vibelet 1.2.241 → 1.2.243
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/index.cjs +1 -1
- package/dist/inventory-scan-worker.cjs +1 -1
- package/dist/runtime-version.cjs +1 -1
- package/dist/web/assets/{App-DoFtS2ld.css → App-6Cciblyj.css} +1 -1
- package/dist/web/assets/App-DHM2JpIe.js +2 -0
- package/dist/web/assets/{BrowserControlPanel-HSOIppjA.js → BrowserControlPanel-CvtVx3Hr.js} +1 -1
- package/dist/web/assets/{ChatPane-DG_WUdJo.css → ChatPane-CMZDQ9ZZ.css} +1 -1
- package/dist/web/assets/ChatPane-Crhr0Lkx.js +2 -0
- package/dist/web/assets/{ChipGroup-CXqq2wlt.js → ChipGroup-DAB6dZFc.js} +1 -1
- package/dist/web/assets/{ComposerMenus-rXTcwRKu.js → ComposerMenus-D7iN4bup.js} +1 -1
- package/dist/web/assets/{DiffDrawer-CXfOImnm.js → DiffDrawer-BR7NrEmt.js} +1 -1
- package/dist/web/assets/FilesControlPanel-B8w2_BRT.js +1 -0
- package/dist/web/assets/{GlobalPendingDialog-B4mfzOBi.js → GlobalPendingDialog-psYp4FyT.js} +1 -1
- package/dist/web/assets/{ImageViewer-C36pXFoT.js → ImageViewer-CKqlB_9p.js} +1 -1
- package/dist/web/assets/{LanguageSettingsPanel-Bb44m-LR.js → LanguageSettingsPanel-eEfHrFPA.js} +1 -1
- package/dist/web/assets/{MarkdownModePanel-CNaSfmI8.js → MarkdownModePanel-R_z8H9hQ.js} +1 -1
- package/dist/web/assets/{MessageImage-CAhJXwr7.js → MessageImage-L_caj_Dp.js} +1 -1
- package/dist/web/assets/{NewSessionDialog-BIVNe-MJ.js → NewSessionDialog-D6GYUsxw.js} +1 -1
- package/dist/web/assets/{NotificationSettingsPanel-FbuRkW04.js → NotificationSettingsPanel-8cC0qcjz.js} +1 -1
- package/dist/web/assets/{PanelFind-DnzTO9GZ.js → PanelFind-CtB-fTaM.js} +1 -1
- package/dist/web/assets/{RemoteLifeOSBlock-Bhm7Sf00.js → RemoteLifeOSBlock-CwM5U04N.js} +2 -2
- package/dist/web/assets/{RemoteWorkspaceSettings-DX0IhsyZ.js → RemoteWorkspaceSettings-BLk7MUa8.js} +1 -1
- package/dist/web/assets/{SessionTerminalPanel-CBbwf8LG.js → SessionTerminalPanel-D_5c6lMk.js} +2 -2
- package/dist/web/assets/{SpeechInputSettingsPanel-Cx71yVTZ.js → SpeechInputSettingsPanel-Bm1UPHiL.js} +1 -1
- package/dist/web/assets/{ThemeSettingsPanel-CxEeL1Yb.js → ThemeSettingsPanel-Tym9Xy1v.js} +1 -1
- package/dist/web/assets/{__vite-browser-external-2447137e-DrC7dgv5.js → __vite-browser-external-2447137e-Ck9f6uYD.js} +1 -1
- package/dist/web/assets/{abnfDiagram-VRR7QNED-ChWHpAet.js → abnfDiagram-VRR7QNED-BPSMtotk.js} +1 -1
- package/dist/web/assets/{arc-Dfxnvl-t.js → arc-CFHn4jAK.js} +1 -1
- package/dist/web/assets/{architectureDiagram-ZJ3FMSHR-kBLnPqES.js → architectureDiagram-ZJ3FMSHR-DoIyc6P-.js} +1 -1
- package/dist/web/assets/{arrow-left-BUz_m4Oq.js → arrow-left-B_J8dbJk.js} +1 -1
- package/dist/web/assets/{arrow-right-BY4NPg2p.js → arrow-right-B0Zthy7B.js} +1 -1
- package/dist/web/assets/{blockDiagram-677ZJIJ3-BNtwjuTh.js → blockDiagram-677ZJIJ3-BOarVZs5.js} +1 -1
- package/dist/web/assets/{c4Diagram-LMCZKHZV-8D-Mwesb.js → c4Diagram-LMCZKHZV-CDoawQWV.js} +1 -1
- package/dist/web/assets/channel-bz5uCtjG.js +1 -0
- package/dist/web/assets/chevron-up-BvhbPeN2.js +1 -0
- package/dist/web/assets/{chunk-2Q5K7J3B-B5fYkjtP.js → chunk-2Q5K7J3B-CkVdI1_G.js} +1 -1
- package/dist/web/assets/{chunk-32BRIVSS-tN_bs2O_.js → chunk-32BRIVSS-lfRflIJE.js} +1 -1
- package/dist/web/assets/{chunk-5VM5RSS4-BVcBoYrd.js → chunk-5VM5RSS4-ChvW640o.js} +1 -1
- package/dist/web/assets/{chunk-EX3LRPZG-CuXY6NcI.js → chunk-EX3LRPZG-LUlAwMu1.js} +1 -1
- package/dist/web/assets/{chunk-JWPE2WC7-C9fui0AP.js → chunk-JWPE2WC7-CZAbFhxm.js} +1 -1
- package/dist/web/assets/{chunk-MOJQB5TN-BsNzYnoh.js → chunk-MOJQB5TN-zbABsF-T.js} +1 -1
- package/dist/web/assets/{chunk-RYQCIY6F-KV-COyMH.js → chunk-RYQCIY6F-DO7-HDJp.js} +1 -1
- package/dist/web/assets/{chunk-V7JOEXUC-BtdUd2AL.js → chunk-V7JOEXUC-CZZpLt5o.js} +1 -1
- package/dist/web/assets/{chunk-VR4S4FIN-CvibGV30.js → chunk-VR4S4FIN-CPVLI9Cz.js} +1 -1
- package/dist/web/assets/{chunk-XXDRQBXY-BQgo6g4Q.js → chunk-XXDRQBXY-dA96ajoY.js} +1 -1
- package/dist/web/assets/classDiagram-OUVF2IWQ-DWTcdIri.js +1 -0
- package/dist/web/assets/classDiagram-v2-EOCWNBFH-DWTcdIri.js +1 -0
- package/dist/web/assets/{collectMessageImages-DfQK7APc.js → collectMessageImages-BHZAEp7l.js} +1 -1
- package/dist/web/assets/{cose-bilkent-JH36ORCC-DqJjP-1o.js → cose-bilkent-JH36ORCC-DkTAw3T7.js} +1 -1
- package/dist/web/assets/{cynefin-VYW2F7L2-CYle_Oh3.js → cynefin-VYW2F7L2-CPV5HP8b.js} +1 -1
- package/dist/web/assets/{cynefinDiagram-TSTJHNR4-Cs6U5rP8.js → cynefinDiagram-TSTJHNR4-BjqGh-JY.js} +1 -1
- package/dist/web/assets/{dagre-VKFMJZFB-B0PDjiVu.js → dagre-VKFMJZFB-CqPOtH9L.js} +1 -1
- package/dist/web/assets/{diagram-FQU43EPY-D1G0yF91.js → diagram-FQU43EPY-51RTvAnu.js} +1 -1
- package/dist/web/assets/{diagram-G47NLZAW-jMb0G0ac.js → diagram-G47NLZAW-B5GqRCH2.js} +1 -1
- package/dist/web/assets/{diagram-NH7WQ7WH-Dsybvax5.js → diagram-NH7WQ7WH-BYUwty2D.js} +1 -1
- package/dist/web/assets/{diagram-OA4YK3LP-C-mEVY1q.js → diagram-OA4YK3LP-C6yJt9W8.js} +1 -1
- package/dist/web/assets/{diagram-WEI45ONY-AWFjaNNW.js → diagram-WEI45ONY-Cc9-k4zE.js} +1 -1
- package/dist/web/assets/{ebnfDiagram-CCIWWBDH-DDcjK3O9.js → ebnfDiagram-CCIWWBDH-DCzmtavH.js} +1 -1
- package/dist/web/assets/{erDiagram-Q63AITRT-EbcQ9tS4.js → erDiagram-Q63AITRT-ZjDc6wjK.js} +1 -1
- package/dist/web/assets/{file-editor-FileCodeEditor-b6IgEhB0.js → file-editor-FileCodeEditor-ynS8wc-T.js} +1 -1
- package/dist/web/assets/{file-editor-ObsidianCodeEditor-B8GDcuAu.js → file-editor-ObsidianCodeEditor-BGsVxYpf.js} +1 -1
- package/dist/web/assets/{file-editor-ObsidianFileEditor-xduoJU9L.js → file-editor-ObsidianFileEditor-DCya_kV_.js} +1 -1
- package/dist/web/assets/{flowDiagram-23GEKE2U-Duhlfe1V.js → flowDiagram-23GEKE2U-JOT3y9OZ.js} +1 -1
- package/dist/web/assets/{folder-plus-CPlBpAjK.js → folder-plus-Dv3mIoot.js} +1 -1
- package/dist/web/assets/{ganttDiagram-NO4QXBWP-rxIBQVNR.js → ganttDiagram-NO4QXBWP-BwMM9lRV.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-IHSO6WYX-CfgOr47E.js → gitGraphDiagram-IHSO6WYX-Ca0Kjref.js} +1 -1
- package/dist/web/assets/highlighted-body-TPN3WLV5-VkAb1QUw.js +1 -0
- package/dist/web/assets/{imageViewerCopy-DbcGAYOb.js → imageViewerCopy-BBW9Oggj.js} +1 -1
- package/dist/web/assets/{index-CUEPjMAK.js → index-B5px1ls4.js} +1 -1
- package/dist/web/assets/{index-Cg-hTlne.js → index-CTpWXHK5.js} +2 -2
- package/dist/web/assets/{index-DIhhLINU.js → index-CtwbNx5m.js} +1 -1
- package/dist/web/assets/{index-C0OnaOQ9.js → index-ofOCAr04.js} +1 -1
- package/dist/web/assets/infoDiagram-FWYZ7A6U-FmG41IWW.js +1 -0
- package/dist/web/assets/{ishikawaDiagram-FXEZZL3T-CrwkydfS.js → ishikawaDiagram-FXEZZL3T-DJix30qW.js} +1 -1
- package/dist/web/assets/{journeyDiagram-5HDEW3XC-9mpjCVzY.js → journeyDiagram-5HDEW3XC-CIDtc9NL.js} +1 -1
- package/dist/web/assets/{kanban-definition-HUTT4EX6-BHH-hi9E.js → kanban-definition-HUTT4EX6-kNtL91_Y.js} +1 -1
- package/dist/web/assets/{key-round-BTcpevK5.js → key-round-CBNFW_Qp.js} +1 -1
- package/dist/web/assets/{linear-BFyDT02f.js → linear-Pl-iycWx.js} +1 -1
- package/dist/web/assets/{mermaid-O7DHMXV3-Btm49B1f.js → mermaid-O7DHMXV3-Bq_tcKDI.js} +2 -2
- package/dist/web/assets/{mermaid.core-DsV-uGyB.js → mermaid.core-DKLhQHMi.js} +2 -2
- package/dist/web/assets/{mic--tu-R1CO.js → mic-BHRmNhFG.js} +1 -1
- package/dist/web/assets/{mindmap-definition-LN4V7U3C-BKiIDYsx.js → mindmap-definition-LN4V7U3C-EdtXTVq3.js} +1 -1
- package/dist/web/assets/{pegDiagram-2B236MQR-sKr_MbJ8.js → pegDiagram-2B236MQR-CcQiWdRU.js} +1 -1
- package/dist/web/assets/{pieDiagram-ENE6RG2P-BDfwhOm3.js → pieDiagram-ENE6RG2P-B9OftxL2.js} +1 -1
- package/dist/web/assets/{quadrantDiagram-ABIIQ3AL-DP98F4Tc.js → quadrantDiagram-ABIIQ3AL-DNzteO4O.js} +1 -1
- package/dist/web/assets/{railroadDiagram-RFXS5EU6-CEIxXnOV.js → railroadDiagram-RFXS5EU6-DETkFxdL.js} +1 -1
- package/dist/web/assets/{requirementDiagram-TGXJPOKE-BFQiFukq.js → requirementDiagram-TGXJPOKE-Bc2ygXJE.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-HTMAVEWB-CK7qSKcH.js → sankeyDiagram-HTMAVEWB-ued5WJdO.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-DBY2YBRQ-DAsJtbEE.js → sequenceDiagram-DBY2YBRQ-CB9W7GEK.js} +1 -1
- package/dist/web/assets/{shield-check-DPmOpYg5.js → shield-check-BHYK9iHQ.js} +1 -1
- package/dist/web/assets/{sizeCapture-X5ZJPWSS-BGpUlliu.js → sizeCapture-X5ZJPWSS-BlYVWgJQ.js} +1 -1
- package/dist/web/assets/{stateDiagram-2N3HPSRC-C54QLFU7.js → stateDiagram-2N3HPSRC-BuBfZ-Ll.js} +1 -1
- package/dist/web/assets/stateDiagram-v2-6OUMAXLB-BVWYwLt9.js +1 -0
- package/dist/web/assets/{swimlanes-5IMT3BWC-BiTjNgIT.js → swimlanes-5IMT3BWC-DymXACYM.js} +2 -2
- package/dist/web/assets/swimlanesDiagram-G3AALYLV-BxIeu7lf.js +1 -0
- package/dist/web/assets/{timeline-definition-FHXFAJF6-C8-hX5IV.js → timeline-definition-FHXFAJF6-Doqvtw8A.js} +1 -1
- package/dist/web/assets/useComposerCompletion-f1any5m7.js +1 -0
- package/dist/web/assets/{useMessageImage-IJxrl7nu.js → useMessageImage-CkBgO2_p.js} +1 -1
- package/dist/web/assets/{vennDiagram-L72KCM5P-Dsqo3cMF.js → vennDiagram-L72KCM5P-BTDdTQn0.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-EHGQE667-CeAk-yQG.js → wardleyDiagram-EHGQE667-DJVmxdj7.js} +1 -1
- package/dist/web/assets/{xychartDiagram-FW5EYKEG-y6abbBAM.js → xychartDiagram-FW5EYKEG-D1C4pPp4.js} +1 -1
- package/dist/web/assets/{zap-BBEUMj_u.js → zap-DsMffYum.js} +1 -1
- package/dist/web/index.html +1 -1
- package/dist/web/obsidian-editor-assets.json +1 -1
- package/package.json +1 -1
- package/dist/web/assets/App-DXhmlTQu.js +0 -2
- package/dist/web/assets/ChatPane-BaAKWPnJ.js +0 -2
- package/dist/web/assets/FilesControlPanel-Dlvt1Gp1.js +0 -1
- package/dist/web/assets/channel-DZo4wTF7.js +0 -1
- package/dist/web/assets/chevron-up-DQfpYsuw.js +0 -1
- package/dist/web/assets/classDiagram-OUVF2IWQ-kVNkVXMH.js +0 -1
- package/dist/web/assets/classDiagram-v2-EOCWNBFH-kVNkVXMH.js +0 -1
- package/dist/web/assets/highlighted-body-TPN3WLV5-Cnt0-aIs.js +0 -1
- package/dist/web/assets/infoDiagram-FWYZ7A6U-ClEYLmSr.js +0 -1
- package/dist/web/assets/stateDiagram-v2-6OUMAXLB-C1gZlI03.js +0 -1
- package/dist/web/assets/swimlanesDiagram-G3AALYLV-DMEyjS0M.js +0 -1
- package/dist/web/assets/useComposerCompletion-gVIPCpAa.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/file-editor-index-DH8OZ6dS.js","assets/file-editor-index-C6CU7Fik.js","assets/file-editor-index-BOi4gj-u.js","assets/file-editor-index-D5fLCdey.js","assets/file-editor-index-CVa9xeL0.js","assets/file-editor-index-wav2nO7A.js","assets/file-editor-index-CMzVhAnN.js","assets/file-editor-index-YeA2vzMT.js","assets/file-editor-index-BxQDEPaH.js","assets/file-editor-index-BWvEAcHp.js","assets/file-editor-index-CTfoBHg1.js","assets/file-editor-index-DIH2DQ5-.js","assets/file-editor-index-Ca7mWpkj.js","assets/file-editor-index-x-jPAG-9.js","assets/file-editor-index-BkRDu8Ih.js","assets/file-editor-index-_YJUu8LH.js","assets/file-editor-index-CEjRXkxt.js","assets/file-editor-index-vyjM9L0w.js","assets/file-editor-index-DhGjGca-.js","assets/file-editor-index-Dijmg1Xu.js","assets/file-editor-index-CBJfyhrV.js","assets/file-editor-index--NhAFrCD.js","assets/file-editor-dockerfile-CZsZcXQt.js","assets/file-editor-simple-mode-CjHKX61j.js","assets/file-editor-factor-DXwzD_Ly.js","assets/file-editor-nsis-DeakT4dU.js","assets/file-editor-pug-C_WDC1BE.js","assets/file-editor-javascript-Ccp3-nCs.js","assets/file-editor-index-D_riXMER.js","assets/file-editor-index-BhOxVDWT.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e,_ as t,r as n,j as r,h as o}from"./index-Cg-hTlne.js";import{c as i,$ as a,a as s,b as l,P as c,e as d,p as u,R as h,S as p,F as m,D as f,f as g,g as v,h as y,i as b,j as w,o as x,s as k,k as C,l as _,T as S,m as A,N as M,n as T,q as E,r as L,t as O,u as I,v as R,w as P,x as B,y as z,z as D,A as N,B as H,C as q,E as j,G as V,H as F,I as $,J as W,K as U,L as G,M as Z,O as X,Q as K,U as Y,V as J,W as Q,X as ee,Y as te,Z as ne,_ as re,a0 as oe,a1 as ie,a2 as ae,a3 as se,a4 as le,a5 as ce,a6 as de,a7 as ue,a8 as he,a9 as pe,aa as me,ab as fe,ac as ge,ad as ve,ae as ye,af as be,ag as we,ah as xe,ai as ke,aj as Ce,ak as _e,al as Se,am as Ae,an as Me,ao as Te,ap as Ee,aq as Le,ar as Oe,as as Ie,at as Re,au as Pe,av as Be,aw as ze,ax as De,ay as Ne,az as He,aA as qe,aB as je,aC as Ve,aD as Fe,aE as $e,aF as We,aG as Ue,aH as Ge,aI as Ze,aJ as Xe,aK as Ke,aL as Ye,aM as Je,aN as Qe,aO as et,aP as tt,aQ as nt,aR as rt,aS as ot,aT as it,aU as at,aV as st,aW as lt,aX as ct,aY as dt,aZ as ut,a_ as ht,a$ as pt,b0 as mt,b1 as ft,b2 as gt,b3 as vt,b4 as yt,b5 as bt,b6 as wt,b7 as xt,b8 as kt,b9 as Ct,ba as _t,bb as St,bc as At,bd as Mt}from"./RemoteLifeOSBlock-Bhm7Sf00.js";import{h as Tt,b as Et}from"./index-CUEPjMAK.js";import{Z as Lt,u as Ot,a3 as It,E as Rt,a4 as Pt,a5 as Bt,z as zt,a6 as Dt,a7 as Nt,k as Ht,X as qt,V as jt,S as Vt,a as Ft,P as $t,e as Wt,F as Ut,a8 as Gt,a9 as Zt,f as Xt,aa as Kt,c as Yt,h as Jt,j as Qt,m as en,C as tn,ab as nn,ac as rn,ad as on,ae as an,af as sn,W as ln,ag as cn,ah as dn,ai as un,aj as hn,ak as pn,al as mn,am as fn,an as gn,ao as vn,ap as yn,aq as bn,ar as wn,as as xn,at as kn,au as Cn,av as _n}from"./file-editor-index-C6CU7Fik.js";import{p as Sn}from"./purify.es-BNLkGfTg.js";import{a as An,b as Mn,d as Tn,e as En}from"./file-editor-index-D5fLCdey.js";import{c as Ln,r as On}from"./index-DIhhLINU.js";import{t as In,a as Rn,d as Pn,x as Bn}from"./isArrayLikeObject-C958pSF-.js";import{t as zn,b as Dn,c as Nn}from"./_baseMerge-DBQbsGvS.js";import{a0 as Hn,a1 as qn,a2 as jn,j as Vn,k as Fn,J as $n,a3 as Wn,a4 as Un,a5 as Gn}from"./App-DXhmlTQu.js";import{M as Zn}from"./MessageImage-CAhJXwr7.js";import"./index-C0OnaOQ9.js";import"./chevron-up-DQfpYsuw.js";import"./__vite-browser-external-2447137e-DrC7dgv5.js";import"./_initCloneObject-BR1zWEqJ.js";import"./useMessageImage-IJxrl7nu.js";function Xn(e){const t=(t,n,r,o)=>{const i=r.options[e],a=t.marker;"*"!==a&&"_"!==a||(r.options[e]=a);try{return Tt[e](t,n,r,o)}finally{r.options[e]=i}};return t.peek=(t,n,r)=>t.marker||r.options[e]||"*",t}const Kn=(e,t,n,r)=>{const o=Tt.text(e,t,n,r);return/[ \t]+$/.test(o)&&r.after.startsWith("\n")?function(e){return e.replace(/[ \t]+$/g,e=>e.replace(/ /g," ").replace(/\t/g,"	"))}(o):o};function Yn(e){return(t,n,r,o)=>(t.spread=!1,t.children&&t.children.forEach(e=>{void 0!==e.spread&&(e.spread=!1)}),(e.list??Tt.list)(t,n,r,o))}const Jn=new Set(["list","blockquote","code","table","thematicBreak"]);function Qn(e){const t=e.handlers||{};return{...e,bullet:"-",bulletOrdered:".",listItemIndent:"one",join:[...e.join||[],(e,t,n)=>{if("listItem"===n.type)return"list"===e.type&&"paragraph"===t.type||"paragraph"===e.type&&"list"===t.type&&function(e){if(e.ordered&&1!==(e.start??1))return!0;const t=e.children?.[0];if(null!=i(t?.checked))return!1;const n=t?.children?.[0];return!(n&&!Jn.has(n.type))||"paragraph"===n.type&&!(n.children??[]).some(e=>"text"!==e.type||e.value?.trim())}(t)?1:void 0}],handlers:{...t,strong:Xn("strong"),emphasis:Xn("emphasis"),text:Kn,list:Yn(t),listItem:(e,t,n,r)=>{e.spread=!1,t&&(t.spread=!1);let o=n.bulletCurrent||"-";if(t?.ordered){const r=t.start??1,i=t.children?t.children.indexOf(e):0,a=n.bulletCurrent||n.options.bulletOrdered||".";o=String(r+i)+a}const a=i(e.checked),s=null==a?"":`[${a}] `,l=n.enter("listItem"),c=n.containerFlow(e,r),d=e.children?.some(e=>"html"===e.type||"paragraph"===e.type&&1===e.children?.length&&"html"===e.children[0].type),u=d?o.length+1:Math.max(4,o.length+1),h=" ".repeat(u),p=e.children?.[0]?.type,m=(Jn.has(p)?`\n${c}`:c).split("\n").map((e,t)=>0===t?`${o} ${s}${e}`:""===e?"":h+e).join("\n");return l(),m}}}}const er=new WeakMap,tr=new Map,nr=[];let rr=!1;function or(){rr=!1,nr.splice(0,2).forEach(e=>{e()}),nr.length>0&&ir()}function ir(){rr||(rr=!0,function(e){"function"!=typeof requestAnimationFrame?setTimeout(e,0):requestAnimationFrame(e)}(or))}function ar(e,t){const n=e.callbacks.get(t)??null;return n?(e.callbacks.delete(t),e.observer.unobserve(t),0===e.callbacks.size&&(e.observer.disconnect(),e.owner.delete(e.rootMargin)),n):null}function sr(e,t=String(e.attrs.alias??"")){return`![[${String(e.attrs.target??"")}${e.attrs.hash?`#${String(e.attrs.hash)}`:""}${t?`|${t}`:""}]]`}function lr(e){return e.some(e=>Boolean(e.spec.inlineSourceActive))}var cr=function(){return In.Date.now()},dr=Math.max,ur=Math.min;function hr(e,t,n){var r,o,i,a,s,l,c=0,d=!1,u=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function m(e){var n=e-l;return void 0===l||n>=t||n<0||u&&e-c>=i}function f(){var e=cr();if(m(e))return g(e);s=setTimeout(f,function(e){var n=t-(e-l);return u?ur(n,i-(e-c)):n}(e))}function g(e){return s=void 0,h&&r?p(e):(r=o=void 0,a)}function v(){var e=cr(),n=m(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(f,t),d?p(e):a}(l);if(u)return clearTimeout(s),s=setTimeout(f,t),p(l)}return void 0===s&&(s=setTimeout(f,t)),a}return t=zn(t)||0,Rn(n)&&(d=!!n.leading,i=(u="maxWait"in n)?dr(zn(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h),v.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},v.flush=function(){return void 0===s?a:g(cr())},v}function pr(e,t,n,r,o,i){return Rn(e)&&Rn(t)&&(i.set(t,e),Dn(e,t,void 0,pr,i),i.delete(t)),e}var mr=Nn(function(e,t,n,r){Dn(e,t,n,r)}),fr=Pn(function(e){return e.push(void 0,pr),Bn(mr,void 0,e)});function gr(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Rn(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),hr(e,t,{leading:r,maxWait:t,trailing:o})}function vr(e){return new Ot(It.define(e))}function yr(e){return t(()=>import("./file-editor-index-DH8OZ6dS.js"),__vite__mapDeps([0,1,2,3])).then(t=>t.sql({dialect:t[e]}))}const br=[Lt.of({name:"C",extensions:["c","h","ino"],load:()=>t(()=>import("./file-editor-index-CVa9xeL0.js"),__vite__mapDeps([4,2,1])).then(e=>e.cpp())}),Lt.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load:()=>t(()=>import("./file-editor-index-CVa9xeL0.js"),__vite__mapDeps([4,2,1])).then(e=>e.cpp())}),Lt.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load:()=>yr("Cassandra")}),Lt.of({name:"CSS",extensions:["css"],load:()=>t(()=>import("./file-editor-index-wav2nO7A.js"),__vite__mapDeps([5,2,1])).then(e=>e.css())}),Lt.of({name:"Go",extensions:["go"],load:()=>t(()=>import("./file-editor-index-CMzVhAnN.js"),__vite__mapDeps([6,2,1,3])).then(e=>e.go())}),Lt.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load:()=>t(()=>import("./file-editor-index-YeA2vzMT.js"),__vite__mapDeps([7,2,1,5,8,3])).then(e=>e.html())}),Lt.of({name:"Java",extensions:["java"],load:()=>t(()=>import("./file-editor-index-BWvEAcHp.js"),__vite__mapDeps([9,2,1])).then(e=>e.java())}),Lt.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load:()=>t(()=>import("./file-editor-index-BxQDEPaH.js"),__vite__mapDeps([8,2,1,3])).then(e=>e.javascript())}),Lt.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load:()=>t(()=>import("./file-editor-index-CTfoBHg1.js"),__vite__mapDeps([10,1,7,2,5,8,3])).then(e=>e.jinja())}),Lt.of({name:"JSON",alias:["json5"],extensions:["json","map"],load:()=>t(()=>import("./file-editor-index-DIH2DQ5-.js"),__vite__mapDeps([11,2,1])).then(e=>e.json())}),Lt.of({name:"JSX",extensions:["jsx"],load:()=>t(()=>import("./file-editor-index-BxQDEPaH.js"),__vite__mapDeps([8,2,1,3])).then(e=>e.javascript({jsx:!0}))}),Lt.of({name:"LESS",extensions:["less"],load:()=>t(()=>import("./file-editor-index-Ca7mWpkj.js"),__vite__mapDeps([12,1,5,2])).then(e=>e.less())}),Lt.of({name:"Liquid",extensions:["liquid"],load:()=>t(()=>import("./file-editor-index-x-jPAG-9.js"),__vite__mapDeps([13,1,7,2,5,8,3])).then(e=>e.liquid())}),Lt.of({name:"MariaDB SQL",load:()=>yr("MariaSQL")}),Lt.of({name:"Markdown",extensions:["md","markdown","mkd"],load:()=>t(()=>import("./file-editor-index-BkRDu8Ih.js"),__vite__mapDeps([14,1,3,7,2,5,8])).then(e=>e.markdown())}),Lt.of({name:"MS SQL",load:()=>yr("MSSQL")}),Lt.of({name:"MySQL",load:()=>yr("MySQL")}),Lt.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load:()=>t(()=>import("./file-editor-index-_YJUu8LH.js"),__vite__mapDeps([15,2,1,7,5,8,3])).then(e=>e.php())}),Lt.of({name:"PLSQL",extensions:["pls"],load:()=>yr("PLSQL")}),Lt.of({name:"PostgreSQL",load:()=>yr("PostgreSQL")}),Lt.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load:()=>t(()=>import("./file-editor-index-CEjRXkxt.js"),__vite__mapDeps([16,2,1,3])).then(e=>e.python())}),Lt.of({name:"Rust",extensions:["rs"],load:()=>t(()=>import("./file-editor-index-vyjM9L0w.js"),__vite__mapDeps([17,2,1])).then(e=>e.rust())}),Lt.of({name:"Sass",extensions:["sass"],load:()=>t(()=>import("./file-editor-index-DhGjGca-.js"),__vite__mapDeps([18,2,1,5])).then(e=>e.sass({indented:!0}))}),Lt.of({name:"SCSS",extensions:["scss"],load:()=>t(()=>import("./file-editor-index-DhGjGca-.js"),__vite__mapDeps([18,2,1,5])).then(e=>e.sass())}),Lt.of({name:"SQL",extensions:["sql"],load:()=>yr("StandardSQL")}),Lt.of({name:"SQLite",load:()=>yr("SQLite")}),Lt.of({name:"TSX",extensions:["tsx"],load:()=>t(()=>import("./file-editor-index-BxQDEPaH.js"),__vite__mapDeps([8,2,1,3])).then(e=>e.javascript({jsx:!0,typescript:!0}))}),Lt.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load:()=>t(()=>import("./file-editor-index-BxQDEPaH.js"),__vite__mapDeps([8,2,1,3])).then(e=>e.javascript({typescript:!0}))}),Lt.of({name:"WebAssembly",extensions:["wat","wast"],load:()=>t(()=>import("./file-editor-index-Dijmg1Xu.js"),__vite__mapDeps([19,1,2])).then(e=>e.wast())}),Lt.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load:()=>t(()=>import("./file-editor-index-CBJfyhrV.js"),__vite__mapDeps([20,2,1])).then(e=>e.xml())}),Lt.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load:()=>t(()=>import("./file-editor-index--NhAFrCD.js"),__vite__mapDeps([21,2,1])).then(e=>e.yaml())}),Lt.of({name:"APL",extensions:["dyalog","apl"],load:()=>t(()=>import("./file-editor-apl-__TFPTXj.js"),[]).then(e=>vr(e.apl))}),Lt.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load:()=>t(()=>import("./file-editor-asciiarmor-D5V0T9Cu.js"),[]).then(e=>vr(e.asciiArmor))}),Lt.of({name:"ASN.1",extensions:["asn","asn1"],load:()=>t(()=>import("./file-editor-asn1-YTasSa1m.js"),[]).then(e=>vr(e.asn1({})))}),Lt.of({name:"Asterisk",filename:/^extensions\.conf$/i,load:()=>t(()=>import("./file-editor-asterisk-B46aRdXb.js"),[]).then(e=>vr(e.asterisk))}),Lt.of({name:"Brainfuck",extensions:["b","bf"],load:()=>t(()=>import("./file-editor-brainfuck-CtZaYBKt.js"),[]).then(e=>vr(e.brainfuck))}),Lt.of({name:"Cobol",extensions:["cob","cpy"],load:()=>t(()=>import("./file-editor-cobol-stawOqaz.js"),[]).then(e=>vr(e.cobol))}),Lt.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>vr(e.csharp))}),Lt.of({name:"Clojure",extensions:["clj","cljc","cljx"],load:()=>t(()=>import("./file-editor-clojure-DiuoqK-z.js"),[]).then(e=>vr(e.clojure))}),Lt.of({name:"ClojureScript",extensions:["cljs"],load:()=>t(()=>import("./file-editor-clojure-DiuoqK-z.js"),[]).then(e=>vr(e.clojure))}),Lt.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load:()=>t(()=>import("./file-editor-css-ZjFoif2m.js"),[]).then(e=>vr(e.gss))}),Lt.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load:()=>t(()=>import("./file-editor-cmake-BF4EFB2i.js"),[]).then(e=>vr(e.cmake))}),Lt.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load:()=>t(()=>import("./file-editor-coffeescript-BTDxI-eT.js"),[]).then(e=>vr(e.coffeeScript))}),Lt.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load:()=>t(()=>import("./file-editor-commonlisp-vq6DHwts.js"),[]).then(e=>vr(e.commonLisp))}),Lt.of({name:"Cypher",extensions:["cyp","cypher"],load:()=>t(()=>import("./file-editor-cypher-gJDei3ni.js"),[]).then(e=>vr(e.cypher))}),Lt.of({name:"Cython",extensions:["pyx","pxd","pxi"],load:()=>t(()=>import("./file-editor-python-BiaVA1aS.js"),[]).then(e=>vr(e.cython))}),Lt.of({name:"Crystal",extensions:["cr"],load:()=>t(()=>import("./file-editor-crystal-CRzZ78HM.js"),[]).then(e=>vr(e.crystal))}),Lt.of({name:"D",extensions:["d"],load:()=>t(()=>import("./file-editor-d-DBBFJxh-.js"),[]).then(e=>vr(e.d))}),Lt.of({name:"Dart",extensions:["dart"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>vr(e.dart))}),Lt.of({name:"diff",extensions:["diff","patch"],load:()=>t(()=>import("./file-editor-diff-UJJ5BM9S.js"),[]).then(e=>vr(e.diff))}),Lt.of({name:"Dockerfile",filename:/^Dockerfile$/,load:()=>t(()=>import("./file-editor-dockerfile-CZsZcXQt.js"),__vite__mapDeps([22,23])).then(e=>vr(e.dockerFile))}),Lt.of({name:"DTD",extensions:["dtd"],load:()=>t(()=>import("./file-editor-dtd-DTQlJHYL.js"),[]).then(e=>vr(e.dtd))}),Lt.of({name:"Dylan",extensions:["dylan","dyl","intr"],load:()=>t(()=>import("./file-editor-dylan-DkEP81N9.js"),[]).then(e=>vr(e.dylan))}),Lt.of({name:"EBNF",load:()=>t(()=>import("./file-editor-ebnf-DdOEfpxz.js"),[]).then(e=>vr(e.ebnf))}),Lt.of({name:"ECL",extensions:["ecl"],load:()=>t(()=>import("./file-editor-ecl-BCmcI64-.js"),[]).then(e=>vr(e.ecl))}),Lt.of({name:"edn",extensions:["edn"],load:()=>t(()=>import("./file-editor-clojure-DiuoqK-z.js"),[]).then(e=>vr(e.clojure))}),Lt.of({name:"Eiffel",extensions:["e"],load:()=>t(()=>import("./file-editor-eiffel-CCu4w8r3.js"),[]).then(e=>vr(e.eiffel))}),Lt.of({name:"Elm",extensions:["elm"],load:()=>t(()=>import("./file-editor-elm-vsguYkAQ.js"),[]).then(e=>vr(e.elm))}),Lt.of({name:"Erlang",extensions:["erl"],load:()=>t(()=>import("./file-editor-erlang-DkiE79O3.js"),[]).then(e=>vr(e.erlang))}),Lt.of({name:"Esper",load:()=>t(()=>import("./file-editor-sql-B3SPsWL6.js"),[]).then(e=>vr(e.esper))}),Lt.of({name:"Factor",extensions:["factor"],load:()=>t(()=>import("./file-editor-factor-DXwzD_Ly.js"),__vite__mapDeps([24,23])).then(e=>vr(e.factor))}),Lt.of({name:"FCL",load:()=>t(()=>import("./file-editor-fcl-D8gVJOao.js"),[]).then(e=>vr(e.fcl))}),Lt.of({name:"Forth",extensions:["forth","fth","4th"],load:()=>t(()=>import("./file-editor-forth-POgR1ypr.js"),[]).then(e=>vr(e.forth))}),Lt.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load:()=>t(()=>import("./file-editor-fortran-BC2PZYR6.js"),[]).then(e=>vr(e.fortran))}),Lt.of({name:"F#",alias:["fsharp"],extensions:["fs"],load:()=>t(()=>import("./file-editor-mllike-3c2dg9RT.js"),[]).then(e=>vr(e.fSharp))}),Lt.of({name:"Gas",extensions:["s"],load:()=>t(()=>import("./file-editor-gas-D2ZU1gfd.js"),[]).then(e=>vr(e.gas))}),Lt.of({name:"Gherkin",extensions:["feature"],load:()=>t(()=>import("./file-editor-gherkin-B6X1vGSW.js"),[]).then(e=>vr(e.gherkin))}),Lt.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load:()=>t(()=>import("./file-editor-groovy-DnIzCrpZ.js"),[]).then(e=>vr(e.groovy))}),Lt.of({name:"Haskell",extensions:["hs"],load:()=>t(()=>import("./file-editor-haskell-Dn099gLW.js"),[]).then(e=>vr(e.haskell))}),Lt.of({name:"Haxe",extensions:["hx"],load:()=>t(()=>import("./file-editor-haxe-80kYRvF1.js"),[]).then(e=>vr(e.haxe))}),Lt.of({name:"HXML",extensions:["hxml"],load:()=>t(()=>import("./file-editor-haxe-80kYRvF1.js"),[]).then(e=>vr(e.hxml))}),Lt.of({name:"HTTP",load:()=>t(()=>import("./file-editor-http-BKJkqRj4.js"),[]).then(e=>vr(e.http))}),Lt.of({name:"IDL",extensions:["pro"],load:()=>t(()=>import("./file-editor-idl-pcmmZuaN.js"),[]).then(e=>vr(e.idl))}),Lt.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load:()=>t(()=>import("./file-editor-javascript-Ccp3-nCs.js"),[]).then(e=>vr(e.jsonld))}),Lt.of({name:"Julia",extensions:["jl"],load:()=>t(()=>import("./file-editor-julia-BqmDTk7j.js"),[]).then(e=>vr(e.julia))}),Lt.of({name:"Kotlin",extensions:["kt","kts"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>vr(e.kotlin))}),Lt.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load:()=>t(()=>import("./file-editor-livescript-HO6ttBFx.js"),[]).then(e=>vr(e.liveScript))}),Lt.of({name:"Lua",extensions:["lua"],load:()=>t(()=>import("./file-editor-lua-CXU1lDR7.js"),[]).then(e=>vr(e.lua))}),Lt.of({name:"mIRC",extensions:["mrc"],load:()=>t(()=>import("./file-editor-mirc-DkvFAiy5.js"),[]).then(e=>vr(e.mirc))}),Lt.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load:()=>t(()=>import("./file-editor-mathematica-IIbmv7SK.js"),[]).then(e=>vr(e.mathematica))}),Lt.of({name:"Modelica",extensions:["mo"],load:()=>t(()=>import("./file-editor-modelica-DSrSSXCg.js"),[]).then(e=>vr(e.modelica))}),Lt.of({name:"MUMPS",extensions:["mps"],load:()=>t(()=>import("./file-editor-mumps-zvxmGV4l.js"),[]).then(e=>vr(e.mumps))}),Lt.of({name:"Mbox",extensions:["mbox"],load:()=>t(()=>import("./file-editor-mbox-z_N2Mo3d.js"),[]).then(e=>vr(e.mbox))}),Lt.of({name:"Nginx",filename:/nginx.*\.conf$/i,load:()=>t(()=>import("./file-editor-nginx-BmAbM9sR.js"),[]).then(e=>vr(e.nginx))}),Lt.of({name:"NSIS",extensions:["nsh","nsi"],load:()=>t(()=>import("./file-editor-nsis-DeakT4dU.js"),__vite__mapDeps([25,23])).then(e=>vr(e.nsis))}),Lt.of({name:"NTriples",extensions:["nt","nq"],load:()=>t(()=>import("./file-editor-ntriples-DEO2wBQg.js"),[]).then(e=>vr(e.ntriples))}),Lt.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>vr(e.objectiveC))}),Lt.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>vr(e.objectiveCpp))}),Lt.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load:()=>t(()=>import("./file-editor-mllike-3c2dg9RT.js"),[]).then(e=>vr(e.oCaml))}),Lt.of({name:"Octave",extensions:["m"],load:()=>t(()=>import("./file-editor-octave-C4hdQ5Hf.js"),[]).then(e=>vr(e.octave))}),Lt.of({name:"Oz",extensions:["oz"],load:()=>t(()=>import("./file-editor-oz-DsOHt9n_.js"),[]).then(e=>vr(e.oz))}),Lt.of({name:"Pascal",extensions:["p","pas"],load:()=>t(()=>import("./file-editor-pascal-MWIkn1JH.js"),[]).then(e=>vr(e.pascal))}),Lt.of({name:"Perl",extensions:["pl","pm"],load:()=>t(()=>import("./file-editor-perl-D4U4Mn-f.js"),[]).then(e=>vr(e.perl))}),Lt.of({name:"Pig",extensions:["pig"],load:()=>t(()=>import("./file-editor-pig-DUTBITpC.js"),[]).then(e=>vr(e.pig))}),Lt.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load:()=>t(()=>import("./file-editor-powershell-akC7YIf9.js"),[]).then(e=>vr(e.powerShell))}),Lt.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load:()=>t(()=>import("./file-editor-properties-_nPj978X.js"),[]).then(e=>vr(e.properties))}),Lt.of({name:"ProtoBuf",extensions:["proto"],load:()=>t(()=>import("./file-editor-protobuf-B4y9do6W.js"),[]).then(e=>vr(e.protobuf))}),Lt.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load:()=>t(()=>import("./file-editor-pug-C_WDC1BE.js"),__vite__mapDeps([26,27])).then(e=>vr(e.pug))}),Lt.of({name:"Puppet",extensions:["pp"],load:()=>t(()=>import("./file-editor-puppet-Dbxp0vTs.js"),[]).then(e=>vr(e.puppet))}),Lt.of({name:"Q",extensions:["q"],load:()=>t(()=>import("./file-editor-q-mUfi2b_o.js"),[]).then(e=>vr(e.q))}),Lt.of({name:"R",alias:["rscript"],extensions:["r","R"],load:()=>t(()=>import("./file-editor-r-J5UZzFYw.js"),[]).then(e=>vr(e.r))}),Lt.of({name:"RPM Changes",load:()=>t(()=>import("./file-editor-rpm-DI_rRufH.js"),[]).then(e=>vr(e.rpmChanges))}),Lt.of({name:"RPM Spec",extensions:["spec"],load:()=>t(()=>import("./file-editor-rpm-DI_rRufH.js"),[]).then(e=>vr(e.rpmSpec))}),Lt.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load:()=>t(()=>import("./file-editor-ruby-SqZyEoLI.js"),[]).then(e=>vr(e.ruby))}),Lt.of({name:"SAS",extensions:["sas"],load:()=>t(()=>import("./file-editor-sas-Bqaci40L.js"),[]).then(e=>vr(e.sas))}),Lt.of({name:"Scala",extensions:["scala"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>vr(e.scala))}),Lt.of({name:"Scheme",extensions:["scm","ss"],load:()=>t(()=>import("./file-editor-scheme-Dtb5z51s.js"),[]).then(e=>vr(e.scheme))}),Lt.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load:()=>t(()=>import("./file-editor-shell-D65E6JiF.js"),[]).then(e=>vr(e.shell))}),Lt.of({name:"Sieve",extensions:["siv","sieve"],load:()=>t(()=>import("./file-editor-sieve-BBCrNNIa.js"),[]).then(e=>vr(e.sieve))}),Lt.of({name:"Smalltalk",extensions:["st"],load:()=>t(()=>import("./file-editor-smalltalk-C7J3IyEP.js"),[]).then(e=>vr(e.smalltalk))}),Lt.of({name:"Solr",load:()=>t(()=>import("./file-editor-solr-CZy78n9F.js"),[]).then(e=>vr(e.solr))}),Lt.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load:()=>t(()=>import("./file-editor-mllike-3c2dg9RT.js"),[]).then(e=>vr(e.sml))}),Lt.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load:()=>t(()=>import("./file-editor-sparql-DItxJg31.js"),[]).then(e=>vr(e.sparql))}),Lt.of({name:"Spreadsheet",alias:["excel","formula"],load:()=>t(()=>import("./file-editor-spreadsheet-CGlWr0eM.js"),[]).then(e=>vr(e.spreadsheet))}),Lt.of({name:"Squirrel",extensions:["nut"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>vr(e.squirrel))}),Lt.of({name:"Stylus",extensions:["styl"],load:()=>t(()=>import("./file-editor-stylus-Dd_3NjJ0.js"),[]).then(e=>vr(e.stylus))}),Lt.of({name:"Swift",extensions:["swift"],load:()=>t(()=>import("./file-editor-swift-B_XXVlXX.js"),[]).then(e=>vr(e.swift))}),Lt.of({name:"sTeX",load:()=>t(()=>import("./file-editor-stex-9_wePcov.js"),[]).then(e=>vr(e.stex))}),Lt.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load:()=>t(()=>import("./file-editor-stex-9_wePcov.js"),[]).then(e=>vr(e.stex))}),Lt.of({name:"SystemVerilog",extensions:["v","sv","svh"],load:()=>t(()=>import("./file-editor-verilog-C8061G8U.js"),[]).then(e=>vr(e.verilog))}),Lt.of({name:"Tcl",extensions:["tcl"],load:()=>t(()=>import("./file-editor-tcl-DxOxgKRU.js"),[]).then(e=>vr(e.tcl))}),Lt.of({name:"Textile",extensions:["textile"],load:()=>t(()=>import("./file-editor-textile-BuVhTOzU.js"),[]).then(e=>vr(e.textile))}),Lt.of({name:"TiddlyWiki",load:()=>t(()=>import("./file-editor-tiddlywiki-BgR6AEZu.js"),[]).then(e=>vr(e.tiddlyWiki))}),Lt.of({name:"Tiki wiki",load:()=>t(()=>import("./file-editor-tiki-ru5LTfYV.js"),[]).then(e=>vr(e.tiki))}),Lt.of({name:"TOML",extensions:["toml"],load:()=>t(()=>import("./file-editor-toml-BVJm5Fzd.js"),[]).then(e=>vr(e.toml))}),Lt.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load:()=>t(()=>import("./file-editor-troff-Ce85hlLp.js"),[]).then(e=>vr(e.troff))}),Lt.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load:()=>t(()=>import("./file-editor-ttcn-BTO1-gcW.js"),[]).then(e=>vr(e.ttcn))}),Lt.of({name:"TTCN_CFG",extensions:["cfg"],load:()=>t(()=>import("./file-editor-ttcn-cfg-DIH_dYzw.js"),[]).then(e=>vr(e.ttcnCfg))}),Lt.of({name:"Turtle",extensions:["ttl"],load:()=>t(()=>import("./file-editor-turtle-DMr_FkeC.js"),[]).then(e=>vr(e.turtle))}),Lt.of({name:"Web IDL",extensions:["webidl"],load:()=>t(()=>import("./file-editor-webidl-CGwyPRYs.js"),[]).then(e=>vr(e.webIDL))}),Lt.of({name:"VB.NET",extensions:["vb"],load:()=>t(()=>import("./file-editor-vb-UtVLDai5.js"),[]).then(e=>vr(e.vb))}),Lt.of({name:"VBScript",extensions:["vbs"],load:()=>t(()=>import("./file-editor-vbscript-a5NhL3_u.js"),[]).then(e=>vr(e.vbScript))}),Lt.of({name:"Velocity",extensions:["vtl"],load:()=>t(()=>import("./file-editor-velocity-BdD_26Jv.js"),[]).then(e=>vr(e.velocity))}),Lt.of({name:"Verilog",extensions:["v"],load:()=>t(()=>import("./file-editor-verilog-C8061G8U.js"),[]).then(e=>vr(e.verilog))}),Lt.of({name:"VHDL",extensions:["vhd","vhdl"],load:()=>t(()=>import("./file-editor-vhdl-JqRksxx8.js"),[]).then(e=>vr(e.vhdl))}),Lt.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load:()=>t(()=>import("./file-editor-xquery-CVDBqZPY.js"),[]).then(e=>vr(e.xQuery))}),Lt.of({name:"Yacas",extensions:["ys"],load:()=>t(()=>import("./file-editor-yacas-WY0UPJfi.js"),[]).then(e=>vr(e.yacas))}),Lt.of({name:"Z80",extensions:["z80"],load:()=>t(()=>import("./file-editor-z80-D8p3gKXp.js"),[]).then(e=>vr(e.z80))}),Lt.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load:()=>t(()=>import("./file-editor-mscgen-BaVD5lDT.js"),[]).then(e=>vr(e.mscgen))}),Lt.of({name:"Xù",extensions:["xu"],load:()=>t(()=>import("./file-editor-mscgen-BaVD5lDT.js"),[]).then(e=>vr(e.xu))}),Lt.of({name:"MsGenny",extensions:["msgenny"],load:()=>t(()=>import("./file-editor-mscgen-BaVD5lDT.js"),[]).then(e=>vr(e.msgenny))}),Lt.of({name:"Vue",extensions:["vue"],load:()=>t(()=>import("./file-editor-index-D_riXMER.js"),__vite__mapDeps([28,1,7,2,5,8,3])).then(e=>e.vue())}),Lt.of({name:"Angular Template",load:()=>t(()=>import("./file-editor-index-BhOxVDWT.js"),__vite__mapDeps([29,1,7,2,5,8,3])).then(e=>e.angular())})],wr="#e06c75",xr="#abb2bf",kr="#7d8799",Cr="#d19a66",_r="#2c313a",Sr="#282c34",Ar="#353a42",Mr="#528bff",Tr=Rt.theme({"&":{color:xr,backgroundColor:Sr},".cm-content":{caretColor:Mr},".cm-cursor, .cm-dropCursor":{borderLeftColor:Mr},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:xr},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Sr,color:kr,border:"none"},".cm-activeLineGutter":{backgroundColor:_r},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Ar},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Ar,borderBottomColor:Ar},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:_r,color:xr}}},{dark:!0}),Er=Bt.define([{tag:zt.keyword,color:"#c678dd"},{tag:[zt.name,zt.deleted,zt.character,zt.propertyName,zt.macroName],color:wr},{tag:[zt.function(zt.variableName),zt.labelName],color:"#61afef"},{tag:[zt.color,zt.constant(zt.name),zt.standard(zt.name)],color:Cr},{tag:[zt.definition(zt.name),zt.separator],color:xr},{tag:[zt.typeName,zt.className,zt.number,zt.changed,zt.annotation,zt.modifier,zt.self,zt.namespace],color:"#e5c07b"},{tag:[zt.operator,zt.operatorKeyword,zt.url,zt.escape,zt.regexp,zt.link,zt.special(zt.string)],color:"#56b6c2"},{tag:[zt.meta,zt.comment],color:kr},{tag:zt.strong,fontWeight:"bold"},{tag:zt.emphasis,fontStyle:"italic"},{tag:zt.strikethrough,textDecoration:"line-through"},{tag:zt.link,color:kr,textDecoration:"underline"},{tag:zt.heading,fontWeight:"bold",color:wr},{tag:[zt.atom,zt.bool,zt.special(zt.variableName)],color:Cr},{tag:[zt.processingInstruction,zt.string,zt.inserted],color:"#98c379"},{tag:zt.invalid,color:"#ffffff"}]),Lr=[Tr,Pt(Er)],Or={encodeCharacter:e=>e,encodeNodeStart:e=>e.type.name,encodeNodeEnd:e=>-function(e){let t=e.schema.cached.changeSetIDs||(e.schema.cached.changeSetIDs=Object.create(null)),n=t[e.name];return null==n&&(t[e.name]=n=Object.keys(e.schema.nodes).indexOf(e.name)+1),n}(e.type),compareTokens:(e,t)=>e===t};function Ir(e,t,n,r,o){for(let i=0,a=0;i<e.childCount;i++){let s=e.child(i),l=a+s.nodeSize,c=Math.max(a,n),d=Math.min(l,r);if(c<d)if(s.isText)for(let e=c;e<d;e++)o.push(t.encodeCharacter(s.text.charCodeAt(e-a),s.marks));else s.isLeaf?o.push(t.encodeNodeStart(s)):(c==a&&o.push(t.encodeNodeStart(s)),Ir(s.content,t,Math.max(a+1,c)-a-1,Math.min(l-1,d)-a-1,o),d==l&&o.push(t.encodeNodeEnd(s)));a=l}return o}function Rr(e,t){return Math.min(15,Math.max(2,Math.floor(Math.max(e,t)/10)))}function Pr(e,t,n,r=Or){let o=Ir(e,r,n.fromA,n.toA,[]),i=Ir(t,r,n.fromB,n.toB,[]),a=0,s=o.length,l=i.length,c=r.compareTokens;for(;a<o.length&&a<i.length&&c(o[a],i[a]);)a++;if(a==o.length&&a==i.length)return[];for(;s>a&&l>a&&c(o[s-1],i[l-1]);)s--,l--;if(s==a||l==a||s==l&&s==a+1)return[n.slice(a,s,a,l)];let d=s-a,u=l-a,h=Math.min(5e3,d+u),p=[],m=[];for(let f=2*(h+1),g=0;g<f;g++)m[g]=-1;for(let f=0;f<=h;f++){for(let e=-f;e<=f;e+=2){let t=m[e+1+h],r=m[e-1+h],g=t<r?r:t+1,v=g+e;for(;g<d&&v<u&&c(o[a+g],i[a+v]);)g++,v++;if(m[e+h]=g,g>=d&&v>=u){let t=[],r=Rr(s-a,l-a),o=-1,i=-1,c=-1,d=-1,u=(e,a,s,l)=>{o>-1&&o<a+r?(o=e,c=s):(o>-1&&t.push(n.slice(o,i,c,d)),o=e,i=a,c=s,d=l)};for(let n=f-1;n>=0;n--){let t=m[e+1+h],r=m[e-1+h];t<r?(e--,g=r+a,v=g+e,u(g,g,v,v+1)):(e++,g=t+a,v=g+e,u(g,g+1,v,v)),m=p[n>>1]}return o>-1&&t.push(n.slice(o,i,c,d)),t.reverse()}}f%2==0&&p.push(m.slice())}return[n.slice(a,s,a,l)]}let Br,zr=class e{constructor(e,t){this.length=e,this.data=t}cut(t){return t==this.length?this:new e(t,this.data)}static slice(t,n,r){if(n==r)return e.none;if(0==n&&r==e.len(t))return t;let o=[];for(let e=0,i=0;i<r;e++){let a=t[e],s=i+a.length,l=Math.min(r,s)-Math.max(n,i);l>0&&o.push(a.cut(l)),i=s}return o}static join(t,n,r){if(0==t.length)return n;if(0==n.length)return t;let o=r(t[t.length-1].data,n[0].data);if(null==o)return t.concat(n);let i=t.slice(0,t.length-1);i.push(new e(t[t.length-1].length+n[0].length,o));for(let e=1;e<n.length;e++)i.push(n[e]);return i}static len(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].length;return t}};zr.none=[];class Dr{constructor(e,t,n,r,o,i){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r,this.deleted=o,this.inserted=i}get lenA(){return this.toA-this.fromA}get lenB(){return this.toB-this.fromB}slice(e,t,n,r){return 0==e&&0==n&&t==this.toA-this.fromA&&r==this.toB-this.fromB?this:new Dr(this.fromA+e,this.fromA+t,this.fromB+n,this.fromB+r,zr.slice(this.deleted,e,t),zr.slice(this.inserted,n,r))}static merge(e,t,n){if(0==e.length)return t;if(0==t.length)return e;let r=[];for(let o=0,i=0,a=e[0],s=t[0];;){if(!a&&!s)return r;if(a&&(!s||a.toB<s.fromA)){let n=i?t[i-1].toB-t[i-1].toA:0;r.push(0==n?a:new Dr(a.fromA,a.toA,a.fromB+n,a.toB+n,a.deleted,a.inserted)),a=o++==e.length?null:e[o]}else if(s&&(!a||s.toA<a.fromB)){let n=o?e[o-1].toB-e[o-1].toA:0;r.push(0==n?s:new Dr(s.fromA-n,s.toA-n,s.fromB,s.toB,s.deleted,s.inserted)),s=i++==t.length?null:t[i]}else{let l=Math.min(a.fromB,s.fromA),c=Math.min(a.fromA,s.fromA-(o?e[o-1].toB-e[o-1].toA:0)),d=c,u=Math.min(s.fromB,a.fromB+(i?t[i-1].toB-t[i-1].toA:0)),h=u,p=zr.none,m=zr.none,f=!1,g=!1;for(;;){let r=a?l>=a.fromB?a.toB:a.fromB:2e8,c=s?l>=s.fromA?s.toA:s.fromA:2e8,u=Math.min(r,c),v=a&&l>=a.fromB,y=s&&l>=s.fromA;if(!v&&!y)break;v&&l==a.fromB&&!f&&(p=zr.join(p,a.deleted,n),d+=a.lenA,f=!0),v&&!y&&(m=zr.join(m,zr.slice(a.inserted,l-a.fromB,u-a.fromB),n),h+=u-l),y&&l==s.fromA&&!g&&(m=zr.join(m,s.inserted,n),h+=s.lenB,g=!0),y&&!v&&(p=zr.join(p,zr.slice(s.deleted,l-s.fromA,u-s.fromA),n),d+=u-l),v&&u==a.toB&&(a=o++==e.length?null:e[o],f=!1),y&&u==s.toA&&(s=i++==t.length?null:t[i],g=!1),l=u}(c<d||u<h)&&r.push(new Dr(c,d,u,h,p,m))}}}static fromJSON(e){return new Dr(e.fromA,e.toA,e.fromB,e.toB,e.deleted.map(e=>new zr(e.length,e.data)),e.inserted.map(e=>new zr(e.length,e.data)))}toJSON(){return this}}try{Br=new RegExp("[\\p{Alphabetic}_]","u")}catch(CT){}class Nr{constructor(e,t){this.config=e,this.changes=t}addSteps(e,t,n){let r=[];for(let s=0;s<t.length;s++){let e=Array.isArray(n)?n[s]:n,o=0;t[s].forEach((t,n,i,a)=>{r.push(new Dr(t+o,n+o,i,a,t==n?zr.none:[new zr(n-t,e)],i==a?zr.none:[new zr(a-i,e)])),o=a-i-(n-t)})}if(0==r.length)return this;let o=Hr(r,this.config.combine),i=Dr.merge(this.changes,o,this.config.combine),a=i;for(let s=0;s<a.length;s++){let t=a[s];if(t.fromA==t.toA||t.fromB==t.toB||!o.some(e=>e.toB>t.fromB&&e.fromB<t.toB))continue;let n=Pr(this.config.doc.content,e.content,t,this.config.encoder);1==n.length&&0==n[0].fromB&&n[0].toB==t.toB-t.fromB||(a==i&&(a=i.slice()),1==n.length?a[s]=n[0]:(a.splice(s,1,...n),s+=n.length-1))}return new Nr(this.config,a)}get startDoc(){return this.config.doc}map(e){let t=t=>{let n=e(t);return n===t.data?t:new zr(t.length,n)};return new Nr(this.config,this.changes.map(e=>new Dr(e.fromA,e.toA,e.fromB,e.toB,e.deleted.map(t),e.inserted.map(t))))}changedRange(e,t){if(e==this)return null;let n=t&&function(e){let t=qr(e);if(!t)return null;let n=qr(e.map(e=>e.invert()).reverse());return{fromA:n.from,toA:n.to,fromB:t.from,toB:t.to}}(t),r=n?n.toB-n.fromB-(n.toA-n.fromA):0;function o(e){return!n||e<=n.fromA?e:e+r}let i=n?n.fromB:2e8,a=n?n.toB:-2e8;function s(e,t=e){i=Math.min(e,i),a=Math.max(t,a)}let l=this.changes,c=e.changes;for(let d=0,u=0;d<l.length&&u<c.length;){let e=l[d],t=c[u];e&&t&&jr(e,t,o)?(d++,u++):t&&(!e||o(e.fromB)>=t.fromB)?(s(t.fromB,t.toB),u++):(s(o(e.fromB),o(e.toB)),d++)}return i<=a?{from:i,to:a}:null}static create(e,t=(e,t)=>e===t?e:null,n=Or,r=[]){return new Nr({combine:t,doc:e,encoder:n},r)}}function Hr(e,t,n=0,r=e.length){if(r==n+1)return[e[n]];let o=n+r>>1;return Dr.merge(Hr(e,t,n,o),Hr(e,t,o,r),t)}function qr(e){let t=2e8,n=-2e8;for(let r=0;r<e.length;r++){let o=e[r];2e8!=t&&(t=o.map(t,-1),n=o.map(n,1)),o.forEach((e,r,o,i)=>{t=Math.min(t,o),n=Math.max(n,i)})}return 2e8==t?null:{from:t,to:n}}function jr(e,t,n){return n(e.fromB)==t.fromB&&n(e.toB)==t.toB&&Vr(e.deleted,t.deleted)&&Vr(e.inserted,t.inserted)}function Vr(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n].length!=t[n].length||e[n].data!==t[n].data)return!1;return!0}function Fr(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-diff",...t}}),e}function $r(e,t,n){const r=n.get(e);if(null!=r)return r;const o=[String(t.encodeNodeStart(e))];if(e.isText){const n=e.text;for(let r=0;r<n.length;r++)o.push(":"+String(t.encodeCharacter(n.charCodeAt(r),e.marks)))}else e.content.forEach(e=>{o.push("/"+$r(e,t,n))});o.push("\\"+String(t.encodeNodeEnd(e)));const i=o.join("");return n.set(e,i),i}function Wr(e,t,n){const r=[];let o=0;return e.content.forEach(e=>{r.push({node:e,offset:o,size:e.nodeSize,signature:$r(e,n.encoder,n.sigCache)}),o+=e.nodeSize}),{node:e,contentStart:t,content:r}}function Ur(e,t,n){return Dr.fromJSON({fromA:e.fromA+t,toA:e.toA+t,fromB:e.fromB+n,toB:e.toB+n,deleted:e.deleted.map(e=>({length:e.length,data:e.data})),inserted:e.inserted.map(e=>({length:e.length,data:e.data}))})}function Gr(e,t){const n=e.content;if(t<n.length)return e.contentStart+n[t].offset;if(t>0){const r=n[t-1];return e.contentStart+r.offset+r.size}return e.contentStart+e.node.content.size}function Zr(e,t,n){return Dr.fromJSON({fromA:t,toA:t+e.size,fromB:n,toB:n,deleted:[{length:e.size,data:null}],inserted:[]})}function Xr(e,t,n){return Dr.fromJSON({fromA:t,toA:t,fromB:n,toB:n+e.size,deleted:[],inserted:[{length:e.size,data:null}]})}function Kr(e,t,n,r,o){if(e.childCount>500||t.childCount>500)return function(e,t,n,r,o){const i=new h(0,e.content.size,new p(t.content,0,0));return Nr.create(e,void 0,o.encoder).addSteps(t,[i.getMap()],null).changes.map(e=>Ur(e,n,r))}(e,t,n,r,o);const i=Wr(e,n,o),a=Wr(t,r,o),s=function(e,t){const n=e.length,r=t.length,o=Array.from({length:n+1},()=>Array.from({length:r+1},()=>0));for(let l=n-1;l>=0;l--)for(let n=r-1;n>=0;n--)e[l].signature===t[n].signature?o[l][n]=o[l+1][n+1]+1:o[l][n]=Math.max(o[l+1][n],o[l][n+1]);const i=[];let a=0,s=0;for(;a<n&&s<r;)e[a].signature===t[s].signature?(i.push([a,s]),a++,s++):o[a+1][s]>=o[a][s+1]?a++:s++;return i}(i.content,a.content),l=[];let c=0,d=0;for(const[u,h]of s)Yr(i,a,{oldStart:c,oldEnd:u,newStart:d,newEnd:h},o,l),c=u+1,d=h+1;return Yr(i,a,{oldStart:c,oldEnd:i.content.length,newStart:d,newEnd:a.content.length},o,l),l}function Yr(e,t,n,r,o){const i=e.content,a=t.content;let s=n.oldStart,l=n.newStart;for(;s<n.oldEnd||l<n.newEnd;){const c=s<n.oldEnd?i[s]:null,d=l<n.newEnd?a[l]:null,u=c&&d&&c.node.type===d.node.type;if(c&&d&&u)o.push(...Jr(e,t,c,d,r)),s++,l++;else{if(c&&(!d||!u)){const n=e.contentStart+c.offset;o.push(Zr(c,n,Gr(t,l))),s++;continue}if(d){const n=t.contentStart+d.offset;o.push(Xr(d,Gr(e,s),n)),l++}}}}function Jr(e,t,n,r,o){const i=e.contentStart+n.offset,a=t.contentStart+r.offset;return function(e,t){if(e.type!==t.type)return!1;const n=e.type;return!n.isTextblock&&!n.isAtom&&!0!==n.spec.code&&!!n.isBlock}(n.node,r.node)&&function(e,t,n){return n.encodeNodeStart(e)===n.encodeNodeStart(t)}(n.node,r.node,o.encoder)?Kr(n.node,r.node,i+1,a+1,o):function(e,t,n){const r=e.parent.copy(m.from(e.node)),o=t.parent.copy(m.from(t.node)),i=new h(0,r.content.size,new p(o.content,0,0));return Nr.create(r,void 0,n.encoder).addSteps(o,[i.getMap()],null).changes.map(n=>Ur(n,e.abs,t.abs))}({node:n.node,parent:e.node,abs:i},{node:r.node,parent:t.node,abs:a},o)}function Qr(e,t,n){const r=function(e={}){const t=new WeakMap,n=new WeakMap;function r(e){let n=t.get(e);if(null!=n)return n;const r=e.attrs,o=r?Object.keys(r).filter(e=>null!=r[e]).sort():[];if(0===o.length)n=e.type.name;else{const t={};for(const e of o)t[e]=r[e];n=`${e.type.name}:${JSON.stringify(t)}`}return t.set(e,n),n}return{encodeCharacter:(e,t)=>{if(0===t.length)return e;let o=n.get(t);return null==o&&(o=t.map(r).join(","),n.set(t,o)),`${e}:${o}`},encodeNodeStart:t=>{const n=t.attrs;if(n&&Object.keys(n).length>0){const r=e[t.type.name]??[],o=Object.keys(n).filter(e=>{if(r.includes(e))return!1;const o=t.type.spec.attrs?.[e]?.default;return n[e]!==o});if(o.length>0){const e={};for(const t of o.sort())e[t]=n[t];return`${t.type.name}:${JSON.stringify(e)}`}}return t.type.name},encodeNodeEnd:e=>{const t=e.type.schema,n=t.cached.changeSetIDs||(t.cached.changeSetIDs=Object.create(null));let r=n[e.type.name];return null==r&&(n[e.type.name]=r=Object.keys(t.nodes).indexOf(e.type.name)+1),-r},compareTokens:(e,t)=>e===t}}(n?.ignoreAttrs),o={encoder:r,sigCache:new WeakMap},i=e.content.size,a=t.content.size,s=n?.range;if(null==s)return Kr(e,t,0,0,o);const l=Math.min(i,a),c=Math.max(0,Math.min(s.from??0,l)),d=Math.max(c,Math.min(s.to??l,l));if(c===d)return[];if(0===c&&d===l&&i===a)return Kr(e,t,0,0,o);const u=function(e,t,n,r,o){const i=e.resolve(n),a=e.resolve(r),s=t.resolve(n),l=t.resolve(r),c=i.sharedDepth(r);if(s.sharedDepth(r)!==c)throw new RangeError(`computeDocDiff: range [${n}, ${r}) resolves to different sharedDepth in old and new docs`);for(let f=0;f<=c;f++){if(o.encodeNodeStart(i.node(f))!==o.encodeNodeStart(s.node(f)))throw new RangeError(`computeDocDiff: ancestor at depth ${f} differs in type or non-ignored attrs along the path to the shared ancestor`);if(i.start(f)!==s.start(f))throw new RangeError(`computeDocDiff: ancestor at depth ${f} starts at different absolute positions in old and new docs (content before the range differs in size)`)}const d=i.node(c);if(d.isTextblock)throw new RangeError(`computeDocDiff: range [${n}, ${r}) lands inside a textblock; widen the range to a block boundary`);if(i.depth!==c||a.depth!==c||s.depth!==c||l.depth!==c)throw new RangeError(`computeDocDiff: range [${n}, ${r}) endpoints must be aligned to child boundaries of the shared ancestor`);const u=s.node(c),h=i.start(c),p=n-h,m=r-h;return{oldCut:d.copy(d.content.cut(p,m)),newCut:u.copy(u.content.cut(p,m)),cutAbsStart:n}}(e,t,c,d,r);return Kr(u.oldCut,u.newCut,u.cutAbsStart,u.cutAbsStart,o)}Nr.computeDiff=Pr;var eo=a({ignoreAttrs:{heading:["id"]}},"diffConfig");Fr(eo,{displayName:"Ctx<diffConfig>",group:"Diff"});var to=new d("MILKDOWN_DIFF");function no(e){return e.changes.filter(t=>!function(e,t){return t.some(t=>e.fromB<t.toB&&e.toB>t.fromB)}(t,e.rejectedRanges))}var ro=s(e=>{const t=e.get(eo.key);return new c({key:to,state:{init:()=>null,apply(e,n,r,o){const i=e.getMeta(to);if(!n){if("start"===i?.type){const e=Qr(o.doc,i.newDoc,{ignoreAttrs:t.ignoreAttrs});return{newDoc:i.newDoc,changes:e,rejectedRanges:[],active:!0}}return null}let a,s=n;if(e.docChanged&&s.active&&(s=function(e,t,n){const r=Qr(e,t.newDoc,n);return{...t,changes:r}}(o.doc,s,{ignoreAttrs:t.ignoreAttrs})),!i)return s;switch(i.type){case"start":{const e=Qr(o.doc,i.newDoc,{ignoreAttrs:t.ignoreAttrs});return{newDoc:i.newDoc,changes:e,rejectedRanges:[],active:!0}}case"accept":case"acceptRange":a=s;break;case"reject":a={...s,rejectedRanges:[...s.rejectedRanges,{fromB:i.fromB,toB:i.toB}]};break;case"rejectRange":a={...s,rejectedRanges:[...s.rejectedRanges,{fromB:i.range.fromB,toB:i.range.toB}]};break;case"acceptAll":case"clear":return null;default:return s}return a.active&&0===no(a).length?null:a}},filterTransaction:(e,t)=>!to.getState(t)?.active||!!e.getMeta(to)||!e.docChanged})});Fr(ro,{displayName:"Prose<diff>",group:"Diff"});var oo=l("StartDiffReview",e=>t=>(n,r)=>{if(null==t)return!1;const o=e.get(u)(t);return!!o&&(r&&r(n.tr.setMeta(to,{type:"start",newDoc:o})),!0)});Fr(oo,{displayName:"Command<startDiffReview>",group:"Diff"});var io=l("StartDiffReviewFromDoc",()=>e=>(t,n)=>!!e&&e.type===t.doc.type&&(n&&n(t.tr.setMeta(to,{type:"start",newDoc:e})),!0));Fr(io,{displayName:"Command<startDiffReviewFromDoc>",group:"Diff"});var ao=l("AcceptDiffChunk",()=>e=>(t,n)=>{if(null==e)return!1;const r=to.getState(t);if(!r)return!1;const o=no(r)[e];if(!o)return!1;if(n){const i=r.newDoc.slice(o.fromB,o.toB);let a=t.tr.replace(o.fromA,o.toA,i);a=a.setMeta(to,{type:"accept",changeIndex:e}),n(a)}return!0});Fr(ao,{displayName:"Command<acceptDiffChunk>",group:"Diff"});var so=l("RejectDiffChunk",()=>e=>(t,n)=>{if(null==e)return!1;const r=to.getState(t);if(!r)return!1;const o=no(r)[e];return!!o&&(n&&n(t.tr.setMeta(to,{type:"reject",fromB:o.fromB,toB:o.toB})),!0)});Fr(so,{displayName:"Command<rejectDiffChunk>",group:"Diff"});var lo=l("AcceptDiffRange",()=>e=>(t,n)=>{if(!e)return!1;const r=to.getState(t);if(!r)return!1;if(n){const o=r.newDoc.slice(e.fromB,e.toB);let i=t.tr.replace(e.fromA,e.toA,o);i=i.setMeta(to,{type:"acceptRange",range:e}),n(i)}return!0});Fr(lo,{displayName:"Command<acceptDiffRange>",group:"Diff"});var co=l("RejectDiffRange",()=>e=>(t,n)=>!!e&&!!to.getState(t)&&(n&&n(t.tr.setMeta(to,{type:"rejectRange",range:e})),!0));Fr(co,{displayName:"Command<rejectDiffRange>",group:"Diff"});var uo=l("AcceptAllDiffs",()=>()=>(e,t)=>{const n=to.getState(e);return!!n&&(t&&t((0===n.rejectedRanges.length?e.tr.replaceWith(0,e.doc.content.size,n.newDoc.content):function(e,t){const n=no(t);for(let r=n.length-1;r>=0;r--){const o=n[r],i=t.newDoc.slice(o.fromB,o.toB);e=e.replace(o.fromA,o.toA,i)}return e}(e.tr,n)).setMeta(to,{type:"acceptAll"})),!0)});Fr(uo,{displayName:"Command<acceptAllDiffs>",group:"Diff"});var ho=l("ClearDiffReview",()=>()=>(e,t)=>!!to.getState(e)&&(t&&t(e.tr.setMeta(to,{type:"clear"})),!0));Fr(ho,{displayName:"Command<clearDiffReview>",group:"Diff"});var po=[eo,ro,oo,io,ao,lo,so,co,uo,ho],mo=Object.defineProperty,fo=Object.getOwnPropertySymbols,go=Object.prototype.hasOwnProperty,vo=Object.prototype.propertyIsEnumerable,yo=(e,t,n)=>t in e?mo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bo=(e,t)=>{for(var n in t||(t={}))go.call(t,n)&&yo(e,n,t[n]);if(fo)for(var n of fo(t))vo.call(t,n)&&yo(e,n,t[n]);return e};function wo(e,t){return Object.assign(e,{meta:bo({package:"@milkdown/components"},t)}),e}const xo="milkdown-diff",ko=a({acceptLabel:"Accept",rejectLabel:"Reject",customBlockTypes:[]},"diffComponentConfig");function Co(e,t,n){if(t===n)return!1;const r=e.resolve(t),o=e.resolve(n);return r.index(0)!==(0===o.depth?Math.max(0,o.index(0)-1):o.index(0))}function _o(e,t,n){if(t>=n)return!1;const r=e.resolve(t),o=e.resolve(n);if(r.sameParent(o)&&r.parent.isTextblock)return!1;let i=!1;return e.nodesBetween(t,n,(e,r)=>{if(i)return!1;if(!e.isBlock)return!0;const o=r+e.nodeSize;return!(r>=t&&o<=n&&(i=!0,1))}),i}function So(e,t,n){if(n!==e.content.size)return!1;const r=e.resolve(t);if(0!==r.depth)return!1;for(let o=r.index(0);o<e.childCount;o++){const t=e.child(o);if("paragraph"!==t.type.name||t.content.size>0)return!1}return!0}function Ao(e,t){const n=e.resolve(t);for(let r=n.depth;r>=1;r--)if(n.node(r).isTextblock)return n.before(r);return t}function Mo(e,t,n,r){let o=0;for(let i=0;i<e.childCount;i++){const a=e.child(i),s=o+a.nodeSize;if(o>=n)break;s>t&&o<n&&r(a,o,s),o=s}}function To(e,t,n,r){Mo(e,t,n,(t,n,o)=>{o===e.content.size&&"paragraph"===t.type.name&&0===t.content.size||r.push(v.node(n,o,{class:`${xo}-removed-block`}))})}function Eo(e,t,n=!1){if(t<0||t>e.content.size)return null;const r=e.resolve(Math.min(t,e.content.size));if(r.depth>=1)return{from:r.before(1),to:r.after(1)};if(n){const e=r.nodeBefore;if(e)return{from:t-e.nodeSize,to:t};const n=r.nodeAfter;if(n)return{from:t,to:t+n.nodeSize}}else{const e=r.nodeAfter;if(e)return{from:t,to:t+e.nodeSize};const n=r.nodeBefore;if(n)return{from:t-n.nodeSize,to:t}}return null}function Lo(e,t,n){if(t<0||t>e.content.size)return null;const r=e.resolve(Math.min(t,e.content.size));for(let o=r.depth;o>=0;o--){const e=r.node(o).type.name;if(n.has(e))return e}return null}function Oo(e,t,n,r=!1){const o=Lo(e,t,n);if(o)return o;const i=e.resolve(Math.min(Math.max(t,0),e.content.size)),a=r?i.nodeBefore:i.nodeAfter;return a&&n.has(a.type.name)?a.type.name:null}function Io(e,t,n,r){return e<r&&t>n}function Ro(e,t,n,r){return t===n?null!=Lo(e,t,r):null!=Oo(e,t,r)||null!=Oo(e,n,r,!0)}function Po(e,t,n){const r=e.resolve(n.fromA);if(!r.parent.isTextblock||r.depth<1)return null;if(!r.node(1).isTextblock)return null;const o=r.after(1),i=t.resolve(n.fromB);let a;if(i.depth>=1&&i.node(1).isTextblock?(a=i.after(1),a>n.toB&&(a=n.toB)):a=n.fromB,o>=n.toA&&a>=n.toB)return null;const s=[];return(o>n.fromA||a>n.fromB)&&s.push({fromA:n.fromA,toA:Math.min(o,n.toA),fromB:n.fromB,toB:a,isBlock:!1}),(n.toA>o||n.toB>a)&&s.push({fromA:o,toA:Math.max(o,n.toA),fromB:a,toB:n.toB,isBlock:!0}),s.length>1?s:null}function Bo(e,t,n,r){return Ro(t,e.fromA,e.toA,r)||Ro(n,e.fromB,e.toB,r)}function zo(e,t,n,r){return t===n?null==Lo(e,t,r)?null:Eo(e,t):null!=Oo(e,t,r)?Eo(e,t):null!=Oo(e,n,r,!0)?Eo(e,n,!0):null}wo(ko,{displayName:"Ctx<diffComponentConfig>",group:"DiffComponent"});const Do=new d("MILKDOWN_DIFF_DECORATION"),No=s(e=>{const t=e.get(ko.key);return new c({key:Do,state:{init:()=>f.empty,apply(n,r,o,i){const a=to.getState(i);return(null==a?void 0:a.active)?n.getMeta(to)||n.docChanged?function(e,t,n,r){const o=[],i=e.get(g),a=new Set(r.customBlockTypes),s=function(e,t,n,r){var o,i,a,s;const l=[],c=new Set;for(let d=0;d<e.length;d++){if(c.has(d))continue;const u=e[d];if(!Bo(u,t,n,r)){l.push({fromA:u.fromA,toA:u.toA,fromB:u.fromB,toB:u.toB,isCustomBlock:!1});continue}const h=zo(t,u.fromA,u.toA,r),p=zo(n,u.fromB,u.toB,r),m={fromA:Math.min(null!=(o=null==h?void 0:h.from)?o:u.fromA,u.fromA),toA:Math.max(null!=(i=null==h?void 0:h.to)?i:u.toA,u.toA),fromB:Math.min(null!=(a=null==p?void 0:p.from)?a:u.fromB,u.fromB),toB:Math.max(null!=(s=null==p?void 0:p.to)?s:u.toB,u.toB),isCustomBlock:!0};c.add(d);for(let t=d+1;t<e.length;t++){if(c.has(t))continue;const n=e[t],r=h&&Io(n.fromA,n.toA,h.from,h.to),o=p&&Io(n.fromB,n.toB,p.from,p.to);(r||o)&&(c.add(t),m.fromA=Math.min(m.fromA,n.fromA),m.toA=Math.max(m.toA,n.toA),m.fromB=Math.min(m.fromB,n.fromB),m.toB=Math.max(m.toB,n.toB))}const f=[];for(let e=0;e<l.length;e++){const t=l[e];if(!t.isCustomBlock)continue;const n=Io(m.fromA,m.toA,t.fromA,t.toA),r=Io(m.fromB,m.toB,t.fromB,t.toB);(n||r)&&(m.fromA=Math.min(m.fromA,t.fromA),m.toA=Math.max(m.toA,t.toA),m.fromB=Math.min(m.fromB,t.fromB),m.toB=Math.max(m.toB,t.toB),f.push(e))}for(let e=f.length-1;e>=0;e--)l.splice(f[e],1);l.push(m)}return l}(no(n),t,n.newDoc,a);!function(e,t){const n=function(e){let t=e.content.size;for(let n=e.childCount-1;n>=0;n--){const r=e.child(n);if("paragraph"!==r.type.name||r.content.size>0)break;t-=r.nodeSize}return t}(t);if(n!==t.content.size)for(const r of e)r.fromA===r.toA&&r.fromB<r.toB&&r.fromA>=n&&(r.fromA=n,r.toA=n)}(s,t);for(let l=0;l<s.length;l++){const e=s[l],a=e.fromA<e.toA,c=e.fromB<e.toB;if(a&&!c&&So(t,e.fromA,e.toA))continue;const d=a&&Co(t,e.fromA,e.toA),u=a&&_o(t,e.fromA,e.toA),h=c&&_o(n.newDoc,e.fromB,e.toB),p=a&&!d&&!u&&!e.isCustomBlock&&!h,m=(d||u||h)&&!p;if(m&&!e.isCustomBlock){const a=Po(t,n.newDoc,e);if(a){Ho({doc:t,newDoc:n.newDoc,segments:a,change:e,changeIndex:l,commands:i,acceptLabel:r.acceptLabel,rejectLabel:r.rejectLabel,decorations:o});continue}}a&&(e.isCustomBlock||m?To(t,e.fromA,e.toA,o):o.push(v.inline(e.fromA,e.toA,{class:`${xo}-removed`})));const f=a?e.toA:e.fromA,g=m?Ao(t,f):f;if(c){const t=qo(n.newDoc,e,m);o.push(v.widget(g,t,{side:-1,key:`added-${l}`}))}const y=jo({commands:i,isBlockLevel:m,change:e,acceptLabel:r.acceptLabel,rejectLabel:r.rejectLabel});o.push(v.widget(g,y,{side:m?-1:1,key:`controls-${l}`}))}return f.create(t,o)}(e,i.doc,a,t):r.map(n.mapping,n.doc):f.empty}},props:{decorations(e){var t;return null!=(t=Do.getState(e))?t:f.empty}}})});function Ho({doc:e,newDoc:t,segments:n,change:r,changeIndex:o,commands:i,acceptLabel:a,rejectLabel:s,decorations:l}){for(let h=0;h<n.length;h++){const r=n[h],i=r.fromA<r.toA,a=r.fromB<r.toB;if(i&&(r.isBlock?To(e,r.fromA,r.toA,l):l.push(v.inline(r.fromA,r.toA,{class:`${xo}-removed`}))),a){const n=r.isBlock?Ao(e,i?r.toA:r.fromA):i?r.toA:r.fromA,a=qo(t,r,r.isBlock);l.push(v.widget(n,a,{side:-1,key:`added-${o}-${h}`}))}}const c=n[n.length-1],d=Ao(e,c.isBlock?c.fromA<c.toA?c.toA:c.fromA:r.toA),u=jo({commands:i,isBlockLevel:!0,change:r,acceptLabel:a,rejectLabel:s});l.push(v.widget(d,u,{side:-1,key:`controls-${o}`}))}function qo(e,t,n){var r;const o=document.createElement(n?"div":"span");o.className=`${xo}-added`,o.contentEditable="false",n&&o.classList.add(`${xo}-added-block`);const i=y.fromSchema(e.type.schema);if(n){const n=function(e,t,n){const r=[];let o=!0,i=-1,a=-1;return Mo(e,t,n,(e,t,n)=>{-1===i&&(i=t),a=n,r.push(e)}),0!==r.length&&i===t&&a===n||(o=!1),o?r:[]}(e,t.fromB,t.toB);if(n.length>0){const e=document.createDocumentFragment();for(const t of n)e.appendChild(i.serializeNode(t));return o.appendChild(e),o}}const a=e.slice(t.fromB,t.toB),s=i.serializeFragment(a.content);if(o.appendChild(s),!(null==(r=o.textContent)?void 0:r.trim())&&!o.querySelector("img, video, audio, canvas, svg")){const n=e.textBetween(t.fromB,t.toB,"\n","\n");n.trim()&&(o.textContent=n)}return o}function jo({commands:e,isBlockLevel:t,change:n,acceptLabel:r,rejectLabel:o}){const i=document.createElement(t?"div":"span");i.className=`${xo}-controls`,i.contentEditable="false",t&&i.classList.add(`${xo}-controls-block`);const a=t=>r=>{r.preventDefault(),r.stopPropagation();const o={fromA:n.fromA,toA:n.toA,fromB:n.fromB,toB:n.toB},i="accept"===t?lo.key:co.key;e.call(i,o)},s=document.createElement("button");s.className=`${xo}-accept`,s.textContent=r,s.addEventListener("click",a("accept"));const l=document.createElement("button");return l.className=`${xo}-reject`,l.textContent=o,l.addEventListener("click",a("reject")),i.appendChild(s),i.appendChild(l),i}wo(No,{displayName:"Prose<diffDecoration>",group:"DiffComponent"});const Vo=[ko,No];function Fo(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-streaming",...t}}),e}var $o=a({throttleMs:100,scrollFollow:!0,diffReviewOnEnd:!1,ignoreAttrs:{heading:["id"]}},"streamingConfig");function Wo(e){if(e.parent.type.spec.code)return{type:"plain-text",preserveNewlines:!0};for(let t=e.depth;t>0;t--)if("table"===e.node(t).type.name)return{type:"plain-text",preserveNewlines:!1};return e.depth>=1?{type:"split-block"}:{type:"block"}}function Uo(e){if(0===e.childCount)return e;const t=e.lastChild;return"paragraph"===t.type.name&&0===t.content.size?e.cut(0,e.size-t.nodeSize):e}Fo($o,{displayName:"Ctx<streamingConfig>",group:"Streaming"});var Go=/[*_~`[\\<]/;function Zo(e,t,n){if(!n)return m.empty;if(!Go.test(n))return m.from(t.text(n));const r=e.get(u)(n)?.firstChild;if("paragraph"!==r?.type.name||0===r.content.size)return m.from(t.text(n));let o=!1;if(r.content.forEach(e=>{(!e.isText||e.marks.length>0)&&(o=!0)}),!o)return m.from(t.text(n));let i=r.content;const a=/^\s+/.exec(n)?.[0];a&&((i.firstChild?.isText?i.firstChild.text??"":"").startsWith(a)||(i=m.from(t.text(a)).append(i)));const s=/\s+$/.exec(n)?.[0];return s&&((i.lastChild?.isText?i.lastChild.text??"":"").endsWith(s)||(i=i.append(m.from(t.text(s))))),i}function Xo(e,t,n){if(null!=n.insertPos){const r=n.insertPos,o=function(e,t,n){const{insertPos:r,currentEndPos:o}=n,i=n.buffer.replace(/\r\n?/g,"\n");if(!i)return{tr:t,applied:!1,insertEndPos:o};const a=t.doc.content.size,s=Math.max(0,Math.min(r,a)),l=Math.max(s,Math.min(o,a)),c=t.doc.resolve(s),d=(e.get($o.key).insertStrategy??Wo)(c),h={ctx:e,tr:t,buffer:i,from:s,to:l,resolved:c};switch(d.type){case"plain-text":return function({tr:e,buffer:t,from:n,to:r},o){const i=o?t:t.replace(/\n/g," "),a=e.doc.type.schema.text(i);return{tr:e=e.replaceWith(n,r,a),applied:!0,insertEndPos:n+i.length}}(h,d.preserveNewlines??!1);case"split-block":return function({ctx:e,tr:t,buffer:n,from:r,to:o,resolved:i}){const a=t.doc.type.schema,s=n.indexOf("\n");if(s<0){const i=Zo(e,a,n);return{tr:t=t.replaceWith(r,o,i),applied:!0,insertEndPos:r+i.size}}const l=n.substring(0,s),c=n.substring(s+1),d=e.get(u),h=c.trim()?d(c):null,f=h?Uo(h.content):m.empty;if(0===f.childCount){const i=Zo(e,a,n.replace(/\n/g," "));return{tr:t=t.replaceWith(r,o,i),applied:!0,insertEndPos:r+i.size}}const g=i.depth;let v=Zo(e,a,l);for(let u=g;u>0;u--)v=m.from(i.node(u).copy(v));const y=v.append(f),b=new p(y,g,0),w=t.doc.content.size,x=t.doc.resolve(Math.min(o,w));let k=o;return g>0&&x.depth===g&&x.parentOffset===x.parent.content.size&&(k=x.after(g)),{tr:t=t.replace(r,k,b),applied:!0,insertEndPos:r+(y.size-g)}}(h);case"block":return function({ctx:e,tr:t,buffer:n,from:r,to:o}){const i=e.get(u)(n);if(!i)return{tr:t,applied:!1,insertEndPos:o};const a=Uo(i.content);return 0===a.size?{tr:t,applied:!1,insertEndPos:o}:{tr:t=t.replace(r,o,new p(a,0,0)),applied:!0,insertEndPos:r+a.size}}(h)}}(e,t,{buffer:n.buffer,insertPos:r,currentEndPos:n.insertEndPos??r});return{tr:o.tr,newDoc:o.applied?o.tr.doc:null,insertEndPos:o.insertEndPos}}return function(e,t,n){const r=e.get(u)(n);if(!r)return{tr:t,newDoc:null};const o=e.get($o.key).ignoreAttrs,i=Qr(t.doc,r,o?{ignoreAttrs:o}:void 0);for(let a=i.length-1;a>=0;a--){const e=i[a],n=r.slice(e.fromB,e.toB);t=t.replace(e.fromA,e.toA,n)}return{tr:t,newDoc:r}}(e,t,n.buffer)}var Ko=new d("MILKDOWN_STREAMING"),Yo=s(e=>{const t=e.get($o.key);return new c({key:Ko,state:{init:()=>null,apply:(e,t)=>function(e,t){if(!e&&"start"!==t?.type)return null;if(!t)return e;switch(t.type){case"start":return{buffer:"",originalDoc:t.originalDoc,active:!0,lastApplyTime:t.lastApplyTime,insertPos:t.insertPos??null,insertEndPos:t.insertEndPos??t.insertPos??null};case"push":return e?{...e,buffer:e.buffer+t.token}:null;case"apply":return e?{...e,lastApplyTime:t.lastApplyTime,insertEndPos:t.insertEndPos??e.insertEndPos}:null;case"end":case"abort":return null;default:return e}}(t,e.getMeta(Ko))},filterTransaction:(e,t)=>!Ko.getState(t)?.active||!!e.getMeta(Ko)||!e.docChanged,view:()=>function(e,t){let n=null,r=-1,o=null;function i(){if(!o)return;const n=Ko.getState(o.state);if(!n?.active||n.buffer.length===r)return;r=n.buffer.length;const i=Xo(e,o.state.tr,n);if(!i.newDoc)return;let a=i.tr;(a.docChanged||null!=i.insertEndPos)&&(a=a.setMeta(Ko,{type:"apply",lastApplyTime:Date.now(),insertEndPos:i.insertEndPos}),t.scrollFollow&&(a=a.scrollIntoView()),o.dispatch(a))}return{update(e){o=e;const a=Ko.getState(e.state);if(!a?.active)return null!=n&&(clearTimeout(n),n=null),void(r=-1);a.buffer.length!==r&&(Date.now()-a.lastApplyTime>=t.throttleMs?i():(null!=n&&clearTimeout(n),n=setTimeout(i,t.throttleMs)))},destroy(){null!=n&&(clearTimeout(n),n=null),o=null}}}(e,t)})});Fo(Yo,{displayName:"Prose<streaming>",group:"Streaming"});var Jo=l("StartStreaming",()=>e=>(t,n)=>{if(Ko.getState(t)?.active)return!1;if(n){let r,o;if(null!=e?.insertAt)if("selection"===e.insertAt){if(r=t.selection.from,o=t.selection.to,t.selection.empty){const e=t.doc.resolve(r);e.parent.isTextblock&&!e.parent.type.spec.code&&0===e.parent.content.size&&1===e.depth&&(r=e.before(e.depth),o=e.after(e.depth))}}else{const n="cursor"===e.insertAt?t.selection.head:e.insertAt;if(!Number.isFinite(n))return!1;r=Math.max(0,Math.min(Math.round(n),t.doc.content.size));const i=t.doc.resolve(r);i.parent.isTextblock&&!i.parent.type.spec.code&&0===i.parent.content.size&&1===i.depth&&(r=i.before(i.depth),o=i.after(i.depth))}n(t.tr.setMeta(Ko,{type:"start",originalDoc:t.doc,insertPos:r,insertEndPos:o,lastApplyTime:Date.now()}))}return!0});Fo(Jo,{displayName:"Command<startStreaming>",group:"Streaming"});var Qo=l("PushChunk",()=>e=>(t,n)=>null!=e&&!!Ko.getState(t)?.active&&(n&&n(t.tr.setMeta(Ko,{type:"push",token:e})),!0));Fo(Qo,{displayName:"Command<pushChunk>",group:"Streaming"});var ei=l("EndStreaming",e=>t=>(n,r)=>{const o=Ko.getState(n);if(!o?.active)return!1;if(r){const a=e.get($o.key),s=t?.diffReview??a.diffReviewOnEnd,l=Xo(e,n.tr,o);let c=l.tr;if(c=c.setMeta(Ko,{type:"end"}),s&&l.newDoc){const t=c.doc;c=c.replace(0,c.doc.content.size,new p(o.originalDoc.content,0,0)),r(c);try{e.get(g).call(io.key,t)}catch(i){console.warn("[milkdown/streaming] diff review handoff skipped:",i)}return!0}r(c)}return!0});Fo(ei,{displayName:"Command<endStreaming>",group:"Streaming"});var ti=l("AbortStreaming",e=>t=>(n,r)=>{const o=Ko.getState(n);if(!o?.active)return!1;if(r){const i=t?.keep??!1;let a=n.tr;a=i?Xo(e,a,o).tr:a.replace(0,n.doc.content.size,new p(o.originalDoc.content,0,0)),a=a.setMeta(Ko,{type:"abort"}),r(a)}return!0});Fo(ti,{displayName:"Command<abortStreaming>",group:"Streaming"});var ni=[$o,Yo,Jo,Qo,ei,ti],ri=class{#e;#t;#n;#r;#o;#i;#a;#s;#l;#c;constructor(e){this.#i=!1,this.onShow=()=>{},this.onHide=()=>{},this.#d=e=>{b(e,this.element,{placement:this.#r.placement??"top",middleware:[w(),x(this.#s),k(this.#l),...this.#n],...this.#r}).then(({x:e,y:t})=>{Object.assign(this.element.style,{left:`${e}px`,top:`${t}px`})}).catch(console.error)},this.#u=e=>this.#o!==e.dom.parentElement,this.#h=(e,t)=>{const{state:n,composing:r}=e,{selection:o,doc:i}=n,{ranges:a}=o,s=Math.min(...a.map(e=>e.$from.pos)),l=Math.max(...a.map(e=>e.$to.pos)),c=t&&t.doc.eq(i)&&t.selection.eq(o);if(this.#i||((this.#o??e.dom.parentElement??document.body).appendChild(this.element),this.#i=!0),r||c)return;if(this.#a?.(),this.#a=void 0,!this.#t(e,t))return void this.hide();const d={getBoundingClientRect:()=>_(e,s,l),contextElement:e.dom};this.#u(e)?this.#a=C(d,this.element,()=>this.#d(d)):this.#d(d),this.show()},this.update=(e,t)=>{this.#c(e,t)},this.#p=e=>{const{doc:t,selection:n}=e.state,{empty:r,from:o,to:i}=n,a=!t.textBetween(o,i).length&&e.state.selection instanceof S,s=this.element.contains(document.activeElement),l=!e.hasFocus()&&!s,c=!e.editable;return!(l||r||a||c)},this.destroy=()=>{this.#a?.(),this.#c.cancel()},this.show=(e,t)=>{if(this.element.dataset.show="true",e){this.#a?.(),this.#a=void 0;const n={...e,contextElement:t?.dom};t&&this.#u(t)?this.#a=C(n,this.element,()=>this.#d(n)):this.#d(n)}this.onShow()},this.hide=()=>{"false"!==this.element.dataset.show&&(this.element.dataset.show="false",this.onHide())},this.element=e.content,this.#e=e.debounce??200,this.#t=e.shouldShow??this.#p,this.#s=e.offset,this.#l=e.shift,this.#n=e.middleware??[],this.#r=e.floatingUIOptions??{},this.#o=e.root,this.element.dataset.show="false",this.#c=gr(this.#h,this.#e)}#d;#u;#h;#p};function oi(e){const t=a({},`${e}_TOOLTIP_SPEC`),n=s(n=>{const r=n.get(t.key);return new c({key:new d(`${e}_TOOLTIP`),...r})}),r=[t,n];return r.key=t.key,r.pluginKey=n.key,t.meta={package:"@milkdown/plugin-tooltip",displayName:`Ctx<tooltipSpec>|${e}`},n.meta={package:"@milkdown/plugin-tooltip",displayName:`Prose<tooltip>|${e}`},r}function ii(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return e=>e in t}const ai={},si=[],li=()=>{},ci=()=>!1,di=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ui=e=>e.startsWith("onUpdate:"),hi=Object.assign,pi=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},mi=Object.prototype.hasOwnProperty,fi=(e,t)=>mi.call(e,t),gi=Array.isArray,vi=e=>"[object Map]"===Si(e),yi=e=>"[object Date]"===Si(e),bi=e=>"function"==typeof e,wi=e=>"string"==typeof e,xi=e=>"symbol"==typeof e,ki=e=>null!==e&&"object"==typeof e,Ci=e=>(ki(e)||bi(e))&&bi(e.then)&&bi(e.catch),_i=Object.prototype.toString,Si=e=>_i.call(e),Ai=e=>wi(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,Mi=ii(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ti=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Ei=/-\w/g,Li=Ti(e=>e.replace(Ei,e=>e.slice(1).toUpperCase())),Oi=/\B([A-Z])/g,Ii=Ti(e=>e.replace(Oi,"-$1").toLowerCase()),Ri=Ti(e=>e.charAt(0).toUpperCase()+e.slice(1)),Pi=Ti(e=>e?`on${Ri(e)}`:""),Bi=(e,t)=>!Object.is(e,t),zi=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Di=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Ni=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Hi;const qi=()=>Hi||(Hi="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function ji(e){if(gi(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],o=wi(r)?Wi(r):ji(r);if(o)for(const e in o)t[e]=o[e]}return t}if(wi(e)||ki(e))return e}const Vi=/;(?![^(]*\))/g,Fi=/:([^]+)/,$i=/\/\*[^]*?\*\//g;function Wi(e){const t={};return e.replace($i,"").split(Vi).forEach(e=>{if(e){const n=e.split(Fi);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Ui(e){let t="";if(wi(e))t=e;else if(gi(e))for(let n=0;n<e.length;n++){const r=Ui(e[n]);r&&(t+=r+" ")}else if(ki(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Gi=ii("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function Zi(e){return!!e||""===e}function Xi(e,t){if(e===t)return!0;let n=yi(e),r=yi(t);if(n||r)return!(!n||!r)&&e.getTime()===t.getTime();if(n=xi(e),r=xi(t),n||r)return e===t;if(n=gi(e),r=gi(t),n||r)return!(!n||!r)&&function(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Xi(e[r],t[r]);return n}(e,t);if(n=ki(e),r=ki(t),n||r){if(!n||!r)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e){const r=e.hasOwnProperty(n),o=t.hasOwnProperty(n);if(r&&!o||!r&&o||!Xi(e[n],t[n]))return!1}}return String(e)===String(t)}let Ki,Yi;class Ji{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Ki,!e&&Ki&&(this.index=(Ki.scopes||(Ki.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=Ki;try{return Ki=this,e()}finally{Ki=t}}}on(){1===++this._on&&(this.prevScope=Ki,Ki=this)}off(){this._on>0&&0===--this._on&&(Ki=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){let t,n;for(this._active=!1,t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}const Qi=new WeakSet;class ea{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ki&&Ki.active&&Ki.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,Qi.has(this)&&(Qi.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||oa(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,va(this),sa(this);const e=Yi,t=pa;Yi=this,pa=!0;try{return this.fn()}finally{la(this),Yi=e,pa=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)ua(e);this.deps=this.depsTail=void 0,va(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?Qi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ca(this)&&this.run()}get dirty(){return ca(this)}}let ta,na,ra=0;function oa(e,t=!1){if(e.flags|=8,t)return e.next=na,void(na=e);e.next=ta,ta=e}function ia(){ra++}function aa(){if(--ra>0)return;if(na){let e=na;for(na=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;ta;){let n=ta;for(ta=void 0;n;){const r=n.next;if(n.next=void 0,n.flags&=-9,1&n.flags)try{n.trigger()}catch(t){e||(e=t)}n=r}}if(e)throw e}function sa(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function la(e){let t,n=e.depsTail,r=n;for(;r;){const e=r.prevDep;-1===r.version?(r===n&&(n=e),ua(r),ha(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function ca(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(da(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function da(e){if(4&e.flags&&!(16&e.flags))return;if(e.flags&=-17,e.globalVersion===ya)return;if(e.globalVersion=ya,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!ca(e)))return;e.flags|=2;const t=e.dep,n=Yi,r=pa;Yi=e,pa=!0;try{sa(e);const n=e.fn(e._value);(0===t.version||Bi(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(o){throw t.version++,o}finally{Yi=n,pa=r,la(e),e.flags&=-3}}function ua(e,t=!1){const{dep:n,prevSub:r,nextSub:o}=e;if(r&&(r.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)ua(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function ha(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let pa=!0;const ma=[];function fa(){ma.push(pa),pa=!1}function ga(){const e=ma.pop();pa=void 0===e||e}function va(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const e=Yi;Yi=void 0;try{t()}finally{Yi=e}}}let ya=0;class ba{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class wa{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Yi||!pa||Yi===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==Yi)t=this.activeLink=new ba(Yi,this),Yi.deps?(t.prevDep=Yi.depsTail,Yi.depsTail.nextDep=t,Yi.depsTail=t):Yi.deps=Yi.depsTail=t,xa(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){const e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=Yi.depsTail,t.nextDep=void 0,Yi.depsTail.nextDep=t,Yi.depsTail=t,Yi.deps===t&&(Yi.deps=e)}return t}trigger(e){this.version++,ya++,this.notify(e)}notify(e){ia();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{aa()}}}function xa(e){if(e.dep.sc++,4&e.sub.flags){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)xa(e)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ka=new WeakMap,Ca=Symbol(""),_a=Symbol(""),Sa=Symbol("");function Aa(e,t,n){if(pa&&Yi){let t=ka.get(e);t||ka.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new wa),r.map=t,r.key=n),r.track()}}function Ma(e,t,n,r,o,i){const a=ka.get(e);if(!a)return void ya++;const s=e=>{e&&e.trigger()};if(ia(),"clear"===t)a.forEach(s);else{const o=gi(e),i=o&&Ai(n);if(o&&"length"===n){const e=Number(r);a.forEach((t,n)=>{("length"===n||n===Sa||!xi(n)&&n>=e)&&s(t)})}else switch((void 0!==n||a.has(void 0))&&s(a.get(n)),i&&s(a.get(Sa)),t){case"add":o?i&&s(a.get("length")):(s(a.get(Ca)),vi(e)&&s(a.get(_a)));break;case"delete":o||(s(a.get(Ca)),vi(e)&&s(a.get(_a)));break;case"set":vi(e)&&s(a.get(Ca))}}aa()}function Ta(e){const t=hs(e);return t===e?t:(Aa(t,0,Sa),ds(e)?t:t.map(ps))}function Ea(e){return Aa(e=hs(e),0,Sa),e}function La(e,t){return cs(e)?ms(ls(e)?ps(t):t):ps(t)}const Oa={__proto__:null,[Symbol.iterator](){return Ia(this,Symbol.iterator,e=>La(this,e))},concat(...e){return Ta(this).concat(...e.map(e=>gi(e)?Ta(e):e))},entries(){return Ia(this,"entries",e=>(e[1]=La(this,e[1]),e))},every(e,t){return Pa(this,"every",e,t,void 0,arguments)},filter(e,t){return Pa(this,"filter",e,t,e=>e.map(e=>La(this,e)),arguments)},find(e,t){return Pa(this,"find",e,t,e=>La(this,e),arguments)},findIndex(e,t){return Pa(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Pa(this,"findLast",e,t,e=>La(this,e),arguments)},findLastIndex(e,t){return Pa(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Pa(this,"forEach",e,t,void 0,arguments)},includes(...e){return za(this,"includes",e)},indexOf(...e){return za(this,"indexOf",e)},join(e){return Ta(this).join(e)},lastIndexOf(...e){return za(this,"lastIndexOf",e)},map(e,t){return Pa(this,"map",e,t,void 0,arguments)},pop(){return Da(this,"pop")},push(...e){return Da(this,"push",e)},reduce(e,...t){return Ba(this,"reduce",e,t)},reduceRight(e,...t){return Ba(this,"reduceRight",e,t)},shift(){return Da(this,"shift")},some(e,t){return Pa(this,"some",e,t,void 0,arguments)},splice(...e){return Da(this,"splice",e)},toReversed(){return Ta(this).toReversed()},toSorted(e){return Ta(this).toSorted(e)},toSpliced(...e){return Ta(this).toSpliced(...e)},unshift(...e){return Da(this,"unshift",e)},values(){return Ia(this,"values",e=>La(this,e))}};function Ia(e,t,n){const r=Ea(e),o=r[t]();return r===e||ds(e)||(o._next=o.next,o.next=()=>{const e=o._next();return e.done||(e.value=n(e.value)),e}),o}const Ra=Array.prototype;function Pa(e,t,n,r,o,i){const a=Ea(e),s=a!==e&&!ds(e),l=a[t];if(l!==Ra[t]){const t=l.apply(e,i);return s?ps(t):t}let c=n;a!==e&&(s?c=function(t,r){return n.call(this,La(e,t),r,e)}:n.length>2&&(c=function(t,r){return n.call(this,t,r,e)}));const d=l.call(a,c,r);return s&&o?o(d):d}function Ba(e,t,n,r){const o=Ea(e);let i=n,a=!1;o!==e&&(o===e||ds(e)?n.length>3&&(i=function(t,r,o){return n.call(this,t,r,o,e)}):(a=0===r.length,i=function(t,r,o){return a&&(a=!1,t=La(e,t)),n.call(this,t,La(e,r),o,e)}));const s=o[t](i,...r);return a?La(e,s):s}function za(e,t,n){const r=hs(e);Aa(r,0,Sa);const o=r[t](...n);return-1!==o&&!1!==o||!us(n[0])?o:(n[0]=hs(n[0]),r[t](...n))}function Da(e,t,n=[]){fa(),ia();const r=hs(e)[t].apply(e,n);return aa(),ga(),r}const Na=ii("__proto__,__v_isRef,__isVue"),Ha=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(xi));function qa(e){xi(e)||(e=String(e));const t=hs(this);return Aa(t,0,e),t.hasOwnProperty(e)}class ja{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;const r=this._isReadonly,o=this._isShallow;if("__v_isReactive"===t)return!r;if("__v_isReadonly"===t)return r;if("__v_isShallow"===t)return o;if("__v_raw"===t)return n===(r?o?rs:ns:o?ts:es).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const i=gi(e);if(!r){let e;if(i&&(e=Oa[t]))return e;if("hasOwnProperty"===t)return qa}const a=Reflect.get(e,t,fs(e)?e:n);if(xi(t)?Ha.has(t):Na(t))return a;if(r||Aa(e,0,t),o)return a;if(fs(a)){const e=i&&Ai(t)?a:a.value;return r&&ki(e)?as(e):e}return ki(a)?r?as(a):os(a):a}}class Va extends ja{constructor(e=!1){super(!1,e)}set(e,t,n,r){let o=e[t];const i=gi(e)&&Ai(t);if(!this._isShallow){const e=cs(o);if(ds(n)||cs(n)||(o=hs(o),n=hs(n)),!i&&fs(o)&&!fs(n))return e||(o.value=n),!0}const a=i?Number(t)<e.length:fi(e,t),s=Reflect.set(e,t,n,fs(e)?e:r);return e===hs(r)&&(a?Bi(n,o)&&Ma(e,"set",t,n):Ma(e,"add",t,n)),s}deleteProperty(e,t){const n=fi(e,t);e[t];const r=Reflect.deleteProperty(e,t);return r&&n&&Ma(e,"delete",t,void 0),r}has(e,t){const n=Reflect.has(e,t);return xi(t)&&Ha.has(t)||Aa(e,0,t),n}ownKeys(e){return Aa(e,0,gi(e)?"length":Ca),Reflect.ownKeys(e)}}class Fa extends ja{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const $a=new Va,Wa=new Fa,Ua=new Va(!0),Ga=e=>e,Za=e=>Reflect.getPrototypeOf(e);function Xa(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function Ka(e,t){const n=function(e,t){const n={get(n){const r=this.__v_raw,o=hs(r),i=hs(n);e||(Bi(n,i)&&Aa(o,0,n),Aa(o,0,i));const{has:a}=Za(o),s=t?Ga:e?ms:ps;return a.call(o,n)?s(r.get(n)):a.call(o,i)?s(r.get(i)):void(r!==o&&r.get(n))},get size(){const t=this.__v_raw;return!e&&Aa(hs(t),0,Ca),t.size},has(t){const n=this.__v_raw,r=hs(n),o=hs(t);return e||(Bi(t,o)&&Aa(r,0,t),Aa(r,0,o)),t===o?n.has(t):n.has(t)||n.has(o)},forEach(n,r){const o=this,i=o.__v_raw,a=t?Ga:e?ms:ps;return!e&&Aa(hs(i),0,Ca),i.forEach((e,t)=>n.call(r,a(e),a(t),o))}};return hi(n,e?{add:Xa("add"),set:Xa("set"),delete:Xa("delete"),clear:Xa("clear")}:{add(e){const n=hs(this),r=Za(n),o=hs(e),i=t||ds(e)||cs(e)?e:o;return r.has.call(n,i)||Bi(e,i)&&r.has.call(n,e)||Bi(o,i)&&r.has.call(n,o)||(n.add(i),Ma(n,"add",i,i)),this},set(e,n){t||ds(n)||cs(n)||(n=hs(n));const r=hs(this),{has:o,get:i}=Za(r);let a=o.call(r,e);a||(e=hs(e),a=o.call(r,e));const s=i.call(r,e);return r.set(e,n),a?Bi(n,s)&&Ma(r,"set",e,n):Ma(r,"add",e,n),this},delete(e){const t=hs(this),{has:n,get:r}=Za(t);let o=n.call(t,e);o||(e=hs(e),o=n.call(t,e)),r&&r.call(t,e);const i=t.delete(e);return o&&Ma(t,"delete",e,void 0),i},clear(){const e=hs(this),t=0!==e.size,n=e.clear();return t&&Ma(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=function(e,t,n){return function(...r){const o=this.__v_raw,i=hs(o),a=vi(i),s="entries"===e||e===Symbol.iterator&&a,l="keys"===e&&a,c=o[e](...r),d=n?Ga:t?ms:ps;return!t&&Aa(i,0,l?_a:Ca),hi(Object.create(c),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:s?[d(e[0]),d(e[1])]:d(e),done:t}}})}}(r,e,t)}),n}(e,t);return(t,r,o)=>"__v_isReactive"===r?!e:"__v_isReadonly"===r?e:"__v_raw"===r?t:Reflect.get(fi(n,r)&&r in t?n:t,r,o)}const Ya={get:Ka(!1,!1)},Ja={get:Ka(!1,!0)},Qa={get:Ka(!0,!1)},es=new WeakMap,ts=new WeakMap,ns=new WeakMap,rs=new WeakMap;function os(e){return cs(e)?e:ss(e,!1,$a,Ya,es)}function is(e){return ss(e,!1,Ua,Ja,ts)}function as(e){return ss(e,!0,Wa,Qa,ns)}function ss(e,t,n,r,o){if(!ki(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const i=function(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>Si(e).slice(8,-1))(e))}(e);if(0===i)return e;const a=o.get(e);if(a)return a;const s=new Proxy(e,2===i?r:n);return o.set(e,s),s}function ls(e){return cs(e)?ls(e.__v_raw):!(!e||!e.__v_isReactive)}function cs(e){return!(!e||!e.__v_isReadonly)}function ds(e){return!(!e||!e.__v_isShallow)}function us(e){return!!e&&!!e.__v_raw}function hs(e){const t=e&&e.__v_raw;return t?hs(t):e}const ps=e=>ki(e)?os(e):e,ms=e=>ki(e)?as(e):e;function fs(e){return!!e&&!0===e.__v_isRef}function gs(e){return ys(e,!1)}function vs(e){return ys(e,!0)}function ys(e,t){return fs(e)?e:new bs(e,t)}class bs{constructor(e,t){this.dep=new wa,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:hs(e),this._value=t?e:ps(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||ds(e)||cs(e);Bi(e=n?e:hs(e),t)&&(this._rawValue=e,this._value=n?e:ps(e),this.dep.trigger())}}const ws={get:(e,t,n)=>"__v_raw"===t?e:function(e){return fs(e)?e.value:e}(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return fs(o)&&!fs(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function xs(e){return ls(e)?e:new Proxy(e,ws)}class ks{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new wa(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ya-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&Yi!==this)return oa(this,!0),!0}get value(){const e=this.dep.track();return da(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function Cs(e,t,n=!1){let r,o;return bi(e)?r=e:(r=e.get,o=e.set),new ks(r,o,n)}const _s={},Ss=new WeakMap;let As;function Ms(e,t=1/0,n){if(t<=0||!ki(e)||e.__v_skip)return e;if(((n=n||new Map).get(e)||0)>=t)return e;if(n.set(e,t),t--,fs(e))Ms(e.value,t,n);else if(gi(e))for(let r=0;r<e.length;r++)Ms(e[r],t,n);else if((e=>"[object Set]"===Si(e))(e)||vi(e))e.forEach(e=>{Ms(e,t,n)});else if((e=>"[object Object]"===Si(e))(e)){for(const r in e)Ms(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Ms(e[r],t,n)}return e}function Ts(e,t,n,r){try{return r?e(...r):e()}catch(o){Ls(o,t,n)}}function Es(e,t,n,r){if(bi(e)){const o=Ts(e,t,n,r);return o&&Ci(o)&&o.catch(e=>{Ls(e,t,n)}),o}if(gi(e)){const o=[];for(let i=0;i<e.length;i++)o.push(Es(e[i],t,n,r));return o}}function Ls(e,t,n,r=!0){t&&t.vnode;const{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||ai;if(t){let r=t.parent;const i=t.proxy,a=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){const t=r.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,i,a))return;r=r.parent}if(o)return fa(),Ts(o,null,10,[e,i,a]),void ga()}!function(e,t,n,r=!0,o=!1){if(o)throw e;console.error(e)}(e,0,0,r,i)}const Os=[];let Is=-1;const Rs=[];let Ps=null,Bs=0;const zs=Promise.resolve();let Ds=null;function Ns(e){const t=Ds||zs;return e?t.then(this?e.bind(this):e):t}function Hs(e){if(!(1&e.flags)){const t=Fs(e),n=Os[Os.length-1];!n||!(2&e.flags)&&t>=Fs(n)?Os.push(e):Os.splice(function(e){let t=Is+1,n=Os.length;for(;t<n;){const r=t+n>>>1,o=Os[r],i=Fs(o);i<e||i===e&&2&o.flags?t=r+1:n=r}return t}(t),0,e),e.flags|=1,qs()}}function qs(){Ds||(Ds=zs.then($s))}function js(e,t,n=Is+1){for(;n<Os.length;n++){const t=Os[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;Os.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function Vs(e){if(Rs.length){const e=[...new Set(Rs)].sort((e,t)=>Fs(e)-Fs(t));if(Rs.length=0,Ps)return void Ps.push(...e);for(Ps=e,Bs=0;Bs<Ps.length;Bs++){const e=Ps[Bs];4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}Ps=null,Bs=0}}const Fs=e=>null==e.id?2&e.flags?-1:1/0:e.id;function $s(e){try{for(Is=0;Is<Os.length;Is++){const e=Os[Is];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),Ts(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;Is<Os.length;Is++){const e=Os[Is];e&&(e.flags&=-2)}Is=-1,Os.length=0,Vs(),Ds=null,(Os.length||Rs.length)&&$s()}}let Ws,Us=[],Gs=!1;function Zs(e,...t){Ws?Ws.emit(e,...t):Gs||Us.push({event:e,args:t})}function Xs(e,t){var n,r;Ws=e,Ws?(Ws.enabled=!0,Us.forEach(({event:e,args:t})=>Ws.emit(e,...t)),Us=[]):"undefined"!=typeof window&&window.HTMLElement&&!(null==(r=null==(n=window.navigator)?void 0:n.userAgent)?void 0:r.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(e=>{Xs(e,t)}),setTimeout(()=>{Ws||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Gs=!0,Us=[])},3e3)):(Gs=!0,Us=[])}const Ks=Qs("component:added"),Ys=Qs("component:updated"),Js=Qs("component:removed");function Qs(e){return t=>{Zs(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let el=null,tl=null;function nl(e){const t=el;return el=e,tl=e&&e.type.__scopeId||null,t}function rl(e,t,n,r){const o=e.dirs,i=t&&t.dirs;for(let a=0;a<o.length;a++){const s=o[a];i&&(s.oldValue=i[a].value);let l=s.dir[r];l&&(fa(),Es(l,n,8,[e.el,s,e,t]),ga())}}function ol(e,t,n=!1){const r=td();if(r||oc){let o=oc?oc._context.provides:r?null==r.parent||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&bi(t)?t.call(r&&r.proxy):t}}const il=Symbol.for("v-scx");function al(e,t){return ll(e,null,t)}function sl(e,t,n){return ll(e,t,n)}function ll(e,t,n=ai){const{immediate:r,deep:o,flush:i,once:a}=n,s=hi({},n),l=t&&r||!t&&"post"!==i;let c;if(sd)if("sync"===i){const e=ol(il);c=e.__watcherHandles||(e.__watcherHandles=[])}else if(!l){const e=()=>{};return e.stop=li,e.resume=li,e.pause=li,e}const d=ed;s.call=(e,t,n)=>Es(e,d,t,n);let u=!1;"post"===i?s.scheduler=e=>{Tc(e,d&&d.suspense)}:"sync"!==i&&(u=!0,s.scheduler=(e,t)=>{t?e():Hs(e)}),s.augmentJob=e=>{t&&(e.flags|=4),u&&(e.flags|=2,d&&(e.id=d.uid,e.i=d))};const h=function(e,t,n=ai){const{immediate:r,deep:o,once:i,scheduler:a,augmentJob:s,call:l}=n,c=e=>o?e:ds(e)||!1===o||0===o?Ms(e,1):Ms(e);let d,u,h,p,m=!1,f=!1;if(fs(e)?(u=()=>e.value,m=ds(e)):ls(e)?(u=()=>c(e),m=!0):gi(e)?(f=!0,m=e.some(e=>ls(e)||ds(e)),u=()=>e.map(e=>fs(e)?e.value:ls(e)?c(e):bi(e)?l?l(e,2):e():void 0)):u=bi(e)?t?l?()=>l(e,2):e:()=>{if(h){fa();try{h()}finally{ga()}}const t=As;As=d;try{return l?l(e,3,[p]):e(p)}finally{As=t}}:li,t&&o){const e=u,t=!0===o?1/0:o;u=()=>Ms(e(),t)}const g=Ki,v=()=>{d.stop(),g&&g.active&&pi(g.effects,d)};if(i&&t){const e=t;t=(...t)=>{e(...t),v()}}let y=f?new Array(e.length).fill(_s):_s;const b=e=>{if(1&d.flags&&(d.dirty||e))if(t){const e=d.run();if(o||m||(f?e.some((e,t)=>Bi(e,y[t])):Bi(e,y))){h&&h();const n=As;As=d;try{const n=[e,y===_s?void 0:f&&y[0]===_s?[]:y,p];y=e,l?l(t,3,n):t(...n)}finally{As=n}}}else d.run()};return s&&s(b),d=new ea(u),d.scheduler=a?()=>a(b,!1):b,p=e=>function(e,t=!1,n=As){if(n){let t=Ss.get(n);t||Ss.set(n,t=[]),t.push(e)}}(e,!1,d),h=d.onStop=()=>{const e=Ss.get(d);if(e){if(l)l(e,4);else for(const t of e)t();Ss.delete(d)}},t?r?b(!0):y=d.run():a?a(b.bind(null,!0),!0):d.run(),v.pause=d.pause.bind(d),v.resume=d.resume.bind(d),v.stop=v,v}(e,t,s);return sd&&(c?c.push(h):l&&h()),h}function cl(e,t,n){const r=this.proxy,o=wi(e)?e.includes(".")?dl(r,e):()=>r[e]:e.bind(r,r);let i;bi(t)?i=t:(i=t.handler,n=t);const a=od(this),s=ll(o,i.bind(r),n);return a(),s}function dl(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}const ul=Symbol("_vte"),hl=Symbol("_leaveCb");function pl(e,t){6&e.shapeFlag&&e.component?(e.transition=t,pl(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ml(e,t){return bi(e)?(()=>hi({name:e.name},t,{setup:e}))():e}function fl(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function gl(e,t){let n;return!(!(n=Object.getOwnPropertyDescriptor(e,t))||n.configurable)}const vl=new WeakMap;function yl(e,t,n,r,o=!1){if(gi(e))return void e.forEach((e,i)=>yl(e,t&&(gi(t)?t[i]:t),n,r,o));if(wl(r)&&!o)return void(512&r.shapeFlag&&r.type.__asyncResolved&&r.component.subTree.component&&yl(e,t,n,r.component.subTree));const i=4&r.shapeFlag?ud(r.component):r.el,a=o?null:i,{i:s,r:l}=e,c=t&&t.r,d=s.refs===ai?s.refs={}:s.refs,u=s.setupState,h=hs(u),p=u===ai?ci:e=>!gl(d,e)&&fi(h,e),m=(e,t)=>!t||!gl(d,t);if(null!=c&&c!==l)if(bl(t),wi(c))d[c]=null,p(c)&&(u[c]=null);else if(fs(c)){const e=t;m(0,e.k)&&(c.value=null),e.k&&(d[e.k]=null)}if(bi(l))Ts(l,s,12,[a,d]);else{const t=wi(l),r=fs(l);if(t||r){const s=()=>{if(e.f){const n=t?p(l)?u[l]:d[l]:m()||!e.k?l.value:d[e.k];if(o)gi(n)&&pi(n,i);else if(gi(n))n.includes(i)||n.push(i);else if(t)d[l]=[i],p(l)&&(u[l]=d[l]);else{const t=[i];m(0,e.k)&&(l.value=t),e.k&&(d[e.k]=t)}}else t?(d[l]=a,p(l)&&(u[l]=a)):r&&(m(0,e.k)&&(l.value=a),e.k&&(d[e.k]=a))};if(a){const t=()=>{s(),vl.delete(e)};t.id=-1,vl.set(e,t),Tc(t,n)}else bl(e),s()}}}function bl(e){const t=vl.get(e);t&&(t.flags|=8,vl.delete(e))}qi().requestIdleCallback,qi().cancelIdleCallback;const wl=e=>!!e.type.__asyncLoader,xl=e=>e.type.__isKeepAlive;function kl(e,t){_l(e,"a",t)}function Cl(e,t){_l(e,"da",t)}function _l(e,t,n=ed){const r=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(Al(t,r,n),n){let e=n.parent;for(;e&&e.parent;)xl(e.parent.vnode)&&Sl(r,t,n,e),e=e.parent}}function Sl(e,t,n,r){const o=Al(t,e,r,!0);Rl(()=>{pi(r[t],o)},n)}function Al(e,t,n=ed,r=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{fa();const o=od(n),i=Es(t,n,e,r);return o(),ga(),i});return r?o.unshift(i):o.push(i),i}}const Ml=e=>(t,n=ed)=>{sd&&"sp"!==e||Al(e,(...e)=>t(...e),n)},Tl=Ml("bm"),El=Ml("m"),Ll=Ml("bu"),Ol=Ml("u"),Il=Ml("bum"),Rl=Ml("um"),Pl=Ml("sp"),Bl=Ml("rtg"),zl=Ml("rtc");function Dl(e,t=ed){Al("ec",e,t)}const Nl=Symbol.for("v-ndc"),Hl=e=>e?ad(e)?ud(e):Hl(e.parent):null,ql=hi(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Hl(e.parent),$root:e=>Hl(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>__VUE_OPTIONS_API__?Gl(e):e.type,$forceUpdate:e=>e.f||(e.f=()=>{Hs(e.update)}),$nextTick:e=>e.n||(e.n=Ns.bind(e.proxy)),$watch:e=>__VUE_OPTIONS_API__?cl.bind(e):li}),jl=(e,t)=>e!==ai&&!e.__isScriptSetup&&fi(e,t),Vl={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:r,data:o,props:i,accessCache:a,type:s,appContext:l}=e;if("$"!==t[0]){const e=a[t];if(void 0!==e)switch(e){case 1:return r[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(jl(r,t))return a[t]=1,r[t];if(__VUE_OPTIONS_API__&&o!==ai&&fi(o,t))return a[t]=2,o[t];if(fi(i,t))return a[t]=3,i[t];if(n!==ai&&fi(n,t))return a[t]=4,n[t];__VUE_OPTIONS_API__&&!$l||(a[t]=0)}}const c=ql[t];let d,u;return c?("$attrs"===t&&Aa(e.attrs,0,""),c(e)):(d=s.__cssModules)&&(d=d[t])?d:n!==ai&&fi(n,t)?(a[t]=4,n[t]):(u=l.config.globalProperties,fi(u,t)?u[t]:void 0)},set({_:e},t,n){const{data:r,setupState:o,ctx:i}=e;return jl(o,t)?(o[t]=n,!0):__VUE_OPTIONS_API__&&r!==ai&&fi(r,t)?(r[t]=n,!0):!(fi(e.props,t)||"$"===t[0]&&t.slice(1)in e||(i[t]=n,0))},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:o,props:i,type:a}},s){let l;return!!(n[s]||__VUE_OPTIONS_API__&&e!==ai&&"$"!==s[0]&&fi(e,s)||jl(t,s)||fi(i,s)||fi(r,s)||fi(ql,s)||fi(o.config.globalProperties,s)||(l=a.__cssModules)&&l[s])},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:fi(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Fl(e){return gi(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let $l=!0;function Wl(e,t,n){Es(gi(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function Ul(e,t,n,r){let o=r.includes(".")?dl(n,r):()=>n[r];if(wi(e)){const n=t[e];bi(n)&&sl(o,n)}else if(bi(e))sl(o,e.bind(n));else if(ki(e))if(gi(e))e.forEach(e=>Ul(e,t,n,r));else{const r=bi(e.handler)?e.handler.bind(n):t[e.handler];bi(r)&&sl(o,r,e)}}function Gl(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:a}}=e.appContext,s=i.get(t);let l;return s?l=s:o.length||n||r?(l={},o.length&&o.forEach(e=>Zl(l,e,a,!0)),Zl(l,t,a)):l=t,ki(t)&&i.set(t,l),l}function Zl(e,t,n,r=!1){const{mixins:o,extends:i}=t;i&&Zl(e,i,n,!0),o&&o.forEach(t=>Zl(e,t,n,!0));for(const a in t)if(r&&"expose"===a);else{const r=Xl[a]||n&&n[a];e[a]=r?r(e[a],t[a]):t[a]}return e}const Xl={data:Kl,props:ec,emits:ec,methods:Ql,computed:Ql,beforeCreate:Jl,created:Jl,beforeMount:Jl,mounted:Jl,beforeUpdate:Jl,updated:Jl,beforeDestroy:Jl,beforeUnmount:Jl,destroyed:Jl,unmounted:Jl,activated:Jl,deactivated:Jl,errorCaptured:Jl,serverPrefetch:Jl,components:Ql,directives:Ql,watch:function(e,t){if(!e)return t;if(!t)return e;const n=hi(Object.create(null),e);for(const r in t)n[r]=Jl(e[r],t[r]);return n},provide:Kl,inject:function(e,t){return Ql(Yl(e),Yl(t))}};function Kl(e,t){return t?e?function(){return hi(bi(e)?e.call(this,this):e,bi(t)?t.call(this,this):t)}:t:e}function Yl(e){if(gi(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Jl(e,t){return e?[...new Set([].concat(e,t))]:t}function Ql(e,t){return e?hi(Object.create(null),e,t):t}function ec(e,t){return e?gi(e)&&gi(t)?[...new Set([...e,...t])]:hi(Object.create(null),Fl(e),Fl(null!=t?t:{})):t}function tc(){return{app:null,config:{isNativeTag:ci,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let nc=0;function rc(e,t){return function(t,n=null){bi(t)||(t=hi({},t)),null==n||ki(n)||(n=null);const r=tc(),o=new WeakSet,i=[];let a=!1;const s=r.app={_uid:nc++,_component:t,_props:n,_container:null,_context:r,_instance:null,version:md,get config(){return r.config},set config(e){},use:(e,...t)=>(o.has(e)||(e&&bi(e.install)?(o.add(e),e.install(s,...t)):bi(e)&&(o.add(e),e(s,...t))),s),mixin:e=>(__VUE_OPTIONS_API__&&(r.mixins.includes(e)||r.mixins.push(e)),s),component:(e,t)=>t?(r.components[e]=t,s):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,s):r.directives[e],mount(o,i,l){if(!a){const i=s._ceVNode||Wc(t,n);return i.appContext=r,!0===l?l="svg":!1===l&&(l=void 0),e(i,o,l),a=!0,s._container=o,o.__vue_app__=s,__VUE_PROD_DEVTOOLS__&&(s._instance=i.component,function(e){Zs("app:init",e,md,{Fragment:Dc,Text:Nc,Comment:Hc,Static:qc})}(s)),ud(i.component)}},onUnmount(e){i.push(e)},unmount(){a&&(Es(i,s._instance,16),e(null,s._container),__VUE_PROD_DEVTOOLS__&&(s._instance=null,function(e){Zs("app:unmount",e)}(s)),delete s._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,s),runWithContext(e){const t=oc;oc=s;try{return e()}finally{oc=t}}};return s}}let oc=null;function ic(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||ai;let o=n;const i=t.startsWith("update:"),a=i&&((e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${Li(t)}Modifiers`]||e[`${Ii(t)}Modifiers`])(r,t.slice(7));let s;a&&(a.trim&&(o=n.map(e=>wi(e)?e.trim():e)),a.number&&(o=n.map(Ni))),__VUE_PROD_DEVTOOLS__&&function(e,t,n){Zs("component:emit",e.appContext.app,e,t,n)}(e,t,o);let l=r[s=Pi(t)]||r[s=Pi(Li(t))];!l&&i&&(l=r[s=Pi(Ii(t))]),l&&Es(l,e,6,o);const c=r[s+"Once"];if(c){if(e.emitted){if(e.emitted[s])return}else e.emitted={};e.emitted[s]=!0,Es(c,e,6,o)}}const ac=new WeakMap;function sc(e,t,n=!1){const r=__VUE_OPTIONS_API__&&n?ac:t.emitsCache,o=r.get(e);if(void 0!==o)return o;const i=e.emits;let a={},s=!1;if(__VUE_OPTIONS_API__&&!bi(e)){const r=e=>{const n=sc(e,t,!0);n&&(s=!0,hi(a,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return i||s?(gi(i)?i.forEach(e=>a[e]=null):hi(a,i),ki(e)&&r.set(e,a),a):(ki(e)&&r.set(e,null),null)}function lc(e,t){return!(!e||!di(t))&&(t=t.slice(2).replace(/Once$/,""),fi(e,t[0].toLowerCase()+t.slice(1))||fi(e,Ii(t))||fi(e,t))}function cc(e){const{type:t,vnode:n,proxy:r,withProxy:o,propsOptions:[i],slots:a,attrs:s,emit:l,render:c,renderCache:d,props:u,data:h,setupState:p,ctx:m,inheritAttrs:f}=e,g=nl(e);let v,y;try{if(4&n.shapeFlag){const e=o||r,t=e;v=Zc(c.call(t,e,d,u,p,h,m)),y=s}else{const e=t;v=Zc(e.length>1?e(u,{attrs:s,slots:a,emit:l}):e(u,null)),y=t.props?s:dc(s)}}catch(w){Ls(w,e,1),v=Wc(Hc)}let b=v;if(y&&!1!==f){const e=Object.keys(y),{shapeFlag:t}=b;e.length&&7&t&&(i&&e.some(ui)&&(y=uc(y,i)),b=Uc(b,y,!1,!0))}return n.dirs&&(b=Uc(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&pl(b,n.transition),v=b,nl(g),v}const dc=e=>{let t;for(const n in e)("class"===n||"style"===n||di(n))&&((t||(t={}))[n]=e[n]);return t},uc=(e,t)=>{const n={};for(const r in e)ui(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function hc(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let o=0;o<r.length;o++){const i=r[o];if(pc(t,e,i)&&!lc(n,i))return!0}return!1}function pc(e,t,n){const r=e[n],o=t[n];return"style"===n&&ki(r)&&ki(o)?!Xi(r,o):r!==o}const mc={},fc=()=>Object.create(mc),gc=e=>Object.getPrototypeOf(e)===mc;function vc(e,t,n,r){const[o,i]=e.propsOptions;let a,s=!1;if(t)for(let l in t){if(Mi(l))continue;const c=t[l];let d;o&&fi(o,d=Li(l))?i&&i.includes(d)?(a||(a={}))[d]=c:n[d]=c:lc(e.emitsOptions,l)||l in r&&c===r[l]||(r[l]=c,s=!0)}if(i){const t=hs(n),r=a||ai;for(let a=0;a<i.length;a++){const s=i[a];n[s]=yc(o,t,s,r[s],e,!fi(r,s))}}return s}function yc(e,t,n,r,o,i){const a=e[n];if(null!=a){const e=fi(a,"default");if(e&&void 0===r){const e=a.default;if(a.type!==Function&&!a.skipFactory&&bi(e)){const{propsDefaults:i}=o;if(n in i)r=i[n];else{const a=od(o);r=i[n]=e.call(null,t),a()}}else r=e;o.ce&&o.ce._setProp(n,r)}a[0]&&(i&&!e?r=!1:!a[1]||""!==r&&r!==Ii(n)||(r=!0))}return r}const bc=new WeakMap;function wc(e,t,n=!1){const r=__VUE_OPTIONS_API__&&n?bc:t.propsCache,o=r.get(e);if(o)return o;const i=e.props,a={},s=[];let l=!1;if(__VUE_OPTIONS_API__&&!bi(e)){const r=e=>{l=!0;const[n,r]=wc(e,t,!0);hi(a,n),r&&s.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!i&&!l)return ki(e)&&r.set(e,si),si;if(gi(i))for(let d=0;d<i.length;d++){const e=Li(i[d]);xc(e)&&(a[e]=ai)}else if(i)for(const d in i){const e=Li(d);if(xc(e)){const t=i[d],n=a[e]=gi(t)||bi(t)?{type:t}:hi({},t),r=n.type;let o=!1,l=!0;if(gi(r))for(let e=0;e<r.length;++e){const t=r[e],n=bi(t)&&t.name;if("Boolean"===n){o=!0;break}"String"===n&&(l=!1)}else o=bi(r)&&"Boolean"===r.name;n[0]=o,n[1]=l,(o||fi(n,"default"))&&s.push(e)}}const c=[a,s];return ki(e)&&r.set(e,c),c}function xc(e){return"$"!==e[0]&&!Mi(e)}const kc=e=>"_"===e||"_ctx"===e||"$stable"===e,Cc=e=>gi(e)?e.map(Zc):[Zc(e)],_c=(e,t,n)=>{if(t._n)return t;const r=function(e,t=el){if(!t)return e;if(e._n)return e;const n=(...r)=>{n._d;const o=nl(t);let i;try{i=e(...r)}finally{nl(o),n._d}return __VUE_PROD_DEVTOOLS__&&Ys(t),i};return n._n=!0,n._c=!0,n._d=!0,n}((...e)=>Cc(t(...e)),n);return r._c=!1,r},Sc=(e,t,n)=>{const r=e._ctx;for(const o in e){if(kc(o))continue;const n=e[o];if(bi(n))t[o]=_c(0,n,r);else if(null!=n){const e=Cc(n);t[o]=()=>e}}},Ac=(e,t)=>{const n=Cc(t);e.slots.default=()=>n},Mc=(e,t,n)=>{for(const r in t)!n&&kc(r)||(e[r]=t[r])},Tc=function(e,t){t&&t.pendingBranch?gi(e)?t.effects.push(...e):t.effects.push(e):function(e){gi(e)?Rs.push(...e):Ps&&-1===e.id?Ps.splice(Bs+1,0,e):1&e.flags||(Rs.push(e),e.flags|=1),qs()}(e)};function Ec(e){return function(e){"boolean"!=typeof __VUE_OPTIONS_API__&&(qi().__VUE_OPTIONS_API__=!0),"boolean"!=typeof __VUE_PROD_DEVTOOLS__&&(qi().__VUE_PROD_DEVTOOLS__=!1),"boolean"!=typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&(qi().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__=!1);const t=qi();t.__VUE__=!0,__VUE_PROD_DEVTOOLS__&&Xs(t.__VUE_DEVTOOLS_GLOBAL_HOOK__,t);const{insert:n,remove:r,patchProp:o,createElement:i,createText:a,createComment:s,setText:l,setElementText:c,parentNode:d,nextSibling:u,setScopeId:h=li,insertStaticContent:p}=e,m=(e,t,n,r=null,o=null,i=null,a=void 0,s=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!Vc(e,t)&&(r=q(e),B(e,o,i,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:c,ref:d,shapeFlag:u}=t;switch(c){case Nc:f(e,t,n,r);break;case Hc:g(e,t,n,r);break;case qc:null==e&&v(t,n,r,a);break;case Dc:S(e,t,n,r,o,i,a,s,l);break;default:1&u?y(e,t,n,r,o,i,a,s,l):6&u?A(e,t,n,r,o,i,a,s,l):(64&u||128&u)&&c.process(e,t,n,r,o,i,a,s,l,F)}null!=d&&o?yl(d,e&&e.ref,i,t||e,!t):null==d&&e&&null!=e.ref&&yl(e.ref,null,i,e,!0)},f=(e,t,r,o)=>{if(null==e)n(t.el=a(t.children),r,o);else{const n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},g=(e,t,r,o)=>{null==e?n(t.el=s(t.children||""),r,o):t.el=e.el},v=(e,t,n,r)=>{[e.el,e.anchor]=p(e.children,t,n,r,e.el,e.anchor)},y=(e,t,n,r,o,i,a,s,l)=>{if("svg"===t.type?a="svg":"math"===t.type&&(a="mathml"),null==e)b(t,n,r,o,i,a,s,l);else{const n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),k(e,t,o,i,a,s,l)}finally{n&&n._endPatch()}}},b=(e,t,r,a,s,l,d,u)=>{let h,p;const{props:m,shapeFlag:f,transition:g,dirs:v}=e;if(h=e.el=i(e.type,l,m&&m.is,m),8&f?c(h,e.children):16&f&&x(e.children,h,null,a,s,Lc(e,l),d,u),v&&rl(e,null,a,"created"),w(h,e,e.scopeId,d,a),m){for(const e in m)"value"===e||Mi(e)||o(h,e,null,m[e],l,a);"value"in m&&o(h,"value",null,m.value,l),(p=m.onVnodeBeforeMount)&&Yc(p,a,e)}__VUE_PROD_DEVTOOLS__&&(Di(h,"__vnode",e,!0),Di(h,"__vueParentComponent",a,!0)),v&&rl(e,null,a,"beforeMount");const y=function(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}(s,g);y&&g.beforeEnter(h),n(h,t,r),((p=m&&m.onVnodeMounted)||y||v)&&Tc(()=>{p&&Yc(p,a,e),y&&g.enter(h),v&&rl(e,null,a,"mounted")},s)},w=(e,t,n,r,o)=>{if(n&&h(e,n),r)for(let i=0;i<r.length;i++)h(e,r[i]);if(o){let n=o.subTree;if(t===n||zc(n.type)&&(n.ssContent===t||n.ssFallback===t)){const t=o.vnode;w(e,t,t.scopeId,t.slotScopeIds,o.parent)}}},x=(e,t,n,r,o,i,a,s,l=0)=>{for(let c=l;c<e.length;c++){const l=e[c]=s?Xc(e[c]):Zc(e[c]);m(null,l,t,n,r,o,i,a,s)}},k=(e,t,n,r,i,a,s)=>{const l=t.el=e.el;__VUE_PROD_DEVTOOLS__&&(l.__vnode=t);let{patchFlag:d,dynamicChildren:u,dirs:h}=t;d|=16&e.patchFlag;const p=e.props||ai,m=t.props||ai;let f;if(n&&Oc(n,!1),(f=m.onVnodeBeforeUpdate)&&Yc(f,n,t,e),h&&rl(t,e,n,"beforeUpdate"),n&&Oc(n,!0),(p.innerHTML&&null==m.innerHTML||p.textContent&&null==m.textContent)&&c(l,""),u?C(e.dynamicChildren,u,l,n,r,Lc(t,i),a):s||O(e,t,l,null,n,r,Lc(t,i),a,!1),d>0){if(16&d)_(l,p,m,n,i);else if(2&d&&p.class!==m.class&&o(l,"class",null,m.class,i),4&d&&o(l,"style",p.style,m.style,i),8&d){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const r=e[t],a=p[r],s=m[r];s===a&&"value"!==r||o(l,r,a,s,i,n)}}1&d&&e.children!==t.children&&c(l,t.children)}else s||null!=u||_(l,p,m,n,i);((f=m.onVnodeUpdated)||h)&&Tc(()=>{f&&Yc(f,n,t,e),h&&rl(t,e,n,"updated")},r)},C=(e,t,n,r,o,i,a)=>{for(let s=0;s<t.length;s++){const l=e[s],c=t[s],u=l.el&&(l.type===Dc||!Vc(l,c)||198&l.shapeFlag)?d(l.el):n;m(l,c,u,null,r,o,i,a,!0)}},_=(e,t,n,r,i)=>{if(t!==n){if(t!==ai)for(const a in t)Mi(a)||a in n||o(e,a,t[a],null,i,r);for(const a in n){if(Mi(a))continue;const s=n[a],l=t[a];s!==l&&"value"!==a&&o(e,a,l,s,i,r)}"value"in n&&o(e,"value",t.value,n.value,i)}},S=(e,t,r,o,i,s,l,c,d)=>{const u=t.el=e?e.el:a(""),h=t.anchor=e?e.anchor:a("");let{patchFlag:p,dynamicChildren:m,slotScopeIds:f}=t;f&&(c=c?c.concat(f):f),null==e?(n(u,r,o),n(h,r,o),x(t.children||[],r,h,i,s,l,c,d)):p>0&&64&p&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(C(e.dynamicChildren,m,r,i,s,l,c),(null!=t.key||i&&t===i.subTree)&&Ic(e,t,!0)):O(e,t,r,h,i,s,l,c,d)},A=(e,t,n,r,o,i,a,s,l)=>{t.slotScopeIds=s,null==e?512&t.shapeFlag?o.ctx.activate(t,n,r,a,l):M(t,n,r,o,i,a,l):T(e,t,l)},M=(e,t,n,r,o,i,a)=>{const s=e.component=function(e,t,n){const r=e.type,o=(t?t.appContext:e.appContext)||Jc,i={uid:Qc++,vnode:e,type:r,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ji(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:wc(r,o),emitsOptions:sc(r,o),emit:null,emitted:null,propsDefaults:ai,inheritAttrs:r.inheritAttrs,ctx:ai,data:ai,props:ai,attrs:ai,slots:ai,refs:ai,setupState:ai,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=ic.bind(null,i),e.ce&&e.ce(i),i}(e,r,o);if(xl(e)&&(s.ctx.renderer=F),function(e,t=!1,n=!1){t&&rd(t);const{props:r,children:o}=e.vnode,i=ad(e);(function(e,t,n,r=!1){const o={},i=fc();e.propsDefaults=Object.create(null),vc(e,t,o,i);for(const a in e.propsOptions[0])a in o||(o[a]=void 0);n?e.props=r?o:is(o):e.type.props?e.props=o:e.props=i,e.attrs=i})(e,r,i,t),((e,t,n)=>{const r=e.slots=fc();if(32&e.vnode.shapeFlag){const e=t._;e?(Mc(r,t,n),n&&Di(r,"_",e,!0)):Sc(t,r)}else t&&Ac(e,t)})(e,o,n||t),i&&function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Vl);const{setup:r}=n;if(r){fa();const n=e.setupContext=r.length>1?function(e){return{attrs:new Proxy(e.attrs,dd),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}(e):null,o=od(e),i=Ts(r,e,0,[e.props,n]),a=Ci(i);if(ga(),o(),!a&&!e.sp||wl(e)||fl(e),a){if(i.then(id,id),t)return i.then(t=>{ld(e,t)}).catch(t=>{Ls(t,e,0)});e.asyncDep=i}else ld(e,i)}else cd(e)}(e,t),t&&rd(!1)}(s,!1,a),s.asyncDep){if(o&&o.registerDep(s,E,a),!e.el){const r=s.subTree=Wc(Hc);g(null,r,t,n),e.placeholder=r.el}}else E(s,e,t,n,o,i,a)},T=(e,t,n)=>{const r=t.component=e.component;if(function(e,t,n){const{props:r,children:o,component:i}=e,{props:a,children:s,patchFlag:l}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!o&&!s||s&&s.$stable)||r!==a&&(r?!a||hc(r,a,c):!!a);if(1024&l)return!0;if(16&l)return r?hc(r,a,c):!!a;if(8&l){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const n=e[t];if(pc(a,r,n)&&!lc(c,n))return!0}}return!1}(e,t,n)){if(r.asyncDep&&!r.asyncResolved)return void L(r,t,n);r.next=t,r.update()}else t.el=e.el,r.vnode=t},E=(e,t,n,r,o,i,a)=>{e.scope.on();const s=e.effect=new ea(()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{const n=Rc(e);if(n)return t&&(t.el=c.el,L(e,t,a)),void n.asyncDep.then(()=>{Tc(()=>{e.isUnmounted||l()},o)})}let u,h=t;Oc(e,!1),t?(t.el=c.el,L(e,t,a)):t=c,n&&zi(n),(u=t.props&&t.props.onVnodeBeforeUpdate)&&Yc(u,s,t,c),Oc(e,!0);const p=cc(e),f=e.subTree;e.subTree=p,m(f,p,d(f.el),q(f),e,o,i),t.el=p.el,null===h&&function({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r!==e)break;(e=t.vnode).el=n,t=t.parent}}(e,p.el),r&&Tc(r,o),(u=t.props&&t.props.onVnodeUpdated)&&Tc(()=>Yc(u,s,t,c),o),__VUE_PROD_DEVTOOLS__&&Ys(e)}else{let a;const{el:s,props:l}=t,{bm:c,m:d,parent:u,root:h,type:p}=e,f=wl(t);Oc(e,!1),c&&zi(c),!f&&(a=l&&l.onVnodeBeforeMount)&&Yc(a,u,t),Oc(e,!0);{h.ce&&h.ce._hasShadowRoot()&&h.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);const a=e.subTree=cc(e);m(null,a,n,r,e,o,i),t.el=a.el}if(d&&Tc(d,o),!f&&(a=l&&l.onVnodeMounted)){const e=t;Tc(()=>Yc(a,u,e),o)}(256&t.shapeFlag||u&&wl(u.vnode)&&256&u.vnode.shapeFlag)&&e.a&&Tc(e.a,o),e.isMounted=!0,__VUE_PROD_DEVTOOLS__&&Ks(e),t=n=r=null}});e.scope.off();const l=e.update=s.run.bind(s),c=e.job=s.runIfDirty.bind(s);c.i=e,c.id=e.uid,s.scheduler=()=>Hs(c),Oc(e,!0),l()},L=(e,t,n)=>{t.component=e;const r=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,r){const{props:o,attrs:i,vnode:{patchFlag:a}}=e,s=hs(o),[l]=e.propsOptions;let c=!1;if(!(r||a>0)||16&a){let r;vc(e,t,o,i)&&(c=!0);for(const i in s)t&&(fi(t,i)||(r=Ii(i))!==i&&fi(t,r))||(l?!n||void 0===n[i]&&void 0===n[r]||(o[i]=yc(l,s,i,void 0,e,!0)):delete o[i]);if(i!==s)for(const e in i)t&&fi(t,e)||(delete i[e],c=!0)}else if(8&a){const n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let a=n[r];if(lc(e.emitsOptions,a))continue;const d=t[a];if(l)if(fi(i,a))d!==i[a]&&(i[a]=d,c=!0);else{const t=Li(a);o[t]=yc(l,s,t,d,e,!1)}else d!==i[a]&&(i[a]=d,c=!0)}}c&&Ma(e.attrs,"set","")}(e,t.props,r,n),((e,t,n)=>{const{vnode:r,slots:o}=e;let i=!0,a=ai;if(32&r.shapeFlag){const e=t._;e?n&&1===e?i=!1:Mc(o,t,n):(i=!t.$stable,Sc(t,o)),a=t}else t&&(Ac(e,t),a={default:1});if(i)for(const s in o)kc(s)||null!=a[s]||delete o[s]})(e,t.children,n),fa(),js(e),ga()},O=(e,t,n,r,o,i,a,s,l=!1)=>{const d=e&&e.children,u=e?e.shapeFlag:0,h=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(128&p)return void R(d,h,n,r,o,i,a,s,l);if(256&p)return void I(d,h,n,r,o,i,a,s,l)}8&m?(16&u&&H(d,o,i),h!==d&&c(n,h)):16&u?16&m?R(d,h,n,r,o,i,a,s,l):H(d,o,i,!0):(8&u&&c(n,""),16&m&&x(h,n,r,o,i,a,s,l))},I=(e,t,n,r,o,i,a,s,l)=>{t=t||si;const c=(e=e||si).length,d=t.length,u=Math.min(c,d);let h;for(h=0;h<u;h++){const r=t[h]=l?Xc(t[h]):Zc(t[h]);m(e[h],r,n,null,o,i,a,s,l)}c>d?H(e,o,i,!0,!1,u):x(t,n,r,o,i,a,s,l,u)},R=(e,t,n,r,o,i,a,s,l)=>{let c=0;const d=t.length;let u=e.length-1,h=d-1;for(;c<=u&&c<=h;){const r=e[c],d=t[c]=l?Xc(t[c]):Zc(t[c]);if(!Vc(r,d))break;m(r,d,n,null,o,i,a,s,l),c++}for(;c<=u&&c<=h;){const r=e[u],c=t[h]=l?Xc(t[h]):Zc(t[h]);if(!Vc(r,c))break;m(r,c,n,null,o,i,a,s,l),u--,h--}if(c>u){if(c<=h){const e=h+1,u=e<d?t[e].el:r;for(;c<=h;)m(null,t[c]=l?Xc(t[c]):Zc(t[c]),n,u,o,i,a,s,l),c++}}else if(c>h)for(;c<=u;)B(e[c],o,i,!0),c++;else{const p=c,f=c,g=new Map;for(c=f;c<=h;c++){const e=t[c]=l?Xc(t[c]):Zc(t[c]);null!=e.key&&g.set(e.key,c)}let v,y=0;const b=h-f+1;let w=!1,x=0;const k=new Array(b);for(c=0;c<b;c++)k[c]=0;for(c=p;c<=u;c++){const r=e[c];if(y>=b){B(r,o,i,!0);continue}let d;if(null!=r.key)d=g.get(r.key);else for(v=f;v<=h;v++)if(0===k[v-f]&&Vc(r,t[v])){d=v;break}void 0===d?B(r,o,i,!0):(k[d-f]=c+1,d>=x?x=d:w=!0,m(r,t[d],n,null,o,i,a,s,l),y++)}const C=w?function(e){const t=e.slice(),n=[0];let r,o,i,a,s;const l=e.length;for(r=0;r<l;r++){const l=e[r];if(0!==l){if(o=n[n.length-1],e[o]<l){t[r]=o,n.push(r);continue}for(i=0,a=n.length-1;i<a;)s=i+a>>1,e[n[s]]<l?i=s+1:a=s;l<e[n[i]]&&(i>0&&(t[r]=n[i-1]),n[i]=r)}}for(i=n.length,a=n[i-1];i-- >0;)n[i]=a,a=t[a];return n}(k):si;for(v=C.length-1,c=b-1;c>=0;c--){const e=f+c,u=t[e],h=t[e+1],p=e+1<d?h.el||Bc(h):r;0===k[c]?m(null,u,n,p,o,i,a,s,l):w&&(v<0||c!==C[v]?P(u,n,p,2):v--)}}},P=(e,t,o,i,a=null)=>{const{el:s,type:l,transition:c,children:d,shapeFlag:h}=e;if(6&h)P(e.component.subTree,t,o,i);else if(128&h)e.suspense.move(t,o,i);else if(64&h)l.move(e,t,o,F);else if(l!==Dc)if(l!==qc)if(2!==i&&1&h&&c)if(0===i)c.beforeEnter(s),n(s,t,o),Tc(()=>c.enter(s),a);else{const{leave:i,delayLeave:a,afterLeave:l}=c,d=()=>{e.ctx.isUnmounted?r(s):n(s,t,o)},u=()=>{s._isLeaving&&s[hl](!0),i(s,()=>{d(),l&&l()})};a?a(s,d,u):u()}else n(s,t,o);else(({el:e,anchor:t},r,o)=>{let i;for(;e&&e!==t;)i=u(e),n(e,r,o),e=i;n(t,r,o)})(e,t,o);else{n(s,t,o);for(let e=0;e<d.length;e++)P(d[e],t,o,i);n(e.anchor,t,o)}},B=(e,t,n,r=!1,o=!1)=>{const{type:i,props:a,ref:s,children:l,dynamicChildren:c,shapeFlag:d,patchFlag:u,dirs:h,cacheIndex:p}=e;if(-2===u&&(o=!1),null!=s&&(fa(),yl(s,null,n,e,!0),ga()),null!=p&&(t.renderCache[p]=void 0),256&d)return void t.ctx.deactivate(e);const m=1&d&&h,f=!wl(e);let g;if(f&&(g=a&&a.onVnodeBeforeUnmount)&&Yc(g,t,e),6&d)N(e.component,n,r);else{if(128&d)return void e.suspense.unmount(n,r);m&&rl(e,null,t,"beforeUnmount"),64&d?e.type.remove(e,t,n,F,r):c&&!c.hasOnce&&(i!==Dc||u>0&&64&u)?H(c,t,n,!1,!0):(i===Dc&&384&u||!o&&16&d)&&H(l,t,n),r&&z(e)}(f&&(g=a&&a.onVnodeUnmounted)||m)&&Tc(()=>{g&&Yc(g,t,e),m&&rl(e,null,t,"unmounted")},n)},z=e=>{const{type:t,el:n,anchor:o,transition:i}=e;if(t===Dc)return void D(n,o);if(t===qc)return void(({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=u(e),r(e),e=n;r(t)})(e);const a=()=>{r(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(1&e.shapeFlag&&i&&!i.persisted){const{leave:t,delayLeave:r}=i,o=()=>t(n,a);r?r(e.el,a,o):o()}else a()},D=(e,t)=>{let n;for(;e!==t;)n=u(e),r(e),e=n;r(t)},N=(e,t,n)=>{const{bum:r,scope:o,job:i,subTree:a,um:s,m:l,a:c}=e;Pc(l),Pc(c),r&&zi(r),o.stop(),i&&(i.flags|=8,B(a,e,t,n)),s&&Tc(s,t),Tc(()=>{e.isUnmounted=!0},t),__VUE_PROD_DEVTOOLS__&&(e=>{Ws&&"function"==typeof Ws.cleanupBuffer&&!Ws.cleanupBuffer(e)&&Js(e)})(e)},H=(e,t,n,r=!1,o=!1,i=0)=>{for(let a=i;a<e.length;a++)B(e[a],t,n,r,o)},q=e=>{if(6&e.shapeFlag)return q(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=u(e.anchor||e.el),n=t&&t[ul];return n?u(n):t};let j=!1;const V=(e,t,n)=>{let r;null==e?t._vnode&&(B(t._vnode,null,null,!0),r=t._vnode.component):m(t._vnode||null,e,t,null,null,null,n),t._vnode=e,j||(j=!0,js(r),Vs(),j=!1)},F={p:m,um:B,m:P,r:z,mt:M,mc:x,pc:O,pbc:C,n:q,o:e};return{render:V,hydrate:void 0,createApp:rc(V)}}(e)}function Lc({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Oc({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Ic(e,t,n=!1){const r=e.children,o=t.children;if(gi(r)&&gi(o))for(let i=0;i<r.length;i++){const e=r[i];let t=o[i];1&t.shapeFlag&&!t.dynamicChildren&&((t.patchFlag<=0||32===t.patchFlag)&&(t=o[i]=Xc(o[i]),t.el=e.el),n||-2===t.patchFlag||Ic(e,t)),t.type===Nc&&(-1===t.patchFlag&&(t=o[i]=Xc(t)),t.el=e.el),t.type!==Hc||t.el||(t.el=e.el)}}function Rc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Rc(t)}function Pc(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Bc(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Bc(t.subTree):null}const zc=e=>e.__isSuspense,Dc=Symbol.for("v-fgt"),Nc=Symbol.for("v-txt"),Hc=Symbol.for("v-cmt"),qc=Symbol.for("v-stc");function jc(e){return!!e&&!0===e.__v_isVNode}function Vc(e,t){return e.type===t.type&&e.key===t.key}const Fc=({key:e})=>null!=e?e:null,$c=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?wi(e)||fs(e)||bi(e)?{i:el,r:e,k:t,f:!!n}:e:null),Wc=function(e,t=null,n=null,r=0,o=null,i=!1){if(e&&e!==Nl||(e=Hc),jc(e)){const r=Uc(e,t,!0);return n&&Kc(r,n),r.patchFlag=-2,r}if(function(e){return bi(e)&&"__vccOpts"in e}(e)&&(e=e.__vccOpts),t){t=function(e){return e?us(e)||gc(e)?hi({},e):e:null}(t);let{class:e,style:n}=t;e&&!wi(e)&&(t.class=Ui(e)),ki(n)&&(us(n)&&!gi(n)&&(n=hi({},n)),t.style=ji(n))}return function(e,t=null,n=null,r=0,o=null,i=(e===Dc?0:1),a=!1,s=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Fc(t),ref:t&&$c(t),scopeId:tl,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:el};return s?(Kc(l,n),128&i&&e.normalize(l)):n&&(l.shapeFlag|=wi(n)?8:16),l}(e,t,n,r,o,wi(e)?1:zc(e)?128:(e=>e.__isTeleport)(e)?64:ki(e)?4:bi(e)?2:0,i,!0)};function Uc(e,t,n=!1,r=!1){const{props:o,ref:i,patchFlag:a,children:s,transition:l}=e,c=t?function(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const e in r)if("class"===e)t.class!==r.class&&(t.class=Ui([t.class,r.class]));else if("style"===e)t.style=ji([t.style,r.style]);else if(di(e)){const n=t[e],o=r[e];!o||n===o||gi(n)&&n.includes(o)||(t[e]=n?[].concat(n,o):o)}else""!==e&&(t[e]=r[e])}return t}(o||{},t):o,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Fc(c),ref:t&&t.ref?n&&i?gi(i)?i.concat($c(t)):[i,$c(t)]:$c(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Dc?-1===a?16:16|a:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Uc(e.ssContent),ssFallback:e.ssFallback&&Uc(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&pl(d,l.clone(d)),d}function Gc(e=" ",t=0){return Wc(Nc,null,e,t)}function Zc(e){return null==e||"boolean"==typeof e?Wc(Hc):gi(e)?Wc(Dc,null,e.slice()):jc(e)?Xc(e):Wc(Nc,null,String(e))}function Xc(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Uc(e)}function Kc(e,t){let n=0;const{shapeFlag:r}=e;if(null==t)t=null;else if(gi(t))n=16;else if("object"==typeof t){if(65&r){const n=t.default;return void(n&&(n._c&&(n._d=!1),Kc(e,n()),n._c&&(n._d=!0)))}{n=32;const r=t._;r||gc(t)?3===r&&el&&(1===el.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=el}}else bi(t)?(t={default:t,_ctx:el},n=32):(t=String(t),64&r?(n=16,t=[Gc(t)]):n=8);e.children=t,e.shapeFlag|=n}function Yc(e,t,n,r=null){Es(e,t,7,[n,r])}const Jc=tc();let Qc=0,ed=null;const td=()=>ed||el;let nd,rd;{const e=qi(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};nd=t("__VUE_INSTANCE_SETTERS__",e=>ed=e),rd=t("__VUE_SSR_SETTERS__",e=>sd=e)}const od=e=>{const t=ed;return nd(e),e.scope.on(),()=>{e.scope.off(),nd(t)}},id=()=>{ed&&ed.scope.off(),nd(null)};function ad(e){return 4&e.vnode.shapeFlag}let sd=!1;function ld(e,t,n){bi(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ki(t)&&(__VUE_PROD_DEVTOOLS__&&(e.devtoolsRawSetupState=t),e.setupState=xs(t)),cd(e)}function cd(e,t,n){const r=e.type;if(e.render||(e.render=r.render||li),__VUE_OPTIONS_API__){const t=od(e);fa();try{!function(e){const t=Gl(e),n=e.proxy,r=e.ctx;$l=!1,t.beforeCreate&&Wl(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:a,watch:s,provide:l,inject:c,created:d,beforeMount:u,mounted:h,beforeUpdate:p,updated:m,activated:f,deactivated:g,beforeDestroy:v,beforeUnmount:y,destroyed:b,unmounted:w,render:x,renderTracked:k,renderTriggered:C,errorCaptured:_,serverPrefetch:S,expose:A,inheritAttrs:M,components:T,directives:E,filters:L}=t;if(c&&function(e,t){gi(e)&&(e=Yl(e));for(const n in e){const r=e[n];let o;o=ki(r)?"default"in r?ol(r.from||n,r.default,!0):ol(r.from||n):ol(r),fs(o)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>o.value,set:e=>o.value=e}):t[n]=o}}(c,r),a)for(const I in a){const e=a[I];bi(e)&&(r[I]=e.bind(n))}if(o){const t=o.call(n,n);ki(t)&&(e.data=os(t))}if($l=!0,i)for(const I in i){const e=i[I],t=bi(e)?e.bind(n,n):bi(e.get)?e.get.bind(n,n):li,o=!bi(e)&&bi(e.set)?e.set.bind(n):li,a=hd({get:t,set:o});Object.defineProperty(r,I,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(s)for(const I in s)Ul(s[I],r,n,I);if(l){const e=bi(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{!function(e,t){if(ed){let n=ed.provides;const r=ed.parent&&ed.parent.provides;r===n&&(n=ed.provides=Object.create(r)),n[e]=t}}(t,e[t])})}function O(e,t){gi(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(d&&Wl(d,e,"c"),O(Tl,u),O(El,h),O(Ll,p),O(Ol,m),O(kl,f),O(Cl,g),O(Dl,_),O(zl,k),O(Bl,C),O(Il,y),O(Rl,w),O(Pl,S),gi(A))if(A.length){const t=e.exposed||(e.exposed={});A.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||(e.exposed={});x&&e.render===li&&(e.render=x),null!=M&&(e.inheritAttrs=M),T&&(e.components=T),E&&(e.directives=E),S&&fl(e)}(e)}finally{ga(),t()}}}const dd={get:(e,t)=>(Aa(e,0,""),e[t])};function ud(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(xs(function(e){return!fi(e,"__v_skip")&&Object.isExtensible(e)&&Di(e,"__v_skip",!0),e}(e.exposed)),{get:(t,n)=>n in t?t[n]:n in ql?ql[n](e):void 0,has:(e,t)=>t in e||t in ql})):e.proxy}const hd=(e,t)=>Cs(e,0,sd);function pd(e,t,n){try{const r=arguments.length;return 2===r?ki(t)&&!gi(t)?jc(t)?Wc(e,null,[t]):Wc(e,t):Wc(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):3===r&&jc(n)&&(n=[n]),Wc(e,t,n))}finally{}}const md="3.5.30";let fd;const gd="undefined"!=typeof window&&window.trustedTypes;if(gd)try{fd=gd.createPolicy("vue",{createHTML:e=>e})}catch(_T){}const vd=fd?e=>fd.createHTML(e):e=>e,yd="undefined"!=typeof document?document:null,bd=yd&&yd.createElement("template"),wd={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o="svg"===t?yd.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?yd.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?yd.createElement(e,{is:n}):yd.createElement(e);return"select"===e&&r&&null!=r.multiple&&o.setAttribute("multiple",r.multiple),o},createText:e=>yd.createTextNode(e),createComment:e=>yd.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>yd.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,i){const a=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),o!==i&&(o=o.nextSibling););else{bd.innerHTML=vd("svg"===r?`<svg>${e}</svg>`:"mathml"===r?`<math>${e}</math>`:e);const o=bd.content;if("svg"===r||"mathml"===r){const e=o.firstChild;for(;e.firstChild;)o.appendChild(e.firstChild);o.removeChild(e)}t.insertBefore(o,n)}return[a?a.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},xd=Symbol("_vtc"),kd=Symbol("_vod"),Cd=Symbol("_vsh"),_d=Symbol(""),Sd=/(?:^|;)\s*display\s*:/,Ad=/\s*!important$/;function Md(e,t,n){if(gi(n))n.forEach(n=>Md(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=function(e,t){const n=Ed[t];if(n)return n;let r=Li(t);if("filter"!==r&&r in e)return Ed[t]=r;r=Ri(r);for(let o=0;o<Td.length;o++){const n=Td[o]+r;if(n in e)return Ed[t]=n}return t}(e,t);Ad.test(n)?e.setProperty(Ii(r),n.replace(Ad,""),"important"):e[r]=n}}const Td=["Webkit","Moz","ms"],Ed={},Ld="http://www.w3.org/1999/xlink";function Od(e,t,n,r,o,i=Gi(t)){r&&t.startsWith("xlink:")?null==n?e.removeAttributeNS(Ld,t.slice(6,t.length)):e.setAttributeNS(Ld,t,n):null==n||i&&!Zi(n)?e.removeAttribute(t):e.setAttribute(t,i?"":xi(n)?String(n):n)}function Id(e,t,n,r,o){if("innerHTML"===t||"textContent"===t)return void(null!=n&&(e[t]="innerHTML"===t?vd(n):n));const i=e.tagName;if("value"===t&&"PROGRESS"!==i&&!i.includes("-")){const r="OPTION"===i?e.getAttribute("value")||"":e.value,o=null==n?"checkbox"===e.type?"on":"":String(n);return r===o&&"_value"in e||(e.value=o),null==n&&e.removeAttribute(t),void(e._value=n)}let a=!1;if(""===n||null==n){const r=typeof e[t];"boolean"===r?n=Zi(n):null==n&&"string"===r?(n="",a=!0):"number"===r&&(n=0,a=!0)}try{e[t]=n}catch(_T){}a&&e.removeAttribute(o||t)}const Rd=Symbol("_vei"),Pd=/(?:Once|Passive|Capture)$/;let Bd=0;const zd=Promise.resolve(),Dd=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Nd=hi({patchProp:(e,t,n,r,o,i)=>{const a="svg"===o;"class"===t?function(e,t,n){const r=e[xd];r&&(t=(t?[t,...r]:[...r]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,r,a):"style"===t?function(e,t,n){const r=e.style,o=wi(n);let i=!1;if(n&&!o){if(t)if(wi(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&Md(r,t,"")}else for(const e in t)null==n[e]&&Md(r,e,"");for(const e in n)"display"===e&&(i=!0),Md(r,e,n[e])}else if(o){if(t!==n){const e=r[_d];e&&(n+=";"+e),r.cssText=n,i=Sd.test(n)}}else t&&e.removeAttribute("style");kd in e&&(e[kd]=i?r.display:"",e[Cd]&&(r.display="none"))}(e,n,r):di(t)?ui(t)||function(e,t,n,r,o=null){const i=e[Rd]||(e[Rd]={}),a=i[t];if(r&&a)a.value=r;else{const[n,s]=function(e){let t;if(Pd.test(e)){let n;for(t={};n=e.match(Pd);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):Ii(e.slice(2)),t]}(t);if(r){const a=i[t]=function(e,t){const n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();Es(function(e,t){if(gi(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=Bd||(zd.then(()=>Bd=0),Bd=Date.now()),n}(r,o);!function(e,t,n,r){e.addEventListener(t,n,r)}(e,n,a,s)}else a&&(function(e,t,n,r){e.removeEventListener(t,n,r)}(e,n,a,s),i[t]=void 0)}}(e,t,0,r,i):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,r){if(r)return"innerHTML"===t||"textContent"===t||!!(t in e&&Dd(t)&&bi(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"autocorrect"===t)return!1;if("sandbox"===t&&"IFRAME"===e.tagName)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return(!Dd(t)||!wi(n))&&t in e}(e,t,r,a))?(Id(e,t,r),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||Od(e,t,r,a,0,"value"!==t)):e._isVueCE&&(function(e,t){const n=e._def.props;if(!n)return!1;const r=Li(t);return Array.isArray(n)?n.some(e=>Li(e)===r):Object.keys(n).some(e=>Li(e)===r)}(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!wi(r)))?Id(e,Li(t),r,0,t):("true-value"===t?e._trueValue=r:"false-value"===t&&(e._falseValue=r),Od(e,t,r,a))}},wd);let Hd;const qd=(...e)=>{const t=(Hd||(Hd=Ec(Nd))).createApp(...e),{mount:n}=t;return t.mount=e=>{const r=function(e){return wi(e)?document.querySelector(e):e}(e);if(!r)return;const o=t._component;bi(o)||o.render||o.template||(o.template=r.innerHTML),1===r.nodeType&&(r.textContent="");const i=n(r,!1,function(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),i},t};function jd({icon:e,class:t,onClick:n}){return pd("span",{class:Ln("milkdown-icon",t),onPointerdown:n,innerHTML:e?Sn.sanitize(e.trim()):void 0})}function Vd(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-block",...t}}),e}jd.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};var Fd=a({filterNodes:e=>!A(e=>"table"===e.type.name)(e)},"blockConfig");Vd(Fd,{displayName:"Ctx<blockConfig>"});var $d=E.ie&&E.ie_version<15||E.ios&&E.webkit_version<604,Wd=class{constructor(){this.#m=()=>{if(!this.#f)return null;const e=this.#f,t=this.#g;if(t&&M.isSelectable(e.node)){const n=M.create(t.state.doc,e.$pos.pos);return t.dispatch(t.state.tr.setSelection(n)),t.focus(),this.#v=n,n}return null},this.#v=null,this.#f=null,this.#y=void 0,this.#b=!1,this.#w=()=>{this.#x?.({type:"hide"}),this.#f=null},this.#k=e=>{this.#f=e,this.#x?.({type:"show",active:e})},this.bind=(e,t)=>{this.#C=e,this.#x=t},this.addEvent=e=>{e.addEventListener("mousedown",this.#_),e.addEventListener("mouseup",this.#S),e.addEventListener("dragstart",this.#A),e.addEventListener("dragend",this.#M)},this.removeEvent=e=>{e.removeEventListener("mousedown",this.#_),e.removeEventListener("mouseup",this.#S),e.removeEventListener("dragstart",this.#A),e.removeEventListener("dragend",this.#M)},this.unBind=()=>{this.#x=void 0},this.#_=()=>{this.#y=this.#f?.el.getBoundingClientRect(),this.#m()},this.#S=()=>{this.#b?(this.#b=!1,this.#v=null):requestAnimationFrame(()=>{this.#y&&this.#g?.focus()})},this.#A=e=>{this.#b=!0;const t=this.#g;if(!t)return;t.dom.dataset.dragging="true";const n=this.#v;if(e.dataTransfer&&n){const r=n.content();e.dataTransfer.effectAllowed="copyMove";const{dom:o,text:i}=t.serializeForClipboard(r);e.dataTransfer.clearData(),e.dataTransfer.setData($d?"Text":"text/html",o.innerHTML),$d||e.dataTransfer.setData("text/plain",i);const a=this.#f?.el;a&&e.dataTransfer.setDragImage(a,0,0),t.dragging={slice:r,move:!0}}},this.#M=()=>{this.#g&&this.#T(this.#g)},this.keydownCallback=e=>(this.#w(),this.#b=!1,e.dom.dataset.dragging="false",!1),this.#E=gr((e,t)=>{if(!e.editable)return;const n=e.dom.getBoundingClientRect(),r=n.left+n.width/2;if(!(e.root.elementFromPoint(r,t.clientY)instanceof Element))return void this.#w();const o=this.#L;if(!o)return;const i=function(e,t,n){if(!e.dom.parentElement)return null;try{const r=e.posAtCoords({left:t.x,top:t.y})?.inside;if(null==r||r<0)return null;let o=e.state.doc.resolve(r),i=e.state.doc.nodeAt(r),a=e.nodeDOM(r);const s=t=>{const r=o.depth>=1&&0===o.index(o.depth);if(!t&&!r)return;const l=o.before(o.depth);i=e.state.doc.nodeAt(l),a=e.nodeDOM(l),o=e.state.doc.resolve(l),n(o,i)||s(!0)};return s(!n(o,i)),a&&i?{node:i,$pos:o,el:a}:null}catch{return null}}(e,{x:r,y:t.clientY},o);i?this.#k(i):this.#w()},200),this.mousemoveCallback=(e,t)=>(e.composing||!e.editable||this.#E(e,t),!1),this.dragoverCallback=(e,t)=>{if(this.#b){const n=this.#g?.dom.parentElement;if(!n)return!1;const r=n.scrollHeight>n.clientHeight,o=n.getBoundingClientRect();if(r){if(n.scrollTop>0&&Math.abs(t.y-o.y)<20)return n.scrollTop=n.scrollTop>10?n.scrollTop-10:0,!1;const r=Math.round(e.dom.getBoundingClientRect().height);if(Math.round(n.scrollTop+o.height)<r&&Math.abs(t.y-(o.height+o.y))<20)return n.scrollTop=n.scrollTop+10,!1}}return!1},this.dragenterCallback=e=>{e.dragging&&(this.#b=!0,e.dom.dataset.dragging="true")},this.dragleaveCallback=(e,t)=>{const n=t.clientX,r=t.clientY;(n<0||r<0||n>window.innerWidth||r>window.innerHeight)&&(this.#f=null,this.#T(e))},this.dropCallback=e=>(this.#T(e),!1),this.dragendCallback=e=>{this.#T(e)},this.#T=e=>{this.#b=!1,e.dom.dataset.dragging="false"}}#C;#m;#v;#f;#y;#b;get#L(){try{return this.#C?.get(Fd.key).filterNodes}catch{return}}get#g(){return this.#C?.get(T)}#x;#w;#k;#_;#S;#A;#M;#E;#T},Ud=a(()=>new Wd,"blockService"),Gd=a({},"blockServiceInstance");Vd(Ud,{displayName:"Ctx<blockService>"}),Vd(Gd,{displayName:"Ctx<blockServiceInstance>"});var Zd=a({},"blockSpec");Vd(Zd,{displayName:"Ctx<blockSpec>"});var Xd=s(e=>{const t=new d("MILKDOWN_BLOCK"),n=e.get(Ud.key)();e.set(Gd.key,n);const r=e.get(Zd.key);return new c({key:t,...r,props:{...r.props,handleDOMEvents:{drop:e=>n.dropCallback(e),pointermove:(e,t)=>n.mousemoveCallback(e,t),keydown:e=>n.keydownCallback(e),dragover:(e,t)=>n.dragoverCallback(e,t),dragleave:(e,t)=>n.dragleaveCallback(e,t),dragenter:e=>n.dragenterCallback(e),dragend:e=>n.dragendCallback(e)}}})});Vd(Xd,{displayName:"Prose<block>"});var Kd=class{#O;#C;#I;#R;#o;#i;#n;#r;#P;#B;#z;get active(){return this.#R}constructor(e){this.#R=null,this.#i=!1,this.update=()=>{requestAnimationFrame(()=>{if(!this.#i)try{this.#D(),this.#i=!0}catch{}})},this.destroy=()=>{this.#I?.unBind(),this.#I?.removeEvent(this.#O),this.#O.remove()},this.show=e=>{const t=e.el,n=this.#C.get(T).dom,r={ctx:this.#C,active:e,editorDom:n,blockDom:this.#O},o={contextElement:t,getBoundingClientRect:()=>this.#B?this.#B(r):t.getBoundingClientRect()},i=[w()];if(this.#P){const e=x(this.#P(r));i.push(e)}b(o,this.#O,{placement:this.#z?this.#z(r):"left",middleware:[...i,...this.#n],...this.#r}).then(({x:e,y:t})=>{Object.assign(this.#O.style,{left:`${e}px`,top:`${t}px`}),this.#O.dataset.show="true"}).catch(console.error)},this.hide=()=>{this.#O.dataset.show="false"},this.#C=e.ctx,this.#O=e.content,this.#P=e.getOffset,this.#B=e.getPosition,this.#z=e.getPlacement,this.#n=e.middleware??[],this.#r=e.floatingUIOptions??{},this.#o=e.root,this.hide()}#D(){const e=this.#C.get(T);(this.#o??e.dom.parentElement??document.body).appendChild(this.#O);const t=this.#C.get(Gd.key);t.bind(this.#C,e=>{"hide"===e.type?(this.hide(),this.#R=null):"show"===e.type&&(this.show(e.active),this.#R=e.active)}),this.#I=t,this.#I.addEvent(this.#O),this.#O.draggable=!0}},Yd=[Zd,Fd,Ud,Gd,Xd];Yd.key=Zd.key,Yd.pluginKey=Xd.key;var Jd=class{#i;#n;#r;#o;#e;#N;#t;#c;#s;constructor(e){this.#i=!1,this.onShow=()=>{},this.onHide=()=>{},this.#h=(e,t)=>{const{state:n,composing:r}=e,{selection:o,doc:i}=n,{ranges:a}=o,s=Math.min(...a.map(e=>e.$from.pos)),l=Math.max(...a.map(e=>e.$to.pos)),c=t&&t.doc.eq(i)&&t.selection.eq(o);this.#i||((this.#o??e.dom.parentElement??document.body).appendChild(this.element),this.#i=!0),r||c||(this.#t(e,t)?(b({getBoundingClientRect:()=>_(e,s,l)},this.element,{placement:"bottom-start",middleware:[w(),x(this.#s),...this.#n],...this.#r}).then(({x:e,y:t})=>{Object.assign(this.element.style,{left:`${e}px`,top:`${t}px`})}).catch(console.error),this.show()):this.hide())},this.#p=e=>{const t=this.getContent(e);if(!t)return!1;const n=t.at(-1);return!!n&&(Array.isArray(this.#N)?this.#N.includes(n):this.#N===n)},this.update=(e,t)=>{this.#c(e,t)},this.getContent=(e,t=e=>"paragraph"===e.type.name)=>{const{selection:n}=e.state,{empty:r,$from:o}=n,i=e.state.selection instanceof S;if("undefined"==typeof document)return;const a=this.element.contains(document.activeElement),s=!e.hasFocus()&&!a,l=!e.editable,c=!L(t)(e.state.selection);return s||l||!r||!i||c?void 0:o.parent.textBetween(Math.max(0,o.parentOffset-500),o.parentOffset,void 0,"")},this.destroy=()=>{this.#c.cancel()},this.show=()=>{this.element.dataset.show="true",this.onShow()},this.hide=()=>{this.element.dataset.show="false",this.onHide()},this.element=e.content,this.#e=e.debounce??200,this.#t=e.shouldShow??this.#p,this.#N=e.trigger??"/",this.#s=e.offset,this.#n=e.middleware??[],this.#r=e.floatingUIOptions??{},this.#o=e.root,this.#c=hr(this.#h,this.#e)}#h;#p};let Qd=e=>crypto.getRandomValues(new Uint8Array(e)),eu=(e,t=21)=>((e,t,n)=>{let r=256-256%e.length;if(256===r){let r=e.length-1;return(o=t)=>{if(!o)return"";let i="";for(;;){let t=n(o),a=o;for(;a--;)if(i+=e[t[a]&r],i.length>=o)return i}}}let o=Math.ceil(409.6*t/r);return(i=t)=>{if(!i)return"";let a="";for(;;){let t=n(o),s=o;for(;s--;)if(t[s]<r&&(a+=e[t[s]%e.length],a.length>=i))return a}}})(e,0|t,Qd);var tu=Object.defineProperty,nu=Object.getOwnPropertySymbols,ru=Object.prototype.hasOwnProperty,ou=Object.prototype.propertyIsEnumerable,iu=(e,t,n)=>t in e?tu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,au=(e,t)=>{for(var n in t||(t={}))ru.call(t,n)&&iu(e,n,t[n]);if(nu)for(var n of nu(t))ou.call(t,n)&&iu(e,n,t[n]);return e};function su(e,t){return Object.assign(e,{meta:au({package:"@milkdown/components"},t)}),e}const lu=a({imageIcon:"🌌",captionIcon:"💬",uploadButton:"Upload file",confirmButton:"Confirm ⏎",uploadPlaceholderText:"or paste the image link ...",captionPlaceholderText:"Image caption",onUpload:e=>Promise.resolve(URL.createObjectURL(e))},"imageBlockConfigCtx");function cu(e){return Et(e,"paragraph",(e,t,n)=>{var r,o;if(1!==(null==(r=e.children)?void 0:r.length))return;const i=null==(o=e.children)?void 0:o[0];if(!i||"image"!==i.type)return;const{url:a,alt:s,title:l}=i,c={type:"image-block",url:a,alt:s,title:l};n.children.splice(t,1,c)})}su(lu,{displayName:"Config<image-block>",group:"ImageBlock"});const du=O("remark-image-block",()=>()=>cu);su(du.plugin,{displayName:"Remark<remarkImageBlock>",group:"ImageBlock"}),su(du.options,{displayName:"RemarkConfig<remarkImageBlock>",group:"ImageBlock"});var uu=Object.defineProperty,hu=Object.getOwnPropertySymbols,pu=Object.prototype.hasOwnProperty,mu=Object.prototype.propertyIsEnumerable,fu=(e,t,n)=>t in e?uu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gu=(e,t)=>{for(var n in t||(t={}))pu.call(t,n)&&fu(e,n,t[n]);if(hu)for(var n of hu(t))mu.call(t,n)&&fu(e,n,t[n]);return e};const vu="image-block",yu=I("image-block",()=>({inline:!1,group:"block",selectable:!0,draggable:!0,isolating:!0,marks:"",atom:!0,priority:100,attrs:{src:{default:"",validate:"string"},caption:{default:"",validate:"string"},ratio:{default:1,validate:"number"}},parseDOM:[{tag:`img[data-type="${vu}"]`,getAttrs:e=>{var t;if(!(e instanceof HTMLElement))throw P(e);return{src:e.getAttribute("src")||"",caption:e.getAttribute("caption")||"",ratio:Number(null!=(t=e.getAttribute("ratio"))?t:1)}}}],toDOM:e=>["img",gu({"data-type":vu},e.attrs)],parseMarkdown:{match:({type:e})=>"image-block"===e,runner:(e,t,n)=>{const r=t.url,o=t.title;let i=Number(t.alt||1);(Number.isNaN(i)||0===i)&&(i=1),e.addNode(n,{src:r,caption:o,ratio:i})}},toMarkdown:{match:e=>"image-block"===e.type.name,runner:(e,t)=>{e.openNode("paragraph"),e.addNode("image",void 0,void 0,{title:t.attrs.caption,url:t.attrs.src,alt:`${Number.parseFloat(t.attrs.ratio).toFixed(2)}`}),e.closeNode()}}}));function bu({icon:e,class:t,onClick:n}){return pd("span",{class:Ln("milkdown-icon",t),onPointerdown:n,innerHTML:e?Sn.sanitize(e.trim()):void 0})}su(yu.node,{displayName:"NodeSchema<image-block>",group:"ImageBlock"}),bu.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const wu=eu("abcdefg",8),xu=ml({props:{src:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setLink:{type:Function,required:!0},imageIcon:{type:String,required:!1},uploadButton:{type:String,required:!1},confirmButton:{type:String,required:!1},uploadPlaceholderText:{type:String,required:!1},onUpload:{type:Function,required:!0},onImageLoadError:{type:Function,required:!1}},setup({readonly:e,src:t,setLink:n,onUpload:r,imageIcon:o,uploadButton:i,confirmButton:a,uploadPlaceholderText:s,className:l,onImageLoadError:c}){var d,u;const h=gs(!1),p=gs(),m=gs(null!=(d=t.value)?d:""),f=gs(wu()),g=gs(0!==(null==(u=t.value)?void 0:u.length)),v=e=>{const t=e.target.value;g.value=0!==t.length,m.value=t},y=e=>{var t,r;"Enter"===e.key&&n(null!=(r=null==(t=p.value)?void 0:t.value)?r:"")},b=e=>{var t;const o=null==(t=e.target.files)?void 0:t[0];o&&r(o).then(e=>{e&&(n(e),g.value=!0)}).catch(e=>{console.error("An error occurred while uploading image"),console.error(e)})};return()=>pd("div",{class:Ln("image-edit",l)},pd(bu,{icon:o,class:"image-icon"}),pd("div",{class:Ln("link-importer",h.value&&"focus")},pd("input",{ref:p,draggable:"true",onDragstart:e=>{e.preventDefault(),e.stopPropagation()},disabled:e.value,class:"link-input-area",value:m.value,onInput:v,onKeydown:y,onFocus:()=>h.value=!0,onBlur:()=>h.value=!1}),!g.value&&pd("div",{class:"placeholder"},pd("input",{disabled:e.value,class:"hidden",id:f.value,type:"file",accept:"image/*",onChange:b}),pd("label",{class:"uploader",for:f.value},pd(bu,{icon:i})),pd("span",{class:"text",onClick:()=>{var e;return null==(e=p.value)?void 0:e.focus()}},s))),m.value&&pd(Dc,null,pd("div",{class:"image-preview"},pd("img",{src:m.value,alt:"",onError:e=>Promise.resolve(null==c?void 0:c(e)).catch(()=>{})})),pd("div",{class:"confirm",onClick:()=>(()=>{var e,t;n(null!=(t=null==(e=p.value)?void 0:e.value)?t:"")})()},pd(bu,{icon:a}))))}}),ku=ml({props:{src:{type:Object,required:!0},caption:{type:Object,required:!0},ratio:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup({src:e,caption:t,ratio:n,readonly:r,setAttr:o,config:i}){var a;const s=gs(),l=gs(),c=gs(Boolean(null==(a=t.value)?void 0:a.length)),d=gs(0),u=()=>{var e;const t=s.value;if(!t)return;const r=t.closest(".milkdown-image-block");if(!r)return;let o=r.getBoundingClientRect().width;if(!o)return;i.maxWidth&&i.maxWidth<o&&(o=i.maxWidth);const a=t.naturalHeight,l=t.naturalWidth;let c=l<o?a:o*(a/l);i.maxHeight&&c>i.maxHeight&&(c=i.maxHeight);const d=(c*(null!=(e=n.value)?e:1)).toFixed(2);t.dataset.origin=c.toFixed(2),t.dataset.height=d,t.style.height=`${d}px`,i.maxWidth&&(t.style.maxWidth=`${i.maxWidth}px`)},h=e=>{e.preventDefault(),e.stopPropagation(),r.value||(c.value=!c.value)},p=e=>{const t=e.target.value;d.value&&window.clearTimeout(d.value),d.value=window.setTimeout(()=>{o("caption",t)},1e3)},m=e=>{const t=e.target.value;d.value&&(window.clearTimeout(d.value),d.value=0),o("caption",t)},f=e=>{e.preventDefault();const t=s.value;if(!t)return;const n=t.getBoundingClientRect().top;let r=e.clientY-n;r<100&&(r=100),i.maxHeight&&r>i.maxHeight&&(r=i.maxHeight);const o=Number(r).toFixed(2);t.dataset.height=o,t.style.height=`${o}px`},g=()=>{window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",g);const e=s.value;if(!e)return;const t=Number(e.dataset.origin),n=Number(e.dataset.height),r=Number.parseFloat(Number(n/t).toFixed(2));Number.isNaN(r)||o("ratio",r)},v=e=>{r.value||(e.preventDefault(),e.stopPropagation(),window.addEventListener("pointermove",f),window.addEventListener("pointerup",g))};return()=>pd(Dc,null,pd("div",{class:"image-wrapper"},pd("div",{class:"operation"},pd("div",{class:"operation-item",onPointerdown:h},pd(bu,{icon:i.captionIcon}))),pd("img",{ref:s,"data-type":vu,onLoad:u,src:e.value,alt:t.value,onError:e=>{var t;return Promise.resolve(null==(t=i.onImageLoadError)?void 0:t.call(i,e)).catch(()=>{})}}),pd("div",{ref:l,class:"image-resize-handle",onPointerdown:v})),c.value&&pd("input",{draggable:"true",onDragstart:e=>{e.preventDefault(),e.stopPropagation()},class:"caption-input",placeholder:null==i?void 0:i.captionPlaceholderText,onInput:p,onBlur:m,value:t.value}))}});var Cu=Object.defineProperty,_u=Object.getOwnPropertySymbols,Su=Object.prototype.hasOwnProperty,Au=Object.prototype.propertyIsEnumerable,Mu=(e,t,n)=>t in e?Cu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const Tu=ml({props:{src:{type:Object,required:!0},caption:{type:Object,required:!0},ratio:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup(e){const{src:t}=e;return()=>{var n;return(null==(n=t.value)?void 0:n.length)?pd(ku,((e,t)=>{for(var n in t||(t={}))Su.call(t,n)&&Mu(e,n,t[n]);if(_u)for(var n of _u(t))Au.call(t,n)&&Mu(e,n,t[n]);return e})({},e)):pd(xu,{src:e.src,selected:e.selected,readonly:e.readonly,setLink:t=>e.setAttr("src",t),imageIcon:e.config.imageIcon,uploadButton:e.config.uploadButton,confirmButton:e.config.confirmButton,uploadPlaceholderText:e.config.uploadPlaceholderText,onUpload:e.config.onUpload,onImageLoadError:e.config.onImageLoadError})}}}),Eu=R(yu.node,e=>(t,n,r)=>{const o=gs(t.attrs.src),i=gs(t.attrs.caption),a=gs(t.attrs.ratio),s=gs(!1),l=gs(!n.editable),c=e.get(lu.key),d=qd(Tu,{src:o,caption:i,ratio:a,selected:s,readonly:l,setAttr:(e,t)=>{if(!n.editable)return;const o=r();null!=o&&n.dispatch(n.state.tr.setNodeAttribute(o,e,"src"===e?Sn.sanitize(t):t))},config:c}),u=document.createElement("div");u.className="milkdown-image-block";const h=al(()=>{s.value?u.classList.add("selected"):u.classList.remove("selected")}),p=c.proxyDomURL,m=e=>{if(p){const t=p(e.attrs.src);"string"==typeof t?o.value=t:t.then(e=>{o.value=e}).catch(console.error)}else o.value=e.attrs.src;a.value=e.attrs.ratio,i.value=e.attrs.caption,l.value=!n.editable};return m(t),d.mount(u),{dom:u,update:e=>e.type===t.type&&(m(e),!0),stopEvent:e=>e.target instanceof HTMLInputElement,selectNode:()=>{s.value=!0},deselectNode:()=>{s.value=!1},destroy:()=>{h(),d.unmount(),u.remove()}}});su(Eu,{displayName:"NodeView<image-block>",group:"ImageBlock"});const Lu=[du,yu,Eu,lu].flat();let Ou,Iu;if("undefined"!=typeof WeakMap){let e=new WeakMap;Ou=t=>e.get(t),Iu=(t,n)=>(e.set(t,n),n)}else{const e=[],t=10;let n=0;Ou=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},Iu=(r,o)=>(n==t&&(n=0),e[n++]=r,e[n++]=o)}var Ru=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const r=t%this.width,o=t/this.width|0;let i=r+1,a=o+1;for(let e=1;i<this.width&&this.map[t+e]==n;e++)i++;for(let e=1;a<this.height&&this.map[t+this.width*e]==n;e++)a++;return{left:r,top:o,right:i,bottom:a}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:r,right:o,top:i,bottom:a}=this.findCell(e);return"horiz"==t?(n<0?0==r:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?0==i:a==this.height)?null:this.map[r+this.width*(n<0?i-1:a)]}rectBetween(e,t){const{left:n,right:r,top:o,bottom:i}=this.findCell(e),{left:a,right:s,top:l,bottom:c}=this.findCell(t);return{left:Math.min(n,a),top:Math.min(o,l),right:Math.max(r,s),bottom:Math.max(i,c)}}cellsInRect(e){const t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let o=e.left;o<e.right;o++){const i=r*this.width+o,a=this.map[i];n[a]||(n[a]=!0,o==e.left&&o&&this.map[i-1]==a||r==e.top&&r&&this.map[i-this.width]==a||t.push(a))}return t}positionAt(e,t,n){for(let r=0,o=0;;r++){const i=o+n.child(r).nodeSize;if(r==e){let n=t+e*this.width;const r=(e+1)*this.width;for(;n<r&&this.map[n]<o;)n++;return n==r?i-1:this.map[n]}o=i}}static get(e){return Ou(e)||Iu(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);const t=function(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){const o=e.child(r);let i=0;if(n)for(let t=0;t<r;t++){const n=e.child(t);for(let e=0;e<n.childCount;e++){const o=n.child(e);t+o.attrs.rowspan>r&&(i+=o.attrs.colspan)}}for(let e=0;e<o.childCount;e++){const t=o.child(e);i+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[];let o=0,i=null;const a=[];for(let c=0,d=t*n;c<d;c++)r[c]=0;for(let c=0,d=0;c<n;c++){const s=e.child(c);d++;for(let e=0;;e++){for(;o<r.length&&0!=r[o];)o++;if(e==s.childCount)break;const l=s.child(e),{colspan:u,rowspan:h,colwidth:p}=l.attrs;for(let e=0;e<h;e++){if(e+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:d,n:h-e});break}const s=o+e*t;for(let e=0;e<u;e++){0==r[s+e]?r[s+e]=d:(i||(i=[])).push({type:"collision",row:c,pos:d,n:u-e});const n=p&&p[e];if(n){const r=(s+e)%t*2,o=a[r];null==o||o!=n&&1==a[r+1]?(a[r]=n,a[r+1]=1):o==n&&a[r+1]++}}}o+=u,d+=l.nodeSize}const l=(c+1)*t;let u=0;for(;o<l;)0==r[o++]&&u++;u&&(i||(i=[])).push({type:"missing",row:c,n:u}),d++}0!==t&&0!==n||(i||(i=[])).push({type:"zero_sized"});const s=new Ru(t,n,r,i);let l=!1;for(let c=0;!l&&c<a.length;c+=2)null!=a[c]&&a[c+1]<n&&(l=!0);return l&&function(e,t,n){e.problems||(e.problems=[]);const r={};for(let o=0;o<e.map.length;o++){const i=e.map[o];if(r[i])continue;r[i]=!0;const a=n.nodeAt(i);if(!a)throw new RangeError(`No cell with offset ${i} found`);let s=null;const l=a.attrs;for(let n=0;n<l.colspan;n++){const r=t[(o+n)%e.width*2];null==r||l.colwidth&&l.colwidth[n]==r||((s||(s=Pu(l)))[n]=r)}s&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:s})}}(s,a,e),s}(e))}};function Pu(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function Bu(e,t){if("string"==typeof e)return{};const n=e.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map(e=>Number(e)):null,o=Number(e.getAttribute("colspan")||1),i={colspan:o,rowspan:Number(e.getAttribute("rowspan")||1),colwidth:r&&r.length==o?r:null};for(const a in t){const n=t[a].getFromDOM,r=n&&n(e);null!=r&&(i[a]=r)}return i}function zu(e,t){const n={};1!=e.attrs.colspan&&(n.colspan=e.attrs.colspan),1!=e.attrs.rowspan&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n["data-colwidth"]=e.attrs.colwidth.join(","));for(const r in t){const o=t[r].setDOMAttr;o&&o(e.attrs[r],n)}return n}function Du(e){if(null!==e){if(!Array.isArray(e))throw new TypeError("colwidth must be null or an array");for(const t of e)if("number"!=typeof t)throw new TypeError("colwidth must be null or an array of numbers")}}function Nu(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}}return t}const Hu=new d("selectingCells");function qu(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function ju(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if("row"==t.node(n).type.spec.tableRole)return!0;return!1}function Vu(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&"cell"==t.node.type.spec.tableRole)return t.$anchor;const n=qu(t.$head)||function(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n-t.nodeSize)}}(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function Fu(e){return"row"==e.parent.type.spec.tableRole&&!!e.nodeAfter}function $u(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Wu(e,t,n){const r=e.node(-1),o=Ru.get(r),i=e.start(-1),a=o.nextCell(e.pos-i,t,n);return null==a?null:e.node(0).resolve(i+a)}function Uu(e,t,n=1){const r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function Gu(e,t,n=1){const r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}var Zu=class e extends z{constructor(e,t=e){const n=e.node(-1),r=Ru.get(n),o=e.start(-1),i=r.rectBetween(e.pos-o,t.pos-o),a=e.node(0),s=r.cellsInRect(i).filter(e=>e!=t.pos-o);s.unshift(t.pos-o);const l=s.map(e=>{const t=n.nodeAt(e);if(!t)throw new RangeError(`No cell with offset ${e} found`);const r=o+e+1;return new D(a.resolve(r),a.resolve(r+t.content.size))});super(l[0].$from,l[0].$to,l),this.$anchorCell=e,this.$headCell=t}map(t,n){const r=t.resolve(n.map(this.$anchorCell.pos)),o=t.resolve(n.map(this.$headCell.pos));if(Fu(r)&&Fu(o)&&$u(r,o)){const t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,o):t&&this.isColSelection()?e.colSelection(r,o):new e(r,o)}return S.between(r,o)}content(){const e=this.$anchorCell.node(-1),t=Ru.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[];for(let s=r.top;s<r.bottom;s++){const n=[];for(let i=s*t.width+r.left,a=r.left;a<r.right;a++,i++){const a=t.map[i];if(o[a])continue;o[a]=!0;const s=t.findCell(a);let l=e.nodeAt(a);if(!l)throw new RangeError(`No cell with offset ${a} found`);const c=r.left-s.left,d=s.right-r.right;if(c>0||d>0){let e=l.attrs;if(c>0&&(e=Uu(e,0,c)),d>0&&(e=Uu(e,e.colspan-d,d)),s.left<r.left){if(l=l.type.createAndFill(e),!l)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else l=l.type.create(e,l.content)}if(s.top<r.top||s.bottom>r.bottom){const e={...l.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};l=s.top<r.top?l.type.createAndFill(e):l.type.create(e,l.content)}n.push(l)}i.push(e.child(s).copy(m.from(n)))}const a=this.isColSelection()&&this.isRowSelection()?e:i;return new p(m.from(a),1,1)}replace(e,t=p.empty){const n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){const{$from:o,$to:a}=r[i],s=e.mapping.slice(n);e.replace(s.map(o.pos),s.map(a.pos),i?p.empty:t)}const o=z.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,t){this.replace(e,new p(m.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),n=Ru.get(t),r=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let i=0;i<o.length;i++)e(t.nodeAt(o[i]),r+o[i])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const r=t.node(-1),o=Ru.get(r),i=t.start(-1),a=o.findCell(t.pos-i),s=o.findCell(n.pos-i),l=t.node(0);return a.top<=s.top?(a.top>0&&(t=l.resolve(i+o.map[a.left])),s.bottom<o.height&&(n=l.resolve(i+o.map[o.width*(o.height-1)+s.right-1]))):(s.top>0&&(n=l.resolve(i+o.map[s.left])),a.bottom<o.height&&(t=l.resolve(i+o.map[o.width*(o.height-1)+a.right-1]))),new e(t,n)}isRowSelection(){const e=this.$anchorCell.node(-1),t=Ru.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),o=t.colCount(this.$headCell.pos-n);if(Math.min(r,o)>0)return!1;const i=r+this.$anchorCell.nodeAfter.attrs.colspan,a=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(i,a)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const r=t.node(-1),o=Ru.get(r),i=t.start(-1),a=o.findCell(t.pos-i),s=o.findCell(n.pos-i),l=t.node(0);return a.left<=s.left?(a.left>0&&(t=l.resolve(i+o.map[a.top*o.width])),s.right<o.width&&(n=l.resolve(i+o.map[o.width*(s.top+1)-1]))):(s.left>0&&(n=l.resolve(i+o.map[s.top*o.width])),a.right<o.width&&(t=l.resolve(i+o.map[o.width*(a.top+1)-1]))),new e(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new Xu(this.$anchorCell.pos,this.$headCell.pos)}};Zu.prototype.visible=!1,z.jsonID("cell",Zu);var Xu=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){const t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&$u(t,n)?new Zu(t,n):z.near(n,1)}};function Ku(e){if(!(e.selection instanceof Zu))return null;const t=[];return e.selection.forEachCell((e,n)=>{t.push(v.node(n,n+e.nodeSize,{class:"selectedCell"}))}),f.create(e.doc,t)}const Yu=new d("fix-tables");function Ju(e,t,n,r){const o=e.childCount,i=t.childCount;e:for(let a=0,s=0;a<i;a++){const i=t.child(a);for(let t=s,r=Math.min(o,a+3);t<r;t++)if(e.child(t)==i){s=t+1,n+=i.nodeSize;continue e}r(i,n),s<o&&e.child(s).sameMarkup(i)?Ju(e.child(s),i,n+1,r):i.nodesBetween(0,i.content.size,r,n+1),n+=i.nodeSize}}function Qu(e,t){let n;const r=(t,r)=>{"table"==t.type.spec.tableRole&&(n=function(e,t,n,r){const o=Ru.get(t);if(!o.problems)return r;r||(r=e.tr);const i=[];for(let l=0;l<o.height;l++)i.push(0);for(let l=0;l<o.problems.length;l++){const e=o.problems[l];if("collision"==e.type){const o=t.nodeAt(e.pos);if(!o)continue;const a=o.attrs;for(let t=0;t<a.rowspan;t++)i[e.row+t]+=e.n;r.setNodeMarkup(r.mapping.map(n+1+e.pos),null,Uu(a,a.colspan-e.n,e.n))}else if("missing"==e.type)i[e.row]+=e.n;else if("overlong_rowspan"==e.type){const o=t.nodeAt(e.pos);if(!o)continue;r.setNodeMarkup(r.mapping.map(n+1+e.pos),null,{...o.attrs,rowspan:o.attrs.rowspan-e.n})}else if("colwidth mismatch"==e.type){const o=t.nodeAt(e.pos);if(!o)continue;r.setNodeMarkup(r.mapping.map(n+1+e.pos),null,{...o.attrs,colwidth:e.colwidth})}else if("zero_sized"==e.type){const e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let a,s;for(let l=0;l<i.length;l++)i[l]&&(null==a&&(a=l),s=l);for(let l=0,c=n+1;l<o.height;l++){const n=t.child(l),o=c+n.nodeSize,d=i[l];if(d>0){let t="cell";n.firstChild&&(t=n.firstChild.type.spec.tableRole);const i=[];for(let n=0;n<d;n++){const n=Nu(e.schema)[t].createAndFill();n&&i.push(n)}const u=0!=l&&a!=l-1||s!=l?o-1:c+1;r.insert(r.mapping.map(u),i)}c=o}return r.setMeta(Yu,{fixTables:!0})}(e,t,r,n))};return t?t.doc!=e.doc&&Ju(t.doc,e.doc,0,r):e.doc.descendants(r),n}function eh(e){const t=Ru.get(e),n=[],r=t.height,o=t.width;for(let i=0;i<r;i++){const r=[];for(let n=0;n<o;n++){const a=i*o+n,s=t.map[a];if(i>0){const e=a-o;if(s===t.map[e]){r.push(null);continue}}if(n>0){const e=a-1;if(s===t.map[e]){r.push(null);continue}}r.push(e.nodeAt(s))}n.push(r)}return n}function th(e,t){const n=[],r=Ru.get(e),o=r.height,i=r.width;for(let a=0;a<o;a++){const o=e.child(a),s=[];for(let n=0;n<i;n++){const o=t[a][n];if(!o)continue;const i=r.map[a*r.width+n],l=e.nodeAt(i);if(!l)continue;const c=l.type.createChecked(o.attrs,o.content,o.marks);s.push(c)}const l=o.type.createChecked(o.attrs,s,o.marks);n.push(l)}return e.type.createChecked(e.attrs,n,e.marks)}function nh(e,t,n,r){const o=t[0]>n[0]?-1:1,i=e.splice(t[0],t.length),a=i.length%2==0?1:0;let s;return s=-1===o?n[0]:n[n.length-1]-a,e.splice(s,0,...i),e}function rh(e){return function(e,t){for(let n=t.depth;n>=0;n-=1){const r=t.node(n);if(e(r))return{node:r,pos:0===n?0:t.before(n),start:t.start(n),depth:n}}return null}(e=>"table"===e.type.spec.tableRole,e)}function oh(e,t){const n=rh(t.$from);if(!n)return;const r=Ru.get(n.node);return e<0||e>r.width-1?void 0:r.cellsInRect({left:e,right:e+1,top:0,bottom:r.height}).map(e=>{const t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t,depth:n.depth+2}})}function ih(e,t){const n=rh(t.$from);if(!n)return;const r=Ru.get(n.node);return e<0||e>r.height-1?void 0:r.cellsInRect({left:0,right:r.width,top:e,bottom:e+1}).map(e=>{const t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t,depth:n.depth+2}})}function ah(e,t,n=t){let r=t,o=n;for(let d=t;d>=0;d--){const t=oh(d,e.selection);t&&t.forEach(e=>{const t=e.node.attrs.colspan+d-1;t>=r&&(r=d),t>o&&(o=t)})}for(let d=t;d<=o;d++){const t=oh(d,e.selection);t&&t.forEach(e=>{const t=e.node.attrs.colspan+d-1;e.node.attrs.colspan>1&&t>o&&(o=t)})}const i=[];for(let d=r;d<=o;d++){const t=oh(d,e.selection);t&&t.length>0&&i.push(d)}r=i[0],o=i[i.length-1];const a=oh(r,e.selection),s=ih(0,e.selection);if(!a||!s)return;const l=e.doc.resolve(a[a.length-1].pos);let c;for(let d=o;d>=r;d--){const t=oh(d,e.selection);if(t&&t.length>0){for(let e=s.length-1;e>=0;e--)if(s[e].pos===t[0].pos){c=t[0];break}if(c)break}}return c?{$anchor:l,$head:e.doc.resolve(c.pos),indexes:i}:void 0}function sh(e,t,n=t){let r=t,o=n;for(let d=t;d>=0;d--){const t=ih(d,e.selection);t&&t.forEach(e=>{const t=e.node.attrs.rowspan+d-1;t>=r&&(r=d),t>o&&(o=t)})}for(let d=t;d<=o;d++){const t=ih(d,e.selection);t&&t.forEach(e=>{const t=e.node.attrs.rowspan+d-1;e.node.attrs.rowspan>1&&t>o&&(o=t)})}const i=[];for(let d=r;d<=o;d++){const t=ih(d,e.selection);t&&t.length>0&&i.push(d)}r=i[0],o=i[i.length-1];const a=ih(r,e.selection),s=oh(0,e.selection);if(!a||!s)return;const l=e.doc.resolve(a[a.length-1].pos);let c;for(let d=o;d>=r;d--){const t=ih(d,e.selection);if(t&&t.length>0){for(let e=s.length-1;e>=0;e--)if(s[e].pos===t[0].pos){c=t[0];break}if(c)break}}return c?{$anchor:l,$head:e.doc.resolve(c.pos),indexes:i}:void 0}function lh(e){return e[0].map((t,n)=>e.map(e=>e[n]))}function ch(e){const t=e.selection,n=Vu(e),r=n.node(-1),o=n.start(-1),i=Ru.get(r);return{...t instanceof Zu?i.rectBetween(t.$anchorCell.pos-o,t.$headCell.pos-o):i.findCell(n.pos-o),tableStart:o,map:i,table:r}}function dh(e,{map:t,tableStart:n,table:r},o){let i=o>0?-1:0;(function(e,t,n){const r=Nu(t.type.schema).header_cell;for(let o=0;o<e.height;o++)if(t.nodeAt(e.map[n+o*e.width]).type!=r)return!1;return!0})(t,r,o+i)&&(i=0==o||o==t.width?null:0);for(let a=0;a<t.height;a++){const s=a*t.width+o;if(o>0&&o<t.width&&t.map[s-1]==t.map[s]){const i=t.map[s],l=r.nodeAt(i);e.setNodeMarkup(e.mapping.map(n+i),null,Gu(l.attrs,o-t.colCount(i))),a+=l.attrs.rowspan-1}else{const l=null==i?Nu(r.type.schema).cell:r.nodeAt(t.map[s+i]).type,c=t.positionAt(a,o,r);e.insert(e.mapping.map(n+c),l.createAndFill())}}return e}function uh(e,t){if(!ju(e))return!1;if(t){const n=ch(e);t(dh(e.tr,n,n.left))}return!0}function hh(e,t){if(!ju(e))return!1;if(t){const n=ch(e);t(dh(e.tr,n,n.right))}return!0}function ph(e,{map:t,table:n,tableStart:r},o){const i=e.mapping.maps.length;for(let a=0;a<t.height;){const s=a*t.width+o,l=t.map[s],c=n.nodeAt(l),d=c.attrs;if(o>0&&t.map[s-1]==l||o<t.width-1&&t.map[s+1]==l)e.setNodeMarkup(e.mapping.slice(i).map(r+l),null,Uu(d,o-t.colCount(l)));else{const t=e.mapping.slice(i).map(r+l);e.delete(t,t+c.nodeSize)}a+=d.rowspan}}function mh(e,{map:t,table:n,tableStart:r},o){let i=0;for(let c=0;c<o;c++)i+=n.child(c).nodeSize;const a=i+n.child(o).nodeSize,s=e.mapping.maps.length;e.delete(i+r,a+r);const l=new Set;for(let c=0,d=o*t.width;c<t.width;c++,d++){const i=t.map[d];if(!l.has(i))if(l.add(i),o>0&&i==t.map[d-t.width]){const t=n.nodeAt(i).attrs;e.setNodeMarkup(e.mapping.slice(s).map(i+r),null,{...t,rowspan:t.rowspan-1}),c+=t.colspan-1}else if(o<t.height&&i==t.map[d+t.width]){const a=n.nodeAt(i),l=a.attrs,d=a.type.create({...l,rowspan:a.attrs.rowspan-1},a.content),u=t.positionAt(o+1,c,n);e.insert(e.mapping.slice(s).map(r+u),d),c+=l.colspan-1}}}function fh(e,t,n){const r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let o=0;o<r.length;o++){const e=t.table.nodeAt(r[o]);if(e&&e.type!==n.header_cell)return!1}return!0}function gh(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(e){return function(t,n){if(!ju(t))return!1;if(n){const r=Nu(t.schema),o=ch(t),i=t.tr,a=o.map.cellsInRect("column"==e?{left:o.left,top:0,right:o.right,bottom:o.map.height}:"row"==e?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),s=a.map(e=>o.table.nodeAt(e));for(let e=0;e<a.length;e++)s[e].type==r.header_cell&&i.setNodeMarkup(o.tableStart+a[e],r.cell,s[e].attrs);if(0===i.steps.length)for(let e=0;e<a.length;e++)i.setNodeMarkup(o.tableStart+a[e],r.header_cell,s[e].attrs);n(i)}return!0}}(e):function(t,n){if(!ju(t))return!1;if(n){const r=Nu(t.schema),o=ch(t),i=t.tr,a=fh("row",o,r),s=fh("column",o,r),l=("column"===e?a:"row"===e&&s)?1:0,c="column"==e?{left:0,top:l,right:1,bottom:o.map.height}:"row"==e?{left:l,top:0,right:o.map.width,bottom:1}:o,d="column"==e?s?r.cell:r.header_cell:"row"==e?a?r.cell:r.header_cell:r.cell;o.map.cellsInRect(c).forEach(e=>{const t=e+o.tableStart,n=i.doc.nodeAt(t);n&&i.setNodeMarkup(t,d,n.attrs)}),n(i)}return!0}}function vh(e){return function(t,n){if(!ju(t))return!1;const r=function(e,t){if(t<0){const t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let n=e.index(-1)-1,r=e.before();n>=0;n--){const t=e.node(-1).child(n),o=t.lastChild;if(o)return r-1-o.nodeSize;r-=t.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){const e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}(Vu(t),e);if(null==r)return!1;if(n){const e=t.doc.resolve(r);n(t.tr.setSelection(S.between(e,function(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}(e))).scrollIntoView())}return!0}}function yh(e,t){const n=e.selection;if(!(n instanceof Zu))return!1;if(t){const r=e.tr,o=Nu(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(o)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new p(o,0,0))}),r.docChanged&&t(r)}return!0}function bh(e,t){const n=e.createAndFill();return new N(n).replace(0,n.content.size,t).doc}function wh(e,t,n,r,o,i,a,s){if(0==a||a==t.height)return!1;let l=!1;for(let c=o;c<i;c++){const o=a*t.width+c,i=t.map[o];if(t.map[o-t.width]==i){l=!0;const o=n.nodeAt(i),{top:d,left:u}=t.findCell(i);e.setNodeMarkup(e.mapping.slice(s).map(i+r),null,{...o.attrs,rowspan:a-d}),e.insert(e.mapping.slice(s).map(t.positionAt(a,u,n)),o.type.createAndFill({...o.attrs,rowspan:d+o.attrs.rowspan-a})),c+=o.attrs.colspan-1}}return l}function xh(e,t,n,r,o,i,a,s){if(0==a||a==t.width)return!1;let l=!1;for(let c=o;c<i;c++){const o=c*t.width+a,i=t.map[o];if(t.map[o-1]==i){l=!0;const o=n.nodeAt(i),d=t.colCount(i),u=e.mapping.slice(s).map(i+r);e.setNodeMarkup(u,null,Uu(o.attrs,a-d,o.attrs.colspan-(a-d))),e.insert(u+o.nodeSize,o.type.createAndFill(Uu(o.attrs,0,a-d))),c+=o.attrs.rowspan-1}}return l}function kh(e,t,n,r,o){let i=n?e.doc.nodeAt(n-1):e.doc;if(!i)throw new Error("No table found");let a=Ru.get(i);const{top:s,left:l}=r,c=l+o.width,d=s+o.height,u=e.tr;let h=0;function f(){if(i=n?u.doc.nodeAt(n-1):u.doc,!i)throw new Error("No table found");a=Ru.get(i),h=u.mapping.maps.length}(function(e,t,n,r,o,i,a){const s=Nu(e.doc.type.schema);let l,c;if(o>t.width)for(let d=0,u=0;d<t.height;d++){const i=n.child(d);u+=i.nodeSize;const h=[];let p;p=null==i.lastChild||i.lastChild.type==s.cell?l||(l=s.cell.createAndFill()):c||(c=s.header_cell.createAndFill());for(let e=t.width;e<o;e++)h.push(p);e.insert(e.mapping.slice(a).map(u-1+r),h)}if(i>t.height){const d=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,o);e++){const o=!(e>=t.width)&&n.nodeAt(t.map[r+e]).type==s.header_cell;d.push(o?c||(c=s.header_cell.createAndFill()):l||(l=s.cell.createAndFill()))}const u=s.row.create(null,m.from(d)),h=[];for(let e=t.height;e<i;e++)h.push(u);e.insert(e.mapping.slice(a).map(r+n.nodeSize-2),h)}return!(!l&&!c)})(u,a,i,n,c,d,h)&&f(),wh(u,a,i,n,l,c,s,h)&&f(),wh(u,a,i,n,l,c,d,h)&&f(),xh(u,a,i,n,s,d,l,h)&&f(),xh(u,a,i,n,s,d,c,h)&&f();for(let m=s;m<d;m++){const e=a.positionAt(m,l,i),t=a.positionAt(m,c,i);u.replace(u.mapping.slice(h).map(e+n),u.mapping.slice(h).map(t+n),new p(o.rows[m-s],0,0))}f(),u.setSelection(new Zu(u.doc.resolve(n+a.positionAt(s,l,i)),u.doc.resolve(n+a.positionAt(d-1,c-1,i)))),t(u)}gh("row",{useDeprecatedLogic:!0}),gh("column",{useDeprecatedLogic:!0}),gh("cell",{useDeprecatedLogic:!0});const Ch=B({ArrowLeft:Sh("horiz",-1),ArrowRight:Sh("horiz",1),ArrowUp:Sh("vert",-1),ArrowDown:Sh("vert",1),"Shift-ArrowLeft":Ah("horiz",-1),"Shift-ArrowRight":Ah("horiz",1),"Shift-ArrowUp":Ah("vert",-1),"Shift-ArrowDown":Ah("vert",1),Backspace:yh,"Mod-Backspace":yh,Delete:yh,"Mod-Delete":yh});function _h(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function Sh(e,t){return(n,r,o)=>{if(!o)return!1;const i=n.selection;if(i instanceof Zu)return _h(n,r,z.near(i.$headCell,t));if("horiz"!=e&&!i.empty)return!1;const a=Lh(o,e,t);if(null==a)return!1;if("horiz"==e)return _h(n,r,z.near(n.doc.resolve(i.head+t),t));{const o=n.doc.resolve(a),i=Wu(o,e,t);let s;return s=i?z.near(i,1):t<0?z.near(n.doc.resolve(o.before(-1)),-1):z.near(n.doc.resolve(o.after(-1)),1),_h(n,r,s)}}}function Ah(e,t){return(n,r,o)=>{if(!o)return!1;const i=n.selection;let a;if(i instanceof Zu)a=i;else{const r=Lh(o,e,t);if(null==r)return!1;a=new Zu(n.doc.resolve(r))}const s=Wu(a.$headCell,e,t);return!!s&&_h(n,r,new Zu(a.$anchorCell,s))}}function Mh(e,t){const n=qu(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new Zu(n))),!0)}function Th(e,t,n){if(!ju(e.state))return!1;let r=function(e){if(0===e.size)return null;let{content:t,openStart:n,openEnd:r}=e;for(;1==t.childCount&&(n>0&&r>0||"table"==t.child(0).type.spec.tableRole);)n--,r--,t=t.child(0).content;const o=t.child(0),i=o.type.spec.tableRole,a=o.type.schema,s=[];if("row"==i)for(let l=0;l<t.childCount;l++){let e=t.child(l).content;const o=l?0:Math.max(0,n-1),i=l<t.childCount-1?0:Math.max(0,r-1);(o||i)&&(e=bh(Nu(a).row,new p(e,o,i)).content),s.push(e)}else{if("cell"!=i&&"header_cell"!=i)return null;s.push(n||r?bh(Nu(a).row,new p(t,n,r)).content:t)}return function(e,t){const n=[];for(let o=0;o<t.length;o++){const e=t[o];for(let t=e.childCount-1;t>=0;t--){const{rowspan:r,colspan:i}=e.child(t).attrs;for(let e=o;e<o+r;e++)n[e]=(n[e]||0)+i}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=t.length&&t.push(m.empty),n[o]<r){const i=Nu(e).cell.createAndFill(),a=[];for(let e=n[o];e<r;e++)a.push(i);t[o]=t[o].append(m.from(a))}return{height:t.length,width:r,rows:t}}(a,s)}(n);const o=e.state.selection;if(o instanceof Zu){r||(r={width:1,height:1,rows:[m.from(bh(Nu(e.state.schema).cell,n))]});const t=o.$anchorCell.node(-1),i=o.$anchorCell.start(-1),a=Ru.get(t).rectBetween(o.$anchorCell.pos-i,o.$headCell.pos-i);return r=function({width:e,height:t,rows:n},r,o){if(e!=r){const t=[],o=[];for(let e=0;e<n.length;e++){const i=n[e],a=[];for(let n=t[e]||0,o=0;n<r;o++){let s=i.child(o%i.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(Uu(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),a.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}o.push(m.from(a))}n=o,e=r}if(t!=o){const e=[];for(let r=0,i=0;r<o;r++,i++){const a=[],s=n[i%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>o&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,o-t.attrs.rowspan)},t.content)),a.push(t)}e.push(m.from(a))}n=e,t=o}return{width:e,height:t,rows:n}}(r,a.right-a.left,a.bottom-a.top),kh(e.state,e.dispatch,i,a,r),!0}if(r){const t=Vu(e.state),n=t.start(-1);return kh(e.state,e.dispatch,n,Ru.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function Eh(e,t){var n;if(0!=t.button)return;if(t.ctrlKey||t.metaKey)return;const r=Oh(e,t.target);let o;if(t.shiftKey&&e.state.selection instanceof Zu)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&null!=(o=qu(e.state.selection.$anchor))&&(null===(n=Ih(e,t))||void 0===n?void 0:n.pos)!=o.pos)i(o,t),t.preventDefault();else if(!r)return;function i(t,n){let r=Ih(e,n);const o=null==Hu.getState(e.state);if(!r||!$u(t,r)){if(!o)return;r=t}const i=new Zu(t,r);if(o||!e.state.selection.eq(i)){const n=e.state.tr.setSelection(i);o&&n.setMeta(Hu,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener("mouseup",a),e.root.removeEventListener("dragstart",a),e.root.removeEventListener("mousemove",s),null!=Hu.getState(e.state)&&e.dispatch(e.state.tr.setMeta(Hu,-1))}function s(n){const o=n,s=Hu.getState(e.state);let l;if(null!=s)l=e.state.doc.resolve(s);else if(Oh(e,o.target)!=r&&(l=Ih(e,t),!l))return a();l&&i(l,o)}e.root.addEventListener("mouseup",a),e.root.addEventListener("dragstart",a),e.root.addEventListener("mousemove",s)}function Lh(e,t,n){if(!(e.state.selection instanceof S))return null;const{$head:r}=e.state.selection;for(let o=r.depth-1;o>=0;o--){const i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){const i=r.before(o),a="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(a)?i:null}}return null}function Oh(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t;return null}function Ih(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:o}=n;return r>=0&&qu(e.state.doc.resolve(r))||qu(e.state.doc.resolve(o))}var Rh=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Ph(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type==this.node.type&&(this.node=e,Ph(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))}};function Ph(e,t,n,r,o,i){let a=0,s=!0,l=t.firstChild;const c=e.firstChild;if(c){for(let e=0,n=0;e<c.childCount;e++){const{colspan:d,colwidth:u}=c.child(e).attrs;for(let e=0;e<d;e++,n++){const c=o==n?i:u&&u[e],d=c?c+"px":"";if(a+=c||r,c||(s=!1),l)l.style.width!=d&&(l.style.width=d),l=l.nextSibling;else{const e=document.createElement("col");e.style.width=d,t.appendChild(e)}}}for(;l;){var d;const e=l.nextSibling;null===(d=l.parentNode)||void 0===d||d.removeChild(l),l=e}s?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}}const Bh=new d("tableColumnResizing");var zh=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){const n=this,r=t.getMeta(Bh);if(r&&null!=r.setHandle)return new e(r.setHandle,!1);if(r&&void 0!==r.setDragging)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return Fu(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function Dh(e,t,n,r){const o="right"==n?-r:r,i=e.posAtCoords({left:t.clientX+o,top:t.clientY});if(!i)return-1;const{pos:a}=i,s=qu(e.state.doc.resolve(a));if(!s)return-1;if("right"==n)return s.pos;const l=Ru.get(s.node(-1)),c=s.start(-1),d=l.map.indexOf(s.pos-c);return d%l.width==0?-1:c+l.map[d-1]}function Nh(e,t,n){const r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function Hh(e,t){e.dispatch(e.state.tr.setMeta(Bh,{setHandle:t}))}function qh(e,t,n,r){const o=e.state.doc.resolve(t),i=o.node(-1),a=o.start(-1),s=Ru.get(i).colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1;let l=e.domAtPos(o.start(-1)).node;for(;l&&"TABLE"!=l.nodeName;)l=l.parentNode;l&&Ph(i,l.firstChild,l,r,s,n)}function jh(e){return Array(e).fill(0)}var Vh="undefined"!=typeof navigator?navigator:null,Fh=Vh&&Vh.userAgent||"",$h=/Edge\/(\d+)/.exec(Fh),Wh=/MSIE \d/.exec(Fh),Uh=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Fh),Gh=!(Wh||Uh||$h)&&!!Vh&&/Apple Computer/.test(Vh.vendor),Zh=new d("safari-ime-span"),Xh=!1;function Kh(e){const t=e.dom.ownerDocument.createElement("span");return t.className="ProseMirror-safari-ime-span",t}var Yh=new c(Gh?{key:Zh,props:{decorations:function(e){const{$from:t,$to:n,to:r}=e.selection;if(Xh&&t.sameParent(n)){const t=v.widget(r,Kh,{ignoreSelection:!0,key:"safari-ime-span"});return f.create(e.doc,[t])}},handleDOMEvents:{compositionstart:()=>{Xh=!0},compositionend:()=>{Xh=!1}}}}:{key:Zh});function Jh(e,t){return Object.assign(e,{meta:{package:"@milkdown/preset-gfm",...t}}),e}var Qh=q("strike_through");Jh(Qh,{displayName:"Attr<strikethrough>",group:"Strikethrough"});var ep=j("strike_through",e=>({parseDOM:[{tag:"del"},{style:"text-decoration",getAttrs:e=>"line-through"===e}],toDOM:t=>["del",e.get(Qh.key)(t)],parseMarkdown:{match:e=>"delete"===e.type,runner:(e,t,n)=>{e.openMark(n),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"strike_through"===e.type.name,runner:(e,t)=>{e.withMark(t,"delete")}}}));Jh(ep.mark,{displayName:"MarkSchema<strikethrough>",group:"Strikethrough"}),Jh(ep.ctx,{displayName:"MarkSchemaCtx<strikethrough>",group:"Strikethrough"});var tp=l("ToggleStrikeThrough",e=>()=>G(ep.type(e)));Jh(tp,{displayName:"Command<ToggleStrikethrough>",group:"Strikethrough"});var np=V(e=>U(new RegExp("(?<![\\w:/])(~{1,2})(.+?)\\1(?!\\w|\\/)"),ep.type(e)));Jh(np,{displayName:"InputRule<strikethrough>",group:"Strikethrough"});var rp=$("strikeThroughKeymap",{ToggleStrikethrough:{shortcuts:"Mod-Alt-x",command:e=>{const t=e.get(g);return()=>t.call(tp.key)}}});Jh(rp.ctx,{displayName:"KeymapCtx<strikethrough>",group:"Strikethrough"}),Jh(rp.shortcuts,{displayName:"Keymap<strikethrough>",group:"Strikethrough"});var op=function(e){const t=e.cellAttributes||{},n={colspan:{default:1,validate:"number"},rowspan:{default:1,validate:"number"},colwidth:{default:null,validate:Du}};for(const r in t)n[r]={default:t[r].default,validate:t[r].validate};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:e.tableGroup,parseDOM:[{tag:"table"}],toDOM:()=>["table",["tbody",0]]},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM:()=>["tr",0]},table_cell:{content:e.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:e=>Bu(e,t)}],toDOM:e=>["td",zu(e,t),0]},table_header:{content:e.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:e=>Bu(e,t)}],toDOM:e=>["th",zu(e,t),0]}}}({tableGroup:"block",cellContent:"paragraph",cellAttributes:{alignment:{default:"left",getFromDOM:e=>e.style.textAlign||"left",setDOMAttr:(e,t)=>{t.style=`text-align: ${e||"left"}`}}}}),ip=I("table",()=>({...op.table,content:"table_header_row table_row+",disableDropCursor:!0,parseMarkdown:{match:e=>"table"===e.type,runner:(e,t,n)=>{const r=t.align,o=t.children.map((e,t)=>({...e,align:r,isHeader:0===t}));e.openNode(n),e.next(o),e.closeNode()}},toMarkdown:{match:e=>"table"===e.type.name,runner:(e,t)=>{const n=t.content.firstChild?.content;if(!n)return;const r=[];n.forEach(e=>{r.push(e.attrs.alignment)}),e.openNode("table",void 0,{align:r}),e.next(t.content),e.closeNode()}}}));Jh(ip.node,{displayName:"NodeSchema<table>",group:"Table"}),Jh(ip.ctx,{displayName:"NodeSchemaCtx<table>",group:"Table"});var ap=I("table_header_row",()=>({...op.table_row,disableDropCursor:!0,content:"(table_header)*",parseDOM:[{tag:"tr[data-is-header]"},{tag:"tr",getAttrs:e=>e instanceof HTMLElement&&!!e.querySelector("th")&&{}}],toDOM:()=>["tr",{"data-is-header":!0},0],parseMarkdown:{match:e=>Boolean("tableRow"===e.type&&e.isHeader),runner:(e,t,n)=>{const r=t.align,o=t.children.map((e,n)=>({...e,align:r[n],isHeader:t.isHeader}));e.openNode(n),e.next(o),e.closeNode()}},toMarkdown:{match:e=>"table_header_row"===e.type.name,runner:(e,t)=>{0!==t.content.size&&(e.openNode("tableRow",void 0,{isHeader:!0}),e.next(t.content),e.closeNode())}}}));Jh(ap.node,{displayName:"NodeSchema<tableHeaderRow>",group:"Table"}),Jh(ap.ctx,{displayName:"NodeSchemaCtx<tableHeaderRow>",group:"Table"});var sp=I("table_row",()=>({...op.table_row,disableDropCursor:!0,content:"(table_cell)*",parseMarkdown:{match:e=>"tableRow"===e.type,runner:(e,t,n)=>{const r=t.align,o=t.children.map((e,t)=>({...e,align:r[t]}));e.openNode(n),e.next(o),e.closeNode()}},toMarkdown:{match:e=>"table_row"===e.type.name,runner:(e,t)=>{0!==t.content.size&&(e.openNode("tableRow"),e.next(t.content),e.closeNode())}}}));Jh(sp.node,{displayName:"NodeSchema<tableRow>",group:"Table"}),Jh(sp.ctx,{displayName:"NodeSchemaCtx<tableRow>",group:"Table"});var lp=I("table_cell",()=>({...op.table_cell,disableDropCursor:!0,parseMarkdown:{match:e=>"tableCell"===e.type&&!e.isHeader,runner:(e,t,n)=>{const r=t.align;e.openNode(n,{alignment:r}).openNode(e.schema.nodes.paragraph).next(t.children).closeNode().closeNode()}},toMarkdown:{match:e=>"table_cell"===e.type.name,runner:(e,t)=>{e.openNode("tableCell").next(t.content).closeNode()}}}));Jh(lp.node,{displayName:"NodeSchema<tableCell>",group:"Table"}),Jh(lp.ctx,{displayName:"NodeSchemaCtx<tableCell>",group:"Table"});var cp=I("table_header",()=>({...op.table_header,disableDropCursor:!0,parseMarkdown:{match:e=>"tableCell"===e.type&&!!e.isHeader,runner:(e,t,n)=>{const r=t.align;e.openNode(n,{alignment:r}),e.openNode(e.schema.nodes.paragraph),e.next(t.children),e.closeNode(),e.closeNode()}},toMarkdown:{match:e=>"table_header"===e.type.name,runner:(e,t)=>{e.openNode("tableCell"),e.next(t.content),e.closeNode()}}}));function dp(e,t=3,n=3){const r=Array(n).fill(0).map(()=>lp.type(e).createAndFill()),o=Array(n).fill(0).map(()=>cp.type(e).createAndFill()),i=Array(t).fill(0).map((t,n)=>0===n?ap.type(e).create(null,o):sp.type(e).create(null,r));return ip.type(e).create(null,i)}function up(e){return(t,n)=>r=>{n=n??r.selection.from;const o=r.doc.resolve(n),i=K(e=>"table"===e.type.name)(o),a=i?{node:i.node,from:i.start}:void 0,s="row"===e;if(a){const e=Ru.get(a.node);if(t>=0&&t<(s?e.height:e.width)){const n=e.positionAt(s?t:e.height-1,s?e.width-1:t,a.node),o=r.doc.resolve(a.from+n),i=s?Zu.rowSelection:Zu.colSelection,l=e.positionAt(s?t:0,s?0:t,a.node),c=r.doc.resolve(a.from+l);return Y(r.setSelection(i(o,c)))}}return r}}Jh(cp.node,{displayName:"NodeSchema<tableHeader>",group:"Table"}),Jh(cp.ctx,{displayName:"NodeSchemaCtx<tableHeader>",group:"Table"});var hp=up("row"),pp=up("col");function mp(e,t,{map:n,tableStart:r,table:o},i){const a=Array(i).fill(0).reduce((e,t,n)=>e+o.child(n).nodeSize,r),s=Array(n.width).fill(0).map((t,r)=>{const i=o.nodeAt(n.map[r]);return lp.type(e).createAndFill({alignment:i?.attrs.alignment})});return t.insert(a,sp.type(e).create(null,s)),t}var fp=l("GoToPrevTableCell",()=>()=>vh(-1));Jh(fp,{displayName:"Command<goToPrevTableCellCommand>",group:"Table"});var gp=l("GoToNextTableCell",()=>()=>vh(1));Jh(gp,{displayName:"Command<goToNextTableCellCommand>",group:"Table"});var vp=l("ExitTable",e=>()=>(t,n)=>{if(!ju(t))return!1;const{$head:r}=t.selection,o=Z(r,ip.type(e));if(!o)return!1;const{to:i}=o,a=t.tr.replaceWith(i,i,X.type(e).createAndFill());return a.setSelection(z.near(a.doc.resolve(i),1)).scrollIntoView(),n?.(a),!0});Jh(vp,{displayName:"Command<breakTableCommand>",group:"Table"});var yp=l("InsertTable",e=>({row:t,col:n}={})=>(r,o)=>{const{selection:i,tr:a}=r,{from:s}=i,l=dp(e,t,n),c=a.replaceSelectionWith(l),d=z.findFrom(c.doc.resolve(s),1,!0);return d&&c.setSelection(d),o?.(c),!0});Jh(yp,{displayName:"Command<insertTableCommand>",group:"Table"});var bp=l("MoveRow",()=>({from:e,to:t,pos:n}={})=>function(e){return(t,n)=>{const{from:r,to:o,select:i=!0,pos:a=t.selection.from}=e,s=t.tr;return!!function(e){var t,n;const{tr:r,originIndex:o,targetIndex:i,select:a,pos:s}=e,l=rh(r.doc.resolve(s));if(!l)return!1;const c=null===(t=sh(r,o))||void 0===t?void 0:t.indexes,d=null===(n=sh(r,i))||void 0===n?void 0:n.indexes;if(!c||!d)return!1;if(c.includes(i))return!1;const u=function(e,t,n){let r=eh(e);return r=nh(r,t,n),th(e,r)}(l.node,c,d);if(r.replaceWith(l.pos,l.pos+l.node.nodeSize,u),!a)return!0;const h=Ru.get(u),p=l.start,m=i,f=h.positionAt(m,h.width-1,u),g=r.doc.resolve(p+f),v=h.positionAt(m,0,u),y=r.doc.resolve(p+v);return r.setSelection(Zu.rowSelection(g,y)),!0}({tr:s,originIndex:r,targetIndex:o,select:i,pos:a})&&(null==n||n(s),!0)}}({from:e??0,to:t??0,pos:n}));Jh(bp,{displayName:"Command<moveRowCommand>",group:"Table"});var wp=l("MoveCol",()=>({from:e,to:t,pos:n}={})=>function(e){return(t,n)=>{const{from:r,to:o,select:i=!0,pos:a=t.selection.from}=e,s=t.tr;return!!function(e){var t,n;const{tr:r,originIndex:o,targetIndex:i,select:a,pos:s}=e,l=rh(r.doc.resolve(s));if(!l)return!1;const c=null===(t=ah(r,o))||void 0===t?void 0:t.indexes,d=null===(n=ah(r,i))||void 0===n?void 0:n.indexes;if(!c||!d)return!1;if(c.includes(i))return!1;const u=function(e,t,n){let r=lh(eh(e));return r=nh(r,t,n),r=lh(r),th(e,r)}(l.node,c,d);if(r.replaceWith(l.pos,l.pos+l.node.nodeSize,u),!a)return!0;const h=Ru.get(u),p=l.start,m=i,f=h.positionAt(h.height-1,m,u),g=r.doc.resolve(p+f),v=h.positionAt(0,m,u),y=r.doc.resolve(p+v);return r.setSelection(Zu.colSelection(g,y)),!0}({tr:s,originIndex:r,targetIndex:o,select:i,pos:a})&&(null==n||n(s),!0)}}({from:e??0,to:t??0,pos:n}));Jh(wp,{displayName:"Command<moveColCommand>",group:"Table"});var xp=l("SelectRow",()=>(e={index:0})=>(t,n)=>{const{tr:r}=t,o=n?.(hp(e.index,e.pos)(r));return Boolean(o)});Jh(xp,{displayName:"Command<selectRowCommand>",group:"Table"});var kp=l("SelectCol",()=>(e={index:0})=>(t,n)=>{const{tr:r}=t,o=n?.(pp(e.index,e.pos)(r));return Boolean(o)});Jh(kp,{displayName:"Command<selectColCommand>",group:"Table"});var Cp=l("SelectTable",()=>()=>(e,t)=>{const{tr:n}=e,r=t?.(function(e){const t=function(e){const t=rh(e.$from);if(!t)return;const n=Ru.get(t.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map(e=>{const n=t.node.nodeAt(e),r=e+t.start;return{pos:r,start:r+1,node:n}})}(e.selection);if(t&&t[0]){const n=e.doc.resolve(t[0].pos),r=t[t.length-1];if(r){const t=e.doc.resolve(r.pos);return Y(e.setSelection(new Zu(t,n)))}}return e}(n));return Boolean(r)});Jh(Cp,{displayName:"Command<selectTableCommand>",group:"Table"});var _p=l("DeleteSelectedCells",()=>()=>(e,t)=>{const{selection:n}=e;if(!(n instanceof Zu))return!1;const r=n.isRowSelection(),o=n.isColSelection();return r&&o?function(e,t){const n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}(e,t):o?function(e,t){if(!ju(e))return!1;if(t){const n=ch(e),r=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(let e=n.right-1;ph(r,n,e),e!=n.left;e--){const e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw new RangeError("No table found");n.table=e,n.map=Ru.get(e)}t(r)}return!0}(e,t):function(e,t){if(!ju(e))return!1;if(t){const n=ch(e),r=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;mh(r,n,e),e!=n.top;e--){const e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw new RangeError("No table found");n.table=e,n.map=Ru.get(n.table)}t(r)}return!0}(e,t)});Jh(_p,{displayName:"Command<deleteSelectedCellsCommand>",group:"Table"});var Sp=l("AddColBefore",()=>()=>uh);Jh(Sp,{displayName:"Command<addColBeforeCommand>",group:"Table"});var Ap=l("AddColAfter",()=>()=>hh);Jh(Ap,{displayName:"Command<addColAfterCommand>",group:"Table"});var Mp=l("AddRowBefore",e=>()=>(t,n)=>{if(!ju(t))return!1;if(n){const r=ch(t);n(mp(e,t.tr,r,r.top))}return!0});Jh(Mp,{displayName:"Command<addRowBeforeCommand>",group:"Table"});var Tp=l("AddRowAfter",e=>()=>(t,n)=>{if(!ju(t))return!1;if(n){const r=ch(t);n(mp(e,t.tr,r,r.bottom))}return!0});Jh(Tp,{displayName:"Command<addRowAfterCommand>",group:"Table"});var Ep=l("SetAlign",()=>(e="left")=>function(e,t){return function(n,r){if(!ju(n))return!1;const o=Vu(n);if(o.nodeAfter.attrs[e]===t)return!1;if(r){const i=n.tr;n.selection instanceof Zu?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&i.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):i.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[e]:t}),r(i)}return!0}}("alignment",e));Jh(Ep,{displayName:"Command<setAlignCommand>",group:"Table"});var Lp=V(e=>new W(/^\|(?<col>\d+)[xX](?<row>\d+)\|\s$/,(t,n,r,o)=>{const i=t.doc.resolve(r);if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),ip.type(e)))return null;const a=dp(e,Math.max(Number(n.groups?.row??0),2),Number(n.groups?.col)),s=t.tr.replaceRangeWith(r,o,a);return s.setSelection(S.create(s.doc,r+3)).scrollIntoView()}));Jh(Lp,{displayName:"InputRule<insertTableInputRule>",group:"Table"});var Op=F(e=>({run:(t,n,r)=>{if(r)return t;function o(t){const n=t.childCount,r=t.lastChild?.childCount??0;if(0===n||0===r)return X.type(e).create();const o=t.firstChild;if(!(r>0&&o&&0===o.childCount))return t;if(n>=3){const r=t.child(1),i=[];for(let t=0;t<r.childCount;t++){const n=r.child(t);i.push(cp.type(e).create(n.attrs,n.content,n.marks))}const a=o.type.create(o.attrs,i),s=[];for(let e=2;e<n;e++)s.push(t.child(e));return t.type.create(t.attrs,[a,...s])}const i=Array(r).fill(0).map(()=>cp.type(e).createAndFill()),a=new p(m.from(i),0,0),s=o.replace(0,0,a);return t.replace(0,o.nodeSize,new p(m.from(s),0,0))}let i=function t(n){let r=function(t){const n=sp.type(e),r=[];let i=[],a=!1;function s(){if(0===i.length)return;const t=ap.type(e).createAndFill(),n=ip.type(e).create(null,[t,...i]);r.push(o(n)),i=[]}return t.forEach(e=>{e.type===n?(a=!0,i.push(e)):(s(),r.push(e))}),s(),a?m.from(r):t}(n),i=r!==n;const a=[];return r.forEach(n=>{if(n.type===ip.type(e)){const e=o(n);e!==n&&(i=!0),a.push(e)}else if(n.childCount>0){const e=t(n.content);e!==n.content?(i=!0,a.push(n.copy(e))):a.push(n)}else a.push(n)}),i?m.from(a):n}(t.content);return i=function(t){const n=[],r=[];t.forEach(e=>r.push(e));for(let o=0;o<r.length;o++){const t=r[o],i=r[o+1];t.type===X.type(e)&&0===t.content.size&&i&&i.type===ip.type(e)||n.push(t)}return n.length<r.length?m.from(n):t}(i),new p(m.from(i),t.openStart,t.openEnd)}}));Jh(Op,{displayName:"PasteRule<table>",group:"Table"});var Ip=$("tableKeymap",{NextCell:{priority:100,shortcuts:["Mod-]","Tab"],command:e=>{const t=e.get(g);return()=>t.call(gp.key)}},PrevCell:{shortcuts:["Mod-[","Shift-Tab"],command:e=>{const t=e.get(g);return()=>t.call(fp.key)}},ExitTable:{shortcuts:["Mod-Enter","Enter"],command:e=>{const t=e.get(g);return()=>t.call(vp.key)}}});Jh(Ip.ctx,{displayName:"KeymapCtx<table>",group:"Table"}),Jh(Ip.shortcuts,{displayName:"Keymap<table>",group:"Table"});var Rp="footnote_definition",Pp="footnoteDefinition",Bp=I("footnote_definition",()=>({group:"block",content:"block+",defining:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`dl[data-type="${Rp}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw P(e);return{label:e.dataset.label}},contentElement:"dd"}],toDOM:e=>{const t=e.attrs.label;return["dl",{"data-label":t,"data-type":Rp},["dt",t],["dd",0]]},parseMarkdown:{match:({type:e})=>e===Pp,runner:(e,t,n)=>{e.openNode(n,{label:t.label}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===Rp,runner:(e,t)=>{e.openNode(Pp,void 0,{label:t.attrs.label,identifier:t.attrs.label}).next(t.content).closeNode()}}}));Jh(Bp.ctx,{displayName:"NodeSchemaCtx<footnodeDef>",group:"footnote"}),Jh(Bp.node,{displayName:"NodeSchema<footnodeDef>",group:"footnote"});var zp="footnote_reference",Dp=I("footnote_reference",()=>({group:"inline",inline:!0,atom:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`sup[data-type="${zp}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw P(e);return{label:e.dataset.label}}}],toDOM:e=>{const t=e.attrs.label;return["sup",{"data-label":t,"data-type":zp},t]},parseMarkdown:{match:({type:e})=>"footnoteReference"===e,runner:(e,t,n)=>{e.addNode(n,{label:t.label})}},toMarkdown:{match:e=>e.type.name===zp,runner:(e,t)=>{e.addNode("footnoteReference",void 0,void 0,{label:t.attrs.label,identifier:t.attrs.label})}}}));Jh(Dp.ctx,{displayName:"NodeSchemaCtx<footnodeRef>",group:"footnote"}),Jh(Dp.node,{displayName:"NodeSchema<footnodeRef>",group:"footnote"});var Np=H.extendSchema(e=>t=>{const n=e(t);return{...n,attrs:{...n.attrs,checked:{default:null,validate:"boolean|null"}},parseDOM:[{tag:'li[data-item-type="task"]',getAttrs:e=>{if(!(e instanceof HTMLElement))throw P(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:e.dataset.spread,checked:e.dataset.checked?"true"===e.dataset.checked:null}}},...n?.parseDOM||[]],toDOM:e=>n.toDOM&&null==e.attrs.checked?n.toDOM(e):["li",{"data-item-type":"task","data-label":e.attrs.label,"data-list-type":e.attrs.listType,"data-spread":e.attrs.spread,"data-checked":e.attrs.checked},0],parseMarkdown:{match:({type:e})=>"listItem"===e,runner:(e,t,r)=>{if(null==t.checked)return void n.parseMarkdown.runner(e,t,r);const o=null!=t.label?`${t.label}.`:"•",i=null!=t.checked?Boolean(t.checked):null,a=null!=t.label?"ordered":"bullet",s=null!=t.spread?`${t.spread}`:"true";e.openNode(r,{label:o,listType:a,spread:s,checked:i}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>"list_item"===e.type.name,runner:(e,t)=>{if(null==t.attrs.checked)return void n.toMarkdown.runner(e,t);const r=t.attrs.label,o=t.attrs.listType,i="true"===t.attrs.spread,a=t.attrs.checked;e.openNode("listItem",void 0,{label:r,listType:o,spread:i,checked:a}),e.next(t.content),e.closeNode()}}}});Jh(Np.node,{displayName:"NodeSchema<taskListItem>",group:"ListItem"}),Jh(Np.ctx,{displayName:"NodeSchemaCtx<taskListItem>",group:"ListItem"});var Hp=V(()=>new W(/^\[(?<checked>\s|x)\]\s$/,(e,t,n,r)=>{const o=e.doc.resolve(n);let i=0,a=o.node(i);for(;a&&"list_item"!==a.type.name;)i--,a=o.node(i);if(!a||null!=a.attrs.checked)return null;const s=Boolean("x"===t.groups?.checked),l=o.before(i),c=e.tr;return c.deleteRange(n,r).setNodeMarkup(l,void 0,{...a.attrs,checked:s}),c}));Jh(Hp,{displayName:"InputRule<wrapInTaskListInputRule>",group:"ListItem"});var qp=[rp,Ip].flat(),jp=[Lp,Hp],Vp=[np],Fp=[Op],$p=s(()=>Yh);Jh($p,{displayName:"Prose<autoInsertSpanPlugin>",group:"Prose"}),Jh(s(()=>function({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=Rh,lastColumnResizable:o=!0}={}){const i=new c({key:Bh,state:{init(e,t){var o;const a=null===(o=i.spec)||void 0===o||null===(o=o.props)||void 0===o?void 0:o.nodeViews,s=Nu(t.schema).table.name;return r&&a&&(a[s]=(e,t)=>new r(e,n,t)),new zh(-1,!1)},apply:(e,t)=>t.apply(e)},props:{attributes:e=>{const t=Bh.getState(e);return t&&t.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(t,n)=>{!function(e,t,n,r){if(!e.editable)return;const o=Bh.getState(e.state);if(o&&!o.dragging){const i=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target);let a=-1;if(i){const{left:r,right:o}=i.getBoundingClientRect();t.clientX-r<=n?a=Dh(e,t,"left",n):o-t.clientX<=n&&(a=Dh(e,t,"right",n))}if(a!=o.activeHandle){if(!r&&-1!==a){const t=e.state.doc.resolve(a),n=t.node(-1),r=Ru.get(n),o=t.start(-1);if(r.colCount(t.pos-o)+t.nodeAfter.attrs.colspan-1==r.width-1)return}Hh(e,a)}}}(t,n,e,o)},mouseleave:e=>{!function(e){if(!e.editable)return;const t=Bh.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&Hh(e,-1)}(e)},mousedown:(e,r)=>{!function(e,t,n,r){var o;if(!e.editable)return!1;const i=null!==(o=e.dom.ownerDocument.defaultView)&&void 0!==o?o:window,a=Bh.getState(e.state);if(!a||-1==a.activeHandle||a.dragging)return!1;const s=e.state.doc.nodeAt(a.activeHandle),l=function(e,t,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const i=e.domAtPos(t);let a=i.node.childNodes[i.offset].offsetWidth,s=n;if(r)for(let l=0;l<n;l++)r[l]&&(a-=r[l],s--);return a/s}(e,a.activeHandle,s.attrs);function c(t){i.removeEventListener("mouseup",c),i.removeEventListener("mousemove",d);const r=Bh.getState(e.state);(null==r?void 0:r.dragging)&&(function(e,t,n){const r=e.state.doc.resolve(t),o=r.node(-1),i=Ru.get(o),a=r.start(-1),s=i.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,l=e.state.tr;for(let c=0;c<i.height;c++){const e=c*i.width+s;if(c&&i.map[e]==i.map[e-i.width])continue;const t=i.map[e],r=o.nodeAt(t).attrs,d=1==r.colspan?0:s-i.colCount(t);if(r.colwidth&&r.colwidth[d]==n)continue;const u=r.colwidth?r.colwidth.slice():jh(r.colspan);u[d]=n,l.setNodeMarkup(a+t,null,{...r,colwidth:u})}l.docChanged&&e.dispatch(l)}(e,r.activeHandle,Nh(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(Bh,{setDragging:null})))}function d(t){if(!t.which)return c(t);const o=Bh.getState(e.state);if(o&&o.dragging){const i=Nh(o.dragging,t,n);qh(e,o.activeHandle,i,r)}}e.dispatch(e.state.tr.setMeta(Bh,{setDragging:{startX:t.clientX,startWidth:l}})),qh(e,a.activeHandle,l,r),i.addEventListener("mouseup",c),i.addEventListener("mousemove",d),t.preventDefault()}(e,r,t,n)}},decorations:e=>{const t=Bh.getState(e);if(t&&t.activeHandle>-1)return function(e,t){const n=[],r=e.doc.resolve(t),o=r.node(-1);if(!o)return f.empty;const i=Ru.get(o),a=r.start(-1),s=i.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1;for(let c=0;c<i.height;c++){const t=s+c*i.width;if(!(s!=i.width-1&&i.map[t]==i.map[t+1]||0!=c&&i.map[t]==i.map[t-i.width])){var l;const r=i.map[t],s=a+r+o.nodeAt(r).nodeSize-1,c=document.createElement("div");c.className="column-resize-handle",(null===(l=Bh.getState(e))||void 0===l?void 0:l.dragging)&&n.push(v.node(a+r,a+r+o.nodeAt(r).nodeSize,{class:"column-resize-dragging"})),n.push(v.widget(s,c))}}return f.create(e.doc,n)}(e,t.activeHandle)},nodeViews:{}}});return i}({})),{displayName:"Prose<columnResizingPlugin>",group:"Prose"});var Wp=s(()=>function({allowTableNodeSelection:e=!1}={}){return new c({key:Hu,state:{init:()=>null,apply(e,t){const n=e.getMeta(Hu);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;const{deleted:r,pos:o}=e.mapping.mapResult(t);return r?null:o}},props:{decorations:Ku,handleDOMEvents:{mousedown:Eh},createSelectionBetween:e=>null!=Hu.getState(e.state)?e.state.selection:null,handleTripleClick:Mh,handleKeyDown:Ch,handlePaste:Th},appendTransaction:(t,n,r)=>function(e,t,n){const r=(t||e).selection,o=(t||e).doc;let i,a;if(r instanceof M&&(a=r.node.type.spec.tableRole)){if("cell"==a||"header_cell"==a)i=Zu.create(o,r.from);else if("row"==a){const e=o.resolve(r.from+1);i=Zu.rowSelection(e,e)}else if(!n){const e=Ru.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];i=Zu.create(o,t+1,n)}}else r instanceof S&&function({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,o=e.depth;for(;o>=0&&!(e.after(o+1)<e.end(o));o--,n++);for(let i=t.depth;i>=0&&!(t.before(i+1)>t.start(i));i--,r--);return n==r&&/row|table/.test(e.node(o).type.spec.tableRole)}(r)?i=S.create(o,r.from):r instanceof S&&function({$from:e,$to:t}){let n,r;for(let o=e.depth;o>0;o--){const t=e.node(o);if("cell"===t.type.spec.tableRole||"header_cell"===t.type.spec.tableRole){n=t;break}}for(let o=t.depth;o>0;o--){const e=t.node(o);if("cell"===e.type.spec.tableRole||"header_cell"===e.type.spec.tableRole){r=e;break}}return n!==r&&0===t.parentOffset}(r)&&(i=S.create(o,r.$from.start(),r.$from.end()));return i&&(t||(t=e.tr)).setSelection(i),t}(r,Qu(r,n),e)})}({allowTableNodeSelection:!0}));Jh(Wp,{displayName:"Prose<tableEditingPlugin>",group:"Prose"});var Up=O("remarkGFM",()=>On);Jh(Up.plugin,{displayName:"Remark<remarkGFMPlugin>",group:"Remark"}),Jh(Up.options,{displayName:"RemarkConfig<remarkGFMPlugin>",group:"Remark"});var Gp=new d("MILKDOWN_KEEP_TABLE_ALIGN_PLUGIN"),Zp=s(()=>new c({key:Gp,appendTransaction:(e,t,n)=>{let r;return t.doc!==n.doc&&n.doc.descendants((e,t)=>{if(r||(r=n.tr),"table_cell"!==e.type.name)return;const o=n.doc.resolve(t),i=o.node(o.depth),a=o.node(o.depth-1).firstChild;if(!a)return;const s=function(e,t){let n=0;return t.forEach((t,r,o)=>{t===e&&(n=o)}),n}(e,i),l=a.maybeChild(s);if(!l)return;const c=l.attrs.alignment;c!==e.attrs.alignment&&r.setNodeMarkup(t,void 0,{...e.attrs,alignment:c})}),r}}));Jh(Zp,{displayName:"Prose<keepTableAlignPlugin>",group:"Prose"});var Xp=[Zp,$p,Up,Wp].flat(),Kp=[[Np,ip,ap,sp,cp,lp,Bp,Dp,Qh,ep].flat(),jp,Fp,Vp,qp,[gp,fp,vp,yp,bp,wp,xp,kp,Cp,_p,Mp,Tp,Sp,Ap,Ep,tp],Xp].flat(),Yp=Object.defineProperty,Jp=Object.getOwnPropertySymbols,Qp=Object.prototype.hasOwnProperty,em=Object.prototype.propertyIsEnumerable,tm=(e,t,n)=>t in e?Yp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nm=(e,t)=>{for(var n in t||(t={}))Qp.call(t,n)&&tm(e,n,t[n]);if(Jp)for(var n of Jp(t))em.call(t,n)&&tm(e,n,t[n]);return e};function rm(e,t){return Object.assign(e,{meta:nm({package:"@milkdown/components"},t)}),e}const om=a({activationMode:"viewport",extensions:[],languages:[],expandIcon:"⬇",searchIcon:"🔍",clearSearchIcon:"⌫",searchPlaceholder:"Search language",noResultText:"No result",copyText:"Copy",copyIcon:"📋",onCopy:()=>{},renderLanguage:e=>e,renderPreview:()=>null,previewToggleButton:e=>e?"Edit":"Hide",previewLabel:"Preview",previewLoading:"Loading..."},"codeBlockConfigCtx");rm(om,{displayName:"Config<code-block>",group:"CodeBlock"});class im{constructor(e){this.languages=e,this.map={},e.forEach(e=>{e.alias.forEach(t=>{this.map[t]=e})})}getAll(){return this.languages.map(e=>({name:e.name,alias:e.alias}))}load(e){const t=this.map[e.toLowerCase()];return t?t.support?Promise.resolve(t.support):t.load():Promise.resolve(void 0)}}function am({icon:e,class:t,onClick:n}){return pd("span",{class:Ln("milkdown-icon",t),onPointerdown:n,innerHTML:e?Sn.sanitize(e.trim()):void 0})}am.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const sm=ml({props:{copyText:{type:String,required:!0},copyIcon:{type:String,required:!0},onCopy:{type:Function,required:!0},text:{type:String,required:!0}},setup(e){const t=()=>{(function(e){return((e,t,n)=>new Promise((t,r)=>{var o=e=>{try{a(n.next(e))}catch(_T){r(_T)}},i=e=>{try{a(n.throw(e))}catch(_T){r(_T)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(o,i);a((n=n.apply(e,null)).next())}))(this,0,function*(){try{return navigator.clipboard.writeText(e)}catch(_T){const n=document.createElement("textarea"),r=document.activeElement;n.value=e,n.setAttribute("readonly",""),n.style.contain="strict",n.style.position="absolute",n.style.left="-9999px",n.style.fontSize="12pt";const o=document.getSelection(),i=o?o.rangeCount>0&&o.getRangeAt(0):null;document.body.appendChild(n),n.select(),n.selectionStart=0,n.selectionEnd=e.length,document.execCommand("copy"),document.body.removeChild(n),i&&(o.removeAllRanges(),o.addRange(i)),r&&r.focus()}})})(e.text).then(()=>e.onCopy(e.text)).catch(console.error)};return()=>pd(Dc,null,pd("button",{type:"button",class:"copy-button",onClick:t},pd(am,{icon:e.copyIcon}),e.copyText))}}),lm=ml({props:{language:{type:Object,required:!0},getReadOnly:{type:Function,required:!0},config:{type:Object,required:!0},getAllLanguages:{type:Function,required:!0},setLanguage:{type:Function,required:!0}},setup({language:e,config:t,setLanguage:n,getAllLanguages:r,getReadOnly:o}){const i=gs(),a=gs(!1),s=gs(),l=gs(),c=gs("");sl([a,i,l],()=>{c.value="";const e=i.value,t=l.value;e&&t&&b(e,t,{placement:"bottom-start"}).then(({x:e,y:n})=>{Object.assign(t.style,{left:`${e}px`,top:`${n}px`})}).catch(console.error)});const d=e=>{if(e.preventDefault(),e.stopPropagation(),o())return;const t=!a.value;a.value=t,t&&setTimeout(()=>{var e;return null==(e=s.value)?void 0:e.focus()},0)},u=e=>{const t=e.target;c.value=t.value},h=e=>{"Escape"===e.key&&(c.value="")},p=hd(()=>{var t;if(!a.value)return[];const n=null!=(t=r())?t:[],o=n.find(t=>t.name.toLowerCase()===e.value.toLowerCase()),i=n.filter(e=>{const t=c.value.toLowerCase();return(e.name.toLowerCase().includes(t)||e.alias.some(e=>e.toLowerCase().includes(t)))&&e!==o});return 0===i.length?[]:o?[o,...i]:i}),m=e=>{const t=e.target;if(i.value&&i.value.contains(t))return;const n=l.value,r=i.value;r&&n&&"true"===r.dataset.expanded&&(n.contains(t)||(a.value=!1))};return El(()=>{window.addEventListener("click",m)}),Rl(()=>{window.removeEventListener("click",m)}),()=>pd(Dc,null,pd("button",{type:"button",ref:i,class:"language-button",onClick:d,"data-expanded":String(a.value)},e.value||"Text",pd("div",{class:"expand-icon"},pd(am,{icon:t.expandIcon}))),pd("div",{ref:l,class:"language-picker"},a.value?pd("div",{class:"list-wrapper"},pd("div",{class:"search-box"},pd("div",{class:"search-icon"},pd(am,{icon:t.searchIcon})),pd("input",{ref:s,class:"search-input",placeholder:t.searchPlaceholder,value:c.value,onInput:u,onKeydown:h}),pd("div",{class:Ln("clear-icon",0===c.value.length&&"hidden"),onMousedown:e=>{e.preventDefault(),c.value=""}},pd(am,{icon:t.clearSearchIcon}))),pd("ul",{class:"language-list",role:"listbox",onKeydown:e=>{if("Enter"===e.key){const e=document.activeElement;e instanceof HTMLElement&&e.dataset.language&&n(e.dataset.language)}}},p.value.length?p.value.map(r=>pd("li",{role:"listitem",tabindex:"0",class:"language-list-item","aria-selected":r.name.toLowerCase()===e.value.toLowerCase(),"data-language":r.name,onClick:()=>{n(r.name),a.value=!1}},t.renderLanguage(r.name,r.name.toLowerCase()===e.value.toLowerCase()))):pd("li",{class:"language-list-item no-result"},t.noResultText))):null))}});let cm;const dm=ml({props:{text:{type:Object,required:!0},language:{type:Object,required:!0},config:{type:Object,required:!0},previewOnlyMode:{type:Object,required:!0},preview:{type:Object,required:!0}},setup(e){const{previewOnlyMode:t,config:n,preview:r}=e,o=gs();return al(()=>{const e=o.value;if(!e)return;for(;e.firstChild;)e.removeChild(e.firstChild);const t=r.value;("string"==typeof t||t instanceof Element)&&(e.innerHTML=function(e){return null!=cm||(cm=function(){const e=Sn(),t={ADD_TAGS:["foreignObject"],ADD_ATTR:["xmlns"],HTML_INTEGRATION_POINTS:{foreignobject:!0}};return e.addHook("uponSanitizeElement",(e,t)=>{var n;if("foreignobject"===t.tagName){const t=e.parentElement;t&&"http://www.w3.org/2000/svg"===t.namespaceURI||null==(n=e.parentNode)||n.removeChild(e)}}),n=>e.sanitize(n,t)}()),cm(e)}(t))}),()=>r.value?pd("div",{class:"preview-panel"},!t.value&&pd(Dc,null,pd("div",{class:"preview-divider"}),pd("div",{class:"preview-label"},n.previewLabel)),pd("div",{ref:o,class:"preview"})):null}}),um=ml({props:{text:{type:Object,required:!0},selected:{type:Object,required:!0},getReadOnly:{type:Function,required:!0},codemirror:{type:Object,required:!0},language:{type:Object,required:!0},getAllLanguages:{type:Function,required:!0},setLanguage:{type:Function,required:!0},config:{type:Object,required:!0}},setup(e){var t;const n=gs(null!=(t=e.config.previewOnlyByDefault)?t:e.getReadOnly()),r=gs(),o=gs(null);El(()=>{for(var t;null==(t=r.value)?void 0:t.firstChild;)r.value.removeChild(r.value.firstChild);r.value&&r.value.appendChild(e.codemirror.dom)}),sl(()=>[e.text.value,e.language.value],()=>{const t=e.config.renderPreview(e.language.value,e.text.value,e=>o.value=e);t&&(o.value=t),void 0===t&&!o.value&&(o.value=Sn.sanitize(e.config.previewLoading)),null===t&&(o.value=null)},{immediate:!0});const i=()=>{};return()=>{var t;return pd(Dc,null,pd("div",{class:"tools"},pd(lm,{language:e.language,config:e.config,setLanguage:e.setLanguage,getAllLanguages:e.getAllLanguages,getReadOnly:e.getReadOnly}),pd("div",{class:"tools-button-group"},pd(sm,{copyIcon:e.config.copyIcon,copyText:e.config.copyText,onCopy:null!=(t=e.config.onCopy)?t:i,text:e.text.value}),o.value?pd("button",{class:"preview-toggle-button",onClick:()=>n.value=!n.value},pd(am,{icon:e.config.previewToggleButton(n.value)})):null)),pd("div",{ref:r,class:Ln("codemirror-host",o.value&&n.value&&"hidden")}),pd(dm,{text:e.text,language:e.language,config:e.config,previewOnlyMode:n,preview:o}))}}}),hm=new WeakMap;let pm=null;function mm(){return pm||(pm=new IntersectionObserver(e=>{for(const t of e){const e=hm.get(t.target);null==e||e(t.isIntersecting)}},{rootMargin:"200px"})),pm}const fm=class e{constructor(e,t,n,r,o){var i;this.node=e,this.view=t,this.getPos=n,this.loader=r,this.config=o,this.selected=gs(!1),this.language=gs(""),this.text=gs(""),this.initialized=!1,this.updating=!1,this.languageName="",this.teardownTimer=null,this.forwardUpdate=e=>{var t;if(this.updating||!this.cm.hasFocus)return;let n=(null!=(t=this.getPos())?t:0)+1;const{main:r}=e.state.selection,o=n+r.from,i=n+r.to,a=this.view.state.selection;if(e.docChanged||a.from!==o||a.to!==i){const t=this.view.state.tr;e.changes.iterChanges((e,r,o,i,a)=>{a.length?t.replaceWith(n+e,n+r,this.view.state.schema.text(a.toString())):t.delete(n+e,n+r),n+=i-o-(r-e)}),t.setSelection(S.create(t.doc,o,i)),this.view.dispatch(t)}},this.activateFromPointer=e=>{var t;if(this.initialized||"interaction"!==this.config.activationMode)return;e.preventDefault(),e.stopPropagation(),this.initializeCodeMirror();const n=null!=(t=this.cm.posAtCoords({x:e.clientX,y:e.clientY}))?t:0;this.cm.focus(),this.cm.dispatch({selection:{anchor:n}})},this.createApp=()=>qd(um,{text:this.text,selected:this.selected,codemirror:this.cm,language:this.language,getAllLanguages:this.getAllLanguages,getReadOnly:()=>!this.view.editable,setLanguage:this.setLanguage,config:this.config}),this.codeMirrorKeymap=()=>{const e=this.view;return[{key:"ArrowUp",run:()=>this.maybeEscape("line",-1)},{key:"ArrowLeft",run:()=>this.maybeEscape("char",-1)},{key:"ArrowDown",run:()=>this.maybeEscape("line",1)},{key:"ArrowRight",run:()=>this.maybeEscape("char",1)},{key:"Mod-Enter",run:()=>!!te(e.state,e.dispatch)&&(e.focus(),!0)},{key:"Mod-z",run:()=>Q(e.state,e.dispatch)},{key:"Shift-Mod-z",run:()=>ee(e.state,e.dispatch)},{key:"Mod-y",run:()=>ee(e.state,e.dispatch)},{key:"Backspace",run:()=>{var e;const t=this.cm.state.selection.ranges;if(t.length>1)return!1;const n=t[0];if(n&&(!n.empty||n.anchor>0))return!1;if(this.cm.state.doc.lines>=2)return!1;const r=this.view.state,o=null!=(e=this.getPos())?e:0,i=r.tr.replaceWith(o,o+this.node.nodeSize,r.schema.nodes.paragraph.createChecked({},this.node.content));return i.setSelection(S.near(i.doc.resolve(o))),this.view.dispatch(i),this.view.focus(),!0}}]},this.maybeEscape=(e,t)=>{var n;const{state:r}=this.cm;let o=r.selection.main;if(!o.empty)return!1;if("line"===e&&(o=r.doc.lineAt(o.head)),t<0?o.from>0:o.to<r.doc.length)return!1;const i=(null!=(n=this.getPos())?n:0)+(t<0?0:this.node.nodeSize),a=S.near(this.view.state.doc.resolve(i),t),s=this.view.state.tr.setSelection(a).scrollIntoView();return this.view.dispatch(s),this.view.focus(),!0},this.setLanguage=e=>{var t;this.view.dispatch(this.view.state.tr.setNodeAttribute(null!=(t=this.getPos())?t:0,"language",e))},this.getAllLanguages=()=>this.loader.getAll(),this.languageConf=new Dt,this.readOnlyConf=new Dt,this.text.value=this.node.textContent,this.language.value=null!=(i=this.node.attrs.language)?i:"",this.dom=document.createElement("div"),this.dom.className="milkdown-code-block",this.disposeSelectedWatcher=al(()=>{this.selected.value?this.dom.classList.add("selected"):this.dom.classList.remove("selected")}),this.dom.addEventListener("pointerdown",this.activateFromPointer),this.renderPlaceholder(),hm.set(this.dom,e=>{e?(this.cancelTeardown(),"viewport"===this.config.activationMode&&this.initializeCodeMirror()):this.initialized&&this.scheduleTeardown()}),mm().observe(this.dom)}renderPlaceholder(){const e=document.createElement("pre");e.className="milkdown-code-block-placeholder";const t=document.createElement("code");t.textContent=this.node.textContent,e.appendChild(t),this.dom.appendChild(e)}initializeCodeMirror(){if(this.initialized)return;this.initialized=!0,this.cm=new Rt({doc:this.node.textContent,root:this.view.root,extensions:[this.readOnlyConf.of(qt.readOnly.of(!this.view.editable)),Nt(),Ht.of(this.codeMirrorKeymap()),this.languageConf.of([]),qt.changeFilter.of(()=>this.view.editable),...this.config.extensions,Rt.updateListener.of(this.forwardUpdate)]});const e=this.dom.querySelector(".milkdown-code-block-placeholder");e&&this.dom.removeChild(e),this.app=this.createApp(),this.app.mount(this.dom),this.updateLanguage()}teardownCodeMirror(){if(this.initialized&&!this.cm.hasFocus&&!this.selected.value){for(this.app.unmount(),this.cm.destroy(),this.initialized=!1,this.languageName="";this.dom.firstChild;)this.dom.removeChild(this.dom.firstChild);this.renderPlaceholder()}}scheduleTeardown(){this.cancelTeardown(),this.teardownTimer=setTimeout(()=>this.teardownCodeMirror(),e.TEARDOWN_DELAY)}cancelTeardown(){null!=this.teardownTimer&&(clearTimeout(this.teardownTimer),this.teardownTimer=null)}updateLanguage(){const e=this.node.attrs.language;e!==this.languageName&&(this.language.value=e,this.loader.load(null!=e?e:"").then(t=>{t&&(this.cm.dispatch({effects:this.languageConf.reconfigure(t)}),this.languageName=e)}).catch(console.error))}setSelection(e,t){this.initialized||this.initializeCodeMirror(),this.cm.dom.isConnected&&(this.cm.focus(),this.updating=!0,this.cm.dispatch({selection:{anchor:e,head:t}}),this.updating=!1)}update(e){var t;if(e.type!==this.node.type)return!1;if(this.updating)return!0;if(this.node=e,this.text.value=e.textContent,this.language.value=null!=(t=e.attrs.language)?t:"",!this.initialized){const t=this.dom.querySelector(".milkdown-code-block-placeholder code");return t&&(t.textContent=e.textContent),!0}this.updateLanguage(),this.view.editable===this.cm.state.readOnly&&this.cm.dispatch({effects:this.readOnlyConf.reconfigure(qt.readOnly.of(!this.view.editable))});const n=function(e,t){if(e===t)return null;let n=0,r=e.length,o=t.length;for(;n<r&&e.charCodeAt(n)===t.charCodeAt(n);)++n;for(;r>n&&o>n&&e.charCodeAt(r-1)===t.charCodeAt(o-1);)r--,o--;return{from:n,to:r,text:t.slice(n,o)}}(this.cm.state.doc.toString(),e.textContent);return n&&(this.updating=!0,this.cm.dispatch({changes:{from:n.from,to:n.to,insert:n.text},scrollIntoView:!0}),this.updating=!1),!0}selectNode(){this.initialized||this.initializeCodeMirror(),this.selected.value=!0,this.cm.focus()}deselectNode(){this.selected.value=!1}stopEvent(){return!0}destroy(){this.cancelTeardown(),this.dom.removeEventListener("pointerdown",this.activateFromPointer),mm().unobserve(this.dom),hm.delete(this.dom),this.initialized&&(this.app.unmount(),this.cm.destroy()),this.disposeSelectedWatcher()}};fm.TEARDOWN_DELAY=5e3;let gm=fm;const vm=R(J.node,e=>{const t=e.get(om.key),n=new im(t.languages);return(e,r,o)=>new gm(e,r,o,n,t)});rm(vm,{displayName:"NodeView<code-block>",group:"CodeBlock"});const ym=[vm,om],bm="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class wm{constructor(e,t,n=0,r=e.length,o,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=o?e=>o(bm(e)):bm,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Jt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=en(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Qt(e);let r=this.normalize(t);if(r.length)for(let o=0,i=n;;o++){let e=r.charCodeAt(o),a=this.match(e,i,this.bufferPos+this.bufferStart);if(o==r.length-1){if(a)return this.value=a,this;break}i==n&&o<t.length&&t.charCodeAt(o)==e&&i++}}}match(e,t,n){let r=null;for(let o=0;o<this.matches.length;o+=2){let t=this.matches[o],i=!1;this.query.charCodeAt(t)==e&&(t==this.query.length-1?r={from:this.matches[o+1],to:n}:(this.matches[o]++,i=!0)),i||(this.matches.splice(o,2),o-=2)}return this.query.charCodeAt(0)==e&&(1==this.query.length?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}"undefined"!=typeof Symbol&&(wm.prototype[Symbol.iterator]=function(){return this});const xm={from:-1,to:-1,match:/.*/.exec("")},km="gm"+(null==/x/.unicode?"":"u");class Cm{constructor(e,t,n,r=0,o=e.length){if(this.text=e,this.to=o,this.curLine="",this.done=!1,this.value=xm,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new Am(e,t,n,r,o);this.re=new RegExp(t,km+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let i=e.lineAt(r);this.curLineStart=i.from,this.matchPos=Mm(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=Mm(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}const _m=new WeakMap;class Sm{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=_m.get(e);if(!r||r.from>=n||r.to<=t){let r=new Sm(t,e.sliceString(t,n));return _m.set(e,r),r}if(r.from==t&&r.to==n)return r;let{text:o,from:i}=r;return i>t&&(o=e.sliceString(t,i)+o,i=t),r.to<n&&(o+=e.sliceString(r.to,n)),_m.set(e,new Sm(i,o)),new Sm(t,o.slice(t-i,n-i))}}class Am{constructor(e,t,n,r,o){this.text=e,this.to=o,this.done=!1,this.value=xm,this.matchPos=Mm(e,r),this.re=new RegExp(t,km+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=Sm.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=Mm(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Sm.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function Mm(e,t){if(t>=e.length)return t;let n,r=e.lineAt(t);for(;t<r.to&&(n=r.text.charCodeAt(t-r.from))>=56320&&n<57344;)t++;return t}"undefined"!=typeof Symbol&&(Cm.prototype[Symbol.iterator]=Am.prototype[Symbol.iterator]=function(){return this});const Tm={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Em=Ut.define({combine:e=>Yt(e,Tm,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),Lm=Xt.mark({class:"cm-selectionMatch"}),Om=Xt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Im(e,t,n,r){return!(0!=n&&e(t.sliceDoc(n-1,n))==tn.Word||r!=t.doc.length&&e(t.sliceDoc(r,r+1))==tn.Word)}const Rm=jt.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Em),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Xt.none;let o,i=r.main,a=null;if(i.empty){if(!t.highlightWordAroundCursor)return Xt.none;let e=n.wordAt(i.head);if(!e)return Xt.none;a=n.charCategorizer(i.head),o=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return Xt.none;if(t.wholeWords){if(o=n.sliceDoc(i.from,i.to),a=n.charCategorizer(i.head),!Im(a,n,i.from,i.to)||!function(e,t,n,r){return e(t.sliceDoc(n,n+1))==tn.Word&&e(t.sliceDoc(r-1,r))==tn.Word}(a,n,i.from,i.to))return Xt.none}else if(o=n.sliceDoc(i.from,i.to),!o)return Xt.none}let s=[];for(let l of e.visibleRanges){let e=new wm(n.doc,o,l.from,l.to);for(;!e.next().done;){let{from:r,to:o}=e.value;if((!a||Im(a,n,r,o))&&(i.empty&&r<=i.from&&o>=i.to?s.push(Om.range(r,o)):(r>=i.to||o<=i.from)&&s.push(Lm.range(r,o)),s.length>t.maxMatches))return Xt.none}}return Xt.set(s)}},{decorations:e=>e.decorations}),Pm=Rt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Bm=Ut.define({combine:e=>Yt(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new uf(e),scrollToMatch:e=>Rt.scrollIntoView(e)})});class zm{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,km),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Fm(this):new Hm(this)}getCursor(e,t=0,n){let r=e.doc?e:qt.create({doc:e});return null==n&&(n=r.doc.length),this.regexp?qm(this,r,t,n):Nm(this,r,t,n)}}class Dm{constructor(e){this.spec=e}}function Nm(e,t,n,r){let o;return e.wholeWord&&(o=function(e,t){return(n,r,o,i)=>((i>n||i+o.length<r)&&(i=Math.max(0,n-2),o=e.sliceString(i,Math.min(e.length,r+2))),!(t(jm(o,n-i))==tn.Word&&t(Vm(o,n-i))==tn.Word||t(Vm(o,r-i))==tn.Word&&t(jm(o,r-i))==tn.Word))}(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(o=function(e,t,n){return(r,o,i,a)=>{if(n&&!n(r,o,i,a))return!1;let s=r>=a&&o<=a+i.length?i.slice(r-a,o-a):t.doc.sliceString(r,o);return e(s,t,r,o)}}(e.test,t,o)),new wm(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),o)}class Hm extends Dm{constructor(e){super(e)}nextMatch(e,t,n){let r=Nm(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=Nm(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),o=Nm(this.spec,e,n,r),i=null;for(;!o.nextOverlapping().done;)i=o.value;if(i)return i;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),!r||r.from==t&&r.to==n?null:r}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=Nm(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let o=Nm(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)r(o.value.from,o.value.to)}}function qm(e,t,n,r){let o;return e.wholeWord&&(o=function(e){return(t,n,r)=>!r[0].length||(e(jm(r.input,r.index))!=tn.Word||e(Vm(r.input,r.index))!=tn.Word)&&(e(Vm(r.input,r.index+r[0].length))!=tn.Word||e(jm(r.input,r.index+r[0].length))!=tn.Word)}(t.charCategorizer(t.selection.main.head))),e.test&&(o=function(e,t,n){return(r,o,i)=>(!n||n(r,o,i))&&e(i[0],t,r,o)}(e.test,t,o)),new Cm(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:o},n,r)}function jm(e,t){return e.slice(an(e,t,!1),t)}function Vm(e,t){return e.slice(t,an(e,t))}class Fm extends Dm{nextMatch(e,t,n){let r=qm(this.spec,e,n,e.doc.length).next();return r.done&&(r=qm(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let o=Math.max(t,n-1e4*r),i=qm(this.spec,e,o,n),a=null;for(;!i.next().done;)a=i.value;if(a&&(o==t||a.from>o+10))return a;if(o==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if("&"==n)return e.match[0];if("$"==n)return"$";for(let r=n.length;r>0;r--){let t=+n.slice(0,r);if(t>0&&t<e.match.length)return e.match[t]+n.slice(r)}return t})}matchAll(e,t){let n=qm(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let o=qm(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!o.next().done;)r(o.value.from,o.value.to)}}const $m=Ft.define(),Wm=Ft.define(),Um=Vt.define({create:e=>new Gm(of(e).create(),null),update(e,t){for(let n of t.effects)n.is($m)?e=new Gm(n.value.create(),e.panel):n.is(Wm)&&(e=new Gm(e.query,n.value?rf:null));return e},provide:e=>Kt.from(e,e=>e.panel)});class Gm{constructor(e,t){this.query=e,this.panel=t}}const Zm=Xt.mark({class:"cm-searchMatch"}),Xm=Xt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Km=jt.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Um))}update(e){let t=e.state.field(Um);(t!=e.startState.field(Um)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Xt.none;let{view:n}=this,r=new nn;for(let o=0,i=n.visibleRanges,a=i.length;o<a;o++){let{from:t,to:s}=i[o];for(;o<a-1&&s>i[o+1].from-500;)s=i[++o].to;e.highlight(n.state,t,s,(e,t)=>{let o=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,o?Xm:Zm)})}return r.finish()}},{decorations:e=>e.decorations});function Ym(e){return t=>{let n=t.state.field(Um,!1);return n&&n.query.spec.valid?e(t,n):lf(t)}}const Jm=Ym((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let o=Wt.single(r.from,r.to),i=e.state.facet(Bm);return e.dispatch({selection:o,effects:[ff(e,r),i.scrollToMatch(o.main,e)],userEvent:"select.search"}),sf(e),!0}),Qm=Ym((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,o=t.prevMatch(n,r,r);if(!o)return!1;let i=Wt.single(o.from,o.to),a=e.state.facet(Bm);return e.dispatch({selection:i,effects:[ff(e,o),a.scrollToMatch(i.main,e)],userEvent:"select.search"}),sf(e),!0}),ef=Ym((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!(!n||!n.length||(e.dispatch({selection:Wt.create(n.map(e=>Wt.range(e.from,e.to))),userEvent:"select.search.matches"}),0))}),tf=Ym((e,{query:t})=>{let{state:n}=e,{from:r,to:o}=n.selection.main;if(n.readOnly)return!1;let i=t.nextMatch(n,r,r);if(!i)return!1;let a,s,l=i,c=[],d=[];l.from==r&&l.to==o&&(s=n.toText(t.getReplacement(l)),c.push({from:l.from,to:l.to,insert:s}),l=t.nextMatch(n,l.from,l.to),d.push(Rt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let u=e.state.changes(c);return l&&(a=Wt.single(l.from,l.to).map(u),d.push(ff(e,l)),d.push(n.facet(Bm).scrollToMatch(a.main,e))),e.dispatch({changes:u,selection:a,effects:d,userEvent:"input.replace"}),!0}),nf=Ym((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Rt.announce.of(r),userEvent:"input.replace.all"}),!0});function rf(e){return e.state.facet(Bm).createPanel(e)}function of(e,t){var n,r,o,i,a;let s=e.selection.main,l=s.empty||s.to>s.from+100?"":e.sliceDoc(s.from,s.to);if(t&&!l)return t;let c=e.facet(Bm);return new zm({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(r=null==t?void 0:t.caseSensitive)&&void 0!==r?r:c.caseSensitive,literal:null!==(o=null==t?void 0:t.literal)&&void 0!==o?o:c.literal,regexp:null!==(i=null==t?void 0:t.regexp)&&void 0!==i?i:c.regexp,wholeWord:null!==(a=null==t?void 0:t.wholeWord)&&void 0!==a?a:c.wholeWord})}function af(e){let t=Gt(e,rf);return t&&t.dom.querySelector("[main-field]")}function sf(e){let t=af(e);t&&t==e.root.activeElement&&t.select()}const lf=e=>{let t=e.state.field(Um,!1);if(t&&t.panel){let n=af(e);if(n&&n!=e.root.activeElement){let r=of(e.state,t.query.spec);r.valid&&e.dispatch({effects:$m.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[Wm.of(!0),t?$m.of(of(e.state,t.query.spec)):Ft.appendConfig.of(vf)]});return!0},cf=e=>{let t=e.state.field(Um,!1);if(!t||!t.panel)return!1;let n=Gt(e,rf);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Wm.of(!1)}),!0},df=[{key:"Mod-f",run:lf,scope:"editor search-panel"},{key:"F3",run:Jm,shift:Qm,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Jm,shift:Qm,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:cf,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:o}=n.main,i=[],a=0;for(let s=new wm(e.doc,e.sliceDoc(r,o));!s.next().done;){if(i.length>1e3)return!1;s.value.from==r&&(a=i.length),i.push(Wt.range(s.value.from,s.value.to))}return t(e.update({selection:Wt.create(i,a),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:o}=Zt(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return o.then(n=>{let o=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!o)return void e.dispatch({effects:r});let i=t.doc.lineAt(t.selection.main.head),[,a,s,l,c]=o,d=l?+l.slice(1):0,u=s?+s:i.number;if(s&&c){let e=u/100;a&&(e=e*("-"==a?-1:1)+i.number/t.doc.lines),u=Math.round(t.doc.lines*e)}else s&&a&&(u=u*("-"==a?-1:1)+i.number);let h=t.doc.line(Math.max(1,Math.min(t.doc.lines,u))),p=Wt.cursor(h.from+Math.max(0,Math.min(d,h.length)));e.dispatch({effects:[r,Rt.scrollIntoView(p.from,{y:"center"})],selection:p})}),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return(({state:e,dispatch:t})=>{let{selection:n}=e,r=Wt.create(n.ranges.map(t=>e.wordAt(t.head)||Wt.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)})({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let o=function(e,t){let{main:n,ranges:r}=e.selection,o=e.wordAt(n.head),i=o&&o.from==n.from&&o.to==n.to;for(let a=!1,s=new wm(e.doc,t,r[r.length-1].to);;){if(s.next(),!s.done){if(a&&r.some(e=>e.from==s.value.from))continue;if(i){let t=e.wordAt(s.value.from);if(!t||t.from!=s.value.from||t.to!=s.value.to)continue}return s.value}if(a)return null;s=new wm(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),a=!0}}(e,r);return!!o&&(t(e.update({selection:e.selection.addRange(Wt.range(o.from,o.to),!1),effects:Rt.scrollIntoView(o.to)})),!0)},preventDefault:!0}];class uf{constructor(e){this.view=e;let t=this.query=e.state.field(Um).query.spec;function n(e,t,n){return rn("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=rn("input",{value:t.search,placeholder:hf(e,"Find"),"aria-label":hf(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=rn("input",{value:t.replace,placeholder:hf(e,"Replace"),"aria-label":hf(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=rn("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=rn("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=rn("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=rn("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>Jm(e),[hf(e,"next")]),n("prev",()=>Qm(e),[hf(e,"previous")]),n("select",()=>ef(e),[hf(e,"all")]),rn("label",null,[this.caseField,hf(e,"match case")]),rn("label",null,[this.reField,hf(e,"regexp")]),rn("label",null,[this.wordField,hf(e,"by word")]),...e.state.readOnly?[]:[rn("br"),this.replaceField,n("replace",()=>tf(e),[hf(e,"replace")]),n("replaceAll",()=>nf(e),[hf(e,"replace all")])],rn("button",{name:"close",onclick:()=>cf(e),"aria-label":hf(e,"close"),type:"button"},["×"])])}commit(){let e=new zm({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:$m.of(e)}))}keydown(e){on(this.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Qm:Jm)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),tf(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is($m)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Bm).top}}function hf(e,t){return e.state.phrase(t)}const pf=30,mf=/[\s\.,:;?!]/;function ff(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),o=e.state.doc.lineAt(n).to,i=Math.max(r.from,t-pf),a=Math.min(o,n+pf),s=e.state.sliceDoc(i,a);if(i!=r.from)for(let l=0;l<pf;l++)if(!mf.test(s[l+1])&&mf.test(s[l])){s=s.slice(l);break}if(a!=o)for(let l=s.length-1;l>s.length-pf;l--)if(!mf.test(s[l-1])&&mf.test(s[l])){s=s.slice(0,l);break}return Rt.announce.of(`${e.state.phrase("current match")}. ${s} ${e.state.phrase("on line")} ${r.number}.`)}const gf=Rt.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),vf=[Um,$t.low(Km),gf];class yf{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class bf{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=n.facet(Of).markerFilter;r&&(e=r(e,n));let o=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),i=new nn,a=[],s=0,l=n.doc.iter(),c=0,d=n.doc.length;for(let h=0;;){let e,t,n=h==o.length?null:o[h];if(!n&&!a.length)break;if(a.length)e=s,t=a.reduce((e,t)=>Math.min(e,t.to),n&&n.from>e?n.from:1e8);else{if(e=n.from,e>d)break;t=n.to,a.push(n),h++}for(;h<o.length;){let n=o[h];if(n.from!=e||!(n.to>n.from||n.to==e)){t=Math.min(n.from,t);break}a.push(n),h++,t=Math.min(n.to,t)}t=Math.min(t,d);let r=!1;if(a.some(n=>n.from==e&&(n.to==t||t==d))&&(r=e==t,!r&&t-e<10)){let n=e-(c+l.value.length);n>0&&(l.next(n),c=e);for(let o=e;;){if(o>=t){r=!0;break}if(!l.lineBreak&&c+l.value.length>o)break;o=c+l.value.length,c+=l.value.length,l.next()}}let u=jf(a);if(r)i.add(e,e,Xt.widget({widget:new Bf(u),diagnostics:a.slice()}));else{let n=a.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");i.add(e,t,Xt.mark({class:"cm-lintRange cm-lintRange-"+u+n,diagnostics:a.slice(),inclusiveEnd:a.some(e=>e.to>t)}))}if(s=t,s==d)break;for(let o=0;o<a.length;o++)a[o].to<=s&&a.splice(o--,1)}let u=i.finish();return new bf(u,t,wf(u))}}function wf(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:o})=>{if(!(t&&o.diagnostics.indexOf(t)<0))if(r){if(o.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new yf(r.from,n,r.diagnostic)}else r=new yf(e,n,t||o.diagnostics[0])}),r}function xf(e,t){return e.field(Sf,!1)?t:t.concat(Ft.appendConfig.of(Vf))}const kf=Ft.define(),Cf=Ft.define(),_f=Ft.define(),Sf=Vt.define({create:()=>new bf(Xt.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,o=e.panel;if(e.selected){let o=t.changes.mapPos(e.selected.from,1);r=wf(n,e.selected.diagnostic,o)||wf(n,null,o)}!n.size&&o&&t.state.facet(Of).autoPanel&&(o=null),e=new bf(n,o,r)}for(let n of t.effects)if(n.is(kf)){let r=t.state.facet(Of).autoPanel?n.value.length?Df.open:null:e.panel;e=bf.init(n.value,r,t.state)}else n.is(Cf)?e=new bf(e.diagnostics,n.value?Df.open:null,e.selected):n.is(_f)&&(e=new bf(e.diagnostics,e.panel,n.value));return e},provide:e=>[Kt.from(e,e=>e.panel),Rt.decorations.from(e,e=>e.diagnostics)]}),Af=Xt.mark({class:"cm-lintRange cm-lintRange-active"});function Mf(e,t,n){let r,{diagnostics:o}=e.state.field(Sf),i=-1,a=-1;o.between(t-(n<0?1:0),t+(n>0?1:0),(e,o,{spec:s})=>{if(t>=e&&t<=o&&(e==o||(t>e||n>0)&&(t<o||n<0)))return r=s.diagnostics,i=e,a=o,!1});let s=e.state.facet(Of).tooltipFilter;return r&&s&&(r=s(r,e.state)),r?{pos:i,end:a,above:e.state.doc.lineAt(i).to<a,create:()=>({dom:Tf(e,r)})}:null}function Tf(e,t){return rn("ul",{class:"cm-tooltip-lint"},t.map(t=>Pf(e,t,!1)))}const Ef=e=>{let t=e.state.field(Sf,!1);return!(!t||!t.panel||(e.dispatch({effects:Cf.of(!1)}),0))},Lf=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(Sf,!1);t&&t.panel||e.dispatch({effects:xf(e.state,[Cf.of(!0)])});let n=Gt(e,Df.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(Sf,!1);if(!t)return!1;let n=e.state.selection.main,r=wf(t.diagnostics,null,n.to+1);return!(!r&&(r=wf(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)||(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),0))}}],Of=Ut.define({combine:e=>({sources:e.map(e=>e.source).filter(e=>null!=e),...Yt(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:If,tooltipFilter:If,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,o)=>e(n,r,o)||t(n,r,o):e:t,autoPanel:(e,t)=>e||t})})});function If(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function Rf(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue e}}t.push("")}return t}function Pf(e,t,n){var r;let o=n?Rf(t.actions):[];return rn("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},rn("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null===(r=t.actions)||void 0===r?void 0:r.map((n,r)=>{let i=!1,a=r=>{if(r.preventDefault(),i)return;i=!0;let o=wf(e.state.field(Sf).diagnostics,t);o&&n.apply(e,o.from,o.to)},{name:s}=n,l=o[r]?s.indexOf(o[r]):-1,c=l<0?s:[s.slice(0,l),rn("u",s.slice(l,l+1)),s.slice(l+1)],d=n.markClass?" "+n.markClass:"";return rn("button",{type:"button",class:"cm-diagnosticAction"+d,onclick:a,onmousedown:a,"aria-label":` Action: ${s}${l<0?"":` (access key "${o[r]})"`}.`},c)}),t.source&&rn("div",{class:"cm-diagnosticSource"},t.source))}class Bf extends ln{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return rn("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class zf{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=Pf(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Df{constructor(e){this.view=e,this.items=[],this.list=rn("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(27==t.keyCode)Ef(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:n}=this.items[this.selectedIndex],r=Rf(n.actions);for(let o=0;o<r.length;o++)if(r[o].toUpperCase().charCodeAt(0)==t.keyCode){let t=wf(this.view.state.field(Sf).diagnostics,n);t&&n.actions[o].apply(e,t.from,t.to)}}}t.preventDefault()}},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=rn("div",{class:"cm-panel-lint"},this.list,rn("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Ef(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Sf).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Sf),n=0,r=!1,o=null,i=new Set;for(e.between(0,this.view.state.doc.length,(e,a,{spec:s})=>{for(let l of s.diagnostics){if(i.has(l))continue;i.add(l);let e,a=-1;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==l){a=t;break}a<0?(e=new zf(this.view,l),this.items.splice(n,0,e),r=!0):(e=this.items[a],a>n&&(this.items.splice(n,a-n),r=!0)),t&&e.diagnostic==t.diagnostic?e.dom.hasAttribute("aria-selected")||(e.dom.setAttribute("aria-selected","true"),o=e):e.dom.hasAttribute("aria-selected")&&e.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();0==this.items.length&&(this.items.push(new zf(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),o?(this.list.setAttribute("aria-activedescendant",o.id),this.view.requestMeasure({key:this,read:()=>({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=wf(this.view.state.field(Sf).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:_f.of(t)})}static open(e){return new Df(e)}}function Nf(e){return function(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const Hf=Rt.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Nf("#d11")},".cm-lintRange-warning":{backgroundImage:Nf("orange")},".cm-lintRange-info":{backgroundImage:Nf("#999")},".cm-lintRange-hint":{backgroundImage:Nf("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function qf(e){return"error"==e?4:"warning"==e?3:"info"==e?2:1}function jf(e){let t="hint",n=1;for(let r of e){let e=qf(r.severity);e>n&&(n=e,t=r.severity)}return t}const Vf=[Sf,Rt.decorations.compute([Sf],e=>{let{selected:t,panel:n}=e.field(Sf);return t&&n&&t.from!=t.to?Xt.set([Af.range(t.from,t.to)]):Xt.none}),sn(Mf,{hideOn:function(e,t){let n=t.pos,r=t.end||n,o=e.state.facet(Of).hideOn(e,n,r);if(null!=o)return o;let i=e.startState.doc.lineAt(t.pos);return!(!e.effects.some(e=>e.is(kf))&&!e.changes.touchesRange(i.from,Math.max(i.to,r)))}}),Hf],Ff=(()=>[cn(),dn(),un(),hn(),pn(),Nt(),mn(),qt.allowMultipleSelections.of(!0),fn(),Pt(wn,{fallback:!0}),gn(),An(),Mn(),vn(),yn(),bn(),[Pm,Rm],Ht.of([...Tn,...xn,...df,...kn,...Cn,...En,...Lf])])();function $f(e){return function(e){return 1===e.nodeType}(e)&&"http://www.w3.org/1999/xhtml"===e.namespaceURI}function Wf(e,t){return Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1])}function Uf(e,t){return Math.min(Wf(e,[t[0],t[1]]),Wf(e,[t[2],t[3]]))}class Gf extends z{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return Gf.valid(n)?new Gf(n):z.near(n)}content(){return p.empty}eq(e){return e instanceof Gf&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new Gf(e.resolve(t.pos))}getBookmark(){return new Zf(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||Xf(e.type))return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||Xf(e.type))return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&Gf.valid(e))return e;let r=e.pos,o=null;for(let n=e.depth;;n--){let i=e.node(n);if(t>0?e.indexAfter(n)<i.childCount:e.index(n)>0){o=i.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let a=e.doc.resolve(r);if(Gf.valid(a))return a}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!M.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*t),n=!1;continue e}break}o=i,r+=t;let a=e.doc.resolve(r);if(Gf.valid(a))return a}return null}}}Gf.prototype.visible=!1,Gf.findFrom=Gf.findGapCursorFrom,z.jsonID("gapcursor",Gf);class Zf{constructor(e){this.pos=e}map(e){return new Zf(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Gf.valid(t)?new Gf(t):z.near(t)}}function Xf(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}const Kf=B({ArrowLeft:Yf("horiz",-1),ArrowRight:Yf("horiz",1),ArrowUp:Yf("vert",-1),ArrowDown:Yf("vert",1)});function Yf(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){let i=e.selection,a=t>0?i.$to:i.$from,s=i.empty;if(i instanceof S){if(!o.endOfTextblock(n)||0==a.depth)return!1;s=!1,a=e.doc.resolve(t>0?a.after():a.before())}let l=Gf.findGapCursorFrom(a,t,s);return!!l&&(r&&r(e.tr.setSelection(new Gf(l))),!0)}}function Jf(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Gf.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&M.isSelectable(e.state.doc.nodeAt(o.inside))||(e.dispatch(e.state.tr.setSelection(new Gf(r))),0))}function Qf(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof Gf))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=m.empty;for(let a=r.length-1;a>=0;a--)o=m.from(r[a].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new p(o,0,0));return i.setSelection(S.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function eg(e){if(!(e.selection instanceof Gf))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",f.create(e.doc,[v.widget(e.selection.head,t,{key:"gapcursor"})])}function tg(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-cursor",...t}}),e}var ng=a(null,"dropIndicatorState");tg(ng,{displayName:"Ctx<dropIndicatorState>"});var rg=a({width:2,color:!1,class:"milkdown-drop-indicator"},"dropIndicatorConfig");tg(rg,{displayName:"Ctx<dropIndicatorConfig>"});var og=new d("MILKDOWN_DROP_INDICATOR_DOM"),ig=s(e=>new c({key:og,view:t=>{const n=e.get(rg.key),r=document.createElement("div");Object.assign(r.style,{position:"fixed",pointerEvents:"none",display:"none",backgroundColor:n.color,top:"0",left:"0"}),r.classList.add(n.class),r.classList.add("milkdown-drop-indicator"),t.dom.parentNode?.appendChild(r);const o=e.use(ng.key),i=e=>{!function(e,t,n){if(!t)return void Object.assign(e.style,{display:"none"});const{line:r}=t,{width:o}=n,{p1:{x:i,y:a},p2:{x:s,y:l}}=r;let c,d,u=a,h=i;a===l?(c=s-i,d=o,u-=o/2):(c=o,d=l-a,h-=o/2),u=Math.round(u),h=Math.round(h),Object.assign(e.style,{display:"block",width:`${c}px`,height:`${d}px`,transform:`translate(${h}px, ${u}px)`})}(r,e,n)};return o.on(i),{destroy:()=>{o.off(i),r.remove()}}}}));tg(ig,{displayName:"Prose<dropIndicatorDOM>"});var ag=s(e=>function(e){let t;return new c({key:new d("prosekit-drop-indicator"),view:n=>(t=function(e,t){let n,r,o,i,a=[];return(s,l)=>(o&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(o,s)||(o=s,i=((o,i)=>{if(!e.editable||e.isDestroyed)return;let s=(()=>{const t=e.dom.getBoundingClientRect(),o=e.state.doc;return a&&n&&r&&t.width===r.width&&t.height===r.height&&t.x===r.x&&t.y===r.y&&n.eq(o)||(r=t,n=o,a=function(e){let t=[[-1,e.state.doc]],n=[];for(;t.length>0;){const[r,o]=t.pop();if(r>=0){let t=e.nodeDOM(r);if(t&&$f(t)){let{top:e,bottom:i,left:a,right:s}=t.getBoundingClientRect();n.push([r,[a,e,s,e]],[r+o.nodeSize,[a,i,s,i]])}}if(o.isBlock&&!o.isTextblock){let e=r+1;for(let n of o.children)t.push([e,n]),e+=n.nodeSize}}return n}(e)),a})();s.sort((e,t)=>{const[n,r]=e,[i,a]=t;return Uf(o,r)-Uf(o,a)||n-i}),s=s.slice(0,8);const l=s.find(n=>!1!==t?.({view:e,pos:n[0],event:i}));return l&&function(e,t){const n=e.dragging;if(!n)return;const{move:r}=n;if(!r)return;const o=e.state.selection;if(!(o instanceof M))return;const{from:i,to:a}=o;return i<=t&&t<=a}(e,l[0])?void 0:l})(s,l)),i)}(n,e.onDrag),function(e,t,n){let r,o,i,a=e.dom,s=!1;const l=()=>{r&&clearTimeout(r),s=!1,r=setTimeout(()=>{s||n.onHide?.()},30)},c=r=>{s=!0;const{clientX:a,clientY:c}=r;if(o===a&&i===c)return;o=a,i=c;let d=t([a,c],r);if(d){const[t,[r,o,i,a]]=d,s={p1:{x:r,y:o},p2:{x:i,y:a}};n.onShow?.({view:e,pos:t,line:s})}else l()};return a.addEventListener("dragover",c),a.addEventListener("dragend",l),a.addEventListener("drop",l),a.addEventListener("dragleave",l),{destroy:()=>{a.removeEventListener("dragover",c),a.removeEventListener("dragend",l),a.removeEventListener("drop",l),a.removeEventListener("dragleave",l)}}}(n,t,e)),props:{handleDrop(e,n,r,o){if(!t)return!1;const i=t([n.clientX,n.clientY],n);if(!i)return!1;n.preventDefault();let a=i[0],s=e.state.tr;if(o){let{node:t}=e.dragging||{};t?t.replace(s):s.deleteSelection()}let l=s.mapping.map(a),c=0==r.openStart&&0==r.openEnd&&1==r.content.childCount,d=s.doc;if(c?s.replaceRangeWith(l,l,r.content.firstChild):s.replaceRange(l,l,r),s.doc.eq(d))return!0;let u=s.doc.resolve(l);if(c&&M.isSelectable(r.content.firstChild)&&u.nodeAfter&&u.nodeAfter.sameMarkup(r.content.firstChild))s.setSelection(new M(u));else{let t=s.mapping.map(a);s.mapping.maps[s.mapping.maps.length-1].forEach((e,n,r,o)=>t=o),s.setSelection(function(e,t,n){return e.someProp("createSelectionBetween",r=>r(e,t,n))||S.between(t,n,void 0)}(e,u,s.doc.resolve(t)))}return e.focus(),e.dispatch(s.setMeta("uiEvent","drop")),!0}}})}({onShow:t=>{e.set(ng.key,t)},onHide:()=>{e.set(ng.key,null)},onDrag:()=>!0}));tg(ag,{displayName:"Prose<dropIndicator>"});var sg=s(()=>new c({props:{decorations:eg,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&Gf.valid(n)?new Gf(n):null,handleClick:Jf,handleKeyDown:Kf,handleDOMEvents:{beforeinput:Qf}}}));tg(sg,{displayName:"Prose<gapCursor>"});var lg=[sg,rg,ng,ig,ag].flat(),cg=new d("prosemirror-virtual-cursor");function dg(e){const t=e.index(),n=e.parent.maybeChild(t);let r=e.textOffset?n:null;return!r&&t>0&&(r=e.parent.maybeChild(t-1)),[null==r?void 0:r.marks,null==n?void 0:n.marks]}function ug(e){return e&&"object"==typeof e&&"$cursor"in e}var hg=Object.defineProperty,pg=Object.getOwnPropertySymbols,mg=Object.prototype.hasOwnProperty,fg=Object.prototype.propertyIsEnumerable,gg=(e,t,n)=>t in e?hg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vg=(e,t)=>{for(var n in t||(t={}))mg.call(t,n)&&gg(e,n,t[n]);if(pg)for(var n of pg(t))fg.call(t,n)&&gg(e,n,t[n]);return e};function yg(e,t){return Object.assign(e,{meta:vg({package:"@milkdown/components"},t)}),e}const bg=a({imageIcon:"🌌",uploadButton:"Upload",confirmButton:"⏎",uploadPlaceholderText:"/Paste",onUpload:e=>Promise.resolve(URL.createObjectURL(e))},"inlineImageConfigCtx");function wg({icon:e,class:t,onClick:n}){return pd("span",{class:Ln("milkdown-icon",t),onPointerdown:n,innerHTML:e?Sn.sanitize(e.trim()):void 0})}yg(bg,{displayName:"Config<image-inline>",group:"ImageInline"}),wg.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const xg=eu("abcdefg",8),kg=ml({props:{src:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setLink:{type:Function,required:!0},imageIcon:{type:String,required:!1},uploadButton:{type:String,required:!1},confirmButton:{type:String,required:!1},uploadPlaceholderText:{type:String,required:!1},onUpload:{type:Function,required:!0},onImageLoadError:{type:Function,required:!1}},setup({readonly:e,src:t,setLink:n,onUpload:r,imageIcon:o,uploadButton:i,confirmButton:a,uploadPlaceholderText:s,className:l,onImageLoadError:c}){var d,u;const h=gs(!1),p=gs(),m=gs(null!=(d=t.value)?d:""),f=gs(xg()),g=gs(0!==(null==(u=t.value)?void 0:u.length)),v=e=>{const t=e.target.value;g.value=0!==t.length,m.value=t},y=e=>{var t,r;"Enter"===e.key&&n(null!=(r=null==(t=p.value)?void 0:t.value)?r:"")},b=e=>{var t;const o=null==(t=e.target.files)?void 0:t[0];o&&r(o).then(e=>{e&&(n(e),g.value=!0)}).catch(e=>{console.error("An error occurred while uploading image"),console.error(e)})};return()=>pd("div",{class:Ln("image-edit",l)},pd(wg,{icon:o,class:"image-icon"}),pd("div",{class:Ln("link-importer",h.value&&"focus")},pd("input",{ref:p,draggable:"true",onDragstart:e=>{e.preventDefault(),e.stopPropagation()},disabled:e.value,class:"link-input-area",value:m.value,onInput:v,onKeydown:y,onFocus:()=>h.value=!0,onBlur:()=>h.value=!1}),!g.value&&pd("div",{class:"placeholder"},pd("input",{disabled:e.value,class:"hidden",id:f.value,type:"file",accept:"image/*",onChange:b}),pd("label",{class:"uploader",for:f.value},pd(wg,{icon:i})),pd("span",{class:"text",onClick:()=>{var e;return null==(e=p.value)?void 0:e.focus()}},s))),m.value&&pd(Dc,null,pd("div",{class:"image-preview"},pd("img",{src:m.value,alt:"",onError:e=>Promise.resolve(null==c?void 0:c(e)).catch(()=>{})})),pd("div",{class:"confirm",onClick:()=>(()=>{var e,t;n(null!=(t=null==(e=p.value)?void 0:e.value)?t:"")})()},pd(wg,{icon:a}))))}}),Cg=ml({props:{src:{type:Object,required:!0},alt:{type:Object,required:!0},title:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup(e){const{src:t,alt:n,title:r}=e;return()=>{var o;return(null==(o=t.value)?void 0:o.length)?pd("img",{class:"image-inline",src:t.value,alt:n.value,title:r.value}):pd(kg,{src:e.src,selected:e.selected,readonly:e.readonly,setLink:t=>e.setAttr("src",t),imageIcon:e.config.imageIcon,uploadButton:e.config.uploadButton,confirmButton:e.config.confirmButton,uploadPlaceholderText:e.config.uploadPlaceholderText,onUpload:e.config.onUpload,className:"empty-image-inline"})}}}),_g=R(re.node,e=>(t,n,r)=>{const o=gs(t.attrs.src),i=gs(t.attrs.alt),a=gs(t.attrs.title),s=gs(!1),l=gs(!n.editable),c=e.get(bg.key),d=qd(Cg,{src:o,alt:i,title:a,selected:s,readonly:l,setAttr:(e,t)=>{if(!n.editable)return;const o=r();null!=o&&n.dispatch(n.state.tr.setNodeAttribute(o,e,"src"===e?Sn.sanitize(t):t))},config:c}),u=document.createElement("span");u.className="milkdown-image-inline";const h=al(()=>{s.value?u.classList.add("selected"):u.classList.remove("selected")}),p=c.proxyDomURL,m=e=>{if(p){const t=p(e.attrs.src);"string"==typeof t?o.value=t:t.then(e=>{o.value=e}).catch(console.error)}else o.value=e.attrs.src;i.value=e.attrs.alt,a.value=e.attrs.title};return m(t),d.mount(u),{dom:u,update:e=>e.type===t.type&&(m(e),!0),stopEvent:e=>e.target instanceof HTMLInputElement,selectNode:()=>{s.value=!0},deselectNode:()=>{s.value=!1},destroy:()=>{h(),d.unmount(),u.remove()}}});yg(_g,{displayName:"NodeView<image-inline>",group:"ImageInline"});const Sg=[bg,_g];class Ag extends Error{constructor(e,t){var n,r,o="KaTeX parse error: "+e,i=t&&t.loc;if(i&&i.start<=i.end){var a=i.lexer.input;n=i.start,r=i.end,n===a.length?o+=" at end of input: ":o+=" at position "+(n+1)+": ";var s=a.slice(n,r).replace(/[^]/g,"$&̲");o+=(n>15?"…"+a.slice(n-15,n):a.slice(0,n))+s+(r+15<a.length?a.slice(r,r+15)+"…":a.slice(r))}super(o),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,Ag.prototype),this.position=n,null!=n&&null!=r&&(this.length=r-n),this.rawMessage=e}}var Mg=/([A-Z])/g,Tg=e=>e.replace(Mg,"-$1").toLowerCase(),Eg={"&":"&",">":">","<":"<",'"':""","'":"'"},Lg=/[&><"']/g,Og=e=>String(e).replace(Lg,e=>Eg[e]),Ig=e=>"ordgroup"===e.type||"color"===e.type?1===e.body.length?Ig(e.body[0]):e:"font"===e.type?Ig(e.body):e,Rg=new Set(["mathord","textord","atom"]),Pg=e=>Rg.has(Ig(e).type),Bg={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function zg(e,t,n,r){var o=n[t];e[t]=void 0!==o?r.processor?r.processor(o):o:function(e){return void 0!==e.default?e.default:function(e){if("string"!=typeof e)return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}(Array.isArray(e.type)?e.type[0]:e.type)}(r)}class Dg{constructor(e){for(var t of(void 0===e&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},Object.keys(Bg))){var n=Bg[t];n&&zg(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if("function"==typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new Ag("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===r?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var r=this.strict;if("function"==typeof r)try{r=r(e,t,n)}catch(o){r="error"}return!(!r||"ignore"===r||!0!==r&&"error"!==r&&("warn"===r?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]"),1)))}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var t=(e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"})(e.url);if(null==t)return!1;e.protocol=t}var n="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(n)}}class Ng{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Hg[qg[this.id]]}sub(){return Hg[jg[this.id]]}fracNum(){return Hg[Vg[this.id]]}fracDen(){return Hg[Fg[this.id]]}cramp(){return Hg[$g[this.id]]}text(){return Hg[Wg[this.id]]}isTight(){return this.size>=2}}var Hg=[new Ng(0,0,!1),new Ng(1,0,!0),new Ng(2,1,!1),new Ng(3,1,!0),new Ng(4,2,!1),new Ng(5,2,!0),new Ng(6,3,!1),new Ng(7,3,!0)],qg=[4,5,4,5,6,7,6,7],jg=[5,5,5,5,7,7,7,7],Vg=[2,3,4,5,6,7,6,7],Fg=[3,3,5,5,7,7,7,7],$g=[1,1,3,3,5,5,7,7],Wg=[0,1,2,3,2,3,2,3],Ug={DISPLAY:Hg[0],TEXT:Hg[2],SCRIPT:Hg[4],SCRIPTSCRIPT:Hg[6]},Gg=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}],Zg=[];function Xg(e){for(var t=0;t<Zg.length;t+=2)if(e>=Zg[t]&&e<=Zg[t+1])return!0;return!1}Gg.forEach(e=>e.blocks.forEach(e=>Zg.push(...e)));var Kg=e=>e+" "+e,Yg=80,Jg={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:Kg("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Kg("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Kg("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Kg("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:Kg("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:Kg("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Kg("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Kg("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class Qg{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(function(e){return"toText"in e}(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var ev={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},tv={ex:!0,em:!0,mu:!0},nv=function(e){return"string"!=typeof e&&(e=e.unit),e in ev||e in tv||"ex"===e},rv=function(e,t){var n;if(e.unit in ev)n=ev[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{var r;if(r=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=r.fontMetrics().xHeight;else{if("em"!==e.unit)throw new Ag("Invalid unit: '"+e.unit+"'");n=r.fontMetrics().quad}r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},ov=function(e){return+e.toFixed(4)+"em"},iv=function(e){return e.filter(e=>e).join(" ")},av=function(e){var t="";for(var n of Object.keys(e)){var r=e[n];void 0!==r&&(t+=Tg(n)+":"+r+";")}return t},sv=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var r=t.getColor();r&&(this.style.color=r)}},lv=function(e){var t=document.createElement(e);for(var n of(t.className=iv(this.classes),Object.assign(t.style,this.style),Object.keys(this.attributes)))t.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},cv=/[\s"'>/=\x00-\x1f]/,dv=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+Og(iv(this.classes))+'"');var n=av(this.style);for(var r of(n&&(t+=' style="'+Og(n)+'"'),Object.keys(this.attributes))){if(cv.test(r))throw new Ag("Invalid attribute name '"+r+"'");t+=" "+r+'="'+Og(this.attributes[r])+'"'}t+=">";for(var o=0;o<this.children.length;o++)t+=this.children[o].toMarkup();return t+"</"+e+">"};class uv{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,sv.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return lv.call(this,"span")}toMarkup(){return dv.call(this,"span")}}class hv{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,sv.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return lv.call(this,"a")}toMarkup(){return dv.call(this,"a")}}class pv{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e='<img src="'+Og(this.src)+'" alt="'+Og(this.alt)+'"',t=av(this.style);return t&&(e+=' style="'+Og(t)+'"'),e+"'/>"}}var mv={"î":"ı̂","ï":"ı̈","í":"ı́","ì":"ı̀"};class fv{constructor(e,t,n,r,o,i,a,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=o||0,this.width=i||0,this.classes=a||[],this.style=s||{},this.maxFontSize=0;var l=function(e){for(var t=0;t<Gg.length;t++)for(var n=Gg[t],r=0;r<n.blocks.length;r++){var o=n.blocks[r];if(e>=o[0]&&e<=o[1])return n.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=mv[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&((t=document.createElement("span")).style.marginRight=ov(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=iv(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=Og(iv(this.classes)),t+='"');var n="";this.italic>0&&(n+="margin-right:"+ov(this.italic)+";"),(n+=av(this.style))&&(e=!0,t+=' style="'+Og(n)+'"');var r=Og(this.text);return e?(t+=">",t+=r,t+="</span>"):r}}class gv{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t of Object.keys(this.attributes))e+=" "+t+'="'+Og(this.attributes[t])+'"';e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+"</svg>"}}class vv{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",Jg[this.pathName]),e}toMarkup(){return this.alternate?'<path d="'+Og(this.alternate)+'"/>':'<path d="'+Og(Jg[this.pathName])+'"/>'}}class yv{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t of Object.keys(this.attributes))e+=" "+t+'="'+Og(this.attributes[t])+'"';return e+"/>"}}var bv={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},wv={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},xv={"Å":"A","Ð":"D","Þ":"o","å":"a","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function kv(e,t,n){if(!bv[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),o=bv[t][r];if(!o&&e[0]in xv&&(r=xv[e[0]].charCodeAt(0),o=bv[t][r]),o||"text"!==n||Xg(r)&&(o=bv[t][77]),o)return{depth:o[0],height:o[1],italic:o[2],skew:o[3],width:o[4]}}var Cv={},_v={math:{},text:{}};function Sv(e,t,n,r,o,i){_v[e][o]={font:t,group:n,replace:r},i&&r&&(_v[e][r]=_v[e][o])}var Av="math",Mv="text",Tv="main",Ev="ams",Lv="accent-token",Ov="bin",Iv="close",Rv="inner",Pv="mathord",Bv="op-token",zv="open",Dv="punct",Nv="rel",Hv="spacing",qv="textord";Sv(Av,Tv,Nv,"≡","\\equiv",!0),Sv(Av,Tv,Nv,"≺","\\prec",!0),Sv(Av,Tv,Nv,"≻","\\succ",!0),Sv(Av,Tv,Nv,"∼","\\sim",!0),Sv(Av,Tv,Nv,"⊥","\\perp"),Sv(Av,Tv,Nv,"⪯","\\preceq",!0),Sv(Av,Tv,Nv,"⪰","\\succeq",!0),Sv(Av,Tv,Nv,"≃","\\simeq",!0),Sv(Av,Tv,Nv,"∣","\\mid",!0),Sv(Av,Tv,Nv,"≪","\\ll",!0),Sv(Av,Tv,Nv,"≫","\\gg",!0),Sv(Av,Tv,Nv,"≍","\\asymp",!0),Sv(Av,Tv,Nv,"∥","\\parallel"),Sv(Av,Tv,Nv,"⋈","\\bowtie",!0),Sv(Av,Tv,Nv,"⌣","\\smile",!0),Sv(Av,Tv,Nv,"⊑","\\sqsubseteq",!0),Sv(Av,Tv,Nv,"⊒","\\sqsupseteq",!0),Sv(Av,Tv,Nv,"≐","\\doteq",!0),Sv(Av,Tv,Nv,"⌢","\\frown",!0),Sv(Av,Tv,Nv,"∋","\\ni",!0),Sv(Av,Tv,Nv,"∝","\\propto",!0),Sv(Av,Tv,Nv,"⊢","\\vdash",!0),Sv(Av,Tv,Nv,"⊣","\\dashv",!0),Sv(Av,Tv,Nv,"∋","\\owns"),Sv(Av,Tv,Dv,".","\\ldotp"),Sv(Av,Tv,Dv,"⋅","\\cdotp"),Sv(Av,Tv,Dv,"⋅","·"),Sv(Mv,Tv,qv,"⋅","·"),Sv(Av,Tv,qv,"#","\\#"),Sv(Mv,Tv,qv,"#","\\#"),Sv(Av,Tv,qv,"&","\\&"),Sv(Mv,Tv,qv,"&","\\&"),Sv(Av,Tv,qv,"ℵ","\\aleph",!0),Sv(Av,Tv,qv,"∀","\\forall",!0),Sv(Av,Tv,qv,"ℏ","\\hbar",!0),Sv(Av,Tv,qv,"∃","\\exists",!0),Sv(Av,Tv,qv,"∇","\\nabla",!0),Sv(Av,Tv,qv,"♭","\\flat",!0),Sv(Av,Tv,qv,"ℓ","\\ell",!0),Sv(Av,Tv,qv,"♮","\\natural",!0),Sv(Av,Tv,qv,"♣","\\clubsuit",!0),Sv(Av,Tv,qv,"℘","\\wp",!0),Sv(Av,Tv,qv,"♯","\\sharp",!0),Sv(Av,Tv,qv,"♢","\\diamondsuit",!0),Sv(Av,Tv,qv,"ℜ","\\Re",!0),Sv(Av,Tv,qv,"♡","\\heartsuit",!0),Sv(Av,Tv,qv,"ℑ","\\Im",!0),Sv(Av,Tv,qv,"♠","\\spadesuit",!0),Sv(Av,Tv,qv,"§","\\S",!0),Sv(Mv,Tv,qv,"§","\\S"),Sv(Av,Tv,qv,"¶","\\P",!0),Sv(Mv,Tv,qv,"¶","\\P"),Sv(Av,Tv,qv,"†","\\dag"),Sv(Mv,Tv,qv,"†","\\dag"),Sv(Mv,Tv,qv,"†","\\textdagger"),Sv(Av,Tv,qv,"‡","\\ddag"),Sv(Mv,Tv,qv,"‡","\\ddag"),Sv(Mv,Tv,qv,"‡","\\textdaggerdbl"),Sv(Av,Tv,Iv,"⎱","\\rmoustache",!0),Sv(Av,Tv,zv,"⎰","\\lmoustache",!0),Sv(Av,Tv,Iv,"⟯","\\rgroup",!0),Sv(Av,Tv,zv,"⟮","\\lgroup",!0),Sv(Av,Tv,Ov,"∓","\\mp",!0),Sv(Av,Tv,Ov,"⊖","\\ominus",!0),Sv(Av,Tv,Ov,"⊎","\\uplus",!0),Sv(Av,Tv,Ov,"⊓","\\sqcap",!0),Sv(Av,Tv,Ov,"∗","\\ast"),Sv(Av,Tv,Ov,"⊔","\\sqcup",!0),Sv(Av,Tv,Ov,"◯","\\bigcirc",!0),Sv(Av,Tv,Ov,"∙","\\bullet",!0),Sv(Av,Tv,Ov,"‡","\\ddagger"),Sv(Av,Tv,Ov,"≀","\\wr",!0),Sv(Av,Tv,Ov,"⨿","\\amalg"),Sv(Av,Tv,Ov,"&","\\And"),Sv(Av,Tv,Nv,"⟵","\\longleftarrow",!0),Sv(Av,Tv,Nv,"⇐","\\Leftarrow",!0),Sv(Av,Tv,Nv,"⟸","\\Longleftarrow",!0),Sv(Av,Tv,Nv,"⟶","\\longrightarrow",!0),Sv(Av,Tv,Nv,"⇒","\\Rightarrow",!0),Sv(Av,Tv,Nv,"⟹","\\Longrightarrow",!0),Sv(Av,Tv,Nv,"↔","\\leftrightarrow",!0),Sv(Av,Tv,Nv,"⟷","\\longleftrightarrow",!0),Sv(Av,Tv,Nv,"⇔","\\Leftrightarrow",!0),Sv(Av,Tv,Nv,"⟺","\\Longleftrightarrow",!0),Sv(Av,Tv,Nv,"↦","\\mapsto",!0),Sv(Av,Tv,Nv,"⟼","\\longmapsto",!0),Sv(Av,Tv,Nv,"↗","\\nearrow",!0),Sv(Av,Tv,Nv,"↩","\\hookleftarrow",!0),Sv(Av,Tv,Nv,"↪","\\hookrightarrow",!0),Sv(Av,Tv,Nv,"↘","\\searrow",!0),Sv(Av,Tv,Nv,"↼","\\leftharpoonup",!0),Sv(Av,Tv,Nv,"⇀","\\rightharpoonup",!0),Sv(Av,Tv,Nv,"↙","\\swarrow",!0),Sv(Av,Tv,Nv,"↽","\\leftharpoondown",!0),Sv(Av,Tv,Nv,"⇁","\\rightharpoondown",!0),Sv(Av,Tv,Nv,"↖","\\nwarrow",!0),Sv(Av,Tv,Nv,"⇌","\\rightleftharpoons",!0),Sv(Av,Ev,Nv,"≮","\\nless",!0),Sv(Av,Ev,Nv,"","\\@nleqslant"),Sv(Av,Ev,Nv,"","\\@nleqq"),Sv(Av,Ev,Nv,"⪇","\\lneq",!0),Sv(Av,Ev,Nv,"≨","\\lneqq",!0),Sv(Av,Ev,Nv,"","\\@lvertneqq"),Sv(Av,Ev,Nv,"⋦","\\lnsim",!0),Sv(Av,Ev,Nv,"⪉","\\lnapprox",!0),Sv(Av,Ev,Nv,"⊀","\\nprec",!0),Sv(Av,Ev,Nv,"⋠","\\npreceq",!0),Sv(Av,Ev,Nv,"⋨","\\precnsim",!0),Sv(Av,Ev,Nv,"⪹","\\precnapprox",!0),Sv(Av,Ev,Nv,"≁","\\nsim",!0),Sv(Av,Ev,Nv,"","\\@nshortmid"),Sv(Av,Ev,Nv,"∤","\\nmid",!0),Sv(Av,Ev,Nv,"⊬","\\nvdash",!0),Sv(Av,Ev,Nv,"⊭","\\nvDash",!0),Sv(Av,Ev,Nv,"⋪","\\ntriangleleft"),Sv(Av,Ev,Nv,"⋬","\\ntrianglelefteq",!0),Sv(Av,Ev,Nv,"⊊","\\subsetneq",!0),Sv(Av,Ev,Nv,"","\\@varsubsetneq"),Sv(Av,Ev,Nv,"⫋","\\subsetneqq",!0),Sv(Av,Ev,Nv,"","\\@varsubsetneqq"),Sv(Av,Ev,Nv,"≯","\\ngtr",!0),Sv(Av,Ev,Nv,"","\\@ngeqslant"),Sv(Av,Ev,Nv,"","\\@ngeqq"),Sv(Av,Ev,Nv,"⪈","\\gneq",!0),Sv(Av,Ev,Nv,"≩","\\gneqq",!0),Sv(Av,Ev,Nv,"","\\@gvertneqq"),Sv(Av,Ev,Nv,"⋧","\\gnsim",!0),Sv(Av,Ev,Nv,"⪊","\\gnapprox",!0),Sv(Av,Ev,Nv,"⊁","\\nsucc",!0),Sv(Av,Ev,Nv,"⋡","\\nsucceq",!0),Sv(Av,Ev,Nv,"⋩","\\succnsim",!0),Sv(Av,Ev,Nv,"⪺","\\succnapprox",!0),Sv(Av,Ev,Nv,"≆","\\ncong",!0),Sv(Av,Ev,Nv,"","\\@nshortparallel"),Sv(Av,Ev,Nv,"∦","\\nparallel",!0),Sv(Av,Ev,Nv,"⊯","\\nVDash",!0),Sv(Av,Ev,Nv,"⋫","\\ntriangleright"),Sv(Av,Ev,Nv,"⋭","\\ntrianglerighteq",!0),Sv(Av,Ev,Nv,"","\\@nsupseteqq"),Sv(Av,Ev,Nv,"⊋","\\supsetneq",!0),Sv(Av,Ev,Nv,"","\\@varsupsetneq"),Sv(Av,Ev,Nv,"⫌","\\supsetneqq",!0),Sv(Av,Ev,Nv,"","\\@varsupsetneqq"),Sv(Av,Ev,Nv,"⊮","\\nVdash",!0),Sv(Av,Ev,Nv,"⪵","\\precneqq",!0),Sv(Av,Ev,Nv,"⪶","\\succneqq",!0),Sv(Av,Ev,Nv,"","\\@nsubseteqq"),Sv(Av,Ev,Ov,"⊴","\\unlhd"),Sv(Av,Ev,Ov,"⊵","\\unrhd"),Sv(Av,Ev,Nv,"↚","\\nleftarrow",!0),Sv(Av,Ev,Nv,"↛","\\nrightarrow",!0),Sv(Av,Ev,Nv,"⇍","\\nLeftarrow",!0),Sv(Av,Ev,Nv,"⇏","\\nRightarrow",!0),Sv(Av,Ev,Nv,"↮","\\nleftrightarrow",!0),Sv(Av,Ev,Nv,"⇎","\\nLeftrightarrow",!0),Sv(Av,Ev,Nv,"△","\\vartriangle"),Sv(Av,Ev,qv,"ℏ","\\hslash"),Sv(Av,Ev,qv,"▽","\\triangledown"),Sv(Av,Ev,qv,"◊","\\lozenge"),Sv(Av,Ev,qv,"Ⓢ","\\circledS"),Sv(Av,Ev,qv,"®","\\circledR"),Sv(Mv,Ev,qv,"®","\\circledR"),Sv(Av,Ev,qv,"∡","\\measuredangle",!0),Sv(Av,Ev,qv,"∄","\\nexists"),Sv(Av,Ev,qv,"℧","\\mho"),Sv(Av,Ev,qv,"Ⅎ","\\Finv",!0),Sv(Av,Ev,qv,"⅁","\\Game",!0),Sv(Av,Ev,qv,"‵","\\backprime"),Sv(Av,Ev,qv,"▲","\\blacktriangle"),Sv(Av,Ev,qv,"▼","\\blacktriangledown"),Sv(Av,Ev,qv,"■","\\blacksquare"),Sv(Av,Ev,qv,"⧫","\\blacklozenge"),Sv(Av,Ev,qv,"★","\\bigstar"),Sv(Av,Ev,qv,"∢","\\sphericalangle",!0),Sv(Av,Ev,qv,"∁","\\complement",!0),Sv(Av,Ev,qv,"ð","\\eth",!0),Sv(Mv,Tv,qv,"ð","ð"),Sv(Av,Ev,qv,"╱","\\diagup"),Sv(Av,Ev,qv,"╲","\\diagdown"),Sv(Av,Ev,qv,"□","\\square"),Sv(Av,Ev,qv,"□","\\Box"),Sv(Av,Ev,qv,"◊","\\Diamond"),Sv(Av,Ev,qv,"¥","\\yen",!0),Sv(Mv,Ev,qv,"¥","\\yen",!0),Sv(Av,Ev,qv,"✓","\\checkmark",!0),Sv(Mv,Ev,qv,"✓","\\checkmark"),Sv(Av,Ev,qv,"ℶ","\\beth",!0),Sv(Av,Ev,qv,"ℸ","\\daleth",!0),Sv(Av,Ev,qv,"ℷ","\\gimel",!0),Sv(Av,Ev,qv,"ϝ","\\digamma",!0),Sv(Av,Ev,qv,"ϰ","\\varkappa"),Sv(Av,Ev,zv,"┌","\\@ulcorner",!0),Sv(Av,Ev,Iv,"┐","\\@urcorner",!0),Sv(Av,Ev,zv,"└","\\@llcorner",!0),Sv(Av,Ev,Iv,"┘","\\@lrcorner",!0),Sv(Av,Ev,Nv,"≦","\\leqq",!0),Sv(Av,Ev,Nv,"⩽","\\leqslant",!0),Sv(Av,Ev,Nv,"⪕","\\eqslantless",!0),Sv(Av,Ev,Nv,"≲","\\lesssim",!0),Sv(Av,Ev,Nv,"⪅","\\lessapprox",!0),Sv(Av,Ev,Nv,"≊","\\approxeq",!0),Sv(Av,Ev,Ov,"⋖","\\lessdot"),Sv(Av,Ev,Nv,"⋘","\\lll",!0),Sv(Av,Ev,Nv,"≶","\\lessgtr",!0),Sv(Av,Ev,Nv,"⋚","\\lesseqgtr",!0),Sv(Av,Ev,Nv,"⪋","\\lesseqqgtr",!0),Sv(Av,Ev,Nv,"≑","\\doteqdot"),Sv(Av,Ev,Nv,"≓","\\risingdotseq",!0),Sv(Av,Ev,Nv,"≒","\\fallingdotseq",!0),Sv(Av,Ev,Nv,"∽","\\backsim",!0),Sv(Av,Ev,Nv,"⋍","\\backsimeq",!0),Sv(Av,Ev,Nv,"⫅","\\subseteqq",!0),Sv(Av,Ev,Nv,"⋐","\\Subset",!0),Sv(Av,Ev,Nv,"⊏","\\sqsubset",!0),Sv(Av,Ev,Nv,"≼","\\preccurlyeq",!0),Sv(Av,Ev,Nv,"⋞","\\curlyeqprec",!0),Sv(Av,Ev,Nv,"≾","\\precsim",!0),Sv(Av,Ev,Nv,"⪷","\\precapprox",!0),Sv(Av,Ev,Nv,"⊲","\\vartriangleleft"),Sv(Av,Ev,Nv,"⊴","\\trianglelefteq"),Sv(Av,Ev,Nv,"⊨","\\vDash",!0),Sv(Av,Ev,Nv,"⊪","\\Vvdash",!0),Sv(Av,Ev,Nv,"⌣","\\smallsmile"),Sv(Av,Ev,Nv,"⌢","\\smallfrown"),Sv(Av,Ev,Nv,"≏","\\bumpeq",!0),Sv(Av,Ev,Nv,"≎","\\Bumpeq",!0),Sv(Av,Ev,Nv,"≧","\\geqq",!0),Sv(Av,Ev,Nv,"⩾","\\geqslant",!0),Sv(Av,Ev,Nv,"⪖","\\eqslantgtr",!0),Sv(Av,Ev,Nv,"≳","\\gtrsim",!0),Sv(Av,Ev,Nv,"⪆","\\gtrapprox",!0),Sv(Av,Ev,Ov,"⋗","\\gtrdot"),Sv(Av,Ev,Nv,"⋙","\\ggg",!0),Sv(Av,Ev,Nv,"≷","\\gtrless",!0),Sv(Av,Ev,Nv,"⋛","\\gtreqless",!0),Sv(Av,Ev,Nv,"⪌","\\gtreqqless",!0),Sv(Av,Ev,Nv,"≖","\\eqcirc",!0),Sv(Av,Ev,Nv,"≗","\\circeq",!0),Sv(Av,Ev,Nv,"≜","\\triangleq",!0),Sv(Av,Ev,Nv,"∼","\\thicksim"),Sv(Av,Ev,Nv,"≈","\\thickapprox"),Sv(Av,Ev,Nv,"⫆","\\supseteqq",!0),Sv(Av,Ev,Nv,"⋑","\\Supset",!0),Sv(Av,Ev,Nv,"⊐","\\sqsupset",!0),Sv(Av,Ev,Nv,"≽","\\succcurlyeq",!0),Sv(Av,Ev,Nv,"⋟","\\curlyeqsucc",!0),Sv(Av,Ev,Nv,"≿","\\succsim",!0),Sv(Av,Ev,Nv,"⪸","\\succapprox",!0),Sv(Av,Ev,Nv,"⊳","\\vartriangleright"),Sv(Av,Ev,Nv,"⊵","\\trianglerighteq"),Sv(Av,Ev,Nv,"⊩","\\Vdash",!0),Sv(Av,Ev,Nv,"∣","\\shortmid"),Sv(Av,Ev,Nv,"∥","\\shortparallel"),Sv(Av,Ev,Nv,"≬","\\between",!0),Sv(Av,Ev,Nv,"⋔","\\pitchfork",!0),Sv(Av,Ev,Nv,"∝","\\varpropto"),Sv(Av,Ev,Nv,"◀","\\blacktriangleleft"),Sv(Av,Ev,Nv,"∴","\\therefore",!0),Sv(Av,Ev,Nv,"∍","\\backepsilon"),Sv(Av,Ev,Nv,"▶","\\blacktriangleright"),Sv(Av,Ev,Nv,"∵","\\because",!0),Sv(Av,Ev,Nv,"⋘","\\llless"),Sv(Av,Ev,Nv,"⋙","\\gggtr"),Sv(Av,Ev,Ov,"⊲","\\lhd"),Sv(Av,Ev,Ov,"⊳","\\rhd"),Sv(Av,Ev,Nv,"≂","\\eqsim",!0),Sv(Av,Tv,Nv,"⋈","\\Join"),Sv(Av,Ev,Nv,"≑","\\Doteq",!0),Sv(Av,Ev,Ov,"∔","\\dotplus",!0),Sv(Av,Ev,Ov,"∖","\\smallsetminus"),Sv(Av,Ev,Ov,"⋒","\\Cap",!0),Sv(Av,Ev,Ov,"⋓","\\Cup",!0),Sv(Av,Ev,Ov,"⩞","\\doublebarwedge",!0),Sv(Av,Ev,Ov,"⊟","\\boxminus",!0),Sv(Av,Ev,Ov,"⊞","\\boxplus",!0),Sv(Av,Ev,Ov,"⋇","\\divideontimes",!0),Sv(Av,Ev,Ov,"⋉","\\ltimes",!0),Sv(Av,Ev,Ov,"⋊","\\rtimes",!0),Sv(Av,Ev,Ov,"⋋","\\leftthreetimes",!0),Sv(Av,Ev,Ov,"⋌","\\rightthreetimes",!0),Sv(Av,Ev,Ov,"⋏","\\curlywedge",!0),Sv(Av,Ev,Ov,"⋎","\\curlyvee",!0),Sv(Av,Ev,Ov,"⊝","\\circleddash",!0),Sv(Av,Ev,Ov,"⊛","\\circledast",!0),Sv(Av,Ev,Ov,"⋅","\\centerdot"),Sv(Av,Ev,Ov,"⊺","\\intercal",!0),Sv(Av,Ev,Ov,"⋒","\\doublecap"),Sv(Av,Ev,Ov,"⋓","\\doublecup"),Sv(Av,Ev,Ov,"⊠","\\boxtimes",!0),Sv(Av,Ev,Nv,"⇢","\\dashrightarrow",!0),Sv(Av,Ev,Nv,"⇠","\\dashleftarrow",!0),Sv(Av,Ev,Nv,"⇇","\\leftleftarrows",!0),Sv(Av,Ev,Nv,"⇆","\\leftrightarrows",!0),Sv(Av,Ev,Nv,"⇚","\\Lleftarrow",!0),Sv(Av,Ev,Nv,"↞","\\twoheadleftarrow",!0),Sv(Av,Ev,Nv,"↢","\\leftarrowtail",!0),Sv(Av,Ev,Nv,"↫","\\looparrowleft",!0),Sv(Av,Ev,Nv,"⇋","\\leftrightharpoons",!0),Sv(Av,Ev,Nv,"↶","\\curvearrowleft",!0),Sv(Av,Ev,Nv,"↺","\\circlearrowleft",!0),Sv(Av,Ev,Nv,"↰","\\Lsh",!0),Sv(Av,Ev,Nv,"⇈","\\upuparrows",!0),Sv(Av,Ev,Nv,"↿","\\upharpoonleft",!0),Sv(Av,Ev,Nv,"⇃","\\downharpoonleft",!0),Sv(Av,Tv,Nv,"⊶","\\origof",!0),Sv(Av,Tv,Nv,"⊷","\\imageof",!0),Sv(Av,Ev,Nv,"⊸","\\multimap",!0),Sv(Av,Ev,Nv,"↭","\\leftrightsquigarrow",!0),Sv(Av,Ev,Nv,"⇉","\\rightrightarrows",!0),Sv(Av,Ev,Nv,"⇄","\\rightleftarrows",!0),Sv(Av,Ev,Nv,"↠","\\twoheadrightarrow",!0),Sv(Av,Ev,Nv,"↣","\\rightarrowtail",!0),Sv(Av,Ev,Nv,"↬","\\looparrowright",!0),Sv(Av,Ev,Nv,"↷","\\curvearrowright",!0),Sv(Av,Ev,Nv,"↻","\\circlearrowright",!0),Sv(Av,Ev,Nv,"↱","\\Rsh",!0),Sv(Av,Ev,Nv,"⇊","\\downdownarrows",!0),Sv(Av,Ev,Nv,"↾","\\upharpoonright",!0),Sv(Av,Ev,Nv,"⇂","\\downharpoonright",!0),Sv(Av,Ev,Nv,"⇝","\\rightsquigarrow",!0),Sv(Av,Ev,Nv,"⇝","\\leadsto"),Sv(Av,Ev,Nv,"⇛","\\Rrightarrow",!0),Sv(Av,Ev,Nv,"↾","\\restriction"),Sv(Av,Tv,qv,"‘","`"),Sv(Av,Tv,qv,"$","\\$"),Sv(Mv,Tv,qv,"$","\\$"),Sv(Mv,Tv,qv,"$","\\textdollar"),Sv(Av,Tv,qv,"%","\\%"),Sv(Mv,Tv,qv,"%","\\%"),Sv(Av,Tv,qv,"_","\\_"),Sv(Mv,Tv,qv,"_","\\_"),Sv(Mv,Tv,qv,"_","\\textunderscore"),Sv(Av,Tv,qv,"∠","\\angle",!0),Sv(Av,Tv,qv,"∞","\\infty",!0),Sv(Av,Tv,qv,"′","\\prime"),Sv(Av,Tv,qv,"△","\\triangle"),Sv(Av,Tv,qv,"Γ","\\Gamma",!0),Sv(Av,Tv,qv,"Δ","\\Delta",!0),Sv(Av,Tv,qv,"Θ","\\Theta",!0),Sv(Av,Tv,qv,"Λ","\\Lambda",!0),Sv(Av,Tv,qv,"Ξ","\\Xi",!0),Sv(Av,Tv,qv,"Π","\\Pi",!0),Sv(Av,Tv,qv,"Σ","\\Sigma",!0),Sv(Av,Tv,qv,"Υ","\\Upsilon",!0),Sv(Av,Tv,qv,"Φ","\\Phi",!0),Sv(Av,Tv,qv,"Ψ","\\Psi",!0),Sv(Av,Tv,qv,"Ω","\\Omega",!0),Sv(Av,Tv,qv,"A","Α"),Sv(Av,Tv,qv,"B","Β"),Sv(Av,Tv,qv,"E","Ε"),Sv(Av,Tv,qv,"Z","Ζ"),Sv(Av,Tv,qv,"H","Η"),Sv(Av,Tv,qv,"I","Ι"),Sv(Av,Tv,qv,"K","Κ"),Sv(Av,Tv,qv,"M","Μ"),Sv(Av,Tv,qv,"N","Ν"),Sv(Av,Tv,qv,"O","Ο"),Sv(Av,Tv,qv,"P","Ρ"),Sv(Av,Tv,qv,"T","Τ"),Sv(Av,Tv,qv,"X","Χ"),Sv(Av,Tv,qv,"¬","\\neg",!0),Sv(Av,Tv,qv,"¬","\\lnot"),Sv(Av,Tv,qv,"⊤","\\top"),Sv(Av,Tv,qv,"⊥","\\bot"),Sv(Av,Tv,qv,"∅","\\emptyset"),Sv(Av,Ev,qv,"∅","\\varnothing"),Sv(Av,Tv,Pv,"α","\\alpha",!0),Sv(Av,Tv,Pv,"β","\\beta",!0),Sv(Av,Tv,Pv,"γ","\\gamma",!0),Sv(Av,Tv,Pv,"δ","\\delta",!0),Sv(Av,Tv,Pv,"ϵ","\\epsilon",!0),Sv(Av,Tv,Pv,"ζ","\\zeta",!0),Sv(Av,Tv,Pv,"η","\\eta",!0),Sv(Av,Tv,Pv,"θ","\\theta",!0),Sv(Av,Tv,Pv,"ι","\\iota",!0),Sv(Av,Tv,Pv,"κ","\\kappa",!0),Sv(Av,Tv,Pv,"λ","\\lambda",!0),Sv(Av,Tv,Pv,"μ","\\mu",!0),Sv(Av,Tv,Pv,"ν","\\nu",!0),Sv(Av,Tv,Pv,"ξ","\\xi",!0),Sv(Av,Tv,Pv,"ο","\\omicron",!0),Sv(Av,Tv,Pv,"π","\\pi",!0),Sv(Av,Tv,Pv,"ρ","\\rho",!0),Sv(Av,Tv,Pv,"σ","\\sigma",!0),Sv(Av,Tv,Pv,"τ","\\tau",!0),Sv(Av,Tv,Pv,"υ","\\upsilon",!0),Sv(Av,Tv,Pv,"ϕ","\\phi",!0),Sv(Av,Tv,Pv,"χ","\\chi",!0),Sv(Av,Tv,Pv,"ψ","\\psi",!0),Sv(Av,Tv,Pv,"ω","\\omega",!0),Sv(Av,Tv,Pv,"ε","\\varepsilon",!0),Sv(Av,Tv,Pv,"ϑ","\\vartheta",!0),Sv(Av,Tv,Pv,"ϖ","\\varpi",!0),Sv(Av,Tv,Pv,"ϱ","\\varrho",!0),Sv(Av,Tv,Pv,"ς","\\varsigma",!0),Sv(Av,Tv,Pv,"φ","\\varphi",!0),Sv(Av,Tv,Ov,"∗","*",!0),Sv(Av,Tv,Ov,"+","+"),Sv(Av,Tv,Ov,"−","-",!0),Sv(Av,Tv,Ov,"⋅","\\cdot",!0),Sv(Av,Tv,Ov,"∘","\\circ",!0),Sv(Av,Tv,Ov,"÷","\\div",!0),Sv(Av,Tv,Ov,"±","\\pm",!0),Sv(Av,Tv,Ov,"×","\\times",!0),Sv(Av,Tv,Ov,"∩","\\cap",!0),Sv(Av,Tv,Ov,"∪","\\cup",!0),Sv(Av,Tv,Ov,"∖","\\setminus",!0),Sv(Av,Tv,Ov,"∧","\\land"),Sv(Av,Tv,Ov,"∨","\\lor"),Sv(Av,Tv,Ov,"∧","\\wedge",!0),Sv(Av,Tv,Ov,"∨","\\vee",!0),Sv(Av,Tv,qv,"√","\\surd"),Sv(Av,Tv,zv,"⟨","\\langle",!0),Sv(Av,Tv,zv,"∣","\\lvert"),Sv(Av,Tv,zv,"∥","\\lVert"),Sv(Av,Tv,Iv,"?","?"),Sv(Av,Tv,Iv,"!","!"),Sv(Av,Tv,Iv,"⟩","\\rangle",!0),Sv(Av,Tv,Iv,"∣","\\rvert"),Sv(Av,Tv,Iv,"∥","\\rVert"),Sv(Av,Tv,Nv,"=","="),Sv(Av,Tv,Nv,":",":"),Sv(Av,Tv,Nv,"≈","\\approx",!0),Sv(Av,Tv,Nv,"≅","\\cong",!0),Sv(Av,Tv,Nv,"≥","\\ge"),Sv(Av,Tv,Nv,"≥","\\geq",!0),Sv(Av,Tv,Nv,"←","\\gets"),Sv(Av,Tv,Nv,">","\\gt",!0),Sv(Av,Tv,Nv,"∈","\\in",!0),Sv(Av,Tv,Nv,"","\\@not"),Sv(Av,Tv,Nv,"⊂","\\subset",!0),Sv(Av,Tv,Nv,"⊃","\\supset",!0),Sv(Av,Tv,Nv,"⊆","\\subseteq",!0),Sv(Av,Tv,Nv,"⊇","\\supseteq",!0),Sv(Av,Ev,Nv,"⊈","\\nsubseteq",!0),Sv(Av,Ev,Nv,"⊉","\\nsupseteq",!0),Sv(Av,Tv,Nv,"⊨","\\models"),Sv(Av,Tv,Nv,"←","\\leftarrow",!0),Sv(Av,Tv,Nv,"≤","\\le"),Sv(Av,Tv,Nv,"≤","\\leq",!0),Sv(Av,Tv,Nv,"<","\\lt",!0),Sv(Av,Tv,Nv,"→","\\rightarrow",!0),Sv(Av,Tv,Nv,"→","\\to"),Sv(Av,Ev,Nv,"≱","\\ngeq",!0),Sv(Av,Ev,Nv,"≰","\\nleq",!0),Sv(Av,Tv,Hv," ","\\ "),Sv(Av,Tv,Hv," ","\\space"),Sv(Av,Tv,Hv," ","\\nobreakspace"),Sv(Mv,Tv,Hv," ","\\ "),Sv(Mv,Tv,Hv," "," "),Sv(Mv,Tv,Hv," ","\\space"),Sv(Mv,Tv,Hv," ","\\nobreakspace"),Sv(Av,Tv,Hv,"","\\nobreak"),Sv(Av,Tv,Hv,"","\\allowbreak"),Sv(Av,Tv,Dv,",",","),Sv(Av,Tv,Dv,";",";"),Sv(Av,Ev,Ov,"⊼","\\barwedge",!0),Sv(Av,Ev,Ov,"⊻","\\veebar",!0),Sv(Av,Tv,Ov,"⊙","\\odot",!0),Sv(Av,Tv,Ov,"⊕","\\oplus",!0),Sv(Av,Tv,Ov,"⊗","\\otimes",!0),Sv(Av,Tv,qv,"∂","\\partial",!0),Sv(Av,Tv,Ov,"⊘","\\oslash",!0),Sv(Av,Ev,Ov,"⊚","\\circledcirc",!0),Sv(Av,Ev,Ov,"⊡","\\boxdot",!0),Sv(Av,Tv,Ov,"△","\\bigtriangleup"),Sv(Av,Tv,Ov,"▽","\\bigtriangledown"),Sv(Av,Tv,Ov,"†","\\dagger"),Sv(Av,Tv,Ov,"⋄","\\diamond"),Sv(Av,Tv,Ov,"⋆","\\star"),Sv(Av,Tv,Ov,"◃","\\triangleleft"),Sv(Av,Tv,Ov,"▹","\\triangleright"),Sv(Av,Tv,zv,"{","\\{"),Sv(Mv,Tv,qv,"{","\\{"),Sv(Mv,Tv,qv,"{","\\textbraceleft"),Sv(Av,Tv,Iv,"}","\\}"),Sv(Mv,Tv,qv,"}","\\}"),Sv(Mv,Tv,qv,"}","\\textbraceright"),Sv(Av,Tv,zv,"{","\\lbrace"),Sv(Av,Tv,Iv,"}","\\rbrace"),Sv(Av,Tv,zv,"[","\\lbrack",!0),Sv(Mv,Tv,qv,"[","\\lbrack",!0),Sv(Av,Tv,Iv,"]","\\rbrack",!0),Sv(Mv,Tv,qv,"]","\\rbrack",!0),Sv(Av,Tv,zv,"(","\\lparen",!0),Sv(Av,Tv,Iv,")","\\rparen",!0),Sv(Mv,Tv,qv,"<","\\textless",!0),Sv(Mv,Tv,qv,">","\\textgreater",!0),Sv(Av,Tv,zv,"⌊","\\lfloor",!0),Sv(Av,Tv,Iv,"⌋","\\rfloor",!0),Sv(Av,Tv,zv,"⌈","\\lceil",!0),Sv(Av,Tv,Iv,"⌉","\\rceil",!0),Sv(Av,Tv,qv,"\\","\\backslash"),Sv(Av,Tv,qv,"∣","|"),Sv(Av,Tv,qv,"∣","\\vert"),Sv(Mv,Tv,qv,"|","\\textbar",!0),Sv(Av,Tv,qv,"∥","\\|"),Sv(Av,Tv,qv,"∥","\\Vert"),Sv(Mv,Tv,qv,"∥","\\textbardbl"),Sv(Mv,Tv,qv,"~","\\textasciitilde"),Sv(Mv,Tv,qv,"\\","\\textbackslash"),Sv(Mv,Tv,qv,"^","\\textasciicircum"),Sv(Av,Tv,Nv,"↑","\\uparrow",!0),Sv(Av,Tv,Nv,"⇑","\\Uparrow",!0),Sv(Av,Tv,Nv,"↓","\\downarrow",!0),Sv(Av,Tv,Nv,"⇓","\\Downarrow",!0),Sv(Av,Tv,Nv,"↕","\\updownarrow",!0),Sv(Av,Tv,Nv,"⇕","\\Updownarrow",!0),Sv(Av,Tv,Bv,"∐","\\coprod"),Sv(Av,Tv,Bv,"⋁","\\bigvee"),Sv(Av,Tv,Bv,"⋀","\\bigwedge"),Sv(Av,Tv,Bv,"⨄","\\biguplus"),Sv(Av,Tv,Bv,"⋂","\\bigcap"),Sv(Av,Tv,Bv,"⋃","\\bigcup"),Sv(Av,Tv,Bv,"∫","\\int"),Sv(Av,Tv,Bv,"∫","\\intop"),Sv(Av,Tv,Bv,"∬","\\iint"),Sv(Av,Tv,Bv,"∭","\\iiint"),Sv(Av,Tv,Bv,"∏","\\prod"),Sv(Av,Tv,Bv,"∑","\\sum"),Sv(Av,Tv,Bv,"⨂","\\bigotimes"),Sv(Av,Tv,Bv,"⨁","\\bigoplus"),Sv(Av,Tv,Bv,"⨀","\\bigodot"),Sv(Av,Tv,Bv,"∮","\\oint"),Sv(Av,Tv,Bv,"∯","\\oiint"),Sv(Av,Tv,Bv,"∰","\\oiiint"),Sv(Av,Tv,Bv,"⨆","\\bigsqcup"),Sv(Av,Tv,Bv,"∫","\\smallint"),Sv(Mv,Tv,Rv,"…","\\textellipsis"),Sv(Av,Tv,Rv,"…","\\mathellipsis"),Sv(Mv,Tv,Rv,"…","\\ldots",!0),Sv(Av,Tv,Rv,"…","\\ldots",!0),Sv(Av,Tv,Rv,"⋯","\\@cdots",!0),Sv(Av,Tv,Rv,"⋱","\\ddots",!0),Sv(Av,Tv,qv,"⋮","\\varvdots"),Sv(Mv,Tv,qv,"⋮","\\varvdots"),Sv(Av,Tv,Lv,"ˊ","\\acute"),Sv(Av,Tv,Lv,"ˋ","\\grave"),Sv(Av,Tv,Lv,"¨","\\ddot"),Sv(Av,Tv,Lv,"~","\\tilde"),Sv(Av,Tv,Lv,"ˉ","\\bar"),Sv(Av,Tv,Lv,"˘","\\breve"),Sv(Av,Tv,Lv,"ˇ","\\check"),Sv(Av,Tv,Lv,"^","\\hat"),Sv(Av,Tv,Lv,"⃗","\\vec"),Sv(Av,Tv,Lv,"˙","\\dot"),Sv(Av,Tv,Lv,"˚","\\mathring"),Sv(Av,Tv,Pv,"","\\@imath"),Sv(Av,Tv,Pv,"","\\@jmath"),Sv(Av,Tv,qv,"ı","ı"),Sv(Av,Tv,qv,"ȷ","ȷ"),Sv(Mv,Tv,qv,"ı","\\i",!0),Sv(Mv,Tv,qv,"ȷ","\\j",!0),Sv(Mv,Tv,qv,"ß","\\ss",!0),Sv(Mv,Tv,qv,"æ","\\ae",!0),Sv(Mv,Tv,qv,"œ","\\oe",!0),Sv(Mv,Tv,qv,"ø","\\o",!0),Sv(Mv,Tv,qv,"Æ","\\AE",!0),Sv(Mv,Tv,qv,"Œ","\\OE",!0),Sv(Mv,Tv,qv,"Ø","\\O",!0),Sv(Mv,Tv,Lv,"ˊ","\\'"),Sv(Mv,Tv,Lv,"ˋ","\\`"),Sv(Mv,Tv,Lv,"ˆ","\\^"),Sv(Mv,Tv,Lv,"˜","\\~"),Sv(Mv,Tv,Lv,"ˉ","\\="),Sv(Mv,Tv,Lv,"˘","\\u"),Sv(Mv,Tv,Lv,"˙","\\."),Sv(Mv,Tv,Lv,"¸","\\c"),Sv(Mv,Tv,Lv,"˚","\\r"),Sv(Mv,Tv,Lv,"ˇ","\\v"),Sv(Mv,Tv,Lv,"¨",'\\"'),Sv(Mv,Tv,Lv,"˝","\\H"),Sv(Mv,Tv,Lv,"◯","\\textcircled");var jv={"--":!0,"---":!0,"``":!0,"''":!0};Sv(Mv,Tv,qv,"–","--",!0),Sv(Mv,Tv,qv,"–","\\textendash"),Sv(Mv,Tv,qv,"—","---",!0),Sv(Mv,Tv,qv,"—","\\textemdash"),Sv(Mv,Tv,qv,"‘","`",!0),Sv(Mv,Tv,qv,"‘","\\textquoteleft"),Sv(Mv,Tv,qv,"’","'",!0),Sv(Mv,Tv,qv,"’","\\textquoteright"),Sv(Mv,Tv,qv,"“","``",!0),Sv(Mv,Tv,qv,"“","\\textquotedblleft"),Sv(Mv,Tv,qv,"”","''",!0),Sv(Mv,Tv,qv,"”","\\textquotedblright"),Sv(Av,Tv,qv,"°","\\degree",!0),Sv(Mv,Tv,qv,"°","\\degree"),Sv(Mv,Tv,qv,"°","\\textdegree",!0),Sv(Av,Tv,qv,"£","\\pounds"),Sv(Av,Tv,qv,"£","\\mathsterling",!0),Sv(Mv,Tv,qv,"£","\\pounds"),Sv(Mv,Tv,qv,"£","\\textsterling",!0),Sv(Av,Ev,qv,"✠","\\maltese"),Sv(Mv,Ev,qv,"✠","\\maltese");for(var Vv=0;Vv<14;Vv++){var Fv='0123456789/@."'.charAt(Vv);Sv(Av,Tv,qv,Fv,Fv)}for(var $v=0;$v<25;$v++){var Wv='0123456789!@*()-=+";:?/.,'.charAt($v);Sv(Mv,Tv,qv,Wv,Wv)}for(var Uv,Gv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Zv=0;Zv<52;Zv++){var Xv=Gv.charAt(Zv);Sv(Av,Tv,Pv,Xv,Xv),Sv(Mv,Tv,qv,Xv,Xv)}Sv(Av,Ev,qv,"C","ℂ"),Sv(Mv,Ev,qv,"C","ℂ"),Sv(Av,Ev,qv,"H","ℍ"),Sv(Mv,Ev,qv,"H","ℍ"),Sv(Av,Ev,qv,"N","ℕ"),Sv(Mv,Ev,qv,"N","ℕ"),Sv(Av,Ev,qv,"P","ℙ"),Sv(Mv,Ev,qv,"P","ℙ"),Sv(Av,Ev,qv,"Q","ℚ"),Sv(Mv,Ev,qv,"Q","ℚ"),Sv(Av,Ev,qv,"R","ℝ"),Sv(Mv,Ev,qv,"R","ℝ"),Sv(Av,Ev,qv,"Z","ℤ"),Sv(Mv,Ev,qv,"Z","ℤ"),Sv(Av,Tv,Pv,"h","ℎ"),Sv(Mv,Tv,Pv,"h","ℎ");for(var Kv=0;Kv<52;Kv++){var Yv=Gv.charAt(Kv);Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56320+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56372+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56424+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56580+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56684+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56736+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56788+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56840+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56944+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Kv<26&&(Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56632+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56476+Kv)),Sv(Mv,Tv,qv,Yv,Uv))}Sv(Av,Tv,Pv,"k",Uv=String.fromCharCode(55349,56668)),Sv(Mv,Tv,qv,"k",Uv);for(var Jv=0;Jv<10;Jv++){var Qv=Jv.toString();Sv(Av,Tv,Pv,Qv,Uv=String.fromCharCode(55349,57294+Jv)),Sv(Mv,Tv,qv,Qv,Uv),Sv(Av,Tv,Pv,Qv,Uv=String.fromCharCode(55349,57314+Jv)),Sv(Mv,Tv,qv,Qv,Uv),Sv(Av,Tv,Pv,Qv,Uv=String.fromCharCode(55349,57324+Jv)),Sv(Mv,Tv,qv,Qv,Uv),Sv(Av,Tv,Pv,Qv,Uv=String.fromCharCode(55349,57334+Jv)),Sv(Mv,Tv,qv,Qv,Uv)}for(var ey=0;ey<3;ey++){var ty="ÐÞþ".charAt(ey);Sv(Av,Tv,Pv,ty,ty),Sv(Mv,Tv,qv,ty,ty)}var ny={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},ry={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},oy={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},iy={mathClass:"",textClass:"",font:""},ay={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},sy={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},ly={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},cy={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},dy={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},uy={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},hy={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},py=[ny,ny,ry,ry,oy,oy,{mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},iy,iy,iy,ay,ay,sy,sy,ly,ly,cy,cy,dy,dy,uy,uy,iy,iy,hy,hy],my=[ny,iy,cy,dy,hy],fy=function(e,t,n){if(_v[n][e]){var r=_v[n][e].replace;r&&(e=r)}return{value:e,metrics:kv(e,t,n)}},gy=function(e,t,n,r,o){var i,a=fy(e,t,n),s=a.metrics;if(e=a.value,s){var l=s.italic;("text"===n||r&&"mathit"===r.font)&&(l=0),i=new fv(e,s.height,s.depth,l,s.skew,s.width,o)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+n+"'"),i=new fv(e,0,0,0,0,0,o);if(r){i.maxFontSize=r.sizeMultiplier,r.style.isTight()&&i.classes.push("mtight");var c=r.getColor();c&&(i.style.color=c)}return i},vy=function(e,t,n,r){return void 0===r&&(r=[]),"boldsymbol"===n.font&&fy(e,"Main-Bold",t).metrics?gy(e,"Main-Bold",t,n,r.concat(["mathbf"])):"\\"===e||"main"===_v[t][e].font?gy(e,"Main-Regular",t,n,r):gy(e,"AMS-Regular",t,n,r.concat(["amsrm"]))},yy=function(e,t){var n="mathord"===e.type?"mathord":"textord",r=e.mode,o=e.text,i=["mord"],{font:a,fontFamily:s,fontWeight:l,fontShape:c}=t,d="math"===r||"text"===r&&!!a,u=d?a:s,h="",p="";if(55349===o.charCodeAt(0)){var m=(e=>{var t=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536;if(119808<=t&&t<120484){var n=Math.floor((t-119808)/26);return py[n]}if(120782<=t&&t<=120831){var r=Math.floor((t-120782)/10);return my[r]}if(120485===t||120486===t)return py[0];if(120486<t&&t<120782)return iy;throw new Ag("Unsupported character: "+e)})(o);h=m.font,p=m[r+"Class"]}if(h)return gy(o,h,r,t,i.concat(p));if(u){var f,g;if("boldsymbol"===u){var v=function(e,t,n){return"textord"!==n&&fy(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(o,r,n);f=v.fontName,g=[v.fontClass]}else d?(f=Ly[a].fontName,g=[a]):(f=Ey(s,l,c),g=[s,l,c]);if(fy(o,f,r).metrics)return gy(o,f,r,t,i.concat(g));if(jv.hasOwnProperty(o)&&"Typewriter"===f.slice(0,10)){for(var y=[],b=0;b<o.length;b++)y.push(gy(o[b],f,r,t,i.concat(g)));return Sy(y)}}if("mathord"===n)return gy(o,"Math-Italic",r,t,i.concat(["mathnormal"]));if("textord"===n){var w=_v[r][o]&&_v[r][o].font;if("ams"===w){var x=Ey("amsrm",l,c);return gy(o,x,r,t,i.concat("amsrm",l,c))}if("main"!==w&&w){var k=Ey(w,l,c);return gy(o,k,r,t,i.concat(k,l,c))}var C=Ey("textrm",l,c);return gy(o,C,r,t,i.concat(l,c))}throw new Error("unexpected type: "+n+" in makeOrd")},by=(e,t)=>{if(iv(e.classes)!==iv(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||0!==e.italic&&e.hasClass("mathnormal"))return!1;if(1===e.classes.length){var n=e.classes[0];if("mbin"===n||"mord"===n)return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var o of Object.keys(t.style))if(e.style[o]!==t.style[o])return!1;return!0},wy=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof fv&&r instanceof fv&&by(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},xy=function(e){for(var t=0,n=0,r=0,o=0;o<e.children.length;o++){var i=e.children[o];i.height>t&&(t=i.height),i.depth>n&&(n=i.depth),i.maxFontSize>r&&(r=i.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},ky=function(e,t,n,r){var o=new uv(e,t,n,r);return xy(o),o},Cy=(e,t,n,r)=>new uv(e,t,n,r),_y=function(e,t,n){var r=ky([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=ov(r.height),r.maxFontSize=1,r},Sy=function(e){var t=new Qg(e);return xy(t),t},Ay=function(e,t){return e instanceof Qg?ky([],[e],t):e},My=function(e,t){for(var{children:n,depth:r}=function(e){if("individualShift"===e.positionType){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,o=r,i=1;i<t.length;i++){var a=-t[i].shift-o-t[i].elem.depth,s=a-(t[i-1].elem.height+t[i-1].elem.depth);o+=a,n.push({type:"kern",size:s}),n.push(t[i])}return{children:n,depth:r}}var l;if("top"===e.positionType){for(var c=e.positionData,d=0;d<e.children.length;d++){var u=e.children[d];c-="kern"===u.type?u.size:u.elem.height+u.elem.depth}l=c}else if("bottom"===e.positionType)l=-e.positionData;else{var h=e.children[0];if("elem"!==h.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-h.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-h.elem.depth}}return{children:e.children,depth:l}}(e),o=0,i=0;i<n.length;i++){var a=n[i];if("elem"===a.type){var s=a.elem;o=Math.max(o,s.maxFontSize,s.height)}}o+=2;var l=ky(["pstrut"],[]);l.style.height=ov(o);for(var c=[],d=r,u=r,h=r,p=0;p<n.length;p++){var m=n[p];if("kern"===m.type)h+=m.size;else{var f=m.elem,g=m.wrapperClasses||[],v=m.wrapperStyle||{},y=ky(g,[l,f],void 0,v);y.style.top=ov(-o-h-f.depth),m.marginLeft&&(y.style.marginLeft=m.marginLeft),m.marginRight&&(y.style.marginRight=m.marginRight),c.push(y),h+=f.height+f.depth}d=Math.min(d,h),u=Math.max(u,h)}var b,w=ky(["vlist"],c);if(w.style.height=ov(u),d<0){var x=ky([],[]),k=ky(["vlist"],[x]);k.style.height=ov(-d);var C=ky(["vlist-s"],[new fv("")]);b=[ky(["vlist-r"],[w,C]),ky(["vlist-r"],[k])]}else b=[ky(["vlist-r"],[w])];var _=ky(["vlist-t"],b);return 2===b.length&&_.classes.push("vlist-t2"),_.height=u,_.depth=-d,_},Ty=(e,t)=>{var n=ky(["mspace"],[],t),r=rv(e,t);return n.style.marginRight=ov(r),n},Ey=(e,t,n)=>{var r;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return r+"-"+("textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===n?"Italic":"Regular")},Ly={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Oy={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Iy=function(e,t){var[n,r,o]=Oy[e],i=new vv(n),a=new gv([i],{width:ov(r),height:ov(o),style:"width:"+ov(r),viewBox:"0 0 "+1e3*r+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),s=Cy(["overlay"],[a],t);return s.height=o,s.style.height=ov(o),s.style.width=ov(r),s},Ry={number:3,unit:"mu"},Py={number:4,unit:"mu"},By={number:5,unit:"mu"},zy={mord:{mop:Ry,mbin:Py,mrel:By,minner:Ry},mop:{mord:Ry,mop:Ry,mrel:By,minner:Ry},mbin:{mord:Py,mop:Py,mopen:Py,minner:Py},mrel:{mord:By,mop:By,mopen:By,minner:By},mopen:{},mclose:{mop:Ry,mbin:Py,mrel:By,minner:Ry},mpunct:{mord:Ry,mop:Ry,mrel:By,mopen:Ry,mclose:Ry,mpunct:Ry,minner:Ry},minner:{mord:Ry,mop:Ry,mbin:Py,mrel:By,mopen:Ry,mpunct:Ry,minner:Ry}},Dy={mord:{mop:Ry},mop:{mord:Ry,mop:Ry},mbin:{},mrel:{},mopen:{},mclose:{mop:Ry},mpunct:{},minner:{mop:Ry}},Ny={},Hy={},qy={};function jy(e){for(var{type:t,names:n,htmlBuilder:r,mathmlBuilder:o}=e,i=0;i<n.length;++i)Ny[n[i]]=e;t&&(r&&(Hy[t]=r),o&&(qy[t]=o))}function Vy(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;n&&(Hy[t]=n),r&&(qy[t]=r)}var Fy=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e},$y=function(e){return"ordgroup"===e.type?e.body:[e]},Wy=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),Uy=new Set(["rightmost","mrel","mclose","mpunct"]),Gy={display:Ug.DISPLAY,text:Ug.TEXT,script:Ug.SCRIPT,scriptscript:Ug.SCRIPTSCRIPT},Zy={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Xy=function(e,t,n,r){void 0===r&&(r=[null,null]);for(var o=[],i=0;i<e.length;i++){var a=tb(e[i],t);if(a instanceof Qg){var s=a.children;o.push(...s)}else o.push(a)}if(wy(o),!n)return o;var l=t;if(1===e.length){var c=e[0];"sizing"===c.type?l=t.havingSize(c.size):"styling"===c.type&&(l=t.havingStyle(Gy[c.style]))}var d=ky([r[0]||"leftmost"],[],t),u=ky([r[1]||"rightmost"],[],t),h="root"===n;return Ky(o,(e,t)=>{var n=t.classes[0],r=e.classes[0];"mbin"===n&&Uy.has(r)?t.classes[0]="mord":"mbin"===r&&Wy.has(n)&&(e.classes[0]="mord")},{node:d},u,h),Ky(o,(e,t)=>{var n,r,o=Qy(t),i=Qy(e),a=o&&i?e.hasClass("mtight")?null==(n=Dy[o])?void 0:n[i]:null==(r=zy[o])?void 0:r[i]:null;if(a)return Ty(a,l)},{node:d},u,h),o},Ky=function(e,t,n,r,o){r&&e.push(r);for(var i=0;i<e.length;i++){var a=e[i],s=Yy(a);if(s)Ky(s.children,t,n,null,o);else{var l=!a.hasClass("mspace");if(l){var c=t(a,n.node);c&&(n.insertAfter?n.insertAfter(c):(e.unshift(c),i++))}l?n.node=a:o&&a.hasClass("newline")&&(n.node=ky(["leftmost"])),n.insertAfter=(t=>n=>{e.splice(t+1,0,n),i++})(i)}}r&&e.pop()},Yy=function(e){return e instanceof Qg||e instanceof hv||e instanceof uv&&e.hasClass("enclosing")?e:null},Jy=function(e,t){var n=Yy(e);if(n){var r=n.children;if(r.length){if("right"===t)return Jy(r[r.length-1],"right");if("left"===t)return Jy(r[0],"left")}}return e},Qy=function(e,t){if(!e)return null;t&&(e=Jy(e,t));var n=e.classes[0];return Zy[n]||null},eb=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return ky(t.concat(n))},tb=function(e,t,n){if(!e)return ky();if(Hy[e.type]){var r=Hy[e.type](e,t);if(n&&t.size!==n.size){r=ky(t.sizingClasses(n),[r],t);var o=t.sizeMultiplier/n.sizeMultiplier;r.height*=o,r.depth*=o}return r}throw new Ag("Got group of unknown type: '"+e.type+"'")};function nb(e,t){var n=ky(["base"],e,t),r=ky(["strut"]);return r.style.height=ov(n.height+n.depth),n.depth&&(r.style.verticalAlign=ov(-n.depth)),n.children.unshift(r),n}function rb(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var r,o=Xy(e,t,"root");2===o.length&&o[1].hasClass("tag")&&(r=o.pop());for(var i,a=[],s=[],l=0;l<o.length;l++)if(s.push(o[l]),o[l].hasClass("mbin")||o[l].hasClass("mrel")||o[l].hasClass("allowbreak")){for(var c=!1;l<o.length-1&&o[l+1].hasClass("mspace")&&!o[l+1].hasClass("newline");)l++,s.push(o[l]),o[l].hasClass("nobreak")&&(c=!0);c||(a.push(nb(s,t)),s=[])}else o[l].hasClass("newline")&&(s.pop(),s.length>0&&(a.push(nb(s,t)),s=[]),a.push(o[l]));s.length>0&&a.push(nb(s,t)),n?((i=nb(Xy(n,t,!0),t)).classes=["tag"],a.push(i)):r&&a.push(r);var d=ky(["katex-html"],a);if(d.setAttribute("aria-hidden","true"),i){var u=i.children[0];u.style.height=ov(d.height+d.depth),d.depth&&(u.style.verticalAlign=ov(-d.depth))}return d}function ob(e){return new Qg(e)}class ib{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=iv(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof ab&&this.children[n+1]instanceof ab){for(var r=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof ab;)r+=this.children[++n].toText();e.appendChild(new ab(r).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=Og(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+Og(iv(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+"</"+this.type+">"}toText(){return this.children.map(e=>e.toText()).join("")}}class ab{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Og(this.toText())}toText(){return this.text}}class sb{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?" ":e>=-.05556&&e<=-.05555?" ":e>=-.1667&&e<=-.1666?" ":e>=-.2223&&e<=-.2222?" ":e>=-.2778&&e<=-.2777?" ":null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",ov(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+ov(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var lb=new Set(["\\imath","\\jmath"]),cb=new Set(["mrow","mtable"]),db=function(e,t,n){return!_v[t][e]||!_v[t][e].replace||55349===e.charCodeAt(0)||jv.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6))||(e=_v[t][e].replace),new ab(e)},ub=function(e){return 1===e.length?e[0]:new ib("mrow",e)},hb={mathit:"italic",boldsymbol:e=>"textord"===e.type?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},pb=(e,t)=>{if("text"===e.mode){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold"}var n=t.font;if(!n||"mathnormal"===n)return null;var r=e.mode,o=hb[n];if(o)return"function"==typeof o?o(e):o;var i=e.text;if(lb.has(i))return null;if(_v[r][i]){var a=_v[r][i].replace;a&&(i=a)}return kv(i,Ly[n].fontName,r)?Ly[n].variant:null};function mb(e){if(!e)return!1;if("mi"===e.type&&1===e.children.length){var t=e.children[0];return t instanceof ab&&"."===t.text}if("mo"===e.type&&1===e.children.length&&"true"===e.getAttribute("separator")&&"0em"===e.getAttribute("lspace")&&"0em"===e.getAttribute("rspace")){var n=e.children[0];return n instanceof ab&&","===n.text}return!1}var fb=function(e,t,n){if(1===e.length){var r=vb(e[0],t);return n&&r instanceof ib&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var o,i=[],a=0;a<e.length;a++){var s=vb(e[a],t);if(s instanceof ib&&o instanceof ib){if("mtext"===s.type&&"mtext"===o.type&&s.getAttribute("mathvariant")===o.getAttribute("mathvariant")){o.children.push(...s.children);continue}if("mn"===s.type&&"mn"===o.type){o.children.push(...s.children);continue}if(mb(s)&&"mn"===o.type){o.children.push(...s.children);continue}if("mn"===s.type&&mb(o))s.children=[...o.children,...s.children],i.pop();else if(("msup"===s.type||"msub"===s.type)&&s.children.length>=1&&("mn"===o.type||mb(o))){var l=s.children[0];l instanceof ib&&"mn"===l.type&&(l.children=[...o.children,...l.children],i.pop())}else if("mi"===o.type&&1===o.children.length){var c=o.children[0];if(c instanceof ab&&"̸"===c.text&&("mo"===s.type||"mi"===s.type||"mn"===s.type)){var d=s.children[0];d instanceof ab&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),i.pop())}}}i.push(s),o=s}return i},gb=function(e,t,n){return ub(fb(e,t,n))},vb=function(e,t){if(!e)return new ib("mrow");if(qy[e.type])return qy[e.type](e,t);throw new Ag("Got group of unknown type: '"+e.type+"'")};function yb(e,t,n,r,o){var i,a=fb(e,n);i=1===a.length&&a[0]instanceof ib&&cb.has(a[0].type)?a[0]:new ib("mrow",a);var s=new ib("annotation",[new ab(t)]);s.setAttribute("encoding","application/x-tex");var l=new ib("semantics",[i,s]),c=new ib("math",[l]);return c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block"),ky([o?"katex":"katex-mathml"],[c])}var bb=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],wb=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],xb=function(e,t){return t.size<2?e:bb[e-1][t.size-1]};class kb{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||kb.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=wb[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,e),new kb(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:xb(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:wb[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=xb(kb.BASESIZE,e);return this.size===t&&this.textSize===kb.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==kb.BASESIZE?["sizing","reset-size"+this.size,"size"+kb.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!Cv[t=e>=5?0:e>=3?1:2]){var n=Cv[t]={cssEmPerMu:wv.quad[t]/18};for(var r in wv)wv.hasOwnProperty(r)&&(n[r]=wv[r][t])}return Cv[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}kb.BASESIZE=6;var Cb=function(e){return new kb({style:e.displayMode?Ug.DISPLAY:Ug.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},_b=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=ky(n,[e])}return e},Sb={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Ab=function(e){var t=new ib("mo",[new ab(Sb[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Mb={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Tb=new Set(["widehat","widecheck","widetilde","utilde"]),Eb=function(e,t){var{span:n,minWidth:r,height:o}=function(){var n=4e5,r=e.label.slice(1);if(Tb.has(r)&&"base"in e){var o,i,a,s="ordgroup"===e.base.type?e.base.body.length:1;if(s>5)"widehat"===r||"widecheck"===r?(o=420,n=2364,a=.42,i=r+"4"):(o=312,n=2340,a=.34,i="tilde4");else{var l=[1,1,2,2,3,3][s];"widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][l],o=[0,239,300,360,420][l],a=[0,.24,.3,.3,.36,.42][l],i=r+l):(n=[0,600,1033,2339,2340][l],o=[0,260,286,306,312][l],a=[0,.26,.286,.3,.306,.34][l],i="tilde"+l)}var c=new vv(i),d=new gv([c],{width:"100%",height:ov(a),viewBox:"0 0 "+n+" "+o,preserveAspectRatio:"none"});return{span:Cy([],[d],t),minWidth:0,height:a}}var u=[],h=Mb[r];if(!h)throw new Error('No SVG data for "'+r+'".');var p,m,[f,g,v]=h,y=v/1e3,b=f.length;if(1===b){if(4!==h.length)throw new Error('Expected 4-tuple for single-path SVG data "'+r+'".');p=["hide-tail"],m=[h[3]]}else if(2===b)p=["halfarrow-left","halfarrow-right"],m=["xMinYMin","xMaxYMin"];else{if(3!==b)throw new Error("Correct katexImagesData or update code here to support\n "+b+" children.");p=["brace-left","brace-center","brace-right"],m=["xMinYMin","xMidYMin","xMaxYMin"]}for(var w=0;w<b;w++){var x=new vv(f[w]),k=new gv([x],{width:"400em",height:ov(y),viewBox:"0 0 "+n+" "+v,preserveAspectRatio:m[w]+" slice"}),C=Cy([p[w]],[k],t);if(1===b)return{span:C,minWidth:g,height:y};C.style.height=ov(y),u.push(C)}return{span:ky(["stretchy"],u,t),minWidth:g,height:y}}();return n.height=o,n.style.height=ov(o),r>0&&(n.style.minWidth=ov(r)),n},Lb={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Ob={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Ib(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Rb(e){var t=Pb(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Pb(e){return e&&("atom"===e.type||Ob.hasOwnProperty(e.type))?e:null}var Bb=e=>e instanceof fv?e:(e=>e instanceof uv||e instanceof hv||e instanceof Qg)(e)&&1===e.children.length?Bb(e.children[0]):void 0,zb=(e,t)=>{var n,r,o;e&&"supsub"===e.type?(n=(r=Ib(e.base,"accent")).base,e.base=n,o=function(e){if(e instanceof uv)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(tb(e,t)),e.base=r):n=(r=Ib(e,"accent")).base;var i,a,s=tb(n,t.havingCrampedStyle()),l=0;r.isShifty&&Pg(n)&&(l=null!=(i=null==(a=Bb(s))?void 0:a.skew)?i:0);var c,d="\\c"===r.label,u=d?s.height+s.depth:Math.min(s.height,t.fontMetrics().xHeight);if(r.isStretchy)c=Eb(r,t),c=My({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:c,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+ov(2*l)+")",marginLeft:ov(2*l)}:void 0}]});else{var h,p;"\\vec"===r.label?(h=Iy("vec",t),p=Oy.vec[1]):(h=function(e){if(e instanceof fv)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}(h=yy({type:"textord",mode:r.mode,text:r.label},t)),h.italic=0,p=h.width,d&&(u+=h.depth)),c=ky(["accent-body"],[h]);var m="\\textcircled"===r.label;m&&(c.classes.push("accent-full"),u=s.height);var f=l;m||(f-=p/2),c.style.left=ov(f),"\\textcircled"===r.label&&(c.style.top=".2em"),c=My({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-u},{type:"elem",elem:c}]})}var g=ky(["mord","accent"],[c],t);return o?(o.children[0]=g,o.height=Math.max(g.height,o.height),o.classes[0]="mord",o):g},Db=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));jy({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],numArgs:1,handler:(e,t)=>{var n=Fy(t[0]),r=!Db.test(e.funcName),o=!r||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:o,base:n}},htmlBuilder:zb,mathmlBuilder:(e,t)=>{var n=e.isStretchy?Ab(e.label):new ib("mo",[db(e.label,e.mode)]),r=new ib("mover",[vb(e.base,t),n]);return r.setAttribute("accent","true"),r}}),jy({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"],handler:(e,t)=>{var n=t[0],r=e.parser.mode;return"math"===r&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}}}),jy({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],numArgs:1,handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:o}},htmlBuilder:(e,t)=>{var n=tb(e.base,t),r=Eb(e,t),o="\\utilde"===e.label?.12:0,i=My({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:o},{type:"elem",elem:n}]});return ky(["mord","accentunder"],[i],t)},mathmlBuilder:(e,t)=>{var n=Ab(e.label),r=new ib("munder",[vb(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var Nb=e=>{var t=new ib("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};jy({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],numArgs:1,numOptionalArgs:1,handler(e,t,n){var{parser:r,funcName:o}=e;return{type:"xArrow",mode:r.mode,label:o,body:t[0],below:n[0]}},htmlBuilder(e,t){var n,r=t.style,o=t.havingStyle(r.sup()),i=Ay(tb(e.body,o,t),t),a="\\x"===e.label.slice(0,2)?"x":"cd";i.classes.push(a+"-arrow-pad"),e.below&&(o=t.havingStyle(r.sub()),(n=Ay(tb(e.below,o,t),t)).classes.push(a+"-arrow-pad"));var s,l=Eb(e,t),c=-t.fontMetrics().axisHeight+.5*l.height,d=-t.fontMetrics().axisHeight-.5*l.height-.111;if((i.depth>.25||"\\xleftequilibrium"===e.label)&&(d-=i.depth),n){var u=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;s=My({positionType:"individualShift",children:[{type:"elem",elem:i,shift:d},{type:"elem",elem:l,shift:c,wrapperClasses:["svg-align"]},{type:"elem",elem:n,shift:u}]})}else s=My({positionType:"individualShift",children:[{type:"elem",elem:i,shift:d},{type:"elem",elem:l,shift:c,wrapperClasses:["svg-align"]}]});return ky(["mrel","x-arrow"],[s],t)},mathmlBuilder(e,t){var n,r=Ab(e.label);if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var o=Nb(vb(e.body,t));if(e.below){var i=Nb(vb(e.below,t));n=new ib("munderover",[r,i,o])}else n=new ib("mover",[r,o])}else if(e.below){var a=Nb(vb(e.below,t));n=new ib("munder",[r,a])}else n=Nb(),n=new ib("mover",[r,n]);return n}}),jy({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],numArgs:1,primitive:!0,handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:$y(o),isCharacterBox:Pg(o)}},htmlBuilder:function(e,t){var n=Xy(e.body,t,!0);return ky([e.mclass],n,t)},mathmlBuilder:function(e,t){var n,r=fb(e.body,t);return"minner"===e.mclass?n=new ib("mpadded",r):"mord"===e.mclass?e.isCharacterBox?(n=r[0]).type="mi":n=new ib("mi",r):(e.isCharacterBox?(n=r[0]).type="mo":n=new ib("mo",r),"mbin"===e.mclass?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"!==e.mclass&&"mclose"!==e.mclass||(n.attributes.lspace="0em",n.attributes.rspace="0em")),n}});var Hb=e=>{var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};jy({type:"mclass",names:["\\@binrel"],numArgs:2,handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Hb(t[0]),body:$y(t[1]),isCharacterBox:Pg(t[1])}}}),jy({type:"mclass",names:["\\stackrel","\\overset","\\underset"],numArgs:2,handler(e,t){var n,{parser:r,funcName:o}=e,i=t[1],a=t[0];n="\\stackrel"!==o?Hb(i):"mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==o,body:$y(i)},l="\\underset"===o?{type:"supsub",mode:a.mode,base:s,sub:a}:{type:"supsub",mode:a.mode,base:s,sup:a};return{type:"mclass",mode:r.mode,mclass:n,body:[l],isCharacterBox:Pg(l)}}}),jy({type:"pmb",names:["\\pmb"],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Hb(t[0]),body:$y(t[0])}},htmlBuilder(e,t){var n=Xy(e.body,t,!0),r=ky([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=fb(e.body,t),r=new ib("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var qb={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},jb=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),Vb=e=>"textord"===e.type&&"@"===e.text,Fb=(e,t)=>("mathord"===e.type||"atom"===e.type)&&e.text===t;function $b(e,t,n){var r=qb[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var o={type:"atom",text:r,mode:"math",family:"rel"},i={type:"ordgroup",mode:"math",body:[n.callFunction("\\\\cdleft",[t[0]],[]),n.callFunction("\\Big",[o],[]),n.callFunction("\\\\cdright",[t[1]],[])]};return n.callFunction("\\\\cdparent",[i],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return n.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}jy({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=Ay(tb(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=ov(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new ib("mrow",[vb(e.label,t)]);return(n=new ib("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new ib("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),jy({type:"cdlabelparent",names:["\\\\cdparent"],numArgs:1,handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=Ay(tb(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new ib("mrow",[vb(e.fragment,t)])}),jy({type:"textord",names:["\\@char"],numArgs:1,allowedInText:!0,handler(e,t){for(var{parser:n}=e,r=Ib(t[0],"ordgroup").body,o="",i=0;i<r.length;i++)o+=Ib(r[i],"textord").text;var a,s=parseInt(o);if(isNaN(s))throw new Ag("\\@char has non-numeric argument "+o);if(s<0||s>=1114111)throw new Ag("\\@char with invalid code point "+o);return s<=65535?a=String.fromCharCode(s):(s-=65536,a=String.fromCharCode(55296+(s>>10),56320+(1023&s))),{type:"textord",mode:n.mode,text:a}}}),jy({type:"color",names:["\\textcolor"],numArgs:2,allowedInText:!0,argTypes:["color","original"],handler(e,t){var{parser:n}=e,r=Ib(t[0],"color-token").color,o=t[1];return{type:"color",mode:n.mode,color:r,body:$y(o)}},htmlBuilder:(e,t)=>{var n=Xy(e.body,t.withColor(e.color),!1);return Sy(n)},mathmlBuilder:(e,t)=>{var n=fb(e.body,t.withColor(e.color)),r=new ib("mstyle",n);return r.setAttribute("mathcolor",e.color),r}}),jy({type:"color",names:["\\color"],numArgs:1,allowedInText:!0,argTypes:["color"],handler(e,t){var{parser:n,breakOnTokenText:r}=e,o=Ib(t[0],"color-token").color;n.gullet.macros.set("\\current@color",o);var i=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:o,body:i}}}),jy({type:"cr",names:["\\\\"],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(e,t,n){var{parser:r}=e,o="["===r.gullet.future().text?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:o&&Ib(o,"size").value}},htmlBuilder(e,t){var n=ky(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=ov(rv(e.size,t)))),n},mathmlBuilder(e,t){var n=new ib("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",ov(rv(e.size,t)))),n}});var Wb={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Ub=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Ag("Expected a control sequence",e);return t},Gb=(e,t,n,r)=>{var o=e.gullet.macros.get(n.text);null==o&&(n.noexpand=!0,o={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,o,r)};jy({type:"internal",names:["\\global","\\long","\\\\globallong"],numArgs:0,allowedInText:!0,handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(Wb[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=Wb[r.text]),Ib(t.parseFunction(),"internal");throw new Ag("Invalid token after macro prefix",r)}}),jy({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),o=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(o))throw new Ag("Expected a control sequence",r);for(var i,a=0,s=[[]];"{"!==t.gullet.future().text;)if("#"===(r=t.gullet.popToken()).text){if("{"===t.gullet.future().text){i=t.gullet.future(),s[a].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Ag('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new Ag('Argument number "'+r.text+'" out of order');a++,s.push([])}else{if("EOF"===r.text)throw new Ag("Expected a macro definition");s[a].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return i&&l.unshift(i),"\\edef"!==n&&"\\xdef"!==n||(l=t.gullet.expandTokens(l)).reverse(),t.gullet.macros.set(o,{tokens:l,numArgs:a,delimiters:s},n===Wb[n]),{type:"internal",mode:t.mode}}}),jy({type:"internal",names:["\\let","\\\\globallet"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=Ub(t.gullet.popToken());t.gullet.consumeSpaces();var o=(e=>{var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t})(t);return Gb(t,r,o,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),jy({type:"internal",names:["\\futurelet","\\\\globalfuture"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=Ub(t.gullet.popToken()),o=t.gullet.popToken(),i=t.gullet.popToken();return Gb(t,r,i,"\\\\globalfuture"===n),t.gullet.pushToken(i),t.gullet.pushToken(o),{type:"internal",mode:t.mode}}});var Zb=function(e,t,n){var r=kv(_v.math[e]&&_v.math[e].replace||e,t,n);if(!r)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return r},Xb=function(e,t,n,r){var o=n.havingBaseStyle(t),i=ky(r.concat(o.sizingClasses(n)),[e],n),a=o.sizeMultiplier/n.sizeMultiplier;return i.height*=a,i.depth*=a,i.maxFontSize=o.sizeMultiplier,i},Kb=function(e,t,n){var r=t.havingBaseStyle(n),o=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=ov(o),e.height-=o,e.depth+=o},Yb=function(e,t,n,r,o,i){var a=function(e,t,n,r){return gy(e,"Size"+t+"-Regular",n,r)}(e,t,o,r),s=Xb(ky(["delimsizing","size"+t],[a],r),Ug.TEXT,r,i);return n&&Kb(s,r,Ug.TEXT),s},Jb=function(e,t,n){return{type:"elem",elem:ky(["delimsizinginner","Size1-Regular"===t?"delim-size1":"delim-size4"],[ky([],[gy(e,t,n)])])}},Qb=function(e,t,n){var r=bv["Size4-Regular"][e.charCodeAt(0)]?bv["Size4-Regular"][e.charCodeAt(0)][4]:bv["Size1-Regular"][e.charCodeAt(0)][4],o=new vv("inner",function(e,t){switch(e){case"⎜":return Kg("M291 0 H417 V"+t+" H291z");case"∣":return Kg("M145 0 H188 V"+t+" H145z");case"∥":return Kg("M145 0 H188 V"+t+" H145z")+Kg("M367 0 H410 V"+t+" H367z");case"⎟":return Kg("M457 0 H583 V"+t+" H457z");case"⎢":return Kg("M319 0 H403 V"+t+" H319z");case"⎥":return Kg("M263 0 H347 V"+t+" H263z");case"⎪":return Kg("M384 0 H504 V"+t+" H384z");case"⏐":return Kg("M312 0 H355 V"+t+" H312z");case"‖":return Kg("M257 0 H300 V"+t+" H257z")+Kg("M478 0 H521 V"+t+" H478z");default:return""}}(e,Math.round(1e3*t))),i=new gv([o],{width:ov(r),height:ov(t),style:"width:"+ov(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),a=Cy([],[i],n);return a.height=t,a.style.height=ov(t),a.style.width=ov(r),{type:"elem",elem:a}},ew={type:"kern",size:-.008},tw=new Set(["|","\\lvert","\\rvert","\\vert"]),nw=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),rw=function(e,t,n,r,o,i){var a,s,l,c,d="",u=0;a=l=c=e,s=null;var h="Size1-Regular";"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?a=l="⏐":"\\Downarrow"===e?a=l="‖":"\\updownarrow"===e?(a="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===e?(a="\\Uparrow",l="‖",c="\\Downarrow"):tw.has(e)?(l="∣",d="vert",u=333):nw.has(e)?(l="∥",d="doublevert",u=556):"["===e||"\\lbrack"===e?(a="⎡",l="⎢",c="⎣",h="Size4-Regular",d="lbrack",u=667):"]"===e||"\\rbrack"===e?(a="⎤",l="⎥",c="⎦",h="Size4-Regular",d="rbrack",u=667):"\\lfloor"===e||"⌊"===e?(l=a="⎢",c="⎣",h="Size4-Regular",d="lfloor",u=667):"\\lceil"===e||"⌈"===e?(a="⎡",l=c="⎢",h="Size4-Regular",d="lceil",u=667):"\\rfloor"===e||"⌋"===e?(l=a="⎥",c="⎦",h="Size4-Regular",d="rfloor",u=667):"\\rceil"===e||"⌉"===e?(a="⎤",l=c="⎥",h="Size4-Regular",d="rceil",u=667):"("===e||"\\lparen"===e?(a="⎛",l="⎜",c="⎝",h="Size4-Regular",d="lparen",u=875):")"===e||"\\rparen"===e?(a="⎞",l="⎟",c="⎠",h="Size4-Regular",d="rparen",u=875):"\\{"===e||"\\lbrace"===e?(a="⎧",s="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(a="⎫",s="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(a="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(a="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(a="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(a="⎫",c="⎩",l="⎪",h="Size4-Regular");var p=Zb(a,h,o),m=p.height+p.depth,f=Zb(l,h,o),g=f.height+f.depth,v=Zb(c,h,o),y=v.height+v.depth,b=0,w=1;if(null!==s){var x=Zb(s,h,o);b=x.height+x.depth,w=2}var k=m+y+b,C=k+Math.max(0,Math.ceil((t-k)/(w*g)))*w*g,_=r.fontMetrics().axisHeight;n&&(_*=r.sizeMultiplier);var S=C/2-_,A=[];if(d.length>0){var M=C-m-y,T=Math.round(1e3*C),E=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 v84 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(d,Math.round(1e3*M)),L=new vv(d,E),O=ov(u/1e3),I=ov(T/1e3),R=new gv([L],{width:O,height:I,viewBox:"0 0 "+u+" "+T}),P=Cy([],[R],r);P.height=T/1e3,P.style.width=O,P.style.height=I,A.push({type:"elem",elem:P})}else{if(A.push(Jb(c,h,o)),A.push(ew),null===s){var B=C-m-y+.016;A.push(Qb(l,B,r))}else{var z=(C-m-y-b)/2+.016;A.push(Qb(l,z,r)),A.push(ew),A.push(Jb(s,h,o)),A.push(ew),A.push(Qb(l,z,r))}A.push(ew),A.push(Jb(a,h,o))}var D=r.havingBaseStyle(Ug.TEXT),N=My({positionType:"bottom",positionData:S,children:A});return Xb(ky(["delimsizing","mult"],[N],D),Ug.TEXT,r,i)},ow=.08,iw=function(e,t,n,r,o){var i=function(e,t,n){t*=1e3;var r="";switch(e){case"sqrtMain":r=function(e){return"M95,"+(622+e+Yg)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize1":r=function(e){return"M263,"+(601+e+Yg)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize2":r=function(e){return"M983 "+(10+e+Yg)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize3":r=function(e){return"M424,"+(2398+e+Yg)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" 80\nh400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize4":r=function(e){return"M473,"+(2713+e+Yg)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" 80h400000v"+(40+e)+"H1017.7z"}(t);break;case"sqrtTall":r=function(e,t,n){return"M702 "+(e+Yg)+"H400000"+(40+e)+"\nH742v"+(n-54-Yg-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 80H400000v"+(40+e)+"H742z"}(t,0,n)}return r}(e,r,n),a=new vv(e,i),s=new gv([a],{width:"400em",height:ov(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Cy(["hide-tail"],[s],o)},aw=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),sw=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),lw=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),cw=[0,1.2,1.8,2.4,3],dw=function(e,t,n,r,o){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),aw.has(e)||lw.has(e))return Yb(e,t,!1,n,r,o);if(sw.has(e))return rw(e,cw[t],!1,n,r,o);throw new Ag("Illegal delimiter: '"+e+"'")},uw=[{type:"small",style:Ug.SCRIPTSCRIPT},{type:"small",style:Ug.SCRIPT},{type:"small",style:Ug.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],hw=[{type:"small",style:Ug.SCRIPTSCRIPT},{type:"small",style:Ug.SCRIPT},{type:"small",style:Ug.TEXT},{type:"stack"}],pw=[{type:"small",style:Ug.SCRIPTSCRIPT},{type:"small",style:Ug.SCRIPT},{type:"small",style:Ug.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],mw=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";var t=e.type;throw new Error("Add support for delim type '"+t+"' here.")},fw=function(e,t,n,r){for(var o=Math.min(2,3-r.style.size);o<n.length;o++){var i=n[o];if("stack"===i.type)break;var a=Zb(e,mw(i),"math"),s=a.height+a.depth;if("small"===i.type&&(s*=r.havingBaseStyle(i.style).sizeMultiplier),s>t)return i}return n[n.length-1]},gw=function(e,t,n,r,o,i){var a;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),a=lw.has(e)?uw:aw.has(e)?pw:hw;var s=fw(e,t,a,r);return"small"===s.type?function(e,t,n,r,o,i){var a=gy(e,"Main-Regular",o,r),s=Xb(a,t,r,i);return Kb(s,r,t),s}(e,s.style,0,r,o,i):"large"===s.type?Yb(e,s.size,n,r,o,i):rw(e,t,n,r,o,i)},vw=function(e,t,n,r,o,i){var a=r.fontMetrics().axisHeight*r.sizeMultiplier,s=5/r.fontMetrics().ptPerEm,l=Math.max(t-a,n+a),c=Math.max(l/500*901,2*l-s);return gw(e,c,!0,r,o,i)},yw={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},bw=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function ww(e){return"isMiddle"in e}function xw(e,t){var n=Pb(e);if(n&&bw.has(n.text))return n;throw new Ag(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function kw(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}jy({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],numArgs:1,argTypes:["primitive"],handler:(e,t)=>{var n=xw(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:yw[e.funcName].size,mclass:yw[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?ky([e.mclass]):dw(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(db(e.delim,e.mode));var n=new ib("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=ov(cw[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),jy({type:"leftright-right",names:["\\right"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&"string"!=typeof n)throw new Ag("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:xw(t[0],e).text,color:n}}}),jy({type:"leftright",names:["\\left"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=xw(t[0],e),r=e.parser;++r.leftrightDepth;var o=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=Ib(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:o,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,t)=>{kw(e);for(var n,r,o=Xy(e.body,t,!0,["mopen","mclose"]),i=0,a=0,s=!1,l=0;l<o.length;l++)ww(o[l])?s=!0:(i=Math.max(o[l].height,i),a=Math.max(o[l].depth,a));if(i*=t.sizeMultiplier,a*=t.sizeMultiplier,n="."===e.left?eb(t,["mopen"]):vw(e.left,i,a,t,e.mode,["mopen"]),o.unshift(n),s)for(var c=1;c<o.length;c++){var d=o[c];if(ww(d)){var u=d.isMiddle;o[c]=vw(u.delim,i,a,u.options,e.mode,[])}}if("."===e.right)r=eb(t,["mclose"]);else{var h=e.rightColor?t.withColor(e.rightColor):t;r=vw(e.right,i,a,h,e.mode,["mclose"])}return o.push(r),ky(["minner"],o,t)},mathmlBuilder:(e,t)=>{kw(e);var n=fb(e.body,t);if("."!==e.left){var r=new ib("mo",[db(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==e.right){var o=new ib("mo",[db(e.right,e.mode)]);o.setAttribute("fence","true"),e.rightColor&&o.setAttribute("mathcolor",e.rightColor),n.push(o)}return ub(n)}}),jy({type:"middle",names:["\\middle"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=xw(t[0],e);if(!e.parser.leftrightDepth)throw new Ag("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return"."===e.delim?n=eb(t,[]):(n=dw(e.delim,1,t,e.mode,[])).isMiddle={delim:e.delim,options:t},n},mathmlBuilder:(e,t)=>{var n="\\vert"===e.delim||"|"===e.delim?db("|","text"):db(e.delim,e.mode),r=new ib("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}}),jy({type:"enclose",names:["\\colorbox"],numArgs:2,allowedInText:!0,argTypes:["color","hbox"],handler(e,t,n){var{parser:r,funcName:o}=e,i=Ib(t[0],"color-token").color,a=t[1];return{type:"enclose",mode:r.mode,label:o,backgroundColor:i,body:a}},htmlBuilder:(e,t)=>{var n,r,o,i=Ay(tb(e.body,t),t),a=e.label.slice(1),s=t.sizeMultiplier,l=Pg(e.body);if("sout"===a)(n=ky(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/s,r=-.5*t.fontMetrics().xHeight;else if("phase"===a){var c=rv({number:.6,unit:"pt"},t),d=rv({number:.35,unit:"ex"},t);s/=t.havingBaseSizing().sizeMultiplier;var u=i.height+i.depth+c+d;i.style.paddingLeft=ov(u/2+c);var h=Math.floor(1e3*u*s),p=function(e){return"M400000 "+e+" H0 L"+e/2+" 0 l65 45 L145 "+(e-80)+" H400000z"}(h),m=new gv([new vv("phase",p)],{width:"400em",height:ov(h/1e3),viewBox:"0 0 400000 "+h,preserveAspectRatio:"xMinYMin slice"});(n=Cy(["hide-tail"],[m],t)).style.height=ov(u),r=i.depth+c+d}else{var f,g;/cancel/.test(a)?l||i.classes.push("cancel-pad"):"angl"===a?i.classes.push("anglpad"):i.classes.push("boxpad");var v=0;/box/.test(a)?(v=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),g=f=t.fontMetrics().fboxsep+("colorbox"===a?0:v)):"angl"===a?(f=4*(v=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness)),g=Math.max(0,.25-i.depth)):g=f=l?.2:0,n=function(e,t,n,r,o){var i,a=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(i=ky(["stretchy",t],[],o),"fbox"===t){var s=o.color&&o.getColor();s&&(i.style.borderColor=s)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new yv({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new yv({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new gv(l,{width:"100%",height:ov(a)});i=Cy([],[c],o)}return i.height=a,i.style.height=ov(a),i}(i,a,f,g,t),/fbox|boxed|fcolorbox/.test(a)?(n.style.borderStyle="solid",n.style.borderWidth=ov(v)):"angl"===a&&.049!==v&&(n.style.borderTopWidth=ov(v),n.style.borderRightWidth=ov(v)),r=i.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)o=My({positionType:"individualShift",children:[{type:"elem",elem:n,shift:r},{type:"elem",elem:i,shift:0}]});else{var y=/cancel|phase/.test(a)?["svg-align"]:[];o=My({positionType:"individualShift",children:[{type:"elem",elem:i,shift:0},{type:"elem",elem:n,shift:r,wrapperClasses:y}]})}return/cancel/.test(a)&&(o.height=i.height,o.depth=i.depth),/cancel/.test(a)&&!l?ky(["mord","cancel-lap"],[o],t):ky(["mord"],[o],t)},mathmlBuilder:(e,t)=>{var n,r=new ib(e.label.includes("colorbox")?"mpadded":"menclose",[vb(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var o=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+ov(o)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r}}),jy({type:"enclose",names:["\\fcolorbox"],numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"],handler(e,t,n){var{parser:r,funcName:o}=e,i=Ib(t[0],"color-token").color,a=Ib(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:r.mode,label:o,backgroundColor:a,borderColor:i,body:s}}}),jy({type:"enclose",names:["\\fbox"],numArgs:1,argTypes:["hbox"],allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}}),jy({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"enclose",mode:n.mode,label:r,body:o}}}),jy({type:"enclose",names:["\\sout"],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e;"math"===n.mode&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var o=t[0];return{type:"enclose",mode:n.mode,label:r,body:o}}}),jy({type:"enclose",names:["\\angl"],numArgs:1,argTypes:["hbox"],allowedInText:!1,handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var Cw={};function _w(e){for(var{type:t,names:n,props:r,handler:o,htmlBuilder:i,mathmlBuilder:a}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:o},l=0;l<n.length;++l)Cw[n[l]]=s;i&&(Hy[t]=i),a&&(qy[t]=a)}var Sw={};function Aw(e,t){Sw[e]=t}class Mw{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new Mw(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class Tw{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new Tw(t,Mw.range(this,e))}}function Ew(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for("\\relax"===n&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);"\\hline"===n||"\\hdashline"===n;)e.consume(),t.push("\\hdashline"===n),e.consumeSpaces(),n=e.fetch().text;return t}var Lw=e=>{if(!e.parser.settings.displayMode)throw new Ag("{"+e.envName+"} can be used only in display mode.")},Ow=new Set(["gather","gather*"]);function Iw(e){if(!e.includes("ed"))return!e.includes("*")}function Rw(e,t,n){var{hskipBeforeAndAfter:r,addJot:o,cols:i,arraystretch:a,colSeparationType:s,autoTag:l,singleRow:c,emptySingleRow:d,maxNumCols:u,leqno:h}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var p=e.gullet.expandMacroAsText("\\arraystretch");if(null==p)a=1;else if(!(a=parseFloat(p))||a<0)throw new Ag("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var m=[],f=[m],g=[],v=[],y=null!=l?[]:void 0;function b(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function w(){y&&(e.gullet.macros.get("\\df@tag")?(y.push(e.subparse([new Tw("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):y.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(b(),v.push(Ew(e));;){var x=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var k={type:"ordgroup",mode:e.mode,body:x};n&&(k={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[k]}),m.push(k);var C=e.fetch().text;if("&"===C){if(u&&m.length===u){if(c||s)throw new Ag("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===C){w(),1===m.length&&"styling"===k.type&&1===k.body.length&&"ordgroup"===k.body[0].type&&0===k.body[0].body.length&&(f.length>1||!d)&&f.pop(),v.length<f.length+1&&v.push([]);break}if("\\\\"!==C)throw new Ag("Expected & or \\\\ or \\cr or \\end",e.nextToken);e.consume();var _=void 0;" "!==e.gullet.future().text&&(_=e.parseSizeGroup(!0)),g.push(_?_.value:null),w(),v.push(Ew(e)),m=[],f.push(m),b()}}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:o,arraystretch:a,body:f,cols:i,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:v,colSeparationType:s,tags:y,leqno:h}}function Pw(e){return"d"===e.slice(0,1)?"display":"text"}var Bw=function(e,t){var n,r,o=e.body.length,i=e.hLinesBeforeRow,a=0,s=new Array(o),l=[],c=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),d=1/t.fontMetrics().ptPerEm,u=5*d;e.colSeparationType&&"small"===e.colSeparationType&&(u=t.havingStyle(Ug.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var h="CD"===e.colSeparationType?rv({number:3,unit:"ex"},t):12*d,p=3*d,m=e.arraystretch*h,f=.7*m,g=.3*m,v=0;function y(e){for(var t=0;t<e.length;++t)t>0&&(v+=.25),l.push({pos:v,isDashed:e[t]})}for(y(i[0]),n=0;n<e.body.length;++n){var b=e.body[n],w=f,x=g;a<b.length&&(a=b.length);var k={cells:new Array(b.length),height:0,depth:0,pos:0};for(r=0;r<b.length;++r){var C=tb(b[r],t);x<C.depth&&(x=C.depth),w<C.height&&(w=C.height),k.cells[r]=C}var _=e.rowGaps[n],S=0;_&&(S=rv(_,t))>0&&(x<(S+=g)&&(x=S),S=0),e.addJot&&n<e.body.length-1&&(x+=p),k.height=w,k.depth=x,v+=w,k.pos=v,v+=x+S,s[n]=k,y(i[n+1])}var A,M,T=v/2+t.fontMetrics().axisHeight,E=e.cols||[],L=[],O=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<o;++n){var I=s[n],R=I.pos-T,P=e.tags[n],B=void 0;(B=!0===P?ky(["eqn-num"],[],t):ky([],!1===P?[]:Xy(P,t,!0),t)).depth=I.depth,B.height=I.height,O.push({type:"elem",elem:B,shift:R})}for(r=0,M=0;r<a||M<E.length;++r,++M){for(var z,D=E[M],N=!0;"separator"===(null==(H=D)?void 0:H.type);){var H;if(N||((A=ky(["arraycolsep"],[])).style.width=ov(t.fontMetrics().doubleRuleSep),L.push(A)),"|"!==D.separator&&":"!==D.separator)throw new Ag("Invalid separator type: "+D.separator);var q="|"===D.separator?"solid":"dashed",j=ky(["vertical-separator"],[],t);j.style.height=ov(v),j.style.borderRightWidth=ov(c),j.style.borderRightStyle=q,j.style.margin="0 "+ov(-c/2);var V=v-T;V&&(j.style.verticalAlign=ov(-V)),L.push(j),D=E[++M],N=!1}if(!(r>=a)){var F,$,W=void 0;(r>0||e.hskipBeforeAndAfter)&&0!==(W=null!=(F=null==($=D)?void 0:$.pregap)?F:u)&&((A=ky(["arraycolsep"],[])).style.width=ov(W),L.push(A));var U=[];for(n=0;n<o;++n){var G=s[n],Z=G.cells[r];if(Z){var X=G.pos-T;Z.depth=G.depth,Z.height=G.height,U.push({type:"elem",elem:Z,shift:X})}}var K,Y,J=My({positionType:"individualShift",children:U}),Q=ky(["col-align-"+((null==(z=D)?void 0:z.align)||"c")],[J]);L.push(Q),(r<a-1||e.hskipBeforeAndAfter)&&0!==(W=null!=(K=null==(Y=D)?void 0:Y.postgap)?K:u)&&((A=ky(["arraycolsep"],[])).style.width=ov(W),L.push(A))}}var ee=ky(["mtable"],L);if(l.length>0){for(var te=_y("hline",t,c),ne=_y("hdashline",t,c),re=[{type:"elem",elem:ee,shift:0}];l.length>0;){var oe=l.pop(),ie=oe.pos-T;oe.isDashed?re.push({type:"elem",elem:ne,shift:ie}):re.push({type:"elem",elem:te,shift:ie})}ee=My({positionType:"individualShift",children:re})}if(0===O.length)return ky(["mord"],[ee],t);var ae=My({positionType:"individualShift",children:O}),se=ky(["tag"],[ae],t);return Sy([ee,se])},zw={c:"center ",l:"left ",r:"right "},Dw=function(e,t){for(var n=[],r=new ib("mtd",[],["mtr-glue"]),o=new ib("mtd",[],["mml-eqn-num"]),i=0;i<e.body.length;i++){for(var a=e.body[i],s=[],l=0;l<a.length;l++)s.push(new ib("mtd",[vb(a[l],t)]));e.tags&&e.tags[i]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(o):s.push(o)),n.push(new ib("mtr",s))}var c=new ib("mtable",n),d=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",ov(d));var u="",h="";if(e.cols&&e.cols.length>0){var p=e.cols,m="",f=!1,g=0,v=p.length;"separator"===p[0].type&&(u+="top ",g=1),"separator"===p[p.length-1].type&&(u+="bottom ",v-=1);for(var y=g;y<v;y++){var b=p[y];"align"===b.type?(h+=zw[b.align],f&&(m+="none "),f=!0):"separator"===b.type&&f&&(m+="|"===b.separator?"solid ":"dashed ",f=!1)}c.setAttribute("columnalign",h.trim()),/[sd]/.test(m)&&c.setAttribute("columnlines",m.trim())}if("align"===e.colSeparationType){for(var w=e.cols||[],x="",k=1;k<w.length;k++)x+=k%2?"0em ":"1em ";c.setAttribute("columnspacing",x.trim())}else"alignat"===e.colSeparationType||"gather"===e.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===e.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var C="",_=e.hLinesBeforeRow;u+=_[0].length>0?"left ":"",u+=_[_.length-1].length>0?"right ":"";for(var S=1;S<_.length-1;S++)C+=0===_[S].length?"none ":_[S][0]?"dashed ":"solid ";return/[sd]/.test(C)&&c.setAttribute("rowlines",C.trim()),""!==u&&(c=new ib("menclose",[c])).setAttribute("notation",u.trim()),e.arraystretch&&e.arraystretch<1&&(c=new ib("mstyle",[c])).setAttribute("scriptlevel","1"),c},Nw=function(e,t){e.envName.includes("ed")||Lw(e);var n=[],r="split"===e.envName,o=Rw(e.parser,{cols:n,addJot:!0,autoTag:r?void 0:Iw(e.envName),emptySingleRow:!0,colSeparationType:e.envName.includes("at")?"alignat":"align",maxNumCols:r?2:void 0,leqno:e.parser.settings.leqno},"display"),i=0,a=0,s={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var l="",c=0;c<t[0].body.length;c++)l+=Ib(t[0].body[c],"textord").text;i=Number(l),a=2*i}var d=!a;o.body.forEach(function(e){for(var t=1;t<e.length;t+=2){var n=Ib(e[t],"styling");Ib(n.body[0],"ordgroup").body.unshift(s)}if(d)a<e.length&&(a=e.length);else{var r=e.length/2;if(i<r)throw new Ag("Too many math in a row: expected "+i+", but got "+r,e[0])}});for(var u=0;u<a;++u){var h="r",p=0;u%2==1?h="l":u>0&&d&&(p=1),n[u]={type:"align",align:h,pregap:p,postgap:0}}return o.colSeparationType=d?"align":"alignat",o};_w({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(Pb(t[0])?[t[0]]:Ib(t[0],"ordgroup").body).map(function(e){var t=Rb(e).text;if("lcr".includes(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new Ag("Unknown column alignment: "+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return Rw(e.parser,r,Pw(e.envName))},htmlBuilder:Bw,mathmlBuilder:Dw}),_w({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===e.envName.charAt(e.envName.length-1)){var o=e.parser;if(o.consumeSpaces(),"["===o.fetch().text){if(o.consume(),o.consumeSpaces(),n=o.fetch().text,!"lcr".includes(n))throw new Ag("Expected l or c or r",o.nextToken);o.consume(),o.consumeSpaces(),o.expect("]"),o.consume(),r.cols=[{type:"align",align:n}]}}var i=Rw(e.parser,r,Pw(e.envName)),a=Math.max(0,...i.body.map(e=>e.length));return i.cols=new Array(a).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:Bw,mathmlBuilder:Dw}),_w({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=Rw(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:Bw,mathmlBuilder:Dw}),_w({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(Pb(t[0])?[t[0]]:Ib(t[0],"ordgroup").body).map(function(e){var t=Rb(e).text;if("lc".includes(t))return{type:"align",align:t};throw new Ag("Unknown column alignment: "+t,e)});if(n.length>1)throw new Ag("{subarray} can contain only one column");var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},o=Rw(e.parser,r,"script");if(o.body.length>0&&o.body[0].length>1)throw new Ag("{subarray} can contain only one column");return o},htmlBuilder:Bw,mathmlBuilder:Dw}),_w({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=Rw(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},Pw(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Bw,mathmlBuilder:Dw}),_w({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Nw,htmlBuilder:Bw,mathmlBuilder:Dw}),_w({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){Ow.has(e.envName)&&Lw(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Iw(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Rw(e.parser,t,"display")},htmlBuilder:Bw,mathmlBuilder:Dw}),_w({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Nw,htmlBuilder:Bw,mathmlBuilder:Dw}),_w({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Lw(e);var t={autoTag:Iw(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Rw(e.parser,t,"display")},htmlBuilder:Bw,mathmlBuilder:Dw}),_w({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(Lw(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===t[t.length-1].length&&t.pop();break}throw new Ag("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var r=[],o=[r],i=0;i<t.length;i++){for(var a=t[i],s=jb(),l=0;l<a.length;l++)if(Vb(a[l])){r.push(s);var c=Rb(a[l+=1]).text,d=new Array(2);if(d[0]={type:"ordgroup",mode:"math",body:[]},d[1]={type:"ordgroup",mode:"math",body:[]},"=|.".includes(c));else{if(!"<>AV".includes(c))throw new Ag('Expected one of "<>AV=|." after @',a[l]);for(var u=0;u<2;u++){for(var h=!0,p=l+1;p<a.length;p++){if(Fb(a[p],c)){h=!1,l=p;break}if(Vb(a[p]))throw new Ag("Missing a "+c+" character to complete a CD arrow.",a[p]);d[u].body.push(a[p])}if(h)throw new Ag("Missing a "+c+" character to complete a CD arrow.",a[l])}}var m={type:"styling",body:[$b(c,d,e)],mode:"math",style:"display",resetFont:!0};r.push(m),s=jb()}else s.body.push(a[l]);i%2==0?r.push(s):r.shift(),r=[],o.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:o,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(o[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(o.length+1).fill([])}}(e.parser)),htmlBuilder:Bw,mathmlBuilder:Dw}),Aw("\\nonumber","\\gdef\\@eqnsw{0}"),Aw("\\notag","\\nonumber"),jy({type:"text",names:["\\hline","\\hdashline"],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(e,t){throw new Ag(e.funcName+" valid only within array environment")}});var Hw=Cw;jy({type:"environment",names:["\\begin","\\end"],numArgs:1,argTypes:["text"],handler(e,t){var{parser:n,funcName:r}=e,o=t[0];if("ordgroup"!==o.type)throw new Ag("Invalid environment name",o);for(var i="",a=0;a<o.body.length;++a)i+=Ib(o.body[a],"textord").text;if("\\begin"===r){if(!Hw.hasOwnProperty(i))throw new Ag("No such environment: "+i,o);var s=Hw[i],{args:l,optArgs:c}=n.parseArguments("\\begin{"+i+"}",s),d={mode:n.mode,envName:i,parser:n},u=s.handler(d,l,c);n.expect("\\end",!1);var h=n.nextToken,p=Ib(n.parseFunction(),"environment");if(p.name!==i)throw new Ag("Mismatch: \\begin{"+i+"} matched by \\end{"+p.name+"}",h);return u}return{type:"environment",mode:n.mode,name:i,nameGroup:o}}});var qw={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};jy({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],numArgs:1,allowedInArgument:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,o=Fy(t[0]),i=r in qw?qw[r]:r;return{type:"font",mode:n.mode,font:i.slice(1),body:o}},htmlBuilder:(e,t)=>{var n=e.font,r=t.withFont(n);return tb(e.body,r)},mathmlBuilder:(e,t)=>{var n=e.font,r=t.withFont(n);return vb(e.body,r)}}),jy({type:"mclass",names:["\\boldsymbol","\\bm"],numArgs:1,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"mclass",mode:n.mode,mclass:Hb(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:Pg(r)}}}),jy({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],numArgs:0,allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:o}=e,{mode:i}=n,a=n.parseExpression(!0,o);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:a}}}});var jw=(e,t)=>t?{type:"styling",mode:e.mode,style:t,body:[e]}:e;jy({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],numArgs:2,allowedInArgument:!0,handler:(e,t)=>{var n,{parser:r,funcName:o}=e,i=t[0],a=t[1],s=null,l=null;switch(o){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,s="(",l=")";break;case"\\\\bracefrac":n=!1,s="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,s="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var c="\\cfrac"===o,d=null;return c||o.startsWith("\\d")?d="display":o.startsWith("\\t")&&(d="text"),jw({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:c,hasBarLine:n,leftDelim:s,rightDelim:l,barSize:null},d)},htmlBuilder:(e,t)=>{var n,r=t.style,o=r.fracNum(),i=r.fracDen();n=t.havingStyle(o);var a=tb(e.numer,n,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;a.height=a.height<s?s:a.height,a.depth=a.depth<l?l:a.depth}n=t.havingStyle(i);var c,d,u,h,p,m,f,g,v,y,b=tb(e.denom,n,t);if(e.hasBarLine?(e.barSize?(d=rv(e.barSize,t),c=_y("frac-line",t,d)):c=_y("frac-line",t),d=c.height,u=c.height):(c=null,d=0,u=t.fontMetrics().defaultRuleThickness),r.size===Ug.DISPLAY.size?(h=t.fontMetrics().num1,p=d>0?3*u:7*u,m=t.fontMetrics().denom1):(d>0?(h=t.fontMetrics().num2,p=u):(h=t.fontMetrics().num3,p=3*u),m=t.fontMetrics().denom2),c){var w=t.fontMetrics().axisHeight;h-a.depth-(w+.5*d)<p&&(h+=p-(h-a.depth-(w+.5*d))),w-.5*d-(b.height-m)<p&&(m+=p-(w-.5*d-(b.height-m))),f=My({positionType:"individualShift",children:[{type:"elem",elem:b,shift:m},{type:"elem",elem:c,shift:-(w-.5*d)},{type:"elem",elem:a,shift:-h}]})}else{var x=h-a.depth-(b.height-m);x<p&&(h+=.5*(p-x),m+=.5*(p-x)),f=My({positionType:"individualShift",children:[{type:"elem",elem:b,shift:m},{type:"elem",elem:a,shift:-h}]})}return n=t.havingStyle(r),f.height*=n.sizeMultiplier/t.sizeMultiplier,f.depth*=n.sizeMultiplier/t.sizeMultiplier,g=r.size===Ug.DISPLAY.size?t.fontMetrics().delim1:r.size===Ug.SCRIPTSCRIPT.size?t.havingStyle(Ug.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,v=null==e.leftDelim?eb(t,["mopen"]):gw(e.leftDelim,g,!0,t.havingStyle(r),e.mode,["mopen"]),y=e.continued?ky([]):null==e.rightDelim?eb(t,["mclose"]):gw(e.rightDelim,g,!0,t.havingStyle(r),e.mode,["mclose"]),ky(["mord"].concat(n.sizingClasses(t)),[v,ky(["mfrac"],[f]),y],t)},mathmlBuilder:(e,t)=>{var n=new ib("mfrac",[vb(e.numer,t),vb(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var r=rv(e.barSize,t);n.setAttribute("linethickness",ov(r))}}else n.setAttribute("linethickness","0px");if(null!=e.leftDelim||null!=e.rightDelim){var o=[];if(null!=e.leftDelim){var i=new ib("mo",[new ab(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),o.push(i)}if(o.push(n),null!=e.rightDelim){var a=new ib("mo",[new ab(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}return ub(o)}return n}}),jy({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],numArgs:0,infix:!0,handler(e){var t,{parser:n,funcName:r,token:o}=e;switch(r){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:o}}});var Vw=["display","text","script","scriptscript"],Fw=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};jy({type:"genfrac",names:["\\genfrac"],numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"],handler(e,t){var n,{parser:r}=e,o=t[4],i=t[5],a=Fy(t[0]),s="atom"===a.type&&"open"===a.family?Fw(a.text):null,l=Fy(t[1]),c="atom"===l.type&&"close"===l.family?Fw(l.text):null,d=Ib(t[2],"size"),u=null;n=!!d.isBlank||(u=d.value).number>0;var h=null,p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var m=Ib(p.body[0],"textord");h=Vw[Number(m.text)]}}else p=Ib(p,"textord"),h=Vw[Number(p.text)];return jw({type:"genfrac",mode:r.mode,numer:o,denom:i,continued:!1,hasBarLine:n,barSize:u,leftDelim:s,rightDelim:c},h)}}),jy({type:"infix",names:["\\above"],numArgs:1,argTypes:["size"],infix:!0,handler(e,t){var{parser:n,funcName:r,token:o}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Ib(t[0],"size").value,token:o}}}),jy({type:"genfrac",names:["\\\\abovefrac"],numArgs:3,argTypes:["math","size","math"],handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0],i=Ib(t[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=t[2],s=i.number>0;return{type:"genfrac",mode:n.mode,numer:o,denom:a,continued:!1,hasBarLine:s,barSize:i,leftDelim:null,rightDelim:null}}});var $w=(e,t)=>{var n,r,o=t.style;"supsub"===e.type?(n=e.sup?tb(e.sup,t.havingStyle(o.sup()),t):tb(e.sub,t.havingStyle(o.sub()),t),r=Ib(e.base,"horizBrace")):r=Ib(e,"horizBrace");var i,a=tb(r.base,t.havingBaseStyle(Ug.DISPLAY)),s=Eb(r,t);if(i=r.isOver?My({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):My({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),n){var l=ky(["minner",r.isOver?"mover":"munder"],[i],t);i=r.isOver?My({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):My({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return ky(["minner",r.isOver?"mover":"munder"],[i],t)};jy({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:t[0]}},htmlBuilder:$w,mathmlBuilder:(e,t)=>{var n=Ab(e.label);return new ib(e.isOver?"mover":"munder",[vb(e.base,t),n])}}),jy({type:"href",names:["\\href"],numArgs:2,argTypes:["url","original"],allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[1],o=Ib(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:o})?{type:"href",mode:n.mode,href:o,body:$y(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=Xy(e.body,t,!1);return function(e,t,n,r){var o=new hv(e,[],n,r);return xy(o),o}(e.href,0,n,t)},mathmlBuilder:(e,t)=>{var n=gb(e.body,t);return n instanceof ib||(n=new ib("mrow",[n])),n.setAttribute("href",e.href),n}}),jy({type:"href",names:["\\url"],numArgs:1,argTypes:["url"],allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=Ib(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var o=[],i=0;i<r.length;i++){var a=r[i];"~"===a&&(a="\\textasciitilde"),o.push({type:"textord",mode:"text",text:a})}var s={type:"text",mode:n.mode,font:"\\texttt",body:o};return{type:"href",mode:n.mode,href:r,body:$y(s)}}}),jy({type:"hbox",names:["\\hbox"],numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0,handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:$y(t[0])}},htmlBuilder(e,t){var n=Xy(e.body,t.withFont(""),!1);return Sy(n)},mathmlBuilder:(e,t)=>new ib("mrow",fb(e.body,t.withFont("")))}),jy({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],numArgs:2,argTypes:["raw","original"],allowedInText:!0,handler:(e,t)=>{var n,{parser:r,funcName:o,token:i}=e,a=Ib(t[0],"raw").string,s=t[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(o){case"\\htmlClass":l.class=a,n={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,n={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,n={command:"\\htmlStyle",style:a};break;case"\\htmlData":for(var c=a.split(","),d=0;d<c.length;d++){var u=c[d],h=u.indexOf("=");if(h<0)throw new Ag("\\htmlData key/value '"+u+"' missing equals sign");var p=u.slice(0,h),m=u.slice(h+1);l["data-"+p.trim()]=m}n={command:"\\htmlData",attributes:l};break;default:throw new Error("Unrecognized html command")}return r.settings.isTrusted(n)?{type:"html",mode:r.mode,attributes:l,body:$y(s)}:r.formatUnsupportedCmd(o)},htmlBuilder:(e,t)=>{var n=Xy(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var o=ky(r,n,t);for(var i in e.attributes)"class"!==i&&e.attributes.hasOwnProperty(i)&&o.setAttribute(i,e.attributes[i]);return o},mathmlBuilder:(e,t)=>gb(e.body,t)}),jy({type:"htmlmathml",names:["\\html@mathml"],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:$y(t[0]),mathml:$y(t[1])}},htmlBuilder:(e,t)=>{var n=Xy(e.html,t,!1);return Sy(n)},mathmlBuilder:(e,t)=>gb(e.mathml,t)});var Ww=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new Ag("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!nv(n))throw new Ag("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};jy({type:"includegraphics",names:["\\includegraphics"],numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1,handler:(e,t,n)=>{var{parser:r}=e,o={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},s="";if(n[0])for(var l=Ib(n[0],"raw").string.split(","),c=0;c<l.length;c++){var d=l[c].split("=");if(2===d.length){var u=d[1].trim();switch(d[0].trim()){case"alt":s=u;break;case"width":o=Ww(u);break;case"height":i=Ww(u);break;case"totalheight":a=Ww(u);break;default:throw new Ag("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var h=Ib(t[0],"url").url;return""===s&&(s=(s=(s=h).replace(/^.*[\\/]/,"")).substring(0,s.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:h})?{type:"includegraphics",mode:r.mode,alt:s,width:o,height:i,totalheight:a,src:h}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=rv(e.height,t),r=0;e.totalheight.number>0&&(r=rv(e.totalheight,t)-n);var o=0;e.width.number>0&&(o=rv(e.width,t));var i={height:ov(n+r)};o>0&&(i.width=ov(o)),r>0&&(i.verticalAlign=ov(-r));var a=new pv(e.src,e.alt,i);return a.height=n,a.depth=r,a},mathmlBuilder:(e,t)=>{var n=new ib("mglyph",[]);n.setAttribute("alt",e.alt);var r=rv(e.height,t),o=0;if(e.totalheight.number>0&&(o=rv(e.totalheight,t)-r,n.setAttribute("valign",ov(-o))),n.setAttribute("height",ov(r+o)),e.width.number>0){var i=rv(e.width,t);n.setAttribute("width",ov(i))}return n.setAttribute("src",e.src),n}}),jy({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e,o=Ib(t[0],"size");if(n.settings.strict){var i="m"===r[1],a="mu"===o.value.unit;i?(a||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, not "+o.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:o.value}},htmlBuilder:(e,t)=>Ty(e.dimension,t),mathmlBuilder(e,t){var n=rv(e.dimension,t);return new sb(n)}}),jy({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:o}},htmlBuilder:(e,t)=>{var n;"clap"===e.alignment?(n=ky([],[tb(e.body,t)]),n=ky(["inner"],[n],t)):n=ky(["inner"],[tb(e.body,t)]);var r=ky(["fix"],[]),o=ky([e.alignment],[n,r],t),i=ky(["strut"]);return i.style.height=ov(o.height+o.depth),o.depth&&(i.style.verticalAlign=ov(-o.depth)),o.children.unshift(i),o=ky(["thinbox"],[o],t),ky(["mord","vbox"],[o],t)},mathmlBuilder:(e,t)=>{var n=new ib("mpadded",[vb(e.body,t)]);if("rlap"!==e.alignment){var r="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}}),jy({type:"styling",names:["\\(","$"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){var{funcName:n,parser:r}=e,o=r.mode;r.switchMode("math");var i="\\("===n?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(o),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}}),jy({type:"text",names:["\\)","\\]"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){throw new Ag("Mismatched "+e.funcName)}});var Uw=(e,t)=>{switch(t.style.size){case Ug.DISPLAY.size:return e.display;case Ug.TEXT.size:return e.text;case Ug.SCRIPT.size:return e.script;case Ug.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};jy({type:"mathchoice",names:["\\mathchoice"],numArgs:4,primitive:!0,handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:$y(t[0]),text:$y(t[1]),script:$y(t[2]),scriptscript:$y(t[3])}},htmlBuilder:(e,t)=>{var n=Uw(e,t),r=Xy(n,t,!1);return Sy(r)},mathmlBuilder:(e,t)=>{var n=Uw(e,t);return gb(n,t)}});var Gw=(e,t,n,r,o,i,a)=>{e=ky([],[e]);var s,l,c,d=n&&Pg(n);if(t){var u=tb(t,r.havingStyle(o.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var h=tb(n,r.havingStyle(o.sub()),r);s={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-h.height)}}if(l&&s){var p=r.fontMetrics().bigOpSpacing5+s.elem.height+s.elem.depth+s.kern+e.depth+a;c=My({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:ov(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:ov(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(s){var m=e.height-a;c=My({positionType:"top",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:ov(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e}]})}else{if(!l)return e;var f=e.depth+a;c=My({positionType:"bottom",positionData:f,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:ov(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}var g=[c];if(s&&0!==i&&!d){var v=ky(["mspace"],[],r);v.style.marginRight=ov(i),g.unshift(v)}return ky(["mop","op-limits"],g,r)},Zw=new Set(["\\smallint"]),Xw=(e,t)=>{var n,r,o,i=!1;"supsub"===e.type?(n=e.sup,r=e.sub,o=Ib(e.base,"op"),i=!0):o=Ib(e,"op");var a,s,l=t.style,c=!1;if(l.size===Ug.DISPLAY.size&&o.symbol&&!Zw.has(o.name)&&(c=!0),o.symbol){var d=c?"Size2-Regular":"Size1-Regular",u="";if("\\oiint"!==o.name&&"\\oiiint"!==o.name||(u=o.name.slice(1),o.name="oiint"===u?"\\iint":"\\iiint"),s=(a=gy(o.name,d,"math",t,["mop","op-symbol",c?"large-op":"small-op"])).italic,u.length>0){var h=Iy(u+"Size"+(c?"2":"1"),t);a=My({positionType:"individualShift",children:[{type:"elem",elem:a,shift:0},{type:"elem",elem:h,shift:c?.08:0}]}),o.name="\\"+u,a.classes.unshift("mop"),a.italic=s}}else if(o.body){var p=Xy(o.body,t,!0);1===p.length&&p[0]instanceof fv?(a=p[0]).classes[0]="mop":a=ky(["mop"],p,t)}else{for(var m=[],f=1;f<o.name.length;f++)m.push(vy(o.name[f],o.mode,t));a=ky(["mop"],m,t)}var g,v=0,y=0;return(a instanceof fv||"\\oiint"===o.name||"\\oiiint"===o.name)&&!o.suppressBaseShift&&(v=(a.height-a.depth)/2-t.fontMetrics().axisHeight,y=null!=(g=a.italic)?g:0),i?Gw(a,n,r,t,l,y,v):(v&&(a.style.position="relative",a.style.top=ov(v)),a)},Kw={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};jy({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],numArgs:0,handler:(e,t)=>{var{parser:n,funcName:r}=e,o=r;return 1===o.length&&(o=Kw[o]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:o}},htmlBuilder:Xw,mathmlBuilder:(e,t)=>{var n;if(e.symbol)n=new ib("mo",[db(e.name,e.mode)]),Zw.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new ib("mo",fb(e.body,t));else{n=new ib("mi",[new ab(e.name.slice(1))]);var r=new ib("mo",[db("","text")]);n=e.parentIsSupSub?new ib("mrow",[n,r]):ob([n,r])}return n}}),jy({type:"op",names:["\\mathop"],numArgs:1,primitive:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:$y(r)}}});var Yw={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};jy({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],numArgs:0,handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}}}),jy({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],numArgs:0,handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}}}),jy({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],numArgs:0,allowedInArgument:!0,handler(e){var{parser:t,funcName:n}=e,r=n;return 1===r.length&&(r=Yw[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}}});var Jw=(e,t)=>{var n,r,o,i,a=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,o=Ib(e.base,"operatorname"),a=!0):o=Ib(e,"operatorname"),o.body.length>0){for(var s=(o.body.map(e=>{var t="text"in e?e.text:void 0;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e})),l=Xy(s,t.withFont("mathrm"),!0),c=0;c<l.length;c++){var d=l[c];d instanceof fv&&(d.text=d.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}i=ky(["mop"],l,t)}else i=ky(["mop"],[],t);return a?Gw(i,n,r,t,t.style,0,0):i};function Qw(e,t,n){for(var r=Xy(e,t,!1),o=t.sizeMultiplier/n.sizeMultiplier,i=0;i<r.length;i++){var a=r[i].classes.indexOf("sizing");a<0?Array.prototype.push.apply(r[i].classes,t.sizingClasses(n)):r[i].classes[a+1]==="reset-size"+t.size&&(r[i].classes[a+1]="reset-size"+n.size),r[i].height*=o,r[i].depth*=o}return Sy(r)}jy({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],numArgs:1,handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"operatorname",mode:n.mode,body:$y(o),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:Jw,mathmlBuilder:(e,t)=>{for(var n=fb(e.body,t.withFont("mathrm")),r=!0,o=0;o<n.length;o++){var i=n[o];if(i instanceof sb);else if(i instanceof ib)switch(i.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":var a=i.children[0];1===i.children.length&&a instanceof ab?a.text=a.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break;default:r=!1}else r=!1}if(r){var s=n.map(e=>e.toText()).join("");n=[new ab(s)]}var l=new ib("mi",n);l.setAttribute("mathvariant","normal");var c=new ib("mo",[db("","text")]);return e.parentIsSupSub?new ib("mrow",[l,c]):ob([l,c])}}),Aw("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),Vy({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?Sy(Xy(e.body,t,!1)):ky(["mord"],Xy(e.body,t,!0),t),mathmlBuilder:(e,t)=>gb(e.body,t,!0)}),jy({type:"overline",names:["\\overline"],numArgs:1,handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=tb(e.body,t.havingCrampedStyle()),r=_y("overline-line",t),o=t.fontMetrics().defaultRuleThickness,i=My({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r},{type:"kern",size:o}]});return ky(["mord","overline"],[i],t)},mathmlBuilder(e,t){var n=new ib("mo",[new ab("‾")]);n.setAttribute("stretchy","true");var r=new ib("mover",[vb(e.body,t),n]);return r.setAttribute("accent","true"),r}}),jy({type:"phantom",names:["\\phantom"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:$y(r)}},htmlBuilder:(e,t)=>{var n=Xy(e.body,t.withPhantom(),!1);return Sy(n)},mathmlBuilder:(e,t)=>{var n=fb(e.body,t);return new ib("mphantom",n)}}),Aw("\\hphantom","\\smash{\\phantom{#1}}"),jy({type:"vphantom",names:["\\vphantom"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=ky(["inner"],[tb(e.body,t.withPhantom())]),r=ky(["fix"],[]);return ky(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=fb($y(e.body),t),r=new ib("mphantom",n),o=new ib("mpadded",[r]);return o.setAttribute("width","0px"),o}}),jy({type:"raisebox",names:["\\raisebox"],numArgs:2,argTypes:["size","hbox"],allowedInText:!0,handler(e,t){var{parser:n}=e,r=Ib(t[0],"size").value,o=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:o}},htmlBuilder(e,t){var n=tb(e.body,t),r=rv(e.dy,t);return My({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new ib("mpadded",[vb(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),jy({type:"internal",names:["\\relax"],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),jy({type:"rule",names:["\\rule"],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"],handler(e,t,n){var{parser:r}=e,o=n[0],i=Ib(t[0],"size"),a=Ib(t[1],"size");return{type:"rule",mode:r.mode,shift:o&&Ib(o,"size").value,width:i.value,height:a.value}},htmlBuilder(e,t){var n=ky(["mord","rule"],[],t),r=rv(e.width,t),o=rv(e.height,t),i=e.shift?rv(e.shift,t):0;return n.style.borderRightWidth=ov(r),n.style.borderTopWidth=ov(o),n.style.bottom=ov(i),n.width=r,n.height=o+i,n.depth=-i,n.maxFontSize=1.125*o*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=rv(e.width,t),r=rv(e.height,t),o=e.shift?rv(e.shift,t):0,i=t.color&&t.getColor()||"black",a=new ib("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",ov(n)),a.setAttribute("height",ov(r));var s=new ib("mpadded",[a]);return o>=0?s.setAttribute("height",ov(o)):(s.setAttribute("height",ov(o)),s.setAttribute("depth",ov(-o))),s.setAttribute("voffset",ov(o)),s}});var ex=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];jy({type:"sizing",names:ex,numArgs:0,allowedInText:!0,handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:o}=e,i=o.parseExpression(!1,n);return{type:"sizing",mode:o.mode,size:ex.indexOf(r)+1,body:i}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return Qw(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=fb(e.body,n),o=new ib("mstyle",r);return o.setAttribute("mathsize",ov(n.sizeMultiplier)),o}}),jy({type:"smash",names:["\\smash"],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(e,t,n)=>{var{parser:r}=e,o=!1,i=!1,a=n[0]&&Ib(n[0],"ordgroup");if(a)for(var s,l=0;l<a.body.length;++l)if("t"===(s=Rb(a.body[l]).text))o=!0;else{if("b"!==s){o=!1,i=!1;break}i=!0}else o=!0,i=!0;var c=t[0];return{type:"smash",mode:r.mode,body:c,smashHeight:o,smashDepth:i}},htmlBuilder:(e,t)=>{var n=ky([],[tb(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return ky(["mord","smash"],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);var o=My({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return ky(["mord"],[o],t)},mathmlBuilder:(e,t)=>{var n=new ib("mpadded",[vb(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),jy({type:"sqrt",names:["\\sqrt"],numArgs:1,numOptionalArgs:1,handler(e,t,n){var{parser:r}=e,o=n[0],i=t[0];return{type:"sqrt",mode:r.mode,body:i,index:o}},htmlBuilder(e,t){var n=tb(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=Ay(n,t);var r=t.fontMetrics().defaultRuleThickness,o=r;t.style.id<Ug.TEXT.id&&(o=t.fontMetrics().xHeight);var i=r+o/4,a=n.height+n.depth+i+r,{span:s,ruleWidth:l,advanceWidth:c}=function(e,t){var n,r,o,i,a,s=t.havingBaseSizing(),l=fw("\\surd",e*s.sizeMultiplier,pw,s),c=s.sizeMultiplier,d=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness);return"small"===l.type?(e<1?c=1:e<1.4&&(c=.7),o=(1+d)/c,(n=iw("sqrtMain",r=(1+d+ow)/c,i=1e3+1e3*d+80,d,t)).style.minWidth="0.853em",a=.833/c):"large"===l.type?(i=1080*cw[l.size],o=(cw[l.size]+d)/c,r=(cw[l.size]+d+ow)/c,(n=iw("sqrtSize"+l.size,r,i,d,t)).style.minWidth="1.02em",a=1/c):(r=e+d+ow,o=e+d,i=Math.floor(1e3*e+d)+80,(n=iw("sqrtTall",r,i,d,t)).style.minWidth="0.742em",a=1.056),n.height=o,n.style.height=ov(r),{span:n,advanceWidth:a,ruleWidth:(t.fontMetrics().sqrtRuleThickness+d)*c}}(a,t),d=s.height-l;d>n.height+n.depth+i&&(i=(i+d-n.height-n.depth)/2);var u=s.height-n.height-i-l;n.style.paddingLeft=ov(c);var h=My({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+u)},{type:"elem",elem:s},{type:"kern",size:l}]});if(e.index){var p=t.havingStyle(Ug.SCRIPTSCRIPT),m=tb(e.index,p,t),f=.6*(h.height-h.depth),g=My({positionType:"shift",positionData:-f,children:[{type:"elem",elem:m}]}),v=ky(["root"],[g]);return ky(["mord","sqrt"],[v,h],t)}return ky(["mord","sqrt"],[h],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new ib("mroot",[vb(n,t),vb(r,t)]):new ib("msqrt",[vb(n,t)])}});var tx={display:Ug.DISPLAY,text:Ug.TEXT,script:Ug.SCRIPT,scriptscript:Ug.SCRIPTSCRIPT};jy({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],numArgs:0,allowedInText:!0,primitive:!0,handler(e,t){var{breakOnTokenText:n,funcName:r,parser:o}=e,i=o.parseExpression(!0,n),a=r.slice(1,r.length-5);if(!function(e){return e in tx}(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:o.mode,style:a,body:i}},htmlBuilder(e,t){var n=tx[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont("")),Qw(e.body,r,t)},mathmlBuilder(e,t){var n=tx[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(""));var o=fb(e.body,r),i=new ib("mstyle",o),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return i.setAttribute("scriptlevel",a[0]),i.setAttribute("displaystyle",a[1]),i}}),Vy({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base;return n?"op"===n.type?n.limits&&(t.style.size===Ug.DISPLAY.size||n.alwaysHandleSupSub)?Xw:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===Ug.DISPLAY.size||n.limits)?Jw:null:"accent"===n.type?Pg(n.base)?zb:null:"horizBrace"===n.type&&!e.sub===n.isOver?$w:null:null}(e,t);if(n)return n(e,t);var r,o,i,{base:a,sup:s,sub:l}=e,c=tb(a,t),d=t.fontMetrics(),u=0,h=0,p=a&&Pg(a);if(s){var m=t.havingStyle(t.style.sup());r=tb(s,m,t),p||(u=c.height-m.fontMetrics().supDrop*m.sizeMultiplier/t.sizeMultiplier)}if(l){var f=t.havingStyle(t.style.sub());o=tb(l,f,t),p||(h=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/t.sizeMultiplier)}i=t.style===Ug.DISPLAY?d.sup1:t.style.cramped?d.sup3:d.sup2;var g,v=t.sizeMultiplier,y=ov(.5/d.ptPerEm/v),b=null;if(o){var w,x=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof fv||x)&&(b=ov(-(null!=(w=c.italic)?w:0)))}if(r&&o){u=Math.max(u,i,r.depth+.25*d.xHeight),h=Math.max(h,d.sub2);var k=4*d.defaultRuleThickness;if(u-r.depth-(o.height-h)<k){h=k-(u-r.depth)+o.height;var C=.8*d.xHeight-(u-r.depth);C>0&&(u+=C,h-=C)}g=My({positionType:"individualShift",children:[{type:"elem",elem:o,shift:h,marginRight:y,marginLeft:b},{type:"elem",elem:r,shift:-u,marginRight:y}]})}else if(o)h=Math.max(h,d.sub1,o.height-.8*d.xHeight),g=My({positionType:"shift",positionData:h,children:[{type:"elem",elem:o,marginLeft:b,marginRight:y}]});else{if(!r)throw new Error("supsub must have either sup or sub.");u=Math.max(u,i,r.depth+.25*d.xHeight),g=My({positionType:"shift",positionData:-u,children:[{type:"elem",elem:r,marginRight:y}]})}var _=Qy(c,"right")||"mord";return ky([_],[c,ky(["msupsub"],[g])],t)},mathmlBuilder(e,t){var n,r=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(r=!0,n=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var o,i=[vb(e.base,t)];if(e.sub&&i.push(vb(e.sub,t)),e.sup&&i.push(vb(e.sup,t)),r)o=n?"mover":"munder";else if(e.sub)if(e.sup){var a=e.base;o=a&&"op"===a.type&&a.limits&&t.style===Ug.DISPLAY||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(t.style===Ug.DISPLAY||a.limits)?"munderover":"msubsup"}else{var s=e.base;o=s&&"op"===s.type&&s.limits&&(t.style===Ug.DISPLAY||s.alwaysHandleSupSub)||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(s.limits||t.style===Ug.DISPLAY)?"munder":"msub"}else{var l=e.base;o=l&&"op"===l.type&&l.limits&&(t.style===Ug.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===Ug.DISPLAY)?"mover":"msup"}return new ib(o,i)}}),Vy({type:"atom",htmlBuilder:(e,t)=>vy(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new ib("mo",[db(e.text,e.mode)]);if("bin"===e.family){var r=pb(e,t);"bold-italic"===r&&n.setAttribute("mathvariant",r)}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var nx={mi:"italic",mn:"normal",mtext:"normal"};Vy({type:"mathord",htmlBuilder:(e,t)=>yy(e,t),mathmlBuilder(e,t){var n=new ib("mi",[db(e.text,e.mode,t)]),r=pb(e,t)||"italic";return r!==nx[n.type]&&n.setAttribute("mathvariant",r),n}}),Vy({type:"textord",htmlBuilder:(e,t)=>yy(e,t),mathmlBuilder(e,t){var n,r=db(e.text,e.mode,t),o=pb(e,t)||"normal";return n="text"===e.mode?new ib("mtext",[r]):/[0-9]/.test(e.text)?new ib("mn",[r]):"\\prime"===e.text?new ib("mo",[r]):new ib("mi",[r]),o!==nx[n.type]&&n.setAttribute("mathvariant",o),n}});var rx={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},ox={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Vy({type:"spacing",htmlBuilder(e,t){if(ox.hasOwnProperty(e.text)){var n=ox[e.text].className||"";if("text"===e.mode){var r=yy(e,t);return r.classes.push(n),r}return ky(["mspace",n],[vy(e.text,e.mode,t)],t)}if(rx.hasOwnProperty(e.text))return ky(["mspace",rx[e.text]],[],t);throw new Ag('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!ox.hasOwnProperty(e.text)){if(rx.hasOwnProperty(e.text))return new ib("mspace");throw new Ag('Unknown type of space "'+e.text+'"')}return new ib("mtext",[new ab(" ")])}});var ix=()=>{var e=new ib("mtd",[]);return e.setAttribute("width","50%"),e};Vy({type:"tag",mathmlBuilder(e,t){var n=new ib("mtable",[new ib("mtr",[ix(),new ib("mtd",[gb(e.body,t)]),ix(),new ib("mtd",[gb(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var ax={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},sx={"\\textbf":"textbf","\\textmd":"textmd"},lx={"\\textit":"textit","\\textup":"textup"},cx=(e,t)=>{var n=e.font;return n?ax[n]?t.withTextFontFamily(ax[n]):sx[n]?t.withTextFontWeight(sx[n]):"\\emph"===n?"textit"===t.fontShape?t.withTextFontShape("textup"):t.withTextFontShape("textit"):t.withTextFontShape(lx[n]):t};jy({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"text",mode:n.mode,body:$y(o),font:r}},htmlBuilder(e,t){var n=cx(e,t),r=Xy(e.body,n,!0);return ky(["mord","text"],r,n)},mathmlBuilder(e,t){var n=cx(e,t);return gb(e.body,n)}}),jy({type:"underline",names:["\\underline"],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=tb(e.body,t),r=_y("underline-line",t),o=t.fontMetrics().defaultRuleThickness,i=My({positionType:"top",positionData:n.height,children:[{type:"kern",size:o},{type:"elem",elem:r},{type:"kern",size:3*o},{type:"elem",elem:n}]});return ky(["mord","underline"],[i],t)},mathmlBuilder(e,t){var n=new ib("mo",[new ab("‾")]);n.setAttribute("stretchy","true");var r=new ib("munder",[vb(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),jy({type:"vcenter",names:["\\vcenter"],numArgs:1,argTypes:["original"],allowedInText:!1,handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=tb(e.body,t),r=t.fontMetrics().axisHeight,o=.5*(n.height-r-(n.depth+r));return My({positionType:"shift",positionData:o,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new ib("mpadded",[vb(e.body,t)],["vcenter"]);return new ib("mrow",[n])}}),jy({type:"verb",names:["\\verb"],numArgs:0,allowedInText:!0,handler(e,t,n){throw new Ag("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=dx(e),r=[],o=t.havingStyle(t.style.text()),i=0;i<n.length;i++){var a=n[i];"~"===a&&(a="\\textasciitilde"),r.push(gy(a,"Typewriter-Regular",e.mode,o,["mord","texttt"]))}return ky(["mord","text"].concat(o.sizingClasses(t)),wy(r),o)},mathmlBuilder(e,t){var n=new ab(dx(e)),r=new ib("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var dx=e=>e.body.replace(/ /g,e.star?"␣":" "),ux=Ny,hx="[ \r\n\t]",px="(\\\\[a-zA-Z@]+)"+hx+"*",mx="[̀-ͯ]",fx=new RegExp(mx+"+$"),gx="("+hx+"+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧-豈-]"+mx+"*|[\ud800-\udbff][\udc00-\udfff]"+mx+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+px+"|\\\\[^\ud800-\udfff])";class vx{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(gx,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Tw("EOF",new Mw(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new Ag("Unexpected character: '"+e[t]+"'",new Tw(e[t],new Mw(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[r]){var o=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===o?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=o+1,this.lex()}return new Tw(r,new Mw(this,t,this.tokenRegex.lastIndex))}}class yx{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new Ag("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(void 0===n&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var o=this.undefStack[this.undefStack.length-1];o&&!o.hasOwnProperty(e)&&(o[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var bx=Sw;Aw("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),Aw("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),Aw("\\@firstoftwo",function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),Aw("\\@secondoftwo",function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),Aw("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return 1===t[0].length&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),Aw("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Aw("\\TextOrMath",function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var wx={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Aw("\\char",function(e){var t,n=e.popToken(),r=0;if("'"===n.text)t=8,n=e.popToken();else if('"'===n.text)t=16,n=e.popToken();else if("`"===n.text)if("\\"===(n=e.popToken()).text[0])r=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new Ag("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(null==(r=wx[n.text])||r>=t)throw new Ag("Invalid base-"+t+" digit "+n.text);for(var o;null!=(o=wx[e.future().text])&&o<t;)r*=t,r+=o,e.popToken()}return"\\@char{"+r+"}"});var xx=(e,t,n,r)=>{var o=e.consumeArg().tokens;if(1!==o.length)throw new Ag("\\newcommand's first argument must be a macro name");var i=o[0].text,a=e.isDefined(i);if(a&&!t)throw new Ag("\\newcommand{"+i+"} attempting to redefine "+i+"; use \\renewcommand");if(!a&&!n)throw new Ag("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var s=0;if(1===(o=e.consumeArg().tokens).length&&"["===o[0].text){for(var l="",c=e.expandNextToken();"]"!==c.text&&"EOF"!==c.text;)l+=c.text,c=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Ag("Invalid number of arguments: "+l);s=parseInt(l),o=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:o,numArgs:s}),""};Aw("\\newcommand",e=>xx(e,!1,!0,!1)),Aw("\\renewcommand",e=>xx(e,!0,!1,!1)),Aw("\\providecommand",e=>xx(e,!0,!0,!0)),Aw("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join("")),""}),Aw("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join("")),""}),Aw("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),ux[n],_v.math[n],_v.text[n]),""}),Aw("\\bgroup","{"),Aw("\\egroup","}"),Aw("~","\\nobreakspace"),Aw("\\lq","`"),Aw("\\rq","'"),Aw("\\aa","\\r a"),Aw("\\AA","\\r A"),Aw("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),Aw("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Aw("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),Aw("ℬ","\\mathscr{B}"),Aw("ℰ","\\mathscr{E}"),Aw("ℱ","\\mathscr{F}"),Aw("ℋ","\\mathscr{H}"),Aw("ℐ","\\mathscr{I}"),Aw("ℒ","\\mathscr{L}"),Aw("ℳ","\\mathscr{M}"),Aw("ℛ","\\mathscr{R}"),Aw("ℭ","\\mathfrak{C}"),Aw("ℌ","\\mathfrak{H}"),Aw("ℨ","\\mathfrak{Z}"),Aw("\\Bbbk","\\Bbb{k}"),Aw("\\llap","\\mathllap{\\textrm{#1}}"),Aw("\\rlap","\\mathrlap{\\textrm{#1}}"),Aw("\\clap","\\mathclap{\\textrm{#1}}"),Aw("\\mathstrut","\\vphantom{(}"),Aw("\\underbar","\\underline{\\text{#1}}"),Aw("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}'),Aw("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),Aw("\\ne","\\neq"),Aw("≠","\\neq"),Aw("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),Aw("∉","\\notin"),Aw("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),Aw("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),Aw("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),Aw("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),Aw("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),Aw("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),Aw("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),Aw("⟂","\\perp"),Aw("‼","\\mathclose{!\\mkern-0.8mu!}"),Aw("∌","\\notni"),Aw("⌜","\\ulcorner"),Aw("⌝","\\urcorner"),Aw("⌞","\\llcorner"),Aw("⌟","\\lrcorner"),Aw("©","\\copyright"),Aw("®","\\textregistered"),Aw("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),Aw("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),Aw("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),Aw("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),Aw("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),Aw("⋮","\\vdots"),Aw("\\varGamma","\\mathit{\\Gamma}"),Aw("\\varDelta","\\mathit{\\Delta}"),Aw("\\varTheta","\\mathit{\\Theta}"),Aw("\\varLambda","\\mathit{\\Lambda}"),Aw("\\varXi","\\mathit{\\Xi}"),Aw("\\varPi","\\mathit{\\Pi}"),Aw("\\varSigma","\\mathit{\\Sigma}"),Aw("\\varUpsilon","\\mathit{\\Upsilon}"),Aw("\\varPhi","\\mathit{\\Phi}"),Aw("\\varPsi","\\mathit{\\Psi}"),Aw("\\varOmega","\\mathit{\\Omega}"),Aw("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Aw("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),Aw("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Aw("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Aw("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Aw("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),Aw("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),Aw("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var kx={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},Cx=new Set(["bin","rel"]);Aw("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in kx?t=kx[n]:("\\not"===n.slice(0,4)||n in _v.math&&Cx.has(_v.math[n].group))&&(t="\\dotsb"),t});var _x={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Aw("\\dotso",function(e){return e.future().text in _x?"\\ldots\\,":"\\ldots"}),Aw("\\dotsc",function(e){var t=e.future().text;return t in _x&&","!==t?"\\ldots\\,":"\\ldots"}),Aw("\\cdots",function(e){return e.future().text in _x?"\\@cdots\\,":"\\@cdots"}),Aw("\\dotsb","\\cdots"),Aw("\\dotsm","\\cdots"),Aw("\\dotsi","\\!\\cdots"),Aw("\\dotsx","\\ldots\\,"),Aw("\\DOTSI","\\relax"),Aw("\\DOTSB","\\relax"),Aw("\\DOTSX","\\relax"),Aw("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Aw("\\,","\\tmspace+{3mu}{.1667em}"),Aw("\\thinspace","\\,"),Aw("\\>","\\mskip{4mu}"),Aw("\\:","\\tmspace+{4mu}{.2222em}"),Aw("\\medspace","\\:"),Aw("\\;","\\tmspace+{5mu}{.2777em}"),Aw("\\thickspace","\\;"),Aw("\\!","\\tmspace-{3mu}{.1667em}"),Aw("\\negthinspace","\\!"),Aw("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Aw("\\negthickspace","\\tmspace-{5mu}{.277em}"),Aw("\\enspace","\\kern.5em "),Aw("\\enskip","\\hskip.5em\\relax"),Aw("\\quad","\\hskip1em\\relax"),Aw("\\qquad","\\hskip2em\\relax"),Aw("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Aw("\\tag@paren","\\tag@literal{({#1})}"),Aw("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ag("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),Aw("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Aw("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Aw("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Aw("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Aw("\\newline","\\\\\\relax"),Aw("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Sx=ov(bv["Main-Regular"]["T".charCodeAt(0)][1]-.7*bv["Main-Regular"]["A".charCodeAt(0)][1]);Aw("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+Sx+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),Aw("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+Sx+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),Aw("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Aw("\\@hspace","\\hskip #1\\relax"),Aw("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Aw("\\ordinarycolon",":"),Aw("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Aw("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Aw("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Aw("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Aw("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Aw("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Aw("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Aw("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Aw("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Aw("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Aw("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Aw("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Aw("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Aw("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Aw("∷","\\dblcolon"),Aw("∹","\\eqcolon"),Aw("≔","\\coloneqq"),Aw("≕","\\eqqcolon"),Aw("⩴","\\Coloneqq"),Aw("\\ratio","\\vcentcolon"),Aw("\\coloncolon","\\dblcolon"),Aw("\\colonequals","\\coloneqq"),Aw("\\coloncolonequals","\\Coloneqq"),Aw("\\equalscolon","\\eqqcolon"),Aw("\\equalscoloncolon","\\Eqqcolon"),Aw("\\colonminus","\\coloneq"),Aw("\\coloncolonminus","\\Coloneq"),Aw("\\minuscolon","\\eqcolon"),Aw("\\minuscoloncolon","\\Eqcolon"),Aw("\\coloncolonapprox","\\Colonapprox"),Aw("\\coloncolonsim","\\Colonsim"),Aw("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Aw("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Aw("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Aw("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Aw("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),Aw("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Aw("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Aw("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),Aw("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),Aw("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),Aw("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),Aw("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),Aw("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),Aw("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),Aw("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),Aw("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),Aw("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),Aw("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),Aw("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),Aw("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),Aw("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),Aw("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),Aw("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),Aw("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),Aw("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),Aw("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),Aw("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),Aw("\\imath","\\html@mathml{\\@imath}{ı}"),Aw("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),Aw("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),Aw("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),Aw("⟦","\\llbracket"),Aw("⟧","\\rrbracket"),Aw("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),Aw("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),Aw("⦃","\\lBrace"),Aw("⦄","\\rBrace"),Aw("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),Aw("⦵","\\minuso"),Aw("\\darr","\\downarrow"),Aw("\\dArr","\\Downarrow"),Aw("\\Darr","\\Downarrow"),Aw("\\lang","\\langle"),Aw("\\rang","\\rangle"),Aw("\\uarr","\\uparrow"),Aw("\\uArr","\\Uparrow"),Aw("\\Uarr","\\Uparrow"),Aw("\\N","\\mathbb{N}"),Aw("\\R","\\mathbb{R}"),Aw("\\Z","\\mathbb{Z}"),Aw("\\alef","\\aleph"),Aw("\\alefsym","\\aleph"),Aw("\\Alpha","\\mathrm{A}"),Aw("\\Beta","\\mathrm{B}"),Aw("\\bull","\\bullet"),Aw("\\Chi","\\mathrm{X}"),Aw("\\clubs","\\clubsuit"),Aw("\\cnums","\\mathbb{C}"),Aw("\\Complex","\\mathbb{C}"),Aw("\\Dagger","\\ddagger"),Aw("\\diamonds","\\diamondsuit"),Aw("\\empty","\\emptyset"),Aw("\\Epsilon","\\mathrm{E}"),Aw("\\Eta","\\mathrm{H}"),Aw("\\exist","\\exists"),Aw("\\harr","\\leftrightarrow"),Aw("\\hArr","\\Leftrightarrow"),Aw("\\Harr","\\Leftrightarrow"),Aw("\\hearts","\\heartsuit"),Aw("\\image","\\Im"),Aw("\\infin","\\infty"),Aw("\\Iota","\\mathrm{I}"),Aw("\\isin","\\in"),Aw("\\Kappa","\\mathrm{K}"),Aw("\\larr","\\leftarrow"),Aw("\\lArr","\\Leftarrow"),Aw("\\Larr","\\Leftarrow"),Aw("\\lrarr","\\leftrightarrow"),Aw("\\lrArr","\\Leftrightarrow"),Aw("\\Lrarr","\\Leftrightarrow"),Aw("\\Mu","\\mathrm{M}"),Aw("\\natnums","\\mathbb{N}"),Aw("\\Nu","\\mathrm{N}"),Aw("\\Omicron","\\mathrm{O}"),Aw("\\plusmn","\\pm"),Aw("\\rarr","\\rightarrow"),Aw("\\rArr","\\Rightarrow"),Aw("\\Rarr","\\Rightarrow"),Aw("\\real","\\Re"),Aw("\\reals","\\mathbb{R}"),Aw("\\Reals","\\mathbb{R}"),Aw("\\Rho","\\mathrm{P}"),Aw("\\sdot","\\cdot"),Aw("\\sect","\\S"),Aw("\\spades","\\spadesuit"),Aw("\\sub","\\subset"),Aw("\\sube","\\subseteq"),Aw("\\supe","\\supseteq"),Aw("\\Tau","\\mathrm{T}"),Aw("\\thetasym","\\vartheta"),Aw("\\weierp","\\wp"),Aw("\\Zeta","\\mathrm{Z}"),Aw("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Aw("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Aw("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Aw("\\bra","\\mathinner{\\langle{#1}|}"),Aw("\\ket","\\mathinner{|{#1}\\rangle}"),Aw("\\braket","\\mathinner{\\langle{#1}\\rangle}"),Aw("\\Bra","\\left\\langle#1\\right|"),Aw("\\Ket","\\left|#1\\right\\rangle");var Ax=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,o=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.macros.get("|"),s=t.macros.get("\\|");t.macros.beginGroup();var l=t=>n=>{e&&(n.macros.set("|",a),o.length&&n.macros.set("\\|",s));var i=t;return!t&&o.length&&"|"===n.future().text&&(n.popToken(),i=!0),{tokens:i?o:r,numArgs:0}};t.macros.set("|",l(!1)),o.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,d=t.expandTokens([...i,...c,...n]);return t.macros.endGroup(),{tokens:d.reverse(),numArgs:0}};Aw("\\bra@ket",Ax(!1)),Aw("\\bra@set",Ax(!0)),Aw("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),Aw("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),Aw("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),Aw("\\angln","{\\angl n}"),Aw("\\blue","\\textcolor{##6495ed}{#1}"),Aw("\\orange","\\textcolor{##ffa500}{#1}"),Aw("\\pink","\\textcolor{##ff00af}{#1}"),Aw("\\red","\\textcolor{##df0030}{#1}"),Aw("\\green","\\textcolor{##28ae7b}{#1}"),Aw("\\gray","\\textcolor{gray}{#1}"),Aw("\\purple","\\textcolor{##9d38bd}{#1}"),Aw("\\blueA","\\textcolor{##ccfaff}{#1}"),Aw("\\blueB","\\textcolor{##80f6ff}{#1}"),Aw("\\blueC","\\textcolor{##63d9ea}{#1}"),Aw("\\blueD","\\textcolor{##11accd}{#1}"),Aw("\\blueE","\\textcolor{##0c7f99}{#1}"),Aw("\\tealA","\\textcolor{##94fff5}{#1}"),Aw("\\tealB","\\textcolor{##26edd5}{#1}"),Aw("\\tealC","\\textcolor{##01d1c1}{#1}"),Aw("\\tealD","\\textcolor{##01a995}{#1}"),Aw("\\tealE","\\textcolor{##208170}{#1}"),Aw("\\greenA","\\textcolor{##b6ffb0}{#1}"),Aw("\\greenB","\\textcolor{##8af281}{#1}"),Aw("\\greenC","\\textcolor{##74cf70}{#1}"),Aw("\\greenD","\\textcolor{##1fab54}{#1}"),Aw("\\greenE","\\textcolor{##0d923f}{#1}"),Aw("\\goldA","\\textcolor{##ffd0a9}{#1}"),Aw("\\goldB","\\textcolor{##ffbb71}{#1}"),Aw("\\goldC","\\textcolor{##ff9c39}{#1}"),Aw("\\goldD","\\textcolor{##e07d10}{#1}"),Aw("\\goldE","\\textcolor{##a75a05}{#1}"),Aw("\\redA","\\textcolor{##fca9a9}{#1}"),Aw("\\redB","\\textcolor{##ff8482}{#1}"),Aw("\\redC","\\textcolor{##f9685d}{#1}"),Aw("\\redD","\\textcolor{##e84d39}{#1}"),Aw("\\redE","\\textcolor{##bc2612}{#1}"),Aw("\\maroonA","\\textcolor{##ffbde0}{#1}"),Aw("\\maroonB","\\textcolor{##ff92c6}{#1}"),Aw("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Aw("\\maroonD","\\textcolor{##ca337c}{#1}"),Aw("\\maroonE","\\textcolor{##9e034e}{#1}"),Aw("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Aw("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Aw("\\purpleC","\\textcolor{##aa87ff}{#1}"),Aw("\\purpleD","\\textcolor{##7854ab}{#1}"),Aw("\\purpleE","\\textcolor{##543b78}{#1}"),Aw("\\mintA","\\textcolor{##f5f9e8}{#1}"),Aw("\\mintB","\\textcolor{##edf2df}{#1}"),Aw("\\mintC","\\textcolor{##e0e5cc}{#1}"),Aw("\\grayA","\\textcolor{##f6f7f7}{#1}"),Aw("\\grayB","\\textcolor{##f0f1f2}{#1}"),Aw("\\grayC","\\textcolor{##e3e5e6}{#1}"),Aw("\\grayD","\\textcolor{##d6d8da}{#1}"),Aw("\\grayE","\\textcolor{##babec2}{#1}"),Aw("\\grayF","\\textcolor{##888d93}{#1}"),Aw("\\grayG","\\textcolor{##626569}{#1}"),Aw("\\grayH","\\textcolor{##3b3e40}{#1}"),Aw("\\grayI","\\textcolor{##21242c}{#1}"),Aw("\\kaBlue","\\textcolor{##314453}{#1}"),Aw("\\kaGreen","\\textcolor{##71B307}{#1}");var Mx={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Tx{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new yx(bx,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new vx(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new Tw("EOF",n.loc)),this.pushTokens(r),new Tw("",Mw.range(t,n))}consumeSpaces(){for(;" "===this.future().text;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r,o=this.future(),i=0,a=0;do{if(r=this.popToken(),t.push(r),"{"===r.text)++i;else if("}"===r.text){if(-1===--i)throw new Ag("Extra }",r)}else if("EOF"===r.text)throw new Ag("Unexpected end of input in a macro argument, expected '"+(e&&n?e[a]:"}")+"'",r);if(e&&n)if((0===i||1===i&&"{"===e[a])&&r.text===e[a]){if(++a===e.length){t.splice(-a,a);break}}else a=0}while(0!==i||n);return"{"===o.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:o,end:r}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new Ag("The length of delimiters doesn't match the number of args!");for(var n=t[0],r=0;r<n.length;r++){var o=this.popToken();if(n[r]!==o.text)throw new Ag("Use of the macro doesn't match its definition",o)}}for(var i=[],a=0;a<e;a++)i.push(this.consumeArg(t&&t[a+1]).tokens);return i}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new Ag("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(null==r||e&&r.unexpandable){if(e&&null==r&&"\\"===n[0]&&!this.isDefined(n))throw new Ag("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var o=r.tokens,i=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs)for(var a=(o=o.slice()).length-1;a>=0;--a){var s=o[a];if("#"===s.text){if(0===a)throw new Ag("Incomplete placeholder at end of macro body",s);if("#"===(s=o[--a]).text)o.splice(a+1,1);else{if(!/^[1-9]$/.test(s.text))throw new Ag("Not a valid argument number",s);o.splice(a,2,...i[+s.text-1])}}}return this.pushTokens(o),o.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Tw(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(!1===this.expandOnce(!0)){var r=this.stack.pop();r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map(e=>e.text).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var n=this.lexer.catcodes[e];if(null!=n&&13!==n)return}var r="function"==typeof t?t(this):t;if("string"==typeof r){var o=0;if(r.includes("#"))for(var i=r.replace(/##/g,"");i.includes("#"+(o+1));)++o;for(var a=new vx(r,this.settings),s=[],l=a.lex();"EOF"!==l.text;)s.push(l),l=a.lex();return s.reverse(),{tokens:s,numArgs:o}}return r}isDefined(e){return this.macros.has(e)||ux.hasOwnProperty(e)||_v.math.hasOwnProperty(e)||_v.text.hasOwnProperty(e)||Mx.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:ux.hasOwnProperty(e)&&!ux[e].primitive}}var Ex=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Lx=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g","ʰ":"h","ⁱ":"i","ʲ":"j","ᵏ":"k","ˡ":"l","ᵐ":"m","ⁿ":"n","ᵒ":"o","ᵖ":"p","ʳ":"r","ˢ":"s","ᵗ":"t","ᵘ":"u","ᵛ":"v","ʷ":"w","ˣ":"x","ʸ":"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Ox={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Ix={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď","ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};class Rx{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Tx(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new Ag("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Tw("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){"math"===this.mode&&this.consumeSpaces();var r=this.fetch();if(Rx.endOfExpression.has(r.text))break;if(t&&r.text===t)break;if(e&&ux[r.text]&&ux[r.text].infix)break;var o=this.parseAtom(t);if(!o)break;"internal"!==o.type&&n.push(o)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t,n=-1,r=0;r<e.length;r++){var o=e[r];if("infix"===o.type){if(-1!==n)throw new Ag("only one infix operator per group",o.token);n=r,t=o.replaceWith}}if(-1!==n&&t){var i,a,s=e.slice(0,n),l=e.slice(n+1);return i=1===s.length&&"ordgroup"===s[0].type?s[0]:{type:"ordgroup",mode:this.mode,body:s},a=1===l.length&&"ordgroup"===l[0].type?l[0]:{type:"ordgroup",mode:this.mode,body:l},["\\\\abovefrac"===t?this.callFunction(t,[i,e[n],a],[]):this.callFunction(t,[i,a],[])]}return e}handleSupSubscript(e){var t,n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();do{var o;t=this.parseGroup(e)}while("internal"===(null==(o=t)?void 0:o.type));if(!t)throw new Ag("Expected group after '"+r+"'",n);return t}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var r={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t,n,r=this.parseGroup("atom",e);if("internal"===(null==r?void 0:r.type))return r;if("text"===this.mode)return r;for(;;){this.consumeSpaces();var o=this.fetch();if("\\limits"===o.text||"\\nolimits"===o.text){if(r&&"op"===r.type)r.limits="\\limits"===o.text,r.alwaysHandleSupSub=!0;else{if(!r||"operatorname"!==r.type)throw new Ag("Limit controls must follow a math operator",o);r.alwaysHandleSupSub&&(r.limits="\\limits"===o.text)}this.consume()}else if("^"===o.text){if(t)throw new Ag("Double superscript",o);t=this.handleSupSubscript("superscript")}else if("_"===o.text){if(n)throw new Ag("Double subscript",o);n=this.handleSupSubscript("subscript")}else if("'"===o.text){if(t)throw new Ag("Double superscript",o);var i={type:"textord",mode:this.mode,text:"\\prime"},a=[i];for(this.consume();"'"===this.fetch().text;)a.push(i),this.consume();"^"===this.fetch().text&&a.push(this.handleSupSubscript("superscript")),t={type:"ordgroup",mode:this.mode,body:a}}else{if(!Lx[o.text])break;var s=Ex.test(o.text),l=[];for(l.push(new Tw(Lx[o.text])),this.consume();;){var c=this.fetch().text;if(!Lx[c])break;if(Ex.test(c)!==s)break;l.unshift(new Tw(Lx[c])),this.consume()}var d=this.subparse(l);s?n={type:"ordgroup",mode:"math",body:d}:t={type:"ordgroup",mode:"math",body:d}}}return t&&n?{type:"supsub",mode:this.mode,base:r,sup:t,sub:n}:t?{type:"supsub",mode:this.mode,base:r,sup:t}:n?{type:"supsub",mode:this.mode,base:r,sub:n}:r}parseFunction(e,t){var n=this.fetch(),r=n.text,o=ux[r];if(!o)return null;if(this.consume(),t&&"atom"!==t&&!o.allowedInArgument)throw new Ag("Got function '"+r+"' with no arguments"+(t?" as "+t:""),n);if("text"===this.mode&&!o.allowedInText)throw new Ag("Can't use function '"+r+"' in text mode",n);if("math"===this.mode&&!1===o.allowedInMath)throw new Ag("Can't use function '"+r+"' in math mode",n);var{args:i,optArgs:a}=this.parseArguments(r,o);return this.callFunction(r,i,a,n,e)}callFunction(e,t,n,r,o){var i={funcName:e,parser:this,token:r,breakOnTokenText:o},a=ux[e];if(a&&a.handler)return a.handler(i,t,n);throw new Ag("No function handler for "+e)}parseArguments(e,t){var n,r=null!=(n=t.numOptionalArgs)?n:0,o=t.numArgs+r;if(0===o)return{args:[],optArgs:[]};for(var i=[],a=[],s=0;s<o;s++){var l,c=null==(l=t.argTypes)?void 0:l[s],d=s<r;("primitive"in t&&t.primitive&&null==c||"sqrt"===t.type&&1===s&&null==a[0])&&(c="primitive");var u=this.parseGroupOfType("argument to '"+e+"'",c,d);if(d)a.push(u);else{if(null==u)throw new Ag("Null argument, please report this as a bug");i.push(u)}}return{args:i,optArgs:a}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":var r=this.parseArgumentGroup(n,"text");return null!=r?{type:"styling",mode:r.mode,body:[r],style:"text",resetFont:!0}:null;case"raw":var o=this.parseStringGroup(n);return null!=o?{type:"raw",mode:"text",string:o.text}:null;case"primitive":if(n)throw new Ag("A primitive argument cannot be optional");var i=this.parseGroup(e);if(null==i)throw new Ag("Expected group as "+e,this.fetch());return i;case"original":case void 0:return this.parseArgumentGroup(n);default:throw new Ag("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;" "===this.fetch().text;)this.consume()}parseStringGroup(e){var t=this.gullet.scanArgument(e);if(null==t)return null;for(var n,r="";"EOF"!==(n=this.fetch()).text;)r+=n.text,this.consume();return this.consume(),t.text=r,t}parseRegexGroup(e,t){for(var n,r=this.fetch(),o=r,i="";"EOF"!==(n=this.fetch()).text&&e.test(i+n.text);)i+=(o=n).text,this.consume();if(""===i)throw new Ag("Invalid "+t+": '"+r.text+"'",r);return r.range(o,i)}parseColorGroup(e){var t=this.parseStringGroup(e);if(null==t)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new Ag("Invalid color: '"+t.text+"'",t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r="#"+r),{type:"color-token",mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!(t=e||"{"===this.gullet.future().text?this.parseStringGroup(e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new Ag("Invalid size: '"+t.text+"'",t);var o={number:+(r[1]+r[2]),unit:r[3]};if(!nv(o))throw new Ag("Invalid unit: '"+o.unit+"'",t);return{type:"size",mode:this.mode,value:o,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup(e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(null==n)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var o=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var i={type:"ordgroup",mode:this.mode,loc:n.loc,body:o};return t&&this.switchMode(r),i}parseGroup(e,t){var n,r=this.fetch(),o=r.text;if("{"===o||"\\begingroup"===o){this.consume();var i="{"===o?"}":"\\endgroup";this.gullet.beginGroup();var a=this.parseExpression(!1,i),s=this.fetch();this.expect(i),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:Mw.range(r,s),body:a,semisimple:"\\begingroup"===o||void 0}}else if(null==(n=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===o[0]&&!Mx.hasOwnProperty(o)){if(this.settings.throwOnError)throw new Ag("Undefined control sequence: "+o,r);n=this.formatUnsupportedCmd(o),this.consume()}return n}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if("textord"===r.type){var o=r.text,i=e[n+1];if(i&&"textord"===i.type){if("-"===o&&"-"===i.text){var a=e[n+2];n+1<t&&a&&"textord"===a.type&&"-"===a.text?(e.splice(n,3,{type:"textord",mode:"text",loc:Mw.range(r,a),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:Mw.range(r,i),text:"--"}),t-=1)}"'"!==o&&"`"!==o||i.text!==o||(e.splice(n,2,{type:"textord",mode:"text",loc:Mw.range(r,i),text:o+o}),t-=1)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r="*"===n.charAt(0);if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new Ag("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:r}}Ix.hasOwnProperty(t[0])&&!_v[this.mode][t[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=Ix[t[0]]+t.slice(1));var o,i=fx.exec(t);if(i&&("i"===(t=t.substring(0,i.index))?t="ı":"j"===t&&(t="ȷ")),_v[this.mode][t]){this.settings.strict&&"math"===this.mode&&"ÐÞþ".includes(t)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var a=_v[this.mode][t].group,s=Mw.range(e);o=function(e){return e in Lb}(a)?{type:"atom",mode:this.mode,family:a,loc:s,text:t}:{type:a,mode:this.mode,loc:s,text:t}}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(Xg(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),o={type:"textord",mode:"text",loc:Mw.range(e),text:t}}if(this.consume(),i)for(var l=0;l<i[0].length;l++){var c=i[0][l];if(!Ox[c])throw new Ag("Unknown accent ' "+c+"'",e);var d=Ox[c][this.mode]||Ox[c].text;if(!d)throw new Ag("Accent "+c+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:Mw.range(e),label:d,isStretchy:!1,isShifty:!0,base:o}}return o}}Rx.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var Px=function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new Rx(e,t);delete n.gullet.macros.current["\\df@tag"];var r=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new Ag("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:n.subparse([new Tw("\\df@tag")])}]}return r},Bx=function(e,t,n){t.textContent="";var r=Dx(e,n).toNode();t.appendChild(r)};"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&("undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Bx=function(){throw new Ag("KaTeX doesn't work in quirks mode.")});var zx=function(e,t,n){if(n.throwOnError||!(e instanceof Ag))throw e;var r=ky(["katex-error"],[new fv(t)]);return r.setAttribute("title",e.toString()),r.setAttribute("style","color:"+n.errorColor),r},Dx=function(e,t){var n=new Dg(t);try{return function(e,t,n){var r,o=Cb(n);if("mathml"===n.output)return yb(e,t,o,n.displayMode,!0);if("html"===n.output){var i=rb(e,o);r=ky(["katex"],[i])}else{var a=yb(e,t,o,n.displayMode,!1),s=rb(e,o);r=ky(["katex"],[a,s])}return _b(r,n)}(Px(e,n),e,n)}catch(r){return zx(r,e,n)}},Nx={version:"0.17.0",render:Bx,renderToString:function(e,t){return Dx(e,t).toMarkup()},ParseError:Ag,SETTINGS_SCHEMA:Bg,__parse:function(e,t){var n=new Dg(t);return Px(e,n)},__renderToDomTree:Dx,__renderToHTMLTree:function(e,t){var n=new Dg(t);try{return function(e,t,n){var r=rb(e,Cb(n)),o=ky(["katex"],[r]);return _b(o,n)}(Px(e,n),0,n)}catch(r){return zx(r,e,n)}},__setFontMetrics:function(e,t){bv[e]=t},__defineSymbol:Sv,__defineFunction:jy,__defineMacro:Aw,__domTree:{Span:uv,Anchor:hv,SymbolNode:fv,SvgNode:gv,PathNode:vv,LineNode:yv}},Hx=Object.defineProperty,qx=Object.getOwnPropertySymbols,jx=Object.prototype.hasOwnProperty,Vx=Object.prototype.propertyIsEnumerable,Fx=(e,t,n)=>t in e?Hx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$x=(e,t)=>{for(var n in t||(t={}))jx.call(t,n)&&Fx(e,n,t[n]);if(qx)for(var n of qx(t))Vx.call(t,n)&&Fx(e,n,t[n]);return e};function Wx(e,t){return Object.assign(e,{meta:$x({package:"@milkdown/components"},t)}),e}var Ux=Object.defineProperty,Gx=Object.getOwnPropertySymbols,Zx=Object.prototype.hasOwnProperty,Xx=Object.prototype.propertyIsEnumerable,Kx=(e,t,n)=>t in e?Ux(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yx=(e,t)=>{for(var n in t||(t={}))Zx.call(t,n)&&Kx(e,n,t[n]);if(Gx)for(var n of Gx(t))Xx.call(t,n)&&Kx(e,n,t[n]);return e};const Jx=a(Yx({},{mode:"preview"}),"linkTooltipStateCtx");Wx(Jx,{displayName:"State<link-tooltip>",group:"LinkTooltip"});const Qx=a(Yx({},{addLink:()=>{},editLink:()=>{},removeLink:()=>{}}),"linkTooltipAPICtx");Wx(Jx,{displayName:"API<link-tooltip>",group:"LinkTooltip"});const ek=a(Yx({},{linkIcon:"🔗",editButton:"✎",removeButton:"⌫",confirmButton:"Confirm ⏎",onCopyLink:()=>{},inputPlaceholder:"Paste link..."}),"linkTooltipConfigCtx");Wx(Jx,{displayName:"Config<link-tooltip>",group:"LinkTooltip"});const tk=l("ToggleLink",e=>()=>t=>{const{doc:n,selection:r}=t,o=oe.type(e);return n.rangeHasMark(r.from,r.to,o)?(e.get(Qx.key).removeLink(r.from,r.to),!0):(e.get(Qx.key).addLink(r.from,r.to),!0)}),nk=oi("LINK_PREVIEW");Wx(nk[0],{displayName:"PreviewTooltipSpec<link-tooltip>",group:"LinkTooltip"}),Wx(nk[1],{displayName:"PreviewTooltipPlugin<link-tooltip>",group:"LinkTooltip"});const rk=oi("LINK_EDIT");function ok({icon:e,class:t,onClick:n}){return pd("span",{class:Ln("milkdown-icon",t),onPointerdown:n,innerHTML:e?Sn.sanitize(e.trim()):void 0})}Wx(rk[0],{displayName:"EditTooltipSpec<link-tooltip>",group:"LinkTooltip"}),Wx(rk[1],{displayName:"EditTooltipPlugin<link-tooltip>",group:"LinkTooltip"}),ok.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const ik=ml({props:{config:{type:Object,required:!0},src:{type:Object,required:!0},onConfirm:{type:Function,required:!0},onCancel:{type:Function,required:!0}},setup({config:e,src:t,onConfirm:n,onCancel:r}){const o=gs(t);sl(t,e=>{o.value=e});const i=()=>{n(o.value)},a=e=>{e.stopPropagation(),"Enter"===e.key&&(e.preventDefault(),i()),"Escape"===e.key&&(e.preventDefault(),r())};return()=>pd("div",{class:"link-edit"},pd("input",{class:"input-area",placeholder:e.value.inputPlaceholder,onKeydown:a,onInput:e=>{o.value=e.target.value},value:o.value}),o.value?pd(ok,{class:"button confirm",icon:e.value.confirmButton,onClick:i}):null)}});var ak,sk,lk,ck,dk,uk,hk,pk,mk,fk,gk,vk,yk=Object.defineProperty,bk=Object.defineProperties,wk=Object.getOwnPropertyDescriptors,xk=Object.getOwnPropertySymbols,kk=Object.prototype.hasOwnProperty,Ck=Object.prototype.propertyIsEnumerable,_k=e=>{throw TypeError(e)},Sk=(e,t,n)=>t in e?yk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ak=(e,t)=>{for(var n in t||(t={}))kk.call(t,n)&&Sk(e,n,t[n]);if(xk)for(var n of xk(t))Ck.call(t,n)&&Sk(e,n,t[n]);return e},Mk=(e,t)=>bk(e,wk(t)),Tk=(e,t,n)=>t.has(e)||_k("Cannot "+n),Ek=(e,t,n)=>(Tk(e,t,"read from private field"),n?n.call(e):t.get(e)),Lk=(e,t,n)=>t.has(e)?_k("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ok=(e,t,n,r)=>(Tk(e,t,"write to private field"),t.set(e,n),n);const Ik={from:-1,to:-1,mark:null};class Rk{constructor(e,t){this.ctx=e,Lk(this,ak),Lk(this,sk),Lk(this,lk,Ak({},Ik)),Lk(this,ck),Lk(this,dk),Lk(this,uk,gs("")),Lk(this,hk,()=>{Ek(this,fk).call(this),Ek(this,sk).hide(),this.ctx.update(Jx.key,e=>Mk(Ak({},e),{mode:"preview"})),Ok(this,lk,Ak({},Ik))}),Lk(this,pk,e=>{const t=e.target;t&&(Ek(this,ak).contains(t)||Ek(this,hk).call(this))}),Lk(this,mk,()=>{document.addEventListener("pointerdown",Ek(this,pk),!0)}),Lk(this,fk,()=>{document.removeEventListener("pointerdown",Ek(this,pk),!0)}),Lk(this,gk,e=>{const t=this.ctx.get(T),{from:n,to:r,mark:o}=Ek(this,lk),i=oe.type(this.ctx),a=ie(e);if(o&&o.attrs.href===a)return void Ek(this,hk).call(this);const s=t.state.tr;if(o&&s.removeMark(n,r,o),n===r){if(!a)return void Ek(this,hk).call(this);const e=i.create({href:a});s.insertText(a,n),s.addMark(n,n+a.length,e)}else s.addMark(n,r,i.create({href:a}));t.dispatch(s),Ek(this,hk).call(this)}),Lk(this,vk,(e,t,n)=>{const r=this.ctx.get(ek.key);Ek(this,dk).value=r,Ek(this,uk).value=e,this.ctx.update(Jx.key,e=>Mk(Ak({},e),{mode:"edit"}));const o=this.ctx.get(T);o.dispatch(o.state.tr.setSelection(S.create(o.state.doc,t,n))),Ek(this,sk).show({getBoundingClientRect:()=>_(o,t,n)},o),Ek(this,mk).call(this),requestAnimationFrame(()=>{var e;null==(e=Ek(this,ak).querySelector("input"))||e.focus()})}),this.update=e=>{const{state:t}=e,{selection:n}=t;if(!(n instanceof S))return;const{from:r,to:o}=n;r===Ek(this,lk).from&&o===Ek(this,lk).to||Ek(this,hk).call(this)},this.destroy=()=>{Ek(this,fk).call(this),Ek(this,ck).unmount(),Ek(this,sk).destroy(),Ek(this,ak).remove()},this.addLink=(e,t)=>{Ok(this,lk,{from:e,to:t,mark:null}),Ek(this,vk).call(this,"",e,t)},this.editLink=(e,t,n)=>{Ok(this,lk,{from:t,to:n,mark:e}),Ek(this,vk).call(this,e.attrs.href,t,n)},this.removeLink=(e,t)=>{const n=this.ctx.get(T),r=n.state.tr;r.removeMark(e,t,oe.type(this.ctx)),n.dispatch(r),Ek(this,hk).call(this)},Ok(this,dk,gs(this.ctx.get(ek.key)));const n=document.createElement("div");n.className="milkdown-link-edit";const r=qd(ik,{config:Ek(this,dk),src:Ek(this,uk),onConfirm:Ek(this,gk),onCancel:Ek(this,hk)});r.mount(n),Ok(this,ck,r),Ok(this,ak,n),Ok(this,sk,new ri({content:n,debounce:0,shouldShow:()=>!1})),Ek(this,sk).onHide=()=>{requestAnimationFrame(()=>{t.dom.focus({preventScroll:!0})})},Ek(this,sk).update(t)}}ak=new WeakMap,sk=new WeakMap,lk=new WeakMap,ck=new WeakMap,dk=new WeakMap,uk=new WeakMap,hk=new WeakMap,pk=new WeakMap,mk=new WeakMap,fk=new WeakMap,gk=new WeakMap,vk=new WeakMap;var Pk=Object.defineProperty,Bk=Object.defineProperties,zk=Object.getOwnPropertyDescriptors,Dk=Object.getOwnPropertySymbols,Nk=Object.prototype.hasOwnProperty,Hk=Object.prototype.propertyIsEnumerable,qk=(e,t,n)=>t in e?Pk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const jk=ml({props:{config:{type:Object,required:!0},src:{type:Object,required:!0},onEdit:{type:Object,required:!0},onRemove:{type:Object,required:!0}},setup({config:e,src:t,onEdit:n,onRemove:r}){const o=hd(()=>ie(t.value)),i=e=>{e.preventDefault(),e.stopPropagation(),n.value()},a=e=>{e.preventDefault(),e.stopPropagation(),r.value()},s=n=>{n.preventDefault();const r=t.value;navigator.clipboard&&r&&navigator.clipboard.writeText(r).then(()=>{e.value.onCopyLink(r)}).catch(e=>console.error(e))};return()=>pd("div",{class:"link-preview"},pd(ok,{class:"button link-icon",icon:e.value.linkIcon,onClick:s}),pd("a",{href:o.value,target:"_blank",rel:"noopener noreferrer",class:"link-display"},t.value),pd(ok,{class:"button link-edit-button",icon:e.value.editButton,onClick:i}),pd(ok,{class:"button link-remove-button",icon:e.value.removeButton,onClick:a}))}});var Vk,Fk,$k,Wk,Uk,Gk,Zk,Xk,Kk,Yk,Jk,Qk,eC,tC,nC=e=>{throw TypeError(e)},rC=(e,t,n)=>t.has(e)||nC("Cannot "+n),oC=(e,t,n)=>(rC(e,t,"read from private field"),n?n.call(e):t.get(e)),iC=(e,t,n)=>t.has(e)?nC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),aC=(e,t,n,r)=>(rC(e,t,"write to private field"),t.set(e,n),n);class sC{constructor(e,t){this.ctx=e,iC(this,Vk),iC(this,Fk),iC(this,$k),iC(this,Wk),iC(this,Uk,gs("")),iC(this,Gk,gs(()=>{})),iC(this,Zk,gs(()=>{})),iC(this,Xk),iC(this,Kk),iC(this,Yk,!1),iC(this,Jk,({mode:e})=>{"edit"===e&&oC(this,tC).call(this)}),iC(this,Qk,()=>{aC(this,Yk,!0)}),iC(this,eC,()=>{aC(this,Yk,!1)}),iC(this,tC,()=>{oC(this,Fk).hide(),oC(this,Fk).element.removeEventListener("mouseenter",oC(this,Qk)),oC(this,Fk).element.removeEventListener("mouseleave",oC(this,eC))}),this.show=(e,t,n,r)=>{oC(this,Wk).value=this.ctx.get(ek.key),oC(this,Uk).value=e.attrs.href,oC(this,Gk).value=()=>{this.ctx.get(Qx.key).editLink(e,t,n)},oC(this,Zk).value=()=>{this.ctx.get(Qx.key).removeLink(t,n),oC(this,tC).call(this)},oC(this,Fk).show({getBoundingClientRect:()=>r},oC(this,Kk)),oC(this,Fk).element.addEventListener("mouseenter",oC(this,Qk)),oC(this,Fk).element.addEventListener("mouseleave",oC(this,eC))},this.hide=()=>{oC(this,Yk)||oC(this,tC).call(this)},this.update=()=>{},this.destroy=()=>{oC(this,Xk).unmount(),oC(this,$k).off(oC(this,Jk)),oC(this,Fk).destroy(),oC(this,Vk).remove()},aC(this,Kk,t),aC(this,Wk,gs(this.ctx.get(ek.key))),aC(this,Xk,qd(jk,{config:oC(this,Wk),src:oC(this,Uk),onEdit:oC(this,Gk),onRemove:oC(this,Zk)})),aC(this,Vk,document.createElement("div")),oC(this,Vk).className="milkdown-link-preview",oC(this,Xk).mount(oC(this,Vk)),aC(this,Fk,new ri({debounce:0,content:oC(this,Vk),shouldShow:()=>!1})),oC(this,Fk).update(t),aC(this,$k,e.use(Jx.key)),oC(this,$k).on(oC(this,Jk))}}function lC(e){(function(e){let t;const n=hr((n,r)=>{if(!t)return;if(!n.hasFocus())return;if("edit"===e.get(Jx.key).mode)return;const o=function(e,t,n){const r=t.posAtCoords({left:n.clientX,top:n.clientY});if(!r)return;const{pos:o}=r,i=t.state.doc.nodeAt(o);if(!i)return;const a=i.marks.find(t=>t.type===oe.mark.type(e));return a&&nk.pluginKey()?{show:!0,pos:o,node:i,mark:a}:void 0}(e,n,r);if(o){const e=n.state.doc.resolve(o.pos),r=function(e,t,n,r,o){let i={start:-1,end:-1};return n.nodesBetween(r,o,(n,r)=>{if(i.start>-1)return!1;-1===i.start&&e.isInSet(n.marks)&&t===n&&(i={start:r,end:r+Math.max(n.textContent.length,1)})}),i}(o.mark,o.node,n.state.doc,e.before(),e.after()),i=r.start,a=r.end;return void t.show(o.mark,i,a,_(n,i,a))}t.hide()},50);e.set(nk.key,{props:{handleDOMEvents:{mousemove:n,mouseleave:()=>{setTimeout(()=>{null==t||t.hide()},50)}}},view:n=>(t=new sC(e,n),t)})})(e),function(e){let t;e.update(Qx.key,e=>((e,t)=>Bk(e,zk(t)))(((e,t)=>{for(var n in t||(t={}))Nk.call(t,n)&&qk(e,n,t[n]);if(Dk)for(var n of Dk(t))Hk.call(t,n)&&qk(e,n,t[n]);return e})({},e),{addLink:(e,n)=>{null==t||t.addLink(e,n)},editLink:(e,n,r)=>{null==t||t.editLink(e,n,r)},removeLink:(e,n)=>{null==t||t.removeLink(e,n)}})),e.set(rk.key,{view:n=>(t=new Rk(e,n),t)})}(e)}Vk=new WeakMap,Fk=new WeakMap,$k=new WeakMap,Wk=new WeakMap,Uk=new WeakMap,Gk=new WeakMap,Zk=new WeakMap,Xk=new WeakMap,Kk=new WeakMap,Yk=new WeakMap,Jk=new WeakMap,Qk=new WeakMap,eC=new WeakMap,tC=new WeakMap;const cC=[Jx,Qx,ek,nk,rk,tk].flat();var dC=Object.defineProperty,uC=Object.getOwnPropertySymbols,hC=Object.prototype.hasOwnProperty,pC=Object.prototype.propertyIsEnumerable,mC=(e,t,n)=>t in e?dC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fC=(e,t)=>{for(var n in t||(t={}))hC.call(t,n)&&mC(e,n,t[n]);if(uC)for(var n of uC(t))pC.call(t,n)&&mC(e,n,t[n]);return e};function gC(e,t){return Object.assign(e,{meta:fC({package:"@milkdown/components"},t)}),e}const vC=a({renderLabel:({label:e,listType:t,checked:n})=>null==n?"bullet"===t?"⦿":e:n?"☑":"□"},"listItemBlockConfigCtx");function yC({icon:e,class:t,onClick:n}){return pd("span",{class:Ln("milkdown-icon",t),onPointerdown:n,innerHTML:e?Sn.sanitize(e.trim()):void 0})}gC(vC,{displayName:"Config<list-item-block>",group:"ListItemBlock"}),yC.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const bC=ml({props:{label:{type:Object,required:!0},checked:{type:Object,required:!0},listType:{type:Object,required:!0},config:{type:Object,required:!0},readonly:{type:Object,required:!0},selected:{type:Object,required:!0},setAttr:{type:Function,required:!0},onMount:{type:Function,required:!0}},setup({label:e,checked:t,listType:n,config:r,readonly:o,setAttr:i,onMount:a,selected:s}){const l=e=>{null!=e&&e instanceof Element&&a(e)},c=e=>{e.stopPropagation(),e.preventDefault(),null!=t.value&&i("checked",!t.value)},d=hd(()=>r.renderLabel({label:e.value,listType:n.value,checked:t.value,readonly:o.value})),u=hd(()=>null==t.value?"bullet"===n.value?"bullet":"ordered":t.value?"checked":"unchecked");return()=>pd("li",{class:Ln("list-item",s.value&&"ProseMirror-selectednode")},pd("div",{class:"label-wrapper",onPointerdown:c,contenteditable:!1},pd(yC,{class:Ln("label",o.value&&"readonly",u.value),icon:d.value})),pd("div",{class:"children",ref:l}))}}),wC=R(H.node,e=>(t,n,r)=>{const o=document.createElement("div");o.className="milkdown-list-item-block";const i=document.createElement("div");i.setAttribute("data-content-dom","true"),i.classList.add("content-dom");const a=gs(t.attrs.label),s=gs(t.attrs.checked),l=gs(t.attrs.listType),c=gs(!n.editable),d=e.get(vC.key),u=gs(!1),h=al(()=>{u.value?o.classList.add("selected"):o.classList.remove("selected")});let p=0;const m=qd(bC,{label:a,checked:s,listType:l,readonly:c,config:d,selected:u,setAttr:(e,t)=>{if(!n.editable)return;const o=r();null!=o&&(n.hasFocus()||n.focus(),n.dispatch(n.state.tr.setNodeAttribute(o,e,t)))},onMount:e=>{if(i.parentNode===e)return;const{anchor:t,head:r}=n.state.selection;e.appendChild(i);const o=n.state.doc;p=requestAnimationFrame(()=>{if(p=0,n.isDestroyed)return;if(!o.eq(n.state.doc))return;if(n.state.selection.anchor!==t||n.state.selection.head!==r)return;const e=n.dom.ownerDocument.getSelection();if(e?.anchorNode&&n.dom.contains(e.anchorNode))try{if(n.posAtDOM(e.anchorNode,e.anchorOffset)!==t||e.focusNode&&n.posAtDOM(e.focusNode,e.focusOffset)!==r)return}catch{return}const i=S.create(n.state.doc,t,r);n.dispatch(n.state.tr.setSelection(i))})}});m.mount(o);const f=e=>{l.value=e.attrs.listType,a.value=e.attrs.label,s.value=e.attrs.checked,c.value=!n.editable};f(t);let g=t;return{dom:o,contentDOM:i,update:e=>e.type===t.type&&(e.sameMarkup(g)&&e.content.eq(g.content)||(g=e,f(e)),!0),ignoreMutation:e=>!o||!i||"selection"!==e.type&&(i===e.target&&"attributes"===e.type||!i.contains(e.target)),selectNode:()=>{u.value=!0},deselectNode:()=>{u.value=!1},destroy:()=>{cancelAnimationFrame(p),h(),m.unmount(),o.remove(),i.remove()}}});gC(wC,{displayName:"NodeView<list-item-block>",group:"ListItemBlock"});const xC=[vC,wC];var kC=Object.defineProperty,CC=Object.getOwnPropertySymbols,_C=Object.prototype.hasOwnProperty,SC=Object.prototype.propertyIsEnumerable,AC=(e,t,n)=>t in e?kC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,MC=(e,t)=>{for(var n in t||(t={}))_C.call(t,n)&&AC(e,n,t[n]);if(CC)for(var n of CC(t))SC.call(t,n)&&AC(e,n,t[n]);return e};function TC(e,t){return Object.assign(e,{meta:MC({package:"@milkdown/components"},t)}),e}var EC=Object.defineProperty,LC=Object.getOwnPropertySymbols,OC=Object.prototype.hasOwnProperty,IC=Object.prototype.propertyIsEnumerable,RC=(e,t,n)=>t in e?EC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const PC=a(((e,t)=>{for(var n in t||(t={}))OC.call(t,n)&&RC(e,n,t[n]);if(LC)for(var n of LC(t))IC.call(t,n)&&RC(e,n,t[n]);return e})({},{renderButton:e=>{switch(e){case"add_row":case"add_col":return"+";case"delete_row":case"delete_col":return"-";case"align_col_left":return"left";case"align_col_center":return"center";case"align_col_right":return"right";case"col_drag_handle":case"row_drag_handle":return"="}}}),"tableBlockConfigCtx");function BC({icon:e,class:t,onClick:n}){return pd("span",{class:Ln("milkdown-icon",t),onPointerdown:n,innerHTML:e?Sn.sanitize(e.trim()):void 0})}function zC(e){const{dragPreviewRef:t,tableWrapperRef:n,contentWrapperRef:r,yLineHandleRef:o,xLineHandleRef:i,colHandleRef:a,rowHandleRef:s}=e,l=t.value;if(!l)return;const c=n.value;if(!c)return;const d=r.value;if(!d)return;const u=d.querySelector("tbody");if(!u)return;const h=l.querySelector("tbody");if(!h)return;const p=o.value;if(!p)return;const m=i.value;if(!m)return;const f=a.value;if(!f)return;const g=s.value;return g?{preview:l,wrapper:c,content:d,contentRoot:u,previewRoot:h,yHandle:p,xHandle:m,colHandle:f,rowHandle:g}:void 0}function DC(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function NC(e,t,n,r,o){const{width:i,height:a}=r.querySelector("tbody").getBoundingClientRect();if("y"===e){const e=r.querySelectorAll("tr")[o];if(!e)return;n.appendChild(e.cloneNode(!0));const a=e.getBoundingClientRect().height;return Object.assign(t.style,{width:`${i}px`,height:`${a}px`}),void(t.dataset.show="true")}if("x"===e){const e=r.querySelectorAll("tr");let i;return Array.from(e).forEach(e=>{const t=e.children[o];if(!t)return;void 0===i&&(i=t.getBoundingClientRect().width);const r=t.parentElement.cloneNode(!1),a=t.cloneNode(!0);r.appendChild(a),n.appendChild(r)}),Object.assign(t.style,{width:`${i}px`,height:`${a}px`}),void(t.dataset.show="true")}}function HC(e,t,n,r){const{xHandle:o,yHandle:i,colHandle:a,rowHandle:s,preview:l}=n;o.dataset.displayType="y"===e?"indicator":"none",i.dataset.displayType="x"===e?"indicator":"none","y"===e?(a.dataset.show="false",jC(s)):(s.dataset.show="false",jC(a));const{hoverIndex:c,dragInfo:d}=r,[u,h]=c.value;d.value={startCoords:[t.clientX,t.clientY],startIndex:"y"===e?u:h,endIndex:"y"===e?u:h,type:"y"===e?"row":"col"},l.dataset.direction="y"===e?"vertical":"horizontal"}function qC(e,t,n,r){const o=null==n?void 0:n.get(T);if(!(null==o?void 0:o.editable))return;t.stopPropagation(),t.dataTransfer&&(t.dataTransfer.effectAllowed="move");const i=zC(e);i&&requestAnimationFrame(()=>{r(i)})}function jC(e){var t;null==(t=e.querySelector(".button-group"))||t.setAttribute("data-show","false")}function VC(e,t){for(let n=0;n<e.childCount;n++)if(e.child(n)===t)return n;return-1}function FC(e,[t,n]){const r=e.value;if(!r)return;const o=r.querySelectorAll("tr"),i=o[t];if(!i)return;const a=o[0];if(!a)return;const s=a.children[n];if(!s)return;const l=i.children[n];return l?{row:i,col:l,headerCol:s}:void 0}function $C({refs:e,index:t,before:n,after:r}){const{contentWrapperRef:o,colHandleRef:i,hoverIndex:a}=e,s=i.value;if(!s)return;a.value=t;const l=FC(o,t);if(!l)return;const{headerCol:c}=l;s.dataset.show="true",n&&n(s),b(c,s,{placement:"top"}).then(({x:e,y:t})=>{Object.assign(s.style,{left:`${e}px`,top:`${t}px`}),r&&r(s)}).catch(console.error)}function WC({refs:e,index:t,before:n,after:r}){const{contentWrapperRef:o,rowHandleRef:i,hoverIndex:a}=e,s=i.value;if(!s)return;a.value=t;const l=FC(o,t);if(!l)return;const{row:c}=l;s.dataset.show="true",n&&n(s),b(c,s,{placement:"left"}).then(({x:e,y:t})=>{Object.assign(s.style,{left:`${e}px`,top:`${t}px`}),r&&r(s)}).catch(console.error)}function UC(e,t,n){const r="x"===n?"left":"top",o="x"===n?"right":"bottom",i=e.length-1,a=e.findIndex((e,n)=>{const a=e.getBoundingClientRect(),s=a[r],l=a[o];return s<=t&&t<=l||n===i&&t>l||0===n&&t<s}),s=e[a];return s?[s,a]:void 0}TC(PC,{displayName:"Config<table-block>",group:"TableBlock"}),BC.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const GC=ml({props:{view:{type:Object,required:!0},ctx:{type:Object,required:!0},getPos:{type:Function,required:!0},config:{type:Object,required:!0},onMount:{type:Function,required:!0},node:{type:Object,required:!0}},setup({view:e,node:t,ctx:n,getPos:r,config:o,onMount:i}){const a=gs(),s=e=>{null!=e&&(e instanceof HTMLElement?(a.value=e,i(e)):a.value=void 0)},l=gs(),c=gs(),d=gs(),u=gs(),h=gs(),p=gs(),m={dragPreviewRef:p,tableWrapperRef:h,contentWrapperRef:a,yLineHandleRef:u,xLineHandleRef:d,colHandleRef:l,rowHandleRef:c,hoverIndex:gs([0,0]),lineHoverIndex:gs([-1,-1]),dragInfo:gs()},{pointerLeave:f,pointerMove:v}=function(e,t){const n=function(e,t){return gr(n=>{if(!(null==t?void 0:t.editable))return;const{contentWrapperRef:r,yLineHandleRef:o,xLineHandleRef:i,colHandleRef:a,rowHandleRef:s,hoverIndex:l,lineHoverIndex:c}=e,d=o.value;if(!d)return;const u=i.value;if(!u)return;const h=r.value;if(!h)return;const p=s.value;if(!p)return;const m=a.value;if(!m)return;const f=function(e,t){var r,o,i;if(t)try{const n=t.posAtCoords({left:e.clientX,top:e.clientY});if(!n)return;const a=null==n?void 0:n.inside;if(null==a||a<0)return;const s=t.state.doc.resolve(a),l=t.state.doc.nodeAt(a);if(!l)return;const c=["table_cell","table_header"],d=["table_row","table_header_row"],u=c.includes(l.type.name)?l:null==(r=A(e=>c.includes(e.type.name))(s))?void 0:r.node,h=null==(o=A(e=>d.includes(e.type.name))(s))?void 0:o.node,p=null==(i=A(e=>"table"===e.type.name)(s))?void 0:i.node;if(!u||!h||!p)return;const m=VC(h,u);return[VC(p,h),m]}catch(n){return}}(n,t);if(!f)return;const g=FC(r,f);if(!g)return;const[v,y]=f,w=g.col.getBoundingClientRect(),k=Math.abs(n.clientX-w.left)<8,C=Math.abs(w.right-n.clientX)<8,_=Math.abs(n.clientY-w.top)<8,S=Math.abs(w.bottom-n.clientY)<8,M=k||C||_||S,T=p.querySelector(".button-group"),E=m.querySelector(".button-group");if(T&&(T.dataset.show="false"),E&&(E.dataset.show="false"),M){const e=h.getBoundingClientRect();p.dataset.show="false",m.dataset.show="false",u.dataset.displayType="tool",d.dataset.displayType="tool";const t=d.getBoundingClientRect().width,n=u.getBoundingClientRect().height;return k||C?(c.value[1]=k?y:y+1,b(g.col,d,{placement:k?"left":"right",middleware:[x(k?-1*t:0)]}).then(({x:t})=>{d.dataset.show="true",Object.assign(d.style,{height:`${e.height}px`,left:`${t}px`})}).catch(console.error)):d.dataset.show="false",void(0!==f[0]&&(_||S)?(c.value[0]=_?v:v+1,b(g.row,u,{placement:_?"top":"bottom",middleware:[x(_?-1*n:0)]}).then(({y:t})=>{u.dataset.show="true",Object.assign(u.style,{width:`${e.width}px`,top:`${t}px`})}).catch(console.error)):u.dataset.show="false")}c.value=[-1,-1],d.dataset.show="false",u.dataset.show="false",p.dataset.show="true",m.dataset.show="true",WC({refs:e,index:f}),$C({refs:e,index:f}),l.value=f},20)}(e,t),r=function(e){return()=>{const{rowHandleRef:t,colHandleRef:n,yLineHandleRef:r,xLineHandleRef:o}=e;setTimeout(()=>{const e=t.value;if(!e)return;const i=n.value;if(!i)return;const a=r.value;if(!a)return;const s=o.value;s&&(e.dataset.show="false",i.dataset.show="false",a.dataset.show="false",s.dataset.show="false")},200)}}(e);return{pointerMove:n,pointerLeave:r}}(m,e),{dragRow:y,dragCol:w}=function(e,t,n){const{dragPreviewRef:r,yLineHandleRef:o,xLineHandleRef:i,dragInfo:a}=e,s=function(e,t){return n=>{qC(e,n,t,t=>{HC("y",n,t,e);const{preview:r,content:o,previewRoot:i}=t;DC(i);const{hoverIndex:a}=e,[s]=a.value;NC("y",r,i,o,s)})}}(e,t),l=function(e,t){return n=>{qC(e,n,t,t=>{HC("x",n,t,e);const{preview:r,content:o,previewRoot:i}=t,{hoverIndex:a}=e,[s,l]=a.value;DC(i),NC("x",r,i,o,l)})}}(e,t),c=()=>{const e=r.value;if(!e)return;if("false"===e.dataset.show)return;const t=null==e?void 0:e.querySelector("tbody");for(;null==t?void 0:t.firstChild;)null==t||t.removeChild(t.firstChild);e&&(e.dataset.show="false")},d=()=>{var s;const l=r.value;if(!l)return;const c=o.value;if(!c)return;const d=i.value;if(!d)return;const u=a.value;if(!u)return;if(!t)return;if("false"===l.dataset.show)return;if(!e.colHandleRef.value)return;if(!e.rowHandleRef.value)return;if(c.dataset.show="false",d.dataset.show="false",u.startIndex===u.endIndex)return;const h=t.get(g),p={from:u.startIndex,to:u.endIndex,pos:(null!=(s=null==n?void 0:n())?s:0)+1};if("col"===u.type){h.call(kp.key,{pos:p.pos,index:u.startIndex}),h.call(wp.key,p);const t=[0,u.endIndex];$C({refs:e,index:t})}else{h.call(xp.key,{pos:p.pos,index:u.startIndex}),h.call(bp.key,p);const t=[u.endIndex,0];WC({refs:e,index:t})}requestAnimationFrame(()=>{t.get(T).focus()})},u=function(e){return gr(t=>{const n=zC(e);if(!n)return;const{preview:r,content:o,contentRoot:i,xHandle:a,yHandle:s}=n,{dragInfo:l,hoverIndex:c}=e;if("false"===r.dataset.show)return;const d=FC(e.contentWrapperRef,c.value);if(!d)return;if(!i.querySelector("tr"))return;const u=l.value;if(!u)return;if(!i.offsetParent)return;const h=i.offsetParent.offsetTop,p=i.offsetParent.offsetLeft;if("col"===u.type){const e=d.col.getBoundingClientRect().width,{left:n,width:a}=i.getBoundingClientRect(),l=p-n,c=t.clientX+l-e/2,[m]=u.startCoords,f=m<t.clientX?"right":"left";r.style.top=`${h}px`;const g=c<n+l-20?n+l-20:c>n+a+l-e+20?n+a+l-e+20:c;r.style.left=`${g}px`;const v=function(e,t){const n=e.querySelector("tr");if(n)return UC(Array.from(n.children),t,"x")}(i,t.clientX);if(v){const[e,t]=v,n=s.getBoundingClientRect().width,r=o.getBoundingClientRect();u.endIndex=t,b(e,s,{placement:"left"===f?"left":"right",middleware:[x("left"===f?-1*n:0)]}).then(({x:e})=>{s.dataset.show="true",Object.assign(s.style,{height:`${r.height}px`,left:`${e}px`,top:`${h}px`})}).catch(console.error)}}else if("row"===u.type){const e=d.row.getBoundingClientRect().height,{top:n,height:s}=i.getBoundingClientRect(),l=h-n,c=t.clientY+l-e/2,[m,f]=u.startCoords,g=f<t.clientY?"down":"up",v=c<n+l-20?n+l-20:c>n+s+l-e+20?n+s+l-e+20:c;r.style.top=`${v}px`,r.style.left=`${p}px`;const y=function(e,t){return UC(Array.from(e.querySelectorAll("tr")),t,"y")}(i,t.clientY);if(y){const[e,t]=y,n=a.getBoundingClientRect().height,r=o.getBoundingClientRect();u.endIndex=t,b(e,a,{placement:"up"===g?"top":"bottom",middleware:[x("up"===g?-1*n:0)]}).then(({y:e})=>{a.dataset.show="true",Object.assign(a.style,{width:`${r.width}px`,top:`${e}px`})}).catch(console.error)}}},20)}(e);return El(()=>{window.addEventListener("dragover",u),window.addEventListener("dragend",c),window.addEventListener("drop",d)}),Rl(()=>{window.removeEventListener("dragover",u),window.removeEventListener("dragend",c),window.removeEventListener("drop",d)}),{dragRow:s,dragCol:l}}(m,n,r),{onAddRow:k,onAddCol:C,selectCol:_,selectRow:S,deleteSelected:M,onAlign:E}=function(e,t,n){const{xLineHandleRef:r,contentWrapperRef:o,colHandleRef:i,rowHandleRef:a,hoverIndex:s,lineHoverIndex:l}=e;return{onAddRow:()=>{var e,i,a;if(!t)return;const s=r.value;if(!s)return;const[c]=l.value;if(c<0)return;if(!t.get(T).editable)return;const d=Array.from(null!=(i=null==(e=o.value)?void 0:e.querySelectorAll("tr"))?i:[]),u=t.get(g),h=(null!=(a=null==n?void 0:n())?a:0)+1;d.length===c?(u.call(xp.key,{pos:h,index:c-1}),u.call(Tp.key)):(u.call(xp.key,{pos:h,index:c}),u.call(Mp.key)),u.call(xp.key,{pos:h,index:c}),s.dataset.show="false"},onAddCol:()=>{var e,i,a,s;if(!t)return;if(!r.value)return;const[c,d]=l.value;if(d<0)return;if(!t.get(T).editable)return;const u=Array.from(null!=(a=null==(i=null==(e=o.value)?void 0:e.querySelector("tr"))?void 0:i.children)?a:[]),h=t.get(g),p=(null!=(s=null==n?void 0:n())?s:0)+1;u.length===d?(h.call(kp.key,{pos:p,index:d-1}),h.call(Ap.key)):(h.call(kp.key,{pos:p,index:d}),h.call(Sp.key)),h.call(kp.key,{pos:p,index:d})},selectCol:()=>{var e,r;if(!t)return;const[o,a]=s.value,l=t.get(g),c=(null!=(e=null==n?void 0:n())?e:0)+1;l.call(kp.key,{pos:c,index:a});const d=null==(r=i.value)?void 0:r.querySelector(".button-group");d&&(d.dataset.show="true"===d.dataset.show?"false":"true")},selectRow:()=>{var e,r;if(!t)return;const[o,i]=s.value,l=t.get(g),c=(null!=(e=null==n?void 0:n())?e:0)+1;l.call(xp.key,{pos:c,index:o});const d=null==(r=a.value)?void 0:r.querySelector(".button-group");d&&o>0&&(d.dataset.show="true"===d.dataset.show?"false":"true")},deleteSelected:e=>{t&&t.get(T).editable&&(e.preventDefault(),e.stopPropagation(),t.get(g).call(_p.key),requestAnimationFrame(()=>{t.get(T).focus()}))},onAlign:e=>n=>{t&&t.get(T).editable&&(n.preventDefault(),n.stopPropagation(),t.get(g).call(Ep.key,e),requestAnimationFrame(()=>{t.get(T).focus()}))}}}(m,n,r);return El(()=>{requestAnimationFrame(()=>{e.editable&&function(e,t,n){if(!n)return;if(!t)return;const{selection:r}=t.state;if(!(r instanceof Zu))return;const{$from:o}=r,i=rh(o);if(i&&i.node===n){if(r.isColSelection()){const{$head:t}=r;return void $C({refs:e,index:[0,t.index(t.depth-1)],before:e=>{var t;null==(t=e.querySelector(".button-group"))||t.setAttribute("data-show","true")}})}if(r.isRowSelection()){const{$head:t}=r,n=A(e=>"table_row"===e.type.name||"table_header_row"===e.type.name)(t);if(!n)return;const o=VC(i.node,n.node);WC({refs:e,index:[o,0],before:e=>{var t;o>0&&(null==(t=e.querySelector(".button-group"))||t.setAttribute("data-show","true"))}})}}}(m,e,t.value)})}),()=>pd("div",{onDragstart:e=>e.preventDefault(),onDragover:e=>e.preventDefault(),onDragleave:e=>e.preventDefault(),onPointermove:v,onPointerleave:f},pd("div",{"data-show":"false",contenteditable:"false",draggable:"true","data-role":"col-drag-handle",class:"handle cell-handle",onDragstart:w,onClick:_,onPointerdown:e=>e.stopPropagation(),onPointermove:e=>e.stopPropagation(),ref:l},pd(BC,{icon:o.renderButton("col_drag_handle")}),pd("div",{"data-show":"false",class:"button-group",onPointermove:e=>e.stopPropagation()},pd("button",{type:"button",onPointerdown:E("left")},pd(BC,{icon:o.renderButton("align_col_left")})),pd("button",{type:"button",onPointerdown:E("center")},pd(BC,{icon:o.renderButton("align_col_center")})),pd("button",{type:"button",onPointerdown:E("right")},pd(BC,{icon:o.renderButton("align_col_right")})),pd("button",{type:"button",onPointerdown:M},pd(BC,{icon:o.renderButton("delete_col")})))),pd("div",{"data-show":"false",contenteditable:"false",draggable:"true","data-role":"row-drag-handle",class:"handle cell-handle",onDragstart:y,onClick:S,onPointerdown:e=>e.stopPropagation(),onPointermove:e=>e.stopPropagation(),ref:c},pd(BC,{icon:o.renderButton("row_drag_handle")}),pd("div",{"data-show":"false",class:"button-group",onPointermove:e=>e.stopPropagation()},pd("button",{type:"button",onPointerdown:M},pd(BC,{icon:o.renderButton("delete_row")})))),pd("div",{class:"table-wrapper",ref:h},pd("div",{"data-show":"false",class:"drag-preview","data-direction":"vertical",ref:p},pd("table",null,pd("tbody",null))),pd("div",{"data-show":"false",contenteditable:"false","data-display-type":"tool","data-role":"x-line-drag-handle",class:"handle line-handle",onPointermove:e=>e.stopPropagation(),ref:d},pd("button",{type:"button",onClick:k,class:"add-button"},pd(BC,{icon:o.renderButton("add_row")}))),pd("div",{"data-show":"false",contenteditable:"false","data-display-type":"tool","data-role":"y-line-drag-handle",class:"handle line-handle",onPointermove:e=>e.stopPropagation(),ref:u},pd("button",{type:"button",onClick:C,class:"add-button"},pd(BC,{icon:o.renderButton("add_col")}))),pd("table",{ref:s,class:"children"})))}});var ZC,XC,KC=e=>{throw TypeError(e)};class YC{constructor(e,t,n,r){this.ctx=e,this.node=t,this.view=n,this.getPos=r,((e,t)=>{t.has(e)?KC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,void 0)})(this,ZC);const o=document.createElement("div");o.className="milkdown-table-block";const i=document.createElement("tbody");this.contentDOM=i,i.setAttribute("data-content-dom","true"),i.classList.add("content-dom"),this.nodeRef=vs(t);const a=qd(GC,{view:n,ctx:e,getPos:r,config:e.get(PC.key),onMount:e=>{e.appendChild(i)},node:this.nodeRef});a.mount(o),this.app=a,this.dom=o}update(e){return!(e.type!==this.node.type||e.sameMarkup(this.node)&&e.content.eq(this.node.content)||(this.node=e,this.nodeRef.value=e,0))}stopEvent(e){if("drop"===e.type||e.type.startsWith("drag"))return!0;if("mousedown"===e.type||"pointerdown"===e.type){if(e.target instanceof Element&&e.target.closest("button"))return!0;const t=e.target;if(t instanceof HTMLElement&&(t.closest("th")||t.closest("td"))){const t=e;return((e,t,n)=>((e=>{ZC.has(e)||KC("Cannot access private method")})(this),n))(0,0,XC).call(this,t)}}return!1}ignoreMutation(e){return!this.dom||!this.contentDOM||"selection"!==e.type&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target))}destroy(){this.app.unmount(),this.dom.remove(),this.contentDOM.remove()}}ZC=new WeakSet,XC=function(e){const t=this.view;if(!t.editable)return!1;const{state:n,dispatch:r}=t,o=t.posAtCoords({left:e.clientX,top:e.clientY});if(!o)return!1;const i=n.doc.resolve(o.inside),a=A(e=>"table_cell"===e.type.name||"table_header"===e.type.name)(i);if(!a)return!1;if(n.selection instanceof S){const e=A(e=>"table_cell"===e.type.name||"table_header"===e.type.name)(n.selection.$from);if((null==e?void 0:e.node)===a.node)return!1}const{from:s}=a,l=M.create(n.doc,s+1);return!n.selection.eq(l)&&(n.selection instanceof Zu?setTimeout(()=>{r(n.tr.setSelection(l).scrollIntoView())},20):requestAnimationFrame(()=>{r(n.tr.setSelection(l).scrollIntoView())}),!0)};const JC=R(ip.node,e=>(t,n,r)=>new YC(e,t,n,r));TC(JC,{displayName:"NodeView<table-block>",group:"TableBlock"});const QC=[PC,JC];function e_(e){if(!e)return!1;if(Array.isArray(e))return!(e.length>1)&&e_(e[0]);const t=e.content;return t?e_(t):"text"===e.type}function t_(e,t){const n=ue(t);if(n)return e.dispatch(e.state.tr.replaceSelectionWith(n,!0)),!0;try{return e.dispatch(e.state.tr.replaceSelection(t)),!0}catch{return!1}}var n_=s(e=>{const t=e.get(ae);return e.update(se,e=>({...e,editable:e.editable??(()=>!0),transformPastedHTML:(t,n)=>{const r=e.transformPastedHTML;return r&&(t=r(t,n)),t.includes("docs-internal-guid")&&(t=(t=t.replace(/<b[^>]*id="docs-internal-guid[^"]*"[^>]*>([\s\S]*)<\/b>/,"$1")).replace(/<div[^>]*>(<table[\s\S]*?<\/table>)<\/div>/g,"$1")),t}})),new c({key:new d("MILKDOWN_CLIPBOARD"),props:{handlePaste:(n,r,o)=>{const i=e.get(u),a=n.props.editable?.(n.state),{clipboardData:s}=r;if(!a||!s)return!1;if(n.state.selection.$from.node().type.spec.code)return!1;const l=s.getData("text/plain"),c=s.getData("vscode-editor-data");if(c){const e=JSON.parse(c)?.mode;if(l&&e){const{tr:r}=n.state,o=ce("code_block",t);return r.replaceSelectionWith(o.create({language:e})).setSelection(S.near(r.doc.resolve(Math.max(0,r.selection.from-2)))).insertText(l.replace(/\r\n?/g,"\n")),n.dispatch(r),!0}}const d=s.getData("text/html");if(0===d.length&&0===l.length)return!1;if(d.length>0&&o)return t_(n,o);const h=de.fromSchema(t);let p;if(0===d.length){const e=i(l);if(!e||"string"==typeof e)return!1;p=y.fromSchema(t).serializeFragment(e.content)}else{const e=document.createElement("template");e.innerHTML=d,p=e.content.cloneNode(!0),e.remove()}return t_(n,h.parseSlice(p))},clipboardTextSerializer:n=>{const r=e.get(le);if(e_(n.content.toJSON()))return n.content.textBetween(0,n.content.size,"\n\n");const o=t.topNodeType.createAndFill(void 0,n.content);return o?r(o):""}}})});function r_(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-history",...t}}),e}!function(e){Object.assign(e,{meta:{package:"@milkdown/plugin-clipboard",displayName:"Prose<clipboard>"}})}(n_);var o_=l("Undo",()=>()=>Q);r_(o_,{displayName:"Command<undo>"});var i_=l("Redo",()=>()=>ee);r_(i_,{displayName:"Command<redo>"});var a_=a({},"historyProviderConfig");r_(a_,{displayName:"Ctx<historyProviderConfig>"});var s_=s(e=>he(e.get(a_.key)));r_(s_,{displayName:"Ctx<historyProviderPlugin>"});var l_=$("historyKeymap",{Undo:{shortcuts:"Mod-z",command:e=>{const t=e.get(g);return()=>t.call(o_.key)}},Redo:{shortcuts:["Mod-y","Shift-Mod-z"],command:e=>{const t=e.get(g);return()=>t.call(i_.key)}}});r_(l_.ctx,{displayName:"KeymapCtx<history>"}),r_(l_.shortcuts,{displayName:"Keymap<history>"});var c_=[a_,s_,l_,o_,i_].flat(),d_=a({type:"space",size:2},"indentConfig");d_.meta={package:"@milkdown/plugin-indent",displayName:"Ctx<indentConfig>"};var u_=pe(e=>({Tab:(t,n)=>{const r=e.get(d_.key),{tr:o}=t,i=function(e,t){const{doc:n,selection:r}=e;if(!n||!r)return e;if(!(r instanceof S||r instanceof me))return e;const{to:o}=r,i="space"===t.type?Array(t.size).fill(" ").join(""):"\t";return e.insertText(i,o)}(o,r);return!!i.docChanged&&(n?.(i),!0)}}));u_.meta={package:"@milkdown/plugin-indent",displayName:"Shortcut<indent>"};var h_=[d_,u_],p_=class{constructor(){this.beforeMountedListeners=[],this.mountedListeners=[],this.updatedListeners=[],this.selectionUpdatedListeners=[],this.markdownUpdatedListeners=[],this.blurListeners=[],this.focusListeners=[],this.destroyListeners=[],this.beforeMount=e=>(this.beforeMountedListeners.push(e),this),this.mounted=e=>(this.mountedListeners.push(e),this),this.updated=e=>(this.updatedListeners.push(e),this)}get listeners(){return{beforeMount:this.beforeMountedListeners,mounted:this.mountedListeners,updated:this.updatedListeners,markdownUpdated:this.markdownUpdatedListeners,blur:this.blurListeners,focus:this.focusListeners,destroy:this.destroyListeners,selectionUpdated:this.selectionUpdatedListeners}}markdownUpdated(e){return this.markdownUpdatedListeners.push(e),this}blur(e){return this.blurListeners.push(e),this}focus(e){return this.focusListeners.push(e),this}destroy(e){return this.destroyListeners.push(e),this}selectionUpdated(e){return this.selectionUpdatedListeners.push(e),this}},m_=fe(new p_,"listener"),f_=new d("MILKDOWN_LISTENER"),g_=e=>(e.inject(m_,new p_),async()=>{await e.wait(ge);const{listeners:t}=e.get(m_);t.beforeMount.forEach(t=>t(e)),await e.wait(ve);const n=e.get(le);let r=null,o=null,i=null,a=null;const s=hr(()=>{if(!a)return;const{doc:i}=a;if(t.updated.length>0&&r&&!r.eq(i)&&t.updated.forEach(t=>{t(e,i,r)}),t.markdownUpdated.length>0&&r&&!r.eq(i)){const r=n(i);t.markdownUpdated.forEach(t=>{t(e,r,o)}),o=r}r=i,a=null},200),l=new c({key:f_,view:()=>({destroy:()=>{s.cancel(),t.destroy.forEach(t=>t(e))}}),props:{handleDOMEvents:{focus:()=>(t.focus.forEach(t=>t(e)),!1),blur:()=>(t.blur.forEach(t=>t(e)),!1)}},state:{init:(e,t)=>{r=t.doc,o=n(t.doc)},apply:n=>{const r=n.selection;(!i&&r||i&&!r.eq(i))&&(t.selectionUpdated.forEach(t=>{t(e,r,i)}),i=r),(n.docChanged||n.storedMarksSet)&&!1!==n.getMeta("addToHistory")&&(a=n,s())}}});e.update(ye,e=>e.concat(l)),await e.wait(be),t.mounted.forEach(t=>t(e))});g_.meta={package:"@milkdown/plugin-listener",displayName:"Listener"};var v_=a({shouldAppend:e=>!!e&&!["heading","paragraph"].includes(e.type.name),getNode:e=>e.schema.nodes.paragraph.create()},"trailingConfig");v_.meta={package:"@milkdown/plugin-trailing",displayName:"Ctx<trailingConfig>"};var y_=s(e=>{const t=new d("MILKDOWN_TRAILING"),{shouldAppend:n,getNode:r}=e.get(v_.key),o=new c({key:t,state:{init:(e,t)=>{const r=t.tr.doc.lastChild;return n(r,t)},apply:(e,t,r,o)=>{if(!e.docChanged)return t;const i=e.doc.lastChild;return n(i,o)}},appendTransaction:(e,t,n)=>{const{doc:i,tr:a}=n,s=r?.(n),l=o.getState(n),c=i.content.size;if(l&&s)return a.insert(c,s)}});return o});y_.meta={package:"@milkdown/plugin-trailing",displayName:"Prose<trailing>"};var b_=[v_,y_],w_=a({uploader:async(e,t)=>{const n=[];for(let o=0;o<e.length;o++){const t=e.item(o);t&&t.type.includes("image")&&n.push(t)}const{image:r}=t.nodes;if(!r)throw we("image");return(await Promise.all(n.map(e=>function(e){return new Promise(t=>{const n=new FileReader;n.addEventListener("load",()=>{t({alt:e.name,src:n.result})},!1),n.readAsDataURL(e)})}(e)))).map(({alt:e,src:t})=>r.createAndFill({src:t,alt:e}))},enableHtmlFileUploader:!1,uploadWidgetFactory:(e,t)=>{const n=document.createElement("span");return n.textContent="Upload in progress...",v.widget(e,n,t)}},"uploadConfig");w_.meta={package:"@milkdown/plugin-upload",displayName:"Ctx<uploadConfig>"};var x_=s(e=>{const t=new d("MILKDOWN_UPLOAD"),n=(n,r,o)=>{if(!o||o.length<=0)return!1;const i=Symbol("upload symbol"),a=e.get(ae),{uploader:s,getInsertPos:l}=e.get(w_.key),{tr:c}=n.state,d=r instanceof DragEvent?n.posAtCoords({left:r.clientX,top:r.clientY})?.pos??c.selection.from:c.selection.from,u="function"==typeof l?l(r,e,d):d;return n.dispatch(c.setMeta(t,{add:{id:i,pos:u}})),s(o,a,e,u).then(e=>{const r=((e,n)=>{const r=t.getState(e);if(!r)return-1;const o=r.find(void 0,void 0,e=>e.id===n);return o.length?o[0]?.from??-1:-1})(n.state,i);r<0||n.dispatch(n.state.tr.replaceWith(r,r,e).setMeta(t,{remove:{id:i}}))}).catch(e=>{console.error(e)}),!0};return new c({key:t,state:{init:()=>f.empty,apply(t,n){const r=n.map(t.mapping,t.doc),o=t.getMeta(this);if(!o)return r;if(o.add){const{uploadWidgetFactory:n}=e.get(w_.key),i=n(o.add.pos,{id:o.add.id});return r.add(t.doc,[i])}if(o.remove){const e=r.find(void 0,void 0,e=>e.id===o.remove.id);return r.remove(e)}return r}},props:{decorations(e){return this.getState(e)},handlePaste:(t,r)=>{const{enableHtmlFileUploader:o}=e.get(w_.key);return r instanceof ClipboardEvent&&!(!o&&r.clipboardData?.getData("text/html"))&&n(t,r,r.clipboardData?.files)},handleDrop:(e,t)=>t instanceof DragEvent&&n(e,t,t.dataTransfer?.files)}})});x_.meta={package:"@milkdown/plugin-upload",displayName:"Prose<upload>"};var k_=[w_,x_],C_=(e=>(e.CodeMirror="code-mirror",e.ListItem="list-item",e.LinkTooltip="link-tooltip",e.Cursor="cursor",e.ImageBlock="image-block",e.BlockEdit="block-edit",e.Toolbar="toolbar",e.Placeholder="placeholder",e.Table="table",e.Latex="latex",e.TopBar="top-bar",e.AI="ai",e))(C_||{});const __={cursor:!0,"list-item":!0,"link-tooltip":!0,"image-block":!0,"block-edit":!0,placeholder:!0,toolbar:!0,"code-mirror":!0,table:!0,latex:!0,"top-bar":!1,ai:!1},S_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M19 9l1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm0 14l1.25-2.75L23 19l-2.75-1.25L19 15l-1.25 2.75L15 19l2.75 1.25zM9 20l3-6.5L18 10l-6-3.5L9 0L6 6.5L0 10l6 3.5z"\n transform="translate(3 3) scale(0.75)"\n />\n </svg>\n',A_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M8.85758 18.625C8.4358 18.625 8.07715 18.4772 7.78163 18.1817C7.48613 17.8862 7.33838 17.5275 7.33838 17.1058V6.8942C7.33838 6.47242 7.48613 6.11377 7.78163 5.81825C8.07715 5.52275 8.4358 5.375 8.85758 5.375H12.1999C13.2191 5.375 14.1406 5.69231 14.9643 6.32693C15.788 6.96154 16.1999 7.81603 16.1999 8.89038C16.1999 9.63779 16.0194 10.2471 15.6585 10.7183C15.2976 11.1894 14.9088 11.5314 14.4922 11.7442C15.005 11.9211 15.4947 12.2708 15.9614 12.7933C16.428 13.3157 16.6614 14.0192 16.6614 14.9038C16.6614 16.182 16.1902 17.1217 15.2479 17.723C14.3056 18.3243 13.3563 18.625 12.3999 18.625H8.85758ZM9.4883 16.6327H12.3191C13.1063 16.6327 13.6627 16.4141 13.9884 15.9769C14.314 15.5397 14.4768 15.1205 14.4768 14.7192C14.4768 14.3179 14.314 13.8987 13.9884 13.4615C13.6627 13.0243 13.0909 12.8057 12.273 12.8057H9.4883V16.6327ZM9.4883 10.875H12.0826C12.6903 10.875 13.172 10.7013 13.5278 10.3539C13.8836 10.0064 14.0615 9.59037 14.0615 9.10575C14.0615 8.59035 13.8733 8.16918 13.497 7.84225C13.1207 7.51533 12.6595 7.35188 12.1133 7.35188H9.4883V10.875Z"\n />\n </svg>\n',M_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_8070)">\n <path\n d="M4 10.5C3.17 10.5 2.5 11.17 2.5 12C2.5 12.83 3.17 13.5 4 13.5C4.83 13.5 5.5 12.83 5.5 12C5.5 11.17 4.83 10.5 4 10.5ZM4 4.5C3.17 4.5 2.5 5.17 2.5 6C2.5 6.83 3.17 7.5 4 7.5C4.83 7.5 5.5 6.83 5.5 6C5.5 5.17 4.83 4.5 4 4.5ZM4 16.5C3.17 16.5 2.5 17.18 2.5 18C2.5 18.82 3.18 19.5 4 19.5C4.82 19.5 5.5 18.82 5.5 18C5.5 17.18 4.83 16.5 4 16.5ZM8 19H20C20.55 19 21 18.55 21 18C21 17.45 20.55 17 20 17H8C7.45 17 7 17.45 7 18C7 18.55 7.45 19 8 19ZM8 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11H8C7.45 11 7 11.45 7 12C7 12.55 7.45 13 8 13ZM7 6C7 6.55 7.45 7 8 7H20C20.55 7 21 6.55 21 6C21 5.45 20.55 5 20 5H8C7.45 5 7 5.45 7 6Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_8070">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',T_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n fill="none"\n viewBox="0 0 24 24"\n stroke-width="1.5"\n stroke="currentColor"\n class="w-6 h-6"\n >\n <path\n stroke-linecap="round"\n stroke-linejoin="round"\n d="M19.5 8.25l-7.5 7.5-7.5-7.5"\n />\n </svg>\n',E_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_1098_15553)">\n <path\n d="M18.3007 5.70973C17.9107 5.31973 17.2807 5.31973 16.8907 5.70973L12.0007 10.5897L7.1107 5.69973C6.7207 5.30973 6.0907 5.30973 5.7007 5.69973C5.3107 6.08973 5.3107 6.71973 5.7007 7.10973L10.5907 11.9997L5.7007 16.8897C5.3107 17.2797 5.3107 17.9097 5.7007 18.2997C6.0907 18.6897 6.7207 18.6897 7.1107 18.2997L12.0007 13.4097L16.8907 18.2997C17.2807 18.6897 17.9107 18.6897 18.3007 18.2997C18.6907 17.9097 18.6907 17.2797 18.3007 16.8897L13.4107 11.9997L18.3007 7.10973C18.6807 6.72973 18.6807 6.08973 18.3007 5.70973Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_1098_15553">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',L_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_8081)">\n <path\n d="M9.4 16.6L4.8 12L9.4 7.4L8 6L2 12L8 18L9.4 16.6ZM14.6 16.6L19.2 12L14.6 7.4L16 6L22 12L16 18L14.6 16.6Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_8081">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',O_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n fill="none"\n >\n <g clip-path="url(#clip0_1013_1606)">\n <path\n d="M9.00012 16.1998L5.50012 12.6998C5.11012 12.3098 4.49012 12.3098 4.10012 12.6998C3.71012 13.0898 3.71012 13.7098 4.10012 14.0998L8.29012 18.2898C8.68012 18.6798 9.31012 18.6798 9.70012 18.2898L20.3001 7.69982C20.6901 7.30982 20.6901 6.68982 20.3001 6.29982C19.9101 5.90982 19.2901 5.90982 18.9001 6.29982L9.00012 16.1998Z"\n fill="#817567"\n />\n </g>\n <defs>\n <clipPath id="clip0_1013_1606">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',I_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n height="24px"\n viewBox="0 -960 960 960"\n width="24px"\n fill="none"\n >\n <path\n d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"\n />\n </svg>\n',R_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_7900)">\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M19 13H5C4.45 13 4 12.55 4 12C4 11.45 4.45 11 5 11H19C19.55 11 20 11.45 20 12C20 12.55 19.55 13 19 13Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_7900">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',P_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="16"\n height="16"\n viewBox="0 0 16 16"\n >\n <path\n d="M3.5 9.83366C3.35833 9.83366 3.23961 9.78571 3.14383 9.68983C3.04794 9.59394 3 9.47516 3 9.33349C3 9.19171 3.04794 9.07299 3.14383 8.97733C3.23961 8.88155 3.35833 8.83366 3.5 8.83366H12.5C12.6417 8.83366 12.7604 8.8816 12.8562 8.97749C12.9521 9.07338 13 9.19216 13 9.33383C13 9.4756 12.9521 9.59433 12.8562 9.68999C12.7604 9.78577 12.6417 9.83366 12.5 9.83366H3.5ZM3.5 7.16699C3.35833 7.16699 3.23961 7.11905 3.14383 7.02316C3.04794 6.92727 3 6.80849 3 6.66683C3 6.52505 3.04794 6.40633 3.14383 6.31066C3.23961 6.21488 3.35833 6.16699 3.5 6.16699H12.5C12.6417 6.16699 12.7604 6.21494 12.8562 6.31083C12.9521 6.40671 13 6.52549 13 6.66716C13 6.80894 12.9521 6.92766 12.8562 7.02333C12.7604 7.1191 12.6417 7.16699 12.5 7.16699H3.5Z"\n />\n </svg>\n',B_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_1013_1585)">\n <path\n d="M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.09 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_1013_1585">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',z_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M9 16l-5-5l5-5l1.4 1.4L7.825 10H18V6h2v6H7.825l2.575 2.6z"\n />\n </svg>\n',D_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_8075)">\n <path\n d="M19 5V19H5V5H19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM14.14 11.86L11.14 15.73L9 13.14L6 17H18L14.14 11.86Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_8075">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',N_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M6.29811 18.625C6.04505 18.625 5.83115 18.5375 5.65641 18.3626C5.48166 18.1877 5.39429 17.9736 5.39429 17.7203C5.39429 17.467 5.48166 17.2532 5.65641 17.0788C5.83115 16.9045 6.04505 16.8173 6.29811 16.8173H9.21159L12.452 7.18265H9.53851C9.28545 7.18265 9.07155 7.0952 8.89681 6.9203C8.72206 6.7454 8.63469 6.5313 8.63469 6.278C8.63469 6.02472 8.72206 5.81089 8.89681 5.63652C9.07155 5.46217 9.28545 5.375 9.53851 5.375H16.8847C17.1377 5.375 17.3516 5.46245 17.5264 5.63735C17.7011 5.81225 17.7885 6.02634 17.7885 6.27962C17.7885 6.53293 17.7011 6.74676 17.5264 6.92113C17.3516 7.09548 17.1377 7.18265 16.8847 7.18265H14.2789L11.0385 16.8173H13.6443C13.8973 16.8173 14.1112 16.9048 14.286 17.0797C14.4607 17.2546 14.5481 17.4687 14.5481 17.722C14.5481 17.9752 14.4607 18.1891 14.286 18.3634C14.1112 18.5378 13.8973 18.625 13.6443 18.625H6.29811Z"\n />\n </svg>\n',H_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M17.0385 19.5003V16.5388H14.0769V15.0388H17.0385V12.0773H18.5384V15.0388H21.5V16.5388H18.5384V19.5003H17.0385ZM10.8077 16.5388H7.03845C5.78282 16.5388 4.7125 16.0963 3.8275 15.2114C2.9425 14.3266 2.5 13.2564 2.5 12.0009C2.5 10.7454 2.9425 9.67504 3.8275 8.78979C4.7125 7.90454 5.78282 7.46191 7.03845 7.46191H10.8077V8.96186H7.03845C6.1987 8.96186 5.48235 9.25834 4.8894 9.85129C4.29645 10.4442 3.99998 11.1606 3.99998 12.0003C3.99998 12.8401 4.29645 13.5564 4.8894 14.1494C5.48235 14.7423 6.1987 15.0388 7.03845 15.0388H10.8077V16.5388ZM8.25 12.7503V11.2504H15.75V12.7503H8.25ZM21.5 12.0003H20C20 11.1606 19.7035 10.4442 19.1106 9.85129C18.5176 9.25834 17.8013 8.96186 16.9615 8.96186H13.1923V7.46191H16.9615C18.2171 7.46191 19.2875 7.90441 20.1725 8.78939C21.0575 9.67439 21.5 10.7447 21.5 12.0003Z"\n />\n </svg>\n',q_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_8067)">\n <path\n d="M8 7H20C20.55 7 21 6.55 21 6C21 5.45 20.55 5 20 5H8C7.45 5 7 5.45 7 6C7 6.55 7.45 7 8 7ZM20 17H8C7.45 17 7 17.45 7 18C7 18.55 7.45 19 8 19H20C20.55 19 21 18.55 21 18C21 17.45 20.55 17 20 17ZM20 11H8C7.45 11 7 11.45 7 12C7 12.55 7.45 13 8 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11ZM4.5 16H2.5C2.22 16 2 16.22 2 16.5C2 16.78 2.22 17 2.5 17H4V17.5H3.5C3.22 17.5 3 17.72 3 18C3 18.28 3.22 18.5 3.5 18.5H4V19H2.5C2.22 19 2 19.22 2 19.5C2 19.78 2.22 20 2.5 20H4.5C4.78 20 5 19.78 5 19.5V16.5C5 16.22 4.78 16 4.5 16ZM2.5 5H3V7.5C3 7.78 3.22 8 3.5 8C3.78 8 4 7.78 4 7.5V4.5C4 4.22 3.78 4 3.5 4H2.5C2.22 4 2 4.22 2 4.5C2 4.78 2.22 5 2.5 5ZM4.5 10H2.5C2.22 10 2 10.22 2 10.5C2 10.78 2.22 11 2.5 11H3.8L2.12 12.96C2.04 13.05 2 13.17 2 13.28V13.5C2 13.78 2.22 14 2.5 14H4.5C4.78 14 5 13.78 5 13.5C5 13.22 4.78 13 4.5 13H3.2L4.88 11.04C4.96 10.95 5 10.83 5 10.72V10.5C5 10.22 4.78 10 4.5 10Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_8067">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',j_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_971_7676)">\n <path\n d="M18 13H13V18C13 18.55 12.55 19 12 19C11.45 19 11 18.55 11 18V13H6C5.45 13 5 12.55 5 12C5 11.45 5.45 11 6 11H11V6C11 5.45 11.45 5 12 5C12.55 5 13 5.45 13 6V11H18C18.55 11 19 11.45 19 12C19 12.55 18.55 13 18 13Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_971_7676">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',V_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_7897)">\n <path\n d="M7.17 17C7.68 17 8.15 16.71 8.37 16.26L9.79 13.42C9.93 13.14 10 12.84 10 12.53V8C10 7.45 9.55 7 9 7H5C4.45 7 4 7.45 4 8V12C4 12.55 4.45 13 5 13H7L5.97 15.06C5.52 15.95 6.17 17 7.17 17ZM17.17 17C17.68 17 18.15 16.71 18.37 16.26L19.79 13.42C19.93 13.14 20 12.84 20 12.53V8C20 7.45 19.55 7 19 7H15C14.45 7 14 7.45 14 8V12C14 12.55 14.45 13 15 13H17L15.97 15.06C15.52 15.95 16.17 17 17.17 17Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_7897">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',F_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M7.30775 20.4997C6.81058 20.4997 6.385 20.3227 6.031 19.9687C5.677 19.6147 5.5 19.1892 5.5 18.692V5.99973H5.25C5.0375 5.99973 4.85942 5.92782 4.71575 5.78398C4.57192 5.64015 4.5 5.46198 4.5 5.24948C4.5 5.03682 4.57192 4.85873 4.71575 4.71523C4.85942 4.57157 5.0375 4.49973 5.25 4.49973H9C9 4.2549 9.08625 4.04624 9.25875 3.87374C9.43108 3.7014 9.63967 3.61523 9.8845 3.61523H14.1155C14.3603 3.61523 14.5689 3.7014 14.7413 3.87374C14.9138 4.04624 15 4.2549 15 4.49973H18.75C18.9625 4.49973 19.1406 4.57165 19.2843 4.71548C19.4281 4.85932 19.5 5.03748 19.5 5.24998C19.5 5.46265 19.4281 5.64073 19.2843 5.78423C19.1406 5.9279 18.9625 5.99973 18.75 5.99973H18.5V18.692C18.5 19.1892 18.323 19.6147 17.969 19.9687C17.615 20.3227 17.1894 20.4997 16.6923 20.4997H7.30775ZM17 5.99973H7V18.692C7 18.7818 7.02883 18.8556 7.0865 18.9132C7.14417 18.9709 7.21792 18.9997 7.30775 18.9997H16.6923C16.7821 18.9997 16.8558 18.9709 16.9135 18.9132C16.9712 18.8556 17 18.7818 17 18.692V5.99973ZM10.1543 16.9997C10.3668 16.9997 10.5448 16.9279 10.6885 16.7842C10.832 16.6404 10.9037 16.4622 10.9037 16.2497V8.74973C10.9037 8.53723 10.8318 8.35907 10.688 8.21523C10.5443 8.07157 10.3662 7.99973 10.1535 7.99973C9.941 7.99973 9.76292 8.07157 9.61925 8.21523C9.47575 8.35907 9.404 8.53723 9.404 8.74973V16.2497C9.404 16.4622 9.47583 16.6404 9.6195 16.7842C9.76333 16.9279 9.94158 16.9997 10.1543 16.9997ZM13.8465 16.9997C14.059 16.9997 14.2371 16.9279 14.3807 16.7842C14.5243 16.6404 14.596 16.4622 14.596 16.2497V8.74973C14.596 8.53723 14.5242 8.35907 14.3805 8.21523C14.2367 8.07157 14.0584 7.99973 13.8458 7.99973C13.6333 7.99973 13.4552 8.07157 13.3115 8.21523C13.168 8.35907 13.0962 8.53723 13.0962 8.74973V16.2497C13.0962 16.4622 13.1682 16.6404 13.312 16.7842C13.4557 16.9279 13.6338 16.9997 13.8465 16.9997Z"\n />\n </svg>\n',$_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n fill="none"\n viewBox="0 0 24 24"\n stroke-width="1.5"\n stroke="currentColor"\n class="w-6 h-6"\n >\n <path\n stroke-linecap="round"\n stroke-linejoin="round"\n d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"\n />\n </svg>\n',W_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M3.25 13.7404C3.0375 13.7404 2.85938 13.6684 2.71563 13.5246C2.57188 13.3808 2.5 13.2026 2.5 12.99C2.5 12.7774 2.57188 12.5993 2.71563 12.4558C2.85938 12.3122 3.0375 12.2404 3.25 12.2404H20.75C20.9625 12.2404 21.1406 12.3123 21.2843 12.4561C21.4281 12.5999 21.5 12.7781 21.5 12.9907C21.5 13.2033 21.4281 13.3814 21.2843 13.525C21.1406 13.6686 20.9625 13.7404 20.75 13.7404H3.25ZM10.9423 10.2596V6.62495H6.5673C6.2735 6.62495 6.02377 6.52201 5.8181 6.31613C5.61245 6.11026 5.50963 5.86027 5.50963 5.56615C5.50963 5.27205 5.61245 5.02083 5.8181 4.8125C6.02377 4.60417 6.2735 4.5 6.5673 4.5H17.4423C17.7361 4.5 17.9858 4.60294 18.1915 4.80883C18.3971 5.01471 18.5 5.2647 18.5 5.5588C18.5 5.85292 18.3971 6.10413 18.1915 6.31245C17.9858 6.52078 17.7361 6.62495 17.4423 6.62495H13.0673V10.2596H10.9423ZM10.9423 15.7211H13.0673V18.4423C13.0673 18.7361 12.9643 18.9858 12.7584 19.1915C12.5526 19.3971 12.3026 19.5 12.0085 19.5C11.7144 19.5 11.4631 19.3962 11.2548 19.1887C11.0465 18.9811 10.9423 18.7291 10.9423 18.4327V15.7211Z"\n />\n </svg>\n',U_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_8078)">\n <path\n d="M20 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H20C21.1 21 22 20.1 22 19V5C22 3.9 21.1 3 20 3ZM20 5V8H5V5H20ZM15 19H10V10H15V19ZM5 10H8V19H5V10ZM17 19V10H20V19H17Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_8078">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',G_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M5.66936 16.3389L9.39244 12.6158C9.54115 12.4671 9.71679 12.3937 9.91936 12.3957C10.1219 12.3976 10.2975 12.4761 10.4463 12.6312C10.5847 12.7823 10.654 12.9585 10.654 13.1599C10.654 13.3613 10.5847 13.5363 10.4463 13.6851L6.32704 17.8197C6.14627 18.0004 5.93538 18.0908 5.69436 18.0908C5.45333 18.0908 5.24243 18.0004 5.06166 17.8197L3.01744 15.7754C2.87899 15.637 2.81136 15.4629 2.81456 15.2533C2.81776 15.0437 2.88859 14.8697 3.02706 14.7312C3.16551 14.5928 3.34008 14.5235 3.55076 14.5235C3.76144 14.5235 3.93494 14.5928 4.07126 14.7312L5.66936 16.3389ZM5.66936 8.72359L9.39244 5.00049C9.54115 4.85177 9.71679 4.77838 9.91936 4.78031C10.1219 4.78223 10.2975 4.86075 10.4463 5.01586C10.5847 5.16691 10.654 5.34314 10.654 5.54454C10.654 5.74592 10.5847 5.92097 10.4463 6.06969L6.32704 10.2043C6.14627 10.3851 5.93538 10.4755 5.69436 10.4755C5.45333 10.4755 5.24243 10.3851 5.06166 10.2043L3.01744 8.16009C2.87899 8.02162 2.81136 7.84759 2.81456 7.63799C2.81776 7.42837 2.88859 7.25433 3.02706 7.11586C3.16551 6.97741 3.34008 6.90819 3.55076 6.90819C3.76144 6.90819 3.93494 6.97741 4.07126 7.11586L5.66936 8.72359ZM13.7597 16.5581C13.5472 16.5581 13.3691 16.4862 13.2253 16.3424C13.0816 16.1986 13.0097 16.0204 13.0097 15.8078C13.0097 15.5952 13.0816 15.4171 13.2253 15.2735C13.3691 15.13 13.5472 15.0582 13.7597 15.0582H20.7597C20.9722 15.0582 21.1503 15.1301 21.2941 15.2739C21.4378 15.4177 21.5097 15.5959 21.5097 15.8085C21.5097 16.0211 21.4378 16.1992 21.2941 16.3427C21.1503 16.4863 20.9722 16.5581 20.7597 16.5581H13.7597ZM13.7597 8.94276C13.5472 8.94276 13.3691 8.87085 13.2253 8.72704C13.0816 8.58324 13.0097 8.40504 13.0097 8.19244C13.0097 7.97985 13.0816 7.80177 13.2253 7.65819C13.3691 7.5146 13.5472 7.44281 13.7597 7.44281H20.7597C20.9722 7.44281 21.1503 7.51471 21.2941 7.65851C21.4378 7.80233 21.5097 7.98053 21.5097 8.19311C21.5097 8.40571 21.4378 8.5838 21.2941 8.72739C21.1503 8.87097 20.9722 8.94276 20.7597 8.94276H13.7597Z"\n />\n </svg>\n',Z_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="m12.9 16l-2.55-2.5l.05-.05q1.45-1.6 2.262-3.117T13.95 7H16V5h-6V3H8v2H2v2h9.1q-.5 1.2-1.225 2.387T8 11.7q-.6-.6-1.187-1.412T5.85 8.6H3.85q.5 1.4 1.3 2.7T6.95 13.7L2.85 17.75L4.25 19.15L8 15.4L10.55 17.95zM18.5 22h-2L21 10h2l4.5 12h-2l-1.05-3h-4.9zm1.6-5h3.6l-1.8-5.1z"\n />\n </svg>\n',X_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="32"\n height="32"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M7 19v-.808L13.096 12L7 5.808V5h10v1.25H9.102L14.727 12l-5.625 5.77H17V19z"\n />\n </svg>\n',K_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n height="24px"\n viewBox="0 -960 960 960"\n width="24px"\n >\n <path\n d="m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"\n />\n </svg>\n',Y_={[C_.CodeMirror]:{theme:Lr,languages:br,expandIcon:T_,searchIcon:$_,clearSearchIcon:E_,searchPlaceholder:"Search language",noResultText:"No result",previewToggleIcon:e=>e?B_:K_}},J_=fe([],"FeaturesCtx"),Q_=fe({},"CrepeCtx");function eS(e){return e.use("FeaturesCtx")}function tS(e){return t=>{eS(t).update(t=>t.includes(e)?t:[...t,e])}}function nS(e,t){var n;const r=e.get(T),o=e.get(le),{state:i}=r,a=o(i.doc);let s="";if(!i.selection.empty){const{from:e,to:t}=i.selection,r=i.doc.slice(e,t),{schema:a}=i.doc.type;let l=a.topNodeType.createAndFill(null,r.content);if(!l){const e=null==(n=a.nodes.paragraph)?void 0:n.createAndFill(null,r.content);e&&(l=a.topNodeType.createAndFill(null,e))}s=l?o(l):i.doc.textBetween(e,t)}return{document:a,selection:s,instruction:t}}const rS=a({provider:void 0,buildContext:void 0,diffReviewOnEnd:!0,onError:e=>{console.error(`[milkdown/ai] [${e.code}]`,e)},aiIcon:void 0},"aiProviderConfig"),oS=a({abortController:null,label:"",lastInstruction:"",lastLabel:void 0,lastFrom:-1,lastTo:-1,diffOwnedByAI:!1},"aiSession");function iS(e,t){const n=e.get(rS.key);try{n.onError(t)}catch(r){console.error("[milkdown/ai] onError handler failed:",r)}}function aS(e){const t=e.get(oS.key);e.set(oS.key,{...t,abortController:null,label:""})}const sS=l("RunAI",e=>t=>(n,r)=>{var o,i,a,s;if(!(null==t?void 0:t.instruction))return!1;const l=e.get(rS.key);if(!l.provider)return!1;if(e.get(oS.key).abortController)return!1;if(null==(o=Ko.getState(n))?void 0:o.active)return!1;if(null==(i=to.getState(n))?void 0:i.active)return!1;if(!r)return!0;const c=new AbortController,{from:d,to:u}=n.selection;e.set(oS.key,{abortController:c,label:null!=(a=t.label)?a:"",lastInstruction:t.instruction,lastLabel:t.label,lastFrom:d,lastTo:u,diffOwnedByAI:!1});const h=e.get(g),p=n.selection.empty?"cursor":"selection";if(!h.call(Jo.key,{insertAt:p}))return aS(e),!1;let m;try{m=(null!=(s=l.buildContext)?s:nS)(e,t.instruction)}catch(f){const t=Me(f);return iS(e,t),h.call(ti.key,{keep:!1}),aS(e),!1}return async function(e,t,n,r){try{const o=t(n,r.signal),i=e.get(g);for await(const e of o){if(r.signal.aborted)break;i.call(Qo.key,e)}if(r.signal.aborted)return;const a=e.get(rS.key);if(a.diffReviewOnEnd){const t=e.get(oS.key);e.set(oS.key,{...t,diffOwnedByAI:!0})}const s=i.call(ei.key,{diffReview:a.diffReviewOnEnd});if(a.diffReviewOnEnd&&!s){const t=e.get(oS.key);e.set(oS.key,{...t,diffOwnedByAI:!1})}}catch(f){if(r.signal.aborted)return;iS(e,Ie(f)),e.get(g).call(ti.key,{keep:!1})}finally{e.get(oS.key).abortController===r&&aS(e)}}(e,l.provider,m,c),!0}),lS=l("AbortAI",e=>t=>(n,r)=>{var o;const i=e.get(oS.key);return r?!!i.abortController&&(i.abortController.abort(),aS(e),(null==(o=Ko.getState(n))?void 0:o.active)&&e.get(g).call(ti.key,t),!0):!!i.abortController});var cS,dS,uS,hS,pS,mS,fS,gS,vS,yS,bS,wS,xS,kS,CS,_S,SS=e=>{throw TypeError(e)},AS=(e,t,n)=>t.has(e)||SS("Cannot "+n),MS=(e,t,n)=>(AS(e,t,"read from private field"),n?n.call(e):t.get(e)),TS=(e,t,n)=>t.has(e)?SS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ES=(e,t,n,r)=>(AS(e,t,"write to private field"),t.set(e,n),n),LS=(e,t,n)=>(AS(e,t,"access private method"),n);const OS="milkdown-ai-diff-actions";function IS(e,t){e.innerHTML=Sn.sanitize(t.trim())}class RS{constructor(e,t,n){this.ctx=e,TS(this,vS),TS(this,cS),TS(this,dS),TS(this,uS),TS(this,hS),TS(this,pS,!1),TS(this,mS,!1),TS(this,fS,null),TS(this,gS,!1),TS(this,xS,()=>{const e=this.ctx.get(oS.key);if(!e.lastInstruction)return;if(!MS(this,gS)||!LS(this,vS,kS).call(this))return;const t=this.ctx.get(g);t.call(ho.key);const n=this.ctx.get(T),{doc:r}=n.state,o=Math.min(Math.max(e.lastFrom,0),r.content.size),i=Math.min(Math.max(e.lastTo,0),r.content.size);n.dispatch(n.state.tr.setSelection(S.create(n.state.doc,o,i))),t.call(sS.key,{instruction:e.lastInstruction,label:e.lastLabel})}),TS(this,CS,()=>{this.ctx.get(g).call(ho.key)}),TS(this,_S,()=>{this.ctx.get(g).call(uo.key)}),ES(this,hS,n),ES(this,dS,LS(this,vS,yS).call(this,t));const r=document.createElement("div");r.className=OS,r.dataset.show="false",ES(this,uS,LS(this,vS,bS).call(this,"retry",n.retryIcon,n.retryLabel,MS(this,xS))),r.appendChild(MS(this,uS)),r.appendChild(LS(this,vS,bS).call(this,"reject",n.rejectIcon,n.rejectAllLabel,MS(this,CS)));const o=LS(this,vS,bS).call(this,"accept",n.acceptIcon,n.acceptAllLabel,MS(this,_S));o.appendChild(LS(this,vS,wS).call(this)),r.appendChild(o),ES(this,cS,r),MS(this,dS).appendChild(r),this.update(t)}update(e){var t;const n=!!(null==(t=to.getState(e.state))?void 0:t.active);if(n!==MS(this,mS))if(ES(this,mS,n),n){const t=this.ctx.get(oS.key);ES(this,gS,t.diffOwnedByAI),ES(this,fS,e.state.doc)}else{ES(this,gS,!1),ES(this,fS,null);const e=this.ctx.get(oS.key);e.diffOwnedByAI&&this.ctx.set(oS.key,{...e,diffOwnedByAI:!1})}const r=n&&MS(this,gS);if(r!==MS(this,pS)&&(ES(this,pS,r),MS(this,cS).dataset.show=r?"true":"false"),r){const t=this.ctx.get(oS.key),n=!!MS(this,fS)&&e.state.doc.eq(MS(this,fS));MS(this,uS).disabled=!t.lastInstruction||!n}}destroy(){MS(this,cS).remove()}}cS=new WeakMap,dS=new WeakMap,uS=new WeakMap,hS=new WeakMap,pS=new WeakMap,mS=new WeakMap,fS=new WeakMap,gS=new WeakMap,vS=new WeakSet,yS=function(e){var t;return null!=(t=e.dom.closest(".milkdown"))?t:document.body},bS=function(e,t,n,r){const o=document.createElement("button");o.type="button",o.className=`${OS}-btn ${OS}-btn-${e}`,o.appendChild(function(e){const t=document.createElement("span");return t.className=`${OS}-icon`,IS(t,e),t}(t));const i=document.createElement("span");return i.textContent=n,o.appendChild(i),o.addEventListener("mousedown",e=>e.preventDefault()),o.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),r()}),o},wS=function(){const e=document.createElement("span");e.className=`${OS}-shortcut`;const t=document.createElement("span");t.textContent=MS(this,hS).modSymbol;const n=document.createElement("span");return n.className=`${OS}-shortcut-icon`,IS(n,MS(this,hS).enterKeyIcon),e.append(t,n),e},xS=new WeakMap,kS=function(){return!!MS(this,fS)&&this.ctx.get(T).state.doc.eq(MS(this,fS))},CS=new WeakMap,_S=new WeakMap;const PS=new d("CREPE_AI_DIFF_ACTIONS_PANEL"),BS=function(){var e,t,n,r;if("undefined"==typeof navigator)return"⌘";const o=navigator,i=null!=(r=null!=(n=null!=(t=null==(e=o.userAgentData)?void 0:e.platform)?t:o.platform)?n:o.userAgent)?r:"";return/mac|iphone|ipad|ipod/i.test(i)?"⌘":"Ctrl"}();var zS,DS,NS=e=>{throw TypeError(e)},HS=(e,t,n)=>t.has(e)||NS("Cannot "+n),qS=(e,t,n)=>(HS(e,t,"read from private field"),n?n.call(e):t.get(e)),jS=(e,t,n)=>t.has(e)?NS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),VS=(e,t,n,r)=>(HS(e,t,"write to private field"),t.set(e,n),n);function FS(e){const t={addItem:(n,r)=>(e.items.set(n,r),t),removeItem:n=>(e.items.delete(n),t),getItem:t=>e.items.get(t),clear:()=>(e.items.clear(),t)};return t}class $S{constructor(){jS(this,zS,[]),this.addItem=(e,t)=>(qS(this,DS).call(this,e),qS(this,zS).push({kind:"item",id:e,item:t}),this),this.addSubmenu=(e,t,n)=>{qS(this,DS).call(this,e);const r={def:t,items:new Map};return n&&n(FS(r)),qS(this,zS).push({kind:"submenu",id:e,node:r}),this},this.removeItem=e=>(qS(this,DS).call(this,e),this),this.getItem=e=>{const t=qS(this,zS).find(t=>"item"===t.kind&&t.id===e);return"item"===(null==t?void 0:t.kind)?t.item:void 0},this.getSubmenu=e=>{const t=qS(this,zS).find(t=>"submenu"===t.kind&&t.id===e);return"submenu"===(null==t?void 0:t.kind)?FS(t.node):void 0},this.clear=()=>(VS(this,zS,[]),this),this.build=()=>{const e=[],t={};for(const n of qS(this,zS))"item"===n.kind?e.push({kind:"item",id:n.id,item:n.item}):(e.push({kind:"submenu",id:n.id,def:n.node.def}),t[n.id]={def:n.node.def,items:Array.from(n.node.items.entries()).map(([e,t])=>({id:e,item:t}))});return{main:e,submenus:t}},jS(this,DS,e=>{VS(this,zS,qS(this,zS).filter(t=>t.id!==e))})}}zS=new WeakMap,DS=new WeakMap;const WS=ml({props:{placeholder:{type:Object,required:!0},resetSignal:{type:Object,required:!0},suggestions:{type:Object,required:!0},chrome:{type:Object,required:!0},onConfirm:{type:Function,required:!0},onCancel:{type:Function,required:!0}},setup({placeholder:e,resetSignal:t,suggestions:n,chrome:r,onConfirm:o,onCancel:i}){const a=gs(""),s=gs({kind:"main"}),l=gs(0),c=gs(null),d=gs(null),u=`ai-instruction-list-${Math.random().toString(36).slice(2,9)}`,h=e=>`${u}-opt-${e}`;sl(t,()=>{a.value="",s.value={kind:"main"},l.value=0});const p=hd(()=>{if("submenu"===s.value.kind){const e=n.submenus[s.value.id];return e?e.items.map(({id:e,item:t})=>({id:e,icon:t.icon,label:t.label,hasSubmenu:!1,prompt:{text:t.prompt,streamingLabel:t.streamingLabel}})):[]}return n.main.map(e=>"item"===e.kind?{id:e.id,icon:e.item.icon,label:e.item.label,hasSubmenu:!1,prompt:{text:e.item.prompt,streamingLabel:e.item.streamingLabel}}:{id:e.id,icon:e.def.icon,label:e.def.label,hasSubmenu:!0})}),m=hd(()=>{var e,t;return"submenu"!==s.value.kind?null:null!=(t=null==(e=n.submenus[s.value.id])?void 0:e.def)?t:null}),f=hd(()=>{const e=a.value.trim().toLowerCase();return e?p.value.filter(t=>t.label.toLowerCase().includes(e)):p.value}),g=hd(()=>a.value.trim().length>0),v=hd(()=>f.value.length+(g.value?1:0));sl([f,s,g],()=>{l.value=g.value?f.value.length:0});const y=()=>{Ns(()=>{var e;return null==(e=c.value)?void 0:e.focus()})},b=()=>{s.value={kind:"main"},a.value="",l.value=0,y()},w=e=>{e.hasSubmenu?(e=>{s.value={kind:"submenu",id:e},a.value="",l.value=0,y()})(e.id):e.prompt&&(o(e.prompt.text,e.prompt.streamingLabel),a.value="")},x=()=>{const e=a.value.trim();e&&(o(e),a.value="")},k=()=>{Ns(()=>{const e=d.value;if(!e)return;const t=e.querySelector(`[data-index="${l.value}"]`);null==t||t.scrollIntoView({block:"nearest"})})},C=e=>{if(e.stopPropagation(),"ArrowDown"===e.key){if(e.preventDefault(),0===v.value)return;return l.value=(l.value+1)%v.value,void k()}if("ArrowUp"===e.key){if(e.preventDefault(),0===v.value)return;return l.value=(l.value-1+v.value)%v.value,void k()}return"Enter"===e.key?(e.preventDefault(),void(()=>{const e=l.value,t=f.value;e<t.length?w(t[e]):g.value&&x()})()):"Escape"===e.key?(e.preventDefault(),void("submenu"===s.value.kind?b():i())):void("Backspace"===e.key&&""===a.value&&"submenu"===s.value.kind&&(e.preventDefault(),b()))},_=e=>{e.preventDefault()};return()=>{const t=f.value,n=g.value,o=m.value;return pd("div",{class:"ai-instruction"},pd("div",{class:"ai-instruction-input"},pd("span",{class:"ai-instruction-input-prefix"},pd(jd,{icon:r.aiIcon})),pd("input",{ref:c,class:"ai-instruction-input-field",role:"combobox","aria-expanded":"true","aria-autocomplete":"list","aria-controls":u,"aria-activedescendant":v.value>0?h(l.value):void 0,placeholder:o?o.searchPlaceholder:e.value,value:a.value,onInput:e=>{a.value=e.target.value},onKeydown:C}),pd("button",{type:"button",class:"ai-instruction-submit","aria-label":r.submitButtonLabel,disabled:!n,onMousedown:_,onClick:x},pd(jd,{icon:r.sendIcon}))),pd("div",{class:"ai-instruction-list",ref:d,id:u,role:"listbox","aria-label":r.listboxLabel},o&&pd("button",{type:"button",class:"ai-instruction-back",onMousedown:_,onClick:b},pd("span",{class:"ai-instruction-back-icon","aria-hidden":"true"},pd(jd,{icon:r.chevronLeftIcon})),pd("span",null,o.title)),t.length>0&&pd("div",{class:"ai-instruction-section"},pd("div",{class:"ai-instruction-section-header"},r.suggestionsHeaderLabel),t.map((e,t)=>pd("div",{key:e.id,id:h(t),"data-index":t,role:"option","aria-selected":t===l.value,class:["ai-instruction-item",t===l.value?"active":""],onMousedown:_,onClick:()=>w(e),onPointerenter:()=>{l.value=t}},pd("span",{class:"ai-instruction-item-icon"},pd(jd,{icon:e.icon})),pd("span",{class:"ai-instruction-item-label"},function(e,t){const n=t.trim();if(!n)return[e];const r=e.toLowerCase(),o=n.toLowerCase(),i=r.indexOf(o);return-1===i?[e]:[e.slice(0,i),pd("mark",null,e.slice(i,i+n.length)),e.slice(i+n.length)]}(e.label,a.value)),e.hasSubmenu&&pd("span",{class:"ai-instruction-item-arrow"},pd(jd,{icon:r.chevronRightIcon}))))),n&&pd("div",{class:"ai-instruction-section"},pd("div",{class:"ai-instruction-section-header"},r.sendAsPromptHeaderLabel),pd("div",{id:h(t.length),"data-index":t.length,role:"option","aria-selected":l.value===t.length,class:["ai-instruction-item","ai-instruction-item-prompt",l.value===t.length?"active":""],onMousedown:_,onClick:x,onPointerenter:()=>{l.value=t.length}},pd("span",{class:"ai-instruction-item-icon"},pd(jd,{icon:r.sendPromptIcon})),pd("span",{class:"ai-instruction-item-label"},r.sendAsPromptLabel," ",pd("span",{class:"ai-instruction-item-quote"},'"',a.value,'"')),pd("span",{class:"ai-instruction-item-shortcut"},pd(jd,{icon:r.enterKeyIcon}))))))}}});var US,GS,ZS,XS,KS,YS,JS,QS,eA,tA,nA=e=>{throw TypeError(e)},rA=(e,t,n)=>t.has(e)||nA("Cannot "+n),oA=(e,t,n)=>(rA(e,t,"read from private field"),n?n.call(e):t.get(e)),iA=(e,t,n)=>t.has(e)?nA("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),aA=(e,t,n,r)=>(rA(e,t,"write to private field"),t.set(e,n),n);class sA{constructor(e,t,n){this.ctx=e,iA(this,US),iA(this,GS),iA(this,ZS),iA(this,XS),iA(this,KS),iA(this,YS,-1),iA(this,JS,-1),iA(this,QS,!1),iA(this,eA,(e,t)=>{e.trim()&&this.ctx.get(g).call(sS.key,{instruction:e,label:t})&&(aA(this,QS,!1),oA(this,GS).hide())}),iA(this,tA,()=>{aA(this,QS,!1),oA(this,GS).hide()}),this.show=(e,t)=>{aA(this,YS,e),aA(this,JS,t),oA(this,KS).value++,aA(this,QS,!0);const n=this.ctx.get(T);oA(this,GS).show({getBoundingClientRect:()=>_(n,e,t)},n),requestAnimationFrame(()=>{var e;null==(e=oA(this,US).querySelector("input"))||e.focus()})},this.update=(e,t)=>{const{selection:n}=e.state,r=n instanceof S,o=n.from!==oA(this,YS)||n.to!==oA(this,JS);if(!r||o)return aA(this,QS,!1),void oA(this,GS).hide();oA(this,GS).update(e,t)},this.destroy=()=>{oA(this,ZS).unmount(),oA(this,GS).destroy(),oA(this,US).remove()},aA(this,XS,gs(n.placeholder)),aA(this,KS,gs(0));const r=document.createElement("div");r.className="milkdown-ai-instruction";const o=qd(WS,{placeholder:oA(this,XS),resetSignal:oA(this,KS),suggestions:n.suggestions,chrome:n.chrome,onConfirm:oA(this,eA),onCancel:oA(this,tA)});o.mount(r),aA(this,ZS,o),aA(this,US,r),aA(this,GS,new ri({content:r,debounce:0,offset:10,shouldShow:()=>oA(this,QS),floatingUIOptions:{placement:"bottom"}})),oA(this,GS).onHide=()=>{aA(this,QS,!1),requestAnimationFrame(()=>{try{const e=oA(this,US).getRootNode().activeElement;if(!e||!oA(this,US).contains(e))return;this.ctx.get(T).dom.focus({preventScroll:!0})}catch(_T){}})},oA(this,GS).update(t)}}US=new WeakMap,GS=new WeakMap,ZS=new WeakMap,XS=new WeakMap,KS=new WeakMap,YS=new WeakMap,JS=new WeakMap,QS=new WeakMap,eA=new WeakMap,tA=new WeakMap;const lA=a({show:()=>{}},"aiInstructionTooltipAPI"),cA=oi("CREPE_AI_INSTRUCTION");function dA(e){var t,n,r,o,i,a,s,l,c,d,u;return{aiIcon:null!=(t=null==e?void 0:e.aiIcon)?t:S_,sendIcon:null!=(n=null==e?void 0:e.sendIcon)?n:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M11 20V7.825l-5.6 5.6L4 12l8-8l8 8l-1.4 1.425l-5.6-5.6V20z"\n />\n </svg>\n',sendPromptIcon:null!=(r=null==e?void 0:e.sendPromptIcon)?r:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M3 20v-6l8-2l-8-2V4l19 8z"\n />\n </svg>\n',enterKeyIcon:null!=(o=null==e?void 0:e.enterKeyIcon)?o:z_,chevronLeftIcon:null!=(i=null==e?void 0:e.chevronLeftIcon)?i:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n fill="none"\n viewBox="0 0 24 24"\n stroke-width="1.5"\n stroke="currentColor"\n >\n <path\n stroke-linecap="round"\n stroke-linejoin="round"\n d="M15.75 19.5L8.25 12l7.5-7.5"\n />\n </svg>\n',chevronRightIcon:null!=(a=null==e?void 0:e.chevronRightIcon)?a:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n fill="none"\n viewBox="0 0 24 24"\n stroke-width="1.5"\n stroke="currentColor"\n >\n <path\n stroke-linecap="round"\n stroke-linejoin="round"\n d="M8.25 4.5l7.5 7.5-7.5 7.5"\n />\n </svg>\n',suggestionsHeaderLabel:null!=(s=null==e?void 0:e.suggestionsHeaderLabel)?s:"SUGGESTIONS",sendAsPromptHeaderLabel:null!=(l=null==e?void 0:e.sendAsPromptHeaderLabel)?l:"SEND AS PROMPT",sendAsPromptLabel:null!=(c=null==e?void 0:e.sendAsPromptLabel)?c:"Ask AI:",submitButtonLabel:null!=(d=null==e?void 0:e.submitButtonLabel)?d:"Send prompt",listboxLabel:null!=(u=null==e?void 0:e.listboxLabel)?u:"AI suggestions"}}var uA,hA,pA,mA,fA,gA,vA,yA=e=>{throw TypeError(e)},bA=(e,t,n)=>t.has(e)||yA("Cannot "+n),wA=(e,t,n)=>(bA(e,t,"read from private field"),n?n.call(e):t.get(e)),xA=(e,t,n)=>t.has(e)?yA("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),kA=(e,t,n,r)=>(bA(e,t,"write to private field"),t.set(e,n),n);const CA="milkdown-ai-streaming",_A=new d("CREPE_AI_STREAMING_INDICATOR");class SA{constructor(e,t,n){xA(this,uA),xA(this,hA),xA(this,pA),xA(this,mA,performance.now()),xA(this,fA,""),xA(this,gA,0),xA(this,vA,()=>{const e=(performance.now()-wA(this,mA))/800*360;wA(this,uA).style.transform=`rotate(${e}deg)`,kA(this,gA,requestAnimationFrame(wA(this,vA)))}),kA(this,pA,t);const r=document.createElement("span");r.className=`${CA}-indicator`,r.contentEditable="false",r.setAttribute("role","status"),r.setAttribute("aria-live","polite");const o=document.createElement("span");o.className=`${CA}-spinner`,o.setAttribute("aria-hidden","true"),r.appendChild(o);const i=document.createElement("span");i.className=`${CA}-label`,r.appendChild(i);const a=document.createElement("span");a.className=`${CA}-esc`,a.textContent=n,r.appendChild(a),this.dom=r,kA(this,uA,o),kA(this,hA,i),this.setLabel(e),wA(this,vA).call(this)}setLabel(e){const t=`${e.get(oS.key).label||wA(this,pA)}…`;t!==wA(this,fA)&&(kA(this,fA,t),wA(this,hA).textContent=t)}destroy(){wA(this,gA)&&cancelAnimationFrame(wA(this,gA)),kA(this,gA,0)}}uA=new WeakMap,hA=new WeakMap,pA=new WeakMap,mA=new WeakMap,fA=new WeakMap,gA=new WeakMap,vA=new WeakMap;const AA=["table","image-block","code_block"],MA={heading:["id"]};function TA(e){return"code_block"===e.$from.parent.type.name}function EA(e){var t;const n=null==(t=e.$from.node(e.$from.depth-1))?void 0:t.type;return"list_item"===(null==n?void 0:n.name)}var LA,OA,IA=e=>{throw TypeError(e)},RA=(e,t,n)=>t.has(e)||IA("Cannot "+n),PA=(e,t,n)=>(RA(e,t,"read from private field"),n?n.call(e):t.get(e)),BA=(e,t,n)=>t.has(e)?IA("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);class zA{constructor(){BA(this,LA,[]),this.clear=()=>(((e,t)=>{RA(e,t,"write to private field"),t.set(e,[])})(this,LA),this),BA(this,OA,e=>{const t={group:e,addItem:(n,r)=>{const o={...r,key:n};return e.items.push(o),t},clear:()=>(e.items=[],t)};return t}),this.addGroup=(e,t)=>{const n={key:e,label:t,items:[]};return PA(this,LA).push(n),PA(this,OA).call(this,n)},this.getGroup=e=>{const t=PA(this,LA).find(t=>t.key===e);if(!t)throw new Error(`Group with key ${e} not found`);return PA(this,OA).call(this,t)},this.build=()=>PA(this,LA)}}LA=new WeakMap,OA=new WeakMap;const DA=ml({props:{ctx:{type:Object,required:!0},show:{type:Object,required:!0},filter:{type:Object,required:!0},hide:{type:Function,required:!0},config:{type:Object,required:!1}},setup({ctx:e,show:t,filter:n,hide:r,config:o}){const i=gs(),a=hd(()=>function(e,t,n){var r,o,i,a,s,l,c,d,u,h,p,m,f,v,y,b,w,x,k,C,_,S,A,M,E,L,O,I,R,P,B,z,D,N,q,j,V,F,$,W,U,G,Z,K,Y,Q,ee,te,ne,re,oe,ie,ae,se,le,ce,de,ue,he,pe,me,fe,ge,ve,ye,be,we,xe,ke,Ce,_e,Se,Ae,Me,Te,Ee,Le,Oe,Ie,Re,Pe,Be,ze,De,Ze,Xe,Ke,Ye,Je,Qe,et,tt,nt,rt,ot,it,at,st,lt,ct,dt,ut,ht,pt,mt,ft,gt,vt,yt,bt,wt,xt,kt,Ct,_t,St,At,Mt,Tt;const Et=n&&eS(n).get(),Lt=null==Et?void 0:Et.includes(C_.Latex),Ot=null==Et?void 0:Et.includes(C_.ImageBlock),It=null==Et?void 0:Et.includes(C_.Table),Rt=new zA;if(null!==(null==t?void 0:t.textGroup)){const e=Rt.addGroup("text",null!=(o=null==(r=null==t?void 0:t.textGroup)?void 0:r.label)?o:"Text");null!==(null==(i=null==t?void 0:t.textGroup)?void 0:i.text)&&e.addItem("text",{label:null!=(l=null==(s=null==(a=null==t?void 0:t.textGroup)?void 0:a.text)?void 0:s.label)?l:"Text",icon:null!=(u=null==(d=null==(c=null==t?void 0:t.textGroup)?void 0:c.text)?void 0:d.icon)?u:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_992_5547)">\n <path\n d="M5 5.5C5 6.33 5.67 7 6.5 7H10.5V17.5C10.5 18.33 11.17 19 12 19C12.83 19 13.5 18.33 13.5 17.5V7H17.5C18.33 7 19 6.33 19 5.5C19 4.67 18.33 4 17.5 4H6.5C5.67 4 5 4.67 5 5.5Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_992_5547">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=X.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n})}}),null!==(null==(h=null==t?void 0:t.textGroup)?void 0:h.h1)&&e.addItem("h1",{label:null!=(f=null==(m=null==(p=null==t?void 0:t.textGroup)?void 0:p.h1)?void 0:m.label)?f:"Heading 1",icon:null!=(b=null==(y=null==(v=null==t?void 0:t.textGroup)?void 0:v.h1)?void 0:y.icon)?b:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_992_5553)">\n <path\n d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM12 17H14V7H10V9H12V17Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_992_5553">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=qe.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n,attrs:{level:1}})}}),null!==(null==(w=null==t?void 0:t.textGroup)?void 0:w.h2)&&e.addItem("h2",{label:null!=(C=null==(k=null==(x=null==t?void 0:t.textGroup)?void 0:x.h2)?void 0:k.label)?C:"Heading 2",icon:null!=(A=null==(S=null==(_=null==t?void 0:t.textGroup)?void 0:_.h2)?void 0:S.icon)?A:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_992_5559)">\n <path\n d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15H11V13H13C14.1 13 15 12.11 15 11V9C15 7.89 14.1 7 13 7H9V9H13V11H11C9.9 11 9 11.89 9 13V17H15V15Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_992_5559">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=qe.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n,attrs:{level:2}})}}),null!==(null==(M=null==t?void 0:t.textGroup)?void 0:M.h3)&&e.addItem("h3",{label:null!=(O=null==(L=null==(E=null==t?void 0:t.textGroup)?void 0:E.h3)?void 0:L.label)?O:"Heading 3",icon:null!=(P=null==(R=null==(I=null==t?void 0:t.textGroup)?void 0:I.h3)?void 0:R.icon)?P:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_992_5565)">\n <path\n d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15V13.5C15 12.67 14.33 12 13.5 12C14.33 12 15 11.33 15 10.5V9C15 7.89 14.1 7 13 7H9V9H13V11H11V13H13V15H9V17H13C14.1 17 15 16.11 15 15Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_992_5565">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=qe.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n,attrs:{level:3}})}}),null!==(null==(B=null==t?void 0:t.textGroup)?void 0:B.h4)&&e.addItem("h4",{label:null!=(N=null==(D=null==(z=null==t?void 0:t.textGroup)?void 0:z.h4)?void 0:D.label)?N:"Heading 4",icon:null!=(V=null==(j=null==(q=null==t?void 0:t.textGroup)?void 0:q.h4)?void 0:j.icon)?V:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_7757)">\n <path\n d="M19.04 3H5.04004C3.94004 3 3.04004 3.9 3.04004 5V19C3.04004 20.1 3.94004 21 5.04004 21H19.04C20.14 21 21.04 20.1 21.04 19V5C21.04 3.9 20.14 3 19.04 3ZM19.04 19H5.04004V5H19.04V19ZM13.04 17H15.04V7H13.04V11H11.04V7H9.04004V13H13.04V17Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_7757">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=qe.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n,attrs:{level:4}})}}),null!==(null==(F=null==t?void 0:t.textGroup)?void 0:F.h5)&&e.addItem("h5",{label:null!=(U=null==(W=null==($=null==t?void 0:t.textGroup)?void 0:$.h5)?void 0:W.label)?U:"Heading 5",icon:null!=(K=null==(Z=null==(G=null==t?void 0:t.textGroup)?void 0:G.h5)?void 0:Z.icon)?K:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_7760)">\n <path\n d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15V13C15 11.89 14.1 11 13 11H11V9H15V7H9V13H13V15H9V17H13C14.1 17 15 16.11 15 15Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_7760">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=qe.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n,attrs:{level:5}})}}),null!==(null==(Y=null==t?void 0:t.textGroup)?void 0:Y.h6)&&e.addItem("h6",{label:null!=(te=null==(ee=null==(Q=null==t?void 0:t.textGroup)?void 0:Q.h6)?void 0:ee.label)?te:"Heading 6",icon:null!=(oe=null==(re=null==(ne=null==t?void 0:t.textGroup)?void 0:ne.h6)?void 0:re.icon)?oe:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_7763)">\n <path\n d="M11 17H13C14.1 17 15 16.11 15 15V13C15 11.89 14.1 11 13 11H11V9H15V7H11C9.9 7 9 7.89 9 9V15C9 16.11 9.9 17 11 17ZM11 13H13V15H11V13ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_7763">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=qe.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n,attrs:{level:6}})}}),null!==(null==(ie=null==t?void 0:t.textGroup)?void 0:ie.quote)&&e.addItem("quote",{label:null!=(le=null==(se=null==(ae=null==t?void 0:t.textGroup)?void 0:ae.quote)?void 0:se.label)?le:"Quote",icon:null!=(ue=null==(de=null==(ce=null==t?void 0:t.textGroup)?void 0:ce.quote)?void 0:de.icon)?ue:V_,onRun:e=>{const t=e.get(g),n=je.type(e);t.call(Ne.key),t.call(Ve.key,{nodeType:n})}}),null!==(null==(he=null==t?void 0:t.textGroup)?void 0:he.divider)&&e.addItem("divider",{label:null!=(fe=null==(me=null==(pe=null==t?void 0:t.textGroup)?void 0:pe.divider)?void 0:me.label)?fe:"Divider",icon:null!=(ye=null==(ve=null==(ge=null==t?void 0:t.textGroup)?void 0:ge.divider)?void 0:ve.icon)?ye:R_,onRun:e=>{const t=e.get(g),n=Fe.type(e);t.call(Ne.key),t.call($e.key,{nodeType:n})}})}if(null!==(null==t?void 0:t.listGroup)){const e=Rt.addGroup("list",null!=(we=null==(be=null==t?void 0:t.listGroup)?void 0:be.label)?we:"List");null!==(null==(xe=null==t?void 0:t.listGroup)?void 0:xe.bulletList)&&e.addItem("bullet-list",{label:null!=(_e=null==(Ce=null==(ke=null==t?void 0:t.listGroup)?void 0:ke.bulletList)?void 0:Ce.label)?_e:"Bullet List",icon:null!=(Me=null==(Ae=null==(Se=null==t?void 0:t.listGroup)?void 0:Se.bulletList)?void 0:Ae.icon)?Me:M_,onRun:e=>{const t=e.get(g),n=We.type(e);t.call(Ne.key),t.call(Ve.key,{nodeType:n})}}),null!==(null==(Te=null==t?void 0:t.listGroup)?void 0:Te.orderedList)&&e.addItem("ordered-list",{label:null!=(Oe=null==(Le=null==(Ee=null==t?void 0:t.listGroup)?void 0:Ee.orderedList)?void 0:Le.label)?Oe:"Ordered List",icon:null!=(Pe=null==(Re=null==(Ie=null==t?void 0:t.listGroup)?void 0:Ie.orderedList)?void 0:Re.icon)?Pe:q_,onRun:e=>{const t=e.get(g),n=Ue.type(e);t.call(Ne.key),t.call(Ve.key,{nodeType:n})}}),null!==(null==(Be=null==t?void 0:t.listGroup)?void 0:Be.taskList)&&e.addItem("task-list",{label:null!=(Ze=null==(De=null==(ze=null==t?void 0:t.listGroup)?void 0:ze.taskList)?void 0:De.label)?Ze:"Task List",icon:null!=(Ye=null==(Ke=null==(Xe=null==t?void 0:t.listGroup)?void 0:Xe.taskList)?void 0:Ke.icon)?Ye:G_,onRun:e=>{const t=e.get(g),n=H.type(e);t.call(Ne.key),t.call(Ve.key,{nodeType:n,attrs:{checked:!1}})}})}if(null!==(null==t?void 0:t.advancedGroup)){const e=Rt.addGroup("advanced",null!=(Qe=null==(Je=null==t?void 0:t.advancedGroup)?void 0:Je.label)?Qe:"Advanced");null!==(null==(et=null==t?void 0:t.advancedGroup)?void 0:et.image)&&Ot&&e.addItem("image",{label:null!=(rt=null==(nt=null==(tt=null==t?void 0:t.advancedGroup)?void 0:tt.image)?void 0:nt.label)?rt:"Image",icon:null!=(at=null==(it=null==(ot=null==t?void 0:t.advancedGroup)?void 0:ot.image)?void 0:it.icon)?at:D_,onRun:e=>{const t=e.get(g),n=yu.type(e);t.call(Ne.key),t.call($e.key,{nodeType:n})}}),null!==(null==(st=null==t?void 0:t.advancedGroup)?void 0:st.codeBlock)&&e.addItem("code",{label:null!=(dt=null==(ct=null==(lt=null==t?void 0:t.advancedGroup)?void 0:lt.codeBlock)?void 0:ct.label)?dt:"Code",icon:null!=(pt=null==(ht=null==(ut=null==t?void 0:t.advancedGroup)?void 0:ut.codeBlock)?void 0:ht.icon)?pt:L_,onRun:e=>{const t=e.get(g),n=J.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n})}}),null!==(null==(mt=null==t?void 0:t.advancedGroup)?void 0:mt.table)&&It&&e.addItem("table",{label:null!=(vt=null==(gt=null==(ft=null==t?void 0:t.advancedGroup)?void 0:ft.table)?void 0:gt.label)?vt:"Table",icon:null!=(wt=null==(bt=null==(yt=null==t?void 0:t.advancedGroup)?void 0:yt.table)?void 0:bt.icon)?wt:U_,onRun:e=>{const t=e.get(g),n=e.get(T);t.call(Ne.key);const{from:r}=n.state.selection;t.call($e.key,{nodeType:dp(e,3,3)}),t.call(Ge.key,{pos:r})}}),null!==(null==(xt=null==t?void 0:t.advancedGroup)?void 0:xt.math)&&Lt&&e.addItem("math",{label:null!=(_t=null==(Ct=null==(kt=null==t?void 0:t.advancedGroup)?void 0:kt.math)?void 0:Ct.label)?_t:"Math",icon:null!=(Mt=null==(At=null==(St=null==t?void 0:t.advancedGroup)?void 0:St.math)?void 0:At.icon)?Mt:X_,onRun:e=>{const t=e.get(g),n=J.type(e);t.call(Ne.key),t.call($e.key,{nodeType:n,attrs:{language:"LaTeX"}})}})}null==(Tt=null==t?void 0:t.buildMenu)||Tt.call(t,Rt);let Pt=Rt.build();e&&(Pt=Pt.map(t=>{const n=t.items.filter(t=>t.label.toLowerCase().includes(e.toLowerCase()));return{...t,items:n}}).filter(e=>e.items.length>0));const Bt=Pt.flatMap(e=>e.items);return Bt.forEach((e,t)=>{Object.assign(e,{index:t})}),Pt.reduce((e,t)=>{const n=e+t.items.length;return Object.assign(t,{range:[e,n]}),n},0),{groups:Pt,size:Bt.length}}(n.value,o,e)),s=gs(0),l=gs({x:-999,y:-999}),c=e=>{const{x:t,y:n}=e;l.value={x:t,y:n}};sl([a,t],()=>{const{size:e}=a.value;0===e&&t.value?r():s.value>=e&&(s.value=0)});const d=(e,t)=>{const n=s.value,r="function"==typeof e?e(n):e;null==t||t(r),s.value=r},u=e=>{var t,n;const r=null==(t=i.value)?void 0:t.querySelector(`[data-index="${e}"]`),o=null==(n=i.value)?void 0:n.querySelector(".menu-groups");r&&o&&(o.scrollTop=r.offsetTop-o.offsetTop)},h=t=>{const n=a.value.groups.flatMap(e=>e.items).at(t);(null==n?void 0:n.onRun)&&e&&n.onRun(e),r()},p=e=>{const{size:t,groups:n}=a.value;return"Escape"===e.key?(e.preventDefault(),void(null==r||r())):"ArrowDown"===e.key?(e.preventDefault(),d(e=>e<t-1?e+1:e,u)):"ArrowUp"===e.key?(e.preventDefault(),d(e=>e<=0?e:e-1,u)):"ArrowLeft"===e.key?(e.preventDefault(),d(e=>{const t=n.find(t=>t.range[0]<=e&&t.range[1]>e);if(!t)return e;const r=n[n.indexOf(t)-1];return r?r.range[1]-1:e},u)):"ArrowRight"===e.key?(e.preventDefault(),d(e=>{const t=n.find(t=>t.range[0]<=e&&t.range[1]>e);if(!t)return e;const r=n[n.indexOf(t)+1];return r?r.range[0]:e},u)):void("Enter"===e.key&&(e.preventDefault(),h(s.value)))},m=e=>t=>{const n=l.value;if(!n)return;const{x:r,y:o}=t;r===n.x&&o===n.y||d(e)};return al(()=>{t.value?window.addEventListener("keydown",p,{capture:!0}):window.removeEventListener("keydown",p,{capture:!0})}),Rl(()=>{window.removeEventListener("keydown",p,{capture:!0})}),()=>pd("div",{ref:i,onPointerdown:e=>e.preventDefault()},pd("nav",{class:"tab-group"},pd("ul",null,a.value.groups.map(e=>pd("li",{key:e.key,onPointerdown:()=>d(e.range[0],u),class:s.value>=e.range[0]&&s.value<e.range[1]?"selected":""},e.label)))),pd("div",{class:"menu-groups",onPointermove:c},a.value.groups.map(e=>pd("div",{key:e.key,class:"menu-group"},pd("h6",null,e.label),pd("ul",null,e.items.map(e=>pd("li",{key:e.key,"data-index":e.index,class:s.value===e.index?"hover":"",onPointerenter:m(e.index),onPointerdown:()=>{var t,n;null==(n=null==(t=i.value)?void 0:t.querySelector(`[data-index="${e.index}"]`))||n.classList.add("active")},onPointerup:()=>{var t,n;null==(n=null==(t=i.value)?void 0:t.querySelector(`[data-index="${e.index}"]`))||n.classList.remove("active"),h(e.index)}},pd(jd,{icon:e.icon}),pd("span",null,e.label))))))))}});var NA,HA,qA,jA,VA,FA=e=>{throw TypeError(e)},$A=(e,t,n)=>t.has(e)||FA("Cannot "+n),WA=(e,t,n)=>($A(e,t,"read from private field"),n?n.call(e):t.get(e)),UA=(e,t,n)=>t.has(e)?FA("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),GA=(e,t,n,r)=>($A(e,t,"write to private field"),t.set(e,n),n);const ZA=function(e){const t=a({},`${e}_SLASH_SPEC`),n=s(n=>{const r=n.get(t.key);return new c({key:new d(`${e}_SLASH`),...r})}),r=[t,n];return r.key=t.key,r.pluginKey=n.key,t.meta={package:"@milkdown/plugin-slash",displayName:`Ctx<slashSpec>|${e}`},n.meta={package:"@milkdown/plugin-slash",displayName:`Prose<slash>|${e}`},r}("CREPE_MENU"),XA=a({show:()=>{},hide:()=>{}},"menuAPICtx");class KA{constructor(e,t,n){UA(this,NA),UA(this,HA),UA(this,qA),UA(this,jA),UA(this,VA,null),this.update=e=>{WA(this,jA).update(e)},this.show=e=>{GA(this,VA,e),WA(this,qA).value="",WA(this,jA).show()},this.hide=()=>{GA(this,VA,null),WA(this,jA).hide()},this.destroy=()=>{WA(this,jA).destroy(),WA(this,HA).unmount(),WA(this,NA).remove()};const r=document.createElement("div");r.classList.add("milkdown-slash-menu");const o=gs(!1),i=gs("");GA(this,qA,i);const a=this.hide,s=qd(DA,{ctx:e,config:n,show:o,filter:i,hide:a});GA(this,HA,s),s.mount(r),GA(this,NA,r);const l=this;GA(this,jA,new Jd({content:WA(this,NA),debounce:20,shouldShow(e){if(TA(e.state.selection)||EA(e.state.selection))return!1;const t=this.getContent(e,e=>["paragraph","heading"].includes(e.type.name));if(null==t)return!1;if(!function(e){if(!(e instanceof S))return!1;const{$head:t}=e,n=t.parent;return t.parentOffset===n.content.size}(e.state.selection))return!1;const n=WA(l,VA);if(i.value=t.startsWith("/")?t.slice(1):t,"number"==typeof n){const t=e.state.doc.nodeSize-2,r=Math.min(n,t);return e.state.doc.resolve(r).node()===e.state.doc.resolve(e.state.selection.from).node()||(GA(l,VA,null),!1)}return!!t.startsWith("/")},offset:10})),WA(this,jA).onShow=()=>{o.value=!0},WA(this,jA).onHide=()=>{o.value=!1},this.update(t),e.set(XA.key,{show:e=>this.show(e),hide:()=>this.hide()})}}NA=new WeakMap,HA=new WeakMap,qA=new WeakMap,jA=new WeakMap,VA=new WeakMap;const YA=ml({props:{onAdd:{type:Function,required:!0},addIcon:{type:String,required:!0},handleIcon:{type:String,required:!0}},setup(e){const t=gs();return()=>pd(Dc,null,pd("div",{ref:t,class:"operation-item",onPointerdown:e=>{var n;e.preventDefault(),e.stopPropagation(),null==(n=t.value)||n.classList.add("active")},onPointerup:n=>{var r;n.preventDefault(),n.stopPropagation(),null==(r=t.value)||r.classList.remove("active"),e.onAdd()}},pd(jd,{icon:e.addIcon})),pd("div",{class:"operation-item"},pd(jd,{icon:e.handleIcon})))}});var JA,QA,eM,tM,nM=e=>{throw TypeError(e)},rM=(e,t,n)=>t.has(e)||nM("Cannot "+n),oM=(e,t,n)=>(rM(e,t,"read from private field"),n?n.call(e):t.get(e)),iM=(e,t,n)=>t.has(e)?nM("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),aM=(e,t,n,r)=>(rM(e,t,"write to private field"),t.set(e,n),n);class sM{constructor(e,t){var n,r,o;iM(this,JA),iM(this,QA),iM(this,eM),iM(this,tM),this.update=()=>{oM(this,QA).update()},this.destroy=()=>{oM(this,QA).destroy(),oM(this,JA).remove(),oM(this,eM).unmount()},this.onAdd=()=>{const e=oM(this,tM),t=e.get(T);t.hasFocus()||t.focus();const{state:n,dispatch:r}=t,o=oM(this,QA).active;if(!o)return;const i=o.$pos.pos+o.node.nodeSize;let a=n.tr.insert(i,X.type(e).create());a=a.setSelection(S.near(a.doc.resolve(i))),r(a.scrollIntoView()),oM(this,QA).hide(),e.get(XA.key).show(a.selection.from)},aM(this,tM,e);const i=document.createElement("div");i.classList.add("milkdown-block-handle");const a=qd(YA,{onAdd:this.onAdd,addIcon:null!=(n=null==t?void 0:t.handleAddIcon)?n:j_,handleIcon:null!=(r=null==t?void 0:t.handleDragIcon)?r:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_971_7680)">\n <path\n d="M11 18C11 19.1 10.1 20 9 20C7.9 20 7 19.1 7 18C7 16.9 7.9 16 9 16C10.1 16 11 16.9 11 18ZM9 10C7.9 10 7 10.9 7 12C7 13.1 7.9 14 9 14C10.1 14 11 13.1 11 12C11 10.9 10.1 10 9 10ZM9 4C7.9 4 7 4.9 7 6C7 7.1 7.9 8 9 8C10.1 8 11 7.1 11 6C11 4.9 10.1 4 9 4ZM15 8C16.1 8 17 7.1 17 6C17 4.9 16.1 4 15 4C13.9 4 13 4.9 13 6C13 7.1 13.9 8 15 8ZM15 10C13.9 10 13 10.9 13 12C13 13.1 13.9 14 15 14C16.1 14 17 13.1 17 12C17 10.9 16.1 10 15 10ZM15 16C13.9 16 13 16.9 13 18C13 19.1 13.9 20 15 20C16.1 20 17 19.1 17 18C17 16.9 16.1 16 15 16Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_971_7680">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n'});a.mount(i),aM(this,eM,a),aM(this,JA,i);const s=null!=(o=null==t?void 0:t.blockHandle)?o:{};aM(this,QA,new Kd({ctx:e,content:i,getOffset:()=>16,getPlacement:({active:e,blockDom:t})=>{if("heading"===e.node.type.name)return"left";let n=0;e.node.descendants(e=>{n+=e.childCount});const r=e.el,o=r.getBoundingClientRect(),i=t.getBoundingClientRect(),a=window.getComputedStyle(r),s=Number.parseInt(a.paddingTop,10)||0,l=Number.parseInt(a.paddingBottom,10)||0,c=o.height-s-l,d=i.height;return n>2||d<c?"left-start":"left"},...s})),this.update()}}JA=new WeakMap,QA=new WeakMap,eM=new WeakMap,tM=new WeakMap;const lM=J.extendSchema(e=>t=>{const n=e(t);return{...n,toMarkdown:{match:n.toMarkdown.match,runner:(e,t)=>{var r,o;if("latex"!==(null!=(r=t.attrs.language)?r:"").toLowerCase())return n.toMarkdown.runner(e,t);e.addNode("math",void 0,(null==(o=t.content.firstChild)?void 0:o.text)||"")}}}}),cM="math_inline",dM=I(cM,()=>({group:"inline",inline:!0,draggable:!0,atom:!0,attrs:{value:{default:""}},parseDOM:[{tag:`span[data-type="${cM}"]`,getAttrs:e=>{var t;return{value:null!=(t=e.dataset.value)?t:""}}}],toDOM:e=>{const t=e.attrs.value,n=document.createElement("span");return n.dataset.type=cM,n.dataset.value=t,Nx.render(t,n,{throwOnError:!1}),n},parseMarkdown:{match:e=>"inlineMath"===e.type,runner:(e,t,n)=>{e.addNode(n,{value:t.value})}},toMarkdown:{match:e=>e.type.name===cM,runner:(e,t)=>{e.addNode("inlineMath",void 0,t.attrs.value)}}})),uM=l("ToggleLatex",e=>()=>(t,n)=>{const{hasNode:r,pos:o,target:i}=Oe(t,dM.type(e)),{selection:a,doc:s,tr:l}=t;if(!r){const t=s.textBetween(a.from,a.to);let r=l.replaceSelectionWith(dM.type(e).create({value:t}));return n&&n(r.setSelection(M.create(r.doc,a.from))),!0}const{from:c,to:d}=a;if(!i||o<0)return!1;let u=l.delete(o,o+1);const h=i.attrs.value;return u=u.insertText(h,o),n&&n(u.setSelection(S.create(u.doc,c,d+h.length-1))),!0}),hM=oi("INLINE_LATEX"),pM=ml({props:{config:{type:Object,required:!0},innerView:{type:Object,required:!0},updateValue:{type:Object,required:!0}},setup(e){const t=t=>{if(t&&t instanceof HTMLElement){for(;t.firstChild;)t.removeChild(t.firstChild);e.innerView.value&&t.appendChild(e.innerView.value.dom)}},n=t=>{t.preventDefault(),e.updateValue.value()};return()=>pd("div",{class:"container"},e.innerView&&pd("div",{ref:t}),pd("button",{type:"button",onPointerdown:n},pd(jd,{icon:e.config.inlineEditConfirm})))}});var mM,fM,gM,vM,yM,bM,wM,xM,kM=e=>{throw TypeError(e)},CM=(e,t,n)=>t.has(e)||kM("Cannot "+n),_M=(e,t,n)=>(CM(e,t,"read from private field"),n?n.call(e):t.get(e)),SM=(e,t,n)=>t.has(e)?kM("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),AM=(e,t,n,r)=>(CM(e,t,"write to private field"),t.set(e,n),n);class MM{constructor(e,t,n){this.ctx=e,SM(this,mM),SM(this,fM),SM(this,gM),SM(this,vM,vs(null)),SM(this,yM,vs(()=>{})),SM(this,bM),SM(this,wM,()=>{_M(this,vM).value&&(_M(this,vM).value.destroy(),_M(this,vM).value=null)}),SM(this,xM,e=>{const t=(()=>{if(!e.editable)return!1;const{selection:t,schema:n}=e.state;if(t.empty)return!1;if(!(t instanceof M))return!1;const r=t.node;if(r.type.name!==cM)return!1;const o=t.from,i=n.nodes.paragraph.create(null,n.text(r.attrs.value)),a=new Re(_M(this,gM),{state:Pe.create({doc:i,schema:new ze({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:()=>["p",0]},text:{group:"inline"}}}),plugins:[Be({"Mod-z":Q,"Mod-Z":ee,"Mod-y":ee,Enter:()=>(_M(this,yM).value(),!0)})]})});return _M(this,vM).value=a,_M(this,yM).value=()=>{const{tr:t}=e.state;t.setNodeAttribute(o,"value",a.state.doc.textContent),e.dispatch(t),requestAnimationFrame(()=>{e.focus()})},!0})();return t||_M(this,wM).call(this),t}),this.update=(e,t)=>{_M(this,fM).update(e,t)},this.destroy=()=>{_M(this,bM).unmount(),_M(this,fM).destroy(),_M(this,mM).remove()};const r=document.createElement("div");r.className="milkdown-latex-inline-edit",AM(this,mM,r),AM(this,bM,qd(pM,{config:n,innerView:_M(this,vM),updateValue:_M(this,yM)})),_M(this,bM).mount(r),AM(this,fM,new ri({debounce:0,content:_M(this,mM),shouldShow:_M(this,xM),offset:10,floatingUIOptions:{placement:"bottom"}})),_M(this,fM).update(t),AM(this,gM,document.createElement("div"))}}mM=new WeakMap,fM=new WeakMap,gM=new WeakMap,vM=new WeakMap,yM=new WeakMap,bM=new WeakMap,wM=new WeakMap,xM=new WeakMap;const TM=V(e=>Ee(/(?:\$)([^$]+)(?:\$)$/,dM.type(e),{getAttr:e=>{var t;return{value:null!=(t=e[1])?t:""}}})),EM=V(e=>Le(/^\$\$[\s\n]$/,J.type(e),()=>({language:"LaTeX"}))),LM=O("remarkMath",()=>Te);function OM(e){return Et(e,"math",(e,t,n)=>{const{value:r}=e,o={type:"code",lang:"LaTeX",value:r};n.children.splice(t,1,o)})}const IM=O("remarkMathBlock",()=>()=>OM),RM=a({text:"Please enter...",mode:"block"},"placeholderConfigCtx"),PM=s(e=>new c({key:new d("CREPE_PLACEHOLDER"),props:{decorations:t=>{var n;const r=function(e){return e.get("CrepeCtx")}(e);if(r.readonly)return null;const o=e.get(RM.key);if("doc"===o.mode&&!function(e){var t;return e.childCount<=1&&!(null==(t=e.firstChild)?void 0:t.content.size)}(t.doc))return null;if(TA(t.selection)||EA(t.selection))return null;const i=function(e,t){const{selection:n}=e;if(!n.empty)return null;const r=n.$anchor,o=r.parent;if(o.content.size>0)return null;if(A(e=>"table"===e.type.name)(r))return null;const i=r.before();return v.node(i,i+o.nodeSize,{class:"crepe-placeholder","data-placeholder":t})}(t,null!=(n=o.text)?n:"Please enter...");return i?f.create(t.doc,[i]):null}}})),BM=ml({props:{ctx:{type:Object,required:!0},hide:{type:Function,required:!0},show:{type:Object,required:!0},selection:{type:Object,required:!0},config:{type:Object,required:!1}},setup(e){const{ctx:t,config:n}=e,r=e=>n=>{n.preventDefault(),t&&(null==e||e(t))};function o(n){return e.selection.value,t.get(De).status===xe.Created&&n(t)}const i=hd(()=>function(e,t){var n,r,o,i,a,s,l,c,d;const u=new zA;u.addGroup("formatting","Formatting").addItem("bold",{icon:null!=(n=null==e?void 0:e.boldIcon)?n:A_,active:e=>e.get(g).call(Xe.key,Ke.type(e)),onRun:e=>{e.get(g).call(Ze.key)}}).addItem("italic",{icon:null!=(r=null==e?void 0:e.italicIcon)?r:N_,active:e=>e.get(g).call(Xe.key,Je.type(e)),onRun:e=>{e.get(g).call(Ye.key)}}).addItem("strikethrough",{icon:null!=(o=null==e?void 0:e.strikethroughIcon)?o:W_,active:e=>e.get(g).call(Xe.key,ep.type(e)),onRun:e=>{e.get(g).call(tp.key)}});const h=u.addGroup("function","Function");h.addItem("code",{icon:null!=(i=null==e?void 0:e.codeIcon)?i:L_,active:e=>e.get(g).call(Xe.key,et.type(e)),onRun:e=>{e.get(g).call(Qe.key)}});const p=t&&eS(t).get();if((null==p?void 0:p.includes(C_.Latex))&&h.addItem("latex",{icon:null!=(a=null==e?void 0:e.latexIcon)?a:X_,active:e=>{const t=e.get(g),n=e.get(ae).nodes[cM];return t.call(tt.key,n)},onRun:e=>{e.get(g).call("ToggleLatex")}}),h.addItem("link",{icon:null!=(s=null==e?void 0:e.linkIcon)?s:H_,active:e=>e.get(g).call(Xe.key,oe.type(e)),onRun:e=>{e.get(g).call(tk.key)}}),t&&(null==p?void 0:p.includes(C_.AI))){const n=t.get(rS.key);n.provider&&h.addItem("ai",{icon:null!=(c=null!=(l=null==e?void 0:e.aiIcon)?l:n.aiIcon)?c:S_,active:()=>!1,onRun:e=>{const t=e.get(lA.key),n=e.get(T),{from:r,to:o}=n.state.selection;t.show(r,o)}})}return null==(d=null==e?void 0:e.buildToolbar)||d.call(e,u),u.build()}(n,t));return()=>pd(Dc,null,i.value.map(e=>e.items.map(e=>pd("button",{type:"button",class:Ln("toolbar-item",t&&o(e.active)&&"active"),onPointerdown:r(e.onRun)},pd(jd,{icon:e.icon})))).reduce((e,t,n)=>(0===n?e.push(...t):e.push(pd("div",{class:"divider"}),...t),e),[]))}});var zM,DM,NM,HM,qM,jM=e=>{throw TypeError(e)},VM=(e,t,n)=>t.has(e)||jM("Cannot "+n),FM=(e,t,n)=>(VM(e,t,"read from private field"),n?n.call(e):t.get(e)),$M=(e,t,n)=>t.has(e)?jM("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),WM=(e,t,n,r)=>(VM(e,t,"write to private field"),t.set(e,n),n);const UM=oi("CREPE_TOOLBAR");class GM{constructor(e,t,n){$M(this,zM),$M(this,DM),$M(this,NM),$M(this,HM),$M(this,qM,gs(!1)),this.update=(e,t)=>{FM(this,zM).update(e,t),FM(this,HM).value=e.state.selection},this.destroy=()=>{FM(this,zM).destroy(),FM(this,NM).unmount(),FM(this,DM).remove()},this.hide=()=>{FM(this,zM).hide()};const r=document.createElement("div");r.className="milkdown-toolbar",WM(this,HM,vs(t.state.selection));const o=qd(BM,{ctx:e,hide:this.hide,config:n,selection:FM(this,HM),show:FM(this,qM)});o.mount(r),WM(this,DM,r),WM(this,NM,o),WM(this,zM,new ri({content:FM(this,DM),debounce:20,offset:10,shouldShow(e){const{doc:t,selection:n}=e.state,{empty:o,from:i,to:a}=n,s=!t.textBetween(i,a).length&&n instanceof S,l=!(n instanceof S),c=e.dom.getRootNode().activeElement,d=r.contains(c),u=!e.hasFocus()&&!d,h=!e.editable;return!(u||l||o||s||h)}})),FM(this,zM).onShow=()=>{FM(this,qM).value=!0},FM(this,zM).onHide=()=>{FM(this,qM).value=!1},this.update(t)}}zM=new WeakMap,DM=new WeakMap,NM=new WeakMap,HM=new WeakMap,qM=new WeakMap;const ZM=[{label:"Paragraph",level:null},{label:"Heading 1",level:1},{label:"Heading 2",level:2},{label:"Heading 3",level:3},{label:"Heading 4",level:4},{label:"Heading 5",level:5},{label:"Heading 6",level:6}];function XM(e,t){if(e.get(g).call(Xe.key,t))return!0;const n=e.get(T),{state:r}=n;if(r.storedMarks)return r.storedMarks.some(e=>e.type===t);if(r.selection instanceof S){const{$cursor:e}=r.selection;if(e)return e.marks().some(e=>e.type===t)}return!1}function KM(e,t){const n=null!=e?e:ZM;return{icon:"",active:()=>!1,selector:{chevronIcon:null!=t?t:T_,activeLabel:e=>function(e,t){var n,r;const o=null!=t?t:ZM,i=e.get(T),{$from:a}=i.state.selection,s=a.parent,l=null!=(n=o.find(e=>null===e.level))?n:o[0];if(s.type===qe.type(e)){const e=s.attrs.level;return null!=(r=o.find(t=>t.level===e))?r:l}return l}(e,n).label,options:n.map(e=>({label:e.label,onSelect:t=>function(e,t){const n=e.get(g);if(null==t){const t=X.type(e);n.call(He.key,{nodeType:t})}else{const r=qe.type(e);n.call(He.key,{nodeType:r,attrs:{level:t}})}}(t,e.level)}))}}}const YM=ml({props:{ctx:{type:Object,required:!0},version:{type:Object,required:!0},config:{type:Object,required:!1}},setup(e){const{ctx:t,config:n}=e,r=gs(null),o=e=>n=>{n.preventDefault(),t&&e(t)};function i(){return t.get(De).status===xe.Created}function a(){e.version.value}function s(e){return a(),!!i()&&e(t)}const l=e=>{e.target.closest(".top-bar-heading-selector")||(r.value=null)};El(()=>{window.addEventListener("pointerdown",l)}),Rl(()=>{window.removeEventListener("pointerdown",l)});const c=hd(()=>function(e,t){var n,r,o,i,a,s,l,c,d,u,h,p,m,f,v;const y=t&&eS(t).get(),b=null==y?void 0:y.includes(C_.Latex),w=null==y?void 0:y.includes(C_.ImageBlock),x=null==y?void 0:y.includes(C_.Table),k=new zA;k.addGroup("heading","Heading").addItem("heading-selector",{...KM(null==e?void 0:e.headingOptions,null==e?void 0:e.chevronDownIcon)}),k.addGroup("formatting","Formatting").addItem("bold",{icon:null!=(n=null==e?void 0:e.boldIcon)?n:A_,active:e=>XM(e,Ke.type(e)),onRun:e=>{e.get(g).call(Ze.key)}}).addItem("italic",{icon:null!=(r=null==e?void 0:e.italicIcon)?r:N_,active:e=>XM(e,Je.type(e)),onRun:e=>{e.get(g).call(Ye.key)}}).addItem("strikethrough",{icon:null!=(o=null==e?void 0:e.strikethroughIcon)?o:W_,active:e=>XM(e,ep.type(e)),onRun:e=>{e.get(g).call(tp.key)}}).addItem("code",{icon:null!=(i=null==e?void 0:e.codeIcon)?i:L_,active:e=>XM(e,et.type(e)),onRun:e=>{const t=e.get(T),{state:n}=t;if(n.selection.empty){const r=et.type(e);XM(e,r)?t.dispatch(n.tr.removeStoredMark(r)):t.dispatch(n.tr.addStoredMark(r.create()))}else e.get(g).call(Qe.key)}}),k.addGroup("list","List").addItem("bullet-list",{icon:null!=(a=null==e?void 0:e.bulletListIcon)?a:M_,active:()=>!1,onRun:e=>{const t=e.get(g),n=We.type(e);t.call(Ve.key,{nodeType:n})}}).addItem("ordered-list",{icon:null!=(s=null==e?void 0:e.orderedListIcon)?s:q_,active:()=>!1,onRun:e=>{const t=e.get(g),n=Ue.type(e);t.call(Ve.key,{nodeType:n})}}).addItem("task-list",{icon:null!=(l=null==e?void 0:e.taskListIcon)?l:G_,active:()=>!1,onRun:e=>{const t=e.get(g),n=H.type(e);t.call(Ve.key,{nodeType:n,attrs:{checked:!1}})}});const C=k.addGroup("insert","Insert");C.addItem("link",{icon:null!=(c=null==e?void 0:e.linkIcon)?c:H_,active:e=>XM(e,oe.type(e)),onRun:e=>{const t=e.get(T),{state:n}=t,r=oe.type(e);n.selection.empty&&XM(e,r)?t.dispatch(n.tr.removeStoredMark(r)):e.get(g).call(tk.key)}}),w&&C.addItem("image",{icon:null!=(d=null==e?void 0:e.imageIcon)?d:D_,active:()=>!1,onRun:e=>{const t=e.get(g),n=yu.type(e);t.call($e.key,{nodeType:n})}}),x&&C.addItem("table",{icon:null!=(u=null==e?void 0:e.tableIcon)?u:U_,active:()=>!1,onRun:e=>{const t=e.get(g),n=e.get(T),{from:r}=n.state.selection;t.call($e.key,{nodeType:dp(e,3,3)}),t.call(Ge.key,{pos:r})}});const _=k.addGroup("block","Block");return _.addItem("code-block",{icon:null!=(h=null==e?void 0:e.codeBlockIcon)?h:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm1 2v14h16V5H4zm8 10h6v2h-6v-2zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243-1.415-1.415L8.667 12z"\n />\n </svg>\n',active:()=>!1,onRun:e=>{const t=e.get(g),n=J.type(e);t.call(He.key,{nodeType:n})}}),b&&_.addItem("math",{icon:null!=(p=null==e?void 0:e.mathIcon)?p:X_,active:()=>!1,onRun:e=>{const t=e.get(g),n=J.type(e);t.call($e.key,{nodeType:n,attrs:{language:"LaTeX"}})}}),k.addGroup("more","More").addItem("quote",{icon:null!=(m=null==e?void 0:e.quoteIcon)?m:V_,active:()=>!1,onRun:e=>{const t=e.get(g),n=je.type(e);t.call(Ve.key,{nodeType:n})}}).addItem("hr",{icon:null!=(f=null==e?void 0:e.hrIcon)?f:R_,active:()=>!1,onRun:e=>{const t=e.get(g),n=Fe.type(e);t.call($e.key,{nodeType:n})}}),null==(v=null==e?void 0:e.buildTopBar)||v.call(e,k),k.build()}(n,t));return()=>{const e=i()?t.get(T):null;return e&&!e.editable?null:pd("div",{class:"top-bar-inner"},c.value.map(e=>e.items.map(e=>e.selector?function(e,n){const o=r.value===e,s=function(e){var n,r;return a(),i()?e.activeLabel(t):null!=(r=null==(n=e.options[0])?void 0:n.label)?r:""}(n);return pd("div",{key:e,class:"top-bar-heading-selector"},pd("button",{type:"button",class:"top-bar-heading-button",onPointerdown:t=>function(e,t){t.preventDefault(),t.stopPropagation(),r.value=r.value===e?null:e}(e,t)},pd("span",{class:"top-bar-heading-label"},s),n.chevronIcon&&pd("span",{class:"top-bar-chevron"},pd(jd,{icon:n.chevronIcon}))),o&&pd("div",{class:"top-bar-heading-dropdown"},n.options.map((n,o)=>pd("button",{key:`${e}-${o}`,type:"button",class:Ln("top-bar-heading-option",s===n.label&&"active"),onPointerdown:e=>{e.preventDefault(),e.stopPropagation(),r.value=null,n.onSelect(t)}},n.label))))}(e.key,e.selector):e.onRun?function(e){return pd("button",{key:e.key,type:"button",class:Ln("top-bar-item",s(e.active)&&"active"),onPointerdown:o(e.onRun)},pd(jd,{icon:e.icon}))}(e):null)).reduce((e,t,n)=>{var r,o;if(0===n)e.push(...t);else{const i=null!=(o=null==(r=c.value[n])?void 0:r.key)?o:n;e.push(pd("div",{key:`divider-${i}`,class:"top-bar-divider"}),...t)}return e},[]))}}});var JM,QM,eT,tT=e=>{throw TypeError(e)},nT=(e,t,n)=>t.has(e)||tT("Cannot "+n),rT=(e,t,n)=>(nT(e,t,"read from private field"),n?n.call(e):t.get(e)),oT=(e,t,n)=>t.has(e)?tT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),iT=(e,t,n,r)=>(nT(e,t,"write to private field"),t.set(e,n),n);const aT=new d("CREPE_TOP_BAR");class sT{constructor(e,t,n){oT(this,JM),oT(this,QM),oT(this,eT),this.update=(e,t)=>{rT(this,JM).style.display=e.editable?"":"none",rT(this,eT).value++},this.destroy=()=>{rT(this,QM).unmount(),rT(this,JM).remove()},iT(this,eT,gs(0));const r=document.createElement("div");r.className="milkdown-top-bar";const o=qd(YM,{ctx:e,config:n,version:rT(this,eT)});o.mount(r),iT(this,JM,r),iT(this,QM,o);const i=t.dom.parentElement;i&&i.insertBefore(r,i.firstChild),this.update(t)}}JM=new WeakMap,QM=new WeakMap,eT=new WeakMap;const lT=a({view:()=>({update:()=>{},destroy:()=>{}})},"topBarConfig"),cT=s(e=>{const t=e.get(lT.key);return new c({key:aT,view:t.view})});var dT,uT,hT,pT=e=>{throw TypeError(e)},mT=(e,t,n)=>t.has(e)||pT("Cannot "+n),fT=(e,t,n)=>(mT(e,t,"read from private field"),n?n.call(e):t.get(e)),gT=(e,t,n)=>t.has(e)?pT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),vT=(e,t,n,r)=>(mT(e,t,"write to private field"),t.set(e,n),n);class yT{constructor({root:e,defaultValue:t=""}={}){var n;gT(this,dT),gT(this,uT),gT(this,hT,!0),this.addFeature=(e,t)=>(e(fT(this,dT),t),this),this.create=()=>fT(this,dT).create(),this.destroy=()=>fT(this,dT).destroy(),this.setReadonly=e=>(vT(this,hT,!e),fT(this,dT).action(t=>{fT(this,dT).status===xe.Created&&t.get(T).setProps({editable:()=>!e})}),this),this.getMarkdown=()=>fT(this,dT).action(ke()),this.on=e=>fT(this,dT).status!==xe.Created?(fT(this,dT).config(t=>{const n=t.get(m_);e(n)}),this):(fT(this,dT).action(t=>{const n=t.get(m_);e(n)}),this),vT(this,uT,null!=(n="string"==typeof e?document.querySelector(e):e)?n:document.body),vT(this,dT,Ce.make().config(e=>{e.inject(Q_,this),e.inject(J_,[])}).config(e=>{e.set(_e,fT(this,uT)),e.set(Se,t),e.set(se,{editable:()=>fT(this,hT)}),e.update(d_.key,e=>({...e,size:4})),e.update(w_.key,e=>({...e,uploader:async(e,t,n)=>{const r=eS(n).get().includes(C_.ImageBlock),o=r?t.nodes["image-block"]:t.nodes.image;if(!o)return[];const i=r?n.get(lu.key).onUpload:void 0,a=[];for(let s=0;s<e.length;s++){const t=e.item(s);t&&t.type.includes("image")&&a.push(t)}return await Promise.all(a.map(async e=>{const t=i?await i(e):URL.createObjectURL(e);return o.createAndFill({src:t})}))}}))}).use(Ae).use(g_).use(c_).use(h_).use(b_).use(n_).use(k_).use(Kp))}get editor(){return fT(this,dT)}get readonly(){return!fT(this,hT)}}dT=new WeakMap,uT=new WeakMap,hT=new WeakMap;class bT extends yT{constructor({features:e={},featureConfigs:t={},...n}={}){super(n);const r=fr(t,Y_);Object.entries({...__,...e}).filter(([,e])=>e).map(([e])=>e).forEach(e=>{const t=r[e];!function(e,t,n){switch(e){case C_.CodeMirror:return((e,t={})=>{e.config(tS(C_.CodeMirror)).config(e=>{const{languages:n=[],theme:r}=t,o=[Ht.of(xn.concat(_n)),Ff];r&&o.push(r),t.extensions&&o.push(...t.extensions),e.update(om.key,e=>{var r;return{extensions:o,languages:n,expandIcon:t.expandIcon||T_,searchIcon:t.searchIcon||$_,clearSearchIcon:t.clearSearchIcon||E_,searchPlaceholder:t.searchPlaceholder||"Search language",copyText:t.copyText||"Copy",copyIcon:t.copyIcon||I_,onCopy:t.onCopy||(()=>{}),noResultText:t.noResultText||"No result",renderLanguage:t.renderLanguage||e.renderLanguage,renderPreview:t.renderPreview||e.renderPreview,previewToggleButton:e=>{var n,r;return[(null==(n=t.previewToggleIcon)?void 0:n.call(t,e))||(e?B_:K_),(null==(r=t.previewToggleText)?void 0:r.call(t,e))||(e?"Edit":"Hide")].map(e=>e.trim()).join(" ")},previewLabel:t.previewLabel||e.previewLabel,previewLoading:t.previewLoading||e.previewLoading,previewOnlyByDefault:null!=(r=t.previewOnlyByDefault)?r:e.previewOnlyByDefault}})}).use(ym)})(t,n);case C_.ListItem:return((e,t)=>{e.config(tS(C_.ListItem)).config(e=>function(e,t){e.set(vC.key,{renderLabel:({label:e,listType:n,checked:r})=>{var o,i,a;return null==r?"bullet"===n?null!=(o=null==t?void 0:t.bulletIcon)?o:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_952_6527)">\n <circle cx="12" cy="12" r="3" />\n </g>\n <defs>\n <clipPath id="clip0_952_6527">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n':e:r?null!=(i=null==t?void 0:t.checkBoxCheckedIcon)?i:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_1803_1151)">\n <path\n d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM10.71 16.29C10.32 16.68 9.69 16.68 9.3 16.29L5.71 12.7C5.32 12.31 5.32 11.68 5.71 11.29C6.1 10.9 6.73 10.9 7.12 11.29L10 14.17L16.88 7.29C17.27 6.9 17.9 6.9 18.29 7.29C18.68 7.68 18.68 8.31 18.29 8.7L10.71 16.29Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_1803_1151">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n':null!=(a=null==t?void 0:t.checkBoxUncheckedIcon)?a:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_1803_535)">\n <path\n d="M18 19H6C5.45 19 5 18.55 5 18V6C5 5.45 5.45 5 6 5H18C18.55 5 19 5.45 19 6V18C19 18.55 18.55 19 18 19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_1803_535">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n'}})}(e,t)).use(xC)})(t,n);case C_.LinkTooltip:return((e,t)=>{e.config(tS(C_.LinkTooltip)).config(lC).config(e=>{e.update(ek.key,e=>{var n,r,o,i,a,s;return{...e,linkIcon:null!=(n=null==t?void 0:t.linkIcon)?n:I_,editButton:null!=(r=null==t?void 0:t.editButton)?r:B_,removeButton:null!=(o=null==t?void 0:t.removeButton)?o:F_,confirmButton:null!=(i=null==t?void 0:t.confirmButton)?i:O_,inputPlaceholder:null!=(a=null==t?void 0:t.inputPlaceholder)?a:"Paste link...",onCopyLink:null!=(s=null==t?void 0:t.onCopyLink)?s:()=>{}}})}).use(cC)})(t,n);case C_.ImageBlock:return((e,t)=>{e.config(tS(C_.ImageBlock)).config(e=>{e.update(bg.key,e=>{var n,r,o,i,a,s;return{uploadButton:null!=(n=null==t?void 0:t.inlineUploadButton)?n:"Upload",imageIcon:null!=(r=null==t?void 0:t.inlineImageIcon)?r:D_,confirmButton:null!=(o=null==t?void 0:t.inlineConfirmButton)?o:O_,uploadPlaceholderText:null!=(i=null==t?void 0:t.inlineUploadPlaceholderText)?i:"or paste link",onUpload:null!=(s=null!=(a=null==t?void 0:t.inlineOnUpload)?a:null==t?void 0:t.onUpload)?s:e.onUpload,proxyDomURL:null==t?void 0:t.proxyDomURL}}),e.update(lu.key,e=>{var n,r,o,i,a,s,l,c,d;return{uploadButton:null!=(n=null==t?void 0:t.blockUploadButton)?n:"Upload file",imageIcon:null!=(r=null==t?void 0:t.blockImageIcon)?r:D_,captionIcon:null!=(o=null==t?void 0:t.blockCaptionIcon)?o:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="32"\n height="32"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M9 22a1 1 0 0 1-1-1v-3H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6.1l-3.7 3.71c-.2.19-.45.29-.7.29zm1-6v3.08L13.08 16H20V4H4v12z"\n />\n </svg>\n',confirmButton:null!=(i=null==t?void 0:t.blockConfirmButton)?i:"Confirm",captionPlaceholderText:null!=(a=null==t?void 0:t.blockCaptionPlaceholderText)?a:"Write Image Caption",uploadPlaceholderText:null!=(s=null==t?void 0:t.blockUploadPlaceholderText)?s:"or paste link",onUpload:null!=(c=null!=(l=null==t?void 0:t.blockOnUpload)?l:null==t?void 0:t.onUpload)?c:e.onUpload,proxyDomURL:null==t?void 0:t.proxyDomURL,onImageLoadError:null!=(d=null==t?void 0:t.onImageLoadError)?d:e.onImageLoadError,maxWidth:null==t?void 0:t.maxWidth,maxHeight:null==t?void 0:t.maxHeight}})}).use(Lu).use(Sg)})(t,n);case C_.Cursor:return((e,t)=>{if(e.config(tS(C_.Cursor)).config(e=>{e.update(rg.key,()=>{var e,n;return{class:"crepe-drop-cursor",width:null!=(e=null==t?void 0:t.width)?e:4,color:null!=(n=null==t?void 0:t.color)&&n}})}).use(lg),!1===(null==t?void 0:t.virtual))return;const n=function(){let e="undefined"==typeof document?null:document.createElement("div");return new c({key:cg,view:t=>{!function(e,t){for(const[n,r]of Object.entries(e.marks))!1!==r.spec.inclusive||t.includes(n)||console.warn(`[prosemirror-virtual-cursor] Virtual cursor does not work well with marks that have inclusive set to false. Please consider removing the inclusive option from the "${n}" mark or adding it to the "skipWarning" option.`)}(t.state.schema,[]);const n=t.dom.ownerDocument;e=e||document.createElement("div");const r=e,o=()=>{!function(e,t){if(!e||!e.dom||e.isDestroyed||!t)return;const{state:n,dom:r}=e,{selection:o}=n;if(!ug(o))return;const i=function(e,t){var n;const r=window.getSelection();if(!r||!r.rangeCount)return null;const o=null==(n=null==r?void 0:r.getRangeAt(0))?void 0:n.cloneRange();if(!o)return null;o.collapse(t);const i=o.getClientRects(),a=(null==i?void 0:i.length)?i[i.length-1]:null;return(null==a?void 0:a.height)?a:e.coordsAtPos(e.state.selection.head)}(e,o.$head===o.$from);if(!i)return t;const a=r.getBoundingClientRect();let s="prosemirror-virtual-cursor";const l=n.selection.$head,[c,d]=dg(l),u=n.storedMarks||l.marks();o.$cursor&&c&&d&&u&&!ne.sameSet(c,d)&&(ne.sameSet(c,u)?s+=" prosemirror-virtual-cursor-left":ne.sameSet(d,u)&&(s+=" prosemirror-virtual-cursor-right")),t.className=s,function(e,t){e.classList.remove(t),e.offsetWidth,e.classList.add(t)}(t,"prosemirror-virtual-cursor-animation"),t.style.height=i.bottom-i.top+"px",t.style.left=i.left-a.left+"px",t.style.top=i.top-a.top+"px"}(t,r)};let i;return window.ResizeObserver&&(i=new window.ResizeObserver(()=>o()),i.observe(t.dom)),n.addEventListener("selectionchange",o),{update:()=>{o()},destroy:()=>{n.removeEventListener("selectionchange",o),i&&i.unobserve(t.dom)}}},props:{handleKeyDown:(e,t)=>{var n;const{selection:r}=e.state;if(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||t.isComposing||!["ArrowLeft","ArrowRight"].includes(t.key)||!ug(r)||!r.empty)return!1;const o=r.$head,[i,a]=dg(o),s=e.state.storedMarks||o.marks();if(i&&a&&!ne.sameSet(i,a)){if("ArrowLeft"===t.key&&!ne.sameSet(i,s))return e.dispatch(e.state.tr.setStoredMarks(i)),!0;if("ArrowRight"===t.key&&!ne.sameSet(a,s))return e.dispatch(e.state.tr.setStoredMarks(a)),!0}return"ArrowLeft"===t.key&&1===o.textOffset?(e.dispatch(e.state.tr.setSelection(S.create(e.state.doc,o.pos-1)).setStoredMarks(o.marks())),!0):"ArrowRight"===t.key&&o.textOffset+1===(null==(n=o.parent.maybeChild(o.index()))?void 0:n.nodeSize)&&(e.dispatch(e.state.tr.setSelection(S.create(e.state.doc,o.pos+1)).setStoredMarks(o.marks())),!0)},decorations:t=>{if(e&&ug(t.selection)&&t.selection.empty)return f.create(t.doc,[v.widget(0,e,{key:"prosemirror-virtual-cursor"})])},attributes:{class:"virtual-cursor-enabled"}}})}();e.use(s(()=>n))})(t,n);case C_.BlockEdit:return((e,t)=>{e.config(tS(C_.BlockEdit)).config(e=>function(e,t){e.set(Fd.key,{filterNodes:e=>!A(e=>["table","blockquote","math_inline"].includes(e.type.name))(e)}),e.set(Yd.key,{view:()=>new sM(e,t)})}(e,t)).config(e=>function(e,t){e.set(ZA.key,{view:n=>new KA(e,n,t)})}(e,t)).use(XA).use(Yd).use(ZA)})(t,n);case C_.Placeholder:return((e,t)=>{e.config(tS(C_.Placeholder)).config(e=>{t&&e.update(RM.key,e=>({...e,...t}))}).use(PM).use(RM)})(t,n);case C_.Toolbar:return((e,t)=>{e.config(tS(C_.Toolbar)).config(e=>{e.set(UM.key,{view:n=>new GM(e,n,t)})}).use(UM)})(t,n);case C_.Table:return((e,t)=>{e.config(tS(C_.Table)).config(e=>{e.update(PC.key,e=>({...e,renderButton:e=>{var n,r,o,i,a,s,l,c,d;switch(e){case"add_row":return null!=(n=null==t?void 0:t.addRowIcon)?n:j_;case"add_col":return null!=(r=null==t?void 0:t.addColIcon)?r:j_;case"delete_row":return null!=(o=null==t?void 0:t.deleteRowIcon)?o:F_;case"delete_col":return null!=(i=null==t?void 0:t.deleteColIcon)?i:F_;case"align_col_left":return null!=(a=null==t?void 0:t.alignLeftIcon)?a:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25ZM4.25 16.625C4.0375 16.625 3.85942 16.5531 3.71575 16.4093C3.57192 16.2654 3.5 16.0872 3.5 15.8748C3.5 15.6621 3.57192 15.484 3.71575 15.3405C3.85942 15.1968 4.0375 15.125 4.25 15.125H13.75C13.9625 15.125 14.1406 15.1969 14.2843 15.3408C14.4281 15.4846 14.5 15.6628 14.5 15.8753C14.5 16.0879 14.4281 16.266 14.2843 16.4095C14.1406 16.5532 13.9625 16.625 13.75 16.625H4.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM4.25 8.875C4.0375 8.875 3.85942 8.80308 3.71575 8.65925C3.57192 8.51542 3.5 8.33725 3.5 8.12475C3.5 7.91208 3.57192 7.734 3.71575 7.5905C3.85942 7.44683 4.0375 7.375 4.25 7.375H13.75C13.9625 7.375 14.1406 7.44692 14.2843 7.59075C14.4281 7.73458 14.5 7.91275 14.5 8.12525C14.5 8.33792 14.4281 8.516 14.2843 8.6595C14.1406 8.80317 13.9625 8.875 13.75 8.875H4.25ZM4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25Z"\n />\n </svg>\n';case"align_col_center":return null!=(s=null==t?void 0:t.alignCenterIcon)?s:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25ZM8.25 16.625C8.0375 16.625 7.85942 16.5531 7.71575 16.4093C7.57192 16.2654 7.5 16.0872 7.5 15.8748C7.5 15.6621 7.57192 15.484 7.71575 15.3405C7.85942 15.1968 8.0375 15.125 8.25 15.125H15.75C15.9625 15.125 16.1406 15.1969 16.2843 15.3408C16.4281 15.4846 16.5 15.6628 16.5 15.8753C16.5 16.0879 16.4281 16.266 16.2843 16.4095C16.1406 16.5532 15.9625 16.625 15.75 16.625H8.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM8.25 8.875C8.0375 8.875 7.85942 8.80308 7.71575 8.65925C7.57192 8.51542 7.5 8.33725 7.5 8.12475C7.5 7.91208 7.57192 7.734 7.71575 7.5905C7.85942 7.44683 8.0375 7.375 8.25 7.375H15.75C15.9625 7.375 16.1406 7.44692 16.2843 7.59075C16.4281 7.73458 16.5 7.91275 16.5 8.12525C16.5 8.33792 16.4281 8.516 16.2843 8.6595C16.1406 8.80317 15.9625 8.875 15.75 8.875H8.25ZM4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25Z"\n />\n </svg>\n';case"align_col_right":return null!=(l=null==t?void 0:t.alignRightIcon)?l:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25ZM10.25 8.875C10.0375 8.875 9.85942 8.80308 9.71575 8.65925C9.57192 8.51542 9.5 8.33725 9.5 8.12475C9.5 7.91208 9.57192 7.734 9.71575 7.5905C9.85942 7.44683 10.0375 7.375 10.25 7.375H19.75C19.9625 7.375 20.1406 7.44692 20.2843 7.59075C20.4281 7.73458 20.5 7.91275 20.5 8.12525C20.5 8.33792 20.4281 8.516 20.2843 8.6595C20.1406 8.80317 19.9625 8.875 19.75 8.875H10.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM10.25 16.625C10.0375 16.625 9.85942 16.5531 9.71575 16.4093C9.57192 16.2654 9.5 16.0872 9.5 15.8748C9.5 15.6621 9.57192 15.484 9.71575 15.3405C9.85942 15.1968 10.0375 15.125 10.25 15.125H19.75C19.9625 15.125 20.1406 15.1969 20.2843 15.3408C20.4281 15.4846 20.5 15.6628 20.5 15.8753C20.5 16.0879 20.4281 16.266 20.2843 16.4095C20.1406 16.5532 19.9625 16.625 19.75 16.625H10.25ZM4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25Z"\n />\n </svg>\n';case"col_drag_handle":return null!=(c=null==t?void 0:t.colDragHandleIcon)?c:P_;case"row_drag_handle":return null!=(d=null==t?void 0:t.rowDragHandleIcon)?d:P_}}}))}).use(QC)})(t,n);case C_.Latex:return((e,t)=>{e.config(tS(C_.Latex)).config(e=>{if(!eS(e).get().includes(C_.CodeMirror))throw new Error("You need to enable CodeMirror to use LaTeX feature");e.update(om.key,e=>({...e,renderPreview:(n,r,o)=>"latex"===n.toLowerCase()&&r.length>0?function(e,t){return Nx.renderToString(e,{...t,throwOnError:!1,displayMode:!0})}(r,null==t?void 0:t.katexOptions):(0,e.renderPreview)(n,r,o)})),e.set(hM.key,{view:n=>{var r;return new MM(e,n,{inlineEditConfirm:null!=(r=null==t?void 0:t.inlineEditConfirm)?r:O_,...t})}})}).use(LM).use(IM).use(dM).use(hM).use(TM).use(EM).use(lM).use(uM)})(t,n);case C_.TopBar:return((e,t)=>{e.config(tS(C_.TopBar)).config(e=>{e.set(lT.key,{view:n=>new sT(e,n,t)})}).use(lT).use(cT)})(t,n);case C_.AI:((e,t)=>{var n,r;const o=null!=(n=null==t?void 0:t.diff)?n:{},i=null!=(r=null==t?void 0:t.streaming)?r:{};e.config(tS(C_.AI)).config(e=>{e.update(eo.key,e=>{var t;return{...e,ignoreAttrs:null!=(t=o.ignoreAttrs)?t:MA}});const{ignoreAttrs:t,...n}=o;e.update(ko.key,e=>{var t;return{...e,customBlockTypes:null!=(t=n.customBlockTypes)?t:AA,...n}})}).use(po).use(Vo).config(e=>{e.update($o.key,e=>{var n;return{...e,...i,ignoreAttrs:null!=(n=i.ignoreAttrs)?n:MA,...void 0!==(null==t?void 0:t.diffReviewOnEnd)?{diffReviewOnEnd:t.diffReviewOnEnd}:{}}})}).use(ni).config(e=>{e.update(rS.key,e=>{var n;return{...e,...void 0!==(null==t?void 0:t.provider)?{provider:t.provider}:{},...void 0!==(null==t?void 0:t.buildContext)?{buildContext:t.buildContext}:{},diffReviewOnEnd:null!=(n=null==t?void 0:t.diffReviewOnEnd)?n:e.diffReviewOnEnd,...void 0!==(null==t?void 0:t.onError)?{onError:t.onError}:{},...void 0!==(null==t?void 0:t.aiIcon)?{aiIcon:t.aiIcon}:{}}})}).use(rS).use(oS).use(sS).use(lS).config(function(e){return t=>{const n=function(e){var t,n;const r=new $S;return function(e){e.addItem("improve",{icon:S_,label:"Improve writing",streamingLabel:"Improving writing",prompt:"Improve the writing while preserving the original meaning."}).addItem("grammar",{icon:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M9.55 17.575L4.225 12.25l1.4-1.425L9.55 14.75l8.825-8.825l1.4 1.425z"\n />\n </svg>\n',label:"Fix grammar & spelling",streamingLabel:"Fixing grammar & spelling",prompt:"Fix any grammar and spelling errors without changing the meaning."}).addItem("shorter",{icon:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M5 13v-2h14v2z"\n />\n </svg>\n',label:"Make shorter",streamingLabel:"Making shorter",prompt:"Make this shorter while preserving the key information."}).addItem("longer",{icon:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M3 18v-2h13v2zm0-5v-2h18v2zm0-5V6h18v2zm15 13v-3h-3v-2h3v-3h2v3h3v2h-3v3z"\n />\n </svg>\n',label:"Make longer",streamingLabel:"Expanding",prompt:"Expand this with more detail and examples."}),e.addSubmenu("tone",{icon:B_,label:"Change tone…",title:"Change tone",searchPlaceholder:"Search tones…"},e=>{const t=[["professional","Professional"],["casual","Casual"],["confident","Confident"],["friendly","Friendly"],["direct","Direct"],["formal","Formal"]];for(const[n,r]of t)e.addItem(n,{icon:B_,label:r,streamingLabel:"Adjusting tone",prompt:`Rewrite this in a ${r.toLowerCase()} tone.`})}),e.addSubmenu("translate",{icon:Z_,label:"Translate…",title:"Translate",searchPlaceholder:"Search languages…"},e=>{const t=[["english","English","English"],["chinese","Chinese","Chinese (Simplified)"],["japanese","Japanese","Japanese"],["korean","Korean","Korean"],["spanish","Spanish","Spanish"],["french","French","French"],["german","German","German"]];for(const[n,r,o]of t)e.addItem(n,{icon:Z_,label:r,streamingLabel:`Translating to ${r}`,prompt:`Translate this to ${o}.`})})}(r),null==(t=null==e?void 0:e.buildAISuggestions)||t.call(e,r),{placeholder:null!=(n=null==e?void 0:e.instructionPlaceholder)?n:"Tell AI what to do with the selection…",chrome:dA(e),suggestions:r.build()}}(e);let r=null;t.update(lA.key,e=>({...e,show:(e,t)=>{null==r||r.show(e,t)}})),t.set(cA.key,{view:e=>(r=new sA(t,e,n),r)})}}(t)).use(lA).use(cA).use(function(e={}){var t,n;const{config:r}=e,o=null!=(t=null==r?void 0:r.fallbackLabel)?t:"Generating",i=null!=(n=null==r?void 0:r.cancelHint)?n:"Esc to cancel";return s(e=>{let t=null;function n(){t&&(t.destroy(),t=null)}return new c({key:_A,state:{init:()=>f.empty,apply(r,a,s,l){const c=Ko.getState(l);return(null==c?void 0:c.active)&&null!=c.insertEndPos?r.getMeta(Ko)||r.docChanged?function(n,r){const a=Math.min(r,n.content.size),s=v.widget(a,(t?t.setLabel(e):t=new SA(e,o,i),t).dom,{side:1,key:"ai-streaming-indicator"});return f.create(n,[s])}(l.doc,c.insertEndPos):a.map(r.mapping,r.doc):(n(),f.empty)}},view:()=>({destroy(){n()}}),props:{decorations(e){var t;return null!=(t=_A.getState(e))?t:f.empty},handleKeyDown(t,n){var r;if("Escape"!==n.key)return!1;const o=e.get(g);return e.get(oS.key).abortController?(n.preventDefault(),o.call(lS.key,{keep:!0}),!0):!!(null==(r=Ko.getState(t.state))?void 0:r.active)&&(n.preventDefault(),o.call(ti.key,{keep:!0}),!0)}}})})}({config:null==t?void 0:t.streamingIndicator})).use(function(e={}){const t=function(e){var t,n,r,o,i,a,s;const{config:l,enterKeyIcon:c}=e;return{retryLabel:null!=(t=null==l?void 0:l.retryLabel)?t:"Retry",rejectAllLabel:null!=(n=null==l?void 0:l.rejectAllLabel)?n:"Reject all",acceptAllLabel:null!=(r=null==l?void 0:l.acceptAllLabel)?r:"Accept all",retryIcon:null!=(o=null==l?void 0:l.retryIcon)?o:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M12 20q-3.35 0-5.675-2.325T4 12q0-3.35 2.325-5.675T12 4q1.725 0 3.3.713T18 6.75V4h2v7h-7V9h4.2q-.8-1.4-2.187-2.2T12 6Q9.5 6 7.75 7.75T6 12q0 2.5 1.75 4.25T12 18q1.925 0 3.475-1.1T17.65 14h2.1q-.7 2.65-2.85 4.325T12 20"\n />\n </svg>\n',rejectIcon:null!=(i=null==l?void 0:l.rejectIcon)?i:E_,acceptIcon:null!=(a=null==l?void 0:l.acceptIcon)?a:O_,enterKeyIcon:null!=c?c:z_,modSymbol:null!=(s=null==l?void 0:l.modSymbol)?s:BS}}(e);return s(e=>new c({key:PS,view:n=>new RS(e,n,t),props:{handleKeyDown(t,n){var r;return!("Enter"!==n.key||!n.metaKey&&!n.ctrlKey||!(null==(r=to.getState(t.state))?void 0:r.active)||!e.get(oS.key).diffOwnedByAI||(n.preventDefault(),e.get(g).call(uo.key),0))}}}))}({config:null==t?void 0:t.diffActions,enterKeyIcon:null==t?void 0:t.enterKeyIcon}))})(t,n)}}(e,this.editor,t)})}}function wT(e){const{path:t,readOnly:o=!1}=e,a=n.useRef(null),l=n.useRef(e);l.current=e;const d=n.useRef(null),u=n.useRef(new Set),h=n.useRef(!1),[p,m]=n.useState(!1);return n.useEffect(()=>{if(!a.current)return;let n=!1,r=!1;m(!1),u.current.clear();const p=document.createElement("div");a.current.append(p);const f=l.current.text,g=new bT({root:p,defaultValue:nt(f),featureConfigs:{[bT.Feature.CodeMirror]:{previewOnlyByDefault:!0,renderPreview:(e,t,n)=>{if(!rt(e))return null;ot(t).then(n)}}},features:{[bT.Feature.Cursor]:!1,[bT.Feature.ImageBlock]:!1,[bT.Feature.BlockEdit]:!1,[bT.Feature.Toolbar]:!0,[bT.Feature.Placeholder]:!1}});g.editor.remove(it),g.editor.config(e=>e.update(om.key,e=>({...e,activationMode:"viewport"}))),g.editor.config(e=>e.update(at,Qn)),g.editor.config(e=>e.update(vC.key,e=>({...e,renderLabel:({label:e,listType:t,checked:n})=>{if(null==n)return"bullet"===t?st:e;if(!0===n)return lt;if("in-progress"===n)return ct;if("cancelled"===n)return dt;const r=i(n);return r&&" "!==r?r:ut}})));for(const e of ht)g.editor.use(e);g.editor.use(pt).use(mt);for(const e of ft)g.editor.use(e);g.editor.use(gt).use(vt).use(yt).use(bt).use(wt);for(const t of e.createNodeViews?.(g)??[])g.editor.use(t);return g.editor.use(s(e=>new c({view:()=>({update(t,o){if(!r||n||h.current||l.current.readOnly||t.state.doc.eq(o.doc))return;const i=e.get(le)(t.state.doc);u.current.add(i),l.current.onChange?.(i)}})}))),g.setReadonly(o),g.create().then(()=>{n?g.destroy():(d.current=g,g.setReadonly(l.current.readOnly??!1),l.current.text!==f&&g.editor.action(xt(nt(l.current.text))),r=!0,g.editor.action(e=>e.get(T).dom.setAttribute("aria-label",t)),a.current&&l.current.onReady?.(a.current))}).catch(()=>{n||m(!0)}),()=>{n=!0,d.current=null,r&&g.destroy(),p.remove()}},[t,e.createNodeViews]),n.useEffect(()=>{d.current?.setReadonly(o)},[o]),n.useEffect(()=>{const t=d.current;if(t)if(t.getMarkdown()!==e.text){if(!u.current.delete(e.text)){u.current.clear(),h.current=!0;try{t.editor.action(xt(nt(e.text)))}finally{h.current=!1}}}else u.current.clear()},[e.text]),r.jsxs("div",{className:"obsidian-file-editor remote-editor","data-readonly":o,onClick:e=>{if(e.defaultPrevented)return;const t=e.target instanceof Element?e.target:null,n=t?.closest(".callout-title")?.parentElement;if(n?.hasAttribute("data-callout-folded"))return e.stopPropagation(),void(n.dataset.calloutFolded=String("true"!==n.dataset.calloutFolded));a.current&&l.current.onClick?.(e,a.current)},children:[p&&r.jsx("p",{role:"alert",children:e.errorText}),r.jsx("div",{ref:a})]})}function xT({target:e,hash:t,host:o}){const[i,a]=n.useState({}),s=qn(),{path:l,cwd:c}=jn(e,o.path,o.cwd);return n.useEffect(()=>{const n=new AbortController;a({});const r=Vn();if(r&&!(o.depth>=3))return(o.resolveFile?.(e,o.path)??Promise.resolve({path:l,cwd:c})).then(async e=>{const o=await fetch(Fn(e.path,e.cwd),{headers:{authorization:`Bearer ${r.pairToken}`},signal:n.signal});if(!o.ok)throw new Error("Unable to load embedded note");const i=Mt(await o.text(),t);if(i.error||null===i.content)throw new Error("Missing section");n.signal.aborted||a({text:i.content,...e})}).catch(()=>{n.signal.aborted||a({error:!0})}),()=>n.abort()},[l,c,t,o.depth]),r.jsxs("div",{className:"remote-note-embed",children:[r.jsxs("button",{type:"button",onClick:()=>o.onOpenFile(i.path??l,i.cwd??c),children:[e||o.path,t?`#${t}`:""," ↗"]}),i.error?r.jsx("p",{children:s.unavailable}):void 0!==i.text?r.jsx(kT,{client:o.client,path:$n(i.path??l,i.cwd??c),cwd:o.cwd,resolveFile:o.resolveFile,text:i.text,readOnly:!0,depth:o.depth+1,onOpenFile:o.onOpenFile}):o.depth<3&&r.jsx("p",{children:s.loading})]})}function kT(t){const{path:i,cwd:a,depth:s=0}=t,l=n.useRef(t);l.current=t;const c=n.useCallback(n=>function(t){const n=Hn(t.path,t.cwd);return[R(kt.node,()=>function(t){return(n,r,o)=>{const i=document.createElement("div");i.className="lifeos-block-nodeview",i.contentEditable="false",i.dataset.lifeosBlockNodeview="true",i.dataset.lifeosHydrationStatus="pending",i.dataset.lifeosExportStatus="loading",i.setAttribute("aria-busy","true"),i.style.minHeight="72px";const a=e=>{(e=>e instanceof HTMLElement&&!(e=>e instanceof HTMLElement&&Boolean(e.closest('[data-mobile-text-entry="true"]')))(e)&&Boolean(e.closest(["button",'input[type="checkbox"]','input[type="radio"]',"label","select",'[role="button"]','[role="dialog"]',".advanced-table-toolbar-action",".advanced-table-page-size-option",".advanced-table-pagination-btn",".advanced-table-col-modal",".advanced-table-col-item",".advanced-table-filter-dropdown","[data-lifeos-action-rail]","[data-lifeos-action-button]"].join(", "))))(e.target)&&((()=>{const e=document.activeElement;e instanceof HTMLElement&&e!==document.body&&(e.isContentEditable||e.closest('[contenteditable="true"]'))&&e.blur()})(),e.stopPropagation())},s=["pointerdown","pointerup","mousedown","mouseup","click","touchstart","touchend","focusin"];s.forEach(e=>{i.addEventListener(e,a)});let l=null,c=t.render??null,d=null,u=!1,h=null;const p=()=>{if(!c||u)return;l||(l=e.createRoot(i));const a=t.resolveFileName?.(r,i)??function(e,t){try{const n=e.dom.closest(".editor-pane");if(n){const e=n.getAttribute("data-current-file");if(e)return e}const r=t.closest(".editor-pane");if(r){const e=r.getAttribute("data-current-file");if(e)return e}}catch{}}(r,i);l.render(c({content:String(n.attrs.value??""),fileName:a,onContentChange:e=>{const t=o();if("number"!=typeof t)return;const i=r.state.tr.setNodeMarkup(t,void 0,{...n.attrs,value:e});r.dispatch(i)}})),i.dataset.lifeosHydrationStatus="rendered",delete i.dataset.lifeosExportStatus,i.removeAttribute("aria-busy")},m=()=>h||(d?.disconnect(),d=null,i.dataset.lifeosHydrationStatus="loading",h=(c?Promise.resolve(c):t.loadRenderer?t.loadRenderer():Promise.reject(new Error("A LifeOSBlock renderer or loader is required."))).then(e=>{u||(c=e,p())}).catch(()=>{u||(i.dataset.lifeosHydrationStatus="error",i.dataset.lifeosExportStatus="error",i.removeAttribute("aria-busy"))}),h),f=()=>{m()};return i.addEventListener("pointerdown",f,{once:!0,capture:!0}),(t.shouldActivateImmediately?.(r,i)??Boolean(r.dom.closest?.('[data-lifeos-block-hydration="eager"]')))||c||"undefined"==typeof IntersectionObserver?m():(d=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&m()},{rootMargin:t.intersectionRootMargin??"200px 0px"}),d.observe(i)),{dom:i,update:e=>e.type===n.type&&(n=e,c&&p(),!0),destroy:()=>{u=!0,d?.disconnect(),d=null,i.removeEventListener("pointerdown",f,!0),s.forEach(e=>{i.removeEventListener(e,a)}),l?.unmount(),l=null},stopEvent:()=>!0,ignoreMutation:()=>!0}}}({resolveFileName:()=>t.path,render:e=>r.jsx(St,{content:e.content??"",fileName:t.path,context:{...t,resolveFile:t.resolveFile??(async(e,n)=>jn(e,n,t.cwd))},read:async e=>{const n=Vn();if(!n)return null;const r=await fetch(Fn(e,t.cwd),{headers:{authorization:`Bearer ${n.pairToken}`}});return r.ok?{content:await r.text()}:null}})})),R(Ct.node,()=>e=>{const t=document.createElement("details");t.className="remote-frontmatter",t.contentEditable="false";const n=document.createElement("summary");n.textContent=qn().properties;const r=document.createElement("pre");return r.textContent=e.attrs.value,t.append(n,r),{dom:t,update:t=>t.type===e.type&&(r.textContent=t.attrs.value,!0)}}),R(_t.node,()=>function(t){return(n,r,o,i=[])=>{const a=document.createElement("div");a.className="wiki-embedding-nodeview",a.dataset.wikiembeddingNodeview="true";const s=document.createElement("div");s.className="wiki-embedding-nodeview-preview",s.contentEditable="false";const l=document.createElement("span");l.className="inline-source-source wiki-embedding-nodeview-source",l.spellcheck=!1,a.append(s,l);let c=null,d=null,u=!1,h=!1;const p=()=>({target:String(n.attrs.target??""),hash:String(n.attrs.hash??""),size:String(n.attrs.alias??"")}),m=()=>{h||(s.style.minHeight="",a.dataset.wikiembeddingRenderStatus="rendered")},f=()=>{if(h)return;const{target:i,hash:a,size:l}=p();c||(c=e.createRoot(s)),c.render(t.render({target:i,hash:a,size:l,onResourceSettled:m,onResize:e=>{const t=Math.round(e);if(!Number.isFinite(t)||t<=0)return;const i=o();if("number"!=typeof i)return;const a=r.state.doc.nodeAt(i);if(!a||a.type!==n.type)return;const s=String(t),l=sr(a,s);if(a.attrs.alias===s&&a.textContent===l)return;const c=a.type.create({...a.attrs,alias:s},r.state.schema.text(l),a.marks);r.dispatch(r.state.tr.replaceWith(i,i+a.nodeSize,c))}}))},g=()=>{u||h||(u=!0,d?.(),d=null,a.dataset.wikiembeddingRenderStatus="loading",f())},v=e=>{const t=function(e){return e.textContent?e.textContent:sr(e)}(n);a.dataset.inlineSourceKind="wikiembedding",a.dataset.inlineSourceRaw=t,a.dataset.wikiembeddingTarget=String(n.attrs.target??""),a.dataset.wikiembeddingHash=String(n.attrs.hash??""),a.dataset.wikiembeddingAlias=String(n.attrs.alias??""),a.dataset.inlineSourceActive=e?"true":"false",a.classList.toggle("inline-source-node-active",e);const r=e?"true":"false";a.contentEditable!==r&&(a.contentEditable=r),s.style.display="",l.style.display=e?"":"none"};return v(lr(i)),(()=>{if(u||h)return;const e=p();if(!t.shouldDeferRender?.(e)||"undefined"==typeof IntersectionObserver)return void g();const n=t.getDeferredMinHeight?.(e)??t.deferredMinHeight??"240px";a.dataset.wikiembeddingRenderStatus="pending",s.style.minHeight=n,s.style.contentVisibility="auto",s.style.containIntrinsicBlockSize=`auto ${n}`,d=function(e){const t=function(e,t){const n=function(e){if(!e)return tr;const t=er.get(e);if(t)return t;const n=new Map;return er.set(e,n),n}(e),r=n.get(t);if(r)return r;let o;const i=new IntersectionObserver(e=>{e.forEach(e=>{if(!e.isIntersecting)return;const t=ar(o,e.target);t&&function(e){nr.push(e),ir()}(t)})},{root:e,rootMargin:t});return o={callbacks:new Map,observer:i,owner:n,rootMargin:t},n.set(t,o),o}(e.root,e.rootMargin);return t.callbacks.set(e.target,e.onIntersect),t.observer.observe(e.target),()=>{ar(t,e.target)}}({target:a,root:t.resolveIntersectionRoot?.(r,a)??null,rootMargin:t.intersectionRootMargin??"600px 0px",onIntersect:g})})(),{dom:a,contentDOM:l,update:(e,r=[])=>e.type===n.type&&(n=e,v(lr(r)),u?f():t.shouldDeferRender?.(p())||g(),!0),destroy:()=>{h=!0,d?.(),d=null,c?.unmount(),c=null},stopEvent:e=>!l.contains(e.target),ignoreMutation:e=>!l.contains(e.target)}}}({render:({target:e,hash:o,size:i})=>At(e)?r.jsx("div",{style:{maxWidth:/^\d+$/.test(i??"")?`${i}px`:void 0},children:r.jsx(Zn,{gallery:t.gallery,src:e,cwd:jn(e,t.path,t.cwd).cwd,onOpen:t.onOpenFile})}):/\.[^/.]+$/.test(e)&&!/\.(md|markdown)$/i.test(e)?r.jsxs("button",{type:"button",onClick:()=>t.onOpenFile(e,n),children:[e," ↗"]}):r.jsx(xT,{target:e,hash:o,host:t})})),R(re.node,()=>o=>{const i=document.createElement("span");i.contentEditable="false";const a=e.createRoot(i),s=()=>a.render(r.jsx(Zn,{gallery:t.gallery,src:o.attrs.src,alt:o.attrs.alt,cwd:n,onOpen:t.onOpenFile}));return s(),{dom:i,update:e=>e.type===o.type&&(o=e,s(),!0),destroy(){queueMicrotask(()=>a.unmount())}}})]}({client:t.client,path:i,cwd:a,depth:s,resolveFile:t.resolveFile,gallery:()=>{const e=[];return n.editor.action(t=>t.get(T).state.doc.descendants(t=>{"image"===t.type.name&&e.push({src:t.attrs.src,alt:t.attrs.alt,cwd:Hn(i,a)}),"wikiembedding"===t.type.name&&At(t.attrs.target)&&e.push({src:t.attrs.target,cwd:jn(t.attrs.target,i,a).cwd})})),e},onOpenFile:(e,t)=>l.current.onOpenFile(e,t)}),[i,a,s,t.client,t.resolveFile]);return r.jsx(wT,{path:i,text:t.text,readOnly:t.readOnly,onChange:t.onChange,createNodeViews:c,errorText:qn().editorError,onReady:e=>{const t=0===s?Gn(i,a):"";t&&requestAnimationFrame(()=>Wn(e,t))},onClick:(e,t)=>{const n=e.target instanceof Element?e.target:null,r=n?.closest("a");if(!r)return;const s=r.getAttribute("data-wikilink-target"),c=r.getAttribute("href");if(e.preventDefault(),e.stopPropagation(),null!==s){const e=r.getAttribute("data-wikilink-hash")??"";!s&&t?Wn(t,e):(l.current.resolveFile?.(s,i)??Promise.resolve(jn(s,i,a))).then(n=>{t&&$n(n.path,n.cwd)===$n(i,a)?Wn(t,e):(Un(n.path,n.cwd,e),l.current.onOpenFile(n.path,n.cwd))})}else if(c&&/^https?:\/\//i.test(c)){const e=o().openExternal;e?e(c):window.open(c,"_blank","noopener,noreferrer")}else c&&!/^(?:[a-z][\w+.-]*:|\/\/)/i.test(c)&&(c.startsWith("#")&&t?Wn(t,c):l.current.onOpenFile(c.split("#")[0]||i,Hn(i,a)))}})}bT.Feature=C_;export{kT as ObsidianFileEditor};
|
|
2
|
+
import{p as e,_ as t,r as n,j as r,h as o}from"./index-CTpWXHK5.js";import{c as i,$ as a,a as s,b as l,P as c,e as d,p as u,R as h,S as p,F as m,D as f,f as g,g as v,h as y,i as b,j as w,o as x,s as k,k as C,l as _,T as S,m as A,N as M,n as T,q as E,r as L,t as O,u as I,v as R,w as P,x as B,y as z,z as D,A as N,B as H,C as q,E as j,G as V,H as F,I as $,J as W,K as U,L as G,M as Z,O as X,Q as K,U as Y,V as J,W as Q,X as ee,Y as te,Z as ne,_ as re,a0 as oe,a1 as ie,a2 as ae,a3 as se,a4 as le,a5 as ce,a6 as de,a7 as ue,a8 as he,a9 as pe,aa as me,ab as fe,ac as ge,ad as ve,ae as ye,af as be,ag as we,ah as xe,ai as ke,aj as Ce,ak as _e,al as Se,am as Ae,an as Me,ao as Te,ap as Ee,aq as Le,ar as Oe,as as Ie,at as Re,au as Pe,av as Be,aw as ze,ax as De,ay as Ne,az as He,aA as qe,aB as je,aC as Ve,aD as Fe,aE as $e,aF as We,aG as Ue,aH as Ge,aI as Ze,aJ as Xe,aK as Ke,aL as Ye,aM as Je,aN as Qe,aO as et,aP as tt,aQ as nt,aR as rt,aS as ot,aT as it,aU as at,aV as st,aW as lt,aX as ct,aY as dt,aZ as ut,a_ as ht,a$ as pt,b0 as mt,b1 as ft,b2 as gt,b3 as vt,b4 as yt,b5 as bt,b6 as wt,b7 as xt,b8 as kt,b9 as Ct,ba as _t,bb as St,bc as At,bd as Mt}from"./RemoteLifeOSBlock-CwM5U04N.js";import{h as Tt,b as Et}from"./index-B5px1ls4.js";import{Z as Lt,u as Ot,a3 as It,E as Rt,a4 as Pt,a5 as Bt,z as zt,a6 as Dt,a7 as Nt,k as Ht,X as qt,V as jt,S as Vt,a as Ft,P as $t,e as Wt,F as Ut,a8 as Gt,a9 as Zt,f as Xt,aa as Kt,c as Yt,h as Jt,j as Qt,m as en,C as tn,ab as nn,ac as rn,ad as on,ae as an,af as sn,W as ln,ag as cn,ah as dn,ai as un,aj as hn,ak as pn,al as mn,am as fn,an as gn,ao as vn,ap as yn,aq as bn,ar as wn,as as xn,at as kn,au as Cn,av as _n}from"./file-editor-index-C6CU7Fik.js";import{p as Sn}from"./purify.es-BNLkGfTg.js";import{a as An,b as Mn,d as Tn,e as En}from"./file-editor-index-D5fLCdey.js";import{c as Ln,r as On}from"./index-CtwbNx5m.js";import{t as In,a as Rn,d as Pn,x as Bn}from"./isArrayLikeObject-C958pSF-.js";import{t as zn,b as Dn,c as Nn}from"./_baseMerge-DBQbsGvS.js";import{ap as Hn,aq as qn,ar as jn,j as Vn,k as Fn,M as $n,as as Wn,at as Un,au as Gn}from"./App-DHM2JpIe.js";import{M as Zn}from"./MessageImage-L_caj_Dp.js";import"./index-ofOCAr04.js";import"./chevron-up-BvhbPeN2.js";import"./__vite-browser-external-2447137e-Ck9f6uYD.js";import"./_initCloneObject-BR1zWEqJ.js";import"./useMessageImage-CkBgO2_p.js";function Xn(e){const t=(t,n,r,o)=>{const i=r.options[e],a=t.marker;"*"!==a&&"_"!==a||(r.options[e]=a);try{return Tt[e](t,n,r,o)}finally{r.options[e]=i}};return t.peek=(t,n,r)=>t.marker||r.options[e]||"*",t}const Kn=(e,t,n,r)=>{const o=Tt.text(e,t,n,r);return/[ \t]+$/.test(o)&&r.after.startsWith("\n")?function(e){return e.replace(/[ \t]+$/g,e=>e.replace(/ /g," ").replace(/\t/g,"	"))}(o):o};function Yn(e){return(t,n,r,o)=>(t.spread=!1,t.children&&t.children.forEach(e=>{void 0!==e.spread&&(e.spread=!1)}),(e.list??Tt.list)(t,n,r,o))}const Jn=new Set(["list","blockquote","code","table","thematicBreak"]);function Qn(e){const t=e.handlers||{};return{...e,bullet:"-",bulletOrdered:".",listItemIndent:"one",join:[...e.join||[],(e,t,n)=>{if("listItem"===n.type)return"list"===e.type&&"paragraph"===t.type||"paragraph"===e.type&&"list"===t.type&&function(e){if(e.ordered&&1!==(e.start??1))return!0;const t=e.children?.[0];if(null!=i(t?.checked))return!1;const n=t?.children?.[0];return!(n&&!Jn.has(n.type))||"paragraph"===n.type&&!(n.children??[]).some(e=>"text"!==e.type||e.value?.trim())}(t)?1:void 0}],handlers:{...t,strong:Xn("strong"),emphasis:Xn("emphasis"),text:Kn,list:Yn(t),listItem:(e,t,n,r)=>{e.spread=!1,t&&(t.spread=!1);let o=n.bulletCurrent||"-";if(t?.ordered){const r=t.start??1,i=t.children?t.children.indexOf(e):0,a=n.bulletCurrent||n.options.bulletOrdered||".";o=String(r+i)+a}const a=i(e.checked),s=null==a?"":`[${a}] `,l=n.enter("listItem"),c=n.containerFlow(e,r),d=e.children?.some(e=>"html"===e.type||"paragraph"===e.type&&1===e.children?.length&&"html"===e.children[0].type),u=d?o.length+1:Math.max(4,o.length+1),h=" ".repeat(u),p=e.children?.[0]?.type,m=(Jn.has(p)?`\n${c}`:c).split("\n").map((e,t)=>0===t?`${o} ${s}${e}`:""===e?"":h+e).join("\n");return l(),m}}}}const er=new WeakMap,tr=new Map,nr=[];let rr=!1;function or(){rr=!1,nr.splice(0,2).forEach(e=>{e()}),nr.length>0&&ir()}function ir(){rr||(rr=!0,function(e){"function"!=typeof requestAnimationFrame?setTimeout(e,0):requestAnimationFrame(e)}(or))}function ar(e,t){const n=e.callbacks.get(t)??null;return n?(e.callbacks.delete(t),e.observer.unobserve(t),0===e.callbacks.size&&(e.observer.disconnect(),e.owner.delete(e.rootMargin)),n):null}function sr(e,t=String(e.attrs.alias??"")){return`![[${String(e.attrs.target??"")}${e.attrs.hash?`#${String(e.attrs.hash)}`:""}${t?`|${t}`:""}]]`}function lr(e){return e.some(e=>Boolean(e.spec.inlineSourceActive))}var cr=function(){return In.Date.now()},dr=Math.max,ur=Math.min;function hr(e,t,n){var r,o,i,a,s,l,c=0,d=!1,u=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function m(e){var n=e-l;return void 0===l||n>=t||n<0||u&&e-c>=i}function f(){var e=cr();if(m(e))return g(e);s=setTimeout(f,function(e){var n=t-(e-l);return u?ur(n,i-(e-c)):n}(e))}function g(e){return s=void 0,h&&r?p(e):(r=o=void 0,a)}function v(){var e=cr(),n=m(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(f,t),d?p(e):a}(l);if(u)return clearTimeout(s),s=setTimeout(f,t),p(l)}return void 0===s&&(s=setTimeout(f,t)),a}return t=zn(t)||0,Rn(n)&&(d=!!n.leading,i=(u="maxWait"in n)?dr(zn(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h),v.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},v.flush=function(){return void 0===s?a:g(cr())},v}function pr(e,t,n,r,o,i){return Rn(e)&&Rn(t)&&(i.set(t,e),Dn(e,t,void 0,pr,i),i.delete(t)),e}var mr=Nn(function(e,t,n,r){Dn(e,t,n,r)}),fr=Pn(function(e){return e.push(void 0,pr),Bn(mr,void 0,e)});function gr(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Rn(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),hr(e,t,{leading:r,maxWait:t,trailing:o})}function vr(e){return new Ot(It.define(e))}function yr(e){return t(()=>import("./file-editor-index-DH8OZ6dS.js"),__vite__mapDeps([0,1,2,3])).then(t=>t.sql({dialect:t[e]}))}const br=[Lt.of({name:"C",extensions:["c","h","ino"],load:()=>t(()=>import("./file-editor-index-CVa9xeL0.js"),__vite__mapDeps([4,2,1])).then(e=>e.cpp())}),Lt.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load:()=>t(()=>import("./file-editor-index-CVa9xeL0.js"),__vite__mapDeps([4,2,1])).then(e=>e.cpp())}),Lt.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load:()=>yr("Cassandra")}),Lt.of({name:"CSS",extensions:["css"],load:()=>t(()=>import("./file-editor-index-wav2nO7A.js"),__vite__mapDeps([5,2,1])).then(e=>e.css())}),Lt.of({name:"Go",extensions:["go"],load:()=>t(()=>import("./file-editor-index-CMzVhAnN.js"),__vite__mapDeps([6,2,1,3])).then(e=>e.go())}),Lt.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load:()=>t(()=>import("./file-editor-index-YeA2vzMT.js"),__vite__mapDeps([7,2,1,5,8,3])).then(e=>e.html())}),Lt.of({name:"Java",extensions:["java"],load:()=>t(()=>import("./file-editor-index-BWvEAcHp.js"),__vite__mapDeps([9,2,1])).then(e=>e.java())}),Lt.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load:()=>t(()=>import("./file-editor-index-BxQDEPaH.js"),__vite__mapDeps([8,2,1,3])).then(e=>e.javascript())}),Lt.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load:()=>t(()=>import("./file-editor-index-CTfoBHg1.js"),__vite__mapDeps([10,1,7,2,5,8,3])).then(e=>e.jinja())}),Lt.of({name:"JSON",alias:["json5"],extensions:["json","map"],load:()=>t(()=>import("./file-editor-index-DIH2DQ5-.js"),__vite__mapDeps([11,2,1])).then(e=>e.json())}),Lt.of({name:"JSX",extensions:["jsx"],load:()=>t(()=>import("./file-editor-index-BxQDEPaH.js"),__vite__mapDeps([8,2,1,3])).then(e=>e.javascript({jsx:!0}))}),Lt.of({name:"LESS",extensions:["less"],load:()=>t(()=>import("./file-editor-index-Ca7mWpkj.js"),__vite__mapDeps([12,1,5,2])).then(e=>e.less())}),Lt.of({name:"Liquid",extensions:["liquid"],load:()=>t(()=>import("./file-editor-index-x-jPAG-9.js"),__vite__mapDeps([13,1,7,2,5,8,3])).then(e=>e.liquid())}),Lt.of({name:"MariaDB SQL",load:()=>yr("MariaSQL")}),Lt.of({name:"Markdown",extensions:["md","markdown","mkd"],load:()=>t(()=>import("./file-editor-index-BkRDu8Ih.js"),__vite__mapDeps([14,1,3,7,2,5,8])).then(e=>e.markdown())}),Lt.of({name:"MS SQL",load:()=>yr("MSSQL")}),Lt.of({name:"MySQL",load:()=>yr("MySQL")}),Lt.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load:()=>t(()=>import("./file-editor-index-_YJUu8LH.js"),__vite__mapDeps([15,2,1,7,5,8,3])).then(e=>e.php())}),Lt.of({name:"PLSQL",extensions:["pls"],load:()=>yr("PLSQL")}),Lt.of({name:"PostgreSQL",load:()=>yr("PostgreSQL")}),Lt.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load:()=>t(()=>import("./file-editor-index-CEjRXkxt.js"),__vite__mapDeps([16,2,1,3])).then(e=>e.python())}),Lt.of({name:"Rust",extensions:["rs"],load:()=>t(()=>import("./file-editor-index-vyjM9L0w.js"),__vite__mapDeps([17,2,1])).then(e=>e.rust())}),Lt.of({name:"Sass",extensions:["sass"],load:()=>t(()=>import("./file-editor-index-DhGjGca-.js"),__vite__mapDeps([18,2,1,5])).then(e=>e.sass({indented:!0}))}),Lt.of({name:"SCSS",extensions:["scss"],load:()=>t(()=>import("./file-editor-index-DhGjGca-.js"),__vite__mapDeps([18,2,1,5])).then(e=>e.sass())}),Lt.of({name:"SQL",extensions:["sql"],load:()=>yr("StandardSQL")}),Lt.of({name:"SQLite",load:()=>yr("SQLite")}),Lt.of({name:"TSX",extensions:["tsx"],load:()=>t(()=>import("./file-editor-index-BxQDEPaH.js"),__vite__mapDeps([8,2,1,3])).then(e=>e.javascript({jsx:!0,typescript:!0}))}),Lt.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load:()=>t(()=>import("./file-editor-index-BxQDEPaH.js"),__vite__mapDeps([8,2,1,3])).then(e=>e.javascript({typescript:!0}))}),Lt.of({name:"WebAssembly",extensions:["wat","wast"],load:()=>t(()=>import("./file-editor-index-Dijmg1Xu.js"),__vite__mapDeps([19,1,2])).then(e=>e.wast())}),Lt.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load:()=>t(()=>import("./file-editor-index-CBJfyhrV.js"),__vite__mapDeps([20,2,1])).then(e=>e.xml())}),Lt.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load:()=>t(()=>import("./file-editor-index--NhAFrCD.js"),__vite__mapDeps([21,2,1])).then(e=>e.yaml())}),Lt.of({name:"APL",extensions:["dyalog","apl"],load:()=>t(()=>import("./file-editor-apl-__TFPTXj.js"),[]).then(e=>vr(e.apl))}),Lt.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load:()=>t(()=>import("./file-editor-asciiarmor-D5V0T9Cu.js"),[]).then(e=>vr(e.asciiArmor))}),Lt.of({name:"ASN.1",extensions:["asn","asn1"],load:()=>t(()=>import("./file-editor-asn1-YTasSa1m.js"),[]).then(e=>vr(e.asn1({})))}),Lt.of({name:"Asterisk",filename:/^extensions\.conf$/i,load:()=>t(()=>import("./file-editor-asterisk-B46aRdXb.js"),[]).then(e=>vr(e.asterisk))}),Lt.of({name:"Brainfuck",extensions:["b","bf"],load:()=>t(()=>import("./file-editor-brainfuck-CtZaYBKt.js"),[]).then(e=>vr(e.brainfuck))}),Lt.of({name:"Cobol",extensions:["cob","cpy"],load:()=>t(()=>import("./file-editor-cobol-stawOqaz.js"),[]).then(e=>vr(e.cobol))}),Lt.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>vr(e.csharp))}),Lt.of({name:"Clojure",extensions:["clj","cljc","cljx"],load:()=>t(()=>import("./file-editor-clojure-DiuoqK-z.js"),[]).then(e=>vr(e.clojure))}),Lt.of({name:"ClojureScript",extensions:["cljs"],load:()=>t(()=>import("./file-editor-clojure-DiuoqK-z.js"),[]).then(e=>vr(e.clojure))}),Lt.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load:()=>t(()=>import("./file-editor-css-ZjFoif2m.js"),[]).then(e=>vr(e.gss))}),Lt.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load:()=>t(()=>import("./file-editor-cmake-BF4EFB2i.js"),[]).then(e=>vr(e.cmake))}),Lt.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load:()=>t(()=>import("./file-editor-coffeescript-BTDxI-eT.js"),[]).then(e=>vr(e.coffeeScript))}),Lt.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load:()=>t(()=>import("./file-editor-commonlisp-vq6DHwts.js"),[]).then(e=>vr(e.commonLisp))}),Lt.of({name:"Cypher",extensions:["cyp","cypher"],load:()=>t(()=>import("./file-editor-cypher-gJDei3ni.js"),[]).then(e=>vr(e.cypher))}),Lt.of({name:"Cython",extensions:["pyx","pxd","pxi"],load:()=>t(()=>import("./file-editor-python-BiaVA1aS.js"),[]).then(e=>vr(e.cython))}),Lt.of({name:"Crystal",extensions:["cr"],load:()=>t(()=>import("./file-editor-crystal-CRzZ78HM.js"),[]).then(e=>vr(e.crystal))}),Lt.of({name:"D",extensions:["d"],load:()=>t(()=>import("./file-editor-d-DBBFJxh-.js"),[]).then(e=>vr(e.d))}),Lt.of({name:"Dart",extensions:["dart"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>vr(e.dart))}),Lt.of({name:"diff",extensions:["diff","patch"],load:()=>t(()=>import("./file-editor-diff-UJJ5BM9S.js"),[]).then(e=>vr(e.diff))}),Lt.of({name:"Dockerfile",filename:/^Dockerfile$/,load:()=>t(()=>import("./file-editor-dockerfile-CZsZcXQt.js"),__vite__mapDeps([22,23])).then(e=>vr(e.dockerFile))}),Lt.of({name:"DTD",extensions:["dtd"],load:()=>t(()=>import("./file-editor-dtd-DTQlJHYL.js"),[]).then(e=>vr(e.dtd))}),Lt.of({name:"Dylan",extensions:["dylan","dyl","intr"],load:()=>t(()=>import("./file-editor-dylan-DkEP81N9.js"),[]).then(e=>vr(e.dylan))}),Lt.of({name:"EBNF",load:()=>t(()=>import("./file-editor-ebnf-DdOEfpxz.js"),[]).then(e=>vr(e.ebnf))}),Lt.of({name:"ECL",extensions:["ecl"],load:()=>t(()=>import("./file-editor-ecl-BCmcI64-.js"),[]).then(e=>vr(e.ecl))}),Lt.of({name:"edn",extensions:["edn"],load:()=>t(()=>import("./file-editor-clojure-DiuoqK-z.js"),[]).then(e=>vr(e.clojure))}),Lt.of({name:"Eiffel",extensions:["e"],load:()=>t(()=>import("./file-editor-eiffel-CCu4w8r3.js"),[]).then(e=>vr(e.eiffel))}),Lt.of({name:"Elm",extensions:["elm"],load:()=>t(()=>import("./file-editor-elm-vsguYkAQ.js"),[]).then(e=>vr(e.elm))}),Lt.of({name:"Erlang",extensions:["erl"],load:()=>t(()=>import("./file-editor-erlang-DkiE79O3.js"),[]).then(e=>vr(e.erlang))}),Lt.of({name:"Esper",load:()=>t(()=>import("./file-editor-sql-B3SPsWL6.js"),[]).then(e=>vr(e.esper))}),Lt.of({name:"Factor",extensions:["factor"],load:()=>t(()=>import("./file-editor-factor-DXwzD_Ly.js"),__vite__mapDeps([24,23])).then(e=>vr(e.factor))}),Lt.of({name:"FCL",load:()=>t(()=>import("./file-editor-fcl-D8gVJOao.js"),[]).then(e=>vr(e.fcl))}),Lt.of({name:"Forth",extensions:["forth","fth","4th"],load:()=>t(()=>import("./file-editor-forth-POgR1ypr.js"),[]).then(e=>vr(e.forth))}),Lt.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load:()=>t(()=>import("./file-editor-fortran-BC2PZYR6.js"),[]).then(e=>vr(e.fortran))}),Lt.of({name:"F#",alias:["fsharp"],extensions:["fs"],load:()=>t(()=>import("./file-editor-mllike-3c2dg9RT.js"),[]).then(e=>vr(e.fSharp))}),Lt.of({name:"Gas",extensions:["s"],load:()=>t(()=>import("./file-editor-gas-D2ZU1gfd.js"),[]).then(e=>vr(e.gas))}),Lt.of({name:"Gherkin",extensions:["feature"],load:()=>t(()=>import("./file-editor-gherkin-B6X1vGSW.js"),[]).then(e=>vr(e.gherkin))}),Lt.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load:()=>t(()=>import("./file-editor-groovy-DnIzCrpZ.js"),[]).then(e=>vr(e.groovy))}),Lt.of({name:"Haskell",extensions:["hs"],load:()=>t(()=>import("./file-editor-haskell-Dn099gLW.js"),[]).then(e=>vr(e.haskell))}),Lt.of({name:"Haxe",extensions:["hx"],load:()=>t(()=>import("./file-editor-haxe-80kYRvF1.js"),[]).then(e=>vr(e.haxe))}),Lt.of({name:"HXML",extensions:["hxml"],load:()=>t(()=>import("./file-editor-haxe-80kYRvF1.js"),[]).then(e=>vr(e.hxml))}),Lt.of({name:"HTTP",load:()=>t(()=>import("./file-editor-http-BKJkqRj4.js"),[]).then(e=>vr(e.http))}),Lt.of({name:"IDL",extensions:["pro"],load:()=>t(()=>import("./file-editor-idl-pcmmZuaN.js"),[]).then(e=>vr(e.idl))}),Lt.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load:()=>t(()=>import("./file-editor-javascript-Ccp3-nCs.js"),[]).then(e=>vr(e.jsonld))}),Lt.of({name:"Julia",extensions:["jl"],load:()=>t(()=>import("./file-editor-julia-BqmDTk7j.js"),[]).then(e=>vr(e.julia))}),Lt.of({name:"Kotlin",extensions:["kt","kts"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>vr(e.kotlin))}),Lt.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load:()=>t(()=>import("./file-editor-livescript-HO6ttBFx.js"),[]).then(e=>vr(e.liveScript))}),Lt.of({name:"Lua",extensions:["lua"],load:()=>t(()=>import("./file-editor-lua-CXU1lDR7.js"),[]).then(e=>vr(e.lua))}),Lt.of({name:"mIRC",extensions:["mrc"],load:()=>t(()=>import("./file-editor-mirc-DkvFAiy5.js"),[]).then(e=>vr(e.mirc))}),Lt.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load:()=>t(()=>import("./file-editor-mathematica-IIbmv7SK.js"),[]).then(e=>vr(e.mathematica))}),Lt.of({name:"Modelica",extensions:["mo"],load:()=>t(()=>import("./file-editor-modelica-DSrSSXCg.js"),[]).then(e=>vr(e.modelica))}),Lt.of({name:"MUMPS",extensions:["mps"],load:()=>t(()=>import("./file-editor-mumps-zvxmGV4l.js"),[]).then(e=>vr(e.mumps))}),Lt.of({name:"Mbox",extensions:["mbox"],load:()=>t(()=>import("./file-editor-mbox-z_N2Mo3d.js"),[]).then(e=>vr(e.mbox))}),Lt.of({name:"Nginx",filename:/nginx.*\.conf$/i,load:()=>t(()=>import("./file-editor-nginx-BmAbM9sR.js"),[]).then(e=>vr(e.nginx))}),Lt.of({name:"NSIS",extensions:["nsh","nsi"],load:()=>t(()=>import("./file-editor-nsis-DeakT4dU.js"),__vite__mapDeps([25,23])).then(e=>vr(e.nsis))}),Lt.of({name:"NTriples",extensions:["nt","nq"],load:()=>t(()=>import("./file-editor-ntriples-DEO2wBQg.js"),[]).then(e=>vr(e.ntriples))}),Lt.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>vr(e.objectiveC))}),Lt.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>vr(e.objectiveCpp))}),Lt.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load:()=>t(()=>import("./file-editor-mllike-3c2dg9RT.js"),[]).then(e=>vr(e.oCaml))}),Lt.of({name:"Octave",extensions:["m"],load:()=>t(()=>import("./file-editor-octave-C4hdQ5Hf.js"),[]).then(e=>vr(e.octave))}),Lt.of({name:"Oz",extensions:["oz"],load:()=>t(()=>import("./file-editor-oz-DsOHt9n_.js"),[]).then(e=>vr(e.oz))}),Lt.of({name:"Pascal",extensions:["p","pas"],load:()=>t(()=>import("./file-editor-pascal-MWIkn1JH.js"),[]).then(e=>vr(e.pascal))}),Lt.of({name:"Perl",extensions:["pl","pm"],load:()=>t(()=>import("./file-editor-perl-D4U4Mn-f.js"),[]).then(e=>vr(e.perl))}),Lt.of({name:"Pig",extensions:["pig"],load:()=>t(()=>import("./file-editor-pig-DUTBITpC.js"),[]).then(e=>vr(e.pig))}),Lt.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load:()=>t(()=>import("./file-editor-powershell-akC7YIf9.js"),[]).then(e=>vr(e.powerShell))}),Lt.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load:()=>t(()=>import("./file-editor-properties-_nPj978X.js"),[]).then(e=>vr(e.properties))}),Lt.of({name:"ProtoBuf",extensions:["proto"],load:()=>t(()=>import("./file-editor-protobuf-B4y9do6W.js"),[]).then(e=>vr(e.protobuf))}),Lt.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load:()=>t(()=>import("./file-editor-pug-C_WDC1BE.js"),__vite__mapDeps([26,27])).then(e=>vr(e.pug))}),Lt.of({name:"Puppet",extensions:["pp"],load:()=>t(()=>import("./file-editor-puppet-Dbxp0vTs.js"),[]).then(e=>vr(e.puppet))}),Lt.of({name:"Q",extensions:["q"],load:()=>t(()=>import("./file-editor-q-mUfi2b_o.js"),[]).then(e=>vr(e.q))}),Lt.of({name:"R",alias:["rscript"],extensions:["r","R"],load:()=>t(()=>import("./file-editor-r-J5UZzFYw.js"),[]).then(e=>vr(e.r))}),Lt.of({name:"RPM Changes",load:()=>t(()=>import("./file-editor-rpm-DI_rRufH.js"),[]).then(e=>vr(e.rpmChanges))}),Lt.of({name:"RPM Spec",extensions:["spec"],load:()=>t(()=>import("./file-editor-rpm-DI_rRufH.js"),[]).then(e=>vr(e.rpmSpec))}),Lt.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load:()=>t(()=>import("./file-editor-ruby-SqZyEoLI.js"),[]).then(e=>vr(e.ruby))}),Lt.of({name:"SAS",extensions:["sas"],load:()=>t(()=>import("./file-editor-sas-Bqaci40L.js"),[]).then(e=>vr(e.sas))}),Lt.of({name:"Scala",extensions:["scala"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>vr(e.scala))}),Lt.of({name:"Scheme",extensions:["scm","ss"],load:()=>t(()=>import("./file-editor-scheme-Dtb5z51s.js"),[]).then(e=>vr(e.scheme))}),Lt.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load:()=>t(()=>import("./file-editor-shell-D65E6JiF.js"),[]).then(e=>vr(e.shell))}),Lt.of({name:"Sieve",extensions:["siv","sieve"],load:()=>t(()=>import("./file-editor-sieve-BBCrNNIa.js"),[]).then(e=>vr(e.sieve))}),Lt.of({name:"Smalltalk",extensions:["st"],load:()=>t(()=>import("./file-editor-smalltalk-C7J3IyEP.js"),[]).then(e=>vr(e.smalltalk))}),Lt.of({name:"Solr",load:()=>t(()=>import("./file-editor-solr-CZy78n9F.js"),[]).then(e=>vr(e.solr))}),Lt.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load:()=>t(()=>import("./file-editor-mllike-3c2dg9RT.js"),[]).then(e=>vr(e.sml))}),Lt.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load:()=>t(()=>import("./file-editor-sparql-DItxJg31.js"),[]).then(e=>vr(e.sparql))}),Lt.of({name:"Spreadsheet",alias:["excel","formula"],load:()=>t(()=>import("./file-editor-spreadsheet-CGlWr0eM.js"),[]).then(e=>vr(e.spreadsheet))}),Lt.of({name:"Squirrel",extensions:["nut"],load:()=>t(()=>import("./file-editor-clike-dMs5i294.js"),[]).then(e=>vr(e.squirrel))}),Lt.of({name:"Stylus",extensions:["styl"],load:()=>t(()=>import("./file-editor-stylus-Dd_3NjJ0.js"),[]).then(e=>vr(e.stylus))}),Lt.of({name:"Swift",extensions:["swift"],load:()=>t(()=>import("./file-editor-swift-B_XXVlXX.js"),[]).then(e=>vr(e.swift))}),Lt.of({name:"sTeX",load:()=>t(()=>import("./file-editor-stex-9_wePcov.js"),[]).then(e=>vr(e.stex))}),Lt.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load:()=>t(()=>import("./file-editor-stex-9_wePcov.js"),[]).then(e=>vr(e.stex))}),Lt.of({name:"SystemVerilog",extensions:["v","sv","svh"],load:()=>t(()=>import("./file-editor-verilog-C8061G8U.js"),[]).then(e=>vr(e.verilog))}),Lt.of({name:"Tcl",extensions:["tcl"],load:()=>t(()=>import("./file-editor-tcl-DxOxgKRU.js"),[]).then(e=>vr(e.tcl))}),Lt.of({name:"Textile",extensions:["textile"],load:()=>t(()=>import("./file-editor-textile-BuVhTOzU.js"),[]).then(e=>vr(e.textile))}),Lt.of({name:"TiddlyWiki",load:()=>t(()=>import("./file-editor-tiddlywiki-BgR6AEZu.js"),[]).then(e=>vr(e.tiddlyWiki))}),Lt.of({name:"Tiki wiki",load:()=>t(()=>import("./file-editor-tiki-ru5LTfYV.js"),[]).then(e=>vr(e.tiki))}),Lt.of({name:"TOML",extensions:["toml"],load:()=>t(()=>import("./file-editor-toml-BVJm5Fzd.js"),[]).then(e=>vr(e.toml))}),Lt.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load:()=>t(()=>import("./file-editor-troff-Ce85hlLp.js"),[]).then(e=>vr(e.troff))}),Lt.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load:()=>t(()=>import("./file-editor-ttcn-BTO1-gcW.js"),[]).then(e=>vr(e.ttcn))}),Lt.of({name:"TTCN_CFG",extensions:["cfg"],load:()=>t(()=>import("./file-editor-ttcn-cfg-DIH_dYzw.js"),[]).then(e=>vr(e.ttcnCfg))}),Lt.of({name:"Turtle",extensions:["ttl"],load:()=>t(()=>import("./file-editor-turtle-DMr_FkeC.js"),[]).then(e=>vr(e.turtle))}),Lt.of({name:"Web IDL",extensions:["webidl"],load:()=>t(()=>import("./file-editor-webidl-CGwyPRYs.js"),[]).then(e=>vr(e.webIDL))}),Lt.of({name:"VB.NET",extensions:["vb"],load:()=>t(()=>import("./file-editor-vb-UtVLDai5.js"),[]).then(e=>vr(e.vb))}),Lt.of({name:"VBScript",extensions:["vbs"],load:()=>t(()=>import("./file-editor-vbscript-a5NhL3_u.js"),[]).then(e=>vr(e.vbScript))}),Lt.of({name:"Velocity",extensions:["vtl"],load:()=>t(()=>import("./file-editor-velocity-BdD_26Jv.js"),[]).then(e=>vr(e.velocity))}),Lt.of({name:"Verilog",extensions:["v"],load:()=>t(()=>import("./file-editor-verilog-C8061G8U.js"),[]).then(e=>vr(e.verilog))}),Lt.of({name:"VHDL",extensions:["vhd","vhdl"],load:()=>t(()=>import("./file-editor-vhdl-JqRksxx8.js"),[]).then(e=>vr(e.vhdl))}),Lt.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load:()=>t(()=>import("./file-editor-xquery-CVDBqZPY.js"),[]).then(e=>vr(e.xQuery))}),Lt.of({name:"Yacas",extensions:["ys"],load:()=>t(()=>import("./file-editor-yacas-WY0UPJfi.js"),[]).then(e=>vr(e.yacas))}),Lt.of({name:"Z80",extensions:["z80"],load:()=>t(()=>import("./file-editor-z80-D8p3gKXp.js"),[]).then(e=>vr(e.z80))}),Lt.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load:()=>t(()=>import("./file-editor-mscgen-BaVD5lDT.js"),[]).then(e=>vr(e.mscgen))}),Lt.of({name:"Xù",extensions:["xu"],load:()=>t(()=>import("./file-editor-mscgen-BaVD5lDT.js"),[]).then(e=>vr(e.xu))}),Lt.of({name:"MsGenny",extensions:["msgenny"],load:()=>t(()=>import("./file-editor-mscgen-BaVD5lDT.js"),[]).then(e=>vr(e.msgenny))}),Lt.of({name:"Vue",extensions:["vue"],load:()=>t(()=>import("./file-editor-index-D_riXMER.js"),__vite__mapDeps([28,1,7,2,5,8,3])).then(e=>e.vue())}),Lt.of({name:"Angular Template",load:()=>t(()=>import("./file-editor-index-BhOxVDWT.js"),__vite__mapDeps([29,1,7,2,5,8,3])).then(e=>e.angular())})],wr="#e06c75",xr="#abb2bf",kr="#7d8799",Cr="#d19a66",_r="#2c313a",Sr="#282c34",Ar="#353a42",Mr="#528bff",Tr=Rt.theme({"&":{color:xr,backgroundColor:Sr},".cm-content":{caretColor:Mr},".cm-cursor, .cm-dropCursor":{borderLeftColor:Mr},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:xr},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Sr,color:kr,border:"none"},".cm-activeLineGutter":{backgroundColor:_r},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Ar},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Ar,borderBottomColor:Ar},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:_r,color:xr}}},{dark:!0}),Er=Bt.define([{tag:zt.keyword,color:"#c678dd"},{tag:[zt.name,zt.deleted,zt.character,zt.propertyName,zt.macroName],color:wr},{tag:[zt.function(zt.variableName),zt.labelName],color:"#61afef"},{tag:[zt.color,zt.constant(zt.name),zt.standard(zt.name)],color:Cr},{tag:[zt.definition(zt.name),zt.separator],color:xr},{tag:[zt.typeName,zt.className,zt.number,zt.changed,zt.annotation,zt.modifier,zt.self,zt.namespace],color:"#e5c07b"},{tag:[zt.operator,zt.operatorKeyword,zt.url,zt.escape,zt.regexp,zt.link,zt.special(zt.string)],color:"#56b6c2"},{tag:[zt.meta,zt.comment],color:kr},{tag:zt.strong,fontWeight:"bold"},{tag:zt.emphasis,fontStyle:"italic"},{tag:zt.strikethrough,textDecoration:"line-through"},{tag:zt.link,color:kr,textDecoration:"underline"},{tag:zt.heading,fontWeight:"bold",color:wr},{tag:[zt.atom,zt.bool,zt.special(zt.variableName)],color:Cr},{tag:[zt.processingInstruction,zt.string,zt.inserted],color:"#98c379"},{tag:zt.invalid,color:"#ffffff"}]),Lr=[Tr,Pt(Er)],Or={encodeCharacter:e=>e,encodeNodeStart:e=>e.type.name,encodeNodeEnd:e=>-function(e){let t=e.schema.cached.changeSetIDs||(e.schema.cached.changeSetIDs=Object.create(null)),n=t[e.name];return null==n&&(t[e.name]=n=Object.keys(e.schema.nodes).indexOf(e.name)+1),n}(e.type),compareTokens:(e,t)=>e===t};function Ir(e,t,n,r,o){for(let i=0,a=0;i<e.childCount;i++){let s=e.child(i),l=a+s.nodeSize,c=Math.max(a,n),d=Math.min(l,r);if(c<d)if(s.isText)for(let e=c;e<d;e++)o.push(t.encodeCharacter(s.text.charCodeAt(e-a),s.marks));else s.isLeaf?o.push(t.encodeNodeStart(s)):(c==a&&o.push(t.encodeNodeStart(s)),Ir(s.content,t,Math.max(a+1,c)-a-1,Math.min(l-1,d)-a-1,o),d==l&&o.push(t.encodeNodeEnd(s)));a=l}return o}function Rr(e,t){return Math.min(15,Math.max(2,Math.floor(Math.max(e,t)/10)))}function Pr(e,t,n,r=Or){let o=Ir(e,r,n.fromA,n.toA,[]),i=Ir(t,r,n.fromB,n.toB,[]),a=0,s=o.length,l=i.length,c=r.compareTokens;for(;a<o.length&&a<i.length&&c(o[a],i[a]);)a++;if(a==o.length&&a==i.length)return[];for(;s>a&&l>a&&c(o[s-1],i[l-1]);)s--,l--;if(s==a||l==a||s==l&&s==a+1)return[n.slice(a,s,a,l)];let d=s-a,u=l-a,h=Math.min(5e3,d+u),p=[],m=[];for(let f=2*(h+1),g=0;g<f;g++)m[g]=-1;for(let f=0;f<=h;f++){for(let e=-f;e<=f;e+=2){let t=m[e+1+h],r=m[e-1+h],g=t<r?r:t+1,v=g+e;for(;g<d&&v<u&&c(o[a+g],i[a+v]);)g++,v++;if(m[e+h]=g,g>=d&&v>=u){let t=[],r=Rr(s-a,l-a),o=-1,i=-1,c=-1,d=-1,u=(e,a,s,l)=>{o>-1&&o<a+r?(o=e,c=s):(o>-1&&t.push(n.slice(o,i,c,d)),o=e,i=a,c=s,d=l)};for(let n=f-1;n>=0;n--){let t=m[e+1+h],r=m[e-1+h];t<r?(e--,g=r+a,v=g+e,u(g,g,v,v+1)):(e++,g=t+a,v=g+e,u(g,g+1,v,v)),m=p[n>>1]}return o>-1&&t.push(n.slice(o,i,c,d)),t.reverse()}}f%2==0&&p.push(m.slice())}return[n.slice(a,s,a,l)]}let Br,zr=class e{constructor(e,t){this.length=e,this.data=t}cut(t){return t==this.length?this:new e(t,this.data)}static slice(t,n,r){if(n==r)return e.none;if(0==n&&r==e.len(t))return t;let o=[];for(let e=0,i=0;i<r;e++){let a=t[e],s=i+a.length,l=Math.min(r,s)-Math.max(n,i);l>0&&o.push(a.cut(l)),i=s}return o}static join(t,n,r){if(0==t.length)return n;if(0==n.length)return t;let o=r(t[t.length-1].data,n[0].data);if(null==o)return t.concat(n);let i=t.slice(0,t.length-1);i.push(new e(t[t.length-1].length+n[0].length,o));for(let e=1;e<n.length;e++)i.push(n[e]);return i}static len(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].length;return t}};zr.none=[];class Dr{constructor(e,t,n,r,o,i){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r,this.deleted=o,this.inserted=i}get lenA(){return this.toA-this.fromA}get lenB(){return this.toB-this.fromB}slice(e,t,n,r){return 0==e&&0==n&&t==this.toA-this.fromA&&r==this.toB-this.fromB?this:new Dr(this.fromA+e,this.fromA+t,this.fromB+n,this.fromB+r,zr.slice(this.deleted,e,t),zr.slice(this.inserted,n,r))}static merge(e,t,n){if(0==e.length)return t;if(0==t.length)return e;let r=[];for(let o=0,i=0,a=e[0],s=t[0];;){if(!a&&!s)return r;if(a&&(!s||a.toB<s.fromA)){let n=i?t[i-1].toB-t[i-1].toA:0;r.push(0==n?a:new Dr(a.fromA,a.toA,a.fromB+n,a.toB+n,a.deleted,a.inserted)),a=o++==e.length?null:e[o]}else if(s&&(!a||s.toA<a.fromB)){let n=o?e[o-1].toB-e[o-1].toA:0;r.push(0==n?s:new Dr(s.fromA-n,s.toA-n,s.fromB,s.toB,s.deleted,s.inserted)),s=i++==t.length?null:t[i]}else{let l=Math.min(a.fromB,s.fromA),c=Math.min(a.fromA,s.fromA-(o?e[o-1].toB-e[o-1].toA:0)),d=c,u=Math.min(s.fromB,a.fromB+(i?t[i-1].toB-t[i-1].toA:0)),h=u,p=zr.none,m=zr.none,f=!1,g=!1;for(;;){let r=a?l>=a.fromB?a.toB:a.fromB:2e8,c=s?l>=s.fromA?s.toA:s.fromA:2e8,u=Math.min(r,c),v=a&&l>=a.fromB,y=s&&l>=s.fromA;if(!v&&!y)break;v&&l==a.fromB&&!f&&(p=zr.join(p,a.deleted,n),d+=a.lenA,f=!0),v&&!y&&(m=zr.join(m,zr.slice(a.inserted,l-a.fromB,u-a.fromB),n),h+=u-l),y&&l==s.fromA&&!g&&(m=zr.join(m,s.inserted,n),h+=s.lenB,g=!0),y&&!v&&(p=zr.join(p,zr.slice(s.deleted,l-s.fromA,u-s.fromA),n),d+=u-l),v&&u==a.toB&&(a=o++==e.length?null:e[o],f=!1),y&&u==s.toA&&(s=i++==t.length?null:t[i],g=!1),l=u}(c<d||u<h)&&r.push(new Dr(c,d,u,h,p,m))}}}static fromJSON(e){return new Dr(e.fromA,e.toA,e.fromB,e.toB,e.deleted.map(e=>new zr(e.length,e.data)),e.inserted.map(e=>new zr(e.length,e.data)))}toJSON(){return this}}try{Br=new RegExp("[\\p{Alphabetic}_]","u")}catch(CT){}class Nr{constructor(e,t){this.config=e,this.changes=t}addSteps(e,t,n){let r=[];for(let s=0;s<t.length;s++){let e=Array.isArray(n)?n[s]:n,o=0;t[s].forEach((t,n,i,a)=>{r.push(new Dr(t+o,n+o,i,a,t==n?zr.none:[new zr(n-t,e)],i==a?zr.none:[new zr(a-i,e)])),o=a-i-(n-t)})}if(0==r.length)return this;let o=Hr(r,this.config.combine),i=Dr.merge(this.changes,o,this.config.combine),a=i;for(let s=0;s<a.length;s++){let t=a[s];if(t.fromA==t.toA||t.fromB==t.toB||!o.some(e=>e.toB>t.fromB&&e.fromB<t.toB))continue;let n=Pr(this.config.doc.content,e.content,t,this.config.encoder);1==n.length&&0==n[0].fromB&&n[0].toB==t.toB-t.fromB||(a==i&&(a=i.slice()),1==n.length?a[s]=n[0]:(a.splice(s,1,...n),s+=n.length-1))}return new Nr(this.config,a)}get startDoc(){return this.config.doc}map(e){let t=t=>{let n=e(t);return n===t.data?t:new zr(t.length,n)};return new Nr(this.config,this.changes.map(e=>new Dr(e.fromA,e.toA,e.fromB,e.toB,e.deleted.map(t),e.inserted.map(t))))}changedRange(e,t){if(e==this)return null;let n=t&&function(e){let t=qr(e);if(!t)return null;let n=qr(e.map(e=>e.invert()).reverse());return{fromA:n.from,toA:n.to,fromB:t.from,toB:t.to}}(t),r=n?n.toB-n.fromB-(n.toA-n.fromA):0;function o(e){return!n||e<=n.fromA?e:e+r}let i=n?n.fromB:2e8,a=n?n.toB:-2e8;function s(e,t=e){i=Math.min(e,i),a=Math.max(t,a)}let l=this.changes,c=e.changes;for(let d=0,u=0;d<l.length&&u<c.length;){let e=l[d],t=c[u];e&&t&&jr(e,t,o)?(d++,u++):t&&(!e||o(e.fromB)>=t.fromB)?(s(t.fromB,t.toB),u++):(s(o(e.fromB),o(e.toB)),d++)}return i<=a?{from:i,to:a}:null}static create(e,t=(e,t)=>e===t?e:null,n=Or,r=[]){return new Nr({combine:t,doc:e,encoder:n},r)}}function Hr(e,t,n=0,r=e.length){if(r==n+1)return[e[n]];let o=n+r>>1;return Dr.merge(Hr(e,t,n,o),Hr(e,t,o,r),t)}function qr(e){let t=2e8,n=-2e8;for(let r=0;r<e.length;r++){let o=e[r];2e8!=t&&(t=o.map(t,-1),n=o.map(n,1)),o.forEach((e,r,o,i)=>{t=Math.min(t,o),n=Math.max(n,i)})}return 2e8==t?null:{from:t,to:n}}function jr(e,t,n){return n(e.fromB)==t.fromB&&n(e.toB)==t.toB&&Vr(e.deleted,t.deleted)&&Vr(e.inserted,t.inserted)}function Vr(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n].length!=t[n].length||e[n].data!==t[n].data)return!1;return!0}function Fr(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-diff",...t}}),e}function $r(e,t,n){const r=n.get(e);if(null!=r)return r;const o=[String(t.encodeNodeStart(e))];if(e.isText){const n=e.text;for(let r=0;r<n.length;r++)o.push(":"+String(t.encodeCharacter(n.charCodeAt(r),e.marks)))}else e.content.forEach(e=>{o.push("/"+$r(e,t,n))});o.push("\\"+String(t.encodeNodeEnd(e)));const i=o.join("");return n.set(e,i),i}function Wr(e,t,n){const r=[];let o=0;return e.content.forEach(e=>{r.push({node:e,offset:o,size:e.nodeSize,signature:$r(e,n.encoder,n.sigCache)}),o+=e.nodeSize}),{node:e,contentStart:t,content:r}}function Ur(e,t,n){return Dr.fromJSON({fromA:e.fromA+t,toA:e.toA+t,fromB:e.fromB+n,toB:e.toB+n,deleted:e.deleted.map(e=>({length:e.length,data:e.data})),inserted:e.inserted.map(e=>({length:e.length,data:e.data}))})}function Gr(e,t){const n=e.content;if(t<n.length)return e.contentStart+n[t].offset;if(t>0){const r=n[t-1];return e.contentStart+r.offset+r.size}return e.contentStart+e.node.content.size}function Zr(e,t,n){return Dr.fromJSON({fromA:t,toA:t+e.size,fromB:n,toB:n,deleted:[{length:e.size,data:null}],inserted:[]})}function Xr(e,t,n){return Dr.fromJSON({fromA:t,toA:t,fromB:n,toB:n+e.size,deleted:[],inserted:[{length:e.size,data:null}]})}function Kr(e,t,n,r,o){if(e.childCount>500||t.childCount>500)return function(e,t,n,r,o){const i=new h(0,e.content.size,new p(t.content,0,0));return Nr.create(e,void 0,o.encoder).addSteps(t,[i.getMap()],null).changes.map(e=>Ur(e,n,r))}(e,t,n,r,o);const i=Wr(e,n,o),a=Wr(t,r,o),s=function(e,t){const n=e.length,r=t.length,o=Array.from({length:n+1},()=>Array.from({length:r+1},()=>0));for(let l=n-1;l>=0;l--)for(let n=r-1;n>=0;n--)e[l].signature===t[n].signature?o[l][n]=o[l+1][n+1]+1:o[l][n]=Math.max(o[l+1][n],o[l][n+1]);const i=[];let a=0,s=0;for(;a<n&&s<r;)e[a].signature===t[s].signature?(i.push([a,s]),a++,s++):o[a+1][s]>=o[a][s+1]?a++:s++;return i}(i.content,a.content),l=[];let c=0,d=0;for(const[u,h]of s)Yr(i,a,{oldStart:c,oldEnd:u,newStart:d,newEnd:h},o,l),c=u+1,d=h+1;return Yr(i,a,{oldStart:c,oldEnd:i.content.length,newStart:d,newEnd:a.content.length},o,l),l}function Yr(e,t,n,r,o){const i=e.content,a=t.content;let s=n.oldStart,l=n.newStart;for(;s<n.oldEnd||l<n.newEnd;){const c=s<n.oldEnd?i[s]:null,d=l<n.newEnd?a[l]:null,u=c&&d&&c.node.type===d.node.type;if(c&&d&&u)o.push(...Jr(e,t,c,d,r)),s++,l++;else{if(c&&(!d||!u)){const n=e.contentStart+c.offset;o.push(Zr(c,n,Gr(t,l))),s++;continue}if(d){const n=t.contentStart+d.offset;o.push(Xr(d,Gr(e,s),n)),l++}}}}function Jr(e,t,n,r,o){const i=e.contentStart+n.offset,a=t.contentStart+r.offset;return function(e,t){if(e.type!==t.type)return!1;const n=e.type;return!n.isTextblock&&!n.isAtom&&!0!==n.spec.code&&!!n.isBlock}(n.node,r.node)&&function(e,t,n){return n.encodeNodeStart(e)===n.encodeNodeStart(t)}(n.node,r.node,o.encoder)?Kr(n.node,r.node,i+1,a+1,o):function(e,t,n){const r=e.parent.copy(m.from(e.node)),o=t.parent.copy(m.from(t.node)),i=new h(0,r.content.size,new p(o.content,0,0));return Nr.create(r,void 0,n.encoder).addSteps(o,[i.getMap()],null).changes.map(n=>Ur(n,e.abs,t.abs))}({node:n.node,parent:e.node,abs:i},{node:r.node,parent:t.node,abs:a},o)}function Qr(e,t,n){const r=function(e={}){const t=new WeakMap,n=new WeakMap;function r(e){let n=t.get(e);if(null!=n)return n;const r=e.attrs,o=r?Object.keys(r).filter(e=>null!=r[e]).sort():[];if(0===o.length)n=e.type.name;else{const t={};for(const e of o)t[e]=r[e];n=`${e.type.name}:${JSON.stringify(t)}`}return t.set(e,n),n}return{encodeCharacter:(e,t)=>{if(0===t.length)return e;let o=n.get(t);return null==o&&(o=t.map(r).join(","),n.set(t,o)),`${e}:${o}`},encodeNodeStart:t=>{const n=t.attrs;if(n&&Object.keys(n).length>0){const r=e[t.type.name]??[],o=Object.keys(n).filter(e=>{if(r.includes(e))return!1;const o=t.type.spec.attrs?.[e]?.default;return n[e]!==o});if(o.length>0){const e={};for(const t of o.sort())e[t]=n[t];return`${t.type.name}:${JSON.stringify(e)}`}}return t.type.name},encodeNodeEnd:e=>{const t=e.type.schema,n=t.cached.changeSetIDs||(t.cached.changeSetIDs=Object.create(null));let r=n[e.type.name];return null==r&&(n[e.type.name]=r=Object.keys(t.nodes).indexOf(e.type.name)+1),-r},compareTokens:(e,t)=>e===t}}(n?.ignoreAttrs),o={encoder:r,sigCache:new WeakMap},i=e.content.size,a=t.content.size,s=n?.range;if(null==s)return Kr(e,t,0,0,o);const l=Math.min(i,a),c=Math.max(0,Math.min(s.from??0,l)),d=Math.max(c,Math.min(s.to??l,l));if(c===d)return[];if(0===c&&d===l&&i===a)return Kr(e,t,0,0,o);const u=function(e,t,n,r,o){const i=e.resolve(n),a=e.resolve(r),s=t.resolve(n),l=t.resolve(r),c=i.sharedDepth(r);if(s.sharedDepth(r)!==c)throw new RangeError(`computeDocDiff: range [${n}, ${r}) resolves to different sharedDepth in old and new docs`);for(let f=0;f<=c;f++){if(o.encodeNodeStart(i.node(f))!==o.encodeNodeStart(s.node(f)))throw new RangeError(`computeDocDiff: ancestor at depth ${f} differs in type or non-ignored attrs along the path to the shared ancestor`);if(i.start(f)!==s.start(f))throw new RangeError(`computeDocDiff: ancestor at depth ${f} starts at different absolute positions in old and new docs (content before the range differs in size)`)}const d=i.node(c);if(d.isTextblock)throw new RangeError(`computeDocDiff: range [${n}, ${r}) lands inside a textblock; widen the range to a block boundary`);if(i.depth!==c||a.depth!==c||s.depth!==c||l.depth!==c)throw new RangeError(`computeDocDiff: range [${n}, ${r}) endpoints must be aligned to child boundaries of the shared ancestor`);const u=s.node(c),h=i.start(c),p=n-h,m=r-h;return{oldCut:d.copy(d.content.cut(p,m)),newCut:u.copy(u.content.cut(p,m)),cutAbsStart:n}}(e,t,c,d,r);return Kr(u.oldCut,u.newCut,u.cutAbsStart,u.cutAbsStart,o)}Nr.computeDiff=Pr;var eo=a({ignoreAttrs:{heading:["id"]}},"diffConfig");Fr(eo,{displayName:"Ctx<diffConfig>",group:"Diff"});var to=new d("MILKDOWN_DIFF");function no(e){return e.changes.filter(t=>!function(e,t){return t.some(t=>e.fromB<t.toB&&e.toB>t.fromB)}(t,e.rejectedRanges))}var ro=s(e=>{const t=e.get(eo.key);return new c({key:to,state:{init:()=>null,apply(e,n,r,o){const i=e.getMeta(to);if(!n){if("start"===i?.type){const e=Qr(o.doc,i.newDoc,{ignoreAttrs:t.ignoreAttrs});return{newDoc:i.newDoc,changes:e,rejectedRanges:[],active:!0}}return null}let a,s=n;if(e.docChanged&&s.active&&(s=function(e,t,n){const r=Qr(e,t.newDoc,n);return{...t,changes:r}}(o.doc,s,{ignoreAttrs:t.ignoreAttrs})),!i)return s;switch(i.type){case"start":{const e=Qr(o.doc,i.newDoc,{ignoreAttrs:t.ignoreAttrs});return{newDoc:i.newDoc,changes:e,rejectedRanges:[],active:!0}}case"accept":case"acceptRange":a=s;break;case"reject":a={...s,rejectedRanges:[...s.rejectedRanges,{fromB:i.fromB,toB:i.toB}]};break;case"rejectRange":a={...s,rejectedRanges:[...s.rejectedRanges,{fromB:i.range.fromB,toB:i.range.toB}]};break;case"acceptAll":case"clear":return null;default:return s}return a.active&&0===no(a).length?null:a}},filterTransaction:(e,t)=>!to.getState(t)?.active||!!e.getMeta(to)||!e.docChanged})});Fr(ro,{displayName:"Prose<diff>",group:"Diff"});var oo=l("StartDiffReview",e=>t=>(n,r)=>{if(null==t)return!1;const o=e.get(u)(t);return!!o&&(r&&r(n.tr.setMeta(to,{type:"start",newDoc:o})),!0)});Fr(oo,{displayName:"Command<startDiffReview>",group:"Diff"});var io=l("StartDiffReviewFromDoc",()=>e=>(t,n)=>!!e&&e.type===t.doc.type&&(n&&n(t.tr.setMeta(to,{type:"start",newDoc:e})),!0));Fr(io,{displayName:"Command<startDiffReviewFromDoc>",group:"Diff"});var ao=l("AcceptDiffChunk",()=>e=>(t,n)=>{if(null==e)return!1;const r=to.getState(t);if(!r)return!1;const o=no(r)[e];if(!o)return!1;if(n){const i=r.newDoc.slice(o.fromB,o.toB);let a=t.tr.replace(o.fromA,o.toA,i);a=a.setMeta(to,{type:"accept",changeIndex:e}),n(a)}return!0});Fr(ao,{displayName:"Command<acceptDiffChunk>",group:"Diff"});var so=l("RejectDiffChunk",()=>e=>(t,n)=>{if(null==e)return!1;const r=to.getState(t);if(!r)return!1;const o=no(r)[e];return!!o&&(n&&n(t.tr.setMeta(to,{type:"reject",fromB:o.fromB,toB:o.toB})),!0)});Fr(so,{displayName:"Command<rejectDiffChunk>",group:"Diff"});var lo=l("AcceptDiffRange",()=>e=>(t,n)=>{if(!e)return!1;const r=to.getState(t);if(!r)return!1;if(n){const o=r.newDoc.slice(e.fromB,e.toB);let i=t.tr.replace(e.fromA,e.toA,o);i=i.setMeta(to,{type:"acceptRange",range:e}),n(i)}return!0});Fr(lo,{displayName:"Command<acceptDiffRange>",group:"Diff"});var co=l("RejectDiffRange",()=>e=>(t,n)=>!!e&&!!to.getState(t)&&(n&&n(t.tr.setMeta(to,{type:"rejectRange",range:e})),!0));Fr(co,{displayName:"Command<rejectDiffRange>",group:"Diff"});var uo=l("AcceptAllDiffs",()=>()=>(e,t)=>{const n=to.getState(e);return!!n&&(t&&t((0===n.rejectedRanges.length?e.tr.replaceWith(0,e.doc.content.size,n.newDoc.content):function(e,t){const n=no(t);for(let r=n.length-1;r>=0;r--){const o=n[r],i=t.newDoc.slice(o.fromB,o.toB);e=e.replace(o.fromA,o.toA,i)}return e}(e.tr,n)).setMeta(to,{type:"acceptAll"})),!0)});Fr(uo,{displayName:"Command<acceptAllDiffs>",group:"Diff"});var ho=l("ClearDiffReview",()=>()=>(e,t)=>!!to.getState(e)&&(t&&t(e.tr.setMeta(to,{type:"clear"})),!0));Fr(ho,{displayName:"Command<clearDiffReview>",group:"Diff"});var po=[eo,ro,oo,io,ao,lo,so,co,uo,ho],mo=Object.defineProperty,fo=Object.getOwnPropertySymbols,go=Object.prototype.hasOwnProperty,vo=Object.prototype.propertyIsEnumerable,yo=(e,t,n)=>t in e?mo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bo=(e,t)=>{for(var n in t||(t={}))go.call(t,n)&&yo(e,n,t[n]);if(fo)for(var n of fo(t))vo.call(t,n)&&yo(e,n,t[n]);return e};function wo(e,t){return Object.assign(e,{meta:bo({package:"@milkdown/components"},t)}),e}const xo="milkdown-diff",ko=a({acceptLabel:"Accept",rejectLabel:"Reject",customBlockTypes:[]},"diffComponentConfig");function Co(e,t,n){if(t===n)return!1;const r=e.resolve(t),o=e.resolve(n);return r.index(0)!==(0===o.depth?Math.max(0,o.index(0)-1):o.index(0))}function _o(e,t,n){if(t>=n)return!1;const r=e.resolve(t),o=e.resolve(n);if(r.sameParent(o)&&r.parent.isTextblock)return!1;let i=!1;return e.nodesBetween(t,n,(e,r)=>{if(i)return!1;if(!e.isBlock)return!0;const o=r+e.nodeSize;return!(r>=t&&o<=n&&(i=!0,1))}),i}function So(e,t,n){if(n!==e.content.size)return!1;const r=e.resolve(t);if(0!==r.depth)return!1;for(let o=r.index(0);o<e.childCount;o++){const t=e.child(o);if("paragraph"!==t.type.name||t.content.size>0)return!1}return!0}function Ao(e,t){const n=e.resolve(t);for(let r=n.depth;r>=1;r--)if(n.node(r).isTextblock)return n.before(r);return t}function Mo(e,t,n,r){let o=0;for(let i=0;i<e.childCount;i++){const a=e.child(i),s=o+a.nodeSize;if(o>=n)break;s>t&&o<n&&r(a,o,s),o=s}}function To(e,t,n,r){Mo(e,t,n,(t,n,o)=>{o===e.content.size&&"paragraph"===t.type.name&&0===t.content.size||r.push(v.node(n,o,{class:`${xo}-removed-block`}))})}function Eo(e,t,n=!1){if(t<0||t>e.content.size)return null;const r=e.resolve(Math.min(t,e.content.size));if(r.depth>=1)return{from:r.before(1),to:r.after(1)};if(n){const e=r.nodeBefore;if(e)return{from:t-e.nodeSize,to:t};const n=r.nodeAfter;if(n)return{from:t,to:t+n.nodeSize}}else{const e=r.nodeAfter;if(e)return{from:t,to:t+e.nodeSize};const n=r.nodeBefore;if(n)return{from:t-n.nodeSize,to:t}}return null}function Lo(e,t,n){if(t<0||t>e.content.size)return null;const r=e.resolve(Math.min(t,e.content.size));for(let o=r.depth;o>=0;o--){const e=r.node(o).type.name;if(n.has(e))return e}return null}function Oo(e,t,n,r=!1){const o=Lo(e,t,n);if(o)return o;const i=e.resolve(Math.min(Math.max(t,0),e.content.size)),a=r?i.nodeBefore:i.nodeAfter;return a&&n.has(a.type.name)?a.type.name:null}function Io(e,t,n,r){return e<r&&t>n}function Ro(e,t,n,r){return t===n?null!=Lo(e,t,r):null!=Oo(e,t,r)||null!=Oo(e,n,r,!0)}function Po(e,t,n){const r=e.resolve(n.fromA);if(!r.parent.isTextblock||r.depth<1)return null;if(!r.node(1).isTextblock)return null;const o=r.after(1),i=t.resolve(n.fromB);let a;if(i.depth>=1&&i.node(1).isTextblock?(a=i.after(1),a>n.toB&&(a=n.toB)):a=n.fromB,o>=n.toA&&a>=n.toB)return null;const s=[];return(o>n.fromA||a>n.fromB)&&s.push({fromA:n.fromA,toA:Math.min(o,n.toA),fromB:n.fromB,toB:a,isBlock:!1}),(n.toA>o||n.toB>a)&&s.push({fromA:o,toA:Math.max(o,n.toA),fromB:a,toB:n.toB,isBlock:!0}),s.length>1?s:null}function Bo(e,t,n,r){return Ro(t,e.fromA,e.toA,r)||Ro(n,e.fromB,e.toB,r)}function zo(e,t,n,r){return t===n?null==Lo(e,t,r)?null:Eo(e,t):null!=Oo(e,t,r)?Eo(e,t):null!=Oo(e,n,r,!0)?Eo(e,n,!0):null}wo(ko,{displayName:"Ctx<diffComponentConfig>",group:"DiffComponent"});const Do=new d("MILKDOWN_DIFF_DECORATION"),No=s(e=>{const t=e.get(ko.key);return new c({key:Do,state:{init:()=>f.empty,apply(n,r,o,i){const a=to.getState(i);return(null==a?void 0:a.active)?n.getMeta(to)||n.docChanged?function(e,t,n,r){const o=[],i=e.get(g),a=new Set(r.customBlockTypes),s=function(e,t,n,r){var o,i,a,s;const l=[],c=new Set;for(let d=0;d<e.length;d++){if(c.has(d))continue;const u=e[d];if(!Bo(u,t,n,r)){l.push({fromA:u.fromA,toA:u.toA,fromB:u.fromB,toB:u.toB,isCustomBlock:!1});continue}const h=zo(t,u.fromA,u.toA,r),p=zo(n,u.fromB,u.toB,r),m={fromA:Math.min(null!=(o=null==h?void 0:h.from)?o:u.fromA,u.fromA),toA:Math.max(null!=(i=null==h?void 0:h.to)?i:u.toA,u.toA),fromB:Math.min(null!=(a=null==p?void 0:p.from)?a:u.fromB,u.fromB),toB:Math.max(null!=(s=null==p?void 0:p.to)?s:u.toB,u.toB),isCustomBlock:!0};c.add(d);for(let t=d+1;t<e.length;t++){if(c.has(t))continue;const n=e[t],r=h&&Io(n.fromA,n.toA,h.from,h.to),o=p&&Io(n.fromB,n.toB,p.from,p.to);(r||o)&&(c.add(t),m.fromA=Math.min(m.fromA,n.fromA),m.toA=Math.max(m.toA,n.toA),m.fromB=Math.min(m.fromB,n.fromB),m.toB=Math.max(m.toB,n.toB))}const f=[];for(let e=0;e<l.length;e++){const t=l[e];if(!t.isCustomBlock)continue;const n=Io(m.fromA,m.toA,t.fromA,t.toA),r=Io(m.fromB,m.toB,t.fromB,t.toB);(n||r)&&(m.fromA=Math.min(m.fromA,t.fromA),m.toA=Math.max(m.toA,t.toA),m.fromB=Math.min(m.fromB,t.fromB),m.toB=Math.max(m.toB,t.toB),f.push(e))}for(let e=f.length-1;e>=0;e--)l.splice(f[e],1);l.push(m)}return l}(no(n),t,n.newDoc,a);!function(e,t){const n=function(e){let t=e.content.size;for(let n=e.childCount-1;n>=0;n--){const r=e.child(n);if("paragraph"!==r.type.name||r.content.size>0)break;t-=r.nodeSize}return t}(t);if(n!==t.content.size)for(const r of e)r.fromA===r.toA&&r.fromB<r.toB&&r.fromA>=n&&(r.fromA=n,r.toA=n)}(s,t);for(let l=0;l<s.length;l++){const e=s[l],a=e.fromA<e.toA,c=e.fromB<e.toB;if(a&&!c&&So(t,e.fromA,e.toA))continue;const d=a&&Co(t,e.fromA,e.toA),u=a&&_o(t,e.fromA,e.toA),h=c&&_o(n.newDoc,e.fromB,e.toB),p=a&&!d&&!u&&!e.isCustomBlock&&!h,m=(d||u||h)&&!p;if(m&&!e.isCustomBlock){const a=Po(t,n.newDoc,e);if(a){Ho({doc:t,newDoc:n.newDoc,segments:a,change:e,changeIndex:l,commands:i,acceptLabel:r.acceptLabel,rejectLabel:r.rejectLabel,decorations:o});continue}}a&&(e.isCustomBlock||m?To(t,e.fromA,e.toA,o):o.push(v.inline(e.fromA,e.toA,{class:`${xo}-removed`})));const f=a?e.toA:e.fromA,g=m?Ao(t,f):f;if(c){const t=qo(n.newDoc,e,m);o.push(v.widget(g,t,{side:-1,key:`added-${l}`}))}const y=jo({commands:i,isBlockLevel:m,change:e,acceptLabel:r.acceptLabel,rejectLabel:r.rejectLabel});o.push(v.widget(g,y,{side:m?-1:1,key:`controls-${l}`}))}return f.create(t,o)}(e,i.doc,a,t):r.map(n.mapping,n.doc):f.empty}},props:{decorations(e){var t;return null!=(t=Do.getState(e))?t:f.empty}}})});function Ho({doc:e,newDoc:t,segments:n,change:r,changeIndex:o,commands:i,acceptLabel:a,rejectLabel:s,decorations:l}){for(let h=0;h<n.length;h++){const r=n[h],i=r.fromA<r.toA,a=r.fromB<r.toB;if(i&&(r.isBlock?To(e,r.fromA,r.toA,l):l.push(v.inline(r.fromA,r.toA,{class:`${xo}-removed`}))),a){const n=r.isBlock?Ao(e,i?r.toA:r.fromA):i?r.toA:r.fromA,a=qo(t,r,r.isBlock);l.push(v.widget(n,a,{side:-1,key:`added-${o}-${h}`}))}}const c=n[n.length-1],d=Ao(e,c.isBlock?c.fromA<c.toA?c.toA:c.fromA:r.toA),u=jo({commands:i,isBlockLevel:!0,change:r,acceptLabel:a,rejectLabel:s});l.push(v.widget(d,u,{side:-1,key:`controls-${o}`}))}function qo(e,t,n){var r;const o=document.createElement(n?"div":"span");o.className=`${xo}-added`,o.contentEditable="false",n&&o.classList.add(`${xo}-added-block`);const i=y.fromSchema(e.type.schema);if(n){const n=function(e,t,n){const r=[];let o=!0,i=-1,a=-1;return Mo(e,t,n,(e,t,n)=>{-1===i&&(i=t),a=n,r.push(e)}),0!==r.length&&i===t&&a===n||(o=!1),o?r:[]}(e,t.fromB,t.toB);if(n.length>0){const e=document.createDocumentFragment();for(const t of n)e.appendChild(i.serializeNode(t));return o.appendChild(e),o}}const a=e.slice(t.fromB,t.toB),s=i.serializeFragment(a.content);if(o.appendChild(s),!(null==(r=o.textContent)?void 0:r.trim())&&!o.querySelector("img, video, audio, canvas, svg")){const n=e.textBetween(t.fromB,t.toB,"\n","\n");n.trim()&&(o.textContent=n)}return o}function jo({commands:e,isBlockLevel:t,change:n,acceptLabel:r,rejectLabel:o}){const i=document.createElement(t?"div":"span");i.className=`${xo}-controls`,i.contentEditable="false",t&&i.classList.add(`${xo}-controls-block`);const a=t=>r=>{r.preventDefault(),r.stopPropagation();const o={fromA:n.fromA,toA:n.toA,fromB:n.fromB,toB:n.toB},i="accept"===t?lo.key:co.key;e.call(i,o)},s=document.createElement("button");s.className=`${xo}-accept`,s.textContent=r,s.addEventListener("click",a("accept"));const l=document.createElement("button");return l.className=`${xo}-reject`,l.textContent=o,l.addEventListener("click",a("reject")),i.appendChild(s),i.appendChild(l),i}wo(No,{displayName:"Prose<diffDecoration>",group:"DiffComponent"});const Vo=[ko,No];function Fo(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-streaming",...t}}),e}var $o=a({throttleMs:100,scrollFollow:!0,diffReviewOnEnd:!1,ignoreAttrs:{heading:["id"]}},"streamingConfig");function Wo(e){if(e.parent.type.spec.code)return{type:"plain-text",preserveNewlines:!0};for(let t=e.depth;t>0;t--)if("table"===e.node(t).type.name)return{type:"plain-text",preserveNewlines:!1};return e.depth>=1?{type:"split-block"}:{type:"block"}}function Uo(e){if(0===e.childCount)return e;const t=e.lastChild;return"paragraph"===t.type.name&&0===t.content.size?e.cut(0,e.size-t.nodeSize):e}Fo($o,{displayName:"Ctx<streamingConfig>",group:"Streaming"});var Go=/[*_~`[\\<]/;function Zo(e,t,n){if(!n)return m.empty;if(!Go.test(n))return m.from(t.text(n));const r=e.get(u)(n)?.firstChild;if("paragraph"!==r?.type.name||0===r.content.size)return m.from(t.text(n));let o=!1;if(r.content.forEach(e=>{(!e.isText||e.marks.length>0)&&(o=!0)}),!o)return m.from(t.text(n));let i=r.content;const a=/^\s+/.exec(n)?.[0];a&&((i.firstChild?.isText?i.firstChild.text??"":"").startsWith(a)||(i=m.from(t.text(a)).append(i)));const s=/\s+$/.exec(n)?.[0];return s&&((i.lastChild?.isText?i.lastChild.text??"":"").endsWith(s)||(i=i.append(m.from(t.text(s))))),i}function Xo(e,t,n){if(null!=n.insertPos){const r=n.insertPos,o=function(e,t,n){const{insertPos:r,currentEndPos:o}=n,i=n.buffer.replace(/\r\n?/g,"\n");if(!i)return{tr:t,applied:!1,insertEndPos:o};const a=t.doc.content.size,s=Math.max(0,Math.min(r,a)),l=Math.max(s,Math.min(o,a)),c=t.doc.resolve(s),d=(e.get($o.key).insertStrategy??Wo)(c),h={ctx:e,tr:t,buffer:i,from:s,to:l,resolved:c};switch(d.type){case"plain-text":return function({tr:e,buffer:t,from:n,to:r},o){const i=o?t:t.replace(/\n/g," "),a=e.doc.type.schema.text(i);return{tr:e=e.replaceWith(n,r,a),applied:!0,insertEndPos:n+i.length}}(h,d.preserveNewlines??!1);case"split-block":return function({ctx:e,tr:t,buffer:n,from:r,to:o,resolved:i}){const a=t.doc.type.schema,s=n.indexOf("\n");if(s<0){const i=Zo(e,a,n);return{tr:t=t.replaceWith(r,o,i),applied:!0,insertEndPos:r+i.size}}const l=n.substring(0,s),c=n.substring(s+1),d=e.get(u),h=c.trim()?d(c):null,f=h?Uo(h.content):m.empty;if(0===f.childCount){const i=Zo(e,a,n.replace(/\n/g," "));return{tr:t=t.replaceWith(r,o,i),applied:!0,insertEndPos:r+i.size}}const g=i.depth;let v=Zo(e,a,l);for(let u=g;u>0;u--)v=m.from(i.node(u).copy(v));const y=v.append(f),b=new p(y,g,0),w=t.doc.content.size,x=t.doc.resolve(Math.min(o,w));let k=o;return g>0&&x.depth===g&&x.parentOffset===x.parent.content.size&&(k=x.after(g)),{tr:t=t.replace(r,k,b),applied:!0,insertEndPos:r+(y.size-g)}}(h);case"block":return function({ctx:e,tr:t,buffer:n,from:r,to:o}){const i=e.get(u)(n);if(!i)return{tr:t,applied:!1,insertEndPos:o};const a=Uo(i.content);return 0===a.size?{tr:t,applied:!1,insertEndPos:o}:{tr:t=t.replace(r,o,new p(a,0,0)),applied:!0,insertEndPos:r+a.size}}(h)}}(e,t,{buffer:n.buffer,insertPos:r,currentEndPos:n.insertEndPos??r});return{tr:o.tr,newDoc:o.applied?o.tr.doc:null,insertEndPos:o.insertEndPos}}return function(e,t,n){const r=e.get(u)(n);if(!r)return{tr:t,newDoc:null};const o=e.get($o.key).ignoreAttrs,i=Qr(t.doc,r,o?{ignoreAttrs:o}:void 0);for(let a=i.length-1;a>=0;a--){const e=i[a],n=r.slice(e.fromB,e.toB);t=t.replace(e.fromA,e.toA,n)}return{tr:t,newDoc:r}}(e,t,n.buffer)}var Ko=new d("MILKDOWN_STREAMING"),Yo=s(e=>{const t=e.get($o.key);return new c({key:Ko,state:{init:()=>null,apply:(e,t)=>function(e,t){if(!e&&"start"!==t?.type)return null;if(!t)return e;switch(t.type){case"start":return{buffer:"",originalDoc:t.originalDoc,active:!0,lastApplyTime:t.lastApplyTime,insertPos:t.insertPos??null,insertEndPos:t.insertEndPos??t.insertPos??null};case"push":return e?{...e,buffer:e.buffer+t.token}:null;case"apply":return e?{...e,lastApplyTime:t.lastApplyTime,insertEndPos:t.insertEndPos??e.insertEndPos}:null;case"end":case"abort":return null;default:return e}}(t,e.getMeta(Ko))},filterTransaction:(e,t)=>!Ko.getState(t)?.active||!!e.getMeta(Ko)||!e.docChanged,view:()=>function(e,t){let n=null,r=-1,o=null;function i(){if(!o)return;const n=Ko.getState(o.state);if(!n?.active||n.buffer.length===r)return;r=n.buffer.length;const i=Xo(e,o.state.tr,n);if(!i.newDoc)return;let a=i.tr;(a.docChanged||null!=i.insertEndPos)&&(a=a.setMeta(Ko,{type:"apply",lastApplyTime:Date.now(),insertEndPos:i.insertEndPos}),t.scrollFollow&&(a=a.scrollIntoView()),o.dispatch(a))}return{update(e){o=e;const a=Ko.getState(e.state);if(!a?.active)return null!=n&&(clearTimeout(n),n=null),void(r=-1);a.buffer.length!==r&&(Date.now()-a.lastApplyTime>=t.throttleMs?i():(null!=n&&clearTimeout(n),n=setTimeout(i,t.throttleMs)))},destroy(){null!=n&&(clearTimeout(n),n=null),o=null}}}(e,t)})});Fo(Yo,{displayName:"Prose<streaming>",group:"Streaming"});var Jo=l("StartStreaming",()=>e=>(t,n)=>{if(Ko.getState(t)?.active)return!1;if(n){let r,o;if(null!=e?.insertAt)if("selection"===e.insertAt){if(r=t.selection.from,o=t.selection.to,t.selection.empty){const e=t.doc.resolve(r);e.parent.isTextblock&&!e.parent.type.spec.code&&0===e.parent.content.size&&1===e.depth&&(r=e.before(e.depth),o=e.after(e.depth))}}else{const n="cursor"===e.insertAt?t.selection.head:e.insertAt;if(!Number.isFinite(n))return!1;r=Math.max(0,Math.min(Math.round(n),t.doc.content.size));const i=t.doc.resolve(r);i.parent.isTextblock&&!i.parent.type.spec.code&&0===i.parent.content.size&&1===i.depth&&(r=i.before(i.depth),o=i.after(i.depth))}n(t.tr.setMeta(Ko,{type:"start",originalDoc:t.doc,insertPos:r,insertEndPos:o,lastApplyTime:Date.now()}))}return!0});Fo(Jo,{displayName:"Command<startStreaming>",group:"Streaming"});var Qo=l("PushChunk",()=>e=>(t,n)=>null!=e&&!!Ko.getState(t)?.active&&(n&&n(t.tr.setMeta(Ko,{type:"push",token:e})),!0));Fo(Qo,{displayName:"Command<pushChunk>",group:"Streaming"});var ei=l("EndStreaming",e=>t=>(n,r)=>{const o=Ko.getState(n);if(!o?.active)return!1;if(r){const a=e.get($o.key),s=t?.diffReview??a.diffReviewOnEnd,l=Xo(e,n.tr,o);let c=l.tr;if(c=c.setMeta(Ko,{type:"end"}),s&&l.newDoc){const t=c.doc;c=c.replace(0,c.doc.content.size,new p(o.originalDoc.content,0,0)),r(c);try{e.get(g).call(io.key,t)}catch(i){console.warn("[milkdown/streaming] diff review handoff skipped:",i)}return!0}r(c)}return!0});Fo(ei,{displayName:"Command<endStreaming>",group:"Streaming"});var ti=l("AbortStreaming",e=>t=>(n,r)=>{const o=Ko.getState(n);if(!o?.active)return!1;if(r){const i=t?.keep??!1;let a=n.tr;a=i?Xo(e,a,o).tr:a.replace(0,n.doc.content.size,new p(o.originalDoc.content,0,0)),a=a.setMeta(Ko,{type:"abort"}),r(a)}return!0});Fo(ti,{displayName:"Command<abortStreaming>",group:"Streaming"});var ni=[$o,Yo,Jo,Qo,ei,ti],ri=class{#e;#t;#n;#r;#o;#i;#a;#s;#l;#c;constructor(e){this.#i=!1,this.onShow=()=>{},this.onHide=()=>{},this.#d=e=>{b(e,this.element,{placement:this.#r.placement??"top",middleware:[w(),x(this.#s),k(this.#l),...this.#n],...this.#r}).then(({x:e,y:t})=>{Object.assign(this.element.style,{left:`${e}px`,top:`${t}px`})}).catch(console.error)},this.#u=e=>this.#o!==e.dom.parentElement,this.#h=(e,t)=>{const{state:n,composing:r}=e,{selection:o,doc:i}=n,{ranges:a}=o,s=Math.min(...a.map(e=>e.$from.pos)),l=Math.max(...a.map(e=>e.$to.pos)),c=t&&t.doc.eq(i)&&t.selection.eq(o);if(this.#i||((this.#o??e.dom.parentElement??document.body).appendChild(this.element),this.#i=!0),r||c)return;if(this.#a?.(),this.#a=void 0,!this.#t(e,t))return void this.hide();const d={getBoundingClientRect:()=>_(e,s,l),contextElement:e.dom};this.#u(e)?this.#a=C(d,this.element,()=>this.#d(d)):this.#d(d),this.show()},this.update=(e,t)=>{this.#c(e,t)},this.#p=e=>{const{doc:t,selection:n}=e.state,{empty:r,from:o,to:i}=n,a=!t.textBetween(o,i).length&&e.state.selection instanceof S,s=this.element.contains(document.activeElement),l=!e.hasFocus()&&!s,c=!e.editable;return!(l||r||a||c)},this.destroy=()=>{this.#a?.(),this.#c.cancel()},this.show=(e,t)=>{if(this.element.dataset.show="true",e){this.#a?.(),this.#a=void 0;const n={...e,contextElement:t?.dom};t&&this.#u(t)?this.#a=C(n,this.element,()=>this.#d(n)):this.#d(n)}this.onShow()},this.hide=()=>{"false"!==this.element.dataset.show&&(this.element.dataset.show="false",this.onHide())},this.element=e.content,this.#e=e.debounce??200,this.#t=e.shouldShow??this.#p,this.#s=e.offset,this.#l=e.shift,this.#n=e.middleware??[],this.#r=e.floatingUIOptions??{},this.#o=e.root,this.element.dataset.show="false",this.#c=gr(this.#h,this.#e)}#d;#u;#h;#p};function oi(e){const t=a({},`${e}_TOOLTIP_SPEC`),n=s(n=>{const r=n.get(t.key);return new c({key:new d(`${e}_TOOLTIP`),...r})}),r=[t,n];return r.key=t.key,r.pluginKey=n.key,t.meta={package:"@milkdown/plugin-tooltip",displayName:`Ctx<tooltipSpec>|${e}`},n.meta={package:"@milkdown/plugin-tooltip",displayName:`Prose<tooltip>|${e}`},r}function ii(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return e=>e in t}const ai={},si=[],li=()=>{},ci=()=>!1,di=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ui=e=>e.startsWith("onUpdate:"),hi=Object.assign,pi=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},mi=Object.prototype.hasOwnProperty,fi=(e,t)=>mi.call(e,t),gi=Array.isArray,vi=e=>"[object Map]"===Si(e),yi=e=>"[object Date]"===Si(e),bi=e=>"function"==typeof e,wi=e=>"string"==typeof e,xi=e=>"symbol"==typeof e,ki=e=>null!==e&&"object"==typeof e,Ci=e=>(ki(e)||bi(e))&&bi(e.then)&&bi(e.catch),_i=Object.prototype.toString,Si=e=>_i.call(e),Ai=e=>wi(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,Mi=ii(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ti=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Ei=/-\w/g,Li=Ti(e=>e.replace(Ei,e=>e.slice(1).toUpperCase())),Oi=/\B([A-Z])/g,Ii=Ti(e=>e.replace(Oi,"-$1").toLowerCase()),Ri=Ti(e=>e.charAt(0).toUpperCase()+e.slice(1)),Pi=Ti(e=>e?`on${Ri(e)}`:""),Bi=(e,t)=>!Object.is(e,t),zi=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Di=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Ni=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Hi;const qi=()=>Hi||(Hi="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function ji(e){if(gi(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],o=wi(r)?Wi(r):ji(r);if(o)for(const e in o)t[e]=o[e]}return t}if(wi(e)||ki(e))return e}const Vi=/;(?![^(]*\))/g,Fi=/:([^]+)/,$i=/\/\*[^]*?\*\//g;function Wi(e){const t={};return e.replace($i,"").split(Vi).forEach(e=>{if(e){const n=e.split(Fi);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Ui(e){let t="";if(wi(e))t=e;else if(gi(e))for(let n=0;n<e.length;n++){const r=Ui(e[n]);r&&(t+=r+" ")}else if(ki(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Gi=ii("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function Zi(e){return!!e||""===e}function Xi(e,t){if(e===t)return!0;let n=yi(e),r=yi(t);if(n||r)return!(!n||!r)&&e.getTime()===t.getTime();if(n=xi(e),r=xi(t),n||r)return e===t;if(n=gi(e),r=gi(t),n||r)return!(!n||!r)&&function(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Xi(e[r],t[r]);return n}(e,t);if(n=ki(e),r=ki(t),n||r){if(!n||!r)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e){const r=e.hasOwnProperty(n),o=t.hasOwnProperty(n);if(r&&!o||!r&&o||!Xi(e[n],t[n]))return!1}}return String(e)===String(t)}let Ki,Yi;class Ji{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Ki,!e&&Ki&&(this.index=(Ki.scopes||(Ki.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=Ki;try{return Ki=this,e()}finally{Ki=t}}}on(){1===++this._on&&(this.prevScope=Ki,Ki=this)}off(){this._on>0&&0===--this._on&&(Ki=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){let t,n;for(this._active=!1,t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}const Qi=new WeakSet;class ea{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ki&&Ki.active&&Ki.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,Qi.has(this)&&(Qi.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||oa(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,va(this),sa(this);const e=Yi,t=pa;Yi=this,pa=!0;try{return this.fn()}finally{la(this),Yi=e,pa=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)ua(e);this.deps=this.depsTail=void 0,va(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?Qi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ca(this)&&this.run()}get dirty(){return ca(this)}}let ta,na,ra=0;function oa(e,t=!1){if(e.flags|=8,t)return e.next=na,void(na=e);e.next=ta,ta=e}function ia(){ra++}function aa(){if(--ra>0)return;if(na){let e=na;for(na=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;ta;){let n=ta;for(ta=void 0;n;){const r=n.next;if(n.next=void 0,n.flags&=-9,1&n.flags)try{n.trigger()}catch(t){e||(e=t)}n=r}}if(e)throw e}function sa(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function la(e){let t,n=e.depsTail,r=n;for(;r;){const e=r.prevDep;-1===r.version?(r===n&&(n=e),ua(r),ha(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function ca(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(da(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function da(e){if(4&e.flags&&!(16&e.flags))return;if(e.flags&=-17,e.globalVersion===ya)return;if(e.globalVersion=ya,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!ca(e)))return;e.flags|=2;const t=e.dep,n=Yi,r=pa;Yi=e,pa=!0;try{sa(e);const n=e.fn(e._value);(0===t.version||Bi(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(o){throw t.version++,o}finally{Yi=n,pa=r,la(e),e.flags&=-3}}function ua(e,t=!1){const{dep:n,prevSub:r,nextSub:o}=e;if(r&&(r.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)ua(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}function ha(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let pa=!0;const ma=[];function fa(){ma.push(pa),pa=!1}function ga(){const e=ma.pop();pa=void 0===e||e}function va(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const e=Yi;Yi=void 0;try{t()}finally{Yi=e}}}let ya=0;class ba{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class wa{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Yi||!pa||Yi===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==Yi)t=this.activeLink=new ba(Yi,this),Yi.deps?(t.prevDep=Yi.depsTail,Yi.depsTail.nextDep=t,Yi.depsTail=t):Yi.deps=Yi.depsTail=t,xa(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){const e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=Yi.depsTail,t.nextDep=void 0,Yi.depsTail.nextDep=t,Yi.depsTail=t,Yi.deps===t&&(Yi.deps=e)}return t}trigger(e){this.version++,ya++,this.notify(e)}notify(e){ia();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{aa()}}}function xa(e){if(e.dep.sc++,4&e.sub.flags){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)xa(e)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ka=new WeakMap,Ca=Symbol(""),_a=Symbol(""),Sa=Symbol("");function Aa(e,t,n){if(pa&&Yi){let t=ka.get(e);t||ka.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new wa),r.map=t,r.key=n),r.track()}}function Ma(e,t,n,r,o,i){const a=ka.get(e);if(!a)return void ya++;const s=e=>{e&&e.trigger()};if(ia(),"clear"===t)a.forEach(s);else{const o=gi(e),i=o&&Ai(n);if(o&&"length"===n){const e=Number(r);a.forEach((t,n)=>{("length"===n||n===Sa||!xi(n)&&n>=e)&&s(t)})}else switch((void 0!==n||a.has(void 0))&&s(a.get(n)),i&&s(a.get(Sa)),t){case"add":o?i&&s(a.get("length")):(s(a.get(Ca)),vi(e)&&s(a.get(_a)));break;case"delete":o||(s(a.get(Ca)),vi(e)&&s(a.get(_a)));break;case"set":vi(e)&&s(a.get(Ca))}}aa()}function Ta(e){const t=hs(e);return t===e?t:(Aa(t,0,Sa),ds(e)?t:t.map(ps))}function Ea(e){return Aa(e=hs(e),0,Sa),e}function La(e,t){return cs(e)?ms(ls(e)?ps(t):t):ps(t)}const Oa={__proto__:null,[Symbol.iterator](){return Ia(this,Symbol.iterator,e=>La(this,e))},concat(...e){return Ta(this).concat(...e.map(e=>gi(e)?Ta(e):e))},entries(){return Ia(this,"entries",e=>(e[1]=La(this,e[1]),e))},every(e,t){return Pa(this,"every",e,t,void 0,arguments)},filter(e,t){return Pa(this,"filter",e,t,e=>e.map(e=>La(this,e)),arguments)},find(e,t){return Pa(this,"find",e,t,e=>La(this,e),arguments)},findIndex(e,t){return Pa(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Pa(this,"findLast",e,t,e=>La(this,e),arguments)},findLastIndex(e,t){return Pa(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Pa(this,"forEach",e,t,void 0,arguments)},includes(...e){return za(this,"includes",e)},indexOf(...e){return za(this,"indexOf",e)},join(e){return Ta(this).join(e)},lastIndexOf(...e){return za(this,"lastIndexOf",e)},map(e,t){return Pa(this,"map",e,t,void 0,arguments)},pop(){return Da(this,"pop")},push(...e){return Da(this,"push",e)},reduce(e,...t){return Ba(this,"reduce",e,t)},reduceRight(e,...t){return Ba(this,"reduceRight",e,t)},shift(){return Da(this,"shift")},some(e,t){return Pa(this,"some",e,t,void 0,arguments)},splice(...e){return Da(this,"splice",e)},toReversed(){return Ta(this).toReversed()},toSorted(e){return Ta(this).toSorted(e)},toSpliced(...e){return Ta(this).toSpliced(...e)},unshift(...e){return Da(this,"unshift",e)},values(){return Ia(this,"values",e=>La(this,e))}};function Ia(e,t,n){const r=Ea(e),o=r[t]();return r===e||ds(e)||(o._next=o.next,o.next=()=>{const e=o._next();return e.done||(e.value=n(e.value)),e}),o}const Ra=Array.prototype;function Pa(e,t,n,r,o,i){const a=Ea(e),s=a!==e&&!ds(e),l=a[t];if(l!==Ra[t]){const t=l.apply(e,i);return s?ps(t):t}let c=n;a!==e&&(s?c=function(t,r){return n.call(this,La(e,t),r,e)}:n.length>2&&(c=function(t,r){return n.call(this,t,r,e)}));const d=l.call(a,c,r);return s&&o?o(d):d}function Ba(e,t,n,r){const o=Ea(e);let i=n,a=!1;o!==e&&(o===e||ds(e)?n.length>3&&(i=function(t,r,o){return n.call(this,t,r,o,e)}):(a=0===r.length,i=function(t,r,o){return a&&(a=!1,t=La(e,t)),n.call(this,t,La(e,r),o,e)}));const s=o[t](i,...r);return a?La(e,s):s}function za(e,t,n){const r=hs(e);Aa(r,0,Sa);const o=r[t](...n);return-1!==o&&!1!==o||!us(n[0])?o:(n[0]=hs(n[0]),r[t](...n))}function Da(e,t,n=[]){fa(),ia();const r=hs(e)[t].apply(e,n);return aa(),ga(),r}const Na=ii("__proto__,__v_isRef,__isVue"),Ha=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(xi));function qa(e){xi(e)||(e=String(e));const t=hs(this);return Aa(t,0,e),t.hasOwnProperty(e)}class ja{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;const r=this._isReadonly,o=this._isShallow;if("__v_isReactive"===t)return!r;if("__v_isReadonly"===t)return r;if("__v_isShallow"===t)return o;if("__v_raw"===t)return n===(r?o?rs:ns:o?ts:es).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const i=gi(e);if(!r){let e;if(i&&(e=Oa[t]))return e;if("hasOwnProperty"===t)return qa}const a=Reflect.get(e,t,fs(e)?e:n);if(xi(t)?Ha.has(t):Na(t))return a;if(r||Aa(e,0,t),o)return a;if(fs(a)){const e=i&&Ai(t)?a:a.value;return r&&ki(e)?as(e):e}return ki(a)?r?as(a):os(a):a}}class Va extends ja{constructor(e=!1){super(!1,e)}set(e,t,n,r){let o=e[t];const i=gi(e)&&Ai(t);if(!this._isShallow){const e=cs(o);if(ds(n)||cs(n)||(o=hs(o),n=hs(n)),!i&&fs(o)&&!fs(n))return e||(o.value=n),!0}const a=i?Number(t)<e.length:fi(e,t),s=Reflect.set(e,t,n,fs(e)?e:r);return e===hs(r)&&(a?Bi(n,o)&&Ma(e,"set",t,n):Ma(e,"add",t,n)),s}deleteProperty(e,t){const n=fi(e,t);e[t];const r=Reflect.deleteProperty(e,t);return r&&n&&Ma(e,"delete",t,void 0),r}has(e,t){const n=Reflect.has(e,t);return xi(t)&&Ha.has(t)||Aa(e,0,t),n}ownKeys(e){return Aa(e,0,gi(e)?"length":Ca),Reflect.ownKeys(e)}}class Fa extends ja{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const $a=new Va,Wa=new Fa,Ua=new Va(!0),Ga=e=>e,Za=e=>Reflect.getPrototypeOf(e);function Xa(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function Ka(e,t){const n=function(e,t){const n={get(n){const r=this.__v_raw,o=hs(r),i=hs(n);e||(Bi(n,i)&&Aa(o,0,n),Aa(o,0,i));const{has:a}=Za(o),s=t?Ga:e?ms:ps;return a.call(o,n)?s(r.get(n)):a.call(o,i)?s(r.get(i)):void(r!==o&&r.get(n))},get size(){const t=this.__v_raw;return!e&&Aa(hs(t),0,Ca),t.size},has(t){const n=this.__v_raw,r=hs(n),o=hs(t);return e||(Bi(t,o)&&Aa(r,0,t),Aa(r,0,o)),t===o?n.has(t):n.has(t)||n.has(o)},forEach(n,r){const o=this,i=o.__v_raw,a=t?Ga:e?ms:ps;return!e&&Aa(hs(i),0,Ca),i.forEach((e,t)=>n.call(r,a(e),a(t),o))}};return hi(n,e?{add:Xa("add"),set:Xa("set"),delete:Xa("delete"),clear:Xa("clear")}:{add(e){const n=hs(this),r=Za(n),o=hs(e),i=t||ds(e)||cs(e)?e:o;return r.has.call(n,i)||Bi(e,i)&&r.has.call(n,e)||Bi(o,i)&&r.has.call(n,o)||(n.add(i),Ma(n,"add",i,i)),this},set(e,n){t||ds(n)||cs(n)||(n=hs(n));const r=hs(this),{has:o,get:i}=Za(r);let a=o.call(r,e);a||(e=hs(e),a=o.call(r,e));const s=i.call(r,e);return r.set(e,n),a?Bi(n,s)&&Ma(r,"set",e,n):Ma(r,"add",e,n),this},delete(e){const t=hs(this),{has:n,get:r}=Za(t);let o=n.call(t,e);o||(e=hs(e),o=n.call(t,e)),r&&r.call(t,e);const i=t.delete(e);return o&&Ma(t,"delete",e,void 0),i},clear(){const e=hs(this),t=0!==e.size,n=e.clear();return t&&Ma(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=function(e,t,n){return function(...r){const o=this.__v_raw,i=hs(o),a=vi(i),s="entries"===e||e===Symbol.iterator&&a,l="keys"===e&&a,c=o[e](...r),d=n?Ga:t?ms:ps;return!t&&Aa(i,0,l?_a:Ca),hi(Object.create(c),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:s?[d(e[0]),d(e[1])]:d(e),done:t}}})}}(r,e,t)}),n}(e,t);return(t,r,o)=>"__v_isReactive"===r?!e:"__v_isReadonly"===r?e:"__v_raw"===r?t:Reflect.get(fi(n,r)&&r in t?n:t,r,o)}const Ya={get:Ka(!1,!1)},Ja={get:Ka(!1,!0)},Qa={get:Ka(!0,!1)},es=new WeakMap,ts=new WeakMap,ns=new WeakMap,rs=new WeakMap;function os(e){return cs(e)?e:ss(e,!1,$a,Ya,es)}function is(e){return ss(e,!1,Ua,Ja,ts)}function as(e){return ss(e,!0,Wa,Qa,ns)}function ss(e,t,n,r,o){if(!ki(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const i=function(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>Si(e).slice(8,-1))(e))}(e);if(0===i)return e;const a=o.get(e);if(a)return a;const s=new Proxy(e,2===i?r:n);return o.set(e,s),s}function ls(e){return cs(e)?ls(e.__v_raw):!(!e||!e.__v_isReactive)}function cs(e){return!(!e||!e.__v_isReadonly)}function ds(e){return!(!e||!e.__v_isShallow)}function us(e){return!!e&&!!e.__v_raw}function hs(e){const t=e&&e.__v_raw;return t?hs(t):e}const ps=e=>ki(e)?os(e):e,ms=e=>ki(e)?as(e):e;function fs(e){return!!e&&!0===e.__v_isRef}function gs(e){return ys(e,!1)}function vs(e){return ys(e,!0)}function ys(e,t){return fs(e)?e:new bs(e,t)}class bs{constructor(e,t){this.dep=new wa,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:hs(e),this._value=t?e:ps(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,n=this.__v_isShallow||ds(e)||cs(e);Bi(e=n?e:hs(e),t)&&(this._rawValue=e,this._value=n?e:ps(e),this.dep.trigger())}}const ws={get:(e,t,n)=>"__v_raw"===t?e:function(e){return fs(e)?e.value:e}(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const o=e[t];return fs(o)&&!fs(n)?(o.value=n,!0):Reflect.set(e,t,n,r)}};function xs(e){return ls(e)?e:new Proxy(e,ws)}class ks{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new wa(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ya-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&Yi!==this)return oa(this,!0),!0}get value(){const e=this.dep.track();return da(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function Cs(e,t,n=!1){let r,o;return bi(e)?r=e:(r=e.get,o=e.set),new ks(r,o,n)}const _s={},Ss=new WeakMap;let As;function Ms(e,t=1/0,n){if(t<=0||!ki(e)||e.__v_skip)return e;if(((n=n||new Map).get(e)||0)>=t)return e;if(n.set(e,t),t--,fs(e))Ms(e.value,t,n);else if(gi(e))for(let r=0;r<e.length;r++)Ms(e[r],t,n);else if((e=>"[object Set]"===Si(e))(e)||vi(e))e.forEach(e=>{Ms(e,t,n)});else if((e=>"[object Object]"===Si(e))(e)){for(const r in e)Ms(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Ms(e[r],t,n)}return e}function Ts(e,t,n,r){try{return r?e(...r):e()}catch(o){Ls(o,t,n)}}function Es(e,t,n,r){if(bi(e)){const o=Ts(e,t,n,r);return o&&Ci(o)&&o.catch(e=>{Ls(e,t,n)}),o}if(gi(e)){const o=[];for(let i=0;i<e.length;i++)o.push(Es(e[i],t,n,r));return o}}function Ls(e,t,n,r=!0){t&&t.vnode;const{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||ai;if(t){let r=t.parent;const i=t.proxy,a=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){const t=r.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,i,a))return;r=r.parent}if(o)return fa(),Ts(o,null,10,[e,i,a]),void ga()}!function(e,t,n,r=!0,o=!1){if(o)throw e;console.error(e)}(e,0,0,r,i)}const Os=[];let Is=-1;const Rs=[];let Ps=null,Bs=0;const zs=Promise.resolve();let Ds=null;function Ns(e){const t=Ds||zs;return e?t.then(this?e.bind(this):e):t}function Hs(e){if(!(1&e.flags)){const t=Fs(e),n=Os[Os.length-1];!n||!(2&e.flags)&&t>=Fs(n)?Os.push(e):Os.splice(function(e){let t=Is+1,n=Os.length;for(;t<n;){const r=t+n>>>1,o=Os[r],i=Fs(o);i<e||i===e&&2&o.flags?t=r+1:n=r}return t}(t),0,e),e.flags|=1,qs()}}function qs(){Ds||(Ds=zs.then($s))}function js(e,t,n=Is+1){for(;n<Os.length;n++){const t=Os[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;Os.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function Vs(e){if(Rs.length){const e=[...new Set(Rs)].sort((e,t)=>Fs(e)-Fs(t));if(Rs.length=0,Ps)return void Ps.push(...e);for(Ps=e,Bs=0;Bs<Ps.length;Bs++){const e=Ps[Bs];4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}Ps=null,Bs=0}}const Fs=e=>null==e.id?2&e.flags?-1:1/0:e.id;function $s(e){try{for(Is=0;Is<Os.length;Is++){const e=Os[Is];!e||8&e.flags||(4&e.flags&&(e.flags&=-2),Ts(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;Is<Os.length;Is++){const e=Os[Is];e&&(e.flags&=-2)}Is=-1,Os.length=0,Vs(),Ds=null,(Os.length||Rs.length)&&$s()}}let Ws,Us=[],Gs=!1;function Zs(e,...t){Ws?Ws.emit(e,...t):Gs||Us.push({event:e,args:t})}function Xs(e,t){var n,r;Ws=e,Ws?(Ws.enabled=!0,Us.forEach(({event:e,args:t})=>Ws.emit(e,...t)),Us=[]):"undefined"!=typeof window&&window.HTMLElement&&!(null==(r=null==(n=window.navigator)?void 0:n.userAgent)?void 0:r.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(e=>{Xs(e,t)}),setTimeout(()=>{Ws||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Gs=!0,Us=[])},3e3)):(Gs=!0,Us=[])}const Ks=Qs("component:added"),Ys=Qs("component:updated"),Js=Qs("component:removed");function Qs(e){return t=>{Zs(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let el=null,tl=null;function nl(e){const t=el;return el=e,tl=e&&e.type.__scopeId||null,t}function rl(e,t,n,r){const o=e.dirs,i=t&&t.dirs;for(let a=0;a<o.length;a++){const s=o[a];i&&(s.oldValue=i[a].value);let l=s.dir[r];l&&(fa(),Es(l,n,8,[e.el,s,e,t]),ga())}}function ol(e,t,n=!1){const r=td();if(r||oc){let o=oc?oc._context.provides:r?null==r.parent||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&bi(t)?t.call(r&&r.proxy):t}}const il=Symbol.for("v-scx");function al(e,t){return ll(e,null,t)}function sl(e,t,n){return ll(e,t,n)}function ll(e,t,n=ai){const{immediate:r,deep:o,flush:i,once:a}=n,s=hi({},n),l=t&&r||!t&&"post"!==i;let c;if(sd)if("sync"===i){const e=ol(il);c=e.__watcherHandles||(e.__watcherHandles=[])}else if(!l){const e=()=>{};return e.stop=li,e.resume=li,e.pause=li,e}const d=ed;s.call=(e,t,n)=>Es(e,d,t,n);let u=!1;"post"===i?s.scheduler=e=>{Tc(e,d&&d.suspense)}:"sync"!==i&&(u=!0,s.scheduler=(e,t)=>{t?e():Hs(e)}),s.augmentJob=e=>{t&&(e.flags|=4),u&&(e.flags|=2,d&&(e.id=d.uid,e.i=d))};const h=function(e,t,n=ai){const{immediate:r,deep:o,once:i,scheduler:a,augmentJob:s,call:l}=n,c=e=>o?e:ds(e)||!1===o||0===o?Ms(e,1):Ms(e);let d,u,h,p,m=!1,f=!1;if(fs(e)?(u=()=>e.value,m=ds(e)):ls(e)?(u=()=>c(e),m=!0):gi(e)?(f=!0,m=e.some(e=>ls(e)||ds(e)),u=()=>e.map(e=>fs(e)?e.value:ls(e)?c(e):bi(e)?l?l(e,2):e():void 0)):u=bi(e)?t?l?()=>l(e,2):e:()=>{if(h){fa();try{h()}finally{ga()}}const t=As;As=d;try{return l?l(e,3,[p]):e(p)}finally{As=t}}:li,t&&o){const e=u,t=!0===o?1/0:o;u=()=>Ms(e(),t)}const g=Ki,v=()=>{d.stop(),g&&g.active&&pi(g.effects,d)};if(i&&t){const e=t;t=(...t)=>{e(...t),v()}}let y=f?new Array(e.length).fill(_s):_s;const b=e=>{if(1&d.flags&&(d.dirty||e))if(t){const e=d.run();if(o||m||(f?e.some((e,t)=>Bi(e,y[t])):Bi(e,y))){h&&h();const n=As;As=d;try{const n=[e,y===_s?void 0:f&&y[0]===_s?[]:y,p];y=e,l?l(t,3,n):t(...n)}finally{As=n}}}else d.run()};return s&&s(b),d=new ea(u),d.scheduler=a?()=>a(b,!1):b,p=e=>function(e,t=!1,n=As){if(n){let t=Ss.get(n);t||Ss.set(n,t=[]),t.push(e)}}(e,!1,d),h=d.onStop=()=>{const e=Ss.get(d);if(e){if(l)l(e,4);else for(const t of e)t();Ss.delete(d)}},t?r?b(!0):y=d.run():a?a(b.bind(null,!0),!0):d.run(),v.pause=d.pause.bind(d),v.resume=d.resume.bind(d),v.stop=v,v}(e,t,s);return sd&&(c?c.push(h):l&&h()),h}function cl(e,t,n){const r=this.proxy,o=wi(e)?e.includes(".")?dl(r,e):()=>r[e]:e.bind(r,r);let i;bi(t)?i=t:(i=t.handler,n=t);const a=od(this),s=ll(o,i.bind(r),n);return a(),s}function dl(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}const ul=Symbol("_vte"),hl=Symbol("_leaveCb");function pl(e,t){6&e.shapeFlag&&e.component?(e.transition=t,pl(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ml(e,t){return bi(e)?(()=>hi({name:e.name},t,{setup:e}))():e}function fl(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function gl(e,t){let n;return!(!(n=Object.getOwnPropertyDescriptor(e,t))||n.configurable)}const vl=new WeakMap;function yl(e,t,n,r,o=!1){if(gi(e))return void e.forEach((e,i)=>yl(e,t&&(gi(t)?t[i]:t),n,r,o));if(wl(r)&&!o)return void(512&r.shapeFlag&&r.type.__asyncResolved&&r.component.subTree.component&&yl(e,t,n,r.component.subTree));const i=4&r.shapeFlag?ud(r.component):r.el,a=o?null:i,{i:s,r:l}=e,c=t&&t.r,d=s.refs===ai?s.refs={}:s.refs,u=s.setupState,h=hs(u),p=u===ai?ci:e=>!gl(d,e)&&fi(h,e),m=(e,t)=>!t||!gl(d,t);if(null!=c&&c!==l)if(bl(t),wi(c))d[c]=null,p(c)&&(u[c]=null);else if(fs(c)){const e=t;m(0,e.k)&&(c.value=null),e.k&&(d[e.k]=null)}if(bi(l))Ts(l,s,12,[a,d]);else{const t=wi(l),r=fs(l);if(t||r){const s=()=>{if(e.f){const n=t?p(l)?u[l]:d[l]:m()||!e.k?l.value:d[e.k];if(o)gi(n)&&pi(n,i);else if(gi(n))n.includes(i)||n.push(i);else if(t)d[l]=[i],p(l)&&(u[l]=d[l]);else{const t=[i];m(0,e.k)&&(l.value=t),e.k&&(d[e.k]=t)}}else t?(d[l]=a,p(l)&&(u[l]=a)):r&&(m(0,e.k)&&(l.value=a),e.k&&(d[e.k]=a))};if(a){const t=()=>{s(),vl.delete(e)};t.id=-1,vl.set(e,t),Tc(t,n)}else bl(e),s()}}}function bl(e){const t=vl.get(e);t&&(t.flags|=8,vl.delete(e))}qi().requestIdleCallback,qi().cancelIdleCallback;const wl=e=>!!e.type.__asyncLoader,xl=e=>e.type.__isKeepAlive;function kl(e,t){_l(e,"a",t)}function Cl(e,t){_l(e,"da",t)}function _l(e,t,n=ed){const r=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(Al(t,r,n),n){let e=n.parent;for(;e&&e.parent;)xl(e.parent.vnode)&&Sl(r,t,n,e),e=e.parent}}function Sl(e,t,n,r){const o=Al(t,e,r,!0);Rl(()=>{pi(r[t],o)},n)}function Al(e,t,n=ed,r=!1){if(n){const o=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...r)=>{fa();const o=od(n),i=Es(t,n,e,r);return o(),ga(),i});return r?o.unshift(i):o.push(i),i}}const Ml=e=>(t,n=ed)=>{sd&&"sp"!==e||Al(e,(...e)=>t(...e),n)},Tl=Ml("bm"),El=Ml("m"),Ll=Ml("bu"),Ol=Ml("u"),Il=Ml("bum"),Rl=Ml("um"),Pl=Ml("sp"),Bl=Ml("rtg"),zl=Ml("rtc");function Dl(e,t=ed){Al("ec",e,t)}const Nl=Symbol.for("v-ndc"),Hl=e=>e?ad(e)?ud(e):Hl(e.parent):null,ql=hi(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Hl(e.parent),$root:e=>Hl(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>__VUE_OPTIONS_API__?Gl(e):e.type,$forceUpdate:e=>e.f||(e.f=()=>{Hs(e.update)}),$nextTick:e=>e.n||(e.n=Ns.bind(e.proxy)),$watch:e=>__VUE_OPTIONS_API__?cl.bind(e):li}),jl=(e,t)=>e!==ai&&!e.__isScriptSetup&&fi(e,t),Vl={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:r,data:o,props:i,accessCache:a,type:s,appContext:l}=e;if("$"!==t[0]){const e=a[t];if(void 0!==e)switch(e){case 1:return r[t];case 2:return o[t];case 4:return n[t];case 3:return i[t]}else{if(jl(r,t))return a[t]=1,r[t];if(__VUE_OPTIONS_API__&&o!==ai&&fi(o,t))return a[t]=2,o[t];if(fi(i,t))return a[t]=3,i[t];if(n!==ai&&fi(n,t))return a[t]=4,n[t];__VUE_OPTIONS_API__&&!$l||(a[t]=0)}}const c=ql[t];let d,u;return c?("$attrs"===t&&Aa(e.attrs,0,""),c(e)):(d=s.__cssModules)&&(d=d[t])?d:n!==ai&&fi(n,t)?(a[t]=4,n[t]):(u=l.config.globalProperties,fi(u,t)?u[t]:void 0)},set({_:e},t,n){const{data:r,setupState:o,ctx:i}=e;return jl(o,t)?(o[t]=n,!0):__VUE_OPTIONS_API__&&r!==ai&&fi(r,t)?(r[t]=n,!0):!(fi(e.props,t)||"$"===t[0]&&t.slice(1)in e||(i[t]=n,0))},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:o,props:i,type:a}},s){let l;return!!(n[s]||__VUE_OPTIONS_API__&&e!==ai&&"$"!==s[0]&&fi(e,s)||jl(t,s)||fi(i,s)||fi(r,s)||fi(ql,s)||fi(o.config.globalProperties,s)||(l=a.__cssModules)&&l[s])},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:fi(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Fl(e){return gi(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let $l=!0;function Wl(e,t,n){Es(gi(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function Ul(e,t,n,r){let o=r.includes(".")?dl(n,r):()=>n[r];if(wi(e)){const n=t[e];bi(n)&&sl(o,n)}else if(bi(e))sl(o,e.bind(n));else if(ki(e))if(gi(e))e.forEach(e=>Ul(e,t,n,r));else{const r=bi(e.handler)?e.handler.bind(n):t[e.handler];bi(r)&&sl(o,r,e)}}function Gl(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:a}}=e.appContext,s=i.get(t);let l;return s?l=s:o.length||n||r?(l={},o.length&&o.forEach(e=>Zl(l,e,a,!0)),Zl(l,t,a)):l=t,ki(t)&&i.set(t,l),l}function Zl(e,t,n,r=!1){const{mixins:o,extends:i}=t;i&&Zl(e,i,n,!0),o&&o.forEach(t=>Zl(e,t,n,!0));for(const a in t)if(r&&"expose"===a);else{const r=Xl[a]||n&&n[a];e[a]=r?r(e[a],t[a]):t[a]}return e}const Xl={data:Kl,props:ec,emits:ec,methods:Ql,computed:Ql,beforeCreate:Jl,created:Jl,beforeMount:Jl,mounted:Jl,beforeUpdate:Jl,updated:Jl,beforeDestroy:Jl,beforeUnmount:Jl,destroyed:Jl,unmounted:Jl,activated:Jl,deactivated:Jl,errorCaptured:Jl,serverPrefetch:Jl,components:Ql,directives:Ql,watch:function(e,t){if(!e)return t;if(!t)return e;const n=hi(Object.create(null),e);for(const r in t)n[r]=Jl(e[r],t[r]);return n},provide:Kl,inject:function(e,t){return Ql(Yl(e),Yl(t))}};function Kl(e,t){return t?e?function(){return hi(bi(e)?e.call(this,this):e,bi(t)?t.call(this,this):t)}:t:e}function Yl(e){if(gi(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Jl(e,t){return e?[...new Set([].concat(e,t))]:t}function Ql(e,t){return e?hi(Object.create(null),e,t):t}function ec(e,t){return e?gi(e)&&gi(t)?[...new Set([...e,...t])]:hi(Object.create(null),Fl(e),Fl(null!=t?t:{})):t}function tc(){return{app:null,config:{isNativeTag:ci,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let nc=0;function rc(e,t){return function(t,n=null){bi(t)||(t=hi({},t)),null==n||ki(n)||(n=null);const r=tc(),o=new WeakSet,i=[];let a=!1;const s=r.app={_uid:nc++,_component:t,_props:n,_container:null,_context:r,_instance:null,version:md,get config(){return r.config},set config(e){},use:(e,...t)=>(o.has(e)||(e&&bi(e.install)?(o.add(e),e.install(s,...t)):bi(e)&&(o.add(e),e(s,...t))),s),mixin:e=>(__VUE_OPTIONS_API__&&(r.mixins.includes(e)||r.mixins.push(e)),s),component:(e,t)=>t?(r.components[e]=t,s):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,s):r.directives[e],mount(o,i,l){if(!a){const i=s._ceVNode||Wc(t,n);return i.appContext=r,!0===l?l="svg":!1===l&&(l=void 0),e(i,o,l),a=!0,s._container=o,o.__vue_app__=s,__VUE_PROD_DEVTOOLS__&&(s._instance=i.component,function(e){Zs("app:init",e,md,{Fragment:Dc,Text:Nc,Comment:Hc,Static:qc})}(s)),ud(i.component)}},onUnmount(e){i.push(e)},unmount(){a&&(Es(i,s._instance,16),e(null,s._container),__VUE_PROD_DEVTOOLS__&&(s._instance=null,function(e){Zs("app:unmount",e)}(s)),delete s._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,s),runWithContext(e){const t=oc;oc=s;try{return e()}finally{oc=t}}};return s}}let oc=null;function ic(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||ai;let o=n;const i=t.startsWith("update:"),a=i&&((e,t)=>"modelValue"===t||"model-value"===t?e.modelModifiers:e[`${t}Modifiers`]||e[`${Li(t)}Modifiers`]||e[`${Ii(t)}Modifiers`])(r,t.slice(7));let s;a&&(a.trim&&(o=n.map(e=>wi(e)?e.trim():e)),a.number&&(o=n.map(Ni))),__VUE_PROD_DEVTOOLS__&&function(e,t,n){Zs("component:emit",e.appContext.app,e,t,n)}(e,t,o);let l=r[s=Pi(t)]||r[s=Pi(Li(t))];!l&&i&&(l=r[s=Pi(Ii(t))]),l&&Es(l,e,6,o);const c=r[s+"Once"];if(c){if(e.emitted){if(e.emitted[s])return}else e.emitted={};e.emitted[s]=!0,Es(c,e,6,o)}}const ac=new WeakMap;function sc(e,t,n=!1){const r=__VUE_OPTIONS_API__&&n?ac:t.emitsCache,o=r.get(e);if(void 0!==o)return o;const i=e.emits;let a={},s=!1;if(__VUE_OPTIONS_API__&&!bi(e)){const r=e=>{const n=sc(e,t,!0);n&&(s=!0,hi(a,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return i||s?(gi(i)?i.forEach(e=>a[e]=null):hi(a,i),ki(e)&&r.set(e,a),a):(ki(e)&&r.set(e,null),null)}function lc(e,t){return!(!e||!di(t))&&(t=t.slice(2).replace(/Once$/,""),fi(e,t[0].toLowerCase()+t.slice(1))||fi(e,Ii(t))||fi(e,t))}function cc(e){const{type:t,vnode:n,proxy:r,withProxy:o,propsOptions:[i],slots:a,attrs:s,emit:l,render:c,renderCache:d,props:u,data:h,setupState:p,ctx:m,inheritAttrs:f}=e,g=nl(e);let v,y;try{if(4&n.shapeFlag){const e=o||r,t=e;v=Zc(c.call(t,e,d,u,p,h,m)),y=s}else{const e=t;v=Zc(e.length>1?e(u,{attrs:s,slots:a,emit:l}):e(u,null)),y=t.props?s:dc(s)}}catch(w){Ls(w,e,1),v=Wc(Hc)}let b=v;if(y&&!1!==f){const e=Object.keys(y),{shapeFlag:t}=b;e.length&&7&t&&(i&&e.some(ui)&&(y=uc(y,i)),b=Uc(b,y,!1,!0))}return n.dirs&&(b=Uc(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&pl(b,n.transition),v=b,nl(g),v}const dc=e=>{let t;for(const n in e)("class"===n||"style"===n||di(n))&&((t||(t={}))[n]=e[n]);return t},uc=(e,t)=>{const n={};for(const r in e)ui(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function hc(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let o=0;o<r.length;o++){const i=r[o];if(pc(t,e,i)&&!lc(n,i))return!0}return!1}function pc(e,t,n){const r=e[n],o=t[n];return"style"===n&&ki(r)&&ki(o)?!Xi(r,o):r!==o}const mc={},fc=()=>Object.create(mc),gc=e=>Object.getPrototypeOf(e)===mc;function vc(e,t,n,r){const[o,i]=e.propsOptions;let a,s=!1;if(t)for(let l in t){if(Mi(l))continue;const c=t[l];let d;o&&fi(o,d=Li(l))?i&&i.includes(d)?(a||(a={}))[d]=c:n[d]=c:lc(e.emitsOptions,l)||l in r&&c===r[l]||(r[l]=c,s=!0)}if(i){const t=hs(n),r=a||ai;for(let a=0;a<i.length;a++){const s=i[a];n[s]=yc(o,t,s,r[s],e,!fi(r,s))}}return s}function yc(e,t,n,r,o,i){const a=e[n];if(null!=a){const e=fi(a,"default");if(e&&void 0===r){const e=a.default;if(a.type!==Function&&!a.skipFactory&&bi(e)){const{propsDefaults:i}=o;if(n in i)r=i[n];else{const a=od(o);r=i[n]=e.call(null,t),a()}}else r=e;o.ce&&o.ce._setProp(n,r)}a[0]&&(i&&!e?r=!1:!a[1]||""!==r&&r!==Ii(n)||(r=!0))}return r}const bc=new WeakMap;function wc(e,t,n=!1){const r=__VUE_OPTIONS_API__&&n?bc:t.propsCache,o=r.get(e);if(o)return o;const i=e.props,a={},s=[];let l=!1;if(__VUE_OPTIONS_API__&&!bi(e)){const r=e=>{l=!0;const[n,r]=wc(e,t,!0);hi(a,n),r&&s.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!i&&!l)return ki(e)&&r.set(e,si),si;if(gi(i))for(let d=0;d<i.length;d++){const e=Li(i[d]);xc(e)&&(a[e]=ai)}else if(i)for(const d in i){const e=Li(d);if(xc(e)){const t=i[d],n=a[e]=gi(t)||bi(t)?{type:t}:hi({},t),r=n.type;let o=!1,l=!0;if(gi(r))for(let e=0;e<r.length;++e){const t=r[e],n=bi(t)&&t.name;if("Boolean"===n){o=!0;break}"String"===n&&(l=!1)}else o=bi(r)&&"Boolean"===r.name;n[0]=o,n[1]=l,(o||fi(n,"default"))&&s.push(e)}}const c=[a,s];return ki(e)&&r.set(e,c),c}function xc(e){return"$"!==e[0]&&!Mi(e)}const kc=e=>"_"===e||"_ctx"===e||"$stable"===e,Cc=e=>gi(e)?e.map(Zc):[Zc(e)],_c=(e,t,n)=>{if(t._n)return t;const r=function(e,t=el){if(!t)return e;if(e._n)return e;const n=(...r)=>{n._d;const o=nl(t);let i;try{i=e(...r)}finally{nl(o),n._d}return __VUE_PROD_DEVTOOLS__&&Ys(t),i};return n._n=!0,n._c=!0,n._d=!0,n}((...e)=>Cc(t(...e)),n);return r._c=!1,r},Sc=(e,t,n)=>{const r=e._ctx;for(const o in e){if(kc(o))continue;const n=e[o];if(bi(n))t[o]=_c(0,n,r);else if(null!=n){const e=Cc(n);t[o]=()=>e}}},Ac=(e,t)=>{const n=Cc(t);e.slots.default=()=>n},Mc=(e,t,n)=>{for(const r in t)!n&&kc(r)||(e[r]=t[r])},Tc=function(e,t){t&&t.pendingBranch?gi(e)?t.effects.push(...e):t.effects.push(e):function(e){gi(e)?Rs.push(...e):Ps&&-1===e.id?Ps.splice(Bs+1,0,e):1&e.flags||(Rs.push(e),e.flags|=1),qs()}(e)};function Ec(e){return function(e){"boolean"!=typeof __VUE_OPTIONS_API__&&(qi().__VUE_OPTIONS_API__=!0),"boolean"!=typeof __VUE_PROD_DEVTOOLS__&&(qi().__VUE_PROD_DEVTOOLS__=!1),"boolean"!=typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&(qi().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__=!1);const t=qi();t.__VUE__=!0,__VUE_PROD_DEVTOOLS__&&Xs(t.__VUE_DEVTOOLS_GLOBAL_HOOK__,t);const{insert:n,remove:r,patchProp:o,createElement:i,createText:a,createComment:s,setText:l,setElementText:c,parentNode:d,nextSibling:u,setScopeId:h=li,insertStaticContent:p}=e,m=(e,t,n,r=null,o=null,i=null,a=void 0,s=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!Vc(e,t)&&(r=q(e),B(e,o,i,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:c,ref:d,shapeFlag:u}=t;switch(c){case Nc:f(e,t,n,r);break;case Hc:g(e,t,n,r);break;case qc:null==e&&v(t,n,r,a);break;case Dc:S(e,t,n,r,o,i,a,s,l);break;default:1&u?y(e,t,n,r,o,i,a,s,l):6&u?A(e,t,n,r,o,i,a,s,l):(64&u||128&u)&&c.process(e,t,n,r,o,i,a,s,l,F)}null!=d&&o?yl(d,e&&e.ref,i,t||e,!t):null==d&&e&&null!=e.ref&&yl(e.ref,null,i,e,!0)},f=(e,t,r,o)=>{if(null==e)n(t.el=a(t.children),r,o);else{const n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},g=(e,t,r,o)=>{null==e?n(t.el=s(t.children||""),r,o):t.el=e.el},v=(e,t,n,r)=>{[e.el,e.anchor]=p(e.children,t,n,r,e.el,e.anchor)},y=(e,t,n,r,o,i,a,s,l)=>{if("svg"===t.type?a="svg":"math"===t.type&&(a="mathml"),null==e)b(t,n,r,o,i,a,s,l);else{const n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),k(e,t,o,i,a,s,l)}finally{n&&n._endPatch()}}},b=(e,t,r,a,s,l,d,u)=>{let h,p;const{props:m,shapeFlag:f,transition:g,dirs:v}=e;if(h=e.el=i(e.type,l,m&&m.is,m),8&f?c(h,e.children):16&f&&x(e.children,h,null,a,s,Lc(e,l),d,u),v&&rl(e,null,a,"created"),w(h,e,e.scopeId,d,a),m){for(const e in m)"value"===e||Mi(e)||o(h,e,null,m[e],l,a);"value"in m&&o(h,"value",null,m.value,l),(p=m.onVnodeBeforeMount)&&Yc(p,a,e)}__VUE_PROD_DEVTOOLS__&&(Di(h,"__vnode",e,!0),Di(h,"__vueParentComponent",a,!0)),v&&rl(e,null,a,"beforeMount");const y=function(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}(s,g);y&&g.beforeEnter(h),n(h,t,r),((p=m&&m.onVnodeMounted)||y||v)&&Tc(()=>{p&&Yc(p,a,e),y&&g.enter(h),v&&rl(e,null,a,"mounted")},s)},w=(e,t,n,r,o)=>{if(n&&h(e,n),r)for(let i=0;i<r.length;i++)h(e,r[i]);if(o){let n=o.subTree;if(t===n||zc(n.type)&&(n.ssContent===t||n.ssFallback===t)){const t=o.vnode;w(e,t,t.scopeId,t.slotScopeIds,o.parent)}}},x=(e,t,n,r,o,i,a,s,l=0)=>{for(let c=l;c<e.length;c++){const l=e[c]=s?Xc(e[c]):Zc(e[c]);m(null,l,t,n,r,o,i,a,s)}},k=(e,t,n,r,i,a,s)=>{const l=t.el=e.el;__VUE_PROD_DEVTOOLS__&&(l.__vnode=t);let{patchFlag:d,dynamicChildren:u,dirs:h}=t;d|=16&e.patchFlag;const p=e.props||ai,m=t.props||ai;let f;if(n&&Oc(n,!1),(f=m.onVnodeBeforeUpdate)&&Yc(f,n,t,e),h&&rl(t,e,n,"beforeUpdate"),n&&Oc(n,!0),(p.innerHTML&&null==m.innerHTML||p.textContent&&null==m.textContent)&&c(l,""),u?C(e.dynamicChildren,u,l,n,r,Lc(t,i),a):s||O(e,t,l,null,n,r,Lc(t,i),a,!1),d>0){if(16&d)_(l,p,m,n,i);else if(2&d&&p.class!==m.class&&o(l,"class",null,m.class,i),4&d&&o(l,"style",p.style,m.style,i),8&d){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const r=e[t],a=p[r],s=m[r];s===a&&"value"!==r||o(l,r,a,s,i,n)}}1&d&&e.children!==t.children&&c(l,t.children)}else s||null!=u||_(l,p,m,n,i);((f=m.onVnodeUpdated)||h)&&Tc(()=>{f&&Yc(f,n,t,e),h&&rl(t,e,n,"updated")},r)},C=(e,t,n,r,o,i,a)=>{for(let s=0;s<t.length;s++){const l=e[s],c=t[s],u=l.el&&(l.type===Dc||!Vc(l,c)||198&l.shapeFlag)?d(l.el):n;m(l,c,u,null,r,o,i,a,!0)}},_=(e,t,n,r,i)=>{if(t!==n){if(t!==ai)for(const a in t)Mi(a)||a in n||o(e,a,t[a],null,i,r);for(const a in n){if(Mi(a))continue;const s=n[a],l=t[a];s!==l&&"value"!==a&&o(e,a,l,s,i,r)}"value"in n&&o(e,"value",t.value,n.value,i)}},S=(e,t,r,o,i,s,l,c,d)=>{const u=t.el=e?e.el:a(""),h=t.anchor=e?e.anchor:a("");let{patchFlag:p,dynamicChildren:m,slotScopeIds:f}=t;f&&(c=c?c.concat(f):f),null==e?(n(u,r,o),n(h,r,o),x(t.children||[],r,h,i,s,l,c,d)):p>0&&64&p&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(C(e.dynamicChildren,m,r,i,s,l,c),(null!=t.key||i&&t===i.subTree)&&Ic(e,t,!0)):O(e,t,r,h,i,s,l,c,d)},A=(e,t,n,r,o,i,a,s,l)=>{t.slotScopeIds=s,null==e?512&t.shapeFlag?o.ctx.activate(t,n,r,a,l):M(t,n,r,o,i,a,l):T(e,t,l)},M=(e,t,n,r,o,i,a)=>{const s=e.component=function(e,t,n){const r=e.type,o=(t?t.appContext:e.appContext)||Jc,i={uid:Qc++,vnode:e,type:r,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ji(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:wc(r,o),emitsOptions:sc(r,o),emit:null,emitted:null,propsDefaults:ai,inheritAttrs:r.inheritAttrs,ctx:ai,data:ai,props:ai,attrs:ai,slots:ai,refs:ai,setupState:ai,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=ic.bind(null,i),e.ce&&e.ce(i),i}(e,r,o);if(xl(e)&&(s.ctx.renderer=F),function(e,t=!1,n=!1){t&&rd(t);const{props:r,children:o}=e.vnode,i=ad(e);(function(e,t,n,r=!1){const o={},i=fc();e.propsDefaults=Object.create(null),vc(e,t,o,i);for(const a in e.propsOptions[0])a in o||(o[a]=void 0);n?e.props=r?o:is(o):e.type.props?e.props=o:e.props=i,e.attrs=i})(e,r,i,t),((e,t,n)=>{const r=e.slots=fc();if(32&e.vnode.shapeFlag){const e=t._;e?(Mc(r,t,n),n&&Di(r,"_",e,!0)):Sc(t,r)}else t&&Ac(e,t)})(e,o,n||t),i&&function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Vl);const{setup:r}=n;if(r){fa();const n=e.setupContext=r.length>1?function(e){return{attrs:new Proxy(e.attrs,dd),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}(e):null,o=od(e),i=Ts(r,e,0,[e.props,n]),a=Ci(i);if(ga(),o(),!a&&!e.sp||wl(e)||fl(e),a){if(i.then(id,id),t)return i.then(t=>{ld(e,t)}).catch(t=>{Ls(t,e,0)});e.asyncDep=i}else ld(e,i)}else cd(e)}(e,t),t&&rd(!1)}(s,!1,a),s.asyncDep){if(o&&o.registerDep(s,E,a),!e.el){const r=s.subTree=Wc(Hc);g(null,r,t,n),e.placeholder=r.el}}else E(s,e,t,n,o,i,a)},T=(e,t,n)=>{const r=t.component=e.component;if(function(e,t,n){const{props:r,children:o,component:i}=e,{props:a,children:s,patchFlag:l}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!o&&!s||s&&s.$stable)||r!==a&&(r?!a||hc(r,a,c):!!a);if(1024&l)return!0;if(16&l)return r?hc(r,a,c):!!a;if(8&l){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const n=e[t];if(pc(a,r,n)&&!lc(c,n))return!0}}return!1}(e,t,n)){if(r.asyncDep&&!r.asyncResolved)return void L(r,t,n);r.next=t,r.update()}else t.el=e.el,r.vnode=t},E=(e,t,n,r,o,i,a)=>{e.scope.on();const s=e.effect=new ea(()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{const n=Rc(e);if(n)return t&&(t.el=c.el,L(e,t,a)),void n.asyncDep.then(()=>{Tc(()=>{e.isUnmounted||l()},o)})}let u,h=t;Oc(e,!1),t?(t.el=c.el,L(e,t,a)):t=c,n&&zi(n),(u=t.props&&t.props.onVnodeBeforeUpdate)&&Yc(u,s,t,c),Oc(e,!0);const p=cc(e),f=e.subTree;e.subTree=p,m(f,p,d(f.el),q(f),e,o,i),t.el=p.el,null===h&&function({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r!==e)break;(e=t.vnode).el=n,t=t.parent}}(e,p.el),r&&Tc(r,o),(u=t.props&&t.props.onVnodeUpdated)&&Tc(()=>Yc(u,s,t,c),o),__VUE_PROD_DEVTOOLS__&&Ys(e)}else{let a;const{el:s,props:l}=t,{bm:c,m:d,parent:u,root:h,type:p}=e,f=wl(t);Oc(e,!1),c&&zi(c),!f&&(a=l&&l.onVnodeBeforeMount)&&Yc(a,u,t),Oc(e,!0);{h.ce&&h.ce._hasShadowRoot()&&h.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);const a=e.subTree=cc(e);m(null,a,n,r,e,o,i),t.el=a.el}if(d&&Tc(d,o),!f&&(a=l&&l.onVnodeMounted)){const e=t;Tc(()=>Yc(a,u,e),o)}(256&t.shapeFlag||u&&wl(u.vnode)&&256&u.vnode.shapeFlag)&&e.a&&Tc(e.a,o),e.isMounted=!0,__VUE_PROD_DEVTOOLS__&&Ks(e),t=n=r=null}});e.scope.off();const l=e.update=s.run.bind(s),c=e.job=s.runIfDirty.bind(s);c.i=e,c.id=e.uid,s.scheduler=()=>Hs(c),Oc(e,!0),l()},L=(e,t,n)=>{t.component=e;const r=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,r){const{props:o,attrs:i,vnode:{patchFlag:a}}=e,s=hs(o),[l]=e.propsOptions;let c=!1;if(!(r||a>0)||16&a){let r;vc(e,t,o,i)&&(c=!0);for(const i in s)t&&(fi(t,i)||(r=Ii(i))!==i&&fi(t,r))||(l?!n||void 0===n[i]&&void 0===n[r]||(o[i]=yc(l,s,i,void 0,e,!0)):delete o[i]);if(i!==s)for(const e in i)t&&fi(t,e)||(delete i[e],c=!0)}else if(8&a){const n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let a=n[r];if(lc(e.emitsOptions,a))continue;const d=t[a];if(l)if(fi(i,a))d!==i[a]&&(i[a]=d,c=!0);else{const t=Li(a);o[t]=yc(l,s,t,d,e,!1)}else d!==i[a]&&(i[a]=d,c=!0)}}c&&Ma(e.attrs,"set","")}(e,t.props,r,n),((e,t,n)=>{const{vnode:r,slots:o}=e;let i=!0,a=ai;if(32&r.shapeFlag){const e=t._;e?n&&1===e?i=!1:Mc(o,t,n):(i=!t.$stable,Sc(t,o)),a=t}else t&&(Ac(e,t),a={default:1});if(i)for(const s in o)kc(s)||null!=a[s]||delete o[s]})(e,t.children,n),fa(),js(e),ga()},O=(e,t,n,r,o,i,a,s,l=!1)=>{const d=e&&e.children,u=e?e.shapeFlag:0,h=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(128&p)return void R(d,h,n,r,o,i,a,s,l);if(256&p)return void I(d,h,n,r,o,i,a,s,l)}8&m?(16&u&&H(d,o,i),h!==d&&c(n,h)):16&u?16&m?R(d,h,n,r,o,i,a,s,l):H(d,o,i,!0):(8&u&&c(n,""),16&m&&x(h,n,r,o,i,a,s,l))},I=(e,t,n,r,o,i,a,s,l)=>{t=t||si;const c=(e=e||si).length,d=t.length,u=Math.min(c,d);let h;for(h=0;h<u;h++){const r=t[h]=l?Xc(t[h]):Zc(t[h]);m(e[h],r,n,null,o,i,a,s,l)}c>d?H(e,o,i,!0,!1,u):x(t,n,r,o,i,a,s,l,u)},R=(e,t,n,r,o,i,a,s,l)=>{let c=0;const d=t.length;let u=e.length-1,h=d-1;for(;c<=u&&c<=h;){const r=e[c],d=t[c]=l?Xc(t[c]):Zc(t[c]);if(!Vc(r,d))break;m(r,d,n,null,o,i,a,s,l),c++}for(;c<=u&&c<=h;){const r=e[u],c=t[h]=l?Xc(t[h]):Zc(t[h]);if(!Vc(r,c))break;m(r,c,n,null,o,i,a,s,l),u--,h--}if(c>u){if(c<=h){const e=h+1,u=e<d?t[e].el:r;for(;c<=h;)m(null,t[c]=l?Xc(t[c]):Zc(t[c]),n,u,o,i,a,s,l),c++}}else if(c>h)for(;c<=u;)B(e[c],o,i,!0),c++;else{const p=c,f=c,g=new Map;for(c=f;c<=h;c++){const e=t[c]=l?Xc(t[c]):Zc(t[c]);null!=e.key&&g.set(e.key,c)}let v,y=0;const b=h-f+1;let w=!1,x=0;const k=new Array(b);for(c=0;c<b;c++)k[c]=0;for(c=p;c<=u;c++){const r=e[c];if(y>=b){B(r,o,i,!0);continue}let d;if(null!=r.key)d=g.get(r.key);else for(v=f;v<=h;v++)if(0===k[v-f]&&Vc(r,t[v])){d=v;break}void 0===d?B(r,o,i,!0):(k[d-f]=c+1,d>=x?x=d:w=!0,m(r,t[d],n,null,o,i,a,s,l),y++)}const C=w?function(e){const t=e.slice(),n=[0];let r,o,i,a,s;const l=e.length;for(r=0;r<l;r++){const l=e[r];if(0!==l){if(o=n[n.length-1],e[o]<l){t[r]=o,n.push(r);continue}for(i=0,a=n.length-1;i<a;)s=i+a>>1,e[n[s]]<l?i=s+1:a=s;l<e[n[i]]&&(i>0&&(t[r]=n[i-1]),n[i]=r)}}for(i=n.length,a=n[i-1];i-- >0;)n[i]=a,a=t[a];return n}(k):si;for(v=C.length-1,c=b-1;c>=0;c--){const e=f+c,u=t[e],h=t[e+1],p=e+1<d?h.el||Bc(h):r;0===k[c]?m(null,u,n,p,o,i,a,s,l):w&&(v<0||c!==C[v]?P(u,n,p,2):v--)}}},P=(e,t,o,i,a=null)=>{const{el:s,type:l,transition:c,children:d,shapeFlag:h}=e;if(6&h)P(e.component.subTree,t,o,i);else if(128&h)e.suspense.move(t,o,i);else if(64&h)l.move(e,t,o,F);else if(l!==Dc)if(l!==qc)if(2!==i&&1&h&&c)if(0===i)c.beforeEnter(s),n(s,t,o),Tc(()=>c.enter(s),a);else{const{leave:i,delayLeave:a,afterLeave:l}=c,d=()=>{e.ctx.isUnmounted?r(s):n(s,t,o)},u=()=>{s._isLeaving&&s[hl](!0),i(s,()=>{d(),l&&l()})};a?a(s,d,u):u()}else n(s,t,o);else(({el:e,anchor:t},r,o)=>{let i;for(;e&&e!==t;)i=u(e),n(e,r,o),e=i;n(t,r,o)})(e,t,o);else{n(s,t,o);for(let e=0;e<d.length;e++)P(d[e],t,o,i);n(e.anchor,t,o)}},B=(e,t,n,r=!1,o=!1)=>{const{type:i,props:a,ref:s,children:l,dynamicChildren:c,shapeFlag:d,patchFlag:u,dirs:h,cacheIndex:p}=e;if(-2===u&&(o=!1),null!=s&&(fa(),yl(s,null,n,e,!0),ga()),null!=p&&(t.renderCache[p]=void 0),256&d)return void t.ctx.deactivate(e);const m=1&d&&h,f=!wl(e);let g;if(f&&(g=a&&a.onVnodeBeforeUnmount)&&Yc(g,t,e),6&d)N(e.component,n,r);else{if(128&d)return void e.suspense.unmount(n,r);m&&rl(e,null,t,"beforeUnmount"),64&d?e.type.remove(e,t,n,F,r):c&&!c.hasOnce&&(i!==Dc||u>0&&64&u)?H(c,t,n,!1,!0):(i===Dc&&384&u||!o&&16&d)&&H(l,t,n),r&&z(e)}(f&&(g=a&&a.onVnodeUnmounted)||m)&&Tc(()=>{g&&Yc(g,t,e),m&&rl(e,null,t,"unmounted")},n)},z=e=>{const{type:t,el:n,anchor:o,transition:i}=e;if(t===Dc)return void D(n,o);if(t===qc)return void(({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=u(e),r(e),e=n;r(t)})(e);const a=()=>{r(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(1&e.shapeFlag&&i&&!i.persisted){const{leave:t,delayLeave:r}=i,o=()=>t(n,a);r?r(e.el,a,o):o()}else a()},D=(e,t)=>{let n;for(;e!==t;)n=u(e),r(e),e=n;r(t)},N=(e,t,n)=>{const{bum:r,scope:o,job:i,subTree:a,um:s,m:l,a:c}=e;Pc(l),Pc(c),r&&zi(r),o.stop(),i&&(i.flags|=8,B(a,e,t,n)),s&&Tc(s,t),Tc(()=>{e.isUnmounted=!0},t),__VUE_PROD_DEVTOOLS__&&(e=>{Ws&&"function"==typeof Ws.cleanupBuffer&&!Ws.cleanupBuffer(e)&&Js(e)})(e)},H=(e,t,n,r=!1,o=!1,i=0)=>{for(let a=i;a<e.length;a++)B(e[a],t,n,r,o)},q=e=>{if(6&e.shapeFlag)return q(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();const t=u(e.anchor||e.el),n=t&&t[ul];return n?u(n):t};let j=!1;const V=(e,t,n)=>{let r;null==e?t._vnode&&(B(t._vnode,null,null,!0),r=t._vnode.component):m(t._vnode||null,e,t,null,null,null,n),t._vnode=e,j||(j=!0,js(r),Vs(),j=!1)},F={p:m,um:B,m:P,r:z,mt:M,mc:x,pc:O,pbc:C,n:q,o:e};return{render:V,hydrate:void 0,createApp:rc(V)}}(e)}function Lc({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Oc({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Ic(e,t,n=!1){const r=e.children,o=t.children;if(gi(r)&&gi(o))for(let i=0;i<r.length;i++){const e=r[i];let t=o[i];1&t.shapeFlag&&!t.dynamicChildren&&((t.patchFlag<=0||32===t.patchFlag)&&(t=o[i]=Xc(o[i]),t.el=e.el),n||-2===t.patchFlag||Ic(e,t)),t.type===Nc&&(-1===t.patchFlag&&(t=o[i]=Xc(t)),t.el=e.el),t.type!==Hc||t.el||(t.el=e.el)}}function Rc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Rc(t)}function Pc(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Bc(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Bc(t.subTree):null}const zc=e=>e.__isSuspense,Dc=Symbol.for("v-fgt"),Nc=Symbol.for("v-txt"),Hc=Symbol.for("v-cmt"),qc=Symbol.for("v-stc");function jc(e){return!!e&&!0===e.__v_isVNode}function Vc(e,t){return e.type===t.type&&e.key===t.key}const Fc=({key:e})=>null!=e?e:null,$c=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?wi(e)||fs(e)||bi(e)?{i:el,r:e,k:t,f:!!n}:e:null),Wc=function(e,t=null,n=null,r=0,o=null,i=!1){if(e&&e!==Nl||(e=Hc),jc(e)){const r=Uc(e,t,!0);return n&&Kc(r,n),r.patchFlag=-2,r}if(function(e){return bi(e)&&"__vccOpts"in e}(e)&&(e=e.__vccOpts),t){t=function(e){return e?us(e)||gc(e)?hi({},e):e:null}(t);let{class:e,style:n}=t;e&&!wi(e)&&(t.class=Ui(e)),ki(n)&&(us(n)&&!gi(n)&&(n=hi({},n)),t.style=ji(n))}return function(e,t=null,n=null,r=0,o=null,i=(e===Dc?0:1),a=!1,s=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Fc(t),ref:t&&$c(t),scopeId:tl,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:el};return s?(Kc(l,n),128&i&&e.normalize(l)):n&&(l.shapeFlag|=wi(n)?8:16),l}(e,t,n,r,o,wi(e)?1:zc(e)?128:(e=>e.__isTeleport)(e)?64:ki(e)?4:bi(e)?2:0,i,!0)};function Uc(e,t,n=!1,r=!1){const{props:o,ref:i,patchFlag:a,children:s,transition:l}=e,c=t?function(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const e in r)if("class"===e)t.class!==r.class&&(t.class=Ui([t.class,r.class]));else if("style"===e)t.style=ji([t.style,r.style]);else if(di(e)){const n=t[e],o=r[e];!o||n===o||gi(n)&&n.includes(o)||(t[e]=n?[].concat(n,o):o)}else""!==e&&(t[e]=r[e])}return t}(o||{},t):o,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Fc(c),ref:t&&t.ref?n&&i?gi(i)?i.concat($c(t)):[i,$c(t)]:$c(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Dc?-1===a?16:16|a:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Uc(e.ssContent),ssFallback:e.ssFallback&&Uc(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&pl(d,l.clone(d)),d}function Gc(e=" ",t=0){return Wc(Nc,null,e,t)}function Zc(e){return null==e||"boolean"==typeof e?Wc(Hc):gi(e)?Wc(Dc,null,e.slice()):jc(e)?Xc(e):Wc(Nc,null,String(e))}function Xc(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Uc(e)}function Kc(e,t){let n=0;const{shapeFlag:r}=e;if(null==t)t=null;else if(gi(t))n=16;else if("object"==typeof t){if(65&r){const n=t.default;return void(n&&(n._c&&(n._d=!1),Kc(e,n()),n._c&&(n._d=!0)))}{n=32;const r=t._;r||gc(t)?3===r&&el&&(1===el.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=el}}else bi(t)?(t={default:t,_ctx:el},n=32):(t=String(t),64&r?(n=16,t=[Gc(t)]):n=8);e.children=t,e.shapeFlag|=n}function Yc(e,t,n,r=null){Es(e,t,7,[n,r])}const Jc=tc();let Qc=0,ed=null;const td=()=>ed||el;let nd,rd;{const e=qi(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};nd=t("__VUE_INSTANCE_SETTERS__",e=>ed=e),rd=t("__VUE_SSR_SETTERS__",e=>sd=e)}const od=e=>{const t=ed;return nd(e),e.scope.on(),()=>{e.scope.off(),nd(t)}},id=()=>{ed&&ed.scope.off(),nd(null)};function ad(e){return 4&e.vnode.shapeFlag}let sd=!1;function ld(e,t,n){bi(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ki(t)&&(__VUE_PROD_DEVTOOLS__&&(e.devtoolsRawSetupState=t),e.setupState=xs(t)),cd(e)}function cd(e,t,n){const r=e.type;if(e.render||(e.render=r.render||li),__VUE_OPTIONS_API__){const t=od(e);fa();try{!function(e){const t=Gl(e),n=e.proxy,r=e.ctx;$l=!1,t.beforeCreate&&Wl(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:a,watch:s,provide:l,inject:c,created:d,beforeMount:u,mounted:h,beforeUpdate:p,updated:m,activated:f,deactivated:g,beforeDestroy:v,beforeUnmount:y,destroyed:b,unmounted:w,render:x,renderTracked:k,renderTriggered:C,errorCaptured:_,serverPrefetch:S,expose:A,inheritAttrs:M,components:T,directives:E,filters:L}=t;if(c&&function(e,t){gi(e)&&(e=Yl(e));for(const n in e){const r=e[n];let o;o=ki(r)?"default"in r?ol(r.from||n,r.default,!0):ol(r.from||n):ol(r),fs(o)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>o.value,set:e=>o.value=e}):t[n]=o}}(c,r),a)for(const I in a){const e=a[I];bi(e)&&(r[I]=e.bind(n))}if(o){const t=o.call(n,n);ki(t)&&(e.data=os(t))}if($l=!0,i)for(const I in i){const e=i[I],t=bi(e)?e.bind(n,n):bi(e.get)?e.get.bind(n,n):li,o=!bi(e)&&bi(e.set)?e.set.bind(n):li,a=hd({get:t,set:o});Object.defineProperty(r,I,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(s)for(const I in s)Ul(s[I],r,n,I);if(l){const e=bi(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{!function(e,t){if(ed){let n=ed.provides;const r=ed.parent&&ed.parent.provides;r===n&&(n=ed.provides=Object.create(r)),n[e]=t}}(t,e[t])})}function O(e,t){gi(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(d&&Wl(d,e,"c"),O(Tl,u),O(El,h),O(Ll,p),O(Ol,m),O(kl,f),O(Cl,g),O(Dl,_),O(zl,k),O(Bl,C),O(Il,y),O(Rl,w),O(Pl,S),gi(A))if(A.length){const t=e.exposed||(e.exposed={});A.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||(e.exposed={});x&&e.render===li&&(e.render=x),null!=M&&(e.inheritAttrs=M),T&&(e.components=T),E&&(e.directives=E),S&&fl(e)}(e)}finally{ga(),t()}}}const dd={get:(e,t)=>(Aa(e,0,""),e[t])};function ud(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(xs(function(e){return!fi(e,"__v_skip")&&Object.isExtensible(e)&&Di(e,"__v_skip",!0),e}(e.exposed)),{get:(t,n)=>n in t?t[n]:n in ql?ql[n](e):void 0,has:(e,t)=>t in e||t in ql})):e.proxy}const hd=(e,t)=>Cs(e,0,sd);function pd(e,t,n){try{const r=arguments.length;return 2===r?ki(t)&&!gi(t)?jc(t)?Wc(e,null,[t]):Wc(e,t):Wc(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):3===r&&jc(n)&&(n=[n]),Wc(e,t,n))}finally{}}const md="3.5.30";let fd;const gd="undefined"!=typeof window&&window.trustedTypes;if(gd)try{fd=gd.createPolicy("vue",{createHTML:e=>e})}catch(_T){}const vd=fd?e=>fd.createHTML(e):e=>e,yd="undefined"!=typeof document?document:null,bd=yd&&yd.createElement("template"),wd={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const o="svg"===t?yd.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?yd.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?yd.createElement(e,{is:n}):yd.createElement(e);return"select"===e&&r&&null!=r.multiple&&o.setAttribute("multiple",r.multiple),o},createText:e=>yd.createTextNode(e),createComment:e=>yd.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>yd.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,o,i){const a=n?n.previousSibling:t.lastChild;if(o&&(o===i||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),o!==i&&(o=o.nextSibling););else{bd.innerHTML=vd("svg"===r?`<svg>${e}</svg>`:"mathml"===r?`<math>${e}</math>`:e);const o=bd.content;if("svg"===r||"mathml"===r){const e=o.firstChild;for(;e.firstChild;)o.appendChild(e.firstChild);o.removeChild(e)}t.insertBefore(o,n)}return[a?a.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},xd=Symbol("_vtc"),kd=Symbol("_vod"),Cd=Symbol("_vsh"),_d=Symbol(""),Sd=/(?:^|;)\s*display\s*:/,Ad=/\s*!important$/;function Md(e,t,n){if(gi(n))n.forEach(n=>Md(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=function(e,t){const n=Ed[t];if(n)return n;let r=Li(t);if("filter"!==r&&r in e)return Ed[t]=r;r=Ri(r);for(let o=0;o<Td.length;o++){const n=Td[o]+r;if(n in e)return Ed[t]=n}return t}(e,t);Ad.test(n)?e.setProperty(Ii(r),n.replace(Ad,""),"important"):e[r]=n}}const Td=["Webkit","Moz","ms"],Ed={},Ld="http://www.w3.org/1999/xlink";function Od(e,t,n,r,o,i=Gi(t)){r&&t.startsWith("xlink:")?null==n?e.removeAttributeNS(Ld,t.slice(6,t.length)):e.setAttributeNS(Ld,t,n):null==n||i&&!Zi(n)?e.removeAttribute(t):e.setAttribute(t,i?"":xi(n)?String(n):n)}function Id(e,t,n,r,o){if("innerHTML"===t||"textContent"===t)return void(null!=n&&(e[t]="innerHTML"===t?vd(n):n));const i=e.tagName;if("value"===t&&"PROGRESS"!==i&&!i.includes("-")){const r="OPTION"===i?e.getAttribute("value")||"":e.value,o=null==n?"checkbox"===e.type?"on":"":String(n);return r===o&&"_value"in e||(e.value=o),null==n&&e.removeAttribute(t),void(e._value=n)}let a=!1;if(""===n||null==n){const r=typeof e[t];"boolean"===r?n=Zi(n):null==n&&"string"===r?(n="",a=!0):"number"===r&&(n=0,a=!0)}try{e[t]=n}catch(_T){}a&&e.removeAttribute(o||t)}const Rd=Symbol("_vei"),Pd=/(?:Once|Passive|Capture)$/;let Bd=0;const zd=Promise.resolve(),Dd=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Nd=hi({patchProp:(e,t,n,r,o,i)=>{const a="svg"===o;"class"===t?function(e,t,n){const r=e[xd];r&&(t=(t?[t,...r]:[...r]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,r,a):"style"===t?function(e,t,n){const r=e.style,o=wi(n);let i=!1;if(n&&!o){if(t)if(wi(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&Md(r,t,"")}else for(const e in t)null==n[e]&&Md(r,e,"");for(const e in n)"display"===e&&(i=!0),Md(r,e,n[e])}else if(o){if(t!==n){const e=r[_d];e&&(n+=";"+e),r.cssText=n,i=Sd.test(n)}}else t&&e.removeAttribute("style");kd in e&&(e[kd]=i?r.display:"",e[Cd]&&(r.display="none"))}(e,n,r):di(t)?ui(t)||function(e,t,n,r,o=null){const i=e[Rd]||(e[Rd]={}),a=i[t];if(r&&a)a.value=r;else{const[n,s]=function(e){let t;if(Pd.test(e)){let n;for(t={};n=e.match(Pd);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):Ii(e.slice(2)),t]}(t);if(r){const a=i[t]=function(e,t){const n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();Es(function(e,t){if(gi(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=Bd||(zd.then(()=>Bd=0),Bd=Date.now()),n}(r,o);!function(e,t,n,r){e.addEventListener(t,n,r)}(e,n,a,s)}else a&&(function(e,t,n,r){e.removeEventListener(t,n,r)}(e,n,a,s),i[t]=void 0)}}(e,t,0,r,i):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,r){if(r)return"innerHTML"===t||"textContent"===t||!!(t in e&&Dd(t)&&bi(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"autocorrect"===t)return!1;if("sandbox"===t&&"IFRAME"===e.tagName)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return(!Dd(t)||!wi(n))&&t in e}(e,t,r,a))?(Id(e,t,r),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||Od(e,t,r,a,0,"value"!==t)):e._isVueCE&&(function(e,t){const n=e._def.props;if(!n)return!1;const r=Li(t);return Array.isArray(n)?n.some(e=>Li(e)===r):Object.keys(n).some(e=>Li(e)===r)}(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!wi(r)))?Id(e,Li(t),r,0,t):("true-value"===t?e._trueValue=r:"false-value"===t&&(e._falseValue=r),Od(e,t,r,a))}},wd);let Hd;const qd=(...e)=>{const t=(Hd||(Hd=Ec(Nd))).createApp(...e),{mount:n}=t;return t.mount=e=>{const r=function(e){return wi(e)?document.querySelector(e):e}(e);if(!r)return;const o=t._component;bi(o)||o.render||o.template||(o.template=r.innerHTML),1===r.nodeType&&(r.textContent="");const i=n(r,!1,function(e){return e instanceof SVGElement?"svg":"function"==typeof MathMLElement&&e instanceof MathMLElement?"mathml":void 0}(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),i},t};function jd({icon:e,class:t,onClick:n}){return pd("span",{class:Ln("milkdown-icon",t),onPointerdown:n,innerHTML:e?Sn.sanitize(e.trim()):void 0})}function Vd(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-block",...t}}),e}jd.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};var Fd=a({filterNodes:e=>!A(e=>"table"===e.type.name)(e)},"blockConfig");Vd(Fd,{displayName:"Ctx<blockConfig>"});var $d=E.ie&&E.ie_version<15||E.ios&&E.webkit_version<604,Wd=class{constructor(){this.#m=()=>{if(!this.#f)return null;const e=this.#f,t=this.#g;if(t&&M.isSelectable(e.node)){const n=M.create(t.state.doc,e.$pos.pos);return t.dispatch(t.state.tr.setSelection(n)),t.focus(),this.#v=n,n}return null},this.#v=null,this.#f=null,this.#y=void 0,this.#b=!1,this.#w=()=>{this.#x?.({type:"hide"}),this.#f=null},this.#k=e=>{this.#f=e,this.#x?.({type:"show",active:e})},this.bind=(e,t)=>{this.#C=e,this.#x=t},this.addEvent=e=>{e.addEventListener("mousedown",this.#_),e.addEventListener("mouseup",this.#S),e.addEventListener("dragstart",this.#A),e.addEventListener("dragend",this.#M)},this.removeEvent=e=>{e.removeEventListener("mousedown",this.#_),e.removeEventListener("mouseup",this.#S),e.removeEventListener("dragstart",this.#A),e.removeEventListener("dragend",this.#M)},this.unBind=()=>{this.#x=void 0},this.#_=()=>{this.#y=this.#f?.el.getBoundingClientRect(),this.#m()},this.#S=()=>{this.#b?(this.#b=!1,this.#v=null):requestAnimationFrame(()=>{this.#y&&this.#g?.focus()})},this.#A=e=>{this.#b=!0;const t=this.#g;if(!t)return;t.dom.dataset.dragging="true";const n=this.#v;if(e.dataTransfer&&n){const r=n.content();e.dataTransfer.effectAllowed="copyMove";const{dom:o,text:i}=t.serializeForClipboard(r);e.dataTransfer.clearData(),e.dataTransfer.setData($d?"Text":"text/html",o.innerHTML),$d||e.dataTransfer.setData("text/plain",i);const a=this.#f?.el;a&&e.dataTransfer.setDragImage(a,0,0),t.dragging={slice:r,move:!0}}},this.#M=()=>{this.#g&&this.#T(this.#g)},this.keydownCallback=e=>(this.#w(),this.#b=!1,e.dom.dataset.dragging="false",!1),this.#E=gr((e,t)=>{if(!e.editable)return;const n=e.dom.getBoundingClientRect(),r=n.left+n.width/2;if(!(e.root.elementFromPoint(r,t.clientY)instanceof Element))return void this.#w();const o=this.#L;if(!o)return;const i=function(e,t,n){if(!e.dom.parentElement)return null;try{const r=e.posAtCoords({left:t.x,top:t.y})?.inside;if(null==r||r<0)return null;let o=e.state.doc.resolve(r),i=e.state.doc.nodeAt(r),a=e.nodeDOM(r);const s=t=>{const r=o.depth>=1&&0===o.index(o.depth);if(!t&&!r)return;const l=o.before(o.depth);i=e.state.doc.nodeAt(l),a=e.nodeDOM(l),o=e.state.doc.resolve(l),n(o,i)||s(!0)};return s(!n(o,i)),a&&i?{node:i,$pos:o,el:a}:null}catch{return null}}(e,{x:r,y:t.clientY},o);i?this.#k(i):this.#w()},200),this.mousemoveCallback=(e,t)=>(e.composing||!e.editable||this.#E(e,t),!1),this.dragoverCallback=(e,t)=>{if(this.#b){const n=this.#g?.dom.parentElement;if(!n)return!1;const r=n.scrollHeight>n.clientHeight,o=n.getBoundingClientRect();if(r){if(n.scrollTop>0&&Math.abs(t.y-o.y)<20)return n.scrollTop=n.scrollTop>10?n.scrollTop-10:0,!1;const r=Math.round(e.dom.getBoundingClientRect().height);if(Math.round(n.scrollTop+o.height)<r&&Math.abs(t.y-(o.height+o.y))<20)return n.scrollTop=n.scrollTop+10,!1}}return!1},this.dragenterCallback=e=>{e.dragging&&(this.#b=!0,e.dom.dataset.dragging="true")},this.dragleaveCallback=(e,t)=>{const n=t.clientX,r=t.clientY;(n<0||r<0||n>window.innerWidth||r>window.innerHeight)&&(this.#f=null,this.#T(e))},this.dropCallback=e=>(this.#T(e),!1),this.dragendCallback=e=>{this.#T(e)},this.#T=e=>{this.#b=!1,e.dom.dataset.dragging="false"}}#C;#m;#v;#f;#y;#b;get#L(){try{return this.#C?.get(Fd.key).filterNodes}catch{return}}get#g(){return this.#C?.get(T)}#x;#w;#k;#_;#S;#A;#M;#E;#T},Ud=a(()=>new Wd,"blockService"),Gd=a({},"blockServiceInstance");Vd(Ud,{displayName:"Ctx<blockService>"}),Vd(Gd,{displayName:"Ctx<blockServiceInstance>"});var Zd=a({},"blockSpec");Vd(Zd,{displayName:"Ctx<blockSpec>"});var Xd=s(e=>{const t=new d("MILKDOWN_BLOCK"),n=e.get(Ud.key)();e.set(Gd.key,n);const r=e.get(Zd.key);return new c({key:t,...r,props:{...r.props,handleDOMEvents:{drop:e=>n.dropCallback(e),pointermove:(e,t)=>n.mousemoveCallback(e,t),keydown:e=>n.keydownCallback(e),dragover:(e,t)=>n.dragoverCallback(e,t),dragleave:(e,t)=>n.dragleaveCallback(e,t),dragenter:e=>n.dragenterCallback(e),dragend:e=>n.dragendCallback(e)}}})});Vd(Xd,{displayName:"Prose<block>"});var Kd=class{#O;#C;#I;#R;#o;#i;#n;#r;#P;#B;#z;get active(){return this.#R}constructor(e){this.#R=null,this.#i=!1,this.update=()=>{requestAnimationFrame(()=>{if(!this.#i)try{this.#D(),this.#i=!0}catch{}})},this.destroy=()=>{this.#I?.unBind(),this.#I?.removeEvent(this.#O),this.#O.remove()},this.show=e=>{const t=e.el,n=this.#C.get(T).dom,r={ctx:this.#C,active:e,editorDom:n,blockDom:this.#O},o={contextElement:t,getBoundingClientRect:()=>this.#B?this.#B(r):t.getBoundingClientRect()},i=[w()];if(this.#P){const e=x(this.#P(r));i.push(e)}b(o,this.#O,{placement:this.#z?this.#z(r):"left",middleware:[...i,...this.#n],...this.#r}).then(({x:e,y:t})=>{Object.assign(this.#O.style,{left:`${e}px`,top:`${t}px`}),this.#O.dataset.show="true"}).catch(console.error)},this.hide=()=>{this.#O.dataset.show="false"},this.#C=e.ctx,this.#O=e.content,this.#P=e.getOffset,this.#B=e.getPosition,this.#z=e.getPlacement,this.#n=e.middleware??[],this.#r=e.floatingUIOptions??{},this.#o=e.root,this.hide()}#D(){const e=this.#C.get(T);(this.#o??e.dom.parentElement??document.body).appendChild(this.#O);const t=this.#C.get(Gd.key);t.bind(this.#C,e=>{"hide"===e.type?(this.hide(),this.#R=null):"show"===e.type&&(this.show(e.active),this.#R=e.active)}),this.#I=t,this.#I.addEvent(this.#O),this.#O.draggable=!0}},Yd=[Zd,Fd,Ud,Gd,Xd];Yd.key=Zd.key,Yd.pluginKey=Xd.key;var Jd=class{#i;#n;#r;#o;#e;#N;#t;#c;#s;constructor(e){this.#i=!1,this.onShow=()=>{},this.onHide=()=>{},this.#h=(e,t)=>{const{state:n,composing:r}=e,{selection:o,doc:i}=n,{ranges:a}=o,s=Math.min(...a.map(e=>e.$from.pos)),l=Math.max(...a.map(e=>e.$to.pos)),c=t&&t.doc.eq(i)&&t.selection.eq(o);this.#i||((this.#o??e.dom.parentElement??document.body).appendChild(this.element),this.#i=!0),r||c||(this.#t(e,t)?(b({getBoundingClientRect:()=>_(e,s,l)},this.element,{placement:"bottom-start",middleware:[w(),x(this.#s),...this.#n],...this.#r}).then(({x:e,y:t})=>{Object.assign(this.element.style,{left:`${e}px`,top:`${t}px`})}).catch(console.error),this.show()):this.hide())},this.#p=e=>{const t=this.getContent(e);if(!t)return!1;const n=t.at(-1);return!!n&&(Array.isArray(this.#N)?this.#N.includes(n):this.#N===n)},this.update=(e,t)=>{this.#c(e,t)},this.getContent=(e,t=e=>"paragraph"===e.type.name)=>{const{selection:n}=e.state,{empty:r,$from:o}=n,i=e.state.selection instanceof S;if("undefined"==typeof document)return;const a=this.element.contains(document.activeElement),s=!e.hasFocus()&&!a,l=!e.editable,c=!L(t)(e.state.selection);return s||l||!r||!i||c?void 0:o.parent.textBetween(Math.max(0,o.parentOffset-500),o.parentOffset,void 0,"")},this.destroy=()=>{this.#c.cancel()},this.show=()=>{this.element.dataset.show="true",this.onShow()},this.hide=()=>{this.element.dataset.show="false",this.onHide()},this.element=e.content,this.#e=e.debounce??200,this.#t=e.shouldShow??this.#p,this.#N=e.trigger??"/",this.#s=e.offset,this.#n=e.middleware??[],this.#r=e.floatingUIOptions??{},this.#o=e.root,this.#c=hr(this.#h,this.#e)}#h;#p};let Qd=e=>crypto.getRandomValues(new Uint8Array(e)),eu=(e,t=21)=>((e,t,n)=>{let r=256-256%e.length;if(256===r){let r=e.length-1;return(o=t)=>{if(!o)return"";let i="";for(;;){let t=n(o),a=o;for(;a--;)if(i+=e[t[a]&r],i.length>=o)return i}}}let o=Math.ceil(409.6*t/r);return(i=t)=>{if(!i)return"";let a="";for(;;){let t=n(o),s=o;for(;s--;)if(t[s]<r&&(a+=e[t[s]%e.length],a.length>=i))return a}}})(e,0|t,Qd);var tu=Object.defineProperty,nu=Object.getOwnPropertySymbols,ru=Object.prototype.hasOwnProperty,ou=Object.prototype.propertyIsEnumerable,iu=(e,t,n)=>t in e?tu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,au=(e,t)=>{for(var n in t||(t={}))ru.call(t,n)&&iu(e,n,t[n]);if(nu)for(var n of nu(t))ou.call(t,n)&&iu(e,n,t[n]);return e};function su(e,t){return Object.assign(e,{meta:au({package:"@milkdown/components"},t)}),e}const lu=a({imageIcon:"🌌",captionIcon:"💬",uploadButton:"Upload file",confirmButton:"Confirm ⏎",uploadPlaceholderText:"or paste the image link ...",captionPlaceholderText:"Image caption",onUpload:e=>Promise.resolve(URL.createObjectURL(e))},"imageBlockConfigCtx");function cu(e){return Et(e,"paragraph",(e,t,n)=>{var r,o;if(1!==(null==(r=e.children)?void 0:r.length))return;const i=null==(o=e.children)?void 0:o[0];if(!i||"image"!==i.type)return;const{url:a,alt:s,title:l}=i,c={type:"image-block",url:a,alt:s,title:l};n.children.splice(t,1,c)})}su(lu,{displayName:"Config<image-block>",group:"ImageBlock"});const du=O("remark-image-block",()=>()=>cu);su(du.plugin,{displayName:"Remark<remarkImageBlock>",group:"ImageBlock"}),su(du.options,{displayName:"RemarkConfig<remarkImageBlock>",group:"ImageBlock"});var uu=Object.defineProperty,hu=Object.getOwnPropertySymbols,pu=Object.prototype.hasOwnProperty,mu=Object.prototype.propertyIsEnumerable,fu=(e,t,n)=>t in e?uu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gu=(e,t)=>{for(var n in t||(t={}))pu.call(t,n)&&fu(e,n,t[n]);if(hu)for(var n of hu(t))mu.call(t,n)&&fu(e,n,t[n]);return e};const vu="image-block",yu=I("image-block",()=>({inline:!1,group:"block",selectable:!0,draggable:!0,isolating:!0,marks:"",atom:!0,priority:100,attrs:{src:{default:"",validate:"string"},caption:{default:"",validate:"string"},ratio:{default:1,validate:"number"}},parseDOM:[{tag:`img[data-type="${vu}"]`,getAttrs:e=>{var t;if(!(e instanceof HTMLElement))throw P(e);return{src:e.getAttribute("src")||"",caption:e.getAttribute("caption")||"",ratio:Number(null!=(t=e.getAttribute("ratio"))?t:1)}}}],toDOM:e=>["img",gu({"data-type":vu},e.attrs)],parseMarkdown:{match:({type:e})=>"image-block"===e,runner:(e,t,n)=>{const r=t.url,o=t.title;let i=Number(t.alt||1);(Number.isNaN(i)||0===i)&&(i=1),e.addNode(n,{src:r,caption:o,ratio:i})}},toMarkdown:{match:e=>"image-block"===e.type.name,runner:(e,t)=>{e.openNode("paragraph"),e.addNode("image",void 0,void 0,{title:t.attrs.caption,url:t.attrs.src,alt:`${Number.parseFloat(t.attrs.ratio).toFixed(2)}`}),e.closeNode()}}}));function bu({icon:e,class:t,onClick:n}){return pd("span",{class:Ln("milkdown-icon",t),onPointerdown:n,innerHTML:e?Sn.sanitize(e.trim()):void 0})}su(yu.node,{displayName:"NodeSchema<image-block>",group:"ImageBlock"}),bu.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const wu=eu("abcdefg",8),xu=ml({props:{src:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setLink:{type:Function,required:!0},imageIcon:{type:String,required:!1},uploadButton:{type:String,required:!1},confirmButton:{type:String,required:!1},uploadPlaceholderText:{type:String,required:!1},onUpload:{type:Function,required:!0},onImageLoadError:{type:Function,required:!1}},setup({readonly:e,src:t,setLink:n,onUpload:r,imageIcon:o,uploadButton:i,confirmButton:a,uploadPlaceholderText:s,className:l,onImageLoadError:c}){var d,u;const h=gs(!1),p=gs(),m=gs(null!=(d=t.value)?d:""),f=gs(wu()),g=gs(0!==(null==(u=t.value)?void 0:u.length)),v=e=>{const t=e.target.value;g.value=0!==t.length,m.value=t},y=e=>{var t,r;"Enter"===e.key&&n(null!=(r=null==(t=p.value)?void 0:t.value)?r:"")},b=e=>{var t;const o=null==(t=e.target.files)?void 0:t[0];o&&r(o).then(e=>{e&&(n(e),g.value=!0)}).catch(e=>{console.error("An error occurred while uploading image"),console.error(e)})};return()=>pd("div",{class:Ln("image-edit",l)},pd(bu,{icon:o,class:"image-icon"}),pd("div",{class:Ln("link-importer",h.value&&"focus")},pd("input",{ref:p,draggable:"true",onDragstart:e=>{e.preventDefault(),e.stopPropagation()},disabled:e.value,class:"link-input-area",value:m.value,onInput:v,onKeydown:y,onFocus:()=>h.value=!0,onBlur:()=>h.value=!1}),!g.value&&pd("div",{class:"placeholder"},pd("input",{disabled:e.value,class:"hidden",id:f.value,type:"file",accept:"image/*",onChange:b}),pd("label",{class:"uploader",for:f.value},pd(bu,{icon:i})),pd("span",{class:"text",onClick:()=>{var e;return null==(e=p.value)?void 0:e.focus()}},s))),m.value&&pd(Dc,null,pd("div",{class:"image-preview"},pd("img",{src:m.value,alt:"",onError:e=>Promise.resolve(null==c?void 0:c(e)).catch(()=>{})})),pd("div",{class:"confirm",onClick:()=>(()=>{var e,t;n(null!=(t=null==(e=p.value)?void 0:e.value)?t:"")})()},pd(bu,{icon:a}))))}}),ku=ml({props:{src:{type:Object,required:!0},caption:{type:Object,required:!0},ratio:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup({src:e,caption:t,ratio:n,readonly:r,setAttr:o,config:i}){var a;const s=gs(),l=gs(),c=gs(Boolean(null==(a=t.value)?void 0:a.length)),d=gs(0),u=()=>{var e;const t=s.value;if(!t)return;const r=t.closest(".milkdown-image-block");if(!r)return;let o=r.getBoundingClientRect().width;if(!o)return;i.maxWidth&&i.maxWidth<o&&(o=i.maxWidth);const a=t.naturalHeight,l=t.naturalWidth;let c=l<o?a:o*(a/l);i.maxHeight&&c>i.maxHeight&&(c=i.maxHeight);const d=(c*(null!=(e=n.value)?e:1)).toFixed(2);t.dataset.origin=c.toFixed(2),t.dataset.height=d,t.style.height=`${d}px`,i.maxWidth&&(t.style.maxWidth=`${i.maxWidth}px`)},h=e=>{e.preventDefault(),e.stopPropagation(),r.value||(c.value=!c.value)},p=e=>{const t=e.target.value;d.value&&window.clearTimeout(d.value),d.value=window.setTimeout(()=>{o("caption",t)},1e3)},m=e=>{const t=e.target.value;d.value&&(window.clearTimeout(d.value),d.value=0),o("caption",t)},f=e=>{e.preventDefault();const t=s.value;if(!t)return;const n=t.getBoundingClientRect().top;let r=e.clientY-n;r<100&&(r=100),i.maxHeight&&r>i.maxHeight&&(r=i.maxHeight);const o=Number(r).toFixed(2);t.dataset.height=o,t.style.height=`${o}px`},g=()=>{window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",g);const e=s.value;if(!e)return;const t=Number(e.dataset.origin),n=Number(e.dataset.height),r=Number.parseFloat(Number(n/t).toFixed(2));Number.isNaN(r)||o("ratio",r)},v=e=>{r.value||(e.preventDefault(),e.stopPropagation(),window.addEventListener("pointermove",f),window.addEventListener("pointerup",g))};return()=>pd(Dc,null,pd("div",{class:"image-wrapper"},pd("div",{class:"operation"},pd("div",{class:"operation-item",onPointerdown:h},pd(bu,{icon:i.captionIcon}))),pd("img",{ref:s,"data-type":vu,onLoad:u,src:e.value,alt:t.value,onError:e=>{var t;return Promise.resolve(null==(t=i.onImageLoadError)?void 0:t.call(i,e)).catch(()=>{})}}),pd("div",{ref:l,class:"image-resize-handle",onPointerdown:v})),c.value&&pd("input",{draggable:"true",onDragstart:e=>{e.preventDefault(),e.stopPropagation()},class:"caption-input",placeholder:null==i?void 0:i.captionPlaceholderText,onInput:p,onBlur:m,value:t.value}))}});var Cu=Object.defineProperty,_u=Object.getOwnPropertySymbols,Su=Object.prototype.hasOwnProperty,Au=Object.prototype.propertyIsEnumerable,Mu=(e,t,n)=>t in e?Cu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const Tu=ml({props:{src:{type:Object,required:!0},caption:{type:Object,required:!0},ratio:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup(e){const{src:t}=e;return()=>{var n;return(null==(n=t.value)?void 0:n.length)?pd(ku,((e,t)=>{for(var n in t||(t={}))Su.call(t,n)&&Mu(e,n,t[n]);if(_u)for(var n of _u(t))Au.call(t,n)&&Mu(e,n,t[n]);return e})({},e)):pd(xu,{src:e.src,selected:e.selected,readonly:e.readonly,setLink:t=>e.setAttr("src",t),imageIcon:e.config.imageIcon,uploadButton:e.config.uploadButton,confirmButton:e.config.confirmButton,uploadPlaceholderText:e.config.uploadPlaceholderText,onUpload:e.config.onUpload,onImageLoadError:e.config.onImageLoadError})}}}),Eu=R(yu.node,e=>(t,n,r)=>{const o=gs(t.attrs.src),i=gs(t.attrs.caption),a=gs(t.attrs.ratio),s=gs(!1),l=gs(!n.editable),c=e.get(lu.key),d=qd(Tu,{src:o,caption:i,ratio:a,selected:s,readonly:l,setAttr:(e,t)=>{if(!n.editable)return;const o=r();null!=o&&n.dispatch(n.state.tr.setNodeAttribute(o,e,"src"===e?Sn.sanitize(t):t))},config:c}),u=document.createElement("div");u.className="milkdown-image-block";const h=al(()=>{s.value?u.classList.add("selected"):u.classList.remove("selected")}),p=c.proxyDomURL,m=e=>{if(p){const t=p(e.attrs.src);"string"==typeof t?o.value=t:t.then(e=>{o.value=e}).catch(console.error)}else o.value=e.attrs.src;a.value=e.attrs.ratio,i.value=e.attrs.caption,l.value=!n.editable};return m(t),d.mount(u),{dom:u,update:e=>e.type===t.type&&(m(e),!0),stopEvent:e=>e.target instanceof HTMLInputElement,selectNode:()=>{s.value=!0},deselectNode:()=>{s.value=!1},destroy:()=>{h(),d.unmount(),u.remove()}}});su(Eu,{displayName:"NodeView<image-block>",group:"ImageBlock"});const Lu=[du,yu,Eu,lu].flat();let Ou,Iu;if("undefined"!=typeof WeakMap){let e=new WeakMap;Ou=t=>e.get(t),Iu=(t,n)=>(e.set(t,n),n)}else{const e=[],t=10;let n=0;Ou=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},Iu=(r,o)=>(n==t&&(n=0),e[n++]=r,e[n++]=o)}var Ru=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const r=t%this.width,o=t/this.width|0;let i=r+1,a=o+1;for(let e=1;i<this.width&&this.map[t+e]==n;e++)i++;for(let e=1;a<this.height&&this.map[t+this.width*e]==n;e++)a++;return{left:r,top:o,right:i,bottom:a}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:r,right:o,top:i,bottom:a}=this.findCell(e);return"horiz"==t?(n<0?0==r:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?0==i:a==this.height)?null:this.map[r+this.width*(n<0?i-1:a)]}rectBetween(e,t){const{left:n,right:r,top:o,bottom:i}=this.findCell(e),{left:a,right:s,top:l,bottom:c}=this.findCell(t);return{left:Math.min(n,a),top:Math.min(o,l),right:Math.max(r,s),bottom:Math.max(i,c)}}cellsInRect(e){const t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let o=e.left;o<e.right;o++){const i=r*this.width+o,a=this.map[i];n[a]||(n[a]=!0,o==e.left&&o&&this.map[i-1]==a||r==e.top&&r&&this.map[i-this.width]==a||t.push(a))}return t}positionAt(e,t,n){for(let r=0,o=0;;r++){const i=o+n.child(r).nodeSize;if(r==e){let n=t+e*this.width;const r=(e+1)*this.width;for(;n<r&&this.map[n]<o;)n++;return n==r?i-1:this.map[n]}o=i}}static get(e){return Ou(e)||Iu(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);const t=function(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){const o=e.child(r);let i=0;if(n)for(let t=0;t<r;t++){const n=e.child(t);for(let e=0;e<n.childCount;e++){const o=n.child(e);t+o.attrs.rowspan>r&&(i+=o.attrs.colspan)}}for(let e=0;e<o.childCount;e++){const t=o.child(e);i+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[];let o=0,i=null;const a=[];for(let c=0,d=t*n;c<d;c++)r[c]=0;for(let c=0,d=0;c<n;c++){const s=e.child(c);d++;for(let e=0;;e++){for(;o<r.length&&0!=r[o];)o++;if(e==s.childCount)break;const l=s.child(e),{colspan:u,rowspan:h,colwidth:p}=l.attrs;for(let e=0;e<h;e++){if(e+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:d,n:h-e});break}const s=o+e*t;for(let e=0;e<u;e++){0==r[s+e]?r[s+e]=d:(i||(i=[])).push({type:"collision",row:c,pos:d,n:u-e});const n=p&&p[e];if(n){const r=(s+e)%t*2,o=a[r];null==o||o!=n&&1==a[r+1]?(a[r]=n,a[r+1]=1):o==n&&a[r+1]++}}}o+=u,d+=l.nodeSize}const l=(c+1)*t;let u=0;for(;o<l;)0==r[o++]&&u++;u&&(i||(i=[])).push({type:"missing",row:c,n:u}),d++}0!==t&&0!==n||(i||(i=[])).push({type:"zero_sized"});const s=new Ru(t,n,r,i);let l=!1;for(let c=0;!l&&c<a.length;c+=2)null!=a[c]&&a[c+1]<n&&(l=!0);return l&&function(e,t,n){e.problems||(e.problems=[]);const r={};for(let o=0;o<e.map.length;o++){const i=e.map[o];if(r[i])continue;r[i]=!0;const a=n.nodeAt(i);if(!a)throw new RangeError(`No cell with offset ${i} found`);let s=null;const l=a.attrs;for(let n=0;n<l.colspan;n++){const r=t[(o+n)%e.width*2];null==r||l.colwidth&&l.colwidth[n]==r||((s||(s=Pu(l)))[n]=r)}s&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:s})}}(s,a,e),s}(e))}};function Pu(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function Bu(e,t){if("string"==typeof e)return{};const n=e.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map(e=>Number(e)):null,o=Number(e.getAttribute("colspan")||1),i={colspan:o,rowspan:Number(e.getAttribute("rowspan")||1),colwidth:r&&r.length==o?r:null};for(const a in t){const n=t[a].getFromDOM,r=n&&n(e);null!=r&&(i[a]=r)}return i}function zu(e,t){const n={};1!=e.attrs.colspan&&(n.colspan=e.attrs.colspan),1!=e.attrs.rowspan&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n["data-colwidth"]=e.attrs.colwidth.join(","));for(const r in t){const o=t[r].setDOMAttr;o&&o(e.attrs[r],n)}return n}function Du(e){if(null!==e){if(!Array.isArray(e))throw new TypeError("colwidth must be null or an array");for(const t of e)if("number"!=typeof t)throw new TypeError("colwidth must be null or an array of numbers")}}function Nu(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}}return t}const Hu=new d("selectingCells");function qu(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function ju(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if("row"==t.node(n).type.spec.tableRole)return!0;return!1}function Vu(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&"cell"==t.node.type.spec.tableRole)return t.$anchor;const n=qu(t.$head)||function(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n-t.nodeSize)}}(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function Fu(e){return"row"==e.parent.type.spec.tableRole&&!!e.nodeAfter}function $u(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Wu(e,t,n){const r=e.node(-1),o=Ru.get(r),i=e.start(-1),a=o.nextCell(e.pos-i,t,n);return null==a?null:e.node(0).resolve(i+a)}function Uu(e,t,n=1){const r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function Gu(e,t,n=1){const r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}var Zu=class e extends z{constructor(e,t=e){const n=e.node(-1),r=Ru.get(n),o=e.start(-1),i=r.rectBetween(e.pos-o,t.pos-o),a=e.node(0),s=r.cellsInRect(i).filter(e=>e!=t.pos-o);s.unshift(t.pos-o);const l=s.map(e=>{const t=n.nodeAt(e);if(!t)throw new RangeError(`No cell with offset ${e} found`);const r=o+e+1;return new D(a.resolve(r),a.resolve(r+t.content.size))});super(l[0].$from,l[0].$to,l),this.$anchorCell=e,this.$headCell=t}map(t,n){const r=t.resolve(n.map(this.$anchorCell.pos)),o=t.resolve(n.map(this.$headCell.pos));if(Fu(r)&&Fu(o)&&$u(r,o)){const t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,o):t&&this.isColSelection()?e.colSelection(r,o):new e(r,o)}return S.between(r,o)}content(){const e=this.$anchorCell.node(-1),t=Ru.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[];for(let s=r.top;s<r.bottom;s++){const n=[];for(let i=s*t.width+r.left,a=r.left;a<r.right;a++,i++){const a=t.map[i];if(o[a])continue;o[a]=!0;const s=t.findCell(a);let l=e.nodeAt(a);if(!l)throw new RangeError(`No cell with offset ${a} found`);const c=r.left-s.left,d=s.right-r.right;if(c>0||d>0){let e=l.attrs;if(c>0&&(e=Uu(e,0,c)),d>0&&(e=Uu(e,e.colspan-d,d)),s.left<r.left){if(l=l.type.createAndFill(e),!l)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else l=l.type.create(e,l.content)}if(s.top<r.top||s.bottom>r.bottom){const e={...l.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};l=s.top<r.top?l.type.createAndFill(e):l.type.create(e,l.content)}n.push(l)}i.push(e.child(s).copy(m.from(n)))}const a=this.isColSelection()&&this.isRowSelection()?e:i;return new p(m.from(a),1,1)}replace(e,t=p.empty){const n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){const{$from:o,$to:a}=r[i],s=e.mapping.slice(n);e.replace(s.map(o.pos),s.map(a.pos),i?p.empty:t)}const o=z.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,t){this.replace(e,new p(m.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),n=Ru.get(t),r=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let i=0;i<o.length;i++)e(t.nodeAt(o[i]),r+o[i])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const r=t.node(-1),o=Ru.get(r),i=t.start(-1),a=o.findCell(t.pos-i),s=o.findCell(n.pos-i),l=t.node(0);return a.top<=s.top?(a.top>0&&(t=l.resolve(i+o.map[a.left])),s.bottom<o.height&&(n=l.resolve(i+o.map[o.width*(o.height-1)+s.right-1]))):(s.top>0&&(n=l.resolve(i+o.map[s.left])),a.bottom<o.height&&(t=l.resolve(i+o.map[o.width*(o.height-1)+a.right-1]))),new e(t,n)}isRowSelection(){const e=this.$anchorCell.node(-1),t=Ru.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),o=t.colCount(this.$headCell.pos-n);if(Math.min(r,o)>0)return!1;const i=r+this.$anchorCell.nodeAfter.attrs.colspan,a=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(i,a)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const r=t.node(-1),o=Ru.get(r),i=t.start(-1),a=o.findCell(t.pos-i),s=o.findCell(n.pos-i),l=t.node(0);return a.left<=s.left?(a.left>0&&(t=l.resolve(i+o.map[a.top*o.width])),s.right<o.width&&(n=l.resolve(i+o.map[o.width*(s.top+1)-1]))):(s.left>0&&(n=l.resolve(i+o.map[s.top*o.width])),a.right<o.width&&(t=l.resolve(i+o.map[o.width*(a.top+1)-1]))),new e(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new Xu(this.$anchorCell.pos,this.$headCell.pos)}};Zu.prototype.visible=!1,z.jsonID("cell",Zu);var Xu=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){const t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&$u(t,n)?new Zu(t,n):z.near(n,1)}};function Ku(e){if(!(e.selection instanceof Zu))return null;const t=[];return e.selection.forEachCell((e,n)=>{t.push(v.node(n,n+e.nodeSize,{class:"selectedCell"}))}),f.create(e.doc,t)}const Yu=new d("fix-tables");function Ju(e,t,n,r){const o=e.childCount,i=t.childCount;e:for(let a=0,s=0;a<i;a++){const i=t.child(a);for(let t=s,r=Math.min(o,a+3);t<r;t++)if(e.child(t)==i){s=t+1,n+=i.nodeSize;continue e}r(i,n),s<o&&e.child(s).sameMarkup(i)?Ju(e.child(s),i,n+1,r):i.nodesBetween(0,i.content.size,r,n+1),n+=i.nodeSize}}function Qu(e,t){let n;const r=(t,r)=>{"table"==t.type.spec.tableRole&&(n=function(e,t,n,r){const o=Ru.get(t);if(!o.problems)return r;r||(r=e.tr);const i=[];for(let l=0;l<o.height;l++)i.push(0);for(let l=0;l<o.problems.length;l++){const e=o.problems[l];if("collision"==e.type){const o=t.nodeAt(e.pos);if(!o)continue;const a=o.attrs;for(let t=0;t<a.rowspan;t++)i[e.row+t]+=e.n;r.setNodeMarkup(r.mapping.map(n+1+e.pos),null,Uu(a,a.colspan-e.n,e.n))}else if("missing"==e.type)i[e.row]+=e.n;else if("overlong_rowspan"==e.type){const o=t.nodeAt(e.pos);if(!o)continue;r.setNodeMarkup(r.mapping.map(n+1+e.pos),null,{...o.attrs,rowspan:o.attrs.rowspan-e.n})}else if("colwidth mismatch"==e.type){const o=t.nodeAt(e.pos);if(!o)continue;r.setNodeMarkup(r.mapping.map(n+1+e.pos),null,{...o.attrs,colwidth:e.colwidth})}else if("zero_sized"==e.type){const e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let a,s;for(let l=0;l<i.length;l++)i[l]&&(null==a&&(a=l),s=l);for(let l=0,c=n+1;l<o.height;l++){const n=t.child(l),o=c+n.nodeSize,d=i[l];if(d>0){let t="cell";n.firstChild&&(t=n.firstChild.type.spec.tableRole);const i=[];for(let n=0;n<d;n++){const n=Nu(e.schema)[t].createAndFill();n&&i.push(n)}const u=0!=l&&a!=l-1||s!=l?o-1:c+1;r.insert(r.mapping.map(u),i)}c=o}return r.setMeta(Yu,{fixTables:!0})}(e,t,r,n))};return t?t.doc!=e.doc&&Ju(t.doc,e.doc,0,r):e.doc.descendants(r),n}function eh(e){const t=Ru.get(e),n=[],r=t.height,o=t.width;for(let i=0;i<r;i++){const r=[];for(let n=0;n<o;n++){const a=i*o+n,s=t.map[a];if(i>0){const e=a-o;if(s===t.map[e]){r.push(null);continue}}if(n>0){const e=a-1;if(s===t.map[e]){r.push(null);continue}}r.push(e.nodeAt(s))}n.push(r)}return n}function th(e,t){const n=[],r=Ru.get(e),o=r.height,i=r.width;for(let a=0;a<o;a++){const o=e.child(a),s=[];for(let n=0;n<i;n++){const o=t[a][n];if(!o)continue;const i=r.map[a*r.width+n],l=e.nodeAt(i);if(!l)continue;const c=l.type.createChecked(o.attrs,o.content,o.marks);s.push(c)}const l=o.type.createChecked(o.attrs,s,o.marks);n.push(l)}return e.type.createChecked(e.attrs,n,e.marks)}function nh(e,t,n,r){const o=t[0]>n[0]?-1:1,i=e.splice(t[0],t.length),a=i.length%2==0?1:0;let s;return s=-1===o?n[0]:n[n.length-1]-a,e.splice(s,0,...i),e}function rh(e){return function(e,t){for(let n=t.depth;n>=0;n-=1){const r=t.node(n);if(e(r))return{node:r,pos:0===n?0:t.before(n),start:t.start(n),depth:n}}return null}(e=>"table"===e.type.spec.tableRole,e)}function oh(e,t){const n=rh(t.$from);if(!n)return;const r=Ru.get(n.node);return e<0||e>r.width-1?void 0:r.cellsInRect({left:e,right:e+1,top:0,bottom:r.height}).map(e=>{const t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t,depth:n.depth+2}})}function ih(e,t){const n=rh(t.$from);if(!n)return;const r=Ru.get(n.node);return e<0||e>r.height-1?void 0:r.cellsInRect({left:0,right:r.width,top:e,bottom:e+1}).map(e=>{const t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t,depth:n.depth+2}})}function ah(e,t,n=t){let r=t,o=n;for(let d=t;d>=0;d--){const t=oh(d,e.selection);t&&t.forEach(e=>{const t=e.node.attrs.colspan+d-1;t>=r&&(r=d),t>o&&(o=t)})}for(let d=t;d<=o;d++){const t=oh(d,e.selection);t&&t.forEach(e=>{const t=e.node.attrs.colspan+d-1;e.node.attrs.colspan>1&&t>o&&(o=t)})}const i=[];for(let d=r;d<=o;d++){const t=oh(d,e.selection);t&&t.length>0&&i.push(d)}r=i[0],o=i[i.length-1];const a=oh(r,e.selection),s=ih(0,e.selection);if(!a||!s)return;const l=e.doc.resolve(a[a.length-1].pos);let c;for(let d=o;d>=r;d--){const t=oh(d,e.selection);if(t&&t.length>0){for(let e=s.length-1;e>=0;e--)if(s[e].pos===t[0].pos){c=t[0];break}if(c)break}}return c?{$anchor:l,$head:e.doc.resolve(c.pos),indexes:i}:void 0}function sh(e,t,n=t){let r=t,o=n;for(let d=t;d>=0;d--){const t=ih(d,e.selection);t&&t.forEach(e=>{const t=e.node.attrs.rowspan+d-1;t>=r&&(r=d),t>o&&(o=t)})}for(let d=t;d<=o;d++){const t=ih(d,e.selection);t&&t.forEach(e=>{const t=e.node.attrs.rowspan+d-1;e.node.attrs.rowspan>1&&t>o&&(o=t)})}const i=[];for(let d=r;d<=o;d++){const t=ih(d,e.selection);t&&t.length>0&&i.push(d)}r=i[0],o=i[i.length-1];const a=ih(r,e.selection),s=oh(0,e.selection);if(!a||!s)return;const l=e.doc.resolve(a[a.length-1].pos);let c;for(let d=o;d>=r;d--){const t=ih(d,e.selection);if(t&&t.length>0){for(let e=s.length-1;e>=0;e--)if(s[e].pos===t[0].pos){c=t[0];break}if(c)break}}return c?{$anchor:l,$head:e.doc.resolve(c.pos),indexes:i}:void 0}function lh(e){return e[0].map((t,n)=>e.map(e=>e[n]))}function ch(e){const t=e.selection,n=Vu(e),r=n.node(-1),o=n.start(-1),i=Ru.get(r);return{...t instanceof Zu?i.rectBetween(t.$anchorCell.pos-o,t.$headCell.pos-o):i.findCell(n.pos-o),tableStart:o,map:i,table:r}}function dh(e,{map:t,tableStart:n,table:r},o){let i=o>0?-1:0;(function(e,t,n){const r=Nu(t.type.schema).header_cell;for(let o=0;o<e.height;o++)if(t.nodeAt(e.map[n+o*e.width]).type!=r)return!1;return!0})(t,r,o+i)&&(i=0==o||o==t.width?null:0);for(let a=0;a<t.height;a++){const s=a*t.width+o;if(o>0&&o<t.width&&t.map[s-1]==t.map[s]){const i=t.map[s],l=r.nodeAt(i);e.setNodeMarkup(e.mapping.map(n+i),null,Gu(l.attrs,o-t.colCount(i))),a+=l.attrs.rowspan-1}else{const l=null==i?Nu(r.type.schema).cell:r.nodeAt(t.map[s+i]).type,c=t.positionAt(a,o,r);e.insert(e.mapping.map(n+c),l.createAndFill())}}return e}function uh(e,t){if(!ju(e))return!1;if(t){const n=ch(e);t(dh(e.tr,n,n.left))}return!0}function hh(e,t){if(!ju(e))return!1;if(t){const n=ch(e);t(dh(e.tr,n,n.right))}return!0}function ph(e,{map:t,table:n,tableStart:r},o){const i=e.mapping.maps.length;for(let a=0;a<t.height;){const s=a*t.width+o,l=t.map[s],c=n.nodeAt(l),d=c.attrs;if(o>0&&t.map[s-1]==l||o<t.width-1&&t.map[s+1]==l)e.setNodeMarkup(e.mapping.slice(i).map(r+l),null,Uu(d,o-t.colCount(l)));else{const t=e.mapping.slice(i).map(r+l);e.delete(t,t+c.nodeSize)}a+=d.rowspan}}function mh(e,{map:t,table:n,tableStart:r},o){let i=0;for(let c=0;c<o;c++)i+=n.child(c).nodeSize;const a=i+n.child(o).nodeSize,s=e.mapping.maps.length;e.delete(i+r,a+r);const l=new Set;for(let c=0,d=o*t.width;c<t.width;c++,d++){const i=t.map[d];if(!l.has(i))if(l.add(i),o>0&&i==t.map[d-t.width]){const t=n.nodeAt(i).attrs;e.setNodeMarkup(e.mapping.slice(s).map(i+r),null,{...t,rowspan:t.rowspan-1}),c+=t.colspan-1}else if(o<t.height&&i==t.map[d+t.width]){const a=n.nodeAt(i),l=a.attrs,d=a.type.create({...l,rowspan:a.attrs.rowspan-1},a.content),u=t.positionAt(o+1,c,n);e.insert(e.mapping.slice(s).map(r+u),d),c+=l.colspan-1}}}function fh(e,t,n){const r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let o=0;o<r.length;o++){const e=t.table.nodeAt(r[o]);if(e&&e.type!==n.header_cell)return!1}return!0}function gh(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(e){return function(t,n){if(!ju(t))return!1;if(n){const r=Nu(t.schema),o=ch(t),i=t.tr,a=o.map.cellsInRect("column"==e?{left:o.left,top:0,right:o.right,bottom:o.map.height}:"row"==e?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),s=a.map(e=>o.table.nodeAt(e));for(let e=0;e<a.length;e++)s[e].type==r.header_cell&&i.setNodeMarkup(o.tableStart+a[e],r.cell,s[e].attrs);if(0===i.steps.length)for(let e=0;e<a.length;e++)i.setNodeMarkup(o.tableStart+a[e],r.header_cell,s[e].attrs);n(i)}return!0}}(e):function(t,n){if(!ju(t))return!1;if(n){const r=Nu(t.schema),o=ch(t),i=t.tr,a=fh("row",o,r),s=fh("column",o,r),l=("column"===e?a:"row"===e&&s)?1:0,c="column"==e?{left:0,top:l,right:1,bottom:o.map.height}:"row"==e?{left:l,top:0,right:o.map.width,bottom:1}:o,d="column"==e?s?r.cell:r.header_cell:"row"==e?a?r.cell:r.header_cell:r.cell;o.map.cellsInRect(c).forEach(e=>{const t=e+o.tableStart,n=i.doc.nodeAt(t);n&&i.setNodeMarkup(t,d,n.attrs)}),n(i)}return!0}}function vh(e){return function(t,n){if(!ju(t))return!1;const r=function(e,t){if(t<0){const t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let n=e.index(-1)-1,r=e.before();n>=0;n--){const t=e.node(-1).child(n),o=t.lastChild;if(o)return r-1-o.nodeSize;r-=t.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){const e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}(Vu(t),e);if(null==r)return!1;if(n){const e=t.doc.resolve(r);n(t.tr.setSelection(S.between(e,function(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}(e))).scrollIntoView())}return!0}}function yh(e,t){const n=e.selection;if(!(n instanceof Zu))return!1;if(t){const r=e.tr,o=Nu(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(o)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new p(o,0,0))}),r.docChanged&&t(r)}return!0}function bh(e,t){const n=e.createAndFill();return new N(n).replace(0,n.content.size,t).doc}function wh(e,t,n,r,o,i,a,s){if(0==a||a==t.height)return!1;let l=!1;for(let c=o;c<i;c++){const o=a*t.width+c,i=t.map[o];if(t.map[o-t.width]==i){l=!0;const o=n.nodeAt(i),{top:d,left:u}=t.findCell(i);e.setNodeMarkup(e.mapping.slice(s).map(i+r),null,{...o.attrs,rowspan:a-d}),e.insert(e.mapping.slice(s).map(t.positionAt(a,u,n)),o.type.createAndFill({...o.attrs,rowspan:d+o.attrs.rowspan-a})),c+=o.attrs.colspan-1}}return l}function xh(e,t,n,r,o,i,a,s){if(0==a||a==t.width)return!1;let l=!1;for(let c=o;c<i;c++){const o=c*t.width+a,i=t.map[o];if(t.map[o-1]==i){l=!0;const o=n.nodeAt(i),d=t.colCount(i),u=e.mapping.slice(s).map(i+r);e.setNodeMarkup(u,null,Uu(o.attrs,a-d,o.attrs.colspan-(a-d))),e.insert(u+o.nodeSize,o.type.createAndFill(Uu(o.attrs,0,a-d))),c+=o.attrs.rowspan-1}}return l}function kh(e,t,n,r,o){let i=n?e.doc.nodeAt(n-1):e.doc;if(!i)throw new Error("No table found");let a=Ru.get(i);const{top:s,left:l}=r,c=l+o.width,d=s+o.height,u=e.tr;let h=0;function f(){if(i=n?u.doc.nodeAt(n-1):u.doc,!i)throw new Error("No table found");a=Ru.get(i),h=u.mapping.maps.length}(function(e,t,n,r,o,i,a){const s=Nu(e.doc.type.schema);let l,c;if(o>t.width)for(let d=0,u=0;d<t.height;d++){const i=n.child(d);u+=i.nodeSize;const h=[];let p;p=null==i.lastChild||i.lastChild.type==s.cell?l||(l=s.cell.createAndFill()):c||(c=s.header_cell.createAndFill());for(let e=t.width;e<o;e++)h.push(p);e.insert(e.mapping.slice(a).map(u-1+r),h)}if(i>t.height){const d=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,o);e++){const o=!(e>=t.width)&&n.nodeAt(t.map[r+e]).type==s.header_cell;d.push(o?c||(c=s.header_cell.createAndFill()):l||(l=s.cell.createAndFill()))}const u=s.row.create(null,m.from(d)),h=[];for(let e=t.height;e<i;e++)h.push(u);e.insert(e.mapping.slice(a).map(r+n.nodeSize-2),h)}return!(!l&&!c)})(u,a,i,n,c,d,h)&&f(),wh(u,a,i,n,l,c,s,h)&&f(),wh(u,a,i,n,l,c,d,h)&&f(),xh(u,a,i,n,s,d,l,h)&&f(),xh(u,a,i,n,s,d,c,h)&&f();for(let m=s;m<d;m++){const e=a.positionAt(m,l,i),t=a.positionAt(m,c,i);u.replace(u.mapping.slice(h).map(e+n),u.mapping.slice(h).map(t+n),new p(o.rows[m-s],0,0))}f(),u.setSelection(new Zu(u.doc.resolve(n+a.positionAt(s,l,i)),u.doc.resolve(n+a.positionAt(d-1,c-1,i)))),t(u)}gh("row",{useDeprecatedLogic:!0}),gh("column",{useDeprecatedLogic:!0}),gh("cell",{useDeprecatedLogic:!0});const Ch=B({ArrowLeft:Sh("horiz",-1),ArrowRight:Sh("horiz",1),ArrowUp:Sh("vert",-1),ArrowDown:Sh("vert",1),"Shift-ArrowLeft":Ah("horiz",-1),"Shift-ArrowRight":Ah("horiz",1),"Shift-ArrowUp":Ah("vert",-1),"Shift-ArrowDown":Ah("vert",1),Backspace:yh,"Mod-Backspace":yh,Delete:yh,"Mod-Delete":yh});function _h(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function Sh(e,t){return(n,r,o)=>{if(!o)return!1;const i=n.selection;if(i instanceof Zu)return _h(n,r,z.near(i.$headCell,t));if("horiz"!=e&&!i.empty)return!1;const a=Lh(o,e,t);if(null==a)return!1;if("horiz"==e)return _h(n,r,z.near(n.doc.resolve(i.head+t),t));{const o=n.doc.resolve(a),i=Wu(o,e,t);let s;return s=i?z.near(i,1):t<0?z.near(n.doc.resolve(o.before(-1)),-1):z.near(n.doc.resolve(o.after(-1)),1),_h(n,r,s)}}}function Ah(e,t){return(n,r,o)=>{if(!o)return!1;const i=n.selection;let a;if(i instanceof Zu)a=i;else{const r=Lh(o,e,t);if(null==r)return!1;a=new Zu(n.doc.resolve(r))}const s=Wu(a.$headCell,e,t);return!!s&&_h(n,r,new Zu(a.$anchorCell,s))}}function Mh(e,t){const n=qu(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new Zu(n))),!0)}function Th(e,t,n){if(!ju(e.state))return!1;let r=function(e){if(0===e.size)return null;let{content:t,openStart:n,openEnd:r}=e;for(;1==t.childCount&&(n>0&&r>0||"table"==t.child(0).type.spec.tableRole);)n--,r--,t=t.child(0).content;const o=t.child(0),i=o.type.spec.tableRole,a=o.type.schema,s=[];if("row"==i)for(let l=0;l<t.childCount;l++){let e=t.child(l).content;const o=l?0:Math.max(0,n-1),i=l<t.childCount-1?0:Math.max(0,r-1);(o||i)&&(e=bh(Nu(a).row,new p(e,o,i)).content),s.push(e)}else{if("cell"!=i&&"header_cell"!=i)return null;s.push(n||r?bh(Nu(a).row,new p(t,n,r)).content:t)}return function(e,t){const n=[];for(let o=0;o<t.length;o++){const e=t[o];for(let t=e.childCount-1;t>=0;t--){const{rowspan:r,colspan:i}=e.child(t).attrs;for(let e=o;e<o+r;e++)n[e]=(n[e]||0)+i}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=t.length&&t.push(m.empty),n[o]<r){const i=Nu(e).cell.createAndFill(),a=[];for(let e=n[o];e<r;e++)a.push(i);t[o]=t[o].append(m.from(a))}return{height:t.length,width:r,rows:t}}(a,s)}(n);const o=e.state.selection;if(o instanceof Zu){r||(r={width:1,height:1,rows:[m.from(bh(Nu(e.state.schema).cell,n))]});const t=o.$anchorCell.node(-1),i=o.$anchorCell.start(-1),a=Ru.get(t).rectBetween(o.$anchorCell.pos-i,o.$headCell.pos-i);return r=function({width:e,height:t,rows:n},r,o){if(e!=r){const t=[],o=[];for(let e=0;e<n.length;e++){const i=n[e],a=[];for(let n=t[e]||0,o=0;n<r;o++){let s=i.child(o%i.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(Uu(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),a.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}o.push(m.from(a))}n=o,e=r}if(t!=o){const e=[];for(let r=0,i=0;r<o;r++,i++){const a=[],s=n[i%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>o&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,o-t.attrs.rowspan)},t.content)),a.push(t)}e.push(m.from(a))}n=e,t=o}return{width:e,height:t,rows:n}}(r,a.right-a.left,a.bottom-a.top),kh(e.state,e.dispatch,i,a,r),!0}if(r){const t=Vu(e.state),n=t.start(-1);return kh(e.state,e.dispatch,n,Ru.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function Eh(e,t){var n;if(0!=t.button)return;if(t.ctrlKey||t.metaKey)return;const r=Oh(e,t.target);let o;if(t.shiftKey&&e.state.selection instanceof Zu)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&null!=(o=qu(e.state.selection.$anchor))&&(null===(n=Ih(e,t))||void 0===n?void 0:n.pos)!=o.pos)i(o,t),t.preventDefault();else if(!r)return;function i(t,n){let r=Ih(e,n);const o=null==Hu.getState(e.state);if(!r||!$u(t,r)){if(!o)return;r=t}const i=new Zu(t,r);if(o||!e.state.selection.eq(i)){const n=e.state.tr.setSelection(i);o&&n.setMeta(Hu,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener("mouseup",a),e.root.removeEventListener("dragstart",a),e.root.removeEventListener("mousemove",s),null!=Hu.getState(e.state)&&e.dispatch(e.state.tr.setMeta(Hu,-1))}function s(n){const o=n,s=Hu.getState(e.state);let l;if(null!=s)l=e.state.doc.resolve(s);else if(Oh(e,o.target)!=r&&(l=Ih(e,t),!l))return a();l&&i(l,o)}e.root.addEventListener("mouseup",a),e.root.addEventListener("dragstart",a),e.root.addEventListener("mousemove",s)}function Lh(e,t,n){if(!(e.state.selection instanceof S))return null;const{$head:r}=e.state.selection;for(let o=r.depth-1;o>=0;o--){const i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){const i=r.before(o),a="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(a)?i:null}}return null}function Oh(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t;return null}function Ih(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:o}=n;return r>=0&&qu(e.state.doc.resolve(r))||qu(e.state.doc.resolve(o))}var Rh=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Ph(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type==this.node.type&&(this.node=e,Ph(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))}};function Ph(e,t,n,r,o,i){let a=0,s=!0,l=t.firstChild;const c=e.firstChild;if(c){for(let e=0,n=0;e<c.childCount;e++){const{colspan:d,colwidth:u}=c.child(e).attrs;for(let e=0;e<d;e++,n++){const c=o==n?i:u&&u[e],d=c?c+"px":"";if(a+=c||r,c||(s=!1),l)l.style.width!=d&&(l.style.width=d),l=l.nextSibling;else{const e=document.createElement("col");e.style.width=d,t.appendChild(e)}}}for(;l;){var d;const e=l.nextSibling;null===(d=l.parentNode)||void 0===d||d.removeChild(l),l=e}s?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}}const Bh=new d("tableColumnResizing");var zh=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){const n=this,r=t.getMeta(Bh);if(r&&null!=r.setHandle)return new e(r.setHandle,!1);if(r&&void 0!==r.setDragging)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return Fu(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function Dh(e,t,n,r){const o="right"==n?-r:r,i=e.posAtCoords({left:t.clientX+o,top:t.clientY});if(!i)return-1;const{pos:a}=i,s=qu(e.state.doc.resolve(a));if(!s)return-1;if("right"==n)return s.pos;const l=Ru.get(s.node(-1)),c=s.start(-1),d=l.map.indexOf(s.pos-c);return d%l.width==0?-1:c+l.map[d-1]}function Nh(e,t,n){const r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function Hh(e,t){e.dispatch(e.state.tr.setMeta(Bh,{setHandle:t}))}function qh(e,t,n,r){const o=e.state.doc.resolve(t),i=o.node(-1),a=o.start(-1),s=Ru.get(i).colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1;let l=e.domAtPos(o.start(-1)).node;for(;l&&"TABLE"!=l.nodeName;)l=l.parentNode;l&&Ph(i,l.firstChild,l,r,s,n)}function jh(e){return Array(e).fill(0)}var Vh="undefined"!=typeof navigator?navigator:null,Fh=Vh&&Vh.userAgent||"",$h=/Edge\/(\d+)/.exec(Fh),Wh=/MSIE \d/.exec(Fh),Uh=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Fh),Gh=!(Wh||Uh||$h)&&!!Vh&&/Apple Computer/.test(Vh.vendor),Zh=new d("safari-ime-span"),Xh=!1;function Kh(e){const t=e.dom.ownerDocument.createElement("span");return t.className="ProseMirror-safari-ime-span",t}var Yh=new c(Gh?{key:Zh,props:{decorations:function(e){const{$from:t,$to:n,to:r}=e.selection;if(Xh&&t.sameParent(n)){const t=v.widget(r,Kh,{ignoreSelection:!0,key:"safari-ime-span"});return f.create(e.doc,[t])}},handleDOMEvents:{compositionstart:()=>{Xh=!0},compositionend:()=>{Xh=!1}}}}:{key:Zh});function Jh(e,t){return Object.assign(e,{meta:{package:"@milkdown/preset-gfm",...t}}),e}var Qh=q("strike_through");Jh(Qh,{displayName:"Attr<strikethrough>",group:"Strikethrough"});var ep=j("strike_through",e=>({parseDOM:[{tag:"del"},{style:"text-decoration",getAttrs:e=>"line-through"===e}],toDOM:t=>["del",e.get(Qh.key)(t)],parseMarkdown:{match:e=>"delete"===e.type,runner:(e,t,n)=>{e.openMark(n),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"strike_through"===e.type.name,runner:(e,t)=>{e.withMark(t,"delete")}}}));Jh(ep.mark,{displayName:"MarkSchema<strikethrough>",group:"Strikethrough"}),Jh(ep.ctx,{displayName:"MarkSchemaCtx<strikethrough>",group:"Strikethrough"});var tp=l("ToggleStrikeThrough",e=>()=>G(ep.type(e)));Jh(tp,{displayName:"Command<ToggleStrikethrough>",group:"Strikethrough"});var np=V(e=>U(new RegExp("(?<![\\w:/])(~{1,2})(.+?)\\1(?!\\w|\\/)"),ep.type(e)));Jh(np,{displayName:"InputRule<strikethrough>",group:"Strikethrough"});var rp=$("strikeThroughKeymap",{ToggleStrikethrough:{shortcuts:"Mod-Alt-x",command:e=>{const t=e.get(g);return()=>t.call(tp.key)}}});Jh(rp.ctx,{displayName:"KeymapCtx<strikethrough>",group:"Strikethrough"}),Jh(rp.shortcuts,{displayName:"Keymap<strikethrough>",group:"Strikethrough"});var op=function(e){const t=e.cellAttributes||{},n={colspan:{default:1,validate:"number"},rowspan:{default:1,validate:"number"},colwidth:{default:null,validate:Du}};for(const r in t)n[r]={default:t[r].default,validate:t[r].validate};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:e.tableGroup,parseDOM:[{tag:"table"}],toDOM:()=>["table",["tbody",0]]},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM:()=>["tr",0]},table_cell:{content:e.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:e=>Bu(e,t)}],toDOM:e=>["td",zu(e,t),0]},table_header:{content:e.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:e=>Bu(e,t)}],toDOM:e=>["th",zu(e,t),0]}}}({tableGroup:"block",cellContent:"paragraph",cellAttributes:{alignment:{default:"left",getFromDOM:e=>e.style.textAlign||"left",setDOMAttr:(e,t)=>{t.style=`text-align: ${e||"left"}`}}}}),ip=I("table",()=>({...op.table,content:"table_header_row table_row+",disableDropCursor:!0,parseMarkdown:{match:e=>"table"===e.type,runner:(e,t,n)=>{const r=t.align,o=t.children.map((e,t)=>({...e,align:r,isHeader:0===t}));e.openNode(n),e.next(o),e.closeNode()}},toMarkdown:{match:e=>"table"===e.type.name,runner:(e,t)=>{const n=t.content.firstChild?.content;if(!n)return;const r=[];n.forEach(e=>{r.push(e.attrs.alignment)}),e.openNode("table",void 0,{align:r}),e.next(t.content),e.closeNode()}}}));Jh(ip.node,{displayName:"NodeSchema<table>",group:"Table"}),Jh(ip.ctx,{displayName:"NodeSchemaCtx<table>",group:"Table"});var ap=I("table_header_row",()=>({...op.table_row,disableDropCursor:!0,content:"(table_header)*",parseDOM:[{tag:"tr[data-is-header]"},{tag:"tr",getAttrs:e=>e instanceof HTMLElement&&!!e.querySelector("th")&&{}}],toDOM:()=>["tr",{"data-is-header":!0},0],parseMarkdown:{match:e=>Boolean("tableRow"===e.type&&e.isHeader),runner:(e,t,n)=>{const r=t.align,o=t.children.map((e,n)=>({...e,align:r[n],isHeader:t.isHeader}));e.openNode(n),e.next(o),e.closeNode()}},toMarkdown:{match:e=>"table_header_row"===e.type.name,runner:(e,t)=>{0!==t.content.size&&(e.openNode("tableRow",void 0,{isHeader:!0}),e.next(t.content),e.closeNode())}}}));Jh(ap.node,{displayName:"NodeSchema<tableHeaderRow>",group:"Table"}),Jh(ap.ctx,{displayName:"NodeSchemaCtx<tableHeaderRow>",group:"Table"});var sp=I("table_row",()=>({...op.table_row,disableDropCursor:!0,content:"(table_cell)*",parseMarkdown:{match:e=>"tableRow"===e.type,runner:(e,t,n)=>{const r=t.align,o=t.children.map((e,t)=>({...e,align:r[t]}));e.openNode(n),e.next(o),e.closeNode()}},toMarkdown:{match:e=>"table_row"===e.type.name,runner:(e,t)=>{0!==t.content.size&&(e.openNode("tableRow"),e.next(t.content),e.closeNode())}}}));Jh(sp.node,{displayName:"NodeSchema<tableRow>",group:"Table"}),Jh(sp.ctx,{displayName:"NodeSchemaCtx<tableRow>",group:"Table"});var lp=I("table_cell",()=>({...op.table_cell,disableDropCursor:!0,parseMarkdown:{match:e=>"tableCell"===e.type&&!e.isHeader,runner:(e,t,n)=>{const r=t.align;e.openNode(n,{alignment:r}).openNode(e.schema.nodes.paragraph).next(t.children).closeNode().closeNode()}},toMarkdown:{match:e=>"table_cell"===e.type.name,runner:(e,t)=>{e.openNode("tableCell").next(t.content).closeNode()}}}));Jh(lp.node,{displayName:"NodeSchema<tableCell>",group:"Table"}),Jh(lp.ctx,{displayName:"NodeSchemaCtx<tableCell>",group:"Table"});var cp=I("table_header",()=>({...op.table_header,disableDropCursor:!0,parseMarkdown:{match:e=>"tableCell"===e.type&&!!e.isHeader,runner:(e,t,n)=>{const r=t.align;e.openNode(n,{alignment:r}),e.openNode(e.schema.nodes.paragraph),e.next(t.children),e.closeNode(),e.closeNode()}},toMarkdown:{match:e=>"table_header"===e.type.name,runner:(e,t)=>{e.openNode("tableCell"),e.next(t.content),e.closeNode()}}}));function dp(e,t=3,n=3){const r=Array(n).fill(0).map(()=>lp.type(e).createAndFill()),o=Array(n).fill(0).map(()=>cp.type(e).createAndFill()),i=Array(t).fill(0).map((t,n)=>0===n?ap.type(e).create(null,o):sp.type(e).create(null,r));return ip.type(e).create(null,i)}function up(e){return(t,n)=>r=>{n=n??r.selection.from;const o=r.doc.resolve(n),i=K(e=>"table"===e.type.name)(o),a=i?{node:i.node,from:i.start}:void 0,s="row"===e;if(a){const e=Ru.get(a.node);if(t>=0&&t<(s?e.height:e.width)){const n=e.positionAt(s?t:e.height-1,s?e.width-1:t,a.node),o=r.doc.resolve(a.from+n),i=s?Zu.rowSelection:Zu.colSelection,l=e.positionAt(s?t:0,s?0:t,a.node),c=r.doc.resolve(a.from+l);return Y(r.setSelection(i(o,c)))}}return r}}Jh(cp.node,{displayName:"NodeSchema<tableHeader>",group:"Table"}),Jh(cp.ctx,{displayName:"NodeSchemaCtx<tableHeader>",group:"Table"});var hp=up("row"),pp=up("col");function mp(e,t,{map:n,tableStart:r,table:o},i){const a=Array(i).fill(0).reduce((e,t,n)=>e+o.child(n).nodeSize,r),s=Array(n.width).fill(0).map((t,r)=>{const i=o.nodeAt(n.map[r]);return lp.type(e).createAndFill({alignment:i?.attrs.alignment})});return t.insert(a,sp.type(e).create(null,s)),t}var fp=l("GoToPrevTableCell",()=>()=>vh(-1));Jh(fp,{displayName:"Command<goToPrevTableCellCommand>",group:"Table"});var gp=l("GoToNextTableCell",()=>()=>vh(1));Jh(gp,{displayName:"Command<goToNextTableCellCommand>",group:"Table"});var vp=l("ExitTable",e=>()=>(t,n)=>{if(!ju(t))return!1;const{$head:r}=t.selection,o=Z(r,ip.type(e));if(!o)return!1;const{to:i}=o,a=t.tr.replaceWith(i,i,X.type(e).createAndFill());return a.setSelection(z.near(a.doc.resolve(i),1)).scrollIntoView(),n?.(a),!0});Jh(vp,{displayName:"Command<breakTableCommand>",group:"Table"});var yp=l("InsertTable",e=>({row:t,col:n}={})=>(r,o)=>{const{selection:i,tr:a}=r,{from:s}=i,l=dp(e,t,n),c=a.replaceSelectionWith(l),d=z.findFrom(c.doc.resolve(s),1,!0);return d&&c.setSelection(d),o?.(c),!0});Jh(yp,{displayName:"Command<insertTableCommand>",group:"Table"});var bp=l("MoveRow",()=>({from:e,to:t,pos:n}={})=>function(e){return(t,n)=>{const{from:r,to:o,select:i=!0,pos:a=t.selection.from}=e,s=t.tr;return!!function(e){var t,n;const{tr:r,originIndex:o,targetIndex:i,select:a,pos:s}=e,l=rh(r.doc.resolve(s));if(!l)return!1;const c=null===(t=sh(r,o))||void 0===t?void 0:t.indexes,d=null===(n=sh(r,i))||void 0===n?void 0:n.indexes;if(!c||!d)return!1;if(c.includes(i))return!1;const u=function(e,t,n){let r=eh(e);return r=nh(r,t,n),th(e,r)}(l.node,c,d);if(r.replaceWith(l.pos,l.pos+l.node.nodeSize,u),!a)return!0;const h=Ru.get(u),p=l.start,m=i,f=h.positionAt(m,h.width-1,u),g=r.doc.resolve(p+f),v=h.positionAt(m,0,u),y=r.doc.resolve(p+v);return r.setSelection(Zu.rowSelection(g,y)),!0}({tr:s,originIndex:r,targetIndex:o,select:i,pos:a})&&(null==n||n(s),!0)}}({from:e??0,to:t??0,pos:n}));Jh(bp,{displayName:"Command<moveRowCommand>",group:"Table"});var wp=l("MoveCol",()=>({from:e,to:t,pos:n}={})=>function(e){return(t,n)=>{const{from:r,to:o,select:i=!0,pos:a=t.selection.from}=e,s=t.tr;return!!function(e){var t,n;const{tr:r,originIndex:o,targetIndex:i,select:a,pos:s}=e,l=rh(r.doc.resolve(s));if(!l)return!1;const c=null===(t=ah(r,o))||void 0===t?void 0:t.indexes,d=null===(n=ah(r,i))||void 0===n?void 0:n.indexes;if(!c||!d)return!1;if(c.includes(i))return!1;const u=function(e,t,n){let r=lh(eh(e));return r=nh(r,t,n),r=lh(r),th(e,r)}(l.node,c,d);if(r.replaceWith(l.pos,l.pos+l.node.nodeSize,u),!a)return!0;const h=Ru.get(u),p=l.start,m=i,f=h.positionAt(h.height-1,m,u),g=r.doc.resolve(p+f),v=h.positionAt(0,m,u),y=r.doc.resolve(p+v);return r.setSelection(Zu.colSelection(g,y)),!0}({tr:s,originIndex:r,targetIndex:o,select:i,pos:a})&&(null==n||n(s),!0)}}({from:e??0,to:t??0,pos:n}));Jh(wp,{displayName:"Command<moveColCommand>",group:"Table"});var xp=l("SelectRow",()=>(e={index:0})=>(t,n)=>{const{tr:r}=t,o=n?.(hp(e.index,e.pos)(r));return Boolean(o)});Jh(xp,{displayName:"Command<selectRowCommand>",group:"Table"});var kp=l("SelectCol",()=>(e={index:0})=>(t,n)=>{const{tr:r}=t,o=n?.(pp(e.index,e.pos)(r));return Boolean(o)});Jh(kp,{displayName:"Command<selectColCommand>",group:"Table"});var Cp=l("SelectTable",()=>()=>(e,t)=>{const{tr:n}=e,r=t?.(function(e){const t=function(e){const t=rh(e.$from);if(!t)return;const n=Ru.get(t.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map(e=>{const n=t.node.nodeAt(e),r=e+t.start;return{pos:r,start:r+1,node:n}})}(e.selection);if(t&&t[0]){const n=e.doc.resolve(t[0].pos),r=t[t.length-1];if(r){const t=e.doc.resolve(r.pos);return Y(e.setSelection(new Zu(t,n)))}}return e}(n));return Boolean(r)});Jh(Cp,{displayName:"Command<selectTableCommand>",group:"Table"});var _p=l("DeleteSelectedCells",()=>()=>(e,t)=>{const{selection:n}=e;if(!(n instanceof Zu))return!1;const r=n.isRowSelection(),o=n.isColSelection();return r&&o?function(e,t){const n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}(e,t):o?function(e,t){if(!ju(e))return!1;if(t){const n=ch(e),r=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(let e=n.right-1;ph(r,n,e),e!=n.left;e--){const e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw new RangeError("No table found");n.table=e,n.map=Ru.get(e)}t(r)}return!0}(e,t):function(e,t){if(!ju(e))return!1;if(t){const n=ch(e),r=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;mh(r,n,e),e!=n.top;e--){const e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw new RangeError("No table found");n.table=e,n.map=Ru.get(n.table)}t(r)}return!0}(e,t)});Jh(_p,{displayName:"Command<deleteSelectedCellsCommand>",group:"Table"});var Sp=l("AddColBefore",()=>()=>uh);Jh(Sp,{displayName:"Command<addColBeforeCommand>",group:"Table"});var Ap=l("AddColAfter",()=>()=>hh);Jh(Ap,{displayName:"Command<addColAfterCommand>",group:"Table"});var Mp=l("AddRowBefore",e=>()=>(t,n)=>{if(!ju(t))return!1;if(n){const r=ch(t);n(mp(e,t.tr,r,r.top))}return!0});Jh(Mp,{displayName:"Command<addRowBeforeCommand>",group:"Table"});var Tp=l("AddRowAfter",e=>()=>(t,n)=>{if(!ju(t))return!1;if(n){const r=ch(t);n(mp(e,t.tr,r,r.bottom))}return!0});Jh(Tp,{displayName:"Command<addRowAfterCommand>",group:"Table"});var Ep=l("SetAlign",()=>(e="left")=>function(e,t){return function(n,r){if(!ju(n))return!1;const o=Vu(n);if(o.nodeAfter.attrs[e]===t)return!1;if(r){const i=n.tr;n.selection instanceof Zu?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&i.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):i.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[e]:t}),r(i)}return!0}}("alignment",e));Jh(Ep,{displayName:"Command<setAlignCommand>",group:"Table"});var Lp=V(e=>new W(/^\|(?<col>\d+)[xX](?<row>\d+)\|\s$/,(t,n,r,o)=>{const i=t.doc.resolve(r);if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),ip.type(e)))return null;const a=dp(e,Math.max(Number(n.groups?.row??0),2),Number(n.groups?.col)),s=t.tr.replaceRangeWith(r,o,a);return s.setSelection(S.create(s.doc,r+3)).scrollIntoView()}));Jh(Lp,{displayName:"InputRule<insertTableInputRule>",group:"Table"});var Op=F(e=>({run:(t,n,r)=>{if(r)return t;function o(t){const n=t.childCount,r=t.lastChild?.childCount??0;if(0===n||0===r)return X.type(e).create();const o=t.firstChild;if(!(r>0&&o&&0===o.childCount))return t;if(n>=3){const r=t.child(1),i=[];for(let t=0;t<r.childCount;t++){const n=r.child(t);i.push(cp.type(e).create(n.attrs,n.content,n.marks))}const a=o.type.create(o.attrs,i),s=[];for(let e=2;e<n;e++)s.push(t.child(e));return t.type.create(t.attrs,[a,...s])}const i=Array(r).fill(0).map(()=>cp.type(e).createAndFill()),a=new p(m.from(i),0,0),s=o.replace(0,0,a);return t.replace(0,o.nodeSize,new p(m.from(s),0,0))}let i=function t(n){let r=function(t){const n=sp.type(e),r=[];let i=[],a=!1;function s(){if(0===i.length)return;const t=ap.type(e).createAndFill(),n=ip.type(e).create(null,[t,...i]);r.push(o(n)),i=[]}return t.forEach(e=>{e.type===n?(a=!0,i.push(e)):(s(),r.push(e))}),s(),a?m.from(r):t}(n),i=r!==n;const a=[];return r.forEach(n=>{if(n.type===ip.type(e)){const e=o(n);e!==n&&(i=!0),a.push(e)}else if(n.childCount>0){const e=t(n.content);e!==n.content?(i=!0,a.push(n.copy(e))):a.push(n)}else a.push(n)}),i?m.from(a):n}(t.content);return i=function(t){const n=[],r=[];t.forEach(e=>r.push(e));for(let o=0;o<r.length;o++){const t=r[o],i=r[o+1];t.type===X.type(e)&&0===t.content.size&&i&&i.type===ip.type(e)||n.push(t)}return n.length<r.length?m.from(n):t}(i),new p(m.from(i),t.openStart,t.openEnd)}}));Jh(Op,{displayName:"PasteRule<table>",group:"Table"});var Ip=$("tableKeymap",{NextCell:{priority:100,shortcuts:["Mod-]","Tab"],command:e=>{const t=e.get(g);return()=>t.call(gp.key)}},PrevCell:{shortcuts:["Mod-[","Shift-Tab"],command:e=>{const t=e.get(g);return()=>t.call(fp.key)}},ExitTable:{shortcuts:["Mod-Enter","Enter"],command:e=>{const t=e.get(g);return()=>t.call(vp.key)}}});Jh(Ip.ctx,{displayName:"KeymapCtx<table>",group:"Table"}),Jh(Ip.shortcuts,{displayName:"Keymap<table>",group:"Table"});var Rp="footnote_definition",Pp="footnoteDefinition",Bp=I("footnote_definition",()=>({group:"block",content:"block+",defining:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`dl[data-type="${Rp}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw P(e);return{label:e.dataset.label}},contentElement:"dd"}],toDOM:e=>{const t=e.attrs.label;return["dl",{"data-label":t,"data-type":Rp},["dt",t],["dd",0]]},parseMarkdown:{match:({type:e})=>e===Pp,runner:(e,t,n)=>{e.openNode(n,{label:t.label}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===Rp,runner:(e,t)=>{e.openNode(Pp,void 0,{label:t.attrs.label,identifier:t.attrs.label}).next(t.content).closeNode()}}}));Jh(Bp.ctx,{displayName:"NodeSchemaCtx<footnodeDef>",group:"footnote"}),Jh(Bp.node,{displayName:"NodeSchema<footnodeDef>",group:"footnote"});var zp="footnote_reference",Dp=I("footnote_reference",()=>({group:"inline",inline:!0,atom:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`sup[data-type="${zp}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw P(e);return{label:e.dataset.label}}}],toDOM:e=>{const t=e.attrs.label;return["sup",{"data-label":t,"data-type":zp},t]},parseMarkdown:{match:({type:e})=>"footnoteReference"===e,runner:(e,t,n)=>{e.addNode(n,{label:t.label})}},toMarkdown:{match:e=>e.type.name===zp,runner:(e,t)=>{e.addNode("footnoteReference",void 0,void 0,{label:t.attrs.label,identifier:t.attrs.label})}}}));Jh(Dp.ctx,{displayName:"NodeSchemaCtx<footnodeRef>",group:"footnote"}),Jh(Dp.node,{displayName:"NodeSchema<footnodeRef>",group:"footnote"});var Np=H.extendSchema(e=>t=>{const n=e(t);return{...n,attrs:{...n.attrs,checked:{default:null,validate:"boolean|null"}},parseDOM:[{tag:'li[data-item-type="task"]',getAttrs:e=>{if(!(e instanceof HTMLElement))throw P(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:e.dataset.spread,checked:e.dataset.checked?"true"===e.dataset.checked:null}}},...n?.parseDOM||[]],toDOM:e=>n.toDOM&&null==e.attrs.checked?n.toDOM(e):["li",{"data-item-type":"task","data-label":e.attrs.label,"data-list-type":e.attrs.listType,"data-spread":e.attrs.spread,"data-checked":e.attrs.checked},0],parseMarkdown:{match:({type:e})=>"listItem"===e,runner:(e,t,r)=>{if(null==t.checked)return void n.parseMarkdown.runner(e,t,r);const o=null!=t.label?`${t.label}.`:"•",i=null!=t.checked?Boolean(t.checked):null,a=null!=t.label?"ordered":"bullet",s=null!=t.spread?`${t.spread}`:"true";e.openNode(r,{label:o,listType:a,spread:s,checked:i}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>"list_item"===e.type.name,runner:(e,t)=>{if(null==t.attrs.checked)return void n.toMarkdown.runner(e,t);const r=t.attrs.label,o=t.attrs.listType,i="true"===t.attrs.spread,a=t.attrs.checked;e.openNode("listItem",void 0,{label:r,listType:o,spread:i,checked:a}),e.next(t.content),e.closeNode()}}}});Jh(Np.node,{displayName:"NodeSchema<taskListItem>",group:"ListItem"}),Jh(Np.ctx,{displayName:"NodeSchemaCtx<taskListItem>",group:"ListItem"});var Hp=V(()=>new W(/^\[(?<checked>\s|x)\]\s$/,(e,t,n,r)=>{const o=e.doc.resolve(n);let i=0,a=o.node(i);for(;a&&"list_item"!==a.type.name;)i--,a=o.node(i);if(!a||null!=a.attrs.checked)return null;const s=Boolean("x"===t.groups?.checked),l=o.before(i),c=e.tr;return c.deleteRange(n,r).setNodeMarkup(l,void 0,{...a.attrs,checked:s}),c}));Jh(Hp,{displayName:"InputRule<wrapInTaskListInputRule>",group:"ListItem"});var qp=[rp,Ip].flat(),jp=[Lp,Hp],Vp=[np],Fp=[Op],$p=s(()=>Yh);Jh($p,{displayName:"Prose<autoInsertSpanPlugin>",group:"Prose"}),Jh(s(()=>function({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=Rh,lastColumnResizable:o=!0}={}){const i=new c({key:Bh,state:{init(e,t){var o;const a=null===(o=i.spec)||void 0===o||null===(o=o.props)||void 0===o?void 0:o.nodeViews,s=Nu(t.schema).table.name;return r&&a&&(a[s]=(e,t)=>new r(e,n,t)),new zh(-1,!1)},apply:(e,t)=>t.apply(e)},props:{attributes:e=>{const t=Bh.getState(e);return t&&t.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(t,n)=>{!function(e,t,n,r){if(!e.editable)return;const o=Bh.getState(e.state);if(o&&!o.dragging){const i=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target);let a=-1;if(i){const{left:r,right:o}=i.getBoundingClientRect();t.clientX-r<=n?a=Dh(e,t,"left",n):o-t.clientX<=n&&(a=Dh(e,t,"right",n))}if(a!=o.activeHandle){if(!r&&-1!==a){const t=e.state.doc.resolve(a),n=t.node(-1),r=Ru.get(n),o=t.start(-1);if(r.colCount(t.pos-o)+t.nodeAfter.attrs.colspan-1==r.width-1)return}Hh(e,a)}}}(t,n,e,o)},mouseleave:e=>{!function(e){if(!e.editable)return;const t=Bh.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&Hh(e,-1)}(e)},mousedown:(e,r)=>{!function(e,t,n,r){var o;if(!e.editable)return!1;const i=null!==(o=e.dom.ownerDocument.defaultView)&&void 0!==o?o:window,a=Bh.getState(e.state);if(!a||-1==a.activeHandle||a.dragging)return!1;const s=e.state.doc.nodeAt(a.activeHandle),l=function(e,t,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const i=e.domAtPos(t);let a=i.node.childNodes[i.offset].offsetWidth,s=n;if(r)for(let l=0;l<n;l++)r[l]&&(a-=r[l],s--);return a/s}(e,a.activeHandle,s.attrs);function c(t){i.removeEventListener("mouseup",c),i.removeEventListener("mousemove",d);const r=Bh.getState(e.state);(null==r?void 0:r.dragging)&&(function(e,t,n){const r=e.state.doc.resolve(t),o=r.node(-1),i=Ru.get(o),a=r.start(-1),s=i.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,l=e.state.tr;for(let c=0;c<i.height;c++){const e=c*i.width+s;if(c&&i.map[e]==i.map[e-i.width])continue;const t=i.map[e],r=o.nodeAt(t).attrs,d=1==r.colspan?0:s-i.colCount(t);if(r.colwidth&&r.colwidth[d]==n)continue;const u=r.colwidth?r.colwidth.slice():jh(r.colspan);u[d]=n,l.setNodeMarkup(a+t,null,{...r,colwidth:u})}l.docChanged&&e.dispatch(l)}(e,r.activeHandle,Nh(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(Bh,{setDragging:null})))}function d(t){if(!t.which)return c(t);const o=Bh.getState(e.state);if(o&&o.dragging){const i=Nh(o.dragging,t,n);qh(e,o.activeHandle,i,r)}}e.dispatch(e.state.tr.setMeta(Bh,{setDragging:{startX:t.clientX,startWidth:l}})),qh(e,a.activeHandle,l,r),i.addEventListener("mouseup",c),i.addEventListener("mousemove",d),t.preventDefault()}(e,r,t,n)}},decorations:e=>{const t=Bh.getState(e);if(t&&t.activeHandle>-1)return function(e,t){const n=[],r=e.doc.resolve(t),o=r.node(-1);if(!o)return f.empty;const i=Ru.get(o),a=r.start(-1),s=i.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1;for(let c=0;c<i.height;c++){const t=s+c*i.width;if(!(s!=i.width-1&&i.map[t]==i.map[t+1]||0!=c&&i.map[t]==i.map[t-i.width])){var l;const r=i.map[t],s=a+r+o.nodeAt(r).nodeSize-1,c=document.createElement("div");c.className="column-resize-handle",(null===(l=Bh.getState(e))||void 0===l?void 0:l.dragging)&&n.push(v.node(a+r,a+r+o.nodeAt(r).nodeSize,{class:"column-resize-dragging"})),n.push(v.widget(s,c))}}return f.create(e.doc,n)}(e,t.activeHandle)},nodeViews:{}}});return i}({})),{displayName:"Prose<columnResizingPlugin>",group:"Prose"});var Wp=s(()=>function({allowTableNodeSelection:e=!1}={}){return new c({key:Hu,state:{init:()=>null,apply(e,t){const n=e.getMeta(Hu);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;const{deleted:r,pos:o}=e.mapping.mapResult(t);return r?null:o}},props:{decorations:Ku,handleDOMEvents:{mousedown:Eh},createSelectionBetween:e=>null!=Hu.getState(e.state)?e.state.selection:null,handleTripleClick:Mh,handleKeyDown:Ch,handlePaste:Th},appendTransaction:(t,n,r)=>function(e,t,n){const r=(t||e).selection,o=(t||e).doc;let i,a;if(r instanceof M&&(a=r.node.type.spec.tableRole)){if("cell"==a||"header_cell"==a)i=Zu.create(o,r.from);else if("row"==a){const e=o.resolve(r.from+1);i=Zu.rowSelection(e,e)}else if(!n){const e=Ru.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];i=Zu.create(o,t+1,n)}}else r instanceof S&&function({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,o=e.depth;for(;o>=0&&!(e.after(o+1)<e.end(o));o--,n++);for(let i=t.depth;i>=0&&!(t.before(i+1)>t.start(i));i--,r--);return n==r&&/row|table/.test(e.node(o).type.spec.tableRole)}(r)?i=S.create(o,r.from):r instanceof S&&function({$from:e,$to:t}){let n,r;for(let o=e.depth;o>0;o--){const t=e.node(o);if("cell"===t.type.spec.tableRole||"header_cell"===t.type.spec.tableRole){n=t;break}}for(let o=t.depth;o>0;o--){const e=t.node(o);if("cell"===e.type.spec.tableRole||"header_cell"===e.type.spec.tableRole){r=e;break}}return n!==r&&0===t.parentOffset}(r)&&(i=S.create(o,r.$from.start(),r.$from.end()));return i&&(t||(t=e.tr)).setSelection(i),t}(r,Qu(r,n),e)})}({allowTableNodeSelection:!0}));Jh(Wp,{displayName:"Prose<tableEditingPlugin>",group:"Prose"});var Up=O("remarkGFM",()=>On);Jh(Up.plugin,{displayName:"Remark<remarkGFMPlugin>",group:"Remark"}),Jh(Up.options,{displayName:"RemarkConfig<remarkGFMPlugin>",group:"Remark"});var Gp=new d("MILKDOWN_KEEP_TABLE_ALIGN_PLUGIN"),Zp=s(()=>new c({key:Gp,appendTransaction:(e,t,n)=>{let r;return t.doc!==n.doc&&n.doc.descendants((e,t)=>{if(r||(r=n.tr),"table_cell"!==e.type.name)return;const o=n.doc.resolve(t),i=o.node(o.depth),a=o.node(o.depth-1).firstChild;if(!a)return;const s=function(e,t){let n=0;return t.forEach((t,r,o)=>{t===e&&(n=o)}),n}(e,i),l=a.maybeChild(s);if(!l)return;const c=l.attrs.alignment;c!==e.attrs.alignment&&r.setNodeMarkup(t,void 0,{...e.attrs,alignment:c})}),r}}));Jh(Zp,{displayName:"Prose<keepTableAlignPlugin>",group:"Prose"});var Xp=[Zp,$p,Up,Wp].flat(),Kp=[[Np,ip,ap,sp,cp,lp,Bp,Dp,Qh,ep].flat(),jp,Fp,Vp,qp,[gp,fp,vp,yp,bp,wp,xp,kp,Cp,_p,Mp,Tp,Sp,Ap,Ep,tp],Xp].flat(),Yp=Object.defineProperty,Jp=Object.getOwnPropertySymbols,Qp=Object.prototype.hasOwnProperty,em=Object.prototype.propertyIsEnumerable,tm=(e,t,n)=>t in e?Yp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nm=(e,t)=>{for(var n in t||(t={}))Qp.call(t,n)&&tm(e,n,t[n]);if(Jp)for(var n of Jp(t))em.call(t,n)&&tm(e,n,t[n]);return e};function rm(e,t){return Object.assign(e,{meta:nm({package:"@milkdown/components"},t)}),e}const om=a({activationMode:"viewport",extensions:[],languages:[],expandIcon:"⬇",searchIcon:"🔍",clearSearchIcon:"⌫",searchPlaceholder:"Search language",noResultText:"No result",copyText:"Copy",copyIcon:"📋",onCopy:()=>{},renderLanguage:e=>e,renderPreview:()=>null,previewToggleButton:e=>e?"Edit":"Hide",previewLabel:"Preview",previewLoading:"Loading..."},"codeBlockConfigCtx");rm(om,{displayName:"Config<code-block>",group:"CodeBlock"});class im{constructor(e){this.languages=e,this.map={},e.forEach(e=>{e.alias.forEach(t=>{this.map[t]=e})})}getAll(){return this.languages.map(e=>({name:e.name,alias:e.alias}))}load(e){const t=this.map[e.toLowerCase()];return t?t.support?Promise.resolve(t.support):t.load():Promise.resolve(void 0)}}function am({icon:e,class:t,onClick:n}){return pd("span",{class:Ln("milkdown-icon",t),onPointerdown:n,innerHTML:e?Sn.sanitize(e.trim()):void 0})}am.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const sm=ml({props:{copyText:{type:String,required:!0},copyIcon:{type:String,required:!0},onCopy:{type:Function,required:!0},text:{type:String,required:!0}},setup(e){const t=()=>{(function(e){return((e,t,n)=>new Promise((t,r)=>{var o=e=>{try{a(n.next(e))}catch(_T){r(_T)}},i=e=>{try{a(n.throw(e))}catch(_T){r(_T)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(o,i);a((n=n.apply(e,null)).next())}))(this,0,function*(){try{return navigator.clipboard.writeText(e)}catch(_T){const n=document.createElement("textarea"),r=document.activeElement;n.value=e,n.setAttribute("readonly",""),n.style.contain="strict",n.style.position="absolute",n.style.left="-9999px",n.style.fontSize="12pt";const o=document.getSelection(),i=o?o.rangeCount>0&&o.getRangeAt(0):null;document.body.appendChild(n),n.select(),n.selectionStart=0,n.selectionEnd=e.length,document.execCommand("copy"),document.body.removeChild(n),i&&(o.removeAllRanges(),o.addRange(i)),r&&r.focus()}})})(e.text).then(()=>e.onCopy(e.text)).catch(console.error)};return()=>pd(Dc,null,pd("button",{type:"button",class:"copy-button",onClick:t},pd(am,{icon:e.copyIcon}),e.copyText))}}),lm=ml({props:{language:{type:Object,required:!0},getReadOnly:{type:Function,required:!0},config:{type:Object,required:!0},getAllLanguages:{type:Function,required:!0},setLanguage:{type:Function,required:!0}},setup({language:e,config:t,setLanguage:n,getAllLanguages:r,getReadOnly:o}){const i=gs(),a=gs(!1),s=gs(),l=gs(),c=gs("");sl([a,i,l],()=>{c.value="";const e=i.value,t=l.value;e&&t&&b(e,t,{placement:"bottom-start"}).then(({x:e,y:n})=>{Object.assign(t.style,{left:`${e}px`,top:`${n}px`})}).catch(console.error)});const d=e=>{if(e.preventDefault(),e.stopPropagation(),o())return;const t=!a.value;a.value=t,t&&setTimeout(()=>{var e;return null==(e=s.value)?void 0:e.focus()},0)},u=e=>{const t=e.target;c.value=t.value},h=e=>{"Escape"===e.key&&(c.value="")},p=hd(()=>{var t;if(!a.value)return[];const n=null!=(t=r())?t:[],o=n.find(t=>t.name.toLowerCase()===e.value.toLowerCase()),i=n.filter(e=>{const t=c.value.toLowerCase();return(e.name.toLowerCase().includes(t)||e.alias.some(e=>e.toLowerCase().includes(t)))&&e!==o});return 0===i.length?[]:o?[o,...i]:i}),m=e=>{const t=e.target;if(i.value&&i.value.contains(t))return;const n=l.value,r=i.value;r&&n&&"true"===r.dataset.expanded&&(n.contains(t)||(a.value=!1))};return El(()=>{window.addEventListener("click",m)}),Rl(()=>{window.removeEventListener("click",m)}),()=>pd(Dc,null,pd("button",{type:"button",ref:i,class:"language-button",onClick:d,"data-expanded":String(a.value)},e.value||"Text",pd("div",{class:"expand-icon"},pd(am,{icon:t.expandIcon}))),pd("div",{ref:l,class:"language-picker"},a.value?pd("div",{class:"list-wrapper"},pd("div",{class:"search-box"},pd("div",{class:"search-icon"},pd(am,{icon:t.searchIcon})),pd("input",{ref:s,class:"search-input",placeholder:t.searchPlaceholder,value:c.value,onInput:u,onKeydown:h}),pd("div",{class:Ln("clear-icon",0===c.value.length&&"hidden"),onMousedown:e=>{e.preventDefault(),c.value=""}},pd(am,{icon:t.clearSearchIcon}))),pd("ul",{class:"language-list",role:"listbox",onKeydown:e=>{if("Enter"===e.key){const e=document.activeElement;e instanceof HTMLElement&&e.dataset.language&&n(e.dataset.language)}}},p.value.length?p.value.map(r=>pd("li",{role:"listitem",tabindex:"0",class:"language-list-item","aria-selected":r.name.toLowerCase()===e.value.toLowerCase(),"data-language":r.name,onClick:()=>{n(r.name),a.value=!1}},t.renderLanguage(r.name,r.name.toLowerCase()===e.value.toLowerCase()))):pd("li",{class:"language-list-item no-result"},t.noResultText))):null))}});let cm;const dm=ml({props:{text:{type:Object,required:!0},language:{type:Object,required:!0},config:{type:Object,required:!0},previewOnlyMode:{type:Object,required:!0},preview:{type:Object,required:!0}},setup(e){const{previewOnlyMode:t,config:n,preview:r}=e,o=gs();return al(()=>{const e=o.value;if(!e)return;for(;e.firstChild;)e.removeChild(e.firstChild);const t=r.value;("string"==typeof t||t instanceof Element)&&(e.innerHTML=function(e){return null!=cm||(cm=function(){const e=Sn(),t={ADD_TAGS:["foreignObject"],ADD_ATTR:["xmlns"],HTML_INTEGRATION_POINTS:{foreignobject:!0}};return e.addHook("uponSanitizeElement",(e,t)=>{var n;if("foreignobject"===t.tagName){const t=e.parentElement;t&&"http://www.w3.org/2000/svg"===t.namespaceURI||null==(n=e.parentNode)||n.removeChild(e)}}),n=>e.sanitize(n,t)}()),cm(e)}(t))}),()=>r.value?pd("div",{class:"preview-panel"},!t.value&&pd(Dc,null,pd("div",{class:"preview-divider"}),pd("div",{class:"preview-label"},n.previewLabel)),pd("div",{ref:o,class:"preview"})):null}}),um=ml({props:{text:{type:Object,required:!0},selected:{type:Object,required:!0},getReadOnly:{type:Function,required:!0},codemirror:{type:Object,required:!0},language:{type:Object,required:!0},getAllLanguages:{type:Function,required:!0},setLanguage:{type:Function,required:!0},config:{type:Object,required:!0}},setup(e){var t;const n=gs(null!=(t=e.config.previewOnlyByDefault)?t:e.getReadOnly()),r=gs(),o=gs(null);El(()=>{for(var t;null==(t=r.value)?void 0:t.firstChild;)r.value.removeChild(r.value.firstChild);r.value&&r.value.appendChild(e.codemirror.dom)}),sl(()=>[e.text.value,e.language.value],()=>{const t=e.config.renderPreview(e.language.value,e.text.value,e=>o.value=e);t&&(o.value=t),void 0===t&&!o.value&&(o.value=Sn.sanitize(e.config.previewLoading)),null===t&&(o.value=null)},{immediate:!0});const i=()=>{};return()=>{var t;return pd(Dc,null,pd("div",{class:"tools"},pd(lm,{language:e.language,config:e.config,setLanguage:e.setLanguage,getAllLanguages:e.getAllLanguages,getReadOnly:e.getReadOnly}),pd("div",{class:"tools-button-group"},pd(sm,{copyIcon:e.config.copyIcon,copyText:e.config.copyText,onCopy:null!=(t=e.config.onCopy)?t:i,text:e.text.value}),o.value?pd("button",{class:"preview-toggle-button",onClick:()=>n.value=!n.value},pd(am,{icon:e.config.previewToggleButton(n.value)})):null)),pd("div",{ref:r,class:Ln("codemirror-host",o.value&&n.value&&"hidden")}),pd(dm,{text:e.text,language:e.language,config:e.config,previewOnlyMode:n,preview:o}))}}}),hm=new WeakMap;let pm=null;function mm(){return pm||(pm=new IntersectionObserver(e=>{for(const t of e){const e=hm.get(t.target);null==e||e(t.isIntersecting)}},{rootMargin:"200px"})),pm}const fm=class e{constructor(e,t,n,r,o){var i;this.node=e,this.view=t,this.getPos=n,this.loader=r,this.config=o,this.selected=gs(!1),this.language=gs(""),this.text=gs(""),this.initialized=!1,this.updating=!1,this.languageName="",this.teardownTimer=null,this.forwardUpdate=e=>{var t;if(this.updating||!this.cm.hasFocus)return;let n=(null!=(t=this.getPos())?t:0)+1;const{main:r}=e.state.selection,o=n+r.from,i=n+r.to,a=this.view.state.selection;if(e.docChanged||a.from!==o||a.to!==i){const t=this.view.state.tr;e.changes.iterChanges((e,r,o,i,a)=>{a.length?t.replaceWith(n+e,n+r,this.view.state.schema.text(a.toString())):t.delete(n+e,n+r),n+=i-o-(r-e)}),t.setSelection(S.create(t.doc,o,i)),this.view.dispatch(t)}},this.activateFromPointer=e=>{var t;if(this.initialized||"interaction"!==this.config.activationMode)return;e.preventDefault(),e.stopPropagation(),this.initializeCodeMirror();const n=null!=(t=this.cm.posAtCoords({x:e.clientX,y:e.clientY}))?t:0;this.cm.focus(),this.cm.dispatch({selection:{anchor:n}})},this.createApp=()=>qd(um,{text:this.text,selected:this.selected,codemirror:this.cm,language:this.language,getAllLanguages:this.getAllLanguages,getReadOnly:()=>!this.view.editable,setLanguage:this.setLanguage,config:this.config}),this.codeMirrorKeymap=()=>{const e=this.view;return[{key:"ArrowUp",run:()=>this.maybeEscape("line",-1)},{key:"ArrowLeft",run:()=>this.maybeEscape("char",-1)},{key:"ArrowDown",run:()=>this.maybeEscape("line",1)},{key:"ArrowRight",run:()=>this.maybeEscape("char",1)},{key:"Mod-Enter",run:()=>!!te(e.state,e.dispatch)&&(e.focus(),!0)},{key:"Mod-z",run:()=>Q(e.state,e.dispatch)},{key:"Shift-Mod-z",run:()=>ee(e.state,e.dispatch)},{key:"Mod-y",run:()=>ee(e.state,e.dispatch)},{key:"Backspace",run:()=>{var e;const t=this.cm.state.selection.ranges;if(t.length>1)return!1;const n=t[0];if(n&&(!n.empty||n.anchor>0))return!1;if(this.cm.state.doc.lines>=2)return!1;const r=this.view.state,o=null!=(e=this.getPos())?e:0,i=r.tr.replaceWith(o,o+this.node.nodeSize,r.schema.nodes.paragraph.createChecked({},this.node.content));return i.setSelection(S.near(i.doc.resolve(o))),this.view.dispatch(i),this.view.focus(),!0}}]},this.maybeEscape=(e,t)=>{var n;const{state:r}=this.cm;let o=r.selection.main;if(!o.empty)return!1;if("line"===e&&(o=r.doc.lineAt(o.head)),t<0?o.from>0:o.to<r.doc.length)return!1;const i=(null!=(n=this.getPos())?n:0)+(t<0?0:this.node.nodeSize),a=S.near(this.view.state.doc.resolve(i),t),s=this.view.state.tr.setSelection(a).scrollIntoView();return this.view.dispatch(s),this.view.focus(),!0},this.setLanguage=e=>{var t;this.view.dispatch(this.view.state.tr.setNodeAttribute(null!=(t=this.getPos())?t:0,"language",e))},this.getAllLanguages=()=>this.loader.getAll(),this.languageConf=new Dt,this.readOnlyConf=new Dt,this.text.value=this.node.textContent,this.language.value=null!=(i=this.node.attrs.language)?i:"",this.dom=document.createElement("div"),this.dom.className="milkdown-code-block",this.disposeSelectedWatcher=al(()=>{this.selected.value?this.dom.classList.add("selected"):this.dom.classList.remove("selected")}),this.dom.addEventListener("pointerdown",this.activateFromPointer),this.renderPlaceholder(),hm.set(this.dom,e=>{e?(this.cancelTeardown(),"viewport"===this.config.activationMode&&this.initializeCodeMirror()):this.initialized&&this.scheduleTeardown()}),mm().observe(this.dom)}renderPlaceholder(){const e=document.createElement("pre");e.className="milkdown-code-block-placeholder";const t=document.createElement("code");t.textContent=this.node.textContent,e.appendChild(t),this.dom.appendChild(e)}initializeCodeMirror(){if(this.initialized)return;this.initialized=!0,this.cm=new Rt({doc:this.node.textContent,root:this.view.root,extensions:[this.readOnlyConf.of(qt.readOnly.of(!this.view.editable)),Nt(),Ht.of(this.codeMirrorKeymap()),this.languageConf.of([]),qt.changeFilter.of(()=>this.view.editable),...this.config.extensions,Rt.updateListener.of(this.forwardUpdate)]});const e=this.dom.querySelector(".milkdown-code-block-placeholder");e&&this.dom.removeChild(e),this.app=this.createApp(),this.app.mount(this.dom),this.updateLanguage()}teardownCodeMirror(){if(this.initialized&&!this.cm.hasFocus&&!this.selected.value){for(this.app.unmount(),this.cm.destroy(),this.initialized=!1,this.languageName="";this.dom.firstChild;)this.dom.removeChild(this.dom.firstChild);this.renderPlaceholder()}}scheduleTeardown(){this.cancelTeardown(),this.teardownTimer=setTimeout(()=>this.teardownCodeMirror(),e.TEARDOWN_DELAY)}cancelTeardown(){null!=this.teardownTimer&&(clearTimeout(this.teardownTimer),this.teardownTimer=null)}updateLanguage(){const e=this.node.attrs.language;e!==this.languageName&&(this.language.value=e,this.loader.load(null!=e?e:"").then(t=>{t&&(this.cm.dispatch({effects:this.languageConf.reconfigure(t)}),this.languageName=e)}).catch(console.error))}setSelection(e,t){this.initialized||this.initializeCodeMirror(),this.cm.dom.isConnected&&(this.cm.focus(),this.updating=!0,this.cm.dispatch({selection:{anchor:e,head:t}}),this.updating=!1)}update(e){var t;if(e.type!==this.node.type)return!1;if(this.updating)return!0;if(this.node=e,this.text.value=e.textContent,this.language.value=null!=(t=e.attrs.language)?t:"",!this.initialized){const t=this.dom.querySelector(".milkdown-code-block-placeholder code");return t&&(t.textContent=e.textContent),!0}this.updateLanguage(),this.view.editable===this.cm.state.readOnly&&this.cm.dispatch({effects:this.readOnlyConf.reconfigure(qt.readOnly.of(!this.view.editable))});const n=function(e,t){if(e===t)return null;let n=0,r=e.length,o=t.length;for(;n<r&&e.charCodeAt(n)===t.charCodeAt(n);)++n;for(;r>n&&o>n&&e.charCodeAt(r-1)===t.charCodeAt(o-1);)r--,o--;return{from:n,to:r,text:t.slice(n,o)}}(this.cm.state.doc.toString(),e.textContent);return n&&(this.updating=!0,this.cm.dispatch({changes:{from:n.from,to:n.to,insert:n.text},scrollIntoView:!0}),this.updating=!1),!0}selectNode(){this.initialized||this.initializeCodeMirror(),this.selected.value=!0,this.cm.focus()}deselectNode(){this.selected.value=!1}stopEvent(){return!0}destroy(){this.cancelTeardown(),this.dom.removeEventListener("pointerdown",this.activateFromPointer),mm().unobserve(this.dom),hm.delete(this.dom),this.initialized&&(this.app.unmount(),this.cm.destroy()),this.disposeSelectedWatcher()}};fm.TEARDOWN_DELAY=5e3;let gm=fm;const vm=R(J.node,e=>{const t=e.get(om.key),n=new im(t.languages);return(e,r,o)=>new gm(e,r,o,n,t)});rm(vm,{displayName:"NodeView<code-block>",group:"CodeBlock"});const ym=[vm,om],bm="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class wm{constructor(e,t,n=0,r=e.length,o,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=o?e=>o(bm(e)):bm,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Jt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=en(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Qt(e);let r=this.normalize(t);if(r.length)for(let o=0,i=n;;o++){let e=r.charCodeAt(o),a=this.match(e,i,this.bufferPos+this.bufferStart);if(o==r.length-1){if(a)return this.value=a,this;break}i==n&&o<t.length&&t.charCodeAt(o)==e&&i++}}}match(e,t,n){let r=null;for(let o=0;o<this.matches.length;o+=2){let t=this.matches[o],i=!1;this.query.charCodeAt(t)==e&&(t==this.query.length-1?r={from:this.matches[o+1],to:n}:(this.matches[o]++,i=!0)),i||(this.matches.splice(o,2),o-=2)}return this.query.charCodeAt(0)==e&&(1==this.query.length?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}"undefined"!=typeof Symbol&&(wm.prototype[Symbol.iterator]=function(){return this});const xm={from:-1,to:-1,match:/.*/.exec("")},km="gm"+(null==/x/.unicode?"":"u");class Cm{constructor(e,t,n,r=0,o=e.length){if(this.text=e,this.to=o,this.curLine="",this.done=!1,this.value=xm,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new Am(e,t,n,r,o);this.re=new RegExp(t,km+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let i=e.lineAt(r);this.curLineStart=i.from,this.matchPos=Mm(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=Mm(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}const _m=new WeakMap;class Sm{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=_m.get(e);if(!r||r.from>=n||r.to<=t){let r=new Sm(t,e.sliceString(t,n));return _m.set(e,r),r}if(r.from==t&&r.to==n)return r;let{text:o,from:i}=r;return i>t&&(o=e.sliceString(t,i)+o,i=t),r.to<n&&(o+=e.sliceString(r.to,n)),_m.set(e,new Sm(i,o)),new Sm(t,o.slice(t-i,n-i))}}class Am{constructor(e,t,n,r,o){this.text=e,this.to=o,this.done=!1,this.value=xm,this.matchPos=Mm(e,r),this.re=new RegExp(t,km+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=Sm.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=Mm(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Sm.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function Mm(e,t){if(t>=e.length)return t;let n,r=e.lineAt(t);for(;t<r.to&&(n=r.text.charCodeAt(t-r.from))>=56320&&n<57344;)t++;return t}"undefined"!=typeof Symbol&&(Cm.prototype[Symbol.iterator]=Am.prototype[Symbol.iterator]=function(){return this});const Tm={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Em=Ut.define({combine:e=>Yt(e,Tm,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),Lm=Xt.mark({class:"cm-selectionMatch"}),Om=Xt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Im(e,t,n,r){return!(0!=n&&e(t.sliceDoc(n-1,n))==tn.Word||r!=t.doc.length&&e(t.sliceDoc(r,r+1))==tn.Word)}const Rm=jt.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Em),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Xt.none;let o,i=r.main,a=null;if(i.empty){if(!t.highlightWordAroundCursor)return Xt.none;let e=n.wordAt(i.head);if(!e)return Xt.none;a=n.charCategorizer(i.head),o=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return Xt.none;if(t.wholeWords){if(o=n.sliceDoc(i.from,i.to),a=n.charCategorizer(i.head),!Im(a,n,i.from,i.to)||!function(e,t,n,r){return e(t.sliceDoc(n,n+1))==tn.Word&&e(t.sliceDoc(r-1,r))==tn.Word}(a,n,i.from,i.to))return Xt.none}else if(o=n.sliceDoc(i.from,i.to),!o)return Xt.none}let s=[];for(let l of e.visibleRanges){let e=new wm(n.doc,o,l.from,l.to);for(;!e.next().done;){let{from:r,to:o}=e.value;if((!a||Im(a,n,r,o))&&(i.empty&&r<=i.from&&o>=i.to?s.push(Om.range(r,o)):(r>=i.to||o<=i.from)&&s.push(Lm.range(r,o)),s.length>t.maxMatches))return Xt.none}}return Xt.set(s)}},{decorations:e=>e.decorations}),Pm=Rt.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Bm=Ut.define({combine:e=>Yt(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new uf(e),scrollToMatch:e=>Rt.scrollIntoView(e)})});class zm{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,km),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Fm(this):new Hm(this)}getCursor(e,t=0,n){let r=e.doc?e:qt.create({doc:e});return null==n&&(n=r.doc.length),this.regexp?qm(this,r,t,n):Nm(this,r,t,n)}}class Dm{constructor(e){this.spec=e}}function Nm(e,t,n,r){let o;return e.wholeWord&&(o=function(e,t){return(n,r,o,i)=>((i>n||i+o.length<r)&&(i=Math.max(0,n-2),o=e.sliceString(i,Math.min(e.length,r+2))),!(t(jm(o,n-i))==tn.Word&&t(Vm(o,n-i))==tn.Word||t(Vm(o,r-i))==tn.Word&&t(jm(o,r-i))==tn.Word))}(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(o=function(e,t,n){return(r,o,i,a)=>{if(n&&!n(r,o,i,a))return!1;let s=r>=a&&o<=a+i.length?i.slice(r-a,o-a):t.doc.sliceString(r,o);return e(s,t,r,o)}}(e.test,t,o)),new wm(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),o)}class Hm extends Dm{constructor(e){super(e)}nextMatch(e,t,n){let r=Nm(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=Nm(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),o=Nm(this.spec,e,n,r),i=null;for(;!o.nextOverlapping().done;)i=o.value;if(i)return i;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),!r||r.from==t&&r.to==n?null:r}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=Nm(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let o=Nm(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)r(o.value.from,o.value.to)}}function qm(e,t,n,r){let o;return e.wholeWord&&(o=function(e){return(t,n,r)=>!r[0].length||(e(jm(r.input,r.index))!=tn.Word||e(Vm(r.input,r.index))!=tn.Word)&&(e(Vm(r.input,r.index+r[0].length))!=tn.Word||e(jm(r.input,r.index+r[0].length))!=tn.Word)}(t.charCategorizer(t.selection.main.head))),e.test&&(o=function(e,t,n){return(r,o,i)=>(!n||n(r,o,i))&&e(i[0],t,r,o)}(e.test,t,o)),new Cm(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:o},n,r)}function jm(e,t){return e.slice(an(e,t,!1),t)}function Vm(e,t){return e.slice(t,an(e,t))}class Fm extends Dm{nextMatch(e,t,n){let r=qm(this.spec,e,n,e.doc.length).next();return r.done&&(r=qm(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let o=Math.max(t,n-1e4*r),i=qm(this.spec,e,o,n),a=null;for(;!i.next().done;)a=i.value;if(a&&(o==t||a.from>o+10))return a;if(o==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if("&"==n)return e.match[0];if("$"==n)return"$";for(let r=n.length;r>0;r--){let t=+n.slice(0,r);if(t>0&&t<e.match.length)return e.match[t]+n.slice(r)}return t})}matchAll(e,t){let n=qm(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let o=qm(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!o.next().done;)r(o.value.from,o.value.to)}}const $m=Ft.define(),Wm=Ft.define(),Um=Vt.define({create:e=>new Gm(of(e).create(),null),update(e,t){for(let n of t.effects)n.is($m)?e=new Gm(n.value.create(),e.panel):n.is(Wm)&&(e=new Gm(e.query,n.value?rf:null));return e},provide:e=>Kt.from(e,e=>e.panel)});class Gm{constructor(e,t){this.query=e,this.panel=t}}const Zm=Xt.mark({class:"cm-searchMatch"}),Xm=Xt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Km=jt.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Um))}update(e){let t=e.state.field(Um);(t!=e.startState.field(Um)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Xt.none;let{view:n}=this,r=new nn;for(let o=0,i=n.visibleRanges,a=i.length;o<a;o++){let{from:t,to:s}=i[o];for(;o<a-1&&s>i[o+1].from-500;)s=i[++o].to;e.highlight(n.state,t,s,(e,t)=>{let o=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,o?Xm:Zm)})}return r.finish()}},{decorations:e=>e.decorations});function Ym(e){return t=>{let n=t.state.field(Um,!1);return n&&n.query.spec.valid?e(t,n):lf(t)}}const Jm=Ym((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let o=Wt.single(r.from,r.to),i=e.state.facet(Bm);return e.dispatch({selection:o,effects:[ff(e,r),i.scrollToMatch(o.main,e)],userEvent:"select.search"}),sf(e),!0}),Qm=Ym((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,o=t.prevMatch(n,r,r);if(!o)return!1;let i=Wt.single(o.from,o.to),a=e.state.facet(Bm);return e.dispatch({selection:i,effects:[ff(e,o),a.scrollToMatch(i.main,e)],userEvent:"select.search"}),sf(e),!0}),ef=Ym((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!(!n||!n.length||(e.dispatch({selection:Wt.create(n.map(e=>Wt.range(e.from,e.to))),userEvent:"select.search.matches"}),0))}),tf=Ym((e,{query:t})=>{let{state:n}=e,{from:r,to:o}=n.selection.main;if(n.readOnly)return!1;let i=t.nextMatch(n,r,r);if(!i)return!1;let a,s,l=i,c=[],d=[];l.from==r&&l.to==o&&(s=n.toText(t.getReplacement(l)),c.push({from:l.from,to:l.to,insert:s}),l=t.nextMatch(n,l.from,l.to),d.push(Rt.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+".")));let u=e.state.changes(c);return l&&(a=Wt.single(l.from,l.to).map(u),d.push(ff(e,l)),d.push(n.facet(Bm).scrollToMatch(a.main,e))),e.dispatch({changes:u,selection:a,effects:d,userEvent:"input.replace"}),!0}),nf=Ym((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:Rt.announce.of(r),userEvent:"input.replace.all"}),!0});function rf(e){return e.state.facet(Bm).createPanel(e)}function of(e,t){var n,r,o,i,a;let s=e.selection.main,l=s.empty||s.to>s.from+100?"":e.sliceDoc(s.from,s.to);if(t&&!l)return t;let c=e.facet(Bm);return new zm({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(r=null==t?void 0:t.caseSensitive)&&void 0!==r?r:c.caseSensitive,literal:null!==(o=null==t?void 0:t.literal)&&void 0!==o?o:c.literal,regexp:null!==(i=null==t?void 0:t.regexp)&&void 0!==i?i:c.regexp,wholeWord:null!==(a=null==t?void 0:t.wholeWord)&&void 0!==a?a:c.wholeWord})}function af(e){let t=Gt(e,rf);return t&&t.dom.querySelector("[main-field]")}function sf(e){let t=af(e);t&&t==e.root.activeElement&&t.select()}const lf=e=>{let t=e.state.field(Um,!1);if(t&&t.panel){let n=af(e);if(n&&n!=e.root.activeElement){let r=of(e.state,t.query.spec);r.valid&&e.dispatch({effects:$m.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[Wm.of(!0),t?$m.of(of(e.state,t.query.spec)):Ft.appendConfig.of(vf)]});return!0},cf=e=>{let t=e.state.field(Um,!1);if(!t||!t.panel)return!1;let n=Gt(e,rf);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Wm.of(!1)}),!0},df=[{key:"Mod-f",run:lf,scope:"editor search-panel"},{key:"F3",run:Jm,shift:Qm,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Jm,shift:Qm,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:cf,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:o}=n.main,i=[],a=0;for(let s=new wm(e.doc,e.sliceDoc(r,o));!s.next().done;){if(i.length>1e3)return!1;s.value.from==r&&(a=i.length),i.push(Wt.range(s.value.from,s.value.to))}return t(e.update({selection:Wt.create(i,a),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:o}=Zt(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return o.then(n=>{let o=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!o)return void e.dispatch({effects:r});let i=t.doc.lineAt(t.selection.main.head),[,a,s,l,c]=o,d=l?+l.slice(1):0,u=s?+s:i.number;if(s&&c){let e=u/100;a&&(e=e*("-"==a?-1:1)+i.number/t.doc.lines),u=Math.round(t.doc.lines*e)}else s&&a&&(u=u*("-"==a?-1:1)+i.number);let h=t.doc.line(Math.max(1,Math.min(t.doc.lines,u))),p=Wt.cursor(h.from+Math.max(0,Math.min(d,h.length)));e.dispatch({effects:[r,Rt.scrollIntoView(p.from,{y:"center"})],selection:p})}),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return(({state:e,dispatch:t})=>{let{selection:n}=e,r=Wt.create(n.ranges.map(t=>e.wordAt(t.head)||Wt.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)})({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let o=function(e,t){let{main:n,ranges:r}=e.selection,o=e.wordAt(n.head),i=o&&o.from==n.from&&o.to==n.to;for(let a=!1,s=new wm(e.doc,t,r[r.length-1].to);;){if(s.next(),!s.done){if(a&&r.some(e=>e.from==s.value.from))continue;if(i){let t=e.wordAt(s.value.from);if(!t||t.from!=s.value.from||t.to!=s.value.to)continue}return s.value}if(a)return null;s=new wm(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),a=!0}}(e,r);return!!o&&(t(e.update({selection:e.selection.addRange(Wt.range(o.from,o.to),!1),effects:Rt.scrollIntoView(o.to)})),!0)},preventDefault:!0}];class uf{constructor(e){this.view=e;let t=this.query=e.state.field(Um).query.spec;function n(e,t,n){return rn("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=rn("input",{value:t.search,placeholder:hf(e,"Find"),"aria-label":hf(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=rn("input",{value:t.replace,placeholder:hf(e,"Replace"),"aria-label":hf(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=rn("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=rn("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=rn("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=rn("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>Jm(e),[hf(e,"next")]),n("prev",()=>Qm(e),[hf(e,"previous")]),n("select",()=>ef(e),[hf(e,"all")]),rn("label",null,[this.caseField,hf(e,"match case")]),rn("label",null,[this.reField,hf(e,"regexp")]),rn("label",null,[this.wordField,hf(e,"by word")]),...e.state.readOnly?[]:[rn("br"),this.replaceField,n("replace",()=>tf(e),[hf(e,"replace")]),n("replaceAll",()=>nf(e),[hf(e,"replace all")])],rn("button",{name:"close",onclick:()=>cf(e),"aria-label":hf(e,"close"),type:"button"},["×"])])}commit(){let e=new zm({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:$m.of(e)}))}keydown(e){on(this.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Qm:Jm)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),tf(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is($m)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Bm).top}}function hf(e,t){return e.state.phrase(t)}const pf=30,mf=/[\s\.,:;?!]/;function ff(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),o=e.state.doc.lineAt(n).to,i=Math.max(r.from,t-pf),a=Math.min(o,n+pf),s=e.state.sliceDoc(i,a);if(i!=r.from)for(let l=0;l<pf;l++)if(!mf.test(s[l+1])&&mf.test(s[l])){s=s.slice(l);break}if(a!=o)for(let l=s.length-1;l>s.length-pf;l--)if(!mf.test(s[l-1])&&mf.test(s[l])){s=s.slice(0,l);break}return Rt.announce.of(`${e.state.phrase("current match")}. ${s} ${e.state.phrase("on line")} ${r.number}.`)}const gf=Rt.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),vf=[Um,$t.low(Km),gf];class yf{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class bf{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=n.facet(Of).markerFilter;r&&(e=r(e,n));let o=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),i=new nn,a=[],s=0,l=n.doc.iter(),c=0,d=n.doc.length;for(let h=0;;){let e,t,n=h==o.length?null:o[h];if(!n&&!a.length)break;if(a.length)e=s,t=a.reduce((e,t)=>Math.min(e,t.to),n&&n.from>e?n.from:1e8);else{if(e=n.from,e>d)break;t=n.to,a.push(n),h++}for(;h<o.length;){let n=o[h];if(n.from!=e||!(n.to>n.from||n.to==e)){t=Math.min(n.from,t);break}a.push(n),h++,t=Math.min(n.to,t)}t=Math.min(t,d);let r=!1;if(a.some(n=>n.from==e&&(n.to==t||t==d))&&(r=e==t,!r&&t-e<10)){let n=e-(c+l.value.length);n>0&&(l.next(n),c=e);for(let o=e;;){if(o>=t){r=!0;break}if(!l.lineBreak&&c+l.value.length>o)break;o=c+l.value.length,c+=l.value.length,l.next()}}let u=jf(a);if(r)i.add(e,e,Xt.widget({widget:new Bf(u),diagnostics:a.slice()}));else{let n=a.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");i.add(e,t,Xt.mark({class:"cm-lintRange cm-lintRange-"+u+n,diagnostics:a.slice(),inclusiveEnd:a.some(e=>e.to>t)}))}if(s=t,s==d)break;for(let o=0;o<a.length;o++)a[o].to<=s&&a.splice(o--,1)}let u=i.finish();return new bf(u,t,wf(u))}}function wf(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:o})=>{if(!(t&&o.diagnostics.indexOf(t)<0))if(r){if(o.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new yf(r.from,n,r.diagnostic)}else r=new yf(e,n,t||o.diagnostics[0])}),r}function xf(e,t){return e.field(Sf,!1)?t:t.concat(Ft.appendConfig.of(Vf))}const kf=Ft.define(),Cf=Ft.define(),_f=Ft.define(),Sf=Vt.define({create:()=>new bf(Xt.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,o=e.panel;if(e.selected){let o=t.changes.mapPos(e.selected.from,1);r=wf(n,e.selected.diagnostic,o)||wf(n,null,o)}!n.size&&o&&t.state.facet(Of).autoPanel&&(o=null),e=new bf(n,o,r)}for(let n of t.effects)if(n.is(kf)){let r=t.state.facet(Of).autoPanel?n.value.length?Df.open:null:e.panel;e=bf.init(n.value,r,t.state)}else n.is(Cf)?e=new bf(e.diagnostics,n.value?Df.open:null,e.selected):n.is(_f)&&(e=new bf(e.diagnostics,e.panel,n.value));return e},provide:e=>[Kt.from(e,e=>e.panel),Rt.decorations.from(e,e=>e.diagnostics)]}),Af=Xt.mark({class:"cm-lintRange cm-lintRange-active"});function Mf(e,t,n){let r,{diagnostics:o}=e.state.field(Sf),i=-1,a=-1;o.between(t-(n<0?1:0),t+(n>0?1:0),(e,o,{spec:s})=>{if(t>=e&&t<=o&&(e==o||(t>e||n>0)&&(t<o||n<0)))return r=s.diagnostics,i=e,a=o,!1});let s=e.state.facet(Of).tooltipFilter;return r&&s&&(r=s(r,e.state)),r?{pos:i,end:a,above:e.state.doc.lineAt(i).to<a,create:()=>({dom:Tf(e,r)})}:null}function Tf(e,t){return rn("ul",{class:"cm-tooltip-lint"},t.map(t=>Pf(e,t,!1)))}const Ef=e=>{let t=e.state.field(Sf,!1);return!(!t||!t.panel||(e.dispatch({effects:Cf.of(!1)}),0))},Lf=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(Sf,!1);t&&t.panel||e.dispatch({effects:xf(e.state,[Cf.of(!0)])});let n=Gt(e,Df.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(Sf,!1);if(!t)return!1;let n=e.state.selection.main,r=wf(t.diagnostics,null,n.to+1);return!(!r&&(r=wf(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)||(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),0))}}],Of=Ut.define({combine:e=>({sources:e.map(e=>e.source).filter(e=>null!=e),...Yt(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:If,tooltipFilter:If,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,o)=>e(n,r,o)||t(n,r,o):e:t,autoPanel:(e,t)=>e||t})})});function If(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function Rf(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue e}}t.push("")}return t}function Pf(e,t,n){var r;let o=n?Rf(t.actions):[];return rn("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},rn("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null===(r=t.actions)||void 0===r?void 0:r.map((n,r)=>{let i=!1,a=r=>{if(r.preventDefault(),i)return;i=!0;let o=wf(e.state.field(Sf).diagnostics,t);o&&n.apply(e,o.from,o.to)},{name:s}=n,l=o[r]?s.indexOf(o[r]):-1,c=l<0?s:[s.slice(0,l),rn("u",s.slice(l,l+1)),s.slice(l+1)],d=n.markClass?" "+n.markClass:"";return rn("button",{type:"button",class:"cm-diagnosticAction"+d,onclick:a,onmousedown:a,"aria-label":` Action: ${s}${l<0?"":` (access key "${o[r]})"`}.`},c)}),t.source&&rn("div",{class:"cm-diagnosticSource"},t.source))}class Bf extends ln{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return rn("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class zf{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=Pf(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Df{constructor(e){this.view=e,this.items=[],this.list=rn("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(27==t.keyCode)Ef(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:n}=this.items[this.selectedIndex],r=Rf(n.actions);for(let o=0;o<r.length;o++)if(r[o].toUpperCase().charCodeAt(0)==t.keyCode){let t=wf(this.view.state.field(Sf).diagnostics,n);t&&n.actions[o].apply(e,t.from,t.to)}}}t.preventDefault()}},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=rn("div",{class:"cm-panel-lint"},this.list,rn("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Ef(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Sf).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Sf),n=0,r=!1,o=null,i=new Set;for(e.between(0,this.view.state.doc.length,(e,a,{spec:s})=>{for(let l of s.diagnostics){if(i.has(l))continue;i.add(l);let e,a=-1;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==l){a=t;break}a<0?(e=new zf(this.view,l),this.items.splice(n,0,e),r=!0):(e=this.items[a],a>n&&(this.items.splice(n,a-n),r=!0)),t&&e.diagnostic==t.diagnostic?e.dom.hasAttribute("aria-selected")||(e.dom.setAttribute("aria-selected","true"),o=e):e.dom.hasAttribute("aria-selected")&&e.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();0==this.items.length&&(this.items.push(new zf(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),o?(this.list.setAttribute("aria-activedescendant",o.id),this.view.requestMeasure({key:this,read:()=>({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=wf(this.view.state.field(Sf).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:_f.of(t)})}static open(e){return new Df(e)}}function Nf(e){return function(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const Hf=Rt.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Nf("#d11")},".cm-lintRange-warning":{backgroundImage:Nf("orange")},".cm-lintRange-info":{backgroundImage:Nf("#999")},".cm-lintRange-hint":{backgroundImage:Nf("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function qf(e){return"error"==e?4:"warning"==e?3:"info"==e?2:1}function jf(e){let t="hint",n=1;for(let r of e){let e=qf(r.severity);e>n&&(n=e,t=r.severity)}return t}const Vf=[Sf,Rt.decorations.compute([Sf],e=>{let{selected:t,panel:n}=e.field(Sf);return t&&n&&t.from!=t.to?Xt.set([Af.range(t.from,t.to)]):Xt.none}),sn(Mf,{hideOn:function(e,t){let n=t.pos,r=t.end||n,o=e.state.facet(Of).hideOn(e,n,r);if(null!=o)return o;let i=e.startState.doc.lineAt(t.pos);return!(!e.effects.some(e=>e.is(kf))&&!e.changes.touchesRange(i.from,Math.max(i.to,r)))}}),Hf],Ff=(()=>[cn(),dn(),un(),hn(),pn(),Nt(),mn(),qt.allowMultipleSelections.of(!0),fn(),Pt(wn,{fallback:!0}),gn(),An(),Mn(),vn(),yn(),bn(),[Pm,Rm],Ht.of([...Tn,...xn,...df,...kn,...Cn,...En,...Lf])])();function $f(e){return function(e){return 1===e.nodeType}(e)&&"http://www.w3.org/1999/xhtml"===e.namespaceURI}function Wf(e,t){return Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1])}function Uf(e,t){return Math.min(Wf(e,[t[0],t[1]]),Wf(e,[t[2],t[3]]))}class Gf extends z{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return Gf.valid(n)?new Gf(n):z.near(n)}content(){return p.empty}eq(e){return e instanceof Gf&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new Gf(e.resolve(t.pos))}getBookmark(){return new Zf(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||Xf(e.type))return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||Xf(e.type))return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&Gf.valid(e))return e;let r=e.pos,o=null;for(let n=e.depth;;n--){let i=e.node(n);if(t>0?e.indexAfter(n)<i.childCount:e.index(n)>0){o=i.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let a=e.doc.resolve(r);if(Gf.valid(a))return a}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!M.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*t),n=!1;continue e}break}o=i,r+=t;let a=e.doc.resolve(r);if(Gf.valid(a))return a}return null}}}Gf.prototype.visible=!1,Gf.findFrom=Gf.findGapCursorFrom,z.jsonID("gapcursor",Gf);class Zf{constructor(e){this.pos=e}map(e){return new Zf(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Gf.valid(t)?new Gf(t):z.near(t)}}function Xf(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}const Kf=B({ArrowLeft:Yf("horiz",-1),ArrowRight:Yf("horiz",1),ArrowUp:Yf("vert",-1),ArrowDown:Yf("vert",1)});function Yf(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){let i=e.selection,a=t>0?i.$to:i.$from,s=i.empty;if(i instanceof S){if(!o.endOfTextblock(n)||0==a.depth)return!1;s=!1,a=e.doc.resolve(t>0?a.after():a.before())}let l=Gf.findGapCursorFrom(a,t,s);return!!l&&(r&&r(e.tr.setSelection(new Gf(l))),!0)}}function Jf(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Gf.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&M.isSelectable(e.state.doc.nodeAt(o.inside))||(e.dispatch(e.state.tr.setSelection(new Gf(r))),0))}function Qf(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof Gf))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=m.empty;for(let a=r.length-1;a>=0;a--)o=m.from(r[a].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new p(o,0,0));return i.setSelection(S.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function eg(e){if(!(e.selection instanceof Gf))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",f.create(e.doc,[v.widget(e.selection.head,t,{key:"gapcursor"})])}function tg(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-cursor",...t}}),e}var ng=a(null,"dropIndicatorState");tg(ng,{displayName:"Ctx<dropIndicatorState>"});var rg=a({width:2,color:!1,class:"milkdown-drop-indicator"},"dropIndicatorConfig");tg(rg,{displayName:"Ctx<dropIndicatorConfig>"});var og=new d("MILKDOWN_DROP_INDICATOR_DOM"),ig=s(e=>new c({key:og,view:t=>{const n=e.get(rg.key),r=document.createElement("div");Object.assign(r.style,{position:"fixed",pointerEvents:"none",display:"none",backgroundColor:n.color,top:"0",left:"0"}),r.classList.add(n.class),r.classList.add("milkdown-drop-indicator"),t.dom.parentNode?.appendChild(r);const o=e.use(ng.key),i=e=>{!function(e,t,n){if(!t)return void Object.assign(e.style,{display:"none"});const{line:r}=t,{width:o}=n,{p1:{x:i,y:a},p2:{x:s,y:l}}=r;let c,d,u=a,h=i;a===l?(c=s-i,d=o,u-=o/2):(c=o,d=l-a,h-=o/2),u=Math.round(u),h=Math.round(h),Object.assign(e.style,{display:"block",width:`${c}px`,height:`${d}px`,transform:`translate(${h}px, ${u}px)`})}(r,e,n)};return o.on(i),{destroy:()=>{o.off(i),r.remove()}}}}));tg(ig,{displayName:"Prose<dropIndicatorDOM>"});var ag=s(e=>function(e){let t;return new c({key:new d("prosekit-drop-indicator"),view:n=>(t=function(e,t){let n,r,o,i,a=[];return(s,l)=>(o&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(o,s)||(o=s,i=((o,i)=>{if(!e.editable||e.isDestroyed)return;let s=(()=>{const t=e.dom.getBoundingClientRect(),o=e.state.doc;return a&&n&&r&&t.width===r.width&&t.height===r.height&&t.x===r.x&&t.y===r.y&&n.eq(o)||(r=t,n=o,a=function(e){let t=[[-1,e.state.doc]],n=[];for(;t.length>0;){const[r,o]=t.pop();if(r>=0){let t=e.nodeDOM(r);if(t&&$f(t)){let{top:e,bottom:i,left:a,right:s}=t.getBoundingClientRect();n.push([r,[a,e,s,e]],[r+o.nodeSize,[a,i,s,i]])}}if(o.isBlock&&!o.isTextblock){let e=r+1;for(let n of o.children)t.push([e,n]),e+=n.nodeSize}}return n}(e)),a})();s.sort((e,t)=>{const[n,r]=e,[i,a]=t;return Uf(o,r)-Uf(o,a)||n-i}),s=s.slice(0,8);const l=s.find(n=>!1!==t?.({view:e,pos:n[0],event:i}));return l&&function(e,t){const n=e.dragging;if(!n)return;const{move:r}=n;if(!r)return;const o=e.state.selection;if(!(o instanceof M))return;const{from:i,to:a}=o;return i<=t&&t<=a}(e,l[0])?void 0:l})(s,l)),i)}(n,e.onDrag),function(e,t,n){let r,o,i,a=e.dom,s=!1;const l=()=>{r&&clearTimeout(r),s=!1,r=setTimeout(()=>{s||n.onHide?.()},30)},c=r=>{s=!0;const{clientX:a,clientY:c}=r;if(o===a&&i===c)return;o=a,i=c;let d=t([a,c],r);if(d){const[t,[r,o,i,a]]=d,s={p1:{x:r,y:o},p2:{x:i,y:a}};n.onShow?.({view:e,pos:t,line:s})}else l()};return a.addEventListener("dragover",c),a.addEventListener("dragend",l),a.addEventListener("drop",l),a.addEventListener("dragleave",l),{destroy:()=>{a.removeEventListener("dragover",c),a.removeEventListener("dragend",l),a.removeEventListener("drop",l),a.removeEventListener("dragleave",l)}}}(n,t,e)),props:{handleDrop(e,n,r,o){if(!t)return!1;const i=t([n.clientX,n.clientY],n);if(!i)return!1;n.preventDefault();let a=i[0],s=e.state.tr;if(o){let{node:t}=e.dragging||{};t?t.replace(s):s.deleteSelection()}let l=s.mapping.map(a),c=0==r.openStart&&0==r.openEnd&&1==r.content.childCount,d=s.doc;if(c?s.replaceRangeWith(l,l,r.content.firstChild):s.replaceRange(l,l,r),s.doc.eq(d))return!0;let u=s.doc.resolve(l);if(c&&M.isSelectable(r.content.firstChild)&&u.nodeAfter&&u.nodeAfter.sameMarkup(r.content.firstChild))s.setSelection(new M(u));else{let t=s.mapping.map(a);s.mapping.maps[s.mapping.maps.length-1].forEach((e,n,r,o)=>t=o),s.setSelection(function(e,t,n){return e.someProp("createSelectionBetween",r=>r(e,t,n))||S.between(t,n,void 0)}(e,u,s.doc.resolve(t)))}return e.focus(),e.dispatch(s.setMeta("uiEvent","drop")),!0}}})}({onShow:t=>{e.set(ng.key,t)},onHide:()=>{e.set(ng.key,null)},onDrag:()=>!0}));tg(ag,{displayName:"Prose<dropIndicator>"});var sg=s(()=>new c({props:{decorations:eg,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&Gf.valid(n)?new Gf(n):null,handleClick:Jf,handleKeyDown:Kf,handleDOMEvents:{beforeinput:Qf}}}));tg(sg,{displayName:"Prose<gapCursor>"});var lg=[sg,rg,ng,ig,ag].flat(),cg=new d("prosemirror-virtual-cursor");function dg(e){const t=e.index(),n=e.parent.maybeChild(t);let r=e.textOffset?n:null;return!r&&t>0&&(r=e.parent.maybeChild(t-1)),[null==r?void 0:r.marks,null==n?void 0:n.marks]}function ug(e){return e&&"object"==typeof e&&"$cursor"in e}var hg=Object.defineProperty,pg=Object.getOwnPropertySymbols,mg=Object.prototype.hasOwnProperty,fg=Object.prototype.propertyIsEnumerable,gg=(e,t,n)=>t in e?hg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vg=(e,t)=>{for(var n in t||(t={}))mg.call(t,n)&&gg(e,n,t[n]);if(pg)for(var n of pg(t))fg.call(t,n)&&gg(e,n,t[n]);return e};function yg(e,t){return Object.assign(e,{meta:vg({package:"@milkdown/components"},t)}),e}const bg=a({imageIcon:"🌌",uploadButton:"Upload",confirmButton:"⏎",uploadPlaceholderText:"/Paste",onUpload:e=>Promise.resolve(URL.createObjectURL(e))},"inlineImageConfigCtx");function wg({icon:e,class:t,onClick:n}){return pd("span",{class:Ln("milkdown-icon",t),onPointerdown:n,innerHTML:e?Sn.sanitize(e.trim()):void 0})}yg(bg,{displayName:"Config<image-inline>",group:"ImageInline"}),wg.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const xg=eu("abcdefg",8),kg=ml({props:{src:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setLink:{type:Function,required:!0},imageIcon:{type:String,required:!1},uploadButton:{type:String,required:!1},confirmButton:{type:String,required:!1},uploadPlaceholderText:{type:String,required:!1},onUpload:{type:Function,required:!0},onImageLoadError:{type:Function,required:!1}},setup({readonly:e,src:t,setLink:n,onUpload:r,imageIcon:o,uploadButton:i,confirmButton:a,uploadPlaceholderText:s,className:l,onImageLoadError:c}){var d,u;const h=gs(!1),p=gs(),m=gs(null!=(d=t.value)?d:""),f=gs(xg()),g=gs(0!==(null==(u=t.value)?void 0:u.length)),v=e=>{const t=e.target.value;g.value=0!==t.length,m.value=t},y=e=>{var t,r;"Enter"===e.key&&n(null!=(r=null==(t=p.value)?void 0:t.value)?r:"")},b=e=>{var t;const o=null==(t=e.target.files)?void 0:t[0];o&&r(o).then(e=>{e&&(n(e),g.value=!0)}).catch(e=>{console.error("An error occurred while uploading image"),console.error(e)})};return()=>pd("div",{class:Ln("image-edit",l)},pd(wg,{icon:o,class:"image-icon"}),pd("div",{class:Ln("link-importer",h.value&&"focus")},pd("input",{ref:p,draggable:"true",onDragstart:e=>{e.preventDefault(),e.stopPropagation()},disabled:e.value,class:"link-input-area",value:m.value,onInput:v,onKeydown:y,onFocus:()=>h.value=!0,onBlur:()=>h.value=!1}),!g.value&&pd("div",{class:"placeholder"},pd("input",{disabled:e.value,class:"hidden",id:f.value,type:"file",accept:"image/*",onChange:b}),pd("label",{class:"uploader",for:f.value},pd(wg,{icon:i})),pd("span",{class:"text",onClick:()=>{var e;return null==(e=p.value)?void 0:e.focus()}},s))),m.value&&pd(Dc,null,pd("div",{class:"image-preview"},pd("img",{src:m.value,alt:"",onError:e=>Promise.resolve(null==c?void 0:c(e)).catch(()=>{})})),pd("div",{class:"confirm",onClick:()=>(()=>{var e,t;n(null!=(t=null==(e=p.value)?void 0:e.value)?t:"")})()},pd(wg,{icon:a}))))}}),Cg=ml({props:{src:{type:Object,required:!0},alt:{type:Object,required:!0},title:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup(e){const{src:t,alt:n,title:r}=e;return()=>{var o;return(null==(o=t.value)?void 0:o.length)?pd("img",{class:"image-inline",src:t.value,alt:n.value,title:r.value}):pd(kg,{src:e.src,selected:e.selected,readonly:e.readonly,setLink:t=>e.setAttr("src",t),imageIcon:e.config.imageIcon,uploadButton:e.config.uploadButton,confirmButton:e.config.confirmButton,uploadPlaceholderText:e.config.uploadPlaceholderText,onUpload:e.config.onUpload,className:"empty-image-inline"})}}}),_g=R(re.node,e=>(t,n,r)=>{const o=gs(t.attrs.src),i=gs(t.attrs.alt),a=gs(t.attrs.title),s=gs(!1),l=gs(!n.editable),c=e.get(bg.key),d=qd(Cg,{src:o,alt:i,title:a,selected:s,readonly:l,setAttr:(e,t)=>{if(!n.editable)return;const o=r();null!=o&&n.dispatch(n.state.tr.setNodeAttribute(o,e,"src"===e?Sn.sanitize(t):t))},config:c}),u=document.createElement("span");u.className="milkdown-image-inline";const h=al(()=>{s.value?u.classList.add("selected"):u.classList.remove("selected")}),p=c.proxyDomURL,m=e=>{if(p){const t=p(e.attrs.src);"string"==typeof t?o.value=t:t.then(e=>{o.value=e}).catch(console.error)}else o.value=e.attrs.src;i.value=e.attrs.alt,a.value=e.attrs.title};return m(t),d.mount(u),{dom:u,update:e=>e.type===t.type&&(m(e),!0),stopEvent:e=>e.target instanceof HTMLInputElement,selectNode:()=>{s.value=!0},deselectNode:()=>{s.value=!1},destroy:()=>{h(),d.unmount(),u.remove()}}});yg(_g,{displayName:"NodeView<image-inline>",group:"ImageInline"});const Sg=[bg,_g];class Ag extends Error{constructor(e,t){var n,r,o="KaTeX parse error: "+e,i=t&&t.loc;if(i&&i.start<=i.end){var a=i.lexer.input;n=i.start,r=i.end,n===a.length?o+=" at end of input: ":o+=" at position "+(n+1)+": ";var s=a.slice(n,r).replace(/[^]/g,"$&̲");o+=(n>15?"…"+a.slice(n-15,n):a.slice(0,n))+s+(r+15<a.length?a.slice(r,r+15)+"…":a.slice(r))}super(o),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,Ag.prototype),this.position=n,null!=n&&null!=r&&(this.length=r-n),this.rawMessage=e}}var Mg=/([A-Z])/g,Tg=e=>e.replace(Mg,"-$1").toLowerCase(),Eg={"&":"&",">":">","<":"<",'"':""","'":"'"},Lg=/[&><"']/g,Og=e=>String(e).replace(Lg,e=>Eg[e]),Ig=e=>"ordgroup"===e.type||"color"===e.type?1===e.body.length?Ig(e.body[0]):e:"font"===e.type?Ig(e.body):e,Rg=new Set(["mathord","textord","atom"]),Pg=e=>Rg.has(Ig(e).type),Bg={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function zg(e,t,n,r){var o=n[t];e[t]=void 0!==o?r.processor?r.processor(o):o:function(e){return void 0!==e.default?e.default:function(e){if("string"!=typeof e)return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}(Array.isArray(e.type)?e.type[0]:e.type)}(r)}class Dg{constructor(e){for(var t of(void 0===e&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},Object.keys(Bg))){var n=Bg[t];n&&zg(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if("function"==typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new Ag("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===r?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var r=this.strict;if("function"==typeof r)try{r=r(e,t,n)}catch(o){r="error"}return!(!r||"ignore"===r||!0!==r&&"error"!==r&&("warn"===r?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]"),1)))}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var t=(e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"})(e.url);if(null==t)return!1;e.protocol=t}var n="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(n)}}class Ng{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Hg[qg[this.id]]}sub(){return Hg[jg[this.id]]}fracNum(){return Hg[Vg[this.id]]}fracDen(){return Hg[Fg[this.id]]}cramp(){return Hg[$g[this.id]]}text(){return Hg[Wg[this.id]]}isTight(){return this.size>=2}}var Hg=[new Ng(0,0,!1),new Ng(1,0,!0),new Ng(2,1,!1),new Ng(3,1,!0),new Ng(4,2,!1),new Ng(5,2,!0),new Ng(6,3,!1),new Ng(7,3,!0)],qg=[4,5,4,5,6,7,6,7],jg=[5,5,5,5,7,7,7,7],Vg=[2,3,4,5,6,7,6,7],Fg=[3,3,5,5,7,7,7,7],$g=[1,1,3,3,5,5,7,7],Wg=[0,1,2,3,2,3,2,3],Ug={DISPLAY:Hg[0],TEXT:Hg[2],SCRIPT:Hg[4],SCRIPTSCRIPT:Hg[6]},Gg=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}],Zg=[];function Xg(e){for(var t=0;t<Zg.length;t+=2)if(e>=Zg[t]&&e<=Zg[t+1])return!0;return!1}Gg.forEach(e=>e.blocks.forEach(e=>Zg.push(...e)));var Kg=e=>e+" "+e,Yg=80,Jg={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:Kg("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Kg("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Kg("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Kg("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:Kg("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:Kg("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Kg("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Kg("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class Qg{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(function(e){return"toText"in e}(e))return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var ev={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},tv={ex:!0,em:!0,mu:!0},nv=function(e){return"string"!=typeof e&&(e=e.unit),e in ev||e in tv||"ex"===e},rv=function(e,t){var n;if(e.unit in ev)n=ev[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{var r;if(r=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=r.fontMetrics().xHeight;else{if("em"!==e.unit)throw new Ag("Invalid unit: '"+e.unit+"'");n=r.fontMetrics().quad}r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},ov=function(e){return+e.toFixed(4)+"em"},iv=function(e){return e.filter(e=>e).join(" ")},av=function(e){var t="";for(var n of Object.keys(e)){var r=e[n];void 0!==r&&(t+=Tg(n)+":"+r+";")}return t},sv=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var r=t.getColor();r&&(this.style.color=r)}},lv=function(e){var t=document.createElement(e);for(var n of(t.className=iv(this.classes),Object.assign(t.style,this.style),Object.keys(this.attributes)))t.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},cv=/[\s"'>/=\x00-\x1f]/,dv=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+Og(iv(this.classes))+'"');var n=av(this.style);for(var r of(n&&(t+=' style="'+Og(n)+'"'),Object.keys(this.attributes))){if(cv.test(r))throw new Ag("Invalid attribute name '"+r+"'");t+=" "+r+'="'+Og(this.attributes[r])+'"'}t+=">";for(var o=0;o<this.children.length;o++)t+=this.children[o].toMarkup();return t+"</"+e+">"};class uv{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,sv.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return lv.call(this,"span")}toMarkup(){return dv.call(this,"span")}}class hv{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,sv.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return lv.call(this,"a")}toMarkup(){return dv.call(this,"a")}}class pv{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e='<img src="'+Og(this.src)+'" alt="'+Og(this.alt)+'"',t=av(this.style);return t&&(e+=' style="'+Og(t)+'"'),e+"'/>"}}var mv={"î":"ı̂","ï":"ı̈","í":"ı́","ì":"ı̀"};class fv{constructor(e,t,n,r,o,i,a,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=o||0,this.width=i||0,this.classes=a||[],this.style=s||{},this.maxFontSize=0;var l=function(e){for(var t=0;t<Gg.length;t++)for(var n=Gg[t],r=0;r<n.blocks.length;r++){var o=n.blocks[r];if(e>=o[0]&&e<=o[1])return n.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=mv[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&((t=document.createElement("span")).style.marginRight=ov(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=iv(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=Og(iv(this.classes)),t+='"');var n="";this.italic>0&&(n+="margin-right:"+ov(this.italic)+";"),(n+=av(this.style))&&(e=!0,t+=' style="'+Og(n)+'"');var r=Og(this.text);return e?(t+=">",t+=r,t+="</span>"):r}}class gv{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t of Object.keys(this.attributes))e+=" "+t+'="'+Og(this.attributes[t])+'"';e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+"</svg>"}}class vv{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",Jg[this.pathName]),e}toMarkup(){return this.alternate?'<path d="'+Og(this.alternate)+'"/>':'<path d="'+Og(Jg[this.pathName])+'"/>'}}class yv{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t of Object.keys(this.attributes))e+=" "+t+'="'+Og(this.attributes[t])+'"';return e+"/>"}}var bv={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},wv={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},xv={"Å":"A","Ð":"D","Þ":"o","å":"a","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R","а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function kv(e,t,n){if(!bv[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),o=bv[t][r];if(!o&&e[0]in xv&&(r=xv[e[0]].charCodeAt(0),o=bv[t][r]),o||"text"!==n||Xg(r)&&(o=bv[t][77]),o)return{depth:o[0],height:o[1],italic:o[2],skew:o[3],width:o[4]}}var Cv={},_v={math:{},text:{}};function Sv(e,t,n,r,o,i){_v[e][o]={font:t,group:n,replace:r},i&&r&&(_v[e][r]=_v[e][o])}var Av="math",Mv="text",Tv="main",Ev="ams",Lv="accent-token",Ov="bin",Iv="close",Rv="inner",Pv="mathord",Bv="op-token",zv="open",Dv="punct",Nv="rel",Hv="spacing",qv="textord";Sv(Av,Tv,Nv,"≡","\\equiv",!0),Sv(Av,Tv,Nv,"≺","\\prec",!0),Sv(Av,Tv,Nv,"≻","\\succ",!0),Sv(Av,Tv,Nv,"∼","\\sim",!0),Sv(Av,Tv,Nv,"⊥","\\perp"),Sv(Av,Tv,Nv,"⪯","\\preceq",!0),Sv(Av,Tv,Nv,"⪰","\\succeq",!0),Sv(Av,Tv,Nv,"≃","\\simeq",!0),Sv(Av,Tv,Nv,"∣","\\mid",!0),Sv(Av,Tv,Nv,"≪","\\ll",!0),Sv(Av,Tv,Nv,"≫","\\gg",!0),Sv(Av,Tv,Nv,"≍","\\asymp",!0),Sv(Av,Tv,Nv,"∥","\\parallel"),Sv(Av,Tv,Nv,"⋈","\\bowtie",!0),Sv(Av,Tv,Nv,"⌣","\\smile",!0),Sv(Av,Tv,Nv,"⊑","\\sqsubseteq",!0),Sv(Av,Tv,Nv,"⊒","\\sqsupseteq",!0),Sv(Av,Tv,Nv,"≐","\\doteq",!0),Sv(Av,Tv,Nv,"⌢","\\frown",!0),Sv(Av,Tv,Nv,"∋","\\ni",!0),Sv(Av,Tv,Nv,"∝","\\propto",!0),Sv(Av,Tv,Nv,"⊢","\\vdash",!0),Sv(Av,Tv,Nv,"⊣","\\dashv",!0),Sv(Av,Tv,Nv,"∋","\\owns"),Sv(Av,Tv,Dv,".","\\ldotp"),Sv(Av,Tv,Dv,"⋅","\\cdotp"),Sv(Av,Tv,Dv,"⋅","·"),Sv(Mv,Tv,qv,"⋅","·"),Sv(Av,Tv,qv,"#","\\#"),Sv(Mv,Tv,qv,"#","\\#"),Sv(Av,Tv,qv,"&","\\&"),Sv(Mv,Tv,qv,"&","\\&"),Sv(Av,Tv,qv,"ℵ","\\aleph",!0),Sv(Av,Tv,qv,"∀","\\forall",!0),Sv(Av,Tv,qv,"ℏ","\\hbar",!0),Sv(Av,Tv,qv,"∃","\\exists",!0),Sv(Av,Tv,qv,"∇","\\nabla",!0),Sv(Av,Tv,qv,"♭","\\flat",!0),Sv(Av,Tv,qv,"ℓ","\\ell",!0),Sv(Av,Tv,qv,"♮","\\natural",!0),Sv(Av,Tv,qv,"♣","\\clubsuit",!0),Sv(Av,Tv,qv,"℘","\\wp",!0),Sv(Av,Tv,qv,"♯","\\sharp",!0),Sv(Av,Tv,qv,"♢","\\diamondsuit",!0),Sv(Av,Tv,qv,"ℜ","\\Re",!0),Sv(Av,Tv,qv,"♡","\\heartsuit",!0),Sv(Av,Tv,qv,"ℑ","\\Im",!0),Sv(Av,Tv,qv,"♠","\\spadesuit",!0),Sv(Av,Tv,qv,"§","\\S",!0),Sv(Mv,Tv,qv,"§","\\S"),Sv(Av,Tv,qv,"¶","\\P",!0),Sv(Mv,Tv,qv,"¶","\\P"),Sv(Av,Tv,qv,"†","\\dag"),Sv(Mv,Tv,qv,"†","\\dag"),Sv(Mv,Tv,qv,"†","\\textdagger"),Sv(Av,Tv,qv,"‡","\\ddag"),Sv(Mv,Tv,qv,"‡","\\ddag"),Sv(Mv,Tv,qv,"‡","\\textdaggerdbl"),Sv(Av,Tv,Iv,"⎱","\\rmoustache",!0),Sv(Av,Tv,zv,"⎰","\\lmoustache",!0),Sv(Av,Tv,Iv,"⟯","\\rgroup",!0),Sv(Av,Tv,zv,"⟮","\\lgroup",!0),Sv(Av,Tv,Ov,"∓","\\mp",!0),Sv(Av,Tv,Ov,"⊖","\\ominus",!0),Sv(Av,Tv,Ov,"⊎","\\uplus",!0),Sv(Av,Tv,Ov,"⊓","\\sqcap",!0),Sv(Av,Tv,Ov,"∗","\\ast"),Sv(Av,Tv,Ov,"⊔","\\sqcup",!0),Sv(Av,Tv,Ov,"◯","\\bigcirc",!0),Sv(Av,Tv,Ov,"∙","\\bullet",!0),Sv(Av,Tv,Ov,"‡","\\ddagger"),Sv(Av,Tv,Ov,"≀","\\wr",!0),Sv(Av,Tv,Ov,"⨿","\\amalg"),Sv(Av,Tv,Ov,"&","\\And"),Sv(Av,Tv,Nv,"⟵","\\longleftarrow",!0),Sv(Av,Tv,Nv,"⇐","\\Leftarrow",!0),Sv(Av,Tv,Nv,"⟸","\\Longleftarrow",!0),Sv(Av,Tv,Nv,"⟶","\\longrightarrow",!0),Sv(Av,Tv,Nv,"⇒","\\Rightarrow",!0),Sv(Av,Tv,Nv,"⟹","\\Longrightarrow",!0),Sv(Av,Tv,Nv,"↔","\\leftrightarrow",!0),Sv(Av,Tv,Nv,"⟷","\\longleftrightarrow",!0),Sv(Av,Tv,Nv,"⇔","\\Leftrightarrow",!0),Sv(Av,Tv,Nv,"⟺","\\Longleftrightarrow",!0),Sv(Av,Tv,Nv,"↦","\\mapsto",!0),Sv(Av,Tv,Nv,"⟼","\\longmapsto",!0),Sv(Av,Tv,Nv,"↗","\\nearrow",!0),Sv(Av,Tv,Nv,"↩","\\hookleftarrow",!0),Sv(Av,Tv,Nv,"↪","\\hookrightarrow",!0),Sv(Av,Tv,Nv,"↘","\\searrow",!0),Sv(Av,Tv,Nv,"↼","\\leftharpoonup",!0),Sv(Av,Tv,Nv,"⇀","\\rightharpoonup",!0),Sv(Av,Tv,Nv,"↙","\\swarrow",!0),Sv(Av,Tv,Nv,"↽","\\leftharpoondown",!0),Sv(Av,Tv,Nv,"⇁","\\rightharpoondown",!0),Sv(Av,Tv,Nv,"↖","\\nwarrow",!0),Sv(Av,Tv,Nv,"⇌","\\rightleftharpoons",!0),Sv(Av,Ev,Nv,"≮","\\nless",!0),Sv(Av,Ev,Nv,"","\\@nleqslant"),Sv(Av,Ev,Nv,"","\\@nleqq"),Sv(Av,Ev,Nv,"⪇","\\lneq",!0),Sv(Av,Ev,Nv,"≨","\\lneqq",!0),Sv(Av,Ev,Nv,"","\\@lvertneqq"),Sv(Av,Ev,Nv,"⋦","\\lnsim",!0),Sv(Av,Ev,Nv,"⪉","\\lnapprox",!0),Sv(Av,Ev,Nv,"⊀","\\nprec",!0),Sv(Av,Ev,Nv,"⋠","\\npreceq",!0),Sv(Av,Ev,Nv,"⋨","\\precnsim",!0),Sv(Av,Ev,Nv,"⪹","\\precnapprox",!0),Sv(Av,Ev,Nv,"≁","\\nsim",!0),Sv(Av,Ev,Nv,"","\\@nshortmid"),Sv(Av,Ev,Nv,"∤","\\nmid",!0),Sv(Av,Ev,Nv,"⊬","\\nvdash",!0),Sv(Av,Ev,Nv,"⊭","\\nvDash",!0),Sv(Av,Ev,Nv,"⋪","\\ntriangleleft"),Sv(Av,Ev,Nv,"⋬","\\ntrianglelefteq",!0),Sv(Av,Ev,Nv,"⊊","\\subsetneq",!0),Sv(Av,Ev,Nv,"","\\@varsubsetneq"),Sv(Av,Ev,Nv,"⫋","\\subsetneqq",!0),Sv(Av,Ev,Nv,"","\\@varsubsetneqq"),Sv(Av,Ev,Nv,"≯","\\ngtr",!0),Sv(Av,Ev,Nv,"","\\@ngeqslant"),Sv(Av,Ev,Nv,"","\\@ngeqq"),Sv(Av,Ev,Nv,"⪈","\\gneq",!0),Sv(Av,Ev,Nv,"≩","\\gneqq",!0),Sv(Av,Ev,Nv,"","\\@gvertneqq"),Sv(Av,Ev,Nv,"⋧","\\gnsim",!0),Sv(Av,Ev,Nv,"⪊","\\gnapprox",!0),Sv(Av,Ev,Nv,"⊁","\\nsucc",!0),Sv(Av,Ev,Nv,"⋡","\\nsucceq",!0),Sv(Av,Ev,Nv,"⋩","\\succnsim",!0),Sv(Av,Ev,Nv,"⪺","\\succnapprox",!0),Sv(Av,Ev,Nv,"≆","\\ncong",!0),Sv(Av,Ev,Nv,"","\\@nshortparallel"),Sv(Av,Ev,Nv,"∦","\\nparallel",!0),Sv(Av,Ev,Nv,"⊯","\\nVDash",!0),Sv(Av,Ev,Nv,"⋫","\\ntriangleright"),Sv(Av,Ev,Nv,"⋭","\\ntrianglerighteq",!0),Sv(Av,Ev,Nv,"","\\@nsupseteqq"),Sv(Av,Ev,Nv,"⊋","\\supsetneq",!0),Sv(Av,Ev,Nv,"","\\@varsupsetneq"),Sv(Av,Ev,Nv,"⫌","\\supsetneqq",!0),Sv(Av,Ev,Nv,"","\\@varsupsetneqq"),Sv(Av,Ev,Nv,"⊮","\\nVdash",!0),Sv(Av,Ev,Nv,"⪵","\\precneqq",!0),Sv(Av,Ev,Nv,"⪶","\\succneqq",!0),Sv(Av,Ev,Nv,"","\\@nsubseteqq"),Sv(Av,Ev,Ov,"⊴","\\unlhd"),Sv(Av,Ev,Ov,"⊵","\\unrhd"),Sv(Av,Ev,Nv,"↚","\\nleftarrow",!0),Sv(Av,Ev,Nv,"↛","\\nrightarrow",!0),Sv(Av,Ev,Nv,"⇍","\\nLeftarrow",!0),Sv(Av,Ev,Nv,"⇏","\\nRightarrow",!0),Sv(Av,Ev,Nv,"↮","\\nleftrightarrow",!0),Sv(Av,Ev,Nv,"⇎","\\nLeftrightarrow",!0),Sv(Av,Ev,Nv,"△","\\vartriangle"),Sv(Av,Ev,qv,"ℏ","\\hslash"),Sv(Av,Ev,qv,"▽","\\triangledown"),Sv(Av,Ev,qv,"◊","\\lozenge"),Sv(Av,Ev,qv,"Ⓢ","\\circledS"),Sv(Av,Ev,qv,"®","\\circledR"),Sv(Mv,Ev,qv,"®","\\circledR"),Sv(Av,Ev,qv,"∡","\\measuredangle",!0),Sv(Av,Ev,qv,"∄","\\nexists"),Sv(Av,Ev,qv,"℧","\\mho"),Sv(Av,Ev,qv,"Ⅎ","\\Finv",!0),Sv(Av,Ev,qv,"⅁","\\Game",!0),Sv(Av,Ev,qv,"‵","\\backprime"),Sv(Av,Ev,qv,"▲","\\blacktriangle"),Sv(Av,Ev,qv,"▼","\\blacktriangledown"),Sv(Av,Ev,qv,"■","\\blacksquare"),Sv(Av,Ev,qv,"⧫","\\blacklozenge"),Sv(Av,Ev,qv,"★","\\bigstar"),Sv(Av,Ev,qv,"∢","\\sphericalangle",!0),Sv(Av,Ev,qv,"∁","\\complement",!0),Sv(Av,Ev,qv,"ð","\\eth",!0),Sv(Mv,Tv,qv,"ð","ð"),Sv(Av,Ev,qv,"╱","\\diagup"),Sv(Av,Ev,qv,"╲","\\diagdown"),Sv(Av,Ev,qv,"□","\\square"),Sv(Av,Ev,qv,"□","\\Box"),Sv(Av,Ev,qv,"◊","\\Diamond"),Sv(Av,Ev,qv,"¥","\\yen",!0),Sv(Mv,Ev,qv,"¥","\\yen",!0),Sv(Av,Ev,qv,"✓","\\checkmark",!0),Sv(Mv,Ev,qv,"✓","\\checkmark"),Sv(Av,Ev,qv,"ℶ","\\beth",!0),Sv(Av,Ev,qv,"ℸ","\\daleth",!0),Sv(Av,Ev,qv,"ℷ","\\gimel",!0),Sv(Av,Ev,qv,"ϝ","\\digamma",!0),Sv(Av,Ev,qv,"ϰ","\\varkappa"),Sv(Av,Ev,zv,"┌","\\@ulcorner",!0),Sv(Av,Ev,Iv,"┐","\\@urcorner",!0),Sv(Av,Ev,zv,"└","\\@llcorner",!0),Sv(Av,Ev,Iv,"┘","\\@lrcorner",!0),Sv(Av,Ev,Nv,"≦","\\leqq",!0),Sv(Av,Ev,Nv,"⩽","\\leqslant",!0),Sv(Av,Ev,Nv,"⪕","\\eqslantless",!0),Sv(Av,Ev,Nv,"≲","\\lesssim",!0),Sv(Av,Ev,Nv,"⪅","\\lessapprox",!0),Sv(Av,Ev,Nv,"≊","\\approxeq",!0),Sv(Av,Ev,Ov,"⋖","\\lessdot"),Sv(Av,Ev,Nv,"⋘","\\lll",!0),Sv(Av,Ev,Nv,"≶","\\lessgtr",!0),Sv(Av,Ev,Nv,"⋚","\\lesseqgtr",!0),Sv(Av,Ev,Nv,"⪋","\\lesseqqgtr",!0),Sv(Av,Ev,Nv,"≑","\\doteqdot"),Sv(Av,Ev,Nv,"≓","\\risingdotseq",!0),Sv(Av,Ev,Nv,"≒","\\fallingdotseq",!0),Sv(Av,Ev,Nv,"∽","\\backsim",!0),Sv(Av,Ev,Nv,"⋍","\\backsimeq",!0),Sv(Av,Ev,Nv,"⫅","\\subseteqq",!0),Sv(Av,Ev,Nv,"⋐","\\Subset",!0),Sv(Av,Ev,Nv,"⊏","\\sqsubset",!0),Sv(Av,Ev,Nv,"≼","\\preccurlyeq",!0),Sv(Av,Ev,Nv,"⋞","\\curlyeqprec",!0),Sv(Av,Ev,Nv,"≾","\\precsim",!0),Sv(Av,Ev,Nv,"⪷","\\precapprox",!0),Sv(Av,Ev,Nv,"⊲","\\vartriangleleft"),Sv(Av,Ev,Nv,"⊴","\\trianglelefteq"),Sv(Av,Ev,Nv,"⊨","\\vDash",!0),Sv(Av,Ev,Nv,"⊪","\\Vvdash",!0),Sv(Av,Ev,Nv,"⌣","\\smallsmile"),Sv(Av,Ev,Nv,"⌢","\\smallfrown"),Sv(Av,Ev,Nv,"≏","\\bumpeq",!0),Sv(Av,Ev,Nv,"≎","\\Bumpeq",!0),Sv(Av,Ev,Nv,"≧","\\geqq",!0),Sv(Av,Ev,Nv,"⩾","\\geqslant",!0),Sv(Av,Ev,Nv,"⪖","\\eqslantgtr",!0),Sv(Av,Ev,Nv,"≳","\\gtrsim",!0),Sv(Av,Ev,Nv,"⪆","\\gtrapprox",!0),Sv(Av,Ev,Ov,"⋗","\\gtrdot"),Sv(Av,Ev,Nv,"⋙","\\ggg",!0),Sv(Av,Ev,Nv,"≷","\\gtrless",!0),Sv(Av,Ev,Nv,"⋛","\\gtreqless",!0),Sv(Av,Ev,Nv,"⪌","\\gtreqqless",!0),Sv(Av,Ev,Nv,"≖","\\eqcirc",!0),Sv(Av,Ev,Nv,"≗","\\circeq",!0),Sv(Av,Ev,Nv,"≜","\\triangleq",!0),Sv(Av,Ev,Nv,"∼","\\thicksim"),Sv(Av,Ev,Nv,"≈","\\thickapprox"),Sv(Av,Ev,Nv,"⫆","\\supseteqq",!0),Sv(Av,Ev,Nv,"⋑","\\Supset",!0),Sv(Av,Ev,Nv,"⊐","\\sqsupset",!0),Sv(Av,Ev,Nv,"≽","\\succcurlyeq",!0),Sv(Av,Ev,Nv,"⋟","\\curlyeqsucc",!0),Sv(Av,Ev,Nv,"≿","\\succsim",!0),Sv(Av,Ev,Nv,"⪸","\\succapprox",!0),Sv(Av,Ev,Nv,"⊳","\\vartriangleright"),Sv(Av,Ev,Nv,"⊵","\\trianglerighteq"),Sv(Av,Ev,Nv,"⊩","\\Vdash",!0),Sv(Av,Ev,Nv,"∣","\\shortmid"),Sv(Av,Ev,Nv,"∥","\\shortparallel"),Sv(Av,Ev,Nv,"≬","\\between",!0),Sv(Av,Ev,Nv,"⋔","\\pitchfork",!0),Sv(Av,Ev,Nv,"∝","\\varpropto"),Sv(Av,Ev,Nv,"◀","\\blacktriangleleft"),Sv(Av,Ev,Nv,"∴","\\therefore",!0),Sv(Av,Ev,Nv,"∍","\\backepsilon"),Sv(Av,Ev,Nv,"▶","\\blacktriangleright"),Sv(Av,Ev,Nv,"∵","\\because",!0),Sv(Av,Ev,Nv,"⋘","\\llless"),Sv(Av,Ev,Nv,"⋙","\\gggtr"),Sv(Av,Ev,Ov,"⊲","\\lhd"),Sv(Av,Ev,Ov,"⊳","\\rhd"),Sv(Av,Ev,Nv,"≂","\\eqsim",!0),Sv(Av,Tv,Nv,"⋈","\\Join"),Sv(Av,Ev,Nv,"≑","\\Doteq",!0),Sv(Av,Ev,Ov,"∔","\\dotplus",!0),Sv(Av,Ev,Ov,"∖","\\smallsetminus"),Sv(Av,Ev,Ov,"⋒","\\Cap",!0),Sv(Av,Ev,Ov,"⋓","\\Cup",!0),Sv(Av,Ev,Ov,"⩞","\\doublebarwedge",!0),Sv(Av,Ev,Ov,"⊟","\\boxminus",!0),Sv(Av,Ev,Ov,"⊞","\\boxplus",!0),Sv(Av,Ev,Ov,"⋇","\\divideontimes",!0),Sv(Av,Ev,Ov,"⋉","\\ltimes",!0),Sv(Av,Ev,Ov,"⋊","\\rtimes",!0),Sv(Av,Ev,Ov,"⋋","\\leftthreetimes",!0),Sv(Av,Ev,Ov,"⋌","\\rightthreetimes",!0),Sv(Av,Ev,Ov,"⋏","\\curlywedge",!0),Sv(Av,Ev,Ov,"⋎","\\curlyvee",!0),Sv(Av,Ev,Ov,"⊝","\\circleddash",!0),Sv(Av,Ev,Ov,"⊛","\\circledast",!0),Sv(Av,Ev,Ov,"⋅","\\centerdot"),Sv(Av,Ev,Ov,"⊺","\\intercal",!0),Sv(Av,Ev,Ov,"⋒","\\doublecap"),Sv(Av,Ev,Ov,"⋓","\\doublecup"),Sv(Av,Ev,Ov,"⊠","\\boxtimes",!0),Sv(Av,Ev,Nv,"⇢","\\dashrightarrow",!0),Sv(Av,Ev,Nv,"⇠","\\dashleftarrow",!0),Sv(Av,Ev,Nv,"⇇","\\leftleftarrows",!0),Sv(Av,Ev,Nv,"⇆","\\leftrightarrows",!0),Sv(Av,Ev,Nv,"⇚","\\Lleftarrow",!0),Sv(Av,Ev,Nv,"↞","\\twoheadleftarrow",!0),Sv(Av,Ev,Nv,"↢","\\leftarrowtail",!0),Sv(Av,Ev,Nv,"↫","\\looparrowleft",!0),Sv(Av,Ev,Nv,"⇋","\\leftrightharpoons",!0),Sv(Av,Ev,Nv,"↶","\\curvearrowleft",!0),Sv(Av,Ev,Nv,"↺","\\circlearrowleft",!0),Sv(Av,Ev,Nv,"↰","\\Lsh",!0),Sv(Av,Ev,Nv,"⇈","\\upuparrows",!0),Sv(Av,Ev,Nv,"↿","\\upharpoonleft",!0),Sv(Av,Ev,Nv,"⇃","\\downharpoonleft",!0),Sv(Av,Tv,Nv,"⊶","\\origof",!0),Sv(Av,Tv,Nv,"⊷","\\imageof",!0),Sv(Av,Ev,Nv,"⊸","\\multimap",!0),Sv(Av,Ev,Nv,"↭","\\leftrightsquigarrow",!0),Sv(Av,Ev,Nv,"⇉","\\rightrightarrows",!0),Sv(Av,Ev,Nv,"⇄","\\rightleftarrows",!0),Sv(Av,Ev,Nv,"↠","\\twoheadrightarrow",!0),Sv(Av,Ev,Nv,"↣","\\rightarrowtail",!0),Sv(Av,Ev,Nv,"↬","\\looparrowright",!0),Sv(Av,Ev,Nv,"↷","\\curvearrowright",!0),Sv(Av,Ev,Nv,"↻","\\circlearrowright",!0),Sv(Av,Ev,Nv,"↱","\\Rsh",!0),Sv(Av,Ev,Nv,"⇊","\\downdownarrows",!0),Sv(Av,Ev,Nv,"↾","\\upharpoonright",!0),Sv(Av,Ev,Nv,"⇂","\\downharpoonright",!0),Sv(Av,Ev,Nv,"⇝","\\rightsquigarrow",!0),Sv(Av,Ev,Nv,"⇝","\\leadsto"),Sv(Av,Ev,Nv,"⇛","\\Rrightarrow",!0),Sv(Av,Ev,Nv,"↾","\\restriction"),Sv(Av,Tv,qv,"‘","`"),Sv(Av,Tv,qv,"$","\\$"),Sv(Mv,Tv,qv,"$","\\$"),Sv(Mv,Tv,qv,"$","\\textdollar"),Sv(Av,Tv,qv,"%","\\%"),Sv(Mv,Tv,qv,"%","\\%"),Sv(Av,Tv,qv,"_","\\_"),Sv(Mv,Tv,qv,"_","\\_"),Sv(Mv,Tv,qv,"_","\\textunderscore"),Sv(Av,Tv,qv,"∠","\\angle",!0),Sv(Av,Tv,qv,"∞","\\infty",!0),Sv(Av,Tv,qv,"′","\\prime"),Sv(Av,Tv,qv,"△","\\triangle"),Sv(Av,Tv,qv,"Γ","\\Gamma",!0),Sv(Av,Tv,qv,"Δ","\\Delta",!0),Sv(Av,Tv,qv,"Θ","\\Theta",!0),Sv(Av,Tv,qv,"Λ","\\Lambda",!0),Sv(Av,Tv,qv,"Ξ","\\Xi",!0),Sv(Av,Tv,qv,"Π","\\Pi",!0),Sv(Av,Tv,qv,"Σ","\\Sigma",!0),Sv(Av,Tv,qv,"Υ","\\Upsilon",!0),Sv(Av,Tv,qv,"Φ","\\Phi",!0),Sv(Av,Tv,qv,"Ψ","\\Psi",!0),Sv(Av,Tv,qv,"Ω","\\Omega",!0),Sv(Av,Tv,qv,"A","Α"),Sv(Av,Tv,qv,"B","Β"),Sv(Av,Tv,qv,"E","Ε"),Sv(Av,Tv,qv,"Z","Ζ"),Sv(Av,Tv,qv,"H","Η"),Sv(Av,Tv,qv,"I","Ι"),Sv(Av,Tv,qv,"K","Κ"),Sv(Av,Tv,qv,"M","Μ"),Sv(Av,Tv,qv,"N","Ν"),Sv(Av,Tv,qv,"O","Ο"),Sv(Av,Tv,qv,"P","Ρ"),Sv(Av,Tv,qv,"T","Τ"),Sv(Av,Tv,qv,"X","Χ"),Sv(Av,Tv,qv,"¬","\\neg",!0),Sv(Av,Tv,qv,"¬","\\lnot"),Sv(Av,Tv,qv,"⊤","\\top"),Sv(Av,Tv,qv,"⊥","\\bot"),Sv(Av,Tv,qv,"∅","\\emptyset"),Sv(Av,Ev,qv,"∅","\\varnothing"),Sv(Av,Tv,Pv,"α","\\alpha",!0),Sv(Av,Tv,Pv,"β","\\beta",!0),Sv(Av,Tv,Pv,"γ","\\gamma",!0),Sv(Av,Tv,Pv,"δ","\\delta",!0),Sv(Av,Tv,Pv,"ϵ","\\epsilon",!0),Sv(Av,Tv,Pv,"ζ","\\zeta",!0),Sv(Av,Tv,Pv,"η","\\eta",!0),Sv(Av,Tv,Pv,"θ","\\theta",!0),Sv(Av,Tv,Pv,"ι","\\iota",!0),Sv(Av,Tv,Pv,"κ","\\kappa",!0),Sv(Av,Tv,Pv,"λ","\\lambda",!0),Sv(Av,Tv,Pv,"μ","\\mu",!0),Sv(Av,Tv,Pv,"ν","\\nu",!0),Sv(Av,Tv,Pv,"ξ","\\xi",!0),Sv(Av,Tv,Pv,"ο","\\omicron",!0),Sv(Av,Tv,Pv,"π","\\pi",!0),Sv(Av,Tv,Pv,"ρ","\\rho",!0),Sv(Av,Tv,Pv,"σ","\\sigma",!0),Sv(Av,Tv,Pv,"τ","\\tau",!0),Sv(Av,Tv,Pv,"υ","\\upsilon",!0),Sv(Av,Tv,Pv,"ϕ","\\phi",!0),Sv(Av,Tv,Pv,"χ","\\chi",!0),Sv(Av,Tv,Pv,"ψ","\\psi",!0),Sv(Av,Tv,Pv,"ω","\\omega",!0),Sv(Av,Tv,Pv,"ε","\\varepsilon",!0),Sv(Av,Tv,Pv,"ϑ","\\vartheta",!0),Sv(Av,Tv,Pv,"ϖ","\\varpi",!0),Sv(Av,Tv,Pv,"ϱ","\\varrho",!0),Sv(Av,Tv,Pv,"ς","\\varsigma",!0),Sv(Av,Tv,Pv,"φ","\\varphi",!0),Sv(Av,Tv,Ov,"∗","*",!0),Sv(Av,Tv,Ov,"+","+"),Sv(Av,Tv,Ov,"−","-",!0),Sv(Av,Tv,Ov,"⋅","\\cdot",!0),Sv(Av,Tv,Ov,"∘","\\circ",!0),Sv(Av,Tv,Ov,"÷","\\div",!0),Sv(Av,Tv,Ov,"±","\\pm",!0),Sv(Av,Tv,Ov,"×","\\times",!0),Sv(Av,Tv,Ov,"∩","\\cap",!0),Sv(Av,Tv,Ov,"∪","\\cup",!0),Sv(Av,Tv,Ov,"∖","\\setminus",!0),Sv(Av,Tv,Ov,"∧","\\land"),Sv(Av,Tv,Ov,"∨","\\lor"),Sv(Av,Tv,Ov,"∧","\\wedge",!0),Sv(Av,Tv,Ov,"∨","\\vee",!0),Sv(Av,Tv,qv,"√","\\surd"),Sv(Av,Tv,zv,"⟨","\\langle",!0),Sv(Av,Tv,zv,"∣","\\lvert"),Sv(Av,Tv,zv,"∥","\\lVert"),Sv(Av,Tv,Iv,"?","?"),Sv(Av,Tv,Iv,"!","!"),Sv(Av,Tv,Iv,"⟩","\\rangle",!0),Sv(Av,Tv,Iv,"∣","\\rvert"),Sv(Av,Tv,Iv,"∥","\\rVert"),Sv(Av,Tv,Nv,"=","="),Sv(Av,Tv,Nv,":",":"),Sv(Av,Tv,Nv,"≈","\\approx",!0),Sv(Av,Tv,Nv,"≅","\\cong",!0),Sv(Av,Tv,Nv,"≥","\\ge"),Sv(Av,Tv,Nv,"≥","\\geq",!0),Sv(Av,Tv,Nv,"←","\\gets"),Sv(Av,Tv,Nv,">","\\gt",!0),Sv(Av,Tv,Nv,"∈","\\in",!0),Sv(Av,Tv,Nv,"","\\@not"),Sv(Av,Tv,Nv,"⊂","\\subset",!0),Sv(Av,Tv,Nv,"⊃","\\supset",!0),Sv(Av,Tv,Nv,"⊆","\\subseteq",!0),Sv(Av,Tv,Nv,"⊇","\\supseteq",!0),Sv(Av,Ev,Nv,"⊈","\\nsubseteq",!0),Sv(Av,Ev,Nv,"⊉","\\nsupseteq",!0),Sv(Av,Tv,Nv,"⊨","\\models"),Sv(Av,Tv,Nv,"←","\\leftarrow",!0),Sv(Av,Tv,Nv,"≤","\\le"),Sv(Av,Tv,Nv,"≤","\\leq",!0),Sv(Av,Tv,Nv,"<","\\lt",!0),Sv(Av,Tv,Nv,"→","\\rightarrow",!0),Sv(Av,Tv,Nv,"→","\\to"),Sv(Av,Ev,Nv,"≱","\\ngeq",!0),Sv(Av,Ev,Nv,"≰","\\nleq",!0),Sv(Av,Tv,Hv," ","\\ "),Sv(Av,Tv,Hv," ","\\space"),Sv(Av,Tv,Hv," ","\\nobreakspace"),Sv(Mv,Tv,Hv," ","\\ "),Sv(Mv,Tv,Hv," "," "),Sv(Mv,Tv,Hv," ","\\space"),Sv(Mv,Tv,Hv," ","\\nobreakspace"),Sv(Av,Tv,Hv,"","\\nobreak"),Sv(Av,Tv,Hv,"","\\allowbreak"),Sv(Av,Tv,Dv,",",","),Sv(Av,Tv,Dv,";",";"),Sv(Av,Ev,Ov,"⊼","\\barwedge",!0),Sv(Av,Ev,Ov,"⊻","\\veebar",!0),Sv(Av,Tv,Ov,"⊙","\\odot",!0),Sv(Av,Tv,Ov,"⊕","\\oplus",!0),Sv(Av,Tv,Ov,"⊗","\\otimes",!0),Sv(Av,Tv,qv,"∂","\\partial",!0),Sv(Av,Tv,Ov,"⊘","\\oslash",!0),Sv(Av,Ev,Ov,"⊚","\\circledcirc",!0),Sv(Av,Ev,Ov,"⊡","\\boxdot",!0),Sv(Av,Tv,Ov,"△","\\bigtriangleup"),Sv(Av,Tv,Ov,"▽","\\bigtriangledown"),Sv(Av,Tv,Ov,"†","\\dagger"),Sv(Av,Tv,Ov,"⋄","\\diamond"),Sv(Av,Tv,Ov,"⋆","\\star"),Sv(Av,Tv,Ov,"◃","\\triangleleft"),Sv(Av,Tv,Ov,"▹","\\triangleright"),Sv(Av,Tv,zv,"{","\\{"),Sv(Mv,Tv,qv,"{","\\{"),Sv(Mv,Tv,qv,"{","\\textbraceleft"),Sv(Av,Tv,Iv,"}","\\}"),Sv(Mv,Tv,qv,"}","\\}"),Sv(Mv,Tv,qv,"}","\\textbraceright"),Sv(Av,Tv,zv,"{","\\lbrace"),Sv(Av,Tv,Iv,"}","\\rbrace"),Sv(Av,Tv,zv,"[","\\lbrack",!0),Sv(Mv,Tv,qv,"[","\\lbrack",!0),Sv(Av,Tv,Iv,"]","\\rbrack",!0),Sv(Mv,Tv,qv,"]","\\rbrack",!0),Sv(Av,Tv,zv,"(","\\lparen",!0),Sv(Av,Tv,Iv,")","\\rparen",!0),Sv(Mv,Tv,qv,"<","\\textless",!0),Sv(Mv,Tv,qv,">","\\textgreater",!0),Sv(Av,Tv,zv,"⌊","\\lfloor",!0),Sv(Av,Tv,Iv,"⌋","\\rfloor",!0),Sv(Av,Tv,zv,"⌈","\\lceil",!0),Sv(Av,Tv,Iv,"⌉","\\rceil",!0),Sv(Av,Tv,qv,"\\","\\backslash"),Sv(Av,Tv,qv,"∣","|"),Sv(Av,Tv,qv,"∣","\\vert"),Sv(Mv,Tv,qv,"|","\\textbar",!0),Sv(Av,Tv,qv,"∥","\\|"),Sv(Av,Tv,qv,"∥","\\Vert"),Sv(Mv,Tv,qv,"∥","\\textbardbl"),Sv(Mv,Tv,qv,"~","\\textasciitilde"),Sv(Mv,Tv,qv,"\\","\\textbackslash"),Sv(Mv,Tv,qv,"^","\\textasciicircum"),Sv(Av,Tv,Nv,"↑","\\uparrow",!0),Sv(Av,Tv,Nv,"⇑","\\Uparrow",!0),Sv(Av,Tv,Nv,"↓","\\downarrow",!0),Sv(Av,Tv,Nv,"⇓","\\Downarrow",!0),Sv(Av,Tv,Nv,"↕","\\updownarrow",!0),Sv(Av,Tv,Nv,"⇕","\\Updownarrow",!0),Sv(Av,Tv,Bv,"∐","\\coprod"),Sv(Av,Tv,Bv,"⋁","\\bigvee"),Sv(Av,Tv,Bv,"⋀","\\bigwedge"),Sv(Av,Tv,Bv,"⨄","\\biguplus"),Sv(Av,Tv,Bv,"⋂","\\bigcap"),Sv(Av,Tv,Bv,"⋃","\\bigcup"),Sv(Av,Tv,Bv,"∫","\\int"),Sv(Av,Tv,Bv,"∫","\\intop"),Sv(Av,Tv,Bv,"∬","\\iint"),Sv(Av,Tv,Bv,"∭","\\iiint"),Sv(Av,Tv,Bv,"∏","\\prod"),Sv(Av,Tv,Bv,"∑","\\sum"),Sv(Av,Tv,Bv,"⨂","\\bigotimes"),Sv(Av,Tv,Bv,"⨁","\\bigoplus"),Sv(Av,Tv,Bv,"⨀","\\bigodot"),Sv(Av,Tv,Bv,"∮","\\oint"),Sv(Av,Tv,Bv,"∯","\\oiint"),Sv(Av,Tv,Bv,"∰","\\oiiint"),Sv(Av,Tv,Bv,"⨆","\\bigsqcup"),Sv(Av,Tv,Bv,"∫","\\smallint"),Sv(Mv,Tv,Rv,"…","\\textellipsis"),Sv(Av,Tv,Rv,"…","\\mathellipsis"),Sv(Mv,Tv,Rv,"…","\\ldots",!0),Sv(Av,Tv,Rv,"…","\\ldots",!0),Sv(Av,Tv,Rv,"⋯","\\@cdots",!0),Sv(Av,Tv,Rv,"⋱","\\ddots",!0),Sv(Av,Tv,qv,"⋮","\\varvdots"),Sv(Mv,Tv,qv,"⋮","\\varvdots"),Sv(Av,Tv,Lv,"ˊ","\\acute"),Sv(Av,Tv,Lv,"ˋ","\\grave"),Sv(Av,Tv,Lv,"¨","\\ddot"),Sv(Av,Tv,Lv,"~","\\tilde"),Sv(Av,Tv,Lv,"ˉ","\\bar"),Sv(Av,Tv,Lv,"˘","\\breve"),Sv(Av,Tv,Lv,"ˇ","\\check"),Sv(Av,Tv,Lv,"^","\\hat"),Sv(Av,Tv,Lv,"⃗","\\vec"),Sv(Av,Tv,Lv,"˙","\\dot"),Sv(Av,Tv,Lv,"˚","\\mathring"),Sv(Av,Tv,Pv,"","\\@imath"),Sv(Av,Tv,Pv,"","\\@jmath"),Sv(Av,Tv,qv,"ı","ı"),Sv(Av,Tv,qv,"ȷ","ȷ"),Sv(Mv,Tv,qv,"ı","\\i",!0),Sv(Mv,Tv,qv,"ȷ","\\j",!0),Sv(Mv,Tv,qv,"ß","\\ss",!0),Sv(Mv,Tv,qv,"æ","\\ae",!0),Sv(Mv,Tv,qv,"œ","\\oe",!0),Sv(Mv,Tv,qv,"ø","\\o",!0),Sv(Mv,Tv,qv,"Æ","\\AE",!0),Sv(Mv,Tv,qv,"Œ","\\OE",!0),Sv(Mv,Tv,qv,"Ø","\\O",!0),Sv(Mv,Tv,Lv,"ˊ","\\'"),Sv(Mv,Tv,Lv,"ˋ","\\`"),Sv(Mv,Tv,Lv,"ˆ","\\^"),Sv(Mv,Tv,Lv,"˜","\\~"),Sv(Mv,Tv,Lv,"ˉ","\\="),Sv(Mv,Tv,Lv,"˘","\\u"),Sv(Mv,Tv,Lv,"˙","\\."),Sv(Mv,Tv,Lv,"¸","\\c"),Sv(Mv,Tv,Lv,"˚","\\r"),Sv(Mv,Tv,Lv,"ˇ","\\v"),Sv(Mv,Tv,Lv,"¨",'\\"'),Sv(Mv,Tv,Lv,"˝","\\H"),Sv(Mv,Tv,Lv,"◯","\\textcircled");var jv={"--":!0,"---":!0,"``":!0,"''":!0};Sv(Mv,Tv,qv,"–","--",!0),Sv(Mv,Tv,qv,"–","\\textendash"),Sv(Mv,Tv,qv,"—","---",!0),Sv(Mv,Tv,qv,"—","\\textemdash"),Sv(Mv,Tv,qv,"‘","`",!0),Sv(Mv,Tv,qv,"‘","\\textquoteleft"),Sv(Mv,Tv,qv,"’","'",!0),Sv(Mv,Tv,qv,"’","\\textquoteright"),Sv(Mv,Tv,qv,"“","``",!0),Sv(Mv,Tv,qv,"“","\\textquotedblleft"),Sv(Mv,Tv,qv,"”","''",!0),Sv(Mv,Tv,qv,"”","\\textquotedblright"),Sv(Av,Tv,qv,"°","\\degree",!0),Sv(Mv,Tv,qv,"°","\\degree"),Sv(Mv,Tv,qv,"°","\\textdegree",!0),Sv(Av,Tv,qv,"£","\\pounds"),Sv(Av,Tv,qv,"£","\\mathsterling",!0),Sv(Mv,Tv,qv,"£","\\pounds"),Sv(Mv,Tv,qv,"£","\\textsterling",!0),Sv(Av,Ev,qv,"✠","\\maltese"),Sv(Mv,Ev,qv,"✠","\\maltese");for(var Vv=0;Vv<14;Vv++){var Fv='0123456789/@."'.charAt(Vv);Sv(Av,Tv,qv,Fv,Fv)}for(var $v=0;$v<25;$v++){var Wv='0123456789!@*()-=+";:?/.,'.charAt($v);Sv(Mv,Tv,qv,Wv,Wv)}for(var Uv,Gv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Zv=0;Zv<52;Zv++){var Xv=Gv.charAt(Zv);Sv(Av,Tv,Pv,Xv,Xv),Sv(Mv,Tv,qv,Xv,Xv)}Sv(Av,Ev,qv,"C","ℂ"),Sv(Mv,Ev,qv,"C","ℂ"),Sv(Av,Ev,qv,"H","ℍ"),Sv(Mv,Ev,qv,"H","ℍ"),Sv(Av,Ev,qv,"N","ℕ"),Sv(Mv,Ev,qv,"N","ℕ"),Sv(Av,Ev,qv,"P","ℙ"),Sv(Mv,Ev,qv,"P","ℙ"),Sv(Av,Ev,qv,"Q","ℚ"),Sv(Mv,Ev,qv,"Q","ℚ"),Sv(Av,Ev,qv,"R","ℝ"),Sv(Mv,Ev,qv,"R","ℝ"),Sv(Av,Ev,qv,"Z","ℤ"),Sv(Mv,Ev,qv,"Z","ℤ"),Sv(Av,Tv,Pv,"h","ℎ"),Sv(Mv,Tv,Pv,"h","ℎ");for(var Kv=0;Kv<52;Kv++){var Yv=Gv.charAt(Kv);Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56320+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56372+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56424+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56580+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56684+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56736+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56788+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56840+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56944+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Kv<26&&(Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56632+Kv)),Sv(Mv,Tv,qv,Yv,Uv),Sv(Av,Tv,Pv,Yv,Uv=String.fromCharCode(55349,56476+Kv)),Sv(Mv,Tv,qv,Yv,Uv))}Sv(Av,Tv,Pv,"k",Uv=String.fromCharCode(55349,56668)),Sv(Mv,Tv,qv,"k",Uv);for(var Jv=0;Jv<10;Jv++){var Qv=Jv.toString();Sv(Av,Tv,Pv,Qv,Uv=String.fromCharCode(55349,57294+Jv)),Sv(Mv,Tv,qv,Qv,Uv),Sv(Av,Tv,Pv,Qv,Uv=String.fromCharCode(55349,57314+Jv)),Sv(Mv,Tv,qv,Qv,Uv),Sv(Av,Tv,Pv,Qv,Uv=String.fromCharCode(55349,57324+Jv)),Sv(Mv,Tv,qv,Qv,Uv),Sv(Av,Tv,Pv,Qv,Uv=String.fromCharCode(55349,57334+Jv)),Sv(Mv,Tv,qv,Qv,Uv)}for(var ey=0;ey<3;ey++){var ty="ÐÞþ".charAt(ey);Sv(Av,Tv,Pv,ty,ty),Sv(Mv,Tv,qv,ty,ty)}var ny={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},ry={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},oy={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},iy={mathClass:"",textClass:"",font:""},ay={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},sy={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},ly={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},cy={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},dy={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},uy={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},hy={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},py=[ny,ny,ry,ry,oy,oy,{mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},iy,iy,iy,ay,ay,sy,sy,ly,ly,cy,cy,dy,dy,uy,uy,iy,iy,hy,hy],my=[ny,iy,cy,dy,hy],fy=function(e,t,n){if(_v[n][e]){var r=_v[n][e].replace;r&&(e=r)}return{value:e,metrics:kv(e,t,n)}},gy=function(e,t,n,r,o){var i,a=fy(e,t,n),s=a.metrics;if(e=a.value,s){var l=s.italic;("text"===n||r&&"mathit"===r.font)&&(l=0),i=new fv(e,s.height,s.depth,l,s.skew,s.width,o)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+n+"'"),i=new fv(e,0,0,0,0,0,o);if(r){i.maxFontSize=r.sizeMultiplier,r.style.isTight()&&i.classes.push("mtight");var c=r.getColor();c&&(i.style.color=c)}return i},vy=function(e,t,n,r){return void 0===r&&(r=[]),"boldsymbol"===n.font&&fy(e,"Main-Bold",t).metrics?gy(e,"Main-Bold",t,n,r.concat(["mathbf"])):"\\"===e||"main"===_v[t][e].font?gy(e,"Main-Regular",t,n,r):gy(e,"AMS-Regular",t,n,r.concat(["amsrm"]))},yy=function(e,t){var n="mathord"===e.type?"mathord":"textord",r=e.mode,o=e.text,i=["mord"],{font:a,fontFamily:s,fontWeight:l,fontShape:c}=t,d="math"===r||"text"===r&&!!a,u=d?a:s,h="",p="";if(55349===o.charCodeAt(0)){var m=(e=>{var t=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536;if(119808<=t&&t<120484){var n=Math.floor((t-119808)/26);return py[n]}if(120782<=t&&t<=120831){var r=Math.floor((t-120782)/10);return my[r]}if(120485===t||120486===t)return py[0];if(120486<t&&t<120782)return iy;throw new Ag("Unsupported character: "+e)})(o);h=m.font,p=m[r+"Class"]}if(h)return gy(o,h,r,t,i.concat(p));if(u){var f,g;if("boldsymbol"===u){var v=function(e,t,n){return"textord"!==n&&fy(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(o,r,n);f=v.fontName,g=[v.fontClass]}else d?(f=Ly[a].fontName,g=[a]):(f=Ey(s,l,c),g=[s,l,c]);if(fy(o,f,r).metrics)return gy(o,f,r,t,i.concat(g));if(jv.hasOwnProperty(o)&&"Typewriter"===f.slice(0,10)){for(var y=[],b=0;b<o.length;b++)y.push(gy(o[b],f,r,t,i.concat(g)));return Sy(y)}}if("mathord"===n)return gy(o,"Math-Italic",r,t,i.concat(["mathnormal"]));if("textord"===n){var w=_v[r][o]&&_v[r][o].font;if("ams"===w){var x=Ey("amsrm",l,c);return gy(o,x,r,t,i.concat("amsrm",l,c))}if("main"!==w&&w){var k=Ey(w,l,c);return gy(o,k,r,t,i.concat(k,l,c))}var C=Ey("textrm",l,c);return gy(o,C,r,t,i.concat(l,c))}throw new Error("unexpected type: "+n+" in makeOrd")},by=(e,t)=>{if(iv(e.classes)!==iv(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||0!==e.italic&&e.hasClass("mathnormal"))return!1;if(1===e.classes.length){var n=e.classes[0];if("mbin"===n||"mord"===n)return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var o of Object.keys(t.style))if(e.style[o]!==t.style[o])return!1;return!0},wy=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof fv&&r instanceof fv&&by(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},xy=function(e){for(var t=0,n=0,r=0,o=0;o<e.children.length;o++){var i=e.children[o];i.height>t&&(t=i.height),i.depth>n&&(n=i.depth),i.maxFontSize>r&&(r=i.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},ky=function(e,t,n,r){var o=new uv(e,t,n,r);return xy(o),o},Cy=(e,t,n,r)=>new uv(e,t,n,r),_y=function(e,t,n){var r=ky([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=ov(r.height),r.maxFontSize=1,r},Sy=function(e){var t=new Qg(e);return xy(t),t},Ay=function(e,t){return e instanceof Qg?ky([],[e],t):e},My=function(e,t){for(var{children:n,depth:r}=function(e){if("individualShift"===e.positionType){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,o=r,i=1;i<t.length;i++){var a=-t[i].shift-o-t[i].elem.depth,s=a-(t[i-1].elem.height+t[i-1].elem.depth);o+=a,n.push({type:"kern",size:s}),n.push(t[i])}return{children:n,depth:r}}var l;if("top"===e.positionType){for(var c=e.positionData,d=0;d<e.children.length;d++){var u=e.children[d];c-="kern"===u.type?u.size:u.elem.height+u.elem.depth}l=c}else if("bottom"===e.positionType)l=-e.positionData;else{var h=e.children[0];if("elem"!==h.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-h.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-h.elem.depth}}return{children:e.children,depth:l}}(e),o=0,i=0;i<n.length;i++){var a=n[i];if("elem"===a.type){var s=a.elem;o=Math.max(o,s.maxFontSize,s.height)}}o+=2;var l=ky(["pstrut"],[]);l.style.height=ov(o);for(var c=[],d=r,u=r,h=r,p=0;p<n.length;p++){var m=n[p];if("kern"===m.type)h+=m.size;else{var f=m.elem,g=m.wrapperClasses||[],v=m.wrapperStyle||{},y=ky(g,[l,f],void 0,v);y.style.top=ov(-o-h-f.depth),m.marginLeft&&(y.style.marginLeft=m.marginLeft),m.marginRight&&(y.style.marginRight=m.marginRight),c.push(y),h+=f.height+f.depth}d=Math.min(d,h),u=Math.max(u,h)}var b,w=ky(["vlist"],c);if(w.style.height=ov(u),d<0){var x=ky([],[]),k=ky(["vlist"],[x]);k.style.height=ov(-d);var C=ky(["vlist-s"],[new fv("")]);b=[ky(["vlist-r"],[w,C]),ky(["vlist-r"],[k])]}else b=[ky(["vlist-r"],[w])];var _=ky(["vlist-t"],b);return 2===b.length&&_.classes.push("vlist-t2"),_.height=u,_.depth=-d,_},Ty=(e,t)=>{var n=ky(["mspace"],[],t),r=rv(e,t);return n.style.marginRight=ov(r),n},Ey=(e,t,n)=>{var r;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return r+"-"+("textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===n?"Italic":"Regular")},Ly={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Oy={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Iy=function(e,t){var[n,r,o]=Oy[e],i=new vv(n),a=new gv([i],{width:ov(r),height:ov(o),style:"width:"+ov(r),viewBox:"0 0 "+1e3*r+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),s=Cy(["overlay"],[a],t);return s.height=o,s.style.height=ov(o),s.style.width=ov(r),s},Ry={number:3,unit:"mu"},Py={number:4,unit:"mu"},By={number:5,unit:"mu"},zy={mord:{mop:Ry,mbin:Py,mrel:By,minner:Ry},mop:{mord:Ry,mop:Ry,mrel:By,minner:Ry},mbin:{mord:Py,mop:Py,mopen:Py,minner:Py},mrel:{mord:By,mop:By,mopen:By,minner:By},mopen:{},mclose:{mop:Ry,mbin:Py,mrel:By,minner:Ry},mpunct:{mord:Ry,mop:Ry,mrel:By,mopen:Ry,mclose:Ry,mpunct:Ry,minner:Ry},minner:{mord:Ry,mop:Ry,mbin:Py,mrel:By,mopen:Ry,mpunct:Ry,minner:Ry}},Dy={mord:{mop:Ry},mop:{mord:Ry,mop:Ry},mbin:{},mrel:{},mopen:{},mclose:{mop:Ry},mpunct:{},minner:{mop:Ry}},Ny={},Hy={},qy={};function jy(e){for(var{type:t,names:n,htmlBuilder:r,mathmlBuilder:o}=e,i=0;i<n.length;++i)Ny[n[i]]=e;t&&(r&&(Hy[t]=r),o&&(qy[t]=o))}function Vy(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;n&&(Hy[t]=n),r&&(qy[t]=r)}var Fy=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e},$y=function(e){return"ordgroup"===e.type?e.body:[e]},Wy=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),Uy=new Set(["rightmost","mrel","mclose","mpunct"]),Gy={display:Ug.DISPLAY,text:Ug.TEXT,script:Ug.SCRIPT,scriptscript:Ug.SCRIPTSCRIPT},Zy={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Xy=function(e,t,n,r){void 0===r&&(r=[null,null]);for(var o=[],i=0;i<e.length;i++){var a=tb(e[i],t);if(a instanceof Qg){var s=a.children;o.push(...s)}else o.push(a)}if(wy(o),!n)return o;var l=t;if(1===e.length){var c=e[0];"sizing"===c.type?l=t.havingSize(c.size):"styling"===c.type&&(l=t.havingStyle(Gy[c.style]))}var d=ky([r[0]||"leftmost"],[],t),u=ky([r[1]||"rightmost"],[],t),h="root"===n;return Ky(o,(e,t)=>{var n=t.classes[0],r=e.classes[0];"mbin"===n&&Uy.has(r)?t.classes[0]="mord":"mbin"===r&&Wy.has(n)&&(e.classes[0]="mord")},{node:d},u,h),Ky(o,(e,t)=>{var n,r,o=Qy(t),i=Qy(e),a=o&&i?e.hasClass("mtight")?null==(n=Dy[o])?void 0:n[i]:null==(r=zy[o])?void 0:r[i]:null;if(a)return Ty(a,l)},{node:d},u,h),o},Ky=function(e,t,n,r,o){r&&e.push(r);for(var i=0;i<e.length;i++){var a=e[i],s=Yy(a);if(s)Ky(s.children,t,n,null,o);else{var l=!a.hasClass("mspace");if(l){var c=t(a,n.node);c&&(n.insertAfter?n.insertAfter(c):(e.unshift(c),i++))}l?n.node=a:o&&a.hasClass("newline")&&(n.node=ky(["leftmost"])),n.insertAfter=(t=>n=>{e.splice(t+1,0,n),i++})(i)}}r&&e.pop()},Yy=function(e){return e instanceof Qg||e instanceof hv||e instanceof uv&&e.hasClass("enclosing")?e:null},Jy=function(e,t){var n=Yy(e);if(n){var r=n.children;if(r.length){if("right"===t)return Jy(r[r.length-1],"right");if("left"===t)return Jy(r[0],"left")}}return e},Qy=function(e,t){if(!e)return null;t&&(e=Jy(e,t));var n=e.classes[0];return Zy[n]||null},eb=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return ky(t.concat(n))},tb=function(e,t,n){if(!e)return ky();if(Hy[e.type]){var r=Hy[e.type](e,t);if(n&&t.size!==n.size){r=ky(t.sizingClasses(n),[r],t);var o=t.sizeMultiplier/n.sizeMultiplier;r.height*=o,r.depth*=o}return r}throw new Ag("Got group of unknown type: '"+e.type+"'")};function nb(e,t){var n=ky(["base"],e,t),r=ky(["strut"]);return r.style.height=ov(n.height+n.depth),n.depth&&(r.style.verticalAlign=ov(-n.depth)),n.children.unshift(r),n}function rb(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var r,o=Xy(e,t,"root");2===o.length&&o[1].hasClass("tag")&&(r=o.pop());for(var i,a=[],s=[],l=0;l<o.length;l++)if(s.push(o[l]),o[l].hasClass("mbin")||o[l].hasClass("mrel")||o[l].hasClass("allowbreak")){for(var c=!1;l<o.length-1&&o[l+1].hasClass("mspace")&&!o[l+1].hasClass("newline");)l++,s.push(o[l]),o[l].hasClass("nobreak")&&(c=!0);c||(a.push(nb(s,t)),s=[])}else o[l].hasClass("newline")&&(s.pop(),s.length>0&&(a.push(nb(s,t)),s=[]),a.push(o[l]));s.length>0&&a.push(nb(s,t)),n?((i=nb(Xy(n,t,!0),t)).classes=["tag"],a.push(i)):r&&a.push(r);var d=ky(["katex-html"],a);if(d.setAttribute("aria-hidden","true"),i){var u=i.children[0];u.style.height=ov(d.height+d.depth),d.depth&&(u.style.verticalAlign=ov(-d.depth))}return d}function ob(e){return new Qg(e)}class ib{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=iv(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof ab&&this.children[n+1]instanceof ab){for(var r=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof ab;)r+=this.children[++n].toText();e.appendChild(new ab(r).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=Og(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+Og(iv(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+"</"+this.type+">"}toText(){return this.children.map(e=>e.toText()).join("")}}class ab{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Og(this.toText())}toText(){return this.text}}class sb{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?" ":e>=-.05556&&e<=-.05555?" ":e>=-.1667&&e<=-.1666?" ":e>=-.2223&&e<=-.2222?" ":e>=-.2778&&e<=-.2777?" ":null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",ov(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+ov(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var lb=new Set(["\\imath","\\jmath"]),cb=new Set(["mrow","mtable"]),db=function(e,t,n){return!_v[t][e]||!_v[t][e].replace||55349===e.charCodeAt(0)||jv.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6))||(e=_v[t][e].replace),new ab(e)},ub=function(e){return 1===e.length?e[0]:new ib("mrow",e)},hb={mathit:"italic",boldsymbol:e=>"textord"===e.type?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},pb=(e,t)=>{if("text"===e.mode){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold"}var n=t.font;if(!n||"mathnormal"===n)return null;var r=e.mode,o=hb[n];if(o)return"function"==typeof o?o(e):o;var i=e.text;if(lb.has(i))return null;if(_v[r][i]){var a=_v[r][i].replace;a&&(i=a)}return kv(i,Ly[n].fontName,r)?Ly[n].variant:null};function mb(e){if(!e)return!1;if("mi"===e.type&&1===e.children.length){var t=e.children[0];return t instanceof ab&&"."===t.text}if("mo"===e.type&&1===e.children.length&&"true"===e.getAttribute("separator")&&"0em"===e.getAttribute("lspace")&&"0em"===e.getAttribute("rspace")){var n=e.children[0];return n instanceof ab&&","===n.text}return!1}var fb=function(e,t,n){if(1===e.length){var r=vb(e[0],t);return n&&r instanceof ib&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var o,i=[],a=0;a<e.length;a++){var s=vb(e[a],t);if(s instanceof ib&&o instanceof ib){if("mtext"===s.type&&"mtext"===o.type&&s.getAttribute("mathvariant")===o.getAttribute("mathvariant")){o.children.push(...s.children);continue}if("mn"===s.type&&"mn"===o.type){o.children.push(...s.children);continue}if(mb(s)&&"mn"===o.type){o.children.push(...s.children);continue}if("mn"===s.type&&mb(o))s.children=[...o.children,...s.children],i.pop();else if(("msup"===s.type||"msub"===s.type)&&s.children.length>=1&&("mn"===o.type||mb(o))){var l=s.children[0];l instanceof ib&&"mn"===l.type&&(l.children=[...o.children,...l.children],i.pop())}else if("mi"===o.type&&1===o.children.length){var c=o.children[0];if(c instanceof ab&&"̸"===c.text&&("mo"===s.type||"mi"===s.type||"mn"===s.type)){var d=s.children[0];d instanceof ab&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),i.pop())}}}i.push(s),o=s}return i},gb=function(e,t,n){return ub(fb(e,t,n))},vb=function(e,t){if(!e)return new ib("mrow");if(qy[e.type])return qy[e.type](e,t);throw new Ag("Got group of unknown type: '"+e.type+"'")};function yb(e,t,n,r,o){var i,a=fb(e,n);i=1===a.length&&a[0]instanceof ib&&cb.has(a[0].type)?a[0]:new ib("mrow",a);var s=new ib("annotation",[new ab(t)]);s.setAttribute("encoding","application/x-tex");var l=new ib("semantics",[i,s]),c=new ib("math",[l]);return c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block"),ky([o?"katex":"katex-mathml"],[c])}var bb=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],wb=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],xb=function(e,t){return t.size<2?e:bb[e-1][t.size-1]};class kb{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||kb.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=wb[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,e),new kb(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:xb(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:wb[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=xb(kb.BASESIZE,e);return this.size===t&&this.textSize===kb.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==kb.BASESIZE?["sizing","reset-size"+this.size,"size"+kb.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!Cv[t=e>=5?0:e>=3?1:2]){var n=Cv[t]={cssEmPerMu:wv.quad[t]/18};for(var r in wv)wv.hasOwnProperty(r)&&(n[r]=wv[r][t])}return Cv[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}kb.BASESIZE=6;var Cb=function(e){return new kb({style:e.displayMode?Ug.DISPLAY:Ug.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},_b=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=ky(n,[e])}return e},Sb={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Ab=function(e){var t=new ib("mo",[new ab(Sb[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Mb={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Tb=new Set(["widehat","widecheck","widetilde","utilde"]),Eb=function(e,t){var{span:n,minWidth:r,height:o}=function(){var n=4e5,r=e.label.slice(1);if(Tb.has(r)&&"base"in e){var o,i,a,s="ordgroup"===e.base.type?e.base.body.length:1;if(s>5)"widehat"===r||"widecheck"===r?(o=420,n=2364,a=.42,i=r+"4"):(o=312,n=2340,a=.34,i="tilde4");else{var l=[1,1,2,2,3,3][s];"widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][l],o=[0,239,300,360,420][l],a=[0,.24,.3,.3,.36,.42][l],i=r+l):(n=[0,600,1033,2339,2340][l],o=[0,260,286,306,312][l],a=[0,.26,.286,.3,.306,.34][l],i="tilde"+l)}var c=new vv(i),d=new gv([c],{width:"100%",height:ov(a),viewBox:"0 0 "+n+" "+o,preserveAspectRatio:"none"});return{span:Cy([],[d],t),minWidth:0,height:a}}var u=[],h=Mb[r];if(!h)throw new Error('No SVG data for "'+r+'".');var p,m,[f,g,v]=h,y=v/1e3,b=f.length;if(1===b){if(4!==h.length)throw new Error('Expected 4-tuple for single-path SVG data "'+r+'".');p=["hide-tail"],m=[h[3]]}else if(2===b)p=["halfarrow-left","halfarrow-right"],m=["xMinYMin","xMaxYMin"];else{if(3!==b)throw new Error("Correct katexImagesData or update code here to support\n "+b+" children.");p=["brace-left","brace-center","brace-right"],m=["xMinYMin","xMidYMin","xMaxYMin"]}for(var w=0;w<b;w++){var x=new vv(f[w]),k=new gv([x],{width:"400em",height:ov(y),viewBox:"0 0 "+n+" "+v,preserveAspectRatio:m[w]+" slice"}),C=Cy([p[w]],[k],t);if(1===b)return{span:C,minWidth:g,height:y};C.style.height=ov(y),u.push(C)}return{span:ky(["stretchy"],u,t),minWidth:g,height:y}}();return n.height=o,n.style.height=ov(o),r>0&&(n.style.minWidth=ov(r)),n},Lb={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Ob={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function Ib(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Rb(e){var t=Pb(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Pb(e){return e&&("atom"===e.type||Ob.hasOwnProperty(e.type))?e:null}var Bb=e=>e instanceof fv?e:(e=>e instanceof uv||e instanceof hv||e instanceof Qg)(e)&&1===e.children.length?Bb(e.children[0]):void 0,zb=(e,t)=>{var n,r,o;e&&"supsub"===e.type?(n=(r=Ib(e.base,"accent")).base,e.base=n,o=function(e){if(e instanceof uv)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(tb(e,t)),e.base=r):n=(r=Ib(e,"accent")).base;var i,a,s=tb(n,t.havingCrampedStyle()),l=0;r.isShifty&&Pg(n)&&(l=null!=(i=null==(a=Bb(s))?void 0:a.skew)?i:0);var c,d="\\c"===r.label,u=d?s.height+s.depth:Math.min(s.height,t.fontMetrics().xHeight);if(r.isStretchy)c=Eb(r,t),c=My({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:c,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+ov(2*l)+")",marginLeft:ov(2*l)}:void 0}]});else{var h,p;"\\vec"===r.label?(h=Iy("vec",t),p=Oy.vec[1]):(h=function(e){if(e instanceof fv)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}(h=yy({type:"textord",mode:r.mode,text:r.label},t)),h.italic=0,p=h.width,d&&(u+=h.depth)),c=ky(["accent-body"],[h]);var m="\\textcircled"===r.label;m&&(c.classes.push("accent-full"),u=s.height);var f=l;m||(f-=p/2),c.style.left=ov(f),"\\textcircled"===r.label&&(c.style.top=".2em"),c=My({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-u},{type:"elem",elem:c}]})}var g=ky(["mord","accent"],[c],t);return o?(o.children[0]=g,o.height=Math.max(g.height,o.height),o.classes[0]="mord",o):g},Db=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));jy({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],numArgs:1,handler:(e,t)=>{var n=Fy(t[0]),r=!Db.test(e.funcName),o=!r||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:o,base:n}},htmlBuilder:zb,mathmlBuilder:(e,t)=>{var n=e.isStretchy?Ab(e.label):new ib("mo",[db(e.label,e.mode)]),r=new ib("mover",[vb(e.base,t),n]);return r.setAttribute("accent","true"),r}}),jy({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"],handler:(e,t)=>{var n=t[0],r=e.parser.mode;return"math"===r&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}}}),jy({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],numArgs:1,handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:o}},htmlBuilder:(e,t)=>{var n=tb(e.base,t),r=Eb(e,t),o="\\utilde"===e.label?.12:0,i=My({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:o},{type:"elem",elem:n}]});return ky(["mord","accentunder"],[i],t)},mathmlBuilder:(e,t)=>{var n=Ab(e.label),r=new ib("munder",[vb(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var Nb=e=>{var t=new ib("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};jy({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],numArgs:1,numOptionalArgs:1,handler(e,t,n){var{parser:r,funcName:o}=e;return{type:"xArrow",mode:r.mode,label:o,body:t[0],below:n[0]}},htmlBuilder(e,t){var n,r=t.style,o=t.havingStyle(r.sup()),i=Ay(tb(e.body,o,t),t),a="\\x"===e.label.slice(0,2)?"x":"cd";i.classes.push(a+"-arrow-pad"),e.below&&(o=t.havingStyle(r.sub()),(n=Ay(tb(e.below,o,t),t)).classes.push(a+"-arrow-pad"));var s,l=Eb(e,t),c=-t.fontMetrics().axisHeight+.5*l.height,d=-t.fontMetrics().axisHeight-.5*l.height-.111;if((i.depth>.25||"\\xleftequilibrium"===e.label)&&(d-=i.depth),n){var u=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;s=My({positionType:"individualShift",children:[{type:"elem",elem:i,shift:d},{type:"elem",elem:l,shift:c,wrapperClasses:["svg-align"]},{type:"elem",elem:n,shift:u}]})}else s=My({positionType:"individualShift",children:[{type:"elem",elem:i,shift:d},{type:"elem",elem:l,shift:c,wrapperClasses:["svg-align"]}]});return ky(["mrel","x-arrow"],[s],t)},mathmlBuilder(e,t){var n,r=Ab(e.label);if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var o=Nb(vb(e.body,t));if(e.below){var i=Nb(vb(e.below,t));n=new ib("munderover",[r,i,o])}else n=new ib("mover",[r,o])}else if(e.below){var a=Nb(vb(e.below,t));n=new ib("munder",[r,a])}else n=Nb(),n=new ib("mover",[r,n]);return n}}),jy({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],numArgs:1,primitive:!0,handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:$y(o),isCharacterBox:Pg(o)}},htmlBuilder:function(e,t){var n=Xy(e.body,t,!0);return ky([e.mclass],n,t)},mathmlBuilder:function(e,t){var n,r=fb(e.body,t);return"minner"===e.mclass?n=new ib("mpadded",r):"mord"===e.mclass?e.isCharacterBox?(n=r[0]).type="mi":n=new ib("mi",r):(e.isCharacterBox?(n=r[0]).type="mo":n=new ib("mo",r),"mbin"===e.mclass?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"!==e.mclass&&"mclose"!==e.mclass||(n.attributes.lspace="0em",n.attributes.rspace="0em")),n}});var Hb=e=>{var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};jy({type:"mclass",names:["\\@binrel"],numArgs:2,handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Hb(t[0]),body:$y(t[1]),isCharacterBox:Pg(t[1])}}}),jy({type:"mclass",names:["\\stackrel","\\overset","\\underset"],numArgs:2,handler(e,t){var n,{parser:r,funcName:o}=e,i=t[1],a=t[0];n="\\stackrel"!==o?Hb(i):"mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==o,body:$y(i)},l="\\underset"===o?{type:"supsub",mode:a.mode,base:s,sub:a}:{type:"supsub",mode:a.mode,base:s,sup:a};return{type:"mclass",mode:r.mode,mclass:n,body:[l],isCharacterBox:Pg(l)}}}),jy({type:"pmb",names:["\\pmb"],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Hb(t[0]),body:$y(t[0])}},htmlBuilder(e,t){var n=Xy(e.body,t,!0),r=ky([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=fb(e.body,t),r=new ib("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var qb={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},jb=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),Vb=e=>"textord"===e.type&&"@"===e.text,Fb=(e,t)=>("mathord"===e.type||"atom"===e.type)&&e.text===t;function $b(e,t,n){var r=qb[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var o={type:"atom",text:r,mode:"math",family:"rel"},i={type:"ordgroup",mode:"math",body:[n.callFunction("\\\\cdleft",[t[0]],[]),n.callFunction("\\Big",[o],[]),n.callFunction("\\\\cdright",[t[1]],[])]};return n.callFunction("\\\\cdparent",[i],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return n.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}jy({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=Ay(tb(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=ov(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new ib("mrow",[vb(e.label,t)]);return(n=new ib("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new ib("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),jy({type:"cdlabelparent",names:["\\\\cdparent"],numArgs:1,handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=Ay(tb(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new ib("mrow",[vb(e.fragment,t)])}),jy({type:"textord",names:["\\@char"],numArgs:1,allowedInText:!0,handler(e,t){for(var{parser:n}=e,r=Ib(t[0],"ordgroup").body,o="",i=0;i<r.length;i++)o+=Ib(r[i],"textord").text;var a,s=parseInt(o);if(isNaN(s))throw new Ag("\\@char has non-numeric argument "+o);if(s<0||s>=1114111)throw new Ag("\\@char with invalid code point "+o);return s<=65535?a=String.fromCharCode(s):(s-=65536,a=String.fromCharCode(55296+(s>>10),56320+(1023&s))),{type:"textord",mode:n.mode,text:a}}}),jy({type:"color",names:["\\textcolor"],numArgs:2,allowedInText:!0,argTypes:["color","original"],handler(e,t){var{parser:n}=e,r=Ib(t[0],"color-token").color,o=t[1];return{type:"color",mode:n.mode,color:r,body:$y(o)}},htmlBuilder:(e,t)=>{var n=Xy(e.body,t.withColor(e.color),!1);return Sy(n)},mathmlBuilder:(e,t)=>{var n=fb(e.body,t.withColor(e.color)),r=new ib("mstyle",n);return r.setAttribute("mathcolor",e.color),r}}),jy({type:"color",names:["\\color"],numArgs:1,allowedInText:!0,argTypes:["color"],handler(e,t){var{parser:n,breakOnTokenText:r}=e,o=Ib(t[0],"color-token").color;n.gullet.macros.set("\\current@color",o);var i=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:o,body:i}}}),jy({type:"cr",names:["\\\\"],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(e,t,n){var{parser:r}=e,o="["===r.gullet.future().text?r.parseSizeGroup(!0):null,i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:o&&Ib(o,"size").value}},htmlBuilder(e,t){var n=ky(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=ov(rv(e.size,t)))),n},mathmlBuilder(e,t){var n=new ib("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",ov(rv(e.size,t)))),n}});var Wb={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Ub=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Ag("Expected a control sequence",e);return t},Gb=(e,t,n,r)=>{var o=e.gullet.macros.get(n.text);null==o&&(n.noexpand=!0,o={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,o,r)};jy({type:"internal",names:["\\global","\\long","\\\\globallong"],numArgs:0,allowedInText:!0,handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(Wb[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=Wb[r.text]),Ib(t.parseFunction(),"internal");throw new Ag("Invalid token after macro prefix",r)}}),jy({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),o=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(o))throw new Ag("Expected a control sequence",r);for(var i,a=0,s=[[]];"{"!==t.gullet.future().text;)if("#"===(r=t.gullet.popToken()).text){if("{"===t.gullet.future().text){i=t.gullet.future(),s[a].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Ag('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new Ag('Argument number "'+r.text+'" out of order');a++,s.push([])}else{if("EOF"===r.text)throw new Ag("Expected a macro definition");s[a].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return i&&l.unshift(i),"\\edef"!==n&&"\\xdef"!==n||(l=t.gullet.expandTokens(l)).reverse(),t.gullet.macros.set(o,{tokens:l,numArgs:a,delimiters:s},n===Wb[n]),{type:"internal",mode:t.mode}}}),jy({type:"internal",names:["\\let","\\\\globallet"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=Ub(t.gullet.popToken());t.gullet.consumeSpaces();var o=(e=>{var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t})(t);return Gb(t,r,o,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),jy({type:"internal",names:["\\futurelet","\\\\globalfuture"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=Ub(t.gullet.popToken()),o=t.gullet.popToken(),i=t.gullet.popToken();return Gb(t,r,i,"\\\\globalfuture"===n),t.gullet.pushToken(i),t.gullet.pushToken(o),{type:"internal",mode:t.mode}}});var Zb=function(e,t,n){var r=kv(_v.math[e]&&_v.math[e].replace||e,t,n);if(!r)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return r},Xb=function(e,t,n,r){var o=n.havingBaseStyle(t),i=ky(r.concat(o.sizingClasses(n)),[e],n),a=o.sizeMultiplier/n.sizeMultiplier;return i.height*=a,i.depth*=a,i.maxFontSize=o.sizeMultiplier,i},Kb=function(e,t,n){var r=t.havingBaseStyle(n),o=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=ov(o),e.height-=o,e.depth+=o},Yb=function(e,t,n,r,o,i){var a=function(e,t,n,r){return gy(e,"Size"+t+"-Regular",n,r)}(e,t,o,r),s=Xb(ky(["delimsizing","size"+t],[a],r),Ug.TEXT,r,i);return n&&Kb(s,r,Ug.TEXT),s},Jb=function(e,t,n){return{type:"elem",elem:ky(["delimsizinginner","Size1-Regular"===t?"delim-size1":"delim-size4"],[ky([],[gy(e,t,n)])])}},Qb=function(e,t,n){var r=bv["Size4-Regular"][e.charCodeAt(0)]?bv["Size4-Regular"][e.charCodeAt(0)][4]:bv["Size1-Regular"][e.charCodeAt(0)][4],o=new vv("inner",function(e,t){switch(e){case"⎜":return Kg("M291 0 H417 V"+t+" H291z");case"∣":return Kg("M145 0 H188 V"+t+" H145z");case"∥":return Kg("M145 0 H188 V"+t+" H145z")+Kg("M367 0 H410 V"+t+" H367z");case"⎟":return Kg("M457 0 H583 V"+t+" H457z");case"⎢":return Kg("M319 0 H403 V"+t+" H319z");case"⎥":return Kg("M263 0 H347 V"+t+" H263z");case"⎪":return Kg("M384 0 H504 V"+t+" H384z");case"⏐":return Kg("M312 0 H355 V"+t+" H312z");case"‖":return Kg("M257 0 H300 V"+t+" H257z")+Kg("M478 0 H521 V"+t+" H478z");default:return""}}(e,Math.round(1e3*t))),i=new gv([o],{width:ov(r),height:ov(t),style:"width:"+ov(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),a=Cy([],[i],n);return a.height=t,a.style.height=ov(t),a.style.width=ov(r),{type:"elem",elem:a}},ew={type:"kern",size:-.008},tw=new Set(["|","\\lvert","\\rvert","\\vert"]),nw=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),rw=function(e,t,n,r,o,i){var a,s,l,c,d="",u=0;a=l=c=e,s=null;var h="Size1-Regular";"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?a=l="⏐":"\\Downarrow"===e?a=l="‖":"\\updownarrow"===e?(a="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===e?(a="\\Uparrow",l="‖",c="\\Downarrow"):tw.has(e)?(l="∣",d="vert",u=333):nw.has(e)?(l="∥",d="doublevert",u=556):"["===e||"\\lbrack"===e?(a="⎡",l="⎢",c="⎣",h="Size4-Regular",d="lbrack",u=667):"]"===e||"\\rbrack"===e?(a="⎤",l="⎥",c="⎦",h="Size4-Regular",d="rbrack",u=667):"\\lfloor"===e||"⌊"===e?(l=a="⎢",c="⎣",h="Size4-Regular",d="lfloor",u=667):"\\lceil"===e||"⌈"===e?(a="⎡",l=c="⎢",h="Size4-Regular",d="lceil",u=667):"\\rfloor"===e||"⌋"===e?(l=a="⎥",c="⎦",h="Size4-Regular",d="rfloor",u=667):"\\rceil"===e||"⌉"===e?(a="⎤",l=c="⎥",h="Size4-Regular",d="rceil",u=667):"("===e||"\\lparen"===e?(a="⎛",l="⎜",c="⎝",h="Size4-Regular",d="lparen",u=875):")"===e||"\\rparen"===e?(a="⎞",l="⎟",c="⎠",h="Size4-Regular",d="rparen",u=875):"\\{"===e||"\\lbrace"===e?(a="⎧",s="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(a="⎫",s="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(a="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(a="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(a="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(a="⎫",c="⎩",l="⎪",h="Size4-Regular");var p=Zb(a,h,o),m=p.height+p.depth,f=Zb(l,h,o),g=f.height+f.depth,v=Zb(c,h,o),y=v.height+v.depth,b=0,w=1;if(null!==s){var x=Zb(s,h,o);b=x.height+x.depth,w=2}var k=m+y+b,C=k+Math.max(0,Math.ceil((t-k)/(w*g)))*w*g,_=r.fontMetrics().axisHeight;n&&(_*=r.sizeMultiplier);var S=C/2-_,A=[];if(d.length>0){var M=C-m-y,T=Math.round(1e3*C),E=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 v84 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(d,Math.round(1e3*M)),L=new vv(d,E),O=ov(u/1e3),I=ov(T/1e3),R=new gv([L],{width:O,height:I,viewBox:"0 0 "+u+" "+T}),P=Cy([],[R],r);P.height=T/1e3,P.style.width=O,P.style.height=I,A.push({type:"elem",elem:P})}else{if(A.push(Jb(c,h,o)),A.push(ew),null===s){var B=C-m-y+.016;A.push(Qb(l,B,r))}else{var z=(C-m-y-b)/2+.016;A.push(Qb(l,z,r)),A.push(ew),A.push(Jb(s,h,o)),A.push(ew),A.push(Qb(l,z,r))}A.push(ew),A.push(Jb(a,h,o))}var D=r.havingBaseStyle(Ug.TEXT),N=My({positionType:"bottom",positionData:S,children:A});return Xb(ky(["delimsizing","mult"],[N],D),Ug.TEXT,r,i)},ow=.08,iw=function(e,t,n,r,o){var i=function(e,t,n){t*=1e3;var r="";switch(e){case"sqrtMain":r=function(e){return"M95,"+(622+e+Yg)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize1":r=function(e){return"M263,"+(601+e+Yg)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize2":r=function(e){return"M983 "+(10+e+Yg)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" 80h400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize3":r=function(e){return"M424,"+(2398+e+Yg)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" 80\nh400000v"+(40+e)+"h-400000z"}(t);break;case"sqrtSize4":r=function(e){return"M473,"+(2713+e+Yg)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" 80h400000v"+(40+e)+"H1017.7z"}(t);break;case"sqrtTall":r=function(e,t,n){return"M702 "+(e+Yg)+"H400000"+(40+e)+"\nH742v"+(n-54-Yg-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 80H400000v"+(40+e)+"H742z"}(t,0,n)}return r}(e,r,n),a=new vv(e,i),s=new gv([a],{width:"400em",height:ov(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return Cy(["hide-tail"],[s],o)},aw=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),sw=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),lw=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),cw=[0,1.2,1.8,2.4,3],dw=function(e,t,n,r,o){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),aw.has(e)||lw.has(e))return Yb(e,t,!1,n,r,o);if(sw.has(e))return rw(e,cw[t],!1,n,r,o);throw new Ag("Illegal delimiter: '"+e+"'")},uw=[{type:"small",style:Ug.SCRIPTSCRIPT},{type:"small",style:Ug.SCRIPT},{type:"small",style:Ug.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],hw=[{type:"small",style:Ug.SCRIPTSCRIPT},{type:"small",style:Ug.SCRIPT},{type:"small",style:Ug.TEXT},{type:"stack"}],pw=[{type:"small",style:Ug.SCRIPTSCRIPT},{type:"small",style:Ug.SCRIPT},{type:"small",style:Ug.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],mw=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";var t=e.type;throw new Error("Add support for delim type '"+t+"' here.")},fw=function(e,t,n,r){for(var o=Math.min(2,3-r.style.size);o<n.length;o++){var i=n[o];if("stack"===i.type)break;var a=Zb(e,mw(i),"math"),s=a.height+a.depth;if("small"===i.type&&(s*=r.havingBaseStyle(i.style).sizeMultiplier),s>t)return i}return n[n.length-1]},gw=function(e,t,n,r,o,i){var a;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),a=lw.has(e)?uw:aw.has(e)?pw:hw;var s=fw(e,t,a,r);return"small"===s.type?function(e,t,n,r,o,i){var a=gy(e,"Main-Regular",o,r),s=Xb(a,t,r,i);return Kb(s,r,t),s}(e,s.style,0,r,o,i):"large"===s.type?Yb(e,s.size,n,r,o,i):rw(e,t,n,r,o,i)},vw=function(e,t,n,r,o,i){var a=r.fontMetrics().axisHeight*r.sizeMultiplier,s=5/r.fontMetrics().ptPerEm,l=Math.max(t-a,n+a),c=Math.max(l/500*901,2*l-s);return gw(e,c,!0,r,o,i)},yw={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},bw=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function ww(e){return"isMiddle"in e}function xw(e,t){var n=Pb(e);if(n&&bw.has(n.text))return n;throw new Ag(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function kw(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}jy({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],numArgs:1,argTypes:["primitive"],handler:(e,t)=>{var n=xw(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:yw[e.funcName].size,mclass:yw[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?ky([e.mclass]):dw(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(db(e.delim,e.mode));var n=new ib("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=ov(cw[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),jy({type:"leftright-right",names:["\\right"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&"string"!=typeof n)throw new Ag("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:xw(t[0],e).text,color:n}}}),jy({type:"leftright",names:["\\left"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=xw(t[0],e),r=e.parser;++r.leftrightDepth;var o=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var i=Ib(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:o,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,t)=>{kw(e);for(var n,r,o=Xy(e.body,t,!0,["mopen","mclose"]),i=0,a=0,s=!1,l=0;l<o.length;l++)ww(o[l])?s=!0:(i=Math.max(o[l].height,i),a=Math.max(o[l].depth,a));if(i*=t.sizeMultiplier,a*=t.sizeMultiplier,n="."===e.left?eb(t,["mopen"]):vw(e.left,i,a,t,e.mode,["mopen"]),o.unshift(n),s)for(var c=1;c<o.length;c++){var d=o[c];if(ww(d)){var u=d.isMiddle;o[c]=vw(u.delim,i,a,u.options,e.mode,[])}}if("."===e.right)r=eb(t,["mclose"]);else{var h=e.rightColor?t.withColor(e.rightColor):t;r=vw(e.right,i,a,h,e.mode,["mclose"])}return o.push(r),ky(["minner"],o,t)},mathmlBuilder:(e,t)=>{kw(e);var n=fb(e.body,t);if("."!==e.left){var r=new ib("mo",[db(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==e.right){var o=new ib("mo",[db(e.right,e.mode)]);o.setAttribute("fence","true"),e.rightColor&&o.setAttribute("mathcolor",e.rightColor),n.push(o)}return ub(n)}}),jy({type:"middle",names:["\\middle"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=xw(t[0],e);if(!e.parser.leftrightDepth)throw new Ag("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return"."===e.delim?n=eb(t,[]):(n=dw(e.delim,1,t,e.mode,[])).isMiddle={delim:e.delim,options:t},n},mathmlBuilder:(e,t)=>{var n="\\vert"===e.delim||"|"===e.delim?db("|","text"):db(e.delim,e.mode),r=new ib("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}}),jy({type:"enclose",names:["\\colorbox"],numArgs:2,allowedInText:!0,argTypes:["color","hbox"],handler(e,t,n){var{parser:r,funcName:o}=e,i=Ib(t[0],"color-token").color,a=t[1];return{type:"enclose",mode:r.mode,label:o,backgroundColor:i,body:a}},htmlBuilder:(e,t)=>{var n,r,o,i=Ay(tb(e.body,t),t),a=e.label.slice(1),s=t.sizeMultiplier,l=Pg(e.body);if("sout"===a)(n=ky(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/s,r=-.5*t.fontMetrics().xHeight;else if("phase"===a){var c=rv({number:.6,unit:"pt"},t),d=rv({number:.35,unit:"ex"},t);s/=t.havingBaseSizing().sizeMultiplier;var u=i.height+i.depth+c+d;i.style.paddingLeft=ov(u/2+c);var h=Math.floor(1e3*u*s),p=function(e){return"M400000 "+e+" H0 L"+e/2+" 0 l65 45 L145 "+(e-80)+" H400000z"}(h),m=new gv([new vv("phase",p)],{width:"400em",height:ov(h/1e3),viewBox:"0 0 400000 "+h,preserveAspectRatio:"xMinYMin slice"});(n=Cy(["hide-tail"],[m],t)).style.height=ov(u),r=i.depth+c+d}else{var f,g;/cancel/.test(a)?l||i.classes.push("cancel-pad"):"angl"===a?i.classes.push("anglpad"):i.classes.push("boxpad");var v=0;/box/.test(a)?(v=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),g=f=t.fontMetrics().fboxsep+("colorbox"===a?0:v)):"angl"===a?(f=4*(v=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness)),g=Math.max(0,.25-i.depth)):g=f=l?.2:0,n=function(e,t,n,r,o){var i,a=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(i=ky(["stretchy",t],[],o),"fbox"===t){var s=o.color&&o.getColor();s&&(i.style.borderColor=s)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new yv({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new yv({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new gv(l,{width:"100%",height:ov(a)});i=Cy([],[c],o)}return i.height=a,i.style.height=ov(a),i}(i,a,f,g,t),/fbox|boxed|fcolorbox/.test(a)?(n.style.borderStyle="solid",n.style.borderWidth=ov(v)):"angl"===a&&.049!==v&&(n.style.borderTopWidth=ov(v),n.style.borderRightWidth=ov(v)),r=i.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)o=My({positionType:"individualShift",children:[{type:"elem",elem:n,shift:r},{type:"elem",elem:i,shift:0}]});else{var y=/cancel|phase/.test(a)?["svg-align"]:[];o=My({positionType:"individualShift",children:[{type:"elem",elem:i,shift:0},{type:"elem",elem:n,shift:r,wrapperClasses:y}]})}return/cancel/.test(a)&&(o.height=i.height,o.depth=i.depth),/cancel/.test(a)&&!l?ky(["mord","cancel-lap"],[o],t):ky(["mord"],[o],t)},mathmlBuilder:(e,t)=>{var n,r=new ib(e.label.includes("colorbox")?"mpadded":"menclose",[vb(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var o=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+ov(o)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r}}),jy({type:"enclose",names:["\\fcolorbox"],numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"],handler(e,t,n){var{parser:r,funcName:o}=e,i=Ib(t[0],"color-token").color,a=Ib(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:r.mode,label:o,backgroundColor:a,borderColor:i,body:s}}}),jy({type:"enclose",names:["\\fbox"],numArgs:1,argTypes:["hbox"],allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}}),jy({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"enclose",mode:n.mode,label:r,body:o}}}),jy({type:"enclose",names:["\\sout"],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e;"math"===n.mode&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var o=t[0];return{type:"enclose",mode:n.mode,label:r,body:o}}}),jy({type:"enclose",names:["\\angl"],numArgs:1,argTypes:["hbox"],allowedInText:!1,handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var Cw={};function _w(e){for(var{type:t,names:n,props:r,handler:o,htmlBuilder:i,mathmlBuilder:a}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:o},l=0;l<n.length;++l)Cw[n[l]]=s;i&&(Hy[t]=i),a&&(qy[t]=a)}var Sw={};function Aw(e,t){Sw[e]=t}class Mw{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new Mw(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class Tw{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new Tw(t,Mw.range(this,e))}}function Ew(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for("\\relax"===n&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);"\\hline"===n||"\\hdashline"===n;)e.consume(),t.push("\\hdashline"===n),e.consumeSpaces(),n=e.fetch().text;return t}var Lw=e=>{if(!e.parser.settings.displayMode)throw new Ag("{"+e.envName+"} can be used only in display mode.")},Ow=new Set(["gather","gather*"]);function Iw(e){if(!e.includes("ed"))return!e.includes("*")}function Rw(e,t,n){var{hskipBeforeAndAfter:r,addJot:o,cols:i,arraystretch:a,colSeparationType:s,autoTag:l,singleRow:c,emptySingleRow:d,maxNumCols:u,leqno:h}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var p=e.gullet.expandMacroAsText("\\arraystretch");if(null==p)a=1;else if(!(a=parseFloat(p))||a<0)throw new Ag("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var m=[],f=[m],g=[],v=[],y=null!=l?[]:void 0;function b(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function w(){y&&(e.gullet.macros.get("\\df@tag")?(y.push(e.subparse([new Tw("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):y.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(b(),v.push(Ew(e));;){var x=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var k={type:"ordgroup",mode:e.mode,body:x};n&&(k={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[k]}),m.push(k);var C=e.fetch().text;if("&"===C){if(u&&m.length===u){if(c||s)throw new Ag("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===C){w(),1===m.length&&"styling"===k.type&&1===k.body.length&&"ordgroup"===k.body[0].type&&0===k.body[0].body.length&&(f.length>1||!d)&&f.pop(),v.length<f.length+1&&v.push([]);break}if("\\\\"!==C)throw new Ag("Expected & or \\\\ or \\cr or \\end",e.nextToken);e.consume();var _=void 0;" "!==e.gullet.future().text&&(_=e.parseSizeGroup(!0)),g.push(_?_.value:null),w(),v.push(Ew(e)),m=[],f.push(m),b()}}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:o,arraystretch:a,body:f,cols:i,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:v,colSeparationType:s,tags:y,leqno:h}}function Pw(e){return"d"===e.slice(0,1)?"display":"text"}var Bw=function(e,t){var n,r,o=e.body.length,i=e.hLinesBeforeRow,a=0,s=new Array(o),l=[],c=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),d=1/t.fontMetrics().ptPerEm,u=5*d;e.colSeparationType&&"small"===e.colSeparationType&&(u=t.havingStyle(Ug.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var h="CD"===e.colSeparationType?rv({number:3,unit:"ex"},t):12*d,p=3*d,m=e.arraystretch*h,f=.7*m,g=.3*m,v=0;function y(e){for(var t=0;t<e.length;++t)t>0&&(v+=.25),l.push({pos:v,isDashed:e[t]})}for(y(i[0]),n=0;n<e.body.length;++n){var b=e.body[n],w=f,x=g;a<b.length&&(a=b.length);var k={cells:new Array(b.length),height:0,depth:0,pos:0};for(r=0;r<b.length;++r){var C=tb(b[r],t);x<C.depth&&(x=C.depth),w<C.height&&(w=C.height),k.cells[r]=C}var _=e.rowGaps[n],S=0;_&&(S=rv(_,t))>0&&(x<(S+=g)&&(x=S),S=0),e.addJot&&n<e.body.length-1&&(x+=p),k.height=w,k.depth=x,v+=w,k.pos=v,v+=x+S,s[n]=k,y(i[n+1])}var A,M,T=v/2+t.fontMetrics().axisHeight,E=e.cols||[],L=[],O=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<o;++n){var I=s[n],R=I.pos-T,P=e.tags[n],B=void 0;(B=!0===P?ky(["eqn-num"],[],t):ky([],!1===P?[]:Xy(P,t,!0),t)).depth=I.depth,B.height=I.height,O.push({type:"elem",elem:B,shift:R})}for(r=0,M=0;r<a||M<E.length;++r,++M){for(var z,D=E[M],N=!0;"separator"===(null==(H=D)?void 0:H.type);){var H;if(N||((A=ky(["arraycolsep"],[])).style.width=ov(t.fontMetrics().doubleRuleSep),L.push(A)),"|"!==D.separator&&":"!==D.separator)throw new Ag("Invalid separator type: "+D.separator);var q="|"===D.separator?"solid":"dashed",j=ky(["vertical-separator"],[],t);j.style.height=ov(v),j.style.borderRightWidth=ov(c),j.style.borderRightStyle=q,j.style.margin="0 "+ov(-c/2);var V=v-T;V&&(j.style.verticalAlign=ov(-V)),L.push(j),D=E[++M],N=!1}if(!(r>=a)){var F,$,W=void 0;(r>0||e.hskipBeforeAndAfter)&&0!==(W=null!=(F=null==($=D)?void 0:$.pregap)?F:u)&&((A=ky(["arraycolsep"],[])).style.width=ov(W),L.push(A));var U=[];for(n=0;n<o;++n){var G=s[n],Z=G.cells[r];if(Z){var X=G.pos-T;Z.depth=G.depth,Z.height=G.height,U.push({type:"elem",elem:Z,shift:X})}}var K,Y,J=My({positionType:"individualShift",children:U}),Q=ky(["col-align-"+((null==(z=D)?void 0:z.align)||"c")],[J]);L.push(Q),(r<a-1||e.hskipBeforeAndAfter)&&0!==(W=null!=(K=null==(Y=D)?void 0:Y.postgap)?K:u)&&((A=ky(["arraycolsep"],[])).style.width=ov(W),L.push(A))}}var ee=ky(["mtable"],L);if(l.length>0){for(var te=_y("hline",t,c),ne=_y("hdashline",t,c),re=[{type:"elem",elem:ee,shift:0}];l.length>0;){var oe=l.pop(),ie=oe.pos-T;oe.isDashed?re.push({type:"elem",elem:ne,shift:ie}):re.push({type:"elem",elem:te,shift:ie})}ee=My({positionType:"individualShift",children:re})}if(0===O.length)return ky(["mord"],[ee],t);var ae=My({positionType:"individualShift",children:O}),se=ky(["tag"],[ae],t);return Sy([ee,se])},zw={c:"center ",l:"left ",r:"right "},Dw=function(e,t){for(var n=[],r=new ib("mtd",[],["mtr-glue"]),o=new ib("mtd",[],["mml-eqn-num"]),i=0;i<e.body.length;i++){for(var a=e.body[i],s=[],l=0;l<a.length;l++)s.push(new ib("mtd",[vb(a[l],t)]));e.tags&&e.tags[i]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(o):s.push(o)),n.push(new ib("mtr",s))}var c=new ib("mtable",n),d=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",ov(d));var u="",h="";if(e.cols&&e.cols.length>0){var p=e.cols,m="",f=!1,g=0,v=p.length;"separator"===p[0].type&&(u+="top ",g=1),"separator"===p[p.length-1].type&&(u+="bottom ",v-=1);for(var y=g;y<v;y++){var b=p[y];"align"===b.type?(h+=zw[b.align],f&&(m+="none "),f=!0):"separator"===b.type&&f&&(m+="|"===b.separator?"solid ":"dashed ",f=!1)}c.setAttribute("columnalign",h.trim()),/[sd]/.test(m)&&c.setAttribute("columnlines",m.trim())}if("align"===e.colSeparationType){for(var w=e.cols||[],x="",k=1;k<w.length;k++)x+=k%2?"0em ":"1em ";c.setAttribute("columnspacing",x.trim())}else"alignat"===e.colSeparationType||"gather"===e.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===e.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var C="",_=e.hLinesBeforeRow;u+=_[0].length>0?"left ":"",u+=_[_.length-1].length>0?"right ":"";for(var S=1;S<_.length-1;S++)C+=0===_[S].length?"none ":_[S][0]?"dashed ":"solid ";return/[sd]/.test(C)&&c.setAttribute("rowlines",C.trim()),""!==u&&(c=new ib("menclose",[c])).setAttribute("notation",u.trim()),e.arraystretch&&e.arraystretch<1&&(c=new ib("mstyle",[c])).setAttribute("scriptlevel","1"),c},Nw=function(e,t){e.envName.includes("ed")||Lw(e);var n=[],r="split"===e.envName,o=Rw(e.parser,{cols:n,addJot:!0,autoTag:r?void 0:Iw(e.envName),emptySingleRow:!0,colSeparationType:e.envName.includes("at")?"alignat":"align",maxNumCols:r?2:void 0,leqno:e.parser.settings.leqno},"display"),i=0,a=0,s={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var l="",c=0;c<t[0].body.length;c++)l+=Ib(t[0].body[c],"textord").text;i=Number(l),a=2*i}var d=!a;o.body.forEach(function(e){for(var t=1;t<e.length;t+=2){var n=Ib(e[t],"styling");Ib(n.body[0],"ordgroup").body.unshift(s)}if(d)a<e.length&&(a=e.length);else{var r=e.length/2;if(i<r)throw new Ag("Too many math in a row: expected "+i+", but got "+r,e[0])}});for(var u=0;u<a;++u){var h="r",p=0;u%2==1?h="l":u>0&&d&&(p=1),n[u]={type:"align",align:h,pregap:p,postgap:0}}return o.colSeparationType=d?"align":"alignat",o};_w({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(Pb(t[0])?[t[0]]:Ib(t[0],"ordgroup").body).map(function(e){var t=Rb(e).text;if("lcr".includes(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new Ag("Unknown column alignment: "+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return Rw(e.parser,r,Pw(e.envName))},htmlBuilder:Bw,mathmlBuilder:Dw}),_w({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===e.envName.charAt(e.envName.length-1)){var o=e.parser;if(o.consumeSpaces(),"["===o.fetch().text){if(o.consume(),o.consumeSpaces(),n=o.fetch().text,!"lcr".includes(n))throw new Ag("Expected l or c or r",o.nextToken);o.consume(),o.consumeSpaces(),o.expect("]"),o.consume(),r.cols=[{type:"align",align:n}]}}var i=Rw(e.parser,r,Pw(e.envName)),a=Math.max(0,...i.body.map(e=>e.length));return i.cols=new Array(a).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:Bw,mathmlBuilder:Dw}),_w({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=Rw(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:Bw,mathmlBuilder:Dw}),_w({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(Pb(t[0])?[t[0]]:Ib(t[0],"ordgroup").body).map(function(e){var t=Rb(e).text;if("lc".includes(t))return{type:"align",align:t};throw new Ag("Unknown column alignment: "+t,e)});if(n.length>1)throw new Ag("{subarray} can contain only one column");var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},o=Rw(e.parser,r,"script");if(o.body.length>0&&o.body[0].length>1)throw new Ag("{subarray} can contain only one column");return o},htmlBuilder:Bw,mathmlBuilder:Dw}),_w({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=Rw(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},Pw(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Bw,mathmlBuilder:Dw}),_w({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Nw,htmlBuilder:Bw,mathmlBuilder:Dw}),_w({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){Ow.has(e.envName)&&Lw(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Iw(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Rw(e.parser,t,"display")},htmlBuilder:Bw,mathmlBuilder:Dw}),_w({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Nw,htmlBuilder:Bw,mathmlBuilder:Dw}),_w({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Lw(e);var t={autoTag:Iw(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Rw(e.parser,t,"display")},htmlBuilder:Bw,mathmlBuilder:Dw}),_w({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(Lw(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===t[t.length-1].length&&t.pop();break}throw new Ag("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var r=[],o=[r],i=0;i<t.length;i++){for(var a=t[i],s=jb(),l=0;l<a.length;l++)if(Vb(a[l])){r.push(s);var c=Rb(a[l+=1]).text,d=new Array(2);if(d[0]={type:"ordgroup",mode:"math",body:[]},d[1]={type:"ordgroup",mode:"math",body:[]},"=|.".includes(c));else{if(!"<>AV".includes(c))throw new Ag('Expected one of "<>AV=|." after @',a[l]);for(var u=0;u<2;u++){for(var h=!0,p=l+1;p<a.length;p++){if(Fb(a[p],c)){h=!1,l=p;break}if(Vb(a[p]))throw new Ag("Missing a "+c+" character to complete a CD arrow.",a[p]);d[u].body.push(a[p])}if(h)throw new Ag("Missing a "+c+" character to complete a CD arrow.",a[l])}}var m={type:"styling",body:[$b(c,d,e)],mode:"math",style:"display",resetFont:!0};r.push(m),s=jb()}else s.body.push(a[l]);i%2==0?r.push(s):r.shift(),r=[],o.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:o,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(o[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(o.length+1).fill([])}}(e.parser)),htmlBuilder:Bw,mathmlBuilder:Dw}),Aw("\\nonumber","\\gdef\\@eqnsw{0}"),Aw("\\notag","\\nonumber"),jy({type:"text",names:["\\hline","\\hdashline"],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(e,t){throw new Ag(e.funcName+" valid only within array environment")}});var Hw=Cw;jy({type:"environment",names:["\\begin","\\end"],numArgs:1,argTypes:["text"],handler(e,t){var{parser:n,funcName:r}=e,o=t[0];if("ordgroup"!==o.type)throw new Ag("Invalid environment name",o);for(var i="",a=0;a<o.body.length;++a)i+=Ib(o.body[a],"textord").text;if("\\begin"===r){if(!Hw.hasOwnProperty(i))throw new Ag("No such environment: "+i,o);var s=Hw[i],{args:l,optArgs:c}=n.parseArguments("\\begin{"+i+"}",s),d={mode:n.mode,envName:i,parser:n},u=s.handler(d,l,c);n.expect("\\end",!1);var h=n.nextToken,p=Ib(n.parseFunction(),"environment");if(p.name!==i)throw new Ag("Mismatch: \\begin{"+i+"} matched by \\end{"+p.name+"}",h);return u}return{type:"environment",mode:n.mode,name:i,nameGroup:o}}});var qw={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};jy({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],numArgs:1,allowedInArgument:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,o=Fy(t[0]),i=r in qw?qw[r]:r;return{type:"font",mode:n.mode,font:i.slice(1),body:o}},htmlBuilder:(e,t)=>{var n=e.font,r=t.withFont(n);return tb(e.body,r)},mathmlBuilder:(e,t)=>{var n=e.font,r=t.withFont(n);return vb(e.body,r)}}),jy({type:"mclass",names:["\\boldsymbol","\\bm"],numArgs:1,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"mclass",mode:n.mode,mclass:Hb(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:Pg(r)}}}),jy({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],numArgs:0,allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:o}=e,{mode:i}=n,a=n.parseExpression(!0,o);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:a}}}});var jw=(e,t)=>t?{type:"styling",mode:e.mode,style:t,body:[e]}:e;jy({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],numArgs:2,allowedInArgument:!0,handler:(e,t)=>{var n,{parser:r,funcName:o}=e,i=t[0],a=t[1],s=null,l=null;switch(o){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,s="(",l=")";break;case"\\\\bracefrac":n=!1,s="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,s="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}var c="\\cfrac"===o,d=null;return c||o.startsWith("\\d")?d="display":o.startsWith("\\t")&&(d="text"),jw({type:"genfrac",mode:r.mode,numer:i,denom:a,continued:c,hasBarLine:n,leftDelim:s,rightDelim:l,barSize:null},d)},htmlBuilder:(e,t)=>{var n,r=t.style,o=r.fracNum(),i=r.fracDen();n=t.havingStyle(o);var a=tb(e.numer,n,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;a.height=a.height<s?s:a.height,a.depth=a.depth<l?l:a.depth}n=t.havingStyle(i);var c,d,u,h,p,m,f,g,v,y,b=tb(e.denom,n,t);if(e.hasBarLine?(e.barSize?(d=rv(e.barSize,t),c=_y("frac-line",t,d)):c=_y("frac-line",t),d=c.height,u=c.height):(c=null,d=0,u=t.fontMetrics().defaultRuleThickness),r.size===Ug.DISPLAY.size?(h=t.fontMetrics().num1,p=d>0?3*u:7*u,m=t.fontMetrics().denom1):(d>0?(h=t.fontMetrics().num2,p=u):(h=t.fontMetrics().num3,p=3*u),m=t.fontMetrics().denom2),c){var w=t.fontMetrics().axisHeight;h-a.depth-(w+.5*d)<p&&(h+=p-(h-a.depth-(w+.5*d))),w-.5*d-(b.height-m)<p&&(m+=p-(w-.5*d-(b.height-m))),f=My({positionType:"individualShift",children:[{type:"elem",elem:b,shift:m},{type:"elem",elem:c,shift:-(w-.5*d)},{type:"elem",elem:a,shift:-h}]})}else{var x=h-a.depth-(b.height-m);x<p&&(h+=.5*(p-x),m+=.5*(p-x)),f=My({positionType:"individualShift",children:[{type:"elem",elem:b,shift:m},{type:"elem",elem:a,shift:-h}]})}return n=t.havingStyle(r),f.height*=n.sizeMultiplier/t.sizeMultiplier,f.depth*=n.sizeMultiplier/t.sizeMultiplier,g=r.size===Ug.DISPLAY.size?t.fontMetrics().delim1:r.size===Ug.SCRIPTSCRIPT.size?t.havingStyle(Ug.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,v=null==e.leftDelim?eb(t,["mopen"]):gw(e.leftDelim,g,!0,t.havingStyle(r),e.mode,["mopen"]),y=e.continued?ky([]):null==e.rightDelim?eb(t,["mclose"]):gw(e.rightDelim,g,!0,t.havingStyle(r),e.mode,["mclose"]),ky(["mord"].concat(n.sizingClasses(t)),[v,ky(["mfrac"],[f]),y],t)},mathmlBuilder:(e,t)=>{var n=new ib("mfrac",[vb(e.numer,t),vb(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var r=rv(e.barSize,t);n.setAttribute("linethickness",ov(r))}}else n.setAttribute("linethickness","0px");if(null!=e.leftDelim||null!=e.rightDelim){var o=[];if(null!=e.leftDelim){var i=new ib("mo",[new ab(e.leftDelim.replace("\\",""))]);i.setAttribute("fence","true"),o.push(i)}if(o.push(n),null!=e.rightDelim){var a=new ib("mo",[new ab(e.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}return ub(o)}return n}}),jy({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],numArgs:0,infix:!0,handler(e){var t,{parser:n,funcName:r,token:o}=e;switch(r){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:o}}});var Vw=["display","text","script","scriptscript"],Fw=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};jy({type:"genfrac",names:["\\genfrac"],numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"],handler(e,t){var n,{parser:r}=e,o=t[4],i=t[5],a=Fy(t[0]),s="atom"===a.type&&"open"===a.family?Fw(a.text):null,l=Fy(t[1]),c="atom"===l.type&&"close"===l.family?Fw(l.text):null,d=Ib(t[2],"size"),u=null;n=!!d.isBlank||(u=d.value).number>0;var h=null,p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var m=Ib(p.body[0],"textord");h=Vw[Number(m.text)]}}else p=Ib(p,"textord"),h=Vw[Number(p.text)];return jw({type:"genfrac",mode:r.mode,numer:o,denom:i,continued:!1,hasBarLine:n,barSize:u,leftDelim:s,rightDelim:c},h)}}),jy({type:"infix",names:["\\above"],numArgs:1,argTypes:["size"],infix:!0,handler(e,t){var{parser:n,funcName:r,token:o}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Ib(t[0],"size").value,token:o}}}),jy({type:"genfrac",names:["\\\\abovefrac"],numArgs:3,argTypes:["math","size","math"],handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0],i=Ib(t[1],"infix").size;if(!i)throw new Error("\\\\abovefrac expected size, but got "+String(i));var a=t[2],s=i.number>0;return{type:"genfrac",mode:n.mode,numer:o,denom:a,continued:!1,hasBarLine:s,barSize:i,leftDelim:null,rightDelim:null}}});var $w=(e,t)=>{var n,r,o=t.style;"supsub"===e.type?(n=e.sup?tb(e.sup,t.havingStyle(o.sup()),t):tb(e.sub,t.havingStyle(o.sub()),t),r=Ib(e.base,"horizBrace")):r=Ib(e,"horizBrace");var i,a=tb(r.base,t.havingBaseStyle(Ug.DISPLAY)),s=Eb(r,t);if(i=r.isOver?My({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):My({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:a}]}),n){var l=ky(["minner",r.isOver?"mover":"munder"],[i],t);i=r.isOver?My({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]}):My({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]})}return ky(["minner",r.isOver?"mover":"munder"],[i],t)};jy({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:t[0]}},htmlBuilder:$w,mathmlBuilder:(e,t)=>{var n=Ab(e.label);return new ib(e.isOver?"mover":"munder",[vb(e.base,t),n])}}),jy({type:"href",names:["\\href"],numArgs:2,argTypes:["url","original"],allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[1],o=Ib(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:o})?{type:"href",mode:n.mode,href:o,body:$y(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=Xy(e.body,t,!1);return function(e,t,n,r){var o=new hv(e,[],n,r);return xy(o),o}(e.href,0,n,t)},mathmlBuilder:(e,t)=>{var n=gb(e.body,t);return n instanceof ib||(n=new ib("mrow",[n])),n.setAttribute("href",e.href),n}}),jy({type:"href",names:["\\url"],numArgs:1,argTypes:["url"],allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=Ib(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var o=[],i=0;i<r.length;i++){var a=r[i];"~"===a&&(a="\\textasciitilde"),o.push({type:"textord",mode:"text",text:a})}var s={type:"text",mode:n.mode,font:"\\texttt",body:o};return{type:"href",mode:n.mode,href:r,body:$y(s)}}}),jy({type:"hbox",names:["\\hbox"],numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0,handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:$y(t[0])}},htmlBuilder(e,t){var n=Xy(e.body,t.withFont(""),!1);return Sy(n)},mathmlBuilder:(e,t)=>new ib("mrow",fb(e.body,t.withFont("")))}),jy({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],numArgs:2,argTypes:["raw","original"],allowedInText:!0,handler:(e,t)=>{var n,{parser:r,funcName:o,token:i}=e,a=Ib(t[0],"raw").string,s=t[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(o){case"\\htmlClass":l.class=a,n={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,n={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,n={command:"\\htmlStyle",style:a};break;case"\\htmlData":for(var c=a.split(","),d=0;d<c.length;d++){var u=c[d],h=u.indexOf("=");if(h<0)throw new Ag("\\htmlData key/value '"+u+"' missing equals sign");var p=u.slice(0,h),m=u.slice(h+1);l["data-"+p.trim()]=m}n={command:"\\htmlData",attributes:l};break;default:throw new Error("Unrecognized html command")}return r.settings.isTrusted(n)?{type:"html",mode:r.mode,attributes:l,body:$y(s)}:r.formatUnsupportedCmd(o)},htmlBuilder:(e,t)=>{var n=Xy(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var o=ky(r,n,t);for(var i in e.attributes)"class"!==i&&e.attributes.hasOwnProperty(i)&&o.setAttribute(i,e.attributes[i]);return o},mathmlBuilder:(e,t)=>gb(e.body,t)}),jy({type:"htmlmathml",names:["\\html@mathml"],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:$y(t[0]),mathml:$y(t[1])}},htmlBuilder:(e,t)=>{var n=Xy(e.html,t,!1);return Sy(n)},mathmlBuilder:(e,t)=>gb(e.mathml,t)});var Ww=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new Ag("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!nv(n))throw new Ag("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};jy({type:"includegraphics",names:["\\includegraphics"],numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1,handler:(e,t,n)=>{var{parser:r}=e,o={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},s="";if(n[0])for(var l=Ib(n[0],"raw").string.split(","),c=0;c<l.length;c++){var d=l[c].split("=");if(2===d.length){var u=d[1].trim();switch(d[0].trim()){case"alt":s=u;break;case"width":o=Ww(u);break;case"height":i=Ww(u);break;case"totalheight":a=Ww(u);break;default:throw new Ag("Invalid key: '"+d[0]+"' in \\includegraphics.")}}}var h=Ib(t[0],"url").url;return""===s&&(s=(s=(s=h).replace(/^.*[\\/]/,"")).substring(0,s.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:h})?{type:"includegraphics",mode:r.mode,alt:s,width:o,height:i,totalheight:a,src:h}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=rv(e.height,t),r=0;e.totalheight.number>0&&(r=rv(e.totalheight,t)-n);var o=0;e.width.number>0&&(o=rv(e.width,t));var i={height:ov(n+r)};o>0&&(i.width=ov(o)),r>0&&(i.verticalAlign=ov(-r));var a=new pv(e.src,e.alt,i);return a.height=n,a.depth=r,a},mathmlBuilder:(e,t)=>{var n=new ib("mglyph",[]);n.setAttribute("alt",e.alt);var r=rv(e.height,t),o=0;if(e.totalheight.number>0&&(o=rv(e.totalheight,t)-r,n.setAttribute("valign",ov(-o))),n.setAttribute("height",ov(r+o)),e.width.number>0){var i=rv(e.width,t);n.setAttribute("width",ov(i))}return n.setAttribute("src",e.src),n}}),jy({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e,o=Ib(t[0],"size");if(n.settings.strict){var i="m"===r[1],a="mu"===o.value.unit;i?(a||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, not "+o.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:o.value}},htmlBuilder:(e,t)=>Ty(e.dimension,t),mathmlBuilder(e,t){var n=rv(e.dimension,t);return new sb(n)}}),jy({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:o}},htmlBuilder:(e,t)=>{var n;"clap"===e.alignment?(n=ky([],[tb(e.body,t)]),n=ky(["inner"],[n],t)):n=ky(["inner"],[tb(e.body,t)]);var r=ky(["fix"],[]),o=ky([e.alignment],[n,r],t),i=ky(["strut"]);return i.style.height=ov(o.height+o.depth),o.depth&&(i.style.verticalAlign=ov(-o.depth)),o.children.unshift(i),o=ky(["thinbox"],[o],t),ky(["mord","vbox"],[o],t)},mathmlBuilder:(e,t)=>{var n=new ib("mpadded",[vb(e.body,t)]);if("rlap"!==e.alignment){var r="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}}),jy({type:"styling",names:["\\(","$"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){var{funcName:n,parser:r}=e,o=r.mode;r.switchMode("math");var i="\\("===n?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(o),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:a}}}),jy({type:"text",names:["\\)","\\]"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){throw new Ag("Mismatched "+e.funcName)}});var Uw=(e,t)=>{switch(t.style.size){case Ug.DISPLAY.size:return e.display;case Ug.TEXT.size:return e.text;case Ug.SCRIPT.size:return e.script;case Ug.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};jy({type:"mathchoice",names:["\\mathchoice"],numArgs:4,primitive:!0,handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:$y(t[0]),text:$y(t[1]),script:$y(t[2]),scriptscript:$y(t[3])}},htmlBuilder:(e,t)=>{var n=Uw(e,t),r=Xy(n,t,!1);return Sy(r)},mathmlBuilder:(e,t)=>{var n=Uw(e,t);return gb(n,t)}});var Gw=(e,t,n,r,o,i,a)=>{e=ky([],[e]);var s,l,c,d=n&&Pg(n);if(t){var u=tb(t,r.havingStyle(o.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var h=tb(n,r.havingStyle(o.sub()),r);s={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-h.height)}}if(l&&s){var p=r.fontMetrics().bigOpSpacing5+s.elem.height+s.elem.depth+s.kern+e.depth+a;c=My({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:ov(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:ov(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}else if(s){var m=e.height-a;c=My({positionType:"top",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:ov(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e}]})}else{if(!l)return e;var f=e.depth+a;c=My({positionType:"bottom",positionData:f,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:ov(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}var g=[c];if(s&&0!==i&&!d){var v=ky(["mspace"],[],r);v.style.marginRight=ov(i),g.unshift(v)}return ky(["mop","op-limits"],g,r)},Zw=new Set(["\\smallint"]),Xw=(e,t)=>{var n,r,o,i=!1;"supsub"===e.type?(n=e.sup,r=e.sub,o=Ib(e.base,"op"),i=!0):o=Ib(e,"op");var a,s,l=t.style,c=!1;if(l.size===Ug.DISPLAY.size&&o.symbol&&!Zw.has(o.name)&&(c=!0),o.symbol){var d=c?"Size2-Regular":"Size1-Regular",u="";if("\\oiint"!==o.name&&"\\oiiint"!==o.name||(u=o.name.slice(1),o.name="oiint"===u?"\\iint":"\\iiint"),s=(a=gy(o.name,d,"math",t,["mop","op-symbol",c?"large-op":"small-op"])).italic,u.length>0){var h=Iy(u+"Size"+(c?"2":"1"),t);a=My({positionType:"individualShift",children:[{type:"elem",elem:a,shift:0},{type:"elem",elem:h,shift:c?.08:0}]}),o.name="\\"+u,a.classes.unshift("mop"),a.italic=s}}else if(o.body){var p=Xy(o.body,t,!0);1===p.length&&p[0]instanceof fv?(a=p[0]).classes[0]="mop":a=ky(["mop"],p,t)}else{for(var m=[],f=1;f<o.name.length;f++)m.push(vy(o.name[f],o.mode,t));a=ky(["mop"],m,t)}var g,v=0,y=0;return(a instanceof fv||"\\oiint"===o.name||"\\oiiint"===o.name)&&!o.suppressBaseShift&&(v=(a.height-a.depth)/2-t.fontMetrics().axisHeight,y=null!=(g=a.italic)?g:0),i?Gw(a,n,r,t,l,y,v):(v&&(a.style.position="relative",a.style.top=ov(v)),a)},Kw={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};jy({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],numArgs:0,handler:(e,t)=>{var{parser:n,funcName:r}=e,o=r;return 1===o.length&&(o=Kw[o]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:o}},htmlBuilder:Xw,mathmlBuilder:(e,t)=>{var n;if(e.symbol)n=new ib("mo",[db(e.name,e.mode)]),Zw.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new ib("mo",fb(e.body,t));else{n=new ib("mi",[new ab(e.name.slice(1))]);var r=new ib("mo",[db("","text")]);n=e.parentIsSupSub?new ib("mrow",[n,r]):ob([n,r])}return n}}),jy({type:"op",names:["\\mathop"],numArgs:1,primitive:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:$y(r)}}});var Yw={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};jy({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],numArgs:0,handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}}}),jy({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],numArgs:0,handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}}}),jy({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],numArgs:0,allowedInArgument:!0,handler(e){var{parser:t,funcName:n}=e,r=n;return 1===r.length&&(r=Yw[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}}});var Jw=(e,t)=>{var n,r,o,i,a=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,o=Ib(e.base,"operatorname"),a=!0):o=Ib(e,"operatorname"),o.body.length>0){for(var s=(o.body.map(e=>{var t="text"in e?e.text:void 0;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e})),l=Xy(s,t.withFont("mathrm"),!0),c=0;c<l.length;c++){var d=l[c];d instanceof fv&&(d.text=d.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}i=ky(["mop"],l,t)}else i=ky(["mop"],[],t);return a?Gw(i,n,r,t,t.style,0,0):i};function Qw(e,t,n){for(var r=Xy(e,t,!1),o=t.sizeMultiplier/n.sizeMultiplier,i=0;i<r.length;i++){var a=r[i].classes.indexOf("sizing");a<0?Array.prototype.push.apply(r[i].classes,t.sizingClasses(n)):r[i].classes[a+1]==="reset-size"+t.size&&(r[i].classes[a+1]="reset-size"+n.size),r[i].height*=o,r[i].depth*=o}return Sy(r)}jy({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],numArgs:1,handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"operatorname",mode:n.mode,body:$y(o),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:Jw,mathmlBuilder:(e,t)=>{for(var n=fb(e.body,t.withFont("mathrm")),r=!0,o=0;o<n.length;o++){var i=n[o];if(i instanceof sb);else if(i instanceof ib)switch(i.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":var a=i.children[0];1===i.children.length&&a instanceof ab?a.text=a.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break;default:r=!1}else r=!1}if(r){var s=n.map(e=>e.toText()).join("");n=[new ab(s)]}var l=new ib("mi",n);l.setAttribute("mathvariant","normal");var c=new ib("mo",[db("","text")]);return e.parentIsSupSub?new ib("mrow",[l,c]):ob([l,c])}}),Aw("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),Vy({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?Sy(Xy(e.body,t,!1)):ky(["mord"],Xy(e.body,t,!0),t),mathmlBuilder:(e,t)=>gb(e.body,t,!0)}),jy({type:"overline",names:["\\overline"],numArgs:1,handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=tb(e.body,t.havingCrampedStyle()),r=_y("overline-line",t),o=t.fontMetrics().defaultRuleThickness,i=My({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r},{type:"kern",size:o}]});return ky(["mord","overline"],[i],t)},mathmlBuilder(e,t){var n=new ib("mo",[new ab("‾")]);n.setAttribute("stretchy","true");var r=new ib("mover",[vb(e.body,t),n]);return r.setAttribute("accent","true"),r}}),jy({type:"phantom",names:["\\phantom"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:$y(r)}},htmlBuilder:(e,t)=>{var n=Xy(e.body,t.withPhantom(),!1);return Sy(n)},mathmlBuilder:(e,t)=>{var n=fb(e.body,t);return new ib("mphantom",n)}}),Aw("\\hphantom","\\smash{\\phantom{#1}}"),jy({type:"vphantom",names:["\\vphantom"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=ky(["inner"],[tb(e.body,t.withPhantom())]),r=ky(["fix"],[]);return ky(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=fb($y(e.body),t),r=new ib("mphantom",n),o=new ib("mpadded",[r]);return o.setAttribute("width","0px"),o}}),jy({type:"raisebox",names:["\\raisebox"],numArgs:2,argTypes:["size","hbox"],allowedInText:!0,handler(e,t){var{parser:n}=e,r=Ib(t[0],"size").value,o=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:o}},htmlBuilder(e,t){var n=tb(e.body,t),r=rv(e.dy,t);return My({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new ib("mpadded",[vb(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),jy({type:"internal",names:["\\relax"],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),jy({type:"rule",names:["\\rule"],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"],handler(e,t,n){var{parser:r}=e,o=n[0],i=Ib(t[0],"size"),a=Ib(t[1],"size");return{type:"rule",mode:r.mode,shift:o&&Ib(o,"size").value,width:i.value,height:a.value}},htmlBuilder(e,t){var n=ky(["mord","rule"],[],t),r=rv(e.width,t),o=rv(e.height,t),i=e.shift?rv(e.shift,t):0;return n.style.borderRightWidth=ov(r),n.style.borderTopWidth=ov(o),n.style.bottom=ov(i),n.width=r,n.height=o+i,n.depth=-i,n.maxFontSize=1.125*o*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=rv(e.width,t),r=rv(e.height,t),o=e.shift?rv(e.shift,t):0,i=t.color&&t.getColor()||"black",a=new ib("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",ov(n)),a.setAttribute("height",ov(r));var s=new ib("mpadded",[a]);return o>=0?s.setAttribute("height",ov(o)):(s.setAttribute("height",ov(o)),s.setAttribute("depth",ov(-o))),s.setAttribute("voffset",ov(o)),s}});var ex=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];jy({type:"sizing",names:ex,numArgs:0,allowedInText:!0,handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:o}=e,i=o.parseExpression(!1,n);return{type:"sizing",mode:o.mode,size:ex.indexOf(r)+1,body:i}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return Qw(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=fb(e.body,n),o=new ib("mstyle",r);return o.setAttribute("mathsize",ov(n.sizeMultiplier)),o}}),jy({type:"smash",names:["\\smash"],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(e,t,n)=>{var{parser:r}=e,o=!1,i=!1,a=n[0]&&Ib(n[0],"ordgroup");if(a)for(var s,l=0;l<a.body.length;++l)if("t"===(s=Rb(a.body[l]).text))o=!0;else{if("b"!==s){o=!1,i=!1;break}i=!0}else o=!0,i=!0;var c=t[0];return{type:"smash",mode:r.mode,body:c,smashHeight:o,smashDepth:i}},htmlBuilder:(e,t)=>{var n=ky([],[tb(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return ky(["mord","smash"],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);var o=My({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return ky(["mord"],[o],t)},mathmlBuilder:(e,t)=>{var n=new ib("mpadded",[vb(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),jy({type:"sqrt",names:["\\sqrt"],numArgs:1,numOptionalArgs:1,handler(e,t,n){var{parser:r}=e,o=n[0],i=t[0];return{type:"sqrt",mode:r.mode,body:i,index:o}},htmlBuilder(e,t){var n=tb(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=Ay(n,t);var r=t.fontMetrics().defaultRuleThickness,o=r;t.style.id<Ug.TEXT.id&&(o=t.fontMetrics().xHeight);var i=r+o/4,a=n.height+n.depth+i+r,{span:s,ruleWidth:l,advanceWidth:c}=function(e,t){var n,r,o,i,a,s=t.havingBaseSizing(),l=fw("\\surd",e*s.sizeMultiplier,pw,s),c=s.sizeMultiplier,d=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness);return"small"===l.type?(e<1?c=1:e<1.4&&(c=.7),o=(1+d)/c,(n=iw("sqrtMain",r=(1+d+ow)/c,i=1e3+1e3*d+80,d,t)).style.minWidth="0.853em",a=.833/c):"large"===l.type?(i=1080*cw[l.size],o=(cw[l.size]+d)/c,r=(cw[l.size]+d+ow)/c,(n=iw("sqrtSize"+l.size,r,i,d,t)).style.minWidth="1.02em",a=1/c):(r=e+d+ow,o=e+d,i=Math.floor(1e3*e+d)+80,(n=iw("sqrtTall",r,i,d,t)).style.minWidth="0.742em",a=1.056),n.height=o,n.style.height=ov(r),{span:n,advanceWidth:a,ruleWidth:(t.fontMetrics().sqrtRuleThickness+d)*c}}(a,t),d=s.height-l;d>n.height+n.depth+i&&(i=(i+d-n.height-n.depth)/2);var u=s.height-n.height-i-l;n.style.paddingLeft=ov(c);var h=My({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+u)},{type:"elem",elem:s},{type:"kern",size:l}]});if(e.index){var p=t.havingStyle(Ug.SCRIPTSCRIPT),m=tb(e.index,p,t),f=.6*(h.height-h.depth),g=My({positionType:"shift",positionData:-f,children:[{type:"elem",elem:m}]}),v=ky(["root"],[g]);return ky(["mord","sqrt"],[v,h],t)}return ky(["mord","sqrt"],[h],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new ib("mroot",[vb(n,t),vb(r,t)]):new ib("msqrt",[vb(n,t)])}});var tx={display:Ug.DISPLAY,text:Ug.TEXT,script:Ug.SCRIPT,scriptscript:Ug.SCRIPTSCRIPT};jy({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],numArgs:0,allowedInText:!0,primitive:!0,handler(e,t){var{breakOnTokenText:n,funcName:r,parser:o}=e,i=o.parseExpression(!0,n),a=r.slice(1,r.length-5);if(!function(e){return e in tx}(a))throw new Error("Unknown style: "+a);return{type:"styling",mode:o.mode,style:a,body:i}},htmlBuilder(e,t){var n=tx[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont("")),Qw(e.body,r,t)},mathmlBuilder(e,t){var n=tx[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(""));var o=fb(e.body,r),i=new ib("mstyle",o),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return i.setAttribute("scriptlevel",a[0]),i.setAttribute("displaystyle",a[1]),i}}),Vy({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base;return n?"op"===n.type?n.limits&&(t.style.size===Ug.DISPLAY.size||n.alwaysHandleSupSub)?Xw:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===Ug.DISPLAY.size||n.limits)?Jw:null:"accent"===n.type?Pg(n.base)?zb:null:"horizBrace"===n.type&&!e.sub===n.isOver?$w:null:null}(e,t);if(n)return n(e,t);var r,o,i,{base:a,sup:s,sub:l}=e,c=tb(a,t),d=t.fontMetrics(),u=0,h=0,p=a&&Pg(a);if(s){var m=t.havingStyle(t.style.sup());r=tb(s,m,t),p||(u=c.height-m.fontMetrics().supDrop*m.sizeMultiplier/t.sizeMultiplier)}if(l){var f=t.havingStyle(t.style.sub());o=tb(l,f,t),p||(h=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/t.sizeMultiplier)}i=t.style===Ug.DISPLAY?d.sup1:t.style.cramped?d.sup3:d.sup2;var g,v=t.sizeMultiplier,y=ov(.5/d.ptPerEm/v),b=null;if(o){var w,x=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof fv||x)&&(b=ov(-(null!=(w=c.italic)?w:0)))}if(r&&o){u=Math.max(u,i,r.depth+.25*d.xHeight),h=Math.max(h,d.sub2);var k=4*d.defaultRuleThickness;if(u-r.depth-(o.height-h)<k){h=k-(u-r.depth)+o.height;var C=.8*d.xHeight-(u-r.depth);C>0&&(u+=C,h-=C)}g=My({positionType:"individualShift",children:[{type:"elem",elem:o,shift:h,marginRight:y,marginLeft:b},{type:"elem",elem:r,shift:-u,marginRight:y}]})}else if(o)h=Math.max(h,d.sub1,o.height-.8*d.xHeight),g=My({positionType:"shift",positionData:h,children:[{type:"elem",elem:o,marginLeft:b,marginRight:y}]});else{if(!r)throw new Error("supsub must have either sup or sub.");u=Math.max(u,i,r.depth+.25*d.xHeight),g=My({positionType:"shift",positionData:-u,children:[{type:"elem",elem:r,marginRight:y}]})}var _=Qy(c,"right")||"mord";return ky([_],[c,ky(["msupsub"],[g])],t)},mathmlBuilder(e,t){var n,r=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(r=!0,n=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var o,i=[vb(e.base,t)];if(e.sub&&i.push(vb(e.sub,t)),e.sup&&i.push(vb(e.sup,t)),r)o=n?"mover":"munder";else if(e.sub)if(e.sup){var a=e.base;o=a&&"op"===a.type&&a.limits&&t.style===Ug.DISPLAY||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(t.style===Ug.DISPLAY||a.limits)?"munderover":"msubsup"}else{var s=e.base;o=s&&"op"===s.type&&s.limits&&(t.style===Ug.DISPLAY||s.alwaysHandleSupSub)||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(s.limits||t.style===Ug.DISPLAY)?"munder":"msub"}else{var l=e.base;o=l&&"op"===l.type&&l.limits&&(t.style===Ug.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===Ug.DISPLAY)?"mover":"msup"}return new ib(o,i)}}),Vy({type:"atom",htmlBuilder:(e,t)=>vy(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new ib("mo",[db(e.text,e.mode)]);if("bin"===e.family){var r=pb(e,t);"bold-italic"===r&&n.setAttribute("mathvariant",r)}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var nx={mi:"italic",mn:"normal",mtext:"normal"};Vy({type:"mathord",htmlBuilder:(e,t)=>yy(e,t),mathmlBuilder(e,t){var n=new ib("mi",[db(e.text,e.mode,t)]),r=pb(e,t)||"italic";return r!==nx[n.type]&&n.setAttribute("mathvariant",r),n}}),Vy({type:"textord",htmlBuilder:(e,t)=>yy(e,t),mathmlBuilder(e,t){var n,r=db(e.text,e.mode,t),o=pb(e,t)||"normal";return n="text"===e.mode?new ib("mtext",[r]):/[0-9]/.test(e.text)?new ib("mn",[r]):"\\prime"===e.text?new ib("mo",[r]):new ib("mi",[r]),o!==nx[n.type]&&n.setAttribute("mathvariant",o),n}});var rx={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},ox={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Vy({type:"spacing",htmlBuilder(e,t){if(ox.hasOwnProperty(e.text)){var n=ox[e.text].className||"";if("text"===e.mode){var r=yy(e,t);return r.classes.push(n),r}return ky(["mspace",n],[vy(e.text,e.mode,t)],t)}if(rx.hasOwnProperty(e.text))return ky(["mspace",rx[e.text]],[],t);throw new Ag('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!ox.hasOwnProperty(e.text)){if(rx.hasOwnProperty(e.text))return new ib("mspace");throw new Ag('Unknown type of space "'+e.text+'"')}return new ib("mtext",[new ab(" ")])}});var ix=()=>{var e=new ib("mtd",[]);return e.setAttribute("width","50%"),e};Vy({type:"tag",mathmlBuilder(e,t){var n=new ib("mtable",[new ib("mtr",[ix(),new ib("mtd",[gb(e.body,t)]),ix(),new ib("mtd",[gb(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var ax={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},sx={"\\textbf":"textbf","\\textmd":"textmd"},lx={"\\textit":"textit","\\textup":"textup"},cx=(e,t)=>{var n=e.font;return n?ax[n]?t.withTextFontFamily(ax[n]):sx[n]?t.withTextFontWeight(sx[n]):"\\emph"===n?"textit"===t.fontShape?t.withTextFontShape("textup"):t.withTextFontShape("textit"):t.withTextFontShape(lx[n]):t};jy({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"text",mode:n.mode,body:$y(o),font:r}},htmlBuilder(e,t){var n=cx(e,t),r=Xy(e.body,n,!0);return ky(["mord","text"],r,n)},mathmlBuilder(e,t){var n=cx(e,t);return gb(e.body,n)}}),jy({type:"underline",names:["\\underline"],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=tb(e.body,t),r=_y("underline-line",t),o=t.fontMetrics().defaultRuleThickness,i=My({positionType:"top",positionData:n.height,children:[{type:"kern",size:o},{type:"elem",elem:r},{type:"kern",size:3*o},{type:"elem",elem:n}]});return ky(["mord","underline"],[i],t)},mathmlBuilder(e,t){var n=new ib("mo",[new ab("‾")]);n.setAttribute("stretchy","true");var r=new ib("munder",[vb(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),jy({type:"vcenter",names:["\\vcenter"],numArgs:1,argTypes:["original"],allowedInText:!1,handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=tb(e.body,t),r=t.fontMetrics().axisHeight,o=.5*(n.height-r-(n.depth+r));return My({positionType:"shift",positionData:o,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new ib("mpadded",[vb(e.body,t)],["vcenter"]);return new ib("mrow",[n])}}),jy({type:"verb",names:["\\verb"],numArgs:0,allowedInText:!0,handler(e,t,n){throw new Ag("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=dx(e),r=[],o=t.havingStyle(t.style.text()),i=0;i<n.length;i++){var a=n[i];"~"===a&&(a="\\textasciitilde"),r.push(gy(a,"Typewriter-Regular",e.mode,o,["mord","texttt"]))}return ky(["mord","text"].concat(o.sizingClasses(t)),wy(r),o)},mathmlBuilder(e,t){var n=new ab(dx(e)),r=new ib("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var dx=e=>e.body.replace(/ /g,e.star?"␣":" "),ux=Ny,hx="[ \r\n\t]",px="(\\\\[a-zA-Z@]+)"+hx+"*",mx="[̀-ͯ]",fx=new RegExp(mx+"+$"),gx="("+hx+"+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧-豈-]"+mx+"*|[\ud800-\udbff][\udc00-\udfff]"+mx+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+px+"|\\\\[^\ud800-\udfff])";class vx{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(gx,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Tw("EOF",new Mw(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new Ag("Unexpected character: '"+e[t]+"'",new Tw(e[t],new Mw(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[r]){var o=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===o?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=o+1,this.lex()}return new Tw(r,new Mw(this,t,this.tokenRegex.lastIndex))}}class yx{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new Ag("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(void 0===n&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var o=this.undefStack[this.undefStack.length-1];o&&!o.hasOwnProperty(e)&&(o[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var bx=Sw;Aw("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),Aw("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),Aw("\\@firstoftwo",function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),Aw("\\@secondoftwo",function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),Aw("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return 1===t[0].length&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),Aw("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Aw("\\TextOrMath",function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var wx={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Aw("\\char",function(e){var t,n=e.popToken(),r=0;if("'"===n.text)t=8,n=e.popToken();else if('"'===n.text)t=16,n=e.popToken();else if("`"===n.text)if("\\"===(n=e.popToken()).text[0])r=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new Ag("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(null==(r=wx[n.text])||r>=t)throw new Ag("Invalid base-"+t+" digit "+n.text);for(var o;null!=(o=wx[e.future().text])&&o<t;)r*=t,r+=o,e.popToken()}return"\\@char{"+r+"}"});var xx=(e,t,n,r)=>{var o=e.consumeArg().tokens;if(1!==o.length)throw new Ag("\\newcommand's first argument must be a macro name");var i=o[0].text,a=e.isDefined(i);if(a&&!t)throw new Ag("\\newcommand{"+i+"} attempting to redefine "+i+"; use \\renewcommand");if(!a&&!n)throw new Ag("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var s=0;if(1===(o=e.consumeArg().tokens).length&&"["===o[0].text){for(var l="",c=e.expandNextToken();"]"!==c.text&&"EOF"!==c.text;)l+=c.text,c=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Ag("Invalid number of arguments: "+l);s=parseInt(l),o=e.consumeArg().tokens}return a&&r||e.macros.set(i,{tokens:o,numArgs:s}),""};Aw("\\newcommand",e=>xx(e,!1,!0,!1)),Aw("\\renewcommand",e=>xx(e,!0,!1,!1)),Aw("\\providecommand",e=>xx(e,!0,!0,!0)),Aw("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join("")),""}),Aw("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join("")),""}),Aw("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),ux[n],_v.math[n],_v.text[n]),""}),Aw("\\bgroup","{"),Aw("\\egroup","}"),Aw("~","\\nobreakspace"),Aw("\\lq","`"),Aw("\\rq","'"),Aw("\\aa","\\r a"),Aw("\\AA","\\r A"),Aw("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),Aw("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),Aw("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),Aw("ℬ","\\mathscr{B}"),Aw("ℰ","\\mathscr{E}"),Aw("ℱ","\\mathscr{F}"),Aw("ℋ","\\mathscr{H}"),Aw("ℐ","\\mathscr{I}"),Aw("ℒ","\\mathscr{L}"),Aw("ℳ","\\mathscr{M}"),Aw("ℛ","\\mathscr{R}"),Aw("ℭ","\\mathfrak{C}"),Aw("ℌ","\\mathfrak{H}"),Aw("ℨ","\\mathfrak{Z}"),Aw("\\Bbbk","\\Bbb{k}"),Aw("\\llap","\\mathllap{\\textrm{#1}}"),Aw("\\rlap","\\mathrlap{\\textrm{#1}}"),Aw("\\clap","\\mathclap{\\textrm{#1}}"),Aw("\\mathstrut","\\vphantom{(}"),Aw("\\underbar","\\underline{\\text{#1}}"),Aw("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}'),Aw("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),Aw("\\ne","\\neq"),Aw("≠","\\neq"),Aw("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),Aw("∉","\\notin"),Aw("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),Aw("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),Aw("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),Aw("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),Aw("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),Aw("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),Aw("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),Aw("⟂","\\perp"),Aw("‼","\\mathclose{!\\mkern-0.8mu!}"),Aw("∌","\\notni"),Aw("⌜","\\ulcorner"),Aw("⌝","\\urcorner"),Aw("⌞","\\llcorner"),Aw("⌟","\\lrcorner"),Aw("©","\\copyright"),Aw("®","\\textregistered"),Aw("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),Aw("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),Aw("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),Aw("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),Aw("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),Aw("⋮","\\vdots"),Aw("\\varGamma","\\mathit{\\Gamma}"),Aw("\\varDelta","\\mathit{\\Delta}"),Aw("\\varTheta","\\mathit{\\Theta}"),Aw("\\varLambda","\\mathit{\\Lambda}"),Aw("\\varXi","\\mathit{\\Xi}"),Aw("\\varPi","\\mathit{\\Pi}"),Aw("\\varSigma","\\mathit{\\Sigma}"),Aw("\\varUpsilon","\\mathit{\\Upsilon}"),Aw("\\varPhi","\\mathit{\\Phi}"),Aw("\\varPsi","\\mathit{\\Psi}"),Aw("\\varOmega","\\mathit{\\Omega}"),Aw("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),Aw("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),Aw("\\boxed","\\fbox{$\\displaystyle{#1}$}"),Aw("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),Aw("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),Aw("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),Aw("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),Aw("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var kx={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},Cx=new Set(["bin","rel"]);Aw("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in kx?t=kx[n]:("\\not"===n.slice(0,4)||n in _v.math&&Cx.has(_v.math[n].group))&&(t="\\dotsb"),t});var _x={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Aw("\\dotso",function(e){return e.future().text in _x?"\\ldots\\,":"\\ldots"}),Aw("\\dotsc",function(e){var t=e.future().text;return t in _x&&","!==t?"\\ldots\\,":"\\ldots"}),Aw("\\cdots",function(e){return e.future().text in _x?"\\@cdots\\,":"\\@cdots"}),Aw("\\dotsb","\\cdots"),Aw("\\dotsm","\\cdots"),Aw("\\dotsi","\\!\\cdots"),Aw("\\dotsx","\\ldots\\,"),Aw("\\DOTSI","\\relax"),Aw("\\DOTSB","\\relax"),Aw("\\DOTSX","\\relax"),Aw("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Aw("\\,","\\tmspace+{3mu}{.1667em}"),Aw("\\thinspace","\\,"),Aw("\\>","\\mskip{4mu}"),Aw("\\:","\\tmspace+{4mu}{.2222em}"),Aw("\\medspace","\\:"),Aw("\\;","\\tmspace+{5mu}{.2777em}"),Aw("\\thickspace","\\;"),Aw("\\!","\\tmspace-{3mu}{.1667em}"),Aw("\\negthinspace","\\!"),Aw("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Aw("\\negthickspace","\\tmspace-{5mu}{.277em}"),Aw("\\enspace","\\kern.5em "),Aw("\\enskip","\\hskip.5em\\relax"),Aw("\\quad","\\hskip1em\\relax"),Aw("\\qquad","\\hskip2em\\relax"),Aw("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Aw("\\tag@paren","\\tag@literal{({#1})}"),Aw("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ag("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),Aw("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Aw("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Aw("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Aw("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Aw("\\newline","\\\\\\relax"),Aw("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Sx=ov(bv["Main-Regular"]["T".charCodeAt(0)][1]-.7*bv["Main-Regular"]["A".charCodeAt(0)][1]);Aw("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+Sx+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),Aw("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+Sx+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),Aw("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Aw("\\@hspace","\\hskip #1\\relax"),Aw("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Aw("\\ordinarycolon",":"),Aw("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Aw("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Aw("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Aw("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Aw("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Aw("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Aw("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Aw("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Aw("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Aw("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Aw("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Aw("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Aw("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Aw("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Aw("∷","\\dblcolon"),Aw("∹","\\eqcolon"),Aw("≔","\\coloneqq"),Aw("≕","\\eqqcolon"),Aw("⩴","\\Coloneqq"),Aw("\\ratio","\\vcentcolon"),Aw("\\coloncolon","\\dblcolon"),Aw("\\colonequals","\\coloneqq"),Aw("\\coloncolonequals","\\Coloneqq"),Aw("\\equalscolon","\\eqqcolon"),Aw("\\equalscoloncolon","\\Eqqcolon"),Aw("\\colonminus","\\coloneq"),Aw("\\coloncolonminus","\\Coloneq"),Aw("\\minuscolon","\\eqcolon"),Aw("\\minuscoloncolon","\\Eqcolon"),Aw("\\coloncolonapprox","\\Colonapprox"),Aw("\\coloncolonsim","\\Colonsim"),Aw("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Aw("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Aw("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Aw("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Aw("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),Aw("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Aw("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Aw("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),Aw("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),Aw("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),Aw("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),Aw("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),Aw("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),Aw("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),Aw("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),Aw("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),Aw("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),Aw("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),Aw("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),Aw("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),Aw("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),Aw("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),Aw("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),Aw("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),Aw("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),Aw("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),Aw("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),Aw("\\imath","\\html@mathml{\\@imath}{ı}"),Aw("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),Aw("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),Aw("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),Aw("⟦","\\llbracket"),Aw("⟧","\\rrbracket"),Aw("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),Aw("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),Aw("⦃","\\lBrace"),Aw("⦄","\\rBrace"),Aw("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),Aw("⦵","\\minuso"),Aw("\\darr","\\downarrow"),Aw("\\dArr","\\Downarrow"),Aw("\\Darr","\\Downarrow"),Aw("\\lang","\\langle"),Aw("\\rang","\\rangle"),Aw("\\uarr","\\uparrow"),Aw("\\uArr","\\Uparrow"),Aw("\\Uarr","\\Uparrow"),Aw("\\N","\\mathbb{N}"),Aw("\\R","\\mathbb{R}"),Aw("\\Z","\\mathbb{Z}"),Aw("\\alef","\\aleph"),Aw("\\alefsym","\\aleph"),Aw("\\Alpha","\\mathrm{A}"),Aw("\\Beta","\\mathrm{B}"),Aw("\\bull","\\bullet"),Aw("\\Chi","\\mathrm{X}"),Aw("\\clubs","\\clubsuit"),Aw("\\cnums","\\mathbb{C}"),Aw("\\Complex","\\mathbb{C}"),Aw("\\Dagger","\\ddagger"),Aw("\\diamonds","\\diamondsuit"),Aw("\\empty","\\emptyset"),Aw("\\Epsilon","\\mathrm{E}"),Aw("\\Eta","\\mathrm{H}"),Aw("\\exist","\\exists"),Aw("\\harr","\\leftrightarrow"),Aw("\\hArr","\\Leftrightarrow"),Aw("\\Harr","\\Leftrightarrow"),Aw("\\hearts","\\heartsuit"),Aw("\\image","\\Im"),Aw("\\infin","\\infty"),Aw("\\Iota","\\mathrm{I}"),Aw("\\isin","\\in"),Aw("\\Kappa","\\mathrm{K}"),Aw("\\larr","\\leftarrow"),Aw("\\lArr","\\Leftarrow"),Aw("\\Larr","\\Leftarrow"),Aw("\\lrarr","\\leftrightarrow"),Aw("\\lrArr","\\Leftrightarrow"),Aw("\\Lrarr","\\Leftrightarrow"),Aw("\\Mu","\\mathrm{M}"),Aw("\\natnums","\\mathbb{N}"),Aw("\\Nu","\\mathrm{N}"),Aw("\\Omicron","\\mathrm{O}"),Aw("\\plusmn","\\pm"),Aw("\\rarr","\\rightarrow"),Aw("\\rArr","\\Rightarrow"),Aw("\\Rarr","\\Rightarrow"),Aw("\\real","\\Re"),Aw("\\reals","\\mathbb{R}"),Aw("\\Reals","\\mathbb{R}"),Aw("\\Rho","\\mathrm{P}"),Aw("\\sdot","\\cdot"),Aw("\\sect","\\S"),Aw("\\spades","\\spadesuit"),Aw("\\sub","\\subset"),Aw("\\sube","\\subseteq"),Aw("\\supe","\\supseteq"),Aw("\\Tau","\\mathrm{T}"),Aw("\\thetasym","\\vartheta"),Aw("\\weierp","\\wp"),Aw("\\Zeta","\\mathrm{Z}"),Aw("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Aw("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Aw("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Aw("\\bra","\\mathinner{\\langle{#1}|}"),Aw("\\ket","\\mathinner{|{#1}\\rangle}"),Aw("\\braket","\\mathinner{\\langle{#1}\\rangle}"),Aw("\\Bra","\\left\\langle#1\\right|"),Aw("\\Ket","\\left|#1\\right\\rangle");var Ax=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,o=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.macros.get("|"),s=t.macros.get("\\|");t.macros.beginGroup();var l=t=>n=>{e&&(n.macros.set("|",a),o.length&&n.macros.set("\\|",s));var i=t;return!t&&o.length&&"|"===n.future().text&&(n.popToken(),i=!0),{tokens:i?o:r,numArgs:0}};t.macros.set("|",l(!1)),o.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,d=t.expandTokens([...i,...c,...n]);return t.macros.endGroup(),{tokens:d.reverse(),numArgs:0}};Aw("\\bra@ket",Ax(!1)),Aw("\\bra@set",Ax(!0)),Aw("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),Aw("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),Aw("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),Aw("\\angln","{\\angl n}"),Aw("\\blue","\\textcolor{##6495ed}{#1}"),Aw("\\orange","\\textcolor{##ffa500}{#1}"),Aw("\\pink","\\textcolor{##ff00af}{#1}"),Aw("\\red","\\textcolor{##df0030}{#1}"),Aw("\\green","\\textcolor{##28ae7b}{#1}"),Aw("\\gray","\\textcolor{gray}{#1}"),Aw("\\purple","\\textcolor{##9d38bd}{#1}"),Aw("\\blueA","\\textcolor{##ccfaff}{#1}"),Aw("\\blueB","\\textcolor{##80f6ff}{#1}"),Aw("\\blueC","\\textcolor{##63d9ea}{#1}"),Aw("\\blueD","\\textcolor{##11accd}{#1}"),Aw("\\blueE","\\textcolor{##0c7f99}{#1}"),Aw("\\tealA","\\textcolor{##94fff5}{#1}"),Aw("\\tealB","\\textcolor{##26edd5}{#1}"),Aw("\\tealC","\\textcolor{##01d1c1}{#1}"),Aw("\\tealD","\\textcolor{##01a995}{#1}"),Aw("\\tealE","\\textcolor{##208170}{#1}"),Aw("\\greenA","\\textcolor{##b6ffb0}{#1}"),Aw("\\greenB","\\textcolor{##8af281}{#1}"),Aw("\\greenC","\\textcolor{##74cf70}{#1}"),Aw("\\greenD","\\textcolor{##1fab54}{#1}"),Aw("\\greenE","\\textcolor{##0d923f}{#1}"),Aw("\\goldA","\\textcolor{##ffd0a9}{#1}"),Aw("\\goldB","\\textcolor{##ffbb71}{#1}"),Aw("\\goldC","\\textcolor{##ff9c39}{#1}"),Aw("\\goldD","\\textcolor{##e07d10}{#1}"),Aw("\\goldE","\\textcolor{##a75a05}{#1}"),Aw("\\redA","\\textcolor{##fca9a9}{#1}"),Aw("\\redB","\\textcolor{##ff8482}{#1}"),Aw("\\redC","\\textcolor{##f9685d}{#1}"),Aw("\\redD","\\textcolor{##e84d39}{#1}"),Aw("\\redE","\\textcolor{##bc2612}{#1}"),Aw("\\maroonA","\\textcolor{##ffbde0}{#1}"),Aw("\\maroonB","\\textcolor{##ff92c6}{#1}"),Aw("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Aw("\\maroonD","\\textcolor{##ca337c}{#1}"),Aw("\\maroonE","\\textcolor{##9e034e}{#1}"),Aw("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Aw("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Aw("\\purpleC","\\textcolor{##aa87ff}{#1}"),Aw("\\purpleD","\\textcolor{##7854ab}{#1}"),Aw("\\purpleE","\\textcolor{##543b78}{#1}"),Aw("\\mintA","\\textcolor{##f5f9e8}{#1}"),Aw("\\mintB","\\textcolor{##edf2df}{#1}"),Aw("\\mintC","\\textcolor{##e0e5cc}{#1}"),Aw("\\grayA","\\textcolor{##f6f7f7}{#1}"),Aw("\\grayB","\\textcolor{##f0f1f2}{#1}"),Aw("\\grayC","\\textcolor{##e3e5e6}{#1}"),Aw("\\grayD","\\textcolor{##d6d8da}{#1}"),Aw("\\grayE","\\textcolor{##babec2}{#1}"),Aw("\\grayF","\\textcolor{##888d93}{#1}"),Aw("\\grayG","\\textcolor{##626569}{#1}"),Aw("\\grayH","\\textcolor{##3b3e40}{#1}"),Aw("\\grayI","\\textcolor{##21242c}{#1}"),Aw("\\kaBlue","\\textcolor{##314453}{#1}"),Aw("\\kaGreen","\\textcolor{##71B307}{#1}");var Mx={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Tx{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new yx(bx,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new vx(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new Tw("EOF",n.loc)),this.pushTokens(r),new Tw("",Mw.range(t,n))}consumeSpaces(){for(;" "===this.future().text;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r,o=this.future(),i=0,a=0;do{if(r=this.popToken(),t.push(r),"{"===r.text)++i;else if("}"===r.text){if(-1===--i)throw new Ag("Extra }",r)}else if("EOF"===r.text)throw new Ag("Unexpected end of input in a macro argument, expected '"+(e&&n?e[a]:"}")+"'",r);if(e&&n)if((0===i||1===i&&"{"===e[a])&&r.text===e[a]){if(++a===e.length){t.splice(-a,a);break}}else a=0}while(0!==i||n);return"{"===o.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:o,end:r}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new Ag("The length of delimiters doesn't match the number of args!");for(var n=t[0],r=0;r<n.length;r++){var o=this.popToken();if(n[r]!==o.text)throw new Ag("Use of the macro doesn't match its definition",o)}}for(var i=[],a=0;a<e;a++)i.push(this.consumeArg(t&&t[a+1]).tokens);return i}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new Ag("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(null==r||e&&r.unexpandable){if(e&&null==r&&"\\"===n[0]&&!this.isDefined(n))throw new Ag("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var o=r.tokens,i=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs)for(var a=(o=o.slice()).length-1;a>=0;--a){var s=o[a];if("#"===s.text){if(0===a)throw new Ag("Incomplete placeholder at end of macro body",s);if("#"===(s=o[--a]).text)o.splice(a+1,1);else{if(!/^[1-9]$/.test(s.text))throw new Ag("Not a valid argument number",s);o.splice(a,2,...i[+s.text-1])}}}return this.pushTokens(o),o.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Tw(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(!1===this.expandOnce(!0)){var r=this.stack.pop();r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map(e=>e.text).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var n=this.lexer.catcodes[e];if(null!=n&&13!==n)return}var r="function"==typeof t?t(this):t;if("string"==typeof r){var o=0;if(r.includes("#"))for(var i=r.replace(/##/g,"");i.includes("#"+(o+1));)++o;for(var a=new vx(r,this.settings),s=[],l=a.lex();"EOF"!==l.text;)s.push(l),l=a.lex();return s.reverse(),{tokens:s,numArgs:o}}return r}isDefined(e){return this.macros.has(e)||ux.hasOwnProperty(e)||_v.math.hasOwnProperty(e)||_v.text.hasOwnProperty(e)||Mx.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:ux.hasOwnProperty(e)&&!ux[e].primitive}}var Ex=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Lx=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g","ʰ":"h","ⁱ":"i","ʲ":"j","ᵏ":"k","ˡ":"l","ᵐ":"m","ⁿ":"n","ᵒ":"o","ᵖ":"p","ʳ":"r","ˢ":"s","ᵗ":"t","ᵘ":"u","ᵛ":"v","ʷ":"w","ˣ":"x","ʸ":"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Ox={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Ix={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď","ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê","ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ","ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ","Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};class Rx{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Tx(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new Ag("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Tw("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){"math"===this.mode&&this.consumeSpaces();var r=this.fetch();if(Rx.endOfExpression.has(r.text))break;if(t&&r.text===t)break;if(e&&ux[r.text]&&ux[r.text].infix)break;var o=this.parseAtom(t);if(!o)break;"internal"!==o.type&&n.push(o)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t,n=-1,r=0;r<e.length;r++){var o=e[r];if("infix"===o.type){if(-1!==n)throw new Ag("only one infix operator per group",o.token);n=r,t=o.replaceWith}}if(-1!==n&&t){var i,a,s=e.slice(0,n),l=e.slice(n+1);return i=1===s.length&&"ordgroup"===s[0].type?s[0]:{type:"ordgroup",mode:this.mode,body:s},a=1===l.length&&"ordgroup"===l[0].type?l[0]:{type:"ordgroup",mode:this.mode,body:l},["\\\\abovefrac"===t?this.callFunction(t,[i,e[n],a],[]):this.callFunction(t,[i,a],[])]}return e}handleSupSubscript(e){var t,n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();do{var o;t=this.parseGroup(e)}while("internal"===(null==(o=t)?void 0:o.type));if(!t)throw new Ag("Expected group after '"+r+"'",n);return t}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var r={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t,n,r=this.parseGroup("atom",e);if("internal"===(null==r?void 0:r.type))return r;if("text"===this.mode)return r;for(;;){this.consumeSpaces();var o=this.fetch();if("\\limits"===o.text||"\\nolimits"===o.text){if(r&&"op"===r.type)r.limits="\\limits"===o.text,r.alwaysHandleSupSub=!0;else{if(!r||"operatorname"!==r.type)throw new Ag("Limit controls must follow a math operator",o);r.alwaysHandleSupSub&&(r.limits="\\limits"===o.text)}this.consume()}else if("^"===o.text){if(t)throw new Ag("Double superscript",o);t=this.handleSupSubscript("superscript")}else if("_"===o.text){if(n)throw new Ag("Double subscript",o);n=this.handleSupSubscript("subscript")}else if("'"===o.text){if(t)throw new Ag("Double superscript",o);var i={type:"textord",mode:this.mode,text:"\\prime"},a=[i];for(this.consume();"'"===this.fetch().text;)a.push(i),this.consume();"^"===this.fetch().text&&a.push(this.handleSupSubscript("superscript")),t={type:"ordgroup",mode:this.mode,body:a}}else{if(!Lx[o.text])break;var s=Ex.test(o.text),l=[];for(l.push(new Tw(Lx[o.text])),this.consume();;){var c=this.fetch().text;if(!Lx[c])break;if(Ex.test(c)!==s)break;l.unshift(new Tw(Lx[c])),this.consume()}var d=this.subparse(l);s?n={type:"ordgroup",mode:"math",body:d}:t={type:"ordgroup",mode:"math",body:d}}}return t&&n?{type:"supsub",mode:this.mode,base:r,sup:t,sub:n}:t?{type:"supsub",mode:this.mode,base:r,sup:t}:n?{type:"supsub",mode:this.mode,base:r,sub:n}:r}parseFunction(e,t){var n=this.fetch(),r=n.text,o=ux[r];if(!o)return null;if(this.consume(),t&&"atom"!==t&&!o.allowedInArgument)throw new Ag("Got function '"+r+"' with no arguments"+(t?" as "+t:""),n);if("text"===this.mode&&!o.allowedInText)throw new Ag("Can't use function '"+r+"' in text mode",n);if("math"===this.mode&&!1===o.allowedInMath)throw new Ag("Can't use function '"+r+"' in math mode",n);var{args:i,optArgs:a}=this.parseArguments(r,o);return this.callFunction(r,i,a,n,e)}callFunction(e,t,n,r,o){var i={funcName:e,parser:this,token:r,breakOnTokenText:o},a=ux[e];if(a&&a.handler)return a.handler(i,t,n);throw new Ag("No function handler for "+e)}parseArguments(e,t){var n,r=null!=(n=t.numOptionalArgs)?n:0,o=t.numArgs+r;if(0===o)return{args:[],optArgs:[]};for(var i=[],a=[],s=0;s<o;s++){var l,c=null==(l=t.argTypes)?void 0:l[s],d=s<r;("primitive"in t&&t.primitive&&null==c||"sqrt"===t.type&&1===s&&null==a[0])&&(c="primitive");var u=this.parseGroupOfType("argument to '"+e+"'",c,d);if(d)a.push(u);else{if(null==u)throw new Ag("Null argument, please report this as a bug");i.push(u)}}return{args:i,optArgs:a}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":var r=this.parseArgumentGroup(n,"text");return null!=r?{type:"styling",mode:r.mode,body:[r],style:"text",resetFont:!0}:null;case"raw":var o=this.parseStringGroup(n);return null!=o?{type:"raw",mode:"text",string:o.text}:null;case"primitive":if(n)throw new Ag("A primitive argument cannot be optional");var i=this.parseGroup(e);if(null==i)throw new Ag("Expected group as "+e,this.fetch());return i;case"original":case void 0:return this.parseArgumentGroup(n);default:throw new Ag("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;" "===this.fetch().text;)this.consume()}parseStringGroup(e){var t=this.gullet.scanArgument(e);if(null==t)return null;for(var n,r="";"EOF"!==(n=this.fetch()).text;)r+=n.text,this.consume();return this.consume(),t.text=r,t}parseRegexGroup(e,t){for(var n,r=this.fetch(),o=r,i="";"EOF"!==(n=this.fetch()).text&&e.test(i+n.text);)i+=(o=n).text,this.consume();if(""===i)throw new Ag("Invalid "+t+": '"+r.text+"'",r);return r.range(o,i)}parseColorGroup(e){var t=this.parseStringGroup(e);if(null==t)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new Ag("Invalid color: '"+t.text+"'",t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r="#"+r),{type:"color-token",mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!(t=e||"{"===this.gullet.future().text?this.parseStringGroup(e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new Ag("Invalid size: '"+t.text+"'",t);var o={number:+(r[1]+r[2]),unit:r[3]};if(!nv(o))throw new Ag("Invalid unit: '"+o.unit+"'",t);return{type:"size",mode:this.mode,value:o,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup(e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(null==n)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var o=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var i={type:"ordgroup",mode:this.mode,loc:n.loc,body:o};return t&&this.switchMode(r),i}parseGroup(e,t){var n,r=this.fetch(),o=r.text;if("{"===o||"\\begingroup"===o){this.consume();var i="{"===o?"}":"\\endgroup";this.gullet.beginGroup();var a=this.parseExpression(!1,i),s=this.fetch();this.expect(i),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:Mw.range(r,s),body:a,semisimple:"\\begingroup"===o||void 0}}else if(null==(n=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===o[0]&&!Mx.hasOwnProperty(o)){if(this.settings.throwOnError)throw new Ag("Undefined control sequence: "+o,r);n=this.formatUnsupportedCmd(o),this.consume()}return n}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if("textord"===r.type){var o=r.text,i=e[n+1];if(i&&"textord"===i.type){if("-"===o&&"-"===i.text){var a=e[n+2];n+1<t&&a&&"textord"===a.type&&"-"===a.text?(e.splice(n,3,{type:"textord",mode:"text",loc:Mw.range(r,a),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:Mw.range(r,i),text:"--"}),t-=1)}"'"!==o&&"`"!==o||i.text!==o||(e.splice(n,2,{type:"textord",mode:"text",loc:Mw.range(r,i),text:o+o}),t-=1)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r="*"===n.charAt(0);if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new Ag("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:r}}Ix.hasOwnProperty(t[0])&&!_v[this.mode][t[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=Ix[t[0]]+t.slice(1));var o,i=fx.exec(t);if(i&&("i"===(t=t.substring(0,i.index))?t="ı":"j"===t&&(t="ȷ")),_v[this.mode][t]){this.settings.strict&&"math"===this.mode&&"ÐÞþ".includes(t)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var a=_v[this.mode][t].group,s=Mw.range(e);o=function(e){return e in Lb}(a)?{type:"atom",mode:this.mode,family:a,loc:s,text:t}:{type:a,mode:this.mode,loc:s,text:t}}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(Xg(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),o={type:"textord",mode:"text",loc:Mw.range(e),text:t}}if(this.consume(),i)for(var l=0;l<i[0].length;l++){var c=i[0][l];if(!Ox[c])throw new Ag("Unknown accent ' "+c+"'",e);var d=Ox[c][this.mode]||Ox[c].text;if(!d)throw new Ag("Accent "+c+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:Mw.range(e),label:d,isStretchy:!1,isShifty:!0,base:o}}return o}}Rx.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var Px=function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new Rx(e,t);delete n.gullet.macros.current["\\df@tag"];var r=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new Ag("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:n.subparse([new Tw("\\df@tag")])}]}return r},Bx=function(e,t,n){t.textContent="";var r=Dx(e,n).toNode();t.appendChild(r)};"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&("undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Bx=function(){throw new Ag("KaTeX doesn't work in quirks mode.")});var zx=function(e,t,n){if(n.throwOnError||!(e instanceof Ag))throw e;var r=ky(["katex-error"],[new fv(t)]);return r.setAttribute("title",e.toString()),r.setAttribute("style","color:"+n.errorColor),r},Dx=function(e,t){var n=new Dg(t);try{return function(e,t,n){var r,o=Cb(n);if("mathml"===n.output)return yb(e,t,o,n.displayMode,!0);if("html"===n.output){var i=rb(e,o);r=ky(["katex"],[i])}else{var a=yb(e,t,o,n.displayMode,!1),s=rb(e,o);r=ky(["katex"],[a,s])}return _b(r,n)}(Px(e,n),e,n)}catch(r){return zx(r,e,n)}},Nx={version:"0.17.0",render:Bx,renderToString:function(e,t){return Dx(e,t).toMarkup()},ParseError:Ag,SETTINGS_SCHEMA:Bg,__parse:function(e,t){var n=new Dg(t);return Px(e,n)},__renderToDomTree:Dx,__renderToHTMLTree:function(e,t){var n=new Dg(t);try{return function(e,t,n){var r=rb(e,Cb(n)),o=ky(["katex"],[r]);return _b(o,n)}(Px(e,n),0,n)}catch(r){return zx(r,e,n)}},__setFontMetrics:function(e,t){bv[e]=t},__defineSymbol:Sv,__defineFunction:jy,__defineMacro:Aw,__domTree:{Span:uv,Anchor:hv,SymbolNode:fv,SvgNode:gv,PathNode:vv,LineNode:yv}},Hx=Object.defineProperty,qx=Object.getOwnPropertySymbols,jx=Object.prototype.hasOwnProperty,Vx=Object.prototype.propertyIsEnumerable,Fx=(e,t,n)=>t in e?Hx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$x=(e,t)=>{for(var n in t||(t={}))jx.call(t,n)&&Fx(e,n,t[n]);if(qx)for(var n of qx(t))Vx.call(t,n)&&Fx(e,n,t[n]);return e};function Wx(e,t){return Object.assign(e,{meta:$x({package:"@milkdown/components"},t)}),e}var Ux=Object.defineProperty,Gx=Object.getOwnPropertySymbols,Zx=Object.prototype.hasOwnProperty,Xx=Object.prototype.propertyIsEnumerable,Kx=(e,t,n)=>t in e?Ux(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yx=(e,t)=>{for(var n in t||(t={}))Zx.call(t,n)&&Kx(e,n,t[n]);if(Gx)for(var n of Gx(t))Xx.call(t,n)&&Kx(e,n,t[n]);return e};const Jx=a(Yx({},{mode:"preview"}),"linkTooltipStateCtx");Wx(Jx,{displayName:"State<link-tooltip>",group:"LinkTooltip"});const Qx=a(Yx({},{addLink:()=>{},editLink:()=>{},removeLink:()=>{}}),"linkTooltipAPICtx");Wx(Jx,{displayName:"API<link-tooltip>",group:"LinkTooltip"});const ek=a(Yx({},{linkIcon:"🔗",editButton:"✎",removeButton:"⌫",confirmButton:"Confirm ⏎",onCopyLink:()=>{},inputPlaceholder:"Paste link..."}),"linkTooltipConfigCtx");Wx(Jx,{displayName:"Config<link-tooltip>",group:"LinkTooltip"});const tk=l("ToggleLink",e=>()=>t=>{const{doc:n,selection:r}=t,o=oe.type(e);return n.rangeHasMark(r.from,r.to,o)?(e.get(Qx.key).removeLink(r.from,r.to),!0):(e.get(Qx.key).addLink(r.from,r.to),!0)}),nk=oi("LINK_PREVIEW");Wx(nk[0],{displayName:"PreviewTooltipSpec<link-tooltip>",group:"LinkTooltip"}),Wx(nk[1],{displayName:"PreviewTooltipPlugin<link-tooltip>",group:"LinkTooltip"});const rk=oi("LINK_EDIT");function ok({icon:e,class:t,onClick:n}){return pd("span",{class:Ln("milkdown-icon",t),onPointerdown:n,innerHTML:e?Sn.sanitize(e.trim()):void 0})}Wx(rk[0],{displayName:"EditTooltipSpec<link-tooltip>",group:"LinkTooltip"}),Wx(rk[1],{displayName:"EditTooltipPlugin<link-tooltip>",group:"LinkTooltip"}),ok.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const ik=ml({props:{config:{type:Object,required:!0},src:{type:Object,required:!0},onConfirm:{type:Function,required:!0},onCancel:{type:Function,required:!0}},setup({config:e,src:t,onConfirm:n,onCancel:r}){const o=gs(t);sl(t,e=>{o.value=e});const i=()=>{n(o.value)},a=e=>{e.stopPropagation(),"Enter"===e.key&&(e.preventDefault(),i()),"Escape"===e.key&&(e.preventDefault(),r())};return()=>pd("div",{class:"link-edit"},pd("input",{class:"input-area",placeholder:e.value.inputPlaceholder,onKeydown:a,onInput:e=>{o.value=e.target.value},value:o.value}),o.value?pd(ok,{class:"button confirm",icon:e.value.confirmButton,onClick:i}):null)}});var ak,sk,lk,ck,dk,uk,hk,pk,mk,fk,gk,vk,yk=Object.defineProperty,bk=Object.defineProperties,wk=Object.getOwnPropertyDescriptors,xk=Object.getOwnPropertySymbols,kk=Object.prototype.hasOwnProperty,Ck=Object.prototype.propertyIsEnumerable,_k=e=>{throw TypeError(e)},Sk=(e,t,n)=>t in e?yk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ak=(e,t)=>{for(var n in t||(t={}))kk.call(t,n)&&Sk(e,n,t[n]);if(xk)for(var n of xk(t))Ck.call(t,n)&&Sk(e,n,t[n]);return e},Mk=(e,t)=>bk(e,wk(t)),Tk=(e,t,n)=>t.has(e)||_k("Cannot "+n),Ek=(e,t,n)=>(Tk(e,t,"read from private field"),n?n.call(e):t.get(e)),Lk=(e,t,n)=>t.has(e)?_k("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ok=(e,t,n,r)=>(Tk(e,t,"write to private field"),t.set(e,n),n);const Ik={from:-1,to:-1,mark:null};class Rk{constructor(e,t){this.ctx=e,Lk(this,ak),Lk(this,sk),Lk(this,lk,Ak({},Ik)),Lk(this,ck),Lk(this,dk),Lk(this,uk,gs("")),Lk(this,hk,()=>{Ek(this,fk).call(this),Ek(this,sk).hide(),this.ctx.update(Jx.key,e=>Mk(Ak({},e),{mode:"preview"})),Ok(this,lk,Ak({},Ik))}),Lk(this,pk,e=>{const t=e.target;t&&(Ek(this,ak).contains(t)||Ek(this,hk).call(this))}),Lk(this,mk,()=>{document.addEventListener("pointerdown",Ek(this,pk),!0)}),Lk(this,fk,()=>{document.removeEventListener("pointerdown",Ek(this,pk),!0)}),Lk(this,gk,e=>{const t=this.ctx.get(T),{from:n,to:r,mark:o}=Ek(this,lk),i=oe.type(this.ctx),a=ie(e);if(o&&o.attrs.href===a)return void Ek(this,hk).call(this);const s=t.state.tr;if(o&&s.removeMark(n,r,o),n===r){if(!a)return void Ek(this,hk).call(this);const e=i.create({href:a});s.insertText(a,n),s.addMark(n,n+a.length,e)}else s.addMark(n,r,i.create({href:a}));t.dispatch(s),Ek(this,hk).call(this)}),Lk(this,vk,(e,t,n)=>{const r=this.ctx.get(ek.key);Ek(this,dk).value=r,Ek(this,uk).value=e,this.ctx.update(Jx.key,e=>Mk(Ak({},e),{mode:"edit"}));const o=this.ctx.get(T);o.dispatch(o.state.tr.setSelection(S.create(o.state.doc,t,n))),Ek(this,sk).show({getBoundingClientRect:()=>_(o,t,n)},o),Ek(this,mk).call(this),requestAnimationFrame(()=>{var e;null==(e=Ek(this,ak).querySelector("input"))||e.focus()})}),this.update=e=>{const{state:t}=e,{selection:n}=t;if(!(n instanceof S))return;const{from:r,to:o}=n;r===Ek(this,lk).from&&o===Ek(this,lk).to||Ek(this,hk).call(this)},this.destroy=()=>{Ek(this,fk).call(this),Ek(this,ck).unmount(),Ek(this,sk).destroy(),Ek(this,ak).remove()},this.addLink=(e,t)=>{Ok(this,lk,{from:e,to:t,mark:null}),Ek(this,vk).call(this,"",e,t)},this.editLink=(e,t,n)=>{Ok(this,lk,{from:t,to:n,mark:e}),Ek(this,vk).call(this,e.attrs.href,t,n)},this.removeLink=(e,t)=>{const n=this.ctx.get(T),r=n.state.tr;r.removeMark(e,t,oe.type(this.ctx)),n.dispatch(r),Ek(this,hk).call(this)},Ok(this,dk,gs(this.ctx.get(ek.key)));const n=document.createElement("div");n.className="milkdown-link-edit";const r=qd(ik,{config:Ek(this,dk),src:Ek(this,uk),onConfirm:Ek(this,gk),onCancel:Ek(this,hk)});r.mount(n),Ok(this,ck,r),Ok(this,ak,n),Ok(this,sk,new ri({content:n,debounce:0,shouldShow:()=>!1})),Ek(this,sk).onHide=()=>{requestAnimationFrame(()=>{t.dom.focus({preventScroll:!0})})},Ek(this,sk).update(t)}}ak=new WeakMap,sk=new WeakMap,lk=new WeakMap,ck=new WeakMap,dk=new WeakMap,uk=new WeakMap,hk=new WeakMap,pk=new WeakMap,mk=new WeakMap,fk=new WeakMap,gk=new WeakMap,vk=new WeakMap;var Pk=Object.defineProperty,Bk=Object.defineProperties,zk=Object.getOwnPropertyDescriptors,Dk=Object.getOwnPropertySymbols,Nk=Object.prototype.hasOwnProperty,Hk=Object.prototype.propertyIsEnumerable,qk=(e,t,n)=>t in e?Pk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const jk=ml({props:{config:{type:Object,required:!0},src:{type:Object,required:!0},onEdit:{type:Object,required:!0},onRemove:{type:Object,required:!0}},setup({config:e,src:t,onEdit:n,onRemove:r}){const o=hd(()=>ie(t.value)),i=e=>{e.preventDefault(),e.stopPropagation(),n.value()},a=e=>{e.preventDefault(),e.stopPropagation(),r.value()},s=n=>{n.preventDefault();const r=t.value;navigator.clipboard&&r&&navigator.clipboard.writeText(r).then(()=>{e.value.onCopyLink(r)}).catch(e=>console.error(e))};return()=>pd("div",{class:"link-preview"},pd(ok,{class:"button link-icon",icon:e.value.linkIcon,onClick:s}),pd("a",{href:o.value,target:"_blank",rel:"noopener noreferrer",class:"link-display"},t.value),pd(ok,{class:"button link-edit-button",icon:e.value.editButton,onClick:i}),pd(ok,{class:"button link-remove-button",icon:e.value.removeButton,onClick:a}))}});var Vk,Fk,$k,Wk,Uk,Gk,Zk,Xk,Kk,Yk,Jk,Qk,eC,tC,nC=e=>{throw TypeError(e)},rC=(e,t,n)=>t.has(e)||nC("Cannot "+n),oC=(e,t,n)=>(rC(e,t,"read from private field"),n?n.call(e):t.get(e)),iC=(e,t,n)=>t.has(e)?nC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),aC=(e,t,n,r)=>(rC(e,t,"write to private field"),t.set(e,n),n);class sC{constructor(e,t){this.ctx=e,iC(this,Vk),iC(this,Fk),iC(this,$k),iC(this,Wk),iC(this,Uk,gs("")),iC(this,Gk,gs(()=>{})),iC(this,Zk,gs(()=>{})),iC(this,Xk),iC(this,Kk),iC(this,Yk,!1),iC(this,Jk,({mode:e})=>{"edit"===e&&oC(this,tC).call(this)}),iC(this,Qk,()=>{aC(this,Yk,!0)}),iC(this,eC,()=>{aC(this,Yk,!1)}),iC(this,tC,()=>{oC(this,Fk).hide(),oC(this,Fk).element.removeEventListener("mouseenter",oC(this,Qk)),oC(this,Fk).element.removeEventListener("mouseleave",oC(this,eC))}),this.show=(e,t,n,r)=>{oC(this,Wk).value=this.ctx.get(ek.key),oC(this,Uk).value=e.attrs.href,oC(this,Gk).value=()=>{this.ctx.get(Qx.key).editLink(e,t,n)},oC(this,Zk).value=()=>{this.ctx.get(Qx.key).removeLink(t,n),oC(this,tC).call(this)},oC(this,Fk).show({getBoundingClientRect:()=>r},oC(this,Kk)),oC(this,Fk).element.addEventListener("mouseenter",oC(this,Qk)),oC(this,Fk).element.addEventListener("mouseleave",oC(this,eC))},this.hide=()=>{oC(this,Yk)||oC(this,tC).call(this)},this.update=()=>{},this.destroy=()=>{oC(this,Xk).unmount(),oC(this,$k).off(oC(this,Jk)),oC(this,Fk).destroy(),oC(this,Vk).remove()},aC(this,Kk,t),aC(this,Wk,gs(this.ctx.get(ek.key))),aC(this,Xk,qd(jk,{config:oC(this,Wk),src:oC(this,Uk),onEdit:oC(this,Gk),onRemove:oC(this,Zk)})),aC(this,Vk,document.createElement("div")),oC(this,Vk).className="milkdown-link-preview",oC(this,Xk).mount(oC(this,Vk)),aC(this,Fk,new ri({debounce:0,content:oC(this,Vk),shouldShow:()=>!1})),oC(this,Fk).update(t),aC(this,$k,e.use(Jx.key)),oC(this,$k).on(oC(this,Jk))}}function lC(e){(function(e){let t;const n=hr((n,r)=>{if(!t)return;if(!n.hasFocus())return;if("edit"===e.get(Jx.key).mode)return;const o=function(e,t,n){const r=t.posAtCoords({left:n.clientX,top:n.clientY});if(!r)return;const{pos:o}=r,i=t.state.doc.nodeAt(o);if(!i)return;const a=i.marks.find(t=>t.type===oe.mark.type(e));return a&&nk.pluginKey()?{show:!0,pos:o,node:i,mark:a}:void 0}(e,n,r);if(o){const e=n.state.doc.resolve(o.pos),r=function(e,t,n,r,o){let i={start:-1,end:-1};return n.nodesBetween(r,o,(n,r)=>{if(i.start>-1)return!1;-1===i.start&&e.isInSet(n.marks)&&t===n&&(i={start:r,end:r+Math.max(n.textContent.length,1)})}),i}(o.mark,o.node,n.state.doc,e.before(),e.after()),i=r.start,a=r.end;return void t.show(o.mark,i,a,_(n,i,a))}t.hide()},50);e.set(nk.key,{props:{handleDOMEvents:{mousemove:n,mouseleave:()=>{setTimeout(()=>{null==t||t.hide()},50)}}},view:n=>(t=new sC(e,n),t)})})(e),function(e){let t;e.update(Qx.key,e=>((e,t)=>Bk(e,zk(t)))(((e,t)=>{for(var n in t||(t={}))Nk.call(t,n)&&qk(e,n,t[n]);if(Dk)for(var n of Dk(t))Hk.call(t,n)&&qk(e,n,t[n]);return e})({},e),{addLink:(e,n)=>{null==t||t.addLink(e,n)},editLink:(e,n,r)=>{null==t||t.editLink(e,n,r)},removeLink:(e,n)=>{null==t||t.removeLink(e,n)}})),e.set(rk.key,{view:n=>(t=new Rk(e,n),t)})}(e)}Vk=new WeakMap,Fk=new WeakMap,$k=new WeakMap,Wk=new WeakMap,Uk=new WeakMap,Gk=new WeakMap,Zk=new WeakMap,Xk=new WeakMap,Kk=new WeakMap,Yk=new WeakMap,Jk=new WeakMap,Qk=new WeakMap,eC=new WeakMap,tC=new WeakMap;const cC=[Jx,Qx,ek,nk,rk,tk].flat();var dC=Object.defineProperty,uC=Object.getOwnPropertySymbols,hC=Object.prototype.hasOwnProperty,pC=Object.prototype.propertyIsEnumerable,mC=(e,t,n)=>t in e?dC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fC=(e,t)=>{for(var n in t||(t={}))hC.call(t,n)&&mC(e,n,t[n]);if(uC)for(var n of uC(t))pC.call(t,n)&&mC(e,n,t[n]);return e};function gC(e,t){return Object.assign(e,{meta:fC({package:"@milkdown/components"},t)}),e}const vC=a({renderLabel:({label:e,listType:t,checked:n})=>null==n?"bullet"===t?"⦿":e:n?"☑":"□"},"listItemBlockConfigCtx");function yC({icon:e,class:t,onClick:n}){return pd("span",{class:Ln("milkdown-icon",t),onPointerdown:n,innerHTML:e?Sn.sanitize(e.trim()):void 0})}gC(vC,{displayName:"Config<list-item-block>",group:"ListItemBlock"}),yC.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const bC=ml({props:{label:{type:Object,required:!0},checked:{type:Object,required:!0},listType:{type:Object,required:!0},config:{type:Object,required:!0},readonly:{type:Object,required:!0},selected:{type:Object,required:!0},setAttr:{type:Function,required:!0},onMount:{type:Function,required:!0}},setup({label:e,checked:t,listType:n,config:r,readonly:o,setAttr:i,onMount:a,selected:s}){const l=e=>{null!=e&&e instanceof Element&&a(e)},c=e=>{e.stopPropagation(),e.preventDefault(),null!=t.value&&i("checked",!t.value)},d=hd(()=>r.renderLabel({label:e.value,listType:n.value,checked:t.value,readonly:o.value})),u=hd(()=>null==t.value?"bullet"===n.value?"bullet":"ordered":t.value?"checked":"unchecked");return()=>pd("li",{class:Ln("list-item",s.value&&"ProseMirror-selectednode")},pd("div",{class:"label-wrapper",onPointerdown:c,contenteditable:!1},pd(yC,{class:Ln("label",o.value&&"readonly",u.value),icon:d.value})),pd("div",{class:"children",ref:l}))}}),wC=R(H.node,e=>(t,n,r)=>{const o=document.createElement("div");o.className="milkdown-list-item-block";const i=document.createElement("div");i.setAttribute("data-content-dom","true"),i.classList.add("content-dom");const a=gs(t.attrs.label),s=gs(t.attrs.checked),l=gs(t.attrs.listType),c=gs(!n.editable),d=e.get(vC.key),u=gs(!1),h=al(()=>{u.value?o.classList.add("selected"):o.classList.remove("selected")});let p=0;const m=qd(bC,{label:a,checked:s,listType:l,readonly:c,config:d,selected:u,setAttr:(e,t)=>{if(!n.editable)return;const o=r();null!=o&&(n.hasFocus()||n.focus(),n.dispatch(n.state.tr.setNodeAttribute(o,e,t)))},onMount:e=>{if(i.parentNode===e)return;const{anchor:t,head:r}=n.state.selection;e.appendChild(i);const o=n.state.doc;p=requestAnimationFrame(()=>{if(p=0,n.isDestroyed)return;if(!o.eq(n.state.doc))return;if(n.state.selection.anchor!==t||n.state.selection.head!==r)return;const e=n.dom.ownerDocument.getSelection();if(e?.anchorNode&&n.dom.contains(e.anchorNode))try{if(n.posAtDOM(e.anchorNode,e.anchorOffset)!==t||e.focusNode&&n.posAtDOM(e.focusNode,e.focusOffset)!==r)return}catch{return}const i=S.create(n.state.doc,t,r);n.dispatch(n.state.tr.setSelection(i))})}});m.mount(o);const f=e=>{l.value=e.attrs.listType,a.value=e.attrs.label,s.value=e.attrs.checked,c.value=!n.editable};f(t);let g=t;return{dom:o,contentDOM:i,update:e=>e.type===t.type&&(e.sameMarkup(g)&&e.content.eq(g.content)||(g=e,f(e)),!0),ignoreMutation:e=>!o||!i||"selection"!==e.type&&(i===e.target&&"attributes"===e.type||!i.contains(e.target)),selectNode:()=>{u.value=!0},deselectNode:()=>{u.value=!1},destroy:()=>{cancelAnimationFrame(p),h(),m.unmount(),o.remove(),i.remove()}}});gC(wC,{displayName:"NodeView<list-item-block>",group:"ListItemBlock"});const xC=[vC,wC];var kC=Object.defineProperty,CC=Object.getOwnPropertySymbols,_C=Object.prototype.hasOwnProperty,SC=Object.prototype.propertyIsEnumerable,AC=(e,t,n)=>t in e?kC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,MC=(e,t)=>{for(var n in t||(t={}))_C.call(t,n)&&AC(e,n,t[n]);if(CC)for(var n of CC(t))SC.call(t,n)&&AC(e,n,t[n]);return e};function TC(e,t){return Object.assign(e,{meta:MC({package:"@milkdown/components"},t)}),e}var EC=Object.defineProperty,LC=Object.getOwnPropertySymbols,OC=Object.prototype.hasOwnProperty,IC=Object.prototype.propertyIsEnumerable,RC=(e,t,n)=>t in e?EC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const PC=a(((e,t)=>{for(var n in t||(t={}))OC.call(t,n)&&RC(e,n,t[n]);if(LC)for(var n of LC(t))IC.call(t,n)&&RC(e,n,t[n]);return e})({},{renderButton:e=>{switch(e){case"add_row":case"add_col":return"+";case"delete_row":case"delete_col":return"-";case"align_col_left":return"left";case"align_col_center":return"center";case"align_col_right":return"right";case"col_drag_handle":case"row_drag_handle":return"="}}}),"tableBlockConfigCtx");function BC({icon:e,class:t,onClick:n}){return pd("span",{class:Ln("milkdown-icon",t),onPointerdown:n,innerHTML:e?Sn.sanitize(e.trim()):void 0})}function zC(e){const{dragPreviewRef:t,tableWrapperRef:n,contentWrapperRef:r,yLineHandleRef:o,xLineHandleRef:i,colHandleRef:a,rowHandleRef:s}=e,l=t.value;if(!l)return;const c=n.value;if(!c)return;const d=r.value;if(!d)return;const u=d.querySelector("tbody");if(!u)return;const h=l.querySelector("tbody");if(!h)return;const p=o.value;if(!p)return;const m=i.value;if(!m)return;const f=a.value;if(!f)return;const g=s.value;return g?{preview:l,wrapper:c,content:d,contentRoot:u,previewRoot:h,yHandle:p,xHandle:m,colHandle:f,rowHandle:g}:void 0}function DC(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function NC(e,t,n,r,o){const{width:i,height:a}=r.querySelector("tbody").getBoundingClientRect();if("y"===e){const e=r.querySelectorAll("tr")[o];if(!e)return;n.appendChild(e.cloneNode(!0));const a=e.getBoundingClientRect().height;return Object.assign(t.style,{width:`${i}px`,height:`${a}px`}),void(t.dataset.show="true")}if("x"===e){const e=r.querySelectorAll("tr");let i;return Array.from(e).forEach(e=>{const t=e.children[o];if(!t)return;void 0===i&&(i=t.getBoundingClientRect().width);const r=t.parentElement.cloneNode(!1),a=t.cloneNode(!0);r.appendChild(a),n.appendChild(r)}),Object.assign(t.style,{width:`${i}px`,height:`${a}px`}),void(t.dataset.show="true")}}function HC(e,t,n,r){const{xHandle:o,yHandle:i,colHandle:a,rowHandle:s,preview:l}=n;o.dataset.displayType="y"===e?"indicator":"none",i.dataset.displayType="x"===e?"indicator":"none","y"===e?(a.dataset.show="false",jC(s)):(s.dataset.show="false",jC(a));const{hoverIndex:c,dragInfo:d}=r,[u,h]=c.value;d.value={startCoords:[t.clientX,t.clientY],startIndex:"y"===e?u:h,endIndex:"y"===e?u:h,type:"y"===e?"row":"col"},l.dataset.direction="y"===e?"vertical":"horizontal"}function qC(e,t,n,r){const o=null==n?void 0:n.get(T);if(!(null==o?void 0:o.editable))return;t.stopPropagation(),t.dataTransfer&&(t.dataTransfer.effectAllowed="move");const i=zC(e);i&&requestAnimationFrame(()=>{r(i)})}function jC(e){var t;null==(t=e.querySelector(".button-group"))||t.setAttribute("data-show","false")}function VC(e,t){for(let n=0;n<e.childCount;n++)if(e.child(n)===t)return n;return-1}function FC(e,[t,n]){const r=e.value;if(!r)return;const o=r.querySelectorAll("tr"),i=o[t];if(!i)return;const a=o[0];if(!a)return;const s=a.children[n];if(!s)return;const l=i.children[n];return l?{row:i,col:l,headerCol:s}:void 0}function $C({refs:e,index:t,before:n,after:r}){const{contentWrapperRef:o,colHandleRef:i,hoverIndex:a}=e,s=i.value;if(!s)return;a.value=t;const l=FC(o,t);if(!l)return;const{headerCol:c}=l;s.dataset.show="true",n&&n(s),b(c,s,{placement:"top"}).then(({x:e,y:t})=>{Object.assign(s.style,{left:`${e}px`,top:`${t}px`}),r&&r(s)}).catch(console.error)}function WC({refs:e,index:t,before:n,after:r}){const{contentWrapperRef:o,rowHandleRef:i,hoverIndex:a}=e,s=i.value;if(!s)return;a.value=t;const l=FC(o,t);if(!l)return;const{row:c}=l;s.dataset.show="true",n&&n(s),b(c,s,{placement:"left"}).then(({x:e,y:t})=>{Object.assign(s.style,{left:`${e}px`,top:`${t}px`}),r&&r(s)}).catch(console.error)}function UC(e,t,n){const r="x"===n?"left":"top",o="x"===n?"right":"bottom",i=e.length-1,a=e.findIndex((e,n)=>{const a=e.getBoundingClientRect(),s=a[r],l=a[o];return s<=t&&t<=l||n===i&&t>l||0===n&&t<s}),s=e[a];return s?[s,a]:void 0}TC(PC,{displayName:"Config<table-block>",group:"TableBlock"}),BC.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};const GC=ml({props:{view:{type:Object,required:!0},ctx:{type:Object,required:!0},getPos:{type:Function,required:!0},config:{type:Object,required:!0},onMount:{type:Function,required:!0},node:{type:Object,required:!0}},setup({view:e,node:t,ctx:n,getPos:r,config:o,onMount:i}){const a=gs(),s=e=>{null!=e&&(e instanceof HTMLElement?(a.value=e,i(e)):a.value=void 0)},l=gs(),c=gs(),d=gs(),u=gs(),h=gs(),p=gs(),m={dragPreviewRef:p,tableWrapperRef:h,contentWrapperRef:a,yLineHandleRef:u,xLineHandleRef:d,colHandleRef:l,rowHandleRef:c,hoverIndex:gs([0,0]),lineHoverIndex:gs([-1,-1]),dragInfo:gs()},{pointerLeave:f,pointerMove:v}=function(e,t){const n=function(e,t){return gr(n=>{if(!(null==t?void 0:t.editable))return;const{contentWrapperRef:r,yLineHandleRef:o,xLineHandleRef:i,colHandleRef:a,rowHandleRef:s,hoverIndex:l,lineHoverIndex:c}=e,d=o.value;if(!d)return;const u=i.value;if(!u)return;const h=r.value;if(!h)return;const p=s.value;if(!p)return;const m=a.value;if(!m)return;const f=function(e,t){var r,o,i;if(t)try{const n=t.posAtCoords({left:e.clientX,top:e.clientY});if(!n)return;const a=null==n?void 0:n.inside;if(null==a||a<0)return;const s=t.state.doc.resolve(a),l=t.state.doc.nodeAt(a);if(!l)return;const c=["table_cell","table_header"],d=["table_row","table_header_row"],u=c.includes(l.type.name)?l:null==(r=A(e=>c.includes(e.type.name))(s))?void 0:r.node,h=null==(o=A(e=>d.includes(e.type.name))(s))?void 0:o.node,p=null==(i=A(e=>"table"===e.type.name)(s))?void 0:i.node;if(!u||!h||!p)return;const m=VC(h,u);return[VC(p,h),m]}catch(n){return}}(n,t);if(!f)return;const g=FC(r,f);if(!g)return;const[v,y]=f,w=g.col.getBoundingClientRect(),k=Math.abs(n.clientX-w.left)<8,C=Math.abs(w.right-n.clientX)<8,_=Math.abs(n.clientY-w.top)<8,S=Math.abs(w.bottom-n.clientY)<8,M=k||C||_||S,T=p.querySelector(".button-group"),E=m.querySelector(".button-group");if(T&&(T.dataset.show="false"),E&&(E.dataset.show="false"),M){const e=h.getBoundingClientRect();p.dataset.show="false",m.dataset.show="false",u.dataset.displayType="tool",d.dataset.displayType="tool";const t=d.getBoundingClientRect().width,n=u.getBoundingClientRect().height;return k||C?(c.value[1]=k?y:y+1,b(g.col,d,{placement:k?"left":"right",middleware:[x(k?-1*t:0)]}).then(({x:t})=>{d.dataset.show="true",Object.assign(d.style,{height:`${e.height}px`,left:`${t}px`})}).catch(console.error)):d.dataset.show="false",void(0!==f[0]&&(_||S)?(c.value[0]=_?v:v+1,b(g.row,u,{placement:_?"top":"bottom",middleware:[x(_?-1*n:0)]}).then(({y:t})=>{u.dataset.show="true",Object.assign(u.style,{width:`${e.width}px`,top:`${t}px`})}).catch(console.error)):u.dataset.show="false")}c.value=[-1,-1],d.dataset.show="false",u.dataset.show="false",p.dataset.show="true",m.dataset.show="true",WC({refs:e,index:f}),$C({refs:e,index:f}),l.value=f},20)}(e,t),r=function(e){return()=>{const{rowHandleRef:t,colHandleRef:n,yLineHandleRef:r,xLineHandleRef:o}=e;setTimeout(()=>{const e=t.value;if(!e)return;const i=n.value;if(!i)return;const a=r.value;if(!a)return;const s=o.value;s&&(e.dataset.show="false",i.dataset.show="false",a.dataset.show="false",s.dataset.show="false")},200)}}(e);return{pointerMove:n,pointerLeave:r}}(m,e),{dragRow:y,dragCol:w}=function(e,t,n){const{dragPreviewRef:r,yLineHandleRef:o,xLineHandleRef:i,dragInfo:a}=e,s=function(e,t){return n=>{qC(e,n,t,t=>{HC("y",n,t,e);const{preview:r,content:o,previewRoot:i}=t;DC(i);const{hoverIndex:a}=e,[s]=a.value;NC("y",r,i,o,s)})}}(e,t),l=function(e,t){return n=>{qC(e,n,t,t=>{HC("x",n,t,e);const{preview:r,content:o,previewRoot:i}=t,{hoverIndex:a}=e,[s,l]=a.value;DC(i),NC("x",r,i,o,l)})}}(e,t),c=()=>{const e=r.value;if(!e)return;if("false"===e.dataset.show)return;const t=null==e?void 0:e.querySelector("tbody");for(;null==t?void 0:t.firstChild;)null==t||t.removeChild(t.firstChild);e&&(e.dataset.show="false")},d=()=>{var s;const l=r.value;if(!l)return;const c=o.value;if(!c)return;const d=i.value;if(!d)return;const u=a.value;if(!u)return;if(!t)return;if("false"===l.dataset.show)return;if(!e.colHandleRef.value)return;if(!e.rowHandleRef.value)return;if(c.dataset.show="false",d.dataset.show="false",u.startIndex===u.endIndex)return;const h=t.get(g),p={from:u.startIndex,to:u.endIndex,pos:(null!=(s=null==n?void 0:n())?s:0)+1};if("col"===u.type){h.call(kp.key,{pos:p.pos,index:u.startIndex}),h.call(wp.key,p);const t=[0,u.endIndex];$C({refs:e,index:t})}else{h.call(xp.key,{pos:p.pos,index:u.startIndex}),h.call(bp.key,p);const t=[u.endIndex,0];WC({refs:e,index:t})}requestAnimationFrame(()=>{t.get(T).focus()})},u=function(e){return gr(t=>{const n=zC(e);if(!n)return;const{preview:r,content:o,contentRoot:i,xHandle:a,yHandle:s}=n,{dragInfo:l,hoverIndex:c}=e;if("false"===r.dataset.show)return;const d=FC(e.contentWrapperRef,c.value);if(!d)return;if(!i.querySelector("tr"))return;const u=l.value;if(!u)return;if(!i.offsetParent)return;const h=i.offsetParent.offsetTop,p=i.offsetParent.offsetLeft;if("col"===u.type){const e=d.col.getBoundingClientRect().width,{left:n,width:a}=i.getBoundingClientRect(),l=p-n,c=t.clientX+l-e/2,[m]=u.startCoords,f=m<t.clientX?"right":"left";r.style.top=`${h}px`;const g=c<n+l-20?n+l-20:c>n+a+l-e+20?n+a+l-e+20:c;r.style.left=`${g}px`;const v=function(e,t){const n=e.querySelector("tr");if(n)return UC(Array.from(n.children),t,"x")}(i,t.clientX);if(v){const[e,t]=v,n=s.getBoundingClientRect().width,r=o.getBoundingClientRect();u.endIndex=t,b(e,s,{placement:"left"===f?"left":"right",middleware:[x("left"===f?-1*n:0)]}).then(({x:e})=>{s.dataset.show="true",Object.assign(s.style,{height:`${r.height}px`,left:`${e}px`,top:`${h}px`})}).catch(console.error)}}else if("row"===u.type){const e=d.row.getBoundingClientRect().height,{top:n,height:s}=i.getBoundingClientRect(),l=h-n,c=t.clientY+l-e/2,[m,f]=u.startCoords,g=f<t.clientY?"down":"up",v=c<n+l-20?n+l-20:c>n+s+l-e+20?n+s+l-e+20:c;r.style.top=`${v}px`,r.style.left=`${p}px`;const y=function(e,t){return UC(Array.from(e.querySelectorAll("tr")),t,"y")}(i,t.clientY);if(y){const[e,t]=y,n=a.getBoundingClientRect().height,r=o.getBoundingClientRect();u.endIndex=t,b(e,a,{placement:"up"===g?"top":"bottom",middleware:[x("up"===g?-1*n:0)]}).then(({y:e})=>{a.dataset.show="true",Object.assign(a.style,{width:`${r.width}px`,top:`${e}px`})}).catch(console.error)}}},20)}(e);return El(()=>{window.addEventListener("dragover",u),window.addEventListener("dragend",c),window.addEventListener("drop",d)}),Rl(()=>{window.removeEventListener("dragover",u),window.removeEventListener("dragend",c),window.removeEventListener("drop",d)}),{dragRow:s,dragCol:l}}(m,n,r),{onAddRow:k,onAddCol:C,selectCol:_,selectRow:S,deleteSelected:M,onAlign:E}=function(e,t,n){const{xLineHandleRef:r,contentWrapperRef:o,colHandleRef:i,rowHandleRef:a,hoverIndex:s,lineHoverIndex:l}=e;return{onAddRow:()=>{var e,i,a;if(!t)return;const s=r.value;if(!s)return;const[c]=l.value;if(c<0)return;if(!t.get(T).editable)return;const d=Array.from(null!=(i=null==(e=o.value)?void 0:e.querySelectorAll("tr"))?i:[]),u=t.get(g),h=(null!=(a=null==n?void 0:n())?a:0)+1;d.length===c?(u.call(xp.key,{pos:h,index:c-1}),u.call(Tp.key)):(u.call(xp.key,{pos:h,index:c}),u.call(Mp.key)),u.call(xp.key,{pos:h,index:c}),s.dataset.show="false"},onAddCol:()=>{var e,i,a,s;if(!t)return;if(!r.value)return;const[c,d]=l.value;if(d<0)return;if(!t.get(T).editable)return;const u=Array.from(null!=(a=null==(i=null==(e=o.value)?void 0:e.querySelector("tr"))?void 0:i.children)?a:[]),h=t.get(g),p=(null!=(s=null==n?void 0:n())?s:0)+1;u.length===d?(h.call(kp.key,{pos:p,index:d-1}),h.call(Ap.key)):(h.call(kp.key,{pos:p,index:d}),h.call(Sp.key)),h.call(kp.key,{pos:p,index:d})},selectCol:()=>{var e,r;if(!t)return;const[o,a]=s.value,l=t.get(g),c=(null!=(e=null==n?void 0:n())?e:0)+1;l.call(kp.key,{pos:c,index:a});const d=null==(r=i.value)?void 0:r.querySelector(".button-group");d&&(d.dataset.show="true"===d.dataset.show?"false":"true")},selectRow:()=>{var e,r;if(!t)return;const[o,i]=s.value,l=t.get(g),c=(null!=(e=null==n?void 0:n())?e:0)+1;l.call(xp.key,{pos:c,index:o});const d=null==(r=a.value)?void 0:r.querySelector(".button-group");d&&o>0&&(d.dataset.show="true"===d.dataset.show?"false":"true")},deleteSelected:e=>{t&&t.get(T).editable&&(e.preventDefault(),e.stopPropagation(),t.get(g).call(_p.key),requestAnimationFrame(()=>{t.get(T).focus()}))},onAlign:e=>n=>{t&&t.get(T).editable&&(n.preventDefault(),n.stopPropagation(),t.get(g).call(Ep.key,e),requestAnimationFrame(()=>{t.get(T).focus()}))}}}(m,n,r);return El(()=>{requestAnimationFrame(()=>{e.editable&&function(e,t,n){if(!n)return;if(!t)return;const{selection:r}=t.state;if(!(r instanceof Zu))return;const{$from:o}=r,i=rh(o);if(i&&i.node===n){if(r.isColSelection()){const{$head:t}=r;return void $C({refs:e,index:[0,t.index(t.depth-1)],before:e=>{var t;null==(t=e.querySelector(".button-group"))||t.setAttribute("data-show","true")}})}if(r.isRowSelection()){const{$head:t}=r,n=A(e=>"table_row"===e.type.name||"table_header_row"===e.type.name)(t);if(!n)return;const o=VC(i.node,n.node);WC({refs:e,index:[o,0],before:e=>{var t;o>0&&(null==(t=e.querySelector(".button-group"))||t.setAttribute("data-show","true"))}})}}}(m,e,t.value)})}),()=>pd("div",{onDragstart:e=>e.preventDefault(),onDragover:e=>e.preventDefault(),onDragleave:e=>e.preventDefault(),onPointermove:v,onPointerleave:f},pd("div",{"data-show":"false",contenteditable:"false",draggable:"true","data-role":"col-drag-handle",class:"handle cell-handle",onDragstart:w,onClick:_,onPointerdown:e=>e.stopPropagation(),onPointermove:e=>e.stopPropagation(),ref:l},pd(BC,{icon:o.renderButton("col_drag_handle")}),pd("div",{"data-show":"false",class:"button-group",onPointermove:e=>e.stopPropagation()},pd("button",{type:"button",onPointerdown:E("left")},pd(BC,{icon:o.renderButton("align_col_left")})),pd("button",{type:"button",onPointerdown:E("center")},pd(BC,{icon:o.renderButton("align_col_center")})),pd("button",{type:"button",onPointerdown:E("right")},pd(BC,{icon:o.renderButton("align_col_right")})),pd("button",{type:"button",onPointerdown:M},pd(BC,{icon:o.renderButton("delete_col")})))),pd("div",{"data-show":"false",contenteditable:"false",draggable:"true","data-role":"row-drag-handle",class:"handle cell-handle",onDragstart:y,onClick:S,onPointerdown:e=>e.stopPropagation(),onPointermove:e=>e.stopPropagation(),ref:c},pd(BC,{icon:o.renderButton("row_drag_handle")}),pd("div",{"data-show":"false",class:"button-group",onPointermove:e=>e.stopPropagation()},pd("button",{type:"button",onPointerdown:M},pd(BC,{icon:o.renderButton("delete_row")})))),pd("div",{class:"table-wrapper",ref:h},pd("div",{"data-show":"false",class:"drag-preview","data-direction":"vertical",ref:p},pd("table",null,pd("tbody",null))),pd("div",{"data-show":"false",contenteditable:"false","data-display-type":"tool","data-role":"x-line-drag-handle",class:"handle line-handle",onPointermove:e=>e.stopPropagation(),ref:d},pd("button",{type:"button",onClick:k,class:"add-button"},pd(BC,{icon:o.renderButton("add_row")}))),pd("div",{"data-show":"false",contenteditable:"false","data-display-type":"tool","data-role":"y-line-drag-handle",class:"handle line-handle",onPointermove:e=>e.stopPropagation(),ref:u},pd("button",{type:"button",onClick:C,class:"add-button"},pd(BC,{icon:o.renderButton("add_col")}))),pd("table",{ref:s,class:"children"})))}});var ZC,XC,KC=e=>{throw TypeError(e)};class YC{constructor(e,t,n,r){this.ctx=e,this.node=t,this.view=n,this.getPos=r,((e,t)=>{t.has(e)?KC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,void 0)})(this,ZC);const o=document.createElement("div");o.className="milkdown-table-block";const i=document.createElement("tbody");this.contentDOM=i,i.setAttribute("data-content-dom","true"),i.classList.add("content-dom"),this.nodeRef=vs(t);const a=qd(GC,{view:n,ctx:e,getPos:r,config:e.get(PC.key),onMount:e=>{e.appendChild(i)},node:this.nodeRef});a.mount(o),this.app=a,this.dom=o}update(e){return!(e.type!==this.node.type||e.sameMarkup(this.node)&&e.content.eq(this.node.content)||(this.node=e,this.nodeRef.value=e,0))}stopEvent(e){if("drop"===e.type||e.type.startsWith("drag"))return!0;if("mousedown"===e.type||"pointerdown"===e.type){if(e.target instanceof Element&&e.target.closest("button"))return!0;const t=e.target;if(t instanceof HTMLElement&&(t.closest("th")||t.closest("td"))){const t=e;return((e,t,n)=>((e=>{ZC.has(e)||KC("Cannot access private method")})(this),n))(0,0,XC).call(this,t)}}return!1}ignoreMutation(e){return!this.dom||!this.contentDOM||"selection"!==e.type&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target))}destroy(){this.app.unmount(),this.dom.remove(),this.contentDOM.remove()}}ZC=new WeakSet,XC=function(e){const t=this.view;if(!t.editable)return!1;const{state:n,dispatch:r}=t,o=t.posAtCoords({left:e.clientX,top:e.clientY});if(!o)return!1;const i=n.doc.resolve(o.inside),a=A(e=>"table_cell"===e.type.name||"table_header"===e.type.name)(i);if(!a)return!1;if(n.selection instanceof S){const e=A(e=>"table_cell"===e.type.name||"table_header"===e.type.name)(n.selection.$from);if((null==e?void 0:e.node)===a.node)return!1}const{from:s}=a,l=M.create(n.doc,s+1);return!n.selection.eq(l)&&(n.selection instanceof Zu?setTimeout(()=>{r(n.tr.setSelection(l).scrollIntoView())},20):requestAnimationFrame(()=>{r(n.tr.setSelection(l).scrollIntoView())}),!0)};const JC=R(ip.node,e=>(t,n,r)=>new YC(e,t,n,r));TC(JC,{displayName:"NodeView<table-block>",group:"TableBlock"});const QC=[PC,JC];function e_(e){if(!e)return!1;if(Array.isArray(e))return!(e.length>1)&&e_(e[0]);const t=e.content;return t?e_(t):"text"===e.type}function t_(e,t){const n=ue(t);if(n)return e.dispatch(e.state.tr.replaceSelectionWith(n,!0)),!0;try{return e.dispatch(e.state.tr.replaceSelection(t)),!0}catch{return!1}}var n_=s(e=>{const t=e.get(ae);return e.update(se,e=>({...e,editable:e.editable??(()=>!0),transformPastedHTML:(t,n)=>{const r=e.transformPastedHTML;return r&&(t=r(t,n)),t.includes("docs-internal-guid")&&(t=(t=t.replace(/<b[^>]*id="docs-internal-guid[^"]*"[^>]*>([\s\S]*)<\/b>/,"$1")).replace(/<div[^>]*>(<table[\s\S]*?<\/table>)<\/div>/g,"$1")),t}})),new c({key:new d("MILKDOWN_CLIPBOARD"),props:{handlePaste:(n,r,o)=>{const i=e.get(u),a=n.props.editable?.(n.state),{clipboardData:s}=r;if(!a||!s)return!1;if(n.state.selection.$from.node().type.spec.code)return!1;const l=s.getData("text/plain"),c=s.getData("vscode-editor-data");if(c){const e=JSON.parse(c)?.mode;if(l&&e){const{tr:r}=n.state,o=ce("code_block",t);return r.replaceSelectionWith(o.create({language:e})).setSelection(S.near(r.doc.resolve(Math.max(0,r.selection.from-2)))).insertText(l.replace(/\r\n?/g,"\n")),n.dispatch(r),!0}}const d=s.getData("text/html");if(0===d.length&&0===l.length)return!1;if(d.length>0&&o)return t_(n,o);const h=de.fromSchema(t);let p;if(0===d.length){const e=i(l);if(!e||"string"==typeof e)return!1;p=y.fromSchema(t).serializeFragment(e.content)}else{const e=document.createElement("template");e.innerHTML=d,p=e.content.cloneNode(!0),e.remove()}return t_(n,h.parseSlice(p))},clipboardTextSerializer:n=>{const r=e.get(le);if(e_(n.content.toJSON()))return n.content.textBetween(0,n.content.size,"\n\n");const o=t.topNodeType.createAndFill(void 0,n.content);return o?r(o):""}}})});function r_(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-history",...t}}),e}!function(e){Object.assign(e,{meta:{package:"@milkdown/plugin-clipboard",displayName:"Prose<clipboard>"}})}(n_);var o_=l("Undo",()=>()=>Q);r_(o_,{displayName:"Command<undo>"});var i_=l("Redo",()=>()=>ee);r_(i_,{displayName:"Command<redo>"});var a_=a({},"historyProviderConfig");r_(a_,{displayName:"Ctx<historyProviderConfig>"});var s_=s(e=>he(e.get(a_.key)));r_(s_,{displayName:"Ctx<historyProviderPlugin>"});var l_=$("historyKeymap",{Undo:{shortcuts:"Mod-z",command:e=>{const t=e.get(g);return()=>t.call(o_.key)}},Redo:{shortcuts:["Mod-y","Shift-Mod-z"],command:e=>{const t=e.get(g);return()=>t.call(i_.key)}}});r_(l_.ctx,{displayName:"KeymapCtx<history>"}),r_(l_.shortcuts,{displayName:"Keymap<history>"});var c_=[a_,s_,l_,o_,i_].flat(),d_=a({type:"space",size:2},"indentConfig");d_.meta={package:"@milkdown/plugin-indent",displayName:"Ctx<indentConfig>"};var u_=pe(e=>({Tab:(t,n)=>{const r=e.get(d_.key),{tr:o}=t,i=function(e,t){const{doc:n,selection:r}=e;if(!n||!r)return e;if(!(r instanceof S||r instanceof me))return e;const{to:o}=r,i="space"===t.type?Array(t.size).fill(" ").join(""):"\t";return e.insertText(i,o)}(o,r);return!!i.docChanged&&(n?.(i),!0)}}));u_.meta={package:"@milkdown/plugin-indent",displayName:"Shortcut<indent>"};var h_=[d_,u_],p_=class{constructor(){this.beforeMountedListeners=[],this.mountedListeners=[],this.updatedListeners=[],this.selectionUpdatedListeners=[],this.markdownUpdatedListeners=[],this.blurListeners=[],this.focusListeners=[],this.destroyListeners=[],this.beforeMount=e=>(this.beforeMountedListeners.push(e),this),this.mounted=e=>(this.mountedListeners.push(e),this),this.updated=e=>(this.updatedListeners.push(e),this)}get listeners(){return{beforeMount:this.beforeMountedListeners,mounted:this.mountedListeners,updated:this.updatedListeners,markdownUpdated:this.markdownUpdatedListeners,blur:this.blurListeners,focus:this.focusListeners,destroy:this.destroyListeners,selectionUpdated:this.selectionUpdatedListeners}}markdownUpdated(e){return this.markdownUpdatedListeners.push(e),this}blur(e){return this.blurListeners.push(e),this}focus(e){return this.focusListeners.push(e),this}destroy(e){return this.destroyListeners.push(e),this}selectionUpdated(e){return this.selectionUpdatedListeners.push(e),this}},m_=fe(new p_,"listener"),f_=new d("MILKDOWN_LISTENER"),g_=e=>(e.inject(m_,new p_),async()=>{await e.wait(ge);const{listeners:t}=e.get(m_);t.beforeMount.forEach(t=>t(e)),await e.wait(ve);const n=e.get(le);let r=null,o=null,i=null,a=null;const s=hr(()=>{if(!a)return;const{doc:i}=a;if(t.updated.length>0&&r&&!r.eq(i)&&t.updated.forEach(t=>{t(e,i,r)}),t.markdownUpdated.length>0&&r&&!r.eq(i)){const r=n(i);t.markdownUpdated.forEach(t=>{t(e,r,o)}),o=r}r=i,a=null},200),l=new c({key:f_,view:()=>({destroy:()=>{s.cancel(),t.destroy.forEach(t=>t(e))}}),props:{handleDOMEvents:{focus:()=>(t.focus.forEach(t=>t(e)),!1),blur:()=>(t.blur.forEach(t=>t(e)),!1)}},state:{init:(e,t)=>{r=t.doc,o=n(t.doc)},apply:n=>{const r=n.selection;(!i&&r||i&&!r.eq(i))&&(t.selectionUpdated.forEach(t=>{t(e,r,i)}),i=r),(n.docChanged||n.storedMarksSet)&&!1!==n.getMeta("addToHistory")&&(a=n,s())}}});e.update(ye,e=>e.concat(l)),await e.wait(be),t.mounted.forEach(t=>t(e))});g_.meta={package:"@milkdown/plugin-listener",displayName:"Listener"};var v_=a({shouldAppend:e=>!!e&&!["heading","paragraph"].includes(e.type.name),getNode:e=>e.schema.nodes.paragraph.create()},"trailingConfig");v_.meta={package:"@milkdown/plugin-trailing",displayName:"Ctx<trailingConfig>"};var y_=s(e=>{const t=new d("MILKDOWN_TRAILING"),{shouldAppend:n,getNode:r}=e.get(v_.key),o=new c({key:t,state:{init:(e,t)=>{const r=t.tr.doc.lastChild;return n(r,t)},apply:(e,t,r,o)=>{if(!e.docChanged)return t;const i=e.doc.lastChild;return n(i,o)}},appendTransaction:(e,t,n)=>{const{doc:i,tr:a}=n,s=r?.(n),l=o.getState(n),c=i.content.size;if(l&&s)return a.insert(c,s)}});return o});y_.meta={package:"@milkdown/plugin-trailing",displayName:"Prose<trailing>"};var b_=[v_,y_],w_=a({uploader:async(e,t)=>{const n=[];for(let o=0;o<e.length;o++){const t=e.item(o);t&&t.type.includes("image")&&n.push(t)}const{image:r}=t.nodes;if(!r)throw we("image");return(await Promise.all(n.map(e=>function(e){return new Promise(t=>{const n=new FileReader;n.addEventListener("load",()=>{t({alt:e.name,src:n.result})},!1),n.readAsDataURL(e)})}(e)))).map(({alt:e,src:t})=>r.createAndFill({src:t,alt:e}))},enableHtmlFileUploader:!1,uploadWidgetFactory:(e,t)=>{const n=document.createElement("span");return n.textContent="Upload in progress...",v.widget(e,n,t)}},"uploadConfig");w_.meta={package:"@milkdown/plugin-upload",displayName:"Ctx<uploadConfig>"};var x_=s(e=>{const t=new d("MILKDOWN_UPLOAD"),n=(n,r,o)=>{if(!o||o.length<=0)return!1;const i=Symbol("upload symbol"),a=e.get(ae),{uploader:s,getInsertPos:l}=e.get(w_.key),{tr:c}=n.state,d=r instanceof DragEvent?n.posAtCoords({left:r.clientX,top:r.clientY})?.pos??c.selection.from:c.selection.from,u="function"==typeof l?l(r,e,d):d;return n.dispatch(c.setMeta(t,{add:{id:i,pos:u}})),s(o,a,e,u).then(e=>{const r=((e,n)=>{const r=t.getState(e);if(!r)return-1;const o=r.find(void 0,void 0,e=>e.id===n);return o.length?o[0]?.from??-1:-1})(n.state,i);r<0||n.dispatch(n.state.tr.replaceWith(r,r,e).setMeta(t,{remove:{id:i}}))}).catch(e=>{console.error(e)}),!0};return new c({key:t,state:{init:()=>f.empty,apply(t,n){const r=n.map(t.mapping,t.doc),o=t.getMeta(this);if(!o)return r;if(o.add){const{uploadWidgetFactory:n}=e.get(w_.key),i=n(o.add.pos,{id:o.add.id});return r.add(t.doc,[i])}if(o.remove){const e=r.find(void 0,void 0,e=>e.id===o.remove.id);return r.remove(e)}return r}},props:{decorations(e){return this.getState(e)},handlePaste:(t,r)=>{const{enableHtmlFileUploader:o}=e.get(w_.key);return r instanceof ClipboardEvent&&!(!o&&r.clipboardData?.getData("text/html"))&&n(t,r,r.clipboardData?.files)},handleDrop:(e,t)=>t instanceof DragEvent&&n(e,t,t.dataTransfer?.files)}})});x_.meta={package:"@milkdown/plugin-upload",displayName:"Prose<upload>"};var k_=[w_,x_],C_=(e=>(e.CodeMirror="code-mirror",e.ListItem="list-item",e.LinkTooltip="link-tooltip",e.Cursor="cursor",e.ImageBlock="image-block",e.BlockEdit="block-edit",e.Toolbar="toolbar",e.Placeholder="placeholder",e.Table="table",e.Latex="latex",e.TopBar="top-bar",e.AI="ai",e))(C_||{});const __={cursor:!0,"list-item":!0,"link-tooltip":!0,"image-block":!0,"block-edit":!0,placeholder:!0,toolbar:!0,"code-mirror":!0,table:!0,latex:!0,"top-bar":!1,ai:!1},S_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M19 9l1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm0 14l1.25-2.75L23 19l-2.75-1.25L19 15l-1.25 2.75L15 19l2.75 1.25zM9 20l3-6.5L18 10l-6-3.5L9 0L6 6.5L0 10l6 3.5z"\n transform="translate(3 3) scale(0.75)"\n />\n </svg>\n',A_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M8.85758 18.625C8.4358 18.625 8.07715 18.4772 7.78163 18.1817C7.48613 17.8862 7.33838 17.5275 7.33838 17.1058V6.8942C7.33838 6.47242 7.48613 6.11377 7.78163 5.81825C8.07715 5.52275 8.4358 5.375 8.85758 5.375H12.1999C13.2191 5.375 14.1406 5.69231 14.9643 6.32693C15.788 6.96154 16.1999 7.81603 16.1999 8.89038C16.1999 9.63779 16.0194 10.2471 15.6585 10.7183C15.2976 11.1894 14.9088 11.5314 14.4922 11.7442C15.005 11.9211 15.4947 12.2708 15.9614 12.7933C16.428 13.3157 16.6614 14.0192 16.6614 14.9038C16.6614 16.182 16.1902 17.1217 15.2479 17.723C14.3056 18.3243 13.3563 18.625 12.3999 18.625H8.85758ZM9.4883 16.6327H12.3191C13.1063 16.6327 13.6627 16.4141 13.9884 15.9769C14.314 15.5397 14.4768 15.1205 14.4768 14.7192C14.4768 14.3179 14.314 13.8987 13.9884 13.4615C13.6627 13.0243 13.0909 12.8057 12.273 12.8057H9.4883V16.6327ZM9.4883 10.875H12.0826C12.6903 10.875 13.172 10.7013 13.5278 10.3539C13.8836 10.0064 14.0615 9.59037 14.0615 9.10575C14.0615 8.59035 13.8733 8.16918 13.497 7.84225C13.1207 7.51533 12.6595 7.35188 12.1133 7.35188H9.4883V10.875Z"\n />\n </svg>\n',M_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_8070)">\n <path\n d="M4 10.5C3.17 10.5 2.5 11.17 2.5 12C2.5 12.83 3.17 13.5 4 13.5C4.83 13.5 5.5 12.83 5.5 12C5.5 11.17 4.83 10.5 4 10.5ZM4 4.5C3.17 4.5 2.5 5.17 2.5 6C2.5 6.83 3.17 7.5 4 7.5C4.83 7.5 5.5 6.83 5.5 6C5.5 5.17 4.83 4.5 4 4.5ZM4 16.5C3.17 16.5 2.5 17.18 2.5 18C2.5 18.82 3.18 19.5 4 19.5C4.82 19.5 5.5 18.82 5.5 18C5.5 17.18 4.83 16.5 4 16.5ZM8 19H20C20.55 19 21 18.55 21 18C21 17.45 20.55 17 20 17H8C7.45 17 7 17.45 7 18C7 18.55 7.45 19 8 19ZM8 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11H8C7.45 11 7 11.45 7 12C7 12.55 7.45 13 8 13ZM7 6C7 6.55 7.45 7 8 7H20C20.55 7 21 6.55 21 6C21 5.45 20.55 5 20 5H8C7.45 5 7 5.45 7 6Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_8070">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',T_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n fill="none"\n viewBox="0 0 24 24"\n stroke-width="1.5"\n stroke="currentColor"\n class="w-6 h-6"\n >\n <path\n stroke-linecap="round"\n stroke-linejoin="round"\n d="M19.5 8.25l-7.5 7.5-7.5-7.5"\n />\n </svg>\n',E_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_1098_15553)">\n <path\n d="M18.3007 5.70973C17.9107 5.31973 17.2807 5.31973 16.8907 5.70973L12.0007 10.5897L7.1107 5.69973C6.7207 5.30973 6.0907 5.30973 5.7007 5.69973C5.3107 6.08973 5.3107 6.71973 5.7007 7.10973L10.5907 11.9997L5.7007 16.8897C5.3107 17.2797 5.3107 17.9097 5.7007 18.2997C6.0907 18.6897 6.7207 18.6897 7.1107 18.2997L12.0007 13.4097L16.8907 18.2997C17.2807 18.6897 17.9107 18.6897 18.3007 18.2997C18.6907 17.9097 18.6907 17.2797 18.3007 16.8897L13.4107 11.9997L18.3007 7.10973C18.6807 6.72973 18.6807 6.08973 18.3007 5.70973Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_1098_15553">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',L_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_8081)">\n <path\n d="M9.4 16.6L4.8 12L9.4 7.4L8 6L2 12L8 18L9.4 16.6ZM14.6 16.6L19.2 12L14.6 7.4L16 6L22 12L16 18L14.6 16.6Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_8081">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',O_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n fill="none"\n >\n <g clip-path="url(#clip0_1013_1606)">\n <path\n d="M9.00012 16.1998L5.50012 12.6998C5.11012 12.3098 4.49012 12.3098 4.10012 12.6998C3.71012 13.0898 3.71012 13.7098 4.10012 14.0998L8.29012 18.2898C8.68012 18.6798 9.31012 18.6798 9.70012 18.2898L20.3001 7.69982C20.6901 7.30982 20.6901 6.68982 20.3001 6.29982C19.9101 5.90982 19.2901 5.90982 18.9001 6.29982L9.00012 16.1998Z"\n fill="#817567"\n />\n </g>\n <defs>\n <clipPath id="clip0_1013_1606">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',I_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n height="24px"\n viewBox="0 -960 960 960"\n width="24px"\n fill="none"\n >\n <path\n d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"\n />\n </svg>\n',R_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_7900)">\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M19 13H5C4.45 13 4 12.55 4 12C4 11.45 4.45 11 5 11H19C19.55 11 20 11.45 20 12C20 12.55 19.55 13 19 13Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_7900">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',P_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="16"\n height="16"\n viewBox="0 0 16 16"\n >\n <path\n d="M3.5 9.83366C3.35833 9.83366 3.23961 9.78571 3.14383 9.68983C3.04794 9.59394 3 9.47516 3 9.33349C3 9.19171 3.04794 9.07299 3.14383 8.97733C3.23961 8.88155 3.35833 8.83366 3.5 8.83366H12.5C12.6417 8.83366 12.7604 8.8816 12.8562 8.97749C12.9521 9.07338 13 9.19216 13 9.33383C13 9.4756 12.9521 9.59433 12.8562 9.68999C12.7604 9.78577 12.6417 9.83366 12.5 9.83366H3.5ZM3.5 7.16699C3.35833 7.16699 3.23961 7.11905 3.14383 7.02316C3.04794 6.92727 3 6.80849 3 6.66683C3 6.52505 3.04794 6.40633 3.14383 6.31066C3.23961 6.21488 3.35833 6.16699 3.5 6.16699H12.5C12.6417 6.16699 12.7604 6.21494 12.8562 6.31083C12.9521 6.40671 13 6.52549 13 6.66716C13 6.80894 12.9521 6.92766 12.8562 7.02333C12.7604 7.1191 12.6417 7.16699 12.5 7.16699H3.5Z"\n />\n </svg>\n',B_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_1013_1585)">\n <path\n d="M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.09 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_1013_1585">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',z_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M9 16l-5-5l5-5l1.4 1.4L7.825 10H18V6h2v6H7.825l2.575 2.6z"\n />\n </svg>\n',D_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_8075)">\n <path\n d="M19 5V19H5V5H19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM14.14 11.86L11.14 15.73L9 13.14L6 17H18L14.14 11.86Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_8075">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',N_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M6.29811 18.625C6.04505 18.625 5.83115 18.5375 5.65641 18.3626C5.48166 18.1877 5.39429 17.9736 5.39429 17.7203C5.39429 17.467 5.48166 17.2532 5.65641 17.0788C5.83115 16.9045 6.04505 16.8173 6.29811 16.8173H9.21159L12.452 7.18265H9.53851C9.28545 7.18265 9.07155 7.0952 8.89681 6.9203C8.72206 6.7454 8.63469 6.5313 8.63469 6.278C8.63469 6.02472 8.72206 5.81089 8.89681 5.63652C9.07155 5.46217 9.28545 5.375 9.53851 5.375H16.8847C17.1377 5.375 17.3516 5.46245 17.5264 5.63735C17.7011 5.81225 17.7885 6.02634 17.7885 6.27962C17.7885 6.53293 17.7011 6.74676 17.5264 6.92113C17.3516 7.09548 17.1377 7.18265 16.8847 7.18265H14.2789L11.0385 16.8173H13.6443C13.8973 16.8173 14.1112 16.9048 14.286 17.0797C14.4607 17.2546 14.5481 17.4687 14.5481 17.722C14.5481 17.9752 14.4607 18.1891 14.286 18.3634C14.1112 18.5378 13.8973 18.625 13.6443 18.625H6.29811Z"\n />\n </svg>\n',H_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M17.0385 19.5003V16.5388H14.0769V15.0388H17.0385V12.0773H18.5384V15.0388H21.5V16.5388H18.5384V19.5003H17.0385ZM10.8077 16.5388H7.03845C5.78282 16.5388 4.7125 16.0963 3.8275 15.2114C2.9425 14.3266 2.5 13.2564 2.5 12.0009C2.5 10.7454 2.9425 9.67504 3.8275 8.78979C4.7125 7.90454 5.78282 7.46191 7.03845 7.46191H10.8077V8.96186H7.03845C6.1987 8.96186 5.48235 9.25834 4.8894 9.85129C4.29645 10.4442 3.99998 11.1606 3.99998 12.0003C3.99998 12.8401 4.29645 13.5564 4.8894 14.1494C5.48235 14.7423 6.1987 15.0388 7.03845 15.0388H10.8077V16.5388ZM8.25 12.7503V11.2504H15.75V12.7503H8.25ZM21.5 12.0003H20C20 11.1606 19.7035 10.4442 19.1106 9.85129C18.5176 9.25834 17.8013 8.96186 16.9615 8.96186H13.1923V7.46191H16.9615C18.2171 7.46191 19.2875 7.90441 20.1725 8.78939C21.0575 9.67439 21.5 10.7447 21.5 12.0003Z"\n />\n </svg>\n',q_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_8067)">\n <path\n d="M8 7H20C20.55 7 21 6.55 21 6C21 5.45 20.55 5 20 5H8C7.45 5 7 5.45 7 6C7 6.55 7.45 7 8 7ZM20 17H8C7.45 17 7 17.45 7 18C7 18.55 7.45 19 8 19H20C20.55 19 21 18.55 21 18C21 17.45 20.55 17 20 17ZM20 11H8C7.45 11 7 11.45 7 12C7 12.55 7.45 13 8 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11ZM4.5 16H2.5C2.22 16 2 16.22 2 16.5C2 16.78 2.22 17 2.5 17H4V17.5H3.5C3.22 17.5 3 17.72 3 18C3 18.28 3.22 18.5 3.5 18.5H4V19H2.5C2.22 19 2 19.22 2 19.5C2 19.78 2.22 20 2.5 20H4.5C4.78 20 5 19.78 5 19.5V16.5C5 16.22 4.78 16 4.5 16ZM2.5 5H3V7.5C3 7.78 3.22 8 3.5 8C3.78 8 4 7.78 4 7.5V4.5C4 4.22 3.78 4 3.5 4H2.5C2.22 4 2 4.22 2 4.5C2 4.78 2.22 5 2.5 5ZM4.5 10H2.5C2.22 10 2 10.22 2 10.5C2 10.78 2.22 11 2.5 11H3.8L2.12 12.96C2.04 13.05 2 13.17 2 13.28V13.5C2 13.78 2.22 14 2.5 14H4.5C4.78 14 5 13.78 5 13.5C5 13.22 4.78 13 4.5 13H3.2L4.88 11.04C4.96 10.95 5 10.83 5 10.72V10.5C5 10.22 4.78 10 4.5 10Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_8067">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',j_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_971_7676)">\n <path\n d="M18 13H13V18C13 18.55 12.55 19 12 19C11.45 19 11 18.55 11 18V13H6C5.45 13 5 12.55 5 12C5 11.45 5.45 11 6 11H11V6C11 5.45 11.45 5 12 5C12.55 5 13 5.45 13 6V11H18C18.55 11 19 11.45 19 12C19 12.55 18.55 13 18 13Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_971_7676">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',V_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_7897)">\n <path\n d="M7.17 17C7.68 17 8.15 16.71 8.37 16.26L9.79 13.42C9.93 13.14 10 12.84 10 12.53V8C10 7.45 9.55 7 9 7H5C4.45 7 4 7.45 4 8V12C4 12.55 4.45 13 5 13H7L5.97 15.06C5.52 15.95 6.17 17 7.17 17ZM17.17 17C17.68 17 18.15 16.71 18.37 16.26L19.79 13.42C19.93 13.14 20 12.84 20 12.53V8C20 7.45 19.55 7 19 7H15C14.45 7 14 7.45 14 8V12C14 12.55 14.45 13 15 13H17L15.97 15.06C15.52 15.95 16.17 17 17.17 17Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_7897">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',F_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M7.30775 20.4997C6.81058 20.4997 6.385 20.3227 6.031 19.9687C5.677 19.6147 5.5 19.1892 5.5 18.692V5.99973H5.25C5.0375 5.99973 4.85942 5.92782 4.71575 5.78398C4.57192 5.64015 4.5 5.46198 4.5 5.24948C4.5 5.03682 4.57192 4.85873 4.71575 4.71523C4.85942 4.57157 5.0375 4.49973 5.25 4.49973H9C9 4.2549 9.08625 4.04624 9.25875 3.87374C9.43108 3.7014 9.63967 3.61523 9.8845 3.61523H14.1155C14.3603 3.61523 14.5689 3.7014 14.7413 3.87374C14.9138 4.04624 15 4.2549 15 4.49973H18.75C18.9625 4.49973 19.1406 4.57165 19.2843 4.71548C19.4281 4.85932 19.5 5.03748 19.5 5.24998C19.5 5.46265 19.4281 5.64073 19.2843 5.78423C19.1406 5.9279 18.9625 5.99973 18.75 5.99973H18.5V18.692C18.5 19.1892 18.323 19.6147 17.969 19.9687C17.615 20.3227 17.1894 20.4997 16.6923 20.4997H7.30775ZM17 5.99973H7V18.692C7 18.7818 7.02883 18.8556 7.0865 18.9132C7.14417 18.9709 7.21792 18.9997 7.30775 18.9997H16.6923C16.7821 18.9997 16.8558 18.9709 16.9135 18.9132C16.9712 18.8556 17 18.7818 17 18.692V5.99973ZM10.1543 16.9997C10.3668 16.9997 10.5448 16.9279 10.6885 16.7842C10.832 16.6404 10.9037 16.4622 10.9037 16.2497V8.74973C10.9037 8.53723 10.8318 8.35907 10.688 8.21523C10.5443 8.07157 10.3662 7.99973 10.1535 7.99973C9.941 7.99973 9.76292 8.07157 9.61925 8.21523C9.47575 8.35907 9.404 8.53723 9.404 8.74973V16.2497C9.404 16.4622 9.47583 16.6404 9.6195 16.7842C9.76333 16.9279 9.94158 16.9997 10.1543 16.9997ZM13.8465 16.9997C14.059 16.9997 14.2371 16.9279 14.3807 16.7842C14.5243 16.6404 14.596 16.4622 14.596 16.2497V8.74973C14.596 8.53723 14.5242 8.35907 14.3805 8.21523C14.2367 8.07157 14.0584 7.99973 13.8458 7.99973C13.6333 7.99973 13.4552 8.07157 13.3115 8.21523C13.168 8.35907 13.0962 8.53723 13.0962 8.74973V16.2497C13.0962 16.4622 13.1682 16.6404 13.312 16.7842C13.4557 16.9279 13.6338 16.9997 13.8465 16.9997Z"\n />\n </svg>\n',$_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n fill="none"\n viewBox="0 0 24 24"\n stroke-width="1.5"\n stroke="currentColor"\n class="w-6 h-6"\n >\n <path\n stroke-linecap="round"\n stroke-linejoin="round"\n d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"\n />\n </svg>\n',W_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M3.25 13.7404C3.0375 13.7404 2.85938 13.6684 2.71563 13.5246C2.57188 13.3808 2.5 13.2026 2.5 12.99C2.5 12.7774 2.57188 12.5993 2.71563 12.4558C2.85938 12.3122 3.0375 12.2404 3.25 12.2404H20.75C20.9625 12.2404 21.1406 12.3123 21.2843 12.4561C21.4281 12.5999 21.5 12.7781 21.5 12.9907C21.5 13.2033 21.4281 13.3814 21.2843 13.525C21.1406 13.6686 20.9625 13.7404 20.75 13.7404H3.25ZM10.9423 10.2596V6.62495H6.5673C6.2735 6.62495 6.02377 6.52201 5.8181 6.31613C5.61245 6.11026 5.50963 5.86027 5.50963 5.56615C5.50963 5.27205 5.61245 5.02083 5.8181 4.8125C6.02377 4.60417 6.2735 4.5 6.5673 4.5H17.4423C17.7361 4.5 17.9858 4.60294 18.1915 4.80883C18.3971 5.01471 18.5 5.2647 18.5 5.5588C18.5 5.85292 18.3971 6.10413 18.1915 6.31245C17.9858 6.52078 17.7361 6.62495 17.4423 6.62495H13.0673V10.2596H10.9423ZM10.9423 15.7211H13.0673V18.4423C13.0673 18.7361 12.9643 18.9858 12.7584 19.1915C12.5526 19.3971 12.3026 19.5 12.0085 19.5C11.7144 19.5 11.4631 19.3962 11.2548 19.1887C11.0465 18.9811 10.9423 18.7291 10.9423 18.4327V15.7211Z"\n />\n </svg>\n',U_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_8078)">\n <path\n d="M20 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H20C21.1 21 22 20.1 22 19V5C22 3.9 21.1 3 20 3ZM20 5V8H5V5H20ZM15 19H10V10H15V19ZM5 10H8V19H5V10ZM17 19V10H20V19H17Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_8078">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',G_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M5.66936 16.3389L9.39244 12.6158C9.54115 12.4671 9.71679 12.3937 9.91936 12.3957C10.1219 12.3976 10.2975 12.4761 10.4463 12.6312C10.5847 12.7823 10.654 12.9585 10.654 13.1599C10.654 13.3613 10.5847 13.5363 10.4463 13.6851L6.32704 17.8197C6.14627 18.0004 5.93538 18.0908 5.69436 18.0908C5.45333 18.0908 5.24243 18.0004 5.06166 17.8197L3.01744 15.7754C2.87899 15.637 2.81136 15.4629 2.81456 15.2533C2.81776 15.0437 2.88859 14.8697 3.02706 14.7312C3.16551 14.5928 3.34008 14.5235 3.55076 14.5235C3.76144 14.5235 3.93494 14.5928 4.07126 14.7312L5.66936 16.3389ZM5.66936 8.72359L9.39244 5.00049C9.54115 4.85177 9.71679 4.77838 9.91936 4.78031C10.1219 4.78223 10.2975 4.86075 10.4463 5.01586C10.5847 5.16691 10.654 5.34314 10.654 5.54454C10.654 5.74592 10.5847 5.92097 10.4463 6.06969L6.32704 10.2043C6.14627 10.3851 5.93538 10.4755 5.69436 10.4755C5.45333 10.4755 5.24243 10.3851 5.06166 10.2043L3.01744 8.16009C2.87899 8.02162 2.81136 7.84759 2.81456 7.63799C2.81776 7.42837 2.88859 7.25433 3.02706 7.11586C3.16551 6.97741 3.34008 6.90819 3.55076 6.90819C3.76144 6.90819 3.93494 6.97741 4.07126 7.11586L5.66936 8.72359ZM13.7597 16.5581C13.5472 16.5581 13.3691 16.4862 13.2253 16.3424C13.0816 16.1986 13.0097 16.0204 13.0097 15.8078C13.0097 15.5952 13.0816 15.4171 13.2253 15.2735C13.3691 15.13 13.5472 15.0582 13.7597 15.0582H20.7597C20.9722 15.0582 21.1503 15.1301 21.2941 15.2739C21.4378 15.4177 21.5097 15.5959 21.5097 15.8085C21.5097 16.0211 21.4378 16.1992 21.2941 16.3427C21.1503 16.4863 20.9722 16.5581 20.7597 16.5581H13.7597ZM13.7597 8.94276C13.5472 8.94276 13.3691 8.87085 13.2253 8.72704C13.0816 8.58324 13.0097 8.40504 13.0097 8.19244C13.0097 7.97985 13.0816 7.80177 13.2253 7.65819C13.3691 7.5146 13.5472 7.44281 13.7597 7.44281H20.7597C20.9722 7.44281 21.1503 7.51471 21.2941 7.65851C21.4378 7.80233 21.5097 7.98053 21.5097 8.19311C21.5097 8.40571 21.4378 8.5838 21.2941 8.72739C21.1503 8.87097 20.9722 8.94276 20.7597 8.94276H13.7597Z"\n />\n </svg>\n',Z_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="m12.9 16l-2.55-2.5l.05-.05q1.45-1.6 2.262-3.117T13.95 7H16V5h-6V3H8v2H2v2h9.1q-.5 1.2-1.225 2.387T8 11.7q-.6-.6-1.187-1.412T5.85 8.6H3.85q.5 1.4 1.3 2.7T6.95 13.7L2.85 17.75L4.25 19.15L8 15.4L10.55 17.95zM18.5 22h-2L21 10h2l4.5 12h-2l-1.05-3h-4.9zm1.6-5h3.6l-1.8-5.1z"\n />\n </svg>\n',X_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="32"\n height="32"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M7 19v-.808L13.096 12L7 5.808V5h10v1.25H9.102L14.727 12l-5.625 5.77H17V19z"\n />\n </svg>\n',K_='\n <svg\n xmlns="http://www.w3.org/2000/svg"\n height="24px"\n viewBox="0 -960 960 960"\n width="24px"\n >\n <path\n d="m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"\n />\n </svg>\n',Y_={[C_.CodeMirror]:{theme:Lr,languages:br,expandIcon:T_,searchIcon:$_,clearSearchIcon:E_,searchPlaceholder:"Search language",noResultText:"No result",previewToggleIcon:e=>e?B_:K_}},J_=fe([],"FeaturesCtx"),Q_=fe({},"CrepeCtx");function eS(e){return e.use("FeaturesCtx")}function tS(e){return t=>{eS(t).update(t=>t.includes(e)?t:[...t,e])}}function nS(e,t){var n;const r=e.get(T),o=e.get(le),{state:i}=r,a=o(i.doc);let s="";if(!i.selection.empty){const{from:e,to:t}=i.selection,r=i.doc.slice(e,t),{schema:a}=i.doc.type;let l=a.topNodeType.createAndFill(null,r.content);if(!l){const e=null==(n=a.nodes.paragraph)?void 0:n.createAndFill(null,r.content);e&&(l=a.topNodeType.createAndFill(null,e))}s=l?o(l):i.doc.textBetween(e,t)}return{document:a,selection:s,instruction:t}}const rS=a({provider:void 0,buildContext:void 0,diffReviewOnEnd:!0,onError:e=>{console.error(`[milkdown/ai] [${e.code}]`,e)},aiIcon:void 0},"aiProviderConfig"),oS=a({abortController:null,label:"",lastInstruction:"",lastLabel:void 0,lastFrom:-1,lastTo:-1,diffOwnedByAI:!1},"aiSession");function iS(e,t){const n=e.get(rS.key);try{n.onError(t)}catch(r){console.error("[milkdown/ai] onError handler failed:",r)}}function aS(e){const t=e.get(oS.key);e.set(oS.key,{...t,abortController:null,label:""})}const sS=l("RunAI",e=>t=>(n,r)=>{var o,i,a,s;if(!(null==t?void 0:t.instruction))return!1;const l=e.get(rS.key);if(!l.provider)return!1;if(e.get(oS.key).abortController)return!1;if(null==(o=Ko.getState(n))?void 0:o.active)return!1;if(null==(i=to.getState(n))?void 0:i.active)return!1;if(!r)return!0;const c=new AbortController,{from:d,to:u}=n.selection;e.set(oS.key,{abortController:c,label:null!=(a=t.label)?a:"",lastInstruction:t.instruction,lastLabel:t.label,lastFrom:d,lastTo:u,diffOwnedByAI:!1});const h=e.get(g),p=n.selection.empty?"cursor":"selection";if(!h.call(Jo.key,{insertAt:p}))return aS(e),!1;let m;try{m=(null!=(s=l.buildContext)?s:nS)(e,t.instruction)}catch(f){const t=Me(f);return iS(e,t),h.call(ti.key,{keep:!1}),aS(e),!1}return async function(e,t,n,r){try{const o=t(n,r.signal),i=e.get(g);for await(const e of o){if(r.signal.aborted)break;i.call(Qo.key,e)}if(r.signal.aborted)return;const a=e.get(rS.key);if(a.diffReviewOnEnd){const t=e.get(oS.key);e.set(oS.key,{...t,diffOwnedByAI:!0})}const s=i.call(ei.key,{diffReview:a.diffReviewOnEnd});if(a.diffReviewOnEnd&&!s){const t=e.get(oS.key);e.set(oS.key,{...t,diffOwnedByAI:!1})}}catch(f){if(r.signal.aborted)return;iS(e,Ie(f)),e.get(g).call(ti.key,{keep:!1})}finally{e.get(oS.key).abortController===r&&aS(e)}}(e,l.provider,m,c),!0}),lS=l("AbortAI",e=>t=>(n,r)=>{var o;const i=e.get(oS.key);return r?!!i.abortController&&(i.abortController.abort(),aS(e),(null==(o=Ko.getState(n))?void 0:o.active)&&e.get(g).call(ti.key,t),!0):!!i.abortController});var cS,dS,uS,hS,pS,mS,fS,gS,vS,yS,bS,wS,xS,kS,CS,_S,SS=e=>{throw TypeError(e)},AS=(e,t,n)=>t.has(e)||SS("Cannot "+n),MS=(e,t,n)=>(AS(e,t,"read from private field"),n?n.call(e):t.get(e)),TS=(e,t,n)=>t.has(e)?SS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ES=(e,t,n,r)=>(AS(e,t,"write to private field"),t.set(e,n),n),LS=(e,t,n)=>(AS(e,t,"access private method"),n);const OS="milkdown-ai-diff-actions";function IS(e,t){e.innerHTML=Sn.sanitize(t.trim())}class RS{constructor(e,t,n){this.ctx=e,TS(this,vS),TS(this,cS),TS(this,dS),TS(this,uS),TS(this,hS),TS(this,pS,!1),TS(this,mS,!1),TS(this,fS,null),TS(this,gS,!1),TS(this,xS,()=>{const e=this.ctx.get(oS.key);if(!e.lastInstruction)return;if(!MS(this,gS)||!LS(this,vS,kS).call(this))return;const t=this.ctx.get(g);t.call(ho.key);const n=this.ctx.get(T),{doc:r}=n.state,o=Math.min(Math.max(e.lastFrom,0),r.content.size),i=Math.min(Math.max(e.lastTo,0),r.content.size);n.dispatch(n.state.tr.setSelection(S.create(n.state.doc,o,i))),t.call(sS.key,{instruction:e.lastInstruction,label:e.lastLabel})}),TS(this,CS,()=>{this.ctx.get(g).call(ho.key)}),TS(this,_S,()=>{this.ctx.get(g).call(uo.key)}),ES(this,hS,n),ES(this,dS,LS(this,vS,yS).call(this,t));const r=document.createElement("div");r.className=OS,r.dataset.show="false",ES(this,uS,LS(this,vS,bS).call(this,"retry",n.retryIcon,n.retryLabel,MS(this,xS))),r.appendChild(MS(this,uS)),r.appendChild(LS(this,vS,bS).call(this,"reject",n.rejectIcon,n.rejectAllLabel,MS(this,CS)));const o=LS(this,vS,bS).call(this,"accept",n.acceptIcon,n.acceptAllLabel,MS(this,_S));o.appendChild(LS(this,vS,wS).call(this)),r.appendChild(o),ES(this,cS,r),MS(this,dS).appendChild(r),this.update(t)}update(e){var t;const n=!!(null==(t=to.getState(e.state))?void 0:t.active);if(n!==MS(this,mS))if(ES(this,mS,n),n){const t=this.ctx.get(oS.key);ES(this,gS,t.diffOwnedByAI),ES(this,fS,e.state.doc)}else{ES(this,gS,!1),ES(this,fS,null);const e=this.ctx.get(oS.key);e.diffOwnedByAI&&this.ctx.set(oS.key,{...e,diffOwnedByAI:!1})}const r=n&&MS(this,gS);if(r!==MS(this,pS)&&(ES(this,pS,r),MS(this,cS).dataset.show=r?"true":"false"),r){const t=this.ctx.get(oS.key),n=!!MS(this,fS)&&e.state.doc.eq(MS(this,fS));MS(this,uS).disabled=!t.lastInstruction||!n}}destroy(){MS(this,cS).remove()}}cS=new WeakMap,dS=new WeakMap,uS=new WeakMap,hS=new WeakMap,pS=new WeakMap,mS=new WeakMap,fS=new WeakMap,gS=new WeakMap,vS=new WeakSet,yS=function(e){var t;return null!=(t=e.dom.closest(".milkdown"))?t:document.body},bS=function(e,t,n,r){const o=document.createElement("button");o.type="button",o.className=`${OS}-btn ${OS}-btn-${e}`,o.appendChild(function(e){const t=document.createElement("span");return t.className=`${OS}-icon`,IS(t,e),t}(t));const i=document.createElement("span");return i.textContent=n,o.appendChild(i),o.addEventListener("mousedown",e=>e.preventDefault()),o.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),r()}),o},wS=function(){const e=document.createElement("span");e.className=`${OS}-shortcut`;const t=document.createElement("span");t.textContent=MS(this,hS).modSymbol;const n=document.createElement("span");return n.className=`${OS}-shortcut-icon`,IS(n,MS(this,hS).enterKeyIcon),e.append(t,n),e},xS=new WeakMap,kS=function(){return!!MS(this,fS)&&this.ctx.get(T).state.doc.eq(MS(this,fS))},CS=new WeakMap,_S=new WeakMap;const PS=new d("CREPE_AI_DIFF_ACTIONS_PANEL"),BS=function(){var e,t,n,r;if("undefined"==typeof navigator)return"⌘";const o=navigator,i=null!=(r=null!=(n=null!=(t=null==(e=o.userAgentData)?void 0:e.platform)?t:o.platform)?n:o.userAgent)?r:"";return/mac|iphone|ipad|ipod/i.test(i)?"⌘":"Ctrl"}();var zS,DS,NS=e=>{throw TypeError(e)},HS=(e,t,n)=>t.has(e)||NS("Cannot "+n),qS=(e,t,n)=>(HS(e,t,"read from private field"),n?n.call(e):t.get(e)),jS=(e,t,n)=>t.has(e)?NS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),VS=(e,t,n,r)=>(HS(e,t,"write to private field"),t.set(e,n),n);function FS(e){const t={addItem:(n,r)=>(e.items.set(n,r),t),removeItem:n=>(e.items.delete(n),t),getItem:t=>e.items.get(t),clear:()=>(e.items.clear(),t)};return t}class $S{constructor(){jS(this,zS,[]),this.addItem=(e,t)=>(qS(this,DS).call(this,e),qS(this,zS).push({kind:"item",id:e,item:t}),this),this.addSubmenu=(e,t,n)=>{qS(this,DS).call(this,e);const r={def:t,items:new Map};return n&&n(FS(r)),qS(this,zS).push({kind:"submenu",id:e,node:r}),this},this.removeItem=e=>(qS(this,DS).call(this,e),this),this.getItem=e=>{const t=qS(this,zS).find(t=>"item"===t.kind&&t.id===e);return"item"===(null==t?void 0:t.kind)?t.item:void 0},this.getSubmenu=e=>{const t=qS(this,zS).find(t=>"submenu"===t.kind&&t.id===e);return"submenu"===(null==t?void 0:t.kind)?FS(t.node):void 0},this.clear=()=>(VS(this,zS,[]),this),this.build=()=>{const e=[],t={};for(const n of qS(this,zS))"item"===n.kind?e.push({kind:"item",id:n.id,item:n.item}):(e.push({kind:"submenu",id:n.id,def:n.node.def}),t[n.id]={def:n.node.def,items:Array.from(n.node.items.entries()).map(([e,t])=>({id:e,item:t}))});return{main:e,submenus:t}},jS(this,DS,e=>{VS(this,zS,qS(this,zS).filter(t=>t.id!==e))})}}zS=new WeakMap,DS=new WeakMap;const WS=ml({props:{placeholder:{type:Object,required:!0},resetSignal:{type:Object,required:!0},suggestions:{type:Object,required:!0},chrome:{type:Object,required:!0},onConfirm:{type:Function,required:!0},onCancel:{type:Function,required:!0}},setup({placeholder:e,resetSignal:t,suggestions:n,chrome:r,onConfirm:o,onCancel:i}){const a=gs(""),s=gs({kind:"main"}),l=gs(0),c=gs(null),d=gs(null),u=`ai-instruction-list-${Math.random().toString(36).slice(2,9)}`,h=e=>`${u}-opt-${e}`;sl(t,()=>{a.value="",s.value={kind:"main"},l.value=0});const p=hd(()=>{if("submenu"===s.value.kind){const e=n.submenus[s.value.id];return e?e.items.map(({id:e,item:t})=>({id:e,icon:t.icon,label:t.label,hasSubmenu:!1,prompt:{text:t.prompt,streamingLabel:t.streamingLabel}})):[]}return n.main.map(e=>"item"===e.kind?{id:e.id,icon:e.item.icon,label:e.item.label,hasSubmenu:!1,prompt:{text:e.item.prompt,streamingLabel:e.item.streamingLabel}}:{id:e.id,icon:e.def.icon,label:e.def.label,hasSubmenu:!0})}),m=hd(()=>{var e,t;return"submenu"!==s.value.kind?null:null!=(t=null==(e=n.submenus[s.value.id])?void 0:e.def)?t:null}),f=hd(()=>{const e=a.value.trim().toLowerCase();return e?p.value.filter(t=>t.label.toLowerCase().includes(e)):p.value}),g=hd(()=>a.value.trim().length>0),v=hd(()=>f.value.length+(g.value?1:0));sl([f,s,g],()=>{l.value=g.value?f.value.length:0});const y=()=>{Ns(()=>{var e;return null==(e=c.value)?void 0:e.focus()})},b=()=>{s.value={kind:"main"},a.value="",l.value=0,y()},w=e=>{e.hasSubmenu?(e=>{s.value={kind:"submenu",id:e},a.value="",l.value=0,y()})(e.id):e.prompt&&(o(e.prompt.text,e.prompt.streamingLabel),a.value="")},x=()=>{const e=a.value.trim();e&&(o(e),a.value="")},k=()=>{Ns(()=>{const e=d.value;if(!e)return;const t=e.querySelector(`[data-index="${l.value}"]`);null==t||t.scrollIntoView({block:"nearest"})})},C=e=>{if(e.stopPropagation(),"ArrowDown"===e.key){if(e.preventDefault(),0===v.value)return;return l.value=(l.value+1)%v.value,void k()}if("ArrowUp"===e.key){if(e.preventDefault(),0===v.value)return;return l.value=(l.value-1+v.value)%v.value,void k()}return"Enter"===e.key?(e.preventDefault(),void(()=>{const e=l.value,t=f.value;e<t.length?w(t[e]):g.value&&x()})()):"Escape"===e.key?(e.preventDefault(),void("submenu"===s.value.kind?b():i())):void("Backspace"===e.key&&""===a.value&&"submenu"===s.value.kind&&(e.preventDefault(),b()))},_=e=>{e.preventDefault()};return()=>{const t=f.value,n=g.value,o=m.value;return pd("div",{class:"ai-instruction"},pd("div",{class:"ai-instruction-input"},pd("span",{class:"ai-instruction-input-prefix"},pd(jd,{icon:r.aiIcon})),pd("input",{ref:c,class:"ai-instruction-input-field",role:"combobox","aria-expanded":"true","aria-autocomplete":"list","aria-controls":u,"aria-activedescendant":v.value>0?h(l.value):void 0,placeholder:o?o.searchPlaceholder:e.value,value:a.value,onInput:e=>{a.value=e.target.value},onKeydown:C}),pd("button",{type:"button",class:"ai-instruction-submit","aria-label":r.submitButtonLabel,disabled:!n,onMousedown:_,onClick:x},pd(jd,{icon:r.sendIcon}))),pd("div",{class:"ai-instruction-list",ref:d,id:u,role:"listbox","aria-label":r.listboxLabel},o&&pd("button",{type:"button",class:"ai-instruction-back",onMousedown:_,onClick:b},pd("span",{class:"ai-instruction-back-icon","aria-hidden":"true"},pd(jd,{icon:r.chevronLeftIcon})),pd("span",null,o.title)),t.length>0&&pd("div",{class:"ai-instruction-section"},pd("div",{class:"ai-instruction-section-header"},r.suggestionsHeaderLabel),t.map((e,t)=>pd("div",{key:e.id,id:h(t),"data-index":t,role:"option","aria-selected":t===l.value,class:["ai-instruction-item",t===l.value?"active":""],onMousedown:_,onClick:()=>w(e),onPointerenter:()=>{l.value=t}},pd("span",{class:"ai-instruction-item-icon"},pd(jd,{icon:e.icon})),pd("span",{class:"ai-instruction-item-label"},function(e,t){const n=t.trim();if(!n)return[e];const r=e.toLowerCase(),o=n.toLowerCase(),i=r.indexOf(o);return-1===i?[e]:[e.slice(0,i),pd("mark",null,e.slice(i,i+n.length)),e.slice(i+n.length)]}(e.label,a.value)),e.hasSubmenu&&pd("span",{class:"ai-instruction-item-arrow"},pd(jd,{icon:r.chevronRightIcon}))))),n&&pd("div",{class:"ai-instruction-section"},pd("div",{class:"ai-instruction-section-header"},r.sendAsPromptHeaderLabel),pd("div",{id:h(t.length),"data-index":t.length,role:"option","aria-selected":l.value===t.length,class:["ai-instruction-item","ai-instruction-item-prompt",l.value===t.length?"active":""],onMousedown:_,onClick:x,onPointerenter:()=>{l.value=t.length}},pd("span",{class:"ai-instruction-item-icon"},pd(jd,{icon:r.sendPromptIcon})),pd("span",{class:"ai-instruction-item-label"},r.sendAsPromptLabel," ",pd("span",{class:"ai-instruction-item-quote"},'"',a.value,'"')),pd("span",{class:"ai-instruction-item-shortcut"},pd(jd,{icon:r.enterKeyIcon}))))))}}});var US,GS,ZS,XS,KS,YS,JS,QS,eA,tA,nA=e=>{throw TypeError(e)},rA=(e,t,n)=>t.has(e)||nA("Cannot "+n),oA=(e,t,n)=>(rA(e,t,"read from private field"),n?n.call(e):t.get(e)),iA=(e,t,n)=>t.has(e)?nA("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),aA=(e,t,n,r)=>(rA(e,t,"write to private field"),t.set(e,n),n);class sA{constructor(e,t,n){this.ctx=e,iA(this,US),iA(this,GS),iA(this,ZS),iA(this,XS),iA(this,KS),iA(this,YS,-1),iA(this,JS,-1),iA(this,QS,!1),iA(this,eA,(e,t)=>{e.trim()&&this.ctx.get(g).call(sS.key,{instruction:e,label:t})&&(aA(this,QS,!1),oA(this,GS).hide())}),iA(this,tA,()=>{aA(this,QS,!1),oA(this,GS).hide()}),this.show=(e,t)=>{aA(this,YS,e),aA(this,JS,t),oA(this,KS).value++,aA(this,QS,!0);const n=this.ctx.get(T);oA(this,GS).show({getBoundingClientRect:()=>_(n,e,t)},n),requestAnimationFrame(()=>{var e;null==(e=oA(this,US).querySelector("input"))||e.focus()})},this.update=(e,t)=>{const{selection:n}=e.state,r=n instanceof S,o=n.from!==oA(this,YS)||n.to!==oA(this,JS);if(!r||o)return aA(this,QS,!1),void oA(this,GS).hide();oA(this,GS).update(e,t)},this.destroy=()=>{oA(this,ZS).unmount(),oA(this,GS).destroy(),oA(this,US).remove()},aA(this,XS,gs(n.placeholder)),aA(this,KS,gs(0));const r=document.createElement("div");r.className="milkdown-ai-instruction";const o=qd(WS,{placeholder:oA(this,XS),resetSignal:oA(this,KS),suggestions:n.suggestions,chrome:n.chrome,onConfirm:oA(this,eA),onCancel:oA(this,tA)});o.mount(r),aA(this,ZS,o),aA(this,US,r),aA(this,GS,new ri({content:r,debounce:0,offset:10,shouldShow:()=>oA(this,QS),floatingUIOptions:{placement:"bottom"}})),oA(this,GS).onHide=()=>{aA(this,QS,!1),requestAnimationFrame(()=>{try{const e=oA(this,US).getRootNode().activeElement;if(!e||!oA(this,US).contains(e))return;this.ctx.get(T).dom.focus({preventScroll:!0})}catch(_T){}})},oA(this,GS).update(t)}}US=new WeakMap,GS=new WeakMap,ZS=new WeakMap,XS=new WeakMap,KS=new WeakMap,YS=new WeakMap,JS=new WeakMap,QS=new WeakMap,eA=new WeakMap,tA=new WeakMap;const lA=a({show:()=>{}},"aiInstructionTooltipAPI"),cA=oi("CREPE_AI_INSTRUCTION");function dA(e){var t,n,r,o,i,a,s,l,c,d,u;return{aiIcon:null!=(t=null==e?void 0:e.aiIcon)?t:S_,sendIcon:null!=(n=null==e?void 0:e.sendIcon)?n:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M11 20V7.825l-5.6 5.6L4 12l8-8l8 8l-1.4 1.425l-5.6-5.6V20z"\n />\n </svg>\n',sendPromptIcon:null!=(r=null==e?void 0:e.sendPromptIcon)?r:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M3 20v-6l8-2l-8-2V4l19 8z"\n />\n </svg>\n',enterKeyIcon:null!=(o=null==e?void 0:e.enterKeyIcon)?o:z_,chevronLeftIcon:null!=(i=null==e?void 0:e.chevronLeftIcon)?i:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n fill="none"\n viewBox="0 0 24 24"\n stroke-width="1.5"\n stroke="currentColor"\n >\n <path\n stroke-linecap="round"\n stroke-linejoin="round"\n d="M15.75 19.5L8.25 12l7.5-7.5"\n />\n </svg>\n',chevronRightIcon:null!=(a=null==e?void 0:e.chevronRightIcon)?a:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n fill="none"\n viewBox="0 0 24 24"\n stroke-width="1.5"\n stroke="currentColor"\n >\n <path\n stroke-linecap="round"\n stroke-linejoin="round"\n d="M8.25 4.5l7.5 7.5-7.5 7.5"\n />\n </svg>\n',suggestionsHeaderLabel:null!=(s=null==e?void 0:e.suggestionsHeaderLabel)?s:"SUGGESTIONS",sendAsPromptHeaderLabel:null!=(l=null==e?void 0:e.sendAsPromptHeaderLabel)?l:"SEND AS PROMPT",sendAsPromptLabel:null!=(c=null==e?void 0:e.sendAsPromptLabel)?c:"Ask AI:",submitButtonLabel:null!=(d=null==e?void 0:e.submitButtonLabel)?d:"Send prompt",listboxLabel:null!=(u=null==e?void 0:e.listboxLabel)?u:"AI suggestions"}}var uA,hA,pA,mA,fA,gA,vA,yA=e=>{throw TypeError(e)},bA=(e,t,n)=>t.has(e)||yA("Cannot "+n),wA=(e,t,n)=>(bA(e,t,"read from private field"),n?n.call(e):t.get(e)),xA=(e,t,n)=>t.has(e)?yA("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),kA=(e,t,n,r)=>(bA(e,t,"write to private field"),t.set(e,n),n);const CA="milkdown-ai-streaming",_A=new d("CREPE_AI_STREAMING_INDICATOR");class SA{constructor(e,t,n){xA(this,uA),xA(this,hA),xA(this,pA),xA(this,mA,performance.now()),xA(this,fA,""),xA(this,gA,0),xA(this,vA,()=>{const e=(performance.now()-wA(this,mA))/800*360;wA(this,uA).style.transform=`rotate(${e}deg)`,kA(this,gA,requestAnimationFrame(wA(this,vA)))}),kA(this,pA,t);const r=document.createElement("span");r.className=`${CA}-indicator`,r.contentEditable="false",r.setAttribute("role","status"),r.setAttribute("aria-live","polite");const o=document.createElement("span");o.className=`${CA}-spinner`,o.setAttribute("aria-hidden","true"),r.appendChild(o);const i=document.createElement("span");i.className=`${CA}-label`,r.appendChild(i);const a=document.createElement("span");a.className=`${CA}-esc`,a.textContent=n,r.appendChild(a),this.dom=r,kA(this,uA,o),kA(this,hA,i),this.setLabel(e),wA(this,vA).call(this)}setLabel(e){const t=`${e.get(oS.key).label||wA(this,pA)}…`;t!==wA(this,fA)&&(kA(this,fA,t),wA(this,hA).textContent=t)}destroy(){wA(this,gA)&&cancelAnimationFrame(wA(this,gA)),kA(this,gA,0)}}uA=new WeakMap,hA=new WeakMap,pA=new WeakMap,mA=new WeakMap,fA=new WeakMap,gA=new WeakMap,vA=new WeakMap;const AA=["table","image-block","code_block"],MA={heading:["id"]};function TA(e){return"code_block"===e.$from.parent.type.name}function EA(e){var t;const n=null==(t=e.$from.node(e.$from.depth-1))?void 0:t.type;return"list_item"===(null==n?void 0:n.name)}var LA,OA,IA=e=>{throw TypeError(e)},RA=(e,t,n)=>t.has(e)||IA("Cannot "+n),PA=(e,t,n)=>(RA(e,t,"read from private field"),n?n.call(e):t.get(e)),BA=(e,t,n)=>t.has(e)?IA("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);class zA{constructor(){BA(this,LA,[]),this.clear=()=>(((e,t)=>{RA(e,t,"write to private field"),t.set(e,[])})(this,LA),this),BA(this,OA,e=>{const t={group:e,addItem:(n,r)=>{const o={...r,key:n};return e.items.push(o),t},clear:()=>(e.items=[],t)};return t}),this.addGroup=(e,t)=>{const n={key:e,label:t,items:[]};return PA(this,LA).push(n),PA(this,OA).call(this,n)},this.getGroup=e=>{const t=PA(this,LA).find(t=>t.key===e);if(!t)throw new Error(`Group with key ${e} not found`);return PA(this,OA).call(this,t)},this.build=()=>PA(this,LA)}}LA=new WeakMap,OA=new WeakMap;const DA=ml({props:{ctx:{type:Object,required:!0},show:{type:Object,required:!0},filter:{type:Object,required:!0},hide:{type:Function,required:!0},config:{type:Object,required:!1}},setup({ctx:e,show:t,filter:n,hide:r,config:o}){const i=gs(),a=hd(()=>function(e,t,n){var r,o,i,a,s,l,c,d,u,h,p,m,f,v,y,b,w,x,k,C,_,S,A,M,E,L,O,I,R,P,B,z,D,N,q,j,V,F,$,W,U,G,Z,K,Y,Q,ee,te,ne,re,oe,ie,ae,se,le,ce,de,ue,he,pe,me,fe,ge,ve,ye,be,we,xe,ke,Ce,_e,Se,Ae,Me,Te,Ee,Le,Oe,Ie,Re,Pe,Be,ze,De,Ze,Xe,Ke,Ye,Je,Qe,et,tt,nt,rt,ot,it,at,st,lt,ct,dt,ut,ht,pt,mt,ft,gt,vt,yt,bt,wt,xt,kt,Ct,_t,St,At,Mt,Tt;const Et=n&&eS(n).get(),Lt=null==Et?void 0:Et.includes(C_.Latex),Ot=null==Et?void 0:Et.includes(C_.ImageBlock),It=null==Et?void 0:Et.includes(C_.Table),Rt=new zA;if(null!==(null==t?void 0:t.textGroup)){const e=Rt.addGroup("text",null!=(o=null==(r=null==t?void 0:t.textGroup)?void 0:r.label)?o:"Text");null!==(null==(i=null==t?void 0:t.textGroup)?void 0:i.text)&&e.addItem("text",{label:null!=(l=null==(s=null==(a=null==t?void 0:t.textGroup)?void 0:a.text)?void 0:s.label)?l:"Text",icon:null!=(u=null==(d=null==(c=null==t?void 0:t.textGroup)?void 0:c.text)?void 0:d.icon)?u:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_992_5547)">\n <path\n d="M5 5.5C5 6.33 5.67 7 6.5 7H10.5V17.5C10.5 18.33 11.17 19 12 19C12.83 19 13.5 18.33 13.5 17.5V7H17.5C18.33 7 19 6.33 19 5.5C19 4.67 18.33 4 17.5 4H6.5C5.67 4 5 4.67 5 5.5Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_992_5547">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=X.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n})}}),null!==(null==(h=null==t?void 0:t.textGroup)?void 0:h.h1)&&e.addItem("h1",{label:null!=(f=null==(m=null==(p=null==t?void 0:t.textGroup)?void 0:p.h1)?void 0:m.label)?f:"Heading 1",icon:null!=(b=null==(y=null==(v=null==t?void 0:t.textGroup)?void 0:v.h1)?void 0:y.icon)?b:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_992_5553)">\n <path\n d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM12 17H14V7H10V9H12V17Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_992_5553">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=qe.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n,attrs:{level:1}})}}),null!==(null==(w=null==t?void 0:t.textGroup)?void 0:w.h2)&&e.addItem("h2",{label:null!=(C=null==(k=null==(x=null==t?void 0:t.textGroup)?void 0:x.h2)?void 0:k.label)?C:"Heading 2",icon:null!=(A=null==(S=null==(_=null==t?void 0:t.textGroup)?void 0:_.h2)?void 0:S.icon)?A:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_992_5559)">\n <path\n d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15H11V13H13C14.1 13 15 12.11 15 11V9C15 7.89 14.1 7 13 7H9V9H13V11H11C9.9 11 9 11.89 9 13V17H15V15Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_992_5559">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=qe.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n,attrs:{level:2}})}}),null!==(null==(M=null==t?void 0:t.textGroup)?void 0:M.h3)&&e.addItem("h3",{label:null!=(O=null==(L=null==(E=null==t?void 0:t.textGroup)?void 0:E.h3)?void 0:L.label)?O:"Heading 3",icon:null!=(P=null==(R=null==(I=null==t?void 0:t.textGroup)?void 0:I.h3)?void 0:R.icon)?P:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_992_5565)">\n <path\n d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15V13.5C15 12.67 14.33 12 13.5 12C14.33 12 15 11.33 15 10.5V9C15 7.89 14.1 7 13 7H9V9H13V11H11V13H13V15H9V17H13C14.1 17 15 16.11 15 15Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_992_5565">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=qe.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n,attrs:{level:3}})}}),null!==(null==(B=null==t?void 0:t.textGroup)?void 0:B.h4)&&e.addItem("h4",{label:null!=(N=null==(D=null==(z=null==t?void 0:t.textGroup)?void 0:z.h4)?void 0:D.label)?N:"Heading 4",icon:null!=(V=null==(j=null==(q=null==t?void 0:t.textGroup)?void 0:q.h4)?void 0:j.icon)?V:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_7757)">\n <path\n d="M19.04 3H5.04004C3.94004 3 3.04004 3.9 3.04004 5V19C3.04004 20.1 3.94004 21 5.04004 21H19.04C20.14 21 21.04 20.1 21.04 19V5C21.04 3.9 20.14 3 19.04 3ZM19.04 19H5.04004V5H19.04V19ZM13.04 17H15.04V7H13.04V11H11.04V7H9.04004V13H13.04V17Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_7757">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=qe.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n,attrs:{level:4}})}}),null!==(null==(F=null==t?void 0:t.textGroup)?void 0:F.h5)&&e.addItem("h5",{label:null!=(U=null==(W=null==($=null==t?void 0:t.textGroup)?void 0:$.h5)?void 0:W.label)?U:"Heading 5",icon:null!=(K=null==(Z=null==(G=null==t?void 0:t.textGroup)?void 0:G.h5)?void 0:Z.icon)?K:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_7760)">\n <path\n d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15V13C15 11.89 14.1 11 13 11H11V9H15V7H9V13H13V15H9V17H13C14.1 17 15 16.11 15 15Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_7760">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=qe.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n,attrs:{level:5}})}}),null!==(null==(Y=null==t?void 0:t.textGroup)?void 0:Y.h6)&&e.addItem("h6",{label:null!=(te=null==(ee=null==(Q=null==t?void 0:t.textGroup)?void 0:Q.h6)?void 0:ee.label)?te:"Heading 6",icon:null!=(oe=null==(re=null==(ne=null==t?void 0:t.textGroup)?void 0:ne.h6)?void 0:re.icon)?oe:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_977_7763)">\n <path\n d="M11 17H13C14.1 17 15 16.11 15 15V13C15 11.89 14.1 11 13 11H11V9H15V7H11C9.9 7 9 7.89 9 9V15C9 16.11 9.9 17 11 17ZM11 13H13V15H11V13ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_977_7763">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n',onRun:e=>{const t=e.get(g),n=qe.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n,attrs:{level:6}})}}),null!==(null==(ie=null==t?void 0:t.textGroup)?void 0:ie.quote)&&e.addItem("quote",{label:null!=(le=null==(se=null==(ae=null==t?void 0:t.textGroup)?void 0:ae.quote)?void 0:se.label)?le:"Quote",icon:null!=(ue=null==(de=null==(ce=null==t?void 0:t.textGroup)?void 0:ce.quote)?void 0:de.icon)?ue:V_,onRun:e=>{const t=e.get(g),n=je.type(e);t.call(Ne.key),t.call(Ve.key,{nodeType:n})}}),null!==(null==(he=null==t?void 0:t.textGroup)?void 0:he.divider)&&e.addItem("divider",{label:null!=(fe=null==(me=null==(pe=null==t?void 0:t.textGroup)?void 0:pe.divider)?void 0:me.label)?fe:"Divider",icon:null!=(ye=null==(ve=null==(ge=null==t?void 0:t.textGroup)?void 0:ge.divider)?void 0:ve.icon)?ye:R_,onRun:e=>{const t=e.get(g),n=Fe.type(e);t.call(Ne.key),t.call($e.key,{nodeType:n})}})}if(null!==(null==t?void 0:t.listGroup)){const e=Rt.addGroup("list",null!=(we=null==(be=null==t?void 0:t.listGroup)?void 0:be.label)?we:"List");null!==(null==(xe=null==t?void 0:t.listGroup)?void 0:xe.bulletList)&&e.addItem("bullet-list",{label:null!=(_e=null==(Ce=null==(ke=null==t?void 0:t.listGroup)?void 0:ke.bulletList)?void 0:Ce.label)?_e:"Bullet List",icon:null!=(Me=null==(Ae=null==(Se=null==t?void 0:t.listGroup)?void 0:Se.bulletList)?void 0:Ae.icon)?Me:M_,onRun:e=>{const t=e.get(g),n=We.type(e);t.call(Ne.key),t.call(Ve.key,{nodeType:n})}}),null!==(null==(Te=null==t?void 0:t.listGroup)?void 0:Te.orderedList)&&e.addItem("ordered-list",{label:null!=(Oe=null==(Le=null==(Ee=null==t?void 0:t.listGroup)?void 0:Ee.orderedList)?void 0:Le.label)?Oe:"Ordered List",icon:null!=(Pe=null==(Re=null==(Ie=null==t?void 0:t.listGroup)?void 0:Ie.orderedList)?void 0:Re.icon)?Pe:q_,onRun:e=>{const t=e.get(g),n=Ue.type(e);t.call(Ne.key),t.call(Ve.key,{nodeType:n})}}),null!==(null==(Be=null==t?void 0:t.listGroup)?void 0:Be.taskList)&&e.addItem("task-list",{label:null!=(Ze=null==(De=null==(ze=null==t?void 0:t.listGroup)?void 0:ze.taskList)?void 0:De.label)?Ze:"Task List",icon:null!=(Ye=null==(Ke=null==(Xe=null==t?void 0:t.listGroup)?void 0:Xe.taskList)?void 0:Ke.icon)?Ye:G_,onRun:e=>{const t=e.get(g),n=H.type(e);t.call(Ne.key),t.call(Ve.key,{nodeType:n,attrs:{checked:!1}})}})}if(null!==(null==t?void 0:t.advancedGroup)){const e=Rt.addGroup("advanced",null!=(Qe=null==(Je=null==t?void 0:t.advancedGroup)?void 0:Je.label)?Qe:"Advanced");null!==(null==(et=null==t?void 0:t.advancedGroup)?void 0:et.image)&&Ot&&e.addItem("image",{label:null!=(rt=null==(nt=null==(tt=null==t?void 0:t.advancedGroup)?void 0:tt.image)?void 0:nt.label)?rt:"Image",icon:null!=(at=null==(it=null==(ot=null==t?void 0:t.advancedGroup)?void 0:ot.image)?void 0:it.icon)?at:D_,onRun:e=>{const t=e.get(g),n=yu.type(e);t.call(Ne.key),t.call($e.key,{nodeType:n})}}),null!==(null==(st=null==t?void 0:t.advancedGroup)?void 0:st.codeBlock)&&e.addItem("code",{label:null!=(dt=null==(ct=null==(lt=null==t?void 0:t.advancedGroup)?void 0:lt.codeBlock)?void 0:ct.label)?dt:"Code",icon:null!=(pt=null==(ht=null==(ut=null==t?void 0:t.advancedGroup)?void 0:ut.codeBlock)?void 0:ht.icon)?pt:L_,onRun:e=>{const t=e.get(g),n=J.type(e);t.call(Ne.key),t.call(He.key,{nodeType:n})}}),null!==(null==(mt=null==t?void 0:t.advancedGroup)?void 0:mt.table)&&It&&e.addItem("table",{label:null!=(vt=null==(gt=null==(ft=null==t?void 0:t.advancedGroup)?void 0:ft.table)?void 0:gt.label)?vt:"Table",icon:null!=(wt=null==(bt=null==(yt=null==t?void 0:t.advancedGroup)?void 0:yt.table)?void 0:bt.icon)?wt:U_,onRun:e=>{const t=e.get(g),n=e.get(T);t.call(Ne.key);const{from:r}=n.state.selection;t.call($e.key,{nodeType:dp(e,3,3)}),t.call(Ge.key,{pos:r})}}),null!==(null==(xt=null==t?void 0:t.advancedGroup)?void 0:xt.math)&&Lt&&e.addItem("math",{label:null!=(_t=null==(Ct=null==(kt=null==t?void 0:t.advancedGroup)?void 0:kt.math)?void 0:Ct.label)?_t:"Math",icon:null!=(Mt=null==(At=null==(St=null==t?void 0:t.advancedGroup)?void 0:St.math)?void 0:At.icon)?Mt:X_,onRun:e=>{const t=e.get(g),n=J.type(e);t.call(Ne.key),t.call($e.key,{nodeType:n,attrs:{language:"LaTeX"}})}})}null==(Tt=null==t?void 0:t.buildMenu)||Tt.call(t,Rt);let Pt=Rt.build();e&&(Pt=Pt.map(t=>{const n=t.items.filter(t=>t.label.toLowerCase().includes(e.toLowerCase()));return{...t,items:n}}).filter(e=>e.items.length>0));const Bt=Pt.flatMap(e=>e.items);return Bt.forEach((e,t)=>{Object.assign(e,{index:t})}),Pt.reduce((e,t)=>{const n=e+t.items.length;return Object.assign(t,{range:[e,n]}),n},0),{groups:Pt,size:Bt.length}}(n.value,o,e)),s=gs(0),l=gs({x:-999,y:-999}),c=e=>{const{x:t,y:n}=e;l.value={x:t,y:n}};sl([a,t],()=>{const{size:e}=a.value;0===e&&t.value?r():s.value>=e&&(s.value=0)});const d=(e,t)=>{const n=s.value,r="function"==typeof e?e(n):e;null==t||t(r),s.value=r},u=e=>{var t,n;const r=null==(t=i.value)?void 0:t.querySelector(`[data-index="${e}"]`),o=null==(n=i.value)?void 0:n.querySelector(".menu-groups");r&&o&&(o.scrollTop=r.offsetTop-o.offsetTop)},h=t=>{const n=a.value.groups.flatMap(e=>e.items).at(t);(null==n?void 0:n.onRun)&&e&&n.onRun(e),r()},p=e=>{const{size:t,groups:n}=a.value;return"Escape"===e.key?(e.preventDefault(),void(null==r||r())):"ArrowDown"===e.key?(e.preventDefault(),d(e=>e<t-1?e+1:e,u)):"ArrowUp"===e.key?(e.preventDefault(),d(e=>e<=0?e:e-1,u)):"ArrowLeft"===e.key?(e.preventDefault(),d(e=>{const t=n.find(t=>t.range[0]<=e&&t.range[1]>e);if(!t)return e;const r=n[n.indexOf(t)-1];return r?r.range[1]-1:e},u)):"ArrowRight"===e.key?(e.preventDefault(),d(e=>{const t=n.find(t=>t.range[0]<=e&&t.range[1]>e);if(!t)return e;const r=n[n.indexOf(t)+1];return r?r.range[0]:e},u)):void("Enter"===e.key&&(e.preventDefault(),h(s.value)))},m=e=>t=>{const n=l.value;if(!n)return;const{x:r,y:o}=t;r===n.x&&o===n.y||d(e)};return al(()=>{t.value?window.addEventListener("keydown",p,{capture:!0}):window.removeEventListener("keydown",p,{capture:!0})}),Rl(()=>{window.removeEventListener("keydown",p,{capture:!0})}),()=>pd("div",{ref:i,onPointerdown:e=>e.preventDefault()},pd("nav",{class:"tab-group"},pd("ul",null,a.value.groups.map(e=>pd("li",{key:e.key,onPointerdown:()=>d(e.range[0],u),class:s.value>=e.range[0]&&s.value<e.range[1]?"selected":""},e.label)))),pd("div",{class:"menu-groups",onPointermove:c},a.value.groups.map(e=>pd("div",{key:e.key,class:"menu-group"},pd("h6",null,e.label),pd("ul",null,e.items.map(e=>pd("li",{key:e.key,"data-index":e.index,class:s.value===e.index?"hover":"",onPointerenter:m(e.index),onPointerdown:()=>{var t,n;null==(n=null==(t=i.value)?void 0:t.querySelector(`[data-index="${e.index}"]`))||n.classList.add("active")},onPointerup:()=>{var t,n;null==(n=null==(t=i.value)?void 0:t.querySelector(`[data-index="${e.index}"]`))||n.classList.remove("active"),h(e.index)}},pd(jd,{icon:e.icon}),pd("span",null,e.label))))))))}});var NA,HA,qA,jA,VA,FA=e=>{throw TypeError(e)},$A=(e,t,n)=>t.has(e)||FA("Cannot "+n),WA=(e,t,n)=>($A(e,t,"read from private field"),n?n.call(e):t.get(e)),UA=(e,t,n)=>t.has(e)?FA("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),GA=(e,t,n,r)=>($A(e,t,"write to private field"),t.set(e,n),n);const ZA=function(e){const t=a({},`${e}_SLASH_SPEC`),n=s(n=>{const r=n.get(t.key);return new c({key:new d(`${e}_SLASH`),...r})}),r=[t,n];return r.key=t.key,r.pluginKey=n.key,t.meta={package:"@milkdown/plugin-slash",displayName:`Ctx<slashSpec>|${e}`},n.meta={package:"@milkdown/plugin-slash",displayName:`Prose<slash>|${e}`},r}("CREPE_MENU"),XA=a({show:()=>{},hide:()=>{}},"menuAPICtx");class KA{constructor(e,t,n){UA(this,NA),UA(this,HA),UA(this,qA),UA(this,jA),UA(this,VA,null),this.update=e=>{WA(this,jA).update(e)},this.show=e=>{GA(this,VA,e),WA(this,qA).value="",WA(this,jA).show()},this.hide=()=>{GA(this,VA,null),WA(this,jA).hide()},this.destroy=()=>{WA(this,jA).destroy(),WA(this,HA).unmount(),WA(this,NA).remove()};const r=document.createElement("div");r.classList.add("milkdown-slash-menu");const o=gs(!1),i=gs("");GA(this,qA,i);const a=this.hide,s=qd(DA,{ctx:e,config:n,show:o,filter:i,hide:a});GA(this,HA,s),s.mount(r),GA(this,NA,r);const l=this;GA(this,jA,new Jd({content:WA(this,NA),debounce:20,shouldShow(e){if(TA(e.state.selection)||EA(e.state.selection))return!1;const t=this.getContent(e,e=>["paragraph","heading"].includes(e.type.name));if(null==t)return!1;if(!function(e){if(!(e instanceof S))return!1;const{$head:t}=e,n=t.parent;return t.parentOffset===n.content.size}(e.state.selection))return!1;const n=WA(l,VA);if(i.value=t.startsWith("/")?t.slice(1):t,"number"==typeof n){const t=e.state.doc.nodeSize-2,r=Math.min(n,t);return e.state.doc.resolve(r).node()===e.state.doc.resolve(e.state.selection.from).node()||(GA(l,VA,null),!1)}return!!t.startsWith("/")},offset:10})),WA(this,jA).onShow=()=>{o.value=!0},WA(this,jA).onHide=()=>{o.value=!1},this.update(t),e.set(XA.key,{show:e=>this.show(e),hide:()=>this.hide()})}}NA=new WeakMap,HA=new WeakMap,qA=new WeakMap,jA=new WeakMap,VA=new WeakMap;const YA=ml({props:{onAdd:{type:Function,required:!0},addIcon:{type:String,required:!0},handleIcon:{type:String,required:!0}},setup(e){const t=gs();return()=>pd(Dc,null,pd("div",{ref:t,class:"operation-item",onPointerdown:e=>{var n;e.preventDefault(),e.stopPropagation(),null==(n=t.value)||n.classList.add("active")},onPointerup:n=>{var r;n.preventDefault(),n.stopPropagation(),null==(r=t.value)||r.classList.remove("active"),e.onAdd()}},pd(jd,{icon:e.addIcon})),pd("div",{class:"operation-item"},pd(jd,{icon:e.handleIcon})))}});var JA,QA,eM,tM,nM=e=>{throw TypeError(e)},rM=(e,t,n)=>t.has(e)||nM("Cannot "+n),oM=(e,t,n)=>(rM(e,t,"read from private field"),n?n.call(e):t.get(e)),iM=(e,t,n)=>t.has(e)?nM("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),aM=(e,t,n,r)=>(rM(e,t,"write to private field"),t.set(e,n),n);class sM{constructor(e,t){var n,r,o;iM(this,JA),iM(this,QA),iM(this,eM),iM(this,tM),this.update=()=>{oM(this,QA).update()},this.destroy=()=>{oM(this,QA).destroy(),oM(this,JA).remove(),oM(this,eM).unmount()},this.onAdd=()=>{const e=oM(this,tM),t=e.get(T);t.hasFocus()||t.focus();const{state:n,dispatch:r}=t,o=oM(this,QA).active;if(!o)return;const i=o.$pos.pos+o.node.nodeSize;let a=n.tr.insert(i,X.type(e).create());a=a.setSelection(S.near(a.doc.resolve(i))),r(a.scrollIntoView()),oM(this,QA).hide(),e.get(XA.key).show(a.selection.from)},aM(this,tM,e);const i=document.createElement("div");i.classList.add("milkdown-block-handle");const a=qd(YA,{onAdd:this.onAdd,addIcon:null!=(n=null==t?void 0:t.handleAddIcon)?n:j_,handleIcon:null!=(r=null==t?void 0:t.handleDragIcon)?r:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_971_7680)">\n <path\n d="M11 18C11 19.1 10.1 20 9 20C7.9 20 7 19.1 7 18C7 16.9 7.9 16 9 16C10.1 16 11 16.9 11 18ZM9 10C7.9 10 7 10.9 7 12C7 13.1 7.9 14 9 14C10.1 14 11 13.1 11 12C11 10.9 10.1 10 9 10ZM9 4C7.9 4 7 4.9 7 6C7 7.1 7.9 8 9 8C10.1 8 11 7.1 11 6C11 4.9 10.1 4 9 4ZM15 8C16.1 8 17 7.1 17 6C17 4.9 16.1 4 15 4C13.9 4 13 4.9 13 6C13 7.1 13.9 8 15 8ZM15 10C13.9 10 13 10.9 13 12C13 13.1 13.9 14 15 14C16.1 14 17 13.1 17 12C17 10.9 16.1 10 15 10ZM15 16C13.9 16 13 16.9 13 18C13 19.1 13.9 20 15 20C16.1 20 17 19.1 17 18C17 16.9 16.1 16 15 16Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_971_7680">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n'});a.mount(i),aM(this,eM,a),aM(this,JA,i);const s=null!=(o=null==t?void 0:t.blockHandle)?o:{};aM(this,QA,new Kd({ctx:e,content:i,getOffset:()=>16,getPlacement:({active:e,blockDom:t})=>{if("heading"===e.node.type.name)return"left";let n=0;e.node.descendants(e=>{n+=e.childCount});const r=e.el,o=r.getBoundingClientRect(),i=t.getBoundingClientRect(),a=window.getComputedStyle(r),s=Number.parseInt(a.paddingTop,10)||0,l=Number.parseInt(a.paddingBottom,10)||0,c=o.height-s-l,d=i.height;return n>2||d<c?"left-start":"left"},...s})),this.update()}}JA=new WeakMap,QA=new WeakMap,eM=new WeakMap,tM=new WeakMap;const lM=J.extendSchema(e=>t=>{const n=e(t);return{...n,toMarkdown:{match:n.toMarkdown.match,runner:(e,t)=>{var r,o;if("latex"!==(null!=(r=t.attrs.language)?r:"").toLowerCase())return n.toMarkdown.runner(e,t);e.addNode("math",void 0,(null==(o=t.content.firstChild)?void 0:o.text)||"")}}}}),cM="math_inline",dM=I(cM,()=>({group:"inline",inline:!0,draggable:!0,atom:!0,attrs:{value:{default:""}},parseDOM:[{tag:`span[data-type="${cM}"]`,getAttrs:e=>{var t;return{value:null!=(t=e.dataset.value)?t:""}}}],toDOM:e=>{const t=e.attrs.value,n=document.createElement("span");return n.dataset.type=cM,n.dataset.value=t,Nx.render(t,n,{throwOnError:!1}),n},parseMarkdown:{match:e=>"inlineMath"===e.type,runner:(e,t,n)=>{e.addNode(n,{value:t.value})}},toMarkdown:{match:e=>e.type.name===cM,runner:(e,t)=>{e.addNode("inlineMath",void 0,t.attrs.value)}}})),uM=l("ToggleLatex",e=>()=>(t,n)=>{const{hasNode:r,pos:o,target:i}=Oe(t,dM.type(e)),{selection:a,doc:s,tr:l}=t;if(!r){const t=s.textBetween(a.from,a.to);let r=l.replaceSelectionWith(dM.type(e).create({value:t}));return n&&n(r.setSelection(M.create(r.doc,a.from))),!0}const{from:c,to:d}=a;if(!i||o<0)return!1;let u=l.delete(o,o+1);const h=i.attrs.value;return u=u.insertText(h,o),n&&n(u.setSelection(S.create(u.doc,c,d+h.length-1))),!0}),hM=oi("INLINE_LATEX"),pM=ml({props:{config:{type:Object,required:!0},innerView:{type:Object,required:!0},updateValue:{type:Object,required:!0}},setup(e){const t=t=>{if(t&&t instanceof HTMLElement){for(;t.firstChild;)t.removeChild(t.firstChild);e.innerView.value&&t.appendChild(e.innerView.value.dom)}},n=t=>{t.preventDefault(),e.updateValue.value()};return()=>pd("div",{class:"container"},e.innerView&&pd("div",{ref:t}),pd("button",{type:"button",onPointerdown:n},pd(jd,{icon:e.config.inlineEditConfirm})))}});var mM,fM,gM,vM,yM,bM,wM,xM,kM=e=>{throw TypeError(e)},CM=(e,t,n)=>t.has(e)||kM("Cannot "+n),_M=(e,t,n)=>(CM(e,t,"read from private field"),n?n.call(e):t.get(e)),SM=(e,t,n)=>t.has(e)?kM("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),AM=(e,t,n,r)=>(CM(e,t,"write to private field"),t.set(e,n),n);class MM{constructor(e,t,n){this.ctx=e,SM(this,mM),SM(this,fM),SM(this,gM),SM(this,vM,vs(null)),SM(this,yM,vs(()=>{})),SM(this,bM),SM(this,wM,()=>{_M(this,vM).value&&(_M(this,vM).value.destroy(),_M(this,vM).value=null)}),SM(this,xM,e=>{const t=(()=>{if(!e.editable)return!1;const{selection:t,schema:n}=e.state;if(t.empty)return!1;if(!(t instanceof M))return!1;const r=t.node;if(r.type.name!==cM)return!1;const o=t.from,i=n.nodes.paragraph.create(null,n.text(r.attrs.value)),a=new Re(_M(this,gM),{state:Pe.create({doc:i,schema:new ze({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:()=>["p",0]},text:{group:"inline"}}}),plugins:[Be({"Mod-z":Q,"Mod-Z":ee,"Mod-y":ee,Enter:()=>(_M(this,yM).value(),!0)})]})});return _M(this,vM).value=a,_M(this,yM).value=()=>{const{tr:t}=e.state;t.setNodeAttribute(o,"value",a.state.doc.textContent),e.dispatch(t),requestAnimationFrame(()=>{e.focus()})},!0})();return t||_M(this,wM).call(this),t}),this.update=(e,t)=>{_M(this,fM).update(e,t)},this.destroy=()=>{_M(this,bM).unmount(),_M(this,fM).destroy(),_M(this,mM).remove()};const r=document.createElement("div");r.className="milkdown-latex-inline-edit",AM(this,mM,r),AM(this,bM,qd(pM,{config:n,innerView:_M(this,vM),updateValue:_M(this,yM)})),_M(this,bM).mount(r),AM(this,fM,new ri({debounce:0,content:_M(this,mM),shouldShow:_M(this,xM),offset:10,floatingUIOptions:{placement:"bottom"}})),_M(this,fM).update(t),AM(this,gM,document.createElement("div"))}}mM=new WeakMap,fM=new WeakMap,gM=new WeakMap,vM=new WeakMap,yM=new WeakMap,bM=new WeakMap,wM=new WeakMap,xM=new WeakMap;const TM=V(e=>Ee(/(?:\$)([^$]+)(?:\$)$/,dM.type(e),{getAttr:e=>{var t;return{value:null!=(t=e[1])?t:""}}})),EM=V(e=>Le(/^\$\$[\s\n]$/,J.type(e),()=>({language:"LaTeX"}))),LM=O("remarkMath",()=>Te);function OM(e){return Et(e,"math",(e,t,n)=>{const{value:r}=e,o={type:"code",lang:"LaTeX",value:r};n.children.splice(t,1,o)})}const IM=O("remarkMathBlock",()=>()=>OM),RM=a({text:"Please enter...",mode:"block"},"placeholderConfigCtx"),PM=s(e=>new c({key:new d("CREPE_PLACEHOLDER"),props:{decorations:t=>{var n;const r=function(e){return e.get("CrepeCtx")}(e);if(r.readonly)return null;const o=e.get(RM.key);if("doc"===o.mode&&!function(e){var t;return e.childCount<=1&&!(null==(t=e.firstChild)?void 0:t.content.size)}(t.doc))return null;if(TA(t.selection)||EA(t.selection))return null;const i=function(e,t){const{selection:n}=e;if(!n.empty)return null;const r=n.$anchor,o=r.parent;if(o.content.size>0)return null;if(A(e=>"table"===e.type.name)(r))return null;const i=r.before();return v.node(i,i+o.nodeSize,{class:"crepe-placeholder","data-placeholder":t})}(t,null!=(n=o.text)?n:"Please enter...");return i?f.create(t.doc,[i]):null}}})),BM=ml({props:{ctx:{type:Object,required:!0},hide:{type:Function,required:!0},show:{type:Object,required:!0},selection:{type:Object,required:!0},config:{type:Object,required:!1}},setup(e){const{ctx:t,config:n}=e,r=e=>n=>{n.preventDefault(),t&&(null==e||e(t))};function o(n){return e.selection.value,t.get(De).status===xe.Created&&n(t)}const i=hd(()=>function(e,t){var n,r,o,i,a,s,l,c,d;const u=new zA;u.addGroup("formatting","Formatting").addItem("bold",{icon:null!=(n=null==e?void 0:e.boldIcon)?n:A_,active:e=>e.get(g).call(Xe.key,Ke.type(e)),onRun:e=>{e.get(g).call(Ze.key)}}).addItem("italic",{icon:null!=(r=null==e?void 0:e.italicIcon)?r:N_,active:e=>e.get(g).call(Xe.key,Je.type(e)),onRun:e=>{e.get(g).call(Ye.key)}}).addItem("strikethrough",{icon:null!=(o=null==e?void 0:e.strikethroughIcon)?o:W_,active:e=>e.get(g).call(Xe.key,ep.type(e)),onRun:e=>{e.get(g).call(tp.key)}});const h=u.addGroup("function","Function");h.addItem("code",{icon:null!=(i=null==e?void 0:e.codeIcon)?i:L_,active:e=>e.get(g).call(Xe.key,et.type(e)),onRun:e=>{e.get(g).call(Qe.key)}});const p=t&&eS(t).get();if((null==p?void 0:p.includes(C_.Latex))&&h.addItem("latex",{icon:null!=(a=null==e?void 0:e.latexIcon)?a:X_,active:e=>{const t=e.get(g),n=e.get(ae).nodes[cM];return t.call(tt.key,n)},onRun:e=>{e.get(g).call("ToggleLatex")}}),h.addItem("link",{icon:null!=(s=null==e?void 0:e.linkIcon)?s:H_,active:e=>e.get(g).call(Xe.key,oe.type(e)),onRun:e=>{e.get(g).call(tk.key)}}),t&&(null==p?void 0:p.includes(C_.AI))){const n=t.get(rS.key);n.provider&&h.addItem("ai",{icon:null!=(c=null!=(l=null==e?void 0:e.aiIcon)?l:n.aiIcon)?c:S_,active:()=>!1,onRun:e=>{const t=e.get(lA.key),n=e.get(T),{from:r,to:o}=n.state.selection;t.show(r,o)}})}return null==(d=null==e?void 0:e.buildToolbar)||d.call(e,u),u.build()}(n,t));return()=>pd(Dc,null,i.value.map(e=>e.items.map(e=>pd("button",{type:"button",class:Ln("toolbar-item",t&&o(e.active)&&"active"),onPointerdown:r(e.onRun)},pd(jd,{icon:e.icon})))).reduce((e,t,n)=>(0===n?e.push(...t):e.push(pd("div",{class:"divider"}),...t),e),[]))}});var zM,DM,NM,HM,qM,jM=e=>{throw TypeError(e)},VM=(e,t,n)=>t.has(e)||jM("Cannot "+n),FM=(e,t,n)=>(VM(e,t,"read from private field"),n?n.call(e):t.get(e)),$M=(e,t,n)=>t.has(e)?jM("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),WM=(e,t,n,r)=>(VM(e,t,"write to private field"),t.set(e,n),n);const UM=oi("CREPE_TOOLBAR");class GM{constructor(e,t,n){$M(this,zM),$M(this,DM),$M(this,NM),$M(this,HM),$M(this,qM,gs(!1)),this.update=(e,t)=>{FM(this,zM).update(e,t),FM(this,HM).value=e.state.selection},this.destroy=()=>{FM(this,zM).destroy(),FM(this,NM).unmount(),FM(this,DM).remove()},this.hide=()=>{FM(this,zM).hide()};const r=document.createElement("div");r.className="milkdown-toolbar",WM(this,HM,vs(t.state.selection));const o=qd(BM,{ctx:e,hide:this.hide,config:n,selection:FM(this,HM),show:FM(this,qM)});o.mount(r),WM(this,DM,r),WM(this,NM,o),WM(this,zM,new ri({content:FM(this,DM),debounce:20,offset:10,shouldShow(e){const{doc:t,selection:n}=e.state,{empty:o,from:i,to:a}=n,s=!t.textBetween(i,a).length&&n instanceof S,l=!(n instanceof S),c=e.dom.getRootNode().activeElement,d=r.contains(c),u=!e.hasFocus()&&!d,h=!e.editable;return!(u||l||o||s||h)}})),FM(this,zM).onShow=()=>{FM(this,qM).value=!0},FM(this,zM).onHide=()=>{FM(this,qM).value=!1},this.update(t)}}zM=new WeakMap,DM=new WeakMap,NM=new WeakMap,HM=new WeakMap,qM=new WeakMap;const ZM=[{label:"Paragraph",level:null},{label:"Heading 1",level:1},{label:"Heading 2",level:2},{label:"Heading 3",level:3},{label:"Heading 4",level:4},{label:"Heading 5",level:5},{label:"Heading 6",level:6}];function XM(e,t){if(e.get(g).call(Xe.key,t))return!0;const n=e.get(T),{state:r}=n;if(r.storedMarks)return r.storedMarks.some(e=>e.type===t);if(r.selection instanceof S){const{$cursor:e}=r.selection;if(e)return e.marks().some(e=>e.type===t)}return!1}function KM(e,t){const n=null!=e?e:ZM;return{icon:"",active:()=>!1,selector:{chevronIcon:null!=t?t:T_,activeLabel:e=>function(e,t){var n,r;const o=null!=t?t:ZM,i=e.get(T),{$from:a}=i.state.selection,s=a.parent,l=null!=(n=o.find(e=>null===e.level))?n:o[0];if(s.type===qe.type(e)){const e=s.attrs.level;return null!=(r=o.find(t=>t.level===e))?r:l}return l}(e,n).label,options:n.map(e=>({label:e.label,onSelect:t=>function(e,t){const n=e.get(g);if(null==t){const t=X.type(e);n.call(He.key,{nodeType:t})}else{const r=qe.type(e);n.call(He.key,{nodeType:r,attrs:{level:t}})}}(t,e.level)}))}}}const YM=ml({props:{ctx:{type:Object,required:!0},version:{type:Object,required:!0},config:{type:Object,required:!1}},setup(e){const{ctx:t,config:n}=e,r=gs(null),o=e=>n=>{n.preventDefault(),t&&e(t)};function i(){return t.get(De).status===xe.Created}function a(){e.version.value}function s(e){return a(),!!i()&&e(t)}const l=e=>{e.target.closest(".top-bar-heading-selector")||(r.value=null)};El(()=>{window.addEventListener("pointerdown",l)}),Rl(()=>{window.removeEventListener("pointerdown",l)});const c=hd(()=>function(e,t){var n,r,o,i,a,s,l,c,d,u,h,p,m,f,v;const y=t&&eS(t).get(),b=null==y?void 0:y.includes(C_.Latex),w=null==y?void 0:y.includes(C_.ImageBlock),x=null==y?void 0:y.includes(C_.Table),k=new zA;k.addGroup("heading","Heading").addItem("heading-selector",{...KM(null==e?void 0:e.headingOptions,null==e?void 0:e.chevronDownIcon)}),k.addGroup("formatting","Formatting").addItem("bold",{icon:null!=(n=null==e?void 0:e.boldIcon)?n:A_,active:e=>XM(e,Ke.type(e)),onRun:e=>{e.get(g).call(Ze.key)}}).addItem("italic",{icon:null!=(r=null==e?void 0:e.italicIcon)?r:N_,active:e=>XM(e,Je.type(e)),onRun:e=>{e.get(g).call(Ye.key)}}).addItem("strikethrough",{icon:null!=(o=null==e?void 0:e.strikethroughIcon)?o:W_,active:e=>XM(e,ep.type(e)),onRun:e=>{e.get(g).call(tp.key)}}).addItem("code",{icon:null!=(i=null==e?void 0:e.codeIcon)?i:L_,active:e=>XM(e,et.type(e)),onRun:e=>{const t=e.get(T),{state:n}=t;if(n.selection.empty){const r=et.type(e);XM(e,r)?t.dispatch(n.tr.removeStoredMark(r)):t.dispatch(n.tr.addStoredMark(r.create()))}else e.get(g).call(Qe.key)}}),k.addGroup("list","List").addItem("bullet-list",{icon:null!=(a=null==e?void 0:e.bulletListIcon)?a:M_,active:()=>!1,onRun:e=>{const t=e.get(g),n=We.type(e);t.call(Ve.key,{nodeType:n})}}).addItem("ordered-list",{icon:null!=(s=null==e?void 0:e.orderedListIcon)?s:q_,active:()=>!1,onRun:e=>{const t=e.get(g),n=Ue.type(e);t.call(Ve.key,{nodeType:n})}}).addItem("task-list",{icon:null!=(l=null==e?void 0:e.taskListIcon)?l:G_,active:()=>!1,onRun:e=>{const t=e.get(g),n=H.type(e);t.call(Ve.key,{nodeType:n,attrs:{checked:!1}})}});const C=k.addGroup("insert","Insert");C.addItem("link",{icon:null!=(c=null==e?void 0:e.linkIcon)?c:H_,active:e=>XM(e,oe.type(e)),onRun:e=>{const t=e.get(T),{state:n}=t,r=oe.type(e);n.selection.empty&&XM(e,r)?t.dispatch(n.tr.removeStoredMark(r)):e.get(g).call(tk.key)}}),w&&C.addItem("image",{icon:null!=(d=null==e?void 0:e.imageIcon)?d:D_,active:()=>!1,onRun:e=>{const t=e.get(g),n=yu.type(e);t.call($e.key,{nodeType:n})}}),x&&C.addItem("table",{icon:null!=(u=null==e?void 0:e.tableIcon)?u:U_,active:()=>!1,onRun:e=>{const t=e.get(g),n=e.get(T),{from:r}=n.state.selection;t.call($e.key,{nodeType:dp(e,3,3)}),t.call(Ge.key,{pos:r})}});const _=k.addGroup("block","Block");return _.addItem("code-block",{icon:null!=(h=null==e?void 0:e.codeBlockIcon)?h:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm1 2v14h16V5H4zm8 10h6v2h-6v-2zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243-1.415-1.415L8.667 12z"\n />\n </svg>\n',active:()=>!1,onRun:e=>{const t=e.get(g),n=J.type(e);t.call(He.key,{nodeType:n})}}),b&&_.addItem("math",{icon:null!=(p=null==e?void 0:e.mathIcon)?p:X_,active:()=>!1,onRun:e=>{const t=e.get(g),n=J.type(e);t.call($e.key,{nodeType:n,attrs:{language:"LaTeX"}})}}),k.addGroup("more","More").addItem("quote",{icon:null!=(m=null==e?void 0:e.quoteIcon)?m:V_,active:()=>!1,onRun:e=>{const t=e.get(g),n=je.type(e);t.call(Ve.key,{nodeType:n})}}).addItem("hr",{icon:null!=(f=null==e?void 0:e.hrIcon)?f:R_,active:()=>!1,onRun:e=>{const t=e.get(g),n=Fe.type(e);t.call($e.key,{nodeType:n})}}),null==(v=null==e?void 0:e.buildTopBar)||v.call(e,k),k.build()}(n,t));return()=>{const e=i()?t.get(T):null;return e&&!e.editable?null:pd("div",{class:"top-bar-inner"},c.value.map(e=>e.items.map(e=>e.selector?function(e,n){const o=r.value===e,s=function(e){var n,r;return a(),i()?e.activeLabel(t):null!=(r=null==(n=e.options[0])?void 0:n.label)?r:""}(n);return pd("div",{key:e,class:"top-bar-heading-selector"},pd("button",{type:"button",class:"top-bar-heading-button",onPointerdown:t=>function(e,t){t.preventDefault(),t.stopPropagation(),r.value=r.value===e?null:e}(e,t)},pd("span",{class:"top-bar-heading-label"},s),n.chevronIcon&&pd("span",{class:"top-bar-chevron"},pd(jd,{icon:n.chevronIcon}))),o&&pd("div",{class:"top-bar-heading-dropdown"},n.options.map((n,o)=>pd("button",{key:`${e}-${o}`,type:"button",class:Ln("top-bar-heading-option",s===n.label&&"active"),onPointerdown:e=>{e.preventDefault(),e.stopPropagation(),r.value=null,n.onSelect(t)}},n.label))))}(e.key,e.selector):e.onRun?function(e){return pd("button",{key:e.key,type:"button",class:Ln("top-bar-item",s(e.active)&&"active"),onPointerdown:o(e.onRun)},pd(jd,{icon:e.icon}))}(e):null)).reduce((e,t,n)=>{var r,o;if(0===n)e.push(...t);else{const i=null!=(o=null==(r=c.value[n])?void 0:r.key)?o:n;e.push(pd("div",{key:`divider-${i}`,class:"top-bar-divider"}),...t)}return e},[]))}}});var JM,QM,eT,tT=e=>{throw TypeError(e)},nT=(e,t,n)=>t.has(e)||tT("Cannot "+n),rT=(e,t,n)=>(nT(e,t,"read from private field"),n?n.call(e):t.get(e)),oT=(e,t,n)=>t.has(e)?tT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),iT=(e,t,n,r)=>(nT(e,t,"write to private field"),t.set(e,n),n);const aT=new d("CREPE_TOP_BAR");class sT{constructor(e,t,n){oT(this,JM),oT(this,QM),oT(this,eT),this.update=(e,t)=>{rT(this,JM).style.display=e.editable?"":"none",rT(this,eT).value++},this.destroy=()=>{rT(this,QM).unmount(),rT(this,JM).remove()},iT(this,eT,gs(0));const r=document.createElement("div");r.className="milkdown-top-bar";const o=qd(YM,{ctx:e,config:n,version:rT(this,eT)});o.mount(r),iT(this,JM,r),iT(this,QM,o);const i=t.dom.parentElement;i&&i.insertBefore(r,i.firstChild),this.update(t)}}JM=new WeakMap,QM=new WeakMap,eT=new WeakMap;const lT=a({view:()=>({update:()=>{},destroy:()=>{}})},"topBarConfig"),cT=s(e=>{const t=e.get(lT.key);return new c({key:aT,view:t.view})});var dT,uT,hT,pT=e=>{throw TypeError(e)},mT=(e,t,n)=>t.has(e)||pT("Cannot "+n),fT=(e,t,n)=>(mT(e,t,"read from private field"),n?n.call(e):t.get(e)),gT=(e,t,n)=>t.has(e)?pT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),vT=(e,t,n,r)=>(mT(e,t,"write to private field"),t.set(e,n),n);class yT{constructor({root:e,defaultValue:t=""}={}){var n;gT(this,dT),gT(this,uT),gT(this,hT,!0),this.addFeature=(e,t)=>(e(fT(this,dT),t),this),this.create=()=>fT(this,dT).create(),this.destroy=()=>fT(this,dT).destroy(),this.setReadonly=e=>(vT(this,hT,!e),fT(this,dT).action(t=>{fT(this,dT).status===xe.Created&&t.get(T).setProps({editable:()=>!e})}),this),this.getMarkdown=()=>fT(this,dT).action(ke()),this.on=e=>fT(this,dT).status!==xe.Created?(fT(this,dT).config(t=>{const n=t.get(m_);e(n)}),this):(fT(this,dT).action(t=>{const n=t.get(m_);e(n)}),this),vT(this,uT,null!=(n="string"==typeof e?document.querySelector(e):e)?n:document.body),vT(this,dT,Ce.make().config(e=>{e.inject(Q_,this),e.inject(J_,[])}).config(e=>{e.set(_e,fT(this,uT)),e.set(Se,t),e.set(se,{editable:()=>fT(this,hT)}),e.update(d_.key,e=>({...e,size:4})),e.update(w_.key,e=>({...e,uploader:async(e,t,n)=>{const r=eS(n).get().includes(C_.ImageBlock),o=r?t.nodes["image-block"]:t.nodes.image;if(!o)return[];const i=r?n.get(lu.key).onUpload:void 0,a=[];for(let s=0;s<e.length;s++){const t=e.item(s);t&&t.type.includes("image")&&a.push(t)}return await Promise.all(a.map(async e=>{const t=i?await i(e):URL.createObjectURL(e);return o.createAndFill({src:t})}))}}))}).use(Ae).use(g_).use(c_).use(h_).use(b_).use(n_).use(k_).use(Kp))}get editor(){return fT(this,dT)}get readonly(){return!fT(this,hT)}}dT=new WeakMap,uT=new WeakMap,hT=new WeakMap;class bT extends yT{constructor({features:e={},featureConfigs:t={},...n}={}){super(n);const r=fr(t,Y_);Object.entries({...__,...e}).filter(([,e])=>e).map(([e])=>e).forEach(e=>{const t=r[e];!function(e,t,n){switch(e){case C_.CodeMirror:return((e,t={})=>{e.config(tS(C_.CodeMirror)).config(e=>{const{languages:n=[],theme:r}=t,o=[Ht.of(xn.concat(_n)),Ff];r&&o.push(r),t.extensions&&o.push(...t.extensions),e.update(om.key,e=>{var r;return{extensions:o,languages:n,expandIcon:t.expandIcon||T_,searchIcon:t.searchIcon||$_,clearSearchIcon:t.clearSearchIcon||E_,searchPlaceholder:t.searchPlaceholder||"Search language",copyText:t.copyText||"Copy",copyIcon:t.copyIcon||I_,onCopy:t.onCopy||(()=>{}),noResultText:t.noResultText||"No result",renderLanguage:t.renderLanguage||e.renderLanguage,renderPreview:t.renderPreview||e.renderPreview,previewToggleButton:e=>{var n,r;return[(null==(n=t.previewToggleIcon)?void 0:n.call(t,e))||(e?B_:K_),(null==(r=t.previewToggleText)?void 0:r.call(t,e))||(e?"Edit":"Hide")].map(e=>e.trim()).join(" ")},previewLabel:t.previewLabel||e.previewLabel,previewLoading:t.previewLoading||e.previewLoading,previewOnlyByDefault:null!=(r=t.previewOnlyByDefault)?r:e.previewOnlyByDefault}})}).use(ym)})(t,n);case C_.ListItem:return((e,t)=>{e.config(tS(C_.ListItem)).config(e=>function(e,t){e.set(vC.key,{renderLabel:({label:e,listType:n,checked:r})=>{var o,i,a;return null==r?"bullet"===n?null!=(o=null==t?void 0:t.bulletIcon)?o:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_952_6527)">\n <circle cx="12" cy="12" r="3" />\n </g>\n <defs>\n <clipPath id="clip0_952_6527">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n':e:r?null!=(i=null==t?void 0:t.checkBoxCheckedIcon)?i:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_1803_1151)">\n <path\n d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM10.71 16.29C10.32 16.68 9.69 16.68 9.3 16.29L5.71 12.7C5.32 12.31 5.32 11.68 5.71 11.29C6.1 10.9 6.73 10.9 7.12 11.29L10 14.17L16.88 7.29C17.27 6.9 17.9 6.9 18.29 7.29C18.68 7.68 18.68 8.31 18.29 8.7L10.71 16.29Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_1803_1151">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n':null!=(a=null==t?void 0:t.checkBoxUncheckedIcon)?a:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <g clip-path="url(#clip0_1803_535)">\n <path\n d="M18 19H6C5.45 19 5 18.55 5 18V6C5 5.45 5.45 5 6 5H18C18.55 5 19 5.45 19 6V18C19 18.55 18.55 19 18 19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3Z"\n />\n </g>\n <defs>\n <clipPath id="clip0_1803_535">\n <rect width="24" height="24" />\n </clipPath>\n </defs>\n </svg>\n'}})}(e,t)).use(xC)})(t,n);case C_.LinkTooltip:return((e,t)=>{e.config(tS(C_.LinkTooltip)).config(lC).config(e=>{e.update(ek.key,e=>{var n,r,o,i,a,s;return{...e,linkIcon:null!=(n=null==t?void 0:t.linkIcon)?n:I_,editButton:null!=(r=null==t?void 0:t.editButton)?r:B_,removeButton:null!=(o=null==t?void 0:t.removeButton)?o:F_,confirmButton:null!=(i=null==t?void 0:t.confirmButton)?i:O_,inputPlaceholder:null!=(a=null==t?void 0:t.inputPlaceholder)?a:"Paste link...",onCopyLink:null!=(s=null==t?void 0:t.onCopyLink)?s:()=>{}}})}).use(cC)})(t,n);case C_.ImageBlock:return((e,t)=>{e.config(tS(C_.ImageBlock)).config(e=>{e.update(bg.key,e=>{var n,r,o,i,a,s;return{uploadButton:null!=(n=null==t?void 0:t.inlineUploadButton)?n:"Upload",imageIcon:null!=(r=null==t?void 0:t.inlineImageIcon)?r:D_,confirmButton:null!=(o=null==t?void 0:t.inlineConfirmButton)?o:O_,uploadPlaceholderText:null!=(i=null==t?void 0:t.inlineUploadPlaceholderText)?i:"or paste link",onUpload:null!=(s=null!=(a=null==t?void 0:t.inlineOnUpload)?a:null==t?void 0:t.onUpload)?s:e.onUpload,proxyDomURL:null==t?void 0:t.proxyDomURL}}),e.update(lu.key,e=>{var n,r,o,i,a,s,l,c,d;return{uploadButton:null!=(n=null==t?void 0:t.blockUploadButton)?n:"Upload file",imageIcon:null!=(r=null==t?void 0:t.blockImageIcon)?r:D_,captionIcon:null!=(o=null==t?void 0:t.blockCaptionIcon)?o:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="32"\n height="32"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M9 22a1 1 0 0 1-1-1v-3H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6.1l-3.7 3.71c-.2.19-.45.29-.7.29zm1-6v3.08L13.08 16H20V4H4v12z"\n />\n </svg>\n',confirmButton:null!=(i=null==t?void 0:t.blockConfirmButton)?i:"Confirm",captionPlaceholderText:null!=(a=null==t?void 0:t.blockCaptionPlaceholderText)?a:"Write Image Caption",uploadPlaceholderText:null!=(s=null==t?void 0:t.blockUploadPlaceholderText)?s:"or paste link",onUpload:null!=(c=null!=(l=null==t?void 0:t.blockOnUpload)?l:null==t?void 0:t.onUpload)?c:e.onUpload,proxyDomURL:null==t?void 0:t.proxyDomURL,onImageLoadError:null!=(d=null==t?void 0:t.onImageLoadError)?d:e.onImageLoadError,maxWidth:null==t?void 0:t.maxWidth,maxHeight:null==t?void 0:t.maxHeight}})}).use(Lu).use(Sg)})(t,n);case C_.Cursor:return((e,t)=>{if(e.config(tS(C_.Cursor)).config(e=>{e.update(rg.key,()=>{var e,n;return{class:"crepe-drop-cursor",width:null!=(e=null==t?void 0:t.width)?e:4,color:null!=(n=null==t?void 0:t.color)&&n}})}).use(lg),!1===(null==t?void 0:t.virtual))return;const n=function(){let e="undefined"==typeof document?null:document.createElement("div");return new c({key:cg,view:t=>{!function(e,t){for(const[n,r]of Object.entries(e.marks))!1!==r.spec.inclusive||t.includes(n)||console.warn(`[prosemirror-virtual-cursor] Virtual cursor does not work well with marks that have inclusive set to false. Please consider removing the inclusive option from the "${n}" mark or adding it to the "skipWarning" option.`)}(t.state.schema,[]);const n=t.dom.ownerDocument;e=e||document.createElement("div");const r=e,o=()=>{!function(e,t){if(!e||!e.dom||e.isDestroyed||!t)return;const{state:n,dom:r}=e,{selection:o}=n;if(!ug(o))return;const i=function(e,t){var n;const r=window.getSelection();if(!r||!r.rangeCount)return null;const o=null==(n=null==r?void 0:r.getRangeAt(0))?void 0:n.cloneRange();if(!o)return null;o.collapse(t);const i=o.getClientRects(),a=(null==i?void 0:i.length)?i[i.length-1]:null;return(null==a?void 0:a.height)?a:e.coordsAtPos(e.state.selection.head)}(e,o.$head===o.$from);if(!i)return t;const a=r.getBoundingClientRect();let s="prosemirror-virtual-cursor";const l=n.selection.$head,[c,d]=dg(l),u=n.storedMarks||l.marks();o.$cursor&&c&&d&&u&&!ne.sameSet(c,d)&&(ne.sameSet(c,u)?s+=" prosemirror-virtual-cursor-left":ne.sameSet(d,u)&&(s+=" prosemirror-virtual-cursor-right")),t.className=s,function(e,t){e.classList.remove(t),e.offsetWidth,e.classList.add(t)}(t,"prosemirror-virtual-cursor-animation"),t.style.height=i.bottom-i.top+"px",t.style.left=i.left-a.left+"px",t.style.top=i.top-a.top+"px"}(t,r)};let i;return window.ResizeObserver&&(i=new window.ResizeObserver(()=>o()),i.observe(t.dom)),n.addEventListener("selectionchange",o),{update:()=>{o()},destroy:()=>{n.removeEventListener("selectionchange",o),i&&i.unobserve(t.dom)}}},props:{handleKeyDown:(e,t)=>{var n;const{selection:r}=e.state;if(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||t.isComposing||!["ArrowLeft","ArrowRight"].includes(t.key)||!ug(r)||!r.empty)return!1;const o=r.$head,[i,a]=dg(o),s=e.state.storedMarks||o.marks();if(i&&a&&!ne.sameSet(i,a)){if("ArrowLeft"===t.key&&!ne.sameSet(i,s))return e.dispatch(e.state.tr.setStoredMarks(i)),!0;if("ArrowRight"===t.key&&!ne.sameSet(a,s))return e.dispatch(e.state.tr.setStoredMarks(a)),!0}return"ArrowLeft"===t.key&&1===o.textOffset?(e.dispatch(e.state.tr.setSelection(S.create(e.state.doc,o.pos-1)).setStoredMarks(o.marks())),!0):"ArrowRight"===t.key&&o.textOffset+1===(null==(n=o.parent.maybeChild(o.index()))?void 0:n.nodeSize)&&(e.dispatch(e.state.tr.setSelection(S.create(e.state.doc,o.pos+1)).setStoredMarks(o.marks())),!0)},decorations:t=>{if(e&&ug(t.selection)&&t.selection.empty)return f.create(t.doc,[v.widget(0,e,{key:"prosemirror-virtual-cursor"})])},attributes:{class:"virtual-cursor-enabled"}}})}();e.use(s(()=>n))})(t,n);case C_.BlockEdit:return((e,t)=>{e.config(tS(C_.BlockEdit)).config(e=>function(e,t){e.set(Fd.key,{filterNodes:e=>!A(e=>["table","blockquote","math_inline"].includes(e.type.name))(e)}),e.set(Yd.key,{view:()=>new sM(e,t)})}(e,t)).config(e=>function(e,t){e.set(ZA.key,{view:n=>new KA(e,n,t)})}(e,t)).use(XA).use(Yd).use(ZA)})(t,n);case C_.Placeholder:return((e,t)=>{e.config(tS(C_.Placeholder)).config(e=>{t&&e.update(RM.key,e=>({...e,...t}))}).use(PM).use(RM)})(t,n);case C_.Toolbar:return((e,t)=>{e.config(tS(C_.Toolbar)).config(e=>{e.set(UM.key,{view:n=>new GM(e,n,t)})}).use(UM)})(t,n);case C_.Table:return((e,t)=>{e.config(tS(C_.Table)).config(e=>{e.update(PC.key,e=>({...e,renderButton:e=>{var n,r,o,i,a,s,l,c,d;switch(e){case"add_row":return null!=(n=null==t?void 0:t.addRowIcon)?n:j_;case"add_col":return null!=(r=null==t?void 0:t.addColIcon)?r:j_;case"delete_row":return null!=(o=null==t?void 0:t.deleteRowIcon)?o:F_;case"delete_col":return null!=(i=null==t?void 0:t.deleteColIcon)?i:F_;case"align_col_left":return null!=(a=null==t?void 0:t.alignLeftIcon)?a:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25ZM4.25 16.625C4.0375 16.625 3.85942 16.5531 3.71575 16.4093C3.57192 16.2654 3.5 16.0872 3.5 15.8748C3.5 15.6621 3.57192 15.484 3.71575 15.3405C3.85942 15.1968 4.0375 15.125 4.25 15.125H13.75C13.9625 15.125 14.1406 15.1969 14.2843 15.3408C14.4281 15.4846 14.5 15.6628 14.5 15.8753C14.5 16.0879 14.4281 16.266 14.2843 16.4095C14.1406 16.5532 13.9625 16.625 13.75 16.625H4.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM4.25 8.875C4.0375 8.875 3.85942 8.80308 3.71575 8.65925C3.57192 8.51542 3.5 8.33725 3.5 8.12475C3.5 7.91208 3.57192 7.734 3.71575 7.5905C3.85942 7.44683 4.0375 7.375 4.25 7.375H13.75C13.9625 7.375 14.1406 7.44692 14.2843 7.59075C14.4281 7.73458 14.5 7.91275 14.5 8.12525C14.5 8.33792 14.4281 8.516 14.2843 8.6595C14.1406 8.80317 13.9625 8.875 13.75 8.875H4.25ZM4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25Z"\n />\n </svg>\n';case"align_col_center":return null!=(s=null==t?void 0:t.alignCenterIcon)?s:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25ZM8.25 16.625C8.0375 16.625 7.85942 16.5531 7.71575 16.4093C7.57192 16.2654 7.5 16.0872 7.5 15.8748C7.5 15.6621 7.57192 15.484 7.71575 15.3405C7.85942 15.1968 8.0375 15.125 8.25 15.125H15.75C15.9625 15.125 16.1406 15.1969 16.2843 15.3408C16.4281 15.4846 16.5 15.6628 16.5 15.8753C16.5 16.0879 16.4281 16.266 16.2843 16.4095C16.1406 16.5532 15.9625 16.625 15.75 16.625H8.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM8.25 8.875C8.0375 8.875 7.85942 8.80308 7.71575 8.65925C7.57192 8.51542 7.5 8.33725 7.5 8.12475C7.5 7.91208 7.57192 7.734 7.71575 7.5905C7.85942 7.44683 8.0375 7.375 8.25 7.375H15.75C15.9625 7.375 16.1406 7.44692 16.2843 7.59075C16.4281 7.73458 16.5 7.91275 16.5 8.12525C16.5 8.33792 16.4281 8.516 16.2843 8.6595C16.1406 8.80317 15.9625 8.875 15.75 8.875H8.25ZM4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25Z"\n />\n </svg>\n';case"align_col_right":return null!=(l=null==t?void 0:t.alignRightIcon)?l:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n d="M4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25ZM10.25 8.875C10.0375 8.875 9.85942 8.80308 9.71575 8.65925C9.57192 8.51542 9.5 8.33725 9.5 8.12475C9.5 7.91208 9.57192 7.734 9.71575 7.5905C9.85942 7.44683 10.0375 7.375 10.25 7.375H19.75C19.9625 7.375 20.1406 7.44692 20.2843 7.59075C20.4281 7.73458 20.5 7.91275 20.5 8.12525C20.5 8.33792 20.4281 8.516 20.2843 8.6595C20.1406 8.80317 19.9625 8.875 19.75 8.875H10.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM10.25 16.625C10.0375 16.625 9.85942 16.5531 9.71575 16.4093C9.57192 16.2654 9.5 16.0872 9.5 15.8748C9.5 15.6621 9.57192 15.484 9.71575 15.3405C9.85942 15.1968 10.0375 15.125 10.25 15.125H19.75C19.9625 15.125 20.1406 15.1969 20.2843 15.3408C20.4281 15.4846 20.5 15.6628 20.5 15.8753C20.5 16.0879 20.4281 16.266 20.2843 16.4095C20.1406 16.5532 19.9625 16.625 19.75 16.625H10.25ZM4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25Z"\n />\n </svg>\n';case"col_drag_handle":return null!=(c=null==t?void 0:t.colDragHandleIcon)?c:P_;case"row_drag_handle":return null!=(d=null==t?void 0:t.rowDragHandleIcon)?d:P_}}}))}).use(QC)})(t,n);case C_.Latex:return((e,t)=>{e.config(tS(C_.Latex)).config(e=>{if(!eS(e).get().includes(C_.CodeMirror))throw new Error("You need to enable CodeMirror to use LaTeX feature");e.update(om.key,e=>({...e,renderPreview:(n,r,o)=>"latex"===n.toLowerCase()&&r.length>0?function(e,t){return Nx.renderToString(e,{...t,throwOnError:!1,displayMode:!0})}(r,null==t?void 0:t.katexOptions):(0,e.renderPreview)(n,r,o)})),e.set(hM.key,{view:n=>{var r;return new MM(e,n,{inlineEditConfirm:null!=(r=null==t?void 0:t.inlineEditConfirm)?r:O_,...t})}})}).use(LM).use(IM).use(dM).use(hM).use(TM).use(EM).use(lM).use(uM)})(t,n);case C_.TopBar:return((e,t)=>{e.config(tS(C_.TopBar)).config(e=>{e.set(lT.key,{view:n=>new sT(e,n,t)})}).use(lT).use(cT)})(t,n);case C_.AI:((e,t)=>{var n,r;const o=null!=(n=null==t?void 0:t.diff)?n:{},i=null!=(r=null==t?void 0:t.streaming)?r:{};e.config(tS(C_.AI)).config(e=>{e.update(eo.key,e=>{var t;return{...e,ignoreAttrs:null!=(t=o.ignoreAttrs)?t:MA}});const{ignoreAttrs:t,...n}=o;e.update(ko.key,e=>{var t;return{...e,customBlockTypes:null!=(t=n.customBlockTypes)?t:AA,...n}})}).use(po).use(Vo).config(e=>{e.update($o.key,e=>{var n;return{...e,...i,ignoreAttrs:null!=(n=i.ignoreAttrs)?n:MA,...void 0!==(null==t?void 0:t.diffReviewOnEnd)?{diffReviewOnEnd:t.diffReviewOnEnd}:{}}})}).use(ni).config(e=>{e.update(rS.key,e=>{var n;return{...e,...void 0!==(null==t?void 0:t.provider)?{provider:t.provider}:{},...void 0!==(null==t?void 0:t.buildContext)?{buildContext:t.buildContext}:{},diffReviewOnEnd:null!=(n=null==t?void 0:t.diffReviewOnEnd)?n:e.diffReviewOnEnd,...void 0!==(null==t?void 0:t.onError)?{onError:t.onError}:{},...void 0!==(null==t?void 0:t.aiIcon)?{aiIcon:t.aiIcon}:{}}})}).use(rS).use(oS).use(sS).use(lS).config(function(e){return t=>{const n=function(e){var t,n;const r=new $S;return function(e){e.addItem("improve",{icon:S_,label:"Improve writing",streamingLabel:"Improving writing",prompt:"Improve the writing while preserving the original meaning."}).addItem("grammar",{icon:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M9.55 17.575L4.225 12.25l1.4-1.425L9.55 14.75l8.825-8.825l1.4 1.425z"\n />\n </svg>\n',label:"Fix grammar & spelling",streamingLabel:"Fixing grammar & spelling",prompt:"Fix any grammar and spelling errors without changing the meaning."}).addItem("shorter",{icon:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M5 13v-2h14v2z"\n />\n </svg>\n',label:"Make shorter",streamingLabel:"Making shorter",prompt:"Make this shorter while preserving the key information."}).addItem("longer",{icon:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M3 18v-2h13v2zm0-5v-2h18v2zm0-5V6h18v2zm15 13v-3h-3v-2h3v-3h2v3h3v2h-3v3z"\n />\n </svg>\n',label:"Make longer",streamingLabel:"Expanding",prompt:"Expand this with more detail and examples."}),e.addSubmenu("tone",{icon:B_,label:"Change tone…",title:"Change tone",searchPlaceholder:"Search tones…"},e=>{const t=[["professional","Professional"],["casual","Casual"],["confident","Confident"],["friendly","Friendly"],["direct","Direct"],["formal","Formal"]];for(const[n,r]of t)e.addItem(n,{icon:B_,label:r,streamingLabel:"Adjusting tone",prompt:`Rewrite this in a ${r.toLowerCase()} tone.`})}),e.addSubmenu("translate",{icon:Z_,label:"Translate…",title:"Translate",searchPlaceholder:"Search languages…"},e=>{const t=[["english","English","English"],["chinese","Chinese","Chinese (Simplified)"],["japanese","Japanese","Japanese"],["korean","Korean","Korean"],["spanish","Spanish","Spanish"],["french","French","French"],["german","German","German"]];for(const[n,r,o]of t)e.addItem(n,{icon:Z_,label:r,streamingLabel:`Translating to ${r}`,prompt:`Translate this to ${o}.`})})}(r),null==(t=null==e?void 0:e.buildAISuggestions)||t.call(e,r),{placeholder:null!=(n=null==e?void 0:e.instructionPlaceholder)?n:"Tell AI what to do with the selection…",chrome:dA(e),suggestions:r.build()}}(e);let r=null;t.update(lA.key,e=>({...e,show:(e,t)=>{null==r||r.show(e,t)}})),t.set(cA.key,{view:e=>(r=new sA(t,e,n),r)})}}(t)).use(lA).use(cA).use(function(e={}){var t,n;const{config:r}=e,o=null!=(t=null==r?void 0:r.fallbackLabel)?t:"Generating",i=null!=(n=null==r?void 0:r.cancelHint)?n:"Esc to cancel";return s(e=>{let t=null;function n(){t&&(t.destroy(),t=null)}return new c({key:_A,state:{init:()=>f.empty,apply(r,a,s,l){const c=Ko.getState(l);return(null==c?void 0:c.active)&&null!=c.insertEndPos?r.getMeta(Ko)||r.docChanged?function(n,r){const a=Math.min(r,n.content.size),s=v.widget(a,(t?t.setLabel(e):t=new SA(e,o,i),t).dom,{side:1,key:"ai-streaming-indicator"});return f.create(n,[s])}(l.doc,c.insertEndPos):a.map(r.mapping,r.doc):(n(),f.empty)}},view:()=>({destroy(){n()}}),props:{decorations(e){var t;return null!=(t=_A.getState(e))?t:f.empty},handleKeyDown(t,n){var r;if("Escape"!==n.key)return!1;const o=e.get(g);return e.get(oS.key).abortController?(n.preventDefault(),o.call(lS.key,{keep:!0}),!0):!!(null==(r=Ko.getState(t.state))?void 0:r.active)&&(n.preventDefault(),o.call(ti.key,{keep:!0}),!0)}}})})}({config:null==t?void 0:t.streamingIndicator})).use(function(e={}){const t=function(e){var t,n,r,o,i,a,s;const{config:l,enterKeyIcon:c}=e;return{retryLabel:null!=(t=null==l?void 0:l.retryLabel)?t:"Retry",rejectAllLabel:null!=(n=null==l?void 0:l.rejectAllLabel)?n:"Reject all",acceptAllLabel:null!=(r=null==l?void 0:l.acceptAllLabel)?r:"Accept all",retryIcon:null!=(o=null==l?void 0:l.retryIcon)?o:'\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="24"\n height="24"\n viewBox="0 0 24 24"\n >\n <path\n fill="currentColor"\n d="M12 20q-3.35 0-5.675-2.325T4 12q0-3.35 2.325-5.675T12 4q1.725 0 3.3.713T18 6.75V4h2v7h-7V9h4.2q-.8-1.4-2.187-2.2T12 6Q9.5 6 7.75 7.75T6 12q0 2.5 1.75 4.25T12 18q1.925 0 3.475-1.1T17.65 14h2.1q-.7 2.65-2.85 4.325T12 20"\n />\n </svg>\n',rejectIcon:null!=(i=null==l?void 0:l.rejectIcon)?i:E_,acceptIcon:null!=(a=null==l?void 0:l.acceptIcon)?a:O_,enterKeyIcon:null!=c?c:z_,modSymbol:null!=(s=null==l?void 0:l.modSymbol)?s:BS}}(e);return s(e=>new c({key:PS,view:n=>new RS(e,n,t),props:{handleKeyDown(t,n){var r;return!("Enter"!==n.key||!n.metaKey&&!n.ctrlKey||!(null==(r=to.getState(t.state))?void 0:r.active)||!e.get(oS.key).diffOwnedByAI||(n.preventDefault(),e.get(g).call(uo.key),0))}}}))}({config:null==t?void 0:t.diffActions,enterKeyIcon:null==t?void 0:t.enterKeyIcon}))})(t,n)}}(e,this.editor,t)})}}function wT(e){const{path:t,readOnly:o=!1}=e,a=n.useRef(null),l=n.useRef(e);l.current=e;const d=n.useRef(null),u=n.useRef(new Set),h=n.useRef(!1),[p,m]=n.useState(!1);return n.useEffect(()=>{if(!a.current)return;let n=!1,r=!1;m(!1),u.current.clear();const p=document.createElement("div");a.current.append(p);const f=l.current.text,g=new bT({root:p,defaultValue:nt(f),featureConfigs:{[bT.Feature.CodeMirror]:{previewOnlyByDefault:!0,renderPreview:(e,t,n)=>{if(!rt(e))return null;ot(t).then(n)}}},features:{[bT.Feature.Cursor]:!1,[bT.Feature.ImageBlock]:!1,[bT.Feature.BlockEdit]:!1,[bT.Feature.Toolbar]:!0,[bT.Feature.Placeholder]:!1}});g.editor.remove(it),g.editor.config(e=>e.update(om.key,e=>({...e,activationMode:"viewport"}))),g.editor.config(e=>e.update(at,Qn)),g.editor.config(e=>e.update(vC.key,e=>({...e,renderLabel:({label:e,listType:t,checked:n})=>{if(null==n)return"bullet"===t?st:e;if(!0===n)return lt;if("in-progress"===n)return ct;if("cancelled"===n)return dt;const r=i(n);return r&&" "!==r?r:ut}})));for(const e of ht)g.editor.use(e);g.editor.use(pt).use(mt);for(const e of ft)g.editor.use(e);g.editor.use(gt).use(vt).use(yt).use(bt).use(wt);for(const t of e.createNodeViews?.(g)??[])g.editor.use(t);return g.editor.use(s(e=>new c({view:()=>({update(t,o){if(!r||n||h.current||l.current.readOnly||t.state.doc.eq(o.doc))return;const i=e.get(le)(t.state.doc);u.current.add(i),l.current.onChange?.(i)}})}))),g.setReadonly(o),g.create().then(()=>{n?g.destroy():(d.current=g,g.setReadonly(l.current.readOnly??!1),l.current.text!==f&&g.editor.action(xt(nt(l.current.text))),r=!0,g.editor.action(e=>e.get(T).dom.setAttribute("aria-label",t)),a.current&&l.current.onReady?.(a.current))}).catch(()=>{n||m(!0)}),()=>{n=!0,d.current=null,r&&g.destroy(),p.remove()}},[t,e.createNodeViews]),n.useEffect(()=>{d.current?.setReadonly(o)},[o]),n.useEffect(()=>{const t=d.current;if(t)if(t.getMarkdown()!==e.text){if(!u.current.delete(e.text)){u.current.clear(),h.current=!0;try{t.editor.action(xt(nt(e.text)))}finally{h.current=!1}}}else u.current.clear()},[e.text]),r.jsxs("div",{className:"obsidian-file-editor remote-editor","data-readonly":o,onClick:e=>{if(e.defaultPrevented)return;const t=e.target instanceof Element?e.target:null,n=t?.closest(".callout-title")?.parentElement;if(n?.hasAttribute("data-callout-folded"))return e.stopPropagation(),void(n.dataset.calloutFolded=String("true"!==n.dataset.calloutFolded));a.current&&l.current.onClick?.(e,a.current)},children:[p&&r.jsx("p",{role:"alert",children:e.errorText}),r.jsx("div",{ref:a})]})}function xT({target:e,hash:t,host:o}){const[i,a]=n.useState({}),s=qn(),{path:l,cwd:c}=jn(e,o.path,o.cwd);return n.useEffect(()=>{const n=new AbortController;a({});const r=Vn();if(r&&!(o.depth>=3))return(o.resolveFile?.(e,o.path)??Promise.resolve({path:l,cwd:c})).then(async e=>{const o=await fetch(Fn(e.path,e.cwd),{headers:{authorization:`Bearer ${r.pairToken}`},signal:n.signal});if(!o.ok)throw new Error("Unable to load embedded note");const i=Mt(await o.text(),t);if(i.error||null===i.content)throw new Error("Missing section");n.signal.aborted||a({text:i.content,...e})}).catch(()=>{n.signal.aborted||a({error:!0})}),()=>n.abort()},[l,c,t,o.depth]),r.jsxs("div",{className:"remote-note-embed",children:[r.jsxs("button",{type:"button",onClick:()=>o.onOpenFile(i.path??l,i.cwd??c),children:[e||o.path,t?`#${t}`:""," ↗"]}),i.error?r.jsx("p",{children:s.unavailable}):void 0!==i.text?r.jsx(kT,{client:o.client,path:$n(i.path??l,i.cwd??c),cwd:o.cwd,resolveFile:o.resolveFile,text:i.text,readOnly:!0,depth:o.depth+1,onOpenFile:o.onOpenFile}):o.depth<3&&r.jsx("p",{children:s.loading})]})}function kT(t){const{path:i,cwd:a,depth:s=0}=t,l=n.useRef(t);l.current=t;const c=n.useCallback(n=>function(t){const n=Hn(t.path,t.cwd);return[R(kt.node,()=>function(t){return(n,r,o)=>{const i=document.createElement("div");i.className="lifeos-block-nodeview",i.contentEditable="false",i.dataset.lifeosBlockNodeview="true",i.dataset.lifeosHydrationStatus="pending",i.dataset.lifeosExportStatus="loading",i.setAttribute("aria-busy","true"),i.style.minHeight="72px";const a=e=>{(e=>e instanceof HTMLElement&&!(e=>e instanceof HTMLElement&&Boolean(e.closest('[data-mobile-text-entry="true"]')))(e)&&Boolean(e.closest(["button",'input[type="checkbox"]','input[type="radio"]',"label","select",'[role="button"]','[role="dialog"]',".advanced-table-toolbar-action",".advanced-table-page-size-option",".advanced-table-pagination-btn",".advanced-table-col-modal",".advanced-table-col-item",".advanced-table-filter-dropdown","[data-lifeos-action-rail]","[data-lifeos-action-button]"].join(", "))))(e.target)&&((()=>{const e=document.activeElement;e instanceof HTMLElement&&e!==document.body&&(e.isContentEditable||e.closest('[contenteditable="true"]'))&&e.blur()})(),e.stopPropagation())},s=["pointerdown","pointerup","mousedown","mouseup","click","touchstart","touchend","focusin"];s.forEach(e=>{i.addEventListener(e,a)});let l=null,c=t.render??null,d=null,u=!1,h=null;const p=()=>{if(!c||u)return;l||(l=e.createRoot(i));const a=t.resolveFileName?.(r,i)??function(e,t){try{const n=e.dom.closest(".editor-pane");if(n){const e=n.getAttribute("data-current-file");if(e)return e}const r=t.closest(".editor-pane");if(r){const e=r.getAttribute("data-current-file");if(e)return e}}catch{}}(r,i);l.render(c({content:String(n.attrs.value??""),fileName:a,onContentChange:e=>{const t=o();if("number"!=typeof t)return;const i=r.state.tr.setNodeMarkup(t,void 0,{...n.attrs,value:e});r.dispatch(i)}})),i.dataset.lifeosHydrationStatus="rendered",delete i.dataset.lifeosExportStatus,i.removeAttribute("aria-busy")},m=()=>h||(d?.disconnect(),d=null,i.dataset.lifeosHydrationStatus="loading",h=(c?Promise.resolve(c):t.loadRenderer?t.loadRenderer():Promise.reject(new Error("A LifeOSBlock renderer or loader is required."))).then(e=>{u||(c=e,p())}).catch(()=>{u||(i.dataset.lifeosHydrationStatus="error",i.dataset.lifeosExportStatus="error",i.removeAttribute("aria-busy"))}),h),f=()=>{m()};return i.addEventListener("pointerdown",f,{once:!0,capture:!0}),(t.shouldActivateImmediately?.(r,i)??Boolean(r.dom.closest?.('[data-lifeos-block-hydration="eager"]')))||c||"undefined"==typeof IntersectionObserver?m():(d=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&m()},{rootMargin:t.intersectionRootMargin??"200px 0px"}),d.observe(i)),{dom:i,update:e=>e.type===n.type&&(n=e,c&&p(),!0),destroy:()=>{u=!0,d?.disconnect(),d=null,i.removeEventListener("pointerdown",f,!0),s.forEach(e=>{i.removeEventListener(e,a)}),l?.unmount(),l=null},stopEvent:()=>!0,ignoreMutation:()=>!0}}}({resolveFileName:()=>t.path,render:e=>r.jsx(St,{content:e.content??"",fileName:t.path,context:{...t,resolveFile:t.resolveFile??(async(e,n)=>jn(e,n,t.cwd))},read:async e=>{const n=Vn();if(!n)return null;const r=await fetch(Fn(e,t.cwd),{headers:{authorization:`Bearer ${n.pairToken}`}});return r.ok?{content:await r.text()}:null}})})),R(Ct.node,()=>e=>{const t=document.createElement("details");t.className="remote-frontmatter",t.contentEditable="false";const n=document.createElement("summary");n.textContent=qn().properties;const r=document.createElement("pre");return r.textContent=e.attrs.value,t.append(n,r),{dom:t,update:t=>t.type===e.type&&(r.textContent=t.attrs.value,!0)}}),R(_t.node,()=>function(t){return(n,r,o,i=[])=>{const a=document.createElement("div");a.className="wiki-embedding-nodeview",a.dataset.wikiembeddingNodeview="true";const s=document.createElement("div");s.className="wiki-embedding-nodeview-preview",s.contentEditable="false";const l=document.createElement("span");l.className="inline-source-source wiki-embedding-nodeview-source",l.spellcheck=!1,a.append(s,l);let c=null,d=null,u=!1,h=!1;const p=()=>({target:String(n.attrs.target??""),hash:String(n.attrs.hash??""),size:String(n.attrs.alias??"")}),m=()=>{h||(s.style.minHeight="",a.dataset.wikiembeddingRenderStatus="rendered")},f=()=>{if(h)return;const{target:i,hash:a,size:l}=p();c||(c=e.createRoot(s)),c.render(t.render({target:i,hash:a,size:l,onResourceSettled:m,onResize:e=>{const t=Math.round(e);if(!Number.isFinite(t)||t<=0)return;const i=o();if("number"!=typeof i)return;const a=r.state.doc.nodeAt(i);if(!a||a.type!==n.type)return;const s=String(t),l=sr(a,s);if(a.attrs.alias===s&&a.textContent===l)return;const c=a.type.create({...a.attrs,alias:s},r.state.schema.text(l),a.marks);r.dispatch(r.state.tr.replaceWith(i,i+a.nodeSize,c))}}))},g=()=>{u||h||(u=!0,d?.(),d=null,a.dataset.wikiembeddingRenderStatus="loading",f())},v=e=>{const t=function(e){return e.textContent?e.textContent:sr(e)}(n);a.dataset.inlineSourceKind="wikiembedding",a.dataset.inlineSourceRaw=t,a.dataset.wikiembeddingTarget=String(n.attrs.target??""),a.dataset.wikiembeddingHash=String(n.attrs.hash??""),a.dataset.wikiembeddingAlias=String(n.attrs.alias??""),a.dataset.inlineSourceActive=e?"true":"false",a.classList.toggle("inline-source-node-active",e);const r=e?"true":"false";a.contentEditable!==r&&(a.contentEditable=r),s.style.display="",l.style.display=e?"":"none"};return v(lr(i)),(()=>{if(u||h)return;const e=p();if(!t.shouldDeferRender?.(e)||"undefined"==typeof IntersectionObserver)return void g();const n=t.getDeferredMinHeight?.(e)??t.deferredMinHeight??"240px";a.dataset.wikiembeddingRenderStatus="pending",s.style.minHeight=n,s.style.contentVisibility="auto",s.style.containIntrinsicBlockSize=`auto ${n}`,d=function(e){const t=function(e,t){const n=function(e){if(!e)return tr;const t=er.get(e);if(t)return t;const n=new Map;return er.set(e,n),n}(e),r=n.get(t);if(r)return r;let o;const i=new IntersectionObserver(e=>{e.forEach(e=>{if(!e.isIntersecting)return;const t=ar(o,e.target);t&&function(e){nr.push(e),ir()}(t)})},{root:e,rootMargin:t});return o={callbacks:new Map,observer:i,owner:n,rootMargin:t},n.set(t,o),o}(e.root,e.rootMargin);return t.callbacks.set(e.target,e.onIntersect),t.observer.observe(e.target),()=>{ar(t,e.target)}}({target:a,root:t.resolveIntersectionRoot?.(r,a)??null,rootMargin:t.intersectionRootMargin??"600px 0px",onIntersect:g})})(),{dom:a,contentDOM:l,update:(e,r=[])=>e.type===n.type&&(n=e,v(lr(r)),u?f():t.shouldDeferRender?.(p())||g(),!0),destroy:()=>{h=!0,d?.(),d=null,c?.unmount(),c=null},stopEvent:e=>!l.contains(e.target),ignoreMutation:e=>!l.contains(e.target)}}}({render:({target:e,hash:o,size:i})=>At(e)?r.jsx("div",{style:{maxWidth:/^\d+$/.test(i??"")?`${i}px`:void 0},children:r.jsx(Zn,{gallery:t.gallery,src:e,cwd:jn(e,t.path,t.cwd).cwd,onOpen:t.onOpenFile})}):/\.[^/.]+$/.test(e)&&!/\.(md|markdown)$/i.test(e)?r.jsxs("button",{type:"button",onClick:()=>t.onOpenFile(e,n),children:[e," ↗"]}):r.jsx(xT,{target:e,hash:o,host:t})})),R(re.node,()=>o=>{const i=document.createElement("span");i.contentEditable="false";const a=e.createRoot(i),s=()=>a.render(r.jsx(Zn,{gallery:t.gallery,src:o.attrs.src,alt:o.attrs.alt,cwd:n,onOpen:t.onOpenFile}));return s(),{dom:i,update:e=>e.type===o.type&&(o=e,s(),!0),destroy(){queueMicrotask(()=>a.unmount())}}})]}({client:t.client,path:i,cwd:a,depth:s,resolveFile:t.resolveFile,gallery:()=>{const e=[];return n.editor.action(t=>t.get(T).state.doc.descendants(t=>{"image"===t.type.name&&e.push({src:t.attrs.src,alt:t.attrs.alt,cwd:Hn(i,a)}),"wikiembedding"===t.type.name&&At(t.attrs.target)&&e.push({src:t.attrs.target,cwd:jn(t.attrs.target,i,a).cwd})})),e},onOpenFile:(e,t)=>l.current.onOpenFile(e,t)}),[i,a,s,t.client,t.resolveFile]);return r.jsx(wT,{path:i,text:t.text,readOnly:t.readOnly,onChange:t.onChange,createNodeViews:c,errorText:qn().editorError,onReady:e=>{const t=0===s?Gn(i,a):"";t&&requestAnimationFrame(()=>Wn(e,t))},onClick:(e,t)=>{const n=e.target instanceof Element?e.target:null,r=n?.closest("a");if(!r)return;const s=r.getAttribute("data-wikilink-target"),c=r.getAttribute("href");if(e.preventDefault(),e.stopPropagation(),null!==s){const e=r.getAttribute("data-wikilink-hash")??"";!s&&t?Wn(t,e):(l.current.resolveFile?.(s,i)??Promise.resolve(jn(s,i,a))).then(n=>{t&&$n(n.path,n.cwd)===$n(i,a)?Wn(t,e):(Un(n.path,n.cwd,e),l.current.onOpenFile(n.path,n.cwd))})}else if(c&&/^https?:\/\//i.test(c)){const e=o().openExternal;e?e(c):window.open(c,"_blank","noopener,noreferrer")}else c&&!/^(?:[a-z][\w+.-]*:|\/\/)/i.test(c)&&(c.startsWith("#")&&t?Wn(t,c):l.current.onOpenFile(c.split("#")[0]||i,Hn(i,a)))}})}bT.Feature=C_;export{kT as ObsidianFileEditor};
|