@decocms/mesh 2.18.0 → 2.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CahACZDg.js → AlertCircle-DZfqNByx.js} +1 -1
- package/dist/client/assets/{ArrowLeft-DlLOWSTj.js → ArrowLeft-Cd6RM4A6.js} +1 -1
- package/dist/client/assets/{ArrowUp-Ck0taqJi.js → ArrowUp-VMKONnWJ.js} +1 -1
- package/dist/client/assets/{Check-Cjgi2ZiG.js → Check-Clnl6VO2.js} +1 -1
- package/dist/client/assets/{ChevronDown-BuVzyKHq.js → ChevronDown-CUCzTkUk.js} +1 -1
- package/dist/client/assets/{Code01-XpAoNs3W.js → Code01-BAik7hF-.js} +1 -1
- package/dist/client/assets/{Copy01-De4SwxDv.js → Copy01-CCfh45Hm.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-D-Bv2U6B.js → DotsHorizontal-H1CDe03p.js} +1 -1
- package/dist/client/assets/{DotsVertical-BhTwPxq7.js → DotsVertical-CubHWPM8.js} +1 -1
- package/dist/client/assets/{Download01-DhkFfGKV.js → Download01-DUxaWCdv.js} +1 -1
- package/dist/client/assets/{Edit01-DsRHb45T.js → Edit01-tXex8wx0.js} +1 -1
- package/dist/client/assets/{File06-BiIPMtEV.js → File06-1GHbOIr4.js} +1 -1
- package/dist/client/assets/{FilterLines-C_UJwG_t.js → FilterLines-Ttp2swRG.js} +1 -1
- package/dist/client/assets/{FlipBackward-CQnTJKeB.js → FlipBackward-BkcMu9OY.js} +1 -1
- package/dist/client/assets/{GitBranch01-ClS9Bk6n.js → GitBranch01-V6D4YBhB.js} +1 -1
- package/dist/client/assets/{Grid01-CRALWbj6.js → Grid01-Bf8eAyhK.js} +1 -1
- package/dist/client/assets/{Home02-ofwnyeoV.js → Home02-8q2bbK8n.js} +1 -1
- package/dist/client/assets/{Image01-Cb4gQMH4.js → Image01-Ba0mxAoN.js} +1 -1
- package/dist/client/assets/{Inbox01-CKGdnZFH.js → Inbox01-BvYPvM_p.js} +1 -1
- package/dist/client/assets/{InfoCircle-_4UsKVMw.js → InfoCircle-DKA0-FHH.js} +1 -1
- package/dist/client/assets/{Key01-BFJBGJng.js → Key01-CrI4HON6.js} +1 -1
- package/dist/client/assets/{LinkExternal01-C1dAUI0b.js → LinkExternal01-CqAE-za3.js} +1 -1
- package/dist/client/assets/{List-DOmOO2Cw.js → List-C6tpn114.js} +1 -1
- package/dist/client/assets/{Loading01-JwelopeC.js → Loading01-wy6i08TR.js} +1 -1
- package/dist/client/assets/{Lock01-B7TIX2sZ.js → Lock01-CGlDIBQ9.js} +1 -1
- package/dist/client/assets/{Play-CMKLF_6n.js → Play-BvhASZjZ.js} +1 -1
- package/dist/client/assets/{Plus-Df2M6Ns2.js → Plus-DaMIylfN.js} +1 -1
- package/dist/client/assets/{SearchMd-Cgfgcbdz.js → SearchMd-DsK25qy7.js} +1 -1
- package/dist/client/assets/{Terminal-C8LHfiOW.js → Terminal-cal0VHQd.js} +1 -1
- package/dist/client/assets/{Trash01-KvZ0cVo9.js → Trash01-pB5oOXYU.js} +1 -1
- package/dist/client/assets/{Upload01-TiwmYxO-.js → Upload01-BRGUFGKZ.js} +1 -1
- package/dist/client/assets/{X-DhyaYbLb.js → X-Bq7VzczH.js} +1 -1
- package/dist/client/assets/{XClose-2bShEltc.js → XClose-zOphE63W.js} +1 -1
- package/dist/client/assets/{alert-dialog-gZhceV_v.js → alert-dialog-BBkPKiLO.js} +1 -1
- package/dist/client/assets/{auth-catchall-Dz8qCpUP.js → auth-catchall-D7-AwG4p.js} +1 -1
- package/dist/client/assets/{avatar-d8M8JpvZ.js → avatar-CumXES9B.js} +1 -1
- package/dist/client/assets/{badge-CKe-ib_i.js → badge-tnyrO2LA.js} +1 -1
- package/dist/client/assets/{binder-iKe3ndXq.js → binder-BxHiGQ64.js} +1 -1
- package/dist/client/assets/{button-DXl1hVqx.js → button-BQMZIX_4.js} +1 -1
- package/dist/client/assets/{card-D0GcpRPY.js → card-B-rrjyBF.js} +1 -1
- package/dist/client/assets/{checkbox-D1tHbcIN.js → checkbox-CJvAgYlu.js} +1 -1
- package/dist/client/assets/{collection-detail-BQkjgYb7.js → collection-detail-w6psdBlt.js} +1 -1
- package/dist/client/assets/{collection-display-button-B_KC-ent.js → collection-display-button-Bi_NXbuN.js} +1 -1
- package/dist/client/assets/{collection-header-BA9HTLmg.js → collection-header-BfNxri-N.js} +1 -1
- package/dist/client/assets/{collection-page-CDkTC45g.js → collection-page-DJtrTRMH.js} +1 -1
- package/dist/client/assets/{collection-search-pUdl1eNx.js → collection-search-9baWd84b.js} +1 -1
- package/dist/client/assets/{collection-tab-BofyxU3Y.js → collection-tab-Ct4krCcB.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-wARoPZXo.js → collection-table-wrapper-Cu-yqUsH.js} +1 -1
- package/dist/client/assets/{connection-ByVJuREK.js → connection-BdWKvn2K.js} +1 -1
- package/dist/client/assets/{connection-card-DjK0GZ2u.js → connection-card-CwhA62aK.js} +1 -1
- package/dist/client/assets/{connection-detail-BGizcg4Z.js → connection-detail-BvvvvXz6.js} +1 -1
- package/dist/client/assets/{connections-B3vaIw3-.js → connections-CfRRCGSZ.js} +1 -1
- package/dist/client/assets/constants-BoL9C76L.js +1 -0
- package/dist/client/assets/{create-organization-dialog-DKwU0dfN.js → create-organization-dialog-gxAB4wwP.js} +1 -1
- package/dist/client/assets/{dialog-1B3YWWMu.js → dialog-BOTxth8M.js} +1 -1
- package/dist/client/assets/{dropdown-menu-Hp4qYTud.js → dropdown-menu-Cwg_0qoi.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-j2gEmQEr.js → dynamic-plugin-layout-DcLqC1O8.js} +1 -1
- package/dist/client/assets/{empty-state-D-JjObLi.js → empty-state-2SJ3WxPr.js} +1 -1
- package/dist/client/assets/{empty-state-C7Gr5Tg2.js → empty-state-DeORHrTg.js} +1 -1
- package/dist/client/assets/{env-vars-editor-D4XTsyk0.js → env-vars-editor-qkfhYptd.js} +1 -1
- package/dist/client/assets/{error-boundary-rr4tK3fB.js → error-boundary-KUKN2TxD.js} +1 -1
- package/dist/client/assets/{extract-connection-data-37AfzoCx.js → extract-connection-data-37AfJqs-.js} +1 -1
- package/dist/client/assets/{file-browser-BECnO7FM.js → file-browser-D3uR2C9M.js} +2 -2
- package/dist/client/assets/{form-BQupN7IV.js → form-o9xmUpnK.js} +1 -1
- package/dist/client/assets/gateway-detail-B6zUy6TE.js +1 -0
- package/dist/client/assets/{gateways-jpQl136Z.js → gateways-fe-SAKln.js} +1 -1
- package/dist/client/assets/{grid-view-BwLKimb0.js → grid-view-vZ2Zpkzy.js} +1 -1
- package/dist/client/assets/{home-9vMYPTYi.js → home-OB-BKE3S.js} +1 -1
- package/dist/client/assets/{index-D0CzZUCs.js → index-BGlkGnRh.js} +1 -1
- package/dist/client/assets/{index-DEuqpeVv.js → index-BdoGlqOh.js} +2 -2
- package/dist/client/assets/{index-Bpy9plQL.js → index-DB3RU6w4.js} +1 -1
- package/dist/client/assets/{index-u_K3efbu.js → index-DuoIQX0P.js} +1 -1
- package/dist/client/assets/{index-DVolwMvn.js → index-nfXEOl8p.js} +31 -31
- package/dist/client/assets/{infiniteQueryObserver-BXdaScti.js → infiniteQueryObserver-B-zosqIG.js} +1 -1
- package/dist/client/assets/{input-CqqzkfyF.js → input-B0JGK4qg.js} +1 -1
- package/dist/client/assets/{layout-D7T4rJzl.js → layout-LCGR_e4n.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-U-fd28FU.js → lazy-highlighter-7Ygumnp-.js} +1 -1
- package/dist/client/assets/{localstorage-keys-kemGZMIp.js → localstorage-keys-DJgrMpsR.js} +1 -1
- package/dist/client/assets/{login-AsctHrUh.js → login-CPHiXmVM.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DqZqwRXe.js → mcp-oauth-DHBNZNZN.js} +1 -1
- package/dist/client/assets/{mcp-server-card-DfoQ5M8z.js → mcp-server-card-CCJD8rY5.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-GLsULv7B.js → mcp-server-detail-B2BLpdBe.js} +1 -1
- package/dist/client/assets/{members-eia2aN0I.js → members-BUKGWKo1.js} +1 -1
- package/dist/client/assets/{monaco-editor-rl0nEzOU.js → monaco-editor-2dgkKSmS.js} +1 -1
- package/dist/client/assets/{monitoring-DWEGkU9y.js → monitoring-Co2ahvWI.js} +1 -1
- package/dist/client/assets/{oauth-callback-BFr0fBNT.js → oauth-callback-DqMgYj7o.js} +1 -1
- package/dist/client/assets/{page-GoE2bJQh.js → page-CUhEXv2W.js} +1 -1
- package/dist/client/assets/{page-BeG_Zpat.js → page-Xy2zuFaN.js} +1 -1
- package/dist/client/assets/{pin-to-sidebar-button-CrzVxc9I.js → pin-to-sidebar-button-BcuLv1ea.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-CvQbqnfg.js → plugin-empty-state-BMZ2lKdt.js} +1 -1
- package/dist/client/assets/{plugin-header-BaWUIpLx.js → plugin-header-CzG6IJ7x.js} +1 -1
- package/dist/client/assets/{plugins-Q7uqmYFh.js → plugins-DrfogMhA.js} +1 -1
- package/dist/client/assets/{popover-BcOo6EXw.js → popover-CXUBdgho.js} +1 -1
- package/dist/client/assets/{project-context-provider-Dn1-l4h2.js → project-context-provider-DhgIBvJ2.js} +1 -1
- package/dist/client/assets/{registry-utils-85b65tFI.js → registry-utils-C1MEHnjt.js} +1 -1
- package/dist/client/assets/{resizable-DkFmgcsj.js → resizable-CwvNlApq.js} +1 -1
- package/dist/client/assets/{resource-tabs-DkDSMlFB.js → resource-tabs-BnWaqzvN.js} +1 -1
- package/dist/client/assets/{select-Bv7J3zlQ.js → select--nDzC8in.js} +1 -1
- package/dist/client/assets/{settings-BK8QvMDL.js → settings-18XrU-68.js} +1 -1
- package/dist/client/assets/shell-layout-DPrrZeqr.js +3 -0
- package/dist/client/assets/{spinner-D0hdWfev.js → spinner-BJxZd1VB.js} +1 -1
- package/dist/client/assets/{switch-ugX7u7WU.js → switch-BFRma3Oi.js} +1 -1
- package/dist/client/assets/{textarea-BUrXtpl5.js → textarea-CZGp5M36.js} +1 -1
- package/dist/client/assets/{tool-set-selector-a1uFioE0.js → tool-set-selector-D-ihTeCw.js} +1 -1
- package/dist/client/assets/{tools-list-DpFBj-bw.js → tools-list-DdaO5B-A.js} +1 -1
- package/dist/client/assets/{tooltip-vUrxHIt0.js → tooltip-DSjdME5j.js} +1 -1
- package/dist/client/assets/{typewriter-title-7_SusDya.js → typewriter-title-D3pHLziM.js} +1 -1
- package/dist/client/assets/{use-binding-B0VMz_Ex.js → use-binding-CdMfLY85.js} +1 -1
- package/dist/client/assets/{use-collections-Cflasxiq.js → use-collections-B_r4T3b1.js} +1 -1
- package/dist/client/assets/{use-connection-DhRUkVvI.js → use-connection-W2V2j8pE.js} +1 -1
- package/dist/client/assets/{use-connection-resources-C-wyp48q.js → use-connection-resources-_fz_82N5.js} +1 -1
- package/dist/client/assets/{use-create-gateway-DMkdPgfy.js → use-create-gateway-DGaCqRhz.js} +1 -1
- package/dist/client/assets/{use-gateway-D5VVN1xE.js → use-gateway-CijYzCU9.js} +1 -1
- package/dist/client/assets/use-gateway-system-prompt-CusPzWe3.js +1 -0
- package/dist/client/assets/{use-list-state-BYREPRxy.js → use-list-state-DNPGmD9A.js} +1 -1
- package/dist/client/assets/{use-mcp-CZeMxRgK.js → use-mcp-fzL3ILVj.js} +1 -1
- package/dist/client/assets/{use-members-Bi0eIvBO.js → use-members-Cs5znkoZ.js} +1 -1
- package/dist/client/assets/{use-mobile-CI2w7svc.js → use-mobile-DPzmQj9d.js} +1 -1
- package/dist/client/assets/{use-organization-settings-D0kNSjbq.js → use-organization-settings-sFF34W-p.js} +1 -1
- package/dist/client/assets/{use-tool-call-CoI4ZCZe.js → use-tool-call-CCdok443.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Bx9UQHNH.js +1 -0
- package/dist/client/assets/{useMutation-xcmVYLP7.js → useMutation-mOecCzvG.js} +1 -1
- package/dist/client/assets/useQuery-B_cnJjvx.js +1 -0
- package/dist/client/assets/{value-C7rJ457O.js → value-C7yMc_BN.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CTWk8Dkt.js → view-mode-toggle-DdRtk7o-.js} +1 -1
- package/dist/client/assets/{workflow-ClKgdB2v.js → workflow-Ca7LNIxD.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +11 -11
- package/dist/server/server.js +11 -11
- package/package.json +1 -1
- package/dist/client/assets/constants-DQVDVC-J.js +0 -1
- package/dist/client/assets/gateway-detail-B1f7bt6s.js +0 -1
- package/dist/client/assets/shell-layout-DImgzYtx.js +0 -3
- package/dist/client/assets/use-gateway-system-prompt-B3fSaA6r.js +0 -1
- package/dist/client/assets/useInfiniteQuery-ckN_t7ea.js +0 -1
- package/dist/client/assets/useQuery-BKyLWvSZ.js +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-
|
|
2
|
-
import{r as j,c as Q,j as m,aH as ud,aI as od,aJ as ld,aK as nt,z as G,aL as Lr,aM as Yu,aN as cd,aO as dd,aP as fd,L as Xe,J as Zn,I as ar,y as Te,aQ as te,aG as Pt,aR as hd,aS as Ae,_ as pd,X as ai,v as ui,x as oi,K as je,d as qu,t as Kn,a as Vu,f as Gu,aT as md,aU as gd,B as bd,E as Ed,aV as Td,a5 as xd,a6 as li,a8 as _d,a7 as yd,aa as Ad,as as kd,a3 as Cd,a9 as Id}from"./index-DEuqpeVv.js";import{c as ie,B as Me}from"./button-DXl1hVqx.js";import{i as Nd}from"./X-DhyaYbLb.js";import{I as ci,E as Sd}from"./empty-state-C7Gr5Tg2.js";import{u as zt}from"./project-context-provider-Dn1-l4h2.js";import{a as ur,b as or,P as lr}from"./popover-BcOo6EXw.js";import{T as wd}from"./textarea-BUrXtpl5.js";import{i as Wu}from"./AlertCircle-CahACZDg.js";import{i as Rd,E as Od}from"./error-boundary-rr4tK3fB.js";import{i as Ld}from"./ArrowUp-Ck0taqJi.js";import{t as vd}from"./ChevronDown-BuVzyKHq.js";import{u as Dd,i as di}from"./use-gateway-D5VVN1xE.js";import{i as Pd}from"./Edit01-DsRHb45T.js";import{U as Md,c as Bd}from"./connection-ByVJuREK.js";import{b as Fd}from"./use-collections-Cflasxiq.js";import{u as Qu,a as Ud}from"./use-connection-DhRUkVvI.js";import{b as Hd}from"./use-binding-B0VMz_Ex.js";import{u as Xt}from"./useMutation-xcmVYLP7.js";import{u as jd}from"./use-gateway-system-prompt-B3fSaA6r.js";import{u as vr,L as fi}from"./localstorage-keys-kemGZMIp.js";import{I as hi}from"./input-CqqzkfyF.js";import{T as xn,b as _n,a as pi,c as yn}from"./tooltip-vUrxHIt0.js";import{i as Yr}from"./Check-Cjgi2ZiG.js";import{i as qr}from"./SearchMd-Cgfgcbdz.js";import{u as zd}from"./use-create-gateway-DMkdPgfy.js";import{S as $d,a as Yd,b as qd,c as Vd,d as Gd}from"./select-Bv7J3zlQ.js";import{i as Wd}from"./File06-BiIPMtEV.js";import{c as Qd,i as Xu}from"./Grid01-CRALWbj6.js";import{a as Xd}from"./Image01-Cb4gQMH4.js";import{a as Zd,F as Kd,b as Jd,c as ef,d as tf,e as nf,f as rf}from"./form-BQupN7IV.js";import{S as Zu}from"./spinner-D0hdWfev.js";import{a as mi}from"./Copy01-De4SwxDv.js";import{i as sf}from"./Terminal-C8LHfiOW.js";import{M as Ku,s as ra}from"./monaco-editor-rl0nEzOU.js";import{b as af,c as uf,d as of,A as lf,a as cf,e as df,g as ff,f as hf}from"./alert-dialog-gZhceV_v.js";import{O as pf,b as mf,c as gf}from"./well-known-mcp-DOEdYmKO.js";import{g as bf}from"./generate-id-Dyweu44Y.js";import{s as Ef}from"./Trash01-KvZ0cVo9.js";var Jn;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const a of s)i[a]=a;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),a={};for(const u of i)a[u]=s[u];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&i.push(a);return i},t.find=(s,i)=>{for(const a of s)if(i(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Jn||(Jn={}));var sa;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(sa||(sa={}));Jn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Jn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Dr extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},s=i=>{for(const a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let u=r,l=0;for(;l<a.path.length;){const o=a.path[l];l===a.path.length-1?(u[o]=u[o]||{_errors:[]},u[o]._errors.push(n(a))):u[o]=u[o]||{_errors:[]},u=u[o],l++}}};return s(this),r}static assert(e){if(!(e instanceof Dr))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Jn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Dr.create=t=>new Dr(t);var ia;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(ia||(ia={}));var ne;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ne||(ne={}));const Ju=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M17.115 15.358c-.27.306-.554.608-.851.905-4.296 4.296-9.678 5.88-12.021 3.536-1.607-1.606-1.368-4.641.325-7.775M6.89 8.725c.281-.32.578-.636.888-.947C12.074 3.482 17.456 1.9 19.8 4.243c1.608 1.607 1.367 4.645-.33 7.781m-3.206-4.246c4.296 4.296 5.88 9.678 3.536 12.021-2.343 2.343-7.725.76-12.02-3.535C3.483 11.968 1.9 6.586 4.244 4.243c2.343-2.343 7.725-.76 12.02 3.535ZM13 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));Ju.displayName="Atom02";const eo=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));eo.displayName="ChevronSelectorVertical";const to=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));to.displayName="Coins01";const no=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M9 14 4 9m0 0 5-5M4 9h6.4c3.36 0 5.04 0 6.324.654a6 6 0 0 1 2.622 2.622C20 13.56 20 15.24 20 18.6V20"}));no.displayName="CornerUpLeft";const ro=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));ro.displayName="CurrencyDollar";const so=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m18 10-4-4M2.5 21.5l3.384-.376c.414-.046.62-.069.814-.131a2 2 0 0 0 .485-.234c.17-.111.317-.259.61-.553L21 7a2.828 2.828 0 1 0-4-4L3.794 16.206c-.294.294-.442.442-.553.611a2 2 0 0 0-.234.485c-.062.193-.085.4-.131.814L2.5 21.5Z"}));so.displayName="Edit02";const io=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M15 16.5V19c0 .932 0 1.398-.152 1.765a2 2 0 0 1-1.083 1.083C13.398 22 12.932 22 12 22c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C9 20.398 9 19.932 9 19v-2.5m6 0c2.649-1.157 4.5-3.925 4.5-7a7.5 7.5 0 0 0-15 0c0 3.075 1.851 5.843 4.5 7m6 0H9"}));io.displayName="Lightbulb01";const ao=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));ao.displayName="LogOut04";const Vr=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));Vr.displayName="Stars01";const uo=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));uo.displayName="Stop";const oo=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M16 8V5l3-3 1 2 2 1-3 3h-3Zm0 0-4 4m10 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m5 10a5 5 0 1 1-5-5"}));oo.displayName="Target04";const lo=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m15 9-6 6m0-6 6 6m7-3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));lo.displayName="XCircle";function $e(t){const e=Q.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let s;e[3]!==n?(s=ie("bg-accent animate-pulse rounded-md",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==r||e[6]!==s?(i=m.jsx("div",{"data-slot":"skeleton",className:s,...r}),e[5]=r,e[6]=s,e[7]=i):i=e[7],i}function Tf(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=fi.developerMode(),t[0]=e):e=t[0],vr(e,!1)}const aa=[{border:"border-purple-400",bg:"bg-purple-400",text:"text-white",bgLight:"bg-purple-400/10"},{border:"border-blue-400",bg:"bg-blue-400",text:"text-white",bgLight:"bg-blue-400/10"},{border:"border-indigo-400",bg:"bg-indigo-400",text:"text-white",bgLight:"bg-indigo-400/10"},{border:"border-violet-400",bg:"bg-violet-400",text:"text-white",bgLight:"bg-violet-400/10"},{border:"border-pink-400",bg:"bg-pink-400",text:"text-white",bgLight:"bg-pink-400/10"},{border:"border-fuchsia-400",bg:"bg-fuchsia-400",text:"text-white",bgLight:"bg-fuchsia-400/10"},{border:"border-emerald-400",bg:"bg-emerald-400",text:"text-white",bgLight:"bg-emerald-400/10"},{border:"border-teal-400",bg:"bg-teal-400",text:"text-white",bgLight:"bg-teal-400/10"},{border:"border-cyan-400",bg:"bg-cyan-400",text:"text-white",bgLight:"bg-cyan-400/10"},{border:"border-sky-400",bg:"bg-sky-400",text:"text-white",bgLight:"bg-sky-400/10"},{border:"border-orange-400",bg:"bg-orange-400",text:"text-white",bgLight:"bg-orange-400/10"},{border:"border-amber-400",bg:"bg-amber-400",text:"text-white",bgLight:"bg-amber-400/10"},{border:"border-rose-400",bg:"bg-rose-400",text:"text-white",bgLight:"bg-rose-400/10"},{border:"border-lime-400",bg:"bg-lime-400",text:"text-white",bgLight:"bg-lime-400/10"}];function xf(t){let e=0;for(let n=0;n<t.length;n++)e=t.charCodeAt(n)+((e<<5)-e);return Math.abs(e)}function co(t){if(t==null)return null;const n=xf(t)%aa.length;return aa[n]}var fo="vercel.ai.error",_f=Symbol.for(fo),ua,oa,Ct=class ho extends(oa=Error,ua=_f,oa){constructor({name:e,message:n,cause:r}){super(n),this[ua]=!0,this.name=e,this.cause=r}static isInstance(e){return ho.hasMarker(e,fo)}static hasMarker(e,n){const r=Symbol.for(n);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function po(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var mo="AI_InvalidArgumentError",go=`vercel.ai.error.${mo}`,yf=Symbol.for(go),la,ca,Af=class extends(ca=Ct,la=yf,ca){constructor({message:t,cause:e,argument:n}){super({name:mo,message:t,cause:e}),this[la]=!0,this.argument=n}static isInstance(t){return Ct.hasMarker(t,go)}},bo="AI_JSONParseError",Eo=`vercel.ai.error.${bo}`,kf=Symbol.for(Eo),da,fa,ha=class extends(fa=Ct,da=kf,fa){constructor({text:t,cause:e}){super({name:bo,message:`JSON parsing failed: Text: ${t}.
|
|
3
|
-
Error message: ${po(e)}`,cause:e}),this[
|
|
4
|
-
Error message: ${po(n)}`,cause:n}),this[pa]=!0,this.value=e}static isInstance(e){return Ct.hasMarker(e,xo)}static wrap({value:e,cause:n}){return Ds.isInstance(n)&&n.value===e?n:new Ds({value:e,cause:n})}},cr=({prefix:t,size:e=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const i=n.length,a=new Array(e);for(let u=0;u<e;u++)a[u]=n[Math.random()*i|0];return a.join("")};if(t==null)return s;if(n.includes(r))throw new Af({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${t}${r}${s()}`},If=cr();function ga(t=globalThis){var e,n,r;return t.window?"runtime/browser":(e=t.navigator)!=null&&e.userAgent?`runtime/${t.navigator.userAgent.toLowerCase()}`:(r=(n=t.process)==null?void 0:n.versions)!=null&&r.node?`runtime/node.js/${t.process.version.substring(0)}`:t.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Qt(t){if(t==null)return{};const e={};if(t instanceof Headers)t.forEach((n,r)=>{e[r.toLowerCase()]=n});else{Array.isArray(t)||(t=Object.entries(t));for(const[n,r]of t)r!=null&&(e[n.toLowerCase()]=r)}return e}function ba(t,...e){const n=new Headers(Qt(t)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...e].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var Nf=/"__proto__"\s*:/,Sf=/"constructor"\s*:/;function Ea(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Nf.test(t)===!1&&Sf.test(t)===!1?e:wf(e)}function wf(t){let e=[t];for(;e.length;){const n=e;e=[];for(const r of n){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const s in r){const i=r[s];i&&typeof i=="object"&&e.push(i)}}}return t}function Rf(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return Ea(t)}try{return Ea(t)}finally{Error.stackTraceLimit=e}}function gi(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:n}=t;if(n!=null)for(const r of Object.keys(n))n[r]=Gt(n[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(Gt):Gt(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(Gt)),t.allOf!=null&&(t.allOf=t.allOf.map(Gt)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(Gt));const{definitions:e}=t;if(e!=null)for(const n of Object.keys(e))e[n]=Gt(e[n]);return t}function Gt(t){return typeof t=="boolean"?t:gi(t)}var Of=Symbol("Let zodToJsonSchema decide on which parser to use"),Ta={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Lf=t=>typeof t=="string"?{...Ta,name:t}:{...Ta,...t};function ct(){return{}}function vf(t,e){var n,r,s;const i={type:"array"};return(n=t.type)!=null&&n._def&&((s=(r=t.type)==null?void 0:r._def)==null?void 0:s.typeName)!==ne.ZodAny&&(i.items=be(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(i.minItems=t.minLength.value),t.maxLength&&(i.maxItems=t.maxLength.value),t.exactLength&&(i.minItems=t.exactLength.value,i.maxItems=t.exactLength.value),i}function Df(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function Pf(){return{type:"boolean"}}function _o(t,e){return be(t.type._def,e)}var Mf=(t,e)=>be(t.innerType._def,e);function yo(t,e,n){const r=n??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,i)=>yo(t,e,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Bf(t)}}var Bf=t=>{const e={type:"integer",format:"unix-time"};for(const n of t.checks)switch(n.kind){case"min":e.minimum=n.value;break;case"max":e.maximum=n.value;break}return e};function Ff(t,e){return{...be(t.innerType._def,e),default:t.defaultValue()}}function Uf(t,e){return e.effectStrategy==="input"?be(t.schema._def,e):ct()}function Hf(t){return{type:"string",enum:Array.from(t.values)}}var jf=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function zf(t,e){const n=[be(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),be(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),r=[];return n.forEach(s=>{if(jf(s))r.push(...s.allOf);else{let i=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:a,...u}=s;i=u}r.push(i)}}),r.length?{allOf:r}:void 0}function $f(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var cs=void 0,mt={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(cs===void 0&&(cs=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),cs),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Ao(t,e){const n={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":gt(n,"email",r.message,e);break;case"format:idn-email":gt(n,"idn-email",r.message,e);break;case"pattern:zod":Qe(n,mt.email,r.message,e);break}break;case"url":gt(n,"uri",r.message,e);break;case"uuid":gt(n,"uuid",r.message,e);break;case"regex":Qe(n,r.regex,r.message,e);break;case"cuid":Qe(n,mt.cuid,r.message,e);break;case"cuid2":Qe(n,mt.cuid2,r.message,e);break;case"startsWith":Qe(n,RegExp(`^${ds(r.value,e)}`),r.message,e);break;case"endsWith":Qe(n,RegExp(`${ds(r.value,e)}$`),r.message,e);break;case"datetime":gt(n,"date-time",r.message,e);break;case"date":gt(n,"date",r.message,e);break;case"time":gt(n,"time",r.message,e);break;case"duration":gt(n,"duration",r.message,e);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"includes":{Qe(n,RegExp(ds(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&>(n,"ipv4",r.message,e),r.version!=="v4"&>(n,"ipv6",r.message,e);break}case"base64url":Qe(n,mt.base64url,r.message,e);break;case"jwt":Qe(n,mt.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&Qe(n,mt.ipv4Cidr,r.message,e),r.version!=="v4"&&Qe(n,mt.ipv6Cidr,r.message,e);break}case"emoji":Qe(n,mt.emoji(),r.message,e);break;case"ulid":{Qe(n,mt.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{gt(n,"binary",r.message,e);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{Qe(n,mt.base64,r.message,e);break}}break}case"nanoid":Qe(n,mt.nanoid,r.message,e)}return n}function ds(t,e){return e.patternStrategy==="escape"?qf(t):t}var Yf=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function qf(t){let e="";for(let n=0;n<t.length;n++)Yf.has(t[n])||(e+="\\"),e+=t[n];return e}function gt(t,e,n,r){var s;t.format||(s=t.anyOf)!=null&&s.some(i=>i.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...n&&r.errorMessages&&{errorMessage:{format:n}}})):t.format=e}function Qe(t,e,n,r){var s;t.pattern||(s=t.allOf)!=null&&s.some(i=>i.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:xa(e,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):t.pattern=xa(e,r)}function xa(t,e){var n;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},s=r.i?t.source.toLowerCase():t.source;let i="",a=!1,u=!1,l=!1;for(let o=0;o<s.length;o++){if(a){i+=s[o],a=!1;continue}if(r.i){if(u){if(s[o].match(/[a-z]/)){l?(i+=s[o],i+=`${s[o-2]}-${s[o]}`.toUpperCase(),l=!1):s[o+1]==="-"&&((n=s[o+2])!=null&&n.match(/[a-z]/))?(i+=s[o],l=!0):i+=`${s[o]}${s[o].toUpperCase()}`;continue}}else if(s[o].match(/[a-z]/)){i+=`[${s[o]}${s[o].toUpperCase()}]`;continue}}if(r.m){if(s[o]==="^"){i+=`(^|(?<=[\r
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-7Ygumnp-.js","assets/index-BdoGlqOh.js","assets/index-Dh9ePU0t.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as j,c as Q,j as m,aH as ud,aI as od,aJ as ld,aK as nt,z as G,aL as Lr,aM as $u,aN as cd,aO as dd,aP as fd,L as Xe,J as Zn,I as ar,y as Te,aQ as te,aG as Pt,aR as hd,aS as Ae,_ as pd,X as ai,v as ui,x as oi,K as je,d as Yu,t as Kn,a as qu,f as Vu,aT as md,aU as gd,B as bd,E as Ed,aV as Td,a5 as xd,a6 as li,a8 as _d,a7 as yd,aa as Ad,as as kd,a3 as Cd,a9 as Id}from"./index-BdoGlqOh.js";import{c as ie,B as Me}from"./button-BQMZIX_4.js";import{i as Nd}from"./X-Bq7VzczH.js";import{I as ci,E as Sd}from"./empty-state-DeORHrTg.js";import{u as zt}from"./project-context-provider-DhgIBvJ2.js";import{a as ur,b as or,P as lr}from"./popover-CXUBdgho.js";import{T as wd}from"./textarea-CZGp5M36.js";import{i as Gu}from"./AlertCircle-DZfqNByx.js";import{i as Rd,E as Od}from"./error-boundary-KUKN2TxD.js";import{i as Ld}from"./ArrowUp-VMKONnWJ.js";import{t as vd}from"./ChevronDown-CUCzTkUk.js";import{u as Dd,i as di}from"./use-gateway-CijYzCU9.js";import{i as Pd}from"./Edit01-tXex8wx0.js";import{U as Md,c as Bd}from"./connection-BdWKvn2K.js";import{b as Fd}from"./use-collections-B_r4T3b1.js";import{u as Wu,a as Ud}from"./use-connection-W2V2j8pE.js";import{b as Hd}from"./use-binding-CdMfLY85.js";import{u as Xt}from"./useMutation-mOecCzvG.js";import{a as jd,u as zd}from"./use-gateway-system-prompt-CusPzWe3.js";import{u as vs,L as Qu}from"./localstorage-keys-DJgrMpsR.js";import{I as fi}from"./input-B0JGK4qg.js";import{T as xn,b as _n,a as hi,c as yn}from"./tooltip-DSjdME5j.js";import{i as $r}from"./Check-Clnl6VO2.js";import{i as Yr}from"./SearchMd-DsK25qy7.js";import{u as $d}from"./use-create-gateway-DGaCqRhz.js";import{S as Yd,a as qd,b as Vd,c as Gd,d as Wd}from"./select--nDzC8in.js";import{i as Qd}from"./File06-1GHbOIr4.js";import{c as Xd,i as Xu}from"./Grid01-Bf8eAyhK.js";import{a as Zd}from"./Image01-Ba0mxAoN.js";import{a as Kd,F as Jd,b as ef,c as tf,d as nf,e as rf,f as sf}from"./form-o9xmUpnK.js";import{S as Zu}from"./spinner-BJxZd1VB.js";import{a as pi}from"./Copy01-CCfh45Hm.js";import{i as af}from"./Terminal-cal0VHQd.js";import{M as Ku,s as na}from"./monaco-editor-2dgkKSmS.js";import{b as uf,c as of,d as lf,A as cf,a as df,e as ff,g as hf,f as pf}from"./alert-dialog-BBkPKiLO.js";import{O as mf,b as gf,c as bf}from"./well-known-mcp-DOEdYmKO.js";import{g as Ef}from"./generate-id-Dyweu44Y.js";import{s as Tf}from"./Trash01-pB5oOXYU.js";var Jn;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function n(s){throw new Error}t.assertNever=n,t.arrayToEnum=s=>{const i={};for(const a of s)i[a]=a;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(u=>typeof s[s[u]]!="number"),a={};for(const u of i)a[u]=s[u];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&i.push(a);return i},t.find=(s,i)=>{for(const a of s)if(i(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}t.joinValues=r,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(Jn||(Jn={}));var ra;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(ra||(ra={}));Jn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);Jn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class vr extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(i){return i.message},r={_errors:[]},s=i=>{for(const a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let u=r,l=0;for(;l<a.path.length;){const o=a.path[l];l===a.path.length-1?(u[o]=u[o]||{_errors:[]},u[o]._errors.push(n(a))):u[o]=u[o]||{_errors:[]},u=u[o],l++}}};return s(this),r}static assert(e){if(!(e instanceof vr))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Jn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n=Object.create(null),r=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];n[i]=n[i]||[],n[i].push(e(s))}else r.push(e(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}vr.create=t=>new vr(t);var sa;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(sa||(sa={}));var ne;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ne||(ne={}));const Ju=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M17.115 15.358c-.27.306-.554.608-.851.905-4.296 4.296-9.678 5.88-12.021 3.536-1.607-1.606-1.368-4.641.325-7.775M6.89 8.725c.281-.32.578-.636.888-.947C12.074 3.482 17.456 1.9 19.8 4.243c1.608 1.607 1.367 4.645-.33 7.781m-3.206-4.246c4.296 4.296 5.88 9.678 3.536 12.021-2.343 2.343-7.725.76-12.02-3.535C3.483 11.968 1.9 6.586 4.244 4.243c2.343-2.343 7.725-.76 12.02 3.535ZM13 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));Ju.displayName="Atom02";const eo=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));eo.displayName="ChevronSelectorVertical";const to=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M15.938 15.938A7.001 7.001 0 0 0 15 2a7.001 7.001 0 0 0-6.938 6.062M16 15a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));to.displayName="Coins01";const no=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M9 14 4 9m0 0 5-5M4 9h6.4c3.36 0 5.04 0 6.324.654a6 6 0 0 1 2.622 2.622C20 13.56 20 15.24 20 18.6V20"}));no.displayName="CornerUpLeft";const ro=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M6 16a4 4 0 0 0 4 4h4a4 4 0 0 0 0-8h-4a4 4 0 0 1 0-8h4a4 4 0 0 1 4 4m-6-6v20"}));ro.displayName="CurrencyDollar";const so=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m18 10-4-4M2.5 21.5l3.384-.376c.414-.046.62-.069.814-.131a2 2 0 0 0 .485-.234c.17-.111.317-.259.61-.553L21 7a2.828 2.828 0 1 0-4-4L3.794 16.206c-.294.294-.442.442-.553.611a2 2 0 0 0-.234.485c-.062.193-.085.4-.131.814L2.5 21.5Z"}));so.displayName="Edit02";const io=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M15 16.5V19c0 .932 0 1.398-.152 1.765a2 2 0 0 1-1.083 1.083C13.398 22 12.932 22 12 22c-.932 0-1.398 0-1.765-.152a2 2 0 0 1-1.083-1.083C9 20.398 9 19.932 9 19v-2.5m6 0c2.649-1.157 4.5-3.925 4.5-7a7.5 7.5 0 0 0-15 0c0 3.075 1.851 5.843 4.5 7m6 0H9"}));io.displayName="Lightbulb01";const ao=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m18 8 4 4m0 0-4 4m4-4H9m6-7.796A8.383 8.383 0 0 0 10.667 3C5.88 3 2 7.03 2 12s3.88 9 8.667 9A8.384 8.384 0 0 0 15 19.796"}));ao.displayName="LogOut04";const qr=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m6.5 13 .784 1.569c.266.53.399.796.576 1.026a3 3 0 0 0 .545.545c.23.177.495.31 1.026.575L11 17.5l-1.569.785c-.53.265-.796.398-1.026.575a3 3 0 0 0-.545.545c-.177.23-.31.495-.576 1.026L6.5 22l-.784-1.569c-.266-.53-.399-.796-.576-1.026a3 3 0 0 0-.545-.545c-.23-.177-.495-.31-1.026-.575L2 17.5l1.569-.785c.53-.265.796-.398 1.026-.575a3 3 0 0 0 .545-.545c.177-.23.31-.495.576-1.026L6.5 13ZM15 2l1.179 3.064c.282.734.423 1.1.642 1.409a3 3 0 0 0 .706.706c.309.22.675.36 1.409.642L22 9l-3.064 1.179c-.734.282-1.1.423-1.409.642a3 3 0 0 0-.706.706c-.22.309-.36.675-.642 1.409L15 16l-1.179-3.064c-.282-.734-.423-1.1-.642-1.409a3 3 0 0 0-.706-.706c-.309-.22-.675-.36-1.409-.642L8 9l3.064-1.179c.734-.282 1.1-.423 1.409-.642a3 3 0 0 0 .706-.706c.22-.309.36-.675.642-1.409L15 2Z"}));qr.displayName="Stars01";const uo=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));uo.displayName="Stop";const oo=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"M16 8V5l3-3 1 2 2 1-3 3h-3Zm0 0-4 4m10 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2m5 10a5 5 0 1 1-5-5"}));oo.displayName="Target04";const lo=({size:t=24,color:e="currentColor",...n})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},j.createElement("path",{d:"m15 9-6 6m0-6 6 6m7-3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));lo.displayName="XCircle";function $e(t){const e=Q.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let s;e[3]!==n?(s=ie("bg-accent animate-pulse rounded-md",n),e[3]=n,e[4]=s):s=e[4];let i;return e[5]!==r||e[6]!==s?(i=m.jsx("div",{"data-slot":"skeleton",className:s,...r}),e[5]=r,e[6]=s,e[7]=i):i=e[7],i}const ia=[{border:"border-purple-400",bg:"bg-purple-400",text:"text-white",bgLight:"bg-purple-400/10"},{border:"border-blue-400",bg:"bg-blue-400",text:"text-white",bgLight:"bg-blue-400/10"},{border:"border-indigo-400",bg:"bg-indigo-400",text:"text-white",bgLight:"bg-indigo-400/10"},{border:"border-violet-400",bg:"bg-violet-400",text:"text-white",bgLight:"bg-violet-400/10"},{border:"border-pink-400",bg:"bg-pink-400",text:"text-white",bgLight:"bg-pink-400/10"},{border:"border-fuchsia-400",bg:"bg-fuchsia-400",text:"text-white",bgLight:"bg-fuchsia-400/10"},{border:"border-emerald-400",bg:"bg-emerald-400",text:"text-white",bgLight:"bg-emerald-400/10"},{border:"border-teal-400",bg:"bg-teal-400",text:"text-white",bgLight:"bg-teal-400/10"},{border:"border-cyan-400",bg:"bg-cyan-400",text:"text-white",bgLight:"bg-cyan-400/10"},{border:"border-sky-400",bg:"bg-sky-400",text:"text-white",bgLight:"bg-sky-400/10"},{border:"border-orange-400",bg:"bg-orange-400",text:"text-white",bgLight:"bg-orange-400/10"},{border:"border-amber-400",bg:"bg-amber-400",text:"text-white",bgLight:"bg-amber-400/10"},{border:"border-rose-400",bg:"bg-rose-400",text:"text-white",bgLight:"bg-rose-400/10"},{border:"border-lime-400",bg:"bg-lime-400",text:"text-white",bgLight:"bg-lime-400/10"}];function xf(t){let e=0;for(let n=0;n<t.length;n++)e=t.charCodeAt(n)+((e<<5)-e);return Math.abs(e)}function co(t){if(t==null)return null;const n=xf(t)%ia.length;return ia[n]}var fo="vercel.ai.error",_f=Symbol.for(fo),aa,ua,Ct=class ho extends(ua=Error,aa=_f,ua){constructor({name:e,message:n,cause:r}){super(n),this[aa]=!0,this.name=e,this.cause=r}static isInstance(e){return ho.hasMarker(e,fo)}static hasMarker(e,n){const r=Symbol.for(n);return e!=null&&typeof e=="object"&&r in e&&typeof e[r]=="boolean"&&e[r]===!0}};function po(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var mo="AI_InvalidArgumentError",go=`vercel.ai.error.${mo}`,yf=Symbol.for(go),oa,la,Af=class extends(la=Ct,oa=yf,la){constructor({message:t,cause:e,argument:n}){super({name:mo,message:t,cause:e}),this[oa]=!0,this.argument=n}static isInstance(t){return Ct.hasMarker(t,go)}},bo="AI_JSONParseError",Eo=`vercel.ai.error.${bo}`,kf=Symbol.for(Eo),ca,da,fa=class extends(da=Ct,ca=kf,da){constructor({text:t,cause:e}){super({name:bo,message:`JSON parsing failed: Text: ${t}.
|
|
3
|
+
Error message: ${po(e)}`,cause:e}),this[ca]=!0,this.text=t}static isInstance(t){return Ct.hasMarker(t,Eo)}},To="AI_TypeValidationError",xo=`vercel.ai.error.${To}`,Cf=Symbol.for(xo),ha,pa,gn=class Ds extends(pa=Ct,ha=Cf,pa){constructor({value:e,cause:n}){super({name:To,message:`Type validation failed: Value: ${JSON.stringify(e)}.
|
|
4
|
+
Error message: ${po(n)}`,cause:n}),this[ha]=!0,this.value=e}static isInstance(e){return Ct.hasMarker(e,xo)}static wrap({value:e,cause:n}){return Ds.isInstance(n)&&n.value===e?n:new Ds({value:e,cause:n})}},cr=({prefix:t,size:e=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const s=()=>{const i=n.length,a=new Array(e);for(let u=0;u<e;u++)a[u]=n[Math.random()*i|0];return a.join("")};if(t==null)return s;if(n.includes(r))throw new Af({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${t}${r}${s()}`},If=cr();function ma(t=globalThis){var e,n,r;return t.window?"runtime/browser":(e=t.navigator)!=null&&e.userAgent?`runtime/${t.navigator.userAgent.toLowerCase()}`:(r=(n=t.process)==null?void 0:n.versions)!=null&&r.node?`runtime/node.js/${t.process.version.substring(0)}`:t.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Qt(t){if(t==null)return{};const e={};if(t instanceof Headers)t.forEach((n,r)=>{e[r.toLowerCase()]=n});else{Array.isArray(t)||(t=Object.entries(t));for(const[n,r]of t)r!=null&&(e[n.toLowerCase()]=r)}return e}function ga(t,...e){const n=new Headers(Qt(t)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...e].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var Nf=/"__proto__"\s*:/,Sf=/"constructor"\s*:/;function ba(t){const e=JSON.parse(t);return e===null||typeof e!="object"||Nf.test(t)===!1&&Sf.test(t)===!1?e:wf(e)}function wf(t){let e=[t];for(;e.length;){const n=e;e=[];for(const r of n){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const s in r){const i=r[s];i&&typeof i=="object"&&e.push(i)}}}return t}function Rf(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return ba(t)}try{return ba(t)}finally{Error.stackTraceLimit=e}}function mi(t){if(t.type==="object"||Array.isArray(t.type)&&t.type.includes("object")){t.additionalProperties=!1;const{properties:n}=t;if(n!=null)for(const r of Object.keys(n))n[r]=Gt(n[r])}t.items!=null&&(t.items=Array.isArray(t.items)?t.items.map(Gt):Gt(t.items)),t.anyOf!=null&&(t.anyOf=t.anyOf.map(Gt)),t.allOf!=null&&(t.allOf=t.allOf.map(Gt)),t.oneOf!=null&&(t.oneOf=t.oneOf.map(Gt));const{definitions:e}=t;if(e!=null)for(const n of Object.keys(e))e[n]=Gt(e[n]);return t}function Gt(t){return typeof t=="boolean"?t:mi(t)}var Of=Symbol("Let zodToJsonSchema decide on which parser to use"),Ea={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Lf=t=>typeof t=="string"?{...Ea,name:t}:{...Ea,...t};function ct(){return{}}function vf(t,e){var n,r,s;const i={type:"array"};return(n=t.type)!=null&&n._def&&((s=(r=t.type)==null?void 0:r._def)==null?void 0:s.typeName)!==ne.ZodAny&&(i.items=be(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(i.minItems=t.minLength.value),t.maxLength&&(i.maxItems=t.maxLength.value),t.exactLength&&(i.minItems=t.exactLength.value,i.maxItems=t.exactLength.value),i}function Df(t){const e={type:"integer",format:"int64"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function Pf(){return{type:"boolean"}}function _o(t,e){return be(t.type._def,e)}var Mf=(t,e)=>be(t.innerType._def,e);function yo(t,e,n){const r=n??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((s,i)=>yo(t,e,s))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Bf(t)}}var Bf=t=>{const e={type:"integer",format:"unix-time"};for(const n of t.checks)switch(n.kind){case"min":e.minimum=n.value;break;case"max":e.maximum=n.value;break}return e};function Ff(t,e){return{...be(t.innerType._def,e),default:t.defaultValue()}}function Uf(t,e){return e.effectStrategy==="input"?be(t.schema._def,e):ct()}function Hf(t){return{type:"string",enum:Array.from(t.values)}}var jf=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function zf(t,e){const n=[be(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),be(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),r=[];return n.forEach(s=>{if(jf(s))r.push(...s.allOf);else{let i=s;if("additionalProperties"in s&&s.additionalProperties===!1){const{additionalProperties:a,...u}=s;i=u}r.push(i)}}),r.length?{allOf:r}:void 0}function $f(t){const e=typeof t.value;return e!=="bigint"&&e!=="number"&&e!=="boolean"&&e!=="string"?{type:Array.isArray(t.value)?"array":"object"}:{type:e==="bigint"?"integer":e,const:t.value}}var ls=void 0,mt={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(ls===void 0&&(ls=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ls),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Ao(t,e){const n={type:"string"};if(t.checks)for(const r of t.checks)switch(r.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(e.emailStrategy){case"format:email":gt(n,"email",r.message,e);break;case"format:idn-email":gt(n,"idn-email",r.message,e);break;case"pattern:zod":Qe(n,mt.email,r.message,e);break}break;case"url":gt(n,"uri",r.message,e);break;case"uuid":gt(n,"uuid",r.message,e);break;case"regex":Qe(n,r.regex,r.message,e);break;case"cuid":Qe(n,mt.cuid,r.message,e);break;case"cuid2":Qe(n,mt.cuid2,r.message,e);break;case"startsWith":Qe(n,RegExp(`^${cs(r.value,e)}`),r.message,e);break;case"endsWith":Qe(n,RegExp(`${cs(r.value,e)}$`),r.message,e);break;case"datetime":gt(n,"date-time",r.message,e);break;case"date":gt(n,"date",r.message,e);break;case"time":gt(n,"time",r.message,e);break;case"duration":gt(n,"duration",r.message,e);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"includes":{Qe(n,RegExp(cs(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&>(n,"ipv4",r.message,e),r.version!=="v4"&>(n,"ipv6",r.message,e);break}case"base64url":Qe(n,mt.base64url,r.message,e);break;case"jwt":Qe(n,mt.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&Qe(n,mt.ipv4Cidr,r.message,e),r.version!=="v4"&&Qe(n,mt.ipv6Cidr,r.message,e);break}case"emoji":Qe(n,mt.emoji(),r.message,e);break;case"ulid":{Qe(n,mt.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{gt(n,"binary",r.message,e);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{Qe(n,mt.base64,r.message,e);break}}break}case"nanoid":Qe(n,mt.nanoid,r.message,e)}return n}function cs(t,e){return e.patternStrategy==="escape"?qf(t):t}var Yf=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function qf(t){let e="";for(let n=0;n<t.length;n++)Yf.has(t[n])||(e+="\\"),e+=t[n];return e}function gt(t,e,n,r){var s;t.format||(s=t.anyOf)!=null&&s.some(i=>i.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format}),delete t.format),t.anyOf.push({format:e,...n&&r.errorMessages&&{errorMessage:{format:n}}})):t.format=e}function Qe(t,e,n,r){var s;t.pattern||(s=t.allOf)!=null&&s.some(i=>i.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Ta(e,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):t.pattern=Ta(e,r)}function Ta(t,e){var n;if(!e.applyRegexFlags||!t.flags)return t.source;const r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},s=r.i?t.source.toLowerCase():t.source;let i="",a=!1,u=!1,l=!1;for(let o=0;o<s.length;o++){if(a){i+=s[o],a=!1;continue}if(r.i){if(u){if(s[o].match(/[a-z]/)){l?(i+=s[o],i+=`${s[o-2]}-${s[o]}`.toUpperCase(),l=!1):s[o+1]==="-"&&((n=s[o+2])!=null&&n.match(/[a-z]/))?(i+=s[o],l=!0):i+=`${s[o]}${s[o].toUpperCase()}`;continue}}else if(s[o].match(/[a-z]/)){i+=`[${s[o]}${s[o].toUpperCase()}]`;continue}}if(r.m){if(s[o]==="^"){i+=`(^|(?<=[\r
|
|
5
5
|
]))`;continue}else if(s[o]==="$"){i+=`($|(?=[\r
|
|
6
6
|
]))`;continue}}if(r.s&&s[o]==="."){i+=u?`${s[o]}\r
|
|
7
7
|
`:`[${s[o]}\r
|
|
8
|
-
]`;continue}i+=s[o],s[o]==="\\"?a=!0:u&&s[o]==="]"?u=!1:!u&&s[o]==="["&&(u=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return i}function ko(t,e){var n,r,s,i,a,u;const l={type:"object",additionalProperties:(n=be(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?n:e.allowedAdditionalProperties};if(((r=t.keyType)==null?void 0:r._def.typeName)===ne.ZodString&&((s=t.keyType._def.checks)!=null&&s.length)){const{type:o,...d}=Ao(t.keyType._def,e);return{...l,propertyNames:d}}else{if(((i=t.keyType)==null?void 0:i._def.typeName)===ne.ZodEnum)return{...l,propertyNames:{enum:t.keyType._def.values}};if(((a=t.keyType)==null?void 0:a._def.typeName)===ne.ZodBranded&&t.keyType._def.type._def.typeName===ne.ZodString&&((u=t.keyType._def.type._def.checks)!=null&&u.length)){const{type:o,...d}=_o(t.keyType._def,e);return{...l,propertyNames:d}}}return l}function Vf(t,e){if(e.mapStrategy==="record")return ko(t,e);const n=be(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||ct(),r=be(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||ct();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function Gf(t){const e=t.values,r=Object.keys(t.values).filter(i=>typeof e[e[i]]!="number").map(i=>e[i]),s=Array.from(new Set(r.map(i=>typeof i)));return{type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:r}}function Wf(){return{not:ct()}}function Qf(){return{type:"null"}}var Ps={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Xf(t,e){const n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in Ps&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((s,i)=>{const a=Ps[i._def.typeName];return a&&!s.includes(a)?[...s,a]:s},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((s,i)=>{const a=typeof i._def.value;switch(a){case"string":case"number":case"boolean":return[...s,a];case"bigint":return[...s,"integer"];case"object":if(i._def.value===null)return[...s,"null"];default:return s}},[]);if(r.length===n.length){const s=r.filter((i,a,u)=>u.indexOf(i)===a);return{type:s.length>1?s:s[0],enum:n.reduce((i,a)=>i.includes(a._def.value)?i:[...i,a._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,s)=>[...r,...s._def.values.filter(i=>!r.includes(i))],[])};return Zf(t,e)}var Zf=(t,e)=>{const n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((r,s)=>be(r._def,{...e,currentPath:[...e.currentPath,"anyOf",`${s}`]})).filter(r=>!!r&&(!e.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function Kf(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[Ps[t.innerType._def.typeName],"null"]};const n=be(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function Jf(t){const e={type:"number"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"int":e.type="integer";break;case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function eh(t,e){const n={type:"object",properties:{}},r=[],s=t.shape();for(const a in s){let u=s[a];if(u===void 0||u._def===void 0)continue;const l=nh(u),o=be(u._def,{...e,currentPath:[...e.currentPath,"properties",a],propertyPath:[...e.currentPath,"properties",a]});o!==void 0&&(n.properties[a]=o,l||r.push(a))}r.length&&(n.required=r);const i=th(t,e);return i!==void 0&&(n.additionalProperties=i),n}function th(t,e){if(t.catchall._def.typeName!=="ZodNever")return be(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function nh(t){try{return t.isOptional()}catch{return!0}}var rh=(t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return be(t.innerType._def,e);const r=be(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:ct()},r]}:ct()},sh=(t,e)=>{if(e.pipeStrategy==="input")return be(t.in._def,e);if(e.pipeStrategy==="output")return be(t.out._def,e);const n=be(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),r=be(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(s=>s!==void 0)}};function ih(t,e){return be(t.type._def,e)}function ah(t,e){const r={type:"array",uniqueItems:!0,items:be(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&(r.minItems=t.minSize.value),t.maxSize&&(r.maxItems=t.maxSize.value),r}function uh(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,r)=>be(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:be(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,r)=>be(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function oh(){return{not:ct()}}function lh(){return ct()}var ch=(t,e)=>be(t.innerType._def,e),dh=(t,e,n)=>{switch(e){case ne.ZodString:return Ao(t,n);case ne.ZodNumber:return Jf(t);case ne.ZodObject:return eh(t,n);case ne.ZodBigInt:return Df(t);case ne.ZodBoolean:return Pf();case ne.ZodDate:return yo(t,n);case ne.ZodUndefined:return oh();case ne.ZodNull:return Qf();case ne.ZodArray:return vf(t,n);case ne.ZodUnion:case ne.ZodDiscriminatedUnion:return Xf(t,n);case ne.ZodIntersection:return zf(t,n);case ne.ZodTuple:return uh(t,n);case ne.ZodRecord:return ko(t,n);case ne.ZodLiteral:return $f(t);case ne.ZodEnum:return Hf(t);case ne.ZodNativeEnum:return Gf(t);case ne.ZodNullable:return Kf(t,n);case ne.ZodOptional:return rh(t,n);case ne.ZodMap:return Vf(t,n);case ne.ZodSet:return ah(t,n);case ne.ZodLazy:return()=>t.getter()._def;case ne.ZodPromise:return ih(t,n);case ne.ZodNaN:case ne.ZodNever:return Wf();case ne.ZodEffects:return Uf(t,n);case ne.ZodAny:return ct();case ne.ZodUnknown:return lh();case ne.ZodDefault:return Ff(t,n);case ne.ZodBranded:return _o(t,n);case ne.ZodReadonly:return ch(t,n);case ne.ZodCatch:return Mf(t,n);case ne.ZodPipeline:return sh(t,n);case ne.ZodFunction:case ne.ZodVoid:case ne.ZodSymbol:return;default:return(r=>{})()}},fh=(t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")};function be(t,e,n=!1){var r;const s=e.seen.get(t);if(e.override){const l=(r=e.override)==null?void 0:r.call(e,t,e,s,n);if(l!==Of)return l}if(s&&!n){const l=hh(s,e);if(l!==void 0)return l}const i={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,i);const a=dh(t,t.typeName,e),u=typeof a=="function"?be(a(),e):a;if(u&&ph(t,e,u),e.postProcess){const l=e.postProcess(u,t,e);return i.jsonSchema=u,l}return i.jsonSchema=u,u}var hh=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:fh(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,r)=>e.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),ct()):e.$refStrategy==="seen"?ct():void 0}},ph=(t,e,n)=>(t.description&&(n.description=t.description),n),mh=t=>{const e=Lf(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([r,s])=>[s._def,{def:s._def,path:[...e.basePath,e.definitionPath,r],jsonSchema:void 0}]))}},gh=(t,e)=>{var n;const r=mh(e);let s=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((o,[d,f])=>{var p;return{...o,[d]:(p=be(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0))!=null?p:ct()}},{}):void 0;const i=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,a=(n=be(t._def,i===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,i]},!1))!=null?n:ct(),u=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;u!==void 0&&(a.title=u);const l=i===void 0?s?{...a,[r.definitionPath]:s}:a:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,i].join("/"),[r.definitionPath]:{...s,[i]:a}};return l.$schema="http://json-schema.org/draft-07/schema#",l},Ms=Symbol.for("vercel.ai.schema");function bh(t){let e;return()=>(e==null&&(e=t()),e)}function Gr(t,{validate:e}={}){return{[Ms]:!0,_type:void 0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function Eh(t){return typeof t=="object"&&t!==null&&Ms in t&&t[Ms]===!0&&"jsonSchema"in t&&"validate"in t}function bi(t){return t==null?Gr({properties:{},additionalProperties:!1}):Eh(t)?t:"~standard"in t?t["~standard"].vendor==="zod"?Co(t):Th(t):t()}function Th(t){return Gr(()=>gi(t["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async e=>{const n=await t["~standard"].validate(e);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new gn({value:e,cause:n.issues})}}})}function xh(t,e){var n;const r=(n=void 0)!=null?n:!1;return Gr(()=>gh(t,{$refStrategy:r?"root":"none"}),{validate:async s=>{const i=await t.safeParseAsync(s);return i.success?{success:!0,value:i.data}:{success:!1,error:i.error}}})}function _h(t,e){var n;const r=(n=void 0)!=null?n:!1;return Gr(()=>gi(ld(t,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async s=>{const i=await od(t,s);return i.success?{success:!0,value:i.data}:{success:!1,error:i.error}}})}function yh(t){return"_zod"in t}function Co(t,e){return yh(t)?_h(t):xh(t)}async function _a({value:t,schema:e}){const n=await er({value:t,schema:e});if(!n.success)throw gn.wrap({value:t,cause:n.error});return n.value}async function er({value:t,schema:e}){const n=bi(e);try{if(n.validate==null)return{success:!0,value:t,rawValue:t};const r=await n.validate(t);return r.success?{success:!0,value:r.value,rawValue:t}:{success:!1,error:gn.wrap({value:t,cause:r.error}),rawValue:t}}catch(r){return{success:!1,error:gn.wrap({value:t,cause:r}),rawValue:t}}}async function Jt({text:t,schema:e}){try{const n=Rf(t);return e==null?{success:!0,value:n,rawValue:n}:await er({value:n,schema:e})}catch(n){return{success:!1,error:ha.isInstance(n)?n:new ha({text:t,cause:n}),rawValue:void 0}}}function Ah({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new ud).pipeThrough(new TransformStream({async transform({data:n},r){n!=="[DONE]"&&r.enqueue(await Jt({text:n,schema:e}))}}))}async function Ut(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}var kh=Object.defineProperty,Ch=(t,e)=>{for(var n in e)kh(t,n,{get:e[n],enumerable:!0})},Io="AI_NoObjectGeneratedError",No=`vercel.ai.error.${Io}`,Ih=Symbol.for(No),So,jt=class extends Ct{constructor({message:t="No object generated.",cause:e,text:n,response:r,usage:s,finishReason:i}){super({name:Io,message:t,cause:e}),this[So]=!0,this.text=n,this.response=r,this.usage=s,this.finishReason=i}static isInstance(t){return Ct.hasMarker(t,No)}};So=Ih;var wo="AI_UIMessageStreamError",Ro=`vercel.ai.error.${wo}`,Nh=Symbol.for(Ro),Oo,on=class extends Ct{constructor({chunkType:t,chunkId:e,message:n}){super({name:wo,message:n}),this[Oo]=!0,this.chunkType=t,this.chunkId=e}static isInstance(t){return Ct.hasMarker(t,Ro)}};Oo=Nh;var ya="6.0.38",Lo=nt([G(),Lr(Uint8Array),Lr(ArrayBuffer),Yu(t=>{var e,n;return(n=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?n:!1},{message:"Must be a Buffer"})]),tr=cd(()=>nt([dd(),G(),fd(),Xe(),Zn(G(),tr.optional()),ar(tr)])),ce=Zn(G(),Zn(G(),tr.optional())),vo=Te({type:te("text"),text:G(),providerOptions:ce.optional()}),Sh=Te({type:te("image"),image:nt([Lo,Lr(URL)]),mediaType:G().optional(),providerOptions:ce.optional()}),Do=Te({type:te("file"),data:nt([Lo,Lr(URL)]),filename:G().optional(),mediaType:G(),providerOptions:ce.optional()}),wh=Te({type:te("reasoning"),text:G(),providerOptions:ce.optional()}),Rh=Te({type:te("tool-call"),toolCallId:G(),toolName:G(),input:Pt(),providerOptions:ce.optional(),providerExecuted:Xe().optional()}),Oh=hd("type",[Te({type:te("text"),value:G(),providerOptions:ce.optional()}),Te({type:te("json"),value:tr,providerOptions:ce.optional()}),Te({type:te("execution-denied"),reason:G().optional(),providerOptions:ce.optional()}),Te({type:te("error-text"),value:G(),providerOptions:ce.optional()}),Te({type:te("error-json"),value:tr,providerOptions:ce.optional()}),Te({type:te("content"),value:ar(nt([Te({type:te("text"),text:G(),providerOptions:ce.optional()}),Te({type:te("media"),data:G(),mediaType:G()}),Te({type:te("file-data"),data:G(),mediaType:G(),filename:G().optional(),providerOptions:ce.optional()}),Te({type:te("file-url"),url:G(),providerOptions:ce.optional()}),Te({type:te("file-id"),fileId:nt([G(),Zn(G(),G())]),providerOptions:ce.optional()}),Te({type:te("image-data"),data:G(),mediaType:G(),providerOptions:ce.optional()}),Te({type:te("image-url"),url:G(),providerOptions:ce.optional()}),Te({type:te("image-file-id"),fileId:nt([G(),Zn(G(),G())]),providerOptions:ce.optional()}),Te({type:te("custom"),providerOptions:ce.optional()})]))})]),Po=Te({type:te("tool-result"),toolCallId:G(),toolName:G(),output:Oh,providerOptions:ce.optional()}),Lh=Te({type:te("tool-approval-request"),approvalId:G(),toolCallId:G()}),vh=Te({type:te("tool-approval-response"),approvalId:G(),approved:Xe(),reason:G().optional()}),Dh=Te({role:te("system"),content:G(),providerOptions:ce.optional()}),Ph=Te({role:te("user"),content:nt([G(),ar(nt([vo,Sh,Do]))]),providerOptions:ce.optional()}),Mh=Te({role:te("assistant"),content:nt([G(),ar(nt([vo,Do,wh,Rh,Po,Lh]))]),providerOptions:ce.optional()}),Bh=Te({role:te("tool"),content:ar(nt([Po,vh])),providerOptions:ce.optional()});nt([Dh,Ph,Mh,Bh]);function Mo(t,e){if(t===void 0&&e===void 0)return;if(t===void 0)return e;if(e===void 0)return t;const n={...t};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const s=e[r];if(s===void 0)continue;const i=r in t?t[r]:void 0,a=s!==null&&typeof s=="object"&&!Array.isArray(s)&&!(s instanceof Date)&&!(s instanceof RegExp),u=i!=null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp);a&&u?n[r]=Mo(i,s):n[r]=s}return n}var Fh={};Ch(Fh,{array:()=>zh,choice:()=>$h,json:()=>Yh,object:()=>jh,text:()=>Hh});function Uh(t){const e=["ROOT"];let n=-1,r=null;function s(l,o,d){switch(l){case'"':{n=o,e.pop(),e.push(d),e.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=o,r=o,e.pop(),e.push(d),e.push("INSIDE_LITERAL");break}case"-":{e.pop(),e.push(d),e.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=o,e.pop(),e.push(d),e.push("INSIDE_NUMBER");break}case"{":{n=o,e.pop(),e.push(d),e.push("INSIDE_OBJECT_START");break}case"[":{n=o,e.pop(),e.push(d),e.push("INSIDE_ARRAY_START");break}}}function i(l,o){switch(l){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=o,e.pop();break}}}function a(l,o){switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=o,e.pop();break}}}for(let l=0;l<t.length;l++){const o=t[l];switch(e[e.length-1]){case"ROOT":s(o,l,"FINISH");break;case"INSIDE_OBJECT_START":{switch(o){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{n=l,e.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{o==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{o==='"'&&(e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{o===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{s(o,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{i(o,l);break}case"INSIDE_STRING":{switch(o){case'"':{e.pop(),n=l;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:n=l}break}case"INSIDE_ARRAY_START":{o==="]"?(n=l,e.pop()):(n=l,s(o,l,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(o){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,e.pop();break}default:{n=l;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{s(o,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),n=l;break}case"INSIDE_NUMBER":{switch(o){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(o,l),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(o,l);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(o,l);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(o,l);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const f=t.substring(r,l+1);!"false".startsWith(f)&&!"true".startsWith(f)&&!"null".startsWith(f)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?i(o,l):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(o,l)):n=l;break}}}let u=t.slice(0,n+1);for(let l=e.length-1;l>=0;l--)switch(e[l]){case"INSIDE_STRING":{u+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{u+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{u+="]";break}case"INSIDE_LITERAL":{const d=t.substring(r,t.length);"true".startsWith(d)?u+="true".slice(d.length):"false".startsWith(d)?u+="false".slice(d.length):"null".startsWith(d)&&(u+="null".slice(d.length))}}return u}async function dr(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await Jt({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await Jt({text:Uh(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Hh=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:t}){return t},async parsePartialOutput({text:t}){return{partial:t}},createElementStreamTransform(){}}),jh=({schema:t,name:e,description:n})=>{const r=bi(t);return{name:"object",responseFormat:Ut(r.jsonSchema).then(s=>({type:"json",schema:s,...e!=null&&{name:e},...n!=null&&{description:n}})),async parseCompleteOutput({text:s},i){const a=await Jt({text:s});if(!a.success)throw new jt({message:"No object generated: could not parse the response.",cause:a.error,text:s,response:i.response,usage:i.usage,finishReason:i.finishReason});const u=await er({value:a.value,schema:r});if(!u.success)throw new jt({message:"No object generated: response did not match schema.",cause:u.error,text:s,response:i.response,usage:i.usage,finishReason:i.finishReason});return u.value},async parsePartialOutput({text:s}){const i=await dr(s);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:i.value}}},createElementStreamTransform(){}}},zh=({element:t,name:e,description:n})=>{const r=bi(t);return{name:"array",responseFormat:Ut(r.jsonSchema).then(s=>{const{$schema:i,...a}=s;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:a}},required:["elements"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}}),async parseCompleteOutput({text:s},i){const a=await Jt({text:s});if(!a.success)throw new jt({message:"No object generated: could not parse the response.",cause:a.error,text:s,response:i.response,usage:i.usage,finishReason:i.finishReason});const u=a.value;if(u==null||typeof u!="object"||!("elements"in u)||!Array.isArray(u.elements))throw new jt({message:"No object generated: response did not match schema.",cause:new gn({value:u,cause:"response must be an object with an elements array"}),text:s,response:i.response,usage:i.usage,finishReason:i.finishReason});for(const l of u.elements){const o=await er({value:l,schema:r});if(!o.success)throw new jt({message:"No object generated: response did not match schema.",cause:o.error,text:s,response:i.response,usage:i.usage,finishReason:i.finishReason})}return u.elements},async parsePartialOutput({text:s}){const i=await dr(s);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const a=i.value;if(a==null||typeof a!="object"||!("elements"in a)||!Array.isArray(a.elements))return;const u=i.state==="repaired-parse"&&a.elements.length>0?a.elements.slice(0,-1):a.elements,l=[];for(const o of u){const d=await er({value:o,schema:r});d.success&&l.push(d.value)}return{partial:l}}}},createElementStreamTransform(){let s=0;return new TransformStream({transform({partialOutput:i},a){if(i!=null)for(;s<i.length;s++)a.enqueue(i[s])}})}}},$h=({options:t,name:e,description:n})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:t}},required:["result"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}),async parseCompleteOutput({text:r},s){const i=await Jt({text:r});if(!i.success)throw new jt({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:s.response,usage:s.usage,finishReason:s.finishReason});const a=i.value;if(a==null||typeof a!="object"||!("result"in a)||typeof a.result!="string"||!t.includes(a.result))throw new jt({message:"No object generated: response did not match schema.",cause:new gn({value:a,cause:"response must be an object that contains a choice value."}),text:r,response:s.response,usage:s.usage,finishReason:s.finishReason});return a.result},async parsePartialOutput({text:r}){const s=await dr(r);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const i=s.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string")return;const a=t.filter(u=>u.startsWith(i.result));return s.state==="successful-parse"?a.includes(i.result)?{partial:i.result}:void 0:a.length===1?{partial:a[0]}:void 0}}},createElementStreamTransform(){}}),Yh=({name:t,description:e}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...t!=null&&{name:t},...e!=null&&{description:e}}),async parseCompleteOutput({text:n},r){const s=await Jt({text:n});if(!s.success)throw new jt({message:"No object generated: could not parse the response.",cause:s.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return s.value},async parsePartialOutput({text:n}){const r=await dr(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return r.value===void 0?void 0:{partial:r.value}}},createElementStreamTransform(){}});cr({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
|
|
8
|
+
]`;continue}i+=s[o],s[o]==="\\"?a=!0:u&&s[o]==="]"?u=!1:!u&&s[o]==="["&&(u=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),t.source}return i}function ko(t,e){var n,r,s,i,a,u;const l={type:"object",additionalProperties:(n=be(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?n:e.allowedAdditionalProperties};if(((r=t.keyType)==null?void 0:r._def.typeName)===ne.ZodString&&((s=t.keyType._def.checks)!=null&&s.length)){const{type:o,...d}=Ao(t.keyType._def,e);return{...l,propertyNames:d}}else{if(((i=t.keyType)==null?void 0:i._def.typeName)===ne.ZodEnum)return{...l,propertyNames:{enum:t.keyType._def.values}};if(((a=t.keyType)==null?void 0:a._def.typeName)===ne.ZodBranded&&t.keyType._def.type._def.typeName===ne.ZodString&&((u=t.keyType._def.type._def.checks)!=null&&u.length)){const{type:o,...d}=_o(t.keyType._def,e);return{...l,propertyNames:d}}}return l}function Vf(t,e){if(e.mapStrategy==="record")return ko(t,e);const n=be(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||ct(),r=be(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||ct();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function Gf(t){const e=t.values,r=Object.keys(t.values).filter(i=>typeof e[e[i]]!="number").map(i=>e[i]),s=Array.from(new Set(r.map(i=>typeof i)));return{type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:r}}function Wf(){return{not:ct()}}function Qf(){return{type:"null"}}var Ps={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Xf(t,e){const n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in Ps&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((s,i)=>{const a=Ps[i._def.typeName];return a&&!s.includes(a)?[...s,a]:s},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((s,i)=>{const a=typeof i._def.value;switch(a){case"string":case"number":case"boolean":return[...s,a];case"bigint":return[...s,"integer"];case"object":if(i._def.value===null)return[...s,"null"];default:return s}},[]);if(r.length===n.length){const s=r.filter((i,a,u)=>u.indexOf(i)===a);return{type:s.length>1?s:s[0],enum:n.reduce((i,a)=>i.includes(a._def.value)?i:[...i,a._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,s)=>[...r,...s._def.values.filter(i=>!r.includes(i))],[])};return Zf(t,e)}var Zf=(t,e)=>{const n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((r,s)=>be(r._def,{...e,currentPath:[...e.currentPath,"anyOf",`${s}`]})).filter(r=>!!r&&(!e.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function Kf(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[Ps[t.innerType._def.typeName],"null"]};const n=be(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function Jf(t){const e={type:"number"};if(!t.checks)return e;for(const n of t.checks)switch(n.kind){case"int":e.type="integer";break;case"min":n.inclusive?e.minimum=n.value:e.exclusiveMinimum=n.value;break;case"max":n.inclusive?e.maximum=n.value:e.exclusiveMaximum=n.value;break;case"multipleOf":e.multipleOf=n.value;break}return e}function eh(t,e){const n={type:"object",properties:{}},r=[],s=t.shape();for(const a in s){let u=s[a];if(u===void 0||u._def===void 0)continue;const l=nh(u),o=be(u._def,{...e,currentPath:[...e.currentPath,"properties",a],propertyPath:[...e.currentPath,"properties",a]});o!==void 0&&(n.properties[a]=o,l||r.push(a))}r.length&&(n.required=r);const i=th(t,e);return i!==void 0&&(n.additionalProperties=i),n}function th(t,e){if(t.catchall._def.typeName!=="ZodNever")return be(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function nh(t){try{return t.isOptional()}catch{return!0}}var rh=(t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return be(t.innerType._def,e);const r=be(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:ct()},r]}:ct()},sh=(t,e)=>{if(e.pipeStrategy==="input")return be(t.in._def,e);if(e.pipeStrategy==="output")return be(t.out._def,e);const n=be(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),r=be(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(s=>s!==void 0)}};function ih(t,e){return be(t.type._def,e)}function ah(t,e){const r={type:"array",uniqueItems:!0,items:be(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&(r.minItems=t.minSize.value),t.maxSize&&(r.maxItems=t.maxSize.value),r}function uh(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,r)=>be(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:be(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,r)=>be(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function oh(){return{not:ct()}}function lh(){return ct()}var ch=(t,e)=>be(t.innerType._def,e),dh=(t,e,n)=>{switch(e){case ne.ZodString:return Ao(t,n);case ne.ZodNumber:return Jf(t);case ne.ZodObject:return eh(t,n);case ne.ZodBigInt:return Df(t);case ne.ZodBoolean:return Pf();case ne.ZodDate:return yo(t,n);case ne.ZodUndefined:return oh();case ne.ZodNull:return Qf();case ne.ZodArray:return vf(t,n);case ne.ZodUnion:case ne.ZodDiscriminatedUnion:return Xf(t,n);case ne.ZodIntersection:return zf(t,n);case ne.ZodTuple:return uh(t,n);case ne.ZodRecord:return ko(t,n);case ne.ZodLiteral:return $f(t);case ne.ZodEnum:return Hf(t);case ne.ZodNativeEnum:return Gf(t);case ne.ZodNullable:return Kf(t,n);case ne.ZodOptional:return rh(t,n);case ne.ZodMap:return Vf(t,n);case ne.ZodSet:return ah(t,n);case ne.ZodLazy:return()=>t.getter()._def;case ne.ZodPromise:return ih(t,n);case ne.ZodNaN:case ne.ZodNever:return Wf();case ne.ZodEffects:return Uf(t,n);case ne.ZodAny:return ct();case ne.ZodUnknown:return lh();case ne.ZodDefault:return Ff(t,n);case ne.ZodBranded:return _o(t,n);case ne.ZodReadonly:return ch(t,n);case ne.ZodCatch:return Mf(t,n);case ne.ZodPipeline:return sh(t,n);case ne.ZodFunction:case ne.ZodVoid:case ne.ZodSymbol:return;default:return(r=>{})()}},fh=(t,e)=>{let n=0;for(;n<t.length&&n<e.length&&t[n]===e[n];n++);return[(t.length-n).toString(),...e.slice(n)].join("/")};function be(t,e,n=!1){var r;const s=e.seen.get(t);if(e.override){const l=(r=e.override)==null?void 0:r.call(e,t,e,s,n);if(l!==Of)return l}if(s&&!n){const l=hh(s,e);if(l!==void 0)return l}const i={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,i);const a=dh(t,t.typeName,e),u=typeof a=="function"?be(a(),e):a;if(u&&ph(t,e,u),e.postProcess){const l=e.postProcess(u,t,e);return i.jsonSchema=u,l}return i.jsonSchema=u,u}var hh=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:fh(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((n,r)=>e.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),ct()):e.$refStrategy==="seen"?ct():void 0}},ph=(t,e,n)=>(t.description&&(n.description=t.description),n),mh=t=>{const e=Lf(t),n=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([r,s])=>[s._def,{def:s._def,path:[...e.basePath,e.definitionPath,r],jsonSchema:void 0}]))}},gh=(t,e)=>{var n;const r=mh(e);let s=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((o,[d,f])=>{var p;return{...o,[d]:(p=be(f._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0))!=null?p:ct()}},{}):void 0;const i=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,a=(n=be(t._def,i===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,i]},!1))!=null?n:ct(),u=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;u!==void 0&&(a.title=u);const l=i===void 0?s?{...a,[r.definitionPath]:s}:a:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,i].join("/"),[r.definitionPath]:{...s,[i]:a}};return l.$schema="http://json-schema.org/draft-07/schema#",l},Ms=Symbol.for("vercel.ai.schema");function bh(t){let e;return()=>(e==null&&(e=t()),e)}function Vr(t,{validate:e}={}){return{[Ms]:!0,_type:void 0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function Eh(t){return typeof t=="object"&&t!==null&&Ms in t&&t[Ms]===!0&&"jsonSchema"in t&&"validate"in t}function gi(t){return t==null?Vr({properties:{},additionalProperties:!1}):Eh(t)?t:"~standard"in t?t["~standard"].vendor==="zod"?Co(t):Th(t):t()}function Th(t){return Vr(()=>mi(t["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async e=>{const n=await t["~standard"].validate(e);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new gn({value:e,cause:n.issues})}}})}function xh(t,e){var n;const r=(n=void 0)!=null?n:!1;return Vr(()=>gh(t,{$refStrategy:r?"root":"none"}),{validate:async s=>{const i=await t.safeParseAsync(s);return i.success?{success:!0,value:i.data}:{success:!1,error:i.error}}})}function _h(t,e){var n;const r=(n=void 0)!=null?n:!1;return Vr(()=>mi(ld(t,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async s=>{const i=await od(t,s);return i.success?{success:!0,value:i.data}:{success:!1,error:i.error}}})}function yh(t){return"_zod"in t}function Co(t,e){return yh(t)?_h(t):xh(t)}async function xa({value:t,schema:e}){const n=await er({value:t,schema:e});if(!n.success)throw gn.wrap({value:t,cause:n.error});return n.value}async function er({value:t,schema:e}){const n=gi(e);try{if(n.validate==null)return{success:!0,value:t,rawValue:t};const r=await n.validate(t);return r.success?{success:!0,value:r.value,rawValue:t}:{success:!1,error:gn.wrap({value:t,cause:r.error}),rawValue:t}}catch(r){return{success:!1,error:gn.wrap({value:t,cause:r}),rawValue:t}}}async function Jt({text:t,schema:e}){try{const n=Rf(t);return e==null?{success:!0,value:n,rawValue:n}:await er({value:n,schema:e})}catch(n){return{success:!1,error:fa.isInstance(n)?n:new fa({text:t,cause:n}),rawValue:void 0}}}function Ah({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new ud).pipeThrough(new TransformStream({async transform({data:n},r){n!=="[DONE]"&&r.enqueue(await Jt({text:n,schema:e}))}}))}async function Ut(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}var kh=Object.defineProperty,Ch=(t,e)=>{for(var n in e)kh(t,n,{get:e[n],enumerable:!0})},Io="AI_NoObjectGeneratedError",No=`vercel.ai.error.${Io}`,Ih=Symbol.for(No),So,jt=class extends Ct{constructor({message:t="No object generated.",cause:e,text:n,response:r,usage:s,finishReason:i}){super({name:Io,message:t,cause:e}),this[So]=!0,this.text=n,this.response=r,this.usage=s,this.finishReason=i}static isInstance(t){return Ct.hasMarker(t,No)}};So=Ih;var wo="AI_UIMessageStreamError",Ro=`vercel.ai.error.${wo}`,Nh=Symbol.for(Ro),Oo,on=class extends Ct{constructor({chunkType:t,chunkId:e,message:n}){super({name:wo,message:n}),this[Oo]=!0,this.chunkType=t,this.chunkId=e}static isInstance(t){return Ct.hasMarker(t,Ro)}};Oo=Nh;var _a="6.0.39",Lo=nt([G(),Lr(Uint8Array),Lr(ArrayBuffer),$u(t=>{var e,n;return(n=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?n:!1},{message:"Must be a Buffer"})]),tr=cd(()=>nt([dd(),G(),fd(),Xe(),Zn(G(),tr.optional()),ar(tr)])),ce=Zn(G(),Zn(G(),tr.optional())),vo=Te({type:te("text"),text:G(),providerOptions:ce.optional()}),Sh=Te({type:te("image"),image:nt([Lo,Lr(URL)]),mediaType:G().optional(),providerOptions:ce.optional()}),Do=Te({type:te("file"),data:nt([Lo,Lr(URL)]),filename:G().optional(),mediaType:G(),providerOptions:ce.optional()}),wh=Te({type:te("reasoning"),text:G(),providerOptions:ce.optional()}),Rh=Te({type:te("tool-call"),toolCallId:G(),toolName:G(),input:Pt(),providerOptions:ce.optional(),providerExecuted:Xe().optional()}),Oh=hd("type",[Te({type:te("text"),value:G(),providerOptions:ce.optional()}),Te({type:te("json"),value:tr,providerOptions:ce.optional()}),Te({type:te("execution-denied"),reason:G().optional(),providerOptions:ce.optional()}),Te({type:te("error-text"),value:G(),providerOptions:ce.optional()}),Te({type:te("error-json"),value:tr,providerOptions:ce.optional()}),Te({type:te("content"),value:ar(nt([Te({type:te("text"),text:G(),providerOptions:ce.optional()}),Te({type:te("media"),data:G(),mediaType:G()}),Te({type:te("file-data"),data:G(),mediaType:G(),filename:G().optional(),providerOptions:ce.optional()}),Te({type:te("file-url"),url:G(),providerOptions:ce.optional()}),Te({type:te("file-id"),fileId:nt([G(),Zn(G(),G())]),providerOptions:ce.optional()}),Te({type:te("image-data"),data:G(),mediaType:G(),providerOptions:ce.optional()}),Te({type:te("image-url"),url:G(),providerOptions:ce.optional()}),Te({type:te("image-file-id"),fileId:nt([G(),Zn(G(),G())]),providerOptions:ce.optional()}),Te({type:te("custom"),providerOptions:ce.optional()})]))})]),Po=Te({type:te("tool-result"),toolCallId:G(),toolName:G(),output:Oh,providerOptions:ce.optional()}),Lh=Te({type:te("tool-approval-request"),approvalId:G(),toolCallId:G()}),vh=Te({type:te("tool-approval-response"),approvalId:G(),approved:Xe(),reason:G().optional()}),Dh=Te({role:te("system"),content:G(),providerOptions:ce.optional()}),Ph=Te({role:te("user"),content:nt([G(),ar(nt([vo,Sh,Do]))]),providerOptions:ce.optional()}),Mh=Te({role:te("assistant"),content:nt([G(),ar(nt([vo,Do,wh,Rh,Po,Lh]))]),providerOptions:ce.optional()}),Bh=Te({role:te("tool"),content:ar(nt([Po,vh])),providerOptions:ce.optional()});nt([Dh,Ph,Mh,Bh]);function Mo(t,e){if(t===void 0&&e===void 0)return;if(t===void 0)return e;if(e===void 0)return t;const n={...t};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const s=e[r];if(s===void 0)continue;const i=r in t?t[r]:void 0,a=s!==null&&typeof s=="object"&&!Array.isArray(s)&&!(s instanceof Date)&&!(s instanceof RegExp),u=i!=null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp);a&&u?n[r]=Mo(i,s):n[r]=s}return n}var Fh={};Ch(Fh,{array:()=>zh,choice:()=>$h,json:()=>Yh,object:()=>jh,text:()=>Hh});function Uh(t){const e=["ROOT"];let n=-1,r=null;function s(l,o,d){switch(l){case'"':{n=o,e.pop(),e.push(d),e.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=o,r=o,e.pop(),e.push(d),e.push("INSIDE_LITERAL");break}case"-":{e.pop(),e.push(d),e.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=o,e.pop(),e.push(d),e.push("INSIDE_NUMBER");break}case"{":{n=o,e.pop(),e.push(d),e.push("INSIDE_OBJECT_START");break}case"[":{n=o,e.pop(),e.push(d),e.push("INSIDE_ARRAY_START");break}}}function i(l,o){switch(l){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=o,e.pop();break}}}function a(l,o){switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=o,e.pop();break}}}for(let l=0;l<t.length;l++){const o=t[l];switch(e[e.length-1]){case"ROOT":s(o,l,"FINISH");break;case"INSIDE_OBJECT_START":{switch(o){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{n=l,e.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{o==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{o==='"'&&(e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{o===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{s(o,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{i(o,l);break}case"INSIDE_STRING":{switch(o){case'"':{e.pop(),n=l;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:n=l}break}case"INSIDE_ARRAY_START":{o==="]"?(n=l,e.pop()):(n=l,s(o,l,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(o){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,e.pop();break}default:{n=l;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{s(o,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),n=l;break}case"INSIDE_NUMBER":{switch(o){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(o,l),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(o,l);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(o,l);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(o,l);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const f=t.substring(r,l+1);!"false".startsWith(f)&&!"true".startsWith(f)&&!"null".startsWith(f)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?i(o,l):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(o,l)):n=l;break}}}let u=t.slice(0,n+1);for(let l=e.length-1;l>=0;l--)switch(e[l]){case"INSIDE_STRING":{u+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{u+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{u+="]";break}case"INSIDE_LITERAL":{const d=t.substring(r,t.length);"true".startsWith(d)?u+="true".slice(d.length):"false".startsWith(d)?u+="false".slice(d.length):"null".startsWith(d)&&(u+="null".slice(d.length))}}return u}async function dr(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await Jt({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await Jt({text:Uh(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Hh=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:t}){return t},async parsePartialOutput({text:t}){return{partial:t}},createElementStreamTransform(){}}),jh=({schema:t,name:e,description:n})=>{const r=gi(t);return{name:"object",responseFormat:Ut(r.jsonSchema).then(s=>({type:"json",schema:s,...e!=null&&{name:e},...n!=null&&{description:n}})),async parseCompleteOutput({text:s},i){const a=await Jt({text:s});if(!a.success)throw new jt({message:"No object generated: could not parse the response.",cause:a.error,text:s,response:i.response,usage:i.usage,finishReason:i.finishReason});const u=await er({value:a.value,schema:r});if(!u.success)throw new jt({message:"No object generated: response did not match schema.",cause:u.error,text:s,response:i.response,usage:i.usage,finishReason:i.finishReason});return u.value},async parsePartialOutput({text:s}){const i=await dr(s);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:i.value}}},createElementStreamTransform(){}}},zh=({element:t,name:e,description:n})=>{const r=gi(t);return{name:"array",responseFormat:Ut(r.jsonSchema).then(s=>{const{$schema:i,...a}=s;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:a}},required:["elements"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}}),async parseCompleteOutput({text:s},i){const a=await Jt({text:s});if(!a.success)throw new jt({message:"No object generated: could not parse the response.",cause:a.error,text:s,response:i.response,usage:i.usage,finishReason:i.finishReason});const u=a.value;if(u==null||typeof u!="object"||!("elements"in u)||!Array.isArray(u.elements))throw new jt({message:"No object generated: response did not match schema.",cause:new gn({value:u,cause:"response must be an object with an elements array"}),text:s,response:i.response,usage:i.usage,finishReason:i.finishReason});for(const l of u.elements){const o=await er({value:l,schema:r});if(!o.success)throw new jt({message:"No object generated: response did not match schema.",cause:o.error,text:s,response:i.response,usage:i.usage,finishReason:i.finishReason})}return u.elements},async parsePartialOutput({text:s}){const i=await dr(s);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const a=i.value;if(a==null||typeof a!="object"||!("elements"in a)||!Array.isArray(a.elements))return;const u=i.state==="repaired-parse"&&a.elements.length>0?a.elements.slice(0,-1):a.elements,l=[];for(const o of u){const d=await er({value:o,schema:r});d.success&&l.push(d.value)}return{partial:l}}}},createElementStreamTransform(){let s=0;return new TransformStream({transform({partialOutput:i},a){if(i!=null)for(;s<i.length;s++)a.enqueue(i[s])}})}}},$h=({options:t,name:e,description:n})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:t}},required:["result"],additionalProperties:!1},...e!=null&&{name:e},...n!=null&&{description:n}}),async parseCompleteOutput({text:r},s){const i=await Jt({text:r});if(!i.success)throw new jt({message:"No object generated: could not parse the response.",cause:i.error,text:r,response:s.response,usage:s.usage,finishReason:s.finishReason});const a=i.value;if(a==null||typeof a!="object"||!("result"in a)||typeof a.result!="string"||!t.includes(a.result))throw new jt({message:"No object generated: response did not match schema.",cause:new gn({value:a,cause:"response must be an object that contains a choice value."}),text:r,response:s.response,usage:s.usage,finishReason:s.finishReason});return a.result},async parsePartialOutput({text:r}){const s=await dr(r);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const i=s.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string")return;const a=t.filter(u=>u.startsWith(i.result));return s.state==="successful-parse"?a.includes(i.result)?{partial:i.result}:void 0:a.length===1?{partial:a[0]}:void 0}}},createElementStreamTransform(){}}),Yh=({name:t,description:e}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...t!=null&&{name:t},...e!=null&&{description:e}}),async parseCompleteOutput({text:n},r){const s=await Jt({text:n});if(!s.success)throw new jt({message:"No object generated: could not parse the response.",cause:s.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return s.value},async parsePartialOutput({text:n}){const r=await dr(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return r.value===void 0?void 0:{partial:r.value}}},createElementStreamTransform(){}});cr({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
|
|
9
9
|
|
|
10
10
|
`)},flush(t){t.enqueue(`data: [DONE]
|
|
11
11
|
|
|
12
|
-
`)}})}});var qh=bh(()=>Co(nt([Ae({type:te("text-start"),id:G(),providerMetadata:ce.optional()}),Ae({type:te("text-delta"),id:G(),delta:G(),providerMetadata:ce.optional()}),Ae({type:te("text-end"),id:G(),providerMetadata:ce.optional()}),Ae({type:te("error"),errorText:G()}),Ae({type:te("tool-input-start"),toolCallId:G(),toolName:G(),providerExecuted:Xe().optional(),dynamic:Xe().optional(),title:G().optional()}),Ae({type:te("tool-input-delta"),toolCallId:G(),inputTextDelta:G()}),Ae({type:te("tool-input-available"),toolCallId:G(),toolName:G(),input:Pt(),providerExecuted:Xe().optional(),providerMetadata:ce.optional(),dynamic:Xe().optional(),title:G().optional()}),Ae({type:te("tool-input-error"),toolCallId:G(),toolName:G(),input:Pt(),providerExecuted:Xe().optional(),providerMetadata:ce.optional(),dynamic:Xe().optional(),errorText:G(),title:G().optional()}),Ae({type:te("tool-approval-request"),approvalId:G(),toolCallId:G()}),Ae({type:te("tool-output-available"),toolCallId:G(),output:Pt(),providerExecuted:Xe().optional(),dynamic:Xe().optional(),preliminary:Xe().optional()}),Ae({type:te("tool-output-error"),toolCallId:G(),errorText:G(),providerExecuted:Xe().optional(),dynamic:Xe().optional()}),Ae({type:te("tool-output-denied"),toolCallId:G()}),Ae({type:te("reasoning-start"),id:G(),providerMetadata:ce.optional()}),Ae({type:te("reasoning-delta"),id:G(),delta:G(),providerMetadata:ce.optional()}),Ae({type:te("reasoning-end"),id:G(),providerMetadata:ce.optional()}),Ae({type:te("source-url"),sourceId:G(),url:G(),title:G().optional(),providerMetadata:ce.optional()}),Ae({type:te("source-document"),sourceId:G(),mediaType:G(),title:G(),filename:G().optional(),providerMetadata:ce.optional()}),Ae({type:te("file"),url:G(),mediaType:G(),providerMetadata:ce.optional()}),Ae({type:Yu(t=>typeof t=="string"&&t.startsWith("data-"),{message:'Type must start with "data-"'}),id:G().optional(),data:Pt(),transient:Xe().optional()}),Ae({type:te("start-step")}),Ae({type:te("finish-step")}),Ae({type:te("start"),messageId:G().optional(),messageMetadata:Pt().optional()}),Ae({type:te("finish"),finishReason:pd(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:Pt().optional()}),Ae({type:te("abort"),reason:G().optional()}),Ae({type:te("message-metadata"),messageMetadata:Pt()})])));function Vh(t){return t.type.startsWith("data-")}function Bs(t){return t.type.startsWith("tool-")}function Gh(t){return t.type==="dynamic-tool"}function Fs(t){return Bs(t)||Gh(t)}function Aa(t){return t.type.split("-").slice(1).join("-")}function Wh({lastMessage:t,messageId:e}){return{message:t?.role==="assistant"?t:{id:e,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function Qh({stream:t,messageMetadataSchema:e,dataPartSchemas:n,runUpdateMessageJob:r,onError:s,onToolCall:i,onData:a}){return t.pipeThrough(new TransformStream({async transform(u,l){await r(async({state:o,write:d})=>{var f,p,h,g;function _(b){const R=o.message.parts.filter(Fs).find(I=>I.toolCallId===b);if(R==null)throw new on({chunkType:"tool-invocation",chunkId:b,message:`No tool invocation found for tool call ID "${b}".`});return R}function T(b){var w;const R=o.message.parts.find(M=>Bs(M)&&M.toolCallId===b.toolCallId),I=b,L=R;R!=null?(R.state=b.state,L.input=I.input,L.output=I.output,L.errorText=I.errorText,L.rawInput=I.rawInput,L.preliminary=I.preliminary,b.title!==void 0&&(L.title=b.title),L.providerExecuted=(w=I.providerExecuted)!=null?w:R.providerExecuted,I.providerMetadata!=null&&R.state==="input-available"&&(R.callProviderMetadata=I.providerMetadata)):o.message.parts.push({type:`tool-${b.toolName}`,toolCallId:b.toolCallId,state:b.state,title:b.title,input:I.input,output:I.output,rawInput:I.rawInput,errorText:I.errorText,providerExecuted:I.providerExecuted,preliminary:I.preliminary,...I.providerMetadata!=null?{callProviderMetadata:I.providerMetadata}:{}})}function E(b){var w,R;const I=o.message.parts.find(P=>P.type==="dynamic-tool"&&P.toolCallId===b.toolCallId),L=b,M=I;I!=null?(I.state=b.state,M.toolName=b.toolName,M.input=L.input,M.output=L.output,M.errorText=L.errorText,M.rawInput=(w=L.rawInput)!=null?w:M.rawInput,M.preliminary=L.preliminary,b.title!==void 0&&(M.title=b.title),M.providerExecuted=(R=L.providerExecuted)!=null?R:I.providerExecuted,L.providerMetadata!=null&&I.state==="input-available"&&(I.callProviderMetadata=L.providerMetadata)):o.message.parts.push({type:"dynamic-tool",toolName:b.toolName,toolCallId:b.toolCallId,state:b.state,input:L.input,output:L.output,errorText:L.errorText,preliminary:L.preliminary,providerExecuted:L.providerExecuted,title:b.title,...L.providerMetadata!=null?{callProviderMetadata:L.providerMetadata}:{}})}async function A(b){if(b!=null){const w=o.message.metadata!=null?Mo(o.message.metadata,b):b;e!=null&&await _a({value:w,schema:e}),o.message.metadata=w}}switch(u.type){case"text-start":{const b={type:"text",text:"",providerMetadata:u.providerMetadata,state:"streaming"};o.activeTextParts[u.id]=b,o.message.parts.push(b),d();break}case"text-delta":{const b=o.activeTextParts[u.id];if(b==null)throw new on({chunkType:"text-delta",chunkId:u.id,message:`Received text-delta for missing text part with ID "${u.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});b.text+=u.delta,b.providerMetadata=(f=u.providerMetadata)!=null?f:b.providerMetadata,d();break}case"text-end":{const b=o.activeTextParts[u.id];if(b==null)throw new on({chunkType:"text-end",chunkId:u.id,message:`Received text-end for missing text part with ID "${u.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});b.state="done",b.providerMetadata=(p=u.providerMetadata)!=null?p:b.providerMetadata,delete o.activeTextParts[u.id],d();break}case"reasoning-start":{const b={type:"reasoning",text:"",providerMetadata:u.providerMetadata,state:"streaming"};o.activeReasoningParts[u.id]=b,o.message.parts.push(b),d();break}case"reasoning-delta":{const b=o.activeReasoningParts[u.id];if(b==null)throw new on({chunkType:"reasoning-delta",chunkId:u.id,message:`Received reasoning-delta for missing reasoning part with ID "${u.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});b.text+=u.delta,b.providerMetadata=(h=u.providerMetadata)!=null?h:b.providerMetadata,d();break}case"reasoning-end":{const b=o.activeReasoningParts[u.id];if(b==null)throw new on({chunkType:"reasoning-end",chunkId:u.id,message:`Received reasoning-end for missing reasoning part with ID "${u.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});b.providerMetadata=(g=u.providerMetadata)!=null?g:b.providerMetadata,b.state="done",delete o.activeReasoningParts[u.id],d();break}case"file":{o.message.parts.push({type:"file",mediaType:u.mediaType,url:u.url}),d();break}case"source-url":{o.message.parts.push({type:"source-url",sourceId:u.sourceId,url:u.url,title:u.title,providerMetadata:u.providerMetadata}),d();break}case"source-document":{o.message.parts.push({type:"source-document",sourceId:u.sourceId,mediaType:u.mediaType,title:u.title,filename:u.filename,providerMetadata:u.providerMetadata}),d();break}case"tool-input-start":{const b=o.message.parts.filter(Bs);o.partialToolCalls[u.toolCallId]={text:"",toolName:u.toolName,index:b.length,dynamic:u.dynamic,title:u.title},u.dynamic?E({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-streaming",input:void 0,providerExecuted:u.providerExecuted,title:u.title}):T({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-streaming",input:void 0,providerExecuted:u.providerExecuted,title:u.title}),d();break}case"tool-input-delta":{const b=o.partialToolCalls[u.toolCallId];if(b==null)throw new on({chunkType:"tool-input-delta",chunkId:u.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${u.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});b.text+=u.inputTextDelta;const{value:w}=await dr(b.text);b.dynamic?E({toolCallId:u.toolCallId,toolName:b.toolName,state:"input-streaming",input:w,title:b.title}):T({toolCallId:u.toolCallId,toolName:b.toolName,state:"input-streaming",input:w,title:b.title}),d();break}case"tool-input-available":{u.dynamic?E({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-available",input:u.input,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata,title:u.title}):T({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-available",input:u.input,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata,title:u.title}),d(),i&&!u.providerExecuted&&await i({toolCall:u});break}case"tool-input-error":{u.dynamic?E({toolCallId:u.toolCallId,toolName:u.toolName,state:"output-error",input:u.input,errorText:u.errorText,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata}):T({toolCallId:u.toolCallId,toolName:u.toolName,state:"output-error",input:void 0,rawInput:u.input,errorText:u.errorText,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata}),d();break}case"tool-approval-request":{const b=_(u.toolCallId);b.state="approval-requested",b.approval={id:u.approvalId},d();break}case"tool-output-denied":{const b=_(u.toolCallId);b.state="output-denied",d();break}case"tool-output-available":{const b=_(u.toolCallId);b.type==="dynamic-tool"?E({toolCallId:u.toolCallId,toolName:b.toolName,state:"output-available",input:b.input,output:u.output,preliminary:u.preliminary,providerExecuted:u.providerExecuted,title:b.title}):T({toolCallId:u.toolCallId,toolName:Aa(b),state:"output-available",input:b.input,output:u.output,providerExecuted:u.providerExecuted,preliminary:u.preliminary,title:b.title}),d();break}case"tool-output-error":{const b=_(u.toolCallId);b.type==="dynamic-tool"?E({toolCallId:u.toolCallId,toolName:b.toolName,state:"output-error",input:b.input,errorText:u.errorText,providerExecuted:u.providerExecuted,title:b.title}):T({toolCallId:u.toolCallId,toolName:Aa(b),state:"output-error",input:b.input,rawInput:b.rawInput,errorText:u.errorText,providerExecuted:u.providerExecuted,title:b.title}),d();break}case"start-step":{o.message.parts.push({type:"step-start"});break}case"finish-step":{o.activeTextParts={},o.activeReasoningParts={};break}case"start":{u.messageId!=null&&(o.message.id=u.messageId),await A(u.messageMetadata),(u.messageId!=null||u.messageMetadata!=null)&&d();break}case"finish":{u.finishReason!=null&&(o.finishReason=u.finishReason),await A(u.messageMetadata),u.messageMetadata!=null&&d();break}case"message-metadata":{await A(u.messageMetadata),u.messageMetadata!=null&&d();break}case"error":{s?.(new Error(u.errorText));break}default:if(Vh(u)){n?.[u.type]!=null&&await _a({value:u.data,schema:n[u.type]});const b=u;if(b.transient){a?.(b);break}const w=b.id!=null?o.message.parts.find(R=>b.type===R.type&&b.id===R.id):void 0;w!=null?w.data=b.data:o.message.parts.push(b),a?.(b),d()}}l.enqueue(u)})}}))}async function Xh({stream:t,onError:e}){const n=t.getReader();try{for(;;){const{done:r}=await n.read();if(r)break}}catch(r){e?.(r)}finally{n.releaseLock()}}cr({prefix:"aitxt",size:24});cr({prefix:"aiobj",size:24});var Zh=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(t){return new Promise((e,n)=>{this.queue.push(async()=>{try{await t(),e()}catch(r){n(r)}}),this.processQueue()})}};cr({prefix:"aiobj",size:24});async function Kh(t){if(t==null)return[];if(!globalThis.FileList||!(t instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(t).map(async e=>{const{name:n,type:r}=e,s=await new Promise((i,a)=>{const u=new FileReader;u.onload=l=>{var o;i((o=l.target)==null?void 0:o.result)},u.onerror=l=>a(l),u.readAsDataURL(e)});return{type:"file",mediaType:r,filename:n,url:s}}))}var Jh=class{constructor({api:t="/api/chat",credentials:e,headers:n,body:r,fetch:s,prepareSendMessagesRequest:i,prepareReconnectToStreamRequest:a}){this.api=t,this.credentials=e,this.headers=n,this.body=r,this.fetch=s,this.prepareSendMessagesRequest=i,this.prepareReconnectToStreamRequest=a}async sendMessages({abortSignal:t,...e}){var n,r,s,i,a;const u=await Ut(this.body),l=await Ut(this.headers),o=await Ut(this.credentials),d={...Qt(l),...Qt(e.headers)},f=await((n=this.prepareSendMessagesRequest)==null?void 0:n.call(this,{api:this.api,id:e.chatId,messages:e.messages,body:{...u,...e.body},headers:d,credentials:o,requestMetadata:e.metadata,trigger:e.trigger,messageId:e.messageId})),p=(r=f?.api)!=null?r:this.api,h=f?.headers!==void 0?Qt(f.headers):d,g=f?.body!==void 0?f.body:{...u,...e.body,id:e.chatId,messages:e.messages,trigger:e.trigger,messageId:e.messageId},_=(s=f?.credentials)!=null?s:o,E=await((i=this.fetch)!=null?i:globalThis.fetch)(p,{method:"POST",headers:ba({"Content-Type":"application/json",...h},`ai-sdk/${ya}`,ga()),body:JSON.stringify(g),credentials:_,signal:t});if(!E.ok)throw new Error((a=await E.text())!=null?a:"Failed to fetch the chat response.");if(!E.body)throw new Error("The response body is empty.");return this.processResponseStream(E.body)}async reconnectToStream(t){var e,n,r,s,i;const a=await Ut(this.body),u=await Ut(this.headers),l=await Ut(this.credentials),o={...Qt(u),...Qt(t.headers)},d=await((e=this.prepareReconnectToStreamRequest)==null?void 0:e.call(this,{api:this.api,id:t.chatId,body:{...a,...t.body},headers:o,credentials:l,requestMetadata:t.metadata})),f=(n=d?.api)!=null?n:`${this.api}/${t.chatId}/stream`,p=d?.headers!==void 0?Qt(d.headers):o,h=(r=d?.credentials)!=null?r:l,_=await((s=this.fetch)!=null?s:globalThis.fetch)(f,{method:"GET",headers:ba(p,`ai-sdk/${ya}`,ga()),credentials:h});if(_.status===204)return null;if(!_.ok)throw new Error((i=await _.text())!=null?i:"Failed to fetch the chat response.");if(!_.body)throw new Error("The response body is empty.");return this.processResponseStream(_.body)}},Bo=class extends Jh{constructor(t={}){super(t)}processResponseStream(t){return Ah({stream:t,schema:qh}).pipeThrough(new TransformStream({async transform(e,n){if(!e.success)throw e.error;n.enqueue(e.value)}}))}},e0=class{constructor({generateId:t=If,id:e=t(),transport:n=new Bo,messageMetadataSchema:r,dataPartSchemas:s,state:i,onError:a,onToolCall:u,onFinish:l,onData:o,sendAutomaticallyWhen:d}){this.activeResponse=void 0,this.jobExecutor=new Zh,this.sendMessage=async(f,p)=>{var h,g,_,T;if(f==null){await this.makeRequest({trigger:"submit-message",messageId:(h=this.lastMessage)==null?void 0:h.id,...p});return}let E;if("text"in f||"files"in f?E={parts:[...Array.isArray(f.files)?f.files:await Kh(f.files),..."text"in f&&f.text!=null?[{type:"text",text:f.text}]:[]]}:E=f,f.messageId!=null){const A=this.state.messages.findIndex(b=>b.id===f.messageId);if(A===-1)throw new Error(`message with id ${f.messageId} not found`);if(this.state.messages[A].role!=="user")throw new Error(`message with id ${f.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,A+1),this.state.replaceMessage(A,{...E,id:f.messageId,role:(g=E.role)!=null?g:"user",metadata:f.metadata})}else this.state.pushMessage({...E,id:(_=E.id)!=null?_:this.generateId(),role:(T=E.role)!=null?T:"user",metadata:f.metadata});await this.makeRequest({trigger:"submit-message",messageId:f.messageId,...p})},this.regenerate=async({messageId:f,...p}={})=>{const h=f==null?this.state.messages.length-1:this.state.messages.findIndex(g=>g.id===f);if(h===-1)throw new Error(`message ${f} not found`);this.state.messages=this.state.messages.slice(0,this.messages[h].role==="assistant"?h:h+1),await this.makeRequest({trigger:"regenerate-message",messageId:f,...p})},this.resumeStream=async(f={})=>{await this.makeRequest({trigger:"resume-stream",...f})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:f,approved:p,reason:h})=>this.jobExecutor.run(async()=>{var g,_;const T=this.state.messages,E=T[T.length-1],A=b=>Fs(b)&&b.state==="approval-requested"&&b.approval.id===f?{...b,state:"approval-responded",approval:{id:f,approved:p,reason:h}}:b;this.state.replaceMessage(T.length-1,{...E,parts:E.parts.map(A)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(A)),this.status!=="streaming"&&this.status!=="submitted"&&((g=this.sendAutomaticallyWhen)!=null&&g.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(_=this.lastMessage)==null?void 0:_.id})}),this.addToolOutput=async({state:f="output-available",tool:p,toolCallId:h,output:g,errorText:_})=>this.jobExecutor.run(async()=>{var T,E;const A=this.state.messages,b=A[A.length-1],w=R=>Fs(R)&&R.toolCallId===h?{...R,state:f,output:g,errorText:_}:R;this.state.replaceMessage(A.length-1,{...b,parts:b.parts.map(w)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(w)),this.status!=="streaming"&&this.status!=="submitted"&&((T=this.sendAutomaticallyWhen)!=null&&T.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(E=this.lastMessage)==null?void 0:E.id})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var f;this.status!=="streaming"&&this.status!=="submitted"||(f=this.activeResponse)!=null&&f.abortController&&this.activeResponse.abortController.abort()},this.id=e,this.transport=n,this.generateId=t,this.messageMetadataSchema=r,this.dataPartSchemas=s,this.state=i,this.onError=a,this.onToolCall=u,this.onFinish=l,this.onData=o,this.sendAutomaticallyWhen=d}get status(){return this.state.status}setStatus({status:t,error:e}){this.status!==t&&(this.state.status=t,this.state.error=e)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(t){this.state.messages=t}async makeRequest({trigger:t,metadata:e,headers:n,body:r,messageId:s}){var i,a,u,l;this.setStatus({status:"submitted",error:void 0});const o=this.lastMessage;let d=!1,f=!1,p=!1;try{const h={state:Wh({lastMessage:this.state.snapshot(o),messageId:this.generateId()}),abortController:new AbortController};h.abortController.signal.addEventListener("abort",()=>{d=!0}),this.activeResponse=h;let g;if(t==="resume-stream"){const T=await this.transport.reconnectToStream({chatId:this.id,metadata:e,headers:n,body:r});if(T==null){this.setStatus({status:"ready"});return}g=T}else g=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:h.abortController.signal,metadata:e,headers:n,body:r,trigger:t,messageId:s});const _=T=>this.jobExecutor.run(()=>T({state:h.state,write:()=>{var E;this.setStatus({status:"streaming"}),h.state.message.id===((E=this.lastMessage)==null?void 0:E.id)?this.state.replaceMessage(this.state.messages.length-1,h.state.message):this.state.pushMessage(h.state.message)}}));await Xh({stream:Qh({stream:g,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:_,onError:T=>{throw T}}),onError:T=>{throw T}}),this.setStatus({status:"ready"})}catch(h){if(d||h.name==="AbortError")return d=!0,this.setStatus({status:"ready"}),null;p=!0,h instanceof TypeError&&(h.message.toLowerCase().includes("fetch")||h.message.toLowerCase().includes("network"))&&(f=!0),this.onError&&h instanceof Error&&this.onError(h),this.setStatus({status:"error",error:h})}finally{try{(a=this.onFinish)==null||a.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:d,isDisconnect:f,isError:p,finishReason:(i=this.activeResponse)==null?void 0:i.state.finishReason})}catch(h){console.error(h)}this.activeResponse=void 0}(u=this.sendAutomaticallyWhen)!=null&&u.call(this,{messages:this.state.messages})&&!p&&await this.makeRequest({trigger:"submit-message",messageId:(l=this.lastMessage)==null?void 0:l.id,metadata:e,headers:n,body:r})}},fs,ka;function t0(){if(ka)return fs;ka=1;function t(e,n){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let r,s=0;return function(...a){clearTimeout(r);const u=Date.now(),l=u-s,o=n-l;o<=0?(s=u,e.apply(this,a)):r=setTimeout(()=>{s=Date.now(),e.apply(this,a)},o)}}return fs=t,fs}var n0=t0();const r0=ai(n0);var Fo=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},ke=(t,e,n)=>(Fo(t,e,"read from private field"),n?n.call(t):e.get(t)),_t=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Mt=(t,e,n,r)=>(Fo(t,e,"write to private field"),e.set(t,n),n);function s0(t,e){return e!=null?r0(t,e):t}var ft,Ir,Nr,Bn,Fn,Un,dn,Us,Hs,i0=class{constructor(t=[]){_t(this,ft,void 0),_t(this,Ir,"ready"),_t(this,Nr,void 0),_t(this,Bn,new Set),_t(this,Fn,new Set),_t(this,Un,new Set),this.pushMessage=e=>{Mt(this,ft,ke(this,ft).concat(e)),ke(this,dn).call(this)},this.popMessage=()=>{Mt(this,ft,ke(this,ft).slice(0,-1)),ke(this,dn).call(this)},this.replaceMessage=(e,n)=>{Mt(this,ft,[...ke(this,ft).slice(0,e),this.snapshot(n),...ke(this,ft).slice(e+1)]),ke(this,dn).call(this)},this.snapshot=e=>structuredClone(e),this["~registerMessagesCallback"]=(e,n)=>{const r=n?s0(e,n):e;return ke(this,Bn).add(r),()=>{ke(this,Bn).delete(r)}},this["~registerStatusCallback"]=e=>(ke(this,Fn).add(e),()=>{ke(this,Fn).delete(e)}),this["~registerErrorCallback"]=e=>(ke(this,Un).add(e),()=>{ke(this,Un).delete(e)}),_t(this,dn,()=>{ke(this,Bn).forEach(e=>e())}),_t(this,Us,()=>{ke(this,Fn).forEach(e=>e())}),_t(this,Hs,()=>{ke(this,Un).forEach(e=>e())}),Mt(this,ft,t)}get status(){return ke(this,Ir)}set status(t){Mt(this,Ir,t),ke(this,Us).call(this)}get error(){return ke(this,Nr)}set error(t){Mt(this,Nr,t),ke(this,Hs).call(this)}get messages(){return ke(this,ft)}set messages(t){Mt(this,ft,[...t]),ke(this,dn).call(this)}};ft=new WeakMap;Ir=new WeakMap;Nr=new WeakMap;Bn=new WeakMap;Fn=new WeakMap;Un=new WeakMap;dn=new WeakMap;Us=new WeakMap;Hs=new WeakMap;var fn,Ca=class extends e0{constructor({messages:e,...n}){const r=new i0(e);super({...n,state:r}),_t(this,fn,void 0),this["~registerMessagesCallback"]=(s,i)=>ke(this,fn)["~registerMessagesCallback"](s,i),this["~registerStatusCallback"]=s=>ke(this,fn)["~registerStatusCallback"](s),this["~registerErrorCallback"]=s=>ke(this,fn)["~registerErrorCallback"](s),Mt(this,fn,r)}};fn=new WeakMap;function a0({experimental_throttle:t,resume:e=!1,...n}={}){const r=j.useRef("chat"in n?{}:{onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});"chat"in n||(r.current={onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});const s={...n,onToolCall:p=>{var h,g;return(g=(h=r.current).onToolCall)==null?void 0:g.call(h,p)},onData:p=>{var h,g;return(g=(h=r.current).onData)==null?void 0:g.call(h,p)},onFinish:p=>{var h,g;return(g=(h=r.current).onFinish)==null?void 0:g.call(h,p)},onError:p=>{var h,g;return(g=(h=r.current).onError)==null?void 0:g.call(h,p)},sendAutomaticallyWhen:p=>{var h,g,_;return(_=(g=(h=r.current).sendAutomaticallyWhen)==null?void 0:g.call(h,p))!=null?_:!1}},i=j.useRef("chat"in n?n.chat:new Ca(s));("chat"in n&&n.chat!==i.current||"id"in n&&i.current.id!==n.id)&&(i.current="chat"in n?n.chat:new Ca(s));const u=j.useCallback(p=>i.current["~registerMessagesCallback"](p,t),[t,i.current.id]),l=j.useSyncExternalStore(u,()=>i.current.messages,()=>i.current.messages),o=j.useSyncExternalStore(i.current["~registerStatusCallback"],()=>i.current.status,()=>i.current.status),d=j.useSyncExternalStore(i.current["~registerErrorCallback"],()=>i.current.error,()=>i.current.error),f=j.useCallback(p=>{typeof p=="function"&&(p=p(i.current.messages)),i.current.messages=p},[i]);return j.useEffect(()=>{e&&i.current.resumeStream()},[e,i]),{id:i.current.id,messages:l,setMessages:f,sendMessage:i.current.sendMessage,regenerate:i.current.regenerate,clearError:i.current.clearError,stop:i.current.stop,error:d,resumeStream:i.current.resumeStream,status:o,addToolResult:i.current.addToolOutput,addToolOutput:i.current.addToolOutput,addToolApprovalResponse:i.current.addToolApprovalResponse}}function u0(t,e){const n=Q.c(4);let r;n[0]!==e?(r=e===void 0?{}:e,n[0]=e,n[1]=r):r=n[1];const s=r,i=t??Md;let a;return n[2]!==i?(a=Bd(i),n[2]=i,n[3]=a):a=n[3],Fd(i,"LLM",a,s)}function Ei(){const t=Q.c(2),e=Qu();let n;return t[0]!==e?(n={connections:e,binding:"LLMS"},t[0]=e,t[1]=n):n=t[1],Hd(n)}function en(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function o0(t,e){let n;const r=()=>{if(n)return n;const s=indexedDB.open(t);return s.onupgradeneeded=()=>s.result.createObjectStore(e),n=en(s),n.then(i=>{i.onclose=()=>n=void 0},()=>{}),n};return(s,i)=>r().then(a=>i(a.transaction(e,s).objectStore(e)))}let hs;function Wr(){return hs||(hs=o0("keyval-store","keyval")),hs}function Ti(t,e=Wr()){return e("readonly",n=>en(n.get(t)))}function jn(t,e,n=Wr()){return n("readwrite",r=>(r.put(e,t),en(r.transaction)))}function Uo(t,e=Wr()){return e("readwrite",n=>(n.delete(t),en(n.transaction)))}function l0(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},en(t.transaction)}function Ho(t=Wr()){return t("readonly",e=>{if(e.getAll&&e.getAllKeys)return Promise.all([en(e.getAllKeys()),en(e.getAll())]).then(([r,s])=>r.map((i,a)=>[i,s[a]]));const n=[];return t("readonly",r=>l0(r,s=>n.push([s.key,s.value])).then(()=>n))})}async function c0(t,e){const n=`${t}:threads:${e}`;return await Ti(n)??null}async function d0(t){const e=`${t}:threads:`;return(await Ho()).filter(([s])=>typeof s=="string"&&s.startsWith(e)).map(([,s])=>s).filter(s=>!s.hidden).sort((s,i)=>String(i.updated_at).localeCompare(String(s.updated_at)))}function jo(t,e){const n=`${t}:messages:`;return Ho().then(r=>r.filter(([i])=>typeof i=="string"&&i.startsWith(n)).map(([,i])=>i).filter(i=>i.metadata?.thread_id===e||i.threadId===e).sort((i,a)=>{const u=i.metadata?.created_at||i.createdAt||"",l=a.metadata?.created_at||a.createdAt||"";return String(u).localeCompare(String(l))}))}function zo(t){const e=Q.c(14),{locator:n}=zt(),r=t?.gatewayId;let s;e[0]!==r||e[1]!==n?(s=je.threads(n),e[0]=r,e[1]=n,e[2]=s):s=e[2];let i;e[3]!==r||e[4]!==n?(i=async()=>await d0(n),e[3]=r,e[4]=n,e[5]=i):i=e[5];let a;e[6]!==s||e[7]!==i?(a={queryKey:s,queryFn:i,staleTime:3e4},e[6]=s,e[7]=i,e[8]=a):a=e[8];const{data:u,refetch:l}=ui(a);let o;e[9]!==u?(o=u??[],e[9]=u,e[10]=o):o=e[10];let d;return e[11]!==l||e[12]!==o?(d={threads:o,refetch:l},e[11]=l,e[12]=o,e[13]=d):d=e[13],d}function f0(t){const e=Q.c(11),{locator:n}=zt();let r;e[0]!==n||e[1]!==t?(r=je.threadMessages(n,t),e[0]=n,e[1]=t,e[2]=r):r=e[2];let s;e[3]!==n||e[4]!==t?(s=()=>jo(n,t),e[3]=n,e[4]=t,e[5]=s):s=e[5];let i;e[6]!==r||e[7]!==s?(i={queryKey:r,queryFn:s,staleTime:3e4},e[6]=r,e[7]=s,e[8]=i):i=e[8];const{data:a}=ui(i);let u;return e[9]!==a?(u=a??[],e[9]=a,e[10]=u):u=e[10],u}function $o(){const t=Q.c(28),{locator:e}=zt(),n=oi();let r;t[0]!==e?(r=async T=>{const E=`${e}:threads:${T.id}`;return await jn(E,T),T},t[0]=e,t[1]=r):r=t[1];let s;t[2]!==e||t[3]!==n?(s=T=>{n.invalidateQueries({queryKey:je.threads(e)}),T.gatewayId&&n.invalidateQueries({queryKey:je.gatewayThreads(e,T.gatewayId)})},t[2]=e,t[3]=n,t[4]=s):s=t[4];let i;t[5]!==r||t[6]!==s?(i={mutationFn:r,onSuccess:s},t[5]=r,t[6]=s,t[7]=i):i=t[7];const a=Xt(i);let u;t[8]!==e?(u=async T=>{const{id:E,updates:A}=T,b=`${e}:threads:${E}`,w=await Ti(b);if(!w)throw new Error(`Thread ${E} not found`);const R={...w,...A};return await jn(b,R),R},t[8]=e,t[9]=u):u=t[9];let l;t[10]!==e||t[11]!==n?(l=T=>{n.invalidateQueries({queryKey:je.threads(e)}),n.invalidateQueries({queryKey:je.thread(e,T.id)}),T.gatewayId&&n.invalidateQueries({queryKey:je.gatewayThreads(e,T.gatewayId)})},t[10]=e,t[11]=n,t[12]=l):l=t[12];let o;t[13]!==u||t[14]!==l?(o={mutationFn:u,onSuccess:l},t[13]=u,t[14]=l,t[15]=o):o=t[15];const d=Xt(o);let f;t[16]!==e?(f=async T=>{const E=`${e}:threads:${T}`;return await Uo(E),T},t[16]=e,t[17]=f):f=t[17];let p;t[18]!==e||t[19]!==n?(p=()=>{n.invalidateQueries({queryKey:je.threads(e)})},t[18]=e,t[19]=n,t[20]=p):p=t[20];let h;t[21]!==f||t[22]!==p?(h={mutationFn:f,onSuccess:p},t[21]=f,t[22]=p,t[23]=h):h=t[23];const g=Xt(h);let _;return t[24]!==g||t[25]!==a||t[26]!==d?(_={insert:a,update:d,delete:g},t[24]=g,t[25]=a,t[26]=d,t[27]=_):_=t[27],_}function Yo(){const t=Q.c(37),{locator:e}=zt(),n=oi();let r;t[0]!==e?(r=async w=>{const R=`${e}:messages:${w.id}`;return await jn(R,w),w},t[0]=e,t[1]=r):r=t[1];let s;t[2]!==e||t[3]!==n?(s=w=>{const R=w.metadata?.thread_id||w.threadId;R&&n.invalidateQueries({queryKey:je.threadMessages(e,R)}),n.invalidateQueries({queryKey:je.messages(e)})},t[2]=e,t[3]=n,t[4]=s):s=t[4];let i;t[5]!==r||t[6]!==s?(i={mutationFn:r,onSuccess:s},t[5]=r,t[6]=s,t[7]=i):i=t[7];const a=Xt(i);let u;t[8]!==e?(u=async w=>(await Promise.all(w.map(R=>{const I=`${e}:messages:${R.id}`;return jn(I,R)})),w),t[8]=e,t[9]=u):u=t[9];let l;t[10]!==e||t[11]!==n?(l=w=>{const R=new Set;for(const I of w){const L=I.metadata?.thread_id||I.threadId;L&&R.add(L)}for(const I of R)n.invalidateQueries({queryKey:je.threadMessages(e,I)});n.invalidateQueries({queryKey:je.messages(e)})},t[10]=e,t[11]=n,t[12]=l):l=t[12];let o;t[13]!==u||t[14]!==l?(o={mutationFn:u,onSuccess:l},t[13]=u,t[14]=l,t[15]=o):o=t[15];const d=Xt(o);let f;t[16]!==e?(f=async w=>{const{id:R,updates:I}=w,L=`${e}:messages:${R}`,M=await Ti(L);if(!M)throw new Error(`Message ${R} not found`);const P={...M,...I};return await jn(L,P),P},t[16]=e,t[17]=f):f=t[17];let p;t[18]!==e||t[19]!==n?(p=w=>{const R=w.metadata?.thread_id||w.threadId;R&&n.invalidateQueries({queryKey:je.threadMessages(e,R)}),n.invalidateQueries({queryKey:je.messages(e)})},t[18]=e,t[19]=n,t[20]=p):p=t[20];let h;t[21]!==f||t[22]!==p?(h={mutationFn:f,onSuccess:p},t[21]=f,t[22]=p,t[23]=h):h=t[23];const g=Xt(h);let _;t[24]!==e?(_=async w=>{const R=`${e}:messages:${w}`;return await Uo(R),w},t[24]=e,t[25]=_):_=t[25];let T;t[26]!==e||t[27]!==n?(T=()=>{n.invalidateQueries({queryKey:je.messages(e)})},t[26]=e,t[27]=n,t[28]=T):T=t[28];let E;t[29]!==T||t[30]!==_?(E={mutationFn:_,onSuccess:T},t[29]=T,t[30]=_,t[31]=E):E=t[31];const A=Xt(E);let b;return t[32]!==A||t[33]!==a||t[34]!==d||t[35]!==g?(b={insert:a,insertMany:d,update:g,delete:A},t[32]=A,t[33]=a,t[34]=d,t[35]=g,t[36]=b):b=t[36],b}function h0(t){const e=Q.c(11);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const r=qu(n),[s]=jd(t??void 0);let i;if(e[1]!==t||e[2]!==s||e[3]!==r.collectionName||e[4]!==r.connectionId||e[5]!==r.itemId){i=[],t&&(i.push(`### Selected Agent/Gateway
|
|
12
|
+
`)}})}});var qh=bh(()=>Co(nt([Ae({type:te("text-start"),id:G(),providerMetadata:ce.optional()}),Ae({type:te("text-delta"),id:G(),delta:G(),providerMetadata:ce.optional()}),Ae({type:te("text-end"),id:G(),providerMetadata:ce.optional()}),Ae({type:te("error"),errorText:G()}),Ae({type:te("tool-input-start"),toolCallId:G(),toolName:G(),providerExecuted:Xe().optional(),providerMetadata:ce.optional(),dynamic:Xe().optional(),title:G().optional()}),Ae({type:te("tool-input-delta"),toolCallId:G(),inputTextDelta:G()}),Ae({type:te("tool-input-available"),toolCallId:G(),toolName:G(),input:Pt(),providerExecuted:Xe().optional(),providerMetadata:ce.optional(),dynamic:Xe().optional(),title:G().optional()}),Ae({type:te("tool-input-error"),toolCallId:G(),toolName:G(),input:Pt(),providerExecuted:Xe().optional(),providerMetadata:ce.optional(),dynamic:Xe().optional(),errorText:G(),title:G().optional()}),Ae({type:te("tool-approval-request"),approvalId:G(),toolCallId:G()}),Ae({type:te("tool-output-available"),toolCallId:G(),output:Pt(),providerExecuted:Xe().optional(),dynamic:Xe().optional(),preliminary:Xe().optional()}),Ae({type:te("tool-output-error"),toolCallId:G(),errorText:G(),providerExecuted:Xe().optional(),dynamic:Xe().optional()}),Ae({type:te("tool-output-denied"),toolCallId:G()}),Ae({type:te("reasoning-start"),id:G(),providerMetadata:ce.optional()}),Ae({type:te("reasoning-delta"),id:G(),delta:G(),providerMetadata:ce.optional()}),Ae({type:te("reasoning-end"),id:G(),providerMetadata:ce.optional()}),Ae({type:te("source-url"),sourceId:G(),url:G(),title:G().optional(),providerMetadata:ce.optional()}),Ae({type:te("source-document"),sourceId:G(),mediaType:G(),title:G(),filename:G().optional(),providerMetadata:ce.optional()}),Ae({type:te("file"),url:G(),mediaType:G(),providerMetadata:ce.optional()}),Ae({type:$u(t=>typeof t=="string"&&t.startsWith("data-"),{message:'Type must start with "data-"'}),id:G().optional(),data:Pt(),transient:Xe().optional()}),Ae({type:te("start-step")}),Ae({type:te("finish-step")}),Ae({type:te("start"),messageId:G().optional(),messageMetadata:Pt().optional()}),Ae({type:te("finish"),finishReason:pd(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:Pt().optional()}),Ae({type:te("abort"),reason:G().optional()}),Ae({type:te("message-metadata"),messageMetadata:Pt()})])));function Vh(t){return t.type.startsWith("data-")}function Bs(t){return t.type.startsWith("tool-")}function Gh(t){return t.type==="dynamic-tool"}function Fs(t){return Bs(t)||Gh(t)}function ya(t){return t.type.split("-").slice(1).join("-")}function Wh({lastMessage:t,messageId:e}){return{message:t?.role==="assistant"?t:{id:e,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function Qh({stream:t,messageMetadataSchema:e,dataPartSchemas:n,runUpdateMessageJob:r,onError:s,onToolCall:i,onData:a}){return t.pipeThrough(new TransformStream({async transform(u,l){await r(async({state:o,write:d})=>{var f,p,h,g;function _(b){const R=o.message.parts.filter(Fs).find(I=>I.toolCallId===b);if(R==null)throw new on({chunkType:"tool-invocation",chunkId:b,message:`No tool invocation found for tool call ID "${b}".`});return R}function T(b){var w;const R=o.message.parts.find(M=>Bs(M)&&M.toolCallId===b.toolCallId),I=b,L=R;R!=null?(R.state=b.state,L.input=I.input,L.output=I.output,L.errorText=I.errorText,L.rawInput=I.rawInput,L.preliminary=I.preliminary,b.title!==void 0&&(L.title=b.title),L.providerExecuted=(w=I.providerExecuted)!=null?w:R.providerExecuted,I.providerMetadata!=null&&(R.callProviderMetadata=I.providerMetadata)):o.message.parts.push({type:`tool-${b.toolName}`,toolCallId:b.toolCallId,state:b.state,title:b.title,input:I.input,output:I.output,rawInput:I.rawInput,errorText:I.errorText,providerExecuted:I.providerExecuted,preliminary:I.preliminary,...I.providerMetadata!=null?{callProviderMetadata:I.providerMetadata}:{}})}function E(b){var w,R;const I=o.message.parts.find(P=>P.type==="dynamic-tool"&&P.toolCallId===b.toolCallId),L=b,M=I;I!=null?(I.state=b.state,M.toolName=b.toolName,M.input=L.input,M.output=L.output,M.errorText=L.errorText,M.rawInput=(w=L.rawInput)!=null?w:M.rawInput,M.preliminary=L.preliminary,b.title!==void 0&&(M.title=b.title),M.providerExecuted=(R=L.providerExecuted)!=null?R:I.providerExecuted,L.providerMetadata!=null&&(I.callProviderMetadata=L.providerMetadata)):o.message.parts.push({type:"dynamic-tool",toolName:b.toolName,toolCallId:b.toolCallId,state:b.state,input:L.input,output:L.output,errorText:L.errorText,preliminary:L.preliminary,providerExecuted:L.providerExecuted,title:b.title,...L.providerMetadata!=null?{callProviderMetadata:L.providerMetadata}:{}})}async function A(b){if(b!=null){const w=o.message.metadata!=null?Mo(o.message.metadata,b):b;e!=null&&await xa({value:w,schema:e}),o.message.metadata=w}}switch(u.type){case"text-start":{const b={type:"text",text:"",providerMetadata:u.providerMetadata,state:"streaming"};o.activeTextParts[u.id]=b,o.message.parts.push(b),d();break}case"text-delta":{const b=o.activeTextParts[u.id];if(b==null)throw new on({chunkType:"text-delta",chunkId:u.id,message:`Received text-delta for missing text part with ID "${u.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});b.text+=u.delta,b.providerMetadata=(f=u.providerMetadata)!=null?f:b.providerMetadata,d();break}case"text-end":{const b=o.activeTextParts[u.id];if(b==null)throw new on({chunkType:"text-end",chunkId:u.id,message:`Received text-end for missing text part with ID "${u.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});b.state="done",b.providerMetadata=(p=u.providerMetadata)!=null?p:b.providerMetadata,delete o.activeTextParts[u.id],d();break}case"reasoning-start":{const b={type:"reasoning",text:"",providerMetadata:u.providerMetadata,state:"streaming"};o.activeReasoningParts[u.id]=b,o.message.parts.push(b),d();break}case"reasoning-delta":{const b=o.activeReasoningParts[u.id];if(b==null)throw new on({chunkType:"reasoning-delta",chunkId:u.id,message:`Received reasoning-delta for missing reasoning part with ID "${u.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});b.text+=u.delta,b.providerMetadata=(h=u.providerMetadata)!=null?h:b.providerMetadata,d();break}case"reasoning-end":{const b=o.activeReasoningParts[u.id];if(b==null)throw new on({chunkType:"reasoning-end",chunkId:u.id,message:`Received reasoning-end for missing reasoning part with ID "${u.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});b.providerMetadata=(g=u.providerMetadata)!=null?g:b.providerMetadata,b.state="done",delete o.activeReasoningParts[u.id],d();break}case"file":{o.message.parts.push({type:"file",mediaType:u.mediaType,url:u.url}),d();break}case"source-url":{o.message.parts.push({type:"source-url",sourceId:u.sourceId,url:u.url,title:u.title,providerMetadata:u.providerMetadata}),d();break}case"source-document":{o.message.parts.push({type:"source-document",sourceId:u.sourceId,mediaType:u.mediaType,title:u.title,filename:u.filename,providerMetadata:u.providerMetadata}),d();break}case"tool-input-start":{const b=o.message.parts.filter(Bs);o.partialToolCalls[u.toolCallId]={text:"",toolName:u.toolName,index:b.length,dynamic:u.dynamic,title:u.title},u.dynamic?E({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-streaming",input:void 0,providerExecuted:u.providerExecuted,title:u.title,providerMetadata:u.providerMetadata}):T({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-streaming",input:void 0,providerExecuted:u.providerExecuted,title:u.title,providerMetadata:u.providerMetadata}),d();break}case"tool-input-delta":{const b=o.partialToolCalls[u.toolCallId];if(b==null)throw new on({chunkType:"tool-input-delta",chunkId:u.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${u.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});b.text+=u.inputTextDelta;const{value:w}=await dr(b.text);b.dynamic?E({toolCallId:u.toolCallId,toolName:b.toolName,state:"input-streaming",input:w,title:b.title}):T({toolCallId:u.toolCallId,toolName:b.toolName,state:"input-streaming",input:w,title:b.title}),d();break}case"tool-input-available":{u.dynamic?E({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-available",input:u.input,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata,title:u.title}):T({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-available",input:u.input,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata,title:u.title}),d(),i&&!u.providerExecuted&&await i({toolCall:u});break}case"tool-input-error":{u.dynamic?E({toolCallId:u.toolCallId,toolName:u.toolName,state:"output-error",input:u.input,errorText:u.errorText,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata}):T({toolCallId:u.toolCallId,toolName:u.toolName,state:"output-error",input:void 0,rawInput:u.input,errorText:u.errorText,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata}),d();break}case"tool-approval-request":{const b=_(u.toolCallId);b.state="approval-requested",b.approval={id:u.approvalId},d();break}case"tool-output-denied":{const b=_(u.toolCallId);b.state="output-denied",d();break}case"tool-output-available":{const b=_(u.toolCallId);b.type==="dynamic-tool"?E({toolCallId:u.toolCallId,toolName:b.toolName,state:"output-available",input:b.input,output:u.output,preliminary:u.preliminary,providerExecuted:u.providerExecuted,title:b.title}):T({toolCallId:u.toolCallId,toolName:ya(b),state:"output-available",input:b.input,output:u.output,providerExecuted:u.providerExecuted,preliminary:u.preliminary,title:b.title}),d();break}case"tool-output-error":{const b=_(u.toolCallId);b.type==="dynamic-tool"?E({toolCallId:u.toolCallId,toolName:b.toolName,state:"output-error",input:b.input,errorText:u.errorText,providerExecuted:u.providerExecuted,title:b.title}):T({toolCallId:u.toolCallId,toolName:ya(b),state:"output-error",input:b.input,rawInput:b.rawInput,errorText:u.errorText,providerExecuted:u.providerExecuted,title:b.title}),d();break}case"start-step":{o.message.parts.push({type:"step-start"});break}case"finish-step":{o.activeTextParts={},o.activeReasoningParts={};break}case"start":{u.messageId!=null&&(o.message.id=u.messageId),await A(u.messageMetadata),(u.messageId!=null||u.messageMetadata!=null)&&d();break}case"finish":{u.finishReason!=null&&(o.finishReason=u.finishReason),await A(u.messageMetadata),u.messageMetadata!=null&&d();break}case"message-metadata":{await A(u.messageMetadata),u.messageMetadata!=null&&d();break}case"error":{s?.(new Error(u.errorText));break}default:if(Vh(u)){n?.[u.type]!=null&&await xa({value:u.data,schema:n[u.type]});const b=u;if(b.transient){a?.(b);break}const w=b.id!=null?o.message.parts.find(R=>b.type===R.type&&b.id===R.id):void 0;w!=null?w.data=b.data:o.message.parts.push(b),a?.(b),d()}}l.enqueue(u)})}}))}async function Xh({stream:t,onError:e}){const n=t.getReader();try{for(;;){const{done:r}=await n.read();if(r)break}}catch(r){e?.(r)}finally{n.releaseLock()}}cr({prefix:"aitxt",size:24});cr({prefix:"aiobj",size:24});var Zh=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(t){return new Promise((e,n)=>{this.queue.push(async()=>{try{await t(),e()}catch(r){n(r)}}),this.processQueue()})}};cr({prefix:"aiobj",size:24});async function Kh(t){if(t==null)return[];if(!globalThis.FileList||!(t instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(t).map(async e=>{const{name:n,type:r}=e,s=await new Promise((i,a)=>{const u=new FileReader;u.onload=l=>{var o;i((o=l.target)==null?void 0:o.result)},u.onerror=l=>a(l),u.readAsDataURL(e)});return{type:"file",mediaType:r,filename:n,url:s}}))}var Jh=class{constructor({api:t="/api/chat",credentials:e,headers:n,body:r,fetch:s,prepareSendMessagesRequest:i,prepareReconnectToStreamRequest:a}){this.api=t,this.credentials=e,this.headers=n,this.body=r,this.fetch=s,this.prepareSendMessagesRequest=i,this.prepareReconnectToStreamRequest=a}async sendMessages({abortSignal:t,...e}){var n,r,s,i,a;const u=await Ut(this.body),l=await Ut(this.headers),o=await Ut(this.credentials),d={...Qt(l),...Qt(e.headers)},f=await((n=this.prepareSendMessagesRequest)==null?void 0:n.call(this,{api:this.api,id:e.chatId,messages:e.messages,body:{...u,...e.body},headers:d,credentials:o,requestMetadata:e.metadata,trigger:e.trigger,messageId:e.messageId})),p=(r=f?.api)!=null?r:this.api,h=f?.headers!==void 0?Qt(f.headers):d,g=f?.body!==void 0?f.body:{...u,...e.body,id:e.chatId,messages:e.messages,trigger:e.trigger,messageId:e.messageId},_=(s=f?.credentials)!=null?s:o,E=await((i=this.fetch)!=null?i:globalThis.fetch)(p,{method:"POST",headers:ga({"Content-Type":"application/json",...h},`ai-sdk/${_a}`,ma()),body:JSON.stringify(g),credentials:_,signal:t});if(!E.ok)throw new Error((a=await E.text())!=null?a:"Failed to fetch the chat response.");if(!E.body)throw new Error("The response body is empty.");return this.processResponseStream(E.body)}async reconnectToStream(t){var e,n,r,s,i;const a=await Ut(this.body),u=await Ut(this.headers),l=await Ut(this.credentials),o={...Qt(u),...Qt(t.headers)},d=await((e=this.prepareReconnectToStreamRequest)==null?void 0:e.call(this,{api:this.api,id:t.chatId,body:{...a,...t.body},headers:o,credentials:l,requestMetadata:t.metadata})),f=(n=d?.api)!=null?n:`${this.api}/${t.chatId}/stream`,p=d?.headers!==void 0?Qt(d.headers):o,h=(r=d?.credentials)!=null?r:l,_=await((s=this.fetch)!=null?s:globalThis.fetch)(f,{method:"GET",headers:ga(p,`ai-sdk/${_a}`,ma()),credentials:h});if(_.status===204)return null;if(!_.ok)throw new Error((i=await _.text())!=null?i:"Failed to fetch the chat response.");if(!_.body)throw new Error("The response body is empty.");return this.processResponseStream(_.body)}},Bo=class extends Jh{constructor(t={}){super(t)}processResponseStream(t){return Ah({stream:t,schema:qh}).pipeThrough(new TransformStream({async transform(e,n){if(!e.success)throw e.error;n.enqueue(e.value)}}))}},e0=class{constructor({generateId:t=If,id:e=t(),transport:n=new Bo,messageMetadataSchema:r,dataPartSchemas:s,state:i,onError:a,onToolCall:u,onFinish:l,onData:o,sendAutomaticallyWhen:d}){this.activeResponse=void 0,this.jobExecutor=new Zh,this.sendMessage=async(f,p)=>{var h,g,_,T;if(f==null){await this.makeRequest({trigger:"submit-message",messageId:(h=this.lastMessage)==null?void 0:h.id,...p});return}let E;if("text"in f||"files"in f?E={parts:[...Array.isArray(f.files)?f.files:await Kh(f.files),..."text"in f&&f.text!=null?[{type:"text",text:f.text}]:[]]}:E=f,f.messageId!=null){const A=this.state.messages.findIndex(b=>b.id===f.messageId);if(A===-1)throw new Error(`message with id ${f.messageId} not found`);if(this.state.messages[A].role!=="user")throw new Error(`message with id ${f.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,A+1),this.state.replaceMessage(A,{...E,id:f.messageId,role:(g=E.role)!=null?g:"user",metadata:f.metadata})}else this.state.pushMessage({...E,id:(_=E.id)!=null?_:this.generateId(),role:(T=E.role)!=null?T:"user",metadata:f.metadata});await this.makeRequest({trigger:"submit-message",messageId:f.messageId,...p})},this.regenerate=async({messageId:f,...p}={})=>{const h=f==null?this.state.messages.length-1:this.state.messages.findIndex(g=>g.id===f);if(h===-1)throw new Error(`message ${f} not found`);this.state.messages=this.state.messages.slice(0,this.messages[h].role==="assistant"?h:h+1),await this.makeRequest({trigger:"regenerate-message",messageId:f,...p})},this.resumeStream=async(f={})=>{await this.makeRequest({trigger:"resume-stream",...f})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:f,approved:p,reason:h})=>this.jobExecutor.run(async()=>{var g,_;const T=this.state.messages,E=T[T.length-1],A=b=>Fs(b)&&b.state==="approval-requested"&&b.approval.id===f?{...b,state:"approval-responded",approval:{id:f,approved:p,reason:h}}:b;this.state.replaceMessage(T.length-1,{...E,parts:E.parts.map(A)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(A)),this.status!=="streaming"&&this.status!=="submitted"&&((g=this.sendAutomaticallyWhen)!=null&&g.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(_=this.lastMessage)==null?void 0:_.id})}),this.addToolOutput=async({state:f="output-available",tool:p,toolCallId:h,output:g,errorText:_})=>this.jobExecutor.run(async()=>{var T,E;const A=this.state.messages,b=A[A.length-1],w=R=>Fs(R)&&R.toolCallId===h?{...R,state:f,output:g,errorText:_}:R;this.state.replaceMessage(A.length-1,{...b,parts:b.parts.map(w)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(w)),this.status!=="streaming"&&this.status!=="submitted"&&((T=this.sendAutomaticallyWhen)!=null&&T.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(E=this.lastMessage)==null?void 0:E.id})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var f;this.status!=="streaming"&&this.status!=="submitted"||(f=this.activeResponse)!=null&&f.abortController&&this.activeResponse.abortController.abort()},this.id=e,this.transport=n,this.generateId=t,this.messageMetadataSchema=r,this.dataPartSchemas=s,this.state=i,this.onError=a,this.onToolCall=u,this.onFinish=l,this.onData=o,this.sendAutomaticallyWhen=d}get status(){return this.state.status}setStatus({status:t,error:e}){this.status!==t&&(this.state.status=t,this.state.error=e)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(t){this.state.messages=t}async makeRequest({trigger:t,metadata:e,headers:n,body:r,messageId:s}){var i,a,u,l;this.setStatus({status:"submitted",error:void 0});const o=this.lastMessage;let d=!1,f=!1,p=!1;try{const h={state:Wh({lastMessage:this.state.snapshot(o),messageId:this.generateId()}),abortController:new AbortController};h.abortController.signal.addEventListener("abort",()=>{d=!0}),this.activeResponse=h;let g;if(t==="resume-stream"){const T=await this.transport.reconnectToStream({chatId:this.id,metadata:e,headers:n,body:r});if(T==null){this.setStatus({status:"ready"});return}g=T}else g=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:h.abortController.signal,metadata:e,headers:n,body:r,trigger:t,messageId:s});const _=T=>this.jobExecutor.run(()=>T({state:h.state,write:()=>{var E;this.setStatus({status:"streaming"}),h.state.message.id===((E=this.lastMessage)==null?void 0:E.id)?this.state.replaceMessage(this.state.messages.length-1,h.state.message):this.state.pushMessage(h.state.message)}}));await Xh({stream:Qh({stream:g,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:_,onError:T=>{throw T}}),onError:T=>{throw T}}),this.setStatus({status:"ready"})}catch(h){if(d||h.name==="AbortError")return d=!0,this.setStatus({status:"ready"}),null;p=!0,h instanceof TypeError&&(h.message.toLowerCase().includes("fetch")||h.message.toLowerCase().includes("network"))&&(f=!0),this.onError&&h instanceof Error&&this.onError(h),this.setStatus({status:"error",error:h})}finally{try{(a=this.onFinish)==null||a.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:d,isDisconnect:f,isError:p,finishReason:(i=this.activeResponse)==null?void 0:i.state.finishReason})}catch(h){console.error(h)}this.activeResponse=void 0}(u=this.sendAutomaticallyWhen)!=null&&u.call(this,{messages:this.state.messages})&&!p&&await this.makeRequest({trigger:"submit-message",messageId:(l=this.lastMessage)==null?void 0:l.id,metadata:e,headers:n,body:r})}},ds,Aa;function t0(){if(Aa)return ds;Aa=1;function t(e,n){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let r,s=0;return function(...a){clearTimeout(r);const u=Date.now(),l=u-s,o=n-l;o<=0?(s=u,e.apply(this,a)):r=setTimeout(()=>{s=Date.now(),e.apply(this,a)},o)}}return ds=t,ds}var n0=t0();const r0=ai(n0);var Fo=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},ke=(t,e,n)=>(Fo(t,e,"read from private field"),n?n.call(t):e.get(t)),_t=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Mt=(t,e,n,r)=>(Fo(t,e,"write to private field"),e.set(t,n),n);function s0(t,e){return e!=null?r0(t,e):t}var ft,Ir,Nr,Bn,Fn,Un,dn,Us,Hs,i0=class{constructor(t=[]){_t(this,ft,void 0),_t(this,Ir,"ready"),_t(this,Nr,void 0),_t(this,Bn,new Set),_t(this,Fn,new Set),_t(this,Un,new Set),this.pushMessage=e=>{Mt(this,ft,ke(this,ft).concat(e)),ke(this,dn).call(this)},this.popMessage=()=>{Mt(this,ft,ke(this,ft).slice(0,-1)),ke(this,dn).call(this)},this.replaceMessage=(e,n)=>{Mt(this,ft,[...ke(this,ft).slice(0,e),this.snapshot(n),...ke(this,ft).slice(e+1)]),ke(this,dn).call(this)},this.snapshot=e=>structuredClone(e),this["~registerMessagesCallback"]=(e,n)=>{const r=n?s0(e,n):e;return ke(this,Bn).add(r),()=>{ke(this,Bn).delete(r)}},this["~registerStatusCallback"]=e=>(ke(this,Fn).add(e),()=>{ke(this,Fn).delete(e)}),this["~registerErrorCallback"]=e=>(ke(this,Un).add(e),()=>{ke(this,Un).delete(e)}),_t(this,dn,()=>{ke(this,Bn).forEach(e=>e())}),_t(this,Us,()=>{ke(this,Fn).forEach(e=>e())}),_t(this,Hs,()=>{ke(this,Un).forEach(e=>e())}),Mt(this,ft,t)}get status(){return ke(this,Ir)}set status(t){Mt(this,Ir,t),ke(this,Us).call(this)}get error(){return ke(this,Nr)}set error(t){Mt(this,Nr,t),ke(this,Hs).call(this)}get messages(){return ke(this,ft)}set messages(t){Mt(this,ft,[...t]),ke(this,dn).call(this)}};ft=new WeakMap;Ir=new WeakMap;Nr=new WeakMap;Bn=new WeakMap;Fn=new WeakMap;Un=new WeakMap;dn=new WeakMap;Us=new WeakMap;Hs=new WeakMap;var fn,ka=class extends e0{constructor({messages:e,...n}){const r=new i0(e);super({...n,state:r}),_t(this,fn,void 0),this["~registerMessagesCallback"]=(s,i)=>ke(this,fn)["~registerMessagesCallback"](s,i),this["~registerStatusCallback"]=s=>ke(this,fn)["~registerStatusCallback"](s),this["~registerErrorCallback"]=s=>ke(this,fn)["~registerErrorCallback"](s),Mt(this,fn,r)}};fn=new WeakMap;function a0({experimental_throttle:t,resume:e=!1,...n}={}){const r=j.useRef("chat"in n?{}:{onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});"chat"in n||(r.current={onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});const s={...n,onToolCall:p=>{var h,g;return(g=(h=r.current).onToolCall)==null?void 0:g.call(h,p)},onData:p=>{var h,g;return(g=(h=r.current).onData)==null?void 0:g.call(h,p)},onFinish:p=>{var h,g;return(g=(h=r.current).onFinish)==null?void 0:g.call(h,p)},onError:p=>{var h,g;return(g=(h=r.current).onError)==null?void 0:g.call(h,p)},sendAutomaticallyWhen:p=>{var h,g,_;return(_=(g=(h=r.current).sendAutomaticallyWhen)==null?void 0:g.call(h,p))!=null?_:!1}},i=j.useRef("chat"in n?n.chat:new ka(s));("chat"in n&&n.chat!==i.current||"id"in n&&i.current.id!==n.id)&&(i.current="chat"in n?n.chat:new ka(s));const u=j.useCallback(p=>i.current["~registerMessagesCallback"](p,t),[t,i.current.id]),l=j.useSyncExternalStore(u,()=>i.current.messages,()=>i.current.messages),o=j.useSyncExternalStore(i.current["~registerStatusCallback"],()=>i.current.status,()=>i.current.status),d=j.useSyncExternalStore(i.current["~registerErrorCallback"],()=>i.current.error,()=>i.current.error),f=j.useCallback(p=>{typeof p=="function"&&(p=p(i.current.messages)),i.current.messages=p},[i]);return j.useEffect(()=>{e&&i.current.resumeStream()},[e,i]),{id:i.current.id,messages:l,setMessages:f,sendMessage:i.current.sendMessage,regenerate:i.current.regenerate,clearError:i.current.clearError,stop:i.current.stop,error:d,resumeStream:i.current.resumeStream,status:o,addToolResult:i.current.addToolOutput,addToolOutput:i.current.addToolOutput,addToolApprovalResponse:i.current.addToolApprovalResponse}}function u0(t,e){const n=Q.c(4);let r;n[0]!==e?(r=e===void 0?{}:e,n[0]=e,n[1]=r):r=n[1];const s=r,i=t??Md;let a;return n[2]!==i?(a=Bd(i),n[2]=i,n[3]=a):a=n[3],Fd(i,"LLM",a,s)}function bi(){const t=Q.c(2),e=Wu();let n;return t[0]!==e?(n={connections:e,binding:"LLMS"},t[0]=e,t[1]=n):n=t[1],Hd(n)}function en(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function o0(t,e){let n;const r=()=>{if(n)return n;const s=indexedDB.open(t);return s.onupgradeneeded=()=>s.result.createObjectStore(e),n=en(s),n.then(i=>{i.onclose=()=>n=void 0},()=>{}),n};return(s,i)=>r().then(a=>i(a.transaction(e,s).objectStore(e)))}let fs;function Gr(){return fs||(fs=o0("keyval-store","keyval")),fs}function Ei(t,e=Gr()){return e("readonly",n=>en(n.get(t)))}function jn(t,e,n=Gr()){return n("readwrite",r=>(r.put(e,t),en(r.transaction)))}function Uo(t,e=Gr()){return e("readwrite",n=>(n.delete(t),en(n.transaction)))}function l0(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},en(t.transaction)}function Ho(t=Gr()){return t("readonly",e=>{if(e.getAll&&e.getAllKeys)return Promise.all([en(e.getAllKeys()),en(e.getAll())]).then(([r,s])=>r.map((i,a)=>[i,s[a]]));const n=[];return t("readonly",r=>l0(r,s=>n.push([s.key,s.value])).then(()=>n))})}async function c0(t,e){const n=`${t}:threads:${e}`;return await Ei(n)??null}async function d0(t){const e=`${t}:threads:`;return(await Ho()).filter(([s])=>typeof s=="string"&&s.startsWith(e)).map(([,s])=>s).filter(s=>!s.hidden).sort((s,i)=>String(i.updated_at).localeCompare(String(s.updated_at)))}function jo(t,e){const n=`${t}:messages:`;return Ho().then(r=>r.filter(([i])=>typeof i=="string"&&i.startsWith(n)).map(([,i])=>i).filter(i=>i.metadata?.thread_id===e||i.threadId===e).sort((i,a)=>{const u=i.metadata?.created_at||i.createdAt||"",l=a.metadata?.created_at||a.createdAt||"";return String(u).localeCompare(String(l))}))}function zo(t){const e=Q.c(14),{locator:n}=zt(),r=t?.gatewayId;let s;e[0]!==r||e[1]!==n?(s=je.threads(n),e[0]=r,e[1]=n,e[2]=s):s=e[2];let i;e[3]!==r||e[4]!==n?(i=async()=>await d0(n),e[3]=r,e[4]=n,e[5]=i):i=e[5];let a;e[6]!==s||e[7]!==i?(a={queryKey:s,queryFn:i,staleTime:3e4},e[6]=s,e[7]=i,e[8]=a):a=e[8];const{data:u,refetch:l}=ui(a);let o;e[9]!==u?(o=u??[],e[9]=u,e[10]=o):o=e[10];let d;return e[11]!==l||e[12]!==o?(d={threads:o,refetch:l},e[11]=l,e[12]=o,e[13]=d):d=e[13],d}function f0(t){const e=Q.c(11),{locator:n}=zt();let r;e[0]!==n||e[1]!==t?(r=je.threadMessages(n,t),e[0]=n,e[1]=t,e[2]=r):r=e[2];let s;e[3]!==n||e[4]!==t?(s=()=>jo(n,t),e[3]=n,e[4]=t,e[5]=s):s=e[5];let i;e[6]!==r||e[7]!==s?(i={queryKey:r,queryFn:s,staleTime:3e4},e[6]=r,e[7]=s,e[8]=i):i=e[8];const{data:a}=ui(i);let u;return e[9]!==a?(u=a??[],e[9]=a,e[10]=u):u=e[10],u}function $o(){const t=Q.c(28),{locator:e}=zt(),n=oi();let r;t[0]!==e?(r=async T=>{const E=`${e}:threads:${T.id}`;return await jn(E,T),T},t[0]=e,t[1]=r):r=t[1];let s;t[2]!==e||t[3]!==n?(s=T=>{n.invalidateQueries({queryKey:je.threads(e)}),T.gatewayId&&n.invalidateQueries({queryKey:je.gatewayThreads(e,T.gatewayId)})},t[2]=e,t[3]=n,t[4]=s):s=t[4];let i;t[5]!==r||t[6]!==s?(i={mutationFn:r,onSuccess:s},t[5]=r,t[6]=s,t[7]=i):i=t[7];const a=Xt(i);let u;t[8]!==e?(u=async T=>{const{id:E,updates:A}=T,b=`${e}:threads:${E}`,w=await Ei(b);if(!w)throw new Error(`Thread ${E} not found`);const R={...w,...A};return await jn(b,R),R},t[8]=e,t[9]=u):u=t[9];let l;t[10]!==e||t[11]!==n?(l=T=>{n.invalidateQueries({queryKey:je.threads(e)}),n.invalidateQueries({queryKey:je.thread(e,T.id)}),T.gatewayId&&n.invalidateQueries({queryKey:je.gatewayThreads(e,T.gatewayId)})},t[10]=e,t[11]=n,t[12]=l):l=t[12];let o;t[13]!==u||t[14]!==l?(o={mutationFn:u,onSuccess:l},t[13]=u,t[14]=l,t[15]=o):o=t[15];const d=Xt(o);let f;t[16]!==e?(f=async T=>{const E=`${e}:threads:${T}`;return await Uo(E),T},t[16]=e,t[17]=f):f=t[17];let p;t[18]!==e||t[19]!==n?(p=()=>{n.invalidateQueries({queryKey:je.threads(e)})},t[18]=e,t[19]=n,t[20]=p):p=t[20];let h;t[21]!==f||t[22]!==p?(h={mutationFn:f,onSuccess:p},t[21]=f,t[22]=p,t[23]=h):h=t[23];const g=Xt(h);let _;return t[24]!==g||t[25]!==a||t[26]!==d?(_={insert:a,update:d,delete:g},t[24]=g,t[25]=a,t[26]=d,t[27]=_):_=t[27],_}function Yo(){const t=Q.c(37),{locator:e}=zt(),n=oi();let r;t[0]!==e?(r=async w=>{const R=`${e}:messages:${w.id}`;return await jn(R,w),w},t[0]=e,t[1]=r):r=t[1];let s;t[2]!==e||t[3]!==n?(s=w=>{const R=w.metadata?.thread_id||w.threadId;R&&n.invalidateQueries({queryKey:je.threadMessages(e,R)}),n.invalidateQueries({queryKey:je.messages(e)})},t[2]=e,t[3]=n,t[4]=s):s=t[4];let i;t[5]!==r||t[6]!==s?(i={mutationFn:r,onSuccess:s},t[5]=r,t[6]=s,t[7]=i):i=t[7];const a=Xt(i);let u;t[8]!==e?(u=async w=>(await Promise.all(w.map(R=>{const I=`${e}:messages:${R.id}`;return jn(I,R)})),w),t[8]=e,t[9]=u):u=t[9];let l;t[10]!==e||t[11]!==n?(l=w=>{const R=new Set;for(const I of w){const L=I.metadata?.thread_id||I.threadId;L&&R.add(L)}for(const I of R)n.invalidateQueries({queryKey:je.threadMessages(e,I)});n.invalidateQueries({queryKey:je.messages(e)})},t[10]=e,t[11]=n,t[12]=l):l=t[12];let o;t[13]!==u||t[14]!==l?(o={mutationFn:u,onSuccess:l},t[13]=u,t[14]=l,t[15]=o):o=t[15];const d=Xt(o);let f;t[16]!==e?(f=async w=>{const{id:R,updates:I}=w,L=`${e}:messages:${R}`,M=await Ei(L);if(!M)throw new Error(`Message ${R} not found`);const P={...M,...I};return await jn(L,P),P},t[16]=e,t[17]=f):f=t[17];let p;t[18]!==e||t[19]!==n?(p=w=>{const R=w.metadata?.thread_id||w.threadId;R&&n.invalidateQueries({queryKey:je.threadMessages(e,R)}),n.invalidateQueries({queryKey:je.messages(e)})},t[18]=e,t[19]=n,t[20]=p):p=t[20];let h;t[21]!==f||t[22]!==p?(h={mutationFn:f,onSuccess:p},t[21]=f,t[22]=p,t[23]=h):h=t[23];const g=Xt(h);let _;t[24]!==e?(_=async w=>{const R=`${e}:messages:${w}`;return await Uo(R),w},t[24]=e,t[25]=_):_=t[25];let T;t[26]!==e||t[27]!==n?(T=()=>{n.invalidateQueries({queryKey:je.messages(e)})},t[26]=e,t[27]=n,t[28]=T):T=t[28];let E;t[29]!==T||t[30]!==_?(E={mutationFn:_,onSuccess:T},t[29]=T,t[30]=_,t[31]=E):E=t[31];const A=Xt(E);let b;return t[32]!==A||t[33]!==a||t[34]!==d||t[35]!==g?(b={insert:a,insertMany:d,update:g,delete:A},t[32]=A,t[33]=a,t[34]=d,t[35]=g,t[36]=b):b=t[36],b}function h0(t){const e=Q.c(11);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},e[0]=n):n=e[0];const r=Yu(n),[s]=jd(t??void 0);let i;if(e[1]!==t||e[2]!==s||e[3]!==r.collectionName||e[4]!==r.connectionId||e[5]!==r.itemId){i=[],t&&(i.push(`### Selected Agent/Gateway
|
|
13
13
|
- ID: ${t}`),s?.trim()&&i.push(`### Agent Instructions
|
|
14
14
|
${s}`));let a;e[7]!==r.collectionName||e[8]!==r.connectionId||e[9]!==r.itemId?(a=[],r.connectionId&&a.push(`- Connection ID: ${r.connectionId}`),r.collectionName&&a.push(`- Collection: ${r.collectionName}`),r.itemId&&a.push(`- Item ID: ${r.itemId}`),e[7]=r.collectionName,e[8]=r.connectionId,e[9]=r.itemId,e[10]=a):a=e[10],a.length>0&&i.push(`### Current Resource
|
|
15
15
|
The user is viewing the following resource:
|
|
@@ -18,10 +18,10 @@ ${a.join(`
|
|
|
18
18
|
|
|
19
19
|
Help the user understand and work with this resource.`),e[1]=t,e[2]=s,e[3]=r.collectionName,e[4]=r.connectionId,e[5]=r.itemId,e[6]=i}else i=e[6];return i.join(`
|
|
20
20
|
|
|
21
|
-
`)}function p0(){const t=Q.c(5),e=oi(),{org:n}=zt();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const s=qu(r);let i;return t[1]!==n||t[2]!==s||t[3]!==e?(i=a=>{const l=a.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!l||!l[1])return;const o=l[1],d=s.connectionId;if(!d)return;e.invalidateQueries({queryKey:je.collection(n.slug,d,o)});const f=o.toLowerCase().replace(/_/g," ");Kn.success(`${f} updated`)},t[1]=n,t[2]=s,t[3]=e,t[4]=i):i=t[4],i}function qo(){const t=Q.c(2),e=Dd();let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function m0(t){const e=Q.c(24),{gateway:n,isSelected:r}=t,s=r&&"bg-accent";let i;e[0]!==s?(i=ie("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-xl transition-colors",s),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n.fallbackIcon?(a=n.fallbackIcon??m.jsx(di,{}),e[2]=n.fallbackIcon,e[3]=a):a=e[3];let u;e[4]!==n.icon||e[5]!==n.title||e[6]!==a?(u=m.jsx(ci,{icon:n.icon,name:n.title,size:"sm",fallbackIcon:a,className:"size-10 rounded-xl border border-stone-200/60 shadow-sm shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=a,e[7]=u):u=e[7];let l;e[8]!==n.title?(l=m.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let o;e[10]!==r?(o=r&&m.jsx(Yr,{size:16,className:"text-foreground shrink-0"}),e[10]=r,e[11]=o):o=e[11];let d;e[12]!==l||e[13]!==o?(d=m.jsxs("div",{className:"flex items-center justify-between",children:[l,o]}),e[12]=l,e[13]=o,e[14]=d):d=e[14];let f;e[15]!==n.description?(f=n.description&&m.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:n.description}),e[15]=n.description,e[16]=f):f=e[16];let p;e[17]!==d||e[18]!==f?(p=m.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[d,f]}),e[17]=d,e[18]=f,e[19]=p):p=e[19];let h;return e[20]!==i||e[21]!==u||e[22]!==p?(h=m.jsxs("div",{className:i,children:[u,p]}),e[20]=i,e[21]=u,e[22]=p,e[23]=h):h=e[23],h}function Vo(t){const e=Q.c(25),{gateways:n,selectedGatewayId:r,onGatewayChange:s,searchInputRef:i}=t,[a,u]=j.useState(""),l=j.useRef(null),o=i??l;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={navigateOnCreate:!0},e[0]=d):d=e[0];const{createGateway:f,isCreating:p}=zd(d);let h;e:{if(!a.trim()){h=n;break e}let P;if(e[1]!==n||e[2]!==a){const S=a.toLowerCase();P=n.filter(B=>B.title.toLowerCase().includes(S)||B.description?.toLowerCase().includes(S)),e[1]=n,e[2]=a,e[3]=P}else P=e[3];h=P}const g=h;let _;e[4]!==s?(_=P=>{s(P),u("")},e[4]=s,e[5]=_):_=e[5];const T=_;let E;e[6]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx(qr,{size:16,className:"text-muted-foreground pointer-events-none shrink-0"}),e[6]=E):E=e[6];let A;e[7]===Symbol.for("react.memo_cache_sentinel")?(A=P=>u(P.target.value),e[7]=A):A=e[7];let b;e[8]!==o||e[9]!==a?(b=m.jsx(hi,{ref:o,type:"text",placeholder:"Search for an agent...",value:a,onChange:A,className:"flex-1 h-8 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none p-0"}),e[8]=o,e[9]=a,e[10]=b):b=e[10];const w=p?"Creating...":"Create Agent";let R;e[11]!==f||e[12]!==p||e[13]!==w?(R=m.jsx(Me,{onClick:f,variant:"outline",size:"sm",className:"h-8 px-3 rounded-lg text-sm font-medium shrink-0",disabled:p,children:w}),e[11]=f,e[12]=p,e[13]=w,e[14]=R):R=e[14];let I;e[15]!==b||e[16]!==R?(I=m.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:m.jsxs("div",{className:"relative flex items-center gap-2",children:[E,b,R]})}),e[15]=b,e[16]=R,e[17]=I):I=e[17];let L;e[18]!==g||e[19]!==T||e[20]!==r?(L=m.jsx("div",{className:"overflow-y-auto p-1.5",children:g.length>0?m.jsx("div",{className:"grid grid-cols-2 gap-0.5",children:g.map(P=>m.jsx("div",{role:"button",tabIndex:0,onClick:()=>T(P.id),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),T(P.id))},className:"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-xl",children:m.jsx(m0,{gateway:P,isSelected:P.id===r})},P.id))}):m.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No agents found"})}),e[18]=g,e[19]=T,e[20]=r,e[21]=L):L=e[21];let M;return e[22]!==L||e[23]!==I?(M=m.jsxs("div",{className:"flex flex-col max-h-[400px]",children:[I,L]}),e[22]=L,e[23]=I,e[24]=M):M=e[24],M}function g0(t){const e=Q.c(37),{selectedGatewayId:n,onGatewayChange:r,gateways:s,className:i,placeholder:a,showTooltip:u,disabled:l}=t,o=a===void 0?"Select Agent":a,d=u===void 0?!0:u,f=l===void 0?!1:l,[p,h]=j.useState(!1),g=j.useRef(null),_=qo(),T=s??_;let E,A;e[0]!==p?(E=()=>{p&&setTimeout(()=>{g.current?.focus()},0)},A=[p],e[0]=p,e[1]=E,e[2]=A):(E=e[1],A=e[2]),j.useEffect(E,A);let b;e[3]!==T||e[4]!==n?(b=n?T.find(re=>re.id===n):null,e[3]=T,e[4]=n,e[5]=b):b=e[5];const w=b;let R;e[6]!==r?(R=re=>{r(re),h(!1)},e[6]=r,e[7]=R):R=e[7];const I=R;let L;e[8]===Symbol.for("react.memo_cache_sentinel")?(L=re=>{h(re)},e[8]=L):L=e[8];const M=L,P=f?"cursor-not-allowed opacity-50":"cursor-pointer hover:bg-accent";let S;e[9]!==i||e[10]!==P?(S=ie("flex items-center justify-center p-1 rounded-md transition-colors shrink-0",P,i),e[9]=i,e[10]=P,e[11]=S):S=e[11];let B;e[12]!==w?(B=w?m.jsx(ci,{icon:w.icon,name:w.title,size:"xs",fallbackIcon:w.fallbackIcon??m.jsx(di,{size:12}),className:"size-5 rounded-md"}):m.jsx("img",{src:"/favicon.svg",alt:"Default Agent",className:"size-5 rounded-md"}),e[12]=w,e[13]=B):B=e[13];let $;e[14]!==f||e[15]!==o||e[16]!==S||e[17]!==B?($=m.jsx("button",{type:"button",disabled:f,className:S,"aria-label":o,children:B}),e[14]=f,e[15]=o,e[16]=S,e[17]=B,e[18]=$):$=e[18];const X=$,q=f?!1:p,U=f?void 0:M;let W;e[19]!==X?(W=m.jsx(_n,{asChild:!0,children:m.jsx(ur,{asChild:!0,children:X})}),e[19]=X,e[20]=W):W=e[20];let V;e[21]!==p||e[22]!==w?.title||e[23]!==d?(V=d&&!p&&m.jsx(xn,{side:"top",className:"text-xs",children:w?.title??"Choose an agent to chat with"}),e[21]=p,e[22]=w?.title,e[23]=d,e[24]=V):V=e[24];let K;e[25]!==W||e[26]!==V?(K=m.jsx(pi,{children:m.jsxs(yn,{children:[W,V]})}),e[25]=W,e[26]=V,e[27]=K):K=e[27];let J;e[28]!==T||e[29]!==I||e[30]!==n?(J=m.jsx(or,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:m.jsx(Vo,{gateways:T,selectedGatewayId:n,onGatewayChange:I,searchInputRef:g})}),e[28]=T,e[29]=I,e[30]=n,e[31]=J):J=e[31];let k;return e[32]!==q||e[33]!==U||e[34]!==K||e[35]!==J?(k=m.jsxs(lr,{open:q,onOpenChange:U,children:[K,J]}),e[32]=q,e[33]=U,e[34]=K,e[35]=J,e[36]=k):k=e[36],k}const b0=["x-ai/grok-code-fast-1","anthropic/claude-sonnet-4.5","google/gemini-2.5-flash","xiaomi/mimo-v2-flash:free","google/gemini-3-flash-preview","deepseek/deepseek-v3.2","anthropic/claude-opus-4.5","x-ai/grok-4.1-fast","google/gemini-2.5-flash-lite","google/gemini-2.0-flash-001"],js=new Map;b0.forEach((t,e)=>{js.set(t,e)});function xi(t){const e=Q.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={pageSize:999},e[0]=n):n=e[0];const r=u0(t??void 0,n);let s;return e[1]!==r?(s=r.filter(T0).sort(E0),e[1]=r,e[2]=s):s=e[2],s}function E0(t,e){const n=js.get(t.id),r=js.get(e.id);return n!==void 0&&r!==void 0?n-r:n!==void 0?-1:r!==void 0?1:t.title.localeCompare(e.title)}function T0(t){return t.limits?.contextWindow&&t.limits?.maxOutputTokens}const x0={reasoning:{icon:m.jsx(Vr,{className:"size-4"}),label:"Reasoning"},"image-upload":{icon:m.jsx(Xd,{className:"size-4"}),label:"Can analyze images"},"file-upload":{icon:m.jsx(Wd,{className:"size-4"}),label:"Can analyze files"},"web-search":{icon:m.jsx(qr,{className:"size-4"}),label:"Can search the web to answer questions"}};function Go(t){const e=Q.c(10),{capability:n}=t,r=x0[n];let s,i;e[0]!==n||e[1]!==r?(s=r||{icon:null,label:n},i=s.label.split("-").map(_0).join(" "),e[0]=n,e[1]=r,e[2]=s,e[3]=i):(s=e[2],i=e[3]);const a=i;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u={backgroundColor:"color-mix(in oklch, var(--chart-1) 15%, transparent)",color:"var(--chart-1)"},e[4]=u):u=e[4];let l;e[5]!==a?(l=m.jsx("span",{children:a}),e[5]=a,e[6]=l):l=e[6];let o;return e[7]!==s.icon||e[8]!==l?(o=m.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 px-1.5 rounded-md text-xs font-medium",style:u,children:[s.icon,l]}),e[7]=s.icon,e[8]=l,e[9]=o):o=e[9],o}function _0(t){return t.charAt(0).toUpperCase()+t.slice(1)}function y0(t){const e=Q.c(53),{model:n,compact:r}=t,s=r===void 0?!1:r;if(!n){let T;return e[0]===Symbol.for("react.memo_cache_sentinel")?(T=m.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=T):T=e[0],T}const i=n.limits?.contextWindow||n.costs?.input||n.costs?.output||n.limits?.maxOutputTokens;if(!i&&!s){let T;e[1]!==n.logo||e[2]!==n.title?(T=n.logo&&m.jsx("img",{src:n.logo,className:"w-6 h-6",alt:n.title}),e[1]=n.logo,e[2]=n.title,e[3]=T):T=e[3];let E;e[4]!==n.title?(E=m.jsx("p",{className:"text-lg font-medium leading-7",children:n.title}),e[4]=n.title,e[5]=E):E=e[5];let A;e[6]!==T||e[7]!==E?(A=m.jsxs("div",{className:"flex items-center gap-3 py-2 px-0",children:[T,E]}),e[6]=T,e[7]=E,e[8]=A):A=e[8];let b;e[9]!==n.description?(b=n.description&&m.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[9]=n.description,e[10]=b):b=e[10];let w;return e[11]!==A||e[12]!==b?(w=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[A,b]}),e[11]=A,e[12]=b,e[13]=w):w=e[13],w}if(!i&&s)return null;if(s){let T;e[14]!==n.limits?(T=n.limits?.contextWindow&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Context"}),m.jsxs("span",{className:"text-foreground font-medium",children:[n.limits.contextWindow.toLocaleString()," tokens"]})]}),e[14]=n.limits,e[15]=T):T=e[15];let E;e[16]!==n.costs?(E=n.costs?.input&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Input cost"}),m.jsxs("span",{className:"text-foreground font-medium",children:["$",n.costs.input.toFixed(2)," / 1M"]})]}),e[16]=n.costs,e[17]=E):E=e[17];let A;e[18]!==n.costs?(A=n.costs?.output&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Output cost"}),m.jsxs("span",{className:"text-foreground font-medium",children:["$",n.costs.output.toFixed(2)," / 1M"]})]}),e[18]=n.costs,e[19]=A):A=e[19];let b;e[20]!==n.limits?(b=n.limits?.maxOutputTokens&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),m.jsxs("span",{className:"text-foreground font-medium",children:[n.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[20]=n.limits,e[21]=b):b=e[21];let w;return e[22]!==T||e[23]!==E||e[24]!==A||e[25]!==b?(w=m.jsxs("div",{className:"flex flex-col gap-2.5 pt-3 pb-3 px-3 rounded-b-lg text-xs",children:[T,E,A,b]}),e[22]=T,e[23]=E,e[24]=A,e[25]=b,e[26]=w):w=e[26],w}let a;e[27]!==n.logo||e[28]!==n.title?(a=n.logo&&m.jsx("img",{src:n.logo,className:"w-6 h-6 shrink-0",alt:n.title}),e[27]=n.logo,e[28]=n.title,e[29]=a):a=e[29];let u;e[30]!==n.title?(u=m.jsx("p",{className:"text-lg font-medium leading-7 wrap-break-word min-w-0",children:n.title}),e[30]=n.title,e[31]=u):u=e[31];let l;e[32]!==a||e[33]!==u?(l=m.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[a,u]}),e[32]=a,e[33]=u,e[34]=l):l=e[34];let o;e[35]!==n.capabilities?(o=n.capabilities&&n.capabilities.length>0&&m.jsx("div",{className:"flex items-center gap-2",children:n.capabilities.map(A0)}),e[35]=n.capabilities,e[36]=o):o=e[36];let d;e[37]!==l||e[38]!==o?(d=m.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,o]}),e[37]=l,e[38]=o,e[39]=d):d=e[39];let f;e[40]!==n.limits?(f=n.limits?.contextWindow&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(Qd,{className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("p",{className:"text-sm text-foreground",children:"Context window"})]}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.limits.contextWindow.toLocaleString()," tokens"]})]}),e[40]=n.limits,e[41]=f):f=e[41];let p;e[42]!==n.costs?(p=(n.costs?.input||n.costs?.output)&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(ro,{className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("p",{className:"text-sm text-foreground",children:"Costs"})]}),m.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.costs?.input!==null&&n.costs?.input!==void 0&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",n.costs.input.toFixed(2)," / 1M tokens (input)"]}),n.costs?.output!==null&&n.costs?.output!==void 0&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",n.costs.output.toFixed(2)," / 1M tokens (output)"]})]})]}),e[42]=n.costs,e[43]=p):p=e[43];let h;e[44]!==n.limits?(h=n.limits?.maxOutputTokens&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(ao,{className:"w-4.5 h-4.5 text-muted-foreground/70"}),m.jsx("p",{className:"text-sm text-foreground",children:"Output limit"})]}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.limits.maxOutputTokens.toLocaleString()," token limit"]})]}),e[44]=n.limits,e[45]=h):h=e[45];let g;e[46]!==f||e[47]!==p||e[48]!==h?(g=m.jsxs("div",{className:"flex flex-col gap-4",children:[f,p,h]}),e[46]=f,e[47]=p,e[48]=h,e[49]=g):g=e[49];let _;return e[50]!==g||e[51]!==d?(_=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[d,g]}),e[50]=g,e[51]=d,e[52]=_):_=e[52],_}function A0(t){return m.jsx(Go,{capability:t},t)}function k0(t){const e=Q.c(15),{model:n,onHover:r}=t;let s;e[0]!==n||e[1]!==r?(s=()=>r(n),e[0]=n,e[1]=r,e[2]=s):s=e[2];let i;e[3]!==n.logo||e[4]!==n.title?(i=n.logo&&m.jsx("img",{src:n.logo,className:"w-5 h-5 shrink-0",alt:n.title}),e[3]=n.logo,e[4]=n.title,e[5]=i):i=e[5];let a;e[6]!==n.title?(a=m.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:n.title}),e[6]=n.title,e[7]=a):a=e[7];let u;e[8]!==n.capabilities?(u=n.capabilities&&n.capabilities.length>0&&m.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:n.capabilities.slice(0,2).map(C0)}),e[8]=n.capabilities,e[9]=u):u=e[9];let l;return e[10]!==s||e[11]!==i||e[12]!==a||e[13]!==u?(l=m.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:s,children:[i,a,u]}),e[10]=s,e[11]=i,e[12]=a,e[13]=u,e[14]=l):l=e[14],l}function C0(t){return m.jsx(Go,{capability:t},t)}function I0(t){const e=Q.c(10),{model:n,placeholder:r}=t,s=r===void 0?"Select model":r;if(!n){let l;return e[0]!==s?(l=m.jsx("span",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=l):l=e[1],l}let i;e[2]!==n.logo||e[3]!==n.title?(i=n.logo&&m.jsx("img",{src:n.logo,className:"w-5 h-5 shrink-0 rounded-sm",alt:n.title}),e[2]=n.logo,e[3]=n.title,e[4]=i):i=e[4];let a;e[5]!==n.title?(a=m.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors truncate min-w-0 hidden sm:inline-block",children:n.title}),e[5]=n.title,e[6]=a):a=e[6];let u;return e[7]!==i||e[8]!==a?(u=m.jsxs("div",{className:"flex items-center gap-2 min-w-0 overflow-hidden",children:[i,a]}),e[7]=i,e[8]=a,e[9]=u):u=e[9],u}function N0(){const t=Q.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:m.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[m.jsx($e,{className:"size-4 shrink-0"}),m.jsx($e,{className:"flex-1 h-6"}),m.jsx($e,{className:"w-[140px] h-8 shrink-0"})]})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[400px] md:min-w-[400px]",children:[e,m.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 pt-2 space-y-1",children:Array.from({length:6}).map(S0)})]}),t[1]=n):n=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[m.jsx($e,{className:"size-6 shrink-0"}),m.jsx($e,{className:"h-6 w-32"})]}),t[2]=r):r=t[2];let s;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[r,m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx($e,{className:"h-6 w-20 rounded-md"}),m.jsx($e,{className:"h-6 w-24 rounded-md"})]})]}),t[3]=s):s=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsx($e,{className:"h-4 w-24"}),m.jsx($e,{className:"h-4 w-32"})]}),t[4]=i):i=t[4];let a;return t[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[n,m.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[s,m.jsxs("div",{className:"flex flex-col gap-4",children:[i,m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsx($e,{className:"h-4 w-16"}),m.jsx($e,{className:"h-4 w-40"})]})]})]})})]}),t[5]=a):a=t[5],a}function S0(t,e){return m.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[m.jsx($e,{className:"size-5 shrink-0 rounded-sm"}),m.jsx($e,{className:"flex-1 h-4"}),m.jsx($e,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function w0(t){const e=Q.c(39),{selectedModel:n,onModelChange:r,onClose:s,modelsConnections:i}=t,[a,u]=j.useState(null),[l,o]=j.useState(""),d=j.useRef(null),[f,p]=j.useState(n?.connectionId??null),h=Ei(),g=i??h,_=xi(f);let T,E;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=()=>{setTimeout(()=>{d.current?.focus()},0)},E=[],e[0]=T,e[1]=E):(T=e[0],E=e[1]),j.useEffect(T,E);let A;e[2]!==_||e[3]!==l?(A=l.trim()?_.filter(J=>{const k=l.toLowerCase();return J.title.toLowerCase().includes(k)||J.provider?.toLowerCase().includes(k)||J.description?.toLowerCase().includes(k)}):_,e[2]=_,e[3]=l,e[4]=A):A=e[4];const b=A;let w;e[5]===Symbol.for("react.memo_cache_sentinel")?(w=J=>{p(J)},e[5]=w):w=e[5];const R=w;let I;e[6]!==_||e[7]!==s||e[8]!==r||e[9]!==f?(I=J=>{const k=_.find(re=>re.id===J);!k||!f||(r({id:k.id,connectionId:f,provider:k.provider??void 0}),o(""),s())},e[6]=_,e[7]=s,e[8]=r,e[9]=f,e[10]=I):I=e[10];const L=I;let M;e[11]===Symbol.for("react.memo_cache_sentinel")?(M=m.jsx(qr,{size:16,className:"text-muted-foreground shrink-0"}),e[11]=M):M=e[11];let P;e[12]===Symbol.for("react.memo_cache_sentinel")?(P=J=>o(J.target.value),e[12]=P):P=e[12];let S;e[13]!==l?(S=m.jsx(hi,{ref:d,type:"text",placeholder:"Search for a model...",value:l,onChange:P,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[13]=l,e[14]=S):S=e[14];let B;e[15]!==g||e[16]!==f?(B=g.length>0&&m.jsxs($d,{value:f??"",onValueChange:R,children:[m.jsxs(Yd,{size:"sm",className:"w-auto min-w-[140px] h-8 shrink-0 [&>svg:last-child]:hidden",onClick:O0,children:[m.jsx(qd,{placeholder:"Select connection"}),m.jsx(eo,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),m.jsx(Vd,{children:g.map(R0)})]}),e[15]=g,e[16]=f,e[17]=B):B=e[17];let $;e[18]!==S||e[19]!==B?($=m.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:m.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[M,S,B]})}),e[18]=S,e[19]=B,e[20]=$):$=e[20];let X;e[21]!==b||e[22]!==L||e[23]!==n?.id?(X=b.length>0?b.map(J=>{const k=J.id===n?.id;return m.jsx("div",{onClick:()=>L(J.id),className:ie("rounded-lg mb-1",k&&"bg-accent"),children:m.jsx(k0,{model:J,onHover:u})},J.id)}):m.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No models found"}),e[21]=b,e[22]=L,e[23]=n?.id,e[24]=X):X=e[24];let q;e[25]!==X?(q=m.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 pt-2",children:X}),e[25]=X,e[26]=q):q=e[26];let U;e[27]!==$||e[28]!==q?(U=m.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[400px] md:min-w-[400px]",children:[$,q]}),e[27]=$,e[28]=q,e[29]=U):U=e[29];let W;e[30]!==a||e[31]!==_||e[32]!==n?(W=a||(n?_.find(J=>J.id===n.id):null)||null,e[30]=a,e[31]=_,e[32]=n,e[33]=W):W=e[33];let V;e[34]!==W?(V=m.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:m.jsx(y0,{model:W})}),e[34]=W,e[35]=V):V=e[35];let K;return e[36]!==U||e[37]!==V?(K=m.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[U,V]}),e[36]=U,e[37]=V,e[38]=K):K=e[38],K}function R0(t){return m.jsx(Gd,{value:t.id,children:m.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?m.jsx("img",{src:t.icon,alt:t.title,className:"w-4 h-4 rounded"}):m.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.title.slice(0,1).toUpperCase()}),m.jsx("span",{children:t.title})]})},t.id)}function O0(t){return t.stopPropagation()}function L0(t){const e=Q.c(23),{selectedModel:n,onModelChange:r,modelsConnections:s,variant:i,className:a,placeholder:u}=t,l=i===void 0?"borderless":i,o=u===void 0?"Select model":u,[d,f]=j.useState(!1),p=Ei(),h=s??p,g=n?.connectionId??null,_=xi(g);let T;e[0]!==_||e[1]!==n?(T=n?_.find(B=>B.id===n.id):void 0,e[0]=_,e[1]=n,e[2]=T):T=e[2];const E=T;if(h.length===0)return null;const A=l==="borderless"?"ghost":"outline",b=l==="borderless"&&"md:border-none";let w;e[3]!==a||e[4]!==b?(w=ie("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",b,a),e[3]=a,e[4]=b,e[5]=w):w=e[5];let R;e[6]!==E||e[7]!==o?(R=m.jsx(I0,{model:E,placeholder:o}),e[6]=E,e[7]=o,e[8]=R):R=e[8];let I;e[9]!==A||e[10]!==w||e[11]!==R?(I=m.jsx(ur,{asChild:!0,children:m.jsx(Me,{variant:A,size:"sm",className:w,children:R})}),e[9]=A,e[10]=w,e[11]=R,e[12]=I):I=e[12];let L;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=m.jsx(N0,{}),e[13]=L):L=e[13];let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=()=>f(!1),e[14]=M):M=e[14];let P;e[15]!==h||e[16]!==r||e[17]!==n?(P=m.jsx(or,{className:"w-full md:w-auto p-0",align:"start",side:"bottom",sideOffset:8,children:m.jsx(j.Suspense,{fallback:L,children:m.jsx(w0,{selectedModel:n,onModelChange:r,onClose:M,modelsConnections:h})})}),e[15]=h,e[16]=r,e[17]=n,e[18]=P):P=e[18];let S;return e[19]!==d||e[20]!==P||e[21]!==I?(S=m.jsxs(lr,{open:d,onOpenChange:f,children:[I,P]}),e[19]=d,e[20]=P,e[21]=I,e[22]=S):S=e[22],S}const v0=t=>new Bo({api:`/api/${t}/models/stream`,credentials:"include",prepareSendMessagesRequest:({messages:e,requestMetadata:n={}})=>{const{system:r,...s}=n,i=r?{id:crypto.randomUUID(),role:"system",parts:[{type:"text",text:r}]}:null;return{body:{messages:i?[i,...e]:e,stream:!0,...s}}}}),Ia=(t,e)=>t?.find(n=>n.id===e)??t?.[0]??null,D0=(t,e)=>{const n=Q.c(14);let r;n[0]!==t?(r=fi.chatSelectedModel(t),n[0]=t,n[1]=r):r=n[1];const[s,i]=vr(r,null),a=s?.connectionId;let u;n[2]!==e||n[3]!==a?(u=Ia(e,a),n[2]=e,n[3]=a,n[4]=u):u=n[4];const l=u,o=xi(l?.id??null),d=s?.id;let f;n[5]!==o||n[6]!==d?(f=Ia(o,d),n[5]=o,n[6]=d,n[7]=f):f=n[7];const p=f;let h;n[8]!==l||n[9]!==p?(h=p&&l?.id?{id:p.id,provider:p.provider,limits:p.limits,connectionId:l.id}:null,n[8]=l,n[9]=p,n[10]=h):h=n[10];const g=h;let _;return n[11]!==g||n[12]!==i?(_=[g,i],n[11]=g,n[12]=i,n[13]=_):_=n[13],_},Wo={inputValue:"",branchContext:null,finishReason:null};function P0(t,e){switch(e.type){case"SET_INPUT":return{...t,inputValue:e.payload};case"START_BRANCH":return{...t,branchContext:e.payload};case"CLEAR_BRANCH":return{...t,branchContext:null};case"SET_FINISH_REASON":return{...t,finishReason:e.payload};case"CLEAR_FINISH_REASON":return{...t,finishReason:null};case"RESET":return Wo;default:return t}}const Qo=j.createContext(null),Xo=()=>crypto.randomUUID();function M0(t){const e=Q.c(75),{children:n}=t,{locator:r,org:s}=zt(),{data:i}=Vu.useSession(),a=i?.user??null,[u,l]=j.useReducer(P0,Wo),o=$o(),d=Yo(),{threads:f}=zo(),[p,h]=vr(fi.threadManagerState(r)+":active-id",j0),g=f0(p),_=qo(),[T,E]=vr(`${r}:selected-gateway-id`,null),A=Ei(),[b,w]=D0(r,A),R=h0(T),I=p0();let L;e[0]!==p||e[1]!==f?(L=f.find(le=>le.id===p)??null,e[0]=p,e[1]=f,e[2]=L):L=e[2];const M=L;let P;e[3]!==_||e[4]!==T?(P=T?_.find(le=>le.id===T)??null:null,e[3]=_,e[4]=T,e[5]=P):P=e[5];const S=P;let B;e[6]!==s.slug?(B=v0(s.slug),e[6]=s.slug,e[7]=B):B=e[7];const $=B;let X;e[8]!==p||e[9]!==r||e[10]!==d||e[11]!==S?.id||e[12]!==o?(X=async le=>{const{finishReason:D,messages:Y,isAbort:Z,isDisconnect:ue,isError:me}=le;if(l({type:"SET_FINISH_REASON",payload:D??null}),D!=="stop"||Z||ue||me)return;const ze=Y.slice(-2).filter(Boolean);if(ze.length!==2){console.warn("[chat] Expected 2 messages, got",ze.length);return}d.insertMany.mutate(ze);const xt=ze.find(U0)?.parts?.find(F0)?.text.slice(0,100)||"",at=await c0(r,p);if(!at){const vt=new Date().toISOString(),Vt={id:p,title:xt,created_at:vt,updated_at:vt,hidden:!1,gatewayId:S?.id};o.insert.mutate(Vt);return}o.update.mutate({id:p,updates:{title:at.title||xt,gatewayId:at.gatewayId||S?.id,updated_at:new Date().toISOString()}})},e[8]=p,e[9]=r,e[10]=d,e[11]=S?.id,e[12]=o,e[13]=X):X=e[13];const q=X,U=B0;let W;e[14]!==p||e[15]!==q||e[16]!==I||e[17]!==g||e[18]!==$?(W={id:p,messages:g,transport:$,onFinish:q,onToolCall:I,onError:U},e[14]=p,e[15]=q,e[16]=I,e[17]=g,e[18]=$,e[19]=W):W=e[19];const V=a0(W),K=V.status==="submitted"||V.status==="streaming",J=V.messages.length===0;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=le=>l({type:"SET_INPUT",payload:le}),e[20]=k):k=e[20];const re=k;let he;e[21]===Symbol.for("react.memo_cache_sentinel")?(he=le=>l({type:"START_BRANCH",payload:le}),e[21]=he):he=e[21];const N=he;let Ee;e[22]===Symbol.for("react.memo_cache_sentinel")?(Ee=()=>l({type:"CLEAR_BRANCH"}),e[22]=Ee):Ee=e[22];const ve=Ee;let fe;e[23]===Symbol.for("react.memo_cache_sentinel")?(fe=()=>l({type:"RESET"}),e[23]=fe):fe=e[23];const Ge=fe;let Ie;e[24]!==h||e[25]!==o?(Ie=le=>{const D=le?.id||crypto.randomUUID(),Y=new Date().toISOString(),Z={id:D,title:le?.title||"",created_at:le?.created_at||Y,updated_at:le?.updated_at||Y,hidden:le?.hidden??!1,gatewayId:le?.gatewayId};return o.insert.mutate(Z),h(D),Z},e[24]=h,e[25]=o,e[26]=Ie):Ie=e[26];const Ne=Ie;let ye;e[27]!==p||e[28]!==h||e[29]!==o?(ye=le=>{o.update.mutate({id:le,updates:{hidden:!0,updated_at:new Date().toISOString()}}),p===le&&h(Xo())},e[27]=p,e[28]=h,e[29]=o,e[30]=ye):ye=e[30];const Fe=ye;let Re;e[31]!==E?(Re=le=>{E(le)},e[31]=E,e[32]=Re):Re=e[32];const De=Re;let Oe;e[33]!==w?(Oe=le=>{w({id:le.id,connectionId:le.connectionId})},e[33]=w,e[34]=Oe):Oe=e[34];const Ue=Oe;let Se;e[35]!==p||e[36]!==V||e[37]!==R||e[38]!==K||e[39]!==S?.id||e[40]!==b||e[41]!==a?.image||e[42]!==a?.name?(Se=async le=>{if(!b){Kn.error("No model configured");return}if(!le?.trim()||K)return;re(""),ve(),l({type:"CLEAR_FINISH_REASON"});const D={created_at:new Date().toISOString(),thread_id:p,system:R,model:{id:b.id,connectionId:b.connectionId,provider:b.provider??void 0,limits:b.limits??void 0},gateway:{id:S?.id??null},user:{avatar:a?.image??void 0,name:a?.name??"you"}};await V.sendMessage({id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:le}],metadata:D},{metadata:D})},e[35]=p,e[36]=V,e[37]=R,e[38]=K,e[39]=S?.id,e[40]=b,e[41]=a?.image,e[42]=a?.name,e[43]=Se):Se=e[43];const He=Se;let We;e[44]!==V?(We=()=>V.stop(),e[44]=V,e[45]=We):We=e[45];const Tt=We;let Je;e[46]===Symbol.for("react.memo_cache_sentinel")?(Je=()=>l({type:"CLEAR_FINISH_REASON"}),e[46]=Je):Je=e[46];const qt=Je;let st;e[47]!==M||e[48]!==p||e[49]!==V.clearError||e[50]!==V.error||e[51]!==V.messages||e[52]!==V.setMessages||e[53]!==V.status||e[54]!==u.branchContext||e[55]!==u.finishReason||e[56]!==u.inputValue||e[57]!==Ne||e[58]!==_||e[59]!==Fe||e[60]!==J||e[61]!==K||e[62]!==A||e[63]!==S||e[64]!==b||e[65]!==He||e[66]!==h||e[67]!==De||e[68]!==Ue||e[69]!==Tt||e[70]!==f?(st={inputValue:u.inputValue,branchContext:u.branchContext,setInputValue:re,startBranch:N,clearBranch:ve,resetInteraction:Ge,activeThreadId:p,activeThread:M,threads:f,createThread:Ne,setActiveThreadId:h,hideThread:Fe,gateways:_,selectedGateway:S,setGatewayId:De,modelsConnections:A,selectedModel:b,setSelectedModel:Ue,messages:V.messages,chatStatus:V.status,isStreaming:K,isChatEmpty:J,sendMessage:He,stopStreaming:Tt,setMessages:V.setMessages,chatError:V.error,clearChatError:V.clearError,finishReason:u.finishReason,clearFinishReason:qt},e[47]=M,e[48]=p,e[49]=V.clearError,e[50]=V.error,e[51]=V.messages,e[52]=V.setMessages,e[53]=V.status,e[54]=u.branchContext,e[55]=u.finishReason,e[56]=u.inputValue,e[57]=Ne,e[58]=_,e[59]=Fe,e[60]=J,e[61]=K,e[62]=A,e[63]=S,e[64]=b,e[65]=He,e[66]=h,e[67]=De,e[68]=Ue,e[69]=Tt,e[70]=f,e[71]=st):st=e[71];const dt=st;let it;return e[72]!==n||e[73]!==dt?(it=m.jsx(Qo.Provider,{value:dt,children:n}),e[72]=n,e[73]=dt,e[74]=it):it=e[74],it}function B0(t){console.error("[chat] Chat error:",t)}function F0(t){return t.type==="text"}function U0(t){return t.parts?.find(H0)}function H0(t){return t.type==="text"}function j0(t){return t||Xo()}function An(){const t=j.useContext(Qo);if(!t)throw new Error("useChat must be used within a ChatProvider");return t}const z0={openrouter:t=>{const e=t?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function $0(t){if(!t?.providerMetadata)return null;for(const e of Object.values(z0)){const n=e(t.providerMetadata);if(n!==null)return n}return null}function Y0(t){return t.reduce((e,n)=>{const r=n.metadata?.usage;return r?{inputTokens:e.inputTokens+(r.inputTokens??0),outputTokens:e.outputTokens+(r.outputTokens??0),totalTokens:e.totalTokens+(r.totalTokens??0),cost:e.cost+($0(r)??0)}:e},{inputTokens:0,outputTokens:0,totalTokens:0,cost:0})}function Zo(t){const e=Q.c(38),{messages:n}=t;let r,s,i,a,u,l,o,d,f,p,h,g;if(e[0]!==n){g=Symbol.for("react.early_return_sentinel");e:{const w=Y0(n);if(!w){g=null;break e}const{totalTokens:R,inputTokens:I,outputTokens:L,cost:M}=w;if(i=M,!R&&!I&&!L){g=null;break e}s=yn;let P;e[13]===Symbol.for("react.memo_cache_sentinel")?(P=m.jsx(to,{size:12}),e[13]=P):P=e[13];const S=m.jsxs(Me,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground pl-1! h-6 gap-1 whitespace-nowrap shrink-0",children:[P,m.jsx("span",{className:"text-[10px] font-mono tabular-nums",children:R.toLocaleString()})]});e[14]!==S?(h=m.jsx(_n,{asChild:!0,children:S}),e[14]=S,e[15]=h):h=e[15],r=xn,f="top",p="font-mono text-[11px]",u="grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",e[16]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx("span",{className:"text-muted",children:"in"}),e[16]=l):l=e[16],o=m.jsx("span",{children:I.toLocaleString()}),e[17]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx("span",{className:"text-muted",children:"out"}),e[17]=d):d=e[17],a=L.toLocaleString()}e[0]=n,e[1]=r,e[2]=s,e[3]=i,e[4]=a,e[5]=u,e[6]=l,e[7]=o,e[8]=d,e[9]=f,e[10]=p,e[11]=h,e[12]=g}else r=e[1],s=e[2],i=e[3],a=e[4],u=e[5],l=e[6],o=e[7],d=e[8],f=e[9],p=e[10],h=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let _;e[18]!==a?(_=m.jsx("span",{children:a}),e[18]=a,e[19]=_):_=e[19];let T;e[20]!==i?(T=i>0&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted",children:"cost"}),m.jsxs("span",{children:["$",i.toFixed(4)]})]}),e[20]=i,e[21]=T):T=e[21];let E;e[22]!==_||e[23]!==T||e[24]!==u||e[25]!==l||e[26]!==o||e[27]!==d?(E=m.jsxs("div",{className:u,children:[l,o,d,_,T]}),e[22]=_,e[23]=T,e[24]=u,e[25]=l,e[26]=o,e[27]=d,e[28]=E):E=e[28];let A;e[29]!==r||e[30]!==E||e[31]!==f||e[32]!==p?(A=m.jsx(r,{side:f,className:p,children:E}),e[29]=r,e[30]=E,e[31]=f,e[32]=p,e[33]=A):A=e[33];let b;return e[34]!==s||e[35]!==A||e[36]!==h?(b=m.jsxs(s,{children:[h,A]}),e[34]=s,e[35]=A,e[36]=h,e[37]=b):b=e[37],b}function q0({gatewayId:t,gateways:e,onGatewayChange:n,disabled:r=!1}){const[s,i]=j.useState(!1),a=j.useRef(null),u=Gu(),{org:l}=zt(),o=e.find(g=>g.id===t);if(!o)return null;j.useEffect(()=>{s&&setTimeout(()=>{a.current?.focus()},0)},[s]);const d=co(t),f=g=>{g.stopPropagation(),n(null)},p=g=>{g.stopPropagation(),u({to:"/$org/gateways/$gatewayId",params:{org:l.slug,gatewayId:t}})},h=g=>{n(g),i(!1)};return m.jsxs("div",{className:ie("flex items-center justify-between px-3 py-1.5 rounded-t-xl",d?.bg),children:[m.jsxs(lr,{open:s,onOpenChange:i,children:[m.jsx(ur,{asChild:!0,children:m.jsxs("button",{type:"button",disabled:r,className:ie("flex items-center gap-1.5 hover:opacity-80 transition-opacity",r?"cursor-not-allowed opacity-50":"cursor-pointer"),children:[m.jsx(ci,{icon:o.icon,name:o.title,size:"2xs",fallbackIcon:o.fallbackIcon??m.jsx(di,{size:10})}),m.jsx("span",{className:"text-xs text-white font-normal",children:o.title}),m.jsx(vd,{size:14,className:"text-white/50"})]})}),m.jsx(or,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:m.jsx(Vo,{gateways:e,selectedGatewayId:t,onGatewayChange:h,searchInputRef:a})})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("button",{type:"button",onClick:p,disabled:r,className:ie("flex items-center justify-center p-1 rounded-full transition-colors",r?"cursor-not-allowed opacity-50":"cursor-pointer hover:bg-white/10"),"aria-label":"Edit gateway",children:m.jsx(Pd,{size:14,className:"text-white"})}),m.jsx("button",{type:"button",onClick:f,disabled:r,className:ie("flex items-center justify-center p-1 rounded-full transition-colors",r?"cursor-not-allowed opacity-50":"cursor-pointer hover:bg-white/10"),"aria-label":"Reset to default",children:m.jsx(lo,{size:14,className:"text-white"})})]})]})}function V0(){const t=Q.c(120),{inputValue:e,setInputValue:n,branchContext:r,clearBranch:s,setActiveThreadId:i,gateways:a,selectedGateway:u,setGatewayId:l,modelsConnections:o,selectedModel:d,setSelectedModel:f,messages:p,isStreaming:h,sendMessage:g,stopStreaming:_,chatError:T,clearChatError:E,finishReason:A,clearFinishReason:b}=An();let w;t[0]!==e||t[1]!==h||t[2]!==d?(w=!h&&d&&e.trim().length>0,t[0]=e,t[1]=h,t[2]=d,t[3]=w):w=t[3];const R=w;let I;t[4]!==R||t[5]!==e||t[6]!==h||t[7]!==g||t[8]!==_?(I=Z=>{Z.preventDefault(),h?_():R&&g(e.trim())},t[4]=R,t[5]=e,t[6]=h,t[7]=g,t[8]=_,t[9]=I):I=t[9];const L=I;let M;t[10]!==R||t[11]!==e||t[12]!==g?(M=Z=>{Z.key==="Enter"&&!Z.shiftKey&&(Z.preventDefault(),R&&g(e.trim()))},t[10]=R,t[11]=e,t[12]=g,t[13]=M):M=t[13];const P=M;let S;t[14]!==r||t[15]!==s||t[16]!==i||t[17]!==n?(S=()=>{r&&(i(r.originalThreadId),s(),n(""))},t[14]=r,t[15]=s,t[16]=i,t[17]=n,t[18]=S):S=t[18];const B=S;let $;t[19]!==T||t[20]!==g?($=()=>{T&&g(`I encountered this error: ${T.message}. Can you help me fix it?`)},t[19]=T,t[20]=g,t[21]=$):$=t[21];const X=$;let q;t[22]!==g?(q=()=>{g("Please continue.")},t[22]=g,t[23]=q):q=t[23];const U=q;let W,V,K,J,k,re;if(t[24]!==r||t[25]!==T||t[26]!==s||t[27]!==E||t[28]!==b||t[29]!==A||t[30]!==U||t[31]!==X||t[32]!==B||t[33]!==u||t[34]!==d||t[35]!==n){const Z=u?co(u.id):null;W=d?"Ask anything or @ for context":"Select a model to start chatting",J="flex flex-col gap-2 w-full min-h-42 justify-end",t[42]!==T||t[43]!==E||t[44]!==X?(k=T&&m.jsxs(vs,{variant:"danger",title:"Error occurred",description:T.message,icon:m.jsx(Wu,{size:16}),onDismiss:E,children:[m.jsx(Me,{size:"sm",variant:"outline",onClick:X,className:"h-7 text-xs",children:"Fix in chat"}),m.jsx(Me,{size:"sm",variant:"outline",disabled:!0,className:"h-7 text-xs",children:"Report"})]}),t[42]=T,t[43]=E,t[44]=X,t[45]=k):k=t[45],t[46]!==b||t[47]!==A||t[48]!==U?(re=A&&A!=="stop"&&m.jsx(vs,{variant:"warning",title:"Response incomplete",description:A==="length"?"Response reached the model's output limit. Different models have different limits. Try switching models or asking it to continue.":A==="content-filter"?"Response was filtered due to content policy.":A==="tool-calls"?"Response paused after tool execution to prevent infinite loops and save costs. Click continue to keep working.":`Response stopped unexpectedly: ${A}`,icon:m.jsx(Rd,{size:16}),onDismiss:b,children:m.jsx(Me,{size:"sm",variant:"outline",onClick:U,className:"h-7 text-xs",children:"Continue"})}),t[46]=b,t[47]=A,t[48]=U,t[49]=re):re=t[49],t[50]!==r||t[51]!==s||t[52]!==B||t[53]!==n?(V=r&&m.jsx(vs,{variant:"default",title:"Editing message (click to view original)",description:r.originalMessageText,icon:m.jsx(no,{size:14}),onDismiss:()=>{s(),n("")},children:m.jsx(Me,{size:"sm",variant:"outline",onClick:B,className:"h-7 text-xs",children:"View original"})}),t[50]=r,t[51]=s,t[52]=B,t[53]=n,t[54]=V):V=t[54],K=ie("relative rounded-xl w-full flex flex-col",u&&"shadow-sm",Z?.bg),t[24]=r,t[25]=T,t[26]=s,t[27]=E,t[28]=b,t[29]=A,t[30]=U,t[31]=X,t[32]=B,t[33]=u,t[34]=d,t[35]=n,t[36]=W,t[37]=V,t[38]=K,t[39]=J,t[40]=k,t[41]=re}else W=t[36],V=t[37],K=t[38],J=t[39],k=t[40],re=t[41];let he;t[55]!==a||t[56]!==h||t[57]!==u||t[58]!==l?(he=u&&m.jsx(q0,{gatewayId:u.id,gateways:a,onGatewayChange:l,disabled:h}),t[55]=a,t[56]=h,t[57]=u,t[58]=l,t[59]=he):he=t[59];const N=!u&&"shadow-sm";let Ee;t[60]!==N?(Ee=ie("w-full relative rounded-xl min-h-[130px] flex flex-col border border-border bg-background",N),t[60]=N,t[61]=Ee):Ee=t[61];let ve;t[62]===Symbol.for("react.memo_cache_sentinel")?(ve={maxHeight:"164px"},t[62]=ve):ve=t[62];let fe;t[63]!==n?(fe=Z=>n(Z.target.value),t[63]=n,t[64]=fe):fe=t[64];const Ge=!d||h;let Ie;t[65]===Symbol.for("react.memo_cache_sentinel")?(Ie=ie("placeholder:text-muted-foreground resize-none focus-visible:ring-0 border-0 p-2 text-[15px]! min-h-[20px] w-full","rounded-none shadow-none","min-h-[20px] h-auto overflow-hidden"),t[65]=Ie):Ie=t[65];let Ne;t[66]!==P||t[67]!==e||t[68]!==W||t[69]!==fe||t[70]!==Ge?(Ne=m.jsx("div",{className:"relative flex flex-col gap-2 p-2.5 flex-1",children:m.jsx("div",{className:"overflow-y-auto relative flex-1",style:ve,children:m.jsx(wd,{rows:1,value:e,onChange:fe,onKeyDown:P,placeholder:W,disabled:Ge,className:Ie})})}),t[66]=P,t[67]=e,t[68]=W,t[69]=fe,t[70]=Ge,t[71]=Ne):Ne=t[71];let ye;t[72]!==a||t[73]!==h||t[74]!==u||t[75]!==l?(ye=!u&&m.jsx(g0,{selectedGatewayId:null,onGatewayChange:l,gateways:a,placeholder:"Agent",disabled:h}),t[72]=a,t[73]=h,t[74]=u,t[75]=l,t[76]=ye):ye=t[76];const Fe=d??void 0;let Re;t[77]!==o||t[78]!==f||t[79]!==Fe?(Re=m.jsx(L0,{selectedModel:Fe,onModelChange:f,modelsConnections:o,placeholder:"Model",variant:"borderless"}),t[77]=o,t[78]=f,t[79]=Fe,t[80]=Re):Re=t[80];let De;t[81]!==p?(De=m.jsx(Zo,{messages:p}),t[81]=p,t[82]=De):De=t[82];let Oe;t[83]!==ye||t[84]!==Re||t[85]!==De?(Oe=m.jsxs("div",{className:"flex items-center gap-2 min-w-0 overflow-hidden",children:[ye,Re,De]}),t[83]=ye,t[84]=Re,t[85]=De,t[86]=Oe):Oe=t[86];const Ue=h?"button":"submit";let Se;t[87]!==h||t[88]!==_?(Se=Z=>{h&&(Z.preventDefault(),Z.stopPropagation(),_())},t[87]=h,t[88]=_,t[89]=Se):Se=t[89];const He=R||h?"default":"ghost",We=!R&&!h,Tt=!R&&!h&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed";let Je;t[90]!==Tt?(Je=ie("size-8 rounded-full transition-all",Tt),t[90]=Tt,t[91]=Je):Je=t[91];const qt=h?"Stop generating":"Send message (Enter)";let st;t[92]!==h?(st=h?m.jsx(uo,{size:20}):m.jsx(Ld,{size:20}),t[92]=h,t[93]=st):st=t[93];let dt;t[94]!==Ue||t[95]!==Se||t[96]!==He||t[97]!==We||t[98]!==Je||t[99]!==qt||t[100]!==st?(dt=m.jsx("div",{className:"flex items-center gap-1",children:m.jsx(Me,{type:Ue,onClick:Se,variant:He,size:"icon",disabled:We,className:Je,title:qt,children:st})}),t[94]=Ue,t[95]=Se,t[96]=He,t[97]=We,t[98]=Je,t[99]=qt,t[100]=st,t[101]=dt):dt=t[101];let it;t[102]!==Oe||t[103]!==dt?(it=m.jsxs("div",{className:"flex items-center justify-between p-2.5",children:[Oe,dt]}),t[102]=Oe,t[103]=dt,t[104]=it):it=t[104];let le;t[105]!==L||t[106]!==Ee||t[107]!==Ne||t[108]!==it?(le=m.jsx("div",{className:"p-0.5",children:m.jsxs("form",{onSubmit:L,className:Ee,children:[Ne,it]})}),t[105]=L,t[106]=Ee,t[107]=Ne,t[108]=it,t[109]=le):le=t[109];let D;t[110]!==he||t[111]!==le||t[112]!==K?(D=m.jsxs("div",{className:K,children:[he,le]}),t[110]=he,t[111]=le,t[112]=K,t[113]=D):D=t[113];let Y;return t[114]!==V||t[115]!==D||t[116]!==J||t[117]!==k||t[118]!==re?(Y=m.jsxs("div",{className:J,children:[k,re,V,D]}),t[114]=V,t[115]=D,t[116]=J,t[117]=k,t[118]=re,t[119]=Y):Y=t[119],Y}const G0={name:"mesh-chat",version:"1.0.0"};function W0(t){if(typeof window>"u")throw new Error("Gateway prompts require a browser environment.");const e=new URL(`/mcp/gateway/${t}`,window.location.origin);return new gd(e,{requestInit:{headers:{Accept:"application/json, text/event-stream","Content-Type":"application/json"}}})}async function Ko(t,e){const n=new md(G0),r=W0(t);try{return await n.connect(r),await e(n)}catch(s){const i=s instanceof Error?s.message:String(s);throw console.error(`[gateway-prompts] Error for gateway ${t}:`,s),new Error(`Failed to communicate with gateway: ${i}`)}finally{await n.close().catch(console.error)}}async function Q0(t){try{return(await Ko(t,n=>n.listPrompts())).prompts??[]}catch(e){return console.error("[gateway-prompts] Failed to list prompts:",e),[]}}async function X0(t,e,n){const r=n??{};return await Ko(t,s=>s.getPrompt({name:e,arguments:r}))}function Z0(t){const e=Q.c(7);let n;e[0]!==t?(n=je.gatewayPrompts(t),e[0]=t,e[1]=n):n=e[1];let r;e[2]!==t?(r=()=>Q0(t),e[2]=t,e[3]=r):r=e[3];let s;return e[4]!==n||e[5]!==r?(s={queryKey:n,queryFn:r,staleTime:6e4,retry:!1},e[4]=n,e[5]=r,e[6]=s):s=e[6],ui(s)}const Na=3;function Jo(t){const e=Q.c(23),{prompt:n,onSelect:r,isSelected:s,isDisabled:i,isLoading:a}=t,u=n.description??n.name;let l;e[0]!==r||e[1]!==n?(l=()=>r(n),e[0]=r,e[1]=n,e[2]=l):l=e[2];const o=i||a,d=s&&"bg-accent/50 text-foreground",f=a&&"bg-accent/50 text-foreground",p=(i||a)&&"cursor-not-allowed hover:bg-accent/50";let h;e[3]!==d||e[4]!==f||e[5]!==p?(h=ie("px-3 py-1.5 text-xs text-muted-foreground hover:text-foreground border border-border rounded-full hover:bg-accent/50 transition-colors cursor-pointer flex items-center gap-1.5",d,f,p),e[3]=d,e[4]=f,e[5]=p,e[6]=h):h=e[6];const g=n.title??n.name;let _;if(e[7]!==g){let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=/_/g,e[9]=w):w=e[9],_=g.replace(w," "),e[7]=g,e[8]=_}else _=e[8];let T;e[10]!==a?(T=a&&m.jsx(Zu,{size:"xs"}),e[10]=a,e[11]=T):T=e[11];let E;e[12]!==l||e[13]!==o||e[14]!==h||e[15]!==_||e[16]!==T?(E=m.jsx(_n,{asChild:!0,children:m.jsxs("button",{type:"button",onClick:l,disabled:o,className:h,children:[_,T]})}),e[12]=l,e[13]=o,e[14]=h,e[15]=_,e[16]=T,e[17]=E):E=e[17];let A;e[18]!==u?(A=m.jsx(xn,{side:"bottom",className:"max-w-xs",children:m.jsx("p",{className:"text-xs",children:u})}),e[18]=u,e[19]=A):A=e[19];let b;return e[20]!==E||e[21]!==A?(b=m.jsxs(yn,{children:[E,A]}),e[20]=E,e[21]=A,e[22]=b):b=e[22],b}function K0(t){const e=Q.c(23),{prompts:n,onSelect:r,loadingPrompt:s,className:i}=t;if(n.length===0)return null;let a,u,l,o,d;if(e[0]!==i||e[1]!==s||e[2]!==r||e[3]!==n){const h=n.slice(0,Na),g=n.slice(Na),_=g.length>0,T=!!s;a=pi,d=300,e[9]!==i?(u=ie("flex flex-wrap items-center justify-center gap-2",i),e[9]=i,e[10]=u):u=e[10];let E;e[11]!==T||e[12]!==s?.name||e[13]!==r?(E=A=>m.jsx(Jo,{prompt:A,onSelect:r,isLoading:s?.name===A.name,isDisabled:T&&s?.name!==A.name},A.name),e[11]=T,e[12]=s?.name,e[13]=r,e[14]=E):E=e[14],l=h.map(E),o=_&&m.jsxs(lr,{children:[m.jsx(ur,{asChild:!0,children:m.jsxs("button",{type:"button",disabled:T,className:ie("size-7 flex items-center justify-center text-xs text-muted-foreground hover:text-foreground border border-border rounded-full hover:bg-accent/50 transition-colors cursor-pointer",T&&"opacity-60 cursor-not-allowed"),children:["+",g.length]})}),m.jsx(or,{side:"bottom",align:"center",className:"w-auto p-2",children:m.jsx("div",{className:"flex flex-col gap-1",children:g.map(A=>{const b=A.description??A.name,w=s?.name===A.name;return m.jsxs(yn,{children:[m.jsx(_n,{asChild:!0,children:m.jsxs("button",{type:"button",onClick:()=>r(A),disabled:T&&!w,className:ie("px-3 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent/50 rounded-md transition-colors cursor-pointer text-left flex items-center gap-1.5",w&&"bg-accent/50 text-foreground",T&&!w&&"opacity-60 cursor-not-allowed"),children:[(A.title??A.name).replace(/_/g," "),w&&m.jsx(Zu,{size:"xs"})]})}),m.jsx(xn,{side:"right",className:"max-w-xs",children:m.jsx("p",{className:"text-xs",children:b})})]},A.name)})})})]}),e[0]=i,e[1]=s,e[2]=r,e[3]=n,e[4]=a,e[5]=u,e[6]=l,e[7]=o,e[8]=d}else a=e[4],u=e[5],l=e[6],o=e[7],d=e[8];let f;e[15]!==u||e[16]!==l||e[17]!==o?(f=m.jsxs("div",{className:u,children:[l,o]}),e[15]=u,e[16]=l,e[17]=o,e[18]=f):f=e[18];let p;return e[19]!==a||e[20]!==d||e[21]!==f?(p=m.jsx(a,{delayDuration:d,children:f}),e[19]=a,e[20]=d,e[21]=f,e[22]=p):p=e[22],p}function J0(t){const e={};for(const n of t.arguments??[])e[n.name]=n.required?G().min(1,"Required"):G();return Te(e)}function ep(t){const e={};for(const n of t.arguments??[])e[n.name]="";return e}function tp(t){for(const e of t.messages??[]){if(e.role!=="user"||e.content?.type!=="text")continue;const n=e.content.text?.trim();if(n)return n}return null}function np(t){const e=Q.c(40),{prompt:n,onCancel:r,onSubmit:s}=t;let i;if(e[0]!==n){const M=J0(n);i=bd(M),e[0]=n,e[1]=i}else i=e[1];const u=i;let l;e[2]!==n?(l=ep(n),e[2]=n,e[3]=l):l=e[3];let o;e[4]!==u||e[5]!==l?(o={resolver:u,defaultValues:l,mode:"onChange"},e[4]=u,e[5]=l,e[6]=o):o=e[6];const d=Ed(o);let f;e[7]!==n.arguments?(f=n.arguments??[],e[7]=n.arguments,e[8]=f):f=e[8];const p=f;let h;e[9]!==r||e[10]!==n?(h=m.jsx(Jo,{prompt:n,onSelect:r,isSelected:!0}),e[9]=r,e[10]=n,e[11]=h):h=e[11];let g;e[12]!==n.description?(g=n.description?m.jsx("p",{className:"text-xs text-muted-foreground max-w-xl text-center",children:n.description}):null,e[12]=n.description,e[13]=g):g=e[13];let _;e[14]!==d||e[15]!==s?(_=d.handleSubmit(s),e[14]=d,e[15]=s,e[16]=_):_=e[16];let T;if(e[17]!==p||e[18]!==d.control){let M;e[20]!==d.control?(M=P=>m.jsx(Kd,{control:d.control,name:P.name,render:S=>{const{field:B}=S;return m.jsxs(Jd,{children:[m.jsxs(ef,{className:"text-xs",children:[P.name,P.required?" *":""]}),m.jsx(tf,{children:m.jsx(hi,{...B,value:B.value??"",required:P.required,placeholder:P.description??"",className:"h-9"})}),P.description?m.jsx(nf,{className:"text-xs",children:P.description}):null,m.jsx(rf,{})]})}},P.name),e[20]=d.control,e[21]=M):M=e[21],T=p.map(M),e[17]=p,e[18]=d.control,e[19]=T}else T=e[19];let E;e[22]!==r?(E=m.jsx(Me,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-3 text-xs",onClick:r,children:"Cancel"}),e[22]=r,e[23]=E):E=e[23];const A=!d.formState.isValid;let b;e[24]!==A?(b=m.jsx(Me,{type:"submit",size:"sm",className:"h-8 px-3 text-xs",disabled:A,children:"Use prompt"}),e[24]=A,e[25]=b):b=e[25];let w;e[26]!==E||e[27]!==b?(w=m.jsxs("div",{className:"flex justify-end gap-2",children:[E,b]}),e[26]=E,e[27]=b,e[28]=w):w=e[28];let R;e[29]!==w||e[30]!==_||e[31]!==T?(R=m.jsxs("form",{className:"w-full max-w-xl flex flex-col gap-3",onSubmit:_,autoComplete:"off",children:[T,w]}),e[29]=w,e[30]=_,e[31]=T,e[32]=R):R=e[32];let I;e[33]!==d||e[34]!==R?(I=m.jsx(Zd,{...d,children:R}),e[33]=d,e[34]=R,e[35]=I):I=e[35];let L;return e[36]!==I||e[37]!==h||e[38]!==g?(L=m.jsxs("div",{className:"flex flex-col items-center gap-3 w-full",children:[h,g,I]}),e[36]=I,e[37]=h,e[38]=g,e[39]=L):L=e[39],L}function rp(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsxs(m.Fragment,{children:[m.jsx($e,{className:"h-6 w-20 rounded-full border border-border"}),m.jsx($e,{className:"h-6 w-24 rounded-full border border-border"})]}),t[0]=e):e=t[0],e}function sp(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"collectingArguments",prompt:e.prompt};case"CANCEL":return{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function ip({gatewayId:t}){const{setInputValue:e}=An(),{data:n}=Z0(t),[r,s]=j.useReducer(sp,{stage:"idle"});if(n.length===0)return null;const i=async(o,d)=>{try{const f=await X0(t,o.name,d),p=tp(f)??o.description??o.name;e(p),s({type:"RESET"})}catch(f){console.error("[ice-breakers] Failed to fetch prompt:",f),Kn.error("Failed to load prompt. Please try again."),s({type:"RESET"})}},a=async o=>{if(o.arguments&&o.arguments.length>0){s({type:"SELECT_PROMPT",prompt:o});return}s({type:"START_LOADING",prompt:o}),await i(o)},u=()=>{s({type:"CANCEL"})},l=async o=>{if(r.stage!=="collectingArguments")return;const{prompt:d}=r;s({type:"START_LOADING",prompt:d,arguments:o}),await i(d,o)};return m.jsx("div",{className:"relative w-full",children:r.stage==="collectingArguments"?m.jsx("div",{className:"animate-in fade-in-0 zoom-in-95 duration-300",children:m.jsx(np,{prompt:r.prompt,onCancel:u,onSubmit:l})},"expanded"):m.jsx("div",{className:"animate-in fade-in-0 zoom-in-95 duration-300",children:m.jsx(K0,{prompts:n,onSelect:a,loadingPrompt:r.stage==="loading"?r.prompt:null})},"list")})}function ap(t){const e=Q.c(8),{className:n}=t,{selectedGateway:r}=An();let s;e[0]!==n?(s=ie("flex flex-wrap items-center justify-center gap-2",n),e[0]=n,e[1]=s):s=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i={minHeight:"32px"},e[2]=i):i=e[2];let a;e[3]!==r?(a=r&&m.jsx(Od,{fallback:null,children:m.jsx(j.Suspense,{fallback:m.jsx(rp,{}),children:m.jsx(ip,{gatewayId:r.id})})},r.id),e[3]=r,e[4]=a):a=e[4];let u;return e[5]!==s||e[6]!==a?(u=m.jsx("div",{className:s,style:i,children:a}),e[5]=s,e[6]=a,e[7]=u):u=e[7],u}function up(){const t=Q.c(3),[e,n]=j.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async a=>{await navigator.clipboard.writeText(a),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const s=r;let i;return t[1]!==e?(i={handleCopy:s,copied:e},t[1]=e,t[2]=i):i=t[2],i}function _i(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var rn=_i();function el(t){rn=t}var zn={exec:()=>null};function pe(t,e=""){let n=typeof t=="string"?t:t.source;const r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(Ke.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,e)};return r}var Ke={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},op=/^(?:[ \t]*(?:\n|$))+/,lp=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,cp=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,fr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,dp=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,yi=/(?:[*+-]|\d{1,9}[.)])/,tl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,nl=pe(tl).replace(/bull/g,yi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),fp=pe(tl).replace(/bull/g,yi).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ai=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,hp=/^[^\n]+/,ki=/(?!\s*\])(?:\\.|[^\[\]\\])+/,pp=pe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ki).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),mp=pe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,yi).getRegex(),Qr="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ci=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,gp=pe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ci).replace("tag",Qr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),rl=pe(Ai).replace("hr",fr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qr).getRegex(),bp=pe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",rl).getRegex(),Ii={blockquote:bp,code:lp,def:pp,fences:cp,heading:dp,hr:fr,html:gp,lheading:nl,list:mp,newline:op,paragraph:rl,table:zn,text:hp},Sa=pe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",fr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qr).getRegex(),Ep={...Ii,lheading:fp,table:Sa,paragraph:pe(Ai).replace("hr",fr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Sa).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qr).getRegex()},Tp={...Ii,html:pe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ci).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:zn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:pe(Ai).replace("hr",fr).replace("heading",` *#{1,6} *[^
|
|
22
|
-
]`).replace("lheading",nl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},xp=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,_p=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,sl=/^( {2,}|\\)\n(?!\s*$)/,yp=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,
|
|
21
|
+
`)}function p0(){const t=Q.c(5),e=oi(),{org:n}=zt();let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={strict:!1},t[0]=r):r=t[0];const s=Yu(r);let i;return t[1]!==n||t[2]!==s||t[3]!==e?(i=a=>{const l=a.toolCall.toolName.match(/^COLLECTION_([A-Z_]+)_(CREATE|UPDATE|DELETE)$/);if(!l||!l[1])return;const o=l[1],d=s.connectionId;if(!d)return;e.invalidateQueries({queryKey:je.collection(n.slug,d,o)});const f=o.toLowerCase().replace(/_/g," ");Kn.success(`${f} updated`)},t[1]=n,t[2]=s,t[3]=e,t[4]=i):i=t[4],i}function qo(){const t=Q.c(2),e=Dd();let n;return t[0]!==e?(n=e??[],t[0]=e,t[1]=n):n=t[1],n}function m0(t){const e=Q.c(24),{gateway:n,isSelected:r}=t,s=r&&"bg-accent";let i;e[0]!==s?(i=ie("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-xl transition-colors",s),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n.fallbackIcon?(a=n.fallbackIcon??m.jsx(di,{}),e[2]=n.fallbackIcon,e[3]=a):a=e[3];let u;e[4]!==n.icon||e[5]!==n.title||e[6]!==a?(u=m.jsx(ci,{icon:n.icon,name:n.title,size:"sm",fallbackIcon:a,className:"size-10 rounded-xl border border-stone-200/60 shadow-sm shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=a,e[7]=u):u=e[7];let l;e[8]!==n.title?(l=m.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=l):l=e[9];let o;e[10]!==r?(o=r&&m.jsx($r,{size:16,className:"text-foreground shrink-0"}),e[10]=r,e[11]=o):o=e[11];let d;e[12]!==l||e[13]!==o?(d=m.jsxs("div",{className:"flex items-center justify-between",children:[l,o]}),e[12]=l,e[13]=o,e[14]=d):d=e[14];let f;e[15]!==n.description?(f=n.description&&m.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:n.description}),e[15]=n.description,e[16]=f):f=e[16];let p;e[17]!==d||e[18]!==f?(p=m.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[d,f]}),e[17]=d,e[18]=f,e[19]=p):p=e[19];let h;return e[20]!==i||e[21]!==u||e[22]!==p?(h=m.jsxs("div",{className:i,children:[u,p]}),e[20]=i,e[21]=u,e[22]=p,e[23]=h):h=e[23],h}function Vo(t){const e=Q.c(25),{gateways:n,selectedGatewayId:r,onGatewayChange:s,searchInputRef:i}=t,[a,u]=j.useState(""),l=j.useRef(null),o=i??l;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={navigateOnCreate:!0},e[0]=d):d=e[0];const{createGateway:f,isCreating:p}=$d(d);let h;e:{if(!a.trim()){h=n;break e}let P;if(e[1]!==n||e[2]!==a){const S=a.toLowerCase();P=n.filter(B=>B.title.toLowerCase().includes(S)||B.description?.toLowerCase().includes(S)),e[1]=n,e[2]=a,e[3]=P}else P=e[3];h=P}const g=h;let _;e[4]!==s?(_=P=>{s(P),u("")},e[4]=s,e[5]=_):_=e[5];const T=_;let E;e[6]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx(Yr,{size:16,className:"text-muted-foreground pointer-events-none shrink-0"}),e[6]=E):E=e[6];let A;e[7]===Symbol.for("react.memo_cache_sentinel")?(A=P=>u(P.target.value),e[7]=A):A=e[7];let b;e[8]!==o||e[9]!==a?(b=m.jsx(fi,{ref:o,type:"text",placeholder:"Search for an agent...",value:a,onChange:A,className:"flex-1 h-8 text-sm border-0 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none p-0"}),e[8]=o,e[9]=a,e[10]=b):b=e[10];const w=p?"Creating...":"Create Agent";let R;e[11]!==f||e[12]!==p||e[13]!==w?(R=m.jsx(Me,{onClick:f,variant:"outline",size:"sm",className:"h-8 px-3 rounded-lg text-sm font-medium shrink-0",disabled:p,children:w}),e[11]=f,e[12]=p,e[13]=w,e[14]=R):R=e[14];let I;e[15]!==b||e[16]!==R?(I=m.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:m.jsxs("div",{className:"relative flex items-center gap-2",children:[E,b,R]})}),e[15]=b,e[16]=R,e[17]=I):I=e[17];let L;e[18]!==g||e[19]!==T||e[20]!==r?(L=m.jsx("div",{className:"overflow-y-auto p-1.5",children:g.length>0?m.jsx("div",{className:"grid grid-cols-2 gap-0.5",children:g.map(P=>m.jsx("div",{role:"button",tabIndex:0,onClick:()=>T(P.id),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),T(P.id))},className:"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-xl",children:m.jsx(m0,{gateway:P,isSelected:P.id===r})},P.id))}):m.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No agents found"})}),e[18]=g,e[19]=T,e[20]=r,e[21]=L):L=e[21];let M;return e[22]!==L||e[23]!==I?(M=m.jsxs("div",{className:"flex flex-col max-h-[400px]",children:[I,L]}),e[22]=L,e[23]=I,e[24]=M):M=e[24],M}function g0(t){const e=Q.c(37),{selectedGatewayId:n,onGatewayChange:r,gateways:s,className:i,placeholder:a,showTooltip:u,disabled:l}=t,o=a===void 0?"Select Agent":a,d=u===void 0?!0:u,f=l===void 0?!1:l,[p,h]=j.useState(!1),g=j.useRef(null),_=qo(),T=s??_;let E,A;e[0]!==p?(E=()=>{p&&setTimeout(()=>{g.current?.focus()},0)},A=[p],e[0]=p,e[1]=E,e[2]=A):(E=e[1],A=e[2]),j.useEffect(E,A);let b;e[3]!==T||e[4]!==n?(b=n?T.find(re=>re.id===n):null,e[3]=T,e[4]=n,e[5]=b):b=e[5];const w=b;let R;e[6]!==r?(R=re=>{r(re),h(!1)},e[6]=r,e[7]=R):R=e[7];const I=R;let L;e[8]===Symbol.for("react.memo_cache_sentinel")?(L=re=>{h(re)},e[8]=L):L=e[8];const M=L,P=f?"cursor-not-allowed opacity-50":"cursor-pointer hover:bg-accent";let S;e[9]!==i||e[10]!==P?(S=ie("flex items-center justify-center p-1 rounded-md transition-colors shrink-0",P,i),e[9]=i,e[10]=P,e[11]=S):S=e[11];let B;e[12]!==w?(B=w?m.jsx(ci,{icon:w.icon,name:w.title,size:"xs",fallbackIcon:w.fallbackIcon??m.jsx(di,{size:12}),className:"size-5 rounded-md"}):m.jsx("img",{src:"/favicon.svg",alt:"Default Agent",className:"size-5 rounded-md"}),e[12]=w,e[13]=B):B=e[13];let $;e[14]!==f||e[15]!==o||e[16]!==S||e[17]!==B?($=m.jsx("button",{type:"button",disabled:f,className:S,"aria-label":o,children:B}),e[14]=f,e[15]=o,e[16]=S,e[17]=B,e[18]=$):$=e[18];const X=$,q=f?!1:p,U=f?void 0:M;let W;e[19]!==X?(W=m.jsx(_n,{asChild:!0,children:m.jsx(ur,{asChild:!0,children:X})}),e[19]=X,e[20]=W):W=e[20];let V;e[21]!==p||e[22]!==w?.title||e[23]!==d?(V=d&&!p&&m.jsx(xn,{side:"top",className:"text-xs",children:w?.title??"Choose an agent to chat with"}),e[21]=p,e[22]=w?.title,e[23]=d,e[24]=V):V=e[24];let K;e[25]!==W||e[26]!==V?(K=m.jsx(hi,{children:m.jsxs(yn,{children:[W,V]})}),e[25]=W,e[26]=V,e[27]=K):K=e[27];let J;e[28]!==T||e[29]!==I||e[30]!==n?(J=m.jsx(or,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:m.jsx(Vo,{gateways:T,selectedGatewayId:n,onGatewayChange:I,searchInputRef:g})}),e[28]=T,e[29]=I,e[30]=n,e[31]=J):J=e[31];let k;return e[32]!==q||e[33]!==U||e[34]!==K||e[35]!==J?(k=m.jsxs(lr,{open:q,onOpenChange:U,children:[K,J]}),e[32]=q,e[33]=U,e[34]=K,e[35]=J,e[36]=k):k=e[36],k}const b0=["x-ai/grok-code-fast-1","anthropic/claude-sonnet-4.5","google/gemini-2.5-flash","xiaomi/mimo-v2-flash:free","google/gemini-3-flash-preview","deepseek/deepseek-v3.2","anthropic/claude-opus-4.5","x-ai/grok-4.1-fast","google/gemini-2.5-flash-lite","google/gemini-2.0-flash-001"],js=new Map;b0.forEach((t,e)=>{js.set(t,e)});function Ti(t){const e=Q.c(3);let n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={pageSize:999},e[0]=n):n=e[0];const r=u0(t??void 0,n);let s;return e[1]!==r?(s=r.filter(T0).sort(E0),e[1]=r,e[2]=s):s=e[2],s}function E0(t,e){const n=js.get(t.id),r=js.get(e.id);return n!==void 0&&r!==void 0?n-r:n!==void 0?-1:r!==void 0?1:t.title.localeCompare(e.title)}function T0(t){return t.limits?.contextWindow&&t.limits?.maxOutputTokens}const x0={reasoning:{icon:m.jsx(qr,{className:"size-4"}),label:"Reasoning"},"image-upload":{icon:m.jsx(Zd,{className:"size-4"}),label:"Can analyze images"},"file-upload":{icon:m.jsx(Qd,{className:"size-4"}),label:"Can analyze files"},"web-search":{icon:m.jsx(Yr,{className:"size-4"}),label:"Can search the web to answer questions"}};function Go(t){const e=Q.c(10),{capability:n}=t,r=x0[n];let s,i;e[0]!==n||e[1]!==r?(s=r||{icon:null,label:n},i=s.label.split("-").map(_0).join(" "),e[0]=n,e[1]=r,e[2]=s,e[3]=i):(s=e[2],i=e[3]);const a=i;let u;e[4]===Symbol.for("react.memo_cache_sentinel")?(u={backgroundColor:"color-mix(in oklch, var(--chart-1) 15%, transparent)",color:"var(--chart-1)"},e[4]=u):u=e[4];let l;e[5]!==a?(l=m.jsx("span",{children:a}),e[5]=a,e[6]=l):l=e[6];let o;return e[7]!==s.icon||e[8]!==l?(o=m.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 px-1.5 rounded-md text-xs font-medium",style:u,children:[s.icon,l]}),e[7]=s.icon,e[8]=l,e[9]=o):o=e[9],o}function _0(t){return t.charAt(0).toUpperCase()+t.slice(1)}function y0(t){const e=Q.c(53),{model:n,compact:r}=t,s=r===void 0?!1:r;if(!n){let T;return e[0]===Symbol.for("react.memo_cache_sentinel")?(T=m.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),e[0]=T):T=e[0],T}const i=n.limits?.contextWindow||n.costs?.input||n.costs?.output||n.limits?.maxOutputTokens;if(!i&&!s){let T;e[1]!==n.logo||e[2]!==n.title?(T=n.logo&&m.jsx("img",{src:n.logo,className:"w-6 h-6",alt:n.title}),e[1]=n.logo,e[2]=n.title,e[3]=T):T=e[3];let E;e[4]!==n.title?(E=m.jsx("p",{className:"text-lg font-medium leading-7",children:n.title}),e[4]=n.title,e[5]=E):E=e[5];let A;e[6]!==T||e[7]!==E?(A=m.jsxs("div",{className:"flex items-center gap-3 py-2 px-0",children:[T,E]}),e[6]=T,e[7]=E,e[8]=A):A=e[8];let b;e[9]!==n.description?(b=n.description&&m.jsx("p",{className:"text-sm text-muted-foreground",children:n.description}),e[9]=n.description,e[10]=b):b=e[10];let w;return e[11]!==A||e[12]!==b?(w=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[A,b]}),e[11]=A,e[12]=b,e[13]=w):w=e[13],w}if(!i&&s)return null;if(s){let T;e[14]!==n.limits?(T=n.limits?.contextWindow&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Context"}),m.jsxs("span",{className:"text-foreground font-medium",children:[n.limits.contextWindow.toLocaleString()," tokens"]})]}),e[14]=n.limits,e[15]=T):T=e[15];let E;e[16]!==n.costs?(E=n.costs?.input&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Input cost"}),m.jsxs("span",{className:"text-foreground font-medium",children:["$",n.costs.input.toFixed(2)," / 1M"]})]}),e[16]=n.costs,e[17]=E):E=e[17];let A;e[18]!==n.costs?(A=n.costs?.output&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Output cost"}),m.jsxs("span",{className:"text-foreground font-medium",children:["$",n.costs.output.toFixed(2)," / 1M"]})]}),e[18]=n.costs,e[19]=A):A=e[19];let b;e[20]!==n.limits?(b=n.limits?.maxOutputTokens&&m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),m.jsxs("span",{className:"text-foreground font-medium",children:[n.limits.maxOutputTokens.toLocaleString()," tokens"]})]}),e[20]=n.limits,e[21]=b):b=e[21];let w;return e[22]!==T||e[23]!==E||e[24]!==A||e[25]!==b?(w=m.jsxs("div",{className:"flex flex-col gap-2.5 pt-3 pb-3 px-3 rounded-b-lg text-xs",children:[T,E,A,b]}),e[22]=T,e[23]=E,e[24]=A,e[25]=b,e[26]=w):w=e[26],w}let a;e[27]!==n.logo||e[28]!==n.title?(a=n.logo&&m.jsx("img",{src:n.logo,className:"w-6 h-6 shrink-0",alt:n.title}),e[27]=n.logo,e[28]=n.title,e[29]=a):a=e[29];let u;e[30]!==n.title?(u=m.jsx("p",{className:"text-lg font-medium leading-7 wrap-break-word min-w-0",children:n.title}),e[30]=n.title,e[31]=u):u=e[31];let l;e[32]!==a||e[33]!==u?(l=m.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[a,u]}),e[32]=a,e[33]=u,e[34]=l):l=e[34];let o;e[35]!==n.capabilities?(o=n.capabilities&&n.capabilities.length>0&&m.jsx("div",{className:"flex items-center gap-2",children:n.capabilities.map(A0)}),e[35]=n.capabilities,e[36]=o):o=e[36];let d;e[37]!==l||e[38]!==o?(d=m.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,o]}),e[37]=l,e[38]=o,e[39]=d):d=e[39];let f;e[40]!==n.limits?(f=n.limits?.contextWindow&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(Xd,{className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("p",{className:"text-sm text-foreground",children:"Context window"})]}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.limits.contextWindow.toLocaleString()," tokens"]})]}),e[40]=n.limits,e[41]=f):f=e[41];let p;e[42]!==n.costs?(p=(n.costs?.input||n.costs?.output)&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(ro,{className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("p",{className:"text-sm text-foreground",children:"Costs"})]}),m.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.costs?.input!==null&&n.costs?.input!==void 0&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",n.costs.input.toFixed(2)," / 1M tokens (input)"]}),n.costs?.output!==null&&n.costs?.output!==void 0&&m.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",n.costs.output.toFixed(2)," / 1M tokens (output)"]})]})]}),e[42]=n.costs,e[43]=p):p=e[43];let h;e[44]!==n.limits?(h=n.limits?.maxOutputTokens&&m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx(ao,{className:"w-4.5 h-4.5 text-muted-foreground/70"}),m.jsx("p",{className:"text-sm text-foreground",children:"Output limit"})]}),m.jsxs("p",{className:"text-sm text-muted-foreground",children:[n.limits.maxOutputTokens.toLocaleString()," token limit"]})]}),e[44]=n.limits,e[45]=h):h=e[45];let g;e[46]!==f||e[47]!==p||e[48]!==h?(g=m.jsxs("div",{className:"flex flex-col gap-4",children:[f,p,h]}),e[46]=f,e[47]=p,e[48]=h,e[49]=g):g=e[49];let _;return e[50]!==g||e[51]!==d?(_=m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[d,g]}),e[50]=g,e[51]=d,e[52]=_):_=e[52],_}function A0(t){return m.jsx(Go,{capability:t},t)}function k0(t){const e=Q.c(15),{model:n,onHover:r}=t;let s;e[0]!==n||e[1]!==r?(s=()=>r(n),e[0]=n,e[1]=r,e[2]=s):s=e[2];let i;e[3]!==n.logo||e[4]!==n.title?(i=n.logo&&m.jsx("img",{src:n.logo,className:"w-5 h-5 shrink-0",alt:n.title}),e[3]=n.logo,e[4]=n.title,e[5]=i):i=e[5];let a;e[6]!==n.title?(a=m.jsx("span",{className:"text-sm text-foreground flex-1 min-w-0 line-clamp-1",children:n.title}),e[6]=n.title,e[7]=a):a=e[7];let u;e[8]!==n.capabilities?(u=n.capabilities&&n.capabilities.length>0&&m.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:n.capabilities.slice(0,2).map(C0)}),e[8]=n.capabilities,e[9]=u):u=e[9];let l;return e[10]!==s||e[11]!==i||e[12]!==a||e[13]!==u?(l=m.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 hover:bg-accent cursor-pointer rounded-lg",onMouseEnter:s,children:[i,a,u]}),e[10]=s,e[11]=i,e[12]=a,e[13]=u,e[14]=l):l=e[14],l}function C0(t){return m.jsx(Go,{capability:t},t)}function I0(t){const e=Q.c(10),{model:n,placeholder:r}=t,s=r===void 0?"Select model":r;if(!n){let l;return e[0]!==s?(l=m.jsx("span",{className:"text-sm text-muted-foreground",children:s}),e[0]=s,e[1]=l):l=e[1],l}let i;e[2]!==n.logo||e[3]!==n.title?(i=n.logo&&m.jsx("img",{src:n.logo,className:"w-5 h-5 shrink-0 rounded-sm",alt:n.title}),e[2]=n.logo,e[3]=n.title,e[4]=i):i=e[4];let a;e[5]!==n.title?(a=m.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors truncate min-w-0 hidden sm:inline-block",children:n.title}),e[5]=n.title,e[6]=a):a=e[6];let u;return e[7]!==i||e[8]!==a?(u=m.jsxs("div",{className:"flex items-center gap-2 min-w-0 overflow-hidden",children:[i,a]}),e[7]=i,e[8]=a,e[9]=u):u=e[9],u}function N0(){const t=Q.c(6);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:m.jsxs("div",{className:"flex items-center gap-2.5 h-12 px-4",children:[m.jsx($e,{className:"size-4 shrink-0"}),m.jsx($e,{className:"flex-1 h-6"}),m.jsx($e,{className:"w-[140px] h-8 shrink-0"})]})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[400px] md:min-w-[400px]",children:[e,m.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 pt-2 space-y-1",children:Array.from({length:6}).map(S0)})]}),t[1]=n):n=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[m.jsx($e,{className:"size-6 shrink-0"}),m.jsx($e,{className:"h-6 w-32"})]}),t[2]=r):r=t[2];let s;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[r,m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx($e,{className:"h-6 w-20 rounded-md"}),m.jsx($e,{className:"h-6 w-24 rounded-md"})]})]}),t[3]=s):s=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsx($e,{className:"h-4 w-24"}),m.jsx($e,{className:"h-4 w-32"})]}),t[4]=i):i=t[4];let a;return t[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[n,m.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:m.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[s,m.jsxs("div",{className:"flex flex-col gap-4",children:[i,m.jsxs("div",{className:"flex flex-col gap-1.5",children:[m.jsx($e,{className:"h-4 w-16"}),m.jsx($e,{className:"h-4 w-40"})]})]})]})})]}),t[5]=a):a=t[5],a}function S0(t,e){return m.jsxs("div",{className:"flex items-center gap-2 min-h-8 py-3 px-3 rounded-lg",children:[m.jsx($e,{className:"size-5 shrink-0 rounded-sm"}),m.jsx($e,{className:"flex-1 h-4"}),m.jsx($e,{className:"w-16 h-5 shrink-0 rounded-md"})]},e)}function w0(t){const e=Q.c(39),{selectedModel:n,onModelChange:r,onClose:s,modelsConnections:i}=t,[a,u]=j.useState(null),[l,o]=j.useState(""),d=j.useRef(null),[f,p]=j.useState(n?.connectionId??null),h=bi(),g=i??h,_=Ti(f);let T,E;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=()=>{setTimeout(()=>{d.current?.focus()},0)},E=[],e[0]=T,e[1]=E):(T=e[0],E=e[1]),j.useEffect(T,E);let A;e[2]!==_||e[3]!==l?(A=l.trim()?_.filter(J=>{const k=l.toLowerCase();return J.title.toLowerCase().includes(k)||J.provider?.toLowerCase().includes(k)||J.description?.toLowerCase().includes(k)}):_,e[2]=_,e[3]=l,e[4]=A):A=e[4];const b=A;let w;e[5]===Symbol.for("react.memo_cache_sentinel")?(w=J=>{p(J)},e[5]=w):w=e[5];const R=w;let I;e[6]!==_||e[7]!==s||e[8]!==r||e[9]!==f?(I=J=>{const k=_.find(re=>re.id===J);!k||!f||(r({id:k.id,connectionId:f,provider:k.provider??void 0}),o(""),s())},e[6]=_,e[7]=s,e[8]=r,e[9]=f,e[10]=I):I=e[10];const L=I;let M;e[11]===Symbol.for("react.memo_cache_sentinel")?(M=m.jsx(Yr,{size:16,className:"text-muted-foreground shrink-0"}),e[11]=M):M=e[11];let P;e[12]===Symbol.for("react.memo_cache_sentinel")?(P=J=>o(J.target.value),e[12]=P):P=e[12];let S;e[13]!==l?(S=m.jsx(fi,{ref:d,type:"text",placeholder:"Search for a model...",value:l,onChange:P,className:"flex-1 border-0 shadow-none focus-visible:ring-0 px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"}),e[13]=l,e[14]=S):S=e[14];let B;e[15]!==g||e[16]!==f?(B=g.length>0&&m.jsxs(Yd,{value:f??"",onValueChange:R,children:[m.jsxs(qd,{size:"sm",className:"w-auto min-w-[140px] h-8 shrink-0 [&>svg:last-child]:hidden",onClick:O0,children:[m.jsx(Vd,{placeholder:"Select connection"}),m.jsx(eo,{className:"size-4 opacity-50 shrink-0 pointer-events-none"})]}),m.jsx(Gd,{children:g.map(R0)})]}),e[15]=g,e[16]=f,e[17]=B):B=e[17];let $;e[18]!==S||e[19]!==B?($=m.jsx("div",{className:"border-b border-border h-12 bg-background/95 backdrop-blur sticky top-0 z-10",children:m.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[M,S,B]})}),e[18]=S,e[19]=B,e[20]=$):$=e[20];let X;e[21]!==b||e[22]!==L||e[23]!==n?.id?(X=b.length>0?b.map(J=>{const k=J.id===n?.id;return m.jsx("div",{onClick:()=>L(J.id),className:ie("rounded-lg mb-1",k&&"bg-accent"),children:m.jsx(k0,{model:J,onHover:u})},J.id)}):m.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"No models found"}),e[21]=b,e[22]=L,e[23]=n?.id,e[24]=X):X=e[24];let q;e[25]!==X?(q=m.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 pt-2",children:X}),e[25]=X,e[26]=q):q=e[26];let U;e[27]!==$||e[28]!==q?(U=m.jsxs("div",{className:"flex-1 flex flex-col md:border-r md:w-[400px] md:min-w-[400px]",children:[$,q]}),e[27]=$,e[28]=q,e[29]=U):U=e[29];let W;e[30]!==a||e[31]!==_||e[32]!==n?(W=a||(n?_.find(J=>J.id===n.id):null)||null,e[30]=a,e[31]=_,e[32]=n,e[33]=W):W=e[33];let V;e[34]!==W?(V=m.jsx("div",{className:"hidden md:block md:w-[320px] md:shrink-0 p-3",children:m.jsx(y0,{model:W})}),e[34]=W,e[35]=V):V=e[35];let K;return e[36]!==U||e[37]!==V?(K=m.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[U,V]}),e[36]=U,e[37]=V,e[38]=K):K=e[38],K}function R0(t){return m.jsx(Wd,{value:t.id,children:m.jsxs("div",{className:"flex items-center gap-2",children:[t.icon?m.jsx("img",{src:t.icon,alt:t.title,className:"w-4 h-4 rounded"}):m.jsx("div",{className:"w-4 h-4 rounded bg-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:t.title.slice(0,1).toUpperCase()}),m.jsx("span",{children:t.title})]})},t.id)}function O0(t){return t.stopPropagation()}function L0(t){const e=Q.c(23),{selectedModel:n,onModelChange:r,modelsConnections:s,variant:i,className:a,placeholder:u}=t,l=i===void 0?"borderless":i,o=u===void 0?"Select model":u,[d,f]=j.useState(!1),p=bi(),h=s??p,g=n?.connectionId??null,_=Ti(g);let T;e[0]!==_||e[1]!==n?(T=n?_.find(B=>B.id===n.id):void 0,e[0]=_,e[1]=n,e[2]=T):T=e[2];const E=T;if(h.length===0)return null;const A=l==="borderless"?"ghost":"outline",b=l==="borderless"&&"md:border-none";let w;e[3]!==a||e[4]!==b?(w=ie("text-sm hover:bg-accent rounded-lg py-0.5 px-1 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0 min-w-0 shrink justify-start overflow-hidden",b,a),e[3]=a,e[4]=b,e[5]=w):w=e[5];let R;e[6]!==E||e[7]!==o?(R=m.jsx(I0,{model:E,placeholder:o}),e[6]=E,e[7]=o,e[8]=R):R=e[8];let I;e[9]!==A||e[10]!==w||e[11]!==R?(I=m.jsx(ur,{asChild:!0,children:m.jsx(Me,{variant:A,size:"sm",className:w,children:R})}),e[9]=A,e[10]=w,e[11]=R,e[12]=I):I=e[12];let L;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=m.jsx(N0,{}),e[13]=L):L=e[13];let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=()=>f(!1),e[14]=M):M=e[14];let P;e[15]!==h||e[16]!==r||e[17]!==n?(P=m.jsx(or,{className:"w-full md:w-auto p-0",align:"start",side:"bottom",sideOffset:8,children:m.jsx(j.Suspense,{fallback:L,children:m.jsx(w0,{selectedModel:n,onModelChange:r,onClose:M,modelsConnections:h})})}),e[15]=h,e[16]=r,e[17]=n,e[18]=P):P=e[18];let S;return e[19]!==d||e[20]!==P||e[21]!==I?(S=m.jsxs(lr,{open:d,onOpenChange:f,children:[I,P]}),e[19]=d,e[20]=P,e[21]=I,e[22]=S):S=e[22],S}const v0=t=>new Bo({api:`/api/${t}/models/stream`,credentials:"include",prepareSendMessagesRequest:({messages:e,requestMetadata:n={}})=>{const{system:r,...s}=n,i=r?{id:crypto.randomUUID(),role:"system",parts:[{type:"text",text:r}]}:null;return{body:{messages:i?[i,...e]:e,stream:!0,...s}}}}),Ca=(t,e)=>t?.find(n=>n.id===e)??t?.[0]??null,D0=(t,e)=>{const n=Q.c(14);let r;n[0]!==t?(r=Qu.chatSelectedModel(t),n[0]=t,n[1]=r):r=n[1];const[s,i]=vs(r,null),a=s?.connectionId;let u;n[2]!==e||n[3]!==a?(u=Ca(e,a),n[2]=e,n[3]=a,n[4]=u):u=n[4];const l=u,o=Ti(l?.id??null),d=s?.id;let f;n[5]!==o||n[6]!==d?(f=Ca(o,d),n[5]=o,n[6]=d,n[7]=f):f=n[7];const p=f;let h;n[8]!==l||n[9]!==p?(h=p&&l?.id?{id:p.id,provider:p.provider,limits:p.limits,connectionId:l.id}:null,n[8]=l,n[9]=p,n[10]=h):h=n[10];const g=h;let _;return n[11]!==g||n[12]!==i?(_=[g,i],n[11]=g,n[12]=i,n[13]=_):_=n[13],_},Wo={inputValue:"",branchContext:null,finishReason:null};function P0(t,e){switch(e.type){case"SET_INPUT":return{...t,inputValue:e.payload};case"START_BRANCH":return{...t,branchContext:e.payload};case"CLEAR_BRANCH":return{...t,branchContext:null};case"SET_FINISH_REASON":return{...t,finishReason:e.payload};case"CLEAR_FINISH_REASON":return{...t,finishReason:null};case"RESET":return Wo;default:return t}}const Qo=j.createContext(null),Xo=()=>crypto.randomUUID();function M0(t){const e=Q.c(75),{children:n}=t,{locator:r,org:s}=zt(),{data:i}=qu.useSession(),a=i?.user??null,[u,l]=j.useReducer(P0,Wo),o=$o(),d=Yo(),{threads:f}=zo(),[p,h]=vs(Qu.threadManagerState(r)+":active-id",j0),g=f0(p),_=qo(),[T,E]=vs(`${r}:selected-gateway-id`,null),A=bi(),[b,w]=D0(r,A),R=h0(T),I=p0();let L;e[0]!==p||e[1]!==f?(L=f.find(le=>le.id===p)??null,e[0]=p,e[1]=f,e[2]=L):L=e[2];const M=L;let P;e[3]!==_||e[4]!==T?(P=T?_.find(le=>le.id===T)??null:null,e[3]=_,e[4]=T,e[5]=P):P=e[5];const S=P;let B;e[6]!==s.slug?(B=v0(s.slug),e[6]=s.slug,e[7]=B):B=e[7];const $=B;let X;e[8]!==p||e[9]!==r||e[10]!==d||e[11]!==S?.id||e[12]!==o?(X=async le=>{const{finishReason:D,messages:Y,isAbort:Z,isDisconnect:ue,isError:me}=le;if(l({type:"SET_FINISH_REASON",payload:D??null}),D!=="stop"||Z||ue||me)return;const ze=Y.slice(-2).filter(Boolean);if(ze.length!==2){console.warn("[chat] Expected 2 messages, got",ze.length);return}d.insertMany.mutate(ze);const xt=ze.find(U0)?.parts?.find(F0)?.text.slice(0,100)||"",at=await c0(r,p);if(!at){const vt=new Date().toISOString(),Vt={id:p,title:xt,created_at:vt,updated_at:vt,hidden:!1,gatewayId:S?.id};o.insert.mutate(Vt);return}o.update.mutate({id:p,updates:{title:at.title||xt,gatewayId:at.gatewayId||S?.id,updated_at:new Date().toISOString()}})},e[8]=p,e[9]=r,e[10]=d,e[11]=S?.id,e[12]=o,e[13]=X):X=e[13];const q=X,U=B0;let W;e[14]!==p||e[15]!==q||e[16]!==I||e[17]!==g||e[18]!==$?(W={id:p,messages:g,transport:$,onFinish:q,onToolCall:I,onError:U},e[14]=p,e[15]=q,e[16]=I,e[17]=g,e[18]=$,e[19]=W):W=e[19];const V=a0(W),K=V.status==="submitted"||V.status==="streaming",J=V.messages.length===0;let k;e[20]===Symbol.for("react.memo_cache_sentinel")?(k=le=>l({type:"SET_INPUT",payload:le}),e[20]=k):k=e[20];const re=k;let he;e[21]===Symbol.for("react.memo_cache_sentinel")?(he=le=>l({type:"START_BRANCH",payload:le}),e[21]=he):he=e[21];const N=he;let Ee;e[22]===Symbol.for("react.memo_cache_sentinel")?(Ee=()=>l({type:"CLEAR_BRANCH"}),e[22]=Ee):Ee=e[22];const ve=Ee;let fe;e[23]===Symbol.for("react.memo_cache_sentinel")?(fe=()=>l({type:"RESET"}),e[23]=fe):fe=e[23];const Ge=fe;let Ie;e[24]!==h||e[25]!==o?(Ie=le=>{const D=le?.id||crypto.randomUUID(),Y=new Date().toISOString(),Z={id:D,title:le?.title||"",created_at:le?.created_at||Y,updated_at:le?.updated_at||Y,hidden:le?.hidden??!1,gatewayId:le?.gatewayId};return o.insert.mutate(Z),h(D),Z},e[24]=h,e[25]=o,e[26]=Ie):Ie=e[26];const Ne=Ie;let ye;e[27]!==p||e[28]!==h||e[29]!==o?(ye=le=>{o.update.mutate({id:le,updates:{hidden:!0,updated_at:new Date().toISOString()}}),p===le&&h(Xo())},e[27]=p,e[28]=h,e[29]=o,e[30]=ye):ye=e[30];const Fe=ye;let Re;e[31]!==E?(Re=le=>{E(le)},e[31]=E,e[32]=Re):Re=e[32];const De=Re;let Oe;e[33]!==w?(Oe=le=>{w({id:le.id,connectionId:le.connectionId})},e[33]=w,e[34]=Oe):Oe=e[34];const Ue=Oe;let Se;e[35]!==p||e[36]!==V||e[37]!==R||e[38]!==K||e[39]!==S?.id||e[40]!==b||e[41]!==a?.image||e[42]!==a?.name?(Se=async le=>{if(!b){Kn.error("No model configured");return}if(!le?.trim()||K)return;re(""),ve(),l({type:"CLEAR_FINISH_REASON"});const D={created_at:new Date().toISOString(),thread_id:p,system:R,model:{id:b.id,connectionId:b.connectionId,provider:b.provider??void 0,limits:b.limits??void 0},gateway:{id:S?.id??null},user:{avatar:a?.image??void 0,name:a?.name??"you"}};await V.sendMessage({id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:le}],metadata:D},{metadata:D})},e[35]=p,e[36]=V,e[37]=R,e[38]=K,e[39]=S?.id,e[40]=b,e[41]=a?.image,e[42]=a?.name,e[43]=Se):Se=e[43];const He=Se;let We;e[44]!==V?(We=()=>V.stop(),e[44]=V,e[45]=We):We=e[45];const Tt=We;let Je;e[46]===Symbol.for("react.memo_cache_sentinel")?(Je=()=>l({type:"CLEAR_FINISH_REASON"}),e[46]=Je):Je=e[46];const qt=Je;let st;e[47]!==M||e[48]!==p||e[49]!==V.clearError||e[50]!==V.error||e[51]!==V.messages||e[52]!==V.setMessages||e[53]!==V.status||e[54]!==u.branchContext||e[55]!==u.finishReason||e[56]!==u.inputValue||e[57]!==Ne||e[58]!==_||e[59]!==Fe||e[60]!==J||e[61]!==K||e[62]!==A||e[63]!==S||e[64]!==b||e[65]!==He||e[66]!==h||e[67]!==De||e[68]!==Ue||e[69]!==Tt||e[70]!==f?(st={inputValue:u.inputValue,branchContext:u.branchContext,setInputValue:re,startBranch:N,clearBranch:ve,resetInteraction:Ge,activeThreadId:p,activeThread:M,threads:f,createThread:Ne,setActiveThreadId:h,hideThread:Fe,gateways:_,selectedGateway:S,setGatewayId:De,modelsConnections:A,selectedModel:b,setSelectedModel:Ue,messages:V.messages,chatStatus:V.status,isStreaming:K,isChatEmpty:J,sendMessage:He,stopStreaming:Tt,setMessages:V.setMessages,chatError:V.error,clearChatError:V.clearError,finishReason:u.finishReason,clearFinishReason:qt},e[47]=M,e[48]=p,e[49]=V.clearError,e[50]=V.error,e[51]=V.messages,e[52]=V.setMessages,e[53]=V.status,e[54]=u.branchContext,e[55]=u.finishReason,e[56]=u.inputValue,e[57]=Ne,e[58]=_,e[59]=Fe,e[60]=J,e[61]=K,e[62]=A,e[63]=S,e[64]=b,e[65]=He,e[66]=h,e[67]=De,e[68]=Ue,e[69]=Tt,e[70]=f,e[71]=st):st=e[71];const dt=st;let it;return e[72]!==n||e[73]!==dt?(it=m.jsx(Qo.Provider,{value:dt,children:n}),e[72]=n,e[73]=dt,e[74]=it):it=e[74],it}function B0(t){console.error("[chat] Chat error:",t)}function F0(t){return t.type==="text"}function U0(t){return t.parts?.find(H0)}function H0(t){return t.type==="text"}function j0(t){return t||Xo()}function An(){const t=j.useContext(Qo);if(!t)throw new Error("useChat must be used within a ChatProvider");return t}const z0={openrouter:t=>{const e=t?.openrouter;return typeof e=="object"&&e!==null&&"usage"in e&&typeof e.usage=="object"&&e.usage!==null&&"cost"in e.usage&&typeof e.usage.cost=="number"?e.usage.cost:null}};function $0(t){if(!t?.providerMetadata)return null;for(const e of Object.values(z0)){const n=e(t.providerMetadata);if(n!==null)return n}return null}function Y0(t){return t.reduce((e,n)=>{const r=n.metadata?.usage;return r?{inputTokens:e.inputTokens+(r.inputTokens??0),outputTokens:e.outputTokens+(r.outputTokens??0),totalTokens:e.totalTokens+(r.totalTokens??0),cost:e.cost+($0(r)??0)}:e},{inputTokens:0,outputTokens:0,totalTokens:0,cost:0})}function Zo(t){const e=Q.c(38),{messages:n}=t;let r,s,i,a,u,l,o,d,f,p,h,g;if(e[0]!==n){g=Symbol.for("react.early_return_sentinel");e:{const w=Y0(n);if(!w){g=null;break e}const{totalTokens:R,inputTokens:I,outputTokens:L,cost:M}=w;if(i=M,!R&&!I&&!L){g=null;break e}s=yn;let P;e[13]===Symbol.for("react.memo_cache_sentinel")?(P=m.jsx(to,{size:12}),e[13]=P):P=e[13];const S=m.jsxs(Me,{variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground pl-1! h-6 gap-1 whitespace-nowrap shrink-0",children:[P,m.jsx("span",{className:"text-[10px] font-mono tabular-nums",children:R.toLocaleString()})]});e[14]!==S?(h=m.jsx(_n,{asChild:!0,children:S}),e[14]=S,e[15]=h):h=e[15],r=xn,f="top",p="font-mono text-[11px]",u="grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",e[16]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx("span",{className:"text-muted",children:"in"}),e[16]=l):l=e[16],o=m.jsx("span",{children:I.toLocaleString()}),e[17]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx("span",{className:"text-muted",children:"out"}),e[17]=d):d=e[17],a=L.toLocaleString()}e[0]=n,e[1]=r,e[2]=s,e[3]=i,e[4]=a,e[5]=u,e[6]=l,e[7]=o,e[8]=d,e[9]=f,e[10]=p,e[11]=h,e[12]=g}else r=e[1],s=e[2],i=e[3],a=e[4],u=e[5],l=e[6],o=e[7],d=e[8],f=e[9],p=e[10],h=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let _;e[18]!==a?(_=m.jsx("span",{children:a}),e[18]=a,e[19]=_):_=e[19];let T;e[20]!==i?(T=i>0&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted",children:"cost"}),m.jsxs("span",{children:["$",i.toFixed(4)]})]}),e[20]=i,e[21]=T):T=e[21];let E;e[22]!==_||e[23]!==T||e[24]!==u||e[25]!==l||e[26]!==o||e[27]!==d?(E=m.jsxs("div",{className:u,children:[l,o,d,_,T]}),e[22]=_,e[23]=T,e[24]=u,e[25]=l,e[26]=o,e[27]=d,e[28]=E):E=e[28];let A;e[29]!==r||e[30]!==E||e[31]!==f||e[32]!==p?(A=m.jsx(r,{side:f,className:p,children:E}),e[29]=r,e[30]=E,e[31]=f,e[32]=p,e[33]=A):A=e[33];let b;return e[34]!==s||e[35]!==A||e[36]!==h?(b=m.jsxs(s,{children:[h,A]}),e[34]=s,e[35]=A,e[36]=h,e[37]=b):b=e[37],b}function q0({gatewayId:t,gateways:e,onGatewayChange:n,disabled:r=!1}){const[s,i]=j.useState(!1),a=j.useRef(null),u=Vu(),{org:l}=zt(),o=e.find(g=>g.id===t);if(!o)return null;j.useEffect(()=>{s&&setTimeout(()=>{a.current?.focus()},0)},[s]);const d=co(t),f=g=>{g.stopPropagation(),n(null)},p=g=>{g.stopPropagation(),u({to:"/$org/gateways/$gatewayId",params:{org:l.slug,gatewayId:t}})},h=g=>{n(g),i(!1)};return m.jsxs("div",{className:ie("flex items-center justify-between px-3 py-1.5 rounded-t-xl",d?.bg),children:[m.jsxs(lr,{open:s,onOpenChange:i,children:[m.jsx(ur,{asChild:!0,children:m.jsxs("button",{type:"button",disabled:r,className:ie("flex items-center gap-1.5 hover:opacity-80 transition-opacity",r?"cursor-not-allowed opacity-50":"cursor-pointer"),children:[m.jsx(ci,{icon:o.icon,name:o.title,size:"2xs",fallbackIcon:o.fallbackIcon??m.jsx(di,{size:10})}),m.jsx("span",{className:"text-xs text-white font-normal",children:o.title}),m.jsx(vd,{size:14,className:"text-white/50"})]})}),m.jsx(or,{className:"w-[550px] p-0 overflow-hidden",align:"start",side:"top",sideOffset:8,children:m.jsx(Vo,{gateways:e,selectedGatewayId:t,onGatewayChange:h,searchInputRef:a})})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("button",{type:"button",onClick:p,disabled:r,className:ie("flex items-center justify-center p-1 rounded-full transition-colors",r?"cursor-not-allowed opacity-50":"cursor-pointer hover:bg-white/10"),"aria-label":"Edit gateway",children:m.jsx(Pd,{size:14,className:"text-white"})}),m.jsx("button",{type:"button",onClick:f,disabled:r,className:ie("flex items-center justify-center p-1 rounded-full transition-colors",r?"cursor-not-allowed opacity-50":"cursor-pointer hover:bg-white/10"),"aria-label":"Reset to default",children:m.jsx(lo,{size:14,className:"text-white"})})]})]})}function V0(){const t=Q.c(120),{inputValue:e,setInputValue:n,branchContext:r,clearBranch:s,setActiveThreadId:i,gateways:a,selectedGateway:u,setGatewayId:l,modelsConnections:o,selectedModel:d,setSelectedModel:f,messages:p,isStreaming:h,sendMessage:g,stopStreaming:_,chatError:T,clearChatError:E,finishReason:A,clearFinishReason:b}=An();let w;t[0]!==e||t[1]!==h||t[2]!==d?(w=!h&&d&&e.trim().length>0,t[0]=e,t[1]=h,t[2]=d,t[3]=w):w=t[3];const R=w;let I;t[4]!==R||t[5]!==e||t[6]!==h||t[7]!==g||t[8]!==_?(I=Z=>{Z.preventDefault(),h?_():R&&g(e.trim())},t[4]=R,t[5]=e,t[6]=h,t[7]=g,t[8]=_,t[9]=I):I=t[9];const L=I;let M;t[10]!==R||t[11]!==e||t[12]!==g?(M=Z=>{Z.key==="Enter"&&!Z.shiftKey&&(Z.preventDefault(),R&&g(e.trim()))},t[10]=R,t[11]=e,t[12]=g,t[13]=M):M=t[13];const P=M;let S;t[14]!==r||t[15]!==s||t[16]!==i||t[17]!==n?(S=()=>{r&&(i(r.originalThreadId),s(),n(""))},t[14]=r,t[15]=s,t[16]=i,t[17]=n,t[18]=S):S=t[18];const B=S;let $;t[19]!==T||t[20]!==g?($=()=>{T&&g(`I encountered this error: ${T.message}. Can you help me fix it?`)},t[19]=T,t[20]=g,t[21]=$):$=t[21];const X=$;let q;t[22]!==g?(q=()=>{g("Please continue.")},t[22]=g,t[23]=q):q=t[23];const U=q;let W,V,K,J,k,re;if(t[24]!==r||t[25]!==T||t[26]!==s||t[27]!==E||t[28]!==b||t[29]!==A||t[30]!==U||t[31]!==X||t[32]!==B||t[33]!==u||t[34]!==d||t[35]!==n){const Z=u?co(u.id):null;W=d?"Ask anything or @ for context":"Select a model to start chatting",J="flex flex-col gap-2 w-full min-h-42 justify-end",t[42]!==T||t[43]!==E||t[44]!==X?(k=T&&m.jsxs(Ls,{variant:"danger",title:"Error occurred",description:T.message,icon:m.jsx(Gu,{size:16}),onDismiss:E,children:[m.jsx(Me,{size:"sm",variant:"outline",onClick:X,className:"h-7 text-xs",children:"Fix in chat"}),m.jsx(Me,{size:"sm",variant:"outline",disabled:!0,className:"h-7 text-xs",children:"Report"})]}),t[42]=T,t[43]=E,t[44]=X,t[45]=k):k=t[45],t[46]!==b||t[47]!==A||t[48]!==U?(re=A&&A!=="stop"&&m.jsx(Ls,{variant:"warning",title:"Response incomplete",description:A==="length"?"Response reached the model's output limit. Different models have different limits. Try switching models or asking it to continue.":A==="content-filter"?"Response was filtered due to content policy.":A==="tool-calls"?"Response paused after tool execution to prevent infinite loops and save costs. Click continue to keep working.":`Response stopped unexpectedly: ${A}`,icon:m.jsx(Rd,{size:16}),onDismiss:b,children:m.jsx(Me,{size:"sm",variant:"outline",onClick:U,className:"h-7 text-xs",children:"Continue"})}),t[46]=b,t[47]=A,t[48]=U,t[49]=re):re=t[49],t[50]!==r||t[51]!==s||t[52]!==B||t[53]!==n?(V=r&&m.jsx(Ls,{variant:"default",title:"Editing message (click to view original)",description:r.originalMessageText,icon:m.jsx(no,{size:14}),onDismiss:()=>{s(),n("")},children:m.jsx(Me,{size:"sm",variant:"outline",onClick:B,className:"h-7 text-xs",children:"View original"})}),t[50]=r,t[51]=s,t[52]=B,t[53]=n,t[54]=V):V=t[54],K=ie("relative rounded-xl w-full flex flex-col",u&&"shadow-sm",Z?.bg),t[24]=r,t[25]=T,t[26]=s,t[27]=E,t[28]=b,t[29]=A,t[30]=U,t[31]=X,t[32]=B,t[33]=u,t[34]=d,t[35]=n,t[36]=W,t[37]=V,t[38]=K,t[39]=J,t[40]=k,t[41]=re}else W=t[36],V=t[37],K=t[38],J=t[39],k=t[40],re=t[41];let he;t[55]!==a||t[56]!==h||t[57]!==u||t[58]!==l?(he=u&&m.jsx(q0,{gatewayId:u.id,gateways:a,onGatewayChange:l,disabled:h}),t[55]=a,t[56]=h,t[57]=u,t[58]=l,t[59]=he):he=t[59];const N=!u&&"shadow-sm";let Ee;t[60]!==N?(Ee=ie("w-full relative rounded-xl min-h-[130px] flex flex-col border border-border bg-background",N),t[60]=N,t[61]=Ee):Ee=t[61];let ve;t[62]===Symbol.for("react.memo_cache_sentinel")?(ve={maxHeight:"164px"},t[62]=ve):ve=t[62];let fe;t[63]!==n?(fe=Z=>n(Z.target.value),t[63]=n,t[64]=fe):fe=t[64];const Ge=!d||h;let Ie;t[65]===Symbol.for("react.memo_cache_sentinel")?(Ie=ie("placeholder:text-muted-foreground resize-none focus-visible:ring-0 border-0 p-2 text-[15px]! min-h-[20px] w-full","rounded-none shadow-none","min-h-[20px] h-auto overflow-hidden"),t[65]=Ie):Ie=t[65];let Ne;t[66]!==P||t[67]!==e||t[68]!==W||t[69]!==fe||t[70]!==Ge?(Ne=m.jsx("div",{className:"relative flex flex-col gap-2 p-2.5 flex-1",children:m.jsx("div",{className:"overflow-y-auto relative flex-1",style:ve,children:m.jsx(wd,{rows:1,value:e,onChange:fe,onKeyDown:P,placeholder:W,disabled:Ge,className:Ie})})}),t[66]=P,t[67]=e,t[68]=W,t[69]=fe,t[70]=Ge,t[71]=Ne):Ne=t[71];let ye;t[72]!==a||t[73]!==h||t[74]!==u||t[75]!==l?(ye=!u&&m.jsx(g0,{selectedGatewayId:null,onGatewayChange:l,gateways:a,placeholder:"Agent",disabled:h}),t[72]=a,t[73]=h,t[74]=u,t[75]=l,t[76]=ye):ye=t[76];const Fe=d??void 0;let Re;t[77]!==o||t[78]!==f||t[79]!==Fe?(Re=m.jsx(L0,{selectedModel:Fe,onModelChange:f,modelsConnections:o,placeholder:"Model",variant:"borderless"}),t[77]=o,t[78]=f,t[79]=Fe,t[80]=Re):Re=t[80];let De;t[81]!==p?(De=m.jsx(Zo,{messages:p}),t[81]=p,t[82]=De):De=t[82];let Oe;t[83]!==ye||t[84]!==Re||t[85]!==De?(Oe=m.jsxs("div",{className:"flex items-center gap-2 min-w-0 overflow-hidden",children:[ye,Re,De]}),t[83]=ye,t[84]=Re,t[85]=De,t[86]=Oe):Oe=t[86];const Ue=h?"button":"submit";let Se;t[87]!==h||t[88]!==_?(Se=Z=>{h&&(Z.preventDefault(),Z.stopPropagation(),_())},t[87]=h,t[88]=_,t[89]=Se):Se=t[89];const He=R||h?"default":"ghost",We=!R&&!h,Tt=!R&&!h&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed";let Je;t[90]!==Tt?(Je=ie("size-8 rounded-full transition-all",Tt),t[90]=Tt,t[91]=Je):Je=t[91];const qt=h?"Stop generating":"Send message (Enter)";let st;t[92]!==h?(st=h?m.jsx(uo,{size:20}):m.jsx(Ld,{size:20}),t[92]=h,t[93]=st):st=t[93];let dt;t[94]!==Ue||t[95]!==Se||t[96]!==He||t[97]!==We||t[98]!==Je||t[99]!==qt||t[100]!==st?(dt=m.jsx("div",{className:"flex items-center gap-1",children:m.jsx(Me,{type:Ue,onClick:Se,variant:He,size:"icon",disabled:We,className:Je,title:qt,children:st})}),t[94]=Ue,t[95]=Se,t[96]=He,t[97]=We,t[98]=Je,t[99]=qt,t[100]=st,t[101]=dt):dt=t[101];let it;t[102]!==Oe||t[103]!==dt?(it=m.jsxs("div",{className:"flex items-center justify-between p-2.5",children:[Oe,dt]}),t[102]=Oe,t[103]=dt,t[104]=it):it=t[104];let le;t[105]!==L||t[106]!==Ee||t[107]!==Ne||t[108]!==it?(le=m.jsx("div",{className:"p-0.5",children:m.jsxs("form",{onSubmit:L,className:Ee,children:[Ne,it]})}),t[105]=L,t[106]=Ee,t[107]=Ne,t[108]=it,t[109]=le):le=t[109];let D;t[110]!==he||t[111]!==le||t[112]!==K?(D=m.jsxs("div",{className:K,children:[he,le]}),t[110]=he,t[111]=le,t[112]=K,t[113]=D):D=t[113];let Y;return t[114]!==V||t[115]!==D||t[116]!==J||t[117]!==k||t[118]!==re?(Y=m.jsxs("div",{className:J,children:[k,re,V,D]}),t[114]=V,t[115]=D,t[116]=J,t[117]=k,t[118]=re,t[119]=Y):Y=t[119],Y}const G0={name:"mesh-chat",version:"1.0.0"};function W0(t){if(typeof window>"u")throw new Error("Gateway prompts require a browser environment.");const e=new URL(`/mcp/gateway/${t}`,window.location.origin);return new gd(e,{requestInit:{headers:{Accept:"application/json, text/event-stream","Content-Type":"application/json"}}})}async function Ko(t,e){const n=new md(G0),r=W0(t);try{return await n.connect(r),await e(n)}catch(s){const i=s instanceof Error?s.message:String(s);throw console.error(`[gateway-prompts] Error for gateway ${t}:`,s),new Error(`Failed to communicate with gateway: ${i}`)}finally{await n.close().catch(console.error)}}async function Q0(t){try{return(await Ko(t,n=>n.listPrompts())).prompts??[]}catch(e){return console.error("[gateway-prompts] Failed to list prompts:",e),[]}}async function X0(t,e,n){const r=n??{};return await Ko(t,s=>s.getPrompt({name:e,arguments:r}))}function Z0(t){const e=Q.c(7);let n;e[0]!==t?(n=je.gatewayPrompts(t),e[0]=t,e[1]=n):n=e[1];let r;e[2]!==t?(r=()=>Q0(t),e[2]=t,e[3]=r):r=e[3];let s;return e[4]!==n||e[5]!==r?(s={queryKey:n,queryFn:r,staleTime:6e4,retry:!1},e[4]=n,e[5]=r,e[6]=s):s=e[6],ui(s)}const Ia=3;function Jo(t){const e=Q.c(23),{prompt:n,onSelect:r,isSelected:s,isDisabled:i,isLoading:a}=t,u=n.description??n.name;let l;e[0]!==r||e[1]!==n?(l=()=>r(n),e[0]=r,e[1]=n,e[2]=l):l=e[2];const o=i||a,d=s&&"bg-accent/50 text-foreground",f=a&&"bg-accent/50 text-foreground",p=(i||a)&&"cursor-not-allowed hover:bg-accent/50";let h;e[3]!==d||e[4]!==f||e[5]!==p?(h=ie("px-3 py-1.5 text-xs text-muted-foreground hover:text-foreground border border-border rounded-full hover:bg-accent/50 transition-colors cursor-pointer flex items-center gap-1.5",d,f,p),e[3]=d,e[4]=f,e[5]=p,e[6]=h):h=e[6];const g=n.title??n.name;let _;if(e[7]!==g){let w;e[9]===Symbol.for("react.memo_cache_sentinel")?(w=/_/g,e[9]=w):w=e[9],_=g.replace(w," "),e[7]=g,e[8]=_}else _=e[8];let T;e[10]!==a?(T=a&&m.jsx(Zu,{size:"xs"}),e[10]=a,e[11]=T):T=e[11];let E;e[12]!==l||e[13]!==o||e[14]!==h||e[15]!==_||e[16]!==T?(E=m.jsx(_n,{asChild:!0,children:m.jsxs("button",{type:"button",onClick:l,disabled:o,className:h,children:[_,T]})}),e[12]=l,e[13]=o,e[14]=h,e[15]=_,e[16]=T,e[17]=E):E=e[17];let A;e[18]!==u?(A=m.jsx(xn,{side:"bottom",className:"max-w-xs",children:m.jsx("p",{className:"text-xs",children:u})}),e[18]=u,e[19]=A):A=e[19];let b;return e[20]!==E||e[21]!==A?(b=m.jsxs(yn,{children:[E,A]}),e[20]=E,e[21]=A,e[22]=b):b=e[22],b}function K0(t){const e=Q.c(23),{prompts:n,onSelect:r,loadingPrompt:s,className:i}=t;if(n.length===0)return null;let a,u,l,o,d;if(e[0]!==i||e[1]!==s||e[2]!==r||e[3]!==n){const h=n.slice(0,Ia),g=n.slice(Ia),_=g.length>0,T=!!s;a=hi,d=300,e[9]!==i?(u=ie("flex flex-wrap items-center justify-center gap-2",i),e[9]=i,e[10]=u):u=e[10];let E;e[11]!==T||e[12]!==s?.name||e[13]!==r?(E=A=>m.jsx(Jo,{prompt:A,onSelect:r,isLoading:s?.name===A.name,isDisabled:T&&s?.name!==A.name},A.name),e[11]=T,e[12]=s?.name,e[13]=r,e[14]=E):E=e[14],l=h.map(E),o=_&&m.jsxs(lr,{children:[m.jsx(ur,{asChild:!0,children:m.jsxs("button",{type:"button",disabled:T,className:ie("size-7 flex items-center justify-center text-xs text-muted-foreground hover:text-foreground border border-border rounded-full hover:bg-accent/50 transition-colors cursor-pointer",T&&"opacity-60 cursor-not-allowed"),children:["+",g.length]})}),m.jsx(or,{side:"bottom",align:"center",className:"w-auto p-2",children:m.jsx("div",{className:"flex flex-col gap-1",children:g.map(A=>{const b=A.description??A.name,w=s?.name===A.name;return m.jsxs(yn,{children:[m.jsx(_n,{asChild:!0,children:m.jsxs("button",{type:"button",onClick:()=>r(A),disabled:T&&!w,className:ie("px-3 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-accent/50 rounded-md transition-colors cursor-pointer text-left flex items-center gap-1.5",w&&"bg-accent/50 text-foreground",T&&!w&&"opacity-60 cursor-not-allowed"),children:[(A.title??A.name).replace(/_/g," "),w&&m.jsx(Zu,{size:"xs"})]})}),m.jsx(xn,{side:"right",className:"max-w-xs",children:m.jsx("p",{className:"text-xs",children:b})})]},A.name)})})})]}),e[0]=i,e[1]=s,e[2]=r,e[3]=n,e[4]=a,e[5]=u,e[6]=l,e[7]=o,e[8]=d}else a=e[4],u=e[5],l=e[6],o=e[7],d=e[8];let f;e[15]!==u||e[16]!==l||e[17]!==o?(f=m.jsxs("div",{className:u,children:[l,o]}),e[15]=u,e[16]=l,e[17]=o,e[18]=f):f=e[18];let p;return e[19]!==a||e[20]!==d||e[21]!==f?(p=m.jsx(a,{delayDuration:d,children:f}),e[19]=a,e[20]=d,e[21]=f,e[22]=p):p=e[22],p}function J0(t){const e={};for(const n of t.arguments??[])e[n.name]=n.required?G().min(1,"Required"):G();return Te(e)}function ep(t){const e={};for(const n of t.arguments??[])e[n.name]="";return e}function tp(t){for(const e of t.messages??[]){if(e.role!=="user"||e.content?.type!=="text")continue;const n=e.content.text?.trim();if(n)return n}return null}function np(t){const e=Q.c(40),{prompt:n,onCancel:r,onSubmit:s}=t;let i;if(e[0]!==n){const M=J0(n);i=bd(M),e[0]=n,e[1]=i}else i=e[1];const u=i;let l;e[2]!==n?(l=ep(n),e[2]=n,e[3]=l):l=e[3];let o;e[4]!==u||e[5]!==l?(o={resolver:u,defaultValues:l,mode:"onChange"},e[4]=u,e[5]=l,e[6]=o):o=e[6];const d=Ed(o);let f;e[7]!==n.arguments?(f=n.arguments??[],e[7]=n.arguments,e[8]=f):f=e[8];const p=f;let h;e[9]!==r||e[10]!==n?(h=m.jsx(Jo,{prompt:n,onSelect:r,isSelected:!0}),e[9]=r,e[10]=n,e[11]=h):h=e[11];let g;e[12]!==n.description?(g=n.description?m.jsx("p",{className:"text-xs text-muted-foreground max-w-xl text-center",children:n.description}):null,e[12]=n.description,e[13]=g):g=e[13];let _;e[14]!==d||e[15]!==s?(_=d.handleSubmit(s),e[14]=d,e[15]=s,e[16]=_):_=e[16];let T;if(e[17]!==p||e[18]!==d.control){let M;e[20]!==d.control?(M=P=>m.jsx(Jd,{control:d.control,name:P.name,render:S=>{const{field:B}=S;return m.jsxs(ef,{children:[m.jsxs(tf,{className:"text-xs",children:[P.name,P.required?" *":""]}),m.jsx(nf,{children:m.jsx(fi,{...B,value:B.value??"",required:P.required,placeholder:P.description??"",className:"h-9"})}),P.description?m.jsx(rf,{className:"text-xs",children:P.description}):null,m.jsx(sf,{})]})}},P.name),e[20]=d.control,e[21]=M):M=e[21],T=p.map(M),e[17]=p,e[18]=d.control,e[19]=T}else T=e[19];let E;e[22]!==r?(E=m.jsx(Me,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-3 text-xs",onClick:r,children:"Cancel"}),e[22]=r,e[23]=E):E=e[23];const A=!d.formState.isValid;let b;e[24]!==A?(b=m.jsx(Me,{type:"submit",size:"sm",className:"h-8 px-3 text-xs",disabled:A,children:"Use prompt"}),e[24]=A,e[25]=b):b=e[25];let w;e[26]!==E||e[27]!==b?(w=m.jsxs("div",{className:"flex justify-end gap-2",children:[E,b]}),e[26]=E,e[27]=b,e[28]=w):w=e[28];let R;e[29]!==w||e[30]!==_||e[31]!==T?(R=m.jsxs("form",{className:"w-full max-w-xl flex flex-col gap-3",onSubmit:_,autoComplete:"off",children:[T,w]}),e[29]=w,e[30]=_,e[31]=T,e[32]=R):R=e[32];let I;e[33]!==d||e[34]!==R?(I=m.jsx(Kd,{...d,children:R}),e[33]=d,e[34]=R,e[35]=I):I=e[35];let L;return e[36]!==I||e[37]!==h||e[38]!==g?(L=m.jsxs("div",{className:"flex flex-col items-center gap-3 w-full",children:[h,g,I]}),e[36]=I,e[37]=h,e[38]=g,e[39]=L):L=e[39],L}function rp(){const t=Q.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsxs(m.Fragment,{children:[m.jsx($e,{className:"h-6 w-20 rounded-full border border-border"}),m.jsx($e,{className:"h-6 w-24 rounded-full border border-border"})]}),t[0]=e):e=t[0],e}function sp(t,e){switch(e.type){case"SELECT_PROMPT":return!e.prompt.arguments||e.prompt.arguments.length===0?{stage:"loading",prompt:e.prompt}:{stage:"collectingArguments",prompt:e.prompt};case"CANCEL":return{stage:"idle"};case"START_LOADING":return{stage:"loading",prompt:e.prompt,arguments:e.arguments};case"RESET":return{stage:"idle"};default:return t}}function ip({gatewayId:t}){const{setInputValue:e}=An(),{data:n}=Z0(t),[r,s]=j.useReducer(sp,{stage:"idle"});if(n.length===0)return null;const i=async(o,d)=>{try{const f=await X0(t,o.name,d),p=tp(f)??o.description??o.name;e(p),s({type:"RESET"})}catch(f){console.error("[ice-breakers] Failed to fetch prompt:",f),Kn.error("Failed to load prompt. Please try again."),s({type:"RESET"})}},a=async o=>{if(o.arguments&&o.arguments.length>0){s({type:"SELECT_PROMPT",prompt:o});return}s({type:"START_LOADING",prompt:o}),await i(o)},u=()=>{s({type:"CANCEL"})},l=async o=>{if(r.stage!=="collectingArguments")return;const{prompt:d}=r;s({type:"START_LOADING",prompt:d,arguments:o}),await i(d,o)};return m.jsx("div",{className:"relative w-full",children:r.stage==="collectingArguments"?m.jsx("div",{className:"animate-in fade-in-0 zoom-in-95 duration-300",children:m.jsx(np,{prompt:r.prompt,onCancel:u,onSubmit:l})},"expanded"):m.jsx("div",{className:"animate-in fade-in-0 zoom-in-95 duration-300",children:m.jsx(K0,{prompts:n,onSelect:a,loadingPrompt:r.stage==="loading"?r.prompt:null})},"list")})}function ap(t){const e=Q.c(8),{className:n}=t,{selectedGateway:r}=An();let s;e[0]!==n?(s=ie("flex flex-wrap items-center justify-center gap-2",n),e[0]=n,e[1]=s):s=e[1];let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i={minHeight:"32px"},e[2]=i):i=e[2];let a;e[3]!==r?(a=r&&m.jsx(Od,{fallback:null,children:m.jsx(j.Suspense,{fallback:m.jsx(rp,{}),children:m.jsx(ip,{gatewayId:r.id})})},r.id),e[3]=r,e[4]=a):a=e[4];let u;return e[5]!==s||e[6]!==a?(u=m.jsx("div",{className:s,style:i,children:a}),e[5]=s,e[6]=a,e[7]=u):u=e[7],u}function up(){const t=Q.c(3),[e,n]=j.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async a=>{await navigator.clipboard.writeText(a),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const s=r;let i;return t[1]!==e?(i={handleCopy:s,copied:e},t[1]=e,t[2]=i):i=t[2],i}function xi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var rn=xi();function el(t){rn=t}var zn={exec:()=>null};function pe(t,e=""){let n=typeof t=="string"?t:t.source;const r={replace:(s,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(Ke.caret,"$1"),n=n.replace(s,a),r},getRegex:()=>new RegExp(n,e)};return r}var Ke={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},op=/^(?:[ \t]*(?:\n|$))+/,lp=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,cp=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,fr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,dp=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_i=/(?:[*+-]|\d{1,9}[.)])/,tl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,nl=pe(tl).replace(/bull/g,_i).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),fp=pe(tl).replace(/bull/g,_i).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),yi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,hp=/^[^\n]+/,Ai=/(?!\s*\])(?:\\.|[^\[\]\\])+/,pp=pe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ai).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),mp=pe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,_i).getRegex(),Wr="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ki=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,gp=pe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ki).replace("tag",Wr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),rl=pe(yi).replace("hr",fr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wr).getRegex(),bp=pe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",rl).getRegex(),Ci={blockquote:bp,code:lp,def:pp,fences:cp,heading:dp,hr:fr,html:gp,lheading:nl,list:mp,newline:op,paragraph:rl,table:zn,text:hp},Na=pe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",fr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wr).getRegex(),Ep={...Ci,lheading:fp,table:Na,paragraph:pe(yi).replace("hr",fr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Na).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wr).getRegex()},Tp={...Ci,html:pe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ki).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:zn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:pe(yi).replace("hr",fr).replace("heading",` *#{1,6} *[^
|
|
22
|
+
]`).replace("lheading",nl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},xp=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,_p=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,sl=/^( {2,}|\\)\n(?!\s*$)/,yp=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Qr=/[\p{P}\p{S}]/u,Ii=/[\s\p{P}\p{S}]/u,il=/[^\s\p{P}\p{S}]/u,Ap=pe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ii).getRegex(),al=/(?!~)[\p{P}\p{S}]/u,kp=/(?!~)[\s\p{P}\p{S}]/u,Cp=/(?:[^\s\p{P}\p{S}]|~)/u,Ip=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,ul=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Np=pe(ul,"u").replace(/punct/g,Qr).getRegex(),Sp=pe(ul,"u").replace(/punct/g,al).getRegex(),ol="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",wp=pe(ol,"gu").replace(/notPunctSpace/g,il).replace(/punctSpace/g,Ii).replace(/punct/g,Qr).getRegex(),Rp=pe(ol,"gu").replace(/notPunctSpace/g,Cp).replace(/punctSpace/g,kp).replace(/punct/g,al).getRegex(),Op=pe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,il).replace(/punctSpace/g,Ii).replace(/punct/g,Qr).getRegex(),Lp=pe(/\\(punct)/,"gu").replace(/punct/g,Qr).getRegex(),vp=pe(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Dp=pe(ki).replace("(?:-->|$)","-->").getRegex(),Pp=pe("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Dp).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Dr=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Mp=pe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Dr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ll=pe(/^!?\[(label)\]\[(ref)\]/).replace("label",Dr).replace("ref",Ai).getRegex(),cl=pe(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ai).getRegex(),Bp=pe("reflink|nolink(?!\\()","g").replace("reflink",ll).replace("nolink",cl).getRegex(),Ni={_backpedal:zn,anyPunctuation:Lp,autolink:vp,blockSkip:Ip,br:sl,code:_p,del:zn,emStrongLDelim:Np,emStrongRDelimAst:wp,emStrongRDelimUnd:Op,escape:xp,link:Mp,nolink:cl,punctuation:Ap,reflink:ll,reflinkSearch:Bp,tag:Pp,text:yp,url:zn},Fp={...Ni,link:pe(/^!?\[(label)\]\((.*?)\)/).replace("label",Dr).getRegex(),reflink:pe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Dr).getRegex()},zs={...Ni,emStrongRDelimAst:Rp,emStrongLDelim:Sp,url:pe(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Up={...zs,br:pe(sl).replace("{2,}","*").getRegex(),text:pe(zs.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Tr={normal:Ci,gfm:Ep,pedantic:Tp},wn={normal:Ni,gfm:zs,breaks:Up,pedantic:Fp},Hp={"&":"&","<":"<",">":">",'"':""","'":"'"},Sa=t=>Hp[t];function yt(t,e){if(e){if(Ke.escapeTest.test(t))return t.replace(Ke.escapeReplace,Sa)}else if(Ke.escapeTestNoEncode.test(t))return t.replace(Ke.escapeReplaceNoEncode,Sa);return t}function wa(t){try{t=encodeURI(t).replace(Ke.percentDecode,"%")}catch{return null}return t}function Ra(t,e){const n=t.replace(Ke.findPipe,(i,a,u)=>{let l=!1,o=a;for(;--o>=0&&u[o]==="\\";)l=!l;return l?"|":" |"}),r=n.split(Ke.splitPipe);let s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(Ke.slashPipe,"|");return r}function Rn(t,e,n){const r=t.length;if(r===0)return"";let s=0;for(;s<r&&t.charAt(r-s-1)===e;)s++;return t.slice(0,r-s)}function jp(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function Oa(t,e,n,r,s){const i=e.href,a=e.title||null,u=t[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;const l={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:u,tokens:r.inlineTokens(u)};return r.state.inLink=!1,l}function zp(t,e,n){const r=t.match(n.other.indentCodeCompensation);if(r===null)return e;const s=r[1];return e.split(`
|
|
23
23
|
`).map(i=>{const a=i.match(n.other.beginningSpace);if(a===null)return i;const[u]=a;return u.length>=s.length?i.slice(s.length):i}).join(`
|
|
24
|
-
`)}var
|
|
24
|
+
`)}var Pr=class{options;rules;lexer;constructor(t){this.options=t||rn}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Rn(n,`
|
|
25
25
|
`)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const n=e[0],r=zp(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){const r=Rn(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Rn(e[0],`
|
|
26
26
|
`)}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let n=Rn(e[0],`
|
|
27
27
|
`).split(`
|
|
@@ -41,9 +41,9 @@ ${d}`:d;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
|
|
|
41
41
|
`,1)[0];let L;if(p=I,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),L=p):L=p.replace(this.rules.other.tabCharGlobal," "),b.test(p)||w.test(p)||R.test(p)||E.test(p)||A.test(p))break;if(L.search(this.rules.other.nonSpaceChar)>=g||!p.trim())d+=`
|
|
42
42
|
`+L.slice(g);else{if(h||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||b.test(f)||w.test(f)||A.test(f))break;d+=`
|
|
43
43
|
`+p}!h&&!p.trim()&&(h=!0),o+=I+`
|
|
44
|
-
`,t=t.substring(I.length+1),f=L.slice(g)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(o)&&(a=!0));let _=null,T;this.options.gfm&&(_=this.rules.other.listIsTask.exec(d),_&&(T=_[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:o,task:!!_,checked:T,loose:!1,text:d,tokens:[]}),s.raw+=o}const u=s.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l=0;l<s.items.length;l++)if(this.lexer.state.top=!1,s.items[l].tokens=this.lexer.blockTokens(s.items[l].text,[]),!s.loose){const o=s.items[l].tokens.filter(f=>f.type==="space"),d=o.length>0&&o.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=d}if(s.loose)for(let l=0;l<s.items.length;l++)s.items[l].loose=!0;return s}}html(t){const e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){const e=this.rules.block.def.exec(t);if(e){const n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:s}}}table(t){const e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const n=
|
|
45
|
-
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const a of r)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<n.length;a++)i.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:i.align[a]});for(const a of s)i.rows.push(
|
|
46
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const i=Rn(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{const i=jp(e[2],"()");if(i===-2)return;if(i>-1){const u=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,u).trim(),e[3]=""}}let r=e[2],s="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),
|
|
44
|
+
`,t=t.substring(I.length+1),f=L.slice(g)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(o)&&(a=!0));let _=null,T;this.options.gfm&&(_=this.rules.other.listIsTask.exec(d),_&&(T=_[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:o,task:!!_,checked:T,loose:!1,text:d,tokens:[]}),s.raw+=o}const u=s.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l=0;l<s.items.length;l++)if(this.lexer.state.top=!1,s.items[l].tokens=this.lexer.blockTokens(s.items[l].text,[]),!s.loose){const o=s.items[l].tokens.filter(f=>f.type==="space"),d=o.length>0&&o.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=d}if(s.loose)for(let l=0;l<s.items.length;l++)s.items[l].loose=!0;return s}}html(t){const e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){const e=this.rules.block.def.exec(t);if(e){const n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:r,title:s}}}table(t){const e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const n=Ra(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
45
|
+
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const a of r)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<n.length;a++)i.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:i.align[a]});for(const a of s)i.rows.push(Ra(a,i.header.length).map((u,l)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:i.align[l]})));return i}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const n=e[1].charAt(e[1].length-1)===`
|
|
46
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const i=Rn(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{const i=jp(e[2],"()");if(i===-2)return;if(i>-1){const u=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,u).trim(),e[3]=""}}let r=e[2],s="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Oa(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){const r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[r.toLowerCase()];if(!s){const i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return Oa(n,s,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const i=[...r[0]].length-1;let a,u,l=i,o=0;const d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+i);(r=d.exec(e))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(u=[...a].length,r[3]||r[4]){l+=u;continue}else if((r[5]||r[6])&&i%3&&!((i+u)%3)){o+=u;continue}if(l-=u,l>0)continue;u=Math.min(u,u+l+o);const f=[...r[0]][0].length,p=t.slice(0,i+r.index+f+u);if(Math.min(i,u)%2){const g=p.slice(1,-1);return{type:"em",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}const h=p.slice(2,-2);return{type:"strong",raw:p,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,r;if(e[2]==="@")n=e[0],r="mailto:"+n;else{let s;do s=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(s!==e[0]);n=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){const n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},Rt=class $s{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||rn,this.options.tokenizer=this.options.tokenizer||new Pr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={other:Ke,block:Tr.normal,inline:wn.normal};this.options.pedantic?(n.block=Tr.pedantic,n.inline=wn.pedantic):this.options.gfm&&(n.block=Tr.gfm,this.options.breaks?n.inline=wn.breaks:n.inline=wn.gfm),this.tokenizer.rules=n}static get rules(){return{block:Tr,inline:wn}}static lex(e,n){return new $s(n).lex(e)}static lexInline(e,n){return new $s(n).inlineTokens(e)}lex(e){e=e.replace(Ke.carriageReturn,`
|
|
47
47
|
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){for(this.options.pedantic&&(e=e.replace(Ke.tabCharGlobal," ").replace(Ke.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(a=>(s=a.call({lexer:this},e,n))?(e=e.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);const a=n.at(-1);s.raw.length===1&&a!==void 0?a.raw+=`
|
|
48
48
|
`:n.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);const a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=`
|
|
49
49
|
`+s.raw,a.text+=`
|
|
@@ -53,7 +53,7 @@ ${d}`:d;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
|
|
|
53
53
|
`+s.raw,a.text+=`
|
|
54
54
|
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(s),r=i.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);const a=n.at(-1);a?.type==="text"?(a.raw+=`
|
|
55
55
|
`+s.raw,a.text+=`
|
|
56
|
-
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(s);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let r=e,s=null;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)u.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a="";for(;e;){i||(a=""),i=!1;let u;if(this.options.extensions?.inline?.some(o=>(u=o.call({lexer:this},e,n))?(e=e.substring(u.raw.length),n.push(u),!0):!1))continue;if(u=this.tokenizer.escape(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.tag(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.link(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(u.raw.length);const o=n.at(-1);u.type==="text"&&o?.type==="text"?(o.raw+=u.raw,o.text+=u.text):n.push(u);continue}if(u=this.tokenizer.emStrong(e,r,a)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.codespan(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.br(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.del(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.autolink(e)){e=e.substring(u.raw.length),n.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(e))){e=e.substring(u.raw.length),n.push(u);continue}let l=e;if(this.options.extensions?.startInline){let o=1/0;const d=e.slice(1);let f;this.options.extensions.startInline.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(o=Math.min(o,f))}),o<1/0&&o>=0&&(l=e.substring(0,o+1))}if(u=this.tokenizer.inlineText(l)){e=e.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(a=u.raw.slice(-1)),i=!0;const o=n.at(-1);o?.type==="text"?(o.raw+=u.raw,o.text+=u.text):n.push(u);continue}if(e){const o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return n}},
|
|
56
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(s);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let r=e,s=null;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)u.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a="";for(;e;){i||(a=""),i=!1;let u;if(this.options.extensions?.inline?.some(o=>(u=o.call({lexer:this},e,n))?(e=e.substring(u.raw.length),n.push(u),!0):!1))continue;if(u=this.tokenizer.escape(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.tag(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.link(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(u.raw.length);const o=n.at(-1);u.type==="text"&&o?.type==="text"?(o.raw+=u.raw,o.text+=u.text):n.push(u);continue}if(u=this.tokenizer.emStrong(e,r,a)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.codespan(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.br(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.del(e)){e=e.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.autolink(e)){e=e.substring(u.raw.length),n.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(e))){e=e.substring(u.raw.length),n.push(u);continue}let l=e;if(this.options.extensions?.startInline){let o=1/0;const d=e.slice(1);let f;this.options.extensions.startInline.forEach(p=>{f=p.call({lexer:this},d),typeof f=="number"&&f>=0&&(o=Math.min(o,f))}),o<1/0&&o>=0&&(l=e.substring(0,o+1))}if(u=this.tokenizer.inlineText(l)){e=e.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(a=u.raw.slice(-1)),i=!0;const o=n.at(-1);o?.type==="text"?(o.raw+=u.raw,o.text+=u.text):n.push(u);continue}if(e){const o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return n}},Mr=class{options;parser;constructor(t){this.options=t||rn}space(t){return""}code({text:t,lang:e,escaped:n}){const r=(e||"").match(Ke.notSpaceStart)?.[0],s=t.replace(Ke.endingNewline,"")+`
|
|
57
57
|
`;return r?'<pre><code class="language-'+yt(r)+'">'+(n?s:yt(s,!0))+`</code></pre>
|
|
58
58
|
`:"<pre><code>"+(n?s:yt(s,!0))+`</code></pre>
|
|
59
59
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
@@ -71,37 +71,37 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
71
71
|
`}tablerow({text:t}){return`<tr>
|
|
72
72
|
${t}</tr>
|
|
73
73
|
`}tablecell(t){const e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
74
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${yt(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){const r=this.parser.parseInline(n),s=
|
|
75
|
-
`+this.renderer.text(u);n?r+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):r+=l;continue}default:{const u='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}parseInline(e,n=this.renderer){let r="";for(let s=0;s<e.length;s++){const i=e[s];if(this.options.extensions?.renderers?.[i.type]){const u=this.options.extensions.renderers[i.type].call({parser:this},i);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=u||"";continue}}const a=i;switch(a.type){case"escape":{r+=n.text(a);break}case"html":{r+=n.html(a);break}case"link":{r+=n.link(a);break}case"image":{r+=n.image(a);break}case"strong":{r+=n.strong(a);break}case"em":{r+=n.em(a);break}case"codespan":{r+=n.codespan(a);break}case"br":{r+=n.br(a);break}case"del":{r+=n.del(a);break}case"text":{r+=n.text(a);break}default:{const u='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},Sr=class{options;block;constructor(t){this.options=t||rn}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Rt.lex:Rt.lexInline}provideParser(){return this.block?Ot.parse:Ot.parseInline}},$p=class{defaults=
|
|
76
|
-
Please report this to https://github.com/markedjs/marked.`,t){const r="<p>An error occurred:</p><pre>"+yt(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},tn=new $p;function ge(t,e){return tn.parse(t,e)}ge.options=ge.setOptions=function(t){return tn.setOptions(t),ge.defaults=tn.defaults,el(ge.defaults),ge};ge.getDefaults=_i;ge.defaults=rn;ge.use=function(...t){return tn.use(...t),ge.defaults=tn.defaults,el(ge.defaults),ge};ge.walkTokens=function(t,e){return tn.walkTokens(t,e)};ge.parseInline=tn.parseInline;ge.Parser=Ot;ge.parser=Ot.parse;ge.Renderer=Br;ge.TextRenderer=wi;ge.Lexer=Rt;ge.lexer=Rt.lex;ge.Tokenizer=Mr;ge.Hooks=Sr;ge.parse=ge;ge.options;ge.setOptions;ge.use;ge.walkTokens;ge.parseInline;Ot.parse;Rt.lex;function va(t){const e=[],n=String(t||"");let r=n.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const a=n.slice(s,r).trim();(a||!i)&&e.push(a),s=r+1,r=n.indexOf(",",s)}return e}function dl(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Yp=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qp=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vp={};function Da(t,e){return(Vp.jsx?qp:Yp).test(t)}const Gp=/[ \t\n\f\r]/g;function Wp(t){return typeof t=="object"?t.type==="text"?Pa(t.value):!1:Pa(t)}function Pa(t){return t.replace(Gp,"")===""}class hr{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}hr.prototype.normal={};hr.prototype.property={};hr.prototype.space=void 0;function fl(t,e){const n={},r={};for(const s of t)Object.assign(n,s.property),Object.assign(r,s.normal);return new hr(n,r,e)}function nr(t){return t.toLowerCase()}class rt{constructor(e,n){this.attribute=n,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;let Qp=0;const se=sn(),Le=sn(),qs=sn(),z=sn(),_e=sn(),mn=sn(),ot=sn();function sn(){return 2**++Qp}const Vs=Object.freeze(Object.defineProperty({__proto__:null,boolean:se,booleanish:Le,commaOrSpaceSeparated:ot,commaSeparated:mn,number:z,overloadedBoolean:qs,spaceSeparated:_e},Symbol.toStringTag,{value:"Module"})),ps=Object.keys(Vs);class Ri extends rt{constructor(e,n,r,s){let i=-1;if(super(e,n),Ma(this,"space",s),typeof r=="number")for(;++i<ps.length;){const a=ps[i];Ma(this,ps[i],(r&Vs[a])===Vs[a])}}}Ri.prototype.defined=!0;function Ma(t,e,n){n&&(t[e]=n)}function kn(t){const e={},n={};for(const[r,s]of Object.entries(t.properties)){const i=new Ri(r,t.transform(t.attributes||{},r),s,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),e[r]=i,n[nr(r)]=r,n[nr(i.attribute)]=r}return new hr(e,n,t.space)}const hl=kn({properties:{ariaActiveDescendant:null,ariaAtomic:Le,ariaAutoComplete:null,ariaBusy:Le,ariaChecked:Le,ariaColCount:z,ariaColIndex:z,ariaColSpan:z,ariaControls:_e,ariaCurrent:null,ariaDescribedBy:_e,ariaDetails:null,ariaDisabled:Le,ariaDropEffect:_e,ariaErrorMessage:null,ariaExpanded:Le,ariaFlowTo:_e,ariaGrabbed:Le,ariaHasPopup:null,ariaHidden:Le,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_e,ariaLevel:z,ariaLive:null,ariaModal:Le,ariaMultiLine:Le,ariaMultiSelectable:Le,ariaOrientation:null,ariaOwns:_e,ariaPlaceholder:null,ariaPosInSet:z,ariaPressed:Le,ariaReadOnly:Le,ariaRelevant:null,ariaRequired:Le,ariaRoleDescription:_e,ariaRowCount:z,ariaRowIndex:z,ariaRowSpan:z,ariaSelected:Le,ariaSetSize:z,ariaSort:null,ariaValueMax:z,ariaValueMin:z,ariaValueNow:z,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function pl(t,e){return e in t?t[e]:e}function ml(t,e){return pl(t,e.toLowerCase())}const Xp=kn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:mn,acceptCharset:_e,accessKey:_e,action:null,allow:null,allowFullScreen:se,allowPaymentRequest:se,allowUserMedia:se,alt:null,as:null,async:se,autoCapitalize:null,autoComplete:_e,autoFocus:se,autoPlay:se,blocking:_e,capture:null,charSet:null,checked:se,cite:null,className:_e,cols:z,colSpan:null,content:null,contentEditable:Le,controls:se,controlsList:_e,coords:z|mn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:se,defer:se,dir:null,dirName:null,disabled:se,download:qs,draggable:Le,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:se,formTarget:null,headers:_e,height:z,hidden:qs,high:z,href:null,hrefLang:null,htmlFor:_e,httpEquiv:_e,id:null,imageSizes:null,imageSrcSet:null,inert:se,inputMode:null,integrity:null,is:null,isMap:se,itemId:null,itemProp:_e,itemRef:_e,itemScope:se,itemType:_e,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:se,low:z,manifest:null,max:null,maxLength:z,media:null,method:null,min:null,minLength:z,multiple:se,muted:se,name:null,nonce:null,noModule:se,noValidate:se,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:se,optimum:z,pattern:null,ping:_e,placeholder:null,playsInline:se,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:se,referrerPolicy:null,rel:_e,required:se,reversed:se,rows:z,rowSpan:z,sandbox:_e,scope:null,scoped:se,seamless:se,selected:se,shadowRootClonable:se,shadowRootDelegatesFocus:se,shadowRootMode:null,shape:null,size:z,sizes:null,slot:null,span:z,spellCheck:Le,src:null,srcDoc:null,srcLang:null,srcSet:null,start:z,step:null,style:null,tabIndex:z,target:null,title:null,translate:null,type:null,typeMustMatch:se,useMap:null,value:Le,width:z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_e,axis:null,background:null,bgColor:null,border:z,borderColor:null,bottomMargin:z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:se,declare:se,event:null,face:null,frame:null,frameBorder:null,hSpace:z,leftMargin:z,link:null,longDesc:null,lowSrc:null,marginHeight:z,marginWidth:z,noResize:se,noHref:se,noShade:se,noWrap:se,object:null,profile:null,prompt:null,rev:null,rightMargin:z,rules:null,scheme:null,scrolling:Le,standby:null,summary:null,text:null,topMargin:z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:se,disableRemotePlayback:se,prefix:null,property:null,results:z,security:null,unselectable:null},space:"html",transform:ml}),Zp=kn({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:ot,accentHeight:z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:z,amplitude:z,arabicForm:null,ascent:z,attributeName:null,attributeType:null,azimuth:z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:z,by:null,calcMode:null,capHeight:z,className:_e,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:z,diffuseConstant:z,direction:null,display:null,dur:null,divisor:z,dominantBaseline:null,download:se,dx:null,dy:null,edgeMode:null,editable:null,elevation:z,enableBackground:null,end:null,event:null,exponent:z,externalResourcesRequired:null,fill:null,fillOpacity:z,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:mn,g2:mn,glyphName:mn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:z,horizOriginX:z,horizOriginY:z,id:null,ideographic:z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:z,k:z,k1:z,k2:z,k3:z,k4:z,kernelMatrix:ot,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:z,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:z,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:z,overlineThickness:z,paintOrder:null,panose1:null,path:null,pathLength:z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_e,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:z,pointsAtY:z,pointsAtZ:z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ot,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ot,rev:ot,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ot,requiredFeatures:ot,requiredFonts:ot,requiredFormats:ot,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:z,specularExponent:z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:z,strikethroughThickness:z,string:null,stroke:null,strokeDashArray:ot,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:z,strokeOpacity:z,strokeWidth:null,style:null,surfaceScale:z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ot,tabIndex:z,tableValues:null,target:null,targetX:z,targetY:z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ot,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:z,underlineThickness:z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:z,values:null,vAlphabetic:z,vMathematical:z,vectorEffect:null,vHanging:z,vIdeographic:z,version:null,vertAdvY:z,vertOriginX:z,vertOriginY:z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:pl}),gl=kn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),bl=kn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ml}),El=kn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),Kp={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"},Jp=/[A-Z]/g,Ba=/-[a-z]/g,em=/^data[-\w.:]+$/i;function Zr(t,e){const n=nr(e);let r=e,s=rt;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&em.test(e)){if(e.charAt(4)==="-"){const i=e.slice(5).replace(Ba,nm);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=e.slice(4);if(!Ba.test(i)){let a=i.replace(Jp,tm);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}s=Ri}return new s(r,e)}function tm(t){return"-"+t.toLowerCase()}function nm(t){return t.charAt(1).toUpperCase()}const pr=fl([hl,Xp,gl,bl,El],"html"),$t=fl([hl,Zp,gl,bl,El],"svg");function Fa(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function Tl(t){return t.join(" ").trim()}var ln={},ms,Ua;function rm(){if(Ua)return ms;Ua=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,u=/^\s+|\s+$/g,l=`
|
|
77
|
-
`,o="/",d="*",f="",p="comment",h="declaration";function g(T,E){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];E=E||{};var A=1,b=1;function w(q){var U=q.match(e);U&&(A+=U.length);var W=q.lastIndexOf(l);b=~W?q.length-W:b+q.length}function R(){var q={line:A,column:b};return function(U){return U.position=new I(q),P(),U}}function I(q){this.start=q,this.end={line:A,column:b},this.source=E.source}I.prototype.content=T;function L(q){var U=new Error(E.source+":"+A+":"+b+": "+q);if(U.reason=q,U.filename=E.source,U.line=A,U.column=b,U.source=T,!E.silent)throw U}function M(q){var U=q.exec(T);if(U){var W=U[0];return w(W),T=T.slice(W.length),U}}function P(){M(n)}function S(q){var U;for(q=q||[];U=B();)U!==!1&&q.push(U);return q}function B(){var q=R();if(!(o!=T.charAt(0)||d!=T.charAt(1))){for(var U=2;f!=T.charAt(U)&&(d!=T.charAt(U)||o!=T.charAt(U+1));)++U;if(U+=2,f===T.charAt(U-1))return L("End of comment missing");var W=T.slice(2,U-2);return b+=2,w(W),T=T.slice(U),b+=2,q({type:p,comment:W})}}function $(){var q=R(),U=M(r);if(U){if(B(),!M(s))return L("property missing ':'");var W=M(i),V=q({type:h,property:_(U[0].replace(t,f)),value:W?_(W[0].replace(t,f)):f});return M(a),V}}function X(){var q=[];S(q);for(var U;U=$();)U!==!1&&(q.push(U),S(q));return q}return P(),X()}function _(T){return T?T.replace(u,f):f}return ms=g,ms}var Ha;function sm(){if(Ha)return ln;Ha=1;var t=ln&&ln.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ln,"__esModule",{value:!0}),ln.default=n;const e=t(rm());function n(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,e.default)(r),u=typeof s=="function";return a.forEach(l=>{if(l.type!=="declaration")return;const{property:o,value:d}=l;u?s(o,d,l):d&&(i=i||{},i[o]=d)}),i}return ln}var On={},ja;function im(){if(ja)return On;ja=1,Object.defineProperty(On,"__esModule",{value:!0}),On.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(o){return!o||n.test(o)||t.test(o)},a=function(o,d){return d.toUpperCase()},u=function(o,d){return"".concat(d,"-")},l=function(o,d){return d===void 0&&(d={}),i(o)?o:(o=o.toLowerCase(),d.reactCompat?o=o.replace(s,u):o=o.replace(r,u),o.replace(e,a))};return On.camelCase=l,On}var Ln,za;function am(){if(za)return Ln;za=1;var t=Ln&&Ln.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},e=t(sm()),n=im();function r(s,i){var a={};return!s||typeof s!="string"||(0,e.default)(s,function(u,l){u&&l&&(a[(0,n.camelCase)(u,i)]=l)}),a}return r.default=r,Ln=r,Ln}var um=am();const om=ai(um),Kr=xl("end"),It=xl("start");function xl(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function lm(t){const e=It(t),n=Kr(t);if(e&&n)return{start:e,end:n}}function $n(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?$a(t.position):"start"in t||"end"in t?$a(t):"line"in t||"column"in t?Gs(t):""}function Gs(t){return Ya(t&&t.line)+":"+Ya(t&&t.column)}function $a(t){return Gs(t&&t.start)+"-"+Gs(t&&t.end)}function Ya(t){return t&&typeof t=="number"?t:1}class qe extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof e=="string"?s=e:!i.cause&&e&&(a=!0,s=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const u=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=u?u.line:void 0,this.name=$n(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}qe.prototype.file="";qe.prototype.name="";qe.prototype.reason="";qe.prototype.message="";qe.prototype.stack="";qe.prototype.column=void 0;qe.prototype.line=void 0;qe.prototype.ancestors=void 0;qe.prototype.cause=void 0;qe.prototype.fatal=void 0;qe.prototype.place=void 0;qe.prototype.ruleId=void 0;qe.prototype.source=void 0;const Oi={}.hasOwnProperty,cm=new Map,dm=/[A-Z]/g,fm=new Set(["table","tbody","thead","tfoot","tr"]),hm=new Set(["td","th"]),_l="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function pm(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=ym(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=_m(n,e.jsx,e.jsxs)}const s={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?$t:pr,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},i=yl(s,t,void 0);return i&&typeof i!="string"?i:s.create(t,s.Fragment,{children:i||void 0},void 0)}function yl(t,e,n){if(e.type==="element")return mm(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return gm(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Em(t,e,n);if(e.type==="mdxjsEsm")return bm(t,e);if(e.type==="root")return Tm(t,e,n);if(e.type==="text")return xm(t,e)}function mm(t,e,n){const r=t.schema;let s=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=$t,t.schema=s),t.ancestors.push(e);const i=kl(t,e.tagName,!1),a=Am(t,e);let u=vi(t,e);return fm.has(e.tagName)&&(u=u.filter(function(l){return typeof l=="string"?!Wp(l):!0})),Al(t,a,i,e),Li(a,u),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function gm(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}rr(t,e.position)}function bm(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);rr(t,e.position)}function Em(t,e,n){const r=t.schema;let s=r;e.name==="svg"&&r.space==="html"&&(s=$t,t.schema=s),t.ancestors.push(e);const i=e.name===null?t.Fragment:kl(t,e.name,!0),a=km(t,e),u=vi(t,e);return Al(t,a,i,e),Li(a,u),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function Tm(t,e,n){const r={};return Li(r,vi(t,e)),t.create(e,t.Fragment,r,n)}function xm(t,e){return e.value}function Al(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function Li(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function _m(t,e,n){return r;function r(s,i,a,u){const o=Array.isArray(a.children)?n:e;return u?o(i,a,u):o(i,a)}}function ym(t,e){return n;function n(r,s,i,a){const u=Array.isArray(i.children),l=It(r);return e(s,i,a,u,{columnNumber:l?l.column-1:void 0,fileName:t,lineNumber:l?l.line:void 0},void 0)}}function Am(t,e){const n={};let r,s;for(s in e.properties)if(s!=="children"&&Oi.call(e.properties,s)){const i=Cm(t,s,e.properties[s]);if(i){const[a,u]=i;t.tableCellAlignToStyle&&a==="align"&&typeof u=="string"&&hm.has(e.tagName)?r=u:n[a]=u}}if(r){const i=n.style||(n.style={});i[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function km(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const u=a.properties[0];u.type,Object.assign(n,t.evaluater.evaluateExpression(u.argument))}else rr(t,e.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const u=r.value.data.estree.body[0];u.type,i=t.evaluater.evaluateExpression(u.expression)}else rr(t,e.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function vi(t,e){const n=[];let r=-1;const s=t.passKeys?new Map:cm;for(;++r<e.children.length;){const i=e.children[r];let a;if(t.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const o=s.get(l)||0;a=l+"-"+o,s.set(l,o+1)}}const u=yl(t,i,a);u!==void 0&&n.push(u)}return n}function Cm(t,e,n){const r=Zr(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?dl(n):Tl(n)),r.property==="style"){let s=typeof n=="object"?n:Im(t,String(n));return t.stylePropertyNameCase==="css"&&(s=Nm(s)),["style",s]}return[t.elementAttributeNameCase==="react"&&r.space?Kp[r.property]||r.property:r.attribute,n]}}function Im(t,e){try{return om(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,s=new qe("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=t.filePath||void 0,s.url=_l+"#cannot-parse-style-attribute",s}}function kl(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const s=e.split(".");let i=-1,a;for(;++i<s.length;){const u=Da(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};a=a?{type:"MemberExpression",object:a,property:u,computed:!!(i&&u.type==="Literal"),optional:!1}:u}r=a}else r=Da(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const s=r.value;return Oi.call(t.components,s)?t.components[s]:s}if(t.evaluater)return t.evaluater.evaluateExpression(r);rr(t)}function rr(t,e){const n=new qe("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=_l+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Nm(t){const e={};let n;for(n in t)Oi.call(t,n)&&(e[Sm(n)]=t[n]);return e}function Sm(t){let e=t.replace(dm,wm);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function wm(t){return"-"+t.toLowerCase()}const gs={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Rm={};function Di(t,e){const n=Rm,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Cl(t,r,s)}function Cl(t,e,n){if(Om(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return qa(t.children,e,n)}return Array.isArray(t)?qa(t,e,n):""}function qa(t,e,n){const r=[];let s=-1;for(;++s<t.length;)r[s]=Cl(t[s],e,n);return r.join("")}function Om(t){return!!(t&&typeof t=="object")}const Va=document.createElement("i");function Pi(t){const e="&"+t+";";Va.innerHTML=e;const n=Va.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function lt(t,e,n,r){const s=t.length;let i=0,a;if(e<0?e=-e>s?0:s+e:e=e>s?s:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);i<r.length;)a=r.slice(i,i+1e4),a.unshift(e,0),t.splice(...a),i+=1e4,e+=1e4}function ht(t,e){return t.length>0?(lt(t,t.length,0,e),t):e}const Ga={}.hasOwnProperty;function Il(t){const e={};let n=-1;for(;++n<t.length;)Lm(e,t[n]);return e}function Lm(t,e){let n;for(n in e){const s=(Ga.call(t,n)?t[n]:void 0)||(t[n]={}),i=e[n];let a;if(i)for(a in i){Ga.call(s,a)||(s[a]=[]);const u=i[a];vm(s[a],Array.isArray(u)?u:u?[u]:[])}}}function vm(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);lt(t,0,0,r)}function Nl(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function bt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ze=Yt(/[A-Za-z]/),Ye=Yt(/[\dA-Za-z]/),Dm=Yt(/[#-'*+\--9=?A-Z^-~]/);function Fr(t){return t!==null&&(t<32||t===127)}const Ws=Yt(/\d/),Pm=Yt(/[\dA-Fa-f]/),Mm=Yt(/[!-/:-@[-`{-~]/);function ee(t){return t!==null&&t<-2}function xe(t){return t!==null&&(t<0||t===32)}function oe(t){return t===-2||t===-1||t===32}const Jr=Yt(new RegExp("\\p{P}|\\p{S}","u")),nn=Yt(/\s/);function Yt(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Cn(t){const e=[];let n=-1,r=0,s=0;for(;++n<t.length;){const i=t.charCodeAt(n);let a="";if(i===37&&Ye(t.charCodeAt(n+1))&&Ye(t.charCodeAt(n+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const u=t.charCodeAt(n+1);i<56320&&u>56319&&u<57344?(a=String.fromCharCode(i,u),s=1):a="�"}else a=String.fromCharCode(i);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return e.join("")+t.slice(r)}function de(t,e,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return oe(l)?(t.enter(n),u(l)):e(l)}function u(l){return oe(l)&&i++<s?(t.consume(l),u):(t.exit(n),e(l))}}const Bm={tokenize:Fm};function Fm(t){const e=t.attempt(this.parser.constructs.contentInitial,r,s);let n;return e;function r(u){if(u===null){t.consume(u);return}return t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),de(t,e,"linePrefix")}function s(u){return t.enter("paragraph"),i(u)}function i(u){const l=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(u)}function a(u){if(u===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(u);return}return ee(u)?(t.consume(u),t.exit("chunkText"),i):(t.consume(u),a)}}const Um={tokenize:Hm},Wa={tokenize:jm};function Hm(t){const e=this,n=[];let r=0,s,i,a;return u;function u(b){if(r<n.length){const w=n[r];return e.containerState=w[1],t.attempt(w[0].continuation,l,o)(b)}return o(b)}function l(b){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,s&&A();const w=e.events.length;let R=w,I;for(;R--;)if(e.events[R][0]==="exit"&&e.events[R][1].type==="chunkFlow"){I=e.events[R][1].end;break}E(r);let L=w;for(;L<e.events.length;)e.events[L][1].end={...I},L++;return lt(e.events,R+1,0,e.events.slice(w)),e.events.length=L,o(b)}return u(b)}function o(b){if(r===n.length){if(!s)return p(b);if(s.currentConstruct&&s.currentConstruct.concrete)return g(b);e.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Wa,d,f)(b)}function d(b){return s&&A(),E(r),p(b)}function f(b){return e.parser.lazy[e.now().line]=r!==n.length,a=e.now().offset,g(b)}function p(b){return e.containerState={},t.attempt(Wa,h,g)(b)}function h(b){return r++,n.push([e.currentConstruct,e.containerState]),p(b)}function g(b){if(b===null){s&&A(),E(0),t.consume(b);return}return s=s||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),_(b)}function _(b){if(b===null){T(t.exit("chunkFlow"),!0),E(0),t.consume(b);return}return ee(b)?(t.consume(b),T(t.exit("chunkFlow")),r=0,e.interrupt=void 0,u):(t.consume(b),_)}function T(b,w){const R=e.sliceStream(b);if(w&&R.push(null),b.previous=i,i&&(i.next=b),i=b,s.defineSkip(b.start),s.write(R),e.parser.lazy[b.start.line]){let I=s.events.length;for(;I--;)if(s.events[I][1].start.offset<a&&(!s.events[I][1].end||s.events[I][1].end.offset>a))return;const L=e.events.length;let M=L,P,S;for(;M--;)if(e.events[M][0]==="exit"&&e.events[M][1].type==="chunkFlow"){if(P){S=e.events[M][1].end;break}P=!0}for(E(r),I=L;I<e.events.length;)e.events[I][1].end={...S},I++;lt(e.events,M+1,0,e.events.slice(L)),e.events.length=I}}function E(b){let w=n.length;for(;w-- >b;){const R=n[w];e.containerState=R[1],R[0].exit.call(e,t)}n.length=b}function A(){s.write([null]),i=void 0,s=void 0,e.containerState._closeFlow=void 0}}function jm(t,e,n){return de(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function bn(t){if(t===null||xe(t)||nn(t))return 1;if(Jr(t))return 2}function es(t,e,n){const r=[];let s=-1;for(;++s<t.length;){const i=t[s].resolveAll;i&&!r.includes(i)&&(e=i(e,n),r.push(i))}return e}const Qs={name:"attention",resolveAll:zm,tokenize:$m};function zm(t,e){let n=-1,r,s,i,a,u,l,o,d;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;l=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f={...t[r][1].end},p={...t[n][1].start};Qa(f,-l),Qa(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...t[r][1].end}},u={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...u.end}},t[r][1].end={...a.start},t[n][1].start={...u.end},o=[],t[r][1].end.offset-t[r][1].start.offset&&(o=ht(o,[["enter",t[r][1],e],["exit",t[r][1],e]])),o=ht(o,[["enter",s,e],["enter",a,e],["exit",a,e],["enter",i,e]]),o=ht(o,es(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),o=ht(o,[["exit",i,e],["enter",u,e],["exit",u,e],["exit",s,e]]),t[n][1].end.offset-t[n][1].start.offset?(d=2,o=ht(o,[["enter",t[n][1],e],["exit",t[n][1],e]])):d=0,lt(t,r-1,n-r+3,o),n=r+o.length-d-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function $m(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=bn(r);let i;return a;function a(l){return i=l,t.enter("attentionSequence"),u(l)}function u(l){if(l===i)return t.consume(l),u;const o=t.exit("attentionSequence"),d=bn(l),f=!d||d===2&&s||n.includes(l),p=!s||s===2&&d||n.includes(r);return o._open=!!(i===42?f:f&&(s||!p)),o._close=!!(i===42?p:p&&(d||!f)),e(l)}}function Qa(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const Ym={name:"autolink",tokenize:qm};function qm(t,e,n){let r=0;return s;function s(h){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),i}function i(h){return Ze(h)?(t.consume(h),a):h===64?n(h):o(h)}function a(h){return h===43||h===45||h===46||Ye(h)?(r=1,u(h)):o(h)}function u(h){return h===58?(t.consume(h),r=0,l):(h===43||h===45||h===46||Ye(h))&&r++<32?(t.consume(h),u):(r=0,o(h))}function l(h){return h===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.exit("autolink"),e):h===null||h===32||h===60||Fr(h)?n(h):(t.consume(h),l)}function o(h){return h===64?(t.consume(h),d):Dm(h)?(t.consume(h),o):n(h)}function d(h){return Ye(h)?f(h):n(h)}function f(h){return h===46?(t.consume(h),r=0,d):h===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.exit("autolink"),e):p(h)}function p(h){if((h===45||Ye(h))&&r++<63){const g=h===45?p:f;return t.consume(h),g}return n(h)}}const mr={partial:!0,tokenize:Vm};function Vm(t,e,n){return r;function r(i){return oe(i)?de(t,s,"linePrefix")(i):s(i)}function s(i){return i===null||ee(i)?e(i):n(i)}}const Sl={continuation:{tokenize:Wm},exit:Qm,name:"blockQuote",tokenize:Gm};function Gm(t,e,n){const r=this;return s;function s(a){if(a===62){const u=r.containerState;return u.open||(t.enter("blockQuote",{_container:!0}),u.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),i}return n(a)}function i(a){return oe(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function Wm(t,e,n){const r=this;return s;function s(a){return oe(a)?de(t,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return t.attempt(Sl,e,n)(a)}}function Qm(t){t.exit("blockQuote")}const wl={name:"characterEscape",tokenize:Xm};function Xm(t,e,n){return r;function r(i){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(i),t.exit("escapeMarker"),s}function s(i){return Mm(i)?(t.enter("characterEscapeValue"),t.consume(i),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(i)}}const Rl={name:"characterReference",tokenize:Zm};function Zm(t,e,n){const r=this;let s=0,i,a;return u;function u(f){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),l}function l(f){return f===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(f),t.exit("characterReferenceMarkerNumeric"),o):(t.enter("characterReferenceValue"),i=31,a=Ye,d(f))}function o(f){return f===88||f===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(f),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),i=6,a=Pm,d):(t.enter("characterReferenceValue"),i=7,a=Ws,d(f))}function d(f){if(f===59&&s){const p=t.exit("characterReferenceValue");return a===Ye&&!Pi(r.sliceSerialize(p))?n(f):(t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(f)&&s++<i?(t.consume(f),d):n(f)}}const Xa={partial:!0,tokenize:Jm},Za={concrete:!0,name:"codeFenced",tokenize:Km};function Km(t,e,n){const r=this,s={partial:!0,tokenize:R};let i=0,a=0,u;return l;function l(I){return o(I)}function o(I){const L=r.events[r.events.length-1];return i=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,u=I,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),d(I)}function d(I){return I===u?(a++,t.consume(I),d):a<3?n(I):(t.exit("codeFencedFenceSequence"),oe(I)?de(t,f,"whitespace")(I):f(I))}function f(I){return I===null||ee(I)?(t.exit("codeFencedFence"),r.interrupt?e(I):t.check(Xa,_,w)(I)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(I))}function p(I){return I===null||ee(I)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(I)):oe(I)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),de(t,h,"whitespace")(I)):I===96&&I===u?n(I):(t.consume(I),p)}function h(I){return I===null||ee(I)?f(I):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),g(I))}function g(I){return I===null||ee(I)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),f(I)):I===96&&I===u?n(I):(t.consume(I),g)}function _(I){return t.attempt(s,w,T)(I)}function T(I){return t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),E}function E(I){return i>0&&oe(I)?de(t,A,"linePrefix",i+1)(I):A(I)}function A(I){return I===null||ee(I)?t.check(Xa,_,w)(I):(t.enter("codeFlowValue"),b(I))}function b(I){return I===null||ee(I)?(t.exit("codeFlowValue"),A(I)):(t.consume(I),b)}function w(I){return t.exit("codeFenced"),e(I)}function R(I,L,M){let P=0;return S;function S(U){return I.enter("lineEnding"),I.consume(U),I.exit("lineEnding"),B}function B(U){return I.enter("codeFencedFence"),oe(U)?de(I,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):$(U)}function $(U){return U===u?(I.enter("codeFencedFenceSequence"),X(U)):M(U)}function X(U){return U===u?(P++,I.consume(U),X):P>=a?(I.exit("codeFencedFenceSequence"),oe(U)?de(I,q,"whitespace")(U):q(U)):M(U)}function q(U){return U===null||ee(U)?(I.exit("codeFencedFence"),L(U)):M(U)}}}function Jm(t,e,n){const r=this;return s;function s(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const bs={name:"codeIndented",tokenize:t1},e1={partial:!0,tokenize:n1};function t1(t,e,n){const r=this;return s;function s(o){return t.enter("codeIndented"),de(t,i,"linePrefix",5)(o)}function i(o){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(o):n(o)}function a(o){return o===null?l(o):ee(o)?t.attempt(e1,a,l)(o):(t.enter("codeFlowValue"),u(o))}function u(o){return o===null||ee(o)?(t.exit("codeFlowValue"),a(o)):(t.consume(o),u)}function l(o){return t.exit("codeIndented"),e(o)}}function n1(t,e,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):ee(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):de(t,i,"linePrefix",5)(a)}function i(a){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(a):ee(a)?s(a):n(a)}}const r1={name:"codeText",previous:i1,resolve:s1,tokenize:a1};function s1(t){let e=t.length-4,n=3,r,s;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)s===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(s=r):(r===e||t[r][1].type==="lineEnding")&&(t[s][1].type="codeTextData",r!==s+2&&(t[s][1].end=t[r-1][1].end,t.splice(s+2,r-s-2),e-=r-s-2,r=s+2),s=void 0);return t}function i1(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function a1(t,e,n){let r=0,s,i;return a;function a(f){return t.enter("codeText"),t.enter("codeTextSequence"),u(f)}function u(f){return f===96?(t.consume(f),r++,u):(t.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(t.enter("space"),t.consume(f),t.exit("space"),l):f===96?(i=t.enter("codeTextSequence"),s=0,d(f)):ee(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),l):(t.enter("codeTextData"),o(f))}function o(f){return f===null||f===32||f===96||ee(f)?(t.exit("codeTextData"),l(f)):(t.consume(f),o)}function d(f){return f===96?(t.consume(f),s++,d):s===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(f)):(i.type="codeTextData",o(f))}}class u1{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const s=n||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&vn(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),vn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),vn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);vn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);vn(this.left,n.reverse())}}}function vn(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function Ol(t){const e={};let n=-1,r,s,i,a,u,l,o;const d=new u1(t);for(;++n<d.length;){for(;n in e;)n=e[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,o1(d,n)),n=e[n],o=!0);else if(r[1]._container){for(i=n,s=void 0;i--;)if(a=d.get(i),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(s&&(d.get(s)[1].type="lineEndingBlank"),a[1].type="lineEnding",s=i);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;s&&(r[1].end={...d.get(s)[1].start},u=d.slice(s,n),u.unshift(r),d.splice(s,n-s+1,u))}}return lt(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!o}function o1(t,e){const n=t.get(e)[1],r=t.get(e)[2];let s=e-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const u=a.events,l=[],o={};let d,f,p=-1,h=n,g=0,_=0;const T=[_];for(;h;){for(;t.get(++s)[1]!==h;);i.push(s),h._tokenizer||(d=r.sliceStream(h),h.next||d.push(null),f&&a.defineSkip(h.start),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++p<u.length;)u[p][0]==="exit"&&u[p-1][0]==="enter"&&u[p][1].type===u[p-1][1].type&&u[p][1].start.line!==u[p][1].end.line&&(_=p+1,T.push(_),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(a.events=[],h?(h._tokenizer=void 0,h.previous=void 0):T.pop(),p=T.length;p--;){const E=u.slice(T[p],T[p+1]),A=i.pop();l.push([A,A+E.length-1]),t.splice(A,2,E)}for(l.reverse(),p=-1;++p<l.length;)o[g+l[p][0]]=g+l[p][1],g+=l[p][1]-l[p][0]-1;return o}const l1={resolve:d1,tokenize:f1},c1={partial:!0,tokenize:h1};function d1(t){return Ol(t),t}function f1(t,e){let n;return r;function r(u){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),s(u)}function s(u){return u===null?i(u):ee(u)?t.check(c1,a,i)(u):(t.consume(u),s)}function i(u){return t.exit("chunkContent"),t.exit("content"),e(u)}function a(u){return t.consume(u),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function h1(t,e,n){const r=this;return s;function s(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),de(t,i,"linePrefix")}function i(a){if(a===null||ee(a))return n(a);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function Ll(t,e,n,r,s,i,a,u,l){const o=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(E){return E===60?(t.enter(r),t.enter(s),t.enter(i),t.consume(E),t.exit(i),p):E===null||E===32||E===41||Fr(E)?n(E):(t.enter(r),t.enter(a),t.enter(u),t.enter("chunkString",{contentType:"string"}),_(E))}function p(E){return E===62?(t.enter(i),t.consume(E),t.exit(i),t.exit(s),t.exit(r),e):(t.enter(u),t.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===62?(t.exit("chunkString"),t.exit(u),p(E)):E===null||E===60||ee(E)?n(E):(t.consume(E),E===92?g:h)}function g(E){return E===60||E===62||E===92?(t.consume(E),h):h(E)}function _(E){return!d&&(E===null||E===41||xe(E))?(t.exit("chunkString"),t.exit(u),t.exit(a),t.exit(r),e(E)):d<o&&E===40?(t.consume(E),d++,_):E===41?(t.consume(E),d--,_):E===null||E===32||E===40||Fr(E)?n(E):(t.consume(E),E===92?T:_)}function T(E){return E===40||E===41||E===92?(t.consume(E),_):_(E)}}function vl(t,e,n,r,s,i){const a=this;let u=0,l;return o;function o(h){return t.enter(r),t.enter(s),t.consume(h),t.exit(s),t.enter(i),d}function d(h){return u>999||h===null||h===91||h===93&&!l||h===94&&!u&&"_hiddenFootnoteSupport"in a.parser.constructs?n(h):h===93?(t.exit(i),t.enter(s),t.consume(h),t.exit(s),t.exit(r),e):ee(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),d):(t.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||ee(h)||u++>999?(t.exit("chunkString"),d(h)):(t.consume(h),l||(l=!oe(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(t.consume(h),u++,f):f(h)}}function Dl(t,e,n,r,s,i){let a;return u;function u(p){return p===34||p===39||p===40?(t.enter(r),t.enter(s),t.consume(p),t.exit(s),a=p===40?41:p,l):n(p)}function l(p){return p===a?(t.enter(s),t.consume(p),t.exit(s),t.exit(r),e):(t.enter(i),o(p))}function o(p){return p===a?(t.exit(i),l(a)):p===null?n(p):ee(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),de(t,o,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===a||p===null||ee(p)?(t.exit("chunkString"),o(p)):(t.consume(p),p===92?f:d)}function f(p){return p===a||p===92?(t.consume(p),d):d(p)}}function Yn(t,e){let n;return r;function r(s){return ee(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),n=!0,r):oe(s)?de(t,r,n?"linePrefix":"lineSuffix")(s):e(s)}}const p1={name:"definition",tokenize:g1},m1={partial:!0,tokenize:b1};function g1(t,e,n){const r=this;let s;return i;function i(h){return t.enter("definition"),a(h)}function a(h){return vl.call(r,t,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function u(h){return s=bt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),l):n(h)}function l(h){return xe(h)?Yn(t,o)(h):o(h)}function o(h){return Ll(t,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return t.attempt(m1,f,f)(h)}function f(h){return oe(h)?de(t,p,"whitespace")(h):p(h)}function p(h){return h===null||ee(h)?(t.exit("definition"),r.parser.defined.push(s),e(h)):n(h)}}function b1(t,e,n){return r;function r(u){return xe(u)?Yn(t,s)(u):n(u)}function s(u){return Dl(t,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function i(u){return oe(u)?de(t,a,"whitespace")(u):a(u)}function a(u){return u===null||ee(u)?e(u):n(u)}}const E1={name:"hardBreakEscape",tokenize:T1};function T1(t,e,n){return r;function r(i){return t.enter("hardBreakEscape"),t.consume(i),s}function s(i){return ee(i)?(t.exit("hardBreakEscape"),e(i)):n(i)}}const x1={name:"headingAtx",resolve:_1,tokenize:y1};function _1(t,e){let n=t.length-2,r=3,s,i;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},i={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},lt(t,r,n-r+1,[["enter",s,e],["enter",i,e],["exit",i,e],["exit",s,e]])),t}function y1(t,e,n){let r=0;return s;function s(d){return t.enter("atxHeading"),i(d)}function i(d){return t.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(t.consume(d),a):d===null||xe(d)?(t.exit("atxHeadingSequence"),u(d)):n(d)}function u(d){return d===35?(t.enter("atxHeadingSequence"),l(d)):d===null||ee(d)?(t.exit("atxHeading"),e(d)):oe(d)?de(t,u,"whitespace")(d):(t.enter("atxHeadingText"),o(d))}function l(d){return d===35?(t.consume(d),l):(t.exit("atxHeadingSequence"),u(d))}function o(d){return d===null||d===35||xe(d)?(t.exit("atxHeadingText"),u(d)):(t.consume(d),o)}}const A1=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ka=["pre","script","style","textarea"],k1={concrete:!0,name:"htmlFlow",resolveTo:N1,tokenize:S1},C1={partial:!0,tokenize:R1},I1={partial:!0,tokenize:w1};function N1(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function S1(t,e,n){const r=this;let s,i,a,u,l;return o;function o(N){return d(N)}function d(N){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(N),f}function f(N){return N===33?(t.consume(N),p):N===47?(t.consume(N),i=!0,_):N===63?(t.consume(N),s=3,r.interrupt?e:k):Ze(N)?(t.consume(N),a=String.fromCharCode(N),T):n(N)}function p(N){return N===45?(t.consume(N),s=2,h):N===91?(t.consume(N),s=5,u=0,g):Ze(N)?(t.consume(N),s=4,r.interrupt?e:k):n(N)}function h(N){return N===45?(t.consume(N),r.interrupt?e:k):n(N)}function g(N){const Ee="CDATA[";return N===Ee.charCodeAt(u++)?(t.consume(N),u===Ee.length?r.interrupt?e:$:g):n(N)}function _(N){return Ze(N)?(t.consume(N),a=String.fromCharCode(N),T):n(N)}function T(N){if(N===null||N===47||N===62||xe(N)){const Ee=N===47,ve=a.toLowerCase();return!Ee&&!i&&Ka.includes(ve)?(s=1,r.interrupt?e(N):$(N)):A1.includes(a.toLowerCase())?(s=6,Ee?(t.consume(N),E):r.interrupt?e(N):$(N)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):i?A(N):b(N))}return N===45||Ye(N)?(t.consume(N),a+=String.fromCharCode(N),T):n(N)}function E(N){return N===62?(t.consume(N),r.interrupt?e:$):n(N)}function A(N){return oe(N)?(t.consume(N),A):S(N)}function b(N){return N===47?(t.consume(N),S):N===58||N===95||Ze(N)?(t.consume(N),w):oe(N)?(t.consume(N),b):S(N)}function w(N){return N===45||N===46||N===58||N===95||Ye(N)?(t.consume(N),w):R(N)}function R(N){return N===61?(t.consume(N),I):oe(N)?(t.consume(N),R):b(N)}function I(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(t.consume(N),l=N,L):oe(N)?(t.consume(N),I):M(N)}function L(N){return N===l?(t.consume(N),l=null,P):N===null||ee(N)?n(N):(t.consume(N),L)}function M(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||xe(N)?R(N):(t.consume(N),M)}function P(N){return N===47||N===62||oe(N)?b(N):n(N)}function S(N){return N===62?(t.consume(N),B):n(N)}function B(N){return N===null||ee(N)?$(N):oe(N)?(t.consume(N),B):n(N)}function $(N){return N===45&&s===2?(t.consume(N),W):N===60&&s===1?(t.consume(N),V):N===62&&s===4?(t.consume(N),re):N===63&&s===3?(t.consume(N),k):N===93&&s===5?(t.consume(N),J):ee(N)&&(s===6||s===7)?(t.exit("htmlFlowData"),t.check(C1,he,X)(N)):N===null||ee(N)?(t.exit("htmlFlowData"),X(N)):(t.consume(N),$)}function X(N){return t.check(I1,q,he)(N)}function q(N){return t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),U}function U(N){return N===null||ee(N)?X(N):(t.enter("htmlFlowData"),$(N))}function W(N){return N===45?(t.consume(N),k):$(N)}function V(N){return N===47?(t.consume(N),a="",K):$(N)}function K(N){if(N===62){const Ee=a.toLowerCase();return Ka.includes(Ee)?(t.consume(N),re):$(N)}return Ze(N)&&a.length<8?(t.consume(N),a+=String.fromCharCode(N),K):$(N)}function J(N){return N===93?(t.consume(N),k):$(N)}function k(N){return N===62?(t.consume(N),re):N===45&&s===2?(t.consume(N),k):$(N)}function re(N){return N===null||ee(N)?(t.exit("htmlFlowData"),he(N)):(t.consume(N),re)}function he(N){return t.exit("htmlFlow"),e(N)}}function w1(t,e,n){const r=this;return s;function s(a){return ee(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function R1(t,e,n){return r;function r(s){return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),t.attempt(mr,e,n)}}const O1={name:"htmlText",tokenize:L1};function L1(t,e,n){const r=this;let s,i,a;return u;function u(k){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(k),l}function l(k){return k===33?(t.consume(k),o):k===47?(t.consume(k),R):k===63?(t.consume(k),b):Ze(k)?(t.consume(k),M):n(k)}function o(k){return k===45?(t.consume(k),d):k===91?(t.consume(k),i=0,g):Ze(k)?(t.consume(k),A):n(k)}function d(k){return k===45?(t.consume(k),h):n(k)}function f(k){return k===null?n(k):k===45?(t.consume(k),p):ee(k)?(a=f,V(k)):(t.consume(k),f)}function p(k){return k===45?(t.consume(k),h):f(k)}function h(k){return k===62?W(k):k===45?p(k):f(k)}function g(k){const re="CDATA[";return k===re.charCodeAt(i++)?(t.consume(k),i===re.length?_:g):n(k)}function _(k){return k===null?n(k):k===93?(t.consume(k),T):ee(k)?(a=_,V(k)):(t.consume(k),_)}function T(k){return k===93?(t.consume(k),E):_(k)}function E(k){return k===62?W(k):k===93?(t.consume(k),E):_(k)}function A(k){return k===null||k===62?W(k):ee(k)?(a=A,V(k)):(t.consume(k),A)}function b(k){return k===null?n(k):k===63?(t.consume(k),w):ee(k)?(a=b,V(k)):(t.consume(k),b)}function w(k){return k===62?W(k):b(k)}function R(k){return Ze(k)?(t.consume(k),I):n(k)}function I(k){return k===45||Ye(k)?(t.consume(k),I):L(k)}function L(k){return ee(k)?(a=L,V(k)):oe(k)?(t.consume(k),L):W(k)}function M(k){return k===45||Ye(k)?(t.consume(k),M):k===47||k===62||xe(k)?P(k):n(k)}function P(k){return k===47?(t.consume(k),W):k===58||k===95||Ze(k)?(t.consume(k),S):ee(k)?(a=P,V(k)):oe(k)?(t.consume(k),P):W(k)}function S(k){return k===45||k===46||k===58||k===95||Ye(k)?(t.consume(k),S):B(k)}function B(k){return k===61?(t.consume(k),$):ee(k)?(a=B,V(k)):oe(k)?(t.consume(k),B):P(k)}function $(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(t.consume(k),s=k,X):ee(k)?(a=$,V(k)):oe(k)?(t.consume(k),$):(t.consume(k),q)}function X(k){return k===s?(t.consume(k),s=void 0,U):k===null?n(k):ee(k)?(a=X,V(k)):(t.consume(k),X)}function q(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||xe(k)?P(k):(t.consume(k),q)}function U(k){return k===47||k===62||xe(k)?P(k):n(k)}function W(k){return k===62?(t.consume(k),t.exit("htmlTextData"),t.exit("htmlText"),e):n(k)}function V(k){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),K}function K(k){return oe(k)?de(t,J,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):J(k)}function J(k){return t.enter("htmlTextData"),a(k)}}const Mi={name:"labelEnd",resolveAll:M1,resolveTo:B1,tokenize:F1},v1={tokenize:U1},D1={tokenize:H1},P1={tokenize:j1};function M1(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",e+=s}}return t.length!==n.length&<(t,0,t.length,n),t}function B1(t,e){let n=t.length,r=0,s,i,a,u;for(;n--;)if(s=t[n][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;t[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(a=n);const l={type:t[i][1].type==="labelLink"?"link":"image",start:{...t[i][1].start},end:{...t[t.length-1][1].end}},o={type:"label",start:{...t[i][1].start},end:{...t[a][1].end}},d={type:"labelText",start:{...t[i+r+2][1].end},end:{...t[a-2][1].start}};return u=[["enter",l,e],["enter",o,e]],u=ht(u,t.slice(i+1,i+r+3)),u=ht(u,[["enter",d,e]]),u=ht(u,es(e.parser.constructs.insideSpan.null,t.slice(i+r+4,a-3),e)),u=ht(u,[["exit",d,e],t[a-2],t[a-1],["exit",o,e]]),u=ht(u,t.slice(a+1)),u=ht(u,[["exit",l,e]]),lt(t,i,t.length,u),t}function F1(t,e,n){const r=this;let s=r.events.length,i,a;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return u;function u(p){return i?i._inactive?f(p):(a=r.parser.defined.includes(bt(r.sliceSerialize({start:i.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),l):n(p)}function l(p){return p===40?t.attempt(v1,d,a?d:f)(p):p===91?t.attempt(D1,d,a?o:f)(p):a?d(p):f(p)}function o(p){return t.attempt(P1,d,f)(p)}function d(p){return e(p)}function f(p){return i._balanced=!0,n(p)}}function U1(t,e,n){return r;function r(f){return t.enter("resource"),t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),s}function s(f){return xe(f)?Yn(t,i)(f):i(f)}function i(f){return f===41?d(f):Ll(t,a,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function a(f){return xe(f)?Yn(t,l)(f):d(f)}function u(f){return n(f)}function l(f){return f===34||f===39||f===40?Dl(t,o,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function o(f){return xe(f)?Yn(t,d)(f):d(f)}function d(f){return f===41?(t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),t.exit("resource"),e):n(f)}}function H1(t,e,n){const r=this;return s;function s(u){return vl.call(r,t,i,a,"reference","referenceMarker","referenceString")(u)}function i(u){return r.parser.defined.includes(bt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(u):n(u)}function a(u){return n(u)}}function j1(t,e,n){return r;function r(i){return t.enter("reference"),t.enter("referenceMarker"),t.consume(i),t.exit("referenceMarker"),s}function s(i){return i===93?(t.enter("referenceMarker"),t.consume(i),t.exit("referenceMarker"),t.exit("reference"),e):n(i)}}const z1={name:"labelStartImage",resolveAll:Mi.resolveAll,tokenize:$1};function $1(t,e,n){const r=this;return s;function s(u){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(u),t.exit("labelImageMarker"),i}function i(u){return u===91?(t.enter("labelMarker"),t.consume(u),t.exit("labelMarker"),t.exit("labelImage"),a):n(u)}function a(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):e(u)}}const Y1={name:"labelStartLink",resolveAll:Mi.resolveAll,tokenize:q1};function q1(t,e,n){const r=this;return s;function s(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),i}function i(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const Es={name:"lineEnding",tokenize:V1};function V1(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),de(t,e,"linePrefix")}}const wr={name:"thematicBreak",tokenize:G1};function G1(t,e,n){let r=0,s;return i;function i(o){return t.enter("thematicBreak"),a(o)}function a(o){return s=o,u(o)}function u(o){return o===s?(t.enter("thematicBreakSequence"),l(o)):r>=3&&(o===null||ee(o))?(t.exit("thematicBreak"),e(o)):n(o)}function l(o){return o===s?(t.consume(o),r++,l):(t.exit("thematicBreakSequence"),oe(o)?de(t,u,"whitespace")(o):u(o))}}const tt={continuation:{tokenize:Z1},exit:J1,name:"list",tokenize:X1},W1={partial:!0,tokenize:eg},Q1={partial:!0,tokenize:K1};function X1(t,e,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return u;function u(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Ws(h)){if(r.containerState.type||(r.containerState.type=g,t.enter(g,{_container:!0})),g==="listUnordered")return t.enter("listItemPrefix"),h===42||h===45?t.check(wr,n,o)(h):o(h);if(!r.interrupt||h===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(h)}return n(h)}function l(h){return Ws(h)&&++a<10?(t.consume(h),l):(!r.interrupt||a<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(t.exit("listItemValue"),o(h)):n(h)}function o(h){return t.enter("listItemMarker"),t.consume(h),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,t.check(mr,r.interrupt?n:d,t.attempt(W1,p,f))}function d(h){return r.containerState.initialBlankLine=!0,i++,p(h)}function f(h){return oe(h)?(t.enter("listItemPrefixWhitespace"),t.consume(h),t.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=i+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(h)}}function Z1(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(mr,s,i);function s(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,de(t,e,"listItemIndent",r.containerState.size+1)(u)}function i(u){return r.containerState.furtherBlankLines||!oe(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(Q1,e,a)(u))}function a(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,de(t,t.attempt(tt,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function K1(t,e,n){const r=this;return de(t,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(i):n(i)}}function J1(t){t.exit(this.containerState.type)}function eg(t,e,n){const r=this;return de(t,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!oe(i)&&a&&a[1].type==="listItemPrefixWhitespace"?e(i):n(i)}}const Ja={name:"setextUnderline",resolveTo:tg,tokenize:ng};function tg(t,e){let n=t.length,r,s,i;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(s=n)}else t[n][1].type==="content"&&t.splice(n,1),!i&&t[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[s][1].type="setextHeadingText",i?(t.splice(s,0,["enter",a,e]),t.splice(i+1,0,["exit",t[r][1],e]),t[r][1].end={...t[i][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function ng(t,e,n){const r=this;let s;return i;function i(o){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),s=o,a(o)):n(o)}function a(o){return t.enter("setextHeadingLineSequence"),u(o)}function u(o){return o===s?(t.consume(o),u):(t.exit("setextHeadingLineSequence"),oe(o)?de(t,l,"lineSuffix")(o):l(o))}function l(o){return o===null||ee(o)?(t.exit("setextHeadingLine"),e(o)):n(o)}}const rg={tokenize:sg};function sg(t){const e=this,n=t.attempt(mr,r,t.attempt(this.parser.constructs.flowInitial,s,de(t,t.attempt(this.parser.constructs.flow,s,t.attempt(l1,s)),"linePrefix")));return n;function r(i){if(i===null){t.consume(i);return}return t.enter("lineEndingBlank"),t.consume(i),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function s(i){if(i===null){t.consume(i);return}return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const ig={resolveAll:Ml()},ag=Pl("string"),ug=Pl("text");function Pl(t){return{resolveAll:Ml(t==="text"?og:void 0),tokenize:e};function e(n){const r=this,s=this.parser.constructs[t],i=n.attempt(s,a,u);return a;function a(d){return o(d)?i(d):u(d)}function u(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return o(d)?(n.exit("data"),i(d)):(n.consume(d),l)}function o(d){if(d===null)return!0;const f=s[d];let p=-1;if(f)for(;++p<f.length;){const h=f[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Ml(t){return e;function e(n,r){let s=-1,i;for(;++s<=n.length;)i===void 0?n[s]&&n[s][1].type==="data"&&(i=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==i+2&&(n[i][1].end=n[s-1][1].end,n.splice(i+2,s-i-2),s=i+2),i=void 0);return t?t(n,r):n}}function og(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],s=e.sliceStream(r);let i=s.length,a=-1,u=0,l;for(;i--;){const o=s[i];if(typeof o=="string"){for(a=o.length;o.charCodeAt(a-1)===32;)u++,a--;if(a)break;a=-1}else if(o===-2)l=!0,u++;else if(o!==-1){i++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(u=0),u){const o={type:n===t.length||l||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:r.start._bufferIndex+a,_index:r.start._index+i,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(t.splice(n,0,["enter",o,e],["exit",o,e]),n+=2)}n++}return t}const lg={42:tt,43:tt,45:tt,48:tt,49:tt,50:tt,51:tt,52:tt,53:tt,54:tt,55:tt,56:tt,57:tt,62:Sl},cg={91:p1},dg={[-2]:bs,[-1]:bs,32:bs},fg={35:x1,42:wr,45:[Ja,wr],60:k1,61:Ja,95:wr,96:Za,126:Za},hg={38:Rl,92:wl},pg={[-5]:Es,[-4]:Es,[-3]:Es,33:z1,38:Rl,42:Qs,60:[Ym,O1],91:Y1,92:[E1,wl],93:Mi,95:Qs,96:r1},mg={null:[Qs,ig]},gg={null:[42,95]},bg={null:[]},Eg=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:gg,contentInitial:cg,disable:bg,document:lg,flow:fg,flowInitial:dg,insideSpan:mg,string:hg,text:pg},Symbol.toStringTag,{value:"Module"}));function Tg(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},i=[];let a=[],u=[];const l={attempt:L(R),check:L(I),consume:A,enter:b,exit:w,interrupt:L(I,{interrupt:!0})},o={code:null,containerState:{},defineSkip:_,events:[],now:g,parser:t,previous:null,sliceSerialize:p,sliceStream:h,write:f};let d=e.tokenize.call(o,l);return e.resolveAll&&i.push(e),o;function f(B){return a=ht(a,B),T(),a[a.length-1]!==null?[]:(M(e,0),o.events=es(i,o.events,o),o.events)}function p(B,$){return _g(h(B),$)}function h(B){return xg(a,B)}function g(){const{_bufferIndex:B,_index:$,line:X,column:q,offset:U}=r;return{_bufferIndex:B,_index:$,line:X,column:q,offset:U}}function _(B){s[B.line]=B.column,S()}function T(){let B;for(;r._index<a.length;){const $=a[r._index];if(typeof $=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<$.length;)E($.charCodeAt(r._bufferIndex));else E($)}}function E(B){d=d(B)}function A(B){ee(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,S()):B!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),o.previous=B}function b(B,$){const X=$||{};return X.type=B,X.start=g(),o.events.push(["enter",X,o]),u.push(X),X}function w(B){const $=u.pop();return $.end=g(),o.events.push(["exit",$,o]),$}function R(B,$){M(B,$.from)}function I(B,$){$.restore()}function L(B,$){return X;function X(q,U,W){let V,K,J,k;return Array.isArray(q)?he(q):"tokenize"in q?he([q]):re(q);function re(fe){return Ge;function Ge(Ie){const Ne=Ie!==null&&fe[Ie],ye=Ie!==null&&fe.null,Fe=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(ye)?ye:ye?[ye]:[]];return he(Fe)(Ie)}}function he(fe){return V=fe,K=0,fe.length===0?W:N(fe[K])}function N(fe){return Ge;function Ge(Ie){return k=P(),J=fe,fe.partial||(o.currentConstruct=fe),fe.name&&o.parser.constructs.disable.null.includes(fe.name)?ve():fe.tokenize.call($?Object.assign(Object.create(o),$):o,l,Ee,ve)(Ie)}}function Ee(fe){return B(J,k),U}function ve(fe){return k.restore(),++K<V.length?N(V[K]):W}}}function M(B,$){B.resolveAll&&!i.includes(B)&&i.push(B),B.resolve&<(o.events,$,o.events.length-$,B.resolve(o.events.slice($),o)),B.resolveTo&&(o.events=B.resolveTo(o.events,o))}function P(){const B=g(),$=o.previous,X=o.currentConstruct,q=o.events.length,U=Array.from(u);return{from:q,restore:W};function W(){r=B,o.previous=$,o.currentConstruct=X,o.events.length=q,u=U,S()}}function S(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function xg(t,e){const n=e.start._index,r=e.start._bufferIndex,s=e.end._index,i=e.end._bufferIndex;let a;if(n===s)a=[t[n].slice(r,i)];else{if(a=t.slice(n,s),r>-1){const u=a[0];typeof u=="string"?a[0]=u.slice(r):a.shift()}i>0&&a.push(t[s].slice(0,i))}return a}function _g(t,e){let n=-1;const r=[];let s;for(;++n<t.length;){const i=t[n];let a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
|
|
74
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${yt(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){const r=this.parser.parseInline(n),s=wa(t);if(s===null)return r;t=s;let i='<a href="'+t+'"';return e&&(i+=' title="'+yt(e)+'"'),i+=">"+r+"</a>",i}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const s=wa(t);if(s===null)return yt(n);t=s;let i=`<img src="${t}" alt="${n}"`;return e&&(i+=` title="${yt(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:yt(t.text)}},Si=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Ot=class Ys{options;renderer;textRenderer;constructor(e){this.options=e||rn,this.options.renderer=this.options.renderer||new Mr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Si}static parse(e,n){return new Ys(n).parse(e)}static parseInline(e,n){return new Ys(n).parseInline(e)}parse(e,n=!0){let r="";for(let s=0;s<e.length;s++){const i=e[s];if(this.options.extensions?.renderers?.[i.type]){const u=i,l=this.options.extensions.renderers[u.type].call({parser:this},u);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)){r+=l||"";continue}}const a=i;switch(a.type){case"space":{r+=this.renderer.space(a);continue}case"hr":{r+=this.renderer.hr(a);continue}case"heading":{r+=this.renderer.heading(a);continue}case"code":{r+=this.renderer.code(a);continue}case"table":{r+=this.renderer.table(a);continue}case"blockquote":{r+=this.renderer.blockquote(a);continue}case"list":{r+=this.renderer.list(a);continue}case"html":{r+=this.renderer.html(a);continue}case"paragraph":{r+=this.renderer.paragraph(a);continue}case"text":{let u=a,l=this.renderer.text(u);for(;s+1<e.length&&e[s+1].type==="text";)u=e[++s],l+=`
|
|
75
|
+
`+this.renderer.text(u);n?r+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):r+=l;continue}default:{const u='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}parseInline(e,n=this.renderer){let r="";for(let s=0;s<e.length;s++){const i=e[s];if(this.options.extensions?.renderers?.[i.type]){const u=this.options.extensions.renderers[i.type].call({parser:this},i);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=u||"";continue}}const a=i;switch(a.type){case"escape":{r+=n.text(a);break}case"html":{r+=n.html(a);break}case"link":{r+=n.link(a);break}case"image":{r+=n.image(a);break}case"strong":{r+=n.strong(a);break}case"em":{r+=n.em(a);break}case"codespan":{r+=n.codespan(a);break}case"br":{r+=n.br(a);break}case"del":{r+=n.del(a);break}case"text":{r+=n.text(a);break}default:{const u='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},Sr=class{options;block;constructor(t){this.options=t||rn}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Rt.lex:Rt.lexInline}provideParser(){return this.block?Ot.parse:Ot.parseInline}},$p=class{defaults=xi();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ot;Renderer=Mr;TextRenderer=Si;Lexer=Rt;Tokenizer=Pr;Hooks=Sr;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(const r of t)switch(n=n.concat(e.call(this,r)),r.type){case"table":{const s=r;for(const i of s.header)n=n.concat(this.walkTokens(i.tokens,e));for(const i of s.rows)for(const a of i)n=n.concat(this.walkTokens(a.tokens,e));break}case"list":{const s=r;n=n.concat(this.walkTokens(s.items,e));break}default:{const s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(i=>{const a=s[i].flat(1/0);n=n.concat(this.walkTokens(a,e))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,e)))}}return n}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const i=e.renderers[s.name];i?e.renderers[s.name]=function(...a){let u=s.renderer.apply(this,a);return u===!1&&(u=i.apply(this,a)),u}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=e[s.level];i?i.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),n.renderer){const s=this.defaults.renderer||new Mr(this.defaults);for(const i in n.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const a=i,u=n.renderer[a],l=s[a];s[a]=(...o)=>{let d=u.apply(s,o);return d===!1&&(d=l.apply(s,o)),d||""}}r.renderer=s}if(n.tokenizer){const s=this.defaults.tokenizer||new Pr(this.defaults);for(const i in n.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const a=i,u=n.tokenizer[a],l=s[a];s[a]=(...o)=>{let d=u.apply(s,o);return d===!1&&(d=l.apply(s,o)),d}}r.tokenizer=s}if(n.hooks){const s=this.defaults.hooks||new Sr;for(const i in n.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const a=i,u=n.hooks[a],l=s[a];Sr.passThroughHooks.has(i)?s[a]=o=>{if(this.defaults.async)return Promise.resolve(u.call(s,o)).then(f=>l.call(s,f));const d=u.call(s,o);return l.call(s,d)}:s[a]=(...o)=>{let d=u.apply(s,o);return d===!1&&(d=l.apply(s,o)),d}}r.hooks=s}if(n.walkTokens){const s=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(a){let u=[];return u.push(i.call(this,a)),s&&(u=u.concat(s.call(this,a))),u}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Rt.lex(t,e??this.defaults)}parser(t,e){return Ot.parse(t,e??this.defaults)}parseMarkdown(t){return(n,r)=>{const s={...r},i={...this.defaults,...s},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=t);const u=i.hooks?i.hooks.provideLexer():t?Rt.lex:Rt.lexInline,l=i.hooks?i.hooks.provideParser():t?Ot.parse:Ot.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(o=>u(o,i)).then(o=>i.hooks?i.hooks.processAllTokens(o):o).then(o=>i.walkTokens?Promise.all(this.walkTokens(o,i.walkTokens)).then(()=>o):o).then(o=>l(o,i)).then(o=>i.hooks?i.hooks.postprocess(o):o).catch(a);try{i.hooks&&(n=i.hooks.preprocess(n));let o=u(n,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let d=l(o,i);return i.hooks&&(d=i.hooks.postprocess(d)),d}catch(o){return a(o)}}}onError(t,e){return n=>{if(n.message+=`
|
|
76
|
+
Please report this to https://github.com/markedjs/marked.`,t){const r="<p>An error occurred:</p><pre>"+yt(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},tn=new $p;function ge(t,e){return tn.parse(t,e)}ge.options=ge.setOptions=function(t){return tn.setOptions(t),ge.defaults=tn.defaults,el(ge.defaults),ge};ge.getDefaults=xi;ge.defaults=rn;ge.use=function(...t){return tn.use(...t),ge.defaults=tn.defaults,el(ge.defaults),ge};ge.walkTokens=function(t,e){return tn.walkTokens(t,e)};ge.parseInline=tn.parseInline;ge.Parser=Ot;ge.parser=Ot.parse;ge.Renderer=Mr;ge.TextRenderer=Si;ge.Lexer=Rt;ge.lexer=Rt.lex;ge.Tokenizer=Pr;ge.Hooks=Sr;ge.parse=ge;ge.options;ge.setOptions;ge.use;ge.walkTokens;ge.parseInline;Ot.parse;Rt.lex;function La(t){const e=[],n=String(t||"");let r=n.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const a=n.slice(s,r).trim();(a||!i)&&e.push(a),s=r+1,r=n.indexOf(",",s)}return e}function dl(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Yp=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qp=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vp={};function va(t,e){return(Vp.jsx?qp:Yp).test(t)}const Gp=/[ \t\n\f\r]/g;function Wp(t){return typeof t=="object"?t.type==="text"?Da(t.value):!1:Da(t)}function Da(t){return t.replace(Gp,"")===""}class hr{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}hr.prototype.normal={};hr.prototype.property={};hr.prototype.space=void 0;function fl(t,e){const n={},r={};for(const s of t)Object.assign(n,s.property),Object.assign(r,s.normal);return new hr(n,r,e)}function nr(t){return t.toLowerCase()}class rt{constructor(e,n){this.attribute=n,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;let Qp=0;const se=sn(),Le=sn(),qs=sn(),z=sn(),_e=sn(),mn=sn(),ot=sn();function sn(){return 2**++Qp}const Vs=Object.freeze(Object.defineProperty({__proto__:null,boolean:se,booleanish:Le,commaOrSpaceSeparated:ot,commaSeparated:mn,number:z,overloadedBoolean:qs,spaceSeparated:_e},Symbol.toStringTag,{value:"Module"})),hs=Object.keys(Vs);class wi extends rt{constructor(e,n,r,s){let i=-1;if(super(e,n),Pa(this,"space",s),typeof r=="number")for(;++i<hs.length;){const a=hs[i];Pa(this,hs[i],(r&Vs[a])===Vs[a])}}}wi.prototype.defined=!0;function Pa(t,e,n){n&&(t[e]=n)}function kn(t){const e={},n={};for(const[r,s]of Object.entries(t.properties)){const i=new wi(r,t.transform(t.attributes||{},r),s,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),e[r]=i,n[nr(r)]=r,n[nr(i.attribute)]=r}return new hr(e,n,t.space)}const hl=kn({properties:{ariaActiveDescendant:null,ariaAtomic:Le,ariaAutoComplete:null,ariaBusy:Le,ariaChecked:Le,ariaColCount:z,ariaColIndex:z,ariaColSpan:z,ariaControls:_e,ariaCurrent:null,ariaDescribedBy:_e,ariaDetails:null,ariaDisabled:Le,ariaDropEffect:_e,ariaErrorMessage:null,ariaExpanded:Le,ariaFlowTo:_e,ariaGrabbed:Le,ariaHasPopup:null,ariaHidden:Le,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_e,ariaLevel:z,ariaLive:null,ariaModal:Le,ariaMultiLine:Le,ariaMultiSelectable:Le,ariaOrientation:null,ariaOwns:_e,ariaPlaceholder:null,ariaPosInSet:z,ariaPressed:Le,ariaReadOnly:Le,ariaRelevant:null,ariaRequired:Le,ariaRoleDescription:_e,ariaRowCount:z,ariaRowIndex:z,ariaRowSpan:z,ariaSelected:Le,ariaSetSize:z,ariaSort:null,ariaValueMax:z,ariaValueMin:z,ariaValueNow:z,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function pl(t,e){return e in t?t[e]:e}function ml(t,e){return pl(t,e.toLowerCase())}const Xp=kn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:mn,acceptCharset:_e,accessKey:_e,action:null,allow:null,allowFullScreen:se,allowPaymentRequest:se,allowUserMedia:se,alt:null,as:null,async:se,autoCapitalize:null,autoComplete:_e,autoFocus:se,autoPlay:se,blocking:_e,capture:null,charSet:null,checked:se,cite:null,className:_e,cols:z,colSpan:null,content:null,contentEditable:Le,controls:se,controlsList:_e,coords:z|mn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:se,defer:se,dir:null,dirName:null,disabled:se,download:qs,draggable:Le,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:se,formTarget:null,headers:_e,height:z,hidden:qs,high:z,href:null,hrefLang:null,htmlFor:_e,httpEquiv:_e,id:null,imageSizes:null,imageSrcSet:null,inert:se,inputMode:null,integrity:null,is:null,isMap:se,itemId:null,itemProp:_e,itemRef:_e,itemScope:se,itemType:_e,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:se,low:z,manifest:null,max:null,maxLength:z,media:null,method:null,min:null,minLength:z,multiple:se,muted:se,name:null,nonce:null,noModule:se,noValidate:se,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:se,optimum:z,pattern:null,ping:_e,placeholder:null,playsInline:se,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:se,referrerPolicy:null,rel:_e,required:se,reversed:se,rows:z,rowSpan:z,sandbox:_e,scope:null,scoped:se,seamless:se,selected:se,shadowRootClonable:se,shadowRootDelegatesFocus:se,shadowRootMode:null,shape:null,size:z,sizes:null,slot:null,span:z,spellCheck:Le,src:null,srcDoc:null,srcLang:null,srcSet:null,start:z,step:null,style:null,tabIndex:z,target:null,title:null,translate:null,type:null,typeMustMatch:se,useMap:null,value:Le,width:z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_e,axis:null,background:null,bgColor:null,border:z,borderColor:null,bottomMargin:z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:se,declare:se,event:null,face:null,frame:null,frameBorder:null,hSpace:z,leftMargin:z,link:null,longDesc:null,lowSrc:null,marginHeight:z,marginWidth:z,noResize:se,noHref:se,noShade:se,noWrap:se,object:null,profile:null,prompt:null,rev:null,rightMargin:z,rules:null,scheme:null,scrolling:Le,standby:null,summary:null,text:null,topMargin:z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:se,disableRemotePlayback:se,prefix:null,property:null,results:z,security:null,unselectable:null},space:"html",transform:ml}),Zp=kn({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:ot,accentHeight:z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:z,amplitude:z,arabicForm:null,ascent:z,attributeName:null,attributeType:null,azimuth:z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:z,by:null,calcMode:null,capHeight:z,className:_e,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:z,diffuseConstant:z,direction:null,display:null,dur:null,divisor:z,dominantBaseline:null,download:se,dx:null,dy:null,edgeMode:null,editable:null,elevation:z,enableBackground:null,end:null,event:null,exponent:z,externalResourcesRequired:null,fill:null,fillOpacity:z,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:mn,g2:mn,glyphName:mn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:z,horizOriginX:z,horizOriginY:z,id:null,ideographic:z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:z,k:z,k1:z,k2:z,k3:z,k4:z,kernelMatrix:ot,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:z,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:z,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:z,overlineThickness:z,paintOrder:null,panose1:null,path:null,pathLength:z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_e,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:z,pointsAtY:z,pointsAtZ:z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ot,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ot,rev:ot,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ot,requiredFeatures:ot,requiredFonts:ot,requiredFormats:ot,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:z,specularExponent:z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:z,strikethroughThickness:z,string:null,stroke:null,strokeDashArray:ot,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:z,strokeOpacity:z,strokeWidth:null,style:null,surfaceScale:z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ot,tabIndex:z,tableValues:null,target:null,targetX:z,targetY:z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ot,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:z,underlineThickness:z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:z,values:null,vAlphabetic:z,vMathematical:z,vectorEffect:null,vHanging:z,vIdeographic:z,version:null,vertAdvY:z,vertOriginX:z,vertOriginY:z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:pl}),gl=kn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),bl=kn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ml}),El=kn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),Kp={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"},Jp=/[A-Z]/g,Ma=/-[a-z]/g,em=/^data[-\w.:]+$/i;function Xr(t,e){const n=nr(e);let r=e,s=rt;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&em.test(e)){if(e.charAt(4)==="-"){const i=e.slice(5).replace(Ma,nm);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=e.slice(4);if(!Ma.test(i)){let a=i.replace(Jp,tm);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}s=wi}return new s(r,e)}function tm(t){return"-"+t.toLowerCase()}function nm(t){return t.charAt(1).toUpperCase()}const pr=fl([hl,Xp,gl,bl,El],"html"),$t=fl([hl,Zp,gl,bl,El],"svg");function Ba(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function Tl(t){return t.join(" ").trim()}var ln={},ps,Fa;function rm(){if(Fa)return ps;Fa=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,u=/^\s+|\s+$/g,l=`
|
|
77
|
+
`,o="/",d="*",f="",p="comment",h="declaration";function g(T,E){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];E=E||{};var A=1,b=1;function w(q){var U=q.match(e);U&&(A+=U.length);var W=q.lastIndexOf(l);b=~W?q.length-W:b+q.length}function R(){var q={line:A,column:b};return function(U){return U.position=new I(q),P(),U}}function I(q){this.start=q,this.end={line:A,column:b},this.source=E.source}I.prototype.content=T;function L(q){var U=new Error(E.source+":"+A+":"+b+": "+q);if(U.reason=q,U.filename=E.source,U.line=A,U.column=b,U.source=T,!E.silent)throw U}function M(q){var U=q.exec(T);if(U){var W=U[0];return w(W),T=T.slice(W.length),U}}function P(){M(n)}function S(q){var U;for(q=q||[];U=B();)U!==!1&&q.push(U);return q}function B(){var q=R();if(!(o!=T.charAt(0)||d!=T.charAt(1))){for(var U=2;f!=T.charAt(U)&&(d!=T.charAt(U)||o!=T.charAt(U+1));)++U;if(U+=2,f===T.charAt(U-1))return L("End of comment missing");var W=T.slice(2,U-2);return b+=2,w(W),T=T.slice(U),b+=2,q({type:p,comment:W})}}function $(){var q=R(),U=M(r);if(U){if(B(),!M(s))return L("property missing ':'");var W=M(i),V=q({type:h,property:_(U[0].replace(t,f)),value:W?_(W[0].replace(t,f)):f});return M(a),V}}function X(){var q=[];S(q);for(var U;U=$();)U!==!1&&(q.push(U),S(q));return q}return P(),X()}function _(T){return T?T.replace(u,f):f}return ps=g,ps}var Ua;function sm(){if(Ua)return ln;Ua=1;var t=ln&&ln.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ln,"__esModule",{value:!0}),ln.default=n;const e=t(rm());function n(r,s){let i=null;if(!r||typeof r!="string")return i;const a=(0,e.default)(r),u=typeof s=="function";return a.forEach(l=>{if(l.type!=="declaration")return;const{property:o,value:d}=l;u?s(o,d,l):d&&(i=i||{},i[o]=d)}),i}return ln}var On={},Ha;function im(){if(Ha)return On;Ha=1,Object.defineProperty(On,"__esModule",{value:!0}),On.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,i=function(o){return!o||n.test(o)||t.test(o)},a=function(o,d){return d.toUpperCase()},u=function(o,d){return"".concat(d,"-")},l=function(o,d){return d===void 0&&(d={}),i(o)?o:(o=o.toLowerCase(),d.reactCompat?o=o.replace(s,u):o=o.replace(r,u),o.replace(e,a))};return On.camelCase=l,On}var Ln,ja;function am(){if(ja)return Ln;ja=1;var t=Ln&&Ln.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},e=t(sm()),n=im();function r(s,i){var a={};return!s||typeof s!="string"||(0,e.default)(s,function(u,l){u&&l&&(a[(0,n.camelCase)(u,i)]=l)}),a}return r.default=r,Ln=r,Ln}var um=am();const om=ai(um),Zr=xl("end"),It=xl("start");function xl(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function lm(t){const e=It(t),n=Zr(t);if(e&&n)return{start:e,end:n}}function $n(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?za(t.position):"start"in t||"end"in t?za(t):"line"in t||"column"in t?Gs(t):""}function Gs(t){return $a(t&&t.line)+":"+$a(t&&t.column)}function za(t){return Gs(t&&t.start)+"-"+Gs(t&&t.end)}function $a(t){return t&&typeof t=="number"?t:1}class qe extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",i={},a=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof e=="string"?s=e:!i.cause&&e&&(a=!0,s=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const u=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=u?u.line:void 0,this.name=$n(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}qe.prototype.file="";qe.prototype.name="";qe.prototype.reason="";qe.prototype.message="";qe.prototype.stack="";qe.prototype.column=void 0;qe.prototype.line=void 0;qe.prototype.ancestors=void 0;qe.prototype.cause=void 0;qe.prototype.fatal=void 0;qe.prototype.place=void 0;qe.prototype.ruleId=void 0;qe.prototype.source=void 0;const Ri={}.hasOwnProperty,cm=new Map,dm=/[A-Z]/g,fm=new Set(["table","tbody","thead","tfoot","tr"]),hm=new Set(["td","th"]),_l="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function pm(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=ym(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=_m(n,e.jsx,e.jsxs)}const s={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?$t:pr,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},i=yl(s,t,void 0);return i&&typeof i!="string"?i:s.create(t,s.Fragment,{children:i||void 0},void 0)}function yl(t,e,n){if(e.type==="element")return mm(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return gm(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Em(t,e,n);if(e.type==="mdxjsEsm")return bm(t,e);if(e.type==="root")return Tm(t,e,n);if(e.type==="text")return xm(t,e)}function mm(t,e,n){const r=t.schema;let s=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=$t,t.schema=s),t.ancestors.push(e);const i=kl(t,e.tagName,!1),a=Am(t,e);let u=Li(t,e);return fm.has(e.tagName)&&(u=u.filter(function(l){return typeof l=="string"?!Wp(l):!0})),Al(t,a,i,e),Oi(a,u),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function gm(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}rr(t,e.position)}function bm(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);rr(t,e.position)}function Em(t,e,n){const r=t.schema;let s=r;e.name==="svg"&&r.space==="html"&&(s=$t,t.schema=s),t.ancestors.push(e);const i=e.name===null?t.Fragment:kl(t,e.name,!0),a=km(t,e),u=Li(t,e);return Al(t,a,i,e),Oi(a,u),t.ancestors.pop(),t.schema=r,t.create(e,i,a,n)}function Tm(t,e,n){const r={};return Oi(r,Li(t,e)),t.create(e,t.Fragment,r,n)}function xm(t,e){return e.value}function Al(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function Oi(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function _m(t,e,n){return r;function r(s,i,a,u){const o=Array.isArray(a.children)?n:e;return u?o(i,a,u):o(i,a)}}function ym(t,e){return n;function n(r,s,i,a){const u=Array.isArray(i.children),l=It(r);return e(s,i,a,u,{columnNumber:l?l.column-1:void 0,fileName:t,lineNumber:l?l.line:void 0},void 0)}}function Am(t,e){const n={};let r,s;for(s in e.properties)if(s!=="children"&&Ri.call(e.properties,s)){const i=Cm(t,s,e.properties[s]);if(i){const[a,u]=i;t.tableCellAlignToStyle&&a==="align"&&typeof u=="string"&&hm.has(e.tagName)?r=u:n[a]=u}}if(r){const i=n.style||(n.style={});i[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function km(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const i=r.data.estree.body[0];i.type;const a=i.expression;a.type;const u=a.properties[0];u.type,Object.assign(n,t.evaluater.evaluateExpression(u.argument))}else rr(t,e.position);else{const s=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const u=r.value.data.estree.body[0];u.type,i=t.evaluater.evaluateExpression(u.expression)}else rr(t,e.position);else i=r.value===null?!0:r.value;n[s]=i}return n}function Li(t,e){const n=[];let r=-1;const s=t.passKeys?new Map:cm;for(;++r<e.children.length;){const i=e.children[r];let a;if(t.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const o=s.get(l)||0;a=l+"-"+o,s.set(l,o+1)}}const u=yl(t,i,a);u!==void 0&&n.push(u)}return n}function Cm(t,e,n){const r=Xr(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?dl(n):Tl(n)),r.property==="style"){let s=typeof n=="object"?n:Im(t,String(n));return t.stylePropertyNameCase==="css"&&(s=Nm(s)),["style",s]}return[t.elementAttributeNameCase==="react"&&r.space?Kp[r.property]||r.property:r.attribute,n]}}function Im(t,e){try{return om(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,s=new qe("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=t.filePath||void 0,s.url=_l+"#cannot-parse-style-attribute",s}}function kl(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const s=e.split(".");let i=-1,a;for(;++i<s.length;){const u=va(s[i])?{type:"Identifier",name:s[i]}:{type:"Literal",value:s[i]};a=a?{type:"MemberExpression",object:a,property:u,computed:!!(i&&u.type==="Literal"),optional:!1}:u}r=a}else r=va(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const s=r.value;return Ri.call(t.components,s)?t.components[s]:s}if(t.evaluater)return t.evaluater.evaluateExpression(r);rr(t)}function rr(t,e){const n=new qe("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=_l+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Nm(t){const e={};let n;for(n in t)Ri.call(t,n)&&(e[Sm(n)]=t[n]);return e}function Sm(t){let e=t.replace(dm,wm);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function wm(t){return"-"+t.toLowerCase()}const ms={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Rm={};function vi(t,e){const n=Rm,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Cl(t,r,s)}function Cl(t,e,n){if(Om(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return Ya(t.children,e,n)}return Array.isArray(t)?Ya(t,e,n):""}function Ya(t,e,n){const r=[];let s=-1;for(;++s<t.length;)r[s]=Cl(t[s],e,n);return r.join("")}function Om(t){return!!(t&&typeof t=="object")}const qa=document.createElement("i");function Di(t){const e="&"+t+";";qa.innerHTML=e;const n=qa.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function lt(t,e,n,r){const s=t.length;let i=0,a;if(e<0?e=-e>s?0:s+e:e=e>s?s:e,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(e,n),t.splice(...a);else for(n&&t.splice(e,n);i<r.length;)a=r.slice(i,i+1e4),a.unshift(e,0),t.splice(...a),i+=1e4,e+=1e4}function ht(t,e){return t.length>0?(lt(t,t.length,0,e),t):e}const Va={}.hasOwnProperty;function Il(t){const e={};let n=-1;for(;++n<t.length;)Lm(e,t[n]);return e}function Lm(t,e){let n;for(n in e){const s=(Va.call(t,n)?t[n]:void 0)||(t[n]={}),i=e[n];let a;if(i)for(a in i){Va.call(s,a)||(s[a]=[]);const u=i[a];vm(s[a],Array.isArray(u)?u:u?[u]:[])}}}function vm(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);lt(t,0,0,r)}function Nl(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function bt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ze=Yt(/[A-Za-z]/),Ye=Yt(/[\dA-Za-z]/),Dm=Yt(/[#-'*+\--9=?A-Z^-~]/);function Br(t){return t!==null&&(t<32||t===127)}const Ws=Yt(/\d/),Pm=Yt(/[\dA-Fa-f]/),Mm=Yt(/[!-/:-@[-`{-~]/);function ee(t){return t!==null&&t<-2}function xe(t){return t!==null&&(t<0||t===32)}function oe(t){return t===-2||t===-1||t===32}const Kr=Yt(new RegExp("\\p{P}|\\p{S}","u")),nn=Yt(/\s/);function Yt(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Cn(t){const e=[];let n=-1,r=0,s=0;for(;++n<t.length;){const i=t.charCodeAt(n);let a="";if(i===37&&Ye(t.charCodeAt(n+1))&&Ye(t.charCodeAt(n+2)))s=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){const u=t.charCodeAt(n+1);i<56320&&u>56319&&u<57344?(a=String.fromCharCode(i,u),s=1):a="�"}else a=String.fromCharCode(i);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return e.join("")+t.slice(r)}function de(t,e,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let i=0;return a;function a(l){return oe(l)?(t.enter(n),u(l)):e(l)}function u(l){return oe(l)&&i++<s?(t.consume(l),u):(t.exit(n),e(l))}}const Bm={tokenize:Fm};function Fm(t){const e=t.attempt(this.parser.constructs.contentInitial,r,s);let n;return e;function r(u){if(u===null){t.consume(u);return}return t.enter("lineEnding"),t.consume(u),t.exit("lineEnding"),de(t,e,"linePrefix")}function s(u){return t.enter("paragraph"),i(u)}function i(u){const l=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,a(u)}function a(u){if(u===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(u);return}return ee(u)?(t.consume(u),t.exit("chunkText"),i):(t.consume(u),a)}}const Um={tokenize:Hm},Ga={tokenize:jm};function Hm(t){const e=this,n=[];let r=0,s,i,a;return u;function u(b){if(r<n.length){const w=n[r];return e.containerState=w[1],t.attempt(w[0].continuation,l,o)(b)}return o(b)}function l(b){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,s&&A();const w=e.events.length;let R=w,I;for(;R--;)if(e.events[R][0]==="exit"&&e.events[R][1].type==="chunkFlow"){I=e.events[R][1].end;break}E(r);let L=w;for(;L<e.events.length;)e.events[L][1].end={...I},L++;return lt(e.events,R+1,0,e.events.slice(w)),e.events.length=L,o(b)}return u(b)}function o(b){if(r===n.length){if(!s)return p(b);if(s.currentConstruct&&s.currentConstruct.concrete)return g(b);e.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Ga,d,f)(b)}function d(b){return s&&A(),E(r),p(b)}function f(b){return e.parser.lazy[e.now().line]=r!==n.length,a=e.now().offset,g(b)}function p(b){return e.containerState={},t.attempt(Ga,h,g)(b)}function h(b){return r++,n.push([e.currentConstruct,e.containerState]),p(b)}function g(b){if(b===null){s&&A(),E(0),t.consume(b);return}return s=s||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:i}),_(b)}function _(b){if(b===null){T(t.exit("chunkFlow"),!0),E(0),t.consume(b);return}return ee(b)?(t.consume(b),T(t.exit("chunkFlow")),r=0,e.interrupt=void 0,u):(t.consume(b),_)}function T(b,w){const R=e.sliceStream(b);if(w&&R.push(null),b.previous=i,i&&(i.next=b),i=b,s.defineSkip(b.start),s.write(R),e.parser.lazy[b.start.line]){let I=s.events.length;for(;I--;)if(s.events[I][1].start.offset<a&&(!s.events[I][1].end||s.events[I][1].end.offset>a))return;const L=e.events.length;let M=L,P,S;for(;M--;)if(e.events[M][0]==="exit"&&e.events[M][1].type==="chunkFlow"){if(P){S=e.events[M][1].end;break}P=!0}for(E(r),I=L;I<e.events.length;)e.events[I][1].end={...S},I++;lt(e.events,M+1,0,e.events.slice(L)),e.events.length=I}}function E(b){let w=n.length;for(;w-- >b;){const R=n[w];e.containerState=R[1],R[0].exit.call(e,t)}n.length=b}function A(){s.write([null]),i=void 0,s=void 0,e.containerState._closeFlow=void 0}}function jm(t,e,n){return de(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function bn(t){if(t===null||xe(t)||nn(t))return 1;if(Kr(t))return 2}function Jr(t,e,n){const r=[];let s=-1;for(;++s<t.length;){const i=t[s].resolveAll;i&&!r.includes(i)&&(e=i(e,n),r.push(i))}return e}const Qs={name:"attention",resolveAll:zm,tokenize:$m};function zm(t,e){let n=-1,r,s,i,a,u,l,o,d;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;l=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const f={...t[r][1].end},p={...t[n][1].start};Wa(f,-l),Wa(p,l),a={type:l>1?"strongSequence":"emphasisSequence",start:f,end:{...t[r][1].end}},u={type:l>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},s={type:l>1?"strong":"emphasis",start:{...a.start},end:{...u.end}},t[r][1].end={...a.start},t[n][1].start={...u.end},o=[],t[r][1].end.offset-t[r][1].start.offset&&(o=ht(o,[["enter",t[r][1],e],["exit",t[r][1],e]])),o=ht(o,[["enter",s,e],["enter",a,e],["exit",a,e],["enter",i,e]]),o=ht(o,Jr(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),o=ht(o,[["exit",i,e],["enter",u,e],["exit",u,e],["exit",s,e]]),t[n][1].end.offset-t[n][1].start.offset?(d=2,o=ht(o,[["enter",t[n][1],e],["exit",t[n][1],e]])):d=0,lt(t,r-1,n-r+3,o),n=r+o.length-d-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function $m(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=bn(r);let i;return a;function a(l){return i=l,t.enter("attentionSequence"),u(l)}function u(l){if(l===i)return t.consume(l),u;const o=t.exit("attentionSequence"),d=bn(l),f=!d||d===2&&s||n.includes(l),p=!s||s===2&&d||n.includes(r);return o._open=!!(i===42?f:f&&(s||!p)),o._close=!!(i===42?p:p&&(d||!f)),e(l)}}function Wa(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const Ym={name:"autolink",tokenize:qm};function qm(t,e,n){let r=0;return s;function s(h){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),i}function i(h){return Ze(h)?(t.consume(h),a):h===64?n(h):o(h)}function a(h){return h===43||h===45||h===46||Ye(h)?(r=1,u(h)):o(h)}function u(h){return h===58?(t.consume(h),r=0,l):(h===43||h===45||h===46||Ye(h))&&r++<32?(t.consume(h),u):(r=0,o(h))}function l(h){return h===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.exit("autolink"),e):h===null||h===32||h===60||Br(h)?n(h):(t.consume(h),l)}function o(h){return h===64?(t.consume(h),d):Dm(h)?(t.consume(h),o):n(h)}function d(h){return Ye(h)?f(h):n(h)}function f(h){return h===46?(t.consume(h),r=0,d):h===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(h),t.exit("autolinkMarker"),t.exit("autolink"),e):p(h)}function p(h){if((h===45||Ye(h))&&r++<63){const g=h===45?p:f;return t.consume(h),g}return n(h)}}const mr={partial:!0,tokenize:Vm};function Vm(t,e,n){return r;function r(i){return oe(i)?de(t,s,"linePrefix")(i):s(i)}function s(i){return i===null||ee(i)?e(i):n(i)}}const Sl={continuation:{tokenize:Wm},exit:Qm,name:"blockQuote",tokenize:Gm};function Gm(t,e,n){const r=this;return s;function s(a){if(a===62){const u=r.containerState;return u.open||(t.enter("blockQuote",{_container:!0}),u.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),i}return n(a)}function i(a){return oe(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function Wm(t,e,n){const r=this;return s;function s(a){return oe(a)?de(t,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return t.attempt(Sl,e,n)(a)}}function Qm(t){t.exit("blockQuote")}const wl={name:"characterEscape",tokenize:Xm};function Xm(t,e,n){return r;function r(i){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(i),t.exit("escapeMarker"),s}function s(i){return Mm(i)?(t.enter("characterEscapeValue"),t.consume(i),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(i)}}const Rl={name:"characterReference",tokenize:Zm};function Zm(t,e,n){const r=this;let s=0,i,a;return u;function u(f){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),l}function l(f){return f===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(f),t.exit("characterReferenceMarkerNumeric"),o):(t.enter("characterReferenceValue"),i=31,a=Ye,d(f))}function o(f){return f===88||f===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(f),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),i=6,a=Pm,d):(t.enter("characterReferenceValue"),i=7,a=Ws,d(f))}function d(f){if(f===59&&s){const p=t.exit("characterReferenceValue");return a===Ye&&!Di(r.sliceSerialize(p))?n(f):(t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(f)&&s++<i?(t.consume(f),d):n(f)}}const Qa={partial:!0,tokenize:Jm},Xa={concrete:!0,name:"codeFenced",tokenize:Km};function Km(t,e,n){const r=this,s={partial:!0,tokenize:R};let i=0,a=0,u;return l;function l(I){return o(I)}function o(I){const L=r.events[r.events.length-1];return i=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,u=I,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),d(I)}function d(I){return I===u?(a++,t.consume(I),d):a<3?n(I):(t.exit("codeFencedFenceSequence"),oe(I)?de(t,f,"whitespace")(I):f(I))}function f(I){return I===null||ee(I)?(t.exit("codeFencedFence"),r.interrupt?e(I):t.check(Qa,_,w)(I)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(I))}function p(I){return I===null||ee(I)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(I)):oe(I)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),de(t,h,"whitespace")(I)):I===96&&I===u?n(I):(t.consume(I),p)}function h(I){return I===null||ee(I)?f(I):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),g(I))}function g(I){return I===null||ee(I)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),f(I)):I===96&&I===u?n(I):(t.consume(I),g)}function _(I){return t.attempt(s,w,T)(I)}function T(I){return t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),E}function E(I){return i>0&&oe(I)?de(t,A,"linePrefix",i+1)(I):A(I)}function A(I){return I===null||ee(I)?t.check(Qa,_,w)(I):(t.enter("codeFlowValue"),b(I))}function b(I){return I===null||ee(I)?(t.exit("codeFlowValue"),A(I)):(t.consume(I),b)}function w(I){return t.exit("codeFenced"),e(I)}function R(I,L,M){let P=0;return S;function S(U){return I.enter("lineEnding"),I.consume(U),I.exit("lineEnding"),B}function B(U){return I.enter("codeFencedFence"),oe(U)?de(I,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):$(U)}function $(U){return U===u?(I.enter("codeFencedFenceSequence"),X(U)):M(U)}function X(U){return U===u?(P++,I.consume(U),X):P>=a?(I.exit("codeFencedFenceSequence"),oe(U)?de(I,q,"whitespace")(U):q(U)):M(U)}function q(U){return U===null||ee(U)?(I.exit("codeFencedFence"),L(U)):M(U)}}}function Jm(t,e,n){const r=this;return s;function s(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i)}function i(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const gs={name:"codeIndented",tokenize:t1},e1={partial:!0,tokenize:n1};function t1(t,e,n){const r=this;return s;function s(o){return t.enter("codeIndented"),de(t,i,"linePrefix",5)(o)}function i(o){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(o):n(o)}function a(o){return o===null?l(o):ee(o)?t.attempt(e1,a,l)(o):(t.enter("codeFlowValue"),u(o))}function u(o){return o===null||ee(o)?(t.exit("codeFlowValue"),a(o)):(t.consume(o),u)}function l(o){return t.exit("codeIndented"),e(o)}}function n1(t,e,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):ee(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):de(t,i,"linePrefix",5)(a)}function i(a){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(a):ee(a)?s(a):n(a)}}const r1={name:"codeText",previous:i1,resolve:s1,tokenize:a1};function s1(t){let e=t.length-4,n=3,r,s;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)s===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(s=r):(r===e||t[r][1].type==="lineEnding")&&(t[s][1].type="codeTextData",r!==s+2&&(t[s][1].end=t[r-1][1].end,t.splice(s+2,r-s-2),e-=r-s-2,r=s+2),s=void 0);return t}function i1(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function a1(t,e,n){let r=0,s,i;return a;function a(f){return t.enter("codeText"),t.enter("codeTextSequence"),u(f)}function u(f){return f===96?(t.consume(f),r++,u):(t.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(t.enter("space"),t.consume(f),t.exit("space"),l):f===96?(i=t.enter("codeTextSequence"),s=0,d(f)):ee(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),l):(t.enter("codeTextData"),o(f))}function o(f){return f===null||f===32||f===96||ee(f)?(t.exit("codeTextData"),l(f)):(t.consume(f),o)}function d(f){return f===96?(t.consume(f),s++,d):s===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(f)):(i.type="codeTextData",o(f))}}class u1{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const s=n||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&vn(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),vn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),vn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);vn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);vn(this.left,n.reverse())}}}function vn(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function Ol(t){const e={};let n=-1,r,s,i,a,u,l,o;const d=new u1(t);for(;++n<d.length;){for(;n in e;)n=e[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,o1(d,n)),n=e[n],o=!0);else if(r[1]._container){for(i=n,s=void 0;i--;)if(a=d.get(i),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(s&&(d.get(s)[1].type="lineEndingBlank"),a[1].type="lineEnding",s=i);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;s&&(r[1].end={...d.get(s)[1].start},u=d.slice(s,n),u.unshift(r),d.splice(s,n-s+1,u))}}return lt(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!o}function o1(t,e){const n=t.get(e)[1],r=t.get(e)[2];let s=e-1;const i=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const u=a.events,l=[],o={};let d,f,p=-1,h=n,g=0,_=0;const T=[_];for(;h;){for(;t.get(++s)[1]!==h;);i.push(s),h._tokenizer||(d=r.sliceStream(h),h.next||d.push(null),f&&a.defineSkip(h.start),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),h._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++p<u.length;)u[p][0]==="exit"&&u[p-1][0]==="enter"&&u[p][1].type===u[p-1][1].type&&u[p][1].start.line!==u[p][1].end.line&&(_=p+1,T.push(_),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(a.events=[],h?(h._tokenizer=void 0,h.previous=void 0):T.pop(),p=T.length;p--;){const E=u.slice(T[p],T[p+1]),A=i.pop();l.push([A,A+E.length-1]),t.splice(A,2,E)}for(l.reverse(),p=-1;++p<l.length;)o[g+l[p][0]]=g+l[p][1],g+=l[p][1]-l[p][0]-1;return o}const l1={resolve:d1,tokenize:f1},c1={partial:!0,tokenize:h1};function d1(t){return Ol(t),t}function f1(t,e){let n;return r;function r(u){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),s(u)}function s(u){return u===null?i(u):ee(u)?t.check(c1,a,i)(u):(t.consume(u),s)}function i(u){return t.exit("chunkContent"),t.exit("content"),e(u)}function a(u){return t.consume(u),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function h1(t,e,n){const r=this;return s;function s(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),de(t,i,"linePrefix")}function i(a){if(a===null||ee(a))return n(a);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function Ll(t,e,n,r,s,i,a,u,l){const o=l||Number.POSITIVE_INFINITY;let d=0;return f;function f(E){return E===60?(t.enter(r),t.enter(s),t.enter(i),t.consume(E),t.exit(i),p):E===null||E===32||E===41||Br(E)?n(E):(t.enter(r),t.enter(a),t.enter(u),t.enter("chunkString",{contentType:"string"}),_(E))}function p(E){return E===62?(t.enter(i),t.consume(E),t.exit(i),t.exit(s),t.exit(r),e):(t.enter(u),t.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===62?(t.exit("chunkString"),t.exit(u),p(E)):E===null||E===60||ee(E)?n(E):(t.consume(E),E===92?g:h)}function g(E){return E===60||E===62||E===92?(t.consume(E),h):h(E)}function _(E){return!d&&(E===null||E===41||xe(E))?(t.exit("chunkString"),t.exit(u),t.exit(a),t.exit(r),e(E)):d<o&&E===40?(t.consume(E),d++,_):E===41?(t.consume(E),d--,_):E===null||E===32||E===40||Br(E)?n(E):(t.consume(E),E===92?T:_)}function T(E){return E===40||E===41||E===92?(t.consume(E),_):_(E)}}function vl(t,e,n,r,s,i){const a=this;let u=0,l;return o;function o(h){return t.enter(r),t.enter(s),t.consume(h),t.exit(s),t.enter(i),d}function d(h){return u>999||h===null||h===91||h===93&&!l||h===94&&!u&&"_hiddenFootnoteSupport"in a.parser.constructs?n(h):h===93?(t.exit(i),t.enter(s),t.consume(h),t.exit(s),t.exit(r),e):ee(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),d):(t.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||ee(h)||u++>999?(t.exit("chunkString"),d(h)):(t.consume(h),l||(l=!oe(h)),h===92?p:f)}function p(h){return h===91||h===92||h===93?(t.consume(h),u++,f):f(h)}}function Dl(t,e,n,r,s,i){let a;return u;function u(p){return p===34||p===39||p===40?(t.enter(r),t.enter(s),t.consume(p),t.exit(s),a=p===40?41:p,l):n(p)}function l(p){return p===a?(t.enter(s),t.consume(p),t.exit(s),t.exit(r),e):(t.enter(i),o(p))}function o(p){return p===a?(t.exit(i),l(a)):p===null?n(p):ee(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),de(t,o,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===a||p===null||ee(p)?(t.exit("chunkString"),o(p)):(t.consume(p),p===92?f:d)}function f(p){return p===a||p===92?(t.consume(p),d):d(p)}}function Yn(t,e){let n;return r;function r(s){return ee(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),n=!0,r):oe(s)?de(t,r,n?"linePrefix":"lineSuffix")(s):e(s)}}const p1={name:"definition",tokenize:g1},m1={partial:!0,tokenize:b1};function g1(t,e,n){const r=this;let s;return i;function i(h){return t.enter("definition"),a(h)}function a(h){return vl.call(r,t,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function u(h){return s=bt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(t.enter("definitionMarker"),t.consume(h),t.exit("definitionMarker"),l):n(h)}function l(h){return xe(h)?Yn(t,o)(h):o(h)}function o(h){return Ll(t,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function d(h){return t.attempt(m1,f,f)(h)}function f(h){return oe(h)?de(t,p,"whitespace")(h):p(h)}function p(h){return h===null||ee(h)?(t.exit("definition"),r.parser.defined.push(s),e(h)):n(h)}}function b1(t,e,n){return r;function r(u){return xe(u)?Yn(t,s)(u):n(u)}function s(u){return Dl(t,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function i(u){return oe(u)?de(t,a,"whitespace")(u):a(u)}function a(u){return u===null||ee(u)?e(u):n(u)}}const E1={name:"hardBreakEscape",tokenize:T1};function T1(t,e,n){return r;function r(i){return t.enter("hardBreakEscape"),t.consume(i),s}function s(i){return ee(i)?(t.exit("hardBreakEscape"),e(i)):n(i)}}const x1={name:"headingAtx",resolve:_1,tokenize:y1};function _1(t,e){let n=t.length-2,r=3,s,i;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},i={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},lt(t,r,n-r+1,[["enter",s,e],["enter",i,e],["exit",i,e],["exit",s,e]])),t}function y1(t,e,n){let r=0;return s;function s(d){return t.enter("atxHeading"),i(d)}function i(d){return t.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(t.consume(d),a):d===null||xe(d)?(t.exit("atxHeadingSequence"),u(d)):n(d)}function u(d){return d===35?(t.enter("atxHeadingSequence"),l(d)):d===null||ee(d)?(t.exit("atxHeading"),e(d)):oe(d)?de(t,u,"whitespace")(d):(t.enter("atxHeadingText"),o(d))}function l(d){return d===35?(t.consume(d),l):(t.exit("atxHeadingSequence"),u(d))}function o(d){return d===null||d===35||xe(d)?(t.exit("atxHeadingText"),u(d)):(t.consume(d),o)}}const A1=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Za=["pre","script","style","textarea"],k1={concrete:!0,name:"htmlFlow",resolveTo:N1,tokenize:S1},C1={partial:!0,tokenize:R1},I1={partial:!0,tokenize:w1};function N1(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function S1(t,e,n){const r=this;let s,i,a,u,l;return o;function o(N){return d(N)}function d(N){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(N),f}function f(N){return N===33?(t.consume(N),p):N===47?(t.consume(N),i=!0,_):N===63?(t.consume(N),s=3,r.interrupt?e:k):Ze(N)?(t.consume(N),a=String.fromCharCode(N),T):n(N)}function p(N){return N===45?(t.consume(N),s=2,h):N===91?(t.consume(N),s=5,u=0,g):Ze(N)?(t.consume(N),s=4,r.interrupt?e:k):n(N)}function h(N){return N===45?(t.consume(N),r.interrupt?e:k):n(N)}function g(N){const Ee="CDATA[";return N===Ee.charCodeAt(u++)?(t.consume(N),u===Ee.length?r.interrupt?e:$:g):n(N)}function _(N){return Ze(N)?(t.consume(N),a=String.fromCharCode(N),T):n(N)}function T(N){if(N===null||N===47||N===62||xe(N)){const Ee=N===47,ve=a.toLowerCase();return!Ee&&!i&&Za.includes(ve)?(s=1,r.interrupt?e(N):$(N)):A1.includes(a.toLowerCase())?(s=6,Ee?(t.consume(N),E):r.interrupt?e(N):$(N)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):i?A(N):b(N))}return N===45||Ye(N)?(t.consume(N),a+=String.fromCharCode(N),T):n(N)}function E(N){return N===62?(t.consume(N),r.interrupt?e:$):n(N)}function A(N){return oe(N)?(t.consume(N),A):S(N)}function b(N){return N===47?(t.consume(N),S):N===58||N===95||Ze(N)?(t.consume(N),w):oe(N)?(t.consume(N),b):S(N)}function w(N){return N===45||N===46||N===58||N===95||Ye(N)?(t.consume(N),w):R(N)}function R(N){return N===61?(t.consume(N),I):oe(N)?(t.consume(N),R):b(N)}function I(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(t.consume(N),l=N,L):oe(N)?(t.consume(N),I):M(N)}function L(N){return N===l?(t.consume(N),l=null,P):N===null||ee(N)?n(N):(t.consume(N),L)}function M(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||xe(N)?R(N):(t.consume(N),M)}function P(N){return N===47||N===62||oe(N)?b(N):n(N)}function S(N){return N===62?(t.consume(N),B):n(N)}function B(N){return N===null||ee(N)?$(N):oe(N)?(t.consume(N),B):n(N)}function $(N){return N===45&&s===2?(t.consume(N),W):N===60&&s===1?(t.consume(N),V):N===62&&s===4?(t.consume(N),re):N===63&&s===3?(t.consume(N),k):N===93&&s===5?(t.consume(N),J):ee(N)&&(s===6||s===7)?(t.exit("htmlFlowData"),t.check(C1,he,X)(N)):N===null||ee(N)?(t.exit("htmlFlowData"),X(N)):(t.consume(N),$)}function X(N){return t.check(I1,q,he)(N)}function q(N){return t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),U}function U(N){return N===null||ee(N)?X(N):(t.enter("htmlFlowData"),$(N))}function W(N){return N===45?(t.consume(N),k):$(N)}function V(N){return N===47?(t.consume(N),a="",K):$(N)}function K(N){if(N===62){const Ee=a.toLowerCase();return Za.includes(Ee)?(t.consume(N),re):$(N)}return Ze(N)&&a.length<8?(t.consume(N),a+=String.fromCharCode(N),K):$(N)}function J(N){return N===93?(t.consume(N),k):$(N)}function k(N){return N===62?(t.consume(N),re):N===45&&s===2?(t.consume(N),k):$(N)}function re(N){return N===null||ee(N)?(t.exit("htmlFlowData"),he(N)):(t.consume(N),re)}function he(N){return t.exit("htmlFlow"),e(N)}}function w1(t,e,n){const r=this;return s;function s(a){return ee(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):n(a)}function i(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function R1(t,e,n){return r;function r(s){return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),t.attempt(mr,e,n)}}const O1={name:"htmlText",tokenize:L1};function L1(t,e,n){const r=this;let s,i,a;return u;function u(k){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(k),l}function l(k){return k===33?(t.consume(k),o):k===47?(t.consume(k),R):k===63?(t.consume(k),b):Ze(k)?(t.consume(k),M):n(k)}function o(k){return k===45?(t.consume(k),d):k===91?(t.consume(k),i=0,g):Ze(k)?(t.consume(k),A):n(k)}function d(k){return k===45?(t.consume(k),h):n(k)}function f(k){return k===null?n(k):k===45?(t.consume(k),p):ee(k)?(a=f,V(k)):(t.consume(k),f)}function p(k){return k===45?(t.consume(k),h):f(k)}function h(k){return k===62?W(k):k===45?p(k):f(k)}function g(k){const re="CDATA[";return k===re.charCodeAt(i++)?(t.consume(k),i===re.length?_:g):n(k)}function _(k){return k===null?n(k):k===93?(t.consume(k),T):ee(k)?(a=_,V(k)):(t.consume(k),_)}function T(k){return k===93?(t.consume(k),E):_(k)}function E(k){return k===62?W(k):k===93?(t.consume(k),E):_(k)}function A(k){return k===null||k===62?W(k):ee(k)?(a=A,V(k)):(t.consume(k),A)}function b(k){return k===null?n(k):k===63?(t.consume(k),w):ee(k)?(a=b,V(k)):(t.consume(k),b)}function w(k){return k===62?W(k):b(k)}function R(k){return Ze(k)?(t.consume(k),I):n(k)}function I(k){return k===45||Ye(k)?(t.consume(k),I):L(k)}function L(k){return ee(k)?(a=L,V(k)):oe(k)?(t.consume(k),L):W(k)}function M(k){return k===45||Ye(k)?(t.consume(k),M):k===47||k===62||xe(k)?P(k):n(k)}function P(k){return k===47?(t.consume(k),W):k===58||k===95||Ze(k)?(t.consume(k),S):ee(k)?(a=P,V(k)):oe(k)?(t.consume(k),P):W(k)}function S(k){return k===45||k===46||k===58||k===95||Ye(k)?(t.consume(k),S):B(k)}function B(k){return k===61?(t.consume(k),$):ee(k)?(a=B,V(k)):oe(k)?(t.consume(k),B):P(k)}function $(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(t.consume(k),s=k,X):ee(k)?(a=$,V(k)):oe(k)?(t.consume(k),$):(t.consume(k),q)}function X(k){return k===s?(t.consume(k),s=void 0,U):k===null?n(k):ee(k)?(a=X,V(k)):(t.consume(k),X)}function q(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||xe(k)?P(k):(t.consume(k),q)}function U(k){return k===47||k===62||xe(k)?P(k):n(k)}function W(k){return k===62?(t.consume(k),t.exit("htmlTextData"),t.exit("htmlText"),e):n(k)}function V(k){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(k),t.exit("lineEnding"),K}function K(k){return oe(k)?de(t,J,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):J(k)}function J(k){return t.enter("htmlTextData"),a(k)}}const Pi={name:"labelEnd",resolveAll:M1,resolveTo:B1,tokenize:F1},v1={tokenize:U1},D1={tokenize:H1},P1={tokenize:j1};function M1(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",e+=s}}return t.length!==n.length&<(t,0,t.length,n),t}function B1(t,e){let n=t.length,r=0,s,i,a,u;for(;n--;)if(s=t[n][1],i){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;t[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(i=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(a=n);const l={type:t[i][1].type==="labelLink"?"link":"image",start:{...t[i][1].start},end:{...t[t.length-1][1].end}},o={type:"label",start:{...t[i][1].start},end:{...t[a][1].end}},d={type:"labelText",start:{...t[i+r+2][1].end},end:{...t[a-2][1].start}};return u=[["enter",l,e],["enter",o,e]],u=ht(u,t.slice(i+1,i+r+3)),u=ht(u,[["enter",d,e]]),u=ht(u,Jr(e.parser.constructs.insideSpan.null,t.slice(i+r+4,a-3),e)),u=ht(u,[["exit",d,e],t[a-2],t[a-1],["exit",o,e]]),u=ht(u,t.slice(a+1)),u=ht(u,[["exit",l,e]]),lt(t,i,t.length,u),t}function F1(t,e,n){const r=this;let s=r.events.length,i,a;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){i=r.events[s][1];break}return u;function u(p){return i?i._inactive?f(p):(a=r.parser.defined.includes(bt(r.sliceSerialize({start:i.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),l):n(p)}function l(p){return p===40?t.attempt(v1,d,a?d:f)(p):p===91?t.attempt(D1,d,a?o:f)(p):a?d(p):f(p)}function o(p){return t.attempt(P1,d,f)(p)}function d(p){return e(p)}function f(p){return i._balanced=!0,n(p)}}function U1(t,e,n){return r;function r(f){return t.enter("resource"),t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),s}function s(f){return xe(f)?Yn(t,i)(f):i(f)}function i(f){return f===41?d(f):Ll(t,a,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function a(f){return xe(f)?Yn(t,l)(f):d(f)}function u(f){return n(f)}function l(f){return f===34||f===39||f===40?Dl(t,o,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):d(f)}function o(f){return xe(f)?Yn(t,d)(f):d(f)}function d(f){return f===41?(t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),t.exit("resource"),e):n(f)}}function H1(t,e,n){const r=this;return s;function s(u){return vl.call(r,t,i,a,"reference","referenceMarker","referenceString")(u)}function i(u){return r.parser.defined.includes(bt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(u):n(u)}function a(u){return n(u)}}function j1(t,e,n){return r;function r(i){return t.enter("reference"),t.enter("referenceMarker"),t.consume(i),t.exit("referenceMarker"),s}function s(i){return i===93?(t.enter("referenceMarker"),t.consume(i),t.exit("referenceMarker"),t.exit("reference"),e):n(i)}}const z1={name:"labelStartImage",resolveAll:Pi.resolveAll,tokenize:$1};function $1(t,e,n){const r=this;return s;function s(u){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(u),t.exit("labelImageMarker"),i}function i(u){return u===91?(t.enter("labelMarker"),t.consume(u),t.exit("labelMarker"),t.exit("labelImage"),a):n(u)}function a(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):e(u)}}const Y1={name:"labelStartLink",resolveAll:Pi.resolveAll,tokenize:q1};function q1(t,e,n){const r=this;return s;function s(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),i}function i(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const bs={name:"lineEnding",tokenize:V1};function V1(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),de(t,e,"linePrefix")}}const wr={name:"thematicBreak",tokenize:G1};function G1(t,e,n){let r=0,s;return i;function i(o){return t.enter("thematicBreak"),a(o)}function a(o){return s=o,u(o)}function u(o){return o===s?(t.enter("thematicBreakSequence"),l(o)):r>=3&&(o===null||ee(o))?(t.exit("thematicBreak"),e(o)):n(o)}function l(o){return o===s?(t.consume(o),r++,l):(t.exit("thematicBreakSequence"),oe(o)?de(t,u,"whitespace")(o):u(o))}}const tt={continuation:{tokenize:Z1},exit:J1,name:"list",tokenize:X1},W1={partial:!0,tokenize:eg},Q1={partial:!0,tokenize:K1};function X1(t,e,n){const r=this,s=r.events[r.events.length-1];let i=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return u;function u(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Ws(h)){if(r.containerState.type||(r.containerState.type=g,t.enter(g,{_container:!0})),g==="listUnordered")return t.enter("listItemPrefix"),h===42||h===45?t.check(wr,n,o)(h):o(h);if(!r.interrupt||h===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),l(h)}return n(h)}function l(h){return Ws(h)&&++a<10?(t.consume(h),l):(!r.interrupt||a<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(t.exit("listItemValue"),o(h)):n(h)}function o(h){return t.enter("listItemMarker"),t.consume(h),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,t.check(mr,r.interrupt?n:d,t.attempt(W1,p,f))}function d(h){return r.containerState.initialBlankLine=!0,i++,p(h)}function f(h){return oe(h)?(t.enter("listItemPrefixWhitespace"),t.consume(h),t.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=i+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(h)}}function Z1(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(mr,s,i);function s(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,de(t,e,"listItemIndent",r.containerState.size+1)(u)}function i(u){return r.containerState.furtherBlankLines||!oe(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(Q1,e,a)(u))}function a(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,de(t,t.attempt(tt,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function K1(t,e,n){const r=this;return de(t,s,"listItemIndent",r.containerState.size+1);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?e(i):n(i)}}function J1(t){t.exit(this.containerState.type)}function eg(t,e,n){const r=this;return de(t,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(i){const a=r.events[r.events.length-1];return!oe(i)&&a&&a[1].type==="listItemPrefixWhitespace"?e(i):n(i)}}const Ka={name:"setextUnderline",resolveTo:tg,tokenize:ng};function tg(t,e){let n=t.length,r,s,i;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(s=n)}else t[n][1].type==="content"&&t.splice(n,1),!i&&t[n][1].type==="definition"&&(i=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[s][1].type="setextHeadingText",i?(t.splice(s,0,["enter",a,e]),t.splice(i+1,0,["exit",t[r][1],e]),t[r][1].end={...t[i][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function ng(t,e,n){const r=this;let s;return i;function i(o){let d=r.events.length,f;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){f=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(t.enter("setextHeadingLine"),s=o,a(o)):n(o)}function a(o){return t.enter("setextHeadingLineSequence"),u(o)}function u(o){return o===s?(t.consume(o),u):(t.exit("setextHeadingLineSequence"),oe(o)?de(t,l,"lineSuffix")(o):l(o))}function l(o){return o===null||ee(o)?(t.exit("setextHeadingLine"),e(o)):n(o)}}const rg={tokenize:sg};function sg(t){const e=this,n=t.attempt(mr,r,t.attempt(this.parser.constructs.flowInitial,s,de(t,t.attempt(this.parser.constructs.flow,s,t.attempt(l1,s)),"linePrefix")));return n;function r(i){if(i===null){t.consume(i);return}return t.enter("lineEndingBlank"),t.consume(i),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function s(i){if(i===null){t.consume(i);return}return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const ig={resolveAll:Ml()},ag=Pl("string"),ug=Pl("text");function Pl(t){return{resolveAll:Ml(t==="text"?og:void 0),tokenize:e};function e(n){const r=this,s=this.parser.constructs[t],i=n.attempt(s,a,u);return a;function a(d){return o(d)?i(d):u(d)}function u(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),l}function l(d){return o(d)?(n.exit("data"),i(d)):(n.consume(d),l)}function o(d){if(d===null)return!0;const f=s[d];let p=-1;if(f)for(;++p<f.length;){const h=f[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Ml(t){return e;function e(n,r){let s=-1,i;for(;++s<=n.length;)i===void 0?n[s]&&n[s][1].type==="data"&&(i=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==i+2&&(n[i][1].end=n[s-1][1].end,n.splice(i+2,s-i-2),s=i+2),i=void 0);return t?t(n,r):n}}function og(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],s=e.sliceStream(r);let i=s.length,a=-1,u=0,l;for(;i--;){const o=s[i];if(typeof o=="string"){for(a=o.length;o.charCodeAt(a-1)===32;)u++,a--;if(a)break;a=-1}else if(o===-2)l=!0,u++;else if(o!==-1){i++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(u=0),u){const o={type:n===t.length||l||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:r.start._bufferIndex+a,_index:r.start._index+i,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...o.start},r.start.offset===r.end.offset?Object.assign(r,o):(t.splice(n,0,["enter",o,e],["exit",o,e]),n+=2)}n++}return t}const lg={42:tt,43:tt,45:tt,48:tt,49:tt,50:tt,51:tt,52:tt,53:tt,54:tt,55:tt,56:tt,57:tt,62:Sl},cg={91:p1},dg={[-2]:gs,[-1]:gs,32:gs},fg={35:x1,42:wr,45:[Ka,wr],60:k1,61:Ka,95:wr,96:Xa,126:Xa},hg={38:Rl,92:wl},pg={[-5]:bs,[-4]:bs,[-3]:bs,33:z1,38:Rl,42:Qs,60:[Ym,O1],91:Y1,92:[E1,wl],93:Pi,95:Qs,96:r1},mg={null:[Qs,ig]},gg={null:[42,95]},bg={null:[]},Eg=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:gg,contentInitial:cg,disable:bg,document:lg,flow:fg,flowInitial:dg,insideSpan:mg,string:hg,text:pg},Symbol.toStringTag,{value:"Module"}));function Tg(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},i=[];let a=[],u=[];const l={attempt:L(R),check:L(I),consume:A,enter:b,exit:w,interrupt:L(I,{interrupt:!0})},o={code:null,containerState:{},defineSkip:_,events:[],now:g,parser:t,previous:null,sliceSerialize:p,sliceStream:h,write:f};let d=e.tokenize.call(o,l);return e.resolveAll&&i.push(e),o;function f(B){return a=ht(a,B),T(),a[a.length-1]!==null?[]:(M(e,0),o.events=Jr(i,o.events,o),o.events)}function p(B,$){return _g(h(B),$)}function h(B){return xg(a,B)}function g(){const{_bufferIndex:B,_index:$,line:X,column:q,offset:U}=r;return{_bufferIndex:B,_index:$,line:X,column:q,offset:U}}function _(B){s[B.line]=B.column,S()}function T(){let B;for(;r._index<a.length;){const $=a[r._index];if(typeof $=="string")for(B=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===B&&r._bufferIndex<$.length;)E($.charCodeAt(r._bufferIndex));else E($)}}function E(B){d=d(B)}function A(B){ee(B)?(r.line++,r.column=1,r.offset+=B===-3?2:1,S()):B!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),o.previous=B}function b(B,$){const X=$||{};return X.type=B,X.start=g(),o.events.push(["enter",X,o]),u.push(X),X}function w(B){const $=u.pop();return $.end=g(),o.events.push(["exit",$,o]),$}function R(B,$){M(B,$.from)}function I(B,$){$.restore()}function L(B,$){return X;function X(q,U,W){let V,K,J,k;return Array.isArray(q)?he(q):"tokenize"in q?he([q]):re(q);function re(fe){return Ge;function Ge(Ie){const Ne=Ie!==null&&fe[Ie],ye=Ie!==null&&fe.null,Fe=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(ye)?ye:ye?[ye]:[]];return he(Fe)(Ie)}}function he(fe){return V=fe,K=0,fe.length===0?W:N(fe[K])}function N(fe){return Ge;function Ge(Ie){return k=P(),J=fe,fe.partial||(o.currentConstruct=fe),fe.name&&o.parser.constructs.disable.null.includes(fe.name)?ve():fe.tokenize.call($?Object.assign(Object.create(o),$):o,l,Ee,ve)(Ie)}}function Ee(fe){return B(J,k),U}function ve(fe){return k.restore(),++K<V.length?N(V[K]):W}}}function M(B,$){B.resolveAll&&!i.includes(B)&&i.push(B),B.resolve&<(o.events,$,o.events.length-$,B.resolve(o.events.slice($),o)),B.resolveTo&&(o.events=B.resolveTo(o.events,o))}function P(){const B=g(),$=o.previous,X=o.currentConstruct,q=o.events.length,U=Array.from(u);return{from:q,restore:W};function W(){r=B,o.previous=$,o.currentConstruct=X,o.events.length=q,u=U,S()}}function S(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function xg(t,e){const n=e.start._index,r=e.start._bufferIndex,s=e.end._index,i=e.end._bufferIndex;let a;if(n===s)a=[t[n].slice(r,i)];else{if(a=t.slice(n,s),r>-1){const u=a[0];typeof u=="string"?a[0]=u.slice(r):a.shift()}i>0&&a.push(t[s].slice(0,i))}return a}function _g(t,e){let n=-1;const r=[];let s;for(;++n<t.length;){const i=t[n];let a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
|
|
78
78
|
`;break}case-3:{a=`\r
|
|
79
|
-
`;break}case-2:{a=e?" ":" ";break}case-1:{if(!e&&s)continue;a=" ";break}default:a=String.fromCharCode(i)}s=i===-2,r.push(a)}return r.join("")}function yg(t){const r={constructs:Il([Eg,...(t||{}).extensions||[]]),content:s(Bm),defined:[],document:s(Um),flow:s(rg),lazy:{},string:s(ag),text:s(ug)};return r;function s(i){return a;function a(u){return Tg(r,i,u)}}}function Ag(t){for(;!Ol(t););return t}const eu=/[\0\t\n\r]/g;function kg(){let t=1,e="",n=!0,r;return s;function s(i,a,u){const l=[];let o,d,f,p,h;for(i=e+(typeof i=="string"?i.toString():new TextDecoder(a||void 0).decode(i)),f=0,e="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(eu.lastIndex=f,o=eu.exec(i),p=o&&o.index!==void 0?o.index:i.length,h=i.charCodeAt(p),!o){e=i.slice(f);break}if(h===10&&f===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<p&&(l.push(i.slice(f,p)),t+=p-f),h){case 0:{l.push(65533),t++;break}case 9:{for(d=Math.ceil(t/4)*4,l.push(-2);t++<d;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:r=!0,t=1}f=p+1}return u&&(r&&l.push(-5),e&&l.push(e),l.push(null)),l}}const Cg=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ig(t){return t.replace(Cg,Ng)}function Ng(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return Nl(n.slice(i?2:1),i?16:10)}return Pi(n)||t}const Bl={}.hasOwnProperty;function Sg(t,e,n){return typeof e!="string"&&(n=e,e=void 0),wg(n)(Ag(yg(n).document().write(kg()(t,e,!0))))}function wg(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Tt),autolinkProtocol:P,autolinkEmail:P,atxHeading:i(Ue),blockQuote:i(ye),characterEscape:P,characterReference:P,codeFenced:i(Fe),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(Fe,a),codeText:i(Re,a),codeTextData:P,data:P,codeFlowValue:P,definition:i(De),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(Oe),hardBreakEscape:i(Se),hardBreakTrailing:i(Se),htmlFlow:i(He,a),htmlFlowData:P,htmlText:i(He,a),htmlTextData:P,image:i(We),label:a,link:i(Tt),listItem:i(qt),listItemValue:p,listOrdered:i(Je,f),listUnordered:i(Je),paragraph:i(st),reference:N,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(Ue),strong:i(dt),thematicBreak:i(le)},exit:{atxHeading:l(),atxHeadingSequence:R,autolink:l(),autolinkEmail:Ne,autolinkProtocol:Ie,blockQuote:l(),characterEscapeValue:S,characterReferenceMarkerHexadecimal:ve,characterReferenceMarkerNumeric:ve,characterReferenceValue:fe,characterReference:Ge,codeFenced:l(T),codeFencedFence:_,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:S,codeIndented:l(E),codeText:l(U),codeTextData:S,data:S,definition:l(),definitionDestinationString:w,definitionLabelString:A,definitionTitleString:b,emphasis:l(),hardBreakEscape:l($),hardBreakTrailing:l($),htmlFlow:l(X),htmlFlowData:S,htmlText:l(q),htmlTextData:S,image:l(V),label:J,labelText:K,lineEnding:B,link:l(W),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Ee,resourceDestinationString:k,resourceTitleString:re,resource:he,setextHeading:l(M),setextHeadingLineSequence:L,setextHeadingText:I,strong:l(),thematicBreak:l()}};Fl(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(D){let Y={type:"root",children:[]};const Z={stack:[Y],tokenStack:[],config:e,enter:u,exit:o,buffer:a,resume:d,data:n},ue=[];let me=-1;for(;++me<D.length;)if(D[me][1].type==="listOrdered"||D[me][1].type==="listUnordered")if(D[me][0]==="enter")ue.push(me);else{const ze=ue.pop();me=s(D,ze,me)}for(me=-1;++me<D.length;){const ze=e[D[me][0]];Bl.call(ze,D[me][1].type)&&ze[D[me][1].type].call(Object.assign({sliceSerialize:D[me][2].sliceSerialize},Z),D[me][1])}if(Z.tokenStack.length>0){const ze=Z.tokenStack[Z.tokenStack.length-1];(ze[1]||tu).call(Z,void 0,ze[0])}for(Y.position={start:Dt(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:Dt(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},me=-1;++me<e.transforms.length;)Y=e.transforms[me](Y)||Y;return Y}function s(D,Y,Z){let ue=Y-1,me=-1,ze=!1,xt,at,vt,Vt;for(;++ue<=Z;){const ut=D[ue];switch(ut[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ut[0]==="enter"?me++:me--,Vt=void 0;break}case"lineEndingBlank":{ut[0]==="enter"&&(xt&&!Vt&&!me&&!vt&&(vt=ue),Vt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vt=void 0}if(!me&&ut[0]==="enter"&&ut[1].type==="listItemPrefix"||me===-1&&ut[0]==="exit"&&(ut[1].type==="listUnordered"||ut[1].type==="listOrdered")){if(xt){let un=ue;for(at=void 0;un--;){const St=D[un];if(St[1].type==="lineEnding"||St[1].type==="lineEndingBlank"){if(St[0]==="exit")continue;at&&(D[at][1].type="lineEndingBlank",ze=!0),St[1].type="lineEnding",at=un}else if(!(St[1].type==="linePrefix"||St[1].type==="blockQuotePrefix"||St[1].type==="blockQuotePrefixWhitespace"||St[1].type==="blockQuoteMarker"||St[1].type==="listItemIndent"))break}vt&&(!at||vt<at)&&(xt._spread=!0),xt.end=Object.assign({},at?D[at][1].start:ut[1].end),D.splice(at||ue,0,["exit",xt,ut[2]]),ue++,Z++}if(ut[1].type==="listItemPrefix"){const un={type:"listItem",_spread:!1,start:Object.assign({},ut[1].start),end:void 0};xt=un,D.splice(ue,0,["enter",un,ut[2]]),ue++,Z++,vt=void 0,Vt=!0}}}return D[Y][1]._spread=ze,Z}function i(D,Y){return Z;function Z(ue){u.call(this,D(ue),ue),Y&&Y.call(this,ue)}}function a(){this.stack.push({type:"fragment",children:[]})}function u(D,Y,Z){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([Y,Z||void 0]),D.position={start:Dt(Y.start),end:void 0}}function l(D){return Y;function Y(Z){D&&D.call(this,Z),o.call(this,Z)}}function o(D,Y){const Z=this.stack.pop(),ue=this.tokenStack.pop();if(ue)ue[0].type!==D.type&&(Y?Y.call(this,D,ue[0]):(ue[1]||tu).call(this,D,ue[0]));else throw new Error("Cannot close `"+D.type+"` ("+$n({start:D.start,end:D.end})+"): it’s not open");Z.position.end=Dt(D.end)}function d(){return Di(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(D){if(this.data.expectingFirstListItemValue){const Y=this.stack[this.stack.length-2];Y.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function h(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.lang=D}function g(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.meta=D}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D.replace(/(\r?\n|\r)$/g,"")}function A(D){const Y=this.resume(),Z=this.stack[this.stack.length-1];Z.label=Y,Z.identifier=bt(this.sliceSerialize(D)).toLowerCase()}function b(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.title=D}function w(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.url=D}function R(D){const Y=this.stack[this.stack.length-1];if(!Y.depth){const Z=this.sliceSerialize(D).length;Y.depth=Z}}function I(){this.data.setextHeadingSlurpLineEnding=!0}function L(D){const Y=this.stack[this.stack.length-1];Y.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function P(D){const Z=this.stack[this.stack.length-1].children;let ue=Z[Z.length-1];(!ue||ue.type!=="text")&&(ue=it(),ue.position={start:Dt(D.start),end:void 0},Z.push(ue)),this.stack.push(ue)}function S(D){const Y=this.stack.pop();Y.value+=this.sliceSerialize(D),Y.position.end=Dt(D.end)}function B(D){const Y=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Z=Y.children[Y.children.length-1];Z.position.end=Dt(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Y.type)&&(P.call(this,D),S.call(this,D))}function $(){this.data.atHardBreak=!0}function X(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D}function q(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D}function U(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D}function W(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=Y,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function V(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=Y,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function K(D){const Y=this.sliceSerialize(D),Z=this.stack[this.stack.length-2];Z.label=Ig(Y),Z.identifier=bt(Y).toLowerCase()}function J(){const D=this.stack[this.stack.length-1],Y=this.resume(),Z=this.stack[this.stack.length-1];if(this.data.inReference=!0,Z.type==="link"){const ue=D.children;Z.children=ue}else Z.alt=Y}function k(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.url=D}function re(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.title=D}function he(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function Ee(D){const Y=this.resume(),Z=this.stack[this.stack.length-1];Z.label=Y,Z.identifier=bt(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function ve(D){this.data.characterReferenceType=D.type}function fe(D){const Y=this.sliceSerialize(D),Z=this.data.characterReferenceType;let ue;Z?(ue=Nl(Y,Z==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ue=Pi(Y);const me=this.stack[this.stack.length-1];me.value+=ue}function Ge(D){const Y=this.stack.pop();Y.position.end=Dt(D.end)}function Ie(D){S.call(this,D);const Y=this.stack[this.stack.length-1];Y.url=this.sliceSerialize(D)}function Ne(D){S.call(this,D);const Y=this.stack[this.stack.length-1];Y.url="mailto:"+this.sliceSerialize(D)}function ye(){return{type:"blockquote",children:[]}}function Fe(){return{type:"code",lang:null,meta:null,value:""}}function Re(){return{type:"inlineCode",value:""}}function De(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Oe(){return{type:"emphasis",children:[]}}function Ue(){return{type:"heading",depth:0,children:[]}}function Se(){return{type:"break"}}function He(){return{type:"html",value:""}}function We(){return{type:"image",title:null,url:"",alt:null}}function Tt(){return{type:"link",title:null,url:"",children:[]}}function Je(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function qt(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function st(){return{type:"paragraph",children:[]}}function dt(){return{type:"strong",children:[]}}function it(){return{type:"text",value:""}}function le(){return{type:"thematicBreak"}}}function Dt(t){return{line:t.line,column:t.column,offset:t.offset}}function Fl(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?Fl(t,r):Rg(t,r)}}function Rg(t,e){let n;for(n in e)if(Bl.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function tu(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+$n({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+$n({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+$n({start:e.start,end:e.end})+") is still open")}function Og(t){const e=this;e.parser=n;function n(r){return Sg(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function Lg(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function vg(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
|
79
|
+
`;break}case-2:{a=e?" ":" ";break}case-1:{if(!e&&s)continue;a=" ";break}default:a=String.fromCharCode(i)}s=i===-2,r.push(a)}return r.join("")}function yg(t){const r={constructs:Il([Eg,...(t||{}).extensions||[]]),content:s(Bm),defined:[],document:s(Um),flow:s(rg),lazy:{},string:s(ag),text:s(ug)};return r;function s(i){return a;function a(u){return Tg(r,i,u)}}}function Ag(t){for(;!Ol(t););return t}const Ja=/[\0\t\n\r]/g;function kg(){let t=1,e="",n=!0,r;return s;function s(i,a,u){const l=[];let o,d,f,p,h;for(i=e+(typeof i=="string"?i.toString():new TextDecoder(a||void 0).decode(i)),f=0,e="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(Ja.lastIndex=f,o=Ja.exec(i),p=o&&o.index!==void 0?o.index:i.length,h=i.charCodeAt(p),!o){e=i.slice(f);break}if(h===10&&f===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<p&&(l.push(i.slice(f,p)),t+=p-f),h){case 0:{l.push(65533),t++;break}case 9:{for(d=Math.ceil(t/4)*4,l.push(-2);t++<d;)l.push(-1);break}case 10:{l.push(-4),t=1;break}default:r=!0,t=1}f=p+1}return u&&(r&&l.push(-5),e&&l.push(e),l.push(null)),l}}const Cg=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ig(t){return t.replace(Cg,Ng)}function Ng(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),i=s===120||s===88;return Nl(n.slice(i?2:1),i?16:10)}return Di(n)||t}const Bl={}.hasOwnProperty;function Sg(t,e,n){return typeof e!="string"&&(n=e,e=void 0),wg(n)(Ag(yg(n).document().write(kg()(t,e,!0))))}function wg(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Tt),autolinkProtocol:P,autolinkEmail:P,atxHeading:i(Ue),blockQuote:i(ye),characterEscape:P,characterReference:P,codeFenced:i(Fe),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(Fe,a),codeText:i(Re,a),codeTextData:P,data:P,codeFlowValue:P,definition:i(De),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(Oe),hardBreakEscape:i(Se),hardBreakTrailing:i(Se),htmlFlow:i(He,a),htmlFlowData:P,htmlText:i(He,a),htmlTextData:P,image:i(We),label:a,link:i(Tt),listItem:i(qt),listItemValue:p,listOrdered:i(Je,f),listUnordered:i(Je),paragraph:i(st),reference:N,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(Ue),strong:i(dt),thematicBreak:i(le)},exit:{atxHeading:l(),atxHeadingSequence:R,autolink:l(),autolinkEmail:Ne,autolinkProtocol:Ie,blockQuote:l(),characterEscapeValue:S,characterReferenceMarkerHexadecimal:ve,characterReferenceMarkerNumeric:ve,characterReferenceValue:fe,characterReference:Ge,codeFenced:l(T),codeFencedFence:_,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:S,codeIndented:l(E),codeText:l(U),codeTextData:S,data:S,definition:l(),definitionDestinationString:w,definitionLabelString:A,definitionTitleString:b,emphasis:l(),hardBreakEscape:l($),hardBreakTrailing:l($),htmlFlow:l(X),htmlFlowData:S,htmlText:l(q),htmlTextData:S,image:l(V),label:J,labelText:K,lineEnding:B,link:l(W),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Ee,resourceDestinationString:k,resourceTitleString:re,resource:he,setextHeading:l(M),setextHeadingLineSequence:L,setextHeadingText:I,strong:l(),thematicBreak:l()}};Fl(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(D){let Y={type:"root",children:[]};const Z={stack:[Y],tokenStack:[],config:e,enter:u,exit:o,buffer:a,resume:d,data:n},ue=[];let me=-1;for(;++me<D.length;)if(D[me][1].type==="listOrdered"||D[me][1].type==="listUnordered")if(D[me][0]==="enter")ue.push(me);else{const ze=ue.pop();me=s(D,ze,me)}for(me=-1;++me<D.length;){const ze=e[D[me][0]];Bl.call(ze,D[me][1].type)&&ze[D[me][1].type].call(Object.assign({sliceSerialize:D[me][2].sliceSerialize},Z),D[me][1])}if(Z.tokenStack.length>0){const ze=Z.tokenStack[Z.tokenStack.length-1];(ze[1]||eu).call(Z,void 0,ze[0])}for(Y.position={start:Dt(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:Dt(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},me=-1;++me<e.transforms.length;)Y=e.transforms[me](Y)||Y;return Y}function s(D,Y,Z){let ue=Y-1,me=-1,ze=!1,xt,at,vt,Vt;for(;++ue<=Z;){const ut=D[ue];switch(ut[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ut[0]==="enter"?me++:me--,Vt=void 0;break}case"lineEndingBlank":{ut[0]==="enter"&&(xt&&!Vt&&!me&&!vt&&(vt=ue),Vt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vt=void 0}if(!me&&ut[0]==="enter"&&ut[1].type==="listItemPrefix"||me===-1&&ut[0]==="exit"&&(ut[1].type==="listUnordered"||ut[1].type==="listOrdered")){if(xt){let un=ue;for(at=void 0;un--;){const St=D[un];if(St[1].type==="lineEnding"||St[1].type==="lineEndingBlank"){if(St[0]==="exit")continue;at&&(D[at][1].type="lineEndingBlank",ze=!0),St[1].type="lineEnding",at=un}else if(!(St[1].type==="linePrefix"||St[1].type==="blockQuotePrefix"||St[1].type==="blockQuotePrefixWhitespace"||St[1].type==="blockQuoteMarker"||St[1].type==="listItemIndent"))break}vt&&(!at||vt<at)&&(xt._spread=!0),xt.end=Object.assign({},at?D[at][1].start:ut[1].end),D.splice(at||ue,0,["exit",xt,ut[2]]),ue++,Z++}if(ut[1].type==="listItemPrefix"){const un={type:"listItem",_spread:!1,start:Object.assign({},ut[1].start),end:void 0};xt=un,D.splice(ue,0,["enter",un,ut[2]]),ue++,Z++,vt=void 0,Vt=!0}}}return D[Y][1]._spread=ze,Z}function i(D,Y){return Z;function Z(ue){u.call(this,D(ue),ue),Y&&Y.call(this,ue)}}function a(){this.stack.push({type:"fragment",children:[]})}function u(D,Y,Z){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([Y,Z||void 0]),D.position={start:Dt(Y.start),end:void 0}}function l(D){return Y;function Y(Z){D&&D.call(this,Z),o.call(this,Z)}}function o(D,Y){const Z=this.stack.pop(),ue=this.tokenStack.pop();if(ue)ue[0].type!==D.type&&(Y?Y.call(this,D,ue[0]):(ue[1]||eu).call(this,D,ue[0]));else throw new Error("Cannot close `"+D.type+"` ("+$n({start:D.start,end:D.end})+"): it’s not open");Z.position.end=Dt(D.end)}function d(){return vi(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(D){if(this.data.expectingFirstListItemValue){const Y=this.stack[this.stack.length-2];Y.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function h(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.lang=D}function g(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.meta=D}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D.replace(/(\r?\n|\r)$/g,"")}function A(D){const Y=this.resume(),Z=this.stack[this.stack.length-1];Z.label=Y,Z.identifier=bt(this.sliceSerialize(D)).toLowerCase()}function b(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.title=D}function w(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.url=D}function R(D){const Y=this.stack[this.stack.length-1];if(!Y.depth){const Z=this.sliceSerialize(D).length;Y.depth=Z}}function I(){this.data.setextHeadingSlurpLineEnding=!0}function L(D){const Y=this.stack[this.stack.length-1];Y.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function P(D){const Z=this.stack[this.stack.length-1].children;let ue=Z[Z.length-1];(!ue||ue.type!=="text")&&(ue=it(),ue.position={start:Dt(D.start),end:void 0},Z.push(ue)),this.stack.push(ue)}function S(D){const Y=this.stack.pop();Y.value+=this.sliceSerialize(D),Y.position.end=Dt(D.end)}function B(D){const Y=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Z=Y.children[Y.children.length-1];Z.position.end=Dt(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Y.type)&&(P.call(this,D),S.call(this,D))}function $(){this.data.atHardBreak=!0}function X(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D}function q(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D}function U(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.value=D}function W(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=Y,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function V(){const D=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=Y,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function K(D){const Y=this.sliceSerialize(D),Z=this.stack[this.stack.length-2];Z.label=Ig(Y),Z.identifier=bt(Y).toLowerCase()}function J(){const D=this.stack[this.stack.length-1],Y=this.resume(),Z=this.stack[this.stack.length-1];if(this.data.inReference=!0,Z.type==="link"){const ue=D.children;Z.children=ue}else Z.alt=Y}function k(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.url=D}function re(){const D=this.resume(),Y=this.stack[this.stack.length-1];Y.title=D}function he(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function Ee(D){const Y=this.resume(),Z=this.stack[this.stack.length-1];Z.label=Y,Z.identifier=bt(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function ve(D){this.data.characterReferenceType=D.type}function fe(D){const Y=this.sliceSerialize(D),Z=this.data.characterReferenceType;let ue;Z?(ue=Nl(Y,Z==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ue=Di(Y);const me=this.stack[this.stack.length-1];me.value+=ue}function Ge(D){const Y=this.stack.pop();Y.position.end=Dt(D.end)}function Ie(D){S.call(this,D);const Y=this.stack[this.stack.length-1];Y.url=this.sliceSerialize(D)}function Ne(D){S.call(this,D);const Y=this.stack[this.stack.length-1];Y.url="mailto:"+this.sliceSerialize(D)}function ye(){return{type:"blockquote",children:[]}}function Fe(){return{type:"code",lang:null,meta:null,value:""}}function Re(){return{type:"inlineCode",value:""}}function De(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Oe(){return{type:"emphasis",children:[]}}function Ue(){return{type:"heading",depth:0,children:[]}}function Se(){return{type:"break"}}function He(){return{type:"html",value:""}}function We(){return{type:"image",title:null,url:"",alt:null}}function Tt(){return{type:"link",title:null,url:"",children:[]}}function Je(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function qt(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function st(){return{type:"paragraph",children:[]}}function dt(){return{type:"strong",children:[]}}function it(){return{type:"text",value:""}}function le(){return{type:"thematicBreak"}}}function Dt(t){return{line:t.line,column:t.column,offset:t.offset}}function Fl(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?Fl(t,r):Rg(t,r)}}function Rg(t,e){let n;for(n in e)if(Bl.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function eu(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+$n({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+$n({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+$n({start:e.start,end:e.end})+") is still open")}function Og(t){const e=this;e.parser=n;function n(r){return Sg(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function Lg(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function vg(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
|
80
80
|
`}]}function Dg(t,e){const n=e.value?e.value+`
|
|
81
81
|
`:"",r={},s=e.lang?e.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(i.data={meta:e.meta}),t.patch(e,i),i=t.applyData(e,i),i={type:"element",tagName:"pre",properties:{},children:[i]},t.patch(e,i),i}function Pg(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Mg(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Bg(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),s=Cn(r.toLowerCase()),i=t.footnoteOrder.indexOf(r);let a,u=t.footnoteCounts.get(r);u===void 0?(u=0,t.footnoteOrder.push(r),a=t.footnoteOrder.length):a=i+1,u+=1,t.footnoteCounts.set(r,u);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,l);const o={type:"element",tagName:"sup",properties:{},children:[l]};return t.patch(e,o),t.applyData(e,o)}function Fg(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Ug(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function Ul(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const s=t.all(e),i=s[0];i&&i.type==="text"?i.value="["+i.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function Hg(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Ul(t,e);const s={src:Cn(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"img",properties:s,children:[]};return t.patch(e,i),t.applyData(e,i)}function jg(t,e){const n={src:Cn(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function zg(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function $g(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Ul(t,e);const s={href:Cn(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const i={type:"element",tagName:"a",properties:s,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function Yg(t,e){const n={href:Cn(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function qg(t,e,n){const r=t.all(e),s=n?Vg(n):Hl(e),i={},a=[];if(typeof e.checked=="boolean"){const d=r[0];let f;d&&d.type==="element"&&d.tagName==="p"?f=d:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const d=r[u];(s||u!==0||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
|
|
82
82
|
`}),d.type==="element"&&d.tagName==="p"&&!s?a.push(...d.children):a.push(d)}const l=r[r.length-1];l&&(s||l.type!=="element"||l.tagName!=="p")&&a.push({type:"text",value:`
|
|
83
|
-
`});const o={type:"element",tagName:"li",properties:i,children:a};return t.patch(e,o),t.applyData(e,o)}function Vg(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=Hl(n[r])}return e}function Hl(t){const e=t.spread;return e??t.children.length>1}function Gg(t,e){const n={},r=t.all(e);let s=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++s<r.length;){const a=r[s];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,i),t.applyData(e,i)}function Wg(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Qg(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function Xg(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Zg(t,e){const n=t.all(e),r=n.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),s.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},u=It(e.children[1]),l=
|
|
83
|
+
`});const o={type:"element",tagName:"li",properties:i,children:a};return t.patch(e,o),t.applyData(e,o)}function Vg(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=Hl(n[r])}return e}function Hl(t){const e=t.spread;return e??t.children.length>1}function Gg(t,e){const n={},r=t.all(e);let s=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++s<r.length;){const a=r[s];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,i),t.applyData(e,i)}function Wg(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Qg(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function Xg(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Zg(t,e){const n=t.all(e),r=n.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),s.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},u=It(e.children[1]),l=Zr(e.children[e.children.length-1]);u&&l&&(a.position={start:u,end:l}),s.push(a)}const i={type:"element",tagName:"table",properties:{},children:t.wrap(s,!0)};return t.patch(e,i),t.applyData(e,i)}function Kg(t,e,n){const r=n?n.children:void 0,i=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,u=a?a.length:e.children.length;let l=-1;const o=[];for(;++l<u;){const f=e.children[l],p={},h=a?a[l]:void 0;h&&(p.align=h);let g={type:"element",tagName:i,properties:p,children:[]};f&&(g.children=t.all(f),t.patch(f,g),g=t.applyData(f,g)),o.push(g)}const d={type:"element",tagName:"tr",properties:{},children:t.wrap(o,!0)};return t.patch(e,d),t.applyData(e,d)}function Jg(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const tu=9,nu=32;function eb(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),s=0;const i=[];for(;r;)i.push(ru(e.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(e);return i.push(ru(e.slice(s),s>0,!1)),i.join("")}function ru(t,e,n){let r=0,s=t.length;if(e){let i=t.codePointAt(r);for(;i===tu||i===nu;)r++,i=t.codePointAt(r)}if(n){let i=t.codePointAt(s-1);for(;i===tu||i===nu;)s--,i=t.codePointAt(s-1)}return s>r?t.slice(r,s):""}function tb(t,e){const n={type:"text",value:eb(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function nb(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const rb={blockquote:Lg,break:vg,code:Dg,delete:Pg,emphasis:Mg,footnoteReference:Bg,heading:Fg,html:Ug,imageReference:Hg,image:jg,inlineCode:zg,linkReference:$g,link:Yg,listItem:qg,list:Gg,paragraph:Wg,root:Qg,strong:Xg,table:Zg,tableCell:Jg,tableRow:Kg,text:tb,thematicBreak:nb,toml:xr,yaml:xr,definition:xr,footnoteDefinition:xr};function xr(){}const jl=-1,es=0,qn=1,Fr=2,Mi=3,Bi=4,Fi=5,Ui=6,zl=7,$l=8,su=typeof self=="object"?self:globalThis,sb=(t,e)=>{const n=(s,i)=>(t.set(i,s),s),r=s=>{if(t.has(s))return t.get(s);const[i,a]=e[s];switch(i){case es:case jl:return n(a,s);case qn:{const u=n([],s);for(const l of a)u.push(r(l));return u}case Fr:{const u=n({},s);for(const[l,o]of a)u[r(l)]=r(o);return u}case Mi:return n(new Date(a),s);case Bi:{const{source:u,flags:l}=a;return n(new RegExp(u,l),s)}case Fi:{const u=n(new Map,s);for(const[l,o]of a)u.set(r(l),r(o));return u}case Ui:{const u=n(new Set,s);for(const l of a)u.add(r(l));return u}case zl:{const{name:u,message:l}=a;return n(new su[u](l),s)}case $l:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:u}=new Uint8Array(a);return n(new DataView(u),a)}}return n(new su[i](a),s)};return r},iu=t=>sb(new Map,t)(0),cn="",{toString:ib}={},{keys:ab}=Object,Dn=t=>{const e=typeof t;if(e!=="object"||!t)return[es,e];const n=ib.call(t).slice(8,-1);switch(n){case"Array":return[qn,cn];case"Object":return[Fr,cn];case"Date":return[Mi,cn];case"RegExp":return[Bi,cn];case"Map":return[Fi,cn];case"Set":return[Ui,cn];case"DataView":return[qn,n]}return n.includes("Array")?[qn,n]:n.includes("Error")?[zl,n]:[Fr,n]},_r=([t,e])=>t===es&&(e==="function"||e==="symbol"),ub=(t,e,n,r)=>{const s=(a,u)=>{const l=r.push(a)-1;return n.set(u,l),l},i=a=>{if(n.has(a))return n.get(a);let[u,l]=Dn(a);switch(u){case es:{let d=a;switch(l){case"bigint":u=$l,d=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);d=null;break;case"undefined":return s([jl],a)}return s([u,d],a)}case qn:{if(l){let p=a;return l==="DataView"?p=new Uint8Array(a.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(a)),s([l,[...p]],a)}const d=[],f=s([u,d],a);for(const p of a)d.push(i(p));return f}case Fr:{if(l)switch(l){case"BigInt":return s([l,a.toString()],a);case"Boolean":case"Number":case"String":return s([l,a.valueOf()],a)}if(e&&"toJSON"in a)return i(a.toJSON());const d=[],f=s([u,d],a);for(const p of ab(a))(t||!_r(Dn(a[p])))&&d.push([i(p),i(a[p])]);return f}case Mi:return s([u,a.toISOString()],a);case Bi:{const{source:d,flags:f}=a;return s([u,{source:d,flags:f}],a)}case Fi:{const d=[],f=s([u,d],a);for(const[p,h]of a)(t||!(_r(Dn(p))||_r(Dn(h))))&&d.push([i(p),i(h)]);return f}case Ui:{const d=[],f=s([u,d],a);for(const p of a)(t||!_r(Dn(p)))&&d.push(i(p));return f}}const{message:o}=a;return s([u,{name:l,message:o}],a)};return i},au=(t,{json:e,lossy:n}={})=>{const r=[];return ub(!(e||n),!!e,new Map,r)(t),r},En=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?iu(au(t,e)):structuredClone(t):(t,e)=>iu(au(t,e));function ob(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function lb(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function cb(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||ob,r=t.options.footnoteBackLabel||lb,s=t.options.footnoteLabel||"Footnotes",i=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let l=-1;for(;++l<t.footnoteOrder.length;){const o=t.footnoteById.get(t.footnoteOrder[l]);if(!o)continue;const d=t.all(o),f=String(o.identifier).toUpperCase(),p=Cn(f.toLowerCase());let h=0;const g=[],_=t.footnoteCounts.get(f);for(;_!==void 0&&++h<=_;){g.length>0&&g.push({type:"text",value:" "});let A=typeof n=="string"?n:n(l,h);typeof A=="string"&&(A={type:"text",value:A}),g.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,h),className:["data-footnote-backref"]},children:Array.isArray(A)?A:[A]})}const T=d[d.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const A=T.children[T.children.length-1];A&&A.type==="text"?A.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...g)}else d.push(...g);const E={type:"element",tagName:"li",properties:{id:e+"fn-"+p},children:t.wrap(d,!0)};t.patch(o,E),u.push(E)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...En(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
84
84
|
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(u,!0)},{type:"text",value:`
|
|
85
|
-
`}]}}const
|
|
85
|
+
`}]}}const ts=(function(t){if(t==null)return pb;if(typeof t=="function")return ns(t);if(typeof t=="object")return Array.isArray(t)?db(t):fb(t);if(typeof t=="string")return hb(t);throw new Error("Expected function, string, or object as test")});function db(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=ts(t[n]);return ns(r);function r(...s){let i=-1;for(;++i<e.length;)if(e[i].apply(this,s))return!0;return!1}}function fb(t){const e=t;return ns(n);function n(r){const s=r;let i;for(i in t)if(s[i]!==e[i])return!1;return!0}}function hb(t){return ns(e);function e(n){return n&&n.type===t}}function ns(t){return e;function e(n,r,s){return!!(mb(n)&&t.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function pb(){return!0}function mb(t){return t!==null&&typeof t=="object"&&"type"in t}const Yl=[],gb=!0,Xs=!1,bb="skip";function ql(t,e,n,r){let s;typeof e=="function"&&typeof n!="function"?(r=n,n=e):s=e;const i=ts(s),a=r?-1:1;u(t,void 0,[])();function u(l,o,d){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const h=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=Yl,g,_,T;if((!e||i(l,o,d[d.length-1]||void 0))&&(h=Eb(n(l,d)),h[0]===Xs))return h;if("children"in l&&l.children){const E=l;if(E.children&&h[0]!==bb)for(_=(r?E.children.length:-1)+a,T=d.concat(E);_>-1&&_<E.children.length;){const A=E.children[_];if(g=u(A,_,T)(),g[0]===Xs)return g;_=typeof g[1]=="number"?g[1]:_+a}}return h}}}function Eb(t){return Array.isArray(t)?t:typeof t=="number"?[gb,t]:t==null?Yl:[t]}function rs(t,e,n,r){let s,i,a;typeof e=="function"&&typeof n!="function"?(i=void 0,a=e,s=n):(i=e,a=n,s=r),ql(t,i,u,s);function u(l,o){const d=o[o.length-1],f=d?d.children.indexOf(l):void 0;return a(l,f,d)}}const Zs={}.hasOwnProperty,Tb={};function xb(t,e){const n=e||Tb,r=new Map,s=new Map,i=new Map,a={...rb,...n.handlers},u={all:o,applyData:yb,definitionById:r,footnoteById:s,footnoteCounts:i,footnoteOrder:[],handlers:a,one:l,options:n,patch:_b,wrap:kb};return rs(t,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const f=d.type==="definition"?r:s,p=String(d.identifier).toUpperCase();f.has(p)||f.set(p,d)}}),u;function l(d,f){const p=d.type,h=u.handlers[p];if(Zs.call(u.handlers,p)&&h)return h(u,d,f);if(u.options.passThrough&&u.options.passThrough.includes(p)){if("children"in d){const{children:_,...T}=d,E=En(T);return E.children=u.all(d),E}return En(d)}return(u.options.unknownHandler||Ab)(u,d,f)}function o(d){const f=[];if("children"in d){const p=d.children;let h=-1;for(;++h<p.length;){const g=u.one(p[h],d);if(g){if(h&&p[h-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=uu(g.value)),!Array.isArray(g)&&g.type==="element")){const _=g.children[0];_&&_.type==="text"&&(_.value=uu(_.value))}Array.isArray(g)?f.push(...g):f.push(g)}}}return f}}function _b(t,e){t.position&&(e.position=lm(t))}function yb(t,e){let n=e;if(t&&t.data){const r=t.data.hName,s=t.data.hChildren,i=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&i&&Object.assign(n.properties,En(i)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function Ab(t,e){const n=e.data||{},r="value"in e&&!(Zs.call(n,"hProperties")||Zs.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function kb(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
|
|
86
86
|
`});++r<t.length;)r&&n.push({type:"text",value:`
|
|
87
87
|
`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
|
|
88
|
-
`}),n}function
|
|
89
|
-
`},s),i}function Cb(t,e){return t&&"run"in t?async function(n,r){const s=lu(n,{file:r,...e});await t.run(s,r)}:function(n,r){return lu(n,{file:r,...t||e})}}function cu(t){if(t)throw t}var Ts,du;function Ib(){if(du)return Ts;du=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(o){return typeof Array.isArray=="function"?Array.isArray(o):e.call(o)==="[object Array]"},i=function(o){if(!o||e.call(o)!=="[object Object]")return!1;var d=t.call(o,"constructor"),f=o.constructor&&o.constructor.prototype&&t.call(o.constructor.prototype,"isPrototypeOf");if(o.constructor&&!d&&!f)return!1;var p;for(p in o);return typeof p>"u"||t.call(o,p)},a=function(o,d){n&&d.name==="__proto__"?n(o,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):o[d.name]=d.newValue},u=function(o,d){if(d==="__proto__")if(t.call(o,d)){if(r)return r(o,d).value}else return;return o[d]};return Ts=function l(){var o,d,f,p,h,g,_=arguments[0],T=1,E=arguments.length,A=!1;for(typeof _=="boolean"&&(A=_,_=arguments[1]||{},T=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});T<E;++T)if(o=arguments[T],o!=null)for(d in o)f=u(_,d),p=u(o,d),_!==p&&(A&&p&&(i(p)||(h=s(p)))?(h?(h=!1,g=f&&s(f)?f:[]):g=f&&i(f)?f:{},a(_,{name:d,newValue:l(A,g,p)})):typeof p<"u"&&a(_,{name:d,newValue:p}));return _},Ts}var Nb=Ib();const xs=ai(Nb);function Ks(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Sb(){const t=[],e={run:n,use:r};return e;function n(...s){let i=-1;const a=s.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);u(null,...s);function u(l,...o){const d=t[++i];let f=-1;if(l){a(l);return}for(;++f<s.length;)(o[f]===null||o[f]===void 0)&&(o[f]=s[f]);s=o,d?wb(d,u)(...o):a(null,...o)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return t.push(s),e}}function wb(t,e){let n;return r;function r(...a){const u=t.length>a.length;let l;u&&a.push(s);try{l=t.apply(this,a)}catch(o){const d=o;if(u&&n)throw d;return s(d)}u||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(a,...u){n||(n=!0,e(a,...u))}function i(a){s(null,a)}}const At={basename:Rb,dirname:Ob,extname:Lb,join:vb,sep:"/"};function Rb(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');gr(t);let n=0,r=-1,s=t.length,i;if(e===void 0||e.length===0||e.length>t.length){for(;s--;)if(t.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,u=e.length-1;for(;s--;)if(t.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),u>-1&&(t.codePointAt(s)===e.codePointAt(u--)?u<0&&(r=s):(u=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function Ob(t){if(gr(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function Lb(t){gr(t);let e=t.length,n=-1,r=0,s=-1,i=0,a;for(;e--;){const u=t.codePointAt(e);if(u===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),u===46?s<0?s=e:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":t.slice(s,n)}function vb(...t){let e=-1,n;for(;++e<t.length;)gr(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":Db(n)}function Db(t){gr(t);const e=t.codePointAt(0)===47;let n=Pb(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function Pb(t,e){let n="",r=0,s=-1,i=0,a=-1,u,l;for(;++a<=t.length;){if(a<t.length)u=t.codePointAt(a);else{if(u===47)break;u=47}if(u===47){if(!(s===a-1||i===1))if(s!==a-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),s=a,i=0;continue}}else if(n.length>0){n="",r=0,s=a,i=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(s+1,a):n=t.slice(s+1,a),r=a-s-1;s=a,i=0}else u===46&&i>-1?i++:i=-1}return n}function gr(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Mb={cwd:Bb};function Bb(){return"/"}function Js(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Fb(t){if(typeof t=="string")t=new URL(t);else if(!Js(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Ub(t)}function Ub(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(e)}const _s=["history","path","basename","stem","extname","dirname"];class Vl{constructor(e){let n;e?Js(e)?n={path:e}:typeof e=="string"||Hb(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":Mb.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<_s.length;){const i=_s[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let s;for(s in n)_s.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?At.basename(this.path):void 0}set basename(e){As(e,"basename"),ys(e,"basename"),this.path=At.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?At.dirname(this.path):void 0}set dirname(e){fu(this.basename,"dirname"),this.path=At.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?At.extname(this.path):void 0}set extname(e){if(ys(e,"extname"),fu(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=At.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Js(e)&&(e=Fb(e)),As(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?At.basename(this.path,this.extname):void 0}set stem(e){As(e,"stem"),ys(e,"stem"),this.path=At.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const s=this.message(e,n,r);throw s.fatal=!0,s}info(e,n,r){const s=this.message(e,n,r);return s.fatal=void 0,s}message(e,n,r){const s=new qe(e,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function ys(t,e){if(t&&t.includes(At.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+At.sep+"`")}function As(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function fu(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function Hb(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const jb=(function(t){const r=this.constructor.prototype,s=r[t],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),zb={}.hasOwnProperty;class ji extends jb{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Sb()}copy(){const e=new ji;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(xs(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(Is("data",this.frozen),this.namespace[e]=n,this):zb.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Is("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(e,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=yr(e),r=this.parser||this.Parser;return ks("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),ks("process",this.parser||this.Parser),Cs("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,a){const u=yr(e),l=r.parse(u);r.run(l,u,function(d,f,p){if(d||!f||!p)return o(d);const h=f,g=r.stringify(h,p);qb(g)?p.value=g:p.result=g,o(d,p)});function o(d,f){d||!f?a(d):i?i(f):n(void 0,f)}}}processSync(e){let n=!1,r;return this.freeze(),ks("processSync",this.parser||this.Parser),Cs("processSync",this.compiler||this.Compiler),this.process(e,s),pu("processSync","process",n),r;function s(i,a){n=!0,cu(i),r=a}}run(e,n,r){hu(e),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(a,u){const l=yr(n);s.run(e,l,o);function o(d,f,p){const h=f||e;d?u(d):a?a(h):r(void 0,h,p)}}}runSync(e,n){let r=!1,s;return this.run(e,n,i),pu("runSync","run",r),s;function i(a,u){cu(a),s=u,r=!0}}stringify(e,n){this.freeze();const r=yr(n),s=this.compiler||this.Compiler;return Cs("stringify",s),hu(e),s(e,r)}use(e,...n){const r=this.attachers,s=this.namespace;if(Is("use",this.frozen),e!=null)if(typeof e=="function")l(e,n);else if(typeof e=="object")Array.isArray(e)?u(e):a(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function i(o){if(typeof o=="function")l(o,[]);else if(typeof o=="object")if(Array.isArray(o)){const[d,...f]=o;l(d,f)}else a(o);else throw new TypeError("Expected usable value, not `"+o+"`")}function a(o){if(!("plugins"in o)&&!("settings"in o))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(o.plugins),o.settings&&(s.settings=xs(!0,s.settings,o.settings))}function u(o){let d=-1;if(o!=null)if(Array.isArray(o))for(;++d<o.length;){const f=o[d];i(f)}else throw new TypeError("Expected a list of plugins, not `"+o+"`")}function l(o,d){let f=-1,p=-1;for(;++f<r.length;)if(r[f][0]===o){p=f;break}if(p===-1)r.push([o,...d]);else if(d.length>0){let[h,...g]=d;const _=r[p][1];Ks(_)&&Ks(h)&&(h=xs(!0,_,h)),r[p]=[o,h,...g]}}}}const $b=new ji().freeze();function ks(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Cs(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Is(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function hu(t){if(!Ks(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function pu(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function yr(t){return Yb(t)?t:new Vl(t)}function Yb(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function qb(t){return typeof t=="string"||Vb(t)}function Vb(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Gb="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",mu=[],gu={allowDangerousHtml:!0},Wb=/^(https?|ircs?|mailto|xmpp)$/i,Qb=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Xb(t){const e=Zb(t),n=Kb(t);return Jb(e.runSync(e.parse(n),n),t)}function Zb(t){const e=t.rehypePlugins||mu,n=t.remarkPlugins||mu,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...gu}:gu;return $b().use(Og).use(n).use(Cb,r).use(e)}function Kb(t){const e=t.children||"",n=new Vl;return typeof e=="string"&&(n.value=e),n}function Jb(t,e){const n=e.allowedElements,r=e.allowElement,s=e.components,i=e.disallowedElements,a=e.skipHtml,u=e.unwrapDisallowed,l=e.urlTransform||eE;for(const d of Qb)Object.hasOwn(e,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Gb+d.id,void 0);return e.className&&(t={type:"element",tagName:"div",properties:{className:e.className},children:t.type==="root"?t.children:[t]}),ss(t,o),pm(t,{Fragment:m.Fragment,components:s,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function o(d,f,p){if(d.type==="raw"&&p&&typeof f=="number")return a?p.children.splice(f,1):p.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let h;for(h in gs)if(Object.hasOwn(gs,h)&&Object.hasOwn(d.properties,h)){const g=d.properties[h],_=gs[h];(_===null||_.includes(d.tagName))&&(d.properties[h]=l(String(g||""),h,d))}}if(d.type==="element"){let h=n?!n.includes(d.tagName):i?i.includes(d.tagName):!1;if(!h&&r&&typeof f=="number"&&(h=!r(d,f,p)),h&&p&&typeof f=="number")return u&&d.children?p.children.splice(f,1,...d.children):p.children.splice(f,1),f}}}function eE(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),s=t.indexOf("/");return e===-1||s!==-1&&e>s||n!==-1&&e>n||r!==-1&&e>r||Wb.test(t.slice(0,e))?t:""}const bu=/[#.]/g;function tE(t,e){const n=t||"",r={};let s=0,i,a;for(;s<n.length;){bu.lastIndex=s;const u=bu.exec(n),l=n.slice(s,u?u.index:n.length);l&&(i?i==="#"?r.id=l:Array.isArray(r.className)?r.className.push(l):r.className=[l]:a=l,s+=l.length),u&&(i=u[0],s++)}return{type:"element",tagName:a||e||"div",properties:r,children:[]}}function Gl(t,e,n){const r=n?iE(n):void 0;function s(i,a,...u){let l;if(i==null){l={type:"root",children:[]};const o=a;u.unshift(o)}else{l=tE(i,e);const o=l.tagName.toLowerCase(),d=r?r.get(o):void 0;if(l.tagName=d||o,nE(a))u.unshift(a);else for(const[f,p]of Object.entries(a))rE(t,l.properties,f,p)}for(const o of u)ei(l.children,o);return l.type==="element"&&l.tagName==="template"&&(l.content={type:"root",children:l.children},l.children=[]),l}return s}function nE(t){if(t===null||typeof t!="object"||Array.isArray(t))return!0;if(typeof t.type!="string")return!1;const e=t,n=Object.keys(t);for(const r of n){const s=e[r];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const i=s;for(const a of i)if(typeof a!="number"&&typeof a!="string")return!0}}return!!("children"in t&&Array.isArray(t.children))}function rE(t,e,n,r){const s=Zr(t,n);let i;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;i=r}else typeof r=="boolean"?i=r:typeof r=="string"?s.spaceSeparated?i=Fa(r):s.commaSeparated?i=va(r):s.commaOrSpaceSeparated?i=Fa(va(r).join(" ")):i=Eu(s,s.property,r):Array.isArray(r)?i=[...r]:i=s.property==="style"?sE(r):String(r);if(Array.isArray(i)){const a=[];for(const u of i)a.push(Eu(s,s.property,u));i=a}s.property==="className"&&Array.isArray(e.className)&&(i=e.className.concat(i)),e[s.property]=i}}function ei(t,e){if(e!=null)if(typeof e=="number"||typeof e=="string")t.push({type:"text",value:String(e)});else if(Array.isArray(e))for(const n of e)ei(t,n);else if(typeof e=="object"&&"type"in e)e.type==="root"?ei(t,e.children):t.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function Eu(t,e,n){if(typeof n=="string"){if(t.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((t.boolean||t.overloadedBoolean)&&(n===""||nr(n)===nr(e)))return!0}return n}function sE(t){const e=[];for(const[n,r]of Object.entries(t))e.push([n,r].join(": "));return e.join("; ")}function iE(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}const aE=["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"],uE=Gl(pr,"div"),oE=Gl($t,"g",aE);function lE(t){const e=String(t),n=[];return{toOffset:s,toPoint:r};function r(i){if(typeof i=="number"&&i>-1&&i<=e.length){let a=0;for(;;){let u=n[a];if(u===void 0){const l=Tu(e,n[a-1]);u=l===-1?e.length+1:l+1,n[a]=u}if(u>i)return{line:a+1,column:i-(a>0?n[a-1]:0)+1,offset:i};a++}}}function s(i){if(i&&typeof i.line=="number"&&typeof i.column=="number"&&!Number.isNaN(i.line)&&!Number.isNaN(i.column)){for(;n.length<i.line;){const u=n[n.length-1],l=Tu(e,u),o=l===-1?e.length+1:l+1;if(u===o)break;n.push(o)}const a=(i.line>1?n[i.line-2]:0)+i.column-1;if(a<n[i.line-1])return a}}}function Tu(t,e){const n=t.indexOf("\r",e),r=t.indexOf(`
|
|
90
|
-
`,e);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const 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/"},Wl={}.hasOwnProperty,cE=Object.prototype;function dE(t,e){const n=e||{};return zi({file:n.file||void 0,location:!1,schema:n.space==="svg"?$t:pr,verbose:n.verbose||!1},t)}function zi(t,e){let n;switch(e.nodeName){case"#comment":{const r=e;return n={type:"comment",value:r.data},Rr(t,r,n),n}case"#document":case"#document-fragment":{const r=e,s="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:Ql(t,e.childNodes),data:{quirksMode:s}},t.file&&t.location){const i=String(t.file),a=lE(i),u=a.toPoint(0),l=a.toPoint(i.length);n.position={start:u,end:l}}return n}case"#documentType":{const r=e;return n={type:"doctype"},Rr(t,r,n),n}case"#text":{const r=e;return n={type:"text",value:r.value},Rr(t,r,n),n}default:return n=fE(t,e),n}}function Ql(t,e){let n=-1;const r=[];for(;++n<e.length;){const s=zi(t,e[n]);r.push(s)}return r}function fE(t,e){const n=t.schema;t.schema=e.namespaceURI===Zt.svg?$t:pr;let r=-1;const s={};for(;++r<e.attrs.length;){const u=e.attrs[r],l=(u.prefix?u.prefix+":":"")+u.name;Wl.call(cE,l)||(s[l]=u.value)}const a=(t.schema.space==="svg"?oE:uE)(e.tagName,s,Ql(t,e.childNodes));if(Rr(t,e,a),a.tagName==="template"){const u=e,l=u.sourceCodeLocation,o=l&&l.startTag&&pn(l.startTag),d=l&&l.endTag&&pn(l.endTag),f=zi(t,u.content);o&&d&&t.file&&(f.position={start:o.end,end:d.start}),a.content=f}return t.schema=n,a}function Rr(t,e,n){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&t.file){const r=hE(t,n,e.sourceCodeLocation);r&&(t.location=!0,n.position=r)}}function hE(t,e,n){const r=pn(n);if(e.type==="element"){const s=e.children[e.children.length-1];if(r&&!n.endTag&&s&&s.position&&s.position.end&&(r.end=Object.assign({},s.position.end)),t.verbose){const i={};let a;if(n.attrs)for(a in n.attrs)Wl.call(n.attrs,a)&&(i[Zr(t.schema,a).property]=pn(n.attrs[a]));n.startTag;const u=pn(n.startTag),l=n.endTag?pn(n.endTag):void 0,o={opening:u};l&&(o.closing=l),o.properties=i,e.data={position:o}}}return r}function pn(t){const e=xu({line:t.startLine,column:t.startCol,offset:t.startOffset}),n=xu({line:t.endLine,column:t.endCol,offset:t.endOffset});return e||n?{start:e,end:n}:void 0}function xu(t){return t.line&&t.column?t:void 0}const _u={}.hasOwnProperty;function Xl(t,e){const n=e||{};function r(s,...i){let a=r.invalid;const u=r.handlers;if(s&&_u.call(s,t)){const l=String(s[t]);a=_u.call(u,l)?u[l]:r.unknown}if(a)return a.call(this,s,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const pE={},mE={}.hasOwnProperty,Zl=Xl("type",{handlers:{root:bE,element:yE,text:xE,comment:_E,doctype:TE}});function gE(t,e){const r=(e||pE).space;return Zl(t,r==="svg"?$t:pr)}function bE(t,e){const n={nodeName:"#document",mode:(t.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=$i(t.children,n,e),In(t,n),n}function EE(t,e){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=$i(t.children,n,e),In(t,n),n}function TE(t){const e={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return In(t,e),e}function xE(t){const e={nodeName:"#text",value:t.value,parentNode:null};return In(t,e),e}function _E(t){const e={nodeName:"#comment",data:t.value,parentNode:null};return In(t,e),e}function yE(t,e){const n=e;let r=n;t.type==="element"&&t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=$t);const s=[];let i;if(t.properties){for(i in t.properties)if(i!=="children"&&mE.call(t.properties,i)){const l=AE(r,i,t.properties[i]);l&&s.push(l)}}const a=r.space,u={nodeName:t.tagName,tagName:t.tagName,attrs:s,namespaceURI:Zt[a],childNodes:[],parentNode:null};return u.childNodes=$i(t.children,u,r),In(t,u),t.tagName==="template"&&t.content&&(u.content=EE(t.content,r)),u}function AE(t,e,n){const r=Zr(t,e);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?dl(n):Tl(n));const s={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const i=s.name.indexOf(":");i<0?s.prefix="":(s.name=s.name.slice(i+1),s.prefix=r.attribute.slice(0,i)),s.namespace=Zt[r.space]}return s}function $i(t,e,n){let r=-1;const s=[];if(t)for(;++r<t.length;){const i=Zl(t[r],n);i.parentNode=e,s.push(i)}return s}function In(t,e){const n=t.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,e.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const kE=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],CE=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]),Ce="�";var x;(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(x||(x={}));const et={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Kl(t){return t>=55296&&t<=57343}function IE(t){return t>=56320&&t<=57343}function NE(t,e){return(t-55296)*1024+9216+e}function Jl(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function ec(t){return t>=64976&&t<=65007||CE.has(t)}var v;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(v||(v={}));const SE=65536;class wE{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=SE,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:r,col:s,offset:i}=this,a=s+n,u=i+n;return{code:e,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:u,endOffset:u}}_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){const n=this.html.charCodeAt(this.pos+1);if(IE(n))return this.pos++,this._addGap(),NE(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,x.EOF;return this._err(v.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,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let r=0;r<e.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==e.charCodeAt(r))return!1;return!0}peek(e){const n=this.pos+e;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,x.EOF;const r=this.html.charCodeAt(n);return r===x.CARRIAGE_RETURN?x.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,x.EOF;let e=this.html.charCodeAt(this.pos);return e===x.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,x.LINE_FEED):e===x.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Kl(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===x.LINE_FEED||e===x.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){Jl(e)?this._err(v.controlCharacterInInputStream):ec(e)&&this._err(v.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var ae;(function(t){t[t.CHARACTER=0]="CHARACTER",t[t.NULL_CHARACTER=1]="NULL_CHARACTER",t[t.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",t[t.START_TAG=3]="START_TAG",t[t.END_TAG=4]="END_TAG",t[t.COMMENT=5]="COMMENT",t[t.DOCTYPE=6]="DOCTYPE",t[t.EOF=7]="EOF",t[t.HIBERNATION=8]="HIBERNATION"})(ae||(ae={}));function tc(t,e){for(let n=t.attrs.length-1;n>=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}const RE=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),OE=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function LE(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=OE.get(t))!==null&&e!==void 0?e:t}var Be;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(Be||(Be={}));const vE=32;var Ht;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Ht||(Ht={}));function ti(t){return t>=Be.ZERO&&t<=Be.NINE}function DE(t){return t>=Be.UPPER_A&&t<=Be.UPPER_F||t>=Be.LOWER_A&&t<=Be.LOWER_F}function PE(t){return t>=Be.UPPER_A&&t<=Be.UPPER_Z||t>=Be.LOWER_A&&t<=Be.LOWER_Z||ti(t)}function ME(t){return t===Be.EQUALS||PE(t)}var Pe;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(Pe||(Pe={}));var wt;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(wt||(wt={}));class BE{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=Pe.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=wt.Strict}startEntity(e){this.decodeMode=e,this.state=Pe.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case Pe.EntityStart:return e.charCodeAt(n)===Be.NUM?(this.state=Pe.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=Pe.NamedEntity,this.stateNamedEntity(e,n));case Pe.NumericStart:return this.stateNumericStart(e,n);case Pe.NumericDecimal:return this.stateNumericDecimal(e,n);case Pe.NumericHex:return this.stateNumericHex(e,n);case Pe.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|vE)===Be.LOWER_X?(this.state=Pe.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=Pe.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,s){if(n!==r){const i=r-n;this.result=this.result*Math.pow(s,i)+Number.parseInt(e.substr(n,i),s),this.consumed+=i}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const s=e.charCodeAt(n);if(ti(s)||DE(s))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const s=e.charCodeAt(n);if(ti(s))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Be.SEMI)this.consumed+=1;else if(this.decodeMode===wt.Strict)return 0;return this.emitCodePoint(LE(this.result),this.consumed),this.errors&&(e!==Be.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let s=r[this.treeIndex],i=(s&Ht.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const a=e.charCodeAt(n);if(this.treeIndex=FE(r,s,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===wt.Attribute&&(i===0||ME(a))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],i=(s&Ht.VALUE_LENGTH)>>14,i!==0){if(a===Be.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==wt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,s=(r[n]&Ht.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[e]&~Ht.VALUE_LENGTH:s[e+1],r),n===3&&this.emitCodePoint(s[e+2],r),r}end(){var e;switch(this.state){case Pe.NamedEntity:return this.result!==0&&(this.decodeMode!==wt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Pe.NumericDecimal:return this.emitNumericEntity(0,2);case Pe.NumericHex:return this.emitNumericEntity(0,3);case Pe.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Pe.EntityStart:return 0}}}function FE(t,e,n,r){const s=(e&Ht.BRANCH_LENGTH)>>7,i=e&Ht.JUMP_TABLE;if(s===0)return i!==0&&r===i?n:-1;if(i){const l=r-i;return l<0||l>=s?-1:t[n+l]-1}let a=n,u=a+s-1;for(;a<=u;){const l=a+u>>>1,o=t[l];if(o<r)a=l+1;else if(o>r)u=l-1;else return t[l+s]}return-1}var F;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})(F||(F={}));var Kt;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(Kt||(Kt={}));var pt;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(pt||(pt={}));var O;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(O||(O={}));var c;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(c||(c={}));const UE=new Map([[O.A,c.A],[O.ADDRESS,c.ADDRESS],[O.ANNOTATION_XML,c.ANNOTATION_XML],[O.APPLET,c.APPLET],[O.AREA,c.AREA],[O.ARTICLE,c.ARTICLE],[O.ASIDE,c.ASIDE],[O.B,c.B],[O.BASE,c.BASE],[O.BASEFONT,c.BASEFONT],[O.BGSOUND,c.BGSOUND],[O.BIG,c.BIG],[O.BLOCKQUOTE,c.BLOCKQUOTE],[O.BODY,c.BODY],[O.BR,c.BR],[O.BUTTON,c.BUTTON],[O.CAPTION,c.CAPTION],[O.CENTER,c.CENTER],[O.CODE,c.CODE],[O.COL,c.COL],[O.COLGROUP,c.COLGROUP],[O.DD,c.DD],[O.DESC,c.DESC],[O.DETAILS,c.DETAILS],[O.DIALOG,c.DIALOG],[O.DIR,c.DIR],[O.DIV,c.DIV],[O.DL,c.DL],[O.DT,c.DT],[O.EM,c.EM],[O.EMBED,c.EMBED],[O.FIELDSET,c.FIELDSET],[O.FIGCAPTION,c.FIGCAPTION],[O.FIGURE,c.FIGURE],[O.FONT,c.FONT],[O.FOOTER,c.FOOTER],[O.FOREIGN_OBJECT,c.FOREIGN_OBJECT],[O.FORM,c.FORM],[O.FRAME,c.FRAME],[O.FRAMESET,c.FRAMESET],[O.H1,c.H1],[O.H2,c.H2],[O.H3,c.H3],[O.H4,c.H4],[O.H5,c.H5],[O.H6,c.H6],[O.HEAD,c.HEAD],[O.HEADER,c.HEADER],[O.HGROUP,c.HGROUP],[O.HR,c.HR],[O.HTML,c.HTML],[O.I,c.I],[O.IMG,c.IMG],[O.IMAGE,c.IMAGE],[O.INPUT,c.INPUT],[O.IFRAME,c.IFRAME],[O.KEYGEN,c.KEYGEN],[O.LABEL,c.LABEL],[O.LI,c.LI],[O.LINK,c.LINK],[O.LISTING,c.LISTING],[O.MAIN,c.MAIN],[O.MALIGNMARK,c.MALIGNMARK],[O.MARQUEE,c.MARQUEE],[O.MATH,c.MATH],[O.MENU,c.MENU],[O.META,c.META],[O.MGLYPH,c.MGLYPH],[O.MI,c.MI],[O.MO,c.MO],[O.MN,c.MN],[O.MS,c.MS],[O.MTEXT,c.MTEXT],[O.NAV,c.NAV],[O.NOBR,c.NOBR],[O.NOFRAMES,c.NOFRAMES],[O.NOEMBED,c.NOEMBED],[O.NOSCRIPT,c.NOSCRIPT],[O.OBJECT,c.OBJECT],[O.OL,c.OL],[O.OPTGROUP,c.OPTGROUP],[O.OPTION,c.OPTION],[O.P,c.P],[O.PARAM,c.PARAM],[O.PLAINTEXT,c.PLAINTEXT],[O.PRE,c.PRE],[O.RB,c.RB],[O.RP,c.RP],[O.RT,c.RT],[O.RTC,c.RTC],[O.RUBY,c.RUBY],[O.S,c.S],[O.SCRIPT,c.SCRIPT],[O.SEARCH,c.SEARCH],[O.SECTION,c.SECTION],[O.SELECT,c.SELECT],[O.SOURCE,c.SOURCE],[O.SMALL,c.SMALL],[O.SPAN,c.SPAN],[O.STRIKE,c.STRIKE],[O.STRONG,c.STRONG],[O.STYLE,c.STYLE],[O.SUB,c.SUB],[O.SUMMARY,c.SUMMARY],[O.SUP,c.SUP],[O.TABLE,c.TABLE],[O.TBODY,c.TBODY],[O.TEMPLATE,c.TEMPLATE],[O.TEXTAREA,c.TEXTAREA],[O.TFOOT,c.TFOOT],[O.TD,c.TD],[O.TH,c.TH],[O.THEAD,c.THEAD],[O.TITLE,c.TITLE],[O.TR,c.TR],[O.TRACK,c.TRACK],[O.TT,c.TT],[O.U,c.U],[O.UL,c.UL],[O.SVG,c.SVG],[O.VAR,c.VAR],[O.WBR,c.WBR],[O.XMP,c.XMP]]);function Nn(t){var e;return(e=UE.get(t))!==null&&e!==void 0?e:c.UNKNOWN}const H=c,HE={[F.HTML]:new Set([H.ADDRESS,H.APPLET,H.AREA,H.ARTICLE,H.ASIDE,H.BASE,H.BASEFONT,H.BGSOUND,H.BLOCKQUOTE,H.BODY,H.BR,H.BUTTON,H.CAPTION,H.CENTER,H.COL,H.COLGROUP,H.DD,H.DETAILS,H.DIR,H.DIV,H.DL,H.DT,H.EMBED,H.FIELDSET,H.FIGCAPTION,H.FIGURE,H.FOOTER,H.FORM,H.FRAME,H.FRAMESET,H.H1,H.H2,H.H3,H.H4,H.H5,H.H6,H.HEAD,H.HEADER,H.HGROUP,H.HR,H.HTML,H.IFRAME,H.IMG,H.INPUT,H.LI,H.LINK,H.LISTING,H.MAIN,H.MARQUEE,H.MENU,H.META,H.NAV,H.NOEMBED,H.NOFRAMES,H.NOSCRIPT,H.OBJECT,H.OL,H.P,H.PARAM,H.PLAINTEXT,H.PRE,H.SCRIPT,H.SECTION,H.SELECT,H.SOURCE,H.STYLE,H.SUMMARY,H.TABLE,H.TBODY,H.TD,H.TEMPLATE,H.TEXTAREA,H.TFOOT,H.TH,H.THEAD,H.TITLE,H.TR,H.TRACK,H.UL,H.WBR,H.XMP]),[F.MATHML]:new Set([H.MI,H.MO,H.MN,H.MS,H.MTEXT,H.ANNOTATION_XML]),[F.SVG]:new Set([H.TITLE,H.FOREIGN_OBJECT,H.DESC]),[F.XLINK]:new Set,[F.XML]:new Set,[F.XMLNS]:new Set},ni=new Set([H.H1,H.H2,H.H3,H.H4,H.H5,H.H6]);O.STYLE,O.SCRIPT,O.XMP,O.IFRAME,O.NOEMBED,O.NOFRAMES,O.PLAINTEXT;var y;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(y||(y={}));const we={DATA:y.DATA,RCDATA:y.RCDATA,RAWTEXT:y.RAWTEXT,SCRIPT_DATA:y.SCRIPT_DATA,PLAINTEXT:y.PLAINTEXT,CDATA_SECTION:y.CDATA_SECTION};function jE(t){return t>=x.DIGIT_0&&t<=x.DIGIT_9}function Hn(t){return t>=x.LATIN_CAPITAL_A&&t<=x.LATIN_CAPITAL_Z}function zE(t){return t>=x.LATIN_SMALL_A&&t<=x.LATIN_SMALL_Z}function Bt(t){return zE(t)||Hn(t)}function yu(t){return Bt(t)||jE(t)}function Ar(t){return t+32}function nc(t){return t===x.SPACE||t===x.LINE_FEED||t===x.TABULATION||t===x.FORM_FEED}function Au(t){return nc(t)||t===x.SOLIDUS||t===x.GREATER_THAN_SIGN}function $E(t){return t===x.NULL?v.nullCharacterReference:t>1114111?v.characterReferenceOutsideUnicodeRange:Kl(t)?v.surrogateCharacterReference:ec(t)?v.noncharacterCharacterReference:Jl(t)||t===x.CARRIAGE_RETURN?v.controlCharacterReference:null}class YE{constructor(e,n){this.options=e,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=y.DATA,this.returnState=y.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new wE(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new BE(RE,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(v.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(v.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=$E(r);s&&this._err(s,1)}}:void 0)}_err(e,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(e,n))}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;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,n,r){this.active=!0,this.preprocessor.write(e,n),this._runParsingLoop(),this.paused||r?.()}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 n=0;n<e;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,n){return this.preprocessor.startsWith(e,n)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:ae.START_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:ae.END_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:ae.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:ae.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,n){this.currentCharacterToken={type:e,chars:n,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,n;const r=this.currentToken;if(tc(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(e=(n=r.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(v.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(){const e=this.currentToken;this.prepareToken(e),e.tagID=Nn(e.tagName),e.type===ae.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(v.endTagWithAttributes),e.selfClosing&&this._err(v.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 ae.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case ae.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case ae.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:ae.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,n)}_emitCodePoint(e){const n=nc(e)?ae.WHITESPACE_CHARACTER:e===x.NULL?ae.NULL_CHARACTER:ae.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(ae.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=y.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?wt.Attribute:wt.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===y.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===y.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===y.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case y.DATA:{this._stateData(e);break}case y.RCDATA:{this._stateRcdata(e);break}case y.RAWTEXT:{this._stateRawtext(e);break}case y.SCRIPT_DATA:{this._stateScriptData(e);break}case y.PLAINTEXT:{this._statePlaintext(e);break}case y.TAG_OPEN:{this._stateTagOpen(e);break}case y.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case y.TAG_NAME:{this._stateTagName(e);break}case y.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case y.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case y.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case y.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case y.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case y.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case y.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case y.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case y.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case y.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case y.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case y.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case y.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case y.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case y.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case y.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case y.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case y.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case y.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case y.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case y.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case y.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case y.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case y.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case y.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case y.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case y.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case y.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case y.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case y.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case y.BOGUS_COMMENT:{this._stateBogusComment(e);break}case y.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case y.COMMENT_START:{this._stateCommentStart(e);break}case y.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case y.COMMENT:{this._stateComment(e);break}case y.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case y.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case y.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case y.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case y.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case y.COMMENT_END:{this._stateCommentEnd(e);break}case y.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case y.DOCTYPE:{this._stateDoctype(e);break}case y.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case y.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case y.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case y.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case y.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case y.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case y.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case y.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case y.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case y.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case y.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case y.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case y.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case y.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case y.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case y.CDATA_SECTION:{this._stateCdataSection(e);break}case y.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case y.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case y.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case y.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case x.LESS_THAN_SIGN:{this.state=y.TAG_OPEN;break}case x.AMPERSAND:{this._startCharacterReference();break}case x.NULL:{this._err(v.unexpectedNullCharacter),this._emitCodePoint(e);break}case x.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case x.AMPERSAND:{this._startCharacterReference();break}case x.LESS_THAN_SIGN:{this.state=y.RCDATA_LESS_THAN_SIGN;break}case x.NULL:{this._err(v.unexpectedNullCharacter),this._emitChars(Ce);break}case x.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case x.LESS_THAN_SIGN:{this.state=y.RAWTEXT_LESS_THAN_SIGN;break}case x.NULL:{this._err(v.unexpectedNullCharacter),this._emitChars(Ce);break}case x.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case x.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_LESS_THAN_SIGN;break}case x.NULL:{this._err(v.unexpectedNullCharacter),this._emitChars(Ce);break}case x.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case x.NULL:{this._err(v.unexpectedNullCharacter),this._emitChars(Ce);break}case x.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Bt(e))this._createStartTagToken(),this.state=y.TAG_NAME,this._stateTagName(e);else switch(e){case x.EXCLAMATION_MARK:{this.state=y.MARKUP_DECLARATION_OPEN;break}case x.SOLIDUS:{this.state=y.END_TAG_OPEN;break}case x.QUESTION_MARK:{this._err(v.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=y.BOGUS_COMMENT,this._stateBogusComment(e);break}case x.EOF:{this._err(v.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(v.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=y.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Bt(e))this._createEndTagToken(),this.state=y.TAG_NAME,this._stateTagName(e);else switch(e){case x.GREATER_THAN_SIGN:{this._err(v.missingEndTagName),this.state=y.DATA;break}case x.EOF:{this._err(v.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(v.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=y.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:{this.state=y.BEFORE_ATTRIBUTE_NAME;break}case x.SOLIDUS:{this.state=y.SELF_CLOSING_START_TAG;break}case x.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentTagToken();break}case x.NULL:{this._err(v.unexpectedNullCharacter),n.tagName+=Ce;break}case x.EOF:{this._err(v.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Hn(e)?Ar(e):e)}}_stateRcdataLessThanSign(e){e===x.SOLIDUS?this.state=y.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=y.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Bt(e)?(this.state=y.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=y.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=y.BEFORE_ATTRIBUTE_NAME,!1;case x.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=y.SELF_CLOSING_START_TAG,!1;case x.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=y.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=y.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===x.SOLIDUS?this.state=y.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=y.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Bt(e)?(this.state=y.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=y.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=y.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case x.SOLIDUS:{this.state=y.SCRIPT_DATA_END_TAG_OPEN;break}case x.EXCLAMATION_MARK:{this.state=y.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=y.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Bt(e)?(this.state=y.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=y.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=y.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===x.HYPHEN_MINUS?(this.state=y.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=y.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===x.HYPHEN_MINUS?(this.state=y.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=y.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case x.HYPHEN_MINUS:{this.state=y.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case x.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case x.NULL:{this._err(v.unexpectedNullCharacter),this._emitChars(Ce);break}case x.EOF:{this._err(v.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case x.HYPHEN_MINUS:{this.state=y.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case x.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case x.NULL:{this._err(v.unexpectedNullCharacter),this.state=y.SCRIPT_DATA_ESCAPED,this._emitChars(Ce);break}case x.EOF:{this._err(v.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=y.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case x.HYPHEN_MINUS:{this._emitChars("-");break}case x.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case x.GREATER_THAN_SIGN:{this.state=y.SCRIPT_DATA,this._emitChars(">");break}case x.NULL:{this._err(v.unexpectedNullCharacter),this.state=y.SCRIPT_DATA_ESCAPED,this._emitChars(Ce);break}case x.EOF:{this._err(v.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=y.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===x.SOLIDUS?this.state=y.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Bt(e)?(this._emitChars("<"),this.state=y.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=y.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Bt(e)?(this.state=y.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=y.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=y.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(et.SCRIPT,!1)&&Au(this.preprocessor.peek(et.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<et.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=y.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case x.HYPHEN_MINUS:{this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case x.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case x.NULL:{this._err(v.unexpectedNullCharacter),this._emitChars(Ce);break}case x.EOF:{this._err(v.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case x.HYPHEN_MINUS:{this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case x.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case x.NULL:{this._err(v.unexpectedNullCharacter),this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ce);break}case x.EOF:{this._err(v.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case x.HYPHEN_MINUS:{this._emitChars("-");break}case x.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case x.GREATER_THAN_SIGN:{this.state=y.SCRIPT_DATA,this._emitChars(">");break}case x.NULL:{this._err(v.unexpectedNullCharacter),this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ce);break}case x.EOF:{this._err(v.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===x.SOLIDUS?(this.state=y.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(et.SCRIPT,!1)&&Au(this.preprocessor.peek(et.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<et.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=y.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.SOLIDUS:case x.GREATER_THAN_SIGN:case x.EOF:{this.state=y.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case x.EQUALS_SIGN:{this._err(v.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=y.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=y.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:case x.SOLIDUS:case x.GREATER_THAN_SIGN:case x.EOF:{this._leaveAttrName(),this.state=y.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case x.EQUALS_SIGN:{this._leaveAttrName(),this.state=y.BEFORE_ATTRIBUTE_VALUE;break}case x.QUOTATION_MARK:case x.APOSTROPHE:case x.LESS_THAN_SIGN:{this._err(v.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case x.NULL:{this._err(v.unexpectedNullCharacter),this.currentAttr.name+=Ce;break}default:this.currentAttr.name+=String.fromCodePoint(Hn(e)?Ar(e):e)}}_stateAfterAttributeName(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.SOLIDUS:{this.state=y.SELF_CLOSING_START_TAG;break}case x.EQUALS_SIGN:{this.state=y.BEFORE_ATTRIBUTE_VALUE;break}case x.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentTagToken();break}case x.EOF:{this._err(v.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=y.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.QUOTATION_MARK:{this.state=y.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case x.APOSTROPHE:{this.state=y.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case x.GREATER_THAN_SIGN:{this._err(v.missingAttributeValue),this.state=y.DATA,this.emitCurrentTagToken();break}default:this.state=y.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case x.QUOTATION_MARK:{this.state=y.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case x.AMPERSAND:{this._startCharacterReference();break}case x.NULL:{this._err(v.unexpectedNullCharacter),this.currentAttr.value+=Ce;break}case x.EOF:{this._err(v.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case x.APOSTROPHE:{this.state=y.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case x.AMPERSAND:{this._startCharacterReference();break}case x.NULL:{this._err(v.unexpectedNullCharacter),this.currentAttr.value+=Ce;break}case x.EOF:{this._err(v.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:{this._leaveAttrValue(),this.state=y.BEFORE_ATTRIBUTE_NAME;break}case x.AMPERSAND:{this._startCharacterReference();break}case x.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=y.DATA,this.emitCurrentTagToken();break}case x.NULL:{this._err(v.unexpectedNullCharacter),this.currentAttr.value+=Ce;break}case x.QUOTATION_MARK:case x.APOSTROPHE:case x.LESS_THAN_SIGN:case x.EQUALS_SIGN:case x.GRAVE_ACCENT:{this._err(v.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case x.EOF:{this._err(v.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:{this._leaveAttrValue(),this.state=y.BEFORE_ATTRIBUTE_NAME;break}case x.SOLIDUS:{this._leaveAttrValue(),this.state=y.SELF_CLOSING_START_TAG;break}case x.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=y.DATA,this.emitCurrentTagToken();break}case x.EOF:{this._err(v.eofInTag),this._emitEOFToken();break}default:this._err(v.missingWhitespaceBetweenAttributes),this.state=y.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case x.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=y.DATA,this.emitCurrentTagToken();break}case x.EOF:{this._err(v.eofInTag),this._emitEOFToken();break}default:this._err(v.unexpectedSolidusInTag),this.state=y.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case x.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentComment(n);break}case x.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case x.NULL:{this._err(v.unexpectedNullCharacter),n.data+=Ce;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(et.DASH_DASH,!0)?(this._createCommentToken(et.DASH_DASH.length+1),this.state=y.COMMENT_START):this._consumeSequenceIfMatch(et.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(et.DOCTYPE.length+1),this.state=y.DOCTYPE):this._consumeSequenceIfMatch(et.CDATA_START,!0)?this.inForeignNode?this.state=y.CDATA_SECTION:(this._err(v.cdataInHtmlContent),this._createCommentToken(et.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=y.BOGUS_COMMENT):this._ensureHibernation()||(this._err(v.incorrectlyOpenedComment),this._createCommentToken(2),this.state=y.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case x.HYPHEN_MINUS:{this.state=y.COMMENT_START_DASH;break}case x.GREATER_THAN_SIGN:{this._err(v.abruptClosingOfEmptyComment),this.state=y.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=y.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case x.HYPHEN_MINUS:{this.state=y.COMMENT_END;break}case x.GREATER_THAN_SIGN:{this._err(v.abruptClosingOfEmptyComment),this.state=y.DATA,this.emitCurrentComment(n);break}case x.EOF:{this._err(v.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=y.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case x.HYPHEN_MINUS:{this.state=y.COMMENT_END_DASH;break}case x.LESS_THAN_SIGN:{n.data+="<",this.state=y.COMMENT_LESS_THAN_SIGN;break}case x.NULL:{this._err(v.unexpectedNullCharacter),n.data+=Ce;break}case x.EOF:{this._err(v.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case x.EXCLAMATION_MARK:{n.data+="!",this.state=y.COMMENT_LESS_THAN_SIGN_BANG;break}case x.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=y.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===x.HYPHEN_MINUS?this.state=y.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=y.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===x.HYPHEN_MINUS?this.state=y.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=y.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==x.GREATER_THAN_SIGN&&e!==x.EOF&&this._err(v.nestedComment),this.state=y.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case x.HYPHEN_MINUS:{this.state=y.COMMENT_END;break}case x.EOF:{this._err(v.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=y.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case x.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentComment(n);break}case x.EXCLAMATION_MARK:{this.state=y.COMMENT_END_BANG;break}case x.HYPHEN_MINUS:{n.data+="-";break}case x.EOF:{this._err(v.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=y.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case x.HYPHEN_MINUS:{n.data+="--!",this.state=y.COMMENT_END_DASH;break}case x.GREATER_THAN_SIGN:{this._err(v.incorrectlyClosedComment),this.state=y.DATA,this.emitCurrentComment(n);break}case x.EOF:{this._err(v.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=y.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:{this.state=y.BEFORE_DOCTYPE_NAME;break}case x.GREATER_THAN_SIGN:{this.state=y.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case x.EOF:{this._err(v.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(v.missingWhitespaceBeforeDoctypeName),this.state=y.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(Hn(e))this._createDoctypeToken(String.fromCharCode(Ar(e))),this.state=y.DOCTYPE_NAME;else switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.NULL:{this._err(v.unexpectedNullCharacter),this._createDoctypeToken(Ce),this.state=y.DOCTYPE_NAME;break}case x.GREATER_THAN_SIGN:{this._err(v.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=y.DATA;break}case x.EOF:{this._err(v.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=y.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:{this.state=y.AFTER_DOCTYPE_NAME;break}case x.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentDoctype(n);break}case x.NULL:{this._err(v.unexpectedNullCharacter),n.name+=Ce;break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Hn(e)?Ar(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentDoctype(n);break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(et.PUBLIC,!1)?this.state=y.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(et.SYSTEM,!1)?this.state=y.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(v.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=y.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:{this.state=y.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case x.QUOTATION_MARK:{this._err(v.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=y.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case x.APOSTROPHE:{this._err(v.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=y.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case x.GREATER_THAN_SIGN:{this._err(v.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=y.DATA,this.emitCurrentDoctype(n);break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(v.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=y.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.QUOTATION_MARK:{n.publicId="",this.state=y.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case x.APOSTROPHE:{n.publicId="",this.state=y.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case x.GREATER_THAN_SIGN:{this._err(v.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=y.DATA,this.emitCurrentDoctype(n);break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(v.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=y.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case x.QUOTATION_MARK:{this.state=y.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case x.NULL:{this._err(v.unexpectedNullCharacter),n.publicId+=Ce;break}case x.GREATER_THAN_SIGN:{this._err(v.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=y.DATA;break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case x.APOSTROPHE:{this.state=y.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case x.NULL:{this._err(v.unexpectedNullCharacter),n.publicId+=Ce;break}case x.GREATER_THAN_SIGN:{this._err(v.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=y.DATA;break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:{this.state=y.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case x.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentDoctype(n);break}case x.QUOTATION_MARK:{this._err(v.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case x.APOSTROPHE:{this._err(v.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(v.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=y.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=y.DATA;break}case x.QUOTATION_MARK:{n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case x.APOSTROPHE:{n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(v.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=y.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:{this.state=y.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case x.QUOTATION_MARK:{this._err(v.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case x.APOSTROPHE:{this._err(v.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case x.GREATER_THAN_SIGN:{this._err(v.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=y.DATA,this.emitCurrentDoctype(n);break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(v.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=y.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.QUOTATION_MARK:{n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case x.APOSTROPHE:{n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case x.GREATER_THAN_SIGN:{this._err(v.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=y.DATA,this.emitCurrentDoctype(n);break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(v.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=y.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case x.QUOTATION_MARK:{this.state=y.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case x.NULL:{this._err(v.unexpectedNullCharacter),n.systemId+=Ce;break}case x.GREATER_THAN_SIGN:{this._err(v.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=y.DATA;break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case x.APOSTROPHE:{this.state=y.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case x.NULL:{this._err(v.unexpectedNullCharacter),n.systemId+=Ce;break}case x.GREATER_THAN_SIGN:{this._err(v.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=y.DATA;break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=y.DATA;break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(v.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=y.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case x.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=y.DATA;break}case x.NULL:{this._err(v.unexpectedNullCharacter);break}case x.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case x.RIGHT_SQUARE_BRACKET:{this.state=y.CDATA_SECTION_BRACKET;break}case x.EOF:{this._err(v.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===x.RIGHT_SQUARE_BRACKET?this.state=y.CDATA_SECTION_END:(this._emitChars("]"),this.state=y.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case x.GREATER_THAN_SIGN:{this.state=y.DATA;break}case x.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=y.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(x.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&yu(this.preprocessor.peek(1))?y.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){yu(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===x.SEMICOLON&&this._err(v.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const rc=new Set([c.DD,c.DT,c.LI,c.OPTGROUP,c.OPTION,c.P,c.RB,c.RP,c.RT,c.RTC]),ku=new Set([...rc,c.CAPTION,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]),Hr=new Set([c.APPLET,c.CAPTION,c.HTML,c.MARQUEE,c.OBJECT,c.TABLE,c.TD,c.TEMPLATE,c.TH]),qE=new Set([...Hr,c.OL,c.UL]),VE=new Set([...Hr,c.BUTTON]),Cu=new Set([c.ANNOTATION_XML,c.MI,c.MN,c.MO,c.MS,c.MTEXT]),Iu=new Set([c.DESC,c.FOREIGN_OBJECT,c.TITLE]),GE=new Set([c.TR,c.TEMPLATE,c.HTML]),WE=new Set([c.TBODY,c.TFOOT,c.THEAD,c.TEMPLATE,c.HTML]),QE=new Set([c.TABLE,c.TEMPLATE,c.HTML]),XE=new Set([c.TD,c.TH]);class ZE{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=c.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===c.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===F.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,n){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,n,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,n){const r=this._indexOf(e);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(e,n,r){const s=this._indexOf(e)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==F.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(e){for(;this.stackTop>=e;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<e)}}popUntilElementPopped(e){const n=this._indexOf(e);this.shortenToLength(Math.max(n,0))}popUntilPopped(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(ni,F.HTML)}popUntilTableCellPopped(){this.popUntilPopped(XE,F.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,n){for(let r=this.stackTop;r>=0;r--)if(e.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(QE,F.HTML)}clearBackToTableBodyContext(){this.clearBackTo(WE,F.HTML)}clearBackToTableRowContext(){this.clearBackTo(GE,F.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===c.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===c.HTML}hasInDynamicScope(e,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case F.HTML:{if(s===e)return!0;if(n.has(s))return!1;break}case F.SVG:{if(Iu.has(s))return!1;break}case F.MATHML:{if(Cu.has(s))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Hr)}hasInListItemScope(e){return this.hasInDynamicScope(e,qE)}hasInButtonScope(e){return this.hasInDynamicScope(e,VE)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case F.HTML:{if(ni.has(n))return!0;if(Hr.has(n))return!1;break}case F.SVG:{if(Iu.has(n))return!1;break}case F.MATHML:{if(Cu.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===F.HTML)switch(this.tagIDs[n]){case e:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===F.HTML)switch(this.tagIDs[e]){case c.TBODY:case c.THEAD:case c.TFOOT:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===F.HTML)switch(this.tagIDs[n]){case e:return!0;case c.OPTION:case c.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&rc.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&ku.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&ku.has(this.currentTagId);)this.pop()}}const Ns=3;var kt;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(kt||(kt={}));const Nu={type:kt.Marker};class KE{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],s=n.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let u=0;u<this.entries.length;u++){const l=this.entries[u];if(l.type===kt.Marker)break;const{element:o}=l;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){const d=this.treeAdapter.getAttrList(o);d.length===s&&r.push({idx:u,attrs:d})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<Ns)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<Ns)return;const s=new Map(n.map(a=>[a.name,a.value]));let i=0;for(let a=0;a<r.length;a++){const u=r[a];u.attrs.every(l=>s.get(l.name)===l.value)&&(i+=1,i>=Ns&&this.entries.splice(u.idx,1))}}insertMarker(){this.entries.unshift(Nu)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:kt.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:kt.Element,element:e,token:n})}removeEntry(e){const n=this.entries.indexOf(e);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const e=this.entries.indexOf(Nu);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===kt.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===kt.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===kt.Element&&n.element===e)}}const Ft={createDocument(){return{nodeName:"#document",mode:pt.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,n){return{nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const r=t.childNodes.indexOf(n);t.childNodes.splice(r,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,n,r){const s=t.childNodes.find(i=>i.nodeName==="#documentType");if(s)s.name=e,s.publicId=n,s.systemId=r;else{const i={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};Ft.appendChild(t,i)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(Ft.isTextNode(n)){n.value+=e;return}}Ft.appendChild(t,Ft.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&Ft.isTextNode(r)?r.value+=e:Ft.insertBefore(t,Ft.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(r=>r.name));for(let r=0;r<e.length;r++)n.has(e[r].name)||t.attrs.push(e[r])},getFirstChild(t){return t.childNodes[0]},getChildNodes(t){return t.childNodes},getParentNode(t){return t.parentNode},getAttrList(t){return t.attrs},getTagName(t){return t.tagName},getNamespaceURI(t){return t.namespaceURI},getTextNodeContent(t){return t.value},getCommentNodeContent(t){return t.data},getDocumentTypeNodeName(t){return t.name},getDocumentTypeNodePublicId(t){return t.publicId},getDocumentTypeNodeSystemId(t){return t.systemId},isTextNode(t){return t.nodeName==="#text"},isCommentNode(t){return t.nodeName==="#comment"},isDocumentTypeNode(t){return t.nodeName==="#documentType"},isElementNode(t){return Object.prototype.hasOwnProperty.call(t,"tagName")},setNodeSourceCodeLocation(t,e){t.sourceCodeLocation=e},getNodeSourceCodeLocation(t){return t.sourceCodeLocation},updateNodeSourceCodeLocation(t,e){t.sourceCodeLocation={...t.sourceCodeLocation,...e}}},sc="html",JE="about:legacy-compat",e2="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",ic=["+//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//"],t2=[...ic,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],n2=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),ac=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],r2=[...ac,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Su(t,e){return e.some(n=>t.startsWith(n))}function s2(t){return t.name===sc&&t.publicId===null&&(t.systemId===null||t.systemId===JE)}function i2(t){if(t.name!==sc)return pt.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===e2)return pt.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),n2.has(n))return pt.QUIRKS;let r=e===null?t2:ic;if(Su(n,r))return pt.QUIRKS;if(r=e===null?ac:r2,Su(n,r))return pt.LIMITED_QUIRKS}return pt.NO_QUIRKS}const wu={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},a2="definitionurl",u2="definitionURL",o2=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(t=>[t.toLowerCase(),t])),l2=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:F.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:F.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:F.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:F.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:F.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:F.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:F.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:F.XML}],["xml:space",{prefix:"xml",name:"space",namespace:F.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:F.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:F.XMLNS}]]),c2=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),d2=new Set([c.B,c.BIG,c.BLOCKQUOTE,c.BODY,c.BR,c.CENTER,c.CODE,c.DD,c.DIV,c.DL,c.DT,c.EM,c.EMBED,c.H1,c.H2,c.H3,c.H4,c.H5,c.H6,c.HEAD,c.HR,c.I,c.IMG,c.LI,c.LISTING,c.MENU,c.META,c.NOBR,c.OL,c.P,c.PRE,c.RUBY,c.S,c.SMALL,c.SPAN,c.STRONG,c.STRIKE,c.SUB,c.SUP,c.TABLE,c.TT,c.U,c.UL,c.VAR]);function f2(t){const e=t.tagID;return e===c.FONT&&t.attrs.some(({name:r})=>r===Kt.COLOR||r===Kt.SIZE||r===Kt.FACE)||d2.has(e)}function uc(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===a2){t.attrs[e].name=u2;break}}function oc(t){for(let e=0;e<t.attrs.length;e++){const n=o2.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function Yi(t){for(let e=0;e<t.attrs.length;e++){const n=l2.get(t.attrs[e].name);n&&(t.attrs[e].prefix=n.prefix,t.attrs[e].name=n.name,t.attrs[e].namespace=n.namespace)}}function h2(t){const e=c2.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=Nn(t.tagName))}function p2(t,e){return e===F.MATHML&&(t===c.MI||t===c.MO||t===c.MN||t===c.MS||t===c.MTEXT)}function m2(t,e,n){if(e===F.MATHML&&t===c.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Kt.ENCODING){const s=n[r].value.toLowerCase();return s===wu.TEXT_HTML||s===wu.APPLICATION_XML}}return e===F.SVG&&(t===c.FOREIGN_OBJECT||t===c.DESC||t===c.TITLE)}function g2(t,e,n,r){return(!r||r===F.HTML)&&m2(t,e,n)||(!r||r===F.MATHML)&&p2(t,e)}const b2="hidden",E2=8,T2=3;var C;(function(t){t[t.INITIAL=0]="INITIAL",t[t.BEFORE_HTML=1]="BEFORE_HTML",t[t.BEFORE_HEAD=2]="BEFORE_HEAD",t[t.IN_HEAD=3]="IN_HEAD",t[t.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",t[t.AFTER_HEAD=5]="AFTER_HEAD",t[t.IN_BODY=6]="IN_BODY",t[t.TEXT=7]="TEXT",t[t.IN_TABLE=8]="IN_TABLE",t[t.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",t[t.IN_CAPTION=10]="IN_CAPTION",t[t.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",t[t.IN_TABLE_BODY=12]="IN_TABLE_BODY",t[t.IN_ROW=13]="IN_ROW",t[t.IN_CELL=14]="IN_CELL",t[t.IN_SELECT=15]="IN_SELECT",t[t.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",t[t.IN_TEMPLATE=17]="IN_TEMPLATE",t[t.AFTER_BODY=18]="AFTER_BODY",t[t.IN_FRAMESET=19]="IN_FRAMESET",t[t.AFTER_FRAMESET=20]="AFTER_FRAMESET",t[t.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",t[t.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(C||(C={}));const x2={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},lc=new Set([c.TABLE,c.TBODY,c.TFOOT,c.THEAD,c.TR]),Ru={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Ft,onParseError:null};class Ou{constructor(e,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=C.INITIAL,this.originalInsertionMode=C.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={...Ru,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new YE(this.options,this),this.activeFormattingElements=new KE(this.treeAdapter),this.fragmentContextID=r?Nn(this.treeAdapter.getTagName(r)):c.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new ZE(this.document,this.treeAdapter,this)}static parse(e,n){const r=new this(n);return r.tokenizer.write(e,!0),r.document}static getFragmentParser(e,n){const r={...Ru,...n};e??(e=r.treeAdapter.createElement(O.TEMPLATE,F.HTML,[]));const s=r.treeAdapter.createElement("documentmock",F.HTML,[]),i=new this(r,s,e);return i.fragmentContextID===c.TEMPLATE&&i.tmplInsertionModeStack.unshift(C.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,r){var s;if(!this.onParseError)return;const i=(s=e.location)!==null&&s!==void 0?s:x2,a={code:n,startLine:i.startLine,startCol:i.startCol,startOffset:i.startOffset,endLine:r?i.startLine:i.endLine,endCol:r?i.startCol:i.endCol,endOffset:r?i.startOffset:i.endOffset};this.onParseError(a)}onItemPush(e,n,r){var s,i;(i=(s=this.treeAdapter).onItemPush)===null||i===void 0||i.call(s,e),r&&this.openElements.stackTop>0&&this._setContextModes(e,n)}onItemPop(e,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,e,this.openElements.current),n){let i,a;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,a=this.fragmentContextID):{current:i,currentTagId:a}=this.openElements,this._setContextModes(i,a)}}_setContextModes(e,n){const r=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===F.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,F.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=C.TEXT}switchToPlaintextParsing(){this.insertionMode=C.TEXT,this.originalInsertionMode=C.IN_BODY,this.tokenizer.state=we.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)===O.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==F.HTML))switch(this.fragmentContextID){case c.TITLE:case c.TEXTAREA:{this.tokenizer.state=we.RCDATA;break}case c.STYLE:case c.XMP:case c.IFRAME:case c.NOEMBED:case c.NOFRAMES:case c.NOSCRIPT:{this.tokenizer.state=we.RAWTEXT;break}case c.SCRIPT:{this.tokenizer.state=we.SCRIPT_DATA;break}case c.PLAINTEXT:{this.tokenizer.state=we.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",r=e.publicId||"",s=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),e.location){const a=this.treeAdapter.getChildNodes(this.document).find(u=>this.treeAdapter.isDocumentTypeNode(u));a&&this.treeAdapter.setNodeSourceCodeLocation(a,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,e)}}_appendElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location)}_insertElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID)}_insertFakeElement(e,n){const r=this.treeAdapter.createElement(e,F.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,F.HTML,e.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(O.HTML,F.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,c.HTML)}_appendCommentNode(e,n){const r=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,e.location)}_insertCharacters(e){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,e.chars,r):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const s=this.treeAdapter.getChildNodes(n),i=r?s.lastIndexOf(r):s.length,a=s[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:l,endCol:o,endOffset:d}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:l,endCol:o,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,e.location)}_adoptNodes(e,n){for(let r=this.treeAdapter.getFirstChild(e);r;r=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(e),i=n.type===ae.END_TAG&&s===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,e.tagID===c.SVG&&this.treeAdapter.getTagName(n)===O.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===F.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===c.MGLYPH||e.tagID===c.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,F.HTML)}_processToken(e){switch(e.type){case ae.CHARACTER:{this.onCharacter(e);break}case ae.NULL_CHARACTER:{this.onNullCharacter(e);break}case ae.COMMENT:{this.onComment(e);break}case ae.DOCTYPE:{this.onDoctype(e);break}case ae.START_TAG:{this._processStartTag(e);break}case ae.END_TAG:{this.onEndTag(e);break}case ae.EOF:{this.onEof(e);break}case ae.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const s=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return g2(e,s,i,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===kt.Marker||this.openElements.contains(s.element)),r=n===-1?e-1:n-1;for(let s=r;s>=0;s--){const i=this.activeFormattingElements.entries[s];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=C.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(c.P),this.openElements.popUntilTagNamePopped(c.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case c.TR:{this.insertionMode=C.IN_ROW;return}case c.TBODY:case c.THEAD:case c.TFOOT:{this.insertionMode=C.IN_TABLE_BODY;return}case c.CAPTION:{this.insertionMode=C.IN_CAPTION;return}case c.COLGROUP:{this.insertionMode=C.IN_COLUMN_GROUP;return}case c.TABLE:{this.insertionMode=C.IN_TABLE;return}case c.BODY:{this.insertionMode=C.IN_BODY;return}case c.FRAMESET:{this.insertionMode=C.IN_FRAMESET;return}case c.SELECT:{this._resetInsertionModeForSelect(e);return}case c.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case c.HTML:{this.insertionMode=this.headElement?C.AFTER_HEAD:C.BEFORE_HEAD;return}case c.TD:case c.TH:{if(e>0){this.insertionMode=C.IN_CELL;return}break}case c.HEAD:{if(e>0){this.insertionMode=C.IN_HEAD;return}break}}this.insertionMode=C.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===c.TEMPLATE)break;if(r===c.TABLE){this.insertionMode=C.IN_SELECT_IN_TABLE;return}}this.insertionMode=C.IN_SELECT}_isElementCausesFosterParenting(e){return lc.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--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case c.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===F.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case c.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const r=this.treeAdapter.getNamespaceURI(e);return HE[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){XT(this,e);return}switch(this.insertionMode){case C.INITIAL:{Pn(this,e);break}case C.BEFORE_HTML:{Vn(this,e);break}case C.BEFORE_HEAD:{Gn(this,e);break}case C.IN_HEAD:{Wn(this,e);break}case C.IN_HEAD_NO_SCRIPT:{Qn(this,e);break}case C.AFTER_HEAD:{Xn(this,e);break}case C.IN_BODY:case C.IN_CAPTION:case C.IN_CELL:case C.IN_TEMPLATE:{dc(this,e);break}case C.TEXT:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case C.IN_TABLE:case C.IN_TABLE_BODY:case C.IN_ROW:{Ss(this,e);break}case C.IN_TABLE_TEXT:{bc(this,e);break}case C.IN_COLUMN_GROUP:{jr(this,e);break}case C.AFTER_BODY:{zr(this,e);break}case C.AFTER_AFTER_BODY:{Or(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){QT(this,e);return}switch(this.insertionMode){case C.INITIAL:{Pn(this,e);break}case C.BEFORE_HTML:{Vn(this,e);break}case C.BEFORE_HEAD:{Gn(this,e);break}case C.IN_HEAD:{Wn(this,e);break}case C.IN_HEAD_NO_SCRIPT:{Qn(this,e);break}case C.AFTER_HEAD:{Xn(this,e);break}case C.TEXT:{this._insertCharacters(e);break}case C.IN_TABLE:case C.IN_TABLE_BODY:case C.IN_ROW:{Ss(this,e);break}case C.IN_COLUMN_GROUP:{jr(this,e);break}case C.AFTER_BODY:{zr(this,e);break}case C.AFTER_AFTER_BODY:{Or(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){ri(this,e);return}switch(this.insertionMode){case C.INITIAL:case C.BEFORE_HTML:case C.BEFORE_HEAD:case C.IN_HEAD:case C.IN_HEAD_NO_SCRIPT:case C.AFTER_HEAD:case C.IN_BODY:case C.IN_TABLE:case C.IN_CAPTION:case C.IN_COLUMN_GROUP:case C.IN_TABLE_BODY:case C.IN_ROW:case C.IN_CELL:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:case C.IN_TEMPLATE:case C.IN_FRAMESET:case C.AFTER_FRAMESET:{ri(this,e);break}case C.IN_TABLE_TEXT:{Mn(this,e);break}case C.AFTER_BODY:{N2(this,e);break}case C.AFTER_AFTER_BODY:case C.AFTER_AFTER_FRAMESET:{S2(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case C.INITIAL:{w2(this,e);break}case C.BEFORE_HEAD:case C.IN_HEAD:case C.IN_HEAD_NO_SCRIPT:case C.AFTER_HEAD:{this._err(e,v.misplacedDoctype);break}case C.IN_TABLE_TEXT:{Mn(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,v.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?ZT(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case C.INITIAL:{Pn(this,e);break}case C.BEFORE_HTML:{R2(this,e);break}case C.BEFORE_HEAD:{L2(this,e);break}case C.IN_HEAD:{Et(this,e);break}case C.IN_HEAD_NO_SCRIPT:{P2(this,e);break}case C.AFTER_HEAD:{B2(this,e);break}case C.IN_BODY:{Ve(this,e);break}case C.IN_TABLE:{Tn(this,e);break}case C.IN_TABLE_TEXT:{Mn(this,e);break}case C.IN_CAPTION:{vT(this,e);break}case C.IN_COLUMN_GROUP:{Gi(this,e);break}case C.IN_TABLE_BODY:{us(this,e);break}case C.IN_ROW:{os(this,e);break}case C.IN_CELL:{MT(this,e);break}case C.IN_SELECT:{xc(this,e);break}case C.IN_SELECT_IN_TABLE:{FT(this,e);break}case C.IN_TEMPLATE:{HT(this,e);break}case C.AFTER_BODY:{zT(this,e);break}case C.IN_FRAMESET:{$T(this,e);break}case C.AFTER_FRAMESET:{qT(this,e);break}case C.AFTER_AFTER_BODY:{GT(this,e);break}case C.AFTER_AFTER_FRAMESET:{WT(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?KT(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case C.INITIAL:{Pn(this,e);break}case C.BEFORE_HTML:{O2(this,e);break}case C.BEFORE_HEAD:{v2(this,e);break}case C.IN_HEAD:{D2(this,e);break}case C.IN_HEAD_NO_SCRIPT:{M2(this,e);break}case C.AFTER_HEAD:{F2(this,e);break}case C.IN_BODY:{as(this,e);break}case C.TEXT:{AT(this,e);break}case C.IN_TABLE:{sr(this,e);break}case C.IN_TABLE_TEXT:{Mn(this,e);break}case C.IN_CAPTION:{DT(this,e);break}case C.IN_COLUMN_GROUP:{PT(this,e);break}case C.IN_TABLE_BODY:{si(this,e);break}case C.IN_ROW:{Tc(this,e);break}case C.IN_CELL:{BT(this,e);break}case C.IN_SELECT:{_c(this,e);break}case C.IN_SELECT_IN_TABLE:{UT(this,e);break}case C.IN_TEMPLATE:{jT(this,e);break}case C.AFTER_BODY:{Ac(this,e);break}case C.IN_FRAMESET:{YT(this,e);break}case C.AFTER_FRAMESET:{VT(this,e);break}case C.AFTER_AFTER_BODY:{Or(this,e);break}}}onEof(e){switch(this.insertionMode){case C.INITIAL:{Pn(this,e);break}case C.BEFORE_HTML:{Vn(this,e);break}case C.BEFORE_HEAD:{Gn(this,e);break}case C.IN_HEAD:{Wn(this,e);break}case C.IN_HEAD_NO_SCRIPT:{Qn(this,e);break}case C.AFTER_HEAD:{Xn(this,e);break}case C.IN_BODY:case C.IN_TABLE:case C.IN_CAPTION:case C.IN_COLUMN_GROUP:case C.IN_TABLE_BODY:case C.IN_ROW:case C.IN_CELL:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:{mc(this,e);break}case C.TEXT:{kT(this,e);break}case C.IN_TABLE_TEXT:{Mn(this,e);break}case C.IN_TEMPLATE:{yc(this,e);break}case C.AFTER_BODY:case C.IN_FRAMESET:case C.AFTER_FRAMESET:case C.AFTER_AFTER_BODY:case C.AFTER_AFTER_FRAMESET:{Vi(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===x.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 C.IN_HEAD:case C.IN_HEAD_NO_SCRIPT:case C.AFTER_HEAD:case C.TEXT:case C.IN_COLUMN_GROUP:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:case C.IN_FRAMESET:case C.AFTER_FRAMESET:{this._insertCharacters(e);break}case C.IN_BODY:case C.IN_CAPTION:case C.IN_CELL:case C.IN_TEMPLATE:case C.AFTER_BODY:case C.AFTER_AFTER_BODY:case C.AFTER_AFTER_FRAMESET:{cc(this,e);break}case C.IN_TABLE:case C.IN_TABLE_BODY:case C.IN_ROW:{Ss(this,e);break}case C.IN_TABLE_TEXT:{gc(this,e);break}}}}function _2(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):pc(t,e),n}function y2(t,e){let n=null,r=t.openElements.stackTop;for(;r>=0;r--){const s=t.openElements.items[r];if(s===e.element)break;t._isSpecialElement(s,t.openElements.tagIDs[r])&&(n=s)}return n||(t.openElements.shortenToLength(Math.max(r,0)),t.activeFormattingElements.removeEntry(e)),n}function A2(t,e,n){let r=e,s=t.openElements.getCommonAncestor(e);for(let i=0,a=s;a!==n;i++,a=s){s=t.openElements.getCommonAncestor(a);const u=t.activeFormattingElements.getElementEntry(a),l=u&&i>=T2;!u||l?(l&&t.activeFormattingElements.removeEntry(u),t.openElements.remove(a)):(a=k2(t,u),r===e&&(t.activeFormattingElements.bookmark=u),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(a,r),r=a)}return r}function k2(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),r=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,r),e.element=r,r}function C2(t,e,n){const r=t.treeAdapter.getTagName(e),s=Nn(r);if(t._isElementCausesFosterParenting(s))t._fosterParentElement(n);else{const i=t.treeAdapter.getNamespaceURI(e);s===c.TEMPLATE&&i===F.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function I2(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:s}=n,i=t.treeAdapter.createElement(s.tagName,r,s.attrs);t._adoptNodes(e,i),t.treeAdapter.appendChild(e,i),t.activeFormattingElements.insertElementAfterBookmark(i,s),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,i,s.tagID)}function qi(t,e){for(let n=0;n<E2;n++){const r=_2(t,e);if(!r)break;const s=y2(t,r);if(!s)break;t.activeFormattingElements.bookmark=r;const i=A2(t,s,r.element),a=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(i),a&&C2(t,a,i),I2(t,s,r)}}function ri(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function N2(t,e){t._appendCommentNode(e,t.openElements.items[0])}function S2(t,e){t._appendCommentNode(e,t.document)}function Vi(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let r=t.openElements.stackTop;r>=n;r--)t._setEndLocation(t.openElements.items[r],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const r=t.openElements.items[0],s=t.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(t._setEndLocation(r,e),t.openElements.stackTop>=1)){const i=t.openElements.items[1],a=t.treeAdapter.getNodeSourceCodeLocation(i);a&&!a.endTag&&t._setEndLocation(i,e)}}}}function w2(t,e){t._setDocumentType(e);const n=e.forceQuirks?pt.QUIRKS:i2(e);s2(e)||t._err(e,v.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=C.BEFORE_HTML}function Pn(t,e){t._err(e,v.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,pt.QUIRKS),t.insertionMode=C.BEFORE_HTML,t._processToken(e)}function R2(t,e){e.tagID===c.HTML?(t._insertElement(e,F.HTML),t.insertionMode=C.BEFORE_HEAD):Vn(t,e)}function O2(t,e){const n=e.tagID;(n===c.HTML||n===c.HEAD||n===c.BODY||n===c.BR)&&Vn(t,e)}function Vn(t,e){t._insertFakeRootElement(),t.insertionMode=C.BEFORE_HEAD,t._processToken(e)}function L2(t,e){switch(e.tagID){case c.HTML:{Ve(t,e);break}case c.HEAD:{t._insertElement(e,F.HTML),t.headElement=t.openElements.current,t.insertionMode=C.IN_HEAD;break}default:Gn(t,e)}}function v2(t,e){const n=e.tagID;n===c.HEAD||n===c.BODY||n===c.HTML||n===c.BR?Gn(t,e):t._err(e,v.endTagWithoutMatchingOpenElement)}function Gn(t,e){t._insertFakeElement(O.HEAD,c.HEAD),t.headElement=t.openElements.current,t.insertionMode=C.IN_HEAD,t._processToken(e)}function Et(t,e){switch(e.tagID){case c.HTML:{Ve(t,e);break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:{t._appendElement(e,F.HTML),e.ackSelfClosing=!0;break}case c.TITLE:{t._switchToTextParsing(e,we.RCDATA);break}case c.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,we.RAWTEXT):(t._insertElement(e,F.HTML),t.insertionMode=C.IN_HEAD_NO_SCRIPT);break}case c.NOFRAMES:case c.STYLE:{t._switchToTextParsing(e,we.RAWTEXT);break}case c.SCRIPT:{t._switchToTextParsing(e,we.SCRIPT_DATA);break}case c.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=C.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(C.IN_TEMPLATE);break}case c.HEAD:{t._err(e,v.misplacedStartTagForHeadElement);break}default:Wn(t,e)}}function D2(t,e){switch(e.tagID){case c.HEAD:{t.openElements.pop(),t.insertionMode=C.AFTER_HEAD;break}case c.BODY:case c.BR:case c.HTML:{Wn(t,e);break}case c.TEMPLATE:{an(t,e);break}default:t._err(e,v.endTagWithoutMatchingOpenElement)}}function an(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==c.TEMPLATE&&t._err(e,v.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,v.endTagWithoutMatchingOpenElement)}function Wn(t,e){t.openElements.pop(),t.insertionMode=C.AFTER_HEAD,t._processToken(e)}function P2(t,e){switch(e.tagID){case c.HTML:{Ve(t,e);break}case c.BASEFONT:case c.BGSOUND:case c.HEAD:case c.LINK:case c.META:case c.NOFRAMES:case c.STYLE:{Et(t,e);break}case c.NOSCRIPT:{t._err(e,v.nestedNoscriptInHead);break}default:Qn(t,e)}}function M2(t,e){switch(e.tagID){case c.NOSCRIPT:{t.openElements.pop(),t.insertionMode=C.IN_HEAD;break}case c.BR:{Qn(t,e);break}default:t._err(e,v.endTagWithoutMatchingOpenElement)}}function Qn(t,e){const n=e.type===ae.EOF?v.openElementsLeftAfterEof:v.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=C.IN_HEAD,t._processToken(e)}function B2(t,e){switch(e.tagID){case c.HTML:{Ve(t,e);break}case c.BODY:{t._insertElement(e,F.HTML),t.framesetOk=!1,t.insertionMode=C.IN_BODY;break}case c.FRAMESET:{t._insertElement(e,F.HTML),t.insertionMode=C.IN_FRAMESET;break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{t._err(e,v.abandonedHeadElementChild),t.openElements.push(t.headElement,c.HEAD),Et(t,e),t.openElements.remove(t.headElement);break}case c.HEAD:{t._err(e,v.misplacedStartTagForHeadElement);break}default:Xn(t,e)}}function F2(t,e){switch(e.tagID){case c.BODY:case c.HTML:case c.BR:{Xn(t,e);break}case c.TEMPLATE:{an(t,e);break}default:t._err(e,v.endTagWithoutMatchingOpenElement)}}function Xn(t,e){t._insertFakeElement(O.BODY,c.BODY),t.insertionMode=C.IN_BODY,is(t,e)}function is(t,e){switch(e.type){case ae.CHARACTER:{dc(t,e);break}case ae.WHITESPACE_CHARACTER:{cc(t,e);break}case ae.COMMENT:{ri(t,e);break}case ae.START_TAG:{Ve(t,e);break}case ae.END_TAG:{as(t,e);break}case ae.EOF:{mc(t,e);break}}}function cc(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function dc(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function U2(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function H2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function j2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,F.HTML),t.insertionMode=C.IN_FRAMESET)}function z2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,F.HTML)}function $2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&ni.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,F.HTML)}function Y2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,F.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function q2(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,F.HTML),n||(t.formElement=t.openElements.current))}function V2(t,e){t.framesetOk=!1;const n=e.tagID;for(let r=t.openElements.stackTop;r>=0;r--){const s=t.openElements.tagIDs[r];if(n===c.LI&&s===c.LI||(n===c.DD||n===c.DT)&&(s===c.DD||s===c.DT)){t.openElements.generateImpliedEndTagsWithExclusion(s),t.openElements.popUntilTagNamePopped(s);break}if(s!==c.ADDRESS&&s!==c.DIV&&s!==c.P&&t._isSpecialElement(t.openElements.items[r],s))break}t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,F.HTML)}function G2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,F.HTML),t.tokenizer.state=we.PLAINTEXT}function W2(t,e){t.openElements.hasInScope(c.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,F.HTML),t.framesetOk=!1}function Q2(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(O.A);n&&(qi(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,F.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function X2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,F.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Z2(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(c.NOBR)&&(qi(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,F.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function K2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,F.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function J2(t,e){t.treeAdapter.getDocumentMode(t.document)!==pt.QUIRKS&&t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,F.HTML),t.framesetOk=!1,t.insertionMode=C.IN_TABLE}function fc(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,F.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function hc(t){const e=tc(t,Kt.TYPE);return e!=null&&e.toLowerCase()===b2}function eT(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,F.HTML),hc(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function tT(t,e){t._appendElement(e,F.HTML),e.ackSelfClosing=!0}function nT(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._appendElement(e,F.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function rT(t,e){e.tagName=O.IMG,e.tagID=c.IMG,fc(t,e)}function sT(t,e){t._insertElement(e,F.HTML),t.skipNextNewLine=!0,t.tokenizer.state=we.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=C.TEXT}function iT(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,we.RAWTEXT)}function aT(t,e){t.framesetOk=!1,t._switchToTextParsing(e,we.RAWTEXT)}function Lu(t,e){t._switchToTextParsing(e,we.RAWTEXT)}function uT(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,F.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===C.IN_TABLE||t.insertionMode===C.IN_CAPTION||t.insertionMode===C.IN_TABLE_BODY||t.insertionMode===C.IN_ROW||t.insertionMode===C.IN_CELL?C.IN_SELECT_IN_TABLE:C.IN_SELECT}function oT(t,e){t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,F.HTML)}function lT(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,F.HTML)}function cT(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(c.RTC),t._insertElement(e,F.HTML)}function dT(t,e){t._reconstructActiveFormattingElements(),uc(e),Yi(e),e.selfClosing?t._appendElement(e,F.MATHML):t._insertElement(e,F.MATHML),e.ackSelfClosing=!0}function fT(t,e){t._reconstructActiveFormattingElements(),oc(e),Yi(e),e.selfClosing?t._appendElement(e,F.SVG):t._insertElement(e,F.SVG),e.ackSelfClosing=!0}function vu(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,F.HTML)}function Ve(t,e){switch(e.tagID){case c.I:case c.S:case c.B:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.SMALL:case c.STRIKE:case c.STRONG:{X2(t,e);break}case c.A:{Q2(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{$2(t,e);break}case c.P:case c.DL:case c.OL:case c.UL:case c.DIV:case c.DIR:case c.NAV:case c.MAIN:case c.MENU:case c.ASIDE:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.DETAILS:case c.ADDRESS:case c.ARTICLE:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{z2(t,e);break}case c.LI:case c.DD:case c.DT:{V2(t,e);break}case c.BR:case c.IMG:case c.WBR:case c.AREA:case c.EMBED:case c.KEYGEN:{fc(t,e);break}case c.HR:{nT(t,e);break}case c.RB:case c.RTC:{lT(t,e);break}case c.RT:case c.RP:{cT(t,e);break}case c.PRE:case c.LISTING:{Y2(t,e);break}case c.XMP:{iT(t,e);break}case c.SVG:{fT(t,e);break}case c.HTML:{U2(t,e);break}case c.BASE:case c.LINK:case c.META:case c.STYLE:case c.TITLE:case c.SCRIPT:case c.BGSOUND:case c.BASEFONT:case c.TEMPLATE:{Et(t,e);break}case c.BODY:{H2(t,e);break}case c.FORM:{q2(t,e);break}case c.NOBR:{Z2(t,e);break}case c.MATH:{dT(t,e);break}case c.TABLE:{J2(t,e);break}case c.INPUT:{eT(t,e);break}case c.PARAM:case c.TRACK:case c.SOURCE:{tT(t,e);break}case c.IMAGE:{rT(t,e);break}case c.BUTTON:{W2(t,e);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{K2(t,e);break}case c.IFRAME:{aT(t,e);break}case c.SELECT:{uT(t,e);break}case c.OPTION:case c.OPTGROUP:{oT(t,e);break}case c.NOEMBED:case c.NOFRAMES:{Lu(t,e);break}case c.FRAMESET:{j2(t,e);break}case c.TEXTAREA:{sT(t,e);break}case c.NOSCRIPT:{t.options.scriptingEnabled?Lu(t,e):vu(t,e);break}case c.PLAINTEXT:{G2(t,e);break}case c.COL:case c.TH:case c.TD:case c.TR:case c.HEAD:case c.FRAME:case c.TBODY:case c.TFOOT:case c.THEAD:case c.CAPTION:case c.COLGROUP:break;default:vu(t,e)}}function hT(t,e){if(t.openElements.hasInScope(c.BODY)&&(t.insertionMode=C.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function pT(t,e){t.openElements.hasInScope(c.BODY)&&(t.insertionMode=C.AFTER_BODY,Ac(t,e))}function mT(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function gT(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(c.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(c.FORM):n&&t.openElements.remove(n))}function bT(t){t.openElements.hasInButtonScope(c.P)||t._insertFakeElement(O.P,c.P),t._closePElement()}function ET(t){t.openElements.hasInListItemScope(c.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(c.LI),t.openElements.popUntilTagNamePopped(c.LI))}function TT(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function xT(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function _T(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function yT(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(O.BR,c.BR),t.openElements.pop(),t.framesetOk=!1}function pc(t,e){const n=e.tagName,r=e.tagID;for(let s=t.openElements.stackTop;s>0;s--){const i=t.openElements.items[s],a=t.openElements.tagIDs[s];if(r===a&&(r!==c.UNKNOWN||t.treeAdapter.getTagName(i)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=s&&t.openElements.shortenToLength(s);break}if(t._isSpecialElement(i,a))break}}function as(t,e){switch(e.tagID){case c.A:case c.B:case c.I:case c.S:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.NOBR:case c.SMALL:case c.STRIKE:case c.STRONG:{qi(t,e);break}case c.P:{bT(t);break}case c.DL:case c.UL:case c.OL:case c.DIR:case c.DIV:case c.NAV:case c.PRE:case c.MAIN:case c.MENU:case c.ASIDE:case c.BUTTON:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.ADDRESS:case c.ARTICLE:case c.DETAILS:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.LISTING:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{mT(t,e);break}case c.LI:{ET(t);break}case c.DD:case c.DT:{TT(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{xT(t);break}case c.BR:{yT(t);break}case c.BODY:{hT(t,e);break}case c.HTML:{pT(t,e);break}case c.FORM:{gT(t);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{_T(t,e);break}case c.TEMPLATE:{an(t,e);break}default:pc(t,e)}}function mc(t,e){t.tmplInsertionModeStack.length>0?yc(t,e):Vi(t,e)}function AT(t,e){var n;e.tagID===c.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function kT(t,e){t._err(e,v.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function Ss(t,e){if(t.openElements.currentTagId!==void 0&&lc.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=C.IN_TABLE_TEXT,e.type){case ae.CHARACTER:{bc(t,e);break}case ae.WHITESPACE_CHARACTER:{gc(t,e);break}}else br(t,e)}function CT(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,F.HTML),t.insertionMode=C.IN_CAPTION}function IT(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,F.HTML),t.insertionMode=C.IN_COLUMN_GROUP}function NT(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(O.COLGROUP,c.COLGROUP),t.insertionMode=C.IN_COLUMN_GROUP,Gi(t,e)}function ST(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,F.HTML),t.insertionMode=C.IN_TABLE_BODY}function wT(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(O.TBODY,c.TBODY),t.insertionMode=C.IN_TABLE_BODY,us(t,e)}function RT(t,e){t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function OT(t,e){hc(e)?t._appendElement(e,F.HTML):br(t,e),e.ackSelfClosing=!0}function LT(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,F.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function Tn(t,e){switch(e.tagID){case c.TD:case c.TH:case c.TR:{wT(t,e);break}case c.STYLE:case c.SCRIPT:case c.TEMPLATE:{Et(t,e);break}case c.COL:{NT(t,e);break}case c.FORM:{LT(t,e);break}case c.TABLE:{RT(t,e);break}case c.TBODY:case c.TFOOT:case c.THEAD:{ST(t,e);break}case c.INPUT:{OT(t,e);break}case c.CAPTION:{CT(t,e);break}case c.COLGROUP:{IT(t,e);break}default:br(t,e)}}function sr(t,e){switch(e.tagID){case c.TABLE:{t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode());break}case c.TEMPLATE:{an(t,e);break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:br(t,e)}}function br(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,is(t,e),t.fosterParentingEnabled=n}function gc(t,e){t.pendingCharacterTokens.push(e)}function bc(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function Mn(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)br(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const Ec=new Set([c.CAPTION,c.COL,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]);function vT(t,e){const n=e.tagID;Ec.has(n)?t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=C.IN_TABLE,Tn(t,e)):Ve(t,e)}function DT(t,e){const n=e.tagID;switch(n){case c.CAPTION:case c.TABLE:{t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=C.IN_TABLE,n===c.TABLE&&sr(t,e));break}case c.BODY:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:as(t,e)}}function Gi(t,e){switch(e.tagID){case c.HTML:{Ve(t,e);break}case c.COL:{t._appendElement(e,F.HTML),e.ackSelfClosing=!0;break}case c.TEMPLATE:{Et(t,e);break}default:jr(t,e)}}function PT(t,e){switch(e.tagID){case c.COLGROUP:{t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=C.IN_TABLE);break}case c.TEMPLATE:{an(t,e);break}case c.COL:break;default:jr(t,e)}}function jr(t,e){t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=C.IN_TABLE,t._processToken(e))}function us(t,e){switch(e.tagID){case c.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,F.HTML),t.insertionMode=C.IN_ROW;break}case c.TH:case c.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(O.TR,c.TR),t.insertionMode=C.IN_ROW,os(t,e);break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE,Tn(t,e));break}default:Tn(t,e)}}function si(t,e){const n=e.tagID;switch(e.tagID){case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE);break}case c.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE,sr(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:case c.TR:break;default:sr(t,e)}}function os(t,e){switch(e.tagID){case c.TH:case c.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,F.HTML),t.insertionMode=C.IN_CELL,t.activeFormattingElements.insertMarker();break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE_BODY,us(t,e));break}default:Tn(t,e)}}function Tc(t,e){switch(e.tagID){case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE_BODY);break}case c.TABLE:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE_BODY,si(t,e));break}case c.TBODY:case c.TFOOT:case c.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(c.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE_BODY,si(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:break;default:sr(t,e)}}function MT(t,e){const n=e.tagID;Ec.has(n)?(t.openElements.hasInTableScope(c.TD)||t.openElements.hasInTableScope(c.TH))&&(t._closeTableCell(),os(t,e)):Ve(t,e)}function BT(t,e){const n=e.tagID;switch(n){case c.TD:case c.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=C.IN_ROW);break}case c.TABLE:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),Tc(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:break;default:as(t,e)}}function xc(t,e){switch(e.tagID){case c.HTML:{Ve(t,e);break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._insertElement(e,F.HTML);break}case c.OPTGROUP:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._insertElement(e,F.HTML);break}case c.HR:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._appendElement(e,F.HTML),e.ackSelfClosing=!0;break}case c.INPUT:case c.KEYGEN:case c.TEXTAREA:case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),e.tagID!==c.SELECT&&t._processStartTag(e));break}case c.SCRIPT:case c.TEMPLATE:{Et(t,e);break}}}function _c(t,e){switch(e.tagID){case c.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===c.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===c.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop();break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop();break}case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode());break}case c.TEMPLATE:{an(t,e);break}}}function FT(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t._processStartTag(e)):xc(t,e)}function UT(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t.onEndTag(e)):_c(t,e)}function HT(t,e){switch(e.tagID){case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{Et(t,e);break}case c.CAPTION:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.tmplInsertionModeStack[0]=C.IN_TABLE,t.insertionMode=C.IN_TABLE,Tn(t,e);break}case c.COL:{t.tmplInsertionModeStack[0]=C.IN_COLUMN_GROUP,t.insertionMode=C.IN_COLUMN_GROUP,Gi(t,e);break}case c.TR:{t.tmplInsertionModeStack[0]=C.IN_TABLE_BODY,t.insertionMode=C.IN_TABLE_BODY,us(t,e);break}case c.TD:case c.TH:{t.tmplInsertionModeStack[0]=C.IN_ROW,t.insertionMode=C.IN_ROW,os(t,e);break}default:t.tmplInsertionModeStack[0]=C.IN_BODY,t.insertionMode=C.IN_BODY,Ve(t,e)}}function jT(t,e){e.tagID===c.TEMPLATE&&an(t,e)}function yc(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):Vi(t,e)}function zT(t,e){e.tagID===c.HTML?Ve(t,e):zr(t,e)}function Ac(t,e){var n;if(e.tagID===c.HTML){if(t.fragmentContext||(t.insertionMode=C.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===c.HTML){t._setEndLocation(t.openElements.items[0],e);const r=t.openElements.items[1];r&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&t._setEndLocation(r,e)}}else zr(t,e)}function zr(t,e){t.insertionMode=C.IN_BODY,is(t,e)}function $T(t,e){switch(e.tagID){case c.HTML:{Ve(t,e);break}case c.FRAMESET:{t._insertElement(e,F.HTML);break}case c.FRAME:{t._appendElement(e,F.HTML),e.ackSelfClosing=!0;break}case c.NOFRAMES:{Et(t,e);break}}}function YT(t,e){e.tagID===c.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==c.FRAMESET&&(t.insertionMode=C.AFTER_FRAMESET))}function qT(t,e){switch(e.tagID){case c.HTML:{Ve(t,e);break}case c.NOFRAMES:{Et(t,e);break}}}function VT(t,e){e.tagID===c.HTML&&(t.insertionMode=C.AFTER_AFTER_FRAMESET)}function GT(t,e){e.tagID===c.HTML?Ve(t,e):Or(t,e)}function Or(t,e){t.insertionMode=C.IN_BODY,is(t,e)}function WT(t,e){switch(e.tagID){case c.HTML:{Ve(t,e);break}case c.NOFRAMES:{Et(t,e);break}}}function QT(t,e){e.chars=Ce,t._insertCharacters(e)}function XT(t,e){t._insertCharacters(e),t.framesetOk=!1}function kc(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==F.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function ZT(t,e){if(f2(e))kc(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===F.MATHML?uc(e):r===F.SVG&&(h2(e),oc(e)),Yi(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function KT(t,e){if(e.tagID===c.P||e.tagID===c.BR){kc(t),t._endTagOutsideForeignContent(e);return}for(let n=t.openElements.stackTop;n>0;n--){const r=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(r)===F.HTML){t._endTagOutsideForeignContent(e);break}const s=t.treeAdapter.getTagName(r);if(s.toLowerCase()===e.tagName){e.tagName=s,t.openElements.shortenToLength(n);break}}}O.AREA,O.BASE,O.BASEFONT,O.BGSOUND,O.BR,O.COL,O.EMBED,O.FRAME,O.HR,O.IMG,O.INPUT,O.KEYGEN,O.LINK,O.META,O.PARAM,O.SOURCE,O.TRACK,O.WBR;const JT=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,ex=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Du={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Cc(t,e){const n=cx(t),r=Xl("type",{handlers:{root:tx,element:nx,text:rx,comment:Nc,doctype:sx,raw:ax},unknown:ux}),s={parser:n?new Ou(Du):Ou.getFragmentParser(void 0,Du),handle(u){r(u,s)},stitches:!1,options:e||{}};r(t,s),Sn(s,It());const i=n?s.parser.document:s.parser.getFragment(),a=dE(i,{file:s.options.file});return s.stitches&&ss(a,"comment",function(u,l,o){const d=u;if(d.value.stitch&&o&&l!==void 0){const f=o.children;return f[l]=d.value.stitch,l}}),a.type==="root"&&a.children.length===1&&a.children[0].type===t.type?a.children[0]:a}function Ic(t,e){let n=-1;if(t)for(;++n<t.length;)e.handle(t[n])}function tx(t,e){Ic(t.children,e)}function nx(t,e){ox(t,e),Ic(t.children,e),lx(t,e)}function rx(t,e){e.parser.tokenizer.state>4&&(e.parser.tokenizer.state=0);const n={type:ae.CHARACTER,chars:t.value,location:Er(t)};Sn(e,It(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function sx(t,e){const n={type:ae.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Er(t)};Sn(e,It(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function ix(t,e){e.stitches=!0;const n=dx(t);if("children"in t&&"children"in n){const r=Cc({type:"root",children:t.children},e.options);n.children=r.children}Nc({type:"comment",value:{stitch:n}},e)}function Nc(t,e){const n=t.value,r={type:ae.COMMENT,data:n,location:Er(t)};Sn(e,It(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function ax(t,e){if(e.parser.tokenizer.preprocessor.html="",e.parser.tokenizer.preprocessor.pos=-1,e.parser.tokenizer.preprocessor.lastGapPos=-2,e.parser.tokenizer.preprocessor.gapStack=[],e.parser.tokenizer.preprocessor.skipNextNewLine=!1,e.parser.tokenizer.preprocessor.lastChunkWritten=!1,e.parser.tokenizer.preprocessor.endOfChunkHit=!1,e.parser.tokenizer.preprocessor.isEol=!1,Sc(e,It(t)),e.parser.tokenizer.write(e.options.tagfilter?t.value.replace(JT,"<$1$2"):t.value,!1),e.parser.tokenizer._runParsingLoop(),e.parser.tokenizer.state===72||e.parser.tokenizer.state===78){e.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=e.parser.tokenizer._consume();e.parser.tokenizer._callState(n)}}function ux(t,e){const n=t;if(e.options.passThrough&&e.options.passThrough.includes(n.type))ix(n,e);else{let r="";throw ex.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Sn(t,e){Sc(t,e);const n=t.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=t.parser.tokenizer.preprocessor.line,n.location.endCol=t.parser.tokenizer.preprocessor.col+1,n.location.endOffset=t.parser.tokenizer.preprocessor.offset+1,t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)),t.parser.tokenizer.paused=!1,t.parser.tokenizer.inLoop=!1,t.parser.tokenizer.active=!1,t.parser.tokenizer.returnState=we.DATA,t.parser.tokenizer.charRefCode=-1,t.parser.tokenizer.consumedAfterSnapshot=-1,t.parser.tokenizer.currentLocation=null,t.parser.tokenizer.currentCharacterToken=null,t.parser.tokenizer.currentToken=null,t.parser.tokenizer.currentAttr={name:"",value:""}}function Sc(t,e){if(e&&e.offset!==void 0){const n={startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:-1,endCol:-1,endOffset:-1};t.parser.tokenizer.preprocessor.lineStartPos=-e.column+1,t.parser.tokenizer.preprocessor.droppedBufferSize=e.offset,t.parser.tokenizer.preprocessor.line=e.line,t.parser.tokenizer.currentLocation=n}}function ox(t,e){const n=t.tagName.toLowerCase();if(e.parser.tokenizer.state===we.PLAINTEXT)return;Sn(e,It(t));const r=e.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:Zt.html;s===Zt.html&&n==="svg"&&(s=Zt.svg);const i=gE({...t,children:[]},{space:s===Zt.svg?"svg":"html"}),a={type:ae.START_TAG,tagName:n,tagID:Nn(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:Er(t)};e.parser.currentToken=a,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=n}function lx(t,e){const n=t.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&kE.includes(n)||e.parser.tokenizer.state===we.PLAINTEXT)return;Sn(e,Kr(t));const r={type:ae.END_TAG,tagName:n,tagID:Nn(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Er(t)};e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken),n===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===we.RCDATA||e.parser.tokenizer.state===we.RAWTEXT||e.parser.tokenizer.state===we.SCRIPT_DATA)&&(e.parser.tokenizer.state=we.DATA)}function cx(t){const e=t.type==="root"?t.children[0]:t;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function Er(t){const e=It(t)||{line:void 0,column:void 0,offset:void 0},n=Kr(t)||{line:void 0,column:void 0,offset:void 0};return{startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function dx(t){return"children"in t?En({...t,children:[]}):En(t)}function fx(t){return function(e,n){return Cc(e,{...t,file:n})}}function Pu(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(e);for(;s!==-1;)r++,s=n.indexOf(e,s+e.length);return r}function hx(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function px(t,e,n){const s=ns((n||{}).ignore||[]),i=mx(e);let a=-1;for(;++a<i.length;)ql(t,"text",u);function u(o,d){let f=-1,p;for(;++f<d.length;){const h=d[f],g=p?p.children:void 0;if(s(h,g?g.indexOf(h):void 0,p))return;p=h}if(p)return l(o,d)}function l(o,d){const f=d[d.length-1],p=i[a][0],h=i[a][1];let g=0;const T=f.children.indexOf(o);let E=!1,A=[];p.lastIndex=0;let b=p.exec(o.value);for(;b;){const w=b.index,R={index:b.index,input:b.input,stack:[...d,o]};let I=h(...b,R);if(typeof I=="string"&&(I=I.length>0?{type:"text",value:I}:void 0),I===!1?p.lastIndex=w+1:(g!==w&&A.push({type:"text",value:o.value.slice(g,w)}),Array.isArray(I)?A.push(...I):I&&A.push(I),g=w+b[0].length,E=!0),!p.global)break;b=p.exec(o.value)}return E?(g<o.value.length&&A.push({type:"text",value:o.value.slice(g)}),f.children.splice(T,1,...A)):A=[o],T+A.length}}function mx(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const s=n[r];e.push([gx(s[0]),bx(s[1])])}return e}function gx(t){return typeof t=="string"?new RegExp(hx(t),"g"):t}function bx(t){return typeof t=="function"?t:function(){return t}}const ws="phrasing",Rs=["autolink","link","image","label"];function Ex(){return{transforms:[Cx],enter:{literalAutolink:xx,literalAutolinkEmail:Os,literalAutolinkHttp:Os,literalAutolinkWww:Os},exit:{literalAutolink:kx,literalAutolinkEmail:Ax,literalAutolinkHttp:_x,literalAutolinkWww:yx}}}function Tx(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ws,notInConstruct:Rs},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ws,notInConstruct:Rs},{character:":",before:"[ps]",after:"\\/",inConstruct:ws,notInConstruct:Rs}]}}function xx(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Os(t){this.config.enter.autolinkProtocol.call(this,t)}function _x(t){this.config.exit.autolinkProtocol.call(this,t)}function yx(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function Ax(t){this.config.exit.autolinkEmail.call(this,t)}function kx(t){this.exit(t)}function Cx(t){px(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ix],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Nx]],{ignore:["link","linkReference"]})}function Ix(t,e,n,r,s){let i="";if(!wc(s)||(/^w/i.test(e)&&(n=e+n,e="",i="http://"),!Sx(n)))return!1;const a=wx(n+r);if(!a[0])return!1;const u={type:"link",title:null,url:i+e+a[0],children:[{type:"text",value:e+a[0]}]};return a[1]?[u,{type:"text",value:a[1]}]:u}function Nx(t,e,n,r){return!wc(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function Sx(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function wx(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const s=Pu(t,"(");let i=Pu(t,")");for(;r!==-1&&s>i;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[t,n]}function wc(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||nn(n)||Jr(n))&&(!e||n!==47)}Rc.peek=Fx;function Rx(){this.buffer()}function Ox(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function Lx(){this.buffer()}function vx(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function Dx(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=bt(this.sliceSerialize(t)).toLowerCase(),n.label=e}function Px(t){this.exit(t)}function Mx(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=bt(this.sliceSerialize(t)).toLowerCase(),n.label=e}function Bx(t){this.exit(t)}function Fx(){return"["}function Rc(t,e,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),u=n.enter("reference");return i+=s.move(n.safe(n.associationId(t),{after:"]",before:i})),u(),a(),i+=s.move("]"),i}function Ux(){return{enter:{gfmFootnoteCallString:Rx,gfmFootnoteCall:Ox,gfmFootnoteDefinitionLabelString:Lx,gfmFootnoteDefinition:vx},exit:{gfmFootnoteCallString:Dx,gfmFootnoteCall:Px,gfmFootnoteDefinitionLabelString:Mx,gfmFootnoteDefinition:Bx}}}function Hx(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:Rc},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const u=i.createTracker(a);let l=u.move("[^");const o=i.enter("footnoteDefinition"),d=i.enter("label");return l+=u.move(i.safe(i.associationId(r),{before:l,after:"]"})),d(),l+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),l+=u.move((e?`
|
|
91
|
-
`:" ")+i.indentLines(i.containerFlow(r,u.current()),e?Oc:jx))),o(),l}}function jx(t,e,n){return e===0?t:Oc(t,e,n)}function Oc(t,e,n){return(n?"":" ")+t}const zx=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Lc.peek=Gx;function $x(){return{canContainEols:["delete"],enter:{strikethrough:qx},exit:{strikethrough:Vx}}}function Yx(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:zx}],handlers:{delete:Lc}}}function qx(t){this.enter({type:"delete",children:[]},t)}function Vx(t){this.exit(t)}function Lc(t,e,n,r){const s=n.createTracker(r),i=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(t,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function Gx(){return"~"}function Wx(t){return t.length}function Qx(t,e){const n=e||{},r=(n.align||[]).concat(),s=n.stringLength||Wx,i=[],a=[],u=[],l=[];let o=0,d=-1;for(;++d<t.length;){const _=[],T=[];let E=-1;for(t[d].length>o&&(o=t[d].length);++E<t[d].length;){const A=Xx(t[d][E]);if(n.alignDelimiters!==!1){const b=s(A);T[E]=b,(l[E]===void 0||b>l[E])&&(l[E]=b)}_.push(A)}a[d]=_,u[d]=T}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<o;)i[f]=
|
|
92
|
-
`)}function Xx(t){return t==null?"":String(t)}function
|
|
88
|
+
`}),n}function uu(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function ou(t,e){const n=xb(t,e),r=n.one(t,void 0),s=cb(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&i.children.push({type:"text",value:`
|
|
89
|
+
`},s),i}function Cb(t,e){return t&&"run"in t?async function(n,r){const s=ou(n,{file:r,...e});await t.run(s,r)}:function(n,r){return ou(n,{file:r,...t||e})}}function lu(t){if(t)throw t}var Es,cu;function Ib(){if(cu)return Es;cu=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(o){return typeof Array.isArray=="function"?Array.isArray(o):e.call(o)==="[object Array]"},i=function(o){if(!o||e.call(o)!=="[object Object]")return!1;var d=t.call(o,"constructor"),f=o.constructor&&o.constructor.prototype&&t.call(o.constructor.prototype,"isPrototypeOf");if(o.constructor&&!d&&!f)return!1;var p;for(p in o);return typeof p>"u"||t.call(o,p)},a=function(o,d){n&&d.name==="__proto__"?n(o,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):o[d.name]=d.newValue},u=function(o,d){if(d==="__proto__")if(t.call(o,d)){if(r)return r(o,d).value}else return;return o[d]};return Es=function l(){var o,d,f,p,h,g,_=arguments[0],T=1,E=arguments.length,A=!1;for(typeof _=="boolean"&&(A=_,_=arguments[1]||{},T=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});T<E;++T)if(o=arguments[T],o!=null)for(d in o)f=u(_,d),p=u(o,d),_!==p&&(A&&p&&(i(p)||(h=s(p)))?(h?(h=!1,g=f&&s(f)?f:[]):g=f&&i(f)?f:{},a(_,{name:d,newValue:l(A,g,p)})):typeof p<"u"&&a(_,{name:d,newValue:p}));return _},Es}var Nb=Ib();const Ts=ai(Nb);function Ks(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Sb(){const t=[],e={run:n,use:r};return e;function n(...s){let i=-1;const a=s.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);u(null,...s);function u(l,...o){const d=t[++i];let f=-1;if(l){a(l);return}for(;++f<s.length;)(o[f]===null||o[f]===void 0)&&(o[f]=s[f]);s=o,d?wb(d,u)(...o):a(null,...o)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return t.push(s),e}}function wb(t,e){let n;return r;function r(...a){const u=t.length>a.length;let l;u&&a.push(s);try{l=t.apply(this,a)}catch(o){const d=o;if(u&&n)throw d;return s(d)}u||(l&&l.then&&typeof l.then=="function"?l.then(i,s):l instanceof Error?s(l):i(l))}function s(a,...u){n||(n=!0,e(a,...u))}function i(a){s(null,a)}}const At={basename:Rb,dirname:Ob,extname:Lb,join:vb,sep:"/"};function Rb(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');gr(t);let n=0,r=-1,s=t.length,i;if(e===void 0||e.length===0||e.length>t.length){for(;s--;)if(t.codePointAt(s)===47){if(i){n=s+1;break}}else r<0&&(i=!0,r=s+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,u=e.length-1;for(;s--;)if(t.codePointAt(s)===47){if(i){n=s+1;break}}else a<0&&(i=!0,a=s+1),u>-1&&(t.codePointAt(s)===e.codePointAt(u--)?u<0&&(r=s):(u=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function Ob(t){if(gr(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function Lb(t){gr(t);let e=t.length,n=-1,r=0,s=-1,i=0,a;for(;e--;){const u=t.codePointAt(e);if(u===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),u===46?s<0?s=e:i!==1&&(i=1):s>-1&&(i=-1)}return s<0||n<0||i===0||i===1&&s===n-1&&s===r+1?"":t.slice(s,n)}function vb(...t){let e=-1,n;for(;++e<t.length;)gr(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":Db(n)}function Db(t){gr(t);const e=t.codePointAt(0)===47;let n=Pb(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function Pb(t,e){let n="",r=0,s=-1,i=0,a=-1,u,l;for(;++a<=t.length;){if(a<t.length)u=t.codePointAt(a);else{if(u===47)break;u=47}if(u===47){if(!(s===a-1||i===1))if(s!==a-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),s=a,i=0;continue}}else if(n.length>0){n="",r=0,s=a,i=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(s+1,a):n=t.slice(s+1,a),r=a-s-1;s=a,i=0}else u===46&&i>-1?i++:i=-1}return n}function gr(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Mb={cwd:Bb};function Bb(){return"/"}function Js(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Fb(t){if(typeof t=="string")t=new URL(t);else if(!Js(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Ub(t)}function Ub(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(e)}const xs=["history","path","basename","stem","extname","dirname"];class Vl{constructor(e){let n;e?Js(e)?n={path:e}:typeof e=="string"||Hb(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":Mb.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<xs.length;){const i=xs[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let s;for(s in n)xs.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?At.basename(this.path):void 0}set basename(e){ys(e,"basename"),_s(e,"basename"),this.path=At.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?At.dirname(this.path):void 0}set dirname(e){du(this.basename,"dirname"),this.path=At.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?At.extname(this.path):void 0}set extname(e){if(_s(e,"extname"),du(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=At.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){Js(e)&&(e=Fb(e)),ys(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?At.basename(this.path,this.extname):void 0}set stem(e){ys(e,"stem"),_s(e,"stem"),this.path=At.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const s=this.message(e,n,r);throw s.fatal=!0,s}info(e,n,r){const s=this.message(e,n,r);return s.fatal=void 0,s}message(e,n,r){const s=new qe(e,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function _s(t,e){if(t&&t.includes(At.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+At.sep+"`")}function ys(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function du(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function Hb(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const jb=(function(t){const r=this.constructor.prototype,s=r[t],i=function(){return s.apply(i,arguments)};return Object.setPrototypeOf(i,r),i}),zb={}.hasOwnProperty;class Hi extends jb{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Sb()}copy(){const e=new Hi;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(Ts(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(Cs("data",this.frozen),this.namespace[e]=n,this):zb.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Cs("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(e,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=yr(e),r=this.parser||this.Parser;return As("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),As("process",this.parser||this.Parser),ks("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(i,a){const u=yr(e),l=r.parse(u);r.run(l,u,function(d,f,p){if(d||!f||!p)return o(d);const h=f,g=r.stringify(h,p);qb(g)?p.value=g:p.result=g,o(d,p)});function o(d,f){d||!f?a(d):i?i(f):n(void 0,f)}}}processSync(e){let n=!1,r;return this.freeze(),As("processSync",this.parser||this.Parser),ks("processSync",this.compiler||this.Compiler),this.process(e,s),hu("processSync","process",n),r;function s(i,a){n=!0,lu(i),r=a}}run(e,n,r){fu(e),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(a,u){const l=yr(n);s.run(e,l,o);function o(d,f,p){const h=f||e;d?u(d):a?a(h):r(void 0,h,p)}}}runSync(e,n){let r=!1,s;return this.run(e,n,i),hu("runSync","run",r),s;function i(a,u){lu(a),s=u,r=!0}}stringify(e,n){this.freeze();const r=yr(n),s=this.compiler||this.Compiler;return ks("stringify",s),fu(e),s(e,r)}use(e,...n){const r=this.attachers,s=this.namespace;if(Cs("use",this.frozen),e!=null)if(typeof e=="function")l(e,n);else if(typeof e=="object")Array.isArray(e)?u(e):a(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function i(o){if(typeof o=="function")l(o,[]);else if(typeof o=="object")if(Array.isArray(o)){const[d,...f]=o;l(d,f)}else a(o);else throw new TypeError("Expected usable value, not `"+o+"`")}function a(o){if(!("plugins"in o)&&!("settings"in o))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(o.plugins),o.settings&&(s.settings=Ts(!0,s.settings,o.settings))}function u(o){let d=-1;if(o!=null)if(Array.isArray(o))for(;++d<o.length;){const f=o[d];i(f)}else throw new TypeError("Expected a list of plugins, not `"+o+"`")}function l(o,d){let f=-1,p=-1;for(;++f<r.length;)if(r[f][0]===o){p=f;break}if(p===-1)r.push([o,...d]);else if(d.length>0){let[h,...g]=d;const _=r[p][1];Ks(_)&&Ks(h)&&(h=Ts(!0,_,h)),r[p]=[o,h,...g]}}}}const $b=new Hi().freeze();function As(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function ks(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Cs(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function fu(t){if(!Ks(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function hu(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function yr(t){return Yb(t)?t:new Vl(t)}function Yb(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function qb(t){return typeof t=="string"||Vb(t)}function Vb(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Gb="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",pu=[],mu={allowDangerousHtml:!0},Wb=/^(https?|ircs?|mailto|xmpp)$/i,Qb=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Xb(t){const e=Zb(t),n=Kb(t);return Jb(e.runSync(e.parse(n),n),t)}function Zb(t){const e=t.rehypePlugins||pu,n=t.remarkPlugins||pu,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...mu}:mu;return $b().use(Og).use(n).use(Cb,r).use(e)}function Kb(t){const e=t.children||"",n=new Vl;return typeof e=="string"&&(n.value=e),n}function Jb(t,e){const n=e.allowedElements,r=e.allowElement,s=e.components,i=e.disallowedElements,a=e.skipHtml,u=e.unwrapDisallowed,l=e.urlTransform||eE;for(const d of Qb)Object.hasOwn(e,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Gb+d.id,void 0);return e.className&&(t={type:"element",tagName:"div",properties:{className:e.className},children:t.type==="root"?t.children:[t]}),rs(t,o),pm(t,{Fragment:m.Fragment,components:s,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function o(d,f,p){if(d.type==="raw"&&p&&typeof f=="number")return a?p.children.splice(f,1):p.children[f]={type:"text",value:d.value},f;if(d.type==="element"){let h;for(h in ms)if(Object.hasOwn(ms,h)&&Object.hasOwn(d.properties,h)){const g=d.properties[h],_=ms[h];(_===null||_.includes(d.tagName))&&(d.properties[h]=l(String(g||""),h,d))}}if(d.type==="element"){let h=n?!n.includes(d.tagName):i?i.includes(d.tagName):!1;if(!h&&r&&typeof f=="number"&&(h=!r(d,f,p)),h&&p&&typeof f=="number")return u&&d.children?p.children.splice(f,1,...d.children):p.children.splice(f,1),f}}}function eE(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),s=t.indexOf("/");return e===-1||s!==-1&&e>s||n!==-1&&e>n||r!==-1&&e>r||Wb.test(t.slice(0,e))?t:""}const gu=/[#.]/g;function tE(t,e){const n=t||"",r={};let s=0,i,a;for(;s<n.length;){gu.lastIndex=s;const u=gu.exec(n),l=n.slice(s,u?u.index:n.length);l&&(i?i==="#"?r.id=l:Array.isArray(r.className)?r.className.push(l):r.className=[l]:a=l,s+=l.length),u&&(i=u[0],s++)}return{type:"element",tagName:a||e||"div",properties:r,children:[]}}function Gl(t,e,n){const r=n?iE(n):void 0;function s(i,a,...u){let l;if(i==null){l={type:"root",children:[]};const o=a;u.unshift(o)}else{l=tE(i,e);const o=l.tagName.toLowerCase(),d=r?r.get(o):void 0;if(l.tagName=d||o,nE(a))u.unshift(a);else for(const[f,p]of Object.entries(a))rE(t,l.properties,f,p)}for(const o of u)ei(l.children,o);return l.type==="element"&&l.tagName==="template"&&(l.content={type:"root",children:l.children},l.children=[]),l}return s}function nE(t){if(t===null||typeof t!="object"||Array.isArray(t))return!0;if(typeof t.type!="string")return!1;const e=t,n=Object.keys(t);for(const r of n){const s=e[r];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const i=s;for(const a of i)if(typeof a!="number"&&typeof a!="string")return!0}}return!!("children"in t&&Array.isArray(t.children))}function rE(t,e,n,r){const s=Xr(t,n);let i;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;i=r}else typeof r=="boolean"?i=r:typeof r=="string"?s.spaceSeparated?i=Ba(r):s.commaSeparated?i=La(r):s.commaOrSpaceSeparated?i=Ba(La(r).join(" ")):i=bu(s,s.property,r):Array.isArray(r)?i=[...r]:i=s.property==="style"?sE(r):String(r);if(Array.isArray(i)){const a=[];for(const u of i)a.push(bu(s,s.property,u));i=a}s.property==="className"&&Array.isArray(e.className)&&(i=e.className.concat(i)),e[s.property]=i}}function ei(t,e){if(e!=null)if(typeof e=="number"||typeof e=="string")t.push({type:"text",value:String(e)});else if(Array.isArray(e))for(const n of e)ei(t,n);else if(typeof e=="object"&&"type"in e)e.type==="root"?ei(t,e.children):t.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function bu(t,e,n){if(typeof n=="string"){if(t.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((t.boolean||t.overloadedBoolean)&&(n===""||nr(n)===nr(e)))return!0}return n}function sE(t){const e=[];for(const[n,r]of Object.entries(t))e.push([n,r].join(": "));return e.join("; ")}function iE(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}const aE=["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"],uE=Gl(pr,"div"),oE=Gl($t,"g",aE);function lE(t){const e=String(t),n=[];return{toOffset:s,toPoint:r};function r(i){if(typeof i=="number"&&i>-1&&i<=e.length){let a=0;for(;;){let u=n[a];if(u===void 0){const l=Eu(e,n[a-1]);u=l===-1?e.length+1:l+1,n[a]=u}if(u>i)return{line:a+1,column:i-(a>0?n[a-1]:0)+1,offset:i};a++}}}function s(i){if(i&&typeof i.line=="number"&&typeof i.column=="number"&&!Number.isNaN(i.line)&&!Number.isNaN(i.column)){for(;n.length<i.line;){const u=n[n.length-1],l=Eu(e,u),o=l===-1?e.length+1:l+1;if(u===o)break;n.push(o)}const a=(i.line>1?n[i.line-2]:0)+i.column-1;if(a<n[i.line-1])return a}}}function Eu(t,e){const n=t.indexOf("\r",e),r=t.indexOf(`
|
|
90
|
+
`,e);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const 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/"},Wl={}.hasOwnProperty,cE=Object.prototype;function dE(t,e){const n=e||{};return ji({file:n.file||void 0,location:!1,schema:n.space==="svg"?$t:pr,verbose:n.verbose||!1},t)}function ji(t,e){let n;switch(e.nodeName){case"#comment":{const r=e;return n={type:"comment",value:r.data},Rr(t,r,n),n}case"#document":case"#document-fragment":{const r=e,s="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:Ql(t,e.childNodes),data:{quirksMode:s}},t.file&&t.location){const i=String(t.file),a=lE(i),u=a.toPoint(0),l=a.toPoint(i.length);n.position={start:u,end:l}}return n}case"#documentType":{const r=e;return n={type:"doctype"},Rr(t,r,n),n}case"#text":{const r=e;return n={type:"text",value:r.value},Rr(t,r,n),n}default:return n=fE(t,e),n}}function Ql(t,e){let n=-1;const r=[];for(;++n<e.length;){const s=ji(t,e[n]);r.push(s)}return r}function fE(t,e){const n=t.schema;t.schema=e.namespaceURI===Zt.svg?$t:pr;let r=-1;const s={};for(;++r<e.attrs.length;){const u=e.attrs[r],l=(u.prefix?u.prefix+":":"")+u.name;Wl.call(cE,l)||(s[l]=u.value)}const a=(t.schema.space==="svg"?oE:uE)(e.tagName,s,Ql(t,e.childNodes));if(Rr(t,e,a),a.tagName==="template"){const u=e,l=u.sourceCodeLocation,o=l&&l.startTag&&pn(l.startTag),d=l&&l.endTag&&pn(l.endTag),f=ji(t,u.content);o&&d&&t.file&&(f.position={start:o.end,end:d.start}),a.content=f}return t.schema=n,a}function Rr(t,e,n){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&t.file){const r=hE(t,n,e.sourceCodeLocation);r&&(t.location=!0,n.position=r)}}function hE(t,e,n){const r=pn(n);if(e.type==="element"){const s=e.children[e.children.length-1];if(r&&!n.endTag&&s&&s.position&&s.position.end&&(r.end=Object.assign({},s.position.end)),t.verbose){const i={};let a;if(n.attrs)for(a in n.attrs)Wl.call(n.attrs,a)&&(i[Xr(t.schema,a).property]=pn(n.attrs[a]));n.startTag;const u=pn(n.startTag),l=n.endTag?pn(n.endTag):void 0,o={opening:u};l&&(o.closing=l),o.properties=i,e.data={position:o}}}return r}function pn(t){const e=Tu({line:t.startLine,column:t.startCol,offset:t.startOffset}),n=Tu({line:t.endLine,column:t.endCol,offset:t.endOffset});return e||n?{start:e,end:n}:void 0}function Tu(t){return t.line&&t.column?t:void 0}const xu={}.hasOwnProperty;function Xl(t,e){const n=e||{};function r(s,...i){let a=r.invalid;const u=r.handlers;if(s&&xu.call(s,t)){const l=String(s[t]);a=xu.call(u,l)?u[l]:r.unknown}if(a)return a.call(this,s,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const pE={},mE={}.hasOwnProperty,Zl=Xl("type",{handlers:{root:bE,element:yE,text:xE,comment:_E,doctype:TE}});function gE(t,e){const r=(e||pE).space;return Zl(t,r==="svg"?$t:pr)}function bE(t,e){const n={nodeName:"#document",mode:(t.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=zi(t.children,n,e),In(t,n),n}function EE(t,e){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=zi(t.children,n,e),In(t,n),n}function TE(t){const e={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return In(t,e),e}function xE(t){const e={nodeName:"#text",value:t.value,parentNode:null};return In(t,e),e}function _E(t){const e={nodeName:"#comment",data:t.value,parentNode:null};return In(t,e),e}function yE(t,e){const n=e;let r=n;t.type==="element"&&t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=$t);const s=[];let i;if(t.properties){for(i in t.properties)if(i!=="children"&&mE.call(t.properties,i)){const l=AE(r,i,t.properties[i]);l&&s.push(l)}}const a=r.space,u={nodeName:t.tagName,tagName:t.tagName,attrs:s,namespaceURI:Zt[a],childNodes:[],parentNode:null};return u.childNodes=zi(t.children,u,r),In(t,u),t.tagName==="template"&&t.content&&(u.content=EE(t.content,r)),u}function AE(t,e,n){const r=Xr(t,e);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?dl(n):Tl(n));const s={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const i=s.name.indexOf(":");i<0?s.prefix="":(s.name=s.name.slice(i+1),s.prefix=r.attribute.slice(0,i)),s.namespace=Zt[r.space]}return s}function zi(t,e,n){let r=-1;const s=[];if(t)for(;++r<t.length;){const i=Zl(t[r],n);i.parentNode=e,s.push(i)}return s}function In(t,e){const n=t.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,e.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const kE=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],CE=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]),Ce="�";var x;(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(x||(x={}));const et={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Kl(t){return t>=55296&&t<=57343}function IE(t){return t>=56320&&t<=57343}function NE(t,e){return(t-55296)*1024+9216+e}function Jl(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function ec(t){return t>=64976&&t<=65007||CE.has(t)}var v;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(v||(v={}));const SE=65536;class wE{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=SE,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:r,col:s,offset:i}=this,a=s+n,u=i+n;return{code:e,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:u,endOffset:u}}_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){const n=this.html.charCodeAt(this.pos+1);if(IE(n))return this.pos++,this._addGap(),NE(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,x.EOF;return this._err(v.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,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let r=0;r<e.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==e.charCodeAt(r))return!1;return!0}peek(e){const n=this.pos+e;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,x.EOF;const r=this.html.charCodeAt(n);return r===x.CARRIAGE_RETURN?x.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,x.EOF;let e=this.html.charCodeAt(this.pos);return e===x.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,x.LINE_FEED):e===x.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Kl(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===x.LINE_FEED||e===x.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){Jl(e)?this._err(v.controlCharacterInInputStream):ec(e)&&this._err(v.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var ae;(function(t){t[t.CHARACTER=0]="CHARACTER",t[t.NULL_CHARACTER=1]="NULL_CHARACTER",t[t.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",t[t.START_TAG=3]="START_TAG",t[t.END_TAG=4]="END_TAG",t[t.COMMENT=5]="COMMENT",t[t.DOCTYPE=6]="DOCTYPE",t[t.EOF=7]="EOF",t[t.HIBERNATION=8]="HIBERNATION"})(ae||(ae={}));function tc(t,e){for(let n=t.attrs.length-1;n>=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}const RE=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),OE=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function LE(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=OE.get(t))!==null&&e!==void 0?e:t}var Be;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(Be||(Be={}));const vE=32;var Ht;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Ht||(Ht={}));function ti(t){return t>=Be.ZERO&&t<=Be.NINE}function DE(t){return t>=Be.UPPER_A&&t<=Be.UPPER_F||t>=Be.LOWER_A&&t<=Be.LOWER_F}function PE(t){return t>=Be.UPPER_A&&t<=Be.UPPER_Z||t>=Be.LOWER_A&&t<=Be.LOWER_Z||ti(t)}function ME(t){return t===Be.EQUALS||PE(t)}var Pe;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(Pe||(Pe={}));var wt;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(wt||(wt={}));class BE{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=Pe.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=wt.Strict}startEntity(e){this.decodeMode=e,this.state=Pe.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case Pe.EntityStart:return e.charCodeAt(n)===Be.NUM?(this.state=Pe.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=Pe.NamedEntity,this.stateNamedEntity(e,n));case Pe.NumericStart:return this.stateNumericStart(e,n);case Pe.NumericDecimal:return this.stateNumericDecimal(e,n);case Pe.NumericHex:return this.stateNumericHex(e,n);case Pe.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|vE)===Be.LOWER_X?(this.state=Pe.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=Pe.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,s){if(n!==r){const i=r-n;this.result=this.result*Math.pow(s,i)+Number.parseInt(e.substr(n,i),s),this.consumed+=i}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const s=e.charCodeAt(n);if(ti(s)||DE(s))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const s=e.charCodeAt(n);if(ti(s))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Be.SEMI)this.consumed+=1;else if(this.decodeMode===wt.Strict)return 0;return this.emitCodePoint(LE(this.result),this.consumed),this.errors&&(e!==Be.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let s=r[this.treeIndex],i=(s&Ht.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const a=e.charCodeAt(n);if(this.treeIndex=FE(r,s,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===wt.Attribute&&(i===0||ME(a))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],i=(s&Ht.VALUE_LENGTH)>>14,i!==0){if(a===Be.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==wt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,s=(r[n]&Ht.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[e]&~Ht.VALUE_LENGTH:s[e+1],r),n===3&&this.emitCodePoint(s[e+2],r),r}end(){var e;switch(this.state){case Pe.NamedEntity:return this.result!==0&&(this.decodeMode!==wt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Pe.NumericDecimal:return this.emitNumericEntity(0,2);case Pe.NumericHex:return this.emitNumericEntity(0,3);case Pe.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Pe.EntityStart:return 0}}}function FE(t,e,n,r){const s=(e&Ht.BRANCH_LENGTH)>>7,i=e&Ht.JUMP_TABLE;if(s===0)return i!==0&&r===i?n:-1;if(i){const l=r-i;return l<0||l>=s?-1:t[n+l]-1}let a=n,u=a+s-1;for(;a<=u;){const l=a+u>>>1,o=t[l];if(o<r)a=l+1;else if(o>r)u=l-1;else return t[l+s]}return-1}var F;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})(F||(F={}));var Kt;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(Kt||(Kt={}));var pt;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(pt||(pt={}));var O;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(O||(O={}));var c;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(c||(c={}));const UE=new Map([[O.A,c.A],[O.ADDRESS,c.ADDRESS],[O.ANNOTATION_XML,c.ANNOTATION_XML],[O.APPLET,c.APPLET],[O.AREA,c.AREA],[O.ARTICLE,c.ARTICLE],[O.ASIDE,c.ASIDE],[O.B,c.B],[O.BASE,c.BASE],[O.BASEFONT,c.BASEFONT],[O.BGSOUND,c.BGSOUND],[O.BIG,c.BIG],[O.BLOCKQUOTE,c.BLOCKQUOTE],[O.BODY,c.BODY],[O.BR,c.BR],[O.BUTTON,c.BUTTON],[O.CAPTION,c.CAPTION],[O.CENTER,c.CENTER],[O.CODE,c.CODE],[O.COL,c.COL],[O.COLGROUP,c.COLGROUP],[O.DD,c.DD],[O.DESC,c.DESC],[O.DETAILS,c.DETAILS],[O.DIALOG,c.DIALOG],[O.DIR,c.DIR],[O.DIV,c.DIV],[O.DL,c.DL],[O.DT,c.DT],[O.EM,c.EM],[O.EMBED,c.EMBED],[O.FIELDSET,c.FIELDSET],[O.FIGCAPTION,c.FIGCAPTION],[O.FIGURE,c.FIGURE],[O.FONT,c.FONT],[O.FOOTER,c.FOOTER],[O.FOREIGN_OBJECT,c.FOREIGN_OBJECT],[O.FORM,c.FORM],[O.FRAME,c.FRAME],[O.FRAMESET,c.FRAMESET],[O.H1,c.H1],[O.H2,c.H2],[O.H3,c.H3],[O.H4,c.H4],[O.H5,c.H5],[O.H6,c.H6],[O.HEAD,c.HEAD],[O.HEADER,c.HEADER],[O.HGROUP,c.HGROUP],[O.HR,c.HR],[O.HTML,c.HTML],[O.I,c.I],[O.IMG,c.IMG],[O.IMAGE,c.IMAGE],[O.INPUT,c.INPUT],[O.IFRAME,c.IFRAME],[O.KEYGEN,c.KEYGEN],[O.LABEL,c.LABEL],[O.LI,c.LI],[O.LINK,c.LINK],[O.LISTING,c.LISTING],[O.MAIN,c.MAIN],[O.MALIGNMARK,c.MALIGNMARK],[O.MARQUEE,c.MARQUEE],[O.MATH,c.MATH],[O.MENU,c.MENU],[O.META,c.META],[O.MGLYPH,c.MGLYPH],[O.MI,c.MI],[O.MO,c.MO],[O.MN,c.MN],[O.MS,c.MS],[O.MTEXT,c.MTEXT],[O.NAV,c.NAV],[O.NOBR,c.NOBR],[O.NOFRAMES,c.NOFRAMES],[O.NOEMBED,c.NOEMBED],[O.NOSCRIPT,c.NOSCRIPT],[O.OBJECT,c.OBJECT],[O.OL,c.OL],[O.OPTGROUP,c.OPTGROUP],[O.OPTION,c.OPTION],[O.P,c.P],[O.PARAM,c.PARAM],[O.PLAINTEXT,c.PLAINTEXT],[O.PRE,c.PRE],[O.RB,c.RB],[O.RP,c.RP],[O.RT,c.RT],[O.RTC,c.RTC],[O.RUBY,c.RUBY],[O.S,c.S],[O.SCRIPT,c.SCRIPT],[O.SEARCH,c.SEARCH],[O.SECTION,c.SECTION],[O.SELECT,c.SELECT],[O.SOURCE,c.SOURCE],[O.SMALL,c.SMALL],[O.SPAN,c.SPAN],[O.STRIKE,c.STRIKE],[O.STRONG,c.STRONG],[O.STYLE,c.STYLE],[O.SUB,c.SUB],[O.SUMMARY,c.SUMMARY],[O.SUP,c.SUP],[O.TABLE,c.TABLE],[O.TBODY,c.TBODY],[O.TEMPLATE,c.TEMPLATE],[O.TEXTAREA,c.TEXTAREA],[O.TFOOT,c.TFOOT],[O.TD,c.TD],[O.TH,c.TH],[O.THEAD,c.THEAD],[O.TITLE,c.TITLE],[O.TR,c.TR],[O.TRACK,c.TRACK],[O.TT,c.TT],[O.U,c.U],[O.UL,c.UL],[O.SVG,c.SVG],[O.VAR,c.VAR],[O.WBR,c.WBR],[O.XMP,c.XMP]]);function Nn(t){var e;return(e=UE.get(t))!==null&&e!==void 0?e:c.UNKNOWN}const H=c,HE={[F.HTML]:new Set([H.ADDRESS,H.APPLET,H.AREA,H.ARTICLE,H.ASIDE,H.BASE,H.BASEFONT,H.BGSOUND,H.BLOCKQUOTE,H.BODY,H.BR,H.BUTTON,H.CAPTION,H.CENTER,H.COL,H.COLGROUP,H.DD,H.DETAILS,H.DIR,H.DIV,H.DL,H.DT,H.EMBED,H.FIELDSET,H.FIGCAPTION,H.FIGURE,H.FOOTER,H.FORM,H.FRAME,H.FRAMESET,H.H1,H.H2,H.H3,H.H4,H.H5,H.H6,H.HEAD,H.HEADER,H.HGROUP,H.HR,H.HTML,H.IFRAME,H.IMG,H.INPUT,H.LI,H.LINK,H.LISTING,H.MAIN,H.MARQUEE,H.MENU,H.META,H.NAV,H.NOEMBED,H.NOFRAMES,H.NOSCRIPT,H.OBJECT,H.OL,H.P,H.PARAM,H.PLAINTEXT,H.PRE,H.SCRIPT,H.SECTION,H.SELECT,H.SOURCE,H.STYLE,H.SUMMARY,H.TABLE,H.TBODY,H.TD,H.TEMPLATE,H.TEXTAREA,H.TFOOT,H.TH,H.THEAD,H.TITLE,H.TR,H.TRACK,H.UL,H.WBR,H.XMP]),[F.MATHML]:new Set([H.MI,H.MO,H.MN,H.MS,H.MTEXT,H.ANNOTATION_XML]),[F.SVG]:new Set([H.TITLE,H.FOREIGN_OBJECT,H.DESC]),[F.XLINK]:new Set,[F.XML]:new Set,[F.XMLNS]:new Set},ni=new Set([H.H1,H.H2,H.H3,H.H4,H.H5,H.H6]);O.STYLE,O.SCRIPT,O.XMP,O.IFRAME,O.NOEMBED,O.NOFRAMES,O.PLAINTEXT;var y;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(y||(y={}));const we={DATA:y.DATA,RCDATA:y.RCDATA,RAWTEXT:y.RAWTEXT,SCRIPT_DATA:y.SCRIPT_DATA,PLAINTEXT:y.PLAINTEXT,CDATA_SECTION:y.CDATA_SECTION};function jE(t){return t>=x.DIGIT_0&&t<=x.DIGIT_9}function Hn(t){return t>=x.LATIN_CAPITAL_A&&t<=x.LATIN_CAPITAL_Z}function zE(t){return t>=x.LATIN_SMALL_A&&t<=x.LATIN_SMALL_Z}function Bt(t){return zE(t)||Hn(t)}function _u(t){return Bt(t)||jE(t)}function Ar(t){return t+32}function nc(t){return t===x.SPACE||t===x.LINE_FEED||t===x.TABULATION||t===x.FORM_FEED}function yu(t){return nc(t)||t===x.SOLIDUS||t===x.GREATER_THAN_SIGN}function $E(t){return t===x.NULL?v.nullCharacterReference:t>1114111?v.characterReferenceOutsideUnicodeRange:Kl(t)?v.surrogateCharacterReference:ec(t)?v.noncharacterCharacterReference:Jl(t)||t===x.CARRIAGE_RETURN?v.controlCharacterReference:null}class YE{constructor(e,n){this.options=e,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=y.DATA,this.returnState=y.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new wE(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new BE(RE,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(v.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(v.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=$E(r);s&&this._err(s,1)}}:void 0)}_err(e,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(e,n))}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;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,n,r){this.active=!0,this.preprocessor.write(e,n),this._runParsingLoop(),this.paused||r?.()}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 n=0;n<e;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,n){return this.preprocessor.startsWith(e,n)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:ae.START_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:ae.END_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:ae.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:ae.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,n){this.currentCharacterToken={type:e,chars:n,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,n;const r=this.currentToken;if(tc(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(e=(n=r.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(v.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(){const e=this.currentToken;this.prepareToken(e),e.tagID=Nn(e.tagName),e.type===ae.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(v.endTagWithAttributes),e.selfClosing&&this._err(v.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 ae.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case ae.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case ae.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:ae.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,n)}_emitCodePoint(e){const n=nc(e)?ae.WHITESPACE_CHARACTER:e===x.NULL?ae.NULL_CHARACTER:ae.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(ae.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=y.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?wt.Attribute:wt.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===y.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===y.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===y.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case y.DATA:{this._stateData(e);break}case y.RCDATA:{this._stateRcdata(e);break}case y.RAWTEXT:{this._stateRawtext(e);break}case y.SCRIPT_DATA:{this._stateScriptData(e);break}case y.PLAINTEXT:{this._statePlaintext(e);break}case y.TAG_OPEN:{this._stateTagOpen(e);break}case y.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case y.TAG_NAME:{this._stateTagName(e);break}case y.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case y.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case y.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case y.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case y.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case y.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case y.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case y.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case y.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case y.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case y.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case y.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case y.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case y.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case y.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case y.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case y.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case y.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case y.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case y.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case y.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case y.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case y.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case y.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case y.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case y.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case y.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case y.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case y.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case y.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case y.BOGUS_COMMENT:{this._stateBogusComment(e);break}case y.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case y.COMMENT_START:{this._stateCommentStart(e);break}case y.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case y.COMMENT:{this._stateComment(e);break}case y.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case y.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case y.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case y.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case y.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case y.COMMENT_END:{this._stateCommentEnd(e);break}case y.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case y.DOCTYPE:{this._stateDoctype(e);break}case y.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case y.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case y.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case y.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case y.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case y.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case y.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case y.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case y.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case y.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case y.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case y.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case y.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case y.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case y.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case y.CDATA_SECTION:{this._stateCdataSection(e);break}case y.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case y.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case y.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case y.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case x.LESS_THAN_SIGN:{this.state=y.TAG_OPEN;break}case x.AMPERSAND:{this._startCharacterReference();break}case x.NULL:{this._err(v.unexpectedNullCharacter),this._emitCodePoint(e);break}case x.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case x.AMPERSAND:{this._startCharacterReference();break}case x.LESS_THAN_SIGN:{this.state=y.RCDATA_LESS_THAN_SIGN;break}case x.NULL:{this._err(v.unexpectedNullCharacter),this._emitChars(Ce);break}case x.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case x.LESS_THAN_SIGN:{this.state=y.RAWTEXT_LESS_THAN_SIGN;break}case x.NULL:{this._err(v.unexpectedNullCharacter),this._emitChars(Ce);break}case x.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case x.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_LESS_THAN_SIGN;break}case x.NULL:{this._err(v.unexpectedNullCharacter),this._emitChars(Ce);break}case x.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case x.NULL:{this._err(v.unexpectedNullCharacter),this._emitChars(Ce);break}case x.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Bt(e))this._createStartTagToken(),this.state=y.TAG_NAME,this._stateTagName(e);else switch(e){case x.EXCLAMATION_MARK:{this.state=y.MARKUP_DECLARATION_OPEN;break}case x.SOLIDUS:{this.state=y.END_TAG_OPEN;break}case x.QUESTION_MARK:{this._err(v.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=y.BOGUS_COMMENT,this._stateBogusComment(e);break}case x.EOF:{this._err(v.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(v.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=y.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Bt(e))this._createEndTagToken(),this.state=y.TAG_NAME,this._stateTagName(e);else switch(e){case x.GREATER_THAN_SIGN:{this._err(v.missingEndTagName),this.state=y.DATA;break}case x.EOF:{this._err(v.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(v.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=y.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:{this.state=y.BEFORE_ATTRIBUTE_NAME;break}case x.SOLIDUS:{this.state=y.SELF_CLOSING_START_TAG;break}case x.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentTagToken();break}case x.NULL:{this._err(v.unexpectedNullCharacter),n.tagName+=Ce;break}case x.EOF:{this._err(v.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Hn(e)?Ar(e):e)}}_stateRcdataLessThanSign(e){e===x.SOLIDUS?this.state=y.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=y.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Bt(e)?(this.state=y.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=y.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=y.BEFORE_ATTRIBUTE_NAME,!1;case x.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=y.SELF_CLOSING_START_TAG,!1;case x.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=y.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=y.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===x.SOLIDUS?this.state=y.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=y.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Bt(e)?(this.state=y.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=y.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=y.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case x.SOLIDUS:{this.state=y.SCRIPT_DATA_END_TAG_OPEN;break}case x.EXCLAMATION_MARK:{this.state=y.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=y.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Bt(e)?(this.state=y.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=y.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=y.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===x.HYPHEN_MINUS?(this.state=y.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=y.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===x.HYPHEN_MINUS?(this.state=y.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=y.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case x.HYPHEN_MINUS:{this.state=y.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case x.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case x.NULL:{this._err(v.unexpectedNullCharacter),this._emitChars(Ce);break}case x.EOF:{this._err(v.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case x.HYPHEN_MINUS:{this.state=y.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case x.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case x.NULL:{this._err(v.unexpectedNullCharacter),this.state=y.SCRIPT_DATA_ESCAPED,this._emitChars(Ce);break}case x.EOF:{this._err(v.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=y.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case x.HYPHEN_MINUS:{this._emitChars("-");break}case x.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case x.GREATER_THAN_SIGN:{this.state=y.SCRIPT_DATA,this._emitChars(">");break}case x.NULL:{this._err(v.unexpectedNullCharacter),this.state=y.SCRIPT_DATA_ESCAPED,this._emitChars(Ce);break}case x.EOF:{this._err(v.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=y.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===x.SOLIDUS?this.state=y.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Bt(e)?(this._emitChars("<"),this.state=y.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=y.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Bt(e)?(this.state=y.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=y.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=y.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(et.SCRIPT,!1)&&yu(this.preprocessor.peek(et.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<et.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=y.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case x.HYPHEN_MINUS:{this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case x.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case x.NULL:{this._err(v.unexpectedNullCharacter),this._emitChars(Ce);break}case x.EOF:{this._err(v.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case x.HYPHEN_MINUS:{this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case x.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case x.NULL:{this._err(v.unexpectedNullCharacter),this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ce);break}case x.EOF:{this._err(v.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case x.HYPHEN_MINUS:{this._emitChars("-");break}case x.LESS_THAN_SIGN:{this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case x.GREATER_THAN_SIGN:{this.state=y.SCRIPT_DATA,this._emitChars(">");break}case x.NULL:{this._err(v.unexpectedNullCharacter),this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ce);break}case x.EOF:{this._err(v.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===x.SOLIDUS?(this.state=y.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(et.SCRIPT,!1)&&yu(this.preprocessor.peek(et.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<et.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=y.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=y.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.SOLIDUS:case x.GREATER_THAN_SIGN:case x.EOF:{this.state=y.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case x.EQUALS_SIGN:{this._err(v.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=y.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=y.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:case x.SOLIDUS:case x.GREATER_THAN_SIGN:case x.EOF:{this._leaveAttrName(),this.state=y.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case x.EQUALS_SIGN:{this._leaveAttrName(),this.state=y.BEFORE_ATTRIBUTE_VALUE;break}case x.QUOTATION_MARK:case x.APOSTROPHE:case x.LESS_THAN_SIGN:{this._err(v.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case x.NULL:{this._err(v.unexpectedNullCharacter),this.currentAttr.name+=Ce;break}default:this.currentAttr.name+=String.fromCodePoint(Hn(e)?Ar(e):e)}}_stateAfterAttributeName(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.SOLIDUS:{this.state=y.SELF_CLOSING_START_TAG;break}case x.EQUALS_SIGN:{this.state=y.BEFORE_ATTRIBUTE_VALUE;break}case x.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentTagToken();break}case x.EOF:{this._err(v.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=y.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.QUOTATION_MARK:{this.state=y.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case x.APOSTROPHE:{this.state=y.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case x.GREATER_THAN_SIGN:{this._err(v.missingAttributeValue),this.state=y.DATA,this.emitCurrentTagToken();break}default:this.state=y.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case x.QUOTATION_MARK:{this.state=y.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case x.AMPERSAND:{this._startCharacterReference();break}case x.NULL:{this._err(v.unexpectedNullCharacter),this.currentAttr.value+=Ce;break}case x.EOF:{this._err(v.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case x.APOSTROPHE:{this.state=y.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case x.AMPERSAND:{this._startCharacterReference();break}case x.NULL:{this._err(v.unexpectedNullCharacter),this.currentAttr.value+=Ce;break}case x.EOF:{this._err(v.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:{this._leaveAttrValue(),this.state=y.BEFORE_ATTRIBUTE_NAME;break}case x.AMPERSAND:{this._startCharacterReference();break}case x.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=y.DATA,this.emitCurrentTagToken();break}case x.NULL:{this._err(v.unexpectedNullCharacter),this.currentAttr.value+=Ce;break}case x.QUOTATION_MARK:case x.APOSTROPHE:case x.LESS_THAN_SIGN:case x.EQUALS_SIGN:case x.GRAVE_ACCENT:{this._err(v.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case x.EOF:{this._err(v.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:{this._leaveAttrValue(),this.state=y.BEFORE_ATTRIBUTE_NAME;break}case x.SOLIDUS:{this._leaveAttrValue(),this.state=y.SELF_CLOSING_START_TAG;break}case x.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=y.DATA,this.emitCurrentTagToken();break}case x.EOF:{this._err(v.eofInTag),this._emitEOFToken();break}default:this._err(v.missingWhitespaceBetweenAttributes),this.state=y.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case x.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=y.DATA,this.emitCurrentTagToken();break}case x.EOF:{this._err(v.eofInTag),this._emitEOFToken();break}default:this._err(v.unexpectedSolidusInTag),this.state=y.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case x.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentComment(n);break}case x.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case x.NULL:{this._err(v.unexpectedNullCharacter),n.data+=Ce;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(et.DASH_DASH,!0)?(this._createCommentToken(et.DASH_DASH.length+1),this.state=y.COMMENT_START):this._consumeSequenceIfMatch(et.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(et.DOCTYPE.length+1),this.state=y.DOCTYPE):this._consumeSequenceIfMatch(et.CDATA_START,!0)?this.inForeignNode?this.state=y.CDATA_SECTION:(this._err(v.cdataInHtmlContent),this._createCommentToken(et.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=y.BOGUS_COMMENT):this._ensureHibernation()||(this._err(v.incorrectlyOpenedComment),this._createCommentToken(2),this.state=y.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case x.HYPHEN_MINUS:{this.state=y.COMMENT_START_DASH;break}case x.GREATER_THAN_SIGN:{this._err(v.abruptClosingOfEmptyComment),this.state=y.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=y.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case x.HYPHEN_MINUS:{this.state=y.COMMENT_END;break}case x.GREATER_THAN_SIGN:{this._err(v.abruptClosingOfEmptyComment),this.state=y.DATA,this.emitCurrentComment(n);break}case x.EOF:{this._err(v.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=y.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case x.HYPHEN_MINUS:{this.state=y.COMMENT_END_DASH;break}case x.LESS_THAN_SIGN:{n.data+="<",this.state=y.COMMENT_LESS_THAN_SIGN;break}case x.NULL:{this._err(v.unexpectedNullCharacter),n.data+=Ce;break}case x.EOF:{this._err(v.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case x.EXCLAMATION_MARK:{n.data+="!",this.state=y.COMMENT_LESS_THAN_SIGN_BANG;break}case x.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=y.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===x.HYPHEN_MINUS?this.state=y.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=y.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===x.HYPHEN_MINUS?this.state=y.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=y.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==x.GREATER_THAN_SIGN&&e!==x.EOF&&this._err(v.nestedComment),this.state=y.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case x.HYPHEN_MINUS:{this.state=y.COMMENT_END;break}case x.EOF:{this._err(v.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=y.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case x.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentComment(n);break}case x.EXCLAMATION_MARK:{this.state=y.COMMENT_END_BANG;break}case x.HYPHEN_MINUS:{n.data+="-";break}case x.EOF:{this._err(v.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=y.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case x.HYPHEN_MINUS:{n.data+="--!",this.state=y.COMMENT_END_DASH;break}case x.GREATER_THAN_SIGN:{this._err(v.incorrectlyClosedComment),this.state=y.DATA,this.emitCurrentComment(n);break}case x.EOF:{this._err(v.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=y.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:{this.state=y.BEFORE_DOCTYPE_NAME;break}case x.GREATER_THAN_SIGN:{this.state=y.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case x.EOF:{this._err(v.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(v.missingWhitespaceBeforeDoctypeName),this.state=y.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(Hn(e))this._createDoctypeToken(String.fromCharCode(Ar(e))),this.state=y.DOCTYPE_NAME;else switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.NULL:{this._err(v.unexpectedNullCharacter),this._createDoctypeToken(Ce),this.state=y.DOCTYPE_NAME;break}case x.GREATER_THAN_SIGN:{this._err(v.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=y.DATA;break}case x.EOF:{this._err(v.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=y.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:{this.state=y.AFTER_DOCTYPE_NAME;break}case x.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentDoctype(n);break}case x.NULL:{this._err(v.unexpectedNullCharacter),n.name+=Ce;break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Hn(e)?Ar(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentDoctype(n);break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(et.PUBLIC,!1)?this.state=y.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(et.SYSTEM,!1)?this.state=y.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(v.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=y.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:{this.state=y.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case x.QUOTATION_MARK:{this._err(v.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=y.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case x.APOSTROPHE:{this._err(v.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=y.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case x.GREATER_THAN_SIGN:{this._err(v.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=y.DATA,this.emitCurrentDoctype(n);break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(v.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=y.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.QUOTATION_MARK:{n.publicId="",this.state=y.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case x.APOSTROPHE:{n.publicId="",this.state=y.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case x.GREATER_THAN_SIGN:{this._err(v.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=y.DATA,this.emitCurrentDoctype(n);break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(v.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=y.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case x.QUOTATION_MARK:{this.state=y.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case x.NULL:{this._err(v.unexpectedNullCharacter),n.publicId+=Ce;break}case x.GREATER_THAN_SIGN:{this._err(v.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=y.DATA;break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case x.APOSTROPHE:{this.state=y.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case x.NULL:{this._err(v.unexpectedNullCharacter),n.publicId+=Ce;break}case x.GREATER_THAN_SIGN:{this._err(v.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=y.DATA;break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:{this.state=y.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case x.GREATER_THAN_SIGN:{this.state=y.DATA,this.emitCurrentDoctype(n);break}case x.QUOTATION_MARK:{this._err(v.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case x.APOSTROPHE:{this._err(v.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(v.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=y.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=y.DATA;break}case x.QUOTATION_MARK:{n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case x.APOSTROPHE:{n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(v.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=y.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:{this.state=y.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case x.QUOTATION_MARK:{this._err(v.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case x.APOSTROPHE:{this._err(v.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case x.GREATER_THAN_SIGN:{this._err(v.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=y.DATA,this.emitCurrentDoctype(n);break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(v.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=y.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.QUOTATION_MARK:{n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case x.APOSTROPHE:{n.systemId="",this.state=y.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case x.GREATER_THAN_SIGN:{this._err(v.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=y.DATA,this.emitCurrentDoctype(n);break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(v.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=y.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case x.QUOTATION_MARK:{this.state=y.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case x.NULL:{this._err(v.unexpectedNullCharacter),n.systemId+=Ce;break}case x.GREATER_THAN_SIGN:{this._err(v.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=y.DATA;break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case x.APOSTROPHE:{this.state=y.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case x.NULL:{this._err(v.unexpectedNullCharacter),n.systemId+=Ce;break}case x.GREATER_THAN_SIGN:{this._err(v.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=y.DATA;break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case x.SPACE:case x.LINE_FEED:case x.TABULATION:case x.FORM_FEED:break;case x.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=y.DATA;break}case x.EOF:{this._err(v.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(v.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=y.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case x.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=y.DATA;break}case x.NULL:{this._err(v.unexpectedNullCharacter);break}case x.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case x.RIGHT_SQUARE_BRACKET:{this.state=y.CDATA_SECTION_BRACKET;break}case x.EOF:{this._err(v.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===x.RIGHT_SQUARE_BRACKET?this.state=y.CDATA_SECTION_END:(this._emitChars("]"),this.state=y.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case x.GREATER_THAN_SIGN:{this.state=y.DATA;break}case x.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=y.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(x.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&_u(this.preprocessor.peek(1))?y.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){_u(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===x.SEMICOLON&&this._err(v.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const rc=new Set([c.DD,c.DT,c.LI,c.OPTGROUP,c.OPTION,c.P,c.RB,c.RP,c.RT,c.RTC]),Au=new Set([...rc,c.CAPTION,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]),Ur=new Set([c.APPLET,c.CAPTION,c.HTML,c.MARQUEE,c.OBJECT,c.TABLE,c.TD,c.TEMPLATE,c.TH]),qE=new Set([...Ur,c.OL,c.UL]),VE=new Set([...Ur,c.BUTTON]),ku=new Set([c.ANNOTATION_XML,c.MI,c.MN,c.MO,c.MS,c.MTEXT]),Cu=new Set([c.DESC,c.FOREIGN_OBJECT,c.TITLE]),GE=new Set([c.TR,c.TEMPLATE,c.HTML]),WE=new Set([c.TBODY,c.TFOOT,c.THEAD,c.TEMPLATE,c.HTML]),QE=new Set([c.TABLE,c.TEMPLATE,c.HTML]),XE=new Set([c.TD,c.TH]);class ZE{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=c.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===c.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===F.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,n){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,n,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,n){const r=this._indexOf(e);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(e,n,r){const s=this._indexOf(e)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==F.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(e){for(;this.stackTop>=e;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<e)}}popUntilElementPopped(e){const n=this._indexOf(e);this.shortenToLength(Math.max(n,0))}popUntilPopped(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(ni,F.HTML)}popUntilTableCellPopped(){this.popUntilPopped(XE,F.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,n){for(let r=this.stackTop;r>=0;r--)if(e.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(QE,F.HTML)}clearBackToTableBodyContext(){this.clearBackTo(WE,F.HTML)}clearBackToTableRowContext(){this.clearBackTo(GE,F.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===c.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===c.HTML}hasInDynamicScope(e,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case F.HTML:{if(s===e)return!0;if(n.has(s))return!1;break}case F.SVG:{if(Cu.has(s))return!1;break}case F.MATHML:{if(ku.has(s))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Ur)}hasInListItemScope(e){return this.hasInDynamicScope(e,qE)}hasInButtonScope(e){return this.hasInDynamicScope(e,VE)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case F.HTML:{if(ni.has(n))return!0;if(Ur.has(n))return!1;break}case F.SVG:{if(Cu.has(n))return!1;break}case F.MATHML:{if(ku.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===F.HTML)switch(this.tagIDs[n]){case e:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===F.HTML)switch(this.tagIDs[e]){case c.TBODY:case c.THEAD:case c.TFOOT:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===F.HTML)switch(this.tagIDs[n]){case e:return!0;case c.OPTION:case c.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&rc.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Au.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&Au.has(this.currentTagId);)this.pop()}}const Is=3;var kt;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(kt||(kt={}));const Iu={type:kt.Marker};class KE{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],s=n.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let u=0;u<this.entries.length;u++){const l=this.entries[u];if(l.type===kt.Marker)break;const{element:o}=l;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){const d=this.treeAdapter.getAttrList(o);d.length===s&&r.push({idx:u,attrs:d})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<Is)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<Is)return;const s=new Map(n.map(a=>[a.name,a.value]));let i=0;for(let a=0;a<r.length;a++){const u=r[a];u.attrs.every(l=>s.get(l.name)===l.value)&&(i+=1,i>=Is&&this.entries.splice(u.idx,1))}}insertMarker(){this.entries.unshift(Iu)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:kt.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:kt.Element,element:e,token:n})}removeEntry(e){const n=this.entries.indexOf(e);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const e=this.entries.indexOf(Iu);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===kt.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===kt.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===kt.Element&&n.element===e)}}const Ft={createDocument(){return{nodeName:"#document",mode:pt.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,n){return{nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const r=t.childNodes.indexOf(n);t.childNodes.splice(r,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,n,r){const s=t.childNodes.find(i=>i.nodeName==="#documentType");if(s)s.name=e,s.publicId=n,s.systemId=r;else{const i={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};Ft.appendChild(t,i)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(Ft.isTextNode(n)){n.value+=e;return}}Ft.appendChild(t,Ft.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&Ft.isTextNode(r)?r.value+=e:Ft.insertBefore(t,Ft.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(r=>r.name));for(let r=0;r<e.length;r++)n.has(e[r].name)||t.attrs.push(e[r])},getFirstChild(t){return t.childNodes[0]},getChildNodes(t){return t.childNodes},getParentNode(t){return t.parentNode},getAttrList(t){return t.attrs},getTagName(t){return t.tagName},getNamespaceURI(t){return t.namespaceURI},getTextNodeContent(t){return t.value},getCommentNodeContent(t){return t.data},getDocumentTypeNodeName(t){return t.name},getDocumentTypeNodePublicId(t){return t.publicId},getDocumentTypeNodeSystemId(t){return t.systemId},isTextNode(t){return t.nodeName==="#text"},isCommentNode(t){return t.nodeName==="#comment"},isDocumentTypeNode(t){return t.nodeName==="#documentType"},isElementNode(t){return Object.prototype.hasOwnProperty.call(t,"tagName")},setNodeSourceCodeLocation(t,e){t.sourceCodeLocation=e},getNodeSourceCodeLocation(t){return t.sourceCodeLocation},updateNodeSourceCodeLocation(t,e){t.sourceCodeLocation={...t.sourceCodeLocation,...e}}},sc="html",JE="about:legacy-compat",e2="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",ic=["+//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//"],t2=[...ic,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],n2=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),ac=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],r2=[...ac,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Nu(t,e){return e.some(n=>t.startsWith(n))}function s2(t){return t.name===sc&&t.publicId===null&&(t.systemId===null||t.systemId===JE)}function i2(t){if(t.name!==sc)return pt.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===e2)return pt.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),n2.has(n))return pt.QUIRKS;let r=e===null?t2:ic;if(Nu(n,r))return pt.QUIRKS;if(r=e===null?ac:r2,Nu(n,r))return pt.LIMITED_QUIRKS}return pt.NO_QUIRKS}const Su={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},a2="definitionurl",u2="definitionURL",o2=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(t=>[t.toLowerCase(),t])),l2=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:F.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:F.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:F.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:F.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:F.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:F.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:F.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:F.XML}],["xml:space",{prefix:"xml",name:"space",namespace:F.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:F.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:F.XMLNS}]]),c2=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),d2=new Set([c.B,c.BIG,c.BLOCKQUOTE,c.BODY,c.BR,c.CENTER,c.CODE,c.DD,c.DIV,c.DL,c.DT,c.EM,c.EMBED,c.H1,c.H2,c.H3,c.H4,c.H5,c.H6,c.HEAD,c.HR,c.I,c.IMG,c.LI,c.LISTING,c.MENU,c.META,c.NOBR,c.OL,c.P,c.PRE,c.RUBY,c.S,c.SMALL,c.SPAN,c.STRONG,c.STRIKE,c.SUB,c.SUP,c.TABLE,c.TT,c.U,c.UL,c.VAR]);function f2(t){const e=t.tagID;return e===c.FONT&&t.attrs.some(({name:r})=>r===Kt.COLOR||r===Kt.SIZE||r===Kt.FACE)||d2.has(e)}function uc(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===a2){t.attrs[e].name=u2;break}}function oc(t){for(let e=0;e<t.attrs.length;e++){const n=o2.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function $i(t){for(let e=0;e<t.attrs.length;e++){const n=l2.get(t.attrs[e].name);n&&(t.attrs[e].prefix=n.prefix,t.attrs[e].name=n.name,t.attrs[e].namespace=n.namespace)}}function h2(t){const e=c2.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=Nn(t.tagName))}function p2(t,e){return e===F.MATHML&&(t===c.MI||t===c.MO||t===c.MN||t===c.MS||t===c.MTEXT)}function m2(t,e,n){if(e===F.MATHML&&t===c.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Kt.ENCODING){const s=n[r].value.toLowerCase();return s===Su.TEXT_HTML||s===Su.APPLICATION_XML}}return e===F.SVG&&(t===c.FOREIGN_OBJECT||t===c.DESC||t===c.TITLE)}function g2(t,e,n,r){return(!r||r===F.HTML)&&m2(t,e,n)||(!r||r===F.MATHML)&&p2(t,e)}const b2="hidden",E2=8,T2=3;var C;(function(t){t[t.INITIAL=0]="INITIAL",t[t.BEFORE_HTML=1]="BEFORE_HTML",t[t.BEFORE_HEAD=2]="BEFORE_HEAD",t[t.IN_HEAD=3]="IN_HEAD",t[t.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",t[t.AFTER_HEAD=5]="AFTER_HEAD",t[t.IN_BODY=6]="IN_BODY",t[t.TEXT=7]="TEXT",t[t.IN_TABLE=8]="IN_TABLE",t[t.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",t[t.IN_CAPTION=10]="IN_CAPTION",t[t.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",t[t.IN_TABLE_BODY=12]="IN_TABLE_BODY",t[t.IN_ROW=13]="IN_ROW",t[t.IN_CELL=14]="IN_CELL",t[t.IN_SELECT=15]="IN_SELECT",t[t.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",t[t.IN_TEMPLATE=17]="IN_TEMPLATE",t[t.AFTER_BODY=18]="AFTER_BODY",t[t.IN_FRAMESET=19]="IN_FRAMESET",t[t.AFTER_FRAMESET=20]="AFTER_FRAMESET",t[t.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",t[t.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(C||(C={}));const x2={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},lc=new Set([c.TABLE,c.TBODY,c.TFOOT,c.THEAD,c.TR]),wu={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Ft,onParseError:null};class Ru{constructor(e,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=C.INITIAL,this.originalInsertionMode=C.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={...wu,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new YE(this.options,this),this.activeFormattingElements=new KE(this.treeAdapter),this.fragmentContextID=r?Nn(this.treeAdapter.getTagName(r)):c.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new ZE(this.document,this.treeAdapter,this)}static parse(e,n){const r=new this(n);return r.tokenizer.write(e,!0),r.document}static getFragmentParser(e,n){const r={...wu,...n};e??(e=r.treeAdapter.createElement(O.TEMPLATE,F.HTML,[]));const s=r.treeAdapter.createElement("documentmock",F.HTML,[]),i=new this(r,s,e);return i.fragmentContextID===c.TEMPLATE&&i.tmplInsertionModeStack.unshift(C.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,r){var s;if(!this.onParseError)return;const i=(s=e.location)!==null&&s!==void 0?s:x2,a={code:n,startLine:i.startLine,startCol:i.startCol,startOffset:i.startOffset,endLine:r?i.startLine:i.endLine,endCol:r?i.startCol:i.endCol,endOffset:r?i.startOffset:i.endOffset};this.onParseError(a)}onItemPush(e,n,r){var s,i;(i=(s=this.treeAdapter).onItemPush)===null||i===void 0||i.call(s,e),r&&this.openElements.stackTop>0&&this._setContextModes(e,n)}onItemPop(e,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,e,this.openElements.current),n){let i,a;this.openElements.stackTop===0&&this.fragmentContext?(i=this.fragmentContext,a=this.fragmentContextID):{current:i,currentTagId:a}=this.openElements,this._setContextModes(i,a)}}_setContextModes(e,n){const r=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===F.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,F.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=C.TEXT}switchToPlaintextParsing(){this.insertionMode=C.TEXT,this.originalInsertionMode=C.IN_BODY,this.tokenizer.state=we.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)===O.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==F.HTML))switch(this.fragmentContextID){case c.TITLE:case c.TEXTAREA:{this.tokenizer.state=we.RCDATA;break}case c.STYLE:case c.XMP:case c.IFRAME:case c.NOEMBED:case c.NOFRAMES:case c.NOSCRIPT:{this.tokenizer.state=we.RAWTEXT;break}case c.SCRIPT:{this.tokenizer.state=we.SCRIPT_DATA;break}case c.PLAINTEXT:{this.tokenizer.state=we.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",r=e.publicId||"",s=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),e.location){const a=this.treeAdapter.getChildNodes(this.document).find(u=>this.treeAdapter.isDocumentTypeNode(u));a&&this.treeAdapter.setNodeSourceCodeLocation(a,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,e)}}_appendElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location)}_insertElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID)}_insertFakeElement(e,n){const r=this.treeAdapter.createElement(e,F.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,F.HTML,e.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(O.HTML,F.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,c.HTML)}_appendCommentNode(e,n){const r=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,e.location)}_insertCharacters(e){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,e.chars,r):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const s=this.treeAdapter.getChildNodes(n),i=r?s.lastIndexOf(r):s.length,a=s[i-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:l,endCol:o,endOffset:d}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:l,endCol:o,endOffset:d})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(a,e.location)}_adoptNodes(e,n){for(let r=this.treeAdapter.getFirstChild(e);r;r=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(e),i=n.type===ae.END_TAG&&s===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,e.tagID===c.SVG&&this.treeAdapter.getTagName(n)===O.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===F.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===c.MGLYPH||e.tagID===c.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,F.HTML)}_processToken(e){switch(e.type){case ae.CHARACTER:{this.onCharacter(e);break}case ae.NULL_CHARACTER:{this.onNullCharacter(e);break}case ae.COMMENT:{this.onComment(e);break}case ae.DOCTYPE:{this.onDoctype(e);break}case ae.START_TAG:{this._processStartTag(e);break}case ae.END_TAG:{this.onEndTag(e);break}case ae.EOF:{this.onEof(e);break}case ae.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const s=this.treeAdapter.getNamespaceURI(n),i=this.treeAdapter.getAttrList(n);return g2(e,s,i,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===kt.Marker||this.openElements.contains(s.element)),r=n===-1?e-1:n-1;for(let s=r;s>=0;s--){const i=this.activeFormattingElements.entries[s];this._insertElement(i.token,this.treeAdapter.getNamespaceURI(i.element)),i.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=C.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(c.P),this.openElements.popUntilTagNamePopped(c.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case c.TR:{this.insertionMode=C.IN_ROW;return}case c.TBODY:case c.THEAD:case c.TFOOT:{this.insertionMode=C.IN_TABLE_BODY;return}case c.CAPTION:{this.insertionMode=C.IN_CAPTION;return}case c.COLGROUP:{this.insertionMode=C.IN_COLUMN_GROUP;return}case c.TABLE:{this.insertionMode=C.IN_TABLE;return}case c.BODY:{this.insertionMode=C.IN_BODY;return}case c.FRAMESET:{this.insertionMode=C.IN_FRAMESET;return}case c.SELECT:{this._resetInsertionModeForSelect(e);return}case c.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case c.HTML:{this.insertionMode=this.headElement?C.AFTER_HEAD:C.BEFORE_HEAD;return}case c.TD:case c.TH:{if(e>0){this.insertionMode=C.IN_CELL;return}break}case c.HEAD:{if(e>0){this.insertionMode=C.IN_HEAD;return}break}}this.insertionMode=C.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===c.TEMPLATE)break;if(r===c.TABLE){this.insertionMode=C.IN_SELECT_IN_TABLE;return}}this.insertionMode=C.IN_SELECT}_isElementCausesFosterParenting(e){return lc.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--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case c.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===F.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case c.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const r=this.treeAdapter.getNamespaceURI(e);return HE[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){XT(this,e);return}switch(this.insertionMode){case C.INITIAL:{Pn(this,e);break}case C.BEFORE_HTML:{Vn(this,e);break}case C.BEFORE_HEAD:{Gn(this,e);break}case C.IN_HEAD:{Wn(this,e);break}case C.IN_HEAD_NO_SCRIPT:{Qn(this,e);break}case C.AFTER_HEAD:{Xn(this,e);break}case C.IN_BODY:case C.IN_CAPTION:case C.IN_CELL:case C.IN_TEMPLATE:{dc(this,e);break}case C.TEXT:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case C.IN_TABLE:case C.IN_TABLE_BODY:case C.IN_ROW:{Ns(this,e);break}case C.IN_TABLE_TEXT:{bc(this,e);break}case C.IN_COLUMN_GROUP:{Hr(this,e);break}case C.AFTER_BODY:{jr(this,e);break}case C.AFTER_AFTER_BODY:{Or(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){QT(this,e);return}switch(this.insertionMode){case C.INITIAL:{Pn(this,e);break}case C.BEFORE_HTML:{Vn(this,e);break}case C.BEFORE_HEAD:{Gn(this,e);break}case C.IN_HEAD:{Wn(this,e);break}case C.IN_HEAD_NO_SCRIPT:{Qn(this,e);break}case C.AFTER_HEAD:{Xn(this,e);break}case C.TEXT:{this._insertCharacters(e);break}case C.IN_TABLE:case C.IN_TABLE_BODY:case C.IN_ROW:{Ns(this,e);break}case C.IN_COLUMN_GROUP:{Hr(this,e);break}case C.AFTER_BODY:{jr(this,e);break}case C.AFTER_AFTER_BODY:{Or(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){ri(this,e);return}switch(this.insertionMode){case C.INITIAL:case C.BEFORE_HTML:case C.BEFORE_HEAD:case C.IN_HEAD:case C.IN_HEAD_NO_SCRIPT:case C.AFTER_HEAD:case C.IN_BODY:case C.IN_TABLE:case C.IN_CAPTION:case C.IN_COLUMN_GROUP:case C.IN_TABLE_BODY:case C.IN_ROW:case C.IN_CELL:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:case C.IN_TEMPLATE:case C.IN_FRAMESET:case C.AFTER_FRAMESET:{ri(this,e);break}case C.IN_TABLE_TEXT:{Mn(this,e);break}case C.AFTER_BODY:{N2(this,e);break}case C.AFTER_AFTER_BODY:case C.AFTER_AFTER_FRAMESET:{S2(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case C.INITIAL:{w2(this,e);break}case C.BEFORE_HEAD:case C.IN_HEAD:case C.IN_HEAD_NO_SCRIPT:case C.AFTER_HEAD:{this._err(e,v.misplacedDoctype);break}case C.IN_TABLE_TEXT:{Mn(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,v.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?ZT(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case C.INITIAL:{Pn(this,e);break}case C.BEFORE_HTML:{R2(this,e);break}case C.BEFORE_HEAD:{L2(this,e);break}case C.IN_HEAD:{Et(this,e);break}case C.IN_HEAD_NO_SCRIPT:{P2(this,e);break}case C.AFTER_HEAD:{B2(this,e);break}case C.IN_BODY:{Ve(this,e);break}case C.IN_TABLE:{Tn(this,e);break}case C.IN_TABLE_TEXT:{Mn(this,e);break}case C.IN_CAPTION:{vT(this,e);break}case C.IN_COLUMN_GROUP:{Vi(this,e);break}case C.IN_TABLE_BODY:{as(this,e);break}case C.IN_ROW:{us(this,e);break}case C.IN_CELL:{MT(this,e);break}case C.IN_SELECT:{xc(this,e);break}case C.IN_SELECT_IN_TABLE:{FT(this,e);break}case C.IN_TEMPLATE:{HT(this,e);break}case C.AFTER_BODY:{zT(this,e);break}case C.IN_FRAMESET:{$T(this,e);break}case C.AFTER_FRAMESET:{qT(this,e);break}case C.AFTER_AFTER_BODY:{GT(this,e);break}case C.AFTER_AFTER_FRAMESET:{WT(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?KT(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case C.INITIAL:{Pn(this,e);break}case C.BEFORE_HTML:{O2(this,e);break}case C.BEFORE_HEAD:{v2(this,e);break}case C.IN_HEAD:{D2(this,e);break}case C.IN_HEAD_NO_SCRIPT:{M2(this,e);break}case C.AFTER_HEAD:{F2(this,e);break}case C.IN_BODY:{is(this,e);break}case C.TEXT:{AT(this,e);break}case C.IN_TABLE:{sr(this,e);break}case C.IN_TABLE_TEXT:{Mn(this,e);break}case C.IN_CAPTION:{DT(this,e);break}case C.IN_COLUMN_GROUP:{PT(this,e);break}case C.IN_TABLE_BODY:{si(this,e);break}case C.IN_ROW:{Tc(this,e);break}case C.IN_CELL:{BT(this,e);break}case C.IN_SELECT:{_c(this,e);break}case C.IN_SELECT_IN_TABLE:{UT(this,e);break}case C.IN_TEMPLATE:{jT(this,e);break}case C.AFTER_BODY:{Ac(this,e);break}case C.IN_FRAMESET:{YT(this,e);break}case C.AFTER_FRAMESET:{VT(this,e);break}case C.AFTER_AFTER_BODY:{Or(this,e);break}}}onEof(e){switch(this.insertionMode){case C.INITIAL:{Pn(this,e);break}case C.BEFORE_HTML:{Vn(this,e);break}case C.BEFORE_HEAD:{Gn(this,e);break}case C.IN_HEAD:{Wn(this,e);break}case C.IN_HEAD_NO_SCRIPT:{Qn(this,e);break}case C.AFTER_HEAD:{Xn(this,e);break}case C.IN_BODY:case C.IN_TABLE:case C.IN_CAPTION:case C.IN_COLUMN_GROUP:case C.IN_TABLE_BODY:case C.IN_ROW:case C.IN_CELL:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:{mc(this,e);break}case C.TEXT:{kT(this,e);break}case C.IN_TABLE_TEXT:{Mn(this,e);break}case C.IN_TEMPLATE:{yc(this,e);break}case C.AFTER_BODY:case C.IN_FRAMESET:case C.AFTER_FRAMESET:case C.AFTER_AFTER_BODY:case C.AFTER_AFTER_FRAMESET:{qi(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===x.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 C.IN_HEAD:case C.IN_HEAD_NO_SCRIPT:case C.AFTER_HEAD:case C.TEXT:case C.IN_COLUMN_GROUP:case C.IN_SELECT:case C.IN_SELECT_IN_TABLE:case C.IN_FRAMESET:case C.AFTER_FRAMESET:{this._insertCharacters(e);break}case C.IN_BODY:case C.IN_CAPTION:case C.IN_CELL:case C.IN_TEMPLATE:case C.AFTER_BODY:case C.AFTER_AFTER_BODY:case C.AFTER_AFTER_FRAMESET:{cc(this,e);break}case C.IN_TABLE:case C.IN_TABLE_BODY:case C.IN_ROW:{Ns(this,e);break}case C.IN_TABLE_TEXT:{gc(this,e);break}}}}function _2(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):pc(t,e),n}function y2(t,e){let n=null,r=t.openElements.stackTop;for(;r>=0;r--){const s=t.openElements.items[r];if(s===e.element)break;t._isSpecialElement(s,t.openElements.tagIDs[r])&&(n=s)}return n||(t.openElements.shortenToLength(Math.max(r,0)),t.activeFormattingElements.removeEntry(e)),n}function A2(t,e,n){let r=e,s=t.openElements.getCommonAncestor(e);for(let i=0,a=s;a!==n;i++,a=s){s=t.openElements.getCommonAncestor(a);const u=t.activeFormattingElements.getElementEntry(a),l=u&&i>=T2;!u||l?(l&&t.activeFormattingElements.removeEntry(u),t.openElements.remove(a)):(a=k2(t,u),r===e&&(t.activeFormattingElements.bookmark=u),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(a,r),r=a)}return r}function k2(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),r=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,r),e.element=r,r}function C2(t,e,n){const r=t.treeAdapter.getTagName(e),s=Nn(r);if(t._isElementCausesFosterParenting(s))t._fosterParentElement(n);else{const i=t.treeAdapter.getNamespaceURI(e);s===c.TEMPLATE&&i===F.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function I2(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:s}=n,i=t.treeAdapter.createElement(s.tagName,r,s.attrs);t._adoptNodes(e,i),t.treeAdapter.appendChild(e,i),t.activeFormattingElements.insertElementAfterBookmark(i,s),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,i,s.tagID)}function Yi(t,e){for(let n=0;n<E2;n++){const r=_2(t,e);if(!r)break;const s=y2(t,r);if(!s)break;t.activeFormattingElements.bookmark=r;const i=A2(t,s,r.element),a=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(i),a&&C2(t,a,i),I2(t,s,r)}}function ri(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function N2(t,e){t._appendCommentNode(e,t.openElements.items[0])}function S2(t,e){t._appendCommentNode(e,t.document)}function qi(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let r=t.openElements.stackTop;r>=n;r--)t._setEndLocation(t.openElements.items[r],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const r=t.openElements.items[0],s=t.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(t._setEndLocation(r,e),t.openElements.stackTop>=1)){const i=t.openElements.items[1],a=t.treeAdapter.getNodeSourceCodeLocation(i);a&&!a.endTag&&t._setEndLocation(i,e)}}}}function w2(t,e){t._setDocumentType(e);const n=e.forceQuirks?pt.QUIRKS:i2(e);s2(e)||t._err(e,v.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=C.BEFORE_HTML}function Pn(t,e){t._err(e,v.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,pt.QUIRKS),t.insertionMode=C.BEFORE_HTML,t._processToken(e)}function R2(t,e){e.tagID===c.HTML?(t._insertElement(e,F.HTML),t.insertionMode=C.BEFORE_HEAD):Vn(t,e)}function O2(t,e){const n=e.tagID;(n===c.HTML||n===c.HEAD||n===c.BODY||n===c.BR)&&Vn(t,e)}function Vn(t,e){t._insertFakeRootElement(),t.insertionMode=C.BEFORE_HEAD,t._processToken(e)}function L2(t,e){switch(e.tagID){case c.HTML:{Ve(t,e);break}case c.HEAD:{t._insertElement(e,F.HTML),t.headElement=t.openElements.current,t.insertionMode=C.IN_HEAD;break}default:Gn(t,e)}}function v2(t,e){const n=e.tagID;n===c.HEAD||n===c.BODY||n===c.HTML||n===c.BR?Gn(t,e):t._err(e,v.endTagWithoutMatchingOpenElement)}function Gn(t,e){t._insertFakeElement(O.HEAD,c.HEAD),t.headElement=t.openElements.current,t.insertionMode=C.IN_HEAD,t._processToken(e)}function Et(t,e){switch(e.tagID){case c.HTML:{Ve(t,e);break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:{t._appendElement(e,F.HTML),e.ackSelfClosing=!0;break}case c.TITLE:{t._switchToTextParsing(e,we.RCDATA);break}case c.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,we.RAWTEXT):(t._insertElement(e,F.HTML),t.insertionMode=C.IN_HEAD_NO_SCRIPT);break}case c.NOFRAMES:case c.STYLE:{t._switchToTextParsing(e,we.RAWTEXT);break}case c.SCRIPT:{t._switchToTextParsing(e,we.SCRIPT_DATA);break}case c.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=C.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(C.IN_TEMPLATE);break}case c.HEAD:{t._err(e,v.misplacedStartTagForHeadElement);break}default:Wn(t,e)}}function D2(t,e){switch(e.tagID){case c.HEAD:{t.openElements.pop(),t.insertionMode=C.AFTER_HEAD;break}case c.BODY:case c.BR:case c.HTML:{Wn(t,e);break}case c.TEMPLATE:{an(t,e);break}default:t._err(e,v.endTagWithoutMatchingOpenElement)}}function an(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==c.TEMPLATE&&t._err(e,v.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,v.endTagWithoutMatchingOpenElement)}function Wn(t,e){t.openElements.pop(),t.insertionMode=C.AFTER_HEAD,t._processToken(e)}function P2(t,e){switch(e.tagID){case c.HTML:{Ve(t,e);break}case c.BASEFONT:case c.BGSOUND:case c.HEAD:case c.LINK:case c.META:case c.NOFRAMES:case c.STYLE:{Et(t,e);break}case c.NOSCRIPT:{t._err(e,v.nestedNoscriptInHead);break}default:Qn(t,e)}}function M2(t,e){switch(e.tagID){case c.NOSCRIPT:{t.openElements.pop(),t.insertionMode=C.IN_HEAD;break}case c.BR:{Qn(t,e);break}default:t._err(e,v.endTagWithoutMatchingOpenElement)}}function Qn(t,e){const n=e.type===ae.EOF?v.openElementsLeftAfterEof:v.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=C.IN_HEAD,t._processToken(e)}function B2(t,e){switch(e.tagID){case c.HTML:{Ve(t,e);break}case c.BODY:{t._insertElement(e,F.HTML),t.framesetOk=!1,t.insertionMode=C.IN_BODY;break}case c.FRAMESET:{t._insertElement(e,F.HTML),t.insertionMode=C.IN_FRAMESET;break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{t._err(e,v.abandonedHeadElementChild),t.openElements.push(t.headElement,c.HEAD),Et(t,e),t.openElements.remove(t.headElement);break}case c.HEAD:{t._err(e,v.misplacedStartTagForHeadElement);break}default:Xn(t,e)}}function F2(t,e){switch(e.tagID){case c.BODY:case c.HTML:case c.BR:{Xn(t,e);break}case c.TEMPLATE:{an(t,e);break}default:t._err(e,v.endTagWithoutMatchingOpenElement)}}function Xn(t,e){t._insertFakeElement(O.BODY,c.BODY),t.insertionMode=C.IN_BODY,ss(t,e)}function ss(t,e){switch(e.type){case ae.CHARACTER:{dc(t,e);break}case ae.WHITESPACE_CHARACTER:{cc(t,e);break}case ae.COMMENT:{ri(t,e);break}case ae.START_TAG:{Ve(t,e);break}case ae.END_TAG:{is(t,e);break}case ae.EOF:{mc(t,e);break}}}function cc(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function dc(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function U2(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function H2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function j2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,F.HTML),t.insertionMode=C.IN_FRAMESET)}function z2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,F.HTML)}function $2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&ni.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,F.HTML)}function Y2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,F.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function q2(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,F.HTML),n||(t.formElement=t.openElements.current))}function V2(t,e){t.framesetOk=!1;const n=e.tagID;for(let r=t.openElements.stackTop;r>=0;r--){const s=t.openElements.tagIDs[r];if(n===c.LI&&s===c.LI||(n===c.DD||n===c.DT)&&(s===c.DD||s===c.DT)){t.openElements.generateImpliedEndTagsWithExclusion(s),t.openElements.popUntilTagNamePopped(s);break}if(s!==c.ADDRESS&&s!==c.DIV&&s!==c.P&&t._isSpecialElement(t.openElements.items[r],s))break}t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,F.HTML)}function G2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,F.HTML),t.tokenizer.state=we.PLAINTEXT}function W2(t,e){t.openElements.hasInScope(c.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,F.HTML),t.framesetOk=!1}function Q2(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(O.A);n&&(Yi(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,F.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function X2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,F.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Z2(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(c.NOBR)&&(Yi(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,F.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function K2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,F.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function J2(t,e){t.treeAdapter.getDocumentMode(t.document)!==pt.QUIRKS&&t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,F.HTML),t.framesetOk=!1,t.insertionMode=C.IN_TABLE}function fc(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,F.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function hc(t){const e=tc(t,Kt.TYPE);return e!=null&&e.toLowerCase()===b2}function eT(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,F.HTML),hc(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function tT(t,e){t._appendElement(e,F.HTML),e.ackSelfClosing=!0}function nT(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._appendElement(e,F.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function rT(t,e){e.tagName=O.IMG,e.tagID=c.IMG,fc(t,e)}function sT(t,e){t._insertElement(e,F.HTML),t.skipNextNewLine=!0,t.tokenizer.state=we.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=C.TEXT}function iT(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,we.RAWTEXT)}function aT(t,e){t.framesetOk=!1,t._switchToTextParsing(e,we.RAWTEXT)}function Ou(t,e){t._switchToTextParsing(e,we.RAWTEXT)}function uT(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,F.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===C.IN_TABLE||t.insertionMode===C.IN_CAPTION||t.insertionMode===C.IN_TABLE_BODY||t.insertionMode===C.IN_ROW||t.insertionMode===C.IN_CELL?C.IN_SELECT_IN_TABLE:C.IN_SELECT}function oT(t,e){t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,F.HTML)}function lT(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,F.HTML)}function cT(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(c.RTC),t._insertElement(e,F.HTML)}function dT(t,e){t._reconstructActiveFormattingElements(),uc(e),$i(e),e.selfClosing?t._appendElement(e,F.MATHML):t._insertElement(e,F.MATHML),e.ackSelfClosing=!0}function fT(t,e){t._reconstructActiveFormattingElements(),oc(e),$i(e),e.selfClosing?t._appendElement(e,F.SVG):t._insertElement(e,F.SVG),e.ackSelfClosing=!0}function Lu(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,F.HTML)}function Ve(t,e){switch(e.tagID){case c.I:case c.S:case c.B:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.SMALL:case c.STRIKE:case c.STRONG:{X2(t,e);break}case c.A:{Q2(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{$2(t,e);break}case c.P:case c.DL:case c.OL:case c.UL:case c.DIV:case c.DIR:case c.NAV:case c.MAIN:case c.MENU:case c.ASIDE:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.DETAILS:case c.ADDRESS:case c.ARTICLE:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{z2(t,e);break}case c.LI:case c.DD:case c.DT:{V2(t,e);break}case c.BR:case c.IMG:case c.WBR:case c.AREA:case c.EMBED:case c.KEYGEN:{fc(t,e);break}case c.HR:{nT(t,e);break}case c.RB:case c.RTC:{lT(t,e);break}case c.RT:case c.RP:{cT(t,e);break}case c.PRE:case c.LISTING:{Y2(t,e);break}case c.XMP:{iT(t,e);break}case c.SVG:{fT(t,e);break}case c.HTML:{U2(t,e);break}case c.BASE:case c.LINK:case c.META:case c.STYLE:case c.TITLE:case c.SCRIPT:case c.BGSOUND:case c.BASEFONT:case c.TEMPLATE:{Et(t,e);break}case c.BODY:{H2(t,e);break}case c.FORM:{q2(t,e);break}case c.NOBR:{Z2(t,e);break}case c.MATH:{dT(t,e);break}case c.TABLE:{J2(t,e);break}case c.INPUT:{eT(t,e);break}case c.PARAM:case c.TRACK:case c.SOURCE:{tT(t,e);break}case c.IMAGE:{rT(t,e);break}case c.BUTTON:{W2(t,e);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{K2(t,e);break}case c.IFRAME:{aT(t,e);break}case c.SELECT:{uT(t,e);break}case c.OPTION:case c.OPTGROUP:{oT(t,e);break}case c.NOEMBED:case c.NOFRAMES:{Ou(t,e);break}case c.FRAMESET:{j2(t,e);break}case c.TEXTAREA:{sT(t,e);break}case c.NOSCRIPT:{t.options.scriptingEnabled?Ou(t,e):Lu(t,e);break}case c.PLAINTEXT:{G2(t,e);break}case c.COL:case c.TH:case c.TD:case c.TR:case c.HEAD:case c.FRAME:case c.TBODY:case c.TFOOT:case c.THEAD:case c.CAPTION:case c.COLGROUP:break;default:Lu(t,e)}}function hT(t,e){if(t.openElements.hasInScope(c.BODY)&&(t.insertionMode=C.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function pT(t,e){t.openElements.hasInScope(c.BODY)&&(t.insertionMode=C.AFTER_BODY,Ac(t,e))}function mT(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function gT(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(c.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(c.FORM):n&&t.openElements.remove(n))}function bT(t){t.openElements.hasInButtonScope(c.P)||t._insertFakeElement(O.P,c.P),t._closePElement()}function ET(t){t.openElements.hasInListItemScope(c.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(c.LI),t.openElements.popUntilTagNamePopped(c.LI))}function TT(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function xT(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function _T(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function yT(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(O.BR,c.BR),t.openElements.pop(),t.framesetOk=!1}function pc(t,e){const n=e.tagName,r=e.tagID;for(let s=t.openElements.stackTop;s>0;s--){const i=t.openElements.items[s],a=t.openElements.tagIDs[s];if(r===a&&(r!==c.UNKNOWN||t.treeAdapter.getTagName(i)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=s&&t.openElements.shortenToLength(s);break}if(t._isSpecialElement(i,a))break}}function is(t,e){switch(e.tagID){case c.A:case c.B:case c.I:case c.S:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.NOBR:case c.SMALL:case c.STRIKE:case c.STRONG:{Yi(t,e);break}case c.P:{bT(t);break}case c.DL:case c.UL:case c.OL:case c.DIR:case c.DIV:case c.NAV:case c.PRE:case c.MAIN:case c.MENU:case c.ASIDE:case c.BUTTON:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.ADDRESS:case c.ARTICLE:case c.DETAILS:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.LISTING:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{mT(t,e);break}case c.LI:{ET(t);break}case c.DD:case c.DT:{TT(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{xT(t);break}case c.BR:{yT(t);break}case c.BODY:{hT(t,e);break}case c.HTML:{pT(t,e);break}case c.FORM:{gT(t);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{_T(t,e);break}case c.TEMPLATE:{an(t,e);break}default:pc(t,e)}}function mc(t,e){t.tmplInsertionModeStack.length>0?yc(t,e):qi(t,e)}function AT(t,e){var n;e.tagID===c.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function kT(t,e){t._err(e,v.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function Ns(t,e){if(t.openElements.currentTagId!==void 0&&lc.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=C.IN_TABLE_TEXT,e.type){case ae.CHARACTER:{bc(t,e);break}case ae.WHITESPACE_CHARACTER:{gc(t,e);break}}else br(t,e)}function CT(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,F.HTML),t.insertionMode=C.IN_CAPTION}function IT(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,F.HTML),t.insertionMode=C.IN_COLUMN_GROUP}function NT(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(O.COLGROUP,c.COLGROUP),t.insertionMode=C.IN_COLUMN_GROUP,Vi(t,e)}function ST(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,F.HTML),t.insertionMode=C.IN_TABLE_BODY}function wT(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(O.TBODY,c.TBODY),t.insertionMode=C.IN_TABLE_BODY,as(t,e)}function RT(t,e){t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function OT(t,e){hc(e)?t._appendElement(e,F.HTML):br(t,e),e.ackSelfClosing=!0}function LT(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,F.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function Tn(t,e){switch(e.tagID){case c.TD:case c.TH:case c.TR:{wT(t,e);break}case c.STYLE:case c.SCRIPT:case c.TEMPLATE:{Et(t,e);break}case c.COL:{NT(t,e);break}case c.FORM:{LT(t,e);break}case c.TABLE:{RT(t,e);break}case c.TBODY:case c.TFOOT:case c.THEAD:{ST(t,e);break}case c.INPUT:{OT(t,e);break}case c.CAPTION:{CT(t,e);break}case c.COLGROUP:{IT(t,e);break}default:br(t,e)}}function sr(t,e){switch(e.tagID){case c.TABLE:{t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode());break}case c.TEMPLATE:{an(t,e);break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:br(t,e)}}function br(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,ss(t,e),t.fosterParentingEnabled=n}function gc(t,e){t.pendingCharacterTokens.push(e)}function bc(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function Mn(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)br(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const Ec=new Set([c.CAPTION,c.COL,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]);function vT(t,e){const n=e.tagID;Ec.has(n)?t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=C.IN_TABLE,Tn(t,e)):Ve(t,e)}function DT(t,e){const n=e.tagID;switch(n){case c.CAPTION:case c.TABLE:{t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=C.IN_TABLE,n===c.TABLE&&sr(t,e));break}case c.BODY:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:is(t,e)}}function Vi(t,e){switch(e.tagID){case c.HTML:{Ve(t,e);break}case c.COL:{t._appendElement(e,F.HTML),e.ackSelfClosing=!0;break}case c.TEMPLATE:{Et(t,e);break}default:Hr(t,e)}}function PT(t,e){switch(e.tagID){case c.COLGROUP:{t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=C.IN_TABLE);break}case c.TEMPLATE:{an(t,e);break}case c.COL:break;default:Hr(t,e)}}function Hr(t,e){t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=C.IN_TABLE,t._processToken(e))}function as(t,e){switch(e.tagID){case c.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,F.HTML),t.insertionMode=C.IN_ROW;break}case c.TH:case c.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(O.TR,c.TR),t.insertionMode=C.IN_ROW,us(t,e);break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE,Tn(t,e));break}default:Tn(t,e)}}function si(t,e){const n=e.tagID;switch(e.tagID){case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE);break}case c.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE,sr(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:case c.TR:break;default:sr(t,e)}}function us(t,e){switch(e.tagID){case c.TH:case c.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,F.HTML),t.insertionMode=C.IN_CELL,t.activeFormattingElements.insertMarker();break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE_BODY,as(t,e));break}default:Tn(t,e)}}function Tc(t,e){switch(e.tagID){case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE_BODY);break}case c.TABLE:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE_BODY,si(t,e));break}case c.TBODY:case c.TFOOT:case c.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(c.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=C.IN_TABLE_BODY,si(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:break;default:sr(t,e)}}function MT(t,e){const n=e.tagID;Ec.has(n)?(t.openElements.hasInTableScope(c.TD)||t.openElements.hasInTableScope(c.TH))&&(t._closeTableCell(),us(t,e)):Ve(t,e)}function BT(t,e){const n=e.tagID;switch(n){case c.TD:case c.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=C.IN_ROW);break}case c.TABLE:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),Tc(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:break;default:is(t,e)}}function xc(t,e){switch(e.tagID){case c.HTML:{Ve(t,e);break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._insertElement(e,F.HTML);break}case c.OPTGROUP:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._insertElement(e,F.HTML);break}case c.HR:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._appendElement(e,F.HTML),e.ackSelfClosing=!0;break}case c.INPUT:case c.KEYGEN:case c.TEXTAREA:case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),e.tagID!==c.SELECT&&t._processStartTag(e));break}case c.SCRIPT:case c.TEMPLATE:{Et(t,e);break}}}function _c(t,e){switch(e.tagID){case c.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===c.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===c.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop();break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop();break}case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode());break}case c.TEMPLATE:{an(t,e);break}}}function FT(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t._processStartTag(e)):xc(t,e)}function UT(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t.onEndTag(e)):_c(t,e)}function HT(t,e){switch(e.tagID){case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{Et(t,e);break}case c.CAPTION:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.tmplInsertionModeStack[0]=C.IN_TABLE,t.insertionMode=C.IN_TABLE,Tn(t,e);break}case c.COL:{t.tmplInsertionModeStack[0]=C.IN_COLUMN_GROUP,t.insertionMode=C.IN_COLUMN_GROUP,Vi(t,e);break}case c.TR:{t.tmplInsertionModeStack[0]=C.IN_TABLE_BODY,t.insertionMode=C.IN_TABLE_BODY,as(t,e);break}case c.TD:case c.TH:{t.tmplInsertionModeStack[0]=C.IN_ROW,t.insertionMode=C.IN_ROW,us(t,e);break}default:t.tmplInsertionModeStack[0]=C.IN_BODY,t.insertionMode=C.IN_BODY,Ve(t,e)}}function jT(t,e){e.tagID===c.TEMPLATE&&an(t,e)}function yc(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):qi(t,e)}function zT(t,e){e.tagID===c.HTML?Ve(t,e):jr(t,e)}function Ac(t,e){var n;if(e.tagID===c.HTML){if(t.fragmentContext||(t.insertionMode=C.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===c.HTML){t._setEndLocation(t.openElements.items[0],e);const r=t.openElements.items[1];r&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&t._setEndLocation(r,e)}}else jr(t,e)}function jr(t,e){t.insertionMode=C.IN_BODY,ss(t,e)}function $T(t,e){switch(e.tagID){case c.HTML:{Ve(t,e);break}case c.FRAMESET:{t._insertElement(e,F.HTML);break}case c.FRAME:{t._appendElement(e,F.HTML),e.ackSelfClosing=!0;break}case c.NOFRAMES:{Et(t,e);break}}}function YT(t,e){e.tagID===c.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==c.FRAMESET&&(t.insertionMode=C.AFTER_FRAMESET))}function qT(t,e){switch(e.tagID){case c.HTML:{Ve(t,e);break}case c.NOFRAMES:{Et(t,e);break}}}function VT(t,e){e.tagID===c.HTML&&(t.insertionMode=C.AFTER_AFTER_FRAMESET)}function GT(t,e){e.tagID===c.HTML?Ve(t,e):Or(t,e)}function Or(t,e){t.insertionMode=C.IN_BODY,ss(t,e)}function WT(t,e){switch(e.tagID){case c.HTML:{Ve(t,e);break}case c.NOFRAMES:{Et(t,e);break}}}function QT(t,e){e.chars=Ce,t._insertCharacters(e)}function XT(t,e){t._insertCharacters(e),t.framesetOk=!1}function kc(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==F.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function ZT(t,e){if(f2(e))kc(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===F.MATHML?uc(e):r===F.SVG&&(h2(e),oc(e)),$i(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function KT(t,e){if(e.tagID===c.P||e.tagID===c.BR){kc(t),t._endTagOutsideForeignContent(e);return}for(let n=t.openElements.stackTop;n>0;n--){const r=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(r)===F.HTML){t._endTagOutsideForeignContent(e);break}const s=t.treeAdapter.getTagName(r);if(s.toLowerCase()===e.tagName){e.tagName=s,t.openElements.shortenToLength(n);break}}}O.AREA,O.BASE,O.BASEFONT,O.BGSOUND,O.BR,O.COL,O.EMBED,O.FRAME,O.HR,O.IMG,O.INPUT,O.KEYGEN,O.LINK,O.META,O.PARAM,O.SOURCE,O.TRACK,O.WBR;const JT=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,ex=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),vu={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Cc(t,e){const n=cx(t),r=Xl("type",{handlers:{root:tx,element:nx,text:rx,comment:Nc,doctype:sx,raw:ax},unknown:ux}),s={parser:n?new Ru(vu):Ru.getFragmentParser(void 0,vu),handle(u){r(u,s)},stitches:!1,options:e||{}};r(t,s),Sn(s,It());const i=n?s.parser.document:s.parser.getFragment(),a=dE(i,{file:s.options.file});return s.stitches&&rs(a,"comment",function(u,l,o){const d=u;if(d.value.stitch&&o&&l!==void 0){const f=o.children;return f[l]=d.value.stitch,l}}),a.type==="root"&&a.children.length===1&&a.children[0].type===t.type?a.children[0]:a}function Ic(t,e){let n=-1;if(t)for(;++n<t.length;)e.handle(t[n])}function tx(t,e){Ic(t.children,e)}function nx(t,e){ox(t,e),Ic(t.children,e),lx(t,e)}function rx(t,e){e.parser.tokenizer.state>4&&(e.parser.tokenizer.state=0);const n={type:ae.CHARACTER,chars:t.value,location:Er(t)};Sn(e,It(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function sx(t,e){const n={type:ae.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Er(t)};Sn(e,It(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function ix(t,e){e.stitches=!0;const n=dx(t);if("children"in t&&"children"in n){const r=Cc({type:"root",children:t.children},e.options);n.children=r.children}Nc({type:"comment",value:{stitch:n}},e)}function Nc(t,e){const n=t.value,r={type:ae.COMMENT,data:n,location:Er(t)};Sn(e,It(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function ax(t,e){if(e.parser.tokenizer.preprocessor.html="",e.parser.tokenizer.preprocessor.pos=-1,e.parser.tokenizer.preprocessor.lastGapPos=-2,e.parser.tokenizer.preprocessor.gapStack=[],e.parser.tokenizer.preprocessor.skipNextNewLine=!1,e.parser.tokenizer.preprocessor.lastChunkWritten=!1,e.parser.tokenizer.preprocessor.endOfChunkHit=!1,e.parser.tokenizer.preprocessor.isEol=!1,Sc(e,It(t)),e.parser.tokenizer.write(e.options.tagfilter?t.value.replace(JT,"<$1$2"):t.value,!1),e.parser.tokenizer._runParsingLoop(),e.parser.tokenizer.state===72||e.parser.tokenizer.state===78){e.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=e.parser.tokenizer._consume();e.parser.tokenizer._callState(n)}}function ux(t,e){const n=t;if(e.options.passThrough&&e.options.passThrough.includes(n.type))ix(n,e);else{let r="";throw ex.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Sn(t,e){Sc(t,e);const n=t.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=t.parser.tokenizer.preprocessor.line,n.location.endCol=t.parser.tokenizer.preprocessor.col+1,n.location.endOffset=t.parser.tokenizer.preprocessor.offset+1,t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)),t.parser.tokenizer.paused=!1,t.parser.tokenizer.inLoop=!1,t.parser.tokenizer.active=!1,t.parser.tokenizer.returnState=we.DATA,t.parser.tokenizer.charRefCode=-1,t.parser.tokenizer.consumedAfterSnapshot=-1,t.parser.tokenizer.currentLocation=null,t.parser.tokenizer.currentCharacterToken=null,t.parser.tokenizer.currentToken=null,t.parser.tokenizer.currentAttr={name:"",value:""}}function Sc(t,e){if(e&&e.offset!==void 0){const n={startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:-1,endCol:-1,endOffset:-1};t.parser.tokenizer.preprocessor.lineStartPos=-e.column+1,t.parser.tokenizer.preprocessor.droppedBufferSize=e.offset,t.parser.tokenizer.preprocessor.line=e.line,t.parser.tokenizer.currentLocation=n}}function ox(t,e){const n=t.tagName.toLowerCase();if(e.parser.tokenizer.state===we.PLAINTEXT)return;Sn(e,It(t));const r=e.parser.openElements.current;let s="namespaceURI"in r?r.namespaceURI:Zt.html;s===Zt.html&&n==="svg"&&(s=Zt.svg);const i=gE({...t,children:[]},{space:s===Zt.svg?"svg":"html"}),a={type:ae.START_TAG,tagName:n,tagID:Nn(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in i?i.attrs:[],location:Er(t)};e.parser.currentToken=a,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=n}function lx(t,e){const n=t.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&kE.includes(n)||e.parser.tokenizer.state===we.PLAINTEXT)return;Sn(e,Zr(t));const r={type:ae.END_TAG,tagName:n,tagID:Nn(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Er(t)};e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken),n===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===we.RCDATA||e.parser.tokenizer.state===we.RAWTEXT||e.parser.tokenizer.state===we.SCRIPT_DATA)&&(e.parser.tokenizer.state=we.DATA)}function cx(t){const e=t.type==="root"?t.children[0]:t;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function Er(t){const e=It(t)||{line:void 0,column:void 0,offset:void 0},n=Zr(t)||{line:void 0,column:void 0,offset:void 0};return{startLine:e.line,startCol:e.column,startOffset:e.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function dx(t){return"children"in t?En({...t,children:[]}):En(t)}function fx(t){return function(e,n){return Cc(e,{...t,file:n})}}function Du(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(e);for(;s!==-1;)r++,s=n.indexOf(e,s+e.length);return r}function hx(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function px(t,e,n){const s=ts((n||{}).ignore||[]),i=mx(e);let a=-1;for(;++a<i.length;)ql(t,"text",u);function u(o,d){let f=-1,p;for(;++f<d.length;){const h=d[f],g=p?p.children:void 0;if(s(h,g?g.indexOf(h):void 0,p))return;p=h}if(p)return l(o,d)}function l(o,d){const f=d[d.length-1],p=i[a][0],h=i[a][1];let g=0;const T=f.children.indexOf(o);let E=!1,A=[];p.lastIndex=0;let b=p.exec(o.value);for(;b;){const w=b.index,R={index:b.index,input:b.input,stack:[...d,o]};let I=h(...b,R);if(typeof I=="string"&&(I=I.length>0?{type:"text",value:I}:void 0),I===!1?p.lastIndex=w+1:(g!==w&&A.push({type:"text",value:o.value.slice(g,w)}),Array.isArray(I)?A.push(...I):I&&A.push(I),g=w+b[0].length,E=!0),!p.global)break;b=p.exec(o.value)}return E?(g<o.value.length&&A.push({type:"text",value:o.value.slice(g)}),f.children.splice(T,1,...A)):A=[o],T+A.length}}function mx(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const s=n[r];e.push([gx(s[0]),bx(s[1])])}return e}function gx(t){return typeof t=="string"?new RegExp(hx(t),"g"):t}function bx(t){return typeof t=="function"?t:function(){return t}}const Ss="phrasing",ws=["autolink","link","image","label"];function Ex(){return{transforms:[Cx],enter:{literalAutolink:xx,literalAutolinkEmail:Rs,literalAutolinkHttp:Rs,literalAutolinkWww:Rs},exit:{literalAutolink:kx,literalAutolinkEmail:Ax,literalAutolinkHttp:_x,literalAutolinkWww:yx}}}function Tx(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ss,notInConstruct:ws},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ss,notInConstruct:ws},{character:":",before:"[ps]",after:"\\/",inConstruct:Ss,notInConstruct:ws}]}}function xx(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Rs(t){this.config.enter.autolinkProtocol.call(this,t)}function _x(t){this.config.exit.autolinkProtocol.call(this,t)}function yx(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function Ax(t){this.config.exit.autolinkEmail.call(this,t)}function kx(t){this.exit(t)}function Cx(t){px(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ix],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Nx]],{ignore:["link","linkReference"]})}function Ix(t,e,n,r,s){let i="";if(!wc(s)||(/^w/i.test(e)&&(n=e+n,e="",i="http://"),!Sx(n)))return!1;const a=wx(n+r);if(!a[0])return!1;const u={type:"link",title:null,url:i+e+a[0],children:[{type:"text",value:e+a[0]}]};return a[1]?[u,{type:"text",value:a[1]}]:u}function Nx(t,e,n,r){return!wc(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function Sx(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function wx(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const s=Du(t,"(");let i=Du(t,")");for(;r!==-1&&s>i;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),i++;return[t,n]}function wc(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||nn(n)||Kr(n))&&(!e||n!==47)}Rc.peek=Fx;function Rx(){this.buffer()}function Ox(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function Lx(){this.buffer()}function vx(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function Dx(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=bt(this.sliceSerialize(t)).toLowerCase(),n.label=e}function Px(t){this.exit(t)}function Mx(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=bt(this.sliceSerialize(t)).toLowerCase(),n.label=e}function Bx(t){this.exit(t)}function Fx(){return"["}function Rc(t,e,n,r){const s=n.createTracker(r);let i=s.move("[^");const a=n.enter("footnoteReference"),u=n.enter("reference");return i+=s.move(n.safe(n.associationId(t),{after:"]",before:i})),u(),a(),i+=s.move("]"),i}function Ux(){return{enter:{gfmFootnoteCallString:Rx,gfmFootnoteCall:Ox,gfmFootnoteDefinitionLabelString:Lx,gfmFootnoteDefinition:vx},exit:{gfmFootnoteCallString:Dx,gfmFootnoteCall:Px,gfmFootnoteDefinitionLabelString:Mx,gfmFootnoteDefinition:Bx}}}function Hx(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:Rc},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,i,a){const u=i.createTracker(a);let l=u.move("[^");const o=i.enter("footnoteDefinition"),d=i.enter("label");return l+=u.move(i.safe(i.associationId(r),{before:l,after:"]"})),d(),l+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),l+=u.move((e?`
|
|
91
|
+
`:" ")+i.indentLines(i.containerFlow(r,u.current()),e?Oc:jx))),o(),l}}function jx(t,e,n){return e===0?t:Oc(t,e,n)}function Oc(t,e,n){return(n?"":" ")+t}const zx=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Lc.peek=Gx;function $x(){return{canContainEols:["delete"],enter:{strikethrough:qx},exit:{strikethrough:Vx}}}function Yx(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:zx}],handlers:{delete:Lc}}}function qx(t){this.enter({type:"delete",children:[]},t)}function Vx(t){this.exit(t)}function Lc(t,e,n,r){const s=n.createTracker(r),i=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(t,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),i(),a}function Gx(){return"~"}function Wx(t){return t.length}function Qx(t,e){const n=e||{},r=(n.align||[]).concat(),s=n.stringLength||Wx,i=[],a=[],u=[],l=[];let o=0,d=-1;for(;++d<t.length;){const _=[],T=[];let E=-1;for(t[d].length>o&&(o=t[d].length);++E<t[d].length;){const A=Xx(t[d][E]);if(n.alignDelimiters!==!1){const b=s(A);T[E]=b,(l[E]===void 0||b>l[E])&&(l[E]=b)}_.push(A)}a[d]=_,u[d]=T}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<o;)i[f]=Pu(r[f]);else{const _=Pu(r);for(;++f<o;)i[f]=_}f=-1;const p=[],h=[];for(;++f<o;){const _=i[f];let T="",E="";_===99?(T=":",E=":"):_===108?T=":":_===114&&(E=":");let A=n.alignDelimiters===!1?1:Math.max(1,l[f]-T.length-E.length);const b=T+"-".repeat(A)+E;n.alignDelimiters!==!1&&(A=T.length+A+E.length,A>l[f]&&(l[f]=A),h[f]=A),p[f]=b}a.splice(1,0,p),u.splice(1,0,h),d=-1;const g=[];for(;++d<a.length;){const _=a[d],T=u[d];f=-1;const E=[];for(;++f<o;){const A=_[f]||"";let b="",w="";if(n.alignDelimiters!==!1){const R=l[f]-(T[f]||0),I=i[f];I===114?b=" ".repeat(R):I===99?R%2?(b=" ".repeat(R/2+.5),w=" ".repeat(R/2-.5)):(b=" ".repeat(R/2),w=b):w=" ".repeat(R)}n.delimiterStart!==!1&&!f&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&A==="")&&(n.delimiterStart!==!1||f)&&E.push(" "),n.alignDelimiters!==!1&&E.push(b),E.push(A),n.alignDelimiters!==!1&&E.push(w),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||f!==o-1)&&E.push("|")}g.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return g.join(`
|
|
92
|
+
`)}function Xx(t){return t==null?"":String(t)}function Pu(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function Zx(t,e,n,r){const s=n.enter("blockquote"),i=n.createTracker(r);i.move("> "),i.shift(2);const a=n.indentLines(n.containerFlow(t,i.current()),Kx);return s(),a}function Kx(t,e,n){return">"+(n?"":" ")+t}function Jx(t,e){return Mu(t,e.inConstruct,!0)&&!Mu(t,e.notInConstruct,!1)}function Mu(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function Bu(t,e,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
93
93
|
`&&Jx(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
94
94
|
`}function e3(t,e){const n=String(t);let r=n.indexOf(e),s=r,i=0,a=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++i>a&&(a=i):i=1,s=r+e.length,r=n.indexOf(e,s);return a}function t3(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function n3(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function r3(t,e,n,r){const s=n3(n),i=t.value||"",a=s==="`"?"GraveAccent":"Tilde";if(t3(t,n)){const f=n.enter("codeIndented"),p=n.indentLines(i,s3);return f(),p}const u=n.createTracker(r),l=s.repeat(Math.max(e3(i,s)+1,3)),o=n.enter("codeFenced");let d=u.move(l);if(t.lang){const f=n.enter(`codeFencedLang${a}`);d+=u.move(n.safe(t.lang,{before:d,after:" ",encode:["`"],...u.current()})),f()}if(t.lang&&t.meta){const f=n.enter(`codeFencedMeta${a}`);d+=u.move(" "),d+=u.move(n.safe(t.meta,{before:d,after:`
|
|
95
95
|
`,encode:["`"],...u.current()})),f()}return d+=u.move(`
|
|
96
96
|
`),i&&(d+=u.move(i+`
|
|
97
|
-
`)),d+=u.move(l),o(),d}function s3(t,e,n){return(n?"":" ")+t}function
|
|
98
|
-
`,...l.current()}))),u(),t.title&&(u=n.enter(`title${i}`),o+=l.move(" "+s),o+=l.move(n.safe(t.title,{before:o,after:s,...l.current()})),o+=l.move(s),u()),a(),o}function a3(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function ir(t){return"&#x"+t.toString(16).toUpperCase()+";"}function
|
|
97
|
+
`)),d+=u.move(l),o(),d}function s3(t,e,n){return(n?"":" ")+t}function Gi(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function i3(t,e,n,r){const s=Gi(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let u=n.enter("label");const l=n.createTracker(r);let o=l.move("[");return o+=l.move(n.safe(n.associationId(t),{before:o,after:"]",...l.current()})),o+=l.move("]: "),u(),!t.url||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),o+=l.move("<"),o+=l.move(n.safe(t.url,{before:o,after:">",...l.current()})),o+=l.move(">")):(u=n.enter("destinationRaw"),o+=l.move(n.safe(t.url,{before:o,after:t.title?" ":`
|
|
98
|
+
`,...l.current()}))),u(),t.title&&(u=n.enter(`title${i}`),o+=l.move(" "+s),o+=l.move(n.safe(t.title,{before:o,after:s,...l.current()})),o+=l.move(s),u()),a(),o}function a3(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function ir(t){return"&#x"+t.toString(16).toUpperCase()+";"}function zr(t,e,n){const r=bn(t),s=bn(e);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}vc.peek=u3;function vc(t,e,n,r){const s=a3(n),i=n.enter("emphasis"),a=n.createTracker(r),u=a.move(s);let l=a.move(n.containerPhrasing(t,{after:s,before:u,...a.current()}));const o=l.charCodeAt(0),d=zr(r.before.charCodeAt(r.before.length-1),o,s);d.inside&&(l=ir(o)+l.slice(1));const f=l.charCodeAt(l.length-1),p=zr(r.after.charCodeAt(0),f,s);p.inside&&(l=l.slice(0,-1)+ir(f));const h=a.move(s);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},u+l+h}function u3(t,e,n){return n.options.emphasis||"*"}function o3(t,e){let n=!1;return rs(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Xs}),!!((!t.depth||t.depth<3)&&vi(t)&&(e.options.setext||n))}function l3(t,e,n,r){const s=Math.max(Math.min(6,t.depth||1),1),i=n.createTracker(r);if(o3(t,n)){const d=n.enter("headingSetext"),f=n.enter("phrasing"),p=n.containerPhrasing(t,{...i.current(),before:`
|
|
99
99
|
`,after:`
|
|
100
100
|
`});return f(),d(),p+`
|
|
101
101
|
`+(s===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
|
|
102
102
|
`))+1))}const a="#".repeat(s),u=n.enter("headingAtx"),l=n.enter("phrasing");i.move(a+" ");let o=n.containerPhrasing(t,{before:"# ",after:`
|
|
103
|
-
`,...i.current()});return/^[\t ]/.test(o)&&(o=ir(o.charCodeAt(0))+o.slice(1)),o=o?a+" "+o:a,n.options.closeAtx&&(o+=" "+a),l(),u(),o}Dc.peek=c3;function Dc(t){return t.value||""}function c3(){return"<"}Pc.peek=d3;function Pc(t,e,n,r){const s=
|
|
103
|
+
`,...i.current()});return/^[\t ]/.test(o)&&(o=ir(o.charCodeAt(0))+o.slice(1)),o=o?a+" "+o:a,n.options.closeAtx&&(o+=" "+a),l(),u(),o}Dc.peek=c3;function Dc(t){return t.value||""}function c3(){return"<"}Pc.peek=d3;function Pc(t,e,n,r){const s=Gi(n),i=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let u=n.enter("label");const l=n.createTracker(r);let o=l.move("![");return o+=l.move(n.safe(t.alt,{before:o,after:"]",...l.current()})),o+=l.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),o+=l.move("<"),o+=l.move(n.safe(t.url,{before:o,after:">",...l.current()})),o+=l.move(">")):(u=n.enter("destinationRaw"),o+=l.move(n.safe(t.url,{before:o,after:t.title?" ":")",...l.current()}))),u(),t.title&&(u=n.enter(`title${i}`),o+=l.move(" "+s),o+=l.move(n.safe(t.title,{before:o,after:s,...l.current()})),o+=l.move(s),u()),o+=l.move(")"),a(),o}function d3(){return"!"}Mc.peek=f3;function Mc(t,e,n,r){const s=t.referenceType,i=n.enter("imageReference");let a=n.enter("label");const u=n.createTracker(r);let l=u.move("![");const o=n.safe(t.alt,{before:l,after:"]",...u.current()});l+=u.move(o+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(t),{before:l,after:"]",...u.current()});return a(),n.stack=d,i(),s==="full"||!o||o!==f?l+=u.move(f+"]"):s==="shortcut"?l=l.slice(0,-1):l+=u.move("]"),l}function f3(){return"!"}Bc.peek=h3;function Bc(t,e,n){let r=t.value||"",s="`",i=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<n.unsafe.length;){const a=n.unsafe[i],u=n.compilePattern(a);let l;if(a.atBreak)for(;l=u.exec(r);){let o=l.index;r.charCodeAt(o)===10&&r.charCodeAt(o-1)===13&&o--,r=r.slice(0,o)+" "+r.slice(l.index+1)}}return s+r+s}function h3(){return"`"}function Fc(t,e){const n=vi(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}Uc.peek=p3;function Uc(t,e,n,r){const s=Gi(n),i=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let u,l;if(Fc(t,n)){const d=n.stack;n.stack=[],u=n.enter("autolink");let f=a.move("<");return f+=a.move(n.containerPhrasing(t,{before:f,after:">",...a.current()})),f+=a.move(">"),u(),n.stack=d,f}u=n.enter("link"),l=n.enter("label");let o=a.move("[");return o+=a.move(n.containerPhrasing(t,{before:o,after:"](",...a.current()})),o+=a.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),o+=a.move("<"),o+=a.move(n.safe(t.url,{before:o,after:">",...a.current()})),o+=a.move(">")):(l=n.enter("destinationRaw"),o+=a.move(n.safe(t.url,{before:o,after:t.title?" ":")",...a.current()}))),l(),t.title&&(l=n.enter(`title${i}`),o+=a.move(" "+s),o+=a.move(n.safe(t.title,{before:o,after:s,...a.current()})),o+=a.move(s),l()),o+=a.move(")"),u(),o}function p3(t,e,n){return Fc(t,n)?"<":"["}Hc.peek=m3;function Hc(t,e,n,r){const s=t.referenceType,i=n.enter("linkReference");let a=n.enter("label");const u=n.createTracker(r);let l=u.move("[");const o=n.containerPhrasing(t,{before:l,after:"]",...u.current()});l+=u.move(o+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const f=n.safe(n.associationId(t),{before:l,after:"]",...u.current()});return a(),n.stack=d,i(),s==="full"||!o||o!==f?l+=u.move(f+"]"):s==="shortcut"?l=l.slice(0,-1):l+=u.move("]"),l}function m3(){return"["}function Wi(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function g3(t){const e=Wi(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function b3(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function jc(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function E3(t,e,n,r){const s=n.enter("list"),i=n.bulletCurrent;let a=t.ordered?b3(n):Wi(n);const u=t.ordered?a==="."?")":".":g3(n);let l=e&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!t.ordered){const d=t.children?t.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),jc(n)===a&&d){let f=-1;for(;++f<t.children.length;){const p=t.children[f];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(a=u),n.bulletCurrent=a;const o=n.containerFlow(t,r);return n.bulletLastUsed=a,n.bulletCurrent=i,s(),o}function T3(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function x3(t,e,n,r){const s=T3(n);let i=n.bulletCurrent||Wi(n);e&&e.type==="list"&&e.ordered&&(i=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+i);let a=i.length+1;(s==="tab"||s==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(a=Math.ceil(a/4)*4);const u=n.createTracker(r);u.move(i+" ".repeat(a-i.length)),u.shift(a);const l=n.enter("listItem"),o=n.indentLines(n.containerFlow(t,u.current()),d);return l(),o;function d(f,p,h){return p?(h?"":" ".repeat(a))+f:(h?i:i+" ".repeat(a-i.length))+f}}function _3(t,e,n,r){const s=n.enter("paragraph"),i=n.enter("phrasing"),a=n.containerPhrasing(t,r);return i(),s(),a}const y3=ts(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function A3(t,e,n,r){return(t.children.some(function(a){return y3(a)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function k3(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}zc.peek=C3;function zc(t,e,n,r){const s=k3(n),i=n.enter("strong"),a=n.createTracker(r),u=a.move(s+s);let l=a.move(n.containerPhrasing(t,{after:s,before:u,...a.current()}));const o=l.charCodeAt(0),d=zr(r.before.charCodeAt(r.before.length-1),o,s);d.inside&&(l=ir(o)+l.slice(1));const f=l.charCodeAt(l.length-1),p=zr(r.after.charCodeAt(0),f,s);p.inside&&(l=l.slice(0,-1)+ir(f));const h=a.move(s+s);return i(),n.attentionEncodeSurroundingInfo={after:p.outside,before:d.outside},u+l+h}function C3(t,e,n){return n.options.strong||"*"}function I3(t,e,n,r){return n.safe(t.value,r)}function N3(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function S3(t,e,n){const r=(jc(n)+(n.options.ruleSpaces?" ":"")).repeat(N3(n));return n.options.ruleSpaces?r.slice(0,-1):r}const $c={blockquote:Zx,break:Bu,code:r3,definition:i3,emphasis:vc,hardBreak:Bu,heading:l3,html:Dc,image:Pc,imageReference:Mc,inlineCode:Bc,link:Uc,linkReference:Hc,list:E3,listItem:x3,paragraph:_3,root:A3,strong:zc,text:I3,thematicBreak:S3};function w3(){return{enter:{table:R3,tableData:Fu,tableHeader:Fu,tableRow:L3},exit:{codeText:v3,table:O3,tableData:Os,tableHeader:Os,tableRow:Os}}}function R3(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function O3(t){this.exit(t),this.data.inTable=void 0}function L3(t){this.enter({type:"tableRow",children:[]},t)}function Os(t){this.exit(t)}function Fu(t){this.enter({type:"tableCell",children:[]},t)}function v3(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,D3));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function D3(t,e){return e==="|"?e:t}function P3(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,s=e.stringLength,i=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
104
104
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:a,tableCell:l,tableRow:u}};function a(h,g,_,T){return o(d(h,_,T),h.align)}function u(h,g,_,T){const E=f(h,_,T),A=o([E]);return A.slice(0,A.indexOf(`
|
|
105
|
-
`))}function l(h,g,_,T){const E=_.enter("tableCell"),A=_.enter("phrasing"),b=_.containerPhrasing(h,{...T,before:i,after:i});return A(),E(),b}function o(h,g){return Qx(h,{align:g,alignDelimiters:r,padding:n,stringLength:s})}function d(h,g,_){const T=h.children;let E=-1;const A=[],b=g.enter("table");for(;++E<T.length;)A[E]=f(T[E],g,_);return b(),A}function f(h,g,_){const T=h.children;let E=-1;const A=[],b=g.enter("tableRow");for(;++E<T.length;)A[E]=l(T[E],h,g,_);return b(),A}function p(h,g,_){let T=$c.inlineCode(h,g,_);return _.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function M3(){return{exit:{taskListCheckValueChecked:Hu,taskListCheckValueUnchecked:Hu,paragraph:F3}}}function B3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:U3}}}function Hu(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function F3(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=e.children;let i=-1,a;for(;++i<s.length;){const u=s[i];if(u.type==="paragraph"){a=u;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function U3(t,e,n,r){const s=t.children[0],i=typeof t.checked=="boolean"&&s&&s.type==="paragraph",a="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);i&&u.move(a);let l=$c.listItem(t,e,n,{...r,...u.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,o)),l;function o(d){return d+a}}function H3(){return[Ex(),Ux(),$x(),w3(),M3()]}function j3(t){return{extensions:[Tx(),Hx(t),Yx(),P3(t),B3()]}}const z3={tokenize:W3,partial:!0},Yc={tokenize:Q3,partial:!0},qc={tokenize:X3,partial:!0},Vc={tokenize:Z3,partial:!0},$3={tokenize:K3,partial:!0},Gc={name:"wwwAutolink",tokenize:V3,previous:Qc},Wc={name:"protocolAutolink",tokenize:G3,previous:Xc},Lt={name:"emailAutolink",tokenize:q3,previous:Zc},Nt={};function Y3(){return{text:Nt}}let Wt=48;for(;Wt<123;)Nt[Wt]=Lt,Wt++,Wt===58?Wt=65:Wt===91&&(Wt=97);Nt[43]=Lt;Nt[45]=Lt;Nt[46]=Lt;Nt[95]=Lt;Nt[72]=[Lt,Wc];Nt[104]=[Lt,Wc];Nt[87]=[Lt,Gc];Nt[119]=[Lt,Gc];function q3(t,e,n){const r=this;let s,i;return a;function a(f){return!ii(f)||!Zc.call(r,r.previous)||Xi(r.events)?n(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(f))}function u(f){return ii(f)?(t.consume(f),u):f===64?(t.consume(f),l):n(f)}function l(f){return f===46?t.check($3,d,o)(f):f===45||f===95||Ye(f)?(i=!0,t.consume(f),l):d(f)}function o(f){return t.consume(f),s=!0,l}function d(f){return i&&s&&Ze(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):n(f)}}function V3(t,e,n){const r=this;return s;function s(a){return a!==87&&a!==119||!Qc.call(r,r.previous)||Xi(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(z3,t.attempt(Yc,t.attempt(qc,i),n),n)(a))}function i(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function G3(t,e,n){const r=this;let s="",i=!1;return a;function a(f){return(f===72||f===104)&&Xc.call(r,r.previous)&&!Xi(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),s+=String.fromCodePoint(f),t.consume(f),u):n(f)}function u(f){if(Ze(f)&&s.length<5)return s+=String.fromCodePoint(f),t.consume(f),u;if(f===58){const p=s.toLowerCase();if(p==="http"||p==="https")return t.consume(f),l}return n(f)}function l(f){return f===47?(t.consume(f),i?o:(i=!0,l)):n(f)}function o(f){return f===null||Fr(f)||xe(f)||nn(f)||Jr(f)?n(f):t.attempt(Yc,t.attempt(qc,d),n)(f)}function d(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function W3(t,e,n){let r=0;return s;function s(a){return(a===87||a===119)&&r<3?(r++,t.consume(a),s):a===46&&r===3?(t.consume(a),i):n(a)}function i(a){return a===null?n(a):e(a)}}function Q3(t,e,n){let r,s,i;return a;function a(o){return o===46||o===95?t.check(Vc,l,u)(o):o===null||xe(o)||nn(o)||o!==45&&Jr(o)?l(o):(i=!0,t.consume(o),a)}function u(o){return o===95?r=!0:(s=r,r=void 0),t.consume(o),a}function l(o){return s||r||!i?n(o):e(o)}}function X3(t,e){let n=0,r=0;return s;function s(a){return a===40?(n++,t.consume(a),s):a===41&&r<n?i(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?t.check(Vc,e,i)(a):a===null||xe(a)||nn(a)?e(a):(t.consume(a),s)}function i(a){return a===41&&r++,t.consume(a),s}}function Z3(t,e,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),r):u===38?(t.consume(u),i):u===93?(t.consume(u),s):u===60||u===null||xe(u)||nn(u)?e(u):n(u)}function s(u){return u===null||u===40||u===91||xe(u)||nn(u)?e(u):r(u)}function i(u){return Ze(u)?a(u):n(u)}function a(u){return u===59?(t.consume(u),r):Ze(u)?(t.consume(u),a):n(u)}}function K3(t,e,n){return r;function r(i){return t.consume(i),s}function s(i){return Ye(i)?n(i):e(i)}}function Qc(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||xe(t)}function Xc(t){return!Ze(t)}function Zc(t){return!(t===47||ii(t))}function ii(t){return t===43||t===45||t===46||t===95||Ye(t)}function Xi(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const J3={tokenize:u_,partial:!0};function e_(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:s_,continuation:{tokenize:i_},exit:a_}},text:{91:{name:"gfmFootnoteCall",tokenize:r_},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:t_,resolveTo:n_}}}}function t_(t,e,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return u;function u(l){if(!a||!a._balanced)return n(l);const o=bt(r.sliceSerialize({start:a.end,end:r.now()}));return o.codePointAt(0)!==94||!i.includes(o.slice(1))?n(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function n_(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",s,e],["exit",s,e],["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function r_(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return u;function u(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",o)}function o(f){if(i>999||f===93&&!a||f===null||f===91||xe(f))return n(f);if(f===93){t.exit("chunkString");const p=t.exit("gfmFootnoteCallString");return s.includes(bt(r.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(f)}return xe(f)||(a=!0),i++,t.consume(f),f===92?d:o}function d(f){return f===91||f===92||f===93?(t.consume(f),i++,o):o(f)}}function s_(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,u;return l;function l(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),o}function o(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",d):n(g)}function d(g){if(a>999||g===93&&!u||g===null||g===91||xe(g))return n(g);if(g===93){t.exit("chunkString");const _=t.exit("gfmFootnoteDefinitionLabelString");return i=bt(r.sliceSerialize(_)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return xe(g)||(u=!0),a++,t.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(t.consume(g),a++,d):d(g)}function p(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),s.includes(i)||s.push(i),de(t,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return e(g)}}function i_(t,e,n){return t.check(mr,e,t.attempt(J3,e,n))}function a_(t){t.exit("gfmFootnoteDefinition")}function u_(t,e,n){const r=this;return de(t,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(i):n(i)}}function o_(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,u){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let o=l;for(;o--;)if(a[o][0]==="exit"&&a[o][1].type==="strikethroughSequenceTemporary"&&a[o][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[o][1].end.offset-a[o][1].start.offset){a[l][1].type="strikethroughSequence",a[o][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[o][1].start),end:Object.assign({},a[l][1].end)},f={type:"strikethroughText",start:Object.assign({},a[o][1].end),end:Object.assign({},a[l][1].start)},p=[["enter",d,u],["enter",a[o][1],u],["exit",a[o][1],u],["enter",f,u]],h=u.parser.constructs.insideSpan.null;h&<(p,p.length,0,es(h,a.slice(o+1,l),u)),lt(p,p.length,0,[["exit",f,u],["enter",a[l][1],u],["exit",a[l][1],u],["exit",d,u]]),lt(a,o-1,l-o+3,p),l=o+p.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function i(a,u,l){const o=this.previous,d=this.events;let f=0;return p;function p(g){return o===126&&d[d.length-1][1].type!=="characterEscape"?l(g):(a.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const _=bn(o);if(g===126)return f>1?l(g):(a.consume(g),f++,h);if(f<2&&!n)return l(g);const T=a.exit("strikethroughSequenceTemporary"),E=bn(g);return T._open=!E||E===2&&!!_,T._close=!_||_===2&&!!E,u(g)}}}class l_{constructor(){this.map=[]}add(e,n,r){c_(this,e,n,r)}consume(e){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let s=r.pop();for(;s;){for(const i of s)e.push(i);s=r.pop()}this.map.length=0}}function c_(t,e,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<t.map.length;){if(t.map[s][0]===e){t.map[s][1]+=n,t.map[s][2].push(...r);return}s+=1}t.map.push([e,n,r])}}function d_(t,e){let n=!1;const r=[];for(;e<t.length;){const s=t[e];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function f_(){return{flow:{null:{name:"table",tokenize:h_,resolveAll:p_}}}}function h_(t,e,n){const r=this;let s=0,i=0,a;return u;function u(S){let B=r.events.length-1;for(;B>-1;){const q=r.events[B][1].type;if(q==="lineEnding"||q==="linePrefix")B--;else break}const $=B>-1?r.events[B][1].type:null,X=$==="tableHead"||$==="tableRow"?I:l;return X===I&&r.parser.lazy[r.now().line]?n(S):X(S)}function l(S){return t.enter("tableHead"),t.enter("tableRow"),o(S)}function o(S){return S===124||(a=!0,i+=1),d(S)}function d(S){return S===null?n(S):ee(S)?i>1?(i=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),h):n(S):oe(S)?de(t,d,"whitespace")(S):(i+=1,a&&(a=!1,s+=1),S===124?(t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),a=!0,d):(t.enter("data"),f(S)))}function f(S){return S===null||S===124||xe(S)?(t.exit("data"),d(S)):(t.consume(S),S===92?p:f)}function p(S){return S===92||S===124?(t.consume(S),f):f(S)}function h(S){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(S):(t.enter("tableDelimiterRow"),a=!1,oe(S)?de(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):g(S))}function g(S){return S===45||S===58?T(S):S===124?(a=!0,t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),_):R(S)}function _(S){return oe(S)?de(t,T,"whitespace")(S):T(S)}function T(S){return S===58?(i+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(S),t.exit("tableDelimiterMarker"),E):S===45?(i+=1,E(S)):S===null||ee(S)?w(S):R(S)}function E(S){return S===45?(t.enter("tableDelimiterFiller"),A(S)):R(S)}function A(S){return S===45?(t.consume(S),A):S===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(S),t.exit("tableDelimiterMarker"),b):(t.exit("tableDelimiterFiller"),b(S))}function b(S){return oe(S)?de(t,w,"whitespace")(S):w(S)}function w(S){return S===124?g(S):S===null||ee(S)?!a||s!==i?R(S):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(S)):R(S)}function R(S){return n(S)}function I(S){return t.enter("tableRow"),L(S)}function L(S){return S===124?(t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),L):S===null||ee(S)?(t.exit("tableRow"),e(S)):oe(S)?de(t,L,"whitespace")(S):(t.enter("data"),M(S))}function M(S){return S===null||S===124||xe(S)?(t.exit("data"),L(S)):(t.consume(S),S===92?P:M)}function P(S){return S===92||S===124?(t.consume(S),M):M(S)}}function p_(t,e){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],u=!1,l=0,o,d,f;const p=new l_;for(;++n<t.length;){const h=t[n],g=h[1];h[0]==="enter"?g.type==="tableHead"?(u=!1,l!==0&&(ju(p,e,l,o,d),d=void 0,l=0),o={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",o,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,i=[0,0,0,0],a=[0,n+1,0,0],u&&(u=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",d,e]])),s=g.type==="tableDelimiterRow"?2:d?3:1):s&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(i[1]!==0&&(a[0]=a[1],f=kr(p,e,i,s,void 0,f),i=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(a[0]=a[1],f=kr(p,e,i,s,void 0,f)),i=a,a=[i[1],n,0,0])):g.type==="tableHead"?(u=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,i[1]!==0?(a[0]=a[1],f=kr(p,e,i,s,n,f)):a[1]!==0&&(f=kr(p,e,a,s,n,f)),s=0):s&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&ju(p,e,l,o,d),p.consume(e.events),n=-1;++n<e.events.length;){const h=e.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=d_(e.events,n))}return t}function kr(t,e,n,r,s,i){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(i.end=Object.assign({},hn(e.events,n[0])),t.add(n[0],0,[["exit",i,e]]));const l=hn(e.events,n[1]);if(i={type:a,start:Object.assign({},l),end:Object.assign({},l)},t.add(n[1],0,[["enter",i,e]]),n[2]!==0){const o=hn(e.events,n[2]),d=hn(e.events,n[3]),f={type:u,start:Object.assign({},o),end:Object.assign({},d)};if(t.add(n[2],0,[["enter",f,e]]),r!==2){const p=e.events[n[2]],h=e.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,_=n[3]-n[2]-1;t.add(g,_,[])}}t.add(n[3]+1,0,[["exit",f,e]])}return s!==void 0&&(i.end=Object.assign({},hn(e.events,s)),t.add(s,0,[["exit",i,e]]),i=void 0),i}function ju(t,e,n,r,s){const i=[],a=hn(e.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,e])),r.end=Object.assign({},a),i.push(["exit",r,e]),t.add(n+1,0,i)}function hn(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const m_={name:"tasklistCheck",tokenize:b_};function g_(){return{text:{91:m_}}}function b_(t,e,n){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),i)}function i(l){return xe(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(l)}function u(l){return ee(l)?e(l):oe(l)?t.check({tokenize:E_},e,n)(l):n(l)}}function E_(t,e,n){return de(t,r,"whitespace");function r(s){return s===null?n(s):e(s)}}function T_(t){return Il([Y3(),e_(),o_(t),f_(),g_()])}const x_={};function __(t){const e=this,n=t||x_,r=e.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(T_(n)),i.push(H3()),a.push(j3(n))}const y_=j.lazy(()=>Td(()=>import("./lazy-highlighter-U-fd28FU.js"),__vite__mapDeps([0,1,2])));function Kc(){const t=Q.c(3),[e,n]=j.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async a=>{await navigator.clipboard.writeText(a),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const s=r;let i;return t[1]!==e?(i={handleCopy:s,copied:e},t[1]=e,t[2]=i):i=t[2],i}function A_(){const t=Q.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[85,70],t[0]=e):e=t[0];const n=e;let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"p-4 font-mono text-sm",style:{background:"#2d2d2d",borderRadius:"0 0 0.5rem 0.5rem",overflow:"auto",minHeight:"4rem"},children:n.map(k_)}),t[1]=r):r=t[1],r}function k_(t,e){return m.jsxs("div",{className:"flex gap-2 items-center my-1",children:[e>2&&e<7&&m.jsx("div",{className:"w-4 h-4 rounded-sm opacity-40 animate-pulse",style:{background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.1}s`}}),e%4===0&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"3rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.12}s`}}),e%3===1&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"2.5rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.14}s`}}),m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:`${t}%`,background:"rgba(255, 255, 255, 0.1)",animationDelay:`${e*.1}s`}}),e%5===2&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"4rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.16}s`}})]},e)}function C_(t){const e=Q.c(12),n=j.useRef(null),{handleCopy:r,copied:s}=Kc(),i=I_;let a;e[0]!==r?(a=async()=>{const p=i(n.current);await r(p)},e[0]=r,e[1]=a):a=e[1];const u=a;let l;e[2]!==s?(l=s?m.jsx(Yr,{size:12}):m.jsx(mi,{size:12}),e[2]=s,e[3]=l):l=e[3];let o;e[4]!==u||e[5]!==l?(o=m.jsx("div",{className:"flex justify-end items-center",children:m.jsxs(Me,{variant:"ghost",onClick:u,"aria-label":"Copy as CSV",className:"text-muted-foreground hover:text-foreground h-6 text-[10px]",type:"button",children:["Copy as CSV",l]})}),e[4]=u,e[5]=l,e[6]=o):o=e[6];let d;e[7]!==t?(d=m.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:m.jsx("table",{ref:n,...t,className:"min-w-full border-collapse text-sm",children:t.children})}),e[7]=t,e[8]=d):d=e[8];let f;return e[9]!==o||e[10]!==d?(f=m.jsxs(m.Fragment,{children:[o,d]}),e[9]=o,e[10]=d,e[11]=f):f=e[11],f}function I_(t){return t?Array.from(t.querySelectorAll("tr")).map(N_).join(`
|
|
106
|
-
`):""}function N_(t){return Array.from(t.querySelectorAll("th,td")).map(S_).join(",")}function S_(t){let e=t.textContent||"";return e=e.replace(/"/g,'""'),e.search(/([",\n])/g)>=0&&(e=`"${e}"`),e}const w_=[__],R_=[fx],O_={p:t=>m.jsx("p",{...t,className:"leading-relaxed text-[15px] mb-2 last:mb-0"}),strong:t=>m.jsx("strong",{...t,className:"font-bold"}),em:t=>m.jsx("em",{...t,className:"italic"}),a:t=>m.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-primary-dark hover:underline break-all font-medium"}),ul:t=>m.jsx("ul",{...t,className:"list-disc ml-6 my-4 space-y-2"}),ol:t=>m.jsx("ol",{...t,className:"list-decimal ml-6 my-4 space-y-2"}),li:t=>m.jsx("li",{...t,className:"leading-relaxed text-[15px]"}),code:t=>m.jsx("code",{...t,className:"px-1 py-0.5 bg-muted rounded text-[15px] font-mono break-all"}),pre:t=>m.jsx("pre",{...t,className:"flex w-full min-w-0 my-4 bg-muted rounded overflow-hidden",children:m.jsx("code",{className:"flex-1 min-w-0 p-4 text-[15px] font-mono whitespace-pre overflow-x-auto",children:t.children})}),table:t=>m.jsx(C_,{...t}),thead:t=>m.jsx("thead",{...t,className:"bg-muted",children:t.children}),tr:t=>m.jsx("tr",{...t,className:"even:bg-muted/50 border-b border-border last:border-0"}),th:t=>m.jsx("th",{...t,className:"px-4 py-2 text-left font-semibold text-muted-foreground border-b border-border"}),td:t=>m.jsx("td",{...t,className:"px-4 py-2 border-b border-border"})},Jc=j.memo(t=>{const e=Q.c(2),{content:n}=t;let r;return e[0]!==n?(r=m.jsx(Xb,{remarkPlugins:w_,rehypePlugins:R_,components:O_,children:n}),e[0]=n,e[1]=r):r=e[1],r},(t,e)=>t.content===e.content);function L_(t){const e=Q.c(20),{language:n,content:r}=t,{handleCopy:s,copied:i}=Kc(),a=n||"text";let u;e[0]!==a?(u=m.jsx("span",{className:"text-xs font-mono uppercase text-muted-foreground tracking-widest select-none",children:a}),e[0]=a,e[1]=u):u=e[1];let l;e[2]!==r||e[3]!==s?(l=()=>s(r),e[2]=r,e[3]=s,e[4]=l):l=e[4];let o;e[5]!==i?(o=i?m.jsx(Yr,{size:14}):m.jsx(mi,{size:14}),e[5]=i,e[6]=o):o=e[6];let d;e[7]!==l||e[8]!==o?(d=m.jsx(Me,{size:"icon",variant:"ghost",onClick:l,"aria-label":"Copy code",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:o}),e[7]=l,e[8]=o,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=m.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 bg-muted border-b border-border",children:[u,d]}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(A_,{}),e[13]=p):p=e[13];let h;e[14]!==r||e[15]!==n?(h=m.jsx(j.Suspense,{fallback:p,children:m.jsx(y_,{language:n,content:r})}),e[14]=r,e[15]=n,e[16]=h):h=e[16];let g;return e[17]!==f||e[18]!==h?(g=m.jsxs("div",{className:"my-4 rounded-lg bg-muted overflow-hidden border border-border grid min-w-0",children:[f,h]}),e[17]=f,e[18]=h,e[19]=g):g=e[19],g}Jc.displayName="MemoizedMarkdownBlock";const Zi=t=>{const e=Q.c(7),{id:n,text:r}=t;let s;e[0]!==r?(s=ge.lexer(r),e[0]=r,e[1]=s):s=e[1];const i=s;let a;if(e[2]!==i||e[3]!==n){let u;e[5]!==n?(u=(l,o)=>l.type==="code"?m.jsx(L_,{language:l.lang,content:l.text},`${n}-block_${o}`):m.jsx(Jc,{content:l.raw},`${n}-block_${o}`),e[5]=n,e[6]=u):u=e[6],a=i.map(u),e[2]=i,e[3]=n,e[4]=a}else a=e[4];return a};Zi.displayName="MemoizedMarkdown";function ed(t){const e=Q.c(18),{id:n,part:r,copyable:s,extraActions:i,hasToolCallAfter:a}=t,u=s===void 0?!1:s,l=a===void 0?!1:a,{handleCopy:o}=up(),[d,f]=j.useState(!1);let p;e[0]!==o||e[1]!==r.text?(p=async()=>{await o(r.text),f(!0),setTimeout(()=>f(!1),2e3)},e[0]=o,e[1]=r.text,e[2]=p):p=e[2];const h=p,g=u&&i,_=g||i,T=!l&&"mb-2";let E;e[3]!==T?(E=ie("group/part relative",T),e[3]=T,e[4]=E):E=e[4];let A;e[5]!==n||e[6]!==r.text?(A=m.jsx(Zi,{id:n,text:r.text}),e[5]=n,e[6]=r.text,e[7]=A):A=e[7];let b;e[8]!==i||e[9]!==h||e[10]!==d||e[11]!==_||e[12]!==g?(b=_&&m.jsx("div",{className:"flex w-full items-center text-xs text-muted-foreground opacity-0 pointer-events-none transition-all duration-200 group-hover/part:opacity-100 group-hover/part:pointer-events-auto mt-2",children:m.jsxs("div",{className:"flex items-center gap-1",children:[g&&m.jsx(Me,{onClick:h,variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground size-6 whitespace-nowrap",children:d?m.jsx(Yr,{size:12}):m.jsx(mi,{size:12})}),i]})}),e[8]=i,e[9]=h,e[10]=d,e[11]=_,e[12]=g,e[13]=b):b=e[13];let w;return e[14]!==E||e[15]!==A||e[16]!==b?(w=m.jsxs("div",{className:E,children:[A,b]}),e[14]=E,e[15]=A,e[16]=b,e[17]=w):w=e[17],w}function v_(t){const e=Q.c(4),{output:n}=t;let r;if(e[0]!==n){const a=JSON.stringify(n,null,2);r=a.length>2e3?a.slice(0,2e3)+"...[TRUNCATED]":a,e[0]=n,e[1]=r}else r=e[1];const s=r;let i;return e[2]!==s?(i=m.jsx("div",{className:"h-full",children:m.jsx(Ku,{code:s,language:"json",height:"100%",readOnly:!0})}),e[2]=s,e[3]=i):i=e[3],i}var ls="Collapsible",[D_,rA]=xd(ls),[P_,Ki]=D_(ls),td=j.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...u}=t,[l,o]=Ad({prop:r,defaultProp:s??!1,onChange:a,caller:ls});return m.jsx(P_,{scope:n,disabled:i,contentId:kd(),open:l,onOpenToggle:j.useCallback(()=>o(d=>!d),[o]),children:m.jsx(li.div,{"data-state":na(l),"data-disabled":i?"":void 0,...u,ref:e})})});td.displayName=ls;var nd="CollapsibleTrigger",Ji=j.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=Ki(nd,n);return m.jsx(li.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":na(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:_d(t.onClick,s.onOpenToggle)})});Ji.displayName=nd;var ea="CollapsibleContent",ta=j.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Ki(ea,t.__scopeCollapsible);return m.jsx(yd,{present:n||s.open,children:({present:i})=>m.jsx(M_,{...r,ref:e,present:i})})});ta.displayName=ea;var M_=j.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,a=Ki(ea,n),[u,l]=j.useState(r),o=j.useRef(null),d=Cd(e,o),f=j.useRef(0),p=f.current,h=j.useRef(0),g=h.current,_=a.open||u,T=j.useRef(_),E=j.useRef(void 0);return j.useEffect(()=>{const A=requestAnimationFrame(()=>T.current=!1);return()=>cancelAnimationFrame(A)},[]),Id(()=>{const A=o.current;if(A){E.current=E.current||{transitionDuration:A.style.transitionDuration,animationName:A.style.animationName},A.style.transitionDuration="0s",A.style.animationName="none";const b=A.getBoundingClientRect();f.current=b.height,h.current=b.width,T.current||(A.style.transitionDuration=E.current.transitionDuration,A.style.animationName=E.current.animationName),l(r)}},[a.open,r]),m.jsx(li.div,{"data-state":na(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!_,...i,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...t.style},children:_&&s})});function na(t){return t?"open":"closed"}var B_=td,sA=Ji,iA=ta;function F_(t){const e=Q.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(B_,{"data-slot":"collapsible",...n}),e[2]=n,e[3]=r):r=e[3],r}function U_(t){const e=Q.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(Ji,{"data-slot":"collapsible-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function H_(t){const e=Q.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(ta,{"data-slot":"collapsible-content",...n}),e[2]=n,e[3]=r):r=e[3],r}function j_(t){return t.split(/[_-]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function zu(t){const e=Q.c(70),{part:n,isFirstInSequence:r,isLastInSequence:s,hasNextToolCall:i}=t,a=r===void 0?!1:r,u=s===void 0?!1:s,l=i===void 0?!1:i,{state:o}=n;let d;e[0]!==n?(d="toolName"in n?n.toolName:n.type.replace("tool-",""),e[0]=n,e[1]=d):d=e[1];const f=d;let p;e[2]!==f?(p=j_(f),e[2]=f,e[3]=p):p=e[3];const h=p,[g,_]=j.useState(!1),[T]=Tf(),E=(o==="input-streaming"||o==="input-available"||o==="output-available")&&!!n.input,A=o==="output-available",b=o==="output-error";if(!T){const ve=o==="input-streaming"||o==="input-available",fe=o==="output-available",Ge=o==="output-error",Ie=a&&"mt-2",Ne=u&&"mb-2";let ye;e[4]!==Ie||e[5]!==Ne?(ye=ie("flex items-center gap-1.5 py-2 opacity-75 relative",Ie,Ne),e[4]=Ie,e[5]=Ne,e[6]=ye):ye=e[6];let Fe;e[7]===Symbol.for("react.memo_cache_sentinel")?(Fe=m.jsx(Ju,{className:"size-4 text-muted-foreground shrink-0"}),e[7]=Fe):Fe=e[7];let Re;e[8]!==l?(Re=l&&m.jsx("div",{className:"absolute left-1/2 top-full w-px bg-border -translate-x-1/2",style:{height:"calc(100% + 1rem)"}}),e[8]=l,e[9]=Re):Re=e[9];let De;e[10]!==Re?(De=m.jsxs("div",{className:"relative shrink-0 flex items-center",children:[Fe,Re]}),e[10]=Re,e[11]=De):De=e[11];let Oe;e[12]!==h||e[13]!==ve?(Oe=ve&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted-foreground shimmer",children:"Calling"})," ",m.jsxs("span",{className:"text-muted-foreground/75 shimmer",children:[h,"..."]})]}),e[12]=h,e[13]=ve,e[14]=Oe):Oe=e[14];let Ue;e[15]!==h||e[16]!==fe?(Ue=fe&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted-foreground",children:"Called"})," ",m.jsx("span",{className:"text-muted-foreground/75",children:h})]}),e[15]=h,e[16]=fe,e[17]=Ue):Ue=e[17];let Se;e[18]!==h||e[19]!==Ge?(Se=Ge&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-destructive/90",children:"Error calling"})," ",m.jsx("span",{className:"text-destructive/75",children:h})]}),e[18]=h,e[19]=Ge,e[20]=Se):Se=e[20];let He;e[21]!==Oe||e[22]!==Ue||e[23]!==Se?(He=m.jsxs("span",{className:"text-[15px]",children:[Oe,Ue,Se]}),e[21]=Oe,e[22]=Ue,e[23]=Se,e[24]=He):He=e[24];let We;return e[25]!==De||e[26]!==He||e[27]!==ye?(We=m.jsxs("div",{className:ye,children:[De,He]}),e[25]=De,e[26]=He,e[27]=ye,e[28]=We):We=e[28],We}let w;e[29]!==o?(w=o==="output-error"?m.jsx(Wu,{className:"size-4 text-destructive shrink-0"}):m.jsx(sf,{className:ie("size-4 text-muted-foreground shrink-0",(o==="input-streaming"||o==="input-available")&&"shimmer")}),e[29]=o,e[30]=w):w=e[30];const R=o==="output-error"&&"text-destructive/90",I=(o==="input-streaming"||o==="input-available")&&"shimmer";let L;e[31]!==R||e[32]!==I?(L=ie("text-[15px] font-medium text-muted-foreground truncate",R,I),e[31]=R,e[32]=I,e[33]=L):L=e[33];const M=o==="input-streaming"&&`Streaming ${f} arguments`,P=o==="input-available"&&`Calling ${f}`,S=o==="output-available"&&`Called ${f}`,B=o==="output-error"&&`Error calling ${f}`;let $;e[34]!==M||e[35]!==P||e[36]!==S||e[37]!==B||e[38]!==L?($=m.jsxs("span",{className:L,children:[M,P,S,B]}),e[34]=M,e[35]=P,e[36]=S,e[37]=B,e[38]=L,e[39]=$):$=e[39];let X;e[40]!==$||e[41]!==w?(X=m.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[w,$]}),e[40]=$,e[41]=w,e[42]=X):X=e[42];const q=g&&"rotate-90";let U;e[43]!==q?(U=ie("size-4 text-muted-foreground transition-transform duration-200",q),e[43]=q,e[44]=U):U=e[44];let W;e[45]!==U?(W=m.jsx("div",{className:"flex items-center gap-2 shrink-0",children:m.jsx(Xu,{className:U})}),e[45]=U,e[46]=W):W=e[46];let V;e[47]!==X||e[48]!==W?(V=m.jsxs(U_,{className:"flex items-center gap-2 w-full cursor-pointer p-3 hover:bg-accent/50 transition-colors",children:[X,W]}),e[47]=X,e[48]=W,e[49]=V):V=e[49];let K;e[50]===Symbol.for("react.memo_cache_sentinel")?(K=m.jsx("div",{className:"w-4 relative shrink-0",children:m.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-0.25 bg-border"})}),e[50]=K):K=e[50];let J;e[51]!==n.input||e[52]!==E?(J=E&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Input"})}),m.jsx("div",{className:"border border-border rounded-lg p-2 h-full max-h-[200px]",children:m.jsx(Ku,{code:JSON.stringify(n.input,null,2),language:"json",foldOnMount:!0,height:"100%",readOnly:!0})})]}),e[51]=n.input,e[52]=E,e[53]=J):J=e[53];let k;e[54]!==n.output||e[55]!==A?(k=A&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output"})}),m.jsx("div",{className:"border border-border rounded-lg max-h-[200px] overflow-auto p-2 h-full",children:m.jsx(v_,{output:n.output})})]}),e[54]=n.output,e[55]=A,e[56]=k):k=e[56];let re;e[57]!==n||e[58]!==b?(re=b&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-destructive/90",children:"Error"})}),m.jsx("div",{className:"border border-destructive/20 rounded-lg max-h-[200px] overflow-auto p-2 bg-destructive/10",children:m.jsx("pre",{className:"text-xs font-mono text-destructive whitespace-pre-wrap wrap-break-word",children:"errorText"in n&&typeof n.errorText=="string"?n.errorText:"An unknown error occurred"})})]}),e[57]=n,e[58]=b,e[59]=re):re=e[59];let he;e[60]!==J||e[61]!==k||e[62]!==re?(he=m.jsx(H_,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:m.jsxs("div",{className:"flex ml-[7px] px-3 pb-3",children:[K,m.jsxs("div",{className:"flex flex-col gap-4 flex-1 min-w-0 pt-2",children:[J,k,re]})]})}),e[60]=J,e[61]=k,e[62]=re,e[63]=he):he=e[63];let N;e[64]!==V||e[65]!==he?(N=m.jsxs("div",{className:"border border-border/75 rounded-lg flex flex-col bg-background w-full min-w-0 overflow-hidden",children:[V,he]}),e[64]=V,e[65]=he,e[66]=N):N=e[66];let Ee;return e[67]!==g||e[68]!==N?(Ee=m.jsx("div",{className:"flex flex-col my-4 w-full min-w-0",children:m.jsx(F_,{open:g,onOpenChange:_,children:N})}),e[67]=g,e[68]=N,e[69]=Ee):Ee=e[69],Ee}const z_={planning:{icon:m.jsx(oo,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Planning next moves"},thinking:{icon:m.jsx(Vr,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Thinking"}},$_=1200;function Y_(){const t=Q.c(7),[e,n]=j.useState("planning");let r,s;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const l=setTimeout(()=>{n("thinking")},$_);return()=>{clearTimeout(l)}},s=[],t[0]=r,t[1]=s):(r=t[0],s=t[1]),j.useEffect(r,s);const i=z_[e];let a;t[2]!==i.label?(a=m.jsxs("span",{className:"text-[15px] text-muted-foreground shimmer",children:[i.label,"..."]}),t[2]=i.label,t[3]=a):a=t[3];let u;return t[4]!==i.icon||t[5]!==a?(u=m.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[i.icon,a]})}),t[4]=i.icon,t[5]=a,t[6]=u):u=t[6],u}function q_(t){const e=Q.c(10),{duration:n,parts:r,id:s}=t,i=n/1e3;let a;e[0]!==i?(a=i.toFixed(1),e[0]=i,e[1]=a):a=e[1];const u=a,[l,o]=j.useState(!1),[d,f]=j.useState(!1);let p;if(e[2]!==s||e[3]!==d||e[4]!==l||e[5]!==r||e[6]!==u){const h=r.filter(G_),g=h.some(V_),_=g||d;let T,E;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>o(!0),E=()=>o(!1),e[8]=T,e[9]=E):(T=e[8],E=e[9]),p=m.jsxs("div",{className:"flex flex-col mb-2",children:[m.jsx("button",{type:"button",onClick:()=>!g&&f(!d),onMouseEnter:T,onMouseLeave:E,className:ie("flex items-center gap-1.5 py-2 opacity-60 transition-opacity",!g&&"cursor-pointer hover:opacity-100",g&&"cursor-default"),children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[g?m.jsx(Vr,{className:"text-muted-foreground shrink-0 shimmer",size:14}):l?m.jsx(Xu,{className:ie("text-muted-foreground transition-transform shrink-0",d&&"rotate-90"),size:14}):m.jsx(io,{className:"text-muted-foreground shrink-0",size:14}),m.jsx("span",{className:ie("text-[15px] text-muted-foreground",g&&"shimmer"),children:g?"Thinking...":`Thought for ${u}s`})]})}),_&&m.jsx("div",{className:"ml-[6px] border-l-2 pl-4 mt-1 mb-2 max-h-[300px] overflow-y-auto",children:h.map((A,b)=>m.jsx("div",{className:"text-muted-foreground markdown-sm pb-2",children:m.jsx(Zi,{id:`${s}-reasoning-${b}`,text:A.text})},`${s}-reasoning-${b}`))})]}),e[2]=s,e[3]=d,e[4]=l,e[5]=r,e[6]=u,e[7]=p}else p=e[7];return p}function V_(t){return t.state==="streaming"}function G_(t){return t.type==="reasoning"}function W_(t){const e=Q.c(17),{part:n,id:r,usageStats:s,isFollowedByToolCall:i,isFirstToolCallInSequence:a,isLastToolCallInSequence:u,hasNextToolCall:l}=t;switch(n.type){case"dynamic-tool":{let o;return e[0]!==l||e[1]!==r||e[2]!==a||e[3]!==u||e[4]!==n?(o=m.jsx(zu,{part:n,id:r,isFirstInSequence:a,isLastInSequence:u,hasNextToolCall:l}),e[0]=l,e[1]=r,e[2]=a,e[3]=u,e[4]=n,e[5]=o):o=e[5],o}case"text":{let o;return e[6]!==r||e[7]!==i||e[8]!==n||e[9]!==s?(o=m.jsx(ed,{id:r,part:n,extraActions:s,copyable:!0,hasToolCallAfter:i}),e[6]=r,e[7]=i,e[8]=n,e[9]=s,e[10]=o):o=e[10],o}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;default:if(n.type.startsWith("tool-")){const o=n;let d;return e[11]!==l||e[12]!==r||e[13]!==a||e[14]!==u||e[15]!==o?(d=m.jsx(zu,{part:o,id:r,isFirstInSequence:a,isLastInSequence:u,hasNextToolCall:l}),e[11]=l,e[12]=r,e[13]=a,e[14]=u,e[15]=o,e[16]=d):d=e[16],d}}throw new Error(`Unknown part type: ${n.type}`)}function Q_(t){const e=Q.c(24),{message:n,status:r,className:s}=t,{id:i,parts:a}=n,o=r==="streaming"||r==="submitted",d=a.length>0;let f;e[0]!==a?(f=a.some(Z_),e[0]=a,e[1]=f):f=e[1];const p=f;let h;e[2]!==o||e[3]!==a?(h=o&&a.some(X_),e[2]=o,e[3]=a,e[4]=h):h=e[4];const g=h;let _;if(e[5]!==n.metadata){const M=n.metadata?.reasoning_start_at?new Date(n.metadata.reasoning_start_at):null,P=n.metadata?.reasoning_end_at?new Date(n.metadata.reasoning_end_at):null;_=M!==null?(P??new Date).getTime()-M.getTime():null,e[5]=n.metadata,e[6]=_}else _=e[6];const T=_,E=d&&(p||g)&&T!==null;let A;e[7]!==n?(A=m.jsx(Zo,{messages:[n]}),e[7]=n,e[8]=A):A=e[8];const b=A;let w;e[9]!==s?(w=ie("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",s),e[9]=s,e[10]=w):w=e[10];let R;e[11]!==T||e[12]!==d||e[13]!==i||e[14]!==o||e[15]!==a||e[16]!==E||e[17]!==b?(R=d?m.jsxs(m.Fragment,{children:[E&&m.jsx(q_,{duration:T,parts:a,id:i}),a.map((M,P)=>{const S=a[P+1],B=a[P-1],$=S&&(S.type==="dynamic-tool"||S.type.startsWith("tool-")),X=M.type==="dynamic-tool"||M.type.startsWith("tool-"),q=B&&(B.type==="dynamic-tool"||B.type.startsWith("tool-")),U=S&&(S.type==="dynamic-tool"||S.type.startsWith("tool-")),W=X&&!q,V=X&&!U,K=X&&U;return m.jsx(W_,{part:M,id:i,usageStats:P===a.length-1?b:void 0,isFollowedByToolCall:$,isFirstToolCallInSequence:W,isLastToolCallInSequence:V,hasNextToolCall:K},`${i}-${P}`)})]}):o?m.jsx(Y_,{}):null,e[11]=T,e[12]=d,e[13]=i,e[14]=o,e[15]=a,e[16]=E,e[17]=b,e[18]=R):R=e[18];let I;e[19]!==R?(I=m.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:m.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-[15px] wrap-break-word overflow-wrap-anywhere bg-transparent",children:R})}),e[19]=R,e[20]=I):I=e[20];let L;return e[21]!==w||e[22]!==I?(L=m.jsx("div",{className:w,children:I}),e[21]=w,e[22]=I,e[23]=L):L=e[23],L}function X_(t){return t.type==="reasoning"&&t.state==="streaming"}function Z_(t){return t.type==="reasoning"}const rd=j.createContext(null);function sd(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx(m.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function K_(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(!j.isValidElement(r))continue;if(r.props?.message?.role==="assistant"){const i=t[n-1],a=j.isValidElement(i)&&i.props?.message?.role,u=i&&j.isValidElement(i)&&a==="user"?i:null;e.push({user:u,assistant:r})}}return e}function J_(t){const e=Q.c(27),{children:n,className:r,minHeightOffset:s}=t,i=j.useRef(null);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],e[0]=a):a=e[0];const u=j.useRef(a);let l,o,d,f,p,h,g;if(e[1]!==n||e[2]!==r||e[3]!==s){const A=j.Children.toArray(n),b=A[A.length-1];o=b&&j.isValidElement(b)&&b.type===sd?b:null;const w=o?A.slice(0,-1):A,R=K_(w);let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=M=>{const P=u.current[M];if(P&&i.current){const S=i.current.offsetTop,B=P.offsetTop;i.current.scrollTo({top:B-S,behavior:"smooth"})}},e[11]=I):I=e[11];const L=I;l=rd.Provider,e[12]===Symbol.for("react.memo_cache_sentinel")?(g={scrollToPair:L},e[12]=g):g=e[12],p=i,e[13]!==r?(h=ie("w-full min-w-0 max-w-full overflow-y-auto h-full overflow-x-hidden",r),e[13]=r,e[14]=h):h=e[14],d="flex flex-col min-w-0 max-w-2xl mx-auto w-full",f=R.map((M,P)=>{const S=P===R.length-1;return m.jsxs("div",{ref:B=>{u.current[P]=B},className:"flex flex-col pb-2",style:S&&s?{minHeight:`calc(100vh - ${s}px)`}:void 0,children:[m.jsx("div",{className:"sticky top-0 z-50 bg-background w-full h-4"}),m.jsx("div",{className:"sticky mb-3 top-4 z-50",children:M.user&&j.isValidElement(M.user)?j.cloneElement(M.user,{pairIndex:P}):M.user}),M.assistant]},P)}),e[1]=n,e[2]=r,e[3]=s,e[4]=l,e[5]=o,e[6]=d,e[7]=f,e[8]=p,e[9]=h,e[10]=g}else l=e[4],o=e[5],d=e[6],f=e[7],p=e[8],h=e[9],g=e[10];let _;e[15]!==o||e[16]!==d||e[17]!==f?(_=m.jsxs("div",{className:d,children:[f,o]}),e[15]=o,e[16]=d,e[17]=f,e[18]=_):_=e[18];let T;e[19]!==p||e[20]!==h||e[21]!==_?(T=m.jsx("div",{ref:p,className:h,children:_}),e[19]=p,e[20]=h,e[21]=_,e[22]=T):T=e[22];let E;return e[23]!==l||e[24]!==g||e[25]!==T?(E=m.jsx(l,{value:g,children:T}),e[23]=l,e[24]=g,e[25]=T,e[26]=E):E=e[26],E}function ey(t){const e=Q.c(5),{locator:n}=zt(),r=Yo(),s=$o();let i;return e[0]!==n||e[1]!==r||e[2]!==t||e[3]!==s?(i=async(u,l,o)=>{const d=await jo(n,o),f=d.findIndex(T=>T.id===u);if(f===-1){console.warn(`[branch] Message ${u} not found in thread ${o}`);return}const p=d.slice(0,f).filter(ty),h=crypto.randomUUID(),g=new Date().toISOString(),_={id:h,title:"",created_at:g,updated_at:g,hidden:!1};if(await s.insert.mutateAsync(_),p.length>0){const T=p.map(E=>({...E,id:crypto.randomUUID(),metadata:{...E.metadata,thread_id:h,created_at:E.metadata?.created_at||g}}));await r.insertMany.mutateAsync(T)}t(h)},e[0]=n,e[1]=r,e[2]=t,e[3]=s,e[4]=i):i=e[4],i}function ty(t){return t.role!=="system"}function ny(t){const e=Q.c(18),{messageId:n,parts:r}=t,[s,i]=j.useState(!1),{setInputValue:a,startBranch:u,setActiveThreadId:l,activeThreadId:o}=An(),d=ey(l);let f;e[0]!==r?(f=r.filter(sy).map(ry).join(`
|
|
107
|
-
`),e[0]=r,e[1]=f):f=e[1];const p=f;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=I=>{I.stopPropagation(),i(!0)},e[2]=h):h=e[2];const g=h;let _;e[3]!==o||e[4]!==d||e[5]!==n||e[6]!==p||e[7]!==a||e[8]!==u?(_=async()=>{await d(n,p,o),a(p),u({originalThreadId:o,originalMessageId:n,originalMessageText:p}),i(!1)},e[3]=o,e[4]=d,e[5]=n,e[6]=p,e[7]=a,e[8]=u,e[9]=_):_=e[9];const T=_;let E;e[10]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx("div",{className:"flex justify-center items-end px-2 pb-1",children:m.jsxs(yn,{children:[m.jsx(_n,{asChild:!0,children:m.jsx(Me,{onClick:g,variant:"ghost",size:"xs",className:"opacity-0 group-hover:opacity-100 hover:bg-gray-200/70 rounded-md transition-opacity text-muted-foreground hover:text-foreground aspect-square w-6 h-6 p-0",children:m.jsx(so,{size:16,className:"p-0.5"})})}),m.jsx(xn,{side:"bottom",children:"Edit message"})]})}),e[10]=E):E=e[10];let A;e[11]===Symbol.for("react.memo_cache_sentinel")?(A=m.jsxs(af,{children:[m.jsx(uf,{children:"Edit message?"}),m.jsx(of,{children:"This will create a new conversation branch from this point. The original conversation will remain unchanged."})]}),e[11]=A):A=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=m.jsx(lf,{children:"Cancel"}),e[12]=b):b=e[12];let w;e[13]!==T?(w=m.jsxs(cf,{children:[A,m.jsxs(df,{children:[b,m.jsx(ff,{onClick:T,children:"Confirm"})]})]}),e[13]=T,e[14]=w):w=e[14];let R;return e[15]!==s||e[16]!==w?(R=m.jsxs(m.Fragment,{children:[E,m.jsx(hf,{open:s,onOpenChange:i,children:w})]}),e[15]=s,e[16]=w,e[17]=R):R=e[17],R}function ry(t){return t.text}function sy(t){return t.type==="text"}function iy(t){const e=Q.c(29),{message:n,className:r,pairIndex:s}=t,{id:i,parts:a}=n,u=j.useContext(rd),[l,o]=j.useState(!1);if(!a||a.length===0)return null;let d;e[0]!==u||e[1]!==s?(d=()=>{o(!0),s!==void 0&&u?.scrollToPair(s)},e[0]=u,e[1]=s,e[2]=d):d=e[2];const f=d;let p;e[3]!==r?(p=ie("message-block w-full min-w-0 group relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",r),e[3]=r,e[4]=p):p=e[4];let h,g;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=()=>o(!0),g=()=>o(!1),e[5]=h,e[6]=g):(h=e[5],g=e[6]);const _=l?"overflow-auto opacity-100":"overflow-hidden opacity-99 mask-b-from-1%";let T;e[7]!==_?(T=ie("z-10 px-4 py-2 transition-opacity max-h-[120px] flex-1",_),e[7]=_,e[8]=T):T=e[8];let E;if(e[9]!==i||e[10]!==a){let L;e[12]!==i?(L=(M,P)=>M.type==="text"?m.jsx(ed,{id:i,part:M},`${i}-${P}`):null,e[12]=i,e[13]=L):L=e[13],E=a.map(L),e[9]=i,e[10]=a,e[11]=E}else E=e[11];let A;e[14]!==E?(A=m.jsx("div",{children:E}),e[14]=E,e[15]=A):A=e[15];let b;e[16]!==T||e[17]!==A?(b=m.jsx("div",{className:T,children:A}),e[16]=T,e[17]=A,e[18]=b):b=e[18];let w;e[19]!==i||e[20]!==a?(w=m.jsx(ny,{messageId:i,parts:a}),e[19]=i,e[20]=a,e[21]=w):w=e[21];let R;e[22]!==f||e[23]!==w||e[24]!==b?(R=m.jsxs("div",{tabIndex:0,onClick:f,onFocus:h,onBlur:g,className:"w-full border min-w-0 shadow-xs rounded-lg text-[0.9375rem] wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[b,w]}),e[22]=f,e[23]=w,e[24]=b,e[25]=R):R=e[25];let I;return e[26]!==R||e[27]!==p?(I=m.jsx(m.Fragment,{children:m.jsx("div",{className:p,children:R})}),e[26]=R,e[27]=p,e[28]=I):I=e[28],I}function ay({title:t="No model provider connected",description:e="Connect to a model provider to unlock AI-powered features.",org:n}){const[r,s]=j.useState(!1),i=Ud(),a=Gu(),{data:u}=Vu.useSession(),l=Qu(),o=u?.user?.id??"",d=()=>{a({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},f=async()=>{if(!n.id||!o){Kn.error("Not authenticated");return}s(!0);try{const p=l?.find(_=>_.connection_url===mf);if(p){a({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:p.id}});return}const h=gf({id:bf("conn")}),g=await i.create.mutateAsync(h);a({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:g.id}})}catch(p){Kn.error(`Failed to connect OpenRouter: ${p instanceof Error?p.message:String(p)}`)}finally{s(!1)}};return m.jsx(Sd,{image:m.jsx("img",{src:"/empty-state-openrouter.svg",alt:"",width:336,height:320,"aria-hidden":"true",className:"w-xs h-auto mask-radial-[100%_100%] mask-radial-from-20% mask-radial-to-50% mask-radial-at-center"}),title:t,description:e,actions:m.jsxs(m.Fragment,{children:[m.jsxs(Me,{variant:"outline",onClick:f,disabled:r,children:[m.jsx("img",{src:pf,alt:"OpenRouter",className:"size-4"}),r?"Installing...":"Install OpenRouter"]}),m.jsx(Me,{variant:"outline",onClick:d,children:"Install Connection"})]})})}function uy(t){const e=new Date(t),r=new Date().getTime()-e.getTime(),s=Math.floor(r/6e4),i=Math.floor(r/36e5);return s<1?"now":s<60?`${s}m`:`${i}h`}function oy(t){const e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(n.getTime()-864e5),s=new Date(n.getTime()-7*864e5),i=new Date(n.getTime()-30*864e5),a=[],u=[],l=[],o=[],d=[];for(const p of t){const h=new Date(p.updated_at);h>=n?a.push(p):h>=r?u.push(p):h>=s?l.push(p):h>=i?o.push(p):d.push(p)}const f=[];return a.length>0&&f.push({label:"Today",threads:a,showRelativeTime:!0}),u.length>0&&f.push({label:"Yesterday",threads:u,showRelativeTime:!1}),l.length>0&&f.push({label:"7 days ago",threads:l,showRelativeTime:!1}),o.length>0&&f.push({label:"30 days ago",threads:o,showRelativeTime:!1}),d.length>0&&f.push({label:"Older",threads:d,showRelativeTime:!1}),f}function ly(t){const e=Q.c(49),{variant:n}=t,r=n===void 0?"icon":n,{threads:s,refetch:i}=zo(),{activeThreadId:a,setActiveThreadId:u,hideThread:l}=An(),[o,d]=j.useState("");let f,p,h,g,_,T,E,A,b,w,R,I;if(e[0]!==a||e[1]!==l||e[2]!==i||e[3]!==o||e[4]!==u||e[5]!==s||e[6]!==r){const $=o.trim()?s.filter(K=>(K.title||"New chat").toLowerCase().includes(o.toLowerCase())):s,X=oy($);let q;e[19]!==i?(q=K=>{K?i():d("")},e[19]=i,e[20]=q):q=e[20];const U=q;g=pi,h=yn,p=lr,w=U,e[21]!==r?(R=m.jsx(_n,{asChild:!0,children:m.jsx(ur,{asChild:!0,children:r==="outline"?m.jsx(Me,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input","aria-label":"Chat history",children:m.jsx(ra,{size:16})}):m.jsx(Me,{type:"button",variant:"ghost",size:"icon",className:"size-6 p-1 hover:bg-transparent","aria-label":"Chat history",children:m.jsx(ra,{size:16,className:"text-muted-foreground hover:text-foreground transition-colors"})})})}),e[21]=r,e[22]=R):R=e[22],e[23]===Symbol.for("react.memo_cache_sentinel")?(I=m.jsx(xn,{children:"Chat history"}),e[23]=I):I=e[23],f=or,E="end",A="w-80 p-0";let W;e[24]===Symbol.for("react.memo_cache_sentinel")?(W=m.jsx(qr,{size:16,className:"text-muted-foreground shrink-0"}),e[24]=W):W=e[24];let V;e[25]===Symbol.for("react.memo_cache_sentinel")?(V=K=>d(K.target.value),e[25]=V):V=e[25],e[26]!==o?(b=m.jsx("div",{className:"border-b",children:m.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[W,m.jsx("input",{type:"text",placeholder:"Search chats...",value:o,onChange:V,className:"flex-1 border-0 shadow-none focus:outline-none px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[26]=o,e[27]=b):b=e[27],_="max-h-[300px] overflow-y-auto",T=$.length===0?m.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:o.trim()?"No chats found":"No chats yet"}):X.map((K,J)=>m.jsxs("div",{children:[J>0&&m.jsx("div",{className:"border-t mx-3"}),m.jsx("div",{className:"px-3 py-1",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground tracking-wide",children:K.label})}),K.threads.map(k=>{const re=k.id===a;return m.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 hover:bg-accent cursor-pointer group ${re?"bg-accent/50":""}`,onClick:()=>u(k.id),children:[m.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[m.jsx("span",{className:"text-sm truncate",children:k.title||"New chat"}),m.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:re?"current":K.showRelativeTime?uy(k.updated_at):null})]}),m.jsx("button",{type:"button",onClick:he=>{he.stopPropagation(),l(k.id)},className:"opacity-0 cursor-pointer group/trash group-hover:opacity-100 p-1 hover:bg-destructive/10 rounded transition-opacity",title:"Remove chat",children:m.jsx(Ef,{size:14,className:"text-muted-foreground group-hover/trash:text-destructive"})})]},k.id)})]},K.label)),e[0]=a,e[1]=l,e[2]=i,e[3]=o,e[4]=u,e[5]=s,e[6]=r,e[7]=f,e[8]=p,e[9]=h,e[10]=g,e[11]=_,e[12]=T,e[13]=E,e[14]=A,e[15]=b,e[16]=w,e[17]=R,e[18]=I}else f=e[7],p=e[8],h=e[9],g=e[10],_=e[11],T=e[12],E=e[13],A=e[14],b=e[15],w=e[16],R=e[17],I=e[18];let L;e[28]!==_||e[29]!==T?(L=m.jsx("div",{className:_,children:T}),e[28]=_,e[29]=T,e[30]=L):L=e[30];let M;e[31]!==f||e[32]!==L||e[33]!==E||e[34]!==A||e[35]!==b?(M=m.jsxs(f,{align:E,className:A,children:[b,L]}),e[31]=f,e[32]=L,e[33]=E,e[34]=A,e[35]=b,e[36]=M):M=e[36];let P;e[37]!==p||e[38]!==M||e[39]!==w||e[40]!==R||e[41]!==I?(P=m.jsxs(p,{onOpenChange:w,children:[R,I,M]}),e[37]=p,e[38]=M,e[39]=w,e[40]=R,e[41]=I,e[42]=P):P=e[42];let S;e[43]!==h||e[44]!==P?(S=m.jsx(h,{children:P}),e[43]=h,e[44]=P,e[45]=S):S=e[45];let B;return e[46]!==g||e[47]!==S?(B=m.jsx(g,{children:S}),e[46]=g,e[47]=S,e[48]=B):B=e[48],B}function cy(){const t=Q.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"size-6 rounded-lg bg-muted animate-pulse"}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsxs("div",{className:"flex items-center gap-3",children:[e,m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("div",{className:"h-3.5 w-28 rounded bg-muted animate-pulse"}),m.jsx("div",{className:"h-3 w-40 rounded bg-muted/60 animate-pulse"})]})]}),t[1]=n):n=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"flex items-center h-12 flex-none border-b border-border/80 px-4",children:m.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[n,m.jsxs("div",{className:"flex items-end gap-2",children:[m.jsx("div",{className:"h-6 w-6 rounded-full bg-muted animate-pulse"}),m.jsx("div",{className:"h-6 w-6 rounded-lg bg-muted animate-pulse"})]})]})}),t[2]=r):r=t[2];let s;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:m.jsxs("div",{className:"mx-auto flex w-full max-w-2xl flex-col gap-4",children:[m.jsx(Cr,{align:"right",width:"w-3/4"}),m.jsx(Cr,{align:"left",width:"w-full",lines:3}),m.jsx(Cr,{align:"right",width:"w-2/3"}),m.jsx(Cr,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=s):s=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:m.jsx("div",{className:"relative flex-1",children:m.jsxs("div",{className:"space-y-2 p-2",children:[m.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),m.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),t[4]=i):i=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("div",{className:"flex items-center gap-1",children:m.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),t[5]=a):a=t[5];let u;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[r,s,m.jsx("div",{className:"px-4 py-4",children:m.jsx("div",{className:"mx-auto w-full max-w-2xl",children:m.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[i,m.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[a,m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),m.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})})]}),t[6]=u):u=t[6],u}function Cr(t){const e=Q.c(22),{align:n,width:r,lines:s}=t,i=r===void 0?"w-full":r,a=s===void 0?1:s,u=n==="right"?"flex-row-reverse":"flex-row";let l;e[0]!==u?(l=ie("flex w-full gap-4 px-4 py-2",u),e[0]=u,e[1]=l):l=e[1];const o=n==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let d;e[2]!==o?(d=ie("flex min-w-0 flex-col gap-2",o),e[2]=o,e[3]=d):d=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=f):f=e[4];const p=n==="right"?"bg-muted":"bg-transparent border border-border/40";let h;e[5]!==p||e[6]!==i?(h=ie("min-w-0 rounded-2xl p-4",p,i),e[5]=p,e[6]=i,e[7]=h):h=e[7];let g;e[8]!==a?(g=Array.from({length:a}),e[8]=a,e[9]=g):g=e[9];let _;e[10]!==a||e[11]!==g?(_=m.jsx("div",{className:"space-y-2",children:g.map((b,w)=>m.jsx("div",{className:ie("h-3 rounded bg-muted-foreground/20 animate-pulse",w===a-1?"w-3/4":"w-full"),style:{animationDelay:`${w*.1}s`}},w))}),e[10]=a,e[11]=g,e[12]=_):_=e[12];let T;e[13]!==_||e[14]!==h?(T=m.jsx("div",{className:h,children:_}),e[13]=_,e[14]=h,e[15]=T):T=e[15];let E;e[16]!==T||e[17]!==d?(E=m.jsxs("div",{className:d,children:[f,T]}),e[16]=T,e[17]=d,e[18]=E):E=e[18];let A;return e[19]!==E||e[20]!==l?(A=m.jsx("div",{className:l,children:E}),e[19]=E,e[20]=l,e[21]=A):A=e[21],A}function dy({messageCount:t,sentinelRef:e}){const n=j.useRef(t),r=j.useRef(0);t>n.current&&r.current!==t&&queueMicrotask(()=>{e.current?.scrollIntoView({behavior:"smooth",block:"start"}),r.current=t}),n.current=t}function $u(t,e){const n=j.Children.toArray(t);for(const r of n)if(j.isValidElement(r)&&r.type===e)return r;return null}function fy(t){const e=Q.c(5),{className:n,children:r}=t;let s;e[0]!==n?(s=ie("flex flex-col h-full w-full bg-sidebar transform-[translateZ(0)]",n),e[0]=n,e[1]=s):s=e[1];let i;return e[2]!==r||e[3]!==s?(i=m.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=i):i=e[4],i}function hy(t){const e=Q.c(7),{children:n}=t;let r;e[0]!==n?(r=$u(n,id),e[0]=n,e[1]=r):r=e[1];const s=r;let i;e[2]!==n?(i=$u(n,ad),e[2]=n,e[3]=i):i=e[3];const a=i;let u;return e[4]!==s||e[5]!==a?(u=m.jsxs("div",{className:"flex h-12 items-center justify-between gap-4 border-b border-border px-4 flex-none",children:[s,a]}),e[4]=s,e[5]=a,e[6]=u):u=e[6],u}function id(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:n}),e[0]=n,e[1]=r):r=e[1],r}function ad(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"flex flex-none items-center gap-1",children:n}),e[0]=n,e[1]=r):r=e[1],r}function py(t){const e=Q.c(5),{children:n,className:r}=t;let s;e[0]!==r?(s=ie("flex-1 min-h-0 overflow-y-auto",r),e[0]=r,e[1]=s):s=e[1];let i;return e[2]!==n||e[3]!==s?(i=m.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=i):i=e[4],i}function my(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"h-full w-full flex items-center justify-center max-w-2xl mx-auto",children:n}),e[0]=n,e[1]=r):r=e[1],r}function gy(t){const e=Q.c(12),{minHeightOffset:n}=t,r=n===void 0?240:n,{messages:s,chatStatus:i}=An(),a=j.useRef(null);let u;e[0]!==s.length?(u={messageCount:s.length,sentinelRef:a},e[0]=s.length,e[1]=u):u=e[1],dy(u);let l;if(e[2]!==s||e[3]!==i){let f;e[5]!==s.length||e[6]!==i?(f=(p,h)=>p.role==="user"?m.jsx(iy,{message:p},p.id):p.role==="assistant"?m.jsx(Q_,{message:p,status:h===s.length-1?i:void 0},p.id):null,e[5]=s.length,e[6]=i,e[7]=f):f=e[7],l=s.map(f),e[2]=s,e[3]=i,e[4]=l}else l=e[4];let o;e[8]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(sd,{children:m.jsx("div",{ref:a,className:"h-0"})}),e[8]=o):o=e[8];let d;return e[9]!==r||e[10]!==l?(d=m.jsxs(J_,{minHeightOffset:r,children:[l,o]}),e[9]=r,e[10]=l,e[11]=d):d=e[11],d}function by(t){const e=Q.c(5),{children:n,className:r}=t;let s;e[0]!==r?(s=ie("flex-none w-full mx-auto p-2","max-w-2xl min-w-0",r),e[0]=r,e[1]=s):s=e[1];let i;return e[2]!==n||e[3]!==s?(i=m.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=i):i=e[4],i}function vs(t){const e=Q.c(24),{title:n,description:r,icon:s,variant:i,onDismiss:a,children:u}=t,l=i===void 0?"default":i;let o,d,f,p,h;if(e[0]!==u||e[1]!==r||e[2]!==s||e[3]!==n||e[4]!==l){const b={default:{container:"border-muted-foreground/30 bg-muted/50 hover:bg-muted transition-colors",icon:"text-muted-foreground",title:"text-muted-foreground",description:"text-muted-foreground/70"},danger:{container:"border-destructive/30 bg-destructive/5",icon:"text-destructive",title:"text-destructive font-medium",description:"text-muted-foreground"},warning:{container:"border-amber-500/30 bg-amber-500/5",icon:"text-amber-600 dark:text-amber-500",title:"text-amber-600 dark:text-amber-500 font-medium",description:"text-muted-foreground"}}[l];p=ie("flex items-start gap-2 px-3 py-2.5 rounded-lg border border-dashed text-sm w-full",b.container),h=s&&m.jsx("div",{className:ie("mt-0.5 shrink-0",b.icon),children:s}),o="flex-1 min-w-0",d=n&&m.jsx("div",{className:ie("text-xs mb-1",b.title),children:n}),f=r&&m.jsx("div",{className:ie("text-xs line-clamp-2",b.description,u?"mb-2":""),children:r}),e[0]=u,e[1]=r,e[2]=s,e[3]=n,e[4]=l,e[5]=o,e[6]=d,e[7]=f,e[8]=p,e[9]=h}else o=e[5],d=e[6],f=e[7],p=e[8],h=e[9];let g;e[10]!==u?(g=u&&m.jsx("div",{className:"flex gap-2",children:u}),e[10]=u,e[11]=g):g=e[11];let _;e[12]!==o||e[13]!==d||e[14]!==f||e[15]!==g?(_=m.jsxs("div",{className:o,children:[d,f,g]}),e[12]=o,e[13]=d,e[14]=f,e[15]=g,e[16]=_):_=e[16];let T;e[17]!==a?(T=a&&m.jsx("button",{type:"button",onClick:a,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0",title:"Dismiss",children:m.jsx(Nd,{size:14})}),e[17]=a,e[18]=T):T=e[18];let E;return e[19]!==p||e[20]!==h||e[21]!==_||e[22]!==T?(E=m.jsxs("div",{className:p,children:[h,_,T]}),e[19]=p,e[20]=h,e[21]=_,e[22]=T,e[23]=E):E=e[23],E}const aA=Object.assign(fy,{Header:Object.assign(hy,{Left:id,Right:ad}),Main:py,Messages:gy,EmptyState:my,Footer:by,Input:V0,Provider:M0,Skeleton:cy,IceBreakers:ap,NoLlmBindingEmptyState:ay,ThreadHistoryPopover:ly});export{aA as C,g0 as G,L0 as M,B_ as R,$e as S,sA as T,An as a,qo as b,uo as c,rA as d,iA as e,eo as i,Tf as u};
|
|
105
|
+
`))}function l(h,g,_,T){const E=_.enter("tableCell"),A=_.enter("phrasing"),b=_.containerPhrasing(h,{...T,before:i,after:i});return A(),E(),b}function o(h,g){return Qx(h,{align:g,alignDelimiters:r,padding:n,stringLength:s})}function d(h,g,_){const T=h.children;let E=-1;const A=[],b=g.enter("table");for(;++E<T.length;)A[E]=f(T[E],g,_);return b(),A}function f(h,g,_){const T=h.children;let E=-1;const A=[],b=g.enter("tableRow");for(;++E<T.length;)A[E]=l(T[E],h,g,_);return b(),A}function p(h,g,_){let T=$c.inlineCode(h,g,_);return _.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function M3(){return{exit:{taskListCheckValueChecked:Uu,taskListCheckValueUnchecked:Uu,paragraph:F3}}}function B3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:U3}}}function Uu(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function F3(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=e.children;let i=-1,a;for(;++i<s.length;){const u=s[i];if(u.type==="paragraph"){a=u;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function U3(t,e,n,r){const s=t.children[0],i=typeof t.checked=="boolean"&&s&&s.type==="paragraph",a="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);i&&u.move(a);let l=$c.listItem(t,e,n,{...r,...u.current()});return i&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,o)),l;function o(d){return d+a}}function H3(){return[Ex(),Ux(),$x(),w3(),M3()]}function j3(t){return{extensions:[Tx(),Hx(t),Yx(),P3(t),B3()]}}const z3={tokenize:W3,partial:!0},Yc={tokenize:Q3,partial:!0},qc={tokenize:X3,partial:!0},Vc={tokenize:Z3,partial:!0},$3={tokenize:K3,partial:!0},Gc={name:"wwwAutolink",tokenize:V3,previous:Qc},Wc={name:"protocolAutolink",tokenize:G3,previous:Xc},Lt={name:"emailAutolink",tokenize:q3,previous:Zc},Nt={};function Y3(){return{text:Nt}}let Wt=48;for(;Wt<123;)Nt[Wt]=Lt,Wt++,Wt===58?Wt=65:Wt===91&&(Wt=97);Nt[43]=Lt;Nt[45]=Lt;Nt[46]=Lt;Nt[95]=Lt;Nt[72]=[Lt,Wc];Nt[104]=[Lt,Wc];Nt[87]=[Lt,Gc];Nt[119]=[Lt,Gc];function q3(t,e,n){const r=this;let s,i;return a;function a(f){return!ii(f)||!Zc.call(r,r.previous)||Qi(r.events)?n(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(f))}function u(f){return ii(f)?(t.consume(f),u):f===64?(t.consume(f),l):n(f)}function l(f){return f===46?t.check($3,d,o)(f):f===45||f===95||Ye(f)?(i=!0,t.consume(f),l):d(f)}function o(f){return t.consume(f),s=!0,l}function d(f){return i&&s&&Ze(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):n(f)}}function V3(t,e,n){const r=this;return s;function s(a){return a!==87&&a!==119||!Qc.call(r,r.previous)||Qi(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(z3,t.attempt(Yc,t.attempt(qc,i),n),n)(a))}function i(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function G3(t,e,n){const r=this;let s="",i=!1;return a;function a(f){return(f===72||f===104)&&Xc.call(r,r.previous)&&!Qi(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),s+=String.fromCodePoint(f),t.consume(f),u):n(f)}function u(f){if(Ze(f)&&s.length<5)return s+=String.fromCodePoint(f),t.consume(f),u;if(f===58){const p=s.toLowerCase();if(p==="http"||p==="https")return t.consume(f),l}return n(f)}function l(f){return f===47?(t.consume(f),i?o:(i=!0,l)):n(f)}function o(f){return f===null||Br(f)||xe(f)||nn(f)||Kr(f)?n(f):t.attempt(Yc,t.attempt(qc,d),n)(f)}function d(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function W3(t,e,n){let r=0;return s;function s(a){return(a===87||a===119)&&r<3?(r++,t.consume(a),s):a===46&&r===3?(t.consume(a),i):n(a)}function i(a){return a===null?n(a):e(a)}}function Q3(t,e,n){let r,s,i;return a;function a(o){return o===46||o===95?t.check(Vc,l,u)(o):o===null||xe(o)||nn(o)||o!==45&&Kr(o)?l(o):(i=!0,t.consume(o),a)}function u(o){return o===95?r=!0:(s=r,r=void 0),t.consume(o),a}function l(o){return s||r||!i?n(o):e(o)}}function X3(t,e){let n=0,r=0;return s;function s(a){return a===40?(n++,t.consume(a),s):a===41&&r<n?i(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?t.check(Vc,e,i)(a):a===null||xe(a)||nn(a)?e(a):(t.consume(a),s)}function i(a){return a===41&&r++,t.consume(a),s}}function Z3(t,e,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),r):u===38?(t.consume(u),i):u===93?(t.consume(u),s):u===60||u===null||xe(u)||nn(u)?e(u):n(u)}function s(u){return u===null||u===40||u===91||xe(u)||nn(u)?e(u):r(u)}function i(u){return Ze(u)?a(u):n(u)}function a(u){return u===59?(t.consume(u),r):Ze(u)?(t.consume(u),a):n(u)}}function K3(t,e,n){return r;function r(i){return t.consume(i),s}function s(i){return Ye(i)?n(i):e(i)}}function Qc(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||xe(t)}function Xc(t){return!Ze(t)}function Zc(t){return!(t===47||ii(t))}function ii(t){return t===43||t===45||t===46||t===95||Ye(t)}function Qi(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const J3={tokenize:u_,partial:!0};function e_(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:s_,continuation:{tokenize:i_},exit:a_}},text:{91:{name:"gfmFootnoteCall",tokenize:r_},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:t_,resolveTo:n_}}}}function t_(t,e,n){const r=this;let s=r.events.length;const i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const l=r.events[s][1];if(l.type==="labelImage"){a=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return u;function u(l){if(!a||!a._balanced)return n(l);const o=bt(r.sliceSerialize({start:a.end,end:r.now()}));return o.codePointAt(0)!==94||!i.includes(o.slice(1))?n(l):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(l),t.exit("gfmFootnoteCallLabelMarker"),e(l))}}function n_(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",s,e],["exit",s,e],["enter",i,e],["enter",a,e],["exit",a,e],["exit",i,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function r_(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i=0,a;return u;function u(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",o)}function o(f){if(i>999||f===93&&!a||f===null||f===91||xe(f))return n(f);if(f===93){t.exit("chunkString");const p=t.exit("gfmFootnoteCallString");return s.includes(bt(r.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(f)}return xe(f)||(a=!0),i++,t.consume(f),f===92?d:o}function d(f){return f===91||f===92||f===93?(t.consume(f),i++,o):o(f)}}function s_(t,e,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i,a=0,u;return l;function l(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),o}function o(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",d):n(g)}function d(g){if(a>999||g===93&&!u||g===null||g===91||xe(g))return n(g);if(g===93){t.exit("chunkString");const _=t.exit("gfmFootnoteDefinitionLabelString");return i=bt(r.sliceSerialize(_)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return xe(g)||(u=!0),a++,t.consume(g),g===92?f:d}function f(g){return g===91||g===92||g===93?(t.consume(g),a++,d):d(g)}function p(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),s.includes(i)||s.push(i),de(t,h,"gfmFootnoteDefinitionWhitespace")):n(g)}function h(g){return e(g)}}function i_(t,e,n){return t.check(mr,e,t.attempt(J3,e,n))}function a_(t){t.exit("gfmFootnoteDefinition")}function u_(t,e,n){const r=this;return de(t,s,"gfmFootnoteDefinitionIndent",5);function s(i){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(i):n(i)}}function o_(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:i,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,u){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let o=l;for(;o--;)if(a[o][0]==="exit"&&a[o][1].type==="strikethroughSequenceTemporary"&&a[o][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[o][1].end.offset-a[o][1].start.offset){a[l][1].type="strikethroughSequence",a[o][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[o][1].start),end:Object.assign({},a[l][1].end)},f={type:"strikethroughText",start:Object.assign({},a[o][1].end),end:Object.assign({},a[l][1].start)},p=[["enter",d,u],["enter",a[o][1],u],["exit",a[o][1],u],["enter",f,u]],h=u.parser.constructs.insideSpan.null;h&<(p,p.length,0,Jr(h,a.slice(o+1,l),u)),lt(p,p.length,0,[["exit",f,u],["enter",a[l][1],u],["exit",a[l][1],u],["exit",d,u]]),lt(a,o-1,l-o+3,p),l=o+p.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function i(a,u,l){const o=this.previous,d=this.events;let f=0;return p;function p(g){return o===126&&d[d.length-1][1].type!=="characterEscape"?l(g):(a.enter("strikethroughSequenceTemporary"),h(g))}function h(g){const _=bn(o);if(g===126)return f>1?l(g):(a.consume(g),f++,h);if(f<2&&!n)return l(g);const T=a.exit("strikethroughSequenceTemporary"),E=bn(g);return T._open=!E||E===2&&!!_,T._close=!_||_===2&&!!E,u(g)}}}class l_{constructor(){this.map=[]}add(e,n,r){c_(this,e,n,r)}consume(e){if(this.map.sort(function(i,a){return i[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let s=r.pop();for(;s;){for(const i of s)e.push(i);s=r.pop()}this.map.length=0}}function c_(t,e,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<t.map.length;){if(t.map[s][0]===e){t.map[s][1]+=n,t.map[s][2].push(...r);return}s+=1}t.map.push([e,n,r])}}function d_(t,e){let n=!1;const r=[];for(;e<t.length;){const s=t[e];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function f_(){return{flow:{null:{name:"table",tokenize:h_,resolveAll:p_}}}}function h_(t,e,n){const r=this;let s=0,i=0,a;return u;function u(S){let B=r.events.length-1;for(;B>-1;){const q=r.events[B][1].type;if(q==="lineEnding"||q==="linePrefix")B--;else break}const $=B>-1?r.events[B][1].type:null,X=$==="tableHead"||$==="tableRow"?I:l;return X===I&&r.parser.lazy[r.now().line]?n(S):X(S)}function l(S){return t.enter("tableHead"),t.enter("tableRow"),o(S)}function o(S){return S===124||(a=!0,i+=1),d(S)}function d(S){return S===null?n(S):ee(S)?i>1?(i=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),h):n(S):oe(S)?de(t,d,"whitespace")(S):(i+=1,a&&(a=!1,s+=1),S===124?(t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),a=!0,d):(t.enter("data"),f(S)))}function f(S){return S===null||S===124||xe(S)?(t.exit("data"),d(S)):(t.consume(S),S===92?p:f)}function p(S){return S===92||S===124?(t.consume(S),f):f(S)}function h(S){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(S):(t.enter("tableDelimiterRow"),a=!1,oe(S)?de(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):g(S))}function g(S){return S===45||S===58?T(S):S===124?(a=!0,t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),_):R(S)}function _(S){return oe(S)?de(t,T,"whitespace")(S):T(S)}function T(S){return S===58?(i+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(S),t.exit("tableDelimiterMarker"),E):S===45?(i+=1,E(S)):S===null||ee(S)?w(S):R(S)}function E(S){return S===45?(t.enter("tableDelimiterFiller"),A(S)):R(S)}function A(S){return S===45?(t.consume(S),A):S===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(S),t.exit("tableDelimiterMarker"),b):(t.exit("tableDelimiterFiller"),b(S))}function b(S){return oe(S)?de(t,w,"whitespace")(S):w(S)}function w(S){return S===124?g(S):S===null||ee(S)?!a||s!==i?R(S):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(S)):R(S)}function R(S){return n(S)}function I(S){return t.enter("tableRow"),L(S)}function L(S){return S===124?(t.enter("tableCellDivider"),t.consume(S),t.exit("tableCellDivider"),L):S===null||ee(S)?(t.exit("tableRow"),e(S)):oe(S)?de(t,L,"whitespace")(S):(t.enter("data"),M(S))}function M(S){return S===null||S===124||xe(S)?(t.exit("data"),L(S)):(t.consume(S),S===92?P:M)}function P(S){return S===92||S===124?(t.consume(S),M):M(S)}}function p_(t,e){let n=-1,r=!0,s=0,i=[0,0,0,0],a=[0,0,0,0],u=!1,l=0,o,d,f;const p=new l_;for(;++n<t.length;){const h=t[n],g=h[1];h[0]==="enter"?g.type==="tableHead"?(u=!1,l!==0&&(Hu(p,e,l,o,d),d=void 0,l=0),o={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",o,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,f=void 0,i=[0,0,0,0],a=[0,n+1,0,0],u&&(u=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},p.add(n,0,[["enter",d,e]])),s=g.type==="tableDelimiterRow"?2:d?3:1):s&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(i[1]!==0&&(a[0]=a[1],f=kr(p,e,i,s,void 0,f),i=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(a[0]=a[1],f=kr(p,e,i,s,void 0,f)),i=a,a=[i[1],n,0,0])):g.type==="tableHead"?(u=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,i[1]!==0?(a[0]=a[1],f=kr(p,e,i,s,n,f)):a[1]!==0&&(f=kr(p,e,a,s,n,f)),s=0):s&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&Hu(p,e,l,o,d),p.consume(e.events),n=-1;++n<e.events.length;){const h=e.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=d_(e.events,n))}return t}function kr(t,e,n,r,s,i){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(i.end=Object.assign({},hn(e.events,n[0])),t.add(n[0],0,[["exit",i,e]]));const l=hn(e.events,n[1]);if(i={type:a,start:Object.assign({},l),end:Object.assign({},l)},t.add(n[1],0,[["enter",i,e]]),n[2]!==0){const o=hn(e.events,n[2]),d=hn(e.events,n[3]),f={type:u,start:Object.assign({},o),end:Object.assign({},d)};if(t.add(n[2],0,[["enter",f,e]]),r!==2){const p=e.events[n[2]],h=e.events[n[3]];if(p[1].end=Object.assign({},h[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,_=n[3]-n[2]-1;t.add(g,_,[])}}t.add(n[3]+1,0,[["exit",f,e]])}return s!==void 0&&(i.end=Object.assign({},hn(e.events,s)),t.add(s,0,[["exit",i,e]]),i=void 0),i}function Hu(t,e,n,r,s){const i=[],a=hn(e.events,n);s&&(s.end=Object.assign({},a),i.push(["exit",s,e])),r.end=Object.assign({},a),i.push(["exit",r,e]),t.add(n+1,0,i)}function hn(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const m_={name:"tasklistCheck",tokenize:b_};function g_(){return{text:{91:m_}}}function b_(t,e,n){const r=this;return s;function s(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),i)}function i(l){return xe(l)?(t.enter("taskListCheckValueUnchecked"),t.consume(l),t.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(t.enter("taskListCheckValueChecked"),t.consume(l),t.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(t.enter("taskListCheckMarker"),t.consume(l),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(l)}function u(l){return ee(l)?e(l):oe(l)?t.check({tokenize:E_},e,n)(l):n(l)}}function E_(t,e,n){return de(t,r,"whitespace");function r(s){return s===null?n(s):e(s)}}function T_(t){return Il([Y3(),e_(),o_(t),f_(),g_()])}const x_={};function __(t){const e=this,n=t||x_,r=e.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(T_(n)),i.push(H3()),a.push(j3(n))}const y_=j.lazy(()=>Td(()=>import("./lazy-highlighter-7Ygumnp-.js"),__vite__mapDeps([0,1,2])));function Kc(){const t=Q.c(3),[e,n]=j.useState(!1);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=async a=>{await navigator.clipboard.writeText(a),n(!0),setTimeout(()=>n(!1),2e3)},t[0]=r):r=t[0];const s=r;let i;return t[1]!==e?(i={handleCopy:s,copied:e},t[1]=e,t[2]=i):i=t[2],i}function A_(){const t=Q.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=[85,70],t[0]=e):e=t[0];const n=e;let r;return t[1]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"p-4 font-mono text-sm",style:{background:"#2d2d2d",borderRadius:"0 0 0.5rem 0.5rem",overflow:"auto",minHeight:"4rem"},children:n.map(k_)}),t[1]=r):r=t[1],r}function k_(t,e){return m.jsxs("div",{className:"flex gap-2 items-center my-1",children:[e>2&&e<7&&m.jsx("div",{className:"w-4 h-4 rounded-sm opacity-40 animate-pulse",style:{background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.1}s`}}),e%4===0&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"3rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.12}s`}}),e%3===1&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"2.5rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.14}s`}}),m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:`${t}%`,background:"rgba(255, 255, 255, 0.1)",animationDelay:`${e*.1}s`}}),e%5===2&&m.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"4rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.16}s`}})]},e)}function C_(t){const e=Q.c(12),n=j.useRef(null),{handleCopy:r,copied:s}=Kc(),i=I_;let a;e[0]!==r?(a=async()=>{const p=i(n.current);await r(p)},e[0]=r,e[1]=a):a=e[1];const u=a;let l;e[2]!==s?(l=s?m.jsx($r,{size:12}):m.jsx(pi,{size:12}),e[2]=s,e[3]=l):l=e[3];let o;e[4]!==u||e[5]!==l?(o=m.jsx("div",{className:"flex justify-end items-center",children:m.jsxs(Me,{variant:"ghost",onClick:u,"aria-label":"Copy as CSV",className:"text-muted-foreground hover:text-foreground h-6 text-[10px]",type:"button",children:["Copy as CSV",l]})}),e[4]=u,e[5]=l,e[6]=o):o=e[6];let d;e[7]!==t?(d=m.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:m.jsx("table",{ref:n,...t,className:"min-w-full border-collapse text-sm",children:t.children})}),e[7]=t,e[8]=d):d=e[8];let f;return e[9]!==o||e[10]!==d?(f=m.jsxs(m.Fragment,{children:[o,d]}),e[9]=o,e[10]=d,e[11]=f):f=e[11],f}function I_(t){return t?Array.from(t.querySelectorAll("tr")).map(N_).join(`
|
|
106
|
+
`):""}function N_(t){return Array.from(t.querySelectorAll("th,td")).map(S_).join(",")}function S_(t){let e=t.textContent||"";return e=e.replace(/"/g,'""'),e.search(/([",\n])/g)>=0&&(e=`"${e}"`),e}const w_=[__],R_=[fx],O_={p:t=>m.jsx("p",{...t,className:"leading-relaxed text-[15px] mb-2 last:mb-0"}),strong:t=>m.jsx("strong",{...t,className:"font-bold"}),em:t=>m.jsx("em",{...t,className:"italic"}),a:t=>m.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-primary-dark hover:underline break-all font-medium"}),ul:t=>m.jsx("ul",{...t,className:"list-disc ml-6 my-4 space-y-2"}),ol:t=>m.jsx("ol",{...t,className:"list-decimal ml-6 my-4 space-y-2"}),li:t=>m.jsx("li",{...t,className:"leading-relaxed text-[15px]"}),code:t=>m.jsx("code",{...t,className:"px-1 py-0.5 bg-muted rounded text-[15px] font-mono break-all"}),pre:t=>m.jsx("pre",{...t,className:"flex w-full min-w-0 my-4 bg-muted rounded overflow-hidden",children:m.jsx("code",{className:"flex-1 min-w-0 p-4 text-[15px] font-mono whitespace-pre overflow-x-auto",children:t.children})}),table:t=>m.jsx(C_,{...t}),thead:t=>m.jsx("thead",{...t,className:"bg-muted",children:t.children}),tr:t=>m.jsx("tr",{...t,className:"even:bg-muted/50 border-b border-border last:border-0"}),th:t=>m.jsx("th",{...t,className:"px-4 py-2 text-left font-semibold text-muted-foreground border-b border-border"}),td:t=>m.jsx("td",{...t,className:"px-4 py-2 border-b border-border"})},Jc=j.memo(t=>{const e=Q.c(2),{content:n}=t;let r;return e[0]!==n?(r=m.jsx(Xb,{remarkPlugins:w_,rehypePlugins:R_,components:O_,children:n}),e[0]=n,e[1]=r):r=e[1],r},(t,e)=>t.content===e.content);function L_(t){const e=Q.c(20),{language:n,content:r}=t,{handleCopy:s,copied:i}=Kc(),a=n||"text";let u;e[0]!==a?(u=m.jsx("span",{className:"text-xs font-mono uppercase text-muted-foreground tracking-widest select-none",children:a}),e[0]=a,e[1]=u):u=e[1];let l;e[2]!==r||e[3]!==s?(l=()=>s(r),e[2]=r,e[3]=s,e[4]=l):l=e[4];let o;e[5]!==i?(o=i?m.jsx($r,{size:14}):m.jsx(pi,{size:14}),e[5]=i,e[6]=o):o=e[6];let d;e[7]!==l||e[8]!==o?(d=m.jsx(Me,{size:"icon",variant:"ghost",onClick:l,"aria-label":"Copy code",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:o}),e[7]=l,e[8]=o,e[9]=d):d=e[9];let f;e[10]!==u||e[11]!==d?(f=m.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 bg-muted border-b border-border",children:[u,d]}),e[10]=u,e[11]=d,e[12]=f):f=e[12];let p;e[13]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(A_,{}),e[13]=p):p=e[13];let h;e[14]!==r||e[15]!==n?(h=m.jsx(j.Suspense,{fallback:p,children:m.jsx(y_,{language:n,content:r})}),e[14]=r,e[15]=n,e[16]=h):h=e[16];let g;return e[17]!==f||e[18]!==h?(g=m.jsxs("div",{className:"my-4 rounded-lg bg-muted overflow-hidden border border-border grid min-w-0",children:[f,h]}),e[17]=f,e[18]=h,e[19]=g):g=e[19],g}Jc.displayName="MemoizedMarkdownBlock";const Xi=t=>{const e=Q.c(7),{id:n,text:r}=t;let s;e[0]!==r?(s=ge.lexer(r),e[0]=r,e[1]=s):s=e[1];const i=s;let a;if(e[2]!==i||e[3]!==n){let u;e[5]!==n?(u=(l,o)=>l.type==="code"?m.jsx(L_,{language:l.lang,content:l.text},`${n}-block_${o}`):m.jsx(Jc,{content:l.raw},`${n}-block_${o}`),e[5]=n,e[6]=u):u=e[6],a=i.map(u),e[2]=i,e[3]=n,e[4]=a}else a=e[4];return a};Xi.displayName="MemoizedMarkdown";function ed(t){const e=Q.c(18),{id:n,part:r,copyable:s,extraActions:i,hasToolCallAfter:a}=t,u=s===void 0?!1:s,l=a===void 0?!1:a,{handleCopy:o}=up(),[d,f]=j.useState(!1);let p;e[0]!==o||e[1]!==r.text?(p=async()=>{await o(r.text),f(!0),setTimeout(()=>f(!1),2e3)},e[0]=o,e[1]=r.text,e[2]=p):p=e[2];const h=p,g=u&&i,_=g||i,T=!l&&"mb-2";let E;e[3]!==T?(E=ie("group/part relative",T),e[3]=T,e[4]=E):E=e[4];let A;e[5]!==n||e[6]!==r.text?(A=m.jsx(Xi,{id:n,text:r.text}),e[5]=n,e[6]=r.text,e[7]=A):A=e[7];let b;e[8]!==i||e[9]!==h||e[10]!==d||e[11]!==_||e[12]!==g?(b=_&&m.jsx("div",{className:"flex w-full items-center text-xs text-muted-foreground opacity-0 pointer-events-none transition-all duration-200 group-hover/part:opacity-100 group-hover/part:pointer-events-auto mt-2",children:m.jsxs("div",{className:"flex items-center gap-1",children:[g&&m.jsx(Me,{onClick:h,variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground size-6 whitespace-nowrap",children:d?m.jsx($r,{size:12}):m.jsx(pi,{size:12})}),i]})}),e[8]=i,e[9]=h,e[10]=d,e[11]=_,e[12]=g,e[13]=b):b=e[13];let w;return e[14]!==E||e[15]!==A||e[16]!==b?(w=m.jsxs("div",{className:E,children:[A,b]}),e[14]=E,e[15]=A,e[16]=b,e[17]=w):w=e[17],w}function v_(t){const e=Q.c(4),{output:n}=t;let r;if(e[0]!==n){const a=JSON.stringify(n,null,2);r=a.length>2e3?a.slice(0,2e3)+"...[TRUNCATED]":a,e[0]=n,e[1]=r}else r=e[1];const s=r;let i;return e[2]!==s?(i=m.jsx("div",{className:"h-full",children:m.jsx(Ku,{code:s,language:"json",height:"100%",readOnly:!0})}),e[2]=s,e[3]=i):i=e[3],i}var os="Collapsible",[D_,rA]=xd(os),[P_,Zi]=D_(os),td=j.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...u}=t,[l,o]=Ad({prop:r,defaultProp:s??!1,onChange:a,caller:os});return m.jsx(P_,{scope:n,disabled:i,contentId:kd(),open:l,onOpenToggle:j.useCallback(()=>o(d=>!d),[o]),children:m.jsx(li.div,{"data-state":ta(l),"data-disabled":i?"":void 0,...u,ref:e})})});td.displayName=os;var nd="CollapsibleTrigger",Ki=j.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=Zi(nd,n);return m.jsx(li.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":ta(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:_d(t.onClick,s.onOpenToggle)})});Ki.displayName=nd;var Ji="CollapsibleContent",ea=j.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Zi(Ji,t.__scopeCollapsible);return m.jsx(yd,{present:n||s.open,children:({present:i})=>m.jsx(M_,{...r,ref:e,present:i})})});ea.displayName=Ji;var M_=j.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,a=Zi(Ji,n),[u,l]=j.useState(r),o=j.useRef(null),d=Cd(e,o),f=j.useRef(0),p=f.current,h=j.useRef(0),g=h.current,_=a.open||u,T=j.useRef(_),E=j.useRef(void 0);return j.useEffect(()=>{const A=requestAnimationFrame(()=>T.current=!1);return()=>cancelAnimationFrame(A)},[]),Id(()=>{const A=o.current;if(A){E.current=E.current||{transitionDuration:A.style.transitionDuration,animationName:A.style.animationName},A.style.transitionDuration="0s",A.style.animationName="none";const b=A.getBoundingClientRect();f.current=b.height,h.current=b.width,T.current||(A.style.transitionDuration=E.current.transitionDuration,A.style.animationName=E.current.animationName),l(r)}},[a.open,r]),m.jsx(li.div,{"data-state":ta(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!_,...i,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...t.style},children:_&&s})});function ta(t){return t?"open":"closed"}var B_=td,sA=Ki,iA=ea;function F_(t){const e=Q.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(B_,{"data-slot":"collapsible",...n}),e[2]=n,e[3]=r):r=e[3],r}function U_(t){const e=Q.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(Ki,{"data-slot":"collapsible-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function H_(t){const e=Q.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(ea,{"data-slot":"collapsible-content",...n}),e[2]=n,e[3]=r):r=e[3],r}function j_(t){return t.split(/[_-]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function ju(t){const e=Q.c(70),{part:n,isFirstInSequence:r,isLastInSequence:s,hasNextToolCall:i}=t,a=r===void 0?!1:r,u=s===void 0?!1:s,l=i===void 0?!1:i,{state:o}=n;let d;e[0]!==n?(d="toolName"in n?n.toolName:n.type.replace("tool-",""),e[0]=n,e[1]=d):d=e[1];const f=d;let p;e[2]!==f?(p=j_(f),e[2]=f,e[3]=p):p=e[3];const h=p,[g,_]=j.useState(!1),[T]=zd(),E=(o==="input-streaming"||o==="input-available"||o==="output-available")&&!!n.input,A=o==="output-available",b=o==="output-error";if(!T){const ve=o==="input-streaming"||o==="input-available",fe=o==="output-available",Ge=o==="output-error",Ie=a&&"mt-2",Ne=u&&"mb-2";let ye;e[4]!==Ie||e[5]!==Ne?(ye=ie("flex items-center gap-1.5 py-2 opacity-75 relative",Ie,Ne),e[4]=Ie,e[5]=Ne,e[6]=ye):ye=e[6];let Fe;e[7]===Symbol.for("react.memo_cache_sentinel")?(Fe=m.jsx(Ju,{className:"size-4 text-muted-foreground shrink-0"}),e[7]=Fe):Fe=e[7];let Re;e[8]!==l?(Re=l&&m.jsx("div",{className:"absolute left-1/2 top-full w-px bg-border -translate-x-1/2",style:{height:"calc(100% + 1rem)"}}),e[8]=l,e[9]=Re):Re=e[9];let De;e[10]!==Re?(De=m.jsxs("div",{className:"relative shrink-0 flex items-center",children:[Fe,Re]}),e[10]=Re,e[11]=De):De=e[11];let Oe;e[12]!==h||e[13]!==ve?(Oe=ve&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted-foreground shimmer",children:"Calling"})," ",m.jsxs("span",{className:"text-muted-foreground/75 shimmer",children:[h,"..."]})]}),e[12]=h,e[13]=ve,e[14]=Oe):Oe=e[14];let Ue;e[15]!==h||e[16]!==fe?(Ue=fe&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted-foreground",children:"Called"})," ",m.jsx("span",{className:"text-muted-foreground/75",children:h})]}),e[15]=h,e[16]=fe,e[17]=Ue):Ue=e[17];let Se;e[18]!==h||e[19]!==Ge?(Se=Ge&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-destructive/90",children:"Error calling"})," ",m.jsx("span",{className:"text-destructive/75",children:h})]}),e[18]=h,e[19]=Ge,e[20]=Se):Se=e[20];let He;e[21]!==Oe||e[22]!==Ue||e[23]!==Se?(He=m.jsxs("span",{className:"text-[15px]",children:[Oe,Ue,Se]}),e[21]=Oe,e[22]=Ue,e[23]=Se,e[24]=He):He=e[24];let We;return e[25]!==De||e[26]!==He||e[27]!==ye?(We=m.jsxs("div",{className:ye,children:[De,He]}),e[25]=De,e[26]=He,e[27]=ye,e[28]=We):We=e[28],We}let w;e[29]!==o?(w=o==="output-error"?m.jsx(Gu,{className:"size-4 text-destructive shrink-0"}):m.jsx(af,{className:ie("size-4 text-muted-foreground shrink-0",(o==="input-streaming"||o==="input-available")&&"shimmer")}),e[29]=o,e[30]=w):w=e[30];const R=o==="output-error"&&"text-destructive/90",I=(o==="input-streaming"||o==="input-available")&&"shimmer";let L;e[31]!==R||e[32]!==I?(L=ie("text-[15px] font-medium text-muted-foreground truncate",R,I),e[31]=R,e[32]=I,e[33]=L):L=e[33];const M=o==="input-streaming"&&`Streaming ${f} arguments`,P=o==="input-available"&&`Calling ${f}`,S=o==="output-available"&&`Called ${f}`,B=o==="output-error"&&`Error calling ${f}`;let $;e[34]!==M||e[35]!==P||e[36]!==S||e[37]!==B||e[38]!==L?($=m.jsxs("span",{className:L,children:[M,P,S,B]}),e[34]=M,e[35]=P,e[36]=S,e[37]=B,e[38]=L,e[39]=$):$=e[39];let X;e[40]!==$||e[41]!==w?(X=m.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[w,$]}),e[40]=$,e[41]=w,e[42]=X):X=e[42];const q=g&&"rotate-90";let U;e[43]!==q?(U=ie("size-4 text-muted-foreground transition-transform duration-200",q),e[43]=q,e[44]=U):U=e[44];let W;e[45]!==U?(W=m.jsx("div",{className:"flex items-center gap-2 shrink-0",children:m.jsx(Xu,{className:U})}),e[45]=U,e[46]=W):W=e[46];let V;e[47]!==X||e[48]!==W?(V=m.jsxs(U_,{className:"flex items-center gap-2 w-full cursor-pointer p-3 hover:bg-accent/50 transition-colors",children:[X,W]}),e[47]=X,e[48]=W,e[49]=V):V=e[49];let K;e[50]===Symbol.for("react.memo_cache_sentinel")?(K=m.jsx("div",{className:"w-4 relative shrink-0",children:m.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-0.25 bg-border"})}),e[50]=K):K=e[50];let J;e[51]!==n.input||e[52]!==E?(J=E&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Input"})}),m.jsx("div",{className:"border border-border rounded-lg p-2 h-full max-h-[200px]",children:m.jsx(Ku,{code:JSON.stringify(n.input,null,2),language:"json",foldOnMount:!0,height:"100%",readOnly:!0})})]}),e[51]=n.input,e[52]=E,e[53]=J):J=e[53];let k;e[54]!==n.output||e[55]!==A?(k=A&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Output"})}),m.jsx("div",{className:"border border-border rounded-lg max-h-[200px] overflow-auto p-2 h-full",children:m.jsx(v_,{output:n.output})})]}),e[54]=n.output,e[55]=A,e[56]=k):k=e[56];let re;e[57]!==n||e[58]!==b?(re=b&&m.jsxs("div",{className:"flex flex-col gap-0.5",children:[m.jsx("div",{className:"px-1 h-5 flex items-center",children:m.jsx("span",{className:"text-xs font-medium text-destructive/90",children:"Error"})}),m.jsx("div",{className:"border border-destructive/20 rounded-lg max-h-[200px] overflow-auto p-2 bg-destructive/10",children:m.jsx("pre",{className:"text-xs font-mono text-destructive whitespace-pre-wrap wrap-break-word",children:"errorText"in n&&typeof n.errorText=="string"?n.errorText:"An unknown error occurred"})})]}),e[57]=n,e[58]=b,e[59]=re):re=e[59];let he;e[60]!==J||e[61]!==k||e[62]!==re?(he=m.jsx(H_,{className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden",children:m.jsxs("div",{className:"flex ml-[7px] px-3 pb-3",children:[K,m.jsxs("div",{className:"flex flex-col gap-4 flex-1 min-w-0 pt-2",children:[J,k,re]})]})}),e[60]=J,e[61]=k,e[62]=re,e[63]=he):he=e[63];let N;e[64]!==V||e[65]!==he?(N=m.jsxs("div",{className:"border border-border/75 rounded-lg flex flex-col bg-background w-full min-w-0 overflow-hidden",children:[V,he]}),e[64]=V,e[65]=he,e[66]=N):N=e[66];let Ee;return e[67]!==g||e[68]!==N?(Ee=m.jsx("div",{className:"flex flex-col my-4 w-full min-w-0",children:m.jsx(F_,{open:g,onOpenChange:_,children:N})}),e[67]=g,e[68]=N,e[69]=Ee):Ee=e[69],Ee}const z_={planning:{icon:m.jsx(oo,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Planning next moves"},thinking:{icon:m.jsx(qr,{className:"text-muted-foreground shrink-0 animate-pulse",size:14}),label:"Thinking"}},$_=1200;function Y_(){const t=Q.c(7),[e,n]=j.useState("planning");let r,s;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const l=setTimeout(()=>{n("thinking")},$_);return()=>{clearTimeout(l)}},s=[],t[0]=r,t[1]=s):(r=t[0],s=t[1]),j.useEffect(r,s);const i=z_[e];let a;t[2]!==i.label?(a=m.jsxs("span",{className:"text-[15px] text-muted-foreground shimmer",children:[i.label,"..."]}),t[2]=i.label,t[3]=a):a=t[3];let u;return t[4]!==i.icon||t[5]!==a?(u=m.jsx("div",{className:"flex items-center gap-1.5 py-2 opacity-60",children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[i.icon,a]})}),t[4]=i.icon,t[5]=a,t[6]=u):u=t[6],u}function q_(t){const e=Q.c(10),{duration:n,parts:r,id:s}=t,i=n/1e3;let a;e[0]!==i?(a=i.toFixed(1),e[0]=i,e[1]=a):a=e[1];const u=a,[l,o]=j.useState(!1),[d,f]=j.useState(!1);let p;if(e[2]!==s||e[3]!==d||e[4]!==l||e[5]!==r||e[6]!==u){const h=r.filter(G_),g=h.some(V_),_=g||d;let T,E;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>o(!0),E=()=>o(!1),e[8]=T,e[9]=E):(T=e[8],E=e[9]),p=m.jsxs("div",{className:"flex flex-col mb-2",children:[m.jsx("button",{type:"button",onClick:()=>!g&&f(!d),onMouseEnter:T,onMouseLeave:E,className:ie("flex items-center gap-1.5 py-2 opacity-60 transition-opacity",!g&&"cursor-pointer hover:opacity-100",g&&"cursor-default"),children:m.jsxs("span",{className:"flex items-center gap-1.5",children:[g?m.jsx(qr,{className:"text-muted-foreground shrink-0 shimmer",size:14}):l?m.jsx(Xu,{className:ie("text-muted-foreground transition-transform shrink-0",d&&"rotate-90"),size:14}):m.jsx(io,{className:"text-muted-foreground shrink-0",size:14}),m.jsx("span",{className:ie("text-[15px] text-muted-foreground",g&&"shimmer"),children:g?"Thinking...":`Thought for ${u}s`})]})}),_&&m.jsx("div",{className:"ml-[6px] border-l-2 pl-4 mt-1 mb-2 max-h-[300px] overflow-y-auto",children:h.map((A,b)=>m.jsx("div",{className:"text-muted-foreground markdown-sm pb-2",children:m.jsx(Xi,{id:`${s}-reasoning-${b}`,text:A.text})},`${s}-reasoning-${b}`))})]}),e[2]=s,e[3]=d,e[4]=l,e[5]=r,e[6]=u,e[7]=p}else p=e[7];return p}function V_(t){return t.state==="streaming"}function G_(t){return t.type==="reasoning"}function W_(t){const e=Q.c(17),{part:n,id:r,usageStats:s,isFollowedByToolCall:i,isFirstToolCallInSequence:a,isLastToolCallInSequence:u,hasNextToolCall:l}=t;switch(n.type){case"dynamic-tool":{let o;return e[0]!==l||e[1]!==r||e[2]!==a||e[3]!==u||e[4]!==n?(o=m.jsx(ju,{part:n,id:r,isFirstInSequence:a,isLastInSequence:u,hasNextToolCall:l}),e[0]=l,e[1]=r,e[2]=a,e[3]=u,e[4]=n,e[5]=o):o=e[5],o}case"text":{let o;return e[6]!==r||e[7]!==i||e[8]!==n||e[9]!==s?(o=m.jsx(ed,{id:r,part:n,extraActions:s,copyable:!0,hasToolCallAfter:i}),e[6]=r,e[7]=i,e[8]=n,e[9]=s,e[10]=o):o=e[10],o}case"reasoning":return null;case"step-start":case"file":case"source-url":case"source-document":return null;default:if(n.type.startsWith("tool-")){const o=n;let d;return e[11]!==l||e[12]!==r||e[13]!==a||e[14]!==u||e[15]!==o?(d=m.jsx(ju,{part:o,id:r,isFirstInSequence:a,isLastInSequence:u,hasNextToolCall:l}),e[11]=l,e[12]=r,e[13]=a,e[14]=u,e[15]=o,e[16]=d):d=e[16],d}}throw new Error(`Unknown part type: ${n.type}`)}function Q_(t){const e=Q.c(24),{message:n,status:r,className:s}=t,{id:i,parts:a}=n,o=r==="streaming"||r==="submitted",d=a.length>0;let f;e[0]!==a?(f=a.some(Z_),e[0]=a,e[1]=f):f=e[1];const p=f;let h;e[2]!==o||e[3]!==a?(h=o&&a.some(X_),e[2]=o,e[3]=a,e[4]=h):h=e[4];const g=h;let _;if(e[5]!==n.metadata){const M=n.metadata?.reasoning_start_at?new Date(n.metadata.reasoning_start_at):null,P=n.metadata?.reasoning_end_at?new Date(n.metadata.reasoning_end_at):null;_=M!==null?(P??new Date).getTime()-M.getTime():null,e[5]=n.metadata,e[6]=_}else _=e[6];const T=_,E=d&&(p||g)&&T!==null;let A;e[7]!==n?(A=m.jsx(Zo,{messages:[n]}),e[7]=n,e[8]=A):A=e[8];const b=A;let w;e[9]!==s?(w=ie("w-full min-w-0 group relative flex items-start gap-4 px-4 z-20 text-foreground flex-row",s),e[9]=s,e[10]=w):w=e[10];let R;e[11]!==T||e[12]!==d||e[13]!==i||e[14]!==o||e[15]!==a||e[16]!==E||e[17]!==b?(R=d?m.jsxs(m.Fragment,{children:[E&&m.jsx(q_,{duration:T,parts:a,id:i}),a.map((M,P)=>{const S=a[P+1],B=a[P-1],$=S&&(S.type==="dynamic-tool"||S.type.startsWith("tool-")),X=M.type==="dynamic-tool"||M.type.startsWith("tool-"),q=B&&(B.type==="dynamic-tool"||B.type.startsWith("tool-")),U=S&&(S.type==="dynamic-tool"||S.type.startsWith("tool-")),W=X&&!q,V=X&&!U,K=X&&U;return m.jsx(W_,{part:M,id:i,usageStats:P===a.length-1?b:void 0,isFollowedByToolCall:$,isFirstToolCallInSequence:W,isLastToolCallInSequence:V,hasNextToolCall:K},`${i}-${P}`)})]}):o?m.jsx(Y_,{}):null,e[11]=T,e[12]=d,e[13]=i,e[14]=o,e[15]=a,e[16]=E,e[17]=b,e[18]=R):R=e[18];let I;e[19]!==R?(I=m.jsx("div",{className:"flex flex-col min-w-0 w-full items-start",children:m.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-[15px] wrap-break-word overflow-wrap-anywhere bg-transparent",children:R})}),e[19]=R,e[20]=I):I=e[20];let L;return e[21]!==w||e[22]!==I?(L=m.jsx("div",{className:w,children:I}),e[21]=w,e[22]=I,e[23]=L):L=e[23],L}function X_(t){return t.type==="reasoning"&&t.state==="streaming"}function Z_(t){return t.type==="reasoning"}const rd=j.createContext(null);function sd(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx(m.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function K_(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(!j.isValidElement(r))continue;if(r.props?.message?.role==="assistant"){const i=t[n-1],a=j.isValidElement(i)&&i.props?.message?.role,u=i&&j.isValidElement(i)&&a==="user"?i:null;e.push({user:u,assistant:r})}}return e}function J_(t){const e=Q.c(27),{children:n,className:r,minHeightOffset:s}=t,i=j.useRef(null);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],e[0]=a):a=e[0];const u=j.useRef(a);let l,o,d,f,p,h,g;if(e[1]!==n||e[2]!==r||e[3]!==s){const A=j.Children.toArray(n),b=A[A.length-1];o=b&&j.isValidElement(b)&&b.type===sd?b:null;const w=o?A.slice(0,-1):A,R=K_(w);let I;e[11]===Symbol.for("react.memo_cache_sentinel")?(I=M=>{const P=u.current[M];if(P&&i.current){const S=i.current.offsetTop,B=P.offsetTop;i.current.scrollTo({top:B-S,behavior:"smooth"})}},e[11]=I):I=e[11];const L=I;l=rd.Provider,e[12]===Symbol.for("react.memo_cache_sentinel")?(g={scrollToPair:L},e[12]=g):g=e[12],p=i,e[13]!==r?(h=ie("w-full min-w-0 max-w-full overflow-y-auto h-full overflow-x-hidden",r),e[13]=r,e[14]=h):h=e[14],d="flex flex-col min-w-0 max-w-2xl mx-auto w-full",f=R.map((M,P)=>{const S=P===R.length-1;return m.jsxs("div",{ref:B=>{u.current[P]=B},className:"flex flex-col pb-2",style:S&&s?{minHeight:`calc(100vh - ${s}px)`}:void 0,children:[m.jsx("div",{className:"sticky top-0 z-50 bg-background w-full h-4"}),m.jsx("div",{className:"sticky mb-3 top-4 z-50",children:M.user&&j.isValidElement(M.user)?j.cloneElement(M.user,{pairIndex:P}):M.user}),M.assistant]},P)}),e[1]=n,e[2]=r,e[3]=s,e[4]=l,e[5]=o,e[6]=d,e[7]=f,e[8]=p,e[9]=h,e[10]=g}else l=e[4],o=e[5],d=e[6],f=e[7],p=e[8],h=e[9],g=e[10];let _;e[15]!==o||e[16]!==d||e[17]!==f?(_=m.jsxs("div",{className:d,children:[f,o]}),e[15]=o,e[16]=d,e[17]=f,e[18]=_):_=e[18];let T;e[19]!==p||e[20]!==h||e[21]!==_?(T=m.jsx("div",{ref:p,className:h,children:_}),e[19]=p,e[20]=h,e[21]=_,e[22]=T):T=e[22];let E;return e[23]!==l||e[24]!==g||e[25]!==T?(E=m.jsx(l,{value:g,children:T}),e[23]=l,e[24]=g,e[25]=T,e[26]=E):E=e[26],E}function ey(t){const e=Q.c(5),{locator:n}=zt(),r=Yo(),s=$o();let i;return e[0]!==n||e[1]!==r||e[2]!==t||e[3]!==s?(i=async(u,l,o)=>{const d=await jo(n,o),f=d.findIndex(T=>T.id===u);if(f===-1){console.warn(`[branch] Message ${u} not found in thread ${o}`);return}const p=d.slice(0,f).filter(ty),h=crypto.randomUUID(),g=new Date().toISOString(),_={id:h,title:"",created_at:g,updated_at:g,hidden:!1};if(await s.insert.mutateAsync(_),p.length>0){const T=p.map(E=>({...E,id:crypto.randomUUID(),metadata:{...E.metadata,thread_id:h,created_at:E.metadata?.created_at||g}}));await r.insertMany.mutateAsync(T)}t(h)},e[0]=n,e[1]=r,e[2]=t,e[3]=s,e[4]=i):i=e[4],i}function ty(t){return t.role!=="system"}function ny(t){const e=Q.c(18),{messageId:n,parts:r}=t,[s,i]=j.useState(!1),{setInputValue:a,startBranch:u,setActiveThreadId:l,activeThreadId:o}=An(),d=ey(l);let f;e[0]!==r?(f=r.filter(sy).map(ry).join(`
|
|
107
|
+
`),e[0]=r,e[1]=f):f=e[1];const p=f;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=I=>{I.stopPropagation(),i(!0)},e[2]=h):h=e[2];const g=h;let _;e[3]!==o||e[4]!==d||e[5]!==n||e[6]!==p||e[7]!==a||e[8]!==u?(_=async()=>{await d(n,p,o),a(p),u({originalThreadId:o,originalMessageId:n,originalMessageText:p}),i(!1)},e[3]=o,e[4]=d,e[5]=n,e[6]=p,e[7]=a,e[8]=u,e[9]=_):_=e[9];const T=_;let E;e[10]===Symbol.for("react.memo_cache_sentinel")?(E=m.jsx("div",{className:"flex justify-center items-end px-2 pb-1",children:m.jsxs(yn,{children:[m.jsx(_n,{asChild:!0,children:m.jsx(Me,{onClick:g,variant:"ghost",size:"xs",className:"opacity-0 group-hover:opacity-100 hover:bg-gray-200/70 rounded-md transition-opacity text-muted-foreground hover:text-foreground aspect-square w-6 h-6 p-0",children:m.jsx(so,{size:16,className:"p-0.5"})})}),m.jsx(xn,{side:"bottom",children:"Edit message"})]})}),e[10]=E):E=e[10];let A;e[11]===Symbol.for("react.memo_cache_sentinel")?(A=m.jsxs(uf,{children:[m.jsx(of,{children:"Edit message?"}),m.jsx(lf,{children:"This will create a new conversation branch from this point. The original conversation will remain unchanged."})]}),e[11]=A):A=e[11];let b;e[12]===Symbol.for("react.memo_cache_sentinel")?(b=m.jsx(cf,{children:"Cancel"}),e[12]=b):b=e[12];let w;e[13]!==T?(w=m.jsxs(df,{children:[A,m.jsxs(ff,{children:[b,m.jsx(hf,{onClick:T,children:"Confirm"})]})]}),e[13]=T,e[14]=w):w=e[14];let R;return e[15]!==s||e[16]!==w?(R=m.jsxs(m.Fragment,{children:[E,m.jsx(pf,{open:s,onOpenChange:i,children:w})]}),e[15]=s,e[16]=w,e[17]=R):R=e[17],R}function ry(t){return t.text}function sy(t){return t.type==="text"}function iy(t){const e=Q.c(29),{message:n,className:r,pairIndex:s}=t,{id:i,parts:a}=n,u=j.useContext(rd),[l,o]=j.useState(!1);if(!a||a.length===0)return null;let d;e[0]!==u||e[1]!==s?(d=()=>{o(!0),s!==void 0&&u?.scrollToPair(s)},e[0]=u,e[1]=s,e[2]=d):d=e[2];const f=d;let p;e[3]!==r?(p=ie("message-block w-full min-w-0 group relative flex items-start gap-4 px-2.5 text-foreground flex-row-reverse",r),e[3]=r,e[4]=p):p=e[4];let h,g;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=()=>o(!0),g=()=>o(!1),e[5]=h,e[6]=g):(h=e[5],g=e[6]);const _=l?"overflow-auto opacity-100":"overflow-hidden opacity-99 mask-b-from-1%";let T;e[7]!==_?(T=ie("z-10 px-4 py-2 transition-opacity max-h-[120px] flex-1",_),e[7]=_,e[8]=T):T=e[8];let E;if(e[9]!==i||e[10]!==a){let L;e[12]!==i?(L=(M,P)=>M.type==="text"?m.jsx(ed,{id:i,part:M},`${i}-${P}`):null,e[12]=i,e[13]=L):L=e[13],E=a.map(L),e[9]=i,e[10]=a,e[11]=E}else E=e[11];let A;e[14]!==E?(A=m.jsx("div",{children:E}),e[14]=E,e[15]=A):A=e[15];let b;e[16]!==T||e[17]!==A?(b=m.jsx("div",{className:T,children:A}),e[16]=T,e[17]=A,e[18]=b):b=e[18];let w;e[19]!==i||e[20]!==a?(w=m.jsx(ny,{messageId:i,parts:a}),e[19]=i,e[20]=a,e[21]=w):w=e[21];let R;e[22]!==f||e[23]!==w||e[24]!==b?(R=m.jsxs("div",{tabIndex:0,onClick:f,onFocus:h,onBlur:g,className:"w-full border min-w-0 shadow-xs rounded-lg text-[0.9375rem] wrap-break-word overflow-wrap-anywhere bg-background cursor-pointer transition-colors relative flex outline-none",children:[b,w]}),e[22]=f,e[23]=w,e[24]=b,e[25]=R):R=e[25];let I;return e[26]!==R||e[27]!==p?(I=m.jsx(m.Fragment,{children:m.jsx("div",{className:p,children:R})}),e[26]=R,e[27]=p,e[28]=I):I=e[28],I}function ay({title:t="No model provider connected",description:e="Connect to a model provider to unlock AI-powered features.",org:n}){const[r,s]=j.useState(!1),i=Ud(),a=Vu(),{data:u}=qu.useSession(),l=Wu(),o=u?.user?.id??"",d=()=>{a({to:"/$org/mcps",params:{org:n.slug},search:{action:"create"}})},f=async()=>{if(!n.id||!o){Kn.error("Not authenticated");return}s(!0);try{const p=l?.find(_=>_.connection_url===gf);if(p){a({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:p.id}});return}const h=bf({id:Ef("conn")}),g=await i.create.mutateAsync(h);a({to:"/$org/mcps/$connectionId",params:{org:n.slug,connectionId:g.id}})}catch(p){Kn.error(`Failed to connect OpenRouter: ${p instanceof Error?p.message:String(p)}`)}finally{s(!1)}};return m.jsx(Sd,{image:m.jsx("img",{src:"/empty-state-openrouter.svg",alt:"",width:336,height:320,"aria-hidden":"true",className:"w-xs h-auto mask-radial-[100%_100%] mask-radial-from-20% mask-radial-to-50% mask-radial-at-center"}),title:t,description:e,actions:m.jsxs(m.Fragment,{children:[m.jsxs(Me,{variant:"outline",onClick:f,disabled:r,children:[m.jsx("img",{src:mf,alt:"OpenRouter",className:"size-4"}),r?"Installing...":"Install OpenRouter"]}),m.jsx(Me,{variant:"outline",onClick:d,children:"Install Connection"})]})})}function uy(t){const e=new Date(t),r=new Date().getTime()-e.getTime(),s=Math.floor(r/6e4),i=Math.floor(r/36e5);return s<1?"now":s<60?`${s}m`:`${i}h`}function oy(t){const e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(n.getTime()-864e5),s=new Date(n.getTime()-7*864e5),i=new Date(n.getTime()-30*864e5),a=[],u=[],l=[],o=[],d=[];for(const p of t){const h=new Date(p.updated_at);h>=n?a.push(p):h>=r?u.push(p):h>=s?l.push(p):h>=i?o.push(p):d.push(p)}const f=[];return a.length>0&&f.push({label:"Today",threads:a,showRelativeTime:!0}),u.length>0&&f.push({label:"Yesterday",threads:u,showRelativeTime:!1}),l.length>0&&f.push({label:"7 days ago",threads:l,showRelativeTime:!1}),o.length>0&&f.push({label:"30 days ago",threads:o,showRelativeTime:!1}),d.length>0&&f.push({label:"Older",threads:d,showRelativeTime:!1}),f}function ly(t){const e=Q.c(49),{variant:n}=t,r=n===void 0?"icon":n,{threads:s,refetch:i}=zo(),{activeThreadId:a,setActiveThreadId:u,hideThread:l}=An(),[o,d]=j.useState("");let f,p,h,g,_,T,E,A,b,w,R,I;if(e[0]!==a||e[1]!==l||e[2]!==i||e[3]!==o||e[4]!==u||e[5]!==s||e[6]!==r){const $=o.trim()?s.filter(K=>(K.title||"New chat").toLowerCase().includes(o.toLowerCase())):s,X=oy($);let q;e[19]!==i?(q=K=>{K?i():d("")},e[19]=i,e[20]=q):q=e[20];const U=q;g=hi,h=yn,p=lr,w=U,e[21]!==r?(R=m.jsx(_n,{asChild:!0,children:m.jsx(ur,{asChild:!0,children:r==="outline"?m.jsx(Me,{type:"button",variant:"outline",size:"icon",className:"size-7 border border-input","aria-label":"Chat history",children:m.jsx(na,{size:16})}):m.jsx(Me,{type:"button",variant:"ghost",size:"icon",className:"size-6 p-1 hover:bg-transparent","aria-label":"Chat history",children:m.jsx(na,{size:16,className:"text-muted-foreground hover:text-foreground transition-colors"})})})}),e[21]=r,e[22]=R):R=e[22],e[23]===Symbol.for("react.memo_cache_sentinel")?(I=m.jsx(xn,{children:"Chat history"}),e[23]=I):I=e[23],f=or,E="end",A="w-80 p-0";let W;e[24]===Symbol.for("react.memo_cache_sentinel")?(W=m.jsx(Yr,{size:16,className:"text-muted-foreground shrink-0"}),e[24]=W):W=e[24];let V;e[25]===Symbol.for("react.memo_cache_sentinel")?(V=K=>d(K.target.value),e[25]=V):V=e[25],e[26]!==o?(b=m.jsx("div",{className:"border-b",children:m.jsxs("label",{className:"flex items-center gap-2.5 h-12 px-4 cursor-text",children:[W,m.jsx("input",{type:"text",placeholder:"Search chats...",value:o,onChange:V,className:"flex-1 border-0 shadow-none focus:outline-none px-0 h-full text-sm placeholder:text-muted-foreground/50 bg-transparent"})]})}),e[26]=o,e[27]=b):b=e[27],_="max-h-[300px] overflow-y-auto",T=$.length===0?m.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:o.trim()?"No chats found":"No chats yet"}):X.map((K,J)=>m.jsxs("div",{children:[J>0&&m.jsx("div",{className:"border-t mx-3"}),m.jsx("div",{className:"px-3 py-1",children:m.jsx("span",{className:"text-xs font-medium text-muted-foreground tracking-wide",children:K.label})}),K.threads.map(k=>{const re=k.id===a;return m.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 hover:bg-accent cursor-pointer group ${re?"bg-accent/50":""}`,onClick:()=>u(k.id),children:[m.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[m.jsx("span",{className:"text-sm truncate",children:k.title||"New chat"}),m.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:re?"current":K.showRelativeTime?uy(k.updated_at):null})]}),m.jsx("button",{type:"button",onClick:he=>{he.stopPropagation(),l(k.id)},className:"opacity-0 cursor-pointer group/trash group-hover:opacity-100 p-1 hover:bg-destructive/10 rounded transition-opacity",title:"Remove chat",children:m.jsx(Tf,{size:14,className:"text-muted-foreground group-hover/trash:text-destructive"})})]},k.id)})]},K.label)),e[0]=a,e[1]=l,e[2]=i,e[3]=o,e[4]=u,e[5]=s,e[6]=r,e[7]=f,e[8]=p,e[9]=h,e[10]=g,e[11]=_,e[12]=T,e[13]=E,e[14]=A,e[15]=b,e[16]=w,e[17]=R,e[18]=I}else f=e[7],p=e[8],h=e[9],g=e[10],_=e[11],T=e[12],E=e[13],A=e[14],b=e[15],w=e[16],R=e[17],I=e[18];let L;e[28]!==_||e[29]!==T?(L=m.jsx("div",{className:_,children:T}),e[28]=_,e[29]=T,e[30]=L):L=e[30];let M;e[31]!==f||e[32]!==L||e[33]!==E||e[34]!==A||e[35]!==b?(M=m.jsxs(f,{align:E,className:A,children:[b,L]}),e[31]=f,e[32]=L,e[33]=E,e[34]=A,e[35]=b,e[36]=M):M=e[36];let P;e[37]!==p||e[38]!==M||e[39]!==w||e[40]!==R||e[41]!==I?(P=m.jsxs(p,{onOpenChange:w,children:[R,I,M]}),e[37]=p,e[38]=M,e[39]=w,e[40]=R,e[41]=I,e[42]=P):P=e[42];let S;e[43]!==h||e[44]!==P?(S=m.jsx(h,{children:P}),e[43]=h,e[44]=P,e[45]=S):S=e[45];let B;return e[46]!==g||e[47]!==S?(B=m.jsx(g,{children:S}),e[46]=g,e[47]=S,e[48]=B):B=e[48],B}function cy(){const t=Q.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx("div",{className:"size-6 rounded-lg bg-muted animate-pulse"}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsxs("div",{className:"flex items-center gap-3",children:[e,m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("div",{className:"h-3.5 w-28 rounded bg-muted animate-pulse"}),m.jsx("div",{className:"h-3 w-40 rounded bg-muted/60 animate-pulse"})]})]}),t[1]=n):n=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("div",{className:"flex items-center h-12 flex-none border-b border-border/80 px-4",children:m.jsxs("div",{className:"flex items-center justify-between gap-3 w-full",children:[n,m.jsxs("div",{className:"flex items-end gap-2",children:[m.jsx("div",{className:"h-6 w-6 rounded-full bg-muted animate-pulse"}),m.jsx("div",{className:"h-6 w-6 rounded-lg bg-muted animate-pulse"})]})]})}),t[2]=r):r=t[2];let s;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:m.jsxs("div",{className:"mx-auto flex w-full max-w-2xl flex-col gap-4",children:[m.jsx(Cr,{align:"right",width:"w-3/4"}),m.jsx(Cr,{align:"left",width:"w-full",lines:3}),m.jsx(Cr,{align:"right",width:"w-2/3"}),m.jsx(Cr,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=s):s=t[3];let i;t[4]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:m.jsx("div",{className:"relative flex-1",children:m.jsxs("div",{className:"space-y-2 p-2",children:[m.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),m.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),t[4]=i):i=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("div",{className:"flex items-center gap-1",children:m.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),t[5]=a):a=t[5];let u;return t[6]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[r,s,m.jsx("div",{className:"px-4 py-4",children:m.jsx("div",{className:"mx-auto w-full max-w-2xl",children:m.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[i,m.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[a,m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),m.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})})]}),t[6]=u):u=t[6],u}function Cr(t){const e=Q.c(22),{align:n,width:r,lines:s}=t,i=r===void 0?"w-full":r,a=s===void 0?1:s,u=n==="right"?"flex-row-reverse":"flex-row";let l;e[0]!==u?(l=ie("flex w-full gap-4 px-4 py-2",u),e[0]=u,e[1]=l):l=e[1];const o=n==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let d;e[2]!==o?(d=ie("flex min-w-0 flex-col gap-2",o),e[2]=o,e[3]=d):d=e[3];let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=f):f=e[4];const p=n==="right"?"bg-muted":"bg-transparent border border-border/40";let h;e[5]!==p||e[6]!==i?(h=ie("min-w-0 rounded-2xl p-4",p,i),e[5]=p,e[6]=i,e[7]=h):h=e[7];let g;e[8]!==a?(g=Array.from({length:a}),e[8]=a,e[9]=g):g=e[9];let _;e[10]!==a||e[11]!==g?(_=m.jsx("div",{className:"space-y-2",children:g.map((b,w)=>m.jsx("div",{className:ie("h-3 rounded bg-muted-foreground/20 animate-pulse",w===a-1?"w-3/4":"w-full"),style:{animationDelay:`${w*.1}s`}},w))}),e[10]=a,e[11]=g,e[12]=_):_=e[12];let T;e[13]!==_||e[14]!==h?(T=m.jsx("div",{className:h,children:_}),e[13]=_,e[14]=h,e[15]=T):T=e[15];let E;e[16]!==T||e[17]!==d?(E=m.jsxs("div",{className:d,children:[f,T]}),e[16]=T,e[17]=d,e[18]=E):E=e[18];let A;return e[19]!==E||e[20]!==l?(A=m.jsx("div",{className:l,children:E}),e[19]=E,e[20]=l,e[21]=A):A=e[21],A}function dy({messageCount:t,sentinelRef:e}){const n=j.useRef(t),r=j.useRef(0);t>n.current&&r.current!==t&&queueMicrotask(()=>{e.current?.scrollIntoView({behavior:"smooth",block:"start"}),r.current=t}),n.current=t}function zu(t,e){const n=j.Children.toArray(t);for(const r of n)if(j.isValidElement(r)&&r.type===e)return r;return null}function fy(t){const e=Q.c(5),{className:n,children:r}=t;let s;e[0]!==n?(s=ie("flex flex-col h-full w-full bg-sidebar transform-[translateZ(0)]",n),e[0]=n,e[1]=s):s=e[1];let i;return e[2]!==r||e[3]!==s?(i=m.jsx("div",{className:s,children:r}),e[2]=r,e[3]=s,e[4]=i):i=e[4],i}function hy(t){const e=Q.c(7),{children:n}=t;let r;e[0]!==n?(r=zu(n,id),e[0]=n,e[1]=r):r=e[1];const s=r;let i;e[2]!==n?(i=zu(n,ad),e[2]=n,e[3]=i):i=e[3];const a=i;let u;return e[4]!==s||e[5]!==a?(u=m.jsxs("div",{className:"flex h-12 items-center justify-between gap-4 border-b border-border px-4 flex-none",children:[s,a]}),e[4]=s,e[5]=a,e[6]=u):u=e[6],u}function id(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:n}),e[0]=n,e[1]=r):r=e[1],r}function ad(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"flex flex-none items-center gap-1",children:n}),e[0]=n,e[1]=r):r=e[1],r}function py(t){const e=Q.c(5),{children:n,className:r}=t;let s;e[0]!==r?(s=ie("flex-1 min-h-0 overflow-y-auto",r),e[0]=r,e[1]=s):s=e[1];let i;return e[2]!==n||e[3]!==s?(i=m.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=i):i=e[4],i}function my(t){const e=Q.c(2),{children:n}=t;let r;return e[0]!==n?(r=m.jsx("div",{className:"h-full w-full flex items-center justify-center max-w-2xl mx-auto",children:n}),e[0]=n,e[1]=r):r=e[1],r}function gy(t){const e=Q.c(12),{minHeightOffset:n}=t,r=n===void 0?240:n,{messages:s,chatStatus:i}=An(),a=j.useRef(null);let u;e[0]!==s.length?(u={messageCount:s.length,sentinelRef:a},e[0]=s.length,e[1]=u):u=e[1],dy(u);let l;if(e[2]!==s||e[3]!==i){let f;e[5]!==s.length||e[6]!==i?(f=(p,h)=>p.role==="user"?m.jsx(iy,{message:p},p.id):p.role==="assistant"?m.jsx(Q_,{message:p,status:h===s.length-1?i:void 0},p.id):null,e[5]=s.length,e[6]=i,e[7]=f):f=e[7],l=s.map(f),e[2]=s,e[3]=i,e[4]=l}else l=e[4];let o;e[8]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(sd,{children:m.jsx("div",{ref:a,className:"h-0"})}),e[8]=o):o=e[8];let d;return e[9]!==r||e[10]!==l?(d=m.jsxs(J_,{minHeightOffset:r,children:[l,o]}),e[9]=r,e[10]=l,e[11]=d):d=e[11],d}function by(t){const e=Q.c(5),{children:n,className:r}=t;let s;e[0]!==r?(s=ie("flex-none w-full mx-auto p-2","max-w-2xl min-w-0",r),e[0]=r,e[1]=s):s=e[1];let i;return e[2]!==n||e[3]!==s?(i=m.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=i):i=e[4],i}function Ls(t){const e=Q.c(24),{title:n,description:r,icon:s,variant:i,onDismiss:a,children:u}=t,l=i===void 0?"default":i;let o,d,f,p,h;if(e[0]!==u||e[1]!==r||e[2]!==s||e[3]!==n||e[4]!==l){const b={default:{container:"border-muted-foreground/30 bg-muted/50 hover:bg-muted transition-colors",icon:"text-muted-foreground",title:"text-muted-foreground",description:"text-muted-foreground/70"},danger:{container:"border-destructive/30 bg-destructive/5",icon:"text-destructive",title:"text-destructive font-medium",description:"text-muted-foreground"},warning:{container:"border-amber-500/30 bg-amber-500/5",icon:"text-amber-600 dark:text-amber-500",title:"text-amber-600 dark:text-amber-500 font-medium",description:"text-muted-foreground"}}[l];p=ie("flex items-start gap-2 px-3 py-2.5 rounded-lg border border-dashed text-sm w-full",b.container),h=s&&m.jsx("div",{className:ie("mt-0.5 shrink-0",b.icon),children:s}),o="flex-1 min-w-0",d=n&&m.jsx("div",{className:ie("text-xs mb-1",b.title),children:n}),f=r&&m.jsx("div",{className:ie("text-xs line-clamp-2",b.description,u?"mb-2":""),children:r}),e[0]=u,e[1]=r,e[2]=s,e[3]=n,e[4]=l,e[5]=o,e[6]=d,e[7]=f,e[8]=p,e[9]=h}else o=e[5],d=e[6],f=e[7],p=e[8],h=e[9];let g;e[10]!==u?(g=u&&m.jsx("div",{className:"flex gap-2",children:u}),e[10]=u,e[11]=g):g=e[11];let _;e[12]!==o||e[13]!==d||e[14]!==f||e[15]!==g?(_=m.jsxs("div",{className:o,children:[d,f,g]}),e[12]=o,e[13]=d,e[14]=f,e[15]=g,e[16]=_):_=e[16];let T;e[17]!==a?(T=a&&m.jsx("button",{type:"button",onClick:a,className:"text-muted-foreground hover:text-foreground transition-colors shrink-0",title:"Dismiss",children:m.jsx(Nd,{size:14})}),e[17]=a,e[18]=T):T=e[18];let E;return e[19]!==p||e[20]!==h||e[21]!==_||e[22]!==T?(E=m.jsxs("div",{className:p,children:[h,_,T]}),e[19]=p,e[20]=h,e[21]=_,e[22]=T,e[23]=E):E=e[23],E}const aA=Object.assign(fy,{Header:Object.assign(hy,{Left:id,Right:ad}),Main:py,Messages:gy,EmptyState:my,Footer:by,Input:V0,Provider:M0,Skeleton:cy,IceBreakers:ap,NoLlmBindingEmptyState:ay,ThreadHistoryPopover:ly});export{aA as C,g0 as G,L0 as M,B_ as R,$e as S,sA as T,qo as a,uo as b,rA as c,iA as d,eo as i,An as u};
|