@decocms/mesh 1.0.0-alpha.36 → 1.0.0-alpha.38
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-BTyO1bIr.js → AlertCircle-BRDn8bYf.js} +1 -1
- package/dist/client/assets/{ArrowLeft-7k17XFQG.js → ArrowLeft-qWOemv4m.js} +1 -1
- package/dist/client/assets/{CheckCircle-C4Oiadwm.js → CheckCircle-DNAL-vtD.js} +1 -1
- package/dist/client/assets/{ChevronDown-BS79qwaj.js → ChevronDown-CJBpL9ke.js} +1 -1
- package/dist/client/assets/{Clock-BOH6uFau.js → Clock-s023drCB.js} +1 -1
- package/dist/client/assets/{Copy01-CxnoIdIZ.js → Copy01-Bm7GrXLR.js} +1 -1
- package/dist/client/assets/{CpuChip02-D3wiCoBz.js → CpuChip02-CY8-jTO9.js} +1 -1
- package/dist/client/assets/{DotsVertical-CwJThHEX.js → DotsVertical-DakD93ro.js} +1 -1
- package/dist/client/assets/{File06-BRYCQPQQ.js → File06-CaEGX5DR.js} +1 -1
- package/dist/client/assets/Grid01-DzkX4KgN.js +1 -0
- package/dist/client/assets/{Inbox01-BNVw88kh.js → Inbox01-BwvF7iId.js} +1 -1
- package/dist/client/assets/{InfoCircle-BE7jSjao.js → InfoCircle-D8u9C2rC.js} +1 -1
- package/dist/client/assets/{Key01-CV-PJgLz.js → Key01-CNozBS0S.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Cw55I4YI.js → LinkExternal01-v_wZOVfQ.js} +1 -1
- package/dist/client/assets/{Loading01-BhFuCyVl.js → Loading01-Bg5ZbX7j.js} +1 -1
- package/dist/client/assets/{Plus-jUkR_Ter.js → Plus-DHLB4x84.js} +1 -1
- package/dist/client/assets/{SearchMd-Cl2YCw8E.js → SearchMd-dWvbF6MG.js} +1 -1
- package/dist/client/assets/{Trash01-BWLyg5Oe.js → Trash01-B8SyVfGZ.js} +1 -1
- package/dist/client/assets/{Upload01-CS5lQvA-.js → Upload01-B11bwIwD.js} +1 -1
- package/dist/client/assets/{X-CUPD619d.js → X-B95LxPIt.js} +1 -1
- package/dist/client/assets/{ChevronRight-CUy2lZv_.js → XClose-B0ejekJj.js} +1 -1
- package/dist/client/assets/{alert-dialog-BAf5ctm5.js → alert-dialog-UMEPZCAs.js} +3 -3
- package/dist/client/assets/auth-DzSQcnhF.js +1 -0
- package/dist/client/assets/{auth-catchall-wKD825hs.js → auth-catchall-BYr2zijL.js} +1 -1
- package/dist/client/assets/avatar-BHmRC7PJ.js +1 -0
- package/dist/client/assets/badge-CsN_0CQA.js +1 -0
- package/dist/client/assets/button-DGzvT_2A.js +1 -0
- package/dist/client/assets/{card-sfFKqZf-.js → card-DhiM8w8S.js} +1 -1
- package/dist/client/assets/{checkbox-DgXbQ8Ox.js → checkbox-CazM39DL.js} +1 -1
- package/dist/client/assets/collection-detail-Be2q4lq8.js +1 -0
- package/dist/client/assets/collection-display-button-HCh5o-4Q.js +1 -0
- package/dist/client/assets/{collection-header-CHbECWq3.js → collection-header-QrVAH4kj.js} +1 -1
- package/dist/client/assets/{collection-page-CDAnXQTM.js → collection-page-CUS5aOdu.js} +1 -1
- package/dist/client/assets/collection-search-nvVuwapQ.js +1 -0
- package/dist/client/assets/collection-table-wrapper-D0FdiE30.js +1 -0
- package/dist/client/assets/{connection-card-DDubRXhM.js → connection-card-CtFpN05k.js} +1 -1
- package/dist/client/assets/connection-detail-DlPH1Rj9.js +1 -0
- package/dist/client/assets/connections-CuXo1k5G.js +1 -0
- package/dist/client/assets/{core-BQb1IbZ1.js → core-CPQcCrZ7.js} +1 -1
- package/dist/client/assets/create-organization-dialog-CO78Byme.js +1 -0
- package/dist/client/assets/deco-chat-skeleton-BAqDOmQt.js +124 -0
- package/dist/client/assets/dialog-BQqZMrZX.js +1 -0
- package/dist/client/assets/dropdown-menu-D1IcmwBM.js +1 -0
- package/dist/client/assets/{error-boundary-CzZS2hu3.js → error-boundary-BePJNb-A.js} +1 -1
- package/dist/client/assets/{extract-connection-data-DG29RoY7.js → extract-connection-data-BzkcwZMq.js} +1 -1
- package/dist/client/assets/form-CtkKIwlr.js +1 -0
- package/dist/client/assets/gateway-detail-BFm1a022.js +1 -0
- package/dist/client/assets/gateways-u5Ek3G6R.js +1 -0
- package/dist/client/assets/home-tHS3Zecm.js +1 -0
- package/dist/client/assets/{index-Q4i_xzP8.js → index-B3hUglpl.js} +1 -1
- package/dist/client/assets/{index-aPgTBlHu.js → index-BFGV_ZyQ.js} +21 -21
- package/dist/client/assets/index-Bchib-vH.css +1 -0
- package/dist/client/assets/index-Co77-1xF.js +1 -0
- package/dist/client/assets/index-RtH5C8CP.js +1 -0
- package/dist/client/assets/{input-DwDBCg8s.js → input-CSN83rcG.js} +1 -1
- package/dist/client/assets/json-eo7c8zn7.js +1 -0
- package/dist/client/assets/json-syntax-highlighter-s54gEg6g.js +2 -0
- package/dist/client/assets/{layout-C05bVaci.js → layout-By0mCM-C.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-nxpk4TOI.js → lazy-highlighter-BA7LoVJl.js} +1 -1
- package/dist/client/assets/localstorage-keys-CKD_ZpQC.js +1 -0
- package/dist/client/assets/{login-ilKhlZxM.js → login-hHvv0tPc.js} +1 -1
- package/dist/client/assets/{mcp-oauth-afk0hDd7.js → mcp-oauth-BXBge9LN.js} +1 -1
- package/dist/client/assets/members-Bvub8C8H.js +3 -0
- package/dist/client/assets/monitoring-B76IY8Nx.js +1 -0
- package/dist/client/assets/{oauth-callback-CfhyzjS-.js → oauth-callback-Buaygh1B.js} +1 -1
- package/dist/client/assets/{page-CxqajJt6.js → page-X28UCcuA.js} +1 -1
- package/dist/client/assets/popover-Bc_J6DJM.js +1 -0
- package/dist/client/assets/prism-light-CJ5lsPAv.js +1 -0
- package/dist/client/assets/resource-tabs-talmxE-P.js +1 -0
- package/dist/client/assets/schema-BNYaaxve.js +1 -0
- package/dist/client/assets/select-zI1MuLqv.js +1 -0
- package/dist/client/assets/settings-3CQfBwb4.js +1 -0
- package/dist/client/assets/shell-layout-DrYzniBY.js +17 -0
- package/dist/client/assets/spinner-Bz0yGoI-.js +1 -0
- package/dist/client/assets/store-DFp_70M-.js +1 -0
- package/dist/client/assets/store-app-detail-lpZSA42O.js +1 -0
- package/dist/client/assets/switch-hr3MPsBc.js +1 -0
- package/dist/client/assets/{textarea-BmlKbSgg.js → textarea-B9KhTSks.js} +1 -1
- package/dist/client/assets/tooltip-B1UObqaJ.js +1 -0
- package/dist/client/assets/types-BH1WeggD.js +44 -0
- package/dist/client/assets/use-binding-BAah0fz3.js +5 -0
- package/dist/client/assets/{use-connection-dLBcN4uO.js → use-connection-DfrXFTVM.js} +2 -2
- package/dist/client/assets/use-gateway-MMJo-JLn.js +1 -0
- package/dist/client/assets/{use-list-state-O_LscsV3.js → use-list-state-z01BeFuP.js} +1 -1
- package/dist/client/assets/use-mcp-BM47vnpW.js +1 -0
- package/dist/client/assets/use-members-ClMZBuqE.js +1 -0
- package/dist/client/assets/{use-mobile-BdgLaCND.js → use-mobile-CZP-mMZd.js} +1 -1
- package/dist/client/assets/use-organization-settings-GOa26Bje.js +1 -0
- package/dist/client/assets/use-tool-call-De--YQMp.js +1 -0
- package/dist/client/assets/useQuery-B00cZGqv.js +1 -0
- package/dist/client/assets/utils-D8oc_Xja.js +1 -0
- package/dist/client/assets/{well-known-mcp-FQpRYY-w.js → well-known-mcp-CJlqApJn.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +2 -2
- package/dist/server/migrate.js +72 -72
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/Play-DGLj3ZQ4.js +0 -1
- package/dist/client/assets/auth-D6xZlTbm.js +0 -1
- package/dist/client/assets/avatar-DPsLS6yn.js +0 -1
- package/dist/client/assets/badge-CpQrddlN.js +0 -1
- package/dist/client/assets/button-BIb1hBlM.js +0 -1
- package/dist/client/assets/collection-detail-kKrf7EiH.js +0 -1
- package/dist/client/assets/collection-display-button-BND5mm33.js +0 -1
- package/dist/client/assets/collection-search-Cvpn1oo5.js +0 -1
- package/dist/client/assets/collection-table-wrapper-LOaVebVl.js +0 -1
- package/dist/client/assets/connection-detail-BLnHf05r.js +0 -1
- package/dist/client/assets/connections-Dl3T9MjG.js +0 -1
- package/dist/client/assets/create-organization-dialog-DdWxBHuT.js +0 -1
- package/dist/client/assets/dialog-BUaIGJyb.js +0 -1
- package/dist/client/assets/dropdown-menu-0UYvqG1t.js +0 -1
- package/dist/client/assets/form-Cn0qh3yi.js +0 -1
- package/dist/client/assets/gateway-detail-ChvGwEiM.js +0 -1
- package/dist/client/assets/gateways-Dkkzx42w.js +0 -1
- package/dist/client/assets/home-u-36hLa3.js +0 -1
- package/dist/client/assets/index-BW5Ye25a.js +0 -1
- package/dist/client/assets/index-DJi6eJya.css +0 -1
- package/dist/client/assets/index-DekEYGbc.js +0 -1
- package/dist/client/assets/json-DwH08lZ1.js +0 -1
- package/dist/client/assets/localstorage-keys-BB92Mxjt.js +0 -1
- package/dist/client/assets/members-BLdNGmNL.js +0 -3
- package/dist/client/assets/monitoring-VVux_71k.js +0 -1
- package/dist/client/assets/popover-DG5g1uWj.js +0 -1
- package/dist/client/assets/prism-light-whovo9oO.js +0 -1
- package/dist/client/assets/resource-tabs-B2DkuD02.js +0 -1
- package/dist/client/assets/schema-DHyBqRM4.js +0 -1
- package/dist/client/assets/select-s-ULrx4h.js +0 -1
- package/dist/client/assets/settings-CBEAfPMj.js +0 -1
- package/dist/client/assets/shell-layout-Bcr5PqYt.js +0 -124
- package/dist/client/assets/spinner-ce6h3T1x.js +0 -1
- package/dist/client/assets/store-app-detail-B4MOAxlk.js +0 -1
- package/dist/client/assets/store-l32Dpsd2.js +0 -1
- package/dist/client/assets/switch-CoEnErLB.js +0 -1
- package/dist/client/assets/tool-set-selector-CCCV8X5h.js +0 -1
- package/dist/client/assets/tooltip-dlGCJiom.js +0 -1
- package/dist/client/assets/types-BA0RpCas.js +0 -45
- package/dist/client/assets/use-binding-DvLo4NgS.js +0 -5
- package/dist/client/assets/use-gateway-IzLpYPB0.js +0 -1
- package/dist/client/assets/use-mcp-DGdnUGyN.js +0 -1
- package/dist/client/assets/use-members-109akJr-.js +0 -1
- package/dist/client/assets/use-organization-settings-Bi59aqvp.js +0 -1
- package/dist/client/assets/use-tool-call-Bi8tuPr0.js +0 -1
- package/dist/client/assets/useQuery-DnWeHrBn.js +0 -1
- package/dist/client/assets/utils-BDGz_y2o.js +0 -1
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lazy-highlighter-nxpk4TOI.js","assets/index-aPgTBlHu.js","assets/index-DJi6eJya.css","assets/core-BQb1IbZ1.js","assets/json-BESjz4hO.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{$ as j,f as o0,n as pa,g as ma,e as Dr,h as u0,i as ye,k as Ps,p as on,l as bi,m as Ei,o as l0,q as c0,s as Al,t as Cl,v as Qn,w as Ms,x as d0,y as f0,z as hr,B as Sr,C as h0,D as ga,E as Il,F as p0,G as re,r as O,c as z,H as m0,I as g0,J as b0,_ as E0,K as x0,L as T0,M as _0,O as y0,P as k0,Q as S0,R as A0,T as C0,U as I0,V as Nl,W as N0,Z as he,X as ba,j as p,Y as zn,a0 as vl,a1 as wl,a2 as st,a3 as Ea,a4 as v0,a5 as Pr,a6 as ui,a as Mr,a7 as w0,a8 as R0,a9 as O0,aa as L0,ab as D0,ac as P0,ad as M0,ae as B0,af as F0,ag as z0,d as Rl,ah as j0,ai as U0,aj as H0,ak as $0,S as Ol,al as Z0,am as Y0,N as q0,an as V0,ao as Ll}from"./index-aPgTBlHu.js";import{i as xa,E as W0}from"./SearchMd-Cl2YCw8E.js";import{U as G0,u as K0,c as Q0,I as xi,a as X0,b as J0,n as ep}from"./use-connection-dLBcN4uO.js";import{u as tp}from"./use-gateway-IzLpYPB0.js";import{E as np,u as rp}from"./use-binding-DvLo4NgS.js";import{u as Dn,L as Br}from"./localstorage-keys-BB92Mxjt.js";import{i as Wt,T as Ta,a as _a,b as ya,u as Nt,c as ip,L as fo,P as sp,O as ap}from"./tooltip-dlGCJiom.js";import{B as at,u as un}from"./button-BIb1hBlM.js";import{i as Rn}from"./CpuChip02-D3wiCoBz.js";import{S as op,a as up,b as lp,c as cp,n as dp}from"./select-s-ULrx4h.js";import{c as X}from"./utils-BDGz_y2o.js";import{u as jn}from"./use-mobile-BdgLaCND.js";import{i as fp,c as Dl,D as hp,a as pp,b as mp,d as gp,e as ho}from"./dropdown-menu-0UYvqG1t.js";import{T as bp}from"./textarea-BmlKbSgg.js";import{i as Pl}from"./File06-BRYCQPQQ.js";import{i as Ep}from"./InfoCircle-BE7jSjao.js";import{P as Ml,a as Bl,b as Fl}from"./popover-DG5g1uWj.js";import{s as xp}from"./Clock-BOH6uFau.js";import{s as Tp}from"./Plus-jUkR_Ter.js";import{s as _p}from"./Trash01-BWLyg5Oe.js";import{i as Ti}from"./X-CUPD619d.js";import{t as zl}from"./ChevronDown-BS79qwaj.js";import{a as Fr}from"./Copy01-CxnoIdIZ.js";import{i as yp}from"./AlertCircle-BTyO1bIr.js";import{C as kp}from"./connection-card-DDubRXhM.js";import{n as Bs}from"./LinkExternal01-Cw55I4YI.js";import{S as Sp}from"./spinner-ce6h3T1x.js";import{E as jl}from"./error-boundary-CzZS2hu3.js";import{u as Ul,a as Ap}from"./use-organization-settings-Bi59aqvp.js";import{C as Cp}from"./create-organization-dialog-DdWxBHuT.js";import{I as Ip}from"./input-DwDBCg8s.js";import{A as Un}from"./avatar-DPsLS6yn.js";import{D as Hl,a as $l,b as Zl,c as Yl,d as ql}from"./dialog-BUaIGJyb.js";import"./auth-D6xZlTbm.js";import"./useQuery-DnWeHrBn.js";import"./ChevronRight-CUy2lZv_.js";import"./card-sfFKqZf-.js";import"./alert-dialog-BAf5ctm5.js";import"./form-Cn0qh3yi.js";const Np=/^[cC][^\s-]{8,}$/,vp=/^[0-9a-z]+$/,wp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Rp=/^[0-9a-vA-V]{20}$/,Op=/^[A-Za-z0-9]{27}$/,Lp=/^[a-zA-Z0-9_-]{21}$/,Dp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Pp=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,po=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,Mp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Bp="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Fp(){return new RegExp(Bp,"u")}const zp=/^(?:(?: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])$/,jp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Up=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,Hp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$p=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Vl=/^[A-Za-z0-9_-]*$/,Zp=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Yp=/^\+(?:[0-9]){6,14}[0-9]$/,Wl="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",qp=new RegExp(`^${Wl}$`);function Gl(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Vp(t){return new RegExp(`^${Gl(t)}$`)}function Wp(t){const e=Gl({precision:t.precision}),n=["Z"];t.local&&n.push(""),t.offset&&n.push("([+-]\\d{2}:\\d{2})");const r=`${e}(?:${n.join("|")})`;return new RegExp(`^${Wl}T(?:${r})$`)}const Gp=t=>{const e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Kp=/^\d+$/,Qp=/^-?\d+(?:\.\d+)?/i,Xp=/true|false/i,Jp=/null/i,em=/^[^A-Z]*$/,tm=/^[^a-z]*$/,ot=j("$ZodCheck",(t,e)=>{var n;t._zod??(t._zod={}),t._zod.def=e,(n=t._zod).onattach??(n.onattach=[])}),Kl={number:"number",bigint:"bigint",object:"date"},Ql=j("$ZodCheckLessThan",(t,e)=>{ot.init(t,e);const n=Kl[typeof e.value];t._zod.onattach.push(r=>{const i=r._zod.bag,s=(e.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?i.maximum=e.value:i.exclusiveMaximum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:n,code:"too_big",maximum:e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Xl=j("$ZodCheckGreaterThan",(t,e)=>{ot.init(t,e);const n=Kl[typeof e.value];t._zod.onattach.push(r=>{const i=r._zod.bag,s=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:n,code:"too_small",minimum:e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),nm=j("$ZodCheckMultipleOf",(t,e)=>{ot.init(t,e),t._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=e.value)}),t._zod.check=n=>{if(typeof n.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%e.value===BigInt(0):o0(n.value,e.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:e.value,input:n.value,inst:t,continue:!e.abort})}}),rm=j("$ZodCheckNumberFormat",(t,e)=>{ot.init(t,e),e.format=e.format||"float64";const n=e.format?.includes("int"),r=n?"int":"number",[i,s]=u0[e.format];t._zod.onattach.push(a=>{const o=a._zod.bag;o.format=e.format,o.minimum=i,o.maximum=s,n&&(o.pattern=Kp)}),t._zod.check=a=>{const o=a.value;if(n){if(!Number.isInteger(o)){a.issues.push({expected:r,format:e.format,code:"invalid_type",input:o,inst:t});return}if(!Number.isSafeInteger(o)){o>0?a.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,continue:!e.abort}):a.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,continue:!e.abort});return}}o<i&&a.issues.push({origin:"number",input:o,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),o>s&&a.issues.push({origin:"number",input:o,code:"too_big",maximum:s,inst:t})}}),im=j("$ZodCheckMaxLength",(t,e)=>{var n;ot.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!pa(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<i&&(r._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{const i=r.value;if(i.length<=e.maximum)return;const a=ma(i);r.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),sm=j("$ZodCheckMinLength",(t,e)=>{var n;ot.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!pa(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{const i=r.value;if(i.length>=e.minimum)return;const a=ma(i);r.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}}),am=j("$ZodCheckLengthEquals",(t,e)=>{var n;ot.init(t,e),(n=t._zod.def).when??(n.when=r=>{const i=r.value;return!pa(i)&&i.length!==void 0}),t._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=e.length,i.maximum=e.length,i.length=e.length}),t._zod.check=r=>{const i=r.value,s=i.length;if(s===e.length)return;const a=ma(i),o=s>e.length;r.issues.push({origin:a,...o?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),Di=j("$ZodCheckStringFormat",(t,e)=>{var n,r;ot.init(t,e),t._zod.onattach.push(i=>{const s=i._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(n=t._zod).check??(n.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(r=t._zod).check??(r.check=()=>{})}),om=j("$ZodCheckRegex",(t,e)=>{Di.init(t,e),t._zod.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),um=j("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=em),Di.init(t,e)}),lm=j("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=tm),Di.init(t,e)}),cm=j("$ZodCheckIncludes",(t,e)=>{ot.init(t,e);const n=Dr(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position}}${n}`:n);e.pattern=r,t._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),t._zod.check=i=>{i.value.includes(e.includes,e.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:i.value,inst:t,continue:!e.abort})}}),dm=j("$ZodCheckStartsWith",(t,e)=>{ot.init(t,e);const n=new RegExp(`^${Dr(e.prefix)}.*`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),fm=j("$ZodCheckEndsWith",(t,e)=>{ot.init(t,e);const n=new RegExp(`.*${Dr(e.suffix)}$`);e.pattern??(e.pattern=n),t._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}}),hm=j("$ZodCheckOverwrite",(t,e)=>{ot.init(t,e),t._zod.check=n=>{n.value=e.tx(n.value)}});class pm{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const r=e.split(`
|
|
3
|
-
`).filter(a=>a),i=Math.min(...r.map(a=>a.length-a.trimStart().length)),s=r.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(const a of s)this.content.push(a)}compile(){const e=Function,n=this?.args,i=[...(this?.content??[""]).map(s=>` ${s}`)];return new e(...n,i.join(`
|
|
4
|
-
`))}}const mm={major:4,minor:0,patch:0},Re=j("$ZodType",(t,e)=>{var n;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=mm;const r=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&r.unshift(t);for(const i of r)for(const s of i._zod.onattach)s(t);if(r.length===0)(n=t._zod).deferred??(n.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{const i=(s,a,o)=>{let u=hr(s),l;for(const d of a){if(d._zod.def.when){if(!d._zod.def.when(s))continue}else if(u)continue;const c=s.issues.length,h=d._zod.check(s);if(h instanceof Promise&&o?.async===!1)throw new Ms;if(l||h instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await h,s.issues.length!==c&&(u||(u=hr(s,c)))});else{if(s.issues.length===c)continue;u||(u=hr(s,c))}}return l?l.then(()=>s):s};t._zod.run=(s,a)=>{const o=t._zod.parse(s,a);if(o instanceof Promise){if(a.async===!1)throw new Ms;return o.then(u=>i(u,r,a))}return i(o,r,a)}}t["~standard"]={validate:i=>{try{const s=d0(t,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return f0(t,i).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),ka=j("$ZodString",(t,e)=>{Re.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Gp(t._zod.bag),t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:t}),n}}),Be=j("$ZodStringFormat",(t,e)=>{Di.init(t,e),ka.init(t,e)}),gm=j("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Pp),Be.init(t,e)}),bm=j("$ZodUUID",(t,e)=>{if(e.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=po(r))}else e.pattern??(e.pattern=po());Be.init(t,e)}),Em=j("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Mp),Be.init(t,e)}),xm=j("$ZodURL",(t,e)=>{Be.init(t,e),t._zod.check=n=>{try{const r=n.value,i=new URL(r),s=i.href;e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Zp.source,input:n.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:n.value,inst:t,continue:!e.abort})),!r.endsWith("/")&&s.endsWith("/")?n.value=s.slice(0,-1):n.value=s;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:t,continue:!e.abort})}}}),Tm=j("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Fp()),Be.init(t,e)}),_m=j("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Lp),Be.init(t,e)}),ym=j("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Np),Be.init(t,e)}),km=j("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=vp),Be.init(t,e)}),Sm=j("$ZodULID",(t,e)=>{e.pattern??(e.pattern=wp),Be.init(t,e)}),Am=j("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Rp),Be.init(t,e)}),Cm=j("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Op),Be.init(t,e)}),Im=j("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Wp(e)),Be.init(t,e)}),Nm=j("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=qp),Be.init(t,e)}),vm=j("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Vp(e)),Be.init(t,e)}),wm=j("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Dp),Be.init(t,e)}),Rm=j("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=zp),Be.init(t,e),t._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),Om=j("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=jp),Be.init(t,e),t._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv6"}),t._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:t,continue:!e.abort})}}}),Lm=j("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Up),Be.init(t,e)}),Dm=j("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Hp),Be.init(t,e),t._zod.check=n=>{const[r,i]=n.value.split("/");try{if(!i)throw new Error;const s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:t,continue:!e.abort})}}});function Jl(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const Pm=j("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=$p),Be.init(t,e),t._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),t._zod.check=n=>{Jl(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:t,continue:!e.abort})}});function Mm(t){if(!Vl.test(t))return!1;const e=t.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=e.padEnd(Math.ceil(e.length/4)*4,"=");return Jl(n)}const Bm=j("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Vl),Be.init(t,e),t._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),t._zod.check=n=>{Mm(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:t,continue:!e.abort})}}),Fm=j("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Yp),Be.init(t,e)});function zm(t,e=null){try{const n=t.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||e&&(!("alg"in i)||i.alg!==e))}catch{return!1}}const jm=j("$ZodJWT",(t,e)=>{Be.init(t,e),t._zod.check=n=>{zm(n.value,e.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:t,continue:!e.abort})}}),ec=j("$ZodNumber",(t,e)=>{Re.init(t,e),t._zod.pattern=t._zod.bag.pattern??Qp,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),n}}),Um=j("$ZodNumber",(t,e)=>{rm.init(t,e),ec.init(t,e)}),Hm=j("$ZodBoolean",(t,e)=>{Re.init(t,e),t._zod.pattern=Xp,t._zod.parse=(n,r)=>{if(e.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),n}}),$m=j("$ZodNull",(t,e)=>{Re.init(t,e),t._zod.pattern=Jp,t._zod.values=new Set([null]),t._zod.parse=(n,r)=>{const i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:t}),n}}),Zm=j("$ZodUnknown",(t,e)=>{Re.init(t,e),t._zod.parse=n=>n}),Ym=j("$ZodNever",(t,e)=>{Re.init(t,e),t._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:t}),n)});function mo(t,e,n){t.issues.length&&e.issues.push(...on(n,t.issues)),e.value[n]=t.value}const qm=j("$ZodArray",(t,e)=>{Re.init(t,e),t._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),n;n.value=Array(i.length);const s=[];for(let a=0;a<i.length;a++){const o=i[a],u=e.element._zod.run({value:o,issues:[]},r);u instanceof Promise?s.push(u.then(l=>mo(l,n,a))):mo(u,n,a)}return s.length?Promise.all(s).then(()=>n):n}});function Qr(t,e,n){t.issues.length&&e.issues.push(...on(n,t.issues)),e.value[n]=t.value}function go(t,e,n,r){t.issues.length?r[n]===void 0?n in r?e.value[n]=void 0:e.value[n]=t.value:e.issues.push(...on(n,t.issues)):t.value===void 0?n in r&&(e.value[n]=void 0):e.value[n]=t.value}const Vm=j("$ZodObject",(t,e)=>{Re.init(t,e);const n=Al(()=>{const c=Object.keys(e.shape);for(const m of c)if(!(e.shape[m]instanceof Re))throw new Error(`Invalid element at key "${m}": expected a Zod schema`);const h=h0(e.shape);return{shape:e.shape,keys:c,keySet:new Set(c),numKeys:c.length,optionalKeys:new Set(h)}});ye(t._zod,"propValues",()=>{const c=e.shape,h={};for(const m in c){const g=c[m]._zod;if(g.values){h[m]??(h[m]=new Set);for(const E of g.values)h[m].add(E)}}return h});const r=c=>{const h=new pm(["shape","payload","ctx"]),m=n.value,g=_=>{const b=Qn(_);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};h.write("const input = payload.value;");const E=Object.create(null);let T=0;for(const _ of m.keys)E[_]=`key_${T++}`;h.write("const newResult = {}");for(const _ of m.keys)if(m.optionalKeys.has(_)){const b=E[_];h.write(`const ${b} = ${g(_)};`);const C=Qn(_);h.write(`
|
|
5
|
-
if (${b}.issues.length) {
|
|
6
|
-
if (input[${C}] === undefined) {
|
|
7
|
-
if (${C} in input) {
|
|
8
|
-
newResult[${C}] = undefined;
|
|
9
|
-
}
|
|
10
|
-
} else {
|
|
11
|
-
payload.issues = payload.issues.concat(
|
|
12
|
-
${b}.issues.map((iss) => ({
|
|
13
|
-
...iss,
|
|
14
|
-
path: iss.path ? [${C}, ...iss.path] : [${C}],
|
|
15
|
-
}))
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
} else if (${b}.value === undefined) {
|
|
19
|
-
if (${C} in input) newResult[${C}] = undefined;
|
|
20
|
-
} else {
|
|
21
|
-
newResult[${C}] = ${b}.value;
|
|
22
|
-
}
|
|
23
|
-
`)}else{const b=E[_];h.write(`const ${b} = ${g(_)};`),h.write(`
|
|
24
|
-
if (${b}.issues.length) payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
|
|
25
|
-
...iss,
|
|
26
|
-
path: iss.path ? [${Qn(_)}, ...iss.path] : [${Qn(_)}]
|
|
27
|
-
})));`),h.write(`newResult[${Qn(_)}] = ${b}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");const x=h.compile();return(_,b)=>x(c,_,b)};let i;const s=Cl,a=!l0.jitless,u=a&&c0.value,l=e.catchall;let d;t._zod.parse=(c,h)=>{d??(d=n.value);const m=c.value;if(!s(m))return c.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),c;const g=[];if(a&&u&&h?.async===!1&&h.jitless!==!0)i||(i=r(e.shape)),c=i(c,h);else{c.value={};const b=d.shape;for(const C of d.keys){const w=b[C],y=w._zod.run({value:m[C],issues:[]},h),R=w._zod.optin==="optional"&&w._zod.optout==="optional";y instanceof Promise?g.push(y.then(D=>R?go(D,c,C,m):Qr(D,c,C))):R?go(y,c,C,m):Qr(y,c,C)}}if(!l)return g.length?Promise.all(g).then(()=>c):c;const E=[],T=d.keySet,x=l._zod,_=x.def.type;for(const b of Object.keys(m)){if(T.has(b))continue;if(_==="never"){E.push(b);continue}const C=x.run({value:m[b],issues:[]},h);C instanceof Promise?g.push(C.then(w=>Qr(w,c,b))):Qr(C,c,b)}return E.length&&c.issues.push({code:"unrecognized_keys",keys:E,input:m,inst:t}),g.length?Promise.all(g).then(()=>c):c}});function bo(t,e,n,r){for(const i of t)if(i.issues.length===0)return e.value=i.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:n,errors:t.map(i=>i.issues.map(s=>bi(s,r,Ei())))}),e}const tc=j("$ZodUnion",(t,e)=>{Re.init(t,e),ye(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),ye(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),ye(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),ye(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){const n=e.options.map(r=>r._zod.pattern);return new RegExp(`^(${n.map(r=>ga(r.source)).join("|")})$`)}}),t._zod.parse=(n,r)=>{let i=!1;const s=[];for(const a of e.options){const o=a._zod.run({value:n.value,issues:[]},r);if(o instanceof Promise)s.push(o),i=!0;else{if(o.issues.length===0)return o;s.push(o)}}return i?Promise.all(s).then(a=>bo(a,n,t,r)):bo(s,n,t,r)}}),Wm=j("$ZodDiscriminatedUnion",(t,e)=>{tc.init(t,e);const n=t._zod.parse;ye(t._zod,"propValues",()=>{const i={};for(const s of e.options){const a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(const[o,u]of Object.entries(a)){i[o]||(i[o]=new Set);for(const l of u)i[o].add(l)}}return i});const r=Al(()=>{const i=e.options,s=new Map;for(const a of i){const o=a._zod.propValues[e.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(const u of o){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,a)}}return s});t._zod.parse=(i,s)=>{const a=i.value;if(!Cl(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),i;const o=r.value.get(a?.[e.discriminator]);return o?o._zod.run(i,s):e.unionFallback?n(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:a,path:[e.discriminator],inst:t}),i)}}),Gm=j("$ZodIntersection",(t,e)=>{Re.init(t,e),t._zod.parse=(n,r)=>{const i=n.value,s=e.left._zod.run({value:i,issues:[]},r),a=e.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([u,l])=>Eo(n,u,l)):Eo(n,s,a)}});function Fs(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Ps(t)&&Ps(e)){const n=Object.keys(e),r=Object.keys(t).filter(s=>n.indexOf(s)!==-1),i={...t,...e};for(const s of r){const a=Fs(t[s],e[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};i[s]=a.data}return{valid:!0,data:i}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<t.length;r++){const i=t[r],s=e[r],a=Fs(i,s);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Eo(t,e,n){if(e.issues.length&&t.issues.push(...e.issues),n.issues.length&&t.issues.push(...n.issues),hr(t))return t;const r=Fs(e.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return t.value=r.data,t}const Km=j("$ZodRecord",(t,e)=>{Re.init(t,e),t._zod.parse=(n,r)=>{const i=n.value;if(!Ps(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),n;const s=[];if(e.keyType._zod.values){const a=e.keyType._zod.values;n.value={};for(const u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){const l=e.valueType._zod.run({value:i[u],issues:[]},r);l instanceof Promise?s.push(l.then(d=>{d.issues.length&&n.issues.push(...on(u,d.issues)),n.value[u]=d.value})):(l.issues.length&&n.issues.push(...on(u,l.issues)),n.value[u]=l.value)}let o;for(const u in i)a.has(u)||(o=o??[],o.push(u));o&&o.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:o})}else{n.value={};for(const a of Reflect.ownKeys(i)){if(a==="__proto__")continue;const o=e.keyType._zod.run({value:a,issues:[]},r);if(o instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(o.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:o.issues.map(l=>bi(l,r,Ei())),input:a,path:[a],inst:t}),n.value[o.value]=o.value;continue}const u=e.valueType._zod.run({value:i[a],issues:[]},r);u instanceof Promise?s.push(u.then(l=>{l.issues.length&&n.issues.push(...on(a,l.issues)),n.value[o.value]=l.value})):(u.issues.length&&n.issues.push(...on(a,u.issues)),n.value[o.value]=u.value)}}return s.length?Promise.all(s).then(()=>n):n}}),Qm=j("$ZodEnum",(t,e)=>{Re.init(t,e);const n=Il(e.entries);t._zod.values=new Set(n),t._zod.pattern=new RegExp(`^(${n.filter(r=>p0.has(typeof r)).map(r=>typeof r=="string"?Dr(r):r.toString()).join("|")})$`),t._zod.parse=(r,i)=>{const s=r.value;return t._zod.values.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:t}),r}}),Xm=j("$ZodLiteral",(t,e)=>{Re.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Dr(n):n?n.toString():String(n)).join("|")})$`),t._zod.parse=(n,r)=>{const i=n.value;return t._zod.values.has(i)||n.issues.push({code:"invalid_value",values:e.values,input:i,inst:t}),n}}),Jm=j("$ZodTransform",(t,e)=>{Re.init(t,e),t._zod.parse=(n,r)=>{const i=e.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(n.value=a,n));if(i instanceof Promise)throw new Ms;return n.value=i,n}}),e1=j("$ZodOptional",(t,e)=>{Re.init(t,e),t._zod.optin="optional",t._zod.optout="optional",ye(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),ye(t._zod,"pattern",()=>{const n=e.innerType._zod.pattern;return n?new RegExp(`^(${ga(n.source)})?$`):void 0}),t._zod.parse=(n,r)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(n,r):n.value===void 0?n:e.innerType._zod.run(n,r)}),t1=j("$ZodNullable",(t,e)=>{Re.init(t,e),ye(t._zod,"optin",()=>e.innerType._zod.optin),ye(t._zod,"optout",()=>e.innerType._zod.optout),ye(t._zod,"pattern",()=>{const n=e.innerType._zod.pattern;return n?new RegExp(`^(${ga(n.source)}|null)$`):void 0}),ye(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(n,r)=>n.value===null?n:e.innerType._zod.run(n,r)}),n1=j("$ZodDefault",(t,e)=>{Re.init(t,e),t._zod.optin="optional",ye(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{if(n.value===void 0)return n.value=e.defaultValue,n;const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>xo(s,e)):xo(i,e)}});function xo(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const r1=j("$ZodPrefault",(t,e)=>{Re.init(t,e),t._zod.optin="optional",ye(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>(n.value===void 0&&(n.value=e.defaultValue),e.innerType._zod.run(n,r))}),i1=j("$ZodNonOptional",(t,e)=>{Re.init(t,e),ye(t._zod,"values",()=>{const n=e.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),t._zod.parse=(n,r)=>{const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>To(s,t)):To(i,t)}});function To(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}const s1=j("$ZodCatch",(t,e)=>{Re.init(t,e),t._zod.optin="optional",ye(t._zod,"optout",()=>e.innerType._zod.optout),ye(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(n,r)=>{const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>(n.value=s.value,s.issues.length&&(n.value=e.catchValue({...n,error:{issues:s.issues.map(a=>bi(a,r,Ei()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=e.catchValue({...n,error:{issues:i.issues.map(s=>bi(s,r,Ei()))},input:n.value}),n.issues=[]),n)}}),a1=j("$ZodPipe",(t,e)=>{Re.init(t,e),ye(t._zod,"values",()=>e.in._zod.values),ye(t._zod,"optin",()=>e.in._zod.optin),ye(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(n,r)=>{const i=e.in._zod.run(n,r);return i instanceof Promise?i.then(s=>_o(s,e,r)):_o(i,e,r)}});function _o(t,e,n){return hr(t)?t:e.out._zod.run({value:t.value,issues:t.issues},n)}const o1=j("$ZodReadonly",(t,e)=>{Re.init(t,e),ye(t._zod,"propValues",()=>e.innerType._zod.propValues),ye(t._zod,"values",()=>e.innerType._zod.values),ye(t._zod,"optin",()=>e.innerType._zod.optin),ye(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(n,r)=>{const i=e.innerType._zod.run(n,r);return i instanceof Promise?i.then(yo):yo(i)}});function yo(t){return t.value=Object.freeze(t.value),t}const u1=j("$ZodLazy",(t,e)=>{Re.init(t,e),ye(t._zod,"innerType",()=>e.getter()),ye(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),ye(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),ye(t._zod,"optin",()=>t._zod.innerType._zod.optin),ye(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(n,r)=>t._zod.innerType._zod.run(n,r)}),l1=j("$ZodCustom",(t,e)=>{ot.init(t,e),Re.init(t,e),t._zod.parse=(n,r)=>n,t._zod.check=n=>{const r=n.value,i=e.fn(r);if(i instanceof Promise)return i.then(s=>ko(s,n,r,t));ko(i,n,r,t)}});function ko(t,e,n,r){if(!t){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),e.issues.push(Sr(i))}}class nc{constructor(){this._map=new Map,this._idmap=new Map}add(e,...n){const r=n[0];if(this._map.set(e,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){const n=this._map.get(e);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(e),this}get(e){const n=e._zod.parent;if(n){const r={...this.get(n)??{}};return delete r.id,{...r,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function c1(){return new nc}const ar=c1();function d1(t,e){return new t({type:"string",...re(e)})}function f1(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...re(e)})}function So(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...re(e)})}function h1(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...re(e)})}function p1(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...re(e)})}function m1(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...re(e)})}function g1(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...re(e)})}function b1(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...re(e)})}function E1(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...re(e)})}function x1(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...re(e)})}function T1(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...re(e)})}function _1(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...re(e)})}function y1(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...re(e)})}function k1(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...re(e)})}function S1(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...re(e)})}function A1(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...re(e)})}function C1(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...re(e)})}function I1(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...re(e)})}function N1(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...re(e)})}function v1(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...re(e)})}function w1(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...re(e)})}function R1(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...re(e)})}function O1(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...re(e)})}function L1(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...re(e)})}function D1(t,e){return new t({type:"string",format:"date",check:"string_format",...re(e)})}function P1(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...re(e)})}function M1(t,e){return new t({type:"string",format:"duration",check:"string_format",...re(e)})}function B1(t,e){return new t({type:"number",checks:[],...re(e)})}function F1(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...re(e)})}function z1(t,e){return new t({type:"boolean",...re(e)})}function j1(t,e){return new t({type:"null",...re(e)})}function U1(t){return new t({type:"unknown"})}function H1(t,e){return new t({type:"never",...re(e)})}function Ao(t,e){return new Ql({check:"less_than",...re(e),value:t,inclusive:!1})}function ss(t,e){return new Ql({check:"less_than",...re(e),value:t,inclusive:!0})}function Co(t,e){return new Xl({check:"greater_than",...re(e),value:t,inclusive:!1})}function as(t,e){return new Xl({check:"greater_than",...re(e),value:t,inclusive:!0})}function Io(t,e){return new nm({check:"multiple_of",...re(e),value:t})}function rc(t,e){return new im({check:"max_length",...re(e),maximum:t})}function _i(t,e){return new sm({check:"min_length",...re(e),minimum:t})}function ic(t,e){return new am({check:"length_equals",...re(e),length:t})}function $1(t,e){return new om({check:"string_format",format:"regex",...re(e),pattern:t})}function Z1(t){return new um({check:"string_format",format:"lowercase",...re(t)})}function Y1(t){return new lm({check:"string_format",format:"uppercase",...re(t)})}function q1(t,e){return new cm({check:"string_format",format:"includes",...re(e),includes:t})}function V1(t,e){return new dm({check:"string_format",format:"starts_with",...re(e),prefix:t})}function W1(t,e){return new fm({check:"string_format",format:"ends_with",...re(e),suffix:t})}function zr(t){return new hm({check:"overwrite",tx:t})}function G1(t){return zr(e=>e.normalize(t))}function K1(){return zr(t=>t.trim())}function Q1(){return zr(t=>t.toLowerCase())}function X1(){return zr(t=>t.toUpperCase())}function J1(t,e,n){return new t({type:"array",element:e,...re(n)})}function eg(t,e,n){const r=re(n);return r.abort??(r.abort=!0),new t({type:"custom",check:"custom",fn:e,...r})}function tg(t,e,n){return new t({type:"custom",check:"custom",fn:e,...re(n)})}class No{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??ar,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,s={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},a=this.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(e,o);const u=e._zod.toJSONSchema?.();if(u)o.schema=u;else{const c={...n,schemaPath:[...n.schemaPath,e],path:n.path},h=e._zod.parent;if(h)o.ref=h,this.process(h,c),this.seen.get(h).isParent=!0;else{const m=o.schema;switch(i.type){case"string":{const g=m;g.type="string";const{minimum:E,maximum:T,format:x,patterns:_,contentEncoding:b}=e._zod.bag;if(typeof E=="number"&&(g.minLength=E),typeof T=="number"&&(g.maxLength=T),x&&(g.format=s[x]??x,g.format===""&&delete g.format),b&&(g.contentEncoding=b),_&&_.size>0){const C=[..._];C.length===1?g.pattern=C[0].source:C.length>1&&(o.schema.allOf=[...C.map(w=>({...this.target==="draft-7"?{type:"string"}:{},pattern:w.source}))])}break}case"number":{const g=m,{minimum:E,maximum:T,format:x,multipleOf:_,exclusiveMaximum:b,exclusiveMinimum:C}=e._zod.bag;typeof x=="string"&&x.includes("int")?g.type="integer":g.type="number",typeof C=="number"&&(g.exclusiveMinimum=C),typeof E=="number"&&(g.minimum=E,typeof C=="number"&&(C>=E?delete g.minimum:delete g.exclusiveMinimum)),typeof b=="number"&&(g.exclusiveMaximum=b),typeof T=="number"&&(g.maximum=T,typeof b=="number"&&(b<=T?delete g.maximum:delete g.exclusiveMaximum)),typeof _=="number"&&(g.multipleOf=_);break}case"boolean":{const g=m;g.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{m.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{m.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{const g=m,{minimum:E,maximum:T}=e._zod.bag;typeof E=="number"&&(g.minItems=E),typeof T=="number"&&(g.maxItems=T),g.type="array",g.items=this.process(i.element,{...c,path:[...c.path,"items"]});break}case"object":{const g=m;g.type="object",g.properties={};const E=i.shape;for(const _ in E)g.properties[_]=this.process(E[_],{...c,path:[...c.path,"properties",_]});const T=new Set(Object.keys(E)),x=new Set([...T].filter(_=>{const b=i.shape[_]._zod;return this.io==="input"?b.optin===void 0:b.optout===void 0}));x.size>0&&(g.required=Array.from(x)),i.catchall?._zod.def.type==="never"?g.additionalProperties=!1:i.catchall?i.catchall&&(g.additionalProperties=this.process(i.catchall,{...c,path:[...c.path,"additionalProperties"]})):this.io==="output"&&(g.additionalProperties=!1);break}case"union":{const g=m;g.anyOf=i.options.map((E,T)=>this.process(E,{...c,path:[...c.path,"anyOf",T]}));break}case"intersection":{const g=m,E=this.process(i.left,{...c,path:[...c.path,"allOf",0]}),T=this.process(i.right,{...c,path:[...c.path,"allOf",1]}),x=b=>"allOf"in b&&Object.keys(b).length===1,_=[...x(E)?E.allOf:[E],...x(T)?T.allOf:[T]];g.allOf=_;break}case"tuple":{const g=m;g.type="array";const E=i.items.map((_,b)=>this.process(_,{...c,path:[...c.path,"prefixItems",b]}));if(this.target==="draft-2020-12"?g.prefixItems=E:g.items=E,i.rest){const _=this.process(i.rest,{...c,path:[...c.path,"items"]});this.target==="draft-2020-12"?g.items=_:g.additionalItems=_}i.rest&&(g.items=this.process(i.rest,{...c,path:[...c.path,"items"]}));const{minimum:T,maximum:x}=e._zod.bag;typeof T=="number"&&(g.minItems=T),typeof x=="number"&&(g.maxItems=x);break}case"record":{const g=m;g.type="object",g.propertyNames=this.process(i.keyType,{...c,path:[...c.path,"propertyNames"]}),g.additionalProperties=this.process(i.valueType,{...c,path:[...c.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{const g=m,E=Il(i.entries);E.every(T=>typeof T=="number")&&(g.type="number"),E.every(T=>typeof T=="string")&&(g.type="string"),g.enum=E;break}case"literal":{const g=m,E=[];for(const T of i.values)if(T===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof T=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");E.push(Number(T))}else E.push(T);if(E.length!==0)if(E.length===1){const T=E[0];g.type=T===null?"null":typeof T,g.const=T}else E.every(T=>typeof T=="number")&&(g.type="number"),E.every(T=>typeof T=="string")&&(g.type="string"),E.every(T=>typeof T=="boolean")&&(g.type="string"),E.every(T=>T===null)&&(g.type="null"),g.enum=E;break}case"file":{const g=m,E={type:"string",format:"binary",contentEncoding:"binary"},{minimum:T,maximum:x,mime:_}=e._zod.bag;T!==void 0&&(E.minLength=T),x!==void 0&&(E.maxLength=x),_?_.length===1?(E.contentMediaType=_[0],Object.assign(g,E)):g.anyOf=_.map(b=>({...E,contentMediaType:b})):Object.assign(g,E);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{const g=this.process(i.innerType,c);m.anyOf=[g,{type:"null"}];break}case"nonoptional":{this.process(i.innerType,c),o.ref=i.innerType;break}case"success":{const g=m;g.type="boolean";break}case"default":{this.process(i.innerType,c),o.ref=i.innerType,m.default=JSON.parse(JSON.stringify(i.defaultValue));break}case"prefault":{this.process(i.innerType,c),o.ref=i.innerType,this.io==="input"&&(m._prefault=JSON.parse(JSON.stringify(i.defaultValue)));break}case"catch":{this.process(i.innerType,c),o.ref=i.innerType;let g;try{g=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}m.default=g;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{const g=m,E=e._zod.pattern;if(!E)throw new Error("Pattern not found in template literal");g.type="string",g.pattern=E.source;break}case"pipe":{const g=this.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;this.process(g,c),o.ref=g;break}case"readonly":{this.process(i.innerType,c),o.ref=i.innerType,m.readOnly=!0;break}case"promise":{this.process(i.innerType,c),o.ref=i.innerType;break}case"optional":{this.process(i.innerType,c),o.ref=i.innerType;break}case"lazy":{const g=e._zod.innerType;this.process(g,c),o.ref=g;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}}}}const l=this.metadataRegistry.get(e);return l&&Object.assign(o.schema,l),this.io==="input"&&Ze(e)&&(delete o.schema.examples,delete o.schema.default),this.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,this.seen.get(e).schema}emit(e,n){const r={cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0},i=this.seen.get(e);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=d=>{const c=this.target==="draft-2020-12"?"$defs":"definitions";if(r.external){const E=r.external.registry.get(d[0])?.id,T=r.external.uri??(_=>_);if(E)return{ref:T(E)};const x=d[1].defId??d[1].schema.id??`schema${this.counter++}`;return d[1].defId=x,{defId:x,ref:`${T("__shared")}#/${c}/${x}`}}if(d[1]===i)return{ref:"#"};const m=`#/${c}/`,g=d[1].schema.id??`__schema${this.counter++}`;return{defId:g,ref:m+g}},a=d=>{if(d[1].schema.$ref)return;const c=d[1],{ref:h,defId:m}=s(d);c.def={...c.schema},m&&(c.defId=m);const g=c.schema;for(const E in g)delete g[E];g.$ref=h};if(r.cycles==="throw")for(const d of this.seen.entries()){const c=d[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
28
|
-
|
|
29
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of this.seen.entries()){const c=d[1];if(e===d[0]){a(d);continue}if(r.external){const m=r.external.registry.get(d[0])?.id;if(e!==d[0]&&m){a(d);continue}}if(this.metadataRegistry.get(d[0])?.id){a(d);continue}if(c.cycle){a(d);continue}if(c.count>1&&r.reused==="ref"){a(d);continue}}const o=(d,c)=>{const h=this.seen.get(d),m=h.def??h.schema,g={...m};if(h.ref===null)return;const E=h.ref;if(h.ref=null,E){o(E,c);const T=this.seen.get(E).schema;T.$ref&&c.target==="draft-7"?(m.allOf=m.allOf??[],m.allOf.push(T)):(Object.assign(m,T),Object.assign(m,g))}h.isParent||this.override({zodSchema:d,jsonSchema:m,path:h.path??[]})};for(const d of[...this.seen.entries()].reverse())o(d[0],{target:this.target});const u={};if(this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),r.external?.uri){const d=r.external.registry.get(e)?.id;if(!d)throw new Error("Schema is missing an `id` property");u.$id=r.external.uri(d)}Object.assign(u,i.def);const l=r.external?.defs??{};for(const d of this.seen.entries()){const c=d[1];c.def&&c.defId&&(l[c.defId]=c.def)}r.external||Object.keys(l).length>0&&(this.target==="draft-2020-12"?u.$defs=l:u.definitions=l);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}}function ng(t,e){if(t instanceof nc){const r=new No(e),i={};for(const o of t._idmap.entries()){const[u,l]=o;r.process(l)}const s={},a={registry:t,uri:e?.uri,defs:i};for(const o of t._idmap.entries()){const[u,l]=o;s[u]=r.emit(l,{...e,external:a})}if(Object.keys(i).length>0){const o=r.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[o]:i}}return{schemas:s}}const n=new No(e);return n.process(t),n.emit(t,e)}function Ze(t,e){const n=e??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);const i=t._zod.def;switch(i.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Ze(i.element,n);case"object":{for(const s in i.shape)if(Ze(i.shape[s],n))return!0;return!1}case"union":{for(const s of i.options)if(Ze(s,n))return!0;return!1}case"intersection":return Ze(i.left,n)||Ze(i.right,n);case"tuple":{for(const s of i.items)if(Ze(s,n))return!0;return!!(i.rest&&Ze(i.rest,n))}case"record":return Ze(i.keyType,n)||Ze(i.valueType,n);case"map":return Ze(i.keyType,n)||Ze(i.valueType,n);case"set":return Ze(i.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Ze(i.innerType,n);case"lazy":return Ze(i.getter(),n);case"default":return Ze(i.innerType,n);case"prefault":return Ze(i.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return Ze(i.in,n)||Ze(i.out,n);case"success":return!1;case"catch":return!1}throw new Error(`Unknown schema type: ${i.type}`)}const sc=({size:t=24,color:e="currentColor",...n})=>O.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},O.createElement("path",{d:"M9 7H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 7.76 3 8.04 3 8.6v10.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21H9m0 0h6m-6 0V4.6c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 3 10.04 3 10.6 3h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 3.76 15 4.04 15 4.6V21m0-10h4.4c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C21 11.76 21 12.04 21 12.6v6.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C20.24 21 19.96 21 19.4 21H15"}));sc.displayName="BarChart10";const ac=({size:t=24,color:e="currentColor",...n})=>O.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},O.createElement("path",{d:"M15 21v-5.4c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 14 13.96 14 13.4 14h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 14.76 9 15.04 9 15.6V21M3 7a3 3 0 0 0 6 0 3 3 0 1 0 6 0 3 3 0 1 0 6 0M6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C19.48 3 18.92 3 17.8 3H6.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C3 4.52 3 5.08 3 6.2v11.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21Z"}));ac.displayName="Building02";const oc=({size:t=24,color:e="currentColor",...n})=>O.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},O.createElement("path",{d:"m7 15 5 5 5-5M7 9l5-5 5 5"}));oc.displayName="ChevronSelectorVertical";const uc=({size:t=24,color:e="currentColor",...n})=>O.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},O.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"}));uc.displayName="Coins01";const lc=({size:t=24,color:e="currentColor",...n})=>O.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},O.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"}));lc.displayName="CurrencyDollar";const cc=({size:t=24,color:e="currentColor",...n})=>O.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},O.createElement("path",{d:"M12 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm7-14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM5 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}));cc.displayName="DotsGrid";const dc=({size:t=24,color:e="currentColor",...n})=>O.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},O.createElement("path",{d:"M2 12h20M2 12c0 5.523 4.477 10 10 10M2 12C2 6.477 6.477 2 12 2m10 10c0 5.523-4.477 10-10 10m10-10c0-5.523-4.477-10-10-10m0 0a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10m0-20a15.3 15.3 0 0 0-4 10 15.3 15.3 0 0 0 4 10"}));dc.displayName="Globe01";const fc=({size:t=24,color:e="currentColor",...n})=>O.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},O.createElement("path",{d:"M9 21v-7.4c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C9.76 12 10.04 12 10.6 12h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C15 12.76 15 13.04 15 13.6V21M11.018 2.764 4.235 8.039c-.453.353-.68.53-.843.75a2 2 0 0 0-.318.65C3 9.704 3 9.991 3 10.565V17.8c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C4.52 21 5.08 21 6.2 21h11.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C21 19.48 21 18.92 21 17.8v-7.235c0-.574 0-.861-.074-1.126a2.002 2.002 0 0 0-.318-.65c-.163-.22-.39-.397-.843-.75l-6.783-5.275c-.351-.273-.527-.41-.72-.462a1 1 0 0 0-.523 0c-.194.052-.37.189-.721.462Z"}));fc.displayName="Home02";const hc=({size:t=24,color:e="currentColor",...n})=>O.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},O.createElement("path",{d:"M16.2 21H6.931c-.605 0-.908 0-1.049-.12a.5.5 0 0 1-.173-.42c.014-.183.228-.397.657-.826l8.503-8.503c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668L21 15v1.2M16.2 21c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2M16.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.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.4M10.5 8.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"}));hc.displayName="Image01";const pc=({size:t=24,color:e="currentColor",...n})=>O.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},O.createElement("path",{d:"M15 3v18M7.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.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3Z"}));pc.displayName="LayoutRight";const mc=({size:t=24,color:e="currentColor",...n})=>O.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},O.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"}));mc.displayName="Lightbulb01";const gc=({size:t=24,color:e="currentColor",...n})=>O.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},O.createElement("path",{d:"m16 17 5-5m0 0-5-5m5 5H9m0-9H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21H9"}));gc.displayName="LogOut01";const bc=({size:t=24,color:e="currentColor",...n})=>O.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},O.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"}));bc.displayName="LogOut04";const Ec=({size:t=24,color:e="currentColor",...n})=>O.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},O.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));Ec.displayName="Mail01";const xc=({size:t=24,color:e="currentColor",...n})=>O.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},O.createElement("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"}),O.createElement("path",{d:"M18.727 14.727a1.5 1.5 0 0 0 .3 1.655l.055.054a1.816 1.816 0 0 1 0 2.573 1.818 1.818 0 0 1-2.573 0l-.055-.055a1.5 1.5 0 0 0-1.654-.3 1.5 1.5 0 0 0-.91 1.373v.155a1.818 1.818 0 1 1-3.636 0V20.1a1.5 1.5 0 0 0-.981-1.373 1.5 1.5 0 0 0-1.655.3l-.054.055a1.818 1.818 0 0 1-3.106-1.287 1.818 1.818 0 0 1 .533-1.286l.054-.055a1.5 1.5 0 0 0 .3-1.654 1.5 1.5 0 0 0-1.372-.91h-.155a1.818 1.818 0 1 1 0-3.636H3.9a1.5 1.5 0 0 0 1.373-.981 1.5 1.5 0 0 0-.3-1.655l-.055-.054A1.818 1.818 0 1 1 7.491 4.99l.054.054a1.5 1.5 0 0 0 1.655.3h.073a1.5 1.5 0 0 0 .909-1.372v-.155a1.818 1.818 0 0 1 3.636 0V3.9a1.499 1.499 0 0 0 .91 1.373 1.5 1.5 0 0 0 1.654-.3l.054-.055a1.817 1.817 0 0 1 2.573 0 1.819 1.819 0 0 1 0 2.573l-.055.054a1.5 1.5 0 0 0-.3 1.655v.073a1.5 1.5 0 0 0 1.373.909h.155a1.818 1.818 0 0 1 0 3.636H20.1a1.499 1.499 0 0 0-1.373.91Z"}));xc.displayName="Settings01";const Pi=({size:t=24,color:e="currentColor",...n})=>O.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},O.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"}));Pi.displayName="Stars01";const Tc=({size:t=24,color:e="currentColor",...n})=>O.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},O.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"}));Tc.displayName="Stop";const _c=({size:t=24,color:e="currentColor",...n})=>O.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},O.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"}));_c.displayName="Target04";const yc=({size:t=24,color:e="currentColor",...n})=>O.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},O.createElement("path",{d:"m4 17 6-6-6-6m8 14h8"}));yc.displayName="Terminal";const kc=({size:t=24,color:e="currentColor",...n})=>O.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},O.createElement("path",{d:"M5.316 19.438A4.001 4.001 0 0 1 9 17h6a4.001 4.001 0 0 1 3.684 2.438M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm6 2.5c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));kc.displayName="UserCircle";const Sc=({size:t=24,color:e="currentColor",...n})=>O.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},O.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));Sc.displayName="Users01";function rg(t,e){const n=z.c(4);let r;n[0]!==e?(r={},n[0]=e,n[1]=r):r=n[1];const i=r,s=t??G0;let a;return n[2]!==s?(a=Q0(s),n[2]=s,n[3]=a):a=n[3],K0(s,"LLM",a,i)}function Sa(){const t=z.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=Br.decoChatOpen(),t[0]=e):e=t[0];const[n,r]=Dn(e,ig);let i;return t[1]!==n||t[2]!==r?(i=[n,r],t[1]=n,t[2]=r,t[3]=i):i=t[3],i}function ig(t){return!!(t??!1)}var Ac="vercel.ai.error",sg=Symbol.for(Ac),vo,wo,Gt=class Cc extends(wo=Error,vo=sg,wo){constructor({name:e,message:n,cause:r}){super(n),this[vo]=!0,this.name=e,this.cause=r}static isInstance(e){return Cc.hasMarker(e,Ac)}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 Ic(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.message:JSON.stringify(t)}var Nc="AI_InvalidArgumentError",vc=`vercel.ai.error.${Nc}`,ag=Symbol.for(vc),Ro,Oo,og=class extends(Oo=Gt,Ro=ag,Oo){constructor({message:t,cause:e,argument:n}){super({name:Nc,message:t,cause:e}),this[Ro]=!0,this.argument=n}static isInstance(t){return Gt.hasMarker(t,vc)}},wc="AI_JSONParseError",Rc=`vercel.ai.error.${wc}`,ug=Symbol.for(Rc),Lo,Do,Po=class extends(Do=Gt,Lo=ug,Do){constructor({text:t,cause:e}){super({name:wc,message:`JSON parsing failed: Text: ${t}.
|
|
30
|
-
Error message: ${Ic(e)}`,cause:e}),this[Lo]=!0,this.text=t}static isInstance(t){return Gt.hasMarker(t,Rc)}},Oc="AI_TypeValidationError",Lc=`vercel.ai.error.${Oc}`,lg=Symbol.for(Lc),Mo,Bo,Pn=class zs extends(Bo=Gt,Mo=lg,Bo){constructor({value:e,cause:n}){super({name:Oc,message:`Type validation failed: Value: ${JSON.stringify(e)}.
|
|
31
|
-
Error message: ${Ic(n)}`,cause:n}),this[Mo]=!0,this.value=e}static isInstance(e){return Gt.hasMarker(e,Lc)}static wrap({value:e,cause:n}){return zs.isInstance(n)&&n.value===e?n:new zs({value:e,cause:n})}};const cg=j("ZodISODateTime",(t,e)=>{Im.init(t,e),ze.init(t,e)});function dg(t){return L1(cg,t)}const fg=j("ZodISODate",(t,e)=>{Nm.init(t,e),ze.init(t,e)});function hg(t){return D1(fg,t)}const pg=j("ZodISOTime",(t,e)=>{vm.init(t,e),ze.init(t,e)});function mg(t){return P1(pg,t)}const gg=j("ZodISODuration",(t,e)=>{wm.init(t,e),ze.init(t,e)});function bg(t){return M1(gg,t)}const Eg=(t,e)=>{m0.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:n=>b0(t,n)},flatten:{value:n=>g0(t,n)},addIssue:{value:n=>t.issues.push(n)},addIssues:{value:n=>t.issues.push(...n)},isEmpty:{get(){return t.issues.length===0}}})},Mi=j("ZodError",Eg,{Parent:Error}),xg=x0(Mi),Tg=_0(Mi),_g=T0(Mi),Dc=E0(Mi),Fe=j("ZodType",(t,e)=>(Re.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...n)=>t.clone({...e,checks:[...e.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),t.clone=(n,r)=>N0(t,n,r),t.brand=()=>t,t.register=((n,r)=>(n.add(t,r),t)),t.parse=(n,r)=>xg(t,n,r,{callee:t.parse}),t.safeParse=(n,r)=>_g(t,n,r),t.parseAsync=async(n,r)=>Tg(t,n,r,{callee:t.parseAsync}),t.safeParseAsync=async(n,r)=>Dc(t,n,r),t.spa=t.safeParseAsync,t.refine=(n,r)=>t.check(gb(n,r)),t.superRefine=n=>t.check(bb(n)),t.overwrite=n=>t.check(zr(n)),t.optional=()=>jo(t),t.nullable=()=>Uo(t),t.nullish=()=>jo(Uo(t)),t.nonoptional=n=>ob(t,n),t.array=()=>Hn(t),t.or=n=>tt([t,n]),t.and=n=>Qg(t,n),t.transform=n=>Ho(t,tb(n)),t.default=n=>ib(t,n),t.prefault=n=>ab(t,n),t.catch=n=>lb(t,n),t.pipe=n=>Ho(t,n),t.readonly=()=>fb(t),t.describe=n=>{const r=t.clone();return ar.add(r,{description:n}),r},Object.defineProperty(t,"description",{get(){return ar.get(t)?.description},configurable:!0}),t.meta=(...n)=>{if(n.length===0)return ar.get(t);const r=t.clone();return ar.add(r,n[0]),r},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),Pc=j("_ZodString",(t,e)=>{ka.init(t,e),Fe.init(t,e);const n=t._zod.bag;t.format=n.format??null,t.minLength=n.minimum??null,t.maxLength=n.maximum??null,t.regex=(...r)=>t.check($1(...r)),t.includes=(...r)=>t.check(q1(...r)),t.startsWith=(...r)=>t.check(V1(...r)),t.endsWith=(...r)=>t.check(W1(...r)),t.min=(...r)=>t.check(_i(...r)),t.max=(...r)=>t.check(rc(...r)),t.length=(...r)=>t.check(ic(...r)),t.nonempty=(...r)=>t.check(_i(1,...r)),t.lowercase=r=>t.check(Z1(r)),t.uppercase=r=>t.check(Y1(r)),t.trim=()=>t.check(K1()),t.normalize=(...r)=>t.check(G1(...r)),t.toLowerCase=()=>t.check(Q1()),t.toUpperCase=()=>t.check(X1())}),yg=j("ZodString",(t,e)=>{ka.init(t,e),Pc.init(t,e),t.email=n=>t.check(f1(kg,n)),t.url=n=>t.check(b1(Sg,n)),t.jwt=n=>t.check(O1(zg,n)),t.emoji=n=>t.check(E1(Ag,n)),t.guid=n=>t.check(So(Fo,n)),t.uuid=n=>t.check(h1(Xr,n)),t.uuidv4=n=>t.check(p1(Xr,n)),t.uuidv6=n=>t.check(m1(Xr,n)),t.uuidv7=n=>t.check(g1(Xr,n)),t.nanoid=n=>t.check(x1(Cg,n)),t.guid=n=>t.check(So(Fo,n)),t.cuid=n=>t.check(T1(Ig,n)),t.cuid2=n=>t.check(_1(Ng,n)),t.ulid=n=>t.check(y1(vg,n)),t.base64=n=>t.check(v1(Mg,n)),t.base64url=n=>t.check(w1(Bg,n)),t.xid=n=>t.check(k1(wg,n)),t.ksuid=n=>t.check(S1(Rg,n)),t.ipv4=n=>t.check(A1(Og,n)),t.ipv6=n=>t.check(C1(Lg,n)),t.cidrv4=n=>t.check(I1(Dg,n)),t.cidrv6=n=>t.check(N1(Pg,n)),t.e164=n=>t.check(R1(Fg,n)),t.datetime=n=>t.check(dg(n)),t.date=n=>t.check(hg(n)),t.time=n=>t.check(mg(n)),t.duration=n=>t.check(bg(n))});function G(t){return d1(yg,t)}const ze=j("ZodStringFormat",(t,e)=>{Be.init(t,e),Pc.init(t,e)}),kg=j("ZodEmail",(t,e)=>{Em.init(t,e),ze.init(t,e)}),Fo=j("ZodGUID",(t,e)=>{gm.init(t,e),ze.init(t,e)}),Xr=j("ZodUUID",(t,e)=>{bm.init(t,e),ze.init(t,e)}),Sg=j("ZodURL",(t,e)=>{xm.init(t,e),ze.init(t,e)}),Ag=j("ZodEmoji",(t,e)=>{Tm.init(t,e),ze.init(t,e)}),Cg=j("ZodNanoID",(t,e)=>{_m.init(t,e),ze.init(t,e)}),Ig=j("ZodCUID",(t,e)=>{ym.init(t,e),ze.init(t,e)}),Ng=j("ZodCUID2",(t,e)=>{km.init(t,e),ze.init(t,e)}),vg=j("ZodULID",(t,e)=>{Sm.init(t,e),ze.init(t,e)}),wg=j("ZodXID",(t,e)=>{Am.init(t,e),ze.init(t,e)}),Rg=j("ZodKSUID",(t,e)=>{Cm.init(t,e),ze.init(t,e)}),Og=j("ZodIPv4",(t,e)=>{Rm.init(t,e),ze.init(t,e)}),Lg=j("ZodIPv6",(t,e)=>{Om.init(t,e),ze.init(t,e)}),Dg=j("ZodCIDRv4",(t,e)=>{Lm.init(t,e),ze.init(t,e)}),Pg=j("ZodCIDRv6",(t,e)=>{Dm.init(t,e),ze.init(t,e)}),Mg=j("ZodBase64",(t,e)=>{Pm.init(t,e),ze.init(t,e)}),Bg=j("ZodBase64URL",(t,e)=>{Bm.init(t,e),ze.init(t,e)}),Fg=j("ZodE164",(t,e)=>{Fm.init(t,e),ze.init(t,e)}),zg=j("ZodJWT",(t,e)=>{jm.init(t,e),ze.init(t,e)}),Mc=j("ZodNumber",(t,e)=>{ec.init(t,e),Fe.init(t,e),t.gt=(r,i)=>t.check(Co(r,i)),t.gte=(r,i)=>t.check(as(r,i)),t.min=(r,i)=>t.check(as(r,i)),t.lt=(r,i)=>t.check(Ao(r,i)),t.lte=(r,i)=>t.check(ss(r,i)),t.max=(r,i)=>t.check(ss(r,i)),t.int=r=>t.check(zo(r)),t.safe=r=>t.check(zo(r)),t.positive=r=>t.check(Co(0,r)),t.nonnegative=r=>t.check(as(0,r)),t.negative=r=>t.check(Ao(0,r)),t.nonpositive=r=>t.check(ss(0,r)),t.multipleOf=(r,i)=>t.check(Io(r,i)),t.step=(r,i)=>t.check(Io(r,i)),t.finite=()=>t;const n=t._zod.bag;t.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),t.isFinite=!0,t.format=n.format??null});function jg(t){return B1(Mc,t)}const Ug=j("ZodNumberFormat",(t,e)=>{Um.init(t,e),Mc.init(t,e)});function zo(t){return F1(Ug,t)}const Hg=j("ZodBoolean",(t,e)=>{Hm.init(t,e),Fe.init(t,e)});function Xe(t){return z1(Hg,t)}const $g=j("ZodNull",(t,e)=>{$m.init(t,e),Fe.init(t,e)});function Zg(t){return j1($g,t)}const Yg=j("ZodUnknown",(t,e)=>{Zm.init(t,e),Fe.init(t,e)});function Ct(){return U1(Yg)}const qg=j("ZodNever",(t,e)=>{Ym.init(t,e),Fe.init(t,e)});function Bc(t){return H1(qg,t)}const Vg=j("ZodArray",(t,e)=>{qm.init(t,e),Fe.init(t,e),t.element=e.element,t.min=(n,r)=>t.check(_i(n,r)),t.nonempty=n=>t.check(_i(1,n)),t.max=(n,r)=>t.check(rc(n,r)),t.length=(n,r)=>t.check(ic(n,r)),t.unwrap=()=>t.element});function Hn(t,e){return J1(Vg,t,e)}const Fc=j("ZodObject",(t,e)=>{Vm.init(t,e),Fe.init(t,e),ye(t,"shape",()=>e.shape),t.keyof=()=>jc(Object.keys(t._zod.def.shape)),t.catchall=n=>t.clone({...t._zod.def,catchall:n}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Ct()}),t.loose=()=>t.clone({...t._zod.def,catchall:Ct()}),t.strict=()=>t.clone({...t._zod.def,catchall:Bc()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=n=>y0(t,n),t.merge=n=>k0(t,n),t.pick=n=>S0(t,n),t.omit=n=>A0(t,n),t.partial=(...n)=>C0(Uc,t,n[0]),t.required=(...n)=>I0(Hc,t,n[0])});function Ne(t,e){const n={type:"object",get shape(){return Nl(this,"shape",{...t}),this.shape},...re(e)};return new Fc(n)}function Oe(t,e){return new Fc({type:"object",get shape(){return Nl(this,"shape",{...t}),this.shape},catchall:Bc(),...re(e)})}const zc=j("ZodUnion",(t,e)=>{tc.init(t,e),Fe.init(t,e),t.options=e.options});function tt(t,e){return new zc({type:"union",options:t,...re(e)})}const Wg=j("ZodDiscriminatedUnion",(t,e)=>{zc.init(t,e),Wm.init(t,e)});function Gg(t,e,n){return new Wg({type:"union",options:e,discriminator:t,...re(n)})}const Kg=j("ZodIntersection",(t,e)=>{Gm.init(t,e),Fe.init(t,e)});function Qg(t,e){return new Kg({type:"intersection",left:t,right:e})}const Xg=j("ZodRecord",(t,e)=>{Km.init(t,e),Fe.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function Ar(t,e,n){return new Xg({type:"record",keyType:t,valueType:e,...re(n)})}const js=j("ZodEnum",(t,e)=>{Qm.init(t,e),Fe.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);const n=new Set(Object.keys(e.entries));t.extract=(r,i)=>{const s={};for(const a of r)if(n.has(a))s[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new js({...e,checks:[],...re(i),entries:s})},t.exclude=(r,i)=>{const s={...e.entries};for(const a of r)if(n.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new js({...e,checks:[],...re(i),entries:s})}});function jc(t,e){const n=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new js({type:"enum",entries:n,...re(e)})}const Jg=j("ZodLiteral",(t,e)=>{Xm.init(t,e),Fe.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function oe(t,e){return new Jg({type:"literal",values:Array.isArray(t)?t:[t],...re(e)})}const eb=j("ZodTransform",(t,e)=>{Jm.init(t,e),Fe.init(t,e),t._zod.parse=(n,r)=>{n.addIssue=s=>{if(typeof s=="string")n.issues.push(Sr(s,n.value,e));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=t),a.continue??(a.continue=!0),n.issues.push(Sr(a))}};const i=e.transform(n.value,n);return i instanceof Promise?i.then(s=>(n.value=s,n)):(n.value=i,n)}});function tb(t){return new eb({type:"transform",transform:t})}const Uc=j("ZodOptional",(t,e)=>{e1.init(t,e),Fe.init(t,e),t.unwrap=()=>t._zod.def.innerType});function jo(t){return new Uc({type:"optional",innerType:t})}const nb=j("ZodNullable",(t,e)=>{t1.init(t,e),Fe.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Uo(t){return new nb({type:"nullable",innerType:t})}const rb=j("ZodDefault",(t,e)=>{n1.init(t,e),Fe.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function ib(t,e){return new rb({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}const sb=j("ZodPrefault",(t,e)=>{r1.init(t,e),Fe.init(t,e),t.unwrap=()=>t._zod.def.innerType});function ab(t,e){return new sb({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}const Hc=j("ZodNonOptional",(t,e)=>{i1.init(t,e),Fe.init(t,e),t.unwrap=()=>t._zod.def.innerType});function ob(t,e){return new Hc({type:"nonoptional",innerType:t,...re(e)})}const ub=j("ZodCatch",(t,e)=>{s1.init(t,e),Fe.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function lb(t,e){return new ub({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const cb=j("ZodPipe",(t,e)=>{a1.init(t,e),Fe.init(t,e),t.in=e.in,t.out=e.out});function Ho(t,e){return new cb({type:"pipe",in:t,out:e})}const db=j("ZodReadonly",(t,e)=>{o1.init(t,e),Fe.init(t,e)});function fb(t){return new db({type:"readonly",innerType:t})}const hb=j("ZodLazy",(t,e)=>{u1.init(t,e),Fe.init(t,e),t.unwrap=()=>t._zod.def.getter()});function pb(t){return new hb({type:"lazy",getter:t})}const Aa=j("ZodCustom",(t,e)=>{l1.init(t,e),Fe.init(t,e)});function mb(t){const e=new ot({check:"custom"});return e._zod.check=t,e}function $c(t,e){return eg(Aa,t??(()=>!0),e)}function gb(t,e={}){return tg(Aa,t,e)}function bb(t){const e=mb(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Sr(r,n.value,e._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),i.continue??(i.continue=!e._zod.def.abort),n.issues.push(Sr(i))}},t(n.value,n)));return e}function yi(t,e={error:`Input not instance of ${t.name}`}){const n=new Aa({type:"custom",check:"custom",fn:r=>r instanceof t,abort:!0,...re(e)});return n._zod.bag.Class=t,n}var jr=({prefix:t,size:e=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=()=>{const s=n.length,a=new Array(e);for(let o=0;o<e;o++)a[o]=n[Math.random()*s|0];return a.join("")};if(t==null)return i;if(n.includes(r))throw new og({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${t}${r}${i()}`},Eb=jr();function $o(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 sn(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 Zo(t,...e){const n=new Headers(sn(t)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...e].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var xb=/"__proto__"\s*:/,Tb=/"constructor"\s*:/;function Yo(t){const e=JSON.parse(t);return e===null||typeof e!="object"||xb.test(t)===!1&&Tb.test(t)===!1?e:_b(e)}function _b(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 i in r){const s=r[i];s&&typeof s=="object"&&e.push(s)}}}return t}function yb(t){const{stackTraceLimit:e}=Error;try{Error.stackTraceLimit=0}catch{return Yo(t)}try{return Yo(t)}finally{Error.stackTraceLimit=e}}function li(t){if(t.type==="object"){t.additionalProperties=!1;const e=t.properties;if(e!=null)for(const n in e)e[n]=li(e[n])}return t.type==="array"&&t.items!=null&&(Array.isArray(t.items)?t.items=t.items.map(e=>li(e)):t.items=li(t.items)),t}var kb=Symbol("Let zodToJsonSchema decide on which parser to use"),qo={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"},Sb=t=>typeof t=="string"?{...qo,name:t}:{...qo,...t};function ht(){return{}}function Ab(t,e){var n,r,i;const s={type:"array"};return(n=t.type)!=null&&n._def&&((i=(r=t.type)==null?void 0:r._def)==null?void 0:i.typeName)!==he.ZodAny&&(s.items=Ce(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&(s.minItems=t.minLength.value),t.maxLength&&(s.maxItems=t.maxLength.value),t.exactLength&&(s.minItems=t.exactLength.value,s.maxItems=t.exactLength.value),s}function Cb(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 Ib(){return{type:"boolean"}}function Zc(t,e){return Ce(t.type._def,e)}var Nb=(t,e)=>Ce(t.innerType._def,e);function Yc(t,e,n){const r=n??e.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((i,s)=>Yc(t,e,i))};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 vb(t)}}var vb=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 wb(t,e){return{...Ce(t.innerType._def,e),default:t.defaultValue()}}function Rb(t,e){return e.effectStrategy==="input"?Ce(t.schema._def,e):ht()}function Ob(t){return{type:"string",enum:Array.from(t.values)}}var Lb=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function Db(t,e){const n=[Ce(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Ce(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i),r=[];return n.forEach(i=>{if(Lb(i))r.push(...i.allOf);else{let s=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:a,...o}=i;s=o}r.push(s)}}),r.length?{allOf:r}:void 0}function Pb(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 os=void 0,Et={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:()=>(os===void 0&&(os=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),os),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 qc(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":xt(n,"email",r.message,e);break;case"format:idn-email":xt(n,"idn-email",r.message,e);break;case"pattern:zod":Qe(n,Et.email,r.message,e);break}break;case"url":xt(n,"uri",r.message,e);break;case"uuid":xt(n,"uuid",r.message,e);break;case"regex":Qe(n,r.regex,r.message,e);break;case"cuid":Qe(n,Et.cuid,r.message,e);break;case"cuid2":Qe(n,Et.cuid2,r.message,e);break;case"startsWith":Qe(n,RegExp(`^${us(r.value,e)}`),r.message,e);break;case"endsWith":Qe(n,RegExp(`${us(r.value,e)}$`),r.message,e);break;case"datetime":xt(n,"date-time",r.message,e);break;case"date":xt(n,"date",r.message,e);break;case"time":xt(n,"time",r.message,e);break;case"duration":xt(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(us(r.value,e)),r.message,e);break}case"ip":{r.version!=="v6"&&xt(n,"ipv4",r.message,e),r.version!=="v4"&&xt(n,"ipv6",r.message,e);break}case"base64url":Qe(n,Et.base64url,r.message,e);break;case"jwt":Qe(n,Et.jwt,r.message,e);break;case"cidr":{r.version!=="v6"&&Qe(n,Et.ipv4Cidr,r.message,e),r.version!=="v4"&&Qe(n,Et.ipv6Cidr,r.message,e);break}case"emoji":Qe(n,Et.emoji(),r.message,e);break;case"ulid":{Qe(n,Et.ulid,r.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{xt(n,"binary",r.message,e);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{Qe(n,Et.base64,r.message,e);break}}break}case"nanoid":Qe(n,Et.nanoid,r.message,e)}return n}function us(t,e){return e.patternStrategy==="escape"?Bb(t):t}var Mb=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Bb(t){let e="";for(let n=0;n<t.length;n++)Mb.has(t[n])||(e+="\\"),e+=t[n];return e}function xt(t,e,n,r){var i;t.format||(i=t.anyOf)!=null&&i.some(s=>s.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 i;t.pattern||(i=t.allOf)!=null&&i.some(s=>s.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern}),delete t.pattern),t.allOf.push({pattern:Vo(e,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):t.pattern=Vo(e,r)}function Vo(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")},i=r.i?t.source.toLowerCase():t.source;let s="",a=!1,o=!1,u=!1;for(let l=0;l<i.length;l++){if(a){s+=i[l],a=!1;continue}if(r.i){if(o){if(i[l].match(/[a-z]/)){u?(s+=i[l],s+=`${i[l-2]}-${i[l]}`.toUpperCase(),u=!1):i[l+1]==="-"&&((n=i[l+2])!=null&&n.match(/[a-z]/))?(s+=i[l],u=!0):s+=`${i[l]}${i[l].toUpperCase()}`;continue}}else if(i[l].match(/[a-z]/)){s+=`[${i[l]}${i[l].toUpperCase()}]`;continue}}if(r.m){if(i[l]==="^"){s+=`(^|(?<=[\r
|
|
32
|
-
]))`;continue}else if(i[l]==="$"){s+=`($|(?=[\r
|
|
33
|
-
]))`;continue}}if(r.s&&i[l]==="."){s+=o?`${i[l]}\r
|
|
34
|
-
`:`[${i[l]}\r
|
|
35
|
-
]`;continue}s+=i[l],i[l]==="\\"?a=!0:o&&i[l]==="]"?o=!1:!o&&i[l]==="["&&(o=!0)}try{new RegExp(s)}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 s}function Vc(t,e){var n,r,i,s,a,o;const u={type:"object",additionalProperties:(n=Ce(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]}))!=null?n:e.allowedAdditionalProperties};if(((r=t.keyType)==null?void 0:r._def.typeName)===he.ZodString&&((i=t.keyType._def.checks)!=null&&i.length)){const{type:l,...d}=qc(t.keyType._def,e);return{...u,propertyNames:d}}else{if(((s=t.keyType)==null?void 0:s._def.typeName)===he.ZodEnum)return{...u,propertyNames:{enum:t.keyType._def.values}};if(((a=t.keyType)==null?void 0:a._def.typeName)===he.ZodBranded&&t.keyType._def.type._def.typeName===he.ZodString&&((o=t.keyType._def.type._def.checks)!=null&&o.length)){const{type:l,...d}=Zc(t.keyType._def,e);return{...u,propertyNames:d}}}return u}function Fb(t,e){if(e.mapStrategy==="record")return Vc(t,e);const n=Ce(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||ht(),r=Ce(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||ht();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function zb(t){const e=t.values,r=Object.keys(t.values).filter(s=>typeof e[e[s]]!="number").map(s=>e[s]),i=Array.from(new Set(r.map(s=>typeof s)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r}}function jb(){return{not:ht()}}function Ub(){return{type:"null"}}var Us={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Hb(t,e){const n=t.options instanceof Map?Array.from(t.options.values()):t.options;if(n.every(r=>r._def.typeName in Us&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((i,s)=>{const a=Us[s._def.typeName];return a&&!i.includes(a)?[...i,a]:i},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((i,s)=>{const a=typeof s._def.value;switch(a){case"string":case"number":case"boolean":return[...i,a];case"bigint":return[...i,"integer"];case"object":if(s._def.value===null)return[...i,"null"];default:return i}},[]);if(r.length===n.length){const i=r.filter((s,a,o)=>o.indexOf(s)===a);return{type:i.length>1?i:i[0],enum:n.reduce((s,a)=>s.includes(a._def.value)?s:[...s,a._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(s=>!r.includes(s))],[])};return $b(t,e)}var $b=(t,e)=>{const n=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((r,i)=>Ce(r._def,{...e,currentPath:[...e.currentPath,"anyOf",`${i}`]})).filter(r=>!!r&&(!e.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function Zb(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return{type:[Us[t.innerType._def.typeName],"null"]};const n=Ce(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function Yb(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 qb(t,e){const n={type:"object",properties:{}},r=[],i=t.shape();for(const a in i){let o=i[a];if(o===void 0||o._def===void 0)continue;const u=Wb(o),l=Ce(o._def,{...e,currentPath:[...e.currentPath,"properties",a],propertyPath:[...e.currentPath,"properties",a]});l!==void 0&&(n.properties[a]=l,u||r.push(a))}r.length&&(n.required=r);const s=Vb(t,e);return s!==void 0&&(n.additionalProperties=s),n}function Vb(t,e){if(t.catchall._def.typeName!=="ZodNever")return Ce(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 Wb(t){try{return t.isOptional()}catch{return!0}}var Gb=(t,e)=>{var n;if(e.currentPath.toString()===((n=e.propertyPath)==null?void 0:n.toString()))return Ce(t.innerType._def,e);const r=Ce(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:ht()},r]}:ht()},Kb=(t,e)=>{if(e.pipeStrategy==="input")return Ce(t.in._def,e);if(e.pipeStrategy==="output")return Ce(t.out._def,e);const n=Ce(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),r=Ce(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(i=>i!==void 0)}};function Qb(t,e){return Ce(t.type._def,e)}function Xb(t,e){const r={type:"array",uniqueItems:!0,items:Ce(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 Jb(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((n,r)=>Ce(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Ce(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((n,r)=>Ce(n._def,{...e,currentPath:[...e.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function e2(){return{not:ht()}}function t2(){return ht()}var n2=(t,e)=>Ce(t.innerType._def,e),r2=(t,e,n)=>{switch(e){case he.ZodString:return qc(t,n);case he.ZodNumber:return Yb(t);case he.ZodObject:return qb(t,n);case he.ZodBigInt:return Cb(t);case he.ZodBoolean:return Ib();case he.ZodDate:return Yc(t,n);case he.ZodUndefined:return e2();case he.ZodNull:return Ub();case he.ZodArray:return Ab(t,n);case he.ZodUnion:case he.ZodDiscriminatedUnion:return Hb(t,n);case he.ZodIntersection:return Db(t,n);case he.ZodTuple:return Jb(t,n);case he.ZodRecord:return Vc(t,n);case he.ZodLiteral:return Pb(t);case he.ZodEnum:return Ob(t);case he.ZodNativeEnum:return zb(t);case he.ZodNullable:return Zb(t,n);case he.ZodOptional:return Gb(t,n);case he.ZodMap:return Fb(t,n);case he.ZodSet:return Xb(t,n);case he.ZodLazy:return()=>t.getter()._def;case he.ZodPromise:return Qb(t,n);case he.ZodNaN:case he.ZodNever:return jb();case he.ZodEffects:return Rb(t,n);case he.ZodAny:return ht();case he.ZodUnknown:return t2();case he.ZodDefault:return wb(t,n);case he.ZodBranded:return Zc(t,n);case he.ZodReadonly:return n2(t,n);case he.ZodCatch:return Nb(t,n);case he.ZodPipeline:return Kb(t,n);case he.ZodFunction:case he.ZodVoid:case he.ZodSymbol:return;default:return(r=>{})()}},i2=(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 Ce(t,e,n=!1){var r;const i=e.seen.get(t);if(e.override){const u=(r=e.override)==null?void 0:r.call(e,t,e,i,n);if(u!==kb)return u}if(i&&!n){const u=s2(i,e);if(u!==void 0)return u}const s={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,s);const a=r2(t,t.typeName,e),o=typeof a=="function"?Ce(a(),e):a;if(o&&a2(t,e,o),e.postProcess){const u=e.postProcess(o,t,e);return s.jsonSchema=o,u}return s.jsonSchema=o,o}var s2=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:i2(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`),ht()):e.$refStrategy==="seen"?ht():void 0}},a2=(t,e,n)=>(t.description&&(n.description=t.description),n),o2=t=>{const e=Sb(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,i])=>[i._def,{def:i._def,path:[...e.basePath,e.definitionPath,r],jsonSchema:void 0}]))}},u2=(t,e)=>{var n;const r=o2(e);let i=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((l,[d,c])=>{var h;return{...l,[d]:(h=Ce(c._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0))!=null?h:ht()}},{}):void 0;const s=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,a=(n=Ce(t._def,s===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,s]},!1))!=null?n:ht(),o=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;o!==void 0&&(a.title=o);const u=s===void 0?i?{...a,[r.definitionPath]:i}:a:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,s].join("/"),[r.definitionPath]:{...i,[s]:a}};return u.$schema="http://json-schema.org/draft-07/schema#",u},Hs=Symbol.for("vercel.ai.schema");function l2(t){let e;return()=>(e==null&&(e=t()),e)}function Bi(t,{validate:e}={}){return{[Hs]:!0,_type:void 0,get jsonSchema(){return typeof t=="function"&&(t=t()),t},validate:e}}function c2(t){return typeof t=="object"&&t!==null&&Hs in t&&t[Hs]===!0&&"jsonSchema"in t&&"validate"in t}function Ca(t){return t==null?Bi({properties:{},additionalProperties:!1}):c2(t)?t:"~standard"in t?t["~standard"].vendor==="zod"?Wc(t):d2(t):t()}function d2(t){return Bi(()=>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 Pn({value:e,cause:n.issues})}}})}function f2(t,e){var n;const r=(n=void 0)!=null?n:!1;return Bi(()=>u2(t,{$refStrategy:r?"root":"none"}),{validate:async i=>{const s=await t.safeParseAsync(i);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function h2(t,e){var n;const r=(n=void 0)!=null?n:!1;return Bi(()=>li(ng(t,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async i=>{const s=await Dc(t,i);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function p2(t){return"_zod"in t}function Wc(t,e){return p2(t)?h2(t):f2(t)}async function Wo({value:t,schema:e}){const n=await Cr({value:t,schema:e});if(!n.success)throw Pn.wrap({value:t,cause:n.error});return n.value}async function Cr({value:t,schema:e}){const n=Ca(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:Pn.wrap({value:t,cause:r.error}),rawValue:t}}catch(r){return{success:!1,error:Pn.wrap({value:t,cause:r}),rawValue:t}}}async function fn({text:t,schema:e}){try{const n=yb(t);return e==null?{success:!0,value:n,rawValue:n}:await Cr({value:n,schema:e})}catch(n){return{success:!1,error:Po.isInstance(n)?n:new Po({text:t,cause:n}),rawValue:void 0}}}function m2({stream:t,schema:e}){return t.pipeThrough(new TextDecoderStream).pipeThrough(new np).pipeThrough(new TransformStream({async transform({data:n},r){n!=="[DONE]"&&r.enqueue(await fn({text:n,schema:e}))}}))}async function Zt(t){return typeof t=="function"&&(t=t()),Promise.resolve(t)}var g2=Object.defineProperty,b2=(t,e)=>{for(var n in e)g2(t,n,{get:e[n],enumerable:!0})},Gc="AI_NoObjectGeneratedError",Kc=`vercel.ai.error.${Gc}`,E2=Symbol.for(Kc),Qc,Vt=class extends Gt{constructor({message:t="No object generated.",cause:e,text:n,response:r,usage:i,finishReason:s}){super({name:Gc,message:t,cause:e}),this[Qc]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=s}static isInstance(t){return Gt.hasMarker(t,Kc)}};Qc=E2;var Go="6.0.3",Xc=tt([G(),yi(Uint8Array),yi(ArrayBuffer),$c(t=>{var e,n;return(n=(e=globalThis.Buffer)==null?void 0:e.isBuffer(t))!=null?n:!1},{message:"Must be a Buffer"})]),Ir=pb(()=>tt([Zg(),G(),jg(),Xe(),Ar(G(),Ir.optional()),Hn(Ir)])),Te=Ar(G(),Ar(G(),Ir.optional())),Jc=Ne({type:oe("text"),text:G(),providerOptions:Te.optional()}),x2=Ne({type:oe("image"),image:tt([Xc,yi(URL)]),mediaType:G().optional(),providerOptions:Te.optional()}),ed=Ne({type:oe("file"),data:tt([Xc,yi(URL)]),filename:G().optional(),mediaType:G(),providerOptions:Te.optional()}),T2=Ne({type:oe("reasoning"),text:G(),providerOptions:Te.optional()}),_2=Ne({type:oe("tool-call"),toolCallId:G(),toolName:G(),input:Ct(),providerOptions:Te.optional(),providerExecuted:Xe().optional()}),y2=Gg("type",[Ne({type:oe("text"),value:G(),providerOptions:Te.optional()}),Ne({type:oe("json"),value:Ir,providerOptions:Te.optional()}),Ne({type:oe("execution-denied"),reason:G().optional(),providerOptions:Te.optional()}),Ne({type:oe("error-text"),value:G(),providerOptions:Te.optional()}),Ne({type:oe("error-json"),value:Ir,providerOptions:Te.optional()}),Ne({type:oe("content"),value:Hn(tt([Ne({type:oe("text"),text:G(),providerOptions:Te.optional()}),Ne({type:oe("media"),data:G(),mediaType:G()}),Ne({type:oe("file-data"),data:G(),mediaType:G(),filename:G().optional(),providerOptions:Te.optional()}),Ne({type:oe("file-url"),url:G(),providerOptions:Te.optional()}),Ne({type:oe("file-id"),fileId:tt([G(),Ar(G(),G())]),providerOptions:Te.optional()}),Ne({type:oe("image-data"),data:G(),mediaType:G(),providerOptions:Te.optional()}),Ne({type:oe("image-url"),url:G(),providerOptions:Te.optional()}),Ne({type:oe("image-file-id"),fileId:tt([G(),Ar(G(),G())]),providerOptions:Te.optional()}),Ne({type:oe("custom"),providerOptions:Te.optional()})]))})]),td=Ne({type:oe("tool-result"),toolCallId:G(),toolName:G(),output:y2,providerOptions:Te.optional()}),k2=Ne({type:oe("tool-approval-request"),approvalId:G(),toolCallId:G()}),S2=Ne({type:oe("tool-approval-response"),approvalId:G(),approved:Xe(),reason:G().optional()}),A2=Ne({role:oe("system"),content:G(),providerOptions:Te.optional()}),C2=Ne({role:oe("user"),content:tt([G(),Hn(tt([Jc,x2,ed]))]),providerOptions:Te.optional()}),I2=Ne({role:oe("assistant"),content:tt([G(),Hn(tt([Jc,ed,T2,_2,td,k2]))]),providerOptions:Te.optional()}),N2=Ne({role:oe("tool"),content:Hn(tt([td,S2])),providerOptions:Te.optional()});tt([A2,C2,I2,N2]);function nd(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 i=e[r];if(i===void 0)continue;const s=r in t?t[r]:void 0,a=i!==null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),o=s!=null&&typeof s=="object"&&!Array.isArray(s)&&!(s instanceof Date)&&!(s instanceof RegExp);a&&o?n[r]=nd(s,i):n[r]=i}return n}var v2={};b2(v2,{array:()=>L2,choice:()=>D2,json:()=>P2,object:()=>O2,text:()=>R2});function w2(t){const e=["ROOT"];let n=-1,r=null;function i(u,l,d){switch(u){case'"':{n=l,e.pop(),e.push(d),e.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=l,r=l,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=l,e.pop(),e.push(d),e.push("INSIDE_NUMBER");break}case"{":{n=l,e.pop(),e.push(d),e.push("INSIDE_OBJECT_START");break}case"[":{n=l,e.pop(),e.push(d),e.push("INSIDE_ARRAY_START");break}}}function s(u,l){switch(u){case",":{e.pop(),e.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=l,e.pop();break}}}function a(u,l){switch(u){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,e.pop();break}}}for(let u=0;u<t.length;u++){const l=t[u];switch(e[e.length-1]){case"ROOT":i(l,u,"FINISH");break;case"INSIDE_OBJECT_START":{switch(l){case'"':{e.pop(),e.push("INSIDE_OBJECT_KEY");break}case"}":{n=u,e.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_KEY"));break}case"INSIDE_OBJECT_KEY":{l==='"'&&(e.pop(),e.push("INSIDE_OBJECT_AFTER_KEY"));break}case"INSIDE_OBJECT_AFTER_KEY":{l===":"&&(e.pop(),e.push("INSIDE_OBJECT_BEFORE_VALUE"));break}case"INSIDE_OBJECT_BEFORE_VALUE":{i(l,u,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{s(l,u);break}case"INSIDE_STRING":{switch(l){case'"':{e.pop(),n=u;break}case"\\":{e.push("INSIDE_STRING_ESCAPE");break}default:n=u}break}case"INSIDE_ARRAY_START":{l==="]"?(n=u,e.pop()):(n=u,i(l,u,"INSIDE_ARRAY_AFTER_VALUE"));break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(l){case",":{e.pop(),e.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=u,e.pop();break}default:{n=u;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{i(l,u,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{e.pop(),n=u;break}case"INSIDE_NUMBER":{switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=u;break}case"e":case"E":case"-":case".":break;case",":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(l,u),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&s(l,u);break}case"}":{e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&s(l,u);break}case"]":{e.pop(),e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(l,u);break}default:{e.pop();break}}break}case"INSIDE_LITERAL":{const c=t.substring(r,u+1);!"false".startsWith(c)&&!"true".startsWith(c)&&!"null".startsWith(c)?(e.pop(),e[e.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?s(l,u):e[e.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(l,u)):n=u;break}}}let o=t.slice(0,n+1);for(let u=e.length-1;u>=0;u--)switch(e[u]){case"INSIDE_STRING":{o+='"';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":{o+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{o+="]";break}case"INSIDE_LITERAL":{const d=t.substring(r,t.length);"true".startsWith(d)?o+="true".slice(d.length):"false".startsWith(d)?o+="false".slice(d.length):"null".startsWith(d)&&(o+="null".slice(d.length))}}return o}async function Ur(t){if(t===void 0)return{value:void 0,state:"undefined-input"};let e=await fn({text:t});return e.success?{value:e.value,state:"successful-parse"}:(e=await fn({text:w2(t)}),e.success?{value:e.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var R2=()=>({responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:t}){return t},async parsePartialOutput({text:t}){return{partial:t}}}),O2=({schema:t,name:e,description:n})=>{const r=Ca(t);return{responseFormat:Zt(r.jsonSchema).then(i=>({type:"json",schema:i,...e!=null&&{name:e},...n!=null&&{description:n}})),async parseCompleteOutput({text:i},s){const a=await fn({text:i});if(!a.success)throw new Vt({message:"No object generated: could not parse the response.",cause:a.error,text:i,response:s.response,usage:s.usage,finishReason:s.finishReason});const o=await Cr({value:a.value,schema:r});if(!o.success)throw new Vt({message:"No object generated: response did not match schema.",cause:o.error,text:i,response:s.response,usage:s.usage,finishReason:s.finishReason});return o.value},async parsePartialOutput({text:i}){const s=await Ur(i);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:s.value}}}}},L2=({element:t,name:e,description:n})=>{const r=Ca(t);return{responseFormat:Zt(r.jsonSchema).then(i=>{const{$schema:s,...a}=i;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:i},s){const a=await fn({text:i});if(!a.success)throw new Vt({message:"No object generated: could not parse the response.",cause:a.error,text:i,response:s.response,usage:s.usage,finishReason:s.finishReason});const o=a.value;if(o==null||typeof o!="object"||!("elements"in o)||!Array.isArray(o.elements))throw new Vt({message:"No object generated: response did not match schema.",cause:new Pn({value:o,cause:"response must be an object with an elements array"}),text:i,response:s.response,usage:s.usage,finishReason:s.finishReason});for(const u of o.elements){const l=await Cr({value:u,schema:r});if(!l.success)throw new Vt({message:"No object generated: response did not match schema.",cause:l.error,text:i,response:s.response,usage:s.usage,finishReason:s.finishReason})}return o.elements},async parsePartialOutput({text:i}){const s=await Ur(i);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const a=s.value;if(a==null||typeof a!="object"||!("elements"in a)||!Array.isArray(a.elements))return;const o=s.state==="repaired-parse"&&a.elements.length>0?a.elements.slice(0,-1):a.elements,u=[];for(const l of o){const d=await Cr({value:l,schema:r});d.success&&u.push(d.value)}return{partial:u}}}}}},D2=({options:t,name:e,description:n})=>({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},i){const s=await fn({text:r});if(!s.success)throw new Vt({message:"No object generated: could not parse the response.",cause:s.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});const a=s.value;if(a==null||typeof a!="object"||!("result"in a)||typeof a.result!="string"||!t.includes(a.result))throw new Vt({message:"No object generated: response did not match schema.",cause:new Pn({value:a,cause:"response must be an object that contains a choice value."}),text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});return a.result},async parsePartialOutput({text:r}){const i=await Ur(r);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const s=i.value;if(s==null||typeof s!="object"||!("result"in s)||typeof s.result!="string")return;const a=t.filter(o=>o.startsWith(s.result));return i.state==="successful-parse"?a.includes(s.result)?{partial:s.result}:void 0:a.length===1?{partial:a[0]}:void 0}}}}),P2=({name:t,description:e}={})=>({responseFormat:Promise.resolve({type:"json",...t!=null&&{name:t},...e!=null&&{description:e}}),async parseCompleteOutput({text:n},r){const i=await fn({text:n});if(!i.success)throw new Vt({message:"No object generated: could not parse the response.",cause:i.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.value},async parsePartialOutput({text:n}){const r=await Ur(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}}}});jr({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(t,e){e.enqueue(`data: ${JSON.stringify(t)}
|
|
36
|
-
|
|
37
|
-
`)},flush(t){t.enqueue(`data: [DONE]
|
|
38
|
-
|
|
39
|
-
`)}})}});var M2=l2(()=>Wc(tt([Oe({type:oe("text-start"),id:G(),providerMetadata:Te.optional()}),Oe({type:oe("text-delta"),id:G(),delta:G(),providerMetadata:Te.optional()}),Oe({type:oe("text-end"),id:G(),providerMetadata:Te.optional()}),Oe({type:oe("error"),errorText:G()}),Oe({type:oe("tool-input-start"),toolCallId:G(),toolName:G(),providerExecuted:Xe().optional(),dynamic:Xe().optional(),title:G().optional()}),Oe({type:oe("tool-input-delta"),toolCallId:G(),inputTextDelta:G()}),Oe({type:oe("tool-input-available"),toolCallId:G(),toolName:G(),input:Ct(),providerExecuted:Xe().optional(),providerMetadata:Te.optional(),dynamic:Xe().optional(),title:G().optional()}),Oe({type:oe("tool-input-error"),toolCallId:G(),toolName:G(),input:Ct(),providerExecuted:Xe().optional(),providerMetadata:Te.optional(),dynamic:Xe().optional(),errorText:G(),title:G().optional()}),Oe({type:oe("tool-approval-request"),approvalId:G(),toolCallId:G()}),Oe({type:oe("tool-output-available"),toolCallId:G(),output:Ct(),providerExecuted:Xe().optional(),dynamic:Xe().optional(),preliminary:Xe().optional()}),Oe({type:oe("tool-output-error"),toolCallId:G(),errorText:G(),providerExecuted:Xe().optional(),dynamic:Xe().optional()}),Oe({type:oe("tool-output-denied"),toolCallId:G()}),Oe({type:oe("reasoning-start"),id:G(),providerMetadata:Te.optional()}),Oe({type:oe("reasoning-delta"),id:G(),delta:G(),providerMetadata:Te.optional()}),Oe({type:oe("reasoning-end"),id:G(),providerMetadata:Te.optional()}),Oe({type:oe("source-url"),sourceId:G(),url:G(),title:G().optional(),providerMetadata:Te.optional()}),Oe({type:oe("source-document"),sourceId:G(),mediaType:G(),title:G(),filename:G().optional(),providerMetadata:Te.optional()}),Oe({type:oe("file"),url:G(),mediaType:G(),providerMetadata:Te.optional()}),Oe({type:$c(t=>typeof t=="string"&&t.startsWith("data-"),{message:'Type must start with "data-"'}),id:G().optional(),data:Ct(),transient:Xe().optional()}),Oe({type:oe("start-step")}),Oe({type:oe("finish-step")}),Oe({type:oe("start"),messageId:G().optional(),messageMetadata:Ct().optional()}),Oe({type:oe("finish"),finishReason:jc(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:Ct().optional()}),Oe({type:oe("abort")}),Oe({type:oe("message-metadata"),messageMetadata:Ct()})])));function B2(t){return t.type.startsWith("data-")}function $s(t){return t.type.startsWith("tool-")}function F2(t){return t.type==="dynamic-tool"}function Zs(t){return $s(t)||F2(t)}function Ko(t){return t.type.split("-").slice(1).join("-")}function z2({lastMessage:t,messageId:e}){return{message:t?.role==="assistant"?t:{id:e,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function j2({stream:t,messageMetadataSchema:e,dataPartSchemas:n,runUpdateMessageJob:r,onError:i,onToolCall:s,onData:a}){return t.pipeThrough(new TransformStream({async transform(o,u){await r(async({state:l,write:d})=>{var c,h,m,g;function E(b){const w=l.message.parts.filter(Zs).find(y=>y.toolCallId===b);if(w==null)throw new Error(`no tool invocation found for tool call ${b}`);return w}function T(b){var C;const w=l.message.parts.find(D=>$s(D)&&D.toolCallId===b.toolCallId),y=b,R=w;w!=null?(w.state=b.state,R.input=y.input,R.output=y.output,R.errorText=y.errorText,R.rawInput=y.rawInput,R.preliminary=y.preliminary,b.title!==void 0&&(R.title=b.title),R.providerExecuted=(C=y.providerExecuted)!=null?C:w.providerExecuted,y.providerMetadata!=null&&w.state==="input-available"&&(w.callProviderMetadata=y.providerMetadata)):l.message.parts.push({type:`tool-${b.toolName}`,toolCallId:b.toolCallId,state:b.state,title:b.title,input:y.input,output:y.output,rawInput:y.rawInput,errorText:y.errorText,providerExecuted:y.providerExecuted,preliminary:y.preliminary,...y.providerMetadata!=null?{callProviderMetadata:y.providerMetadata}:{}})}function x(b){var C,w;const y=l.message.parts.find(P=>P.type==="dynamic-tool"&&P.toolCallId===b.toolCallId),R=b,D=y;y!=null?(y.state=b.state,D.toolName=b.toolName,D.input=R.input,D.output=R.output,D.errorText=R.errorText,D.rawInput=(C=R.rawInput)!=null?C:D.rawInput,D.preliminary=R.preliminary,b.title!==void 0&&(D.title=b.title),D.providerExecuted=(w=R.providerExecuted)!=null?w:y.providerExecuted,R.providerMetadata!=null&&y.state==="input-available"&&(y.callProviderMetadata=R.providerMetadata)):l.message.parts.push({type:"dynamic-tool",toolName:b.toolName,toolCallId:b.toolCallId,state:b.state,input:R.input,output:R.output,errorText:R.errorText,preliminary:R.preliminary,providerExecuted:R.providerExecuted,title:b.title,...R.providerMetadata!=null?{callProviderMetadata:R.providerMetadata}:{}})}async function _(b){if(b!=null){const C=l.message.metadata!=null?nd(l.message.metadata,b):b;e!=null&&await Wo({value:C,schema:e}),l.message.metadata=C}}switch(o.type){case"text-start":{const b={type:"text",text:"",providerMetadata:o.providerMetadata,state:"streaming"};l.activeTextParts[o.id]=b,l.message.parts.push(b),d();break}case"text-delta":{const b=l.activeTextParts[o.id];b.text+=o.delta,b.providerMetadata=(c=o.providerMetadata)!=null?c:b.providerMetadata,d();break}case"text-end":{const b=l.activeTextParts[o.id];b.state="done",b.providerMetadata=(h=o.providerMetadata)!=null?h:b.providerMetadata,delete l.activeTextParts[o.id],d();break}case"reasoning-start":{const b={type:"reasoning",text:"",providerMetadata:o.providerMetadata,state:"streaming"};l.activeReasoningParts[o.id]=b,l.message.parts.push(b),d();break}case"reasoning-delta":{const b=l.activeReasoningParts[o.id];b.text+=o.delta,b.providerMetadata=(m=o.providerMetadata)!=null?m:b.providerMetadata,d();break}case"reasoning-end":{const b=l.activeReasoningParts[o.id];b.providerMetadata=(g=o.providerMetadata)!=null?g:b.providerMetadata,b.state="done",delete l.activeReasoningParts[o.id],d();break}case"file":{l.message.parts.push({type:"file",mediaType:o.mediaType,url:o.url}),d();break}case"source-url":{l.message.parts.push({type:"source-url",sourceId:o.sourceId,url:o.url,title:o.title,providerMetadata:o.providerMetadata}),d();break}case"source-document":{l.message.parts.push({type:"source-document",sourceId:o.sourceId,mediaType:o.mediaType,title:o.title,filename:o.filename,providerMetadata:o.providerMetadata}),d();break}case"tool-input-start":{const b=l.message.parts.filter($s);l.partialToolCalls[o.toolCallId]={text:"",toolName:o.toolName,index:b.length,dynamic:o.dynamic,title:o.title},o.dynamic?x({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-streaming",input:void 0,providerExecuted:o.providerExecuted,title:o.title}):T({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-streaming",input:void 0,providerExecuted:o.providerExecuted,title:o.title}),d();break}case"tool-input-delta":{const b=l.partialToolCalls[o.toolCallId];b.text+=o.inputTextDelta;const{value:C}=await Ur(b.text);b.dynamic?x({toolCallId:o.toolCallId,toolName:b.toolName,state:"input-streaming",input:C,title:b.title}):T({toolCallId:o.toolCallId,toolName:b.toolName,state:"input-streaming",input:C,title:b.title}),d();break}case"tool-input-available":{o.dynamic?x({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-available",input:o.input,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata,title:o.title}):T({toolCallId:o.toolCallId,toolName:o.toolName,state:"input-available",input:o.input,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata,title:o.title}),d(),s&&!o.providerExecuted&&await s({toolCall:o});break}case"tool-input-error":{o.dynamic?x({toolCallId:o.toolCallId,toolName:o.toolName,state:"output-error",input:o.input,errorText:o.errorText,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata}):T({toolCallId:o.toolCallId,toolName:o.toolName,state:"output-error",input:void 0,rawInput:o.input,errorText:o.errorText,providerExecuted:o.providerExecuted,providerMetadata:o.providerMetadata}),d();break}case"tool-approval-request":{const b=E(o.toolCallId);b.state="approval-requested",b.approval={id:o.approvalId},d();break}case"tool-output-denied":{const b=E(o.toolCallId);b.state="output-denied",d();break}case"tool-output-available":{const b=E(o.toolCallId);b.type==="dynamic-tool"?x({toolCallId:o.toolCallId,toolName:b.toolName,state:"output-available",input:b.input,output:o.output,preliminary:o.preliminary,providerExecuted:o.providerExecuted,title:b.title}):T({toolCallId:o.toolCallId,toolName:Ko(b),state:"output-available",input:b.input,output:o.output,providerExecuted:o.providerExecuted,preliminary:o.preliminary,title:b.title}),d();break}case"tool-output-error":{const b=E(o.toolCallId);b.type==="dynamic-tool"?x({toolCallId:o.toolCallId,toolName:b.toolName,state:"output-error",input:b.input,errorText:o.errorText,providerExecuted:o.providerExecuted,title:b.title}):T({toolCallId:o.toolCallId,toolName:Ko(b),state:"output-error",input:b.input,rawInput:b.rawInput,errorText:o.errorText,providerExecuted:o.providerExecuted,title:b.title}),d();break}case"start-step":{l.message.parts.push({type:"step-start"});break}case"finish-step":{l.activeTextParts={},l.activeReasoningParts={};break}case"start":{o.messageId!=null&&(l.message.id=o.messageId),await _(o.messageMetadata),(o.messageId!=null||o.messageMetadata!=null)&&d();break}case"finish":{o.finishReason!=null&&(l.finishReason=o.finishReason),await _(o.messageMetadata),o.messageMetadata!=null&&d();break}case"message-metadata":{await _(o.messageMetadata),o.messageMetadata!=null&&d();break}case"error":{i?.(new Error(o.errorText));break}default:if(B2(o)){n?.[o.type]!=null&&await Wo({value:o.data,schema:n[o.type]});const b=o;if(b.transient){a?.(b);break}const C=b.id!=null?l.message.parts.find(w=>b.type===w.type&&b.id===w.id):void 0;C!=null?C.data=b.data:l.message.parts.push(b),a?.(b),d()}}u.enqueue(o)})}}))}async function U2({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()}}jr({prefix:"aitxt",size:24});jr({prefix:"aiobj",size:24});var H2=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()})}};jr({prefix:"aiobj",size:24});async function $2(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,i=await new Promise((s,a)=>{const o=new FileReader;o.onload=u=>{var l;s((l=u.target)==null?void 0:l.result)},o.onerror=u=>a(u),o.readAsDataURL(e)});return{type:"file",mediaType:r,filename:n,url:i}}))}var Z2=class{constructor({api:t="/api/chat",credentials:e,headers:n,body:r,fetch:i,prepareSendMessagesRequest:s,prepareReconnectToStreamRequest:a}){this.api=t,this.credentials=e,this.headers=n,this.body=r,this.fetch=i,this.prepareSendMessagesRequest=s,this.prepareReconnectToStreamRequest=a}async sendMessages({abortSignal:t,...e}){var n,r,i,s,a;const o=await Zt(this.body),u=await Zt(this.headers),l=await Zt(this.credentials),d={...sn(u),...sn(e.headers)},c=await((n=this.prepareSendMessagesRequest)==null?void 0:n.call(this,{api:this.api,id:e.chatId,messages:e.messages,body:{...o,...e.body},headers:d,credentials:l,requestMetadata:e.metadata,trigger:e.trigger,messageId:e.messageId})),h=(r=c?.api)!=null?r:this.api,m=c?.headers!==void 0?sn(c.headers):d,g=c?.body!==void 0?c.body:{...o,...e.body,id:e.chatId,messages:e.messages,trigger:e.trigger,messageId:e.messageId},E=(i=c?.credentials)!=null?i:l,x=await((s=this.fetch)!=null?s:globalThis.fetch)(h,{method:"POST",headers:Zo({"Content-Type":"application/json",...m},`ai-sdk/${Go}`,$o()),body:JSON.stringify(g),credentials:E,signal:t});if(!x.ok)throw new Error((a=await x.text())!=null?a:"Failed to fetch the chat response.");if(!x.body)throw new Error("The response body is empty.");return this.processResponseStream(x.body)}async reconnectToStream(t){var e,n,r,i,s;const a=await Zt(this.body),o=await Zt(this.headers),u=await Zt(this.credentials),l={...sn(o),...sn(t.headers)},d=await((e=this.prepareReconnectToStreamRequest)==null?void 0:e.call(this,{api:this.api,id:t.chatId,body:{...a,...t.body},headers:l,credentials:u,requestMetadata:t.metadata})),c=(n=d?.api)!=null?n:`${this.api}/${t.chatId}/stream`,h=d?.headers!==void 0?sn(d.headers):l,m=(r=d?.credentials)!=null?r:u,E=await((i=this.fetch)!=null?i:globalThis.fetch)(c,{method:"GET",headers:Zo(h,`ai-sdk/${Go}`,$o()),credentials:m});if(E.status===204)return null;if(!E.ok)throw new Error((s=await E.text())!=null?s:"Failed to fetch the chat response.");if(!E.body)throw new Error("The response body is empty.");return this.processResponseStream(E.body)}},rd=class extends Z2{constructor(t={}){super(t)}processResponseStream(t){return m2({stream:t,schema:M2}).pipeThrough(new TransformStream({async transform(e,n){if(!e.success)throw e.error;n.enqueue(e.value)}}))}},Y2=class{constructor({generateId:t=Eb,id:e=t(),transport:n=new rd,messageMetadataSchema:r,dataPartSchemas:i,state:s,onError:a,onToolCall:o,onFinish:u,onData:l,sendAutomaticallyWhen:d}){this.activeResponse=void 0,this.jobExecutor=new H2,this.sendMessage=async(c,h)=>{var m,g,E,T;if(c==null){await this.makeRequest({trigger:"submit-message",messageId:(m=this.lastMessage)==null?void 0:m.id,...h});return}let x;if("text"in c||"files"in c?x={parts:[...Array.isArray(c.files)?c.files:await $2(c.files),..."text"in c&&c.text!=null?[{type:"text",text:c.text}]:[]]}:x=c,c.messageId!=null){const _=this.state.messages.findIndex(b=>b.id===c.messageId);if(_===-1)throw new Error(`message with id ${c.messageId} not found`);if(this.state.messages[_].role!=="user")throw new Error(`message with id ${c.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,_+1),this.state.replaceMessage(_,{...x,id:c.messageId,role:(g=x.role)!=null?g:"user",metadata:c.metadata})}else this.state.pushMessage({...x,id:(E=x.id)!=null?E:this.generateId(),role:(T=x.role)!=null?T:"user",metadata:c.metadata});await this.makeRequest({trigger:"submit-message",messageId:c.messageId,...h})},this.regenerate=async({messageId:c,...h}={})=>{const m=c==null?this.state.messages.length-1:this.state.messages.findIndex(g=>g.id===c);if(m===-1)throw new Error(`message ${c} not found`);this.state.messages=this.state.messages.slice(0,this.messages[m].role==="assistant"?m:m+1),await this.makeRequest({trigger:"regenerate-message",messageId:c,...h})},this.resumeStream=async(c={})=>{await this.makeRequest({trigger:"resume-stream",...c})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:c,approved:h,reason:m})=>this.jobExecutor.run(async()=>{var g,E;const T=this.state.messages,x=T[T.length-1],_=b=>Zs(b)&&b.state==="approval-requested"&&b.approval.id===c?{...b,state:"approval-responded",approval:{id:c,approved:h,reason:m}}:b;this.state.replaceMessage(T.length-1,{...x,parts:x.parts.map(_)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(_)),this.status!=="streaming"&&this.status!=="submitted"&&((g=this.sendAutomaticallyWhen)!=null&&g.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(E=this.lastMessage)==null?void 0:E.id})}),this.addToolOutput=async({state:c="output-available",tool:h,toolCallId:m,output:g,errorText:E})=>this.jobExecutor.run(async()=>{var T,x;const _=this.state.messages,b=_[_.length-1],C=w=>Zs(w)&&w.toolCallId===m?{...w,state:c,output:g,errorText:E}:w;this.state.replaceMessage(_.length-1,{...b,parts:b.parts.map(C)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(C)),this.status!=="streaming"&&this.status!=="submitted"&&((T=this.sendAutomaticallyWhen)!=null&&T.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(x=this.lastMessage)==null?void 0:x.id})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var c;this.status!=="streaming"&&this.status!=="submitted"||(c=this.activeResponse)!=null&&c.abortController&&this.activeResponse.abortController.abort()},this.id=e,this.transport=n,this.generateId=t,this.messageMetadataSchema=r,this.dataPartSchemas=i,this.state=s,this.onError=a,this.onToolCall=o,this.onFinish=u,this.onData=l,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:i}){var s,a,o,u;this.setStatus({status:"submitted",error:void 0});const l=this.lastMessage;let d=!1,c=!1,h=!1;try{const m={state:z2({lastMessage:this.state.snapshot(l),messageId:this.generateId()}),abortController:new AbortController};m.abortController.signal.addEventListener("abort",()=>{d=!0}),this.activeResponse=m;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:m.abortController.signal,metadata:e,headers:n,body:r,trigger:t,messageId:i});const E=T=>this.jobExecutor.run(()=>T({state:m.state,write:()=>{var x;this.setStatus({status:"streaming"}),m.state.message.id===((x=this.lastMessage)==null?void 0:x.id)?this.state.replaceMessage(this.state.messages.length-1,m.state.message):this.state.pushMessage(m.state.message)}}));await U2({stream:j2({stream:g,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:E,onError:T=>{throw T}}),onError:T=>{throw T}}),this.setStatus({status:"ready"})}catch(m){if(d||m.name==="AbortError")return d=!0,this.setStatus({status:"ready"}),null;h=!0,m instanceof TypeError&&(m.message.toLowerCase().includes("fetch")||m.message.toLowerCase().includes("network"))&&(c=!0),this.onError&&m instanceof Error&&this.onError(m),this.setStatus({status:"error",error:m})}finally{try{(a=this.onFinish)==null||a.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:d,isDisconnect:c,isError:h,finishReason:(s=this.activeResponse)==null?void 0:s.state.finishReason})}catch(m){console.error(m)}this.activeResponse=void 0}(o=this.sendAutomaticallyWhen)!=null&&o.call(this,{messages:this.state.messages})&&!h&&await this.makeRequest({trigger:"submit-message",messageId:(u=this.lastMessage)==null?void 0:u.id,metadata:e,headers:n,body:r})}},ls,Qo;function q2(){if(Qo)return ls;Qo=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,i=0;return function(...a){clearTimeout(r);const o=Date.now(),u=o-i,l=n-u;l<=0?(i=o,e.apply(this,a)):r=setTimeout(()=>{i=Date.now(),e.apply(this,a)},l)}}return ls=t,ls}var V2=q2();const W2=ba(V2);var id=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Le=(t,e,n)=>(id(t,e,"read from private field"),n?n.call(t):e.get(t)),kt=(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)},Ut=(t,e,n,r)=>(id(t,e,"write to private field"),e.set(t,n),n);function G2(t,e){return e!=null?W2(t,e):t}var pt,ci,di,or,ur,lr,An,Ys,qs,K2=class{constructor(t=[]){kt(this,pt,void 0),kt(this,ci,"ready"),kt(this,di,void 0),kt(this,or,new Set),kt(this,ur,new Set),kt(this,lr,new Set),this.pushMessage=e=>{Ut(this,pt,Le(this,pt).concat(e)),Le(this,An).call(this)},this.popMessage=()=>{Ut(this,pt,Le(this,pt).slice(0,-1)),Le(this,An).call(this)},this.replaceMessage=(e,n)=>{Ut(this,pt,[...Le(this,pt).slice(0,e),this.snapshot(n),...Le(this,pt).slice(e+1)]),Le(this,An).call(this)},this.snapshot=e=>structuredClone(e),this["~registerMessagesCallback"]=(e,n)=>{const r=n?G2(e,n):e;return Le(this,or).add(r),()=>{Le(this,or).delete(r)}},this["~registerStatusCallback"]=e=>(Le(this,ur).add(e),()=>{Le(this,ur).delete(e)}),this["~registerErrorCallback"]=e=>(Le(this,lr).add(e),()=>{Le(this,lr).delete(e)}),kt(this,An,()=>{Le(this,or).forEach(e=>e())}),kt(this,Ys,()=>{Le(this,ur).forEach(e=>e())}),kt(this,qs,()=>{Le(this,lr).forEach(e=>e())}),Ut(this,pt,t)}get status(){return Le(this,ci)}set status(t){Ut(this,ci,t),Le(this,Ys).call(this)}get error(){return Le(this,di)}set error(t){Ut(this,di,t),Le(this,qs).call(this)}get messages(){return Le(this,pt)}set messages(t){Ut(this,pt,[...t]),Le(this,An).call(this)}};pt=new WeakMap;ci=new WeakMap;di=new WeakMap;or=new WeakMap;ur=new WeakMap;lr=new WeakMap;An=new WeakMap;Ys=new WeakMap;qs=new WeakMap;var Cn,Xo=class extends Y2{constructor({messages:t,...e}){const n=new K2(t);super({...e,state:n}),kt(this,Cn,void 0),this["~registerMessagesCallback"]=(r,i)=>Le(this,Cn)["~registerMessagesCallback"](r,i),this["~registerStatusCallback"]=r=>Le(this,Cn)["~registerStatusCallback"](r),this["~registerErrorCallback"]=r=>Le(this,Cn)["~registerErrorCallback"](r),Ut(this,Cn,n)}};Cn=new WeakMap;function Q2({experimental_throttle:t,resume:e=!1,...n}={}){const r=O.useRef("chat"in n?n.chat:new Xo(n));("chat"in n&&n.chat!==r.current||"id"in n&&r.current.id!==n.id)&&(r.current="chat"in n?n.chat:new Xo(n));const s=O.useCallback(d=>r.current["~registerMessagesCallback"](d,t),[t,r.current.id]),a=O.useSyncExternalStore(s,()=>r.current.messages,()=>r.current.messages),o=O.useSyncExternalStore(r.current["~registerStatusCallback"],()=>r.current.status,()=>r.current.status),u=O.useSyncExternalStore(r.current["~registerErrorCallback"],()=>r.current.error,()=>r.current.error),l=O.useCallback(d=>{typeof d=="function"&&(d=d(r.current.messages)),r.current.messages=d},[r]);return O.useEffect(()=>{e&&r.current.resumeStream()},[e,r]),{id:r.current.id,messages:a,setMessages:l,sendMessage:r.current.sendMessage,regenerate:r.current.regenerate,clearError:r.current.clearError,stop:r.current.stop,error:u,resumeStream:r.current.resumeStream,status:o,addToolResult:r.current.addToolOutput,addToolOutput:r.current.addToolOutput,addToolApprovalResponse:r.current.addToolApprovalResponse}}function sd(t){const e=z.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=p.jsx(zn.Root,{"data-slot":"drawer",...n}),e[2]=n,e[3]=r):r=e[3],r}function ad(t){const e=z.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=p.jsx(zn.Trigger,{"data-slot":"drawer-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function X2(t){const e=z.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=p.jsx(zn.Portal,{"data-slot":"drawer-portal",...n}),e[2]=n,e[3]=r):r=e[3],r}function J2(t){const e=z.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 i;e[3]!==n?(i=X("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx(zn.Overlay,{"data-slot":"drawer-overlay",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function od(t){const e=z.c(12);let n,r,i;e[0]!==t?({className:r,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s=p.jsx(J2,{}),e[4]=s):s=e[4];let a;e[5]!==r?(a=X("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",r),e[5]=r,e[6]=a):a=e[6];let o;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),e[7]=o):o=e[7];let u;return e[8]!==n||e[9]!==i||e[10]!==a?(u=p.jsxs(X2,{"data-slot":"drawer-portal",children:[s,p.jsxs(zn.Content,{"data-slot":"drawer-content",className:a,...i,children:[o,n]})]}),e[8]=n,e[9]=i,e[10]=a,e[11]=u):u=e[11],u}function ud(t){const e=z.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 i;e[3]!==n?(i=X("flex flex-col gap-1.5 px-4 py-2",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx("div",{"data-slot":"drawer-header",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function ld(t){const e=z.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 i;e[3]!==n?(i=X("text-foreground font-semibold",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx(zn.Title,{"data-slot":"drawer-title",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Vs({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=eE({defaultProp:e,onChange:n}),s=t!==void 0,a=s?t:r,o=vl(n),u=O.useCallback(l=>{if(s){const c=typeof l=="function"?l(t):l;c!==t&&o(c)}else i(l)},[s,t,i,o]);return[a,u]}function eE({defaultProp:t,onChange:e}){const n=O.useState(t),[r]=n,i=O.useRef(r),s=vl(e);return O.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}const cd=O.createContext({isMobile:!1,setValue:()=>{}}),Ia=()=>O.useContext(cd),dd=t=>{const e=z.c(37);let n,r,i,s,a,o,u,l;e[0]!==t?({children:n,defaultOpen:r,open:o,onOpenChange:s,defaultValue:i,value:l,onValueChange:a,...u}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s,e[5]=a,e[6]=o,e[7]=u,e[8]=l):(n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],u=e[7],l=e[8]);const d=jn(),c=r??!1;let h;e[9]!==s||e[10]!==o||e[11]!==c?(h={prop:o,defaultProp:c,onChange:s},e[9]=s,e[10]=o,e[11]=c,e[12]=h):h=e[12];const[m,g]=Vs(h);let E;e[13]!==i||e[14]!==a||e[15]!==l?(E={prop:l,defaultProp:i,onChange:a},e[13]=i,e[14]=a,e[15]=l,e[16]=E):E=e[16];const[T,x]=Vs(E);let _;e[17]!==x?(_=D=>{D&&x(D)},e[17]=x,e[18]=_):_=e[18];const b=_;let C;e[19]!==d||e[20]!==b?(C={isMobile:d,setValue:b},e[19]=d,e[20]=b,e[21]=C):C=e[21];let w;e[22]!==n||e[23]!==m||e[24]!==u||e[25]!==g?(w=p.jsx(sd,{open:m,onOpenChange:g,...u,children:n}),e[22]=n,e[23]=m,e[24]=u,e[25]=g,e[26]=w):w=e[26];let y;e[27]!==m||e[28]!==u||e[29]!==g||e[30]!==b||e[31]!==w||e[32]!==T?(y=p.jsx(cp,{open:m,onOpenChange:g,value:T,onValueChange:b,...u,children:w}),e[27]=m,e[28]=u,e[29]=g,e[30]=b,e[31]=w,e[32]=T,e[33]=y):y=e[33];let R;return e[34]!==C||e[35]!==y?(R=p.jsx(cd.Provider,{value:C,children:y}),e[34]=C,e[35]=y,e[36]=R):R=e[36],R},fd=t=>{const{children:e,title:n,headerActions:r,...i}=t,{isMobile:s}=Ia(),{className:a,...o}=i;return s?p.jsxs(od,{...o,children:[p.jsxs(ud,{className:X(r?"flex flex-row items-center justify-between":"hidden"),children:[p.jsx(ld,{children:n}),r]}),p.jsx("div",{className:X("flex flex-col gap-2 p-2 py-4",a),children:e})]}):p.jsx(lp,{...i,children:e})},hd=t=>{const e=z.c(7);let n,r;e[0]!==t?({children:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const{isMobile:i}=Ia();let s;return e[3]!==n||e[4]!==i||e[5]!==r?(s=i?p.jsx(ad,{asChild:!0,children:p.jsx(at,{variant:"outline",...r,children:n})}):p.jsx(up,{...r,children:n}),e[3]=n,e[4]=i,e[5]=r,e[6]=s):s=e[6],s},pd=t=>{const e=z.c(7);let n,r;e[0]!==t?({children:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const{isMobile:i}=Ia();let s;return e[3]!==n||e[4]!==i||e[5]!==r?(s=i?p.jsx("span",{...r,children:n}):p.jsx(op,{...r,children:n}),e[3]=n,e[4]=i,e[5]=r,e[6]=s):s=e[6],s};function tE(t){const e=z.c(24),{gateway:n,isSelected:r}=t,i=r&&"bg-accent";let s;e[0]!==i?(s=X("flex items-start gap-3 py-3 px-3 hover:bg-accent cursor-pointer rounded-xl",i),e[0]=i,e[1]=s):s=e[1];let a;e[2]!==n.fallbackIcon?(a=n.fallbackIcon??p.jsx(Rn,{}),e[2]=n.fallbackIcon,e[3]=a):a=e[3];let o;e[4]!==n.icon||e[5]!==n.title||e[6]!==a?(o=p.jsx(xi,{icon:n.icon,name:n.title,size:"sm",fallbackIcon:a,className:"size-10"}),e[4]=n.icon,e[5]=n.title,e[6]=a,e[7]=o):o=e[7];let u;e[8]!==n.title?(u=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=u):u=e[9];let l;e[10]!==r?(l=r&&p.jsx(Wt,{size:16,className:"text-foreground shrink-0"}),e[10]=r,e[11]=l):l=e[11];let d;e[12]!==u||e[13]!==l?(d=p.jsxs("div",{className:"flex items-center justify-between",children:[u,l]}),e[12]=u,e[13]=l,e[14]=d):d=e[14];let c;e[15]!==n.description?(c=n.description&&p.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 leading-relaxed",children:n.description}),e[15]=n.description,e[16]=c):c=e[16];let h;e[17]!==d||e[18]!==c?(h=p.jsxs("div",{className:"flex flex-col flex-1 min-w-0 gap-0.5",children:[d,c]}),e[17]=d,e[18]=c,e[19]=h):h=e[19];let m;return e[20]!==s||e[21]!==o||e[22]!==h?(m=p.jsxs("div",{className:s,children:[o,h]}),e[20]=s,e[21]=o,e[22]=h,e[23]=m):m=e[23],m}function nE(t){const e=z.c(12),{gateway:n}=t;if(!n){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsx("span",{className:"text-sm text-muted-foreground",children:"Select gateway"}),e[0]=o):o=e[0],o}let r;e[1]!==n.fallbackIcon?(r=n.fallbackIcon??p.jsx(Rn,{}),e[1]=n.fallbackIcon,e[2]=r):r=e[2];let i;e[3]!==n.icon||e[4]!==n.title||e[5]!==r?(i=p.jsx(xi,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:r,className:"size-5"}),e[3]=n.icon,e[4]=n.title,e[5]=r,e[6]=i):i=e[6];let s;e[7]!==n.title?(s=p.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=s):s=e[8];let a;return e[9]!==i||e[10]!==s?(a=p.jsxs("div",{className:"flex items-center gap-2",children:[i,s]}),e[9]=i,e[10]=s,e[11]=a):a=e[11],a}function rE(t){const e=z.c(37),{gateways:n,selectedGatewayId:r,onGatewayChange:i,variant:s,className:a,placeholder:o}=t,u=s===void 0?"bordered":s,l=o===void 0?"Select gateway":o,[d,c]=O.useState(!1);let h;if(e[0]!==n||e[1]!==r){let M;e[3]!==r?(M=F=>F.id===r,e[3]=r,e[4]=M):M=e[4],h=n.find(M),e[0]=n,e[1]=r,e[2]=h}else h=e[2];const m=h;let g;e[5]!==i?(g=M=>{i(M),c(!1)},e[5]=i,e[6]=g):g=e[6];const E=g;if(n.length===0)return null;const T=r||"",x=u==="borderless"?"border-0 md:border-none":"border";let _;e[7]!==a||e[8]!==x?(_=X("h-8! text-sm hover:bg-accent rounded-lg py-1 px-2 gap-1 shadow-none cursor-pointer group focus-visible:ring-0 focus-visible:ring-offset-0",x,a),e[7]=a,e[8]=x,e[9]=_):_=e[9];let b;e[10]!==m?(b=p.jsx(nE,{gateway:m}),e[10]=m,e[11]=b):b=e[11];let C;e[12]!==l||e[13]!==b?(C=p.jsx(pd,{placeholder:l,children:b}),e[12]=l,e[13]=b,e[14]=C):C=e[14];let w;e[15]!==_||e[16]!==C?(w=p.jsx(hd,{className:_,children:C}),e[15]=_,e[16]=C,e[17]=w):w=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=p.jsx("div",{className:"border-b px-4 py-3 bg-background/95 backdrop-blur sticky top-0 z-10",children:p.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[p.jsx(xa,{size:16}),p.jsx("span",{className:"text-sm",children:"Search for a gateway..."})]})}),e[18]=y):y=e[18];let R;if(e[19]!==n||e[20]!==E||e[21]!==r){let M;e[23]!==E||e[24]!==r?(M=F=>p.jsx("div",{onClick:()=>E(F.id),className:"outline-none",children:p.jsx(tE,{gateway:F,isSelected:F.id===r})},F.id),e[23]=E,e[24]=r,e[25]=M):M=e[25],R=n.map(M),e[19]=n,e[20]=E,e[21]=r,e[22]=R}else R=e[22];let D;e[26]!==R?(D=p.jsxs("div",{className:"flex flex-col max-h-[400px]",children:[y,p.jsx("div",{className:"overflow-y-auto p-2 flex flex-col gap-1",children:R})]}),e[26]=R,e[27]=D):D=e[27];let P;e[28]!==l||e[29]!==D?(P=p.jsx(fd,{title:l,className:"w-full md:w-[400px] p-0",children:D}),e[28]=l,e[29]=D,e[30]=P):P=e[30];let v;return e[31]!==E||e[32]!==d||e[33]!==w||e[34]!==P||e[35]!==T?(v=p.jsxs(dd,{open:d,onOpenChange:c,value:T,onValueChange:E,children:[w,P]}),e[31]=E,e[32]=d,e[33]=w,e[34]=P,e[35]=T,e[36]=v):v=e[36],v}function iE(t){const e=z.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex flex-col h-full w-full bg-sidebar transform-[translateZ(0)]",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=p.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function sE(t){const e=z.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex h-12 items-center justify-between border-b border-border px-4 flex-none",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=p.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function aE(t){const e=z.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex-1 min-h-0 overflow-y-auto",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=p.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function oE(t){const e=z.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex-none w-full mx-auto p-2",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=p.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}const tn=Object.assign(iE,{Header:sE,Content:aE,Footer:oE});function uE(t){const e=z.c(14),{title:n,description:r,avatar:i,avatarNode:s,className:a}=t,o=n===void 0?"Start a conversation":n;let u;e[0]!==a?(u=X("flex flex-col items-center justify-center gap-4 p-8 text-center",a),e[0]=a,e[1]=u):u=e[1];let l;e[2]!==i||e[3]!==s?(l=s||i&&p.jsx("img",{src:i,alt:"Chat avatar",className:"size-[60px] rounded-[18px] border-[1.875px] border-border/10"}),e[2]=i,e[3]=s,e[4]=l):l=e[4];let d;e[5]!==o?(d=o&&p.jsx("h3",{className:"text-xl font-medium text-foreground",children:o}),e[5]=o,e[6]=d):d=e[6];let c;e[7]!==r?(c=r&&p.jsx("div",{className:"text-muted-foreground text-center text-sm max-w-md",children:r}),e[7]=r,e[8]=c):c=e[8];let h;return e[9]!==u||e[10]!==l||e[11]!==d||e[12]!==c?(h=p.jsxs("div",{className:u,children:[l,d,c]}),e[9]=u,e[10]=l,e[11]=d,e[12]=c,e[13]=h):h=e[13],h}function lE(t){const e=z.c(67),{value:n,onChange:r,onSubmit:i,onStop:s,disabled:a,isStreaming:o,placeholder:u,className:l,centered:d,contextContent:c,leftActions:h,rightActions:m,maxTextHeight:g}=t,E=u===void 0?"Ask anything or @ for context":u,T=d===void 0?!1:d,x=g===void 0?"164px":g;let _;e[0]!==a||e[1]!==o||e[2]!==n?(_=!a&&!o&&n.trim().length>0,e[0]=a,e[1]=o,e[2]=n,e[3]=_):_=e[3];const b=_;let C;e[4]!==b||e[5]!==o||e[6]!==s||e[7]!==i?(C=Pe=>{Pe.preventDefault(),o&&s?s():b&&i()},e[4]=b,e[5]=o,e[6]=s,e[7]=i,e[8]=C):C=e[8];const w=C;let y;e[9]!==b||e[10]!==i?(y=Pe=>{Pe.key==="Enter"&&!Pe.shiftKey&&(Pe.preventDefault(),b&&i())},e[9]=b,e[10]=i,e[11]=y):y=e[11];const R=y;let D;e[12]!==l?(D=X("w-full",l),e[12]=l,e[13]=D):D=e[13];const P=T?"shadow-md":"shadow-sm";let v;e[14]!==P?(v=X("relative rounded-xl border border-border bg-background w-full min-h-[130px] flex flex-col",P),e[14]=P,e[15]=v):v=e[15];let M;e[16]!==c?(M=c&&p.jsx("div",{className:"mb-1",children:c}),e[16]=c,e[17]=M):M=e[17];let F;e[18]!==x?(F={maxHeight:x},e[18]=x,e[19]=F):F=e[19];let K;e[20]!==r?(K=Pe=>r(Pe.target.value),e[20]=r,e[21]=K):K=e[21];const Y=a||o;let H;e[22]===Symbol.for("react.memo_cache_sentinel")?(H=X("placeholder:text-muted-foreground resize-none focus-visible:ring-0 border-0 p-2 text-sm min-h-[20px] w-full","rounded-none shadow-none"),e[22]=H):H=e[22];let J;e[23]===Symbol.for("react.memo_cache_sentinel")?(J={minHeight:"20px",height:"auto",overflow:"hidden"},e[23]=J):J=e[23];let de;e[24]!==R||e[25]!==E||e[26]!==K||e[27]!==Y||e[28]!==n?(de=p.jsx(bp,{value:n,onChange:K,onKeyDown:R,placeholder:E,disabled:Y,className:H,rows:1,style:J}),e[24]=R,e[25]=E,e[26]=K,e[27]=Y,e[28]=n,e[29]=de):de=e[29];let ue;e[30]!==F||e[31]!==de?(ue=p.jsx("div",{className:"overflow-y-auto relative flex-1",style:F,children:de}),e[30]=F,e[31]=de,e[32]=ue):ue=e[32];let me;e[33]!==M||e[34]!==ue?(me=p.jsxs("div",{className:"relative flex flex-col gap-2 p-2.5 flex-1",children:[M,ue]}),e[33]=M,e[34]=ue,e[35]=me):me=e[35];let N;e[36]!==h?(N=p.jsx("div",{className:"flex items-center overflow-hidden",children:h}),e[36]=h,e[37]=N):N=e[37];const V=o?"button":"submit";let ne;e[38]!==o||e[39]!==s?(ne=Pe=>{o&&(Pe.preventDefault(),Pe.stopPropagation(),s?.())},e[38]=o,e[39]=s,e[40]=ne):ne=e[40];const S=b||o?"default":"ghost",te=!b&&!o,se=!b&&!o&&"bg-muted text-muted-foreground hover:bg-muted hover:text-muted-foreground cursor-not-allowed";let Q;e[41]!==se?(Q=X("size-8 rounded-full transition-all",se),e[41]=se,e[42]=Q):Q=e[42];const ee=o?"Stop generating":"Send message (Enter)";let ie;e[43]!==o?(ie=o?p.jsx(Tc,{size:20}):p.jsx(fp,{size:20}),e[43]=o,e[44]=ie):ie=e[44];let le;e[45]!==V||e[46]!==ne||e[47]!==S||e[48]!==te||e[49]!==Q||e[50]!==ee||e[51]!==ie?(le=p.jsx(at,{type:V,onClick:ne,variant:S,size:"icon",disabled:te,className:Q,title:ee,children:ie}),e[45]=V,e[46]=ne,e[47]=S,e[48]=te,e[49]=Q,e[50]=ee,e[51]=ie,e[52]=le):le=e[52];let ge;e[53]!==m||e[54]!==le?(ge=p.jsxs("div",{className:"flex items-center gap-1",children:[m,le]}),e[53]=m,e[54]=le,e[55]=ge):ge=e[55];let De;e[56]!==N||e[57]!==ge?(De=p.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[N,ge]}),e[56]=N,e[57]=ge,e[58]=De):De=e[58];let $e;e[59]!==me||e[60]!==De||e[61]!==v?($e=p.jsxs("div",{className:v,children:[me,De]}),e[59]=me,e[60]=De,e[61]=v,e[62]=$e):$e=e[62];let Se;return e[63]!==w||e[64]!==$e||e[65]!==D?(Se=p.jsx("form",{onSubmit:w,className:D,children:$e}),e[63]=w,e[64]=$e,e[65]=D,e[66]=Se):Se=e[66],Se}const cE={reasoning:{icon:p.jsx(Pi,{className:"size-4"}),bg:"bg-purple-100",text:"text-purple-700",label:"Reasoning"},"image-upload":{icon:p.jsx(hc,{className:"size-4"}),bg:"bg-teal-100",text:"text-teal-700",label:"Can analyze images"},"file-upload":{icon:p.jsx(Pl,{className:"size-4"}),bg:"bg-blue-100",text:"text-blue-700",label:"Can analyze files"},"web-search":{icon:p.jsx(xa,{className:"size-4"}),bg:"bg-amber-100",text:"text-amber-700",label:"Can search the web to answer questions"}},md=O.memo(function(e){const n=z.c(11),{capability:r}=e,i=cE[r];let s;n[0]!==r||n[1]!==i?(s=i||{icon:p.jsx(Wt,{className:"size-4"}),bg:"bg-slate-200",text:"text-slate-700",label:r},n[0]=r,n[1]=i,n[2]=s):s=n[2];const a=s,o=`flex items-center justify-center h-6 w-6 rounded-sm ${a.bg} ${a.text}`;let u;n[3]!==a.icon||n[4]!==o?(u=p.jsx(Ta,{asChild:!0,children:p.jsx("div",{className:o,children:a.icon})}),n[3]=a.icon,n[4]=o,n[5]=u):u=n[5];let l;n[6]!==a.label?(l=p.jsx(_a,{children:p.jsx("p",{children:a.label})}),n[6]=a.label,n[7]=l):l=n[7];let d;return n[8]!==u||n[9]!==l?(d=p.jsxs(ya,{children:[u,l]}),n[8]=u,n[9]=l,n[10]=d):d=n[10],d}),Jo=O.memo(function(e){const n=z.c(54),{model:r,compact:i}=e,s=i===void 0?!1:i;if(!r){let x;return n[0]===Symbol.for("react.memo_cache_sentinel")?(x=p.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"Hover to preview"}),n[0]=x):x=n[0],x}const a=r.contextWindow||r.inputCost||r.outputCost||r.outputLimit;if(!a&&!s){let x;n[1]!==r.logo||n[2]!==r.name?(x=r.logo&&p.jsx("img",{src:r.logo,className:"w-6 h-6",alt:r.name}),n[1]=r.logo,n[2]=r.name,n[3]=x):x=n[3];let _;n[4]!==r.name?(_=p.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[4]=r.name,n[5]=_):_=n[5];let b;n[6]!==x||n[7]!==_?(b=p.jsxs("div",{className:"flex items-center gap-3 py-2 px-0",children:[x,_]}),n[6]=x,n[7]=_,n[8]=b):b=n[8];let C;n[9]!==r.description?(C=r.description&&p.jsx("p",{className:"text-sm text-muted-foreground",children:r.description}),n[9]=r.description,n[10]=C):C=n[10];let w;return n[11]!==b||n[12]!==C?(w=p.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[b,C]}),n[11]=b,n[12]=C,n[13]=w):w=n[13],w}if(!a&&s)return null;if(s){let x;n[14]!==r.contextWindow?(x=r.contextWindow&&p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-muted-foreground",children:"Context"}),p.jsxs("span",{className:"text-foreground font-medium",children:[r.contextWindow.toLocaleString()," tokens"]})]}),n[14]=r.contextWindow,n[15]=x):x=n[15];let _;n[16]!==r.inputCost?(_=r.inputCost&&p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-muted-foreground",children:"Input cost"}),p.jsxs("span",{className:"text-foreground font-medium",children:["$",r.inputCost.toFixed(2)," / 1M"]})]}),n[16]=r.inputCost,n[17]=_):_=n[17];let b;n[18]!==r.outputCost?(b=r.outputCost&&p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-muted-foreground",children:"Output cost"}),p.jsxs("span",{className:"text-foreground font-medium",children:["$",r.outputCost.toFixed(2)," / 1M"]})]}),n[18]=r.outputCost,n[19]=b):b=n[19];let C;n[20]!==r.outputLimit?(C=r.outputLimit&&p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsx("span",{className:"text-muted-foreground",children:"Output limit"}),p.jsxs("span",{className:"text-foreground font-medium",children:[r.outputLimit.toLocaleString()," tokens"]})]}),n[20]=r.outputLimit,n[21]=C):C=n[21];let w;return n[22]!==x||n[23]!==_||n[24]!==b||n[25]!==C?(w=p.jsxs("div",{className:"flex flex-col gap-2.5 pt-3 pb-3 px-3 rounded-b-xl text-xs",children:[x,_,b,C]}),n[22]=x,n[23]=_,n[24]=b,n[25]=C,n[26]=w):w=n[26],w}let o;n[27]!==r.logo||n[28]!==r.name?(o=r.logo&&p.jsx("img",{src:r.logo,className:"w-6 h-6",alt:r.name}),n[27]=r.logo,n[28]=r.name,n[29]=o):o=n[29];let u;n[30]!==r.name?(u=p.jsx("p",{className:"text-lg font-medium leading-7",children:r.name}),n[30]=r.name,n[31]=u):u=n[31];let l;n[32]!==o||n[33]!==u?(l=p.jsxs("div",{className:"flex items-center gap-3",children:[o,u]}),n[32]=o,n[33]=u,n[34]=l):l=n[34];let d;n[35]!==r.capabilities?(d=r.capabilities&&r.capabilities.length>0&&p.jsx("div",{className:"flex items-center gap-2",children:r.capabilities.map(pE)}),n[35]=r.capabilities,n[36]=d):d=n[36];let c;n[37]!==l||n[38]!==d?(c=p.jsxs("div",{className:"flex flex-col gap-3 py-2 px-0",children:[l,d]}),n[37]=l,n[38]=d,n[39]=c):c=n[39];let h;n[40]!==r.contextWindow?(h=r.contextWindow&&p.jsxs("div",{className:"flex flex-col gap-1.5",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(Dl,{className:"w-3.5 h-3.5 text-muted-foreground"}),p.jsx("p",{className:"text-sm text-foreground",children:"Context window"})]}),p.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.contextWindow.toLocaleString()," tokens"]})]}),n[40]=r.contextWindow,n[41]=h):h=n[41];let m;n[42]!==r.inputCost||n[43]!==r.outputCost?(m=(r.inputCost||r.outputCost)&&p.jsxs("div",{className:"flex flex-col gap-1.5",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(lc,{className:"w-3.5 h-3.5 text-muted-foreground"}),p.jsx("p",{className:"text-sm text-foreground",children:"Costs"})]}),p.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.inputCost!==null&&r.inputCost!==void 0&&p.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",r.inputCost.toFixed(2)," / 1M tokens (input)"]}),r.outputCost!==null&&r.outputCost!==void 0&&p.jsxs("p",{className:"text-sm text-muted-foreground",children:["$",r.outputCost.toFixed(2)," / 1M tokens (output)"]})]})]}),n[42]=r.inputCost,n[43]=r.outputCost,n[44]=m):m=n[44];let g;n[45]!==r.outputLimit?(g=r.outputLimit&&p.jsxs("div",{className:"flex flex-col gap-1.5",children:[p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(bc,{className:"w-4.5 h-4.5 text-muted-foreground/70"}),p.jsx("p",{className:"text-sm text-foreground",children:"Output limit"})]}),p.jsxs("p",{className:"text-sm text-muted-foreground",children:[r.outputLimit.toLocaleString()," token limit"]})]}),n[45]=r.outputLimit,n[46]=g):g=n[46];let E;n[47]!==h||n[48]!==m||n[49]!==g?(E=p.jsxs("div",{className:"flex flex-col gap-4",children:[h,m,g]}),n[47]=h,n[48]=m,n[49]=g,n[50]=E):E=n[50];let T;return n[51]!==E||n[52]!==c?(T=p.jsxs("div",{className:"flex flex-col gap-3 py-1 px-1.5",children:[c,E]}),n[51]=E,n[52]=c,n[53]=T):T=n[53],T}),dE=O.memo(function(e){const n=z.c(27),{model:r,onHover:i,isSelected:s,hasExpandedInfo:a}=e,o=a?"rounded-t-xl":"rounded-xl";let u;n[0]!==o?(u=X("flex items-center gap-2 h-10 py-4 px-3 hover:bg-accent cursor-pointer",o),n[0]=o,n[1]=u):u=n[1];let l;n[2]!==r||n[3]!==i?(l=()=>i(r),n[2]=r,n[3]=i,n[4]=l):l=n[4];let d;n[5]!==r.logo||n[6]!==r.name?(d=r.logo&&p.jsx("img",{src:r.logo,className:"w-5 h-5 shrink-0",alt:r.name}),n[5]=r.logo,n[6]=r.name,n[7]=d):d=n[7];let c;n[8]!==r.name?(c=p.jsx("span",{className:"text-sm text-foreground",children:r.name}),n[8]=r.name,n[9]=c):c=n[9];let h;n[10]!==a||n[11]!==r.capabilities?(h=a&&r.capabilities&&r.capabilities.length>0&&p.jsx("div",{className:"md:hidden flex items-center gap-1.5 ml-auto",children:r.capabilities.map(mE)}),n[10]=a,n[11]=r.capabilities,n[12]=h):h=n[12];let m;n[13]!==a||n[14]!==s?(m=s&&!a&&p.jsx(Wt,{className:"w-4 h-4 text-foreground ml-auto"}),n[13]=a,n[14]=s,n[15]=m):m=n[15];let g;n[16]!==a||n[17]!==s?(g=s&&a&&p.jsx(Wt,{className:"w-4 h-4 text-foreground ml-2 shrink-0"}),n[16]=a,n[17]=s,n[18]=g):g=n[18];let E;return n[19]!==u||n[20]!==l||n[21]!==d||n[22]!==c||n[23]!==h||n[24]!==m||n[25]!==g?(E=p.jsxs("div",{className:u,onMouseEnter:l,children:[d,c,h,m,g]}),n[19]=u,n[20]=l,n[21]=d,n[22]=c,n[23]=h,n[24]=m,n[25]=g,n[26]=E):E=n[26],E});function fE(t){const e=z.c(9),{model:n}=t;if(!n){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx("span",{className:"text-sm text-muted-foreground",children:"Select model"}),e[0]=a):a=e[0],a}let r;e[1]!==n.logo||e[2]!==n.name?(r=n.logo&&p.jsx("img",{src:n.logo,className:"w-4 h-4",alt:n.name}),e[1]=n.logo,e[2]=n.name,e[3]=r):r=e[3];let i;e[4]!==n.name?(i=p.jsx("span",{className:"text-sm text-muted-foreground group-hover:text-foreground transition-colors",children:n.name}),e[4]=n.name,e[5]=i):i=e[5];let s;return e[6]!==r||e[7]!==i?(s=p.jsxs("div",{className:"flex items-center gap-2",children:[r,i]}),e[6]=r,e[7]=i,e[8]=s):s=e[8],s}function hE(t){const e=z.c(53),{models:n,selectedModelId:r,onModelChange:i,variant:s,className:a,placeholder:o}=t,u=s===void 0?"borderless":s,l=o===void 0?"Select model":o,[d,c]=O.useState(!1),[h,m]=O.useState(null),[g,E]=O.useState(!1);let T;if(e[0]!==n||e[1]!==r){let ne;e[3]!==r?(ne=S=>S.id===r,e[3]=r,e[4]=ne):ne=e[4],T=n.find(ne),e[0]=n,e[1]=r,e[2]=T}else T=e[2];const x=T;let _;e[5]!==i?(_=ne=>{i(ne),c(!1)},e[5]=i,e[6]=_):_=e[6];const b=_;if(n.length===0)return null;const C=r||"",w=u==="borderless"&&"md:border-none";let y;e[7]!==a||e[8]!==w?(y=X("h-8! text-sm hover:bg-accent rounded-lg py-1 px-2 gap-1 shadow-none cursor-pointer border-0 group focus-visible:ring-0 focus-visible:ring-offset-0",w,a),e[7]=a,e[8]=w,e[9]=y):y=e[9];let R;e[10]!==x?(R=p.jsx(fE,{model:x}),e[10]=x,e[11]=R):R=e[11];let D;e[12]!==l||e[13]!==R?(D=p.jsx(pd,{placeholder:l,children:R}),e[12]=l,e[13]=R,e[14]=D):D=e[14];let P;e[15]!==y||e[16]!==D?(P=p.jsx(hd,{className:y,children:D}),e[15]=y,e[16]=D,e[17]=P):P=e[17];let v;e[18]!==g?(v=()=>E(!g),e[18]=g,e[19]=v):v=e[19];const M=g?"text-foreground":"text-muted-foreground";let F;e[20]!==M?(F=X("w-5 h-5 transition-colors",M),e[20]=M,e[21]=F):F=e[21];let K;e[22]!==F?(K=p.jsx(Ep,{className:F}),e[22]=F,e[23]=K):K=e[23];let Y;e[24]!==v||e[25]!==K?(Y=p.jsx("button",{type:"button",onClick:v,className:"md:hidden flex items-center justify-center h-8 w-8 rounded-lg hover:bg-accent transition-colors","aria-label":"Toggle model info",children:K}),e[24]=v,e[25]=K,e[26]=Y):Y=e[26];let H;if(e[27]!==b||e[28]!==n||e[29]!==r||e[30]!==g){let ne;e[32]!==b||e[33]!==r||e[34]!==g?(ne=S=>p.jsxs("div",{onClick:()=>b(S.id),className:X("rounded-xl mb-1",S.id===r&&"bg-accent"),children:[p.jsx(dE,{model:S,onHover:m,isSelected:S.id===r,hasExpandedInfo:g}),g&&p.jsx("div",{className:"md:hidden",children:p.jsx(Jo,{model:S,compact:!0})})]},S.id),e[32]=b,e[33]=r,e[34]=g,e[35]=ne):ne=e[35],H=n.map(ne),e[27]=b,e[28]=n,e[29]=r,e[30]=g,e[31]=H}else H=e[31];let J;e[36]!==H?(J=p.jsx("div",{className:"flex-1 overflow-y-auto px-0.5 md:border-r",children:H}),e[36]=H,e[37]=J):J=e[37];const de=h||x||null;let ue;e[38]!==de?(ue=p.jsx("div",{className:"hidden md:block md:w-[300px] p-3",children:p.jsx(Jo,{model:de})}),e[38]=de,e[39]=ue):ue=e[39];let me;e[40]!==J||e[41]!==ue?(me=p.jsxs("div",{className:"flex flex-col md:flex-row h-[350px]",children:[J,ue]}),e[40]=J,e[41]=ue,e[42]=me):me=e[42];let N;e[43]!==l||e[44]!==Y||e[45]!==me?(N=p.jsx(fd,{title:l,className:"w-full md:w-auto md:min-w-[600px] [&_button[aria-label='Scroll down']]:!hidden [&_button[aria-label='Scroll up']]:!hidden",headerActions:Y,children:me}),e[43]=l,e[44]=Y,e[45]=me,e[46]=N):N=e[46];let V;return e[47]!==b||e[48]!==d||e[49]!==P||e[50]!==N||e[51]!==C?(V=p.jsxs(dd,{open:d,onOpenChange:c,value:C,onValueChange:b,children:[P,N]}),e[47]=b,e[48]=d,e[49]=P,e[50]=N,e[51]=C,e[52]=V):V=e[52],V}function pE(t){return p.jsx(md,{capability:t},t)}function mE(t){return p.jsx(md,{capability:t},t)}function hn(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function gE(t,e){let n;const r=()=>{if(n)return n;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),n=hn(i),n.then(s=>{s.onclose=()=>n=void 0},()=>{}),n};return(i,s)=>r().then(a=>s(a.transaction(e,i).objectStore(e)))}let cs;function Fi(){return cs||(cs=gE("keyval-store","keyval")),cs}function Na(t,e=Fi()){return e("readonly",n=>hn(n.get(t)))}function pr(t,e,n=Fi()){return n("readwrite",r=>(r.put(e,t),hn(r.transaction)))}function gd(t,e=Fi()){return e("readwrite",n=>(n.delete(t),hn(n.transaction)))}function bE(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},hn(t.transaction)}function bd(t=Fi()){return t("readonly",e=>{if(e.getAll&&e.getAllKeys)return Promise.all([hn(e.getAllKeys()),hn(e.getAll())]).then(([r,i])=>r.map((s,a)=>[s,i[a]]));const n=[];return t("readonly",r=>bE(r,i=>n.push([i.key,i.value])).then(()=>n))})}async function EE(t,e){const n=`${t}:threads:${e}`;return await Na(n)??null}async function xE(t){const e=`${t}:threads:`;return(await bd()).filter(([i])=>typeof i=="string"&&i.startsWith(e)).map(([,i])=>i).filter(i=>!i.hidden).sort((i,s)=>String(s.updated_at).localeCompare(String(i.updated_at)))}function TE(t,e){const n=`${t}:messages:`;return bd().then(r=>r.filter(([s])=>typeof s=="string"&&s.startsWith(n)).map(([,s])=>s).filter(s=>s.metadata?.thread_id===e||s.threadId===e).sort((s,a)=>{const o=s.metadata?.created_at||s.createdAt||"",u=a.metadata?.created_at||a.createdAt||"";return String(o).localeCompare(String(u))}))}function _E(){const t=z.c(12),{locator:e}=Nt();let n;t[0]!==e?(n=st.threads(e),t[0]=e,t[1]=n):n=t[1];let r;t[2]!==e?(r=()=>xE(e),t[2]=e,t[3]=r):r=t[3];let i;t[4]!==n||t[5]!==r?(i={queryKey:n,queryFn:r,staleTime:3e4},t[4]=n,t[5]=r,t[6]=i):i=t[6];const{data:s,refetch:a}=Ea(i);let o;t[7]!==s?(o=s??[],t[7]=s,t[8]=o):o=t[8];let u;return t[9]!==a||t[10]!==o?(u={threads:o,refetch:a},t[9]=a,t[10]=o,t[11]=u):u=t[11],u}function yE(t){const e=z.c(11),{locator:n}=Nt();let r;e[0]!==n||e[1]!==t?(r=st.threadMessages(n,t),e[0]=n,e[1]=t,e[2]=r):r=e[2];let i;e[3]!==n||e[4]!==t?(i=()=>TE(n,t),e[3]=n,e[4]=t,e[5]=i):i=e[5];let s;e[6]!==r||e[7]!==i?(s={queryKey:r,queryFn:i,staleTime:3e4},e[6]=r,e[7]=i,e[8]=s):s=e[8];const{data:a}=Ea(s);let o;return e[9]!==a?(o=a??[],e[9]=a,e[10]=o):o=e[10],o}function Ed(){const t=z.c(28),{locator:e}=Nt(),n=wl();let r;t[0]!==e?(r=async T=>{const x=`${e}:threads:${T.id}`;return await pr(x,T),T},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=()=>{n.invalidateQueries({queryKey:st.threads(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let s;t[5]!==r||t[6]!==i?(s={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=s):s=t[7];const a=un(s);let o;t[8]!==e?(o=async T=>{const{id:x,updates:_}=T,b=`${e}:threads:${x}`,C=await Na(b);if(!C)throw new Error(`Thread ${x} not found`);const w={...C,..._};return await pr(b,w),w},t[8]=e,t[9]=o):o=t[9];let u;t[10]!==e||t[11]!==n?(u=T=>{n.invalidateQueries({queryKey:st.threads(e)}),n.invalidateQueries({queryKey:st.thread(e,T.id)})},t[10]=e,t[11]=n,t[12]=u):u=t[12];let l;t[13]!==o||t[14]!==u?(l={mutationFn:o,onSuccess:u},t[13]=o,t[14]=u,t[15]=l):l=t[15];const d=un(l);let c;t[16]!==e?(c=async T=>{const x=`${e}:threads:${T}`;return await gd(x),T},t[16]=e,t[17]=c):c=t[17];let h;t[18]!==e||t[19]!==n?(h=()=>{n.invalidateQueries({queryKey:st.threads(e)})},t[18]=e,t[19]=n,t[20]=h):h=t[20];let m;t[21]!==c||t[22]!==h?(m={mutationFn:c,onSuccess:h},t[21]=c,t[22]=h,t[23]=m):m=t[23];const g=un(m);let E;return t[24]!==g||t[25]!==a||t[26]!==d?(E={insert:a,update:d,delete:g},t[24]=g,t[25]=a,t[26]=d,t[27]=E):E=t[27],E}function kE(){const t=z.c(37),{locator:e}=Nt(),n=wl();let r;t[0]!==e?(r=async C=>{const w=`${e}:messages:${C.id}`;return await pr(w,C),C},t[0]=e,t[1]=r):r=t[1];let i;t[2]!==e||t[3]!==n?(i=C=>{const w=C.metadata?.thread_id||C.threadId;w&&n.invalidateQueries({queryKey:st.threadMessages(e,w)}),n.invalidateQueries({queryKey:st.messages(e)})},t[2]=e,t[3]=n,t[4]=i):i=t[4];let s;t[5]!==r||t[6]!==i?(s={mutationFn:r,onSuccess:i},t[5]=r,t[6]=i,t[7]=s):s=t[7];const a=un(s);let o;t[8]!==e?(o=async C=>(await Promise.all(C.map(w=>{const y=`${e}:messages:${w.id}`;return pr(y,w)})),C),t[8]=e,t[9]=o):o=t[9];let u;t[10]!==e||t[11]!==n?(u=C=>{const w=new Set;for(const y of C){const R=y.metadata?.thread_id||y.threadId;R&&w.add(R)}for(const y of w)n.invalidateQueries({queryKey:st.threadMessages(e,y)});n.invalidateQueries({queryKey:st.messages(e)})},t[10]=e,t[11]=n,t[12]=u):u=t[12];let l;t[13]!==o||t[14]!==u?(l={mutationFn:o,onSuccess:u},t[13]=o,t[14]=u,t[15]=l):l=t[15];const d=un(l);let c;t[16]!==e?(c=async C=>{const{id:w,updates:y}=C,R=`${e}:messages:${w}`,D=await Na(R);if(!D)throw new Error(`Message ${w} not found`);const P={...D,...y};return await pr(R,P),P},t[16]=e,t[17]=c):c=t[17];let h;t[18]!==e||t[19]!==n?(h=C=>{const w=C.metadata?.thread_id||C.threadId;w&&n.invalidateQueries({queryKey:st.threadMessages(e,w)}),n.invalidateQueries({queryKey:st.messages(e)})},t[18]=e,t[19]=n,t[20]=h):h=t[20];let m;t[21]!==c||t[22]!==h?(m={mutationFn:c,onSuccess:h},t[21]=c,t[22]=h,t[23]=m):m=t[23];const g=un(m);let E;t[24]!==e?(E=async C=>{const w=`${e}:messages:${C}`;return await gd(w),C},t[24]=e,t[25]=E):E=t[25];let T;t[26]!==e||t[27]!==n?(T=()=>{n.invalidateQueries({queryKey:st.messages(e)})},t[26]=e,t[27]=n,t[28]=T):T=t[28];let x;t[29]!==T||t[30]!==E?(x={mutationFn:E,onSuccess:T},t[29]=T,t[30]=E,t[31]=x):x=t[31];const _=un(x);let b;return t[32]!==_||t[33]!==a||t[34]!==d||t[35]!==g?(b={insert:a,insertMany:d,update:g,delete:_},t[32]=_,t[33]=a,t[34]=d,t[35]=g,t[36]=b):b=t[36],b}const xd=()=>crypto.randomUUID(),Td=O.createContext(null);function SE(t){const e=z.c(15),{children:n}=t,{locator:r}=Nt(),i=Ed(),[s,a]=Dn(Br.threadManagerState(r)+":active-id",AE);let o;e[0]!==a||e[1]!==i?(o=g=>{const E=g?.id||crypto.randomUUID(),T=new Date().toISOString(),x={id:E,title:g?.title||"",created_at:g?.created_at||T,updated_at:g?.updated_at||T,hidden:g?.hidden??!1};return i.insert.mutate(x),a(E),x},e[0]=a,e[1]=i,e[2]=o):o=e[2];const u=o;let l;e[3]!==s||e[4]!==a||e[5]!==i?(l=g=>{i.update.mutate({id:g,updates:{hidden:!0,updated_at:new Date().toISOString()}}),s===g&&a(xd())},e[3]=s,e[4]=a,e[5]=i,e[6]=l):l=e[6];const d=l;let c;e[7]!==s||e[8]!==u||e[9]!==d||e[10]!==a?(c={activeThreadId:s,createThread:u,setActiveThreadId:a,hideThread:d},e[7]=s,e[8]=u,e[9]=d,e[10]=a,e[11]=c):c=e[11];const h=c;let m;return e[12]!==n||e[13]!==h?(m=p.jsx(Td.Provider,{value:h,children:n}),e[12]=n,e[13]=h,e[14]=m):m=e[14],m}function AE(t){return t||xd()}function _d(){const t=O.useContext(Td);if(!t)throw new Error("useChat must be used within a ChatProvider");return t}function va(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var bn=va();function yd(t){bn=t}var mr={exec:()=>null};function ke(t,e=""){let n=typeof t=="string"?t:t.source;const r={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(et.caret,"$1"),n=n.replace(i,a),r},getRegex:()=>new RegExp(n,e)};return r}var et={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")},CE=/^(?:[ \t]*(?:\n|$))+/,IE=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,NE=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Hr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,vE=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,wa=/(?:[*+-]|\d{1,9}[.)])/,kd=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Sd=ke(kd).replace(/bull/g,wa).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(),wE=ke(kd).replace(/bull/g,wa).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(),Ra=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,RE=/^[^\n]+/,Oa=/(?!\s*\])(?:\\.|[^\[\]\\])+/,OE=ke(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Oa).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),LE=ke(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,wa).getRegex(),zi="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",La=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,DE=ke("^ {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",La).replace("tag",zi).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ad=ke(Ra).replace("hr",Hr).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",zi).getRegex(),PE=ke(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ad).getRegex(),Da={blockquote:PE,code:IE,def:OE,fences:NE,heading:vE,hr:Hr,html:DE,lheading:Sd,list:LE,newline:CE,paragraph:Ad,table:mr,text:RE},eu=ke("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Hr).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",zi).getRegex(),ME={...Da,lheading:wE,table:eu,paragraph:ke(Ra).replace("hr",Hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",eu).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",zi).getRegex()},BE={...Da,html:ke(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",La).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:mr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ke(Ra).replace("hr",Hr).replace("heading",` *#{1,6} *[^
|
|
40
|
-
]`).replace("lheading",Sd).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},FE=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,zE=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Cd=/^( {2,}|\\)\n(?!\s*$)/,jE=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ji=/[\p{P}\p{S}]/u,Pa=/[\s\p{P}\p{S}]/u,Id=/[^\s\p{P}\p{S}]/u,UE=ke(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Pa).getRegex(),Nd=/(?!~)[\p{P}\p{S}]/u,HE=/(?!~)[\s\p{P}\p{S}]/u,$E=/(?:[^\s\p{P}\p{S}]|~)/u,ZE=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,vd=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,YE=ke(vd,"u").replace(/punct/g,ji).getRegex(),qE=ke(vd,"u").replace(/punct/g,Nd).getRegex(),wd="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",VE=ke(wd,"gu").replace(/notPunctSpace/g,Id).replace(/punctSpace/g,Pa).replace(/punct/g,ji).getRegex(),WE=ke(wd,"gu").replace(/notPunctSpace/g,$E).replace(/punctSpace/g,HE).replace(/punct/g,Nd).getRegex(),GE=ke("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Id).replace(/punctSpace/g,Pa).replace(/punct/g,ji).getRegex(),KE=ke(/\\(punct)/,"gu").replace(/punct/g,ji).getRegex(),QE=ke(/^<(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(),XE=ke(La).replace("(?:-->|$)","-->").getRegex(),JE=ke("^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",XE).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ki=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ex=ke(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ki).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Rd=ke(/^!?\[(label)\]\[(ref)\]/).replace("label",ki).replace("ref",Oa).getRegex(),Od=ke(/^!?\[(ref)\](?:\[\])?/).replace("ref",Oa).getRegex(),tx=ke("reflink|nolink(?!\\()","g").replace("reflink",Rd).replace("nolink",Od).getRegex(),Ma={_backpedal:mr,anyPunctuation:KE,autolink:QE,blockSkip:ZE,br:Cd,code:zE,del:mr,emStrongLDelim:YE,emStrongRDelimAst:VE,emStrongRDelimUnd:GE,escape:FE,link:ex,nolink:Od,punctuation:UE,reflink:Rd,reflinkSearch:tx,tag:JE,text:jE,url:mr},nx={...Ma,link:ke(/^!?\[(label)\]\((.*?)\)/).replace("label",ki).getRegex(),reflink:ke(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ki).getRegex()},Ws={...Ma,emStrongRDelimAst:WE,emStrongLDelim:qE,url:ke(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},rx={...Ws,br:ke(Cd).replace("{2,}","*").getRegex(),text:ke(Ws.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Jr={normal:Da,gfm:ME,pedantic:BE},Xn={normal:Ma,gfm:Ws,breaks:rx,pedantic:nx},ix={"&":"&","<":"<",">":">",'"':""","'":"'"},tu=t=>ix[t];function St(t,e){if(e){if(et.escapeTest.test(t))return t.replace(et.escapeReplace,tu)}else if(et.escapeTestNoEncode.test(t))return t.replace(et.escapeReplaceNoEncode,tu);return t}function nu(t){try{t=encodeURI(t).replace(et.percentDecode,"%")}catch{return null}return t}function ru(t,e){const n=t.replace(et.findPipe,(s,a,o)=>{let u=!1,l=a;for(;--l>=0&&o[l]==="\\";)u=!u;return u?"|":" |"}),r=n.split(et.splitPipe);let i=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(;i<r.length;i++)r[i]=r[i].trim().replace(et.slashPipe,"|");return r}function Jn(t,e,n){const r=t.length;if(r===0)return"";let i=0;for(;i<r&&t.charAt(r-i-1)===e;)i++;return t.slice(0,r-i)}function sx(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 iu(t,e,n,r,i){const s=e.href,a=e.title||null,o=t[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;const u={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,u}function ax(t,e,n){const r=t.match(n.other.indentCodeCompensation);if(r===null)return e;const i=r[1];return e.split(`
|
|
41
|
-
`).map(s=>{const a=s.match(n.other.beginningSpace);if(a===null)return s;const[o]=a;return o.length>=i.length?s.slice(i.length):s}).join(`
|
|
42
|
-
`)}var Si=class{options;rules;lexer;constructor(t){this.options=t||bn}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:Jn(n,`
|
|
43
|
-
`)}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const n=e[0],r=ax(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=Jn(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:Jn(e[0],`
|
|
44
|
-
`)}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let n=Jn(e[0],`
|
|
45
|
-
`).split(`
|
|
46
|
-
`),r="",i="";const s=[];for(;n.length>0;){let a=!1;const o=[];let u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))o.push(n[u]),a=!0;else if(!a)o.push(n[u]);else break;n=n.slice(u);const l=o.join(`
|
|
47
|
-
`),d=l.replace(this.rules.other.blockquoteSetextReplace,`
|
|
48
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
49
|
-
${l}`:l,i=i?`${i}
|
|
50
|
-
${d}`:d;const c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,s,!0),this.lexer.state.top=c,n.length===0)break;const h=s.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){const m=h,g=m.raw+`
|
|
51
|
-
`+n.join(`
|
|
52
|
-
`),E=this.blockquote(g);s[s.length-1]=E,r=r.substring(0,r.length-m.raw.length)+E.raw,i=i.substring(0,i.length-m.text.length)+E.text;break}else if(h?.type==="list"){const m=h,g=m.raw+`
|
|
53
|
-
`+n.join(`
|
|
54
|
-
`),E=this.list(g);s[s.length-1]=E,r=r.substring(0,r.length-h.raw.length)+E.raw,i=i.substring(0,i.length-m.raw.length)+E.raw,n=g.substring(s.at(-1).raw.length).split(`
|
|
55
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim();const r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const s=this.rules.other.listItemRegex(n);let a=!1;for(;t;){let u=!1,l="",d="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;l=e[0],t=t.substring(l.length);let c=e[2].split(`
|
|
56
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,x=>" ".repeat(3*x.length)),h=t.split(`
|
|
57
|
-
`,1)[0],m=!c.trim(),g=0;if(this.options.pedantic?(g=2,d=c.trimStart()):m?g=e[1].length+1:(g=e[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,d=c.slice(g),g+=e[1].length),m&&this.rules.other.blankLine.test(h)&&(l+=h+`
|
|
58
|
-
`,t=t.substring(h.length+1),u=!0),!u){const x=this.rules.other.nextBulletRegex(g),_=this.rules.other.hrRegex(g),b=this.rules.other.fencesBeginRegex(g),C=this.rules.other.headingBeginRegex(g),w=this.rules.other.htmlBeginRegex(g);for(;t;){const y=t.split(`
|
|
59
|
-
`,1)[0];let R;if(h=y,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),R=h):R=h.replace(this.rules.other.tabCharGlobal," "),b.test(h)||C.test(h)||w.test(h)||x.test(h)||_.test(h))break;if(R.search(this.rules.other.nonSpaceChar)>=g||!h.trim())d+=`
|
|
60
|
-
`+R.slice(g);else{if(m||c.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||b.test(c)||C.test(c)||_.test(c))break;d+=`
|
|
61
|
-
`+h}!m&&!h.trim()&&(m=!0),l+=y+`
|
|
62
|
-
`,t=t.substring(y.length+1),c=R.slice(g)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(a=!0));let E=null,T;this.options.gfm&&(E=this.rules.other.listIsTask.exec(d),E&&(T=E[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:l,task:!!E,checked:T,loose:!1,text:d,tokens:[]}),i.raw+=l}const o=i.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let u=0;u<i.items.length;u++)if(this.lexer.state.top=!1,i.items[u].tokens=this.lexer.blockTokens(i.items[u].text,[]),!i.loose){const l=i.items[u].tokens.filter(c=>c.type==="space"),d=l.length>0&&l.some(c=>this.rules.other.anyLine.test(c.raw));i.loose=d}if(i.loose)for(let u=0;u<i.items.length;u++)i.items[u].loose=!0;return i}}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"):"",i=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:i}}}table(t){const e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const n=ru(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
63
|
-
`):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const a of r)this.rules.other.tableAlignRight.test(a)?s.align.push("right"):this.rules.other.tableAlignCenter.test(a)?s.align.push("center"):this.rules.other.tableAlignLeft.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a<n.length;a++)s.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:s.align[a]});for(const a of i)s.rows.push(ru(a,s.header.length).map((o,u)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:s.align[u]})));return s}}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)===`
|
|
64
|
-
`?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 s=Jn(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{const s=sx(e[2],"()");if(s===-2)return;if(s>-1){const o=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){const s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=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)),iu(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.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," "),i=e[r.toLowerCase()];if(!i){const s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return iu(n,i,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 s=[...r[0]].length-1;let a,o,u=s,l=0;const d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*t.length+s);(r=d.exec(e))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){u+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){l+=o;continue}if(u-=o,u>0)continue;o=Math.min(o,o+u+l);const c=[...r[0]][0].length,h=t.slice(0,s+r.index+c+o);if(Math.min(s,o)%2){const g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}const m=h.slice(2,-2);return{type:"strong",raw:h,text:m,tokens:this.lexer.inlineTokens(m)}}}}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),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw: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 i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==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}}}},Pt=class Gs{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||bn,this.options.tokenizer=this.options.tokenizer||new Si,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:et,block:Jr.normal,inline:Xn.normal};this.options.pedantic?(n.block=Jr.pedantic,n.inline=Xn.pedantic):this.options.gfm&&(n.block=Jr.gfm,this.options.breaks?n.inline=Xn.breaks:n.inline=Xn.gfm),this.tokenizer.rules=n}static get rules(){return{block:Jr,inline:Xn}}static lex(e,n){return new Gs(n).lex(e)}static lexInline(e,n){return new Gs(n).inlineTokens(e)}lex(e){e=e.replace(et.carriageReturn,`
|
|
65
|
-
`),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(et.tabCharGlobal," ").replace(et.spaceLine,""));e;){let i;if(this.options.extensions?.block?.some(a=>(i=a.call({lexer:this},e,n))?(e=e.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);const a=n.at(-1);i.raw.length===1&&a!==void 0?a.raw+=`
|
|
66
|
-
`:n.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);const a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=`
|
|
67
|
-
`+i.raw,a.text+=`
|
|
68
|
-
`+i.text,this.inlineQueue.at(-1).src=a.text):n.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);const a=n.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=`
|
|
69
|
-
`+i.raw,a.text+=`
|
|
70
|
-
`+i.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),n.push(i);continue}let s=e;if(this.options.extensions?.startBlock){let a=1/0;const o=e.slice(1);let u;this.options.extensions.startBlock.forEach(l=>{u=l.call({lexer:this},o),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(s=e.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){const a=n.at(-1);r&&a?.type==="paragraph"?(a.raw+=`
|
|
71
|
-
`+i.raw,a.text+=`
|
|
72
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i),r=s.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);const a=n.at(-1);a?.type==="text"?(a.raw+=`
|
|
73
|
-
`+i.raw,a.text+=`
|
|
74
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):n.push(i);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,i=null;if(this.tokens.links){const o=Object.keys(this.tokens.links);if(o.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)o.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,a="";for(;e;){s||(a=""),s=!1;let o;if(this.options.extensions?.inline?.some(l=>(o=l.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);const l=n.at(-1);o.type==="text"&&l?.type==="text"?(l.raw+=o.raw,l.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(e,r,a)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let u=e;if(this.options.extensions?.startInline){let l=1/0;const d=e.slice(1);let c;this.options.extensions.startInline.forEach(h=>{c=h.call({lexer:this},d),typeof c=="number"&&c>=0&&(l=Math.min(l,c))}),l<1/0&&l>=0&&(u=e.substring(0,l+1))}if(o=this.tokenizer.inlineText(u)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(a=o.raw.slice(-1)),s=!0;const l=n.at(-1);l?.type==="text"?(l.raw+=o.raw,l.text+=o.text):n.push(o);continue}if(e){const l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return n}},Ai=class{options;parser;constructor(t){this.options=t||bn}space(t){return""}code({text:t,lang:e,escaped:n}){const r=(e||"").match(et.notSpaceStart)?.[0],i=t.replace(et.endingNewline,"")+`
|
|
75
|
-
`;return r?'<pre><code class="language-'+St(r)+'">'+(n?i:St(i,!0))+`</code></pre>
|
|
76
|
-
`:"<pre><code>"+(n?i:St(i,!0))+`</code></pre>
|
|
77
|
-
`}blockquote({tokens:t}){return`<blockquote>
|
|
78
|
-
${this.parser.parse(t)}</blockquote>
|
|
79
|
-
`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
80
|
-
`}hr(t){return`<hr>
|
|
81
|
-
`}list(t){const e=t.ordered,n=t.start;let r="";for(let a=0;a<t.items.length;a++){const o=t.items[a];r+=this.listitem(o)}const i=e?"ol":"ul",s=e&&n!==1?' start="'+n+'"':"";return"<"+i+s+`>
|
|
82
|
-
`+r+"</"+i+`>
|
|
83
|
-
`}listitem(t){let e="";if(t.task){const n=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=n+" "+St(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):e+=n+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
|
|
84
|
-
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
85
|
-
`}table(t){let e="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);e+=this.tablerow({text:n});let r="";for(let i=0;i<t.rows.length;i++){const s=t.rows[i];n="";for(let a=0;a<s.length;a++)n+=this.tablecell(s[a]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
86
|
-
<thead>
|
|
87
|
-
`+e+`</thead>
|
|
88
|
-
`+r+`</table>
|
|
89
|
-
`}tablerow({text:t}){return`<tr>
|
|
90
|
-
${t}</tr>
|
|
91
|
-
`}tablecell(t){const e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
92
|
-
`}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>${St(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),i=nu(t);if(i===null)return r;t=i;let s='<a href="'+t+'"';return e&&(s+=' title="'+St(e)+'"'),s+=">"+r+"</a>",s}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const i=nu(t);if(i===null)return St(n);t=i;let s=`<img src="${t}" alt="${n}"`;return e&&(s+=` title="${St(e)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:St(t.text)}},Ba=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""}},Mt=class Ks{options;renderer;textRenderer;constructor(e){this.options=e||bn,this.options.renderer=this.options.renderer||new Ai,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ba}static parse(e,n){return new Ks(n).parse(e)}static parseInline(e,n){return new Ks(n).parseInline(e)}parse(e,n=!0){let r="";for(let i=0;i<e.length;i++){const s=e[i];if(this.options.extensions?.renderers?.[s.type]){const o=s,u=this.options.extensions.renderers[o.type].call({parser:this},o);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(o.type)){r+=u||"";continue}}const a=s;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 o=a,u=this.renderer.text(o);for(;i+1<e.length&&e[i+1].type==="text";)o=e[++i],u+=`
|
|
93
|
-
`+this.renderer.text(o);n?r+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):r+=u;continue}default:{const o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}parseInline(e,n=this.renderer){let r="";for(let i=0;i<e.length;i++){const s=e[i];if(this.options.extensions?.renderers?.[s.type]){const o=this.options.extensions.renderers[s.type].call({parser:this},s);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=o||"";continue}}const a=s;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 o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}},fi=class{options;block;constructor(t){this.options=t||bn}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Pt.lex:Pt.lexInline}provideParser(){return this.block?Mt.parse:Mt.parseInline}},ox=class{defaults=va();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Mt;Renderer=Ai;TextRenderer=Ba;Lexer=Pt;Tokenizer=Si;Hooks=fi;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 i=r;for(const s of i.header)n=n.concat(this.walkTokens(s.tokens,e));for(const s of i.rows)for(const a of s)n=n.concat(this.walkTokens(a.tokens,e));break}case"list":{const i=r;n=n.concat(this.walkTokens(i.items,e));break}default:{const i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(s=>{const a=i[s].flat(1/0);n=n.concat(this.walkTokens(a,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.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(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const s=e.renderers[i.name];s?e.renderers[i.name]=function(...a){let o=i.renderer.apply(this,a);return o===!1&&(o=s.apply(this,a)),o}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const s=e[i.level];s?s.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),r.extensions=e),n.renderer){const i=this.defaults.renderer||new Ai(this.defaults);for(const s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;const a=s,o=n.renderer[a],u=i[a];i[a]=(...l)=>{let d=o.apply(i,l);return d===!1&&(d=u.apply(i,l)),d||""}}r.renderer=i}if(n.tokenizer){const i=this.defaults.tokenizer||new Si(this.defaults);for(const s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const a=s,o=n.tokenizer[a],u=i[a];i[a]=(...l)=>{let d=o.apply(i,l);return d===!1&&(d=u.apply(i,l)),d}}r.tokenizer=i}if(n.hooks){const i=this.defaults.hooks||new fi;for(const s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;const a=s,o=n.hooks[a],u=i[a];fi.passThroughHooks.has(s)?i[a]=l=>{if(this.defaults.async)return Promise.resolve(o.call(i,l)).then(c=>u.call(i,c));const d=o.call(i,l);return u.call(i,d)}:i[a]=(...l)=>{let d=o.apply(i,l);return d===!1&&(d=u.apply(i,l)),d}}r.hooks=i}if(n.walkTokens){const i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(a){let o=[];return o.push(s.call(this,a)),i&&(o=o.concat(i.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Pt.lex(t,e??this.defaults)}parser(t,e){return Mt.parse(t,e??this.defaults)}parseMarkdown(t){return(n,r)=>{const i={...r},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.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"));s.hooks&&(s.hooks.options=s,s.hooks.block=t);const o=s.hooks?s.hooks.provideLexer():t?Pt.lex:Pt.lexInline,u=s.hooks?s.hooks.provideParser():t?Mt.parse:Mt.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(l=>o(l,s)).then(l=>s.hooks?s.hooks.processAllTokens(l):l).then(l=>s.walkTokens?Promise.all(this.walkTokens(l,s.walkTokens)).then(()=>l):l).then(l=>u(l,s)).then(l=>s.hooks?s.hooks.postprocess(l):l).catch(a);try{s.hooks&&(n=s.hooks.preprocess(n));let l=o(n,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let d=u(l,s);return s.hooks&&(d=s.hooks.postprocess(d)),d}catch(l){return a(l)}}}onError(t,e){return n=>{if(n.message+=`
|
|
94
|
-
Please report this to https://github.com/markedjs/marked.`,t){const r="<p>An error occurred:</p><pre>"+St(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},pn=new ox;function Ae(t,e){return pn.parse(t,e)}Ae.options=Ae.setOptions=function(t){return pn.setOptions(t),Ae.defaults=pn.defaults,yd(Ae.defaults),Ae};Ae.getDefaults=va;Ae.defaults=bn;Ae.use=function(...t){return pn.use(...t),Ae.defaults=pn.defaults,yd(Ae.defaults),Ae};Ae.walkTokens=function(t,e){return pn.walkTokens(t,e)};Ae.parseInline=pn.parseInline;Ae.Parser=Mt;Ae.parser=Mt.parse;Ae.Renderer=Ai;Ae.TextRenderer=Ba;Ae.Lexer=Pt;Ae.lexer=Pt.lex;Ae.Tokenizer=Si;Ae.Hooks=fi;Ae.parse=Ae;Ae.options;Ae.setOptions;Ae.use;Ae.walkTokens;Ae.parseInline;Mt.parse;Pt.lex;function su(t){const e=[],n=String(t||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const a=n.slice(i,r).trim();(a||!s)&&e.push(a),i=r+1,r=n.indexOf(",",i)}return e}function Ld(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ux=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lx=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,cx={};function au(t,e){return(cx.jsx?lx:ux).test(t)}const dx=/[ \t\n\f\r]/g;function fx(t){return typeof t=="object"?t.type==="text"?ou(t.value):!1:ou(t)}function ou(t){return t.replace(dx,"")===""}class $r{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}$r.prototype.normal={};$r.prototype.property={};$r.prototype.space=void 0;function Dd(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new $r(n,r,e)}function Nr(t){return t.toLowerCase()}class ut{constructor(e,n){this.attribute=n,this.property=e}}ut.prototype.attribute="";ut.prototype.booleanish=!1;ut.prototype.boolean=!1;ut.prototype.commaOrSpaceSeparated=!1;ut.prototype.commaSeparated=!1;ut.prototype.defined=!1;ut.prototype.mustUseProperty=!1;ut.prototype.number=!1;ut.prototype.overloadedBoolean=!1;ut.prototype.property="";ut.prototype.spaceSeparated=!1;ut.prototype.space=void 0;let hx=0;const fe=En(),He=En(),Qs=En(),q=En(),we=En(),On=En(),ct=En();function En(){return 2**++hx}const Xs=Object.freeze(Object.defineProperty({__proto__:null,boolean:fe,booleanish:He,commaOrSpaceSeparated:ct,commaSeparated:On,number:q,overloadedBoolean:Qs,spaceSeparated:we},Symbol.toStringTag,{value:"Module"})),ds=Object.keys(Xs);class Fa extends ut{constructor(e,n,r,i){let s=-1;if(super(e,n),uu(this,"space",i),typeof r=="number")for(;++s<ds.length;){const a=ds[s];uu(this,ds[s],(r&Xs[a])===Xs[a])}}}Fa.prototype.defined=!0;function uu(t,e,n){n&&(t[e]=n)}function $n(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const s=new Fa(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),e[r]=s,n[Nr(r)]=r,n[Nr(s.attribute)]=r}return new $r(e,n,t.space)}const Pd=$n({properties:{ariaActiveDescendant:null,ariaAtomic:He,ariaAutoComplete:null,ariaBusy:He,ariaChecked:He,ariaColCount:q,ariaColIndex:q,ariaColSpan:q,ariaControls:we,ariaCurrent:null,ariaDescribedBy:we,ariaDetails:null,ariaDisabled:He,ariaDropEffect:we,ariaErrorMessage:null,ariaExpanded:He,ariaFlowTo:we,ariaGrabbed:He,ariaHasPopup:null,ariaHidden:He,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:we,ariaLevel:q,ariaLive:null,ariaModal:He,ariaMultiLine:He,ariaMultiSelectable:He,ariaOrientation:null,ariaOwns:we,ariaPlaceholder:null,ariaPosInSet:q,ariaPressed:He,ariaReadOnly:He,ariaRelevant:null,ariaRequired:He,ariaRoleDescription:we,ariaRowCount:q,ariaRowIndex:q,ariaRowSpan:q,ariaSelected:He,ariaSetSize:q,ariaSort:null,ariaValueMax:q,ariaValueMin:q,ariaValueNow:q,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function Md(t,e){return e in t?t[e]:e}function Bd(t,e){return Md(t,e.toLowerCase())}const px=$n({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:On,acceptCharset:we,accessKey:we,action:null,allow:null,allowFullScreen:fe,allowPaymentRequest:fe,allowUserMedia:fe,alt:null,as:null,async:fe,autoCapitalize:null,autoComplete:we,autoFocus:fe,autoPlay:fe,blocking:we,capture:null,charSet:null,checked:fe,cite:null,className:we,cols:q,colSpan:null,content:null,contentEditable:He,controls:fe,controlsList:we,coords:q|On,crossOrigin:null,data:null,dateTime:null,decoding:null,default:fe,defer:fe,dir:null,dirName:null,disabled:fe,download:Qs,draggable:He,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:fe,formTarget:null,headers:we,height:q,hidden:Qs,high:q,href:null,hrefLang:null,htmlFor:we,httpEquiv:we,id:null,imageSizes:null,imageSrcSet:null,inert:fe,inputMode:null,integrity:null,is:null,isMap:fe,itemId:null,itemProp:we,itemRef:we,itemScope:fe,itemType:we,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:fe,low:q,manifest:null,max:null,maxLength:q,media:null,method:null,min:null,minLength:q,multiple:fe,muted:fe,name:null,nonce:null,noModule:fe,noValidate:fe,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:fe,optimum:q,pattern:null,ping:we,placeholder:null,playsInline:fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:fe,referrerPolicy:null,rel:we,required:fe,reversed:fe,rows:q,rowSpan:q,sandbox:we,scope:null,scoped:fe,seamless:fe,selected:fe,shadowRootClonable:fe,shadowRootDelegatesFocus:fe,shadowRootMode:null,shape:null,size:q,sizes:null,slot:null,span:q,spellCheck:He,src:null,srcDoc:null,srcLang:null,srcSet:null,start:q,step:null,style:null,tabIndex:q,target:null,title:null,translate:null,type:null,typeMustMatch:fe,useMap:null,value:He,width:q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:we,axis:null,background:null,bgColor:null,border:q,borderColor:null,bottomMargin:q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:fe,declare:fe,event:null,face:null,frame:null,frameBorder:null,hSpace:q,leftMargin:q,link:null,longDesc:null,lowSrc:null,marginHeight:q,marginWidth:q,noResize:fe,noHref:fe,noShade:fe,noWrap:fe,object:null,profile:null,prompt:null,rev:null,rightMargin:q,rules:null,scheme:null,scrolling:He,standby:null,summary:null,text:null,topMargin:q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:fe,disableRemotePlayback:fe,prefix:null,property:null,results:q,security:null,unselectable:null},space:"html",transform:Bd}),mx=$n({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:ct,accentHeight:q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:q,amplitude:q,arabicForm:null,ascent:q,attributeName:null,attributeType:null,azimuth:q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:q,by:null,calcMode:null,capHeight:q,className:we,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:q,diffuseConstant:q,direction:null,display:null,dur:null,divisor:q,dominantBaseline:null,download:fe,dx:null,dy:null,edgeMode:null,editable:null,elevation:q,enableBackground:null,end:null,event:null,exponent:q,externalResourcesRequired:null,fill:null,fillOpacity:q,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:On,g2:On,glyphName:On,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:q,horizOriginX:q,horizOriginY:q,id:null,ideographic:q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:q,k:q,k1:q,k2:q,k3:q,k4:q,kernelMatrix:ct,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:q,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:q,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:q,overlineThickness:q,paintOrder:null,panose1:null,path:null,pathLength:q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:we,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:q,pointsAtY:q,pointsAtZ:q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ct,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ct,rev:ct,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ct,requiredFeatures:ct,requiredFonts:ct,requiredFormats:ct,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:q,specularExponent:q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:q,strikethroughThickness:q,string:null,stroke:null,strokeDashArray:ct,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:q,strokeOpacity:q,strokeWidth:null,style:null,surfaceScale:q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ct,tabIndex:q,tableValues:null,target:null,targetX:q,targetY:q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ct,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:q,underlineThickness:q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:q,values:null,vAlphabetic:q,vMathematical:q,vectorEffect:null,vHanging:q,vIdeographic:q,version:null,vertAdvY:q,vertOriginX:q,vertOriginY:q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Md}),Fd=$n({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()}}),zd=$n({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Bd}),jd=$n({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),gx={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"},bx=/[A-Z]/g,lu=/-[a-z]/g,Ex=/^data[-\w.:]+$/i;function Ui(t,e){const n=Nr(e);let r=e,i=ut;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ex.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(lu,Tx);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!lu.test(s)){let a=s.replace(bx,xx);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=Fa}return new i(r,e)}function xx(t){return"-"+t.toLowerCase()}function Tx(t){return t.charAt(1).toUpperCase()}const Zr=Dd([Pd,px,Fd,zd,jd],"html"),Kt=Dd([Pd,mx,Fd,zd,jd],"svg");function cu(t){const e=String(t||"").trim();return e?e.split(/[ \t\n\r\f]+/g):[]}function Ud(t){return t.join(" ").trim()}var yn={},fs,du;function _x(){if(du)return fs;du=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,o=/^\s+|\s+$/g,u=`
|
|
95
|
-
`,l="/",d="*",c="",h="comment",m="declaration";function g(T,x){if(typeof T!="string")throw new TypeError("First argument must be a string");if(!T)return[];x=x||{};var _=1,b=1;function C(Y){var H=Y.match(e);H&&(_+=H.length);var J=Y.lastIndexOf(u);b=~J?Y.length-J:b+Y.length}function w(){var Y={line:_,column:b};return function(H){return H.position=new y(Y),P(),H}}function y(Y){this.start=Y,this.end={line:_,column:b},this.source=x.source}y.prototype.content=T;function R(Y){var H=new Error(x.source+":"+_+":"+b+": "+Y);if(H.reason=Y,H.filename=x.source,H.line=_,H.column=b,H.source=T,!x.silent)throw H}function D(Y){var H=Y.exec(T);if(H){var J=H[0];return C(J),T=T.slice(J.length),H}}function P(){D(n)}function v(Y){var H;for(Y=Y||[];H=M();)H!==!1&&Y.push(H);return Y}function M(){var Y=w();if(!(l!=T.charAt(0)||d!=T.charAt(1))){for(var H=2;c!=T.charAt(H)&&(d!=T.charAt(H)||l!=T.charAt(H+1));)++H;if(H+=2,c===T.charAt(H-1))return R("End of comment missing");var J=T.slice(2,H-2);return b+=2,C(J),T=T.slice(H),b+=2,Y({type:h,comment:J})}}function F(){var Y=w(),H=D(r);if(H){if(M(),!D(i))return R("property missing ':'");var J=D(s),de=Y({type:m,property:E(H[0].replace(t,c)),value:J?E(J[0].replace(t,c)):c});return D(a),de}}function K(){var Y=[];v(Y);for(var H;H=F();)H!==!1&&(Y.push(H),v(Y));return Y}return P(),K()}function E(T){return T?T.replace(o,c):c}return fs=g,fs}var fu;function yx(){if(fu)return yn;fu=1;var t=yn&&yn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(yn,"__esModule",{value:!0}),yn.default=n;const e=t(_x());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const a=(0,e.default)(r),o=typeof i=="function";return a.forEach(u=>{if(u.type!=="declaration")return;const{property:l,value:d}=u;o?i(l,d,u):d&&(s=s||{},s[l]=d)}),s}return yn}var er={},hu;function kx(){if(hu)return er;hu=1,Object.defineProperty(er,"__esModule",{value:!0}),er.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(l){return!l||n.test(l)||t.test(l)},a=function(l,d){return d.toUpperCase()},o=function(l,d){return"".concat(d,"-")},u=function(l,d){return d===void 0&&(d={}),s(l)?l:(l=l.toLowerCase(),d.reactCompat?l=l.replace(i,o):l=l.replace(r,o),l.replace(e,a))};return er.camelCase=u,er}var tr,pu;function Sx(){if(pu)return tr;pu=1;var t=tr&&tr.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},e=t(yx()),n=kx();function r(i,s){var a={};return!i||typeof i!="string"||(0,e.default)(i,function(o,u){o&&u&&(a[(0,n.camelCase)(o,s)]=u)}),a}return r.default=r,tr=r,tr}var Ax=Sx();const Cx=ba(Ax),Hi=Hd("end"),vt=Hd("start");function Hd(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 Ix(t){const e=vt(t),n=Hi(t);if(e&&n)return{start:e,end:n}}function gr(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?mu(t.position):"start"in t||"end"in t?mu(t):"line"in t||"column"in t?Js(t):""}function Js(t){return gu(t&&t.line)+":"+gu(t&&t.column)}function mu(t){return Js(t&&t.start)+"-"+Js(t&&t.end)}function gu(t){return t&&typeof t=="number"?t:1}class Ge extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof e=="string"?i=e:!s.cause&&e&&(a=!0,i=e.message,s.cause=e),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=gr(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Ge.prototype.file="";Ge.prototype.name="";Ge.prototype.reason="";Ge.prototype.message="";Ge.prototype.stack="";Ge.prototype.column=void 0;Ge.prototype.line=void 0;Ge.prototype.ancestors=void 0;Ge.prototype.cause=void 0;Ge.prototype.fatal=void 0;Ge.prototype.place=void 0;Ge.prototype.ruleId=void 0;Ge.prototype.source=void 0;const za={}.hasOwnProperty,Nx=new Map,vx=/[A-Z]/g,wx=new Set(["table","tbody","thead","tfoot","tr"]),Rx=new Set(["td","th"]),$d="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Ox(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=jx(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=zx(n,e.jsx,e.jsxs)}const i={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"?Kt:Zr,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},s=Zd(i,t,void 0);return s&&typeof s!="string"?s:i.create(t,i.Fragment,{children:s||void 0},void 0)}function Zd(t,e,n){if(e.type==="element")return Lx(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Dx(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Mx(t,e,n);if(e.type==="mdxjsEsm")return Px(t,e);if(e.type==="root")return Bx(t,e,n);if(e.type==="text")return Fx(t,e)}function Lx(t,e,n){const r=t.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Kt,t.schema=i),t.ancestors.push(e);const s=qd(t,e.tagName,!1),a=Ux(t,e);let o=Ua(t,e);return wx.has(e.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!fx(u):!0})),Yd(t,a,s,e),ja(a,o),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function Dx(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)}vr(t,e.position)}function Px(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);vr(t,e.position)}function Mx(t,e,n){const r=t.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=Kt,t.schema=i),t.ancestors.push(e);const s=e.name===null?t.Fragment:qd(t,e.name,!0),a=Hx(t,e),o=Ua(t,e);return Yd(t,a,s,e),ja(a,o),t.ancestors.pop(),t.schema=r,t.create(e,s,a,n)}function Bx(t,e,n){const r={};return ja(r,Ua(t,e)),t.create(e,t.Fragment,r,n)}function Fx(t,e){return e.value}function Yd(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function ja(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function zx(t,e,n){return r;function r(i,s,a,o){const l=Array.isArray(a.children)?n:e;return o?l(s,a,o):l(s,a)}}function jx(t,e){return n;function n(r,i,s,a){const o=Array.isArray(s.children),u=vt(r);return e(i,s,a,o,{columnNumber:u?u.column-1:void 0,fileName:t,lineNumber:u?u.line:void 0},void 0)}}function Ux(t,e){const n={};let r,i;for(i in e.properties)if(i!=="children"&&za.call(e.properties,i)){const s=$x(t,i,e.properties[i]);if(s){const[a,o]=s;t.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&Rx.has(e.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Hx(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,t.evaluater.evaluateExpression(o.argument))}else vr(t,e.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const o=r.value.data.estree.body[0];o.type,s=t.evaluater.evaluateExpression(o.expression)}else vr(t,e.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Ua(t,e){const n=[];let r=-1;const i=t.passKeys?new Map:Nx;for(;++r<e.children.length;){const s=e.children[r];let a;if(t.passKeys){const u=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(u){const l=i.get(u)||0;a=u+"-"+l,i.set(u,l+1)}}const o=Zd(t,s,a);o!==void 0&&n.push(o)}return n}function $x(t,e,n){const r=Ui(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Ld(n):Ud(n)),r.property==="style"){let i=typeof n=="object"?n:Zx(t,String(n));return t.stylePropertyNameCase==="css"&&(i=Yx(i)),["style",i]}return[t.elementAttributeNameCase==="react"&&r.space?gx[r.property]||r.property:r.attribute,n]}}function Zx(t,e){try{return Cx(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,i=new Ge("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=$d+"#cannot-parse-style-attribute",i}}function qd(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const i=e.split(".");let s=-1,a;for(;++s<i.length;){const o=au(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=a}else r=au(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const i=r.value;return za.call(t.components,i)?t.components[i]:i}if(t.evaluater)return t.evaluater.evaluateExpression(r);vr(t)}function vr(t,e){const n=new Ge("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=$d+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Yx(t){const e={};let n;for(n in t)za.call(t,n)&&(e[qx(n)]=t[n]);return e}function qx(t){let e=t.replace(vx,Vx);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function Vx(t){return"-"+t.toLowerCase()}const hs={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"]},Wx={};function Ha(t,e){const n=Wx,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Vd(t,r,i)}function Vd(t,e,n){if(Gx(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 bu(t.children,e,n)}return Array.isArray(t)?bu(t,e,n):""}function bu(t,e,n){const r=[];let i=-1;for(;++i<t.length;)r[i]=Vd(t[i],e,n);return r.join("")}function Gx(t){return!!(t&&typeof t=="object")}const Eu=document.createElement("i");function $a(t){const e="&"+t+";";Eu.innerHTML=e;const n=Eu.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function ft(t,e,n,r){const i=t.length;let s=0,a;if(e<0?e=-e>i?0:i+e:e=e>i?i: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);s<r.length;)a=r.slice(s,s+1e4),a.unshift(e,0),t.splice(...a),s+=1e4,e+=1e4}function mt(t,e){return t.length>0?(ft(t,t.length,0,e),t):e}const xu={}.hasOwnProperty;function Wd(t){const e={};let n=-1;for(;++n<t.length;)Kx(e,t[n]);return e}function Kx(t,e){let n;for(n in e){const i=(xu.call(t,n)?t[n]:void 0)||(t[n]={}),s=e[n];let a;if(s)for(a in s){xu.call(i,a)||(i[a]=[]);const o=s[a];Qx(i[a],Array.isArray(o)?o:o?[o]:[])}}}function Qx(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);ft(t,0,0,r)}function Gd(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 Tt(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Je=Qt(/[A-Za-z]/),We=Qt(/[\dA-Za-z]/),Xx=Qt(/[#-'*+\--9=?A-Z^-~]/);function Ci(t){return t!==null&&(t<32||t===127)}const ea=Qt(/\d/),Jx=Qt(/[\dA-Fa-f]/),eT=Qt(/[!-/:-@[-`{-~]/);function ae(t){return t!==null&&t<-2}function ve(t){return t!==null&&(t<0||t===32)}function Ee(t){return t===-2||t===-1||t===32}const $i=Qt(new RegExp("\\p{P}|\\p{S}","u")),mn=Qt(/\s/);function Qt(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Zn(t){const e=[];let n=-1,r=0,i=0;for(;++n<t.length;){const s=t.charCodeAt(n);let a="";if(s===37&&We(t.charCodeAt(n+1))&&We(t.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=t.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(e.push(t.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return e.join("")+t.slice(r)}function _e(t,e,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(u){return Ee(u)?(t.enter(n),o(u)):e(u)}function o(u){return Ee(u)&&s++<i?(t.consume(u),o):(t.exit(n),e(u))}}const tT={tokenize:nT};function nT(t){const e=t.attempt(this.parser.constructs.contentInitial,r,i);let n;return e;function r(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),_e(t,e,"linePrefix")}function i(o){return t.enter("paragraph"),s(o)}function s(o){const u=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(o)}function a(o){if(o===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(o);return}return ae(o)?(t.consume(o),t.exit("chunkText"),s):(t.consume(o),a)}}const rT={tokenize:iT},Tu={tokenize:sT};function iT(t){const e=this,n=[];let r=0,i,s,a;return o;function o(b){if(r<n.length){const C=n[r];return e.containerState=C[1],t.attempt(C[0].continuation,u,l)(b)}return l(b)}function u(b){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&_();const C=e.events.length;let w=C,y;for(;w--;)if(e.events[w][0]==="exit"&&e.events[w][1].type==="chunkFlow"){y=e.events[w][1].end;break}x(r);let R=C;for(;R<e.events.length;)e.events[R][1].end={...y},R++;return ft(e.events,w+1,0,e.events.slice(C)),e.events.length=R,l(b)}return o(b)}function l(b){if(r===n.length){if(!i)return h(b);if(i.currentConstruct&&i.currentConstruct.concrete)return g(b);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Tu,d,c)(b)}function d(b){return i&&_(),x(r),h(b)}function c(b){return e.parser.lazy[e.now().line]=r!==n.length,a=e.now().offset,g(b)}function h(b){return e.containerState={},t.attempt(Tu,m,g)(b)}function m(b){return r++,n.push([e.currentConstruct,e.containerState]),h(b)}function g(b){if(b===null){i&&_(),x(0),t.consume(b);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),E(b)}function E(b){if(b===null){T(t.exit("chunkFlow"),!0),x(0),t.consume(b);return}return ae(b)?(t.consume(b),T(t.exit("chunkFlow")),r=0,e.interrupt=void 0,o):(t.consume(b),E)}function T(b,C){const w=e.sliceStream(b);if(C&&w.push(null),b.previous=s,s&&(s.next=b),s=b,i.defineSkip(b.start),i.write(w),e.parser.lazy[b.start.line]){let y=i.events.length;for(;y--;)if(i.events[y][1].start.offset<a&&(!i.events[y][1].end||i.events[y][1].end.offset>a))return;const R=e.events.length;let D=R,P,v;for(;D--;)if(e.events[D][0]==="exit"&&e.events[D][1].type==="chunkFlow"){if(P){v=e.events[D][1].end;break}P=!0}for(x(r),y=R;y<e.events.length;)e.events[y][1].end={...v},y++;ft(e.events,D+1,0,e.events.slice(R)),e.events.length=y}}function x(b){let C=n.length;for(;C-- >b;){const w=n[C];e.containerState=w[1],w[0].exit.call(e,t)}n.length=b}function _(){i.write([null]),s=void 0,i=void 0,e.containerState._closeFlow=void 0}}function sT(t,e,n){return _e(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Mn(t){if(t===null||ve(t)||mn(t))return 1;if($i(t))return 2}function Zi(t,e,n){const r=[];let i=-1;for(;++i<t.length;){const s=t[i].resolveAll;s&&!r.includes(s)&&(e=s(e,n),r.push(s))}return e}const ta={name:"attention",resolveAll:aT,tokenize:oT};function aT(t,e){let n=-1,r,i,s,a,o,u,l,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;u=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 c={...t[r][1].end},h={...t[n][1].start};_u(c,-u),_u(h,u),a={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...t[r][1].end}},o={type:u>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:h},s={type:u>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},t[r][1].end={...a.start},t[n][1].start={...o.end},l=[],t[r][1].end.offset-t[r][1].start.offset&&(l=mt(l,[["enter",t[r][1],e],["exit",t[r][1],e]])),l=mt(l,[["enter",i,e],["enter",a,e],["exit",a,e],["enter",s,e]]),l=mt(l,Zi(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),l=mt(l,[["exit",s,e],["enter",o,e],["exit",o,e],["exit",i,e]]),t[n][1].end.offset-t[n][1].start.offset?(d=2,l=mt(l,[["enter",t[n][1],e],["exit",t[n][1],e]])):d=0,ft(t,r-1,n-r+3,l),n=r+l.length-d-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function oT(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Mn(r);let s;return a;function a(u){return s=u,t.enter("attentionSequence"),o(u)}function o(u){if(u===s)return t.consume(u),o;const l=t.exit("attentionSequence"),d=Mn(u),c=!d||d===2&&i||n.includes(u),h=!i||i===2&&d||n.includes(r);return l._open=!!(s===42?c:c&&(i||!h)),l._close=!!(s===42?h:h&&(d||!c)),e(u)}}function _u(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const uT={name:"autolink",tokenize:lT};function lT(t,e,n){let r=0;return i;function i(m){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),s}function s(m){return Je(m)?(t.consume(m),a):m===64?n(m):l(m)}function a(m){return m===43||m===45||m===46||We(m)?(r=1,o(m)):l(m)}function o(m){return m===58?(t.consume(m),r=0,u):(m===43||m===45||m===46||We(m))&&r++<32?(t.consume(m),o):(r=0,l(m))}function u(m){return m===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.exit("autolink"),e):m===null||m===32||m===60||Ci(m)?n(m):(t.consume(m),u)}function l(m){return m===64?(t.consume(m),d):Xx(m)?(t.consume(m),l):n(m)}function d(m){return We(m)?c(m):n(m)}function c(m){return m===46?(t.consume(m),r=0,d):m===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.exit("autolink"),e):h(m)}function h(m){if((m===45||We(m))&&r++<63){const g=m===45?h:c;return t.consume(m),g}return n(m)}}const Yr={partial:!0,tokenize:cT};function cT(t,e,n){return r;function r(s){return Ee(s)?_e(t,i,"linePrefix")(s):i(s)}function i(s){return s===null||ae(s)?e(s):n(s)}}const Kd={continuation:{tokenize:fT},exit:hT,name:"blockQuote",tokenize:dT};function dT(t,e,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(t.enter("blockQuote",{_container:!0}),o.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(a),t.exit("blockQuoteMarker"),s}return n(a)}function s(a){return Ee(a)?(t.enter("blockQuotePrefixWhitespace"),t.consume(a),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(a))}}function fT(t,e,n){const r=this;return i;function i(a){return Ee(a)?_e(t,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return t.attempt(Kd,e,n)(a)}}function hT(t){t.exit("blockQuote")}const Qd={name:"characterEscape",tokenize:pT};function pT(t,e,n){return r;function r(s){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(s),t.exit("escapeMarker"),i}function i(s){return eT(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(s)}}const Xd={name:"characterReference",tokenize:mT};function mT(t,e,n){const r=this;let i=0,s,a;return o;function o(c){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(c),t.exit("characterReferenceMarker"),u}function u(c){return c===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(c),t.exit("characterReferenceMarkerNumeric"),l):(t.enter("characterReferenceValue"),s=31,a=We,d(c))}function l(c){return c===88||c===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(c),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),s=6,a=Jx,d):(t.enter("characterReferenceValue"),s=7,a=ea,d(c))}function d(c){if(c===59&&i){const h=t.exit("characterReferenceValue");return a===We&&!$a(r.sliceSerialize(h))?n(c):(t.enter("characterReferenceMarker"),t.consume(c),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return a(c)&&i++<s?(t.consume(c),d):n(c)}}const yu={partial:!0,tokenize:bT},ku={concrete:!0,name:"codeFenced",tokenize:gT};function gT(t,e,n){const r=this,i={partial:!0,tokenize:w};let s=0,a=0,o;return u;function u(y){return l(y)}function l(y){const R=r.events[r.events.length-1];return s=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,o=y,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),d(y)}function d(y){return y===o?(a++,t.consume(y),d):a<3?n(y):(t.exit("codeFencedFenceSequence"),Ee(y)?_e(t,c,"whitespace")(y):c(y))}function c(y){return y===null||ae(y)?(t.exit("codeFencedFence"),r.interrupt?e(y):t.check(yu,E,C)(y)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===null||ae(y)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),c(y)):Ee(y)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),_e(t,m,"whitespace")(y)):y===96&&y===o?n(y):(t.consume(y),h)}function m(y){return y===null||ae(y)?c(y):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),g(y))}function g(y){return y===null||ae(y)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),c(y)):y===96&&y===o?n(y):(t.consume(y),g)}function E(y){return t.attempt(i,C,T)(y)}function T(y){return t.enter("lineEnding"),t.consume(y),t.exit("lineEnding"),x}function x(y){return s>0&&Ee(y)?_e(t,_,"linePrefix",s+1)(y):_(y)}function _(y){return y===null||ae(y)?t.check(yu,E,C)(y):(t.enter("codeFlowValue"),b(y))}function b(y){return y===null||ae(y)?(t.exit("codeFlowValue"),_(y)):(t.consume(y),b)}function C(y){return t.exit("codeFenced"),e(y)}function w(y,R,D){let P=0;return v;function v(H){return y.enter("lineEnding"),y.consume(H),y.exit("lineEnding"),M}function M(H){return y.enter("codeFencedFence"),Ee(H)?_e(y,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):F(H)}function F(H){return H===o?(y.enter("codeFencedFenceSequence"),K(H)):D(H)}function K(H){return H===o?(P++,y.consume(H),K):P>=a?(y.exit("codeFencedFenceSequence"),Ee(H)?_e(y,Y,"whitespace")(H):Y(H)):D(H)}function Y(H){return H===null||ae(H)?(y.exit("codeFencedFence"),R(H)):D(H)}}}function bT(t,e,n){const r=this;return i;function i(a){return a===null?n(a):(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}const ps={name:"codeIndented",tokenize:xT},ET={partial:!0,tokenize:TT};function xT(t,e,n){const r=this;return i;function i(l){return t.enter("codeIndented"),_e(t,s,"linePrefix",5)(l)}function s(l){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(l):n(l)}function a(l){return l===null?u(l):ae(l)?t.attempt(ET,a,u)(l):(t.enter("codeFlowValue"),o(l))}function o(l){return l===null||ae(l)?(t.exit("codeFlowValue"),a(l)):(t.consume(l),o)}function u(l){return t.exit("codeIndented"),e(l)}}function TT(t,e,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):ae(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),i):_e(t,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(a):ae(a)?i(a):n(a)}}const _T={name:"codeText",previous:kT,resolve:yT,tokenize:ST};function yT(t){let e=t.length-4,n=3,r,i;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;)i===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(i=r):(r===e||t[r][1].type==="lineEnding")&&(t[i][1].type="codeTextData",r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),e-=r-i-2,r=i+2),i=void 0);return t}function kT(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ST(t,e,n){let r=0,i,s;return a;function a(c){return t.enter("codeText"),t.enter("codeTextSequence"),o(c)}function o(c){return c===96?(t.consume(c),r++,o):(t.exit("codeTextSequence"),u(c))}function u(c){return c===null?n(c):c===32?(t.enter("space"),t.consume(c),t.exit("space"),u):c===96?(s=t.enter("codeTextSequence"),i=0,d(c)):ae(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),u):(t.enter("codeTextData"),l(c))}function l(c){return c===null||c===32||c===96||ae(c)?(t.exit("codeTextData"),u(c)):(t.consume(c),l)}function d(c){return c===96?(t.consume(c),i++,d):i===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(c)):(s.type="codeTextData",l(c))}}class AT{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 i=n||0;this.setCursor(Math.trunc(e));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&nr(this.left,r),s.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),nr(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),nr(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);nr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);nr(this.left,n.reverse())}}}function nr(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 Jd(t){const e={};let n=-1,r,i,s,a,o,u,l;const d=new AT(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"&&(u=r[1]._tokenizer.events,s=0,s<u.length&&u[s][1].type==="lineEndingBlank"&&(s+=2),s<u.length&&u[s][1].type==="content"))for(;++s<u.length&&u[s][1].type!=="content";)u[s][1].type==="chunkText"&&(u[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,CT(d,n)),n=e[n],l=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=d.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},o=d.slice(i,n),o.unshift(r),d.splice(i,n-i+1,o))}}return ft(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!l}function CT(t,e){const n=t.get(e)[1],r=t.get(e)[2];let i=e-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,u=[],l={};let d,c,h=-1,m=n,g=0,E=0;const T=[E];for(;m;){for(;t.get(++i)[1]!==m;);s.push(i),m._tokenizer||(d=r.sliceStream(m),m.next||d.push(null),c&&a.defineSkip(m.start),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),c=m,m=m.next}for(m=n;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(E=h+1,T.push(E),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(a.events=[],m?(m._tokenizer=void 0,m.previous=void 0):T.pop(),h=T.length;h--;){const x=o.slice(T[h],T[h+1]),_=s.pop();u.push([_,_+x.length-1]),t.splice(_,2,x)}for(u.reverse(),h=-1;++h<u.length;)l[g+u[h][0]]=g+u[h][1],g+=u[h][1]-u[h][0]-1;return l}const IT={resolve:vT,tokenize:wT},NT={partial:!0,tokenize:RT};function vT(t){return Jd(t),t}function wT(t,e){let n;return r;function r(o){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):ae(o)?t.check(NT,a,s)(o):(t.consume(o),i)}function s(o){return t.exit("chunkContent"),t.exit("content"),e(o)}function a(o){return t.consume(o),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function RT(t,e,n){const r=this;return i;function i(a){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),_e(t,s,"linePrefix")}function s(a){if(a===null||ae(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?e(a):t.interrupt(r.parser.constructs.flow,n,e)(a)}}function ef(t,e,n,r,i,s,a,o,u){const l=u||Number.POSITIVE_INFINITY;let d=0;return c;function c(x){return x===60?(t.enter(r),t.enter(i),t.enter(s),t.consume(x),t.exit(s),h):x===null||x===32||x===41||Ci(x)?n(x):(t.enter(r),t.enter(a),t.enter(o),t.enter("chunkString",{contentType:"string"}),E(x))}function h(x){return x===62?(t.enter(s),t.consume(x),t.exit(s),t.exit(i),t.exit(r),e):(t.enter(o),t.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===62?(t.exit("chunkString"),t.exit(o),h(x)):x===null||x===60||ae(x)?n(x):(t.consume(x),x===92?g:m)}function g(x){return x===60||x===62||x===92?(t.consume(x),m):m(x)}function E(x){return!d&&(x===null||x===41||ve(x))?(t.exit("chunkString"),t.exit(o),t.exit(a),t.exit(r),e(x)):d<l&&x===40?(t.consume(x),d++,E):x===41?(t.consume(x),d--,E):x===null||x===32||x===40||Ci(x)?n(x):(t.consume(x),x===92?T:E)}function T(x){return x===40||x===41||x===92?(t.consume(x),E):E(x)}}function tf(t,e,n,r,i,s){const a=this;let o=0,u;return l;function l(m){return t.enter(r),t.enter(i),t.consume(m),t.exit(i),t.enter(s),d}function d(m){return o>999||m===null||m===91||m===93&&!u||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(t.exit(s),t.enter(i),t.consume(m),t.exit(i),t.exit(r),e):ae(m)?(t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),d):(t.enter("chunkString",{contentType:"string"}),c(m))}function c(m){return m===null||m===91||m===93||ae(m)||o++>999?(t.exit("chunkString"),d(m)):(t.consume(m),u||(u=!Ee(m)),m===92?h:c)}function h(m){return m===91||m===92||m===93?(t.consume(m),o++,c):c(m)}}function nf(t,e,n,r,i,s){let a;return o;function o(h){return h===34||h===39||h===40?(t.enter(r),t.enter(i),t.consume(h),t.exit(i),a=h===40?41:h,u):n(h)}function u(h){return h===a?(t.enter(i),t.consume(h),t.exit(i),t.exit(r),e):(t.enter(s),l(h))}function l(h){return h===a?(t.exit(s),u(a)):h===null?n(h):ae(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),_e(t,l,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===a||h===null||ae(h)?(t.exit("chunkString"),l(h)):(t.consume(h),h===92?c:d)}function c(h){return h===a||h===92?(t.consume(h),d):d(h)}}function br(t,e){let n;return r;function r(i){return ae(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),n=!0,r):Ee(i)?_e(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const OT={name:"definition",tokenize:DT},LT={partial:!0,tokenize:PT};function DT(t,e,n){const r=this;let i;return s;function s(m){return t.enter("definition"),a(m)}function a(m){return tf.call(r,t,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return i=Tt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),u):n(m)}function u(m){return ve(m)?br(t,l)(m):l(m)}function l(m){return ef(t,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return t.attempt(LT,c,c)(m)}function c(m){return Ee(m)?_e(t,h,"whitespace")(m):h(m)}function h(m){return m===null||ae(m)?(t.exit("definition"),r.parser.defined.push(i),e(m)):n(m)}}function PT(t,e,n){return r;function r(o){return ve(o)?br(t,i)(o):n(o)}function i(o){return nf(t,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return Ee(o)?_e(t,a,"whitespace")(o):a(o)}function a(o){return o===null||ae(o)?e(o):n(o)}}const MT={name:"hardBreakEscape",tokenize:BT};function BT(t,e,n){return r;function r(s){return t.enter("hardBreakEscape"),t.consume(s),i}function i(s){return ae(s)?(t.exit("hardBreakEscape"),e(s)):n(s)}}const FT={name:"headingAtx",resolve:zT,tokenize:jT};function zT(t,e){let n=t.length-2,r=3,i,s;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&&(i={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},s={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},ft(t,r,n-r+1,[["enter",i,e],["enter",s,e],["exit",s,e],["exit",i,e]])),t}function jT(t,e,n){let r=0;return i;function i(d){return t.enter("atxHeading"),s(d)}function s(d){return t.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(t.consume(d),a):d===null||ve(d)?(t.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(t.enter("atxHeadingSequence"),u(d)):d===null||ae(d)?(t.exit("atxHeading"),e(d)):Ee(d)?_e(t,o,"whitespace")(d):(t.enter("atxHeadingText"),l(d))}function u(d){return d===35?(t.consume(d),u):(t.exit("atxHeadingSequence"),o(d))}function l(d){return d===null||d===35||ve(d)?(t.exit("atxHeadingText"),o(d)):(t.consume(d),l)}}const UT=["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"],Su=["pre","script","style","textarea"],HT={concrete:!0,name:"htmlFlow",resolveTo:YT,tokenize:qT},$T={partial:!0,tokenize:WT},ZT={partial:!0,tokenize:VT};function YT(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 qT(t,e,n){const r=this;let i,s,a,o,u;return l;function l(S){return d(S)}function d(S){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(S),c}function c(S){return S===33?(t.consume(S),h):S===47?(t.consume(S),s=!0,E):S===63?(t.consume(S),i=3,r.interrupt?e:N):Je(S)?(t.consume(S),a=String.fromCharCode(S),T):n(S)}function h(S){return S===45?(t.consume(S),i=2,m):S===91?(t.consume(S),i=5,o=0,g):Je(S)?(t.consume(S),i=4,r.interrupt?e:N):n(S)}function m(S){return S===45?(t.consume(S),r.interrupt?e:N):n(S)}function g(S){const te="CDATA[";return S===te.charCodeAt(o++)?(t.consume(S),o===te.length?r.interrupt?e:F:g):n(S)}function E(S){return Je(S)?(t.consume(S),a=String.fromCharCode(S),T):n(S)}function T(S){if(S===null||S===47||S===62||ve(S)){const te=S===47,se=a.toLowerCase();return!te&&!s&&Su.includes(se)?(i=1,r.interrupt?e(S):F(S)):UT.includes(a.toLowerCase())?(i=6,te?(t.consume(S),x):r.interrupt?e(S):F(S)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):s?_(S):b(S))}return S===45||We(S)?(t.consume(S),a+=String.fromCharCode(S),T):n(S)}function x(S){return S===62?(t.consume(S),r.interrupt?e:F):n(S)}function _(S){return Ee(S)?(t.consume(S),_):v(S)}function b(S){return S===47?(t.consume(S),v):S===58||S===95||Je(S)?(t.consume(S),C):Ee(S)?(t.consume(S),b):v(S)}function C(S){return S===45||S===46||S===58||S===95||We(S)?(t.consume(S),C):w(S)}function w(S){return S===61?(t.consume(S),y):Ee(S)?(t.consume(S),w):b(S)}function y(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(t.consume(S),u=S,R):Ee(S)?(t.consume(S),y):D(S)}function R(S){return S===u?(t.consume(S),u=null,P):S===null||ae(S)?n(S):(t.consume(S),R)}function D(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||ve(S)?w(S):(t.consume(S),D)}function P(S){return S===47||S===62||Ee(S)?b(S):n(S)}function v(S){return S===62?(t.consume(S),M):n(S)}function M(S){return S===null||ae(S)?F(S):Ee(S)?(t.consume(S),M):n(S)}function F(S){return S===45&&i===2?(t.consume(S),J):S===60&&i===1?(t.consume(S),de):S===62&&i===4?(t.consume(S),V):S===63&&i===3?(t.consume(S),N):S===93&&i===5?(t.consume(S),me):ae(S)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check($T,ne,K)(S)):S===null||ae(S)?(t.exit("htmlFlowData"),K(S)):(t.consume(S),F)}function K(S){return t.check(ZT,Y,ne)(S)}function Y(S){return t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),H}function H(S){return S===null||ae(S)?K(S):(t.enter("htmlFlowData"),F(S))}function J(S){return S===45?(t.consume(S),N):F(S)}function de(S){return S===47?(t.consume(S),a="",ue):F(S)}function ue(S){if(S===62){const te=a.toLowerCase();return Su.includes(te)?(t.consume(S),V):F(S)}return Je(S)&&a.length<8?(t.consume(S),a+=String.fromCharCode(S),ue):F(S)}function me(S){return S===93?(t.consume(S),N):F(S)}function N(S){return S===62?(t.consume(S),V):S===45&&i===2?(t.consume(S),N):F(S)}function V(S){return S===null||ae(S)?(t.exit("htmlFlowData"),ne(S)):(t.consume(S),V)}function ne(S){return t.exit("htmlFlow"),e(S)}}function VT(t,e,n){const r=this;return i;function i(a){return ae(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):e(a)}}function WT(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Yr,e,n)}}const GT={name:"htmlText",tokenize:KT};function KT(t,e,n){const r=this;let i,s,a;return o;function o(N){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(N),u}function u(N){return N===33?(t.consume(N),l):N===47?(t.consume(N),w):N===63?(t.consume(N),b):Je(N)?(t.consume(N),D):n(N)}function l(N){return N===45?(t.consume(N),d):N===91?(t.consume(N),s=0,g):Je(N)?(t.consume(N),_):n(N)}function d(N){return N===45?(t.consume(N),m):n(N)}function c(N){return N===null?n(N):N===45?(t.consume(N),h):ae(N)?(a=c,de(N)):(t.consume(N),c)}function h(N){return N===45?(t.consume(N),m):c(N)}function m(N){return N===62?J(N):N===45?h(N):c(N)}function g(N){const V="CDATA[";return N===V.charCodeAt(s++)?(t.consume(N),s===V.length?E:g):n(N)}function E(N){return N===null?n(N):N===93?(t.consume(N),T):ae(N)?(a=E,de(N)):(t.consume(N),E)}function T(N){return N===93?(t.consume(N),x):E(N)}function x(N){return N===62?J(N):N===93?(t.consume(N),x):E(N)}function _(N){return N===null||N===62?J(N):ae(N)?(a=_,de(N)):(t.consume(N),_)}function b(N){return N===null?n(N):N===63?(t.consume(N),C):ae(N)?(a=b,de(N)):(t.consume(N),b)}function C(N){return N===62?J(N):b(N)}function w(N){return Je(N)?(t.consume(N),y):n(N)}function y(N){return N===45||We(N)?(t.consume(N),y):R(N)}function R(N){return ae(N)?(a=R,de(N)):Ee(N)?(t.consume(N),R):J(N)}function D(N){return N===45||We(N)?(t.consume(N),D):N===47||N===62||ve(N)?P(N):n(N)}function P(N){return N===47?(t.consume(N),J):N===58||N===95||Je(N)?(t.consume(N),v):ae(N)?(a=P,de(N)):Ee(N)?(t.consume(N),P):J(N)}function v(N){return N===45||N===46||N===58||N===95||We(N)?(t.consume(N),v):M(N)}function M(N){return N===61?(t.consume(N),F):ae(N)?(a=M,de(N)):Ee(N)?(t.consume(N),M):P(N)}function F(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(t.consume(N),i=N,K):ae(N)?(a=F,de(N)):Ee(N)?(t.consume(N),F):(t.consume(N),Y)}function K(N){return N===i?(t.consume(N),i=void 0,H):N===null?n(N):ae(N)?(a=K,de(N)):(t.consume(N),K)}function Y(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||ve(N)?P(N):(t.consume(N),Y)}function H(N){return N===47||N===62||ve(N)?P(N):n(N)}function J(N){return N===62?(t.consume(N),t.exit("htmlTextData"),t.exit("htmlText"),e):n(N)}function de(N){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(N),t.exit("lineEnding"),ue}function ue(N){return Ee(N)?_e(t,me,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):me(N)}function me(N){return t.enter("htmlTextData"),a(N)}}const Za={name:"labelEnd",resolveAll:e3,resolveTo:t3,tokenize:n3},QT={tokenize:r3},XT={tokenize:i3},JT={tokenize:s3};function e3(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 i=r.type==="labelImage"?4:2;r.type="data",e+=i}}return t.length!==n.length&&ft(t,0,t.length,n),t}function t3(t,e){let n=t.length,r=0,i,s,a,o;for(;n--;)if(i=t[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(t[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const u={type:t[s][1].type==="labelLink"?"link":"image",start:{...t[s][1].start},end:{...t[t.length-1][1].end}},l={type:"label",start:{...t[s][1].start},end:{...t[a][1].end}},d={type:"labelText",start:{...t[s+r+2][1].end},end:{...t[a-2][1].start}};return o=[["enter",u,e],["enter",l,e]],o=mt(o,t.slice(s+1,s+r+3)),o=mt(o,[["enter",d,e]]),o=mt(o,Zi(e.parser.constructs.insideSpan.null,t.slice(s+r+4,a-3),e)),o=mt(o,[["exit",d,e],t[a-2],t[a-1],["exit",l,e]]),o=mt(o,t.slice(a+1)),o=mt(o,[["exit",u,e]]),ft(t,s,t.length,o),t}function n3(t,e,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(h){return s?s._inactive?c(h):(a=r.parser.defined.includes(Tt(r.sliceSerialize({start:s.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(h),t.exit("labelMarker"),t.exit("labelEnd"),u):n(h)}function u(h){return h===40?t.attempt(QT,d,a?d:c)(h):h===91?t.attempt(XT,d,a?l:c)(h):a?d(h):c(h)}function l(h){return t.attempt(JT,d,c)(h)}function d(h){return e(h)}function c(h){return s._balanced=!0,n(h)}}function r3(t,e,n){return r;function r(c){return t.enter("resource"),t.enter("resourceMarker"),t.consume(c),t.exit("resourceMarker"),i}function i(c){return ve(c)?br(t,s)(c):s(c)}function s(c){return c===41?d(c):ef(t,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function a(c){return ve(c)?br(t,u)(c):d(c)}function o(c){return n(c)}function u(c){return c===34||c===39||c===40?nf(t,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):d(c)}function l(c){return ve(c)?br(t,d)(c):d(c)}function d(c){return c===41?(t.enter("resourceMarker"),t.consume(c),t.exit("resourceMarker"),t.exit("resource"),e):n(c)}}function i3(t,e,n){const r=this;return i;function i(o){return tf.call(r,t,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(Tt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(o):n(o)}function a(o){return n(o)}}function s3(t,e,n){return r;function r(s){return t.enter("reference"),t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),i}function i(s){return s===93?(t.enter("referenceMarker"),t.consume(s),t.exit("referenceMarker"),t.exit("reference"),e):n(s)}}const a3={name:"labelStartImage",resolveAll:Za.resolveAll,tokenize:o3};function o3(t,e,n){const r=this;return i;function i(o){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(o),t.exit("labelImageMarker"),s}function s(o){return o===91?(t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):e(o)}}const u3={name:"labelStartLink",resolveAll:Za.resolveAll,tokenize:l3};function l3(t,e,n){const r=this;return i;function i(a){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):e(a)}}const ms={name:"lineEnding",tokenize:c3};function c3(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),_e(t,e,"linePrefix")}}const hi={name:"thematicBreak",tokenize:d3};function d3(t,e,n){let r=0,i;return s;function s(l){return t.enter("thematicBreak"),a(l)}function a(l){return i=l,o(l)}function o(l){return l===i?(t.enter("thematicBreakSequence"),u(l)):r>=3&&(l===null||ae(l))?(t.exit("thematicBreak"),e(l)):n(l)}function u(l){return l===i?(t.consume(l),r++,u):(t.exit("thematicBreakSequence"),Ee(l)?_e(t,o,"whitespace")(l):o(l))}}const rt={continuation:{tokenize:m3},exit:b3,name:"list",tokenize:p3},f3={partial:!0,tokenize:E3},h3={partial:!0,tokenize:g3};function p3(t,e,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(m){const g=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:ea(m)){if(r.containerState.type||(r.containerState.type=g,t.enter(g,{_container:!0})),g==="listUnordered")return t.enter("listItemPrefix"),m===42||m===45?t.check(hi,n,l)(m):l(m);if(!r.interrupt||m===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(m)}return n(m)}function u(m){return ea(m)&&++a<10?(t.consume(m),u):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(t.exit("listItemValue"),l(m)):n(m)}function l(m){return t.enter("listItemMarker"),t.consume(m),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,t.check(Yr,r.interrupt?n:d,t.attempt(f3,h,c))}function d(m){return r.containerState.initialBlankLine=!0,s++,h(m)}function c(m){return Ee(m)?(t.enter("listItemPrefixWhitespace"),t.consume(m),t.exit("listItemPrefixWhitespace"),h):n(m)}function h(m){return r.containerState.size=s+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(m)}}function m3(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Yr,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,_e(t,e,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!Ee(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(h3,e,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,_e(t,t.attempt(rt,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function g3(t,e,n){const r=this;return _e(t,i,"listItemIndent",r.containerState.size+1);function i(s){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(s):n(s)}}function b3(t){t.exit(this.containerState.type)}function E3(t,e,n){const r=this;return _e(t,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!Ee(s)&&a&&a[1].type==="listItemPrefixWhitespace"?e(s):n(s)}}const Au={name:"setextUnderline",resolveTo:x3,tokenize:T3};function x3(t,e){let n=t.length,r,i,s;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(i=n)}else t[n][1].type==="content"&&t.splice(n,1),!s&&t[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",s?(t.splice(i,0,["enter",a,e]),t.splice(s+1,0,["exit",t[r][1],e]),t[r][1].end={...t[s][1].end}):t[r][1]=a,t.push(["exit",a,e]),t}function T3(t,e,n){const r=this;let i;return s;function s(l){let d=r.events.length,c;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){c=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(t.enter("setextHeadingLine"),i=l,a(l)):n(l)}function a(l){return t.enter("setextHeadingLineSequence"),o(l)}function o(l){return l===i?(t.consume(l),o):(t.exit("setextHeadingLineSequence"),Ee(l)?_e(t,u,"lineSuffix")(l):u(l))}function u(l){return l===null||ae(l)?(t.exit("setextHeadingLine"),e(l)):n(l)}}const _3={tokenize:y3};function y3(t){const e=this,n=t.attempt(Yr,r,t.attempt(this.parser.constructs.flowInitial,i,_e(t,t.attempt(this.parser.constructs.flow,i,t.attempt(IT,i)),"linePrefix")));return n;function r(s){if(s===null){t.consume(s);return}return t.enter("lineEndingBlank"),t.consume(s),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function i(s){if(s===null){t.consume(s);return}return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const k3={resolveAll:sf()},S3=rf("string"),A3=rf("text");function rf(t){return{resolveAll:sf(t==="text"?C3:void 0),tokenize:e};function e(n){const r=this,i=this.parser.constructs[t],s=n.attempt(i,a,o);return a;function a(d){return l(d)?s(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return l(d)?(n.exit("data"),s(d)):(n.consume(d),u)}function l(d){if(d===null)return!0;const c=i[d];let h=-1;if(c)for(;++h<c.length;){const m=c[h];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function sf(t){return e;function e(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return t?t(n,r):n}}function C3(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],i=e.sliceStream(r);let s=i.length,a=-1,o=0,u;for(;s--;){const l=i[s];if(typeof l=="string"){for(a=l.length;l.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(l===-2)u=!0,o++;else if(l!==-1){s++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(o=0),o){const l={type:n===t.length||u||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...l.start},r.start.offset===r.end.offset?Object.assign(r,l):(t.splice(n,0,["enter",l,e],["exit",l,e]),n+=2)}n++}return t}const I3={42:rt,43:rt,45:rt,48:rt,49:rt,50:rt,51:rt,52:rt,53:rt,54:rt,55:rt,56:rt,57:rt,62:Kd},N3={91:OT},v3={[-2]:ps,[-1]:ps,32:ps},w3={35:FT,42:hi,45:[Au,hi],60:HT,61:Au,95:hi,96:ku,126:ku},R3={38:Xd,92:Qd},O3={[-5]:ms,[-4]:ms,[-3]:ms,33:a3,38:Xd,42:ta,60:[uT,GT],91:u3,92:[MT,Qd],93:Za,95:ta,96:_T},L3={null:[ta,k3]},D3={null:[42,95]},P3={null:[]},M3=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:D3,contentInitial:N3,disable:P3,document:I3,flow:w3,flowInitial:v3,insideSpan:L3,string:R3,text:O3},Symbol.toStringTag,{value:"Module"}));function B3(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 i={},s=[];let a=[],o=[];const u={attempt:R(w),check:R(y),consume:_,enter:b,exit:C,interrupt:R(y,{interrupt:!0})},l={code:null,containerState:{},defineSkip:E,events:[],now:g,parser:t,previous:null,sliceSerialize:h,sliceStream:m,write:c};let d=e.tokenize.call(l,u);return e.resolveAll&&s.push(e),l;function c(M){return a=mt(a,M),T(),a[a.length-1]!==null?[]:(D(e,0),l.events=Zi(s,l.events,l),l.events)}function h(M,F){return z3(m(M),F)}function m(M){return F3(a,M)}function g(){const{_bufferIndex:M,_index:F,line:K,column:Y,offset:H}=r;return{_bufferIndex:M,_index:F,line:K,column:Y,offset:H}}function E(M){i[M.line]=M.column,v()}function T(){let M;for(;r._index<a.length;){const F=a[r._index];if(typeof F=="string")for(M=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===M&&r._bufferIndex<F.length;)x(F.charCodeAt(r._bufferIndex));else x(F)}}function x(M){d=d(M)}function _(M){ae(M)?(r.line++,r.column=1,r.offset+=M===-3?2:1,v()):M!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=M}function b(M,F){const K=F||{};return K.type=M,K.start=g(),l.events.push(["enter",K,l]),o.push(K),K}function C(M){const F=o.pop();return F.end=g(),l.events.push(["exit",F,l]),F}function w(M,F){D(M,F.from)}function y(M,F){F.restore()}function R(M,F){return K;function K(Y,H,J){let de,ue,me,N;return Array.isArray(Y)?ne(Y):"tokenize"in Y?ne([Y]):V(Y);function V(Q){return ee;function ee(ie){const le=ie!==null&&Q[ie],ge=ie!==null&&Q.null,De=[...Array.isArray(le)?le:le?[le]:[],...Array.isArray(ge)?ge:ge?[ge]:[]];return ne(De)(ie)}}function ne(Q){return de=Q,ue=0,Q.length===0?J:S(Q[ue])}function S(Q){return ee;function ee(ie){return N=P(),me=Q,Q.partial||(l.currentConstruct=Q),Q.name&&l.parser.constructs.disable.null.includes(Q.name)?se():Q.tokenize.call(F?Object.assign(Object.create(l),F):l,u,te,se)(ie)}}function te(Q){return M(me,N),H}function se(Q){return N.restore(),++ue<de.length?S(de[ue]):J}}}function D(M,F){M.resolveAll&&!s.includes(M)&&s.push(M),M.resolve&&ft(l.events,F,l.events.length-F,M.resolve(l.events.slice(F),l)),M.resolveTo&&(l.events=M.resolveTo(l.events,l))}function P(){const M=g(),F=l.previous,K=l.currentConstruct,Y=l.events.length,H=Array.from(o);return{from:Y,restore:J};function J(){r=M,l.previous=F,l.currentConstruct=K,l.events.length=Y,o=H,v()}}function v(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function F3(t,e){const n=e.start._index,r=e.start._bufferIndex,i=e.end._index,s=e.end._bufferIndex;let a;if(n===i)a=[t[n].slice(r,s)];else{if(a=t.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(t[i].slice(0,s))}return a}function z3(t,e){let n=-1;const r=[];let i;for(;++n<t.length;){const s=t[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
|
|
96
|
-
`;break}case-3:{a=`\r
|
|
97
|
-
`;break}case-2:{a=e?" ":" ";break}case-1:{if(!e&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function j3(t){const r={constructs:Wd([M3,...(t||{}).extensions||[]]),content:i(tT),defined:[],document:i(rT),flow:i(_3),lazy:{},string:i(S3),text:i(A3)};return r;function i(s){return a;function a(o){return B3(r,s,o)}}}function U3(t){for(;!Jd(t););return t}const Cu=/[\0\t\n\r]/g;function H3(){let t=1,e="",n=!0,r;return i;function i(s,a,o){const u=[];let l,d,c,h,m;for(s=e+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),c=0,e="",n&&(s.charCodeAt(0)===65279&&c++,n=void 0);c<s.length;){if(Cu.lastIndex=c,l=Cu.exec(s),h=l&&l.index!==void 0?l.index:s.length,m=s.charCodeAt(h),!l){e=s.slice(c);break}if(m===10&&c===h&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<h&&(u.push(s.slice(c,h)),t+=h-c),m){case 0:{u.push(65533),t++;break}case 9:{for(d=Math.ceil(t/4)*4,u.push(-2);t++<d;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:r=!0,t=1}c=h+1}return o&&(r&&u.push(-5),e&&u.push(e),u.push(null)),u}}const $3=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Z3(t){return t.replace($3,Y3)}function Y3(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Gd(n.slice(s?2:1),s?16:10)}return $a(n)||t}const af={}.hasOwnProperty;function q3(t,e,n){return typeof e!="string"&&(n=e,e=void 0),V3(n)(U3(j3(n).document().write(H3()(t,e,!0))))}function V3(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Wn),autolinkProtocol:P,autolinkEmail:P,atxHeading:s(Ft),blockQuote:s(ge),characterEscape:P,characterReference:P,codeFenced:s(De),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(De,a),codeText:s($e,a),codeTextData:P,data:P,codeFlowValue:P,definition:s(Se),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(Pe),hardBreakEscape:s(Xt),hardBreakTrailing:s(Xt),htmlFlow:s(Tn,a),htmlFlowData:P,htmlText:s(Tn,a),htmlTextData:P,image:s(Ve),label:a,link:s(Wn),listItem:s(Jt),listItemValue:h,listOrdered:s(Gr,c),listUnordered:s(Gr),paragraph:s(Kr),reference:S,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(Ft),strong:s(is),thematicBreak:s(a0)},exit:{atxHeading:u(),atxHeadingSequence:w,autolink:u(),autolinkEmail:le,autolinkProtocol:ie,blockQuote:u(),characterEscapeValue:v,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:Q,characterReference:ee,codeFenced:u(T),codeFencedFence:E,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:v,codeIndented:u(x),codeText:u(H),codeTextData:v,data:v,definition:u(),definitionDestinationString:C,definitionLabelString:_,definitionTitleString:b,emphasis:u(),hardBreakEscape:u(F),hardBreakTrailing:u(F),htmlFlow:u(K),htmlFlowData:v,htmlText:u(Y),htmlTextData:v,image:u(de),label:me,labelText:ue,lineEnding:M,link:u(J),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:te,resourceDestinationString:N,resourceTitleString:V,resource:ne,setextHeading:u(D),setextHeadingLineSequence:R,setextHeadingText:y,strong:u(),thematicBreak:u()}};of(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(U){let W={type:"root",children:[]};const ce={stack:[W],tokenStack:[],config:e,enter:o,exit:l,buffer:a,resume:d,data:n},xe=[];let Ie=-1;for(;++Ie<U.length;)if(U[Ie][1].type==="listOrdered"||U[Ie][1].type==="listUnordered")if(U[Ie][0]==="enter")xe.push(Ie);else{const bt=xe.pop();Ie=i(U,bt,Ie)}for(Ie=-1;++Ie<U.length;){const bt=e[U[Ie][0]];af.call(bt,U[Ie][1].type)&&bt[U[Ie][1].type].call(Object.assign({sliceSerialize:U[Ie][2].sliceSerialize},ce),U[Ie][1])}if(ce.tokenStack.length>0){const bt=ce.tokenStack[ce.tokenStack.length-1];(bt[1]||Iu).call(ce,void 0,bt[0])}for(W.position={start:zt(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:zt(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},Ie=-1;++Ie<e.transforms.length;)W=e.transforms[Ie](W)||W;return W}function i(U,W,ce){let xe=W-1,Ie=-1,bt=!1,en,Rt,Gn,Kn;for(;++xe<=ce;){const lt=U[xe];switch(lt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{lt[0]==="enter"?Ie++:Ie--,Kn=void 0;break}case"lineEndingBlank":{lt[0]==="enter"&&(en&&!Kn&&!Ie&&!Gn&&(Gn=xe),Kn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Kn=void 0}if(!Ie&<[0]==="enter"&<[1].type==="listItemPrefix"||Ie===-1&<[0]==="exit"&&(lt[1].type==="listUnordered"||lt[1].type==="listOrdered")){if(en){let _n=xe;for(Rt=void 0;_n--;){const Ot=U[_n];if(Ot[1].type==="lineEnding"||Ot[1].type==="lineEndingBlank"){if(Ot[0]==="exit")continue;Rt&&(U[Rt][1].type="lineEndingBlank",bt=!0),Ot[1].type="lineEnding",Rt=_n}else if(!(Ot[1].type==="linePrefix"||Ot[1].type==="blockQuotePrefix"||Ot[1].type==="blockQuotePrefixWhitespace"||Ot[1].type==="blockQuoteMarker"||Ot[1].type==="listItemIndent"))break}Gn&&(!Rt||Gn<Rt)&&(en._spread=!0),en.end=Object.assign({},Rt?U[Rt][1].start:lt[1].end),U.splice(Rt||xe,0,["exit",en,lt[2]]),xe++,ce++}if(lt[1].type==="listItemPrefix"){const _n={type:"listItem",_spread:!1,start:Object.assign({},lt[1].start),end:void 0};en=_n,U.splice(xe,0,["enter",_n,lt[2]]),xe++,ce++,Gn=void 0,Kn=!0}}}return U[W][1]._spread=bt,ce}function s(U,W){return ce;function ce(xe){o.call(this,U(xe),xe),W&&W.call(this,xe)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(U,W,ce){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([W,ce||void 0]),U.position={start:zt(W.start),end:void 0}}function u(U){return W;function W(ce){U&&U.call(this,ce),l.call(this,ce)}}function l(U,W){const ce=this.stack.pop(),xe=this.tokenStack.pop();if(xe)xe[0].type!==U.type&&(W?W.call(this,U,xe[0]):(xe[1]||Iu).call(this,U,xe[0]));else throw new Error("Cannot close `"+U.type+"` ("+gr({start:U.start,end:U.end})+"): it’s not open");ce.position.end=zt(U.end)}function d(){return Ha(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(U){if(this.data.expectingFirstListItemValue){const W=this.stack[this.stack.length-2];W.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function m(){const U=this.resume(),W=this.stack[this.stack.length-1];W.lang=U}function g(){const U=this.resume(),W=this.stack[this.stack.length-1];W.meta=U}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function T(){const U=this.resume(),W=this.stack[this.stack.length-1];W.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const U=this.resume(),W=this.stack[this.stack.length-1];W.value=U.replace(/(\r?\n|\r)$/g,"")}function _(U){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.label=W,ce.identifier=Tt(this.sliceSerialize(U)).toLowerCase()}function b(){const U=this.resume(),W=this.stack[this.stack.length-1];W.title=U}function C(){const U=this.resume(),W=this.stack[this.stack.length-1];W.url=U}function w(U){const W=this.stack[this.stack.length-1];if(!W.depth){const ce=this.sliceSerialize(U).length;W.depth=ce}}function y(){this.data.setextHeadingSlurpLineEnding=!0}function R(U){const W=this.stack[this.stack.length-1];W.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function P(U){const ce=this.stack[this.stack.length-1].children;let xe=ce[ce.length-1];(!xe||xe.type!=="text")&&(xe=s0(),xe.position={start:zt(U.start),end:void 0},ce.push(xe)),this.stack.push(xe)}function v(U){const W=this.stack.pop();W.value+=this.sliceSerialize(U),W.position.end=zt(U.end)}function M(U){const W=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ce=W.children[W.children.length-1];ce.position.end=zt(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(W.type)&&(P.call(this,U),v.call(this,U))}function F(){this.data.atHardBreak=!0}function K(){const U=this.resume(),W=this.stack[this.stack.length-1];W.value=U}function Y(){const U=this.resume(),W=this.stack[this.stack.length-1];W.value=U}function H(){const U=this.resume(),W=this.stack[this.stack.length-1];W.value=U}function J(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const W=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=W,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function de(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const W=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=W,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function ue(U){const W=this.sliceSerialize(U),ce=this.stack[this.stack.length-2];ce.label=Z3(W),ce.identifier=Tt(W).toLowerCase()}function me(){const U=this.stack[this.stack.length-1],W=this.resume(),ce=this.stack[this.stack.length-1];if(this.data.inReference=!0,ce.type==="link"){const xe=U.children;ce.children=xe}else ce.alt=W}function N(){const U=this.resume(),W=this.stack[this.stack.length-1];W.url=U}function V(){const U=this.resume(),W=this.stack[this.stack.length-1];W.title=U}function ne(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function te(U){const W=this.resume(),ce=this.stack[this.stack.length-1];ce.label=W,ce.identifier=Tt(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function se(U){this.data.characterReferenceType=U.type}function Q(U){const W=this.sliceSerialize(U),ce=this.data.characterReferenceType;let xe;ce?(xe=Gd(W,ce==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):xe=$a(W);const Ie=this.stack[this.stack.length-1];Ie.value+=xe}function ee(U){const W=this.stack.pop();W.position.end=zt(U.end)}function ie(U){v.call(this,U);const W=this.stack[this.stack.length-1];W.url=this.sliceSerialize(U)}function le(U){v.call(this,U);const W=this.stack[this.stack.length-1];W.url="mailto:"+this.sliceSerialize(U)}function ge(){return{type:"blockquote",children:[]}}function De(){return{type:"code",lang:null,meta:null,value:""}}function $e(){return{type:"inlineCode",value:""}}function Se(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Pe(){return{type:"emphasis",children:[]}}function Ft(){return{type:"heading",depth:0,children:[]}}function Xt(){return{type:"break"}}function Tn(){return{type:"html",value:""}}function Ve(){return{type:"image",title:null,url:"",alt:null}}function Wn(){return{type:"link",title:null,url:"",children:[]}}function Gr(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function Jt(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function Kr(){return{type:"paragraph",children:[]}}function is(){return{type:"strong",children:[]}}function s0(){return{type:"text",value:""}}function a0(){return{type:"thematicBreak"}}}function zt(t){return{line:t.line,column:t.column,offset:t.offset}}function of(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?of(t,r):W3(t,r)}}function W3(t,e){let n;for(n in e)if(af.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 Iu(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+gr({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+gr({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+gr({start:e.start,end:e.end})+") is still open")}function G3(t){const e=this;e.parser=n;function n(r){return q3(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function K3(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 Q3(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
|
|
98
|
-
`}]}function X3(t,e){const n=e.value?e.value+`
|
|
99
|
-
`:"",r={},i=e.lang?e.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(s.data={meta:e.meta}),t.patch(e,s),s=t.applyData(e,s),s={type:"element",tagName:"pre",properties:{},children:[s]},t.patch(e,s),s}function J3(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function e_(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function t_(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),i=Zn(r.toLowerCase()),s=t.footnoteOrder.indexOf(r);let a,o=t.footnoteCounts.get(r);o===void 0?(o=0,t.footnoteOrder.push(r),a=t.footnoteOrder.length):a=s+1,o+=1,t.footnoteCounts.set(r,o);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};t.patch(e,u);const l={type:"element",tagName:"sup",properties:{},children:[u]};return t.patch(e,l),t.applyData(e,l)}function n_(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 r_(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function uf(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 i=t.all(e),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function i_(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return uf(t,e);const i={src:Zn(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,s),t.applyData(e,s)}function s_(t,e){const n={src:Zn(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 a_(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 o_(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return uf(t,e);const i={href:Zn(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,s),t.applyData(e,s)}function u_(t,e){const n={href:Zn(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 l_(t,e,n){const r=t.all(e),i=n?c_(n):lf(e),s={},a=[];if(typeof e.checked=="boolean"){const d=r[0];let c;d&&d.type==="element"&&d.tagName==="p"?c=d:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(i||o!==0||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
|
|
100
|
-
`}),d.type==="element"&&d.tagName==="p"&&!i?a.push(...d.children):a.push(d)}const u=r[r.length-1];u&&(i||u.type!=="element"||u.tagName!=="p")&&a.push({type:"text",value:`
|
|
101
|
-
`});const l={type:"element",tagName:"li",properties:s,children:a};return t.patch(e,l),t.applyData(e,l)}function c_(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=lf(n[r])}return e}function lf(t){const e=t.spread;return e??t.children.length>1}function d_(t,e){const n={},r=t.all(e);let i=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++i<r.length;){const a=r[i];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 s={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,s),t.applyData(e,s)}function f_(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function h_(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function p_(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function m_(t,e){const n=t.all(e),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},o=vt(e.children[1]),u=Hi(e.children[e.children.length-1]);o&&u&&(a.position={start:o,end:u}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:t.wrap(i,!0)};return t.patch(e,s),t.applyData(e,s)}function g_(t,e,n){const r=n?n.children:void 0,s=(r?r.indexOf(e):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:e.children.length;let u=-1;const l=[];for(;++u<o;){const c=e.children[u],h={},m=a?a[u]:void 0;m&&(h.align=m);let g={type:"element",tagName:s,properties:h,children:[]};c&&(g.children=t.all(c),t.patch(c,g),g=t.applyData(c,g)),l.push(g)}const d={type:"element",tagName:"tr",properties:{},children:t.wrap(l,!0)};return t.patch(e,d),t.applyData(e,d)}function b_(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const Nu=9,vu=32;function E_(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),i=0;const s=[];for(;r;)s.push(wu(e.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(e);return s.push(wu(e.slice(i),i>0,!1)),s.join("")}function wu(t,e,n){let r=0,i=t.length;if(e){let s=t.codePointAt(r);for(;s===Nu||s===vu;)r++,s=t.codePointAt(r)}if(n){let s=t.codePointAt(i-1);for(;s===Nu||s===vu;)i--,s=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function x_(t,e){const n={type:"text",value:E_(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function T_(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const __={blockquote:K3,break:Q3,code:X3,delete:J3,emphasis:e_,footnoteReference:t_,heading:n_,html:r_,imageReference:i_,image:s_,inlineCode:a_,linkReference:o_,link:u_,listItem:l_,list:d_,paragraph:f_,root:h_,strong:p_,table:m_,tableCell:b_,tableRow:g_,text:x_,thematicBreak:T_,toml:ei,yaml:ei,definition:ei,footnoteDefinition:ei};function ei(){}const cf=-1,Yi=0,Er=1,Ii=2,Ya=3,qa=4,Va=5,Wa=6,df=7,ff=8,Ru=typeof self=="object"?self:globalThis,y_=(t,e)=>{const n=(i,s)=>(t.set(s,i),i),r=i=>{if(t.has(i))return t.get(i);const[s,a]=e[i];switch(s){case Yi:case cf:return n(a,i);case Er:{const o=n([],i);for(const u of a)o.push(r(u));return o}case Ii:{const o=n({},i);for(const[u,l]of a)o[r(u)]=r(l);return o}case Ya:return n(new Date(a),i);case qa:{const{source:o,flags:u}=a;return n(new RegExp(o,u),i)}case Va:{const o=n(new Map,i);for(const[u,l]of a)o.set(r(u),r(l));return o}case Wa:{const o=n(new Set,i);for(const u of a)o.add(r(u));return o}case df:{const{name:o,message:u}=a;return n(new Ru[o](u),i)}case ff:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(new Ru[s](a),i)};return r},Ou=t=>y_(new Map,t)(0),kn="",{toString:k_}={},{keys:S_}=Object,rr=t=>{const e=typeof t;if(e!=="object"||!t)return[Yi,e];const n=k_.call(t).slice(8,-1);switch(n){case"Array":return[Er,kn];case"Object":return[Ii,kn];case"Date":return[Ya,kn];case"RegExp":return[qa,kn];case"Map":return[Va,kn];case"Set":return[Wa,kn];case"DataView":return[Er,n]}return n.includes("Array")?[Er,n]:n.includes("Error")?[df,n]:[Ii,n]},ti=([t,e])=>t===Yi&&(e==="function"||e==="symbol"),A_=(t,e,n,r)=>{const i=(a,o)=>{const u=r.push(a)-1;return n.set(o,u),u},s=a=>{if(n.has(a))return n.get(a);let[o,u]=rr(a);switch(o){case Yi:{let d=a;switch(u){case"bigint":o=ff,d=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return i([cf],a)}return i([o,d],a)}case Er:{if(u){let h=a;return u==="DataView"?h=new Uint8Array(a.buffer):u==="ArrayBuffer"&&(h=new Uint8Array(a)),i([u,[...h]],a)}const d=[],c=i([o,d],a);for(const h of a)d.push(s(h));return c}case Ii:{if(u)switch(u){case"BigInt":return i([u,a.toString()],a);case"Boolean":case"Number":case"String":return i([u,a.valueOf()],a)}if(e&&"toJSON"in a)return s(a.toJSON());const d=[],c=i([o,d],a);for(const h of S_(a))(t||!ti(rr(a[h])))&&d.push([s(h),s(a[h])]);return c}case Ya:return i([o,a.toISOString()],a);case qa:{const{source:d,flags:c}=a;return i([o,{source:d,flags:c}],a)}case Va:{const d=[],c=i([o,d],a);for(const[h,m]of a)(t||!(ti(rr(h))||ti(rr(m))))&&d.push([s(h),s(m)]);return c}case Wa:{const d=[],c=i([o,d],a);for(const h of a)(t||!ti(rr(h)))&&d.push(s(h));return c}}const{message:l}=a;return i([o,{name:u,message:l}],a)};return s},Lu=(t,{json:e,lossy:n}={})=>{const r=[];return A_(!(e||n),!!e,new Map,r)(t),r},Bn=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Ou(Lu(t,e)):structuredClone(t):(t,e)=>Ou(Lu(t,e));function C_(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 I_(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function N_(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||C_,r=t.options.footnoteBackLabel||I_,i=t.options.footnoteLabel||"Footnotes",s=t.options.footnoteLabelTagName||"h2",a=t.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let u=-1;for(;++u<t.footnoteOrder.length;){const l=t.footnoteById.get(t.footnoteOrder[u]);if(!l)continue;const d=t.all(l),c=String(l.identifier).toUpperCase(),h=Zn(c.toLowerCase());let m=0;const g=[],E=t.footnoteCounts.get(c);for(;E!==void 0&&++m<=E;){g.length>0&&g.push({type:"text",value:" "});let _=typeof n=="string"?n:n(u,m);typeof _=="string"&&(_={type:"text",value:_}),g.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+h+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,m),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const T=d[d.length-1];if(T&&T.type==="element"&&T.tagName==="p"){const _=T.children[T.children.length-1];_&&_.type==="text"?_.value+=" ":T.children.push({type:"text",value:" "}),T.children.push(...g)}else d.push(...g);const x={type:"element",tagName:"li",properties:{id:e+"fn-"+h},children:t.wrap(d,!0)};t.patch(l,x),o.push(x)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Bn(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
102
|
-
`},{type:"element",tagName:"ol",properties:{},children:t.wrap(o,!0)},{type:"text",value:`
|
|
103
|
-
`}]}}const qi=(function(t){if(t==null)return O_;if(typeof t=="function")return Vi(t);if(typeof t=="object")return Array.isArray(t)?v_(t):w_(t);if(typeof t=="string")return R_(t);throw new Error("Expected function, string, or object as test")});function v_(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=qi(t[n]);return Vi(r);function r(...i){let s=-1;for(;++s<e.length;)if(e[s].apply(this,i))return!0;return!1}}function w_(t){const e=t;return Vi(n);function n(r){const i=r;let s;for(s in t)if(i[s]!==e[s])return!1;return!0}}function R_(t){return Vi(e);function e(n){return n&&n.type===t}}function Vi(t){return e;function e(n,r,i){return!!(L_(n)&&t.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function O_(){return!0}function L_(t){return t!==null&&typeof t=="object"&&"type"in t}const hf=[],D_=!0,na=!1,P_="skip";function pf(t,e,n,r){let i;typeof e=="function"&&typeof n!="function"?(r=n,n=e):i=e;const s=qi(i),a=r?-1:1;o(t,void 0,[])();function o(u,l,d){const c=u&&typeof u=="object"?u:{};if(typeof c.type=="string"){const m=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(u.type+(m?"<"+m+">":""))+")"})}return h;function h(){let m=hf,g,E,T;if((!e||s(u,l,d[d.length-1]||void 0))&&(m=M_(n(u,d)),m[0]===na))return m;if("children"in u&&u.children){const x=u;if(x.children&&m[0]!==P_)for(E=(r?x.children.length:-1)+a,T=d.concat(x);E>-1&&E<x.children.length;){const _=x.children[E];if(g=o(_,E,T)(),g[0]===na)return g;E=typeof g[1]=="number"?g[1]:E+a}}return m}}}function M_(t){return Array.isArray(t)?t:typeof t=="number"?[D_,t]:t==null?hf:[t]}function Wi(t,e,n,r){let i,s,a;typeof e=="function"&&typeof n!="function"?(s=void 0,a=e,i=n):(s=e,a=n,i=r),pf(t,s,o,i);function o(u,l){const d=l[l.length-1],c=d?d.children.indexOf(u):void 0;return a(u,c,d)}}const ra={}.hasOwnProperty,B_={};function F_(t,e){const n=e||B_,r=new Map,i=new Map,s=new Map,a={...__,...n.handlers},o={all:l,applyData:j_,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:u,options:n,patch:z_,wrap:H_};return Wi(t,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const c=d.type==="definition"?r:i,h=String(d.identifier).toUpperCase();c.has(h)||c.set(h,d)}}),o;function u(d,c){const h=d.type,m=o.handlers[h];if(ra.call(o.handlers,h)&&m)return m(o,d,c);if(o.options.passThrough&&o.options.passThrough.includes(h)){if("children"in d){const{children:E,...T}=d,x=Bn(T);return x.children=o.all(d),x}return Bn(d)}return(o.options.unknownHandler||U_)(o,d,c)}function l(d){const c=[];if("children"in d){const h=d.children;let m=-1;for(;++m<h.length;){const g=o.one(h[m],d);if(g){if(m&&h[m-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=Du(g.value)),!Array.isArray(g)&&g.type==="element")){const E=g.children[0];E&&E.type==="text"&&(E.value=Du(E.value))}Array.isArray(g)?c.push(...g):c.push(g)}}}return c}}function z_(t,e){t.position&&(e.position=Ix(t))}function j_(t,e){let n=e;if(t&&t.data){const r=t.data.hName,i=t.data.hChildren,s=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"&&s&&Object.assign(n.properties,Bn(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function U_(t,e){const n=e.data||{},r="value"in e&&!(ra.call(n,"hProperties")||ra.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 H_(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
|
|
104
|
-
`});++r<t.length;)r&&n.push({type:"text",value:`
|
|
105
|
-
`}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
|
|
106
|
-
`}),n}function Du(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function Pu(t,e){const n=F_(t,e),r=n.one(t,void 0),i=N_(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
107
|
-
`},i),s}function $_(t,e){return t&&"run"in t?async function(n,r){const i=Pu(n,{file:r,...e});await t.run(i,r)}:function(n,r){return Pu(n,{file:r,...t||e})}}function Mu(t){if(t)throw t}var gs,Bu;function Z_(){if(Bu)return gs;Bu=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(l){return typeof Array.isArray=="function"?Array.isArray(l):e.call(l)==="[object Array]"},s=function(l){if(!l||e.call(l)!=="[object Object]")return!1;var d=t.call(l,"constructor"),c=l.constructor&&l.constructor.prototype&&t.call(l.constructor.prototype,"isPrototypeOf");if(l.constructor&&!d&&!c)return!1;var h;for(h in l);return typeof h>"u"||t.call(l,h)},a=function(l,d){n&&d.name==="__proto__"?n(l,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):l[d.name]=d.newValue},o=function(l,d){if(d==="__proto__")if(t.call(l,d)){if(r)return r(l,d).value}else return;return l[d]};return gs=function u(){var l,d,c,h,m,g,E=arguments[0],T=1,x=arguments.length,_=!1;for(typeof E=="boolean"&&(_=E,E=arguments[1]||{},T=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});T<x;++T)if(l=arguments[T],l!=null)for(d in l)c=o(E,d),h=o(l,d),E!==h&&(_&&h&&(s(h)||(m=i(h)))?(m?(m=!1,g=c&&i(c)?c:[]):g=c&&s(c)?c:{},a(E,{name:d,newValue:u(_,g,h)})):typeof h<"u"&&a(E,{name:d,newValue:h}));return E},gs}var Y_=Z_();const bs=ba(Y_);function ia(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 q_(){const t=[],e={run:n,use:r};return e;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(u,...l){const d=t[++s];let c=-1;if(u){a(u);return}for(;++c<i.length;)(l[c]===null||l[c]===void 0)&&(l[c]=i[c]);i=l,d?V_(d,o)(...l):a(null,...l)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function V_(t,e){let n;return r;function r(...a){const o=t.length>a.length;let u;o&&a.push(i);try{u=t.apply(this,a)}catch(l){const d=l;if(o&&n)throw d;return i(d)}o||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(a,...o){n||(n=!0,e(a,...o))}function s(a){i(null,a)}}const At={basename:W_,dirname:G_,extname:K_,join:Q_,sep:"/"};function W_(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');qr(t);let n=0,r=-1,i=t.length,s;if(e===void 0||e.length===0||e.length>t.length){for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let a=-1,o=e.length-1;for(;i--;)if(t.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(t.codePointAt(i)===e.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=t.length),t.slice(n,r)}function G_(t){if(qr(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 K_(t){qr(t);let e=t.length,n=-1,r=0,i=-1,s=0,a;for(;e--;){const o=t.codePointAt(e);if(o===47){if(a){r=e+1;break}continue}n<0&&(a=!0,n=e+1),o===46?i<0?i=e:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":t.slice(i,n)}function Q_(...t){let e=-1,n;for(;++e<t.length;)qr(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":X_(n)}function X_(t){qr(t);const e=t.codePointAt(0)===47;let n=J_(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function J_(t,e){let n="",r=0,i=-1,s=0,a=-1,o,u;for(;++a<=t.length;){if(a<t.length)o=t.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(i+1,a):n=t.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function qr(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const ey={cwd:ty};function ty(){return"/"}function sa(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function ny(t){if(typeof t=="string")t=new URL(t);else if(!sa(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 ry(t)}function ry(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 i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(e)}const Es=["history","path","basename","stem","extname","dirname"];class mf{constructor(e){let n;e?sa(e)?n={path:e}:typeof e=="string"||iy(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":ey.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Es.length;){const s=Es[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Es.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?At.basename(this.path):void 0}set basename(e){Ts(e,"basename"),xs(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(xs(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){sa(e)&&(e=ny(e)),Ts(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){Ts(e,"stem"),xs(e,"stem"),this.path=At.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const i=this.message(e,n,r);throw i.fatal=!0,i}info(e,n,r){const i=this.message(e,n,r);return i.fatal=void 0,i}message(e,n,r){const i=new Ge(e,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function xs(t,e){if(t&&t.includes(At.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+At.sep+"`")}function Ts(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 iy(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const sy=(function(t){const r=this.constructor.prototype,i=r[t],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),ay={}.hasOwnProperty;class Ga extends sy{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=q_()}copy(){const e=new Ga;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(bs(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(ks("data",this.frozen),this.namespace[e]=n,this):ay.call(this.namespace,e)&&this.namespace[e]||void 0:e?(ks("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 i=n.call(e,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=ni(e),r=this.parser||this.Parser;return _s("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),_s("process",this.parser||this.Parser),ys("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=ni(e),u=r.parse(o);r.run(u,o,function(d,c,h){if(d||!c||!h)return l(d);const m=c,g=r.stringify(m,h);ly(g)?h.value=g:h.result=g,l(d,h)});function l(d,c){d||!c?a(d):s?s(c):n(void 0,c)}}}processSync(e){let n=!1,r;return this.freeze(),_s("processSync",this.parser||this.Parser),ys("processSync",this.compiler||this.Compiler),this.process(e,i),ju("processSync","process",n),r;function i(s,a){n=!0,Mu(s),r=a}}run(e,n,r){zu(e),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const u=ni(n);i.run(e,u,l);function l(d,c,h){const m=c||e;d?o(d):a?a(m):r(void 0,m,h)}}}runSync(e,n){let r=!1,i;return this.run(e,n,s),ju("runSync","run",r),i;function s(a,o){Mu(a),i=o,r=!0}}stringify(e,n){this.freeze();const r=ni(n),i=this.compiler||this.Compiler;return ys("stringify",i),zu(e),i(e,r)}use(e,...n){const r=this.attachers,i=this.namespace;if(ks("use",this.frozen),e!=null)if(typeof e=="function")u(e,n);else if(typeof e=="object")Array.isArray(e)?o(e):a(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function s(l){if(typeof l=="function")u(l,[]);else if(typeof l=="object")if(Array.isArray(l)){const[d,...c]=l;u(d,c)}else a(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function a(l){if(!("plugins"in l)&&!("settings"in l))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");o(l.plugins),l.settings&&(i.settings=bs(!0,i.settings,l.settings))}function o(l){let d=-1;if(l!=null)if(Array.isArray(l))for(;++d<l.length;){const c=l[d];s(c)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function u(l,d){let c=-1,h=-1;for(;++c<r.length;)if(r[c][0]===l){h=c;break}if(h===-1)r.push([l,...d]);else if(d.length>0){let[m,...g]=d;const E=r[h][1];ia(E)&&ia(m)&&(m=bs(!0,E,m)),r[h]=[l,m,...g]}}}}const oy=new Ga().freeze();function _s(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function ys(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function ks(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 zu(t){if(!ia(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function ju(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function ni(t){return uy(t)?t:new mf(t)}function uy(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function ly(t){return typeof t=="string"||cy(t)}function cy(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const dy="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Uu=[],Hu={allowDangerousHtml:!0},fy=/^(https?|ircs?|mailto|xmpp)$/i,hy=[{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 py(t){const e=my(t),n=gy(t);return by(e.runSync(e.parse(n),n),t)}function my(t){const e=t.rehypePlugins||Uu,n=t.remarkPlugins||Uu,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Hu}:Hu;return oy().use(G3).use(n).use($_,r).use(e)}function gy(t){const e=t.children||"",n=new mf;return typeof e=="string"&&(n.value=e),n}function by(t,e){const n=e.allowedElements,r=e.allowElement,i=e.components,s=e.disallowedElements,a=e.skipHtml,o=e.unwrapDisallowed,u=e.urlTransform||Ey;for(const d of hy)Object.hasOwn(e,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+dy+d.id,void 0);return e.className&&(t={type:"element",tagName:"div",properties:{className:e.className},children:t.type==="root"?t.children:[t]}),Wi(t,l),Ox(t,{Fragment:p.Fragment,components:i,ignoreInvalidStyle:!0,jsx:p.jsx,jsxs:p.jsxs,passKeys:!0,passNode:!0});function l(d,c,h){if(d.type==="raw"&&h&&typeof c=="number")return a?h.children.splice(c,1):h.children[c]={type:"text",value:d.value},c;if(d.type==="element"){let m;for(m in hs)if(Object.hasOwn(hs,m)&&Object.hasOwn(d.properties,m)){const g=d.properties[m],E=hs[m];(E===null||E.includes(d.tagName))&&(d.properties[m]=u(String(g||""),m,d))}}if(d.type==="element"){let m=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!m&&r&&typeof c=="number"&&(m=!r(d,c,h)),m&&h&&typeof c=="number")return o&&d.children?h.children.splice(c,1,...d.children):h.children.splice(c,1),c}}}function Ey(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),i=t.indexOf("/");return e===-1||i!==-1&&e>i||n!==-1&&e>n||r!==-1&&e>r||fy.test(t.slice(0,e))?t:""}const $u=/[#.]/g;function xy(t,e){const n=t||"",r={};let i=0,s,a;for(;i<n.length;){$u.lastIndex=i;const o=$u.exec(n),u=n.slice(i,o?o.index:n.length);u&&(s?s==="#"?r.id=u:Array.isArray(r.className)?r.className.push(u):r.className=[u]:a=u,i+=u.length),o&&(s=o[0],i++)}return{type:"element",tagName:a||e||"div",properties:r,children:[]}}function gf(t,e,n){const r=n?ky(n):void 0;function i(s,a,...o){let u;if(s==null){u={type:"root",children:[]};const l=a;o.unshift(l)}else{u=xy(s,e);const l=u.tagName.toLowerCase(),d=r?r.get(l):void 0;if(u.tagName=d||l,Ty(a))o.unshift(a);else for(const[c,h]of Object.entries(a))_y(t,u.properties,c,h)}for(const l of o)aa(u.children,l);return u.type==="element"&&u.tagName==="template"&&(u.content={type:"root",children:u.children},u.children=[]),u}return i}function Ty(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 i=e[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const s=i;for(const a of s)if(typeof a!="number"&&typeof a!="string")return!0}}return!!("children"in t&&Array.isArray(t.children))}function _y(t,e,n,r){const i=Ui(t,n);let s;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;s=r}else typeof r=="boolean"?s=r:typeof r=="string"?i.spaceSeparated?s=cu(r):i.commaSeparated?s=su(r):i.commaOrSpaceSeparated?s=cu(su(r).join(" ")):s=Zu(i,i.property,r):Array.isArray(r)?s=[...r]:s=i.property==="style"?yy(r):String(r);if(Array.isArray(s)){const a=[];for(const o of s)a.push(Zu(i,i.property,o));s=a}i.property==="className"&&Array.isArray(e.className)&&(s=e.className.concat(s)),e[i.property]=s}}function aa(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)aa(t,n);else if(typeof e=="object"&&"type"in e)e.type==="root"?aa(t,e.children):t.push(e);else throw new Error("Expected node, nodes, or string, got `"+e+"`")}function Zu(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 yy(t){const e=[];for(const[n,r]of Object.entries(t))e.push([n,r].join(": "));return e.join("; ")}function ky(t){const e=new Map;for(const n of t)e.set(n.toLowerCase(),n);return e}const Sy=["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"],Ay=gf(Zr,"div"),Cy=gf(Kt,"g",Sy);function Iy(t){const e=String(t),n=[];return{toOffset:i,toPoint:r};function r(s){if(typeof s=="number"&&s>-1&&s<=e.length){let a=0;for(;;){let o=n[a];if(o===void 0){const u=Yu(e,n[a-1]);o=u===-1?e.length+1:u+1,n[a]=o}if(o>s)return{line:a+1,column:s-(a>0?n[a-1]:0)+1,offset:s};a++}}}function i(s){if(s&&typeof s.line=="number"&&typeof s.column=="number"&&!Number.isNaN(s.line)&&!Number.isNaN(s.column)){for(;n.length<s.line;){const o=n[n.length-1],u=Yu(e,o),l=u===-1?e.length+1:u+1;if(o===l)break;n.push(l)}const a=(s.line>1?n[s.line-2]:0)+s.column-1;if(a<n[s.line-1])return a}}}function Yu(t,e){const n=t.indexOf("\r",e),r=t.indexOf(`
|
|
108
|
-
`,e);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const ln={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/"},bf={}.hasOwnProperty,Ny=Object.prototype;function vy(t,e){const n=e||{};return Ka({file:n.file||void 0,location:!1,schema:n.space==="svg"?Kt:Zr,verbose:n.verbose||!1},t)}function Ka(t,e){let n;switch(e.nodeName){case"#comment":{const r=e;return n={type:"comment",value:r.data},pi(t,r,n),n}case"#document":case"#document-fragment":{const r=e,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:Ef(t,e.childNodes),data:{quirksMode:i}},t.file&&t.location){const s=String(t.file),a=Iy(s),o=a.toPoint(0),u=a.toPoint(s.length);n.position={start:o,end:u}}return n}case"#documentType":{const r=e;return n={type:"doctype"},pi(t,r,n),n}case"#text":{const r=e;return n={type:"text",value:r.value},pi(t,r,n),n}default:return n=wy(t,e),n}}function Ef(t,e){let n=-1;const r=[];for(;++n<e.length;){const i=Ka(t,e[n]);r.push(i)}return r}function wy(t,e){const n=t.schema;t.schema=e.namespaceURI===ln.svg?Kt:Zr;let r=-1;const i={};for(;++r<e.attrs.length;){const o=e.attrs[r],u=(o.prefix?o.prefix+":":"")+o.name;bf.call(Ny,u)||(i[u]=o.value)}const a=(t.schema.space==="svg"?Cy:Ay)(e.tagName,i,Ef(t,e.childNodes));if(pi(t,e,a),a.tagName==="template"){const o=e,u=o.sourceCodeLocation,l=u&&u.startTag&&vn(u.startTag),d=u&&u.endTag&&vn(u.endTag),c=Ka(t,o.content);l&&d&&t.file&&(c.position={start:l.end,end:d.start}),a.content=c}return t.schema=n,a}function pi(t,e,n){if("sourceCodeLocation"in e&&e.sourceCodeLocation&&t.file){const r=Ry(t,n,e.sourceCodeLocation);r&&(t.location=!0,n.position=r)}}function Ry(t,e,n){const r=vn(n);if(e.type==="element"){const i=e.children[e.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),t.verbose){const s={};let a;if(n.attrs)for(a in n.attrs)bf.call(n.attrs,a)&&(s[Ui(t.schema,a).property]=vn(n.attrs[a]));n.startTag;const o=vn(n.startTag),u=n.endTag?vn(n.endTag):void 0,l={opening:o};u&&(l.closing=u),l.properties=s,e.data={position:l}}}return r}function vn(t){const e=qu({line:t.startLine,column:t.startCol,offset:t.startOffset}),n=qu({line:t.endLine,column:t.endCol,offset:t.endOffset});return e||n?{start:e,end:n}:void 0}function qu(t){return t.line&&t.column?t:void 0}const Vu={}.hasOwnProperty;function xf(t,e){const n=e||{};function r(i,...s){let a=r.invalid;const o=r.handlers;if(i&&Vu.call(i,t)){const u=String(i[t]);a=Vu.call(o,u)?o[u]:r.unknown}if(a)return a.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Oy={},Ly={}.hasOwnProperty,Tf=xf("type",{handlers:{root:Py,element:jy,text:Fy,comment:zy,doctype:By}});function Dy(t,e){const r=(e||Oy).space;return Tf(t,r==="svg"?Kt:Zr)}function Py(t,e){const n={nodeName:"#document",mode:(t.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Qa(t.children,n,e),Yn(t,n),n}function My(t,e){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Qa(t.children,n,e),Yn(t,n),n}function By(t){const e={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return Yn(t,e),e}function Fy(t){const e={nodeName:"#text",value:t.value,parentNode:null};return Yn(t,e),e}function zy(t){const e={nodeName:"#comment",data:t.value,parentNode:null};return Yn(t,e),e}function jy(t,e){const n=e;let r=n;t.type==="element"&&t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Kt);const i=[];let s;if(t.properties){for(s in t.properties)if(s!=="children"&&Ly.call(t.properties,s)){const u=Uy(r,s,t.properties[s]);u&&i.push(u)}}const a=r.space,o={nodeName:t.tagName,tagName:t.tagName,attrs:i,namespaceURI:ln[a],childNodes:[],parentNode:null};return o.childNodes=Qa(t.children,o,r),Yn(t,o),t.tagName==="template"&&t.content&&(o.content=My(t.content,r)),o}function Uy(t,e,n){const r=Ui(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?Ld(n):Ud(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const s=i.name.indexOf(":");s<0?i.prefix="":(i.name=i.name.slice(s+1),i.prefix=r.attribute.slice(0,s)),i.namespace=ln[r.space]}return i}function Qa(t,e,n){let r=-1;const i=[];if(t)for(;++r<t.length;){const s=Tf(t[r],n);s.parentNode=e,i.push(s)}return i}function Yn(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 Hy=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],$y=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]),Me="�";var k;(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"})(k||(k={}));const nt={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function _f(t){return t>=55296&&t<=57343}function Zy(t){return t>=56320&&t<=57343}function Yy(t,e){return(t-55296)*1024+9216+e}function yf(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function kf(t){return t>=64976&&t<=65007||$y.has(t)}var B;(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"})(B||(B={}));const qy=65536;class Vy{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=qy,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:i,offset:s}=this,a=i+n,o=s+n;return{code:e,startLine:r,endLine:r,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(Zy(n))return this.pos++,this._addGap(),Yy(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,k.EOF;return this._err(B.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,k.EOF;const r=this.html.charCodeAt(n);return r===k.CARRIAGE_RETURN?k.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,k.EOF;let e=this.html.charCodeAt(this.pos);return e===k.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,k.LINE_FEED):e===k.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,_f(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===k.LINE_FEED||e===k.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){yf(e)?this._err(B.controlCharacterInInputStream):kf(e)&&this._err(B.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var be;(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"})(be||(be={}));function Sf(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 Wy=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))),Gy=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 Ky(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=Gy.get(t))!==null&&e!==void 0?e:t}var qe;(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"})(qe||(qe={}));const Qy=32;var qt;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(qt||(qt={}));function oa(t){return t>=qe.ZERO&&t<=qe.NINE}function Xy(t){return t>=qe.UPPER_A&&t<=qe.UPPER_F||t>=qe.LOWER_A&&t<=qe.LOWER_F}function Jy(t){return t>=qe.UPPER_A&&t<=qe.UPPER_Z||t>=qe.LOWER_A&&t<=qe.LOWER_Z||oa(t)}function ek(t){return t===qe.EQUALS||Jy(t)}var Ye;(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"})(Ye||(Ye={}));var Lt;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Lt||(Lt={}));class tk{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=Ye.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Lt.Strict}startEntity(e){this.decodeMode=e,this.state=Ye.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case Ye.EntityStart:return e.charCodeAt(n)===qe.NUM?(this.state=Ye.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=Ye.NamedEntity,this.stateNamedEntity(e,n));case Ye.NumericStart:return this.stateNumericStart(e,n);case Ye.NumericDecimal:return this.stateNumericDecimal(e,n);case Ye.NumericHex:return this.stateNumericHex(e,n);case Ye.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|Qy)===qe.LOWER_X?(this.state=Ye.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=Ye.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+Number.parseInt(e.substr(n,s),i),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(oa(i)||Xy(i))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const i=e.charCodeAt(n);if(oa(i))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(i,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===qe.SEMI)this.consumed+=1;else if(this.decodeMode===Lt.Strict)return 0;return this.emitCodePoint(Ky(this.result),this.consumed),this.errors&&(e!==qe.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&qt.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const a=e.charCodeAt(n);if(this.treeIndex=nk(r,i,this.treeIndex+Math.max(1,s),a),this.treeIndex<0)return this.result===0||this.decodeMode===Lt.Attribute&&(s===0||ek(a))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&qt.VALUE_LENGTH)>>14,s!==0){if(a===qe.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Lt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,i=(r[n]&qt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[e]&~qt.VALUE_LENGTH:i[e+1],r),n===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case Ye.NamedEntity:return this.result!==0&&(this.decodeMode!==Lt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ye.NumericDecimal:return this.emitNumericEntity(0,2);case Ye.NumericHex:return this.emitNumericEntity(0,3);case Ye.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ye.EntityStart:return 0}}}function nk(t,e,n,r){const i=(e&qt.BRANCH_LENGTH)>>7,s=e&qt.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=i?-1:t[n+u]-1}let a=n,o=a+i-1;for(;a<=o;){const u=a+o>>>1,l=t[u];if(l<r)a=u+1;else if(l>r)o=u-1;else return t[u+i]}return-1}var $;(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/"})($||($={}));var cn;(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"})(cn||(cn={}));var gt;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(gt||(gt={}));var L;(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"})(L||(L={}));var f;(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"})(f||(f={}));const rk=new Map([[L.A,f.A],[L.ADDRESS,f.ADDRESS],[L.ANNOTATION_XML,f.ANNOTATION_XML],[L.APPLET,f.APPLET],[L.AREA,f.AREA],[L.ARTICLE,f.ARTICLE],[L.ASIDE,f.ASIDE],[L.B,f.B],[L.BASE,f.BASE],[L.BASEFONT,f.BASEFONT],[L.BGSOUND,f.BGSOUND],[L.BIG,f.BIG],[L.BLOCKQUOTE,f.BLOCKQUOTE],[L.BODY,f.BODY],[L.BR,f.BR],[L.BUTTON,f.BUTTON],[L.CAPTION,f.CAPTION],[L.CENTER,f.CENTER],[L.CODE,f.CODE],[L.COL,f.COL],[L.COLGROUP,f.COLGROUP],[L.DD,f.DD],[L.DESC,f.DESC],[L.DETAILS,f.DETAILS],[L.DIALOG,f.DIALOG],[L.DIR,f.DIR],[L.DIV,f.DIV],[L.DL,f.DL],[L.DT,f.DT],[L.EM,f.EM],[L.EMBED,f.EMBED],[L.FIELDSET,f.FIELDSET],[L.FIGCAPTION,f.FIGCAPTION],[L.FIGURE,f.FIGURE],[L.FONT,f.FONT],[L.FOOTER,f.FOOTER],[L.FOREIGN_OBJECT,f.FOREIGN_OBJECT],[L.FORM,f.FORM],[L.FRAME,f.FRAME],[L.FRAMESET,f.FRAMESET],[L.H1,f.H1],[L.H2,f.H2],[L.H3,f.H3],[L.H4,f.H4],[L.H5,f.H5],[L.H6,f.H6],[L.HEAD,f.HEAD],[L.HEADER,f.HEADER],[L.HGROUP,f.HGROUP],[L.HR,f.HR],[L.HTML,f.HTML],[L.I,f.I],[L.IMG,f.IMG],[L.IMAGE,f.IMAGE],[L.INPUT,f.INPUT],[L.IFRAME,f.IFRAME],[L.KEYGEN,f.KEYGEN],[L.LABEL,f.LABEL],[L.LI,f.LI],[L.LINK,f.LINK],[L.LISTING,f.LISTING],[L.MAIN,f.MAIN],[L.MALIGNMARK,f.MALIGNMARK],[L.MARQUEE,f.MARQUEE],[L.MATH,f.MATH],[L.MENU,f.MENU],[L.META,f.META],[L.MGLYPH,f.MGLYPH],[L.MI,f.MI],[L.MO,f.MO],[L.MN,f.MN],[L.MS,f.MS],[L.MTEXT,f.MTEXT],[L.NAV,f.NAV],[L.NOBR,f.NOBR],[L.NOFRAMES,f.NOFRAMES],[L.NOEMBED,f.NOEMBED],[L.NOSCRIPT,f.NOSCRIPT],[L.OBJECT,f.OBJECT],[L.OL,f.OL],[L.OPTGROUP,f.OPTGROUP],[L.OPTION,f.OPTION],[L.P,f.P],[L.PARAM,f.PARAM],[L.PLAINTEXT,f.PLAINTEXT],[L.PRE,f.PRE],[L.RB,f.RB],[L.RP,f.RP],[L.RT,f.RT],[L.RTC,f.RTC],[L.RUBY,f.RUBY],[L.S,f.S],[L.SCRIPT,f.SCRIPT],[L.SEARCH,f.SEARCH],[L.SECTION,f.SECTION],[L.SELECT,f.SELECT],[L.SOURCE,f.SOURCE],[L.SMALL,f.SMALL],[L.SPAN,f.SPAN],[L.STRIKE,f.STRIKE],[L.STRONG,f.STRONG],[L.STYLE,f.STYLE],[L.SUB,f.SUB],[L.SUMMARY,f.SUMMARY],[L.SUP,f.SUP],[L.TABLE,f.TABLE],[L.TBODY,f.TBODY],[L.TEMPLATE,f.TEMPLATE],[L.TEXTAREA,f.TEXTAREA],[L.TFOOT,f.TFOOT],[L.TD,f.TD],[L.TH,f.TH],[L.THEAD,f.THEAD],[L.TITLE,f.TITLE],[L.TR,f.TR],[L.TRACK,f.TRACK],[L.TT,f.TT],[L.U,f.U],[L.UL,f.UL],[L.SVG,f.SVG],[L.VAR,f.VAR],[L.WBR,f.WBR],[L.XMP,f.XMP]]);function qn(t){var e;return(e=rk.get(t))!==null&&e!==void 0?e:f.UNKNOWN}const Z=f,ik={[$.HTML]:new Set([Z.ADDRESS,Z.APPLET,Z.AREA,Z.ARTICLE,Z.ASIDE,Z.BASE,Z.BASEFONT,Z.BGSOUND,Z.BLOCKQUOTE,Z.BODY,Z.BR,Z.BUTTON,Z.CAPTION,Z.CENTER,Z.COL,Z.COLGROUP,Z.DD,Z.DETAILS,Z.DIR,Z.DIV,Z.DL,Z.DT,Z.EMBED,Z.FIELDSET,Z.FIGCAPTION,Z.FIGURE,Z.FOOTER,Z.FORM,Z.FRAME,Z.FRAMESET,Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6,Z.HEAD,Z.HEADER,Z.HGROUP,Z.HR,Z.HTML,Z.IFRAME,Z.IMG,Z.INPUT,Z.LI,Z.LINK,Z.LISTING,Z.MAIN,Z.MARQUEE,Z.MENU,Z.META,Z.NAV,Z.NOEMBED,Z.NOFRAMES,Z.NOSCRIPT,Z.OBJECT,Z.OL,Z.P,Z.PARAM,Z.PLAINTEXT,Z.PRE,Z.SCRIPT,Z.SECTION,Z.SELECT,Z.SOURCE,Z.STYLE,Z.SUMMARY,Z.TABLE,Z.TBODY,Z.TD,Z.TEMPLATE,Z.TEXTAREA,Z.TFOOT,Z.TH,Z.THEAD,Z.TITLE,Z.TR,Z.TRACK,Z.UL,Z.WBR,Z.XMP]),[$.MATHML]:new Set([Z.MI,Z.MO,Z.MN,Z.MS,Z.MTEXT,Z.ANNOTATION_XML]),[$.SVG]:new Set([Z.TITLE,Z.FOREIGN_OBJECT,Z.DESC]),[$.XLINK]:new Set,[$.XML]:new Set,[$.XMLNS]:new Set},ua=new Set([Z.H1,Z.H2,Z.H3,Z.H4,Z.H5,Z.H6]);L.STYLE,L.SCRIPT,L.XMP,L.IFRAME,L.NOEMBED,L.NOFRAMES,L.PLAINTEXT;var A;(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"})(A||(A={}));const Ue={DATA:A.DATA,RCDATA:A.RCDATA,RAWTEXT:A.RAWTEXT,SCRIPT_DATA:A.SCRIPT_DATA,PLAINTEXT:A.PLAINTEXT,CDATA_SECTION:A.CDATA_SECTION};function sk(t){return t>=k.DIGIT_0&&t<=k.DIGIT_9}function cr(t){return t>=k.LATIN_CAPITAL_A&&t<=k.LATIN_CAPITAL_Z}function ak(t){return t>=k.LATIN_SMALL_A&&t<=k.LATIN_SMALL_Z}function Ht(t){return ak(t)||cr(t)}function Wu(t){return Ht(t)||sk(t)}function ri(t){return t+32}function Af(t){return t===k.SPACE||t===k.LINE_FEED||t===k.TABULATION||t===k.FORM_FEED}function Gu(t){return Af(t)||t===k.SOLIDUS||t===k.GREATER_THAN_SIGN}function ok(t){return t===k.NULL?B.nullCharacterReference:t>1114111?B.characterReferenceOutsideUnicodeRange:_f(t)?B.surrogateCharacterReference:kf(t)?B.noncharacterCharacterReference:yf(t)||t===k.CARRIAGE_RETURN?B.controlCharacterReference:null}class uk{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=A.DATA,this.returnState=A.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new Vy(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new tk(Wy,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(B.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(B.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=ok(r);i&&this._err(i,1)}}:void 0)}_err(e,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.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:be.START_TAG,tagName:"",tagID:f.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:be.END_TAG,tagName:"",tagID:f.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:be.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:be.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(Sf(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(e=(n=r.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(B.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=qn(e.tagName),e.type===be.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(B.endTagWithAttributes),e.selfClosing&&this._err(B.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 be.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case be.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case be.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:be.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=Af(e)?be.WHITESPACE_CHARACTER:e===k.NULL?be.NULL_CHARACTER:be.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(be.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=A.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Lt.Attribute:Lt.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===A.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===A.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===A.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case A.DATA:{this._stateData(e);break}case A.RCDATA:{this._stateRcdata(e);break}case A.RAWTEXT:{this._stateRawtext(e);break}case A.SCRIPT_DATA:{this._stateScriptData(e);break}case A.PLAINTEXT:{this._statePlaintext(e);break}case A.TAG_OPEN:{this._stateTagOpen(e);break}case A.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case A.TAG_NAME:{this._stateTagName(e);break}case A.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case A.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case A.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case A.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case A.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case A.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case A.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case A.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case A.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case A.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case A.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case A.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case A.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case A.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case A.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case A.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case A.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case A.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case A.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case A.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case A.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case A.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case A.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case A.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case A.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case A.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case A.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case A.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case A.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case A.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case A.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case A.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case A.BOGUS_COMMENT:{this._stateBogusComment(e);break}case A.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case A.COMMENT_START:{this._stateCommentStart(e);break}case A.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case A.COMMENT:{this._stateComment(e);break}case A.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case A.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case A.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case A.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case A.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case A.COMMENT_END:{this._stateCommentEnd(e);break}case A.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case A.DOCTYPE:{this._stateDoctype(e);break}case A.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case A.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case A.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case A.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case A.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case A.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case A.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case A.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case A.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case A.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case A.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case A.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case A.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case A.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case A.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case A.CDATA_SECTION:{this._stateCdataSection(e);break}case A.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case A.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case A.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case A.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case k.LESS_THAN_SIGN:{this.state=A.TAG_OPEN;break}case k.AMPERSAND:{this._startCharacterReference();break}case k.NULL:{this._err(B.unexpectedNullCharacter),this._emitCodePoint(e);break}case k.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case k.AMPERSAND:{this._startCharacterReference();break}case k.LESS_THAN_SIGN:{this.state=A.RCDATA_LESS_THAN_SIGN;break}case k.NULL:{this._err(B.unexpectedNullCharacter),this._emitChars(Me);break}case k.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case k.LESS_THAN_SIGN:{this.state=A.RAWTEXT_LESS_THAN_SIGN;break}case k.NULL:{this._err(B.unexpectedNullCharacter),this._emitChars(Me);break}case k.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case k.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_LESS_THAN_SIGN;break}case k.NULL:{this._err(B.unexpectedNullCharacter),this._emitChars(Me);break}case k.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case k.NULL:{this._err(B.unexpectedNullCharacter),this._emitChars(Me);break}case k.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Ht(e))this._createStartTagToken(),this.state=A.TAG_NAME,this._stateTagName(e);else switch(e){case k.EXCLAMATION_MARK:{this.state=A.MARKUP_DECLARATION_OPEN;break}case k.SOLIDUS:{this.state=A.END_TAG_OPEN;break}case k.QUESTION_MARK:{this._err(B.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=A.BOGUS_COMMENT,this._stateBogusComment(e);break}case k.EOF:{this._err(B.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(B.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=A.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Ht(e))this._createEndTagToken(),this.state=A.TAG_NAME,this._stateTagName(e);else switch(e){case k.GREATER_THAN_SIGN:{this._err(B.missingEndTagName),this.state=A.DATA;break}case k.EOF:{this._err(B.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(B.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=A.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:{this.state=A.BEFORE_ATTRIBUTE_NAME;break}case k.SOLIDUS:{this.state=A.SELF_CLOSING_START_TAG;break}case k.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentTagToken();break}case k.NULL:{this._err(B.unexpectedNullCharacter),n.tagName+=Me;break}case k.EOF:{this._err(B.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(cr(e)?ri(e):e)}}_stateRcdataLessThanSign(e){e===k.SOLIDUS?this.state=A.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=A.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Ht(e)?(this.state=A.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=A.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 k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=A.BEFORE_ATTRIBUTE_NAME,!1;case k.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=A.SELF_CLOSING_START_TAG,!1;case k.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=A.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=A.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===k.SOLIDUS?this.state=A.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=A.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Ht(e)?(this.state=A.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=A.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=A.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case k.SOLIDUS:{this.state=A.SCRIPT_DATA_END_TAG_OPEN;break}case k.EXCLAMATION_MARK:{this.state=A.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=A.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Ht(e)?(this.state=A.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=A.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=A.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===k.HYPHEN_MINUS?(this.state=A.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=A.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===k.HYPHEN_MINUS?(this.state=A.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=A.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case k.HYPHEN_MINUS:{this.state=A.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case k.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case k.NULL:{this._err(B.unexpectedNullCharacter),this._emitChars(Me);break}case k.EOF:{this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case k.HYPHEN_MINUS:{this.state=A.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case k.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case k.NULL:{this._err(B.unexpectedNullCharacter),this.state=A.SCRIPT_DATA_ESCAPED,this._emitChars(Me);break}case k.EOF:{this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=A.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case k.HYPHEN_MINUS:{this._emitChars("-");break}case k.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case k.GREATER_THAN_SIGN:{this.state=A.SCRIPT_DATA,this._emitChars(">");break}case k.NULL:{this._err(B.unexpectedNullCharacter),this.state=A.SCRIPT_DATA_ESCAPED,this._emitChars(Me);break}case k.EOF:{this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=A.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===k.SOLIDUS?this.state=A.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Ht(e)?(this._emitChars("<"),this.state=A.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=A.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Ht(e)?(this.state=A.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=A.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=A.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(nt.SCRIPT,!1)&&Gu(this.preprocessor.peek(nt.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<nt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=A.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case k.HYPHEN_MINUS:{this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case k.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case k.NULL:{this._err(B.unexpectedNullCharacter),this._emitChars(Me);break}case k.EOF:{this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case k.HYPHEN_MINUS:{this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case k.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case k.NULL:{this._err(B.unexpectedNullCharacter),this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Me);break}case k.EOF:{this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case k.HYPHEN_MINUS:{this._emitChars("-");break}case k.LESS_THAN_SIGN:{this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case k.GREATER_THAN_SIGN:{this.state=A.SCRIPT_DATA,this._emitChars(">");break}case k.NULL:{this._err(B.unexpectedNullCharacter),this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Me);break}case k.EOF:{this._err(B.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===k.SOLIDUS?(this.state=A.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(nt.SCRIPT,!1)&&Gu(this.preprocessor.peek(nt.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<nt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=A.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=A.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:break;case k.SOLIDUS:case k.GREATER_THAN_SIGN:case k.EOF:{this.state=A.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case k.EQUALS_SIGN:{this._err(B.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=A.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=A.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:case k.SOLIDUS:case k.GREATER_THAN_SIGN:case k.EOF:{this._leaveAttrName(),this.state=A.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case k.EQUALS_SIGN:{this._leaveAttrName(),this.state=A.BEFORE_ATTRIBUTE_VALUE;break}case k.QUOTATION_MARK:case k.APOSTROPHE:case k.LESS_THAN_SIGN:{this._err(B.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case k.NULL:{this._err(B.unexpectedNullCharacter),this.currentAttr.name+=Me;break}default:this.currentAttr.name+=String.fromCodePoint(cr(e)?ri(e):e)}}_stateAfterAttributeName(e){switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:break;case k.SOLIDUS:{this.state=A.SELF_CLOSING_START_TAG;break}case k.EQUALS_SIGN:{this.state=A.BEFORE_ATTRIBUTE_VALUE;break}case k.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentTagToken();break}case k.EOF:{this._err(B.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=A.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:break;case k.QUOTATION_MARK:{this.state=A.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case k.APOSTROPHE:{this.state=A.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case k.GREATER_THAN_SIGN:{this._err(B.missingAttributeValue),this.state=A.DATA,this.emitCurrentTagToken();break}default:this.state=A.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case k.QUOTATION_MARK:{this.state=A.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case k.AMPERSAND:{this._startCharacterReference();break}case k.NULL:{this._err(B.unexpectedNullCharacter),this.currentAttr.value+=Me;break}case k.EOF:{this._err(B.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case k.APOSTROPHE:{this.state=A.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case k.AMPERSAND:{this._startCharacterReference();break}case k.NULL:{this._err(B.unexpectedNullCharacter),this.currentAttr.value+=Me;break}case k.EOF:{this._err(B.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:{this._leaveAttrValue(),this.state=A.BEFORE_ATTRIBUTE_NAME;break}case k.AMPERSAND:{this._startCharacterReference();break}case k.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=A.DATA,this.emitCurrentTagToken();break}case k.NULL:{this._err(B.unexpectedNullCharacter),this.currentAttr.value+=Me;break}case k.QUOTATION_MARK:case k.APOSTROPHE:case k.LESS_THAN_SIGN:case k.EQUALS_SIGN:case k.GRAVE_ACCENT:{this._err(B.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case k.EOF:{this._err(B.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:{this._leaveAttrValue(),this.state=A.BEFORE_ATTRIBUTE_NAME;break}case k.SOLIDUS:{this._leaveAttrValue(),this.state=A.SELF_CLOSING_START_TAG;break}case k.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=A.DATA,this.emitCurrentTagToken();break}case k.EOF:{this._err(B.eofInTag),this._emitEOFToken();break}default:this._err(B.missingWhitespaceBetweenAttributes),this.state=A.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case k.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=A.DATA,this.emitCurrentTagToken();break}case k.EOF:{this._err(B.eofInTag),this._emitEOFToken();break}default:this._err(B.unexpectedSolidusInTag),this.state=A.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case k.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentComment(n);break}case k.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case k.NULL:{this._err(B.unexpectedNullCharacter),n.data+=Me;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(nt.DASH_DASH,!0)?(this._createCommentToken(nt.DASH_DASH.length+1),this.state=A.COMMENT_START):this._consumeSequenceIfMatch(nt.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(nt.DOCTYPE.length+1),this.state=A.DOCTYPE):this._consumeSequenceIfMatch(nt.CDATA_START,!0)?this.inForeignNode?this.state=A.CDATA_SECTION:(this._err(B.cdataInHtmlContent),this._createCommentToken(nt.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=A.BOGUS_COMMENT):this._ensureHibernation()||(this._err(B.incorrectlyOpenedComment),this._createCommentToken(2),this.state=A.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case k.HYPHEN_MINUS:{this.state=A.COMMENT_START_DASH;break}case k.GREATER_THAN_SIGN:{this._err(B.abruptClosingOfEmptyComment),this.state=A.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=A.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case k.HYPHEN_MINUS:{this.state=A.COMMENT_END;break}case k.GREATER_THAN_SIGN:{this._err(B.abruptClosingOfEmptyComment),this.state=A.DATA,this.emitCurrentComment(n);break}case k.EOF:{this._err(B.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=A.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case k.HYPHEN_MINUS:{this.state=A.COMMENT_END_DASH;break}case k.LESS_THAN_SIGN:{n.data+="<",this.state=A.COMMENT_LESS_THAN_SIGN;break}case k.NULL:{this._err(B.unexpectedNullCharacter),n.data+=Me;break}case k.EOF:{this._err(B.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case k.EXCLAMATION_MARK:{n.data+="!",this.state=A.COMMENT_LESS_THAN_SIGN_BANG;break}case k.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=A.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===k.HYPHEN_MINUS?this.state=A.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=A.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===k.HYPHEN_MINUS?this.state=A.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=A.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==k.GREATER_THAN_SIGN&&e!==k.EOF&&this._err(B.nestedComment),this.state=A.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case k.HYPHEN_MINUS:{this.state=A.COMMENT_END;break}case k.EOF:{this._err(B.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=A.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case k.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentComment(n);break}case k.EXCLAMATION_MARK:{this.state=A.COMMENT_END_BANG;break}case k.HYPHEN_MINUS:{n.data+="-";break}case k.EOF:{this._err(B.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=A.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case k.HYPHEN_MINUS:{n.data+="--!",this.state=A.COMMENT_END_DASH;break}case k.GREATER_THAN_SIGN:{this._err(B.incorrectlyClosedComment),this.state=A.DATA,this.emitCurrentComment(n);break}case k.EOF:{this._err(B.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=A.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:{this.state=A.BEFORE_DOCTYPE_NAME;break}case k.GREATER_THAN_SIGN:{this.state=A.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case k.EOF:{this._err(B.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(B.missingWhitespaceBeforeDoctypeName),this.state=A.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(cr(e))this._createDoctypeToken(String.fromCharCode(ri(e))),this.state=A.DOCTYPE_NAME;else switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:break;case k.NULL:{this._err(B.unexpectedNullCharacter),this._createDoctypeToken(Me),this.state=A.DOCTYPE_NAME;break}case k.GREATER_THAN_SIGN:{this._err(B.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=A.DATA;break}case k.EOF:{this._err(B.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=A.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:{this.state=A.AFTER_DOCTYPE_NAME;break}case k.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentDoctype(n);break}case k.NULL:{this._err(B.unexpectedNullCharacter),n.name+=Me;break}case k.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(cr(e)?ri(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:break;case k.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentDoctype(n);break}case k.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(nt.PUBLIC,!1)?this.state=A.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(nt.SYSTEM,!1)?this.state=A.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(B.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:{this.state=A.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case k.QUOTATION_MARK:{this._err(B.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=A.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case k.APOSTROPHE:{this._err(B.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=A.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case k.GREATER_THAN_SIGN:{this._err(B.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=A.DATA,this.emitCurrentDoctype(n);break}case k.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(B.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:break;case k.QUOTATION_MARK:{n.publicId="",this.state=A.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case k.APOSTROPHE:{n.publicId="",this.state=A.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case k.GREATER_THAN_SIGN:{this._err(B.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=A.DATA,this.emitCurrentDoctype(n);break}case k.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(B.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case k.QUOTATION_MARK:{this.state=A.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case k.NULL:{this._err(B.unexpectedNullCharacter),n.publicId+=Me;break}case k.GREATER_THAN_SIGN:{this._err(B.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=A.DATA;break}case k.EOF:{this._err(B.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 k.APOSTROPHE:{this.state=A.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case k.NULL:{this._err(B.unexpectedNullCharacter),n.publicId+=Me;break}case k.GREATER_THAN_SIGN:{this._err(B.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=A.DATA;break}case k.EOF:{this._err(B.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 k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:{this.state=A.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case k.GREATER_THAN_SIGN:{this.state=A.DATA,this.emitCurrentDoctype(n);break}case k.QUOTATION_MARK:{this._err(B.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case k.APOSTROPHE:{this._err(B.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case k.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:break;case k.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=A.DATA;break}case k.QUOTATION_MARK:{n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case k.APOSTROPHE:{n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case k.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:{this.state=A.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case k.QUOTATION_MARK:{this._err(B.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case k.APOSTROPHE:{this._err(B.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case k.GREATER_THAN_SIGN:{this._err(B.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=A.DATA,this.emitCurrentDoctype(n);break}case k.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:break;case k.QUOTATION_MARK:{n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case k.APOSTROPHE:{n.systemId="",this.state=A.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case k.GREATER_THAN_SIGN:{this._err(B.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=A.DATA,this.emitCurrentDoctype(n);break}case k.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(B.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case k.QUOTATION_MARK:{this.state=A.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case k.NULL:{this._err(B.unexpectedNullCharacter),n.systemId+=Me;break}case k.GREATER_THAN_SIGN:{this._err(B.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=A.DATA;break}case k.EOF:{this._err(B.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 k.APOSTROPHE:{this.state=A.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case k.NULL:{this._err(B.unexpectedNullCharacter),n.systemId+=Me;break}case k.GREATER_THAN_SIGN:{this._err(B.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=A.DATA;break}case k.EOF:{this._err(B.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 k.SPACE:case k.LINE_FEED:case k.TABULATION:case k.FORM_FEED:break;case k.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=A.DATA;break}case k.EOF:{this._err(B.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(B.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=A.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case k.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=A.DATA;break}case k.NULL:{this._err(B.unexpectedNullCharacter);break}case k.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case k.RIGHT_SQUARE_BRACKET:{this.state=A.CDATA_SECTION_BRACKET;break}case k.EOF:{this._err(B.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===k.RIGHT_SQUARE_BRACKET?this.state=A.CDATA_SECTION_END:(this._emitChars("]"),this.state=A.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case k.GREATER_THAN_SIGN:{this.state=A.DATA;break}case k.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=A.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(k.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Wu(this.preprocessor.peek(1))?A.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){Wu(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===k.SEMICOLON&&this._err(B.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const Cf=new Set([f.DD,f.DT,f.LI,f.OPTGROUP,f.OPTION,f.P,f.RB,f.RP,f.RT,f.RTC]),Ku=new Set([...Cf,f.CAPTION,f.COLGROUP,f.TBODY,f.TD,f.TFOOT,f.TH,f.THEAD,f.TR]),Ni=new Set([f.APPLET,f.CAPTION,f.HTML,f.MARQUEE,f.OBJECT,f.TABLE,f.TD,f.TEMPLATE,f.TH]),lk=new Set([...Ni,f.OL,f.UL]),ck=new Set([...Ni,f.BUTTON]),Qu=new Set([f.ANNOTATION_XML,f.MI,f.MN,f.MO,f.MS,f.MTEXT]),Xu=new Set([f.DESC,f.FOREIGN_OBJECT,f.TITLE]),dk=new Set([f.TR,f.TEMPLATE,f.HTML]),fk=new Set([f.TBODY,f.TFOOT,f.THEAD,f.TEMPLATE,f.HTML]),hk=new Set([f.TABLE,f.TEMPLATE,f.HTML]),pk=new Set([f.TD,f.TH]);class mk{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=f.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===f.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===$.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 i=this._indexOf(e)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==$.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(ua,$.HTML)}popUntilTableCellPopped(){this.popUntilPopped(pk,$.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(hk,$.HTML)}clearBackToTableBodyContext(){this.clearBackTo(fk,$.HTML)}clearBackToTableRowContext(){this.clearBackTo(dk,$.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]===f.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]===f.HTML}hasInDynamicScope(e,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case $.HTML:{if(i===e)return!0;if(n.has(i))return!1;break}case $.SVG:{if(Xu.has(i))return!1;break}case $.MATHML:{if(Qu.has(i))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Ni)}hasInListItemScope(e){return this.hasInDynamicScope(e,lk)}hasInButtonScope(e){return this.hasInDynamicScope(e,ck)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case $.HTML:{if(ua.has(n))return!0;if(Ni.has(n))return!1;break}case $.SVG:{if(Xu.has(n))return!1;break}case $.MATHML:{if(Qu.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===$.HTML)switch(this.tagIDs[n]){case e:return!0;case f.TABLE:case f.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===$.HTML)switch(this.tagIDs[e]){case f.TBODY:case f.THEAD:case f.TFOOT:return!0;case f.TABLE:case f.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===$.HTML)switch(this.tagIDs[n]){case e:return!0;case f.OPTION:case f.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Cf.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 Ss=3;var It;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(It||(It={}));const Ju={type:It.Marker};class gk{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],i=n.length,s=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let o=0;o<this.entries.length;o++){const u=this.entries[o];if(u.type===It.Marker)break;const{element:l}=u;if(this.treeAdapter.getTagName(l)===s&&this.treeAdapter.getNamespaceURI(l)===a){const d=this.treeAdapter.getAttrList(l);d.length===i&&r.push({idx:o,attrs:d})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<Ss)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<Ss)return;const i=new Map(n.map(a=>[a.name,a.value]));let s=0;for(let a=0;a<r.length;a++){const o=r[a];o.attrs.every(u=>i.get(u.name)===u.value)&&(s+=1,s>=Ss&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(Ju)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:It.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:It.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(Ju);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===It.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===It.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===It.Element&&n.element===e)}}const $t={createDocument(){return{nodeName:"#document",mode:gt.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 i=t.childNodes.find(s=>s.nodeName==="#documentType");if(i)i.name=e,i.publicId=n,i.systemId=r;else{const s={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};$t.appendChild(t,s)}},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($t.isTextNode(n)){n.value+=e;return}}$t.appendChild(t,$t.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&$t.isTextNode(r)?r.value+=e:$t.insertBefore(t,$t.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}}},If="html",bk="about:legacy-compat",Ek="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Nf=["+//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//"],xk=[...Nf,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],Tk=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),vf=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],_k=[...vf,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function el(t,e){return e.some(n=>t.startsWith(n))}function yk(t){return t.name===If&&t.publicId===null&&(t.systemId===null||t.systemId===bk)}function kk(t){if(t.name!==If)return gt.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===Ek)return gt.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),Tk.has(n))return gt.QUIRKS;let r=e===null?xk:Nf;if(el(n,r))return gt.QUIRKS;if(r=e===null?vf:_k,el(n,r))return gt.LIMITED_QUIRKS}return gt.NO_QUIRKS}const tl={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},Sk="definitionurl",Ak="definitionURL",Ck=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])),Ik=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:$.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:$.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:$.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:$.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:$.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:$.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:$.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:$.XML}],["xml:space",{prefix:"xml",name:"space",namespace:$.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:$.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:$.XMLNS}]]),Nk=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])),vk=new Set([f.B,f.BIG,f.BLOCKQUOTE,f.BODY,f.BR,f.CENTER,f.CODE,f.DD,f.DIV,f.DL,f.DT,f.EM,f.EMBED,f.H1,f.H2,f.H3,f.H4,f.H5,f.H6,f.HEAD,f.HR,f.I,f.IMG,f.LI,f.LISTING,f.MENU,f.META,f.NOBR,f.OL,f.P,f.PRE,f.RUBY,f.S,f.SMALL,f.SPAN,f.STRONG,f.STRIKE,f.SUB,f.SUP,f.TABLE,f.TT,f.U,f.UL,f.VAR]);function wk(t){const e=t.tagID;return e===f.FONT&&t.attrs.some(({name:r})=>r===cn.COLOR||r===cn.SIZE||r===cn.FACE)||vk.has(e)}function wf(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===Sk){t.attrs[e].name=Ak;break}}function Rf(t){for(let e=0;e<t.attrs.length;e++){const n=Ck.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function Xa(t){for(let e=0;e<t.attrs.length;e++){const n=Ik.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 Rk(t){const e=Nk.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=qn(t.tagName))}function Ok(t,e){return e===$.MATHML&&(t===f.MI||t===f.MO||t===f.MN||t===f.MS||t===f.MTEXT)}function Lk(t,e,n){if(e===$.MATHML&&t===f.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===cn.ENCODING){const i=n[r].value.toLowerCase();return i===tl.TEXT_HTML||i===tl.APPLICATION_XML}}return e===$.SVG&&(t===f.FOREIGN_OBJECT||t===f.DESC||t===f.TITLE)}function Dk(t,e,n,r){return(!r||r===$.HTML)&&Lk(t,e,n)||(!r||r===$.MATHML)&&Ok(t,e)}const Pk="hidden",Mk=8,Bk=3;var I;(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"})(I||(I={}));const Fk={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Of=new Set([f.TABLE,f.TBODY,f.TFOOT,f.THEAD,f.TR]),nl={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:$t,onParseError:null};class rl{constructor(e,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=I.INITIAL,this.originalInsertionMode=I.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={...nl,...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 uk(this.options,this),this.activeFormattingElements=new gk(this.treeAdapter),this.fragmentContextID=r?qn(this.treeAdapter.getTagName(r)):f.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new mk(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={...nl,...n};e??(e=r.treeAdapter.createElement(L.TEMPLATE,$.HTML,[]));const i=r.treeAdapter.createElement("documentmock",$.HTML,[]),s=new this(r,i,e);return s.fragmentContextID===f.TEMPLATE&&s.tmplInsertionModeStack.unshift(I.IN_TEMPLATE),s._initTokenizerForFragmentParsing(),s._insertFakeRootElement(),s._resetInsertionMode(),s._findFormInFragmentContext(),s}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,r){var i;if(!this.onParseError)return;const s=(i=e.location)!==null&&i!==void 0?i:Fk,a={code:n,startLine:s.startLine,startCol:s.startCol,startOffset:s.startOffset,endLine:r?s.startLine:s.endLine,endCol:r?s.startCol:s.endCol,endOffset:r?s.startOffset:s.endOffset};this.onParseError(a)}onItemPush(e,n,r){var i,s;(s=(i=this.treeAdapter).onItemPush)===null||s===void 0||s.call(i,e),r&&this.openElements.stackTop>0&&this._setContextModes(e,n)}onItemPop(e,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,e,this.openElements.current),n){let s,a;this.openElements.stackTop===0&&this.fragmentContext?(s=this.fragmentContext,a=this.fragmentContextID):{current:s,currentTagId:a}=this.openElements,this._setContextModes(s,a)}}_setContextModes(e,n){const r=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===$.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,$.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=I.TEXT}switchToPlaintextParsing(){this.insertionMode=I.TEXT,this.originalInsertionMode=I.IN_BODY,this.tokenizer.state=Ue.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)===L.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==$.HTML))switch(this.fragmentContextID){case f.TITLE:case f.TEXTAREA:{this.tokenizer.state=Ue.RCDATA;break}case f.STYLE:case f.XMP:case f.IFRAME:case f.NOEMBED:case f.NOFRAMES:case f.NOSCRIPT:{this.tokenizer.state=Ue.RAWTEXT;break}case f.SCRIPT:{this.tokenizer.state=Ue.SCRIPT_DATA;break}case f.PLAINTEXT:{this.tokenizer.state=Ue.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",r=e.publicId||"",i=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),e.location){const a=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));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,$.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,$.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(L.HTML,$.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,f.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 i=this.treeAdapter.getChildNodes(n),s=r?i.lastIndexOf(r):i.length,a=i[s-1];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:u,endCol:l,endOffset:d}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:u,endCol:l,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,i=this.treeAdapter.getTagName(e),s=n.type===be.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,s)}}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===f.SVG&&this.treeAdapter.getTagName(n)===L.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===$.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===f.MGLYPH||e.tagID===f.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,$.HTML)}_processToken(e){switch(e.type){case be.CHARACTER:{this.onCharacter(e);break}case be.NULL_CHARACTER:{this.onNullCharacter(e);break}case be.COMMENT:{this.onComment(e);break}case be.DOCTYPE:{this.onDoctype(e);break}case be.START_TAG:{this._processStartTag(e);break}case be.END_TAG:{this.onEndTag(e);break}case be.EOF:{this.onEof(e);break}case be.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const i=this.treeAdapter.getNamespaceURI(n),s=this.treeAdapter.getAttrList(n);return Dk(e,i,s,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===It.Marker||this.openElements.contains(i.element)),r=n===-1?e-1:n-1;for(let i=r;i>=0;i--){const s=this.activeFormattingElements.entries[i];this._insertElement(s.token,this.treeAdapter.getNamespaceURI(s.element)),s.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=I.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(f.P),this.openElements.popUntilTagNamePopped(f.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case f.TR:{this.insertionMode=I.IN_ROW;return}case f.TBODY:case f.THEAD:case f.TFOOT:{this.insertionMode=I.IN_TABLE_BODY;return}case f.CAPTION:{this.insertionMode=I.IN_CAPTION;return}case f.COLGROUP:{this.insertionMode=I.IN_COLUMN_GROUP;return}case f.TABLE:{this.insertionMode=I.IN_TABLE;return}case f.BODY:{this.insertionMode=I.IN_BODY;return}case f.FRAMESET:{this.insertionMode=I.IN_FRAMESET;return}case f.SELECT:{this._resetInsertionModeForSelect(e);return}case f.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case f.HTML:{this.insertionMode=this.headElement?I.AFTER_HEAD:I.BEFORE_HEAD;return}case f.TD:case f.TH:{if(e>0){this.insertionMode=I.IN_CELL;return}break}case f.HEAD:{if(e>0){this.insertionMode=I.IN_HEAD;return}break}}this.insertionMode=I.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===f.TEMPLATE)break;if(r===f.TABLE){this.insertionMode=I.IN_SELECT_IN_TABLE;return}}this.insertionMode=I.IN_SELECT}_isElementCausesFosterParenting(e){return Of.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 f.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===$.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case f.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 ik[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){pS(this,e);return}switch(this.insertionMode){case I.INITIAL:{ir(this,e);break}case I.BEFORE_HTML:{xr(this,e);break}case I.BEFORE_HEAD:{Tr(this,e);break}case I.IN_HEAD:{_r(this,e);break}case I.IN_HEAD_NO_SCRIPT:{yr(this,e);break}case I.AFTER_HEAD:{kr(this,e);break}case I.IN_BODY:case I.IN_CAPTION:case I.IN_CELL:case I.IN_TEMPLATE:{Df(this,e);break}case I.TEXT:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case I.IN_TABLE:case I.IN_TABLE_BODY:case I.IN_ROW:{As(this,e);break}case I.IN_TABLE_TEXT:{jf(this,e);break}case I.IN_COLUMN_GROUP:{vi(this,e);break}case I.AFTER_BODY:{wi(this,e);break}case I.AFTER_AFTER_BODY:{mi(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){hS(this,e);return}switch(this.insertionMode){case I.INITIAL:{ir(this,e);break}case I.BEFORE_HTML:{xr(this,e);break}case I.BEFORE_HEAD:{Tr(this,e);break}case I.IN_HEAD:{_r(this,e);break}case I.IN_HEAD_NO_SCRIPT:{yr(this,e);break}case I.AFTER_HEAD:{kr(this,e);break}case I.TEXT:{this._insertCharacters(e);break}case I.IN_TABLE:case I.IN_TABLE_BODY:case I.IN_ROW:{As(this,e);break}case I.IN_COLUMN_GROUP:{vi(this,e);break}case I.AFTER_BODY:{wi(this,e);break}case I.AFTER_AFTER_BODY:{mi(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){la(this,e);return}switch(this.insertionMode){case I.INITIAL:case I.BEFORE_HTML:case I.BEFORE_HEAD:case I.IN_HEAD:case I.IN_HEAD_NO_SCRIPT:case I.AFTER_HEAD:case I.IN_BODY:case I.IN_TABLE:case I.IN_CAPTION:case I.IN_COLUMN_GROUP:case I.IN_TABLE_BODY:case I.IN_ROW:case I.IN_CELL:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:case I.IN_TEMPLATE:case I.IN_FRAMESET:case I.AFTER_FRAMESET:{la(this,e);break}case I.IN_TABLE_TEXT:{sr(this,e);break}case I.AFTER_BODY:{Yk(this,e);break}case I.AFTER_AFTER_BODY:case I.AFTER_AFTER_FRAMESET:{qk(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case I.INITIAL:{Vk(this,e);break}case I.BEFORE_HEAD:case I.IN_HEAD:case I.IN_HEAD_NO_SCRIPT:case I.AFTER_HEAD:{this._err(e,B.misplacedDoctype);break}case I.IN_TABLE_TEXT:{sr(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,B.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?mS(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case I.INITIAL:{ir(this,e);break}case I.BEFORE_HTML:{Wk(this,e);break}case I.BEFORE_HEAD:{Kk(this,e);break}case I.IN_HEAD:{yt(this,e);break}case I.IN_HEAD_NO_SCRIPT:{Jk(this,e);break}case I.AFTER_HEAD:{t4(this,e);break}case I.IN_BODY:{Ke(this,e);break}case I.IN_TABLE:{Fn(this,e);break}case I.IN_TABLE_TEXT:{sr(this,e);break}case I.IN_CAPTION:{Q4(this,e);break}case I.IN_COLUMN_GROUP:{to(this,e);break}case I.IN_TABLE_BODY:{Qi(this,e);break}case I.IN_ROW:{Xi(this,e);break}case I.IN_CELL:{eS(this,e);break}case I.IN_SELECT:{$f(this,e);break}case I.IN_SELECT_IN_TABLE:{nS(this,e);break}case I.IN_TEMPLATE:{iS(this,e);break}case I.AFTER_BODY:{aS(this,e);break}case I.IN_FRAMESET:{oS(this,e);break}case I.AFTER_FRAMESET:{lS(this,e);break}case I.AFTER_AFTER_BODY:{dS(this,e);break}case I.AFTER_AFTER_FRAMESET:{fS(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?gS(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case I.INITIAL:{ir(this,e);break}case I.BEFORE_HTML:{Gk(this,e);break}case I.BEFORE_HEAD:{Qk(this,e);break}case I.IN_HEAD:{Xk(this,e);break}case I.IN_HEAD_NO_SCRIPT:{e4(this,e);break}case I.AFTER_HEAD:{n4(this,e);break}case I.IN_BODY:{Ki(this,e);break}case I.TEXT:{U4(this,e);break}case I.IN_TABLE:{wr(this,e);break}case I.IN_TABLE_TEXT:{sr(this,e);break}case I.IN_CAPTION:{X4(this,e);break}case I.IN_COLUMN_GROUP:{J4(this,e);break}case I.IN_TABLE_BODY:{ca(this,e);break}case I.IN_ROW:{Hf(this,e);break}case I.IN_CELL:{tS(this,e);break}case I.IN_SELECT:{Zf(this,e);break}case I.IN_SELECT_IN_TABLE:{rS(this,e);break}case I.IN_TEMPLATE:{sS(this,e);break}case I.AFTER_BODY:{qf(this,e);break}case I.IN_FRAMESET:{uS(this,e);break}case I.AFTER_FRAMESET:{cS(this,e);break}case I.AFTER_AFTER_BODY:{mi(this,e);break}}}onEof(e){switch(this.insertionMode){case I.INITIAL:{ir(this,e);break}case I.BEFORE_HTML:{xr(this,e);break}case I.BEFORE_HEAD:{Tr(this,e);break}case I.IN_HEAD:{_r(this,e);break}case I.IN_HEAD_NO_SCRIPT:{yr(this,e);break}case I.AFTER_HEAD:{kr(this,e);break}case I.IN_BODY:case I.IN_TABLE:case I.IN_CAPTION:case I.IN_COLUMN_GROUP:case I.IN_TABLE_BODY:case I.IN_ROW:case I.IN_CELL:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:{Ff(this,e);break}case I.TEXT:{H4(this,e);break}case I.IN_TABLE_TEXT:{sr(this,e);break}case I.IN_TEMPLATE:{Yf(this,e);break}case I.AFTER_BODY:case I.IN_FRAMESET:case I.AFTER_FRAMESET:case I.AFTER_AFTER_BODY:case I.AFTER_AFTER_FRAMESET:{eo(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===k.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 I.IN_HEAD:case I.IN_HEAD_NO_SCRIPT:case I.AFTER_HEAD:case I.TEXT:case I.IN_COLUMN_GROUP:case I.IN_SELECT:case I.IN_SELECT_IN_TABLE:case I.IN_FRAMESET:case I.AFTER_FRAMESET:{this._insertCharacters(e);break}case I.IN_BODY:case I.IN_CAPTION:case I.IN_CELL:case I.IN_TEMPLATE:case I.AFTER_BODY:case I.AFTER_AFTER_BODY:case I.AFTER_AFTER_FRAMESET:{Lf(this,e);break}case I.IN_TABLE:case I.IN_TABLE_BODY:case I.IN_ROW:{As(this,e);break}case I.IN_TABLE_TEXT:{zf(this,e);break}}}}function zk(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):Bf(t,e),n}function jk(t,e){let n=null,r=t.openElements.stackTop;for(;r>=0;r--){const i=t.openElements.items[r];if(i===e.element)break;t._isSpecialElement(i,t.openElements.tagIDs[r])&&(n=i)}return n||(t.openElements.shortenToLength(Math.max(r,0)),t.activeFormattingElements.removeEntry(e)),n}function Uk(t,e,n){let r=e,i=t.openElements.getCommonAncestor(e);for(let s=0,a=i;a!==n;s++,a=i){i=t.openElements.getCommonAncestor(a);const o=t.activeFormattingElements.getElementEntry(a),u=o&&s>=Bk;!o||u?(u&&t.activeFormattingElements.removeEntry(o),t.openElements.remove(a)):(a=Hk(t,o),r===e&&(t.activeFormattingElements.bookmark=o),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(a,r),r=a)}return r}function Hk(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 $k(t,e,n){const r=t.treeAdapter.getTagName(e),i=qn(r);if(t._isElementCausesFosterParenting(i))t._fosterParentElement(n);else{const s=t.treeAdapter.getNamespaceURI(e);i===f.TEMPLATE&&s===$.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function Zk(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:i}=n,s=t.treeAdapter.createElement(i.tagName,r,i.attrs);t._adoptNodes(e,s),t.treeAdapter.appendChild(e,s),t.activeFormattingElements.insertElementAfterBookmark(s,i),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,s,i.tagID)}function Ja(t,e){for(let n=0;n<Mk;n++){const r=zk(t,e);if(!r)break;const i=jk(t,r);if(!i)break;t.activeFormattingElements.bookmark=r;const s=Uk(t,i,r.element),a=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(s),a&&$k(t,a,s),Zk(t,i,r)}}function la(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function Yk(t,e){t._appendCommentNode(e,t.openElements.items[0])}function qk(t,e){t._appendCommentNode(e,t.document)}function eo(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],i=t.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(t._setEndLocation(r,e),t.openElements.stackTop>=1)){const s=t.openElements.items[1],a=t.treeAdapter.getNodeSourceCodeLocation(s);a&&!a.endTag&&t._setEndLocation(s,e)}}}}function Vk(t,e){t._setDocumentType(e);const n=e.forceQuirks?gt.QUIRKS:kk(e);yk(e)||t._err(e,B.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=I.BEFORE_HTML}function ir(t,e){t._err(e,B.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,gt.QUIRKS),t.insertionMode=I.BEFORE_HTML,t._processToken(e)}function Wk(t,e){e.tagID===f.HTML?(t._insertElement(e,$.HTML),t.insertionMode=I.BEFORE_HEAD):xr(t,e)}function Gk(t,e){const n=e.tagID;(n===f.HTML||n===f.HEAD||n===f.BODY||n===f.BR)&&xr(t,e)}function xr(t,e){t._insertFakeRootElement(),t.insertionMode=I.BEFORE_HEAD,t._processToken(e)}function Kk(t,e){switch(e.tagID){case f.HTML:{Ke(t,e);break}case f.HEAD:{t._insertElement(e,$.HTML),t.headElement=t.openElements.current,t.insertionMode=I.IN_HEAD;break}default:Tr(t,e)}}function Qk(t,e){const n=e.tagID;n===f.HEAD||n===f.BODY||n===f.HTML||n===f.BR?Tr(t,e):t._err(e,B.endTagWithoutMatchingOpenElement)}function Tr(t,e){t._insertFakeElement(L.HEAD,f.HEAD),t.headElement=t.openElements.current,t.insertionMode=I.IN_HEAD,t._processToken(e)}function yt(t,e){switch(e.tagID){case f.HTML:{Ke(t,e);break}case f.BASE:case f.BASEFONT:case f.BGSOUND:case f.LINK:case f.META:{t._appendElement(e,$.HTML),e.ackSelfClosing=!0;break}case f.TITLE:{t._switchToTextParsing(e,Ue.RCDATA);break}case f.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,Ue.RAWTEXT):(t._insertElement(e,$.HTML),t.insertionMode=I.IN_HEAD_NO_SCRIPT);break}case f.NOFRAMES:case f.STYLE:{t._switchToTextParsing(e,Ue.RAWTEXT);break}case f.SCRIPT:{t._switchToTextParsing(e,Ue.SCRIPT_DATA);break}case f.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=I.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(I.IN_TEMPLATE);break}case f.HEAD:{t._err(e,B.misplacedStartTagForHeadElement);break}default:_r(t,e)}}function Xk(t,e){switch(e.tagID){case f.HEAD:{t.openElements.pop(),t.insertionMode=I.AFTER_HEAD;break}case f.BODY:case f.BR:case f.HTML:{_r(t,e);break}case f.TEMPLATE:{xn(t,e);break}default:t._err(e,B.endTagWithoutMatchingOpenElement)}}function xn(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==f.TEMPLATE&&t._err(e,B.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(f.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,B.endTagWithoutMatchingOpenElement)}function _r(t,e){t.openElements.pop(),t.insertionMode=I.AFTER_HEAD,t._processToken(e)}function Jk(t,e){switch(e.tagID){case f.HTML:{Ke(t,e);break}case f.BASEFONT:case f.BGSOUND:case f.HEAD:case f.LINK:case f.META:case f.NOFRAMES:case f.STYLE:{yt(t,e);break}case f.NOSCRIPT:{t._err(e,B.nestedNoscriptInHead);break}default:yr(t,e)}}function e4(t,e){switch(e.tagID){case f.NOSCRIPT:{t.openElements.pop(),t.insertionMode=I.IN_HEAD;break}case f.BR:{yr(t,e);break}default:t._err(e,B.endTagWithoutMatchingOpenElement)}}function yr(t,e){const n=e.type===be.EOF?B.openElementsLeftAfterEof:B.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=I.IN_HEAD,t._processToken(e)}function t4(t,e){switch(e.tagID){case f.HTML:{Ke(t,e);break}case f.BODY:{t._insertElement(e,$.HTML),t.framesetOk=!1,t.insertionMode=I.IN_BODY;break}case f.FRAMESET:{t._insertElement(e,$.HTML),t.insertionMode=I.IN_FRAMESET;break}case f.BASE:case f.BASEFONT:case f.BGSOUND:case f.LINK:case f.META:case f.NOFRAMES:case f.SCRIPT:case f.STYLE:case f.TEMPLATE:case f.TITLE:{t._err(e,B.abandonedHeadElementChild),t.openElements.push(t.headElement,f.HEAD),yt(t,e),t.openElements.remove(t.headElement);break}case f.HEAD:{t._err(e,B.misplacedStartTagForHeadElement);break}default:kr(t,e)}}function n4(t,e){switch(e.tagID){case f.BODY:case f.HTML:case f.BR:{kr(t,e);break}case f.TEMPLATE:{xn(t,e);break}default:t._err(e,B.endTagWithoutMatchingOpenElement)}}function kr(t,e){t._insertFakeElement(L.BODY,f.BODY),t.insertionMode=I.IN_BODY,Gi(t,e)}function Gi(t,e){switch(e.type){case be.CHARACTER:{Df(t,e);break}case be.WHITESPACE_CHARACTER:{Lf(t,e);break}case be.COMMENT:{la(t,e);break}case be.START_TAG:{Ke(t,e);break}case be.END_TAG:{Ki(t,e);break}case be.EOF:{Ff(t,e);break}}}function Lf(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function Df(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function r4(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function i4(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function s4(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,$.HTML),t.insertionMode=I.IN_FRAMESET)}function a4(t,e){t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._insertElement(e,$.HTML)}function o4(t,e){t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&ua.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,$.HTML)}function u4(t,e){t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._insertElement(e,$.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function l4(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._insertElement(e,$.HTML),n||(t.formElement=t.openElements.current))}function c4(t,e){t.framesetOk=!1;const n=e.tagID;for(let r=t.openElements.stackTop;r>=0;r--){const i=t.openElements.tagIDs[r];if(n===f.LI&&i===f.LI||(n===f.DD||n===f.DT)&&(i===f.DD||i===f.DT)){t.openElements.generateImpliedEndTagsWithExclusion(i),t.openElements.popUntilTagNamePopped(i);break}if(i!==f.ADDRESS&&i!==f.DIV&&i!==f.P&&t._isSpecialElement(t.openElements.items[r],i))break}t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._insertElement(e,$.HTML)}function d4(t,e){t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._insertElement(e,$.HTML),t.tokenizer.state=Ue.PLAINTEXT}function f4(t,e){t.openElements.hasInScope(f.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(f.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML),t.framesetOk=!1}function h4(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(L.A);n&&(Ja(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function p4(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function m4(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(f.NOBR)&&(Ja(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,$.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function g4(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function b4(t,e){t.treeAdapter.getDocumentMode(t.document)!==gt.QUIRKS&&t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._insertElement(e,$.HTML),t.framesetOk=!1,t.insertionMode=I.IN_TABLE}function Pf(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,$.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function Mf(t){const e=Sf(t,cn.TYPE);return e!=null&&e.toLowerCase()===Pk}function E4(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,$.HTML),Mf(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function x4(t,e){t._appendElement(e,$.HTML),e.ackSelfClosing=!0}function T4(t,e){t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._appendElement(e,$.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function _4(t,e){e.tagName=L.IMG,e.tagID=f.IMG,Pf(t,e)}function y4(t,e){t._insertElement(e,$.HTML),t.skipNextNewLine=!0,t.tokenizer.state=Ue.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=I.TEXT}function k4(t,e){t.openElements.hasInButtonScope(f.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,Ue.RAWTEXT)}function S4(t,e){t.framesetOk=!1,t._switchToTextParsing(e,Ue.RAWTEXT)}function il(t,e){t._switchToTextParsing(e,Ue.RAWTEXT)}function A4(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===I.IN_TABLE||t.insertionMode===I.IN_CAPTION||t.insertionMode===I.IN_TABLE_BODY||t.insertionMode===I.IN_ROW||t.insertionMode===I.IN_CELL?I.IN_SELECT_IN_TABLE:I.IN_SELECT}function C4(t,e){t.openElements.currentTagId===f.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML)}function I4(t,e){t.openElements.hasInScope(f.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,$.HTML)}function N4(t,e){t.openElements.hasInScope(f.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(f.RTC),t._insertElement(e,$.HTML)}function v4(t,e){t._reconstructActiveFormattingElements(),wf(e),Xa(e),e.selfClosing?t._appendElement(e,$.MATHML):t._insertElement(e,$.MATHML),e.ackSelfClosing=!0}function w4(t,e){t._reconstructActiveFormattingElements(),Rf(e),Xa(e),e.selfClosing?t._appendElement(e,$.SVG):t._insertElement(e,$.SVG),e.ackSelfClosing=!0}function sl(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,$.HTML)}function Ke(t,e){switch(e.tagID){case f.I:case f.S:case f.B:case f.U:case f.EM:case f.TT:case f.BIG:case f.CODE:case f.FONT:case f.SMALL:case f.STRIKE:case f.STRONG:{p4(t,e);break}case f.A:{h4(t,e);break}case f.H1:case f.H2:case f.H3:case f.H4:case f.H5:case f.H6:{o4(t,e);break}case f.P:case f.DL:case f.OL:case f.UL:case f.DIV:case f.DIR:case f.NAV:case f.MAIN:case f.MENU:case f.ASIDE:case f.CENTER:case f.FIGURE:case f.FOOTER:case f.HEADER:case f.HGROUP:case f.DIALOG:case f.DETAILS:case f.ADDRESS:case f.ARTICLE:case f.SEARCH:case f.SECTION:case f.SUMMARY:case f.FIELDSET:case f.BLOCKQUOTE:case f.FIGCAPTION:{a4(t,e);break}case f.LI:case f.DD:case f.DT:{c4(t,e);break}case f.BR:case f.IMG:case f.WBR:case f.AREA:case f.EMBED:case f.KEYGEN:{Pf(t,e);break}case f.HR:{T4(t,e);break}case f.RB:case f.RTC:{I4(t,e);break}case f.RT:case f.RP:{N4(t,e);break}case f.PRE:case f.LISTING:{u4(t,e);break}case f.XMP:{k4(t,e);break}case f.SVG:{w4(t,e);break}case f.HTML:{r4(t,e);break}case f.BASE:case f.LINK:case f.META:case f.STYLE:case f.TITLE:case f.SCRIPT:case f.BGSOUND:case f.BASEFONT:case f.TEMPLATE:{yt(t,e);break}case f.BODY:{i4(t,e);break}case f.FORM:{l4(t,e);break}case f.NOBR:{m4(t,e);break}case f.MATH:{v4(t,e);break}case f.TABLE:{b4(t,e);break}case f.INPUT:{E4(t,e);break}case f.PARAM:case f.TRACK:case f.SOURCE:{x4(t,e);break}case f.IMAGE:{_4(t,e);break}case f.BUTTON:{f4(t,e);break}case f.APPLET:case f.OBJECT:case f.MARQUEE:{g4(t,e);break}case f.IFRAME:{S4(t,e);break}case f.SELECT:{A4(t,e);break}case f.OPTION:case f.OPTGROUP:{C4(t,e);break}case f.NOEMBED:case f.NOFRAMES:{il(t,e);break}case f.FRAMESET:{s4(t,e);break}case f.TEXTAREA:{y4(t,e);break}case f.NOSCRIPT:{t.options.scriptingEnabled?il(t,e):sl(t,e);break}case f.PLAINTEXT:{d4(t,e);break}case f.COL:case f.TH:case f.TD:case f.TR:case f.HEAD:case f.FRAME:case f.TBODY:case f.TFOOT:case f.THEAD:case f.CAPTION:case f.COLGROUP:break;default:sl(t,e)}}function R4(t,e){if(t.openElements.hasInScope(f.BODY)&&(t.insertionMode=I.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function O4(t,e){t.openElements.hasInScope(f.BODY)&&(t.insertionMode=I.AFTER_BODY,qf(t,e))}function L4(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function D4(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(f.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(f.FORM):n&&t.openElements.remove(n))}function P4(t){t.openElements.hasInButtonScope(f.P)||t._insertFakeElement(L.P,f.P),t._closePElement()}function M4(t){t.openElements.hasInListItemScope(f.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(f.LI),t.openElements.popUntilTagNamePopped(f.LI))}function B4(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function F4(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function z4(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function j4(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(L.BR,f.BR),t.openElements.pop(),t.framesetOk=!1}function Bf(t,e){const n=e.tagName,r=e.tagID;for(let i=t.openElements.stackTop;i>0;i--){const s=t.openElements.items[i],a=t.openElements.tagIDs[i];if(r===a&&(r!==f.UNKNOWN||t.treeAdapter.getTagName(s)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=i&&t.openElements.shortenToLength(i);break}if(t._isSpecialElement(s,a))break}}function Ki(t,e){switch(e.tagID){case f.A:case f.B:case f.I:case f.S:case f.U:case f.EM:case f.TT:case f.BIG:case f.CODE:case f.FONT:case f.NOBR:case f.SMALL:case f.STRIKE:case f.STRONG:{Ja(t,e);break}case f.P:{P4(t);break}case f.DL:case f.UL:case f.OL:case f.DIR:case f.DIV:case f.NAV:case f.PRE:case f.MAIN:case f.MENU:case f.ASIDE:case f.BUTTON:case f.CENTER:case f.FIGURE:case f.FOOTER:case f.HEADER:case f.HGROUP:case f.DIALOG:case f.ADDRESS:case f.ARTICLE:case f.DETAILS:case f.SEARCH:case f.SECTION:case f.SUMMARY:case f.LISTING:case f.FIELDSET:case f.BLOCKQUOTE:case f.FIGCAPTION:{L4(t,e);break}case f.LI:{M4(t);break}case f.DD:case f.DT:{B4(t,e);break}case f.H1:case f.H2:case f.H3:case f.H4:case f.H5:case f.H6:{F4(t);break}case f.BR:{j4(t);break}case f.BODY:{R4(t,e);break}case f.HTML:{O4(t,e);break}case f.FORM:{D4(t);break}case f.APPLET:case f.OBJECT:case f.MARQUEE:{z4(t,e);break}case f.TEMPLATE:{xn(t,e);break}default:Bf(t,e)}}function Ff(t,e){t.tmplInsertionModeStack.length>0?Yf(t,e):eo(t,e)}function U4(t,e){var n;e.tagID===f.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function H4(t,e){t._err(e,B.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function As(t,e){if(t.openElements.currentTagId!==void 0&&Of.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=I.IN_TABLE_TEXT,e.type){case be.CHARACTER:{jf(t,e);break}case be.WHITESPACE_CHARACTER:{zf(t,e);break}}else Vr(t,e)}function $4(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,$.HTML),t.insertionMode=I.IN_CAPTION}function Z4(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,$.HTML),t.insertionMode=I.IN_COLUMN_GROUP}function Y4(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(L.COLGROUP,f.COLGROUP),t.insertionMode=I.IN_COLUMN_GROUP,to(t,e)}function q4(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,$.HTML),t.insertionMode=I.IN_TABLE_BODY}function V4(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(L.TBODY,f.TBODY),t.insertionMode=I.IN_TABLE_BODY,Qi(t,e)}function W4(t,e){t.openElements.hasInTableScope(f.TABLE)&&(t.openElements.popUntilTagNamePopped(f.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function G4(t,e){Mf(e)?t._appendElement(e,$.HTML):Vr(t,e),e.ackSelfClosing=!0}function K4(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,$.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function Fn(t,e){switch(e.tagID){case f.TD:case f.TH:case f.TR:{V4(t,e);break}case f.STYLE:case f.SCRIPT:case f.TEMPLATE:{yt(t,e);break}case f.COL:{Y4(t,e);break}case f.FORM:{K4(t,e);break}case f.TABLE:{W4(t,e);break}case f.TBODY:case f.TFOOT:case f.THEAD:{q4(t,e);break}case f.INPUT:{G4(t,e);break}case f.CAPTION:{$4(t,e);break}case f.COLGROUP:{Z4(t,e);break}default:Vr(t,e)}}function wr(t,e){switch(e.tagID){case f.TABLE:{t.openElements.hasInTableScope(f.TABLE)&&(t.openElements.popUntilTagNamePopped(f.TABLE),t._resetInsertionMode());break}case f.TEMPLATE:{xn(t,e);break}case f.BODY:case f.CAPTION:case f.COL:case f.COLGROUP:case f.HTML:case f.TBODY:case f.TD:case f.TFOOT:case f.TH:case f.THEAD:case f.TR:break;default:Vr(t,e)}}function Vr(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,Gi(t,e),t.fosterParentingEnabled=n}function zf(t,e){t.pendingCharacterTokens.push(e)}function jf(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function sr(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)Vr(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const Uf=new Set([f.CAPTION,f.COL,f.COLGROUP,f.TBODY,f.TD,f.TFOOT,f.TH,f.THEAD,f.TR]);function Q4(t,e){const n=e.tagID;Uf.has(n)?t.openElements.hasInTableScope(f.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(f.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=I.IN_TABLE,Fn(t,e)):Ke(t,e)}function X4(t,e){const n=e.tagID;switch(n){case f.CAPTION:case f.TABLE:{t.openElements.hasInTableScope(f.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(f.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=I.IN_TABLE,n===f.TABLE&&wr(t,e));break}case f.BODY:case f.COL:case f.COLGROUP:case f.HTML:case f.TBODY:case f.TD:case f.TFOOT:case f.TH:case f.THEAD:case f.TR:break;default:Ki(t,e)}}function to(t,e){switch(e.tagID){case f.HTML:{Ke(t,e);break}case f.COL:{t._appendElement(e,$.HTML),e.ackSelfClosing=!0;break}case f.TEMPLATE:{yt(t,e);break}default:vi(t,e)}}function J4(t,e){switch(e.tagID){case f.COLGROUP:{t.openElements.currentTagId===f.COLGROUP&&(t.openElements.pop(),t.insertionMode=I.IN_TABLE);break}case f.TEMPLATE:{xn(t,e);break}case f.COL:break;default:vi(t,e)}}function vi(t,e){t.openElements.currentTagId===f.COLGROUP&&(t.openElements.pop(),t.insertionMode=I.IN_TABLE,t._processToken(e))}function Qi(t,e){switch(e.tagID){case f.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,$.HTML),t.insertionMode=I.IN_ROW;break}case f.TH:case f.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(L.TR,f.TR),t.insertionMode=I.IN_ROW,Xi(t,e);break}case f.CAPTION:case f.COL:case f.COLGROUP:case f.TBODY:case f.TFOOT:case f.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE,Fn(t,e));break}default:Fn(t,e)}}function ca(t,e){const n=e.tagID;switch(e.tagID){case f.TBODY:case f.TFOOT:case f.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE);break}case f.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE,wr(t,e));break}case f.BODY:case f.CAPTION:case f.COL:case f.COLGROUP:case f.HTML:case f.TD:case f.TH:case f.TR:break;default:wr(t,e)}}function Xi(t,e){switch(e.tagID){case f.TH:case f.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,$.HTML),t.insertionMode=I.IN_CELL,t.activeFormattingElements.insertMarker();break}case f.CAPTION:case f.COL:case f.COLGROUP:case f.TBODY:case f.TFOOT:case f.THEAD:case f.TR:{t.openElements.hasInTableScope(f.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE_BODY,Qi(t,e));break}default:Fn(t,e)}}function Hf(t,e){switch(e.tagID){case f.TR:{t.openElements.hasInTableScope(f.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE_BODY);break}case f.TABLE:{t.openElements.hasInTableScope(f.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE_BODY,ca(t,e));break}case f.TBODY:case f.TFOOT:case f.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(f.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=I.IN_TABLE_BODY,ca(t,e));break}case f.BODY:case f.CAPTION:case f.COL:case f.COLGROUP:case f.HTML:case f.TD:case f.TH:break;default:wr(t,e)}}function eS(t,e){const n=e.tagID;Uf.has(n)?(t.openElements.hasInTableScope(f.TD)||t.openElements.hasInTableScope(f.TH))&&(t._closeTableCell(),Xi(t,e)):Ke(t,e)}function tS(t,e){const n=e.tagID;switch(n){case f.TD:case f.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=I.IN_ROW);break}case f.TABLE:case f.TBODY:case f.TFOOT:case f.THEAD:case f.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),Hf(t,e));break}case f.BODY:case f.CAPTION:case f.COL:case f.COLGROUP:case f.HTML:break;default:Ki(t,e)}}function $f(t,e){switch(e.tagID){case f.HTML:{Ke(t,e);break}case f.OPTION:{t.openElements.currentTagId===f.OPTION&&t.openElements.pop(),t._insertElement(e,$.HTML);break}case f.OPTGROUP:{t.openElements.currentTagId===f.OPTION&&t.openElements.pop(),t.openElements.currentTagId===f.OPTGROUP&&t.openElements.pop(),t._insertElement(e,$.HTML);break}case f.HR:{t.openElements.currentTagId===f.OPTION&&t.openElements.pop(),t.openElements.currentTagId===f.OPTGROUP&&t.openElements.pop(),t._appendElement(e,$.HTML),e.ackSelfClosing=!0;break}case f.INPUT:case f.KEYGEN:case f.TEXTAREA:case f.SELECT:{t.openElements.hasInSelectScope(f.SELECT)&&(t.openElements.popUntilTagNamePopped(f.SELECT),t._resetInsertionMode(),e.tagID!==f.SELECT&&t._processStartTag(e));break}case f.SCRIPT:case f.TEMPLATE:{yt(t,e);break}}}function Zf(t,e){switch(e.tagID){case f.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===f.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===f.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===f.OPTGROUP&&t.openElements.pop();break}case f.OPTION:{t.openElements.currentTagId===f.OPTION&&t.openElements.pop();break}case f.SELECT:{t.openElements.hasInSelectScope(f.SELECT)&&(t.openElements.popUntilTagNamePopped(f.SELECT),t._resetInsertionMode());break}case f.TEMPLATE:{xn(t,e);break}}}function nS(t,e){const n=e.tagID;n===f.CAPTION||n===f.TABLE||n===f.TBODY||n===f.TFOOT||n===f.THEAD||n===f.TR||n===f.TD||n===f.TH?(t.openElements.popUntilTagNamePopped(f.SELECT),t._resetInsertionMode(),t._processStartTag(e)):$f(t,e)}function rS(t,e){const n=e.tagID;n===f.CAPTION||n===f.TABLE||n===f.TBODY||n===f.TFOOT||n===f.THEAD||n===f.TR||n===f.TD||n===f.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(f.SELECT),t._resetInsertionMode(),t.onEndTag(e)):Zf(t,e)}function iS(t,e){switch(e.tagID){case f.BASE:case f.BASEFONT:case f.BGSOUND:case f.LINK:case f.META:case f.NOFRAMES:case f.SCRIPT:case f.STYLE:case f.TEMPLATE:case f.TITLE:{yt(t,e);break}case f.CAPTION:case f.COLGROUP:case f.TBODY:case f.TFOOT:case f.THEAD:{t.tmplInsertionModeStack[0]=I.IN_TABLE,t.insertionMode=I.IN_TABLE,Fn(t,e);break}case f.COL:{t.tmplInsertionModeStack[0]=I.IN_COLUMN_GROUP,t.insertionMode=I.IN_COLUMN_GROUP,to(t,e);break}case f.TR:{t.tmplInsertionModeStack[0]=I.IN_TABLE_BODY,t.insertionMode=I.IN_TABLE_BODY,Qi(t,e);break}case f.TD:case f.TH:{t.tmplInsertionModeStack[0]=I.IN_ROW,t.insertionMode=I.IN_ROW,Xi(t,e);break}default:t.tmplInsertionModeStack[0]=I.IN_BODY,t.insertionMode=I.IN_BODY,Ke(t,e)}}function sS(t,e){e.tagID===f.TEMPLATE&&xn(t,e)}function Yf(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(f.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):eo(t,e)}function aS(t,e){e.tagID===f.HTML?Ke(t,e):wi(t,e)}function qf(t,e){var n;if(e.tagID===f.HTML){if(t.fragmentContext||(t.insertionMode=I.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===f.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 wi(t,e)}function wi(t,e){t.insertionMode=I.IN_BODY,Gi(t,e)}function oS(t,e){switch(e.tagID){case f.HTML:{Ke(t,e);break}case f.FRAMESET:{t._insertElement(e,$.HTML);break}case f.FRAME:{t._appendElement(e,$.HTML),e.ackSelfClosing=!0;break}case f.NOFRAMES:{yt(t,e);break}}}function uS(t,e){e.tagID===f.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==f.FRAMESET&&(t.insertionMode=I.AFTER_FRAMESET))}function lS(t,e){switch(e.tagID){case f.HTML:{Ke(t,e);break}case f.NOFRAMES:{yt(t,e);break}}}function cS(t,e){e.tagID===f.HTML&&(t.insertionMode=I.AFTER_AFTER_FRAMESET)}function dS(t,e){e.tagID===f.HTML?Ke(t,e):mi(t,e)}function mi(t,e){t.insertionMode=I.IN_BODY,Gi(t,e)}function fS(t,e){switch(e.tagID){case f.HTML:{Ke(t,e);break}case f.NOFRAMES:{yt(t,e);break}}}function hS(t,e){e.chars=Me,t._insertCharacters(e)}function pS(t,e){t._insertCharacters(e),t.framesetOk=!1}function Vf(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==$.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function mS(t,e){if(wk(e))Vf(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===$.MATHML?wf(e):r===$.SVG&&(Rk(e),Rf(e)),Xa(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function gS(t,e){if(e.tagID===f.P||e.tagID===f.BR){Vf(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)===$.HTML){t._endTagOutsideForeignContent(e);break}const i=t.treeAdapter.getTagName(r);if(i.toLowerCase()===e.tagName){e.tagName=i,t.openElements.shortenToLength(n);break}}}L.AREA,L.BASE,L.BASEFONT,L.BGSOUND,L.BR,L.COL,L.EMBED,L.FRAME,L.HR,L.IMG,L.INPUT,L.KEYGEN,L.LINK,L.META,L.PARAM,L.SOURCE,L.TRACK,L.WBR;const bS=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,ES=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),al={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Wf(t,e){const n=NS(t),r=xf("type",{handlers:{root:xS,element:TS,text:_S,comment:Kf,doctype:yS,raw:SS},unknown:AS}),i={parser:n?new rl(al):rl.getFragmentParser(void 0,al),handle(o){r(o,i)},stitches:!1,options:e||{}};r(t,i),Vn(i,vt());const s=n?i.parser.document:i.parser.getFragment(),a=vy(s,{file:i.options.file});return i.stitches&&Wi(a,"comment",function(o,u,l){const d=o;if(d.value.stitch&&l&&u!==void 0){const c=l.children;return c[u]=d.value.stitch,u}}),a.type==="root"&&a.children.length===1&&a.children[0].type===t.type?a.children[0]:a}function Gf(t,e){let n=-1;if(t)for(;++n<t.length;)e.handle(t[n])}function xS(t,e){Gf(t.children,e)}function TS(t,e){CS(t,e),Gf(t.children,e),IS(t,e)}function _S(t,e){e.parser.tokenizer.state>4&&(e.parser.tokenizer.state=0);const n={type:be.CHARACTER,chars:t.value,location:Wr(t)};Vn(e,vt(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function yS(t,e){const n={type:be.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Wr(t)};Vn(e,vt(t)),e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)}function kS(t,e){e.stitches=!0;const n=vS(t);if("children"in t&&"children"in n){const r=Wf({type:"root",children:t.children},e.options);n.children=r.children}Kf({type:"comment",value:{stitch:n}},e)}function Kf(t,e){const n=t.value,r={type:be.COMMENT,data:n,location:Wr(t)};Vn(e,vt(t)),e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken)}function SS(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,Qf(e,vt(t)),e.parser.tokenizer.write(e.options.tagfilter?t.value.replace(bS,"<$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 AS(t,e){const n=t;if(e.options.passThrough&&e.options.passThrough.includes(n.type))kS(n,e);else{let r="";throw ES.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 Vn(t,e){Qf(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=Ue.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 Qf(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 CS(t,e){const n=t.tagName.toLowerCase();if(e.parser.tokenizer.state===Ue.PLAINTEXT)return;Vn(e,vt(t));const r=e.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:ln.html;i===ln.html&&n==="svg"&&(i=ln.svg);const s=Dy({...t,children:[]},{space:i===ln.svg?"svg":"html"}),a={type:be.START_TAG,tagName:n,tagID:qn(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in s?s.attrs:[],location:Wr(t)};e.parser.currentToken=a,e.parser._processToken(e.parser.currentToken),e.parser.tokenizer.lastStartTagName=n}function IS(t,e){const n=t.tagName.toLowerCase();if(!e.parser.tokenizer.inForeignNode&&Hy.includes(n)||e.parser.tokenizer.state===Ue.PLAINTEXT)return;Vn(e,Hi(t));const r={type:be.END_TAG,tagName:n,tagID:qn(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Wr(t)};e.parser.currentToken=r,e.parser._processToken(e.parser.currentToken),n===e.parser.tokenizer.lastStartTagName&&(e.parser.tokenizer.state===Ue.RCDATA||e.parser.tokenizer.state===Ue.RAWTEXT||e.parser.tokenizer.state===Ue.SCRIPT_DATA)&&(e.parser.tokenizer.state=Ue.DATA)}function NS(t){const e=t.type==="root"?t.children[0]:t;return!!(e&&(e.type==="doctype"||e.type==="element"&&e.tagName.toLowerCase()==="html"))}function Wr(t){const e=vt(t)||{line:void 0,column:void 0,offset:void 0},n=Hi(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 vS(t){return"children"in t?Bn({...t,children:[]}):Bn(t)}function wS(t){return function(e,n){return Wf(e,{...t,file:n})}}function ol(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function RS(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function OS(t,e,n){const i=qi((n||{}).ignore||[]),s=LS(e);let a=-1;for(;++a<s.length;)pf(t,"text",o);function o(l,d){let c=-1,h;for(;++c<d.length;){const m=d[c],g=h?h.children:void 0;if(i(m,g?g.indexOf(m):void 0,h))return;h=m}if(h)return u(l,d)}function u(l,d){const c=d[d.length-1],h=s[a][0],m=s[a][1];let g=0;const T=c.children.indexOf(l);let x=!1,_=[];h.lastIndex=0;let b=h.exec(l.value);for(;b;){const C=b.index,w={index:b.index,input:b.input,stack:[...d,l]};let y=m(...b,w);if(typeof y=="string"&&(y=y.length>0?{type:"text",value:y}:void 0),y===!1?h.lastIndex=C+1:(g!==C&&_.push({type:"text",value:l.value.slice(g,C)}),Array.isArray(y)?_.push(...y):y&&_.push(y),g=C+b[0].length,x=!0),!h.global)break;b=h.exec(l.value)}return x?(g<l.value.length&&_.push({type:"text",value:l.value.slice(g)}),c.children.splice(T,1,..._)):_=[l],T+_.length}}function LS(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 i=n[r];e.push([DS(i[0]),PS(i[1])])}return e}function DS(t){return typeof t=="string"?new RegExp(RS(t),"g"):t}function PS(t){return typeof t=="function"?t:function(){return t}}const Cs="phrasing",Is=["autolink","link","image","label"];function MS(){return{transforms:[$S],enter:{literalAutolink:FS,literalAutolinkEmail:Ns,literalAutolinkHttp:Ns,literalAutolinkWww:Ns},exit:{literalAutolink:HS,literalAutolinkEmail:US,literalAutolinkHttp:zS,literalAutolinkWww:jS}}}function BS(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Cs,notInConstruct:Is},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Cs,notInConstruct:Is},{character:":",before:"[ps]",after:"\\/",inConstruct:Cs,notInConstruct:Is}]}}function FS(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Ns(t){this.config.enter.autolinkProtocol.call(this,t)}function zS(t){this.config.exit.autolinkProtocol.call(this,t)}function jS(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 US(t){this.config.exit.autolinkEmail.call(this,t)}function HS(t){this.exit(t)}function $S(t){OS(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ZS],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),YS]],{ignore:["link","linkReference"]})}function ZS(t,e,n,r,i){let s="";if(!Xf(i)||(/^w/i.test(e)&&(n=e+n,e="",s="http://"),!qS(n)))return!1;const a=VS(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:s+e+a[0],children:[{type:"text",value:e+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function YS(t,e,n,r){return!Xf(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function qS(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 VS(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 i=ol(t,"(");let s=ol(t,")");for(;r!==-1&&i>s;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[t,n]}function Xf(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||mn(n)||$i(n))&&(!e||n!==47)}Jf.peek=nA;function WS(){this.buffer()}function GS(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function KS(){this.buffer()}function QS(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function XS(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tt(this.sliceSerialize(t)).toLowerCase(),n.label=e}function JS(t){this.exit(t)}function eA(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tt(this.sliceSerialize(t)).toLowerCase(),n.label=e}function tA(t){this.exit(t)}function nA(){return"["}function Jf(t,e,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return s+=i.move(n.safe(n.associationId(t),{after:"]",before:s})),o(),a(),s+=i.move("]"),s}function rA(){return{enter:{gfmFootnoteCallString:WS,gfmFootnoteCall:GS,gfmFootnoteDefinitionLabelString:KS,gfmFootnoteDefinition:QS},exit:{gfmFootnoteCallString:XS,gfmFootnoteCall:JS,gfmFootnoteDefinitionLabelString:eA,gfmFootnoteDefinition:tA}}}function iA(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:Jf},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const o=s.createTracker(a);let u=o.move("[^");const l=s.enter("footnoteDefinition"),d=s.enter("label");return u+=o.move(s.safe(s.associationId(r),{before:u,after:"]"})),d(),u+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),u+=o.move((e?`
|
|
109
|
-
`:" ")+s.indentLines(s.containerFlow(r,o.current()),e?eh:sA))),l(),u}}function sA(t,e,n){return e===0?t:eh(t,e,n)}function eh(t,e,n){return(n?"":" ")+t}const aA=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];th.peek=dA;function oA(){return{canContainEols:["delete"],enter:{strikethrough:lA},exit:{strikethrough:cA}}}function uA(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:aA}],handlers:{delete:th}}}function lA(t){this.enter({type:"delete",children:[]},t)}function cA(t){this.exit(t)}function th(t,e,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(t,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function dA(){return"~"}function fA(t){return t.length}function hA(t,e){const n=e||{},r=(n.align||[]).concat(),i=n.stringLength||fA,s=[],a=[],o=[],u=[];let l=0,d=-1;for(;++d<t.length;){const E=[],T=[];let x=-1;for(t[d].length>l&&(l=t[d].length);++x<t[d].length;){const _=pA(t[d][x]);if(n.alignDelimiters!==!1){const b=i(_);T[x]=b,(u[x]===void 0||b>u[x])&&(u[x]=b)}E.push(_)}a[d]=E,o[d]=T}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<l;)s[c]=ul(r[c]);else{const E=ul(r);for(;++c<l;)s[c]=E}c=-1;const h=[],m=[];for(;++c<l;){const E=s[c];let T="",x="";E===99?(T=":",x=":"):E===108?T=":":E===114&&(x=":");let _=n.alignDelimiters===!1?1:Math.max(1,u[c]-T.length-x.length);const b=T+"-".repeat(_)+x;n.alignDelimiters!==!1&&(_=T.length+_+x.length,_>u[c]&&(u[c]=_),m[c]=_),h[c]=b}a.splice(1,0,h),o.splice(1,0,m),d=-1;const g=[];for(;++d<a.length;){const E=a[d],T=o[d];c=-1;const x=[];for(;++c<l;){const _=E[c]||"";let b="",C="";if(n.alignDelimiters!==!1){const w=u[c]-(T[c]||0),y=s[c];y===114?b=" ".repeat(w):y===99?w%2?(b=" ".repeat(w/2+.5),C=" ".repeat(w/2-.5)):(b=" ".repeat(w/2),C=b):C=" ".repeat(w)}n.delimiterStart!==!1&&!c&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&_==="")&&(n.delimiterStart!==!1||c)&&x.push(" "),n.alignDelimiters!==!1&&x.push(b),x.push(_),n.alignDelimiters!==!1&&x.push(C),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||c!==l-1)&&x.push("|")}g.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return g.join(`
|
|
110
|
-
`)}function pA(t){return t==null?"":String(t)}function ul(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 mA(t,e,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(t,s.current()),gA);return i(),a}function gA(t,e,n){return">"+(n?"":" ")+t}function bA(t,e){return ll(t,e.inConstruct,!0)&&!ll(t,e.notInConstruct,!1)}function ll(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 cl(t,e,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
111
|
-
`&&bA(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
112
|
-
`}function EA(t,e){const n=String(t);let r=n.indexOf(e),i=r,s=0,a=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>a&&(a=s):s=1,i=r+e.length,r=n.indexOf(e,i);return a}function xA(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 TA(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 _A(t,e,n,r){const i=TA(n),s=t.value||"",a=i==="`"?"GraveAccent":"Tilde";if(xA(t,n)){const c=n.enter("codeIndented"),h=n.indentLines(s,yA);return c(),h}const o=n.createTracker(r),u=i.repeat(Math.max(EA(s,i)+1,3)),l=n.enter("codeFenced");let d=o.move(u);if(t.lang){const c=n.enter(`codeFencedLang${a}`);d+=o.move(n.safe(t.lang,{before:d,after:" ",encode:["`"],...o.current()})),c()}if(t.lang&&t.meta){const c=n.enter(`codeFencedMeta${a}`);d+=o.move(" "),d+=o.move(n.safe(t.meta,{before:d,after:`
|
|
113
|
-
`,encode:["`"],...o.current()})),c()}return d+=o.move(`
|
|
114
|
-
`),s&&(d+=o.move(s+`
|
|
115
|
-
`)),d+=o.move(u),l(),d}function yA(t,e,n){return(n?"":" ")+t}function no(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 kA(t,e,n,r){const i=no(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const u=n.createTracker(r);let l=u.move("[");return l+=u.move(n.safe(n.associationId(t),{before:l,after:"]",...u.current()})),l+=u.move("]: "),o(),!t.url||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(n.safe(t.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(o=n.enter("destinationRaw"),l+=u.move(n.safe(t.url,{before:l,after:t.title?" ":`
|
|
116
|
-
`,...u.current()}))),o(),t.title&&(o=n.enter(`title${s}`),l+=u.move(" "+i),l+=u.move(n.safe(t.title,{before:l,after:i,...u.current()})),l+=u.move(i),o()),a(),l}function SA(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 Rr(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Ri(t,e,n){const r=Mn(t),i=Mn(e);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}nh.peek=AA;function nh(t,e,n,r){const i=SA(n),s=n.enter("emphasis"),a=n.createTracker(r),o=a.move(i);let u=a.move(n.containerPhrasing(t,{after:i,before:o,...a.current()}));const l=u.charCodeAt(0),d=Ri(r.before.charCodeAt(r.before.length-1),l,i);d.inside&&(u=Rr(l)+u.slice(1));const c=u.charCodeAt(u.length-1),h=Ri(r.after.charCodeAt(0),c,i);h.inside&&(u=u.slice(0,-1)+Rr(c));const m=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+u+m}function AA(t,e,n){return n.options.emphasis||"*"}function CA(t,e){let n=!1;return Wi(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,na}),!!((!t.depth||t.depth<3)&&Ha(t)&&(e.options.setext||n))}function IA(t,e,n,r){const i=Math.max(Math.min(6,t.depth||1),1),s=n.createTracker(r);if(CA(t,n)){const d=n.enter("headingSetext"),c=n.enter("phrasing"),h=n.containerPhrasing(t,{...s.current(),before:`
|
|
117
|
-
`,after:`
|
|
118
|
-
`});return c(),d(),h+`
|
|
119
|
-
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
120
|
-
`))+1))}const a="#".repeat(i),o=n.enter("headingAtx"),u=n.enter("phrasing");s.move(a+" ");let l=n.containerPhrasing(t,{before:"# ",after:`
|
|
121
|
-
`,...s.current()});return/^[\t ]/.test(l)&&(l=Rr(l.charCodeAt(0))+l.slice(1)),l=l?a+" "+l:a,n.options.closeAtx&&(l+=" "+a),u(),o(),l}rh.peek=NA;function rh(t){return t.value||""}function NA(){return"<"}ih.peek=vA;function ih(t,e,n,r){const i=no(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const u=n.createTracker(r);let l=u.move("![");return l+=u.move(n.safe(t.alt,{before:l,after:"]",...u.current()})),l+=u.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=n.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(n.safe(t.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(o=n.enter("destinationRaw"),l+=u.move(n.safe(t.url,{before:l,after:t.title?" ":")",...u.current()}))),o(),t.title&&(o=n.enter(`title${s}`),l+=u.move(" "+i),l+=u.move(n.safe(t.title,{before:l,after:i,...u.current()})),l+=u.move(i),o()),l+=u.move(")"),a(),l}function vA(){return"!"}sh.peek=wA;function sh(t,e,n,r){const i=t.referenceType,s=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let u=o.move("![");const l=n.safe(t.alt,{before:u,after:"]",...o.current()});u+=o.move(l+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(t),{before:u,after:"]",...o.current()});return a(),n.stack=d,s(),i==="full"||!l||l!==c?u+=o.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function wA(){return"!"}ah.peek=RA;function ah(t,e,n){let r=t.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const a=n.unsafe[s],o=n.compilePattern(a);let u;if(a.atBreak)for(;u=o.exec(r);){let l=u.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(u.index+1)}}return i+r+i}function RA(){return"`"}function oh(t,e){const n=Ha(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))}uh.peek=OA;function uh(t,e,n,r){const i=no(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,u;if(oh(t,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let c=a.move("<");return c+=a.move(n.containerPhrasing(t,{before:c,after:">",...a.current()})),c+=a.move(">"),o(),n.stack=d,c}o=n.enter("link"),u=n.enter("label");let l=a.move("[");return l+=a.move(n.containerPhrasing(t,{before:l,after:"](",...a.current()})),l+=a.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),l+=a.move("<"),l+=a.move(n.safe(t.url,{before:l,after:">",...a.current()})),l+=a.move(">")):(u=n.enter("destinationRaw"),l+=a.move(n.safe(t.url,{before:l,after:t.title?" ":")",...a.current()}))),u(),t.title&&(u=n.enter(`title${s}`),l+=a.move(" "+i),l+=a.move(n.safe(t.title,{before:l,after:i,...a.current()})),l+=a.move(i),u()),l+=a.move(")"),o(),l}function OA(t,e,n){return oh(t,n)?"<":"["}lh.peek=LA;function lh(t,e,n,r){const i=t.referenceType,s=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let u=o.move("[");const l=n.containerPhrasing(t,{before:u,after:"]",...o.current()});u+=o.move(l+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const c=n.safe(n.associationId(t),{before:u,after:"]",...o.current()});return a(),n.stack=d,s(),i==="full"||!l||l!==c?u+=o.move(c+"]"):i==="shortcut"?u=u.slice(0,-1):u+=o.move("]"),u}function LA(){return"["}function ro(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 DA(t){const e=ro(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 PA(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 ch(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 MA(t,e,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=t.ordered?PA(n):ro(n);const o=t.ordered?a==="."?")":".":DA(n);let u=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&&(u=!0),ch(n)===a&&d){let c=-1;for(;++c<t.children.length;){const h=t.children[c];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(a=o),n.bulletCurrent=a;const l=n.containerFlow(t,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),l}function BA(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 FA(t,e,n,r){const i=BA(n);let s=n.bulletCurrent||ro(n);e&&e.type==="list"&&e.ordered&&(s=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(s+" ".repeat(a-s.length)),o.shift(a);const u=n.enter("listItem"),l=n.indentLines(n.containerFlow(t,o.current()),d);return u(),l;function d(c,h,m){return h?(m?"":" ".repeat(a))+c:(m?s:s+" ".repeat(a-s.length))+c}}function zA(t,e,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(t,r);return s(),i(),a}const jA=qi(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function UA(t,e,n,r){return(t.children.some(function(a){return jA(a)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function HA(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}dh.peek=$A;function dh(t,e,n,r){const i=HA(n),s=n.enter("strong"),a=n.createTracker(r),o=a.move(i+i);let u=a.move(n.containerPhrasing(t,{after:i,before:o,...a.current()}));const l=u.charCodeAt(0),d=Ri(r.before.charCodeAt(r.before.length-1),l,i);d.inside&&(u=Rr(l)+u.slice(1));const c=u.charCodeAt(u.length-1),h=Ri(r.after.charCodeAt(0),c,i);h.inside&&(u=u.slice(0,-1)+Rr(c));const m=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:h.outside,before:d.outside},o+u+m}function $A(t,e,n){return n.options.strong||"*"}function ZA(t,e,n,r){return n.safe(t.value,r)}function YA(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 qA(t,e,n){const r=(ch(n)+(n.options.ruleSpaces?" ":"")).repeat(YA(n));return n.options.ruleSpaces?r.slice(0,-1):r}const fh={blockquote:mA,break:cl,code:_A,definition:kA,emphasis:nh,hardBreak:cl,heading:IA,html:rh,image:ih,imageReference:sh,inlineCode:ah,link:uh,linkReference:lh,list:MA,listItem:FA,paragraph:zA,root:UA,strong:dh,text:ZA,thematicBreak:qA};function VA(){return{enter:{table:WA,tableData:dl,tableHeader:dl,tableRow:KA},exit:{codeText:QA,table:GA,tableData:vs,tableHeader:vs,tableRow:vs}}}function WA(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 GA(t){this.exit(t),this.data.inTable=void 0}function KA(t){this.enter({type:"tableRow",children:[]},t)}function vs(t){this.exit(t)}function dl(t){this.enter({type:"tableCell",children:[]},t)}function QA(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,XA));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function XA(t,e){return e==="|"?e:t}function JA(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
122
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:a,tableCell:u,tableRow:o}};function a(m,g,E,T){return l(d(m,E,T),m.align)}function o(m,g,E,T){const x=c(m,E,T),_=l([x]);return _.slice(0,_.indexOf(`
|
|
123
|
-
`))}function u(m,g,E,T){const x=E.enter("tableCell"),_=E.enter("phrasing"),b=E.containerPhrasing(m,{...T,before:s,after:s});return _(),x(),b}function l(m,g){return hA(m,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function d(m,g,E){const T=m.children;let x=-1;const _=[],b=g.enter("table");for(;++x<T.length;)_[x]=c(T[x],g,E);return b(),_}function c(m,g,E){const T=m.children;let x=-1;const _=[],b=g.enter("tableRow");for(;++x<T.length;)_[x]=u(T[x],m,g,E);return b(),_}function h(m,g,E){let T=fh.inlineCode(m,g,E);return E.stack.includes("tableCell")&&(T=T.replace(/\|/g,"\\$&")),T}}function eC(){return{exit:{taskListCheckValueChecked:fl,taskListCheckValueUnchecked:fl,paragraph:nC}}}function tC(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:rC}}}function fl(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function nC(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 i=e.children;let s=-1,a;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){a=o;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 rC(t,e,n,r){const i=t.children[0],s=typeof t.checked=="boolean"&&i&&i.type==="paragraph",a="["+(t.checked?"x":" ")+"] ",o=n.createTracker(r);s&&o.move(a);let u=fh.listItem(t,e,n,{...r,...o.current()});return s&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),u;function l(d){return d+a}}function iC(){return[MS(),rA(),oA(),VA(),eC()]}function sC(t){return{extensions:[BS(),iA(t),uA(),JA(t),tC()]}}const aC={tokenize:fC,partial:!0},hh={tokenize:hC,partial:!0},ph={tokenize:pC,partial:!0},mh={tokenize:mC,partial:!0},oC={tokenize:gC,partial:!0},gh={name:"wwwAutolink",tokenize:cC,previous:Eh},bh={name:"protocolAutolink",tokenize:dC,previous:xh},Bt={name:"emailAutolink",tokenize:lC,previous:Th},wt={};function uC(){return{text:wt}}let nn=48;for(;nn<123;)wt[nn]=Bt,nn++,nn===58?nn=65:nn===91&&(nn=97);wt[43]=Bt;wt[45]=Bt;wt[46]=Bt;wt[95]=Bt;wt[72]=[Bt,bh];wt[104]=[Bt,bh];wt[87]=[Bt,gh];wt[119]=[Bt,gh];function lC(t,e,n){const r=this;let i,s;return a;function a(c){return!da(c)||!Th.call(r,r.previous)||io(r.events)?n(c):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),o(c))}function o(c){return da(c)?(t.consume(c),o):c===64?(t.consume(c),u):n(c)}function u(c){return c===46?t.check(oC,d,l)(c):c===45||c===95||We(c)?(s=!0,t.consume(c),u):d(c)}function l(c){return t.consume(c),i=!0,u}function d(c){return s&&i&&Je(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(c)):n(c)}}function cC(t,e,n){const r=this;return i;function i(a){return a!==87&&a!==119||!Eh.call(r,r.previous)||io(r.events)?n(a):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(aC,t.attempt(hh,t.attempt(ph,s),n),n)(a))}function s(a){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(a)}}function dC(t,e,n){const r=this;let i="",s=!1;return a;function a(c){return(c===72||c===104)&&xh.call(r,r.previous)&&!io(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),t.consume(c),o):n(c)}function o(c){if(Je(c)&&i.length<5)return i+=String.fromCodePoint(c),t.consume(c),o;if(c===58){const h=i.toLowerCase();if(h==="http"||h==="https")return t.consume(c),u}return n(c)}function u(c){return c===47?(t.consume(c),s?l:(s=!0,u)):n(c)}function l(c){return c===null||Ci(c)||ve(c)||mn(c)||$i(c)?n(c):t.attempt(hh,t.attempt(ph,d),n)(c)}function d(c){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(c)}}function fC(t,e,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,t.consume(a),i):a===46&&r===3?(t.consume(a),s):n(a)}function s(a){return a===null?n(a):e(a)}}function hC(t,e,n){let r,i,s;return a;function a(l){return l===46||l===95?t.check(mh,u,o)(l):l===null||ve(l)||mn(l)||l!==45&&$i(l)?u(l):(s=!0,t.consume(l),a)}function o(l){return l===95?r=!0:(i=r,r=void 0),t.consume(l),a}function u(l){return i||r||!s?n(l):e(l)}}function pC(t,e){let n=0,r=0;return i;function i(a){return a===40?(n++,t.consume(a),i):a===41&&r<n?s(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(mh,e,s)(a):a===null||ve(a)||mn(a)?e(a):(t.consume(a),i)}function s(a){return a===41&&r++,t.consume(a),i}}function mC(t,e,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(t.consume(o),r):o===38?(t.consume(o),s):o===93?(t.consume(o),i):o===60||o===null||ve(o)||mn(o)?e(o):n(o)}function i(o){return o===null||o===40||o===91||ve(o)||mn(o)?e(o):r(o)}function s(o){return Je(o)?a(o):n(o)}function a(o){return o===59?(t.consume(o),r):Je(o)?(t.consume(o),a):n(o)}}function gC(t,e,n){return r;function r(s){return t.consume(s),i}function i(s){return We(s)?n(s):e(s)}}function Eh(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||ve(t)}function xh(t){return!Je(t)}function Th(t){return!(t===47||da(t))}function da(t){return t===43||t===45||t===46||t===95||We(t)}function io(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 bC={tokenize:AC,partial:!0};function EC(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:yC,continuation:{tokenize:kC},exit:SC}},text:{91:{name:"gfmFootnoteCall",tokenize:_C},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:xC,resolveTo:TC}}}}function xC(t,e,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){a=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return o;function o(u){if(!a||!a._balanced)return n(u);const l=Tt(r.sliceSerialize({start:a.end,end:r.now()}));return l.codePointAt(0)!==94||!s.includes(l.slice(1))?n(u):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),e(u))}}function TC(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)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",s,e],["enter",a,e],["exit",a,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...o),t}function _C(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return o;function o(c){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),u}function u(c){return c!==94?n(c):(t.enter("gfmFootnoteCallMarker"),t.consume(c),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(c){if(s>999||c===93&&!a||c===null||c===91||ve(c))return n(c);if(c===93){t.exit("chunkString");const h=t.exit("gfmFootnoteCallString");return i.includes(Tt(r.sliceSerialize(h)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(c)}return ve(c)||(a=!0),s++,t.consume(c),c===92?d:l}function d(c){return c===91||c===92||c===93?(t.consume(c),s++,l):l(c)}}function yC(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,o;return u;function u(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(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&&!o||g===null||g===91||ve(g))return n(g);if(g===93){t.exit("chunkString");const E=t.exit("gfmFootnoteDefinitionLabelString");return s=Tt(r.sliceSerialize(E)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),h}return ve(g)||(o=!0),a++,t.consume(g),g===92?c:d}function c(g){return g===91||g===92||g===93?(t.consume(g),a++,d):d(g)}function h(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),i.includes(s)||i.push(s),_e(t,m,"gfmFootnoteDefinitionWhitespace")):n(g)}function m(g){return e(g)}}function kC(t,e,n){return t.check(Yr,e,t.attempt(bC,e,n))}function SC(t){t.exit("gfmFootnoteDefinition")}function AC(t,e,n){const r=this;return _e(t,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?e(s):n(s)}}function CC(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let u=-1;for(;++u<a.length;)if(a[u][0]==="enter"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._close){let l=u;for(;l--;)if(a[l][0]==="exit"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._open&&a[u][1].end.offset-a[u][1].start.offset===a[l][1].end.offset-a[l][1].start.offset){a[u][1].type="strikethroughSequence",a[l][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[l][1].start),end:Object.assign({},a[u][1].end)},c={type:"strikethroughText",start:Object.assign({},a[l][1].end),end:Object.assign({},a[u][1].start)},h=[["enter",d,o],["enter",a[l][1],o],["exit",a[l][1],o],["enter",c,o]],m=o.parser.constructs.insideSpan.null;m&&ft(h,h.length,0,Zi(m,a.slice(l+1,u),o)),ft(h,h.length,0,[["exit",c,o],["enter",a[u][1],o],["exit",a[u][1],o],["exit",d,o]]),ft(a,l-1,u-l+3,h),u=l+h.length-2;break}}for(u=-1;++u<a.length;)a[u][1].type==="strikethroughSequenceTemporary"&&(a[u][1].type="data");return a}function s(a,o,u){const l=this.previous,d=this.events;let c=0;return h;function h(g){return l===126&&d[d.length-1][1].type!=="characterEscape"?u(g):(a.enter("strikethroughSequenceTemporary"),m(g))}function m(g){const E=Mn(l);if(g===126)return c>1?u(g):(a.consume(g),c++,m);if(c<2&&!n)return u(g);const T=a.exit("strikethroughSequenceTemporary"),x=Mn(g);return T._open=!x||x===2&&!!E,T._close=!E||E===2&&!!x,o(g)}}}class IC{constructor(){this.map=[]}add(e,n,r){NC(this,e,n,r)}consume(e){if(this.map.sort(function(s,a){return s[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 i=r.pop();for(;i;){for(const s of i)e.push(s);i=r.pop()}this.map.length=0}}function NC(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function vC(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function wC(){return{flow:{null:{name:"table",tokenize:RC,resolveAll:OC}}}}function RC(t,e,n){const r=this;let i=0,s=0,a;return o;function o(v){let M=r.events.length-1;for(;M>-1;){const Y=r.events[M][1].type;if(Y==="lineEnding"||Y==="linePrefix")M--;else break}const F=M>-1?r.events[M][1].type:null,K=F==="tableHead"||F==="tableRow"?y:u;return K===y&&r.parser.lazy[r.now().line]?n(v):K(v)}function u(v){return t.enter("tableHead"),t.enter("tableRow"),l(v)}function l(v){return v===124||(a=!0,s+=1),d(v)}function d(v){return v===null?n(v):ae(v)?s>1?(s=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(v),t.exit("lineEnding"),m):n(v):Ee(v)?_e(t,d,"whitespace")(v):(s+=1,a&&(a=!1,i+=1),v===124?(t.enter("tableCellDivider"),t.consume(v),t.exit("tableCellDivider"),a=!0,d):(t.enter("data"),c(v)))}function c(v){return v===null||v===124||ve(v)?(t.exit("data"),d(v)):(t.consume(v),v===92?h:c)}function h(v){return v===92||v===124?(t.consume(v),c):c(v)}function m(v){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(v):(t.enter("tableDelimiterRow"),a=!1,Ee(v)?_e(t,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):g(v))}function g(v){return v===45||v===58?T(v):v===124?(a=!0,t.enter("tableCellDivider"),t.consume(v),t.exit("tableCellDivider"),E):w(v)}function E(v){return Ee(v)?_e(t,T,"whitespace")(v):T(v)}function T(v){return v===58?(s+=1,a=!0,t.enter("tableDelimiterMarker"),t.consume(v),t.exit("tableDelimiterMarker"),x):v===45?(s+=1,x(v)):v===null||ae(v)?C(v):w(v)}function x(v){return v===45?(t.enter("tableDelimiterFiller"),_(v)):w(v)}function _(v){return v===45?(t.consume(v),_):v===58?(a=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(v),t.exit("tableDelimiterMarker"),b):(t.exit("tableDelimiterFiller"),b(v))}function b(v){return Ee(v)?_e(t,C,"whitespace")(v):C(v)}function C(v){return v===124?g(v):v===null||ae(v)?!a||i!==s?w(v):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(v)):w(v)}function w(v){return n(v)}function y(v){return t.enter("tableRow"),R(v)}function R(v){return v===124?(t.enter("tableCellDivider"),t.consume(v),t.exit("tableCellDivider"),R):v===null||ae(v)?(t.exit("tableRow"),e(v)):Ee(v)?_e(t,R,"whitespace")(v):(t.enter("data"),D(v))}function D(v){return v===null||v===124||ve(v)?(t.exit("data"),R(v)):(t.consume(v),v===92?P:D)}function P(v){return v===92||v===124?(t.consume(v),D):D(v)}}function OC(t,e){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,u=0,l,d,c;const h=new IC;for(;++n<t.length;){const m=t[n],g=m[1];m[0]==="enter"?g.type==="tableHead"?(o=!1,u!==0&&(hl(h,e,u,l,d),d=void 0,u=0),l={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",l,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,c=void 0,s=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},h.add(n,0,[["enter",d,e]])),i=g.type==="tableDelimiterRow"?2:d?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],c=ii(h,e,s,i,void 0,c),s=[0,0,0,0]),a[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],c=ii(h,e,s,i,void 0,c)),s=a,a=[s[1],n,0,0])):g.type==="tableHead"?(o=!0,u=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(u=n,s[1]!==0?(a[0]=a[1],c=ii(h,e,s,i,n,c)):a[1]!==0&&(c=ii(h,e,a,i,n,c)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(a[3]=n)}for(u!==0&&hl(h,e,u,l,d),h.consume(e.events),n=-1;++n<e.events.length;){const m=e.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=vC(e.events,n))}return t}function ii(t,e,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},In(e.events,n[0])),t.add(n[0],0,[["exit",s,e]]));const u=In(e.events,n[1]);if(s={type:a,start:Object.assign({},u),end:Object.assign({},u)},t.add(n[1],0,[["enter",s,e]]),n[2]!==0){const l=In(e.events,n[2]),d=In(e.events,n[3]),c={type:o,start:Object.assign({},l),end:Object.assign({},d)};if(t.add(n[2],0,[["enter",c,e]]),r!==2){const h=e.events[n[2]],m=e.events[n[3]];if(h[1].end=Object.assign({},m[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,E=n[3]-n[2]-1;t.add(g,E,[])}}t.add(n[3]+1,0,[["exit",c,e]])}return i!==void 0&&(s.end=Object.assign({},In(e.events,i)),t.add(i,0,[["exit",s,e]]),s=void 0),s}function hl(t,e,n,r,i){const s=[],a=In(e.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,e])),r.end=Object.assign({},a),s.push(["exit",r,e]),t.add(n+1,0,s)}function In(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const LC={name:"tasklistCheck",tokenize:PC};function DC(){return{text:{91:LC}}}function PC(t,e,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),s)}function s(u){return ve(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),a):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),a):n(u)}function a(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),o):n(u)}function o(u){return ae(u)?e(u):Ee(u)?t.check({tokenize:MC},e,n)(u):n(u)}}function MC(t,e,n){return _e(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function BC(t){return Wd([uC(),EC(),CC(t),wC(),DC()])}const FC={};function zC(t){const e=this,n=t||FC,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(BC(n)),s.push(iC()),a.push(sC(n))}const jC=O.lazy(()=>v0(()=>import("./lazy-highlighter-nxpk4TOI.js"),__vite__mapDeps([0,1,2,3,4])));function _h(){const t=z.c(3),[e,n]=O.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 i=r;let s;return t[1]!==e?(s={handleCopy:i,copied:e},t[1]=e,t[2]=s):s=t[2],s}function UC(){const t=z.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=p.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(HC)}),t[1]=r):r=t[1],r}function HC(t,e){return p.jsxs("div",{className:"flex gap-2 items-center my-1",children:[e>2&&e<7&&p.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&&p.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&&p.jsx("div",{className:"h-4 rounded animate-pulse",style:{width:"2.5rem",background:"rgba(128, 128, 128, 0.3)",animationDelay:`${e*.14}s`}}),p.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&&p.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=z.c(12),n=O.useRef(null),{handleCopy:r,copied:i}=_h(),s=ZC;let a;e[0]!==r?(a=async()=>{const h=s(n.current);await r(h)},e[0]=r,e[1]=a):a=e[1];const o=a;let u;e[2]!==i?(u=i?p.jsx(Wt,{size:12}):p.jsx(Fr,{size:12}),e[2]=i,e[3]=u):u=e[3];let l;e[4]!==o||e[5]!==u?(l=p.jsx("div",{className:"flex justify-end items-center",children:p.jsxs(at,{variant:"ghost",onClick:o,"aria-label":"Copy as CSV",className:"text-muted-foreground hover:text-foreground h-6 text-[10px]",type:"button",children:["Copy as CSV",u]})}),e[4]=o,e[5]=u,e[6]=l):l=e[6];let d;e[7]!==t?(d=p.jsx("div",{className:"overflow-x-auto mb-4 rounded-lg border border-border",children:p.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 c;return e[9]!==l||e[10]!==d?(c=p.jsxs(p.Fragment,{children:[l,d]}),e[9]=l,e[10]=d,e[11]=c):c=e[11],c}function ZC(t){return t?Array.from(t.querySelectorAll("tr")).map(YC).join(`
|
|
124
|
-
`):""}function YC(t){return Array.from(t.querySelectorAll("th,td")).map(qC).join(",")}function qC(t){let e=t.textContent||"";return e=e.replace(/"/g,'""'),e.search(/([",\n])/g)>=0&&(e=`"${e}"`),e}const VC=[zC],WC=[wS],GC={p:t=>p.jsx("p",{...t,className:"leading-relaxed text-[0.9375rem]"}),strong:t=>p.jsx("strong",{...t,className:"font-bold"}),em:t=>p.jsx("em",{...t,className:"italic"}),a:t=>p.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-primary-dark hover:underline break-all font-medium"}),ul:t=>p.jsx("ul",{...t,className:"list-disc ml-6 my-4 space-y-2"}),ol:t=>p.jsx("ol",{...t,className:"list-decimal ml-6 my-4 space-y-2"}),li:t=>p.jsx("li",{...t,className:"leading-relaxed text-[0.9375rem]"}),code:t=>p.jsx("code",{...t,className:"px-1 py-0.5 bg-muted rounded text-sm font-mono break-all"}),pre:t=>p.jsx("pre",{...t,className:"flex w-full min-w-0 my-4 bg-muted rounded overflow-hidden",children:p.jsx("code",{className:"flex-1 min-w-0 p-4 text-sm font-mono whitespace-pre overflow-x-auto",children:t.children})}),table:t=>p.jsx($C,{...t}),thead:t=>p.jsx("thead",{...t,className:"bg-muted",children:t.children}),tr:t=>p.jsx("tr",{...t,className:"even:bg-muted/50 border-b border-border last:border-0"}),th:t=>p.jsx("th",{...t,className:"px-4 py-2 text-left font-semibold text-muted-foreground border-b border-border"}),td:t=>p.jsx("td",{...t,className:"px-4 py-2 border-b border-border"})},yh=O.memo(t=>{const e=z.c(2),{content:n}=t;let r;return e[0]!==n?(r=p.jsx(py,{remarkPlugins:VC,rehypePlugins:WC,components:GC,children:n}),e[0]=n,e[1]=r):r=e[1],r},(t,e)=>t.content===e.content);function KC(t){const e=z.c(20),{language:n,content:r}=t,{handleCopy:i,copied:s}=_h(),a=n||"text";let o;e[0]!==a?(o=p.jsx("span",{className:"text-xs font-mono uppercase text-muted-foreground tracking-widest select-none",children:a}),e[0]=a,e[1]=o):o=e[1];let u;e[2]!==r||e[3]!==i?(u=()=>i(r),e[2]=r,e[3]=i,e[4]=u):u=e[4];let l;e[5]!==s?(l=s?p.jsx(Wt,{size:14}):p.jsx(Fr,{size:14}),e[5]=s,e[6]=l):l=e[6];let d;e[7]!==u||e[8]!==l?(d=p.jsx(at,{size:"icon",variant:"ghost",onClick:u,"aria-label":"Copy code",className:"text-muted-foreground hover:text-foreground rounded-lg h-8 w-8",children:l}),e[7]=u,e[8]=l,e[9]=d):d=e[9];let c;e[10]!==o||e[11]!==d?(c=p.jsxs("div",{className:"flex items-center justify-between p-1 pl-4 bg-muted border-b border-border",children:[o,d]}),e[10]=o,e[11]=d,e[12]=c):c=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=p.jsx(UC,{}),e[13]=h):h=e[13];let m;e[14]!==r||e[15]!==n?(m=p.jsx(O.Suspense,{fallback:h,children:p.jsx(jC,{language:n,content:r})}),e[14]=r,e[15]=n,e[16]=m):m=e[16];let g;return e[17]!==c||e[18]!==m?(g=p.jsxs("div",{className:"my-4 rounded-lg bg-muted overflow-hidden border border-border grid min-w-0",children:[c,m]}),e[17]=c,e[18]=m,e[19]=g):g=e[19],g}yh.displayName="MemoizedMarkdownBlock";const so=t=>{const e=z.c(7),{id:n,text:r}=t;let i;e[0]!==r?(i=Ae.lexer(r),e[0]=r,e[1]=i):i=e[1];const s=i;let a;if(e[2]!==s||e[3]!==n){let o;e[5]!==n?(o=(u,l)=>u.type==="code"?p.jsx(KC,{language:u.lang,content:u.text},`${n}-block_${l}`):p.jsx(yh,{content:u.raw},`${n}-block_${l}`),e[5]=n,e[6]=o):o=e[6],a=s.map(o),e[2]=s,e[3]=n,e[4]=a}else a=e[4];return a};so.displayName="MemoizedMarkdown";function QC(t,e){switch(e.type){case"TOGGLE":return{isExpanded:!t.isExpanded,wasManuallyToggled:!0};case"SET_EXPANDED":return t.wasManuallyToggled?t:{...t,isExpanded:e.payload};default:return t}}function XC(t){const e=z.c(38),{part:n,id:r}=t,{state:i}=n,s=i==="streaming";let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={isExpanded:!1,wasManuallyToggled:!1},e[0]=a):a=e[0];const[o,u]=O.useReducer(QC,a),{isExpanded:l}=o;let d,c;e[1]!==s?(d=()=>{u({type:"SET_EXPANDED",payload:s})},c=[s],e[1]=s,e[2]=d,e[3]=c):(d=e[2],c=e[3]),O.useEffect(d,c);let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=()=>{u({type:"TOGGLE"})},e[4]=h):h=e[4];const m=h,g=s&&"animate-pulse";let E;e[5]!==g?(E=X("text-muted-foreground transition-opacity",g),e[5]=g,e[6]=E):E=e[6];let T;e[7]!==E?(T=p.jsx(Pi,{className:E}),e[7]=E,e[8]=T):T=e[8];const x=s&&"text-shimmer";let _;e[9]!==x?(_=X("text-sm font-medium text-muted-foreground",x),e[9]=x,e[10]=_):_=e[10];let b;e[11]!==_?(b=p.jsx("span",{className:_,children:"Agent thinking"}),e[11]=_,e[12]=b):b=e[12];const C=l?"rotate-180":"";let w;e[13]!==C?(w=X("text-muted-foreground transition-transform duration-200",C),e[13]=C,e[14]=w):w=e[14];let y;e[15]!==w?(y=p.jsx(zl,{className:w}),e[15]=w,e[16]=y):y=e[16];let R;e[17]!==b||e[18]!==y||e[19]!==T?(R=p.jsxs("button",{type:"button",onClick:m,className:"flex items-center gap-2 py-2 transition-colors cursor-pointer",children:[T,b,y]}),e[17]=b,e[18]=y,e[19]=T,e[20]=R):R=e[20];const D=l?s?"max-h-[400px] opacity-100":"max-h-[200px] opacity-80":"max-h-0 opacity-0 overflow-hidden";let P;e[21]!==D?(P=X("transition-all duration-200 ease-in-out",D),e[21]=D,e[22]=P):P=e[22];const v=s?"max-h-[400px]":"max-h-[200px]";let M;e[23]!==v?(M=X("border-l-2 pl-4 overflow-y-auto",v),e[23]=v,e[24]=M):M=e[24];let F;e[25]===Symbol.for("react.memo_cache_sentinel")?(F=X("text-muted-foreground markdown-sm pb-2"),e[25]=F):F=e[25];let K;e[26]!==r||e[27]!==n.text?(K=p.jsx("div",{className:F,children:p.jsx(so,{id:r,text:n.text})}),e[26]=r,e[27]=n.text,e[28]=K):K=e[28];let Y;e[29]!==M||e[30]!==K?(Y=p.jsx("div",{className:M,children:K}),e[29]=M,e[30]=K,e[31]=Y):Y=e[31];let H;e[32]!==P||e[33]!==Y?(H=p.jsx("div",{className:P,children:Y}),e[32]=P,e[33]=Y,e[34]=H):H=e[34];let J;return e[35]!==R||e[36]!==H?(J=p.jsxs("div",{className:"flex flex-col",children:[R,H]}),e[35]=R,e[36]=H,e[37]=J):J=e[37],J}function JC(){const t=z.c(3),[e,n]=O.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 i=r;let s;return t[1]!==e?(s={handleCopy:i,copied:e},t[1]=e,t[2]=s):s=t[2],s}function kh(t){const e=z.c(13),{id:n,text:r,copyable:i}=t,s=i===void 0?!1:i,{handleCopy:a}=JC(),[o,u]=O.useState(!1);let l;e[0]!==a||e[1]!==r?(l=async()=>{await a(r),u(!0),setTimeout(()=>u(!1),2e3)},e[0]=a,e[1]=r,e[2]=l):l=e[2];const d=l;let c;e[3]!==n||e[4]!==r?(c=p.jsx(so,{id:n,text:r}),e[3]=n,e[4]=r,e[5]=c):c=e[5];let h;e[6]!==s||e[7]!==d||e[8]!==o?(h=s&&p.jsx("div",{className:"flex w-full items-center justify-end gap-2 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",children:p.jsx("div",{className:"flex gap-1",children:p.jsx(at,{onClick:d,variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground px-2 py-1 h-auto whitespace-nowrap",children:o?p.jsx(Wt,{className:"mr-1 text-sm"}):p.jsx(Fr,{className:"mr-1 text-sm"})})})}),e[6]=s,e[7]=d,e[8]=o,e[9]=h):h=e[9];let m;return e[10]!==c||e[11]!==h?(m=p.jsxs("div",{className:"group/part relative",children:[c,h]}),e[10]=c,e[11]=h,e[12]=m):m=e[12],m}function e6(t){const e=z.c(28),{toolName:n,input:r,output:i,isError:s}=t;let a;if(e[0]!==i){const l=JSON.stringify(i,null,2);a=l.length>2e3?l.slice(0,2e3)+"...[TRUNCATED]":l,e[0]=i,e[1]=a}else a=e[1];const o=a;if(n==="READ_MCP_TOOLS"){const l=r?.id;if(l){let d;return e[2]!==l?(d=p.jsx(pl,{connectionId:l}),e[2]=l,e[3]=d):d=e[3],d}}if(n==="CALL_MCP_TOOL"){const l=r?.connectionId;let d;e[4]!==l?(d=l&&p.jsx(pl,{connectionId:l,compact:!0}),e[4]=l,e[5]=d):d=e[5];let c;e[6]!==i?(c=JSON.stringify(i,null,2),e[6]=i,e[7]=c):c=e[7];let h;e[8]!==c?(h=p.jsx("div",{className:"absolute top-1 right-1 z-10",children:p.jsx(t6,{text:c})}),e[8]=c,e[9]=h):h=e[9];let m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=p.jsx("div",{className:"font-semibold text-muted-foreground mb-0.5 text-[10px] uppercase tracking-wider",children:"Input"}),e[10]=m):m=e[10];let g;e[11]!==r?(g=JSON.stringify(r,null,2),e[11]=r,e[12]=g):g=e[12];let E;e[13]!==g?(E=p.jsx("pre",{className:"whitespace-pre-wrap break-all text-muted-foreground mb-2",children:g}),e[13]=g,e[14]=E):E=e[14];let T;e[15]===Symbol.for("react.memo_cache_sentinel")?(T=p.jsx("div",{className:"font-semibold text-muted-foreground mb-0.5 text-[10px] uppercase tracking-wider",children:"Output"}),e[15]=T):T=e[15];const x=`whitespace-pre-wrap break-all ${s?"text-destructive":"text-foreground"}`;let _;e[16]!==o||e[17]!==x?(_=p.jsx("pre",{className:x,children:o}),e[16]=o,e[17]=x,e[18]=_):_=e[18];let b;e[19]!==_||e[20]!==h||e[21]!==E?(b=p.jsxs("div",{className:"relative bg-muted rounded-md p-2 text-xs font-mono overflow-auto max-h-[200px]",children:[h,m,E,T,_]}),e[19]=_,e[20]=h,e[21]=E,e[22]=b):b=e[22];let C;return e[23]!==b||e[24]!==d?(C=p.jsxs("div",{className:"flex flex-col gap-2",children:[d,b]}),e[23]=b,e[24]=d,e[25]=C):C=e[25],C}let u;return e[26]!==o?(u=p.jsx("div",{className:"bg-muted rounded-md p-2 text-xs font-mono overflow-auto max-h-[200px]",children:p.jsx("pre",{className:"whitespace-pre-wrap break-all",children:o})}),e[26]=o,e[27]=u):u=e[27],u}function pl(t){const e=z.c(15),{connectionId:n,compact:r}=t,i=X0(n),{org:s}=Nt(),{slug:a}=s,o=Pr();if(!i)return null;let u;e[0]!==i.id||e[1]!==o||e[2]!==a?(u=()=>{o({to:"/$org/mcps/$connectionId",params:{org:a,connectionId:i.id}})},e[0]=i.id,e[1]=o,e[2]=a,e[3]=u):u=e[3];const l=u;if(r){let c;e[4]!==i.title?(c=p.jsx("span",{className:"font-medium text-foreground",children:i.title}),e[4]=i.title,e[5]=c):c=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=p.jsx(Bs,{size:12}),e[6]=h):h=e[6];let m;e[7]!==l?(m=p.jsx("button",{type:"button",onClick:l,className:"hover:text-foreground transition-colors",title:"Open connection",children:h}),e[7]=l,e[8]=m):m=e[8];let g;return e[9]!==c||e[10]!==m?(g=p.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground bg-muted/50 px-2 py-1 rounded-md w-fit",children:[c,m]}),e[9]=c,e[10]=m,e[11]=g):g=e[11],g}let d;return e[12]!==i||e[13]!==l?(d=p.jsx(kp,{connection:i,onClick:l}),e[12]=i,e[13]=l,e[14]=d):d=e[14],d}function t6({text:t}){const e=async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(t),ui.success("Copied to clipboard");else throw new Error("Clipboard API unavailable")}catch(n){try{const r=document.createElement("textarea");r.value=t,r.style.position="fixed",r.style.left="-9999px",r.style.top="0",document.body.appendChild(r),r.focus(),r.select();const i=document.execCommand("copy");if(document.body.removeChild(r),i)ui.success("Copied to clipboard");else throw new Error("Fallback copy failed")}catch(r){console.error("Copy failed",n,r),ui.error("Failed to copy to clipboard")}}};return p.jsx(at,{size:"icon",variant:"ghost",className:"h-5 w-5 hover:bg-background/50",onClick:e,children:p.jsx(Fr,{size:12})})}function n6(t){const e=z.c(39),{part:n}=t,{state:r}=n;let i;e[0]!==n?(i="toolName"in n?n.toolName:n.type.replace("tool-",""),e[0]=n,e[1]=i):i=e[1];const s=i;let a;e[2]!==r?(a=r==="output-error"?p.jsx(yp,{className:"h-3.5 w-3.5 text-destructive"}):p.jsx(yc,{className:"h-3.5 w-3.5"}),e[2]=r,e[3]=a):a=e[3];const o=r==="output-error"&&"text-destructive/90";let u;e[4]!==o?(u=X(o),e[4]=o,e[5]=u):u=e[5];const l=r==="input-streaming"&&`Streaming ${s} arguments`,d=r==="input-available"&&`Calling ${s}`,c=r==="output-available"&&`Called ${s}`,h=r==="output-error"&&`Error calling ${s}`;let m;e[6]!==u||e[7]!==l||e[8]!==d||e[9]!==c||e[10]!==h?(m=p.jsxs("span",{className:u,children:[l,d,c,h]}),e[6]=u,e[7]=l,e[8]=d,e[9]=c,e[10]=h,e[11]=m):m=e[11];let g;e[12]!==r?(g=(r==="input-streaming"||r==="input-available")&&p.jsx("span",{className:"animate-spin",children:p.jsx(Sp,{size:"xs"})}),e[12]=r,e[13]=g):g=e[13];let E;e[14]!==g||e[15]!==a||e[16]!==m?(E=p.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[a,m,g]}),e[14]=g,e[15]=a,e[16]=m,e[17]=E):E=e[17];const T=r==="output-error"?"border-destructive/50":"border-border";let x;e[18]!==T?(x=X("transition-all duration-200 ease-in-out","border-l-2 pl-3",T),e[18]=T,e[19]=x):x=e[19];let _;e[20]!==n.input||e[21]!==r?(_=(r==="input-streaming"||r==="input-available")&&!!n.input&&p.jsx("div",{className:"text-xs font-mono text-muted-foreground bg-muted/30 p-2 rounded",children:JSON.stringify(n.input,null,2)}),e[20]=n.input,e[21]=r,e[22]=_):_=e[22];let b;e[23]!==n.input||e[24]!==n.output||e[25]!==r||e[26]!==s?(b=r==="output-available"&&p.jsx(e6,{toolName:s,input:n.input,output:n.output}),e[23]=n.input,e[24]=n.output,e[25]=r,e[26]=s,e[27]=b):b=e[27];let C;e[28]!==n||e[29]!==r?(C=r==="output-error"&&p.jsx("div",{className:"text-xs font-mono bg-destructive/10 text-destructive p-2 rounded border border-destructive/20",children:"errorText"in n&&typeof n.errorText=="string"?n.errorText:"An unknown error occurred"}),e[28]=n,e[29]=r,e[30]=C):C=e[30];let w;e[31]!==x||e[32]!==_||e[33]!==b||e[34]!==C?(w=p.jsxs("div",{className:x,children:[_,b,C]}),e[31]=x,e[32]=_,e[33]=b,e[34]=C,e[35]=w):w=e[35];let y;return e[36]!==E||e[37]!==w?(y=p.jsxs("div",{className:"flex flex-col gap-1.5 py-1",children:[E,w]}),e[36]=E,e[37]=w,e[38]=y):y=e[38],y}const r6={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 i6(t){if(!t?.providerMetadata)return null;for(const e of Object.values(r6)){const n=e(t.providerMetadata);if(n!==null)return n}return null}function s6(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+(i6(r)??0)}:e},{inputTokens:0,outputTokens:0,totalTokens:0,cost:0})}function Sh(t){const e=z.c(38),{messages:n}=t;let r,i,s,a,o,u,l,d,c,h,m,g;if(e[0]!==n){g=Symbol.for("react.early_return_sentinel");e:{const C=s6(n);if(!C){g=null;break e}const{totalTokens:w,inputTokens:y,outputTokens:R,cost:D}=C;if(s=D,!w&&!y&&!R){g=null;break e}i=ya;let P;e[13]===Symbol.for("react.memo_cache_sentinel")?(P=p.jsx(uc,{size:12,className:"opacity-60"}),e[13]=P):P=e[13];const v=p.jsxs("button",{type:"button",className:"ml-auto shrink-0 flex items-center gap-1 text-[11px] text-muted-foreground/60 font-mono tabular-nums hover:text-muted-foreground transition-colors",children:[P,p.jsx("span",{className:"hidden md:inline",children:w.toLocaleString()})]});e[14]!==v?(m=p.jsx(Ta,{asChild:!0,children:v}),e[14]=v,e[15]=m):m=e[15],r=_a,c="top",h="font-mono text-[11px]",o="grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5",e[16]===Symbol.for("react.memo_cache_sentinel")?(u=p.jsx("span",{className:"text-muted",children:"in"}),e[16]=u):u=e[16],l=p.jsx("span",{children:y.toLocaleString()}),e[17]===Symbol.for("react.memo_cache_sentinel")?(d=p.jsx("span",{className:"text-muted",children:"out"}),e[17]=d):d=e[17],a=R.toLocaleString()}e[0]=n,e[1]=r,e[2]=i,e[3]=s,e[4]=a,e[5]=o,e[6]=u,e[7]=l,e[8]=d,e[9]=c,e[10]=h,e[11]=m,e[12]=g}else r=e[1],i=e[2],s=e[3],a=e[4],o=e[5],u=e[6],l=e[7],d=e[8],c=e[9],h=e[10],m=e[11],g=e[12];if(g!==Symbol.for("react.early_return_sentinel"))return g;let E;e[18]!==a?(E=p.jsx("span",{children:a}),e[18]=a,e[19]=E):E=e[19];let T;e[20]!==s?(T=s>0&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"text-muted",children:"cost"}),p.jsxs("span",{children:["$",s.toFixed(4)]})]}),e[20]=s,e[21]=T):T=e[21];let x;e[22]!==E||e[23]!==T||e[24]!==o||e[25]!==u||e[26]!==l||e[27]!==d?(x=p.jsxs("div",{className:o,children:[u,l,d,E,T]}),e[22]=E,e[23]=T,e[24]=o,e[25]=u,e[26]=l,e[27]=d,e[28]=x):x=e[28];let _;e[29]!==r||e[30]!==x||e[31]!==c||e[32]!==h?(_=p.jsx(r,{side:c,className:h,children:x}),e[29]=r,e[30]=x,e[31]=c,e[32]=h,e[33]=_):_=e[33];let b;return e[34]!==i||e[35]!==_||e[36]!==m?(b=p.jsxs(i,{children:[m,_]}),e[34]=i,e[35]=_,e[36]=m,e[37]=b):b=e[37],b}const a6={planning:{icon:p.jsx(_c,{className:"text-muted-foreground animate-pulse",size:20}),label:"Planning next moves"},thinking:{icon:p.jsx(Pi,{className:"text-muted-foreground animate-pulse",size:20}),label:"Thinking"}},o6=1200;function u6(){const t=z.c(7),[e,n]=O.useState("planning");let r,i;t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const u=setTimeout(()=>{n("thinking")},o6);return()=>{clearTimeout(u)}},i=[],t[0]=r,t[1]=i):(r=t[0],i=t[1]),O.useEffect(r,i);const s=a6[e];let a;t[2]!==s.label?(a=p.jsxs("span",{className:"text-sm font-medium text-muted-foreground text-shimmer",children:[s.label,"..."]}),t[2]=s.label,t[3]=a):a=t[3];let o;return t[4]!==s.icon||t[5]!==a?(o=p.jsxs("div",{className:"flex items-center gap-2 py-2",children:[s.icon,a]}),t[4]=s.icon,t[5]=a,t[6]=o):o=t[6],o}function l6(t){const e=z.c(5),{duration:n}=t,r=n/1e3;let i;e[0]!==r?(i=r.toFixed(1),e[0]=r,e[1]=i):i=e[1];const s=i;let a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx(mc,{className:"text-muted-foreground",size:16}),e[2]=a):a=e[2];let o;return e[3]!==s?(o=p.jsxs("div",{className:"flex items-center gap-2 py-2 opacity-60",children:[a,p.jsxs("span",{className:"text-xs text-muted-foreground",children:["Thought · ",s,"s"]})]}),e[3]=s,e[4]=o):o=e[4],o}function c6(t,e,n){const r=t.type.startsWith("tool-")||t.type==="dynamic-tool";if(t.type==="step-start"||t.type==="file"||t.type==="source-url"||t.type==="source-document")return null;if(r)return p.jsx(n6,{part:t,id:e},`${e}-${n}`);switch(t.type){case"text":return p.jsx(kh,{id:e,text:t.text,copyable:!0},`${e}-${n}`);case"reasoning":return p.jsx(XC,{part:t,id:e},`${e}-${n}`)}throw new Error(`Unknown part type: ${t.type}`)}function d6(t){const e=z.c(29),{message:n,status:r,className:i}=t,{id:s,parts:a}=n,l=r==="streaming"||r==="submitted",d=O.useRef(null);let c;e[0]!==s?(c=()=>{const v=localStorage.getItem(`msg-duration-${s}`);return v?Number(v):null},e[0]=s,e[1]=c):c=e[1];const[h,m]=O.useState(c);let g,E;e[2]!==l?(g=()=>{l&&d.current===null&&(d.current=Date.now())},E=[l],e[2]=l,e[3]=g,e[4]=E):(g=e[3],E=e[4]),O.useEffect(g,E);let T,x;e[5]!==h||e[6]!==s||e[7]!==a.length?(T=()=>{if(a.length>0&&h===null&&d.current!==null){const v=Date.now()-d.current;m(v),localStorage.setItem(`msg-duration-${s}`,v.toString())}},x=[a.length,h,s],e[5]=h,e[6]=s,e[7]=a.length,e[8]=T,e[9]=x):(T=e[8],x=e[9]),O.useEffect(T,x);const _=a.length>0,b=_&&!l&&h!==null;let C;e[10]!==i?(C=X("w-full min-w-0 group relative flex items-start gap-4 px-8 z-20 text-foreground flex-row",i),e[10]=i,e[11]=C):C=e[11];let w;e[12]!==h||e[13]!==_||e[14]!==s||e[15]!==l||e[16]!==a||e[17]!==b?(w=_?p.jsxs(p.Fragment,{children:[b&&p.jsx(l6,{duration:h}),a.map((v,M)=>c6(v,s,M))]}):l?p.jsx(u6,{}):null,e[12]=h,e[13]=_,e[14]=s,e[15]=l,e[16]=a,e[17]=b,e[18]=w):w=e[18];let y;e[19]!==w?(y=p.jsx("div",{className:"w-full min-w-0 not-only:rounded-2xl text-[0.9375rem] wrap-break-word overflow-wrap-anywhere bg-transparent",children:w}),e[19]=w,e[20]=y):y=e[20];let R;e[21]!==n?(R=p.jsx(Sh,{messages:[n]}),e[21]=n,e[22]=R):R=e[22];let D;e[23]!==y||e[24]!==R?(D=p.jsxs("div",{className:"flex flex-col gap-2 min-w-0 w-full items-start",children:[y,R]}),e[23]=y,e[24]=R,e[25]=D):D=e[25];let P;return e[26]!==D||e[27]!==C?(P=p.jsx("div",{className:C,children:D}),e[26]=D,e[27]=C,e[28]=P):P=e[28],P}const Ah=O.createContext(null);function Ch(t){const e=z.c(2),{children:n}=t;let r;return e[0]!==n?(r=p.jsx(p.Fragment,{children:n}),e[0]=n,e[1]=r):r=e[1],r}function f6(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];if(!O.isValidElement(r))continue;if(r.props?.message?.role==="assistant"){const s=t[n-1],a=O.isValidElement(s)&&s.props?.message?.role,o=s&&O.isValidElement(s)&&a==="user"?s:null;e.push({user:o,assistant:r})}}return e}function h6(t){const e=z.c(27),{children:n,className:r,minHeightOffset:i}=t,s=O.useRef(null);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],e[0]=a):a=e[0];const o=O.useRef(a);let u,l,d,c,h,m,g;if(e[1]!==n||e[2]!==r||e[3]!==i){const _=O.Children.toArray(n),b=_[_.length-1];l=b&&O.isValidElement(b)&&b.type===Ch?b:null;const C=l?_.slice(0,-1):_,w=f6(C);let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=D=>{const P=o.current[D];if(P&&s.current){const v=s.current.offsetTop,M=P.offsetTop;s.current.scrollTo({top:M-v,behavior:"smooth"})}},e[11]=y):y=e[11];const R=y;u=Ah.Provider,e[12]===Symbol.for("react.memo_cache_sentinel")?(g={scrollToPair:R},e[12]=g):g=e[12],h=s,e[13]!==r?(m=X("w-full min-w-0 max-w-full overflow-y-auto h-full overflow-x-hidden",r),e[13]=r,e[14]=m):m=e[14],d="flex flex-col min-w-0 max-w-2xl mx-auto w-full",c=w.map((D,P)=>{const v=P===w.length-1;return p.jsxs("div",{ref:M=>{o.current[P]=M},className:"flex flex-col gap-2 py-2",style:v&&i?{minHeight:`calc(100vh - ${i}px)`}:void 0,children:[p.jsx("div",{className:"sticky top-0 z-50 bg-background w-full h-2"}),p.jsx("div",{className:"sticky top-2 z-50",children:D.user&&O.isValidElement(D.user)?O.cloneElement(D.user,{pairIndex:P}):D.user}),D.assistant]},P)}),e[1]=n,e[2]=r,e[3]=i,e[4]=u,e[5]=l,e[6]=d,e[7]=c,e[8]=h,e[9]=m,e[10]=g}else u=e[4],l=e[5],d=e[6],c=e[7],h=e[8],m=e[9],g=e[10];let E;e[15]!==l||e[16]!==d||e[17]!==c?(E=p.jsxs("div",{className:d,children:[c,l]}),e[15]=l,e[16]=d,e[17]=c,e[18]=E):E=e[18];let T;e[19]!==h||e[20]!==m||e[21]!==E?(T=p.jsx("div",{ref:h,className:m,children:E}),e[19]=h,e[20]=m,e[21]=E,e[22]=T):T=e[22];let x;return e[23]!==u||e[24]!==g||e[25]!==T?(x=p.jsx(u,{value:g,children:T}),e[23]=u,e[24]=g,e[25]=T,e[26]=x):x=e[26],x}function p6(t){const e=z.c(29),{message:n,className:r,pairIndex:i}=t,{id:s,parts:a}=n,o=O.useRef(null),u=O.useContext(Ah),[l,d]=O.useState(!1);if(!a||a.length===0)return null;const h=a.reduce(m6,0)>60;let m;e[0]!==u||e[1]!==i?(m=()=>{i!==void 0&&u?.scrollToPair(i)},e[0]=u,e[1]=i,e[2]=m):m=e[2];const g=m;let E;e[3]!==r?(E=X("message-block w-full min-w-0 group relative flex items-start gap-4 px-4 text-foreground flex-row-reverse",r),e[3]=r,e[4]=E):E=e[4];const T=h&&!l&&"overflow-hidden relative max-h-[60px]";let x;e[5]!==T?(x=X(T),e[5]=T,e[6]=x):x=e[6];let _;if(e[7]!==s||e[8]!==a){let D;e[10]!==s?(D=(P,v)=>P.type==="text"?p.jsx(kh,{id:s,text:P.text},`${s}-${v}`):null,e[10]=s,e[11]=D):D=e[11],_=a.map(D),e[7]=s,e[8]=a,e[9]=_}else _=e[9];let b;e[12]!==l||e[13]!==h?(b=h&&!l&&p.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-12 bg-gradient-to-t from-muted to-transparent pointer-events-none"}),e[12]=l,e[13]=h,e[14]=b):b=e[14];let C;e[15]!==x||e[16]!==_||e[17]!==b?(C=p.jsxs("div",{className:x,children:[_,b]}),e[15]=x,e[16]=_,e[17]=b,e[18]=C):C=e[18];let w;e[19]!==l||e[20]!==h?(w=h&&p.jsx("div",{className:"flex justify-center",children:p.jsx(at,{onClick:D=>{D.stopPropagation(),d(!l)},variant:"ghost",size:"xs",className:"text-xs w-full text-muted-foreground hover:text-foreground",children:l?p.jsx(dp,{className:"text-sm"}):p.jsx(zl,{className:"text-sm"})})}),e[19]=l,e[20]=h,e[21]=w):w=e[21];let y;e[22]!==g||e[23]!==C||e[24]!==w?(y=p.jsxs("div",{onClick:g,className:"w-full border min-w-0 shadow-[0_3px_6px_-1px_rgba(0,0,0,0.1)] rounded-lg text-[0.9375rem] break-words overflow-wrap-anywhere bg-muted px-4 py-2 cursor-pointer transition-colors",children:[C,w]}),e[22]=g,e[23]=C,e[24]=w,e[25]=y):y=e[25];let R;return e[26]!==E||e[27]!==y?(R=p.jsxs("div",{ref:o,className:E,children:[" ",y]}),e[26]=E,e[27]=y,e[28]=R):R=e[28],R}function m6(t,e){return e.type==="text"?t+e.text.length:t}const g6="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png",b6=t=>new rd({api:`/api/${t}/models/stream`,credentials:"include",prepareSendMessagesRequest:({messages:e,requestMetadata:n})=>({body:{messages:e,stream:!0,...n}})});function E6(t){const e=z.c(12),{onSubmit:n,onStop:r,disabled:i,isStreaming:s,placeholder:a,leftActions:o}=t,[u,l]=O.useState("");let d;e[0]!==u||e[1]!==s||e[2]!==n?(d=async m=>{if(m?.preventDefault(),!u?.trim()||s)return;const g=u.trim();try{await n(g),l("")}catch(E){const T=E;console.error("Failed to send message:",T);const x=T instanceof Error?T.message:"Failed to send message";ui.error(x)}},e[0]=u,e[1]=s,e[2]=n,e[3]=d):d=e[3];const c=d;let h;return e[4]!==i||e[5]!==c||e[6]!==u||e[7]!==s||e[8]!==o||e[9]!==r||e[10]!==a?(h=p.jsx(lE,{value:u,onChange:l,onSubmit:c,onStop:r,disabled:i,isStreaming:s,placeholder:a,leftActions:o}),e[4]=i,e[5]=c,e[6]=u,e[7]=s,e[8]=o,e[9]=r,e[10]=a,e[11]=h):h=e[11],h}function x6(t){const e=new Date(t),r=new Date().getTime()-e.getTime(),i=Math.floor(r/6e4),s=Math.floor(r/36e5);return i<1?"now":i<60?`${i}m`:`${s}h`}function T6(t){const e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate()),r=new Date(n.getTime()-864e5),i=new Date(n.getTime()-7*864e5),s=new Date(n.getTime()-30*864e5),a=[],o=[],u=[],l=[],d=[];for(const h of t){const m=new Date(h.updated_at);m>=n?a.push(h):m>=r?o.push(h):m>=i?u.push(h):m>=s?l.push(h):d.push(h)}const c=[];return a.length>0&&c.push({label:"Today",threads:a,showRelativeTime:!0}),o.length>0&&c.push({label:"Yesterday",threads:o,showRelativeTime:!1}),u.length>0&&c.push({label:"7 days ago",threads:u,showRelativeTime:!1}),l.length>0&&c.push({label:"30 days ago",threads:l,showRelativeTime:!1}),d.length>0&&c.push({label:"Older",threads:d,showRelativeTime:!1}),c}function _6(){const t=z.c(36),{threads:e,refetch:n}=_E(),{activeThreadId:r,setActiveThreadId:i,hideThread:s}=_d(),[a,o]=O.useState("");let u,l,d,c,h,m,g,E,T;if(t[0]!==r||t[1]!==s||t[2]!==n||t[3]!==a||t[4]!==i||t[5]!==e){const C=a.trim()?e.filter(v=>(v.title||"New chat").toLowerCase().includes(a.toLowerCase())):e,w=T6(C);let y;t[15]!==n?(y=v=>{v?n():o("")},t[15]=n,t[16]=y):y=t[16];const R=y;l=Ml,E=R,t[17]===Symbol.for("react.memo_cache_sentinel")?(T=p.jsx(Bl,{asChild:!0,children:p.jsx("button",{type:"button",className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"Chat history",children:p.jsx(xp,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})}),t[17]=T):T=t[17],u=Fl,h="end",m="w-80 p-0";let D;t[18]===Symbol.for("react.memo_cache_sentinel")?(D=p.jsx(xa,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),t[18]=D):D=t[18];let P;t[19]===Symbol.for("react.memo_cache_sentinel")?(P=v=>o(v.target.value),t[19]=P):P=t[19],t[20]!==a?(g=p.jsx("div",{className:"p-2 border-b",children:p.jsxs("div",{className:"relative",children:[D,p.jsx("input",{type:"text",placeholder:"Search chats...",value:a,onChange:P,className:"w-full pl-8 pr-3 py-1.5 text-sm bg-muted/50 border border-border rounded-md focus:outline-none focus:ring-1 focus:ring-ring placeholder:text-muted-foreground"})]})}),t[20]=a,t[21]=g):g=t[21],d="max-h-[300px] overflow-y-auto",c=C.length===0?p.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:a.trim()?"No chats found":"No chats yet"}):w.map((v,M)=>p.jsxs("div",{children:[M>0&&p.jsx("div",{className:"border-t mx-3"}),p.jsx("div",{className:"px-3 py-1",children:p.jsx("span",{className:"text-xs font-medium text-muted-foreground tracking-wide",children:v.label})}),v.threads.map(F=>{const K=F.id===r;return p.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 hover:bg-accent cursor-pointer group ${K?"bg-accent/50":""}`,onClick:()=>i(F.id),children:[p.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[p.jsx("span",{className:"text-sm truncate",children:F.title||"New chat"}),p.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:K?"current":v.showRelativeTime?x6(F.updated_at):null})]}),p.jsx("button",{type:"button",onClick:Y=>{Y.stopPropagation(),s(F.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:p.jsx(_p,{size:14,className:"text-muted-foreground group-hover/trash:text-destructive"})})]},F.id)})]},v.label)),t[0]=r,t[1]=s,t[2]=n,t[3]=a,t[4]=i,t[5]=e,t[6]=u,t[7]=l,t[8]=d,t[9]=c,t[10]=h,t[11]=m,t[12]=g,t[13]=E,t[14]=T}else u=t[6],l=t[7],d=t[8],c=t[9],h=t[10],m=t[11],g=t[12],E=t[13],T=t[14];let x;t[22]!==d||t[23]!==c?(x=p.jsx("div",{className:d,children:c}),t[22]=d,t[23]=c,t[24]=x):x=t[24];let _;t[25]!==u||t[26]!==h||t[27]!==m||t[28]!==g||t[29]!==x?(_=p.jsxs(u,{align:h,className:m,children:[g,x]}),t[25]=u,t[26]=h,t[27]=m,t[28]=g,t[29]=x,t[30]=_):_=t[30];let b;return t[31]!==l||t[32]!==E||t[33]!==T||t[34]!==_?(b=p.jsxs(l,{onOpenChange:E,children:[T,_]}),t[31]=l,t[32]=E,t[33]=T,t[34]=_,t[35]=b):b=t[35],b}function y6(){const{data:t}=Mr.useSession(),e=t?.user,{org:n,locator:r}=Nt(),[,i]=Sa(),s=Pr(),{createThread:a,activeThreadId:o}=_d(),u=O.useRef(null),l=Ed(),d=kE(),c=yE(o),[h,m]=Dn(Br.chatSelectedModel(r),V=>V??null),[g,E]=Dn(`${r}:selected-gateway`,()=>null),T=b6(n.slug),b=Q2({id:o,messages:c,transport:T,onFinish:async V=>{const{finishReason:ne,messages:S,isAbort:te,isDisconnect:se,isError:Q}=V;if(ne!=="stop"||te||se||Q)return;const ee=S.slice(-2).filter(Boolean);if(ee.length===2){d.insertMany.mutate(ee);const ie=ee.find(ge=>ge.parts?.find(De=>De.type==="text"))?.parts?.find(ge=>ge.type==="text")?.text.slice(0,100)||"",le=await EE(r,o);le?l.update.mutate({id:o,updates:{title:le.title||ie,updated_at:new Date().toISOString()}}):a({id:o,title:ie})}},onError:V=>{console.error("[deco-chat] Chat error:",V)}}),{status:C}=b,w=J0(),[y]=rp({connections:w,binding:"LLMS"}),R=rg(y?.id),D=tp(),P=!R||!y?[]:R.map(V=>({...V,name:V.title,contextWindow:V.limits?.contextWindow,outputLimit:V.limits?.maxOutputTokens,inputCost:V.costs?.input,outputCost:V.costs?.output,provider:V.provider,connectionId:y.id,connectionName:y.title})).sort((V,ne)=>V.name.localeCompare(ne.name));O.useEffect(()=>{if(P.length>0&&!h){const V=P[0];V&&m({id:V.id,connectionId:V.connectionId})}},[R,y,h,m]),O.useEffect(()=>{if(D.length>0&&!g){const V=D[0];V&&E({gatewayId:V.id})}},[D,g,E]);const v=P.find(V=>V.id===h?.id&&V.connectionId===h?.connectionId),M=D.find(V=>V.id===g?.gatewayId),F=b.messages.length===0,K=O.useRef(b.messages.length),Y=O.useRef(0);b.messages.length>K.current&&Y.current!==b.messages.length&&queueMicrotask(()=>{u.current&&(u.current.scrollIntoView({behavior:"smooth",block:"start"}),Y.current=b.messages.length)}),K.current=b.messages.length;const H=D.map(V=>({id:V.id,title:V.title,icon:V.icon,description:V.description,fallbackIcon:p.jsx(Rn,{})})),J=async V=>{if(!V?.trim()||C==="submitted"||C==="streaming")return;if(!v){console.error("No model configured");return}const ne={created_at:new Date().toISOString(),thread_id:o,model:v,gateway:M?{id:M.id}:void 0,user:{avatar:e?.image??void 0,name:e?.name??"you"}};await b.sendMessage({id:crypto.randomUUID(),role:"user",parts:[{type:"text",text:V}],metadata:ne},{metadata:ne})},de=()=>{b.stop?.()},ue=!!y,me=D.length>0;if(!(ue&&me)){let V,ne;return!ue&&!me?(V="Connect your providers",ne="Connect an LLM provider and create a gateway to unlock AI-powered features."):ue?(V="No gateways configured",ne="Create a gateway to expose your MCP tools to the chat."):(V="No model provider connected",ne="Connect to a model provider to unlock AI-powered features."),p.jsxs(tn,{className:"h-full",children:[p.jsxs(tn.Header,{children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("img",{src:g6,alt:"deco chat",className:"size-5 rounded"}),p.jsx("span",{className:"text-sm font-medium",children:"deco chat"})]}),p.jsx("div",{className:"flex items-center gap-1",children:p.jsx("button",{type:"button",onClick:()=>i(!1),className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:p.jsx(Ti,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})})]}),p.jsx(tn.Content,{className:"flex flex-col items-center",children:p.jsx(W0,{title:V,description:ne,actions:p.jsx(at,{variant:"outline",onClick:()=>s({to:ue?"/$org/gateways":"/$org/mcps",params:{org:n.slug},search:ue?void 0:{action:"create"}}),children:ue?"Create gateway":"Add connection"})})})]})}return p.jsxs(tn,{className:"h-full",children:[p.jsxs(tn.Header,{children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(xi,{icon:M?.icon,name:M?.title||"deco chat",size:"xs",fallbackIcon:p.jsx(Rn,{size:12})}),p.jsx("span",{className:"text-sm font-medium",children:M?.title||"deco chat"})]}),p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("button",{type:"button",onClick:()=>{a()},className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent group cursor-pointer",title:"New chat",children:p.jsx(Tp,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})}),p.jsx(_6,{}),p.jsx("button",{type:"button",onClick:()=>i(!1),className:"flex size-6 items-center justify-center rounded-full p-1 hover:bg-transparent transition-colors group cursor-pointer",title:"Close chat",children:p.jsx(Ti,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors"})})]})]}),p.jsx(tn.Content,{children:F?p.jsx(uE,{title:M?.title||"Ask deco chat",description:M?.description||"Ask anything about configuring model providers or using MCP Mesh.",avatarNode:p.jsx(xi,{icon:M?.icon,name:M?.title||"deco chat",size:"lg",fallbackIcon:p.jsx(Rn,{size:32}),className:"size-[60px]! rounded-[18px]!"})}):p.jsxs(h6,{minHeightOffset:240,children:[b.messages.map((V,ne)=>V.role==="user"?p.jsx(p6,{message:V},V.id):V.role==="assistant"?p.jsx(d6,{message:V,status:ne===b.messages.length-1?C:void 0},V.id):null),p.jsx(Ch,{children:p.jsx("div",{ref:u,className:"h-0"})})]})}),p.jsx(tn.Footer,{children:p.jsx(E6,{onSubmit:J,onStop:de,disabled:P.length===0||!h,isStreaming:C==="submitted"||C==="streaming",placeholder:P.length===0?"Add an LLM binding connection to start chatting":"Ask anything or @ for context",leftActions:p.jsxs("div",{className:"flex items-center gap-2",children:[D.length>0&&p.jsx(rE,{gateways:H,selectedGatewayId:g?.gatewayId,onGatewayChange:V=>{V&&E({gatewayId:V})},placeholder:"Gateway",variant:"bordered"}),P.length>0&&p.jsx(hE,{models:P,selectedModelId:h?.id,onModelChange:V=>{if(!V)return;const ne=P.find(S=>S.id===V);ne&&m({id:ne.id,connectionId:ne.connectionId})},placeholder:"Model",variant:"borderless"}),p.jsx(Sh,{messages:b.messages})]})})})]})}function k6(t){const e=z.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=p.jsx(w0,{"data-slot":"sheet",...n}),e[2]=n,e[3]=r):r=e[3],r}function S6(t){const e=z.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=p.jsx(D0,{"data-slot":"sheet-portal",...n}),e[2]=n,e[3]=r):r=e[3],r}function A6(t){const e=z.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 i;e[3]!==n?(i=X("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx(M0,{"data-slot":"sheet-overlay",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function C6(t){const e=z.c(17);let n,r,i,s;e[0]!==t?({className:r,children:n,side:s,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s):(n=e[1],r=e[2],i=e[3],s=e[4]);const a=s===void 0?"right":s;let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsx(A6,{}),e[5]=o):o=e[5];const u=a==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",l=a==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",d=a==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",c=a==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t";let h;e[6]!==r||e[7]!==u||e[8]!==l||e[9]!==d||e[10]!==c?(h=X("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",u,l,d,c,r),e[6]=r,e[7]=u,e[8]=l,e[9]=d,e[10]=c,e[11]=h):h=e[11];let m;e[12]===Symbol.for("react.memo_cache_sentinel")?(m=p.jsxs(P0,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[p.jsx(Ti,{className:"size-4"}),p.jsx("span",{className:"sr-only",children:"Close"})]}),e[12]=m):m=e[12];let g;return e[13]!==n||e[14]!==i||e[15]!==h?(g=p.jsxs(S6,{children:[o,p.jsxs(L0,{"data-slot":"sheet-content",className:h,...i,children:[n,m]})]}),e[13]=n,e[14]=i,e[15]=h,e[16]=g):g=e[16],g}function I6(t){const e=z.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 i;e[3]!==n?(i=X("flex flex-col gap-1.5 p-4",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx("div",{"data-slot":"sheet-header",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function N6(t){const e=z.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 i;e[3]!==n?(i=X("text-foreground font-semibold",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx(R0,{"data-slot":"sheet-title",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function v6(t){const e=z.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 i;e[3]!==n?(i=X("text-muted-foreground text-sm",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx(O0,{"data-slot":"sheet-description",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Ih(t){const e=z.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 i;e[3]!==n?(i=X("bg-accent animate-pulse rounded-md",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx("div",{"data-slot":"skeleton",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}const w6="sidebar_state",R6=3600*24*7,O6="16rem",L6="18rem",D6="3rem",P6="b",Nh=O.createContext(null);function ao(){const t=O.useContext(Nh);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function M6(t){const e=z.c(21),{defaultOpen:n,open:r,onOpenChange:i,children:s}=t,a=n===void 0?!0:n,o=jn(),[u,l]=O.useState(!1),[d,c]=O.useState(a),h=r??d;let m;e[0]!==h||e[1]!==i?(m=D=>{const P=typeof D=="function"?D(h):D;i?i(P):c(P),document.cookie=`${w6}=${P}; path=/; max-age=${R6}`},e[0]=h,e[1]=i,e[2]=m):m=e[2];const g=m;let E;e[3]!==o||e[4]!==g?(E=()=>o?l(F6):g(B6),e[3]=o,e[4]=g,e[5]=E):E=e[5];const T=E;let x,_;e[6]!==T?(x=()=>{const D=P=>{if(P.key===P6&&(P.metaKey||P.ctrlKey)){const v=P.target;if(v.tagName==="INPUT"||v.tagName==="TEXTAREA"||v.isContentEditable)return;P.preventDefault(),T()}};return globalThis.addEventListener("keydown",D),()=>globalThis.removeEventListener("keydown",D)},_=[T],e[6]=T,e[7]=x,e[8]=_):(x=e[7],_=e[8]),O.useEffect(x,_);const b=h?"expanded":"collapsed";let C;e[9]!==o||e[10]!==h||e[11]!==u||e[12]!==g||e[13]!==b||e[14]!==T?(C={state:b,open:h,setOpen:g,isMobile:o,openMobile:u,setOpenMobile:l,toggleSidebar:T},e[9]=o,e[10]=h,e[11]=u,e[12]=g,e[13]=b,e[14]=T,e[15]=C):C=e[15];const w=C;let y;e[16]!==s?(y=p.jsx(ip,{delayDuration:0,children:s}),e[16]=s,e[17]=y):y=e[17];let R;return e[18]!==w||e[19]!==y?(R=p.jsx(Nh.Provider,{value:w,children:y}),e[18]=w,e[19]=y,e[20]=R):R=e[20],R}function B6(t){return!t}function F6(t){return!t}function z6(t){const e=z.c(14);let n,r,i,s;e[0]!==t?({className:r,style:s,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s):(n=e[1],r=e[2],i=e[3],s=e[4]);let a;e[5]!==s?(a={"--sidebar-width":O6,"--sidebar-width-icon":D6,...s},e[5]=s,e[6]=a):a=e[6];const o=a;let u;e[7]!==r?(u=X("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-full w-full",r),e[7]=r,e[8]=u):u=e[8];let l;return e[9]!==n||e[10]!==i||e[11]!==o||e[12]!==u?(l=p.jsx("div",{"data-slot":"sidebar-wrapper",style:o,className:u,...i,children:n}),e[9]=n,e[10]=i,e[11]=o,e[12]=u,e[13]=l):l=e[13],l}function j6(t){const e=z.c(46);let n,r,i,s,a,o;e[0]!==t?({side:s,variant:a,collapsible:o,className:r,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s,e[5]=a,e[6]=o):(n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6]);const u=s===void 0?"left":s,l=a===void 0?"sidebar":a,d=o===void 0?"offcanvas":o,{isMobile:c,state:h,openMobile:m,setOpenMobile:g}=ao();if(d==="none"){let P;e[7]!==r?(P=X("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),e[7]=r,e[8]=P):P=e[8];let v;return e[9]!==n||e[10]!==i||e[11]!==P?(v=p.jsx("div",{"data-slot":"sidebar",className:P,...i,children:n}),e[9]=n,e[10]=i,e[11]=P,e[12]=v):v=e[12],v}if(c){let P;e[13]===Symbol.for("react.memo_cache_sentinel")?(P={"--sidebar-width":L6},e[13]=P):P=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=p.jsxs(I6,{className:"sr-only",children:[p.jsx(N6,{children:"Sidebar"}),p.jsx(v6,{children:"Displays the mobile sidebar."})]}),e[14]=v):v=e[14];let M;e[15]!==n?(M=p.jsx("div",{className:"flex h-full w-full flex-col",children:n}),e[15]=n,e[16]=M):M=e[16];let F;e[17]!==u||e[18]!==M?(F=p.jsxs(C6,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:P,side:u,children:[v,M]}),e[17]=u,e[18]=M,e[19]=F):F=e[19];let K;return e[20]!==m||e[21]!==i||e[22]!==g||e[23]!==F?(K=p.jsx(k6,{open:m,onOpenChange:g,...i,children:F}),e[20]=m,e[21]=i,e[22]=g,e[23]=F,e[24]=K):K=e[24],K}const E=h==="collapsed"?d:"",T=l==="floating"||l==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let x;e[25]!==T?(x=X("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",T),e[25]=T,e[26]=x):x=e[26];let _;e[27]!==x?(_=p.jsx("div",{"data-slot":"sidebar-gap",className:x}),e[27]=x,e[28]=_):_=e[28];const b=u==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",C=l==="floating"||l==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let w;e[29]!==r||e[30]!==b||e[31]!==C?(w=X("fixed top-12 bottom-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",b,C,r),e[29]=r,e[30]=b,e[31]=C,e[32]=w):w=e[32];let y;e[33]!==n?(y=p.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border py-2 flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:n}),e[33]=n,e[34]=y):y=e[34];let R;e[35]!==i||e[36]!==w||e[37]!==y?(R=p.jsx("div",{"data-slot":"sidebar-container",className:w,...i,children:y}),e[35]=i,e[36]=w,e[37]=y,e[38]=R):R=e[38];let D;return e[39]!==u||e[40]!==h||e[41]!==R||e[42]!==E||e[43]!==_||e[44]!==l?(D=p.jsxs("div",{className:"group peer text-foreground hidden md:block border-r","data-state":h,"data-collapsible":E,"data-variant":l,"data-side":u,"data-slot":"sidebar",children:[_,R]}),e[39]=u,e[40]=h,e[41]=R,e[42]=E,e[43]=_,e[44]=l,e[45]=D):D=e[45],D}function U6(t){const e=z.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 i;e[3]!==n?(i=X("bg-background relative flex w-full flex-1 flex-col min-w-0","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx("main",{"data-slot":"sidebar-inset",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function H6(t){const e=z.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 i;e[3]!==n?(i=X("h-4 m-0! w-full",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx("div",{"data-sidebar":"separator",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function $6(t){const e=z.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 i;e[3]!==n?(i=X("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Z6(t){const e=z.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 i;e[3]!==n?(i=X("relative flex w-full min-w-0 flex-col px-2 py-2 md:py-0",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Y6(t){const e=z.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 i;e[3]!==n?(i=X("w-full text-sm",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function q6(t){const e=z.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 i;e[3]!==n?(i=X("flex w-full min-w-0 flex-col gap-1",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function Ji(t){const e=z.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 i;e[3]!==n?(i=X("group/menu-item relative",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}const V6=B0("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-lg px-2 py-1.5 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding,colors] transition-colors duration-150 ease-out hover:transition-none focus-visible:ring-2 active:bg-sidebar-accent/75 disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent/75 [&>span:last-child]:truncate [&>svg]:size-[18px] [&>svg]:shrink-0 [&>svg]:text-muted-foreground",{variants:{variant:{default:"hover:bg-sidebar-accent text-sidebar-foreground/80 active:text-sidebar-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-7 text-sm font-[450]",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function vh(t){const e=z.c(28);let n,r,i,s,a,o,u;e[0]!==t?({asChild:i,isActive:s,variant:a,size:o,tooltip:u,className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s,e[5]=a,e[6]=o,e[7]=u):(n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],u=e[7]);const l=i===void 0?!1:i,d=s===void 0?!1:s,c=a===void 0?"default":a,h=o===void 0?"default":o,m=l?F0:"button",{isMobile:g,state:E}=ao();let T;e[8]!==n||e[9]!==h||e[10]!==c?(T=X(V6({variant:c,size:h}),n),e[8]=n,e[9]=h,e[10]=c,e[11]=T):T=e[11];let x;e[12]!==m||e[13]!==d||e[14]!==r||e[15]!==h||e[16]!==T?(x=p.jsx(m,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":h,"data-active":d,className:T,...r}),e[12]=m,e[13]=d,e[14]=r,e[15]=h,e[16]=T,e[17]=x):x=e[17];const _=x;if(!u)return _;if(typeof u=="string"){let R;e[18]!==u?(R={children:u},e[18]=u,e[19]=R):R=e[19],u=R}let b;e[20]!==_?(b=p.jsx(Ta,{asChild:!0,children:_}),e[20]=_,e[21]=b):b=e[21];const C=E!=="collapsed"||g;let w;e[22]!==C||e[23]!==u?(w=p.jsx(_a,{side:"right",align:"center",hidden:C,...u}),e[22]=C,e[23]=u,e[24]=w):w=e[24];let y;return e[25]!==b||e[26]!==w?(y=p.jsxs(ya,{children:[b,w]}),e[25]=b,e[26]=w,e[27]=y):y=e[27],y}function W6(t){const e=z.c(26),{item:n}=t,r=Pr(),{org:i}=Nt(),s=Ul(i.id),a=Ap(i.id);let o;e[0]!==a.update||e[1]!==n.url||e[2]!==s?.sidebar_items?(o=async()=>{const C=(s?.sidebar_items||[]).filter(w=>w.url!==n.url);await a.update.mutateAsync({sidebar_items:C})},e[0]=a.update,e[1]=n.url,e[2]=s?.sidebar_items,e[3]=o):o=e[3];const u=o;let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=/^https?:\/\/.+/,e[4]=l):l=e[4];let d;e[5]!==n.icon?(d=l.test(n.icon),e[5]=n.icon,e[6]=d):d=e[6];const c=d;let h;e[7]!==n.url||e[8]!==r?(h=()=>{r({to:n.url})},e[7]=n.url,e[8]=r,e[9]=h):h=e[9];const m=n.title;let g;e[10]!==c||e[11]!==n.icon||e[12]!==n.title?(g=p.jsx("div",{className:"flex items-center justify-center shrink-0",children:c?p.jsx("img",{src:n.icon,alt:n.title,className:"h-4 w-4 rounded object-cover"}):p.jsx(Pl,{size:16,className:"text-muted-foreground group-hover/item:text-foreground transition-colors"})}),e[10]=c,e[11]=n.icon,e[12]=n.title,e[13]=g):g=e[13];let E;e[14]!==n.title?(E=n.title.toLocaleLowerCase(),e[14]=n.title,e[15]=E):E=e[15];let T;e[16]!==E?(T=p.jsx("div",{className:"flex-1 min-w-0 flex flex-col items-start",children:p.jsx("span",{className:"truncate text-sm w-full capitalize",children:E})}),e[16]=E,e[17]=T):T=e[17];let x;e[18]!==u?(x=p.jsx(Ti,{size:16,className:"text-muted-foreground opacity-0 group-hover/item:opacity-50 hover:opacity-100 cursor-pointer",onClick:b=>{b.preventDefault(),b.stopPropagation(),u()}}),e[18]=u,e[19]=x):x=e[19];let _;return e[20]!==n.title||e[21]!==h||e[22]!==g||e[23]!==T||e[24]!==x?(_=p.jsx(Ji,{children:p.jsxs(vh,{className:"w-full pr-2 group/item relative cursor-pointer text-foreground/90 hover:text-foreground",onClick:h,tooltip:m,children:[g,T,x]})}),e[20]=n.title,e[21]=h,e[22]=g,e[23]=T,e[24]=x,e[25]=_):_=e[25],_}function G6(){const t=z.c(4),{org:e}=Nt(),r=Ul(e.id)?.sidebar_items;if(!r?.length)return null;let i;t[0]!==r?(i=r.map(K6),t[0]=r,t[1]=i):i=t[1];let s;return t[2]!==i?(s=p.jsx(wh,{children:i}),t[2]=i,t[3]=s):s=t[3],s}function K6(t){return p.jsx(W6,{item:t},t.url)}function ml(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=p.jsx(Ji,{children:p.jsx("div",{className:"flex items-center gap-2 px-4 py-2",children:p.jsx(Ih,{className:"h-4 flex-1"})})}),t[0]=e):e=t[0],e}function wh(t){const e=z.c(4),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsx(H6,{className:"my-2 -ml-1"}),e[0]=r):r=e[0];let i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=p.jsx(Ji,{children:p.jsx("div",{className:"group-data-[collapsible=icon]:hidden px-2 py-0 text-xs font-medium h-6 text-muted-foreground flex items-center justify-between",children:p.jsx("span",{className:"whitespace-nowrap",children:"Pinned Views"})})}),e[1]=i):i=e[1];let s;return e[2]!==n?(s=p.jsxs(p.Fragment,{children:[r,i,n]}),e[2]=n,e[3]=s):s=e[3],s}function Q6(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=p.jsx(O.Suspense,{fallback:p.jsxs(wh,{children:[p.jsx(ml,{}),p.jsx(ml,{})]}),children:p.jsx(G6,{})}),t[0]=e):e=t[0],e}function X6(){const t=z.c(43),{locator:e}=Nt(),n=Pr();let r;t[0]!==e?(r=fo.parse(e),t[0]=e,t[1]=r):r=t[1];const{org:i}=r;let s;t[2]!==e?(s=fo.isOrgAdminProject(e),t[2]=e,t[3]=s):s=t[3];const a=s;let o;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsx(fc,{}),t[4]=o):o=t[4];let u;t[5]!==n||t[6]!==i?(u={key:"home",label:"Home",icon:o,onClick:()=>n({to:"/$org",params:{org:i}})},t[5]=n,t[6]=i,t[7]=u):u=t[7];let l;t[8]===Symbol.for("react.memo_cache_sentinel")?(l=p.jsx(ac,{}),t[8]=l):l=t[8];let d;t[9]!==n||t[10]!==i?(d={key:"store",label:"Store",icon:l,onClick:()=>n({to:"/$org/store",params:{org:i}})},t[9]=n,t[10]=i,t[11]=d):d=t[11];let c;t[12]===Symbol.for("react.memo_cache_sentinel")?(c=p.jsx(ep,{}),t[12]=c):c=t[12];let h;t[13]!==n||t[14]!==i?(h={key:"mcps",label:"MCP Servers",icon:c,onClick:()=>n({to:"/$org/mcps",params:{org:i}})},t[13]=n,t[14]=i,t[15]=h):h=t[15];let m;t[16]===Symbol.for("react.memo_cache_sentinel")?(m=p.jsx(Rn,{}),t[16]=m):m=t[16];let g;t[17]!==n||t[18]!==i?(g={key:"gateways",label:"MCP Gateways",icon:m,onClick:()=>n({to:"/$org/gateways",params:{org:i}})},t[17]=n,t[18]=i,t[19]=g):g=t[19];let E;t[20]===Symbol.for("react.memo_cache_sentinel")?(E=p.jsx(sc,{}),t[20]=E):E=t[20];let T;t[21]!==n||t[22]!==i?(T={key:"monitoring",label:"Monitoring",icon:E,onClick:()=>n({to:"/$org/monitoring",params:{org:i}})},t[21]=n,t[22]=i,t[23]=T):T=t[23];let x;t[24]===Symbol.for("react.memo_cache_sentinel")?(x=p.jsx(Sc,{}),t[24]=x):x=t[24];let _;t[25]!==n||t[26]!==i?(_={key:"members",label:"Members",icon:x,onClick:()=>n({to:"/$org/members",params:{org:i}})},t[25]=n,t[26]=i,t[27]=_):_=t[27];let b;t[28]===Symbol.for("react.memo_cache_sentinel")?(b=p.jsx(xc,{}),t[28]=b):b=t[28];let C;t[29]!==n||t[30]!==i?(C={key:"settings",label:"Settings",icon:b,onClick:()=>n({to:"/$org/settings",params:{org:i}})},t[29]=n,t[30]=i,t[31]=C):C=t[31];let w;t[32]!==T||t[33]!==_||t[34]!==C||t[35]!==u||t[36]!==d||t[37]!==h||t[38]!==g?(w=[u,d,h,g,T,_,C],t[32]=T,t[33]=_,t[34]=C,t[35]=u,t[36]=d,t[37]=h,t[38]=g,t[39]=w):w=t[39];const y=w;let R;return t[40]!==y||t[41]!==a?(R=a?y:[],t[40]=y,t[41]=a,t[42]=R):R=t[42],R}function Rh(t){const e=z.c(10),{navigationItems:n,footer:r,additionalContent:i,variant:s,collapsible:a}=t,o=s===void 0?"sidebar":s,u=a===void 0?"icon":a;let l;e[0]!==n?(l=n.map(J6),e[0]=n,e[1]=l):l=e[1];let d;e[2]!==i||e[3]!==l?(d=p.jsx($6,{className:"flex-1 overflow-x-hidden",children:p.jsx(Z6,{className:"font-medium",children:p.jsx(Y6,{children:p.jsxs(q6,{className:"gap-0.5",children:[l,i]})})})}),e[2]=i,e[3]=l,e[4]=d):d=e[4];let c;return e[5]!==u||e[6]!==r||e[7]!==d||e[8]!==o?(c=p.jsxs(j6,{variant:o,collapsible:u,children:[d,r]}),e[5]=u,e[6]=r,e[7]=d,e[8]=o,e[9]=c):c=e[9],c}function J6(t){return p.jsx(Ji,{children:p.jsxs(vh,{className:"group/nav-item cursor-pointer text-foreground/90 hover:text-foreground",onClick:t.onClick,isActive:t.isActive,tooltip:t.label,children:[p.jsx("span",{className:"text-muted-foreground group-hover/nav-item:text-foreground transition-colors [&>svg]:size-4",children:t.icon}),p.jsx("span",{className:"truncate",children:t.label})]})},t.key)}Rh.Skeleton=function(){return p.jsx("div",{className:"flex flex-col gap-0.5",children:Array.from({length:8}).map((e,n)=>p.jsx("div",{className:"w-full h-8",children:p.jsx(Ih,{className:"h-full bg-sidebar-accent rounded-md"})},n))})};function eI(){const t=z.c(3),e=X6();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=p.jsx(p.Fragment,{children:p.jsx(jl,{children:p.jsx(O.Suspense,{fallback:null,children:p.jsx(Q6,{})})})}),t[0]=n):n=t[0];let r;return t[1]!==e?(r=p.jsx(Rh,{navigationItems:e,additionalContent:n}),t[1]=e,t[2]=r):r=t[2],r}function tI(t){const e=z.c(12);let n,r,i,s;e[0]!==t?({className:n,orientation:i,decorative:s,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s):(n=e[1],r=e[2],i=e[3],s=e[4]);const a=i===void 0?"horizontal":i,o=s===void 0?!0:s;let u;e[5]!==n?(u=X("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),e[5]=n,e[6]=u):u=e[6];let l;return e[7]!==o||e[8]!==a||e[9]!==r||e[10]!==u?(l=p.jsx(z0,{"data-slot":"separator-root",decorative:o,orientation:a,className:u,...r}),e[7]=o,e[8]=a,e[9]=r,e[10]=u,e[11]=l):l=e[11],l}const Oh=O.createContext(null);function nI(){const t=O.useContext(Oh);if(!t)throw new Error("TopbarSwitcher compound components must be used within TopbarSwitcher.Root");return t}function rI(t){const e=z.c(10),{children:n,onItemHover:r}=t,[i,s]=O.useState(null);let a;e[0]!==r?(a=c=>{s(c),r?.(c)},e[0]=r,e[1]=a):a=e[1];const o=a;let u;e[2]!==i||e[3]!==o?(u={hoveredItem:i,setHoveredItem:o},e[2]=i,e[3]=o,e[4]=u):u=e[4];let l;e[5]!==n?(l=p.jsx(Ml,{children:n}),e[5]=n,e[6]=l):l=e[6];let d;return e[7]!==u||e[8]!==l?(d=p.jsx(Oh.Provider,{value:u,children:l}),e[7]=u,e[8]=l,e[9]=d):d=e[9],d}function iI(t){const e=z.c(6),{children:n,onClick:r}=t;let i;e[0]!==n||e[1]!==r?(i=p.jsx(at,{variant:"link",className:"p-0.5 h-auto",onClick:r,type:"button",children:n}),e[0]=n,e[1]=r,e[2]=i):i=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=p.jsx(Bl,{asChild:!0,children:p.jsx(at,{size:"icon",variant:"ghost",className:"w-6 h-6 p-0",children:p.jsx(oc,{size:16,className:"opacity-50"})})}),e[3]=s):s=e[3];let a;return e[4]!==i?(a=p.jsxs("div",{className:"flex items-center gap-1",children:[i,s]}),e[4]=i,e[5]=a):a=e[5],a}function sI(t){const e=z.c(8),{item:n,fallback:r}=t,i=r===void 0?"":r,s=n?.avatarUrl??"",a=n?.name??i;let o;e[0]!==s||e[1]!==a?(o=p.jsx(Un,{url:s,fallback:a,size:"xs",objectFit:"contain"}),e[0]=s,e[1]=a,e[2]=o):o=e[2];const u=n?.name??i;let l;e[3]!==u?(l=p.jsx("span",{children:u}),e[3]=u,e[4]=l):l=e[4];let d;return e[5]!==o||e[6]!==l?(d=p.jsxs("div",{className:"flex items-center gap-2",children:[o,l]}),e[5]=o,e[6]=l,e[7]=d):d=e[7],d}function aI(t){const e=z.c(6),{children:n,align:r}=t,i=r===void 0?"start":r,a=O.Children.toArray(n).filter(oI).length===1?"280px":"480px";let o;e[0]!==a?(o={width:a},e[0]=a,e[1]=o):o=e[1];let u;return e[2]!==i||e[3]!==n||e[4]!==o?(u=p.jsx(Fl,{align:i,className:"p-0 flex items-start",style:o,children:n}),e[2]=i,e[3]=n,e[4]=o,e[5]=u):u=e[5],u}function oI(t){return O.isValidElement(t)&&(t.type===Dh||t.type===Lh)}function Lh(t){const e=z.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex flex-col border-border w-[240px] border-r last:border-r-0 last:w-full",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=p.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}const Dh=Lh;function uI(t){const e=z.c(6),{placeholder:n,value:r,onChange:i}=t,s=n===void 0?"Search...":n;let a;e[0]!==i?(a=u=>i(u.target.value),e[0]=i,e[1]=a):a=e[1];let o;return e[2]!==s||e[3]!==a||e[4]!==r?(o=p.jsx(Ip,{placeholder:s,value:r,onChange:a,className:"rounded-none border-t-0 border-x-0 focus-visible:border-border focus-visible:ring-0"}),e[2]=s,e[3]=a,e[4]=r,e[5]=o):o=e[5],o}function lI(t){const e=z.c(6),{children:n,emptyMessage:r}=t,i=r===void 0?"No items found.":r,s=O.Children.count(n)>0;let a;e[0]!==i||e[1]!==s?(a=!s&&p.jsx("div",{className:"text-muted-foreground text-sm px-1 py-8 text-center",children:i}),e[0]=i,e[1]=s,e[2]=a):a=e[2];let o;return e[3]!==n||e[4]!==a?(o=p.jsxs("div",{className:"flex flex-col gap-0.5 p-1 max-h-44 overflow-y-auto",children:[a,n]}),e[3]=n,e[4]=a,e[5]=o):o=e[5],o}function cI(t){const e=z.c(15),{item:n,onClick:r,onHover:i,children:s}=t,a=nI();let o;e[0]!==a||e[1]!==n||e[2]!==i?(o=()=>{a.setHoveredItem(n.slug),i?.(n)},e[0]=a,e[1]=n,e[2]=i,e[3]=o):o=e[3];const u=o;let l;e[4]!==n||e[5]!==r?(l=()=>r(n),e[4]=n,e[5]=r,e[6]=l):l=e[6];let d;e[7]!==s||e[8]!==n.avatarUrl||e[9]!==n.name?(d=s||p.jsxs(p.Fragment,{children:[p.jsx(Un,{url:n.avatarUrl??"",fallback:n.name,size:"xs",className:"w-[22px]! h-[22px]!",objectFit:"contain"}),p.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:n.name})]}),e[7]=s,e[8]=n.avatarUrl,e[9]=n.name,e[10]=d):d=e[10];let c;return e[11]!==u||e[12]!==l||e[13]!==d?(c=p.jsx(at,{onClick:l,onMouseEnter:u,variant:"ghost",size:"sm",className:"w-full justify-start font-normal",children:d}),e[11]=u,e[12]=l,e[13]=d,e[14]=c):c=e[14],c}function dI(t){const e=z.c(2),{children:n}=t;let r;return e[0]!==n?(r=p.jsx("div",{className:"px-1 pb-1 pt-0.5",children:n}),e[0]=n,e[1]=r):r=e[1],r}function fI(t){const e=z.c(11),{onClick:n,icon:r,children:i,variant:s}=t,o=(s===void 0?"default":s)==="muted"&&"text-muted-foreground";let u;e[0]!==o?(u=X("w-full justify-start font-normal",o),e[0]=o,e[1]=u):u=e[1];let l;e[2]!==r?(l=r&&p.jsx("span",{className:"[&>svg]:size-4",children:r}),e[2]=r,e[3]=l):l=e[3];let d;e[4]!==i?(d=p.jsx("span",{children:i}),e[4]=i,e[5]=d):d=e[5];let c;return e[6]!==n||e[7]!==u||e[8]!==l||e[9]!==d?(c=p.jsxs(at,{variant:"ghost",size:"sm",className:u,onClick:n,children:[l,d]}),e[6]=n,e[7]=u,e[8]=l,e[9]=d,e[10]=c):c=e[10],c}function hI(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=p.jsx(tI,{}),t[0]=e):e=t[0],e}function pI(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=p.jsx("div",{className:"h-4 w-16 bg-accent rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const it=Object.assign(rI,{Trigger:iI,CurrentItem:sI,Content:aI,Panel:Dh,Search:uI,Items:lI,Item:cI,Actions:dI,Action:fI,Separator:hI,Skeleton:pI});function fa(){const t=z.c(59);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:n}=Rl(e),{data:r}=Mr.useListOrganizations(),i=Pr();let s;t[1]!==n||t[2]!==r?(s=r?.find(Y=>Y.slug===n),t[1]=n,t[2]=r,t[3]=s):s=t[3];const a=s,[o,u]=O.useState(""),[l,d]=O.useState(!1);let c,h,m,g,E,T,x,_;if(t[4]!==a||t[5]!==i||t[6]!==n||t[7]!==o||t[8]!==r){const H=(r?(()=>{const V=r.filter(ne=>ne.name.toLowerCase().includes(o.toLowerCase()));if(n){const ne=V.findIndex(S=>S.slug===n);if(ne>0){const S=V[ne];S&&(V.splice(ne,1),V.unshift(S))}}return V})():[]).map(mI);let J;t[17]!==a?(J=a?{slug:a.slug,name:a.name,avatarUrl:a.logo}:void 0,t[17]=a,t[18]=J):J=t[18];const de=J;g=it;let ue;t[19]!==i||t[20]!==n?(ue=()=>i({to:"/$org",params:{org:n??""}}),t[19]=i,t[20]=n,t[21]=ue):ue=t[21];let me;t[22]!==de?(me=p.jsx(it.CurrentItem,{item:de}),t[22]=de,t[23]=me):me=t[23],t[24]!==ue||t[25]!==me?(_=p.jsx(it.Trigger,{onClick:ue,children:me}),t[24]=ue,t[25]=me,t[26]=_):_=t[26],m=it.Content,h=it.Panel,t[27]!==o?(x=p.jsx(it.Search,{placeholder:"Search organizations...",value:o,onChange:u}),t[27]=o,t[28]=x):x=t[28],c=it.Items,E="No organizations found.";let N;t[29]!==i?(N=V=>p.jsx(it.Item,{item:V,onClick:ne=>i({to:"/$org",params:{org:ne.slug}})},V.slug),t[29]=i,t[30]=N):N=t[30],T=H.map(N),t[4]=a,t[5]=i,t[6]=n,t[7]=o,t[8]=r,t[9]=c,t[10]=h,t[11]=m,t[12]=g,t[13]=E,t[14]=T,t[15]=x,t[16]=_}else c=t[9],h=t[10],m=t[11],g=t[12],E=t[13],T=t[14],x=t[15],_=t[16];let b;t[31]!==c||t[32]!==E||t[33]!==T?(b=p.jsx(c,{emptyMessage:E,children:T}),t[31]=c,t[32]=E,t[33]=T,t[34]=b):b=t[34];let C,w;t[35]===Symbol.for("react.memo_cache_sentinel")?(C=p.jsx(it.Actions,{children:p.jsx(it.Action,{onClick:()=>d(!0),variant:"muted",children:"+ Create organization"})}),w=p.jsx(it.Separator,{}),t[35]=C,t[36]=w):(C=t[35],w=t[36]);let y;t[37]!==i?(y=()=>i({to:"/"}),t[37]=i,t[38]=y):y=t[38];let R;t[39]===Symbol.for("react.memo_cache_sentinel")?(R=p.jsx(Dl,{}),t[39]=R):R=t[39];let D;t[40]!==y?(D=p.jsx(it.Actions,{children:p.jsx(it.Action,{onClick:y,icon:R,children:"See all organizations"})}),t[40]=y,t[41]=D):D=t[41];let P;t[42]!==h||t[43]!==D||t[44]!==x||t[45]!==b?(P=p.jsxs(h,{children:[x,b,C,w,D]}),t[42]=h,t[43]=D,t[44]=x,t[45]=b,t[46]=P):P=t[46];let v;t[47]!==m||t[48]!==P?(v=p.jsx(m,{children:P}),t[47]=m,t[48]=P,t[49]=v):v=t[49];let M;t[50]!==g||t[51]!==v||t[52]!==_?(M=p.jsxs(g,{children:[_,v]}),t[50]=g,t[51]=v,t[52]=_,t[53]=M):M=t[53];let F;t[54]!==l?(F=p.jsx(Cp,{open:l,onOpenChange:d}),t[54]=l,t[55]=F):F=t[55];let K;return t[56]!==M||t[57]!==F?(K=p.jsxs(p.Fragment,{children:[M,F]}),t[56]=M,t[57]=F,t[58]=K):K=t[58],K}function mI(t){return{slug:t.slug,name:t.name,avatarUrl:t.logo}}fa.Skeleton=it.Skeleton;const Ph=O.createContext({setOpen:()=>{}}),gI=()=>O.useContext(Ph),bI=t=>{const e=z.c(25);let n,r,i,s,a;e[0]!==t?({children:n,defaultOpen:r,open:s,onOpenChange:i,...a}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=s,e[5]=a):(n=e[1],r=e[2],i=e[3],s=e[4],a=e[5]);const o=r??!1;let u;e[6]!==i||e[7]!==s||e[8]!==o?(u={prop:s,defaultProp:o,onChange:i},e[6]=i,e[7]=s,e[8]=o,e[9]=u):u=e[9];const[l,d]=Vs(u);let c;e[10]!==d?(c={setOpen:d},e[10]=d,e[11]=c):c=e[11];let h;e[12]!==n||e[13]!==l||e[14]!==a||e[15]!==d?(h=p.jsx(sd,{open:l,onOpenChange:d,...a,children:n}),e[12]=n,e[13]=l,e[14]=a,e[15]=d,e[16]=h):h=e[16];let m;e[17]!==l||e[18]!==a||e[19]!==d||e[20]!==h?(m=p.jsx(mp,{open:l,onOpenChange:d,...a,children:h}),e[17]=l,e[18]=a,e[19]=d,e[20]=h,e[21]=m):m=e[21];let g;return e[22]!==c||e[23]!==m?(g=p.jsx(Ph.Provider,{value:c,children:m}),e[22]=c,e[23]=m,e[24]=g):g=e[24],g},EI=t=>{const{children:e,title:n,...r}=t,i=jn(),{className:s,...a}=r;return i?p.jsxs(od,{...a,children:[p.jsx(ud,{className:"hidden",children:p.jsx(ld,{children:n})}),p.jsx("div",{className:X("flex flex-col gap-2 p-2 py-4",s),children:e})]}):p.jsx(pp,{...r,children:e})},xI=t=>{const{children:e,...n}=t,{setOpen:r}=gI(),i=jn(),{className:s,...a}=n;return i?p.jsx("div",{...a,onClick:o=>{r(!1);const{onClick:u}=a;u?.(o)},className:X("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",s),children:e}):p.jsx(gp,{...n,children:e})},TI=t=>{const e=z.c(7);let n,r;e[0]!==t?({children:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const i=jn();let s;return e[3]!==n||e[4]!==i||e[5]!==r?(s=i?p.jsx(ad,{asChild:!0,children:n}):p.jsx(hp,{...r,children:n}),e[3]=n,e[4]=i,e[5]=r,e[6]=s):s=e[6],s},_I=t=>{const e=z.c(7);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]);const i=jn();let s;return e[3]!==n||e[4]!==i||e[5]!==r?(s=i?p.jsx(ho,{className:X(n),...r}):p.jsx(ho,{className:X(n),...r}),e[3]=n,e[4]=i,e[5]=r,e[6]=s):s=e[6],s};function yI(t){const e=z.c(11),{user:n,trigger:r,align:i,children:s}=t,a=i===void 0?"start":i;let o;e[0]!==r||e[1]!==n?(o=r(n),e[0]=r,e[1]=n,e[2]=o):o=e[2];let u;e[3]!==o?(u=p.jsx(TI,{asChild:!0,children:p.jsx("div",{children:o})}),e[3]=o,e[4]=u):u=e[4];let l;e[5]!==a||e[6]!==s?(l=p.jsx(EI,{side:"top",align:a,className:"md:w-[240px]",children:s}),e[5]=a,e[6]=s,e[7]=l):l=e[7];let d;return e[8]!==u||e[9]!==l?(d=p.jsxs(bI,{children:[u,l]}),e[8]=u,e[9]=l,e[10]=d):d=e[10],d}function kI(t){const e=z.c(8),{children:n,onClick:r,className:i,asChild:s}=t;let a;e[0]!==s||e[1]!==n||e[2]!==r?(a=s?n:p.jsx("button",{type:"button",className:"flex items-center gap-2 text-sm w-full cursor-pointer",onClick:r,children:n}),e[0]=s,e[1]=n,e[2]=r,e[3]=a):a=e[3];let o;return e[4]!==s||e[5]!==i||e[6]!==a?(o=p.jsx(xI,{asChild:s,className:i,children:a}),e[4]=s,e[5]=i,e[6]=a,e[7]=o):o=e[7],o}function SI(t){const e=z.c(2),{className:n}=t;let r;return e[0]!==n?(r=p.jsx(_I,{className:n}),e[0]=n,e[1]=r):r=e[1],r}function AI(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=p.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"}),t[0]=e):e=t[0],e}const jt=Object.assign(yI,{Item:kI,Separator:SI,Skeleton:AI});function CI(t){const e=z.c(32),{open:n,onOpenChange:r,user:i,userImage:s}=t,[a,o]=O.useState(!1);let u;e[0]!==i.id?(u=()=>{navigator.clipboard.writeText(i.id),o(!0),setTimeout(()=>o(!1),2e3)},e[0]=i.id,e[1]=u):u=e[1];const l=u;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=p.jsxs(Hl,{children:[p.jsx($l,{children:"Profile"}),p.jsx(Zl,{children:"Your account information"})]}),e[2]=d):d=e[2];const c=i.name||i.email||"U";let h;e[3]!==c||e[4]!==s?(h=p.jsx(Un,{url:s,fallback:c,shape:"circle",size:"2xl"}),e[3]=c,e[4]=s,e[5]=h):h=e[5];const m=i.name||i.email;let g;e[6]!==m?(g=p.jsx("div",{className:"text-lg font-semibold text-center",children:m}),e[6]=m,e[7]=g):g=e[7];let E;e[8]!==i.email?(E=p.jsx("div",{className:"text-sm text-muted-foreground text-center",children:i.email}),e[8]=i.email,e[9]=E):E=e[9];let T;e[10]!==g||e[11]!==E?(T=p.jsxs("div",{className:"flex flex-col items-center gap-2 w-full",children:[g,E]}),e[10]=g,e[11]=E,e[12]=T):T=e[12];let x;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=p.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"User ID"}),e[13]=x):x=e[13];let _;e[14]!==i.id?(_=p.jsxs("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[x,p.jsx("span",{className:"text-sm font-mono truncate",children:i.id})]}),e[14]=i.id,e[15]=_):_=e[15];let b;e[16]!==a?(b=a?p.jsx(Wt,{size:16,className:"text-green-600"}):p.jsx(Fr,{size:16,className:"text-muted-foreground"}),e[16]=a,e[17]=b):b=e[17];let C;e[18]!==l||e[19]!==b?(C=p.jsx("button",{type:"button",onClick:l,className:"flex-shrink-0 p-2 hover:bg-background rounded-md transition-colors","aria-label":"Copy user ID",children:b}),e[18]=l,e[19]=b,e[20]=C):C=e[20];let w;e[21]!==_||e[22]!==C?(w=p.jsxs("div",{className:"flex items-center justify-between gap-3 w-full px-4 py-3 rounded-lg bg-muted/50 border border-border",children:[_,C]}),e[21]=_,e[22]=C,e[23]=w):w=e[23];let y;e[24]!==w||e[25]!==h||e[26]!==T?(y=p.jsxs(Yl,{className:"sm:max-w-md",children:[d,p.jsxs("div",{className:"flex flex-col items-center gap-6 py-4",children:[h,T,w]})]}),e[24]=w,e[25]=h,e[26]=T,e[27]=y):y=e[27];let R;return e[28]!==r||e[29]!==n||e[30]!==y?(R=p.jsx(ql,{open:n,onOpenChange:r,children:y}),e[28]=r,e[29]=n,e[30]=y,e[31]=R):R=e[31],R}function II(t){const e=z.c(5),{open:n,onOpenChange:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=p.jsxs(Hl,{children:[p.jsx($l,{children:"Invitations"}),p.jsx(Zl,{children:"Your pending organization invitations"})]}),e[0]=i):i=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=p.jsxs(Yl,{className:"sm:max-w-lg",children:[i,p.jsx("div",{className:"max-h-[420px] overflow-auto pr-1",children:p.jsx(H0,{})})]}),e[1]=s):s=e[1];let a;return e[2]!==r||e[3]!==n?(a=p.jsx(ql,{open:n,onOpenChange:r,children:s}),e[2]=r,e[3]=n,e[4]=a):a=e[4],a}function NI(t){const e=z.c(31),{user:n,userImage:r,hasInvites:i,showInvitesItem:s}=t,[a,o]=O.useState(!1),[u,l]=O.useState(!1);let d;e[0]!==i||e[1]!==n.email||e[2]!==n.name||e[3]!==r?(d=()=>p.jsxs("div",{className:"relative",children:[p.jsx(Un,{url:r,fallback:n.name||n.email||"U",shape:"circle",size:"sm",className:"cursor-pointer hover:ring-2 ring-muted-foreground transition-all"}),i&&p.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2.5 w-2.5 rounded-full bg-destructive ring-2 ring-background"})]}),e[0]=i,e[1]=n.email,e[2]=n.name,e[3]=r,e[4]=d):d=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=p.jsxs(jt.Item,{onClick:()=>o(!0),children:[p.jsx(kc,{className:"text-muted-foreground",size:18}),"Profile"]}),e[5]=c):c=e[5];let h;e[6]!==i||e[7]!==s?(h=s&&p.jsxs(jt.Item,{onClick:()=>l(!0),children:[p.jsx(Ec,{className:"text-muted-foreground",size:18}),"Invitations",i&&p.jsx("span",{className:"ml-auto h-2 w-2 rounded-full bg-destructive"})]}),e[6]=i,e[7]=s,e[8]=h):h=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=p.jsx(jt.Separator,{}),e[9]=m):m=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=p.jsx(U0,{className:"w-4 h-4 text-muted-foreground"}),e[10]=g):g=e[10];let E;e[11]===Symbol.for("react.memo_cache_sentinel")?(E=p.jsx(jt.Item,{asChild:!0,children:p.jsxs("a",{href:"https://github.com/decocms/admin",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[g,"decocms/admin",p.jsx(Bs,{size:18,className:"text-muted-foreground ml-auto"})]})}),e[11]=E):E=e[11];let T;e[12]===Symbol.for("react.memo_cache_sentinel")?(T=p.jsx(dc,{className:"text-muted-foreground",size:18}),e[12]=T):T=e[12];let x,_;e[13]===Symbol.for("react.memo_cache_sentinel")?(x=p.jsx(jt.Item,{asChild:!0,children:p.jsxs("a",{href:"https://decocms.com",target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center gap-2 text-sm cursor-pointer",children:[T,"Homepage",p.jsx(Bs,{size:18,className:"ml-auto text-muted-foreground"})]})}),_=p.jsx(jt.Separator,{}),e[13]=x,e[14]=_):(x=e[13],_=e[14]);let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=p.jsxs(jt.Item,{onClick:vI,children:[p.jsx(gc,{size:18,className:"text-muted-foreground"}),"Log out"]}),e[15]=b):b=e[15];let C;e[16]!==d||e[17]!==h||e[18]!==n?(C=p.jsxs(jt,{user:n,trigger:d,align:"end",children:[c,h,m,E,x,_,b]}),e[16]=d,e[17]=h,e[18]=n,e[19]=C):C=e[19];let w;e[20]!==a||e[21]!==n||e[22]!==r?(w=a&&p.jsx(CI,{open:a,onOpenChange:o,user:n,userImage:r}),e[20]=a,e[21]=n,e[22]=r,e[23]=w):w=e[23];let y;e[24]!==u||e[25]!==s?(y=s&&u&&p.jsx(II,{open:u,onOpenChange:l}),e[24]=u,e[25]=s,e[26]=y):y=e[26];let R;return e[27]!==C||e[28]!==w||e[29]!==y?(R=p.jsxs(p.Fragment,{children:[C,w,y]}),e[27]=C,e[28]=w,e[29]=y,e[30]=R):R=e[30],R}function vI(){return Mr.signOut()}function wI(){const{data:t}=Mr.useSession(),e=O.useContext(j0),{data:n}=e.hooks.useListUserInvitations(),i=(n??[]).length>0;if(!t?.user)return p.jsx(Un,{url:void 0,fallback:"U",shape:"circle",size:"sm",className:"cursor-pointer",muted:!0});const s=t.user,a={...s,name:s.name??void 0},o=s.image;return p.jsx(NI,{user:a,userImage:o,hasInvites:i,showInvitesItem:!0})}function RI(t){const e=z.c(6),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsx($0,{children:p.jsx(Ol,{})}),e[0]=r):r=e[0];let i;e[1]!==n?(i=p.jsx(Z0,{children:n}),e[1]=n,e[2]=i):i=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=p.jsx(Y0,{children:p.jsx(q0,{to:"/login",replace:!0})}),e[3]=s):s=e[3];let a;return e[4]!==i?(a=p.jsxs(p.Fragment,{children:[r,i,s]}),e[4]=i,e[5]=a):a=e[5],a}function OI(t){const e=z.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=p.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function LI(t){const e=z.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex items-center justify-center px-2 h-full border-r border-border",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=p.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function DI(t){const e=z.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex items-center gap-2 px-2 h-full",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=p.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function PI(t){const e=z.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex items-center gap-2 px-2 h-full flex-1",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=p.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function MI(t){const e=z.c(5),{children:n,className:r}=t;let i;e[0]!==r?(i=X("flex items-center gap-2 px-2 h-full ml-auto",r),e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==n||e[3]!==i?(s=p.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=s):s=e[4],s}function BI(){const t=z.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=p.jsx("div",{className:"flex items-center justify-center px-2 h-full border-r border-border",children:p.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=p.jsx("div",{className:"flex items-center gap-2 px-2 h-full",children:p.jsx("div",{className:"w-32 h-6 bg-muted rounded-md animate-pulse"})}),t[1]=n):n=t[1];let r;return t[2]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsxs("div",{className:"fixed top-0 left-0 right-0 z-20 bg-sidebar flex items-center w-full h-12 border-b border-border",children:[e,n,p.jsx("div",{className:"flex items-center gap-2 px-2 h-full ml-auto",children:p.jsx("div",{className:"w-8 h-8 bg-muted rounded-full animate-pulse"})})]}),t[2]=r):r=t[2],r}const si=Object.assign(OI,{Sidebar:LI,Left:DI,Center:PI,Right:MI,Skeleton:BI});function FI(){const t=z.c(7);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=p.jsx("div",{className:"size-10 rounded-xl bg-muted animate-pulse"}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=p.jsxs("div",{className:"flex items-center gap-3",children:[e,p.jsxs("div",{className:"flex flex-col gap-2",children:[p.jsx("div",{className:"h-4 w-24 rounded bg-muted animate-pulse"}),p.jsx("div",{className:"h-3 w-32 rounded bg-muted/60 animate-pulse"})]})]}),t[1]=n):n=t[1];let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=p.jsx("div",{className:"flex-none border-b border-border/80 px-5 pb-4 pt-6",children:p.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n,p.jsxs("div",{className:"flex flex-col items-end gap-2",children:[p.jsx("div",{className:"h-5 w-20 rounded-full bg-muted animate-pulse"}),p.jsx("div",{className:"h-8 w-48 rounded-lg bg-muted animate-pulse"})]})]})}),t[2]=r):r=t[2];let i;t[3]===Symbol.for("react.memo_cache_sentinel")?(i=p.jsx("div",{className:"flex-1 overflow-hidden px-4 py-4",children:p.jsxs("div",{className:"mx-auto flex max-w-2xl flex-col gap-4",children:[p.jsx(ai,{align:"right",width:"w-3/4"}),p.jsx(ai,{align:"left",width:"w-full",lines:3}),p.jsx(ai,{align:"right",width:"w-2/3"}),p.jsx(ai,{align:"left",width:"w-5/6",lines:2})]})}),t[3]=i):i=t[3];let s;t[4]===Symbol.for("react.memo_cache_sentinel")?(s=p.jsx("div",{className:"relative flex flex-1 flex-col gap-2 p-2.5",children:p.jsx("div",{className:"relative flex-1",children:p.jsxs("div",{className:"space-y-2 p-2",children:[p.jsx("div",{className:"h-3 w-full rounded bg-muted/40 animate-pulse"}),p.jsx("div",{className:"h-3 w-4/5 rounded bg-muted/40 animate-pulse"})]})})}),t[4]=s):s=t[4];let a;t[5]===Symbol.for("react.memo_cache_sentinel")?(a=p.jsx("div",{className:"flex items-center gap-1",children:p.jsx("div",{className:"size-8 rounded-full bg-muted/60 animate-pulse"})}),t[5]=a):a=t[5];let o;return t[6]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsxs("div",{className:"flex h-full w-full flex-col bg-sidebar",children:[r,i,p.jsx("div",{className:"flex-none border-t border-border/80 px-5 py-4",children:p.jsx("div",{className:"space-y-3",children:p.jsxs("div",{className:"relative flex min-h-[130px] flex-col rounded-xl border border-border bg-background shadow-sm",children:[s,p.jsxs("div",{className:"flex items-center justify-between px-2.5 pb-2.5",children:[a,p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx("div",{className:"h-8 w-32 rounded-lg bg-muted/60 animate-pulse"}),p.jsx("div",{className:"size-8 rounded-full bg-muted animate-pulse"})]})]})]})})})]}),t[6]=o):o=t[6],o}function ai(t){const e=z.c(22),{align:n,width:r,lines:i}=t,s=r===void 0?"w-full":r,a=i===void 0?1:i,o=n==="right"?"flex-row-reverse":"flex-row";let u;e[0]!==o?(u=X("flex w-full gap-4 px-4 py-2",o),e[0]=o,e[1]=u):u=e[1];const l=n==="right"?"ml-auto max-w-3/4 items-end":"w-full items-start";let d;e[2]!==l?(d=X("flex min-w-0 flex-col gap-2",l),e[2]=l,e[3]=d):d=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=p.jsx("div",{className:"h-3 w-16 rounded bg-muted/40 animate-pulse"}),e[4]=c):c=e[4];const h=n==="right"?"bg-muted":"bg-transparent border border-border/40";let m;e[5]!==h||e[6]!==s?(m=X("min-w-0 rounded-2xl p-4",h,s),e[5]=h,e[6]=s,e[7]=m):m=e[7];let g;e[8]!==a?(g=Array.from({length:a}),e[8]=a,e[9]=g):g=e[9];let E;e[10]!==a||e[11]!==g?(E=p.jsx("div",{className:"space-y-2",children:g.map((b,C)=>p.jsx("div",{className:X("h-3 rounded bg-muted-foreground/20 animate-pulse",C===a-1?"w-3/4":"w-full"),style:{animationDelay:`${C*.1}s`}},C))}),e[10]=a,e[11]=g,e[12]=E):E=e[12];let T;e[13]!==E||e[14]!==m?(T=p.jsx("div",{className:m,children:E}),e[13]=E,e[14]=m,e[15]=T):T=e[15];let x;e[16]!==T||e[17]!==d?(x=p.jsxs("div",{className:d,children:[c,T]}),e[16]=T,e[17]=d,e[18]=x):x=e[18];let _;return e[19]!==x||e[20]!==u?(_=p.jsx("div",{className:u,children:x}),e[19]=x,e[20]=u,e[21]=_):_=e[21],_}const es=O.createContext(null);es.displayName="PanelGroupContext";const je={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},oo=10,dn=O.useLayoutEffect,gl=V0.useId,zI=typeof gl=="function"?gl:()=>null;let jI=0;function uo(t=null){const e=zI(),n=O.useRef(t||e||null);return n.current===null&&(n.current=""+jI++),t??n.current}function Mh({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:s,id:a,maxSize:o,minSize:u,onCollapse:l,onExpand:d,onResize:c,order:h,style:m,tagName:g="div",...E}){const T=O.useContext(es);if(T===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:_,getPanelSize:b,getPanelStyle:C,groupId:w,isPanelCollapsed:y,reevaluatePanelConstraints:R,registerPanel:D,resizePanel:P,unregisterPanel:v}=T,M=uo(a),F=O.useRef({callbacks:{onCollapse:l,onExpand:d,onResize:c},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:o,minSize:u},id:M,idIsFromProps:a!==void 0,order:h});O.useRef({didLogMissingDefaultSizeWarning:!1}),dn(()=>{const{callbacks:Y,constraints:H}=F.current,J={...H};F.current.id=M,F.current.idIsFromProps=a!==void 0,F.current.order=h,Y.onCollapse=l,Y.onExpand=d,Y.onResize=c,H.collapsedSize=n,H.collapsible=r,H.defaultSize=i,H.maxSize=o,H.minSize=u,(J.collapsedSize!==H.collapsedSize||J.collapsible!==H.collapsible||J.maxSize!==H.maxSize||J.minSize!==H.minSize)&&R(F.current,J)}),dn(()=>{const Y=F.current;return D(Y),()=>{v(Y)}},[h,M,D,v]),O.useImperativeHandle(s,()=>({collapse:()=>{x(F.current)},expand:Y=>{_(F.current,Y)},getId(){return M},getSize(){return b(F.current)},isCollapsed(){return y(F.current)},isExpanded(){return!y(F.current)},resize:Y=>{P(F.current,Y)}}),[x,_,b,y,M,P]);const K=C(F.current,i);return O.createElement(g,{...E,children:t,className:e,id:M,style:{...K,...m},[je.groupId]:w,[je.panel]:"",[je.panelCollapsible]:r||void 0,[je.panelId]:M,[je.panelSize]:parseFloat(""+K.flexGrow).toFixed(1)})}const Bh=O.forwardRef((t,e)=>O.createElement(Mh,{...t,forwardedRef:e}));Mh.displayName="Panel";Bh.displayName="forwardRef(Panel)";let ha=null,gi=-1,Yt=null;function UI(t,e){if(e){const n=(e&Hh)!==0,r=(e&$h)!==0,i=(e&Zh)!==0,s=(e&Yh)!==0;if(n)return i?"se-resize":s?"ne-resize":"e-resize";if(r)return i?"sw-resize":s?"nw-resize":"w-resize";if(i)return"s-resize";if(s)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function HI(){Yt!==null&&(document.head.removeChild(Yt),ha=null,Yt=null,gi=-1)}function ws(t,e){var n,r;const i=UI(t,e);if(ha!==i){if(ha=i,Yt===null&&(Yt=document.createElement("style"),document.head.appendChild(Yt)),gi>=0){var s;(s=Yt.sheet)===null||s===void 0||s.removeRule(gi)}gi=(n=(r=Yt.sheet)===null||r===void 0?void 0:r.insertRule(`*{cursor: ${i} !important;}`))!==null&&n!==void 0?n:-1}}function Fh(t){return t.type==="keydown"}function zh(t){return t.type.startsWith("pointer")}function jh(t){return t.type.startsWith("mouse")}function ts(t){if(zh(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(jh(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function $I(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function ZI(t,e,n){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function YI(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:xl(t),b:xl(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;pe(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:El(bl(n.a)),b:El(bl(n.b))};if(i.a===i.b){const s=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let o=s.length;for(;o--;){const u=s[o];if(u===a.a)return 1;if(u===a.b)return-1}}return Math.sign(i.a-i.b)}const qI=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function VI(t){var e;const n=getComputedStyle((e=Uh(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function WI(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||VI(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||qI.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function bl(t){let e=t.length;for(;e--;){const n=t[e];if(pe(n,"Missing node"),WI(n))return n}return null}function El(t){return t&&Number(getComputedStyle(t).zIndex)||0}function xl(t){const e=[];for(;t;)e.push(t),t=Uh(t);return e}function Uh(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const Hh=1,$h=2,Zh=4,Yh=8,GI=$I()==="coarse";let _t=[],Ln=!1,an=new Map,ns=new Map;const Or=new Set;function KI(t,e,n,r,i){var s;const{ownerDocument:a}=e,o={direction:n,element:e,hitAreaMargins:r,setResizeHandlerState:i},u=(s=an.get(a))!==null&&s!==void 0?s:0;return an.set(a,u+1),Or.add(o),Oi(),function(){var d;ns.delete(t),Or.delete(o);const c=(d=an.get(a))!==null&&d!==void 0?d:1;if(an.set(a,c-1),Oi(),c===1&&an.delete(a),_t.includes(o)){const h=_t.indexOf(o);h>=0&&_t.splice(h,1),co(),i("up",!0,null)}}}function QI(t){const{target:e}=t,{x:n,y:r}=ts(t);Ln=!0,lo({target:e,x:n,y:r}),Oi(),_t.length>0&&(Li("down",t),t.preventDefault(),qh(e)||t.stopImmediatePropagation())}function Rs(t){const{x:e,y:n}=ts(t);if(Ln&&t.buttons===0&&(Ln=!1,Li("up",t)),!Ln){const{target:r}=t;lo({target:r,x:e,y:n})}Li("move",t),co(),_t.length>0&&t.preventDefault()}function Os(t){const{target:e}=t,{x:n,y:r}=ts(t);ns.clear(),Ln=!1,_t.length>0&&(t.preventDefault(),qh(e)||t.stopImmediatePropagation()),Li("up",t),lo({target:e,x:n,y:r}),co(),Oi()}function qh(t){let e=t;for(;e;){if(e.hasAttribute(je.resizeHandle))return!0;e=e.parentElement}return!1}function lo({target:t,x:e,y:n}){_t.splice(0);let r=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(r=t),Or.forEach(i=>{const{element:s,hitAreaMargins:a}=i,o=s.getBoundingClientRect(),{bottom:u,left:l,right:d,top:c}=o,h=GI?a.coarse:a.fine;if(e>=l-h&&e<=d+h&&n>=c-h&&n<=u+h){if(r!==null&&document.contains(r)&&s!==r&&!s.contains(r)&&!r.contains(s)&&YI(r,s)>0){let g=r,E=!1;for(;g&&!g.contains(s);){if(ZI(g.getBoundingClientRect(),o)){E=!0;break}g=g.parentElement}if(E)return}_t.push(i)}})}function Ls(t,e){ns.set(t,e)}function co(){let t=!1,e=!1;_t.forEach(r=>{const{direction:i}=r;i==="horizontal"?t=!0:e=!0});let n=0;ns.forEach(r=>{n|=r}),t&&e?ws("intersection",n):t?ws("horizontal",n):e?ws("vertical",n):HI()}let Ds=new AbortController;function Oi(){Ds.abort(),Ds=new AbortController;const t={capture:!0,signal:Ds.signal};Or.size&&(Ln?(_t.length>0&&an.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("contextmenu",Os,t),r.addEventListener("pointerleave",Rs,t),r.addEventListener("pointermove",Rs,t))}),window.addEventListener("pointerup",Os,t),window.addEventListener("pointercancel",Os,t)):an.forEach((e,n)=>{const{body:r}=n;e>0&&(r.addEventListener("pointerdown",QI,t),r.addEventListener("pointermove",Rs,t))}))}function Li(t,e){Or.forEach(n=>{const{setResizeHandlerState:r}=n,i=_t.includes(n);r(t,i,e)})}function XI(){const[t,e]=O.useState(0);return O.useCallback(()=>e(n=>n+1),[])}function pe(t,e){if(!t)throw console.error(e),Error(e)}function gn(t,e,n=oo){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function Dt(t,e,n=oo){return gn(t,e,n)===0}function dt(t,e,n){return gn(t,e,n)===0}function JI(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++){const i=t[r],s=e[r];if(!dt(i,s,n))return!1}return!0}function wn({panelConstraints:t,panelIndex:e,size:n}){const r=t[e];pe(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:i=0,collapsible:s,maxSize:a=100,minSize:o=0}=r;if(gn(n,o)<0)if(s){const u=(i+o)/2;gn(n,u)<0?n=i:n=o}else n=o;return n=Math.min(a,n),n=parseFloat(n.toFixed(oo)),n}function dr({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:s}){if(dt(t,0))return e;const a=[...e],[o,u]=r;pe(o!=null,"Invalid first pivot index"),pe(u!=null,"Invalid second pivot index");let l=0;if(s==="keyboard"){{const c=t<0?u:o,h=n[c];pe(h,`Panel constraints not found for index ${c}`);const{collapsedSize:m=0,collapsible:g,minSize:E=0}=h;if(g){const T=e[c];if(pe(T!=null,`Previous layout not found for panel index ${c}`),dt(T,m)){const x=E-T;gn(x,Math.abs(t))>0&&(t=t<0?0-x:x)}}}{const c=t<0?o:u,h=n[c];pe(h,`No panel constraints found for index ${c}`);const{collapsedSize:m=0,collapsible:g,minSize:E=0}=h;if(g){const T=e[c];if(pe(T!=null,`Previous layout not found for panel index ${c}`),dt(T,E)){const x=T-m;gn(x,Math.abs(t))>0&&(t=t<0?0-x:x)}}}}{const c=t<0?1:-1;let h=t<0?u:o,m=0;for(;;){const E=e[h];pe(E!=null,`Previous layout not found for panel index ${h}`);const x=wn({panelConstraints:n,panelIndex:h,size:100})-E;if(m+=x,h+=c,h<0||h>=n.length)break}const g=Math.min(Math.abs(t),Math.abs(m));t=t<0?0-g:g}{let h=t<0?o:u;for(;h>=0&&h<n.length;){const m=Math.abs(t)-Math.abs(l),g=e[h];pe(g!=null,`Previous layout not found for panel index ${h}`);const E=g-m,T=wn({panelConstraints:n,panelIndex:h,size:E});if(!dt(g,T)&&(l+=g-T,a[h]=T,l.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?h--:h++}}if(JI(i,a))return i;{const c=t<0?u:o,h=e[c];pe(h!=null,`Previous layout not found for panel index ${c}`);const m=h+l,g=wn({panelConstraints:n,panelIndex:c,size:m});if(a[c]=g,!dt(g,m)){let E=m-g,x=t<0?u:o;for(;x>=0&&x<n.length;){const _=a[x];pe(_!=null,`Previous layout not found for panel index ${x}`);const b=_+E,C=wn({panelConstraints:n,panelIndex:x,size:b});if(dt(_,C)||(E-=C-_,a[x]=C),dt(E,0))break;t>0?x--:x++}}}const d=a.reduce((c,h)=>h+c,0);return dt(d,100)?a:i}function eN({layout:t,panelsArray:e,pivotIndices:n}){let r=0,i=100,s=0,a=0;const o=n[0];pe(o!=null,"No pivot index found"),e.forEach((c,h)=>{const{constraints:m}=c,{maxSize:g=100,minSize:E=0}=m;h===o?(r=E,i=g):(s+=E,a+=g)});const u=Math.min(i,100-s),l=Math.max(r,100-a),d=t[o];return{valueMax:u,valueMin:l,valueNow:d}}function Lr(t,e=document){return Array.from(e.querySelectorAll(`[${je.resizeHandleId}][data-panel-group-id="${t}"]`))}function Vh(t,e,n=document){const i=Lr(t,n).findIndex(s=>s.getAttribute(je.resizeHandleId)===e);return i??null}function Wh(t,e,n){const r=Vh(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function Gh(t,e=document){var n;if(e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return r||null}function rs(t,e=document){const n=e.querySelector(`[${je.resizeHandleId}="${t}"]`);return n||null}function tN(t,e,n,r=document){var i,s,a,o;const u=rs(e,r),l=Lr(t,r),d=u?l.indexOf(u):-1,c=(i=(s=n[d])===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:null,h=(a=(o=n[d+1])===null||o===void 0?void 0:o.id)!==null&&a!==void 0?a:null;return[c,h]}function nN({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:i,panelGroupElement:s,setLayout:a}){O.useRef({didWarnAboutMissingResizeHandle:!1}),dn(()=>{if(!s)return;const o=Lr(n,s);for(let u=0;u<i.length-1;u++){const{valueMax:l,valueMin:d,valueNow:c}=eN({layout:r,panelsArray:i,pivotIndices:[u,u+1]}),h=o[u];if(h!=null){const m=i[u];pe(m,`No panel data found for index "${u}"`),h.setAttribute("aria-controls",m.id),h.setAttribute("aria-valuemax",""+Math.round(l)),h.setAttribute("aria-valuemin",""+Math.round(d)),h.setAttribute("aria-valuenow",c!=null?""+Math.round(c):"")}}return()=>{o.forEach((u,l)=>{u.removeAttribute("aria-controls"),u.removeAttribute("aria-valuemax"),u.removeAttribute("aria-valuemin"),u.removeAttribute("aria-valuenow")})}},[n,r,i,s]),O.useEffect(()=>{if(!s)return;const o=e.current;pe(o,"Eager values not found");const{panelDataArray:u}=o,l=Gh(n,s);pe(l!=null,`No group found for id "${n}"`);const d=Lr(n,s);pe(d,`No resize handles found for group id "${n}"`);const c=d.map(h=>{const m=h.getAttribute(je.resizeHandleId);pe(m,"Resize handle element has no handle id attribute");const[g,E]=tN(n,m,u,s);if(g==null||E==null)return()=>{};const T=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const _=u.findIndex(b=>b.id===g);if(_>=0){const b=u[_];pe(b,`No panel data found for index ${_}`);const C=r[_],{collapsedSize:w=0,collapsible:y,minSize:R=0}=b.constraints;if(C!=null&&y){const D=dr({delta:dt(C,w)?R-w:w-C,initialLayout:r,panelConstraints:u.map(P=>P.constraints),pivotIndices:Wh(n,m,s),prevLayout:r,trigger:"keyboard"});r!==D&&a(D)}}break}}};return h.addEventListener("keydown",T),()=>{h.removeEventListener("keydown",T)}});return()=>{c.forEach(h=>h())}},[s,t,e,n,r,i,a])}function Tl(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Kh(t,e){const n=t==="horizontal",{x:r,y:i}=ts(e);return n?r:i}function rN(t,e,n,r,i){const s=n==="horizontal",a=rs(e,i);pe(a,`No resize handle element found for id "${e}"`);const o=a.getAttribute(je.groupId);pe(o,"Resize handle element has no group id attribute");let{initialCursorPosition:u}=r;const l=Kh(n,t),d=Gh(o,i);pe(d,`No group element found for id "${o}"`);const c=d.getBoundingClientRect(),h=s?c.width:c.height;return(l-u)/h*100}function iN(t,e,n,r,i,s){if(Fh(t)){const a=n==="horizontal";let o=0;t.shiftKey?o=100:i!=null?o=i:o=10;let u=0;switch(t.key){case"ArrowDown":u=a?0:o;break;case"ArrowLeft":u=a?-o:0;break;case"ArrowRight":u=a?o:0;break;case"ArrowUp":u=a?0:-o;break;case"End":u=100;break;case"Home":u=-100;break}return u}else return r==null?0:rN(t,e,n,r,s)}function sN({panelDataArray:t}){const e=Array(t.length),n=t.map(s=>s.constraints);let r=0,i=100;for(let s=0;s<t.length;s++){const a=n[s];pe(a,`Panel constraints not found for index ${s}`);const{defaultSize:o}=a;o!=null&&(r++,e[s]=o,i-=o)}for(let s=0;s<t.length;s++){const a=n[s];pe(a,`Panel constraints not found for index ${s}`);const{defaultSize:o}=a;if(o!=null)continue;const u=t.length-r,l=i/u;r++,e[s]=l,i-=l}return e}function Sn(t,e,n){e.forEach((r,i)=>{const s=t[i];pe(s,`Panel data not found for index ${i}`);const{callbacks:a,constraints:o,id:u}=s,{collapsedSize:l=0,collapsible:d}=o,c=n[u];if(c==null||r!==c){n[u]=r;const{onCollapse:h,onExpand:m,onResize:g}=a;g&&g(r,c),d&&(h||m)&&(m&&(c==null||Dt(c,l))&&!Dt(r,l)&&m(),h&&(c==null||!Dt(c,l))&&Dt(r,l)&&h())}})}function oi(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function aN({defaultSize:t,dragState:e,layout:n,panelData:r,panelIndex:i,precision:s=3}){const a=n[i];let o;return a==null?o=t!=null?t.toPrecision(s):"1":r.length===1?o="1":o=a.toPrecision(s),{flexBasis:0,flexGrow:o,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function oN(t,e=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...i)},e)}}function _l(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function Qh(t){return`react-resizable-panels:${t}`}function Xh(t){return t.map(e=>{const{constraints:n,id:r,idIsFromProps:i,order:s}=e;return i?r:s?`${s}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function Jh(t,e){try{const n=Qh(t),r=e.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function uN(t,e,n){var r,i;const s=(r=Jh(t,n))!==null&&r!==void 0?r:{},a=Xh(e);return(i=s[a])!==null&&i!==void 0?i:null}function lN(t,e,n,r,i){var s;const a=Qh(t),o=Xh(e),u=(s=Jh(t,i))!==null&&s!==void 0?s:{};u[o]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(a,JSON.stringify(u))}catch(l){console.error(l)}}function yl({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((s,a)=>s+a,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(s=>`${s}%`).join(", ")}`);if(!dt(r,100)&&n.length>0)for(let s=0;s<e.length;s++){const a=n[s];pe(a!=null,`No layout data found for index ${s}`);const o=100/r*a;n[s]=o}let i=0;for(let s=0;s<e.length;s++){const a=n[s];pe(a!=null,`No layout data found for index ${s}`);const o=wn({panelConstraints:e,panelIndex:s,size:a});a!=o&&(i+=a-o,n[s]=o)}if(!dt(i,0))for(let s=0;s<e.length;s++){const a=n[s];pe(a!=null,`No layout data found for index ${s}`);const o=a+i,u=wn({panelConstraints:e,panelIndex:s,size:o});if(a!==u&&(i-=u-a,n[s]=u,dt(i,0)))break}return n}const cN=100,fr={getItem:t=>(_l(fr),fr.getItem(t)),setItem:(t,e)=>{_l(fr),fr.setItem(t,e)}},kl={};function e0({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:i,id:s=null,onLayout:a=null,keyboardResizeBy:o=null,storage:u=fr,style:l,tagName:d="div",...c}){const h=uo(s),m=O.useRef(null),[g,E]=O.useState(null),[T,x]=O.useState([]),_=XI(),b=O.useRef({}),C=O.useRef(new Map),w=O.useRef(0),y=O.useRef({autoSaveId:t,direction:r,dragState:g,id:h,keyboardResizeBy:o,onLayout:a,storage:u}),R=O.useRef({layout:T,panelDataArray:[],panelDataArrayChanged:!1});O.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),O.useImperativeHandle(i,()=>({getId:()=>y.current.id,getLayout:()=>{const{layout:S}=R.current;return S},setLayout:S=>{const{onLayout:te}=y.current,{layout:se,panelDataArray:Q}=R.current,ee=yl({layout:S,panelConstraints:Q.map(ie=>ie.constraints)});Tl(se,ee)||(x(ee),R.current.layout=ee,te&&te(ee),Sn(Q,ee,b.current))}}),[]),dn(()=>{y.current.autoSaveId=t,y.current.direction=r,y.current.dragState=g,y.current.id=h,y.current.onLayout=a,y.current.storage=u}),nN({committedValuesRef:y,eagerValuesRef:R,groupId:h,layout:T,panelDataArray:R.current.panelDataArray,setLayout:x,panelGroupElement:m.current}),O.useEffect(()=>{const{panelDataArray:S}=R.current;if(t){if(T.length===0||T.length!==S.length)return;let te=kl[t];te==null&&(te=oN(lN,cN),kl[t]=te);const se=[...S],Q=new Map(C.current);te(t,se,Q,T,u)}},[t,T,u]),O.useEffect(()=>{});const D=O.useCallback(S=>{const{onLayout:te}=y.current,{layout:se,panelDataArray:Q}=R.current;if(S.constraints.collapsible){const ee=Q.map(De=>De.constraints),{collapsedSize:ie=0,panelSize:le,pivotIndices:ge}=rn(Q,S,se);if(pe(le!=null,`Panel size not found for panel "${S.id}"`),!Dt(le,ie)){C.current.set(S.id,le);const $e=Nn(Q,S)===Q.length-1?le-ie:ie-le,Se=dr({delta:$e,initialLayout:se,panelConstraints:ee,pivotIndices:ge,prevLayout:se,trigger:"imperative-api"});oi(se,Se)||(x(Se),R.current.layout=Se,te&&te(Se),Sn(Q,Se,b.current))}}},[]),P=O.useCallback((S,te)=>{const{onLayout:se}=y.current,{layout:Q,panelDataArray:ee}=R.current;if(S.constraints.collapsible){const ie=ee.map(Pe=>Pe.constraints),{collapsedSize:le=0,panelSize:ge=0,minSize:De=0,pivotIndices:$e}=rn(ee,S,Q),Se=te??De;if(Dt(ge,le)){const Pe=C.current.get(S.id),Ft=Pe!=null&&Pe>=Se?Pe:Se,Tn=Nn(ee,S)===ee.length-1?ge-Ft:Ft-ge,Ve=dr({delta:Tn,initialLayout:Q,panelConstraints:ie,pivotIndices:$e,prevLayout:Q,trigger:"imperative-api"});oi(Q,Ve)||(x(Ve),R.current.layout=Ve,se&&se(Ve),Sn(ee,Ve,b.current))}}},[]),v=O.useCallback(S=>{const{layout:te,panelDataArray:se}=R.current,{panelSize:Q}=rn(se,S,te);return pe(Q!=null,`Panel size not found for panel "${S.id}"`),Q},[]),M=O.useCallback((S,te)=>{const{panelDataArray:se}=R.current,Q=Nn(se,S);return aN({defaultSize:te,dragState:g,layout:T,panelData:se,panelIndex:Q})},[g,T]),F=O.useCallback(S=>{const{layout:te,panelDataArray:se}=R.current,{collapsedSize:Q=0,collapsible:ee,panelSize:ie}=rn(se,S,te);return pe(ie!=null,`Panel size not found for panel "${S.id}"`),ee===!0&&Dt(ie,Q)},[]),K=O.useCallback(S=>{const{layout:te,panelDataArray:se}=R.current,{collapsedSize:Q=0,collapsible:ee,panelSize:ie}=rn(se,S,te);return pe(ie!=null,`Panel size not found for panel "${S.id}"`),!ee||gn(ie,Q)>0},[]),Y=O.useCallback(S=>{const{panelDataArray:te}=R.current;te.push(S),te.sort((se,Q)=>{const ee=se.order,ie=Q.order;return ee==null&&ie==null?0:ee==null?-1:ie==null?1:ee-ie}),R.current.panelDataArrayChanged=!0,_()},[_]);dn(()=>{if(R.current.panelDataArrayChanged){R.current.panelDataArrayChanged=!1;const{autoSaveId:S,onLayout:te,storage:se}=y.current,{layout:Q,panelDataArray:ee}=R.current;let ie=null;if(S){const ge=uN(S,ee,se);ge&&(C.current=new Map(Object.entries(ge.expandToSizes)),ie=ge.layout)}ie==null&&(ie=sN({panelDataArray:ee}));const le=yl({layout:ie,panelConstraints:ee.map(ge=>ge.constraints)});Tl(Q,le)||(x(le),R.current.layout=le,te&&te(le),Sn(ee,le,b.current))}}),dn(()=>{const S=R.current;return()=>{S.layout=[]}},[]);const H=O.useCallback(S=>{let te=!1;const se=m.current;return se&&window.getComputedStyle(se,null).getPropertyValue("direction")==="rtl"&&(te=!0),function(ee){ee.preventDefault();const ie=m.current;if(!ie)return()=>null;const{direction:le,dragState:ge,id:De,keyboardResizeBy:$e,onLayout:Se}=y.current,{layout:Pe,panelDataArray:Ft}=R.current,{initialLayout:Xt}=ge??{},Tn=Wh(De,S,ie);let Ve=iN(ee,S,le,ge,$e,ie);const Wn=le==="horizontal";Wn&&te&&(Ve=-Ve);const Gr=Ft.map(is=>is.constraints),Jt=dr({delta:Ve,initialLayout:Xt??Pe,panelConstraints:Gr,pivotIndices:Tn,prevLayout:Pe,trigger:Fh(ee)?"keyboard":"mouse-or-touch"}),Kr=!oi(Pe,Jt);(zh(ee)||jh(ee))&&w.current!=Ve&&(w.current=Ve,!Kr&&Ve!==0?Wn?Ls(S,Ve<0?Hh:$h):Ls(S,Ve<0?Zh:Yh):Ls(S,0)),Kr&&(x(Jt),R.current.layout=Jt,Se&&Se(Jt),Sn(Ft,Jt,b.current))}},[]),J=O.useCallback((S,te)=>{const{onLayout:se}=y.current,{layout:Q,panelDataArray:ee}=R.current,ie=ee.map(Pe=>Pe.constraints),{panelSize:le,pivotIndices:ge}=rn(ee,S,Q);pe(le!=null,`Panel size not found for panel "${S.id}"`);const $e=Nn(ee,S)===ee.length-1?le-te:te-le,Se=dr({delta:$e,initialLayout:Q,panelConstraints:ie,pivotIndices:ge,prevLayout:Q,trigger:"imperative-api"});oi(Q,Se)||(x(Se),R.current.layout=Se,se&&se(Se),Sn(ee,Se,b.current))},[]),de=O.useCallback((S,te)=>{const{layout:se,panelDataArray:Q}=R.current,{collapsedSize:ee=0,collapsible:ie}=te,{collapsedSize:le=0,collapsible:ge,maxSize:De=100,minSize:$e=0}=S.constraints,{panelSize:Se}=rn(Q,S,se);Se!=null&&(ie&&ge&&Dt(Se,ee)?Dt(ee,le)||J(S,le):Se<$e?J(S,$e):Se>De&&J(S,De))},[J]),ue=O.useCallback((S,te)=>{const{direction:se}=y.current,{layout:Q}=R.current;if(!m.current)return;const ee=rs(S,m.current);pe(ee,`Drag handle element not found for id "${S}"`);const ie=Kh(se,te);E({dragHandleId:S,dragHandleRect:ee.getBoundingClientRect(),initialCursorPosition:ie,initialLayout:Q})},[]),me=O.useCallback(()=>{E(null)},[]),N=O.useCallback(S=>{const{panelDataArray:te}=R.current,se=Nn(te,S);se>=0&&(te.splice(se,1),delete b.current[S.id],R.current.panelDataArrayChanged=!0,_())},[_]),V=O.useMemo(()=>({collapsePanel:D,direction:r,dragState:g,expandPanel:P,getPanelSize:v,getPanelStyle:M,groupId:h,isPanelCollapsed:F,isPanelExpanded:K,reevaluatePanelConstraints:de,registerPanel:Y,registerResizeHandle:H,resizePanel:J,startDragging:ue,stopDragging:me,unregisterPanel:N,panelGroupElement:m.current}),[D,g,r,P,v,M,h,F,K,de,Y,H,J,ue,me,N]),ne={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return O.createElement(es.Provider,{value:V},O.createElement(d,{...c,children:e,className:n,id:s,ref:m,style:{...ne,...l},[je.group]:"",[je.groupDirection]:r,[je.groupId]:h}))}const t0=O.forwardRef((t,e)=>O.createElement(e0,{...t,forwardedRef:e}));e0.displayName="PanelGroup";t0.displayName="forwardRef(PanelGroup)";function Nn(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function rn(t,e,n){const r=Nn(t,e),s=r===t.length-1?[r-1,r]:[r,r+1],a=n[r];return{...e.constraints,panelSize:a,pivotIndices:s}}function dN({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){O.useEffect(()=>{if(t||n==null||r==null)return;const i=rs(e,r);if(i==null)return;const s=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),n(a);break}case"F6":{a.preventDefault();const o=i.getAttribute(je.groupId);pe(o,`No group element found for id "${o}"`);const u=Lr(o,r),l=Vh(o,e,r);pe(l!==null,`No resize element found for id "${e}"`);const d=a.shiftKey?l>0?l-1:u.length-1:l+1<u.length?l+1:0;u[d].focus();break}}};return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}},[r,t,e,n])}function n0({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:r,id:i,onBlur:s,onClick:a,onDragging:o,onFocus:u,onPointerDown:l,onPointerUp:d,style:c={},tabIndex:h=0,tagName:m="div",...g}){var E,T;const x=O.useRef(null),_=O.useRef({onClick:a,onDragging:o,onPointerDown:l,onPointerUp:d});O.useEffect(()=>{_.current.onClick=a,_.current.onDragging=o,_.current.onPointerDown=l,_.current.onPointerUp=d});const b=O.useContext(es);if(b===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:C,groupId:w,registerResizeHandle:y,startDragging:R,stopDragging:D,panelGroupElement:P}=b,v=uo(i),[M,F]=O.useState("inactive"),[K,Y]=O.useState(!1),[H,J]=O.useState(null),de=O.useRef({state:M});dn(()=>{de.current.state=M}),O.useEffect(()=>{if(n)J(null);else{const V=y(v);J(()=>V)}},[n,v,y]);const ue=(E=r?.coarse)!==null&&E!==void 0?E:15,me=(T=r?.fine)!==null&&T!==void 0?T:5;O.useEffect(()=>{if(n||H==null)return;const V=x.current;pe(V,"Element ref not attached");let ne=!1;return KI(v,V,C,{coarse:ue,fine:me},(te,se,Q)=>{if(!se){F("inactive");return}switch(te){case"down":{F("drag"),ne=!1,pe(Q,'Expected event to be defined for "down" action'),R(v,Q);const{onDragging:ee,onPointerDown:ie}=_.current;ee?.(!0),ie?.();break}case"move":{const{state:ee}=de.current;ne=!0,ee!=="drag"&&F("hover"),pe(Q,'Expected event to be defined for "move" action'),H(Q);break}case"up":{F("hover"),D();const{onClick:ee,onDragging:ie,onPointerUp:le}=_.current;ie?.(!1),le?.(),ne||ee?.();break}}})},[ue,C,n,me,y,v,H,R,D]),dN({disabled:n,handleId:v,resizeHandler:H,panelGroupElement:P});const N={touchAction:"none",userSelect:"none"};return O.createElement(m,{...g,children:t,className:e,id:i,onBlur:()=>{Y(!1),s?.()},onFocus:()=>{Y(!0),u?.()},ref:x,role:"separator",style:{...N,...c},tabIndex:h,[je.groupDirection]:C,[je.groupId]:w,[je.resizeHandle]:"",[je.resizeHandleActive]:M==="drag"?"pointer":K?"keyboard":void 0,[je.resizeHandleEnabled]:!n,[je.resizeHandleId]:v,[je.resizeHandleState]:M})}n0.displayName="PanelResizeHandle";function fN(t){const e=z.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 i;e[3]!==n?(i=X("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",n),e[3]=n,e[4]=i):i=e[4];let s;return e[5]!==r||e[6]!==i?(s=p.jsx(t0,{"data-slot":"resizable-panel-group",className:i,...r}),e[5]=r,e[6]=i,e[7]=s):s=e[7],s}function r0(t){const e=z.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=p.jsx(Bh,{"data-slot":"resizable-panel",...n}),e[2]=n,e[3]=r):r=e[3],r}function hN(t){const e=z.c(12);let n,r,i;e[0]!==t?({withHandle:i,className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let s;e[4]!==n?(s=X("bg-border focus-visible:ring-ring relative flex w-[0.5px] items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",n),e[4]=n,e[5]=s):s=e[5];let a;e[6]!==i?(a=i&&p.jsx("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:p.jsx(cc,{className:"size-2.5"})}),e[6]=i,e[7]=a):a=e[7];let o;return e[8]!==r||e[9]!==s||e[10]!==a?(o=p.jsx(n0,{"data-slot":"resizable-handle",className:s,...r,children:a}),e[8]=r,e[9]=s,e[10]=a,e[11]=o):o=e[11],o}function i0(){const t=z.c(3),{toggleSidebar:e}=ao();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=p.jsx(pc,{className:"text-muted-foreground/85 group-hover:text-foreground transition-colors",size:20}),t[0]=n):n=t[0];let r;return t[1]!==e?(r=p.jsx(p.Fragment,{children:p.jsx(at,{onClick:e,size:"icon",variant:"ghost",className:"w-8 h-8 rounded-md",children:n})}),t[1]=e,t[2]=r):r=t[2],r}i0.Skeleton=function(){return p.jsx("div",{className:"w-8 h-8 bg-muted rounded-md animate-pulse"})};const pN="https://assets.decocache.com/decocms/fd07a578-6b1c-40f1-bc05-88a3b981695d/f7fc4ffa81aec04e37ae670c3cd4936643a7b269.png";function Sl(t){const e=z.c(18),{showSidebarToggle:n,showOrgSwitcher:r,showDecoChat:i}=t,s=n===void 0?!1:n,a=r===void 0?!1:r,o=i===void 0?!1:i,[,u]=Sa();let l;e[0]!==u?(l=()=>u(mN),e[0]=u,e[1]=l):l=e[1];const d=l;let c;e[2]!==s?(c=s&&p.jsx(si.Sidebar,{children:p.jsx(i0,{})}),e[2]=s,e[3]=c):c=e[3];let h;e[4]!==a?(h=a&&p.jsx(O.Suspense,{fallback:p.jsx(fa.Skeleton,{}),children:p.jsx(fa,{})}),e[4]=a,e[5]=h):h=e[5];let m;e[6]!==h?(m=p.jsx(si.Left,{children:h}),e[6]=h,e[7]=m):m=e[7];let g;e[8]!==o||e[9]!==d?(g=o&&p.jsxs(at,{size:"sm",variant:"default",onClick:d,children:[p.jsx(Un,{url:pN,fallback:"DC",size:"2xs",className:"rounded-sm"}),"deco chat"]}),e[8]=o,e[9]=d,e[10]=g):g=e[10];let E;e[11]===Symbol.for("react.memo_cache_sentinel")?(E=p.jsx(wI,{}),e[11]=E):E=e[11];let T;e[12]!==g?(T=p.jsxs(si.Right,{className:"gap-2",children:[g,E]}),e[12]=g,e[13]=T):T=e[13];let x;return e[14]!==T||e[15]!==c||e[16]!==m?(x=p.jsxs(si,{children:[c,m,T]}),e[14]=T,e[15]=c,e[16]=m,e[17]=x):x=e[17],x}function mN(t){return!t}function gN(t){const e=z.c(10),{children:n,className:r}=t,[,i]=O.useTransition();let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=Br.decoChatPanelWidth(),e[0]=s):s=e[0];const[a,o]=Dn(s,30);let u;e[1]!==o?(u=h=>i(()=>o(h)),e[1]=o,e[2]=u):u=e[2];const l=u;let d;e[3]!==r?(d=X("min-w-0",r),e[3]=r,e[4]=d):d=e[4];let c;return e[5]!==a||e[6]!==n||e[7]!==l||e[8]!==d?(c=p.jsx(r0,{defaultSize:a,minSize:20,className:d,onResize:l,children:n}),e[5]=a,e[6]=n,e[7]=l,e[8]=d,e[9]=c):c=e[9],c}function bN(t){const e=z.c(5),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=Br.sidebarOpen(),e[0]=r):r=e[0];const[i,s]=Dn(r,!0);let a;return e[1]!==n||e[2]!==s||e[3]!==i?(a=p.jsx(M6,{open:i,onOpenChange:s,children:n}),e[1]=n,e[2]=s,e[3]=i,e[4]=a):a=e[4],a}function EN(){const t=z.c(9),[e]=Sa();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=p.jsx(r0,{className:"bg-background",children:p.jsx(Ll,{})}),t[0]=n):n=t[0];let r;t[1]!==e?(r=p.jsx(hN,{withHandle:e}),t[1]=e,t[2]=r):r=t[2];const i=e?"max-w-none":"max-w-0";let s;t[3]===Symbol.for("react.memo_cache_sentinel")?(s=p.jsx(jl,{children:p.jsx(O.Suspense,{fallback:p.jsx(FI,{}),children:p.jsx(y6,{})})}),t[3]=s):s=t[3];let a;t[4]!==i?(a=p.jsx(gN,{className:i,children:s}),t[4]=i,t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==a?(o=p.jsxs(fN,{direction:"horizontal",children:[n,r,a]}),t[6]=r,t[7]=a,t[8]=o):o=t[8],o}function xN(){const t=z.c(19);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{org:n}=Rl(e);let r;t[1]!==n?(r=st.activeOrganization(n),t[1]=n,t[2]=r):r=t[2];let i;t[3]!==n?(i=async()=>{if(!n)return null;const{data:m}=await Mr.organization.setActive({organizationSlug:n});return{org:m,project:{slug:ap}}},t[3]=n,t[4]=i):i=t[4];let s;t[5]!==r||t[6]!==i?(s={queryKey:r,queryFn:i,gcTime:1/0,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1},t[5]=r,t[6]=i,t[7]=s):s=t[7];const{data:a}=Ea(s);if(!a){let m;t[8]===Symbol.for("react.memo_cache_sentinel")?(m=p.jsx(Sl,{}),t[8]=m):m=t[8];let g;return t[9]===Symbol.for("react.memo_cache_sentinel")?(g=p.jsxs("div",{className:"min-h-screen bg-background",children:[m,p.jsx("div",{className:"pt-12",children:p.jsx(Ll,{})})]}),t[9]=g):g=t[9],g}let o;t[10]===Symbol.for("react.memo_cache_sentinel")?(o=p.jsx(Sl,{showSidebarToggle:!0,showOrgSwitcher:!0,showDecoChat:!0}),t[10]=o):o=t[10];let u;t[11]===Symbol.for("react.memo_cache_sentinel")?(u={"--sidebar-width":"13rem","--sidebar-width-mobile":"11rem"},t[11]=u):u=t[11];let l;t[12]===Symbol.for("react.memo_cache_sentinel")?(l=p.jsx(eI,{}),t[12]=l):l=t[12];let d;t[13]===Symbol.for("react.memo_cache_sentinel")?(d=p.jsx(bN,{children:p.jsxs("div",{className:"flex flex-col h-screen",children:[o,p.jsxs(z6,{className:"flex-1 bg-sidebar",style:u,children:[l,p.jsx(U6,{className:"pt-12",children:p.jsx(EN,{})})]})]})}),t[13]=d):d=t[13];let c;t[14]!==a.org.slug?(c=p.jsx(SE,{children:d},a.org.slug),t[14]=a.org.slug,t[15]=c):c=t[15];let h;return t[16]!==a||t[17]!==c?(h=p.jsx(sp,{...a,children:c}),t[16]=a,t[17]=c,t[18]=h):h=t[18],h}function sv(){const t=z.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=p.jsx(RI,{children:p.jsx(O.Suspense,{fallback:p.jsx(Ol,{}),children:p.jsx(xN,{})})}),t[0]=e):e=t[0],e}export{sv as default};
|