@kinetis/vector-ui 0.11.2 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/static/200.html +1 -1
- package/dist/static/404.html +1 -1
- package/dist/static/_nuxt/{BMH6XD5t.js → 1aNtrH5X.js} +1 -1
- package/dist/static/_nuxt/{DeE2hFUW.js → 2c1vZ90H.js} +1 -1
- package/dist/static/_nuxt/{CRmKHw86.js → 2oUN-NEf.js} +1 -1
- package/dist/static/_nuxt/{DS06smGS.js → 42EY5Fp0.js} +1 -1
- package/dist/static/_nuxt/51OWHj8c.js +2 -0
- package/dist/static/_nuxt/{NhIo1iEQ.js → 5WvxG0mj.js} +1 -1
- package/dist/static/_nuxt/{CHjg6j9X.js → 9MD1hlLT.js} +1 -1
- package/dist/static/_nuxt/{DTV9sLEj.js → 9mpX2szp.js} +1 -1
- package/dist/static/_nuxt/{C9s0nkkI.js → B0GD7QJy.js} +1 -1
- package/dist/static/_nuxt/{D_abDeln.js → B1-Pqo_7.js} +1 -1
- package/dist/static/_nuxt/{CPlriU47.js → B1NXg37X.js} +1 -1
- package/dist/static/_nuxt/{B6kFBEhx.js → B4joN-Do.js} +1 -1
- package/dist/static/_nuxt/{DMEspESN.js → B9psIVnP.js} +1 -1
- package/dist/static/_nuxt/{BiSoCgYL.js → BBBFJ6ov.js} +1 -1
- package/dist/static/_nuxt/{DA90LVQc.js → BFZ46Edz.js} +1 -1
- package/dist/static/_nuxt/{DlvvDtkE.js → BFcl4Vn9.js} +1 -1
- package/dist/static/_nuxt/{DIQMtM1r.js → BH3E4sUK.js} +1 -1
- package/dist/static/_nuxt/BHPSB5VN.js +1 -0
- package/dist/static/_nuxt/{BsuNB234.js → BHcm7bNA.js} +1 -1
- package/dist/static/_nuxt/{DnB5yhNN.js → BIv9Nyve.js} +1 -1
- package/dist/static/_nuxt/BKpxsGPP.js +1 -0
- package/dist/static/_nuxt/{tVajdWsj.js → BKxQp7go.js} +3 -3
- package/dist/static/_nuxt/{DrTddWZC.js → BOc3bd5G.js} +1 -1
- package/dist/static/_nuxt/{BvQdC4Rk.js → BQKTPMnh.js} +1 -1
- package/dist/static/_nuxt/{BExVV8sb.js → BQnpCLjt.js} +1 -1
- package/dist/static/_nuxt/{CNktovgL.js → BSfpIrlx.js} +1 -1
- package/dist/static/_nuxt/{D-oBCPmo.js → BTI9wOw3.js} +1 -1
- package/dist/static/_nuxt/BVRr96yG.js +1 -0
- package/dist/static/_nuxt/{O2KY3yNo.js → BVjSh6vC.js} +1 -1
- package/dist/static/_nuxt/{XNHkNf2i.js → BWrwqNAK.js} +1 -1
- package/dist/static/_nuxt/BZweJiQx.js +1 -0
- package/dist/static/_nuxt/{CLwRxnOz.js → B_DG2saj.js} +1 -1
- package/dist/static/_nuxt/{CrvzmL4h.js → B_RjakRk.js} +1 -1
- package/dist/static/_nuxt/{DmydL5Ff.js → B_fQu_h2.js} +1 -1
- package/dist/static/_nuxt/{BMxCKVli.js → BfsupGyC.js} +1 -1
- package/dist/static/_nuxt/{DhZZH7ze.js → BgRi2kFj.js} +1 -1
- package/dist/static/_nuxt/{pevRwwGL.js → BiIirvgR.js} +2 -2
- package/dist/static/_nuxt/{idqqeYTH.js → BkHt6U4C.js} +1 -1
- package/dist/static/_nuxt/{DwS6ZbkU.js → Bm_wsdTH.js} +1 -1
- package/dist/static/_nuxt/{Bp5tF5r6.js → BnlaqUIK.js} +1 -1
- package/dist/static/_nuxt/BpaVnQT3.js +1 -0
- package/dist/static/_nuxt/{BRJdRL8w.js → Bs6-HCEW.js} +1 -1
- package/dist/static/_nuxt/{C0ki9wQv.js → BtRqSK7K.js} +1 -1
- package/dist/static/_nuxt/{BESQ-0Gs.js → Bt_KgVrY.js} +1 -1
- package/dist/static/_nuxt/BwHwQnM0.js +1 -0
- package/dist/static/_nuxt/{DAFT7J9G.js → BzKz2oL1.js} +1 -1
- package/dist/static/_nuxt/{BFtPCOZD.js → C-MpSlvO.js} +1 -1
- package/dist/static/_nuxt/{C5YhaRPN.js → C32HLL_3.js} +1 -1
- package/dist/static/_nuxt/C3XkRFds.js +1 -0
- package/dist/static/_nuxt/{Bokf_2lV.js → C4rsQhBq.js} +1 -1
- package/dist/static/_nuxt/{B3xq4tG7.js → C5Ez1FXH.js} +1 -1
- package/dist/static/_nuxt/C6FXj6mJ.js +1 -0
- package/dist/static/_nuxt/{C1_SI7KJ.js → CADHRY6v.js} +1 -1
- package/dist/static/_nuxt/{DjH3KClu.js → CCr9dqOM.js} +1 -1
- package/dist/static/_nuxt/CEMM7MyS.js +100 -0
- package/dist/static/_nuxt/{Byau8pUT.js → CHpNSaGi.js} +1 -1
- package/dist/static/_nuxt/CHyInEhw.js +1 -0
- package/dist/static/_nuxt/CIQLz04l.js +1 -0
- package/dist/static/_nuxt/{CTjx55ns.js → CJCvPySI.js} +1 -1
- package/dist/static/_nuxt/{Cqn_GvXb.js → COHV16dX.js} +1 -1
- package/dist/static/_nuxt/{D1QDGpmd.js → CPAF2hi7.js} +2 -2
- package/dist/static/_nuxt/{CmQ01dNA.js → CQQ-wIWC.js} +1 -1
- package/dist/static/_nuxt/CQnAjs6t.js +1 -0
- package/dist/static/_nuxt/{BqCs26gd.js → CRQyQuGt.js} +1 -1
- package/dist/static/_nuxt/{BQJFH4zD.js → CSzw4ySZ.js} +1 -1
- package/dist/static/_nuxt/{cUv4pc51.js → CTHeqfU5.js} +1 -1
- package/dist/static/_nuxt/{DpgU2PHs.js → CXIZ5vIr.js} +1 -1
- package/dist/static/_nuxt/{CxIMB56s.js → CXxZ_oTv.js} +1 -1
- package/dist/static/_nuxt/{R-E-AGli.js → C_2GgX80.js} +1 -1
- package/dist/static/_nuxt/{jFfaJB_N.js → C_Ouo24Z.js} +1 -1
- package/dist/static/_nuxt/{Cy0OG4l8.js → C_zyLiGr.js} +1 -1
- package/dist/static/_nuxt/{PZu-Wsjm.js → Cc0_Jvm0.js} +1 -1
- package/dist/static/_nuxt/{DmDYfbOW.js → CdjG3WTk.js} +1 -1
- package/dist/static/_nuxt/{DNU7W_nS.js → ChHm6L68.js} +1 -1
- package/dist/static/_nuxt/{B9haHkUY.js → Ci1-hOA9.js} +1 -1
- package/dist/static/_nuxt/{DDiJSP0v.js → CmQyigb3.js} +1 -1
- package/dist/static/_nuxt/{XUnzKVDP.js → CsTzOWPJ.js} +1 -1
- package/dist/static/_nuxt/{DwZHvFrZ.js → CtrzPVjw.js} +1 -1
- package/dist/static/_nuxt/{DjFitDi7.js → Cuw0Qa9p.js} +1 -1
- package/dist/static/_nuxt/{CrKjUxoH.js → CxFDmUjN.js} +4 -4
- package/dist/static/_nuxt/{DCXlqH9t.js → Cya8cjkR.js} +2 -2
- package/dist/static/_nuxt/{Cnk6TpKh.js → D-rB2fWZ.js} +1 -1
- package/dist/static/_nuxt/{BQj8iTaT.js → D7DEE4gN.js} +1 -1
- package/dist/static/_nuxt/D8kTmNUH.js +1 -0
- package/dist/static/_nuxt/{CYenBSuZ.js → D9BNw4XE.js} +1 -1
- package/dist/static/_nuxt/{Cn3Lx2PZ.js → DBgKGXIj.js} +1 -1
- package/dist/static/_nuxt/{BzyqpjTr.js → DFQG9ZD0.js} +1 -1
- package/dist/static/_nuxt/{B8kpdvvf.js → DFsV0Sjv.js} +1 -1
- package/dist/static/_nuxt/{DPkCdlhJ.js → DGOB4cMy.js} +1 -1
- package/dist/static/_nuxt/DI2U4Yky.js +1 -0
- package/dist/static/_nuxt/{B8eHDL1x.js → DLzA6Iec.js} +1 -1
- package/dist/static/_nuxt/{DunIFW85.js → DQ1z3A04.js} +1 -1
- package/dist/static/_nuxt/{CqS2QE9K.js → DR4qylKa.js} +1 -1
- package/dist/static/_nuxt/DS8Zc0uz.js +1 -0
- package/dist/static/_nuxt/{CNtSjZb9.js → DVIiT5EL.js} +1 -1
- package/dist/static/_nuxt/{X769DZgg.js → DVRz0uUW.js} +1 -1
- package/dist/static/_nuxt/DZo3dYLJ.js +3 -0
- package/dist/static/_nuxt/DZwwQ4WY.js +1 -0
- package/dist/static/_nuxt/DcteQ4TC.js +1 -0
- package/dist/static/_nuxt/DdqPXmq8.js +1 -0
- package/dist/static/_nuxt/{XP_NhcAc.js → Dg_tXu9P.js} +1 -1
- package/dist/static/_nuxt/{FiVpZbG7.js → DhECW-Pr.js} +1 -1
- package/dist/static/_nuxt/{lU2WvORK.js → DjL4J8kw.js} +2 -2
- package/dist/static/_nuxt/{CLuA010K.js → DkQpAs16.js} +1 -1
- package/dist/static/_nuxt/DmrPXKlp.js +1 -0
- package/dist/static/_nuxt/{BZGd3Us3.js → Dnv1kjao.js} +1 -1
- package/dist/static/_nuxt/{BG8sqKld.js → Dorn4eG1.js} +1 -1
- package/dist/static/_nuxt/{B4CNYLGX.js → DvnG2kZK.js} +1 -1
- package/dist/static/_nuxt/{Cdn0sqgm.js → DzOxWOFX.js} +1 -1
- package/dist/static/_nuxt/{BcKdSO1s.js → E-mWtnN5.js} +1 -1
- package/dist/static/_nuxt/{Dcf0mLpX.js → F676SWHd.js} +1 -1
- package/dist/static/_nuxt/{CS2rsiMP.js → Ge5l3uM8.js} +1 -1
- package/dist/static/_nuxt/{jDoGFcUw.js → JjWUotQr.js} +1 -1
- package/dist/static/_nuxt/{DLiDtIjt.js → K6puNuXp.js} +2 -2
- package/dist/static/_nuxt/{B_BN_HbD.js → Lj7y5-JX.js} +1 -1
- package/dist/static/_nuxt/{C3gWfuE3.js → MAzsrRZz.js} +1 -1
- package/dist/static/_nuxt/{BW9HID9H.js → MEvklnEE.js} +1 -1
- package/dist/static/_nuxt/{CBuI8G-0.js → OMRlJR6k.js} +1 -1
- package/dist/static/_nuxt/ORpfF6Nb.js +1 -0
- package/dist/static/_nuxt/{v3MehyQK.js → R0rf_l_C.js} +1 -1
- package/dist/static/_nuxt/{DaV1Nwi1.js → RChVezE9.js} +1 -1
- package/dist/static/_nuxt/{rPED9XOq.js → UfoGua8K.js} +1 -1
- package/dist/static/_nuxt/{D8BLAufX.js → bmIlMXFn.js} +1 -1
- package/dist/static/_nuxt/builds/latest.json +1 -1
- package/dist/static/_nuxt/builds/meta/ba4cc360-829e-4272-bb1c-7391e700bb32.json +1 -0
- package/dist/static/_nuxt/{3JezEUxl.js → cDe9iywT.js} +1 -1
- package/dist/static/_nuxt/error-404.B1_4-op0.css +1 -0
- package/dist/static/_nuxt/error-500.ueligmdw.css +1 -0
- package/dist/static/_nuxt/{GcJARbV4.js → go_nGSOr.js} +1 -1
- package/dist/static/_nuxt/{CMALc53B.js → iEEDTq6e.js} +1 -1
- package/dist/static/_nuxt/{B30gqjcn.js → mtQhqX_4.js} +1 -1
- package/dist/static/_nuxt/{CElnT3Ea.js → qpVO-NAo.js} +1 -1
- package/dist/static/_nuxt/{CGkUvIUb.js → rSRjHK_a.js} +1 -1
- package/dist/static/_nuxt/{BD3vrpfE.js → rSy2G_Qb.js} +1 -1
- package/dist/static/_nuxt/{DcCk6iJg.js → xkua0wtW.js} +1 -1
- package/dist/static/index.html +1 -1
- package/dist/static/jobs/index.html +1 -1
- package/dist/static/login/index.html +1 -1
- package/dist/static/settings/index.html +1 -1
- package/dist/static/vector-bundle.json +143 -143
- package/package.json +4 -4
- package/dist/static/_nuxt/5zee4flr.js +0 -1
- package/dist/static/_nuxt/BC1JF9Zk.js +0 -1
- package/dist/static/_nuxt/BDjB0t0q.js +0 -1
- package/dist/static/_nuxt/BMa85Lo_.js +0 -1
- package/dist/static/_nuxt/BUXLfoCg.js +0 -1
- package/dist/static/_nuxt/BUnmJXi2.js +0 -1
- package/dist/static/_nuxt/BUxh8xLU.js +0 -1
- package/dist/static/_nuxt/BscDSMUQ.js +0 -1
- package/dist/static/_nuxt/Bz10rfP9.js +0 -1
- package/dist/static/_nuxt/C4SdFsgS.js +0 -1
- package/dist/static/_nuxt/C8910TI5.js +0 -1
- package/dist/static/_nuxt/CRC87riD.js +0 -1
- package/dist/static/_nuxt/CdkTzVlv.js +0 -1
- package/dist/static/_nuxt/Cx1ACnK3.js +0 -2
- package/dist/static/_nuxt/DUh5YbE0.js +0 -1
- package/dist/static/_nuxt/DVRkMeDb.js +0 -3
- package/dist/static/_nuxt/DaaIbCq6.js +0 -1
- package/dist/static/_nuxt/DpMtZe_u.js +0 -1
- package/dist/static/_nuxt/Neo3srpw.js +0 -1
- package/dist/static/_nuxt/builds/meta/39204f67-0d39-471b-8b04-27ba53111b8c.json +0 -1
- package/dist/static/_nuxt/error-404.BWA13HPT.css +0 -1
- package/dist/static/_nuxt/error-500.DWMOKWSC.css +0 -1
- package/dist/static/_nuxt/heMUOJ3z.js +0 -1
- package/dist/static/_nuxt/joVv9dY7.js +0 -1
- package/dist/static/_nuxt/uFRd1kpu.js +0 -100
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Yt as e}from"./
|
|
1
|
+
import{Yt as e}from"./CPAF2hi7.js";import{$ as t,B as n,C as r,Ct as i,D as a,Dt as o,E as s,Et as c,G as l,H as u,I as d,J as f,K as p,L as m,M as h,N as g,Ot as _,P as v,Q as y,R as b,S as x,St as S,T as C,Tt as ee,U as te,V as ne,W as w,X as T,Y as re,Z as ie,_t as ae,at as oe,b as se,bt as E,ct as ce,dt as le,et as ue,ft as de,gt as fe,ht as pe,it as me,k as D,lt as he,mt as ge,ot as _e,pt as ve,rt as O,tt as ye,ut as be,v as xe,vt as k,wt as A,x as j,xt as M,y as Se,yt as N,z as Ce}from"#entry";var we=new WeakSet,Te=new WeakSet;function Ee(e){let t=e;return we.add(t),t}function De(e){return Array.isArray(e)&&we.has(e)}function Oe(e){return e.flatMap(e=>e==null?[]:Array.isArray(e)&&Te.has(e)&&!De(e)?Oe(e):[e])}function ke(e,t){if(e===`slot`)return 0;if(e instanceof Function){let n=e(t);return Array.isArray(n)&&!De(n)&&!Te.has(n)?Ee(n):n}let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);if(Array.isArray(n)){if(De(n))return Ee([e,r,n]);if(n.length===0)return Ee([e,r]);let t=Oe(n);return t.length===0?Ee([e,r]):Ee([e,r,...t])}return Ee(n==null?[e,r]:[e,r,n])}var Ae=(e,t)=>ke(e,t),je=(e,t)=>{let{state:n}=e,{selection:r}=n;if(!r.empty)return!1;let{$from:i}=r;if(i.parentOffset!==0)return!1;let a=i.depth-1;if(a<0)return!1;let o=i.node(a),s=i.index(a);if(s===0)return!1;if(o.type===t)return e.commands.lift(t.name);let c=o.child(s-1);if(c.type!==t||!c.lastChild?.isTextblock)return!1;let l=i.before()-1-1;return e.commands.command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=i.parent.content,r=new _(n,0,0);return e.replace(l,i.after(),r),e.setSelection(S.create(e.doc,l+n.size)),e.scrollIntoView(),t(e),!0})},Me=/^\s*>\s$/,Ne=j.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return Ae(`blockquote`,{...O(this.options.HTMLAttributes,e),children:Ae(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
|
|
2
2
|
`).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
|
|
3
3
|
`))}),n.join(`
|
|
4
4
|
>
|
|
@@ -37,7 +37,7 @@ import{Yt as e}from"./D1QDGpmd.js";import{$ as t,B as n,C as r,Ct as i,D as a,Dt
|
|
|
37
37
|
`),n=t===-1?e:e.slice(0,t);if(!oi.test(n))return[[],0,[]];let r=vi,i=yi(e,r),a=pi(i);for(;a[1]===i.length&&i.length===r;)r*=2,i=yi(e,r),a=pi(i);return[a[0],a[1],i]}var xi=`listItem`,Si=`textStyle`,Ci=/^(\d+)\.\s$/;function wi(e){let t=e.match(/list-style-type\s*:\s*([^;]+)/i);if(!t)return null;switch(t[1].trim().toLowerCase()){case`upper-roman`:return`I`;case`lower-roman`:return`i`;case`upper-alpha`:case`upper-latin`:return`A`;case`lower-alpha`:case`lower-latin`:return`a`;default:return null}}var Ti=j.create({name:`orderedList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute(`start`)?parseInt(e.getAttribute(`start`)||``,10):1},type:{default:null,parseHTML:e=>{let t=e.getAttribute(`type`);if(t)return t;let n=e.getAttribute(`style`);if(n){let e=wi(n);if(e)return e}let r=e.querySelector(`li`);if(r){let e=r.getAttribute(`style`);if(e){let t=wi(e);if(t)return t}}return null}}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,type:n,...r}=e,i=O(this.options.HTMLAttributes,r);return t!==1&&(i.start=t),n&&n!==`1`&&(i.type=n),[`ol`,i,0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.typeMarker,i=e.items?_i(e.items,t):[],a={};return n!==1&&(a.start=n),r&&(a.type=r),Object.keys(a).length>0?{type:`orderedList`,attrs:a,content:i}:{type:`orderedList`,content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
38
38
|
`):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:()=>-1,tokenize:(e,t,n)=>{let[r,i,a]=bi(e);if(r.length===0)return;let o=gi(r,r[0].indent,n);if(o.length!==0)return{type:`list`,ordered:!0,start:r[0]?.number||1,typeMarker:r[0]?.type,items:o,raw:a.slice(0,i).join(`
|
|
39
39
|
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(xi,this.editor.getAttributes(Si)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new k({props:{handlePaste:(e,t)=>{if((t.clipboardData?.getData(`text/html`))?.trim())return!1;let n=t.clipboardData?.getData(`text/plain`);if(!n)return!1;let r=hi(n);if(!r)return!1;try{let t=e.state.schema.nodeFromJSON(r),n=e.state.tr.replaceSelectionWith(t);return e.dispatch(n),!0}catch{return!1}}}})]},addInputRules(){let e=(e,t)=>(!t.attrs.type||t.attrs.type===`1`)&&t.childCount+t.attrs.start===+e[1],t=he({find:Ci,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=he({find:Ci,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Si)}),joinPredicate:e,editor:this.editor})),[t]}}),Ei=/^\s*(\[([( |x])?\])\s$/,Di=`position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0`,Oi=(e,t,n)=>{var r;return(n==null||(r=n.checkboxLabel)==null?void 0:r.call(n,e,t))||`Task item checkbox for ${e.textContent||`empty task item`}`},ki=j.create({name:`taskItem`,addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:`taskList`,a11y:void 0}},content(){return this.options.nested?`paragraph block*`:`paragraph+`},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute(`data-checked`);return t===``||t===`true`},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:e=>e.querySelector(`div`)??e}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,O(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode(`paragraph`,{},t.parseInline(e.tokens))):e.text?n.push(t.createNode(`paragraph`,{},[t.createNode(`text`,{text:e.text})])):n.push(t.createNode(`paragraph`,{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{let n=`- [${e.attrs?.checked?`x`:` `}] `;return _e(e,t,n)},addExtensions(){return this.options.nested?[jr(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`);o.style.cssText=Di;let l=e=>{let t=Oi(e,e.attrs.checked,this.options.a11y);s.setAttribute(`aria-label`,t),o.textContent=t};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=p(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[he({find:Ei,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),Ai=j.create({name:`taskList`,addOptions(){return{itemTypeName:`taskItem`,HTMLAttributes:{}}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return[`ul`,O(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode(`taskList`,{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
40
|
-
`):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=oe(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(t){let r={type:`taskList`,raw:t.raw,items:t.items},i=e.slice(t.raw.length);return i.trim()?[r,...n.blockTokens(i)]:[r]}return n.blockTokens(e)},i=oe(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});xe.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(Dr.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(Xr.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(ai.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(Ti.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(ki.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(Ai.configure(this.options.taskList)),e}});var ji=` `,Mi=`\xA0`,Ni=j.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,O(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===ji||n[0].text===ji||n[0].raw===Mi||n[0].text===Mi)&&r.length===1&&r[0].type===`text`&&(r[0].text===ji||r[0].text===Mi)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){var i,a;let e=Array.isArray(n==null||(i=n.previousNode)==null?void 0:i.content)?n.previousNode.content:[];return(n==null||(a=n.previousNode)==null?void 0:a.type)===`paragraph`&&e.length===0?ji:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Pi=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Fi=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Ii=se.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,O(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ue({find:Pi,type:this.type})]},addPasteRules(){return[ye({find:Fi,type:this.type})]}}),Li=j.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),Ri=se.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,O(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function zi(e={}){return new k({view(t){return new Bi(t,e)}})}var Bi=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.setCursor(null),this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc){if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(!t||i)return null;let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=ee(this.editorView.state.doc,a,this.editorView.dragging.slice);e!=null&&(a=e)}return a}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},Vi=class e extends E{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):E.near(r)}content(){return _.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new Hi(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!Wi(e)||!Gi(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!ae.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};Vi.prototype.visible=!1,Vi.findFrom=Vi.findGapCursorFrom,E.jsonID(`gapcursor`,Vi);var Hi=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Vi.valid(t)?new Vi(t):E.near(t)}};function Ui(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function Wi(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0}else for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||Ui(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Gi(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0}else for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||Ui(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Ki(){return new k({props:{decorations:Zi,createSelectionBetween(e,t,n){return t.pos==n.pos&&Vi.valid(n)?new Vi(n):null},handleClick:Yi,handleKeyDown:qi,handleDOMEvents:{beforeinput:Xi}}})}var qi=ge({ArrowLeft:Ji(`horiz`,-1),ArrowRight:Ji(`horiz`,1),ArrowUp:Ji(`vert`,-1),ArrowDown:Ji(`vert`,1)});function Ji(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof S){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=Vi.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new Vi(c))),!0):!1}}function Yi(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Vi.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&ae.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Vi(r))),!0)}function Xi(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof Vi))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 i=c.empty;for(let e=r.length-1;e>=0;e--)i=c.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new _(i,0,0));return a.setSelection(S.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function Zi(e){if(!(e.selection instanceof Vi))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,fe.create(e.doc,[pe.widget(e.selection.head,t,{key:`gapcursor`})])}xe.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new k({key:new N(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var Qi=xe.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[zi(this.options)]}});xe.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new k({key:new N(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return fe.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(pe.node(t,t+e.nodeSize,{class:this.options.className}))}),fe.create(e,a)}}})]}});var $i=xe.create({name:`gapCursor`,addProseMirrorPlugins(){return[Ki()]},extendNodeSchema(e){let t={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:C(ne(e,`allowGapCursor`,t))??null}}}),ea=`placeholder`,ta=new N(`tiptap__placeholder`);function na(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:a,isEmptyDoc:o,hasAnchor:s,classes:{emptyNode:c,emptyEditor:l}}=e,u=[c];return o&&u.push(l),pe.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function ra(e,t){return typeof e==`function`?e(t):e}function ia({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:a,to:o}){let{anchor:s}=i,c=[],l=e.isEmpty;return r.nodesBetween(a,o,(r,i)=>{let a=s>=i&&s<=i+r.nodeSize,o=!r.isLeaf&&ie(r);return r.type.isTextblock&&(a||!t.showOnlyCurrent)&&o&&c.push(na({editor:e,isEmptyDoc:l,dataAttribute:n,hasAnchor:a,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:ra(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:a})},node:r,pos:i})),t.includeChildren}),c}function aa({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!e.isEditable&&t.showOnlyWhenEditable)return null;let{anchor:a}=i,o=[],s=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),c=i.depth>0?i.node(1):i.nodeAfter,l=i.depth>0?i.before(1):a;if(c&&c.type.isTextblock&&ie(c)){let r=a>=l&&a<=l+c.nodeSize;o.push(na({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:ra(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else o.push(...ia({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return fe.create(r,o)}function oa(e,t){let n=e.resolve(t);if(n.depth===0){let e=n.nodeAfter??n.nodeBefore;if(!e)return{from:t,to:t};let r=n.nodeAfter?t:t-e.nodeSize;return{from:r,to:r+e.nodeSize}}let r=n.before(1);return{from:r,to:r+n.node(1).nodeSize}}function sa(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function ca(e,t,n){let r=[];return e.forEach((e,i)=>{let a=i,o=a+e.nodeSize,s=a+1,c=o+1;s<n&&c>t&&r.push({from:a,to:o})}),r}function la(e){if(e.length===0)return[];let t=[...e].sort((e,t)=>e.from-t.from),n=[{...t[0]}];for(let e=1;e<t.length;e+=1){let r=n[n.length-1],i=t[e];i.from<=r.to?r.to=Math.max(r.to,i.to):n.push({...i})}return n}function ua(e,t){let n=ca(e,t.from,t.to);return n.push(sa(e,oa(e,t.from))),t.to>t.from?n.push(sa(e,oa(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(sa(e,oa(e,Math.min(t.from+1,e.content.size)))),n}function da(e,t,r){let i=[];if(e.docChanged){let t=n(e);for(let e of t)i.push(...ua(r.doc,e.newRange))}return e.selectionSet&&(i.push(sa(r.doc,oa(r.doc,e.mapping.map(t.selection.anchor)))),i.push(sa(r.doc,oa(r.doc,r.selection.anchor)))),la(i)}function fa(e,t,n){let r=Math.max(0,Math.min(e,n.content.size));return{from:r,to:Math.max(r,Math.min(t,n.content.size))}}function pa({decorations:e,ranges:t,editor:n,options:r,dataAttribute:i,doc:a,selection:o}){let s=e;for(let e of t){let{from:t,to:c}=fa(e.from,e.to,a),l=s.find(t,c).filter(e=>e.from>=t&&e.to<=c);l.length&&(s=s.remove(l));let u=ia({editor:n,options:r,dataAttribute:i,doc:a,selection:o,from:t,to:c});u.length&&(s=s.add(a,u))}return s}function ma({editor:e,options:t,dataAttribute:n}){return{init(r,i){return aa({editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection})??fe.empty},apply(r,i,a,o){return!r.docChanged&&!r.selectionSet?i:pa({decorations:i.map(r.mapping,r.doc),ranges:da(r,a,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function ha(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function ga({editor:e,options:t}){let n=t.dataAttribute?`data-${ha(t.dataAttribute)}`:`data-${ea}`,r=t.showOnlyCurrent&&!t.includeChildren;return new k({key:ta,...r?{}:{state:ma({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:r,selection:i})=>aa({editor:e,options:t,dataAttribute:n,doc:r,selection:i}):n=>t.showOnlyWhenEditable&&!e.isEditable?fe.empty:ta.getState(n)??fe.empty}})}var _a=xe.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:ea,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[ga({editor:this.editor,options:this.options})]}});function va(e,t){return!e.selection.empty&&!y(e.selection)&&t.isEditable}function ya(e,t){return va(e,t)&&!t.isFocused&&!t.view.dragging}function ba(){var e;(e=window.getSelection())==null||e.removeAllRanges()}function xa(e){e.focus()}xe.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new k({key:new N(`selection`),props:{decorations(n){return ya(n,e)?fe.create(n.doc,[pe.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(t){return va(t.state,e)&&ba(),!1},focus(t){return va(t.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&t.hasFocus()&&xa(t)}),!1}}}})]}});function Sa({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var Ca=xe.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new N(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new k({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!Sa({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!Sa({node:r,types:n})}}})]}}),wa=xe.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>ve(e,t),redo:()=>({state:e,dispatch:t})=>de(e,t)}},addProseMirrorPlugins(){return[be(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Ta=xe.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(Re.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(Ne.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(Dr.configure(this.options.bulletList)),this.options.code!==!1&&e.push(He.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(Ke.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(qe.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(Qi.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push($i.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(Je.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(Ye.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(wa.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(Xe.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(tt.configure(this.options.italic)),this.options.listItem!==!1&&e.push(Xr.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(ai.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(Cr.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(Ti.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(Ni.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(Ii.configure(this.options.strike)),this.options.text!==!1&&e.push(Li.configure(this.options.text)),this.options.underline!==!1&&e.push(Ri.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(Ca.configure(this.options?.trailingNode)),e}}),Ea,Da;if(typeof WeakMap<`u`){let e=new WeakMap;Ea=t=>e.get(t),Da=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;Ea=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},Da=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var V=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++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw 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 RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return Ea(e)||Da(e,Oa(e))}};function Oa(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=ka(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new V(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&Aa(s,o,e),s}function ka(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function Aa(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=ja(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function ja(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function H(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var Ma=new N(`selectingCells`);function Na(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function Pa(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function Fa(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function Ia(e){let 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&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=Na(t.$head)||La(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function La(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function Ra(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function za(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function Ba(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Va(e,t,n){let r=e.node(-1),i=V.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function Ha(e,t,n=1){let 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 Ua(e,t,n=1){let 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}function Wa(e,t,n){let r=H(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var U=class e extends E{constructor(e,t=e){let n=e.node(-1),r=V.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new M(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(Ra(r)&&Ra(i)&&Ba(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return S.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=V.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=Ha(e,0,l)),u>0&&(e=Ha(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(c.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new _(c.from(o),1,1)}replace(e,t=_.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?_.empty:t)}let i=E.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new _(c.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=V.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let 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){let r=t.node(-1),i=V.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=V.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==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){let r=t.node(-1),i=V.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.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 Ga(this.$anchorCell.pos,this.$headCell.pos)}};U.prototype.visible=!1,E.jsonID(`cell`,U);var Ga=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){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&Ba(t,n)?new U(t,n):E.near(n,1)}};function Ka(e){if(!(e.selection instanceof U))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(pe.node(n,n+e.nodeSize,{class:`selectedCell`}))}),fe.create(e.doc,t)}function qa({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function Ja({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function Ya(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof ae&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=U.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=U.rowSelection(e,e)}else if(!n){let e=V.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=U.create(i,t+1,n)}}else r instanceof S&&qa(r)?a=S.create(i,r.from):r instanceof S&&Ja(r)&&(a=S.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var Xa=new N(`fix-tables`);function Za(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?Za(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function Qa(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=$a(e,t,r,n))};return t?t.doc!=e.doc&&Za(t.doc,e.doc,0,r):e.doc.descendants(r),n}function $a(e,t,n,r){let i=V.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,Ha(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=H(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(Xa,{fixTables:!0})}function eo(e){let t=e.selection,n=Ia(e),r=n.node(-1),i=n.start(-1),a=V.get(r);return{...t instanceof U?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function to(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;Wa(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,Ua(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?H(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function no(e,t){if(!Fa(e))return!1;if(t){let n=eo(e);t(to(e.tr,n,n.left))}return!0}function ro(e,t){if(!Fa(e))return!1;if(t){let n=eo(e);t(to(e.tr,n,n.right))}return!0}function io(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,Ha(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function ao(e,t){if(!Fa(e))return!1;if(t){let n=eo(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;io(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=V.get(e)}t(r)}return!0}function oo(e,t,n){let r=H(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function so(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;oo(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?H(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,H(r.type.schema).row.create(null,o)),e}function co(e,t){if(!Fa(e))return!1;if(t){let n=eo(e);t(so(e.tr,n,n.top))}return!0}function lo(e,t){if(!Fa(e))return!1;if(t){let n=eo(e);t(so(e.tr,n,n.bottom))}return!0}function uo(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function fo(e,t){if(!Fa(e))return!1;if(t){let n=eo(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;uo(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=V.get(n.table)}t(r)}return!0}function po(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function mo({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function ho(e,t){let n=e.selection;if(!(n instanceof U)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=eo(e),{map:i}=r;if(mo(i,r))return!1;if(t){let n=e.tr,a={},o=c.empty,s,l;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let c=i.map[e*i.width+t],u=r.table.nodeAt(c);if(!a[c]&&u){if(a[c]=!0,s==null)s=c,l=u;else{po(u)||(o=o.append(u.content));let e=n.mapping.map(c+r.tableStart);n.delete(e,e+u.nodeSize)}}}if(s==null||l==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...Ua(l.attrs,l.attrs.colspan,r.right-r.left-l.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+l.content.size,t=po(l)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new U(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function go(e,t){let n=H(e.schema);return _o(({node:e})=>n[e.type.spec.tableRole])(e,t)}function _o(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof U){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=Pa(r.$from),!i)return!1;a=Na(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=eo(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)(r!=l.left||t!=l.top)&&u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof U&&u.setSelection(new U(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function vo(e,t){return function(n,r){if(!Fa(n))return!1;let i=Ia(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof U?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function yo(e){return function(t,n){if(!Fa(t))return!1;if(n){let r=H(t.schema),i=eo(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function bo(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function xo(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?yo(e):function(t,n){if(!Fa(t))return!1;if(n){let r=H(t.schema),i=eo(t),a=t.tr,o=bo(`row`,i,r),s=bo(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}xo(`row`,{useDeprecatedLogic:!0}),xo(`column`,{useDeprecatedLogic:!0});var So=xo(`cell`,{useDeprecatedLogic:!0});function Co(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function wo(e){return function(t,n){if(!Fa(t))return!1;let r=Co(Ia(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(S.between(e,za(e))).scrollIntoView())}return!0}}function To(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Eo(e,t){let n=e.selection;if(!(n instanceof U))return!1;if(t){let r=e.tr,i=H(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new _(i,0,0))}),r.docChanged&&t(r)}return!0}function Do(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=ko(H(o).row,new _(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?ko(H(o).row,new _(t,n,r)).content:t);else return null;return Oo(o,s)}function Oo(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(c.empty),n[i]<r){let a=H(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(c.from(o))}return{height:t.length,width:r,rows:t}}function ko(e,t){let n=e.createAndFill();return new A(n).replace(0,n.content.size,t).doc}function Ao({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(Ha(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.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}i.push(c.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(c.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function jo(e,t,n,r,i,a,o){let s=e.doc.type.schema,l=H(s),u,d;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let c=n.child(a);s+=c.nodeSize;let f=[],p;p=c.lastChild==null||c.lastChild.type==l.cell?u||=l.cell.createAndFill():d||=l.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==l.header_cell;s.push(i?d||=l.header_cell.createAndFill():u||=l.cell.createAndFill())}let f=l.row.create(null,c.from(s)),p=[];for(let e=t.height;e<a;e++)p.push(f);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),p)}return!!(u||d)}function Mo(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function No(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,Ha(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(Ha(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function Po(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=V.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=V.get(a),f=d.mapping.maps.length}jo(d,o,a,n,l,u,f)&&p(),Mo(d,o,a,n,c,l,s,f)&&p(),Mo(d,o,a,n,c,l,u,f)&&p(),No(d,o,a,n,s,u,c,f)&&p(),No(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new _(i.rows[e-s],0,0))}p(),d.setSelection(new U(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var Fo=ge({ArrowLeft:Lo(`horiz`,-1),ArrowRight:Lo(`horiz`,1),ArrowUp:Lo(`vert`,-1),ArrowDown:Lo(`vert`,1),"Shift-ArrowLeft":Ro(`horiz`,-1),"Shift-ArrowRight":Ro(`horiz`,1),"Shift-ArrowUp":Ro(`vert`,-1),"Shift-ArrowDown":Ro(`vert`,1),Backspace:Eo,"Mod-Backspace":Eo,Delete:Eo,"Mod-Delete":Eo});function Io(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function Lo(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof U)return Io(n,r,E.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=Ho(i,e,t);if(o==null)return!1;if(e==`horiz`)return Io(n,r,E.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=Va(i,e,t),s;return s=a?E.near(a,1):t<0?E.near(n.doc.resolve(i.before(-1)),-1):E.near(n.doc.resolve(i.after(-1)),1),Io(n,r,s)}}}function Ro(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof U)o=a;else{let r=Ho(i,e,t);if(r==null)return!1;o=new U(n.doc.resolve(r))}let s=Va(o.$headCell,e,t);return s?Io(n,r,new U(o.$anchorCell,s)):!1}}function zo(e,t){let n=e.state.doc,r=Na(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new U(r))),!0):!1}function Bo(e,t,n){if(!Fa(e.state))return!1;let r=Do(n),i=e.state.selection;if(i instanceof U){r||={width:1,height:1,rows:[c.from(ko(H(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=V.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=Ao(r,o.right-o.left,o.bottom-o.top),Po(e.state,e.dispatch,a,o,r),!0}if(r){let t=Ia(e.state),n=t.start(-1);return Po(e.state,e.dispatch,n,V.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function Vo(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=Uo(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof U)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=Na(e.state.selection.$anchor))!=null&&Wo(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=Wo(e,n),i=Ma.getState(e.state)==null;if(!r||!Ba(t,r)){if(i)r=t;else return}let a=new U(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(Ma,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),Ma.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(Ma,-1))}function o(r){let o=r,s=Ma.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(Uo(e,o.target)!=n&&(c=Wo(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function Ho(e,t,n){if(!(e.state.selection instanceof S))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function Uo(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function Wo(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&Na(e.state.doc.resolve(r))||Na(e.state.doc.resolve(i))}var Go=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`)),Ko(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,Ko(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function Ko(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var qo=new N(`tableColumnResizing`);function Jo({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=Go,lastColumnResizable:i=!0}={}){let a=new k({key:qo,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=H(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new Yo(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=qo.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{Xo(t,n,e,i)},mouseleave:e=>{Zo(e)},mousedown:(e,r)=>{Qo(e,r,t,n)}},decorations:e=>{let t=qo.getState(e);if(t&&t.activeHandle>-1)return ss(e,t.activeHandle)},nodeViews:{}}});return a}var Yo=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(qo);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return Ra(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function Xo(e,t,n,r){if(!e.editable)return;let i=qo.getState(e.state);if(i&&!i.dragging){let a=es(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=ts(e,t,`left`,n):i-t.clientX<=n&&(o=ts(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=V.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}rs(e,o)}}}function Zo(e){if(!e.editable)return;let t=qo.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&rs(e,-1)}function Qo(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=qo.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=$o(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(qo,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=qo.getState(e.state);r?.dragging&&(is(e,r.activeHandle,ns(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(qo,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=qo.getState(e.state);if(i&&i.dragging){let a=ns(i.dragging,t,n);as(e,i.activeHandle,a,r)}}return as(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function $o(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function es(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function ts(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=Na(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=V.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function ns(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function rs(e,t){e.dispatch(e.state.tr.setMeta(qo,{setHandle:t}))}function is(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=V.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():os(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function as(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=V.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&Ko(a,c.firstChild,c,r,s,n)}function os(e){return Array(e).fill(0)}function ss(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return fe.empty;let a=V.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,qo.getState(e)?.dragging&&n.push(pe.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(pe.widget(s,c))}}return fe.create(e.doc,n)}function cs({allowTableNodeSelection:e=!1}={}){return new k({key:Ma,state:{init(){return null},apply(e,t){let n=e.getMeta(Ma);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:Ka,handleDOMEvents:{mousedown:Vo},createSelectionBetween(e){return Ma.getState(e.state)==null?null:e.state.selection},handleTripleClick:zo,handleKeyDown:Fo,handlePaste:Bo},appendTransaction(t,n,r){return Ya(r,Qa(r,n),e)}})}function ls(e){return e===`left`||e===`right`||e===`center`?e:null}function us(e){let t=(e.style.textAlign||``).trim().toLowerCase(),n=(e.getAttribute(`align`)||``).trim().toLowerCase();return ls(t||n)}function ds(e){return ls(e?.align)}function fs(){return{default:null,parseHTML:e=>us(e),renderHTML:e=>{let n=ls(e.align);return t(n)?{style:`text-align: ${n}`}:{}}}}function ps(e){let t=e.parentElement,n=e.closest(`table`);if(!t||!n)return null;let r=Array.from(t.children).indexOf(e),i=n.querySelectorAll(`colgroup > col`)[r]?.getAttribute(`width`);return i?[parseInt(i,10)]:null}function ms(e){let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):ps(e)}var hs=/[ \t\r\n\f]+/g;function gs(e){return e.children.length>0?!1:(e.textContent??``).replace(hs,``)===``}function _s(e){let t=e.createAndFill();if(!t)throw Error(`[tiptap error]: "${e.name}" has no default content to backfill.`);return t.content}function vs(e,t,n){if(!(n in t))return;let r=t[n];(r===1||r===`1`||r==null)&&delete e[n]}var ys=j.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ms},align:fs()}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`,getAttrs:e=>gs(e)?{}:!1,getContent:(e,t)=>_s(t.nodes[this.name])},{tag:`td`}]},renderHTML({HTMLAttributes:e}){let t=O(this.options.HTMLAttributes,e);return vs(t,e,`colspan`),vs(t,e,`rowspan`),[`td`,t,0]}}),bs=j.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ms},align:fs()}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`,getAttrs:e=>gs(e)?{}:!1,getContent:(e,t)=>_s(t.nodes[this.name])},{tag:`th`}]},renderHTML({HTMLAttributes:e}){let t=O(this.options.HTMLAttributes,e);return vs(t,e,`colspan`),vs(t,e,`rowspan`),[`th`,t,0]}}),xs=j.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,O(this.options.HTMLAttributes,e),0]}});function Ss(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function Cs(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l!==null)for(let e=0,n=0;e<l.childCount;e+=1){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e+=1,n+=1){let l=i===n?a:d&&d[e],u=l?`${l}px`:``;if(o+=l||r,l||(s=!1),c){if(c.style.width!==u){let[e,t]=Ss(r,l);c.style.setProperty(e,t)}c=c.nextSibling}else{let e=document.createElement(`col`),[n,i]=Ss(r,l);e.style.setProperty(n,i),t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);s&&!d?(n.style.width=`${o}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${o}px`)}var ws=class{constructor(e,t,n,r={}){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`));for(let[e,t]of Object.entries(r))t!=null&&(e===`style`?this.table.style.cssText=String(t):this.table.setAttribute(e,String(t)));e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),Cs(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,Cs(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!(!n||r||e.type!==`attributes`&&e.type!==`childList`&&e.type!==`characterData`)}};function Ts(e,t,n,r){let i=0,a=!0,o=[],s=e.firstChild;if(!s)return{};for(let e=0,c=0;e<s.childCount;e+=1){let{colspan:l,colwidth:u}=s.child(e).attrs;for(let e=0;e<l;e+=1,c+=1){let s=n===c?r:u&&u[e];i+=s||t,s||(a=!1);let[l,d]=Ss(t,s);o.push([`col`,{style:`${l}: ${d}`}])}}let c=a?`${i}px`:``,l=a?``:`${i}px`;return{colgroup:[`colgroup`,{},...o],tableWidth:c,tableMinWidth:l}}function Es(e,t){return t?e.createChecked(null,t):e.createAndFill()}function Ds(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function Os(e,t,n,r,i){let a=Ds(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=Es(a.cell,i);if(e&&s.push(e),r){let e=Es(a.header_cell,i);e&&o.push(e)}}let c=[];for(let e=0;e<t;e+=1)c.push(a.row.createChecked(null,r&&e===0?o:s));return a.table.createChecked(null,c)}function ks(e){return e instanceof U}var As=({editor:e})=>{let{selection:t}=e.state;if(!ks(t))return!1;let n=0;return v(t.ranges[0].$from,e=>e.type.name===`table`)?.node.descendants(e=>{if(e.type.name===`table`)return!1;[`tableCell`,`tableHeader`].includes(e.type.name)&&(n+=1)}),n===t.ranges.length&&(e.commands.deleteTable(),!0)};function js(e,t){let n=e.mapping.map(t);if(v(e.selection.$from,e=>e.type.name===`table`)?.pos===n)return;let r=e.doc.nodeAt(n);if(!r)return;let i=n+r.nodeSize-1;e.setSelection(S.near(e.doc.resolve(i),-1))}function Ms(e){let t=``,n=0;for(;n<e.length;){if(e[n]===`\\`&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}if(e[n]!=="`"){t+=e[n++];continue}let r=0;for(;n+r<e.length&&e[n+r]==="`";)r+=1;let i=n+r,a=!1;for(;i<e.length;){if(e[i]!=="`"){i+=1;continue}let o=0;for(;i+o<e.length&&e[i+o]==="`";)o+=1;if(o===r){let o=e.slice(n+r,i);t+=e.slice(n,n+r)+o.replace(/\\\||\|/g,e=>e===`|`?`\\|`:e)+e.slice(i,i+r),n=i+r,a=!0;break}i+=o}a||(t+=e.slice(n,n+r),n+=r)}return t}function Ns(e){return e.split(`
|
|
40
|
+
`):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=oe(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(t){let r={type:`taskList`,raw:t.raw,items:t.items},i=e.slice(t.raw.length);return i.trim()?[r,...n.blockTokens(i)]:[r]}return n.blockTokens(e)},i=oe(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:`taskList`,raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});xe.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(Dr.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(Xr.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(ai.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(Ti.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(ki.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(Ai.configure(this.options.taskList)),e}});var ji=` `,Mi=`\xA0`,Ni=j.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,O(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===ji||n[0].text===ji||n[0].raw===Mi||n[0].text===Mi)&&r.length===1&&r[0].type===`text`&&(r[0].text===ji||r[0].text===Mi)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){var i,a;let e=Array.isArray(n==null||(i=n.previousNode)==null?void 0:i.content)?n.previousNode.content:[];return(n==null||(a=n.previousNode)==null?void 0:a.type)===`paragraph`&&e.length===0?ji:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Pi=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Fi=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Ii=se.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,O(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ue({find:Pi,type:this.type})]},addPasteRules(){return[ye({find:Fi,type:this.type})]}}),Li=j.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),Ri=se.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,O(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function zi(e={}){return new k({view(t){return new Bi(t,e)}})}var Bi=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.setCursor(null),this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc){if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(!t||i)return null;let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=ee(this.editorView.state.doc,a,this.editorView.dragging.slice);e!=null&&(a=e)}return a}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},Vi=class e extends E{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):E.near(r)}content(){return _.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new Hi(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!Wi(e)||!Gi(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!ae.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};Vi.prototype.visible=!1,Vi.findFrom=Vi.findGapCursorFrom,E.jsonID(`gapcursor`,Vi);var Hi=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Vi.valid(t)?new Vi(t):E.near(t)}};function Ui(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function Wi(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0}else for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||Ui(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Gi(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0}else for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||Ui(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Ki(){return new k({props:{decorations:Zi,createSelectionBetween(e,t,n){return t.pos==n.pos&&Vi.valid(n)?new Vi(n):null},handleClick:Yi,handleKeyDown:qi,handleDOMEvents:{beforeinput:Xi}}})}var qi=ge({ArrowLeft:Ji(`horiz`,-1),ArrowRight:Ji(`horiz`,1),ArrowUp:Ji(`vert`,-1),ArrowDown:Ji(`vert`,1)});function Ji(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof S){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=Vi.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new Vi(c))),!0):!1}}function Yi(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Vi.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&ae.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Vi(r))),!0)}function Xi(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof Vi))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 i=c.empty;for(let e=r.length-1;e>=0;e--)i=c.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new _(i,0,0));return a.setSelection(S.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function Zi(e){if(!(e.selection instanceof Vi))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,fe.create(e.doc,[pe.widget(e.selection.head,t,{key:`gapcursor`})])}xe.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new k({key:new N(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var Qi=xe.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[zi(this.options)]}});xe.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new k({key:new N(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return fe.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(pe.node(t,t+e.nodeSize,{class:this.options.className}))}),fe.create(e,a)}}})]}});var $i=xe.create({name:`gapCursor`,addProseMirrorPlugins(){return[Ki()]},extendNodeSchema(e){let t={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:C(ne(e,`allowGapCursor`,t))??null}}}),ea=`placeholder`,ta=new N(`tiptap__placeholder`);function na(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:a,isEmptyDoc:o,hasAnchor:s,classes:{emptyNode:c,emptyEditor:l}}=e,u=[c];return o&&u.push(l),pe.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function ra(e,t){return typeof e==`function`?e(t):e}function ia({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:a,to:o}){let{anchor:s}=i,c=[],l=e.isEmpty;return r.nodesBetween(a,o,(r,i)=>{let a=s>=i&&s<=i+r.nodeSize,o=!r.isLeaf&&ie(r);return r.type.isTextblock&&(a||!t.showOnlyCurrent)&&o&&c.push(na({editor:e,isEmptyDoc:l,dataAttribute:n,hasAnchor:a,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:ra(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:a})},node:r,pos:i})),t.includeChildren}),c}function aa({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!e.isEditable&&t.showOnlyWhenEditable)return null;let{anchor:a}=i,o=[],s=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),c=i.depth>0?i.node(1):i.nodeAfter,l=i.depth>0?i.before(1):a;if(c&&c.type.isTextblock&&ie(c)){let r=a>=l&&a<=l+c.nodeSize;o.push(na({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:ra(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else o.push(...ia({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return fe.create(r,o)}function oa(e,t){let n=e.resolve(t);if(n.depth===0){let e=n.nodeAfter??n.nodeBefore;if(!e)return{from:t,to:t};let r=n.nodeAfter?t:t-e.nodeSize;return{from:r,to:r+e.nodeSize}}let r=n.before(1);return{from:r,to:r+n.node(1).nodeSize}}function sa(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function ca(e,t,n){let r=[];return e.forEach((e,i)=>{let a=i,o=a+e.nodeSize,s=a+1,c=o+1;s<n&&c>t&&r.push({from:a,to:o})}),r}function la(e){if(e.length===0)return[];let t=[...e].sort((e,t)=>e.from-t.from),n=[{...t[0]}];for(let e=1;e<t.length;e+=1){let r=n[n.length-1],i=t[e];i.from<=r.to?r.to=Math.max(r.to,i.to):n.push({...i})}return n}function ua(e,t){let n=ca(e,t.from,t.to);return n.push(sa(e,oa(e,t.from))),t.to>t.from?n.push(sa(e,oa(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(sa(e,oa(e,Math.min(t.from+1,e.content.size)))),n}function da(e,t,r){let i=[];if(e.docChanged){let t=n(e);for(let e of t)i.push(...ua(r.doc,e.newRange))}return e.selectionSet&&(i.push(sa(r.doc,oa(r.doc,e.mapping.map(t.selection.anchor)))),i.push(sa(r.doc,oa(r.doc,r.selection.anchor)))),la(i)}function fa(e,t,n){let r=Math.max(0,Math.min(e,n.content.size));return{from:r,to:Math.max(r,Math.min(t,n.content.size))}}function pa({decorations:e,ranges:t,editor:n,options:r,dataAttribute:i,doc:a,selection:o}){let s=e;for(let e of t){let{from:t,to:c}=fa(e.from,e.to,a),l=s.find(t,c).filter(e=>e.from>=t&&e.to<=c);l.length&&(s=s.remove(l));let u=ia({editor:n,options:r,dataAttribute:i,doc:a,selection:o,from:t,to:c});u.length&&(s=s.add(a,u))}return s}function ma({editor:e,options:t,dataAttribute:n}){return{init(r,i){return aa({editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection})??fe.empty},apply(r,i,a,o){return!r.docChanged&&!r.selectionSet?i:pa({decorations:i.map(r.mapping,r.doc),ranges:da(r,a,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function ha(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function ga({editor:e,options:t}){let n=t.dataAttribute?`data-${ha(t.dataAttribute)}`:`data-${ea}`,r=t.showOnlyCurrent&&!t.includeChildren;return new k({key:ta,...r?{}:{state:ma({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:r,selection:i})=>aa({editor:e,options:t,dataAttribute:n,doc:r,selection:i}):n=>t.showOnlyWhenEditable&&!e.isEditable?fe.empty:ta.getState(n)??fe.empty}})}var _a=xe.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:ea,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[ga({editor:this.editor,options:this.options})]}});function va(e,t){return!e.selection.empty&&!y(e.selection)&&t.isEditable}function ya(e,t){return va(e,t)&&!t.isFocused&&!t.view.dragging}function ba(){var e;(e=window.getSelection())==null||e.removeAllRanges()}function xa(e){e.focus()}xe.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new k({key:new N(`selection`),props:{decorations(n){return ya(n,e)?fe.create(n.doc,[pe.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(t){return va(t.state,e)&&ba(),!1},focus(t){return va(t.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&t.hasFocus()&&xa(t)}),!1}}}})]}});function Sa({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var Ca=xe.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new N(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new k({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!Sa({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!Sa({node:r,types:n})}}})]}}),wa=xe.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>ve(e,t),redo:()=>({state:e,dispatch:t})=>de(e,t)}},addProseMirrorPlugins(){return[be(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Ta=xe.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(Re.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(Ne.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(Dr.configure(this.options.bulletList)),this.options.code!==!1&&e.push(He.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(Ke.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(qe.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(Qi.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push($i.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(Je.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(Ye.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(wa.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(Xe.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(tt.configure(this.options.italic)),this.options.listItem!==!1&&e.push(Xr.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(ai.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(Cr.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(Ti.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(Ni.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(Ii.configure(this.options.strike)),this.options.text!==!1&&e.push(Li.configure(this.options.text)),this.options.underline!==!1&&e.push(Ri.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(Ca.configure(this.options?.trailingNode)),e}}),Ea,Da;if(typeof WeakMap<`u`){let e=new WeakMap;Ea=t=>e.get(t),Da=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;Ea=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},Da=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var V=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++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw 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 RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return Ea(e)||Da(e,Oa(e))}};function Oa(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=ka(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new V(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&Aa(s,o,e),s}function ka(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function Aa(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r==null||c.colwidth&&c.colwidth[n]==r||((s||=ja(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function ja(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function H(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var Ma=new N(`selectingCells`);function Na(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function Pa(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function Fa(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function Ia(e){let 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&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=Na(t.$head)||La(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function La(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function Ra(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function za(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function Ba(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Va(e,t,n){let r=e.node(-1),i=V.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function Ha(e,t,n=1){let 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 Ua(e,t,n=1){let 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}function Wa(e,t,n){let r=H(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var U=class e extends E{constructor(e,t=e){let n=e.node(-1),r=V.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new M(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(Ra(r)&&Ra(i)&&Ba(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return S.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=V.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=Ha(e,0,l)),u>0&&(e=Ha(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(c.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new _(c.from(o),1,1)}replace(e,t=_.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?_.empty:t)}let i=E.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new _(c.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=V.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let 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){let r=t.node(-1),i=V.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=V.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==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){let r=t.node(-1),i=V.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.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 Ga(this.$anchorCell.pos,this.$headCell.pos)}};U.prototype.visible=!1,E.jsonID(`cell`,U);var Ga=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){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&Ba(t,n)?new U(t,n):E.near(n,1)}};function Ka(e){if(!(e.selection instanceof U))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(pe.node(n,n+e.nodeSize,{class:`selectedCell`}))}),fe.create(e.doc,t)}function qa({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function Ja({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function Ya(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof ae&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=U.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=U.rowSelection(e,e)}else if(!n){let e=V.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=U.create(i,t+1,n)}}else r instanceof S&&qa(r)?a=S.create(i,r.from):r instanceof S&&Ja(r)&&(a=S.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var Xa=new N(`fix-tables`);function Za(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?Za(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function Qa(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=$a(e,t,r,n))};return t?t.doc!=e.doc&&Za(t.doc,e.doc,0,r):e.doc.descendants(r),n}function $a(e,t,n,r){let i=V.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,Ha(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=H(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(Xa,{fixTables:!0})}function eo(e){let t=e.selection,n=Ia(e),r=n.node(-1),i=n.start(-1),a=V.get(r);return{...t instanceof U?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function to(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;Wa(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,Ua(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?H(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function no(e,t){if(!Fa(e))return!1;if(t){let n=eo(e);t(to(e.tr,n,n.left))}return!0}function ro(e,t){if(!Fa(e))return!1;if(t){let n=eo(e);t(to(e.tr,n,n.right))}return!0}function io(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,Ha(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function ao(e,t){if(!Fa(e))return!1;if(t){let n=eo(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;io(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=V.get(e)}t(r)}return!0}function oo(e,t,n){let r=H(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function so(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;oo(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?H(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,H(r.type.schema).row.create(null,o)),e}function co(e,t){if(!Fa(e))return!1;if(t){let n=eo(e);t(so(e.tr,n,n.top))}return!0}function lo(e,t){if(!Fa(e))return!1;if(t){let n=eo(e);t(so(e.tr,n,n.bottom))}return!0}function uo(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function fo(e,t){if(!Fa(e))return!1;if(t){let n=eo(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;uo(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=V.get(n.table)}t(r)}return!0}function po(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function mo({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function ho(e,t){let n=e.selection;if(!(n instanceof U)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=eo(e),{map:i}=r;if(mo(i,r))return!1;if(t){let n=e.tr,a={},o=c.empty,s,l;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let c=i.map[e*i.width+t],u=r.table.nodeAt(c);if(!a[c]&&u){if(a[c]=!0,s==null)s=c,l=u;else{po(u)||(o=o.append(u.content));let e=n.mapping.map(c+r.tableStart);n.delete(e,e+u.nodeSize)}}}if(s==null||l==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...Ua(l.attrs,l.attrs.colspan,r.right-r.left-l.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+l.content.size,t=po(l)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new U(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function go(e,t){let n=H(e.schema);return _o(({node:e})=>n[e.type.spec.tableRole])(e,t)}function _o(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof U){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=Pa(r.$from),!i)return!1;a=Na(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=eo(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)(r!=l.left||t!=l.top)&&u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof U&&u.setSelection(new U(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function vo(e,t){return function(n,r){if(!Fa(n))return!1;let i=Ia(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof U?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function yo(e){return function(t,n){if(!Fa(t))return!1;if(n){let r=H(t.schema),i=eo(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function bo(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function xo(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?yo(e):function(t,n){if(!Fa(t))return!1;if(n){let r=H(t.schema),i=eo(t),a=t.tr,o=bo(`row`,i,r),s=bo(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}xo(`row`,{useDeprecatedLogic:!0}),xo(`column`,{useDeprecatedLogic:!0});var So=xo(`cell`,{useDeprecatedLogic:!0});function Co(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function wo(e){return function(t,n){if(!Fa(t))return!1;let r=Co(Ia(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(S.between(e,za(e))).scrollIntoView())}return!0}}function To(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Eo(e,t){let n=e.selection;if(!(n instanceof U))return!1;if(t){let r=e.tr,i=H(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new _(i,0,0))}),r.docChanged&&t(r)}return!0}function Do(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=ko(H(o).row,new _(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?ko(H(o).row,new _(t,n,r)).content:t);else return null;return Oo(o,s)}function Oo(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(c.empty),n[i]<r){let a=H(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(c.from(o))}return{height:t.length,width:r,rows:t}}function ko(e,t){let n=e.createAndFill();return new A(n).replace(0,n.content.size,t).doc}function Ao({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(Ha(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.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}i.push(c.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(c.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function jo(e,t,n,r,i,a,o){let s=e.doc.type.schema,l=H(s),u,d;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let c=n.child(a);s+=c.nodeSize;let f=[],p;p=c.lastChild==null||c.lastChild.type==l.cell?u||=l.cell.createAndFill():d||=l.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==l.header_cell;s.push(i?d||=l.header_cell.createAndFill():u||=l.cell.createAndFill())}let f=l.row.create(null,c.from(s)),p=[];for(let e=t.height;e<a;e++)p.push(f);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),p)}return!!(u||d)}function Mo(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function No(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,Ha(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(Ha(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function Po(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=V.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=V.get(a),f=d.mapping.maps.length}jo(d,o,a,n,l,u,f)&&p(),Mo(d,o,a,n,c,l,s,f)&&p(),Mo(d,o,a,n,c,l,u,f)&&p(),No(d,o,a,n,s,u,c,f)&&p(),No(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new _(i.rows[e-s],0,0))}p(),d.setSelection(new U(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var Fo=ge({ArrowLeft:Lo(`horiz`,-1),ArrowRight:Lo(`horiz`,1),ArrowUp:Lo(`vert`,-1),ArrowDown:Lo(`vert`,1),"Shift-ArrowLeft":Ro(`horiz`,-1),"Shift-ArrowRight":Ro(`horiz`,1),"Shift-ArrowUp":Ro(`vert`,-1),"Shift-ArrowDown":Ro(`vert`,1),Backspace:Eo,"Mod-Backspace":Eo,Delete:Eo,"Mod-Delete":Eo});function Io(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function Lo(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof U)return Io(n,r,E.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=Ho(i,e,t);if(o==null)return!1;if(e==`horiz`)return Io(n,r,E.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=Va(i,e,t),s;return s=a?E.near(a,1):t<0?E.near(n.doc.resolve(i.before(-1)),-1):E.near(n.doc.resolve(i.after(-1)),1),Io(n,r,s)}}}function Ro(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof U)o=a;else{let r=Ho(i,e,t);if(r==null)return!1;o=new U(n.doc.resolve(r))}let s=Va(o.$headCell,e,t);return s?Io(n,r,new U(o.$anchorCell,s)):!1}}function zo(e,t){let n=e.state.doc,r=Na(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new U(r))),!0):!1}function Bo(e,t,n){if(!Fa(e.state))return!1;let r=Do(n),i=e.state.selection;if(i instanceof U){r||={width:1,height:1,rows:[c.from(ko(H(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=V.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=Ao(r,o.right-o.left,o.bottom-o.top),Po(e.state,e.dispatch,a,o,r),!0}if(r){let t=Ia(e.state),n=t.start(-1);return Po(e.state,e.dispatch,n,V.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function Vo(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=Uo(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof U)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=Na(e.state.selection.$anchor))!=null&&Wo(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=Wo(e,n),i=Ma.getState(e.state)==null;if(!r||!Ba(t,r)){if(i)r=t;else return}let a=new U(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(Ma,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),Ma.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(Ma,-1))}function o(r){let o=r,s=Ma.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(Uo(e,o.target)!=n&&(c=Wo(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function Ho(e,t,n){if(!(e.state.selection instanceof S))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function Uo(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function Wo(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&Na(e.state.doc.resolve(r))||Na(e.state.doc.resolve(i))}var Go=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`)),Ko(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,Ko(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function Ko(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var qo=new N(`tableColumnResizing`);function Jo({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=Go,lastColumnResizable:i=!0}={}){let a=new k({key:qo,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=H(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new Yo(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=qo.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{Xo(t,n,e,i)},mouseleave:e=>{Zo(e)},mousedown:(e,r)=>{Qo(e,r,t,n)}},decorations:e=>{let t=qo.getState(e);if(t&&t.activeHandle>-1)return ss(e,t.activeHandle)},nodeViews:{}}});return a}var Yo=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(qo);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return Ra(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function Xo(e,t,n,r){if(!e.editable)return;let i=qo.getState(e.state);if(i&&!i.dragging){let a=es(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=ts(e,t,`left`,n):i-t.clientX<=n&&(o=ts(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=V.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}rs(e,o)}}}function Zo(e){if(!e.editable)return;let t=qo.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&rs(e,-1)}function Qo(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=qo.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=$o(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(qo,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=qo.getState(e.state);r?.dragging&&(is(e,r.activeHandle,ns(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(qo,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=qo.getState(e.state);if(i&&i.dragging){let a=ns(i.dragging,t,n);as(e,i.activeHandle,a,r)}}return as(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function $o(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function es(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function ts(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=Na(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=V.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function ns(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function rs(e,t){e.dispatch(e.state.tr.setMeta(qo,{setHandle:t}))}function is(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=V.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():os(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function as(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=V.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&Ko(a,c.firstChild,c,r,s,n)}function os(e){return Array(e).fill(0)}function ss(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return fe.empty;let a=V.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,qo.getState(e)?.dragging&&n.push(pe.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(pe.widget(s,c))}}return fe.create(e.doc,n)}function cs({allowTableNodeSelection:e=!1}={}){return new k({key:Ma,state:{init(){return null},apply(e,t){let n=e.getMeta(Ma);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:Ka,handleDOMEvents:{mousedown:Vo},createSelectionBetween(e){return Ma.getState(e.state)==null?null:e.state.selection},handleTripleClick:zo,handleKeyDown:Fo,handlePaste:Bo},appendTransaction(t,n,r){return Ya(r,Qa(r,n),e)}})}function ls(e){return e===`left`||e===`right`||e===`center`?e:null}function us(e){let t=(e.style.textAlign||``).trim().toLowerCase(),n=(e.getAttribute(`align`)||``).trim().toLowerCase();return ls(t||n)}function ds(e){return ls(e?.align)}function fs(){return{default:null,parseHTML:e=>us(e),renderHTML:e=>{let n=ls(e.align);return t(n)?{style:`text-align: ${n}`}:{}}}}function ps(e){let t=e.parentElement,n=e.closest(`table`);if(!t||!n)return null;let r=Array.from(t.children).indexOf(e),i=n.querySelectorAll(`colgroup > col`)[r]?.getAttribute(`width`);return i?[parseInt(i,10)]:null}function ms(e){let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):ps(e)}var hs=/[ \t\r\n\f]+/g;function gs(e){return e.children.length>0?!1:(e.textContent??``).replace(hs,``)===``}function _s(e){let t=e.createAndFill();if(!t)throw Error(`[tiptap error]: "${e.name}" has no default content to backfill.`);return t.content}function vs(e,t,n){if(!(n in t))return;let r=t[n];(r===1||r===`1`||r==null)&&delete e[n]}var ys=j.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ms},align:fs()}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`,getAttrs:e=>gs(e)?{}:!1,getContent:(e,t)=>_s(t.nodes[this.name])},{tag:`td`}]},renderHTML({HTMLAttributes:e}){let t=O(this.options.HTMLAttributes,e);return vs(t,e,`colspan`),vs(t,e,`rowspan`),[`td`,t,0]}}),bs=j.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:ms},align:fs()}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`,getAttrs:e=>gs(e)?{}:!1,getContent:(e,t)=>_s(t.nodes[this.name])},{tag:`th`}]},renderHTML({HTMLAttributes:e}){let t=O(this.options.HTMLAttributes,e);return vs(t,e,`colspan`),vs(t,e,`rowspan`),[`th`,t,0]}}),xs=j.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,O(this.options.HTMLAttributes,e),0]}});function Ss(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function Cs(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l!==null)for(let e=0,n=0;e<l.childCount;e+=1){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e+=1,n+=1){let l=i===n?a:d&&d[e],u=l?`${l}px`:``;if(o+=l||r,l||(s=!1),c){if(c.style.width!==u){let[e,t]=Ss(r,l);c.style.setProperty(e,t)}c=c.nextSibling}else{let e=document.createElement(`col`),[n,i]=Ss(r,l);e.style.setProperty(n,i),t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);s&&!d?(n.style.width=`${o}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${o}px`)}var ws=class{constructor(e,t,n,r={}){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`));for(let[e,t]of Object.entries(r))t!=null&&(e===`style`?this.table.style.cssText=String(t):this.table.setAttribute(e,String(t)));e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),Cs(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,Cs(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!(!n||r||e.type!==`attributes`&&e.type!==`childList`&&e.type!==`characterData`)}};function Ts(e,t,n,r){let i=0,a=!0,o=[],s=e.firstChild;if(!s)return{};for(let e=0,c=0;e<s.childCount;e+=1){let{colspan:l,colwidth:u}=s.child(e).attrs;for(let e=0;e<l;e+=1,c+=1){let s=n===c?r:u&&u[e];i+=s||t,s||(a=!1);let[l,d]=Ss(t,s);o.push([`col`,{style:`${l}: ${d}`}])}}let c=a?`${i}px`:``,l=a?``:`${i}px`;return{colgroup:[`colgroup`,{},...o],tableWidth:c,tableMinWidth:l}}function Es(e,t){return t?e.createChecked(null,t):e.createAndFill()}function Ds(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function Os(e,t,n,r,i){let a=Ds(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=Es(a.cell,i);if(e&&s.push(e),r){let e=Es(a.header_cell,i);e&&o.push(e)}}let c=[];for(let e=0;e<t;e+=1)c.push(a.row.createChecked(null,r&&e===0?o:s));return a.table.createChecked(null,c)}function ks(e){return e instanceof U}var As=({editor:e})=>{let{selection:t}=e.state;if(!ks(t))return!1;let n=0;return v(t.ranges[0].$from,e=>e.type.name===`table`)?.node.descendants(e=>{if(e.type.name===`table`)return!1;[`tableCell`,`tableHeader`].includes(e.type.name)&&(n+=1)}),n===t.ranges.length&&(e.commands.deleteTable(),!0)};function js(e,t){let n=e.mapping.map(t);if(v(e.selection.$from,e=>e.type.name===`table`)?.pos===n)return;let r=e.doc.nodeAt(n);if(!r)return;let i=n+r.nodeSize-1;e.setSelection(S.near(e.doc.resolve(i),-1))}function Ms(e){let t=``,n=0;for(;n<e.length;){if(e[n]===`\\`&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}if(e[n]!=="`"){t+=e[n++];continue}let r=0;for(;n+r<e.length&&e[n+r]==="`";)r+=1;let i=n+r,a=!1;for(;i<e.length;){if(e[i]!=="`"){i+=1;continue}let o=0;for(;i+o<e.length&&e[i+o]==="`";)o+=1;if(o===r){let o=e.slice(n+r,i);t+=e.slice(n,n+r)+o.replace(/\\\||\|/g,e=>e===`|`?`\\|`:e)+e.slice(i,i+r),n=i+r,a=!0;break}i+=o}a||(t+=e.slice(n,n+r),n+=r)}return t}function Ns(e){return e.split(`
|
|
41
41
|
`).map(e=>!e.includes(`|`)||!e.includes("`")?e:Ms(e)).join(`
|
|
42
42
|
`)}function Ps(e){return(e||``).replaceAll(``,` `).replace(/\s+/g,` `).trim()}function Fs(e,t){return t?e.split(t).join(`
|
|
43
43
|
`):e}function Is(e){return e.replace(/\\.|\|/g,e=>e===`|`?`\\|`:e)}function Ls(e,t,n={}){if(!e||!e.content||e.content.length===0)return``;let r=[];e.content.forEach(e=>{let i=[];e.content&&e.content.forEach(e=>{let r=``;r=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>Fs(t.renderChildren(e),n.cellLineSeparator)).join(`
|
|
@@ -49,9 +49,9 @@ import{Yt as e}from"./D1QDGpmd.js";import{$ as t,B as n,C as r,Ct as i,D as a,Dt
|
|
|
49
49
|
`);if(a.length<2)return;let o=a[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(o)||!o.includes(`|`))return;let s=Ns(i);if(s===i)return;let c=n.blockTokens(s)[0];if(c?.type!==`table`||!c.raw)return;let l=c.raw.split(`
|
|
50
50
|
`).length,u=e.split(`
|
|
51
51
|
`).slice(0,l).join(`
|
|
52
|
-
`);return{...c,raw:u}}},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=Os(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(S.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>no(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>ro(e,t),deleteColumn:()=>({state:e,dispatch:t})=>{let n=v(e.selection.$from,e=>e.type.name===`table`);return ao(e,t&&(e=>{n&&js(e,n.pos),t(e)}))},addRowBefore:()=>({state:e,dispatch:t})=>co(e,t),addRowAfter:()=>({state:e,dispatch:t})=>lo(e,t),deleteRow:()=>({state:e,dispatch:t})=>{let n=v(e.selection.$from,e=>e.type.name===`table`);return fo(e,t&&(e=>{n&&js(e,n.pos),t(e)}))},deleteTable:()=>({state:e,dispatch:t})=>To(e,t),mergeCells:()=>({state:e,dispatch:t})=>ho(e,t),splitCell:()=>({state:e,dispatch:t})=>go(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>xo(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>xo(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>So(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>ho(e,t)?!0:go(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>vo(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>wo(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>wo(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&Qa(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=U.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:As,"Mod-Backspace":As,Delete:As,"Mod-Delete":As}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Jo({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],cs({allowTableNodeSelection:this.options.allowTableNodeSelection}),Vs()]},addNodeView(){let e=this.options.resizable&&this.editor.isEditable,t=this.options.View;return e||!t?null:({node:e,view:n,HTMLAttributes:r})=>{let i=O(this.options.HTMLAttributes,r);return new t(e,this.options.cellMinWidth,n,i)}},extendNodeSchema(e){let t={name:e.name,options:e.options,storage:e.storage};return{tableRole:C(ne(e,`tableRole`,t))}}}),Us=xe.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(Hs.configure(this.options.table)),this.options.tableCell!==!1&&e.push(ys.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(bs.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(xs.configure(this.options.tableRow)),e}}),Ws=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Gs=j.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,O(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:i}=this.options.resize,a=new Set([`src`,`width`,`height`]);return({node:o,getPos:s,HTMLAttributes:c,editor:l})=>{let u=document.createElement(`img`);u.draggable=!1;let d=O(this.options.HTMLAttributes,c);Object.entries(d).forEach(([e,t])=>{if(t!=null)switch(e){case`src`:case`width`:case`height`:break;default:u.setAttribute(e,t)}}),d.src!==null&&(u.src=d.src);let f={...c},m=e=>{typeof e==`string`&&e!==``?u.getAttribute(`src`)!==e&&(u.src=e):(u.hasAttribute(`src`)&&u.removeAttribute(`src`),u.src!==``&&(u.src=``))};m(c.src);let h=new r({element:u,editor:l,node:o,getPos:s,onResize:(e,t)=>{u.style.width=`${e}px`,u.style.height=`${t}px`},onCommit:(e,t)=>{let n=s();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:e=>{if(e.type!==o.type)return!1;let t=l.extensionManager.attributes.filter(t=>t.type===e.type.name),n=p(e,t);return Object.keys(f).forEach(e=>{!a.has(e)&&!(e in n)&&u.removeAttribute(e)}),Object.entries(n).forEach(([e,t])=>{a.has(e)||(t==null?u.removeAttribute(e):u.setAttribute(e,t))}),m(n.src),f=n,!0},options:{directions:e,min:{width:t,height:n},preserveAspectRatio:i===!0}}),g=h.dom,_=()=>{g.style.visibility=``,g.style.pointerEvents=``};return g.style.visibility=`hidden`,g.style.pointerEvents=`none`,u.complete&&u.naturalWidth>0?_():(u.onload=_,u.onerror=_),h}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[me({find:Ws,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),Ks=_a,qs=Math.min,Js=Math.max,Ys=Math.round,Xs=Math.floor,Zs=e=>({x:e,y:e}),Qs={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function $s(e,t){return typeof e==`function`?e(t):e}function ec(e){return e.split(`-`)[0]}function tc(e){return e.split(`-`)[1]}function nc(e){return e===`x`?`y`:`x`}function rc(e){return e===`y`?`height`:`width`}function ic(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ac(e){return nc(ic(e))}function oc(e,t,n){n===void 0&&(n=!1);let r=tc(e),i=ac(e),a=rc(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=hc(o)),[o,hc(o)]}function sc(e){let t=hc(e);return[cc(e),t,cc(t)]}function cc(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var lc=[`left`,`right`],uc=[`right`,`left`],dc=[`top`,`bottom`],fc=[`bottom`,`top`];function pc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?uc:lc:t?lc:uc;case`left`:case`right`:return t?dc:fc;default:return[]}}function mc(e,t,n,r){let i=tc(e),a=pc(ec(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(cc)))),a}function hc(e){let t=ec(e);return Qs[t]+e.slice(t.length)}function gc(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function _c(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:gc(e)}function vc(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function yc(e,t,n){let{reference:r,floating:i}=e,a=ic(t),o=ac(t),s=rc(o),c=ec(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=tc(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function bc(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=$s(t,e),p=_c(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=vc(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=vc(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var xc=50,Sc=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:bc},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=yc(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<xc&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=yc(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Cc=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=$s(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ec(r),_=ic(o),v=ec(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[hc(o)]:sc(o)),x=p!==`none`;!d&&x&&b.push(...mc(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),ee=[],te=i.flip?.overflows||[];if(l&&ee.push(C[g]),u){let e=oc(r,a,y);ee.push(C[e[0]],C[e[1]])}if(te=[...te,{placement:r,overflows:ee}],!ee.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===ic(t)||te.every(e=>ic(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:te},reset:{placement:t}};let n=te.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=te.filter(e=>{if(x){let t=ic(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},wc=new Set([`left`,`top`]);async function Tc(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ec(n),s=tc(n),c=ic(n)===`y`,l=wc.has(o)?-1:1,u=a&&c?-1:1,d=$s(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Ec=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Tc(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}};function Dc(){return typeof window<`u`}function Oc(e){return jc(e)?(e.nodeName||``).toLowerCase():`#document`}function kc(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ac(e){return((jc(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function jc(e){return Dc()?e instanceof Node||e instanceof kc(e).Node:!1}function Mc(e){return Dc()?e instanceof Element||e instanceof kc(e).Element:!1}function Nc(e){return Dc()?e instanceof HTMLElement||e instanceof kc(e).HTMLElement:!1}function Pc(e){return!Dc()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof kc(e).ShadowRoot}function Fc(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Kc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ic(e){return/^(table|td|th)$/.test(Oc(e))}function Lc(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Rc=/transform|translate|scale|rotate|perspective|filter/,zc=/paint|layout|strict|content/,Bc=e=>!!e&&e!==`none`,Vc;function Hc(e){let t=Mc(e)?Kc(e):e;return Bc(t.transform)||Bc(t.translate)||Bc(t.scale)||Bc(t.rotate)||Bc(t.perspective)||!Wc()&&(Bc(t.backdropFilter)||Bc(t.filter))||Rc.test(t.willChange||``)||zc.test(t.contain||``)}function Uc(e){let t=Jc(e);for(;Nc(t)&&!Gc(t);){if(Hc(t))return t;if(Lc(t))return null;t=Jc(t)}return null}function Wc(){return Vc??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Vc}function Gc(e){return/^(html|body|#document)$/.test(Oc(e))}function Kc(e){return kc(e).getComputedStyle(e)}function qc(e){return Mc(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jc(e){if(Oc(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Pc(e)&&e.host||Ac(e);return Pc(t)?t.host:t}function Yc(e){let t=Jc(e);return Gc(t)?(e.ownerDocument||e).body:Nc(t)&&Fc(t)?t:Yc(t)}function Xc(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Yc(e),i=r===e.ownerDocument?.body,a=kc(r);if(i){let e=Zc(a);return t.concat(a,a.visualViewport||[],Fc(r)?r:[],e&&n?Xc(e):[])}return t.concat(r,Xc(r,[],n))}function Zc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Qc(e){let t=Kc(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Nc(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ys(n)!==a||Ys(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function $c(e){return Mc(e)?e:e.contextElement}function el(e){let t=$c(e);if(!Nc(t))return Zs(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Qc(t),o=(a?Ys(n.width):n.width)/r,s=(a?Ys(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var tl=Zs(0);function nl(e){let t=kc(e);return!Wc()||!t.visualViewport?tl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rl(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===kc(e)}function il(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=$c(e),o=Zs(1);t&&(r?Mc(r)&&(o=el(r)):o=el(e));let s=rl(a,n,r)?nl(a):Zs(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=kc(a),t=Mc(r)?kc(r):r,n=e,i=Zc(n);for(;i&&t!==n;){let e=el(i),t=i.getBoundingClientRect(),r=Kc(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=kc(i),i=Zc(n)}}return vc({width:u,height:d,x:c,y:l})}function al(e,t){let n=qc(e).scrollLeft;return t?t.left+n:il(Ac(e)).left+n}function ol(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-al(e,n),y:n.top+t.scrollTop}}function sl(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ac(r),s=t?Lc(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Zs(1),u=Zs(0),d=Nc(r);if((d||!a)&&((Oc(r)!==`body`||Fc(o))&&(c=qc(r)),d)){let e=il(r);l=el(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ol(o,c):Zs(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function cl(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ll(e){let t=qc(e),n=e.ownerDocument.body,r=Js(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Js(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+al(e),o=-t.scrollTop;return Kc(n).direction===`rtl`&&(a+=Js(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ul=25;function dl(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=kc(e),a=Ac(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Wc()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(al(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ul&&(s-=o)}return{width:s,height:c,x:l,y:u}}function fl(e,t){let n=il(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=el(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function pl(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=dl(e,n,t);else if(t===`document`)r=ll(Ac(e));else if(Mc(t))r=fl(t,n);else{let n=nl(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return vc(r)}function ml(e,t){let n=t.get(e);if(n)return n;let r=Xc(e,[],!1).filter(e=>Mc(e)&&Oc(e)!==`body`),i=null,a=Kc(e).position===`fixed`,o=a?Jc(e):e;for(;Mc(o)&&!Gc(o);){let e=Kc(o),t=Hc(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Jc(o)}return t.set(e,r),r}function hl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Lc(t)?[]:ml(t,this._c):[].concat(n),r],o=pl(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=pl(t,a[e],i);s=Js(n.top,s),c=qs(n.right,c),l=qs(n.bottom,l),u=Js(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function gl(e){let{width:t,height:n}=Qc(e);return{width:t,height:n}}function _l(e,t,n){let r=Nc(t),i=Ac(t),a=n===`fixed`,o=il(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Zs(0);if((r||!a)&&((Oc(t)!==`body`||Fc(i))&&(s=qc(t)),r)){let e=il(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=al(i));let l=i&&!r&&!a?ol(i,s):Zs(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function vl(e){return Kc(e).position===`static`}function yl(e,t){if(!Nc(e)||Kc(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ac(e)===n&&(n=n.ownerDocument.body),n}function bl(e,t){let n=kc(e);if(Lc(e))return n;if(!Nc(e)){let t=Jc(e);for(;t&&!Gc(t);){if(Mc(t)&&!vl(t))return t;t=Jc(t)}return n}let r=yl(e,t);for(;r&&Ic(r)&&vl(r);)r=yl(r,t);return r&&Gc(r)&&vl(r)&&!Hc(r)?n:r||Uc(e)||n}var xl=async function(e){let t=this.getOffsetParent||bl,n=this.getDimensions,r=await n(e.floating);return{reference:_l(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Sl(e){return Kc(e).direction===`rtl`}var Cl={convertOffsetParentRelativeRectToViewportRelativeRect:sl,getDocumentElement:Ac,getClippingRect:hl,getOffsetParent:bl,getElementRects:xl,getClientRects:cl,getDimensions:gl,getScale:el,isElement:Mc,isRTL:Sl};function wl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Tl(e,t,n){let r=null,i,a=Ac(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Xs(d),h=Xs(a.clientWidth-(u+f)),g=Xs(a.clientHeight-(d+p)),_=Xs(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Js(0,qs(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!wl(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=kc(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function El(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=$c(e),u=i||a?[...l?Xc(l):[],...t?Xc(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Tl(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?il(e):null;c&&g();function g(){let t=il(e);h&&!wl(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Dl=Ec,Ol=Cc,kl=(e,t,n)=>{let r=new Map,i=n??{},a={...Cl,...i.platform,_c:r};return Sc(e,t,{...i,platform:a})};function Al(e){let{char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:o}=e,s=n&&!r,c=h(t),l=RegExp(`\\s${c}$`),u=a?`^`:``,d=r?``:c,f=RegExp(s?`${u}${c}.*?(?=\\s${d}|$)`:`${u}(?:^)?${c}[^\\s${d}]*`,`gm`),p=o.nodeBefore?.isText&&o.nodeBefore.text;if(!p)return null;let m=o.pos-p.length,g=Array.from(p.matchAll(f)).pop();if(!g||g.input===void 0||g.index===void 0)return null;let _=g.input.slice(Math.max(0,g.index-1),g.index),v=RegExp(`^[${i?.join(``)}\0]?$`).test(_);if(i!==null&&!v)return null;let y=m+g.index,b=y+g[0].length;return s&&l.test(p.slice(b-1,b+1))&&(g[0]+=` `,b+=1),y<o.pos&&b>=o.pos?{range:{from:y,to:b},query:g[0].slice(t.length),text:g[0]}:null}function jl(e){return e.docChanged?e.steps.some(e=>{let t=e.slice;if(!t?.content)return!1;let n=t.content.textBetween(0,t.content.size,`
|
|
52
|
+
`);return{...c,raw:u}}},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=Os(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(S.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>no(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>ro(e,t),deleteColumn:()=>({state:e,dispatch:t})=>{let n=v(e.selection.$from,e=>e.type.name===`table`);return ao(e,t&&(e=>{n&&js(e,n.pos),t(e)}))},addRowBefore:()=>({state:e,dispatch:t})=>co(e,t),addRowAfter:()=>({state:e,dispatch:t})=>lo(e,t),deleteRow:()=>({state:e,dispatch:t})=>{let n=v(e.selection.$from,e=>e.type.name===`table`);return fo(e,t&&(e=>{n&&js(e,n.pos),t(e)}))},deleteTable:()=>({state:e,dispatch:t})=>To(e,t),mergeCells:()=>({state:e,dispatch:t})=>ho(e,t),splitCell:()=>({state:e,dispatch:t})=>go(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>xo(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>xo(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>So(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>ho(e,t)?!0:go(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>vo(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>wo(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>wo(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&Qa(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=U.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:As,"Mod-Backspace":As,Delete:As,"Mod-Delete":As}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Jo({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],cs({allowTableNodeSelection:this.options.allowTableNodeSelection}),Vs()]},addNodeView(){let e=this.options.resizable&&this.editor.isEditable,t=this.options.View;return e||!t?null:({node:e,view:n,HTMLAttributes:r})=>{let i=O(this.options.HTMLAttributes,r);return new t(e,this.options.cellMinWidth,n,i)}},extendNodeSchema(e){let t={name:e.name,options:e.options,storage:e.storage};return{tableRole:C(ne(e,`tableRole`,t))}}}),Us=xe.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(Hs.configure(this.options.table)),this.options.tableCell!==!1&&e.push(ys.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(bs.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(xs.configure(this.options.tableRow)),e}}),Ws=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Gs=j.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,O(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:i}=this.options.resize,a=new Set([`src`,`width`,`height`]);return({node:o,getPos:s,HTMLAttributes:c,editor:l})=>{let u=document.createElement(`img`);u.draggable=!1;let d=O(this.options.HTMLAttributes,c);Object.entries(d).forEach(([e,t])=>{if(t!=null)switch(e){case`src`:case`width`:case`height`:break;default:u.setAttribute(e,t)}}),d.src!==null&&(u.src=d.src);let f={...c},m=e=>{typeof e==`string`&&e!==``?u.getAttribute(`src`)!==e&&(u.src=e):(u.hasAttribute(`src`)&&u.removeAttribute(`src`),u.src!==``&&(u.src=``))};m(c.src);let h=new r({element:u,editor:l,node:o,getPos:s,onResize:(e,t)=>{u.style.width=`${e}px`,u.style.height=`${t}px`},onCommit:(e,t)=>{let n=s();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:e=>{if(e.type!==o.type)return!1;let t=l.extensionManager.attributes.filter(t=>t.type===e.type.name),n=p(e,t);return Object.keys(f).forEach(e=>{!a.has(e)&&!(e in n)&&u.removeAttribute(e)}),Object.entries(n).forEach(([e,t])=>{a.has(e)||(t==null?u.removeAttribute(e):u.setAttribute(e,t))}),m(n.src),f=n,!0},options:{directions:e,min:{width:t,height:n},preserveAspectRatio:i===!0}}),g=h.dom,_=()=>{g.style.visibility=``,g.style.pointerEvents=``};return g.style.visibility=`hidden`,g.style.pointerEvents=`none`,u.complete&&u.naturalWidth>0?_():(u.onload=_,u.onerror=_),h}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[me({find:Ws,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),Ks=_a,qs=Math.min,Js=Math.max,Ys=Math.round,Xs=Math.floor,Zs=e=>({x:e,y:e}),Qs={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function $s(e,t){return typeof e==`function`?e(t):e}function ec(e){return e.split(`-`)[0]}function tc(e){return e.split(`-`)[1]}function nc(e){return e===`x`?`y`:`x`}function rc(e){return e===`y`?`height`:`width`}function ic(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ac(e){return nc(ic(e))}function oc(e,t,n){n===void 0&&(n=!1);let r=tc(e),i=ac(e),a=rc(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=hc(o)),[o,hc(o)]}function sc(e){let t=hc(e);return[cc(e),t,cc(t)]}function cc(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var lc=[`left`,`right`],uc=[`right`,`left`],dc=[`top`,`bottom`],fc=[`bottom`,`top`];function pc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?uc:lc:t?lc:uc;case`left`:case`right`:return t?dc:fc;default:return[]}}function mc(e,t,n,r){let i=tc(e),a=pc(ec(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(cc)))),a}function hc(e){let t=ec(e);return Qs[t]+e.slice(t.length)}function gc(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function _c(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:gc(e)}function vc(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function yc(e,t,n){let{reference:r,floating:i}=e,a=ic(t),o=ac(t),s=rc(o),c=ec(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=tc(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function bc(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=$s(t,e),p=_c(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=vc(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=vc(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var xc=50,Sc=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:bc},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=yc(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<xc&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=yc(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Cc=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=$s(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ec(r),_=ic(o),v=ec(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[hc(o)]:sc(o)),x=p!==`none`;!d&&x&&b.push(...mc(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),ee=[],te=i.flip?.overflows||[];if(l&&ee.push(C[g]),u){let e=oc(r,a,y);ee.push(C[e[0]],C[e[1]])}if(te=[...te,{placement:r,overflows:ee}],!ee.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===ic(t)||te.every(e=>ic(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:te},reset:{placement:t}};let n=te.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=te.filter(e=>{if(x){let t=ic(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},wc=new Set([`left`,`top`]);async function Tc(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ec(n),s=tc(n),c=ic(n)===`y`,l=wc.has(o)?-1:1,u=a&&c?-1:1,d=$s(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Ec=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Tc(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}};function Dc(){return typeof window<`u`}function Oc(e){return jc(e)?(e.nodeName||``).toLowerCase():`#document`}function kc(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ac(e){return((jc(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function jc(e){return Dc()?e instanceof Node||e instanceof kc(e).Node:!1}function Mc(e){return Dc()?e instanceof Element||e instanceof kc(e).Element:!1}function Nc(e){return Dc()?e instanceof HTMLElement||e instanceof kc(e).HTMLElement:!1}function Pc(e){return!Dc()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof kc(e).ShadowRoot}function Fc(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Kc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ic(e){return/^(table|td|th)$/.test(Oc(e))}function Lc(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Rc=/transform|translate|scale|rotate|perspective|filter/,zc=/paint|layout|strict|content/,Bc=e=>!!e&&e!==`none`,Vc;function Hc(e){let t=Mc(e)?Kc(e):e;return Bc(t.transform)||Bc(t.translate)||Bc(t.scale)||Bc(t.rotate)||Bc(t.perspective)||!Wc()&&(Bc(t.backdropFilter)||Bc(t.filter))||Rc.test(t.willChange||``)||zc.test(t.contain||``)}function Uc(e){let t=Jc(e);for(;Nc(t)&&!Gc(t);){if(Hc(t))return t;if(Lc(t))return null;t=Jc(t)}return null}function Wc(){return Vc??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Vc}function Gc(e){return/^(html|body|#document)$/.test(Oc(e))}function Kc(e){return kc(e).getComputedStyle(e)}function qc(e){return Mc(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jc(e){if(Oc(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Pc(e)&&e.host||Ac(e);return Pc(t)?t.host:t}function Yc(e){let t=Jc(e);return Gc(t)?(e.ownerDocument||e).body:Nc(t)&&Fc(t)?t:Yc(t)}function Xc(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Yc(e),i=r===e.ownerDocument?.body,a=kc(r);if(i){let e=Zc(a);return t.concat(a,a.visualViewport||[],Fc(r)?r:[],e&&n?Xc(e):[])}return t.concat(r,Xc(r,[],n))}function Zc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Qc(e){let t=Kc(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Nc(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ys(n)!==a||Ys(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function $c(e){return Mc(e)?e:e.contextElement}function el(e){let t=$c(e);if(!Nc(t))return Zs(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Qc(t),o=(a?Ys(n.width):n.width)/r,s=(a?Ys(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var tl=Zs(0);function nl(e){let t=kc(e);return!Wc()||!t.visualViewport?tl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rl(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===kc(e)}function il(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=$c(e),o=Zs(1);t&&(r?Mc(r)&&(o=el(r)):o=el(e));let s=rl(a,n,r)?nl(a):Zs(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=kc(a),t=Mc(r)?kc(r):r,n=e,i=Zc(n);for(;i&&t!==n;){let e=el(i),t=i.getBoundingClientRect(),r=Kc(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=kc(i),i=Zc(n)}}return vc({width:u,height:d,x:c,y:l})}function al(e,t){let n=qc(e).scrollLeft;return t?t.left+n:il(Ac(e)).left+n}function ol(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-al(e,n),y:n.top+t.scrollTop}}function sl(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ac(r),s=t?Lc(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Zs(1),u=Zs(0),d=Nc(r);if((d||!a)&&((Oc(r)!==`body`||Fc(o))&&(c=qc(r)),d)){let e=il(r);l=el(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ol(o,c):Zs(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function cl(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ll(e){let t=qc(e),n=e.ownerDocument.body,r=Js(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Js(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+al(e),o=-t.scrollTop;return Kc(n).direction===`rtl`&&(a+=Js(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ul=25;function dl(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=kc(e),a=Ac(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Wc()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(al(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ul&&(s-=o)}return{width:s,height:c,x:l,y:u}}function fl(e,t){let n=il(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=el(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function pl(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=dl(e,n,t);else if(t===`document`)r=ll(Ac(e));else if(Mc(t))r=fl(t,n);else{let n=nl(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return vc(r)}function ml(e,t){let n=t.get(e);if(n)return n;let r=Xc(e,[],!1).filter(e=>Mc(e)&&Oc(e)!==`body`),i=null,a=Kc(e).position===`fixed`,o=a?Jc(e):e;for(;Mc(o)&&!Gc(o);){let e=Kc(o),t=Hc(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Jc(o)}return t.set(e,r),r}function hl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Lc(t)?[]:ml(t,this._c):[].concat(n),r],o=pl(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=pl(t,a[e],i);s=Js(n.top,s),c=qs(n.right,c),l=qs(n.bottom,l),u=Js(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function gl(e){let{width:t,height:n}=Qc(e);return{width:t,height:n}}function _l(e,t,n){let r=Nc(t),i=Ac(t),a=n===`fixed`,o=il(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Zs(0);if((r||!a)&&((Oc(t)!==`body`||Fc(i))&&(s=qc(t)),r)){let e=il(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=al(i));let l=i&&!r&&!a?ol(i,s):Zs(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function vl(e){return Kc(e).position===`static`}function yl(e,t){if(!Nc(e)||Kc(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ac(e)===n&&(n=n.ownerDocument.body),n}function bl(e,t){let n=kc(e);if(Lc(e))return n;if(!Nc(e)){let t=Jc(e);for(;t&&!Gc(t);){if(Mc(t)&&!vl(t))return t;t=Jc(t)}return n}let r=yl(e,t);for(;r&&Ic(r)&&vl(r);)r=yl(r,t);return r&&Gc(r)&&vl(r)&&!Hc(r)?n:r||Uc(e)||n}var xl=async function(e){let t=this.getOffsetParent||bl,n=this.getDimensions,r=await n(e.floating);return{reference:_l(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Sl(e){return Kc(e).direction===`rtl`}var Cl={convertOffsetParentRelativeRectToViewportRelativeRect:sl,getDocumentElement:Ac,getClippingRect:hl,getOffsetParent:bl,getElementRects:xl,getClientRects:cl,getDimensions:gl,getScale:el,isElement:Mc,isRTL:Sl};function wl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Tl(e,t,n){let r=null,i,a=Ac(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Xs(d),h=Xs(a.clientWidth-(u+f)),g=Xs(a.clientHeight-(d+p)),_=Xs(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Js(0,qs(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!wl(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=kc(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function El(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=$c(e),u=i||a?[...l?Xc(l):[],...t?Xc(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Tl(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?il(e):null;c&&g();function g(){let t=il(e);h&&!wl(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Dl=Ec,Ol=Cc,kl=(e,t,n)=>{let r=new Map,i=n??{},a={...Cl,...i.platform,_c:r};return Sc(e,t,{...i,platform:a})};function Al(e){let{char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:o}=e,s=n&&!r,c=h(t),l=RegExp(`\\s${c}$`),u=a?`^`:``,d=r?``:c,f=RegExp(s?`${u}${c}.*?(?=\\s${d}|$)`:`${u}(?:^)?${c}[^\\s${d}]*`,`gm`),p=o.nodeBefore?.isText&&o.nodeBefore.text;if(!p)return null;let m=o.pos-p.length,g=Array.from(p.matchAll(f)).pop();if(!g||g.input===void 0||g.index===void 0)return null;let _=g.input.slice(Math.max(0,g.index-1),g.index),v=RegExp(`^[${i?.join(``)}\0]?$`).test(_);if(i!==null&&!v)return null;let y=m+g.index,b=y+g[0].length;return s&&l.test(p.slice(b-1,b+1))&&(g[0]+=` `,b+=1),y<o.pos&&b>=o.pos?{range:{from:y,to:b},query:g[0].slice(t.length),text:g[0]}:null}function jl(e){return e.docChanged?e.steps.some(e=>{let t=e.slice;if(!t?.content)return!1;let n=t.content.textBetween(0,t.content.size,`
|
|
53
53
|
`);return/\s/.test(n)}):!1}function Ml(e){return()=>{let t=e.state.selection.$anchor.pos,{top:n,right:r,bottom:i,left:a}=e.view.coordsAtPos(t);try{return new DOMRect(a,n,r-a,i-n)}catch{return null}}}function Nl(e,t,n,r){return n?()=>{let n=r.getState(e.state)?.decorationId;return t.dom.querySelector(`[data-decoration-id="${n}"]`)?.getBoundingClientRect()||null}:Ml(e)}function Pl({match:e,dismissedRange:t,state:n,transaction:r,editor:i,shouldResetDismissed:a,effectiveAllowSpaces:o}){return a?.({editor:i,state:n,range:t,match:e,transaction:r,allowSpaces:o})?!1:o?e.range.from===t.from:e.range.from===t.from&&!jl(r)}function Fl({view:e,pluginKeyRef:t}){let n=e.state.tr.setMeta(t,{exit:!0});e.dispatch(n)}function Il({pluginKey:e,decorationTag:t,decorationClass:n,decorationContent:r,decorationEmptyClass:i,renderer:a,dispatchExit:o}){return{handleKeyDown(t,n){var r;let i=e.getState(t.state);if(!i.active)return!1;if(n.key===`Escape`||n.key===`Esc`){var s;return a==null||(s=a.onKeyDown)==null||s.call(a,{view:t,event:n,range:i.range}),o(t),!0}return(a==null||(r=a.onKeyDown)==null?void 0:r.call(a,{view:t,event:n,range:i.range}))||!1},decorations(a){let{active:o,range:s,decorationId:c,query:l}=e.getState(a);if(!o)return null;let u=!l?.length,d=[n];return u&&d.push(i),fe.create(a.doc,[pe.inline(s.from,s.to,{nodeName:t,class:d.join(` `),"data-decoration-id":c||void 0,"data-decoration-content":r})])}}}function Ll({editor:e,char:t,effectiveAllowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,findSuggestionMatch:o,allow:s,shouldShow:c,shouldKeepDismissed:l,pluginKey:u}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(d,f,p,m){let{isEditable:h}=e,{composing:g}=e.view,{selection:_}=d,{empty:v,from:y}=_,b={...f},x=d.getMeta(u);if(x&&x.exit)return b.active=!1,b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null,b.dismissedRange=f.active?{...f.range}:f.dismissedRange,b;if(b.composing=g,d.docChanged&&b.dismissedRange!==null&&(b.dismissedRange={from:d.mapping.map(b.dismissedRange.from),to:d.mapping.map(b.dismissedRange.to)}),h&&(v||e.view.composing)){(y<f.range.from||y>f.range.to)&&!g&&!f.composing&&(b.active=!1);let u=o({char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:_.$from}),p=`id_${Math.floor(Math.random()*4294967295)}`;u&&s({editor:e,state:m,range:u.range,isActive:f.active})&&(!c||c({editor:e,range:u.range,query:u.query,text:u.text,transaction:d}))?(b.dismissedRange!==null&&!l({match:u,dismissedRange:b.dismissedRange,state:m,transaction:d})&&(b.dismissedRange=null),b.dismissedRange===null?(b.active=!0,b.decorationId=f.decorationId||p,b.range=u.range,b.query=u.query,b.text=u.text):b.active=!1):(u||(b.dismissedRange=null),b.active=!1)}else b.active=!1;return b.active||(b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null),b}}}function Rl({editor:e,items:t}){let n=null,r=null,i=null,a=()=>{r!==null&&(clearTimeout(r),r=null),i?.(),i=null},o=e=>new Promise(t=>{i=t,r=setTimeout(()=>{r=null;let e=i;i=null,e?.()},e)}),s=()=>{n?.abort(),a(),n=null};return{abort:s,fetch:async(r,i)=>{s(),n=new AbortController;let a=n;if(i>0&&await o(i),n!==a||a.signal.aborted)return{status:`aborted`};try{let i=await t({editor:e,query:r,signal:a.signal});return n!==a||a.signal.aborted?{status:`aborted`}:{status:`resolved`,items:i}}catch{return n!==a||a.signal.aborted?{status:`aborted`}:{status:`error`}}}}}function zl({placement:e,offset:t,flip:n,floatingUi:r}){var i;let a=[Dl({mainAxis:t.mainAxis??4,crossAxis:t.crossAxis??0})];return n&&a.push(Ol()),r!=null&&(i=r.middleware)!=null&&i.length&&a.push(...r.middleware),{placement:e,strategy:r?.strategy??`absolute`,middleware:a}}function Bl(e){if(e instanceof HTMLElement)return e;if(typeof e==`string`)try{let t=document.querySelector(e);if(t)return t}catch{return document.body}return document.body}function Vl({getReferenceRect:e,contextElement:t,config:n,container:r,dismissOnOutsideClick:i,dismiss:a}){return(o,s={})=>{let c={getBoundingClientRect:()=>e()??new DOMRect,contextElement:t},l=!1,u=!o.isConnected;u&&Bl(r).appendChild(o),s.onPosition||(o.style.visibility=`hidden`,o.style.width=`max-content`);let d=El(c,o,()=>{kl(c,o,{placement:n.placement,strategy:n.strategy,middleware:n.middleware}).then(({x:e,y:t,placement:n,strategy:r})=>{s.onPosition?s.onPosition({x:e,y:t,placement:n,strategy:r}):(Object.assign(o.style,{position:r,left:`${e}px`,top:`${t}px`}),l||(l=!0,o.style.visibility=``))})},s.autoUpdate),f;return i&&(f=e=>{let n=e.target;!(n instanceof Node)||o.contains(n)||t.contains(n)||a()},document.addEventListener(`pointerdown`,f,!0)),()=>{d(),f&&document.removeEventListener(`pointerdown`,f,!0),u&&o.remove()}}}function Hl({editor:e,pluginKey:t,items:n,renderer:r,minQueryLength:i,debounce:a,initialItems:o,placement:s,offset:c,container:l,flip:u,floatingUi:d,dismissOnOutsideClick:f,command:p,clientRectFor:m,dispatchExit:h}){let g,_=Rl({editor:e,items:n}),v=zl({placement:s,offset:c,flip:u,floatingUi:d});function y(e,t){switch(e){case`started`:var n;r==null||(n=r.onStart)==null||n.call(r,t);break;case`updated`:var i;r==null||(i=r.onUpdate)==null||i.call(r,t);break;case`stopped`:var a;r==null||(a=r.onExit)==null||a.call(r,t)}}return{update:async(n,d)=>{let b=t.getState(d),x=t.getState(n.state);if(!b||!x)return;let S=null,C=b.query!==x.query,ee=b.text!==x.text,te=b.range.from!==x.range.from||b.range.to!==x.range.to,ne=C||ee||te;if(!b.active&&x.active)S=`started`;else if(b.active&&!x.active)S=`stopped`;else if(x.active&&ne)S=`updated`;else return;let w=S===`stopped`?b:x,T=n.dom.querySelector(`[data-decoration-id="${w.decorationId}"]`),re=m(n,T),ie=i===0||(w.query?w.query.length>=i:!1),ae=(S===`started`||S===`updated`)&&ie;if(g={editor:e,range:w.range,query:w.query||``,text:w.text||``,items:o??[],command:t=>p({editor:e,range:w.range,props:t}),decorationNode:T,clientRect:re,loading:ae,placement:s,offset:{mainAxis:c.mainAxis??4,crossAxis:c.crossAxis??0},container:l,flip:u,floatingUi:v,mount:Vl({getReferenceRect:re,contextElement:n.dom,config:v,container:l,dismissOnOutsideClick:f,dismiss:()=>h(e.view)})},S===`started`){var oe;r==null||(oe=r.onBeforeStart)==null||oe.call(r,g)}if(S===`updated`){var se;r==null||(se=r.onBeforeUpdate)==null||se.call(r,g)}if(S===`started`&&y(S,g),S===`started`||S===`updated`){if(!ae)_.abort(),g={...g,items:o??[],loading:!1};else{g={...g,items:o??[],loading:!0},S=`updated`,y(S,g);let e=await _.fetch(w.query||``,a);if(e.status===`aborted`)return;if(!t.getState(n.state)?.active){_.abort();return}g=e.status===`resolved`?{...g,items:e.items,loading:!1}:{...g,loading:!1}}}S===`stopped`?(_.abort(),y(S,g),g=void 0):S===`updated`&&y(S,g)},destroy:()=>{var e;_.abort(),g&&(r==null||(e=r.onExit)==null||e.call(r,g))}}}var Ul=new N(`suggestion`);function Wl({pluginKey:e=Ul,editor:t,char:n=`@`,allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:a=[` `],startOfLine:o=!1,decorationTag:s=`span`,decorationClass:c=`suggestion`,decorationContent:l=``,decorationEmptyClass:u=`is-empty`,command:d=()=>null,items:f=()=>[],minQueryLength:p=0,debounce:m=0,initialItems:h,placement:g=`bottom-start`,offset:_={},container:v,flip:y=!0,floatingUi:b,dismissOnOutsideClick:x=!0,render:S=()=>({}),allow:C=()=>!0,findSuggestionMatch:ee=Al,shouldShow:te,shouldResetDismissed:ne}){let w=S?.(),T=r&&!i,re=(n,r)=>Nl(t,n,r,e);function ie(e){return Pl({...e,editor:t,shouldResetDismissed:ne,effectiveAllowSpaces:T})}let ae=t=>Fl({view:t,pluginKeyRef:e});return new k({key:e,view:()=>Hl({editor:t,pluginKey:e,items:f,renderer:w,minQueryLength:p,debounce:m,initialItems:h,placement:g,offset:_,container:v,flip:y,floatingUi:b,dismissOnOutsideClick:x,command:d,clientRectFor:re,dispatchExit:ae}),state:Ll({editor:t,char:n,effectiveAllowSpaces:T,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,findSuggestionMatch:ee,allow:C,shouldShow:te,shouldKeepDismissed:ie,pluginKey:e}),props:Il({pluginKey:e,decorationTag:s,decorationClass:c,decorationContent:l,decorationEmptyClass:u,renderer:w,dispatchExit:ae})})}function Gl({editor:e,overrideSuggestionOptions:t,extensionName:n,char:r=`@`}){return{editor:e,char:r,pluginKey:new N,command:({editor:e,range:t,props:i})=>{var a,o;let s=e.view.state.selection.$to.nodeAfter;s!=null&&(a=s.text)!=null&&a.startsWith(` `)&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:n,attrs:{...i,mentionSuggestionChar:r}},{type:`text`,text:` `}]).run(),(o=e.view.dom.ownerDocument.defaultView)==null||(o=o.getSelection())==null||o.collapseToEnd()},allow:({state:e,range:t})=>{let r=e.doc.resolve(t.from),i=e.schema.nodes[n];return!!r.parent.type.contentMatch.matchType(i)},...t}}function Kl(e){return(e.options.suggestions.length?e.options.suggestions:[e.options.suggestion]).map(t=>Gl({editor:e.editor,overrideSuggestionOptions:t,extensionName:e.name,char:t.char}))}function ql(e,t){let n=Kl(e);return n.find(e=>e.char===t)||(n.length?n[0]:null)}var Jl=j.create({name:`mention`,priority:101,addOptions(){return{HTMLAttributes:{},renderText({node:e,suggestion:t}){return`${t?.char??`@`}${e.attrs.label??e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:e,node:t,suggestion:n}){return[`span`,O(this.HTMLAttributes,e.HTMLAttributes),`${n?.char??`@`}${t.attrs.label??t.attrs.id}`]},suggestions:[],suggestion:{}}},group:`inline`,inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute(`data-id`),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute(`data-label`),renderHTML:e=>e.label?{"data-label":e.label}:{}},mentionSuggestionChar:{default:`@`,parseHTML:e=>e.getAttribute(`data-mention-suggestion-char`),renderHTML:e=>({"data-mention-suggestion-char":e.mentionSuggestionChar})}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){let n=ql(this,e.attrs.mentionSuggestionChar);if(this.options.renderLabel!==void 0)return console.warn(`renderLabel is deprecated use renderText and renderHTML instead`),[`span`,O({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e,suggestion:n})];let r={...this.options};r.HTMLAttributes=O({"data-type":this.name},this.options.HTMLAttributes,t);let i=this.options.renderHTML({options:r,node:e,suggestion:n});return typeof i==`string`?[`span`,O({"data-type":this.name},this.options.HTMLAttributes,t),i]:i},...D({nodeName:`mention`,name:`@`,selfClosing:!0,allowedAttributes:[`id`,`label`,{name:`mentionSuggestionChar`,skipIfDefault:`@`}],parseAttributes:e=>{let t={},n=/(?:^|\s)(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i===`char`?`mentionSuggestionChar`:i]=a??o,r=n.exec(e)}return t},serializeAttributes:e=>Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e===`mentionSuggestionChar`?`char`:e}="${t}"`).join(` `)}),renderText({node:e}){let t={options:this.options,node:e,suggestion:ql(this,e.attrs.mentionSuggestionChar)};return this.options.renderLabel===void 0?this.options.renderText(t):(console.warn(`renderLabel is deprecated use renderText and renderHTML instead`),this.options.renderLabel(t))},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let n=!1,{selection:r}=t,{empty:i,anchor:a}=r;if(!i)return!1;let s=new o,c=0;return t.doc.nodesBetween(a-1,a,(e,t)=>{if(e.type.name===this.name)return n=!0,s=e,c=t,!1}),n&&e.insertText(this.options.deleteTriggerWithBackspace?``:s.attrs.mentionSuggestionChar,c,c+s.nodeSize),n})}},addProseMirrorPlugins(){return Kl(this).map(Wl)}});function Yl(e,t){this.v=e,this.k=t}function Xl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Zl(e){if(Array.isArray(e))return e}function Ql(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function $l(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
54
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eu(e,t){return Zl(e)||Ql(e,t)||tu(e,t)||$l()}function tu(e,t){if(e){if(typeof e==`string`)return Xl(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xl(e,t):void 0}}function nu(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof Yl;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}nu.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},nu.prototype.next=function(e){return this._invoke(`next`,e)},nu.prototype.throw=function(e){return this._invoke(`throw`,e)},nu.prototype.return=function(e){return this._invoke(`return`,e)};var ru=Object.entries,iu=Object.setPrototypeOf,au=Object.isFrozen,ou=Object.getPrototypeOf,su=Object.getOwnPropertyDescriptor,W=Object.freeze,G=Object.seal,cu=Object.create,lu=typeof Reflect<`u`&&Reflect,uu=lu.apply,du=lu.construct;W||=function(e){return e},G||=function(e){return e},uu||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},du||=function(e){return new e(...[...arguments].slice(1))};var fu=q(Array.prototype.forEach);Array.prototype.indexOf;var pu=q(Array.prototype.lastIndexOf),mu=q(Array.prototype.pop),hu=q(Array.prototype.push),gu=q(Array.prototype.slice),_u=q(Array.prototype.splice),vu=Array.isArray,yu=Fu(Set),bu=q(Set.prototype.add),xu=q(Set.prototype.has),Su=q(String.prototype.toLowerCase),Cu=q(String.prototype.toString),wu=q(String.prototype.match),Tu=q(String.prototype.replace),Eu=q(String.prototype.indexOf),Du=q(String.prototype.trim),Ou=q(Number.prototype.toString),ku=q(Boolean.prototype.toString),Au=typeof BigInt>`u`?null:q(BigInt.prototype.toString),ju=typeof Symbol>`u`?null:q(Symbol.prototype.toString),Mu=q(Object.prototype.hasOwnProperty),Nu=q(Object.prototype.toString),K=q(RegExp.prototype.test),Pu=Fu(TypeError);function q(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return uu(e,t,n)}}function Fu(e){return function(){return du(e,[...arguments])}}function J(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Su;if(iu&&iu(e,null),!vu(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(au(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Iu(e){for(let t=0;t<e.length;t++)Mu(e,t)||(e[t]=null);return e}function Lu(e){let t=cu(null);for(let r of ru(e)){var n=eu(r,2);let i=n[0],a=n[1];Mu(e,i)&&(t[i]=vu(a)?Iu(a):a&&typeof a==`object`&&a.constructor===Object?Lu(a):a)}return t}function Ru(e){switch(typeof e){case`string`:return e;case`number`:return Ou(e);case`boolean`:return ku(e);case`bigint`:return Au?Au(e):`0`;case`symbol`:return ju?ju(e):`Symbol()`;case`undefined`:return Nu(e);case`function`:case`object`:{if(e===null)return Nu(e);let t=e,n=zu(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Nu(e)}return Nu(e)}default:return Nu(e)}}function zu(e,t){for(;e!==null;){let n=su(e,t);if(n){if(n.get)return q(n.get);if(typeof n.value==`function`)return q(n.value)}e=ou(e)}function n(){return null}return n}function Bu(e,t){for(;e!==null;){let n=su(e,t);if(n)return n.get?q(n.get):null;e=ou(e)}return null}function Vu(e){try{return K(e,``),!0}catch{return!1}}var Hu=W(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Uu=W(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Wu=W([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Gu=W([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Ku=W(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),qu=W([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Ju=W([`#text`]),Yu=W(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Xu=W(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Zu=W(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Qu=W([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),$u=G(/{{[\w\W]*|^[\w\W]*}}/g),ed=G(/<%[\w\W]*|^[\w\W]*%>/g),td=G(/\${[\w\W]*/g),nd=G(/^data-[\-\w.\u00B7-\uFFFF]+$/),rd=G(/^aria-[\-\w]+$/),id=G(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ad=G(/^(?:\w+script|data):/i),od=G(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),sd=G(/^html$/i),cd=G(/^[a-z][.\w]*(-[.\w]+)+$/i),ld=G(/<[/\w!]/g),ud=G(/<[/\w]/g),dd=G(/<\/no(script|embed|frames)/i),fd=G(/\/>/i),Y={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},pd=W(J({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),md=function(){return typeof window>`u`?null:window},hd=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},gd=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},_d=function(e,t,n,r){return Mu(e,t)&&vu(e[t])?J(r.base?Lu(r.base):{},e[t],r.transform):n},vd=function(e,t,n){let r=Mu(e,t)?e[t]:void 0;return r&&typeof r==`object`?Lu(r):n()};function yd(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:md(),t=e=>yd(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==Y.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=zu(d,`cloneNode`),p=zu(d,`remove`),m=zu(d,`removeAttributeNode`),h=zu(d,`nextSibling`),g=zu(d,`childNodes`),_=zu(d,`parentNode`),v=zu(d,`shadowRoot`),y=zu(d,`attributes`),b=o&&o.prototype?zu(o.prototype,`nodeType`):null,x=o&&o.prototype?zu(o.prototype,`nodeName`):null,S=o&&o.prototype?zu(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},ee=function(e){return x?x(e):e.nodeName},te=Bu(d,`namespaceURI`),ne=function(e){return te?te(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let w,T=``,re,ie=!1,ae=0,oe=function(){if(ae>0)throw Pu(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},se=function(e){oe(),ae++;try{return w.createHTML(e)}finally{ae--}},E=function(e){oe(),ae++;try{return w.createScriptURL(e)}finally{ae--}},ce=function(){return ie||=(re=hd(u,i),!0),re},le=n,ue=le.implementation,de=le.createNodeIterator,fe=le.createDocumentFragment,pe=le.getElementsByTagName,me=r.importNode,D=gd();t.isSupported=typeof ru==`function`&&typeof _==`function`&&ue&&ue.createHTMLDocument!==void 0;let he=$u,ge=ed,_e=td,ve=nd,O=rd,ye=ad,be=od,xe=cd,k=id,A=null,j=J({},[...Hu,...Uu,...Wu,...Ku,...Ju]),M=null,Se=J({},[...Yu,...Xu,...Zu,...Qu]),N=Object.seal(cu(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ce=null,we=null,Te=Object.seal(cu(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ee=!0,De=!0,Oe=!1,ke=!0,Ae=!1,je=!0,Me=!1,Ne=!1,Pe=null,Fe=null,Ie=!1,Le=!1,Re=!1,ze=!1,Be=!0,Ve=!1,He=`user-content-`,Ue=!0,We=!1,Ge=null,Ke={},qe=null,Je=J({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ye=null,Xe=J({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ze=null,Qe=J({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),$e=`http://www.w3.org/1998/Math/MathML`,et=`http://www.w3.org/2000/svg`,tt=`http://www.w3.org/1999/xhtml`,nt=tt,rt=!1,it=null,at=J({},[$e,et,tt],Cu),ot=W([`mi`,`mo`,`mn`,`ms`,`mtext`]),st=J({},ot),ct=W([`annotation-xml`]),lt=J({},ct),ut=J({},[`title`,`style`,`font`,`a`,`script`]),dt=null,ft=[`application/xhtml+xml`,`text/html`],P=null,pt=null,mt=n.createElement(`form`),ht=function(e){return e instanceof RegExp||e instanceof Function},F=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pt&&pt===e)return;(!e||typeof e!=`object`)&&(e={}),e=Lu(e),dt=ft.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,P=dt===`application/xhtml+xml`?Cu:Su,A=_d(e,`ALLOWED_TAGS`,j,{transform:P}),M=_d(e,`ALLOWED_ATTR`,Se,{transform:P}),it=_d(e,`ALLOWED_NAMESPACES`,at,{transform:Cu}),Ze=_d(e,`ADD_URI_SAFE_ATTR`,Qe,{transform:P,base:Qe}),Ye=_d(e,`ADD_DATA_URI_TAGS`,Xe,{transform:P,base:Xe}),qe=_d(e,`FORBID_CONTENTS`,Je,{transform:P}),Ce=_d(e,`FORBID_TAGS`,Lu({}),{transform:P}),we=_d(e,`FORBID_ATTR`,Lu({}),{transform:P}),Ke=Mu(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Lu(e.USE_PROFILES):e.USE_PROFILES:!1,Ee=e.ALLOW_ARIA_ATTR!==!1,De=e.ALLOW_DATA_ATTR!==!1,Oe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ae=e.SAFE_FOR_TEMPLATES||!1,je=e.SAFE_FOR_XML!==!1,Me=e.WHOLE_DOCUMENT||!1,Le=e.RETURN_DOM||!1,Re=e.RETURN_DOM_FRAGMENT||!1,ze=e.RETURN_TRUSTED_TYPE||!1,Ie=e.FORCE_BODY||!1,Be=e.SANITIZE_DOM!==!1,Ve=e.SANITIZE_NAMED_PROPS||!1,Ue=e.KEEP_CONTENT!==!1,We=e.IN_PLACE||!1,k=Vu(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:id,nt=typeof e.NAMESPACE==`string`?e.NAMESPACE:tt,st=vd(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>J({},ot)),lt=vd(e,`HTML_INTEGRATION_POINTS`,()=>J({},ct));let t=vd(e,`CUSTOM_ELEMENT_HANDLING`,()=>cu(null));if(N=cu(null),Mu(t,`tagNameCheck`)&&ht(t.tagNameCheck)&&(N.tagNameCheck=t.tagNameCheck),Mu(t,`attributeNameCheck`)&&ht(t.attributeNameCheck)&&(N.attributeNameCheck=t.attributeNameCheck),Mu(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(N.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),G(N),Ae&&(De=!1),Re&&(Le=!0),Ke&&(A=J({},Ju),M=cu(null),Ke.html===!0&&(J(A,Hu),J(M,Yu)),Ke.svg===!0&&(J(A,Uu),J(M,Xu),J(M,Qu)),Ke.svgFilters===!0&&(J(A,Wu),J(M,Xu),J(M,Qu)),Ke.mathMl===!0&&(J(A,Ku),J(M,Zu),J(M,Qu))),Te.tagCheck=null,Te.attributeCheck=null,Mu(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Te.tagCheck=e.ADD_TAGS:vu(e.ADD_TAGS)&&(A===j&&(A=Lu(A)),J(A,e.ADD_TAGS,P))),Mu(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Te.attributeCheck=e.ADD_ATTR:vu(e.ADD_ATTR)&&(M===Se&&(M=Lu(M)),J(M,e.ADD_ATTR,P))),Mu(e,`ADD_FORBID_CONTENTS`)&&vu(e.ADD_FORBID_CONTENTS)&&(qe===Je&&(qe=Lu(qe)),J(qe,e.ADD_FORBID_CONTENTS,P)),Ue&&(A[`#text`]=!0),Me&&J(A,[`html`,`head`,`body`]),A.table&&(J(A,[`tbody`]),delete Ce.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Pu(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Pu(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=w;w=e.TRUSTED_TYPES_POLICY;try{T=se(``)}catch(e){throw w=t,e}}else e.TRUSTED_TYPES_POLICY===null?(w=void 0,T=``):(w===void 0&&(w=ce()),w&&typeof T==`string`&&(T=se(``)));W&&W(e),pt=e},I=J({},[...Uu,...Wu,...Gu]),L=J({},[...Ku,...qu]),gt=function(e,t,n){return t.namespaceURI===tt?e===`svg`:t.namespaceURI===$e?e===`svg`&&(n===`annotation-xml`||st[n]):!!I[e]},R=function(e,t,n){return t.namespaceURI===tt?e===`math`:t.namespaceURI===et?e===`math`&<[n]:!!L[e]},_t=function(e,t,n){return t.namespaceURI===et&&!lt[n]||t.namespaceURI===$e&&!st[n]?!1:!L[e]&&(ut[e]||!I[e])},vt=function(e){let t=ne(e),n=Su(ee(e)),r=_(e),i,a;return r&&C(r)===Y.element?(i={namespaceURI:ne(r)},a=Su(ee(r))):(i={namespaceURI:nt},a=`template`),it[t]?t===et?gt(n,i,a):t===$e?R(n,i,a):t===tt?_t(n,i,a):!!(dt===`application/xhtml+xml`&&it[t]):!1},yt=function(e){hu(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw Pu(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},bt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},xt=function(e){Tt(e);let t=g(e);t&&fu(gu(t),e=>{try{p(e)}catch{}});let n=C(e)===Y.element?y(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&bt(e,r,i)}},St=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}hu(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Le||Re)try{yt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Ct=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||M[P(i)]||bt(e,r,i)}},wt=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&C(e)===Y.element){let t=v(e);Bt(t)&&r.push(t)}let i=g(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},Tt=function(e){wt(e,e=>{C(e)===Y.element&&Ct(e)})},Et=function(e){let t=[];return wt(e,e=>{t.push(e)},!0),t},Dt=function(e,t){let n=yu();fu(Et(e),e=>{C(e)===Y.element&&bu(n,e)}),fu(t,e=>{C(e)===Y.element&&!xu(n,e)&&Ct(e)})},Ot=function(e,n){let r=!1;return fu(t.removed,t=>{t.element&&(r||=t.element===e,Tt(t.element))}),Dt(e,n),r},kt=function(e,t){let n=Ge,r=null,i=()=>(r||(r=yu(),fu(t,e=>{bu(r,e)})),r);for(let t=0;;t++){let r=Et(e),a=[e],o=!1;if(fu(r,e=>{C(e)===Y.documentFragment?hu(a,e):!o&&!xu(n,e)&&(o=xu(i(),e))}),!o)return;if(t>=8)throw Pu(`the tree kept changing during in-place sanitization; refusing to return it`);fu(a,(t,n)=>{At(t,n>0,e,i())})}},At=function(e,t,n,r){let i=Ft(e),a;for(;a=i.nextNode();)xu(r,a)&&!xu(Ge,a)&&(t&&z(D.uponSanitizeShadowNode,a,null),qt(a,n),en(a,n),Bt(a.content)&&tn(a.content))},jt=function(e){Ge&&bu(Ge,e)},Mt=function(e,t){return je?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Nt=function(e){je&&wt(e,e=>{let t=C(e);if(t===Y.processingInstruction||t===Y.comment&&K(ud,e.data)){try{p(e)}catch{}return!1}if(t===Y.element){let t=e,n=P(ee(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Mt(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},Pt=function(e){let t=null,r=null;if(Ie)e=`<remove></remove>`+e;else{let t=wu(e,/^[\r\n\t ]+/);r=t&&t[0]}dt===`application/xhtml+xml`&&nt===tt&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=w?se(e):e;if(nt===tt)try{t=new l().parseFromString(i,dt)}catch{}if(!t||!t.documentElement){t=ue.createDocument(nt,`template`,null);try{t.documentElement.innerHTML=rt?T:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),nt===tt?pe.call(t,Me?`html`:`body`)[0]:Me?t.documentElement:a},Ft=function(e){let t=S?S(e):e.ownerDocument;return de.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},It=function(e){return e=Tu(e,he,` `),e=Tu(e,ge,` `),e=Tu(e,_e,` `),e},Lt=function(e){Rt(e);let t=e.querySelectorAll?.call(e,`template`);t&&fu(t,e=>{Bt(e.content)&&Lt(e.content)})},Rt=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=de.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=It(r.data),r=n.nextNode()},zt=function(e){let t=x?x(e):null;return typeof t!=`string`||P(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Bt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===Y.documentFragment}catch{return!1}},Vt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function z(e,n,r){e.length!==0&&fu(e,e=>{e.call(t,n,r,pt)})}let Ht=function(e,t){return!!(je&&e.hasChildNodes()&&!Vt(e.firstElementChild)&&K(ld,e.textContent)&&K(ld,e.innerHTML)||je&&pd[t]&&C(e)===Y.element&&ne(e)===tt&&(Vt(e.firstElementChild)||typeof e.textContent==`string`&&K(ld,e.textContent))||e.nodeType===Y.processingInstruction||je&&e.nodeType===Y.comment&&K(ud,e.data))},Ut=function(e,t){return e instanceof RegExp?K(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Wt=function(e,t,n){if(!Ce[t]&&Xt(t)&&Ut(N.tagNameCheck,t))return!1;if(Ue&&!qe[t]&&!qe[Su(t)]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return yt(e),!0},Gt=function(e,t,n,r){return e.length===0?t:t===n||t===r?Lu(t):t},Kt=function(e,t){return e===t||_(e)!==null?!1:(We&&Tt(e),!0)},qt=function(e,n){if(jt(e),z(D.beforeSanitizeElements,e,null),Kt(e,n))return!0;if(zt(e))return yt(e),!0;let r=P(ee(e));if(A=Gt(D.uponSanitizeElement,A,j,Pe),z(D.uponSanitizeElement,e,{tagName:r,allowedTags:A}),Kt(e,n))return!0;if(Ht(e,r))return yt(e),!0;if(Ce[r]||!(Te.tagCheck instanceof Function&&Te.tagCheck(r))&&!A[r]){let t=Wt(e,r,n);return t===!1&&(z(D.afterSanitizeElements,e,null),Kt(e,n))?!0:t}if(C(e)===Y.element&&!vt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&K(dd,e.innerHTML))return yt(e),!0;if(Ae&&e.nodeType===Y.text){let n=It(e.textContent);e.textContent!==n&&(hu(t.removed,{element:e.cloneNode()}),e.textContent=n)}return z(D.afterSanitizeElements,e,null),Kt(e,n)},Jt=function(e,t,r){if(we[t]||Mt(t,e)||Be&&(t===`id`||t===`name`)&&(r in n||r in mt))return!1;let i=M[t]||Te.attributeCheck instanceof Function&&Te.attributeCheck(t,e);return De&&K(ve,t)||Ee&&K(O,t)?!0:i?Ze[t]||K(k,Tu(r,be,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Eu(r,`data:`)===0&&Ye[e]||Oe&&!K(ye,Tu(r,be,``))?!0:!r:Xt(e)&&Ut(N.tagNameCheck,e)&&Ut(N.attributeNameCheck,t,e)||t===`is`&&N.allowCustomizedBuiltInElements&&Ut(N.tagNameCheck,r)},Yt=J({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Xt=function(e){return!Yt[Su(e)]&&K(xe,e)},Zt=function(e,t,n,r){if(w&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return se(r);case`TrustedScriptURL`:return E(r)}return r},Qt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!zt(e)||(yt(e),!1)}catch{return St(t,e),!1}},$t=function(e,t){return je&&K(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:Su(e)===`attributename`&&wu(t,`href`)!==null},en=function(e,n){if(z(D.beforeSanitizeAttributes,e,null),Kt(e,n))return;let r=e.attributes;if(!r||zt(e))return;M=Gt(D.uponSanitizeAttribute,M,Se,Fe);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0},a=r.length,o=P(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=P(s),d=l,f=s===`value`?d:Du(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,z(D.uponSanitizeAttribute,e,i),f=i.attrValue,Ve&&(u===`id`||u===`name`)&&Eu(f,He)!==0&&(St(s,e,n),f=He+f,p=!0),$t(s,f)?St(s,e,n):i.forceKeepAttr||(i.keepAttr?!ke&&K(fd,f)?St(s,e,n):(Ae&&(f=It(f)),Jt(o,u,f)?(f=Zt(o,u,c,f),f!==d&&Qt(e,s,c,f)&&p&&mu(t.removed)):St(s,e,n)):St(s,e,n))}z(D.afterSanitizeAttributes,e,null),Kt(e,n)},tn=function(e){let t=null,n=Ft(e);for(z(D.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(z(D.uponSanitizeShadowNode,t,null),qt(t,e),en(t,e),Bt(t.content)&&tn(t.content),C(t)===Y.element){let e=v(t);Bt(e)&&(nn(e),tn(e))}Ae&&Rt(e),z(D.afterSanitizeShadowDOM,e,null)},nn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){tn(e.shadow);continue}let n=e.node,r=C(n)===Y.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&P(e)===`template`){let e=n.content;Bt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Bt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(rt=!e,rt&&(e=`<!-->`),typeof e!=`string`&&!Vt(e)&&(e=Ru(e),typeof e!=`string`))throw Pu(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ne?(A=Pe,M=Fe):F(n),(D.uponSanitizeElement.length>0||D.uponSanitizeAttribute.length>0)&&(A=Lu(A)),D.uponSanitizeAttribute.length>0&&(M=Lu(M)),t.removed=[];let c=We&&typeof e!=`string`&&Vt(e),l=[],u=Ge;if(c){Nt(e);let t=ee(e);if(typeof t==`string`){let n=P(t);if(!A[n]||Ce[n])throw xt(e),Pu(`root node is forbidden and cannot be sanitized in-place`)}if(zt(e))throw xt(e),Pu(`root node is clobbered and cannot be sanitized in-place`);l=Et(e),Ge=yu()}else if(Vt(e))i=Pt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Y.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),nn(i);else{if(!Le&&!Ae&&!Me&&e.indexOf(`<`)===-1)return w&&ze?se(e):e;if(i=Pt(e),!i)return Le?null:ze?T:``}i&&Ie&&yt(i.firstChild);let d=c?e:i;try{c&&nn(e);let t=Ft(d);for(;o=t.nextNode();)qt(o,d),en(o,d),Bt(o.content)&&tn(o.content);c&&kt(e,l)}catch(t){throw c&&(xt(e),Ot(e,l)),t}finally{Ge=u}if(c){if(Ot(e,l))throw Pu(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Ae&&Lt(e),e}if(Le){if(Ae&&Lt(i),Re)for(s=fe.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(M.shadowroot||M.shadowrootmode)&&(s=me.call(r,s,!0)),s}let f=Me?i.outerHTML:i.innerHTML;return Me&&A[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&K(sd,i.ownerDocument.doctype.name)&&(f=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
54
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eu(e,t){return Zl(e)||Ql(e,t)||tu(e,t)||$l()}function tu(e,t){if(e){if(typeof e==`string`)return Xl(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xl(e,t):void 0}}function nu(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof Yl;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}nu.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},nu.prototype.next=function(e){return this._invoke(`next`,e)},nu.prototype.throw=function(e){return this._invoke(`throw`,e)},nu.prototype.return=function(e){return this._invoke(`return`,e)};var ru=Object.entries,iu=Object.setPrototypeOf,au=Object.isFrozen,ou=Object.getPrototypeOf,su=Object.getOwnPropertyDescriptor,W=Object.freeze,G=Object.seal,cu=Object.create,lu=typeof Reflect<`u`&&Reflect,uu=lu.apply,du=lu.construct;W||=function(e){return e},G||=function(e){return e},uu||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},du||=function(e){return new e(...[...arguments].slice(1))};var fu=q(Array.prototype.forEach);Array.prototype.indexOf;var pu=q(Array.prototype.lastIndexOf),mu=q(Array.prototype.pop),hu=q(Array.prototype.push),gu=q(Array.prototype.slice),_u=q(Array.prototype.splice),vu=Array.isArray,yu=Fu(Set),bu=q(Set.prototype.add),xu=q(Set.prototype.has),Su=q(String.prototype.toLowerCase),Cu=q(String.prototype.toString),wu=q(String.prototype.match),Tu=q(String.prototype.replace),Eu=q(String.prototype.indexOf),Du=q(String.prototype.trim),Ou=q(Number.prototype.toString),ku=q(Boolean.prototype.toString),Au=typeof BigInt>`u`?null:q(BigInt.prototype.toString),ju=typeof Symbol>`u`?null:q(Symbol.prototype.toString),Mu=q(Object.prototype.hasOwnProperty),Nu=q(Object.prototype.toString),K=q(RegExp.prototype.test),Pu=Fu(TypeError);function q(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return uu(e,t,n)}}function Fu(e){return function(){return du(e,[...arguments])}}function J(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Su;if(iu&&iu(e,null),!vu(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(au(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Iu(e){for(let t=0;t<e.length;t++)Mu(e,t)||(e[t]=null);return e}function Lu(e){let t=cu(null);for(let r of ru(e)){var n=eu(r,2);let i=n[0],a=n[1];Mu(e,i)&&(t[i]=vu(a)?Iu(a):a&&typeof a==`object`&&a.constructor===Object?Lu(a):a)}return t}function Ru(e){switch(typeof e){case`string`:return e;case`number`:return Ou(e);case`boolean`:return ku(e);case`bigint`:return Au?Au(e):`0`;case`symbol`:return ju?ju(e):`Symbol()`;case`undefined`:return Nu(e);case`function`:case`object`:{if(e===null)return Nu(e);let t=e,n=zu(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Nu(e)}return Nu(e)}default:return Nu(e)}}function zu(e,t){for(;e!==null;){let n=su(e,t);if(n){if(n.get)return q(n.get);if(typeof n.value==`function`)return q(n.value)}e=ou(e)}function n(){return null}return n}function Bu(e,t){for(;e!==null;){let n=su(e,t);if(n)return n.get?q(n.get):null;e=ou(e)}return null}function Vu(e){try{return K(e,``),!0}catch{return!1}}var Hu=W(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Uu=W(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Wu=W([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Gu=W([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Ku=W(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),qu=W([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Ju=W([`#text`]),Yu=W(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Xu=W(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Zu=W(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Qu=W([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),$u=G(/{{[\w\W]*|^[\w\W]*}}/g),ed=G(/<%[\w\W]*|^[\w\W]*%>/g),td=G(/\${[\w\W]*/g),nd=G(/^data-[\-\w.\u00B7-\uFFFF]+$/),rd=G(/^aria-[\-\w]+$/),id=G(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ad=G(/^(?:\w+script|data):/i),od=G(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),sd=G(/^html$/i),cd=G(/^[a-z][.\w]*(-[.\w]+)+$/i),ld=G(/<[/\w!]/g),ud=G(/<[/\w]/g),dd=G(/<\/no(script|embed|frames)/i),fd=G(/\/>/i),Y={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},pd=W(J({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),md=function(){return typeof window>`u`?null:window},hd=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},gd=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},_d=function(e,t,n,r){return Mu(e,t)&&vu(e[t])?J(r.base?Lu(r.base):{},e[t],r.transform):n},vd=function(e,t,n){let r=Mu(e,t)?e[t]:void 0;return r&&typeof r==`object`?Lu(r):n()};function yd(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:md(),t=e=>yd(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==Y.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=zu(d,`cloneNode`),p=zu(d,`remove`),m=zu(d,`removeAttributeNode`),h=zu(d,`nextSibling`),g=zu(d,`childNodes`),_=zu(d,`parentNode`),v=zu(d,`shadowRoot`),y=zu(d,`attributes`),b=o&&o.prototype?zu(o.prototype,`nodeType`):null,x=o&&o.prototype?zu(o.prototype,`nodeName`):null,S=o&&o.prototype?zu(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},ee=function(e){return x?x(e):e.nodeName},te=Bu(d,`namespaceURI`),ne=function(e){return te?te(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let w,T=``,re,ie=!1,ae=0,oe=function(){if(ae>0)throw Pu(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},se=function(e){oe(),ae++;try{return w.createHTML(e)}finally{ae--}},E=function(e){oe(),ae++;try{return w.createScriptURL(e)}finally{ae--}},ce=function(){return ie||=(re=hd(u,i),!0),re},le=n,ue=le.implementation,de=le.createNodeIterator,fe=le.createDocumentFragment,pe=le.getElementsByTagName,me=r.importNode,D=gd();t.isSupported=typeof ru==`function`&&typeof _==`function`&&ue&&ue.createHTMLDocument!==void 0;let he=$u,ge=ed,_e=td,ve=nd,O=rd,ye=ad,be=od,xe=cd,k=id,A=null,j=J({},[...Hu,...Uu,...Wu,...Ku,...Ju]),M=null,Se=J({},[...Yu,...Xu,...Zu,...Qu]),N=Object.seal(cu(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ce=null,we=null,Te=Object.seal(cu(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ee=!0,De=!0,Oe=!1,ke=!0,Ae=!1,je=!0,Me=!1,Ne=!1,Pe=null,Fe=null,Ie=!1,Le=!1,Re=!1,ze=!1,Be=!0,Ve=!1,He=`user-content-`,Ue=!0,We=!1,Ge=null,Ke={},qe=null,Je=J({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ye=null,Xe=J({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ze=null,Qe=J({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),$e=`http://www.w3.org/1998/Math/MathML`,et=`http://www.w3.org/2000/svg`,tt=`http://www.w3.org/1999/xhtml`,nt=tt,rt=!1,it=null,at=J({},[$e,et,tt],Cu),ot=W([`mi`,`mo`,`mn`,`ms`,`mtext`]),st=J({},ot),ct=W([`annotation-xml`]),lt=J({},ct),ut=J({},[`title`,`style`,`font`,`a`,`script`]),dt=null,ft=[`application/xhtml+xml`,`text/html`],P=null,pt=null,mt=n.createElement(`form`),ht=function(e){return e instanceof RegExp||e instanceof Function},F=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pt&&pt===e)return;e&&typeof e==`object`||(e={}),e=Lu(e),dt=ft.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,P=dt===`application/xhtml+xml`?Cu:Su,A=_d(e,`ALLOWED_TAGS`,j,{transform:P}),M=_d(e,`ALLOWED_ATTR`,Se,{transform:P}),it=_d(e,`ALLOWED_NAMESPACES`,at,{transform:Cu}),Ze=_d(e,`ADD_URI_SAFE_ATTR`,Qe,{transform:P,base:Qe}),Ye=_d(e,`ADD_DATA_URI_TAGS`,Xe,{transform:P,base:Xe}),qe=_d(e,`FORBID_CONTENTS`,Je,{transform:P}),Ce=_d(e,`FORBID_TAGS`,Lu({}),{transform:P}),we=_d(e,`FORBID_ATTR`,Lu({}),{transform:P}),Ke=Mu(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Lu(e.USE_PROFILES):e.USE_PROFILES:!1,Ee=e.ALLOW_ARIA_ATTR!==!1,De=e.ALLOW_DATA_ATTR!==!1,Oe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ae=e.SAFE_FOR_TEMPLATES||!1,je=e.SAFE_FOR_XML!==!1,Me=e.WHOLE_DOCUMENT||!1,Le=e.RETURN_DOM||!1,Re=e.RETURN_DOM_FRAGMENT||!1,ze=e.RETURN_TRUSTED_TYPE||!1,Ie=e.FORCE_BODY||!1,Be=e.SANITIZE_DOM!==!1,Ve=e.SANITIZE_NAMED_PROPS||!1,Ue=e.KEEP_CONTENT!==!1,We=e.IN_PLACE||!1,k=Vu(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:id,nt=typeof e.NAMESPACE==`string`?e.NAMESPACE:tt,st=vd(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>J({},ot)),lt=vd(e,`HTML_INTEGRATION_POINTS`,()=>J({},ct));let t=vd(e,`CUSTOM_ELEMENT_HANDLING`,()=>cu(null));if(N=cu(null),Mu(t,`tagNameCheck`)&&ht(t.tagNameCheck)&&(N.tagNameCheck=t.tagNameCheck),Mu(t,`attributeNameCheck`)&&ht(t.attributeNameCheck)&&(N.attributeNameCheck=t.attributeNameCheck),Mu(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(N.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),G(N),Ae&&(De=!1),Re&&(Le=!0),Ke&&(A=J({},Ju),M=cu(null),Ke.html===!0&&(J(A,Hu),J(M,Yu)),Ke.svg===!0&&(J(A,Uu),J(M,Xu),J(M,Qu)),Ke.svgFilters===!0&&(J(A,Wu),J(M,Xu),J(M,Qu)),Ke.mathMl===!0&&(J(A,Ku),J(M,Zu),J(M,Qu))),Te.tagCheck=null,Te.attributeCheck=null,Mu(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Te.tagCheck=e.ADD_TAGS:vu(e.ADD_TAGS)&&(A===j&&(A=Lu(A)),J(A,e.ADD_TAGS,P))),Mu(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Te.attributeCheck=e.ADD_ATTR:vu(e.ADD_ATTR)&&(M===Se&&(M=Lu(M)),J(M,e.ADD_ATTR,P))),Mu(e,`ADD_FORBID_CONTENTS`)&&vu(e.ADD_FORBID_CONTENTS)&&(qe===Je&&(qe=Lu(qe)),J(qe,e.ADD_FORBID_CONTENTS,P)),Ue&&(A[`#text`]=!0),Me&&J(A,[`html`,`head`,`body`]),A.table&&(J(A,[`tbody`]),delete Ce.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Pu(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Pu(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=w;w=e.TRUSTED_TYPES_POLICY;try{T=se(``)}catch(e){throw w=t,e}}else e.TRUSTED_TYPES_POLICY===null?(w=void 0,T=``):(w===void 0&&(w=ce()),w&&typeof T==`string`&&(T=se(``)));W&&W(e),pt=e},I=J({},[...Uu,...Wu,...Gu]),L=J({},[...Ku,...qu]),gt=function(e,t,n){return t.namespaceURI===tt?e===`svg`:t.namespaceURI===$e?e===`svg`&&(n===`annotation-xml`||st[n]):!!I[e]},R=function(e,t,n){return t.namespaceURI===tt?e===`math`:t.namespaceURI===et?e===`math`&<[n]:!!L[e]},_t=function(e,t,n){return t.namespaceURI===et&&!lt[n]||t.namespaceURI===$e&&!st[n]?!1:!L[e]&&(ut[e]||!I[e])},vt=function(e){let t=ne(e),n=Su(ee(e)),r=_(e),i,a;return r&&C(r)===Y.element?(i={namespaceURI:ne(r)},a=Su(ee(r))):(i={namespaceURI:nt},a=`template`),it[t]?t===et?gt(n,i,a):t===$e?R(n,i,a):t===tt?_t(n,i,a):!!(dt===`application/xhtml+xml`&&it[t]):!1},yt=function(e){hu(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw Pu(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},bt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},xt=function(e){Tt(e);let t=g(e);t&&fu(gu(t),e=>{try{p(e)}catch{}});let n=C(e)===Y.element?y(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&bt(e,r,i)}},St=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}hu(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Le||Re)try{yt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Ct=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||M[P(i)]||bt(e,r,i)}},wt=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&C(e)===Y.element){let t=v(e);Bt(t)&&r.push(t)}let i=g(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},Tt=function(e){wt(e,e=>{C(e)===Y.element&&Ct(e)})},Et=function(e){let t=[];return wt(e,e=>{t.push(e)},!0),t},Dt=function(e,t){let n=yu();fu(Et(e),e=>{C(e)===Y.element&&bu(n,e)}),fu(t,e=>{C(e)===Y.element&&!xu(n,e)&&Ct(e)})},Ot=function(e,n){let r=!1;return fu(t.removed,t=>{t.element&&(r||=t.element===e,Tt(t.element))}),Dt(e,n),r},kt=function(e,t){let n=Ge,r=null,i=()=>(r||(r=yu(),fu(t,e=>{bu(r,e)})),r);for(let t=0;;t++){let r=Et(e),a=[e],o=!1;if(fu(r,e=>{C(e)===Y.documentFragment?hu(a,e):!o&&!xu(n,e)&&(o=xu(i(),e))}),!o)return;if(t>=8)throw Pu(`the tree kept changing during in-place sanitization; refusing to return it`);fu(a,(t,n)=>{At(t,n>0,e,i())})}},At=function(e,t,n,r){let i=Ft(e),a;for(;a=i.nextNode();)xu(r,a)&&!xu(Ge,a)&&(t&&z(D.uponSanitizeShadowNode,a,null),qt(a,n),en(a,n),Bt(a.content)&&tn(a.content))},jt=function(e){Ge&&bu(Ge,e)},Mt=function(e,t){return je?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Nt=function(e){je&&wt(e,e=>{let t=C(e);if(t===Y.processingInstruction||t===Y.comment&&K(ud,e.data)){try{p(e)}catch{}return!1}if(t===Y.element){let t=e,n=P(ee(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Mt(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},Pt=function(e){let t=null,r=null;if(Ie)e=`<remove></remove>`+e;else{let t=wu(e,/^[\r\n\t ]+/);r=t&&t[0]}dt===`application/xhtml+xml`&&nt===tt&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=w?se(e):e;if(nt===tt)try{t=new l().parseFromString(i,dt)}catch{}if(!t||!t.documentElement){t=ue.createDocument(nt,`template`,null);try{t.documentElement.innerHTML=rt?T:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),nt===tt?pe.call(t,Me?`html`:`body`)[0]:Me?t.documentElement:a},Ft=function(e){let t=S?S(e):e.ownerDocument;return de.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},It=function(e){return e=Tu(e,he,` `),e=Tu(e,ge,` `),e=Tu(e,_e,` `),e},Lt=function(e){Rt(e);let t=e.querySelectorAll?.call(e,`template`);t&&fu(t,e=>{Bt(e.content)&&Lt(e.content)})},Rt=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=de.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=It(r.data),r=n.nextNode()},zt=function(e){let t=x?x(e):null;return typeof t!=`string`||P(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Bt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===Y.documentFragment}catch{return!1}},Vt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function z(e,n,r){e.length!==0&&fu(e,e=>{e.call(t,n,r,pt)})}let Ht=function(e,t){return!!(je&&e.hasChildNodes()&&!Vt(e.firstElementChild)&&K(ld,e.textContent)&&K(ld,e.innerHTML)||je&&pd[t]&&C(e)===Y.element&&ne(e)===tt&&(Vt(e.firstElementChild)||typeof e.textContent==`string`&&K(ld,e.textContent))||e.nodeType===Y.processingInstruction||je&&e.nodeType===Y.comment&&K(ud,e.data))},Ut=function(e,t){return e instanceof RegExp?K(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Wt=function(e,t,n){if(!Ce[t]&&Xt(t)&&Ut(N.tagNameCheck,t))return!1;if(Ue&&!qe[t]&&!qe[Su(t)]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return yt(e),!0},Gt=function(e,t,n,r){return e.length===0?t:t===n||t===r?Lu(t):t},Kt=function(e,t){return e===t||_(e)!==null?!1:(We&&Tt(e),!0)},qt=function(e,n){if(jt(e),z(D.beforeSanitizeElements,e,null),Kt(e,n))return!0;if(zt(e))return yt(e),!0;let r=P(ee(e));if(A=Gt(D.uponSanitizeElement,A,j,Pe),z(D.uponSanitizeElement,e,{tagName:r,allowedTags:A}),Kt(e,n))return!0;if(Ht(e,r))return yt(e),!0;if(Ce[r]||!(Te.tagCheck instanceof Function&&Te.tagCheck(r))&&!A[r]){let t=Wt(e,r,n);return t===!1&&(z(D.afterSanitizeElements,e,null),Kt(e,n))?!0:t}if(C(e)===Y.element&&!vt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&K(dd,e.innerHTML))return yt(e),!0;if(Ae&&e.nodeType===Y.text){let n=It(e.textContent);e.textContent!==n&&(hu(t.removed,{element:e.cloneNode()}),e.textContent=n)}return z(D.afterSanitizeElements,e,null),Kt(e,n)},Jt=function(e,t,r){if(we[t]||Mt(t,e)||Be&&(t===`id`||t===`name`)&&(r in n||r in mt))return!1;let i=M[t]||Te.attributeCheck instanceof Function&&Te.attributeCheck(t,e);return De&&K(ve,t)||Ee&&K(O,t)?!0:i?Ze[t]||K(k,Tu(r,be,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Eu(r,`data:`)===0&&Ye[e]||Oe&&!K(ye,Tu(r,be,``))?!0:!r:Xt(e)&&Ut(N.tagNameCheck,e)&&Ut(N.attributeNameCheck,t,e)||t===`is`&&N.allowCustomizedBuiltInElements&&Ut(N.tagNameCheck,r)},Yt=J({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Xt=function(e){return!Yt[Su(e)]&&K(xe,e)},Zt=function(e,t,n,r){if(w&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return se(r);case`TrustedScriptURL`:return E(r)}return r},Qt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!zt(e)||(yt(e),!1)}catch{return St(t,e),!1}},$t=function(e,t){return je&&K(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:Su(e)===`attributename`&&wu(t,`href`)!==null},en=function(e,n){if(z(D.beforeSanitizeAttributes,e,null),Kt(e,n))return;let r=e.attributes;if(!r||zt(e))return;M=Gt(D.uponSanitizeAttribute,M,Se,Fe);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0},a=r.length,o=P(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=P(s),d=l,f=s===`value`?d:Du(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,z(D.uponSanitizeAttribute,e,i),f=i.attrValue,Ve&&(u===`id`||u===`name`)&&Eu(f,He)!==0&&(St(s,e,n),f=He+f,p=!0),$t(s,f)?St(s,e,n):i.forceKeepAttr||(i.keepAttr?!ke&&K(fd,f)?St(s,e,n):(Ae&&(f=It(f)),Jt(o,u,f)?(f=Zt(o,u,c,f),f!==d&&Qt(e,s,c,f)&&p&&mu(t.removed)):St(s,e,n)):St(s,e,n))}z(D.afterSanitizeAttributes,e,null),Kt(e,n)},tn=function(e){let t=null,n=Ft(e);for(z(D.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(z(D.uponSanitizeShadowNode,t,null),qt(t,e),en(t,e),Bt(t.content)&&tn(t.content),C(t)===Y.element){let e=v(t);Bt(e)&&(nn(e),tn(e))}Ae&&Rt(e),z(D.afterSanitizeShadowDOM,e,null)},nn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){tn(e.shadow);continue}let n=e.node,r=C(n)===Y.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&P(e)===`template`){let e=n.content;Bt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Bt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(rt=!e,rt&&(e=`<!-->`),typeof e!=`string`&&!Vt(e)&&(e=Ru(e),typeof e!=`string`))throw Pu(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ne?(A=Pe,M=Fe):F(n),(D.uponSanitizeElement.length>0||D.uponSanitizeAttribute.length>0)&&(A=Lu(A)),D.uponSanitizeAttribute.length>0&&(M=Lu(M)),t.removed=[];let c=We&&typeof e!=`string`&&Vt(e),l=[],u=Ge;if(c){Nt(e);let t=ee(e);if(typeof t==`string`){let n=P(t);if(!A[n]||Ce[n])throw xt(e),Pu(`root node is forbidden and cannot be sanitized in-place`)}if(zt(e))throw xt(e),Pu(`root node is clobbered and cannot be sanitized in-place`);l=Et(e),Ge=yu()}else if(Vt(e))i=Pt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Y.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),nn(i);else{if(!Le&&!Ae&&!Me&&e.indexOf(`<`)===-1)return w&&ze?se(e):e;if(i=Pt(e),!i)return Le?null:ze?T:``}i&&Ie&&yt(i.firstChild);let d=c?e:i;try{c&&nn(e);let t=Ft(d);for(;o=t.nextNode();)qt(o,d),en(o,d),Bt(o.content)&&tn(o.content);c&&kt(e,l)}catch(t){throw c&&(xt(e),Ot(e,l)),t}finally{Ge=u}if(c){if(Ot(e,l))throw Pu(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Ae&&Lt(e),e}if(Le){if(Ae&&Lt(i),Re)for(s=fe.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(M.shadowroot||M.shadowrootmode)&&(s=me.call(r,s,!0)),s}let f=Me?i.outerHTML:i.innerHTML;return Me&&A[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&K(sd,i.ownerDocument.doctype.name)&&(f=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
55
55
|
`+f),Ae&&(f=It(f)),w&&ze?se(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};F(e),Ne=!0,Pe=A,Fe=M},t.clearConfig=function(){pt=null,Ne=!1,Pe=null,Fe=null,w=re,T=``},t.isValidAttribute=function(e,t,n){pt||F({});let r=P(e),i=P(t);return typeof n==`string`&&($t(t,n)||!ke&&K(fd,n))?!1:Jt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&Mu(D,e)&&hu(D[e],t)},t.removeHook=function(e,t){if(Mu(D,e)){if(t!==void 0){let n=pu(D[e],t);return n===-1?void 0:_u(D[e],n,1)[0]}return mu(D[e])}},t.removeHooks=function(e){Mu(D,e)&&(D[e]=[])},t.removeAllHooks=function(){D=gd()},t}var bd=yd(),xd={};function Sd(e){let t=xd[e];if(t)return t;t=xd[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]=`%`+(`0`+r.toString(16).toUpperCase()).slice(-2)}return t}function Cd(e,t){typeof t!=`string`&&(t=Cd.defaultChars);let n=Sd(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t=``;for(let r=0,i=e.length;r<i;r+=3){let a=parseInt(e.slice(r+1,r+3),16);if(a<128)t+=n[a];else{if((a&224)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((n&192)==128){let e=a<<6&1984|n&63;t+=e<128?`��`:String.fromCharCode(e),r+=3;continue}}if((a&240)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((n&192)==128&&(i&192)==128){let e=a<<12&61440|n<<6&4032|i&63;t+=e<2048||e>=55296&&e<=57343?`���`:String.fromCharCode(e),r+=6;continue}}if((a&248)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),o=parseInt(e.slice(r+10,r+12),16);if((n&192)==128&&(i&192)==128&&(o&192)==128){let e=a<<18&1835008|n<<12&258048|i<<6&4032|o&63;e<65536||e>1114111?t+=`����`:(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(e&1023))),r+=9;continue}}t+=`�`}}return t})}Cd.defaultChars=`;/?:@&=+$,#`,Cd.componentChars=``;var wd={};function Td(e){let t=wd[e];if(t)return t;t=wd[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push(`%`+(`0`+e.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Ed(e,t,n){typeof t!=`string`&&(n=t,t=Ed.defaultChars),n===void 0&&(n=!0);let r=Td(t),i=``;for(let t=0,a=e.length;t<a;t++){let o=e.charCodeAt(t);if(n&&o===37&&t+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3)))i+=e.slice(t,t+3),t+=2;else if(o<128)i+=r[o];else if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&t+1<a){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}i+=`%EF%BF%BD`}else i+=encodeURIComponent(e[t])}return i}Ed.defaultChars=`;/?:@&=+$,-_.!~*'()#`,Ed.componentChars=`-_.!~*'()`;function Dd(e){let t=``;return t+=e.protocol||``,t+=e.slashes?`//`:``,t+=e.auth?e.auth+`@`:``,e.hostname&&e.hostname.indexOf(`:`)!==-1?t+=`[`+e.hostname+`]`:t+=e.hostname||``,t+=e.port?`:`+e.port:``,t+=e.pathname||``,t+=e.search||``,t+=e.hash||``,t}function Od(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var kd=/^([a-z0-9.+-]+:)/i,Ad=/:[0-9]*$/,jd=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Md=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
|
|
56
56
|
`,` `],Nd=[`/`,`?`,`#`],Pd=255,Fd=/^[+a-z0-9A-Z_-]{0,63}$/,Id=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Ld={javascript:!0,"javascript:":!0},Rd={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function zd(e,t){if(e&&e instanceof Od)return e;let n=new Od;return n.parse(e,t),n}Od.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=jd.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=kd.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)===`//`,i&&!(o&&Ld[o])&&(a=a.substr(2),this.slashes=!0)),!Ld[o]&&(i||o&&!Rd[o])){let e=-1;for(let t=0;t<Nd.length;t++)r=a.indexOf(Nd[t]),r!==-1&&(e===-1||r<e)&&(e=r);let t,n;n=e===-1?a.lastIndexOf(`@`):a.lastIndexOf(`@`,e),n!==-1&&(t=a.slice(0,n),a=a.slice(n+1),this.auth=t),e=-1;for(let t=0;t<Md.length;t++)r=a.indexOf(Md[t]),r!==-1&&(e===-1||r<e)&&(e=r);e===-1&&(e=a.length),a[e-1]===`:`&&e--;let i=a.slice(0,e);a=a.slice(e),this.parseHost(i),this.hostname=this.hostname||``;let o=this.hostname[0]===`[`&&this.hostname[this.hostname.length-1]===`]`;if(!o){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(Fd)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(Fd)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(Id);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>Pd&&(this.hostname=``),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let s=a.indexOf(`#`);s!==-1&&(this.hash=a.substr(s),a=a.slice(0,s));let c=a.indexOf(`?`);return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),Rd[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},Od.prototype.parseHost=function(e){let t=Ad.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var Bd=e({decode:()=>Cd,encode:()=>Ed,format:()=>Dd,parse:()=>zd}),Vd=e({Any:()=>Hd,Cc:()=>Ud,Cf:()=>Wd,P:()=>Gd,S:()=>Kd,Z:()=>qd}),Hd=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Ud=/[\0-\x1F\x7F-\x9F]/,Wd=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Gd=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB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u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uF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8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA]/,qd=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Jd=[8364,0,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,0,381,0,0,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,0,382,376];function Yd(e){return e===0||e>=55296&&e<=57343||e>1114111}function Xd(e){return Yd(e)?65533:e>=128&&e<=159&&Jd[e-128]||e}function Zd(e){return e-1>>>0<127||e-160>>>0<55136?String.fromCharCode(e):String.fromCodePoint(Xd(e))}var Qd=(()=>{let e=new Uint8Array(127),t=0;for(let n=33;n<=126;n++)n!==34&&n!==36&&n!==92&&(e[n]=t++);return e})();function $d(e,t,n,r,i,a){let o=e.length,s=a*90,c=0,l=()=>{let t=Qd[e.charCodeAt(c++)];return t<a?t:t*91-s+Qd[e.charCodeAt(c++)]},u=n-r,d=n+i,f=new Int32Array(d);f.fill(-1,r,a),f.fill(-1,a+u,d);let p=new Int32Array(d),m=new Int32Array(d);function h(t,n){let r=0,i=n,a=n+t;for(;i<a;){let t=Qd[e.charCodeAt(c++)];if(t<89)r+=t,f[i++]=r;else if(t===89){let t=Qd[e.charCodeAt(c++)]+2;for(;t--;)f[i++]=++r}else{let t=Qd[e.charCodeAt(c++)];r+=89+(t<90?t*91+Qd[e.charCodeAt(c++)]:Qd[e.charCodeAt(c++)]*8281+Qd[e.charCodeAt(c++)]*91+Qd[e.charCodeAt(c++)]),f[i++]=r}}}h(r,0),h(u,a);let g=new Int32Array(i*2),_=0,v=0;function y(e,t){for(let n=0;n<e;n++){let e=t+n,r=l(),i=l();g[v*2]=r,g[v*2+1]=i,v+=1,p[e]=_;let a=(f[r]<0?m[r]:1)+(f[i]<0?m[i]:1);m[e]=a,_+=a}}y(i-a+r,a+u),y(a-r,r);let b=new Uint16Array(_),x=0;for(let e=0;e<v;e++)for(let t=0;t<2;t++){let n=g[e*2+t],r=f[n];if(r<0){let e=p[n],t=e+m[n];for(;e<t;)b[x++]=b[e++]}else b[x++]=r}let S=new Uint16Array(t),C=0;for(;c<o;){let t=Qd[e.charCodeAt(c++)];t>=a&&(t=t*91-s+Qd[e.charCodeAt(c++)]);let n=f[t];if(n<0){let e=p[t],n=e+m[t];for(;e<n;)S[C++]=b[e++]}else S[C++]=n}return S}var ef=$d("!}.&u%}'&}*'~!6*)%&,~!J~!J~%L~y<~!R,~~%Lu~~#GD~~#|)1#%}^%}2%+#.##%##%}&%##%'#%##&%#%#'%#&#%#&#'#%%#&#%##%#)%''%&%#%#'%#%%#%%}%%%#%#&(23#%%#&-%0%('1#(##%#'##+%'*.:1}#%#6-+(%'%%#%%%}#L'2351&('%}&/N'(0(/*-%(%%}#'+&T%7.2}#&%&#%#36/5##%&%%#&#%%#))2%%##%&&'0~!#*+&'%1~!%).'3q?&%'1~!.##%6(~!+%%%(Gw'rT~!E#<nA%#jZ~!H%(~!42##~!*31&~!G%U~#)5~#`3~!J~!Z~%]~%Y~%C~!q~!u~#kz~%#~!6'~!D~!U~!?~#T~!c%~!G#'~%7|~!G~!J~!G&~#pb~(Df}#%}*&}#%##%##%##&#-}&'#'&%#.++}%mI,#,@&(}*%}*'%&##&#%##%}&0}#.},U},%}+%}&%}#%##&}B%(}(%}+%)})%##%#&}&%##%&}<%}>%#%&}*%}(%}9%}/%})%}*%}*%}?&}&%}3%}&*#%})%#%#)}#&#-#+*%E%%'%'#%}#*V##&##I}#&&##%&%#&&Qf%%))w/0+&%#(#.%-''''++++7}>%4'',##1,#%#&%##&#'##&#*#9)%&%}#*}%,#+P(%A&%#'&##wSD',9E00#y#@}(+}&%&>~!#~!X}#*}(&&}(&}(,%}%&#+&}#&}I%#%}%)#(},'%#*}4%%#%}(''}#/##(##),%-##%%)#&}(.}&%#&}%%}*&#%},&&}&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|OjXuvvNr}:Rh&i[w*t|cd+U#jJvsu)vsSn~Mkfrmu9p}u7vwv]So!McW#Xa!ax5@A5aY:5;5<H|>kJv~vYrquJu3x4ib#T)2@SmZM?C2F|Bj:rmu9@xPhI(a*a#U#`a3-5Abb|L~@:RhK9:4E|0@52B5G|#C::aY?C2F|-:2<BaY?C2F|.5Jvk!a)javYrquJu3x4ia#T)2@SmYM?C2F|HAxPhH(!a#U#`a*-5Abb|4~@:RhJ9:4E|R@52B5G|F:2<BaY?C2F|Sc^#Xa2j=Qq5CJvB!-g<v{z;hhM?C2F|Zi[vrv{z;hiM?C2F|XKsA>!a)-g<v{z;h[eb?C2F|]i[vrv{z;h]eb?C2F|^iZu.vix,hZq3ah!.(?C2F|QOu!5ShXM:2<BaY?C2F|P",13494,2713,49,25,61),X;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.FLAG13=8192]=`FLAG13`,e[e.BRANCH_LENGTH=8064]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`,e[e.VALUE_MASK=8191]=`VALUE_MASK`})(X||={});var Z;(function(e){e[e.AMP=38]=`AMP`,e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_X=120]=`LOWER_X`})(Z||={});var tf=32,nf=21,rf=2097151,af=2047,of=0;function sf(e){let t=e>>>nf;return t===af?of:t}function cf(e){return e-Z.ZERO>>>0<=9}function lf(e){return(e|tf)-Z.LOWER_A>>>0<=5}function uf(e){return(e|tf)-Z.LOWER_A>>>0<=25}function df(e){return e===Z.EQUALS||uf(e)||cf(e)}var ff;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(ff||={});var pf;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(pf||={});function mf(e,t,n,r){let i=(t&X.BRANCH_LENGTH)>>7,a=t&X.JUMP_TABLE;if(a){if(i===0)return r===a?n:-1;let t=r-a;if(t>>>0>=i)return-1;let o=e[n+t];return o===0?-1:n+i+o-1&65535}if(i===0)return-1;let o=i+1>>1,s=n+o+i;for(let t=0;t<i;t++){let i=e[n+(t>>1)]>>((t&1)<<3)&255;if(i===r)return s+e[n+o+t]&65535;if(i>r)return-1}return-1}function hf(e,t,n){return n===1?String.fromCharCode(e[t]&X.VALUE_MASK):n===2?String.fromCharCode(e[t+1]):String.fromCharCode(e[t+1],e[t+2])}function gf(e,t,n){let r=t+1,i=0,a=r;if(r<n&&(e.charCodeAt(r)|tf)===Z.LOWER_X)for(r+=1,a=r;r<n;){let t=e.charCodeAt(r);if(cf(t))i=i*16+(t-Z.ZERO);else if(lf(t))i=i*16+((t|tf)-Z.LOWER_A+10);else break;r+=1}else for(;r<n;){let t=e.charCodeAt(r)-Z.ZERO;if(t>>>0>9)break;i=i*10+t,r+=1}if(r===a)return 0;r<n&&e.charCodeAt(r)===Z.SEMI&&(r+=1),i>1114111&&(i=1114112);let o=r-t;return o>=af&&(of=o,o=af),o<<nf|i}function _f(e,t,n){let r=ef,i=e.indexOf(`&`);if(i<0)return e;let a=e.length,o=0,s=``,c=r[0],l=c&X.JUMP_TABLE,u=(c&X.BRANCH_LENGTH)>>7;do{let c=i+1,d=e.charCodeAt(c),f,p;if(d===Z.NUM){let n=gf(e,c,a);f=sf(n),t&&f>0&&e.charCodeAt(c+f-1)!==Z.SEMI&&(f=0),p=f===0?``:Zd(n&rf)}else if(uf(d)){f=0,p=``;let n=d-l,i;if(n>>>0<u){let e=r[1+n];i=e===0?-1:u+e&65535}else i=-1;let o=0,s=0,m=i<0?0:r[i],h=c+1;trie:for(;h<a;){for(;(m&(X.VALUE_LENGTH|X.FLAG13))===0&&(m&X.JUMP_TABLE)!==0;){let t=m&X.JUMP_TABLE,n=(m&X.BRANCH_LENGTH)>>7;if(n===0){if(e.charCodeAt(h)!==t)break trie;i+=1}else{let a=e.charCodeAt(h)-t;if(a>>>0>=n)break trie;let o=r[i+1+a];if(o===0)break trie;i=i+n+o&65535}if(m=r[i],h+=1,h>=a)break trie}if((m&(X.VALUE_LENGTH|X.FLAG13))===X.FLAG13){let t=(m&X.BRANCH_LENGTH)>>7;if(e.charCodeAt(h)!==(m&X.JUMP_TABLE))break;h+=1;let n=t-1,a=i+1,o=0;for(;o+1<n;o+=2){let t=r[a];if(e.charCodeAt(h)!==(t&255)||(h+=1,e.charCodeAt(h)!==(t>>8&255)))break trie;h+=1,a+=1}if(o<n){if(e.charCodeAt(h)!==(r[a]&255))break;h+=1}i+=1+(t>>1),m=r[i];continue}let n=m>>>14,l=e.charCodeAt(h);if(n!==0){if(l===Z.SEMI){f=h-c+1,p=n===1?String.fromCharCode(m&X.VALUE_MASK):hf(r,i,n);break}if(!t&&(m&X.FLAG13)===0&&(f=h-c,o=i,s=n),n===1)break}let u=mf(r,m,i+(n||1),l);if(u<0)break;i=u,m=r[i],h+=1}if(p===``){let e=m>>>14;e!==0&&!t&&(m&X.FLAG13)===0&&(f=h-c,o=i,s=e),f>0&&(p=hf(r,o,s))}}else f=0,p=``;f===0||n&&d!==Z.NUM&&e.charCodeAt(c+f-1)!==Z.SEMI&&c+f<a&&df(e.charCodeAt(c+f))?i=c:(o<i&&(s+=e.slice(o,i)),s+=p,i=o=c+f),e.charCodeAt(i)!==Z.AMP&&(i=e.indexOf(`&`,i))}while(i>=0);return s+e.slice(o)}function vf(e){return _f(e,!0,!1)}var yf=class{src_Any=Hd.source;src_Cc=Ud.source;src_Z=qd.source;src_P=Gd.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join(`|`);src_ZCc=[this.src_Z,this.src_Cc].join(`|`);cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}nestedPairRE(e,t,n=4){let r=this.escapeRE(e),i=this.escapeRE(t),a=`(?:(?!${this.src_ZCc}|${r}|${i}).)`,o=`${r}${a}{0,1000}${i}`;for(let e=2;e<=n;e++)o=`${r}(?:${a}|${o}){0,1000}${i}`;return o}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=RegExp(`(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])`)}get_ipv6_addr(){let e=`[0-9A-Fa-f]{1,4}`,t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=RegExp(`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`)}get_host_terminator(){return this.cache.src_host_terminator??=RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts[`---`]?`-(?!--)|`:`-|`}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=RegExp(`(?:[/?#](?:${this.nestedPairRE(`[`,`]`)}|${this.nestedPairRE(`(`,`)`)}|${this.nestedPairRE(`{`,`}`)}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts[`---`]?`\\-(?!--(?:[^-]|$))(?:-{0,19})|`:`\\-{1,20}|`)+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=RegExp(`xn--[a-z0-9\\-]{1,59}`)}get_tld(){if(this.cache.tld)return this.cache.tld;let e=[...new Set(this.opts.tlds||[])].sort().reverse().join(`|`);return this.cache.tld=RegExp(`${e||`$#none#$`}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=RegExp(`(?:`+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=RegExp(`(?:`+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=RegExp(`(?:`+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=RegExp(`(?:`+(this.opts.fuzzyIP?this.get_ipv4_addr().source+`|`:``)+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=RegExp(`(?:`+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=RegExp(`(?:`+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=RegExp(``)}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=RegExp(`@${this.get_fuzzy_mail_host().source}`,`ig`)}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${this.src_ZPCc}))(?:(?![$+<=>^\`|\uff5c])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,`ig`)}get_http_validator(){return this.cache.http_validator??=RegExp(`\\/\\/`+(this.opts.urlAuth?this.get_auth().source:``)+this.get_url_host_port().source+this.get_path().source,`iy`)}get_relative_proto_validator(){return this.cache.relative_proto_validator??=RegExp((this.opts.urlAuth?this.get_auth().source:``)+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,`iy`)}get_mail_name_validator(){return this.cache.mail_name_validator??=RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,`iy`)}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join(`|`))}get_schema_search(){return this.cache.schema_search??=RegExp(`(^|(?!_)(?:[><\uff5c]|${this.src_ZPCc}))(${this.get_schema_names().source})`,`ig`)}get_schema_at_start(){return this.cache.schema_at_start??=RegExp(`^${this.get_schema_search().source}`,`i`)}},bf={validate:(e,t,n)=>{let r=n.re.get_http_validator();r.lastIndex=t;let i=r.exec(e);return i?i[0].length:0},normalize:(e,t)=>t.normalize(e)},xf={"http:":bf,"https:":bf,"ftp:":bf,"//":{validate:function(e,t,n){let r=n.re.get_relative_proto_validator();r.lastIndex=t;let i=r.exec(e);return i?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:i[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){let r=n.re.get_mailto_validator();r.lastIndex=t;let i=r.exec(e);return i?i[0].length:0},normalize:(e,t)=>t.normalize(e)}},Sf=`a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw`,Cf=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`;function wf(){let e=Cf.split(`|`);return Sf.split(`|`).forEach(t=>{let n=t.indexOf(`:`),r=t.slice(0,n);for(let i of t.slice(n+1))e.push(r+i)}),e}var Tf={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:wf(),urlAuth:!1,maxLength:1e4},Ef=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,r){let i=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i}},Df=class{__opts__;__schemas__;re;constructor(e={}){let{rebuilder:t,...n}=e;this.__opts__={...Tf,...n},this.__schemas__={...xf},this.re=t||new yf,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{let n={normalize:(e,t)=>t.normalize(e),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__[`http:`]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__[`mailto:`]&&e.indexOf(`@`)>=0){let n=this.re.get_fuzzy_mail_host_search(),r=this.re.get_mail_name_validator();for(n.lastIndex=0;(t=n.exec(e))!==null;){let n=e.slice(Math.max(0,t.index-65),t.index);if(r.test(n))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){let t=[],n=this.re.get_schema_search(),r,i,a,o,s,c,l=!1,u=!1,d=!1,f=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__[`http:`]&&(r=this.re.get_fuzzy_link_search(),r.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__[`mailto:`]&&(i=this.re.get_fuzzy_mail_host_search(),i.lastIndex=0,a=this.re.get_mail_name_validator());;){let p=Math.max(f-1,0);if(i&&a&&!d&&(!s||s.index<f))for(i.lastIndex<p&&(i.lastIndex=p);;){let t=i.exec(e);if(!t){d=!0,s=void 0;break}let n=a.exec(e.slice(Math.max(0,t.index-65),t.index));if(n){if(s={schema:`mailto:`,index:t.index-n[1].length,lastIndex:t.index+t[0].length},s.index>=f)break;i.lastIndex<p&&(i.lastIndex=p)}}if(r&&!u&&(!o||o.index<f))for(r.lastIndex<p&&(r.lastIndex=p);;){let t=r.exec(e);if(!t){u=!0,o=void 0;break}if(o={schema:``,index:t.index+t[1].length,lastIndex:t.index+t[0].length},o.index>=f)break;r.lastIndex<p&&(r.lastIndex=p)}let m=s;(!m||o&&(o.index<m.index||o.index===m.index&&o.lastIndex>m.lastIndex))&&(m=o);let h;if(!l)for(;;){if(!c){n.lastIndex<p&&(n.lastIndex=p);let t=n.exec(e);if(!t){l=!0;break}c={schema:t[2],index:t.index+t[1].length,lastIndex:t.index+t[0].length}}if(c.index<f){c=void 0;continue}if(m&&c.index>m.index)break;let t=c;c=void 0;let r=this.testSchemaAt(e,t.schema,t.lastIndex);if(r){h={schema:t.schema,index:t.index,lastIndex:t.lastIndex+r};break}}let g=h;if((!g||s&&(s.index<g.index||s.index===g.index&&s.lastIndex>g.lastIndex))&&(g=s),(!g||o&&(o.index<g.index||o.index===g.index&&o.lastIndex>g.lastIndex))&&(g=o),!g)break;g===s?s=void 0:g===o&&(o=void 0);let _=new Ef(e,g.schema,g.index,g.lastIndex);_.schema?this.__schemas__[_.schema].normalize(_,this):this.normalize(_),t.push(_),f=g.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;let t=this.re.get_schema_at_start().exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;let r=new Ef(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[r.schema].normalize(r,this),r}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}},Of=2147483647,kf=36,Af=1,jf=26,Mf=38,Nf=700,Pf=72,Ff=128,If=`-`,Lf=/^xn--/,Rf=/[^\0-\x7F]/,zf=/[\x2E\u3002\uFF0E\uFF61]/g,Bf={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},Vf=35,Hf=Math.floor,Uf=String.fromCharCode;function Wf(e){throw RangeError(Bf[e])}function Gf(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function Kf(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(zf,`.`);let i=Gf(e.split(`.`),t).join(`.`);return r+i}function qf(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(r&64512)==56320?t.push(((i&1023)<<10)+(r&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}var Jf=e=>String.fromCodePoint(...e),Yf=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:kf},Xf=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Zf=function(e,t,n){let r=0;for(e=n?Hf(e/Nf):e>>1,e+=Hf(e/t);e>455;r+=kf)e=Hf(e/Vf);return Hf(r+36*e/(e+Mf))},Qf=function(e){let t=[],n=e.length,r=0,i=Ff,a=Pf,o=e.lastIndexOf(If);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&Wf(`not-basic`),t.push(e.charCodeAt(n));for(let s=o>0?o+1:0;s<n;){let o=r;for(let t=1,i=kf;;i+=kf){s>=n&&Wf(`invalid-input`);let o=Yf(e.charCodeAt(s++));o>=kf&&Wf(`invalid-input`),o>Hf((Of-r)/t)&&Wf(`overflow`),r+=o*t;let c=i<=a?Af:i>=a+jf?jf:i-a;if(o<c)break;let l=kf-c;t>Hf(Of/l)&&Wf(`overflow`),t*=l}let c=t.length+1;a=Zf(r-o,c,o==0),Hf(r/c)>Of-i&&Wf(`overflow`),i+=Hf(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},$f=function(e){let t=[];e=qf(e);let n=e.length,r=Ff,i=0,a=Pf;for(let n of e)n<128&&t.push(Uf(n));let o=t.length,s=o;for(o&&t.push(If);s<n;){let n=Of;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>Hf((Of-i)/c)&&Wf(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>Of&&Wf(`overflow`),n===r){let e=i;for(let n=kf;;n+=kf){let r=n<=a?Af:n>=a+jf?jf:n-a;if(e<r)break;let i=e-r,o=kf-r;t.push(Uf(Xf(r+i%o,0))),e=Hf(i/o)}t.push(Uf(Xf(e,0))),a=Zf(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},ep={version:`2.3.1`,ucs2:{decode:qf,encode:Jf},decode:Qf,encode:$f,toASCII:function(e){return Kf(e,function(e){return Rf.test(e)?`xn--`+$f(e):e})},toUnicode:function(e){return Kf(e,function(e){return Lf.test(e)?Qf(e.slice(4).toLowerCase()):e})}},tp=Object.defineProperty,np=(e,t)=>{let n={};for(var r in e)tp(n,r,{get:e[r],enumerable:!0});return t||tp(n,Symbol.toStringTag,{value:`Module`}),n},rp=np({arrayReplaceAt:()=>ap,asciiTrim:()=>Dp,callable:()=>ip,escapeHtml:()=>vp,escapeRE:()=>bp,fromCodePoint:()=>sp,isMdAsciiPunct:()=>wp,isPunctChar:()=>Sp,isPunctCharCode:()=>Cp,isSpace:()=>Q,isValidEntityCode:()=>op,isWhiteSpace:()=>xp,lib:()=>Op,normalizeReference:()=>Tp,unescapeAll:()=>pp,unescapeMd:()=>fp});function ip(e){let t=function(...n){return Reflect.construct(e,n,new.target&&new.target!==t?new.target:e)};return Object.defineProperty(t,"name",{value:e.name}),Object.setPrototypeOf(t,e),t.prototype=e.prototype,t}function ap(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function op(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function sp(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var cp=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,lp=RegExp(`${cp.source}|&([a-z#][a-z0-9]{1,31});`,`gi`),up=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function dp(e,t){if(t.charCodeAt(0)===35&&up.test(t)){let n=t[1].toLowerCase()===`x`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return op(n)?sp(n):e}let n=vf(e);return n===e?e:n}function fp(e){return e.indexOf(`\\`)<0?e:e.replace(cp,`$1`)}function pp(e){return e.indexOf(`\\`)<0&&e.indexOf(`&`)<0?e:e.replace(lp,function(e,t,n){return t||dp(e,n)})}var mp=/[&<>"]/,hp=/[&<>"]/g,gp={"&":`&`,"<":`<`,">":`>`,'"':`"`};function _p(e){return gp[e]}function vp(e){return mp.test(e)?e.replace(hp,_p):e}var yp=/[.?*+^$[\]\\(){}|-]/g;function bp(e){return e.replace(yp,`\\$&`)}function Q(e){switch(e){case 9:case 32:return!0}return!1}function xp(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Sp(e){return Gd.test(e)||Kd.test(e)}function Cp(e){return Sp(sp(e))}function wp(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Tp(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}function Ep(e){return e===32||e===9||e===10||e===13}function Dp(e){let t=0;for(;t<e.length&&Ep(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&Ep(e.charCodeAt(n));n--);return e.slice(t,n+1)}var Op={mdurl:Bd,ucmicro:Vd};function kp(e,t,n){let r,i,a,o,s=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<s;){if(a=e.src.charCodeAt(e.pos),a===93&&(r--,r===0)){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)r++;else if(n)return e.pos=c,-1}}let l=-1;return i&&(l=e.pos),e.pos=c,l}function Ap(e,t,n){let r,i=t,a={ok:!1,pos:0,str:``};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return a;if(r===62)return a.pos=i+1,a.str=pp(e.slice(t+1,i)),a.ok=!0,a;r===92&&i+1<n?i+=2:i++}return a}let o=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));)if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32){i++;continue}i+=2}else{if(r===40&&(o++,o>32))return a;if(r===41){if(o===0)break;o--}i++}return t===i||o!==0||(a.str=pp(e.slice(t,i)),a.pos=i,a.ok=!0),a}function jp(e,t,n,r){let i,a=t,o={ok:!1,can_continue:!1,pos:0,str:``,marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(a>=n)return o;let r=e.charCodeAt(a);if(r!==34&&r!==39&&r!==40)return o;t++,a++,r===40&&(r=41),o.marker=r}for(;a<n;){if(i=e.charCodeAt(a),i===o.marker)return o.pos=a+1,o.str+=pp(e.slice(t,a)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=pp(e.slice(t,a)),o}var Mp=np({parseLinkDestination:()=>Ap,parseLinkLabel:()=>kp,parseLinkTitle:()=>jp});function Np(e){"@babel/helpers - typeof";return Np=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Np(e)}function Pp(e,t){if(Np(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Np(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Fp(e){var t=Pp(e,`string`);return Np(t)==`symbol`?t:t+``}function $(e,t,n){return(t=Fp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ip=class{constructor(e,t,n){$(this,`map`,null),$(this,`level`,0),$(this,`children`,null),$(this,`content`,``),$(this,`markup`,``),$(this,`info`,``),$(this,`block`,!1),$(this,`hidden`,!1),this.type=e,this.tag=t,this.attrs=null,this.nesting=n,this.meta=null}attrIndex(e){if(!this.attrs)return-1;let t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r}attrGet(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){let n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},Lp=class{constructor(){$(this,`__rules__`,[]),$(this,`__cache__`,null)}__find__(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1}__compile__(){let e=new Set;this.__rules__.forEach(t=>{t.enabled&&t.alt.forEach(t=>{t&&e.add(t)})}),this.__cache__=Object.create(null),this.__cache__[``]=[],this.__rules__.forEach(e=>{e.enabled&&this.__cache__[``].push(e.fn)}),e.forEach(e=>{this.__cache__[e]=[],this.__rules__.forEach(t=>{t.enabled&&t.alt.indexOf(e)>=0&&this.__cache__[e].push(t.fn)})})}at(e,t,n={}){let r=this.__find__(e);if(r===-1)throw Error(`Parser rule not found: ${e}`);this.__rules__[r].fn=t,this.__rules__[r].alt=n.alt||[],this.__cache__=null}before(e,t,n,r={}){let i=this.__find__(e);if(i===-1)throw Error(`Parser rule not found: ${e}`);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null}after(e,t,n,r={}){let i=this.__find__(e);if(i===-1)throw Error(`Parser rule not found: ${e}`);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null}push(e,t,n={}){this.__rules__.push({name:e,enabled:!0,fn:t,alt:n.alt||[]}),this.__cache__=null}enable(e,t=!1){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(e=>{let r=this.__find__(e);if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name ${e}`)}this.__rules__[r].enabled=!0,n.push(e)}),this.__cache__=null,n}enableOnly(e,t=!1){Array.isArray(e)||(e=[e]),this.__rules__.forEach(e=>{e.enabled=!1}),this.enable(e,t)}disable(e,t=!1){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(e=>{let r=this.__find__(e);if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name ${e}`)}this.__rules__[r].enabled=!1,n.push(e)}),this.__cache__=null,n}getRules(e){return this.__cache__||this.__compile__(),this.__cache__[e]||[]}},Rp={};Rp.code_inline=function(e,t,n,r,i){let a=e[t];return`<code${i.renderAttrs(a)}>${vp(a.content)}</code>`},Rp.code_block=function(e,t,n,r,i){let a=e[t];return`<pre${i.renderAttrs(a)}><code>${vp(e[t].content)}</code></pre>\n`},Rp.fence=function(e,t,n,r,i){let a=e[t],o=a.info?pp(a.info).trim():``,s=``,c=``;if(o){let e=o.split(/(\s+)/g);s=e[0],c=e.slice(2).join(``)}let l;if(l=n.highlight&&n.highlight(a.content,s,c)||vp(a.content),l.indexOf(`<pre`)===0)return l+`
|
|
57
57
|
`;if(o){let e=a.attrIndex(`class`),t=a.attrs?a.attrs.slice():[];e<0?t.push([`class`,`${n.langPrefix}${s}`]):(t[e]=[t[e][0],t[e][1]],t[e][1]+=` ${n.langPrefix}${s}`);let r={attrs:t};return`<pre><code${i.renderAttrs(r)}>${l}</code></pre>\n`}return`<pre><code${i.renderAttrs(a)}>${l}</code></pre>\n`},Rp.image=function(e,t,n,r,i){let a=e[t];return a.attrs[a.attrIndex(`alt`)][1]=i.renderInlineAsText(a.children,n,r),i.renderToken(e,t,n)},Rp.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
|