@joeyshi12/casper 0.13.2 → 0.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mcp.js +1 -1
- package/dist/server.js +2 -2
- package/dist/web/assets/{abnfDiagram-N423BO3Z-DmQxvVw4.js → abnfDiagram-N423BO3Z-30Vcqagk.js} +1 -1
- package/dist/web/assets/{arc-BfCnlsNy.js → arc-13FWO6K4.js} +1 -1
- package/dist/web/assets/{architectureDiagram-T3A2C74G-BCIJOgq_.js → architectureDiagram-T3A2C74G-bA6MKu_J.js} +1 -1
- package/dist/web/assets/{blockDiagram-VBNYF7ZC-CTvGQX_9.js → blockDiagram-VBNYF7ZC-DD_nvSfk.js} +1 -1
- package/dist/web/assets/{c4Diagram-5PPSVZJV-0VXVo5E_.js → c4Diagram-5PPSVZJV-CspQwqPf.js} +1 -1
- package/dist/web/assets/channel-zLA-uS3t.js +1 -0
- package/dist/web/assets/{chunk-2GRJ4B5K-BoIQHQYk.js → chunk-2GRJ4B5K-COMUfWT0.js} +1 -1
- package/dist/web/assets/{chunk-2Q5K7J3B-D7FFKHN5.js → chunk-2Q5K7J3B-C2Vbexsj.js} +1 -1
- package/dist/web/assets/{chunk-5RXB4S5H-DYZ_rUe6.js → chunk-5RXB4S5H-Cqv3JcaA.js} +1 -1
- package/dist/web/assets/{chunk-5VM5RSS4-CWalyS7e.js → chunk-5VM5RSS4-fFzxxKRB.js} +1 -1
- package/dist/web/assets/{chunk-6Q2QTUOP-DTM4fuqy.js → chunk-6Q2QTUOP-DAQnygvZ.js} +1 -1
- package/dist/web/assets/{chunk-GF5L2VYU-MAdQf-T4.js → chunk-GF5L2VYU-ezr1BU1U.js} +1 -1
- package/dist/web/assets/{chunk-JWPE2WC7-Bb6HsWaR.js → chunk-JWPE2WC7-BHS-xh2p.js} +1 -1
- package/dist/web/assets/{chunk-KBJHAD2P-BRP165Jw.js → chunk-KBJHAD2P-55VCUzfW.js} +1 -1
- package/dist/web/assets/{chunk-RYQCIY6F-CGiilBb3.js → chunk-RYQCIY6F-nNai8l8B.js} +1 -1
- package/dist/web/assets/{chunk-XXDRQBXY-sYl-9_za.js → chunk-XXDRQBXY-_iBwp3f8.js} +1 -1
- package/dist/web/assets/classDiagram-JCYQIIEL-BYkKcsWY.js +1 -0
- package/dist/web/assets/classDiagram-v2-OCEON4UE-BYkKcsWY.js +1 -0
- package/dist/web/assets/{cose-bilkent-JH36ORCC-CjoG_nyu.js → cose-bilkent-JH36ORCC-Ct6E80LC.js} +1 -1
- package/dist/web/assets/{cynefin-VYW2F7L2-CnUF4h5w.js → cynefin-VYW2F7L2-D6zguOZp.js} +1 -1
- package/dist/web/assets/{cynefinDiagram-MW4NZA55-i5rPGS1j.js → cynefinDiagram-MW4NZA55-G0jasyXN.js} +1 -1
- package/dist/web/assets/{dagre-VZM6K2ZE-BixnRL6Q.js → dagre-VZM6K2ZE-B3Qf2XPU.js} +1 -1
- package/dist/web/assets/{diagram-7IWD3JNH-BjmwbikM.js → diagram-7IWD3JNH-ic7TvuIg.js} +1 -1
- package/dist/web/assets/{diagram-B4RE2ZJO-Cj4jQtcL.js → diagram-B4RE2ZJO-Dz8X_bZj.js} +1 -1
- package/dist/web/assets/{diagram-LBJQPF4R-CJeB6DZs.js → diagram-LBJQPF4R-DWgbAos-.js} +1 -1
- package/dist/web/assets/{diagram-Q27KOJAE-D95ZWMOe.js → diagram-Q27KOJAE-C4RD56zJ.js} +1 -1
- package/dist/web/assets/{diagram-UB23O5K3-BCkJCDNd.js → diagram-UB23O5K3-BZGAAwNf.js} +1 -1
- package/dist/web/assets/{ebnfDiagram-BXEA7PRR-DMT2Wg61.js → ebnfDiagram-BXEA7PRR-CDn1qljS.js} +1 -1
- package/dist/web/assets/{erDiagram-JOGREHBK-Dcqf4f5h.js → erDiagram-JOGREHBK-NlTMXy1h.js} +1 -1
- package/dist/web/assets/{flowDiagram-UKHOOZJN-CtrWLLmZ.js → flowDiagram-UKHOOZJN-B13dqBZW.js} +1 -1
- package/dist/web/assets/{ganttDiagram-PKOTCBZU-80jU0FoX.js → ganttDiagram-PKOTCBZU-BpTbSF2T.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-DS77QQ5N-Dgghfsp3.js → gitGraphDiagram-DS77QQ5N-sYdo2HkC.js} +1 -1
- package/dist/web/assets/{index-Dm7Xrwyu.js → index-CtkIu20x.js} +32 -32
- package/dist/web/assets/{index-CQt5Wpu4.js → index-DaPSZyqC.js} +1 -1
- package/dist/web/assets/{infoDiagram-6WML65LV-gri_rl5u.js → infoDiagram-6WML65LV-Dqh_5iqR.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-WSZJBQD7-BdXdkSwq.js → ishikawaDiagram-WSZJBQD7-D5HsAYFO.js} +1 -1
- package/dist/web/assets/{journeyDiagram-NVQOT4AX-CnmGYvzE.js → journeyDiagram-NVQOT4AX-V-A2ogNY.js} +1 -1
- package/dist/web/assets/{kanban-definition-27J2QSJJ-Cl3D6BBs.js → kanban-definition-27J2QSJJ-5DpeX_Ua.js} +1 -1
- package/dist/web/assets/{linear-_4qEY8pC.js → linear-Bzd8_yi_.js} +1 -1
- package/dist/web/assets/{mermaid.core-D9w1JyXU.js → mermaid.core-CbRUo2Lc.js} +4 -4
- package/dist/web/assets/{mindmap-definition-FAOFIHXS-Dz3IQHSl.js → mindmap-definition-FAOFIHXS-BJtUy1k7.js} +1 -1
- package/dist/web/assets/{pegDiagram-VL7TDLO6-CfpCeupV.js → pegDiagram-VL7TDLO6-DVcycUAg.js} +1 -1
- package/dist/web/assets/{pieDiagram-7S7Q4E2Y-b1pb3bg-.js → pieDiagram-7S7Q4E2Y-Cil2lW69.js} +1 -1
- package/dist/web/assets/{quadrantDiagram-CIZ2JOQS-DU5v2RSa.js → quadrantDiagram-CIZ2JOQS-DxLyggwq.js} +1 -1
- package/dist/web/assets/{railroadDiagram-AXF67PYL-CBTJeBnz.js → railroadDiagram-AXF67PYL-DeTmkZdR.js} +1 -1
- package/dist/web/assets/{requirementDiagram-LRYGKXZP-GH8PxhWh.js → requirementDiagram-LRYGKXZP-Bd8yvUue.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-W5VNT64P-D4TRSHIU.js → sankeyDiagram-W5VNT64P-CnOou1Al.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-SI44F4Z6-Bs7Its6h.js → sequenceDiagram-SI44F4Z6-CYYfWPJ4.js} +1 -1
- package/dist/web/assets/{sizeCapture-X5ZJPWSS-DHA8cV0Z.js → sizeCapture-X5ZJPWSS-DFT0I-IO.js} +1 -1
- package/dist/web/assets/{stateDiagram-OKZ733FA-hof5QV2R.js → stateDiagram-OKZ733FA-CE-6WVaF.js} +1 -1
- package/dist/web/assets/stateDiagram-v2-UEYNNEHI-D88Jl38v.js +1 -0
- package/dist/web/assets/{swimlanes-SLNWSIFB-ChntuP1Y.js → swimlanes-SLNWSIFB-DeBY71Su.js} +2 -2
- package/dist/web/assets/swimlanesDiagram-ULZ7WXOC-DbdyFLex.js +8 -0
- package/dist/web/assets/{timeline-definition-Z64GVDOM-CzVm8Plh.js → timeline-definition-Z64GVDOM-BJtiZrl-.js} +1 -1
- package/dist/web/assets/{vennDiagram-T6HMQDX7-i-LDRMKo.js → vennDiagram-T6HMQDX7-O8xDm0fa.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-T6FBY63Y-BFk_vVWu.js → wardleyDiagram-T6FBY63Y-Cd28GGNH.js} +1 -1
- package/dist/web/assets/{xychartDiagram-ELKLHX3M-ColQWIVA.js → xychartDiagram-ELKLHX3M-CX_bZVj2.js} +1 -1
- package/dist/web/index.html +1 -1
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/dist/web/assets/channel-CckQqwvG.js +0 -1
- package/dist/web/assets/classDiagram-JCYQIIEL-agncFfR3.js +0 -1
- package/dist/web/assets/classDiagram-v2-OCEON4UE-agncFfR3.js +0 -1
- package/dist/web/assets/stateDiagram-v2-UEYNNEHI-CIMzASFu.js +0 -1
- package/dist/web/assets/swimlanesDiagram-ULZ7WXOC-CVDa_HOM.js +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DaPSZyqC.js","assets/katex-C5jXJg4s.js","assets/katex-BYZTj3zW.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
var qT=Object.defineProperty;var QT=(e,t,n)=>t in e?qT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Le=(e,t,n)=>QT(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function qc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wl={exports:{}},Na={},Yl={exports:{}},De={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -52,45 +52,45 @@ Error generating stack: `+y.message+`
|
|
|
52
52
|
Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let E=xn(),g;if(t){let R=typeof t=="string"?Oi(t):t;Ke(f==="/"||((P=R.pathname)==null?void 0:P.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 "${R.pathname}" was given in the \`location\` prop.`),g=R}else g=E;let x=g.pathname||"/",b=x;if(f!=="/"){let R=f.replace(/^\//,"").split("/");b="/"+x.replace(/^\//,"").split("/").slice(R.length).join("/")}let S=n&&n.state.matches.length?n.state.matches.map(R=>Object.assign(R,{route:n.manifest[R.route.id]||R.route})):g0(e,{pathname:b});yn(h||S!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),yn(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let A=Y2(S&&S.map(R=>Object.assign({},R,{params:Object.assign({},l,R.params),pathname:gn([f,a.encodeLocation?a.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?f:gn([f,a.encodeLocation?a.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),s,n);return t&&A?v.createElement(Ja.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...g},navigationType:"POP"}},A):A}function H2(){let e=K2(),t=N2(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:o},"ErrorBoundary")," or"," ",v.createElement("code",{style:o},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:s},n):null,l)}var z2=v.createElement(H2,null),R0=class extends v.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=F2(e.digest);n&&(e=n)}let t=e!==void 0?v.createElement(In.Provider,{value:this.props.routeContext},v.createElement(Xc.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement($2,{error:e},t):t}};R0.contextType=N0;var Kl=new WeakMap;function $2({children:e,error:t}){let{basename:n}=v.useContext(Gt);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=M2(t.digest);if(a){let s=Kl.get(t);if(s)throw s;let o=_0(a.location,n),l=o.absoluteURL||o.to;if(I2(l))throw new Error("Invalid redirect location");if(C0&&!Kl.get(t))if(o.isExternal||a.reloadDocument)window.location.href=l;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:a.replace}));throw Kl.set(t,d),d}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l}`})}}return e}function W2({routeContext:e,match:t,children:n}){let a=v.useContext(Di);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(In.Provider,{value:e},n)}function Y2(e,t=[],n){let a=n==null?void 0:n.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let s=e,o=a==null?void 0:a.errors;if(o!=null){let E=s.findIndex(g=>g.route.id&&(o==null?void 0:o[g.route.id])!==void 0);Ke(E>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,E+1))}let l=!1,d=-1;if(n&&a){l=a.renderFallback;for(let E=0;E<s.length;E++){let g=s[E];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(d=E),g.route.id){let{loaderData:x,errors:b}=a,S=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!b||b[g.route.id]===void 0);if(g.route.lazy||S){n.isStatic&&(l=!0),d>=0?s=s.slice(0,d+1):s=[s[0]];break}}}}let f=n==null?void 0:n.onError,h=a&&f?(E,g)=>{var x,b;f(E,{location:a.location,params:((b=(x=a.matches)==null?void 0:x[0])==null?void 0:b.params)??{},pattern:A2(a.matches),errorInfo:g})}:void 0;return s.reduceRight((E,g,x)=>{let b,S=!1,A=null,P=null;a&&(b=o&&g.route.id?o[g.route.id]:void 0,A=g.route.errorElement||z2,l&&(d<0&&x===0?(O0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,P=null):d===x&&(S=!0,P=g.route.hydrateFallbackElement||null)));let R=t.concat(s.slice(0,x+1)),F=()=>{let U;return b?U=A:S?U=P:g.route.Component?U=v.createElement(g.route.Component,null):g.route.element?U=g.route.element:U=E,v.createElement(W2,{match:g,routeContext:{outlet:E,matches:R,isDataRoute:a!=null},children:U})};return a&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?v.createElement(R0,{location:a.location,revalidation:a.revalidation,component:A,error:b,children:F(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:h}):F()},null)}function Zc(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function V2(e){let t=v.useContext(Di);return Ke(t,Zc(e)),t}function q2(e){let t=v.useContext(zu);return Ke(t,Zc(e)),t}function Q2(e){let t=v.useContext(In);return Ke(t,Zc(e)),t}function ed(e){let t=Q2(e),n=t.matches[t.matches.length-1];return Ke(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function G2(){return ed("useRouteId")}function K2(){var a;let e=v.useContext(Xc),t=q2("useRouteError"),n=ed("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function X2(){let{router:e}=V2("useNavigate"),t=ed("useNavigate"),n=v.useRef(!1);return I0(()=>{n.current=!0}),v.useCallback(async(s,o={})=>{yn(n.current,w0),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var Lp={};function O0(e,t,n){!t&&!Lp[e]&&(Lp[e]=!0,yn(!1,n))}v.memo(J2);function J2({routes:e,manifest:t,future:n,state:a,isStatic:s,onError:o}){return L0(e,void 0,{manifest:t,state:a,isStatic:s,onError:o})}function Z2({to:e,replace:t,state:n,relative:a}){Ke(Qr(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=v.useContext(Gt);yn(!s,"<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:o}=v.useContext(In),{pathname:l}=xn(),d=Jc(),f=Hu(e,Kc(o),l,a==="path"),h=JSON.stringify(f);return v.useEffect(()=>{d(JSON.parse(h),{replace:t,state:n,relative:a})},[d,h,a,t,n]),null}function Ai(e){Ke(!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 ey({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:s,static:o=!1,useTransitions:l}){Ke(!Qr(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:d,navigator:s,static:o,useTransitions:l,future:{}}),[d,s,o,l]);typeof n=="string"&&(n=Oi(n));let{pathname:h="/",search:E="",hash:g="",state:x=null,key:b="default",mask:S}=n,A=v.useMemo(()=>{let P=Wn(h,d);return P==null?null:{location:{pathname:P,search:E,hash:g,state:x,key:b,mask:S},navigationType:a}},[d,h,E,g,x,b,a,S]);return yn(A!=null,`<Router basename="${d}"> is not able to match the URL "${h}${E}${g}" because it does not start with the basename, so the <Router> won't render anything.`),A==null?null:v.createElement(Gt.Provider,{value:f},v.createElement(Ja.Provider,{children:t,value:A}))}function ty({children:e,location:t}){return j2(Nc(e),t)}function Nc(e,t=[]){let n=[];return v.Children.forEach(e,(a,s)=>{if(!v.isValidElement(a))return;let o=[...t,s];if(a.type===v.Fragment){n.push.apply(n,Nc(a.props.children,o));return}Ke(a.type===Ai,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ke(!a.props.index||!a.props.children,"An index route cannot have child routes.");let l={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(l.children=Nc(a.props.children,o)),n.push(l)}),n}var Au="get",vu="application/x-www-form-urlencoded";function $u(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function ny(e){return $u(e)&&e.tagName.toLowerCase()==="button"}function ry(e){return $u(e)&&e.tagName.toLowerCase()==="form"}function iy(e){return $u(e)&&e.tagName.toLowerCase()==="input"}function ay(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function sy(e,t){return e.button===0&&(!t||t==="_self")&&!ay(e)}var bu=null;function uy(){if(bu===null)try{new FormData(document.createElement("form"),0),bu=!1}catch{bu=!0}return bu}var oy=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Xl(e){return e!=null&&!oy.has(e)?(yn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${vu}"`),null):e}function ly(e,t){let n,a,s,o,l;if(ry(e)){let d=e.getAttribute("action");a=d?Wn(d,t):null,n=e.getAttribute("method")||Au,s=Xl(e.getAttribute("enctype"))||vu,o=new FormData(e)}else if(ny(e)||iy(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||d.getAttribute("action");if(a=f?Wn(f,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Au,s=Xl(e.getAttribute("formenctype"))||Xl(d.getAttribute("enctype"))||vu,o=new FormData(d,e),!uy()){let{name:h,type:E,value:g}=e;if(E==="image"){let x=h?`${h}.`:"";o.append(`${x}x`,"0"),o.append(`${x}y`,"0")}else h&&o.append(h,g)}}else{if($u(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Au,a=null,s=vu,l=e}return o&&s==="text/plain"&&(l=o,o=void 0),{action:a,method:n.toLowerCase(),encType:s,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function td(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function D0(e,t,n,a){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${a}`:s.pathname=`${s.pathname}.${a}`:s.pathname==="/"?s.pathname=`_root.${a}`:t&&Wn(s.pathname,t)==="/"?s.pathname=`${Ou(t)}/_root.${a}`:s.pathname=`${Ou(s.pathname)}.${a}`,s}async function cy(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 dy(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 fy(e,t,n){let a=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let l=await cy(o,n);return l.links?l.links():[]}return[]}));return gy(a.flat(1).filter(dy).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Rp(e,t,n,a,s,o){let l=(f,h)=>n[h]?f.route.id!==n[h].route.id:!0,d=(f,h)=>{var E;return n[h].pathname!==f.pathname||((E=n[h].route.path)==null?void 0:E.endsWith("*"))&&n[h].params["*"]!==f.params["*"]};return o==="assets"?t.filter((f,h)=>l(f,h)||d(f,h)):o==="data"?t.filter((f,h)=>{var g;let E=a.routes[f.route.id];if(!E||!E.hasLoader)return!1;if(l(f,h)||d(f,h))return!0;if(f.route.shouldRevalidate){let x=f.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function hy(e,t,{includeHydrateFallback:n}={}){return py(e.map(a=>{let s=t.routes[a.route.id];if(!s)return[];let o=[s.module];return s.clientActionModule&&(o=o.concat(s.clientActionModule)),s.clientLoaderModule&&(o=o.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(o=o.concat(s.hydrateFallbackModule)),s.imports&&(o=o.concat(s.imports)),o}).flat(1))}function py(e){return[...new Set(e)]}function my(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function gy(e,t){let n=new Set;return new Set(t),e.reduce((a,s)=>{let o=JSON.stringify(my(s));return n.has(o)||(n.add(o),a.push({key:o,link:s})),a},[])}function nd(){let e=v.useContext(Di);return td(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Ey(){let e=v.useContext(zu);return td(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var rd=v.createContext(void 0);rd.displayName="FrameworkContext";function Wu(){let e=v.useContext(rd);return td(e,"You must render this element inside a <HydratedRouter> element"),e}function Ty(e,t){let n=v.useContext(rd),[a,s]=v.useState(!1),[o,l]=v.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:h,onMouseLeave:E,onTouchStart:g}=t,x=v.useRef(null);v.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let A=R=>{R.forEach(F=>{l(F.isIntersecting)})},P=new IntersectionObserver(A,{threshold:.5});return x.current&&P.observe(x.current),()=>{P.disconnect()}}},[e]),v.useEffect(()=>{if(a){let A=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(A)}}},[a]);let b=()=>{s(!0)},S=()=>{s(!1),l(!1)};return n?e!=="intent"?[o,x,{}]:[o,x,{onFocus:Aa(d,b),onBlur:Aa(f,S),onMouseEnter:Aa(h,b),onMouseLeave:Aa(E,S),onTouchStart:Aa(g,b)}]:[!1,x,{}]}function Aa(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function yy({page:e,...t}){let n=L2(),{nonce:a}=Wu(),{router:s}=nd(),o=v.useMemo(()=>g0(s.routes,e,s.basename),[s.routes,e,s.basename]);return o?(t.nonce==null&&a&&(t={...t,nonce:a}),n?v.createElement(by,{page:e,matches:o,...t}):v.createElement(ky,{page:e,matches:o,...t})):null}function xy(e){let{manifest:t,routeModules:n}=Wu(),[a,s]=v.useState([]);return v.useEffect(()=>{let o=!1;return fy(e,t,n).then(l=>{o||s(l)}),()=>{o=!0}},[e,t,n]),a}function by({page:e,matches:t,...n}){let a=xn(),{future:s}=Wu(),{basename:o}=nd(),l=v.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let d=D0(e,o,s.v8_trailingSlashAwareDataRequests,"rsc"),f=!1,h=[];for(let E of t)typeof E.route.shouldRevalidate=="function"?f=!0:h.push(E.route.id);return f&&h.length>0&&d.searchParams.set("_routes",h.join(",")),[d.pathname+d.search]},[o,s.v8_trailingSlashAwareDataRequests,e,a,t]);return v.createElement(v.Fragment,null,l.map(d=>v.createElement("link",{key:d,rel:"prefetch",as:"fetch",href:d,...n})))}function ky({page:e,matches:t,...n}){let a=xn(),{future:s,manifest:o,routeModules:l}=Wu(),{basename:d}=nd(),{loaderData:f,matches:h}=Ey(),E=v.useMemo(()=>Rp(e,t,h,o,a,"data"),[e,t,h,o,a]),g=v.useMemo(()=>Rp(e,t,h,o,a,"assets"),[e,t,h,o,a]),x=v.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let A=new Set,P=!1;if(t.forEach(F=>{var K;let U=o.routes[F.route.id];!U||!U.hasLoader||(!E.some($=>$.route.id===F.route.id)&&F.route.id in f&&((K=l[F.route.id])!=null&&K.shouldRevalidate)||U.hasClientLoader?P=!0:A.add(F.route.id))}),A.size===0)return[];let R=D0(e,d,s.v8_trailingSlashAwareDataRequests,"data");return P&&A.size>0&&R.searchParams.set("_routes",t.filter(F=>A.has(F.route.id)).map(F=>F.route.id).join(",")),[R.pathname+R.search]},[d,s.v8_trailingSlashAwareDataRequests,f,a,o,E,t,e,l]),b=v.useMemo(()=>hy(g,o),[g,o]),S=xy(g);return v.createElement(v.Fragment,null,x.map(A=>v.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...n})),b.map(A=>v.createElement("link",{key:A,rel:"modulepreload",href:A,...n})),S.map(({key:A,link:P})=>v.createElement("link",{key:A,nonce:n.nonce,...P,crossOrigin:P.crossOrigin??n.crossOrigin})))}function Cy(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var _y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{_y&&(window.__reactRouterVersion="7.18.2")}catch{}function Sy({basename:e,children:t,useTransitions:n,window:a}){let s=v.useRef();s.current==null&&(s.current=i2({window:a,v5Compat:!0}));let o=s.current,[l,d]=v.useState({action:o.action,location:o.location}),f=v.useCallback(h=>{n===!1?d(h):v.startTransition(()=>d(h))},[n]);return v.useLayoutEffect(()=>o.listen(f),[o,f]),v.createElement(ey,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:o,useTransitions:n})}var id=v.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:s,reloadDocument:o,replace:l,mask:d,state:f,target:h,to:E,preventScrollReset:g,viewTransition:x,defaultShouldRevalidate:b,...S},A){let{basename:P,navigator:R,useTransitions:F}=v.useContext(Gt),U=typeof E=="string"&&Gc.test(E),K=_0(E,P);E=K.to;let $=B2(E,{relative:s}),j=xn(),te=null;if(d){let Y=Hu(d,[],j.mask?j.mask.pathname:"/",!0);P!=="/"&&(Y.pathname=Y.pathname==="/"?P:gn([P,Y.pathname])),te=R.createHref(Y)}let[ue,fe,B]=Ty(a,S),ie=wy(E,{replace:l,mask:d,state:f,target:h,preventScrollReset:g,relative:s,viewTransition:x,defaultShouldRevalidate:b,useTransitions:F});function ce(Y){t&&t(Y),Y.defaultPrevented||ie(Y)}let ke=!(K.isExternal||o),de=v.createElement("a",{...S,...B,href:(ke?te:void 0)||K.absoluteURL||$,onClick:ke?ce:t,ref:Cy(A,fe),target:h,"data-discover":!U&&n==="render"?"true":void 0});return ue&&!U?v.createElement(v.Fragment,null,de,v.createElement(yy,{page:$})):de});id.displayName="Link";var Ny=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:s=!1,style:o,to:l,viewTransition:d,children:f,...h},E){let g=Za(l,{relative:h.relative}),x=xn(),b=v.useContext(zu),{navigator:S,basename:A}=v.useContext(Gt),P=b!=null&&Dy(g)&&d===!0,R=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,F=x.pathname,U=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(F=F.toLowerCase(),U=U?U.toLowerCase():null,R=R.toLowerCase()),U&&A&&(U=Wn(U,A)||U);const K=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let $=F===R||!s&&F.startsWith(R)&&F.charAt(K)==="/",j=U!=null&&(U===R||!s&&U.startsWith(R)&&U.charAt(R.length)==="/"),te={isActive:$,isPending:j,isTransitioning:P},ue=$?t:void 0,fe;typeof a=="function"?fe=a(te):fe=[a,$?"active":null,j?"pending":null,P?"transitioning":null].filter(Boolean).join(" ");let B=typeof o=="function"?o(te):o;return v.createElement(id,{...h,"aria-current":ue,className:fe,ref:E,style:B,to:l,viewTransition:d},typeof f=="function"?f(te):f)});Ny.displayName="NavLink";var Ay=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:s,state:o,method:l=Au,action:d,onSubmit:f,relative:h,preventScrollReset:E,viewTransition:g,defaultShouldRevalidate:x,...b},S)=>{let{useTransitions:A}=v.useContext(Gt),P=Ry(),R=Oy(d,{relative:h}),F=l.toLowerCase()==="get"?"get":"post",U=typeof d=="string"&&Gc.test(d),K=$=>{if(f&&f($),$.defaultPrevented)return;$.preventDefault();let j=$.nativeEvent.submitter,te=(j==null?void 0:j.getAttribute("formmethod"))||l,ue=()=>P(j||$.currentTarget,{fetcherKey:t,method:te,navigate:n,replace:s,state:o,relative:h,preventScrollReset:E,viewTransition:g,defaultShouldRevalidate:x});A&&n!==!1?v.startTransition(()=>ue()):ue()};return v.createElement("form",{ref:S,method:F,action:R,onSubmit:a?f:K,...b,"data-discover":!U&&e==="render"?"true":void 0})});Ay.displayName="Form";function vy(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function P0(e){let t=v.useContext(Di);return Ke(t,vy(e)),t}function wy(e,{target:t,replace:n,mask:a,state:s,preventScrollReset:o,relative:l,viewTransition:d,defaultShouldRevalidate:f,useTransitions:h}={}){let E=Jc(),g=xn(),x=Za(e,{relative:l});return v.useCallback(b=>{if(sy(b,t)){b.preventDefault();let S=n!==void 0?n:Ya(g)===Ya(x),A=()=>E(e,{replace:S,mask:a,state:s,preventScrollReset:o,relative:l,viewTransition:d,defaultShouldRevalidate:f});h?v.startTransition(()=>A()):A()}},[g,E,x,n,a,s,t,e,o,l,d,f,h])}var Iy=0,Ly=()=>`__${String(++Iy)}__`;function Ry(){let{router:e}=P0("useSubmit"),{basename:t}=v.useContext(Gt),n=G2(),a=e.fetch,s=e.navigate;return v.useCallback(async(o,l={})=>{let{action:d,method:f,encType:h,formData:E,body:g}=ly(o,t);if(l.navigate===!1){let x=l.fetcherKey||Ly();await a(x,n,l.action||d,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:E,body:g,formMethod:l.method||f,formEncType:l.encType||h,flushSync:l.flushSync})}else await s(l.action||d,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:E,body:g,formMethod:l.method||f,formEncType:l.encType||h,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[a,s,t,n])}function Oy(e,{relative:t}={}){let{basename:n}=v.useContext(Gt),a=v.useContext(In);Ke(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),o={...Za(e||".",{relative:t})},l=xn();if(e==null){o.search=l.search;let d=new URLSearchParams(o.search),f=d.getAll("index");if(f.some(E=>E==="")){d.delete("index"),f.filter(g=>g).forEach(g=>d.append("index",g));let E=d.toString();o.search=E?`?${E}`:""}}return(!e||e===".")&&s.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:gn([n,o.pathname])),Ya(o)}function Dy(e,{relative:t}={}){let n=v.useContext(A0);Ke(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=P0("useViewTransitionState"),s=Za(e,{relative:t});if(!n.isTransitioning)return!1;let o=Wn(n.currentLocation.pathname,a)||n.currentLocation.pathname,l=Wn(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Va(s.pathname,l)!=null||Va(s.pathname,o)!=null}const Op=e=>{let t;const n=new Set,a=(h,E)=>{const g=typeof h=="function"?h(t):h;if(!Object.is(g,t)){const x=t;t=E??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(b=>b(t,x))}},s=()=>t,d={setState:a,getState:s,getInitialState:()=>f,subscribe:h=>(n.add(h),()=>n.delete(h))},f=t=e(a,s,d);return d},Py=(e=>e?Op(e):Op),My=e=>e;function Fy(e,t=My){const n=Pa.useSyncExternalStore(e.subscribe,Pa.useCallback(()=>t(e.getState()),[e,t]),Pa.useCallback(()=>t(e.getInitialState()),[e,t]));return Pa.useDebugValue(n),n}const Dp=e=>{const t=Py(e),n=a=>Fy(t,a);return Object.assign(n,t),n},By=(e=>e?Dp(e):Dp),M0="Attached files: ";function ad(e){return e.split(`
|
|
53
53
|
`).filter(t=>!t.startsWith(M0)).join(`
|
|
54
54
|
`).trim()}function Pp(){return{turnStatus:"idle",contextUsagePercentage:0,compacting:!1}}const Jl=60;function Uy(e){const t=e.filter(o=>o.type==="text").map(o=>o.text).join(`
|
|
55
|
-
`),n=ad(t).replace(/```[\s\S]*?```/g," ").replace(/\s+/g," ").trim();if(!n)return"";if(n.length<=Jl)return n.replace(/[.,;:!?]+$/,"");const a=n.slice(0,Jl),s=a.lastIndexOf(" ");return`${(s>Jl/2?a.slice(0,s):a).replace(/[.,;:!?]+$/,"")}…`}const jy=(e,t)=>t.updatedAt.localeCompare(e.updatedAt);function F0(e,t){const n=e.find(s=>s.chatId===t.chatId),a=n&&n.updatedAt.localeCompare(t.updatedAt)>0?{...t,updatedAt:n.updatedAt}:t;return[...e.filter(s=>s.chatId!==t.chatId),a].sort(jy)}function Hy(e,t,n){const a=e.find(s=>s.chatId===t);return a?F0(e,{...a,updatedAt:n}):e}function B0(e){const t=e.toLowerCase();return t.includes("credential")||t.includes("expired")||t.includes("not authenticated")||t.includes("unauthorized")||t.includes("kiro-cli login")?{title:"Kiro isn't authenticated",fix:"Run `kiro-cli login` on the server, then retry.",sessionWide:!0}:t.includes("a turn is already running")?{title:"A turn is already running",fix:"Wait for the current turn to finish, or stop it first."}:t.includes("enoent")||t.includes("spawn")||t.includes("command not found")?{title:"Couldn't start kiro-cli",fix:"Check that KIRO_BIN points at an executable kiro-cli.",sessionWide:!0}:t.includes("timed out")?{title:"The request timed out"}:{title:"Turn failed"}}const xe=By((e,t)=>({chats:[],models:[],agents:[],defaultAgentId:"kiro_default",activeId:null,chatId:null,loadingChatId:null,modes:[],items:[],appliedSeq:0,remainingOlder:0,observability:Pp(),fsVersion:{},watchedPaths:[],streamingText:"",streamingThought:"",pending:[],chatNotice:null,connStatus:"closed",createError:null,reloadingId:null,previewPath:null,setConnStatus:n=>e({connStatus:n}),setCreateError:n=>e({createError:n}),setReloadingId:n=>e({reloadingId:n}),openFilePreview:n=>e({previewPath:n}),closeFilePreview:()=>e({previewPath:null}),markCancelling:()=>e(n=>n.observability.turnStatus==="running"?{observability:{...n.observability,turnStatus:"cancelling"}}:{}),setCurrentModel:n=>e({currentModelId:n}),setCurrentAgent:n=>e(a=>({currentModeId:n,chats:a.activeId?a.chats.map(s=>s.chatId===a.activeId?{...s,agentId:n}:s):a.chats})),setCompacting:n=>e(a=>a.observability.compacting===n?{}:{observability:{...a.observability,compacting:n}}),markPendingSending:n=>e(a=>({pending:a.pending.map(s=>s.id===n?{...s,status:"sending",error:void 0}:s)})),renameChatRow:(n,a)=>e(s=>({chats:s.chats.map(o=>o.chatId===n?{...o,title:a}:o)})),bumpFsPath:n=>e(a=>({fsVersion:{...a.fsVersion,[n]:(a.fsVersion[n]??0)+1}})),setWatchedPaths:n=>e({watchedPaths:n}),setChats:n=>e({chats:n}),setModels:n=>e({models:n}),setAgents:(n,a)=>e({agents:n,defaultAgentId:a}),setLoadingChat:n=>e({loadingChatId:n}),loadDetail:(n,a)=>e(s=>({activeId:n.summary.chatId,chatId:n.summary.chatId,loadingChatId:null,chats:F0(s.chats,n.summary),modes:n.modes,currentModeId:n.currentModeId,currentModelId:n.summary.modelId,observability:n.observability,items:n.transcript,appliedSeq:n.head,remainingOlder:Math.max(0,n.transcriptTotal-n.transcript.length),streamingText:"",streamingThought:"",pending:a!=null&&a.keepPending?s.pending:[],chatNotice:null})),prependItems:n=>e(a=>({items:[...n,...a.items],remainingOlder:Math.max(0,a.remainingOlder-n.length)})),newChatId:()=>{const n=crypto.randomUUID();return e({chatId:n}),n},clearActive:()=>e({activeId:null,loadingChatId:null,modes:[],items:[],appliedSeq:0,remainingOlder:0,observability:Pp(),streamingText:"",streamingThought:"",pending:[],chatNotice:null,currentModeId:void 0,currentModelId:void 0,previewPath:null}),dismissChatNotice:()=>e({chatNotice:null}),setChatNotice:n=>e({chatNotice:n}),addPending:n=>e(a=>({pending:[...a.pending,{...n,status:"sending"}]})),markPendingFailed:(n,a)=>e(s=>({pending:s.pending.map(o=>o.id===n?{...o,status:"failed",error:a}:o)})),applyEvent:n=>{var o,l,d,f;const a=t(),s=n.payload;if(!(n.seq<=a.appliedSeq))switch(e({appliedSeq:n.seq}),s.kind){case"turn_started":{const h=s.prompt.filter(S=>S.type==="text").map(S=>S.text).join(""),E=ad(h),g=a.pending.findIndex(S=>S.status==="sending"),x=new Date(n.ts).toISOString(),b=Hy(a.chats,n.chatId,x);e({items:[...a.items,{type:"message",message:{id:`u-${n.seq}`,role:"user",text:E,timestamp:n.ts,attachments:s.attachments}}],pending:g===-1?a.pending:a.pending.filter((S,A)=>A!==g),chats:b,streamingText:"",observability:{...a.observability,turnStatus:"running"}});break}case"session_update":{const h=s.update;if(h.sessionUpdate==="agent_message_chunk"){const E=((o=h.content)==null?void 0:o.text)??"";e({streamingText:a.streamingText+E})}else if(h.sessionUpdate==="agent_thought_chunk"){const E=((l=h.content)==null?void 0:l.text)??"";e({streamingThought:a.streamingThought+E})}else if(h.sessionUpdate==="tool_call"){const E=h,g=(f=(d=E._meta)==null?void 0:d.kiro)==null?void 0:f.toolName;e({items:[...Zl(a,`s-${n.seq}`,n.ts),{type:"tool_call",tool:{id:E.toolCallId,name:g,title:E.title??E.toolCallId,kind:E.kind,status:E.status??"pending",input:E.rawInput,content:E.content??[]}}],streamingText:"",streamingThought:""})}else if(h.sessionUpdate==="tool_call_update"){const E=h;e({items:a.items.map(g=>g.type==="tool_call"&&g.tool.id===E.toolCallId?{type:"tool_call",tool:{...g.tool,status:E.status??g.tool.status,output:E.rawOutput??g.tool.output,content:E.content??g.tool.content}}:g)})}break}case"turn_ended":{e({items:Zl(a,`s-${n.seq}`,n.ts),chatNotice:null,streamingText:"",streamingThought:"",observability:{...a.observability,turnStatus:"idle"}});break}case"turn_error":{const h=B0(s.message);e({items:[...Zl(a,`s-${n.seq}`,n.ts),{type:"turn_error",id:`err-${n.seq}`,message:s.message,timestamp:n.ts}],chatNotice:h.sessionWide?{title:h.title,fix:h.fix,detail:s.message}:a.chatNotice,streamingText:"",streamingThought:"",observability:{...a.observability,turnStatus:"idle"}});break}case"metadata":e({observability:{...a.observability,contextUsagePercentage:s.params.contextUsagePercentage??a.observability.contextUsagePercentage}});break;case"compaction":{const h=s.params.status.type!=="started",E=s.params.summary??"";e({observability:{...a.observability,compacting:!h},items:h&&E.trim()?[...a.items,{type:"compaction",id:`c-${n.seq}`,summary:E,timestamp:n.ts}]:a.items});break}case"process_exited":e({observability:{...a.observability,turnStatus:"idle",compacting:!1}});break}}}));function Zl(e,t,n=Date.now()){const a=[...e.items];return e.streamingThought.trim()&&a.push({type:"message",message:{id:`t-${t}`,role:"thinking",text:e.streamingThought,timestamp:n}}),e.streamingText.trim()&&a.push({type:"message",message:{id:`a-${t}`,role:"assistant",text:e.streamingText,timestamp:n}}),a}async function bt(e,t,n){const a={};n!==void 0&&(a["content-type"]="application/json");const s=await fetch(t,{method:e,headers:a,credentials:"same-origin",body:n!==void 0?JSON.stringify(n):void 0});if(s.status===401)throw new Error("Unauthorized");if(!s.ok){const l=await s.text();let d="";try{d=JSON.parse(l).error??""}catch{}throw new Error(d||`${e} ${t} failed (${s.status}): ${l}`)}const o=await s.text();return o?JSON.parse(o):{}}function zy(e){return bt("POST","/api/login",{token:e})}function $y(){return bt("POST","/api/logout")}const dt={devices:()=>bt("GET","/api/devices"),revokeDevice:e=>bt("DELETE",`/api/devices/${e}`),logoutAll:()=>bt("POST","/api/logout-all"),models:()=>bt("GET","/api/models"),agents:()=>bt("GET","/api/agents"),listDirs:e=>bt("GET",`/api/fs/dirs?path=${encodeURIComponent(e)}`),listChats:()=>bt("GET","/api/chats"),createChat:e=>bt("POST","/api/chats",e),getChat:e=>bt("GET",`/api/chats/${e}`),transcriptPage:(e,t,n)=>bt("GET",`/api/chats/${e}/transcript?offset=${t}&limit=${n}`),deleteChat:e=>bt("DELETE",`/api/chats/${e}`),renameChat:(e,t)=>bt("POST",`/api/chats/${e}/rename`,{title:t}),setChatCwd:(e,t)=>bt("POST",`/api/chats/${e}/cwd`,{cwd:t}),reloadChat:e=>bt("POST",`/api/chats/${e}/reload`),tree:(e,t="")=>bt("GET",`/api/chats/${e}/tree?path=${encodeURIComponent(t)}`),downloadUrl:(e,t)=>t.startsWith("/")?`/api/fs/file?download=1&path=${encodeURIComponent(t)}`:`/api/chats/${e}/download?path=${encodeURIComponent(t)}`,previewUrl:(e,t)=>t.startsWith("/")?`/api/fs/file?path=${encodeURIComponent(t)}`:`/api/chats/${e}/preview?path=${encodeURIComponent(t)}`,uploadFiles:async(e,t)=>{const n=new FormData;for(const s of t)n.append("files",s,s.name);const a=await fetch(`/api/chats/${encodeURIComponent(e)}/uploads`,{method:"POST",credentials:"same-origin",body:n});if(a.status===401)throw new Error("Unauthorized");if(!a.ok){const s=await a.text();throw new Error(`Upload failed (${a.status}): ${s}`)}return await a.json()}},wu={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},Wy=8e3,U0=25e3,Yy=1e4;function Mp(e){return e.state===void 0||e.state===wu.CLOSED||e.state===wu.CLOSING?!0:e.state===wu.CONNECTING?e.now-e.connectingSince>Wy:e.now-e.lastMessageAt>U0+Yy}function Vy(e){return e.state===wu.OPEN&&e.now-e.lastMessageAt>U0}const qy=1008;class Qy{constructor(t,n,a=0){Le(this,"ws",null);Le(this,"cursor",0);Le(this,"closedByUser",!1);Le(this,"backoff",500);Le(this,"reconnectTimer",null);Le(this,"connectingSince",0);Le(this,"lastMessageAt",0);Le(this,"watchdog",null);Le(this,"eager",()=>{this.closedByUser||Mp(this.sample())&&this.connect()});Le(this,"onVisibility",()=>{document.visibilityState==="visible"&&this.eager()});this.chatId=t,this.handlers=n,this.cursor=a,window.addEventListener("online",this.eager),document.addEventListener("visibilitychange",this.onVisibility)}sample(){var t;return{state:(t=this.ws)==null?void 0:t.readyState,connectingSince:this.connectingSince,lastMessageAt:this.lastMessageAt,now:Date.now()}}startWatchdog(){this.watchdog===null&&(this.watchdog=window.setInterval(()=>{if(this.closedByUser)return;const t=this.sample();Mp(t)?this.connect():Vy(t)&&this.send({type:"ping"})},5e3))}reset(t){this.cursor=t}connect(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;t&&(this.ws=null,t.onopen=null,t.onmessage=null,t.onclose=null,t.onerror=null,(t.readyState===WebSocket.OPEN||t.readyState===WebSocket.CONNECTING)&&t.close()),this.connectingSince=Date.now(),this.lastMessageAt=Date.now(),this.startWatchdog(),this.handlers.onStatus(this.cursor>0?"reconnecting":"connecting");const a=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws?chatId=${encodeURIComponent(this.chatId)}&cursor=${this.cursor}`,s=new WebSocket(a);this.ws=s,s.onopen=()=>{this.ws===s&&(this.backoff=500,this.handlers.onStatus("replaying"))},s.onmessage=o=>{var d,f,h,E,g,x;if(this.ws!==s)return;this.lastMessageAt=Date.now();const l=JSON.parse(o.data);switch(l.type){case"event":l.event.seq>this.cursor&&(this.cursor=l.event.seq,this.handlers.onEvent(l.event));break;case"replay_complete":this.handlers.onStatus("connected");break;case"resync":this.handlers.onStatus("resyncing"),this.handlers.onResync();break;case"ack":(f=(d=this.handlers).onAck)==null||f.call(d,l.action,l.ok,l.error);break;case"error":console.warn("ws error:",l.message),(E=(h=this.handlers).onServerError)==null||E.call(h,l.message);break;case"fs_changed":(x=(g=this.handlers).onFsChanged)==null||x.call(g,l.path);break}},s.onclose=o=>{var l,d;if(this.ws===s){if(this.closedByUser){this.handlers.onStatus("closed");return}if(o.code===qy){this.closedByUser=!0,this.handlers.onStatus("closed"),(d=(l=this.handlers).onUnauthorized)==null||d.call(l);return}this.handlers.onStatus("reconnecting"),this.reconnectTimer=window.setTimeout(()=>this.connect(),this.backoff),this.backoff=Math.min(this.backoff*1.7,1e4)}},s.onerror=()=>{this.ws===s&&s.close()}}send(t){var n;return((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN?(this.ws.send(JSON.stringify(t)),!0):!1}prompt(t,n){return this.send({type:"prompt",content:t,attachments:n})}cancel(){this.send({type:"cancel"})}setMode(t){this.send({type:"set_mode",modeId:t})}setModel(t){this.send({type:"set_model",modelId:t})}watchPaths(t){this.send({type:"watch_paths",paths:t})}execCommand(t){this.send({type:"exec_command",command:t})}close(){this.closedByUser=!0,window.removeEventListener("online",this.eager),document.removeEventListener("visibilitychange",this.onVisibility),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.watchdog!==null&&(clearInterval(this.watchdog),this.watchdog=null);const t=this.ws;this.ws=null,t&&(t.onopen=null,t.onmessage=null,t.onclose=null,t.onerror=null,t.close())}}const j0="/chats",H0=`${j0}/:chatId`;function z0(e){return`${j0}/${encodeURIComponent(e)}`}const sd="/new",Gy={prompt:"Message",cancel:"Stop",set_mode:"Agent change",set_model:"Model change",exec_command:"Command"};class Ky{constructor(t={}){Le(this,"api");Le(this,"createSocket");Le(this,"listCoalesceMs");Le(this,"turnEndedRefreshMs");Le(this,"compactTimeoutMs");Le(this,"host",null);Le(this,"socket",null);Le(this,"openTarget",null);Le(this,"handledRoute");Le(this,"isDraft",!1);Le(this,"lastSent",null);Le(this,"msgSeq",0);Le(this,"firstPrompt",null);Le(this,"lastCreateOpts",null);Le(this,"listSeq",0);Le(this,"listTimer",null);this.api=t.api??dt,this.createSocket=t.createSocket??((n,a,s)=>new Qy(n,a,s)),this.listCoalesceMs=t.listCoalesceMs??150,this.turnEndedRefreshMs=t.turnEndedRefreshMs??1200,this.compactTimeoutMs=t.compactTimeoutMs??12e4}attach(t){this.host=t}get state(){return xe.getState()}refreshSessions(){this.listTimer===null&&(this.listTimer=setTimeout(()=>{this.listTimer=null;const t=++this.listSeq;this.api.listChats().then(n=>{t===this.listSeq&&this.state.setChats(n.chats)}).catch(()=>{})},this.listCoalesceMs))}loadPickers(){this.api.models().then(t=>this.state.setModels(t.models)).catch(()=>{}),this.api.agents().then(t=>this.state.setAgents(t.agents,t.defaultAgentId)).catch(()=>{})}syncRoute(t,n){if(this.isDraft=n,n&&!this.state.chatId&&this.state.newChatId(),this.handledRoute!==t)if(this.handledRoute=t,t)this.openChat(t);else{this.openTarget=null,this.closeSocket();const a=this.state.activeId===null&&this.state.chatId!==null;this.state.clearActive(),a||this.state.newChatId(),this.refreshSessions()}}closeSocket(){var t;(t=this.socket)==null||t.close(),this.socket=null}async openChat(t,n){var s;if(this.state.activeId===t)return;this.openTarget=t,this.closeSocket(),this.state.setConnStatus("connecting"),n||this.state.setLoadingChat(t);let a;if(n)a=n;else try{a=await this.api.getChat(t)}catch(o){if(this.openTarget!==t)return;this.state.setConnStatus("closed"),this.state.setLoadingChat(null),console.error("open session failed:",o),(s=this.host)==null||s.navigate("/",{replace:!0});return}this.openTarget===t&&(this.state.loadDetail(a,{keepPending:!!n}),this.socket=this.createSocket(t,this.socketHandlers(t),a.head),this.socket.connect())}socketHandlers(t){return{onEvent:n=>{this.state.applyEvent(n),n.payload.kind==="turn_started"&&this.refreshSessions(),n.payload.kind==="turn_ended"&&setTimeout(()=>this.refreshSessions(),this.turnEndedRefreshMs)},onStatus:n=>{if(this.state.setConnStatus(n),n==="connected"&&this.firstPrompt){const a=this.firstPrompt;this.firstPrompt=null,this.deliver(a.id,a.content,a.attachments)}},onResync:async()=>{var a;const n=await this.api.getChat(t);this.openTarget===t&&(this.state.loadDetail(n),(a=this.socket)==null||a.reset(n.head))},onAck:(n,a,s)=>{if(a)return;const o=s??"The server rejected the request.";if(n==="prompt"){this.lastSent&&this.state.markPendingFailed(this.lastSent,o);return}console.error(`${Gy[n]??n} rejected:`,o)},onFsChanged:n=>this.state.bumpFsPath(n),onUnauthorized:()=>{var n;this.closeSocket(),this.state.clearActive(),(n=this.host)==null||n.onLock()},onServerError:n=>{console.error("server error:",n)}}}async createChat(t){var n;this.closeSocket(),this.state.setConnStatus("connecting"),this.state.setCreateError(null),this.lastCreateOpts=t;try{const a=await this.api.createChat({chatId:this.state.chatId??void 0,cwd:t.cwd||void 0,agentId:t.agentId,modelId:t.modelId,freshWorkspace:!t.cwd});this.refreshSessions();const s=a.summary.chatId;return this.handledRoute=s,this.isDraft=!1,(n=this.host)==null||n.navigate(z0(s)),this.openChat(s,a),!0}catch(a){return this.state.setConnStatus("closed"),this.state.setCreateError(a instanceof Error?a.message:"Failed to create session"),!1}}retryCreate(){this.lastCreateOpts&&this.createChat(this.lastCreateOpts)}dismissCreateError(){var t;this.state.setCreateError(null),(t=this.host)==null||t.navigate("/")}startDraft(){var t;this.openTarget=null,this.closeSocket(),this.state.clearActive(),this.state.newChatId(),this.state.setCreateError(null),(t=this.host)==null||t.navigate(sd)}send(t,n){const a=`pending-${this.msgSeq++}`,s=ad(t.filter(o=>o.type==="text").map(o=>o.text).join(`
|
|
56
|
-
`));if(this.state.addPending({id:a,text:s,attachments:n,content:t}),this.isDraft){const{currentModeId:o,currentModelId:l}=this.state;this.createChat({agentId:o,modelId:l,title:Uy(t)}).then(d=>{d?this.firstPrompt={id:a,content:t,attachments:n}:this.state.markPendingFailed(a,"Could not start the session.")});return}this.deliver(a,t,n)}deliver(t,n,a){var s;this.lastSent=t,!((s=this.socket)!=null&&s.prompt(n,a))&&this.state.markPendingFailed(t,this.socket?"Not connected to the server - reconnecting. Retry once the status dot is green.":"No active session socket.")}retrySend(t){const n=this.state.pending.find(a=>a.id===t);n&&(this.state.markPendingSending(t),this.deliver(t,n.content,n.attachments))}retryTurn(t){this.send([{type:"text",text:t}])}cancel(){var t;(t=this.socket)==null||t.cancel(),this.state.markCancelling()}changeModel(t){var n;(n=this.socket)==null||n.setModel(t),this.state.setCurrentModel(t)}changeAgent(t){var n;(n=this.socket)==null||n.setMode(t),this.state.setCurrentAgent(t)}compact(){var t;(t=this.socket)==null||t.execCommand("compact"),this.state.setCompacting(!0),setTimeout(()=>this.state.setCompacting(!1),this.compactTimeoutMs)}async reloadChat(){var n;const t=this.state.activeId;if(!(!t||this.state.reloadingId===t)){this.state.setReloadingId(t);try{const a=await this.api.reloadChat(t);if(this.state.activeId!==t)return;this.state.loadDetail(a),(n=this.socket)==null||n.reset(a.head),this.loadPickers()}catch(a){if(this.state.activeId!==t)return;const s=a instanceof Error?a.message:"The server rejected the reload.";this.state.setChatNotice({title:"Couldn't reload the session",fix:s,detail:s})}finally{this.state.reloadingId===t&&this.state.setReloadingId(null)}}}watchPaths(t){var n;(n=this.socket)==null||n.watchPaths(t)}async deleteChat(t){var n;try{await this.api.deleteChat(t)}catch{console.error("delete session failed"),this.refreshSessions();return}this.state.activeId===t?(n=this.host)==null||n.navigate("/"):this.refreshSessions()}async renameChat(t,n){this.state.renameChatRow(t,n),await this.api.renameChat(t,n).catch(()=>{console.error("rename session failed")}),this.refreshSessions()}markLoading(t){t!==this.state.activeId&&this.state.setLoadingChat(t)}lock(){var t,n;this.closeSocket(),this.state.clearActive(),(t=this.host)==null||t.navigate("/",{replace:!0}),(n=this.host)==null||n.onLock()}get canSend(){return this.isDraft||xe.getState().activeId!==null}}const nt=new Ky;function $0(e){const t=e.trim().slice(0,4e3);return!t||!nt.canSend?!1:(nt.send([{type:"text",text:t}]),!0)}function Yu({size:e=14,className:t}){return T.jsx("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:T.jsx("polyline",{points:"6 9 12 15 18 9"})})}function Xy({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[T.jsx("circle",{cx:"4",cy:"12",r:"1.8"}),T.jsx("circle",{cx:"12",cy:"12",r:"1.8"}),T.jsx("circle",{cx:"20",cy:"12",r:"1.8"})]})}function Jy({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[T.jsx("circle",{cx:"12",cy:"5",r:"1.9"}),T.jsx("circle",{cx:"12",cy:"12",r:"1.9"}),T.jsx("circle",{cx:"12",cy:"19",r:"1.9"})]})}function Zy({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M20 11a8 8 0 0 0-13.6-4.5L3 9"}),T.jsx("polyline",{points:"3 4 3 9 8 9"}),T.jsx("path",{d:"M4 13a8 8 0 0 0 13.6 4.5L21 15"}),T.jsx("polyline",{points:"21 20 21 15 16 15"})]})}function ud({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function ex({size:e=16,className:t}){return T.jsx("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:T.jsx("polyline",{points:"20 6 9 17 4 12"})})}function W0({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"}),T.jsx("line",{x1:"12",y1:"9.5",x2:"12",y2:"13.5"}),T.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]})}function tx({size:e=18,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("rect",{x:"4",y:"11",width:"16",height:"10",rx:"2"}),T.jsx("path",{d:"M8 11V7a4 4 0 0 1 8 0v4"})]})}function yr({size:e=28,className:t}){return T.jsx("svg",{className:`spinner ${t??""}`,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round","aria-hidden":!0,children:T.jsx("path",{d:"M12 3a9 9 0 1 0 9 9"})})}function nx({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M12 19V5"}),T.jsx("path",{d:"m5 12 7-7 7 7"})]})}function Fp({size:e=16,className:t}){return T.jsx("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none","aria-hidden":!0,children:T.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}function Y0({size:e=20,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),T.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function V0({size:e=20,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("circle",{cx:"11",cy:"11",r:"7"}),T.jsx("line",{x1:"21",y1:"21",x2:"16.5",y2:"16.5"})]})}function q0({size:e=16,className:t}){return T.jsx("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:T.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function rx({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2v1"}),T.jsx("path",{d:"M2 10l2.5 9h15l2.5-9H7.5"})]})}function Q0({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),T.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function Bp({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),T.jsx("polyline",{points:"14 2 14 8 20 8"}),T.jsx("polyline",{points:"9 15 7 13 9 11"}),T.jsx("polyline",{points:"15 11 17 13 15 15"})]})}function ix({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),T.jsx("polyline",{points:"14 2 14 8 20 8"}),T.jsx("circle",{cx:"12",cy:"15",r:"2"}),T.jsx("path",{d:"M12 11v2"}),T.jsx("path",{d:"M12 17v1"})]})}function ax({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),T.jsx("polyline",{points:"14 2 14 8 20 8"}),T.jsx("line",{x1:"8",y1:"13",x2:"16",y2:"13"}),T.jsx("line",{x1:"8",y1:"17",x2:"14",y2:"17"})]})}function sx({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),T.jsx("polyline",{points:"14 2 14 8 20 8"}),T.jsx("circle",{cx:"10",cy:"14",r:"2"}),T.jsx("path",{d:"M20 17l-3-3-5 5"})]})}function ux({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),T.jsx("polyline",{points:"14 2 14 8 20 8"}),T.jsx("path",{d:"M8 13h3v3H8z"}),T.jsx("line",{x1:"14",y1:"13",x2:"16",y2:"13"}),T.jsx("line",{x1:"14",y1:"16",x2:"16",y2:"16"})]})}function ox({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),T.jsx("polyline",{points:"14 2 14 8 20 8"}),T.jsx("polyline",{points:"8 15 10 13 8 11"}),T.jsx("line",{x1:"12",y1:"16",x2:"16",y2:"16"})]})}function lx({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),T.jsx("polyline",{points:"7 10 12 15 17 10"}),T.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function ec({size:e=20,className:t}){return T.jsx("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:T.jsx("path",{d:"M4 7h16M4 12h16M4 17h10"})})}function cx({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),T.jsx("line",{x1:"9",y1:"14",x2:"15",y2:"14"}),T.jsx("line",{x1:"9",y1:"18",x2:"13",y2:"18"})]})}function dx({size:e=18,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("polyline",{points:"4 14 10 14 10 20"}),T.jsx("polyline",{points:"20 10 14 10 14 4"}),T.jsx("line",{x1:"14",y1:"10",x2:"21",y2:"3"}),T.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]})}function fx({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z"}),T.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function hx({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("polyline",{points:"16 18 22 12 16 6"}),T.jsx("polyline",{points:"8 6 2 12 8 18"})]})}function px({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("polyline",{points:"15 3 21 3 21 9"}),T.jsx("polyline",{points:"9 21 3 21 3 15"}),T.jsx("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),T.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]})}function mx({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("polyline",{points:"4 14 10 14 10 20"}),T.jsx("polyline",{points:"20 10 14 10 14 4"}),T.jsx("line",{x1:"14",y1:"10",x2:"21",y2:"3"}),T.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]})}var es=p0();const va=8,Up=6;function G0({anchor:e,onClose:t,children:n}){const a=v.useRef(null),[s,o]=v.useState(null);return v.useLayoutEffect(()=>{const l=a.current;if(!e||!l)return;const d=e.getBoundingClientRect(),f=l.getBoundingClientRect(),h=d.bottom+Up,g=h+f.height+va<=window.innerHeight?h:Math.max(va,d.top-Up-f.height),x=Math.min(Math.max(va,d.right-f.width),Math.max(va,window.innerWidth-f.width-va));o({top:g,left:x})},[e]),v.useEffect(()=>{const l=h=>{var g;const E=h.target;(g=a.current)!=null&&g.contains(E)||e!=null&&e.contains(E)||t()},d=h=>{h.key==="Escape"&&t()};document.addEventListener("mousedown",l),document.addEventListener("keydown",d);const f={capture:!0,passive:!0};return window.addEventListener("scroll",t,f),window.addEventListener("resize",t),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",d),window.removeEventListener("scroll",t,f),window.removeEventListener("resize",t)}},[e,t]),es.createPortal(T.jsx("div",{ref:a,className:"menu-list menu-list-floating",role:"menu",style:s?{top:s.top,left:s.left}:{visibility:"hidden"},children:n}),document.body)}function gx(e,t){const n=e.trim().toLowerCase();if(!n)return 0;const a=t.toLowerCase();let s=0,o=0,l=-2;for(let d=0;d<n.length;d++){const f=n[d],h=a.indexOf(f,o);if(h===-1)return-1;s+=1,h===l+1&&(s+=3),(h===0||/\s|[-_/.]/.test(a[h-1]??""))&&(s+=2),l=h,o=h+1}return s}function Ex({sessions:e,onOpen:t,onClose:n}){const[a,s]=v.useState(""),[o,l]=v.useState(0),d=v.useRef(null);v.useEffect(()=>{var g;(g=d.current)==null||g.focus()},[]);const f=v.useMemo(()=>a.trim()?e.map(g=>({s:g,score:gx(a,g.title)})).filter(g=>g.score>=0).sort((g,x)=>x.score-g.score).map(g=>g.s):e.slice(0,50),[e,a]);v.useEffect(()=>{l(0)},[a]);const h=g=>{t(g),n()},E=g=>{if(g.key==="Escape")n();else if(g.key==="ArrowDown")g.preventDefault(),l(x=>Math.min(x+1,f.length-1));else if(g.key==="ArrowUp")g.preventDefault(),l(x=>Math.max(x-1,0));else if(g.key==="Enter"){g.preventDefault();const x=f[o];x&&h(x.chatId)}};return es.createPortal(T.jsx("div",{className:"search-backdrop",onClick:n,children:T.jsxs("div",{className:"search-modal",role:"dialog","aria-label":"Search sessions",onClick:g=>g.stopPropagation(),children:[T.jsxs("div",{className:"search-field",children:[T.jsx(V0,{size:20,className:"search-field-icon"}),T.jsx("input",{ref:d,className:"search-modal-input",value:a,placeholder:"Search sessions…",onChange:g=>s(g.target.value),onKeyDown:E}),T.jsx("kbd",{className:"search-esc",children:"esc"})]}),T.jsx("div",{className:"search-results",children:f.length===0?T.jsx("p",{className:"search-empty",children:a.trim()?`No sessions match "${a}".`:"No sessions yet."}):f.map((g,x)=>T.jsxs("button",{className:`search-result ${x===o?"is-active":""}`,onMouseEnter:()=>l(x),onClick:()=>h(g.chatId),children:[T.jsx("span",{className:"search-result-title",children:g.title}),T.jsx("span",{className:"search-result-agent",children:g.agentId??"kiro_default"})]},g.chatId))})]})}),document.body)}function K0(e,t=!1){const n=Date.parse(e);if(Number.isNaN(n))return"";const a=Math.round((Date.now()-n)/6e4),s=l=>t?`${l} ago`:l;if(a<1)return t?"just now":"now";if(a<60)return s(`${a}m`);const o=Math.round(a/60);return o<24?s(`${o}h`):s(`${Math.round(o/24)}d`)}function Tx(e){if(!e)return"Unknown device";const t=/iPhone|iPad/.test(e)?"iOS":/Android/.test(e)?"Android":/Macintosh|Mac OS/.test(e)?"macOS":/Windows/.test(e)?"Windows":/Linux/.test(e)?"Linux":"Device",n=/Firefox/.test(e)?"Firefox":/Edg\//.test(e)?"Edge":/Chrome/.test(e)?"Chrome":/Safari/.test(e)?"Safari":"";return n?`${t} · ${n}`:t}function yx({onClose:e,onSelfRevoked:t}){const[n,a]=v.useState(null),[s,o]=v.useState(!1),l=()=>dt.devices().then(h=>a(h.devices)).catch(()=>a([]));v.useEffect(()=>{l()},[]);const d=async h=>{o(!0);try{if(await dt.revokeDevice(h.id),h.current){t();return}await l()}finally{o(!1)}},f=async()=>{o(!0);try{await dt.logoutAll(),t()}finally{o(!1)}};return es.createPortal(T.jsx("div",{className:"search-backdrop",onClick:e,children:T.jsxs("div",{className:"search-modal",role:"dialog","aria-label":"Logged-in devices",onClick:h=>h.stopPropagation(),children:[T.jsxs("div",{className:"devices-head",children:[T.jsx("span",{className:"devices-title",children:"Logged-in devices"}),T.jsx("button",{className:"btn-ghost",onClick:e,children:"Close"})]}),T.jsx("div",{className:"devices-list",children:n===null?T.jsx("p",{className:"search-empty",children:"Loading…"}):n.length===0?T.jsx("p",{className:"search-empty",children:"No active devices."}):n.map(h=>T.jsxs("div",{className:"device-row",children:[T.jsxs("span",{className:"device-main",children:[T.jsxs("span",{className:"device-name",children:[Tx(h.userAgent),h.current&&T.jsx("span",{className:"device-badge",children:"This device"})]}),T.jsxs("span",{className:"device-sub",children:["Active ",K0(h.lastSeenAt,!0)]})]}),T.jsx("button",{className:"btn-ghost device-revoke",disabled:s,onClick:()=>d(h),children:h.current?"Log out":"Revoke"})]},h.id))}),n&&n.length>1&&T.jsx("div",{className:"devices-foot",children:T.jsx("button",{className:"btn-ghost device-revoke",disabled:s,onClick:f,children:"Log out all devices"})})]})}),document.body)}function xx({title:e,message:t,confirmLabel:n="Confirm",danger:a=!1,onConfirm:s,onCancel:o}){return v.useEffect(()=>{const l=d=>{d.key==="Escape"&&o()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[o]),es.createPortal(T.jsx("div",{className:"confirm-backdrop",onClick:l=>{l.target===l.currentTarget&&o()},children:T.jsxs("div",{className:"confirm-modal",role:"dialog","aria-modal":"true","aria-label":e,children:[T.jsx("h3",{className:"confirm-title",children:e}),t&&T.jsx("p",{className:"confirm-message",children:t}),T.jsxs("div",{className:"confirm-actions",children:[T.jsx("button",{className:"btn-ghost",onClick:o,children:"Cancel"}),T.jsx("button",{className:a?"btn-danger":"btn-primary",onClick:s,autoFocus:!0,children:n})]})]})}),document.body)}function bx({sessions:e,activeId:t,loadingId:n,onOpen:a,onNew:s,onDelete:o,onRename:l,onLock:d}){const[f,h]=v.useState(!1),[E,g]=v.useState(!1),[x,b]=v.useState(!1),[S,A]=v.useState(null),[P,R]=v.useState(null),[F,U]=v.useState(null),[K,$]=v.useState(null),[j,te]=v.useState(""),ue=v.useCallback(()=>{A(null),R(null)},[]);v.useEffect(()=>{if(!x)return;const B=()=>b(!1);return document.addEventListener("click",B),()=>document.removeEventListener("click",B)},[x]);const fe=B=>{const ie=j.trim();ie&&l(B,ie),$(null)};return T.jsxs("aside",{className:"sidebar",children:[T.jsxs("header",{className:"sidebar-head",children:[T.jsxs("span",{className:"brand",children:[T.jsx("img",{className:"brand-logo",src:"/logo.svg",alt:""}),T.jsx("span",{className:"wordmark",children:"Casper"})]}),T.jsxs("div",{className:"sidebar-actions",children:[T.jsxs("div",{className:"account-menu",children:[T.jsx("button",{className:"iconbtn iconbtn-lg","aria-label":"Account",title:"Account",onClick:B=>{B.stopPropagation(),b(ie=>!ie)},children:T.jsx(tx,{size:18})}),x&&T.jsxs("div",{className:"menu-list",onClick:B=>B.stopPropagation(),children:[T.jsx("button",{className:"menu-item",onClick:()=>{b(!1),g(!0)},children:"Devices"}),T.jsx("button",{className:"menu-item",onClick:()=>{b(!1),d()},children:"Lock app"})]})]}),T.jsx("button",{className:"iconbtn iconbtn-lg","aria-label":"Search sessions",onClick:()=>h(!0),children:T.jsx(V0,{size:20})}),T.jsx("button",{className:"iconbtn iconbtn-lg","aria-label":"New session",title:"New session",onClick:s,children:T.jsx(Y0,{size:20})})]})]}),T.jsx("div",{className:"sidebar-list",children:e.length===0?T.jsx("p",{className:"sidebar-empty",children:"No sessions yet. Start one and it keeps running while you're away."}):e.map(B=>T.jsxs("div",{className:`srow ${B.chatId===t?"is-active":""} ${S===B.chatId?"is-menu-open":""}`,children:[K===B.chatId?T.jsx("input",{className:"srow-rename",autoFocus:!0,onFocus:ie=>ie.currentTarget.select(),value:j,onChange:ie=>te(ie.target.value),onBlur:()=>fe(B.chatId),onKeyDown:ie=>{ie.key==="Enter"&&fe(B.chatId),ie.key==="Escape"&&$(null)},onClick:ie=>ie.stopPropagation()}):T.jsx(id,{className:"srow-open",to:z0(B.chatId),onClick:ie=>{ie.metaKey||ie.ctrlKey||ie.shiftKey||ie.altKey||a(B.chatId)},children:T.jsxs("span",{className:"srow-main",children:[T.jsx("span",{className:"srow-title",title:B.title,children:B.title}),T.jsxs("span",{className:"srow-sub",children:[T.jsx("span",{className:"srow-agent",children:B.agentId??"kiro_default"}),T.jsx("span",{className:"srow-dot",children:"·"}),n===B.chatId&&T.jsx(yr,{size:11,className:"srow-spinner"}),T.jsx("span",{className:"srow-when",children:K0(B.updatedAt)})]})]})}),T.jsxs("div",{className:"srow-menu",children:[T.jsx("button",{className:"iconbtn srow-menu-btn","aria-label":"Session actions","aria-haspopup":"menu","aria-expanded":S===B.chatId,onClick:ie=>{ie.stopPropagation();const ce=S===B.chatId;R(ce?null:ie.currentTarget),A(ce?null:B.chatId)},children:T.jsx(Jy,{size:16})}),S===B.chatId&&T.jsxs(G0,{anchor:P,onClose:ue,children:[T.jsx("button",{className:"menu-item",onClick:()=>{te(B.title),$(B.chatId),ue()},children:"Rename"}),T.jsx("button",{className:"menu-item menu-item-danger",onClick:()=>{ue(),U(B.chatId)},children:"Delete"})]})]})]},B.chatId))}),f&&T.jsx(Ex,{sessions:e,onOpen:a,onClose:()=>h(!1)}),E&&T.jsx(yx,{onClose:()=>g(!1),onSelfRevoked:()=>{g(!1),d()}}),F&&T.jsx(xx,{title:"Delete session?",message:"This session and its history will be permanently deleted. This can't be undone.",confirmLabel:"Delete",danger:!0,onConfirm:()=>{const B=F;U(null),o(B)},onCancel:()=>U(null)})]})}function X0(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}const kx="modulepreload",Cx=function(e){return"/"+e},jp={},Ac=function(t,n,a){let s=Promise.resolve();if(n&&n.length>0){let l=function(h){return Promise.all(h.map(E=>Promise.resolve(E).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));s=l(n.map(h=>{if(h=Cx(h),h in jp)return;jp[h]=!0;const E=h.endsWith(".css"),g=E?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const x=document.createElement("link");if(x.rel=E?"stylesheet":kx,E||(x.as="script"),x.crossOrigin="",x.href=h,f&&x.setAttribute("nonce",f),document.head.appendChild(x),E)return new Promise((b,S)=>{x.addEventListener("load",b),x.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(l){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=l,window.dispatchEvent(d),!d.defaultPrevented)throw l}return s.then(l=>{for(const d of l||[])d.status==="rejected"&&o(d.reason);return t().catch(o)})};function Hp(e){const t=[],n=String(e||"");let a=n.indexOf(","),s=0,o=!1;for(;!o;){a===-1&&(a=n.length,o=!0);const l=n.slice(s,a).trim();(l||!o)&&t.push(l),s=a+1,a=n.indexOf(",",s)}return t}function J0(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const _x=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Sx=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Nx={};function zp(e,t){return(Nx.jsx?Sx:_x).test(e)}const Ax=/[ \t\n\f\r]/g;function vx(e){return typeof e=="object"?e.type==="text"?$p(e.value):!1:$p(e)}function $p(e){return e.replace(Ax,"")===""}class ts{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}ts.prototype.normal={};ts.prototype.property={};ts.prototype.space=void 0;function Z0(e,t){const n={},a={};for(const s of e)Object.assign(n,s.property),Object.assign(a,s.normal);return new ts(n,a,t)}function qa(e){return e.toLowerCase()}class Ht{constructor(t,n){this.attribute=n,this.property=t}}Ht.prototype.attribute="";Ht.prototype.booleanish=!1;Ht.prototype.boolean=!1;Ht.prototype.commaOrSpaceSeparated=!1;Ht.prototype.commaSeparated=!1;Ht.prototype.defined=!1;Ht.prototype.mustUseProperty=!1;Ht.prototype.number=!1;Ht.prototype.overloadedBoolean=!1;Ht.prototype.property="";Ht.prototype.spaceSeparated=!1;Ht.prototype.space=void 0;let wx=0;const we=Gr(),ot=Gr(),vc=Gr(),ae=Gr(),Ye=Gr(),Wr=Gr(),qt=Gr();function Gr(){return 2**++wx}const wc=Object.freeze(Object.defineProperty({__proto__:null,boolean:we,booleanish:ot,commaOrSpaceSeparated:qt,commaSeparated:Wr,number:ae,overloadedBoolean:vc,spaceSeparated:Ye},Symbol.toStringTag,{value:"Module"})),tc=Object.keys(wc);class od extends Ht{constructor(t,n,a,s){let o=-1;if(super(t,n),Wp(this,"space",s),typeof a=="number")for(;++o<tc.length;){const l=tc[o];Wp(this,tc[o],(a&wc[l])===wc[l])}}}od.prototype.defined=!0;function Wp(e,t,n){n&&(e[t]=n)}function Pi(e){const t={},n={};for(const[a,s]of Object.entries(e.properties)){const o=new od(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[qa(a)]=a,n[qa(o.attribute)]=a}return new ts(t,n,e.space)}const e1=Pi({properties:{ariaActiveDescendant:null,ariaAtomic:ot,ariaAutoComplete:null,ariaBusy:ot,ariaChecked:ot,ariaColCount:ae,ariaColIndex:ae,ariaColSpan:ae,ariaControls:Ye,ariaCurrent:null,ariaDescribedBy:Ye,ariaDetails:null,ariaDisabled:ot,ariaDropEffect:Ye,ariaErrorMessage:null,ariaExpanded:ot,ariaFlowTo:Ye,ariaGrabbed:ot,ariaHasPopup:null,ariaHidden:ot,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ye,ariaLevel:ae,ariaLive:null,ariaModal:ot,ariaMultiLine:ot,ariaMultiSelectable:ot,ariaOrientation:null,ariaOwns:Ye,ariaPlaceholder:null,ariaPosInSet:ae,ariaPressed:ot,ariaReadOnly:ot,ariaRelevant:null,ariaRequired:ot,ariaRoleDescription:Ye,ariaRowCount:ae,ariaRowIndex:ae,ariaRowSpan:ae,ariaSelected:ot,ariaSetSize:ae,ariaSort:null,ariaValueMax:ae,ariaValueMin:ae,ariaValueNow:ae,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function t1(e,t){return t in e?e[t]:t}function n1(e,t){return t1(e,t.toLowerCase())}const Ix=Pi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Wr,acceptCharset:Ye,accessKey:Ye,action:null,allow:null,allowFullScreen:we,allowPaymentRequest:we,allowUserMedia:we,alpha:we,alt:null,as:null,async:we,autoCapitalize:null,autoComplete:Ye,autoFocus:we,autoPlay:we,blocking:Ye,capture:null,charSet:null,checked:we,cite:null,className:Ye,closedBy:null,colorSpace:null,cols:ae,colSpan:ae,command:null,commandFor:null,content:null,contentEditable:ot,controls:we,controlsList:Ye,coords:ae|Wr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:we,defer:we,dir:null,dirName:null,disabled:we,download:vc,draggable:ot,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:we,formTarget:null,headers:Ye,height:ae,hidden:vc,high:ae,href:null,hrefLang:null,htmlFor:Ye,httpEquiv:Ye,id:null,imageSizes:null,imageSrcSet:null,inert:we,inputMode:null,integrity:null,is:null,isMap:we,itemId:null,itemProp:Ye,itemRef:Ye,itemScope:we,itemType:Ye,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:we,low:ae,manifest:null,max:null,maxLength:ae,media:null,method:null,min:null,minLength:ae,multiple:we,muted:we,name:null,nonce:null,noModule:we,noValidate:we,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:we,optimum:ae,pattern:null,ping:Ye,placeholder:null,playsInline:we,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:we,referrerPolicy:null,rel:Ye,required:we,reversed:we,rows:ae,rowSpan:ae,sandbox:Ye,scope:null,scoped:we,seamless:we,selected:we,shadowRootClonable:we,shadowRootCustomElementRegistry:we,shadowRootDelegatesFocus:we,shadowRootMode:null,shadowRootSerializable:we,shape:null,size:ae,sizes:null,slot:null,span:ae,spellCheck:ot,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ae,step:null,style:null,tabIndex:ae,target:null,title:null,translate:null,type:null,typeMustMatch:we,useMap:null,value:ot,width:ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ye,axis:null,background:null,bgColor:null,border:ae,borderColor:null,bottomMargin:ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:we,declare:we,event:null,face:null,frame:null,frameBorder:null,hSpace:ae,leftMargin:ae,link:null,longDesc:null,lowSrc:null,marginHeight:ae,marginWidth:ae,noResize:we,noHref:we,noShade:we,noWrap:we,object:null,profile:null,prompt:null,rev:null,rightMargin:ae,rules:null,scheme:null,scrolling:ot,standby:null,summary:null,text:null,topMargin:ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ae,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:we,disablePictureInPicture:we,disableRemotePlayback:we,exportParts:Wr,part:Ye,prefix:null,property:null,results:ae,security:null,unselectable:null},space:"html",transform:n1}),Lx=Pi({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:qt,accentHeight:ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ae,amplitude:ae,arabicForm:null,ascent:ae,attributeName:null,attributeType:null,azimuth:ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ae,by:null,calcMode:null,capHeight:ae,className:Ye,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:ae,diffuseConstant:ae,direction:null,display:null,dur:null,divisor:ae,dominantBaseline:null,download:we,dx:null,dy:null,edgeMode:null,editable:null,elevation:ae,enableBackground:null,end:null,event:null,exponent:ae,externalResourcesRequired:null,fill:null,fillOpacity:ae,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:Wr,g2:Wr,glyphName:Wr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ae,horizOriginX:ae,horizOriginY:ae,id:null,ideographic:ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ae,k:ae,k1:ae,k2:ae,k3:ae,k4:ae,kernelMatrix:qt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ae,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ae,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:ae,overlineThickness:ae,paintOrder:null,panose1:null,path:null,pathLength:ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ye,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ae,pointsAtY:ae,pointsAtZ:ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:qt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:qt,rev:qt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:qt,requiredFeatures:qt,requiredFonts:qt,requiredFormats:qt,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:ae,specularExponent:ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ae,strikethroughThickness:ae,string:null,stroke:null,strokeDashArray:qt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ae,strokeOpacity:ae,strokeWidth:null,style:null,surfaceScale:ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:qt,tabIndex:ae,tableValues:null,target:null,targetX:ae,targetY:ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:qt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ae,underlineThickness:ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ae,values:null,vAlphabetic:ae,vMathematical:ae,vectorEffect:null,vHanging:ae,vIdeographic:ae,version:null,vertAdvY:ae,vertOriginX:ae,vertOriginY:ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:t1}),r1=Pi({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()}}),i1=Pi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:n1}),a1=Pi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Rx={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"},Ox=/[A-Z]/g,Yp=/-[a-z]/g,Dx=/^data[-\w.:]+$/i;function Vu(e,t){const n=qa(t);let a=t,s=Ht;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Dx.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Yp,Mx);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Yp.test(o)){let l=o.replace(Ox,Px);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=od}return new s(a,t)}function Px(e){return"-"+e.toLowerCase()}function Mx(e){return e.charAt(1).toUpperCase()}const ns=Z0([e1,Ix,r1,i1,a1],"html"),xr=Z0([e1,Lx,r1,i1,a1],"svg");function Vp(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function s1(e){return e.join(" ").trim()}var Ni={},nc,qp;function Fx(){if(qp)return nc;qp=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,d=/^\s+|\s+$/g,f=`
|
|
57
|
-
`,h="/",E="*",g="",x="comment",b="declaration";function S(P,R){if(typeof P!="string")throw new TypeError("First argument must be a string");if(!P)return[];R=R||{};var F=1,U=1;function K(de){var Y=de.match(t);Y&&(F+=Y.length);var ge=de.lastIndexOf(f);U=~ge?de.length-ge:U+de.length}function $(){var de={line:F,column:U};return function(Y){return Y.position=new j(de),fe(),Y}}function j(de){this.start=de,this.end={line:F,column:U},this.source=R.source}j.prototype.content=P;function te(de){var Y=new Error(R.source+":"+F+":"+U+": "+de);if(Y.reason=de,Y.filename=R.source,Y.line=F,Y.column=U,Y.source=P,!R.silent)throw Y}function ue(de){var Y=de.exec(P);if(Y){var ge=Y[0];return K(ge),P=P.slice(ge.length),Y}}function fe(){ue(n)}function B(de){var Y;for(de=de||[];Y=ie();)Y!==!1&&de.push(Y);return de}function ie(){var de=$();if(!(h!=P.charAt(0)||E!=P.charAt(1))){for(var Y=2;g!=P.charAt(Y)&&(E!=P.charAt(Y)||h!=P.charAt(Y+1));)++Y;if(Y+=2,g===P.charAt(Y-1))return te("End of comment missing");var ge=P.slice(2,Y-2);return U+=2,K(ge),P=P.slice(Y),U+=2,de({type:x,comment:ge})}}function ce(){var de=$(),Y=ue(a);if(Y){if(ie(),!ue(s))return te("property missing ':'");var ge=ue(o),pe=de({type:b,property:A(Y[0].replace(e,g)),value:ge?A(ge[0].replace(e,g)):g});return ue(l),pe}}function ke(){var de=[];B(de);for(var Y;Y=ce();)Y!==!1&&(de.push(Y),B(de));return de}return fe(),ke()}function A(P){return P?P.replace(d,g):g}return nc=S,nc}var Qp;function Bx(){if(Qp)return Ni;Qp=1;var e=Ni&&Ni.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.default=n;const t=e(Fx());function n(a,s){let o=null;if(!a||typeof a!="string")return o;const l=(0,t.default)(a),d=typeof s=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:h,value:E}=f;d?s(h,E,f):E&&(o=o||{},o[h]=E)}),o}return Ni}var wa={},Gp;function Ux(){if(Gp)return wa;Gp=1,Object.defineProperty(wa,"__esModule",{value:!0}),wa.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},l=function(h,E){return E.toUpperCase()},d=function(h,E){return"".concat(E,"-")},f=function(h,E){return E===void 0&&(E={}),o(h)?h:(h=h.toLowerCase(),E.reactCompat?h=h.replace(s,d):h=h.replace(a,d),h.replace(t,l))};return wa.camelCase=f,wa}var Ia,Kp;function jx(){if(Kp)return Ia;Kp=1;var e=Ia&&Ia.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(Bx()),n=Ux();function a(s,o){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(d,f){d&&f&&(l[(0,n.camelCase)(d,o)]=f)}),l}return a.default=a,Ia=a,Ia}var Hx=jx();const zx=qc(Hx),qu=u1("end"),Ln=u1("start");function u1(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function o1(e){const t=Ln(e),n=qu(e);if(t&&n)return{start:t,end:n}}function Fa(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Xp(e.position):"start"in e||"end"in e?Xp(e):"line"in e||"column"in e?Ic(e):""}function Ic(e){return Jp(e&&e.line)+":"+Jp(e&&e.column)}function Xp(e){return Ic(e&&e.start)+"-"+Ic(e&&e.end)}function Jp(e){return e&&typeof e=="number"?e:1}class vt extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let s="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?s=t:!o.cause&&t&&(l=!0,s=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const f=a.indexOf(":");f===-1?o.ruleId=a:(o.source=a.slice(0,f),o.ruleId=a.slice(f+1))}if(!o.place&&o.ancestors&&o.ancestors){const f=o.ancestors[o.ancestors.length-1];f&&(o.place=f.position)}const d=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=d?d.line:void 0,this.name=Fa(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vt.prototype.file="";vt.prototype.name="";vt.prototype.reason="";vt.prototype.message="";vt.prototype.stack="";vt.prototype.column=void 0;vt.prototype.line=void 0;vt.prototype.ancestors=void 0;vt.prototype.cause=void 0;vt.prototype.fatal=void 0;vt.prototype.place=void 0;vt.prototype.ruleId=void 0;vt.prototype.source=void 0;const ld={}.hasOwnProperty,$x=new Map,Wx=/[A-Z]/g,Yx=new Set(["table","tbody","thead","tfoot","tr"]),Vx=new Set(["td","th"]),l1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function qx(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=tb(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");a=eb(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,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"?xr:ns,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=c1(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function c1(e,t,n){if(t.type==="element")return Qx(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Gx(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Xx(e,t,n);if(t.type==="mdxjsEsm")return Kx(e,t);if(t.type==="root")return Jx(e,t,n);if(t.type==="text")return Zx(e,t)}function Qx(e,t,n){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=xr,e.schema=s),e.ancestors.push(t);const o=f1(e,t.tagName,!1),l=nb(e,t);let d=dd(e,t);return Yx.has(t.tagName)&&(d=d.filter(function(f){return typeof f=="string"?!vx(f):!0})),d1(e,l,o,t),cd(l,d),e.ancestors.pop(),e.schema=a,e.create(t,o,l,n)}function Gx(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}Qa(e,t.position)}function Kx(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Qa(e,t.position)}function Xx(e,t,n){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=xr,e.schema=s),e.ancestors.push(t);const o=t.name===null?e.Fragment:f1(e,t.name,!0),l=rb(e,t),d=dd(e,t);return d1(e,l,o,t),cd(l,d),e.ancestors.pop(),e.schema=a,e.create(t,o,l,n)}function Jx(e,t,n){const a={};return cd(a,dd(e,t)),e.create(t,e.Fragment,a,n)}function Zx(e,t){return t.value}function d1(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function cd(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function eb(e,t,n){return a;function a(s,o,l,d){const h=Array.isArray(l.children)?n:t;return d?h(o,l,d):h(o,l)}}function tb(e,t){return n;function n(a,s,o,l){const d=Array.isArray(o.children),f=Ln(a);return t(s,o,l,d,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function nb(e,t){const n={};let a,s;for(s in t.properties)if(s!=="children"&&ld.call(t.properties,s)){const o=ib(e,s,t.properties[s]);if(o){const[l,d]=o;e.tableCellAlignToStyle&&l==="align"&&typeof d=="string"&&Vx.has(t.tagName)?a=d:n[l]=d}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function rb(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const l=o.expression;l.type;const d=l.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else Qa(e,t.position);else{const s=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const d=a.value.data.estree.body[0];d.type,o=e.evaluater.evaluateExpression(d.expression)}else Qa(e,t.position);else o=a.value===null?!0:a.value;n[s]=o}return n}function dd(e,t){const n=[];let a=-1;const s=e.passKeys?new Map:$x;for(;++a<t.children.length;){const o=t.children[a];let l;if(e.passKeys){const f=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(f){const h=s.get(f)||0;l=f+"-"+h,s.set(f,h+1)}}const d=c1(e,o,l);d!==void 0&&n.push(d)}return n}function ib(e,t,n){const a=Vu(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?J0(n):s1(n)),a.property==="style"){let s=typeof n=="object"?n:ab(e,String(n));return e.stylePropertyNameCase==="css"&&(s=sb(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?Rx[a.property]||a.property:a.attribute,n]}}function ab(e,t){try{return zx(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,s=new vt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=l1+"#cannot-parse-style-attribute",s}}function f1(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let o=-1,l;for(;++o<s.length;){const d=zp(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};l=l?{type:"MemberExpression",object:l,property:d,computed:!!(o&&d.type==="Literal"),optional:!1}:d}a=l}else a=zp(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return ld.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);Qa(e)}function Qa(e,t){const n=new vt("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=l1+"#cannot-handle-mdx-estrees-without-createevaluater",n}function sb(e){const t={};let n;for(n in e)ld.call(e,n)&&(t[ub(n)]=e[n]);return t}function ub(e){let t=e.replace(Wx,ob);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function ob(e){return"-"+e.toLowerCase()}const rc={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"]},lb={};function fd(e,t){const n=lb,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return h1(e,a,s)}function h1(e,t,n){if(cb(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 Zp(e.children,t,n)}return Array.isArray(e)?Zp(e,t,n):""}function Zp(e,t,n){const a=[];let s=-1;for(;++s<e.length;)a[s]=h1(e[s],t,n);return a.join("")}function cb(e){return!!(e&&typeof e=="object")}const em=document.createElement("i");function hd(e){const t="&"+e+";";em.innerHTML=t;const n=em.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Qt(e,t,n,a){const s=e.length;let o=0,l;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,a.length<1e4)l=Array.from(a),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<a.length;)l=a.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function rn(e,t){return e.length>0?(Qt(e,e.length,0,t),e):t}const tm={}.hasOwnProperty;function p1(e){const t={};let n=-1;for(;++n<e.length;)db(t,e[n]);return t}function db(e,t){let n;for(n in t){const s=(tm.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){tm.call(s,l)||(s[l]=[]);const d=o[l];fb(s[l],Array.isArray(d)?d:d?[d]:[])}}}function fb(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Qt(e,0,0,a)}function m1(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)}function En(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Rt=br(/[A-Za-z]/),At=br(/[\dA-Za-z]/),hb=br(/[#-'*+\--9=?A-Z^-~]/);function Du(e){return e!==null&&(e<32||e===127)}const Lc=br(/\d/),pb=br(/[\dA-Fa-f]/),mb=br(/[!-/:-@[-`{-~]/);function be(e){return e!==null&&e<-2}function Ve(e){return e!==null&&(e<0||e===32)}function Fe(e){return e===-2||e===-1||e===32}const Qu=br(new RegExp("\\p{P}|\\p{S}","u")),Vr=br(/\s/);function br(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Mi(e){const t=[];let n=-1,a=0,s=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&At(e.charCodeAt(n+1))&&At(e.charCodeAt(n+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const d=e.charCodeAt(n+1);o<56320&&d>56319&&d<57344?(l=String.fromCharCode(o,d),s=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(a,n),encodeURIComponent(l)),a=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(a)}function Me(e,t,n,a){const s=a?a-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(f){return Fe(f)?(e.enter(n),d(f)):t(f)}function d(f){return Fe(f)&&o++<s?(e.consume(f),d):(e.exit(n),t(f))}}const gb={tokenize:Eb};function Eb(e){const t=e.attempt(this.parser.constructs.contentInitial,a,s);let n;return t;function a(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Me(e,t,"linePrefix")}function s(d){return e.enter("paragraph"),o(d)}function o(d){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(d)}function l(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return be(d)?(e.consume(d),e.exit("chunkText"),o):(e.consume(d),l)}}const Tb={tokenize:yb},nm={tokenize:xb};function yb(e){const t=this,n=[];let a=0,s,o,l;return d;function d(U){if(a<n.length){const K=n[a];return t.containerState=K[1],e.attempt(K[0].continuation,f,h)(U)}return h(U)}function f(U){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&F();const K=t.events.length;let $=K,j;for(;$--;)if(t.events[$][0]==="exit"&&t.events[$][1].type==="chunkFlow"){j=t.events[$][1].end;break}R(a);let te=K;for(;te<t.events.length;)t.events[te][1].end={...j},te++;return Qt(t.events,$+1,0,t.events.slice(K)),t.events.length=te,h(U)}return d(U)}function h(U){if(a===n.length){if(!s)return x(U);if(s.currentConstruct&&s.currentConstruct.concrete)return S(U);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(nm,E,g)(U)}function E(U){return s&&F(),R(a),x(U)}function g(U){return t.parser.lazy[t.now().line]=a!==n.length,l=t.now().offset,S(U)}function x(U){return t.containerState={},e.attempt(nm,b,S)(U)}function b(U){return a++,n.push([t.currentConstruct,t.containerState]),x(U)}function S(U){if(U===null){s&&F(),R(0),e.consume(U);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),A(U)}function A(U){if(U===null){P(e.exit("chunkFlow"),!0),R(0),e.consume(U);return}return be(U)?(e.consume(U),P(e.exit("chunkFlow")),a=0,t.interrupt=void 0,d):(e.consume(U),A)}function P(U,K){const $=t.sliceStream(U);if(K&&$.push(null),U.previous=o,o&&(o.next=U),o=U,s.defineSkip(U.start),s.write($),t.parser.lazy[U.start.line]){let j=s.events.length;for(;j--;)if(s.events[j][1].start.offset<l&&(!s.events[j][1].end||s.events[j][1].end.offset>l))return;const te=t.events.length;let ue=te,fe,B;for(;ue--;)if(t.events[ue][0]==="exit"&&t.events[ue][1].type==="chunkFlow"){if(fe){B=t.events[ue][1].end;break}fe=!0}for(R(a),j=te;j<t.events.length;)t.events[j][1].end={...B},j++;Qt(t.events,ue+1,0,t.events.slice(te)),t.events.length=j}}function R(U){let K=n.length;for(;K-- >U;){const $=n[K];t.containerState=$[1],$[0].exit.call(t,e)}n.length=U}function F(){s.write([null]),o=void 0,s=void 0,t.containerState._closeFlow=void 0}}function xb(e,t,n){return Me(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Li(e){if(e===null||Ve(e)||Vr(e))return 1;if(Qu(e))return 2}function Gu(e,t,n){const a=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!a.includes(o)&&(t=o(t,n),a.push(o))}return t}const Rc={name:"attention",resolveAll:bb,tokenize:kb};function bb(e,t){let n=-1,a,s,o,l,d,f,h,E;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[a][1].end},x={...e[n][1].start};rm(g,-f),rm(x,f),l={type:f>1?"strongSequence":"emphasisSequence",start:g,end:{...e[a][1].end}},d={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:x},o={type:f>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},s={type:f>1?"strong":"emphasis",start:{...l.start},end:{...d.end}},e[a][1].end={...l.start},e[n][1].start={...d.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=rn(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=rn(h,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",o,t]]),h=rn(h,Gu(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=rn(h,[["exit",o,t],["enter",d,t],["exit",d,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(E=2,h=rn(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):E=0,Qt(e,a-1,n-a+3,h),n=a+h.length-E-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function kb(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,s=Li(a);let o;return l;function l(f){return o=f,e.enter("attentionSequence"),d(f)}function d(f){if(f===o)return e.consume(f),d;const h=e.exit("attentionSequence"),E=Li(f),g=!E||E===2&&s||n.includes(f),x=!s||s===2&&E||n.includes(a);return h._open=!!(o===42?g:g&&(s||!x)),h._close=!!(o===42?x:x&&(E||!g)),t(f)}}function rm(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Cb={name:"autolink",tokenize:_b};function _b(e,t,n){let a=0;return s;function s(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(b){return Rt(b)?(e.consume(b),l):b===64?n(b):h(b)}function l(b){return b===43||b===45||b===46||At(b)?(a=1,d(b)):h(b)}function d(b){return b===58?(e.consume(b),a=0,f):(b===43||b===45||b===46||At(b))&&a++<32?(e.consume(b),d):(a=0,h(b))}function f(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||Du(b)?n(b):(e.consume(b),f)}function h(b){return b===64?(e.consume(b),E):hb(b)?(e.consume(b),h):n(b)}function E(b){return At(b)?g(b):n(b)}function g(b){return b===46?(e.consume(b),a=0,E):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):x(b)}function x(b){if((b===45||At(b))&&a++<63){const S=b===45?x:g;return e.consume(b),S}return n(b)}}const rs={partial:!0,tokenize:Sb};function Sb(e,t,n){return a;function a(o){return Fe(o)?Me(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||be(o)?t(o):n(o)}}const g1={continuation:{tokenize:Ab},exit:vb,name:"blockQuote",tokenize:Nb};function Nb(e,t,n){const a=this;return s;function s(l){if(l===62){const d=a.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return Fe(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function Ab(e,t,n){const a=this;return s;function s(l){return Fe(l)?Me(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(g1,t,n)(l)}}function vb(e){e.exit("blockQuote")}const E1={name:"characterEscape",tokenize:wb};function wb(e,t,n){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return mb(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const T1={name:"characterReference",tokenize:Ib};function Ib(e,t,n){const a=this;let s=0,o,l;return d;function d(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),f}function f(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,l=At,E(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=pb,E):(e.enter("characterReferenceValue"),o=7,l=Lc,E(g))}function E(g){if(g===59&&s){const x=e.exit("characterReferenceValue");return l===At&&!hd(a.sliceSerialize(x))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(g)&&s++<o?(e.consume(g),E):n(g)}}const im={partial:!0,tokenize:Rb},am={concrete:!0,name:"codeFenced",tokenize:Lb};function Lb(e,t,n){const a=this,s={partial:!0,tokenize:$};let o=0,l=0,d;return f;function f(j){return h(j)}function h(j){const te=a.events[a.events.length-1];return o=te&&te[1].type==="linePrefix"?te[2].sliceSerialize(te[1],!0).length:0,d=j,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),E(j)}function E(j){return j===d?(l++,e.consume(j),E):l<3?n(j):(e.exit("codeFencedFenceSequence"),Fe(j)?Me(e,g,"whitespace")(j):g(j))}function g(j){return j===null||be(j)?(e.exit("codeFencedFence"),a.interrupt?t(j):e.check(im,A,K)(j)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(j))}function x(j){return j===null||be(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(j)):Fe(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Me(e,b,"whitespace")(j)):j===96&&j===d?n(j):(e.consume(j),x)}function b(j){return j===null||be(j)?g(j):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(j))}function S(j){return j===null||be(j)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(j)):j===96&&j===d?n(j):(e.consume(j),S)}function A(j){return e.attempt(s,K,P)(j)}function P(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),R}function R(j){return o>0&&Fe(j)?Me(e,F,"linePrefix",o+1)(j):F(j)}function F(j){return j===null||be(j)?e.check(im,A,K)(j):(e.enter("codeFlowValue"),U(j))}function U(j){return j===null||be(j)?(e.exit("codeFlowValue"),F(j)):(e.consume(j),U)}function K(j){return e.exit("codeFenced"),t(j)}function $(j,te,ue){let fe=0;return B;function B(Y){return j.enter("lineEnding"),j.consume(Y),j.exit("lineEnding"),ie}function ie(Y){return j.enter("codeFencedFence"),Fe(Y)?Me(j,ce,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):ce(Y)}function ce(Y){return Y===d?(j.enter("codeFencedFenceSequence"),ke(Y)):ue(Y)}function ke(Y){return Y===d?(fe++,j.consume(Y),ke):fe>=l?(j.exit("codeFencedFenceSequence"),Fe(Y)?Me(j,de,"whitespace")(Y):de(Y)):ue(Y)}function de(Y){return Y===null||be(Y)?(j.exit("codeFencedFence"),te(Y)):ue(Y)}}}function Rb(e,t,n){const a=this;return s;function s(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return a.parser.lazy[a.now().line]?n(l):t(l)}}const ic={name:"codeIndented",tokenize:Db},Ob={partial:!0,tokenize:Pb};function Db(e,t,n){const a=this;return s;function s(h){return e.enter("codeIndented"),Me(e,o,"linePrefix",5)(h)}function o(h){const E=a.events[a.events.length-1];return E&&E[1].type==="linePrefix"&&E[2].sliceSerialize(E[1],!0).length>=4?l(h):n(h)}function l(h){return h===null?f(h):be(h)?e.attempt(Ob,l,f)(h):(e.enter("codeFlowValue"),d(h))}function d(h){return h===null||be(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),d)}function f(h){return e.exit("codeIndented"),t(h)}}function Pb(e,t,n){const a=this;return s;function s(l){return a.parser.lazy[a.now().line]?n(l):be(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):Me(e,o,"linePrefix",5)(l)}function o(l){const d=a.events[a.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(l):be(l)?s(l):n(l)}}const Mb={name:"codeText",previous:Bb,resolve:Fb,tokenize:Ub};function Fb(e){let t=e.length-4,n=3,a,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="codeTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function Bb(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Ub(e,t,n){let a=0,s,o;return l;function l(g){return e.enter("codeText"),e.enter("codeTextSequence"),d(g)}function d(g){return g===96?(e.consume(g),a++,d):(e.exit("codeTextSequence"),f(g))}function f(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),f):g===96?(o=e.enter("codeTextSequence"),s=0,E(g)):be(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),f):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||be(g)?(e.exit("codeTextData"),f(g)):(e.consume(g),h)}function E(g){return g===96?(e.consume(g),s++,E):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",h(g))}}class jb{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 a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const s=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&La(this.left,a),o.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),La(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),La(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);La(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);La(this.left,n.reverse())}}}function La(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 y1(e){const t={};let n=-1,a,s,o,l,d,f,h;const E=new jb(e);for(;++n<E.length;){for(;n in t;)n=t[n];if(a=E.get(n),n&&a[1].type==="chunkFlow"&&E.get(n-1)[1].type==="listItemPrefix"&&(f=a[1]._tokenizer.events,o=0,o<f.length&&f[o][1].type==="lineEndingBlank"&&(o+=2),o<f.length&&f[o][1].type==="content"))for(;++o<f.length&&f[o][1].type!=="content";)f[o][1].type==="chunkText"&&(f[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,Hb(E,n)),n=t[n],h=!0);else if(a[1]._container){for(o=n,s=void 0;o--;)if(l=E.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(E.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(a[1].end={...E.get(s)[1].start},d=E.slice(s,n),d.unshift(a),E.splice(s,n-s+1,d))}}return Qt(e,0,Number.POSITIVE_INFINITY,E.slice(0)),!h}function Hb(e,t){const n=e.get(t)[1],a=e.get(t)[2];let s=t-1;const o=[];let l=n._tokenizer;l||(l=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const d=l.events,f=[],h={};let E,g,x=-1,b=n,S=0,A=0;const P=[A];for(;b;){for(;e.get(++s)[1]!==b;);o.push(s),b._tokenizer||(E=a.sliceStream(b),b.next||E.push(null),g&&l.defineSkip(b.start),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(E),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),g=b,b=b.next}for(b=n;++x<d.length;)d[x][0]==="exit"&&d[x-1][0]==="enter"&&d[x][1].type===d[x-1][1].type&&d[x][1].start.line!==d[x][1].end.line&&(A=x+1,P.push(A),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(l.events=[],b?(b._tokenizer=void 0,b.previous=void 0):P.pop(),x=P.length;x--;){const R=d.slice(P[x],P[x+1]),F=o.pop();f.push([F,F+R.length-1]),e.splice(F,2,R)}for(f.reverse(),x=-1;++x<f.length;)h[S+f[x][0]]=S+f[x][1],S+=f[x][1]-f[x][0]-1;return h}const zb={resolve:Wb,tokenize:Yb},$b={partial:!0,tokenize:Vb};function Wb(e){return y1(e),e}function Yb(e,t){let n;return a;function a(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(d)}function s(d){return d===null?o(d):be(d)?e.check($b,l,o)(d):(e.consume(d),s)}function o(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function l(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function Vb(e,t,n){const a=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Me(e,o,"linePrefix")}function o(l){if(l===null||be(l))return n(l);const d=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(l):e.interrupt(a.parser.constructs.flow,n,t)(l)}}function x1(e,t,n,a,s,o,l,d,f){const h=f||Number.POSITIVE_INFINITY;let E=0;return g;function g(R){return R===60?(e.enter(a),e.enter(s),e.enter(o),e.consume(R),e.exit(o),x):R===null||R===32||R===41||Du(R)?n(R):(e.enter(a),e.enter(l),e.enter(d),e.enter("chunkString",{contentType:"string"}),A(R))}function x(R){return R===62?(e.enter(o),e.consume(R),e.exit(o),e.exit(s),e.exit(a),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),b(R))}function b(R){return R===62?(e.exit("chunkString"),e.exit(d),x(R)):R===null||R===60||be(R)?n(R):(e.consume(R),R===92?S:b)}function S(R){return R===60||R===62||R===92?(e.consume(R),b):b(R)}function A(R){return!E&&(R===null||R===41||Ve(R))?(e.exit("chunkString"),e.exit(d),e.exit(l),e.exit(a),t(R)):E<h&&R===40?(e.consume(R),E++,A):R===41?(e.consume(R),E--,A):R===null||R===32||R===40||Du(R)?n(R):(e.consume(R),R===92?P:A)}function P(R){return R===40||R===41||R===92?(e.consume(R),A):A(R)}}function b1(e,t,n,a,s,o){const l=this;let d=0,f;return h;function h(b){return e.enter(a),e.enter(s),e.consume(b),e.exit(s),e.enter(o),E}function E(b){return d>999||b===null||b===91||b===93&&!f||b===94&&!d&&"_hiddenFootnoteSupport"in l.parser.constructs?n(b):b===93?(e.exit(o),e.enter(s),e.consume(b),e.exit(s),e.exit(a),t):be(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),E):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||b===91||b===93||be(b)||d++>999?(e.exit("chunkString"),E(b)):(e.consume(b),f||(f=!Fe(b)),b===92?x:g)}function x(b){return b===91||b===92||b===93?(e.consume(b),d++,g):g(b)}}function k1(e,t,n,a,s,o){let l;return d;function d(x){return x===34||x===39||x===40?(e.enter(a),e.enter(s),e.consume(x),e.exit(s),l=x===40?41:x,f):n(x)}function f(x){return x===l?(e.enter(s),e.consume(x),e.exit(s),e.exit(a),t):(e.enter(o),h(x))}function h(x){return x===l?(e.exit(o),f(l)):x===null?n(x):be(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Me(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),E(x))}function E(x){return x===l||x===null||be(x)?(e.exit("chunkString"),h(x)):(e.consume(x),x===92?g:E)}function g(x){return x===l||x===92?(e.consume(x),E):E(x)}}function Ba(e,t){let n;return a;function a(s){return be(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,a):Fe(s)?Me(e,a,n?"linePrefix":"lineSuffix")(s):t(s)}}const qb={name:"definition",tokenize:Gb},Qb={partial:!0,tokenize:Kb};function Gb(e,t,n){const a=this;let s;return o;function o(b){return e.enter("definition"),l(b)}function l(b){return b1.call(a,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function d(b){return s=En(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),f):n(b)}function f(b){return Ve(b)?Ba(e,h)(b):h(b)}function h(b){return x1(e,E,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function E(b){return e.attempt(Qb,g,g)(b)}function g(b){return Fe(b)?Me(e,x,"whitespace")(b):x(b)}function x(b){return b===null||be(b)?(e.exit("definition"),a.parser.defined.push(s),t(b)):n(b)}}function Kb(e,t,n){return a;function a(d){return Ve(d)?Ba(e,s)(d):n(d)}function s(d){return k1(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function o(d){return Fe(d)?Me(e,l,"whitespace")(d):l(d)}function l(d){return d===null||be(d)?t(d):n(d)}}const Xb={name:"hardBreakEscape",tokenize:Jb};function Jb(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return be(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Zb={name:"headingAtx",resolve:ek,tokenize:tk};function ek(e,t){let n=e.length-2,a=3,s,o;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(s={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},o={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},Qt(e,a,n-a+1,[["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t]])),e}function tk(e,t,n){let a=0;return s;function s(E){return e.enter("atxHeading"),o(E)}function o(E){return e.enter("atxHeadingSequence"),l(E)}function l(E){return E===35&&a++<6?(e.consume(E),l):E===null||Ve(E)?(e.exit("atxHeadingSequence"),d(E)):n(E)}function d(E){return E===35?(e.enter("atxHeadingSequence"),f(E)):E===null||be(E)?(e.exit("atxHeading"),t(E)):Fe(E)?Me(e,d,"whitespace")(E):(e.enter("atxHeadingText"),h(E))}function f(E){return E===35?(e.consume(E),f):(e.exit("atxHeadingSequence"),d(E))}function h(E){return E===null||E===35||Ve(E)?(e.exit("atxHeadingText"),d(E)):(e.consume(E),h)}}const nk=["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"],sm=["pre","script","style","textarea"],rk={concrete:!0,name:"htmlFlow",resolveTo:sk,tokenize:uk},ik={partial:!0,tokenize:lk},ak={partial:!0,tokenize:ok};function sk(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 uk(e,t,n){const a=this;let s,o,l,d,f;return h;function h(I){return E(I)}function E(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),g}function g(I){return I===33?(e.consume(I),x):I===47?(e.consume(I),o=!0,A):I===63?(e.consume(I),s=3,a.interrupt?t:C):Rt(I)?(e.consume(I),l=String.fromCharCode(I),P):n(I)}function x(I){return I===45?(e.consume(I),s=2,b):I===91?(e.consume(I),s=5,d=0,S):Rt(I)?(e.consume(I),s=4,a.interrupt?t:C):n(I)}function b(I){return I===45?(e.consume(I),a.interrupt?t:C):n(I)}function S(I){const Ne="CDATA[";return I===Ne.charCodeAt(d++)?(e.consume(I),d===Ne.length?a.interrupt?t:ce:S):n(I)}function A(I){return Rt(I)?(e.consume(I),l=String.fromCharCode(I),P):n(I)}function P(I){if(I===null||I===47||I===62||Ve(I)){const Ne=I===47,Ie=l.toLowerCase();return!Ne&&!o&&sm.includes(Ie)?(s=1,a.interrupt?t(I):ce(I)):nk.includes(l.toLowerCase())?(s=6,Ne?(e.consume(I),R):a.interrupt?t(I):ce(I)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(I):o?F(I):U(I))}return I===45||At(I)?(e.consume(I),l+=String.fromCharCode(I),P):n(I)}function R(I){return I===62?(e.consume(I),a.interrupt?t:ce):n(I)}function F(I){return Fe(I)?(e.consume(I),F):B(I)}function U(I){return I===47?(e.consume(I),B):I===58||I===95||Rt(I)?(e.consume(I),K):Fe(I)?(e.consume(I),U):B(I)}function K(I){return I===45||I===46||I===58||I===95||At(I)?(e.consume(I),K):$(I)}function $(I){return I===61?(e.consume(I),j):Fe(I)?(e.consume(I),$):U(I)}function j(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),f=I,te):Fe(I)?(e.consume(I),j):ue(I)}function te(I){return I===f?(e.consume(I),f=null,fe):I===null||be(I)?n(I):(e.consume(I),te)}function ue(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||Ve(I)?$(I):(e.consume(I),ue)}function fe(I){return I===47||I===62||Fe(I)?U(I):n(I)}function B(I){return I===62?(e.consume(I),ie):n(I)}function ie(I){return I===null||be(I)?ce(I):Fe(I)?(e.consume(I),ie):n(I)}function ce(I){return I===45&&s===2?(e.consume(I),ge):I===60&&s===1?(e.consume(I),pe):I===62&&s===4?(e.consume(I),O):I===63&&s===3?(e.consume(I),C):I===93&&s===5?(e.consume(I),oe):be(I)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(ik,G,ke)(I)):I===null||be(I)?(e.exit("htmlFlowData"),ke(I)):(e.consume(I),ce)}function ke(I){return e.check(ak,de,G)(I)}function de(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),Y}function Y(I){return I===null||be(I)?ke(I):(e.enter("htmlFlowData"),ce(I))}function ge(I){return I===45?(e.consume(I),C):ce(I)}function pe(I){return I===47?(e.consume(I),l="",X):ce(I)}function X(I){if(I===62){const Ne=l.toLowerCase();return sm.includes(Ne)?(e.consume(I),O):ce(I)}return Rt(I)&&l.length<8?(e.consume(I),l+=String.fromCharCode(I),X):ce(I)}function oe(I){return I===93?(e.consume(I),C):ce(I)}function C(I){return I===62?(e.consume(I),O):I===45&&s===2?(e.consume(I),C):ce(I)}function O(I){return I===null||be(I)?(e.exit("htmlFlowData"),G(I)):(e.consume(I),O)}function G(I){return e.exit("htmlFlow"),t(I)}}function ok(e,t,n){const a=this;return s;function s(l){return be(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return a.parser.lazy[a.now().line]?n(l):t(l)}}function lk(e,t,n){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(rs,t,n)}}const ck={name:"htmlText",tokenize:dk};function dk(e,t,n){const a=this;let s,o,l;return d;function d(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),f}function f(C){return C===33?(e.consume(C),h):C===47?(e.consume(C),$):C===63?(e.consume(C),U):Rt(C)?(e.consume(C),ue):n(C)}function h(C){return C===45?(e.consume(C),E):C===91?(e.consume(C),o=0,S):Rt(C)?(e.consume(C),F):n(C)}function E(C){return C===45?(e.consume(C),b):n(C)}function g(C){return C===null?n(C):C===45?(e.consume(C),x):be(C)?(l=g,pe(C)):(e.consume(C),g)}function x(C){return C===45?(e.consume(C),b):g(C)}function b(C){return C===62?ge(C):C===45?x(C):g(C)}function S(C){const O="CDATA[";return C===O.charCodeAt(o++)?(e.consume(C),o===O.length?A:S):n(C)}function A(C){return C===null?n(C):C===93?(e.consume(C),P):be(C)?(l=A,pe(C)):(e.consume(C),A)}function P(C){return C===93?(e.consume(C),R):A(C)}function R(C){return C===62?ge(C):C===93?(e.consume(C),R):A(C)}function F(C){return C===null||C===62?ge(C):be(C)?(l=F,pe(C)):(e.consume(C),F)}function U(C){return C===null?n(C):C===63?(e.consume(C),K):be(C)?(l=U,pe(C)):(e.consume(C),U)}function K(C){return C===62?ge(C):U(C)}function $(C){return Rt(C)?(e.consume(C),j):n(C)}function j(C){return C===45||At(C)?(e.consume(C),j):te(C)}function te(C){return be(C)?(l=te,pe(C)):Fe(C)?(e.consume(C),te):ge(C)}function ue(C){return C===45||At(C)?(e.consume(C),ue):C===47||C===62||Ve(C)?fe(C):n(C)}function fe(C){return C===47?(e.consume(C),ge):C===58||C===95||Rt(C)?(e.consume(C),B):be(C)?(l=fe,pe(C)):Fe(C)?(e.consume(C),fe):ge(C)}function B(C){return C===45||C===46||C===58||C===95||At(C)?(e.consume(C),B):ie(C)}function ie(C){return C===61?(e.consume(C),ce):be(C)?(l=ie,pe(C)):Fe(C)?(e.consume(C),ie):fe(C)}function ce(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),s=C,ke):be(C)?(l=ce,pe(C)):Fe(C)?(e.consume(C),ce):(e.consume(C),de)}function ke(C){return C===s?(e.consume(C),s=void 0,Y):C===null?n(C):be(C)?(l=ke,pe(C)):(e.consume(C),ke)}function de(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||Ve(C)?fe(C):(e.consume(C),de)}function Y(C){return C===47||C===62||Ve(C)?fe(C):n(C)}function ge(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function pe(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),X}function X(C){return Fe(C)?Me(e,oe,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):oe(C)}function oe(C){return e.enter("htmlTextData"),l(C)}}const pd={name:"labelEnd",resolveAll:mk,resolveTo:gk,tokenize:Ek},fk={tokenize:Tk},hk={tokenize:yk},pk={tokenize:xk};function mk(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const s=a.type==="labelImage"?4:2;a.type="data",t+=s}}return e.length!==n.length&&Qt(e,0,e.length,n),e}function gk(e,t){let n=e.length,a=0,s,o,l,d;for(;n--;)if(s=e[n][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=n,s.type!=="labelLink")){a=2;break}}else s.type==="labelEnd"&&(l=n);const f={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},E={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[l-2][1].start}};return d=[["enter",f,t],["enter",h,t]],d=rn(d,e.slice(o+1,o+a+3)),d=rn(d,[["enter",E,t]]),d=rn(d,Gu(t.parser.constructs.insideSpan.null,e.slice(o+a+4,l-3),t)),d=rn(d,[["exit",E,t],e[l-2],e[l-1],["exit",h,t]]),d=rn(d,e.slice(l+1)),d=rn(d,[["exit",f,t]]),Qt(e,o,e.length,d),e}function Ek(e,t,n){const a=this;let s=a.events.length,o,l;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){o=a.events[s][1];break}return d;function d(x){return o?o._inactive?g(x):(l=a.parser.defined.includes(En(a.sliceSerialize({start:o.end,end:a.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(fk,E,l?E:g)(x):x===91?e.attempt(hk,E,l?h:g)(x):l?E(x):g(x)}function h(x){return e.attempt(pk,E,g)(x)}function E(x){return t(x)}function g(x){return o._balanced=!0,n(x)}}function Tk(e,t,n){return a;function a(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),s}function s(g){return Ve(g)?Ba(e,o)(g):o(g)}function o(g){return g===41?E(g):x1(e,l,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function l(g){return Ve(g)?Ba(e,f)(g):E(g)}function d(g){return n(g)}function f(g){return g===34||g===39||g===40?k1(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):E(g)}function h(g){return Ve(g)?Ba(e,E)(g):E(g)}function E(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function yk(e,t,n){const a=this;return s;function s(d){return b1.call(a,e,o,l,"reference","referenceMarker","referenceString")(d)}function o(d){return a.parser.defined.includes(En(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function l(d){return n(d)}}function xk(e,t,n){return a;function a(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),s}function s(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const bk={name:"labelStartImage",resolveAll:pd.resolveAll,tokenize:kk};function kk(e,t,n){const a=this;return s;function s(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),o}function o(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),l):n(d)}function l(d){return d===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):t(d)}}const Ck={name:"labelStartLink",resolveAll:pd.resolveAll,tokenize:_k};function _k(e,t,n){const a=this;return s;function s(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(l):t(l)}}const ac={name:"lineEnding",tokenize:Sk};function Sk(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Me(e,t,"linePrefix")}}const Iu={name:"thematicBreak",tokenize:Nk};function Nk(e,t,n){let a=0,s;return o;function o(h){return e.enter("thematicBreak"),l(h)}function l(h){return s=h,d(h)}function d(h){return h===s?(e.enter("thematicBreakSequence"),f(h)):a>=3&&(h===null||be(h))?(e.exit("thematicBreak"),t(h)):n(h)}function f(h){return h===s?(e.consume(h),a++,f):(e.exit("thematicBreakSequence"),Fe(h)?Me(e,d,"whitespace")(h):d(h))}}const jt={continuation:{tokenize:Ik},exit:Rk,name:"list",tokenize:wk},Ak={partial:!0,tokenize:Ok},vk={partial:!0,tokenize:Lk};function wk(e,t,n){const a=this,s=a.events[a.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return d;function d(b){const S=a.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||b===a.containerState.marker:Lc(b)){if(a.containerState.type||(a.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Iu,n,h)(b):h(b);if(!a.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(b)}return n(b)}function f(b){return Lc(b)&&++l<10?(e.consume(b),f):(!a.interrupt||l<2)&&(a.containerState.marker?b===a.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),h(b)):n(b)}function h(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||b,e.check(rs,a.interrupt?n:E,e.attempt(Ak,x,g))}function E(b){return a.containerState.initialBlankLine=!0,o++,x(b)}function g(b){return Fe(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),x):n(b)}function x(b){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function Ik(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(rs,s,o);function s(d){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,Me(e,t,"listItemIndent",a.containerState.size+1)(d)}function o(d){return a.containerState.furtherBlankLines||!Fe(d)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,l(d)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(vk,t,l)(d))}function l(d){return a.containerState._closeFlow=!0,a.interrupt=void 0,Me(e,e.attempt(jt,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function Lk(e,t,n){const a=this;return Me(e,s,"listItemIndent",a.containerState.size+1);function s(o){const l=a.events[a.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===a.containerState.size?t(o):n(o)}}function Rk(e){e.exit(this.containerState.type)}function Ok(e,t,n){const a=this;return Me(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const l=a.events[a.events.length-1];return!Fe(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const um={name:"setextUnderline",resolveTo:Dk,tokenize:Pk};function Dk(e,t){let n=e.length,a,s,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",l,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=l,e.push(["exit",l,t]),e}function Pk(e,t,n){const a=this;let s;return o;function o(h){let E=a.events.length,g;for(;E--;)if(a.events[E][1].type!=="lineEnding"&&a.events[E][1].type!=="linePrefix"&&a.events[E][1].type!=="content"){g=a.events[E][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(e.enter("setextHeadingLine"),s=h,l(h)):n(h)}function l(h){return e.enter("setextHeadingLineSequence"),d(h)}function d(h){return h===s?(e.consume(h),d):(e.exit("setextHeadingLineSequence"),Fe(h)?Me(e,f,"lineSuffix")(h):f(h))}function f(h){return h===null||be(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const Mk={tokenize:Fk};function Fk(e){const t=this,n=e.attempt(rs,a,e.attempt(this.parser.constructs.flowInitial,s,Me(e,e.attempt(this.parser.constructs.flow,s,e.attempt(zb,s)),"linePrefix")));return n;function a(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Bk={resolveAll:_1()},Uk=C1("string"),jk=C1("text");function C1(e){return{resolveAll:_1(e==="text"?Hk:void 0),tokenize:t};function t(n){const a=this,s=this.parser.constructs[e],o=n.attempt(s,l,d);return l;function l(E){return h(E)?o(E):d(E)}function d(E){if(E===null){n.consume(E);return}return n.enter("data"),n.consume(E),f}function f(E){return h(E)?(n.exit("data"),o(E)):(n.consume(E),f)}function h(E){if(E===null)return!0;const g=s[E];let x=-1;if(g)for(;++x<g.length;){const b=g[x];if(!b.previous||b.previous.call(a,a.previous))return!0}return!1}}}function _1(e){return t;function t(n,a){let s=-1,o;for(;++s<=n.length;)o===void 0?n[s]&&n[s][1].type==="data"&&(o=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==o+2&&(n[o][1].end=n[s-1][1].end,n.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(n,a):n}}function Hk(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 a=e[n-1][1],s=t.sliceStream(a);let o=s.length,l=-1,d=0,f;for(;o--;){const h=s[o];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)d++,l--;if(l)break;l=-1}else if(h===-2)f=!0,d++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const h={type:n===e.length||f||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:a.start._bufferIndex+l,_index:a.start._index+o,line:a.end.line,column:a.end.column-d,offset:a.end.offset-d},end:{...a.end}};a.end={...h.start},a.start.offset===a.end.offset?Object.assign(a,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const zk={42:jt,43:jt,45:jt,48:jt,49:jt,50:jt,51:jt,52:jt,53:jt,54:jt,55:jt,56:jt,57:jt,62:g1},$k={91:qb},Wk={[-2]:ic,[-1]:ic,32:ic},Yk={35:Zb,42:Iu,45:[um,Iu],60:rk,61:um,95:Iu,96:am,126:am},Vk={38:T1,92:E1},qk={[-5]:ac,[-4]:ac,[-3]:ac,33:bk,38:T1,42:Rc,60:[Cb,ck],91:Ck,92:[Xb,E1],93:pd,95:Rc,96:Mb},Qk={null:[Rc,Bk]},Gk={null:[42,95]},Kk={null:[]},Xk=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Gk,contentInitial:$k,disable:Kk,document:zk,flow:Yk,flowInitial:Wk,insideSpan:Qk,string:Vk,text:qk},Symbol.toStringTag,{value:"Module"}));function Jk(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},o=[];let l=[],d=[];const f={attempt:te($),check:te(j),consume:F,enter:U,exit:K,interrupt:te(j,{interrupt:!0})},h={code:null,containerState:{},defineSkip:A,events:[],now:S,parser:e,previous:null,sliceSerialize:x,sliceStream:b,write:g};let E=t.tokenize.call(h,f);return t.resolveAll&&o.push(t),h;function g(ie){return l=rn(l,ie),P(),l[l.length-1]!==null?[]:(ue(t,0),h.events=Gu(o,h.events,h),h.events)}function x(ie,ce){return eC(b(ie),ce)}function b(ie){return Zk(l,ie)}function S(){const{_bufferIndex:ie,_index:ce,line:ke,column:de,offset:Y}=a;return{_bufferIndex:ie,_index:ce,line:ke,column:de,offset:Y}}function A(ie){s[ie.line]=ie.column,B()}function P(){let ie;for(;a._index<l.length;){const ce=l[a._index];if(typeof ce=="string")for(ie=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===ie&&a._bufferIndex<ce.length;)R(ce.charCodeAt(a._bufferIndex));else R(ce)}}function R(ie){E=E(ie)}function F(ie){be(ie)?(a.line++,a.column=1,a.offset+=ie===-3?2:1,B()):ie!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===l[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=ie}function U(ie,ce){const ke=ce||{};return ke.type=ie,ke.start=S(),h.events.push(["enter",ke,h]),d.push(ke),ke}function K(ie){const ce=d.pop();return ce.end=S(),h.events.push(["exit",ce,h]),ce}function $(ie,ce){ue(ie,ce.from)}function j(ie,ce){ce.restore()}function te(ie,ce){return ke;function ke(de,Y,ge){let pe,X,oe,C;return Array.isArray(de)?G(de):"tokenize"in de?G([de]):O(de);function O(Se){return je;function je(Re){const ze=Re!==null&&Se[Re],st=Re!==null&&Se.null,On=[...Array.isArray(ze)?ze:ze?[ze]:[],...Array.isArray(st)?st:st?[st]:[]];return G(On)(Re)}}function G(Se){return pe=Se,X=0,Se.length===0?ge:I(Se[X])}function I(Se){return je;function je(Re){return C=fe(),oe=Se,Se.partial||(h.currentConstruct=Se),Se.name&&h.parser.constructs.disable.null.includes(Se.name)?Ie():Se.tokenize.call(ce?Object.assign(Object.create(h),ce):h,f,Ne,Ie)(Re)}}function Ne(Se){return ie(oe,C),Y}function Ie(Se){return C.restore(),++X<pe.length?I(pe[X]):ge}}}function ue(ie,ce){ie.resolveAll&&!o.includes(ie)&&o.push(ie),ie.resolve&&Qt(h.events,ce,h.events.length-ce,ie.resolve(h.events.slice(ce),h)),ie.resolveTo&&(h.events=ie.resolveTo(h.events,h))}function fe(){const ie=S(),ce=h.previous,ke=h.currentConstruct,de=h.events.length,Y=Array.from(d);return{from:de,restore:ge};function ge(){a=ie,h.previous=ce,h.currentConstruct=ke,h.events.length=de,d=Y,B()}}function B(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function Zk(e,t){const n=t.start._index,a=t.start._bufferIndex,s=t.end._index,o=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(a,o)];else{if(l=e.slice(n,s),a>-1){const d=l[0];typeof d=="string"?l[0]=d.slice(a):l.shift()}o>0&&l.push(e[s].slice(0,o))}return l}function eC(e,t){let n=-1;const a=[];let s;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
|
55
|
+
`),n=ad(t).replace(/```[\s\S]*?```/g," ").replace(/\s+/g," ").trim();if(!n)return"";if(n.length<=Jl)return n.replace(/[.,;:!?]+$/,"");const a=n.slice(0,Jl),s=a.lastIndexOf(" ");return`${(s>Jl/2?a.slice(0,s):a).replace(/[.,;:!?]+$/,"")}…`}const jy=(e,t)=>t.updatedAt.localeCompare(e.updatedAt);function F0(e,t){const n=e.find(s=>s.chatId===t.chatId),a=n&&n.updatedAt.localeCompare(t.updatedAt)>0?{...t,updatedAt:n.updatedAt}:t;return[...e.filter(s=>s.chatId!==t.chatId),a].sort(jy)}function Hy(e,t,n){const a=e.find(s=>s.chatId===t);return a?F0(e,{...a,updatedAt:n}):e}function B0(e){const t=e.toLowerCase();return t.includes("credential")||t.includes("expired")||t.includes("not authenticated")||t.includes("unauthorized")||t.includes("kiro-cli login")?{title:"Kiro isn't authenticated",fix:"Run `kiro-cli login` on the server, then retry.",sessionWide:!0}:t.includes("a turn is already running")?{title:"A turn is already running",fix:"Wait for the current turn to finish, or stop it first."}:t.includes("enoent")||t.includes("spawn")||t.includes("command not found")?{title:"Couldn't start kiro-cli",fix:"Check that KIRO_BIN points at an executable kiro-cli.",sessionWide:!0}:t.includes("timed out")?{title:"The request timed out"}:{title:"Turn failed"}}function zy(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Array.from(e,n=>n.toString(16).padStart(2,"0")).join("");return[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,20),t.slice(20)].join("-")}const xe=By((e,t)=>({chats:[],models:[],agents:[],defaultAgentId:"kiro_default",activeId:null,chatId:null,loadingChatId:null,modes:[],items:[],appliedSeq:0,remainingOlder:0,observability:Pp(),fsVersion:{},watchedPaths:[],streamingText:"",streamingThought:"",pending:[],chatNotice:null,connStatus:"closed",createError:null,reloadingId:null,previewPath:null,setConnStatus:n=>e({connStatus:n}),setCreateError:n=>e({createError:n}),setReloadingId:n=>e({reloadingId:n}),openFilePreview:n=>e({previewPath:n}),closeFilePreview:()=>e({previewPath:null}),markCancelling:()=>e(n=>n.observability.turnStatus==="running"?{observability:{...n.observability,turnStatus:"cancelling"}}:{}),setCurrentModel:n=>e({currentModelId:n}),setCurrentAgent:n=>e(a=>({currentModeId:n,chats:a.activeId?a.chats.map(s=>s.chatId===a.activeId?{...s,agentId:n}:s):a.chats})),setCompacting:n=>e(a=>a.observability.compacting===n?{}:{observability:{...a.observability,compacting:n}}),markPendingSending:n=>e(a=>({pending:a.pending.map(s=>s.id===n?{...s,status:"sending",error:void 0}:s)})),renameChatRow:(n,a)=>e(s=>({chats:s.chats.map(o=>o.chatId===n?{...o,title:a}:o)})),bumpFsPath:n=>e(a=>({fsVersion:{...a.fsVersion,[n]:(a.fsVersion[n]??0)+1}})),setWatchedPaths:n=>e({watchedPaths:n}),setChats:n=>e({chats:n}),setModels:n=>e({models:n}),setAgents:(n,a)=>e({agents:n,defaultAgentId:a}),setLoadingChat:n=>e({loadingChatId:n}),loadDetail:(n,a)=>e(s=>({activeId:n.summary.chatId,chatId:n.summary.chatId,loadingChatId:null,chats:F0(s.chats,n.summary),modes:n.modes,currentModeId:n.currentModeId,currentModelId:n.summary.modelId,observability:n.observability,items:n.transcript,appliedSeq:n.head,remainingOlder:Math.max(0,n.transcriptTotal-n.transcript.length),streamingText:"",streamingThought:"",pending:a!=null&&a.keepPending?s.pending:[],chatNotice:null})),prependItems:n=>e(a=>({items:[...n,...a.items],remainingOlder:Math.max(0,a.remainingOlder-n.length)})),newChatId:()=>{const n=zy();return e({chatId:n}),n},clearActive:()=>e({activeId:null,loadingChatId:null,modes:[],items:[],appliedSeq:0,remainingOlder:0,observability:Pp(),streamingText:"",streamingThought:"",pending:[],chatNotice:null,currentModeId:void 0,currentModelId:void 0,previewPath:null}),dismissChatNotice:()=>e({chatNotice:null}),setChatNotice:n=>e({chatNotice:n}),addPending:n=>e(a=>({pending:[...a.pending,{...n,status:"sending"}]})),markPendingFailed:(n,a)=>e(s=>({pending:s.pending.map(o=>o.id===n?{...o,status:"failed",error:a}:o)})),applyEvent:n=>{var o,l,d,f;const a=t(),s=n.payload;if(!(n.seq<=a.appliedSeq))switch(e({appliedSeq:n.seq}),s.kind){case"turn_started":{const h=s.prompt.filter(S=>S.type==="text").map(S=>S.text).join(""),E=ad(h),g=a.pending.findIndex(S=>S.status==="sending"),x=new Date(n.ts).toISOString(),b=Hy(a.chats,n.chatId,x);e({items:[...a.items,{type:"message",message:{id:`u-${n.seq}`,role:"user",text:E,timestamp:n.ts,attachments:s.attachments}}],pending:g===-1?a.pending:a.pending.filter((S,A)=>A!==g),chats:b,streamingText:"",observability:{...a.observability,turnStatus:"running"}});break}case"session_update":{const h=s.update;if(h.sessionUpdate==="agent_message_chunk"){const E=((o=h.content)==null?void 0:o.text)??"";e({streamingText:a.streamingText+E})}else if(h.sessionUpdate==="agent_thought_chunk"){const E=((l=h.content)==null?void 0:l.text)??"";e({streamingThought:a.streamingThought+E})}else if(h.sessionUpdate==="tool_call"){const E=h,g=(f=(d=E._meta)==null?void 0:d.kiro)==null?void 0:f.toolName;e({items:[...Zl(a,`s-${n.seq}`,n.ts),{type:"tool_call",tool:{id:E.toolCallId,name:g,title:E.title??E.toolCallId,kind:E.kind,status:E.status??"pending",input:E.rawInput,content:E.content??[]}}],streamingText:"",streamingThought:""})}else if(h.sessionUpdate==="tool_call_update"){const E=h;e({items:a.items.map(g=>g.type==="tool_call"&&g.tool.id===E.toolCallId?{type:"tool_call",tool:{...g.tool,status:E.status??g.tool.status,output:E.rawOutput??g.tool.output,content:E.content??g.tool.content}}:g)})}break}case"turn_ended":{e({items:Zl(a,`s-${n.seq}`,n.ts),chatNotice:null,streamingText:"",streamingThought:"",observability:{...a.observability,turnStatus:"idle"}});break}case"turn_error":{const h=B0(s.message);e({items:[...Zl(a,`s-${n.seq}`,n.ts),{type:"turn_error",id:`err-${n.seq}`,message:s.message,timestamp:n.ts}],chatNotice:h.sessionWide?{title:h.title,fix:h.fix,detail:s.message}:a.chatNotice,streamingText:"",streamingThought:"",observability:{...a.observability,turnStatus:"idle"}});break}case"metadata":e({observability:{...a.observability,contextUsagePercentage:s.params.contextUsagePercentage??a.observability.contextUsagePercentage}});break;case"compaction":{const h=s.params.status.type!=="started",E=s.params.summary??"";e({observability:{...a.observability,compacting:!h},items:h&&E.trim()?[...a.items,{type:"compaction",id:`c-${n.seq}`,summary:E,timestamp:n.ts}]:a.items});break}case"process_exited":e({observability:{...a.observability,turnStatus:"idle",compacting:!1}});break}}}));function Zl(e,t,n=Date.now()){const a=[...e.items];return e.streamingThought.trim()&&a.push({type:"message",message:{id:`t-${t}`,role:"thinking",text:e.streamingThought,timestamp:n}}),e.streamingText.trim()&&a.push({type:"message",message:{id:`a-${t}`,role:"assistant",text:e.streamingText,timestamp:n}}),a}async function bt(e,t,n){const a={};n!==void 0&&(a["content-type"]="application/json");const s=await fetch(t,{method:e,headers:a,credentials:"same-origin",body:n!==void 0?JSON.stringify(n):void 0});if(s.status===401)throw new Error("Unauthorized");if(!s.ok){const l=await s.text();let d="";try{d=JSON.parse(l).error??""}catch{}throw new Error(d||`${e} ${t} failed (${s.status}): ${l}`)}const o=await s.text();return o?JSON.parse(o):{}}function $y(e){return bt("POST","/api/login",{token:e})}function Wy(){return bt("POST","/api/logout")}const dt={devices:()=>bt("GET","/api/devices"),revokeDevice:e=>bt("DELETE",`/api/devices/${e}`),logoutAll:()=>bt("POST","/api/logout-all"),models:()=>bt("GET","/api/models"),agents:()=>bt("GET","/api/agents"),listDirs:e=>bt("GET",`/api/fs/dirs?path=${encodeURIComponent(e)}`),listChats:()=>bt("GET","/api/chats"),createChat:e=>bt("POST","/api/chats",e),getChat:e=>bt("GET",`/api/chats/${e}`),transcriptPage:(e,t,n)=>bt("GET",`/api/chats/${e}/transcript?offset=${t}&limit=${n}`),deleteChat:e=>bt("DELETE",`/api/chats/${e}`),renameChat:(e,t)=>bt("POST",`/api/chats/${e}/rename`,{title:t}),setChatCwd:(e,t)=>bt("POST",`/api/chats/${e}/cwd`,{cwd:t}),reloadChat:e=>bt("POST",`/api/chats/${e}/reload`),tree:(e,t="")=>bt("GET",`/api/chats/${e}/tree?path=${encodeURIComponent(t)}`),downloadUrl:(e,t)=>t.startsWith("/")?`/api/fs/file?download=1&path=${encodeURIComponent(t)}`:`/api/chats/${e}/download?path=${encodeURIComponent(t)}`,previewUrl:(e,t)=>t.startsWith("/")?`/api/fs/file?path=${encodeURIComponent(t)}`:`/api/chats/${e}/preview?path=${encodeURIComponent(t)}`,uploadFiles:async(e,t)=>{const n=new FormData;for(const s of t)n.append("files",s,s.name);const a=await fetch(`/api/chats/${encodeURIComponent(e)}/uploads`,{method:"POST",credentials:"same-origin",body:n});if(a.status===401)throw new Error("Unauthorized");if(!a.ok){const s=await a.text();throw new Error(`Upload failed (${a.status}): ${s}`)}return await a.json()}},wu={CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},Yy=8e3,U0=25e3,Vy=1e4;function Mp(e){return e.state===void 0||e.state===wu.CLOSED||e.state===wu.CLOSING?!0:e.state===wu.CONNECTING?e.now-e.connectingSince>Yy:e.now-e.lastMessageAt>U0+Vy}function qy(e){return e.state===wu.OPEN&&e.now-e.lastMessageAt>U0}const Qy=1008;class Gy{constructor(t,n,a=0){Le(this,"ws",null);Le(this,"cursor",0);Le(this,"closedByUser",!1);Le(this,"backoff",500);Le(this,"reconnectTimer",null);Le(this,"connectingSince",0);Le(this,"lastMessageAt",0);Le(this,"watchdog",null);Le(this,"eager",()=>{this.closedByUser||Mp(this.sample())&&this.connect()});Le(this,"onVisibility",()=>{document.visibilityState==="visible"&&this.eager()});this.chatId=t,this.handlers=n,this.cursor=a,window.addEventListener("online",this.eager),document.addEventListener("visibilitychange",this.onVisibility)}sample(){var t;return{state:(t=this.ws)==null?void 0:t.readyState,connectingSince:this.connectingSince,lastMessageAt:this.lastMessageAt,now:Date.now()}}startWatchdog(){this.watchdog===null&&(this.watchdog=window.setInterval(()=>{if(this.closedByUser)return;const t=this.sample();Mp(t)?this.connect():qy(t)&&this.send({type:"ping"})},5e3))}reset(t){this.cursor=t}connect(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);const t=this.ws;t&&(this.ws=null,t.onopen=null,t.onmessage=null,t.onclose=null,t.onerror=null,(t.readyState===WebSocket.OPEN||t.readyState===WebSocket.CONNECTING)&&t.close()),this.connectingSince=Date.now(),this.lastMessageAt=Date.now(),this.startWatchdog(),this.handlers.onStatus(this.cursor>0?"reconnecting":"connecting");const a=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws?chatId=${encodeURIComponent(this.chatId)}&cursor=${this.cursor}`,s=new WebSocket(a);this.ws=s,s.onopen=()=>{this.ws===s&&(this.backoff=500,this.handlers.onStatus("replaying"))},s.onmessage=o=>{var d,f,h,E,g,x;if(this.ws!==s)return;this.lastMessageAt=Date.now();const l=JSON.parse(o.data);switch(l.type){case"event":l.event.seq>this.cursor&&(this.cursor=l.event.seq,this.handlers.onEvent(l.event));break;case"replay_complete":this.handlers.onStatus("connected");break;case"resync":this.handlers.onStatus("resyncing"),this.handlers.onResync();break;case"ack":(f=(d=this.handlers).onAck)==null||f.call(d,l.action,l.ok,l.error);break;case"error":console.warn("ws error:",l.message),(E=(h=this.handlers).onServerError)==null||E.call(h,l.message);break;case"fs_changed":(x=(g=this.handlers).onFsChanged)==null||x.call(g,l.path);break}},s.onclose=o=>{var l,d;if(this.ws===s){if(this.closedByUser){this.handlers.onStatus("closed");return}if(o.code===Qy){this.closedByUser=!0,this.handlers.onStatus("closed"),(d=(l=this.handlers).onUnauthorized)==null||d.call(l);return}this.handlers.onStatus("reconnecting"),this.reconnectTimer=window.setTimeout(()=>this.connect(),this.backoff),this.backoff=Math.min(this.backoff*1.7,1e4)}},s.onerror=()=>{this.ws===s&&s.close()}}send(t){var n;return((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN?(this.ws.send(JSON.stringify(t)),!0):!1}prompt(t,n){return this.send({type:"prompt",content:t,attachments:n})}cancel(){this.send({type:"cancel"})}setMode(t){this.send({type:"set_mode",modeId:t})}setModel(t){this.send({type:"set_model",modelId:t})}watchPaths(t){this.send({type:"watch_paths",paths:t})}execCommand(t){this.send({type:"exec_command",command:t})}close(){this.closedByUser=!0,window.removeEventListener("online",this.eager),document.removeEventListener("visibilitychange",this.onVisibility),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.watchdog!==null&&(clearInterval(this.watchdog),this.watchdog=null);const t=this.ws;this.ws=null,t&&(t.onopen=null,t.onmessage=null,t.onclose=null,t.onerror=null,t.close())}}const j0="/chats",H0=`${j0}/:chatId`;function z0(e){return`${j0}/${encodeURIComponent(e)}`}const sd="/new",Ky={prompt:"Message",cancel:"Stop",set_mode:"Agent change",set_model:"Model change",exec_command:"Command"};class Xy{constructor(t={}){Le(this,"api");Le(this,"createSocket");Le(this,"listCoalesceMs");Le(this,"turnEndedRefreshMs");Le(this,"compactTimeoutMs");Le(this,"host",null);Le(this,"socket",null);Le(this,"openTarget",null);Le(this,"handledRoute");Le(this,"isDraft",!1);Le(this,"lastSent",null);Le(this,"msgSeq",0);Le(this,"firstPrompt",null);Le(this,"lastCreateOpts",null);Le(this,"listSeq",0);Le(this,"listTimer",null);this.api=t.api??dt,this.createSocket=t.createSocket??((n,a,s)=>new Gy(n,a,s)),this.listCoalesceMs=t.listCoalesceMs??150,this.turnEndedRefreshMs=t.turnEndedRefreshMs??1200,this.compactTimeoutMs=t.compactTimeoutMs??12e4}attach(t){this.host=t}get state(){return xe.getState()}refreshSessions(){this.listTimer===null&&(this.listTimer=setTimeout(()=>{this.listTimer=null;const t=++this.listSeq;this.api.listChats().then(n=>{t===this.listSeq&&this.state.setChats(n.chats)}).catch(()=>{})},this.listCoalesceMs))}loadPickers(){this.api.models().then(t=>this.state.setModels(t.models)).catch(()=>{}),this.api.agents().then(t=>this.state.setAgents(t.agents,t.defaultAgentId)).catch(()=>{})}syncRoute(t,n){if(this.isDraft=n,n&&!this.state.chatId&&this.state.newChatId(),this.handledRoute!==t)if(this.handledRoute=t,t)this.openChat(t);else{this.openTarget=null,this.closeSocket();const a=this.state.activeId===null&&this.state.chatId!==null;this.state.clearActive(),a||this.state.newChatId(),this.refreshSessions()}}closeSocket(){var t;(t=this.socket)==null||t.close(),this.socket=null}async openChat(t,n){var s;if(this.state.activeId===t)return;this.openTarget=t,this.closeSocket(),this.state.setConnStatus("connecting"),n||this.state.setLoadingChat(t);let a;if(n)a=n;else try{a=await this.api.getChat(t)}catch(o){if(this.openTarget!==t)return;this.state.setConnStatus("closed"),this.state.setLoadingChat(null),console.error("open session failed:",o),(s=this.host)==null||s.navigate("/",{replace:!0});return}this.openTarget===t&&(this.state.loadDetail(a,{keepPending:!!n}),this.socket=this.createSocket(t,this.socketHandlers(t),a.head),this.socket.connect())}socketHandlers(t){return{onEvent:n=>{this.state.applyEvent(n),n.payload.kind==="turn_started"&&this.refreshSessions(),n.payload.kind==="turn_ended"&&setTimeout(()=>this.refreshSessions(),this.turnEndedRefreshMs)},onStatus:n=>{if(this.state.setConnStatus(n),n==="connected"&&this.firstPrompt){const a=this.firstPrompt;this.firstPrompt=null,this.deliver(a.id,a.content,a.attachments)}},onResync:async()=>{var a;const n=await this.api.getChat(t);this.openTarget===t&&(this.state.loadDetail(n),(a=this.socket)==null||a.reset(n.head))},onAck:(n,a,s)=>{if(a)return;const o=s??"The server rejected the request.";if(n==="prompt"){this.lastSent&&this.state.markPendingFailed(this.lastSent,o);return}console.error(`${Ky[n]??n} rejected:`,o)},onFsChanged:n=>this.state.bumpFsPath(n),onUnauthorized:()=>{var n;this.closeSocket(),this.state.clearActive(),(n=this.host)==null||n.onLock()},onServerError:n=>{console.error("server error:",n)}}}async createChat(t){var n;this.closeSocket(),this.state.setConnStatus("connecting"),this.state.setCreateError(null),this.lastCreateOpts=t;try{const a=await this.api.createChat({chatId:this.state.chatId??void 0,cwd:t.cwd||void 0,agentId:t.agentId,modelId:t.modelId,freshWorkspace:!t.cwd});this.refreshSessions();const s=a.summary.chatId;return this.handledRoute=s,this.isDraft=!1,(n=this.host)==null||n.navigate(z0(s)),this.openChat(s,a),!0}catch(a){return this.state.setConnStatus("closed"),this.state.setCreateError(a instanceof Error?a.message:"Failed to create session"),!1}}retryCreate(){this.lastCreateOpts&&this.createChat(this.lastCreateOpts)}dismissCreateError(){var t;this.state.setCreateError(null),(t=this.host)==null||t.navigate("/")}startDraft(){var t;this.openTarget=null,this.closeSocket(),this.state.clearActive(),this.state.newChatId(),this.state.setCreateError(null),(t=this.host)==null||t.navigate(sd)}send(t,n){const a=`pending-${this.msgSeq++}`,s=ad(t.filter(o=>o.type==="text").map(o=>o.text).join(`
|
|
56
|
+
`));if(this.state.addPending({id:a,text:s,attachments:n,content:t}),this.isDraft){const{currentModeId:o,currentModelId:l}=this.state;this.createChat({agentId:o,modelId:l,title:Uy(t)}).then(d=>{d?this.firstPrompt={id:a,content:t,attachments:n}:this.state.markPendingFailed(a,"Could not start the session.")});return}this.deliver(a,t,n)}deliver(t,n,a){var s;this.lastSent=t,!((s=this.socket)!=null&&s.prompt(n,a))&&this.state.markPendingFailed(t,this.socket?"Not connected to the server - reconnecting. Retry once the status dot is green.":"No active session socket.")}retrySend(t){const n=this.state.pending.find(a=>a.id===t);n&&(this.state.markPendingSending(t),this.deliver(t,n.content,n.attachments))}retryTurn(t){this.send([{type:"text",text:t}])}cancel(){var t;(t=this.socket)==null||t.cancel(),this.state.markCancelling()}changeModel(t){var n;(n=this.socket)==null||n.setModel(t),this.state.setCurrentModel(t)}changeAgent(t){var n;(n=this.socket)==null||n.setMode(t),this.state.setCurrentAgent(t)}compact(){var t;(t=this.socket)==null||t.execCommand("compact"),this.state.setCompacting(!0),setTimeout(()=>this.state.setCompacting(!1),this.compactTimeoutMs)}async reloadChat(){var n;const t=this.state.activeId;if(!(!t||this.state.reloadingId===t)){this.state.setReloadingId(t);try{const a=await this.api.reloadChat(t);if(this.state.activeId!==t)return;this.state.loadDetail(a),(n=this.socket)==null||n.reset(a.head),this.loadPickers()}catch(a){if(this.state.activeId!==t)return;const s=a instanceof Error?a.message:"The server rejected the reload.";this.state.setChatNotice({title:"Couldn't reload the session",fix:s,detail:s})}finally{this.state.reloadingId===t&&this.state.setReloadingId(null)}}}watchPaths(t){var n;(n=this.socket)==null||n.watchPaths(t)}async deleteChat(t){var n;try{await this.api.deleteChat(t)}catch{console.error("delete session failed"),this.refreshSessions();return}this.state.activeId===t?(n=this.host)==null||n.navigate("/"):this.refreshSessions()}async renameChat(t,n){this.state.renameChatRow(t,n),await this.api.renameChat(t,n).catch(()=>{console.error("rename session failed")}),this.refreshSessions()}markLoading(t){t!==this.state.activeId&&this.state.setLoadingChat(t)}lock(){var t,n;this.closeSocket(),this.state.clearActive(),(t=this.host)==null||t.navigate("/",{replace:!0}),(n=this.host)==null||n.onLock()}get canSend(){return this.isDraft||xe.getState().activeId!==null}}const nt=new Xy;function $0(e){const t=e.trim().slice(0,4e3);return!t||!nt.canSend?!1:(nt.send([{type:"text",text:t}]),!0)}function Yu({size:e=14,className:t}){return T.jsx("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:T.jsx("polyline",{points:"6 9 12 15 18 9"})})}function Jy({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[T.jsx("circle",{cx:"4",cy:"12",r:"1.8"}),T.jsx("circle",{cx:"12",cy:"12",r:"1.8"}),T.jsx("circle",{cx:"20",cy:"12",r:"1.8"})]})}function Zy({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[T.jsx("circle",{cx:"12",cy:"5",r:"1.9"}),T.jsx("circle",{cx:"12",cy:"12",r:"1.9"}),T.jsx("circle",{cx:"12",cy:"19",r:"1.9"})]})}function ex({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M20 11a8 8 0 0 0-13.6-4.5L3 9"}),T.jsx("polyline",{points:"3 4 3 9 8 9"}),T.jsx("path",{d:"M4 13a8 8 0 0 0 13.6 4.5L21 15"}),T.jsx("polyline",{points:"21 20 21 15 16 15"})]})}function ud({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function tx({size:e=16,className:t}){return T.jsx("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:T.jsx("polyline",{points:"20 6 9 17 4 12"})})}function W0({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"}),T.jsx("line",{x1:"12",y1:"9.5",x2:"12",y2:"13.5"}),T.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]})}function nx({size:e=18,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("rect",{x:"4",y:"11",width:"16",height:"10",rx:"2"}),T.jsx("path",{d:"M8 11V7a4 4 0 0 1 8 0v4"})]})}function yr({size:e=28,className:t}){return T.jsx("svg",{className:`spinner ${t??""}`,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round","aria-hidden":!0,children:T.jsx("path",{d:"M12 3a9 9 0 1 0 9 9"})})}function rx({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M12 19V5"}),T.jsx("path",{d:"m5 12 7-7 7 7"})]})}function Fp({size:e=16,className:t}){return T.jsx("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none","aria-hidden":!0,children:T.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}function Y0({size:e=20,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),T.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}function V0({size:e=20,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("circle",{cx:"11",cy:"11",r:"7"}),T.jsx("line",{x1:"21",y1:"21",x2:"16.5",y2:"16.5"})]})}function q0({size:e=16,className:t}){return T.jsx("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:T.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function ix({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2v1"}),T.jsx("path",{d:"M2 10l2.5 9h15l2.5-9H7.5"})]})}function Q0({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),T.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function Bp({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),T.jsx("polyline",{points:"14 2 14 8 20 8"}),T.jsx("polyline",{points:"9 15 7 13 9 11"}),T.jsx("polyline",{points:"15 11 17 13 15 15"})]})}function ax({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),T.jsx("polyline",{points:"14 2 14 8 20 8"}),T.jsx("circle",{cx:"12",cy:"15",r:"2"}),T.jsx("path",{d:"M12 11v2"}),T.jsx("path",{d:"M12 17v1"})]})}function sx({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),T.jsx("polyline",{points:"14 2 14 8 20 8"}),T.jsx("line",{x1:"8",y1:"13",x2:"16",y2:"13"}),T.jsx("line",{x1:"8",y1:"17",x2:"14",y2:"17"})]})}function ux({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),T.jsx("polyline",{points:"14 2 14 8 20 8"}),T.jsx("circle",{cx:"10",cy:"14",r:"2"}),T.jsx("path",{d:"M20 17l-3-3-5 5"})]})}function ox({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),T.jsx("polyline",{points:"14 2 14 8 20 8"}),T.jsx("path",{d:"M8 13h3v3H8z"}),T.jsx("line",{x1:"14",y1:"13",x2:"16",y2:"13"}),T.jsx("line",{x1:"14",y1:"16",x2:"16",y2:"16"})]})}function lx({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),T.jsx("polyline",{points:"14 2 14 8 20 8"}),T.jsx("polyline",{points:"8 15 10 13 8 11"}),T.jsx("line",{x1:"12",y1:"16",x2:"16",y2:"16"})]})}function cx({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),T.jsx("polyline",{points:"7 10 12 15 17 10"}),T.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function ec({size:e=20,className:t}){return T.jsx("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":!0,children:T.jsx("path",{d:"M4 7h16M4 12h16M4 17h10"})})}function dx({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),T.jsx("line",{x1:"9",y1:"14",x2:"15",y2:"14"}),T.jsx("line",{x1:"9",y1:"18",x2:"13",y2:"18"})]})}function fx({size:e=18,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("polyline",{points:"4 14 10 14 10 20"}),T.jsx("polyline",{points:"20 10 14 10 14 4"}),T.jsx("line",{x1:"14",y1:"10",x2:"21",y2:"3"}),T.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]})}function hx({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("path",{d:"M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z"}),T.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function px({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("polyline",{points:"16 18 22 12 16 6"}),T.jsx("polyline",{points:"8 6 2 12 8 18"})]})}function mx({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("polyline",{points:"15 3 21 3 21 9"}),T.jsx("polyline",{points:"9 21 3 21 3 15"}),T.jsx("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),T.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]})}function gx({size:e=16,className:t}){return T.jsxs("svg",{className:t,width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[T.jsx("polyline",{points:"4 14 10 14 10 20"}),T.jsx("polyline",{points:"20 10 14 10 14 4"}),T.jsx("line",{x1:"14",y1:"10",x2:"21",y2:"3"}),T.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]})}var es=p0();const va=8,Up=6;function G0({anchor:e,onClose:t,children:n}){const a=v.useRef(null),[s,o]=v.useState(null);return v.useLayoutEffect(()=>{const l=a.current;if(!e||!l)return;const d=e.getBoundingClientRect(),f=l.getBoundingClientRect(),h=d.bottom+Up,g=h+f.height+va<=window.innerHeight?h:Math.max(va,d.top-Up-f.height),x=Math.min(Math.max(va,d.right-f.width),Math.max(va,window.innerWidth-f.width-va));o({top:g,left:x})},[e]),v.useEffect(()=>{const l=h=>{var g;const E=h.target;(g=a.current)!=null&&g.contains(E)||e!=null&&e.contains(E)||t()},d=h=>{h.key==="Escape"&&t()};document.addEventListener("mousedown",l),document.addEventListener("keydown",d);const f={capture:!0,passive:!0};return window.addEventListener("scroll",t,f),window.addEventListener("resize",t),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",d),window.removeEventListener("scroll",t,f),window.removeEventListener("resize",t)}},[e,t]),es.createPortal(T.jsx("div",{ref:a,className:"menu-list menu-list-floating",role:"menu",style:s?{top:s.top,left:s.left}:{visibility:"hidden"},children:n}),document.body)}function Ex(e,t){const n=e.trim().toLowerCase();if(!n)return 0;const a=t.toLowerCase();let s=0,o=0,l=-2;for(let d=0;d<n.length;d++){const f=n[d],h=a.indexOf(f,o);if(h===-1)return-1;s+=1,h===l+1&&(s+=3),(h===0||/\s|[-_/.]/.test(a[h-1]??""))&&(s+=2),l=h,o=h+1}return s}function Tx({sessions:e,onOpen:t,onClose:n}){const[a,s]=v.useState(""),[o,l]=v.useState(0),d=v.useRef(null);v.useEffect(()=>{var g;(g=d.current)==null||g.focus()},[]);const f=v.useMemo(()=>a.trim()?e.map(g=>({s:g,score:Ex(a,g.title)})).filter(g=>g.score>=0).sort((g,x)=>x.score-g.score).map(g=>g.s):e.slice(0,50),[e,a]);v.useEffect(()=>{l(0)},[a]);const h=g=>{t(g),n()},E=g=>{if(g.key==="Escape")n();else if(g.key==="ArrowDown")g.preventDefault(),l(x=>Math.min(x+1,f.length-1));else if(g.key==="ArrowUp")g.preventDefault(),l(x=>Math.max(x-1,0));else if(g.key==="Enter"){g.preventDefault();const x=f[o];x&&h(x.chatId)}};return es.createPortal(T.jsx("div",{className:"search-backdrop",onClick:n,children:T.jsxs("div",{className:"search-modal",role:"dialog","aria-label":"Search sessions",onClick:g=>g.stopPropagation(),children:[T.jsxs("div",{className:"search-field",children:[T.jsx(V0,{size:20,className:"search-field-icon"}),T.jsx("input",{ref:d,className:"search-modal-input",value:a,placeholder:"Search sessions…",onChange:g=>s(g.target.value),onKeyDown:E}),T.jsx("kbd",{className:"search-esc",children:"esc"})]}),T.jsx("div",{className:"search-results",children:f.length===0?T.jsx("p",{className:"search-empty",children:a.trim()?`No sessions match "${a}".`:"No sessions yet."}):f.map((g,x)=>T.jsxs("button",{className:`search-result ${x===o?"is-active":""}`,onMouseEnter:()=>l(x),onClick:()=>h(g.chatId),children:[T.jsx("span",{className:"search-result-title",children:g.title}),T.jsx("span",{className:"search-result-agent",children:g.agentId??"kiro_default"})]},g.chatId))})]})}),document.body)}function K0(e,t=!1){const n=Date.parse(e);if(Number.isNaN(n))return"";const a=Math.round((Date.now()-n)/6e4),s=l=>t?`${l} ago`:l;if(a<1)return t?"just now":"now";if(a<60)return s(`${a}m`);const o=Math.round(a/60);return o<24?s(`${o}h`):s(`${Math.round(o/24)}d`)}function yx(e){if(!e)return"Unknown device";const t=/iPhone|iPad/.test(e)?"iOS":/Android/.test(e)?"Android":/Macintosh|Mac OS/.test(e)?"macOS":/Windows/.test(e)?"Windows":/Linux/.test(e)?"Linux":"Device",n=/Firefox/.test(e)?"Firefox":/Edg\//.test(e)?"Edge":/Chrome/.test(e)?"Chrome":/Safari/.test(e)?"Safari":"";return n?`${t} · ${n}`:t}function xx({onClose:e,onSelfRevoked:t}){const[n,a]=v.useState(null),[s,o]=v.useState(!1),l=()=>dt.devices().then(h=>a(h.devices)).catch(()=>a([]));v.useEffect(()=>{l()},[]);const d=async h=>{o(!0);try{if(await dt.revokeDevice(h.id),h.current){t();return}await l()}finally{o(!1)}},f=async()=>{o(!0);try{await dt.logoutAll(),t()}finally{o(!1)}};return es.createPortal(T.jsx("div",{className:"search-backdrop",onClick:e,children:T.jsxs("div",{className:"search-modal",role:"dialog","aria-label":"Logged-in devices",onClick:h=>h.stopPropagation(),children:[T.jsxs("div",{className:"devices-head",children:[T.jsx("span",{className:"devices-title",children:"Logged-in devices"}),T.jsx("button",{className:"btn-ghost",onClick:e,children:"Close"})]}),T.jsx("div",{className:"devices-list",children:n===null?T.jsx("p",{className:"search-empty",children:"Loading…"}):n.length===0?T.jsx("p",{className:"search-empty",children:"No active devices."}):n.map(h=>T.jsxs("div",{className:"device-row",children:[T.jsxs("span",{className:"device-main",children:[T.jsxs("span",{className:"device-name",children:[yx(h.userAgent),h.current&&T.jsx("span",{className:"device-badge",children:"This device"})]}),T.jsxs("span",{className:"device-sub",children:["Active ",K0(h.lastSeenAt,!0)]})]}),T.jsx("button",{className:"btn-ghost device-revoke",disabled:s,onClick:()=>d(h),children:h.current?"Log out":"Revoke"})]},h.id))}),n&&n.length>1&&T.jsx("div",{className:"devices-foot",children:T.jsx("button",{className:"btn-ghost device-revoke",disabled:s,onClick:f,children:"Log out all devices"})})]})}),document.body)}function bx({title:e,message:t,confirmLabel:n="Confirm",danger:a=!1,onConfirm:s,onCancel:o}){return v.useEffect(()=>{const l=d=>{d.key==="Escape"&&o()};return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[o]),es.createPortal(T.jsx("div",{className:"confirm-backdrop",onClick:l=>{l.target===l.currentTarget&&o()},children:T.jsxs("div",{className:"confirm-modal",role:"dialog","aria-modal":"true","aria-label":e,children:[T.jsx("h3",{className:"confirm-title",children:e}),t&&T.jsx("p",{className:"confirm-message",children:t}),T.jsxs("div",{className:"confirm-actions",children:[T.jsx("button",{className:"btn-ghost",onClick:o,children:"Cancel"}),T.jsx("button",{className:a?"btn-danger":"btn-primary",onClick:s,autoFocus:!0,children:n})]})]})}),document.body)}function kx({sessions:e,activeId:t,loadingId:n,onOpen:a,onNew:s,onDelete:o,onRename:l,onLock:d}){const[f,h]=v.useState(!1),[E,g]=v.useState(!1),[x,b]=v.useState(!1),[S,A]=v.useState(null),[P,R]=v.useState(null),[F,U]=v.useState(null),[K,$]=v.useState(null),[j,te]=v.useState(""),ue=v.useCallback(()=>{A(null),R(null)},[]);v.useEffect(()=>{if(!x)return;const B=()=>b(!1);return document.addEventListener("click",B),()=>document.removeEventListener("click",B)},[x]);const fe=B=>{const ie=j.trim();ie&&l(B,ie),$(null)};return T.jsxs("aside",{className:"sidebar",children:[T.jsxs("header",{className:"sidebar-head",children:[T.jsxs("span",{className:"brand",children:[T.jsx("img",{className:"brand-logo",src:"/logo.svg",alt:""}),T.jsx("span",{className:"wordmark",children:"Casper"})]}),T.jsxs("div",{className:"sidebar-actions",children:[T.jsxs("div",{className:"account-menu",children:[T.jsx("button",{className:"iconbtn iconbtn-lg","aria-label":"Account",title:"Account",onClick:B=>{B.stopPropagation(),b(ie=>!ie)},children:T.jsx(nx,{size:18})}),x&&T.jsxs("div",{className:"menu-list",onClick:B=>B.stopPropagation(),children:[T.jsx("button",{className:"menu-item",onClick:()=>{b(!1),g(!0)},children:"Devices"}),T.jsx("button",{className:"menu-item",onClick:()=>{b(!1),d()},children:"Lock app"})]})]}),T.jsx("button",{className:"iconbtn iconbtn-lg","aria-label":"Search sessions",onClick:()=>h(!0),children:T.jsx(V0,{size:20})}),T.jsx("button",{className:"iconbtn iconbtn-lg","aria-label":"New session",title:"New session",onClick:s,children:T.jsx(Y0,{size:20})})]})]}),T.jsx("div",{className:"sidebar-list",children:e.length===0?T.jsx("p",{className:"sidebar-empty",children:"No sessions yet. Start one and it keeps running while you're away."}):e.map(B=>T.jsxs("div",{className:`srow ${B.chatId===t?"is-active":""} ${S===B.chatId?"is-menu-open":""}`,children:[K===B.chatId?T.jsx("input",{className:"srow-rename",autoFocus:!0,onFocus:ie=>ie.currentTarget.select(),value:j,onChange:ie=>te(ie.target.value),onBlur:()=>fe(B.chatId),onKeyDown:ie=>{ie.key==="Enter"&&fe(B.chatId),ie.key==="Escape"&&$(null)},onClick:ie=>ie.stopPropagation()}):T.jsx(id,{className:"srow-open",to:z0(B.chatId),onClick:ie=>{ie.metaKey||ie.ctrlKey||ie.shiftKey||ie.altKey||a(B.chatId)},children:T.jsxs("span",{className:"srow-main",children:[T.jsx("span",{className:"srow-title",title:B.title,children:B.title}),T.jsxs("span",{className:"srow-sub",children:[T.jsx("span",{className:"srow-agent",children:B.agentId??"kiro_default"}),T.jsx("span",{className:"srow-dot",children:"·"}),n===B.chatId&&T.jsx(yr,{size:11,className:"srow-spinner"}),T.jsx("span",{className:"srow-when",children:K0(B.updatedAt)})]})]})}),T.jsxs("div",{className:"srow-menu",children:[T.jsx("button",{className:"iconbtn srow-menu-btn","aria-label":"Session actions","aria-haspopup":"menu","aria-expanded":S===B.chatId,onClick:ie=>{ie.stopPropagation();const ce=S===B.chatId;R(ce?null:ie.currentTarget),A(ce?null:B.chatId)},children:T.jsx(Zy,{size:16})}),S===B.chatId&&T.jsxs(G0,{anchor:P,onClose:ue,children:[T.jsx("button",{className:"menu-item",onClick:()=>{te(B.title),$(B.chatId),ue()},children:"Rename"}),T.jsx("button",{className:"menu-item menu-item-danger",onClick:()=>{ue(),U(B.chatId)},children:"Delete"})]})]})]},B.chatId))}),f&&T.jsx(Tx,{sessions:e,onOpen:a,onClose:()=>h(!1)}),E&&T.jsx(xx,{onClose:()=>g(!1),onSelfRevoked:()=>{g(!1),d()}}),F&&T.jsx(bx,{title:"Delete session?",message:"This session and its history will be permanently deleted. This can't be undone.",confirmLabel:"Delete",danger:!0,onConfirm:()=>{const B=F;U(null),o(B)},onCancel:()=>U(null)})]})}function X0(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}const Cx="modulepreload",_x=function(e){return"/"+e},jp={},Ac=function(t,n,a){let s=Promise.resolve();if(n&&n.length>0){let l=function(h){return Promise.all(h.map(E=>Promise.resolve(E).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));s=l(n.map(h=>{if(h=_x(h),h in jp)return;jp[h]=!0;const E=h.endsWith(".css"),g=E?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const x=document.createElement("link");if(x.rel=E?"stylesheet":Cx,E||(x.as="script"),x.crossOrigin="",x.href=h,f&&x.setAttribute("nonce",f),document.head.appendChild(x),E)return new Promise((b,S)=>{x.addEventListener("load",b),x.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(l){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=l,window.dispatchEvent(d),!d.defaultPrevented)throw l}return s.then(l=>{for(const d of l||[])d.status==="rejected"&&o(d.reason);return t().catch(o)})};function Hp(e){const t=[],n=String(e||"");let a=n.indexOf(","),s=0,o=!1;for(;!o;){a===-1&&(a=n.length,o=!0);const l=n.slice(s,a).trim();(l||!o)&&t.push(l),s=a+1,a=n.indexOf(",",s)}return t}function J0(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Sx=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Nx=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ax={};function zp(e,t){return(Ax.jsx?Nx:Sx).test(e)}const vx=/[ \t\n\f\r]/g;function wx(e){return typeof e=="object"?e.type==="text"?$p(e.value):!1:$p(e)}function $p(e){return e.replace(vx,"")===""}class ts{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}ts.prototype.normal={};ts.prototype.property={};ts.prototype.space=void 0;function Z0(e,t){const n={},a={};for(const s of e)Object.assign(n,s.property),Object.assign(a,s.normal);return new ts(n,a,t)}function qa(e){return e.toLowerCase()}class Ht{constructor(t,n){this.attribute=n,this.property=t}}Ht.prototype.attribute="";Ht.prototype.booleanish=!1;Ht.prototype.boolean=!1;Ht.prototype.commaOrSpaceSeparated=!1;Ht.prototype.commaSeparated=!1;Ht.prototype.defined=!1;Ht.prototype.mustUseProperty=!1;Ht.prototype.number=!1;Ht.prototype.overloadedBoolean=!1;Ht.prototype.property="";Ht.prototype.spaceSeparated=!1;Ht.prototype.space=void 0;let Ix=0;const we=Gr(),ot=Gr(),vc=Gr(),ae=Gr(),Ye=Gr(),Wr=Gr(),qt=Gr();function Gr(){return 2**++Ix}const wc=Object.freeze(Object.defineProperty({__proto__:null,boolean:we,booleanish:ot,commaOrSpaceSeparated:qt,commaSeparated:Wr,number:ae,overloadedBoolean:vc,spaceSeparated:Ye},Symbol.toStringTag,{value:"Module"})),tc=Object.keys(wc);class od extends Ht{constructor(t,n,a,s){let o=-1;if(super(t,n),Wp(this,"space",s),typeof a=="number")for(;++o<tc.length;){const l=tc[o];Wp(this,tc[o],(a&wc[l])===wc[l])}}}od.prototype.defined=!0;function Wp(e,t,n){n&&(e[t]=n)}function Pi(e){const t={},n={};for(const[a,s]of Object.entries(e.properties)){const o=new od(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[qa(a)]=a,n[qa(o.attribute)]=a}return new ts(t,n,e.space)}const e1=Pi({properties:{ariaActiveDescendant:null,ariaAtomic:ot,ariaAutoComplete:null,ariaBusy:ot,ariaChecked:ot,ariaColCount:ae,ariaColIndex:ae,ariaColSpan:ae,ariaControls:Ye,ariaCurrent:null,ariaDescribedBy:Ye,ariaDetails:null,ariaDisabled:ot,ariaDropEffect:Ye,ariaErrorMessage:null,ariaExpanded:ot,ariaFlowTo:Ye,ariaGrabbed:ot,ariaHasPopup:null,ariaHidden:ot,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ye,ariaLevel:ae,ariaLive:null,ariaModal:ot,ariaMultiLine:ot,ariaMultiSelectable:ot,ariaOrientation:null,ariaOwns:Ye,ariaPlaceholder:null,ariaPosInSet:ae,ariaPressed:ot,ariaReadOnly:ot,ariaRelevant:null,ariaRequired:ot,ariaRoleDescription:Ye,ariaRowCount:ae,ariaRowIndex:ae,ariaRowSpan:ae,ariaSelected:ot,ariaSetSize:ae,ariaSort:null,ariaValueMax:ae,ariaValueMin:ae,ariaValueNow:ae,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function t1(e,t){return t in e?e[t]:t}function n1(e,t){return t1(e,t.toLowerCase())}const Lx=Pi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Wr,acceptCharset:Ye,accessKey:Ye,action:null,allow:null,allowFullScreen:we,allowPaymentRequest:we,allowUserMedia:we,alpha:we,alt:null,as:null,async:we,autoCapitalize:null,autoComplete:Ye,autoFocus:we,autoPlay:we,blocking:Ye,capture:null,charSet:null,checked:we,cite:null,className:Ye,closedBy:null,colorSpace:null,cols:ae,colSpan:ae,command:null,commandFor:null,content:null,contentEditable:ot,controls:we,controlsList:Ye,coords:ae|Wr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:we,defer:we,dir:null,dirName:null,disabled:we,download:vc,draggable:ot,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:we,formTarget:null,headers:Ye,height:ae,hidden:vc,high:ae,href:null,hrefLang:null,htmlFor:Ye,httpEquiv:Ye,id:null,imageSizes:null,imageSrcSet:null,inert:we,inputMode:null,integrity:null,is:null,isMap:we,itemId:null,itemProp:Ye,itemRef:Ye,itemScope:we,itemType:Ye,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:we,low:ae,manifest:null,max:null,maxLength:ae,media:null,method:null,min:null,minLength:ae,multiple:we,muted:we,name:null,nonce:null,noModule:we,noValidate:we,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:we,optimum:ae,pattern:null,ping:Ye,placeholder:null,playsInline:we,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:we,referrerPolicy:null,rel:Ye,required:we,reversed:we,rows:ae,rowSpan:ae,sandbox:Ye,scope:null,scoped:we,seamless:we,selected:we,shadowRootClonable:we,shadowRootCustomElementRegistry:we,shadowRootDelegatesFocus:we,shadowRootMode:null,shadowRootSerializable:we,shape:null,size:ae,sizes:null,slot:null,span:ae,spellCheck:ot,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ae,step:null,style:null,tabIndex:ae,target:null,title:null,translate:null,type:null,typeMustMatch:we,useMap:null,value:ot,width:ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ye,axis:null,background:null,bgColor:null,border:ae,borderColor:null,bottomMargin:ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:we,declare:we,event:null,face:null,frame:null,frameBorder:null,hSpace:ae,leftMargin:ae,link:null,longDesc:null,lowSrc:null,marginHeight:ae,marginWidth:ae,noResize:we,noHref:we,noShade:we,noWrap:we,object:null,profile:null,prompt:null,rev:null,rightMargin:ae,rules:null,scheme:null,scrolling:ot,standby:null,summary:null,text:null,topMargin:ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ae,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:we,disablePictureInPicture:we,disableRemotePlayback:we,exportParts:Wr,part:Ye,prefix:null,property:null,results:ae,security:null,unselectable:null},space:"html",transform:n1}),Rx=Pi({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:qt,accentHeight:ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ae,amplitude:ae,arabicForm:null,ascent:ae,attributeName:null,attributeType:null,azimuth:ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ae,by:null,calcMode:null,capHeight:ae,className:Ye,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:ae,diffuseConstant:ae,direction:null,display:null,dur:null,divisor:ae,dominantBaseline:null,download:we,dx:null,dy:null,edgeMode:null,editable:null,elevation:ae,enableBackground:null,end:null,event:null,exponent:ae,externalResourcesRequired:null,fill:null,fillOpacity:ae,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:Wr,g2:Wr,glyphName:Wr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ae,horizOriginX:ae,horizOriginY:ae,id:null,ideographic:ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ae,k:ae,k1:ae,k2:ae,k3:ae,k4:ae,kernelMatrix:qt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ae,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ae,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:ae,overlineThickness:ae,paintOrder:null,panose1:null,path:null,pathLength:ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ye,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ae,pointsAtY:ae,pointsAtZ:ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:qt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:qt,rev:qt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:qt,requiredFeatures:qt,requiredFonts:qt,requiredFormats:qt,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:ae,specularExponent:ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ae,strikethroughThickness:ae,string:null,stroke:null,strokeDashArray:qt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ae,strokeOpacity:ae,strokeWidth:null,style:null,surfaceScale:ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:qt,tabIndex:ae,tableValues:null,target:null,targetX:ae,targetY:ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:qt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ae,underlineThickness:ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ae,values:null,vAlphabetic:ae,vMathematical:ae,vectorEffect:null,vHanging:ae,vIdeographic:ae,version:null,vertAdvY:ae,vertOriginX:ae,vertOriginY:ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:t1}),r1=Pi({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()}}),i1=Pi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:n1}),a1=Pi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Ox={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"},Dx=/[A-Z]/g,Yp=/-[a-z]/g,Px=/^data[-\w.:]+$/i;function Vu(e,t){const n=qa(t);let a=t,s=Ht;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Px.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Yp,Fx);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Yp.test(o)){let l=o.replace(Dx,Mx);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=od}return new s(a,t)}function Mx(e){return"-"+e.toLowerCase()}function Fx(e){return e.charAt(1).toUpperCase()}const ns=Z0([e1,Lx,r1,i1,a1],"html"),xr=Z0([e1,Rx,r1,i1,a1],"svg");function Vp(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function s1(e){return e.join(" ").trim()}var Ni={},nc,qp;function Bx(){if(qp)return nc;qp=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,d=/^\s+|\s+$/g,f=`
|
|
57
|
+
`,h="/",E="*",g="",x="comment",b="declaration";function S(P,R){if(typeof P!="string")throw new TypeError("First argument must be a string");if(!P)return[];R=R||{};var F=1,U=1;function K(de){var Y=de.match(t);Y&&(F+=Y.length);var ge=de.lastIndexOf(f);U=~ge?de.length-ge:U+de.length}function $(){var de={line:F,column:U};return function(Y){return Y.position=new j(de),fe(),Y}}function j(de){this.start=de,this.end={line:F,column:U},this.source=R.source}j.prototype.content=P;function te(de){var Y=new Error(R.source+":"+F+":"+U+": "+de);if(Y.reason=de,Y.filename=R.source,Y.line=F,Y.column=U,Y.source=P,!R.silent)throw Y}function ue(de){var Y=de.exec(P);if(Y){var ge=Y[0];return K(ge),P=P.slice(ge.length),Y}}function fe(){ue(n)}function B(de){var Y;for(de=de||[];Y=ie();)Y!==!1&&de.push(Y);return de}function ie(){var de=$();if(!(h!=P.charAt(0)||E!=P.charAt(1))){for(var Y=2;g!=P.charAt(Y)&&(E!=P.charAt(Y)||h!=P.charAt(Y+1));)++Y;if(Y+=2,g===P.charAt(Y-1))return te("End of comment missing");var ge=P.slice(2,Y-2);return U+=2,K(ge),P=P.slice(Y),U+=2,de({type:x,comment:ge})}}function ce(){var de=$(),Y=ue(a);if(Y){if(ie(),!ue(s))return te("property missing ':'");var ge=ue(o),pe=de({type:b,property:A(Y[0].replace(e,g)),value:ge?A(ge[0].replace(e,g)):g});return ue(l),pe}}function ke(){var de=[];B(de);for(var Y;Y=ce();)Y!==!1&&(de.push(Y),B(de));return de}return fe(),ke()}function A(P){return P?P.replace(d,g):g}return nc=S,nc}var Qp;function Ux(){if(Qp)return Ni;Qp=1;var e=Ni&&Ni.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Ni,"__esModule",{value:!0}),Ni.default=n;const t=e(Bx());function n(a,s){let o=null;if(!a||typeof a!="string")return o;const l=(0,t.default)(a),d=typeof s=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:h,value:E}=f;d?s(h,E,f):E&&(o=o||{},o[h]=E)}),o}return Ni}var wa={},Gp;function jx(){if(Gp)return wa;Gp=1,Object.defineProperty(wa,"__esModule",{value:!0}),wa.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},l=function(h,E){return E.toUpperCase()},d=function(h,E){return"".concat(E,"-")},f=function(h,E){return E===void 0&&(E={}),o(h)?h:(h=h.toLowerCase(),E.reactCompat?h=h.replace(s,d):h=h.replace(a,d),h.replace(t,l))};return wa.camelCase=f,wa}var Ia,Kp;function Hx(){if(Kp)return Ia;Kp=1;var e=Ia&&Ia.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(Ux()),n=jx();function a(s,o){var l={};return!s||typeof s!="string"||(0,t.default)(s,function(d,f){d&&f&&(l[(0,n.camelCase)(d,o)]=f)}),l}return a.default=a,Ia=a,Ia}var zx=Hx();const $x=qc(zx),qu=u1("end"),Ln=u1("start");function u1(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function o1(e){const t=Ln(e),n=qu(e);if(t&&n)return{start:t,end:n}}function Fa(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Xp(e.position):"start"in e||"end"in e?Xp(e):"line"in e||"column"in e?Ic(e):""}function Ic(e){return Jp(e&&e.line)+":"+Jp(e&&e.column)}function Xp(e){return Ic(e&&e.start)+"-"+Ic(e&&e.end)}function Jp(e){return e&&typeof e=="number"?e:1}class vt extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let s="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?s=t:!o.cause&&t&&(l=!0,s=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const f=a.indexOf(":");f===-1?o.ruleId=a:(o.source=a.slice(0,f),o.ruleId=a.slice(f+1))}if(!o.place&&o.ancestors&&o.ancestors){const f=o.ancestors[o.ancestors.length-1];f&&(o.place=f.position)}const d=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=d?d.line:void 0,this.name=Fa(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}vt.prototype.file="";vt.prototype.name="";vt.prototype.reason="";vt.prototype.message="";vt.prototype.stack="";vt.prototype.column=void 0;vt.prototype.line=void 0;vt.prototype.ancestors=void 0;vt.prototype.cause=void 0;vt.prototype.fatal=void 0;vt.prototype.place=void 0;vt.prototype.ruleId=void 0;vt.prototype.source=void 0;const ld={}.hasOwnProperty,Wx=new Map,Yx=/[A-Z]/g,Vx=new Set(["table","tbody","thead","tfoot","tr"]),qx=new Set(["td","th"]),l1="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Qx(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=nb(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");a=tb(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,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"?xr:ns,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=c1(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function c1(e,t,n){if(t.type==="element")return Gx(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Kx(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Jx(e,t,n);if(t.type==="mdxjsEsm")return Xx(e,t);if(t.type==="root")return Zx(e,t,n);if(t.type==="text")return eb(e,t)}function Gx(e,t,n){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=xr,e.schema=s),e.ancestors.push(t);const o=f1(e,t.tagName,!1),l=rb(e,t);let d=dd(e,t);return Vx.has(t.tagName)&&(d=d.filter(function(f){return typeof f=="string"?!wx(f):!0})),d1(e,l,o,t),cd(l,d),e.ancestors.pop(),e.schema=a,e.create(t,o,l,n)}function Kx(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}Qa(e,t.position)}function Xx(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Qa(e,t.position)}function Jx(e,t,n){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=xr,e.schema=s),e.ancestors.push(t);const o=t.name===null?e.Fragment:f1(e,t.name,!0),l=ib(e,t),d=dd(e,t);return d1(e,l,o,t),cd(l,d),e.ancestors.pop(),e.schema=a,e.create(t,o,l,n)}function Zx(e,t,n){const a={};return cd(a,dd(e,t)),e.create(t,e.Fragment,a,n)}function eb(e,t){return t.value}function d1(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function cd(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function tb(e,t,n){return a;function a(s,o,l,d){const h=Array.isArray(l.children)?n:t;return d?h(o,l,d):h(o,l)}}function nb(e,t){return n;function n(a,s,o,l){const d=Array.isArray(o.children),f=Ln(a);return t(s,o,l,d,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function rb(e,t){const n={};let a,s;for(s in t.properties)if(s!=="children"&&ld.call(t.properties,s)){const o=ab(e,s,t.properties[s]);if(o){const[l,d]=o;e.tableCellAlignToStyle&&l==="align"&&typeof d=="string"&&qx.has(t.tagName)?a=d:n[l]=d}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function ib(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const l=o.expression;l.type;const d=l.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else Qa(e,t.position);else{const s=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const d=a.value.data.estree.body[0];d.type,o=e.evaluater.evaluateExpression(d.expression)}else Qa(e,t.position);else o=a.value===null?!0:a.value;n[s]=o}return n}function dd(e,t){const n=[];let a=-1;const s=e.passKeys?new Map:Wx;for(;++a<t.children.length;){const o=t.children[a];let l;if(e.passKeys){const f=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(f){const h=s.get(f)||0;l=f+"-"+h,s.set(f,h+1)}}const d=c1(e,o,l);d!==void 0&&n.push(d)}return n}function ab(e,t,n){const a=Vu(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?J0(n):s1(n)),a.property==="style"){let s=typeof n=="object"?n:sb(e,String(n));return e.stylePropertyNameCase==="css"&&(s=ub(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?Ox[a.property]||a.property:a.attribute,n]}}function sb(e,t){try{return $x(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,s=new vt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=l1+"#cannot-parse-style-attribute",s}}function f1(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let o=-1,l;for(;++o<s.length;){const d=zp(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};l=l?{type:"MemberExpression",object:l,property:d,computed:!!(o&&d.type==="Literal"),optional:!1}:d}a=l}else a=zp(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return ld.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);Qa(e)}function Qa(e,t){const n=new vt("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=l1+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ub(e){const t={};let n;for(n in e)ld.call(e,n)&&(t[ob(n)]=e[n]);return t}function ob(e){let t=e.replace(Yx,lb);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function lb(e){return"-"+e.toLowerCase()}const rc={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"]},cb={};function fd(e,t){const n=cb,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return h1(e,a,s)}function h1(e,t,n){if(db(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 Zp(e.children,t,n)}return Array.isArray(e)?Zp(e,t,n):""}function Zp(e,t,n){const a=[];let s=-1;for(;++s<e.length;)a[s]=h1(e[s],t,n);return a.join("")}function db(e){return!!(e&&typeof e=="object")}const em=document.createElement("i");function hd(e){const t="&"+e+";";em.innerHTML=t;const n=em.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Qt(e,t,n,a){const s=e.length;let o=0,l;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,a.length<1e4)l=Array.from(a),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<a.length;)l=a.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function rn(e,t){return e.length>0?(Qt(e,e.length,0,t),e):t}const tm={}.hasOwnProperty;function p1(e){const t={};let n=-1;for(;++n<e.length;)fb(t,e[n]);return t}function fb(e,t){let n;for(n in t){const s=(tm.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){tm.call(s,l)||(s[l]=[]);const d=o[l];hb(s[l],Array.isArray(d)?d:d?[d]:[])}}}function hb(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Qt(e,0,0,a)}function m1(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)}function En(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Rt=br(/[A-Za-z]/),At=br(/[\dA-Za-z]/),pb=br(/[#-'*+\--9=?A-Z^-~]/);function Du(e){return e!==null&&(e<32||e===127)}const Lc=br(/\d/),mb=br(/[\dA-Fa-f]/),gb=br(/[!-/:-@[-`{-~]/);function be(e){return e!==null&&e<-2}function Ve(e){return e!==null&&(e<0||e===32)}function Fe(e){return e===-2||e===-1||e===32}const Qu=br(new RegExp("\\p{P}|\\p{S}","u")),Vr=br(/\s/);function br(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Mi(e){const t=[];let n=-1,a=0,s=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&At(e.charCodeAt(n+1))&&At(e.charCodeAt(n+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const d=e.charCodeAt(n+1);o<56320&&d>56319&&d<57344?(l=String.fromCharCode(o,d),s=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(a,n),encodeURIComponent(l)),a=n+s+1,l=""),s&&(n+=s,s=0)}return t.join("")+e.slice(a)}function Me(e,t,n,a){const s=a?a-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(f){return Fe(f)?(e.enter(n),d(f)):t(f)}function d(f){return Fe(f)&&o++<s?(e.consume(f),d):(e.exit(n),t(f))}}const Eb={tokenize:Tb};function Tb(e){const t=e.attempt(this.parser.constructs.contentInitial,a,s);let n;return t;function a(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Me(e,t,"linePrefix")}function s(d){return e.enter("paragraph"),o(d)}function o(d){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(d)}function l(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return be(d)?(e.consume(d),e.exit("chunkText"),o):(e.consume(d),l)}}const yb={tokenize:xb},nm={tokenize:bb};function xb(e){const t=this,n=[];let a=0,s,o,l;return d;function d(U){if(a<n.length){const K=n[a];return t.containerState=K[1],e.attempt(K[0].continuation,f,h)(U)}return h(U)}function f(U){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&F();const K=t.events.length;let $=K,j;for(;$--;)if(t.events[$][0]==="exit"&&t.events[$][1].type==="chunkFlow"){j=t.events[$][1].end;break}R(a);let te=K;for(;te<t.events.length;)t.events[te][1].end={...j},te++;return Qt(t.events,$+1,0,t.events.slice(K)),t.events.length=te,h(U)}return d(U)}function h(U){if(a===n.length){if(!s)return x(U);if(s.currentConstruct&&s.currentConstruct.concrete)return S(U);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(nm,E,g)(U)}function E(U){return s&&F(),R(a),x(U)}function g(U){return t.parser.lazy[t.now().line]=a!==n.length,l=t.now().offset,S(U)}function x(U){return t.containerState={},e.attempt(nm,b,S)(U)}function b(U){return a++,n.push([t.currentConstruct,t.containerState]),x(U)}function S(U){if(U===null){s&&F(),R(0),e.consume(U);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),A(U)}function A(U){if(U===null){P(e.exit("chunkFlow"),!0),R(0),e.consume(U);return}return be(U)?(e.consume(U),P(e.exit("chunkFlow")),a=0,t.interrupt=void 0,d):(e.consume(U),A)}function P(U,K){const $=t.sliceStream(U);if(K&&$.push(null),U.previous=o,o&&(o.next=U),o=U,s.defineSkip(U.start),s.write($),t.parser.lazy[U.start.line]){let j=s.events.length;for(;j--;)if(s.events[j][1].start.offset<l&&(!s.events[j][1].end||s.events[j][1].end.offset>l))return;const te=t.events.length;let ue=te,fe,B;for(;ue--;)if(t.events[ue][0]==="exit"&&t.events[ue][1].type==="chunkFlow"){if(fe){B=t.events[ue][1].end;break}fe=!0}for(R(a),j=te;j<t.events.length;)t.events[j][1].end={...B},j++;Qt(t.events,ue+1,0,t.events.slice(te)),t.events.length=j}}function R(U){let K=n.length;for(;K-- >U;){const $=n[K];t.containerState=$[1],$[0].exit.call(t,e)}n.length=U}function F(){s.write([null]),o=void 0,s=void 0,t.containerState._closeFlow=void 0}}function bb(e,t,n){return Me(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Li(e){if(e===null||Ve(e)||Vr(e))return 1;if(Qu(e))return 2}function Gu(e,t,n){const a=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!a.includes(o)&&(t=o(t,n),a.push(o))}return t}const Rc={name:"attention",resolveAll:kb,tokenize:Cb};function kb(e,t){let n=-1,a,s,o,l,d,f,h,E;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[a][1].end},x={...e[n][1].start};rm(g,-f),rm(x,f),l={type:f>1?"strongSequence":"emphasisSequence",start:g,end:{...e[a][1].end}},d={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:x},o={type:f>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},s={type:f>1?"strong":"emphasis",start:{...l.start},end:{...d.end}},e[a][1].end={...l.start},e[n][1].start={...d.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=rn(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=rn(h,[["enter",s,t],["enter",l,t],["exit",l,t],["enter",o,t]]),h=rn(h,Gu(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=rn(h,[["exit",o,t],["enter",d,t],["exit",d,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(E=2,h=rn(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):E=0,Qt(e,a-1,n-a+3,h),n=a+h.length-E-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Cb(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,s=Li(a);let o;return l;function l(f){return o=f,e.enter("attentionSequence"),d(f)}function d(f){if(f===o)return e.consume(f),d;const h=e.exit("attentionSequence"),E=Li(f),g=!E||E===2&&s||n.includes(f),x=!s||s===2&&E||n.includes(a);return h._open=!!(o===42?g:g&&(s||!x)),h._close=!!(o===42?x:x&&(E||!g)),t(f)}}function rm(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const _b={name:"autolink",tokenize:Sb};function Sb(e,t,n){let a=0;return s;function s(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(b){return Rt(b)?(e.consume(b),l):b===64?n(b):h(b)}function l(b){return b===43||b===45||b===46||At(b)?(a=1,d(b)):h(b)}function d(b){return b===58?(e.consume(b),a=0,f):(b===43||b===45||b===46||At(b))&&a++<32?(e.consume(b),d):(a=0,h(b))}function f(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||Du(b)?n(b):(e.consume(b),f)}function h(b){return b===64?(e.consume(b),E):pb(b)?(e.consume(b),h):n(b)}function E(b){return At(b)?g(b):n(b)}function g(b){return b===46?(e.consume(b),a=0,E):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):x(b)}function x(b){if((b===45||At(b))&&a++<63){const S=b===45?x:g;return e.consume(b),S}return n(b)}}const rs={partial:!0,tokenize:Nb};function Nb(e,t,n){return a;function a(o){return Fe(o)?Me(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||be(o)?t(o):n(o)}}const g1={continuation:{tokenize:vb},exit:wb,name:"blockQuote",tokenize:Ab};function Ab(e,t,n){const a=this;return s;function s(l){if(l===62){const d=a.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return Fe(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function vb(e,t,n){const a=this;return s;function s(l){return Fe(l)?Me(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(g1,t,n)(l)}}function wb(e){e.exit("blockQuote")}const E1={name:"characterEscape",tokenize:Ib};function Ib(e,t,n){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return gb(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const T1={name:"characterReference",tokenize:Lb};function Lb(e,t,n){const a=this;let s=0,o,l;return d;function d(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),f}function f(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,l=At,E(g))}function h(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=mb,E):(e.enter("characterReferenceValue"),o=7,l=Lc,E(g))}function E(g){if(g===59&&s){const x=e.exit("characterReferenceValue");return l===At&&!hd(a.sliceSerialize(x))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(g)&&s++<o?(e.consume(g),E):n(g)}}const im={partial:!0,tokenize:Ob},am={concrete:!0,name:"codeFenced",tokenize:Rb};function Rb(e,t,n){const a=this,s={partial:!0,tokenize:$};let o=0,l=0,d;return f;function f(j){return h(j)}function h(j){const te=a.events[a.events.length-1];return o=te&&te[1].type==="linePrefix"?te[2].sliceSerialize(te[1],!0).length:0,d=j,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),E(j)}function E(j){return j===d?(l++,e.consume(j),E):l<3?n(j):(e.exit("codeFencedFenceSequence"),Fe(j)?Me(e,g,"whitespace")(j):g(j))}function g(j){return j===null||be(j)?(e.exit("codeFencedFence"),a.interrupt?t(j):e.check(im,A,K)(j)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(j))}function x(j){return j===null||be(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(j)):Fe(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Me(e,b,"whitespace")(j)):j===96&&j===d?n(j):(e.consume(j),x)}function b(j){return j===null||be(j)?g(j):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(j))}function S(j){return j===null||be(j)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(j)):j===96&&j===d?n(j):(e.consume(j),S)}function A(j){return e.attempt(s,K,P)(j)}function P(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),R}function R(j){return o>0&&Fe(j)?Me(e,F,"linePrefix",o+1)(j):F(j)}function F(j){return j===null||be(j)?e.check(im,A,K)(j):(e.enter("codeFlowValue"),U(j))}function U(j){return j===null||be(j)?(e.exit("codeFlowValue"),F(j)):(e.consume(j),U)}function K(j){return e.exit("codeFenced"),t(j)}function $(j,te,ue){let fe=0;return B;function B(Y){return j.enter("lineEnding"),j.consume(Y),j.exit("lineEnding"),ie}function ie(Y){return j.enter("codeFencedFence"),Fe(Y)?Me(j,ce,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):ce(Y)}function ce(Y){return Y===d?(j.enter("codeFencedFenceSequence"),ke(Y)):ue(Y)}function ke(Y){return Y===d?(fe++,j.consume(Y),ke):fe>=l?(j.exit("codeFencedFenceSequence"),Fe(Y)?Me(j,de,"whitespace")(Y):de(Y)):ue(Y)}function de(Y){return Y===null||be(Y)?(j.exit("codeFencedFence"),te(Y)):ue(Y)}}}function Ob(e,t,n){const a=this;return s;function s(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return a.parser.lazy[a.now().line]?n(l):t(l)}}const ic={name:"codeIndented",tokenize:Pb},Db={partial:!0,tokenize:Mb};function Pb(e,t,n){const a=this;return s;function s(h){return e.enter("codeIndented"),Me(e,o,"linePrefix",5)(h)}function o(h){const E=a.events[a.events.length-1];return E&&E[1].type==="linePrefix"&&E[2].sliceSerialize(E[1],!0).length>=4?l(h):n(h)}function l(h){return h===null?f(h):be(h)?e.attempt(Db,l,f)(h):(e.enter("codeFlowValue"),d(h))}function d(h){return h===null||be(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),d)}function f(h){return e.exit("codeIndented"),t(h)}}function Mb(e,t,n){const a=this;return s;function s(l){return a.parser.lazy[a.now().line]?n(l):be(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):Me(e,o,"linePrefix",5)(l)}function o(l){const d=a.events[a.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(l):be(l)?s(l):n(l)}}const Fb={name:"codeText",previous:Ub,resolve:Bb,tokenize:jb};function Bb(e){let t=e.length-4,n=3,a,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="codeTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function Ub(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function jb(e,t,n){let a=0,s,o;return l;function l(g){return e.enter("codeText"),e.enter("codeTextSequence"),d(g)}function d(g){return g===96?(e.consume(g),a++,d):(e.exit("codeTextSequence"),f(g))}function f(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),f):g===96?(o=e.enter("codeTextSequence"),s=0,E(g)):be(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),f):(e.enter("codeTextData"),h(g))}function h(g){return g===null||g===32||g===96||be(g)?(e.exit("codeTextData"),f(g)):(e.consume(g),h)}function E(g){return g===96?(e.consume(g),s++,E):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",h(g))}}class Hb{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 a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const s=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&La(this.left,a),o.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),La(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),La(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);La(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);La(this.left,n.reverse())}}}function La(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 y1(e){const t={};let n=-1,a,s,o,l,d,f,h;const E=new Hb(e);for(;++n<E.length;){for(;n in t;)n=t[n];if(a=E.get(n),n&&a[1].type==="chunkFlow"&&E.get(n-1)[1].type==="listItemPrefix"&&(f=a[1]._tokenizer.events,o=0,o<f.length&&f[o][1].type==="lineEndingBlank"&&(o+=2),o<f.length&&f[o][1].type==="content"))for(;++o<f.length&&f[o][1].type!=="content";)f[o][1].type==="chunkText"&&(f[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,zb(E,n)),n=t[n],h=!0);else if(a[1]._container){for(o=n,s=void 0;o--;)if(l=E.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(s&&(E.get(s)[1].type="lineEndingBlank"),l[1].type="lineEnding",s=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;s&&(a[1].end={...E.get(s)[1].start},d=E.slice(s,n),d.unshift(a),E.splice(s,n-s+1,d))}}return Qt(e,0,Number.POSITIVE_INFINITY,E.slice(0)),!h}function zb(e,t){const n=e.get(t)[1],a=e.get(t)[2];let s=t-1;const o=[];let l=n._tokenizer;l||(l=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const d=l.events,f=[],h={};let E,g,x=-1,b=n,S=0,A=0;const P=[A];for(;b;){for(;e.get(++s)[1]!==b;);o.push(s),b._tokenizer||(E=a.sliceStream(b),b.next||E.push(null),g&&l.defineSkip(b.start),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(E),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),g=b,b=b.next}for(b=n;++x<d.length;)d[x][0]==="exit"&&d[x-1][0]==="enter"&&d[x][1].type===d[x-1][1].type&&d[x][1].start.line!==d[x][1].end.line&&(A=x+1,P.push(A),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(l.events=[],b?(b._tokenizer=void 0,b.previous=void 0):P.pop(),x=P.length;x--;){const R=d.slice(P[x],P[x+1]),F=o.pop();f.push([F,F+R.length-1]),e.splice(F,2,R)}for(f.reverse(),x=-1;++x<f.length;)h[S+f[x][0]]=S+f[x][1],S+=f[x][1]-f[x][0]-1;return h}const $b={resolve:Yb,tokenize:Vb},Wb={partial:!0,tokenize:qb};function Yb(e){return y1(e),e}function Vb(e,t){let n;return a;function a(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(d)}function s(d){return d===null?o(d):be(d)?e.check(Wb,l,o)(d):(e.consume(d),s)}function o(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function l(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function qb(e,t,n){const a=this;return s;function s(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Me(e,o,"linePrefix")}function o(l){if(l===null||be(l))return n(l);const d=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(l):e.interrupt(a.parser.constructs.flow,n,t)(l)}}function x1(e,t,n,a,s,o,l,d,f){const h=f||Number.POSITIVE_INFINITY;let E=0;return g;function g(R){return R===60?(e.enter(a),e.enter(s),e.enter(o),e.consume(R),e.exit(o),x):R===null||R===32||R===41||Du(R)?n(R):(e.enter(a),e.enter(l),e.enter(d),e.enter("chunkString",{contentType:"string"}),A(R))}function x(R){return R===62?(e.enter(o),e.consume(R),e.exit(o),e.exit(s),e.exit(a),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),b(R))}function b(R){return R===62?(e.exit("chunkString"),e.exit(d),x(R)):R===null||R===60||be(R)?n(R):(e.consume(R),R===92?S:b)}function S(R){return R===60||R===62||R===92?(e.consume(R),b):b(R)}function A(R){return!E&&(R===null||R===41||Ve(R))?(e.exit("chunkString"),e.exit(d),e.exit(l),e.exit(a),t(R)):E<h&&R===40?(e.consume(R),E++,A):R===41?(e.consume(R),E--,A):R===null||R===32||R===40||Du(R)?n(R):(e.consume(R),R===92?P:A)}function P(R){return R===40||R===41||R===92?(e.consume(R),A):A(R)}}function b1(e,t,n,a,s,o){const l=this;let d=0,f;return h;function h(b){return e.enter(a),e.enter(s),e.consume(b),e.exit(s),e.enter(o),E}function E(b){return d>999||b===null||b===91||b===93&&!f||b===94&&!d&&"_hiddenFootnoteSupport"in l.parser.constructs?n(b):b===93?(e.exit(o),e.enter(s),e.consume(b),e.exit(s),e.exit(a),t):be(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),E):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||b===91||b===93||be(b)||d++>999?(e.exit("chunkString"),E(b)):(e.consume(b),f||(f=!Fe(b)),b===92?x:g)}function x(b){return b===91||b===92||b===93?(e.consume(b),d++,g):g(b)}}function k1(e,t,n,a,s,o){let l;return d;function d(x){return x===34||x===39||x===40?(e.enter(a),e.enter(s),e.consume(x),e.exit(s),l=x===40?41:x,f):n(x)}function f(x){return x===l?(e.enter(s),e.consume(x),e.exit(s),e.exit(a),t):(e.enter(o),h(x))}function h(x){return x===l?(e.exit(o),f(l)):x===null?n(x):be(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Me(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),E(x))}function E(x){return x===l||x===null||be(x)?(e.exit("chunkString"),h(x)):(e.consume(x),x===92?g:E)}function g(x){return x===l||x===92?(e.consume(x),E):E(x)}}function Ba(e,t){let n;return a;function a(s){return be(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,a):Fe(s)?Me(e,a,n?"linePrefix":"lineSuffix")(s):t(s)}}const Qb={name:"definition",tokenize:Kb},Gb={partial:!0,tokenize:Xb};function Kb(e,t,n){const a=this;let s;return o;function o(b){return e.enter("definition"),l(b)}function l(b){return b1.call(a,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function d(b){return s=En(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),f):n(b)}function f(b){return Ve(b)?Ba(e,h)(b):h(b)}function h(b){return x1(e,E,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function E(b){return e.attempt(Gb,g,g)(b)}function g(b){return Fe(b)?Me(e,x,"whitespace")(b):x(b)}function x(b){return b===null||be(b)?(e.exit("definition"),a.parser.defined.push(s),t(b)):n(b)}}function Xb(e,t,n){return a;function a(d){return Ve(d)?Ba(e,s)(d):n(d)}function s(d){return k1(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function o(d){return Fe(d)?Me(e,l,"whitespace")(d):l(d)}function l(d){return d===null||be(d)?t(d):n(d)}}const Jb={name:"hardBreakEscape",tokenize:Zb};function Zb(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return be(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const ek={name:"headingAtx",resolve:tk,tokenize:nk};function tk(e,t){let n=e.length-2,a=3,s,o;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(s={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},o={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},Qt(e,a,n-a+1,[["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t]])),e}function nk(e,t,n){let a=0;return s;function s(E){return e.enter("atxHeading"),o(E)}function o(E){return e.enter("atxHeadingSequence"),l(E)}function l(E){return E===35&&a++<6?(e.consume(E),l):E===null||Ve(E)?(e.exit("atxHeadingSequence"),d(E)):n(E)}function d(E){return E===35?(e.enter("atxHeadingSequence"),f(E)):E===null||be(E)?(e.exit("atxHeading"),t(E)):Fe(E)?Me(e,d,"whitespace")(E):(e.enter("atxHeadingText"),h(E))}function f(E){return E===35?(e.consume(E),f):(e.exit("atxHeadingSequence"),d(E))}function h(E){return E===null||E===35||Ve(E)?(e.exit("atxHeadingText"),d(E)):(e.consume(E),h)}}const rk=["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"],sm=["pre","script","style","textarea"],ik={concrete:!0,name:"htmlFlow",resolveTo:uk,tokenize:ok},ak={partial:!0,tokenize:ck},sk={partial:!0,tokenize:lk};function uk(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 ok(e,t,n){const a=this;let s,o,l,d,f;return h;function h(I){return E(I)}function E(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),g}function g(I){return I===33?(e.consume(I),x):I===47?(e.consume(I),o=!0,A):I===63?(e.consume(I),s=3,a.interrupt?t:C):Rt(I)?(e.consume(I),l=String.fromCharCode(I),P):n(I)}function x(I){return I===45?(e.consume(I),s=2,b):I===91?(e.consume(I),s=5,d=0,S):Rt(I)?(e.consume(I),s=4,a.interrupt?t:C):n(I)}function b(I){return I===45?(e.consume(I),a.interrupt?t:C):n(I)}function S(I){const Ne="CDATA[";return I===Ne.charCodeAt(d++)?(e.consume(I),d===Ne.length?a.interrupt?t:ce:S):n(I)}function A(I){return Rt(I)?(e.consume(I),l=String.fromCharCode(I),P):n(I)}function P(I){if(I===null||I===47||I===62||Ve(I)){const Ne=I===47,Ie=l.toLowerCase();return!Ne&&!o&&sm.includes(Ie)?(s=1,a.interrupt?t(I):ce(I)):rk.includes(l.toLowerCase())?(s=6,Ne?(e.consume(I),R):a.interrupt?t(I):ce(I)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(I):o?F(I):U(I))}return I===45||At(I)?(e.consume(I),l+=String.fromCharCode(I),P):n(I)}function R(I){return I===62?(e.consume(I),a.interrupt?t:ce):n(I)}function F(I){return Fe(I)?(e.consume(I),F):B(I)}function U(I){return I===47?(e.consume(I),B):I===58||I===95||Rt(I)?(e.consume(I),K):Fe(I)?(e.consume(I),U):B(I)}function K(I){return I===45||I===46||I===58||I===95||At(I)?(e.consume(I),K):$(I)}function $(I){return I===61?(e.consume(I),j):Fe(I)?(e.consume(I),$):U(I)}function j(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),f=I,te):Fe(I)?(e.consume(I),j):ue(I)}function te(I){return I===f?(e.consume(I),f=null,fe):I===null||be(I)?n(I):(e.consume(I),te)}function ue(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||Ve(I)?$(I):(e.consume(I),ue)}function fe(I){return I===47||I===62||Fe(I)?U(I):n(I)}function B(I){return I===62?(e.consume(I),ie):n(I)}function ie(I){return I===null||be(I)?ce(I):Fe(I)?(e.consume(I),ie):n(I)}function ce(I){return I===45&&s===2?(e.consume(I),ge):I===60&&s===1?(e.consume(I),pe):I===62&&s===4?(e.consume(I),O):I===63&&s===3?(e.consume(I),C):I===93&&s===5?(e.consume(I),oe):be(I)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(ak,G,ke)(I)):I===null||be(I)?(e.exit("htmlFlowData"),ke(I)):(e.consume(I),ce)}function ke(I){return e.check(sk,de,G)(I)}function de(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),Y}function Y(I){return I===null||be(I)?ke(I):(e.enter("htmlFlowData"),ce(I))}function ge(I){return I===45?(e.consume(I),C):ce(I)}function pe(I){return I===47?(e.consume(I),l="",X):ce(I)}function X(I){if(I===62){const Ne=l.toLowerCase();return sm.includes(Ne)?(e.consume(I),O):ce(I)}return Rt(I)&&l.length<8?(e.consume(I),l+=String.fromCharCode(I),X):ce(I)}function oe(I){return I===93?(e.consume(I),C):ce(I)}function C(I){return I===62?(e.consume(I),O):I===45&&s===2?(e.consume(I),C):ce(I)}function O(I){return I===null||be(I)?(e.exit("htmlFlowData"),G(I)):(e.consume(I),O)}function G(I){return e.exit("htmlFlow"),t(I)}}function lk(e,t,n){const a=this;return s;function s(l){return be(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return a.parser.lazy[a.now().line]?n(l):t(l)}}function ck(e,t,n){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(rs,t,n)}}const dk={name:"htmlText",tokenize:fk};function fk(e,t,n){const a=this;let s,o,l;return d;function d(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),f}function f(C){return C===33?(e.consume(C),h):C===47?(e.consume(C),$):C===63?(e.consume(C),U):Rt(C)?(e.consume(C),ue):n(C)}function h(C){return C===45?(e.consume(C),E):C===91?(e.consume(C),o=0,S):Rt(C)?(e.consume(C),F):n(C)}function E(C){return C===45?(e.consume(C),b):n(C)}function g(C){return C===null?n(C):C===45?(e.consume(C),x):be(C)?(l=g,pe(C)):(e.consume(C),g)}function x(C){return C===45?(e.consume(C),b):g(C)}function b(C){return C===62?ge(C):C===45?x(C):g(C)}function S(C){const O="CDATA[";return C===O.charCodeAt(o++)?(e.consume(C),o===O.length?A:S):n(C)}function A(C){return C===null?n(C):C===93?(e.consume(C),P):be(C)?(l=A,pe(C)):(e.consume(C),A)}function P(C){return C===93?(e.consume(C),R):A(C)}function R(C){return C===62?ge(C):C===93?(e.consume(C),R):A(C)}function F(C){return C===null||C===62?ge(C):be(C)?(l=F,pe(C)):(e.consume(C),F)}function U(C){return C===null?n(C):C===63?(e.consume(C),K):be(C)?(l=U,pe(C)):(e.consume(C),U)}function K(C){return C===62?ge(C):U(C)}function $(C){return Rt(C)?(e.consume(C),j):n(C)}function j(C){return C===45||At(C)?(e.consume(C),j):te(C)}function te(C){return be(C)?(l=te,pe(C)):Fe(C)?(e.consume(C),te):ge(C)}function ue(C){return C===45||At(C)?(e.consume(C),ue):C===47||C===62||Ve(C)?fe(C):n(C)}function fe(C){return C===47?(e.consume(C),ge):C===58||C===95||Rt(C)?(e.consume(C),B):be(C)?(l=fe,pe(C)):Fe(C)?(e.consume(C),fe):ge(C)}function B(C){return C===45||C===46||C===58||C===95||At(C)?(e.consume(C),B):ie(C)}function ie(C){return C===61?(e.consume(C),ce):be(C)?(l=ie,pe(C)):Fe(C)?(e.consume(C),ie):fe(C)}function ce(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),s=C,ke):be(C)?(l=ce,pe(C)):Fe(C)?(e.consume(C),ce):(e.consume(C),de)}function ke(C){return C===s?(e.consume(C),s=void 0,Y):C===null?n(C):be(C)?(l=ke,pe(C)):(e.consume(C),ke)}function de(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||Ve(C)?fe(C):(e.consume(C),de)}function Y(C){return C===47||C===62||Ve(C)?fe(C):n(C)}function ge(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function pe(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),X}function X(C){return Fe(C)?Me(e,oe,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):oe(C)}function oe(C){return e.enter("htmlTextData"),l(C)}}const pd={name:"labelEnd",resolveAll:gk,resolveTo:Ek,tokenize:Tk},hk={tokenize:yk},pk={tokenize:xk},mk={tokenize:bk};function gk(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const s=a.type==="labelImage"?4:2;a.type="data",t+=s}}return e.length!==n.length&&Qt(e,0,e.length,n),e}function Ek(e,t){let n=e.length,a=0,s,o,l,d;for(;n--;)if(s=e[n][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=n,s.type!=="labelLink")){a=2;break}}else s.type==="labelEnd"&&(l=n);const f={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},E={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[l-2][1].start}};return d=[["enter",f,t],["enter",h,t]],d=rn(d,e.slice(o+1,o+a+3)),d=rn(d,[["enter",E,t]]),d=rn(d,Gu(t.parser.constructs.insideSpan.null,e.slice(o+a+4,l-3),t)),d=rn(d,[["exit",E,t],e[l-2],e[l-1],["exit",h,t]]),d=rn(d,e.slice(l+1)),d=rn(d,[["exit",f,t]]),Qt(e,o,e.length,d),e}function Tk(e,t,n){const a=this;let s=a.events.length,o,l;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){o=a.events[s][1];break}return d;function d(x){return o?o._inactive?g(x):(l=a.parser.defined.includes(En(a.sliceSerialize({start:o.end,end:a.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(hk,E,l?E:g)(x):x===91?e.attempt(pk,E,l?h:g)(x):l?E(x):g(x)}function h(x){return e.attempt(mk,E,g)(x)}function E(x){return t(x)}function g(x){return o._balanced=!0,n(x)}}function yk(e,t,n){return a;function a(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),s}function s(g){return Ve(g)?Ba(e,o)(g):o(g)}function o(g){return g===41?E(g):x1(e,l,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function l(g){return Ve(g)?Ba(e,f)(g):E(g)}function d(g){return n(g)}function f(g){return g===34||g===39||g===40?k1(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):E(g)}function h(g){return Ve(g)?Ba(e,E)(g):E(g)}function E(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function xk(e,t,n){const a=this;return s;function s(d){return b1.call(a,e,o,l,"reference","referenceMarker","referenceString")(d)}function o(d){return a.parser.defined.includes(En(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function l(d){return n(d)}}function bk(e,t,n){return a;function a(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),s}function s(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const kk={name:"labelStartImage",resolveAll:pd.resolveAll,tokenize:Ck};function Ck(e,t,n){const a=this;return s;function s(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),o}function o(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),l):n(d)}function l(d){return d===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):t(d)}}const _k={name:"labelStartLink",resolveAll:pd.resolveAll,tokenize:Sk};function Sk(e,t,n){const a=this;return s;function s(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(l):t(l)}}const ac={name:"lineEnding",tokenize:Nk};function Nk(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Me(e,t,"linePrefix")}}const Iu={name:"thematicBreak",tokenize:Ak};function Ak(e,t,n){let a=0,s;return o;function o(h){return e.enter("thematicBreak"),l(h)}function l(h){return s=h,d(h)}function d(h){return h===s?(e.enter("thematicBreakSequence"),f(h)):a>=3&&(h===null||be(h))?(e.exit("thematicBreak"),t(h)):n(h)}function f(h){return h===s?(e.consume(h),a++,f):(e.exit("thematicBreakSequence"),Fe(h)?Me(e,d,"whitespace")(h):d(h))}}const jt={continuation:{tokenize:Lk},exit:Ok,name:"list",tokenize:Ik},vk={partial:!0,tokenize:Dk},wk={partial:!0,tokenize:Rk};function Ik(e,t,n){const a=this,s=a.events[a.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,l=0;return d;function d(b){const S=a.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||b===a.containerState.marker:Lc(b)){if(a.containerState.type||(a.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Iu,n,h)(b):h(b);if(!a.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(b)}return n(b)}function f(b){return Lc(b)&&++l<10?(e.consume(b),f):(!a.interrupt||l<2)&&(a.containerState.marker?b===a.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),h(b)):n(b)}function h(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||b,e.check(rs,a.interrupt?n:E,e.attempt(vk,x,g))}function E(b){return a.containerState.initialBlankLine=!0,o++,x(b)}function g(b){return Fe(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),x):n(b)}function x(b){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function Lk(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(rs,s,o);function s(d){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,Me(e,t,"listItemIndent",a.containerState.size+1)(d)}function o(d){return a.containerState.furtherBlankLines||!Fe(d)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,l(d)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(wk,t,l)(d))}function l(d){return a.containerState._closeFlow=!0,a.interrupt=void 0,Me(e,e.attempt(jt,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function Rk(e,t,n){const a=this;return Me(e,s,"listItemIndent",a.containerState.size+1);function s(o){const l=a.events[a.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===a.containerState.size?t(o):n(o)}}function Ok(e){e.exit(this.containerState.type)}function Dk(e,t,n){const a=this;return Me(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const l=a.events[a.events.length-1];return!Fe(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const um={name:"setextUnderline",resolveTo:Pk,tokenize:Mk};function Pk(e,t){let n=e.length,a,s,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",l,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=l,e.push(["exit",l,t]),e}function Mk(e,t,n){const a=this;let s;return o;function o(h){let E=a.events.length,g;for(;E--;)if(a.events[E][1].type!=="lineEnding"&&a.events[E][1].type!=="linePrefix"&&a.events[E][1].type!=="content"){g=a.events[E][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||g)?(e.enter("setextHeadingLine"),s=h,l(h)):n(h)}function l(h){return e.enter("setextHeadingLineSequence"),d(h)}function d(h){return h===s?(e.consume(h),d):(e.exit("setextHeadingLineSequence"),Fe(h)?Me(e,f,"lineSuffix")(h):f(h))}function f(h){return h===null||be(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const Fk={tokenize:Bk};function Bk(e){const t=this,n=e.attempt(rs,a,e.attempt(this.parser.constructs.flowInitial,s,Me(e,e.attempt(this.parser.constructs.flow,s,e.attempt($b,s)),"linePrefix")));return n;function a(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Uk={resolveAll:_1()},jk=C1("string"),Hk=C1("text");function C1(e){return{resolveAll:_1(e==="text"?zk:void 0),tokenize:t};function t(n){const a=this,s=this.parser.constructs[e],o=n.attempt(s,l,d);return l;function l(E){return h(E)?o(E):d(E)}function d(E){if(E===null){n.consume(E);return}return n.enter("data"),n.consume(E),f}function f(E){return h(E)?(n.exit("data"),o(E)):(n.consume(E),f)}function h(E){if(E===null)return!0;const g=s[E];let x=-1;if(g)for(;++x<g.length;){const b=g[x];if(!b.previous||b.previous.call(a,a.previous))return!0}return!1}}}function _1(e){return t;function t(n,a){let s=-1,o;for(;++s<=n.length;)o===void 0?n[s]&&n[s][1].type==="data"&&(o=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==o+2&&(n[o][1].end=n[s-1][1].end,n.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(n,a):n}}function zk(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 a=e[n-1][1],s=t.sliceStream(a);let o=s.length,l=-1,d=0,f;for(;o--;){const h=s[o];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)d++,l--;if(l)break;l=-1}else if(h===-2)f=!0,d++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const h={type:n===e.length||f||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:a.start._bufferIndex+l,_index:a.start._index+o,line:a.end.line,column:a.end.column-d,offset:a.end.offset-d},end:{...a.end}};a.end={...h.start},a.start.offset===a.end.offset?Object.assign(a,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const $k={42:jt,43:jt,45:jt,48:jt,49:jt,50:jt,51:jt,52:jt,53:jt,54:jt,55:jt,56:jt,57:jt,62:g1},Wk={91:Qb},Yk={[-2]:ic,[-1]:ic,32:ic},Vk={35:ek,42:Iu,45:[um,Iu],60:ik,61:um,95:Iu,96:am,126:am},qk={38:T1,92:E1},Qk={[-5]:ac,[-4]:ac,[-3]:ac,33:kk,38:T1,42:Rc,60:[_b,dk],91:_k,92:[Jb,E1],93:pd,95:Rc,96:Fb},Gk={null:[Rc,Uk]},Kk={null:[42,95]},Xk={null:[]},Jk=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Kk,contentInitial:Wk,disable:Xk,document:$k,flow:Vk,flowInitial:Yk,insideSpan:Gk,string:qk,text:Qk},Symbol.toStringTag,{value:"Module"}));function Zk(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},o=[];let l=[],d=[];const f={attempt:te($),check:te(j),consume:F,enter:U,exit:K,interrupt:te(j,{interrupt:!0})},h={code:null,containerState:{},defineSkip:A,events:[],now:S,parser:e,previous:null,sliceSerialize:x,sliceStream:b,write:g};let E=t.tokenize.call(h,f);return t.resolveAll&&o.push(t),h;function g(ie){return l=rn(l,ie),P(),l[l.length-1]!==null?[]:(ue(t,0),h.events=Gu(o,h.events,h),h.events)}function x(ie,ce){return tC(b(ie),ce)}function b(ie){return eC(l,ie)}function S(){const{_bufferIndex:ie,_index:ce,line:ke,column:de,offset:Y}=a;return{_bufferIndex:ie,_index:ce,line:ke,column:de,offset:Y}}function A(ie){s[ie.line]=ie.column,B()}function P(){let ie;for(;a._index<l.length;){const ce=l[a._index];if(typeof ce=="string")for(ie=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===ie&&a._bufferIndex<ce.length;)R(ce.charCodeAt(a._bufferIndex));else R(ce)}}function R(ie){E=E(ie)}function F(ie){be(ie)?(a.line++,a.column=1,a.offset+=ie===-3?2:1,B()):ie!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===l[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=ie}function U(ie,ce){const ke=ce||{};return ke.type=ie,ke.start=S(),h.events.push(["enter",ke,h]),d.push(ke),ke}function K(ie){const ce=d.pop();return ce.end=S(),h.events.push(["exit",ce,h]),ce}function $(ie,ce){ue(ie,ce.from)}function j(ie,ce){ce.restore()}function te(ie,ce){return ke;function ke(de,Y,ge){let pe,X,oe,C;return Array.isArray(de)?G(de):"tokenize"in de?G([de]):O(de);function O(Se){return je;function je(Re){const ze=Re!==null&&Se[Re],st=Re!==null&&Se.null,On=[...Array.isArray(ze)?ze:ze?[ze]:[],...Array.isArray(st)?st:st?[st]:[]];return G(On)(Re)}}function G(Se){return pe=Se,X=0,Se.length===0?ge:I(Se[X])}function I(Se){return je;function je(Re){return C=fe(),oe=Se,Se.partial||(h.currentConstruct=Se),Se.name&&h.parser.constructs.disable.null.includes(Se.name)?Ie():Se.tokenize.call(ce?Object.assign(Object.create(h),ce):h,f,Ne,Ie)(Re)}}function Ne(Se){return ie(oe,C),Y}function Ie(Se){return C.restore(),++X<pe.length?I(pe[X]):ge}}}function ue(ie,ce){ie.resolveAll&&!o.includes(ie)&&o.push(ie),ie.resolve&&Qt(h.events,ce,h.events.length-ce,ie.resolve(h.events.slice(ce),h)),ie.resolveTo&&(h.events=ie.resolveTo(h.events,h))}function fe(){const ie=S(),ce=h.previous,ke=h.currentConstruct,de=h.events.length,Y=Array.from(d);return{from:de,restore:ge};function ge(){a=ie,h.previous=ce,h.currentConstruct=ke,h.events.length=de,d=Y,B()}}function B(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function eC(e,t){const n=t.start._index,a=t.start._bufferIndex,s=t.end._index,o=t.end._bufferIndex;let l;if(n===s)l=[e[n].slice(a,o)];else{if(l=e.slice(n,s),a>-1){const d=l[0];typeof d=="string"?l[0]=d.slice(a):l.shift()}o>0&&l.push(e[s].slice(0,o))}return l}function tC(e,t){let n=-1;const a=[];let s;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
|
58
58
|
`;break}case-3:{l=`\r
|
|
59
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&s)continue;l=" ";break}default:l=String.fromCharCode(o)}s=o===-2,a.push(l)}return a.join("")}function tC(e){const a={constructs:p1([Xk,...(e||{}).extensions||[]]),content:s(gb),defined:[],document:s(Tb),flow:s(Mk),lazy:{},string:s(Uk),text:s(jk)};return a;function s(o){return l;function l(d){return Jk(a,o,d)}}}function nC(e){for(;!y1(e););return e}const om=/[\0\t\n\r]/g;function rC(){let e=1,t="",n=!0,a;return s;function s(o,l,d){const f=[];let h,E,g,x,b;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(om.lastIndex=g,h=om.exec(o),x=h&&h.index!==void 0?h.index:o.length,b=o.charCodeAt(x),!h){t=o.slice(g);break}if(b===10&&g===x&&a)f.push(-3),a=void 0;else switch(a&&(f.push(-5),a=void 0),g<x&&(f.push(o.slice(g,x)),e+=x-g),b){case 0:{f.push(65533),e++;break}case 9:{for(E=Math.ceil(e/4)*4,f.push(-2);e++<E;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:a=!0,e=1}g=x+1}return d&&(a&&f.push(-5),t&&f.push(t),f.push(null)),f}}const iC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function aC(e){return e.replace(iC,sC)}function sC(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),o=s===120||s===88;return m1(n.slice(o?2:1),o?16:10)}return hd(n)||e}const S1={}.hasOwnProperty;function uC(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),oC(n)(nC(tC(n).document().write(rC()(e,t,!0))))}function oC(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ti),autolinkProtocol:fe,autolinkEmail:fe,atxHeading:o(Hi),blockQuote:o(st),characterEscape:fe,characterReference:fe,codeFenced:o(On),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(On,l),codeText:o(os,l),codeTextData:fe,data:fe,codeFlowValue:fe,definition:o(Zr),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(ji),hardBreakEscape:o(zi),hardBreakTrailing:o(zi),htmlFlow:o(ei,l),htmlFlowData:fe,htmlText:o(ei,l),htmlTextData:fe,image:o(ls),label:l,link:o(ti),listItem:o(qn),listItemValue:x,listOrdered:o(Vn,g),listUnordered:o(Vn),paragraph:o($i),reference:I,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(Hi),strong:o(cs),thematicBreak:o(fs)},exit:{atxHeading:f(),atxHeadingSequence:$,autolink:f(),autolinkEmail:ze,autolinkProtocol:Re,blockQuote:f(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:Ie,characterReferenceMarkerNumeric:Ie,characterReferenceValue:Se,characterReference:je,codeFenced:f(P),codeFencedFence:A,codeFencedFenceInfo:b,codeFencedFenceMeta:S,codeFlowValue:B,codeIndented:f(R),codeText:f(Y),codeTextData:B,data:B,definition:f(),definitionDestinationString:K,definitionLabelString:F,definitionTitleString:U,emphasis:f(),hardBreakEscape:f(ce),hardBreakTrailing:f(ce),htmlFlow:f(ke),htmlFlowData:B,htmlText:f(de),htmlTextData:B,image:f(pe),label:oe,labelText:X,lineEnding:ie,link:f(ge),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:Ne,resourceDestinationString:C,resourceTitleString:O,resource:G,setextHeading:f(ue),setextHeadingLineSequence:te,setextHeadingText:j,strong:f(),thematicBreak:f()}};N1(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(Q){let le={type:"root",children:[]};const Ae={stack:[le],tokenStack:[],config:t,enter:d,exit:h,buffer:l,resume:E,data:n},Oe=[];let Be=-1;for(;++Be<Q.length;)if(Q[Be][1].type==="listOrdered"||Q[Be][1].type==="listUnordered")if(Q[Be][0]==="enter")Oe.push(Be);else{const Et=Oe.pop();Be=s(Q,Et,Be)}for(Be=-1;++Be<Q.length;){const Et=t[Q[Be][0]];S1.call(Et,Q[Be][1].type)&&Et[Q[Be][1].type].call(Object.assign({sliceSerialize:Q[Be][2].sliceSerialize},Ae),Q[Be][1])}if(Ae.tokenStack.length>0){const Et=Ae.tokenStack[Ae.tokenStack.length-1];(Et[1]||lm).call(Ae,void 0,Et[0])}for(le.position={start:pr(Q.length>0?Q[0][1].start:{line:1,column:1,offset:0}),end:pr(Q.length>0?Q[Q.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be<t.transforms.length;)le=t.transforms[Be](le)||le;return le}function s(Q,le,Ae){let Oe=le-1,Be=-1,Et=!1,Dn,Kt,Qn,_r;for(;++Oe<=Ae;){const Tt=Q[Oe];switch(Tt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Tt[0]==="enter"?Be++:Be--,_r=void 0;break}case"lineEndingBlank":{Tt[0]==="enter"&&(Dn&&!_r&&!Be&&!Qn&&(Qn=Oe),_r=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:_r=void 0}if(!Be&&Tt[0]==="enter"&&Tt[1].type==="listItemPrefix"||Be===-1&&Tt[0]==="exit"&&(Tt[1].type==="listUnordered"||Tt[1].type==="listOrdered")){if(Dn){let kn=Oe;for(Kt=void 0;kn--;){const zt=Q[kn];if(zt[1].type==="lineEnding"||zt[1].type==="lineEndingBlank"){if(zt[0]==="exit")continue;Kt&&(Q[Kt][1].type="lineEndingBlank",Et=!0),zt[1].type="lineEnding",Kt=kn}else if(!(zt[1].type==="linePrefix"||zt[1].type==="blockQuotePrefix"||zt[1].type==="blockQuotePrefixWhitespace"||zt[1].type==="blockQuoteMarker"||zt[1].type==="listItemIndent"))break}Qn&&(!Kt||Qn<Kt)&&(Dn._spread=!0),Dn.end=Object.assign({},Kt?Q[Kt][1].start:Tt[1].end),Q.splice(Kt||Oe,0,["exit",Dn,Tt[2]]),Oe++,Ae++}if(Tt[1].type==="listItemPrefix"){const kn={type:"listItem",_spread:!1,start:Object.assign({},Tt[1].start),end:void 0};Dn=kn,Q.splice(Oe,0,["enter",kn,Tt[2]]),Oe++,Ae++,Qn=void 0,_r=!0}}}return Q[le][1]._spread=Et,Ae}function o(Q,le){return Ae;function Ae(Oe){d.call(this,Q(Oe),Oe),le&&le.call(this,Oe)}}function l(){this.stack.push({type:"fragment",children:[]})}function d(Q,le,Ae){this.stack[this.stack.length-1].children.push(Q),this.stack.push(Q),this.tokenStack.push([le,Ae||void 0]),Q.position={start:pr(le.start),end:void 0}}function f(Q){return le;function le(Ae){Q&&Q.call(this,Ae),h.call(this,Ae)}}function h(Q,le){const Ae=this.stack.pop(),Oe=this.tokenStack.pop();if(Oe)Oe[0].type!==Q.type&&(le?le.call(this,Q,Oe[0]):(Oe[1]||lm).call(this,Q,Oe[0]));else throw new Error("Cannot close `"+Q.type+"` ("+Fa({start:Q.start,end:Q.end})+"): it’s not open");Ae.position.end=pr(Q.end)}function E(){return fd(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(Q){if(this.data.expectingFirstListItemValue){const le=this.stack[this.stack.length-2];le.start=Number.parseInt(this.sliceSerialize(Q),10),this.data.expectingFirstListItemValue=void 0}}function b(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.lang=Q}function S(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.meta=Q}function A(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function P(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.value=Q.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function R(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.value=Q.replace(/(\r?\n|\r)$/g,"")}function F(Q){const le=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=le,Ae.identifier=En(this.sliceSerialize(Q)).toLowerCase()}function U(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.title=Q}function K(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.url=Q}function $(Q){const le=this.stack[this.stack.length-1];if(!le.depth){const Ae=this.sliceSerialize(Q).length;le.depth=Ae}}function j(){this.data.setextHeadingSlurpLineEnding=!0}function te(Q){const le=this.stack[this.stack.length-1];le.depth=this.sliceSerialize(Q).codePointAt(0)===61?1:2}function ue(){this.data.setextHeadingSlurpLineEnding=void 0}function fe(Q){const Ae=this.stack[this.stack.length-1].children;let Oe=Ae[Ae.length-1];(!Oe||Oe.type!=="text")&&(Oe=ds(),Oe.position={start:pr(Q.start),end:void 0},Ae.push(Oe)),this.stack.push(Oe)}function B(Q){const le=this.stack.pop();le.value+=this.sliceSerialize(Q),le.position.end=pr(Q.end)}function ie(Q){const le=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=le.children[le.children.length-1];Ae.position.end=pr(Q.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(le.type)&&(fe.call(this,Q),B.call(this,Q))}function ce(){this.data.atHardBreak=!0}function ke(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.value=Q}function de(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.value=Q}function Y(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.value=Q}function ge(){const Q=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";Q.type+="Reference",Q.referenceType=le,delete Q.url,delete Q.title}else delete Q.identifier,delete Q.label;this.data.referenceType=void 0}function pe(){const Q=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";Q.type+="Reference",Q.referenceType=le,delete Q.url,delete Q.title}else delete Q.identifier,delete Q.label;this.data.referenceType=void 0}function X(Q){const le=this.sliceSerialize(Q),Ae=this.stack[this.stack.length-2];Ae.label=aC(le),Ae.identifier=En(le).toLowerCase()}function oe(){const Q=this.stack[this.stack.length-1],le=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const Oe=Q.children;Ae.children=Oe}else Ae.alt=le}function C(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.url=Q}function O(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.title=Q}function G(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function Ne(Q){const le=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=le,Ae.identifier=En(this.sliceSerialize(Q)).toLowerCase(),this.data.referenceType="full"}function Ie(Q){this.data.characterReferenceType=Q.type}function Se(Q){const le=this.sliceSerialize(Q),Ae=this.data.characterReferenceType;let Oe;Ae?(Oe=m1(le,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Oe=hd(le);const Be=this.stack[this.stack.length-1];Be.value+=Oe}function je(Q){const le=this.stack.pop();le.position.end=pr(Q.end)}function Re(Q){B.call(this,Q);const le=this.stack[this.stack.length-1];le.url=this.sliceSerialize(Q)}function ze(Q){B.call(this,Q);const le=this.stack[this.stack.length-1];le.url="mailto:"+this.sliceSerialize(Q)}function st(){return{type:"blockquote",children:[]}}function On(){return{type:"code",lang:null,meta:null,value:""}}function os(){return{type:"inlineCode",value:""}}function Zr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ji(){return{type:"emphasis",children:[]}}function Hi(){return{type:"heading",depth:0,children:[]}}function zi(){return{type:"break"}}function ei(){return{type:"html",value:""}}function ls(){return{type:"image",title:null,url:"",alt:null}}function ti(){return{type:"link",title:null,url:"",children:[]}}function Vn(Q){return{type:"list",ordered:Q.type==="listOrdered",start:null,spread:Q._spread,children:[]}}function qn(Q){return{type:"listItem",spread:Q._spread,checked:null,children:[]}}function $i(){return{type:"paragraph",children:[]}}function cs(){return{type:"strong",children:[]}}function ds(){return{type:"text",value:""}}function fs(){return{type:"thematicBreak"}}}function pr(e){return{line:e.line,column:e.column,offset:e.offset}}function N1(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?N1(e,a):lC(e,a)}}function lC(e,t){let n;for(n in t)if(S1.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function lm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Fa({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Fa({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Fa({start:t.start,end:t.end})+") is still open")}function cC(e){const t=this;t.parser=n;function n(a){return uC(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function dC(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 fC(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
60
|
-
`}]}function
|
|
61
|
-
`:"",a={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(a.className=["language-"+s[0]]);let o={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function
|
|
59
|
+
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&s)continue;l=" ";break}default:l=String.fromCharCode(o)}s=o===-2,a.push(l)}return a.join("")}function nC(e){const a={constructs:p1([Jk,...(e||{}).extensions||[]]),content:s(Eb),defined:[],document:s(yb),flow:s(Fk),lazy:{},string:s(jk),text:s(Hk)};return a;function s(o){return l;function l(d){return Zk(a,o,d)}}}function rC(e){for(;!y1(e););return e}const om=/[\0\t\n\r]/g;function iC(){let e=1,t="",n=!0,a;return s;function s(o,l,d){const f=[];let h,E,g,x,b;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(om.lastIndex=g,h=om.exec(o),x=h&&h.index!==void 0?h.index:o.length,b=o.charCodeAt(x),!h){t=o.slice(g);break}if(b===10&&g===x&&a)f.push(-3),a=void 0;else switch(a&&(f.push(-5),a=void 0),g<x&&(f.push(o.slice(g,x)),e+=x-g),b){case 0:{f.push(65533),e++;break}case 9:{for(E=Math.ceil(e/4)*4,f.push(-2);e++<E;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:a=!0,e=1}g=x+1}return d&&(a&&f.push(-5),t&&f.push(t),f.push(null)),f}}const aC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function sC(e){return e.replace(aC,uC)}function uC(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),o=s===120||s===88;return m1(n.slice(o?2:1),o?16:10)}return hd(n)||e}const S1={}.hasOwnProperty;function oC(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),lC(n)(rC(nC(n).document().write(iC()(e,t,!0))))}function lC(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ti),autolinkProtocol:fe,autolinkEmail:fe,atxHeading:o(Hi),blockQuote:o(st),characterEscape:fe,characterReference:fe,codeFenced:o(On),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(On,l),codeText:o(os,l),codeTextData:fe,data:fe,codeFlowValue:fe,definition:o(Zr),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(ji),hardBreakEscape:o(zi),hardBreakTrailing:o(zi),htmlFlow:o(ei,l),htmlFlowData:fe,htmlText:o(ei,l),htmlTextData:fe,image:o(ls),label:l,link:o(ti),listItem:o(qn),listItemValue:x,listOrdered:o(Vn,g),listUnordered:o(Vn),paragraph:o($i),reference:I,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(Hi),strong:o(cs),thematicBreak:o(fs)},exit:{atxHeading:f(),atxHeadingSequence:$,autolink:f(),autolinkEmail:ze,autolinkProtocol:Re,blockQuote:f(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:Ie,characterReferenceMarkerNumeric:Ie,characterReferenceValue:Se,characterReference:je,codeFenced:f(P),codeFencedFence:A,codeFencedFenceInfo:b,codeFencedFenceMeta:S,codeFlowValue:B,codeIndented:f(R),codeText:f(Y),codeTextData:B,data:B,definition:f(),definitionDestinationString:K,definitionLabelString:F,definitionTitleString:U,emphasis:f(),hardBreakEscape:f(ce),hardBreakTrailing:f(ce),htmlFlow:f(ke),htmlFlowData:B,htmlText:f(de),htmlTextData:B,image:f(pe),label:oe,labelText:X,lineEnding:ie,link:f(ge),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:Ne,resourceDestinationString:C,resourceTitleString:O,resource:G,setextHeading:f(ue),setextHeadingLineSequence:te,setextHeadingText:j,strong:f(),thematicBreak:f()}};N1(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(Q){let le={type:"root",children:[]};const Ae={stack:[le],tokenStack:[],config:t,enter:d,exit:h,buffer:l,resume:E,data:n},Oe=[];let Be=-1;for(;++Be<Q.length;)if(Q[Be][1].type==="listOrdered"||Q[Be][1].type==="listUnordered")if(Q[Be][0]==="enter")Oe.push(Be);else{const Et=Oe.pop();Be=s(Q,Et,Be)}for(Be=-1;++Be<Q.length;){const Et=t[Q[Be][0]];S1.call(Et,Q[Be][1].type)&&Et[Q[Be][1].type].call(Object.assign({sliceSerialize:Q[Be][2].sliceSerialize},Ae),Q[Be][1])}if(Ae.tokenStack.length>0){const Et=Ae.tokenStack[Ae.tokenStack.length-1];(Et[1]||lm).call(Ae,void 0,Et[0])}for(le.position={start:pr(Q.length>0?Q[0][1].start:{line:1,column:1,offset:0}),end:pr(Q.length>0?Q[Q.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be<t.transforms.length;)le=t.transforms[Be](le)||le;return le}function s(Q,le,Ae){let Oe=le-1,Be=-1,Et=!1,Dn,Kt,Qn,_r;for(;++Oe<=Ae;){const Tt=Q[Oe];switch(Tt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Tt[0]==="enter"?Be++:Be--,_r=void 0;break}case"lineEndingBlank":{Tt[0]==="enter"&&(Dn&&!_r&&!Be&&!Qn&&(Qn=Oe),_r=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:_r=void 0}if(!Be&&Tt[0]==="enter"&&Tt[1].type==="listItemPrefix"||Be===-1&&Tt[0]==="exit"&&(Tt[1].type==="listUnordered"||Tt[1].type==="listOrdered")){if(Dn){let kn=Oe;for(Kt=void 0;kn--;){const zt=Q[kn];if(zt[1].type==="lineEnding"||zt[1].type==="lineEndingBlank"){if(zt[0]==="exit")continue;Kt&&(Q[Kt][1].type="lineEndingBlank",Et=!0),zt[1].type="lineEnding",Kt=kn}else if(!(zt[1].type==="linePrefix"||zt[1].type==="blockQuotePrefix"||zt[1].type==="blockQuotePrefixWhitespace"||zt[1].type==="blockQuoteMarker"||zt[1].type==="listItemIndent"))break}Qn&&(!Kt||Qn<Kt)&&(Dn._spread=!0),Dn.end=Object.assign({},Kt?Q[Kt][1].start:Tt[1].end),Q.splice(Kt||Oe,0,["exit",Dn,Tt[2]]),Oe++,Ae++}if(Tt[1].type==="listItemPrefix"){const kn={type:"listItem",_spread:!1,start:Object.assign({},Tt[1].start),end:void 0};Dn=kn,Q.splice(Oe,0,["enter",kn,Tt[2]]),Oe++,Ae++,Qn=void 0,_r=!0}}}return Q[le][1]._spread=Et,Ae}function o(Q,le){return Ae;function Ae(Oe){d.call(this,Q(Oe),Oe),le&&le.call(this,Oe)}}function l(){this.stack.push({type:"fragment",children:[]})}function d(Q,le,Ae){this.stack[this.stack.length-1].children.push(Q),this.stack.push(Q),this.tokenStack.push([le,Ae||void 0]),Q.position={start:pr(le.start),end:void 0}}function f(Q){return le;function le(Ae){Q&&Q.call(this,Ae),h.call(this,Ae)}}function h(Q,le){const Ae=this.stack.pop(),Oe=this.tokenStack.pop();if(Oe)Oe[0].type!==Q.type&&(le?le.call(this,Q,Oe[0]):(Oe[1]||lm).call(this,Q,Oe[0]));else throw new Error("Cannot close `"+Q.type+"` ("+Fa({start:Q.start,end:Q.end})+"): it’s not open");Ae.position.end=pr(Q.end)}function E(){return fd(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(Q){if(this.data.expectingFirstListItemValue){const le=this.stack[this.stack.length-2];le.start=Number.parseInt(this.sliceSerialize(Q),10),this.data.expectingFirstListItemValue=void 0}}function b(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.lang=Q}function S(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.meta=Q}function A(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function P(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.value=Q.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function R(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.value=Q.replace(/(\r?\n|\r)$/g,"")}function F(Q){const le=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=le,Ae.identifier=En(this.sliceSerialize(Q)).toLowerCase()}function U(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.title=Q}function K(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.url=Q}function $(Q){const le=this.stack[this.stack.length-1];if(!le.depth){const Ae=this.sliceSerialize(Q).length;le.depth=Ae}}function j(){this.data.setextHeadingSlurpLineEnding=!0}function te(Q){const le=this.stack[this.stack.length-1];le.depth=this.sliceSerialize(Q).codePointAt(0)===61?1:2}function ue(){this.data.setextHeadingSlurpLineEnding=void 0}function fe(Q){const Ae=this.stack[this.stack.length-1].children;let Oe=Ae[Ae.length-1];(!Oe||Oe.type!=="text")&&(Oe=ds(),Oe.position={start:pr(Q.start),end:void 0},Ae.push(Oe)),this.stack.push(Oe)}function B(Q){const le=this.stack.pop();le.value+=this.sliceSerialize(Q),le.position.end=pr(Q.end)}function ie(Q){const le=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=le.children[le.children.length-1];Ae.position.end=pr(Q.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(le.type)&&(fe.call(this,Q),B.call(this,Q))}function ce(){this.data.atHardBreak=!0}function ke(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.value=Q}function de(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.value=Q}function Y(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.value=Q}function ge(){const Q=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";Q.type+="Reference",Q.referenceType=le,delete Q.url,delete Q.title}else delete Q.identifier,delete Q.label;this.data.referenceType=void 0}function pe(){const Q=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";Q.type+="Reference",Q.referenceType=le,delete Q.url,delete Q.title}else delete Q.identifier,delete Q.label;this.data.referenceType=void 0}function X(Q){const le=this.sliceSerialize(Q),Ae=this.stack[this.stack.length-2];Ae.label=sC(le),Ae.identifier=En(le).toLowerCase()}function oe(){const Q=this.stack[this.stack.length-1],le=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const Oe=Q.children;Ae.children=Oe}else Ae.alt=le}function C(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.url=Q}function O(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.title=Q}function G(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function Ne(Q){const le=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=le,Ae.identifier=En(this.sliceSerialize(Q)).toLowerCase(),this.data.referenceType="full"}function Ie(Q){this.data.characterReferenceType=Q.type}function Se(Q){const le=this.sliceSerialize(Q),Ae=this.data.characterReferenceType;let Oe;Ae?(Oe=m1(le,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Oe=hd(le);const Be=this.stack[this.stack.length-1];Be.value+=Oe}function je(Q){const le=this.stack.pop();le.position.end=pr(Q.end)}function Re(Q){B.call(this,Q);const le=this.stack[this.stack.length-1];le.url=this.sliceSerialize(Q)}function ze(Q){B.call(this,Q);const le=this.stack[this.stack.length-1];le.url="mailto:"+this.sliceSerialize(Q)}function st(){return{type:"blockquote",children:[]}}function On(){return{type:"code",lang:null,meta:null,value:""}}function os(){return{type:"inlineCode",value:""}}function Zr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ji(){return{type:"emphasis",children:[]}}function Hi(){return{type:"heading",depth:0,children:[]}}function zi(){return{type:"break"}}function ei(){return{type:"html",value:""}}function ls(){return{type:"image",title:null,url:"",alt:null}}function ti(){return{type:"link",title:null,url:"",children:[]}}function Vn(Q){return{type:"list",ordered:Q.type==="listOrdered",start:null,spread:Q._spread,children:[]}}function qn(Q){return{type:"listItem",spread:Q._spread,checked:null,children:[]}}function $i(){return{type:"paragraph",children:[]}}function cs(){return{type:"strong",children:[]}}function ds(){return{type:"text",value:""}}function fs(){return{type:"thematicBreak"}}}function pr(e){return{line:e.line,column:e.column,offset:e.offset}}function N1(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?N1(e,a):cC(e,a)}}function cC(e,t){let n;for(n in t)if(S1.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function lm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Fa({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Fa({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Fa({start:t.start,end:t.end})+") is still open")}function dC(e){const t=this;t.parser=n;function n(a){return oC(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function fC(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 hC(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
60
|
+
`}]}function pC(e,t){const n=t.value?t.value+`
|
|
61
|
+
`:"",a={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(a.className=["language-"+s[0]]);let o={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function mC(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gC(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function EC(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),s=Mi(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let l,d=e.footnoteCounts.get(a);d===void 0?(d=0,e.footnoteOrder.push(a),l=e.footnoteOrder.length):l=o+1,d+=1,e.footnoteCounts.set(a,d);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const h={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,h),e.applyData(t,h)}function TC(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 yC(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function A1(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const s=e.all(t),o=s[0];o&&o.type==="text"?o.value="["+o.value:s.unshift({type:"text",value:"["});const l=s[s.length-1];return l&&l.type==="text"?l.value+=a:s.push({type:"text",value:a}),s}function xC(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return A1(e,t);const s={src:Mi(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(s.title=a.title);const o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,o),e.applyData(t,o)}function bC(e,t){const n={src:Mi(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 a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function kC(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function CC(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return A1(e,t);const s={href:Mi(a.url||"")};a.title!==null&&a.title!==void 0&&(s.title=a.title);const o={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function _C(e,t){const n={href:Mi(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function SC(e,t,n){const a=e.all(t),s=n?NC(n):v1(t),o={},l=[];if(typeof t.checked=="boolean"){const E=a[0];let g;E&&E.type==="element"&&E.tagName==="p"?g=E:(g={type:"element",tagName:"p",properties:{},children:[]},a.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let d=-1;for(;++d<a.length;){const E=a[d];(s||d!==0||E.type!=="element"||E.tagName!=="p")&&l.push({type:"text",value:`
|
|
62
62
|
`}),E.type==="element"&&E.tagName==="p"&&!s?l.push(...E.children):l.push(E)}const f=a[a.length-1];f&&(s||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
|
|
63
|
-
`});const h={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,h),e.applyData(t,h)}function
|
|
63
|
+
`});const h={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,h),e.applyData(t,h)}function NC(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=v1(n[a])}return t}function v1(e){const t=e.spread;return t??e.children.length>1}function AC(e,t){const n={},a=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<a.length;){const l=a[s];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function vC(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wC(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function IC(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LC(e,t){const n=e.all(t),a=n.shift(),s=[];if(a){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],l),s.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=Ln(t.children[1]),f=qu(t.children[t.children.length-1]);d&&f&&(l.position={start:d,end:f}),s.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,o),e.applyData(t,o)}function RC(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,d=l?l.length:t.children.length;let f=-1;const h=[];for(;++f<d;){const g=t.children[f],x={},b=l?l[f]:void 0;b&&(x.align=b);let S={type:"element",tagName:o,properties:x,children:[]};g&&(S.children=e.all(g),e.patch(g,S),S=e.applyData(g,S)),h.push(S)}const E={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,E),e.applyData(t,E)}function OC(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const cm=9,dm=32;function DC(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),s=0;const o=[];for(;a;)o.push(fm(t.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=n.exec(t);return o.push(fm(t.slice(s),s>0,!1)),o.join("")}function fm(e,t,n){let a=0,s=e.length;if(t){let o=e.codePointAt(a);for(;o===cm||o===dm;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(s-1);for(;o===cm||o===dm;)s--,o=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function PC(e,t){const n={type:"text",value:DC(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function MC(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const FC={blockquote:fC,break:hC,code:pC,delete:mC,emphasis:gC,footnoteReference:EC,heading:TC,html:yC,imageReference:xC,image:bC,inlineCode:kC,linkReference:CC,link:_C,listItem:SC,list:AC,paragraph:vC,root:wC,strong:IC,table:LC,tableCell:OC,tableRow:RC,text:PC,thematicBreak:MC,toml:ku,yaml:ku,definition:ku,footnoteDefinition:ku};function ku(){}const w1=-1,Ku=0,Ua=1,Pu=2,md=3,gd=4,Ed=5,Td=6,I1=7,L1=8,BC=typeof self=="object"?self:globalThis,hm=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new BC[e](t)},UC=(e,t)=>{const n=(s,o)=>(e.set(o,s),s),a=s=>{if(e.has(s))return e.get(s);const[o,l]=t[s];switch(o){case Ku:case w1:return n(l,s);case Ua:{const d=n([],s);for(const f of l)d.push(a(f));return d}case Pu:{const d=n({},s);for(const[f,h]of l)d[a(f)]=a(h);return d}case md:return n(new Date(l),s);case gd:{const{source:d,flags:f}=l;return n(new RegExp(d,f),s)}case Ed:{const d=n(new Map,s);for(const[f,h]of l)d.set(a(f),a(h));return d}case Td:{const d=n(new Set,s);for(const f of l)d.add(a(f));return d}case I1:{const{name:d,message:f}=l;return n(hm(d,f),s)}case L1:return n(BigInt(l),s);case"BigInt":return n(Object(BigInt(l)),s);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:d}=new Uint8Array(l);return n(new DataView(d),l)}}return n(hm(o,l),s)};return a},pm=e=>UC(new Map,e)(0),zr="",{toString:jC}={},{keys:HC}=Object,Ra=e=>{const t=typeof e;if(t!=="object"||!e)return[Ku,t];const n=jC.call(e).slice(8,-1);switch(n){case"Array":return[Ua,zr];case"Object":return[Pu,zr];case"Date":return[md,zr];case"RegExp":return[gd,zr];case"Map":return[Ed,zr];case"Set":return[Td,zr];case"DataView":return[Ua,n]}return n.includes("Array")?[Ua,n]:n.includes("Error")?[I1,n]:[Pu,n]},Cu=([e,t])=>e===Ku&&(t==="function"||t==="symbol"),zC=(e,t,n,a)=>{const s=(l,d)=>{const f=a.push(l)-1;return n.set(d,f),f},o=l=>{if(n.has(l))return n.get(l);let[d,f]=Ra(l);switch(d){case Ku:{let E=l;switch(f){case"bigint":d=L1,E=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);E=null;break;case"undefined":return s([w1],l)}return s([d,E],l)}case Ua:{if(f){let x=l;return f==="DataView"?x=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(x=new Uint8Array(l)),s([f,[...x]],l)}const E=[],g=s([d,E],l);for(const x of l)E.push(o(x));return g}case Pu:{if(f)switch(f){case"BigInt":return s([f,l.toString()],l);case"Boolean":case"Number":case"String":return s([f,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const E=[],g=s([d,E],l);for(const x of HC(l))(e||!Cu(Ra(l[x])))&&E.push([o(x),o(l[x])]);return g}case md:return s([d,isNaN(l.getTime())?zr:l.toISOString()],l);case gd:{const{source:E,flags:g}=l;return s([d,{source:E,flags:g}],l)}case Ed:{const E=[],g=s([d,E],l);for(const[x,b]of l)(e||!(Cu(Ra(x))||Cu(Ra(b))))&&E.push([o(x),o(b)]);return g}case Td:{const E=[],g=s([d,E],l);for(const x of l)(e||!Cu(Ra(x)))&&E.push(o(x));return g}}const{message:h}=l;return s([d,{name:f,message:h}],l)};return o},mm=(e,{json:t,lossy:n}={})=>{const a=[];return zC(!(t||n),!!t,new Map,a)(e),a},qr=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?pm(mm(e,t)):structuredClone(e):(e,t)=>pm(mm(e,t));function $C(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 WC(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function YC(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||$C,a=e.options.footnoteBackLabel||WC,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let f=-1;for(;++f<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[f]);if(!h)continue;const E=e.all(h),g=String(h.identifier).toUpperCase(),x=Mi(g.toLowerCase());let b=0;const S=[],A=e.footnoteCounts.get(g);for(;A!==void 0&&++b<=A;){S.length>0&&S.push({type:"text",value:" "});let F=typeof n=="string"?n:n(f,b);typeof F=="string"&&(F={type:"text",value:F}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(f,b),className:["data-footnote-backref"]},children:Array.isArray(F)?F:[F]})}const P=E[E.length-1];if(P&&P.type==="element"&&P.tagName==="p"){const F=P.children[P.children.length-1];F&&F.type==="text"?F.value+=" ":P.children.push({type:"text",value:" "}),P.children.push(...S)}else E.push(...S);const R={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(E,!0)};e.patch(h,R),d.push(R)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...qr(l),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
64
64
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
|
|
65
|
-
`}]}}const Xu=(function(e){if(e==null)return
|
|
65
|
+
`}]}}const Xu=(function(e){if(e==null)return GC;if(typeof e=="function")return Ju(e);if(typeof e=="object")return Array.isArray(e)?VC(e):qC(e);if(typeof e=="string")return QC(e);throw new Error("Expected function, string, or object as test")});function VC(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Xu(e[n]);return Ju(a);function a(...s){let o=-1;for(;++o<t.length;)if(t[o].apply(this,s))return!0;return!1}}function qC(e){const t=e;return Ju(n);function n(a){const s=a;let o;for(o in e)if(s[o]!==t[o])return!1;return!0}}function QC(e){return Ju(t);function t(n){return n&&n.type===e}}function Ju(e){return t;function t(n,a,s){return!!(KC(n)&&e.call(this,n,typeof a=="number"?a:void 0,s||void 0))}}function GC(){return!0}function KC(e){return e!==null&&typeof e=="object"&&"type"in e}const R1=[],XC=!0,Oc=!1,JC="skip";function O1(e,t,n,a){let s;typeof t=="function"&&typeof n!="function"?(a=n,n=t):s=t;const o=Xu(s),l=a?-1:1;d(e,void 0,[])();function d(f,h,E){const g=f&&typeof f=="object"?f:{};if(typeof g.type=="string"){const b=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(f.type+(b?"<"+b+">":""))+")"})}return x;function x(){let b=R1,S,A,P;if((!t||o(f,h,E[E.length-1]||void 0))&&(b=ZC(n(f,E)),b[0]===Oc))return b;if("children"in f&&f.children){const R=f;if(R.children&&b[0]!==JC)for(A=(a?R.children.length:-1)+l,P=E.concat(R);A>-1&&A<R.children.length;){const F=R.children[A];if(S=d(F,A,P)(),S[0]===Oc)return S;A=typeof S[1]=="number"?S[1]:A+l}}return b}}}function ZC(e){return Array.isArray(e)?e:typeof e=="number"?[XC,e]:e==null?R1:[e]}function Zu(e,t,n,a){let s,o,l;typeof t=="function"&&typeof n!="function"?(o=void 0,l=t,s=n):(o=t,l=n,s=a),O1(e,o,d,s);function d(f,h){const E=h[h.length-1],g=E?E.children.indexOf(f):void 0;return l(f,g,E)}}const Dc={}.hasOwnProperty,e_={};function t_(e,t){const n=t||e_,a=new Map,s=new Map,o=new Map,l={...FC,...n.handlers},d={all:h,applyData:r_,definitionById:a,footnoteById:s,footnoteCounts:o,footnoteOrder:[],handlers:l,one:f,options:n,patch:n_,wrap:a_};return Zu(e,function(E){if(E.type==="definition"||E.type==="footnoteDefinition"){const g=E.type==="definition"?a:s,x=String(E.identifier).toUpperCase();g.has(x)||g.set(x,E)}}),d;function f(E,g){const x=E.type,b=d.handlers[x];if(Dc.call(d.handlers,x)&&b)return b(d,E,g);if(d.options.passThrough&&d.options.passThrough.includes(x)){if("children"in E){const{children:A,...P}=E,R=qr(P);return R.children=d.all(E),R}return qr(E)}return(d.options.unknownHandler||i_)(d,E,g)}function h(E){const g=[];if("children"in E){const x=E.children;let b=-1;for(;++b<x.length;){const S=d.one(x[b],E);if(S){if(b&&x[b-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=gm(S.value)),!Array.isArray(S)&&S.type==="element")){const A=S.children[0];A&&A.type==="text"&&(A.value=gm(A.value))}Array.isArray(S)?g.push(...S):g.push(S)}}}return g}}function n_(e,t){e.position&&(t.position=o1(e))}function r_(e,t){let n=t;if(e&&e.data){const a=e.data.hName,s=e.data.hChildren,o=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const l="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:l}}n.type==="element"&&o&&Object.assign(n.properties,qr(o)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function i_(e,t){const n=t.data||{},a="value"in t&&!(Dc.call(n,"hProperties")||Dc.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function a_(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
|
66
66
|
`});++a<e.length;)a&&n.push({type:"text",value:`
|
|
67
67
|
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
68
|
-
`}),n}function gm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Em(e,t){const n=
|
|
69
|
-
`},s),o}function a_(e,t){return e&&"run"in e?async function(n,a){const s=Em(n,{file:a,...t});await e.run(s,a)}:function(n,a){return Em(n,{file:a,...e||t})}}function Tm(e){if(e)throw e}var sc,ym;function s_(){if(ym)return sc;ym=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},o=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var E=e.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!E&&!g)return!1;var x;for(x in h);return typeof x>"u"||e.call(h,x)},l=function(h,E){n&&E.name==="__proto__"?n(h,E.name,{enumerable:!0,configurable:!0,value:E.newValue,writable:!0}):h[E.name]=E.newValue},d=function(h,E){if(E==="__proto__")if(e.call(h,E)){if(a)return a(h,E).value}else return;return h[E]};return sc=function f(){var h,E,g,x,b,S,A=arguments[0],P=1,R=arguments.length,F=!1;for(typeof A=="boolean"&&(F=A,A=arguments[1]||{},P=2),(A==null||typeof A!="object"&&typeof A!="function")&&(A={});P<R;++P)if(h=arguments[P],h!=null)for(E in h)g=d(A,E),x=d(h,E),A!==x&&(F&&x&&(o(x)||(b=s(x)))?(b?(b=!1,S=g&&s(g)?g:[]):S=g&&o(g)?g:{},l(A,{name:E,newValue:f(F,S,x)})):typeof x<"u"&&l(A,{name:E,newValue:x}));return A},sc}var u_=s_();const uc=qc(u_);function Pc(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 o_(){const e=[],t={run:n,use:a};return t;function n(...s){let o=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);d(null,...s);function d(f,...h){const E=e[++o];let g=-1;if(f){l(f);return}for(;++g<s.length;)(h[g]===null||h[g]===void 0)&&(h[g]=s[g]);s=h,E?l_(E,d)(...h):l(null,...h)}}function a(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function l_(e,t){let n;return a;function a(...l){const d=e.length>l.length;let f;d&&l.push(s);try{f=e.apply(this,l)}catch(h){const E=h;if(d&&n)throw E;return s(E)}d||(f&&f.then&&typeof f.then=="function"?f.then(o,s):f instanceof Error?s(f):o(f))}function s(l,...d){n||(n=!0,t(l,...d))}function o(l){s(null,l)}}const vn={basename:c_,dirname:d_,extname:f_,join:h_,sep:"/"};function c_(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');is(e);let n=0,a=-1,s=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else a<0&&(o=!0,a=s+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let l=-1,d=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else l<0&&(o=!0,l=s+1),d>-1&&(e.codePointAt(s)===t.codePointAt(d--)?d<0&&(a=s):(d=-1,a=l));return n===a?a=l:a<0&&(a=e.length),e.slice(n,a)}function d_(e){if(is(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function f_(e){is(e);let t=e.length,n=-1,a=0,s=-1,o=0,l;for(;t--;){const d=e.codePointAt(t);if(d===47){if(l){a=t+1;break}continue}n<0&&(l=!0,n=t+1),d===46?s<0?s=t:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||n<0||o===0||o===1&&s===n-1&&s===a+1?"":e.slice(s,n)}function h_(...e){let t=-1,n;for(;++t<e.length;)is(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":p_(n)}function p_(e){is(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="",a=0,s=-1,o=0,l=-1,d,f;for(;++l<=e.length;){if(l<e.length)d=e.codePointAt(l);else{if(d===47)break;d=47}if(d===47){if(!(s===l-1||o===1))if(s!==l-1&&o===2){if(n.length<2||a!==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="",a=0):(n=n.slice(0,f),a=n.length-1-n.lastIndexOf("/")),s=l,o=0;continue}}else if(n.length>0){n="",a=0,s=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),a=l-s-1;s=l,o=0}else d===46&&o>-1?o++:o=-1}return n}function is(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const g_={cwd:E_};function E_(){return"/"}function Mc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function T_(e){if(typeof e=="string")e=new URL(e);else if(!Mc(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 y_(e)}function y_(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const oc=["history","path","basename","stem","extname","dirname"];class D1{constructor(t){let n;t?Mc(t)?n={path:t}:typeof t=="string"||x_(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":g_.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<oc.length;){const o=oc[a];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let s;for(s in n)oc.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?vn.basename(this.path):void 0}set basename(t){cc(t,"basename"),lc(t,"basename"),this.path=vn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?vn.dirname(this.path):void 0}set dirname(t){xm(this.basename,"dirname"),this.path=vn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?vn.extname(this.path):void 0}set extname(t){if(lc(t,"extname"),xm(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=vn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Mc(t)&&(t=T_(t)),cc(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?vn.basename(this.path,this.extname):void 0}set stem(t){cc(t,"stem"),lc(t,"stem"),this.path=vn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const s=this.message(t,n,a);throw s.fatal=!0,s}info(t,n,a){const s=this.message(t,n,a);return s.fatal=void 0,s}message(t,n,a){const s=new vt(t,n,a);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function lc(e,t){if(e&&e.includes(vn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+vn.sep+"`")}function cc(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function xm(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function x_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const b_=(function(e){const a=this.constructor.prototype,s=a[e],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),k_={}.hasOwnProperty;class yd extends b_{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=o_()}copy(){const t=new yd;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(uc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(hc("data",this.frozen),this.namespace[t]=n,this):k_.call(this.namespace,t)&&this.namespace[t]||void 0:t?(hc("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,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const s=n.call(t,...a);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=_u(t),a=this.parser||this.Parser;return dc("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),dc("process",this.parser||this.Parser),fc("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(o,l){const d=_u(t),f=a.parse(d);a.run(f,d,function(E,g,x){if(E||!g||!x)return h(E);const b=g,S=a.stringify(b,x);S_(S)?x.value=S:x.result=S,h(E,x)});function h(E,g){E||!g?l(E):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,a;return this.freeze(),dc("processSync",this.parser||this.Parser),fc("processSync",this.compiler||this.Compiler),this.process(t,s),km("processSync","process",n),a;function s(o,l){n=!0,Tm(o),a=l}}run(t,n,a){bm(t),this.freeze();const s=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?o(void 0,a):new Promise(o);function o(l,d){const f=_u(n);s.run(t,f,h);function h(E,g,x){const b=g||t;E?d(E):l?l(b):a(void 0,b,x)}}}runSync(t,n){let a=!1,s;return this.run(t,n,o),km("runSync","run",a),s;function o(l,d){Tm(l),s=d,a=!0}}stringify(t,n){this.freeze();const a=_u(n),s=this.compiler||this.Compiler;return fc("stringify",s),bm(t),s(t,a)}use(t,...n){const a=this.attachers,s=this.namespace;if(hc("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(h){if(typeof h=="function")f(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[E,...g]=h;f(E,g)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(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");d(h.plugins),h.settings&&(s.settings=uc(!0,s.settings,h.settings))}function d(h){let E=-1;if(h!=null)if(Array.isArray(h))for(;++E<h.length;){const g=h[E];o(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function f(h,E){let g=-1,x=-1;for(;++g<a.length;)if(a[g][0]===h){x=g;break}if(x===-1)a.push([h,...E]);else if(E.length>0){let[b,...S]=E;const A=a[x][1];Pc(A)&&Pc(b)&&(b=uc(!0,A,b)),a[x]=[h,b,...S]}}}}const C_=new yd().freeze();function dc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function fc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function hc(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 bm(e){if(!Pc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function km(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function _u(e){return __(e)?e:new D1(e)}function __(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function S_(e){return typeof e=="string"||N_(e)}function N_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const A_="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Cm=[],_m={allowDangerousHtml:!0},v_=/^(https?|ircs?|mailto|xmpp)$/i,w_=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function I_(e){const t=L_(e),n=R_(e);return O_(t.runSync(t.parse(n),n),e)}function L_(e){const t=e.rehypePlugins||Cm,n=e.remarkPlugins||Cm,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,..._m}:_m;return C_().use(cC).use(n).use(a_,a).use(t)}function R_(e){const t=e.children||"",n=new D1;return typeof t=="string"&&(n.value=t),n}function O_(e,t){const n=t.allowedElements,a=t.allowElement,s=t.components,o=t.disallowedElements,l=t.skipHtml,d=t.unwrapDisallowed,f=t.urlTransform||D_;for(const E of w_)Object.hasOwn(t,E.from)&&(""+E.from+(E.to?"use `"+E.to+"` instead":"remove it")+A_+E.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Zu(e,h),qx(e,{Fragment:T.Fragment,components:s,ignoreInvalidStyle:!0,jsx:T.jsx,jsxs:T.jsxs,passKeys:!0,passNode:!0});function h(E,g,x){if(E.type==="raw"&&x&&typeof g=="number")return l?x.children.splice(g,1):x.children[g]={type:"text",value:E.value},g;if(E.type==="element"){let b;for(b in rc)if(Object.hasOwn(rc,b)&&Object.hasOwn(E.properties,b)){const S=E.properties[b],A=rc[b];(A===null||A.includes(E.tagName))&&(E.properties[b]=f(String(S||""),b,E))}}if(E.type==="element"){let b=n?!n.includes(E.tagName):o?o.includes(E.tagName):!1;if(!b&&a&&typeof g=="number"&&(b=!a(E,g,x)),b&&x&&typeof g=="number")return d&&E.children?x.children.splice(g,1,...E.children):x.children.splice(g,1),g}}}function D_(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||a!==-1&&t>a||v_.test(e.slice(0,t))?e:""}function Sm(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,s=n.indexOf(t);for(;s!==-1;)a++,s=n.indexOf(t,s+t.length);return a}function P_(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function M_(e,t,n){const s=Xu((n||{}).ignore||[]),o=F_(t);let l=-1;for(;++l<o.length;)O1(e,"text",d);function d(h,E){let g=-1,x;for(;++g<E.length;){const b=E[g],S=x?x.children:void 0;if(s(b,S?S.indexOf(b):void 0,x))return;x=b}if(x)return f(h,E)}function f(h,E){const g=E[E.length-1],x=o[l][0],b=o[l][1];let S=0;const P=g.children.indexOf(h);let R=!1,F=[];x.lastIndex=0;let U=x.exec(h.value);for(;U;){const K=U.index,$={index:U.index,input:U.input,stack:[...E,h]};let j=b(...U,$);if(typeof j=="string"&&(j=j.length>0?{type:"text",value:j}:void 0),j===!1?x.lastIndex=K+1:(S!==K&&F.push({type:"text",value:h.value.slice(S,K)}),Array.isArray(j)?F.push(...j):j&&F.push(j),S=K+U[0].length,R=!0),!x.global)break;U=x.exec(h.value)}return R?(S<h.value.length&&F.push({type:"text",value:h.value.slice(S)}),g.children.splice(P,1,...F)):F=[h],P+F.length}}function F_(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 a=-1;for(;++a<n.length;){const s=n[a];t.push([B_(s[0]),U_(s[1])])}return t}function B_(e){return typeof e=="string"?new RegExp(P_(e),"g"):e}function U_(e){return typeof e=="function"?e:function(){return e}}const pc="phrasing",mc=["autolink","link","image","label"];function j_(){return{transforms:[q_],enter:{literalAutolink:z_,literalAutolinkEmail:gc,literalAutolinkHttp:gc,literalAutolinkWww:gc},exit:{literalAutolink:V_,literalAutolinkEmail:Y_,literalAutolinkHttp:$_,literalAutolinkWww:W_}}}function H_(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:pc,notInConstruct:mc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:pc,notInConstruct:mc},{character:":",before:"[ps]",after:"\\/",inConstruct:pc,notInConstruct:mc}]}}function z_(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function gc(e){this.config.enter.autolinkProtocol.call(this,e)}function $_(e){this.config.exit.autolinkProtocol.call(this,e)}function W_(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 Y_(e){this.config.exit.autolinkEmail.call(this,e)}function V_(e){this.exit(e)}function q_(e){M_(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Q_],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),G_]],{ignore:["link","linkReference"]})}function Q_(e,t,n,a,s){let o="";if(!P1(s)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!K_(n)))return!1;const l=X_(n+a);if(!l[0])return!1;const d={type:"link",title:null,url:o+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[d,{type:"text",value:l[1]}]:d}function G_(e,t,n,a){return!P1(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function K_(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 X_(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const s=Sm(e,"(");let o=Sm(e,")");for(;a!==-1&&s>o;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),o++;return[e,n]}function P1(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Vr(n)||Qu(n))&&(!t||n!==47)}M1.peek=sS;function J_(){this.buffer()}function Z_(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function eS(){this.buffer()}function tS(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function nS(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=En(this.sliceSerialize(e)).toLowerCase(),n.label=t}function rS(e){this.exit(e)}function iS(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=En(this.sliceSerialize(e)).toLowerCase(),n.label=t}function aS(e){this.exit(e)}function sS(){return"["}function M1(e,t,n,a){const s=n.createTracker(a);let o=s.move("[^");const l=n.enter("footnoteReference"),d=n.enter("reference");return o+=s.move(n.safe(n.associationId(e),{after:"]",before:o})),d(),l(),o+=s.move("]"),o}function uS(){return{enter:{gfmFootnoteCallString:J_,gfmFootnoteCall:Z_,gfmFootnoteDefinitionLabelString:eS,gfmFootnoteDefinition:tS},exit:{gfmFootnoteCallString:nS,gfmFootnoteCall:rS,gfmFootnoteDefinitionLabelString:iS,gfmFootnoteDefinition:aS}}}function oS(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:M1},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,s,o,l){const d=o.createTracker(l);let f=d.move("[^");const h=o.enter("footnoteDefinition"),E=o.enter("label");return f+=d.move(o.safe(o.associationId(a),{before:f,after:"]"})),E(),f+=d.move("]:"),a.children&&a.children.length>0&&(d.shift(4),f+=d.move((t?`
|
|
70
|
-
`:" ")+o.indentLines(o.containerFlow(a,d.current()),t?F1:
|
|
71
|
-
`)}function
|
|
72
|
-
`&&
|
|
73
|
-
`}function j1(e,t){const n=String(e);let a=n.indexOf(t),s=a,o=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===s?++o>l&&(l=o):o=1,s=a+t.length,a=n.indexOf(t,s);return l}function
|
|
68
|
+
`}),n}function gm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Em(e,t){const n=t_(e,t),a=n.one(e,void 0),s=YC(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&o.children.push({type:"text",value:`
|
|
69
|
+
`},s),o}function s_(e,t){return e&&"run"in e?async function(n,a){const s=Em(n,{file:a,...t});await e.run(s,a)}:function(n,a){return Em(n,{file:a,...e||t})}}function Tm(e){if(e)throw e}var sc,ym;function u_(){if(ym)return sc;ym=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},o=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var E=e.call(h,"constructor"),g=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!E&&!g)return!1;var x;for(x in h);return typeof x>"u"||e.call(h,x)},l=function(h,E){n&&E.name==="__proto__"?n(h,E.name,{enumerable:!0,configurable:!0,value:E.newValue,writable:!0}):h[E.name]=E.newValue},d=function(h,E){if(E==="__proto__")if(e.call(h,E)){if(a)return a(h,E).value}else return;return h[E]};return sc=function f(){var h,E,g,x,b,S,A=arguments[0],P=1,R=arguments.length,F=!1;for(typeof A=="boolean"&&(F=A,A=arguments[1]||{},P=2),(A==null||typeof A!="object"&&typeof A!="function")&&(A={});P<R;++P)if(h=arguments[P],h!=null)for(E in h)g=d(A,E),x=d(h,E),A!==x&&(F&&x&&(o(x)||(b=s(x)))?(b?(b=!1,S=g&&s(g)?g:[]):S=g&&o(g)?g:{},l(A,{name:E,newValue:f(F,S,x)})):typeof x<"u"&&l(A,{name:E,newValue:x}));return A},sc}var o_=u_();const uc=qc(o_);function Pc(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:a};return t;function n(...s){let o=-1;const l=s.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);d(null,...s);function d(f,...h){const E=e[++o];let g=-1;if(f){l(f);return}for(;++g<s.length;)(h[g]===null||h[g]===void 0)&&(h[g]=s[g]);s=h,E?c_(E,d)(...h):l(null,...h)}}function a(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function c_(e,t){let n;return a;function a(...l){const d=e.length>l.length;let f;d&&l.push(s);try{f=e.apply(this,l)}catch(h){const E=h;if(d&&n)throw E;return s(E)}d||(f&&f.then&&typeof f.then=="function"?f.then(o,s):f instanceof Error?s(f):o(f))}function s(l,...d){n||(n=!0,t(l,...d))}function o(l){s(null,l)}}const vn={basename:d_,dirname:f_,extname:h_,join:p_,sep:"/"};function d_(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');is(e);let n=0,a=-1,s=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else a<0&&(o=!0,a=s+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let l=-1,d=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else l<0&&(o=!0,l=s+1),d>-1&&(e.codePointAt(s)===t.codePointAt(d--)?d<0&&(a=s):(d=-1,a=l));return n===a?a=l:a<0&&(a=e.length),e.slice(n,a)}function f_(e){if(is(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function h_(e){is(e);let t=e.length,n=-1,a=0,s=-1,o=0,l;for(;t--;){const d=e.codePointAt(t);if(d===47){if(l){a=t+1;break}continue}n<0&&(l=!0,n=t+1),d===46?s<0?s=t:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||n<0||o===0||o===1&&s===n-1&&s===a+1?"":e.slice(s,n)}function p_(...e){let t=-1,n;for(;++t<e.length;)is(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":m_(n)}function m_(e){is(e);const t=e.codePointAt(0)===47;let n=g_(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function g_(e,t){let n="",a=0,s=-1,o=0,l=-1,d,f;for(;++l<=e.length;){if(l<e.length)d=e.codePointAt(l);else{if(d===47)break;d=47}if(d===47){if(!(s===l-1||o===1))if(s!==l-1&&o===2){if(n.length<2||a!==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="",a=0):(n=n.slice(0,f),a=n.length-1-n.lastIndexOf("/")),s=l,o=0;continue}}else if(n.length>0){n="",a=0,s=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(s+1,l):n=e.slice(s+1,l),a=l-s-1;s=l,o=0}else d===46&&o>-1?o++:o=-1}return n}function is(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const E_={cwd:T_};function T_(){return"/"}function Mc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function y_(e){if(typeof e=="string")e=new URL(e);else if(!Mc(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 a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const oc=["history","path","basename","stem","extname","dirname"];class D1{constructor(t){let n;t?Mc(t)?n={path:t}:typeof t=="string"||b_(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":E_.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<oc.length;){const o=oc[a];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let s;for(s in n)oc.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?vn.basename(this.path):void 0}set basename(t){cc(t,"basename"),lc(t,"basename"),this.path=vn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?vn.dirname(this.path):void 0}set dirname(t){xm(this.basename,"dirname"),this.path=vn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?vn.extname(this.path):void 0}set extname(t){if(lc(t,"extname"),xm(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=vn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Mc(t)&&(t=y_(t)),cc(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?vn.basename(this.path,this.extname):void 0}set stem(t){cc(t,"stem"),lc(t,"stem"),this.path=vn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const s=this.message(t,n,a);throw s.fatal=!0,s}info(t,n,a){const s=this.message(t,n,a);return s.fatal=void 0,s}message(t,n,a){const s=new vt(t,n,a);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function lc(e,t){if(e&&e.includes(vn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+vn.sep+"`")}function cc(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function xm(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function b_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const k_=(function(e){const a=this.constructor.prototype,s=a[e],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),C_={}.hasOwnProperty;class yd extends k_{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 yd;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(uc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(hc("data",this.frozen),this.namespace[t]=n,this):C_.call(this.namespace,t)&&this.namespace[t]||void 0:t?(hc("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,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const s=n.call(t,...a);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=_u(t),a=this.parser||this.Parser;return dc("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),dc("process",this.parser||this.Parser),fc("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(o,l){const d=_u(t),f=a.parse(d);a.run(f,d,function(E,g,x){if(E||!g||!x)return h(E);const b=g,S=a.stringify(b,x);N_(S)?x.value=S:x.result=S,h(E,x)});function h(E,g){E||!g?l(E):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,a;return this.freeze(),dc("processSync",this.parser||this.Parser),fc("processSync",this.compiler||this.Compiler),this.process(t,s),km("processSync","process",n),a;function s(o,l){n=!0,Tm(o),a=l}}run(t,n,a){bm(t),this.freeze();const s=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?o(void 0,a):new Promise(o);function o(l,d){const f=_u(n);s.run(t,f,h);function h(E,g,x){const b=g||t;E?d(E):l?l(b):a(void 0,b,x)}}}runSync(t,n){let a=!1,s;return this.run(t,n,o),km("runSync","run",a),s;function o(l,d){Tm(l),s=d,a=!0}}stringify(t,n){this.freeze();const a=_u(n),s=this.compiler||this.Compiler;return fc("stringify",s),bm(t),s(t,a)}use(t,...n){const a=this.attachers,s=this.namespace;if(hc("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(h){if(typeof h=="function")f(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[E,...g]=h;f(E,g)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(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");d(h.plugins),h.settings&&(s.settings=uc(!0,s.settings,h.settings))}function d(h){let E=-1;if(h!=null)if(Array.isArray(h))for(;++E<h.length;){const g=h[E];o(g)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function f(h,E){let g=-1,x=-1;for(;++g<a.length;)if(a[g][0]===h){x=g;break}if(x===-1)a.push([h,...E]);else if(E.length>0){let[b,...S]=E;const A=a[x][1];Pc(A)&&Pc(b)&&(b=uc(!0,A,b)),a[x]=[h,b,...S]}}}}const __=new yd().freeze();function dc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function fc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function hc(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 bm(e){if(!Pc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function km(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function _u(e){return S_(e)?e:new D1(e)}function S_(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function N_(e){return typeof e=="string"||A_(e)}function A_(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const v_="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Cm=[],_m={allowDangerousHtml:!0},w_=/^(https?|ircs?|mailto|xmpp)$/i,I_=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function L_(e){const t=R_(e),n=O_(e);return D_(t.runSync(t.parse(n),n),e)}function R_(e){const t=e.rehypePlugins||Cm,n=e.remarkPlugins||Cm,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,..._m}:_m;return __().use(dC).use(n).use(s_,a).use(t)}function O_(e){const t=e.children||"",n=new D1;return typeof t=="string"&&(n.value=t),n}function D_(e,t){const n=t.allowedElements,a=t.allowElement,s=t.components,o=t.disallowedElements,l=t.skipHtml,d=t.unwrapDisallowed,f=t.urlTransform||P_;for(const E of I_)Object.hasOwn(t,E.from)&&(""+E.from+(E.to?"use `"+E.to+"` instead":"remove it")+v_+E.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Zu(e,h),Qx(e,{Fragment:T.Fragment,components:s,ignoreInvalidStyle:!0,jsx:T.jsx,jsxs:T.jsxs,passKeys:!0,passNode:!0});function h(E,g,x){if(E.type==="raw"&&x&&typeof g=="number")return l?x.children.splice(g,1):x.children[g]={type:"text",value:E.value},g;if(E.type==="element"){let b;for(b in rc)if(Object.hasOwn(rc,b)&&Object.hasOwn(E.properties,b)){const S=E.properties[b],A=rc[b];(A===null||A.includes(E.tagName))&&(E.properties[b]=f(String(S||""),b,E))}}if(E.type==="element"){let b=n?!n.includes(E.tagName):o?o.includes(E.tagName):!1;if(!b&&a&&typeof g=="number"&&(b=!a(E,g,x)),b&&x&&typeof g=="number")return d&&E.children?x.children.splice(g,1,...E.children):x.children.splice(g,1),g}}}function P_(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||a!==-1&&t>a||w_.test(e.slice(0,t))?e:""}function Sm(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,s=n.indexOf(t);for(;s!==-1;)a++,s=n.indexOf(t,s+t.length);return a}function M_(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function F_(e,t,n){const s=Xu((n||{}).ignore||[]),o=B_(t);let l=-1;for(;++l<o.length;)O1(e,"text",d);function d(h,E){let g=-1,x;for(;++g<E.length;){const b=E[g],S=x?x.children:void 0;if(s(b,S?S.indexOf(b):void 0,x))return;x=b}if(x)return f(h,E)}function f(h,E){const g=E[E.length-1],x=o[l][0],b=o[l][1];let S=0;const P=g.children.indexOf(h);let R=!1,F=[];x.lastIndex=0;let U=x.exec(h.value);for(;U;){const K=U.index,$={index:U.index,input:U.input,stack:[...E,h]};let j=b(...U,$);if(typeof j=="string"&&(j=j.length>0?{type:"text",value:j}:void 0),j===!1?x.lastIndex=K+1:(S!==K&&F.push({type:"text",value:h.value.slice(S,K)}),Array.isArray(j)?F.push(...j):j&&F.push(j),S=K+U[0].length,R=!0),!x.global)break;U=x.exec(h.value)}return R?(S<h.value.length&&F.push({type:"text",value:h.value.slice(S)}),g.children.splice(P,1,...F)):F=[h],P+F.length}}function B_(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 a=-1;for(;++a<n.length;){const s=n[a];t.push([U_(s[0]),j_(s[1])])}return t}function U_(e){return typeof e=="string"?new RegExp(M_(e),"g"):e}function j_(e){return typeof e=="function"?e:function(){return e}}const pc="phrasing",mc=["autolink","link","image","label"];function H_(){return{transforms:[Q_],enter:{literalAutolink:$_,literalAutolinkEmail:gc,literalAutolinkHttp:gc,literalAutolinkWww:gc},exit:{literalAutolink:q_,literalAutolinkEmail:V_,literalAutolinkHttp:W_,literalAutolinkWww:Y_}}}function z_(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:pc,notInConstruct:mc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:pc,notInConstruct:mc},{character:":",before:"[ps]",after:"\\/",inConstruct:pc,notInConstruct:mc}]}}function $_(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function gc(e){this.config.enter.autolinkProtocol.call(this,e)}function W_(e){this.config.exit.autolinkProtocol.call(this,e)}function Y_(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 V_(e){this.config.exit.autolinkEmail.call(this,e)}function q_(e){this.exit(e)}function Q_(e){F_(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,G_],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),K_]],{ignore:["link","linkReference"]})}function G_(e,t,n,a,s){let o="";if(!P1(s)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!X_(n)))return!1;const l=J_(n+a);if(!l[0])return!1;const d={type:"link",title:null,url:o+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[d,{type:"text",value:l[1]}]:d}function K_(e,t,n,a){return!P1(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function X_(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 J_(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const s=Sm(e,"(");let o=Sm(e,")");for(;a!==-1&&s>o;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),o++;return[e,n]}function P1(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Vr(n)||Qu(n))&&(!t||n!==47)}M1.peek=uS;function Z_(){this.buffer()}function eS(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function tS(){this.buffer()}function nS(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function rS(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=En(this.sliceSerialize(e)).toLowerCase(),n.label=t}function iS(e){this.exit(e)}function aS(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=En(this.sliceSerialize(e)).toLowerCase(),n.label=t}function sS(e){this.exit(e)}function uS(){return"["}function M1(e,t,n,a){const s=n.createTracker(a);let o=s.move("[^");const l=n.enter("footnoteReference"),d=n.enter("reference");return o+=s.move(n.safe(n.associationId(e),{after:"]",before:o})),d(),l(),o+=s.move("]"),o}function oS(){return{enter:{gfmFootnoteCallString:Z_,gfmFootnoteCall:eS,gfmFootnoteDefinitionLabelString:tS,gfmFootnoteDefinition:nS},exit:{gfmFootnoteCallString:rS,gfmFootnoteCall:iS,gfmFootnoteDefinitionLabelString:aS,gfmFootnoteDefinition:sS}}}function lS(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:M1},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,s,o,l){const d=o.createTracker(l);let f=d.move("[^");const h=o.enter("footnoteDefinition"),E=o.enter("label");return f+=d.move(o.safe(o.associationId(a),{before:f,after:"]"})),E(),f+=d.move("]:"),a.children&&a.children.length>0&&(d.shift(4),f+=d.move((t?`
|
|
70
|
+
`:" ")+o.indentLines(o.containerFlow(a,d.current()),t?F1:cS))),h(),f}}function cS(e,t,n){return t===0?e:F1(e,t,n)}function F1(e,t,n){return(n?"":" ")+e}const dS=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];B1.peek=gS;function fS(){return{canContainEols:["delete"],enter:{strikethrough:pS},exit:{strikethrough:mS}}}function hS(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:dS}],handlers:{delete:B1}}}function pS(e){this.enter({type:"delete",children:[]},e)}function mS(e){this.exit(e)}function B1(e,t,n,a){const s=n.createTracker(a),o=n.enter("strikethrough");let l=s.move("~~");return l+=n.containerPhrasing(e,{...s.current(),before:l,after:"~"}),l+=s.move("~~"),o(),l}function gS(){return"~"}function ES(e){return e.length}function TS(e,t){const n=t||{},a=(n.align||[]).concat(),s=n.stringLength||ES,o=[],l=[],d=[],f=[];let h=0,E=-1;for(;++E<e.length;){const A=[],P=[];let R=-1;for(e[E].length>h&&(h=e[E].length);++R<e[E].length;){const F=yS(e[E][R]);if(n.alignDelimiters!==!1){const U=s(F);P[R]=U,(f[R]===void 0||U>f[R])&&(f[R]=U)}A.push(F)}l[E]=A,d[E]=P}let g=-1;if(typeof a=="object"&&"length"in a)for(;++g<h;)o[g]=Nm(a[g]);else{const A=Nm(a);for(;++g<h;)o[g]=A}g=-1;const x=[],b=[];for(;++g<h;){const A=o[g];let P="",R="";A===99?(P=":",R=":"):A===108?P=":":A===114&&(R=":");let F=n.alignDelimiters===!1?1:Math.max(1,f[g]-P.length-R.length);const U=P+"-".repeat(F)+R;n.alignDelimiters!==!1&&(F=P.length+F+R.length,F>f[g]&&(f[g]=F),b[g]=F),x[g]=U}l.splice(1,0,x),d.splice(1,0,b),E=-1;const S=[];for(;++E<l.length;){const A=l[E],P=d[E];g=-1;const R=[];for(;++g<h;){const F=A[g]||"";let U="",K="";if(n.alignDelimiters!==!1){const $=f[g]-(P[g]||0),j=o[g];j===114?U=" ".repeat($):j===99?$%2?(U=" ".repeat($/2+.5),K=" ".repeat($/2-.5)):(U=" ".repeat($/2),K=U):K=" ".repeat($)}n.delimiterStart!==!1&&!g&&R.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&F==="")&&(n.delimiterStart!==!1||g)&&R.push(" "),n.alignDelimiters!==!1&&R.push(U),R.push(F),n.alignDelimiters!==!1&&R.push(K),n.padding!==!1&&R.push(" "),(n.delimiterEnd!==!1||g!==h-1)&&R.push("|")}S.push(n.delimiterEnd===!1?R.join("").replace(/ +$/,""):R.join(""))}return S.join(`
|
|
71
|
+
`)}function yS(e){return e==null?"":String(e)}function Nm(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}const Am={}.hasOwnProperty;function U1(e,t){const n=t||{};function a(s,...o){let l=a.invalid;const d=a.handlers;if(s&&Am.call(s,e)){const f=String(s[e]);l=Am.call(d,f)?d[f]:a.unknown}if(l)return l.call(this,s,...o)}return a.handlers=n.handlers||{},a.invalid=n.invalid,a.unknown=n.unknown,a}function xS(e,t,n,a){const s=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const l=n.indentLines(n.containerFlow(e,o.current()),bS);return s(),l}function bS(e,t,n){return">"+(n?"":" ")+e}function kS(e,t){return vm(e,t.inConstruct,!0)&&!vm(e,t.notInConstruct,!1)}function vm(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function wm(e,t,n,a){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
72
|
+
`&&kS(n.stack,n.unsafe[s]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
73
|
+
`}function j1(e,t){const n=String(e);let a=n.indexOf(t),s=a,o=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===s?++o>l&&(l=o):o=1,s=a+t.length,a=n.indexOf(t,s);return l}function CS(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 _S(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 SS(e,t,n,a){const s=_S(n),o=e.value||"",l=s==="`"?"GraveAccent":"Tilde";if(CS(e,n)){const g=n.enter("codeIndented"),x=n.indentLines(o,NS);return g(),x}const d=n.createTracker(a),f=s.repeat(Math.max(j1(o,s)+1,3)),h=n.enter("codeFenced");let E=d.move(f);if(e.lang){const g=n.enter(`codeFencedLang${l}`);E+=d.move(n.safe(e.lang,{before:E,after:" ",encode:["`"],...d.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${l}`);E+=d.move(" "),E+=d.move(n.safe(e.meta,{before:E,after:`
|
|
74
74
|
`,encode:["`"],...d.current()})),g()}return E+=d.move(`
|
|
75
75
|
`),o&&(E+=d.move(o+`
|
|
76
|
-
`)),E+=d.move(f),h(),E}function
|
|
77
|
-
`,...f.current()}))),d(),e.title&&(d=n.enter(`title${o}`),h+=f.move(" "+s),h+=f.move(n.safe(e.title,{before:h,after:s,...f.current()})),h+=f.move(s),d()),l(),h}function
|
|
76
|
+
`)),E+=d.move(f),h(),E}function NS(e,t,n){return(n?"":" ")+e}function xd(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 AS(e,t,n,a){const s=xd(n),o=s==='"'?"Quote":"Apostrophe",l=n.enter("definition");let d=n.enter("label");const f=n.createTracker(a);let h=f.move("[");return h+=f.move(n.safe(n.associationId(e),{before:h,after:"]",...f.current()})),h+=f.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(d=n.enter("destinationRaw"),h+=f.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
77
|
+
`,...f.current()}))),d(),e.title&&(d=n.enter(`title${o}`),h+=f.move(" "+s),h+=f.move(n.safe(e.title,{before:h,after:s,...f.current()})),h+=f.move(s),d()),l(),h}function vS(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 Ga(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Mu(e,t,n){const a=Li(e),s=Li(t);return a===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}H1.peek=wS;function H1(e,t,n,a){const s=vS(n),o=n.enter("emphasis"),l=n.createTracker(a),d=l.move(s);let f=l.move(n.containerPhrasing(e,{after:s,before:d,...l.current()}));const h=f.charCodeAt(0),E=Mu(a.before.charCodeAt(a.before.length-1),h,s);E.inside&&(f=Ga(h)+f.slice(1));const g=f.charCodeAt(f.length-1),x=Mu(a.after.charCodeAt(0),g,s);x.inside&&(f=f.slice(0,-1)+Ga(g));const b=l.move(s);return o(),n.attentionEncodeSurroundingInfo={after:x.outside,before:E.outside},d+f+b}function wS(e,t,n){return n.options.emphasis||"*"}function IS(e,t){let n=!1;return Zu(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Oc}),!!((!e.depth||e.depth<3)&&fd(e)&&(t.options.setext||n))}function LS(e,t,n,a){const s=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(IS(e,n)){const E=n.enter("headingSetext"),g=n.enter("phrasing"),x=n.containerPhrasing(e,{...o.current(),before:`
|
|
78
78
|
`,after:`
|
|
79
79
|
`});return g(),E(),x+`
|
|
80
80
|
`+(s===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
81
81
|
`))+1))}const l="#".repeat(s),d=n.enter("headingAtx"),f=n.enter("phrasing");o.move(l+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
82
|
-
`,...o.current()});return/^[\t ]/.test(h)&&(h=Ga(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,n.options.closeAtx&&(h+=" "+l),f(),d(),h}z1.peek=
|
|
82
|
+
`,...o.current()});return/^[\t ]/.test(h)&&(h=Ga(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,n.options.closeAtx&&(h+=" "+l),f(),d(),h}z1.peek=RS;function z1(e){return e.value||""}function RS(){return"<"}$1.peek=OS;function $1(e,t,n,a){const s=xd(n),o=s==='"'?"Quote":"Apostrophe",l=n.enter("image");let d=n.enter("label");const f=n.createTracker(a);let h=f.move("![");return h+=f.move(n.safe(e.alt,{before:h,after:"]",...f.current()})),h+=f.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(d=n.enter("destinationRaw"),h+=f.move(n.safe(e.url,{before:h,after:e.title?" ":")",...f.current()}))),d(),e.title&&(d=n.enter(`title${o}`),h+=f.move(" "+s),h+=f.move(n.safe(e.title,{before:h,after:s,...f.current()})),h+=f.move(s),d()),h+=f.move(")"),l(),h}function OS(){return"!"}W1.peek=DS;function W1(e,t,n,a){const s=e.referenceType,o=n.enter("imageReference");let l=n.enter("label");const d=n.createTracker(a);let f=d.move("![");const h=n.safe(e.alt,{before:f,after:"]",...d.current()});f+=d.move(h+"]["),l();const E=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(e),{before:f,after:"]",...d.current()});return l(),n.stack=E,o(),s==="full"||!h||h!==g?f+=d.move(g+"]"):s==="shortcut"?f=f.slice(0,-1):f+=d.move("]"),f}function DS(){return"!"}Y1.peek=PS;function Y1(e,t,n){let a=e.value||"",s="`",o=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(a);)s+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o<n.unsafe.length;){const l=n.unsafe[o],d=n.compilePattern(l);let f;if(l.atBreak)for(;f=d.exec(a);){let h=f.index;a.charCodeAt(h)===10&&a.charCodeAt(h-1)===13&&h--,a=a.slice(0,h)+" "+a.slice(f.index+1)}}return s+a+s}function PS(){return"`"}function V1(e,t){const n=fd(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))}q1.peek=MS;function q1(e,t,n,a){const s=xd(n),o=s==='"'?"Quote":"Apostrophe",l=n.createTracker(a);let d,f;if(V1(e,n)){const E=n.stack;n.stack=[],d=n.enter("autolink");let g=l.move("<");return g+=l.move(n.containerPhrasing(e,{before:g,after:">",...l.current()})),g+=l.move(">"),d(),n.stack=E,g}d=n.enter("link"),f=n.enter("label");let h=l.move("[");return h+=l.move(n.containerPhrasing(e,{before:h,after:"](",...l.current()})),h+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(n.safe(e.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(f=n.enter("destinationRaw"),h+=l.move(n.safe(e.url,{before:h,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=l.move(" "+s),h+=l.move(n.safe(e.title,{before:h,after:s,...l.current()})),h+=l.move(s),f()),h+=l.move(")"),d(),h}function MS(e,t,n){return V1(e,n)?"<":"["}Q1.peek=FS;function Q1(e,t,n,a){const s=e.referenceType,o=n.enter("linkReference");let l=n.enter("label");const d=n.createTracker(a);let f=d.move("[");const h=n.containerPhrasing(e,{before:f,after:"]",...d.current()});f+=d.move(h+"]["),l();const E=n.stack;n.stack=[],l=n.enter("reference");const g=n.safe(n.associationId(e),{before:f,after:"]",...d.current()});return l(),n.stack=E,o(),s==="full"||!h||h!==g?f+=d.move(g+"]"):s==="shortcut"?f=f.slice(0,-1):f+=d.move("]"),f}function FS(){return"["}function bd(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 BS(e){const t=bd(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 US(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 G1(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 jS(e,t,n,a){const s=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?US(n):bd(n);const d=e.ordered?l==="."?")":".":BS(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const E=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&E&&(!E.children||!E.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),G1(n)===l&&E){let g=-1;for(;++g<e.children.length;){const x=e.children[g];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=d),n.bulletCurrent=l;const h=n.containerFlow(e,a);return n.bulletLastUsed=l,n.bulletCurrent=o,s(),h}function HS(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 zS(e,t,n,a){const s=HS(n);let o=n.bulletCurrent||bd(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const d=n.createTracker(a);d.move(o+" ".repeat(l-o.length)),d.shift(l);const f=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,d.current()),E);return f(),h;function E(g,x,b){return x?(b?"":" ".repeat(l))+g:(b?o:o+" ".repeat(l-o.length))+g}}function $S(e,t,n,a){const s=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,a);return o(),s(),l}const WS=Xu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function YS(e,t,n,a){return(e.children.some(function(l){return WS(l)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function VS(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}K1.peek=qS;function K1(e,t,n,a){const s=VS(n),o=n.enter("strong"),l=n.createTracker(a),d=l.move(s+s);let f=l.move(n.containerPhrasing(e,{after:s,before:d,...l.current()}));const h=f.charCodeAt(0),E=Mu(a.before.charCodeAt(a.before.length-1),h,s);E.inside&&(f=Ga(h)+f.slice(1));const g=f.charCodeAt(f.length-1),x=Mu(a.after.charCodeAt(0),g,s);x.inside&&(f=f.slice(0,-1)+Ga(g));const b=l.move(s+s);return o(),n.attentionEncodeSurroundingInfo={after:x.outside,before:E.outside},d+f+b}function qS(e,t,n){return n.options.strong||"*"}function QS(e,t,n,a){return n.safe(e.value,a)}function GS(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 KS(e,t,n){const a=(G1(n)+(n.options.ruleSpaces?" ":"")).repeat(GS(n));return n.options.ruleSpaces?a.slice(0,-1):a}const X1={blockquote:xS,break:wm,code:SS,definition:AS,emphasis:H1,hardBreak:wm,heading:LS,html:z1,image:$1,imageReference:W1,inlineCode:Y1,link:q1,linkReference:Q1,list:jS,listItem:zS,paragraph:$S,root:YS,strong:K1,text:QS,thematicBreak:KS};function XS(){return{enter:{table:JS,tableData:Im,tableHeader:Im,tableRow:e3},exit:{codeText:t3,table:ZS,tableData:Ec,tableHeader:Ec,tableRow:Ec}}}function JS(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 ZS(e){this.exit(e),this.data.inTable=void 0}function e3(e){this.enter({type:"tableRow",children:[]},e)}function Ec(e){this.exit(e)}function Im(e){this.enter({type:"tableCell",children:[]},e)}function t3(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,n3));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function n3(e,t){return t==="|"?t:e}function r3(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,s=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
83
83
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:l,tableCell:f,tableRow:d}};function l(b,S,A,P){return h(E(b,A,P),b.align)}function d(b,S,A,P){const R=g(b,A,P),F=h([R]);return F.slice(0,F.indexOf(`
|
|
84
|
-
`))}function f(b,S,A,P){const R=A.enter("tableCell"),F=A.enter("phrasing"),U=A.containerPhrasing(b,{...P,before:o,after:o});return F(),R(),U}function h(b,S){return ES(b,{align:S,alignDelimiters:a,padding:n,stringLength:s})}function E(b,S,A){const P=b.children;let R=-1;const F=[],U=S.enter("table");for(;++R<P.length;)F[R]=g(P[R],S,A);return U(),F}function g(b,S,A){const P=b.children;let R=-1;const F=[],U=S.enter("tableRow");for(;++R<P.length;)F[R]=f(P[R],b,S,A);return U(),F}function x(b,S,A){let P=X1.inlineCode(b,S,A);return A.stack.includes("tableCell")&&(P=P.replace(/\|/g,"\\$&")),P}}function r3(){return{exit:{taskListCheckValueChecked:Lm,taskListCheckValueUnchecked:Lm,paragraph:a3}}}function i3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:s3}}}function Lm(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function a3(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 a=n.children[0];if(a&&a.type==="text"){const s=t.children;let o=-1,l;for(;++o<s.length;){const d=s[o];if(d.type==="paragraph"){l=d;break}}l===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function s3(e,t,n,a){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",d=n.createTracker(a);o&&d.move(l);let f=X1.listItem(e,t,n,{...a,...d.current()});return o&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),f;function h(E){return E+l}}function u3(){return[j_(),uS(),dS(),KS(),r3()]}function o3(e){return{extensions:[H_(),oS(e),fS(),n3(e),i3()]}}const l3={tokenize:m3,partial:!0},J1={tokenize:g3,partial:!0},Z1={tokenize:E3,partial:!0},eg={tokenize:T3,partial:!0},c3={tokenize:y3,partial:!0},tg={name:"wwwAutolink",tokenize:h3,previous:rg},ng={name:"protocolAutolink",tokenize:p3,previous:ig},Yn={name:"emailAutolink",tokenize:f3,previous:ag},Rn={};function d3(){return{text:Rn}}let Br=48;for(;Br<123;)Rn[Br]=Yn,Br++,Br===58?Br=65:Br===91&&(Br=97);Rn[43]=Yn;Rn[45]=Yn;Rn[46]=Yn;Rn[95]=Yn;Rn[72]=[Yn,ng];Rn[104]=[Yn,ng];Rn[87]=[Yn,tg];Rn[119]=[Yn,tg];function f3(e,t,n){const a=this;let s,o;return l;function l(g){return!Fc(g)||!ag.call(a,a.previous)||kd(a.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(g))}function d(g){return Fc(g)?(e.consume(g),d):g===64?(e.consume(g),f):n(g)}function f(g){return g===46?e.check(c3,E,h)(g):g===45||g===95||At(g)?(o=!0,e.consume(g),f):E(g)}function h(g){return e.consume(g),s=!0,f}function E(g){return o&&s&&Rt(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function h3(e,t,n){const a=this;return s;function s(l){return l!==87&&l!==119||!rg.call(a,a.previous)||kd(a.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(l3,e.attempt(J1,e.attempt(Z1,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function p3(e,t,n){const a=this;let s="",o=!1;return l;function l(g){return(g===72||g===104)&&ig.call(a,a.previous)&&!kd(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(g),e.consume(g),d):n(g)}function d(g){if(Rt(g)&&s.length<5)return s+=String.fromCodePoint(g),e.consume(g),d;if(g===58){const x=s.toLowerCase();if(x==="http"||x==="https")return e.consume(g),f}return n(g)}function f(g){return g===47?(e.consume(g),o?h:(o=!0,f)):n(g)}function h(g){return g===null||Du(g)||Ve(g)||Vr(g)||Qu(g)?n(g):e.attempt(J1,e.attempt(Z1,E),n)(g)}function E(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function m3(e,t,n){let a=0;return s;function s(l){return(l===87||l===119)&&a<3?(a++,e.consume(l),s):l===46&&a===3?(e.consume(l),o):n(l)}function o(l){return l===null?n(l):t(l)}}function g3(e,t,n){let a,s,o;return l;function l(h){return h===46||h===95?e.check(eg,f,d)(h):h===null||Ve(h)||Vr(h)||h!==45&&Qu(h)?f(h):(o=!0,e.consume(h),l)}function d(h){return h===95?a=!0:(s=a,a=void 0),e.consume(h),l}function f(h){return s||a||!o?n(h):t(h)}}function E3(e,t){let n=0,a=0;return s;function s(l){return l===40?(n++,e.consume(l),s):l===41&&a<n?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(eg,t,o)(l):l===null||Ve(l)||Vr(l)?t(l):(e.consume(l),s)}function o(l){return l===41&&a++,e.consume(l),s}}function T3(e,t,n){return a;function a(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),a):d===38?(e.consume(d),o):d===93?(e.consume(d),s):d===60||d===null||Ve(d)||Vr(d)?t(d):n(d)}function s(d){return d===null||d===40||d===91||Ve(d)||Vr(d)?t(d):a(d)}function o(d){return Rt(d)?l(d):n(d)}function l(d){return d===59?(e.consume(d),a):Rt(d)?(e.consume(d),l):n(d)}}function y3(e,t,n){return a;function a(o){return e.consume(o),s}function s(o){return At(o)?n(o):t(o)}}function rg(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ve(e)}function ig(e){return!Rt(e)}function ag(e){return!(e===47||Fc(e))}function Fc(e){return e===43||e===45||e===46||e===95||At(e)}function kd(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const x3={tokenize:v3,partial:!0};function b3(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:S3,continuation:{tokenize:N3},exit:A3}},text:{91:{name:"gfmFootnoteCall",tokenize:_3},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:k3,resolveTo:C3}}}}function k3(e,t,n){const a=this;let s=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let l;for(;s--;){const f=a.events[s][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return d;function d(f){if(!l||!l._balanced)return n(f);const h=En(a.sliceSerialize({start:l.end,end:a.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function C3(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 a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},d=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...d),e}function _3(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,l;return d;function d(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),f}function f(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(g){if(o>999||g===93&&!l||g===null||g===91||Ve(g))return n(g);if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return s.includes(En(a.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return Ve(g)||(l=!0),o++,e.consume(g),g===92?E:h}function E(g){return g===91||g===92||g===93?(e.consume(g),o++,h):h(g)}}function S3(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,l=0,d;return f;function f(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",E):n(S)}function E(S){if(l>999||S===93&&!d||S===null||S===91||Ve(S))return n(S);if(S===93){e.exit("chunkString");const A=e.exit("gfmFootnoteDefinitionLabelString");return o=En(a.sliceSerialize(A)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return Ve(S)||(d=!0),l++,e.consume(S),S===92?g:E}function g(S){return S===91||S===92||S===93?(e.consume(S),l++,E):E(S)}function x(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(o)||s.push(o),Me(e,b,"gfmFootnoteDefinitionWhitespace")):n(S)}function b(S){return t(S)}}function N3(e,t,n){return e.check(rs,t,e.attempt(x3,t,n))}function A3(e){e.exit("gfmFootnoteDefinition")}function v3(e,t,n){const a=this;return Me(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const l=a.events[a.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):n(o)}}function w3(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:s};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function s(l,d){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let h=f;for(;h--;)if(l[h][0]==="exit"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[h][1].end.offset-l[h][1].start.offset){l[f][1].type="strikethroughSequence",l[h][1].type="strikethroughSequence";const E={type:"strikethrough",start:Object.assign({},l[h][1].start),end:Object.assign({},l[f][1].end)},g={type:"strikethroughText",start:Object.assign({},l[h][1].end),end:Object.assign({},l[f][1].start)},x=[["enter",E,d],["enter",l[h][1],d],["exit",l[h][1],d],["enter",g,d]],b=d.parser.constructs.insideSpan.null;b&&Qt(x,x.length,0,Gu(b,l.slice(h+1,f),d)),Qt(x,x.length,0,[["exit",g,d],["enter",l[f][1],d],["exit",l[f][1],d],["exit",E,d]]),Qt(l,h-1,f-h+3,x),f=h+x.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function o(l,d,f){const h=this.previous,E=this.events;let g=0;return x;function x(S){return h===126&&E[E.length-1][1].type!=="characterEscape"?f(S):(l.enter("strikethroughSequenceTemporary"),b(S))}function b(S){const A=Li(h);if(S===126)return g>1?f(S):(l.consume(S),g++,b);if(g<2&&!n)return f(S);const P=l.exit("strikethroughSequenceTemporary"),R=Li(S);return P._open=!R||R===2&&!!A,P._close=!A||A===2&&!!R,d(S)}}}class I3{constructor(){this.map=[]}add(t,n,a){L3(this,t,n,a)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let s=a.pop();for(;s;){for(const o of s)t.push(o);s=a.pop()}this.map.length=0}}function L3(e,t,n,a){let s=0;if(!(n===0&&a.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...a);return}s+=1}e.map.push([t,n,a])}}function R3(e,t){let n=!1;const a=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function O3(){return{flow:{null:{name:"table",tokenize:D3,resolveAll:P3}}}}function D3(e,t,n){const a=this;let s=0,o=0,l;return d;function d(B){let ie=a.events.length-1;for(;ie>-1;){const de=a.events[ie][1].type;if(de==="lineEnding"||de==="linePrefix")ie--;else break}const ce=ie>-1?a.events[ie][1].type:null,ke=ce==="tableHead"||ce==="tableRow"?j:f;return ke===j&&a.parser.lazy[a.now().line]?n(B):ke(B)}function f(B){return e.enter("tableHead"),e.enter("tableRow"),h(B)}function h(B){return B===124||(l=!0,o+=1),E(B)}function E(B){return B===null?n(B):be(B)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),b):n(B):Fe(B)?Me(e,E,"whitespace")(B):(o+=1,l&&(l=!1,s+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),l=!0,E):(e.enter("data"),g(B)))}function g(B){return B===null||B===124||Ve(B)?(e.exit("data"),E(B)):(e.consume(B),B===92?x:g)}function x(B){return B===92||B===124?(e.consume(B),g):g(B)}function b(B){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(B):(e.enter("tableDelimiterRow"),l=!1,Fe(B)?Me(e,S,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):S(B))}function S(B){return B===45||B===58?P(B):B===124?(l=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),A):$(B)}function A(B){return Fe(B)?Me(e,P,"whitespace")(B):P(B)}function P(B){return B===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),R):B===45?(o+=1,R(B)):B===null||be(B)?K(B):$(B)}function R(B){return B===45?(e.enter("tableDelimiterFiller"),F(B)):$(B)}function F(B){return B===45?(e.consume(B),F):B===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),U):(e.exit("tableDelimiterFiller"),U(B))}function U(B){return Fe(B)?Me(e,K,"whitespace")(B):K(B)}function K(B){return B===124?S(B):B===null||be(B)?!l||s!==o?$(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(B)):$(B)}function $(B){return n(B)}function j(B){return e.enter("tableRow"),te(B)}function te(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),te):B===null||be(B)?(e.exit("tableRow"),t(B)):Fe(B)?Me(e,te,"whitespace")(B):(e.enter("data"),ue(B))}function ue(B){return B===null||B===124||Ve(B)?(e.exit("data"),te(B)):(e.consume(B),B===92?fe:ue)}function fe(B){return B===92||B===124?(e.consume(B),ue):ue(B)}}function P3(e,t){let n=-1,a=!0,s=0,o=[0,0,0,0],l=[0,0,0,0],d=!1,f=0,h,E,g;const x=new I3;for(;++n<e.length;){const b=e[n],S=b[1];b[0]==="enter"?S.type==="tableHead"?(d=!1,f!==0&&(Rm(x,t,f,h,E),E=void 0,f=0),h={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},x.add(n,0,[["enter",h,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(a=!0,g=void 0,o=[0,0,0,0],l=[0,n+1,0,0],d&&(d=!1,E={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},x.add(n,0,[["enter",E,t]])),s=S.type==="tableDelimiterRow"?2:E?3:1):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(a=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],g=Su(x,t,o,s,void 0,g),o=[0,0,0,0]),l[2]=n)):S.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(l[0]=l[1],g=Su(x,t,o,s,void 0,g)),o=l,l=[o[1],n,0,0])):S.type==="tableHead"?(d=!0,f=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(f=n,o[1]!==0?(l[0]=l[1],g=Su(x,t,o,s,n,g)):l[1]!==0&&(g=Su(x,t,l,s,n,g)),s=0):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&Rm(x,t,f,h,E),x.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=R3(t.events,n))}return e}function Su(e,t,n,a,s,o){const l=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",d="tableContent";n[0]!==0&&(o.end=Object.assign({},vi(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const f=vi(t.events,n[1]);if(o={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=vi(t.events,n[2]),E=vi(t.events,n[3]),g={type:d,start:Object.assign({},h),end:Object.assign({},E)};if(e.add(n[2],0,[["enter",g,t]]),a!==2){const x=t.events[n[2]],b=t.events[n[3]];if(x[1].end=Object.assign({},b[1].end),x[1].type="chunkText",x[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,A=n[3]-n[2]-1;e.add(S,A,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return s!==void 0&&(o.end=Object.assign({},vi(t.events,s)),e.add(s,0,[["exit",o,t]]),o=void 0),o}function Rm(e,t,n,a,s){const o=[],l=vi(t.events,n);s&&(s.end=Object.assign({},l),o.push(["exit",s,t])),a.end=Object.assign({},l),o.push(["exit",a,t]),e.add(n+1,0,o)}function vi(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const M3={name:"tasklistCheck",tokenize:B3};function F3(){return{text:{91:M3}}}function B3(e,t,n){const a=this;return s;function s(f){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),o)}function o(f){return Ve(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):n(f)}function d(f){return be(f)?t(f):Fe(f)?e.check({tokenize:U3},t,n)(f):n(f)}}function U3(e,t,n){return Me(e,a,"whitespace");function a(s){return s===null?n(s):t(s)}}function j3(e){return p1([d3(),b3(),w3(e),O3(),F3()])}const H3={};function z3(e){const t=this,n=e||H3,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),l=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(j3(n)),o.push(u3()),l.push(o3(n))}function $3(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:s,mathFlowFence:a,mathFlowFenceMeta:n,mathFlowValue:d,mathText:l,mathTextData:d}};function e(f){const h={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[h]}},f)}function t(){this.buffer()}function n(){const f=this.resume(),h=this.stack[this.stack.length-1];h.type,h.meta=f}function a(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(f){const h=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),E=this.stack[this.stack.length-1];E.type,this.exit(f),E.value=h;const g=E.data.hChildren[0];g.type,g.tagName,g.children.push({type:"text",value:h}),this.data.mathFlowInside=void 0}function o(f){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},f),this.buffer()}function l(f){const h=this.resume(),E=this.stack[this.stack.length-1];E.type,this.exit(f),E.value=h,E.data.hChildren.push({type:"text",value:h})}function d(f){this.config.enter.data.call(this,f),this.config.exit.data.call(this,f)}}function W3(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),a.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
|
|
84
|
+
`))}function f(b,S,A,P){const R=A.enter("tableCell"),F=A.enter("phrasing"),U=A.containerPhrasing(b,{...P,before:o,after:o});return F(),R(),U}function h(b,S){return TS(b,{align:S,alignDelimiters:a,padding:n,stringLength:s})}function E(b,S,A){const P=b.children;let R=-1;const F=[],U=S.enter("table");for(;++R<P.length;)F[R]=g(P[R],S,A);return U(),F}function g(b,S,A){const P=b.children;let R=-1;const F=[],U=S.enter("tableRow");for(;++R<P.length;)F[R]=f(P[R],b,S,A);return U(),F}function x(b,S,A){let P=X1.inlineCode(b,S,A);return A.stack.includes("tableCell")&&(P=P.replace(/\|/g,"\\$&")),P}}function i3(){return{exit:{taskListCheckValueChecked:Lm,taskListCheckValueUnchecked:Lm,paragraph:s3}}}function a3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:u3}}}function Lm(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function s3(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 a=n.children[0];if(a&&a.type==="text"){const s=t.children;let o=-1,l;for(;++o<s.length;){const d=s[o];if(d.type==="paragraph"){l=d;break}}l===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function u3(e,t,n,a){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",d=n.createTracker(a);o&&d.move(l);let f=X1.listItem(e,t,n,{...a,...d.current()});return o&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),f;function h(E){return E+l}}function o3(){return[H_(),oS(),fS(),XS(),i3()]}function l3(e){return{extensions:[z_(),lS(e),hS(),r3(e),a3()]}}const c3={tokenize:g3,partial:!0},J1={tokenize:E3,partial:!0},Z1={tokenize:T3,partial:!0},eg={tokenize:y3,partial:!0},d3={tokenize:x3,partial:!0},tg={name:"wwwAutolink",tokenize:p3,previous:rg},ng={name:"protocolAutolink",tokenize:m3,previous:ig},Yn={name:"emailAutolink",tokenize:h3,previous:ag},Rn={};function f3(){return{text:Rn}}let Br=48;for(;Br<123;)Rn[Br]=Yn,Br++,Br===58?Br=65:Br===91&&(Br=97);Rn[43]=Yn;Rn[45]=Yn;Rn[46]=Yn;Rn[95]=Yn;Rn[72]=[Yn,ng];Rn[104]=[Yn,ng];Rn[87]=[Yn,tg];Rn[119]=[Yn,tg];function h3(e,t,n){const a=this;let s,o;return l;function l(g){return!Fc(g)||!ag.call(a,a.previous)||kd(a.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(g))}function d(g){return Fc(g)?(e.consume(g),d):g===64?(e.consume(g),f):n(g)}function f(g){return g===46?e.check(d3,E,h)(g):g===45||g===95||At(g)?(o=!0,e.consume(g),f):E(g)}function h(g){return e.consume(g),s=!0,f}function E(g){return o&&s&&Rt(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function p3(e,t,n){const a=this;return s;function s(l){return l!==87&&l!==119||!rg.call(a,a.previous)||kd(a.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(c3,e.attempt(J1,e.attempt(Z1,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function m3(e,t,n){const a=this;let s="",o=!1;return l;function l(g){return(g===72||g===104)&&ig.call(a,a.previous)&&!kd(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(g),e.consume(g),d):n(g)}function d(g){if(Rt(g)&&s.length<5)return s+=String.fromCodePoint(g),e.consume(g),d;if(g===58){const x=s.toLowerCase();if(x==="http"||x==="https")return e.consume(g),f}return n(g)}function f(g){return g===47?(e.consume(g),o?h:(o=!0,f)):n(g)}function h(g){return g===null||Du(g)||Ve(g)||Vr(g)||Qu(g)?n(g):e.attempt(J1,e.attempt(Z1,E),n)(g)}function E(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function g3(e,t,n){let a=0;return s;function s(l){return(l===87||l===119)&&a<3?(a++,e.consume(l),s):l===46&&a===3?(e.consume(l),o):n(l)}function o(l){return l===null?n(l):t(l)}}function E3(e,t,n){let a,s,o;return l;function l(h){return h===46||h===95?e.check(eg,f,d)(h):h===null||Ve(h)||Vr(h)||h!==45&&Qu(h)?f(h):(o=!0,e.consume(h),l)}function d(h){return h===95?a=!0:(s=a,a=void 0),e.consume(h),l}function f(h){return s||a||!o?n(h):t(h)}}function T3(e,t){let n=0,a=0;return s;function s(l){return l===40?(n++,e.consume(l),s):l===41&&a<n?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(eg,t,o)(l):l===null||Ve(l)||Vr(l)?t(l):(e.consume(l),s)}function o(l){return l===41&&a++,e.consume(l),s}}function y3(e,t,n){return a;function a(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),a):d===38?(e.consume(d),o):d===93?(e.consume(d),s):d===60||d===null||Ve(d)||Vr(d)?t(d):n(d)}function s(d){return d===null||d===40||d===91||Ve(d)||Vr(d)?t(d):a(d)}function o(d){return Rt(d)?l(d):n(d)}function l(d){return d===59?(e.consume(d),a):Rt(d)?(e.consume(d),l):n(d)}}function x3(e,t,n){return a;function a(o){return e.consume(o),s}function s(o){return At(o)?n(o):t(o)}}function rg(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ve(e)}function ig(e){return!Rt(e)}function ag(e){return!(e===47||Fc(e))}function Fc(e){return e===43||e===45||e===46||e===95||At(e)}function kd(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const b3={tokenize:w3,partial:!0};function k3(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:N3,continuation:{tokenize:A3},exit:v3}},text:{91:{name:"gfmFootnoteCall",tokenize:S3},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:C3,resolveTo:_3}}}}function C3(e,t,n){const a=this;let s=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let l;for(;s--;){const f=a.events[s][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return d;function d(f){if(!l||!l._balanced)return n(f);const h=En(a.sliceSerialize({start:l.end,end:a.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function _3(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 a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},d=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...d),e}function S3(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,l;return d;function d(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),f}function f(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(g){if(o>999||g===93&&!l||g===null||g===91||Ve(g))return n(g);if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return s.includes(En(a.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return Ve(g)||(l=!0),o++,e.consume(g),g===92?E:h}function E(g){return g===91||g===92||g===93?(e.consume(g),o++,h):h(g)}}function N3(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,l=0,d;return f;function f(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",E):n(S)}function E(S){if(l>999||S===93&&!d||S===null||S===91||Ve(S))return n(S);if(S===93){e.exit("chunkString");const A=e.exit("gfmFootnoteDefinitionLabelString");return o=En(a.sliceSerialize(A)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return Ve(S)||(d=!0),l++,e.consume(S),S===92?g:E}function g(S){return S===91||S===92||S===93?(e.consume(S),l++,E):E(S)}function x(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(o)||s.push(o),Me(e,b,"gfmFootnoteDefinitionWhitespace")):n(S)}function b(S){return t(S)}}function A3(e,t,n){return e.check(rs,t,e.attempt(b3,t,n))}function v3(e){e.exit("gfmFootnoteDefinition")}function w3(e,t,n){const a=this;return Me(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const l=a.events[a.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):n(o)}}function I3(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:s};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function s(l,d){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let h=f;for(;h--;)if(l[h][0]==="exit"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[h][1].end.offset-l[h][1].start.offset){l[f][1].type="strikethroughSequence",l[h][1].type="strikethroughSequence";const E={type:"strikethrough",start:Object.assign({},l[h][1].start),end:Object.assign({},l[f][1].end)},g={type:"strikethroughText",start:Object.assign({},l[h][1].end),end:Object.assign({},l[f][1].start)},x=[["enter",E,d],["enter",l[h][1],d],["exit",l[h][1],d],["enter",g,d]],b=d.parser.constructs.insideSpan.null;b&&Qt(x,x.length,0,Gu(b,l.slice(h+1,f),d)),Qt(x,x.length,0,[["exit",g,d],["enter",l[f][1],d],["exit",l[f][1],d],["exit",E,d]]),Qt(l,h-1,f-h+3,x),f=h+x.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function o(l,d,f){const h=this.previous,E=this.events;let g=0;return x;function x(S){return h===126&&E[E.length-1][1].type!=="characterEscape"?f(S):(l.enter("strikethroughSequenceTemporary"),b(S))}function b(S){const A=Li(h);if(S===126)return g>1?f(S):(l.consume(S),g++,b);if(g<2&&!n)return f(S);const P=l.exit("strikethroughSequenceTemporary"),R=Li(S);return P._open=!R||R===2&&!!A,P._close=!A||A===2&&!!R,d(S)}}}class L3{constructor(){this.map=[]}add(t,n,a){R3(this,t,n,a)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let s=a.pop();for(;s;){for(const o of s)t.push(o);s=a.pop()}this.map.length=0}}function R3(e,t,n,a){let s=0;if(!(n===0&&a.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...a);return}s+=1}e.map.push([t,n,a])}}function O3(e,t){let n=!1;const a=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function D3(){return{flow:{null:{name:"table",tokenize:P3,resolveAll:M3}}}}function P3(e,t,n){const a=this;let s=0,o=0,l;return d;function d(B){let ie=a.events.length-1;for(;ie>-1;){const de=a.events[ie][1].type;if(de==="lineEnding"||de==="linePrefix")ie--;else break}const ce=ie>-1?a.events[ie][1].type:null,ke=ce==="tableHead"||ce==="tableRow"?j:f;return ke===j&&a.parser.lazy[a.now().line]?n(B):ke(B)}function f(B){return e.enter("tableHead"),e.enter("tableRow"),h(B)}function h(B){return B===124||(l=!0,o+=1),E(B)}function E(B){return B===null?n(B):be(B)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),b):n(B):Fe(B)?Me(e,E,"whitespace")(B):(o+=1,l&&(l=!1,s+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),l=!0,E):(e.enter("data"),g(B)))}function g(B){return B===null||B===124||Ve(B)?(e.exit("data"),E(B)):(e.consume(B),B===92?x:g)}function x(B){return B===92||B===124?(e.consume(B),g):g(B)}function b(B){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(B):(e.enter("tableDelimiterRow"),l=!1,Fe(B)?Me(e,S,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):S(B))}function S(B){return B===45||B===58?P(B):B===124?(l=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),A):$(B)}function A(B){return Fe(B)?Me(e,P,"whitespace")(B):P(B)}function P(B){return B===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),R):B===45?(o+=1,R(B)):B===null||be(B)?K(B):$(B)}function R(B){return B===45?(e.enter("tableDelimiterFiller"),F(B)):$(B)}function F(B){return B===45?(e.consume(B),F):B===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),U):(e.exit("tableDelimiterFiller"),U(B))}function U(B){return Fe(B)?Me(e,K,"whitespace")(B):K(B)}function K(B){return B===124?S(B):B===null||be(B)?!l||s!==o?$(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(B)):$(B)}function $(B){return n(B)}function j(B){return e.enter("tableRow"),te(B)}function te(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),te):B===null||be(B)?(e.exit("tableRow"),t(B)):Fe(B)?Me(e,te,"whitespace")(B):(e.enter("data"),ue(B))}function ue(B){return B===null||B===124||Ve(B)?(e.exit("data"),te(B)):(e.consume(B),B===92?fe:ue)}function fe(B){return B===92||B===124?(e.consume(B),ue):ue(B)}}function M3(e,t){let n=-1,a=!0,s=0,o=[0,0,0,0],l=[0,0,0,0],d=!1,f=0,h,E,g;const x=new L3;for(;++n<e.length;){const b=e[n],S=b[1];b[0]==="enter"?S.type==="tableHead"?(d=!1,f!==0&&(Rm(x,t,f,h,E),E=void 0,f=0),h={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},x.add(n,0,[["enter",h,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(a=!0,g=void 0,o=[0,0,0,0],l=[0,n+1,0,0],d&&(d=!1,E={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},x.add(n,0,[["enter",E,t]])),s=S.type==="tableDelimiterRow"?2:E?3:1):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(a=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],g=Su(x,t,o,s,void 0,g),o=[0,0,0,0]),l[2]=n)):S.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(l[0]=l[1],g=Su(x,t,o,s,void 0,g)),o=l,l=[o[1],n,0,0])):S.type==="tableHead"?(d=!0,f=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(f=n,o[1]!==0?(l[0]=l[1],g=Su(x,t,o,s,n,g)):l[1]!==0&&(g=Su(x,t,l,s,n,g)),s=0):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&Rm(x,t,f,h,E),x.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=O3(t.events,n))}return e}function Su(e,t,n,a,s,o){const l=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",d="tableContent";n[0]!==0&&(o.end=Object.assign({},vi(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const f=vi(t.events,n[1]);if(o={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=vi(t.events,n[2]),E=vi(t.events,n[3]),g={type:d,start:Object.assign({},h),end:Object.assign({},E)};if(e.add(n[2],0,[["enter",g,t]]),a!==2){const x=t.events[n[2]],b=t.events[n[3]];if(x[1].end=Object.assign({},b[1].end),x[1].type="chunkText",x[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,A=n[3]-n[2]-1;e.add(S,A,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return s!==void 0&&(o.end=Object.assign({},vi(t.events,s)),e.add(s,0,[["exit",o,t]]),o=void 0),o}function Rm(e,t,n,a,s){const o=[],l=vi(t.events,n);s&&(s.end=Object.assign({},l),o.push(["exit",s,t])),a.end=Object.assign({},l),o.push(["exit",a,t]),e.add(n+1,0,o)}function vi(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const F3={name:"tasklistCheck",tokenize:U3};function B3(){return{text:{91:F3}}}function U3(e,t,n){const a=this;return s;function s(f){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),o)}function o(f){return Ve(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):n(f)}function d(f){return be(f)?t(f):Fe(f)?e.check({tokenize:j3},t,n)(f):n(f)}}function j3(e,t,n){return Me(e,a,"whitespace");function a(s){return s===null?n(s):t(s)}}function H3(e){return p1([f3(),k3(),I3(e),D3(),B3()])}const z3={};function $3(e){const t=this,n=e||z3,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),l=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(H3(n)),o.push(o3()),l.push(l3(n))}function W3(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:s,mathFlowFence:a,mathFlowFenceMeta:n,mathFlowValue:d,mathText:l,mathTextData:d}};function e(f){const h={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[h]}},f)}function t(){this.buffer()}function n(){const f=this.resume(),h=this.stack[this.stack.length-1];h.type,h.meta=f}function a(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(f){const h=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),E=this.stack[this.stack.length-1];E.type,this.exit(f),E.value=h;const g=E.data.hChildren[0];g.type,g.tagName,g.children.push({type:"text",value:h}),this.data.mathFlowInside=void 0}function o(f){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},f),this.buffer()}function l(f){const h=this.resume(),E=this.stack[this.stack.length-1];E.type,this.exit(f),E.value=h,E.data.hChildren.push({type:"text",value:h})}function d(f){this.config.enter.data.call(this,f),this.config.exit.data.call(this,f)}}function Y3(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),a.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
|
|
85
85
|
`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:a}};function n(o,l,d,f){const h=o.value||"",E=d.createTracker(f),g="$".repeat(Math.max(j1(h,"$")+1,2)),x=d.enter("mathFlow");let b=E.move(g);if(o.meta){const S=d.enter("mathFlowMeta");b+=E.move(d.safe(o.meta,{after:`
|
|
86
86
|
`,before:b,encode:["$"],...E.current()})),S()}return b+=E.move(`
|
|
87
87
|
`),h&&(b+=E.move(h+`
|
|
88
|
-
`)),b+=E.move(g),x(),b}function a(o,l,d){let f=o.value||"",h=1;for(t||h++;new RegExp("(^|[^$])"+"\\$".repeat(h)+"([^$]|$)").test(f);)h++;const E="$".repeat(h);/[^ \r\n]/.test(f)&&(/^[ \r\n]/.test(f)&&/[ \r\n]$/.test(f)||/^\$|\$$/.test(f))&&(f=" "+f+" ");let g=-1;for(;++g<d.unsafe.length;){const x=d.unsafe[g];if(!x.atBreak)continue;const b=d.compilePattern(x);let S;for(;S=b.exec(f);){let A=S.index;f.codePointAt(A)===10&&f.codePointAt(A-1)===13&&A--,f=f.slice(0,A)+" "+f.slice(S.index+1)}}return E+f+E}function s(){return"$"}}const
|
|
89
|
-
${n}`,t+3);return a===-1?e.length:a+4}if(e[t]==="`"){let n=0;for(;e[t+n]==="`";)n++;const a=e.indexOf("`".repeat(n),t+n);return a===-1?t+n:a+n}return t}function
|
|
90
|
-
`,t);return a===-1?n:n===-1||n+1===a?a:n<a?n:a}const $r={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/"},ug={}.hasOwnProperty,xN=Object.prototype;function bN(e,t){const n=t||{};return Cd({file:n.file||void 0,location:!1,schema:n.space==="svg"?xr:ns,verbose:n.verbose||!1},e)}function Cd(e,t){let n;switch(t.nodeName){case"#comment":{const a=t;return n={type:"comment",value:a.data},Lu(e,a,n),n}case"#document":case"#document-fragment":{const a=t,s="mode"in a?a.mode==="quirks"||a.mode==="limited-quirks":!1;if(n={type:"root",children:og(e,t.childNodes),data:{quirksMode:s}},e.file&&e.location){const o=String(e.file),l=yN(o),d=l.toPoint(0),f=l.toPoint(o.length);n.position={start:d,end:f}}return n}case"#documentType":{const a=t;return n={type:"doctype"},Lu(e,a,n),n}case"#text":{const a=t;return n={type:"text",value:a.value},Lu(e,a,n),n}default:return n=kN(e,t),n}}function og(e,t){let n=-1;const a=[];for(;++n<t.length;){const s=Cd(e,t[n]);a.push(s)}return a}function kN(e,t){const n=e.schema;e.schema=t.namespaceURI===$r.svg?xr:ns;let a=-1;const s={};for(;++a<t.attrs.length;){const d=t.attrs[a],f=(d.prefix?d.prefix+":":"")+d.name;ug.call(xN,f)||(s[f]=d.value)}const l=(e.schema.space==="svg"?TN:EN)(t.tagName,s,og(e,t.childNodes));if(Lu(e,t,l),l.tagName==="template"){const d=t,f=d.sourceCodeLocation,h=f&&f.startTag&&wi(f.startTag),E=f&&f.endTag&&wi(f.endTag),g=Cd(e,d.content);h&&E&&e.file&&(g.position={start:h.end,end:E.start}),l.content=g}return e.schema=n,l}function Lu(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const a=CN(e,n,t.sourceCodeLocation);a&&(e.location=!0,n.position=a)}}function CN(e,t,n){const a=wi(n);if(t.type==="element"){const s=t.children[t.children.length-1];if(a&&!n.endTag&&s&&s.position&&s.position.end&&(a.end=Object.assign({},s.position.end)),e.verbose){const o={};let l;if(n.attrs)for(l in n.attrs)ug.call(n.attrs,l)&&(o[Vu(e.schema,l).property]=wi(n.attrs[l]));n.startTag;const d=wi(n.startTag),f=n.endTag?wi(n.endTag):void 0,h={opening:d};f&&(h.closing=f),h.properties=o,t.data={position:h}}}return a}function wi(e){const t=Bm({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=Bm({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function Bm(e){return e.line&&e.column?e:void 0}const _N={},SN={}.hasOwnProperty,lg=U1("type",{handlers:{root:AN,element:RN,text:IN,comment:LN,doctype:wN}});function NN(e,t){const a=(t||_N).space;return lg(e,a==="svg"?xr:ns)}function AN(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=_d(e.children,n,t),Fi(e,n),n}function vN(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=_d(e.children,n,t),Fi(e,n),n}function wN(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Fi(e,t),t}function IN(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Fi(e,t),t}function LN(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Fi(e,t),t}function RN(e,t){const n=t;let a=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(a=xr);const s=[];let o;if(e.properties){for(o in e.properties)if(o!=="children"&&SN.call(e.properties,o)){const f=ON(a,o,e.properties[o]);f&&s.push(f)}}const l=a.space,d={nodeName:e.tagName,tagName:e.tagName,attrs:s,namespaceURI:$r[l],childNodes:[],parentNode:null};return d.childNodes=_d(e.children,d,a),Fi(e,d),e.tagName==="template"&&e.content&&(d.content=vN(e.content,a)),d}function ON(e,t,n){const a=Vu(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&a.boolean)return;Array.isArray(n)&&(n=a.commaSeparated?J0(n):s1(n));const s={name:a.attribute,value:n===!0?"":String(n)};if(a.space&&a.space!=="html"&&a.space!=="svg"){const o=s.name.indexOf(":");o<0?s.prefix="":(s.name=s.name.slice(o+1),s.prefix=a.attribute.slice(0,o)),s.namespace=$r[a.space]}return s}function _d(e,t,n){let a=-1;const s=[];if(e)for(;++a<e.length;){const o=lg(e[a],n);o.parentNode=t,s.push(o)}return s}function Fi(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 DN=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],PN=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]),Je="�";var _;(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"})(_||(_={}));const Ut={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function cg(e){return e>=55296&&e<=57343}function MN(e){return e>=56320&&e<=57343}function FN(e,t){return(e-55296)*1024+9216+t}function dg(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function fg(e){return e>=64976&&e<=65007||PN.has(e)}var q;(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"})(q||(q={}));const BN=65536;class UN{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=BN,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:a,col:s,offset:o}=this,l=s+n,d=o+n;return{code:t,startLine:a,endLine:a,startCol:l,endCol:l,startOffset:d,endOffset:d}}_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(MN(n))return this.pos++,this._addGap(),FN(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,_.EOF;return this._err(q.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 a=0;a<t.length;a++)if((this.html.charCodeAt(this.pos+a)|32)!==t.charCodeAt(a))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,_.EOF;const a=this.html.charCodeAt(n);return a===_.CARRIAGE_RETURN?_.LINE_FEED:a}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,_.EOF;let t=this.html.charCodeAt(this.pos);return t===_.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,_.LINE_FEED):t===_.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,cg(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===_.LINE_FEED||t===_.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){dg(t)?this._err(q.controlCharacterInInputStream):fg(t)&&this._err(q.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Pe;(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"})(Pe||(Pe={}));function hg(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 jN=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),HN=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 zN(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=HN.get(e))!==null&&t!==void 0?t:e}var gt;(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"})(gt||(gt={}));const $N=32;var Tr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Tr||(Tr={}));function Uc(e){return e>=gt.ZERO&&e<=gt.NINE}function WN(e){return e>=gt.UPPER_A&&e<=gt.UPPER_F||e>=gt.LOWER_A&&e<=gt.LOWER_F}function YN(e){return e>=gt.UPPER_A&&e<=gt.UPPER_Z||e>=gt.LOWER_A&&e<=gt.LOWER_Z||Uc(e)}function VN(e){return e===gt.EQUALS||YN(e)}var mt;(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"})(mt||(mt={}));var $n;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})($n||($n={}));class qN{constructor(t,n,a){this.decodeTree=t,this.emitCodePoint=n,this.errors=a,this.state=mt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=$n.Strict}startEntity(t){this.decodeMode=t,this.state=mt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case mt.EntityStart:return t.charCodeAt(n)===gt.NUM?(this.state=mt.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=mt.NamedEntity,this.stateNamedEntity(t,n));case mt.NumericStart:return this.stateNumericStart(t,n);case mt.NumericDecimal:return this.stateNumericDecimal(t,n);case mt.NumericHex:return this.stateNumericHex(t,n);case mt.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|$N)===gt.LOWER_X?(this.state=mt.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=mt.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,a,s){if(n!==a){const o=a-n;this.result=this.result*Math.pow(s,o)+Number.parseInt(t.substr(n,o),s),this.consumed+=o}}stateNumericHex(t,n){const a=n;for(;n<t.length;){const s=t.charCodeAt(n);if(Uc(s)||WN(s))n+=1;else return this.addToNumericResult(t,a,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(t,a,n,16),-1}stateNumericDecimal(t,n){const a=n;for(;n<t.length;){const s=t.charCodeAt(n);if(Uc(s))n+=1;else return this.addToNumericResult(t,a,n,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(t,a,n,10),-1}emitNumericEntity(t,n){var a;if(this.consumed<=n)return(a=this.errors)===null||a===void 0||a.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===gt.SEMI)this.consumed+=1;else if(this.decodeMode===$n.Strict)return 0;return this.emitCodePoint(zN(this.result),this.consumed),this.errors&&(t!==gt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:a}=this;let s=a[this.treeIndex],o=(s&Tr.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const l=t.charCodeAt(n);if(this.treeIndex=QN(a,s,this.treeIndex+Math.max(1,o),l),this.treeIndex<0)return this.result===0||this.decodeMode===$n.Attribute&&(o===0||VN(l))?0:this.emitNotTerminatedNamedEntity();if(s=a[this.treeIndex],o=(s&Tr.VALUE_LENGTH)>>14,o!==0){if(l===gt.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==$n.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:a}=this,s=(a[n]&Tr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,a){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[t]&~Tr.VALUE_LENGTH:s[t+1],a),n===3&&this.emitCodePoint(s[t+2],a),a}end(){var t;switch(this.state){case mt.NamedEntity:return this.result!==0&&(this.decodeMode!==$n.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case mt.NumericDecimal:return this.emitNumericEntity(0,2);case mt.NumericHex:return this.emitNumericEntity(0,3);case mt.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case mt.EntityStart:return 0}}}function QN(e,t,n,a){const s=(t&Tr.BRANCH_LENGTH)>>7,o=t&Tr.JUMP_TABLE;if(s===0)return o!==0&&a===o?n:-1;if(o){const f=a-o;return f<0||f>=s?-1:e[n+f]-1}let l=n,d=l+s-1;for(;l<=d;){const f=l+d>>>1,h=e[f];if(h<a)l=f+1;else if(h>a)d=f-1;else return e[f+s]}return-1}var Z;(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/"})(Z||(Z={}));var Yr;(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"})(Yr||(Yr={}));var an;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(an||(an={}));var z;(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"})(z||(z={}));var p;(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"})(p||(p={}));const GN=new Map([[z.A,p.A],[z.ADDRESS,p.ADDRESS],[z.ANNOTATION_XML,p.ANNOTATION_XML],[z.APPLET,p.APPLET],[z.AREA,p.AREA],[z.ARTICLE,p.ARTICLE],[z.ASIDE,p.ASIDE],[z.B,p.B],[z.BASE,p.BASE],[z.BASEFONT,p.BASEFONT],[z.BGSOUND,p.BGSOUND],[z.BIG,p.BIG],[z.BLOCKQUOTE,p.BLOCKQUOTE],[z.BODY,p.BODY],[z.BR,p.BR],[z.BUTTON,p.BUTTON],[z.CAPTION,p.CAPTION],[z.CENTER,p.CENTER],[z.CODE,p.CODE],[z.COL,p.COL],[z.COLGROUP,p.COLGROUP],[z.DD,p.DD],[z.DESC,p.DESC],[z.DETAILS,p.DETAILS],[z.DIALOG,p.DIALOG],[z.DIR,p.DIR],[z.DIV,p.DIV],[z.DL,p.DL],[z.DT,p.DT],[z.EM,p.EM],[z.EMBED,p.EMBED],[z.FIELDSET,p.FIELDSET],[z.FIGCAPTION,p.FIGCAPTION],[z.FIGURE,p.FIGURE],[z.FONT,p.FONT],[z.FOOTER,p.FOOTER],[z.FOREIGN_OBJECT,p.FOREIGN_OBJECT],[z.FORM,p.FORM],[z.FRAME,p.FRAME],[z.FRAMESET,p.FRAMESET],[z.H1,p.H1],[z.H2,p.H2],[z.H3,p.H3],[z.H4,p.H4],[z.H5,p.H5],[z.H6,p.H6],[z.HEAD,p.HEAD],[z.HEADER,p.HEADER],[z.HGROUP,p.HGROUP],[z.HR,p.HR],[z.HTML,p.HTML],[z.I,p.I],[z.IMG,p.IMG],[z.IMAGE,p.IMAGE],[z.INPUT,p.INPUT],[z.IFRAME,p.IFRAME],[z.KEYGEN,p.KEYGEN],[z.LABEL,p.LABEL],[z.LI,p.LI],[z.LINK,p.LINK],[z.LISTING,p.LISTING],[z.MAIN,p.MAIN],[z.MALIGNMARK,p.MALIGNMARK],[z.MARQUEE,p.MARQUEE],[z.MATH,p.MATH],[z.MENU,p.MENU],[z.META,p.META],[z.MGLYPH,p.MGLYPH],[z.MI,p.MI],[z.MO,p.MO],[z.MN,p.MN],[z.MS,p.MS],[z.MTEXT,p.MTEXT],[z.NAV,p.NAV],[z.NOBR,p.NOBR],[z.NOFRAMES,p.NOFRAMES],[z.NOEMBED,p.NOEMBED],[z.NOSCRIPT,p.NOSCRIPT],[z.OBJECT,p.OBJECT],[z.OL,p.OL],[z.OPTGROUP,p.OPTGROUP],[z.OPTION,p.OPTION],[z.P,p.P],[z.PARAM,p.PARAM],[z.PLAINTEXT,p.PLAINTEXT],[z.PRE,p.PRE],[z.RB,p.RB],[z.RP,p.RP],[z.RT,p.RT],[z.RTC,p.RTC],[z.RUBY,p.RUBY],[z.S,p.S],[z.SCRIPT,p.SCRIPT],[z.SEARCH,p.SEARCH],[z.SECTION,p.SECTION],[z.SELECT,p.SELECT],[z.SOURCE,p.SOURCE],[z.SMALL,p.SMALL],[z.SPAN,p.SPAN],[z.STRIKE,p.STRIKE],[z.STRONG,p.STRONG],[z.STYLE,p.STYLE],[z.SUB,p.SUB],[z.SUMMARY,p.SUMMARY],[z.SUP,p.SUP],[z.TABLE,p.TABLE],[z.TBODY,p.TBODY],[z.TEMPLATE,p.TEMPLATE],[z.TEXTAREA,p.TEXTAREA],[z.TFOOT,p.TFOOT],[z.TD,p.TD],[z.TH,p.TH],[z.THEAD,p.THEAD],[z.TITLE,p.TITLE],[z.TR,p.TR],[z.TRACK,p.TRACK],[z.TT,p.TT],[z.U,p.U],[z.UL,p.UL],[z.SVG,p.SVG],[z.VAR,p.VAR],[z.WBR,p.WBR],[z.XMP,p.XMP]]);function Bi(e){var t;return(t=GN.get(e))!==null&&t!==void 0?t:p.UNKNOWN}const re=p,KN={[Z.HTML]:new Set([re.ADDRESS,re.APPLET,re.AREA,re.ARTICLE,re.ASIDE,re.BASE,re.BASEFONT,re.BGSOUND,re.BLOCKQUOTE,re.BODY,re.BR,re.BUTTON,re.CAPTION,re.CENTER,re.COL,re.COLGROUP,re.DD,re.DETAILS,re.DIR,re.DIV,re.DL,re.DT,re.EMBED,re.FIELDSET,re.FIGCAPTION,re.FIGURE,re.FOOTER,re.FORM,re.FRAME,re.FRAMESET,re.H1,re.H2,re.H3,re.H4,re.H5,re.H6,re.HEAD,re.HEADER,re.HGROUP,re.HR,re.HTML,re.IFRAME,re.IMG,re.INPUT,re.LI,re.LINK,re.LISTING,re.MAIN,re.MARQUEE,re.MENU,re.META,re.NAV,re.NOEMBED,re.NOFRAMES,re.NOSCRIPT,re.OBJECT,re.OL,re.P,re.PARAM,re.PLAINTEXT,re.PRE,re.SCRIPT,re.SECTION,re.SELECT,re.SOURCE,re.STYLE,re.SUMMARY,re.TABLE,re.TBODY,re.TD,re.TEMPLATE,re.TEXTAREA,re.TFOOT,re.TH,re.THEAD,re.TITLE,re.TR,re.TRACK,re.UL,re.WBR,re.XMP]),[Z.MATHML]:new Set([re.MI,re.MO,re.MN,re.MS,re.MTEXT,re.ANNOTATION_XML]),[Z.SVG]:new Set([re.TITLE,re.FOREIGN_OBJECT,re.DESC]),[Z.XLINK]:new Set,[Z.XML]:new Set,[Z.XMLNS]:new Set},jc=new Set([re.H1,re.H2,re.H3,re.H4,re.H5,re.H6]);z.STYLE,z.SCRIPT,z.XMP,z.IFRAME,z.NOEMBED,z.NOFRAMES,z.PLAINTEXT;var N;(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"})(N||(N={}));const at={DATA:N.DATA,RCDATA:N.RCDATA,RAWTEXT:N.RAWTEXT,SCRIPT_DATA:N.SCRIPT_DATA,PLAINTEXT:N.PLAINTEXT,CDATA_SECTION:N.CDATA_SECTION};function XN(e){return e>=_.DIGIT_0&&e<=_.DIGIT_9}function Ma(e){return e>=_.LATIN_CAPITAL_A&&e<=_.LATIN_CAPITAL_Z}function JN(e){return e>=_.LATIN_SMALL_A&&e<=_.LATIN_SMALL_Z}function mr(e){return JN(e)||Ma(e)}function Um(e){return mr(e)||XN(e)}function Nu(e){return e+32}function pg(e){return e===_.SPACE||e===_.LINE_FEED||e===_.TABULATION||e===_.FORM_FEED}function jm(e){return pg(e)||e===_.SOLIDUS||e===_.GREATER_THAN_SIGN}function ZN(e){return e===_.NULL?q.nullCharacterReference:e>1114111?q.characterReferenceOutsideUnicodeRange:cg(e)?q.surrogateCharacterReference:fg(e)?q.noncharacterCharacterReference:dg(e)||e===_.CARRIAGE_RETURN?q.controlCharacterReference:null}class eA{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=N.DATA,this.returnState=N.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new UN(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new qN(jN,(a,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(a)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(q.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:a=>{this._err(q.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+a)},validateNumericCharacterReference:a=>{const s=ZN(a);s&&this._err(s,1)}}:void 0)}_err(t,n=0){var a,s;(s=(a=this.handler).onParseError)===null||s===void 0||s.call(a,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,a){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||a==null||a()}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:Pe.START_TAG,tagName:"",tagID:p.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Pe.END_TAG,tagName:"",tagID:p.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:Pe.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:Pe.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 a=this.currentToken;if(hg(a,this.currentAttr.name)===null){if(a.attrs.push(this.currentAttr),a.location&&this.currentLocation){const s=(t=(n=a.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(q.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=Bi(t.tagName),t.type===Pe.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(q.endTagWithAttributes),t.selfClosing&&this._err(q.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 Pe.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Pe.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Pe.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:Pe.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=pg(t)?Pe.WHITESPACE_CHARACTER:t===_.NULL?Pe.NULL_CHARACTER:Pe.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Pe.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=N.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?$n.Attribute:$n.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===N.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===N.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===N.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case N.DATA:{this._stateData(t);break}case N.RCDATA:{this._stateRcdata(t);break}case N.RAWTEXT:{this._stateRawtext(t);break}case N.SCRIPT_DATA:{this._stateScriptData(t);break}case N.PLAINTEXT:{this._statePlaintext(t);break}case N.TAG_OPEN:{this._stateTagOpen(t);break}case N.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case N.TAG_NAME:{this._stateTagName(t);break}case N.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case N.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case N.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case N.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case N.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case N.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case N.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case N.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case N.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case N.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case N.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case N.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case N.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case N.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case N.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case N.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case N.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case N.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case N.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case N.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case N.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case N.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case N.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case N.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case N.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case N.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case N.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case N.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case N.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case N.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case N.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case N.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case N.BOGUS_COMMENT:{this._stateBogusComment(t);break}case N.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case N.COMMENT_START:{this._stateCommentStart(t);break}case N.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case N.COMMENT:{this._stateComment(t);break}case N.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case N.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case N.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case N.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case N.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case N.COMMENT_END:{this._stateCommentEnd(t);break}case N.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case N.DOCTYPE:{this._stateDoctype(t);break}case N.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case N.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case N.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case N.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case N.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case N.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case N.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case N.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case N.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case N.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case N.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case N.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case N.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case N.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case N.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case N.CDATA_SECTION:{this._stateCdataSection(t);break}case N.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case N.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case N.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case N.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case _.LESS_THAN_SIGN:{this.state=N.TAG_OPEN;break}case _.AMPERSAND:{this._startCharacterReference();break}case _.NULL:{this._err(q.unexpectedNullCharacter),this._emitCodePoint(t);break}case _.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case _.AMPERSAND:{this._startCharacterReference();break}case _.LESS_THAN_SIGN:{this.state=N.RCDATA_LESS_THAN_SIGN;break}case _.NULL:{this._err(q.unexpectedNullCharacter),this._emitChars(Je);break}case _.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case _.LESS_THAN_SIGN:{this.state=N.RAWTEXT_LESS_THAN_SIGN;break}case _.NULL:{this._err(q.unexpectedNullCharacter),this._emitChars(Je);break}case _.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case _.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_LESS_THAN_SIGN;break}case _.NULL:{this._err(q.unexpectedNullCharacter),this._emitChars(Je);break}case _.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case _.NULL:{this._err(q.unexpectedNullCharacter),this._emitChars(Je);break}case _.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(mr(t))this._createStartTagToken(),this.state=N.TAG_NAME,this._stateTagName(t);else switch(t){case _.EXCLAMATION_MARK:{this.state=N.MARKUP_DECLARATION_OPEN;break}case _.SOLIDUS:{this.state=N.END_TAG_OPEN;break}case _.QUESTION_MARK:{this._err(q.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=N.BOGUS_COMMENT,this._stateBogusComment(t);break}case _.EOF:{this._err(q.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(q.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=N.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(mr(t))this._createEndTagToken(),this.state=N.TAG_NAME,this._stateTagName(t);else switch(t){case _.GREATER_THAN_SIGN:{this._err(q.missingEndTagName),this.state=N.DATA;break}case _.EOF:{this._err(q.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(q.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=N.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:{this.state=N.BEFORE_ATTRIBUTE_NAME;break}case _.SOLIDUS:{this.state=N.SELF_CLOSING_START_TAG;break}case _.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentTagToken();break}case _.NULL:{this._err(q.unexpectedNullCharacter),n.tagName+=Je;break}case _.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Ma(t)?Nu(t):t)}}_stateRcdataLessThanSign(t){t===_.SOLIDUS?this.state=N.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=N.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){mr(t)?(this.state=N.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=N.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 _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=N.BEFORE_ATTRIBUTE_NAME,!1;case _.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=N.SELF_CLOSING_START_TAG,!1;case _.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=N.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=N.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===_.SOLIDUS?this.state=N.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=N.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){mr(t)?(this.state=N.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=N.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=N.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case _.SOLIDUS:{this.state=N.SCRIPT_DATA_END_TAG_OPEN;break}case _.EXCLAMATION_MARK:{this.state=N.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=N.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){mr(t)?(this.state=N.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=N.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=N.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===_.HYPHEN_MINUS?(this.state=N.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=N.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===_.HYPHEN_MINUS?(this.state=N.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=N.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case _.HYPHEN_MINUS:{this.state=N.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case _.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case _.NULL:{this._err(q.unexpectedNullCharacter),this._emitChars(Je);break}case _.EOF:{this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case _.HYPHEN_MINUS:{this.state=N.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case _.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case _.NULL:{this._err(q.unexpectedNullCharacter),this.state=N.SCRIPT_DATA_ESCAPED,this._emitChars(Je);break}case _.EOF:{this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=N.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case _.HYPHEN_MINUS:{this._emitChars("-");break}case _.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case _.GREATER_THAN_SIGN:{this.state=N.SCRIPT_DATA,this._emitChars(">");break}case _.NULL:{this._err(q.unexpectedNullCharacter),this.state=N.SCRIPT_DATA_ESCAPED,this._emitChars(Je);break}case _.EOF:{this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=N.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===_.SOLIDUS?this.state=N.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:mr(t)?(this._emitChars("<"),this.state=N.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=N.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){mr(t)?(this.state=N.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=N.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=N.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Ut.SCRIPT,!1)&&jm(this.preprocessor.peek(Ut.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Ut.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=N.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case _.HYPHEN_MINUS:{this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case _.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case _.NULL:{this._err(q.unexpectedNullCharacter),this._emitChars(Je);break}case _.EOF:{this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case _.HYPHEN_MINUS:{this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case _.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case _.NULL:{this._err(q.unexpectedNullCharacter),this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Je);break}case _.EOF:{this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case _.HYPHEN_MINUS:{this._emitChars("-");break}case _.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case _.GREATER_THAN_SIGN:{this.state=N.SCRIPT_DATA,this._emitChars(">");break}case _.NULL:{this._err(q.unexpectedNullCharacter),this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Je);break}case _.EOF:{this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===_.SOLIDUS?(this.state=N.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Ut.SCRIPT,!1)&&jm(this.preprocessor.peek(Ut.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Ut.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=N.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:break;case _.SOLIDUS:case _.GREATER_THAN_SIGN:case _.EOF:{this.state=N.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case _.EQUALS_SIGN:{this._err(q.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=N.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=N.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:case _.SOLIDUS:case _.GREATER_THAN_SIGN:case _.EOF:{this._leaveAttrName(),this.state=N.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case _.EQUALS_SIGN:{this._leaveAttrName(),this.state=N.BEFORE_ATTRIBUTE_VALUE;break}case _.QUOTATION_MARK:case _.APOSTROPHE:case _.LESS_THAN_SIGN:{this._err(q.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case _.NULL:{this._err(q.unexpectedNullCharacter),this.currentAttr.name+=Je;break}default:this.currentAttr.name+=String.fromCodePoint(Ma(t)?Nu(t):t)}}_stateAfterAttributeName(t){switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:break;case _.SOLIDUS:{this.state=N.SELF_CLOSING_START_TAG;break}case _.EQUALS_SIGN:{this.state=N.BEFORE_ATTRIBUTE_VALUE;break}case _.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentTagToken();break}case _.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=N.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:break;case _.QUOTATION_MARK:{this.state=N.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case _.APOSTROPHE:{this.state=N.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case _.GREATER_THAN_SIGN:{this._err(q.missingAttributeValue),this.state=N.DATA,this.emitCurrentTagToken();break}default:this.state=N.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case _.QUOTATION_MARK:{this.state=N.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case _.AMPERSAND:{this._startCharacterReference();break}case _.NULL:{this._err(q.unexpectedNullCharacter),this.currentAttr.value+=Je;break}case _.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case _.APOSTROPHE:{this.state=N.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case _.AMPERSAND:{this._startCharacterReference();break}case _.NULL:{this._err(q.unexpectedNullCharacter),this.currentAttr.value+=Je;break}case _.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:{this._leaveAttrValue(),this.state=N.BEFORE_ATTRIBUTE_NAME;break}case _.AMPERSAND:{this._startCharacterReference();break}case _.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=N.DATA,this.emitCurrentTagToken();break}case _.NULL:{this._err(q.unexpectedNullCharacter),this.currentAttr.value+=Je;break}case _.QUOTATION_MARK:case _.APOSTROPHE:case _.LESS_THAN_SIGN:case _.EQUALS_SIGN:case _.GRAVE_ACCENT:{this._err(q.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case _.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:{this._leaveAttrValue(),this.state=N.BEFORE_ATTRIBUTE_NAME;break}case _.SOLIDUS:{this._leaveAttrValue(),this.state=N.SELF_CLOSING_START_TAG;break}case _.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=N.DATA,this.emitCurrentTagToken();break}case _.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:this._err(q.missingWhitespaceBetweenAttributes),this.state=N.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case _.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=N.DATA,this.emitCurrentTagToken();break}case _.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:this._err(q.unexpectedSolidusInTag),this.state=N.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case _.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentComment(n);break}case _.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case _.NULL:{this._err(q.unexpectedNullCharacter),n.data+=Je;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Ut.DASH_DASH,!0)?(this._createCommentToken(Ut.DASH_DASH.length+1),this.state=N.COMMENT_START):this._consumeSequenceIfMatch(Ut.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Ut.DOCTYPE.length+1),this.state=N.DOCTYPE):this._consumeSequenceIfMatch(Ut.CDATA_START,!0)?this.inForeignNode?this.state=N.CDATA_SECTION:(this._err(q.cdataInHtmlContent),this._createCommentToken(Ut.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=N.BOGUS_COMMENT):this._ensureHibernation()||(this._err(q.incorrectlyOpenedComment),this._createCommentToken(2),this.state=N.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case _.HYPHEN_MINUS:{this.state=N.COMMENT_START_DASH;break}case _.GREATER_THAN_SIGN:{this._err(q.abruptClosingOfEmptyComment),this.state=N.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=N.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case _.HYPHEN_MINUS:{this.state=N.COMMENT_END;break}case _.GREATER_THAN_SIGN:{this._err(q.abruptClosingOfEmptyComment),this.state=N.DATA,this.emitCurrentComment(n);break}case _.EOF:{this._err(q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=N.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case _.HYPHEN_MINUS:{this.state=N.COMMENT_END_DASH;break}case _.LESS_THAN_SIGN:{n.data+="<",this.state=N.COMMENT_LESS_THAN_SIGN;break}case _.NULL:{this._err(q.unexpectedNullCharacter),n.data+=Je;break}case _.EOF:{this._err(q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case _.EXCLAMATION_MARK:{n.data+="!",this.state=N.COMMENT_LESS_THAN_SIGN_BANG;break}case _.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=N.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===_.HYPHEN_MINUS?this.state=N.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=N.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===_.HYPHEN_MINUS?this.state=N.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=N.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==_.GREATER_THAN_SIGN&&t!==_.EOF&&this._err(q.nestedComment),this.state=N.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case _.HYPHEN_MINUS:{this.state=N.COMMENT_END;break}case _.EOF:{this._err(q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=N.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case _.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentComment(n);break}case _.EXCLAMATION_MARK:{this.state=N.COMMENT_END_BANG;break}case _.HYPHEN_MINUS:{n.data+="-";break}case _.EOF:{this._err(q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=N.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case _.HYPHEN_MINUS:{n.data+="--!",this.state=N.COMMENT_END_DASH;break}case _.GREATER_THAN_SIGN:{this._err(q.incorrectlyClosedComment),this.state=N.DATA,this.emitCurrentComment(n);break}case _.EOF:{this._err(q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=N.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:{this.state=N.BEFORE_DOCTYPE_NAME;break}case _.GREATER_THAN_SIGN:{this.state=N.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case _.EOF:{this._err(q.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingWhitespaceBeforeDoctypeName),this.state=N.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Ma(t))this._createDoctypeToken(String.fromCharCode(Nu(t))),this.state=N.DOCTYPE_NAME;else switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:break;case _.NULL:{this._err(q.unexpectedNullCharacter),this._createDoctypeToken(Je),this.state=N.DOCTYPE_NAME;break}case _.GREATER_THAN_SIGN:{this._err(q.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=N.DATA;break}case _.EOF:{this._err(q.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=N.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:{this.state=N.AFTER_DOCTYPE_NAME;break}case _.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentDoctype(n);break}case _.NULL:{this._err(q.unexpectedNullCharacter),n.name+=Je;break}case _.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Ma(t)?Nu(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:break;case _.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentDoctype(n);break}case _.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Ut.PUBLIC,!1)?this.state=N.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Ut.SYSTEM,!1)?this.state=N.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(q.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:{this.state=N.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case _.QUOTATION_MARK:{this._err(q.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=N.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case _.APOSTROPHE:{this._err(q.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=N.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case _.GREATER_THAN_SIGN:{this._err(q.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=N.DATA,this.emitCurrentDoctype(n);break}case _.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:break;case _.QUOTATION_MARK:{n.publicId="",this.state=N.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case _.APOSTROPHE:{n.publicId="",this.state=N.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case _.GREATER_THAN_SIGN:{this._err(q.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=N.DATA,this.emitCurrentDoctype(n);break}case _.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case _.QUOTATION_MARK:{this.state=N.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case _.NULL:{this._err(q.unexpectedNullCharacter),n.publicId+=Je;break}case _.GREATER_THAN_SIGN:{this._err(q.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=N.DATA;break}case _.EOF:{this._err(q.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 _.APOSTROPHE:{this.state=N.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case _.NULL:{this._err(q.unexpectedNullCharacter),n.publicId+=Je;break}case _.GREATER_THAN_SIGN:{this._err(q.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=N.DATA;break}case _.EOF:{this._err(q.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 _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:{this.state=N.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case _.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentDoctype(n);break}case _.QUOTATION_MARK:{this._err(q.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case _.APOSTROPHE:{this._err(q.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case _.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:break;case _.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=N.DATA;break}case _.QUOTATION_MARK:{n.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case _.APOSTROPHE:{n.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case _.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:{this.state=N.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case _.QUOTATION_MARK:{this._err(q.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case _.APOSTROPHE:{this._err(q.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case _.GREATER_THAN_SIGN:{this._err(q.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=N.DATA,this.emitCurrentDoctype(n);break}case _.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:break;case _.QUOTATION_MARK:{n.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case _.APOSTROPHE:{n.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case _.GREATER_THAN_SIGN:{this._err(q.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=N.DATA,this.emitCurrentDoctype(n);break}case _.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case _.QUOTATION_MARK:{this.state=N.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case _.NULL:{this._err(q.unexpectedNullCharacter),n.systemId+=Je;break}case _.GREATER_THAN_SIGN:{this._err(q.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=N.DATA;break}case _.EOF:{this._err(q.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 _.APOSTROPHE:{this.state=N.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case _.NULL:{this._err(q.unexpectedNullCharacter),n.systemId+=Je;break}case _.GREATER_THAN_SIGN:{this._err(q.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=N.DATA;break}case _.EOF:{this._err(q.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 _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:break;case _.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=N.DATA;break}case _.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case _.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=N.DATA;break}case _.NULL:{this._err(q.unexpectedNullCharacter);break}case _.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case _.RIGHT_SQUARE_BRACKET:{this.state=N.CDATA_SECTION_BRACKET;break}case _.EOF:{this._err(q.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===_.RIGHT_SQUARE_BRACKET?this.state=N.CDATA_SECTION_END:(this._emitChars("]"),this.state=N.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case _.GREATER_THAN_SIGN:{this.state=N.DATA;break}case _.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=N.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(_.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Um(this.preprocessor.peek(1))?N.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Um(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===_.SEMICOLON&&this._err(q.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const mg=new Set([p.DD,p.DT,p.LI,p.OPTGROUP,p.OPTION,p.P,p.RB,p.RP,p.RT,p.RTC]),Hm=new Set([...mg,p.CAPTION,p.COLGROUP,p.TBODY,p.TD,p.TFOOT,p.TH,p.THEAD,p.TR]),Fu=new Set([p.APPLET,p.CAPTION,p.HTML,p.MARQUEE,p.OBJECT,p.TABLE,p.TD,p.TEMPLATE,p.TH]),tA=new Set([...Fu,p.OL,p.UL]),nA=new Set([...Fu,p.BUTTON]),zm=new Set([p.ANNOTATION_XML,p.MI,p.MN,p.MO,p.MS,p.MTEXT]),$m=new Set([p.DESC,p.FOREIGN_OBJECT,p.TITLE]),rA=new Set([p.TR,p.TEMPLATE,p.HTML]),iA=new Set([p.TBODY,p.TFOOT,p.THEAD,p.TEMPLATE,p.HTML]),aA=new Set([p.TABLE,p.TEMPLATE,p.HTML]),sA=new Set([p.TD,p.TH]);class uA{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,a){this.treeAdapter=n,this.handler=a,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=p.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===p.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Z.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 a=this._indexOf(t);this.items[a]=n,a===this.stackTop&&(this.current=n)}insertAfter(t,n,a){const s=this._indexOf(t)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,a),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===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])!==Z.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 a=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(a,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(jc,Z.HTML)}popUntilTableCellPopped(){this.popUntilPopped(sA,Z.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let a=this.stackTop;a>=0;a--)if(t.has(this.tagIDs[a])&&this.treeAdapter.getNamespaceURI(this.items[a])===n)return a;return-1}clearBackTo(t,n){const a=this._indexOfTagNames(t,n);this.shortenToLength(a+1)}clearBackToTableContext(){this.clearBackTo(aA,Z.HTML)}clearBackToTableBodyContext(){this.clearBackTo(iA,Z.HTML)}clearBackToTableRowContext(){this.clearBackTo(rA,Z.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]===p.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]===p.HTML}hasInDynamicScope(t,n){for(let a=this.stackTop;a>=0;a--){const s=this.tagIDs[a];switch(this.treeAdapter.getNamespaceURI(this.items[a])){case Z.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case Z.SVG:{if($m.has(s))return!1;break}case Z.MATHML:{if(zm.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Fu)}hasInListItemScope(t){return this.hasInDynamicScope(t,tA)}hasInButtonScope(t){return this.hasInDynamicScope(t,nA)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Z.HTML:{if(jc.has(n))return!0;if(Fu.has(n))return!1;break}case Z.SVG:{if($m.has(n))return!1;break}case Z.MATHML:{if(zm.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Z.HTML)switch(this.tagIDs[n]){case t:return!0;case p.TABLE:case p.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Z.HTML)switch(this.tagIDs[t]){case p.TBODY:case p.THEAD:case p.TFOOT:return!0;case p.TABLE:case p.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Z.HTML)switch(this.tagIDs[n]){case t:return!0;case p.OPTION:case p.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&mg.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Hm.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Hm.has(this.currentTagId);)this.pop()}}const Tc=3;var wn;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(wn||(wn={}));const Wm={type:wn.Marker};class oA{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const a=[],s=n.length,o=this.treeAdapter.getTagName(t),l=this.treeAdapter.getNamespaceURI(t);for(let d=0;d<this.entries.length;d++){const f=this.entries[d];if(f.type===wn.Marker)break;const{element:h}=f;if(this.treeAdapter.getTagName(h)===o&&this.treeAdapter.getNamespaceURI(h)===l){const E=this.treeAdapter.getAttrList(h);E.length===s&&a.push({idx:d,attrs:E})}}return a}_ensureNoahArkCondition(t){if(this.entries.length<Tc)return;const n=this.treeAdapter.getAttrList(t),a=this._getNoahArkConditionCandidates(t,n);if(a.length<Tc)return;const s=new Map(n.map(l=>[l.name,l.value]));let o=0;for(let l=0;l<a.length;l++){const d=a[l];d.attrs.every(f=>s.get(f.name)===f.value)&&(o+=1,o>=Tc&&this.entries.splice(d.idx,1))}}insertMarker(){this.entries.unshift(Wm)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:wn.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const a=this.entries.indexOf(this.bookmark);this.entries.splice(a,0,{type:wn.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(Wm);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(a=>a.type===wn.Marker||this.treeAdapter.getTagName(a.element)===t);return n&&n.type===wn.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===wn.Element&&n.element===t)}}const gr={createDocument(){return{nodeName:"#document",mode:an.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 a=e.childNodes.indexOf(n);e.childNodes.splice(a,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,a){const s=e.childNodes.find(o=>o.nodeName==="#documentType");if(s)s.name=t,s.publicId=n,s.systemId=a;else{const o={nodeName:"#documentType",name:t,publicId:n,systemId:a,parentNode:null};gr.appendChild(e,o)}},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(gr.isTextNode(n)){n.value+=t;return}}gr.appendChild(e,gr.createTextNode(t))},insertTextBefore(e,t,n){const a=e.childNodes[e.childNodes.indexOf(n)-1];a&&gr.isTextNode(a)?a.value+=t:gr.insertBefore(e,gr.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(a=>a.name));for(let a=0;a<t.length;a++)n.has(t[a].name)||e.attrs.push(t[a])},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}}},gg="html",lA="about:legacy-compat",cA="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Eg=["+//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//"],dA=[...Eg,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],fA=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Tg=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],hA=[...Tg,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Ym(e,t){return t.some(n=>e.startsWith(n))}function pA(e){return e.name===gg&&e.publicId===null&&(e.systemId===null||e.systemId===lA)}function mA(e){if(e.name!==gg)return an.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===cA)return an.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),fA.has(n))return an.QUIRKS;let a=t===null?dA:Eg;if(Ym(n,a))return an.QUIRKS;if(a=t===null?Tg:hA,Ym(n,a))return an.LIMITED_QUIRKS}return an.NO_QUIRKS}const Vm={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},gA="definitionurl",EA="definitionURL",TA=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])),yA=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Z.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Z.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Z.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Z.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Z.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Z.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Z.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Z.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Z.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Z.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Z.XMLNS}]]),xA=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])),bA=new Set([p.B,p.BIG,p.BLOCKQUOTE,p.BODY,p.BR,p.CENTER,p.CODE,p.DD,p.DIV,p.DL,p.DT,p.EM,p.EMBED,p.H1,p.H2,p.H3,p.H4,p.H5,p.H6,p.HEAD,p.HR,p.I,p.IMG,p.LI,p.LISTING,p.MENU,p.META,p.NOBR,p.OL,p.P,p.PRE,p.RUBY,p.S,p.SMALL,p.SPAN,p.STRONG,p.STRIKE,p.SUB,p.SUP,p.TABLE,p.TT,p.U,p.UL,p.VAR]);function kA(e){const t=e.tagID;return t===p.FONT&&e.attrs.some(({name:a})=>a===Yr.COLOR||a===Yr.SIZE||a===Yr.FACE)||bA.has(t)}function yg(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===gA){e.attrs[t].name=EA;break}}function xg(e){for(let t=0;t<e.attrs.length;t++){const n=TA.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Sd(e){for(let t=0;t<e.attrs.length;t++){const n=yA.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 CA(e){const t=xA.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Bi(e.tagName))}function _A(e,t){return t===Z.MATHML&&(e===p.MI||e===p.MO||e===p.MN||e===p.MS||e===p.MTEXT)}function SA(e,t,n){if(t===Z.MATHML&&e===p.ANNOTATION_XML){for(let a=0;a<n.length;a++)if(n[a].name===Yr.ENCODING){const s=n[a].value.toLowerCase();return s===Vm.TEXT_HTML||s===Vm.APPLICATION_XML}}return t===Z.SVG&&(e===p.FOREIGN_OBJECT||e===p.DESC||e===p.TITLE)}function NA(e,t,n,a){return(!a||a===Z.HTML)&&SA(e,t,n)||(!a||a===Z.MATHML)&&_A(e,t)}const AA="hidden",vA=8,wA=3;var L;(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"})(L||(L={}));const IA={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},bg=new Set([p.TABLE,p.TBODY,p.TFOOT,p.THEAD,p.TR]),qm={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:gr,onParseError:null};class Qm{constructor(t,n,a=null,s=null){this.fragmentContext=a,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=L.INITIAL,this.originalInsertionMode=L.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={...qm,...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 eA(this.options,this),this.activeFormattingElements=new oA(this.treeAdapter),this.fragmentContextID=a?Bi(this.treeAdapter.getTagName(a)):p.UNKNOWN,this._setContextModes(a??this.document,this.fragmentContextID),this.openElements=new uA(this.document,this.treeAdapter,this)}static parse(t,n){const a=new this(n);return a.tokenizer.write(t,!0),a.document}static getFragmentParser(t,n){const a={...qm,...n};t??(t=a.treeAdapter.createElement(z.TEMPLATE,Z.HTML,[]));const s=a.treeAdapter.createElement("documentmock",Z.HTML,[]),o=new this(a,s,t);return o.fragmentContextID===p.TEMPLATE&&o.tmplInsertionModeStack.unshift(L.IN_TEMPLATE),o._initTokenizerForFragmentParsing(),o._insertFakeRootElement(),o._resetInsertionMode(),o._findFormInFragmentContext(),o}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,a){var s;if(!this.onParseError)return;const o=(s=t.location)!==null&&s!==void 0?s:IA,l={code:n,startLine:o.startLine,startCol:o.startCol,startOffset:o.startOffset,endLine:a?o.startLine:o.endLine,endCol:a?o.startCol:o.endCol,endOffset:a?o.startOffset:o.endOffset};this.onParseError(l)}onItemPush(t,n,a){var s,o;(o=(s=this.treeAdapter).onItemPush)===null||o===void 0||o.call(s,t),a&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var a,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(a=this.treeAdapter).onItemPop)===null||s===void 0||s.call(a,t,this.openElements.current),n){let o,l;this.openElements.stackTop===0&&this.fragmentContext?(o=this.fragmentContext,l=this.fragmentContextID):{current:o,currentTagId:l}=this.openElements,this._setContextModes(o,l)}}_setContextModes(t,n){const a=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Z.HTML;this.currentNotInHTML=!a,this.tokenizer.inForeignNode=!a&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Z.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=L.TEXT}switchToPlaintextParsing(){this.insertionMode=L.TEXT,this.originalInsertionMode=L.IN_BODY,this.tokenizer.state=at.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)===z.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Z.HTML))switch(this.fragmentContextID){case p.TITLE:case p.TEXTAREA:{this.tokenizer.state=at.RCDATA;break}case p.STYLE:case p.XMP:case p.IFRAME:case p.NOEMBED:case p.NOFRAMES:case p.NOSCRIPT:{this.tokenizer.state=at.RAWTEXT;break}case p.SCRIPT:{this.tokenizer.state=at.SCRIPT_DATA;break}case p.PLAINTEXT:{this.tokenizer.state=at.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",a=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,a,s),t.location){const l=this.treeAdapter.getChildNodes(this.document).find(d=>this.treeAdapter.isDocumentTypeNode(d));l&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const a=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,a)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const a=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(a??this.document,t)}}_appendElement(t,n){const a=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(a,t.location)}_insertElement(t,n){const a=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(a,t.location),this.openElements.push(a,t.tagID)}_insertFakeElement(t,n){const a=this.treeAdapter.createElement(t,Z.HTML,[]);this._attachElementToTree(a,null),this.openElements.push(a,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Z.HTML,t.attrs),a=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,a),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(z.HTML,Z.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,p.HTML)}_appendCommentNode(t,n){const a=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,a),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}_insertCharacters(t){let n,a;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:a}=this._findFosterParentingLocation(),a?this.treeAdapter.insertTextBefore(n,t.chars,a):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const s=this.treeAdapter.getChildNodes(n),o=a?s.lastIndexOf(a):s.length,l=s[o-1];if(this.treeAdapter.getNodeSourceCodeLocation(l)){const{endLine:f,endCol:h,endOffset:E}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(l,{endLine:f,endCol:h,endOffset:E})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}_adoptNodes(t,n){for(let a=this.treeAdapter.getFirstChild(t);a;a=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(a),this.treeAdapter.appendChild(n,a)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const a=n.location,s=this.treeAdapter.getTagName(t),o=n.type===Pe.END_TAG&&s===n.tagName?{endTag:{...a},endLine:a.endLine,endCol:a.endCol,endOffset:a.endOffset}:{endLine:a.startLine,endCol:a.startCol,endOffset:a.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,o)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,a;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,a=this.fragmentContextID):{current:n,currentTagId:a}=this.openElements,t.tagID===p.SVG&&this.treeAdapter.getTagName(n)===z.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Z.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===p.MGLYPH||t.tagID===p.MALIGNMARK)&&a!==void 0&&!this._isIntegrationPoint(a,n,Z.HTML)}_processToken(t){switch(t.type){case Pe.CHARACTER:{this.onCharacter(t);break}case Pe.NULL_CHARACTER:{this.onNullCharacter(t);break}case Pe.COMMENT:{this.onComment(t);break}case Pe.DOCTYPE:{this.onDoctype(t);break}case Pe.START_TAG:{this._processStartTag(t);break}case Pe.END_TAG:{this.onEndTag(t);break}case Pe.EOF:{this.onEof(t);break}case Pe.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,a){const s=this.treeAdapter.getNamespaceURI(n),o=this.treeAdapter.getAttrList(n);return NA(t,s,o,a)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===wn.Marker||this.openElements.contains(s.element)),a=n===-1?t-1:n-1;for(let s=a;s>=0;s--){const o=this.activeFormattingElements.entries[s];this._insertElement(o.token,this.treeAdapter.getNamespaceURI(o.element)),o.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=L.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(p.P),this.openElements.popUntilTagNamePopped(p.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case p.TR:{this.insertionMode=L.IN_ROW;return}case p.TBODY:case p.THEAD:case p.TFOOT:{this.insertionMode=L.IN_TABLE_BODY;return}case p.CAPTION:{this.insertionMode=L.IN_CAPTION;return}case p.COLGROUP:{this.insertionMode=L.IN_COLUMN_GROUP;return}case p.TABLE:{this.insertionMode=L.IN_TABLE;return}case p.BODY:{this.insertionMode=L.IN_BODY;return}case p.FRAMESET:{this.insertionMode=L.IN_FRAMESET;return}case p.SELECT:{this._resetInsertionModeForSelect(t);return}case p.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case p.HTML:{this.insertionMode=this.headElement?L.AFTER_HEAD:L.BEFORE_HEAD;return}case p.TD:case p.TH:{if(t>0){this.insertionMode=L.IN_CELL;return}break}case p.HEAD:{if(t>0){this.insertionMode=L.IN_HEAD;return}break}}this.insertionMode=L.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const a=this.openElements.tagIDs[n];if(a===p.TEMPLATE)break;if(a===p.TABLE){this.insertionMode=L.IN_SELECT_IN_TABLE;return}}this.insertionMode=L.IN_SELECT}_isElementCausesFosterParenting(t){return bg.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 p.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Z.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case p.TABLE:{const a=this.treeAdapter.getParentNode(n);return a?{parent:a,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 a=this.treeAdapter.getNamespaceURI(t);return KN[a].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){sw(this,t);return}switch(this.insertionMode){case L.INITIAL:{Oa(this,t);break}case L.BEFORE_HTML:{ja(this,t);break}case L.BEFORE_HEAD:{Ha(this,t);break}case L.IN_HEAD:{za(this,t);break}case L.IN_HEAD_NO_SCRIPT:{$a(this,t);break}case L.AFTER_HEAD:{Wa(this,t);break}case L.IN_BODY:case L.IN_CAPTION:case L.IN_CELL:case L.IN_TEMPLATE:{Cg(this,t);break}case L.TEXT:case L.IN_SELECT:case L.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case L.IN_TABLE:case L.IN_TABLE_BODY:case L.IN_ROW:{yc(this,t);break}case L.IN_TABLE_TEXT:{wg(this,t);break}case L.IN_COLUMN_GROUP:{Bu(this,t);break}case L.AFTER_BODY:{Uu(this,t);break}case L.AFTER_AFTER_BODY:{Ru(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){aw(this,t);return}switch(this.insertionMode){case L.INITIAL:{Oa(this,t);break}case L.BEFORE_HTML:{ja(this,t);break}case L.BEFORE_HEAD:{Ha(this,t);break}case L.IN_HEAD:{za(this,t);break}case L.IN_HEAD_NO_SCRIPT:{$a(this,t);break}case L.AFTER_HEAD:{Wa(this,t);break}case L.TEXT:{this._insertCharacters(t);break}case L.IN_TABLE:case L.IN_TABLE_BODY:case L.IN_ROW:{yc(this,t);break}case L.IN_COLUMN_GROUP:{Bu(this,t);break}case L.AFTER_BODY:{Uu(this,t);break}case L.AFTER_AFTER_BODY:{Ru(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Hc(this,t);return}switch(this.insertionMode){case L.INITIAL:case L.BEFORE_HTML:case L.BEFORE_HEAD:case L.IN_HEAD:case L.IN_HEAD_NO_SCRIPT:case L.AFTER_HEAD:case L.IN_BODY:case L.IN_TABLE:case L.IN_CAPTION:case L.IN_COLUMN_GROUP:case L.IN_TABLE_BODY:case L.IN_ROW:case L.IN_CELL:case L.IN_SELECT:case L.IN_SELECT_IN_TABLE:case L.IN_TEMPLATE:case L.IN_FRAMESET:case L.AFTER_FRAMESET:{Hc(this,t);break}case L.IN_TABLE_TEXT:{Da(this,t);break}case L.AFTER_BODY:{FA(this,t);break}case L.AFTER_AFTER_BODY:case L.AFTER_AFTER_FRAMESET:{BA(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case L.INITIAL:{UA(this,t);break}case L.BEFORE_HEAD:case L.IN_HEAD:case L.IN_HEAD_NO_SCRIPT:case L.AFTER_HEAD:{this._err(t,q.misplacedDoctype);break}case L.IN_TABLE_TEXT:{Da(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,q.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?uw(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case L.INITIAL:{Oa(this,t);break}case L.BEFORE_HTML:{jA(this,t);break}case L.BEFORE_HEAD:{zA(this,t);break}case L.IN_HEAD:{bn(this,t);break}case L.IN_HEAD_NO_SCRIPT:{YA(this,t);break}case L.AFTER_HEAD:{qA(this,t);break}case L.IN_BODY:{wt(this,t);break}case L.IN_TABLE:{Ri(this,t);break}case L.IN_TABLE_TEXT:{Da(this,t);break}case L.IN_CAPTION:{$v(this,t);break}case L.IN_COLUMN_GROUP:{vd(this,t);break}case L.IN_TABLE_BODY:{no(this,t);break}case L.IN_ROW:{ro(this,t);break}case L.IN_CELL:{Vv(this,t);break}case L.IN_SELECT:{Rg(this,t);break}case L.IN_SELECT_IN_TABLE:{Qv(this,t);break}case L.IN_TEMPLATE:{Kv(this,t);break}case L.AFTER_BODY:{Jv(this,t);break}case L.IN_FRAMESET:{Zv(this,t);break}case L.AFTER_FRAMESET:{tw(this,t);break}case L.AFTER_AFTER_BODY:{rw(this,t);break}case L.AFTER_AFTER_FRAMESET:{iw(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?ow(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case L.INITIAL:{Oa(this,t);break}case L.BEFORE_HTML:{HA(this,t);break}case L.BEFORE_HEAD:{$A(this,t);break}case L.IN_HEAD:{WA(this,t);break}case L.IN_HEAD_NO_SCRIPT:{VA(this,t);break}case L.AFTER_HEAD:{QA(this,t);break}case L.IN_BODY:{to(this,t);break}case L.TEXT:{Ov(this,t);break}case L.IN_TABLE:{Ka(this,t);break}case L.IN_TABLE_TEXT:{Da(this,t);break}case L.IN_CAPTION:{Wv(this,t);break}case L.IN_COLUMN_GROUP:{Yv(this,t);break}case L.IN_TABLE_BODY:{zc(this,t);break}case L.IN_ROW:{Lg(this,t);break}case L.IN_CELL:{qv(this,t);break}case L.IN_SELECT:{Og(this,t);break}case L.IN_SELECT_IN_TABLE:{Gv(this,t);break}case L.IN_TEMPLATE:{Xv(this,t);break}case L.AFTER_BODY:{Pg(this,t);break}case L.IN_FRAMESET:{ew(this,t);break}case L.AFTER_FRAMESET:{nw(this,t);break}case L.AFTER_AFTER_BODY:{Ru(this,t);break}}}onEof(t){switch(this.insertionMode){case L.INITIAL:{Oa(this,t);break}case L.BEFORE_HTML:{ja(this,t);break}case L.BEFORE_HEAD:{Ha(this,t);break}case L.IN_HEAD:{za(this,t);break}case L.IN_HEAD_NO_SCRIPT:{$a(this,t);break}case L.AFTER_HEAD:{Wa(this,t);break}case L.IN_BODY:case L.IN_TABLE:case L.IN_CAPTION:case L.IN_COLUMN_GROUP:case L.IN_TABLE_BODY:case L.IN_ROW:case L.IN_CELL:case L.IN_SELECT:case L.IN_SELECT_IN_TABLE:{Ag(this,t);break}case L.TEXT:{Dv(this,t);break}case L.IN_TABLE_TEXT:{Da(this,t);break}case L.IN_TEMPLATE:{Dg(this,t);break}case L.AFTER_BODY:case L.IN_FRAMESET:case L.AFTER_FRAMESET:case L.AFTER_AFTER_BODY:case L.AFTER_AFTER_FRAMESET:{Ad(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===_.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 L.IN_HEAD:case L.IN_HEAD_NO_SCRIPT:case L.AFTER_HEAD:case L.TEXT:case L.IN_COLUMN_GROUP:case L.IN_SELECT:case L.IN_SELECT_IN_TABLE:case L.IN_FRAMESET:case L.AFTER_FRAMESET:{this._insertCharacters(t);break}case L.IN_BODY:case L.IN_CAPTION:case L.IN_CELL:case L.IN_TEMPLATE:case L.AFTER_BODY:case L.AFTER_AFTER_BODY:case L.AFTER_AFTER_FRAMESET:{kg(this,t);break}case L.IN_TABLE:case L.IN_TABLE_BODY:case L.IN_ROW:{yc(this,t);break}case L.IN_TABLE_TEXT:{vg(this,t);break}}}}function LA(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):Ng(e,t),n}function RA(e,t){let n=null,a=e.openElements.stackTop;for(;a>=0;a--){const s=e.openElements.items[a];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[a])&&(n=s)}return n||(e.openElements.shortenToLength(Math.max(a,0)),e.activeFormattingElements.removeEntry(t)),n}function OA(e,t,n){let a=t,s=e.openElements.getCommonAncestor(t);for(let o=0,l=s;l!==n;o++,l=s){s=e.openElements.getCommonAncestor(l);const d=e.activeFormattingElements.getElementEntry(l),f=d&&o>=wA;!d||f?(f&&e.activeFormattingElements.removeEntry(d),e.openElements.remove(l)):(l=DA(e,d),a===t&&(e.activeFormattingElements.bookmark=d),e.treeAdapter.detachNode(a),e.treeAdapter.appendChild(l,a),a=l)}return a}function DA(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),a=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,a),t.element=a,a}function PA(e,t,n){const a=e.treeAdapter.getTagName(t),s=Bi(a);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const o=e.treeAdapter.getNamespaceURI(t);s===p.TEMPLATE&&o===Z.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function MA(e,t,n){const a=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,o=e.treeAdapter.createElement(s.tagName,a,s.attrs);e._adoptNodes(t,o),e.treeAdapter.appendChild(t,o),e.activeFormattingElements.insertElementAfterBookmark(o,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,o,s.tagID)}function Nd(e,t){for(let n=0;n<vA;n++){const a=LA(e,t);if(!a)break;const s=RA(e,a);if(!s)break;e.activeFormattingElements.bookmark=a;const o=OA(e,s,a.element),l=e.openElements.getCommonAncestor(a.element);e.treeAdapter.detachNode(o),l&&PA(e,l,o),MA(e,s,a)}}function Hc(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function FA(e,t){e._appendCommentNode(t,e.openElements.items[0])}function BA(e,t){e._appendCommentNode(t,e.document)}function Ad(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let a=e.openElements.stackTop;a>=n;a--)e._setEndLocation(e.openElements.items[a],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const a=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(a);if(s&&!s.endTag&&(e._setEndLocation(a,t),e.openElements.stackTop>=1)){const o=e.openElements.items[1],l=e.treeAdapter.getNodeSourceCodeLocation(o);l&&!l.endTag&&e._setEndLocation(o,t)}}}}function UA(e,t){e._setDocumentType(t);const n=t.forceQuirks?an.QUIRKS:mA(t);pA(t)||e._err(t,q.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=L.BEFORE_HTML}function Oa(e,t){e._err(t,q.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,an.QUIRKS),e.insertionMode=L.BEFORE_HTML,e._processToken(t)}function jA(e,t){t.tagID===p.HTML?(e._insertElement(t,Z.HTML),e.insertionMode=L.BEFORE_HEAD):ja(e,t)}function HA(e,t){const n=t.tagID;(n===p.HTML||n===p.HEAD||n===p.BODY||n===p.BR)&&ja(e,t)}function ja(e,t){e._insertFakeRootElement(),e.insertionMode=L.BEFORE_HEAD,e._processToken(t)}function zA(e,t){switch(t.tagID){case p.HTML:{wt(e,t);break}case p.HEAD:{e._insertElement(t,Z.HTML),e.headElement=e.openElements.current,e.insertionMode=L.IN_HEAD;break}default:Ha(e,t)}}function $A(e,t){const n=t.tagID;n===p.HEAD||n===p.BODY||n===p.HTML||n===p.BR?Ha(e,t):e._err(t,q.endTagWithoutMatchingOpenElement)}function Ha(e,t){e._insertFakeElement(z.HEAD,p.HEAD),e.headElement=e.openElements.current,e.insertionMode=L.IN_HEAD,e._processToken(t)}function bn(e,t){switch(t.tagID){case p.HTML:{wt(e,t);break}case p.BASE:case p.BASEFONT:case p.BGSOUND:case p.LINK:case p.META:{e._appendElement(t,Z.HTML),t.ackSelfClosing=!0;break}case p.TITLE:{e._switchToTextParsing(t,at.RCDATA);break}case p.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,at.RAWTEXT):(e._insertElement(t,Z.HTML),e.insertionMode=L.IN_HEAD_NO_SCRIPT);break}case p.NOFRAMES:case p.STYLE:{e._switchToTextParsing(t,at.RAWTEXT);break}case p.SCRIPT:{e._switchToTextParsing(t,at.SCRIPT_DATA);break}case p.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=L.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(L.IN_TEMPLATE);break}case p.HEAD:{e._err(t,q.misplacedStartTagForHeadElement);break}default:za(e,t)}}function WA(e,t){switch(t.tagID){case p.HEAD:{e.openElements.pop(),e.insertionMode=L.AFTER_HEAD;break}case p.BODY:case p.BR:case p.HTML:{za(e,t);break}case p.TEMPLATE:{Kr(e,t);break}default:e._err(t,q.endTagWithoutMatchingOpenElement)}}function Kr(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==p.TEMPLATE&&e._err(t,q.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(p.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,q.endTagWithoutMatchingOpenElement)}function za(e,t){e.openElements.pop(),e.insertionMode=L.AFTER_HEAD,e._processToken(t)}function YA(e,t){switch(t.tagID){case p.HTML:{wt(e,t);break}case p.BASEFONT:case p.BGSOUND:case p.HEAD:case p.LINK:case p.META:case p.NOFRAMES:case p.STYLE:{bn(e,t);break}case p.NOSCRIPT:{e._err(t,q.nestedNoscriptInHead);break}default:$a(e,t)}}function VA(e,t){switch(t.tagID){case p.NOSCRIPT:{e.openElements.pop(),e.insertionMode=L.IN_HEAD;break}case p.BR:{$a(e,t);break}default:e._err(t,q.endTagWithoutMatchingOpenElement)}}function $a(e,t){const n=t.type===Pe.EOF?q.openElementsLeftAfterEof:q.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=L.IN_HEAD,e._processToken(t)}function qA(e,t){switch(t.tagID){case p.HTML:{wt(e,t);break}case p.BODY:{e._insertElement(t,Z.HTML),e.framesetOk=!1,e.insertionMode=L.IN_BODY;break}case p.FRAMESET:{e._insertElement(t,Z.HTML),e.insertionMode=L.IN_FRAMESET;break}case p.BASE:case p.BASEFONT:case p.BGSOUND:case p.LINK:case p.META:case p.NOFRAMES:case p.SCRIPT:case p.STYLE:case p.TEMPLATE:case p.TITLE:{e._err(t,q.abandonedHeadElementChild),e.openElements.push(e.headElement,p.HEAD),bn(e,t),e.openElements.remove(e.headElement);break}case p.HEAD:{e._err(t,q.misplacedStartTagForHeadElement);break}default:Wa(e,t)}}function QA(e,t){switch(t.tagID){case p.BODY:case p.HTML:case p.BR:{Wa(e,t);break}case p.TEMPLATE:{Kr(e,t);break}default:e._err(t,q.endTagWithoutMatchingOpenElement)}}function Wa(e,t){e._insertFakeElement(z.BODY,p.BODY),e.insertionMode=L.IN_BODY,eo(e,t)}function eo(e,t){switch(t.type){case Pe.CHARACTER:{Cg(e,t);break}case Pe.WHITESPACE_CHARACTER:{kg(e,t);break}case Pe.COMMENT:{Hc(e,t);break}case Pe.START_TAG:{wt(e,t);break}case Pe.END_TAG:{to(e,t);break}case Pe.EOF:{Ag(e,t);break}}}function kg(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Cg(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function GA(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function KA(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function XA(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Z.HTML),e.insertionMode=L.IN_FRAMESET)}function JA(e,t){e.openElements.hasInButtonScope(p.P)&&e._closePElement(),e._insertElement(t,Z.HTML)}function ZA(e,t){e.openElements.hasInButtonScope(p.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&jc.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Z.HTML)}function ev(e,t){e.openElements.hasInButtonScope(p.P)&&e._closePElement(),e._insertElement(t,Z.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function tv(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(p.P)&&e._closePElement(),e._insertElement(t,Z.HTML),n||(e.formElement=e.openElements.current))}function nv(e,t){e.framesetOk=!1;const n=t.tagID;for(let a=e.openElements.stackTop;a>=0;a--){const s=e.openElements.tagIDs[a];if(n===p.LI&&s===p.LI||(n===p.DD||n===p.DT)&&(s===p.DD||s===p.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==p.ADDRESS&&s!==p.DIV&&s!==p.P&&e._isSpecialElement(e.openElements.items[a],s))break}e.openElements.hasInButtonScope(p.P)&&e._closePElement(),e._insertElement(t,Z.HTML)}function rv(e,t){e.openElements.hasInButtonScope(p.P)&&e._closePElement(),e._insertElement(t,Z.HTML),e.tokenizer.state=at.PLAINTEXT}function iv(e,t){e.openElements.hasInScope(p.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(p.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML),e.framesetOk=!1}function av(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(z.A);n&&(Nd(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function sv(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function uv(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(p.NOBR)&&(Nd(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function ov(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function lv(e,t){e.treeAdapter.getDocumentMode(e.document)!==an.QUIRKS&&e.openElements.hasInButtonScope(p.P)&&e._closePElement(),e._insertElement(t,Z.HTML),e.framesetOk=!1,e.insertionMode=L.IN_TABLE}function _g(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Z.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Sg(e){const t=hg(e,Yr.TYPE);return t!=null&&t.toLowerCase()===AA}function cv(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Z.HTML),Sg(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function dv(e,t){e._appendElement(t,Z.HTML),t.ackSelfClosing=!0}function fv(e,t){e.openElements.hasInButtonScope(p.P)&&e._closePElement(),e._appendElement(t,Z.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function hv(e,t){t.tagName=z.IMG,t.tagID=p.IMG,_g(e,t)}function pv(e,t){e._insertElement(t,Z.HTML),e.skipNextNewLine=!0,e.tokenizer.state=at.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=L.TEXT}function mv(e,t){e.openElements.hasInButtonScope(p.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,at.RAWTEXT)}function gv(e,t){e.framesetOk=!1,e._switchToTextParsing(t,at.RAWTEXT)}function Gm(e,t){e._switchToTextParsing(t,at.RAWTEXT)}function Ev(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===L.IN_TABLE||e.insertionMode===L.IN_CAPTION||e.insertionMode===L.IN_TABLE_BODY||e.insertionMode===L.IN_ROW||e.insertionMode===L.IN_CELL?L.IN_SELECT_IN_TABLE:L.IN_SELECT}function Tv(e,t){e.openElements.currentTagId===p.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML)}function yv(e,t){e.openElements.hasInScope(p.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Z.HTML)}function xv(e,t){e.openElements.hasInScope(p.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(p.RTC),e._insertElement(t,Z.HTML)}function bv(e,t){e._reconstructActiveFormattingElements(),yg(t),Sd(t),t.selfClosing?e._appendElement(t,Z.MATHML):e._insertElement(t,Z.MATHML),t.ackSelfClosing=!0}function kv(e,t){e._reconstructActiveFormattingElements(),xg(t),Sd(t),t.selfClosing?e._appendElement(t,Z.SVG):e._insertElement(t,Z.SVG),t.ackSelfClosing=!0}function Km(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML)}function wt(e,t){switch(t.tagID){case p.I:case p.S:case p.B:case p.U:case p.EM:case p.TT:case p.BIG:case p.CODE:case p.FONT:case p.SMALL:case p.STRIKE:case p.STRONG:{sv(e,t);break}case p.A:{av(e,t);break}case p.H1:case p.H2:case p.H3:case p.H4:case p.H5:case p.H6:{ZA(e,t);break}case p.P:case p.DL:case p.OL:case p.UL:case p.DIV:case p.DIR:case p.NAV:case p.MAIN:case p.MENU:case p.ASIDE:case p.CENTER:case p.FIGURE:case p.FOOTER:case p.HEADER:case p.HGROUP:case p.DIALOG:case p.DETAILS:case p.ADDRESS:case p.ARTICLE:case p.SEARCH:case p.SECTION:case p.SUMMARY:case p.FIELDSET:case p.BLOCKQUOTE:case p.FIGCAPTION:{JA(e,t);break}case p.LI:case p.DD:case p.DT:{nv(e,t);break}case p.BR:case p.IMG:case p.WBR:case p.AREA:case p.EMBED:case p.KEYGEN:{_g(e,t);break}case p.HR:{fv(e,t);break}case p.RB:case p.RTC:{yv(e,t);break}case p.RT:case p.RP:{xv(e,t);break}case p.PRE:case p.LISTING:{ev(e,t);break}case p.XMP:{mv(e,t);break}case p.SVG:{kv(e,t);break}case p.HTML:{GA(e,t);break}case p.BASE:case p.LINK:case p.META:case p.STYLE:case p.TITLE:case p.SCRIPT:case p.BGSOUND:case p.BASEFONT:case p.TEMPLATE:{bn(e,t);break}case p.BODY:{KA(e,t);break}case p.FORM:{tv(e,t);break}case p.NOBR:{uv(e,t);break}case p.MATH:{bv(e,t);break}case p.TABLE:{lv(e,t);break}case p.INPUT:{cv(e,t);break}case p.PARAM:case p.TRACK:case p.SOURCE:{dv(e,t);break}case p.IMAGE:{hv(e,t);break}case p.BUTTON:{iv(e,t);break}case p.APPLET:case p.OBJECT:case p.MARQUEE:{ov(e,t);break}case p.IFRAME:{gv(e,t);break}case p.SELECT:{Ev(e,t);break}case p.OPTION:case p.OPTGROUP:{Tv(e,t);break}case p.NOEMBED:case p.NOFRAMES:{Gm(e,t);break}case p.FRAMESET:{XA(e,t);break}case p.TEXTAREA:{pv(e,t);break}case p.NOSCRIPT:{e.options.scriptingEnabled?Gm(e,t):Km(e,t);break}case p.PLAINTEXT:{rv(e,t);break}case p.COL:case p.TH:case p.TD:case p.TR:case p.HEAD:case p.FRAME:case p.TBODY:case p.TFOOT:case p.THEAD:case p.CAPTION:case p.COLGROUP:break;default:Km(e,t)}}function Cv(e,t){if(e.openElements.hasInScope(p.BODY)&&(e.insertionMode=L.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function _v(e,t){e.openElements.hasInScope(p.BODY)&&(e.insertionMode=L.AFTER_BODY,Pg(e,t))}function Sv(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Nv(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(p.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(p.FORM):n&&e.openElements.remove(n))}function Av(e){e.openElements.hasInButtonScope(p.P)||e._insertFakeElement(z.P,p.P),e._closePElement()}function vv(e){e.openElements.hasInListItemScope(p.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(p.LI),e.openElements.popUntilTagNamePopped(p.LI))}function wv(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Iv(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Lv(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function Rv(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(z.BR,p.BR),e.openElements.pop(),e.framesetOk=!1}function Ng(e,t){const n=t.tagName,a=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){const o=e.openElements.items[s],l=e.openElements.tagIDs[s];if(a===l&&(a!==p.UNKNOWN||e.treeAdapter.getTagName(o)===n)){e.openElements.generateImpliedEndTagsWithExclusion(a),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(o,l))break}}function to(e,t){switch(t.tagID){case p.A:case p.B:case p.I:case p.S:case p.U:case p.EM:case p.TT:case p.BIG:case p.CODE:case p.FONT:case p.NOBR:case p.SMALL:case p.STRIKE:case p.STRONG:{Nd(e,t);break}case p.P:{Av(e);break}case p.DL:case p.UL:case p.OL:case p.DIR:case p.DIV:case p.NAV:case p.PRE:case p.MAIN:case p.MENU:case p.ASIDE:case p.BUTTON:case p.CENTER:case p.FIGURE:case p.FOOTER:case p.HEADER:case p.HGROUP:case p.DIALOG:case p.ADDRESS:case p.ARTICLE:case p.DETAILS:case p.SEARCH:case p.SECTION:case p.SUMMARY:case p.LISTING:case p.FIELDSET:case p.BLOCKQUOTE:case p.FIGCAPTION:{Sv(e,t);break}case p.LI:{vv(e);break}case p.DD:case p.DT:{wv(e,t);break}case p.H1:case p.H2:case p.H3:case p.H4:case p.H5:case p.H6:{Iv(e);break}case p.BR:{Rv(e);break}case p.BODY:{Cv(e,t);break}case p.HTML:{_v(e,t);break}case p.FORM:{Nv(e);break}case p.APPLET:case p.OBJECT:case p.MARQUEE:{Lv(e,t);break}case p.TEMPLATE:{Kr(e,t);break}default:Ng(e,t)}}function Ag(e,t){e.tmplInsertionModeStack.length>0?Dg(e,t):Ad(e,t)}function Ov(e,t){var n;t.tagID===p.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function Dv(e,t){e._err(t,q.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function yc(e,t){if(e.openElements.currentTagId!==void 0&&bg.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=L.IN_TABLE_TEXT,t.type){case Pe.CHARACTER:{wg(e,t);break}case Pe.WHITESPACE_CHARACTER:{vg(e,t);break}}else as(e,t)}function Pv(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Z.HTML),e.insertionMode=L.IN_CAPTION}function Mv(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Z.HTML),e.insertionMode=L.IN_COLUMN_GROUP}function Fv(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(z.COLGROUP,p.COLGROUP),e.insertionMode=L.IN_COLUMN_GROUP,vd(e,t)}function Bv(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Z.HTML),e.insertionMode=L.IN_TABLE_BODY}function Uv(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(z.TBODY,p.TBODY),e.insertionMode=L.IN_TABLE_BODY,no(e,t)}function jv(e,t){e.openElements.hasInTableScope(p.TABLE)&&(e.openElements.popUntilTagNamePopped(p.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Hv(e,t){Sg(t)?e._appendElement(t,Z.HTML):as(e,t),t.ackSelfClosing=!0}function zv(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Z.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Ri(e,t){switch(t.tagID){case p.TD:case p.TH:case p.TR:{Uv(e,t);break}case p.STYLE:case p.SCRIPT:case p.TEMPLATE:{bn(e,t);break}case p.COL:{Fv(e,t);break}case p.FORM:{zv(e,t);break}case p.TABLE:{jv(e,t);break}case p.TBODY:case p.TFOOT:case p.THEAD:{Bv(e,t);break}case p.INPUT:{Hv(e,t);break}case p.CAPTION:{Pv(e,t);break}case p.COLGROUP:{Mv(e,t);break}default:as(e,t)}}function Ka(e,t){switch(t.tagID){case p.TABLE:{e.openElements.hasInTableScope(p.TABLE)&&(e.openElements.popUntilTagNamePopped(p.TABLE),e._resetInsertionMode());break}case p.TEMPLATE:{Kr(e,t);break}case p.BODY:case p.CAPTION:case p.COL:case p.COLGROUP:case p.HTML:case p.TBODY:case p.TD:case p.TFOOT:case p.TH:case p.THEAD:case p.TR:break;default:as(e,t)}}function as(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,eo(e,t),e.fosterParentingEnabled=n}function vg(e,t){e.pendingCharacterTokens.push(t)}function wg(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Da(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)as(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const Ig=new Set([p.CAPTION,p.COL,p.COLGROUP,p.TBODY,p.TD,p.TFOOT,p.TH,p.THEAD,p.TR]);function $v(e,t){const n=t.tagID;Ig.has(n)?e.openElements.hasInTableScope(p.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(p.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=L.IN_TABLE,Ri(e,t)):wt(e,t)}function Wv(e,t){const n=t.tagID;switch(n){case p.CAPTION:case p.TABLE:{e.openElements.hasInTableScope(p.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(p.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=L.IN_TABLE,n===p.TABLE&&Ka(e,t));break}case p.BODY:case p.COL:case p.COLGROUP:case p.HTML:case p.TBODY:case p.TD:case p.TFOOT:case p.TH:case p.THEAD:case p.TR:break;default:to(e,t)}}function vd(e,t){switch(t.tagID){case p.HTML:{wt(e,t);break}case p.COL:{e._appendElement(t,Z.HTML),t.ackSelfClosing=!0;break}case p.TEMPLATE:{bn(e,t);break}default:Bu(e,t)}}function Yv(e,t){switch(t.tagID){case p.COLGROUP:{e.openElements.currentTagId===p.COLGROUP&&(e.openElements.pop(),e.insertionMode=L.IN_TABLE);break}case p.TEMPLATE:{Kr(e,t);break}case p.COL:break;default:Bu(e,t)}}function Bu(e,t){e.openElements.currentTagId===p.COLGROUP&&(e.openElements.pop(),e.insertionMode=L.IN_TABLE,e._processToken(t))}function no(e,t){switch(t.tagID){case p.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Z.HTML),e.insertionMode=L.IN_ROW;break}case p.TH:case p.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(z.TR,p.TR),e.insertionMode=L.IN_ROW,ro(e,t);break}case p.CAPTION:case p.COL:case p.COLGROUP:case p.TBODY:case p.TFOOT:case p.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=L.IN_TABLE,Ri(e,t));break}default:Ri(e,t)}}function zc(e,t){const n=t.tagID;switch(t.tagID){case p.TBODY:case p.TFOOT:case p.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=L.IN_TABLE);break}case p.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=L.IN_TABLE,Ka(e,t));break}case p.BODY:case p.CAPTION:case p.COL:case p.COLGROUP:case p.HTML:case p.TD:case p.TH:case p.TR:break;default:Ka(e,t)}}function ro(e,t){switch(t.tagID){case p.TH:case p.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Z.HTML),e.insertionMode=L.IN_CELL,e.activeFormattingElements.insertMarker();break}case p.CAPTION:case p.COL:case p.COLGROUP:case p.TBODY:case p.TFOOT:case p.THEAD:case p.TR:{e.openElements.hasInTableScope(p.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=L.IN_TABLE_BODY,no(e,t));break}default:Ri(e,t)}}function Lg(e,t){switch(t.tagID){case p.TR:{e.openElements.hasInTableScope(p.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=L.IN_TABLE_BODY);break}case p.TABLE:{e.openElements.hasInTableScope(p.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=L.IN_TABLE_BODY,zc(e,t));break}case p.TBODY:case p.TFOOT:case p.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(p.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=L.IN_TABLE_BODY,zc(e,t));break}case p.BODY:case p.CAPTION:case p.COL:case p.COLGROUP:case p.HTML:case p.TD:case p.TH:break;default:Ka(e,t)}}function Vv(e,t){const n=t.tagID;Ig.has(n)?(e.openElements.hasInTableScope(p.TD)||e.openElements.hasInTableScope(p.TH))&&(e._closeTableCell(),ro(e,t)):wt(e,t)}function qv(e,t){const n=t.tagID;switch(n){case p.TD:case p.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=L.IN_ROW);break}case p.TABLE:case p.TBODY:case p.TFOOT:case p.THEAD:case p.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),Lg(e,t));break}case p.BODY:case p.CAPTION:case p.COL:case p.COLGROUP:case p.HTML:break;default:to(e,t)}}function Rg(e,t){switch(t.tagID){case p.HTML:{wt(e,t);break}case p.OPTION:{e.openElements.currentTagId===p.OPTION&&e.openElements.pop(),e._insertElement(t,Z.HTML);break}case p.OPTGROUP:{e.openElements.currentTagId===p.OPTION&&e.openElements.pop(),e.openElements.currentTagId===p.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Z.HTML);break}case p.HR:{e.openElements.currentTagId===p.OPTION&&e.openElements.pop(),e.openElements.currentTagId===p.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Z.HTML),t.ackSelfClosing=!0;break}case p.INPUT:case p.KEYGEN:case p.TEXTAREA:case p.SELECT:{e.openElements.hasInSelectScope(p.SELECT)&&(e.openElements.popUntilTagNamePopped(p.SELECT),e._resetInsertionMode(),t.tagID!==p.SELECT&&e._processStartTag(t));break}case p.SCRIPT:case p.TEMPLATE:{bn(e,t);break}}}function Og(e,t){switch(t.tagID){case p.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===p.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===p.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===p.OPTGROUP&&e.openElements.pop();break}case p.OPTION:{e.openElements.currentTagId===p.OPTION&&e.openElements.pop();break}case p.SELECT:{e.openElements.hasInSelectScope(p.SELECT)&&(e.openElements.popUntilTagNamePopped(p.SELECT),e._resetInsertionMode());break}case p.TEMPLATE:{Kr(e,t);break}}}function Qv(e,t){const n=t.tagID;n===p.CAPTION||n===p.TABLE||n===p.TBODY||n===p.TFOOT||n===p.THEAD||n===p.TR||n===p.TD||n===p.TH?(e.openElements.popUntilTagNamePopped(p.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Rg(e,t)}function Gv(e,t){const n=t.tagID;n===p.CAPTION||n===p.TABLE||n===p.TBODY||n===p.TFOOT||n===p.THEAD||n===p.TR||n===p.TD||n===p.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(p.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Og(e,t)}function Kv(e,t){switch(t.tagID){case p.BASE:case p.BASEFONT:case p.BGSOUND:case p.LINK:case p.META:case p.NOFRAMES:case p.SCRIPT:case p.STYLE:case p.TEMPLATE:case p.TITLE:{bn(e,t);break}case p.CAPTION:case p.COLGROUP:case p.TBODY:case p.TFOOT:case p.THEAD:{e.tmplInsertionModeStack[0]=L.IN_TABLE,e.insertionMode=L.IN_TABLE,Ri(e,t);break}case p.COL:{e.tmplInsertionModeStack[0]=L.IN_COLUMN_GROUP,e.insertionMode=L.IN_COLUMN_GROUP,vd(e,t);break}case p.TR:{e.tmplInsertionModeStack[0]=L.IN_TABLE_BODY,e.insertionMode=L.IN_TABLE_BODY,no(e,t);break}case p.TD:case p.TH:{e.tmplInsertionModeStack[0]=L.IN_ROW,e.insertionMode=L.IN_ROW,ro(e,t);break}default:e.tmplInsertionModeStack[0]=L.IN_BODY,e.insertionMode=L.IN_BODY,wt(e,t)}}function Xv(e,t){t.tagID===p.TEMPLATE&&Kr(e,t)}function Dg(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(p.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Ad(e,t)}function Jv(e,t){t.tagID===p.HTML?wt(e,t):Uu(e,t)}function Pg(e,t){var n;if(t.tagID===p.HTML){if(e.fragmentContext||(e.insertionMode=L.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===p.HTML){e._setEndLocation(e.openElements.items[0],t);const a=e.openElements.items[1];a&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(a))===null||n===void 0)&&n.endTag)&&e._setEndLocation(a,t)}}else Uu(e,t)}function Uu(e,t){e.insertionMode=L.IN_BODY,eo(e,t)}function Zv(e,t){switch(t.tagID){case p.HTML:{wt(e,t);break}case p.FRAMESET:{e._insertElement(t,Z.HTML);break}case p.FRAME:{e._appendElement(t,Z.HTML),t.ackSelfClosing=!0;break}case p.NOFRAMES:{bn(e,t);break}}}function ew(e,t){t.tagID===p.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==p.FRAMESET&&(e.insertionMode=L.AFTER_FRAMESET))}function tw(e,t){switch(t.tagID){case p.HTML:{wt(e,t);break}case p.NOFRAMES:{bn(e,t);break}}}function nw(e,t){t.tagID===p.HTML&&(e.insertionMode=L.AFTER_AFTER_FRAMESET)}function rw(e,t){t.tagID===p.HTML?wt(e,t):Ru(e,t)}function Ru(e,t){e.insertionMode=L.IN_BODY,eo(e,t)}function iw(e,t){switch(t.tagID){case p.HTML:{wt(e,t);break}case p.NOFRAMES:{bn(e,t);break}}}function aw(e,t){t.chars=Je,e._insertCharacters(t)}function sw(e,t){e._insertCharacters(t),e.framesetOk=!1}function Mg(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Z.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function uw(e,t){if(kA(t))Mg(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),a=e.treeAdapter.getNamespaceURI(n);a===Z.MATHML?yg(t):a===Z.SVG&&(CA(t),xg(t)),Sd(t),t.selfClosing?e._appendElement(t,a):e._insertElement(t,a),t.ackSelfClosing=!0}}function ow(e,t){if(t.tagID===p.P||t.tagID===p.BR){Mg(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const a=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(a)===Z.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(a);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}z.AREA,z.BASE,z.BASEFONT,z.BGSOUND,z.BR,z.COL,z.EMBED,z.FRAME,z.HR,z.IMG,z.INPUT,z.KEYGEN,z.LINK,z.META,z.PARAM,z.SOURCE,z.TRACK,z.WBR;const lw=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,cw=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Xm={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Fg(e,t){const n=xw(e),a=U1("type",{handlers:{root:dw,element:fw,text:hw,comment:Ug,doctype:pw,raw:gw},unknown:Ew}),s={parser:n?new Qm(Xm):Qm.getFragmentParser(void 0,Xm),handle(d){a(d,s)},stitches:!1,options:t||{}};a(e,s),Ui(s,Ln());const o=n?s.parser.document:s.parser.getFragment(),l=bN(o,{file:s.options.file});return s.stitches&&Zu(l,"comment",function(d,f,h){const E=d;if(E.value.stitch&&h&&f!==void 0){const g=h.children;return g[f]=E.value.stitch,f}}),l.type==="root"&&l.children.length===1&&l.children[0].type===e.type?l.children[0]:l}function Bg(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function dw(e,t){Bg(e.children,t)}function fw(e,t){Tw(e,t),Bg(e.children,t),yw(e,t)}function hw(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Pe.CHARACTER,chars:e.value,location:ss(e)};Ui(t,Ln(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function pw(e,t){const n={type:Pe.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:ss(e)};Ui(t,Ln(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function mw(e,t){t.stitches=!0;const n=bw(e);if("children"in e&&"children"in n){const a=Fg({type:"root",children:e.children},t.options);n.children=a.children}Ug({type:"comment",value:{stitch:n}},t)}function Ug(e,t){const n=e.value,a={type:Pe.COMMENT,data:n,location:ss(e)};Ui(t,Ln(e)),t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken)}function gw(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,jg(t,Ln(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(lw,"<$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 Ew(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))mw(n,t);else{let a="";throw cw.has(n.type)&&(a=". 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"+a)}}function Ui(e,t){jg(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=at.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 jg(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 Tw(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===at.PLAINTEXT)return;Ui(t,Ln(e));const a=t.parser.openElements.current;let s="namespaceURI"in a?a.namespaceURI:$r.html;s===$r.html&&n==="svg"&&(s=$r.svg);const o=NN({...e,children:[]},{space:s===$r.svg?"svg":"html"}),l={type:Pe.START_TAG,tagName:n,tagID:Bi(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in o?o.attrs:[],location:ss(e)};t.parser.currentToken=l,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function yw(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&DN.includes(n)||t.parser.tokenizer.state===at.PLAINTEXT)return;Ui(t,qu(e));const a={type:Pe.END_TAG,tagName:n,tagID:Bi(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:ss(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===at.RCDATA||t.parser.tokenizer.state===at.RAWTEXT||t.parser.tokenizer.state===at.SCRIPT_DATA)&&(t.parser.tokenizer.state=at.DATA)}function xw(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function ss(e){const t=Ln(e)||{line:void 0,column:void 0,offset:void 0},n=qu(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 bw(e){return"children"in e?qr({...e,children:[]}):qr(e)}function kw(e){return function(t,n){return Fg(t,{...e,file:n})}}const Ur=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],$c={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Ur,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Ur],h2:[["className","sr-only"]],img:[...Ur,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Ur,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Ur],table:[...Ur],ul:[...Ur,["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"]},Er={}.hasOwnProperty;function Cw(e,t){let n={type:"root",children:[]};const a={schema:t?{...$c,...t}:$c,stack:[]},s=Hg(a,e);return s&&(Array.isArray(s)?s.length===1?n=s[0]:n.children=s:n=s),n}function Hg(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return _w(e,n);case"doctype":return Sw(e,n);case"element":return Nw(e,n);case"root":return Aw(e,n);case"text":return vw(e,n)}}}function _w(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",a=n.indexOf("-->"),o={type:"comment",value:a<0?n:n.slice(0,a)};return us(o,t),o}}function Sw(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return us(n,t),n}}function Nw(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const a=zg(e,t.children),s=ww(e,t.properties);e.stack.pop();let o=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(o=!0,e.schema.ancestors&&Er.call(e.schema.ancestors,n))){const d=e.schema.ancestors[n];let f=-1;for(o=!1;++f<d.length;)e.stack.includes(d[f])&&(o=!0)}if(!o)return e.schema.strip&&!e.schema.strip.includes(n)?a:void 0;const l={type:"element",tagName:n,properties:s,children:a};return us(l,t),l}function Aw(e,t){const a={type:"root",children:zg(e,t.children)};return us(a,t),a}function vw(e,t){const a={type:"text",value:typeof t.value=="string"?t.value:""};return us(a,t),a}function zg(e,t){const n=[];if(Array.isArray(t)){const a=t;let s=-1;for(;++s<a.length;){const o=Hg(e,a[s]);o&&(Array.isArray(o)?n.push(...o):n.push(o))}}return n}function ww(e,t){const n=e.stack[e.stack.length-1],a=e.schema.attributes,s=e.schema.required,o=a&&Er.call(a,n)?a[n]:void 0,l=a&&Er.call(a,"*")?a["*"]:void 0,d=t&&typeof t=="object"?t:{},f={};let h;for(h in d)if(Er.call(d,h)){const E=d[h];let g=Jm(e,Zm(o,h),h,E);g==null&&(g=Jm(e,Zm(l,h),h,E)),g!=null&&(f[h]=g)}if(s&&Er.call(s,n)){const E=s[n];for(h in E)Er.call(E,h)&&!Er.call(f,h)&&(f[h]=E[h])}return f}function Jm(e,t,n,a){return t?Array.isArray(a)?Iw(e,t,n,a):$g(e,t,n,a):void 0}function Iw(e,t,n,a){let s=-1;const o=[];for(;++s<a.length;){const l=$g(e,t,n,a[s]);(typeof l=="number"||typeof l=="string")&&o.push(l)}return o}function $g(e,t,n,a){if(!(typeof a!="boolean"&&typeof a!="number"&&typeof a!="string")&&Lw(e,n,a)){if(typeof t=="object"&&t.length>1){let s=!1,o=0;for(;++o<t.length;){const l=t[o];if(l&&typeof l=="object"&&"flags"in l){if(l.test(String(a))){s=!0;break}}else if(l===a){s=!0;break}}if(!s)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+a:a}}function Lw(e,t,n){const a=e.schema.protocols&&Er.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!a||a.length===0)return!0;const s=String(n),o=s.indexOf(":"),l=s.indexOf("?"),d=s.indexOf("#"),f=s.indexOf("/");if(o<0||f>-1&&o>f||l>-1&&o>l||d>-1&&o>d)return!0;let h=-1;for(;++h<a.length;){const E=a[h];if(o===E.length&&s.slice(0,E.length)===E)return!0}return!1}function us(e,t){const n=o1(t);t.data&&(e.data=qr(t.data)),n&&(e.position=n)}function Zm(e,t){let n,a=-1;if(e)for(;++a<e.length;){const s=e[a],o=typeof s=="string"?s:s[0];if(o===t)return s;o==="data*"&&(n=s)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function Rw(e){return function(t){return Cw(t,e)}}const Wc=$c,jr=(e,...t)=>{var n;return[...((n=Wc.attributes)==null?void 0:n[e])??[],...t]},Ow={...Wc,attributes:{...Wc.attributes,p:jr("p","align"),div:jr("div","align"),h1:jr("h1","align"),h2:jr("h2","align"),h3:jr("h3","align"),img:jr("img","width","height","align"),a:jr("a","align")}},Dw=new Set(["code","pre","svg","math","style","script","textarea"]),Pw="fade-word";function Mw(e){const t=[];for(const n of e.split(/(\s+)/))if(n){if(/^\s+$/.test(n)){t.push({type:"text",value:n});continue}t.push({type:"element",tagName:"span",properties:{className:[Pw]},children:[{type:"text",value:n}]})}return t}function Wg(e){const t=e.children;if(!t)return;const n=[];for(const a of t){if(a.type==="text"){n.push(...Mw(a.value??""));continue}if(a.type==="element"&&Dw.has(a.tagName??"")){n.push(a);continue}Wg(a),n.push(a)}e.children=n}function Fw(){return e=>Wg(e)}const Bw=256*1024;let Hr=null,Uw=0;const ju=new Map;function e0(e,t){var n;(n=ju.get(e))==null||n(t),ju.delete(e)}function jw(){if(Hr)return Hr;try{Hr=new Worker(new URL("/assets/highlightWorker-DJp1Ce5p.js",import.meta.url),{type:"module"}),Hr.addEventListener("message",e=>e0(e.data.id,e.data.html)),Hr.addEventListener("error",()=>{for(const e of[...ju.keys()])e0(e,null);Hr=null})}catch{return null}return Hr}async function wd(e,t){if(e.length>Bw)return null;const n=jw();if(!n)return null;const a=++Uw;return new Promise(s=>{ju.set(a,s),n.postMessage({id:a,code:e,lang:t})})}function Hw({code:e,lang:t}){const[n,a]=v.useState(null);v.useEffect(()=>{let o=!1;return wd(e,t).then(l=>{o||a(l)}).catch(()=>{o||a(null)}),()=>{o=!0}},[e,t]);const s=()=>{var o;return void((o=navigator.clipboard)==null?void 0:o.writeText(e))};return T.jsxs("div",{className:"codeblock",children:[T.jsxs("div",{className:"codeblock-bar",children:[T.jsx("span",{className:"codeblock-lang",children:t||"text"}),T.jsx("button",{className:"codeblock-copy",onClick:s,"aria-label":"Copy code",children:"copy"})]}),n?T.jsx("div",{className:"codeblock-body",dangerouslySetInnerHTML:{__html:n}}):T.jsx("pre",{className:"codeblock-body codeblock-plain",children:T.jsx("code",{children:e})})]})}let xc=null;function zw(){return xc||(xc=Ac(()=>import("./mermaid.core-D9w1JyXU.js").then(e=>e.bp),[]).then(e=>(e.default.initialize({startOnLoad:!1,theme:"dark",securityLevel:"strict",themeVariables:{primaryColor:"#44475a",primaryTextColor:"#f8f8f2",primaryBorderColor:"#bd93f9",lineColor:"#8be9fd",fontFamily:"Inter, sans-serif"}}),e.default))),xc}let $w=0;function Ww({code:e}){const t=v.useRef(null),[n,a]=v.useState(!1);return v.useEffect(()=>{let s=!1;a(!1);const o=e.trim();if(o)return zw().then(async l=>{const d=await l.parse(o,{suppressErrors:!0});if(s||!d)return;const{svg:f}=await l.render(`mermaid-${$w++}`,o);s||!t.current||(t.current.innerHTML=f,a(!0))}).catch(()=>{}),()=>{s=!0}},[e]),T.jsxs("div",{className:"mermaid-wrap",children:[T.jsx("div",{className:`mermaid-block ${n?"":"is-hidden"}`,ref:t}),!n&&T.jsxs("div",{className:"codeblock",children:[T.jsx("div",{className:"codeblock-bar",children:T.jsx("span",{className:"codeblock-lang",children:"mermaid"})}),T.jsx("pre",{className:"codeblock-body codeblock-plain",children:T.jsx("code",{children:e})})]})]})}const Yw=/language-(\w+)/,Vw=/\n$/,qw={code(e){const{className:t,children:n}=e,a=Yw.exec(t??""),s=String(n).replace(Vw,"");if(!t&&!s.includes(`
|
|
91
|
-
`))return T.jsx("code",{className:"md-inline-code",children:s});const l=(a==null?void 0:a[1])??"";return l==="mermaid"?T.jsx(
|
|
88
|
+
`)),b+=E.move(g),x(),b}function a(o,l,d){let f=o.value||"",h=1;for(t||h++;new RegExp("(^|[^$])"+"\\$".repeat(h)+"([^$]|$)").test(f);)h++;const E="$".repeat(h);/[^ \r\n]/.test(f)&&(/^[ \r\n]/.test(f)&&/[ \r\n]$/.test(f)||/^\$|\$$/.test(f))&&(f=" "+f+" ");let g=-1;for(;++g<d.unsafe.length;){const x=d.unsafe[g];if(!x.atBreak)continue;const b=d.compilePattern(x);let S;for(;S=b.exec(f);){let A=S.index;f.codePointAt(A)===10&&f.codePointAt(A-1)===13&&A--,f=f.slice(0,A)+" "+f.slice(S.index+1)}}return E+f+E}function s(){return"$"}}const V3={tokenize:q3,concrete:!0,name:"mathFlow"},Om={tokenize:Q3,partial:!0};function q3(e,t,n){const a=this,s=a.events[a.events.length-1],o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0;let l=0;return d;function d(F){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),f(F)}function f(F){return F===36?(e.consume(F),l++,f):l<2?n(F):(e.exit("mathFlowFenceSequence"),Me(e,h,"whitespace")(F))}function h(F){return F===null||be(F)?g(F):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(F))}function E(F){return F===null||be(F)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),g(F)):F===36?n(F):(e.consume(F),E)}function g(F){return e.exit("mathFlowFence"),a.interrupt?t(F):e.attempt(Om,x,P)(F)}function x(F){return e.attempt({tokenize:R,partial:!0},P,b)(F)}function b(F){return(o?Me(e,S,"linePrefix",o+1):S)(F)}function S(F){return F===null?P(F):be(F)?e.attempt(Om,x,P)(F):(e.enter("mathFlowValue"),A(F))}function A(F){return F===null||be(F)?(e.exit("mathFlowValue"),S(F)):(e.consume(F),A)}function P(F){return e.exit("mathFlow"),t(F)}function R(F,U,K){let $=0;return Me(F,j,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function j(fe){return F.enter("mathFlowFence"),F.enter("mathFlowFenceSequence"),te(fe)}function te(fe){return fe===36?($++,F.consume(fe),te):$<l?K(fe):(F.exit("mathFlowFenceSequence"),Me(F,ue,"whitespace")(fe))}function ue(fe){return fe===null||be(fe)?(F.exit("mathFlowFence"),U(fe)):K(fe)}}}function Q3(e,t,n){const a=this;return s;function s(l){return l===null?t(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return a.parser.lazy[a.now().line]?n(l):t(l)}}function G3(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:a,resolve:K3,previous:X3,name:"mathText"};function a(s,o,l){let d=0,f,h;return E;function E(A){return s.enter("mathText"),s.enter("mathTextSequence"),g(A)}function g(A){return A===36?(s.consume(A),d++,g):d<2&&!n?l(A):(s.exit("mathTextSequence"),x(A))}function x(A){return A===null?l(A):A===36?(h=s.enter("mathTextSequence"),f=0,S(A)):A===32?(s.enter("space"),s.consume(A),s.exit("space"),x):be(A)?(s.enter("lineEnding"),s.consume(A),s.exit("lineEnding"),x):(s.enter("mathTextData"),b(A))}function b(A){return A===null||A===32||A===36||be(A)?(s.exit("mathTextData"),x(A)):(s.consume(A),b)}function S(A){return A===36?(s.consume(A),f++,S):f===d?(s.exit("mathTextSequence"),s.exit("mathText"),o(A)):(h.type="mathTextData",b(A))}}}function K3(e){let t=e.length-4,n=3,a,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[n][1].type="mathTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="mathTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function X3(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function J3(e){return{flow:{36:V3},text:{36:G3(e)}}}const Z3={};function eN(e){const t=this,n=e||Z3,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),l=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(J3(n)),o.push(W3()),l.push(Y3(n))}const tN=[$3,eN],nN=/\\[a-zA-Z]+|[\^_]/,rN=/^\d[\d,.]*\s*(?:[kKmMbB]|bn|billion|million|thousand)?$/,iN=/^[a-zA-Z]{3,}$/,Dm=/[=+\-*/<>≤≥±×÷]/,aN=/[.,;:!?]$/,sN=/\n/,uN=/\s+/,oN=/\d,\d{3}\b/;function lN(e){const t=e.trim();if(!t||sN.test(e))return!1;if(nN.test(t))return!0;if(rN.test(t))return!1;const n=t.split(uN),a=n.filter(o=>iN.test(o.replace(aN,"")));return a.length>=2||oN.test(t)?!1:!!(n.every(o=>o.length<=4)&&(n.length===1||Dm.test(t))||Dm.test(t)&&a.length===0)}function cN(e,t){if(e.startsWith("```",t)||e.startsWith("~~~",t)){const n=e.slice(t,t+3),a=e.indexOf(`
|
|
89
|
+
${n}`,t+3);return a===-1?e.length:a+4}if(e[t]==="`"){let n=0;for(;e[t+n]==="`";)n++;const a=e.indexOf("`".repeat(n),t+n);return a===-1?t+n:a+n}return t}function dN(e){let t="",n=0;for(;n<e.length;){const a=cN(e,n);if(a>n){t+=e.slice(n,a),n=a;continue}if(e[n]==="$"&&e[n+1]==="$"){const s=e.indexOf("$$",n+2),o=s===-1?e.length:s+2;t+=e.slice(n,o),n=o;continue}if(e[n]==="$"&&e[n-1]!=="\\"){const s=e.indexOf("$",n+1);if(s!==-1){const o=e.slice(n+1,s);if(!lN(o)){t+=`\\$${o}`,n=s;continue}t+=e.slice(n,s+1),n=s+1;continue}}t+=e[n],n++}return t}const Pm=/[#.]/g;function fN(e,t){const n=e||"",a={};let s=0,o,l;for(;s<n.length;){Pm.lastIndex=s;const d=Pm.exec(n),f=n.slice(s,d?d.index:n.length);f&&(o?o==="#"?a.id=f:Array.isArray(a.className)?a.className.push(f):a.className=[f]:l=f,s+=f.length),d&&(o=d[0],s++)}return{type:"element",tagName:l||t||"div",properties:a,children:[]}}function sg(e,t,n){const a=n?gN(n):void 0;function s(o,l,...d){let f;if(o==null){f={type:"root",children:[]};const h=l;d.unshift(h)}else{f=fN(o,t);const h=f.tagName.toLowerCase(),E=a?a.get(h):void 0;if(f.tagName=E||h,hN(l))d.unshift(l);else for(const[g,x]of Object.entries(l))pN(e,f.properties,g,x)}for(const h of d)Bc(f.children,h);return f.type==="element"&&f.tagName==="template"&&(f.content={type:"root",children:f.children},f.children=[]),f}return s}function hN(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 a of n){const s=t[a];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const o=s;for(const l of o)if(typeof l!="number"&&typeof l!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function pN(e,t,n,a){const s=Vu(e,n);let o;if(a!=null){if(typeof a=="number"){if(Number.isNaN(a))return;o=a}else typeof a=="boolean"?o=a:typeof a=="string"?s.spaceSeparated?o=Vp(a):s.commaSeparated?o=Hp(a):s.commaOrSpaceSeparated?o=Vp(Hp(a).join(" ")):o=Mm(s,s.property,a):Array.isArray(a)?o=[...a]:o=s.property==="style"?mN(a):String(a);if(Array.isArray(o)){const l=[];for(const d of o)l.push(Mm(s,s.property,d));o=l}s.property==="className"&&Array.isArray(t.className)&&(o=t.className.concat(o)),t[s.property]=o}}function Bc(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)Bc(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Bc(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Mm(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||qa(n)===qa(t)))return!0}return n}function mN(e){const t=[];for(const[n,a]of Object.entries(e))t.push([n,a].join(": "));return t.join("; ")}function gN(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const EN=["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"],TN=sg(ns,"div"),yN=sg(xr,"g",EN);function xN(e){const t=String(e),n=[];return{toOffset:s,toPoint:a};function a(o){if(typeof o=="number"&&o>-1&&o<=t.length){let l=0;for(;;){let d=n[l];if(d===void 0){const f=Fm(t,n[l-1]);d=f===-1?t.length+1:f+1,n[l]=d}if(d>o)return{line:l+1,column:o-(l>0?n[l-1]:0)+1,offset:o};l++}}}function s(o){if(o&&typeof o.line=="number"&&typeof o.column=="number"&&!Number.isNaN(o.line)&&!Number.isNaN(o.column)){for(;n.length<o.line;){const d=n[n.length-1],f=Fm(t,d),h=f===-1?t.length+1:f+1;if(d===h)break;n.push(h)}const l=(o.line>1?n[o.line-2]:0)+o.column-1;if(l<n[o.line-1])return l}}}function Fm(e,t){const n=e.indexOf("\r",t),a=e.indexOf(`
|
|
90
|
+
`,t);return a===-1?n:n===-1||n+1===a?a:n<a?n:a}const $r={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/"},ug={}.hasOwnProperty,bN=Object.prototype;function kN(e,t){const n=t||{};return Cd({file:n.file||void 0,location:!1,schema:n.space==="svg"?xr:ns,verbose:n.verbose||!1},e)}function Cd(e,t){let n;switch(t.nodeName){case"#comment":{const a=t;return n={type:"comment",value:a.data},Lu(e,a,n),n}case"#document":case"#document-fragment":{const a=t,s="mode"in a?a.mode==="quirks"||a.mode==="limited-quirks":!1;if(n={type:"root",children:og(e,t.childNodes),data:{quirksMode:s}},e.file&&e.location){const o=String(e.file),l=xN(o),d=l.toPoint(0),f=l.toPoint(o.length);n.position={start:d,end:f}}return n}case"#documentType":{const a=t;return n={type:"doctype"},Lu(e,a,n),n}case"#text":{const a=t;return n={type:"text",value:a.value},Lu(e,a,n),n}default:return n=CN(e,t),n}}function og(e,t){let n=-1;const a=[];for(;++n<t.length;){const s=Cd(e,t[n]);a.push(s)}return a}function CN(e,t){const n=e.schema;e.schema=t.namespaceURI===$r.svg?xr:ns;let a=-1;const s={};for(;++a<t.attrs.length;){const d=t.attrs[a],f=(d.prefix?d.prefix+":":"")+d.name;ug.call(bN,f)||(s[f]=d.value)}const l=(e.schema.space==="svg"?yN:TN)(t.tagName,s,og(e,t.childNodes));if(Lu(e,t,l),l.tagName==="template"){const d=t,f=d.sourceCodeLocation,h=f&&f.startTag&&wi(f.startTag),E=f&&f.endTag&&wi(f.endTag),g=Cd(e,d.content);h&&E&&e.file&&(g.position={start:h.end,end:E.start}),l.content=g}return e.schema=n,l}function Lu(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const a=_N(e,n,t.sourceCodeLocation);a&&(e.location=!0,n.position=a)}}function _N(e,t,n){const a=wi(n);if(t.type==="element"){const s=t.children[t.children.length-1];if(a&&!n.endTag&&s&&s.position&&s.position.end&&(a.end=Object.assign({},s.position.end)),e.verbose){const o={};let l;if(n.attrs)for(l in n.attrs)ug.call(n.attrs,l)&&(o[Vu(e.schema,l).property]=wi(n.attrs[l]));n.startTag;const d=wi(n.startTag),f=n.endTag?wi(n.endTag):void 0,h={opening:d};f&&(h.closing=f),h.properties=o,t.data={position:h}}}return a}function wi(e){const t=Bm({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=Bm({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function Bm(e){return e.line&&e.column?e:void 0}const SN={},NN={}.hasOwnProperty,lg=U1("type",{handlers:{root:vN,element:ON,text:LN,comment:RN,doctype:IN}});function AN(e,t){const a=(t||SN).space;return lg(e,a==="svg"?xr:ns)}function vN(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=_d(e.children,n,t),Fi(e,n),n}function wN(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=_d(e.children,n,t),Fi(e,n),n}function IN(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Fi(e,t),t}function LN(e){const t={nodeName:"#text",value:e.value,parentNode:null};return Fi(e,t),t}function RN(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return Fi(e,t),t}function ON(e,t){const n=t;let a=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(a=xr);const s=[];let o;if(e.properties){for(o in e.properties)if(o!=="children"&&NN.call(e.properties,o)){const f=DN(a,o,e.properties[o]);f&&s.push(f)}}const l=a.space,d={nodeName:e.tagName,tagName:e.tagName,attrs:s,namespaceURI:$r[l],childNodes:[],parentNode:null};return d.childNodes=_d(e.children,d,a),Fi(e,d),e.tagName==="template"&&e.content&&(d.content=wN(e.content,a)),d}function DN(e,t,n){const a=Vu(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&a.boolean)return;Array.isArray(n)&&(n=a.commaSeparated?J0(n):s1(n));const s={name:a.attribute,value:n===!0?"":String(n)};if(a.space&&a.space!=="html"&&a.space!=="svg"){const o=s.name.indexOf(":");o<0?s.prefix="":(s.name=s.name.slice(o+1),s.prefix=a.attribute.slice(0,o)),s.namespace=$r[a.space]}return s}function _d(e,t,n){let a=-1;const s=[];if(e)for(;++a<e.length;){const o=lg(e[a],n);o.parentNode=t,s.push(o)}return s}function Fi(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 PN=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],MN=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]),Je="�";var _;(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"})(_||(_={}));const Ut={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function cg(e){return e>=55296&&e<=57343}function FN(e){return e>=56320&&e<=57343}function BN(e,t){return(e-55296)*1024+9216+t}function dg(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function fg(e){return e>=64976&&e<=65007||MN.has(e)}var q;(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"})(q||(q={}));const UN=65536;class jN{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=UN,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:a,col:s,offset:o}=this,l=s+n,d=o+n;return{code:t,startLine:a,endLine:a,startCol:l,endCol:l,startOffset:d,endOffset:d}}_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(FN(n))return this.pos++,this._addGap(),BN(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,_.EOF;return this._err(q.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 a=0;a<t.length;a++)if((this.html.charCodeAt(this.pos+a)|32)!==t.charCodeAt(a))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,_.EOF;const a=this.html.charCodeAt(n);return a===_.CARRIAGE_RETURN?_.LINE_FEED:a}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,_.EOF;let t=this.html.charCodeAt(this.pos);return t===_.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,_.LINE_FEED):t===_.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,cg(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===_.LINE_FEED||t===_.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){dg(t)?this._err(q.controlCharacterInInputStream):fg(t)&&this._err(q.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var Pe;(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"})(Pe||(Pe={}));function hg(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 HN=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),zN=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 $N(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=zN.get(e))!==null&&t!==void 0?t:e}var gt;(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"})(gt||(gt={}));const WN=32;var Tr;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Tr||(Tr={}));function Uc(e){return e>=gt.ZERO&&e<=gt.NINE}function YN(e){return e>=gt.UPPER_A&&e<=gt.UPPER_F||e>=gt.LOWER_A&&e<=gt.LOWER_F}function VN(e){return e>=gt.UPPER_A&&e<=gt.UPPER_Z||e>=gt.LOWER_A&&e<=gt.LOWER_Z||Uc(e)}function qN(e){return e===gt.EQUALS||VN(e)}var mt;(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"})(mt||(mt={}));var $n;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})($n||($n={}));class QN{constructor(t,n,a){this.decodeTree=t,this.emitCodePoint=n,this.errors=a,this.state=mt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=$n.Strict}startEntity(t){this.decodeMode=t,this.state=mt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case mt.EntityStart:return t.charCodeAt(n)===gt.NUM?(this.state=mt.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=mt.NamedEntity,this.stateNamedEntity(t,n));case mt.NumericStart:return this.stateNumericStart(t,n);case mt.NumericDecimal:return this.stateNumericDecimal(t,n);case mt.NumericHex:return this.stateNumericHex(t,n);case mt.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|WN)===gt.LOWER_X?(this.state=mt.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=mt.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,a,s){if(n!==a){const o=a-n;this.result=this.result*Math.pow(s,o)+Number.parseInt(t.substr(n,o),s),this.consumed+=o}}stateNumericHex(t,n){const a=n;for(;n<t.length;){const s=t.charCodeAt(n);if(Uc(s)||YN(s))n+=1;else return this.addToNumericResult(t,a,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(t,a,n,16),-1}stateNumericDecimal(t,n){const a=n;for(;n<t.length;){const s=t.charCodeAt(n);if(Uc(s))n+=1;else return this.addToNumericResult(t,a,n,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(t,a,n,10),-1}emitNumericEntity(t,n){var a;if(this.consumed<=n)return(a=this.errors)===null||a===void 0||a.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===gt.SEMI)this.consumed+=1;else if(this.decodeMode===$n.Strict)return 0;return this.emitCodePoint($N(this.result),this.consumed),this.errors&&(t!==gt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:a}=this;let s=a[this.treeIndex],o=(s&Tr.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const l=t.charCodeAt(n);if(this.treeIndex=GN(a,s,this.treeIndex+Math.max(1,o),l),this.treeIndex<0)return this.result===0||this.decodeMode===$n.Attribute&&(o===0||qN(l))?0:this.emitNotTerminatedNamedEntity();if(s=a[this.treeIndex],o=(s&Tr.VALUE_LENGTH)>>14,o!==0){if(l===gt.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==$n.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:a}=this,s=(a[n]&Tr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,a){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[t]&~Tr.VALUE_LENGTH:s[t+1],a),n===3&&this.emitCodePoint(s[t+2],a),a}end(){var t;switch(this.state){case mt.NamedEntity:return this.result!==0&&(this.decodeMode!==$n.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case mt.NumericDecimal:return this.emitNumericEntity(0,2);case mt.NumericHex:return this.emitNumericEntity(0,3);case mt.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case mt.EntityStart:return 0}}}function GN(e,t,n,a){const s=(t&Tr.BRANCH_LENGTH)>>7,o=t&Tr.JUMP_TABLE;if(s===0)return o!==0&&a===o?n:-1;if(o){const f=a-o;return f<0||f>=s?-1:e[n+f]-1}let l=n,d=l+s-1;for(;l<=d;){const f=l+d>>>1,h=e[f];if(h<a)l=f+1;else if(h>a)d=f-1;else return e[f+s]}return-1}var Z;(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/"})(Z||(Z={}));var Yr;(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"})(Yr||(Yr={}));var an;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(an||(an={}));var z;(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"})(z||(z={}));var p;(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"})(p||(p={}));const KN=new Map([[z.A,p.A],[z.ADDRESS,p.ADDRESS],[z.ANNOTATION_XML,p.ANNOTATION_XML],[z.APPLET,p.APPLET],[z.AREA,p.AREA],[z.ARTICLE,p.ARTICLE],[z.ASIDE,p.ASIDE],[z.B,p.B],[z.BASE,p.BASE],[z.BASEFONT,p.BASEFONT],[z.BGSOUND,p.BGSOUND],[z.BIG,p.BIG],[z.BLOCKQUOTE,p.BLOCKQUOTE],[z.BODY,p.BODY],[z.BR,p.BR],[z.BUTTON,p.BUTTON],[z.CAPTION,p.CAPTION],[z.CENTER,p.CENTER],[z.CODE,p.CODE],[z.COL,p.COL],[z.COLGROUP,p.COLGROUP],[z.DD,p.DD],[z.DESC,p.DESC],[z.DETAILS,p.DETAILS],[z.DIALOG,p.DIALOG],[z.DIR,p.DIR],[z.DIV,p.DIV],[z.DL,p.DL],[z.DT,p.DT],[z.EM,p.EM],[z.EMBED,p.EMBED],[z.FIELDSET,p.FIELDSET],[z.FIGCAPTION,p.FIGCAPTION],[z.FIGURE,p.FIGURE],[z.FONT,p.FONT],[z.FOOTER,p.FOOTER],[z.FOREIGN_OBJECT,p.FOREIGN_OBJECT],[z.FORM,p.FORM],[z.FRAME,p.FRAME],[z.FRAMESET,p.FRAMESET],[z.H1,p.H1],[z.H2,p.H2],[z.H3,p.H3],[z.H4,p.H4],[z.H5,p.H5],[z.H6,p.H6],[z.HEAD,p.HEAD],[z.HEADER,p.HEADER],[z.HGROUP,p.HGROUP],[z.HR,p.HR],[z.HTML,p.HTML],[z.I,p.I],[z.IMG,p.IMG],[z.IMAGE,p.IMAGE],[z.INPUT,p.INPUT],[z.IFRAME,p.IFRAME],[z.KEYGEN,p.KEYGEN],[z.LABEL,p.LABEL],[z.LI,p.LI],[z.LINK,p.LINK],[z.LISTING,p.LISTING],[z.MAIN,p.MAIN],[z.MALIGNMARK,p.MALIGNMARK],[z.MARQUEE,p.MARQUEE],[z.MATH,p.MATH],[z.MENU,p.MENU],[z.META,p.META],[z.MGLYPH,p.MGLYPH],[z.MI,p.MI],[z.MO,p.MO],[z.MN,p.MN],[z.MS,p.MS],[z.MTEXT,p.MTEXT],[z.NAV,p.NAV],[z.NOBR,p.NOBR],[z.NOFRAMES,p.NOFRAMES],[z.NOEMBED,p.NOEMBED],[z.NOSCRIPT,p.NOSCRIPT],[z.OBJECT,p.OBJECT],[z.OL,p.OL],[z.OPTGROUP,p.OPTGROUP],[z.OPTION,p.OPTION],[z.P,p.P],[z.PARAM,p.PARAM],[z.PLAINTEXT,p.PLAINTEXT],[z.PRE,p.PRE],[z.RB,p.RB],[z.RP,p.RP],[z.RT,p.RT],[z.RTC,p.RTC],[z.RUBY,p.RUBY],[z.S,p.S],[z.SCRIPT,p.SCRIPT],[z.SEARCH,p.SEARCH],[z.SECTION,p.SECTION],[z.SELECT,p.SELECT],[z.SOURCE,p.SOURCE],[z.SMALL,p.SMALL],[z.SPAN,p.SPAN],[z.STRIKE,p.STRIKE],[z.STRONG,p.STRONG],[z.STYLE,p.STYLE],[z.SUB,p.SUB],[z.SUMMARY,p.SUMMARY],[z.SUP,p.SUP],[z.TABLE,p.TABLE],[z.TBODY,p.TBODY],[z.TEMPLATE,p.TEMPLATE],[z.TEXTAREA,p.TEXTAREA],[z.TFOOT,p.TFOOT],[z.TD,p.TD],[z.TH,p.TH],[z.THEAD,p.THEAD],[z.TITLE,p.TITLE],[z.TR,p.TR],[z.TRACK,p.TRACK],[z.TT,p.TT],[z.U,p.U],[z.UL,p.UL],[z.SVG,p.SVG],[z.VAR,p.VAR],[z.WBR,p.WBR],[z.XMP,p.XMP]]);function Bi(e){var t;return(t=KN.get(e))!==null&&t!==void 0?t:p.UNKNOWN}const re=p,XN={[Z.HTML]:new Set([re.ADDRESS,re.APPLET,re.AREA,re.ARTICLE,re.ASIDE,re.BASE,re.BASEFONT,re.BGSOUND,re.BLOCKQUOTE,re.BODY,re.BR,re.BUTTON,re.CAPTION,re.CENTER,re.COL,re.COLGROUP,re.DD,re.DETAILS,re.DIR,re.DIV,re.DL,re.DT,re.EMBED,re.FIELDSET,re.FIGCAPTION,re.FIGURE,re.FOOTER,re.FORM,re.FRAME,re.FRAMESET,re.H1,re.H2,re.H3,re.H4,re.H5,re.H6,re.HEAD,re.HEADER,re.HGROUP,re.HR,re.HTML,re.IFRAME,re.IMG,re.INPUT,re.LI,re.LINK,re.LISTING,re.MAIN,re.MARQUEE,re.MENU,re.META,re.NAV,re.NOEMBED,re.NOFRAMES,re.NOSCRIPT,re.OBJECT,re.OL,re.P,re.PARAM,re.PLAINTEXT,re.PRE,re.SCRIPT,re.SECTION,re.SELECT,re.SOURCE,re.STYLE,re.SUMMARY,re.TABLE,re.TBODY,re.TD,re.TEMPLATE,re.TEXTAREA,re.TFOOT,re.TH,re.THEAD,re.TITLE,re.TR,re.TRACK,re.UL,re.WBR,re.XMP]),[Z.MATHML]:new Set([re.MI,re.MO,re.MN,re.MS,re.MTEXT,re.ANNOTATION_XML]),[Z.SVG]:new Set([re.TITLE,re.FOREIGN_OBJECT,re.DESC]),[Z.XLINK]:new Set,[Z.XML]:new Set,[Z.XMLNS]:new Set},jc=new Set([re.H1,re.H2,re.H3,re.H4,re.H5,re.H6]);z.STYLE,z.SCRIPT,z.XMP,z.IFRAME,z.NOEMBED,z.NOFRAMES,z.PLAINTEXT;var N;(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"})(N||(N={}));const at={DATA:N.DATA,RCDATA:N.RCDATA,RAWTEXT:N.RAWTEXT,SCRIPT_DATA:N.SCRIPT_DATA,PLAINTEXT:N.PLAINTEXT,CDATA_SECTION:N.CDATA_SECTION};function JN(e){return e>=_.DIGIT_0&&e<=_.DIGIT_9}function Ma(e){return e>=_.LATIN_CAPITAL_A&&e<=_.LATIN_CAPITAL_Z}function ZN(e){return e>=_.LATIN_SMALL_A&&e<=_.LATIN_SMALL_Z}function mr(e){return ZN(e)||Ma(e)}function Um(e){return mr(e)||JN(e)}function Nu(e){return e+32}function pg(e){return e===_.SPACE||e===_.LINE_FEED||e===_.TABULATION||e===_.FORM_FEED}function jm(e){return pg(e)||e===_.SOLIDUS||e===_.GREATER_THAN_SIGN}function eA(e){return e===_.NULL?q.nullCharacterReference:e>1114111?q.characterReferenceOutsideUnicodeRange:cg(e)?q.surrogateCharacterReference:fg(e)?q.noncharacterCharacterReference:dg(e)||e===_.CARRIAGE_RETURN?q.controlCharacterReference:null}class tA{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=N.DATA,this.returnState=N.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new jN(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new QN(HN,(a,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(a)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(q.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:a=>{this._err(q.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+a)},validateNumericCharacterReference:a=>{const s=eA(a);s&&this._err(s,1)}}:void 0)}_err(t,n=0){var a,s;(s=(a=this.handler).onParseError)===null||s===void 0||s.call(a,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,a){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||a==null||a()}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:Pe.START_TAG,tagName:"",tagID:p.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Pe.END_TAG,tagName:"",tagID:p.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:Pe.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:Pe.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 a=this.currentToken;if(hg(a,this.currentAttr.name)===null){if(a.attrs.push(this.currentAttr),a.location&&this.currentLocation){const s=(t=(n=a.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(q.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=Bi(t.tagName),t.type===Pe.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(q.endTagWithAttributes),t.selfClosing&&this._err(q.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 Pe.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case Pe.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case Pe.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:Pe.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=pg(t)?Pe.WHITESPACE_CHARACTER:t===_.NULL?Pe.NULL_CHARACTER:Pe.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(Pe.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=N.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?$n.Attribute:$n.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===N.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===N.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===N.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case N.DATA:{this._stateData(t);break}case N.RCDATA:{this._stateRcdata(t);break}case N.RAWTEXT:{this._stateRawtext(t);break}case N.SCRIPT_DATA:{this._stateScriptData(t);break}case N.PLAINTEXT:{this._statePlaintext(t);break}case N.TAG_OPEN:{this._stateTagOpen(t);break}case N.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case N.TAG_NAME:{this._stateTagName(t);break}case N.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case N.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case N.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case N.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case N.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case N.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case N.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case N.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case N.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case N.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case N.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case N.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case N.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case N.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case N.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case N.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case N.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case N.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case N.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case N.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case N.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case N.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case N.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case N.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case N.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case N.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case N.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case N.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case N.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case N.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case N.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case N.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case N.BOGUS_COMMENT:{this._stateBogusComment(t);break}case N.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case N.COMMENT_START:{this._stateCommentStart(t);break}case N.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case N.COMMENT:{this._stateComment(t);break}case N.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case N.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case N.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case N.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case N.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case N.COMMENT_END:{this._stateCommentEnd(t);break}case N.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case N.DOCTYPE:{this._stateDoctype(t);break}case N.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case N.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case N.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case N.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case N.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case N.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case N.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case N.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case N.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case N.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case N.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case N.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case N.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case N.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case N.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case N.CDATA_SECTION:{this._stateCdataSection(t);break}case N.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case N.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case N.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case N.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case _.LESS_THAN_SIGN:{this.state=N.TAG_OPEN;break}case _.AMPERSAND:{this._startCharacterReference();break}case _.NULL:{this._err(q.unexpectedNullCharacter),this._emitCodePoint(t);break}case _.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case _.AMPERSAND:{this._startCharacterReference();break}case _.LESS_THAN_SIGN:{this.state=N.RCDATA_LESS_THAN_SIGN;break}case _.NULL:{this._err(q.unexpectedNullCharacter),this._emitChars(Je);break}case _.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case _.LESS_THAN_SIGN:{this.state=N.RAWTEXT_LESS_THAN_SIGN;break}case _.NULL:{this._err(q.unexpectedNullCharacter),this._emitChars(Je);break}case _.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case _.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_LESS_THAN_SIGN;break}case _.NULL:{this._err(q.unexpectedNullCharacter),this._emitChars(Je);break}case _.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case _.NULL:{this._err(q.unexpectedNullCharacter),this._emitChars(Je);break}case _.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(mr(t))this._createStartTagToken(),this.state=N.TAG_NAME,this._stateTagName(t);else switch(t){case _.EXCLAMATION_MARK:{this.state=N.MARKUP_DECLARATION_OPEN;break}case _.SOLIDUS:{this.state=N.END_TAG_OPEN;break}case _.QUESTION_MARK:{this._err(q.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=N.BOGUS_COMMENT,this._stateBogusComment(t);break}case _.EOF:{this._err(q.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(q.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=N.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(mr(t))this._createEndTagToken(),this.state=N.TAG_NAME,this._stateTagName(t);else switch(t){case _.GREATER_THAN_SIGN:{this._err(q.missingEndTagName),this.state=N.DATA;break}case _.EOF:{this._err(q.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(q.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=N.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:{this.state=N.BEFORE_ATTRIBUTE_NAME;break}case _.SOLIDUS:{this.state=N.SELF_CLOSING_START_TAG;break}case _.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentTagToken();break}case _.NULL:{this._err(q.unexpectedNullCharacter),n.tagName+=Je;break}case _.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Ma(t)?Nu(t):t)}}_stateRcdataLessThanSign(t){t===_.SOLIDUS?this.state=N.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=N.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){mr(t)?(this.state=N.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=N.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 _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=N.BEFORE_ATTRIBUTE_NAME,!1;case _.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=N.SELF_CLOSING_START_TAG,!1;case _.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=N.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=N.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===_.SOLIDUS?this.state=N.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=N.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){mr(t)?(this.state=N.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=N.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=N.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case _.SOLIDUS:{this.state=N.SCRIPT_DATA_END_TAG_OPEN;break}case _.EXCLAMATION_MARK:{this.state=N.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=N.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){mr(t)?(this.state=N.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=N.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=N.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===_.HYPHEN_MINUS?(this.state=N.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=N.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===_.HYPHEN_MINUS?(this.state=N.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=N.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case _.HYPHEN_MINUS:{this.state=N.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case _.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case _.NULL:{this._err(q.unexpectedNullCharacter),this._emitChars(Je);break}case _.EOF:{this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case _.HYPHEN_MINUS:{this.state=N.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case _.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case _.NULL:{this._err(q.unexpectedNullCharacter),this.state=N.SCRIPT_DATA_ESCAPED,this._emitChars(Je);break}case _.EOF:{this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=N.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case _.HYPHEN_MINUS:{this._emitChars("-");break}case _.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case _.GREATER_THAN_SIGN:{this.state=N.SCRIPT_DATA,this._emitChars(">");break}case _.NULL:{this._err(q.unexpectedNullCharacter),this.state=N.SCRIPT_DATA_ESCAPED,this._emitChars(Je);break}case _.EOF:{this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=N.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===_.SOLIDUS?this.state=N.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:mr(t)?(this._emitChars("<"),this.state=N.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=N.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){mr(t)?(this.state=N.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=N.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=N.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Ut.SCRIPT,!1)&&jm(this.preprocessor.peek(Ut.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Ut.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=N.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case _.HYPHEN_MINUS:{this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case _.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case _.NULL:{this._err(q.unexpectedNullCharacter),this._emitChars(Je);break}case _.EOF:{this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case _.HYPHEN_MINUS:{this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case _.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case _.NULL:{this._err(q.unexpectedNullCharacter),this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Je);break}case _.EOF:{this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case _.HYPHEN_MINUS:{this._emitChars("-");break}case _.LESS_THAN_SIGN:{this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case _.GREATER_THAN_SIGN:{this.state=N.SCRIPT_DATA,this._emitChars(">");break}case _.NULL:{this._err(q.unexpectedNullCharacter),this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Je);break}case _.EOF:{this._err(q.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===_.SOLIDUS?(this.state=N.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Ut.SCRIPT,!1)&&jm(this.preprocessor.peek(Ut.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Ut.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=N.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=N.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:break;case _.SOLIDUS:case _.GREATER_THAN_SIGN:case _.EOF:{this.state=N.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case _.EQUALS_SIGN:{this._err(q.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=N.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=N.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:case _.SOLIDUS:case _.GREATER_THAN_SIGN:case _.EOF:{this._leaveAttrName(),this.state=N.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case _.EQUALS_SIGN:{this._leaveAttrName(),this.state=N.BEFORE_ATTRIBUTE_VALUE;break}case _.QUOTATION_MARK:case _.APOSTROPHE:case _.LESS_THAN_SIGN:{this._err(q.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case _.NULL:{this._err(q.unexpectedNullCharacter),this.currentAttr.name+=Je;break}default:this.currentAttr.name+=String.fromCodePoint(Ma(t)?Nu(t):t)}}_stateAfterAttributeName(t){switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:break;case _.SOLIDUS:{this.state=N.SELF_CLOSING_START_TAG;break}case _.EQUALS_SIGN:{this.state=N.BEFORE_ATTRIBUTE_VALUE;break}case _.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentTagToken();break}case _.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=N.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:break;case _.QUOTATION_MARK:{this.state=N.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case _.APOSTROPHE:{this.state=N.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case _.GREATER_THAN_SIGN:{this._err(q.missingAttributeValue),this.state=N.DATA,this.emitCurrentTagToken();break}default:this.state=N.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case _.QUOTATION_MARK:{this.state=N.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case _.AMPERSAND:{this._startCharacterReference();break}case _.NULL:{this._err(q.unexpectedNullCharacter),this.currentAttr.value+=Je;break}case _.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case _.APOSTROPHE:{this.state=N.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case _.AMPERSAND:{this._startCharacterReference();break}case _.NULL:{this._err(q.unexpectedNullCharacter),this.currentAttr.value+=Je;break}case _.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:{this._leaveAttrValue(),this.state=N.BEFORE_ATTRIBUTE_NAME;break}case _.AMPERSAND:{this._startCharacterReference();break}case _.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=N.DATA,this.emitCurrentTagToken();break}case _.NULL:{this._err(q.unexpectedNullCharacter),this.currentAttr.value+=Je;break}case _.QUOTATION_MARK:case _.APOSTROPHE:case _.LESS_THAN_SIGN:case _.EQUALS_SIGN:case _.GRAVE_ACCENT:{this._err(q.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case _.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:{this._leaveAttrValue(),this.state=N.BEFORE_ATTRIBUTE_NAME;break}case _.SOLIDUS:{this._leaveAttrValue(),this.state=N.SELF_CLOSING_START_TAG;break}case _.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=N.DATA,this.emitCurrentTagToken();break}case _.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:this._err(q.missingWhitespaceBetweenAttributes),this.state=N.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case _.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=N.DATA,this.emitCurrentTagToken();break}case _.EOF:{this._err(q.eofInTag),this._emitEOFToken();break}default:this._err(q.unexpectedSolidusInTag),this.state=N.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case _.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentComment(n);break}case _.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case _.NULL:{this._err(q.unexpectedNullCharacter),n.data+=Je;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Ut.DASH_DASH,!0)?(this._createCommentToken(Ut.DASH_DASH.length+1),this.state=N.COMMENT_START):this._consumeSequenceIfMatch(Ut.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Ut.DOCTYPE.length+1),this.state=N.DOCTYPE):this._consumeSequenceIfMatch(Ut.CDATA_START,!0)?this.inForeignNode?this.state=N.CDATA_SECTION:(this._err(q.cdataInHtmlContent),this._createCommentToken(Ut.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=N.BOGUS_COMMENT):this._ensureHibernation()||(this._err(q.incorrectlyOpenedComment),this._createCommentToken(2),this.state=N.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case _.HYPHEN_MINUS:{this.state=N.COMMENT_START_DASH;break}case _.GREATER_THAN_SIGN:{this._err(q.abruptClosingOfEmptyComment),this.state=N.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=N.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case _.HYPHEN_MINUS:{this.state=N.COMMENT_END;break}case _.GREATER_THAN_SIGN:{this._err(q.abruptClosingOfEmptyComment),this.state=N.DATA,this.emitCurrentComment(n);break}case _.EOF:{this._err(q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=N.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case _.HYPHEN_MINUS:{this.state=N.COMMENT_END_DASH;break}case _.LESS_THAN_SIGN:{n.data+="<",this.state=N.COMMENT_LESS_THAN_SIGN;break}case _.NULL:{this._err(q.unexpectedNullCharacter),n.data+=Je;break}case _.EOF:{this._err(q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case _.EXCLAMATION_MARK:{n.data+="!",this.state=N.COMMENT_LESS_THAN_SIGN_BANG;break}case _.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=N.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===_.HYPHEN_MINUS?this.state=N.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=N.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===_.HYPHEN_MINUS?this.state=N.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=N.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==_.GREATER_THAN_SIGN&&t!==_.EOF&&this._err(q.nestedComment),this.state=N.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case _.HYPHEN_MINUS:{this.state=N.COMMENT_END;break}case _.EOF:{this._err(q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=N.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case _.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentComment(n);break}case _.EXCLAMATION_MARK:{this.state=N.COMMENT_END_BANG;break}case _.HYPHEN_MINUS:{n.data+="-";break}case _.EOF:{this._err(q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=N.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case _.HYPHEN_MINUS:{n.data+="--!",this.state=N.COMMENT_END_DASH;break}case _.GREATER_THAN_SIGN:{this._err(q.incorrectlyClosedComment),this.state=N.DATA,this.emitCurrentComment(n);break}case _.EOF:{this._err(q.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=N.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:{this.state=N.BEFORE_DOCTYPE_NAME;break}case _.GREATER_THAN_SIGN:{this.state=N.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case _.EOF:{this._err(q.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingWhitespaceBeforeDoctypeName),this.state=N.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Ma(t))this._createDoctypeToken(String.fromCharCode(Nu(t))),this.state=N.DOCTYPE_NAME;else switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:break;case _.NULL:{this._err(q.unexpectedNullCharacter),this._createDoctypeToken(Je),this.state=N.DOCTYPE_NAME;break}case _.GREATER_THAN_SIGN:{this._err(q.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=N.DATA;break}case _.EOF:{this._err(q.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=N.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:{this.state=N.AFTER_DOCTYPE_NAME;break}case _.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentDoctype(n);break}case _.NULL:{this._err(q.unexpectedNullCharacter),n.name+=Je;break}case _.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Ma(t)?Nu(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:break;case _.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentDoctype(n);break}case _.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Ut.PUBLIC,!1)?this.state=N.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Ut.SYSTEM,!1)?this.state=N.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(q.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:{this.state=N.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case _.QUOTATION_MARK:{this._err(q.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=N.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case _.APOSTROPHE:{this._err(q.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=N.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case _.GREATER_THAN_SIGN:{this._err(q.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=N.DATA,this.emitCurrentDoctype(n);break}case _.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:break;case _.QUOTATION_MARK:{n.publicId="",this.state=N.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case _.APOSTROPHE:{n.publicId="",this.state=N.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case _.GREATER_THAN_SIGN:{this._err(q.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=N.DATA,this.emitCurrentDoctype(n);break}case _.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case _.QUOTATION_MARK:{this.state=N.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case _.NULL:{this._err(q.unexpectedNullCharacter),n.publicId+=Je;break}case _.GREATER_THAN_SIGN:{this._err(q.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=N.DATA;break}case _.EOF:{this._err(q.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 _.APOSTROPHE:{this.state=N.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case _.NULL:{this._err(q.unexpectedNullCharacter),n.publicId+=Je;break}case _.GREATER_THAN_SIGN:{this._err(q.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=N.DATA;break}case _.EOF:{this._err(q.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 _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:{this.state=N.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case _.GREATER_THAN_SIGN:{this.state=N.DATA,this.emitCurrentDoctype(n);break}case _.QUOTATION_MARK:{this._err(q.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case _.APOSTROPHE:{this._err(q.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case _.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:break;case _.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=N.DATA;break}case _.QUOTATION_MARK:{n.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case _.APOSTROPHE:{n.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case _.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:{this.state=N.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case _.QUOTATION_MARK:{this._err(q.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case _.APOSTROPHE:{this._err(q.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case _.GREATER_THAN_SIGN:{this._err(q.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=N.DATA,this.emitCurrentDoctype(n);break}case _.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:break;case _.QUOTATION_MARK:{n.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case _.APOSTROPHE:{n.systemId="",this.state=N.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case _.GREATER_THAN_SIGN:{this._err(q.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=N.DATA,this.emitCurrentDoctype(n);break}case _.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case _.QUOTATION_MARK:{this.state=N.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case _.NULL:{this._err(q.unexpectedNullCharacter),n.systemId+=Je;break}case _.GREATER_THAN_SIGN:{this._err(q.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=N.DATA;break}case _.EOF:{this._err(q.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 _.APOSTROPHE:{this.state=N.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case _.NULL:{this._err(q.unexpectedNullCharacter),n.systemId+=Je;break}case _.GREATER_THAN_SIGN:{this._err(q.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=N.DATA;break}case _.EOF:{this._err(q.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 _.SPACE:case _.LINE_FEED:case _.TABULATION:case _.FORM_FEED:break;case _.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=N.DATA;break}case _.EOF:{this._err(q.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(q.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=N.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case _.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=N.DATA;break}case _.NULL:{this._err(q.unexpectedNullCharacter);break}case _.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case _.RIGHT_SQUARE_BRACKET:{this.state=N.CDATA_SECTION_BRACKET;break}case _.EOF:{this._err(q.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===_.RIGHT_SQUARE_BRACKET?this.state=N.CDATA_SECTION_END:(this._emitChars("]"),this.state=N.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case _.GREATER_THAN_SIGN:{this.state=N.DATA;break}case _.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=N.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(_.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Um(this.preprocessor.peek(1))?N.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){Um(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===_.SEMICOLON&&this._err(q.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const mg=new Set([p.DD,p.DT,p.LI,p.OPTGROUP,p.OPTION,p.P,p.RB,p.RP,p.RT,p.RTC]),Hm=new Set([...mg,p.CAPTION,p.COLGROUP,p.TBODY,p.TD,p.TFOOT,p.TH,p.THEAD,p.TR]),Fu=new Set([p.APPLET,p.CAPTION,p.HTML,p.MARQUEE,p.OBJECT,p.TABLE,p.TD,p.TEMPLATE,p.TH]),nA=new Set([...Fu,p.OL,p.UL]),rA=new Set([...Fu,p.BUTTON]),zm=new Set([p.ANNOTATION_XML,p.MI,p.MN,p.MO,p.MS,p.MTEXT]),$m=new Set([p.DESC,p.FOREIGN_OBJECT,p.TITLE]),iA=new Set([p.TR,p.TEMPLATE,p.HTML]),aA=new Set([p.TBODY,p.TFOOT,p.THEAD,p.TEMPLATE,p.HTML]),sA=new Set([p.TABLE,p.TEMPLATE,p.HTML]),uA=new Set([p.TD,p.TH]);class oA{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,a){this.treeAdapter=n,this.handler=a,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=p.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===p.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===Z.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 a=this._indexOf(t);this.items[a]=n,a===this.stackTop&&(this.current=n)}insertAfter(t,n,a){const s=this._indexOf(t)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,a),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===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])!==Z.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 a=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(a,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(jc,Z.HTML)}popUntilTableCellPopped(){this.popUntilPopped(uA,Z.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let a=this.stackTop;a>=0;a--)if(t.has(this.tagIDs[a])&&this.treeAdapter.getNamespaceURI(this.items[a])===n)return a;return-1}clearBackTo(t,n){const a=this._indexOfTagNames(t,n);this.shortenToLength(a+1)}clearBackToTableContext(){this.clearBackTo(sA,Z.HTML)}clearBackToTableBodyContext(){this.clearBackTo(aA,Z.HTML)}clearBackToTableRowContext(){this.clearBackTo(iA,Z.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]===p.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]===p.HTML}hasInDynamicScope(t,n){for(let a=this.stackTop;a>=0;a--){const s=this.tagIDs[a];switch(this.treeAdapter.getNamespaceURI(this.items[a])){case Z.HTML:{if(s===t)return!0;if(n.has(s))return!1;break}case Z.SVG:{if($m.has(s))return!1;break}case Z.MATHML:{if(zm.has(s))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Fu)}hasInListItemScope(t){return this.hasInDynamicScope(t,nA)}hasInButtonScope(t){return this.hasInDynamicScope(t,rA)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case Z.HTML:{if(jc.has(n))return!0;if(Fu.has(n))return!1;break}case Z.SVG:{if($m.has(n))return!1;break}case Z.MATHML:{if(zm.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Z.HTML)switch(this.tagIDs[n]){case t:return!0;case p.TABLE:case p.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===Z.HTML)switch(this.tagIDs[t]){case p.TBODY:case p.THEAD:case p.TFOOT:return!0;case p.TABLE:case p.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===Z.HTML)switch(this.tagIDs[n]){case t:return!0;case p.OPTION:case p.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&mg.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Hm.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Hm.has(this.currentTagId);)this.pop()}}const Tc=3;var wn;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(wn||(wn={}));const Wm={type:wn.Marker};class lA{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const a=[],s=n.length,o=this.treeAdapter.getTagName(t),l=this.treeAdapter.getNamespaceURI(t);for(let d=0;d<this.entries.length;d++){const f=this.entries[d];if(f.type===wn.Marker)break;const{element:h}=f;if(this.treeAdapter.getTagName(h)===o&&this.treeAdapter.getNamespaceURI(h)===l){const E=this.treeAdapter.getAttrList(h);E.length===s&&a.push({idx:d,attrs:E})}}return a}_ensureNoahArkCondition(t){if(this.entries.length<Tc)return;const n=this.treeAdapter.getAttrList(t),a=this._getNoahArkConditionCandidates(t,n);if(a.length<Tc)return;const s=new Map(n.map(l=>[l.name,l.value]));let o=0;for(let l=0;l<a.length;l++){const d=a[l];d.attrs.every(f=>s.get(f.name)===f.value)&&(o+=1,o>=Tc&&this.entries.splice(d.idx,1))}}insertMarker(){this.entries.unshift(Wm)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:wn.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const a=this.entries.indexOf(this.bookmark);this.entries.splice(a,0,{type:wn.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(Wm);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(a=>a.type===wn.Marker||this.treeAdapter.getTagName(a.element)===t);return n&&n.type===wn.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===wn.Element&&n.element===t)}}const gr={createDocument(){return{nodeName:"#document",mode:an.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 a=e.childNodes.indexOf(n);e.childNodes.splice(a,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,a){const s=e.childNodes.find(o=>o.nodeName==="#documentType");if(s)s.name=t,s.publicId=n,s.systemId=a;else{const o={nodeName:"#documentType",name:t,publicId:n,systemId:a,parentNode:null};gr.appendChild(e,o)}},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(gr.isTextNode(n)){n.value+=t;return}}gr.appendChild(e,gr.createTextNode(t))},insertTextBefore(e,t,n){const a=e.childNodes[e.childNodes.indexOf(n)-1];a&&gr.isTextNode(a)?a.value+=t:gr.insertBefore(e,gr.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(a=>a.name));for(let a=0;a<t.length;a++)n.has(t[a].name)||e.attrs.push(t[a])},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}}},gg="html",cA="about:legacy-compat",dA="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Eg=["+//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//"],fA=[...Eg,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],hA=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Tg=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],pA=[...Tg,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Ym(e,t){return t.some(n=>e.startsWith(n))}function mA(e){return e.name===gg&&e.publicId===null&&(e.systemId===null||e.systemId===cA)}function gA(e){if(e.name!==gg)return an.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===dA)return an.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),hA.has(n))return an.QUIRKS;let a=t===null?fA:Eg;if(Ym(n,a))return an.QUIRKS;if(a=t===null?Tg:pA,Ym(n,a))return an.LIMITED_QUIRKS}return an.NO_QUIRKS}const Vm={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},EA="definitionurl",TA="definitionURL",yA=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])),xA=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:Z.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:Z.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:Z.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:Z.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:Z.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:Z.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:Z.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:Z.XML}],["xml:space",{prefix:"xml",name:"space",namespace:Z.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:Z.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:Z.XMLNS}]]),bA=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])),kA=new Set([p.B,p.BIG,p.BLOCKQUOTE,p.BODY,p.BR,p.CENTER,p.CODE,p.DD,p.DIV,p.DL,p.DT,p.EM,p.EMBED,p.H1,p.H2,p.H3,p.H4,p.H5,p.H6,p.HEAD,p.HR,p.I,p.IMG,p.LI,p.LISTING,p.MENU,p.META,p.NOBR,p.OL,p.P,p.PRE,p.RUBY,p.S,p.SMALL,p.SPAN,p.STRONG,p.STRIKE,p.SUB,p.SUP,p.TABLE,p.TT,p.U,p.UL,p.VAR]);function CA(e){const t=e.tagID;return t===p.FONT&&e.attrs.some(({name:a})=>a===Yr.COLOR||a===Yr.SIZE||a===Yr.FACE)||kA.has(t)}function yg(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===EA){e.attrs[t].name=TA;break}}function xg(e){for(let t=0;t<e.attrs.length;t++){const n=yA.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Sd(e){for(let t=0;t<e.attrs.length;t++){const n=xA.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 _A(e){const t=bA.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Bi(e.tagName))}function SA(e,t){return t===Z.MATHML&&(e===p.MI||e===p.MO||e===p.MN||e===p.MS||e===p.MTEXT)}function NA(e,t,n){if(t===Z.MATHML&&e===p.ANNOTATION_XML){for(let a=0;a<n.length;a++)if(n[a].name===Yr.ENCODING){const s=n[a].value.toLowerCase();return s===Vm.TEXT_HTML||s===Vm.APPLICATION_XML}}return t===Z.SVG&&(e===p.FOREIGN_OBJECT||e===p.DESC||e===p.TITLE)}function AA(e,t,n,a){return(!a||a===Z.HTML)&&NA(e,t,n)||(!a||a===Z.MATHML)&&SA(e,t)}const vA="hidden",wA=8,IA=3;var L;(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"})(L||(L={}));const LA={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},bg=new Set([p.TABLE,p.TBODY,p.TFOOT,p.THEAD,p.TR]),qm={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:gr,onParseError:null};class Qm{constructor(t,n,a=null,s=null){this.fragmentContext=a,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=L.INITIAL,this.originalInsertionMode=L.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={...qm,...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 tA(this.options,this),this.activeFormattingElements=new lA(this.treeAdapter),this.fragmentContextID=a?Bi(this.treeAdapter.getTagName(a)):p.UNKNOWN,this._setContextModes(a??this.document,this.fragmentContextID),this.openElements=new oA(this.document,this.treeAdapter,this)}static parse(t,n){const a=new this(n);return a.tokenizer.write(t,!0),a.document}static getFragmentParser(t,n){const a={...qm,...n};t??(t=a.treeAdapter.createElement(z.TEMPLATE,Z.HTML,[]));const s=a.treeAdapter.createElement("documentmock",Z.HTML,[]),o=new this(a,s,t);return o.fragmentContextID===p.TEMPLATE&&o.tmplInsertionModeStack.unshift(L.IN_TEMPLATE),o._initTokenizerForFragmentParsing(),o._insertFakeRootElement(),o._resetInsertionMode(),o._findFormInFragmentContext(),o}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,a){var s;if(!this.onParseError)return;const o=(s=t.location)!==null&&s!==void 0?s:LA,l={code:n,startLine:o.startLine,startCol:o.startCol,startOffset:o.startOffset,endLine:a?o.startLine:o.endLine,endCol:a?o.startCol:o.endCol,endOffset:a?o.startOffset:o.endOffset};this.onParseError(l)}onItemPush(t,n,a){var s,o;(o=(s=this.treeAdapter).onItemPush)===null||o===void 0||o.call(s,t),a&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var a,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(s=(a=this.treeAdapter).onItemPop)===null||s===void 0||s.call(a,t,this.openElements.current),n){let o,l;this.openElements.stackTop===0&&this.fragmentContext?(o=this.fragmentContext,l=this.fragmentContextID):{current:o,currentTagId:l}=this.openElements,this._setContextModes(o,l)}}_setContextModes(t,n){const a=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===Z.HTML;this.currentNotInHTML=!a,this.tokenizer.inForeignNode=!a&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,Z.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=L.TEXT}switchToPlaintextParsing(){this.insertionMode=L.TEXT,this.originalInsertionMode=L.IN_BODY,this.tokenizer.state=at.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)===z.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==Z.HTML))switch(this.fragmentContextID){case p.TITLE:case p.TEXTAREA:{this.tokenizer.state=at.RCDATA;break}case p.STYLE:case p.XMP:case p.IFRAME:case p.NOEMBED:case p.NOFRAMES:case p.NOSCRIPT:{this.tokenizer.state=at.RAWTEXT;break}case p.SCRIPT:{this.tokenizer.state=at.SCRIPT_DATA;break}case p.PLAINTEXT:{this.tokenizer.state=at.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",a=t.publicId||"",s=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,a,s),t.location){const l=this.treeAdapter.getChildNodes(this.document).find(d=>this.treeAdapter.isDocumentTypeNode(d));l&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const a=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,a)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const a=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(a??this.document,t)}}_appendElement(t,n){const a=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(a,t.location)}_insertElement(t,n){const a=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(a,t.location),this.openElements.push(a,t.tagID)}_insertFakeElement(t,n){const a=this.treeAdapter.createElement(t,Z.HTML,[]);this._attachElementToTree(a,null),this.openElements.push(a,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,Z.HTML,t.attrs),a=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,a),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(z.HTML,Z.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,p.HTML)}_appendCommentNode(t,n){const a=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,a),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,t.location)}_insertCharacters(t){let n,a;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:a}=this._findFosterParentingLocation(),a?this.treeAdapter.insertTextBefore(n,t.chars,a):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const s=this.treeAdapter.getChildNodes(n),o=a?s.lastIndexOf(a):s.length,l=s[o-1];if(this.treeAdapter.getNodeSourceCodeLocation(l)){const{endLine:f,endCol:h,endOffset:E}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(l,{endLine:f,endCol:h,endOffset:E})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(l,t.location)}_adoptNodes(t,n){for(let a=this.treeAdapter.getFirstChild(t);a;a=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(a),this.treeAdapter.appendChild(n,a)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const a=n.location,s=this.treeAdapter.getTagName(t),o=n.type===Pe.END_TAG&&s===n.tagName?{endTag:{...a},endLine:a.endLine,endCol:a.endCol,endOffset:a.endOffset}:{endLine:a.startLine,endCol:a.startCol,endOffset:a.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,o)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,a;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,a=this.fragmentContextID):{current:n,currentTagId:a}=this.openElements,t.tagID===p.SVG&&this.treeAdapter.getTagName(n)===z.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===Z.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===p.MGLYPH||t.tagID===p.MALIGNMARK)&&a!==void 0&&!this._isIntegrationPoint(a,n,Z.HTML)}_processToken(t){switch(t.type){case Pe.CHARACTER:{this.onCharacter(t);break}case Pe.NULL_CHARACTER:{this.onNullCharacter(t);break}case Pe.COMMENT:{this.onComment(t);break}case Pe.DOCTYPE:{this.onDoctype(t);break}case Pe.START_TAG:{this._processStartTag(t);break}case Pe.END_TAG:{this.onEndTag(t);break}case Pe.EOF:{this.onEof(t);break}case Pe.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,a){const s=this.treeAdapter.getNamespaceURI(n),o=this.treeAdapter.getAttrList(n);return AA(t,s,o,a)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===wn.Marker||this.openElements.contains(s.element)),a=n===-1?t-1:n-1;for(let s=a;s>=0;s--){const o=this.activeFormattingElements.entries[s];this._insertElement(o.token,this.treeAdapter.getNamespaceURI(o.element)),o.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=L.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(p.P),this.openElements.popUntilTagNamePopped(p.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case p.TR:{this.insertionMode=L.IN_ROW;return}case p.TBODY:case p.THEAD:case p.TFOOT:{this.insertionMode=L.IN_TABLE_BODY;return}case p.CAPTION:{this.insertionMode=L.IN_CAPTION;return}case p.COLGROUP:{this.insertionMode=L.IN_COLUMN_GROUP;return}case p.TABLE:{this.insertionMode=L.IN_TABLE;return}case p.BODY:{this.insertionMode=L.IN_BODY;return}case p.FRAMESET:{this.insertionMode=L.IN_FRAMESET;return}case p.SELECT:{this._resetInsertionModeForSelect(t);return}case p.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case p.HTML:{this.insertionMode=this.headElement?L.AFTER_HEAD:L.BEFORE_HEAD;return}case p.TD:case p.TH:{if(t>0){this.insertionMode=L.IN_CELL;return}break}case p.HEAD:{if(t>0){this.insertionMode=L.IN_HEAD;return}break}}this.insertionMode=L.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const a=this.openElements.tagIDs[n];if(a===p.TEMPLATE)break;if(a===p.TABLE){this.insertionMode=L.IN_SELECT_IN_TABLE;return}}this.insertionMode=L.IN_SELECT}_isElementCausesFosterParenting(t){return bg.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 p.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===Z.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case p.TABLE:{const a=this.treeAdapter.getParentNode(n);return a?{parent:a,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 a=this.treeAdapter.getNamespaceURI(t);return XN[a].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){uw(this,t);return}switch(this.insertionMode){case L.INITIAL:{Oa(this,t);break}case L.BEFORE_HTML:{ja(this,t);break}case L.BEFORE_HEAD:{Ha(this,t);break}case L.IN_HEAD:{za(this,t);break}case L.IN_HEAD_NO_SCRIPT:{$a(this,t);break}case L.AFTER_HEAD:{Wa(this,t);break}case L.IN_BODY:case L.IN_CAPTION:case L.IN_CELL:case L.IN_TEMPLATE:{Cg(this,t);break}case L.TEXT:case L.IN_SELECT:case L.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case L.IN_TABLE:case L.IN_TABLE_BODY:case L.IN_ROW:{yc(this,t);break}case L.IN_TABLE_TEXT:{wg(this,t);break}case L.IN_COLUMN_GROUP:{Bu(this,t);break}case L.AFTER_BODY:{Uu(this,t);break}case L.AFTER_AFTER_BODY:{Ru(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){sw(this,t);return}switch(this.insertionMode){case L.INITIAL:{Oa(this,t);break}case L.BEFORE_HTML:{ja(this,t);break}case L.BEFORE_HEAD:{Ha(this,t);break}case L.IN_HEAD:{za(this,t);break}case L.IN_HEAD_NO_SCRIPT:{$a(this,t);break}case L.AFTER_HEAD:{Wa(this,t);break}case L.TEXT:{this._insertCharacters(t);break}case L.IN_TABLE:case L.IN_TABLE_BODY:case L.IN_ROW:{yc(this,t);break}case L.IN_COLUMN_GROUP:{Bu(this,t);break}case L.AFTER_BODY:{Uu(this,t);break}case L.AFTER_AFTER_BODY:{Ru(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Hc(this,t);return}switch(this.insertionMode){case L.INITIAL:case L.BEFORE_HTML:case L.BEFORE_HEAD:case L.IN_HEAD:case L.IN_HEAD_NO_SCRIPT:case L.AFTER_HEAD:case L.IN_BODY:case L.IN_TABLE:case L.IN_CAPTION:case L.IN_COLUMN_GROUP:case L.IN_TABLE_BODY:case L.IN_ROW:case L.IN_CELL:case L.IN_SELECT:case L.IN_SELECT_IN_TABLE:case L.IN_TEMPLATE:case L.IN_FRAMESET:case L.AFTER_FRAMESET:{Hc(this,t);break}case L.IN_TABLE_TEXT:{Da(this,t);break}case L.AFTER_BODY:{BA(this,t);break}case L.AFTER_AFTER_BODY:case L.AFTER_AFTER_FRAMESET:{UA(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case L.INITIAL:{jA(this,t);break}case L.BEFORE_HEAD:case L.IN_HEAD:case L.IN_HEAD_NO_SCRIPT:case L.AFTER_HEAD:{this._err(t,q.misplacedDoctype);break}case L.IN_TABLE_TEXT:{Da(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,q.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?ow(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case L.INITIAL:{Oa(this,t);break}case L.BEFORE_HTML:{HA(this,t);break}case L.BEFORE_HEAD:{$A(this,t);break}case L.IN_HEAD:{bn(this,t);break}case L.IN_HEAD_NO_SCRIPT:{VA(this,t);break}case L.AFTER_HEAD:{QA(this,t);break}case L.IN_BODY:{wt(this,t);break}case L.IN_TABLE:{Ri(this,t);break}case L.IN_TABLE_TEXT:{Da(this,t);break}case L.IN_CAPTION:{Wv(this,t);break}case L.IN_COLUMN_GROUP:{vd(this,t);break}case L.IN_TABLE_BODY:{no(this,t);break}case L.IN_ROW:{ro(this,t);break}case L.IN_CELL:{qv(this,t);break}case L.IN_SELECT:{Rg(this,t);break}case L.IN_SELECT_IN_TABLE:{Gv(this,t);break}case L.IN_TEMPLATE:{Xv(this,t);break}case L.AFTER_BODY:{Zv(this,t);break}case L.IN_FRAMESET:{ew(this,t);break}case L.AFTER_FRAMESET:{nw(this,t);break}case L.AFTER_AFTER_BODY:{iw(this,t);break}case L.AFTER_AFTER_FRAMESET:{aw(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?lw(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case L.INITIAL:{Oa(this,t);break}case L.BEFORE_HTML:{zA(this,t);break}case L.BEFORE_HEAD:{WA(this,t);break}case L.IN_HEAD:{YA(this,t);break}case L.IN_HEAD_NO_SCRIPT:{qA(this,t);break}case L.AFTER_HEAD:{GA(this,t);break}case L.IN_BODY:{to(this,t);break}case L.TEXT:{Dv(this,t);break}case L.IN_TABLE:{Ka(this,t);break}case L.IN_TABLE_TEXT:{Da(this,t);break}case L.IN_CAPTION:{Yv(this,t);break}case L.IN_COLUMN_GROUP:{Vv(this,t);break}case L.IN_TABLE_BODY:{zc(this,t);break}case L.IN_ROW:{Lg(this,t);break}case L.IN_CELL:{Qv(this,t);break}case L.IN_SELECT:{Og(this,t);break}case L.IN_SELECT_IN_TABLE:{Kv(this,t);break}case L.IN_TEMPLATE:{Jv(this,t);break}case L.AFTER_BODY:{Pg(this,t);break}case L.IN_FRAMESET:{tw(this,t);break}case L.AFTER_FRAMESET:{rw(this,t);break}case L.AFTER_AFTER_BODY:{Ru(this,t);break}}}onEof(t){switch(this.insertionMode){case L.INITIAL:{Oa(this,t);break}case L.BEFORE_HTML:{ja(this,t);break}case L.BEFORE_HEAD:{Ha(this,t);break}case L.IN_HEAD:{za(this,t);break}case L.IN_HEAD_NO_SCRIPT:{$a(this,t);break}case L.AFTER_HEAD:{Wa(this,t);break}case L.IN_BODY:case L.IN_TABLE:case L.IN_CAPTION:case L.IN_COLUMN_GROUP:case L.IN_TABLE_BODY:case L.IN_ROW:case L.IN_CELL:case L.IN_SELECT:case L.IN_SELECT_IN_TABLE:{Ag(this,t);break}case L.TEXT:{Pv(this,t);break}case L.IN_TABLE_TEXT:{Da(this,t);break}case L.IN_TEMPLATE:{Dg(this,t);break}case L.AFTER_BODY:case L.IN_FRAMESET:case L.AFTER_FRAMESET:case L.AFTER_AFTER_BODY:case L.AFTER_AFTER_FRAMESET:{Ad(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===_.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 L.IN_HEAD:case L.IN_HEAD_NO_SCRIPT:case L.AFTER_HEAD:case L.TEXT:case L.IN_COLUMN_GROUP:case L.IN_SELECT:case L.IN_SELECT_IN_TABLE:case L.IN_FRAMESET:case L.AFTER_FRAMESET:{this._insertCharacters(t);break}case L.IN_BODY:case L.IN_CAPTION:case L.IN_CELL:case L.IN_TEMPLATE:case L.AFTER_BODY:case L.AFTER_AFTER_BODY:case L.AFTER_AFTER_FRAMESET:{kg(this,t);break}case L.IN_TABLE:case L.IN_TABLE_BODY:case L.IN_ROW:{yc(this,t);break}case L.IN_TABLE_TEXT:{vg(this,t);break}}}}function RA(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):Ng(e,t),n}function OA(e,t){let n=null,a=e.openElements.stackTop;for(;a>=0;a--){const s=e.openElements.items[a];if(s===t.element)break;e._isSpecialElement(s,e.openElements.tagIDs[a])&&(n=s)}return n||(e.openElements.shortenToLength(Math.max(a,0)),e.activeFormattingElements.removeEntry(t)),n}function DA(e,t,n){let a=t,s=e.openElements.getCommonAncestor(t);for(let o=0,l=s;l!==n;o++,l=s){s=e.openElements.getCommonAncestor(l);const d=e.activeFormattingElements.getElementEntry(l),f=d&&o>=IA;!d||f?(f&&e.activeFormattingElements.removeEntry(d),e.openElements.remove(l)):(l=PA(e,d),a===t&&(e.activeFormattingElements.bookmark=d),e.treeAdapter.detachNode(a),e.treeAdapter.appendChild(l,a),a=l)}return a}function PA(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),a=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,a),t.element=a,a}function MA(e,t,n){const a=e.treeAdapter.getTagName(t),s=Bi(a);if(e._isElementCausesFosterParenting(s))e._fosterParentElement(n);else{const o=e.treeAdapter.getNamespaceURI(t);s===p.TEMPLATE&&o===Z.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function FA(e,t,n){const a=e.treeAdapter.getNamespaceURI(n.element),{token:s}=n,o=e.treeAdapter.createElement(s.tagName,a,s.attrs);e._adoptNodes(t,o),e.treeAdapter.appendChild(t,o),e.activeFormattingElements.insertElementAfterBookmark(o,s),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,o,s.tagID)}function Nd(e,t){for(let n=0;n<wA;n++){const a=RA(e,t);if(!a)break;const s=OA(e,a);if(!s)break;e.activeFormattingElements.bookmark=a;const o=DA(e,s,a.element),l=e.openElements.getCommonAncestor(a.element);e.treeAdapter.detachNode(o),l&&MA(e,l,o),FA(e,s,a)}}function Hc(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function BA(e,t){e._appendCommentNode(t,e.openElements.items[0])}function UA(e,t){e._appendCommentNode(t,e.document)}function Ad(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let a=e.openElements.stackTop;a>=n;a--)e._setEndLocation(e.openElements.items[a],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const a=e.openElements.items[0],s=e.treeAdapter.getNodeSourceCodeLocation(a);if(s&&!s.endTag&&(e._setEndLocation(a,t),e.openElements.stackTop>=1)){const o=e.openElements.items[1],l=e.treeAdapter.getNodeSourceCodeLocation(o);l&&!l.endTag&&e._setEndLocation(o,t)}}}}function jA(e,t){e._setDocumentType(t);const n=t.forceQuirks?an.QUIRKS:gA(t);mA(t)||e._err(t,q.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=L.BEFORE_HTML}function Oa(e,t){e._err(t,q.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,an.QUIRKS),e.insertionMode=L.BEFORE_HTML,e._processToken(t)}function HA(e,t){t.tagID===p.HTML?(e._insertElement(t,Z.HTML),e.insertionMode=L.BEFORE_HEAD):ja(e,t)}function zA(e,t){const n=t.tagID;(n===p.HTML||n===p.HEAD||n===p.BODY||n===p.BR)&&ja(e,t)}function ja(e,t){e._insertFakeRootElement(),e.insertionMode=L.BEFORE_HEAD,e._processToken(t)}function $A(e,t){switch(t.tagID){case p.HTML:{wt(e,t);break}case p.HEAD:{e._insertElement(t,Z.HTML),e.headElement=e.openElements.current,e.insertionMode=L.IN_HEAD;break}default:Ha(e,t)}}function WA(e,t){const n=t.tagID;n===p.HEAD||n===p.BODY||n===p.HTML||n===p.BR?Ha(e,t):e._err(t,q.endTagWithoutMatchingOpenElement)}function Ha(e,t){e._insertFakeElement(z.HEAD,p.HEAD),e.headElement=e.openElements.current,e.insertionMode=L.IN_HEAD,e._processToken(t)}function bn(e,t){switch(t.tagID){case p.HTML:{wt(e,t);break}case p.BASE:case p.BASEFONT:case p.BGSOUND:case p.LINK:case p.META:{e._appendElement(t,Z.HTML),t.ackSelfClosing=!0;break}case p.TITLE:{e._switchToTextParsing(t,at.RCDATA);break}case p.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,at.RAWTEXT):(e._insertElement(t,Z.HTML),e.insertionMode=L.IN_HEAD_NO_SCRIPT);break}case p.NOFRAMES:case p.STYLE:{e._switchToTextParsing(t,at.RAWTEXT);break}case p.SCRIPT:{e._switchToTextParsing(t,at.SCRIPT_DATA);break}case p.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=L.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(L.IN_TEMPLATE);break}case p.HEAD:{e._err(t,q.misplacedStartTagForHeadElement);break}default:za(e,t)}}function YA(e,t){switch(t.tagID){case p.HEAD:{e.openElements.pop(),e.insertionMode=L.AFTER_HEAD;break}case p.BODY:case p.BR:case p.HTML:{za(e,t);break}case p.TEMPLATE:{Kr(e,t);break}default:e._err(t,q.endTagWithoutMatchingOpenElement)}}function Kr(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==p.TEMPLATE&&e._err(t,q.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(p.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,q.endTagWithoutMatchingOpenElement)}function za(e,t){e.openElements.pop(),e.insertionMode=L.AFTER_HEAD,e._processToken(t)}function VA(e,t){switch(t.tagID){case p.HTML:{wt(e,t);break}case p.BASEFONT:case p.BGSOUND:case p.HEAD:case p.LINK:case p.META:case p.NOFRAMES:case p.STYLE:{bn(e,t);break}case p.NOSCRIPT:{e._err(t,q.nestedNoscriptInHead);break}default:$a(e,t)}}function qA(e,t){switch(t.tagID){case p.NOSCRIPT:{e.openElements.pop(),e.insertionMode=L.IN_HEAD;break}case p.BR:{$a(e,t);break}default:e._err(t,q.endTagWithoutMatchingOpenElement)}}function $a(e,t){const n=t.type===Pe.EOF?q.openElementsLeftAfterEof:q.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=L.IN_HEAD,e._processToken(t)}function QA(e,t){switch(t.tagID){case p.HTML:{wt(e,t);break}case p.BODY:{e._insertElement(t,Z.HTML),e.framesetOk=!1,e.insertionMode=L.IN_BODY;break}case p.FRAMESET:{e._insertElement(t,Z.HTML),e.insertionMode=L.IN_FRAMESET;break}case p.BASE:case p.BASEFONT:case p.BGSOUND:case p.LINK:case p.META:case p.NOFRAMES:case p.SCRIPT:case p.STYLE:case p.TEMPLATE:case p.TITLE:{e._err(t,q.abandonedHeadElementChild),e.openElements.push(e.headElement,p.HEAD),bn(e,t),e.openElements.remove(e.headElement);break}case p.HEAD:{e._err(t,q.misplacedStartTagForHeadElement);break}default:Wa(e,t)}}function GA(e,t){switch(t.tagID){case p.BODY:case p.HTML:case p.BR:{Wa(e,t);break}case p.TEMPLATE:{Kr(e,t);break}default:e._err(t,q.endTagWithoutMatchingOpenElement)}}function Wa(e,t){e._insertFakeElement(z.BODY,p.BODY),e.insertionMode=L.IN_BODY,eo(e,t)}function eo(e,t){switch(t.type){case Pe.CHARACTER:{Cg(e,t);break}case Pe.WHITESPACE_CHARACTER:{kg(e,t);break}case Pe.COMMENT:{Hc(e,t);break}case Pe.START_TAG:{wt(e,t);break}case Pe.END_TAG:{to(e,t);break}case Pe.EOF:{Ag(e,t);break}}}function kg(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Cg(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function KA(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function XA(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function JA(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,Z.HTML),e.insertionMode=L.IN_FRAMESET)}function ZA(e,t){e.openElements.hasInButtonScope(p.P)&&e._closePElement(),e._insertElement(t,Z.HTML)}function ev(e,t){e.openElements.hasInButtonScope(p.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&jc.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,Z.HTML)}function tv(e,t){e.openElements.hasInButtonScope(p.P)&&e._closePElement(),e._insertElement(t,Z.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function nv(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(p.P)&&e._closePElement(),e._insertElement(t,Z.HTML),n||(e.formElement=e.openElements.current))}function rv(e,t){e.framesetOk=!1;const n=t.tagID;for(let a=e.openElements.stackTop;a>=0;a--){const s=e.openElements.tagIDs[a];if(n===p.LI&&s===p.LI||(n===p.DD||n===p.DT)&&(s===p.DD||s===p.DT)){e.openElements.generateImpliedEndTagsWithExclusion(s),e.openElements.popUntilTagNamePopped(s);break}if(s!==p.ADDRESS&&s!==p.DIV&&s!==p.P&&e._isSpecialElement(e.openElements.items[a],s))break}e.openElements.hasInButtonScope(p.P)&&e._closePElement(),e._insertElement(t,Z.HTML)}function iv(e,t){e.openElements.hasInButtonScope(p.P)&&e._closePElement(),e._insertElement(t,Z.HTML),e.tokenizer.state=at.PLAINTEXT}function av(e,t){e.openElements.hasInScope(p.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(p.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML),e.framesetOk=!1}function sv(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(z.A);n&&(Nd(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function uv(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function ov(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(p.NOBR)&&(Nd(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,Z.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function lv(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function cv(e,t){e.treeAdapter.getDocumentMode(e.document)!==an.QUIRKS&&e.openElements.hasInButtonScope(p.P)&&e._closePElement(),e._insertElement(t,Z.HTML),e.framesetOk=!1,e.insertionMode=L.IN_TABLE}function _g(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Z.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Sg(e){const t=hg(e,Yr.TYPE);return t!=null&&t.toLowerCase()===vA}function dv(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,Z.HTML),Sg(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function fv(e,t){e._appendElement(t,Z.HTML),t.ackSelfClosing=!0}function hv(e,t){e.openElements.hasInButtonScope(p.P)&&e._closePElement(),e._appendElement(t,Z.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function pv(e,t){t.tagName=z.IMG,t.tagID=p.IMG,_g(e,t)}function mv(e,t){e._insertElement(t,Z.HTML),e.skipNextNewLine=!0,e.tokenizer.state=at.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=L.TEXT}function gv(e,t){e.openElements.hasInButtonScope(p.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,at.RAWTEXT)}function Ev(e,t){e.framesetOk=!1,e._switchToTextParsing(t,at.RAWTEXT)}function Gm(e,t){e._switchToTextParsing(t,at.RAWTEXT)}function Tv(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===L.IN_TABLE||e.insertionMode===L.IN_CAPTION||e.insertionMode===L.IN_TABLE_BODY||e.insertionMode===L.IN_ROW||e.insertionMode===L.IN_CELL?L.IN_SELECT_IN_TABLE:L.IN_SELECT}function yv(e,t){e.openElements.currentTagId===p.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML)}function xv(e,t){e.openElements.hasInScope(p.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,Z.HTML)}function bv(e,t){e.openElements.hasInScope(p.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(p.RTC),e._insertElement(t,Z.HTML)}function kv(e,t){e._reconstructActiveFormattingElements(),yg(t),Sd(t),t.selfClosing?e._appendElement(t,Z.MATHML):e._insertElement(t,Z.MATHML),t.ackSelfClosing=!0}function Cv(e,t){e._reconstructActiveFormattingElements(),xg(t),Sd(t),t.selfClosing?e._appendElement(t,Z.SVG):e._insertElement(t,Z.SVG),t.ackSelfClosing=!0}function Km(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,Z.HTML)}function wt(e,t){switch(t.tagID){case p.I:case p.S:case p.B:case p.U:case p.EM:case p.TT:case p.BIG:case p.CODE:case p.FONT:case p.SMALL:case p.STRIKE:case p.STRONG:{uv(e,t);break}case p.A:{sv(e,t);break}case p.H1:case p.H2:case p.H3:case p.H4:case p.H5:case p.H6:{ev(e,t);break}case p.P:case p.DL:case p.OL:case p.UL:case p.DIV:case p.DIR:case p.NAV:case p.MAIN:case p.MENU:case p.ASIDE:case p.CENTER:case p.FIGURE:case p.FOOTER:case p.HEADER:case p.HGROUP:case p.DIALOG:case p.DETAILS:case p.ADDRESS:case p.ARTICLE:case p.SEARCH:case p.SECTION:case p.SUMMARY:case p.FIELDSET:case p.BLOCKQUOTE:case p.FIGCAPTION:{ZA(e,t);break}case p.LI:case p.DD:case p.DT:{rv(e,t);break}case p.BR:case p.IMG:case p.WBR:case p.AREA:case p.EMBED:case p.KEYGEN:{_g(e,t);break}case p.HR:{hv(e,t);break}case p.RB:case p.RTC:{xv(e,t);break}case p.RT:case p.RP:{bv(e,t);break}case p.PRE:case p.LISTING:{tv(e,t);break}case p.XMP:{gv(e,t);break}case p.SVG:{Cv(e,t);break}case p.HTML:{KA(e,t);break}case p.BASE:case p.LINK:case p.META:case p.STYLE:case p.TITLE:case p.SCRIPT:case p.BGSOUND:case p.BASEFONT:case p.TEMPLATE:{bn(e,t);break}case p.BODY:{XA(e,t);break}case p.FORM:{nv(e,t);break}case p.NOBR:{ov(e,t);break}case p.MATH:{kv(e,t);break}case p.TABLE:{cv(e,t);break}case p.INPUT:{dv(e,t);break}case p.PARAM:case p.TRACK:case p.SOURCE:{fv(e,t);break}case p.IMAGE:{pv(e,t);break}case p.BUTTON:{av(e,t);break}case p.APPLET:case p.OBJECT:case p.MARQUEE:{lv(e,t);break}case p.IFRAME:{Ev(e,t);break}case p.SELECT:{Tv(e,t);break}case p.OPTION:case p.OPTGROUP:{yv(e,t);break}case p.NOEMBED:case p.NOFRAMES:{Gm(e,t);break}case p.FRAMESET:{JA(e,t);break}case p.TEXTAREA:{mv(e,t);break}case p.NOSCRIPT:{e.options.scriptingEnabled?Gm(e,t):Km(e,t);break}case p.PLAINTEXT:{iv(e,t);break}case p.COL:case p.TH:case p.TD:case p.TR:case p.HEAD:case p.FRAME:case p.TBODY:case p.TFOOT:case p.THEAD:case p.CAPTION:case p.COLGROUP:break;default:Km(e,t)}}function _v(e,t){if(e.openElements.hasInScope(p.BODY)&&(e.insertionMode=L.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function Sv(e,t){e.openElements.hasInScope(p.BODY)&&(e.insertionMode=L.AFTER_BODY,Pg(e,t))}function Nv(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Av(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(p.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(p.FORM):n&&e.openElements.remove(n))}function vv(e){e.openElements.hasInButtonScope(p.P)||e._insertFakeElement(z.P,p.P),e._closePElement()}function wv(e){e.openElements.hasInListItemScope(p.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(p.LI),e.openElements.popUntilTagNamePopped(p.LI))}function Iv(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Lv(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Rv(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function Ov(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(z.BR,p.BR),e.openElements.pop(),e.framesetOk=!1}function Ng(e,t){const n=t.tagName,a=t.tagID;for(let s=e.openElements.stackTop;s>0;s--){const o=e.openElements.items[s],l=e.openElements.tagIDs[s];if(a===l&&(a!==p.UNKNOWN||e.treeAdapter.getTagName(o)===n)){e.openElements.generateImpliedEndTagsWithExclusion(a),e.openElements.stackTop>=s&&e.openElements.shortenToLength(s);break}if(e._isSpecialElement(o,l))break}}function to(e,t){switch(t.tagID){case p.A:case p.B:case p.I:case p.S:case p.U:case p.EM:case p.TT:case p.BIG:case p.CODE:case p.FONT:case p.NOBR:case p.SMALL:case p.STRIKE:case p.STRONG:{Nd(e,t);break}case p.P:{vv(e);break}case p.DL:case p.UL:case p.OL:case p.DIR:case p.DIV:case p.NAV:case p.PRE:case p.MAIN:case p.MENU:case p.ASIDE:case p.BUTTON:case p.CENTER:case p.FIGURE:case p.FOOTER:case p.HEADER:case p.HGROUP:case p.DIALOG:case p.ADDRESS:case p.ARTICLE:case p.DETAILS:case p.SEARCH:case p.SECTION:case p.SUMMARY:case p.LISTING:case p.FIELDSET:case p.BLOCKQUOTE:case p.FIGCAPTION:{Nv(e,t);break}case p.LI:{wv(e);break}case p.DD:case p.DT:{Iv(e,t);break}case p.H1:case p.H2:case p.H3:case p.H4:case p.H5:case p.H6:{Lv(e);break}case p.BR:{Ov(e);break}case p.BODY:{_v(e,t);break}case p.HTML:{Sv(e,t);break}case p.FORM:{Av(e);break}case p.APPLET:case p.OBJECT:case p.MARQUEE:{Rv(e,t);break}case p.TEMPLATE:{Kr(e,t);break}default:Ng(e,t)}}function Ag(e,t){e.tmplInsertionModeStack.length>0?Dg(e,t):Ad(e,t)}function Dv(e,t){var n;t.tagID===p.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function Pv(e,t){e._err(t,q.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function yc(e,t){if(e.openElements.currentTagId!==void 0&&bg.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=L.IN_TABLE_TEXT,t.type){case Pe.CHARACTER:{wg(e,t);break}case Pe.WHITESPACE_CHARACTER:{vg(e,t);break}}else as(e,t)}function Mv(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,Z.HTML),e.insertionMode=L.IN_CAPTION}function Fv(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Z.HTML),e.insertionMode=L.IN_COLUMN_GROUP}function Bv(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(z.COLGROUP,p.COLGROUP),e.insertionMode=L.IN_COLUMN_GROUP,vd(e,t)}function Uv(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,Z.HTML),e.insertionMode=L.IN_TABLE_BODY}function jv(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(z.TBODY,p.TBODY),e.insertionMode=L.IN_TABLE_BODY,no(e,t)}function Hv(e,t){e.openElements.hasInTableScope(p.TABLE)&&(e.openElements.popUntilTagNamePopped(p.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function zv(e,t){Sg(t)?e._appendElement(t,Z.HTML):as(e,t),t.ackSelfClosing=!0}function $v(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,Z.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Ri(e,t){switch(t.tagID){case p.TD:case p.TH:case p.TR:{jv(e,t);break}case p.STYLE:case p.SCRIPT:case p.TEMPLATE:{bn(e,t);break}case p.COL:{Bv(e,t);break}case p.FORM:{$v(e,t);break}case p.TABLE:{Hv(e,t);break}case p.TBODY:case p.TFOOT:case p.THEAD:{Uv(e,t);break}case p.INPUT:{zv(e,t);break}case p.CAPTION:{Mv(e,t);break}case p.COLGROUP:{Fv(e,t);break}default:as(e,t)}}function Ka(e,t){switch(t.tagID){case p.TABLE:{e.openElements.hasInTableScope(p.TABLE)&&(e.openElements.popUntilTagNamePopped(p.TABLE),e._resetInsertionMode());break}case p.TEMPLATE:{Kr(e,t);break}case p.BODY:case p.CAPTION:case p.COL:case p.COLGROUP:case p.HTML:case p.TBODY:case p.TD:case p.TFOOT:case p.TH:case p.THEAD:case p.TR:break;default:as(e,t)}}function as(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,eo(e,t),e.fosterParentingEnabled=n}function vg(e,t){e.pendingCharacterTokens.push(t)}function wg(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Da(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)as(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const Ig=new Set([p.CAPTION,p.COL,p.COLGROUP,p.TBODY,p.TD,p.TFOOT,p.TH,p.THEAD,p.TR]);function Wv(e,t){const n=t.tagID;Ig.has(n)?e.openElements.hasInTableScope(p.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(p.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=L.IN_TABLE,Ri(e,t)):wt(e,t)}function Yv(e,t){const n=t.tagID;switch(n){case p.CAPTION:case p.TABLE:{e.openElements.hasInTableScope(p.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(p.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=L.IN_TABLE,n===p.TABLE&&Ka(e,t));break}case p.BODY:case p.COL:case p.COLGROUP:case p.HTML:case p.TBODY:case p.TD:case p.TFOOT:case p.TH:case p.THEAD:case p.TR:break;default:to(e,t)}}function vd(e,t){switch(t.tagID){case p.HTML:{wt(e,t);break}case p.COL:{e._appendElement(t,Z.HTML),t.ackSelfClosing=!0;break}case p.TEMPLATE:{bn(e,t);break}default:Bu(e,t)}}function Vv(e,t){switch(t.tagID){case p.COLGROUP:{e.openElements.currentTagId===p.COLGROUP&&(e.openElements.pop(),e.insertionMode=L.IN_TABLE);break}case p.TEMPLATE:{Kr(e,t);break}case p.COL:break;default:Bu(e,t)}}function Bu(e,t){e.openElements.currentTagId===p.COLGROUP&&(e.openElements.pop(),e.insertionMode=L.IN_TABLE,e._processToken(t))}function no(e,t){switch(t.tagID){case p.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,Z.HTML),e.insertionMode=L.IN_ROW;break}case p.TH:case p.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(z.TR,p.TR),e.insertionMode=L.IN_ROW,ro(e,t);break}case p.CAPTION:case p.COL:case p.COLGROUP:case p.TBODY:case p.TFOOT:case p.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=L.IN_TABLE,Ri(e,t));break}default:Ri(e,t)}}function zc(e,t){const n=t.tagID;switch(t.tagID){case p.TBODY:case p.TFOOT:case p.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=L.IN_TABLE);break}case p.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=L.IN_TABLE,Ka(e,t));break}case p.BODY:case p.CAPTION:case p.COL:case p.COLGROUP:case p.HTML:case p.TD:case p.TH:case p.TR:break;default:Ka(e,t)}}function ro(e,t){switch(t.tagID){case p.TH:case p.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,Z.HTML),e.insertionMode=L.IN_CELL,e.activeFormattingElements.insertMarker();break}case p.CAPTION:case p.COL:case p.COLGROUP:case p.TBODY:case p.TFOOT:case p.THEAD:case p.TR:{e.openElements.hasInTableScope(p.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=L.IN_TABLE_BODY,no(e,t));break}default:Ri(e,t)}}function Lg(e,t){switch(t.tagID){case p.TR:{e.openElements.hasInTableScope(p.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=L.IN_TABLE_BODY);break}case p.TABLE:{e.openElements.hasInTableScope(p.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=L.IN_TABLE_BODY,zc(e,t));break}case p.TBODY:case p.TFOOT:case p.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(p.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=L.IN_TABLE_BODY,zc(e,t));break}case p.BODY:case p.CAPTION:case p.COL:case p.COLGROUP:case p.HTML:case p.TD:case p.TH:break;default:Ka(e,t)}}function qv(e,t){const n=t.tagID;Ig.has(n)?(e.openElements.hasInTableScope(p.TD)||e.openElements.hasInTableScope(p.TH))&&(e._closeTableCell(),ro(e,t)):wt(e,t)}function Qv(e,t){const n=t.tagID;switch(n){case p.TD:case p.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=L.IN_ROW);break}case p.TABLE:case p.TBODY:case p.TFOOT:case p.THEAD:case p.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),Lg(e,t));break}case p.BODY:case p.CAPTION:case p.COL:case p.COLGROUP:case p.HTML:break;default:to(e,t)}}function Rg(e,t){switch(t.tagID){case p.HTML:{wt(e,t);break}case p.OPTION:{e.openElements.currentTagId===p.OPTION&&e.openElements.pop(),e._insertElement(t,Z.HTML);break}case p.OPTGROUP:{e.openElements.currentTagId===p.OPTION&&e.openElements.pop(),e.openElements.currentTagId===p.OPTGROUP&&e.openElements.pop(),e._insertElement(t,Z.HTML);break}case p.HR:{e.openElements.currentTagId===p.OPTION&&e.openElements.pop(),e.openElements.currentTagId===p.OPTGROUP&&e.openElements.pop(),e._appendElement(t,Z.HTML),t.ackSelfClosing=!0;break}case p.INPUT:case p.KEYGEN:case p.TEXTAREA:case p.SELECT:{e.openElements.hasInSelectScope(p.SELECT)&&(e.openElements.popUntilTagNamePopped(p.SELECT),e._resetInsertionMode(),t.tagID!==p.SELECT&&e._processStartTag(t));break}case p.SCRIPT:case p.TEMPLATE:{bn(e,t);break}}}function Og(e,t){switch(t.tagID){case p.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===p.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===p.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===p.OPTGROUP&&e.openElements.pop();break}case p.OPTION:{e.openElements.currentTagId===p.OPTION&&e.openElements.pop();break}case p.SELECT:{e.openElements.hasInSelectScope(p.SELECT)&&(e.openElements.popUntilTagNamePopped(p.SELECT),e._resetInsertionMode());break}case p.TEMPLATE:{Kr(e,t);break}}}function Gv(e,t){const n=t.tagID;n===p.CAPTION||n===p.TABLE||n===p.TBODY||n===p.TFOOT||n===p.THEAD||n===p.TR||n===p.TD||n===p.TH?(e.openElements.popUntilTagNamePopped(p.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Rg(e,t)}function Kv(e,t){const n=t.tagID;n===p.CAPTION||n===p.TABLE||n===p.TBODY||n===p.TFOOT||n===p.THEAD||n===p.TR||n===p.TD||n===p.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(p.SELECT),e._resetInsertionMode(),e.onEndTag(t)):Og(e,t)}function Xv(e,t){switch(t.tagID){case p.BASE:case p.BASEFONT:case p.BGSOUND:case p.LINK:case p.META:case p.NOFRAMES:case p.SCRIPT:case p.STYLE:case p.TEMPLATE:case p.TITLE:{bn(e,t);break}case p.CAPTION:case p.COLGROUP:case p.TBODY:case p.TFOOT:case p.THEAD:{e.tmplInsertionModeStack[0]=L.IN_TABLE,e.insertionMode=L.IN_TABLE,Ri(e,t);break}case p.COL:{e.tmplInsertionModeStack[0]=L.IN_COLUMN_GROUP,e.insertionMode=L.IN_COLUMN_GROUP,vd(e,t);break}case p.TR:{e.tmplInsertionModeStack[0]=L.IN_TABLE_BODY,e.insertionMode=L.IN_TABLE_BODY,no(e,t);break}case p.TD:case p.TH:{e.tmplInsertionModeStack[0]=L.IN_ROW,e.insertionMode=L.IN_ROW,ro(e,t);break}default:e.tmplInsertionModeStack[0]=L.IN_BODY,e.insertionMode=L.IN_BODY,wt(e,t)}}function Jv(e,t){t.tagID===p.TEMPLATE&&Kr(e,t)}function Dg(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(p.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Ad(e,t)}function Zv(e,t){t.tagID===p.HTML?wt(e,t):Uu(e,t)}function Pg(e,t){var n;if(t.tagID===p.HTML){if(e.fragmentContext||(e.insertionMode=L.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===p.HTML){e._setEndLocation(e.openElements.items[0],t);const a=e.openElements.items[1];a&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(a))===null||n===void 0)&&n.endTag)&&e._setEndLocation(a,t)}}else Uu(e,t)}function Uu(e,t){e.insertionMode=L.IN_BODY,eo(e,t)}function ew(e,t){switch(t.tagID){case p.HTML:{wt(e,t);break}case p.FRAMESET:{e._insertElement(t,Z.HTML);break}case p.FRAME:{e._appendElement(t,Z.HTML),t.ackSelfClosing=!0;break}case p.NOFRAMES:{bn(e,t);break}}}function tw(e,t){t.tagID===p.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==p.FRAMESET&&(e.insertionMode=L.AFTER_FRAMESET))}function nw(e,t){switch(t.tagID){case p.HTML:{wt(e,t);break}case p.NOFRAMES:{bn(e,t);break}}}function rw(e,t){t.tagID===p.HTML&&(e.insertionMode=L.AFTER_AFTER_FRAMESET)}function iw(e,t){t.tagID===p.HTML?wt(e,t):Ru(e,t)}function Ru(e,t){e.insertionMode=L.IN_BODY,eo(e,t)}function aw(e,t){switch(t.tagID){case p.HTML:{wt(e,t);break}case p.NOFRAMES:{bn(e,t);break}}}function sw(e,t){t.chars=Je,e._insertCharacters(t)}function uw(e,t){e._insertCharacters(t),e.framesetOk=!1}function Mg(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==Z.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function ow(e,t){if(CA(t))Mg(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),a=e.treeAdapter.getNamespaceURI(n);a===Z.MATHML?yg(t):a===Z.SVG&&(_A(t),xg(t)),Sd(t),t.selfClosing?e._appendElement(t,a):e._insertElement(t,a),t.ackSelfClosing=!0}}function lw(e,t){if(t.tagID===p.P||t.tagID===p.BR){Mg(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const a=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(a)===Z.HTML){e._endTagOutsideForeignContent(t);break}const s=e.treeAdapter.getTagName(a);if(s.toLowerCase()===t.tagName){t.tagName=s,e.openElements.shortenToLength(n);break}}}z.AREA,z.BASE,z.BASEFONT,z.BGSOUND,z.BR,z.COL,z.EMBED,z.FRAME,z.HR,z.IMG,z.INPUT,z.KEYGEN,z.LINK,z.META,z.PARAM,z.SOURCE,z.TRACK,z.WBR;const cw=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,dw=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Xm={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Fg(e,t){const n=bw(e),a=U1("type",{handlers:{root:fw,element:hw,text:pw,comment:Ug,doctype:mw,raw:Ew},unknown:Tw}),s={parser:n?new Qm(Xm):Qm.getFragmentParser(void 0,Xm),handle(d){a(d,s)},stitches:!1,options:t||{}};a(e,s),Ui(s,Ln());const o=n?s.parser.document:s.parser.getFragment(),l=kN(o,{file:s.options.file});return s.stitches&&Zu(l,"comment",function(d,f,h){const E=d;if(E.value.stitch&&h&&f!==void 0){const g=h.children;return g[f]=E.value.stitch,f}}),l.type==="root"&&l.children.length===1&&l.children[0].type===e.type?l.children[0]:l}function Bg(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function fw(e,t){Bg(e.children,t)}function hw(e,t){yw(e,t),Bg(e.children,t),xw(e,t)}function pw(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:Pe.CHARACTER,chars:e.value,location:ss(e)};Ui(t,Ln(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function mw(e,t){const n={type:Pe.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:ss(e)};Ui(t,Ln(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function gw(e,t){t.stitches=!0;const n=kw(e);if("children"in e&&"children"in n){const a=Fg({type:"root",children:e.children},t.options);n.children=a.children}Ug({type:"comment",value:{stitch:n}},t)}function Ug(e,t){const n=e.value,a={type:Pe.COMMENT,data:n,location:ss(e)};Ui(t,Ln(e)),t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken)}function Ew(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,jg(t,Ln(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(cw,"<$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 Tw(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))gw(n,t);else{let a="";throw dw.has(n.type)&&(a=". 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"+a)}}function Ui(e,t){jg(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=at.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 jg(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 yw(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===at.PLAINTEXT)return;Ui(t,Ln(e));const a=t.parser.openElements.current;let s="namespaceURI"in a?a.namespaceURI:$r.html;s===$r.html&&n==="svg"&&(s=$r.svg);const o=AN({...e,children:[]},{space:s===$r.svg?"svg":"html"}),l={type:Pe.START_TAG,tagName:n,tagID:Bi(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in o?o.attrs:[],location:ss(e)};t.parser.currentToken=l,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function xw(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&PN.includes(n)||t.parser.tokenizer.state===at.PLAINTEXT)return;Ui(t,qu(e));const a={type:Pe.END_TAG,tagName:n,tagID:Bi(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:ss(e)};t.parser.currentToken=a,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===at.RCDATA||t.parser.tokenizer.state===at.RAWTEXT||t.parser.tokenizer.state===at.SCRIPT_DATA)&&(t.parser.tokenizer.state=at.DATA)}function bw(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function ss(e){const t=Ln(e)||{line:void 0,column:void 0,offset:void 0},n=qu(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 kw(e){return"children"in e?qr({...e,children:[]}):qr(e)}function Cw(e){return function(t,n){return Fg(t,{...e,file:n})}}const Ur=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],$c={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Ur,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Ur],h2:[["className","sr-only"]],img:[...Ur,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Ur,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Ur],table:[...Ur],ul:[...Ur,["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"]},Er={}.hasOwnProperty;function _w(e,t){let n={type:"root",children:[]};const a={schema:t?{...$c,...t}:$c,stack:[]},s=Hg(a,e);return s&&(Array.isArray(s)?s.length===1?n=s[0]:n.children=s:n=s),n}function Hg(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return Sw(e,n);case"doctype":return Nw(e,n);case"element":return Aw(e,n);case"root":return vw(e,n);case"text":return ww(e,n)}}}function Sw(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",a=n.indexOf("-->"),o={type:"comment",value:a<0?n:n.slice(0,a)};return us(o,t),o}}function Nw(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return us(n,t),n}}function Aw(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const a=zg(e,t.children),s=Iw(e,t.properties);e.stack.pop();let o=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(o=!0,e.schema.ancestors&&Er.call(e.schema.ancestors,n))){const d=e.schema.ancestors[n];let f=-1;for(o=!1;++f<d.length;)e.stack.includes(d[f])&&(o=!0)}if(!o)return e.schema.strip&&!e.schema.strip.includes(n)?a:void 0;const l={type:"element",tagName:n,properties:s,children:a};return us(l,t),l}function vw(e,t){const a={type:"root",children:zg(e,t.children)};return us(a,t),a}function ww(e,t){const a={type:"text",value:typeof t.value=="string"?t.value:""};return us(a,t),a}function zg(e,t){const n=[];if(Array.isArray(t)){const a=t;let s=-1;for(;++s<a.length;){const o=Hg(e,a[s]);o&&(Array.isArray(o)?n.push(...o):n.push(o))}}return n}function Iw(e,t){const n=e.stack[e.stack.length-1],a=e.schema.attributes,s=e.schema.required,o=a&&Er.call(a,n)?a[n]:void 0,l=a&&Er.call(a,"*")?a["*"]:void 0,d=t&&typeof t=="object"?t:{},f={};let h;for(h in d)if(Er.call(d,h)){const E=d[h];let g=Jm(e,Zm(o,h),h,E);g==null&&(g=Jm(e,Zm(l,h),h,E)),g!=null&&(f[h]=g)}if(s&&Er.call(s,n)){const E=s[n];for(h in E)Er.call(E,h)&&!Er.call(f,h)&&(f[h]=E[h])}return f}function Jm(e,t,n,a){return t?Array.isArray(a)?Lw(e,t,n,a):$g(e,t,n,a):void 0}function Lw(e,t,n,a){let s=-1;const o=[];for(;++s<a.length;){const l=$g(e,t,n,a[s]);(typeof l=="number"||typeof l=="string")&&o.push(l)}return o}function $g(e,t,n,a){if(!(typeof a!="boolean"&&typeof a!="number"&&typeof a!="string")&&Rw(e,n,a)){if(typeof t=="object"&&t.length>1){let s=!1,o=0;for(;++o<t.length;){const l=t[o];if(l&&typeof l=="object"&&"flags"in l){if(l.test(String(a))){s=!0;break}}else if(l===a){s=!0;break}}if(!s)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+a:a}}function Rw(e,t,n){const a=e.schema.protocols&&Er.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!a||a.length===0)return!0;const s=String(n),o=s.indexOf(":"),l=s.indexOf("?"),d=s.indexOf("#"),f=s.indexOf("/");if(o<0||f>-1&&o>f||l>-1&&o>l||d>-1&&o>d)return!0;let h=-1;for(;++h<a.length;){const E=a[h];if(o===E.length&&s.slice(0,E.length)===E)return!0}return!1}function us(e,t){const n=o1(t);t.data&&(e.data=qr(t.data)),n&&(e.position=n)}function Zm(e,t){let n,a=-1;if(e)for(;++a<e.length;){const s=e[a],o=typeof s=="string"?s:s[0];if(o===t)return s;o==="data*"&&(n=s)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function Ow(e){return function(t){return _w(t,e)}}const Wc=$c,jr=(e,...t)=>{var n;return[...((n=Wc.attributes)==null?void 0:n[e])??[],...t]},Dw={...Wc,attributes:{...Wc.attributes,p:jr("p","align"),div:jr("div","align"),h1:jr("h1","align"),h2:jr("h2","align"),h3:jr("h3","align"),img:jr("img","width","height","align"),a:jr("a","align")}},Pw=new Set(["code","pre","svg","math","style","script","textarea"]),Mw="fade-word";function Fw(e){const t=[];for(const n of e.split(/(\s+)/))if(n){if(/^\s+$/.test(n)){t.push({type:"text",value:n});continue}t.push({type:"element",tagName:"span",properties:{className:[Mw]},children:[{type:"text",value:n}]})}return t}function Wg(e){const t=e.children;if(!t)return;const n=[];for(const a of t){if(a.type==="text"){n.push(...Fw(a.value??""));continue}if(a.type==="element"&&Pw.has(a.tagName??"")){n.push(a);continue}Wg(a),n.push(a)}e.children=n}function Bw(){return e=>Wg(e)}const Uw=256*1024;let Hr=null,jw=0;const ju=new Map;function e0(e,t){var n;(n=ju.get(e))==null||n(t),ju.delete(e)}function Hw(){if(Hr)return Hr;try{Hr=new Worker(new URL("/assets/highlightWorker-DJp1Ce5p.js",import.meta.url),{type:"module"}),Hr.addEventListener("message",e=>e0(e.data.id,e.data.html)),Hr.addEventListener("error",()=>{for(const e of[...ju.keys()])e0(e,null);Hr=null})}catch{return null}return Hr}async function wd(e,t){if(e.length>Uw)return null;const n=Hw();if(!n)return null;const a=++jw;return new Promise(s=>{ju.set(a,s),n.postMessage({id:a,code:e,lang:t})})}function zw({code:e,lang:t}){const[n,a]=v.useState(null);v.useEffect(()=>{let o=!1;return wd(e,t).then(l=>{o||a(l)}).catch(()=>{o||a(null)}),()=>{o=!0}},[e,t]);const s=()=>{var o;return void((o=navigator.clipboard)==null?void 0:o.writeText(e))};return T.jsxs("div",{className:"codeblock",children:[T.jsxs("div",{className:"codeblock-bar",children:[T.jsx("span",{className:"codeblock-lang",children:t||"text"}),T.jsx("button",{className:"codeblock-copy",onClick:s,"aria-label":"Copy code",children:"copy"})]}),n?T.jsx("div",{className:"codeblock-body",dangerouslySetInnerHTML:{__html:n}}):T.jsx("pre",{className:"codeblock-body codeblock-plain",children:T.jsx("code",{children:e})})]})}let xc=null;function $w(){return xc||(xc=Ac(()=>import("./mermaid.core-CbRUo2Lc.js").then(e=>e.bp),[]).then(e=>(e.default.initialize({startOnLoad:!1,theme:"dark",securityLevel:"strict",themeVariables:{primaryColor:"#44475a",primaryTextColor:"#f8f8f2",primaryBorderColor:"#bd93f9",lineColor:"#8be9fd",fontFamily:"Inter, sans-serif"}}),e.default))),xc}let Ww=0;function Yw({code:e}){const t=v.useRef(null),[n,a]=v.useState(!1);return v.useEffect(()=>{let s=!1;a(!1);const o=e.trim();if(o)return $w().then(async l=>{const d=await l.parse(o,{suppressErrors:!0});if(s||!d)return;const{svg:f}=await l.render(`mermaid-${Ww++}`,o);s||!t.current||(t.current.innerHTML=f,a(!0))}).catch(()=>{}),()=>{s=!0}},[e]),T.jsxs("div",{className:"mermaid-wrap",children:[T.jsx("div",{className:`mermaid-block ${n?"":"is-hidden"}`,ref:t}),!n&&T.jsxs("div",{className:"codeblock",children:[T.jsx("div",{className:"codeblock-bar",children:T.jsx("span",{className:"codeblock-lang",children:"mermaid"})}),T.jsx("pre",{className:"codeblock-body codeblock-plain",children:T.jsx("code",{children:e})})]})]})}const Vw=/language-(\w+)/,qw=/\n$/,Qw={code(e){const{className:t,children:n}=e,a=Vw.exec(t??""),s=String(n).replace(qw,"");if(!t&&!s.includes(`
|
|
91
|
+
`))return T.jsx("code",{className:"md-inline-code",children:s});const l=(a==null?void 0:a[1])??"";return l==="mermaid"?T.jsx(Yw,{code:s}):T.jsx(zw,{code:s,lang:l})},a(e){return T.jsx("a",{...e,target:"_blank",rel:"noreferrer noopener"})}};let Ii=null,t0=null;function Yg(){return t0??(t0=Promise.all([Ac(()=>import("./index-DaPSZyqC.js"),__vite__mapDeps([0,1])),Ac(()=>Promise.resolve({}),__vite__mapDeps([2]))]).then(([e])=>{Ii=e.default})),t0}let n0=!1;function Gw(){if(n0||Ii)return;n0=!0;const e=()=>void Yg(),t=globalThis.requestIdleCallback;t?t(e):setTimeout(e,2e3)}const Kw=/(^|[^\\])\$/,Xa=v.memo(function({text:t,html:n=!1,streaming:a=!1}){const s=v.useMemo(()=>dN(t),[t]),o=Kw.test(s),[l,d]=v.useState(()=>Ii!==null);v.useEffect(()=>{if(Ii)return;if(!o){Gw();return}let h=!0;return Yg().then(()=>{h&&d(!0)}),()=>{h=!1}},[o]);const f=v.useMemo(()=>{const h=o&&Ii?[Ii]:[];return n?[Cw,[Ow,Dw],...h]:a?[...h,Bw]:h},[n,a,o,l]);return T.jsx("div",{className:"md",children:T.jsx(L_,{remarkPlugins:tN,rehypePlugins:f,components:Qw,children:s})})});function Xw(e,t){if(!e||!t)return null;if(!t.startsWith("/"))return i0(t.replace(/^\.\//,""));const n=r0(e),a=i0(r0(t));return a===null||a===n?null:a.startsWith(`${n}/`)?a.slice(n.length+1):null}const r0=e=>e.replace(/\/+$/,"");function i0(e){const t=e.startsWith("/"),n=[];for(const s of e.split("/"))if(!(s===""||s===".")){if(s!==".."){n.push(s);continue}if(n.length===0)return null;n.pop()}const a=n.join("/");return t?`/${a}`:a}const Jw=4e5;function a0(e,t){const n=e.split(`
|
|
92
92
|
`),a=t.split(`
|
|
93
|
-
`),s=n.length,o=a.length;if(s*o>
|
|
93
|
+
`),s=n.length,o=a.length;if(s*o>Jw)return[...n.map(E=>({type:"del",text:E})),...a.map(E=>({type:"add",text:E}))];const l=Array.from({length:s+1},()=>new Array(o+1).fill(0));for(let E=s-1;E>=0;E--)for(let g=o-1;g>=0;g--)l[E][g]=n[E]===a[g]?l[E+1][g+1]+1:Math.max(l[E+1][g],l[E][g+1]);const d=[];let f=0,h=0;for(;f<s&&h<o;)n[f]===a[h]?(d.push({type:"ctx",text:n[f]}),f++,h++):l[f+1][h]>=l[f][h+1]?(d.push({type:"del",text:n[f]}),f++):(d.push({type:"add",text:a[h]}),h++);for(;f<s;)d.push({type:"del",text:n[f++]});for(;h<o;)d.push({type:"add",text:a[h++]});return d}const Vg={loading:"lazy",decoding:"async",ref:e=>{e!=null&&e.complete&&(e.dataset.loaded="")},onLoad:e=>{e.currentTarget.dataset.loaded=""}},Zw=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif"]);function eI(e){const t=e.toLowerCase(),n=t.lastIndexOf("."),a=n>0?t.slice(n+1):"";return Zw.has(a)?"image":a==="pdf"?"pdf":a==="html"||a==="htm"?"html":a==="md"||a==="markdown"?"markdown":"text"}const tI={ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",mjs:"javascript",cjs:"javascript",json:"json",jsonl:"json",yaml:"yaml",yml:"yaml",md:"markdown",markdown:"markdown",html:"html",htm:"html",xml:"xml",css:"css",scss:"scss",less:"less",py:"python",rs:"rust",go:"go",java:"java",c:"c",h:"c",cpp:"cpp",cc:"cpp",cxx:"cpp",hpp:"cpp",cs:"csharp",rb:"ruby",php:"php",kt:"kotlin",kts:"kotlin",swift:"swift",zig:"zig",lua:"lua",tex:"latex",toml:"toml",ini:"ini",cfg:"ini",conf:"ini",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",dockerfile:"docker",sql:"sql",diff:"diff",patch:"diff",jsonc:"json",svg:"xml",vue:"vue",svelte:"svelte",env:"ini",proto:"proto",graphql:"graphql"};function qg(e){return Qg(e.trim().split("/").pop()??"")||"text"}function Qg(e){const t=e.toLowerCase();if(t==="dockerfile")return"docker";if(t==="makefile")return"make";const n=t.split(".").pop()??"";return tI[n]??""}const Tn=e=>!!e&&typeof e=="object";function Id(e){switch(e.name){case"shell":return"shell";case"write":case"strReplace":return"write";case"read":return"read";case"grep":return"grep";case"todo_list":return"todo";case"web_fetch":return"webfetch";case"web_search":return"websearch";case"introspect":return"introspect"}if(e.name)return"generic";const t=Tn(e.input)?e.input:{},n=e.kind,a=typeof t.command=="string"?t.command:void 0,s=o=>Object.prototype.hasOwnProperty.call(t,o);return e.title==="todo_list"||s("tasks")||s("task_list_description")||s("completed_task_ids")||s("remove_task_ids")||a!==void 0&&["complete","add","remove","list"].includes(a)?"todo":n==="read"||Array.isArray(t.operations)||e.title==="read"?"read":e.title==="grep"||typeof t.pattern=="string"&&!s("operations")?"grep":n==="edit"||e.title==="write"||e.title==="strReplace"||(a==="create"||a==="strReplace"||a==="insert")&&typeof t.path=="string"||typeof t.oldStr=="string"&&typeof t.newStr=="string"?"write":n==="execute"||e.title==="shell"||typeof t.command=="string"?"shell":typeof t.url=="string"?"webfetch":typeof t.query=="string"&&(n==="search"||e.title==="web_search")?"websearch":e.title==="introspect"||typeof t.doc_path=="string"?"introspect":"generic"}const nI={shell:"shell",write:"write",read:"read",grep:"grep",todo:"todo_list",webfetch:"web_fetch",websearch:"web_search",introspect:"introspect",generic:void 0},rI=/^@?([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)$/,iI=/@([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)/;function aI(e){const t=rI.exec(e.name??"");if(t)return`@${t[1]}/${t[2]}`;const n=iI.exec(e.title??"");return!n||e.name&&e.name!==n[2]?null:`@${n[1]}/${n[2]}`}function sI(e){const t=aI(e);if(t)return t;if(e.name)return e.name;const n=nI[Id(e)];if(n)return n;const a=e.title??"";return a&&!/\s/.test(a)?a:"tool"}function Xr(e){const t=[];for(const n of e)Tn(n)&&(n.type==="content"&&Tn(n.content)&&typeof n.content.text=="string"?t.push(n.content.text):n.type==="text"&&typeof n.text=="string"?t.push(n.text):n.kind==="text"&&typeof n.data=="string"&&t.push(n.data));return t.join("")}function Jr(e){for(const t of e)if(Tn(t)&&t.kind==="json"&&Tn(t.data))return t.data;return null}function Ld(e){const t=Object.keys(e);return t.length===1&&typeof e[t[0]]=="string"?e[t[0]]:null}function uI(e){if(e==null)return[];if(typeof e=="string")return e?[{kind:"text",data:e}]:[];if(Tn(e)&&Array.isArray(e.items)){const t=[];for(const n of e.items)Tn(n)&&(typeof n.Text=="string"?t.push({kind:"text",data:n.Text}):Tn(n.Json)&&t.push({kind:"json",data:n.Json}));return t}return[]}function kr(e){return[...Array.isArray(e.content)?e.content:[],...uI(e.output)]}function oI(e){for(const t of e)if(Tn(t)&&t.type==="diff"&&typeof t.oldText=="string"&&typeof t.newText=="string")return{path:typeof t.path=="string"?t.path:void 0,oldText:t.oldText,newText:t.newText};return null}function lI(e){let t=Jr(e);if(!t||!Array.isArray(t.tasks)){const n=Xr(e).trim();if(n.startsWith("{"))try{const a=JSON.parse(n);t=Tn(a)?a:null}catch{t=null}}return t&&Array.isArray(t.tasks)?t.tasks.map(n=>{const a=Tn(n)?n:{};return{desc:typeof a.task_description=="string"?a.task_description:"",done:a.completed===!0}}):null}const cI="show_widget";function dI(e){var s;if(!((s=e.name)!=null&&s.endsWith(cI)))return null;const t=e.input??{},n=typeof t.widget_code=="string"?t.widget_code:"";return{title:typeof t.title=="string"?t.title:"",code:n}}function fI(e){return e.replace(/_/g," ").trim()}function hI(e){var o;if(!((o=e.name)!=null&&o.endsWith("show_choice")))return null;const t=e.input??{},n=typeof t.question=="string"?t.question.trim():"",a=Array.isArray(t.options)?t.options:[],s=[];for(const l of a){const d=l??{},f=typeof d.label=="string"&&d.label.trim()?d.label:"";if(!f)continue;const h=typeof d.detail=="string"&&d.detail.trim()?d.detail:void 0,E=typeof d.prompt=="string"&&d.prompt.trim()?d.prompt:f;s.push({label:f,detail:h,prompt:E})}return!n||s.length<2?null:{question:n,options:s}}function pI(e,t){if(t===null)return{picked:null,superseded:!1};const n=e.find(a=>a.prompt.trim()===t.trim());return n?{picked:n.label,superseded:!1}:{picked:null,superseded:!0}}function mI(e){var s;const{items:t,pending:n}=xe.getState(),a=t.findIndex(o=>o.type==="tool_call"&&o.tool.id===e);if(a===-1)return null;for(const o of t.slice(a+1))if(o.type==="message"&&o.message.role==="user")return o.message.text;return((s=n[0])==null?void 0:s.text)??null}function gI({data:e,toolId:t}){const n=xe(E=>E.items),a=xe(E=>E.pending),[s,o]=v.useState(null),l=pI(e.options,n.length||a.length?mI(t):null),d=s??l.picked,f=d!==null||l.superseded,h=E=>{f||$0(E.prompt)&&o(E.label)};return T.jsxs("div",{className:"tpl-choice",children:[T.jsx("p",{className:"tpl-choice-q",children:e.question}),T.jsx("div",{className:"tpl-choice-opts",children:e.options.map(E=>{const g=d===E.label;return T.jsxs("button",{className:`tpl-choice-opt${g?" is-picked":""}`,onClick:()=>h(E),disabled:f,"aria-pressed":g,children:[T.jsx("span",{className:"tpl-choice-label",children:E.label}),E.detail&&T.jsx("span",{className:"tpl-choice-detail",children:E.detail})]},E.label)})})]})}const EI=["https://cdnjs.cloudflare.com","https://cdn.jsdelivr.net","https://unpkg.com","https://esm.sh"];function TI(){const e=EI.join(" ");return["default-src 'none'",`script-src 'unsafe-inline' ${e}`,`style-src 'unsafe-inline' ${e} https://fonts.googleapis.com`,"img-src data: blob: https:","font-src data: https:",`connect-src ${e}`].join("; ")}const yI=`
|
|
94
94
|
(function () {
|
|
95
95
|
var parent = window.parent;
|
|
96
96
|
var root = document.getElementById('root');
|
|
@@ -214,7 +214,7 @@ ${n}`,t+3);return a===-1?e.length:a+4}if(e[t]==="`"){let n=0;for(;e[t+n]==="`";)
|
|
|
214
214
|
pollHeight(4000);
|
|
215
215
|
});
|
|
216
216
|
})();
|
|
217
|
-
`,
|
|
217
|
+
`,xI=`
|
|
218
218
|
*, *::before, *::after { box-sizing: border-box; }
|
|
219
219
|
html, body { margin: 0; padding: 0; background: transparent; }
|
|
220
220
|
/* The host sizes the frame to fit, so a scrollbar in here is always a measuring
|
|
@@ -231,19 +231,19 @@ body {
|
|
|
231
231
|
a { color: var(--color-accent, #bd93f9); }
|
|
232
232
|
::-webkit-scrollbar { width: 8px; height: 8px; }
|
|
233
233
|
::-webkit-scrollbar-thumb { background: var(--color-border, #44475a); border-radius: 4px; }
|
|
234
|
-
`;function
|
|
234
|
+
`;function bI(){return`<!doctype html>
|
|
235
235
|
<html>
|
|
236
236
|
<head>
|
|
237
237
|
<meta charset="utf-8">
|
|
238
|
-
<meta http-equiv="Content-Security-Policy" content="${
|
|
238
|
+
<meta http-equiv="Content-Security-Policy" content="${TI()}">
|
|
239
239
|
<meta name="color-scheme" content="dark">
|
|
240
|
-
<style>${
|
|
240
|
+
<style>${xI}</style>
|
|
241
241
|
<style id="theme"></style>
|
|
242
242
|
</head>
|
|
243
243
|
<body><div id="root"></div>
|
|
244
244
|
<!-- Runtime last: it grabs #root on the way in, so the element has to exist. -->
|
|
245
|
-
<script>${
|
|
245
|
+
<script>${yI}<\/script>
|
|
246
246
|
</body>
|
|
247
|
-
</html>`}const bI
|
|
248
|
-
`)})]},l)})});const s=Xr(t);return s.trim()?T.jsx(sn,{code:s,lang:"text"}):Cr(e)}function MI(e){const t=oI(kr(e));return!t||t.length===0?Cr(e):T.jsx("div",{className:"todo",children:t.map((n,a)=>T.jsxs("div",{className:`todo-item ${n.done?"is-done":""}`,children:[T.jsx("span",{className:"todo-check","aria-hidden":!0,children:n.done?"☑":"☐"}),T.jsx("span",{className:"todo-text",children:n.desc})]},a))})}function FI(e){const t=kt(e.input),n=$e(t==null?void 0:t.query)??$e(t==null?void 0:t.doc_path),a=kr(e),s=Jr(a),o=(s?$e(s.documentation)??Ld(s):null)??Xr(a);return T.jsxs(T.Fragment,{children:[n&&T.jsxs("div",{className:"toolcall-section",children:[T.jsx("div",{className:"toolcall-label",children:"query"}),T.jsx(sn,{code:n,lang:"text"})]}),o.trim()?T.jsx("div",{className:"toolcall-doc",children:T.jsx(Xa,{text:o})}):Cr(e)]})}function BI(e){const t=kt(e.input),n=$e(t==null?void 0:t.url),a=$e(t==null?void 0:t.mode),s=$e(t==null?void 0:t.search_terms),o=kr(e),l=Jr(o),d=l?Ld(l)??$e(l.content)??JSON.stringify(l,null,2):Xr(o);return T.jsxs(T.Fragment,{children:[n&&T.jsxs("div",{className:"toolcall-meta",children:[T.jsx("a",{className:"toolcall-link",href:n,target:"_blank",rel:"noopener noreferrer",children:n}),a&&T.jsx("span",{className:"toolcall-tag",children:a})]}),s&&T.jsxs("div",{className:"toolcall-section",children:[T.jsx("div",{className:"toolcall-label",children:"search terms"}),T.jsx(sn,{code:s,lang:"text"})]}),d.trim()?T.jsx(sn,{code:d,lang:"markdown"}):Cr(e)]})}function UI(e){if(!e)return null;const t=Array.isArray(e.results)?e.results:Array.isArray(e.items)?e.items:Array.isArray(e.data)?e.data:null;if(!t)return null;const n=[];for(const a of t){const s=kt(a);s&&n.push({title:$e(s.title)??$e(s.name),url:$e(s.url)??$e(s.link)??$e(s.href),snippet:$e(s.snippet)??$e(s.description)??$e(s.content)??$e(s.text)})}return n.length?n:null}function jI(e){var s;const t=kr(e),n=UI(Jr(t));if(!n)return Cr(e);const a=$e((s=kt(e.input))==null?void 0:s.query);return T.jsxs(T.Fragment,{children:[a&&T.jsxs("div",{className:"toolcall-section",children:[T.jsx("div",{className:"toolcall-label",children:"query"}),T.jsx(sn,{code:a,lang:"text"})]}),T.jsx("ol",{className:"websearch",children:n.map((o,l)=>T.jsxs("li",{className:"websearch-item",children:[o.url?T.jsx("a",{className:"websearch-title",href:o.url,target:"_blank",rel:"noopener noreferrer",children:o.title??o.url}):T.jsx("span",{className:"websearch-title",children:o.title??"(untitled)"}),o.url&&T.jsx("div",{className:"websearch-url",children:o.url}),o.snippet&&T.jsx("p",{className:"websearch-snippet",children:o.snippet})]},l))})]})}function Cr(e){const t=e.input;let n="";if(typeof t=="string")n=t;else if(kt(t)){const{__tool_use_purpose:f,...h}=kt(t);n=JSON.stringify(h,null,2)}const a=kr(e),s=Jr(a),o=s?Ld(s):null,l=o??(s?JSON.stringify(s,null,2):Xr(a)),d=o?"text":/^\s*[[{]/.test(l)?"json":"text";return T.jsxs(T.Fragment,{children:[n&&n!=="{}"&&T.jsxs("div",{className:"toolcall-section",children:[T.jsx("div",{className:"toolcall-label",children:"input"}),T.jsx(sn,{code:n,lang:kt(t)?"json":"text"})]}),l.trim()&&T.jsxs("div",{className:"toolcall-section",children:[T.jsx("div",{className:"toolcall-label",children:"output"}),T.jsx(sn,{code:l,lang:d})]})]})}function sn({code:e,lang:t}){const[n,a]=v.useState(null);return v.useEffect(()=>{let s=!1;return wd(e,t).then(o=>!s&&a(o)).catch(()=>!s&&a(null)),()=>{s=!0}},[e,t]),n?T.jsx("div",{className:"toolcode",dangerouslySetInnerHTML:{__html:n}}):T.jsx("pre",{className:"toolcode toolcode-plain",children:e})}function o0({diff:e}){return T.jsx("div",{className:"diff-body",children:e.map((t,n)=>T.jsxs("div",{className:`diff-line diff-${t.type}`,children:[T.jsx("span",{className:"diff-sign","aria-hidden":!0,children:t.type==="add"?"+":t.type==="del"?"-":" "}),T.jsx("span",{className:"diff-code",children:t.text||" "})]},n))})}const HI=v.memo(vI),zI=4,$I=300,WI=240,YI=80;function VI(e,t){if(e<=0)return{offset:0,limit:0};const n=Math.max(0,e-t);return{offset:n,limit:e-n}}function qI(e,t,n,a){const s=t-e,o=Math.max(0,a-n);return s>o+zI}class QI{constructor(t){Le(this,"ports");Le(this,"frames");Le(this,"follow",!1);Le(this,"lastScrollTop",0);Le(this,"lastMaxTop",0);Le(this,"anchor",null);Le(this,"loadingOlder",!1);Le(this,"showButton",!1);Le(this,"initializedFor",null);Le(this,"prevPendingCount",0);Le(this,"raf",0);Le(this,"content",{chatId:null,itemCount:0,pendingCount:0,remainingOlder:0});Le(this,"followTick",()=>{var s,o;this.raf=0;const t=this.ports.element();if(!t||!this.follow)return;const n=this.bottomOf(t),a=n-t.scrollTop;if(a<=1||(o=(s=this.ports).reducedMotion)!=null&&o.call(s)){t.scrollTop=n,this.lastScrollTop=t.scrollTop,this.lastMaxTop=n;return}t.scrollTop+=Math.max(10,Math.ceil(a*.3)),this.lastScrollTop=t.scrollTop,this.lastMaxTop=n,this.raf=this.frames.request(this.followTick)});this.ports=t,this.frames=t.frames??{request:n=>requestAnimationFrame(n),cancel:n=>cancelAnimationFrame(n)}}reset(){this.follow=!1,this.prevPendingCount=0,this.anchor=null,this.cancelFollow(),this.setFlags({loadingOlder:!1,showScrollButton:!1})}dispose(){this.cancelFollow()}onContent(t){this.content=t;const n=this.ports.element();if(n){if(this.initializedFor!==t.chatId&&t.itemCount>0){this.initializedFor=t.chatId,this.follow=!1,n.scrollTop=this.bottomOf(n),this.lastScrollTop=n.scrollTop,this.lastMaxTop=this.bottomOf(n),this.prevPendingCount=t.pendingCount,this.setFlags({showScrollButton:!1});return}t.pendingCount>this.prevPendingCount&&(this.follow=!0),this.prevPendingCount=t.pendingCount,this.follow?this.scheduleFollow():this.updateButton(n)}}onScroll(){const t=this.ports.element();if(!t)return;const n=this.bottomOf(t);qI(t.scrollTop,this.lastScrollTop,n,this.lastMaxTop)&&(this.follow=!1),this.lastScrollTop=t.scrollTop,this.lastMaxTop=n,this.updateButton(t),t.scrollTop<$I&&this.loadOlder()}jumpToLatest(){this.follow=!0,this.setFlags({showScrollButton:!1}),this.scheduleFollow()}restoreAnchor(){if(this.anchor==null)return;const t=this.ports.element();t&&(t.scrollTop=t.scrollHeight-this.anchor),this.anchor=null,this.setFlags({loadingOlder:!1})}loadOlder(){const t=this.ports.element(),n=this.content.chatId;if(!t||!n||this.loadingOlder||this.content.remainingOlder<=0)return;this.setFlags({loadingOlder:!0});const{offset:a,limit:s}=VI(this.content.remainingOlder,YI);this.anchor=t.scrollHeight-t.scrollTop,this.ports.fetchPage(n,a,s).then(o=>{if(this.content.chatId!==n)return this.abandonPage();if(o.length===0)return this.abandonPage();this.ports.prepend(o)}).catch(()=>{this.abandonPage(),console.error("could not load earlier transcript page")})}abandonPage(){this.anchor=null,this.setFlags({loadingOlder:!1})}scheduleFollow(){this.raf||(this.raf=this.frames.request(this.followTick))}cancelFollow(){this.raf&&this.frames.cancel(this.raf),this.raf=0}bottomOf(t){return t.scrollHeight-t.clientHeight}updateButton(t){const n=this.bottomOf(t)-t.scrollTop;this.setFlags({showScrollButton:n>WI})}setFlags(t){const n=t.loadingOlder??this.loadingOlder,a=t.showScrollButton??this.showButton;n===this.loadingOlder&&a===this.showButton||(this.loadingOlder=n,this.showButton=a,this.ports.onFlags({loadingOlder:n,showScrollButton:a}))}}const GI=700,bc=typeof window<"u"?window.matchMedia("(prefers-reduced-motion: reduce)"):null;function l0({chatId:e,attachments:t,onOpen:n}){return T.jsx("div",{className:"msg-attachments",children:t.map(a=>a.kind==="image"?T.jsx("a",{href:dt.previewUrl(e,a.path),target:"_blank",rel:"noopener noreferrer",className:"msg-image-link",children:T.jsx("img",{src:dt.previewUrl(e,a.path),alt:a.name,className:"msg-image",...Vg})},a.path):T.jsxs("button",{type:"button",className:"msg-file",title:a.path,onClick:()=>n(a.path),children:[T.jsx(Q0,{size:14}),T.jsx("span",{className:"msg-file-name",children:a.name}),T.jsx("span",{className:"msg-file-size",children:X0(a.size)})]},a.path))})}const KI=v.memo(function(){const t=xe($=>$.items),n=xe($=>$.streamingText),a=xe($=>$.streamingThought),s=xe($=>$.pending),o=s.some($=>$.status==="sending"),l=xe($=>$.observability.turnStatus),d=xe($=>$.observability.compacting),f=xe($=>$.activeId),h=xe($=>$.openFilePreview),E=xe($=>$.remainingOlder),g=v.useRef({session:null,ids:new Set});g.current.session!==f&&(g.current={session:f,ids:new Set(t.filter($=>$.type==="tool_call").map($=>$.tool.id))});const x=$=>!g.current.ids.has($),[b,S]=v.useState(!1);v.useEffect(()=>{if(S(!1),l!=="running")return;const $=setTimeout(()=>S(!0),GI);return()=>clearTimeout($)},[l,n,a,t.length]);const A=v.useRef(null),[P,R]=v.useState({loadingOlder:!1,showScrollButton:!1}),F=v.useRef(null);F.current||(F.current=new QI({element:()=>A.current,fetchPage:($,j,te)=>dt.transcriptPage($,j,te).then(ue=>ue.items),prepend:$=>xe.getState().prependItems($),onFlags:R,reducedMotion:()=>(bc==null?void 0:bc.matches)??!1}));const U=F.current;v.useEffect(()=>(U.reset(),()=>U.dispose()),[f,U]),v.useEffect(()=>{U.onContent({chatId:f,itemCount:t.length,pendingCount:s.length,remainingOlder:E})},[t,n,a,s,f,d,E,U]),v.useLayoutEffect(()=>{U.restoreAnchor()},[t,U]);const K=t.length===0&&!n&&!a&&s.length===0;return T.jsxs("div",{className:"transcript-wrap",children:[P.loadingOlder&&T.jsxs("div",{className:"loading-older",role:"status",children:[T.jsx(yr,{size:14}),T.jsx("span",{children:"Loading earlier messages…"})]}),T.jsxs("div",{className:"transcript",ref:A,onScroll:()=>U.onScroll(),children:[K&&T.jsxs("div",{className:"transcript-empty",children:[T.jsx("p",{className:"empty-title",children:"Casper is here."}),T.jsx("p",{className:"empty-sub",children:"Hand off a task. Casper keeps working server-side and has it ready when you get back."})]}),t.map($=>$.type==="message"?$.message.role==="thinking"?T.jsx(c0,{text:$.message.text},$.message.id):T.jsx("div",{className:`msg msg-${$.message.role}`,children:$.message.role==="assistant"?T.jsx(Xa,{text:$.message.text}):T.jsxs(T.Fragment,{children:[f&&$.message.attachments&&$.message.attachments.length>0&&T.jsx(l0,{chatId:f,attachments:$.message.attachments,onOpen:h}),$.message.text&&T.jsx("div",{className:"msg-user-text",children:$.message.text})]})},$.message.id):$.type==="tool_call"?T.jsx(HI,{tool:$.tool,arriving:x($.tool.id)},$.tool.id):$.type==="turn_error"?T.jsx(XI,{message:$.message},$.id):T.jsx(JI,{summary:$.summary},$.id)),s.map($=>T.jsxs("div",{className:`msg msg-user msg-pending ${$.status==="failed"?"is-failed":""}`,children:[f&&$.attachments&&$.attachments.length>0&&T.jsx(l0,{chatId:f,attachments:$.attachments,onOpen:h}),$.text&&T.jsx("div",{className:"msg-user-text",children:$.text}),$.status==="failed"&&T.jsxs("div",{className:"msg-failed",children:[T.jsx("span",{className:"msg-failed-why",children:$.error??"Failed to send."}),T.jsx("button",{className:"msg-retry",onClick:()=>nt.retrySend($.id),children:"Retry"})]})]},$.id)),a&&T.jsx(c0,{text:a,live:!0}),n&&T.jsx("div",{className:"msg msg-assistant",children:T.jsx(Xa,{text:n,streaming:!0})}),(l==="running"||o)&&(b||!n&&!a)&&T.jsxs("div",{className:"thinking",children:[T.jsx("span",{className:"thinking-dot"}),T.jsx("span",{className:"thinking-dot"}),T.jsx("span",{className:"thinking-dot"})]}),d&&T.jsx("div",{className:"compaction compaction-live",children:T.jsx("div",{className:"compaction-rule",children:T.jsxs("span",{className:"compaction-head",children:[T.jsx(yr,{size:13,className:"compaction-icon"}),T.jsx("span",{className:"compaction-label",children:"Compacting conversation…"})]})})})]}),P.showScrollButton&&T.jsx("button",{className:"scroll-to-bottom",onClick:()=>U.jumpToLatest(),"aria-label":"Scroll to latest",title:"Scroll to latest",children:T.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:T.jsx("polyline",{points:"6 9 12 15 18 9"})})})]})});function c0({text:e,live:t=!1}){const[n,a]=v.useState(!1);return T.jsxs("div",{className:`thought ${t?"is-live":""}`,children:[T.jsxs("button",{className:"thought-head",onClick:()=>a(s=>!s),children:[T.jsx("span",{className:`thought-chevron ${n?"is-open":""}`,children:T.jsx(Yu,{size:13})}),T.jsx("span",{className:`thought-label ${t?"is-live":""}`,children:"Thinking"})]}),n&&T.jsx("div",{className:"thought-body",children:T.jsx("div",{className:"thought-text",children:e})})]})}function XI({message:e}){const[t,n]=v.useState(!1),[a,s]=v.useState(!1),o=B0(e),l=xe(f=>{for(let h=f.items.length-1;h>=0;h--){const E=f.items[h];if(E.type==="message"&&E.message.role==="user")return E.message.text}return""}),d=()=>{var f;(f=navigator.clipboard)==null||f.writeText(e).then(()=>{s(!0),setTimeout(()=>s(!1),1500)},()=>{})};return T.jsxs("div",{className:"sysnote",children:[T.jsx("div",{className:"sysnote-rule",children:T.jsxs("button",{className:"sysnote-head",onClick:()=>n(f=>!f),"aria-expanded":t,children:[T.jsx(W0,{size:13}),T.jsx("span",{className:"sysnote-label",children:o.title}),T.jsx("span",{className:"sysnote-toggle",children:t?"Hide details":"Show details"})]})}),t&&T.jsxs("div",{className:"sysnote-body",children:[o.fix&&T.jsx("p",{className:"sysnote-fix",children:o.fix}),T.jsx("pre",{className:"sysnote-raw",children:e}),T.jsxs("div",{className:"sysnote-actions",children:[l&&T.jsx("button",{className:"btn-sm is-danger",onClick:()=>nt.retryTurn(l),children:"Retry turn"}),T.jsx("button",{className:"btn-sm",onClick:d,children:a?"Copied":"Copy details"})]})]})]})}function JI({summary:e}){const[t,n]=v.useState(!1);return T.jsxs("div",{className:"compaction",children:[T.jsx("div",{className:"compaction-rule",children:T.jsxs("button",{className:"compaction-head",onClick:()=>n(a=>!a),"aria-expanded":t,children:[T.jsx(dx,{size:14,className:"compaction-icon"}),T.jsx("span",{className:"compaction-label",children:"Conversation compacted"}),T.jsx("span",{className:"compaction-toggle",children:t?"Hide summary":"Show summary"})]})}),t&&T.jsx("div",{className:"compaction-body",children:T.jsx(Xa,{text:e})})]})}const mn="/",kc=2;function ZI(e){if(!e||e===mn)return mn;const t=e.replace(/\/+$/,"").lastIndexOf(mn);return t<=0?mn:e.slice(0,t)}function e6(e){const t=[{name:mn,path:mn}];let n="";for(const a of e.split(mn).filter(Boolean))n=`${n}${mn}${a}`,t.push({name:a,path:n});return t}function t6(e,t){return t.slice(e.length).replace(/^\/+/,"")}function n6({initialPath:e,onChange:t,onSubmit:n}){const[a,s]=v.useState(e.trim()),[o,l]=v.useState(""),[d,f]=v.useState(null),[h,E]=v.useState(-1),[g,x]=v.useState(null),b=v.useRef(null),S=v.useRef(null),A=v.useRef(""),P=v.useRef(!1),R=v.useRef(a);R.current=a;const F=v.useRef(t);F.current=t;const U=v.useId(),K=`${U}-listbox`,$=v.useMemo(()=>{if(o.startsWith(mn)||!a)return o;const C=a.endsWith(mn)?a:a+mn;return o?C+o:C},[a,o]);v.useEffect(()=>{A.current=$;const C=setTimeout(()=>{dt.listDirs($).then(O=>{A.current===$&&(f(O),!P.current&&O.dir&&(P.current=!0,R.current||s(O.dir)),F.current(O.target))}).catch(()=>{A.current===$&&f(null)})},150);return()=>clearTimeout(C)},[$]);const j=(d==null?void 0:d.entries)??[],te=(d==null?void 0:d.dir)??a,ue=e6(te),fe=ue.length>kc+2,B=fe?ue.slice(1,-kc):[],ie=fe?ue.slice(-kc):ue.slice(1),ce=ue[0],ke=ue[ue.length-1];v.useEffect(()=>{var O,G;if(h<0)return;const C=(O=S.current)==null?void 0:O.children[h];(G=C==null?void 0:C.scrollIntoView)==null||G.call(C,{block:"nearest"})},[h]);const de=C=>{var O;s(C),l(""),E(-1),(O=b.current)==null||O.focus()},Y=C=>{if(C.key==="ArrowDown"&&j.length>0)C.preventDefault(),E(O=>Math.min(O+1,j.length-1));else if(C.key==="ArrowUp"&&j.length>0)C.preventDefault(),E(O=>Math.max(O-1,-1));else if(C.key==="ArrowLeft"&&C.currentTarget.selectionStart===0&&!o)C.preventDefault(),de(ZI(te));else if(C.key==="Enter"){C.preventDefault();const O=h>=0?j[h]:void 0;O?de(O):n()}else C.key==="Escape"&&h>=0&&(C.stopPropagation(),E(-1))},ge=d==null?void 0:d.target,pe=!!ge&&(d==null?void 0:d.targetKind)==="missing",X=!!ge&&(d==null?void 0:d.targetKind)==="file",oe=(C,O="")=>T.jsx("button",{type:"button",className:`dirpick-crumb ${C===ke?"is-here":""} ${O}`,onClick:()=>C!==ke&&de(C.path),disabled:C===ke,title:C.path,children:C.name});return T.jsxs("div",{className:"dirpick",children:[T.jsxs("div",{className:"dirpick-crumbs",children:[oe(ce),B.length>0&&T.jsx("button",{type:"button",className:"dirpick-crumb dirpick-more","aria-haspopup":"menu","aria-expanded":g!==null,"aria-label":`Show ${B.length} folders above`,title:`${B.length} folders above`,onClick:C=>x(g?null:C.currentTarget),children:T.jsx(Xy,{size:15})}),ie.map((C,O)=>T.jsxs("span",{className:"dirpick-crumb-wrap",children:[(O>0||B.length>0)&&T.jsx("span",{className:"dirpick-sep",children:"/"}),oe(C)]},C.path))]}),g&&T.jsx(G0,{anchor:g,onClose:()=>x(null),children:B.map(C=>T.jsx("button",{className:"menu-item",onClick:()=>{x(null),de(C.path)},children:C.name},C.path))}),T.jsx("input",{ref:b,className:"dirpick-input",role:"combobox","aria-expanded":j.length>0,"aria-controls":K,"aria-autocomplete":"list","aria-label":"Working directory","aria-activedescendant":h>=0?`${U}-opt-${h}`:void 0,value:o,placeholder:"Search folders…",autoComplete:"off",spellCheck:!1,onChange:C=>{l(C.target.value),E(-1)},onKeyDown:Y}),T.jsxs("div",{ref:S,id:K,role:"listbox","aria-label":"Folders",className:"dirpick-list",children:[j.map((C,O)=>T.jsx("button",{id:`${U}-opt-${O}`,type:"button",role:"option","aria-selected":O===h,className:`dirpick-opt ${O===h?"is-active":""}`,title:C,onMouseDown:G=>G.preventDefault(),onClick:()=>de(C),children:T.jsx("span",{className:"dirpick-tail",children:T.jsx("span",{children:t6(te,C)})})},C)),j.length===0&&T.jsx("div",{className:"dirpick-empty",children:o?"Nothing here matches.":"No subfolders."})]}),T.jsxs("div",{className:"dirpick-status","aria-live":"polite",children:[pe&&T.jsx("span",{className:"dirpick-note is-new",children:"This folder will be created"}),X&&T.jsx("span",{className:"dirpick-note is-bad",children:"That path is a file, not a folder"})]})]})}function r6({chatId:e,currentCwd:t,onChanged:n,onClose:a}){const[s,o]=v.useState(t??""),[l,d]=v.useState(!1),[f,h]=v.useState(null),E=v.useRef(!1);v.useEffect(()=>{const x=b=>{b.key==="Escape"&&a()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[a]);const g=async()=>{const x=s.trim();if(!(!x||l)){d(!0),h(null);try{const b=await dt.setChatCwd(e,x);n(b.cwd),a()}catch(b){h(b.message)}finally{d(!1)}}};return T.jsx("div",{className:"sheet-backdrop",onMouseDown:x=>{E.current=x.target===x.currentTarget},onClick:x=>{x.target===x.currentTarget&&E.current&&a(),E.current=!1},children:T.jsxs("div",{className:"sheet",role:"dialog","aria-modal":"true","aria-labelledby":"change-folder-title",children:[T.jsx("h2",{className:"sheet-title",id:"change-folder-title",children:"Change working directory"}),T.jsx(n6,{initialPath:t??"",onChange:o,onSubmit:g}),f&&T.jsx("div",{className:"sheet-error",children:f}),T.jsxs("div",{className:"sheet-actions",children:[T.jsx("button",{className:"btn-ghost",onClick:a,disabled:l,children:"Cancel"}),T.jsx("button",{className:"btn-primary",onClick:g,disabled:l||!s.trim(),children:l?"Saving…":"Change folder"})]})]})})}function i6({name:e}){var n;switch((n=e.split(".").pop())==null?void 0:n.toLowerCase()){case"ts":case"tsx":case"js":case"jsx":case"mjs":case"py":case"rb":case"go":case"rs":case"java":case"c":case"cpp":case"h":case"hpp":case"vue":case"svelte":return T.jsx(Bp,{size:15,className:"ftree-icon-svg ftree-icon-code"});case"json":case"yaml":case"yml":case"toml":case"ini":case"env":case"lock":return T.jsx(ix,{size:15,className:"ftree-icon-svg ftree-icon-config"});case"md":case"txt":case"rst":case"log":case"csv":return T.jsx(ax,{size:15,className:"ftree-icon-svg ftree-icon-text"});case"css":case"scss":case"less":case"sass":return T.jsx(ux,{size:15,className:"ftree-icon-svg ftree-icon-style"});case"html":case"svg":case"xml":return T.jsx(Bp,{size:15,className:"ftree-icon-svg ftree-icon-markup"});case"png":case"jpg":case"jpeg":case"gif":case"webp":case"bmp":case"ico":case"avif":return T.jsx(sx,{size:15,className:"ftree-icon-svg ftree-icon-image"});case"sh":case"bash":case"zsh":case"fish":case"bat":case"ps1":return T.jsx(ox,{size:15,className:"ftree-icon-svg ftree-icon-terminal"});default:return T.jsx(Q0,{size:15,className:"ftree-icon-svg"})}}function Xg({entry:e,chatId:t,depth:n,onPreview:a,onExpanded:s}){const o=xe(g=>g.fsVersion[e.path]??0),[l,d]=v.useState({expanded:!1,children:null,loading:!1});v.useEffect(()=>{if(e.type==="directory")return s(e.path,l.expanded),()=>s(e.path,!1)},[e.path,e.type,l.expanded,s]),v.useEffect(()=>{if(!o||!l.expanded)return;let g=!0;return dt.tree(t,e.path).then(x=>{g&&d(b=>({...b,children:x.entries}))}).catch(()=>{}),()=>{g=!1}},[o]);const f=v.useCallback(async()=>{if(e.type==="directory"&&!l.loading){if(l.expanded){d(g=>({...g,expanded:!1}));return}if(l.children===null){d(g=>({...g,loading:!0}));try{const g=await dt.tree(t,e.path);d({expanded:!0,children:g.entries,loading:!1})}catch{d(g=>({...g,loading:!1}))}}else d(g=>({...g,expanded:!0}))}},[e,t,l.expanded,l.children,l.loading]),h=v.useCallback(()=>{e.type==="file"&&a(e)},[e,a]),E=n*16;return e.type==="directory"?T.jsxs(T.Fragment,{children:[T.jsxs("button",{className:"ftree-row ftree-dir",onClick:f,style:{paddingLeft:`${E+8}px`},children:[T.jsx("span",{className:`ftree-chevron ${l.expanded?"is-open":""}`,children:l.loading?T.jsx(yr,{size:12}):T.jsx(Yu,{size:12,className:"ftree-chevron-icon"})}),T.jsx("span",{className:"ftree-icon",children:l.expanded?T.jsx(rx,{size:15,className:"ftree-icon-svg ftree-icon-folder"}):T.jsx(q0,{size:15,className:"ftree-icon-svg ftree-icon-folder"})}),T.jsx("span",{className:"ftree-name",children:e.name})]}),l.expanded&&l.children&&T.jsxs("div",{className:"ftree-children",children:[l.children.map(g=>T.jsx(Xg,{entry:g,chatId:t,depth:n+1,onPreview:a,onExpanded:s},g.path)),l.children.length===0&&T.jsx("div",{className:"ftree-empty",style:{paddingLeft:`${E+24}px`},children:"Empty"})]})]}):T.jsxs("div",{className:"ftree-row ftree-file",style:{paddingLeft:`${E+8}px`},onClick:h,children:[T.jsx("span",{className:"ftree-chevron ftree-chevron-spacer","aria-hidden":"true"}),T.jsx("span",{className:"ftree-icon",children:T.jsx(i6,{name:e.name})}),T.jsx("span",{className:"ftree-name",children:e.name}),e.size!=null&&T.jsx("span",{className:"ftree-size",children:X0(e.size)})]})}function a6({chatId:e,onClose:t}){var j;const[n,a]=v.useState([]),[s,o]=v.useState(""),[l,d]=v.useState(!0),[f,h]=v.useState(null),[E,g]=v.useState(!1),x=xe(te=>te.chats),b=xe(te=>te.setWatchedPaths),S=xe(te=>te.fsVersion[""]??0),A=v.useRef(new Set),P=xe(te=>te.setChats),R=xe(te=>te.openFilePreview),F=(j=x.find(te=>te.chatId===e))==null?void 0:j.cwd,U=v.useCallback(()=>{b(["",...A.current])},[b]),K=v.useCallback((te,ue)=>{const fe=A.current;ue!==fe.has(te)&&(ue?fe.add(te):fe.delete(te),U())},[U]);v.useEffect(()=>(U(),()=>b([])),[U,b]);const $=v.useCallback(async(te=!1)=>{te||d(!0),h(null);try{const ue=await dt.tree(e);a(ue.entries),o(ue.cwd)}catch(ue){h(ue.message)}finally{te||d(!1)}},[e]);return v.useEffect(()=>{$()},[$]),v.useEffect(()=>{S&&$(!0)},[S]),T.jsxs("div",{className:"ftree-panel",children:[T.jsxs("div",{className:"ftree-header",children:[T.jsx("span",{className:"ftree-title",title:s,children:"Files"}),T.jsx("button",{className:"ftree-refresh",onClick:()=>g(!0),title:"Change working directory","aria-label":"Change working directory",children:T.jsx(q0,{size:14})}),t&&T.jsx("button",{className:"ftree-close",onClick:t,title:"Close file tree","aria-label":"Close file tree",children:T.jsx(ud,{size:15})})]}),s&&T.jsx("div",{className:"ftree-cwd",title:s,children:s}),T.jsxs("div",{className:"ftree-list",children:[l&&n.length===0&&T.jsx("div",{className:"ftree-loading",children:"Loading…"}),f&&T.jsxs("div",{className:"ftree-error",children:[f,T.jsx("button",{className:"ftree-repoint",onClick:()=>g(!0),children:"Change folder…"})]}),!l&&!f&&n.length===0&&T.jsx("div",{className:"ftree-empty",children:"No files"}),!f&&n.map(te=>T.jsx(Xg,{entry:te,chatId:e,depth:0,onPreview:ue=>R(ue.path),onExpanded:K},te.path))]}),E&&T.jsx(r6,{chatId:e,currentCwd:s||F,onChanged:te=>{P(x.map(ue=>ue.chatId===e?{...ue,cwd:te}:ue)),$()},onClose:()=>g(!1)})]})}const Cc=e=>e.split("/").pop()||e;function s6({preview:e,chatId:t,onClose:n}){const[a,s]=v.useState(!1),[o,l]=v.useState({}),d=()=>{window.open(dt.downloadUrl(t,e.path),"_blank")},f=b=>{b.target===b.currentTarget&&n()};v.useEffect(()=>{const b=S=>{S.key==="Escape"&&n()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[n]);const h=o[e.path]??!1,E=e.kind==="html"||e.kind==="markdown",g=E&&!h,x=e.kind!=="image"&&e.kind!=="pdf"&&!g;return T.jsx("div",{className:"fpreview-backdrop",onClick:f,children:T.jsxs("div",{className:`fpreview-modal${a?" fpreview-full":""}`,children:[T.jsxs("div",{className:"fpreview-header",children:[E&&!e.error&&T.jsxs("div",{className:"fpreview-seg",role:"group","aria-label":"Preview mode",children:[T.jsx("button",{className:`fpreview-seg-btn${h?"":" is-active"}`,onClick:()=>l(b=>({...b,[e.path]:!1})),title:"Rendered","aria-label":"Rendered","aria-pressed":!h,children:T.jsx(fx,{size:17})}),T.jsx("button",{className:`fpreview-seg-btn${h?" is-active":""}`,onClick:()=>l(b=>({...b,[e.path]:!0})),title:"Source","aria-label":"Source","aria-pressed":h,children:T.jsx(hx,{size:17})})]}),T.jsx("span",{className:"fpreview-name",title:e.path,children:e.name}),T.jsx("button",{className:"fpreview-dl",onClick:d,title:"Download file","aria-label":"Download file",children:T.jsx(lx,{size:18})}),T.jsx("button",{className:"fpreview-full-btn",onClick:()=>s(b=>!b),title:a?"Exit fullscreen":"Fullscreen","aria-label":a?"Exit fullscreen":"Fullscreen",children:a?T.jsx(mx,{size:18}):T.jsx(px,{size:18})}),T.jsx("button",{className:"fpreview-close",onClick:n,"aria-label":"Close preview",children:T.jsx(ud,{size:18})})]}),T.jsxs("div",{className:"fpreview-body",children:[e.loading&&T.jsx("div",{className:"fpreview-loading",children:T.jsx(yr,{size:48})}),e.error&&T.jsx("div",{className:"ftree-error",children:e.error}),!e.loading&&!e.error&&e.kind==="image"&&T.jsx("img",{src:dt.previewUrl(t,e.path),alt:e.name,className:"fpreview-image"}),!e.error&&e.kind==="pdf"&&T.jsx("iframe",{src:dt.previewUrl(t,e.path),title:e.name,className:"fpreview-pdf"}),!e.error&&e.kind==="html"&&g&&T.jsx("iframe",{src:`${dt.previewUrl(t,e.path)}&raw=1`,title:e.name,className:"fpreview-html",sandbox:"allow-scripts allow-forms"}),!e.loading&&!e.error&&e.kind==="markdown"&&g&&e.content!==null&&T.jsx("div",{className:"fpreview-md",children:T.jsx(Xa,{text:e.content,html:!0})}),!e.loading&&!e.error&&x&&e.highlightedHtml&&T.jsx("div",{className:"fpreview-highlighted",dangerouslySetInnerHTML:{__html:e.highlightedHtml}}),!e.loading&&!e.error&&x&&!e.highlightedHtml&&e.content!==null&&T.jsx("pre",{className:"fpreview-code",children:e.content})]})]})})}function u6(){const e=xe(l=>l.previewPath),t=xe(l=>l.activeId),n=xe(l=>l.closeFilePreview),[a,s]=v.useState(null),o=v.useCallback(()=>n(),[n]);return v.useEffect(()=>{if(!e||!t){s(null);return}let l=!1;const d=Zw(Cc(e)),f=d!=="image"&&d!=="pdf";if(s({path:e,name:Cc(e),content:null,highlightedHtml:null,kind:d,loading:f,error:null}),!!f)return(async()=>{try{const h=await fetch(dt.previewUrl(t,e),{credentials:"same-origin"});if(!h.ok)throw new Error(await h.text()||`HTTP ${h.status}`);const E=await h.text();if(l)return;s(b=>b&&b.path===e?{...b,content:E,loading:!1}:b);const g=Qg(Cc(e));if(!g)return;const x=await wd(E,g);if(l||!x)return;s(b=>b&&b.path===e?{...b,highlightedHtml:x}:b)}catch(h){if(l)return;s(E=>E&&E.path===e?{...E,loading:!1,error:h instanceof Error?h.message:"Could not read the file"}:E)}})(),()=>{l=!0}},[e,t]),!a||!t?null:es.createPortal(T.jsx(s6,{preview:a,chatId:t,onClose:o}),document.body)}function Jg({ariaLabel:e,value:t,options:n,onChange:a}){const[s,o]=v.useState(!1),[l,d]=v.useState(0),f=v.useRef(null),h=n.find(x=>x.value===t);v.useEffect(()=>{if(!s)return;const x=b=>{f.current&&!f.current.contains(b.target)&&o(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[s]),v.useEffect(()=>{if(!s)return;const x=n.findIndex(b=>b.value===t);d(x>=0?x:0)},[s]);const E=x=>{a(x),o(!1)},g=x=>{if(!s){(x.key==="Enter"||x.key===" "||x.key==="ArrowDown")&&(x.preventDefault(),o(!0));return}if(x.key==="Escape")o(!1);else if(x.key==="ArrowDown")x.preventDefault(),d(b=>Math.min(b+1,n.length-1));else if(x.key==="ArrowUp")x.preventDefault(),d(b=>Math.max(b-1,0));else if(x.key==="Enter"){x.preventDefault();const b=n[l];b&&E(b.value)}};return T.jsxs("div",{className:"dd",ref:f,children:[T.jsxs("button",{type:"button",className:`dd-trigger ${s?"is-open":""}`,"aria-haspopup":"listbox","aria-expanded":s,onClick:()=>o(x=>!x),onKeyDown:g,"aria-label":e,children:[T.jsx("span",{className:"dd-value",children:(h==null?void 0:h.label)??t??"Select…"}),T.jsx(Yu,{size:13,className:"dd-chevron"})]}),s&&T.jsx("div",{className:"dd-panel",role:"listbox",children:n.map((x,b)=>T.jsxs("button",{type:"button",role:"option","aria-selected":x.value===t,className:`dd-option ${b===l?"is-active":""} ${x.value===t?"is-selected":""}`,onMouseEnter:()=>d(b),onClick:()=>E(x.value),children:[T.jsx("span",{className:"dd-check",children:x.value===t&&T.jsx(ex,{size:15})}),T.jsx("span",{className:"dd-option-label",children:x.label}),x.hint&&T.jsx("span",{className:"dd-option-hint",children:x.hint})]},x.value))})]})}function o6({value:e,onChange:t}){var s;const n=xe(o=>o.models),a=e??((s=n.find(o=>o.isDefault))==null?void 0:s.modelId);return T.jsx(Jg,{ariaLabel:"Model",value:a,onChange:t,options:n.map(o=>({value:o.modelId,label:o.modelName,hint:`${o.rateMultiplier}x`}))})}function l6({value:e,onChange:t}){const n=xe(d=>d.modes),a=xe(d=>d.agents),s=xe(d=>d.defaultAgentId),o=n.length>0?n:a,l=e??s;return T.jsx(Jg,{ariaLabel:"Agent",value:l,onChange:t,options:o.map(d=>({value:d.id,label:d.name}))})}const pn=18,Yc=2.5,Vc=(pn-Yc)/2,d0=2*Math.PI*Vc;function c6(e){return e>85?"var(--aurora-red)":e>60?"var(--aurora-orange)":"var(--frost)"}const f0=new Intl.NumberFormat;function d6(){var S;const e=xe(A=>A.observability.contextUsagePercentage),t=xe(A=>A.observability.compacting),n=xe(A=>A.observability.turnStatus),a=xe(A=>A.activeId),s=xe(A=>A.currentModelId),o=xe(A=>A.models),[l,d]=v.useState(!1),f=v.useRef(null);v.useEffect(()=>{if(!l)return;const A=R=>{f.current&&!f.current.contains(R.target)&&d(!1)},P=R=>{R.key==="Escape"&&d(!1)};return document.addEventListener("mousedown",A),document.addEventListener("keydown",P),()=>{document.removeEventListener("mousedown",A),document.removeEventListener("keydown",P)}},[l]);const h=Math.max(0,Math.min(100,e)),E=c6(h),g=h/100*d0,x=(S=o.find(A=>A.modelId===s))==null?void 0:S.contextWindowTokens,b=x?Math.round(h/100*x):void 0;return a?T.jsxs("div",{className:"ctx",ref:f,children:[T.jsx("button",{type:"button",className:"ctx-btn",onClick:()=>d(A=>!A),"aria-haspopup":"dialog","aria-expanded":l,"aria-label":`Context ${h.toFixed(0)}% used`,title:`Context ${h.toFixed(0)}% used`,children:T.jsx("svg",{width:pn,height:pn,viewBox:`0 0 ${pn} ${pn}`,"aria-hidden":!0,children:T.jsxs("g",{transform:`rotate(-90 ${pn/2} ${pn/2})`,children:[T.jsx("circle",{cx:pn/2,cy:pn/2,r:Vc,fill:"none",stroke:"var(--n2)",strokeWidth:Yc}),T.jsx("circle",{cx:pn/2,cy:pn/2,r:Vc,fill:"none",stroke:E,strokeWidth:Yc,strokeLinecap:"round",strokeDasharray:`${g} ${d0-g}`})]})})}),l&&T.jsxs("div",{className:"ctx-pop",role:"dialog","aria-label":"Context usage",children:[T.jsxs("div",{className:"ctx-pop-head",children:[T.jsx("span",{className:"ctx-pop-title",children:"Context used"}),T.jsxs("span",{className:"ctx-pop-pct",style:{color:E},children:[h.toFixed(1),"%"]})]}),T.jsx("div",{className:"ctx-pop-bar",children:T.jsx("span",{className:"ctx-pop-bar-fill",style:{width:`${h}%`,background:E}})}),x?T.jsxs("dl",{className:"ctx-pop-rows",children:[T.jsxs("div",{className:"ctx-pop-row",children:[T.jsx("dt",{children:"Used"}),T.jsxs("dd",{children:[f0.format(b??0)," tokens"]})]}),T.jsxs("div",{className:"ctx-pop-row",children:[T.jsx("dt",{children:"Window"}),T.jsxs("dd",{children:[f0.format(x)," tokens"]})]})]}):T.jsx("p",{className:"ctx-pop-note",children:"Token counts need a selected model’s window size."}),T.jsx("button",{type:"button",className:"ctx-pop-compact",disabled:t||n!=="idle",onClick:()=>{d(!1),nt.compact()},children:t?"Compacting…":"Compact conversation"})]})]}):null}const f6={closed:"Offline - reconnecting when possible",reconnecting:"Reconnecting…",resyncing:"Resyncing…"};function h6(e){return e.live?e.uploading?"Uploading…":e.cancelling?"Stopping…":e.compacting?"Compacting conversation…":e.running?"Casper is working…":"Ask Casper to build something…":f6[e.connStatus]??"Connecting…"}const h0=new Set(["image/png","image/jpeg","image/gif","image/webp","image/svg+xml"]);function p6({chatId:e,connStatus:t,draft:n}){const[a,s]=v.useState(""),[o,l]=v.useState([]),[d,f]=v.useState(!1),[h,E]=v.useState(null),g=xe(Y=>Y.observability.turnStatus),x=xe(Y=>Y.observability.compacting),b=xe(Y=>Y.currentModeId),S=xe(Y=>Y.currentModelId),A=g==="running",P=g==="cancelling",R=n||t==="connected",F=v.useRef(null),U=v.useRef(null),K=Y=>new Promise((ge,pe)=>{const X=new FileReader;X.onload=()=>ge(X.result.split(",")[1]??""),X.onerror=()=>pe(new Error("Failed to read file")),X.readAsDataURL(Y)}),$=v.useCallback(()=>{const Y=U.current;Y&&(Y.style.height="auto",Y.style.height=`${Math.min(Y.scrollHeight,200)}px`)},[]);v.useEffect(()=>{$()},[a,$]);const j=v.useCallback(Y=>{const ge=Y.map(pe=>{const X=h0.has(pe.type);return{id:`att-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,file:pe,isImage:X,previewUrl:X?URL.createObjectURL(pe):void 0}});l(pe=>[...pe,...ge])},[]),te=async(Y,ge,pe)=>{const X=[];Y.length>0&&X.push({type:"text",text:M0+Y.map(oe=>oe.path).join(", ")+`
|
|
249
|
-
`});for(let oe=0;oe<Y.length;oe++){const C=Y[oe],O=ge[oe];if(C&&C.kind==="image"&&O)try{const G=await K(O.file);X.push({type:"image",data:G,mimeType:C.mimeType})}catch{}}return pe&&X.push({type:"text",text:pe}),X},ue=async()=>{const Y=a.trim();if(!Y&&o.length===0||A||P||x||!R||d)return;let ge=[];const pe=o;if(pe.length>0){if(!e){E("No chat to upload to.");return}f(!0),E(null);try{ge=(await dt.uploadFiles(e,pe.map(C=>C.file))).files}catch(oe){E(oe.message),f(!1);return}f(!1)}const X=await te(ge,pe,Y);X.length!==0&&(nt.send(X,ge.map(oe=>({path:oe.path,name:oe.name,size:oe.size,kind:oe.kind}))),s(""),pe.forEach(oe=>oe.previewUrl&&URL.revokeObjectURL(oe.previewUrl)),l([]),requestAnimationFrame(()=>{U.current&&(U.current.style.height="auto")}))},fe=Y=>{Y.key==="Enter"&&!Y.shiftKey&&(Y.preventDefault(),ue())},B=v.useCallback(Y=>{var X;const ge=(X=Y.clipboardData)==null?void 0:X.items;if(!ge)return;const pe=[];for(const oe of Array.from(ge))if(oe.kind==="file"&&h0.has(oe.type)){const C=oe.getAsFile();C&&pe.push(C)}pe.length>0&&(Y.preventDefault(),j(pe))},[j]),ie=Y=>{Y.target.files&&j(Array.from(Y.target.files)),Y.target.value=""},ce=Y=>{l(ge=>{const pe=ge.find(X=>X.id===Y);return pe!=null&&pe.previewUrl&&URL.revokeObjectURL(pe.previewUrl),ge.filter(X=>X.id!==Y)})};v.useEffect(()=>()=>{l(Y=>(Y.forEach(ge=>ge.previewUrl&&URL.revokeObjectURL(ge.previewUrl)),Y))},[]);const ke=h6({live:R,connStatus:t,uploading:d,cancelling:P,compacting:x,running:A}),de=(a.trim()||o.length>0)&&!A&&!P&&!x&&!d&&R;return T.jsxs("div",{className:"composer",children:[h&&T.jsx("div",{className:"composer-error",children:h}),o.length>0&&T.jsx("div",{className:"composer-attachments",children:o.map(Y=>T.jsxs("div",{className:"composer-att",children:[Y.isImage&&Y.previewUrl?T.jsx("img",{src:Y.previewUrl,alt:Y.file.name,className:"composer-att-img"}):T.jsxs("div",{className:"composer-att-file",title:Y.file.name,children:[T.jsx("span",{className:"composer-att-file-icon",children:"📄"}),T.jsx("span",{className:"composer-att-file-name",children:Y.file.name})]}),T.jsx("button",{className:"composer-att-remove",onClick:()=>ce(Y.id),"aria-label":`Remove ${Y.file.name}`,children:"×"})]},Y.id))}),T.jsxs("div",{className:"composer-box",children:[T.jsx("textarea",{ref:U,className:"composer-input",value:a,onChange:Y=>s(Y.target.value),onKeyDown:fe,onPaste:B,placeholder:ke,rows:1}),T.jsxs("div",{className:"composer-actions",children:[T.jsx("button",{className:"composer-plus",onClick:()=>{var Y;return(Y=F.current)==null?void 0:Y.click()},disabled:!R||d,title:"Add photos & files","aria-label":"Add photos and files",children:T.jsx(Y0,{size:18})}),T.jsxs("div",{className:"composer-actions-right",children:[T.jsx(d6,{}),T.jsx(l6,{value:b,onChange:Y=>nt.changeAgent(Y)}),T.jsx(o6,{value:S,onChange:Y=>nt.changeModel(Y)}),A?T.jsx("button",{className:"composer-btn composer-stop",onClick:()=>nt.cancel(),title:"Stop","aria-label":"Stop",children:T.jsx(Fp,{size:15})}):P?T.jsx("button",{className:"composer-btn composer-stop",disabled:!0,title:"Stopping…","aria-label":"Stopping",children:T.jsx(Fp,{size:15})}):T.jsx("button",{className:"composer-btn composer-send",onClick:ue,disabled:!de,title:d?"Uploading…":"Send","aria-label":d?"Uploading":"Send",children:d?T.jsx(yr,{size:15}):T.jsx(nx,{size:17})})]})]})]}),T.jsx("input",{ref:F,type:"file",multiple:!0,onChange:ie,className:"composer-file-input"})]})}const m6={connecting:{cls:"busy",label:"Connecting"},replaying:{cls:"busy",label:"Catching up"},connected:{cls:"ok",label:"Live"},reconnecting:{cls:"busy",label:"Reconnecting"},resyncing:{cls:"busy",label:"Resyncing"},closed:{cls:"down",label:"Offline"}};function g6({status:e}){const{cls:t,label:n}=m6[e];return T.jsxs("span",{className:`conndot conndot-${t}`,children:[T.jsx("span",{className:"conndot-blip"}),T.jsx("span",{className:"conndot-label",children:n})]})}function E6({isDraft:e,navOpen:t,onToggleNav:n}){const a=xe(K=>K.loadingChatId),s=xe(K=>K.connStatus),o=xe(K=>K.createError),l=xe(K=>{var $;return($=K.chats.find(j=>j.chatId===K.activeId))==null?void 0:$.title}),d=xe(K=>e&&K.pending.length===0&&K.items.length===0),f=xe(K=>K.activeId),h=xe(K=>K.chatId),E=xe(K=>K.chatNotice),g=xe(K=>K.reloadingId!==null&&K.reloadingId===K.activeId),x=xe(K=>K.observability.turnStatus==="running"),b=xe(K=>K.dismissChatNotice),[S,A]=v.useState(!1);if(v.useEffect(()=>{A(!1)},[f]),a)return T.jsxs("main",{className:"chatpane",children:[T.jsxs("header",{className:"chat-head",children:[T.jsx("button",{className:"navbtn",onClick:n,"aria-label":t?"Hide sessions":"Show sessions","aria-expanded":t,children:T.jsx(ec,{size:20})}),T.jsx("span",{className:"chat-title",children:"Opening session…"})]}),T.jsx("div",{className:"chat-blank",children:T.jsx(yr,{size:48,className:"chat-spinner"})})]});if(o)return T.jsxs("main",{className:"chatpane",children:[T.jsxs("header",{className:"chat-head",children:[T.jsx("button",{className:"navbtn",onClick:n,"aria-label":t?"Hide sessions":"Show sessions","aria-expanded":t,children:T.jsx(ec,{size:20})}),T.jsx("span",{className:"chat-title",children:"New session"})]}),T.jsxs("div",{className:"chat-blank",children:[T.jsx("p",{className:"chat-blank-title",children:"Couldn't start the session"}),T.jsx("p",{className:"chat-blank-sub",children:o}),T.jsxs("div",{className:"chat-error-actions",children:[T.jsx("button",{className:"btn-primary",onClick:()=>nt.retryCreate(),children:"Try again"}),T.jsx("button",{className:"btn-ghost",onClick:()=>nt.dismissCreateError(),children:"Back to sessions"})]})]})]});const P=E&&T.jsxs("div",{className:"notice-banner",role:"alert",children:[T.jsx(W0,{size:16,className:"notice-icon"}),T.jsxs("div",{className:"notice-text",children:[T.jsx("p",{className:"notice-title",children:E.title}),E.fix&&T.jsx("p",{className:"notice-sub",children:E.fix})]}),T.jsx("button",{className:"notice-x",onClick:b,"aria-label":"Dismiss",children:T.jsx(ud,{size:14})})]}),R=T.jsxs("div",{className:"composer-wrap",children:[P,T.jsx(p6,{chatId:h,connStatus:s,draft:e})]}),F=T.jsxs("div",{className:"chat-draft",children:[T.jsxs("div",{className:"draft-hero",children:[T.jsx("img",{className:"draft-logo",src:"/logo.svg",alt:""}),T.jsx("h1",{className:"draft-title",children:"Casper"})]}),R]}),U=T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"chat-body",children:T.jsx(KI,{})}),R]});return T.jsxs("main",{className:`chatpane chatpane-split ${S?"has-tree":""}`,children:[T.jsxs("div",{className:"chat-col",children:[T.jsxs("header",{className:"chat-head",children:[T.jsx("button",{className:"navbtn",onClick:n,"aria-label":t?"Hide sessions":"Show sessions","aria-expanded":t,children:T.jsx(ec,{size:20})}),!e&&T.jsx("span",{className:"chat-title",title:l,children:l??"Session"}),!e&&T.jsx(g6,{status:s}),!e&&T.jsx("button",{className:"chat-head-btn chat-reload",onClick:()=>void nt.reloadChat(),disabled:g||x,title:x?"Reload after the turn":"Reload session","aria-label":"Reload session",children:g?T.jsx(yr,{size:18}):T.jsx(Zy,{size:18})}),!e&&T.jsx("button",{className:`chat-head-btn ftree-toggle ${S?"is-active":""}`,onClick:()=>A(K=>!K),title:"Toggle file tree","aria-label":"Toggle file tree","aria-pressed":S,children:T.jsx(cx,{size:18})})]}),d?F:U]}),f&&T.jsxs("aside",{className:`ftree-aside ${S?"is-open":""}`,children:[S&&T.jsx(a6,{chatId:f,onClose:()=>A(!1)}),T.jsx(u6,{})]}),f&&S&&T.jsx("div",{className:"ftree-backdrop",onClick:()=>A(!1),"aria-hidden":!0})]})}function T6({onReady:e}){const[t,n]=v.useState(""),[a,s]=v.useState(null),[o,l]=v.useState(!1),d=async()=>{l(!0),s(null);try{await zy(t.trim()),e()}catch(f){s(f.message)}finally{l(!1)}};return T.jsxs("div",{className:"gate",children:[T.jsx("img",{className:"gate-logo",src:"/logo.svg",alt:""}),T.jsx("h1",{className:"gate-title",children:"Casper"}),T.jsx("p",{className:"gate-sub",children:"Enter your access token to continue."}),T.jsx("input",{className:"gate-input",type:"password",value:t,placeholder:"access token",onChange:f=>n(f.target.value),onKeyDown:f=>f.key==="Enter"&&d()}),a&&T.jsx("p",{className:"gate-error",children:a}),T.jsx("button",{className:"btn-primary gate-btn",onClick:d,disabled:o,children:o?"Checking…":"Continue"}),T.jsxs("p",{className:"gate-hint",children:["Don't have it? On the machine running Casper, run ",T.jsx("code",{children:"casper token"}),"."]})]})}const _c=768;function y6(){const[e,t]=v.useState("checking");return v.useEffect(()=>{e==="checking"&&dt.listChats().then(n=>{xe.getState().setChats(n.chats),t("ready")}).catch(()=>t("gate"))},[e]),e==="checking"?T.jsx("div",{className:"app-splash"}):e==="gate"?T.jsx(T6,{onReady:()=>t("ready")}):T.jsx(Sy,{children:T.jsxs(ty,{children:[T.jsxs(Ai,{element:T.jsx(x6,{onLock:()=>t("gate")}),children:[T.jsx(Ai,{index:!0,element:null}),T.jsx(Ai,{path:sd,element:null}),T.jsx(Ai,{path:H0,element:null})]}),T.jsx(Ai,{path:"*",element:T.jsx(Z2,{to:"/",replace:!0})})]})})}function x6({onLock:e}){var b;const t=xe(S=>S.chats),n=xe(S=>S.activeId),a=xe(S=>S.watchedPaths),s=xe(S=>S.connStatus),o=xe(S=>S.loadingChatId),l=Jc(),d=((b=Ip(H0))==null?void 0:b.params.chatId)??null,f=Ip(sd)!==null||!d&&n===null;v.useEffect(()=>{nt.attach({navigate:l,onLock:e})},[l,e]),v.useEffect(()=>{nt.loadPickers(),xe.getState().chats.length===0&&nt.refreshSessions()},[]),v.useEffect(()=>{nt.syncRoute(d,f)},[d,f]),v.useEffect(()=>{s==="connected"&&nt.watchPaths(a)},[a,s]);const h=v.useCallback(()=>{$y(),nt.lock()},[]),[E,g]=v.useState(()=>window.innerWidth>_c);v.useEffect(()=>{const S=window.matchMedia(`(max-width: ${_c}px)`),A=P=>g(!P.matches);return S.addEventListener("change",A),()=>S.removeEventListener("change",A)},[]);const x=v.useCallback(()=>{window.innerWidth<=_c&&g(!1)},[]);return T.jsxs("div",{className:`layout ${E?"nav-open":""}`,children:[T.jsx(bx,{sessions:t,activeId:n,loadingId:o,onOpen:S=>{nt.markLoading(S),x()},onNew:()=>{nt.startDraft(),x()},onDelete:S=>void nt.deleteChat(S),onRename:(S,A)=>void nt.renameChat(S,A),onLock:h}),E&&T.jsx("button",{className:"nav-scrim","aria-label":"Close session panel",onClick:()=>g(!1)}),T.jsx(E6,{navOpen:E,onToggleNav:()=>g(S=>!S),isDraft:f})]})}if("serviceWorker"in navigator){const e=!!navigator.serviceWorker.controller;let t=!1;navigator.serviceWorker.addEventListener("controllerchange",()=>{t||!e||(t=!0,window.location.reload())}),navigator.serviceWorker.ready.then(n=>{n.update().catch(()=>{}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&n.update().catch(()=>{})})}).catch(()=>{})}n2.createRoot(document.getElementById("root")).render(T.jsx(Pa.StrictMode,{children:T.jsx(y6,{})}));export{XC as S,Ac as _,Xu as c,qc as g,EN as h,TN as s,O1 as v,$r as w};
|
|
247
|
+
</html>`}const kI=bI(),CI=256*1024;function _I(){const e=getComputedStyle(document.documentElement),t=n=>e.getPropertyValue(n).trim();return[`--color-background-primary:${t("--n0")}`,`--color-background-secondary:${t("--n1")}`,`--color-border:${t("--n2")}`,`--color-text-secondary:${t("--n4")}`,`--color-text-primary:${t("--n5")}`,`--color-accent:${t("--frost")}`,`--color-accent-alt:${t("--aurora-purple")}`,`--color-teal:${t("--frost-teal")}`,`--color-green:${t("--aurora-green")}`,`--color-yellow:${t("--aurora-yellow")}`,`--color-orange:${t("--aurora-orange")}`,`--color-red:${t("--aurora-red")}`,`--font-body:${t("--font-body")}`,`--font-mono:${t("--font-mono")}`].join(";")}function SI({code:e}){const t=v.useRef(null),[n,a]=v.useState(!1),[s,o]=v.useState(120),l=e.length>CI;v.useEffect(()=>{const f=t.current;if(!f)return;const h=E=>{if(E.source!==f.contentWindow)return;const g=E.data;(g==null?void 0:g.type)==="casper:height"&&typeof g.height=="number"?o(Math.min(Math.max(g.height,40),2e3)):(g==null?void 0:g.type)==="casper:prompt"&&typeof g.text=="string"&&$0(g.text)};return window.addEventListener("message",h),()=>window.removeEventListener("message",h)},[]),v.useEffect(()=>{var f,h;n&&((h=(f=t.current)==null?void 0:f.contentWindow)==null||h.postMessage({type:"casper:theme",css:_I()},"*"))},[n]),v.useEffect(()=>{var f,h;!n||l||(h=(f=t.current)==null?void 0:f.contentWindow)==null||h.postMessage({type:"casper:html",html:e.trimStart()},"*")},[e,n,l]);const d=()=>a(!0);return l?T.jsxs("div",{className:"widget-error",children:["Widget is ",Math.round(e.length/1024)," KB, too large to render."]}):T.jsx("div",{className:"widget-wrap",style:{height:s},children:T.jsx("iframe",{ref:t,className:"widget-frame",title:"Widget",sandbox:"allow-scripts",srcDoc:kI,onLoad:d})})}const NI={pending:"queued",in_progress:"running",completed:"done",failed:"failed"},kt=e=>e&&typeof e=="object"?e:null,$e=e=>typeof e=="string"?e:void 0,s0=e=>e.split("/").pop()||e;function AI(e){const t=Array.isArray(e.operations)?e.operations:[];for(const n of t){const a=kt(n);if(a&&typeof a.path=="string")return a.path;if(a&&Array.isArray(a.image_paths)&&typeof a.image_paths[0]=="string")return a.image_paths[0]}}function vI(e){const t=kt(e.input);if(!t)return null;const n=$e(t.__tool_use_purpose);if(n)return{text:n};switch(Id(e)){case"write":{const a=$e(t.path);return a?{text:s0(a),title:a}:null}case"read":{const a=AI(t);return a?{text:s0(a),title:a}:null}case"grep":{const a=$e(t.pattern);return a?{text:a}:null}case"websearch":case"introspect":{const a=$e(t.query)??$e(t.doc_path);return a?{text:a}:null}case"webfetch":{const a=$e(t.url);if(!a)return null;let s=a;try{s=new URL(a).hostname||a}catch{}return{text:s,title:a}}default:return null}}function Gg(e){const t=kt(e);if(!t||!Array.isArray(t.operations))return[];const n=[];for(const a of t.operations){const s=kt(a);if(s&&s.mode==="Image"&&Array.isArray(s.image_paths))for(const o of s.image_paths)typeof o=="string"&&n.push(o)}return n}const u0=e=>`/api/fs/file?path=${encodeURIComponent(e)}`;function wI({tool:e,arriving:t}){const n=dI(e);if(n)return e.status==="failed"?T.jsxs("div",{className:"widget-error",children:["Widget ",fI(n.title)||"call"," failed."]}):n.code?T.jsx(SI,{code:n.code}):null;const a=hI(e);return a?T.jsx(gI,{data:a,toolId:e.id}):T.jsx(II,{tool:e,arriving:t})}function II({tool:e,arriving:t=!1}){const n=e.status,[a,s]=v.useState(n==="failed"),o=vI(e),l=Gg(e.input);return T.jsxs("div",{className:`toolcall toolcall-${n} ${t?"is-arriving":""}`,children:[T.jsxs("button",{className:"toolcall-head",onClick:()=>s(d=>!d),children:[T.jsx("span",{className:`toolcall-dot dot-${n}`}),T.jsx("span",{className:"toolcall-title",children:sI(e)}),o&&T.jsx("span",{className:"toolcall-summary",title:o.title??o.text,children:o.text}),T.jsx("span",{className:"toolcall-status",children:NI[n]??n}),T.jsx("span",{className:`toolcall-chevron ${a?"is-open":""}`,children:T.jsx(Yu,{size:14})})]}),l.length>0&&T.jsx("div",{className:"toolcall-images",children:l.map(d=>T.jsx("a",{href:u0(d),target:"_blank",rel:"noopener noreferrer",className:"toolcall-image-link",children:T.jsx("img",{src:u0(d),alt:d.split("/").pop()??"image",className:"toolcall-image",...Vg})},d))}),T.jsx(LI,{open:a,children:T.jsx("div",{className:"toolcall-body",children:RI(e)})})]})}function LI({open:e,children:t}){const[n,a]=v.useState(e);v.useEffect(()=>{e&&a(!0)},[e]);const s=o=>{o.propertyName==="grid-template-rows"&&!e&&a(!1)};return T.jsx("div",{className:`collapse ${e?"is-open":""}`,onTransitionEnd:s,children:T.jsx("div",{className:"collapse-inner",children:n?t:null})})}function RI(e){switch(Id(e)){case"shell":return OI(e);case"write":return DI(e);case"read":return PI(e);case"grep":return MI(e);case"todo":return FI(e);case"webfetch":return UI(e);case"websearch":return HI(e);case"introspect":return BI(e);default:return Cr(e)}}function OI(e){const t=kt(e.input),n=$e(t==null?void 0:t.command)??"",a=kr(e),s=Jr(a),o=s?$e(s.stdout)??"":Xr(a),l=s?$e(s.stderr)??"":"",d=s?String(s.exit_status??""):"",f=d!==""&&!/\b0$/.test(d);return T.jsxs(T.Fragment,{children:[n&&T.jsx(sn,{code:n,lang:"bash"}),o.trim()&&T.jsx(sn,{code:o,lang:"text"}),l.trim()&&T.jsxs("div",{className:"toolcall-section",children:[T.jsx("div",{className:"toolcall-label",children:"stderr"}),T.jsx(sn,{code:l,lang:"text"})]}),f&&T.jsx("div",{className:"toolcall-exit",children:d})]})}function Kg({path:e}){const t=xe(l=>l.activeId),n=xe(l=>{var d;return((d=l.chats.find(f=>f.chatId===l.activeId))==null?void 0:d.cwd)??""}),a=xe(l=>l.openFilePreview),s=t?Xw(n,e):null,o=s??e;return s?T.jsx("div",{className:"toolcall-file",children:T.jsx("button",{className:"toolcall-file-name",onClick:()=>a(s),title:`Preview ${e}`,children:o})}):T.jsx("div",{className:"toolcall-file",title:e,children:T.jsx("span",{className:"toolcall-file-name is-plain",children:o})})}function DI(e){const t=kt(e.input),n=$e(t==null?void 0:t.path)??"",a=f=>n?T.jsxs(T.Fragment,{children:[T.jsx(Kg,{path:n}),f]}):f,s=$e(t==null?void 0:t.command);if(s==="create"||s==="insert"){const f=$e(t==null?void 0:t.content);if(f!==void 0)return a(T.jsx(sn,{code:f,lang:qg(n)}))}const o=$e(t==null?void 0:t.oldStr),l=$e(t==null?void 0:t.newStr);if(o!==void 0&&l!==void 0)return a(T.jsx(o0,{diff:a0(o,l)}));const d=oI(e.content);return a(d?T.jsx(o0,{diff:a0(d.oldText,d.newText)}):Cr(e))}function PI(e){const t=kt(e.input),n=t&&Array.isArray(t.operations)?t.operations:[],a=Xr(kr(e));if(!a.trim())return Gg(e.input).length>0?null:Cr(e);const s=n.map(kt).find(d=>d&&d.mode!=="Image"),o=s&&typeof s.path=="string"?s.path:"",l=(s==null?void 0:s.mode)==="Line"?qg(o):"text";return T.jsxs(T.Fragment,{children:[o&&T.jsx(Kg,{path:o}),T.jsx(sn,{code:a,lang:l})]})}function MI(e){const t=kr(e),n=Jr(t),a=n&&Array.isArray(n.results)?n.results.filter(o=>{const l=kt(o);return!!l&&(Array.isArray(l.matches)||typeof l.file=="string")}):null;if(a&&a.length>0)return T.jsx("div",{className:"grep",children:a.map((o,l)=>{const d=kt(o),f=d&&typeof d.file=="string"?d.file:"",h=d&&Array.isArray(d.matches)?d.matches.map(String):[];return T.jsxs("div",{className:"grep-file",children:[T.jsx("div",{className:"grep-fname",children:f}),T.jsx("pre",{className:"grep-matches",children:h.join(`
|
|
248
|
+
`)})]},l)})});const s=Xr(t);return s.trim()?T.jsx(sn,{code:s,lang:"text"}):Cr(e)}function FI(e){const t=lI(kr(e));return!t||t.length===0?Cr(e):T.jsx("div",{className:"todo",children:t.map((n,a)=>T.jsxs("div",{className:`todo-item ${n.done?"is-done":""}`,children:[T.jsx("span",{className:"todo-check","aria-hidden":!0,children:n.done?"☑":"☐"}),T.jsx("span",{className:"todo-text",children:n.desc})]},a))})}function BI(e){const t=kt(e.input),n=$e(t==null?void 0:t.query)??$e(t==null?void 0:t.doc_path),a=kr(e),s=Jr(a),o=(s?$e(s.documentation)??Ld(s):null)??Xr(a);return T.jsxs(T.Fragment,{children:[n&&T.jsxs("div",{className:"toolcall-section",children:[T.jsx("div",{className:"toolcall-label",children:"query"}),T.jsx(sn,{code:n,lang:"text"})]}),o.trim()?T.jsx("div",{className:"toolcall-doc",children:T.jsx(Xa,{text:o})}):Cr(e)]})}function UI(e){const t=kt(e.input),n=$e(t==null?void 0:t.url),a=$e(t==null?void 0:t.mode),s=$e(t==null?void 0:t.search_terms),o=kr(e),l=Jr(o),d=l?Ld(l)??$e(l.content)??JSON.stringify(l,null,2):Xr(o);return T.jsxs(T.Fragment,{children:[n&&T.jsxs("div",{className:"toolcall-meta",children:[T.jsx("a",{className:"toolcall-link",href:n,target:"_blank",rel:"noopener noreferrer",children:n}),a&&T.jsx("span",{className:"toolcall-tag",children:a})]}),s&&T.jsxs("div",{className:"toolcall-section",children:[T.jsx("div",{className:"toolcall-label",children:"search terms"}),T.jsx(sn,{code:s,lang:"text"})]}),d.trim()?T.jsx(sn,{code:d,lang:"markdown"}):Cr(e)]})}function jI(e){if(!e)return null;const t=Array.isArray(e.results)?e.results:Array.isArray(e.items)?e.items:Array.isArray(e.data)?e.data:null;if(!t)return null;const n=[];for(const a of t){const s=kt(a);s&&n.push({title:$e(s.title)??$e(s.name),url:$e(s.url)??$e(s.link)??$e(s.href),snippet:$e(s.snippet)??$e(s.description)??$e(s.content)??$e(s.text)})}return n.length?n:null}function HI(e){var s;const t=kr(e),n=jI(Jr(t));if(!n)return Cr(e);const a=$e((s=kt(e.input))==null?void 0:s.query);return T.jsxs(T.Fragment,{children:[a&&T.jsxs("div",{className:"toolcall-section",children:[T.jsx("div",{className:"toolcall-label",children:"query"}),T.jsx(sn,{code:a,lang:"text"})]}),T.jsx("ol",{className:"websearch",children:n.map((o,l)=>T.jsxs("li",{className:"websearch-item",children:[o.url?T.jsx("a",{className:"websearch-title",href:o.url,target:"_blank",rel:"noopener noreferrer",children:o.title??o.url}):T.jsx("span",{className:"websearch-title",children:o.title??"(untitled)"}),o.url&&T.jsx("div",{className:"websearch-url",children:o.url}),o.snippet&&T.jsx("p",{className:"websearch-snippet",children:o.snippet})]},l))})]})}function Cr(e){const t=e.input;let n="";if(typeof t=="string")n=t;else if(kt(t)){const{__tool_use_purpose:f,...h}=kt(t);n=JSON.stringify(h,null,2)}const a=kr(e),s=Jr(a),o=s?Ld(s):null,l=o??(s?JSON.stringify(s,null,2):Xr(a)),d=o?"text":/^\s*[[{]/.test(l)?"json":"text";return T.jsxs(T.Fragment,{children:[n&&n!=="{}"&&T.jsxs("div",{className:"toolcall-section",children:[T.jsx("div",{className:"toolcall-label",children:"input"}),T.jsx(sn,{code:n,lang:kt(t)?"json":"text"})]}),l.trim()&&T.jsxs("div",{className:"toolcall-section",children:[T.jsx("div",{className:"toolcall-label",children:"output"}),T.jsx(sn,{code:l,lang:d})]})]})}function sn({code:e,lang:t}){const[n,a]=v.useState(null);return v.useEffect(()=>{let s=!1;return wd(e,t).then(o=>!s&&a(o)).catch(()=>!s&&a(null)),()=>{s=!0}},[e,t]),n?T.jsx("div",{className:"toolcode",dangerouslySetInnerHTML:{__html:n}}):T.jsx("pre",{className:"toolcode toolcode-plain",children:e})}function o0({diff:e}){return T.jsx("div",{className:"diff-body",children:e.map((t,n)=>T.jsxs("div",{className:`diff-line diff-${t.type}`,children:[T.jsx("span",{className:"diff-sign","aria-hidden":!0,children:t.type==="add"?"+":t.type==="del"?"-":" "}),T.jsx("span",{className:"diff-code",children:t.text||" "})]},n))})}const zI=v.memo(wI),$I=4,WI=300,YI=240,VI=80;function qI(e,t){if(e<=0)return{offset:0,limit:0};const n=Math.max(0,e-t);return{offset:n,limit:e-n}}function QI(e,t,n,a){const s=t-e,o=Math.max(0,a-n);return s>o+$I}class GI{constructor(t){Le(this,"ports");Le(this,"frames");Le(this,"follow",!1);Le(this,"lastScrollTop",0);Le(this,"lastMaxTop",0);Le(this,"anchor",null);Le(this,"loadingOlder",!1);Le(this,"showButton",!1);Le(this,"initializedFor",null);Le(this,"prevPendingCount",0);Le(this,"raf",0);Le(this,"content",{chatId:null,itemCount:0,pendingCount:0,remainingOlder:0});Le(this,"followTick",()=>{var s,o;this.raf=0;const t=this.ports.element();if(!t||!this.follow)return;const n=this.bottomOf(t),a=n-t.scrollTop;if(a<=1||(o=(s=this.ports).reducedMotion)!=null&&o.call(s)){t.scrollTop=n,this.lastScrollTop=t.scrollTop,this.lastMaxTop=n;return}t.scrollTop+=Math.max(10,Math.ceil(a*.3)),this.lastScrollTop=t.scrollTop,this.lastMaxTop=n,this.raf=this.frames.request(this.followTick)});this.ports=t,this.frames=t.frames??{request:n=>requestAnimationFrame(n),cancel:n=>cancelAnimationFrame(n)}}reset(){this.follow=!1,this.prevPendingCount=0,this.anchor=null,this.cancelFollow(),this.setFlags({loadingOlder:!1,showScrollButton:!1})}dispose(){this.cancelFollow()}onContent(t){this.content=t;const n=this.ports.element();if(n){if(this.initializedFor!==t.chatId&&t.itemCount>0){this.initializedFor=t.chatId,this.follow=!1,n.scrollTop=this.bottomOf(n),this.lastScrollTop=n.scrollTop,this.lastMaxTop=this.bottomOf(n),this.prevPendingCount=t.pendingCount,this.setFlags({showScrollButton:!1});return}t.pendingCount>this.prevPendingCount&&(this.follow=!0),this.prevPendingCount=t.pendingCount,this.follow?this.scheduleFollow():this.updateButton(n)}}onScroll(){const t=this.ports.element();if(!t)return;const n=this.bottomOf(t);QI(t.scrollTop,this.lastScrollTop,n,this.lastMaxTop)&&(this.follow=!1),this.lastScrollTop=t.scrollTop,this.lastMaxTop=n,this.updateButton(t),t.scrollTop<WI&&this.loadOlder()}jumpToLatest(){this.follow=!0,this.setFlags({showScrollButton:!1}),this.scheduleFollow()}restoreAnchor(){if(this.anchor==null)return;const t=this.ports.element();t&&(t.scrollTop=t.scrollHeight-this.anchor),this.anchor=null,this.setFlags({loadingOlder:!1})}loadOlder(){const t=this.ports.element(),n=this.content.chatId;if(!t||!n||this.loadingOlder||this.content.remainingOlder<=0)return;this.setFlags({loadingOlder:!0});const{offset:a,limit:s}=qI(this.content.remainingOlder,VI);this.anchor=t.scrollHeight-t.scrollTop,this.ports.fetchPage(n,a,s).then(o=>{if(this.content.chatId!==n)return this.abandonPage();if(o.length===0)return this.abandonPage();this.ports.prepend(o)}).catch(()=>{this.abandonPage(),console.error("could not load earlier transcript page")})}abandonPage(){this.anchor=null,this.setFlags({loadingOlder:!1})}scheduleFollow(){this.raf||(this.raf=this.frames.request(this.followTick))}cancelFollow(){this.raf&&this.frames.cancel(this.raf),this.raf=0}bottomOf(t){return t.scrollHeight-t.clientHeight}updateButton(t){const n=this.bottomOf(t)-t.scrollTop;this.setFlags({showScrollButton:n>YI})}setFlags(t){const n=t.loadingOlder??this.loadingOlder,a=t.showScrollButton??this.showButton;n===this.loadingOlder&&a===this.showButton||(this.loadingOlder=n,this.showButton=a,this.ports.onFlags({loadingOlder:n,showScrollButton:a}))}}const KI=700,bc=typeof window<"u"?window.matchMedia("(prefers-reduced-motion: reduce)"):null;function l0({chatId:e,attachments:t,onOpen:n}){return T.jsx("div",{className:"msg-attachments",children:t.map(a=>a.kind==="image"?T.jsx("a",{href:dt.previewUrl(e,a.path),target:"_blank",rel:"noopener noreferrer",className:"msg-image-link",children:T.jsx("img",{src:dt.previewUrl(e,a.path),alt:a.name,className:"msg-image",...Vg})},a.path):T.jsxs("button",{type:"button",className:"msg-file",title:a.path,onClick:()=>n(a.path),children:[T.jsx(Q0,{size:14}),T.jsx("span",{className:"msg-file-name",children:a.name}),T.jsx("span",{className:"msg-file-size",children:X0(a.size)})]},a.path))})}const XI=v.memo(function(){const t=xe($=>$.items),n=xe($=>$.streamingText),a=xe($=>$.streamingThought),s=xe($=>$.pending),o=s.some($=>$.status==="sending"),l=xe($=>$.observability.turnStatus),d=xe($=>$.observability.compacting),f=xe($=>$.activeId),h=xe($=>$.openFilePreview),E=xe($=>$.remainingOlder),g=v.useRef({session:null,ids:new Set});g.current.session!==f&&(g.current={session:f,ids:new Set(t.filter($=>$.type==="tool_call").map($=>$.tool.id))});const x=$=>!g.current.ids.has($),[b,S]=v.useState(!1);v.useEffect(()=>{if(S(!1),l!=="running")return;const $=setTimeout(()=>S(!0),KI);return()=>clearTimeout($)},[l,n,a,t.length]);const A=v.useRef(null),[P,R]=v.useState({loadingOlder:!1,showScrollButton:!1}),F=v.useRef(null);F.current||(F.current=new GI({element:()=>A.current,fetchPage:($,j,te)=>dt.transcriptPage($,j,te).then(ue=>ue.items),prepend:$=>xe.getState().prependItems($),onFlags:R,reducedMotion:()=>(bc==null?void 0:bc.matches)??!1}));const U=F.current;v.useEffect(()=>(U.reset(),()=>U.dispose()),[f,U]),v.useEffect(()=>{U.onContent({chatId:f,itemCount:t.length,pendingCount:s.length,remainingOlder:E})},[t,n,a,s,f,d,E,U]),v.useLayoutEffect(()=>{U.restoreAnchor()},[t,U]);const K=t.length===0&&!n&&!a&&s.length===0;return T.jsxs("div",{className:"transcript-wrap",children:[P.loadingOlder&&T.jsxs("div",{className:"loading-older",role:"status",children:[T.jsx(yr,{size:14}),T.jsx("span",{children:"Loading earlier messages…"})]}),T.jsxs("div",{className:"transcript",ref:A,onScroll:()=>U.onScroll(),children:[K&&T.jsxs("div",{className:"transcript-empty",children:[T.jsx("p",{className:"empty-title",children:"Casper is here."}),T.jsx("p",{className:"empty-sub",children:"Hand off a task. Casper keeps working server-side and has it ready when you get back."})]}),t.map($=>$.type==="message"?$.message.role==="thinking"?T.jsx(c0,{text:$.message.text},$.message.id):T.jsx("div",{className:`msg msg-${$.message.role}`,children:$.message.role==="assistant"?T.jsx(Xa,{text:$.message.text}):T.jsxs(T.Fragment,{children:[f&&$.message.attachments&&$.message.attachments.length>0&&T.jsx(l0,{chatId:f,attachments:$.message.attachments,onOpen:h}),$.message.text&&T.jsx("div",{className:"msg-user-text",children:$.message.text})]})},$.message.id):$.type==="tool_call"?T.jsx(zI,{tool:$.tool,arriving:x($.tool.id)},$.tool.id):$.type==="turn_error"?T.jsx(JI,{message:$.message},$.id):T.jsx(ZI,{summary:$.summary},$.id)),s.map($=>T.jsxs("div",{className:`msg msg-user msg-pending ${$.status==="failed"?"is-failed":""}`,children:[f&&$.attachments&&$.attachments.length>0&&T.jsx(l0,{chatId:f,attachments:$.attachments,onOpen:h}),$.text&&T.jsx("div",{className:"msg-user-text",children:$.text}),$.status==="failed"&&T.jsxs("div",{className:"msg-failed",children:[T.jsx("span",{className:"msg-failed-why",children:$.error??"Failed to send."}),T.jsx("button",{className:"msg-retry",onClick:()=>nt.retrySend($.id),children:"Retry"})]})]},$.id)),a&&T.jsx(c0,{text:a,live:!0}),n&&T.jsx("div",{className:"msg msg-assistant",children:T.jsx(Xa,{text:n,streaming:!0})}),(l==="running"||o)&&(b||!n&&!a)&&T.jsxs("div",{className:"thinking",children:[T.jsx("span",{className:"thinking-dot"}),T.jsx("span",{className:"thinking-dot"}),T.jsx("span",{className:"thinking-dot"})]}),d&&T.jsx("div",{className:"compaction compaction-live",children:T.jsx("div",{className:"compaction-rule",children:T.jsxs("span",{className:"compaction-head",children:[T.jsx(yr,{size:13,className:"compaction-icon"}),T.jsx("span",{className:"compaction-label",children:"Compacting conversation…"})]})})})]}),P.showScrollButton&&T.jsx("button",{className:"scroll-to-bottom",onClick:()=>U.jumpToLatest(),"aria-label":"Scroll to latest",title:"Scroll to latest",children:T.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:T.jsx("polyline",{points:"6 9 12 15 18 9"})})})]})});function c0({text:e,live:t=!1}){const[n,a]=v.useState(!1);return T.jsxs("div",{className:`thought ${t?"is-live":""}`,children:[T.jsxs("button",{className:"thought-head",onClick:()=>a(s=>!s),children:[T.jsx("span",{className:`thought-chevron ${n?"is-open":""}`,children:T.jsx(Yu,{size:13})}),T.jsx("span",{className:`thought-label ${t?"is-live":""}`,children:"Thinking"})]}),n&&T.jsx("div",{className:"thought-body",children:T.jsx("div",{className:"thought-text",children:e})})]})}function JI({message:e}){const[t,n]=v.useState(!1),[a,s]=v.useState(!1),o=B0(e),l=xe(f=>{for(let h=f.items.length-1;h>=0;h--){const E=f.items[h];if(E.type==="message"&&E.message.role==="user")return E.message.text}return""}),d=()=>{var f;(f=navigator.clipboard)==null||f.writeText(e).then(()=>{s(!0),setTimeout(()=>s(!1),1500)},()=>{})};return T.jsxs("div",{className:"sysnote",children:[T.jsx("div",{className:"sysnote-rule",children:T.jsxs("button",{className:"sysnote-head",onClick:()=>n(f=>!f),"aria-expanded":t,children:[T.jsx(W0,{size:13}),T.jsx("span",{className:"sysnote-label",children:o.title}),T.jsx("span",{className:"sysnote-toggle",children:t?"Hide details":"Show details"})]})}),t&&T.jsxs("div",{className:"sysnote-body",children:[o.fix&&T.jsx("p",{className:"sysnote-fix",children:o.fix}),T.jsx("pre",{className:"sysnote-raw",children:e}),T.jsxs("div",{className:"sysnote-actions",children:[l&&T.jsx("button",{className:"btn-sm is-danger",onClick:()=>nt.retryTurn(l),children:"Retry turn"}),T.jsx("button",{className:"btn-sm",onClick:d,children:a?"Copied":"Copy details"})]})]})]})}function ZI({summary:e}){const[t,n]=v.useState(!1);return T.jsxs("div",{className:"compaction",children:[T.jsx("div",{className:"compaction-rule",children:T.jsxs("button",{className:"compaction-head",onClick:()=>n(a=>!a),"aria-expanded":t,children:[T.jsx(fx,{size:14,className:"compaction-icon"}),T.jsx("span",{className:"compaction-label",children:"Conversation compacted"}),T.jsx("span",{className:"compaction-toggle",children:t?"Hide summary":"Show summary"})]})}),t&&T.jsx("div",{className:"compaction-body",children:T.jsx(Xa,{text:e})})]})}const mn="/",kc=2;function e6(e){if(!e||e===mn)return mn;const t=e.replace(/\/+$/,"").lastIndexOf(mn);return t<=0?mn:e.slice(0,t)}function t6(e){const t=[{name:mn,path:mn}];let n="";for(const a of e.split(mn).filter(Boolean))n=`${n}${mn}${a}`,t.push({name:a,path:n});return t}function n6(e,t){return t.slice(e.length).replace(/^\/+/,"")}function r6({initialPath:e,onChange:t,onSubmit:n}){const[a,s]=v.useState(e.trim()),[o,l]=v.useState(""),[d,f]=v.useState(null),[h,E]=v.useState(-1),[g,x]=v.useState(null),b=v.useRef(null),S=v.useRef(null),A=v.useRef(""),P=v.useRef(!1),R=v.useRef(a);R.current=a;const F=v.useRef(t);F.current=t;const U=v.useId(),K=`${U}-listbox`,$=v.useMemo(()=>{if(o.startsWith(mn)||!a)return o;const C=a.endsWith(mn)?a:a+mn;return o?C+o:C},[a,o]);v.useEffect(()=>{A.current=$;const C=setTimeout(()=>{dt.listDirs($).then(O=>{A.current===$&&(f(O),!P.current&&O.dir&&(P.current=!0,R.current||s(O.dir)),F.current(O.target))}).catch(()=>{A.current===$&&f(null)})},150);return()=>clearTimeout(C)},[$]);const j=(d==null?void 0:d.entries)??[],te=(d==null?void 0:d.dir)??a,ue=t6(te),fe=ue.length>kc+2,B=fe?ue.slice(1,-kc):[],ie=fe?ue.slice(-kc):ue.slice(1),ce=ue[0],ke=ue[ue.length-1];v.useEffect(()=>{var O,G;if(h<0)return;const C=(O=S.current)==null?void 0:O.children[h];(G=C==null?void 0:C.scrollIntoView)==null||G.call(C,{block:"nearest"})},[h]);const de=C=>{var O;s(C),l(""),E(-1),(O=b.current)==null||O.focus()},Y=C=>{if(C.key==="ArrowDown"&&j.length>0)C.preventDefault(),E(O=>Math.min(O+1,j.length-1));else if(C.key==="ArrowUp"&&j.length>0)C.preventDefault(),E(O=>Math.max(O-1,-1));else if(C.key==="ArrowLeft"&&C.currentTarget.selectionStart===0&&!o)C.preventDefault(),de(e6(te));else if(C.key==="Enter"){C.preventDefault();const O=h>=0?j[h]:void 0;O?de(O):n()}else C.key==="Escape"&&h>=0&&(C.stopPropagation(),E(-1))},ge=d==null?void 0:d.target,pe=!!ge&&(d==null?void 0:d.targetKind)==="missing",X=!!ge&&(d==null?void 0:d.targetKind)==="file",oe=(C,O="")=>T.jsx("button",{type:"button",className:`dirpick-crumb ${C===ke?"is-here":""} ${O}`,onClick:()=>C!==ke&&de(C.path),disabled:C===ke,title:C.path,children:C.name});return T.jsxs("div",{className:"dirpick",children:[T.jsxs("div",{className:"dirpick-crumbs",children:[oe(ce),B.length>0&&T.jsx("button",{type:"button",className:"dirpick-crumb dirpick-more","aria-haspopup":"menu","aria-expanded":g!==null,"aria-label":`Show ${B.length} folders above`,title:`${B.length} folders above`,onClick:C=>x(g?null:C.currentTarget),children:T.jsx(Jy,{size:15})}),ie.map((C,O)=>T.jsxs("span",{className:"dirpick-crumb-wrap",children:[(O>0||B.length>0)&&T.jsx("span",{className:"dirpick-sep",children:"/"}),oe(C)]},C.path))]}),g&&T.jsx(G0,{anchor:g,onClose:()=>x(null),children:B.map(C=>T.jsx("button",{className:"menu-item",onClick:()=>{x(null),de(C.path)},children:C.name},C.path))}),T.jsx("input",{ref:b,className:"dirpick-input",role:"combobox","aria-expanded":j.length>0,"aria-controls":K,"aria-autocomplete":"list","aria-label":"Working directory","aria-activedescendant":h>=0?`${U}-opt-${h}`:void 0,value:o,placeholder:"Search folders…",autoComplete:"off",spellCheck:!1,onChange:C=>{l(C.target.value),E(-1)},onKeyDown:Y}),T.jsxs("div",{ref:S,id:K,role:"listbox","aria-label":"Folders",className:"dirpick-list",children:[j.map((C,O)=>T.jsx("button",{id:`${U}-opt-${O}`,type:"button",role:"option","aria-selected":O===h,className:`dirpick-opt ${O===h?"is-active":""}`,title:C,onMouseDown:G=>G.preventDefault(),onClick:()=>de(C),children:T.jsx("span",{className:"dirpick-tail",children:T.jsx("span",{children:n6(te,C)})})},C)),j.length===0&&T.jsx("div",{className:"dirpick-empty",children:o?"Nothing here matches.":"No subfolders."})]}),T.jsxs("div",{className:"dirpick-status","aria-live":"polite",children:[pe&&T.jsx("span",{className:"dirpick-note is-new",children:"This folder will be created"}),X&&T.jsx("span",{className:"dirpick-note is-bad",children:"That path is a file, not a folder"})]})]})}function i6({chatId:e,currentCwd:t,onChanged:n,onClose:a}){const[s,o]=v.useState(t??""),[l,d]=v.useState(!1),[f,h]=v.useState(null),E=v.useRef(!1);v.useEffect(()=>{const x=b=>{b.key==="Escape"&&a()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[a]);const g=async()=>{const x=s.trim();if(!(!x||l)){d(!0),h(null);try{const b=await dt.setChatCwd(e,x);n(b.cwd),a()}catch(b){h(b.message)}finally{d(!1)}}};return T.jsx("div",{className:"sheet-backdrop",onMouseDown:x=>{E.current=x.target===x.currentTarget},onClick:x=>{x.target===x.currentTarget&&E.current&&a(),E.current=!1},children:T.jsxs("div",{className:"sheet",role:"dialog","aria-modal":"true","aria-labelledby":"change-folder-title",children:[T.jsx("h2",{className:"sheet-title",id:"change-folder-title",children:"Change working directory"}),T.jsx(r6,{initialPath:t??"",onChange:o,onSubmit:g}),f&&T.jsx("div",{className:"sheet-error",children:f}),T.jsxs("div",{className:"sheet-actions",children:[T.jsx("button",{className:"btn-ghost",onClick:a,disabled:l,children:"Cancel"}),T.jsx("button",{className:"btn-primary",onClick:g,disabled:l||!s.trim(),children:l?"Saving…":"Change folder"})]})]})})}function a6({name:e}){var n;switch((n=e.split(".").pop())==null?void 0:n.toLowerCase()){case"ts":case"tsx":case"js":case"jsx":case"mjs":case"py":case"rb":case"go":case"rs":case"java":case"c":case"cpp":case"h":case"hpp":case"vue":case"svelte":return T.jsx(Bp,{size:15,className:"ftree-icon-svg ftree-icon-code"});case"json":case"yaml":case"yml":case"toml":case"ini":case"env":case"lock":return T.jsx(ax,{size:15,className:"ftree-icon-svg ftree-icon-config"});case"md":case"txt":case"rst":case"log":case"csv":return T.jsx(sx,{size:15,className:"ftree-icon-svg ftree-icon-text"});case"css":case"scss":case"less":case"sass":return T.jsx(ox,{size:15,className:"ftree-icon-svg ftree-icon-style"});case"html":case"svg":case"xml":return T.jsx(Bp,{size:15,className:"ftree-icon-svg ftree-icon-markup"});case"png":case"jpg":case"jpeg":case"gif":case"webp":case"bmp":case"ico":case"avif":return T.jsx(ux,{size:15,className:"ftree-icon-svg ftree-icon-image"});case"sh":case"bash":case"zsh":case"fish":case"bat":case"ps1":return T.jsx(lx,{size:15,className:"ftree-icon-svg ftree-icon-terminal"});default:return T.jsx(Q0,{size:15,className:"ftree-icon-svg"})}}function Xg({entry:e,chatId:t,depth:n,onPreview:a,onExpanded:s}){const o=xe(g=>g.fsVersion[e.path]??0),[l,d]=v.useState({expanded:!1,children:null,loading:!1});v.useEffect(()=>{if(e.type==="directory")return s(e.path,l.expanded),()=>s(e.path,!1)},[e.path,e.type,l.expanded,s]),v.useEffect(()=>{if(!o||!l.expanded)return;let g=!0;return dt.tree(t,e.path).then(x=>{g&&d(b=>({...b,children:x.entries}))}).catch(()=>{}),()=>{g=!1}},[o]);const f=v.useCallback(async()=>{if(e.type==="directory"&&!l.loading){if(l.expanded){d(g=>({...g,expanded:!1}));return}if(l.children===null){d(g=>({...g,loading:!0}));try{const g=await dt.tree(t,e.path);d({expanded:!0,children:g.entries,loading:!1})}catch{d(g=>({...g,loading:!1}))}}else d(g=>({...g,expanded:!0}))}},[e,t,l.expanded,l.children,l.loading]),h=v.useCallback(()=>{e.type==="file"&&a(e)},[e,a]),E=n*16;return e.type==="directory"?T.jsxs(T.Fragment,{children:[T.jsxs("button",{className:"ftree-row ftree-dir",onClick:f,style:{paddingLeft:`${E+8}px`},children:[T.jsx("span",{className:`ftree-chevron ${l.expanded?"is-open":""}`,children:l.loading?T.jsx(yr,{size:12}):T.jsx(Yu,{size:12,className:"ftree-chevron-icon"})}),T.jsx("span",{className:"ftree-icon",children:l.expanded?T.jsx(ix,{size:15,className:"ftree-icon-svg ftree-icon-folder"}):T.jsx(q0,{size:15,className:"ftree-icon-svg ftree-icon-folder"})}),T.jsx("span",{className:"ftree-name",children:e.name})]}),l.expanded&&l.children&&T.jsxs("div",{className:"ftree-children",children:[l.children.map(g=>T.jsx(Xg,{entry:g,chatId:t,depth:n+1,onPreview:a,onExpanded:s},g.path)),l.children.length===0&&T.jsx("div",{className:"ftree-empty",style:{paddingLeft:`${E+24}px`},children:"Empty"})]})]}):T.jsxs("div",{className:"ftree-row ftree-file",style:{paddingLeft:`${E+8}px`},onClick:h,children:[T.jsx("span",{className:"ftree-chevron ftree-chevron-spacer","aria-hidden":"true"}),T.jsx("span",{className:"ftree-icon",children:T.jsx(a6,{name:e.name})}),T.jsx("span",{className:"ftree-name",children:e.name}),e.size!=null&&T.jsx("span",{className:"ftree-size",children:X0(e.size)})]})}function s6({chatId:e,onClose:t}){var j;const[n,a]=v.useState([]),[s,o]=v.useState(""),[l,d]=v.useState(!0),[f,h]=v.useState(null),[E,g]=v.useState(!1),x=xe(te=>te.chats),b=xe(te=>te.setWatchedPaths),S=xe(te=>te.fsVersion[""]??0),A=v.useRef(new Set),P=xe(te=>te.setChats),R=xe(te=>te.openFilePreview),F=(j=x.find(te=>te.chatId===e))==null?void 0:j.cwd,U=v.useCallback(()=>{b(["",...A.current])},[b]),K=v.useCallback((te,ue)=>{const fe=A.current;ue!==fe.has(te)&&(ue?fe.add(te):fe.delete(te),U())},[U]);v.useEffect(()=>(U(),()=>b([])),[U,b]);const $=v.useCallback(async(te=!1)=>{te||d(!0),h(null);try{const ue=await dt.tree(e);a(ue.entries),o(ue.cwd)}catch(ue){h(ue.message)}finally{te||d(!1)}},[e]);return v.useEffect(()=>{$()},[$]),v.useEffect(()=>{S&&$(!0)},[S]),T.jsxs("div",{className:"ftree-panel",children:[T.jsxs("div",{className:"ftree-header",children:[T.jsx("span",{className:"ftree-title",title:s,children:"Files"}),T.jsx("button",{className:"ftree-refresh",onClick:()=>g(!0),title:"Change working directory","aria-label":"Change working directory",children:T.jsx(q0,{size:14})}),t&&T.jsx("button",{className:"ftree-close",onClick:t,title:"Close file tree","aria-label":"Close file tree",children:T.jsx(ud,{size:15})})]}),s&&T.jsx("div",{className:"ftree-cwd",title:s,children:s}),T.jsxs("div",{className:"ftree-list",children:[l&&n.length===0&&T.jsx("div",{className:"ftree-loading",children:"Loading…"}),f&&T.jsxs("div",{className:"ftree-error",children:[f,T.jsx("button",{className:"ftree-repoint",onClick:()=>g(!0),children:"Change folder…"})]}),!l&&!f&&n.length===0&&T.jsx("div",{className:"ftree-empty",children:"No files"}),!f&&n.map(te=>T.jsx(Xg,{entry:te,chatId:e,depth:0,onPreview:ue=>R(ue.path),onExpanded:K},te.path))]}),E&&T.jsx(i6,{chatId:e,currentCwd:s||F,onChanged:te=>{P(x.map(ue=>ue.chatId===e?{...ue,cwd:te}:ue)),$()},onClose:()=>g(!1)})]})}const Cc=e=>e.split("/").pop()||e;function u6({preview:e,chatId:t,onClose:n}){const[a,s]=v.useState(!1),[o,l]=v.useState({}),d=()=>{window.open(dt.downloadUrl(t,e.path),"_blank")},f=b=>{b.target===b.currentTarget&&n()};v.useEffect(()=>{const b=S=>{S.key==="Escape"&&n()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[n]);const h=o[e.path]??!1,E=e.kind==="html"||e.kind==="markdown",g=E&&!h,x=e.kind!=="image"&&e.kind!=="pdf"&&!g;return T.jsx("div",{className:"fpreview-backdrop",onClick:f,children:T.jsxs("div",{className:`fpreview-modal${a?" fpreview-full":""}`,children:[T.jsxs("div",{className:"fpreview-header",children:[E&&!e.error&&T.jsxs("div",{className:"fpreview-seg",role:"group","aria-label":"Preview mode",children:[T.jsx("button",{className:`fpreview-seg-btn${h?"":" is-active"}`,onClick:()=>l(b=>({...b,[e.path]:!1})),title:"Rendered","aria-label":"Rendered","aria-pressed":!h,children:T.jsx(hx,{size:17})}),T.jsx("button",{className:`fpreview-seg-btn${h?" is-active":""}`,onClick:()=>l(b=>({...b,[e.path]:!0})),title:"Source","aria-label":"Source","aria-pressed":h,children:T.jsx(px,{size:17})})]}),T.jsx("span",{className:"fpreview-name",title:e.path,children:e.name}),T.jsx("button",{className:"fpreview-dl",onClick:d,title:"Download file","aria-label":"Download file",children:T.jsx(cx,{size:18})}),T.jsx("button",{className:"fpreview-full-btn",onClick:()=>s(b=>!b),title:a?"Exit fullscreen":"Fullscreen","aria-label":a?"Exit fullscreen":"Fullscreen",children:a?T.jsx(gx,{size:18}):T.jsx(mx,{size:18})}),T.jsx("button",{className:"fpreview-close",onClick:n,"aria-label":"Close preview",children:T.jsx(ud,{size:18})})]}),T.jsxs("div",{className:"fpreview-body",children:[e.loading&&T.jsx("div",{className:"fpreview-loading",children:T.jsx(yr,{size:48})}),e.error&&T.jsx("div",{className:"ftree-error",children:e.error}),!e.loading&&!e.error&&e.kind==="image"&&T.jsx("img",{src:dt.previewUrl(t,e.path),alt:e.name,className:"fpreview-image"}),!e.error&&e.kind==="pdf"&&T.jsx("iframe",{src:dt.previewUrl(t,e.path),title:e.name,className:"fpreview-pdf"}),!e.error&&e.kind==="html"&&g&&T.jsx("iframe",{src:`${dt.previewUrl(t,e.path)}&raw=1`,title:e.name,className:"fpreview-html",sandbox:"allow-scripts allow-forms"}),!e.loading&&!e.error&&e.kind==="markdown"&&g&&e.content!==null&&T.jsx("div",{className:"fpreview-md",children:T.jsx(Xa,{text:e.content,html:!0})}),!e.loading&&!e.error&&x&&e.highlightedHtml&&T.jsx("div",{className:"fpreview-highlighted",dangerouslySetInnerHTML:{__html:e.highlightedHtml}}),!e.loading&&!e.error&&x&&!e.highlightedHtml&&e.content!==null&&T.jsx("pre",{className:"fpreview-code",children:e.content})]})]})})}function o6(){const e=xe(l=>l.previewPath),t=xe(l=>l.activeId),n=xe(l=>l.closeFilePreview),[a,s]=v.useState(null),o=v.useCallback(()=>n(),[n]);return v.useEffect(()=>{if(!e||!t){s(null);return}let l=!1;const d=eI(Cc(e)),f=d!=="image"&&d!=="pdf";if(s({path:e,name:Cc(e),content:null,highlightedHtml:null,kind:d,loading:f,error:null}),!!f)return(async()=>{try{const h=await fetch(dt.previewUrl(t,e),{credentials:"same-origin"});if(!h.ok)throw new Error(await h.text()||`HTTP ${h.status}`);const E=await h.text();if(l)return;s(b=>b&&b.path===e?{...b,content:E,loading:!1}:b);const g=Qg(Cc(e));if(!g)return;const x=await wd(E,g);if(l||!x)return;s(b=>b&&b.path===e?{...b,highlightedHtml:x}:b)}catch(h){if(l)return;s(E=>E&&E.path===e?{...E,loading:!1,error:h instanceof Error?h.message:"Could not read the file"}:E)}})(),()=>{l=!0}},[e,t]),!a||!t?null:es.createPortal(T.jsx(u6,{preview:a,chatId:t,onClose:o}),document.body)}function Jg({ariaLabel:e,value:t,options:n,onChange:a}){const[s,o]=v.useState(!1),[l,d]=v.useState(0),f=v.useRef(null),h=n.find(x=>x.value===t);v.useEffect(()=>{if(!s)return;const x=b=>{f.current&&!f.current.contains(b.target)&&o(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[s]),v.useEffect(()=>{if(!s)return;const x=n.findIndex(b=>b.value===t);d(x>=0?x:0)},[s]);const E=x=>{a(x),o(!1)},g=x=>{if(!s){(x.key==="Enter"||x.key===" "||x.key==="ArrowDown")&&(x.preventDefault(),o(!0));return}if(x.key==="Escape")o(!1);else if(x.key==="ArrowDown")x.preventDefault(),d(b=>Math.min(b+1,n.length-1));else if(x.key==="ArrowUp")x.preventDefault(),d(b=>Math.max(b-1,0));else if(x.key==="Enter"){x.preventDefault();const b=n[l];b&&E(b.value)}};return T.jsxs("div",{className:"dd",ref:f,children:[T.jsxs("button",{type:"button",className:`dd-trigger ${s?"is-open":""}`,"aria-haspopup":"listbox","aria-expanded":s,onClick:()=>o(x=>!x),onKeyDown:g,"aria-label":e,children:[T.jsx("span",{className:"dd-value",children:(h==null?void 0:h.label)??t??"Select…"}),T.jsx(Yu,{size:13,className:"dd-chevron"})]}),s&&T.jsx("div",{className:"dd-panel",role:"listbox",children:n.map((x,b)=>T.jsxs("button",{type:"button",role:"option","aria-selected":x.value===t,className:`dd-option ${b===l?"is-active":""} ${x.value===t?"is-selected":""}`,onMouseEnter:()=>d(b),onClick:()=>E(x.value),children:[T.jsx("span",{className:"dd-check",children:x.value===t&&T.jsx(tx,{size:15})}),T.jsx("span",{className:"dd-option-label",children:x.label}),x.hint&&T.jsx("span",{className:"dd-option-hint",children:x.hint})]},x.value))})]})}function l6({value:e,onChange:t}){var s;const n=xe(o=>o.models),a=e??((s=n.find(o=>o.isDefault))==null?void 0:s.modelId);return T.jsx(Jg,{ariaLabel:"Model",value:a,onChange:t,options:n.map(o=>({value:o.modelId,label:o.modelName,hint:`${o.rateMultiplier}x`}))})}function c6({value:e,onChange:t}){const n=xe(d=>d.modes),a=xe(d=>d.agents),s=xe(d=>d.defaultAgentId),o=n.length>0?n:a,l=e??s;return T.jsx(Jg,{ariaLabel:"Agent",value:l,onChange:t,options:o.map(d=>({value:d.id,label:d.name}))})}const pn=18,Yc=2.5,Vc=(pn-Yc)/2,d0=2*Math.PI*Vc;function d6(e){return e>85?"var(--aurora-red)":e>60?"var(--aurora-orange)":"var(--frost)"}const f0=new Intl.NumberFormat;function f6(){var S;const e=xe(A=>A.observability.contextUsagePercentage),t=xe(A=>A.observability.compacting),n=xe(A=>A.observability.turnStatus),a=xe(A=>A.activeId),s=xe(A=>A.currentModelId),o=xe(A=>A.models),[l,d]=v.useState(!1),f=v.useRef(null);v.useEffect(()=>{if(!l)return;const A=R=>{f.current&&!f.current.contains(R.target)&&d(!1)},P=R=>{R.key==="Escape"&&d(!1)};return document.addEventListener("mousedown",A),document.addEventListener("keydown",P),()=>{document.removeEventListener("mousedown",A),document.removeEventListener("keydown",P)}},[l]);const h=Math.max(0,Math.min(100,e)),E=d6(h),g=h/100*d0,x=(S=o.find(A=>A.modelId===s))==null?void 0:S.contextWindowTokens,b=x?Math.round(h/100*x):void 0;return a?T.jsxs("div",{className:"ctx",ref:f,children:[T.jsx("button",{type:"button",className:"ctx-btn",onClick:()=>d(A=>!A),"aria-haspopup":"dialog","aria-expanded":l,"aria-label":`Context ${h.toFixed(0)}% used`,title:`Context ${h.toFixed(0)}% used`,children:T.jsx("svg",{width:pn,height:pn,viewBox:`0 0 ${pn} ${pn}`,"aria-hidden":!0,children:T.jsxs("g",{transform:`rotate(-90 ${pn/2} ${pn/2})`,children:[T.jsx("circle",{cx:pn/2,cy:pn/2,r:Vc,fill:"none",stroke:"var(--n2)",strokeWidth:Yc}),T.jsx("circle",{cx:pn/2,cy:pn/2,r:Vc,fill:"none",stroke:E,strokeWidth:Yc,strokeLinecap:"round",strokeDasharray:`${g} ${d0-g}`})]})})}),l&&T.jsxs("div",{className:"ctx-pop",role:"dialog","aria-label":"Context usage",children:[T.jsxs("div",{className:"ctx-pop-head",children:[T.jsx("span",{className:"ctx-pop-title",children:"Context used"}),T.jsxs("span",{className:"ctx-pop-pct",style:{color:E},children:[h.toFixed(1),"%"]})]}),T.jsx("div",{className:"ctx-pop-bar",children:T.jsx("span",{className:"ctx-pop-bar-fill",style:{width:`${h}%`,background:E}})}),x?T.jsxs("dl",{className:"ctx-pop-rows",children:[T.jsxs("div",{className:"ctx-pop-row",children:[T.jsx("dt",{children:"Used"}),T.jsxs("dd",{children:[f0.format(b??0)," tokens"]})]}),T.jsxs("div",{className:"ctx-pop-row",children:[T.jsx("dt",{children:"Window"}),T.jsxs("dd",{children:[f0.format(x)," tokens"]})]})]}):T.jsx("p",{className:"ctx-pop-note",children:"Token counts need a selected model’s window size."}),T.jsx("button",{type:"button",className:"ctx-pop-compact",disabled:t||n!=="idle",onClick:()=>{d(!1),nt.compact()},children:t?"Compacting…":"Compact conversation"})]})]}):null}const h6={closed:"Offline - reconnecting when possible",reconnecting:"Reconnecting…",resyncing:"Resyncing…"};function p6(e){return e.live?e.uploading?"Uploading…":e.cancelling?"Stopping…":e.compacting?"Compacting conversation…":e.running?"Casper is working…":"Ask Casper to build something…":h6[e.connStatus]??"Connecting…"}const h0=new Set(["image/png","image/jpeg","image/gif","image/webp","image/svg+xml"]);function m6({chatId:e,connStatus:t,draft:n}){const[a,s]=v.useState(""),[o,l]=v.useState([]),[d,f]=v.useState(!1),[h,E]=v.useState(null),g=xe(Y=>Y.observability.turnStatus),x=xe(Y=>Y.observability.compacting),b=xe(Y=>Y.currentModeId),S=xe(Y=>Y.currentModelId),A=g==="running",P=g==="cancelling",R=n||t==="connected",F=v.useRef(null),U=v.useRef(null),K=Y=>new Promise((ge,pe)=>{const X=new FileReader;X.onload=()=>ge(X.result.split(",")[1]??""),X.onerror=()=>pe(new Error("Failed to read file")),X.readAsDataURL(Y)}),$=v.useCallback(()=>{const Y=U.current;Y&&(Y.style.height="auto",Y.style.height=`${Math.min(Y.scrollHeight,200)}px`)},[]);v.useEffect(()=>{$()},[a,$]);const j=v.useCallback(Y=>{const ge=Y.map(pe=>{const X=h0.has(pe.type);return{id:`att-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,file:pe,isImage:X,previewUrl:X?URL.createObjectURL(pe):void 0}});l(pe=>[...pe,...ge])},[]),te=async(Y,ge,pe)=>{const X=[];Y.length>0&&X.push({type:"text",text:M0+Y.map(oe=>oe.path).join(", ")+`
|
|
249
|
+
`});for(let oe=0;oe<Y.length;oe++){const C=Y[oe],O=ge[oe];if(C&&C.kind==="image"&&O)try{const G=await K(O.file);X.push({type:"image",data:G,mimeType:C.mimeType})}catch{}}return pe&&X.push({type:"text",text:pe}),X},ue=async()=>{const Y=a.trim();if(!Y&&o.length===0||A||P||x||!R||d)return;let ge=[];const pe=o;if(pe.length>0){if(!e){E("No chat to upload to.");return}f(!0),E(null);try{ge=(await dt.uploadFiles(e,pe.map(C=>C.file))).files}catch(oe){E(oe.message),f(!1);return}f(!1)}const X=await te(ge,pe,Y);X.length!==0&&(nt.send(X,ge.map(oe=>({path:oe.path,name:oe.name,size:oe.size,kind:oe.kind}))),s(""),pe.forEach(oe=>oe.previewUrl&&URL.revokeObjectURL(oe.previewUrl)),l([]),requestAnimationFrame(()=>{U.current&&(U.current.style.height="auto")}))},fe=Y=>{Y.key==="Enter"&&!Y.shiftKey&&(Y.preventDefault(),ue())},B=v.useCallback(Y=>{var X;const ge=(X=Y.clipboardData)==null?void 0:X.items;if(!ge)return;const pe=[];for(const oe of Array.from(ge))if(oe.kind==="file"&&h0.has(oe.type)){const C=oe.getAsFile();C&&pe.push(C)}pe.length>0&&(Y.preventDefault(),j(pe))},[j]),ie=Y=>{Y.target.files&&j(Array.from(Y.target.files)),Y.target.value=""},ce=Y=>{l(ge=>{const pe=ge.find(X=>X.id===Y);return pe!=null&&pe.previewUrl&&URL.revokeObjectURL(pe.previewUrl),ge.filter(X=>X.id!==Y)})};v.useEffect(()=>()=>{l(Y=>(Y.forEach(ge=>ge.previewUrl&&URL.revokeObjectURL(ge.previewUrl)),Y))},[]);const ke=p6({live:R,connStatus:t,uploading:d,cancelling:P,compacting:x,running:A}),de=(a.trim()||o.length>0)&&!A&&!P&&!x&&!d&&R;return T.jsxs("div",{className:"composer",children:[h&&T.jsx("div",{className:"composer-error",children:h}),o.length>0&&T.jsx("div",{className:"composer-attachments",children:o.map(Y=>T.jsxs("div",{className:"composer-att",children:[Y.isImage&&Y.previewUrl?T.jsx("img",{src:Y.previewUrl,alt:Y.file.name,className:"composer-att-img"}):T.jsxs("div",{className:"composer-att-file",title:Y.file.name,children:[T.jsx("span",{className:"composer-att-file-icon",children:"📄"}),T.jsx("span",{className:"composer-att-file-name",children:Y.file.name})]}),T.jsx("button",{className:"composer-att-remove",onClick:()=>ce(Y.id),"aria-label":`Remove ${Y.file.name}`,children:"×"})]},Y.id))}),T.jsxs("div",{className:"composer-box",children:[T.jsx("textarea",{ref:U,className:"composer-input",value:a,onChange:Y=>s(Y.target.value),onKeyDown:fe,onPaste:B,placeholder:ke,rows:1}),T.jsxs("div",{className:"composer-actions",children:[T.jsx("button",{className:"composer-plus",onClick:()=>{var Y;return(Y=F.current)==null?void 0:Y.click()},disabled:!R||d,title:"Add photos & files","aria-label":"Add photos and files",children:T.jsx(Y0,{size:18})}),T.jsxs("div",{className:"composer-actions-right",children:[T.jsx(f6,{}),T.jsx(c6,{value:b,onChange:Y=>nt.changeAgent(Y)}),T.jsx(l6,{value:S,onChange:Y=>nt.changeModel(Y)}),A?T.jsx("button",{className:"composer-btn composer-stop",onClick:()=>nt.cancel(),title:"Stop","aria-label":"Stop",children:T.jsx(Fp,{size:15})}):P?T.jsx("button",{className:"composer-btn composer-stop",disabled:!0,title:"Stopping…","aria-label":"Stopping",children:T.jsx(Fp,{size:15})}):T.jsx("button",{className:"composer-btn composer-send",onClick:ue,disabled:!de,title:d?"Uploading…":"Send","aria-label":d?"Uploading":"Send",children:d?T.jsx(yr,{size:15}):T.jsx(rx,{size:17})})]})]})]}),T.jsx("input",{ref:F,type:"file",multiple:!0,onChange:ie,className:"composer-file-input"})]})}const g6={connecting:{cls:"busy",label:"Connecting"},replaying:{cls:"busy",label:"Catching up"},connected:{cls:"ok",label:"Live"},reconnecting:{cls:"busy",label:"Reconnecting"},resyncing:{cls:"busy",label:"Resyncing"},closed:{cls:"down",label:"Offline"}};function E6({status:e}){const{cls:t,label:n}=g6[e];return T.jsxs("span",{className:`conndot conndot-${t}`,children:[T.jsx("span",{className:"conndot-blip"}),T.jsx("span",{className:"conndot-label",children:n})]})}function T6({isDraft:e,navOpen:t,onToggleNav:n}){const a=xe(K=>K.loadingChatId),s=xe(K=>K.connStatus),o=xe(K=>K.createError),l=xe(K=>{var $;return($=K.chats.find(j=>j.chatId===K.activeId))==null?void 0:$.title}),d=xe(K=>e&&K.pending.length===0&&K.items.length===0),f=xe(K=>K.activeId),h=xe(K=>K.chatId),E=xe(K=>K.chatNotice),g=xe(K=>K.reloadingId!==null&&K.reloadingId===K.activeId),x=xe(K=>K.observability.turnStatus==="running"),b=xe(K=>K.dismissChatNotice),[S,A]=v.useState(!1);if(v.useEffect(()=>{A(!1)},[f]),a)return T.jsxs("main",{className:"chatpane",children:[T.jsxs("header",{className:"chat-head",children:[T.jsx("button",{className:"navbtn",onClick:n,"aria-label":t?"Hide sessions":"Show sessions","aria-expanded":t,children:T.jsx(ec,{size:20})}),T.jsx("span",{className:"chat-title",children:"Opening session…"})]}),T.jsx("div",{className:"chat-blank",children:T.jsx(yr,{size:48,className:"chat-spinner"})})]});if(o)return T.jsxs("main",{className:"chatpane",children:[T.jsxs("header",{className:"chat-head",children:[T.jsx("button",{className:"navbtn",onClick:n,"aria-label":t?"Hide sessions":"Show sessions","aria-expanded":t,children:T.jsx(ec,{size:20})}),T.jsx("span",{className:"chat-title",children:"New session"})]}),T.jsxs("div",{className:"chat-blank",children:[T.jsx("p",{className:"chat-blank-title",children:"Couldn't start the session"}),T.jsx("p",{className:"chat-blank-sub",children:o}),T.jsxs("div",{className:"chat-error-actions",children:[T.jsx("button",{className:"btn-primary",onClick:()=>nt.retryCreate(),children:"Try again"}),T.jsx("button",{className:"btn-ghost",onClick:()=>nt.dismissCreateError(),children:"Back to sessions"})]})]})]});const P=E&&T.jsxs("div",{className:"notice-banner",role:"alert",children:[T.jsx(W0,{size:16,className:"notice-icon"}),T.jsxs("div",{className:"notice-text",children:[T.jsx("p",{className:"notice-title",children:E.title}),E.fix&&T.jsx("p",{className:"notice-sub",children:E.fix})]}),T.jsx("button",{className:"notice-x",onClick:b,"aria-label":"Dismiss",children:T.jsx(ud,{size:14})})]}),R=T.jsxs("div",{className:"composer-wrap",children:[P,T.jsx(m6,{chatId:h,connStatus:s,draft:e})]}),F=T.jsxs("div",{className:"chat-draft",children:[T.jsxs("div",{className:"draft-hero",children:[T.jsx("img",{className:"draft-logo",src:"/logo.svg",alt:""}),T.jsx("h1",{className:"draft-title",children:"Casper"})]}),R]}),U=T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"chat-body",children:T.jsx(XI,{})}),R]});return T.jsxs("main",{className:`chatpane chatpane-split ${S?"has-tree":""}`,children:[T.jsxs("div",{className:"chat-col",children:[T.jsxs("header",{className:"chat-head",children:[T.jsx("button",{className:"navbtn",onClick:n,"aria-label":t?"Hide sessions":"Show sessions","aria-expanded":t,children:T.jsx(ec,{size:20})}),!e&&T.jsx("span",{className:"chat-title",title:l,children:l??"Session"}),!e&&T.jsx(E6,{status:s}),!e&&T.jsx("button",{className:"chat-head-btn chat-reload",onClick:()=>void nt.reloadChat(),disabled:g||x,title:x?"Reload after the turn":"Reload session","aria-label":"Reload session",children:g?T.jsx(yr,{size:18}):T.jsx(ex,{size:18})}),!e&&T.jsx("button",{className:`chat-head-btn ftree-toggle ${S?"is-active":""}`,onClick:()=>A(K=>!K),title:"Toggle file tree","aria-label":"Toggle file tree","aria-pressed":S,children:T.jsx(dx,{size:18})})]}),d?F:U]}),f&&T.jsxs("aside",{className:`ftree-aside ${S?"is-open":""}`,children:[S&&T.jsx(s6,{chatId:f,onClose:()=>A(!1)}),T.jsx(o6,{})]}),f&&S&&T.jsx("div",{className:"ftree-backdrop",onClick:()=>A(!1),"aria-hidden":!0})]})}function y6({onReady:e}){const[t,n]=v.useState(""),[a,s]=v.useState(null),[o,l]=v.useState(!1),d=async()=>{l(!0),s(null);try{await $y(t.trim()),e()}catch(f){s(f.message)}finally{l(!1)}};return T.jsxs("div",{className:"gate",children:[T.jsx("img",{className:"gate-logo",src:"/logo.svg",alt:""}),T.jsx("h1",{className:"gate-title",children:"Casper"}),T.jsx("p",{className:"gate-sub",children:"Enter your access token to continue."}),T.jsx("input",{className:"gate-input",type:"password",value:t,placeholder:"access token",onChange:f=>n(f.target.value),onKeyDown:f=>f.key==="Enter"&&d()}),a&&T.jsx("p",{className:"gate-error",children:a}),T.jsx("button",{className:"btn-primary gate-btn",onClick:d,disabled:o,children:o?"Checking…":"Continue"}),T.jsxs("p",{className:"gate-hint",children:["Don't have it? On the machine running Casper, run ",T.jsx("code",{children:"casper token"}),"."]})]})}const _c=768;function x6(){const[e,t]=v.useState("checking");return v.useEffect(()=>{e==="checking"&&dt.listChats().then(n=>{xe.getState().setChats(n.chats),t("ready")}).catch(()=>t("gate"))},[e]),e==="checking"?T.jsx("div",{className:"app-splash"}):e==="gate"?T.jsx(y6,{onReady:()=>t("ready")}):T.jsx(Sy,{children:T.jsxs(ty,{children:[T.jsxs(Ai,{element:T.jsx(b6,{onLock:()=>t("gate")}),children:[T.jsx(Ai,{index:!0,element:null}),T.jsx(Ai,{path:sd,element:null}),T.jsx(Ai,{path:H0,element:null})]}),T.jsx(Ai,{path:"*",element:T.jsx(Z2,{to:"/",replace:!0})})]})})}function b6({onLock:e}){var b;const t=xe(S=>S.chats),n=xe(S=>S.activeId),a=xe(S=>S.watchedPaths),s=xe(S=>S.connStatus),o=xe(S=>S.loadingChatId),l=Jc(),d=((b=Ip(H0))==null?void 0:b.params.chatId)??null,f=Ip(sd)!==null||!d&&n===null;v.useEffect(()=>{nt.attach({navigate:l,onLock:e})},[l,e]),v.useEffect(()=>{nt.loadPickers(),xe.getState().chats.length===0&&nt.refreshSessions()},[]),v.useEffect(()=>{nt.syncRoute(d,f)},[d,f]),v.useEffect(()=>{s==="connected"&&nt.watchPaths(a)},[a,s]);const h=v.useCallback(()=>{Wy(),nt.lock()},[]),[E,g]=v.useState(()=>window.innerWidth>_c);v.useEffect(()=>{const S=window.matchMedia(`(max-width: ${_c}px)`),A=P=>g(!P.matches);return S.addEventListener("change",A),()=>S.removeEventListener("change",A)},[]);const x=v.useCallback(()=>{window.innerWidth<=_c&&g(!1)},[]);return T.jsxs("div",{className:`layout ${E?"nav-open":""}`,children:[T.jsx(kx,{sessions:t,activeId:n,loadingId:o,onOpen:S=>{nt.markLoading(S),x()},onNew:()=>{nt.startDraft(),x()},onDelete:S=>void nt.deleteChat(S),onRename:(S,A)=>void nt.renameChat(S,A),onLock:h}),E&&T.jsx("button",{className:"nav-scrim","aria-label":"Close session panel",onClick:()=>g(!1)}),T.jsx(T6,{navOpen:E,onToggleNav:()=>g(S=>!S),isDraft:f})]})}if("serviceWorker"in navigator){const e=!!navigator.serviceWorker.controller;let t=!1;navigator.serviceWorker.addEventListener("controllerchange",()=>{t||!e||(t=!0,window.location.reload())}),navigator.serviceWorker.ready.then(n=>{n.update().catch(()=>{}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&n.update().catch(()=>{})})}).catch(()=>{})}n2.createRoot(document.getElementById("root")).render(T.jsx(Pa.StrictMode,{children:T.jsx(x6,{})}));export{JC as S,Ac as _,Xu as c,qc as g,TN as h,yN as s,O1 as v,$r as w};
|