bloby-bot 0.18.0 → 0.18.2
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-bloby/assets/{bloby-B8Qpaiaq.js → bloby-DYxsXV7f.js} +4 -4
- package/dist-bloby/assets/{highlighted-body-OFNGDK62-CEYRDN-L.js → highlighted-body-OFNGDK62-D3YkbUq4.js} +1 -1
- package/dist-bloby/assets/mermaid-GHXKKRXX-Bg8FPZtr.js +1 -0
- package/dist-bloby/bloby.html +1 -1
- package/package.json +1 -1
- package/supervisor/chat/bloby-main.tsx +10 -0
- package/supervisor/index.ts +1 -1
- package/supervisor/widget.js +43 -0
- package/workspace/client/index.html +2 -1
- package/workspace/client/public/bloby-favicon.png +0 -0
- package/dist-bloby/assets/mermaid-GHXKKRXX-6uL8XX_T.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-OFNGDK62-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-OFNGDK62-D3YkbUq4.js","assets/jsx-runtime-C0W9Wf2W.js","assets/angular-html-olSuI25H.js","assets/html-CzX0w7K_.js","assets/css-zY4NE9yA.js","assets/javascript-CzjRtS1s.js","assets/angular-ts-BJPoZ_vo.js","assets/scss-Efq7Dmbs.js","assets/apl-CyVuPSCb.js","assets/json-CdFmZMJc.js","assets/xml-BlDEvPia.js","assets/java-BqKEu7zh.js","assets/astro-CKc3-gwH.js","assets/postcss-BTQso3H9.js","assets/tsx-DrzBggF8.js","assets/typescript-COZIw7xM.js","assets/blade-DMAsVBaV.js","assets/html-derivative-D-XvNBA6.js","assets/sql-CB6kO6Km.js","assets/bsl-B1qbqNES.js","assets/sdbl-BmWYR-pI.js","assets/c-BvB8CVo8.js","assets/cairo-BDj8wWhy.js","assets/python-CKg5r0C3.js","assets/cobol-hBjMZW-R.js","assets/coffee-B4OtR3w-.js","assets/cpp-BblbpnyR.js","assets/glsl-CEMf-THb.js","assets/regexp-CvWG4lI-.js","assets/crystal-x3k4USY-.js","assets/shellscript-BbEstezf.js","assets/edge-B-9TrlZC.js","assets/elixir-CXCzbj1r.js","assets/elm-BdRiwmde.js","assets/erb-C9tvRzx3.js","assets/ruby-CXP5_4kq.js","assets/graphql-dBCd2Czl.js","assets/jsx-BL6Wh6Qw.js","assets/haml-Ck5pVAEG.js","assets/lua-B4ezzssg.js","assets/yaml-iUXljnLs.js","assets/erlang-Bc4hQuqa.js","assets/markdown-BaI9LyM4.js","assets/fortran-fixed-form-B02FOYI-.js","assets/fortran-free-form-BPTf0lbT.js","assets/fsharp-DhdR18vN.js","assets/gdresource-DgnrMPIx.js","assets/gdscript-CsadCSaZ.js","assets/gdshader-PfnN_8tR.js","assets/git-commit-DGJi7qBD.js","assets/diff-CdkWtnkL.js","assets/git-rebase-HwDSB2qJ.js","assets/glimmer-js-B6LF_BMd.js","assets/glimmer-ts-Cn42BUKe.js","assets/hack-DDEqRjBe.js","assets/handlebars-g9Qe0ao2.js","assets/http-qlhghEti.js","assets/hurl-CHIKfBKk.js","assets/csv-DNUpVBxl.js","assets/hxml-adC65L_J.js","assets/haxe-DfXTCEOz.js","assets/jinja-BHZt0_Dn.js","assets/jison-TqJYWKkW.js","assets/julia-CW07fy07.js","assets/r-CGji9_vM.js","assets/just-DBcWo9WY.js","assets/perl-DqDX-7VG.js","assets/latex-D6lXiPTF.js","assets/tex-CdJ24HJj.js","assets/liquid-DhYYAQ41.js","assets/marko-xtrIBdcL.js","assets/less-C95PyOu0.js","assets/mdc-DyZVNnwP.js","assets/nextflow-JEyYUlIq.js","assets/nextflow-groovy-wvmJO4hi.js","assets/nginx-CGgm1VOJ.js","assets/nim-Br7S817Z.js","assets/php-DYSqNNGJ.js","assets/pug-Bob3gNio.js","assets/qml-CsMafcqN.js","assets/razor-B4PzhaZX.js","assets/csharp-BDKQY1K9.js","assets/rst-BXuz-2b8.js","assets/cmake-D5rSbMir.js","assets/sas-Cov9PzAD.js","assets/shaderlab-DZ3Lsiak.js","assets/hlsl-DpuYn7pp.js","assets/shellsession-BHLVblBB.js","assets/soy-e0u3-wIA.js","assets/sparql-B9c85a_o.js","assets/turtle-CqNXyJWZ.js","assets/stata-B1mLEMrz.js","assets/surrealql-BTKo2XFY.js","assets/svelte-B7URZ-wm.js","assets/templ-DVRYIgGq.js","assets/go-DLnOLj8q.js","assets/ts-tags-CCSbelDn.js","assets/twig-Dn4ruiVl.js","assets/vue-D19cWHwY.js","assets/vue-html-_j-KC7Cs.js","assets/vue-vine-BC03MN6c.js","assets/stylus-sKwvsUaC.js","assets/xsl-DR-zOeBm.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{c as e,i as t,n,o as r,r as i,t as a}from"./jsx-runtime-C0W9Wf2W.js";import{a as o,c as s,d as c,f as l,i as u,l as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v}from"./globals-Y2sqR_Rk.js";var y=l(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),b=l(`bell-ring`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]),x=l(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),S=l(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),C=l(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),w=l(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),T=l(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),ee=l(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),te=l(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),E=l(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),ne=l(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),re=l(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),ie=l(`send-horizontal`,[[`path`,{d:`M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z`,key:`117uat`}],[`path`,{d:`M6 12h16`,key:`s4cdu5`}]]),D=l(`share`,[[`path`,{d:`M12 2v13`,key:`1km8f5`}],[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`,key:`1b2hhj`}]]),ae=l(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),oe=l(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),se=l(`wand-sparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),O=l(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),k=e(i(),1),ce=e(m(),1),le=class e{ws=null;handlers=new Map;statusHandlers=new Set;reconnectTimer=null;heartbeatTimer=null;url;queue=[];intentionalClose=!1;reconnectDelay=1e3;static MAX_RECONNECT_DELAY=8e3;tokenGetter=null;constructor(e,t){let n=location.protocol===`https:`?`wss:`:`ws:`,r=location.host;this.url=e??`${n}//${r}/ws`,this.tokenGetter=t??null}connect(){this.intentionalClose=!1;let t=this.url;if(this.tokenGetter){let e=this.tokenGetter();if(e){let n=t.includes(`?`)?`&`:`?`;t=`${t}${n}token=${e}`}}this.ws=new WebSocket(t),this.ws.onopen=()=>{this.reconnectDelay=1e3,this.notifyStatus(!0),this.flushQueue(),this.startHeartbeat()},this.ws.onmessage=e=>{if(e.data===`pong`)return;let t=JSON.parse(e.data);this.handlers.get(t.type)?.forEach(e=>e(t.data))},this.ws.onclose=()=>{this.stopHeartbeat(),this.notifyStatus(!1),this.intentionalClose||(this.reconnectTimer=setTimeout(()=>{this.reconnectDelay=Math.min(this.reconnectDelay*2,e.MAX_RECONNECT_DELAY),this.connect()},this.reconnectDelay))},this.ws.onerror=()=>this.ws?.close()}disconnect(){this.intentionalClose=!0,this.reconnectTimer&&=(clearTimeout(this.reconnectTimer),null),this.stopHeartbeat(),this.ws?.close(),this.ws=null}on(e,t){return this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t),()=>this.handlers.get(e)?.delete(t)}onStatus(e){return this.statusHandlers.add(e),()=>this.statusHandlers.delete(e)}send(e,t){let n={type:e,data:t};this.ws?.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify(n)):this.queue.push(n)}get connected(){return this.ws?.readyState===WebSocket.OPEN}flushQueue(){for(;this.queue.length>0&&this.ws?.readyState===WebSocket.OPEN;){let e=this.queue.shift();this.ws.send(JSON.stringify(e))}}notifyStatus(e){this.statusHandlers.forEach(t=>t(e))}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.ws?.readyState===WebSocket.OPEN&&this.ws.send(`ping`)},25e3)}stopHeartbeat(){this.heartbeatTimer&&=(clearInterval(this.heartbeatTimer),null)}},ue=`bloby_token`,de=null;function A(){return localStorage.getItem(ue)}function fe(e){localStorage.setItem(ue,e)}function pe(){localStorage.removeItem(ue)}function j(e){de=e}async function me(e,t={}){let n=A(),r=new Headers(t.headers);n&&r.set(`Authorization`,`Bearer ${n}`);let i=await fetch(e,{...t,headers:r});return i.status===401&&n&&(pe(),de?.()),i}function he(e,t,n=!0){let[r,i]=(0,k.useState)([]),[a,o]=(0,k.useState)(null),[s,c]=(0,k.useState)(!1),[l,u]=(0,k.useState)(``),[d,f]=(0,k.useState)([]),[p,m]=(0,k.useState)(!1),h=(0,k.useRef)(!1),g=(0,k.useRef)(null),_=(0,k.useRef)(!1),v=(0,k.useRef)(!1);(0,k.useEffect)(()=>{g.current=a},[a]),(0,k.useEffect)(()=>{_.current=s},[s]);let y=(0,k.useCallback)(e=>{let t;e.audio_data&&(t=e.audio_data.startsWith(`data:`)?e.audio_data:e.audio_data.includes(`/`)?`/api/files/${e.audio_data}`:`data:audio/webm;base64,${e.audio_data}`);let n;if(e.attachments)try{n=JSON.parse(e.attachments)}catch{}return{id:e.id,role:e.role,content:e.content,timestamp:e.created_at,audioData:t,hasAttachments:!!(n&&n.length>0),attachments:n}},[]),b=(0,k.useCallback)(async()=>{try{let e=await me(`/api/context/current`).then(e=>e.json());if(!e.conversationId)return;o(e.conversationId);let t=await me(`/api/conversations/${e.conversationId}/messages?limit=20`);if(!t.ok)return;let n=await t.json();if(!n?.length)return;i(n.filter(e=>e.role===`user`||e.role===`assistant`).map(y)),m(n.length>=20)}catch{}},[y]),x=(0,k.useCallback)(async()=>{if(!(v.current||!g.current)){v.current=!0;try{let e=r[0]?.id;if(!e)return;let t=await me(`/api/conversations/${g.current}/messages?before=${e}&limit=20`);if(!t.ok)return;let n=await t.json();if(!n?.length){m(!1);return}let a=n.filter(e=>e.role===`user`||e.role===`assistant`).map(y);i(e=>[...a,...e]),n.length<20&&m(!1)}catch{}finally{v.current=!1}}},[r,y]);return(0,k.useEffect)(()=>{!n||h.current||(h.current=!0,b())},[n,b]),(0,k.useEffect)(()=>{n&&t&&t>0&&b()},[n,t,b]),(0,k.useEffect)(()=>{if(!n||!t||t===0||!s)return;let e=setInterval(()=>{if(!_.current){clearInterval(e);return}b()},3e3);return()=>clearInterval(e)},[n,t,s,b]),(0,k.useEffect)(()=>{if(!e)return;let t=[e.on(`bot:typing`,()=>{c(!0),f([])}),e.on(`bot:token`,e=>{u(t=>t+e.token)}),e.on(`bot:tool`,e=>{f(t=>t.find(t=>t.name===e.name&&t.status===`running`)?t:[...t,{name:e.name,status:`running`}])}),e.on(`bot:response`,e=>{o(e.conversationId),i(t=>[...t,{id:e.messageId||Date.now().toString(),role:`assistant`,content:e.content,timestamp:new Date().toISOString()}]),u(``),c(!1),f([])}),e.on(`bot:error`,e=>{u(``),c(!1),f([]),i(t=>[...t,{id:Date.now().toString(),role:`assistant`,content:`Error: ${e.error}`,timestamp:new Date().toISOString()}])}),e.on(`chat:sync`,e=>{g.current&&e.conversationId!==g.current||i(t=>[...t,{id:Date.now().toString(),role:e.message.role,content:e.message.content,timestamp:e.message.timestamp}])}),e.on(`chat:conversation-created`,e=>{o(e.conversationId)}),e.on(`chat:state`,e=>{e.streaming&&(c(!0),e.conversationId&&o(e.conversationId),e.buffer&&u(e.buffer))}),e.on(`chat:cleared`,()=>{i([]),o(null),u(``),c(!1),f([]),h.current=!1})];return()=>t.forEach(e=>e())},[e]),{messages:r,streaming:s,streamBuffer:l,conversationId:a,tools:d,hasMore:p,loadOlder:x,sendMessage:(0,k.useCallback)((t,n,r)=>{if(!e||!t.trim()&&(!n||n.length===0))return;let o={id:Date.now().toString(),role:`user`,content:t,timestamp:new Date().toISOString(),hasAttachments:!!(n&&n.length>0),audioData:r?r.startsWith(`data:`)?r:`data:audio/webm;base64,${r}`:void 0};i(e=>[...e,o]);let s={conversationId:a,content:t};r&&(s.audioData=r.includes(`,`)?r.split(`,`)[1]:r),n?.length&&(s.attachments=n.map(e=>{let t=e.preview.match(/^data:([^;]+);base64,(.+)$/);return{type:e.type,name:e.name,mediaType:t?.[1]||`application/octet-stream`,data:t?.[2]||``}})),e.send(`user:message`,s)},[e,a]),stopStreaming:(0,k.useCallback)(()=>{e&&(e.send(`user:stop`,{conversationId:a}),c(!1),u(``),f([]))},[e,a]),clearContext:(0,k.useCallback)(()=>{e&&e.send(`user:clear-context`,{}),i([]),o(null),u(``),c(!1),f([]),h.current=!1},[e])}}var M=a(),ge=`bloby_login_totp`;function _e({onLogin:e,totpEnabled:t}){let[n,r]=(0,k.useState)(``),[i,a]=(0,k.useState)(``),[o,s]=(0,k.useState)(!1),[l,m]=(0,k.useState)(`password`),[g,_]=(0,k.useState)(``),[y,b]=(0,k.useState)(``),[x,S]=(0,k.useState)(!0),[C,w]=(0,k.useState)(!1),T=(0,k.useRef)(null);(0,k.useEffect)(()=>{try{let e=sessionStorage.getItem(ge);if(!e)return;let t=JSON.parse(e);t.pendingToken&&t.expiresAt>Date.now()?(b(t.pendingToken),m(`totp`)):sessionStorage.removeItem(ge)}catch{}},[]),(0,k.useEffect)(()=>{l===`totp`&&setTimeout(()=>T.current?.focus(),100)},[l]);function ee(e){try{sessionStorage.setItem(ge,JSON.stringify({pendingToken:e,expiresAt:Date.now()+4.5*60*1e3}))}catch{}}function E(){try{sessionStorage.removeItem(ge)}catch{}}let ne=async()=>{if(!(!n.trim()||o)){s(!0),a(``);try{let t=btoa(`admin:${n}`),r=await fetch(`/api/portal/login`,{headers:{Authorization:`Basic ${t}`},credentials:`include`}),i=await r.json();r.ok&&i.token?(E(),e(i.token)):r.ok&&i.requiresTOTP?(b(i.pendingToken),ee(i.pendingToken),m(`totp`),a(``)):a(i.error||`Invalid password`)}catch{a(`Could not reach server`)}finally{s(!1)}}},re=async()=>{if(!(!g.trim()||o)){s(!0),a(``);try{let t=await fetch(`/api/portal/login/totp?pending=${encodeURIComponent(y)}&code=${encodeURIComponent(g)}&trust=${x?`1`:`0`}`,{credentials:`include`}),n=await t.json();t.ok&&n.token?(E(),e(n.token)):a(n.error||`Invalid code`)}catch{a(`Could not reach server`)}finally{s(!1)}}},ie=e=>{e.key===`Enter`&&(l===`password`?ne():re())},D=()=>{m(`password`),a(``),_(``),w(!1),E()},ae=`w-full bg-white/[0.05] border border-white/[0.08] text-white rounded-xl px-4 py-3 text-base outline-none input-glow placeholder:text-white/20 transition-all`;return(0,M.jsx)(`div`,{className:`flex flex-col items-center justify-center h-dvh px-6`,children:(0,M.jsx)(`div`,{className:`w-full max-w-[320px] flex flex-col items-center`,children:(0,M.jsx)(h,{mode:`wait`,children:l===`password`?(0,M.jsxs)(f.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.2},className:`w-full flex flex-col items-center`,children:[(0,M.jsx)(`div`,{className:`w-14 h-14 rounded-2xl bg-white/[0.04] border border-white/[0.08] flex items-center justify-center mb-5`,children:(0,M.jsx)(te,{className:`h-6 w-6 text-white/40`})}),(0,M.jsx)(`h1`,{className:`text-xl font-bold text-white tracking-tight mb-1`,children:`Welcome back`}),(0,M.jsx)(`p`,{className:`text-white/40 text-[13px] mb-6`,children:`Enter your password to continue.`}),i&&(0,M.jsx)(`div`,{className:`w-full bg-red-500/8 border border-red-500/15 rounded-xl px-4 py-2.5 mb-4`,children:(0,M.jsx)(`p`,{className:`text-red-400/90 text-[12px]`,children:i})}),(0,M.jsx)(`input`,{type:`password`,value:n,onChange:e=>r(e.target.value),onKeyDown:ie,placeholder:`Password`,autoFocus:!0,autoComplete:`current-password`,className:ae}),(0,M.jsx)(`button`,{onClick:ne,disabled:!n.trim()||o,className:`w-full mt-4 py-3 bg-gradient-brand hover:opacity-90 text-white text-[14px] font-semibold rounded-full transition-colors flex items-center justify-center gap-2 disabled:opacity-40`,children:o?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(p,{className:`h-4 w-4 animate-spin`}),`Signing in...`]}):(0,M.jsxs)(M.Fragment,{children:[`Sign In`,(0,M.jsx)(v,{className:`h-4 w-4`})]})})]},`password`):(0,M.jsxs)(f.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{duration:.2},className:`w-full flex flex-col items-center`,children:[(0,M.jsx)(`div`,{className:`w-14 h-14 rounded-2xl bg-[#AF27E3]/10 border border-[#AF27E3]/20 flex items-center justify-center mb-5`,children:(0,M.jsx)(u,{className:`h-6 w-6 text-[#AF27E3]`})}),(0,M.jsx)(`h1`,{className:`text-xl font-bold text-white tracking-tight mb-1`,children:C?`Recovery code`:`Enter your 2FA code`}),(0,M.jsx)(`p`,{className:`text-white/40 text-[13px] mb-6`,children:C?`Enter one of your recovery codes.`:`Open your authenticator app and enter the 6-digit code.`}),i&&(0,M.jsx)(`div`,{className:`w-full bg-red-500/8 border border-red-500/15 rounded-xl px-4 py-2.5 mb-4`,children:(0,M.jsx)(`p`,{className:`text-red-400/90 text-[12px]`,children:i})}),(0,M.jsx)(`input`,{ref:T,type:`text`,inputMode:C?`text`:`numeric`,autoComplete:`one-time-code`,maxLength:C?20:6,value:g,onChange:e=>{_(C?e.target.value:e.target.value.replace(/\D/g,``)),a(``)},onKeyDown:ie,placeholder:C?`Recovery code`:`000000`,autoFocus:!0,className:ae+(C?``:` tracking-[0.3em] text-center font-mono`)}),(0,M.jsxs)(`label`,{className:`flex items-center gap-2.5 mt-4 w-full cursor-pointer`,children:[(0,M.jsx)(`div`,{onClick:()=>S(e=>!e),className:`w-5 h-5 rounded-md border flex items-center justify-center transition-all ${x?`bg-[#AF27E3] border-[#AF27E3]`:`bg-white/[0.04] border-white/[0.12]`}`,children:x&&(0,M.jsx)(d,{className:`h-3.5 w-3.5 text-white`})}),(0,M.jsx)(`span`,{className:`text-[13px] text-white/50`,children:`Trust this device for 90 days`})]}),(0,M.jsx)(`button`,{onClick:re,disabled:!g.trim()||o,className:`w-full mt-4 py-3 bg-gradient-brand hover:opacity-90 text-white text-[14px] font-semibold rounded-full transition-colors flex items-center justify-center gap-2 disabled:opacity-40`,children:o?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(p,{className:`h-4 w-4 animate-spin`}),`Verifying...`]}):(0,M.jsxs)(M.Fragment,{children:[`Verify`,(0,M.jsx)(v,{className:`h-4 w-4`})]})}),(0,M.jsxs)(`div`,{className:`flex items-center gap-4 mt-4`,children:[(0,M.jsxs)(`button`,{onClick:D,className:`text-[12px] text-white/30 hover:text-white/50 flex items-center gap-1 transition-colors`,children:[(0,M.jsx)(c,{className:`h-3 w-3`}),`Back`]}),(0,M.jsx)(`button`,{onClick:()=>{w(e=>!e),_(``),a(``)},className:`text-[12px] text-white/30 hover:text-white/50 transition-colors`,children:C?`Use authenticator code`:`Use a recovery code`})]})]},`totp`)})})})}var ve=(function(e){if(e==null)return Ce;if(typeof e==`function`)return Se(e);if(typeof e==`object`)return Array.isArray(e)?ye(e):be(e);if(typeof e==`string`)return xe(e);throw Error(`Expected function, string, or object as test`)});function ye(e){let t=[],n=-1;for(;++n<e.length;)t[n]=ve(e[n]);return Se(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function be(e){let t=e;return Se(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function xe(e){return Se(t);function t(t){return t&&t.type===e}}function Se(e){return t;function t(t,n,r){return!!(we(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Ce(){return!0}function we(e){return typeof e==`object`&&!!e&&`type`in e}function Te(e){return e}var Ee=[],De=`skip`;function Oe(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=ve(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+Te(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Ee,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=ke(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function ke(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Ee:[e]}function Ae(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Oe(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var je={indicator:`indicator`,textOnly:`text-only`,remove:`remove`};function Me({defaultOrigin:e=``,allowedLinkPrefixes:t=[],allowedImagePrefixes:n=[],allowDataImages:r=!1,allowedProtocols:i=[],blockedImageClass:a=`inline-block bg-gray-200 dark:bg-gray-700 text-gray-600 dark:text-gray-400 px-3 py-1 rounded text-sm`,blockedLinkClass:o=`text-gray-500`,linkBlockPolicy:s=je.indicator,imageBlockPolicy:c=je.indicator}){let l=t.length&&!t.every(e=>e===`*`),u=n.length&&!n.every(e=>e===`*`);if(!e&&(l||u))throw Error(`defaultOrigin is required when allowedLinkPrefixes or allowedImagePrefixes are provided`);return l=>{let u=He(e,t,n,r,i,a,o,s,c);Re(l),Ae(l,u)}}function Ne(e,t){if(typeof e!=`string`)return null;try{return new URL(e)}catch{if(t)try{return new URL(e,t)}catch{return null}if(e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`))try{return new URL(e,`http://example.com`)}catch{return null}return null}}function Pe(e){return typeof e==`string`?e.startsWith(`/`)||e.startsWith(`./`)||e.startsWith(`../`):!1}var Fe=new Set([`https:`,`http:`,`irc:`,`ircs:`,`mailto:`,`xmpp:`,`blob:`]),Ie=new Set([`javascript:`,`data:`,`file:`,`vbscript:`]);function Le(e,t,n,r=!1,i=!1,a=[]){if(!e)return null;if(typeof e==`string`&&e.startsWith(`#`)&&!i)try{if(new URL(e,`http://example.com`).hash===e)return e}catch{}if(typeof e==`string`&&e.startsWith(`data:`))return i&&r&&e.startsWith(`data:image/`)?e:null;if(typeof e==`string`&&e.startsWith(`blob:`)){try{if(new URL(e).protocol===`blob:`&&e.length>5){let t=e.substring(5);if(t&&t.length>0&&t!==`invalid`)return e}}catch{return null}return null}let o=Ne(e,n);if(!o||Ie.has(o.protocol)||!(Fe.has(o.protocol)||a.includes(o.protocol)||a.includes(`*`)))return null;if(o.protocol===`mailto:`||!o.protocol.match(/^https?:$/))return o.href;let s=Pe(e);return o&&t.some(e=>{let t=Ne(e,n);return!t||t.origin!==o.origin?!1:o.href.startsWith(t.href)})?s?o.pathname+o.search+o.hash:o.href:t.includes(`*`)?o.protocol!==`https:`&&o.protocol!==`http:`?null:s?o.pathname+o.search+o.hash:o.href:null}function Re(e){if(`children`in e&&Array.isArray(e.children)){e.children=e.children.filter(e=>e!=null);for(let t of e.children)Re(t)}}var ze=Symbol(`node-seen`);function Be(e,t,n){return t===je.remove?{type:`remove`}:t===je.textOnly?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[...e.children]}}:{type:`replace`,element:{type:`element`,tagName:`span`,properties:{title:`Blocked URL: `+String(e.properties.href),class:n},children:[...e.children,{type:`text`,value:` [blocked]`}]}}}function Ve(e,t,n){if(t===je.remove)return{type:`remove`};if(t===je.textOnly){let t=String(e.properties.alt||``);return t?{type:`replace`,element:{type:`element`,tagName:`span`,properties:{},children:[{type:`text`,value:t}]}}:{type:`remove`}}return{type:`replace`,element:{type:`element`,tagName:`span`,properties:{class:n},children:[{type:`text`,value:`[Image blocked: `+String(e.properties.alt||`No description`)+`]`}]}}}var He=(e,t,n,r,i,a,o,s,c)=>{let l=(u,d,f)=>{if(u.type!==`element`||u[ze])return!0;if(u.tagName===`a`){let n=Le(u.properties.href,t,e,!1,!1,i);if(n===null){if(u[ze]=!0,Ae(u,l),f&&typeof d==`number`){let e=Be(u,s,o);if(e.type===`remove`)return f.children.splice(d,1),[De,d];f.children[d]=e.element}return De}else return u.properties.href=n,u.properties.target=`_blank`,u.properties.rel=`noopener noreferrer`,!0}if(u.tagName===`img`){let t=Le(u.properties.src,n,e,r,!0,i);if(t===null){if(u[ze]=!0,Ae(u,l),f&&typeof d==`number`){let e=Ve(u,c,a);if(e.type===`remove`)return f.children.splice(d,1),[De,d];f.children[d]=e.element}return De}else return u.properties.src=t,!0}return!0};return l},Ue=typeof self==`object`?self:globalThis,We=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new Ue[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new Ue[a](o),i)};return r},Ge=e=>We(new Map,e)(0),Ke=``,{toString:qe}={},{keys:Je}=Object,Ye=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=qe.call(e).slice(8,-1);switch(n){case`Array`:return[1,Ke];case`Object`:return[2,Ke];case`Date`:return[3,Ke];case`RegExp`:return[4,Ke];case`Map`:return[5,Ke];case`Set`:return[6,Ke];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},Xe=([e,t])=>e===0&&(t===`function`||t===`symbol`),Ze=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=Ye(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Je(r))(e||!Xe(Ye(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(Xe(Ye(n))||Xe(Ye(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!Xe(Ye(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},Qe=(e,{json:t,lossy:n}={})=>{let r=[];return Ze(!(t||n),!!t,new Map,r)(e),r},$e=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Ge(Qe(e,t)):structuredClone(e):(e,t)=>Ge(Qe(e,t)),et=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};et.prototype.normal={},et.prototype.property={},et.prototype.space=void 0;function tt(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new et(n,r,t)}function nt(e){return e.toLowerCase()}var rt=class{constructor(e,t){this.attribute=t,this.property=e}};rt.prototype.attribute=``,rt.prototype.booleanish=!1,rt.prototype.boolean=!1,rt.prototype.commaOrSpaceSeparated=!1,rt.prototype.commaSeparated=!1,rt.prototype.defined=!1,rt.prototype.mustUseProperty=!1,rt.prototype.number=!1,rt.prototype.overloadedBoolean=!1,rt.prototype.property=``,rt.prototype.spaceSeparated=!1,rt.prototype.space=void 0;var it=r({boolean:()=>N,booleanish:()=>ot,commaOrSpaceSeparated:()=>ut,commaSeparated:()=>lt,number:()=>P,overloadedBoolean:()=>st,spaceSeparated:()=>ct}),at=0,N=dt(),ot=dt(),st=dt(),P=dt(),ct=dt(),lt=dt(),ut=dt();function dt(){return 2**++at}var ft=Object.keys(it),pt=class extends rt{constructor(e,t,n,r){let i=-1;if(super(e,t),mt(this,`space`,r),typeof n==`number`)for(;++i<ft.length;){let e=ft[i];mt(this,ft[i],(n&it[e])===it[e])}}};pt.prototype.defined=!0;function mt(e,t,n){n&&(e[t]=n)}function ht(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new pt(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[nt(r)]=r,n[nt(a.attribute)]=r}return new et(t,n,e.space)}var gt=ht({properties:{ariaActiveDescendant:null,ariaAtomic:ot,ariaAutoComplete:null,ariaBusy:ot,ariaChecked:ot,ariaColCount:P,ariaColIndex:P,ariaColSpan:P,ariaControls:ct,ariaCurrent:null,ariaDescribedBy:ct,ariaDetails:null,ariaDisabled:ot,ariaDropEffect:ct,ariaErrorMessage:null,ariaExpanded:ot,ariaFlowTo:ct,ariaGrabbed:ot,ariaHasPopup:null,ariaHidden:ot,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ct,ariaLevel:P,ariaLive:null,ariaModal:ot,ariaMultiLine:ot,ariaMultiSelectable:ot,ariaOrientation:null,ariaOwns:ct,ariaPlaceholder:null,ariaPosInSet:P,ariaPressed:ot,ariaReadOnly:ot,ariaRelevant:null,ariaRequired:ot,ariaRoleDescription:ct,ariaRowCount:P,ariaRowIndex:P,ariaRowSpan:P,ariaSelected:ot,ariaSetSize:P,ariaSort:null,ariaValueMax:P,ariaValueMin:P,ariaValueNow:P,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function _t(e,t){return t in e?e[t]:t}function vt(e,t){return _t(e,t.toLowerCase())}var yt=ht({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:lt,acceptCharset:ct,accessKey:ct,action:null,allow:null,allowFullScreen:N,allowPaymentRequest:N,allowUserMedia:N,alt:null,as:null,async:N,autoCapitalize:null,autoComplete:ct,autoFocus:N,autoPlay:N,blocking:ct,capture:null,charSet:null,checked:N,cite:null,className:ct,cols:P,colSpan:null,content:null,contentEditable:ot,controls:N,controlsList:ct,coords:P|lt,crossOrigin:null,data:null,dateTime:null,decoding:null,default:N,defer:N,dir:null,dirName:null,disabled:N,download:st,draggable:ot,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:N,formTarget:null,headers:ct,height:P,hidden:st,high:P,href:null,hrefLang:null,htmlFor:ct,httpEquiv:ct,id:null,imageSizes:null,imageSrcSet:null,inert:N,inputMode:null,integrity:null,is:null,isMap:N,itemId:null,itemProp:ct,itemRef:ct,itemScope:N,itemType:ct,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:N,low:P,manifest:null,max:null,maxLength:P,media:null,method:null,min:null,minLength:P,multiple:N,muted:N,name:null,nonce:null,noModule:N,noValidate:N,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:N,optimum:P,pattern:null,ping:ct,placeholder:null,playsInline:N,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:N,referrerPolicy:null,rel:ct,required:N,reversed:N,rows:P,rowSpan:P,sandbox:ct,scope:null,scoped:N,seamless:N,selected:N,shadowRootClonable:N,shadowRootDelegatesFocus:N,shadowRootMode:null,shape:null,size:P,sizes:null,slot:null,span:P,spellCheck:ot,src:null,srcDoc:null,srcLang:null,srcSet:null,start:P,step:null,style:null,tabIndex:P,target:null,title:null,translate:null,type:null,typeMustMatch:N,useMap:null,value:ot,width:P,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ct,axis:null,background:null,bgColor:null,border:P,borderColor:null,bottomMargin:P,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:N,declare:N,event:null,face:null,frame:null,frameBorder:null,hSpace:P,leftMargin:P,link:null,longDesc:null,lowSrc:null,marginHeight:P,marginWidth:P,noResize:N,noHref:N,noShade:N,noWrap:N,object:null,profile:null,prompt:null,rev:null,rightMargin:P,rules:null,scheme:null,scrolling:ot,standby:null,summary:null,text:null,topMargin:P,valueType:null,version:null,vAlign:null,vLink:null,vSpace:P,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:N,disableRemotePlayback:N,prefix:null,property:null,results:P,security:null,unselectable:null},space:`html`,transform:vt}),bt=ht({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:ut,accentHeight:P,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:P,amplitude:P,arabicForm:null,ascent:P,attributeName:null,attributeType:null,azimuth:P,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:P,by:null,calcMode:null,capHeight:P,className:ct,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:P,diffuseConstant:P,direction:null,display:null,dur:null,divisor:P,dominantBaseline:null,download:N,dx:null,dy:null,edgeMode:null,editable:null,elevation:P,enableBackground:null,end:null,event:null,exponent:P,externalResourcesRequired:null,fill:null,fillOpacity:P,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:lt,g2:lt,glyphName:lt,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:P,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:P,horizOriginX:P,horizOriginY:P,id:null,ideographic:P,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:P,k:P,k1:P,k2:P,k3:P,k4:P,kernelMatrix:ut,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:P,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:P,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:P,overlineThickness:P,paintOrder:null,panose1:null,path:null,pathLength:P,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ct,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:P,pointsAtY:P,pointsAtZ:P,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ut,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ut,rev:ut,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ut,requiredFeatures:ut,requiredFonts:ut,requiredFormats:ut,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:P,specularExponent:P,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:P,strikethroughThickness:P,string:null,stroke:null,strokeDashArray:ut,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:P,strokeOpacity:P,strokeWidth:null,style:null,surfaceScale:P,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ut,tabIndex:P,tableValues:null,target:null,targetX:P,targetY:P,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ut,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:P,underlineThickness:P,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:P,values:null,vAlphabetic:P,vMathematical:P,vectorEffect:null,vHanging:P,vIdeographic:P,version:null,vertAdvY:P,vertOriginX:P,vertOriginY:P,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:P,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:_t}),xt=ht({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()}}),St=ht({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:vt}),Ct=ht({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),wt={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`},Tt=/[A-Z]/g,Et=/-[a-z]/g,Dt=/^data[-\w.:]+$/i;function Ot(e,t){let n=nt(t),r=t,i=rt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Dt.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Et,At);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Et.test(e)){let n=e.replace(Tt,kt);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=pt}return new i(r,t)}function kt(e){return`-`+e.toLowerCase()}function At(e){return e.charAt(1).toUpperCase()}var jt=tt([gt,yt,xt,St,Ct],`html`),Mt=tt([gt,bt,xt,St,Ct],`svg`);function Nt(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function Pt(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Ft=/[#.]/g;function It(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){Ft.lastIndex=i;let e=Ft.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function Lt(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Rt(e){return e.join(` `).trim()}function zt(e,t,n){let r=n?Gt(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=It(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,Bt(i))a.unshift(i);else for(let[t,n]of Object.entries(i))Vt(e,o.properties,t,n)}for(let e of a)Ht(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function Bt(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function Vt(e,t,n,r){let i=Ot(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?Lt(r):i.commaSeparated?Nt(r):i.commaOrSpaceSeparated?Lt(Nt(r).join(` `)):Ut(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?Wt(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(Ut(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function Ht(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(let n of t)Ht(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?Ht(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}function Ut(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||nt(n)===nt(t)))return!0}return n}function Wt(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function Gt(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var Kt=`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`.split(`.`),qt=zt(jt,`div`),Jt=zt(Mt,`g`,Kt);function Yt(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=Xt(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=Xt(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function Xt(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
|
|
3
3
|
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var Zt={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/`},Qt={}.hasOwnProperty,$t=Object.prototype;function en(e,t){let n=t||{};return tn({file:n.file||void 0,location:!1,schema:n.space===`svg`?Mt:jt,verbose:n.verbose||!1},e)}function tn(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},an(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:nn(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=Yt(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},an(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},an(e,r,n),n}default:return n=rn(e,t),n}}function nn(e,t){let n=-1,r=[];for(;++n<t.length;){let i=tn(e,t[n]);r.push(i)}return r}function rn(e,t){let n=e.schema;e.schema=t.namespaceURI===Zt.svg?Mt:jt;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;Qt.call($t,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?Jt:qt)(t.tagName,i,nn(e,t.childNodes));if(an(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&sn(r.startTag),o=r&&r.endTag&&sn(r.endTag),s=tn(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function an(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=on(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function on(e,t,n){let r=sn(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)Qt.call(n.attrs,i)&&(r[Ot(e.schema,i).property]=sn(n.attrs[i]));n.startTag;let a=sn(n.startTag),o=n.endTag?sn(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function sn(e){let t=cn({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=cn({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function cn(e){return e.line&&e.column?e:void 0}var ln={}.hasOwnProperty;function un(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&ln.call(t,e)){let n=String(t[e]);i=ln.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var dn={},fn={}.hasOwnProperty,pn=un(`type`,{handlers:{root:hn,element:bn,text:vn,comment:yn,doctype:_n}});function mn(e,t){let n=(t||dn).space;return pn(e,n===`svg`?Mt:jt)}function hn(e,t){let n={nodeName:`#document`,mode:(e.data||{}).quirksMode?`quirks`:`no-quirks`,childNodes:[]};return n.childNodes=Sn(e.children,n,t),Cn(e,n),n}function gn(e,t){let n={nodeName:`#document-fragment`,childNodes:[]};return n.childNodes=Sn(e.children,n,t),Cn(e,n),n}function _n(e){let t={nodeName:`#documentType`,name:`html`,publicId:``,systemId:``,parentNode:null};return Cn(e,t),t}function vn(e){let t={nodeName:`#text`,value:e.value,parentNode:null};return Cn(e,t),t}function yn(e){let t={nodeName:`#comment`,data:e.value,parentNode:null};return Cn(e,t),t}function bn(e,t){let n=t,r=n;e.type===`element`&&e.tagName.toLowerCase()===`svg`&&n.space===`html`&&(r=Mt);let i=[],a;if(e.properties){for(a in e.properties)if(a!==`children`&&fn.call(e.properties,a)){let t=xn(r,a,e.properties[a]);t&&i.push(t)}}let o=r.space,s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:Zt[o],childNodes:[],parentNode:null};return s.childNodes=Sn(e.children,s,r),Cn(e,s),e.tagName===`template`&&e.content&&(s.content=gn(e.content,r)),s}function xn(e,t,n){let r=Ot(e,t);if(n===!1||n==null||typeof n==`number`&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?Pt(n):Rt(n));let i={name:r.attribute,value:n===!0?``:String(n)};if(r.space&&r.space!==`html`&&r.space!==`svg`){let e=i.name.indexOf(`:`);e<0?i.prefix=``:(i.name=i.name.slice(e+1),i.prefix=r.attribute.slice(0,e)),i.namespace=Zt[r.space]}return i}function Sn(e,t,n){let r=-1,i=[];if(e)for(;++r<e.length;){let a=pn(e[r],n);a.parentNode=t,i.push(a)}return i}function Cn(e,t){let 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})}var wn=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Tn=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]),F;(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`})(F||={});var En={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function Dn(e){return e>=55296&&e<=57343}function On(e){return e>=56320&&e<=57343}function kn(e,t){return(e-55296)*1024+9216+t}function An(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function jn(e){return e>=64976&&e<=65007||Tn.has(e)}var I;(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`})(I||={});var Mn=65536,Nn=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=Mn,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(On(t))return this.pos++,this._addGap(),kn(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,F.EOF;return this._err(I.surrogateInInputStream),e}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(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,F.EOF;let n=this.html.charCodeAt(t);return n===F.CARRIAGE_RETURN?F.LINE_FEED:n}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,F.EOF;let e=this.html.charCodeAt(this.pos);return e===F.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,F.LINE_FEED):e===F.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Dn(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===F.LINE_FEED||e===F.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){An(e)?this._err(I.controlCharacterInInputStream):jn(e)&&this._err(I.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},L;(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`})(L||={});function Pn(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}var Fn=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肻\xA0ଷ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))),In=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]]);String.fromCodePoint;function Ln(e){return e>=55296&&e<=57343||e>1114111?65533:In.get(e)??e}var Rn;(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`})(Rn||={});var zn=32,Bn;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(Bn||={});function Vn(e){return e>=Rn.ZERO&&e<=Rn.NINE}function Hn(e){return e>=Rn.UPPER_A&&e<=Rn.UPPER_F||e>=Rn.LOWER_A&&e<=Rn.LOWER_F}function Un(e){return e>=Rn.UPPER_A&&e<=Rn.UPPER_Z||e>=Rn.LOWER_A&&e<=Rn.LOWER_Z||Vn(e)}function Wn(e){return e===Rn.EQUALS||Un(e)}var Gn;(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`})(Gn||={});var Kn;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(Kn||={});var qn=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Gn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Kn.Strict}startEntity(e){this.decodeMode=e,this.state=Gn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Gn.EntityStart:return e.charCodeAt(t)===Rn.NUM?(this.state=Gn.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Gn.NamedEntity,this.stateNamedEntity(e,t));case Gn.NumericStart:return this.stateNumericStart(e,t);case Gn.NumericDecimal:return this.stateNumericDecimal(e,t);case Gn.NumericHex:return this.stateNumericHex(e,t);case Gn.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|zn)===Rn.LOWER_X?(this.state=Gn.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Gn.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(Vn(r)||Hn(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(Vn(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Rn.SEMI)this.consumed+=1;else if(this.decodeMode===Kn.Strict)return 0;return this.emitCodePoint(Ln(this.result),this.consumed),this.errors&&(e!==Rn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&Bn.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=Jn(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===Kn.Attribute&&(i===0||Wn(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&Bn.VALUE_LENGTH)>>14,i!==0){if(a===Rn.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Kn.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&Bn.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~Bn.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case Gn.NamedEntity:return this.result!==0&&(this.decodeMode!==Kn.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Gn.NumericDecimal:return this.emitNumericEntity(0,2);case Gn.NumericHex:return this.emitNumericEntity(0,3);case Gn.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Gn.EntityStart:return 0}}};function Jn(e,t,n,r){let i=(t&Bn.BRANCH_LENGTH)>>7,a=t&Bn.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var R;(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/`})(R||={});var Yn;(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`})(Yn||={});var Xn;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(Xn||={});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||={});var B;(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`})(B||={});var Zn=new Map([[z.A,B.A],[z.ADDRESS,B.ADDRESS],[z.ANNOTATION_XML,B.ANNOTATION_XML],[z.APPLET,B.APPLET],[z.AREA,B.AREA],[z.ARTICLE,B.ARTICLE],[z.ASIDE,B.ASIDE],[z.B,B.B],[z.BASE,B.BASE],[z.BASEFONT,B.BASEFONT],[z.BGSOUND,B.BGSOUND],[z.BIG,B.BIG],[z.BLOCKQUOTE,B.BLOCKQUOTE],[z.BODY,B.BODY],[z.BR,B.BR],[z.BUTTON,B.BUTTON],[z.CAPTION,B.CAPTION],[z.CENTER,B.CENTER],[z.CODE,B.CODE],[z.COL,B.COL],[z.COLGROUP,B.COLGROUP],[z.DD,B.DD],[z.DESC,B.DESC],[z.DETAILS,B.DETAILS],[z.DIALOG,B.DIALOG],[z.DIR,B.DIR],[z.DIV,B.DIV],[z.DL,B.DL],[z.DT,B.DT],[z.EM,B.EM],[z.EMBED,B.EMBED],[z.FIELDSET,B.FIELDSET],[z.FIGCAPTION,B.FIGCAPTION],[z.FIGURE,B.FIGURE],[z.FONT,B.FONT],[z.FOOTER,B.FOOTER],[z.FOREIGN_OBJECT,B.FOREIGN_OBJECT],[z.FORM,B.FORM],[z.FRAME,B.FRAME],[z.FRAMESET,B.FRAMESET],[z.H1,B.H1],[z.H2,B.H2],[z.H3,B.H3],[z.H4,B.H4],[z.H5,B.H5],[z.H6,B.H6],[z.HEAD,B.HEAD],[z.HEADER,B.HEADER],[z.HGROUP,B.HGROUP],[z.HR,B.HR],[z.HTML,B.HTML],[z.I,B.I],[z.IMG,B.IMG],[z.IMAGE,B.IMAGE],[z.INPUT,B.INPUT],[z.IFRAME,B.IFRAME],[z.KEYGEN,B.KEYGEN],[z.LABEL,B.LABEL],[z.LI,B.LI],[z.LINK,B.LINK],[z.LISTING,B.LISTING],[z.MAIN,B.MAIN],[z.MALIGNMARK,B.MALIGNMARK],[z.MARQUEE,B.MARQUEE],[z.MATH,B.MATH],[z.MENU,B.MENU],[z.META,B.META],[z.MGLYPH,B.MGLYPH],[z.MI,B.MI],[z.MO,B.MO],[z.MN,B.MN],[z.MS,B.MS],[z.MTEXT,B.MTEXT],[z.NAV,B.NAV],[z.NOBR,B.NOBR],[z.NOFRAMES,B.NOFRAMES],[z.NOEMBED,B.NOEMBED],[z.NOSCRIPT,B.NOSCRIPT],[z.OBJECT,B.OBJECT],[z.OL,B.OL],[z.OPTGROUP,B.OPTGROUP],[z.OPTION,B.OPTION],[z.P,B.P],[z.PARAM,B.PARAM],[z.PLAINTEXT,B.PLAINTEXT],[z.PRE,B.PRE],[z.RB,B.RB],[z.RP,B.RP],[z.RT,B.RT],[z.RTC,B.RTC],[z.RUBY,B.RUBY],[z.S,B.S],[z.SCRIPT,B.SCRIPT],[z.SEARCH,B.SEARCH],[z.SECTION,B.SECTION],[z.SELECT,B.SELECT],[z.SOURCE,B.SOURCE],[z.SMALL,B.SMALL],[z.SPAN,B.SPAN],[z.STRIKE,B.STRIKE],[z.STRONG,B.STRONG],[z.STYLE,B.STYLE],[z.SUB,B.SUB],[z.SUMMARY,B.SUMMARY],[z.SUP,B.SUP],[z.TABLE,B.TABLE],[z.TBODY,B.TBODY],[z.TEMPLATE,B.TEMPLATE],[z.TEXTAREA,B.TEXTAREA],[z.TFOOT,B.TFOOT],[z.TD,B.TD],[z.TH,B.TH],[z.THEAD,B.THEAD],[z.TITLE,B.TITLE],[z.TR,B.TR],[z.TRACK,B.TRACK],[z.TT,B.TT],[z.U,B.U],[z.UL,B.UL],[z.SVG,B.SVG],[z.VAR,B.VAR],[z.WBR,B.WBR],[z.XMP,B.XMP]]);function Qn(e){return Zn.get(e)??B.UNKNOWN}var V=B,$n={[R.HTML]:new Set([V.ADDRESS,V.APPLET,V.AREA,V.ARTICLE,V.ASIDE,V.BASE,V.BASEFONT,V.BGSOUND,V.BLOCKQUOTE,V.BODY,V.BR,V.BUTTON,V.CAPTION,V.CENTER,V.COL,V.COLGROUP,V.DD,V.DETAILS,V.DIR,V.DIV,V.DL,V.DT,V.EMBED,V.FIELDSET,V.FIGCAPTION,V.FIGURE,V.FOOTER,V.FORM,V.FRAME,V.FRAMESET,V.H1,V.H2,V.H3,V.H4,V.H5,V.H6,V.HEAD,V.HEADER,V.HGROUP,V.HR,V.HTML,V.IFRAME,V.IMG,V.INPUT,V.LI,V.LINK,V.LISTING,V.MAIN,V.MARQUEE,V.MENU,V.META,V.NAV,V.NOEMBED,V.NOFRAMES,V.NOSCRIPT,V.OBJECT,V.OL,V.P,V.PARAM,V.PLAINTEXT,V.PRE,V.SCRIPT,V.SECTION,V.SELECT,V.SOURCE,V.STYLE,V.SUMMARY,V.TABLE,V.TBODY,V.TD,V.TEMPLATE,V.TEXTAREA,V.TFOOT,V.TH,V.THEAD,V.TITLE,V.TR,V.TRACK,V.UL,V.WBR,V.XMP]),[R.MATHML]:new Set([V.MI,V.MO,V.MN,V.MS,V.MTEXT,V.ANNOTATION_XML]),[R.SVG]:new Set([V.TITLE,V.FOREIGN_OBJECT,V.DESC]),[R.XLINK]:new Set,[R.XML]:new Set,[R.XMLNS]:new Set},er=new Set([V.H1,V.H2,V.H3,V.H4,V.H5,V.H6]);new Set([z.STYLE,z.SCRIPT,z.XMP,z.IFRAME,z.NOEMBED,z.NOFRAMES,z.PLAINTEXT]);var H;(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`})(H||={});var tr={DATA:H.DATA,RCDATA:H.RCDATA,RAWTEXT:H.RAWTEXT,SCRIPT_DATA:H.SCRIPT_DATA,PLAINTEXT:H.PLAINTEXT,CDATA_SECTION:H.CDATA_SECTION};function nr(e){return e>=F.DIGIT_0&&e<=F.DIGIT_9}function rr(e){return e>=F.LATIN_CAPITAL_A&&e<=F.LATIN_CAPITAL_Z}function ir(e){return e>=F.LATIN_SMALL_A&&e<=F.LATIN_SMALL_Z}function ar(e){return ir(e)||rr(e)}function or(e){return ar(e)||nr(e)}function sr(e){return e+32}function cr(e){return e===F.SPACE||e===F.LINE_FEED||e===F.TABULATION||e===F.FORM_FEED}function lr(e){return cr(e)||e===F.SOLIDUS||e===F.GREATER_THAN_SIGN}function ur(e){return e===F.NULL?I.nullCharacterReference:e>1114111?I.characterReferenceOutsideUnicodeRange:Dn(e)?I.surrogateCharacterReference:jn(e)?I.noncharacterCharacterReference:An(e)||e===F.CARRIAGE_RETURN?I.controlCharacterReference:null}var dr=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=H.DATA,this.returnState=H.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new Nn(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new qn(Fn,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(I.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(I.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=ur(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),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(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:L.START_TAG,tagName:``,tagID:B.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:L.END_TAG,tagName:``,tagID:B.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:L.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:L.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(Pn(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(I.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=Qn(e.tagName),e.type===L.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(I.endTagWithAttributes),e.selfClosing&&this._err(I.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case L.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case L.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case L.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:L.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,t)}_emitCodePoint(e){let t=cr(e)?L.WHITESPACE_CHARACTER:e===F.NULL?L.NULL_CHARACTER:L.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(L.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=H.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Kn.Attribute:Kn.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===H.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===H.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===H.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case H.DATA:this._stateData(e);break;case H.RCDATA:this._stateRcdata(e);break;case H.RAWTEXT:this._stateRawtext(e);break;case H.SCRIPT_DATA:this._stateScriptData(e);break;case H.PLAINTEXT:this._statePlaintext(e);break;case H.TAG_OPEN:this._stateTagOpen(e);break;case H.END_TAG_OPEN:this._stateEndTagOpen(e);break;case H.TAG_NAME:this._stateTagName(e);break;case H.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case H.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case H.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case H.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case H.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case H.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case H.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case H.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case H.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case H.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case H.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case H.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case H.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case H.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case H.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case H.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case H.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case H.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case H.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case H.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case H.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case H.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case H.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case H.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case H.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case H.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case H.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case H.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case H.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case H.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case H.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case H.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case H.BOGUS_COMMENT:this._stateBogusComment(e);break;case H.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case H.COMMENT_START:this._stateCommentStart(e);break;case H.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case H.COMMENT:this._stateComment(e);break;case H.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case H.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case H.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case H.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case H.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case H.COMMENT_END:this._stateCommentEnd(e);break;case H.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case H.DOCTYPE:this._stateDoctype(e);break;case H.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case H.DOCTYPE_NAME:this._stateDoctypeName(e);break;case H.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case H.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case H.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case H.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case H.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case H.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case H.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case H.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case H.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case H.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case H.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case H.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case H.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case H.CDATA_SECTION:this._stateCdataSection(e);break;case H.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case H.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case H.CHARACTER_REFERENCE:this._stateCharacterReference();break;case H.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case F.LESS_THAN_SIGN:this.state=H.TAG_OPEN;break;case F.AMPERSAND:this._startCharacterReference();break;case F.NULL:this._err(I.unexpectedNullCharacter),this._emitCodePoint(e);break;case F.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case F.AMPERSAND:this._startCharacterReference();break;case F.LESS_THAN_SIGN:this.state=H.RCDATA_LESS_THAN_SIGN;break;case F.NULL:this._err(I.unexpectedNullCharacter),this._emitChars(`�`);break;case F.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case F.LESS_THAN_SIGN:this.state=H.RAWTEXT_LESS_THAN_SIGN;break;case F.NULL:this._err(I.unexpectedNullCharacter),this._emitChars(`�`);break;case F.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case F.LESS_THAN_SIGN:this.state=H.SCRIPT_DATA_LESS_THAN_SIGN;break;case F.NULL:this._err(I.unexpectedNullCharacter),this._emitChars(`�`);break;case F.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case F.NULL:this._err(I.unexpectedNullCharacter),this._emitChars(`�`);break;case F.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(ar(e))this._createStartTagToken(),this.state=H.TAG_NAME,this._stateTagName(e);else switch(e){case F.EXCLAMATION_MARK:this.state=H.MARKUP_DECLARATION_OPEN;break;case F.SOLIDUS:this.state=H.END_TAG_OPEN;break;case F.QUESTION_MARK:this._err(I.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=H.BOGUS_COMMENT,this._stateBogusComment(e);break;case F.EOF:this._err(I.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(I.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=H.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(ar(e))this._createEndTagToken(),this.state=H.TAG_NAME,this._stateTagName(e);else switch(e){case F.GREATER_THAN_SIGN:this._err(I.missingEndTagName),this.state=H.DATA;break;case F.EOF:this._err(I.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(I.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=H.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:this.state=H.BEFORE_ATTRIBUTE_NAME;break;case F.SOLIDUS:this.state=H.SELF_CLOSING_START_TAG;break;case F.GREATER_THAN_SIGN:this.state=H.DATA,this.emitCurrentTagToken();break;case F.NULL:this._err(I.unexpectedNullCharacter),t.tagName+=`�`;break;case F.EOF:this._err(I.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(rr(e)?sr(e):e)}}_stateRcdataLessThanSign(e){e===F.SOLIDUS?this.state=H.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=H.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){ar(e)?(this.state=H.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=H.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=H.BEFORE_ATTRIBUTE_NAME,!1;case F.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=H.SELF_CLOSING_START_TAG,!1;case F.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=H.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=H.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===F.SOLIDUS?this.state=H.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=H.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){ar(e)?(this.state=H.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=H.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=H.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case F.SOLIDUS:this.state=H.SCRIPT_DATA_END_TAG_OPEN;break;case F.EXCLAMATION_MARK:this.state=H.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=H.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){ar(e)?(this.state=H.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=H.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=H.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===F.HYPHEN_MINUS?(this.state=H.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=H.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===F.HYPHEN_MINUS?(this.state=H.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=H.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case F.HYPHEN_MINUS:this.state=H.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case F.LESS_THAN_SIGN:this.state=H.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case F.NULL:this._err(I.unexpectedNullCharacter),this._emitChars(`�`);break;case F.EOF:this._err(I.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case F.HYPHEN_MINUS:this.state=H.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case F.LESS_THAN_SIGN:this.state=H.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case F.NULL:this._err(I.unexpectedNullCharacter),this.state=H.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case F.EOF:this._err(I.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=H.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case F.HYPHEN_MINUS:this._emitChars(`-`);break;case F.LESS_THAN_SIGN:this.state=H.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case F.GREATER_THAN_SIGN:this.state=H.SCRIPT_DATA,this._emitChars(`>`);break;case F.NULL:this._err(I.unexpectedNullCharacter),this.state=H.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case F.EOF:this._err(I.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=H.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===F.SOLIDUS?this.state=H.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ar(e)?(this._emitChars(`<`),this.state=H.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=H.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){ar(e)?(this.state=H.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=H.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=H.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(En.SCRIPT,!1)&&lr(this.preprocessor.peek(En.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<En.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=H.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case F.HYPHEN_MINUS:this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case F.LESS_THAN_SIGN:this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case F.NULL:this._err(I.unexpectedNullCharacter),this._emitChars(`�`);break;case F.EOF:this._err(I.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case F.HYPHEN_MINUS:this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case F.LESS_THAN_SIGN:this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case F.NULL:this._err(I.unexpectedNullCharacter),this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case F.EOF:this._err(I.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case F.HYPHEN_MINUS:this._emitChars(`-`);break;case F.LESS_THAN_SIGN:this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case F.GREATER_THAN_SIGN:this.state=H.SCRIPT_DATA,this._emitChars(`>`);break;case F.NULL:this._err(I.unexpectedNullCharacter),this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case F.EOF:this._err(I.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===F.SOLIDUS?(this.state=H.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(En.SCRIPT,!1)&&lr(this.preprocessor.peek(En.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<En.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=H.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=H.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.SOLIDUS:case F.GREATER_THAN_SIGN:case F.EOF:this.state=H.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case F.EQUALS_SIGN:this._err(I.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=H.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=H.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:case F.SOLIDUS:case F.GREATER_THAN_SIGN:case F.EOF:this._leaveAttrName(),this.state=H.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case F.EQUALS_SIGN:this._leaveAttrName(),this.state=H.BEFORE_ATTRIBUTE_VALUE;break;case F.QUOTATION_MARK:case F.APOSTROPHE:case F.LESS_THAN_SIGN:this._err(I.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case F.NULL:this._err(I.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(rr(e)?sr(e):e)}}_stateAfterAttributeName(e){switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.SOLIDUS:this.state=H.SELF_CLOSING_START_TAG;break;case F.EQUALS_SIGN:this.state=H.BEFORE_ATTRIBUTE_VALUE;break;case F.GREATER_THAN_SIGN:this.state=H.DATA,this.emitCurrentTagToken();break;case F.EOF:this._err(I.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=H.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.QUOTATION_MARK:this.state=H.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case F.APOSTROPHE:this.state=H.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case F.GREATER_THAN_SIGN:this._err(I.missingAttributeValue),this.state=H.DATA,this.emitCurrentTagToken();break;default:this.state=H.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case F.QUOTATION_MARK:this.state=H.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case F.AMPERSAND:this._startCharacterReference();break;case F.NULL:this._err(I.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case F.EOF:this._err(I.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case F.APOSTROPHE:this.state=H.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case F.AMPERSAND:this._startCharacterReference();break;case F.NULL:this._err(I.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case F.EOF:this._err(I.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:this._leaveAttrValue(),this.state=H.BEFORE_ATTRIBUTE_NAME;break;case F.AMPERSAND:this._startCharacterReference();break;case F.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=H.DATA,this.emitCurrentTagToken();break;case F.NULL:this._err(I.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case F.QUOTATION_MARK:case F.APOSTROPHE:case F.LESS_THAN_SIGN:case F.EQUALS_SIGN:case F.GRAVE_ACCENT:this._err(I.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case F.EOF:this._err(I.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:this._leaveAttrValue(),this.state=H.BEFORE_ATTRIBUTE_NAME;break;case F.SOLIDUS:this._leaveAttrValue(),this.state=H.SELF_CLOSING_START_TAG;break;case F.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=H.DATA,this.emitCurrentTagToken();break;case F.EOF:this._err(I.eofInTag),this._emitEOFToken();break;default:this._err(I.missingWhitespaceBetweenAttributes),this.state=H.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case F.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=H.DATA,this.emitCurrentTagToken();break}case F.EOF:this._err(I.eofInTag),this._emitEOFToken();break;default:this._err(I.unexpectedSolidusInTag),this.state=H.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case F.GREATER_THAN_SIGN:this.state=H.DATA,this.emitCurrentComment(t);break;case F.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case F.NULL:this._err(I.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(En.DASH_DASH,!0)?(this._createCommentToken(En.DASH_DASH.length+1),this.state=H.COMMENT_START):this._consumeSequenceIfMatch(En.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(En.DOCTYPE.length+1),this.state=H.DOCTYPE):this._consumeSequenceIfMatch(En.CDATA_START,!0)?this.inForeignNode?this.state=H.CDATA_SECTION:(this._err(I.cdataInHtmlContent),this._createCommentToken(En.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=H.BOGUS_COMMENT):this._ensureHibernation()||(this._err(I.incorrectlyOpenedComment),this._createCommentToken(2),this.state=H.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case F.HYPHEN_MINUS:this.state=H.COMMENT_START_DASH;break;case F.GREATER_THAN_SIGN:{this._err(I.abruptClosingOfEmptyComment),this.state=H.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=H.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case F.HYPHEN_MINUS:this.state=H.COMMENT_END;break;case F.GREATER_THAN_SIGN:this._err(I.abruptClosingOfEmptyComment),this.state=H.DATA,this.emitCurrentComment(t);break;case F.EOF:this._err(I.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=H.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case F.HYPHEN_MINUS:this.state=H.COMMENT_END_DASH;break;case F.LESS_THAN_SIGN:t.data+=`<`,this.state=H.COMMENT_LESS_THAN_SIGN;break;case F.NULL:this._err(I.unexpectedNullCharacter),t.data+=`�`;break;case F.EOF:this._err(I.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case F.EXCLAMATION_MARK:t.data+=`!`,this.state=H.COMMENT_LESS_THAN_SIGN_BANG;break;case F.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=H.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===F.HYPHEN_MINUS?this.state=H.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=H.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===F.HYPHEN_MINUS?this.state=H.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=H.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==F.GREATER_THAN_SIGN&&e!==F.EOF&&this._err(I.nestedComment),this.state=H.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case F.HYPHEN_MINUS:this.state=H.COMMENT_END;break;case F.EOF:this._err(I.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=H.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case F.GREATER_THAN_SIGN:this.state=H.DATA,this.emitCurrentComment(t);break;case F.EXCLAMATION_MARK:this.state=H.COMMENT_END_BANG;break;case F.HYPHEN_MINUS:t.data+=`-`;break;case F.EOF:this._err(I.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=H.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case F.HYPHEN_MINUS:t.data+=`--!`,this.state=H.COMMENT_END_DASH;break;case F.GREATER_THAN_SIGN:this._err(I.incorrectlyClosedComment),this.state=H.DATA,this.emitCurrentComment(t);break;case F.EOF:this._err(I.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=H.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:this.state=H.BEFORE_DOCTYPE_NAME;break;case F.GREATER_THAN_SIGN:this.state=H.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case F.EOF:{this._err(I.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(I.missingWhitespaceBeforeDoctypeName),this.state=H.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(rr(e))this._createDoctypeToken(String.fromCharCode(sr(e))),this.state=H.DOCTYPE_NAME;else switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.NULL:this._err(I.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=H.DOCTYPE_NAME;break;case F.GREATER_THAN_SIGN:{this._err(I.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=H.DATA;break}case F.EOF:{this._err(I.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=H.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:this.state=H.AFTER_DOCTYPE_NAME;break;case F.GREATER_THAN_SIGN:this.state=H.DATA,this.emitCurrentDoctype(t);break;case F.NULL:this._err(I.unexpectedNullCharacter),t.name+=`�`;break;case F.EOF:this._err(I.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(rr(e)?sr(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.GREATER_THAN_SIGN:this.state=H.DATA,this.emitCurrentDoctype(t);break;case F.EOF:this._err(I.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(En.PUBLIC,!1)?this.state=H.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(En.SYSTEM,!1)?this.state=H.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(I.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:this.state=H.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case F.QUOTATION_MARK:this._err(I.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=H.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case F.APOSTROPHE:this._err(I.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=H.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case F.GREATER_THAN_SIGN:this._err(I.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=H.DATA,this.emitCurrentDoctype(t);break;case F.EOF:this._err(I.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(I.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.QUOTATION_MARK:t.publicId=``,this.state=H.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case F.APOSTROPHE:t.publicId=``,this.state=H.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case F.GREATER_THAN_SIGN:this._err(I.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=H.DATA,this.emitCurrentDoctype(t);break;case F.EOF:this._err(I.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(I.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case F.QUOTATION_MARK:this.state=H.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case F.NULL:this._err(I.unexpectedNullCharacter),t.publicId+=`�`;break;case F.GREATER_THAN_SIGN:this._err(I.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=H.DATA;break;case F.EOF:this._err(I.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case F.APOSTROPHE:this.state=H.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case F.NULL:this._err(I.unexpectedNullCharacter),t.publicId+=`�`;break;case F.GREATER_THAN_SIGN:this._err(I.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=H.DATA;break;case F.EOF:this._err(I.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:this.state=H.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case F.GREATER_THAN_SIGN:this.state=H.DATA,this.emitCurrentDoctype(t);break;case F.QUOTATION_MARK:this._err(I.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case F.APOSTROPHE:this._err(I.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case F.EOF:this._err(I.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(I.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=H.DATA;break;case F.QUOTATION_MARK:t.systemId=``,this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case F.APOSTROPHE:t.systemId=``,this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case F.EOF:this._err(I.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(I.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:this.state=H.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case F.QUOTATION_MARK:this._err(I.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case F.APOSTROPHE:this._err(I.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case F.GREATER_THAN_SIGN:this._err(I.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=H.DATA,this.emitCurrentDoctype(t);break;case F.EOF:this._err(I.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(I.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.QUOTATION_MARK:t.systemId=``,this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case F.APOSTROPHE:t.systemId=``,this.state=H.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case F.GREATER_THAN_SIGN:this._err(I.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=H.DATA,this.emitCurrentDoctype(t);break;case F.EOF:this._err(I.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(I.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case F.QUOTATION_MARK:this.state=H.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case F.NULL:this._err(I.unexpectedNullCharacter),t.systemId+=`�`;break;case F.GREATER_THAN_SIGN:this._err(I.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=H.DATA;break;case F.EOF:this._err(I.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case F.APOSTROPHE:this.state=H.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case F.NULL:this._err(I.unexpectedNullCharacter),t.systemId+=`�`;break;case F.GREATER_THAN_SIGN:this._err(I.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=H.DATA;break;case F.EOF:this._err(I.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case F.SPACE:case F.LINE_FEED:case F.TABULATION:case F.FORM_FEED:break;case F.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=H.DATA;break;case F.EOF:this._err(I.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(I.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=H.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case F.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=H.DATA;break;case F.NULL:this._err(I.unexpectedNullCharacter);break;case F.EOF:this.emitCurrentDoctype(t),this._emitEOFToken();break;default:}}_stateCdataSection(e){switch(e){case F.RIGHT_SQUARE_BRACKET:this.state=H.CDATA_SECTION_BRACKET;break;case F.EOF:this._err(I.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===F.RIGHT_SQUARE_BRACKET?this.state=H.CDATA_SECTION_END:(this._emitChars(`]`),this.state=H.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case F.GREATER_THAN_SIGN:this.state=H.DATA;break;case F.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=H.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(F.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&or(this.preprocessor.peek(1))?H.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){or(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===F.SEMICOLON&&this._err(I.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},fr=new Set([B.DD,B.DT,B.LI,B.OPTGROUP,B.OPTION,B.P,B.RB,B.RP,B.RT,B.RTC]),pr=new Set([...fr,B.CAPTION,B.COLGROUP,B.TBODY,B.TD,B.TFOOT,B.TH,B.THEAD,B.TR]),mr=new Set([B.APPLET,B.CAPTION,B.HTML,B.MARQUEE,B.OBJECT,B.TABLE,B.TD,B.TEMPLATE,B.TH]),hr=new Set([...mr,B.OL,B.UL]),gr=new Set([...mr,B.BUTTON]),_r=new Set([B.ANNOTATION_XML,B.MI,B.MN,B.MO,B.MS,B.MTEXT]),vr=new Set([B.DESC,B.FOREIGN_OBJECT,B.TITLE]),yr=new Set([B.TR,B.TEMPLATE,B.HTML]),br=new Set([B.TBODY,B.TFOOT,B.THEAD,B.TEMPLATE,B.HTML]),xr=new Set([B.TABLE,B.TEMPLATE,B.HTML]),Sr=new Set([B.TD,B.TH]),Cr=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=B.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===B.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===R.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==R.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(er,R.HTML)}popUntilTableCellPopped(){this.popUntilPopped(Sr,R.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(xr,R.HTML)}clearBackToTableBodyContext(){this.clearBackTo(br,R.HTML)}clearBackToTableRowContext(){this.clearBackTo(yr,R.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===B.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===B.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case R.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case R.SVG:if(vr.has(r))return!1;break;case R.MATHML:if(_r.has(r))return!1;break}}return!0}hasInScope(e){return this.hasInDynamicScope(e,mr)}hasInListItemScope(e){return this.hasInDynamicScope(e,hr)}hasInButtonScope(e){return this.hasInDynamicScope(e,gr)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case R.HTML:if(er.has(t))return!0;if(mr.has(t))return!1;break;case R.SVG:if(vr.has(t))return!1;break;case R.MATHML:if(_r.has(t))return!1;break}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===R.HTML)switch(this.tagIDs[t]){case e:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===R.HTML)switch(this.tagIDs[e]){case B.TBODY:case B.THEAD:case B.TFOOT:return!0;case B.TABLE:case B.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===R.HTML)switch(this.tagIDs[t]){case e:return!0;case B.OPTION:case B.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&fr.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&pr.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&pr.has(this.currentTagId);)this.pop()}},wr=3,Tr;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(Tr||={});var Er={type:Tr.Marker},Dr=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===Tr.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<wr)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<wr)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=wr&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(Er)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:Tr.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:Tr.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(Er);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===Tr.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===Tr.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===Tr.Element&&t.element===e)}},Or={createDocument(){return{nodeName:`#document`,mode:Xn.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){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};Or.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(Or.isTextNode(n)){n.value+=t;return}}Or.appendChild(e,Or.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Or.isTextNode(r)?r.value+=t:Or.insertBefore(e,Or.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},kr=`html`,Ar=`about:legacy-compat`,jr=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,Mr=`+//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//`.split(`,`),Nr=[...Mr,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],Pr=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),Fr=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],Ir=[...Fr,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function Lr(e,t){return t.some(t=>e.startsWith(t))}function Rr(e){return e.name===kr&&e.publicId===null&&(e.systemId===null||e.systemId===Ar)}function zr(e){if(e.name!==kr)return Xn.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===jr)return Xn.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),Pr.has(n))return Xn.QUIRKS;let e=t===null?Nr:Mr;if(Lr(n,e))return Xn.QUIRKS;if(e=t===null?Fr:Ir,Lr(n,e))return Xn.LIMITED_QUIRKS}return Xn.NO_QUIRKS}var Br={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},Vr=`definitionurl`,Hr=`definitionURL`,Ur=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`.split(`.`).map(e=>[e.toLowerCase(),e])),Wr=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:R.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:R.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:R.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:R.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:R.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:R.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:R.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:R.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:R.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:R.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:R.XMLNS}]]),Gr=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`.split(`.`).map(e=>[e.toLowerCase(),e])),Kr=new Set([B.B,B.BIG,B.BLOCKQUOTE,B.BODY,B.BR,B.CENTER,B.CODE,B.DD,B.DIV,B.DL,B.DT,B.EM,B.EMBED,B.H1,B.H2,B.H3,B.H4,B.H5,B.H6,B.HEAD,B.HR,B.I,B.IMG,B.LI,B.LISTING,B.MENU,B.META,B.NOBR,B.OL,B.P,B.PRE,B.RUBY,B.S,B.SMALL,B.SPAN,B.STRONG,B.STRIKE,B.SUB,B.SUP,B.TABLE,B.TT,B.U,B.UL,B.VAR]);function qr(e){let t=e.tagID;return t===B.FONT&&e.attrs.some(({name:e})=>e===Yn.COLOR||e===Yn.SIZE||e===Yn.FACE)||Kr.has(t)}function Jr(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===Vr){e.attrs[t].name=Hr;break}}function Yr(e){for(let t=0;t<e.attrs.length;t++){let n=Ur.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Xr(e){for(let t=0;t<e.attrs.length;t++){let n=Wr.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 Zr(e){let t=Gr.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Qn(e.tagName))}function Qr(e,t){return t===R.MATHML&&(e===B.MI||e===B.MO||e===B.MN||e===B.MS||e===B.MTEXT)}function $r(e,t,n){if(t===R.MATHML&&e===B.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===Yn.ENCODING){let t=n[e].value.toLowerCase();return t===Br.TEXT_HTML||t===Br.APPLICATION_XML}}return t===R.SVG&&(e===B.FOREIGN_OBJECT||e===B.DESC||e===B.TITLE)}function ei(e,t,n,r){return(!r||r===R.HTML)&&$r(e,t,n)||(!r||r===R.MATHML)&&Qr(e,t)}var ti=`hidden`,ni=8,ri=3,U;(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`})(U||={});var ii={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},ai=new Set([B.TABLE,B.TBODY,B.TFOOT,B.THEAD,B.TR]),oi={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Or,onParseError:null},si=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=U.INITIAL,this.originalInsertionMode=U.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={...oi,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new dr(this.options,this),this.activeFormattingElements=new Dr(this.treeAdapter),this.fragmentContextID=n?Qn(this.treeAdapter.getTagName(n)):B.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new Cr(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...oi,...t};e??=n.treeAdapter.createElement(z.TEMPLATE,R.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,R.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===B.TEMPLATE&&i.tmplInsertionModeStack.unshift(U.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??ii,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===R.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,R.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=U.TEXT}switchToPlaintextParsing(){this.insertionMode=U.TEXT,this.originalInsertionMode=U.IN_BODY,this.tokenizer.state=tr.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===z.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==R.HTML))switch(this.fragmentContextID){case B.TITLE:case B.TEXTAREA:this.tokenizer.state=tr.RCDATA;break;case B.STYLE:case B.XMP:case B.IFRAME:case B.NOEMBED:case B.NOFRAMES:case B.NOSCRIPT:this.tokenizer.state=tr.RAWTEXT;break;case B.SCRIPT:this.tokenizer.state=tr.SCRIPT_DATA;break;case B.PLAINTEXT:this.tokenizer.state=tr.PLAINTEXT;break;default:}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,R.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,R.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(z.HTML,R.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,B.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===L.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===B.SVG&&this.treeAdapter.getTagName(t)===z.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===R.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===B.MGLYPH||e.tagID===B.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,R.HTML)}_processToken(e){switch(e.type){case L.CHARACTER:this.onCharacter(e);break;case L.NULL_CHARACTER:this.onNullCharacter(e);break;case L.COMMENT:this.onComment(e);break;case L.DOCTYPE:this.onDoctype(e);break;case L.START_TAG:this._processStartTag(e);break;case L.END_TAG:this.onEndTag(e);break;case L.EOF:this.onEof(e);break;case L.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e);break}}_isIntegrationPoint(e,t,n){return ei(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===Tr.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=U.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(B.P),this.openElements.popUntilTagNamePopped(B.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case B.TR:this.insertionMode=U.IN_ROW;return;case B.TBODY:case B.THEAD:case B.TFOOT:this.insertionMode=U.IN_TABLE_BODY;return;case B.CAPTION:this.insertionMode=U.IN_CAPTION;return;case B.COLGROUP:this.insertionMode=U.IN_COLUMN_GROUP;return;case B.TABLE:this.insertionMode=U.IN_TABLE;return;case B.BODY:this.insertionMode=U.IN_BODY;return;case B.FRAMESET:this.insertionMode=U.IN_FRAMESET;return;case B.SELECT:this._resetInsertionModeForSelect(e);return;case B.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case B.HTML:this.insertionMode=this.headElement?U.AFTER_HEAD:U.BEFORE_HEAD;return;case B.TD:case B.TH:if(e>0){this.insertionMode=U.IN_CELL;return}break;case B.HEAD:if(e>0){this.insertionMode=U.IN_HEAD;return}break}this.insertionMode=U.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===B.TEMPLATE)break;if(e===B.TABLE){this.insertionMode=U.IN_SELECT_IN_TABLE;return}}this.insertionMode=U.IN_SELECT}_isElementCausesFosterParenting(e){return ai.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case B.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===R.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case B.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}default:}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return $n[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Eo(this,e);return}switch(this.insertionMode){case U.INITIAL:bi(this,e);break;case U.BEFORE_HTML:Ci(this,e);break;case U.BEFORE_HEAD:Ei(this,e);break;case U.IN_HEAD:Ai(this,e);break;case U.IN_HEAD_NO_SCRIPT:Ni(this,e);break;case U.AFTER_HEAD:Ii(this,e);break;case U.IN_BODY:case U.IN_CAPTION:case U.IN_CELL:case U.IN_TEMPLATE:zi(this,e);break;case U.TEXT:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:Pa(this,e);break;case U.IN_TABLE_TEXT:qa(this,e);break;case U.IN_COLUMN_GROUP:eo(this,e);break;case U.AFTER_BODY:_o(this,e);break;case U.AFTER_AFTER_BODY:Co(this,e);break;default:}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){To(this,e);return}switch(this.insertionMode){case U.INITIAL:bi(this,e);break;case U.BEFORE_HTML:Ci(this,e);break;case U.BEFORE_HEAD:Ei(this,e);break;case U.IN_HEAD:Ai(this,e);break;case U.IN_HEAD_NO_SCRIPT:Ni(this,e);break;case U.AFTER_HEAD:Ii(this,e);break;case U.TEXT:this._insertCharacters(e);break;case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:Pa(this,e);break;case U.IN_COLUMN_GROUP:eo(this,e);break;case U.AFTER_BODY:_o(this,e);break;case U.AFTER_AFTER_BODY:Co(this,e);break;default:}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){hi(this,e);return}switch(this.insertionMode){case U.INITIAL:case U.BEFORE_HTML:case U.BEFORE_HEAD:case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:case U.IN_BODY:case U.IN_TABLE:case U.IN_CAPTION:case U.IN_COLUMN_GROUP:case U.IN_TABLE_BODY:case U.IN_ROW:case U.IN_CELL:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:case U.IN_TEMPLATE:case U.IN_FRAMESET:case U.AFTER_FRAMESET:hi(this,e);break;case U.IN_TABLE_TEXT:Ja(this,e);break;case U.AFTER_BODY:gi(this,e);break;case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:_i(this,e);break;default:}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case U.INITIAL:yi(this,e);break;case U.BEFORE_HEAD:case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:this._err(e,I.misplacedDoctype);break;case U.IN_TABLE_TEXT:Ja(this,e);break;default:}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,I.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?Oo(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case U.INITIAL:bi(this,e);break;case U.BEFORE_HTML:xi(this,e);break;case U.BEFORE_HEAD:wi(this,e);break;case U.IN_HEAD:Di(this,e);break;case U.IN_HEAD_NO_SCRIPT:ji(this,e);break;case U.AFTER_HEAD:Pi(this,e);break;case U.IN_BODY:va(this,e);break;case U.IN_TABLE:Ua(this,e);break;case U.IN_TABLE_TEXT:Ja(this,e);break;case U.IN_CAPTION:Xa(this,e);break;case U.IN_COLUMN_GROUP:Qa(this,e);break;case U.IN_TABLE_BODY:to(this,e);break;case U.IN_ROW:ro(this,e);break;case U.IN_CELL:ao(this,e);break;case U.IN_SELECT:so(this,e);break;case U.IN_SELECT_IN_TABLE:lo(this,e);break;case U.IN_TEMPLATE:fo(this,e);break;case U.AFTER_BODY:ho(this,e);break;case U.IN_FRAMESET:vo(this,e);break;case U.AFTER_FRAMESET:bo(this,e);break;case U.AFTER_AFTER_BODY:So(this,e);break;case U.AFTER_AFTER_FRAMESET:wo(this,e);break;default:}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?ko(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case U.INITIAL:bi(this,e);break;case U.BEFORE_HTML:Si(this,e);break;case U.BEFORE_HEAD:Ti(this,e);break;case U.IN_HEAD:Oi(this,e);break;case U.IN_HEAD_NO_SCRIPT:Mi(this,e);break;case U.AFTER_HEAD:Fi(this,e);break;case U.IN_BODY:Aa(this,e);break;case U.TEXT:Ma(this,e);break;case U.IN_TABLE:Wa(this,e);break;case U.IN_TABLE_TEXT:Ja(this,e);break;case U.IN_CAPTION:Za(this,e);break;case U.IN_COLUMN_GROUP:$a(this,e);break;case U.IN_TABLE_BODY:no(this,e);break;case U.IN_ROW:io(this,e);break;case U.IN_CELL:oo(this,e);break;case U.IN_SELECT:co(this,e);break;case U.IN_SELECT_IN_TABLE:uo(this,e);break;case U.IN_TEMPLATE:po(this,e);break;case U.AFTER_BODY:go(this,e);break;case U.IN_FRAMESET:yo(this,e);break;case U.AFTER_FRAMESET:xo(this,e);break;case U.AFTER_AFTER_BODY:Co(this,e);break;default:}}onEof(e){switch(this.insertionMode){case U.INITIAL:bi(this,e);break;case U.BEFORE_HTML:Ci(this,e);break;case U.BEFORE_HEAD:Ei(this,e);break;case U.IN_HEAD:Ai(this,e);break;case U.IN_HEAD_NO_SCRIPT:Ni(this,e);break;case U.AFTER_HEAD:Ii(this,e);break;case U.IN_BODY:case U.IN_TABLE:case U.IN_CAPTION:case U.IN_COLUMN_GROUP:case U.IN_TABLE_BODY:case U.IN_ROW:case U.IN_CELL:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:ja(this,e);break;case U.TEXT:Na(this,e);break;case U.IN_TABLE_TEXT:Ja(this,e);break;case U.IN_TEMPLATE:mo(this,e);break;case U.AFTER_BODY:case U.IN_FRAMESET:case U.AFTER_FRAMESET:case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:vi(this,e);break;default:}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===F.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case U.IN_HEAD:case U.IN_HEAD_NO_SCRIPT:case U.AFTER_HEAD:case U.TEXT:case U.IN_COLUMN_GROUP:case U.IN_SELECT:case U.IN_SELECT_IN_TABLE:case U.IN_FRAMESET:case U.AFTER_FRAMESET:this._insertCharacters(e);break;case U.IN_BODY:case U.IN_CAPTION:case U.IN_CELL:case U.IN_TEMPLATE:case U.AFTER_BODY:case U.AFTER_AFTER_BODY:case U.AFTER_AFTER_FRAMESET:Ri(this,e);break;case U.IN_TABLE:case U.IN_TABLE_BODY:case U.IN_ROW:Pa(this,e);break;case U.IN_TABLE_TEXT:Ka(this,e);break;default:}}};function ci(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):ka(e,t),n}function li(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function ui(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=ri;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=di(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function di(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function fi(e,t,n){let r=Qn(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===B.TEMPLATE&&i===R.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function pi(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function mi(e,t){for(let n=0;n<ni;n++){let n=ci(e,t);if(!n)break;let r=li(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=ui(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&fi(e,a,i),pi(e,r,n)}}function hi(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function gi(e,t){e._appendCommentNode(t,e.openElements.items[0])}function _i(e,t){e._appendCommentNode(t,e.document)}function vi(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function yi(e,t){e._setDocumentType(t);let n=t.forceQuirks?Xn.QUIRKS:zr(t);Rr(t)||e._err(t,I.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=U.BEFORE_HTML}function bi(e,t){e._err(t,I.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Xn.QUIRKS),e.insertionMode=U.BEFORE_HTML,e._processToken(t)}function xi(e,t){t.tagID===B.HTML?(e._insertElement(t,R.HTML),e.insertionMode=U.BEFORE_HEAD):Ci(e,t)}function Si(e,t){let n=t.tagID;(n===B.HTML||n===B.HEAD||n===B.BODY||n===B.BR)&&Ci(e,t)}function Ci(e,t){e._insertFakeRootElement(),e.insertionMode=U.BEFORE_HEAD,e._processToken(t)}function wi(e,t){switch(t.tagID){case B.HTML:va(e,t);break;case B.HEAD:e._insertElement(t,R.HTML),e.headElement=e.openElements.current,e.insertionMode=U.IN_HEAD;break;default:Ei(e,t)}}function Ti(e,t){let n=t.tagID;n===B.HEAD||n===B.BODY||n===B.HTML||n===B.BR?Ei(e,t):e._err(t,I.endTagWithoutMatchingOpenElement)}function Ei(e,t){e._insertFakeElement(z.HEAD,B.HEAD),e.headElement=e.openElements.current,e.insertionMode=U.IN_HEAD,e._processToken(t)}function Di(e,t){switch(t.tagID){case B.HTML:va(e,t);break;case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:e._appendElement(t,R.HTML),t.ackSelfClosing=!0;break;case B.TITLE:e._switchToTextParsing(t,tr.RCDATA);break;case B.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,tr.RAWTEXT):(e._insertElement(t,R.HTML),e.insertionMode=U.IN_HEAD_NO_SCRIPT);break;case B.NOFRAMES:case B.STYLE:e._switchToTextParsing(t,tr.RAWTEXT);break;case B.SCRIPT:e._switchToTextParsing(t,tr.SCRIPT_DATA);break;case B.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=U.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(U.IN_TEMPLATE);break;case B.HEAD:e._err(t,I.misplacedStartTagForHeadElement);break;default:Ai(e,t)}}function Oi(e,t){switch(t.tagID){case B.HEAD:e.openElements.pop(),e.insertionMode=U.AFTER_HEAD;break;case B.BODY:case B.BR:case B.HTML:Ai(e,t);break;case B.TEMPLATE:ki(e,t);break;default:e._err(t,I.endTagWithoutMatchingOpenElement)}}function ki(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==B.TEMPLATE&&e._err(t,I.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,I.endTagWithoutMatchingOpenElement)}function Ai(e,t){e.openElements.pop(),e.insertionMode=U.AFTER_HEAD,e._processToken(t)}function ji(e,t){switch(t.tagID){case B.HTML:va(e,t);break;case B.BASEFONT:case B.BGSOUND:case B.HEAD:case B.LINK:case B.META:case B.NOFRAMES:case B.STYLE:Di(e,t);break;case B.NOSCRIPT:e._err(t,I.nestedNoscriptInHead);break;default:Ni(e,t)}}function Mi(e,t){switch(t.tagID){case B.NOSCRIPT:e.openElements.pop(),e.insertionMode=U.IN_HEAD;break;case B.BR:Ni(e,t);break;default:e._err(t,I.endTagWithoutMatchingOpenElement)}}function Ni(e,t){let n=t.type===L.EOF?I.openElementsLeftAfterEof:I.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=U.IN_HEAD,e._processToken(t)}function Pi(e,t){switch(t.tagID){case B.HTML:va(e,t);break;case B.BODY:e._insertElement(t,R.HTML),e.framesetOk=!1,e.insertionMode=U.IN_BODY;break;case B.FRAMESET:e._insertElement(t,R.HTML),e.insertionMode=U.IN_FRAMESET;break;case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:e._err(t,I.abandonedHeadElementChild),e.openElements.push(e.headElement,B.HEAD),Di(e,t),e.openElements.remove(e.headElement);break;case B.HEAD:e._err(t,I.misplacedStartTagForHeadElement);break;default:Ii(e,t)}}function Fi(e,t){switch(t.tagID){case B.BODY:case B.HTML:case B.BR:Ii(e,t);break;case B.TEMPLATE:ki(e,t);break;default:e._err(t,I.endTagWithoutMatchingOpenElement)}}function Ii(e,t){e._insertFakeElement(z.BODY,B.BODY),e.insertionMode=U.IN_BODY,Li(e,t)}function Li(e,t){switch(t.type){case L.CHARACTER:zi(e,t);break;case L.WHITESPACE_CHARACTER:Ri(e,t);break;case L.COMMENT:hi(e,t);break;case L.START_TAG:va(e,t);break;case L.END_TAG:Aa(e,t);break;case L.EOF:ja(e,t);break;default:}}function Ri(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function zi(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Bi(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function Vi(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function Hi(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,R.HTML),e.insertionMode=U.IN_FRAMESET)}function Ui(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,R.HTML)}function Wi(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&er.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,R.HTML)}function Gi(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,R.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Ki(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,R.HTML),n||(e.formElement=e.openElements.current))}function qi(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===B.LI&&r===B.LI||(n===B.DD||n===B.DT)&&(r===B.DD||r===B.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==B.ADDRESS&&r!==B.DIV&&r!==B.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,R.HTML)}function Ji(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,R.HTML),e.tokenizer.state=tr.PLAINTEXT}function Yi(e,t){e.openElements.hasInScope(B.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(B.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,R.HTML),e.framesetOk=!1}function Xi(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(z.A);n&&(mi(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,R.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Zi(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,R.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Qi(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(B.NOBR)&&(mi(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,R.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function $i(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,R.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function ea(e,t){e.treeAdapter.getDocumentMode(e.document)!==Xn.QUIRKS&&e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._insertElement(t,R.HTML),e.framesetOk=!1,e.insertionMode=U.IN_TABLE}function ta(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,R.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function na(e){let t=Pn(e,Yn.TYPE);return t!=null&&t.toLowerCase()===ti}function ra(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,R.HTML),na(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function ia(e,t){e._appendElement(t,R.HTML),t.ackSelfClosing=!0}function aa(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._appendElement(t,R.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function oa(e,t){t.tagName=z.IMG,t.tagID=B.IMG,ta(e,t)}function sa(e,t){e._insertElement(t,R.HTML),e.skipNextNewLine=!0,e.tokenizer.state=tr.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=U.TEXT}function ca(e,t){e.openElements.hasInButtonScope(B.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,tr.RAWTEXT)}function la(e,t){e.framesetOk=!1,e._switchToTextParsing(t,tr.RAWTEXT)}function ua(e,t){e._switchToTextParsing(t,tr.RAWTEXT)}function da(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,R.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===U.IN_TABLE||e.insertionMode===U.IN_CAPTION||e.insertionMode===U.IN_TABLE_BODY||e.insertionMode===U.IN_ROW||e.insertionMode===U.IN_CELL?U.IN_SELECT_IN_TABLE:U.IN_SELECT}function fa(e,t){e.openElements.currentTagId===B.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,R.HTML)}function pa(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,R.HTML)}function ma(e,t){e.openElements.hasInScope(B.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(B.RTC),e._insertElement(t,R.HTML)}function ha(e,t){e._reconstructActiveFormattingElements(),Jr(t),Xr(t),t.selfClosing?e._appendElement(t,R.MATHML):e._insertElement(t,R.MATHML),t.ackSelfClosing=!0}function ga(e,t){e._reconstructActiveFormattingElements(),Yr(t),Xr(t),t.selfClosing?e._appendElement(t,R.SVG):e._insertElement(t,R.SVG),t.ackSelfClosing=!0}function _a(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,R.HTML)}function va(e,t){switch(t.tagID){case B.I:case B.S:case B.B:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.SMALL:case B.STRIKE:case B.STRONG:Zi(e,t);break;case B.A:Xi(e,t);break;case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:Wi(e,t);break;case B.P:case B.DL:case B.OL:case B.UL:case B.DIV:case B.DIR:case B.NAV:case B.MAIN:case B.MENU:case B.ASIDE:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.DETAILS:case B.ADDRESS:case B.ARTICLE:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:Ui(e,t);break;case B.LI:case B.DD:case B.DT:qi(e,t);break;case B.BR:case B.IMG:case B.WBR:case B.AREA:case B.EMBED:case B.KEYGEN:ta(e,t);break;case B.HR:aa(e,t);break;case B.RB:case B.RTC:pa(e,t);break;case B.RT:case B.RP:ma(e,t);break;case B.PRE:case B.LISTING:Gi(e,t);break;case B.XMP:ca(e,t);break;case B.SVG:ga(e,t);break;case B.HTML:Bi(e,t);break;case B.BASE:case B.LINK:case B.META:case B.STYLE:case B.TITLE:case B.SCRIPT:case B.BGSOUND:case B.BASEFONT:case B.TEMPLATE:Di(e,t);break;case B.BODY:Vi(e,t);break;case B.FORM:Ki(e,t);break;case B.NOBR:Qi(e,t);break;case B.MATH:ha(e,t);break;case B.TABLE:ea(e,t);break;case B.INPUT:ra(e,t);break;case B.PARAM:case B.TRACK:case B.SOURCE:ia(e,t);break;case B.IMAGE:oa(e,t);break;case B.BUTTON:Yi(e,t);break;case B.APPLET:case B.OBJECT:case B.MARQUEE:$i(e,t);break;case B.IFRAME:la(e,t);break;case B.SELECT:da(e,t);break;case B.OPTION:case B.OPTGROUP:fa(e,t);break;case B.NOEMBED:case B.NOFRAMES:ua(e,t);break;case B.FRAMESET:Hi(e,t);break;case B.TEXTAREA:sa(e,t);break;case B.NOSCRIPT:e.options.scriptingEnabled?ua(e,t):_a(e,t);break;case B.PLAINTEXT:Ji(e,t);break;case B.COL:case B.TH:case B.TD:case B.TR:case B.HEAD:case B.FRAME:case B.TBODY:case B.TFOOT:case B.THEAD:case B.CAPTION:case B.COLGROUP:break;default:_a(e,t)}}function ya(e,t){if(e.openElements.hasInScope(B.BODY)&&(e.insertionMode=U.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function ba(e,t){e.openElements.hasInScope(B.BODY)&&(e.insertionMode=U.AFTER_BODY,go(e,t))}function xa(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function Sa(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(B.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(B.FORM):n&&e.openElements.remove(n))}function Ca(e){e.openElements.hasInButtonScope(B.P)||e._insertFakeElement(z.P,B.P),e._closePElement()}function wa(e){e.openElements.hasInListItemScope(B.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(B.LI),e.openElements.popUntilTagNamePopped(B.LI))}function Ta(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Ea(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function Da(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function Oa(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(z.BR,B.BR),e.openElements.pop(),e.framesetOk=!1}function ka(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==B.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function Aa(e,t){switch(t.tagID){case B.A:case B.B:case B.I:case B.S:case B.U:case B.EM:case B.TT:case B.BIG:case B.CODE:case B.FONT:case B.NOBR:case B.SMALL:case B.STRIKE:case B.STRONG:mi(e,t);break;case B.P:Ca(e);break;case B.DL:case B.UL:case B.OL:case B.DIR:case B.DIV:case B.NAV:case B.PRE:case B.MAIN:case B.MENU:case B.ASIDE:case B.BUTTON:case B.CENTER:case B.FIGURE:case B.FOOTER:case B.HEADER:case B.HGROUP:case B.DIALOG:case B.ADDRESS:case B.ARTICLE:case B.DETAILS:case B.SEARCH:case B.SECTION:case B.SUMMARY:case B.LISTING:case B.FIELDSET:case B.BLOCKQUOTE:case B.FIGCAPTION:xa(e,t);break;case B.LI:wa(e);break;case B.DD:case B.DT:Ta(e,t);break;case B.H1:case B.H2:case B.H3:case B.H4:case B.H5:case B.H6:Ea(e);break;case B.BR:Oa(e);break;case B.BODY:ya(e,t);break;case B.HTML:ba(e,t);break;case B.FORM:Sa(e);break;case B.APPLET:case B.OBJECT:case B.MARQUEE:Da(e,t);break;case B.TEMPLATE:ki(e,t);break;default:ka(e,t)}}function ja(e,t){e.tmplInsertionModeStack.length>0?mo(e,t):vi(e,t)}function Ma(e,t){var n;t.tagID===B.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function Na(e,t){e._err(t,I.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Pa(e,t){if(e.openElements.currentTagId!==void 0&&ai.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=U.IN_TABLE_TEXT,t.type){case L.CHARACTER:qa(e,t);break;case L.WHITESPACE_CHARACTER:Ka(e,t);break}else Ga(e,t)}function Fa(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,R.HTML),e.insertionMode=U.IN_CAPTION}function Ia(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,R.HTML),e.insertionMode=U.IN_COLUMN_GROUP}function La(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(z.COLGROUP,B.COLGROUP),e.insertionMode=U.IN_COLUMN_GROUP,Qa(e,t)}function Ra(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,R.HTML),e.insertionMode=U.IN_TABLE_BODY}function za(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(z.TBODY,B.TBODY),e.insertionMode=U.IN_TABLE_BODY,to(e,t)}function Ba(e,t){e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function Va(e,t){na(t)?e._appendElement(t,R.HTML):Ga(e,t),t.ackSelfClosing=!0}function Ha(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,R.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function Ua(e,t){switch(t.tagID){case B.TD:case B.TH:case B.TR:za(e,t);break;case B.STYLE:case B.SCRIPT:case B.TEMPLATE:Di(e,t);break;case B.COL:La(e,t);break;case B.FORM:Ha(e,t);break;case B.TABLE:Ba(e,t);break;case B.TBODY:case B.TFOOT:case B.THEAD:Ra(e,t);break;case B.INPUT:Va(e,t);break;case B.CAPTION:Fa(e,t);break;case B.COLGROUP:Ia(e,t);break;default:Ga(e,t)}}function Wa(e,t){switch(t.tagID){case B.TABLE:e.openElements.hasInTableScope(B.TABLE)&&(e.openElements.popUntilTagNamePopped(B.TABLE),e._resetInsertionMode());break;case B.TEMPLATE:ki(e,t);break;case B.BODY:case B.CAPTION:case B.COL:case B.COLGROUP:case B.HTML:case B.TBODY:case B.TD:case B.TFOOT:case B.TH:case B.THEAD:case B.TR:break;default:Ga(e,t)}}function Ga(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Li(e,t),e.fosterParentingEnabled=n}function Ka(e,t){e.pendingCharacterTokens.push(t)}function qa(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Ja(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)Ga(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var Ya=new Set([B.CAPTION,B.COL,B.COLGROUP,B.TBODY,B.TD,B.TFOOT,B.TH,B.THEAD,B.TR]);function Xa(e,t){let n=t.tagID;Ya.has(n)?e.openElements.hasInTableScope(B.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(B.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_TABLE,Ua(e,t)):va(e,t)}function Za(e,t){let n=t.tagID;switch(n){case B.CAPTION:case B.TABLE:e.openElements.hasInTableScope(B.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(B.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_TABLE,n===B.TABLE&&Wa(e,t));break;case B.BODY:case B.COL:case B.COLGROUP:case B.HTML:case B.TBODY:case B.TD:case B.TFOOT:case B.TH:case B.THEAD:case B.TR:break;default:Aa(e,t)}}function Qa(e,t){switch(t.tagID){case B.HTML:va(e,t);break;case B.COL:e._appendElement(t,R.HTML),t.ackSelfClosing=!0;break;case B.TEMPLATE:Di(e,t);break;default:eo(e,t)}}function $a(e,t){switch(t.tagID){case B.COLGROUP:e.openElements.currentTagId===B.COLGROUP&&(e.openElements.pop(),e.insertionMode=U.IN_TABLE);break;case B.TEMPLATE:ki(e,t);break;case B.COL:break;default:eo(e,t)}}function eo(e,t){e.openElements.currentTagId===B.COLGROUP&&(e.openElements.pop(),e.insertionMode=U.IN_TABLE,e._processToken(t))}function to(e,t){switch(t.tagID){case B.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,R.HTML),e.insertionMode=U.IN_ROW;break;case B.TH:case B.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(z.TR,B.TR),e.insertionMode=U.IN_ROW,ro(e,t);break;case B.CAPTION:case B.COL:case B.COLGROUP:case B.TBODY:case B.TFOOT:case B.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE,Ua(e,t));break;default:Ua(e,t)}}function no(e,t){let n=t.tagID;switch(t.tagID){case B.TBODY:case B.TFOOT:case B.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE);break;case B.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE,Wa(e,t));break;case B.BODY:case B.CAPTION:case B.COL:case B.COLGROUP:case B.HTML:case B.TD:case B.TH:case B.TR:break;default:Wa(e,t)}}function ro(e,t){switch(t.tagID){case B.TH:case B.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,R.HTML),e.insertionMode=U.IN_CELL,e.activeFormattingElements.insertMarker();break;case B.CAPTION:case B.COL:case B.COLGROUP:case B.TBODY:case B.TFOOT:case B.THEAD:case B.TR:e.openElements.hasInTableScope(B.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,to(e,t));break;default:Ua(e,t)}}function io(e,t){switch(t.tagID){case B.TR:e.openElements.hasInTableScope(B.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY);break;case B.TABLE:e.openElements.hasInTableScope(B.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,no(e,t));break;case B.TBODY:case B.TFOOT:case B.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(B.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=U.IN_TABLE_BODY,no(e,t));break;case B.BODY:case B.CAPTION:case B.COL:case B.COLGROUP:case B.HTML:case B.TD:case B.TH:break;default:Wa(e,t)}}function ao(e,t){let n=t.tagID;Ya.has(n)?(e.openElements.hasInTableScope(B.TD)||e.openElements.hasInTableScope(B.TH))&&(e._closeTableCell(),ro(e,t)):va(e,t)}function oo(e,t){let n=t.tagID;switch(n){case B.TD:case B.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=U.IN_ROW);break;case B.TABLE:case B.TBODY:case B.TFOOT:case B.THEAD:case B.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),io(e,t));break;case B.BODY:case B.CAPTION:case B.COL:case B.COLGROUP:case B.HTML:break;default:Aa(e,t)}}function so(e,t){switch(t.tagID){case B.HTML:va(e,t);break;case B.OPTION:e.openElements.currentTagId===B.OPTION&&e.openElements.pop(),e._insertElement(t,R.HTML);break;case B.OPTGROUP:e.openElements.currentTagId===B.OPTION&&e.openElements.pop(),e.openElements.currentTagId===B.OPTGROUP&&e.openElements.pop(),e._insertElement(t,R.HTML);break;case B.HR:e.openElements.currentTagId===B.OPTION&&e.openElements.pop(),e.openElements.currentTagId===B.OPTGROUP&&e.openElements.pop(),e._appendElement(t,R.HTML),t.ackSelfClosing=!0;break;case B.INPUT:case B.KEYGEN:case B.TEXTAREA:case B.SELECT:e.openElements.hasInSelectScope(B.SELECT)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),t.tagID!==B.SELECT&&e._processStartTag(t));break;case B.SCRIPT:case B.TEMPLATE:Di(e,t);break;default:}}function co(e,t){switch(t.tagID){case B.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===B.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===B.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===B.OPTGROUP&&e.openElements.pop();break;case B.OPTION:e.openElements.currentTagId===B.OPTION&&e.openElements.pop();break;case B.SELECT:e.openElements.hasInSelectScope(B.SELECT)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode());break;case B.TEMPLATE:ki(e,t);break;default:}}function lo(e,t){let n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e._processStartTag(t)):so(e,t)}function uo(e,t){let n=t.tagID;n===B.CAPTION||n===B.TABLE||n===B.TBODY||n===B.TFOOT||n===B.THEAD||n===B.TR||n===B.TD||n===B.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(B.SELECT),e._resetInsertionMode(),e.onEndTag(t)):co(e,t)}function fo(e,t){switch(t.tagID){case B.BASE:case B.BASEFONT:case B.BGSOUND:case B.LINK:case B.META:case B.NOFRAMES:case B.SCRIPT:case B.STYLE:case B.TEMPLATE:case B.TITLE:Di(e,t);break;case B.CAPTION:case B.COLGROUP:case B.TBODY:case B.TFOOT:case B.THEAD:e.tmplInsertionModeStack[0]=U.IN_TABLE,e.insertionMode=U.IN_TABLE,Ua(e,t);break;case B.COL:e.tmplInsertionModeStack[0]=U.IN_COLUMN_GROUP,e.insertionMode=U.IN_COLUMN_GROUP,Qa(e,t);break;case B.TR:e.tmplInsertionModeStack[0]=U.IN_TABLE_BODY,e.insertionMode=U.IN_TABLE_BODY,to(e,t);break;case B.TD:case B.TH:e.tmplInsertionModeStack[0]=U.IN_ROW,e.insertionMode=U.IN_ROW,ro(e,t);break;default:e.tmplInsertionModeStack[0]=U.IN_BODY,e.insertionMode=U.IN_BODY,va(e,t)}}function po(e,t){t.tagID===B.TEMPLATE&&ki(e,t)}function mo(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(B.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):vi(e,t)}function ho(e,t){t.tagID===B.HTML?va(e,t):_o(e,t)}function go(e,t){if(t.tagID===B.HTML){if(e.fragmentContext||(e.insertionMode=U.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===B.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else _o(e,t)}function _o(e,t){e.insertionMode=U.IN_BODY,Li(e,t)}function vo(e,t){switch(t.tagID){case B.HTML:va(e,t);break;case B.FRAMESET:e._insertElement(t,R.HTML);break;case B.FRAME:e._appendElement(t,R.HTML),t.ackSelfClosing=!0;break;case B.NOFRAMES:Di(e,t);break;default:}}function yo(e,t){t.tagID===B.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==B.FRAMESET&&(e.insertionMode=U.AFTER_FRAMESET))}function bo(e,t){switch(t.tagID){case B.HTML:va(e,t);break;case B.NOFRAMES:Di(e,t);break;default:}}function xo(e,t){t.tagID===B.HTML&&(e.insertionMode=U.AFTER_AFTER_FRAMESET)}function So(e,t){t.tagID===B.HTML?va(e,t):Co(e,t)}function Co(e,t){e.insertionMode=U.IN_BODY,Li(e,t)}function wo(e,t){switch(t.tagID){case B.HTML:va(e,t);break;case B.NOFRAMES:Di(e,t);break;default:}}function To(e,t){t.chars=`�`,e._insertCharacters(t)}function Eo(e,t){e._insertCharacters(t),e.framesetOk=!1}function Do(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==R.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Oo(e,t){if(qr(t))Do(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===R.MATHML?Jr(t):r===R.SVG&&(Zr(t),Yr(t)),Xr(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function ko(e,t){if(t.tagID===B.P||t.tagID===B.BR){Do(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===R.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}new Set([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]);var Ao=Mo(`end`),jo=Mo(`start`);function Mo(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function No(e){let t=jo(e),n=Ao(e);if(t&&n)return{start:t,end:n}}var Po=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Fo=new Set([`mdxFlowExpression`,`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxTextExpression`,`mdxjsEsm`]),Io={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Lo(e,t){let n=Zo(e),r=un(`type`,{handlers:{root:zo,element:Bo,text:Vo,comment:Wo,doctype:Ho,raw:Go},unknown:Ko}),i={parser:n?new si(Io):si.getFragmentParser(void 0,Io),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),qo(i,jo());let a=en(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&Ae(a,`comment`,function(e,t,n){let r=e;if(r.value.stitch&&n&&t!==void 0){let e=n.children;return e[t]=r.value.stitch,t}}),a.type===`root`&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function Ro(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function zo(e,t){Ro(e.children,t)}function Bo(e,t){Yo(e,t),Ro(e.children,t),Xo(e,t)}function Vo(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);let n={type:L.CHARACTER,chars:e.value,location:Qo(e)};qo(t,jo(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Ho(e,t){let n={type:L.DOCTYPE,name:`html`,forceQuirks:!1,publicId:``,systemId:``,location:Qo(e)};qo(t,jo(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Uo(e,t){t.stitches=!0;let n=$o(e);`children`in e&&`children`in n&&(n.children=Lo({type:`root`,children:e.children},t.options).children),Wo({type:`comment`,value:{stitch:n}},t)}function Wo(e,t){let n=e.value,r={type:L.COMMENT,data:n,location:Qo(e)};qo(t,jo(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function Go(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,Jo(t,jo(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Po,`<$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;let e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function Ko(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Uo(n,t);else{let e=``;throw Fo.has(n.type)&&(e=". 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"),Error("Cannot compile `"+n.type+"` node"+e)}}function qo(e,t){Jo(e,t);let 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=tr.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 Jo(e,t){if(t&&t.offset!==void 0){let 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 Yo(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===tr.PLAINTEXT)return;qo(t,jo(e));let r=t.parser.openElements.current,i=`namespaceURI`in r?r.namespaceURI:Zt.html;i===Zt.html&&n===`svg`&&(i=Zt.svg);let a=mn({...e,children:[]},{space:i===Zt.svg?`svg`:`html`}),o={type:L.START_TAG,tagName:n,tagID:Qn(n),selfClosing:!1,ackSelfClosing:!1,attrs:`attrs`in a?a.attrs:[],location:Qo(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Xo(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&wn.includes(n)||t.parser.tokenizer.state===tr.PLAINTEXT)return;qo(t,Ao(e));let r={type:L.END_TAG,tagName:n,tagID:Qn(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Qo(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===tr.RCDATA||t.parser.tokenizer.state===tr.RAWTEXT||t.parser.tokenizer.state===tr.SCRIPT_DATA)&&(t.parser.tokenizer.state=tr.DATA)}function Zo(e){let t=e.type===`root`?e.children[0]:e;return!!(t&&(t.type===`doctype`||t.type===`element`&&t.tagName.toLowerCase()===`html`))}function Qo(e){let t=jo(e)||{line:void 0,column:void 0,offset:void 0},n=Ao(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 $o(e){return`children`in e?$e({...e,children:[]}):$e(e)}function es(e){return function(t,n){return Lo(t,{...e,file:n})}}var ts=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],ns={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...ts,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...ts],h2:[[`className`,`sr-only`]],img:[...ts,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...ts,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...ts],table:[...ts],ul:[...ts,[`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`.split(`.`)},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`.split(`.`)},rs={}.hasOwnProperty;function is(e,t){let n={type:`root`,children:[]},r=as({schema:t?{...ns,...t}:ns,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function as(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return os(e,n);case`doctype`:return ss(e,n);case`element`:return cs(e,n);case`root`:return ls(e,n);case`text`:return us(e,n);default:}}}function os(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return _s(r,t),r}}function ss(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return _s(e,t),e}}function cs(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=ds(e,t.children),i=fs(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&rs.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return _s(o,t),o}function ls(e,t){let n={type:`root`,children:ds(e,t.children)};return _s(n,t),n}function us(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return _s(n,t),n}function ds(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=as(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function fs(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&rs.call(r,n)?r[n]:void 0,o=r&&rs.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(rs.call(s,l)){let t=s[l],n=ps(e,vs(a,l),l,t);n??=ps(e,vs(o,l),l,t),n!=null&&(c[l]=n)}if(i&&rs.call(i,n)){let e=i[n];for(l in e)rs.call(e,l)&&!rs.call(c,l)&&(c[l]=e[l])}return c}function ps(e,t,n,r){return t?Array.isArray(r)?ms(e,t,n,r):hs(e,t,n,r):void 0}function ms(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=hs(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function hs(e,t,n,r){if(!(typeof r!=`boolean`&&typeof r!=`number`&&typeof r!=`string`)&&gs(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function gs(e,t,n){let r=e.schema.protocols&&rs.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function _s(e,t){let n=No(t);t.data&&(e.data=$e(t.data)),n&&(e.position=n)}function vs(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function ys(e){return function(t){return is(t,e)}}function bs(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var xs=js(/[A-Za-z]/),Ss=js(/[\dA-Za-z]/),Cs=js(/[#-'*+\--9=?A-Z^-~]/);function ws(e){return e!==null&&(e<32||e===127)}var Ts=js(/\d/),Es=js(/[\dA-Fa-f]/),Ds=js(/[!-/:-@[-`{-~]/);function W(e){return e!==null&&e<-2}function Os(e){return e!==null&&(e<0||e===32)}function G(e){return e===-2||e===-1||e===32}var ks=js(/\p{P}|\p{S}/u),As=js(/\s/);function js(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Ms(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Ns(e,t,n){let r=ve((n||{}).ignore||[]),i=Ps(t),a=-1;for(;++a<i.length;)Oe(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Ps(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Fs(e[0]),Is(e[1])])}return t}function Fs(e){return typeof e==`string`?new RegExp(Ms(e),`g`):e}function Is(e){return typeof e==`function`?e:function(){return e}}var Ls=`phrasing`,Rs=[`autolink`,`link`,`image`,`label`];function zs(){return{transforms:[qs],enter:{literalAutolink:Vs,literalAutolinkEmail:Hs,literalAutolinkHttp:Hs,literalAutolinkWww:Hs},exit:{literalAutolink:Ks,literalAutolinkEmail:Gs,literalAutolinkHttp:Us,literalAutolinkWww:Ws}}}function Bs(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Ls,notInConstruct:Rs},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Ls,notInConstruct:Rs},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Ls,notInConstruct:Rs}]}}function Vs(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Hs(e){this.config.enter.autolinkProtocol.call(this,e)}function Us(e){this.config.exit.autolinkProtocol.call(this,e)}function Ws(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Gs(e){this.config.exit.autolinkEmail.call(this,e)}function Ks(e){this.exit(e)}function qs(e){Ns(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Js],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Ys]],{ignore:[`link`,`linkReference`]})}function Js(e,t,n,r,i){let a=``;if(!Qs(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Xs(n)))return!1;let o=Zs(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Ys(e,t,n,r){return!Qs(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Xs(e){let 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 Zs(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=bs(e,`(`),a=bs(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function Qs(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||As(n)||ks(n))&&(!t||n!==47)}function $s(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}lc.peek=cc;function ec(){this.buffer()}function tc(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function nc(){this.buffer()}function rc(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function ic(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=$s(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ac(e){this.exit(e)}function oc(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=$s(this.sliceSerialize(e)).toLowerCase(),n.label=t}function sc(e){this.exit(e)}function cc(){return`[`}function lc(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function uc(){return{enter:{gfmFootnoteCallString:ec,gfmFootnoteCall:tc,gfmFootnoteDefinitionLabelString:nc,gfmFootnoteDefinition:rc},exit:{gfmFootnoteCallString:ic,gfmFootnoteCall:ac,gfmFootnoteDefinitionLabelString:oc,gfmFootnoteDefinition:sc}}}function dc(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:lc},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
4
4
|
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?pc:fc))),s(),o}}function fc(e,t,n){return t===0?e:pc(e,t,n)}function pc(e,t,n){return(n?``:` `)+e}var mc=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];yc.peek=bc;function hc(){return{canContainEols:[`delete`],enter:{strikethrough:_c},exit:{strikethrough:vc}}}function gc(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:mc}],handlers:{delete:yc}}}function _c(e){this.enter({type:`delete`,children:[]},e)}function vc(e){this.exit(e)}function yc(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function bc(){return`~`}function xc(e){return e.length}function Sc(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||xc,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Cc(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=wc(r[d]);else{let e=wc(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
@@ -109,14 +109,14 @@ ${e}</tr>
|
|
|
109
109
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${ib(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=ab(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+ib(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=ab(e);if(i===null)return ib(n);e=i;let a=`<img src="${e}" alt="${ib(n)}"`;return t&&(a+=` title="${ib(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:ib(e.text)}},hb=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},gb=class e{options;renderer;textRenderer;constructor(e){this.options=e||Kv,this.options.renderer=this.options.renderer||new mb,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new hb}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},_b=class{options;block;constructor(e){this.options=e||Kv}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?pb.lex:pb.lexInline}provideParser(){return this.block?gb.parse:gb.parseInline}},vb=new class{defaults=Gv();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=gb;Renderer=mb;TextRenderer=hb;Lexer=pb;Tokenizer=fb;Hooks=_b;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new mb(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new fb(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new _b;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];_b.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&_b.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return pb.lex(e,t??this.defaults)}parser(e,t){return gb.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?pb.lex:pb.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?gb.parse:gb.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?pb.lex:pb.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?gb.parse:gb.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
110
110
|
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+ib(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function yb(e,t){return vb.parse(e,t)}yb.options=yb.setOptions=function(e){return vb.setOptions(e),yb.defaults=vb.defaults,qv(yb.defaults),yb},yb.getDefaults=Gv,yb.defaults=Kv,yb.use=function(...e){return vb.use(...e),yb.defaults=vb.defaults,qv(yb.defaults),yb},yb.walkTokens=function(e,t){return vb.walkTokens(e,t)},yb.parseInline=vb.parseInline,yb.Parser=gb,yb.parser=gb.parse,yb.Renderer=mb,yb.TextRenderer=hb,yb.Lexer=pb,yb.lexer=pb.lex,yb.Tokenizer=fb,yb.Hooks=_b,yb.parse=yb,yb.options,yb.setOptions,yb.use,yb.walkTokens,yb.parseInline,gb.parse,pb.lex;var bb=`modulepreload`,xb=function(e){return`/bloby/`+e},Sb={},Z=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=xb(t,n),t in Sb)return;Sb[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:bb,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Cb=300,wb=`300px`,Tb=500;function Eb(e={}){let{immediate:t=!1,debounceDelay:n=Cb,rootMargin:r=wb,idleTimeout:i=Tb}=e,[a,o]=(0,k.useState)(!1),s=(0,k.useRef)(null),c=(0,k.useRef)(null),l=(0,k.useRef)(null),u=(0,k.useMemo)(()=>e=>{let t=Date.now();return window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})},1)},[]),d=(0,k.useMemo)(()=>typeof window<`u`&&window.requestIdleCallback?(e,t)=>window.requestIdleCallback(e,t):u,[u]),f=(0,k.useMemo)(()=>typeof window<`u`&&window.cancelIdleCallback?e=>window.cancelIdleCallback(e):e=>{clearTimeout(e)},[]);return(0,k.useEffect)(()=>{if(t){o(!0);return}let e=s.current;if(!e)return;c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null);let a=()=>{c.current&&=(clearTimeout(c.current),null),l.current&&=(f(l.current),null)},u=e=>{l.current=d(t=>{t.timeRemaining()>0||t.didTimeout?(o(!0),e.disconnect()):l.current=d(()=>{o(!0),e.disconnect()},{timeout:i/2})},{timeout:i})},p=e=>{a(),c.current=window.setTimeout(()=>{var t;let n=e.takeRecords();(n.length===0||(t=n.at(-1)?.isIntersecting)!=null&&t)&&u(e)},n)},m=(e,t)=>{e.isIntersecting?p(t):a()},h=new IntersectionObserver(e=>{for(let t of e)m(t,h)},{rootMargin:r,threshold:0});return h.observe(e),()=>{c.current&&clearTimeout(c.current),l.current&&f(l.current),h.disconnect()}},[t,n,r,i,f,d]),{shouldRender:a,containerRef:s}}var Db=/\s/,Ob=/^\s+$/,kb=new Set([`code`,`pre`,`svg`,`math`,`annotation`]),Ab=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`element`,jb=e=>e.some(e=>Ab(e)&&kb.has(e.tagName)),Mb=e=>{let t=[],n=``,r=!1;for(let i of e){let e=Db.test(i);e!==r&&n&&(t.push(n),n=``),n+=i,r=e}return n&&t.push(n),t},Nb=e=>{let t=[],n=``;for(let r of e)Db.test(r)?n+=r:(n&&=(t.push(n),``),t.push(r));return n&&t.push(n),t},Pb=(e,t,n,r,i,a)=>{let o=`--sd-animation:sd-${t};--sd-duration:${i?0:n}ms;--sd-easing:${r}`;return a&&(o+=`;--sd-delay:${a}ms`),{type:`element`,tagName:`span`,properties:{"data-sd-animate":!0,style:o},children:[{type:`text`,value:e}]}},Fb=(e,t,n,r,i)=>{let a=t.at(-1);if(!(a&&`children`in a))return;if(jb(t))return De;let o=a,s=o.children.indexOf(e);if(s===-1)return;let c=e.value;if(!c.trim()){i.count+=c.length;return}let l=n.sep===`char`?Nb(c):Mb(c),u=r.prevContentLength,d=l.map(e=>{let t=i.count;if(i.count+=e.length,Ob.test(e))return{type:`text`,value:e};let r=u>0&&t<u,a=r?0:i.newIndex++*n.stagger;return Pb(e,n.animation,n.duration,n.easing,r,a)});return o.children.splice(s,1,...d),s+d.length},Ib=0;function Lb(e){let t={animation:e?.animation??`fadeIn`,duration:e?.duration??150,easing:e?.easing??`ease`,sep:e?.sep??`word`,stagger:e?.stagger??40},n={prevContentLength:0,lastRenderCharCount:0},r=Ib++,i=()=>e=>{let r={count:0,newIndex:0};Oe(e,`text`,(e,i)=>Fb(e,i,t,n,r)),n.lastRenderCharCount=r.count,n.prevContentLength=0};return Object.defineProperty(i,`name`,{value:`rehypeAnimate$${r}`}),{name:`animate`,type:`animate`,rehypePlugin:i,setPrevContentLength(e){n.prevContentLength=e},getLastRenderCharCount(){let e=n.lastRenderCharCount;return n.lastRenderCharCount=0,e}}}Lb();var Rb=(0,k.createContext)(!1),zb=()=>(0,k.useContext)(Rb),Bb=(...e)=>Rh(hm(e)),Vb=(e,t)=>{if(!e||!t)return t;let n=`${e}:`;return t.split(/\s+/).filter(Boolean).map(t=>t.startsWith(n)?t:`${e}:${t}`).join(` `)},Hb=e=>e?(...t)=>Vb(e,Rh(hm(t))):Bb,Ub=(e,t,n)=>{let r=typeof t==`string`&&n.startsWith(`text/csv`)?``:``,i=typeof t==`string`?new Blob([r+t],{type:n}):t,a=URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=e,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)},Wb=(0,k.createContext)(Bb),Q=()=>(0,k.useContext)(Wb),Gb=Bb(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-6`,`before:mr-4`,`before:text-[13px]`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),Kb=e=>{let t={};for(let n of e.split(`;`)){let e=n.indexOf(`:`);if(e>0){let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();r&&i&&(t[r]=i)}}return t},qb=(0,k.memo)(({children:e,result:t,language:n,className:r,startLine:i,lineNumbers:a=!0,...o})=>{let s=Q(),c=(0,k.useMemo)(()=>s(Gb),[s]),l=(0,k.useMemo)(()=>{let e={};return t.bg&&(e[`--sdm-bg`]=t.bg),t.fg&&(e[`--sdm-fg`]=t.fg),t.rootStyle&&Object.assign(e,Kb(t.rootStyle)),e},[t.bg,t.fg,t.rootStyle]);return(0,M.jsx)(`div`,{className:s(r,`overflow-x-auto rounded-md border border-border bg-background p-4 text-sm`),"data-language":n,"data-streamdown":`code-block-body`,...o,children:(0,M.jsx)(`pre`,{className:s(r,`bg-[var(--sdm-bg,inherit]`,`dark:bg-[var(--shiki-dark-bg,var(--sdm-bg,inherit)]`),style:l,children:(0,M.jsx)(`code`,{className:a?s(`[counter-increment:line_0] [counter-reset:line]`):void 0,style:a&&i&&i>1?{counterReset:`line ${i-1}`}:void 0,children:t.tokens.map((e,t)=>(0,M.jsx)(`span`,{className:a?c:void 0,children:e.length===0||e.length===1&&e[0].content===``?`
|
|
111
111
|
`:e.map((e,t)=>{let n={},r=!!e.bgColor;if(e.color&&(n[`--sdm-c`]=e.color),e.bgColor&&(n[`--sdm-tbg`]=e.bgColor),e.htmlStyle)for(let[t,i]of Object.entries(e.htmlStyle))t===`color`?n[`--sdm-c`]=i:t===`background-color`?(n[`--sdm-tbg`]=i,r=!0):n[t]=i;return(0,M.jsx)(`span`,{className:s(`text-[var(--sdm-c,inherit)]`,`dark:text-[var(--shiki-dark,var(--sdm-c,inherit))]`,r&&`bg-[var(--sdm-tbg)]`,r&&`dark:bg-[var(--shiki-dark-bg,var(--sdm-tbg))]`),style:n,...e.htmlAttrs,children:e.content},t)})},t))})})})},(e,t)=>e.result===t.result&&e.language===t.language&&e.className===t.className&&e.startLine===t.startLine&&e.lineNumbers===t.lineNumbers),Jb=({className:e,language:t,style:n,isIncomplete:r,...i})=>(0,M.jsx)(`div`,{className:Q()(`my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,e),"data-incomplete":r||void 0,"data-language":t,"data-streamdown":`code-block`,style:{contentVisibility:`auto`,containIntrinsicSize:`auto 200px`,...n},...i}),Yb=(0,k.createContext)({code:``}),Xb=()=>(0,k.useContext)(Yb),Zb=({language:e})=>{let t=Q();return(0,M.jsx)(`div`,{className:t(`flex h-8 items-center text-muted-foreground text-xs`),"data-language":e,"data-streamdown":`code-block-header`,children:(0,M.jsx)(`span`,{className:t(`ml-1 font-mono lowercase`),children:e})})},Qb=e=>{let t=e.length;for(;t>0&&e[t-1]===`
|
|
112
|
-
`;)t--;return e.slice(0,t)},$b=(0,k.lazy)(()=>Z(()=>import(`./highlighted-body-OFNGDK62-
|
|
112
|
+
`;)t--;return e.slice(0,t)},$b=(0,k.lazy)(()=>Z(()=>import(`./highlighted-body-OFNGDK62-D3YkbUq4.js`).then(e=>({default:e.HighlightedCodeBlockBody})),__vite__mapDeps([0,1]))),ex=({code:e,language:t,className:n,children:r,isIncomplete:i=!1,startLine:a,lineNumbers:o,...s})=>{let c=Q(),l=(0,k.useMemo)(()=>Qb(e),[e]),u=(0,k.useMemo)(()=>({bg:`transparent`,fg:`inherit`,tokens:l.split(`
|
|
113
113
|
`).map(e=>[{content:e,color:`inherit`,bgColor:`transparent`,htmlStyle:{},offset:0}])}),[l]);return(0,M.jsx)(Yb.Provider,{value:{code:e},children:(0,M.jsxs)(Jb,{isIncomplete:i,language:t,children:[(0,M.jsx)(Zb,{language:t}),r?(0,M.jsx)(`div`,{className:c(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,M.jsx)(`div`,{className:c(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`code-block-actions`,children:r})}):null,(0,M.jsx)(k.Suspense,{fallback:(0,M.jsx)(qb,{className:n,language:t,lineNumbers:o,result:u,startLine:a,...s}),children:(0,M.jsx)($b,{className:n,code:l,language:t,lineNumbers:o,raw:u,startLine:a,...s})})]})})},tx={CheckIcon:e=>(0,M.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M15.5607 3.99999L15.0303 4.53032L6.23744 13.3232C5.55403 14.0066 4.44599 14.0066 3.76257 13.3232L4.2929 12.7929L3.76257 13.3232L0.969676 10.5303L0.439346 9.99999L1.50001 8.93933L2.03034 9.46966L4.82323 12.2626C4.92086 12.3602 5.07915 12.3602 5.17678 12.2626L13.9697 3.46966L14.5 2.93933L15.5607 3.99999Z`,fill:`currentColor`,fillRule:`evenodd`})}),CopyIcon:e=>(0,M.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M2.75 0.5C1.7835 0.5 1 1.2835 1 2.25V9.75C1 10.7165 1.7835 11.5 2.75 11.5H3.75H4.5V10H3.75H2.75C2.61193 10 2.5 9.88807 2.5 9.75V2.25C2.5 2.11193 2.61193 2 2.75 2H8.25C8.38807 2 8.5 2.11193 8.5 2.25V3H10V2.25C10 1.2835 9.2165 0.5 8.25 0.5H2.75ZM7.75 4.5C6.7835 4.5 6 5.2835 6 6.25V13.75C6 14.7165 6.7835 15.5 7.75 15.5H13.25C14.2165 15.5 15 14.7165 15 13.75V6.25C15 5.2835 14.2165 4.5 13.25 4.5H7.75ZM7.5 6.25C7.5 6.11193 7.61193 6 7.75 6H13.25C13.3881 6 13.5 6.11193 13.5 6.25V13.75C13.5 13.8881 13.3881 14 13.25 14H7.75C7.61193 14 7.5 13.8881 7.5 13.75V6.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),DownloadIcon:e=>(0,M.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M8.75 1V1.75V8.68934L10.7197 6.71967L11.25 6.18934L12.3107 7.25L11.7803 7.78033L8.70711 10.8536C8.31658 11.2441 7.68342 11.2441 7.29289 10.8536L4.21967 7.78033L3.68934 7.25L4.75 6.18934L5.28033 6.71967L7.25 8.68934V1.75V1H8.75ZM13.5 9.25V13.5H2.5V9.25V8.5H1V9.25V14C1 14.5523 1.44771 15 2 15H14C14.5523 15 15 14.5523 15 14V9.25V8.5H13.5V9.25Z`,fill:`currentColor`,fillRule:`evenodd`})}),ExternalLinkIcon:e=>(0,M.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 10.25V13.25C13.5 13.3881 13.3881 13.5 13.25 13.5H2.75C2.61193 13.5 2.5 13.3881 2.5 13.25L2.5 2.75C2.5 2.61193 2.61193 2.5 2.75 2.5H5.75H6.5V1H5.75H2.75C1.7835 1 1 1.7835 1 2.75V13.25C1 14.2165 1.7835 15 2.75 15H13.25C14.2165 15 15 14.2165 15 13.25V10.25V9.5H13.5V10.25ZM9 1H9.75H14.2495C14.6637 1 14.9995 1.33579 14.9995 1.75V6.25V7H13.4995V6.25V3.56066L8.53033 8.52978L8 9.06011L6.93934 7.99945L7.46967 7.46912L12.4388 2.5H9.75H9V1Z`,fill:`currentColor`,fillRule:`evenodd`})}),Loader2Icon:e=>(0,M.jsxs)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:[(0,M.jsx)(`path`,{d:`M8 0V4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M8 16V12`,opacity:`0.5`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M3.29773 1.52783L5.64887 4.7639`,opacity:`0.9`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M12.7023 1.52783L10.3511 4.7639`,opacity:`0.1`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M12.7023 14.472L10.3511 11.236`,opacity:`0.4`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M3.29773 14.472L5.64887 11.236`,opacity:`0.6`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M15.6085 5.52783L11.8043 6.7639`,opacity:`0.2`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M0.391602 10.472L4.19583 9.23598`,opacity:`0.7`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M15.6085 10.4722L11.8043 9.2361`,opacity:`0.3`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,M.jsx)(`path`,{d:`M0.391602 5.52783L4.19583 6.7639`,opacity:`0.8`,stroke:`currentColor`,strokeWidth:`1.5`})]}),Maximize2Icon:e=>(0,M.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M1 5.25V6H2.5V5.25V2.5H5.25H6V1H5.25H2C1.44772 1 1 1.44772 1 2V5.25ZM5.25 14.9994H6V13.4994H5.25H2.5V10.7494V9.99939H1V10.7494V13.9994C1 14.5517 1.44772 14.9994 2 14.9994H5.25ZM15 10V10.75V14C15 14.5523 14.5523 15 14 15H10.75H10V13.5H10.75H13.5V10.75V10H15ZM10.75 1H10V2.5H10.75H13.5V5.25V6H15V5.25V2C15 1.44772 14.5523 1 14 1H10.75Z`,fill:`currentColor`,fillRule:`evenodd`})}),RotateCcwIcon:e=>(0,M.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z`,fill:`currentColor`,fillRule:`evenodd`})}),XIcon:e=>(0,M.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomInIcon:e=>(0,M.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H5.875V4.75V4.125H7.125V4.75V5.875H8.25H8.875V7.125H8.25H7.125V8.25V8.875H5.875V8.25V7.125H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})}),ZoomOutIcon:e=>(0,M.jsx)(`svg`,{color:`currentColor`,height:16,strokeLinejoin:`round`,viewBox:`0 0 16 16`,width:16,...e,children:(0,M.jsx)(`path`,{clipRule:`evenodd`,d:`M1.5 6.5C1.5 3.73858 3.73858 1.5 6.5 1.5C9.26142 1.5 11.5 3.73858 11.5 6.5C11.5 9.26142 9.26142 11.5 6.5 11.5C3.73858 11.5 1.5 9.26142 1.5 6.5ZM6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.02469 13 9.42677 12.475 10.5353 11.596L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L11.596 10.5353C12.475 9.42677 13 8.02469 13 6.5C13 2.91015 10.0899 0 6.5 0ZM4.125 5.875H4.75H8.25H8.875V7.125H8.25H4.75H4.125V5.875Z`,fill:`currentColor`,fillRule:`evenodd`})})},nx=(0,k.createContext)(tx),rx=(e,t)=>{if(e===t)return!0;if(!(e&&t))return e===t;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>e[n]===t[n]):!1},ix=({icons:e,children:t})=>{let n=(0,k.useRef)(e),r=(0,k.useRef)(e?{...tx,...e}:tx);rx(n.current,e)||(n.current=e,r.current=e?{...tx,...e}:tx);let i=r.current;return(0,M.jsx)(nx.Provider,{value:i,children:t})},ax=()=>(0,k.useContext)(nx),ox={copyCode:`Copy Code`,downloadFile:`Download file`,downloadDiagram:`Download diagram`,downloadDiagramAsSvg:`Download diagram as SVG`,downloadDiagramAsPng:`Download diagram as PNG`,downloadDiagramAsMmd:`Download diagram as MMD`,viewFullscreen:`View fullscreen`,exitFullscreen:`Exit fullscreen`,mermaidFormatSvg:`SVG`,mermaidFormatPng:`PNG`,mermaidFormatMmd:`MMD`,copyTable:`Copy table`,copyTableAsMarkdown:`Copy table as Markdown`,copyTableAsCsv:`Copy table as CSV`,copyTableAsTsv:`Copy table as TSV`,downloadTable:`Download table`,downloadTableAsCsv:`Download table as CSV`,downloadTableAsMarkdown:`Download table as Markdown`,tableFormatMarkdown:`Markdown`,tableFormatCsv:`CSV`,tableFormatTsv:`TSV`,imageNotAvailable:`Image not available`,downloadImage:`Download image`,openExternalLink:`Open external link?`,externalLinkWarning:`You're about to visit an external website.`,close:`Close`,copyLink:`Copy link`,copied:`Copied`,openLink:`Open link`},sx=(0,k.createContext)(ox),cx=()=>(0,k.useContext)(sx),lx=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,code:a,...o})=>{let s=Q(),[c,l]=(0,k.useState)(!1),u=(0,k.useRef)(0),{code:d}=Xb(),{isAnimating:f}=(0,k.useContext)(hC),p=cx(),m=a??d,h=async()=>{var r;if(typeof window>`u`||!((r=navigator==null?void 0:navigator.clipboard)!=null&&r.writeText)){t?.(Error(`Clipboard API not available`));return}try{c||(await navigator.clipboard.writeText(m),l(!0),e?.(),u.current=window.setTimeout(()=>l(!1),n))}catch(e){t?.(e)}};(0,k.useEffect)(()=>()=>{window.clearTimeout(u.current)},[]);let g=ax(),_=c?g.CheckIcon:g.CopyIcon;return(0,M.jsx)(`button`,{className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-copy-button`,disabled:f,onClick:h,title:p.copyCode,type:`button`,...o,children:r??(0,M.jsx)(_,{size:14})})},ux={"1c":`1c`,"1c-query":`1cq`,abap:`abap`,"actionscript-3":`as`,ada:`ada`,adoc:`adoc`,"angular-html":`html`,"angular-ts":`ts`,apache:`conf`,apex:`cls`,apl:`apl`,applescript:`applescript`,ara:`ara`,asciidoc:`adoc`,asm:`asm`,astro:`astro`,awk:`awk`,ballerina:`bal`,bash:`sh`,bat:`bat`,batch:`bat`,be:`be`,beancount:`beancount`,berry:`berry`,bibtex:`bib`,bicep:`bicep`,blade:`blade.php`,bsl:`bsl`,c:`c`,"c#":`cs`,"c++":`cpp`,cadence:`cdc`,cairo:`cairo`,cdc:`cdc`,clarity:`clar`,clj:`clj`,clojure:`clj`,"closure-templates":`soy`,cmake:`cmake`,cmd:`cmd`,cobol:`cob`,codeowners:`CODEOWNERS`,codeql:`ql`,coffee:`coffee`,coffeescript:`coffee`,"common-lisp":`lisp`,console:`sh`,coq:`v`,cpp:`cpp`,cql:`cql`,crystal:`cr`,cs:`cs`,csharp:`cs`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cql`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,docker:`dockerfile`,dockerfile:`dockerfile`,dotenv:`env`,"dream-maker":`dm`,edge:`edge`,elisp:`el`,elixir:`ex`,elm:`elm`,"emacs-lisp":`el`,erb:`erb`,erl:`erl`,erlang:`erl`,f:`f`,"f#":`fs`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`f90`,f95:`f95`,fennel:`fnl`,fish:`fish`,fluent:`ftl`,for:`for`,"fortran-fixed-form":`f`,"fortran-free-form":`f90`,fs:`fs`,fsharp:`fs`,fsl:`fsl`,ftl:`ftl`,gdresource:`tres`,gdscript:`gd`,gdshader:`gdshader`,genie:`gs`,gherkin:`feature`,"git-commit":`gitcommit`,"git-rebase":`gitrebase`,gjs:`js`,gleam:`gleam`,"glimmer-js":`js`,"glimmer-ts":`ts`,glsl:`glsl`,gnuplot:`plt`,go:`go`,gql:`gql`,graphql:`graphql`,groovy:`groovy`,gts:`gts`,hack:`hack`,haml:`haml`,handlebars:`hbs`,haskell:`hs`,haxe:`hx`,hbs:`hbs`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,hs:`hs`,html:`html`,"html-derivative":`html`,http:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,jade:`jade`,java:`java`,javascript:`js`,jinja:`jinja`,jison:`jison`,jl:`jl`,js:`js`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,julia:`jl`,kotlin:`kt`,kql:`kql`,kt:`kt`,kts:`kts`,kusto:`kql`,latex:`tex`,lean:`lean`,lean4:`lean`,less:`less`,liquid:`liquid`,lisp:`lisp`,lit:`lit`,llvm:`ll`,log:`log`,logo:`logo`,lua:`lua`,luau:`luau`,make:`mak`,makefile:`mak`,markdown:`md`,marko:`marko`,matlab:`m`,md:`md`,mdc:`mdc`,mdx:`mdx`,mediawiki:`wiki`,mermaid:`mmd`,mips:`s`,mipsasm:`s`,mmd:`mmd`,mojo:`mojo`,move:`move`,nar:`nar`,narrat:`narrat`,nextflow:`nf`,nf:`nf`,nginx:`conf`,nim:`nim`,nix:`nix`,nu:`nu`,nushell:`nu`,objc:`m`,"objective-c":`m`,"objective-cpp":`mm`,ocaml:`ml`,pascal:`pas`,perl:`pl`,perl6:`p6`,php:`php`,plsql:`pls`,po:`po`,polar:`polar`,postcss:`pcss`,pot:`pot`,potx:`potx`,powerquery:`pq`,powershell:`ps1`,prisma:`prisma`,prolog:`pl`,properties:`properties`,proto:`proto`,protobuf:`proto`,ps:`ps`,ps1:`ps1`,pug:`pug`,puppet:`pp`,purescript:`purs`,py:`py`,python:`py`,ql:`ql`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,racket:`rkt`,raku:`raku`,razor:`cshtml`,rb:`rb`,reg:`reg`,regex:`regex`,regexp:`regexp`,rel:`rel`,riscv:`s`,rs:`rs`,rst:`rst`,ruby:`rb`,rust:`rs`,sas:`sas`,sass:`sass`,scala:`scala`,scheme:`scm`,scss:`scss`,sdbl:`sdbl`,sh:`sh`,shader:`shader`,shaderlab:`shader`,shell:`sh`,shellscript:`sh`,shellsession:`sh`,smalltalk:`st`,solidity:`sol`,soy:`soy`,sparql:`rq`,spl:`spl`,splunk:`spl`,sql:`sql`,"ssh-config":`config`,stata:`do`,styl:`styl`,stylus:`styl`,svelte:`svelte`,swift:`swift`,"system-verilog":`sv`,systemd:`service`,talon:`talon`,talonscript:`talon`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,terraform:`tf`,tex:`tex`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`ts`,"ts-tags":`ts`,tsp:`tsp`,tsv:`tsv`,tsx:`tsx`,turtle:`ttl`,twig:`twig`,typ:`typ`,typescript:`ts`,typespec:`tsp`,typst:`typ`,v:`v`,vala:`vala`,vb:`vb`,verilog:`v`,vhdl:`vhdl`,vim:`vim`,viml:`vim`,vimscript:`vim`,vue:`vue`,"vue-html":`html`,"vue-vine":`vine`,vy:`vy`,vyper:`vy`,wasm:`wasm`,wenyan:`wy`,wgsl:`wgsl`,wiki:`wiki`,wikitext:`wiki`,wit:`wit`,wl:`wl`,wolfram:`wl`,xml:`xml`,xsl:`xsl`,yaml:`yaml`,yml:`yml`,zenscript:`zs`,zig:`zig`,zsh:`zsh`,文言:`wy`},dx=({onDownload:e,onError:t,language:n,children:r,className:i,code:a,...o})=>{let s=Q(),{code:c}=Xb(),{isAnimating:l}=(0,k.useContext)(hC),u=cx(),d=ax(),f=a??c,p=`file.${n&&n in ux?ux[n]:`txt`}`,m=()=>{try{Ub(p,f,`text/plain`),e?.()}catch(e){t?.(e)}};return(0,M.jsx)(`button`,{className:s(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),"data-streamdown":`code-block-download-button`,disabled:l,onClick:m,title:u.downloadFile,type:`button`,...o,children:r??(0,M.jsx)(d.DownloadIcon,{size:14})})},fx=()=>{let{Loader2Icon:e}=ax(),t=Q();return(0,M.jsxs)(`div`,{className:t(`w-full divide-y divide-border overflow-hidden rounded-xl border border-border`),children:[(0,M.jsx)(`div`,{className:t(`h-[46px] w-full bg-muted/80`)}),(0,M.jsx)(`div`,{className:t(`flex w-full items-center justify-center p-4`),children:(0,M.jsx)(e,{className:t(`size-4 animate-spin`)})})]})},px=/\.[^/.]+$/,mx=({node:e,className:t,src:n,alt:r,onLoad:i,onError:a,...o})=>{let{DownloadIcon:s}=ax(),c=Q(),l=(0,k.useRef)(null),[u,d]=(0,k.useState)(!1),[f,p]=(0,k.useState)(!1),m=cx(),h=o.width!=null||o.height!=null,g=(u||h)&&!f,_=f&&!h;(0,k.useEffect)(()=>{let e=l.current;if(e!=null&&e.complete){let t=e.naturalWidth>0;d(t),p(!t)}},[]);let v=(0,k.useCallback)(e=>{d(!0),p(!1),i?.(e)},[i]),y=(0,k.useCallback)(e=>{d(!1),p(!0),a?.(e)},[a]),b=async()=>{if(n)try{let e=await(await fetch(n)).blob(),t=new URL(n,window.location.origin).pathname.split(`/`).pop()||``,i=t.split(`.`).pop(),a=t.includes(`.`)&&i!==void 0&&i.length<=4,o=``;if(a)o=t;else{let n=e.type,i=`png`;n.includes(`jpeg`)||n.includes(`jpg`)?i=`jpg`:n.includes(`png`)?i=`png`:n.includes(`svg`)?i=`svg`:n.includes(`gif`)?i=`gif`:n.includes(`webp`)&&(i=`webp`),o=`${(r||t||`image`).replace(px,``)}.${i}`}Ub(o,e,e.type)}catch{window.open(n,`_blank`)}};return n?(0,M.jsxs)(`div`,{className:c(`group relative my-4 inline-block`),"data-streamdown":`image-wrapper`,children:[(0,M.jsx)(`img`,{alt:r,className:c(`max-w-full rounded-lg`,_&&`hidden`,t),"data-streamdown":`image`,onError:y,onLoad:v,ref:l,src:n,...o}),_&&(0,M.jsx)(`span`,{className:c(`text-muted-foreground text-xs italic`),"data-streamdown":`image-fallback`,children:m.imageNotAvailable}),(0,M.jsx)(`div`,{className:c(`pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block`)}),g&&(0,M.jsx)(`button`,{className:c(`absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background`,`opacity-0 group-hover:opacity-100`),onClick:b,title:m.downloadImage,type:`button`,children:(0,M.jsx)(s,{size:14})})]}):null},hx=0,gx=()=>{hx+=1,hx===1&&(document.body.style.overflow=`hidden`)},_x=()=>{hx=Math.max(0,hx-1),hx===0&&(document.body.style.overflow=``)},vx=({url:e,isOpen:t,onClose:n,onConfirm:r})=>{let{CheckIcon:i,CopyIcon:a,ExternalLinkIcon:o,XIcon:s}=ax(),c=Q(),[l,u]=(0,k.useState)(!1),d=cx(),f=(0,k.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),u(!0),setTimeout(()=>u(!1),2e3)}catch{}},[e]),p=(0,k.useCallback)(()=>{r(),n()},[r,n]);return(0,k.useEffect)(()=>{if(t){gx();let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),_x()}}},[t,n]),t?(0,M.jsx)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm`),"data-streamdown":`link-safety-modal`,onClick:n,onKeyDown:e=>{e.key===`Escape`&&n()},role:`button`,tabIndex:0,children:(0,M.jsxs)(`div`,{className:c(`relative mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border bg-background p-6 shadow-lg`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,M.jsx)(`button`,{className:c(`absolute top-4 right-4 rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:n,title:d.close,type:`button`,children:(0,M.jsx)(s,{size:16})}),(0,M.jsxs)(`div`,{className:c(`flex flex-col gap-2`),children:[(0,M.jsxs)(`div`,{className:c(`flex items-center gap-2 font-semibold text-lg`),children:[(0,M.jsx)(o,{size:20}),(0,M.jsx)(`span`,{children:d.openExternalLink})]}),(0,M.jsx)(`p`,{className:c(`text-muted-foreground text-sm`),children:d.externalLinkWarning})]}),(0,M.jsx)(`div`,{className:c(`break-all rounded-md bg-muted p-3 font-mono text-sm`,e.length>100&&`max-h-32 overflow-y-auto`),children:e}),(0,M.jsxs)(`div`,{className:c(`flex gap-2`),children:[(0,M.jsx)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md border bg-background px-4 py-2 font-medium text-sm transition-all hover:bg-muted`),onClick:f,type:`button`,children:l?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(i,{size:14}),(0,M.jsx)(`span`,{children:d.copied})]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(a,{size:14}),(0,M.jsx)(`span`,{children:d.copyLink})]})}),(0,M.jsxs)(`button`,{className:c(`flex flex-1 items-center justify-center gap-2 rounded-md bg-primary px-4 py-2 font-medium text-primary-foreground text-sm transition-all hover:bg-primary/90`),onClick:p,type:`button`,children:[(0,M.jsx)(o,{size:14}),(0,M.jsx)(`span`,{children:d.openLink})]})]})]})}):null},yx=(0,k.createContext)(null),bx=()=>(0,k.useContext)(yx),xx=()=>bx()?.code??null,Sx=()=>bx()?.mermaid??null,Cx=e=>{var t;let n=bx();return n!=null&&n.renderers&&e&&(t=n.renderers.find(t=>Array.isArray(t.language)?t.language.includes(e):t.language===e))!=null?t:null},wx=(e,t)=>new Promise((t,n)=>{let r=`data:image/svg+xml;base64,`+btoa(unescape(encodeURIComponent(e))),i=new Image;i.crossOrigin=`anonymous`,i.onload=()=>{let e=document.createElement(`canvas`),r=i.width*5,a=i.height*5;e.width=r,e.height=a;let o=e.getContext(`2d`);if(!o){n(Error(`Failed to create 2D canvas context for PNG export`));return}o.drawImage(i,0,0,r,a),e.toBlob(e=>{if(!e){n(Error(`Failed to create PNG blob`));return}t(e)},`image/png`)},i.onerror=()=>n(Error(`Failed to load SVG image`)),i.src=r}),Tx=({chart:e,children:t,className:n,onDownload:r,config:i,onError:a})=>{let o=Q(),[s,c]=(0,k.useState)(!1),l=(0,k.useRef)(null),{isAnimating:u}=(0,k.useContext)(hC),d=ax(),f=Sx(),p=cx(),m=async t=>{try{if(t===`mmd`){Ub(`diagram.mmd`,e,`text/plain`),c(!1),r?.(t);return}if(!f){a?.(Error(`Mermaid plugin not available`));return}let n=f.getMermaid(i),o=e.split(``).reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0),s=`mermaid-${Math.abs(o)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:l}=await n.render(s,e);if(!l){a?.(Error(`SVG not found. Please wait for the diagram to render.`));return}if(t===`svg`){Ub(`diagram.svg`,l,`image/svg+xml`),c(!1),r?.(t);return}if(t===`png`){Ub(`diagram.png`,await wx(l),`image/png`),r?.(t),c(!1);return}}catch(e){a?.(e)}};return(0,k.useEffect)(()=>{let e=e=>{let t=e.composedPath();l.current&&!t.includes(l.current)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,M.jsxs)(`div`,{className:o(`relative`),ref:l,children:[(0,M.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),disabled:u,onClick:()=>c(!s),title:p.downloadDiagram,type:`button`,children:t??(0,M.jsx)(d.DownloadIcon,{size:14})}),s?(0,M.jsxs)(`div`,{className:o(`absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,M.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`svg`),title:p.downloadDiagramAsSvg,type:`button`,children:p.mermaidFormatSvg}),(0,M.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`png`),title:p.downloadDiagramAsPng,type:`button`,children:p.mermaidFormatPng}),(0,M.jsx)(`button`,{className:o(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`mmd`),title:p.downloadDiagramAsMmd,type:`button`,children:p.mermaidFormatMmd})]}):null]})},Ex=({chart:e,config:t,onFullscreen:n,onExit:r,className:i,...a})=>{let{Maximize2Icon:o,XIcon:s}=ax(),c=Q(),[l,u]=(0,k.useState)(!1),{isAnimating:d,controls:f}=(0,k.useContext)(hC),p=cx(),m=(()=>{if(typeof f==`boolean`)return f;let e=f.mermaid;return e===!1?!1:e===!0||e===void 0?!0:e.panZoom!==!1})(),h=()=>{u(!l)};return(0,k.useEffect)(()=>{if(l){gx();let e=e=>{e.key===`Escape`&&u(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),_x()}}},[l]),(0,k.useEffect)(()=>{l?n?.():r&&r()},[l,n,r]),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{className:c(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,i),disabled:d,onClick:h,title:p.viewFullscreen,type:`button`,...a,children:(0,M.jsx)(o,{size:14})}),l?(0,Wv.createPortal)((0,M.jsxs)(`div`,{className:c(`fixed inset-0 z-50 flex items-center justify-center bg-background/95 backdrop-blur-sm`),onClick:h,onKeyDown:e=>{e.key===`Escape`&&h()},role:`button`,tabIndex:0,children:[(0,M.jsx)(`button`,{className:c(`absolute top-4 right-4 z-10 rounded-md p-2 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:h,title:p.exitFullscreen,type:`button`,children:(0,M.jsx)(s,{size:20})}),(0,M.jsx)(`div`,{className:c(`flex size-full items-center justify-center p-4`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:(0,M.jsx)(yC,{chart:e,className:c(`size-full [&_svg]:h-auto [&_svg]:w-auto`),config:t,fullscreen:!0,showControls:m})})]}),document.body):null]})},Dx=e=>{let t=[],n=[],r=e.querySelectorAll(`thead th`);for(let e of r)t.push(e.textContent?.trim()||``);let i=e.querySelectorAll(`tbody tr`);for(let e of i){let t=[],r=e.querySelectorAll(`td`);for(let e of r)t.push(e.textContent?.trim()||``);n.push(t)}return{headers:t,rows:n}},Ox=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1,n=!1;for(let r of e){if(r===`"`){t=!0,n=!0;break}(r===`,`||r===`
|
|
114
114
|
`)&&(t=!0)}return t?n?`"${e.replace(/"/g,`""`)}"`:`"${e}"`:e},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(`,`),o+=1);for(let e of n)a[o]=e.map(r).join(`,`),o+=1;return a.join(`
|
|
115
115
|
`)},kx=e=>{let{headers:t,rows:n}=e,r=e=>{let t=!1;for(let n of e)if(n===` `||n===`
|
|
116
116
|
`||n===`\r`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===` `?n.push(`\\t`):t===`
|
|
117
117
|
`?n.push(`\\n`):t===`\r`?n.push(`\\r`):n.push(t);return n.join(``)},i=t.length>0?n.length+1:n.length,a=Array(i),o=0;t.length>0&&(a[o]=t.map(r).join(` `),o+=1);for(let e of n)a[o]=e.map(r).join(` `),o+=1;return a.join(`
|
|
118
118
|
`)},Ax=e=>{let t=!1;for(let n of e)if(n===`\\`||n===`|`){t=!0;break}if(!t)return e;let n=[];for(let t of e)t===`\\`?n.push(`\\\\`):t===`|`?n.push(`\\|`):n.push(t);return n.join(``)},jx=e=>{let{headers:t,rows:n}=e;if(t.length===0)return``;let r=Array(n.length+2),i=0;r[i]=`| ${t.map(e=>Ax(e)).join(` | `)} |`,i+=1;let a=Array(t.length);for(let e=0;e<t.length;e+=1)a[e]=`---`;r[i]=`| ${a.join(` | `)} |`,i+=1;for(let e of n)if(e.length<t.length){let n=Array(t.length);for(let r=0;r<t.length;r+=1)n[r]=r<e.length?Ax(e[r]):``;r[i]=`| ${n.join(` | `)} |`,i+=1}else r[i]=`| ${e.map(e=>Ax(e)).join(` | `)} |`,i+=1;return r.join(`
|
|
119
|
-
`)},Mx=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=Q(),[o,s]=(0,k.useState)(!1),[c,l]=(0,k.useState)(!1),u=(0,k.useRef)(null),d=(0,k.useRef)(0),{isAnimating:f}=(0,k.useContext)(hC),p=cx(),m=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=Dx(t),o=({csv:Ox,tsv:kx,md:jx}[e]||jx)(a),c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),d.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,k.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(d.current)}},[]);let h=ax(),g=c?h.CheckIcon:h.CopyIcon;return(0,M.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,M.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:f,onClick:()=>s(!o),title:p.copyTable,type:`button`,children:e??(0,M.jsx)(g,{height:14,width:14})}),o?(0,M.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,M.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`md`),title:p.copyTableAsMarkdown,type:`button`,children:p.tableFormatMarkdown}),(0,M.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`csv`),title:p.copyTableAsCsv,type:`button`,children:p.tableFormatCsv}),(0,M.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`tsv`),title:p.copyTableAsTsv,type:`button`,children:p.tableFormatTsv})]}):null]})},Nx=({children:e,className:t,onDownload:n,onError:r})=>{let i=Q(),[a,o]=(0,k.useState)(!1),s=(0,k.useRef)(null),{isAnimating:c}=(0,k.useContext)(hC),l=cx(),u=ax(),d=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=Dx(t),a=e===`csv`?Ox(i):jx(i);Ub(`table.${e===`csv`?`csv`:`md`}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,k.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,M.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,M.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:l.downloadTable,type:`button`,children:e??(0,M.jsx)(u.DownloadIcon,{size:14})}),a?(0,M.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,M.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`csv`),title:l.downloadTableAsCsv,type:`button`,children:l.tableFormatCsv}),(0,M.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`markdown`),title:l.downloadTableAsMarkdown,type:`button`,children:l.tableFormatMarkdown})]}):null]})},Px=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=ax(),o=Q(),[s,c]=(0,k.useState)(!1),{isAnimating:l}=(0,k.useContext)(hC),u=cx(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,k.useEffect)(()=>{if(s){gx();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),_x()}}},[s]),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:d,title:u.viewFullscreen,type:`button`,children:(0,M.jsx)(i,{size:14})}),s?(0,Wv.createPortal)((0,M.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:f,onKeyDown:e=>{e.key===`Escape`&&f()},role:`dialog`,children:(0,M.jsxs)(`div`,{className:o(`flex h-full flex-col`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,M.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,M.jsx)(Mx,{}):null,r?(0,M.jsx)(Nx,{}):null,(0,M.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:f,title:u.exitFullscreen,type:`button`,children:(0,M.jsx)(a,{size:20})})]}),(0,M.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,M.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},Fx=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:a=!0,...o})=>{let s=Q(),c=n&&r,l=n&&i,u=n&&a,d=c||l||u;return(0,M.jsxs)(`div`,{className:s(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[d?(0,M.jsxs)(`div`,{className:s(`flex items-center justify-end gap-1`),children:[c?(0,M.jsx)(Mx,{}):null,l?(0,M.jsx)(Nx,{}):null,u?(0,M.jsx)(Px,{showCopy:c,showDownload:l,children:e}):null]}):null,(0,M.jsx)(`div`,{className:s(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),children:(0,M.jsx)(`table`,{className:s(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...o,children:e})})]})},Ix=/startLine=(\d+)/,Lx=/\bnoLineNumbers\b/,Rx=(0,k.lazy)(()=>Z(()=>import(`./mermaid-GHXKKRXX-6uL8XX_T.js`).then(e=>({default:e.Mermaid})),[])),zx=/language-([^\s]+)/;function Bx(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function Vx(e,t){return e.className===t.className&&Bx(e.node,t.node)}var Hx=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,Ux=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Wx=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Gx=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Kx=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`ol`,{className:Q()(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e}),(e,t)=>Vx(e,t));Kx.displayName=`MarkdownOl`;var qx=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`li`,{className:Q()(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e}),(e,t)=>e.className===t.className&&Bx(e.node,t.node));qx.displayName=`MarkdownLi`;var Jx=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`ul`,{className:Q()(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e}),(e,t)=>Vx(e,t));Jx.displayName=`MarkdownUl`;var Yx=(0,k.memo)(({className:e,node:t,...n})=>(0,M.jsx)(`hr`,{className:Q()(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n}),(e,t)=>Vx(e,t));Yx.displayName=`MarkdownHr`;var Xx=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`span`,{className:Q()(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e}),(e,t)=>Vx(e,t));Xx.displayName=`MarkdownStrong`;var Zx=(0,k.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=Q(),{linkSafety:o}=(0,k.useContext)(hC),[s,c]=(0,k.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,k.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),d=(0,k.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),f=(0,k.useCallback)(()=>{c(!1)},[]),p={url:n??``,isOpen:s,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(p):(0,M.jsx)(vx,{...p})]}):(0,M.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>Vx(e,t)&&e.href===t.href);Zx.displayName=`MarkdownA`;var Qx=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`h1`,{className:Q()(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e}),(e,t)=>Vx(e,t));Qx.displayName=`MarkdownH1`;var $x=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`h2`,{className:Q()(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e}),(e,t)=>Vx(e,t));$x.displayName=`MarkdownH2`;var eS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`h3`,{className:Q()(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e}),(e,t)=>Vx(e,t));eS.displayName=`MarkdownH3`;var tS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`h4`,{className:Q()(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e}),(e,t)=>Vx(e,t));tS.displayName=`MarkdownH4`;var nS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`h5`,{className:Q()(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e}),(e,t)=>Vx(e,t));nS.displayName=`MarkdownH5`;var rS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`h6`,{className:Q()(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e}),(e,t)=>Vx(e,t));rS.displayName=`MarkdownH6`;var iS=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i}=(0,k.useContext)(hC);return(0,M.jsx)(Fx,{className:t,showControls:Hx(i,`table`),showCopy:Ux(i,`copy`),showDownload:Ux(i,`download`),showFullscreen:Ux(i,`fullscreen`),...r,children:e})},(e,t)=>Vx(e,t));iS.displayName=`MarkdownTable`;var aS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`thead`,{className:Q()(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e}),(e,t)=>Vx(e,t));aS.displayName=`MarkdownThead`;var oS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`tbody`,{className:Q()(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e}),(e,t)=>Vx(e,t));oS.displayName=`MarkdownTbody`;var sS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`tr`,{className:Q()(`border-border`,t),"data-streamdown":`table-row`,...r,children:e}),(e,t)=>Vx(e,t));sS.displayName=`MarkdownTr`;var cS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`th`,{className:Q()(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e}),(e,t)=>Vx(e,t));cS.displayName=`MarkdownTh`;var lS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`td`,{className:Q()(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e}),(e,t)=>Vx(e,t));lS.displayName=`MarkdownTd`;var uS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`blockquote`,{className:Q()(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e}),(e,t)=>Vx(e,t));uS.displayName=`MarkdownBlockquote`;var dS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`sup`,{className:Q()(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e}),(e,t)=>Vx(e,t));dS.displayName=`MarkdownSup`;var fS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`sub`,{className:Q()(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e}),(e,t)=>Vx(e,t));fS.displayName=`MarkdownSub`;var pS=(0,k.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,k.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,k.isValidElement)(e))if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,k.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,k.isValidElement)(e))return e;if(e.type===Kx){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,M.jsx)(`section`,{className:t,...r,children:i}):null}return(0,M.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>Vx(e,t));pS.displayName=`MarkdownSection`;var mS=(0,k.memo)(({node:e,className:t,children:n,...r})=>{let i=Q(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,k.useContext)(hC),l=Sx(),u=zb(),d=(t?.match(zx))?.at(1)??``,f=Cx(d);if(a)return(0,M.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let p=e?.properties?.metastring,m=p?.match(Ix),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&&Lx.test(p))&&c!==!1,v=``;if((0,k.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?v=n.props.children:typeof n==`string`&&(v=n),f){let e=f.component;return(0,M.jsx)(k.Suspense,{fallback:(0,M.jsx)(fx,{}),children:(0,M.jsx)(e,{code:v,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=Hx(s,`mermaid`),n=Gx(s,`download`),r=Gx(s,`copy`),a=Gx(s,`fullscreen`),c=Gx(s,`panZoom`),l=e&&(n||r||a);return(0,M.jsx)(k.Suspense,{fallback:(0,M.jsx)(fx,{}),children:(0,M.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,M.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,M.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,M.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,M.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,M.jsx)(Tx,{chart:v,config:o?.config}):null,r?(0,M.jsx)(lx,{code:v}):null,a?(0,M.jsx)(Ex,{chart:v,config:o?.config}):null]})}):null,(0,M.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,M.jsx)(Rx,{chart:v,config:o?.config,showControls:c})})]})})}let y=Hx(s,`code`),b=Wx(s,`download`),x=Wx(s,`copy`);return(0,M.jsx)(ex,{className:t,code:v,isIncomplete:u,language:d,lineNumbers:_,startLine:g,children:y?(0,M.jsxs)(M.Fragment,{children:[b?(0,M.jsx)(dx,{code:v,language:d}):null,x?(0,M.jsx)(lx,{}):null]}):null})},(e,t)=>e.className===t.className&&Bx(e.node,t.node));mS.displayName=`MarkdownCode`;var hS=(0,k.memo)(mx,(e,t)=>e.className===t.className&&Bx(e.node,t.node));hS.displayName=`MarkdownImg`;var gS=(0,k.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,k.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,M.jsx)(M.Fragment,{children:e})}return(0,M.jsx)(`p`,{...n,children:e})},(e,t)=>Vx(e,t));gS.displayName=`MarkdownParagraph`;var _S={ol:Kx,li:qx,ul:Jx,hr:Yx,strong:Xx,a:Zx,h1:Qx,h2:$x,h3:eS,h4:tS,h5:nS,h6:rS,table:iS,thead:aS,tbody:oS,tr:sS,th:cS,td:lS,blockquote:uS,code:mS,img:hS,pre:({children:e})=>(0,k.isValidElement)(e)?(0,k.cloneElement)(e,{"data-block":`true`}):e,sup:dS,sub:fS,p:gS,section:pS},vS=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,yS=/\p{L}/u;function bS(e){let t=e.replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``);for(let e of t){if(vS.test(e))return`rtl`;if(yS.test(e))return`ltr`}return`ltr`}var xS=/^[ \t]{0,3}(`{3,}|~{3,})/,SS=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,CS=e=>{let t=e.split(`
|
|
119
|
+
`)},Mx=({children:e,className:t,onCopy:n,onError:r,timeout:i=2e3})=>{let a=Q(),[o,s]=(0,k.useState)(!1),[c,l]=(0,k.useState)(!1),u=(0,k.useRef)(null),d=(0,k.useRef)(0),{isAnimating:f}=(0,k.useContext)(hC),p=cx(),m=async e=>{var t;if(typeof window>`u`||!((t=navigator==null?void 0:navigator.clipboard)!=null&&t.write)){r?.(Error(`Clipboard API not available`));return}try{let t=(u.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let a=Dx(t),o=({csv:Ox,tsv:kx,md:jx}[e]||jx)(a),c=new ClipboardItem({"text/plain":new Blob([o],{type:`text/plain`}),"text/html":new Blob([t.outerHTML],{type:`text/html`})});await navigator.clipboard.write([c]),l(!0),s(!1),n?.(e),d.current=window.setTimeout(()=>l(!1),i)}catch(e){r?.(e)}};(0,k.useEffect)(()=>{let e=e=>{let t=e.composedPath();u.current&&!t.includes(u.current)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e),window.clearTimeout(d.current)}},[]);let h=ax(),g=c?h.CheckIcon:h.CopyIcon;return(0,M.jsxs)(`div`,{className:a(`relative`),ref:u,children:[(0,M.jsx)(`button`,{className:a(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:f,onClick:()=>s(!o),title:p.copyTable,type:`button`,children:e??(0,M.jsx)(g,{height:14,width:14})}),o?(0,M.jsxs)(`div`,{className:a(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,M.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`md`),title:p.copyTableAsMarkdown,type:`button`,children:p.tableFormatMarkdown}),(0,M.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`csv`),title:p.copyTableAsCsv,type:`button`,children:p.tableFormatCsv}),(0,M.jsx)(`button`,{className:a(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>m(`tsv`),title:p.copyTableAsTsv,type:`button`,children:p.tableFormatTsv})]}):null]})},Nx=({children:e,className:t,onDownload:n,onError:r})=>{let i=Q(),[a,o]=(0,k.useState)(!1),s=(0,k.useRef)(null),{isAnimating:c}=(0,k.useContext)(hC),l=cx(),u=ax(),d=e=>{try{let t=(s.current?.closest(`[data-streamdown="table-wrapper"]`))?.querySelector(`table`);if(!t){r?.(Error(`Table not found`));return}let i=Dx(t),a=e===`csv`?Ox(i):jx(i);Ub(`table.${e===`csv`?`csv`:`md`}`,a,e===`csv`?`text/csv`:`text/markdown`),o(!1),n?.(e)}catch(e){r?.(e)}};return(0,k.useEffect)(()=>{let e=e=>{let t=e.composedPath();s.current&&!t.includes(s.current)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[]),(0,M.jsxs)(`div`,{className:i(`relative`),ref:s,children:[(0,M.jsx)(`button`,{className:i(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:c,onClick:()=>o(!a),title:l.downloadTable,type:`button`,children:e??(0,M.jsx)(u.DownloadIcon,{size:14})}),a?(0,M.jsxs)(`div`,{className:i(`absolute top-full right-0 z-20 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg`),children:[(0,M.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`csv`),title:l.downloadTableAsCsv,type:`button`,children:l.tableFormatCsv}),(0,M.jsx)(`button`,{className:i(`w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40`),onClick:()=>d(`markdown`),title:l.downloadTableAsMarkdown,type:`button`,children:l.tableFormatMarkdown})]}):null]})},Px=({children:e,className:t,showCopy:n=!0,showDownload:r=!0})=>{let{Maximize2Icon:i,XIcon:a}=ax(),o=Q(),[s,c]=(0,k.useState)(!1),{isAnimating:l}=(0,k.useContext)(hC),u=cx(),d=()=>{c(!0)},f=()=>{c(!1)};return(0,k.useEffect)(()=>{if(s){gx();let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),_x()}}},[s]),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{className:o(`cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,t),disabled:l,onClick:d,title:u.viewFullscreen,type:`button`,children:(0,M.jsx)(i,{size:14})}),s?(0,Wv.createPortal)((0,M.jsx)(`div`,{"aria-label":u.viewFullscreen,"aria-modal":`true`,className:o(`fixed inset-0 z-50 flex flex-col bg-background`),"data-streamdown":`table-fullscreen`,onClick:f,onKeyDown:e=>{e.key===`Escape`&&f()},role:`dialog`,children:(0,M.jsxs)(`div`,{className:o(`flex h-full flex-col`),onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),role:`presentation`,children:[(0,M.jsxs)(`div`,{className:o(`flex items-center justify-end gap-1 p-4`),children:[n?(0,M.jsx)(Mx,{}):null,r?(0,M.jsx)(Nx,{}):null,(0,M.jsx)(`button`,{className:o(`rounded-md p-1 text-muted-foreground transition-all hover:bg-muted hover:text-foreground`),onClick:f,title:u.exitFullscreen,type:`button`,children:(0,M.jsx)(a,{size:20})})]}),(0,M.jsx)(`div`,{className:o(`flex-1 overflow-auto p-4 pt-0 [&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10`),children:(0,M.jsx)(`table`,{className:o(`w-full border-collapse border border-border`),"data-streamdown":`table`,children:e})})]})}),document.body):null]})},Fx=({children:e,className:t,showControls:n,showCopy:r=!0,showDownload:i=!0,showFullscreen:a=!0,...o})=>{let s=Q(),c=n&&r,l=n&&i,u=n&&a,d=c||l||u;return(0,M.jsxs)(`div`,{className:s(`my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2`),"data-streamdown":`table-wrapper`,children:[d?(0,M.jsxs)(`div`,{className:s(`flex items-center justify-end gap-1`),children:[c?(0,M.jsx)(Mx,{}):null,l?(0,M.jsx)(Nx,{}):null,u?(0,M.jsx)(Px,{showCopy:c,showDownload:l,children:e}):null]}):null,(0,M.jsx)(`div`,{className:s(`border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background`),children:(0,M.jsx)(`table`,{className:s(`w-full divide-y divide-border`,t),"data-streamdown":`table`,...o,children:e})})]})},Ix=/startLine=(\d+)/,Lx=/\bnoLineNumbers\b/,Rx=(0,k.lazy)(()=>Z(()=>import(`./mermaid-GHXKKRXX-Bg8FPZtr.js`).then(e=>({default:e.Mermaid})),[])),zx=/language-([^\s]+)/;function Bx(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let n=e.position.start,r=t.position.start,i=e.position.end,a=t.position.end;return n?.line===r?.line&&n?.column===r?.column&&i?.line===a?.line&&i?.column===a?.column}function Vx(e,t){return e.className===t.className&&Bx(e.node,t.node)}var Hx=(e,t)=>typeof e==`boolean`?e:e[t]!==!1,Ux=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.table;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Wx=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.code;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Gx=(e,t)=>{if(typeof e==`boolean`)return e;let n=e.mermaid;return n===!1?!1:n===!0||n===void 0?!0:n[t]!==!1},Kx=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`ol`,{className:Q()(`list-inside list-decimal whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`ordered-list`,...r,children:e}),(e,t)=>Vx(e,t));Kx.displayName=`MarkdownOl`;var qx=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`li`,{className:Q()(`py-1 [&>p]:inline`,t),"data-streamdown":`list-item`,...r,children:e}),(e,t)=>e.className===t.className&&Bx(e.node,t.node));qx.displayName=`MarkdownLi`;var Jx=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`ul`,{className:Q()(`list-inside list-disc whitespace-normal [li_&]:pl-6`,t),"data-streamdown":`unordered-list`,...r,children:e}),(e,t)=>Vx(e,t));Jx.displayName=`MarkdownUl`;var Yx=(0,k.memo)(({className:e,node:t,...n})=>(0,M.jsx)(`hr`,{className:Q()(`my-6 border-border`,e),"data-streamdown":`horizontal-rule`,...n}),(e,t)=>Vx(e,t));Yx.displayName=`MarkdownHr`;var Xx=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`span`,{className:Q()(`font-semibold`,t),"data-streamdown":`strong`,...r,children:e}),(e,t)=>Vx(e,t));Xx.displayName=`MarkdownStrong`;var Zx=(0,k.memo)(({children:e,className:t,href:n,node:r,...i})=>{let a=Q(),{linkSafety:o}=(0,k.useContext)(hC),[s,c]=(0,k.useState)(!1),l=n===`streamdown:incomplete-link`,u=(0,k.useCallback)(async e=>{if(!(!(o!=null&&o.enabled&&n)||l)){if(e.preventDefault(),o.onLinkCheck&&await o.onLinkCheck(n)){window.open(n,`_blank`,`noreferrer`);return}c(!0)}},[o,n,l]),d=(0,k.useCallback)(()=>{n&&window.open(n,`_blank`,`noreferrer`)},[n]),f=(0,k.useCallback)(()=>{c(!1)},[]),p={url:n??``,isOpen:s,onClose:f,onConfirm:d};return o!=null&&o.enabled&&n?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`button`,{className:a(`wrap-anywhere appearance-none text-left font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,onClick:u,type:`button`,children:e}),o.renderModal?o.renderModal(p):(0,M.jsx)(vx,{...p})]}):(0,M.jsx)(`a`,{className:a(`wrap-anywhere font-medium text-primary underline`,t),"data-incomplete":l,"data-streamdown":`link`,href:n,rel:`noreferrer`,target:`_blank`,...i,children:e})},(e,t)=>Vx(e,t)&&e.href===t.href);Zx.displayName=`MarkdownA`;var Qx=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`h1`,{className:Q()(`mt-6 mb-2 font-semibold text-3xl`,t),"data-streamdown":`heading-1`,...r,children:e}),(e,t)=>Vx(e,t));Qx.displayName=`MarkdownH1`;var $x=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`h2`,{className:Q()(`mt-6 mb-2 font-semibold text-2xl`,t),"data-streamdown":`heading-2`,...r,children:e}),(e,t)=>Vx(e,t));$x.displayName=`MarkdownH2`;var eS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`h3`,{className:Q()(`mt-6 mb-2 font-semibold text-xl`,t),"data-streamdown":`heading-3`,...r,children:e}),(e,t)=>Vx(e,t));eS.displayName=`MarkdownH3`;var tS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`h4`,{className:Q()(`mt-6 mb-2 font-semibold text-lg`,t),"data-streamdown":`heading-4`,...r,children:e}),(e,t)=>Vx(e,t));tS.displayName=`MarkdownH4`;var nS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`h5`,{className:Q()(`mt-6 mb-2 font-semibold text-base`,t),"data-streamdown":`heading-5`,...r,children:e}),(e,t)=>Vx(e,t));nS.displayName=`MarkdownH5`;var rS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`h6`,{className:Q()(`mt-6 mb-2 font-semibold text-sm`,t),"data-streamdown":`heading-6`,...r,children:e}),(e,t)=>Vx(e,t));rS.displayName=`MarkdownH6`;var iS=(0,k.memo)(({children:e,className:t,node:n,...r})=>{let{controls:i}=(0,k.useContext)(hC);return(0,M.jsx)(Fx,{className:t,showControls:Hx(i,`table`),showCopy:Ux(i,`copy`),showDownload:Ux(i,`download`),showFullscreen:Ux(i,`fullscreen`),...r,children:e})},(e,t)=>Vx(e,t));iS.displayName=`MarkdownTable`;var aS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`thead`,{className:Q()(`bg-muted/80`,t),"data-streamdown":`table-header`,...r,children:e}),(e,t)=>Vx(e,t));aS.displayName=`MarkdownThead`;var oS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`tbody`,{className:Q()(`divide-y divide-border`,t),"data-streamdown":`table-body`,...r,children:e}),(e,t)=>Vx(e,t));oS.displayName=`MarkdownTbody`;var sS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`tr`,{className:Q()(`border-border`,t),"data-streamdown":`table-row`,...r,children:e}),(e,t)=>Vx(e,t));sS.displayName=`MarkdownTr`;var cS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`th`,{className:Q()(`whitespace-nowrap px-4 py-2 text-left font-semibold text-sm`,t),"data-streamdown":`table-header-cell`,...r,children:e}),(e,t)=>Vx(e,t));cS.displayName=`MarkdownTh`;var lS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`td`,{className:Q()(`px-4 py-2 text-sm`,t),"data-streamdown":`table-cell`,...r,children:e}),(e,t)=>Vx(e,t));lS.displayName=`MarkdownTd`;var uS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`blockquote`,{className:Q()(`my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic`,t),"data-streamdown":`blockquote`,...r,children:e}),(e,t)=>Vx(e,t));uS.displayName=`MarkdownBlockquote`;var dS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`sup`,{className:Q()(`text-sm`,t),"data-streamdown":`superscript`,...r,children:e}),(e,t)=>Vx(e,t));dS.displayName=`MarkdownSup`;var fS=(0,k.memo)(({children:e,className:t,node:n,...r})=>(0,M.jsx)(`sub`,{className:Q()(`text-sm`,t),"data-streamdown":`subscript`,...r,children:e}),(e,t)=>Vx(e,t));fS.displayName=`MarkdownSub`;var pS=(0,k.memo)(({children:e,className:t,node:n,...r})=>{if(`data-footnotes`in r){let n=e=>{if(!(0,k.isValidElement)(e))return!1;let t=Array.isArray(e.props.children)?e.props.children:[e.props.children],n=!1,r=!1;for(let e of t)if(e){if(typeof e==`string`)e.trim()!==``&&(n=!0);else if((0,k.isValidElement)(e))if(e.props?.[`data-footnote-backref`]!==void 0)r=!0;else{let t=Array.isArray(e.props.children)?e.props.children:[e.props.children];for(let e of t){if(typeof e==`string`&&e.trim()!==``){n=!0;break}if((0,k.isValidElement)(e)&&e.props?.[`data-footnote-backref`]===void 0){n=!0;break}}}}return r&&!n},i=Array.isArray(e)?e.map(e=>{if(!(0,k.isValidElement)(e))return e;if(e.type===Kx){let t=(Array.isArray(e.props.children)?e.props.children:[e.props.children]).filter(e=>!n(e));return t.length===0?null:{...e,props:{...e.props,children:t}}}return e}):e;return(Array.isArray(i)?i.some(e=>e!==null):i!==null)?(0,M.jsx)(`section`,{className:t,...r,children:i}):null}return(0,M.jsx)(`section`,{className:t,...r,children:e})},(e,t)=>Vx(e,t));pS.displayName=`MarkdownSection`;var mS=(0,k.memo)(({node:e,className:t,children:n,...r})=>{let i=Q(),a=!(`data-block`in r),{mermaid:o,controls:s,lineNumbers:c}=(0,k.useContext)(hC),l=Sx(),u=zb(),d=(t?.match(zx))?.at(1)??``,f=Cx(d);if(a)return(0,M.jsx)(`code`,{className:i(`rounded bg-muted px-1.5 py-0.5 font-mono text-sm`,t),"data-streamdown":`inline-code`,...r,children:n});let p=e?.properties?.metastring,m=p?.match(Ix),h=m?Number.parseInt(m[1],10):void 0,g=h!==void 0&&h>=1?h:void 0,_=!(p&&Lx.test(p))&&c!==!1,v=``;if((0,k.isValidElement)(n)&&n.props&&typeof n.props==`object`&&`children`in n.props&&typeof n.props.children==`string`?v=n.props.children:typeof n==`string`&&(v=n),f){let e=f.component;return(0,M.jsx)(k.Suspense,{fallback:(0,M.jsx)(fx,{}),children:(0,M.jsx)(e,{code:v,isIncomplete:u,language:d,meta:p})})}if(d===`mermaid`&&l){let e=Hx(s,`mermaid`),n=Gx(s,`download`),r=Gx(s,`copy`),a=Gx(s,`fullscreen`),c=Gx(s,`panZoom`),l=e&&(n||r||a);return(0,M.jsx)(k.Suspense,{fallback:(0,M.jsx)(fx,{}),children:(0,M.jsxs)(`div`,{className:i(`group relative my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2`,t),"data-streamdown":`mermaid-block`,children:[(0,M.jsx)(`div`,{className:i(`flex h-8 items-center text-muted-foreground text-xs`),children:(0,M.jsx)(`span`,{className:i(`ml-1 font-mono lowercase`),children:`mermaid`})}),l?(0,M.jsx)(`div`,{className:i(`pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end`),children:(0,M.jsxs)(`div`,{className:i(`pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur`),"data-streamdown":`mermaid-block-actions`,children:[n?(0,M.jsx)(Tx,{chart:v,config:o?.config}):null,r?(0,M.jsx)(lx,{code:v}):null,a?(0,M.jsx)(Ex,{chart:v,config:o?.config}):null]})}):null,(0,M.jsx)(`div`,{className:i(`rounded-md border border-border bg-background`),children:(0,M.jsx)(Rx,{chart:v,config:o?.config,showControls:c})})]})})}let y=Hx(s,`code`),b=Wx(s,`download`),x=Wx(s,`copy`);return(0,M.jsx)(ex,{className:t,code:v,isIncomplete:u,language:d,lineNumbers:_,startLine:g,children:y?(0,M.jsxs)(M.Fragment,{children:[b?(0,M.jsx)(dx,{code:v,language:d}):null,x?(0,M.jsx)(lx,{}):null]}):null})},(e,t)=>e.className===t.className&&Bx(e.node,t.node));mS.displayName=`MarkdownCode`;var hS=(0,k.memo)(mx,(e,t)=>e.className===t.className&&Bx(e.node,t.node));hS.displayName=`MarkdownImg`;var gS=(0,k.memo)(({children:e,node:t,...n})=>{let r=(Array.isArray(e)?e:[e]).filter(e=>e!=null&&e!==``);if(r.length===1&&(0,k.isValidElement)(r[0])){let t=r[0].props.node?.tagName;if(t===`img`||t===`code`&&`data-block`in r[0].props)return(0,M.jsx)(M.Fragment,{children:e})}return(0,M.jsx)(`p`,{...n,children:e})},(e,t)=>Vx(e,t));gS.displayName=`MarkdownParagraph`;var _S={ol:Kx,li:qx,ul:Jx,hr:Yx,strong:Xx,a:Zx,h1:Qx,h2:$x,h3:eS,h4:tS,h5:nS,h6:rS,table:iS,thead:aS,tbody:oS,tr:sS,th:cS,td:lS,blockquote:uS,code:mS,img:hS,pre:({children:e})=>(0,k.isValidElement)(e)?(0,k.cloneElement)(e,{"data-block":`true`}):e,sup:dS,sub:fS,p:gS,section:pS},vS=/[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/,yS=/\p{L}/u;function bS(e){let t=e.replace(/^#{1,6}\s+/gm,``).replace(/(\*{1,3}|_{1,3})/g,``).replace(/`[^`]*`/g,``).replace(/\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/^[\s>*\-+\d.]+/gm,``);for(let e of t){if(vS.test(e))return`rtl`;if(yS.test(e))return`ltr`}return`ltr`}var xS=/^[ \t]{0,3}(`{3,}|~{3,})/,SS=/^\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?$/,CS=e=>{let t=e.split(`
|
|
120
120
|
`),n=null,r=0;for(let e of t){let t=xS.exec(e);if(n===null){if(t){let e=t[1];n=e[0],r=e.length}}else if(t){let e=t[1],i=e[0],a=e.length;i===n&&a>=r&&(n=null,r=0)}}return n!==null},wS=e=>{let t=e.split(`
|
|
121
121
|
`);for(let e of t){let t=e.trim();if(t.length>0&&t.includes(`|`)&&SS.test(t))return!0}return!1},TS=()=>e=>{Ae(e,`html`,(e,t,n)=>{!n||typeof t!=`number`||(n.children[t]={type:`text`,value:e.value})})},ES=[],DS={allowDangerousHtml:!0},OS=new WeakMap,kS=new class{constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let n=e.rehypePlugins,r=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(n||r||i)){let t=`default`;return this.keyCache.set(e,t),t}let a=e=>{if(!e||e.length===0)return``;let t=``;for(let n=0;n<e.length;n+=1){let r=e[n];if(n>0&&(t+=`,`),Array.isArray(r)){let[e,n]=r;if(typeof e==`function`){let n=OS.get(e);n||(n=e.name,OS.set(e,n)),t+=n}else t+=String(e);t+=`:`,t+=JSON.stringify(n)}else if(typeof r==`function`){let e=OS.get(r);e||(e=r.name,OS.set(r,e)),t+=e}else t+=String(r)}return t},o=a(n),s=`${a(r)}::${o}::${i?JSON.stringify(i):``}`;return this.keyCache.set(e,s),s}get(e){let t=this.generateCacheKey(e),n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(e,t){let n=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}this.cache.set(n,t)}clear(){this.cache.clear()}},AS=e=>{let t=jS(e),n=e.children||``;return RS(t.runSync(t.parse(n),n),e)},jS=e=>{let t=kS.get(e);if(t)return t;let n=NS(e);return kS.set(e,n),n},MS=e=>e.some(e=>Array.isArray(e)?e[0]===es:e===es),NS=e=>{let t=e.rehypePlugins||ES,n=e.remarkPlugins||ES,r=MS(t)?n:[...n,TS],i=e.remarkRehypeOptions?{...DS,...e.remarkRehypeOptions}:DS;return Pv().use(h_).use(r).use(ov,i).use(t)},PS=e=>e,FS=(e,t,n,r)=>{n?e.children.splice(t,1):e.children[t]={type:`text`,value:r}},IS=(e,t)=>{for(let n in Ag)if(Object.hasOwn(Ag,n)&&Object.hasOwn(e.properties,n)){let r=e.properties[n],i=Ag[n];(i===null||i.includes(e.tagName))&&(e.properties[n]=t(String(r||``),n,e)??void 0)}},LS=(e,t,n,r,i,a)=>{let o=!1;return r?o=!r.includes(e.tagName):i&&(o=i.includes(e.tagName)),!o&&a&&typeof t==`number`&&(o=!a(e,t,n)),o},RS=(e,t)=>{let{allowElement:n,allowedElements:r,disallowedElements:i,skipHtml:a,unwrapDisallowed:o,urlTransform:s}=t;if(n||r||i||a||s){let t=s||PS;Ae(e,(e,s,c)=>{if(e.type===`raw`&&c&&typeof s==`number`)return FS(c,s,a,e.value),s;if(e.type===`element`&&(IS(e,t),LS(e,s,c,r,i,n)&&c&&typeof s==`number`))return o&&e.children?c.children.splice(s,1,...e.children):c.children.splice(s,1),s})}return cg(e,{Fragment:M.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:M.jsx,jsxs:M.jsxs,passKeys:!0,passNode:!0})},zS=/\[\^[\w-]{1,200}\](?!:)/,BS=/\[\^[\w-]{1,200}\]:/,VS=/<(\w+)[\s>]/,HS=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),US=new Map,WS=new Map,GS=e=>{let t=e.toLowerCase(),n=US.get(t);if(n)return n;let r=RegExp(`<${t}(?=[\\s>/])[^>]*>`,`gi`);return US.set(t,r),r},KS=e=>{let t=e.toLowerCase(),n=WS.get(t);if(n)return n;let r=RegExp(`</${t}(?=[\\s>])[^>]*>`,`gi`);return WS.set(t,r),r},qS=(e,t)=>{if(HS.has(t.toLowerCase()))return 0;let n=e.match(GS(t));if(!n)return 0;let r=0;for(let e of n)e.trimEnd().endsWith(`/>`)||(r+=1);return r},JS=(e,t)=>{let n=e.match(KS(t));return n?n.length:0},YS=e=>{let t=0;for(let n=0;n<e.length-1;n+=1)e[n]===`$`&&e[n+1]===`$`&&(t+=1,n+=1);return t},XS=e=>{let t=zS.test(e),n=BS.test(e);if(t||n)return[e];let r=pb.lex(e,{gfm:!0}),i=[],a=[],o=!1;for(let e of r){let t=e.raw,n=i.length;if(a.length>0){i[n-1]+=t;let e=a.at(-1),r=qS(t,e),o=JS(t,e);for(let t=0;t<r;t+=1)a.push(e);for(let t=0;t<o;t+=1)a.length>0&&a.at(-1)===e&&a.pop();continue}if(e.type===`html`&&e.block){let e=t.match(VS);if(e){let n=e[1];qS(t,n)>JS(t,n)&&a.push(n)}}if(n>0&&!o){let e=i[n-1];if(YS(e)%2==1){i[n-1]=e+t;continue}}i.push(t),e.type!==`space`&&(o=e.type===`code`)}return i},ZS=(e,t)=>{if(!t.length)return e;let n=e;for(let e of t){let t=RegExp(`(<${e}(?=[\\s>/])[^>]*>)([\\s\\S]*?)(</${e}\\s*>)`,`gi`);n=n.replace(t,(e,t,n,r)=>{if(!n.includes(`
|
|
122
122
|
|
|
@@ -286,4 +286,4 @@ XID_Start XIDS`.split(/\s/).map(e=>[cA(e),e])),tj=new Map([[`s`,BA(383)],[BA(383
|
|
|
286
286
|
th,td{border:1px solid rgba(255,255,255,.12);padding:.6rem .85rem;text-align:left;font-size:.875rem}
|
|
287
287
|
th{background:rgba(255,255,255,.05);font-weight:600}
|
|
288
288
|
tr:hover td{background:rgba(255,255,255,.03)}
|
|
289
|
-
</style></head><body>${t}</body></html>`),n.document.close())}function TM(e){let t=e.target.closest(`[title="View fullscreen"]`);if(t){e.stopPropagation(),e.preventDefault();let n=t.closest(`[data-streamdown]`)?.querySelector(`table`)??t.closest(`.group`)?.querySelector(`table`);n&&wM(n)}}function EM({role:e,content:t,timestamp:n,hasAttachments:r,audioData:i,attachments:a,onImageClick:o}){let s=e===`user`,c=n?xM(n):``,l=a?.filter(e=>e.mediaType?.startsWith(`image/`))||[],u=a?.filter(e=>!e.mediaType?.startsWith(`image/`))||[],d=l.filter(e=>e.filePath).map(e=>e.filePath.startsWith(`data:`)?e.filePath:`/api/files/${e.filePath}`);return s?i?(0,M.jsxs)(`div`,{className:`flex flex-col items-end gap-0.5`,children:[(0,M.jsxs)(`div`,{className:`group relative max-w-[85%]`,children:[(0,M.jsx)(CM,{text:t}),(0,M.jsx)(`div`,{className:`rounded-2xl px-4 py-2.5 text-sm leading-relaxed bg-primary text-primary-foreground`,children:(0,M.jsx)(bM,{audioData:i})})]}),c&&(0,M.jsx)(`span`,{className:`text-[10px] text-muted-foreground/50 px-1 self-end`,children:c})]}):(0,M.jsxs)(`div`,{className:`flex flex-col items-end gap-0.5`,children:[(0,M.jsxs)(`div`,{className:`group relative max-w-[85%]`,children:[(0,M.jsx)(CM,{text:t}),(0,M.jsxs)(`div`,{className:`rounded-2xl px-4 py-2.5 text-sm leading-relaxed whitespace-pre-wrap bg-primary text-primary-foreground break-words`,children:[d.length>0&&(0,M.jsx)(`div`,{className:`flex gap-1.5 flex-wrap mb-2`,children:d.map((e,t)=>(0,M.jsx)(`img`,{src:e,alt:l[t]?.name||`attachment`,className:`w-28 h-28 rounded-lg object-cover cursor-pointer border border-white/10 hover:opacity-80 transition-opacity`,onClick:()=>o?.(d,t)},t))}),u.length>0&&(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-primary-foreground/60 mr-1.5`,children:[(0,M.jsx)(E,{className:`h-3 w-3`}),u.length>1&&(0,M.jsx)(`span`,{className:`text-xs`,children:u.length})]}),!a?.length&&r&&(0,M.jsx)(`span`,{className:`inline-flex items-center gap-1 text-primary-foreground/60 mr-1.5`,children:(0,M.jsx)(E,{className:`h-3 w-3`})}),t]})]}),c&&(0,M.jsx)(`span`,{className:`text-[10px] text-muted-foreground/50 px-1 self-end`,children:c})]}):(0,M.jsxs)(`div`,{className:`flex flex-col items-start gap-0.5`,children:[(0,M.jsxs)(`div`,{className:`group relative w-full`,children:[(0,M.jsx)(CM,{text:t}),(0,M.jsx)(`div`,{className:`rounded-2xl px-4 py-2.5 text-sm leading-relaxed bg-muted text-foreground prose prose-sm prose-invert max-w-none [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 break-words`,onClickCapture:TM,children:(0,M.jsx)(_C,{mode:`static`,plugins:{code:vM},controls:{code:{copy:!0,download:!1},table:{copy:!0,download:!0,fullscreen:!0}},shikiTheme:[`github-dark`,`github-dark`],lineNumbers:!1,components:{a({href:e,children:t}){return e?.includes(`/api/channels/whatsapp/qr-page`)?(0,M.jsxs)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-3 my-2 px-3.5 py-2.5 rounded-xl bg-[#25D366]/10 border border-[#25D366]/20 hover:bg-[#25D366]/15 transition-colors no-underline`,children:[(0,M.jsx)(`div`,{className:`flex items-center justify-center w-8 h-8 rounded-lg bg-[#25D366] shrink-0`,children:(0,M.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`w-4 h-4 fill-white`,children:(0,M.jsx)(`path`,{d:`M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z`})})}),(0,M.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,M.jsx)(`span`,{className:`text-[#25D366] font-medium text-sm`,children:`Click here to pair your WhatsApp`}),(0,M.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Opens QR code pairing page`})]}),(0,M.jsx)(g,{className:`w-3.5 h-3.5 text-muted-foreground/50 ml-auto shrink-0`})]}):(0,M.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:`text-[#4C89F2] underline decoration-[#4C89F2]/30 underline-offset-2 hover:decoration-[#4C89F2] transition-colors`,children:t})}},children:SM(t)})})]}),c&&(0,M.jsx)(`span`,{className:`text-[10px] text-muted-foreground/50 px-1`,children:c})]})}function DM(e){return{Read:`Reading file`,Write:`Writing file`,Edit:`Editing file`,Bash:`Running command`,Grep:`Searching code`,Glob:`Finding files`,Task:`Running task`,WebFetch:`Fetching URL`,WebSearch:`Searching web`}[e]||`Using ${e}`}function OM({text:e,toolName:t}){return e?(0,M.jsx)(`div`,{className:`flex flex-col items-start`,children:(0,M.jsxs)(`div`,{className:`w-full rounded-2xl px-4 py-2.5 text-sm leading-relaxed bg-muted text-foreground prose prose-sm prose-invert max-w-none [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 break-words`,children:[(0,M.jsx)(_C,{mode:`streaming`,isAnimating:!0,caret:`block`,plugins:{code:vM},controls:!1,shikiTheme:[`github-dark`,`github-dark`],lineNumbers:!1,children:e}),t&&(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 mt-1 text-xs text-muted-foreground`,children:[(0,M.jsx)(`div`,{className:`w-2.5 h-2.5 border-[1.5px] border-muted-foreground/30 border-t-primary rounded-full animate-spin`}),(0,M.jsxs)(`span`,{children:[DM(t),`...`]})]})]})}):(0,M.jsx)(`div`,{className:`flex justify-start`,children:(0,M.jsxs)(`div`,{className:`rounded-2xl px-4 py-2.5 text-sm bg-muted text-foreground`,children:[(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 h-5`,children:[(0,M.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-muted-foreground/60 animate-bounce`,style:{animationDelay:`0ms`}}),(0,M.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-muted-foreground/60 animate-bounce`,style:{animationDelay:`150ms`}}),(0,M.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-muted-foreground/60 animate-bounce`,style:{animationDelay:`300ms`}})]}),t&&(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 mt-1 text-xs text-muted-foreground`,children:[(0,M.jsx)(`div`,{className:`w-2.5 h-2.5 border-[1.5px] border-muted-foreground/30 border-t-primary rounded-full animate-spin`}),(0,M.jsxs)(`span`,{children:[DM(t),`...`]})]})]})})}function kM({images:e,index:t,onClose:n,onNavigate:r}){let i=(0,k.useCallback)(()=>{t>0&&r(t-1)},[t,r]),a=(0,k.useCallback)(()=>{t<e.length-1&&r(t+1)},[t,e.length,r]);return(0,k.useEffect)(()=>{let e=e=>{e.key===`Escape`&&n(),e.key===`ArrowLeft`&&i(),e.key===`ArrowRight`&&a()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n,i,a]),(0,M.jsx)(h,{children:(0,M.jsxs)(f.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`fixed inset-0 z-50 flex items-center justify-center bg-black/90`,onClick:n,children:[(0,M.jsx)(`button`,{onClick:n,className:`absolute top-4 right-4 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 transition-colors text-white`,children:(0,M.jsx)(O,{className:`h-5 w-5`})}),e.length>1&&(0,M.jsxs)(`div`,{className:`absolute top-4 left-1/2 -translate-x-1/2 text-white/70 text-sm tabular-nums`,children:[t+1,` / `,e.length]}),t>0&&(0,M.jsx)(`button`,{onClick:e=>{e.stopPropagation(),i()},className:`absolute left-3 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 transition-colors text-white`,children:(0,M.jsx)(C,{className:`h-6 w-6`})}),t<e.length-1&&(0,M.jsx)(`button`,{onClick:e=>{e.stopPropagation(),a()},className:`absolute right-3 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 transition-colors text-white`,children:(0,M.jsx)(w,{className:`h-6 w-6`})}),(0,M.jsx)(`img`,{src:e[t],alt:``,className:`max-h-[85vh] max-w-[90vw] object-contain rounded-lg`,onClick:e=>e.stopPropagation()})]})})}function AM({messages:e,streaming:t,streamBuffer:n,tools:r,hasMore:i,onLoadOlder:a}){let o=(0,k.useRef)(null),s=(0,k.useRef)(null),c=(0,k.useRef)(null),l=(0,k.useRef)(!0),[u,d]=(0,k.useState)(!1),[f,p]=(0,k.useState)(null),m=(0,k.useCallback)((e,t)=>{p({images:e,index:t})},[]);(0,k.useEffect)(()=>{o.current&&(l.current&&e.length>0?(o.current.scrollIntoView({behavior:`instant`}),l.current=!1):l.current||o.current.scrollIntoView({behavior:`smooth`}))},[e,n,r,t]),(0,k.useEffect)(()=>{if(!c.current||!a)return;let e=c.current,t=new IntersectionObserver(async e=>{if(e[0].isIntersecting&&i&&!u){let e=s.current;if(!e)return;let t=e.scrollHeight;d(!0),await a(),d(!1),requestAnimationFrame(()=>{let n=e.scrollHeight;e.scrollTop+=n-t})}},{root:s.current,threshold:.1});return t.observe(e),()=>t.disconnect()},[i,u,a]);let h=r.length>0?r[r.length-1]:null,g=h?.status===`running`?h.name:void 0;return(0,M.jsxs)(`div`,{ref:s,className:`flex-1 overflow-y-auto overflow-x-hidden p-4 flex flex-col min-h-0`,children:[(0,M.jsx)(`div`,{className:`flex-1`}),i&&(0,M.jsx)(`div`,{ref:c,className:`flex justify-center py-2`,children:u&&(0,M.jsx)(`div`,{className:`w-5 h-5 border-2 border-muted-foreground/20 border-t-muted-foreground/60 rounded-full animate-spin`})}),e.length===0&&!t&&(0,M.jsx)(`div`,{className:`flex items-center justify-center py-8 text-muted-foreground text-sm`,children:`Start a conversation with your Bloby..`}),(0,M.jsxs)(`div`,{className:`space-y-3`,children:[e.map(e=>(0,M.jsx)(EM,{role:e.role,content:e.content,timestamp:e.timestamp,hasAttachments:e.hasAttachments,audioData:e.audioData,attachments:e.attachments,onImageClick:m},e.id)),t&&(0,M.jsx)(OM,{text:n,toolName:g})]}),(0,M.jsx)(`div`,{ref:o}),f&&(0,M.jsx)(kM,{images:f.images,index:f.index,onClose:()=>p(null),onNavigate:e=>p(t=>t?{...t,index:e}:null)})]})}var jM=()=>typeof window>`u`?null:window.SpeechRecognition??window.webkitSpeechRecognition??null,MM=jM()!==null;function NM(){let e=(0,k.useRef)(null),t=(0,k.useRef)(``),n=(0,k.useRef)(null),r=(0,k.useMemo)(()=>MM,[]);return{start:(0,k.useCallback)(()=>{let r=jM();if(!r)return;if(e.current)try{e.current.abort()}catch{}let i=new r;i.continuous=!1,i.interimResults=!0,i.lang=navigator.language||`en-US`,t.current=``,e.current=i,i.onresult=e=>{t.current=e.results[e.results.length-1][0].transcript},i.onend=()=>{e.current=null,n.current&&=(n.current(t.current),null)},i.onerror=r=>{console.error(`[SpeechRecognition] error:`,r.error),e.current=null,n.current&&=(n.current(t.current),null)};try{i.start()}catch(e){console.error(`[SpeechRecognition] start failed:`,e)}},[]),stop:(0,k.useCallback)(()=>new Promise(r=>{let i=e.current;if(!i){r(t.current);return}n.current=r;try{i.stop()}catch{e.current=null,r(t.current),n.current=null}setTimeout(()=>{n.current&&(n.current(t.current),n.current=null,e.current=null)},2e3)}),[]),abort:(0,k.useCallback)(()=>{t.current=``;let r=e.current;if(r){try{r.abort()}catch{}e.current=null}n.current&&=(n.current(``),null)},[]),isSupported:r}}function PM(e){return`${Math.floor(e/60)}:${(e%60).toString().padStart(2,`0`)}`}function FM(e,t=4*1024*1024){return new Promise(n=>{let r=new Image;r.onload=()=>{let e=1600,{width:i,height:a}=r;if(i>e||a>e){let t=Math.min(e/i,e/a);i=Math.round(i*t),a=Math.round(a*t)}let o=document.createElement(`canvas`);o.width=i,o.height=a,o.getContext(`2d`).drawImage(r,0,0,i,a);for(let e of[.8,.6,.4,.3]){let r=o.toDataURL(`image/jpeg`,e);if(Math.round((r.length-23)*.75)<=t){n(r);return}}n(o.toDataURL(`image/jpeg`,.2))},r.onerror=()=>n(e),r.src=e})}var IM=`bloby_draft`;function LM({onSend:e,onStop:t,streaming:n,whisperEnabled:r,onTranscribe:i}){let{start:a,stop:s,abort:c,isSupported:l}=NM(),u=r||l,[d,p]=(0,k.useState)(()=>{try{return localStorage.getItem(IM)||``}catch{return``}}),[m,g]=(0,k.useState)([]),_=(0,k.useRef)(null),[v,y]=(0,k.useState)(!1),[b,x]=(0,k.useState)(0),C=d.trim().length>0,w=C||m.length>0,T=(0,k.useRef)(null),ee=(0,k.useRef)(null),te=(0,k.useRef)(null),ne=(0,k.useRef)(null),re=(0,k.useRef)(null),D=(0,k.useRef)(0),se=(0,k.useRef)(0),ce=(0,k.useRef)(null),le=(0,k.useRef)(!1),ue=(0,k.useRef)(!1),de=(0,k.useRef)(null),A=(0,k.useRef)(null),fe=(0,k.useRef)([]),pe=(0,k.useRef)(null);(0,k.useEffect)(()=>{let e=T.current;e&&(e.style.height=`0px`,e.style.height=`${Math.min(e.scrollHeight,88)}px`)},[d]),(0,k.useEffect)(()=>(_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{try{localStorage.setItem(IM,d)}catch{}},500),()=>{_.current&&clearTimeout(_.current)}),[d]),(0,k.useEffect)(()=>{if(v)return de.current=setInterval(()=>x(e=>e+1),1e3),()=>{de.current&&clearInterval(de.current)}},[v]);let j=(0,k.useCallback)(async t=>{de.current&&clearInterval(de.current),ce.current&&=(clearTimeout(ce.current),null),le.current=!1;let n=A.current,r=pe.current;if(t)r?.getTracks().forEach(e=>e.stop()),A.current=null,pe.current=null,fe.current=[],c();else if(n&&n.state!==`inactive`)n.onstop=async()=>{r?.getTracks().forEach(e=>e.stop());let t=new Blob(fe.current,{type:`audio/webm`});if(fe.current=[],A.current=null,pe.current=null,t.size<1e3)return;let n=new FileReader;n.onloadend=async()=>{let t=n.result,r=t.split(`,`)[1];if(r)try{let n;if(n=i?await i(r):await(await fetch(`/api/whisper/transcribe`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({audio:r})})).json(),n.transcript?.trim()){let r=m.length>0?m:void 0;e(n.transcript.trim(),r,t),r&&g([])}}catch(e){console.error(`[InputBar] Whisper transcription error:`,e)}},n.readAsDataURL(t)},n.stop();else{r?.getTracks().forEach(e=>e.stop()),A.current=null,pe.current=null,fe.current=[];try{let t=await s();if(t.trim()){let n=m.length>0?m:void 0;e(t.trim(),n),n&&g([])}}catch(e){console.error(`[InputBar] Web Speech stop error:`,e)}}re.current&&(re.current.style.transform=``),y(!1),x(0),se.current=0},[e,i,m,r,c,s]),me=(0,k.useCallback)(e=>{let t=e.type.startsWith(`image/`),n=e.type===`application/pdf`;if(!t&&!n)return;let r=new FileReader;r.onload=async n=>{let r=n.target?.result;t&&(r=await FM(r)),g(n=>[...n,{id:Math.random().toString(36).slice(2),type:t?`image`:`file`,name:e.name,preview:r}])},r.readAsDataURL(e)},[]),he=(0,k.useCallback)(e=>{let t=e.target.files;if(t){for(let e=0;e<t.length;e++)me(t[e]);e.target.value=``}},[me]),ge=(0,k.useCallback)(e=>{g(t=>t.filter(t=>t.id!==e))},[]);(0,k.useEffect)(()=>{let e=e=>{if(e.clipboardData?.items){for(let t of e.clipboardData.items)if(t.type.startsWith(`image/`)){e.preventDefault();let n=t.getAsFile();n&&me(n)}}};return document.addEventListener(`paste`,e),()=>document.removeEventListener(`paste`,e)},[me]);let _e=()=>{if(w){e(d,m.length>0?m:void 0),p(``),g([]);try{localStorage.removeItem(IM)}catch{}requestAnimationFrame(()=>T.current?.focus())}},ve=(0,k.useCallback)(e=>{e.preventDefault(),ue.current=!0,D.current=e.clientX,se.current=0,e.currentTarget.setPointerCapture(e.pointerId),ce.current=setTimeout(async()=>{if(u)try{if(r){let e=await navigator.mediaDevices.getUserMedia({audio:!0});if(!ue.current){e.getTracks().forEach(e=>e.stop());return}pe.current=e;let t=MediaRecorder.isTypeSupported(`audio/webm;codecs=opus`)?`audio/webm;codecs=opus`:`audio/webm`,n=new MediaRecorder(e,{mimeType:t});fe.current=[],n.ondataavailable=e=>{e.data.size>0&&fe.current.push(e.data)},A.current=n,n.start()}else if(a(),!ue.current){c();return}le.current=!0,y(!0),x(0)}catch(e){console.error(`[InputBar] recording setup failed:`,e)}},200)},[u,r,a,c]),ye=(0,k.useCallback)(e=>{if(!le.current)return;let t=Math.min(0,e.clientX-D.current);if(se.current=t,re.current&&(re.current.style.transform=`translateX(${t}px)`),ne.current){let t=ne.current.getBoundingClientRect(),n=t.left+t.width/2;Math.abs(e.clientX-n)<36&&j(!0)}},[j]),be=(0,k.useCallback)(()=>{ue.current=!1,ce.current&&=(clearTimeout(ce.current),null),le.current&&j(!1)},[j]),xe=(0,k.useCallback)(()=>{ue.current=!1,ce.current&&=(clearTimeout(ce.current),null),le.current&&j(!0)},[j]);return(0,M.jsxs)(`div`,{className:`shrink-0 p-3 relative`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col transition-opacity duration-100 ${v?`opacity-0 pointer-events-none`:`opacity-100`}`,children:[(0,M.jsx)(h,{children:m.length>0&&(0,M.jsx)(f.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},className:`overflow-hidden`,children:(0,M.jsx)(`div`,{className:`flex gap-2 px-3 pt-2.5 pb-2 flex-wrap bg-white/[0.04] border border-white/[0.08] rounded-2xl mb-2`,children:m.map(e=>(0,M.jsxs)(`div`,{className:`relative group flex-shrink-0`,children:[e.type===`image`?(0,M.jsx)(`img`,{src:e.preview,alt:e.name,className:`w-14 h-14 rounded-lg object-cover border border-white/10`}):(0,M.jsxs)(`div`,{className:`w-14 h-14 rounded-lg bg-white/5 border border-white/10 flex flex-col items-center justify-center gap-0.5 px-1`,children:[(0,M.jsx)(`svg`,{className:`w-5 h-5 text-muted-foreground`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:1.5,children:(0,M.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z`})}),(0,M.jsx)(`span`,{className:`text-[8px] text-muted-foreground truncate w-full text-center`,children:e.name.split(`.`).pop()})]}),(0,M.jsx)(`button`,{onClick:()=>ge(e.id),className:`absolute -top-1.5 -right-1.5 w-4 h-4 bg-black/80 border border-white/20 rounded-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity`,children:(0,M.jsx)(O,{className:`w-2.5 h-2.5 text-white`})})]},e.id))})})}),(0,M.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex-1 flex items-end bg-white rounded-2xl px-4`,children:[(0,M.jsx)(`textarea`,{ref:T,value:d,onChange:e=>p(e.target.value),onKeyDown:e=>{let t=`ontouchstart`in window||navigator.maxTouchPoints>0;e.key===`Enter`&&!e.shiftKey&&!t&&(e.preventDefault(),w&&_e())},placeholder:`Type a message...`,rows:1,className:`flex-1 resize-none bg-transparent text-gray-900 py-3 text-sm outline-none placeholder:text-gray-400 overflow-y-auto`,style:{maxHeight:88}}),(0,M.jsx)(`input`,{ref:ee,type:`file`,className:`hidden`,accept:`image/*,.pdf`,multiple:!0,onChange:he}),(0,M.jsx)(`input`,{ref:te,type:`file`,className:`hidden`,accept:`image/*`,capture:`environment`,onChange:he}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>ee.current?.click(),className:`shrink-0 p-1.5 mb-2 text-gray-400 hover:text-gray-600 transition-colors`,children:(0,M.jsx)(E,{className:`h-4 w-4`})}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>te.current?.click(),className:`shrink-0 p-1.5 mb-2 text-gray-400 hover:text-gray-600 transition-colors`,children:(0,M.jsx)(S,{className:`h-4 w-4`})})]}),n?(0,M.jsx)(`button`,{onClick:t,className:`flex items-center justify-center h-12 w-12 shrink-0 rounded-full bg-destructive text-destructive-foreground transition-colors`,children:(0,M.jsx)(ae,{className:`h-4 w-4`})}):C?(0,M.jsx)(`button`,{onClick:_e,className:`flex items-center justify-center h-12 w-12 shrink-0 rounded-full bg-white text-gray-900 transition-colors hover:bg-gray-100`,children:(0,M.jsx)(ie,{className:`h-4 w-4`})}):(0,M.jsx)(`div`,{className:`flex items-center justify-center h-12 w-12 shrink-0 rounded-full transition-colors touch-none select-none ${u?`bg-gradient-brand text-white cursor-pointer`:`bg-gray-200 text-gray-400 cursor-default`}`,title:u?void 0:`Voice input requires Chrome, Edge, or Safari. Enable Whisper in Settings for any browser.`,onPointerDown:u?ve:void 0,onPointerMove:u?ye:void 0,onPointerUp:u?be:void 0,onPointerCancel:u?xe:void 0,children:(0,M.jsx)(o,{className:`h-4 w-4`})})]})]}),(0,M.jsx)(h,{children:v&&(0,M.jsx)(f.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},className:`absolute inset-0 p-3 flex items-center touch-none`,children:(0,M.jsxs)(`div`,{className:`flex items-center w-full gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,M.jsxs)(`span`,{className:`relative flex h-2 w-2 shrink-0`,children:[(0,M.jsx)(`span`,{className:`animate-ping absolute inline-flex h-full w-full rounded-full bg-destructive opacity-75`}),(0,M.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-destructive`})]}),(0,M.jsx)(`span`,{className:`text-sm font-medium tabular-nums`,children:PM(b)})]}),(0,M.jsxs)(`div`,{className:`flex-1 flex items-center bg-muted rounded-full h-12 pl-1 pr-0.5`,children:[(0,M.jsx)(`div`,{ref:ne,className:`flex items-center justify-center h-9 w-9 shrink-0 rounded-full bg-destructive/10 text-destructive`,children:(0,M.jsx)(oe,{className:`h-4 w-4`})}),(0,M.jsx)(`div`,{className:`flex-1 flex justify-center min-w-0`,children:(0,M.jsx)(f.span,{className:`text-[13px] whitespace-nowrap select-none font-medium`,style:{backgroundImage:`linear-gradient(90deg, #999 0%, #999 35%, #fff 50%, #999 65%, #999 100%)`,backgroundSize:`200% 100%`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},animate:{backgroundPosition:[`200% center`,`-200% center`]},transition:{duration:2.5,repeat:1/0,ease:`linear`},children:`◄◄ slide to cancel`})}),(0,M.jsx)(`div`,{ref:re,className:`shrink-0 touch-none select-none will-change-transform`,style:{transition:`none`},onPointerDown:ve,onPointerMove:ye,onPointerUp:be,onPointerCancel:xe,children:(0,M.jsx)(`div`,{className:`flex items-center justify-center h-11 w-11 rounded-full bg-destructive text-destructive-foreground`,children:(0,M.jsx)(o,{className:`h-5 w-5`})})})]})]})})})]})}function RM(){let e=(0,k.useRef)(null),[t,n]=(0,k.useState)(!1),[r,i]=(0,k.useState)(`Bloby`),[a,o]=(0,k.useState)(!1),[s,l]=(0,k.useState)(!1),[u,d]=(0,k.useState)(!1),[f,p]=(0,k.useState)(0),m=(0,k.useRef)(null),h=(0,k.useRef)(!1),[g,v]=(0,k.useState)(!0),[S,C]=(0,k.useState)(null),[w,te]=(0,k.useState)(`loading`);function E(e){let t=(e+`=`.repeat((4-e.length%4)%4)).replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}async function ne(){try{if(await Notification.requestPermission()!==`granted`){te(`denied`);return}let t=await navigator.serviceWorker.ready,{publicKey:n}=await(await fetch(`/api/push/vapid-public-key`)).json(),r=(await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:E(n)})).toJSON(),i=e.current;i&&i.send(`push:subscribe`,{endpoint:r.endpoint,keys:r.keys}),te(`subscribed`)}catch(e){console.error(`[push] Subscribe failed:`,e)}}async function re(){try{let t=await(await navigator.serviceWorker.ready).pushManager.getSubscription();if(t){let n=t.endpoint;await t.unsubscribe();let r=e.current;r&&r.send(`push:unsubscribe`,{endpoint:n})}te(`unsubscribed`)}catch(e){console.error(`[push] Unsubscribe failed:`,e)}}let[ie,ae]=(0,k.useState)(!1),oe=/iPad|iPhone|iPod/.test(navigator.userAgent),ce=window.matchMedia(`(display-mode: standalone)`).matches||navigator.standalone,ue=/Android|iPhone|iPad|iPod|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),de=window.self!==window.top;(0,k.useEffect)(()=>{let e=e=>{e.data?.type===`bloby:show-ios-install`&&ae(!0)};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[]);let[ge,ve]=(0,k.useState)(!1),[ye,be]=(0,k.useState)(!1),[xe,Se]=(0,k.useState)(!1),[Ce,we]=(0,k.useState)(!1);(0,k.useEffect)(()=>{(async()=>{try{let e=await(await fetch(`/api/onboard/status`)).json();if(e.totpEnabled&&we(!0),!e.portalConfigured){be(!1),Se(!0),ve(!0);return}be(!0);let t=A();if(t){if((await(await fetch(`/api/portal/validate-token?token=${encodeURIComponent(t)}`)).json()).valid){Se(!0),ve(!0);return}pe()}Se(!1),ve(!0)}catch{Se(!0),ve(!0)}})()},[]);let Te=e=>{fe(e),Se(!0)};(0,k.useEffect)(()=>{j(()=>{Se(!1),be(!0)})},[]),(0,k.useEffect)(()=>{if(!xe)return;let e=()=>{fetch(`/app/api/health`).then(e=>v(e.ok)).catch(()=>v(!1))};e();let t=setInterval(e,1e4);return()=>clearInterval(t)},[xe]),(0,k.useEffect)(()=>{xe&&(async()=>{if(!(`PushManager`in window)||!(`serviceWorker`in navigator)){te(`unsupported`);return}if(Notification.permission===`denied`){te(`denied`);return}try{let e=await(await navigator.serviceWorker.ready).pushManager.getSubscription();te(e&&(await(await fetch(`/api/push/status?endpoint=${encodeURIComponent(e.endpoint)}`)).json()).subscribed?`subscribed`:`unsubscribed`)}catch{te(`unsupported`)}})()},[xe]),(0,k.useEffect)(()=>{if(!xe)return;let t=location.protocol===`https:`?`wss:`:`ws:`,r=location.host,i=new le(`${t}//${r}/bloby/ws`,A);e.current=i;let a=i.onStatus(e=>{n(e),e&&h.current&&p(e=>e+1),h.current=e}),o=i.on(`app:rebuilding`,()=>{window.parent?.postMessage({type:`bloby:rebuilding`},`*`)}),s=i.on(`app:rebuilt`,()=>{window.parent?.postMessage({type:`bloby:rebuilt`},`*`)}),c=i.on(`app:build-error`,e=>{window.parent?.postMessage({type:`bloby:build-error`,error:e.error},`*`)}),l=i.on(`app:hmr-update`,()=>{window.parent?.postMessage({type:`bloby:hmr-update`},`*`)});return i.connect(),()=>{a(),o(),s(),c(),l(),i.disconnect()}},[xe]),(0,k.useEffect)(()=>{xe&&(me(`/api/settings`).then(e=>e.json()).then(e=>{e.agent_name&&i(e.agent_name),e.whisper_enabled===`true`&&o(!0)}).catch(()=>{}),me(`/api/wallet/balance`).then(e=>e.json()).then(e=>{e.address&&C(e.balance)}).catch(()=>{}))},[xe]),(0,k.useEffect)(()=>{if(!s)return;let e=e=>{m.current&&!m.current.contains(e.target)&&l(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s]);let{messages:Ee,streaming:De,streamBuffer:Oe,tools:ke,hasMore:Ae,loadOlder:je,sendMessage:Me,stopStreaming:Ne,clearContext:Pe}=he(e.current,f,xe);return(0,k.useEffect)(()=>{let t=async t=>{if(t.data?.type!==`bloby:voice-record`)return;let{audio:n,transcript:r}=t.data;if(n&&a){let t=e.current;if(!t?.connected)return;try{let e=await new Promise((e,r)=>{let i=t.on(`whisper:result`,t=>{i(),clearTimeout(a),e(t)}),a=setTimeout(()=>{i(),r(Error(`Timeout`))},3e4);t.send(`whisper:transcribe`,{audio:n})});e.transcript?.trim()&&Me(e.transcript.trim(),void 0,`data:audio/webm;base64,${n}`)}catch(e){console.error(`[BlobyApp] widget voice transcription error:`,e)}}else r?.trim()&&Me(r.trim())};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)},[Me,a]),ge?ye&&!xe?(0,M.jsx)(_e,{onLogin:Te,totpEnabled:Ce}):(0,M.jsxs)(`div`,{className:`flex flex-col h-dvh overflow-hidden`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 border-b border-border shrink-0`,children:[(0,M.jsx)(`button`,{onClick:()=>window.parent?.postMessage({type:`bloby:close`},`*`),className:`flex items-center justify-center h-7 w-7 -ml-1 rounded-full text-muted-foreground hover:text-foreground hover:bg-white/[0.06] transition-colors`,"aria-label":`Close chat`,children:(0,M.jsx)(c,{className:`h-5 w-5`})}),(0,M.jsx)(`img`,{src:`/bloby.png`,alt:r,className:`h-5 w-auto`}),(0,M.jsx)(`span`,{className:`text-sm font-semibold`,children:r}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-muted-foreground ml-1`,children:[(0,M.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,M.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${t?`bg-green-500`:`bg-red-500`}`}),`Chat`]}),(0,M.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,M.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${g?`bg-green-500`:`bg-orange-400 animate-pulse`}`}),`Workspace`]})]}),S!==null&&(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-full bg-white/[0.06] border border-border px-2.5 py-1`,children:[(0,M.jsxs)(`span`,{className:`text-[11px] text-muted-foreground font-mono`,children:[`$`,S]}),(0,M.jsx)(`a`,{href:`https://www.bloby.bot/marketplace`,target:`_blank`,rel:`noopener noreferrer`,className:`text-[11px] font-medium text-blue-400 hover:text-blue-300 transition-colors`,children:`Add`})]}),(0,M.jsx)(`div`,{className:`flex-1`}),(0,M.jsxs)(`div`,{className:`flex items-center gap-1`,children:[w!==`loading`&&w!==`unsupported`&&(0,M.jsx)(`button`,{onClick:()=>{w===`subscribed`?re():w===`unsubscribed`&&ne()},disabled:w===`denied`,className:`flex items-center justify-center h-7 w-7 rounded-full text-muted-foreground hover:text-foreground hover:bg-white/[0.06] transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,title:w===`denied`?`Notifications blocked — enable in browser settings`:w===`subscribed`?`Disable push notifications`:`Enable push notifications`,children:w===`denied`?(0,M.jsx)(y,{className:`h-4 w-4`}):w===`subscribed`?(0,M.jsx)(b,{className:`h-4 w-4 text-blue-400`}):(0,M.jsx)(x,{className:`h-4 w-4`})}),(0,M.jsxs)(`div`,{className:`relative`,ref:m,children:[(0,M.jsx)(`button`,{onClick:()=>l(e=>!e),className:`flex items-center justify-center h-7 w-7 rounded-full text-muted-foreground hover:text-foreground hover:bg-white/[0.06] transition-colors`,children:(0,M.jsx)(ee,{className:`h-4 w-4`})}),s&&(0,M.jsxs)(`div`,{className:`absolute right-0 top-full mt-1 min-w-[160px] rounded-md border border-border bg-popover py-1 shadow-lg z-50`,children:[(0,M.jsxs)(`button`,{onClick:()=>{d(!0),l(!1)},className:`flex w-full items-center gap-2 px-3 py-2 text-sm text-muted-foreground hover:text-foreground hover:bg-white/[0.06] transition-colors`,children:[(0,M.jsx)(se,{className:`h-4 w-4`}),`Settings`]}),ue&&!ce&&(0,M.jsxs)(`button`,{onClick:()=>{l(!1),de?window.parent.postMessage({type:`bloby:install-app`},`*`):ae(!0)},className:`flex w-full items-center gap-2 px-3 py-2 text-sm text-muted-foreground hover:text-foreground hover:bg-white/[0.06] transition-colors`,children:[(0,M.jsx)(T,{className:`h-4 w-4`}),`Install App`]})]})]})]})]}),(0,M.jsxs)(`div`,{className:`flex-1 min-h-0 flex flex-col overflow-hidden`,children:[(0,M.jsx)(AM,{messages:Ee,streaming:De,streamBuffer:Oe,tools:ke,hasMore:Ae,onLoadOlder:je}),(0,M.jsx)(LM,{onSend:Me,onStop:Ne,streaming:De,whisperEnabled:a,onTranscribe:t=>new Promise((n,r)=>{let i=e.current;if(!i?.connected){r(Error(`WebSocket not connected`));return}let a=i.on(`whisper:result`,e=>{a(),clearTimeout(o),n(e)}),o=setTimeout(()=>{a(),r(Error(`Transcription timeout`))},3e4);i.send(`whisper:transcribe`,{audio:t})})})]}),u&&(0,M.jsx)(_,{onSave:t=>new Promise((n,r)=>{let i=e.current;if(!i?.connected){r(Error(`WebSocket not connected`));return}let a=i.on(`settings:saved`,e=>{a(),clearTimeout(s),n(e)}),o=i.on(`settings:save-error`,e=>{o(),clearTimeout(s),r(Error(e.error||`Save failed`))}),s=setTimeout(()=>{a(),o(),r(Error(`Save timeout`))},1e4);i.send(`settings:save`,t)}),onTunnelSwitch:t=>new Promise((n,r)=>{let i=e.current;if(!i?.connected){r(Error(`Not connected`));return}let a=i.on(`tunnel:switched`,e=>{a(),o(),clearTimeout(s),n(e)}),o=i.on(`tunnel:switch-error`,e=>{a(),o(),clearTimeout(s),r(Error(e.error))}),s=setTimeout(()=>{a(),o(),r(Error(`Timeout`))},3e4);i.send(`tunnel:switch`,{mode:t})}),onComplete:()=>{d(!1),me(`/api/settings`).then(e=>e.json()).then(e=>{e.agent_name&&i(e.agent_name),o(e.whisper_enabled===`true`)}).catch(()=>{}),window.parent?.postMessage({type:`bloby:onboard-complete`},`*`)}}),ie&&(0,M.jsxs)(`div`,{className:`fixed inset-0 z-[300] flex items-end sm:items-center justify-center p-4`,children:[(0,M.jsx)(`div`,{className:`absolute inset-0 bg-black/60 backdrop-blur-sm`,onClick:()=>ae(!1)}),(0,M.jsxs)(`div`,{className:`relative w-full max-w-[360px] bg-[#1c1c1e] border border-white/[0.08] rounded-2xl shadow-2xl overflow-hidden`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between px-5 pt-5 pb-2`,children:[(0,M.jsx)(`h2`,{className:`text-[17px] font-semibold text-white`,children:`Install App`}),(0,M.jsx)(`button`,{onClick:()=>ae(!1),className:`h-7 w-7 rounded-full bg-white/[0.08] flex items-center justify-center text-white/50 hover:text-white/80 transition-colors`,children:(0,M.jsx)(O,{className:`h-4 w-4`})})]}),(0,M.jsxs)(`div`,{className:`px-5 pb-6 pt-1`,children:[(0,M.jsx)(`p`,{className:`text-white/50 text-[13px] mb-5 leading-relaxed`,children:`Add Bloby to your home screen for a full-screen app experience.`}),oe?(0,M.jsxs)(`div`,{className:`space-y-3.5`,children:[(0,M.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,M.jsx)(`span`,{className:`flex-shrink-0 w-7 h-7 rounded-full bg-[#007AFF]/15 text-[#007AFF] text-[13px] font-semibold flex items-center justify-center mt-0.5`,children:`1`}),(0,M.jsxs)(`div`,{className:`flex-1`,children:[(0,M.jsx)(`p`,{className:`text-white text-[14px] font-medium`,children:`Tap the Share button`}),(0,M.jsxs)(`p`,{className:`text-white/40 text-[12px] mt-0.5 flex items-center gap-1.5`,children:[`The `,(0,M.jsx)(D,{className:`h-3.5 w-3.5 inline`}),` icon at the bottom of Safari`]})]})]}),(0,M.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,M.jsx)(`span`,{className:`flex-shrink-0 w-7 h-7 rounded-full bg-[#007AFF]/15 text-[#007AFF] text-[13px] font-semibold flex items-center justify-center mt-0.5`,children:`2`}),(0,M.jsxs)(`div`,{className:`flex-1`,children:[(0,M.jsx)(`p`,{className:`text-white text-[14px] font-medium`,children:`Scroll down and tap`}),(0,M.jsx)(`p`,{className:`text-white/40 text-[12px] mt-0.5`,children:`"Add to Home Screen"`})]})]}),(0,M.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,M.jsx)(`span`,{className:`flex-shrink-0 w-7 h-7 rounded-full bg-[#007AFF]/15 text-[#007AFF] text-[13px] font-semibold flex items-center justify-center mt-0.5`,children:`3`}),(0,M.jsxs)(`div`,{className:`flex-1`,children:[(0,M.jsx)(`p`,{className:`text-white text-[14px] font-medium`,children:`Tap "Add"`}),(0,M.jsx)(`p`,{className:`text-white/40 text-[12px] mt-0.5`,children:`Bloby will appear on your home screen`})]})]})]}):(0,M.jsxs)(`div`,{className:`space-y-3.5`,children:[(0,M.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,M.jsx)(`span`,{className:`flex-shrink-0 w-7 h-7 rounded-full bg-[#007AFF]/15 text-[#007AFF] text-[13px] font-semibold flex items-center justify-center mt-0.5`,children:`1`}),(0,M.jsxs)(`div`,{className:`flex-1`,children:[(0,M.jsx)(`p`,{className:`text-white text-[14px] font-medium`,children:`Open browser menu`}),(0,M.jsx)(`p`,{className:`text-white/40 text-[12px] mt-0.5`,children:`Tap the three-dot menu in your browser`})]})]}),(0,M.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,M.jsx)(`span`,{className:`flex-shrink-0 w-7 h-7 rounded-full bg-[#007AFF]/15 text-[#007AFF] text-[13px] font-semibold flex items-center justify-center mt-0.5`,children:`2`}),(0,M.jsxs)(`div`,{className:`flex-1`,children:[(0,M.jsx)(`p`,{className:`text-white text-[14px] font-medium`,children:`Tap "Install app" or "Add to Home screen"`}),(0,M.jsx)(`p`,{className:`text-white/40 text-[12px] mt-0.5`,children:`Bloby will be installed as a standalone app`})]})]})]}),(0,M.jsx)(`button`,{onClick:()=>ae(!1),className:`w-full mt-5 py-2.5 bg-white/[0.06] hover:bg-white/[0.1] text-white text-[14px] font-medium rounded-xl transition-colors`,children:`Got it`})]})]})]})]}):(0,M.jsx)(`div`,{className:`flex items-center justify-center h-dvh`,children:(0,M.jsx)(`div`,{className:`w-6 h-6 border-2 border-white/10 border-t-white/50 rounded-full animate-spin`})})}ce.createRoot(document.getElementById(`root`)).render((0,M.jsx)(k.StrictMode,{children:(0,M.jsx)(RM,{})}));export{yC as i,xx as n,hC as r,qb as t};
|
|
289
|
+
</style></head><body>${t}</body></html>`),n.document.close())}function TM(e){let t=e.target.closest(`[title="View fullscreen"]`);if(t){e.stopPropagation(),e.preventDefault();let n=t.closest(`[data-streamdown]`)?.querySelector(`table`)??t.closest(`.group`)?.querySelector(`table`);n&&wM(n)}}function EM({role:e,content:t,timestamp:n,hasAttachments:r,audioData:i,attachments:a,onImageClick:o}){let s=e===`user`,c=n?xM(n):``,l=a?.filter(e=>e.mediaType?.startsWith(`image/`))||[],u=a?.filter(e=>!e.mediaType?.startsWith(`image/`))||[],d=l.filter(e=>e.filePath).map(e=>e.filePath.startsWith(`data:`)?e.filePath:`/api/files/${e.filePath}`);return s?i?(0,M.jsxs)(`div`,{className:`flex flex-col items-end gap-0.5`,children:[(0,M.jsxs)(`div`,{className:`group relative max-w-[85%]`,children:[(0,M.jsx)(CM,{text:t}),(0,M.jsx)(`div`,{className:`rounded-2xl px-4 py-2.5 text-sm leading-relaxed bg-primary text-primary-foreground`,children:(0,M.jsx)(bM,{audioData:i})})]}),c&&(0,M.jsx)(`span`,{className:`text-[10px] text-muted-foreground/50 px-1 self-end`,children:c})]}):(0,M.jsxs)(`div`,{className:`flex flex-col items-end gap-0.5`,children:[(0,M.jsxs)(`div`,{className:`group relative max-w-[85%]`,children:[(0,M.jsx)(CM,{text:t}),(0,M.jsxs)(`div`,{className:`rounded-2xl px-4 py-2.5 text-sm leading-relaxed whitespace-pre-wrap bg-primary text-primary-foreground break-words`,children:[d.length>0&&(0,M.jsx)(`div`,{className:`flex gap-1.5 flex-wrap mb-2`,children:d.map((e,t)=>(0,M.jsx)(`img`,{src:e,alt:l[t]?.name||`attachment`,className:`w-28 h-28 rounded-lg object-cover cursor-pointer border border-white/10 hover:opacity-80 transition-opacity`,onClick:()=>o?.(d,t)},t))}),u.length>0&&(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-primary-foreground/60 mr-1.5`,children:[(0,M.jsx)(E,{className:`h-3 w-3`}),u.length>1&&(0,M.jsx)(`span`,{className:`text-xs`,children:u.length})]}),!a?.length&&r&&(0,M.jsx)(`span`,{className:`inline-flex items-center gap-1 text-primary-foreground/60 mr-1.5`,children:(0,M.jsx)(E,{className:`h-3 w-3`})}),t]})]}),c&&(0,M.jsx)(`span`,{className:`text-[10px] text-muted-foreground/50 px-1 self-end`,children:c})]}):(0,M.jsxs)(`div`,{className:`flex flex-col items-start gap-0.5`,children:[(0,M.jsxs)(`div`,{className:`group relative w-full`,children:[(0,M.jsx)(CM,{text:t}),(0,M.jsx)(`div`,{className:`rounded-2xl px-4 py-2.5 text-sm leading-relaxed bg-muted text-foreground prose prose-sm prose-invert max-w-none [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 break-words`,onClickCapture:TM,children:(0,M.jsx)(_C,{mode:`static`,plugins:{code:vM},controls:{code:{copy:!0,download:!1},table:{copy:!0,download:!0,fullscreen:!0}},shikiTheme:[`github-dark`,`github-dark`],lineNumbers:!1,components:{a({href:e,children:t}){return e?.includes(`/api/channels/whatsapp/qr-page`)?(0,M.jsxs)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-3 my-2 px-3.5 py-2.5 rounded-xl bg-[#25D366]/10 border border-[#25D366]/20 hover:bg-[#25D366]/15 transition-colors no-underline`,children:[(0,M.jsx)(`div`,{className:`flex items-center justify-center w-8 h-8 rounded-lg bg-[#25D366] shrink-0`,children:(0,M.jsx)(`svg`,{viewBox:`0 0 24 24`,className:`w-4 h-4 fill-white`,children:(0,M.jsx)(`path`,{d:`M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z`})})}),(0,M.jsxs)(`div`,{className:`flex flex-col min-w-0`,children:[(0,M.jsx)(`span`,{className:`text-[#25D366] font-medium text-sm`,children:`Click here to pair your WhatsApp`}),(0,M.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Opens QR code pairing page`})]}),(0,M.jsx)(g,{className:`w-3.5 h-3.5 text-muted-foreground/50 ml-auto shrink-0`})]}):(0,M.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:`text-[#4C89F2] underline decoration-[#4C89F2]/30 underline-offset-2 hover:decoration-[#4C89F2] transition-colors`,children:t})}},children:SM(t)})})]}),c&&(0,M.jsx)(`span`,{className:`text-[10px] text-muted-foreground/50 px-1`,children:c})]})}function DM(e){return{Read:`Reading file`,Write:`Writing file`,Edit:`Editing file`,Bash:`Running command`,Grep:`Searching code`,Glob:`Finding files`,Task:`Running task`,WebFetch:`Fetching URL`,WebSearch:`Searching web`}[e]||`Using ${e}`}function OM({text:e,toolName:t}){return e?(0,M.jsx)(`div`,{className:`flex flex-col items-start`,children:(0,M.jsxs)(`div`,{className:`w-full rounded-2xl px-4 py-2.5 text-sm leading-relaxed bg-muted text-foreground prose prose-sm prose-invert max-w-none [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 break-words`,children:[(0,M.jsx)(_C,{mode:`streaming`,isAnimating:!0,caret:`block`,plugins:{code:vM},controls:!1,shikiTheme:[`github-dark`,`github-dark`],lineNumbers:!1,children:e}),t&&(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 mt-1 text-xs text-muted-foreground`,children:[(0,M.jsx)(`div`,{className:`w-2.5 h-2.5 border-[1.5px] border-muted-foreground/30 border-t-primary rounded-full animate-spin`}),(0,M.jsxs)(`span`,{children:[DM(t),`...`]})]})]})}):(0,M.jsx)(`div`,{className:`flex justify-start`,children:(0,M.jsxs)(`div`,{className:`rounded-2xl px-4 py-2.5 text-sm bg-muted text-foreground`,children:[(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 h-5`,children:[(0,M.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-muted-foreground/60 animate-bounce`,style:{animationDelay:`0ms`}}),(0,M.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-muted-foreground/60 animate-bounce`,style:{animationDelay:`150ms`}}),(0,M.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-muted-foreground/60 animate-bounce`,style:{animationDelay:`300ms`}})]}),t&&(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 mt-1 text-xs text-muted-foreground`,children:[(0,M.jsx)(`div`,{className:`w-2.5 h-2.5 border-[1.5px] border-muted-foreground/30 border-t-primary rounded-full animate-spin`}),(0,M.jsxs)(`span`,{children:[DM(t),`...`]})]})]})})}function kM({images:e,index:t,onClose:n,onNavigate:r}){let i=(0,k.useCallback)(()=>{t>0&&r(t-1)},[t,r]),a=(0,k.useCallback)(()=>{t<e.length-1&&r(t+1)},[t,e.length,r]);return(0,k.useEffect)(()=>{let e=e=>{e.key===`Escape`&&n(),e.key===`ArrowLeft`&&i(),e.key===`ArrowRight`&&a()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n,i,a]),(0,M.jsx)(h,{children:(0,M.jsxs)(f.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:`fixed inset-0 z-50 flex items-center justify-center bg-black/90`,onClick:n,children:[(0,M.jsx)(`button`,{onClick:n,className:`absolute top-4 right-4 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 transition-colors text-white`,children:(0,M.jsx)(O,{className:`h-5 w-5`})}),e.length>1&&(0,M.jsxs)(`div`,{className:`absolute top-4 left-1/2 -translate-x-1/2 text-white/70 text-sm tabular-nums`,children:[t+1,` / `,e.length]}),t>0&&(0,M.jsx)(`button`,{onClick:e=>{e.stopPropagation(),i()},className:`absolute left-3 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 transition-colors text-white`,children:(0,M.jsx)(C,{className:`h-6 w-6`})}),t<e.length-1&&(0,M.jsx)(`button`,{onClick:e=>{e.stopPropagation(),a()},className:`absolute right-3 top-1/2 -translate-y-1/2 z-10 p-2 rounded-full bg-white/10 hover:bg-white/20 transition-colors text-white`,children:(0,M.jsx)(w,{className:`h-6 w-6`})}),(0,M.jsx)(`img`,{src:e[t],alt:``,className:`max-h-[85vh] max-w-[90vw] object-contain rounded-lg`,onClick:e=>e.stopPropagation()})]})})}function AM({messages:e,streaming:t,streamBuffer:n,tools:r,hasMore:i,onLoadOlder:a}){let o=(0,k.useRef)(null),s=(0,k.useRef)(null),c=(0,k.useRef)(null),l=(0,k.useRef)(!0),[u,d]=(0,k.useState)(!1),[f,p]=(0,k.useState)(null),m=(0,k.useCallback)((e,t)=>{p({images:e,index:t})},[]);(0,k.useEffect)(()=>{o.current&&(l.current&&e.length>0?(o.current.scrollIntoView({behavior:`instant`}),l.current=!1):l.current||o.current.scrollIntoView({behavior:`smooth`}))},[e,n,r,t]),(0,k.useEffect)(()=>{if(!c.current||!a)return;let e=c.current,t=new IntersectionObserver(async e=>{if(e[0].isIntersecting&&i&&!u){let e=s.current;if(!e)return;let t=e.scrollHeight;d(!0),await a(),d(!1),requestAnimationFrame(()=>{let n=e.scrollHeight;e.scrollTop+=n-t})}},{root:s.current,threshold:.1});return t.observe(e),()=>t.disconnect()},[i,u,a]);let h=r.length>0?r[r.length-1]:null,g=h?.status===`running`?h.name:void 0;return(0,M.jsxs)(`div`,{ref:s,className:`flex-1 overflow-y-auto overflow-x-hidden p-4 flex flex-col min-h-0`,children:[(0,M.jsx)(`div`,{className:`flex-1`}),i&&(0,M.jsx)(`div`,{ref:c,className:`flex justify-center py-2`,children:u&&(0,M.jsx)(`div`,{className:`w-5 h-5 border-2 border-muted-foreground/20 border-t-muted-foreground/60 rounded-full animate-spin`})}),e.length===0&&!t&&(0,M.jsx)(`div`,{className:`flex items-center justify-center py-8 text-muted-foreground text-sm`,children:`Start a conversation with your Bloby..`}),(0,M.jsxs)(`div`,{className:`space-y-3`,children:[e.map(e=>(0,M.jsx)(EM,{role:e.role,content:e.content,timestamp:e.timestamp,hasAttachments:e.hasAttachments,audioData:e.audioData,attachments:e.attachments,onImageClick:m},e.id)),t&&(0,M.jsx)(OM,{text:n,toolName:g})]}),(0,M.jsx)(`div`,{ref:o}),f&&(0,M.jsx)(kM,{images:f.images,index:f.index,onClose:()=>p(null),onNavigate:e=>p(t=>t?{...t,index:e}:null)})]})}var jM=()=>typeof window>`u`?null:window.SpeechRecognition??window.webkitSpeechRecognition??null,MM=jM()!==null;function NM(){let e=(0,k.useRef)(null),t=(0,k.useRef)(``),n=(0,k.useRef)(null),r=(0,k.useMemo)(()=>MM,[]);return{start:(0,k.useCallback)(()=>{let r=jM();if(!r)return;if(e.current)try{e.current.abort()}catch{}let i=new r;i.continuous=!1,i.interimResults=!0,i.lang=navigator.language||`en-US`,t.current=``,e.current=i,i.onresult=e=>{t.current=e.results[e.results.length-1][0].transcript},i.onend=()=>{e.current=null,n.current&&=(n.current(t.current),null)},i.onerror=r=>{console.error(`[SpeechRecognition] error:`,r.error),e.current=null,n.current&&=(n.current(t.current),null)};try{i.start()}catch(e){console.error(`[SpeechRecognition] start failed:`,e)}},[]),stop:(0,k.useCallback)(()=>new Promise(r=>{let i=e.current;if(!i){r(t.current);return}n.current=r;try{i.stop()}catch{e.current=null,r(t.current),n.current=null}setTimeout(()=>{n.current&&(n.current(t.current),n.current=null,e.current=null)},2e3)}),[]),abort:(0,k.useCallback)(()=>{t.current=``;let r=e.current;if(r){try{r.abort()}catch{}e.current=null}n.current&&=(n.current(``),null)},[]),isSupported:r}}function PM(e){return`${Math.floor(e/60)}:${(e%60).toString().padStart(2,`0`)}`}function FM(e,t=4*1024*1024){return new Promise(n=>{let r=new Image;r.onload=()=>{let e=1600,{width:i,height:a}=r;if(i>e||a>e){let t=Math.min(e/i,e/a);i=Math.round(i*t),a=Math.round(a*t)}let o=document.createElement(`canvas`);o.width=i,o.height=a,o.getContext(`2d`).drawImage(r,0,0,i,a);for(let e of[.8,.6,.4,.3]){let r=o.toDataURL(`image/jpeg`,e);if(Math.round((r.length-23)*.75)<=t){n(r);return}}n(o.toDataURL(`image/jpeg`,.2))},r.onerror=()=>n(e),r.src=e})}var IM=`bloby_draft`;function LM({onSend:e,onStop:t,streaming:n,whisperEnabled:r,onTranscribe:i}){let{start:a,stop:s,abort:c,isSupported:l}=NM(),u=r||l,[d,p]=(0,k.useState)(()=>{try{return localStorage.getItem(IM)||``}catch{return``}}),[m,g]=(0,k.useState)([]),_=(0,k.useRef)(null),[v,y]=(0,k.useState)(!1),[b,x]=(0,k.useState)(0),C=d.trim().length>0,w=C||m.length>0,T=(0,k.useRef)(null),ee=(0,k.useRef)(null),te=(0,k.useRef)(null),ne=(0,k.useRef)(null),re=(0,k.useRef)(null),D=(0,k.useRef)(0),se=(0,k.useRef)(0),ce=(0,k.useRef)(null),le=(0,k.useRef)(!1),ue=(0,k.useRef)(!1),de=(0,k.useRef)(null),A=(0,k.useRef)(null),fe=(0,k.useRef)([]),pe=(0,k.useRef)(null);(0,k.useEffect)(()=>{let e=T.current;e&&(e.style.height=`0px`,e.style.height=`${Math.min(e.scrollHeight,88)}px`)},[d]),(0,k.useEffect)(()=>(_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{try{localStorage.setItem(IM,d)}catch{}},500),()=>{_.current&&clearTimeout(_.current)}),[d]),(0,k.useEffect)(()=>{if(v)return de.current=setInterval(()=>x(e=>e+1),1e3),()=>{de.current&&clearInterval(de.current)}},[v]);let j=(0,k.useCallback)(async t=>{de.current&&clearInterval(de.current),ce.current&&=(clearTimeout(ce.current),null),le.current=!1;let n=A.current,r=pe.current;if(t)r?.getTracks().forEach(e=>e.stop()),A.current=null,pe.current=null,fe.current=[],c();else if(n&&n.state!==`inactive`)n.onstop=async()=>{r?.getTracks().forEach(e=>e.stop());let t=new Blob(fe.current,{type:`audio/webm`});if(fe.current=[],A.current=null,pe.current=null,t.size<1e3)return;let n=new FileReader;n.onloadend=async()=>{let t=n.result,r=t.split(`,`)[1];if(r)try{let n;if(n=i?await i(r):await(await fetch(`/api/whisper/transcribe`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({audio:r})})).json(),n.transcript?.trim()){let r=m.length>0?m:void 0;e(n.transcript.trim(),r,t),r&&g([])}}catch(e){console.error(`[InputBar] Whisper transcription error:`,e)}},n.readAsDataURL(t)},n.stop();else{r?.getTracks().forEach(e=>e.stop()),A.current=null,pe.current=null,fe.current=[];try{let t=await s();if(t.trim()){let n=m.length>0?m:void 0;e(t.trim(),n),n&&g([])}}catch(e){console.error(`[InputBar] Web Speech stop error:`,e)}}re.current&&(re.current.style.transform=``),y(!1),x(0),se.current=0},[e,i,m,r,c,s]),me=(0,k.useCallback)(e=>{let t=e.type.startsWith(`image/`),n=e.type===`application/pdf`;if(!t&&!n)return;let r=new FileReader;r.onload=async n=>{let r=n.target?.result;t&&(r=await FM(r)),g(n=>[...n,{id:Math.random().toString(36).slice(2),type:t?`image`:`file`,name:e.name,preview:r}])},r.readAsDataURL(e)},[]),he=(0,k.useCallback)(e=>{let t=e.target.files;if(t){for(let e=0;e<t.length;e++)me(t[e]);e.target.value=``}},[me]),ge=(0,k.useCallback)(e=>{g(t=>t.filter(t=>t.id!==e))},[]);(0,k.useEffect)(()=>{let e=e=>{if(e.clipboardData?.items){for(let t of e.clipboardData.items)if(t.type.startsWith(`image/`)){e.preventDefault();let n=t.getAsFile();n&&me(n)}}};return document.addEventListener(`paste`,e),()=>document.removeEventListener(`paste`,e)},[me]);let _e=()=>{if(w){e(d,m.length>0?m:void 0),p(``),g([]);try{localStorage.removeItem(IM)}catch{}requestAnimationFrame(()=>T.current?.focus())}},ve=(0,k.useCallback)(e=>{e.preventDefault(),ue.current=!0,D.current=e.clientX,se.current=0,e.currentTarget.setPointerCapture(e.pointerId),ce.current=setTimeout(async()=>{if(u)try{if(r){let e=await navigator.mediaDevices.getUserMedia({audio:!0});if(!ue.current){e.getTracks().forEach(e=>e.stop());return}pe.current=e;let t=MediaRecorder.isTypeSupported(`audio/webm;codecs=opus`)?`audio/webm;codecs=opus`:`audio/webm`,n=new MediaRecorder(e,{mimeType:t});fe.current=[],n.ondataavailable=e=>{e.data.size>0&&fe.current.push(e.data)},A.current=n,n.start()}else if(a(),!ue.current){c();return}le.current=!0,y(!0),x(0)}catch(e){console.error(`[InputBar] recording setup failed:`,e)}},200)},[u,r,a,c]),ye=(0,k.useCallback)(e=>{if(!le.current)return;let t=Math.min(0,e.clientX-D.current);if(se.current=t,re.current&&(re.current.style.transform=`translateX(${t}px)`),ne.current){let t=ne.current.getBoundingClientRect(),n=t.left+t.width/2;Math.abs(e.clientX-n)<36&&j(!0)}},[j]),be=(0,k.useCallback)(()=>{ue.current=!1,ce.current&&=(clearTimeout(ce.current),null),le.current&&j(!1)},[j]),xe=(0,k.useCallback)(()=>{ue.current=!1,ce.current&&=(clearTimeout(ce.current),null),le.current&&j(!0)},[j]);return(0,M.jsxs)(`div`,{className:`shrink-0 p-3 relative`,children:[(0,M.jsxs)(`div`,{className:`flex flex-col transition-opacity duration-100 ${v?`opacity-0 pointer-events-none`:`opacity-100`}`,children:[(0,M.jsx)(h,{children:m.length>0&&(0,M.jsx)(f.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{duration:.15},className:`overflow-hidden`,children:(0,M.jsx)(`div`,{className:`flex gap-2 px-3 pt-2.5 pb-2 flex-wrap bg-white/[0.04] border border-white/[0.08] rounded-2xl mb-2`,children:m.map(e=>(0,M.jsxs)(`div`,{className:`relative group flex-shrink-0`,children:[e.type===`image`?(0,M.jsx)(`img`,{src:e.preview,alt:e.name,className:`w-14 h-14 rounded-lg object-cover border border-white/10`}):(0,M.jsxs)(`div`,{className:`w-14 h-14 rounded-lg bg-white/5 border border-white/10 flex flex-col items-center justify-center gap-0.5 px-1`,children:[(0,M.jsx)(`svg`,{className:`w-5 h-5 text-muted-foreground`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:1.5,children:(0,M.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z`})}),(0,M.jsx)(`span`,{className:`text-[8px] text-muted-foreground truncate w-full text-center`,children:e.name.split(`.`).pop()})]}),(0,M.jsx)(`button`,{onClick:()=>ge(e.id),className:`absolute -top-1.5 -right-1.5 w-4 h-4 bg-black/80 border border-white/20 rounded-full flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity`,children:(0,M.jsx)(O,{className:`w-2.5 h-2.5 text-white`})})]},e.id))})})}),(0,M.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex-1 flex items-end bg-white rounded-2xl px-4`,children:[(0,M.jsx)(`textarea`,{ref:T,value:d,onChange:e=>p(e.target.value),onKeyDown:e=>{let t=`ontouchstart`in window||navigator.maxTouchPoints>0;e.key===`Enter`&&!e.shiftKey&&!t&&(e.preventDefault(),w&&_e())},placeholder:`Type a message...`,rows:1,className:`flex-1 resize-none bg-transparent text-gray-900 py-3 text-sm outline-none placeholder:text-gray-400 overflow-y-auto`,style:{maxHeight:88}}),(0,M.jsx)(`input`,{ref:ee,type:`file`,className:`hidden`,accept:`image/*,.pdf`,multiple:!0,onChange:he}),(0,M.jsx)(`input`,{ref:te,type:`file`,className:`hidden`,accept:`image/*`,capture:`environment`,onChange:he}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>ee.current?.click(),className:`shrink-0 p-1.5 mb-2 text-gray-400 hover:text-gray-600 transition-colors`,children:(0,M.jsx)(E,{className:`h-4 w-4`})}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>te.current?.click(),className:`shrink-0 p-1.5 mb-2 text-gray-400 hover:text-gray-600 transition-colors`,children:(0,M.jsx)(S,{className:`h-4 w-4`})})]}),n?(0,M.jsx)(`button`,{onClick:t,className:`flex items-center justify-center h-12 w-12 shrink-0 rounded-full bg-destructive text-destructive-foreground transition-colors`,children:(0,M.jsx)(ae,{className:`h-4 w-4`})}):C?(0,M.jsx)(`button`,{onClick:_e,className:`flex items-center justify-center h-12 w-12 shrink-0 rounded-full bg-white text-gray-900 transition-colors hover:bg-gray-100`,children:(0,M.jsx)(ie,{className:`h-4 w-4`})}):(0,M.jsx)(`div`,{className:`flex items-center justify-center h-12 w-12 shrink-0 rounded-full transition-colors touch-none select-none ${u?`bg-gradient-brand text-white cursor-pointer`:`bg-gray-200 text-gray-400 cursor-default`}`,title:u?void 0:`Voice input requires Chrome, Edge, or Safari. Enable Whisper in Settings for any browser.`,onPointerDown:u?ve:void 0,onPointerMove:u?ye:void 0,onPointerUp:u?be:void 0,onPointerCancel:u?xe:void 0,children:(0,M.jsx)(o,{className:`h-4 w-4`})})]})]}),(0,M.jsx)(h,{children:v&&(0,M.jsx)(f.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},className:`absolute inset-0 p-3 flex items-center touch-none`,children:(0,M.jsxs)(`div`,{className:`flex items-center w-full gap-2`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,M.jsxs)(`span`,{className:`relative flex h-2 w-2 shrink-0`,children:[(0,M.jsx)(`span`,{className:`animate-ping absolute inline-flex h-full w-full rounded-full bg-destructive opacity-75`}),(0,M.jsx)(`span`,{className:`relative inline-flex rounded-full h-2 w-2 bg-destructive`})]}),(0,M.jsx)(`span`,{className:`text-sm font-medium tabular-nums`,children:PM(b)})]}),(0,M.jsxs)(`div`,{className:`flex-1 flex items-center bg-muted rounded-full h-12 pl-1 pr-0.5`,children:[(0,M.jsx)(`div`,{ref:ne,className:`flex items-center justify-center h-9 w-9 shrink-0 rounded-full bg-destructive/10 text-destructive`,children:(0,M.jsx)(oe,{className:`h-4 w-4`})}),(0,M.jsx)(`div`,{className:`flex-1 flex justify-center min-w-0`,children:(0,M.jsx)(f.span,{className:`text-[13px] whitespace-nowrap select-none font-medium`,style:{backgroundImage:`linear-gradient(90deg, #999 0%, #999 35%, #fff 50%, #999 65%, #999 100%)`,backgroundSize:`200% 100%`,WebkitBackgroundClip:`text`,WebkitTextFillColor:`transparent`,backgroundClip:`text`},animate:{backgroundPosition:[`200% center`,`-200% center`]},transition:{duration:2.5,repeat:1/0,ease:`linear`},children:`◄◄ slide to cancel`})}),(0,M.jsx)(`div`,{ref:re,className:`shrink-0 touch-none select-none will-change-transform`,style:{transition:`none`},onPointerDown:ve,onPointerMove:ye,onPointerUp:be,onPointerCancel:xe,children:(0,M.jsx)(`div`,{className:`flex items-center justify-center h-11 w-11 rounded-full bg-destructive text-destructive-foreground`,children:(0,M.jsx)(o,{className:`h-5 w-5`})})})]})]})})})]})}function RM(){let e=(0,k.useRef)(null),[t,n]=(0,k.useState)(!1),[r,i]=(0,k.useState)(`Bloby`),[a,o]=(0,k.useState)(!1),[s,l]=(0,k.useState)(!1),[u,d]=(0,k.useState)(!1),[f,p]=(0,k.useState)(0),m=(0,k.useRef)(null),h=(0,k.useRef)(!1),[g,v]=(0,k.useState)(!0),[S,C]=(0,k.useState)(null),[w,te]=(0,k.useState)(`loading`);function E(e){let t=(e+`=`.repeat((4-e.length%4)%4)).replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}async function ne(){try{if(await Notification.requestPermission()!==`granted`){te(`denied`);return}let t=await navigator.serviceWorker.ready,{publicKey:n}=await(await fetch(`/api/push/vapid-public-key`)).json(),r=(await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:E(n)})).toJSON(),i=e.current;i&&i.send(`push:subscribe`,{endpoint:r.endpoint,keys:r.keys}),te(`subscribed`)}catch(e){console.error(`[push] Subscribe failed:`,e)}}async function re(){try{let t=await(await navigator.serviceWorker.ready).pushManager.getSubscription();if(t){let n=t.endpoint;await t.unsubscribe();let r=e.current;r&&r.send(`push:unsubscribe`,{endpoint:n})}te(`unsubscribed`)}catch(e){console.error(`[push] Unsubscribe failed:`,e)}}let[ie,ae]=(0,k.useState)(!1),oe=/iPad|iPhone|iPod/.test(navigator.userAgent),ce=window.matchMedia(`(display-mode: standalone)`).matches||navigator.standalone,ue=/Android|iPhone|iPad|iPod|webOS|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),de=window.self!==window.top;(0,k.useEffect)(()=>{let e=e=>{e.data?.type===`bloby:show-ios-install`&&ae(!0)};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[]);let[ge,ve]=(0,k.useState)(!1),[ye,be]=(0,k.useState)(!1),[xe,Se]=(0,k.useState)(!1),[Ce,we]=(0,k.useState)(!1);(0,k.useEffect)(()=>{(async()=>{try{let e=await(await fetch(`/api/onboard/status`)).json();if(e.totpEnabled&&we(!0),!e.portalConfigured){be(!1),Se(!0),ve(!0);return}be(!0);let t=A();if(t){if((await(await fetch(`/api/portal/validate-token?token=${encodeURIComponent(t)}`)).json()).valid){Se(!0),ve(!0);return}pe()}Se(!1),ve(!0)}catch{Se(!0),ve(!0)}})()},[]);let Te=e=>{fe(e),Se(!0)};(0,k.useEffect)(()=>{j(()=>{Se(!1),be(!0)})},[]),(0,k.useEffect)(()=>{if(!xe)return;let e=()=>{fetch(`/app/api/health`).then(e=>v(e.ok)).catch(()=>v(!1))};e();let t=setInterval(e,1e4);return()=>clearInterval(t)},[xe]),(0,k.useEffect)(()=>{xe&&(async()=>{if(!(`PushManager`in window)||!(`serviceWorker`in navigator)){te(`unsupported`);return}if(Notification.permission===`denied`){te(`denied`);return}try{let e=await(await navigator.serviceWorker.ready).pushManager.getSubscription();te(e&&(await(await fetch(`/api/push/status?endpoint=${encodeURIComponent(e.endpoint)}`)).json()).subscribed?`subscribed`:`unsubscribed`)}catch{te(`unsupported`)}})()},[xe]),(0,k.useEffect)(()=>{if(!xe)return;let t=location.protocol===`https:`?`wss:`:`ws:`,r=location.host,i=new le(`${t}//${r}/bloby/ws`,A);e.current=i;let a=i.onStatus(e=>{n(e),e&&h.current&&p(e=>e+1),h.current=e}),o=i.on(`app:rebuilding`,()=>{window.parent?.postMessage({type:`bloby:rebuilding`},`*`)}),s=i.on(`app:rebuilt`,()=>{window.parent?.postMessage({type:`bloby:rebuilt`},`*`)}),c=i.on(`app:build-error`,e=>{window.parent?.postMessage({type:`bloby:build-error`,error:e.error},`*`)}),l=i.on(`app:hmr-update`,()=>{window.parent?.postMessage({type:`bloby:hmr-update`},`*`)}),u=i.on(`bot:response`,()=>{window.parent?.postMessage({type:`bloby:new-message`},`*`)}),d=i.on(`chat:sync`,()=>{window.parent?.postMessage({type:`bloby:new-message`},`*`)});return i.connect(),()=>{a(),o(),s(),c(),l(),u(),d(),i.disconnect()}},[xe]),(0,k.useEffect)(()=>{xe&&(me(`/api/settings`).then(e=>e.json()).then(e=>{e.agent_name&&i(e.agent_name),e.whisper_enabled===`true`&&o(!0)}).catch(()=>{}),me(`/api/wallet/balance`).then(e=>e.json()).then(e=>{e.address&&C(e.balance)}).catch(()=>{}))},[xe]),(0,k.useEffect)(()=>{if(!s)return;let e=e=>{m.current&&!m.current.contains(e.target)&&l(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s]);let{messages:Ee,streaming:De,streamBuffer:Oe,tools:ke,hasMore:Ae,loadOlder:je,sendMessage:Me,stopStreaming:Ne,clearContext:Pe}=he(e.current,f,xe);return(0,k.useEffect)(()=>{let t=async t=>{if(t.data?.type!==`bloby:voice-record`)return;let{audio:n,transcript:r}=t.data;if(n&&a){let t=e.current;if(!t?.connected)return;try{let e=await new Promise((e,r)=>{let i=t.on(`whisper:result`,t=>{i(),clearTimeout(a),e(t)}),a=setTimeout(()=>{i(),r(Error(`Timeout`))},3e4);t.send(`whisper:transcribe`,{audio:n})});e.transcript?.trim()&&Me(e.transcript.trim(),void 0,`data:audio/webm;base64,${n}`)}catch(e){console.error(`[BlobyApp] widget voice transcription error:`,e)}}else r?.trim()&&Me(r.trim())};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)},[Me,a]),ge?ye&&!xe?(0,M.jsx)(_e,{onLogin:Te,totpEnabled:Ce}):(0,M.jsxs)(`div`,{className:`flex flex-col h-dvh overflow-hidden`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 border-b border-border shrink-0`,children:[(0,M.jsx)(`button`,{onClick:()=>window.parent?.postMessage({type:`bloby:close`},`*`),className:`flex items-center justify-center h-7 w-7 -ml-1 rounded-full text-muted-foreground hover:text-foreground hover:bg-white/[0.06] transition-colors`,"aria-label":`Close chat`,children:(0,M.jsx)(c,{className:`h-5 w-5`})}),(0,M.jsx)(`img`,{src:`/bloby.png`,alt:r,className:`h-5 w-auto`}),(0,M.jsx)(`span`,{className:`text-sm font-semibold`,children:r}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-muted-foreground ml-1`,children:[(0,M.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,M.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${t?`bg-green-500`:`bg-red-500`}`}),`Chat`]}),(0,M.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,M.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${g?`bg-green-500`:`bg-orange-400 animate-pulse`}`}),`Workspace`]})]}),S!==null&&(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-full bg-white/[0.06] border border-border px-2.5 py-1`,children:[(0,M.jsxs)(`span`,{className:`text-[11px] text-muted-foreground font-mono`,children:[`$`,S]}),(0,M.jsx)(`a`,{href:`https://www.bloby.bot/marketplace`,target:`_blank`,rel:`noopener noreferrer`,className:`text-[11px] font-medium text-blue-400 hover:text-blue-300 transition-colors`,children:`Add`})]}),(0,M.jsx)(`div`,{className:`flex-1`}),(0,M.jsxs)(`div`,{className:`flex items-center gap-1`,children:[w!==`loading`&&w!==`unsupported`&&(0,M.jsx)(`button`,{onClick:()=>{w===`subscribed`?re():w===`unsubscribed`&&ne()},disabled:w===`denied`,className:`flex items-center justify-center h-7 w-7 rounded-full text-muted-foreground hover:text-foreground hover:bg-white/[0.06] transition-colors disabled:opacity-40 disabled:cursor-not-allowed`,title:w===`denied`?`Notifications blocked — enable in browser settings`:w===`subscribed`?`Disable push notifications`:`Enable push notifications`,children:w===`denied`?(0,M.jsx)(y,{className:`h-4 w-4`}):w===`subscribed`?(0,M.jsx)(b,{className:`h-4 w-4 text-blue-400`}):(0,M.jsx)(x,{className:`h-4 w-4`})}),(0,M.jsxs)(`div`,{className:`relative`,ref:m,children:[(0,M.jsx)(`button`,{onClick:()=>l(e=>!e),className:`flex items-center justify-center h-7 w-7 rounded-full text-muted-foreground hover:text-foreground hover:bg-white/[0.06] transition-colors`,children:(0,M.jsx)(ee,{className:`h-4 w-4`})}),s&&(0,M.jsxs)(`div`,{className:`absolute right-0 top-full mt-1 min-w-[160px] rounded-md border border-border bg-popover py-1 shadow-lg z-50`,children:[(0,M.jsxs)(`button`,{onClick:()=>{d(!0),l(!1)},className:`flex w-full items-center gap-2 px-3 py-2 text-sm text-muted-foreground hover:text-foreground hover:bg-white/[0.06] transition-colors`,children:[(0,M.jsx)(se,{className:`h-4 w-4`}),`Settings`]}),ue&&!ce&&(0,M.jsxs)(`button`,{onClick:()=>{l(!1),de?window.parent.postMessage({type:`bloby:install-app`},`*`):ae(!0)},className:`flex w-full items-center gap-2 px-3 py-2 text-sm text-muted-foreground hover:text-foreground hover:bg-white/[0.06] transition-colors`,children:[(0,M.jsx)(T,{className:`h-4 w-4`}),`Install App`]})]})]})]})]}),(0,M.jsxs)(`div`,{className:`flex-1 min-h-0 flex flex-col overflow-hidden`,children:[(0,M.jsx)(AM,{messages:Ee,streaming:De,streamBuffer:Oe,tools:ke,hasMore:Ae,onLoadOlder:je}),(0,M.jsx)(LM,{onSend:Me,onStop:Ne,streaming:De,whisperEnabled:a,onTranscribe:t=>new Promise((n,r)=>{let i=e.current;if(!i?.connected){r(Error(`WebSocket not connected`));return}let a=i.on(`whisper:result`,e=>{a(),clearTimeout(o),n(e)}),o=setTimeout(()=>{a(),r(Error(`Transcription timeout`))},3e4);i.send(`whisper:transcribe`,{audio:t})})})]}),u&&(0,M.jsx)(_,{onSave:t=>new Promise((n,r)=>{let i=e.current;if(!i?.connected){r(Error(`WebSocket not connected`));return}let a=i.on(`settings:saved`,e=>{a(),clearTimeout(s),n(e)}),o=i.on(`settings:save-error`,e=>{o(),clearTimeout(s),r(Error(e.error||`Save failed`))}),s=setTimeout(()=>{a(),o(),r(Error(`Save timeout`))},1e4);i.send(`settings:save`,t)}),onTunnelSwitch:t=>new Promise((n,r)=>{let i=e.current;if(!i?.connected){r(Error(`Not connected`));return}let a=i.on(`tunnel:switched`,e=>{a(),o(),clearTimeout(s),n(e)}),o=i.on(`tunnel:switch-error`,e=>{a(),o(),clearTimeout(s),r(Error(e.error))}),s=setTimeout(()=>{a(),o(),r(Error(`Timeout`))},3e4);i.send(`tunnel:switch`,{mode:t})}),onComplete:()=>{d(!1),me(`/api/settings`).then(e=>e.json()).then(e=>{e.agent_name&&i(e.agent_name),o(e.whisper_enabled===`true`)}).catch(()=>{}),window.parent?.postMessage({type:`bloby:onboard-complete`},`*`)}}),ie&&(0,M.jsxs)(`div`,{className:`fixed inset-0 z-[300] flex items-end sm:items-center justify-center p-4`,children:[(0,M.jsx)(`div`,{className:`absolute inset-0 bg-black/60 backdrop-blur-sm`,onClick:()=>ae(!1)}),(0,M.jsxs)(`div`,{className:`relative w-full max-w-[360px] bg-[#1c1c1e] border border-white/[0.08] rounded-2xl shadow-2xl overflow-hidden`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between px-5 pt-5 pb-2`,children:[(0,M.jsx)(`h2`,{className:`text-[17px] font-semibold text-white`,children:`Install App`}),(0,M.jsx)(`button`,{onClick:()=>ae(!1),className:`h-7 w-7 rounded-full bg-white/[0.08] flex items-center justify-center text-white/50 hover:text-white/80 transition-colors`,children:(0,M.jsx)(O,{className:`h-4 w-4`})})]}),(0,M.jsxs)(`div`,{className:`px-5 pb-6 pt-1`,children:[(0,M.jsx)(`p`,{className:`text-white/50 text-[13px] mb-5 leading-relaxed`,children:`Add Bloby to your home screen for a full-screen app experience.`}),oe?(0,M.jsxs)(`div`,{className:`space-y-3.5`,children:[(0,M.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,M.jsx)(`span`,{className:`flex-shrink-0 w-7 h-7 rounded-full bg-[#007AFF]/15 text-[#007AFF] text-[13px] font-semibold flex items-center justify-center mt-0.5`,children:`1`}),(0,M.jsxs)(`div`,{className:`flex-1`,children:[(0,M.jsx)(`p`,{className:`text-white text-[14px] font-medium`,children:`Tap the Share button`}),(0,M.jsxs)(`p`,{className:`text-white/40 text-[12px] mt-0.5 flex items-center gap-1.5`,children:[`The `,(0,M.jsx)(D,{className:`h-3.5 w-3.5 inline`}),` icon at the bottom of Safari`]})]})]}),(0,M.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,M.jsx)(`span`,{className:`flex-shrink-0 w-7 h-7 rounded-full bg-[#007AFF]/15 text-[#007AFF] text-[13px] font-semibold flex items-center justify-center mt-0.5`,children:`2`}),(0,M.jsxs)(`div`,{className:`flex-1`,children:[(0,M.jsx)(`p`,{className:`text-white text-[14px] font-medium`,children:`Scroll down and tap`}),(0,M.jsx)(`p`,{className:`text-white/40 text-[12px] mt-0.5`,children:`"Add to Home Screen"`})]})]}),(0,M.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,M.jsx)(`span`,{className:`flex-shrink-0 w-7 h-7 rounded-full bg-[#007AFF]/15 text-[#007AFF] text-[13px] font-semibold flex items-center justify-center mt-0.5`,children:`3`}),(0,M.jsxs)(`div`,{className:`flex-1`,children:[(0,M.jsx)(`p`,{className:`text-white text-[14px] font-medium`,children:`Tap "Add"`}),(0,M.jsx)(`p`,{className:`text-white/40 text-[12px] mt-0.5`,children:`Bloby will appear on your home screen`})]})]})]}):(0,M.jsxs)(`div`,{className:`space-y-3.5`,children:[(0,M.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,M.jsx)(`span`,{className:`flex-shrink-0 w-7 h-7 rounded-full bg-[#007AFF]/15 text-[#007AFF] text-[13px] font-semibold flex items-center justify-center mt-0.5`,children:`1`}),(0,M.jsxs)(`div`,{className:`flex-1`,children:[(0,M.jsx)(`p`,{className:`text-white text-[14px] font-medium`,children:`Open browser menu`}),(0,M.jsx)(`p`,{className:`text-white/40 text-[12px] mt-0.5`,children:`Tap the three-dot menu in your browser`})]})]}),(0,M.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,M.jsx)(`span`,{className:`flex-shrink-0 w-7 h-7 rounded-full bg-[#007AFF]/15 text-[#007AFF] text-[13px] font-semibold flex items-center justify-center mt-0.5`,children:`2`}),(0,M.jsxs)(`div`,{className:`flex-1`,children:[(0,M.jsx)(`p`,{className:`text-white text-[14px] font-medium`,children:`Tap "Install app" or "Add to Home screen"`}),(0,M.jsx)(`p`,{className:`text-white/40 text-[12px] mt-0.5`,children:`Bloby will be installed as a standalone app`})]})]})]}),(0,M.jsx)(`button`,{onClick:()=>ae(!1),className:`w-full mt-5 py-2.5 bg-white/[0.06] hover:bg-white/[0.1] text-white text-[14px] font-medium rounded-xl transition-colors`,children:`Got it`})]})]})]})]}):(0,M.jsx)(`div`,{className:`flex items-center justify-center h-dvh`,children:(0,M.jsx)(`div`,{className:`w-6 h-6 border-2 border-white/10 border-t-white/50 rounded-full animate-spin`})})}ce.createRoot(document.getElementById(`root`)).render((0,M.jsx)(k.StrictMode,{children:(0,M.jsx)(RM,{})}));export{yC as i,xx as n,hC as r,qb as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,r as t,t as n}from"./jsx-runtime-C0W9Wf2W.js";import{n as r,r as i,t as a}from"./bloby-
|
|
1
|
+
import{c as e,r as t,t as n}from"./jsx-runtime-C0W9Wf2W.js";import{n as r,r as i,t as a}from"./bloby-DYxsXV7f.js";var o=e(t(),1),s=n(),c=({code:e,language:t,raw:n,className:c,startLine:l,lineNumbers:u,...d})=>{let{shikiTheme:f}=(0,o.useContext)(i),p=r(),[m,h]=(0,o.useState)(n);return(0,o.useEffect)(()=>{if(!p){h(n);return}let r=p.highlight({code:e,language:t,themes:f},e=>{h(e)});r&&h(r)},[e,t,f,p,n]),(0,s.jsx)(a,{className:c,language:t,lineNumbers:u,result:m,startLine:l,...d})};export{c as HighlightedCodeBlockBody};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./bloby-DYxsXV7f.js";export{e as Mermaid};
|
package/dist-bloby/bloby.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, interactive-widget=resizes-content" />
|
|
6
6
|
<title>Bloby Chat</title>
|
|
7
|
-
<script type="module" crossorigin src="/bloby/assets/bloby-
|
|
7
|
+
<script type="module" crossorigin src="/bloby/assets/bloby-DYxsXV7f.js"></script>
|
|
8
8
|
<link rel="modulepreload" crossorigin href="/bloby/assets/jsx-runtime-C0W9Wf2W.js">
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/bloby/assets/globals-Y2sqR_Rk.js">
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/bloby/assets/globals-Dw5ZdZGt.css">
|
package/package.json
CHANGED
|
@@ -234,6 +234,14 @@ function BlobyApp() {
|
|
|
234
234
|
window.parent?.postMessage({ type: 'bloby:hmr-update' }, '*');
|
|
235
235
|
});
|
|
236
236
|
|
|
237
|
+
// Notify parent when agent finishes a response or a cross-device message arrives
|
|
238
|
+
const unsubBotMsg = client.on('bot:response', () => {
|
|
239
|
+
window.parent?.postMessage({ type: 'bloby:new-message' }, '*');
|
|
240
|
+
});
|
|
241
|
+
const unsubSyncMsg = client.on('chat:sync', () => {
|
|
242
|
+
window.parent?.postMessage({ type: 'bloby:new-message' }, '*');
|
|
243
|
+
});
|
|
244
|
+
|
|
237
245
|
client.connect();
|
|
238
246
|
|
|
239
247
|
return () => {
|
|
@@ -242,6 +250,8 @@ function BlobyApp() {
|
|
|
242
250
|
unsubRebuilt();
|
|
243
251
|
unsubBuildError();
|
|
244
252
|
unsubHmr();
|
|
253
|
+
unsubBotMsg();
|
|
254
|
+
unsubSyncMsg();
|
|
245
255
|
client.disconnect();
|
|
246
256
|
};
|
|
247
257
|
}, [authenticated]);
|
package/supervisor/index.ts
CHANGED
|
@@ -455,7 +455,7 @@ ${connected
|
|
|
455
455
|
<script>async function relink(){await fetch('/api/channels/whatsapp/logout',{method:'POST'});await fetch('/api/channels/whatsapp/connect',{method:'POST'});setTimeout(()=>location.reload(),2000)}</script>`
|
|
456
456
|
: qr
|
|
457
457
|
? `<div class="qr-card"><div class="qr-inner">${qr}</div></div><p class="scan-hint">Scan with WhatsApp to link</p>`
|
|
458
|
-
: '<p class="loading">Starting WhatsApp
|
|
458
|
+
: '<p class="loading">Starting WhatsApp...</p>'}
|
|
459
459
|
</div>
|
|
460
460
|
${!connected ? '<script>setTimeout(()=>location.reload(),4000)</script>' : ''}
|
|
461
461
|
</body></html>`);
|
package/supervisor/widget.js
CHANGED
|
@@ -63,6 +63,12 @@
|
|
|
63
63
|
var BUBBLE_SIZE = 60;
|
|
64
64
|
var BUBBLE_MARGIN = 24;
|
|
65
65
|
|
|
66
|
+
// ── Badge element (HTML, not canvas — avoids border-radius clipping) ──
|
|
67
|
+
var badgeEl = document.createElement('div');
|
|
68
|
+
badgeEl.id = 'bloby-widget-badge';
|
|
69
|
+
badgeEl.style.cssText = 'display:none;position:fixed;bottom:' + (BUBBLE_MARGIN + BUBBLE_SIZE - 14) + 'px;right:' + (BUBBLE_MARGIN - 5) + 'px;z-index:99999;min-width:20px;height:20px;border-radius:10px;background:#F04D68;color:#fff;font:bold 11px -apple-system,BlinkMacSystemFont,sans-serif;text-align:center;line-height:20px;padding:0 5px;box-sizing:border-box;pointer-events:none;';
|
|
70
|
+
document.body.appendChild(badgeEl);
|
|
71
|
+
|
|
66
72
|
// ══════════════════════════════════════════════════════════════════
|
|
67
73
|
// ── Headphones Sprite Sheet Config ───────────────────────────────
|
|
68
74
|
// ══════════════════════════════════════════════════════════════════
|
|
@@ -164,6 +170,9 @@
|
|
|
164
170
|
var hpPingPong = 1;
|
|
165
171
|
var hpLastFrameTime = 0;
|
|
166
172
|
|
|
173
|
+
// ── Unread badge ──
|
|
174
|
+
var unreadCount = 0;
|
|
175
|
+
|
|
167
176
|
// ── Headphones mic recording state ──
|
|
168
177
|
var hpMediaRecorder = null;
|
|
169
178
|
var hpAudioChunks = [];
|
|
@@ -386,6 +395,15 @@
|
|
|
386
395
|
ctx.restore();
|
|
387
396
|
}
|
|
388
397
|
|
|
398
|
+
function updateBadge() {
|
|
399
|
+
if (unreadCount <= 0 || canvasPhase !== 'bubble' || isOpen) {
|
|
400
|
+
badgeEl.style.display = 'none';
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
badgeEl.textContent = unreadCount > 9 ? '9+' : String(unreadCount);
|
|
404
|
+
badgeEl.style.display = 'block';
|
|
405
|
+
}
|
|
406
|
+
|
|
389
407
|
function draw(now) {
|
|
390
408
|
ctx.clearRect(0, 0, W, H);
|
|
391
409
|
|
|
@@ -428,6 +446,7 @@
|
|
|
428
446
|
|
|
429
447
|
function enterHpCanvasMode() {
|
|
430
448
|
canvasPhase = 'headphones';
|
|
449
|
+
badgeEl.style.display = 'none';
|
|
431
450
|
// Expand canvas, keeping center roughly aligned with the bubble center
|
|
432
451
|
var bubbleCenterFromRight = BUBBLE_MARGIN + BUBBLE_SIZE / 2;
|
|
433
452
|
var bubbleCenterFromBottom = BUBBLE_MARGIN + BUBBLE_SIZE / 2;
|
|
@@ -729,11 +748,18 @@
|
|
|
729
748
|
var isOpen = false;
|
|
730
749
|
|
|
731
750
|
function toggle() {
|
|
751
|
+
// If clicked during splash or travel animation, skip straight to bubble first
|
|
752
|
+
if (canvasPhase === 'splash' || canvasPhase === 'transitioning') {
|
|
753
|
+
skipToBubble();
|
|
754
|
+
try { sessionStorage.setItem(SPLASH_KEY, '1'); } catch(e) {}
|
|
755
|
+
}
|
|
732
756
|
if (canvasPhase !== 'bubble') return;
|
|
733
757
|
isOpen = !isOpen;
|
|
734
758
|
panel.classList.toggle('open', isOpen);
|
|
735
759
|
backdrop.classList.toggle('open', isOpen);
|
|
736
760
|
canvas.style.display = isOpen ? 'none' : 'block';
|
|
761
|
+
if (isOpen) unreadCount = 0;
|
|
762
|
+
updateBadge();
|
|
737
763
|
}
|
|
738
764
|
|
|
739
765
|
// ── Bubble pointer handlers (tap → open panel, long-press → headphones mic) ──
|
|
@@ -776,6 +802,17 @@
|
|
|
776
802
|
if (hpState !== 'none' && hpState !== 'deactivating') stopHpRecording(true);
|
|
777
803
|
});
|
|
778
804
|
|
|
805
|
+
// ── Click on blob during splash/travel → skip animation and open chat ──
|
|
806
|
+
document.addEventListener('click', function(e) {
|
|
807
|
+
if (canvasPhase !== 'splash' && canvasPhase !== 'transitioning') return;
|
|
808
|
+
if (animState === 'loading') return;
|
|
809
|
+
var dx = e.clientX - center.x;
|
|
810
|
+
var dy = e.clientY - center.y;
|
|
811
|
+
if (Math.sqrt(dx * dx + dy * dy) < DISPLAY_H / 2 + 15) {
|
|
812
|
+
toggle();
|
|
813
|
+
}
|
|
814
|
+
});
|
|
815
|
+
|
|
779
816
|
// Prevent context menu on long-press (mobile)
|
|
780
817
|
bubble.addEventListener('contextmenu', function(e) {
|
|
781
818
|
e.preventDefault();
|
|
@@ -801,6 +838,12 @@
|
|
|
801
838
|
|
|
802
839
|
if (e.data.type === 'bloby:close' && isOpen) toggle();
|
|
803
840
|
|
|
841
|
+
// New message from agent — badge the bubble if panel is closed
|
|
842
|
+
if (e.data.type === 'bloby:new-message' && !isOpen) {
|
|
843
|
+
unreadCount++;
|
|
844
|
+
updateBadge();
|
|
845
|
+
}
|
|
846
|
+
|
|
804
847
|
if (e.data.type === 'bloby:install-app') {
|
|
805
848
|
if (deferredInstallPrompt) {
|
|
806
849
|
deferredInstallPrompt.prompt();
|
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
8
8
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
|
9
9
|
<meta name="apple-mobile-web-app-title" content="Bloby" />
|
|
10
|
+
<link rel="icon" type="image/png" href="/bloby-favicon.png" />
|
|
10
11
|
<link rel="apple-touch-icon" href="/bloby-icon-192.png" />
|
|
11
12
|
<link rel="manifest" href="/manifest.json" />
|
|
12
13
|
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&display=swap" rel="stylesheet">
|
|
13
|
-
<title>Bloby</title>
|
|
14
|
+
<title>Bloby - AI agent with its own workspace</title>
|
|
14
15
|
</head>
|
|
15
16
|
<body class="bg-background text-foreground" style="background-color:#0A0A0A">
|
|
16
17
|
<!-- Dark background fallback — visible instantly while widget.js loads.
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./bloby-B8Qpaiaq.js";export{e as Mermaid};
|