@wervt/cms 0.0.3 → 0.0.4
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/README.md +16 -1
- package/dist/editor/assets/Button-Dai6Ph2c.js +6 -0
- package/dist/editor/assets/{RichTextInput-DHmilx6T.js → RichTextInput-CdL9ZFoP.js} +120 -120
- package/dist/editor/assets/Toast-BaUcosq6.js +13 -0
- package/dist/editor/assets/index-CP6dGIyl.css +2 -0
- package/dist/editor/assets/index-Du-lvx2V.js +16 -0
- package/dist/editor/index.html +3 -3
- package/dist/module.js +5 -1
- package/dist/runtime/app/drafts.d.ts +5 -0
- package/dist/runtime/app/drafts.js +8 -0
- package/dist/runtime/app/preview.client.d.ts +2 -0
- package/dist/runtime/app/preview.client.js +28 -0
- package/dist/runtime/app/useCms.js +2 -1
- package/dist/runtime/preview.d.ts +34 -0
- package/dist/runtime/preview.js +35 -0
- package/package.json +1 -1
- package/dist/editor/assets/Button-BHCKwuIs.js +0 -6
- package/dist/editor/assets/Toast-pKrAdYOo.js +0 -13
- package/dist/editor/assets/index-JJD_O40W.js +0 -16
- package/dist/editor/assets/index-kXxO7vu1.css +0 -2
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import{$n as e,$t as t,B as n,C as r,D as i,Dn as a,Er as o,Fr as s,G as c,Gr as l,I as u,Kn as d,Kr as f,L as p,Ln as m,N as h,Nn as g,Nt as _,Pn as v,Qt as y,S as b,Sr as x,Vn as S,X as ee,Xt as te,Y as ne,Yn as re,Yt as ie,Zr as ae,Zt as oe,_ as se,a as ce,an as le,at as ue,cn as de,di as fe,ei as pe,er as me,g as he,gn as ge,gr as _e,mr as ve,nt as ye,on as be,pi as xe,qn as C,ri as Se,rr as Ce,rt as we,si as w,st as Te,t as Ee,tt as De,ui as Oe,ur as ke,v as Ae,vn as je,w as Me,xr as Ne,y as Pe,yn as Fe,z as Ie,zt as Le}from"./Button-BHCKwuIs.js";import{A as Re,C as ze,D as Be,E as Ve,F as He,L as Ue,M as We,N as Ge,O as Ke,P as qe,R as Je,S as Ye,T as Xe,a as Ze,b as Qe,i as $e,j as et,k as tt,n as nt,o as rt,r as it,s as at,t as ot,v as st,w as ct,x as lt,y as ut}from"./index-JJD_O40W.js";function dt(e,t){let n=we(!1,300);ue(()=>{n.value=!1});let r=ae(null),i=ee();function a(){r.value=null,n.value=!1}function o(e,t){if(!t)return;let i=e.currentTarget,a={x:e.clientX,y:e.clientY},o=pt(a,ft(a,i.getBoundingClientRect()),1),s=mt(t.getBoundingClientRect()),c=gt([...o,...s]);r.value=c,n.value=!0}return x(n=>{if(e.value&&t.value){let r=e.value,i=t.value,a=e=>o(e,i),s=e=>o(e,r);r.addEventListener(`pointerleave`,a),i.addEventListener(`pointerleave`,s),n(()=>{r.removeEventListener(`pointerleave`,a),i.removeEventListener(`pointerleave`,s)})}}),x(n=>{if(r.value){let o=n=>{if(!r.value||!(n.target instanceof Element))return;let o=n.target,s={x:n.clientX,y:n.clientY},c=e.value?.contains(o)||t.value?.contains(o),l=!ht(s,r.value),u=!!o.closest(`[data-grace-area-trigger]`);c?a():(l||u)&&(a(),i.trigger())},s=e.value?.ownerDocument;s?.addEventListener(`pointermove`,o),n(()=>s?.removeEventListener(`pointermove`,o))}}),{isPointerInTransit:n,onPointerExit:i.on}}function ft(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function pt(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}function mt(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function ht(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function gt(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),_t(t)}function _t(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t.at(-1),n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n.at(-1),t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var vt=de({__name:`BaseSeparator`,props:{orientation:{type:String,required:!1,default:`horizontal`},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=[`horizontal`,`vertical`];function r(e){return n.includes(e)}let i=ie(()=>r(t.orientation)?t.orientation:`horizontal`),a=ie(()=>i.value===`vertical`?t.orientation:void 0),s=ie(()=>t.decorative?{role:`none`}:{"aria-orientation":a.value,role:`separator`});return(t,n)=>(C(),oe(w(b),g({as:e.as,"as-child":e.asChild,"data-orientation":i.value},s.value),{default:o(()=>[me(t.$slots,`default`)]),_:3},16,[`as`,`as-child`,`data-orientation`]))}}),yt=de({__name:`Separator`,props:{orientation:{type:String,required:!1,default:`horizontal`},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(C(),oe(vt,fe(je(t)),{default:o(()=>[me(e.$slots,`default`)]),_:3},16))}}),bt=de({__name:`TooltipArrow`,props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`svg`}},setup(e){let t=e;return Me(),(e,n)=>(C(),oe(w(st),fe(je(t)),{default:o(()=>[me(e.$slots,`default`)]),_:3},16))}}),xt=`tooltip.open`,[St,Ct]=i(`TooltipRoot`),wt=de({__name:`TooltipRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t;Me();let i=at(),a=ie(()=>n.disableHoverableContent??i.disableHoverableContent.value),s=ie(()=>n.disableClosingTrigger??i.disableClosingTrigger.value),c=ie(()=>n.disabled??i.disabled.value),l=ie(()=>n.delayDuration??i.delayDuration.value),u=ie(()=>n.ignoreNonKeyboardFocus??i.ignoreNonKeyboardFocus.value),d=ne(n,`open`,r,{defaultValue:n.defaultOpen,passive:n.open===void 0});Ne(d,e=>{i.onClose&&(e?(i.onOpen(),document.dispatchEvent(new CustomEvent(xt))):i.onClose())});let f=ae(!1),p=ae(),m=ie(()=>d.value?f.value?`delayed-open`:`instant-open`:`closed`),{start:h,stop:g}=Te(()=>{f.value=!0,d.value=!0},l,{immediate:!1});function _(){g(),f.value=!1,d.value=!0}function v(){g(),d.value=!1}function y(){h()}return Ct({contentId:``,open:d,stateAttribute:m,trigger:p,onTriggerChange(e){p.value=e},onTriggerEnter(){i.isOpenDelayed.value?y():_()},onTriggerLeave(){a.value?v():g()},onOpen:_,onClose:v,disableHoverableContent:a,disableClosingTrigger:s,disabled:c,ignoreNonKeyboardFocus:u}),(e,t)=>(C(),oe(w(Re),null,{default:o(()=>[me(e.$slots,`default`,{open:w(d)})]),_:3}))}}),Tt=de({__name:`TooltipContentImpl`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1,default:void 0},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:void 0},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1,default:void 0},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=St(),a=at(),{forwardRef:s,currentElement:l}=Me(),u=ie(()=>n.ariaLabel||l.value?.textContent),d=ie(()=>{let{ariaLabel:e,...t}=n;return Ie(t,a.content.value??{},{side:`top`,sideOffset:0,align:`center`,avoidCollisions:!0,collisionBoundary:[],collisionPadding:0,arrowPadding:0,sticky:`partial`,hideWhenDetached:!1})});return S(()=>{c(window,`scroll`,e=>{e.target?.contains(i.trigger.value)&&i.onClose()},{capture:!0}),c(document,xt,i.onClose)}),(e,t)=>(C(),oe(w(We),{"as-child":``,"disable-outside-pointer-events":!1,onEscapeKeyDown:t[0]||=e=>r(`escapeKeyDown`,e),onPointerDownOutside:t[1]||=e=>{w(i).disableClosingTrigger.value&&w(i).trigger.value?.contains(e.target)&&e.preventDefault(),r(`pointerDownOutside`,e)},onFocusOutside:t[2]||=_(()=>{},[`prevent`]),onDismiss:t[3]||=e=>w(i).onClose()},{default:o(()=>[be(w(ut),g({ref:w(s),"data-state":w(i).stateAttribute.value},{...e.$attrs,...d.value},{style:{"--reka-tooltip-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-tooltip-content-available-width":`var(--reka-popper-available-width)`,"--reka-tooltip-content-available-height":`var(--reka-popper-available-height)`,"--reka-tooltip-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-tooltip-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:o(()=>[me(e.$slots,`default`),be(w(Pe),{id:w(i).contentId,role:`tooltip`},{default:o(()=>[le(xe(u.value),1)]),_:1},8,[`id`])]),_:3},16,[`data-state`])]),_:3}))}}),Et=de({__name:`TooltipContentHoverable`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(e){let t=He(e),{forwardRef:n,currentElement:r}=Me(),{trigger:i,onClose:a}=St(),s=at(),{isPointerInTransit:l,onPointerExit:u}=dt(i,r);return s.isPointerInTransitRef=l,u(()=>{a()}),c(r,`pointermove`,e=>{let t=r.value;t&&e.pointerType!==`touch`&&t.ownerDocument.elementsFromPoint?.(e.clientX,e.clientY).some(e=>{if(t.contains(e))return!1;let n=e.closest(`[data-grace-area-trigger]`);return!!n&&n!==i.value})&&a()}),(e,r)=>(C(),oe(Tt,g({ref:w(n)},w(t)),{default:o(()=>[me(e.$slots,`default`)]),_:3},16))}}),Dt=de({__name:`TooltipContent`,props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,i=t,a=St(),s=qe(n,i),{forwardRef:c}=Me();return(t,n)=>(C(),oe(w(r),{present:e.forceMount||w(a).open.value},{default:o(()=>[(C(),oe(Ce(w(a).disableHoverableContent.value?Tt:Et),g({ref:w(c)},w(s)),{default:o(()=>[me(t.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),Ot=de({__name:`TooltipPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(C(),oe(w(et),fe(je(t)),{default:o(()=>[me(e.$slots,`default`)]),_:3},16))}}),kt=de({__name:`TooltipTrigger`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,n=St(),r=at();n.contentId||=Ge(void 0,`reka-tooltip-content`);let{forwardRef:i,currentElement:a}=Me(),s=ae(!1),c=ae(!1),l=ie(()=>n.disabled.value?{}:{click:_,focus:m,pointermove:f,pointerleave:p,pointerdown:d,blur:h});Ne(a,e=>{n.onTriggerChange(e)},{immediate:!0});function u(){setTimeout(()=>{s.value=!1},1)}function d(){n.open&&!n.disableClosingTrigger.value&&n.onClose(),s.value=!0,document.addEventListener(`pointerup`,u,{once:!0})}function f(e){e.pointerType!==`touch`&&!c.value&&!r.isPointerInTransitRef.value&&(n.onTriggerEnter(),c.value=!0)}function p(){n.onTriggerLeave(),c.value=!1}function m(e){s.value||(!n.ignoreNonKeyboardFocus.value||e.target.matches?.(`:focus-visible`))&&n.onOpen()}function h(){n.onClose()}function _(){n.disableClosingTrigger.value||n.onClose()}return(r,s)=>(C(),oe(w(tt),{"as-child":``,reference:e.reference??w(a)},{default:o(()=>[be(w(b),g({ref:w(i),"aria-describedby":w(n).open.value?w(n).contentId:void 0,"data-state":w(n).stateAttribute.value,as:e.as,"as-child":t.asChild,"data-grace-area-trigger":``},ke(l.value)),{default:o(()=>[me(r.$slots,`default`)]),_:3},16,[`aria-describedby`,`data-state`,`as`,`as-child`])]),_:3},8,[`reference`]))}}),At=Object.defineProperty,jt=(e,t)=>{let n={};for(var r in e)At(n,r,{get:e[r],enumerable:!0});return t||At(n,Symbol.toStringTag,{value:`Module`}),n};function Mt(e){this.content=e}Mt.prototype={constructor:Mt,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new Mt(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Mt(n)},addToStart:function(e,t){return new Mt([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Mt(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new Mt(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Mt.from(e),e.size?new Mt(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Mt.from(e),e.size?new Mt(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Mt.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},Mt.from=function(e){if(e instanceof Mt)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Mt(t)};function Nt(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a)n+=i.nodeSize;else{if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&It(e.charCodeAt(r-1))&&Ft(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=Nt(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}}function Pt(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s)n-=c,r-=c;else{if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&It(e.charCodeAt(i-1))&&Ft(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=Pt(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}}function Ft(e){return e>=56320&&e<57344}function It(e){return e>=55296&&e<56320}var T=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Nt(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Pt(this,e,t,n)}findIndex(e){if(e==0)return Rt(0,e);if(e==this.size)return Rt(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Rt(t+1,i):Rt(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};T.empty=new T([],0);var Lt={index:0,offset:0};function Rt(e,t){return Lt.index=e,Lt.offset=t,Lt}function zt(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!zt(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!zt(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var E=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&zt(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};E.none=[];var Bt=class extends Error{},D=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Ht(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Vt(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(T.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};D.empty=new D(T.empty,0,0);function Vt(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Vt(a.content,t-i-1,n-i-1)))}function Ht(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=Ht(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function Ut(e,t,n){if(n.openStart>e.depth)throw new Bt(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Bt(`Inconsistent open depths`);return Wt(e,t,n,0)}function Wt(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=Wt(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return Yt(a,Zt(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return Yt(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=Qt(n,e);return Yt(a,Xt(e,i,o,t,r))}}function Gt(e,t){if(!t.type.compatibleContent(e.type))throw new Bt(`Cannot join `+t.type.name+` onto `+e.type.name)}function Kt(e,t,n){let r=e.node(n);return Gt(r,t.node(n)),r}function qt(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Jt(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(qt(e.nodeAfter,r),a++));for(let e=a;e<o;e++)qt(i.child(e),r);t&&t.depth==n&&t.textOffset&&qt(t.nodeBefore,r)}function Yt(e,t){if(!e.type.validContent(t))throw new Bt(`Invalid content for node `+e.type.name);return e.copy(t)}function Xt(e,t,n,r,i){let a=e.depth>i&&Kt(e,t,i+1),o=r.depth>i&&Kt(n,r,i+1),s=[];return Jt(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Gt(a,o),qt(Yt(a,Xt(e,t,n,r,i+1)),s)):(a&&qt(Yt(a,Zt(e,t,i+1)),s),Jt(t,n,i,s),o&&qt(Yt(o,Zt(n,r,i+1)),s)),Jt(r,null,i,s),new T(s)}function Zt(e,t,n){let r=[];return Jt(null,e,n,r),e.depth>n&&qt(Yt(Kt(e,t,n+1),Zt(e,t,n+1)),r),Jt(t,null,n,r),new T(r)}function Qt(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(T.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var $t=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return E.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive!==!1||r&&i[a].isInSet(r.marks)||(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive!==!1||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new rn(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=nn.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else nn.set(t,r=new en);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%tn,i}},en=class{constructor(){this.elts=[],this.i=0}},tn=12,nn=new WeakMap,rn=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},an=Object.create(null),on=class e{constructor(e,t,n,r=E.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||T.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&zt(this.attrs,t||e.defaultAttrs||an)&&E.sameSet(this.marks,n||E.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return D.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new D(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return Ut(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return $t.resolveCached(this,e)}resolveNoCache(e){return $t.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),cn(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=T.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),ln(this.type.attrs,this.attrs,`node`,this.type.name);let e=E.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];ln(n.type.attrs,n.attrs,`mark`,n.type.name),e=n.addToSet(e)}if(!E.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=T.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};on.prototype.text=void 0;var sn=class e extends on{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):cn(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function cn(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function ln(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}var un=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new dn(t,n);if(r.next==null)return e.empty;let i=fn(r);r.next&&r.err(`Unexpected trailing text`);let a=Sn(yn(i));return Cn(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return T.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];a.isLeaf||a.hasRequiredAttrs()||a.name in t||r.type&&!o.validEnd||(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
2
|
-
`)}};un.empty=new un(!0);var dn=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function fn(e){let t=[];do t.push(pn(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function pn(e){let t=[];do t.push(mn(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function mn(e){let t=vn(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=gn(e,t);else break;return t}function hn(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function gn(e,t){let n=hn(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:hn(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function _n(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function vn(e){if(e.eat(`(`)){let t=fn(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=_n(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function yn(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function bn(e,t){return t-e}function xn(e,t){let n=[];return r(t),n.sort(bn);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Sn(e){let t=Object.create(null);return n(xn(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);xn(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new un(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(bn);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Cn(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function wn(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Tn(e,t){let n=Object.create(null);for(let r in e){let i=e[r],a=t&&t[r];if(a===void 0){if(i.hasDefault)a=i.default;else throw RangeError(`No value supplied for attribute `+r)}else i.validate&&i.validate(a);n[r]=a}return n}function En(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new kn(e,r,t[r]);return n}var Dn=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=En(e,n.attrs),this.defaultAttrs=wn(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==un.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Tn(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new on(this,this.computeAttrs(e),T.from(t),E.setFrom(n))}createChecked(e=null,t,n){return t=T.from(t),this.checkContent(t),new on(this,this.computeAttrs(e),t,E.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=T.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(T.empty,!0);return i?new on(this,e,t.append(i),E.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:E.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function On(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var kn=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?On(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},An=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=En(e,r.attrs),this.excluded=null;let i=wn(this.attrs);this.instance=i?new E(this,i):null}create(e=null){return!e&&this.instance?this.instance:new E(this,Tn(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}},jn=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=Mt.from(e.nodes),t.marks=Mt.from(e.marks||{}),this.nodes=Dn.compile(this.spec.nodes,this),this.marks=An.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=un.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?Mn(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:Mn(this,n.split(` `))}this.nodeFromJSON=e=>on.fromJSON(this,e),this.markFromJSON=e=>E.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof Dn))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new sn(n,n.defaultAttrs,e,E.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function Mn(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function Nn(e){return e.tag!=null}function Pn(e){return e.style!=null}var Fn=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(Nn(e))this.tags.push(e);else if(Pn(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new Wn(this,t,!1);return n.addAll(e,E.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Wn(this,t,!0);return n.addAll(e,E.none,t.from,t.to),D.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Kn(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=qn(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=qn(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},In={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Ln={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Rn={ol:!0,ul:!0},zn=1,Bn=2,Vn=4;function Hn(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?zn:0)|(t===`full`?Bn:0)}var Un=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=E.none,this.match=i||(a&Vn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(T.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&zn)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=T.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(T.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!In.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},Wn=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=Hn(null,t.preserveWhitespace,0)|(n?Vn:0);i=r?new Un(r.type,r.attrs,E.none,!0,t.topMatch||r.type.contentMatch,a):n?new Un(null,null,E.none,!0,null,a):new Un(e.schema.topNodeType,null,E.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&Bn?`full`:this.localPreserveWS||(r.options&zn)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
|
|
3
|
-
`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;
|
|
4
|
-
`),t)}ignoreFallback(e,t){e.nodeName!=`BR`||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node){if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=E.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):Jn(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=Hn(e,i,a.options);a.options&Vn&&a.content.length==0&&(o|=Vn);let s=E.none;return n=n.filter(t=>!(a.type?a.type.allowsMarkType(t.type):Jn(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new Un(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=zn);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function Gn(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Rn.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function Kn(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function qn(e){let t={};for(let n in e)t[n]=e[n];return t}function Jn(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var Yn=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=Zn(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name])a++;else{if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return Zn(t).createTextNode(e.text);let{dom:n,contentDOM:r}=tr(Zn(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&tr(Zn(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:tr(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Xn(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Xn(e.marks)}};function Xn(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Zn(e){return e.document||window.document}var Qn=new WeakMap;function $n(e){let t=Qn.get(e);return t===void 0&&Qn.set(e,t=er(e)),t}function er(e){let t=null;function n(e){if(e&&typeof e==`object`){if(Array.isArray(e)){if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t])}else for(let t in e)n(e[t])}}return n(e),t}function tr(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=$n(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=tr(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var nr=65535,rr=2**16;function ir(e,t){return e+t*rr}function ar(e){return e&nr}function or(e){return(e-(e&nr))/rr}var sr=1,cr=2,lr=4,ur=8,dr=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&ur)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&lr)>0}},fr=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=ar(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+or(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:ir(o/3,e-s),f=0;return c&&(f|=e==s?cr:e==u?sr:lr,(t<0?e!=s:e!=u)&&(f|=ur)),new dr(a,f,d)}r+=l-c}return n?e+r:new dr(e+r,0,null)}touches(e,t){let n=0,r=ar(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};fr.empty=new fr([]);var pr=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new dr(e,r,null)}},mr=Object.create(null),hr=class{getMap(){return fr.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=mr[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in mr)throw RangeError(`Duplicate use of step JSON ID `+e);return mr[e]=t,t.prototype.jsonID=e,t}},gr=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof Bt)return e.fail(t.message);throw t}}};function _r(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(_r(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return T.fromArray(r)}var vr=class e extends hr{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new D(_r(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return gr.fromReplace(e,this.from,this.to,i)}invert(){return new yr(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};hr.jsonID(`addMark`,vr);var yr=class e extends hr{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new D(_r(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return gr.fromReplace(e,this.from,this.to,n)}invert(){return new vr(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};hr.jsonID(`removeMark`,yr);var br=class e extends hr{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return gr.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return gr.fromReplace(e,this.pos,this.pos+1,new D(T.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new xr(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};hr.jsonID(`addNodeMark`,br);var xr=class e extends hr{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return gr.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return gr.fromReplace(e,this.pos,this.pos+1,new D(T.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new br(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};hr.jsonID(`removeNodeMark`,xr);var Sr=class e extends hr{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&wr(e,this.from,this.to)?gr.fail(`Structure replace would overwrite content`):gr.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new fr([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?D.empty:new D(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?D.empty:new D(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,D.fromJSON(t,n.slice),!!n.structure)}};Sr.MAP_BIAS=1,hr.jsonID(`replace`,Sr);var Cr=class e extends hr{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(wr(e,this.from,this.gapFrom)||wr(e,this.gapTo,this.to)))return gr.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return gr.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?gr.fromReplace(e,this.from,this.to,n):gr.fail(`Content does not fit in gap`)}getMap(){return new fr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,D.fromJSON(t,n.slice),n.insert,!!n.structure)}};hr.jsonID(`replaceAround`,Cr);function wr(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Tr(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new yr(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new vr(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Er(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof An){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new yr(t.from,t.to,t.style)))}function Dr(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new Sr(s,l,D.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new yr(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new D(T.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new Sr(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(T.empty,!0);e.replace(s,s,new D(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Or(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function kr(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!Or(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function Ar(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=T.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=T.from(r.node(e).copy(u)),d++):c--;let f=T.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=T.from(i.node(e).copy(f)),p++):l++;e.step(new Cr(c,l,o,s,new D(u.append(f),d,p),u.size-d,!0))}function jr(e,t,n=null,r=e){let i=Nr(e,t),a=i&&Pr(r,t);return a?i.map(Mr).concat({type:t,attrs:n}).concat(a.map(Mr)):null}function Mr(e){return{type:e,attrs:null}}function Nr(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function Pr(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function Fr(e,t,n){let r=T.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=T.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new Cr(i,a,i,a,new D(r,0,0),n.length,!0))}function Ir(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&zr(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&Rr(e,t,n,a),Dr(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Cr(c,l,c+1,l-1,new D(T.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Lr(e,t,n,a),!1}})}function Lr(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function Rr(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
|
|
5
|
-
`))}})}function zr(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Br(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new Cr(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new D(T.from(o),0,0),1,!0))}function Vr(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function Hr(e,t,n=1,r){let i=e.doc.resolve(t),a=T.empty,o=T.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=T.from(i.node(e).copy(a));let t=r&&r[s];o=T.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new Sr(t,t,new D(a.append(o),n,n),!0))}function Ur(e,t){let n=e.resolve(t),r=n.index();return Gr(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Wr(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function Gr(e,t){return!!(e&&t&&!e.isLeaf&&Wr(e,t))}function Kr(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&Gr(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function qr(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);Rr(e,r.node(),r.before(),s)}o.inlineContent&&Dr(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new Sr(l,c.map(t+n,-1),D.empty,!0)),r===!0){let t=e.doc.resolve(l);Lr(e,t.node(),t.before(),e.steps.length)}return e}function Jr(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function Yr(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Xr(e,t,n=t,r=D.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return Zr(i,a,r)?new Sr(t,n,r):new Qr(i,a,r).fit()}function Zr(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var Qr=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=T.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=T.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new D(i,a,o);return e>-1?new Cr(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new Sr(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=ti(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(T.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced;return oi(e,-1)<=t?!1:(this.unplaced.size>1&&oi(e,1)>n&&n++,this.unplaced=new D(e,t+1,n),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=ti(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new D($r(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new D($r(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(ni(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=ei(this.placed,t,T.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?D.empty:new D($r(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new D($r(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!ri(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=ri(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=ri(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=ei(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=ei(this.placed,this.depth,T.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(T.empty,!0);e.childCount&&(this.placed=ei(this.placed,this.frontier.length,e))}};function $r(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy($r(e.firstChild.content,t-1,n)))}function ei(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(ei(e.lastChild.content,t-1,n)))}function ti(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function ni(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,ni(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(T.empty,!0)))),e.copy(r)}function ri(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!ii(n,a.content,o)?s:null}function ii(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function ai(e){return e.spec.defining||e.spec.definingForContent}function oi(e,t){for(let n=0;;n++){let r=t<0?e.firstChild:e.lastChild;if(!r||r.isAtom)return n;e=r.content}}function si(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(Zr(i,a,r))return e.step(new Sr(t,n,r));let o=di(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=ai(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new D(ci(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function ci(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(ci(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(T.empty,!0))}return e}function li(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=Jr(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new D(T.from(r),0,0))}function ui(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=di(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function di(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var fi=class e extends hr{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return gr.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return gr.fromReplace(e,this.pos,this.pos+1,new D(T.from(r),0,+!t.isLeaf))}getMap(){return fr.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};hr.jsonID(`attr`,fi);var pi=class e extends hr{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return gr.ok(n)}getMap(){return fr.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};hr.jsonID(`docAttr`,pi);var mi=class extends Error{};mi=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},mi.prototype=Object.create(Error.prototype),mi.prototype.constructor=mi,mi.prototype.name=`TransformError`;var hi=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new pr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new mi(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=D.empty){let r=Xr(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new D(T.from(n),0,0))}delete(e,t){return this.replace(e,t,D.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return si(this,e,t,n),this}replaceRangeWith(e,t,n){return li(this,e,t,n),this}deleteRange(e,t){return ui(this,e,t),this}lift(e,t){return Ar(this,e,t),this}join(e,t=1){return qr(this,e,t),this}wrap(e,t){return Fr(this,e,t),this}setBlockType(e,t=e,n,r=null){return Ir(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return Br(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new fi(e,t,n)),this}setDocAttribute(e,t){return this.step(new pi(e,t)),this}addNodeMark(e,t){return this.step(new br(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof E)t.isInSet(n.marks)&&this.step(new xr(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new xr(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return Hr(this,e,t,n),this}addMark(e,t,n){return Tr(this,e,t,n),this}removeMark(e,t,n){return Er(this,e,t,n),this}clearIncompatible(e,t,n){return Dr(this,e,t,n),this}},gi=Object.create(null),O=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new _i(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=D.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?D.empty:t),o==0&&Ti(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){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),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),Ti(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new k(e):wi(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?wi(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):wi(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Si(e.node(0))}static atStart(e){return wi(e,e,0,0,1)||new Si(e)}static atEnd(e){return wi(e,e,e.content.size,e.childCount,-1)||new Si(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=gi[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in gi)throw RangeError(`Duplicate use of selection JSON ID `+e);return gi[e]=t,t.prototype.jsonID=e,t}getBookmark(){return k.between(this.$anchor,this.$head).getBookmark()}};O.prototype.visible=!0;var _i=class{constructor(e,t){this.$from=e,this.$to=t}},vi=!1;function yi(e){!vi&&!e.parent.inlineContent&&(vi=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var k=class e extends O{constructor(e,t=e){yi(e),yi(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return O.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=D.empty){if(super.replace(e,t),t==D.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new bi(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=O.findFrom(n,r,!0)||O.findFrom(n,-r,!0);if(e)n=e.$head;else return O.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(O.findFrom(t,-r,!0)||O.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};O.jsonID(`text`,k);var bi=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){return k.between(e.resolve(this.anchor),e.resolve(this.head))}},A=class e extends O{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?O.near(a):new e(a)}content(){return new D(T.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new xi(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};A.prototype.visible=!1,O.jsonID(`node`,A);var xi=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new bi(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&A.isSelectable(n)?new A(t):O.near(t)}},Si=class e extends O{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=D.empty){if(t==D.empty){e.delete(0,e.doc.content.size);let t=O.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return Ci}};O.jsonID(`all`,Si);var Ci={map(){return this},resolve(e){return new Si(e)}};function wi(e,t,n,r,i,a=!1){if(t.inlineContent)return k.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=wi(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&A.isSelectable(r))return A.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function Ti(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Sr||i instanceof Cr))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(O.near(e.doc.resolve(o),n))}var Ei=1,Di=2,Oi=4,ki=class extends hi{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Ei)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Ei)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Di,this}ensureMarks(e){return E.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Di)>0}addStep(e,t){super.addStep(e,t),this.updated&=-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||E.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(O.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Oi,this}get scrolledIntoView(){return(this.updated&Oi)>0}};function Ai(e,t){return!t||!e?e:e.bind(t)}var ji=class{constructor(e,t,n){this.name=e,this.init=Ai(t.init,n),this.apply=Ai(t.apply,n)}},Mi=[new ji(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new ji(`selection`,{init(e,t){return e.selection||O.atStart(t.doc)},apply(e){return e.selection}}),new ji(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new ji(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],Ni=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Mi.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new ji(e.key,e.spec.state,e))})}},Pi=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new ki(this)}static create(t){let n=new Ni(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new Ni(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new Ni(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=on.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=O.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function Fi(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=Fi(i,t,{})),n[r]=i}return n}var j=class{constructor(e){this.spec=e,this.props={},e.props&&Fi(e.props,this,this.props),this.key=e.key?e.key.key:Li(`plugin`)}getState(e){return e[this.key]}},Ii=Object.create(null);function Li(e){return e in Ii?e+`$`+ ++Ii[e]:(Ii[e]=0,e+`$`)}var M=class{constructor(e=`key`){this.key=Li(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},Ri=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function zi(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var Bi=(e,t,n)=>{let r=zi(e,n);if(!r)return!1;let i=Ki(r);if(!i){let n=r.blockRange(),i=n&&kr(n);return i!=null&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(ua(e,i,t,-1))return!0;if(r.parent.content.size==0&&(Wi(a,`end`)||A.isSelectable(a)))for(let n=r.depth;;n--){let o=Xr(e.doc,r.before(n),r.after(n),D.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(Wi(a,`end`)?O.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):A.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},Vi=(e,t,n)=>{let r=zi(e,n);if(!r)return!1;let i=Ki(r);return i?Ui(e,i,t):!1},Hi=(e,t,n)=>{let r=qi(e,n);if(!r)return!1;let i=Xi(r);return i?Ui(e,i,t):!1};function Ui(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=Xr(e.doc,i,o,D.empty);if(!s||s.from!=i||s instanceof Sr&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(k.create(t.doc,i)),n(t.scrollIntoView())}return!0}function Wi(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var Gi=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=Ki(r)}let o=a&&a.nodeBefore;return!o||!A.isSelectable(o)?!1:(t&&t(e.tr.setSelection(A.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function Ki(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function qi(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var Ji=(e,t,n)=>{let r=qi(e,n);if(!r)return!1;let i=Xi(r);if(!i)return!1;let a=i.nodeAfter;if(ua(e,i,t,1))return!0;if(r.parent.content.size==0&&(Wi(a,`start`)||A.isSelectable(a))){let n=Xr(e.doc,r.before(),r.after(),D.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Wi(a,`start`)?O.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):A.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},Yi=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=Xi(r)}let o=a&&a.nodeAfter;return!o||!A.isSelectable(o)?!1:(t&&t(e.tr.setSelection(A.create(e.doc,a.pos)).scrollIntoView()),!0)};function Xi(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var Zi=(e,t)=>{let n=e.selection,r=n instanceof A,i;if(r){if(n.node.isTextblock||!Ur(e.doc,n.from))return!1;i=n.from}else if(i=Kr(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(A.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},Qi=(e,t)=>{let n=e.selection,r;if(n instanceof A){if(n.node.isTextblock||!Ur(e.doc,n.to))return!1;r=n.to}else if(r=Kr(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},$i=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&kr(i);return a!=null&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},ea=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
6
|
-
`).scrollIntoView()),!0)};function ta(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var na=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=ta(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(O.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},ra=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Si||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=ta(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(k.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},ia=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(Vr(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&kr(r);return i!=null&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function aa(e){return(t,n)=>{if(t.selection instanceof A&&t.selection.node.isBlock){let{$from:e}=t.selection;return!e.parentOffset||!Vr(t.doc,e.pos)?!1:(n&&n(t.tr.split(e.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let r=t.tr;!t.selection.empty&&(t.selection instanceof k||t.selection instanceof Si)&&r.deleteSelection();let{$from:i}=r.selection,a=r.steps.length,o=[],s,c,l=!1,u=!1;for(let t=i.depth;;t--)if(i.node(t).isBlock){l=i.end(t)==i.pos+(i.depth-t),u=i.start(t)==i.pos-(i.depth-t),c=ta(i.node(t-1).contentMatchAt(i.indexAfter(t-1)));let n=e&&e(i.parent,l,i);o.unshift(n||(l&&c?{type:c}:null)),s=t;break}else{if(t==1)return!1;o.unshift(null)}let d=i.pos,f=Vr(r.doc,d,o.length,o);if(f||=(o[0]=c?{type:c}:null,Vr(r.doc,d,o.length,o)),!f)return!1;if(r.split(d,o.length,o),!l&&u&&i.node(s).type!=c){let e=r.mapping.slice(a),t=e.map(i.before(s)),n=r.doc.resolve(t);c&&i.node(s-1).canReplaceWith(n.index(),n.index()+1,c)&&r.setNodeMarkup(e.map(i.before(s)),c)}return n&&n(r.scrollIntoView()),!0}}var oa=aa(),sa=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a!=0&&(i=n.before(a),t&&t(e.tr.setSelection(A.create(e.doc,i))),!0)},ca=(e,t)=>(t&&t(e.tr.setSelection(new Si(e.doc))),!0);function la(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||Ur(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function ua(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&la(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=T.empty;for(let e=o.length-1;e>=0;e--)s=T.from(o[e].create(null,s));s=T.from(i.copy(s));let c=e.tr.step(new Cr(t.pos-1,r,t.pos,r,new D(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&Ur(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:O.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&kr(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&Wi(a,`start`,!0)&&Wi(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=T.empty;for(let e=o.length-1;e>=0;e--)r=T.from(o[e].copy(r));n(e.tr.step(new Cr(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new D(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function da(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(k.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var fa=da(-1),pa=da(1);function ma(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&jr(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function ha(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(e,t)){if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function ga(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var _a=ga(Ri,Bi,Gi),va=ga(Ri,Ji,Yi),ya={Enter:ga(ea,ra,ia,oa),"Mod-Enter":na,Backspace:_a,"Mod-Backspace":_a,"Shift-Backspace":_a,Delete:va,"Mod-Delete":va,"Mod-a":ca},ba={"Ctrl-h":ya.Backspace,"Alt-Backspace":ya[`Mod-Backspace`],"Ctrl-d":ya.Delete,"Ctrl-Alt-Backspace":ya[`Mod-Delete`],"Alt-Delete":ya[`Mod-Delete`],"Alt-d":ya[`Mod-Delete`],"Ctrl-a":fa,"Ctrl-e":pa};for(let e in ya)ba[e]=ya[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function xa(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return Sa(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function Sa(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new rn(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new rn(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=jr(a,n,r,t);return s?(e&&Ca(e,t,s,i,n),!0):!1}function Ca(e,t,n,r,i){let a=T.empty;for(let e=n.length-1;e>=0;e--)a=T.from(n[e].type.create(n[e].attrs,a));e.step(new Cr(t.start-(r?2:0),t.end,t.start,t.end,new D(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&Vr(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function wa(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?Ta(t,n,e,a):Ea(t,n,a):!0:!1}}function Ta(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new Cr(a-1,o,a,o,new D(T.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new rn(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=kr(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return Ur(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function Ea(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?T.empty:T.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new Cr(d-+!!s,f+ +!!c,d+1,f-1,new D((s?T.empty:T.from(i.copy(T.empty))).append(c?T.empty:T.from(i.copy(T.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function Da(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=T.from(r?e.create():null),o=new D(T.from(e.create(null,T.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new Cr(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var Oa=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},ka=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},Aa=null,ja=function(e,t,n){let r=Aa||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},Ma=function(){Aa=null},Na=function(e,t,n,r){return n&&(Fa(e,t,n,r,-1)||Fa(e,t,n,r,1))},Pa=/^(img|br|input|textarea|hr)$/i;function Fa(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Ia(e))){let n=e.parentNode;if(!n||!N(n)||Ha(e)||Pa.test(e.nodeName)||e.contentEditable==`false`)return!1;t=Oa(e)+(i<0?0:1),e=n}else if(N(e)){let n=e.childNodes[t+(i<0?-1:0)];if(N(n)&&n.contentEditable==`false`){if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1}else e=n,t=i<0?Ia(e):0}else return!1}}function Ia(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function N(e){return e.nodeType==1}function La(e){return e.nodeType==3}function Ra(e,t){return t?e.contains(N(t)?t:t.parentNode):!1}function za(e,t){for(;;){if(La(e)&&t)return e;if(N(e)&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=Ia(e)}else if(e.parentNode&&!Ha(e))t=Oa(e),e=e.parentNode;else return null}}function Ba(e,t){for(;;){if(La(e)&&t<e.nodeValue.length)return e;if(N(e)&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!Ha(e))t=Oa(e)+1,e=e.parentNode;else return null}}function Va(e,t,n){for(let r=t==0,i=t==Ia(e);r||i;){if(e==n)return!0;let t=Oa(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==Ia(e)}}function Ha(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var Ua=function(e){return e.focusNode&&Na(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Wa(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function Ga(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Ka(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Ia(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Ia(r.startContainer),r.startOffset)}}}var qa=typeof navigator<`u`?navigator:null,Ja=typeof document<`u`?document:null,Ya=qa&&qa.userAgent||``,Xa=/Edge\/(\d+)/.exec(Ya),Za=/MSIE \d/.exec(Ya),Qa=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ya),$a=!!(Za||Qa||Xa),eo=Za?document.documentMode:Qa?+Qa[1]:Xa?+Xa[1]:0,to=!$a&&/gecko\/(\d+)/i.test(Ya);to&&+(/Firefox\/(\d+)/.exec(Ya)||[0,0])[1];var no=!$a&&/Chrome\/(\d+)/.exec(Ya),ro=!!no,io=no?+no[1]:0,ao=!$a&&!!qa&&/Apple Computer/.test(qa.vendor),oo=ao&&(/Mobile\/\w+/.test(Ya)||!!qa&&qa.maxTouchPoints>2),so=oo||(qa?/Mac/.test(qa.platform):!1),co=qa?/Win/.test(qa.platform):!1,lo=/Android \d/.test(Ya),uo=!!Ja&&`webkitFontSmoothing`in Ja.documentElement.style,fo=uo?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function po(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function mo(e,t){return typeof e==`number`?e:e[t]}function ho(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function go(e,t,n){if(!jo(t)&&t.left==0)return;let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(!N(o)){o=ka(o);continue}let e=o==a.body,n=e?po(a):ho(o),s=0,c=0;if(t.top<n.top+mo(r,`top`)?c=-(n.top-t.top+mo(i,`top`)):t.bottom>n.bottom-mo(r,`bottom`)&&(c=t.bottom-t.top>n.bottom-n.top?t.top+mo(i,`top`)-n.top:t.bottom-n.bottom+mo(i,`bottom`)),t.left<n.left+mo(r,`left`)?s=-(n.left-t.left+mo(i,`left`)):t.right>n.right-mo(r,`right`)&&(s=t.right-n.right+mo(i,`right`)),s||c){if(e)a.defaultView.scrollBy(s,c);else{let e=o.scrollLeft,n=o.scrollTop;c&&(o.scrollTop+=c),s&&(o.scrollLeft+=s);let r=o.scrollLeft-e,i=o.scrollTop-n;t={left:t.left-r,top:t.top-i,right:t.right-r,bottom:t.bottom-i}}}let l=e?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(l))break;o=l==`absolute`?o.offsetParent:ka(o)}}function _o(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:vo(e.dom)}}function vo(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=ka(r));return t}function yo({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;bo(n,r==0?0:r-t)}function bo(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var xo=null;function So(e){if(e.setActive)return e.setActive();if(xo)return e.focus(xo);let t=vo(e);e.focus(xo==null?{get preventScroll(){return xo={preventScroll:!0},!0}}:void 0),xo||(xo=!1,bo(t,0))}function Co(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(N(u))e=u.getClientRects();else if(La(u))e=ja(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&La(n)?{left:p.right<t.left?p.right:p.left,top:t.top}:t,N(u)&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&La(n)?wo(n,i):!n||r?{node:e,offset:a}:Co(n,i)}function wo(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=Mo(r,1);if(n.top!=n.bottom&&To(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function To(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Eo(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function Do(e,t,n){let{node:r,offset:i}=Co(t,n),a=-1;if(N(r)&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function Oo(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(N(t.dom)&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function ko(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(N(n)){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(To(t,i))return ko(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function Ao(e,t){let n=e.dom.ownerDocument,r,i=0,a=Ka(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o)){let n=e.dom.getBoundingClientRect();if(!To(t,n)||(o=ko(e.dom,t,n),!o))return null}if(ao)for(let e=o;r&&e;e=ka(e))e.draggable&&(r=void 0);if(o=Eo(o,t),r){if(to&&N(r)&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;uo&&i&&N(r)&&N(n=r.childNodes[i-1])&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&N(r.lastChild)&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:i!=0&&N(r)&&r.childNodes[i-1].nodeName==`BR`||(s=Oo(e,r,i,t))}s??=Do(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function jo(e){return e.top<e.bottom||e.left<e.right}function Mo(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(jo(e))return e}return Array.prototype.find.call(n,jo)||e.getBoundingClientRect()}var No=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Po(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=uo||to;if(La(r)){if(o&&(No.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=Mo(ja(r,i,i),n);if(to&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=Mo(ja(r,i-1,i-1),-1);if(t.top==e.top){let n=Mo(ja(r,i,i+1),-1);if(n.top!=e.top)return Fo(n,n.left<t.left)}}return e}{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,Fo(Mo(ja(r,e,t),a),a<0)}}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==Ia(r))){let e=r.childNodes[i-1];if(N(e))return Io(e.getBoundingClientRect(),!1)}if(a==null&&i<Ia(r)){let e=r.childNodes[i];if(N(e))return Io(e.getBoundingClientRect(),!0)}return Io(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==Ia(r))){let e=r.childNodes[i-1],t=La(e)?ja(e,Ia(e)-+!o):N(e)&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return Fo(Mo(t,1),!1)}if(a==null&&i<Ia(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?La(e)?ja(e,0,+!o):N(e)?e:null:null;if(t)return Fo(Mo(t,-1),!0)}return Fo(Mo(La(r)?ja(r):r,-n),n>=0)}function Fo(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Io(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Lo(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function Ro(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return Lo(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=Po(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(N(e))t=e.getClientRects();else if(La(e))t=ja(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var zo=/[\u0590-\u08ac]/;function Bo(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!zo.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:Lo(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!Ra(l,u)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var Vo=null,Ho=null,Uo=!1;function Wo(e,t,n){return Vo==t&&Ho==n?Uo:(Vo=t,Ho=n,Uo=n==`up`||n==`down`?Ro(e,t,n):Bo(e,t,n))}var Go=0,Ko=1,qo=2,Jo=3,Yo=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=Go,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&Ra(this.contentDOM,e)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>Oa(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=!!(e.compareDocumentPosition(this.contentDOM)&4);else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node)){if(n&&(a=i.nodeDOM)&&!(N(a)?Ra(a,e):a==e))n=!1;else return i}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(;n>0;n--){let e=this.children[n-1];if(e.size||!(e instanceof ns||e instanceof Xo&&e.side>=0))break}if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?Oa(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?Oa(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=Oa(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=Oa(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(!N(t)||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((to||ao)&&e==t){let{node:e,offset:t}=o;if(La(e)){if(u=!!(t&&e.nodeValue[t-1]==`
|
|
7
|
-
`),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:Oa(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(to&&l.focusNode&&l.focusNode!=s.node&&N(l.focusNode)){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&ao)&&Na(o.node,o.offset,l.anchorNode,l.anchorOffset)&&Na(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&to)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?qo:Ko,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Jo:i.markDirty(e-r,t-r);return}i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?qo:Jo}n=a}this.dirty=qo}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?qo:Ko;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},Xo=class extends Yo{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){let e=N(a)?a:document.createElement(`span`);e!=a&&e.appendChild(a),e.hasAttribute(`contenteditable`)||(e.contentEditable=`false`),e.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==Go&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},Zo=class extends Yo{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},Qo=class e extends Yo{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return o&&o.dom||(o=Yn.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Jo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Jo&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Go){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=Go}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=bs(a,n,o,r)),t>0&&(a=bs(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},$o=class e extends Yo{constructor(e,t,n,r,i,a,o){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(!La(u))throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=Yn.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=ds(u,r,n),l?c=new rs(t,n,r,i,u,d||null,f,l):n.isText?new ts(t,n,r,i,u,f):new e(t,n,r,i,u,d||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(t.preserveWhitespace=`full`),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}if(!t.contentElement){let n=e&&e.find(t=>N(t)&&e.indexOf(t.parentNode)<0&&this.dom.contains(t));n?t.contentElement=n:t.getContent=()=>T.empty}}return t}matchesNode(e,t,n){return this.dirty==Go&&e.eq(this.node)&&fs(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new ms(this,a&&a.node,e),c=this.node.inlineContent,l=c&&this.node.isBlock;_s(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?E.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,u,d)=>{s.syncToMarks(t.marks,n,e,d),l&&t.isAtom&&!t.isText&&s.addHackNode(`IMG`,s.top);let f;s.findNodeMatch(t,a,u,d)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(f=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,u,f,e)||s.updateNextNode(t,a,u,e,d,r)||s.addNode(t,a,u,e,r),r+=t.nodeSize,c&&(l=t.isAtom&&!t.isText)}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==qo)&&(a&&this.protectLocalComposition(e,a),is(this.contentDOM,this.children,e),oo&&vs(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof k)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=ys(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let a=new Zo(this,i,t,r);e.input.compositionNodes.push(a),this.children=bs(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==Jo||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=Go}updateOuterDeco(e){if(fs(e,this.outerDeco))return;let t=!N(this.nodeDOM),n=this.dom;this.dom=ls(this.dom,this.nodeDOM,cs(this.outerDeco,this.node,t),cs(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){N(this.nodeDOM)&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){N(this.nodeDOM)&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function es(e,t,n,r,i){ds(r,t,e);let a=new $o(void 0,e,t,n,r,r,r);return a.contentDOM&&a.updateChildren(i,0),a}var ts=class e extends $o{constructor(e,t,n,r,i,a){super(e,t,n,r,i,null,a)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==Jo||this.dirty!=Go&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Go||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=Go,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Jo)}get domAtom(){return!1}isText(e){return this.node.text==e}},ns=class extends Yo{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Go&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},rs=class extends $o{constructor(e,t,n,r,i,a,o,s){super(e,t,n,r,i,a,o),this.spec=s}update(e,t,n,r){if(this.dirty==Jo)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function is(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=ps(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof Qo){let t=r?r.previousSibling:e.lastChild;is(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=ps(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var as=function(e){e&&(this.nodeName=e)};as.prototype=Object.create(null);var ss=[new as];function cs(e,t,n){if(e.length==0)return ss;let r=n?ss[0]:new as,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new as(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new as(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function ls(e,t,n,r){if(n==ss&&r==ss)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName||(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=ss[0]),i=t}us(i,o||ss[0],a)}return i}function us(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function ds(e,t,n){return ls(e,e,ss,cs(t,n,!N(e)))}function fs(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function ps(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var ms=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=hs(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=Go,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i<0&&this.index<this.top.children.length){let t=this.top.children[this.index];t instanceof Qo&&t.dirty!=Jo&&t.mark.type==e[a].type&&t.spec.update&&!this.isLocked(t.dom)&&t.spec.update(e[a])&&(t.mark=e[a],i=this.index,this.changed=!0)}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=Qo.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==Jo&&a.dom==a.contentDOM&&(a.dirty=qo),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof $o){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=Jo&&fs(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=qo,u.updateChildren(r,a+1),u.dirty=Go),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!fs(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=$o.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=$o.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new Xo(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Qo;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof ts)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((ao||ro)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new ns(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||N(e)&&e.contains(this.lock.parentNode))}};function hs(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof Qo)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function gs(e,t){return e.type.side-t.type.side}function _s(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u){if(d){d.sort(gs);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c)}let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function vs(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function ys(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function bs(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function xs(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(Ua(n)){for(c=o;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&A.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&Va(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new A(o==e?s:r.resolve(e))}else if(to&&t==`key`&&o>e.state.selection.to&&N(n.focusNode)&&n.focusOffset==n.focusNode.childNodes.length&&i&&i.posAtStart>e.state.selection.to)for(let e=n.focusNode;;e=e.parentNode){if(getComputedStyle(e).overflow!=`visible`){l=O.findFrom(r.resolve(i.posAtStart),1);break}if(e==i.dom||e.nextSibling||!e.parentNode||!N(e.parentNode))break}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=Ms(e,u,s,n)}return l}function Ss(e){return e.editable?e.hasFocus():Ps(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Cs(e,t=!1){let n=e.state.selection;if(As(e,n),!Ss(e))return;let r=e.input.mouseDown;if(!t&&ro&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Na(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)ks(e);else{let{anchor:r,head:i}=n,a,o;ws&&!(n instanceof k)&&(n.$from.parent.inlineContent||(a=Ts(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Ts(e,n.to))),e.docView.setSelection(r,i,e,t),ws&&(a&&Ds(a),o&&Ds(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&Os(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}var ws=ao||ro&&io<63;function Ts(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(ao&&i&&i.contentEditable==`false`)return Es(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return Es(i);if(a)return Es(a)}}function Es(e){return e.contentEditable=`true`,ao&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Ds(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function Os(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!Ss(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function ks(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,Oa(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&$a&&eo<=11&&(n.disabled=!0,n.disabled=!1)}function As(e,t){if(t instanceof A){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(js(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else js(e)}function js(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function Ms(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||k.between(t,n,r)}function Ns(e){return e.editable&&!e.hasFocus()?!1:Ps(e)}function Ps(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return Ra(e.dom,t.anchorNode)&&(e.editable||Ra(e.dom,t.focusNode))}catch{return!1}}function Fs(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Na(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Is(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&O.findFrom(a,t)}function Ls(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Rs(e,t,n){let r=e.state.selection;if(r instanceof k){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return Ls(e,new k(r.$anchor,a))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=Is(e.state,t);return n&&n instanceof A?Ls(e,n):!1}if(!(so&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?A.isSelectable(i)?Ls(e,new A(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):Ls(e,new k(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1}}else if(r instanceof A&&r.node.isInline)return Ls(e,new k(t>0?r.$to:r.$from));else{let n=Is(e.state,t);return n?Ls(e,n):!1}}function zs(e,t){let n=e.pmViewDesc;return n?n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`):N(e)&&e.contentEditable==`false`}function Bs(e,t){return t<0?Vs(e):Hs(e)}function Vs(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(to&&N(n)&&r<Ia(n)&&zs(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(!N(n))break;let e=n.childNodes[r-1];if(zs(e,-1))i=n,a=--r;else if(La(e))n=e,r=n.nodeValue.length;else break}else if(Us(n))break;else{let t=n.previousSibling;for(;t&&zs(t,-1);)i=n.parentNode,a=Oa(t),t=t.previousSibling;if(t)n=t,r=Ia(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?Ks(e,n,r):i&&Ks(e,i,a)}function Hs(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Ia(n),a,o;for(;;)if(r<i){if(!N(n))break;let e=n.childNodes[r];if(zs(e,1))a=n,o=++r;else break}else if(Us(n))break;else{let t=n.nextSibling;for(;t&&zs(t,1);)a=t.parentNode,o=Oa(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=Ia(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&Ks(e,a,o)}function Us(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Ws(e,t){for(;e&&t==e.childNodes.length&&!Ha(e);)t=Oa(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(La(n))return n;if(N(n)&&n.contentEditable==`false`)break;e=n,t=0}}function Gs(e,t){for(;e&&!t&&!Ha(e);)t=Oa(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(La(n))return n;if(N(n)&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function Ks(e,t,n){if(!La(t)){let e,r;(r=Ws(t,n))?(t=r,n=0):(e=Gs(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Ua(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Cs(e)},50)}function qs(e,t){let n=e.state.doc.resolve(t);if(!(ro||co)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function Js(e,t,n){let r=e.state.selection;if(r instanceof k&&!r.empty||n.indexOf(`s`)>-1||so&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=Is(e.state,t);if(n&&n instanceof A)return Ls(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof Si?O.near(n,t):O.findFrom(n,t);return o?Ls(e,o):!1}return!1}function Ys(e,t){if(!(e.state.selection instanceof k))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function Xs(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Zs(e){if(!ao||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&N(t)&&n==0&&t.firstChild&&N(t.firstChild)&&t.firstChild.contentEditable==`false`){let n=t.firstChild;Xs(e,n,`true`),setTimeout(()=>Xs(e,n,`false`),20)}return!1}function Qs(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function $s(e,t){let n=t.keyCode,r=Qs(t);if(n==8||so&&n==72&&r==`c`)return Ys(e,-1)||Bs(e,-1);if(n==46&&!t.shiftKey||so&&n==68&&r==`c`)return Ys(e,1)||Bs(e,1);if(n==13||n==27)return!0;if(n==37||so&&n==66&&r==`c`){let t=n==37?qs(e,e.state.selection.from)==`ltr`?-1:1:-1;return Rs(e,t,r)||Bs(e,t)}if(n==39||so&&n==70&&r==`c`){let t=n==39?qs(e,e.state.selection.from)==`ltr`?1:-1:1;return Rs(e,t,r)||Bs(e,t)}return n==38||so&&n==80&&r==`c`?Js(e,-1,r)||Bs(e,-1):n==40||so&&n==78&&r==`c`?Zs(e)||Js(e,1,r)||Bs(e,1):!(r!=(so?`m`:`c`)||n!=66&&n!=73&&n!=89&&n!=90)}function ec(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||Yn.fromSchema(e.state.schema),s=uc(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&N(l)&&(u=lc[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&N(l)&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
|
|
1
|
+
import{$ as e,An as t,At as n,C as r,Cr as i,E as a,F as o,H as s,Hr as c,I as l,It as u,Jr as d,Jt as f,K as p,Kn as m,Kt as h,L as g,Mr as _,P as v,Pn as y,Q as b,Rn as x,S,Un as C,Ur as ee,Wn as w,Xn as te,Xt as ne,Yt as re,Zn as ie,Zr as ae,_ as oe,an as se,ci as ce,dr as le,ei as ue,er as de,et as fe,g as pe,gn as me,h as he,hn as ge,ii as T,it as _e,j as ve,jn as ye,nn as be,nt as xe,p as Se,pn as Ce,pr as we,q as Te,qt as Ee,rn as De,si as Oe,sr as ke,t as Ae,ui as je,v as Me,vr as Ne,wn as Pe,x as Fe,yr as Ie}from"./Button-Dai6Ph2c.js";import{A as Le,C as Re,D as ze,E as Be,F as Ve,I as He,L as Ue,M as We,N as Ge,O as Ke,P as qe,S as Je,T as Ye,a as Xe,b as Ze,i as Qe,j as $e,k as et,n as tt,o as nt,r as rt,s as it,t as at,v as ot,w as st,x as ct,y as lt}from"./index-Du-lvx2V.js";function ut(e,t){let n=fe(!1,300);xe(()=>{n.value=!1});let r=d(null),i=Te();function a(){r.value=null,n.value=!1}function o(e,t){if(!t)return;let i=e.currentTarget,a={x:e.clientX,y:e.clientY},o=ft(a,dt(a,i.getBoundingClientRect()),1),s=pt(t.getBoundingClientRect()),c=ht([...o,...s]);r.value=c,n.value=!0}return Ie(n=>{if(e.value&&t.value){let r=e.value,i=t.value,a=e=>o(e,i),s=e=>o(e,r);r.addEventListener(`pointerleave`,a),i.addEventListener(`pointerleave`,s),n(()=>{r.removeEventListener(`pointerleave`,a),i.removeEventListener(`pointerleave`,s)})}}),Ie(n=>{if(r.value){let o=n=>{if(!r.value||!(n.target instanceof Element))return;let o=n.target,s={x:n.clientX,y:n.clientY},c=e.value?.contains(o)||t.value?.contains(o),l=!mt(s,r.value),u=!!o.closest(`[data-grace-area-trigger]`);c?a():(l||u)&&(a(),i.trigger())},s=e.value?.ownerDocument;s?.addEventListener(`pointermove`,o),n(()=>s?.removeEventListener(`pointermove`,o))}}),{isPointerInTransit:n,onPointerExit:i.on}}function dt(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function ft(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}function pt(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function mt(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function ht(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),gt(t)}function gt(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t.at(-1),n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n.at(-1),t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var _t=se({__name:`BaseSeparator`,props:{orientation:{type:String,required:!1,default:`horizontal`},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let n=e,r=[`horizontal`,`vertical`];function a(e){return r.includes(e)}let o=h(()=>a(n.orientation)?n.orientation:`horizontal`),s=h(()=>o.value===`vertical`?n.orientation:void 0),c=h(()=>n.decorative?{role:`none`}:{"aria-orientation":s.value,role:`separator`});return(n,r)=>(w(),f(T(Fe),t({as:e.as,"as-child":e.asChild,"data-orientation":o.value},c.value),{default:i(()=>[ie(n.$slots,`default`)]),_:3},16,[`as`,`as-child`,`data-orientation`]))}}),vt=se({__name:`Separator`,props:{orientation:{type:String,required:!1,default:`horizontal`},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e;return(e,n)=>(w(),f(_t,ce(ge(t)),{default:i(()=>[ie(e.$slots,`default`)]),_:3},16))}}),yt=se({__name:`TooltipArrow`,props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`svg`}},setup(e){let t=e;return r(),(e,n)=>(w(),f(T(ot),ce(ge(t)),{default:i(()=>[ie(e.$slots,`default`)]),_:3},16))}}),bt=`tooltip.open`,[xt,St]=a(`TooltipRoot`),Ct=se({__name:`TooltipRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:[`update:open`],setup(e,{emit:t}){let n=e,a=t;r();let o=it(),s=h(()=>n.disableHoverableContent??o.disableHoverableContent.value),c=h(()=>n.disableClosingTrigger??o.disableClosingTrigger.value),l=h(()=>n.disabled??o.disabled.value),u=h(()=>n.delayDuration??o.delayDuration.value),m=h(()=>n.ignoreNonKeyboardFocus??o.ignoreNonKeyboardFocus.value),g=p(n,`open`,a,{defaultValue:n.defaultOpen,passive:n.open===void 0});Ne(g,e=>{o.onClose&&(e?(o.onOpen(),document.dispatchEvent(new CustomEvent(bt))):o.onClose())});let _=d(!1),v=d(),y=h(()=>g.value?_.value?`delayed-open`:`instant-open`:`closed`),{start:b,stop:x}=_e(()=>{_.value=!0,g.value=!0},u,{immediate:!1});function S(){x(),_.value=!1,g.value=!0}function C(){x(),g.value=!1}function ee(){b()}return St({contentId:``,open:g,stateAttribute:y,trigger:v,onTriggerChange(e){v.value=e},onTriggerEnter(){o.isOpenDelayed.value?ee():S()},onTriggerLeave(){s.value?C():x()},onOpen:S,onClose:C,disableHoverableContent:s,disableClosingTrigger:c,disabled:l,ignoreNonKeyboardFocus:m}),(e,t)=>(w(),f(T(Le),null,{default:i(()=>[ie(e.$slots,`default`,{open:T(g)})]),_:3}))}}),wt=se({__name:`TooltipContentImpl`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1,default:void 0},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:void 0},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1,default:void 0},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:a}){let o=e,c=a,u=xt(),d=it(),{forwardRef:p,currentElement:m}=r(),g=h(()=>o.ariaLabel||m.value?.textContent),_=h(()=>{let{ariaLabel:e,...t}=o;return l(t,d.content.value??{},{side:`top`,sideOffset:0,align:`center`,avoidCollisions:!0,collisionBoundary:[],collisionPadding:0,arrowPadding:0,sticky:`partial`,hideWhenDetached:!1})});return x(()=>{s(window,`scroll`,e=>{e.target?.contains(u.trigger.value)&&u.onClose()},{capture:!0}),s(document,bt,u.onClose)}),(e,r)=>(w(),f(T(We),{"as-child":``,"disable-outside-pointer-events":!1,onEscapeKeyDown:r[0]||=e=>c(`escapeKeyDown`,e),onPointerDownOutside:r[1]||=e=>{T(u).disableClosingTrigger.value&&T(u).trigger.value?.contains(e.target)&&e.preventDefault(),c(`pointerDownOutside`,e)},onFocusOutside:r[2]||=n(()=>{},[`prevent`]),onDismiss:r[3]||=e=>T(u).onClose()},{default:i(()=>[De(T(lt),t({ref:T(p),"data-state":T(u).stateAttribute.value},{...e.$attrs,..._.value},{style:{"--reka-tooltip-content-transform-origin":`var(--reka-popper-transform-origin)`,"--reka-tooltip-content-available-width":`var(--reka-popper-available-width)`,"--reka-tooltip-content-available-height":`var(--reka-popper-available-height)`,"--reka-tooltip-trigger-width":`var(--reka-popper-anchor-width)`,"--reka-tooltip-trigger-height":`var(--reka-popper-anchor-height)`}}),{default:i(()=>[ie(e.$slots,`default`),De(T(Me),{id:T(u).contentId,role:`tooltip`},{default:i(()=>[be(je(g.value),1)]),_:1},8,[`id`])]),_:3},16,[`data-state`])]),_:3}))}}),Tt=se({__name:`TooltipContentHoverable`,props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(e){let n=Ve(e),{forwardRef:a,currentElement:o}=r(),{trigger:c,onClose:l}=xt(),u=it(),{isPointerInTransit:d,onPointerExit:p}=ut(c,o);return u.isPointerInTransitRef=d,p(()=>{l()}),s(o,`pointermove`,e=>{let t=o.value;t&&e.pointerType!==`touch`&&t.ownerDocument.elementsFromPoint?.(e.clientX,e.clientY).some(e=>{if(t.contains(e))return!1;let n=e.closest(`[data-grace-area-trigger]`);return!!n&&n!==c.value})&&l()}),(e,r)=>(w(),f(wt,t({ref:T(a)},T(n)),{default:i(()=>[ie(e.$slots,`default`)]),_:3},16))}}),Et=se({__name:`TooltipContent`,props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:n}){let a=e,o=n,s=xt(),c=qe(a,o),{forwardRef:l}=r();return(n,r)=>(w(),f(T(S),{present:e.forceMount||T(s).open.value},{default:i(()=>[(w(),f(de(T(s).disableHoverableContent.value?wt:Tt),t({ref:T(l)},T(c)),{default:i(()=>[ie(n.$slots,`default`)]),_:3},16))]),_:3},8,[`present`]))}}),Dt=se({__name:`TooltipPortal`,props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){let t=e;return(e,n)=>(w(),f(T($e),ce(ge(t)),{default:i(()=>[ie(e.$slots,`default`)]),_:3},16))}}),Ot=se({__name:`TooltipTrigger`,props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let n=e,a=xt(),o=it();a.contentId||=Ge(void 0,`reka-tooltip-content`);let{forwardRef:s,currentElement:c}=r(),l=d(!1),u=d(!1),p=h(()=>a.disabled.value?{}:{click:x,focus:y,pointermove:_,pointerleave:v,pointerdown:g,blur:b});Ne(c,e=>{a.onTriggerChange(e)},{immediate:!0});function m(){setTimeout(()=>{l.value=!1},1)}function g(){a.open&&!a.disableClosingTrigger.value&&a.onClose(),l.value=!0,document.addEventListener(`pointerup`,m,{once:!0})}function _(e){e.pointerType!==`touch`&&!u.value&&!o.isPointerInTransitRef.value&&(a.onTriggerEnter(),u.value=!0)}function v(){a.onTriggerLeave(),u.value=!1}function y(e){l.value||(!a.ignoreNonKeyboardFocus.value||e.target.matches?.(`:focus-visible`))&&a.onOpen()}function b(){a.onClose()}function x(){a.disableClosingTrigger.value||a.onClose()}return(r,o)=>(w(),f(T(et),{"as-child":``,reference:e.reference??T(c)},{default:i(()=>[De(T(Fe),t({ref:T(s),"aria-describedby":T(a).open.value?T(a).contentId:void 0,"data-state":T(a).stateAttribute.value,as:e.as,"as-child":n.asChild,"data-grace-area-trigger":``},ke(p.value)),{default:i(()=>[ie(r.$slots,`default`)]),_:3},16,[`aria-describedby`,`data-state`,`as`,`as-child`])]),_:3},8,[`reference`]))}}),kt=Object.defineProperty,At=(e,t)=>{let n={};for(var r in e)kt(n,r,{get:e[r],enumerable:!0});return t||kt(n,Symbol.toStringTag,{value:`Module`}),n};function jt(e){this.content=e}jt.prototype={constructor:jt,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new jt(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new jt(n)},addToStart:function(e,t){return new jt([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new jt(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new jt(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=jt.from(e),e.size?new jt(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=jt.from(e),e.size?new jt(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=jt.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},jt.from=function(e){if(e instanceof jt)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new jt(t)};function Mt(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a)n+=i.nodeSize;else{if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&Ft(e.charCodeAt(r-1))&&Pt(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=Mt(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}}function Nt(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s)n-=c,r-=c;else{if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&Ft(e.charCodeAt(i-1))&&Pt(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=Nt(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}}function Pt(e){return e>=56320&&e<57344}function Ft(e){return e>=55296&&e<56320}var E=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Mt(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Nt(this,e,t,n)}findIndex(e){if(e==0)return Lt(0,e);if(e==this.size)return Lt(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Lt(t+1,i):Lt(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};E.empty=new E([],0);var It={index:0,offset:0};function Lt(e,t){return It.index=e,It.offset=t,It}function Rt(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Rt(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Rt(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var D=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Rt(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};D.none=[];var zt=class extends Error{},O=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Vt(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Bt(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(E.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};O.empty=new O(E.empty,0,0);function Bt(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Bt(a.content,t-i-1,n-i-1)))}function Vt(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=Vt(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function Ht(e,t,n){if(n.openStart>e.depth)throw new zt(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new zt(`Inconsistent open depths`);return Ut(e,t,n,0)}function Ut(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=Ut(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return Jt(a,Xt(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return Jt(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=Zt(n,e);return Jt(a,Yt(e,i,o,t,r))}}function Wt(e,t){if(!t.type.compatibleContent(e.type))throw new zt(`Cannot join `+t.type.name+` onto `+e.type.name)}function Gt(e,t,n){let r=e.node(n);return Wt(r,t.node(n)),r}function Kt(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function qt(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Kt(e.nodeAfter,r),a++));for(let e=a;e<o;e++)Kt(i.child(e),r);t&&t.depth==n&&t.textOffset&&Kt(t.nodeBefore,r)}function Jt(e,t){if(!e.type.validContent(t))throw new zt(`Invalid content for node `+e.type.name);return e.copy(t)}function Yt(e,t,n,r,i){let a=e.depth>i&&Gt(e,t,i+1),o=r.depth>i&&Gt(n,r,i+1),s=[];return qt(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Wt(a,o),Kt(Jt(a,Yt(e,t,n,r,i+1)),s)):(a&&Kt(Jt(a,Xt(e,t,i+1)),s),qt(t,n,i,s),o&&Kt(Jt(o,Xt(n,r,i+1)),s)),qt(r,null,i,s),new E(s)}function Xt(e,t,n){let r=[];return qt(null,e,n,r),e.depth>n&&Kt(Jt(Gt(e,t,n+1),Xt(e,t,n+1)),r),qt(t,null,n,r),new E(r)}function Zt(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(E.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Qt=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return D.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive!==!1||r&&i[a].isInSet(r.marks)||(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive!==!1||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new nn(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=tn.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else tn.set(t,r=new $t);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%en,i}},$t=class{constructor(){this.elts=[],this.i=0}},en=12,tn=new WeakMap,nn=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},rn=Object.create(null),an=class e{constructor(e,t,n,r=D.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||E.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Rt(this.attrs,t||e.defaultAttrs||rn)&&D.sameSet(this.marks,n||D.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return O.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new O(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return Ht(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Qt.resolveCached(this,e)}resolveNoCache(e){return Qt.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),sn(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=E.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),cn(this.type.attrs,this.attrs,`node`,this.type.name);let e=D.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];cn(n.type.attrs,n.attrs,`mark`,n.type.name),e=n.addToSet(e)}if(!D.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=E.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};an.prototype.text=void 0;var on=class e extends an{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):sn(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function sn(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function cn(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}var ln=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new un(t,n);if(r.next==null)return e.empty;let i=dn(r);r.next&&r.err(`Unexpected trailing text`);let a=xn(vn(i));return Sn(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return E.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];a.isLeaf||a.hasRequiredAttrs()||a.name in t||r.type&&!o.validEnd||(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
2
|
+
`)}};ln.empty=new ln(!0);var un=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function dn(e){let t=[];do t.push(fn(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function fn(e){let t=[];do t.push(pn(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function pn(e){let t=_n(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=hn(e,t);else break;return t}function mn(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function hn(e,t){let n=mn(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:mn(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function gn(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function _n(e){if(e.eat(`(`)){let t=dn(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=gn(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function vn(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function yn(e,t){return t-e}function bn(e,t){let n=[];return r(t),n.sort(yn);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function xn(e){let t=Object.create(null);return n(bn(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);bn(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new ln(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(yn);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Sn(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Cn(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function wn(e,t){let n=Object.create(null);for(let r in e){let i=e[r],a=t&&t[r];if(a===void 0){if(i.hasDefault)a=i.default;else throw RangeError(`No value supplied for attribute `+r)}else i.validate&&i.validate(a);n[r]=a}return n}function Tn(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new On(e,r,t[r]);return n}var En=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=Tn(e,n.attrs),this.defaultAttrs=Cn(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ln.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:wn(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new an(this,this.computeAttrs(e),E.from(t),D.setFrom(n))}createChecked(e=null,t,n){return t=E.from(t),this.checkContent(t),new an(this,this.computeAttrs(e),t,D.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=E.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(E.empty,!0);return i?new an(this,e,t.append(i),D.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:D.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function Dn(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var On=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Dn(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},kn=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Tn(e,r.attrs),this.excluded=null;let i=Cn(this.attrs);this.instance=i?new D(this,i):null}create(e=null){return!e&&this.instance?this.instance:new D(this,wn(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}},An=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=jt.from(e.nodes),t.marks=jt.from(e.marks||{}),this.nodes=En.compile(this.spec.nodes,this),this.marks=kn.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=ln.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?jn(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:jn(this,n.split(` `))}this.nodeFromJSON=e=>an.fromJSON(this,e),this.markFromJSON=e=>D.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof En))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new on(n,n.defaultAttrs,e,D.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function jn(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function Mn(e){return e.tag!=null}function Nn(e){return e.style!=null}var Pn=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(Mn(e))this.tags.push(e);else if(Nn(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new Un(this,t,!1);return n.addAll(e,D.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Un(this,t,!0);return n.addAll(e,D.none,t.from,t.to),O.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Gn(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Kn(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Kn(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},Fn={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},In={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ln={ol:!0,ul:!0},Rn=1,zn=2,Bn=4;function Vn(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?Rn:0)|(t===`full`?zn:0)}var Hn=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=D.none,this.match=i||(a&Bn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(E.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Rn)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=E.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(E.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Fn.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},Un=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=Vn(null,t.preserveWhitespace,0)|(n?Bn:0);i=r?new Hn(r.type,r.attrs,D.none,!0,t.topMatch||r.type.contentMatch,a):n?new Hn(null,null,D.none,!0,null,a):new Hn(e.schema.topNodeType,null,D.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&zn?`full`:this.localPreserveWS||(r.options&Rn)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
|
|
3
|
+
`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;Ln.hasOwnProperty(a)&&this.parser.normalizeLists&&Wn(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:In.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(Fn.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
|
+
`),t)}ignoreFallback(e,t){e.nodeName!=`BR`||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node){if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=D.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):qn(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=Vn(e,i,a.options);a.options&Bn&&a.content.length==0&&(o|=Bn);let s=D.none;return n=n.filter(t=>!(a.type?a.type.allowsMarkType(t.type):qn(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new Hn(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=Rn);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function Wn(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Ln.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function Gn(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Kn(e){let t={};for(let n in e)t[n]=e[n];return t}function qn(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var Jn=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=Xn(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name])a++;else{if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return Xn(t).createTextNode(e.text);let{dom:n,contentDOM:r}=er(Xn(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&er(Xn(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:er(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Yn(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Yn(e.marks)}};function Yn(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Xn(e){return e.document||window.document}var Zn=new WeakMap;function Qn(e){let t=Zn.get(e);return t===void 0&&Zn.set(e,t=$n(e)),t}function $n(e){let t=null;function n(e){if(e&&typeof e==`object`){if(Array.isArray(e)){if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t])}else for(let t in e)n(e[t])}}return n(e),t}function er(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=Qn(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=er(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var tr=65535,nr=2**16;function rr(e,t){return e+t*nr}function ir(e){return e&tr}function ar(e){return(e-(e&tr))/nr}var or=1,sr=2,cr=4,lr=8,ur=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&lr)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&cr)>0}},dr=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=ir(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+ar(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:rr(o/3,e-s),f=0;return c&&(f|=e==s?sr:e==u?or:cr,(t<0?e!=s:e!=u)&&(f|=lr)),new ur(a,f,d)}r+=l-c}return n?e+r:new ur(e+r,0,null)}touches(e,t){let n=0,r=ir(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};dr.empty=new dr([]);var fr=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new ur(e,r,null)}},pr=Object.create(null),mr=class{getMap(){return dr.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=pr[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in pr)throw RangeError(`Duplicate use of step JSON ID `+e);return pr[e]=t,t.prototype.jsonID=e,t}},hr=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof zt)return e.fail(t.message);throw t}}};function gr(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(gr(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return E.fromArray(r)}var _r=class e extends mr{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new O(gr(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return hr.fromReplace(e,this.from,this.to,i)}invert(){return new vr(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};mr.jsonID(`addMark`,_r);var vr=class e extends mr{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new O(gr(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return hr.fromReplace(e,this.from,this.to,n)}invert(){return new _r(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};mr.jsonID(`removeMark`,vr);var yr=class e extends mr{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return hr.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return hr.fromReplace(e,this.pos,this.pos+1,new O(E.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new br(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};mr.jsonID(`addNodeMark`,yr);var br=class e extends mr{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return hr.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return hr.fromReplace(e,this.pos,this.pos+1,new O(E.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new yr(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};mr.jsonID(`removeNodeMark`,br);var xr=class e extends mr{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Cr(e,this.from,this.to)?hr.fail(`Structure replace would overwrite content`):hr.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new dr([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?O.empty:new O(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?O.empty:new O(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,O.fromJSON(t,n.slice),!!n.structure)}};xr.MAP_BIAS=1,mr.jsonID(`replace`,xr);var Sr=class e extends mr{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(Cr(e,this.from,this.gapFrom)||Cr(e,this.gapTo,this.to)))return hr.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return hr.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?hr.fromReplace(e,this.from,this.to,n):hr.fail(`Content does not fit in gap`)}getMap(){return new dr([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,O.fromJSON(t,n.slice),n.insert,!!n.structure)}};mr.jsonID(`replaceAround`,Sr);function Cr(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function wr(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new vr(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new _r(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Tr(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof kn){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new vr(t.from,t.to,t.style)))}function Er(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new xr(s,l,O.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new vr(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new O(E.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new xr(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(E.empty,!0);e.replace(s,s,new O(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Dr(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Or(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!Dr(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function kr(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=E.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=E.from(r.node(e).copy(u)),d++):c--;let f=E.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=E.from(i.node(e).copy(f)),p++):l++;e.step(new Sr(c,l,o,s,new O(u.append(f),d,p),u.size-d,!0))}function Ar(e,t,n=null,r=e){let i=Mr(e,t),a=i&&Nr(r,t);return a?i.map(jr).concat({type:t,attrs:n}).concat(a.map(jr)):null}function jr(e){return{type:e,attrs:null}}function Mr(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function Nr(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function Pr(e,t,n){let r=E.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=E.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new Sr(i,a,i,a,new O(r,0,0),n.length,!0))}function Fr(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&Rr(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&Lr(e,t,n,a),Er(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Sr(c,l,c+1,l-1,new O(E.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Ir(e,t,n,a),!1}})}function Ir(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function Lr(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
|
|
5
|
+
`))}})}function Rr(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function zr(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new Sr(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new O(E.from(o),0,0),1,!0))}function Br(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function Vr(e,t,n=1,r){let i=e.doc.resolve(t),a=E.empty,o=E.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=E.from(i.node(e).copy(a));let t=r&&r[s];o=E.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new xr(t,t,new O(a.append(o),n,n),!0))}function Hr(e,t){let n=e.resolve(t),r=n.index();return Wr(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Ur(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function Wr(e,t){return!!(e&&t&&!e.isLeaf&&Ur(e,t))}function Gr(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&Wr(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function Kr(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);Lr(e,r.node(),r.before(),s)}o.inlineContent&&Er(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new xr(l,c.map(t+n,-1),O.empty,!0)),r===!0){let t=e.doc.resolve(l);Ir(e,t.node(),t.before(),e.steps.length)}return e}function qr(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function Jr(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Yr(e,t,n=t,r=O.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return Xr(i,a,r)?new xr(t,n,r):new Zr(i,a,r).fit()}function Xr(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var Zr=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=E.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=E.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new O(i,a,o);return e>-1?new Sr(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new xr(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=ei(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(E.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced;return ai(e,-1)<=t?!1:(this.unplaced.size>1&&ai(e,1)>n&&n++,this.unplaced=new O(e,t+1,n),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=ei(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new O(Qr(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new O(Qr(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(ti(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=$r(this.placed,t,E.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?O.empty:new O(Qr(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new O(Qr(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!ni(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=ni(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=ni(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=$r(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=$r(this.placed,this.depth,E.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(E.empty,!0);e.childCount&&(this.placed=$r(this.placed,this.frontier.length,e))}};function Qr(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Qr(e.firstChild.content,t-1,n)))}function $r(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy($r(e.lastChild.content,t-1,n)))}function ei(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function ti(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,ti(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(E.empty,!0)))),e.copy(r)}function ni(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!ri(n,a.content,o)?s:null}function ri(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function ii(e){return e.spec.defining||e.spec.definingForContent}function ai(e,t){for(let n=0;;n++){let r=t<0?e.firstChild:e.lastChild;if(!r||r.isAtom)return n;e=r.content}}function oi(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(Xr(i,a,r))return e.step(new xr(t,n,r));let o=ui(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=ii(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new O(si(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function si(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(si(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(E.empty,!0))}return e}function ci(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=qr(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new O(E.from(r),0,0))}function li(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=ui(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function ui(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var di=class e extends mr{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return hr.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return hr.fromReplace(e,this.pos,this.pos+1,new O(E.from(r),0,+!t.isLeaf))}getMap(){return dr.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:`attr`,pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!=`number`||typeof n.attr!=`string`)throw RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};mr.jsonID(`attr`,di);var fi=class e extends mr{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return hr.ok(n)}getMap(){return dr.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};mr.jsonID(`docAttr`,fi);var pi=class extends Error{};pi=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},pi.prototype=Object.create(Error.prototype),pi.prototype.constructor=pi,pi.prototype.name=`TransformError`;var mi=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new fr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new pi(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=O.empty){let r=Yr(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new O(E.from(n),0,0))}delete(e,t){return this.replace(e,t,O.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return oi(this,e,t,n),this}replaceRangeWith(e,t,n){return ci(this,e,t,n),this}deleteRange(e,t){return li(this,e,t),this}lift(e,t){return kr(this,e,t),this}join(e,t=1){return Kr(this,e,t),this}wrap(e,t){return Pr(this,e,t),this}setBlockType(e,t=e,n,r=null){return Fr(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return zr(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new di(e,t,n)),this}setDocAttribute(e,t){return this.step(new fi(e,t)),this}addNodeMark(e,t){return this.step(new yr(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof D)t.isInSet(n.marks)&&this.step(new br(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new br(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return Vr(this,e,t,n),this}addMark(e,t,n){return wr(this,e,t,n),this}removeMark(e,t,n){return Tr(this,e,t,n),this}clearIncompatible(e,t,n){return Er(this,e,t,n),this}},hi=Object.create(null),k=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new gi(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=O.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?O.empty:t),o==0&&wi(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){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),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),wi(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new A(e):Ci(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?Ci(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Ci(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new xi(e.node(0))}static atStart(e){return Ci(e,e,0,0,1)||new xi(e)}static atEnd(e){return Ci(e,e,e.content.size,e.childCount,-1)||new xi(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=hi[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in hi)throw RangeError(`Duplicate use of selection JSON ID `+e);return hi[e]=t,t.prototype.jsonID=e,t}getBookmark(){return A.between(this.$anchor,this.$head).getBookmark()}};k.prototype.visible=!0;var gi=class{constructor(e,t){this.$from=e,this.$to=t}},_i=!1;function vi(e){!_i&&!e.parent.inlineContent&&(_i=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var A=class e extends k{constructor(e,t=e){vi(e),vi(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return k.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=O.empty){if(super.replace(e,t),t==O.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new yi(this.anchor,this.head)}toJSON(){return{type:`text`,anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!=`number`||typeof n.head!=`number`)throw RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=k.findFrom(n,r,!0)||k.findFrom(n,-r,!0);if(e)n=e.$head;else return k.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(k.findFrom(t,-r,!0)||k.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};k.jsonID(`text`,A);var yi=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){return A.between(e.resolve(this.anchor),e.resolve(this.head))}},j=class e extends k{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?k.near(a):new e(a)}content(){return new O(E.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new bi(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};j.prototype.visible=!1,k.jsonID(`node`,j);var bi=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new yi(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&j.isSelectable(n)?new j(t):k.near(t)}},xi=class e extends k{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=O.empty){if(t==O.empty){e.delete(0,e.doc.content.size);let t=k.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return Si}};k.jsonID(`all`,xi);var Si={map(){return this},resolve(e){return new xi(e)}};function Ci(e,t,n,r,i,a=!1){if(t.inlineContent)return A.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=Ci(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&j.isSelectable(r))return j.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function wi(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof xr||i instanceof Sr))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(k.near(e.doc.resolve(o),n))}var Ti=1,Ei=2,Di=4,Oi=class extends mi{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Ti)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Ti)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ei,this}ensureMarks(e){return D.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Ei)>0}addStep(e,t){super.addStep(e,t),this.updated&=-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||D.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(k.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Di,this}get scrolledIntoView(){return(this.updated&Di)>0}};function ki(e,t){return!t||!e?e:e.bind(t)}var Ai=class{constructor(e,t,n){this.name=e,this.init=ki(t.init,n),this.apply=ki(t.apply,n)}},ji=[new Ai(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Ai(`selection`,{init(e,t){return e.selection||k.atStart(t.doc)},apply(e){return e.selection}}),new Ai(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Ai(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],Mi=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ji.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new Ai(e.key,e.spec.state,e))})}},Ni=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new Oi(this)}static create(t){let n=new Mi(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new Mi(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new Mi(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=an.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=k.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function Pi(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=Pi(i,t,{})),n[r]=i}return n}var M=class{constructor(e){this.spec=e,this.props={},e.props&&Pi(e.props,this,this.props),this.key=e.key?e.key.key:Ii(`plugin`)}getState(e){return e[this.key]}},Fi=Object.create(null);function Ii(e){return e in Fi?e+`$`+ ++Fi[e]:(Fi[e]=0,e+`$`)}var N=class{constructor(e=`key`){this.key=Ii(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},Li=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Ri(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var zi=(e,t,n)=>{let r=Ri(e,n);if(!r)return!1;let i=Gi(r);if(!i){let n=r.blockRange(),i=n&&Or(n);return i!=null&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(la(e,i,t,-1))return!0;if(r.parent.content.size==0&&(Ui(a,`end`)||j.isSelectable(a)))for(let n=r.depth;;n--){let o=Yr(e.doc,r.before(n),r.after(n),O.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(Ui(a,`end`)?k.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):j.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},Bi=(e,t,n)=>{let r=Ri(e,n);if(!r)return!1;let i=Gi(r);return i?Hi(e,i,t):!1},Vi=(e,t,n)=>{let r=Ki(e,n);if(!r)return!1;let i=Yi(r);return i?Hi(e,i,t):!1};function Hi(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=Yr(e.doc,i,o,O.empty);if(!s||s.from!=i||s instanceof xr&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(A.create(t.doc,i)),n(t.scrollIntoView())}return!0}function Ui(e,t,n=!1){for(let r=e;r;r=t==`start`?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}var Wi=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=Gi(r)}let o=a&&a.nodeBefore;return!o||!j.isSelectable(o)?!1:(t&&t(e.tr.setSelection(j.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function Gi(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function Ki(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var qi=(e,t,n)=>{let r=Ki(e,n);if(!r)return!1;let i=Yi(r);if(!i)return!1;let a=i.nodeAfter;if(la(e,i,t,1))return!0;if(r.parent.content.size==0&&(Ui(a,`start`)||j.isSelectable(a))){let n=Yr(e.doc,r.before(),r.after(),O.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Ui(a,`start`)?k.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):j.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},Ji=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=Yi(r)}let o=a&&a.nodeAfter;return!o||!j.isSelectable(o)?!1:(t&&t(e.tr.setSelection(j.create(e.doc,a.pos)).scrollIntoView()),!0)};function Yi(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var Xi=(e,t)=>{let n=e.selection,r=n instanceof j,i;if(r){if(n.node.isTextblock||!Hr(e.doc,n.from))return!1;i=n.from}else if(i=Gr(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(j.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},Zi=(e,t)=>{let n=e.selection,r;if(n instanceof j){if(n.node.isTextblock||!Hr(e.doc,n.to))return!1;r=n.to}else if(r=Gr(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},Qi=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&Or(i);return a!=null&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},$i=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
6
|
+
`).scrollIntoView()),!0)};function ea(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var ta=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),a=n.indexAfter(-1),o=ea(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(k.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},na=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof xi||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=ea(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(A.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},ra=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(Br(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Or(r);return i!=null&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function ia(e){return(t,n)=>{if(t.selection instanceof j&&t.selection.node.isBlock){let{$from:e}=t.selection;return!e.parentOffset||!Br(t.doc,e.pos)?!1:(n&&n(t.tr.split(e.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let r=t.tr;!t.selection.empty&&(t.selection instanceof A||t.selection instanceof xi)&&r.deleteSelection();let{$from:i}=r.selection,a=r.steps.length,o=[],s,c,l=!1,u=!1;for(let t=i.depth;;t--)if(i.node(t).isBlock){l=i.end(t)==i.pos+(i.depth-t),u=i.start(t)==i.pos-(i.depth-t),c=ea(i.node(t-1).contentMatchAt(i.indexAfter(t-1)));let n=e&&e(i.parent,l,i);o.unshift(n||(l&&c?{type:c}:null)),s=t;break}else{if(t==1)return!1;o.unshift(null)}let d=i.pos,f=Br(r.doc,d,o.length,o);if(f||=(o[0]=c?{type:c}:null,Br(r.doc,d,o.length,o)),!f)return!1;if(r.split(d,o.length,o),!l&&u&&i.node(s).type!=c){let e=r.mapping.slice(a),t=e.map(i.before(s)),n=r.doc.resolve(t);c&&i.node(s-1).canReplaceWith(n.index(),n.index()+1,c)&&r.setNodeMarkup(e.map(i.before(s)),c)}return n&&n(r.scrollIntoView()),!0}}var aa=ia(),oa=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a!=0&&(i=n.before(a),t&&t(e.tr.setSelection(j.create(e.doc,i))),!0)},sa=(e,t)=>(t&&t(e.tr.setSelection(new xi(e.doc))),!0);function ca(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||Hr(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function la(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&ca(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=E.empty;for(let e=o.length-1;e>=0;e--)s=E.from(o[e].create(null,s));s=E.from(i.copy(s));let c=e.tr.step(new Sr(t.pos-1,r,t.pos,r,new O(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&Hr(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:k.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&Or(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&Ui(a,`start`,!0)&&Ui(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=E.empty;for(let e=o.length-1;e>=0;e--)r=E.from(o[e].copy(r));n(e.tr.step(new Sr(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new O(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function ua(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(A.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var da=ua(-1),fa=ua(1);function pa(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&Ar(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function ma(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(e,t)){if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function ha(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var ga=ha(Li,zi,Wi),_a=ha(Li,qi,Ji),va={Enter:ha($i,na,ra,aa),"Mod-Enter":ta,Backspace:ga,"Mod-Backspace":ga,"Shift-Backspace":ga,Delete:_a,"Mod-Delete":_a,"Mod-a":sa},ya={"Ctrl-h":va.Backspace,"Alt-Backspace":va[`Mod-Backspace`],"Ctrl-d":va.Delete,"Ctrl-Alt-Backspace":va[`Mod-Delete`],"Alt-Delete":va[`Mod-Delete`],"Alt-d":va[`Mod-Delete`],"Ctrl-a":da,"Ctrl-e":fa};for(let e in va)ya[e]=va[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function ba(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return xa(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function xa(e,t,n,r=null){let i=!1,a=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let e=o.resolve(t.start-2);a=new nn(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new nn(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=Ar(a,n,r,t);return s?(e&&Sa(e,t,s,i,n),!0):!1}function Sa(e,t,n,r,i){let a=E.empty;for(let e=n.length-1;e>=0;e--)a=E.from(n[e].type.create(n[e].attrs,a));e.step(new Sr(t.start-(r?2:0),t.end,t.start,t.end,new O(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&Br(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function Ca(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?wa(t,n,e,a):Ta(t,n,a):!0:!1}}function wa(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new Sr(a-1,o,a,o,new O(E.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new nn(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=Or(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return Hr(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function Ta(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?E.empty:E.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new Sr(d-+!!s,f+ +!!c,d+1,f-1,new O((s?E.empty:E.from(i.copy(E.empty))).append(c?E.empty:E.from(i.copy(E.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function Ea(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=E.from(r?e.create():null),o=new O(E.from(e.create(null,E.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new Sr(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var Da=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Oa=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},ka=null,Aa=function(e,t,n){let r=ka||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},ja=function(){ka=null},Ma=function(e,t,n,r){return n&&(Pa(e,t,n,r,-1)||Pa(e,t,n,r,1))},Na=/^(img|br|input|textarea|hr)$/i;function Pa(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Fa(e))){let n=e.parentNode;if(!n||!P(n)||Va(e)||Na.test(e.nodeName)||e.contentEditable==`false`)return!1;t=Da(e)+(i<0?0:1),e=n}else if(P(e)){let n=e.childNodes[t+(i<0?-1:0)];if(P(n)&&n.contentEditable==`false`){if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1}else e=n,t=i<0?Fa(e):0}else return!1}}function Fa(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function P(e){return e.nodeType==1}function Ia(e){return e.nodeType==3}function La(e,t){return t?e.contains(P(t)?t:t.parentNode):!1}function Ra(e,t){for(;;){if(Ia(e)&&t)return e;if(P(e)&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=Fa(e)}else if(e.parentNode&&!Va(e))t=Da(e),e=e.parentNode;else return null}}function za(e,t){for(;;){if(Ia(e)&&t<e.nodeValue.length)return e;if(P(e)&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!Va(e))t=Da(e)+1,e=e.parentNode;else return null}}function Ba(e,t,n){for(let r=t==0,i=t==Fa(e);r||i;){if(e==n)return!0;let t=Da(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==Fa(e)}}function Va(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var Ha=function(e){return e.focusNode&&Ma(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Ua(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function Wa(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Ga(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Fa(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Fa(r.startContainer),r.startOffset)}}}var Ka=typeof navigator<`u`?navigator:null,qa=typeof document<`u`?document:null,Ja=Ka&&Ka.userAgent||``,Ya=/Edge\/(\d+)/.exec(Ja),Xa=/MSIE \d/.exec(Ja),Za=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ja),Qa=!!(Xa||Za||Ya),$a=Xa?document.documentMode:Za?+Za[1]:Ya?+Ya[1]:0,eo=!Qa&&/gecko\/(\d+)/i.test(Ja);eo&&+(/Firefox\/(\d+)/.exec(Ja)||[0,0])[1];var to=!Qa&&/Chrome\/(\d+)/.exec(Ja),no=!!to,ro=to?+to[1]:0,io=!Qa&&!!Ka&&/Apple Computer/.test(Ka.vendor),ao=io&&(/Mobile\/\w+/.test(Ja)||!!Ka&&Ka.maxTouchPoints>2),oo=ao||(Ka?/Mac/.test(Ka.platform):!1),so=Ka?/Win/.test(Ka.platform):!1,co=/Android \d/.test(Ja),lo=!!qa&&`webkitFontSmoothing`in qa.documentElement.style,uo=lo?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function fo(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function po(e,t){return typeof e==`number`?e:e[t]}function mo(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function ho(e,t,n){if(!Ao(t)&&t.left==0)return;let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(!P(o)){o=Oa(o);continue}let e=o==a.body,n=e?fo(a):mo(o),s=0,c=0;if(t.top<n.top+po(r,`top`)?c=-(n.top-t.top+po(i,`top`)):t.bottom>n.bottom-po(r,`bottom`)&&(c=t.bottom-t.top>n.bottom-n.top?t.top+po(i,`top`)-n.top:t.bottom-n.bottom+po(i,`bottom`)),t.left<n.left+po(r,`left`)?s=-(n.left-t.left+po(i,`left`)):t.right>n.right-po(r,`right`)&&(s=t.right-n.right+po(i,`right`)),s||c){if(e)a.defaultView.scrollBy(s,c);else{let e=o.scrollLeft,n=o.scrollTop;c&&(o.scrollTop+=c),s&&(o.scrollLeft+=s);let r=o.scrollLeft-e,i=o.scrollTop-n;t={left:t.left-r,top:t.top-i,right:t.right-r,bottom:t.bottom-i}}}let l=e?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(l))break;o=l==`absolute`?o.offsetParent:Oa(o)}}function go(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:_o(e.dom)}}function _o(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Oa(r));return t}function vo({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;yo(n,r==0?0:r-t)}function yo(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var bo=null;function xo(e){if(e.setActive)return e.setActive();if(bo)return e.focus(bo);let t=_o(e);e.focus(bo==null?{get preventScroll(){return bo={preventScroll:!0},!0}}:void 0),bo||(bo=!1,yo(t,0))}function So(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(P(u))e=u.getClientRects();else if(Ia(u))e=Aa(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&Ia(n)?{left:p.right<t.left?p.right:p.left,top:t.top}:t,P(u)&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&Ia(n)?Co(n,i):!n||r?{node:e,offset:a}:So(n,i)}function Co(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=jo(r,1);if(n.top!=n.bottom&&wo(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function wo(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function To(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function Eo(e,t,n){let{node:r,offset:i}=So(t,n),a=-1;if(P(r)&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function Do(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(P(t.dom)&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function Oo(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),a=i;;){let n=e.childNodes[a];if(P(n)){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(wo(t,i))return Oo(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function ko(e,t){let n=e.dom.ownerDocument,r,i=0,a=Ga(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o)){let n=e.dom.getBoundingClientRect();if(!wo(t,n)||(o=Oo(e.dom,t,n),!o))return null}if(io)for(let e=o;r&&e;e=Oa(e))e.draggable&&(r=void 0);if(o=To(o,t),r){if(eo&&P(r)&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;lo&&i&&P(r)&&P(n=r.childNodes[i-1])&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&P(r.lastChild)&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:i!=0&&P(r)&&r.childNodes[i-1].nodeName==`BR`||(s=Do(e,r,i,t))}s??=Eo(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function Ao(e){return e.top<e.bottom||e.left<e.right}function jo(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(Ao(e))return e}return Array.prototype.find.call(n,Ao)||e.getBoundingClientRect()}var Mo=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function No(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=lo||eo;if(Ia(r)){if(o&&(Mo.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=jo(Aa(r,i,i),n);if(eo&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=jo(Aa(r,i-1,i-1),-1);if(t.top==e.top){let n=jo(Aa(r,i,i+1),-1);if(n.top!=e.top)return Po(n,n.left<t.left)}}return e}{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,Po(jo(Aa(r,e,t),a),a<0)}}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==Fa(r))){let e=r.childNodes[i-1];if(P(e))return Fo(e.getBoundingClientRect(),!1)}if(a==null&&i<Fa(r)){let e=r.childNodes[i];if(P(e))return Fo(e.getBoundingClientRect(),!0)}return Fo(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==Fa(r))){let e=r.childNodes[i-1],t=Ia(e)?Aa(e,Fa(e)-+!o):P(e)&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return Po(jo(t,1),!1)}if(a==null&&i<Fa(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?Ia(e)?Aa(e,0,+!o):P(e)?e:null:null;if(t)return Po(jo(t,-1),!0)}return Po(jo(Ia(r)?Aa(r):r,-n),n>=0)}function Po(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Fo(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Io(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function Lo(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return Io(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=No(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(P(e))t=e.getClientRects();else if(Ia(e))t=Aa(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var Ro=/[\u0590-\u08ac]/;function zo(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!Ro.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:Io(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!La(l,u)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var Bo=null,Vo=null,Ho=!1;function Uo(e,t,n){return Bo==t&&Vo==n?Ho:(Bo=t,Vo=n,Ho=n==`up`||n==`down`?Lo(e,t,n):zo(e,t,n))}var Wo=0,Go=1,Ko=2,qo=3,Jo=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=Wo,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&La(this.contentDOM,e)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>Da(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=!!(e.compareDocumentPosition(this.contentDOM)&4);else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node)){if(n&&(a=i.nodeDOM)&&!(P(a)?La(a,e):a==e))n=!1;else return i}}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(;n>0;n--){let e=this.children[n-1];if(e.size||!(e instanceof ts||e instanceof Yo&&e.side>=0))break}if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?Da(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?Da(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=Da(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=Da(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(!P(t)||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((eo||io)&&e==t){let{node:e,offset:t}=o;if(Ia(e)){if(u=!!(t&&e.nodeValue[t-1]==`
|
|
7
|
+
`),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:Da(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(eo&&l.focusNode&&l.focusNode!=s.node&&P(l.focusNode)){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&io)&&Ma(o.node,o.offset,l.anchorNode,l.anchorOffset)&&Ma(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&eo)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?Ko:Go,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=qo:i.markDirty(e-r,t-r);return}i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Ko:qo}n=a}this.dirty=Ko}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?Ko:Go;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},Yo=class extends Jo{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){let e=P(a)?a:document.createElement(`span`);e!=a&&e.appendChild(a),e.hasAttribute(`contenteditable`)||(e.contentEditable=`false`),e.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==Wo&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!=`selection`||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},Xo=class extends Jo{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},Zo=class e extends Jo{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return o&&o.dom||(o=Jn.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&qo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=qo&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Wo){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=Wo}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=ys(a,n,o,r)),t>0&&(a=ys(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},Qo=class e extends Jo{constructor(e,t,n,r,i,a,o){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(!Ia(u))throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=Jn.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=us(u,r,n),l?c=new ns(t,n,r,i,u,d||null,f,l):n.isText?new es(t,n,r,i,u,f):new e(t,n,r,i,u,d||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(t.preserveWhitespace=`full`),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}if(!t.contentElement){let n=e&&e.find(t=>P(t)&&e.indexOf(t.parentNode)<0&&this.dom.contains(t));n?t.contentElement=n:t.getContent=()=>E.empty}}return t}matchesNode(e,t,n){return this.dirty==Wo&&e.eq(this.node)&&ds(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new ps(this,a&&a.node,e),c=this.node.inlineContent,l=c&&this.node.isBlock;gs(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?D.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,u,d)=>{s.syncToMarks(t.marks,n,e,d),l&&t.isAtom&&!t.isText&&s.addHackNode(`IMG`,s.top);let f;s.findNodeMatch(t,a,u,d)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(f=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,u,f,e)||s.updateNextNode(t,a,u,e,d,r)||s.addNode(t,a,u,e,r),r+=t.nodeSize,c&&(l=t.isAtom&&!t.isText)}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==Ko)&&(a&&this.protectLocalComposition(e,a),rs(this.contentDOM,this.children,e),ao&&_s(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof A)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=vs(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let a=new Xo(this,i,t,r);e.input.compositionNodes.push(a),this.children=ys(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==qo||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=Wo}updateOuterDeco(e){if(ds(e,this.outerDeco))return;let t=!P(this.nodeDOM),n=this.dom;this.dom=cs(this.dom,this.nodeDOM,ss(this.outerDeco,this.node,t),ss(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){P(this.nodeDOM)&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){P(this.nodeDOM)&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function $o(e,t,n,r,i){us(r,t,e);let a=new Qo(void 0,e,t,n,r,r,r);return a.contentDOM&&a.updateChildren(i,0),a}var es=class e extends Qo{constructor(e,t,n,r,i,a){super(e,t,n,r,i,null,a)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==qo||this.dirty!=Wo&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Wo||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=Wo,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=qo)}get domAtom(){return!1}isText(e){return this.node.text==e}},ts=class extends Jo{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Wo&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},ns=class extends Qo{constructor(e,t,n,r,i,a,o,s){super(e,t,n,r,i,a,o),this.spec=s}update(e,t,n,r){if(this.dirty==qo)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function rs(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=fs(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof Zo){let t=r?r.previousSibling:e.lastChild;rs(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=fs(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var is=function(e){e&&(this.nodeName=e)};is.prototype=Object.create(null);var as=[new is];function ss(e,t,n){if(e.length==0)return as;let r=n?as[0]:new is,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new is(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new is(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function cs(e,t,n,r){if(n==as&&r==as)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName||(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=as[0]),i=t}ls(i,o||as[0],a)}return i}function ls(e,t,n){for(let r in t)r!=`class`&&r!=`style`&&r!=`nodeName`&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!=`class`&&r!=`style`&&r!=`nodeName`&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(` `).filter(Boolean):[],i=n.class?n.class.split(` `).filter(Boolean):[];for(let t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function us(e,t,n){return cs(e,e,as,ss(t,n,!P(e)))}function ds(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function fs(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var ps=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=ms(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=Wo,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i<0&&this.index<this.top.children.length){let t=this.top.children[this.index];t instanceof Zo&&t.dirty!=qo&&t.mark.type==e[a].type&&t.spec.update&&!this.isLocked(t.dom)&&t.spec.update(e[a])&&(t.mark=e[a],i=this.index,this.changed=!0)}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=Zo.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==qo&&a.dom==a.contentDOM&&(a.dirty=Ko),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof Qo){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=qo&&ds(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=Ko,u.updateChildren(r,a+1),u.dirty=Wo),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!ds(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=Qo.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=Qo.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new Yo(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Zo;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof es)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((io||no)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new ts(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||P(e)&&e.contains(this.lock.parentNode))}};function ms(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof Zo)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function hs(e,t){return e.type.side-t.type.side}function gs(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u){if(d){d.sort(hs);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c)}let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function _s(e){if(e.nodeName==`UL`||e.nodeName==`OL`){let t=e.style.cssText;e.style.cssText=t+`; list-style: square !important`,window.getComputedStyle(e).listStyle,e.style.cssText=t}}function vs(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function ys(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function bs(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(Ha(n)){for(c=o;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&j.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&Ba(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new j(o==e?s:r.resolve(e))}else if(eo&&t==`key`&&o>e.state.selection.to&&P(n.focusNode)&&n.focusOffset==n.focusNode.childNodes.length&&i&&i.posAtStart>e.state.selection.to)for(let e=n.focusNode;;e=e.parentNode){if(getComputedStyle(e).overflow!=`visible`){l=k.findFrom(r.resolve(i.posAtStart),1);break}if(e==i.dom||e.nextSibling||!e.parentNode||!P(e.parentNode))break}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=js(e,u,s,n)}return l}function xs(e){return e.editable?e.hasFocus():Ns(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Ss(e,t=!1){let n=e.state.selection;if(ks(e,n),!xs(e))return;let r=e.input.mouseDown;if(!t&&no&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Ma(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)Os(e);else{let{anchor:r,head:i}=n,a,o;Cs&&!(n instanceof A)&&(n.$from.parent.inlineContent||(a=ws(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=ws(e,n.to))),e.docView.setSelection(r,i,e,t),Cs&&(a&&Es(a),o&&Es(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&Ds(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}var Cs=io||no&&ro<63;function ws(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(io&&i&&i.contentEditable==`false`)return Ts(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return Ts(i);if(a)return Ts(a)}}function Ts(e){return e.contentEditable=`true`,io&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Es(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function Ds(e){let t=e.dom.ownerDocument;t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener(`selectionchange`,e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener(`selectionchange`,e.input.hideSelectionGuard),setTimeout(()=>{(!xs(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function Os(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,Da(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&Qa&&$a<=11&&(n.disabled=!0,n.disabled=!1)}function ks(e,t){if(t instanceof j){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(As(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else As(e)}function As(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function js(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||A.between(t,n,r)}function Ms(e){return e.editable&&!e.hasFocus()?!1:Ns(e)}function Ns(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return La(e.dom,t.anchorNode)&&(e.editable||La(e.dom,t.focusNode))}catch{return!1}}function Ps(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Ma(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Fs(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&k.findFrom(a,t)}function Is(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Ls(e,t,n){let r=e.state.selection;if(r instanceof A){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return Is(e,new A(r.$anchor,a))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=Fs(e.state,t);return n&&n instanceof j?Is(e,n):!1}if(!(oo&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?j.isSelectable(i)?Is(e,new j(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):Is(e,new A(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1}}else if(r instanceof j&&r.node.isInline)return Is(e,new A(t>0?r.$to:r.$from));else{let n=Fs(e.state,t);return n?Is(e,n):!1}}function Rs(e,t){let n=e.pmViewDesc;return n?n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`):P(e)&&e.contentEditable==`false`}function zs(e,t){return t<0?Bs(e):Vs(e)}function Bs(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(eo&&P(n)&&r<Fa(n)&&Rs(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(!P(n))break;let e=n.childNodes[r-1];if(Rs(e,-1))i=n,a=--r;else if(Ia(e))n=e,r=n.nodeValue.length;else break}else if(Hs(n))break;else{let t=n.previousSibling;for(;t&&Rs(t,-1);)i=n.parentNode,a=Da(t),t=t.previousSibling;if(t)n=t,r=Fa(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?Gs(e,n,r):i&&Gs(e,i,a)}function Vs(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Fa(n),a,o;for(;;)if(r<i){if(!P(n))break;let e=n.childNodes[r];if(Rs(e,1))a=n,o=++r;else break}else if(Hs(n))break;else{let t=n.nextSibling;for(;t&&Rs(t,1);)a=t.parentNode,o=Da(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=Fa(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&Gs(e,a,o)}function Hs(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Us(e,t){for(;e&&t==e.childNodes.length&&!Va(e);)t=Da(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(Ia(n))return n;if(P(n)&&n.contentEditable==`false`)break;e=n,t=0}}function Ws(e,t){for(;e&&!t&&!Va(e);)t=Da(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(Ia(n))return n;if(P(n)&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function Gs(e,t,n){if(!Ia(t)){let e,r;(r=Us(t,n))?(t=r,n=0):(e=Ws(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Ha(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Ss(e)},50)}function Ks(e,t){let n=e.state.doc.resolve(t);if(!(no||so)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function qs(e,t,n){let r=e.state.selection;if(r instanceof A&&!r.empty||n.indexOf(`s`)>-1||oo&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=Fs(e.state,t);if(n&&n instanceof j)return Is(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof xi?k.near(n,t):k.findFrom(n,t);return o?Is(e,o):!1}return!1}function Js(e,t){if(!(e.state.selection instanceof A))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`))return!0;let a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function Ys(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Xs(e){if(!io||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&P(t)&&n==0&&t.firstChild&&P(t.firstChild)&&t.firstChild.contentEditable==`false`){let n=t.firstChild;Ys(e,n,`true`),setTimeout(()=>Ys(e,n,`false`),20)}return!1}function Zs(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function Qs(e,t){let n=t.keyCode,r=Zs(t);if(n==8||oo&&n==72&&r==`c`)return Js(e,-1)||zs(e,-1);if(n==46&&!t.shiftKey||oo&&n==68&&r==`c`)return Js(e,1)||zs(e,1);if(n==13||n==27)return!0;if(n==37||oo&&n==66&&r==`c`){let t=n==37?Ks(e,e.state.selection.from)==`ltr`?-1:1:-1;return Ls(e,t,r)||zs(e,t)}if(n==39||oo&&n==70&&r==`c`){let t=n==39?Ks(e,e.state.selection.from)==`ltr`?1:-1:1;return Ls(e,t,r)||zs(e,t)}return n==38||oo&&n==80&&r==`c`?qs(e,-1,r)||zs(e,-1):n==40||oo&&n==78&&r==`c`?Xs(e)||qs(e,1,r)||zs(e,1):!(r!=(oo?`m`:`c`)||n!=66&&n!=73&&n!=89&&n!=90)}function $s(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||Jn.fromSchema(e.state.schema),s=lc(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&P(l)&&(u=cc[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&P(l)&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
|
|
8
8
|
|
|
9
|
-
`),slice:t}}function
|
|
10
|
-
`))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=Yn.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=pc(n),uo&&mc(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&!N(e);)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||Fn.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!nc.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=hc(cc(s,+u[1],+u[2]),u[4]);else if(s=D.maxOpen(rc(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=cc(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var nc=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function rc(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&ac(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=oc(a[a.length-1],i.length));let n=ic(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return T.from(a)}return e}function ic(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,T.from(e));return e}function ac(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=ac(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(T.from(ic(n,e,i+1))))}}function oc(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,oc(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(T.empty,!0);return e.copy(n.append(r))}function sc(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=sc(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(T.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function cc(e,t,n){return t<e.openStart&&(e=new D(sc(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new D(sc(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var lc={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]};function uc(){return document.implementation.createHTMLDocument(`title`)}var dc=null;function fc(e){let t=window.trustedTypes;if(!t)return e;if(!dc){if(dc=t.defaultPolicy)try{return dc.createHTML(e)}catch{}dc=t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e})}return dc.createHTML(e)}function pc(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=uc(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(e),a;if((a=i&&lc[i[1].toLowerCase()])&&(e=a.map(e=>`<`+e+`>`).join(``)+e+a.map(e=>`</`+e+`>`).reverse().join(``)),r.innerHTML=fc(e),a)for(let e=0;e<a.length;e++)r=r.querySelector(a[e])||r;for(let e=0;e<n.styleSheets.length;e++){let t=n.styleSheets[e];for(let e=0;e<t.rules.length;e++){let n=t.rules[e];if(n instanceof CSSStyleRule){let e=r.querySelectorAll(n.selectorText);for(let t=0;t<e.length;t++)e[t].style.cssText+=n.style.cssText}}}return r}function mc(e){let t=e.querySelectorAll(ro?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function hc(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;try{i=T.from(t.create(r[e+1],i))}catch{break}a++,o++}return new D(i,a,o)}var gc={},_c={},vc={touchstart:!0,touchmove:!0},yc=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function bc(e){for(let t in gc){let n=gc[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{Tc(e,t)&&!wc(e,t)&&(e.editable||!(t.type in _c))&&n(e,t)},vc[t]?{passive:!0}:void 0)}ao&&e.dom.addEventListener(`input`,()=>null),Cc(e)}function xc(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Sc(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function Cc(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>wc(e,t))})}function wc(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function Tc(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Ec(e,t){!wc(e,t)&&gc[t.type]&&(e.editable||!(t.type in _c))&&gc[t.type](e,t)}_c.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!Uc(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(lo&&ro&&n.keyCode==13))){if(n.keyCode!=229&&e.domObserver.forceFlush(),oo&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,Wa(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||$s(e,n)?n.preventDefault():xc(e,`key`)}},_c.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},_c.keypress=(e,t)=>{let n=t;if(Uc(e)||!n.charCode||n.ctrlKey&&!n.altKey||so&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof k)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function Dc(e){return{left:e.clientX,top:e.clientY}}function Oc(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function kc(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function Ac(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta(`pointer`,!0),e.dispatch(r)}function jc(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&A.isSelectable(r)?(Ac(e,new A(n)),!0):!1}function Mc(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof A&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(A.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i!=null&&(Ac(e,A.create(e.state.doc,i)),!0)}function Nc(e,t,n,r,i){return kc(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?Mc(e,n):jc(e,n))}function Pc(e,t,n,r){return kc(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function Fc(e,t,n,r){return kc(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||Ic(e,n,r)}function Ic(e,t,n){if(n.button!=0)return!1;let r=Lc(e,t,!0),i=e.state.doc;return r?(Ac(e,r),r instanceof k&&i.eq(e.state.doc)&&(e.input.mouseDown=new Hc(e,r)),!0):!1}function Lc(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?k.create(r,0,r.content.size):null;let i=r.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e),a=i.before(e);if(t.inlineContent)return k.create(r,a+1,a+1+t.content.size);if(n&&A.isSelectable(t))return A.create(r,a)}return null}function Rc(e){return Yc(e)}var zc=so?`metaKey`:`ctrlKey`;gc.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Rc(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&Oc(n,e.input.lastClick)&&!n[zc]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let o=e.posAtCoords(Dc(n));o&&(a==`singleClick`?e.input.mouseDown=new Vc(e,o,n,!!r):(a==`doubleClick`?Pc:Fc)(e,o.pos,o.inside,n)?n.preventDefault():xc(e,`pointer`))};var Bc=class{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}},Vc=class extends Bc{constructor(e,t,n,r){super(e),this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[zc],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&N(s.nodeDOM)?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof A&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!!(this.target&&to&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),xc(e,`pointer`)}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||Cs(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Dc(e))),this.updateAllowDefault(e),this.allowDefault||!t?xc(this.view,`pointer`):Nc(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ao&&this.mightDrag&&!this.mightDrag.node.isAtom||ro&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Ac(this.view,O.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):xc(this.view,`pointer`)}move(e){this.updateAllowDefault(e),xc(this.view,`pointer`),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}},Hc=class extends Bc{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),xc(this.view,`pointer`);let t=this.view.posAtCoords(Dc(e)),n=t&&Lc(this.view,t.inside,!1);if(!n)return;let{doc:r}=this.view.state,i=this.startSelection,[a,o]=n.from<i.from?[i.to,n.from]:[i.from,n.to];Ac(this.view,k.create(r,a,o))}};gc.touchstart=e=>{e.input.lastTouch=Date.now(),Rc(e),xc(e,`pointer`)},gc.touchmove=e=>{e.input.lastTouch=Date.now(),xc(e,`pointer`)},gc.contextmenu=e=>Rc(e);function Uc(e,t){return e.composing?!0:ao&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var Wc=lo?5e3:-1;_c.compositionstart=_c.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof k&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||ro&&co&&Gc(e)))e.markCursor=e.state.storedMarks||n.marks(),Yc(e,!0),e.markCursor=null;else if(Yc(e,!t.selection.empty),to&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&N(n)&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(La(t)){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}Kc(e,Wc)};function Gc(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||!N(t)||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return N(r)&&r.contentEditable==`false`}_c.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Kc(e,20))};function Kc(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Yc(e),t))}function qc(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Jc(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=za(t.focusNode,t.focusOffset),r=Ba(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return r}}return n||r}function Yc(e,t=!1){if(!(lo&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),qc(e),t||e.docView&&e.docView.dirty){let n=xs(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function Xc(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var Zc=$a&&eo<15||oo&&fo<604;gc.copy=_c.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=Zc?null:n.clipboardData,{dom:o,text:s}=ec(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):Xc(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function Qc(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function $c(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?el(e,r.value,null,i,t):el(e,r.textContent,r.innerHTML,i,t)},50)}function el(e,t,n,r,i){let a=tc(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||D.empty)))return!0;if(!a)return!1;let o=Qc(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function tl(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}_c.paste=(e,t)=>{let n=t;if(e.composing&&!lo)return;let r=Zc?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&el(e,tl(r),r.getData(`text/html`),i,n)?n.preventDefault():$c(e,n)};var nl=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},rl=so?`altKey`:`ctrlKey`;function il(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[rl]:!n}gc.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(Dc(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof A?i.to-1:i.to))){if(r&&r.mightDrag)o=A.create(e.state.doc,r.mightDrag.pos);else if(n.target&&N(n.target)){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=A.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=ec(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!ro||io>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Zc?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,Zc||n.dataTransfer.setData(`text/plain`,c),e.dragging=new nl(l,il(e,n),o)},gc.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},_c.dragover=_c.dragenter=(e,t)=>t.preventDefault(),_c.drop=(e,t)=>{try{al(e,t,e.dragging)}finally{e.dragging=null}};function al(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Dc(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=tc(e,tl(t.dataTransfer),Zc?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&il(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||D.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?Yr(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&A.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new A(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(Ms(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}gc.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Cs(e)},20))},gc.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},gc.beforeinput=(e,t)=>{if(lo&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,Wa(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in _c)gc[e]=_c[e];function ol(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var sl=class e{constructor(e,t){this.toDOM=e,this.spec=t||fl,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new ul(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&ol(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},cl=class e{constructor(e,t){this.attrs=e,this.spec=t||fl}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new ul(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&ol(this.attrs,t.attrs)&&ol(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},ll=class e{constructor(e,t){this.attrs=e,this.spec=t||fl}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new ul(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&ol(this.attrs,t.attrs)&&ol(this.spec,t.spec)}destroy(){}},ul=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new sl(n,r))}static inline(t,n,r,i){return new e(t,n,new cl(r,i))}static node(t,n,r,i){return new e(t,n,new ll(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof cl}get widget(){return this.type instanceof sl}},dl=[],fl={},P=class e{constructor(e,t){this.local=e.length?e:dl,this.children=t.length?t:dl}static create(e,t){return t.length?bl(t,e,0,fl):pl}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==pl||e.maps.length==0?this:this.mapInner(e,t,0,0,n||fl)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?hl(this.children,o||[],t,n,r,i,a):o?new e(o.sort(xl),dl):pl}add(t,n){return n.length?this==pl?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=vl(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,bl(s,e,o+1,fl)),a+=3}});let o=gl(a?yl(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(xl):this.local,i||this.children)}remove(e){return e.length==0||this==pl?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==pl?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):pl}forChild(t,n){if(this==pl)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof cl){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(xl),dl);return r?new ml([t,r]):t}return r||pl}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return Sl(this.localsInner(e))}localsInner(e){if(this==pl)return dl;if(e.inlineContent||!this.local.some(cl.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof cl||t.push(this.local[e]);return t}forEachSet(e){e(this)}};P.empty=new P([],[]),P.removeOverlap=Sl;var pl=P.empty,ml=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,fl));return e.from(r)}forChild(t,n){if(n.isLeaf)return P.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=pl&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length){if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}}return t?Sl(n?t:t.sort(xl)):dl}static from(t){switch(t.length){case 0:return pl;case 1:return t[0];default:return new e(t.every(e=>e instanceof P)?t:t.reduce((e,t)=>e.concat(t instanceof P?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function hl(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==pl?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=bl(_l(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new P(t.sort(xl),s)}function gl(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new ul(i.from+t,i.to+t,i.type))}return n}function _l(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function vl(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function yl(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function bl(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=vl(e,t,o+n);if(s){a=!0;let e=bl(s,t,n+o+1,r);e!=pl&&i.push(o,o+t.nodeSize,e)}});let o=gl(a?yl(e):e,-n).sort(xl);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new P(o,i):pl}function xl(e,t){return e.from-t.from||e.to-t.to}function Sl(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from)a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),Cl(t,i+1,a.copy(r.to,a.to)));else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),Cl(t,i,r.copy(a.from,r.to)));break}}}return t}function Cl(e,t,n){for(;t<e.length&&xl(n,e[t])>0;)t++;e.splice(t,0,n)}function wl(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=pl&&t.push(r)}),e.cursorWrapper&&t.push(P.create(e.state.doc,[e.cursorWrapper.deco])),ml.from(t)}var Tl={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},El=$a&&eo<=11,Dl=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},Ol=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Dl,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);$a&&eo<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():ao&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),El&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Tl)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Ns(this.view)){if(this.suppressingSelectionUpdates)return Cs(this.view);if($a&&eo<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Na(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=ka(n))t.add(n);for(let r=e.anchorNode;r;r=ka(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:La(n)?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Ns(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||ro&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(e=>e.type==`childList`&&e.removedNodes.length))){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&N(t);){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(to&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||Pl(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Ua(n)&&(c=xs(e))&&c.eq(O.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Cs(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),jl(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Fl(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Cs(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),La(r)&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if($a&&eo<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?Oa(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?Oa(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}return e.type==`attributes`?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}},kl=new WeakMap,Al=!1;function jl(e){if(!kl.has(e)&&(kl.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=to,Al)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),Al=!0}}function Ml(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return Na(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function Nl(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Ml(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?Ml(e,n):null}function Pl(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function Fl(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||!N(e)||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function Il(e,t,n,r){let{node:i,fromOffset:a,toOffset:o,from:s,to:c}=e.docView.parseRange(t,n),l=e.domSelectionRange(),u,d=l.anchorNode;if(d&&Ra(e.dom,d)&&(u=[{node:d,offset:l.anchorOffset}],Ua(l)||u.push({node:l.focusNode,offset:l.focusOffset})),ro&&e.input.lastKeyCode===8)for(let e=o;e>a;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){o=e;break}if(!n||n.size)break}let f=e.state.doc,p=e.someProp(`domParser`)||Fn.fromSchema(e.state.schema),m=f.resolve(s),h=null,g=p.parse(i,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:a,to:o,preserveWhitespace:m.parent.type.whitespace!=`pre`||`full`,findPositions:u,ruleFromNode:Ll(r),context:m});if(u&&u[0].pos!=null){let e=u[0].pos,t=u[1]&&u[1].pos;t??=e,h={anchor:e+s,head:t+s}}return{doc:g,sel:h,from:s,to:c}}var Ll=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName==`BR`&&t.parentNode){if(ao&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}if(t.parentNode.lastChild==t||ao&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName==`IMG`&&t.getAttribute(`mark-placeholder`))return{ignore:!0};return null},Rl=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function zl(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=xs(e,t);if(n&&!e.state.selection.eq(n)){if(ro&&lo&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,Wa(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=Il(e,t,n,i),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=Gl(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(oo&&e.input.lastIOSEnter>Date.now()-225||lo)&&i.some(e=>N(e)&&!Rl.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,Wa(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m){if(r&&c instanceof k&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=Bl(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof k&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),$a&&eo<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((oo&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&Ul(l.doc,h.pos,g.pos))&&e.someProp(`handleKeyDown`,t=>t(e,Wa(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&Hl(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,Wa(8,`Backspace`)))){lo&&ro&&e.domObserver.suppressSelectionUpdates();return}ro&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),lo&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,Wa(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=Bl(e,n.doc,l.sel);t&&!(ro&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||$a&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v){if(h.pos==g.pos){$a&&eo<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Cs(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=Vl(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x())}else e.dispatch(x())}function Bl(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Ms(e,t.resolve(n.anchor),t.resolve(n.head))}function Vl(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(T.from(l).eq(e))return{mark:s,type:o}}function Hl(e,t,n,r,i){if(n-t<=i.pos-r.pos||Wl(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(Wl(a,!0,!0));return!o.parent.isTextblock||o.pos>n||Wl(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Ul(e,t,n){let r=0,i=0;return e.nodesBetween(t,n,(e,a)=>{e.isTextblock&&a>=t&&a<n?r++:(e.isText?/\S/.test(e.text.slice(Math.max(0,t-a),Math.min(e.nodeSize,n-a))):e.isLeaf)&&i++}),i==0&&r==1}function Wl(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function Gl(e,t,n,r,i){let a=e.findDiffStart(t,n),o=n+e.size,s=n+t.size;if(a==null)return null;let{a:c,b:l}=e.findDiffEnd(t,o,s);if(i==`end`){let e=Math.max(0,a-Math.min(c,l));r-=c+e-a}if(c<a&&o<s){let e=r<=a&&r>=c?a-r:0;a-=e,l=a+(l-c),c=a}else if(l<a){let e=r<=a&&r>=l?a-r:0;a-=e,c=a+(c-l),l=a}return{start:a,endA:c,endB:l}}var Kl=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new yc,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach($l),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Yl(this),Jl(this),this.nodeViews=Zl(this),this.docView=es(this.state.doc,ql(this),wl(this),this.dom,this),this.domObserver=new Ol(this,(e,t,n,r)=>zl(this,e,t,n,r)),this.domObserver.start(),bc(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Cc(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach($l),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(qc(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Zl(this);Ql(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Cc(this),this.editable=Yl(this),Jl(this);let o=wl(this),s=ql(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&_o(this);if(i){this.domObserver.stop();let t=l&&($a||ro)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&Xl(n.selection,e.selection);if(l){let n=ro?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Jc(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=es(e.doc,s,o,this.dom,this)),!n||this.trackWrites&&this.dom.contains(this.trackWrites)||(t=!0)}let i=this.input.mouseDown;t||!(i&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Fs(this)&&i.delaySelUpdate())?Cs(this,t):(As(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&yo(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&Ra(this.dom,e)&&!this.someProp(`handleScrollToSelection`,e=>e(this))){if(this.state.selection instanceof A){let t=this.docView.domAfterPos(this.state.selection.from);N(t)&&go(this,t.getBoundingClientRect(),e)}else go(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new nl(e.slice,e.move,r<0?void 0:A.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if($a){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&So(this.dom),Cs(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Ao(this,e)}coordsAtPos(e,t=1){return Po(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return Wo(this,t||this.state,e)}pasteHTML(e,t){return el(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return el(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return ec(this,e)}destroy(){this.docView&&(Sc(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],wl(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Ma())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Ec(this,e)}domSelectionRange(){let e=this.dom.isConnected!==!1&&this.domSelection();return e?ao&&this.root.nodeType===11&&Ga(this.dom.ownerDocument)==this.dom&&Nl(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};Kl.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function ql(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[ul.node(0,e.state.doc.content.size,t)]}function Jl(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:ul.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Yl(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function Xl(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function Zl(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function Ql(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function $l(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}for(var eu={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},tu={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},nu=typeof navigator<`u`&&/Mac/.test(navigator.platform),ru=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),iu=0;iu<10;iu++)eu[48+iu]=eu[96+iu]=String(iu);for(var iu=1;iu<=24;iu++)eu[iu+111]=`F`+iu;for(var iu=65;iu<=90;iu++)eu[iu]=String.fromCharCode(iu+32),tu[iu]=String.fromCharCode(iu);for(var au in eu)tu.hasOwnProperty(au)||(tu[au]=eu[au]);function ou(e){var t=!(nu&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||ru&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?tu:eu)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var su=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),cu=typeof navigator<`u`&&/Win/.test(navigator.platform);function lu(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))su?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function uu(e){let t=Object.create(null);for(let n in e)t[lu(n)]=e[n];return t}function du(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function fu(e){return new j({props:{handleKeyDown:pu(e)}})}function pu(e){let t=uu(e);return function(e,n){let r=ou(n),i,a=t[du(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[du(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(cu&&n.ctrlKey&&n.altKey)&&(i=eu[n.keyCode])&&i!=r){let r=t[du(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var mu=200,hu=function(){};hu.prototype.append=function(e){return e.length?(e=hu.from(e),!this.length&&e||e.length<mu&&this.leafAppend(e)||this.length<mu&&e.leafPrepend(this)||this.appendInner(e)):this},hu.prototype.prepend=function(e){return e.length?hu.from(e).append(this):this},hu.prototype.appendInner=function(e){return new _u(this,e)},hu.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?hu.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},hu.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},hu.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},hu.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},hu.from=function(e){return e instanceof hu?e:e&&e.length?new gu(e):hu.empty};var gu=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=mu)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=mu)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(hu);hu.empty=new gu([]);var _u=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(hu),vu=500,yu=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step)i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);else{if(i){u.push(new xu(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new xu(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1}},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new xu(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>Cu&&(s=bu(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new pr;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new xu(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;n=Math.min(this.items.length,n);let r=[],i=this.items.length-n,a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new xu(i,o,l))}else r.push(new xu(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new xu(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>vu&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new xu(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(hu.from(i.reverse()),a)}};yu.empty=new yu(hu.empty,0);function bu(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var xu=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},Su=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},Cu=20;function wu(e,t,n,r){let i=n.getMeta(Nu),a;if(i)return i.historyState;n.getMeta(Pu)&&(e=new Su(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(Nu))return o.getMeta(Nu).redo?new Su(e.done.addTransform(n,void 0,r,ju(t)),e.undone,Eu(n.mapping.maps),e.prevTime,e.prevComposition):new Su(e.done,e.undone.addTransform(n,void 0,r,ju(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!Tu(n,e.prevRanges)),s=o?Du(e.prevRanges,n.mapping):Eu(n.mapping.maps);return new Su(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,ju(t)),yu.empty,s,n.time,i??e.prevComposition)}return(a=n.getMeta(`rebased`))?new Su(e.done.rebased(n,a),e.undone.rebased(n,a),Du(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new Su(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Du(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function Tu(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function Eu(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function Du(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function Ou(e,t,n){let r=ju(t),i=Nu.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new Su(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(Nu,{redo:n,historyState:c})}var ku=!1,Au=null;function ju(e){let t=e.plugins;if(Au!=t){ku=!1,Au=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){ku=!0;break}}return ku}function Mu(e){return e.setMeta(Pu,!0)}var Nu=new M(`history`),Pu=new M(`closeHistory`);function Fu(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new j({key:Nu,state:{init(){return new Su(yu.empty,yu.empty,null,0,-1)},apply(t,n,r){return wu(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?Lu:n==`historyRedo`?Ru:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Iu(e,t){return(n,r)=>{let i=Nu.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=Ou(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var Lu=Iu(!1,!0),Ru=Iu(!0,!0);function zu(e){return e.getMeta(Nu)!=null}function Bu(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var Vu=class e{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}static createFakeChain(){let e=new Proxy({},{get:(t,n)=>{if(n!==`then`)return n===`run`?()=>!1:()=>e}});return e}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}static createFallbackCan(){let t=e.createFakeChain();return new Proxy({chain:()=>t},{get:(e,t)=>{if(t!==`then`)return t===`chain`?e.chain:()=>!1}})}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:Bu({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},Hu=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{if(!e.isDestroyed){var n;t.dom.blur(),(n=window)==null||(n=n.getSelection())==null||n.removeAllRanges()}}),!0),Uu=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),Wu=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=kr(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},Gu=e=>t=>e(t),Ku=()=>({state:e,dispatch:t})=>ra(e,t),qu=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new k(r.doc.resolve(Math.max(o-1,0)))),!0},Ju=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function Yu(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var Xu=e=>({tr:t,state:n,dispatch:r})=>{let i=Yu(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},Zu=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},Qu=e=>e.content?/^text(\*|\+)/.test(e.content):!1,$u=(e,t,n)=>{if(!e.parent.isInline||n===`left`&&e.pos>e.start()||n===`right`&&e.pos<e.end())return e.pos;let r=t.nodes[e.parent.type.name].spec;return Qu(r)?n===`left`?e.start()-1:e.end()+1:e.pos},ed=(e,t,n)=>({from:$u(e,n,`left`),to:$u(t,n,`right`)}),td=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){let n=e.tr,{ranges:r}=e.selection,i=n.steps.length;r.forEach(t=>{let r=n.mapping.slice(i),{from:a,to:o}=ed(n.doc.resolve(r.map(t.$from.pos)),n.doc.resolve(r.map(t.$to.pos)),e.schema);n.deleteRange(a,o)}),n.selection.empty||n.setSelection(k.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),t(n)}return!0},nd=()=>({commands:e})=>e.keyboardShortcut(`Enter`),rd=()=>({state:e,dispatch:t})=>na(e,t);function id(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function ad(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:id(t[r])?t[r].test(e[r]):t[r]===e[r])}function od(e,t,n={}){return e.find(e=>e.type===t&&ad(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function sd(e,t,n={}){return!!od(e,t,n)}function cd(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(r.node&&r.node.marks.some(e=>e.type===t)||(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!od([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&sd([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&sd([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function ld(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var ud=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=ld(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=cd(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=k.create(o,e.from,e.to);n.setSelection(t)}}return!0},dd=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function fd(e){return e instanceof k}function pd(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function md(e,t=null){if(!t)return null;let n=O.atStart(e),r=O.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?k.create(e,pd(0,i,a),pd(e.content.size,i,a)):k.create(e,pd(t,i,a),pd(t,i,a))}function hd(){return[`Android`].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function gd(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function _d(){return typeof navigator<`u`&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var vd=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(gd()||hd())&&r.dom.focus(),_d()&&!gd()&&!hd()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!fd(n.state.selection))return o(),!0;let s=md(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},yd=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),bd=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),xd=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&xd(r)}return e};function Sd(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return xd(n)}function Cd(e){return typeof e?.nodesBetween==`function`}function wd(e,t,n){if(Cd(e))return e;let r=typeof e==`object`&&!!e;n={slice:!0,parseOptions:{},...n};let i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return T.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),wd(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new jn({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?Fn.fromSchema(a).parseSlice(Sd(e),n.parseOptions):Fn.fromSchema(a).parse(Sd(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=Fn.fromSchema(t);return n.slice?r.parseSlice(Sd(e),n.parseOptions).content:r.parse(Sd(e),n.parseOptions)}return wd(``,t,n)}function Td(e){return!(`type`in e)}function Ed(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Sr||i instanceof Cr))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(O.near(e.doc.resolve(o),n))}var Dd=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{wd(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=wd(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0,f=Td(i)?i.content:[i];if(f.forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let p;if(u)p=Array.isArray(t)?t.map(e=>e.text||``).join(``):Cd(t)?f.map(e=>e.text??``).join(``):typeof t==`object`&&t&&t.text?t.text:t,r.insertText(p,c,l);else{p=T.from(f);let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,i=t.isText||t.isTextblock,a=t.content.size>0;n&&i&&a&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&Ed(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:p}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:p})}return!0};function Od(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var kd=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{pos:i,attrs:a,content:o,updateSelection:s=!0}=e,c;c=typeof i==`number`?t.doc.resolve(i):i||t.selection.$from;let l=Od(c.parent.contentMatchAt(c.index()));if(!l)return!1;let u=Object.keys(l.spec.attrs||{}),d=a?Object.fromEntries(Object.entries(a).filter(([e])=>u.includes(e))):{},f;if(o){let e=wd(o,r.schema);f=l.createAndFill(d,e)}else f=l.createAndFill(d);return f?(n&&(t.insert(c.pos,f),s&&Ed(t,t.steps.length-1,-1)),!0):!1},Ad=()=>({state:e,dispatch:t})=>Zi(e,t),jd=()=>({state:e,dispatch:t})=>Qi(e,t),Md=()=>({state:e,dispatch:t})=>Bi(e,t),Nd=()=>({state:e,dispatch:t})=>Ji(e,t),Pd=(e,t)=>{let n=e.resolve(t),r=n.nodeBefore,i=n.nodeAfter;return!r||!i?!1:!r.type.spec.isolating&&!i.type.spec.isolating},Fd=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Kr(e.doc,e.selection.$from.pos,-1);return r==null||!Pd(e.doc,r)?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Id=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Kr(e.doc,e.selection.$from.pos,1);return r==null||!Pd(e.doc,r)?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Ld=()=>({state:e,dispatch:t})=>Vi(e,t),Rd=()=>({state:e,dispatch:t})=>Hi(e,t);function zd(){return typeof navigator<`u`&&/Mac/.test(navigator.platform)}function Bd(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))gd()||zd()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var Vd=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=Bd(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function Hd(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?Yu(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>!o||o.name===e.node.type.name).filter(e=>ad(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var Ud=(e,t={})=>({state:n,dispatch:r})=>Hd(n,Yu(e,n.schema),t)?$i(n,r):!1,Wd=()=>({state:e,dispatch:t})=>ia(e,t),Gd=e=>({state:t,dispatch:n})=>wa(Yu(e,t.schema))(t,n),Kd=()=>({state:e,dispatch:t})=>ea(e,t);function qd(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function Jd(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var Yd=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=qd(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=Yu(e,r.schema)),s===`mark`&&(o=ld(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,Jd(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(Jd(a.attrs,t))))})})}),c},Xd=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Zd=()=>({tr:e,dispatch:t})=>{if(t){let t=new Si(e.doc);e.setSelection(t)}return!0},Qd=()=>({state:e,dispatch:t})=>Gi(e,t),$d=()=>({state:e,dispatch:t})=>Yi(e,t),ef=()=>({state:e,dispatch:t})=>sa(e,t),tf=()=>({state:e,dispatch:t})=>pa(e,t),nf=()=>({state:e,dispatch:t})=>fa(e,t);function rf(e,t,n={},r={}){return wd(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var af=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=rf(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});if(o){let e=Td(s)?s.content:[s];a.replaceWith(0,c.content.size,e).setMeta(`preventUpdate`,!n)}return!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function of(e,t){let n=ld(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function sf(e,t){let n=new hi(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function cf(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function lf(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function uf(e){return t=>lf(t.$from,e)}function F(e,t,n){return e.config[t]===void 0&&e.parent?F(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?F(e.parent,t,n):null}):e.config[t]}function df(e){return e.map(e=>{let t=F(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...df(t())]:e}).flat(10)}function ff(e,t){let n=Yn.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function pf(e){return typeof e==`function`}function I(e,t=void 0,...n){return pf(e)?t?e.bind(t)(...n):e(...n):e}function mf(e={}){return Object.keys(e).length===0&&e.constructor===Object}function hf(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function gf(e){let t=[],{nodeExtensions:n,markExtensions:r}=hf(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=F(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=F(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function _f(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i)r=!r,n+=o;else if(o===`"`&&!r)i=!i,n+=o;else{if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}}return n&&t.push(n),t}function vf(e){let t=[],n=_f(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function L(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(e===`__proto__`)Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0});else if(!n[e])n[e]=t;else if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...vf(n[e]),...vf(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function yf(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>L(e,t),{})}function bf(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`||e!==`false`&&e:e}function xf(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):bf(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function Sf(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&mf(t)?!1:t!=null))}function Cf(e){var t,n;let r={};return!(e!=null&&(t=e.attribute)!=null&&t.isRequired)&&`default`in(e?.attribute||{})&&(r.default=e.attribute.default),(e==null||(n=e.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function wf(e,t){let n=gf(e),{nodeExtensions:r,markExtensions:i}=hf(e),a=r.find(e=>F(e,`topNode`))?.name;return new jn({topNode:a,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=Sf({...e.reduce((e,t)=>{let n=F(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:I(F(r,`content`,a)),marks:I(F(r,`marks`,a)),group:I(F(r,`group`,a)),inline:I(F(r,`inline`,a)),atom:I(F(r,`atom`,a)),selectable:I(F(r,`selectable`,a)),draggable:I(F(r,`draggable`,a)),code:I(F(r,`code`,a)),whitespace:I(F(r,`whitespace`,a)),linebreakReplacement:I(F(r,`linebreakReplacement`,a)),defining:I(F(r,`defining`,a)),isolating:I(F(r,`isolating`,a)),attrs:Object.fromEntries(i.map(Cf))}),s=I(F(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>xf(e,i)));let c=F(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:yf(e,i)}));let l=F(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=Sf({...e.reduce((e,t)=>{let n=F(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:I(F(r,`inclusive`,a)),excludes:I(F(r,`excludes`,a)),group:I(F(r,`group`,a)),spanning:I(F(r,`spanning`,a)),code:I(F(r,`code`,a)),attrs:Object.fromEntries(i.map(Cf))}),s=I(F(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>xf(e,i)));let c=F(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:yf(e,i)})),[r.name,o]}))})}function Tf(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function Ef(e){return e.sort((e,t)=>{let n=F(e,`priority`)||100,r=F(t,`priority`)||100;return n>r?-1:+(n<r)})}function Df(e){let t=Ef(df(e)),n=Tf(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function Of(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
|
|
9
|
+
`),slice:t}}function ec(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new O(E.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
10
|
+
`))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=Jn.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=fc(n),lo&&pc(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&!P(e);)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||Pn.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!tc.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=mc(sc(s,+u[1],+u[2]),u[4]);else if(s=O.maxOpen(nc(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=sc(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var tc=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function nc(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&ic(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=ac(a[a.length-1],i.length));let n=rc(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return E.from(a)}return e}function rc(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,E.from(e));return e}function ic(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=ic(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(E.from(rc(n,e,i+1))))}}function ac(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,ac(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(E.empty,!0);return e.copy(n.append(r))}function oc(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=oc(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(E.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function sc(e,t,n){return t<e.openStart&&(e=new O(oc(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new O(oc(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var cc={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]};function lc(){return document.implementation.createHTMLDocument(`title`)}var uc=null;function dc(e){let t=window.trustedTypes;if(!t)return e;if(!uc){if(uc=t.defaultPolicy)try{return uc.createHTML(e)}catch{}uc=t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e})}return uc.createHTML(e)}function fc(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=lc(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(e),a;if((a=i&&cc[i[1].toLowerCase()])&&(e=a.map(e=>`<`+e+`>`).join(``)+e+a.map(e=>`</`+e+`>`).reverse().join(``)),r.innerHTML=dc(e),a)for(let e=0;e<a.length;e++)r=r.querySelector(a[e])||r;for(let e=0;e<n.styleSheets.length;e++){let t=n.styleSheets[e];for(let e=0;e<t.rules.length;e++){let n=t.rules[e];if(n instanceof CSSStyleRule){let e=r.querySelectorAll(n.selectorText);for(let t=0;t<e.length;t++)e[t].style.cssText+=n.style.cssText}}}return r}function pc(e){let t=e.querySelectorAll(no?`span:not([class]):not([style])`:`span.Apple-converted-space`);for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function mc(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;try{i=E.from(t.create(r[e+1],i))}catch{break}a++,o++}return new O(i,a,o)}var hc={},gc={},_c={touchstart:!0,touchmove:!0},vc=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:``,button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function yc(e){for(let t in hc){let n=hc[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{wc(e,t)&&!Cc(e,t)&&(e.editable||!(t.type in gc))&&n(e,t)},_c[t]?{passive:!0}:void 0)}io&&e.dom.addEventListener(`input`,()=>null),Sc(e)}function bc(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function xc(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function Sc(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Cc(e,t))})}function Cc(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function wc(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Tc(e,t){!Cc(e,t)&&hc[t.type]&&(e.editable||!(t.type in gc))&&hc[t.type](e,t)}gc.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!Hc(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(co&&no&&n.keyCode==13))){if(n.keyCode!=229&&e.domObserver.forceFlush(),ao&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,Ua(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||Qs(e,n)?n.preventDefault():bc(e,`key`)}},gc.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},gc.keypress=(e,t)=>{let n=t;if(Hc(e)||!n.charCode||n.ctrlKey&&!n.altKey||oo&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof A)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function Ec(e){return{left:e.clientX,top:e.clientY}}function Dc(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function Oc(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function kc(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta(`pointer`,!0),e.dispatch(r)}function Ac(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&j.isSelectable(r)?(kc(e,new j(n)),!0):!1}function jc(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof j&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(j.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i!=null&&(kc(e,j.create(e.state.doc,i)),!0)}function Mc(e,t,n,r,i){return Oc(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?jc(e,n):Ac(e,n))}function Nc(e,t,n,r){return Oc(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function Pc(e,t,n,r){return Oc(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||Fc(e,n,r)}function Fc(e,t,n){if(n.button!=0)return!1;let r=Ic(e,t,!0),i=e.state.doc;return r?(kc(e,r),r instanceof A&&i.eq(e.state.doc)&&(e.input.mouseDown=new Vc(e,r)),!0):!1}function Ic(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?A.create(r,0,r.content.size):null;let i=r.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e),a=i.before(e);if(t.inlineContent)return A.create(r,a+1,a+1+t.content.size);if(n&&j.isSelectable(t))return j.create(r,a)}return null}function Lc(e){return Jc(e)}var Rc=oo?`metaKey`:`ctrlKey`;hc.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Lc(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&Dc(n,e.input.lastClick)&&!n[Rc]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let o=e.posAtCoords(Ec(n));o&&(a==`singleClick`?e.input.mouseDown=new Bc(e,o,n,!!r):(a==`doubleClick`?Nc:Pc)(e,o.pos,o.inside,n)?n.preventDefault():bc(e,`pointer`))};var zc=class{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}},Bc=class extends zc{constructor(e,t,n,r){super(e),this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[Rc],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&P(s.nodeDOM)?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof j&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!!(this.target&&eo&&!this.target.hasAttribute(`contentEditable`))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute(`contentEditable`,`false`)},20),this.view.domObserver.start()),bc(e,`pointer`)}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute(`draggable`),this.mightDrag.setUneditable&&this.target.removeAttribute(`contentEditable`),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||Ss(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Ec(e))),this.updateAllowDefault(e),this.allowDefault||!t?bc(this.view,`pointer`):Mc(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||io&&this.mightDrag&&!this.mightDrag.node.isAtom||no&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(kc(this.view,k.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):bc(this.view,`pointer`)}move(e){this.updateAllowDefault(e),bc(this.view,`pointer`),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}},Vc=class extends zc{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),bc(this.view,`pointer`);let t=this.view.posAtCoords(Ec(e)),n=t&&Ic(this.view,t.inside,!1);if(!n)return;let{doc:r}=this.view.state,i=this.startSelection,[a,o]=n.from<i.from?[i.to,n.from]:[i.from,n.to];kc(this.view,A.create(r,a,o))}};hc.touchstart=e=>{e.input.lastTouch=Date.now(),Lc(e),bc(e,`pointer`)},hc.touchmove=e=>{e.input.lastTouch=Date.now(),bc(e,`pointer`)},hc.contextmenu=e=>Lc(e);function Hc(e,t){return e.composing?!0:io&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var Uc=co?5e3:-1;gc.compositionstart=gc.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof A&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||no&&so&&Wc(e)))e.markCursor=e.state.storedMarks||n.marks(),Jc(e,!0),e.markCursor=null;else if(Jc(e,!t.selection.empty),eo&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&P(n)&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(Ia(t)){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}Gc(e,Uc)};function Wc(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||!P(t)||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return P(r)&&r.contentEditable==`false`}gc.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Gc(e,20))};function Gc(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Jc(e),t))}function Kc(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function qc(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=Ra(t.focusNode,t.focusOffset),r=za(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return r}}return n||r}function Jc(e,t=!1){if(!(co&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Kc(e),t||e.docView&&e.docView.dirty){let n=bs(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function Yc(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement(`div`));n.appendChild(t),n.style.cssText=`position: fixed; left: -10000px; top: 10px`;let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var Xc=Qa&&$a<15||ao&&uo<604;hc.copy=gc.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=Xc?null:n.clipboardData,{dom:o,text:s}=$s(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):Yc(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function Zc(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Qc(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?`textarea`:`div`));n||(r.contentEditable=`true`),r.style.cssText=`position: fixed; left: -10000px; top: 10px`,r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?$c(e,r.value,null,i,t):$c(e,r.textContent,r.innerHTML,i,t)},50)}function $c(e,t,n,r,i){let a=ec(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||O.empty)))return!0;if(!a)return!1;let o=Zc(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function el(e){let t=e.getData(`text/plain`)||e.getData(`Text`);if(t)return t;let n=e.getData(`text/uri-list`);return n?n.replace(/\r?\n/g,` `):``}gc.paste=(e,t)=>{let n=t;if(e.composing&&!co)return;let r=Xc?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&$c(e,el(r),r.getData(`text/html`),i,n)?n.preventDefault():Qc(e,n)};var tl=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},nl=oo?`altKey`:`ctrlKey`;function rl(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[nl]:!n}hc.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(Ec(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof j?i.to-1:i.to))){if(r&&r.mightDrag)o=j.create(e.state.doc,r.mightDrag.pos);else if(n.target&&P(n.target)){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=j.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=$s(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!no||ro>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Xc?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,Xc||n.dataTransfer.setData(`text/plain`,c),e.dragging=new tl(l,rl(e,n),o)},hc.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},gc.dragover=gc.dragenter=(e,t)=>t.preventDefault(),gc.drop=(e,t)=>{try{il(e,t,e.dragging)}finally{e.dragging=null}};function il(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Ec(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=ec(e,el(t.dataTransfer),Xc?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&rl(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||O.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?Jr(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&j.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new j(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(js(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}hc.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add(`ProseMirror-focused`),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Ss(e)},20))},hc.blur=(e,t)=>{let n=t;e.focused&&=(e.domObserver.stop(),e.dom.classList.remove(`ProseMirror-focused`),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),!1)},hc.beforeinput=(e,t)=>{if(co&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,Ua(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in gc)hc[e]=gc[e];function al(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var ol=class e{constructor(e,t){this.toDOM=e,this.spec=t||dl,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new ll(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&al(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},sl=class e{constructor(e,t){this.attrs=e,this.spec=t||dl}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new ll(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&al(this.attrs,t.attrs)&&al(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},cl=class e{constructor(e,t){this.attrs=e,this.spec=t||dl}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new ll(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&al(this.attrs,t.attrs)&&al(this.spec,t.spec)}destroy(){}},ll=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new ol(n,r))}static inline(t,n,r,i){return new e(t,n,new sl(r,i))}static node(t,n,r,i){return new e(t,n,new cl(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof sl}get widget(){return this.type instanceof ol}},ul=[],dl={},F=class e{constructor(e,t){this.local=e.length?e:ul,this.children=t.length?t:ul}static create(e,t){return t.length?yl(t,e,0,dl):fl}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==fl||e.maps.length==0?this:this.mapInner(e,t,0,0,n||dl)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?ml(this.children,o||[],t,n,r,i,a):o?new e(o.sort(bl),ul):fl}add(t,n){return n.length?this==fl?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=_l(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,yl(s,e,o+1,dl)),a+=3}});let o=hl(a?vl(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(bl):this.local,i||this.children)}remove(e){return e.length==0||this==fl?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==fl?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):fl}forChild(t,n){if(this==fl)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof sl){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(bl),ul);return r?new pl([t,r]):t}return r||fl}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return xl(this.localsInner(e))}localsInner(e){if(this==fl)return ul;if(e.inlineContent||!this.local.some(sl.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof sl||t.push(this.local[e]);return t}forEachSet(e){e(this)}};F.empty=new F([],[]),F.removeOverlap=xl;var fl=F.empty,pl=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,dl));return e.from(r)}forChild(t,n){if(n.isLeaf)return F.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=fl&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length){if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}}return t?xl(n?t:t.sort(bl)):ul}static from(t){switch(t.length){case 0:return fl;case 1:return t[0];default:return new e(t.every(e=>e instanceof F)?t:t.reduce((e,t)=>e.concat(t instanceof F?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function ml(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==fl?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=yl(gl(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new F(t.sort(bl),s)}function hl(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new ll(i.from+t,i.to+t,i.type))}return n}function gl(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function _l(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function vl(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function yl(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=_l(e,t,o+n);if(s){a=!0;let e=yl(s,t,n+o+1,r);e!=fl&&i.push(o,o+t.nodeSize,e)}});let o=hl(a?vl(e):e,-n).sort(bl);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new F(o,i):fl}function bl(e,t){return e.from-t.from||e.to-t.to}function xl(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let a=t[i];if(a.from==r.from)a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),Sl(t,i+1,a.copy(r.to,a.to)));else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),Sl(t,i,r.copy(a.from,r.to)));break}}}return t}function Sl(e,t,n){for(;t<e.length&&bl(n,e[t])>0;)t++;e.splice(t,0,n)}function Cl(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=fl&&t.push(r)}),e.cursorWrapper&&t.push(F.create(e.state.doc,[e.cursorWrapper.deco])),pl.from(t)}var wl={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Tl=Qa&&$a<=11,El=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},Dl=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new El,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);Qa&&$a<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():io&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Tl&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,wl)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener(`DOMCharacterDataModified`,this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener(`selectionchange`,this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener(`selectionchange`,this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Ms(this.view)){if(this.suppressingSelectionUpdates)return Ss(this.view);if(Qa&&$a<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Ma(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=Oa(n))t.add(n);for(let r=e.anchorNode;r;r=Oa(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:Ia(n)?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Ms(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||no&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(e=>e.type==`childList`&&e.removedNodes.length))){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&P(t);){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(eo&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||Nl(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Ha(n)&&(c=bs(e))&&c.eq(k.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ss(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),Al(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Pl(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Ss(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),Ia(r)&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(Qa&&$a<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?Da(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?Da(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}return e.type==`attributes`?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}},Ol=new WeakMap,kl=!1;function Al(e){if(!Ol.has(e)&&(Ol.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=eo,kl)return;console.warn(`ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.`),kl=!0}}function jl(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return Ma(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function Ml(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return jl(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?jl(e,n):null}function Nl(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function Pl(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||!P(e)||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function Fl(e,t,n,r){let{node:i,fromOffset:a,toOffset:o,from:s,to:c}=e.docView.parseRange(t,n),l=e.domSelectionRange(),u,d=l.anchorNode;if(d&&La(e.dom,d)&&(u=[{node:d,offset:l.anchorOffset}],Ha(l)||u.push({node:l.focusNode,offset:l.focusOffset})),no&&e.input.lastKeyCode===8)for(let e=o;e>a;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){o=e;break}if(!n||n.size)break}let f=e.state.doc,p=e.someProp(`domParser`)||Pn.fromSchema(e.state.schema),m=f.resolve(s),h=null,g=p.parse(i,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:a,to:o,preserveWhitespace:m.parent.type.whitespace!=`pre`||`full`,findPositions:u,ruleFromNode:Il(r),context:m});if(u&&u[0].pos!=null){let e=u[0].pos,t=u[1]&&u[1].pos;t??=e,h={anchor:e+s,head:t+s}}return{doc:g,sel:h,from:s,to:c}}var Il=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName==`BR`&&t.parentNode){if(io&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}if(t.parentNode.lastChild==t||io&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName==`IMG`&&t.getAttribute(`mark-placeholder`))return{ignore:!0};return null},Ll=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Rl(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=bs(e,t);if(n&&!e.state.selection.eq(n)){if(no&&co&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,Ua(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=Fl(e,t,n,i),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=Wl(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(ao&&e.input.lastIOSEnter>Date.now()-225||co)&&i.some(e=>P(e)&&!Ll.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,Ua(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m){if(r&&c instanceof A&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=zl(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof A&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),Qa&&$a<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((ao&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&Hl(l.doc,h.pos,g.pos))&&e.someProp(`handleKeyDown`,t=>t(e,Ua(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&Vl(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,Ua(8,`Backspace`)))){co&&no&&e.domObserver.suppressSelectionUpdates();return}no&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),co&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,Ua(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=zl(e,n.doc,l.sel);t&&!(no&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||Qa&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v){if(h.pos==g.pos){Qa&&$a<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ss(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=Bl(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x())}else e.dispatch(x())}function zl(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:js(e,t.resolve(n.anchor),t.resolve(n.head))}function Bl(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(E.from(l).eq(e))return{mark:s,type:o}}function Vl(e,t,n,r,i){if(n-t<=i.pos-r.pos||Ul(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(Ul(a,!0,!0));return!o.parent.isTextblock||o.pos>n||Ul(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Hl(e,t,n){let r=0,i=0;return e.nodesBetween(t,n,(e,a)=>{e.isTextblock&&a>=t&&a<n?r++:(e.isText?/\S/.test(e.text.slice(Math.max(0,t-a),Math.min(e.nodeSize,n-a))):e.isLeaf)&&i++}),i==0&&r==1}function Ul(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function Wl(e,t,n,r,i){let a=e.findDiffStart(t,n),o=n+e.size,s=n+t.size;if(a==null)return null;let{a:c,b:l}=e.findDiffEnd(t,o,s);if(i==`end`){let e=Math.max(0,a-Math.min(c,l));r-=c+e-a}if(c<a&&o<s){let e=r<=a&&r>=c?a-r:0;a-=e,l=a+(l-c),c=a}else if(l<a){let e=r<=a&&r>=l?a-r:0;a-=e,c=a+(c-l),l=a}return{start:a,endA:c,endB:l}}var Gl=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new vc,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Ql),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Jl(this),ql(this),this.nodeViews=Xl(this),this.docView=$o(this.state.doc,Kl(this),Cl(this),this.dom,this),this.domObserver=new Dl(this,(e,t,n,r)=>Rl(this,e,t,n,r)),this.domObserver.start(),yc(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Sc(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Ql),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(Kc(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Xl(this);Zl(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Sc(this),this.editable=Jl(this),ql(this);let o=Cl(this),s=Kl(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&go(this);if(i){this.domObserver.stop();let t=l&&(Qa||no)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&Yl(n.selection,e.selection);if(l){let n=no?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=qc(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=$o(e.doc,s,o,this.dom,this)),!n||this.trackWrites&&this.dom.contains(this.trackWrites)||(t=!0)}let i=this.input.mouseDown;t||!(i&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Ps(this)&&i.delaySelUpdate())?Ss(this,t):(ks(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&vo(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&La(this.dom,e)&&!this.someProp(`handleScrollToSelection`,e=>e(this))){if(this.state.selection instanceof j){let t=this.docView.domAfterPos(this.state.selection.from);P(t)&&ho(this,t.getBoundingClientRect(),e)}else ho(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new tl(e.slice,e.move,r<0?void 0:j.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(Qa){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&xo(this.dom),Ss(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return ko(this,e)}coordsAtPos(e,t=1){return No(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return Uo(this,t||this.state,e)}pasteHTML(e,t){return $c(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return $c(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return $s(this,e)}destroy(){this.docView&&(xc(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Cl(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,ja())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Tc(this,e)}domSelectionRange(){let e=this.dom.isConnected!==!1&&this.domSelection();return e?io&&this.root.nodeType===11&&Wa(this.dom.ownerDocument)==this.dom&&Ml(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};Gl.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function Kl(e){let t=Object.create(null);return t.class=`ProseMirror`,t.contenteditable=String(e.editable),e.someProp(`attributes`,n=>{if(typeof n==`function`&&(n=n(e.state)),n)for(let e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[ll.node(0,e.state.doc.content.size,t)]}function ql(e){if(e.markCursor){let t=document.createElement(`img`);t.className=`ProseMirror-separator`,t.setAttribute(`mark-placeholder`,`true`),t.setAttribute(`alt`,``),e.cursorWrapper={dom:t,deco:ll.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Jl(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function Yl(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function Xl(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function Zl(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function Ql(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}for(var $l={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},eu={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},tu=typeof navigator<`u`&&/Mac/.test(navigator.platform),nu=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ru=0;ru<10;ru++)$l[48+ru]=$l[96+ru]=String(ru);for(var ru=1;ru<=24;ru++)$l[ru+111]=`F`+ru;for(var ru=65;ru<=90;ru++)$l[ru]=String.fromCharCode(ru+32),eu[ru]=String.fromCharCode(ru);for(var iu in $l)eu.hasOwnProperty(iu)||(eu[iu]=$l[iu]);function au(e){var t=!(tu&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||nu&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?eu:$l)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var ou=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),su=typeof navigator<`u`&&/Win/.test(navigator.platform);function cu(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))ou?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function lu(e){let t=Object.create(null);for(let n in e)t[cu(n)]=e[n];return t}function uu(e,t,n=!0){return t.altKey&&(e=`Alt-`+e),t.ctrlKey&&(e=`Ctrl-`+e),t.metaKey&&(e=`Meta-`+e),n&&t.shiftKey&&(e=`Shift-`+e),e}function du(e){return new M({props:{handleKeyDown:fu(e)}})}function fu(e){let t=lu(e);return function(e,n){let r=au(n),i,a=t[uu(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[uu(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(su&&n.ctrlKey&&n.altKey)&&(i=$l[n.keyCode])&&i!=r){let r=t[uu(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var pu=200,mu=function(){};mu.prototype.append=function(e){return e.length?(e=mu.from(e),!this.length&&e||e.length<pu&&this.leafAppend(e)||this.length<pu&&e.leafPrepend(this)||this.appendInner(e)):this},mu.prototype.prepend=function(e){return e.length?mu.from(e).append(this):this},mu.prototype.appendInner=function(e){return new gu(this,e)},mu.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?mu.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},mu.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},mu.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},mu.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},mu.from=function(e){return e instanceof mu?e:e&&e.length?new hu(e):mu.empty};var hu=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=pu)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=pu)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(mu);mu.empty=new hu([]);var gu=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(mu),_u=500,vu=class e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step)i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);else{if(i){u.push(new bu(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new bu(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1}},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new bu(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>Su&&(s=yu(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new fr;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new bu(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;n=Math.min(this.items.length,n);let r=[],i=this.items.length-n,a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new bu(i,o,l))}else r.push(new bu(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new bu(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>_u&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new bu(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(mu.from(i.reverse()),a)}};vu.empty=new vu(mu.empty,0);function yu(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var bu=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},xu=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},Su=20;function Cu(e,t,n,r){let i=n.getMeta(Mu),a;if(i)return i.historyState;n.getMeta(Nu)&&(e=new xu(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(Mu))return o.getMeta(Mu).redo?new xu(e.done.addTransform(n,void 0,r,Au(t)),e.undone,Tu(n.mapping.maps),e.prevTime,e.prevComposition):new xu(e.done,e.undone.addTransform(n,void 0,r,Au(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!wu(n,e.prevRanges)),s=o?Eu(e.prevRanges,n.mapping):Tu(n.mapping.maps);return new xu(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,Au(t)),vu.empty,s,n.time,i??e.prevComposition)}return(a=n.getMeta(`rebased`))?new xu(e.done.rebased(n,a),e.undone.rebased(n,a),Eu(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new xu(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Eu(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function wu(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function Tu(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function Eu(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function Du(e,t,n){let r=Au(t),i=Mu.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new xu(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(Mu,{redo:n,historyState:c})}var Ou=!1,ku=null;function Au(e){let t=e.plugins;if(ku!=t){Ou=!1,ku=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Ou=!0;break}}return Ou}function ju(e){return e.setMeta(Nu,!0)}var Mu=new N(`history`),Nu=new N(`closeHistory`);function Pu(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new M({key:Mu,state:{init(){return new xu(vu.empty,vu.empty,null,0,-1)},apply(t,n,r){return Cu(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?Iu:n==`historyRedo`?Lu:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Fu(e,t){return(n,r)=>{let i=Mu.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=Du(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var Iu=Fu(!1,!0),Lu=Fu(!0,!0);function Ru(e){return e.getMeta(Mu)!=null}function zu(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var Bu=class e{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}static createFakeChain(){let e=new Proxy({},{get:(t,n)=>{if(n!==`then`)return n===`run`?()=>!1:()=>e}});return e}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}static createFallbackCan(){let t=e.createFakeChain();return new Proxy({chain:()=>t},{get:(e,t)=>{if(t!==`then`)return t===`chain`?e.chain:()=>!1}})}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:zu({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},Vu=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{if(!e.isDestroyed){var n;t.dom.blur(),(n=window)==null||(n=n.getSelection())==null||n.removeAllRanges()}}),!0),Hu=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),Uu=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=Or(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},Wu=e=>t=>e(t),Gu=()=>({state:e,dispatch:t})=>na(e,t),Ku=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new A(r.doc.resolve(Math.max(o-1,0)))),!0},qu=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function Ju(e,t){if(typeof e==`string`){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var Yu=e=>({tr:t,state:n,dispatch:r})=>{let i=Ju(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},Xu=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},Zu=e=>e.content?/^text(\*|\+)/.test(e.content):!1,Qu=(e,t,n)=>{if(!e.parent.isInline||n===`left`&&e.pos>e.start()||n===`right`&&e.pos<e.end())return e.pos;let r=t.nodes[e.parent.type.name].spec;return Zu(r)?n===`left`?e.start()-1:e.end()+1:e.pos},$u=(e,t,n)=>({from:Qu(e,n,`left`),to:Qu(t,n,`right`)}),ed=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){let n=e.tr,{ranges:r}=e.selection,i=n.steps.length;r.forEach(t=>{let r=n.mapping.slice(i),{from:a,to:o}=$u(n.doc.resolve(r.map(t.$from.pos)),n.doc.resolve(r.map(t.$to.pos)),e.schema);n.deleteRange(a,o)}),n.selection.empty||n.setSelection(A.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),t(n)}return!0},td=()=>({commands:e})=>e.keyboardShortcut(`Enter`),nd=()=>({state:e,dispatch:t})=>ta(e,t);function rd(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function id(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:rd(t[r])?t[r].test(e[r]):t[r]===e[r])}function ad(e,t,n={}){return e.find(e=>e.type===t&&id(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function od(e,t,n={}){return!!ad(e,t,n)}function sd(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(r.node&&r.node.marks.some(e=>e.type===t)||(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!ad([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&od([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&od([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function cd(e,t){if(typeof e==`string`){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var ld=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=cd(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=sd(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=A.create(o,e.from,e.to);n.setSelection(t)}}return!0},ud=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function dd(e){return e instanceof A}function fd(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function pd(e,t=null){if(!t)return null;let n=k.atStart(e),r=k.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?A.create(e,fd(0,i,a),fd(e.content.size,i,a)):A.create(e,fd(t,i,a),fd(t,i,a))}function md(){return[`Android`].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function hd(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function gd(){return typeof navigator<`u`&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var _d=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(hd()||md())&&r.dom.focus(),gd()&&!hd()&&!md()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!dd(n.state.selection))return o(),!0;let s=pd(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},vd=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),yd=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),bd=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&bd(r)}return e};function xd(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return bd(n)}function Sd(e){return typeof e?.nodesBetween==`function`}function Cd(e,t,n){if(Sd(e))return e;let r=typeof e==`object`&&!!e;n={slice:!0,parseOptions:{},...n};let i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return E.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),Cd(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new An({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:`inline*`,group:`block`,parseDOM:[{tag:`*`,getAttrs:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?Pn.fromSchema(a).parseSlice(xd(e),n.parseOptions):Pn.fromSchema(a).parse(xd(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=Pn.fromSchema(t);return n.slice?r.parseSlice(xd(e),n.parseOptions).content:r.parse(xd(e),n.parseOptions)}return Cd(``,t,n)}function wd(e){return!(`type`in e)}function Td(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof xr||i instanceof Sr))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(k.near(e.doc.resolve(o),n))}var Ed=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{Cd(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=Cd(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0,f=wd(i)?i.content:[i];if(f.forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let p;if(u)p=Array.isArray(t)?t.map(e=>e.text||``).join(``):Sd(t)?f.map(e=>e.text??``).join(``):typeof t==`object`&&t&&t.text?t.text:t,r.insertText(p,c,l);else{p=E.from(f);let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,i=t.isText||t.isTextblock,a=t.content.size>0;n&&i&&a&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&Td(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:p}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:p})}return!0};function Dd(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var Od=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{pos:i,attrs:a,content:o,updateSelection:s=!0}=e,c;c=typeof i==`number`?t.doc.resolve(i):i||t.selection.$from;let l=Dd(c.parent.contentMatchAt(c.index()));if(!l)return!1;let u=Object.keys(l.spec.attrs||{}),d=a?Object.fromEntries(Object.entries(a).filter(([e])=>u.includes(e))):{},f;if(o){let e=Cd(o,r.schema);f=l.createAndFill(d,e)}else f=l.createAndFill(d);return f?(n&&(t.insert(c.pos,f),s&&Td(t,t.steps.length-1,-1)),!0):!1},kd=()=>({state:e,dispatch:t})=>Xi(e,t),Ad=()=>({state:e,dispatch:t})=>Zi(e,t),jd=()=>({state:e,dispatch:t})=>zi(e,t),Md=()=>({state:e,dispatch:t})=>qi(e,t),Nd=(e,t)=>{let n=e.resolve(t),r=n.nodeBefore,i=n.nodeAfter;return!r||!i?!1:!r.type.spec.isolating&&!i.type.spec.isolating},Pd=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Gr(e.doc,e.selection.$from.pos,-1);return r==null||!Nd(e.doc,r)?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Fd=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Gr(e.doc,e.selection.$from.pos,1);return r==null||!Nd(e.doc,r)?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Id=()=>({state:e,dispatch:t})=>Bi(e,t),Ld=()=>({state:e,dispatch:t})=>Vi(e,t);function Rd(){return typeof navigator<`u`&&/Mac/.test(navigator.platform)}function zd(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))hd()||Rd()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var Bd=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=zd(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function Vd(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?Ju(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>!o||o.name===e.node.type.name).filter(e=>id(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var Hd=(e,t={})=>({state:n,dispatch:r})=>Vd(n,Ju(e,n.schema),t)?Qi(n,r):!1,Ud=()=>({state:e,dispatch:t})=>ra(e,t),Wd=e=>({state:t,dispatch:n})=>Ca(Ju(e,t.schema))(t,n),Gd=()=>({state:e,dispatch:t})=>$i(e,t);function Kd(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function qd(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var Jd=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Kd(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=Ju(e,r.schema)),s===`mark`&&(o=cd(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,qd(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(qd(a.attrs,t))))})})}),c},Yd=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),Xd=()=>({tr:e,dispatch:t})=>{if(t){let t=new xi(e.doc);e.setSelection(t)}return!0},Zd=()=>({state:e,dispatch:t})=>Wi(e,t),Qd=()=>({state:e,dispatch:t})=>Ji(e,t),$d=()=>({state:e,dispatch:t})=>oa(e,t),ef=()=>({state:e,dispatch:t})=>fa(e,t),tf=()=>({state:e,dispatch:t})=>da(e,t);function nf(e,t,n={},r={}){return Cd(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var rf=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=nf(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});if(o){let e=wd(s)?s.content:[s];a.replaceWith(0,c.content.size,e).setMeta(`preventUpdate`,!n)}return!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function af(e,t){let n=cd(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function of(e,t){let n=new mi(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function sf(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function cf(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function lf(e){return t=>cf(t.$from,e)}function I(e,t,n){return e.config[t]===void 0&&e.parent?I(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?I(e.parent,t,n):null}):e.config[t]}function uf(e){return e.map(e=>{let t=I(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...uf(t())]:e}).flat(10)}function df(e,t){let n=Jn.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function ff(e){return typeof e==`function`}function L(e,t=void 0,...n){return ff(e)?t?e.bind(t)(...n):e(...n):e}function pf(e={}){return Object.keys(e).length===0&&e.constructor===Object}function mf(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function hf(e){let t=[],{nodeExtensions:n,markExtensions:r}=mf(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=I(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=I(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function gf(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i)r=!r,n+=o;else if(o===`"`&&!r)i=!i,n+=o;else{if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}}return n&&t.push(n),t}function _f(e){let t=[],n=gf(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function R(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(e===`__proto__`)Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0});else if(!n[e])n[e]=t;else if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([..._f(n[e]),..._f(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function vf(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>R(e,t),{})}function yf(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`||e!==`false`&&e:e}function bf(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):yf(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function xf(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&pf(t)?!1:t!=null))}function Sf(e){var t,n;let r={};return!(e!=null&&(t=e.attribute)!=null&&t.isRequired)&&`default`in(e?.attribute||{})&&(r.default=e.attribute.default),(e==null||(n=e.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function Cf(e,t){let n=hf(e),{nodeExtensions:r,markExtensions:i}=mf(e),a=r.find(e=>I(e,`topNode`))?.name;return new An({topNode:a,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=xf({...e.reduce((e,t)=>{let n=I(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:L(I(r,`content`,a)),marks:L(I(r,`marks`,a)),group:L(I(r,`group`,a)),inline:L(I(r,`inline`,a)),atom:L(I(r,`atom`,a)),selectable:L(I(r,`selectable`,a)),draggable:L(I(r,`draggable`,a)),code:L(I(r,`code`,a)),whitespace:L(I(r,`whitespace`,a)),linebreakReplacement:L(I(r,`linebreakReplacement`,a)),defining:L(I(r,`defining`,a)),isolating:L(I(r,`isolating`,a)),attrs:Object.fromEntries(i.map(Sf))}),s=L(I(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>bf(e,i)));let c=I(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:vf(e,i)}));let l=I(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=xf({...e.reduce((e,t)=>{let n=I(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:L(I(r,`inclusive`,a)),excludes:L(I(r,`excludes`,a)),group:L(I(r,`group`,a)),spanning:L(I(r,`spanning`,a)),code:L(I(r,`code`,a)),attrs:Object.fromEntries(i.map(Sf))}),s=L(I(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>bf(e,i)));let c=I(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:vf(e,i)})),[r.name,o]}))})}function wf(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function Tf(e){return e.sort((e,t)=>{let n=I(e,`priority`)||100,r=I(t,`priority`)||100;return n>r?-1:+(n<r)})}function Ef(e){let t=Tf(uf(e)),n=wf(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function Df(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
|
|
11
11
|
|
|
12
|
-
`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;if(e.isText){var d;s+=e==null||(d=e.text)==null?void 0:d.slice(Math.max(r,n)-n,i-n)}}),s}function kf(e,t){return Of(e,{from:0,to:e.content.size},t)}function Af(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function jf(e,t){let n=Yu(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function Mf(e,t){let n=qd(typeof t==`string`?t:t.name,e.schema);return n===`node`?jf(e,t):n===`mark`?of(e,t):{}}function Nf(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Pf(e){let t=Nf(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function Ff(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),Pf(r)}function If(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=cd(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{e&&e?.nodeSize!==void 0&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var Lf=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]},Rf=e=>{let t=e.depth-1;if(t<0)return null;let n=e.index(t);return n===0?null:e.node(t).child(n-1)};function zf(e,t){return t.nodes[e]||t.marks[e]||null}function Bf(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var Vf=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function Hf(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?ld(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!a||a.name===e.type.name).find(e=>ad(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>!a||a.name===e.mark.type.name).filter(e=>ad(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>!a||e.mark.type!==a&&e.mark.type.excludes(a)).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function Uf(e,t,n={}){if(!t)return Hd(e,null,n)||Hf(e,null,n);let r=qd(t,e.schema);return r===`node`?Hd(e,t,n):r===`mark`&&Hf(e,t,n)}var Wf=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=uf(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Gf=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function Kf(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function qf(e,t){let{nodeExtensions:n}=hf(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=I(F(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`&&i.split(` `).includes(`list`)}function Jf(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(Jf(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function Yf(e){return e instanceof A}var Xf=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function Zf(e,t){let n=t.mapping.mapResult(e.position);return{position:new Xf(n.pos),mapResult:n}}function Qf(e){return new Xf(e)}function $f(e,t,n){let r=e.state.doc.content.size,i=pd(t,0,r),a=pd(n,0,r),o=e.coordsAtPos(i),s=e.coordsAtPos(a,-1),c=Math.min(o.top,s.top),l=Math.max(o.bottom,s.bottom),u=Math.min(o.left,s.left),d=Math.max(o.right,s.right),f={top:c,bottom:l,left:u,right:d,width:d-u,height:l-c,x:u,y:c};return{...f,toJSON:()=>f}}function ep(e,t,n){let{selection:r}=t,i=null;if(fd(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var tp=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=ld(e,r.schema);if(i){if(o){let e=of(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})})}return ep(r,n,c)},np=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),rp=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=Yu(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>ha(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>ha(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},ip=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=pd(e,0,n.content.size),i=A.create(n,r);t.setSelection(i)}return!0},ap=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},op=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=k.atStart(n).from,o=k.atEnd(n).to,s=pd(r,a,o),c=pd(i,a,o),l=k.create(n,s,c);t.setSelection(l)}return!0},sp=e=>({state:t,dispatch:n})=>Da(Yu(e,t.schema))(t,n);function cp(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var lp=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=Bf(l,s.node().type.name,s.node().attrs);if(a instanceof A&&a.node.isBlock)return!s.parentOffset||!Vr(o,s.pos)?!1:(r&&(e&&cp(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:Od(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=a instanceof k&&!a.empty?Pi.create({doc:t.doc,selection:a}).tr.deleteSelection():null,h=m?m.doc:t.doc,g=m?m.mapping.map(s.pos):s.pos,_=Vr(h,g,1,p);if(!p&&!_&&Vr(h,g,1,f?[{type:f}]:void 0)&&(_=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(_){let e=t.steps.length;if(a instanceof k&&t.deleteSelection(),t.split(t.mapping.slice(e).map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f){let n=t.mapping.slice(e).map(s.before()),r=t.doc.resolve(n);s.node(-1).canReplaceWith(r.index(),r.index()+1,f)&&t.setNodeMarkup(t.mapping.slice(e).map(s.before()),f)}}e&&cp(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return _},up=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=Yu(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=T.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=T.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...Bf(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(T.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new D(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(k.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...Bf(d,u.type.name,u.attrs),...t},m={...Bf(d,s.node().type.name,s.node().attrs),...t},h=s.parentOffset===0&&s.index(-1)===0,g=s.before(-1);n.delete(s.pos,c.pos);let _=h?u.attrs:p,v=f?[{type:o,attrs:_},{type:f,attrs:m}]:[{type:o,attrs:_}];if(!Vr(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,v).scrollIntoView(),h&&n.setNodeMarkup(g,void 0,p),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0};function dp(e){return!e||e===`1`?null:e}function fp(e,t){return dp(e)===dp(t)}var pp=(e,t)=>{let n=uf(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&Ur(e.doc,n.pos))||!fp(n.node.attrs.type,i?.attrs.type)||e.join(n.pos),!0},mp=(e,t)=>{let n=uf(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&Ur(e.doc,r))||!fp(n.node.attrs.type,i?.attrs.type)||e.join(r),!0};function hp(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return k.between(r,i)}var gp=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=Yu(e,o.schema),m=Yu(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=uf(e=>qf(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,ee=o.doc.content.content,te=ee.length===1?ee[0]:null,ne=S&&te&&qf(te.type.name,d)?{node:te,pos:0,depth:0}:null,re=x??ne,ie=!!x&&y.depth>=1&&y.depth-x.depth<=1,ae=!!ne;if((ie||ae)&&re){if(re.node.type===p)return S&&ae?c().command(({tr:e,dispatch:t})=>{let n=hp(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(qf(re.node.type.name,d)&&p.validContent(re.node.content))return c().command(()=>(a.setNodeMarkup(re.pos,p),!0)).command(()=>pp(a,p)).command(()=>mp(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>pp(a,p)).command(()=>mp(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>pp(a,p)).command(()=>mp(a,p)).run()},_p=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=ld(e,r.schema);return Hf(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},vp=(e,t,n={})=>({state:r,commands:i})=>{let a=Yu(e,r.schema),o=Yu(t,r.schema),s=Hd(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},yp=(e,t={})=>({state:n,commands:r})=>{let i=Yu(e,n.schema);return Hd(n,i,t)?r.lift(i):r.wrapIn(i,t)},bp=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},xp=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:i=!1}=e,{selection:a}=t,{empty:o,ranges:s}=a;if(o)return!0;let{nonClearableMarks:c}=r.extensionManager;if(n){let e=Object.values(r.schema.marks).filter(e=>i||!c.includes(e.name));s.forEach(n=>{for(let r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},Sp=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=ld(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=cd(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},Cp=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},wp=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=qd(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=Yu(e,r.schema)),s===`mark`&&(o=ld(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},Tp=new M(`__tiptap_decorations__`),Ep=e=>({tr:t,dispatch:n})=>(n&&t.setMeta(Tp,{type:`force`,name:e}),!0),Dp=(e,t={})=>({state:n,dispatch:r})=>ma(Yu(e,n.schema),t)(n,r),Op=(e,t={})=>({state:n,dispatch:r})=>xa(Yu(e,n.schema),t)(n,r),kp=jt({blur:()=>Hu,clearContent:()=>Uu,clearNodes:()=>Wu,command:()=>Gu,createParagraphNear:()=>Ku,cut:()=>qu,deleteCurrentNode:()=>Ju,deleteNode:()=>Xu,deleteRange:()=>Zu,deleteSelection:()=>td,enter:()=>nd,exitCode:()=>rd,extendMarkRange:()=>ud,first:()=>dd,focus:()=>vd,forEach:()=>yd,insertContent:()=>bd,insertContentAt:()=>Dd,insertDefaultBlock:()=>kd,joinBackward:()=>Md,joinDown:()=>jd,joinForward:()=>Nd,joinItemBackward:()=>Fd,joinItemForward:()=>Id,joinTextblockBackward:()=>Ld,joinTextblockForward:()=>Rd,joinUp:()=>Ad,keyboardShortcut:()=>Vd,lift:()=>Ud,liftEmptyBlock:()=>Wd,liftListItem:()=>Gd,newlineInCode:()=>Kd,resetAttributes:()=>Yd,scrollIntoView:()=>Xd,selectAll:()=>Zd,selectNodeBackward:()=>Qd,selectNodeForward:()=>$d,selectParentNode:()=>ef,selectTextblockEnd:()=>tf,selectTextblockStart:()=>nf,setContent:()=>af,setMark:()=>tp,setMeta:()=>np,setNode:()=>rp,setNodeSelection:()=>ip,setTextDirection:()=>ap,setTextSelection:()=>op,sinkListItem:()=>sp,splitBlock:()=>lp,splitListItem:()=>up,toggleList:()=>gp,toggleMark:()=>_p,toggleNode:()=>vp,toggleWrap:()=>yp,undoInputRule:()=>bp,unsetAllMarks:()=>xp,unsetMark:()=>Sp,unsetTextDirection:()=>Cp,updateAttributes:()=>wp,updateDecorations:()=>Ep,wrapIn:()=>Dp,wrapInList:()=>Op}),Ap=new WeakMap;function jp(e,t){Ap.set(e,(Ap.get(e)??0)+1);try{return t()}finally{let t=(Ap.get(e)??1)-1;t>0?Ap.set(e,t):Ap.delete(e)}}function Mp(e){return Ap.has(e)}var Np=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},Pp=typeof process<`u`&&!1;function Fp(e){return e.kind===`widget`}function Ip(e,t){let n=[],r=new Set;for(let i of e)i.kind===`widget`&&Fp(i)&&r.add(i.key),n.push(i.toPMDecoration(t));return{decorations:n,widgetKeys:r}}function Lp(e,t,n){let{decorations:r,widgetKeys:i}=Ip(t,n);return{set:P.create(e,r),widgetKeys:i}}function Rp({position:e,from:t,to:n,docSize:r}){return e<t?!1:e<n||e===n&&n===r}function zp({decorations:e,from:t,to:n,docSize:r,extensionName:i,warnedExtensions:a}){return e.filter(e=>Rp({position:e.anchor,from:t,to:n,docSize:r})?!0:(e.anchor===n||a.has(i)||(a.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)),!1))}function Bp(e){let t=e.spec?.key;return typeof t==`string`?t:void 0}function Vp(e){let t=new Map,n=new Map;for(let r of e.find()){let e=Bp(r);if(!e)continue;let i=r.spec.extensionName??`unknown`,a=t.get(e)??new Set;a.add(i),t.set(e,a),n.set(e,(n.get(e)??0)+1)}return Array.from(t,([e,t])=>({key:e,extensions:t})).filter(({key:e})=>(n.get(e)??0)>1)}function Hp(e){return e.jsonID===`attr`}function Up(e){let t=!1;if(e.getMap().forEach(()=>{t=!0}),t||Hp(e))return!0;let n=e;return typeof n.from==`number`&&typeof n.to==`number`}function Wp(e,t){let n=null,r=0,i=0;for(let a=0;a<e.childCount&&!(i>t.to);a+=1){let o=i+e.child(a).nodeSize;o>=t.from&&(n===null&&(n=i),r=o),i=o}return n===null?null:{from:n,to:r}}function Gp(e,t){if(e.steps.some(e=>!Up(e)))return{type:`full`};let n=Ff(e).map(({newRange:e})=>e);e.steps.forEach((t,r)=>{if(!Hp(t))return;let i=e.mapping.slice(r);n.push({from:i.map(t.pos,-1),to:i.map(t.pos+1)})});let r=[];for(let e of n){let n=Wp(t,e);n&&r.push(n)}r.sort((e,t)=>e.from-t.from);let i=[];for(let e of r){let t=i[i.length-1];t&&e.from<=t.to?t.to=Math.max(t.to,e.to):i.push({...e})}return{type:`ranges`,ranges:i}}function Kp(e,t,n,r){return e.map(t,n,{onRemove:e=>{let t=e?.key;typeof t==`string`&&r.delete(t)}})}function qp(e,t,n){let r=t.decorationSetsByExtension[e]??P.empty,i=new Set(t.widgetKeysByExtension[e]??[]);return{set:Kp(r,n.mapping,n.doc,i),widgetKeys:i}}function Jp(e,t){let n=Object.values(t).flatMap(e=>e.find());return P.create(e,n)}function Yp(e){let t=new Set;for(let n of Object.values(e))for(let e of n)t.add(e);return t}function Xp(e,t){switch(t.update??`document`){case`document`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case`changedRanges`:if(!t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case`manual`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(t.shouldUpdate)throw Error(`[tiptap error]: Extension "${e}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function Zp(e,t,n){return n?!0:e.update===`manual`?!1:e.shouldUpdate?e.shouldUpdate(t):t.tr.docChanged}var Qp=new Set,$p=class{constructor(e){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{let t=Tp.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach(({name:e,spec:t})=>Xp(e,t)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on(`beforeTransaction`,this.handleBeforeTransaction)}destroy(){this.editor.off(`beforeTransaction`,this.handleBeforeTransaction)}liveWidgetKeys(){return Tp.getState(this.editor.state)?.widgetKeys??Qp}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(e){let t=[];for(let{name:n,addDecorations:r}of e){let e=r();e&&t.push({name:n,spec:e})}return t}createPlugin(){let{editor:e,entries:t}=this;return new j({key:Tp,state:{init:(e,n)=>{let r={},i={};for(let{name:e,spec:a}of t){let{set:t,widgetKeys:o}=this.buildFullSet(e,a,n);r[e]=t,i[e]=o}let a={decorationSetsByExtension:r,widgetKeysByExtension:i,mergedDecorationSet:this.buildMergedSet(n.doc,r),widgetKeys:Yp(i)};return this.warnDuplicateWidgetKeys(a),a},apply:(n,r,i,a)=>{let o=n.getMeta(Tp),s=o?.type===`force`&&!o.name,c=o?.type===`force`?o.name:void 0,l={},u={},d=new Set;return jp(e,()=>{for(let{name:o,spec:f}of t){let t=s||c===o;if(!Zp(f,{editor:e,tr:n,oldState:i,newState:a},t)){let e=qp(o,r,n);l[o]=e.set,u[o]=e.widgetKeys}else if(f.update===`changedRanges`&&n.docChanged&&!t){let e=this.applyChangedRangesRecompute(o,f,r,n,a);l[o]=e.set,u[o]=e.widgetKeys,d.add(o)}else{let{set:e,widgetKeys:t}=this.buildFullSet(o,f,a);l[o]=e,u[o]=t,d.add(o)}}}),d.size===0&&!n.docChanged?r:{decorationSetsByExtension:l,widgetKeysByExtension:u,mergedDecorationSet:this.mergeAfterApply({entries:t,previous:r,tr:n,decorationSetsByExtension:l,recomputedNames:d}),widgetKeys:Yp(u)}}},props:{decorations(e){return Tp.getState(e)?.mergedDecorationSet??P.empty}}})}applyChangedRangesRecompute(e,t,n,r,i){let a=Gp(r,i.doc);return a.type===`full`?this.buildFullSet(e,t,i):this.rebuildRanges(e,t,n,r,i,a.ranges)}rebuildRanges(e,t,n,r,i,a){let o=n.decorationSetsByExtension[e]??P.empty,s=new Set(n.widgetKeysByExtension[e]??[]),c=Kp(o,r.mapping,r.doc,s),l=i.doc.content.size;for(let{from:n,to:r}of a){let a=c.find(n,r).filter(e=>Rp({position:e.from,from:n,to:r,docSize:l}));for(let e of a){let t=Bp(e);t&&s.delete(t)}c=c.remove(a);let{decorations:o,widgetKeys:u}=Ip(zp({decorations:this.runCreate(e,`createInRange`,()=>t.createInRange({editor:this.editor,state:i,view:this.mountedView,from:n,to:r})),from:n,to:r,docSize:l,extensionName:e,warnedExtensions:this.warnedOutOfRangeExtensions}),e);c=c.add(i.doc,o);for(let e of u)s.add(e)}return{set:c,widgetKeys:s}}buildFullSet(e,t,n){let r=this.runCreate(e,`create`,()=>t.create({editor:this.editor,state:n,view:this.mountedView}));return Lp(n.doc,r,e)}runCreate(e,t,n){try{return n()}catch(n){return console.error(`[tiptap error]: Extension "${e}" threw in \`addDecorations().${t}()\`. Its decorations were dropped for this update.`,n),[]}}warnDuplicateWidgetKeys(e){if(!Pp)return;if(e.widgetKeys.size===0){this.warnedWidgetKeys.clear();return}let t=Vp(e.mergedDecorationSet),n=new Set(t.map(({key:e})=>e));for(let{key:e,extensions:n}of t){if(this.warnedWidgetKeys.has(e))continue;let t=Array.from(n).map(e=>`"${e}"`).join(`, `);console.warn(`[tiptap warn]: Duplicate widget decoration key "${e}" in extension${n.size===1?``:`s`} ${t}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \`comment-\${id}\`).`)}this.warnedWidgetKeys=n}buildMergedSet(e,t){let n=Object.keys(t);return n.length===1?t[n[0]]:Jp(e,t)}mergeAfterApply({entries:e,previous:t,tr:n,decorationSetsByExtension:r,recomputedNames:i}){return e.length===1?r[e[0].name]:i.size===0?t.mergedDecorationSet.map(n.mapping,n.doc):Jp(n.doc,r)}};function em(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof A){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}function tm(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}function nm(e){return typeof e==`number`}function rm(e){return Object.prototype.toString.call(e).slice(8,-1)}function im(e){return rm(e)===`Object`&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function am(e){return typeof e==`string`&&e.trim().length>0&&!/[;{}]/.test(e)}function om(e,t,n){let r=e.split(`
|
|
12
|
+
`,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;if(e.isText){var d;s+=e==null||(d=e.text)==null?void 0:d.slice(Math.max(r,n)-n,i-n)}}),s}function Of(e,t){return Df(e,{from:0,to:e.content.size},t)}function kf(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Af(e,t){let n=Ju(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function jf(e,t){let n=Kd(typeof t==`string`?t:t.name,e.schema);return n===`node`?Af(e,t):n===`mark`?af(e,t):{}}function Mf(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Nf(e){let t=Mf(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function Pf(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),Nf(r)}function Ff(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=sd(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{e&&e?.nodeSize!==void 0&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var If=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]},Lf=e=>{let t=e.depth-1;if(t<0)return null;let n=e.index(t);return n===0?null:e.node(t).child(n-1)};function Rf(e,t){return t.nodes[e]||t.marks[e]||null}function zf(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var Bf=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function Vf(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?cd(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!a||a.name===e.type.name).find(e=>id(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>!a||a.name===e.mark.type.name).filter(e=>id(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>!a||e.mark.type!==a&&e.mark.type.excludes(a)).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function Hf(e,t,n={}){if(!t)return Vd(e,null,n)||Vf(e,null,n);let r=Kd(t,e.schema);return r===`node`?Vd(e,t,n):r===`mark`&&Vf(e,t,n)}var Uf=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=lf(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Wf=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function Gf(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function Kf(e,t){let{nodeExtensions:n}=mf(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=L(I(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`&&i.split(` `).includes(`list`)}function qf(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(qf(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function Jf(e){return e instanceof j}var Yf=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function Xf(e,t){let n=t.mapping.mapResult(e.position);return{position:new Yf(n.pos),mapResult:n}}function Zf(e){return new Yf(e)}function Qf(e,t,n){let r=e.state.doc.content.size,i=fd(t,0,r),a=fd(n,0,r),o=e.coordsAtPos(i),s=e.coordsAtPos(a,-1),c=Math.min(o.top,s.top),l=Math.max(o.bottom,s.bottom),u=Math.min(o.left,s.left),d=Math.max(o.right,s.right),f={top:c,bottom:l,left:u,right:d,width:d-u,height:l-c,x:u,y:c};return{...f,toJSON:()=>f}}function $f(e,t,n){let{selection:r}=t,i=null;if(dd(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var ep=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=cd(e,r.schema);if(i){if(o){let e=af(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})})}return $f(r,n,c)},tp=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),np=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=Ju(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>ma(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>ma(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},rp=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=fd(e,0,n.content.size),i=j.create(n,r);t.setSelection(i)}return!0},ip=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},ap=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=A.atStart(n).from,o=A.atEnd(n).to,s=fd(r,a,o),c=fd(i,a,o),l=A.create(n,s,c);t.setSelection(l)}return!0},op=e=>({state:t,dispatch:n})=>Ea(Ju(e,t.schema))(t,n);function sp(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var cp=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=zf(l,s.node().type.name,s.node().attrs);if(a instanceof j&&a.node.isBlock)return!s.parentOffset||!Br(o,s.pos)?!1:(r&&(e&&sp(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:Dd(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=a instanceof A&&!a.empty?Ni.create({doc:t.doc,selection:a}).tr.deleteSelection():null,h=m?m.doc:t.doc,g=m?m.mapping.map(s.pos):s.pos,_=Br(h,g,1,p);if(!p&&!_&&Br(h,g,1,f?[{type:f}]:void 0)&&(_=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(_){let e=t.steps.length;if(a instanceof A&&t.deleteSelection(),t.split(t.mapping.slice(e).map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f){let n=t.mapping.slice(e).map(s.before()),r=t.doc.resolve(n);s.node(-1).canReplaceWith(r.index(),r.index()+1,f)&&t.setNodeMarkup(t.mapping.slice(e).map(s.before()),f)}}e&&sp(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return _},lp=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=Ju(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=E.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=E.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...zf(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(E.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new O(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(A.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...zf(d,u.type.name,u.attrs),...t},m={...zf(d,s.node().type.name,s.node().attrs),...t},h=s.parentOffset===0&&s.index(-1)===0,g=s.before(-1);n.delete(s.pos,c.pos);let _=h?u.attrs:p,v=f?[{type:o,attrs:_},{type:f,attrs:m}]:[{type:o,attrs:_}];if(!Br(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,v).scrollIntoView(),h&&n.setNodeMarkup(g,void 0,p),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0};function up(e){return!e||e===`1`?null:e}function dp(e,t){return up(e)===up(t)}var fp=(e,t)=>{let n=lf(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&Hr(e.doc,n.pos))||!dp(n.node.attrs.type,i?.attrs.type)||e.join(n.pos),!0},pp=(e,t)=>{let n=lf(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===i?.type&&Hr(e.doc,r))||!dp(n.node.attrs.type,i?.attrs.type)||e.join(r),!0};function mp(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return A.between(r,i)}var hp=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=Ju(e,o.schema),m=Ju(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=lf(e=>Kf(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,ee=C.length===1?C[0]:null,w=S&&ee&&Kf(ee.type.name,d)?{node:ee,pos:0,depth:0}:null,te=x??w,ne=!!x&&y.depth>=1&&y.depth-x.depth<=1,re=!!w;if((ne||re)&&te){if(te.node.type===p)return S&&re?c().command(({tr:e,dispatch:t})=>{let n=mp(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(Kf(te.node.type.name,d)&&p.validContent(te.node.content))return c().command(()=>(a.setNodeMarkup(te.pos,p),!0)).command(()=>fp(a,p)).command(()=>pp(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>fp(a,p)).command(()=>pp(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>fp(a,p)).command(()=>pp(a,p)).run()},gp=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=cd(e,r.schema);return Vf(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},_p=(e,t,n={})=>({state:r,commands:i})=>{let a=Ju(e,r.schema),o=Ju(t,r.schema),s=Vd(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},vp=(e,t={})=>({state:n,commands:r})=>{let i=Ju(e,n.schema);return Vd(n,i,t)?r.lift(i):r.wrapIn(i,t)},yp=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},bp=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:i=!1}=e,{selection:a}=t,{empty:o,ranges:s}=a;if(o)return!0;let{nonClearableMarks:c}=r.extensionManager;if(n){let e=Object.values(r.schema.marks).filter(e=>i||!c.includes(e.name));s.forEach(n=>{for(let r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},xp=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=cd(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=sd(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},Sp=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},Cp=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Kd(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=Ju(e,r.schema)),s===`mark`&&(o=cd(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},wp=new N(`__tiptap_decorations__`),Tp=e=>({tr:t,dispatch:n})=>(n&&t.setMeta(wp,{type:`force`,name:e}),!0),Ep=(e,t={})=>({state:n,dispatch:r})=>pa(Ju(e,n.schema),t)(n,r),Dp=(e,t={})=>({state:n,dispatch:r})=>ba(Ju(e,n.schema),t)(n,r),Op=At({blur:()=>Vu,clearContent:()=>Hu,clearNodes:()=>Uu,command:()=>Wu,createParagraphNear:()=>Gu,cut:()=>Ku,deleteCurrentNode:()=>qu,deleteNode:()=>Yu,deleteRange:()=>Xu,deleteSelection:()=>ed,enter:()=>td,exitCode:()=>nd,extendMarkRange:()=>ld,first:()=>ud,focus:()=>_d,forEach:()=>vd,insertContent:()=>yd,insertContentAt:()=>Ed,insertDefaultBlock:()=>Od,joinBackward:()=>jd,joinDown:()=>Ad,joinForward:()=>Md,joinItemBackward:()=>Pd,joinItemForward:()=>Fd,joinTextblockBackward:()=>Id,joinTextblockForward:()=>Ld,joinUp:()=>kd,keyboardShortcut:()=>Bd,lift:()=>Hd,liftEmptyBlock:()=>Ud,liftListItem:()=>Wd,newlineInCode:()=>Gd,resetAttributes:()=>Jd,scrollIntoView:()=>Yd,selectAll:()=>Xd,selectNodeBackward:()=>Zd,selectNodeForward:()=>Qd,selectParentNode:()=>$d,selectTextblockEnd:()=>ef,selectTextblockStart:()=>tf,setContent:()=>rf,setMark:()=>ep,setMeta:()=>tp,setNode:()=>np,setNodeSelection:()=>rp,setTextDirection:()=>ip,setTextSelection:()=>ap,sinkListItem:()=>op,splitBlock:()=>cp,splitListItem:()=>lp,toggleList:()=>hp,toggleMark:()=>gp,toggleNode:()=>_p,toggleWrap:()=>vp,undoInputRule:()=>yp,unsetAllMarks:()=>bp,unsetMark:()=>xp,unsetTextDirection:()=>Sp,updateAttributes:()=>Cp,updateDecorations:()=>Tp,wrapIn:()=>Ep,wrapInList:()=>Dp}),kp=new WeakMap;function Ap(e,t){kp.set(e,(kp.get(e)??0)+1);try{return t()}finally{let t=(kp.get(e)??1)-1;t>0?kp.set(e,t):kp.delete(e)}}function jp(e){return kp.has(e)}var Mp=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},Np=typeof process<`u`&&!1;function Pp(e){return e.kind===`widget`}function Fp(e,t){let n=[],r=new Set;for(let i of e)i.kind===`widget`&&Pp(i)&&r.add(i.key),n.push(i.toPMDecoration(t));return{decorations:n,widgetKeys:r}}function Ip(e,t,n){let{decorations:r,widgetKeys:i}=Fp(t,n);return{set:F.create(e,r),widgetKeys:i}}function Lp({position:e,from:t,to:n,docSize:r}){return e<t?!1:e<n||e===n&&n===r}function Rp({decorations:e,from:t,to:n,docSize:r,extensionName:i,warnedExtensions:a}){return e.filter(e=>Lp({position:e.anchor,from:t,to:n,docSize:r})?!0:(e.anchor===n||a.has(i)||(a.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)),!1))}function zp(e){let t=e.spec?.key;return typeof t==`string`?t:void 0}function Bp(e){let t=new Map,n=new Map;for(let r of e.find()){let e=zp(r);if(!e)continue;let i=r.spec.extensionName??`unknown`,a=t.get(e)??new Set;a.add(i),t.set(e,a),n.set(e,(n.get(e)??0)+1)}return Array.from(t,([e,t])=>({key:e,extensions:t})).filter(({key:e})=>(n.get(e)??0)>1)}function Vp(e){return e.jsonID===`attr`}function Hp(e){let t=!1;if(e.getMap().forEach(()=>{t=!0}),t||Vp(e))return!0;let n=e;return typeof n.from==`number`&&typeof n.to==`number`}function Up(e,t){let n=null,r=0,i=0;for(let a=0;a<e.childCount&&!(i>t.to);a+=1){let o=i+e.child(a).nodeSize;o>=t.from&&(n===null&&(n=i),r=o),i=o}return n===null?null:{from:n,to:r}}function Wp(e,t){if(e.steps.some(e=>!Hp(e)))return{type:`full`};let n=Pf(e).map(({newRange:e})=>e);e.steps.forEach((t,r)=>{if(!Vp(t))return;let i=e.mapping.slice(r);n.push({from:i.map(t.pos,-1),to:i.map(t.pos+1)})});let r=[];for(let e of n){let n=Up(t,e);n&&r.push(n)}r.sort((e,t)=>e.from-t.from);let i=[];for(let e of r){let t=i[i.length-1];t&&e.from<=t.to?t.to=Math.max(t.to,e.to):i.push({...e})}return{type:`ranges`,ranges:i}}function Gp(e,t,n,r){return e.map(t,n,{onRemove:e=>{let t=e?.key;typeof t==`string`&&r.delete(t)}})}function Kp(e,t,n){let r=t.decorationSetsByExtension[e]??F.empty,i=new Set(t.widgetKeysByExtension[e]??[]);return{set:Gp(r,n.mapping,n.doc,i),widgetKeys:i}}function qp(e,t){let n=Object.values(t).flatMap(e=>e.find());return F.create(e,n)}function Jp(e){let t=new Set;for(let n of Object.values(e))for(let e of n)t.add(e);return t}function Yp(e,t){switch(t.update??`document`){case`document`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case`changedRanges`:if(!t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case`manual`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(t.shouldUpdate)throw Error(`[tiptap error]: Extension "${e}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function Xp(e,t,n){return n?!0:e.update===`manual`?!1:e.shouldUpdate?e.shouldUpdate(t):t.tr.docChanged}var Zp=new Set,Qp=class{constructor(e){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{let t=wp.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach(({name:e,spec:t})=>Yp(e,t)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on(`beforeTransaction`,this.handleBeforeTransaction)}destroy(){this.editor.off(`beforeTransaction`,this.handleBeforeTransaction)}liveWidgetKeys(){return wp.getState(this.editor.state)?.widgetKeys??Zp}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(e){let t=[];for(let{name:n,addDecorations:r}of e){let e=r();e&&t.push({name:n,spec:e})}return t}createPlugin(){let{editor:e,entries:t}=this;return new M({key:wp,state:{init:(e,n)=>{let r={},i={};for(let{name:e,spec:a}of t){let{set:t,widgetKeys:o}=this.buildFullSet(e,a,n);r[e]=t,i[e]=o}let a={decorationSetsByExtension:r,widgetKeysByExtension:i,mergedDecorationSet:this.buildMergedSet(n.doc,r),widgetKeys:Jp(i)};return this.warnDuplicateWidgetKeys(a),a},apply:(n,r,i,a)=>{let o=n.getMeta(wp),s=o?.type===`force`&&!o.name,c=o?.type===`force`?o.name:void 0,l={},u={},d=new Set;return Ap(e,()=>{for(let{name:o,spec:f}of t){let t=s||c===o;if(!Xp(f,{editor:e,tr:n,oldState:i,newState:a},t)){let e=Kp(o,r,n);l[o]=e.set,u[o]=e.widgetKeys}else if(f.update===`changedRanges`&&n.docChanged&&!t){let e=this.applyChangedRangesRecompute(o,f,r,n,a);l[o]=e.set,u[o]=e.widgetKeys,d.add(o)}else{let{set:e,widgetKeys:t}=this.buildFullSet(o,f,a);l[o]=e,u[o]=t,d.add(o)}}}),d.size===0&&!n.docChanged?r:{decorationSetsByExtension:l,widgetKeysByExtension:u,mergedDecorationSet:this.mergeAfterApply({entries:t,previous:r,tr:n,decorationSetsByExtension:l,recomputedNames:d}),widgetKeys:Jp(u)}}},props:{decorations(e){return wp.getState(e)?.mergedDecorationSet??F.empty}}})}applyChangedRangesRecompute(e,t,n,r,i){let a=Wp(r,i.doc);return a.type===`full`?this.buildFullSet(e,t,i):this.rebuildRanges(e,t,n,r,i,a.ranges)}rebuildRanges(e,t,n,r,i,a){let o=n.decorationSetsByExtension[e]??F.empty,s=new Set(n.widgetKeysByExtension[e]??[]),c=Gp(o,r.mapping,r.doc,s),l=i.doc.content.size;for(let{from:n,to:r}of a){let a=c.find(n,r).filter(e=>Lp({position:e.from,from:n,to:r,docSize:l}));for(let e of a){let t=zp(e);t&&s.delete(t)}c=c.remove(a);let{decorations:o,widgetKeys:u}=Fp(Rp({decorations:this.runCreate(e,`createInRange`,()=>t.createInRange({editor:this.editor,state:i,view:this.mountedView,from:n,to:r})),from:n,to:r,docSize:l,extensionName:e,warnedExtensions:this.warnedOutOfRangeExtensions}),e);c=c.add(i.doc,o);for(let e of u)s.add(e)}return{set:c,widgetKeys:s}}buildFullSet(e,t,n){let r=this.runCreate(e,`create`,()=>t.create({editor:this.editor,state:n,view:this.mountedView}));return Ip(n.doc,r,e)}runCreate(e,t,n){try{return n()}catch(n){return console.error(`[tiptap error]: Extension "${e}" threw in \`addDecorations().${t}()\`. Its decorations were dropped for this update.`,n),[]}}warnDuplicateWidgetKeys(e){if(!Np)return;if(e.widgetKeys.size===0){this.warnedWidgetKeys.clear();return}let t=Bp(e.mergedDecorationSet),n=new Set(t.map(({key:e})=>e));for(let{key:e,extensions:n}of t){if(this.warnedWidgetKeys.has(e))continue;let t=Array.from(n).map(e=>`"${e}"`).join(`, `);console.warn(`[tiptap warn]: Duplicate widget decoration key "${e}" in extension${n.size===1?``:`s`} ${t}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \`comment-\${id}\`).`)}this.warnedWidgetKeys=n}buildMergedSet(e,t){let n=Object.keys(t);return n.length===1?t[n[0]]:qp(e,t)}mergeAfterApply({entries:e,previous:t,tr:n,decorationSetsByExtension:r,recomputedNames:i}){return e.length===1?r[e[0].name]:i.size===0?t.mergedDecorationSet.map(n.mapping,n.doc):qp(n.doc,r)}};function $p(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof j){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}function em(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}function tm(e){return typeof e==`number`}function nm(e){return Object.prototype.toString.call(e).slice(8,-1)}function rm(e){return nm(e)===`Object`&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function im(e){return typeof e==`string`&&e.trim().length>0&&!/[;{}]/.test(e)}function am(e,t,n){let r=e.split(`
|
|
13
13
|
`),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],u=e.match(t.itemPattern);if(!u){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}\n`;continue}return}let d=t.extractItemData(u),{indentLevel:f,mainContent:p}=d;a=`${a}${e}\n`;let m=[p];for(o+=1;o<r.length;){var c;let e=r[o];if(e.trim()===``){var l;let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((((l=r[o+1+t].match(/^(\s*)/))==null||(l=l[1])==null?void 0:l.length)||0)>f){m.push(e),a=`${a}${e}\n`,o+=1;continue}break}if((((c=e.match(/^(\s*)/))==null||(c=c[1])==null?void 0:c.length)||0)>f)m.push(e),a=`${a}${e}\n`,o+=1;else break}let h,g=m.slice(1);if(g.length>0){let e=g.map(e=>e.slice(f+s)).join(`
|
|
14
|
-
`);e.trim()&&(h=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let _=t.createToken(d,h);i.push(_)}if(i.length!==0)return{items:i,raw:a}}var
|
|
14
|
+
`);e.trim()&&(h=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let _=t.createToken(d,h);i.push(_)}if(i.length!==0)return{items:i,raw:a}}var om=4;function sm(e){let t=0;for(let n of e)t=n===` `?t+om-t%om:t+1;return t}function cm(e,t,n,r,i){if(!e||!Array.isArray(e.content))return``;let a=typeof n==`function`?n(r):n,[o,...s]=e.content,c=`${a}${t.renderChildren([o])}`;return s&&s.length>0&&s.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=e=>{if(!i?.alignNestedToPrefix)return t.indent(e);let n=t.indent(``),r=sm(a);return(sm(n)>=r?n:` `.repeat(r))+e},o=r.split(`
|
|
15
15
|
`).map(e=>n(e||``)).join(`
|
|
16
|
-
`);c+=e.type===`paragraph`?`\n\n${o}`:`\n${o}`}}),c}function
|
|
17
|
-
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var
|
|
16
|
+
`);c+=e.type===`paragraph`?`\n\n${o}`:`\n${o}`}}),c}function lm(e,t){let n={...e};return rm(e)&&rm(t)&&Object.keys(t).forEach(r=>{rm(t[r])&&rm(e[r])?n[r]=lm(e[r],t[r]):n[r]=t[r]}),n}function um(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var dm=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},fm=(e,t)=>{if(rd(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn(`[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".`),r.push(n.replaceWith)),r};function pm(e){let{editor:t,from:n,to:r,text:i,insertText:a}=e;if(!a)return{inputTransaction:null,tr:t.view.state.tr};let o=t.view.state.tr.insertText(i,n,r);return{inputTransaction:o,tr:Ni.create({doc:o.doc,selection:o.selection,storedMarks:o.storedMarks}).tr}}function mm(e){let{editor:t,from:n,to:r,text:i,rule:a,match:o,plugin:s,insertText:c}=e,{view:l}=t,{inputTransaction:u,tr:d}=pm({editor:t,from:n,to:r,text:i,insertText:c}),f=u?n+i.length:r,p=zu({state:l.state,transaction:d}),m={from:n-(o[0].length-i.length),to:f},{commands:h,chain:g,can:_}=new Bu({editor:t,state:p});return a.handler({state:p,range:m,match:o,commands:h,chain:g,can:_})===null||!d.steps.length?!1:(u&&(l.dispatch(u),!l.state.doc.eq(u.doc))||(ju(d),d.setMeta(`inputRule`,!0),a.undoable&&d.setMeta(s,{transform:d,from:n,to:f,text:i}),l.dispatch(d)),!0)}function hm(e,t,n){let r=t[0].length-n.length;if(r<=0)return!0;let i=e.parentOffset-r;return i>=0&&e.parent.textBetween(i,e.parentOffset)===t[0].slice(0,r)}function gm(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o,insertText:s}=e,{view:c}=t;if(c.composing)return!1;let l=c.state.doc.resolve(n);if(l.parent.type.spec.code||(l.nodeBefore||l.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let u=Bf(l)+i;for(let e of a){let a=fm(u,e.find);if(a&&hm(l,a,i)&&mm({editor:t,from:n,to:r,text:i,rule:e,match:a,plugin:o,insertText:s}))return!0}return!1}function _m(e){let{editor:t,rules:n}=e,r=new M({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:df(E.from(e),a.schema);let{from:i}=s,o=i+e.length;gm({editor:t,from:i,to:o,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return gm({editor:t,from:i,to:a,text:o,rules:n,plugin:r,insertText:!0})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&gm({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?gm({editor:t,from:a.pos,to:a.pos,text:`
|
|
17
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var vm=class{constructor(e={}){this.type=`extendable`,this.parent=null,this.child=null,this.name=``,this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...L(I(this,`addOptions`,{name:this.name}))}}get storage(){return{...L(I(this,`addStorage`,{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>lm(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name=`name`in e?e.name:t.parent.name,t}},ym=class e extends vm{constructor(...e){super(...e),this.type=`mark`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},bm=class{constructor(e){this.find=e.find,this.handler=e.handler}},xm=(e,t,n)=>{if(rd(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function Sm(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new Bu({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{var f;if((f=e.type)!=null&&(f=f.spec)!=null&&f.code||!(e.isText||e.isTextblock||e.isInline))return;let p=e.content?.size??e.nodeSize??0,m=Math.max(r,t),h=Math.min(i,t+p);m>=h||xm(e.isText?e.text||``:e.textBetween(m-t,h-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=m+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var Cm=null,wm=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function Tm(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr,l=zu({state:e,transaction:c});if(Sm({editor:t,state:l,from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})&&c.steps.length){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return t.on(`destroy`,()=>{Cm===t&&(Cm=null)}),n.map(e=>new M({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(Cm=t)},i=()=>{Cm&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=Cm;e?.isEditable&&setTimeout(()=>{if(e.isDestroyed)return;let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:df(E.from(t),r.schema);let{from:n}=d,i=n+t.length,a=wm(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(tm(p)&&m&&p!==m.b)return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var Em=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=Ef(e),this.schema=Cf(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=I(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Rf(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this,t=Tf([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Rf(t.name,this.schema)},r=[],i=I(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&I(t,`exitable`,n)&&(a.ArrowRight=()=>ym.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=du(a);r.push(o);let s=I(t,`addInputRules`,n);if(Gf(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=_m({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=I(t,`addPasteRules`,n);if(Gf(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=Tm({editor:e,rules:t});r.push(...n)}}let l=I(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r}),n=this.createDecorationPlugin();return n&&t.push(n),t}createDecorationPlugin(){var e;let{editor:t}=this;(e=this.decorationManager)==null||e.destroy();let n=[];return this.extensions.forEach(e=>{let r=I(e,`addDecorations`,{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:Rf(e.name,this.schema)});r&&n.push({name:e.name,addDecorations:r})}),this.decorationManager=new Qp({editor:t,entries:n}),this.decorationManager.plugin}get attributes(){return hf(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=mf(this.extensions);return Object.fromEntries(t.filter(e=>!!I(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=I(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Ju(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>{let l=vf(r,n);return i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:l})}]:[]}))}dispatchTransaction(e){let{editor:t}=this;return Tf([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Rf(n.name,this.schema)},i=I(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return Tf([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Rf(n.name,this.schema)},i=I(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=mf(this.extensions);return Object.fromEntries(t.filter(e=>!!I(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=I(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:cd(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=vf(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{um(i,e,t)}})}]:[]}))}destroy(){var e;(e=this.decorationManager)==null||e.destroy(),this.extensions.forEach(e=>{let t=e;for(;t.parent;){let e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Rf(e.name,this.schema)};e.type===`mark`&&((L(I(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name),(L(I(e,`clearable`,t))??!0)||this.nonClearableMarks.push(e.name));let n=I(e,`onBeforeCreate`,t),r=I(e,`onCreate`,t),i=I(e,`onUpdate`,t),a=I(e,`onSelectionUpdate`,t),o=I(e,`onTransaction`,t),s=I(e,`onFocus`,t),c=I(e,`onBlur`,t),l=I(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};Em.resolve=Ef,Em.sort=Tf,Em.flatten=uf;var z=class e extends vm{constructor(...e){super(...e),this.type=`extension`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Dm=z.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new M({key:new N(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,a=kf(n),{blockSeparator:o}=this.options,s={...o===void 0?{}:{blockSeparator:o},textSerializers:a};return[...i.ranges].sort((e,t)=>e.$from.pos-t.$from.pos).map(({$from:e,$to:t})=>Df(r,{from:e.pos,to:t.pos},s)).join(o??`
|
|
18
18
|
|
|
19
|
-
`)}}})]}}),
|
|
19
|
+
`)}}})]}}),Om=z.create({name:`commands`,addCommands(){return{...Op}}}),km=z.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){var n;let r=()=>{var n,r;if(((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null||(r=n.filterTransaction)==null?void 0:r.call(n,e))??e.getMeta(`y-sync$`))return;let i=of(e.before,[e,...t]);Pf(i).forEach(t=>{i.mapping.mapResult(t.oldRange.from).deletedAfter&&i.mapping.mapResult(t.oldRange.to).deletedBefore&&i.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let a=r+n.nodeSize-2,o=t.oldRange.from<=r&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:r,to:a,newFrom:i.mapping.map(r),newTo:i.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:i})})});let a=i.mapping;i.steps.forEach((t,n)=>{if(t instanceof vr){let r=a.slice(n).map(t.from,-1),o=a.slice(n).map(t.to),s=a.invert().map(r,-1),c=a.invert().map(o),l=r>0&&i.doc.nodeAt(r-1)?.marks.some(e=>e.eq(t.mark)),u=i.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:r,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:i})}})};((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null?void 0:n.async)??!0?setTimeout(r,0):r()}}),Am=z.create({name:`drop`,addProseMirrorPlugins(){return[new M({key:new N(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),jm=z.create({name:`editable`,addProseMirrorPlugins(){return[new M({key:new N(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),Mm=new N(`focusEvents`),Nm=z.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new M({key:Mm,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),Pm=z.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:k.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return hd()||Rd()?i:r},addProseMirrorPlugins(){return[new M({key:new N(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=k.atStart(t.doc).from,l=k.atEnd(t.doc).to;if(a||o!==c||s!==l||!qf(n.doc))return;let u=n.tr,d=zu({state:n,transaction:u}),{commands:f}=new Bu({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),Fm=z.create({name:`paste`,addProseMirrorPlugins(){return[new M({key:new N(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),Im=z.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new M({key:new N(`tabindex`),props:{attributes:()=>!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),Lm=z.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=mf(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new M({key:new N(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),Rm=!1;function zm(e){if(Rm)return;Rm=!0;let t;try{t=xr.fromJSON(e,{from:0,to:0}).slice.content}catch{return}t instanceof E||console.warn(`[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.`)}var Bm=class e{get name(){return this.node.type.name}constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new e(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e){if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r}r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},Vm=`.ProseMirror {
|
|
20
20
|
position: relative;
|
|
21
21
|
}
|
|
22
22
|
|
|
@@ -86,176 +86,176 @@ img.ProseMirror-separator {
|
|
|
86
86
|
|
|
87
87
|
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
88
88
|
display: block;
|
|
89
|
-
}`,
|
|
89
|
+
}`,Hm=class extends Mp{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Xf,createMappablePosition:Zf},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc();if(!this.editorState){let e=pd(t,this.options.autofocus);this.editorState=Ni.create({doc:t,schema:this.schema,selection:e||void 0})}zm(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():Bu.createFakeChain()}can(){return this.commandManager?this.commandManager.can():Bu.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=em(Vm,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps({...this.options.editorProps,attributes:this.getEditorViewAttributes()}),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return Np&&!this.hasWarnedStaleDecorationRead&&jp(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=ff(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;let n=[...this.options.enableCoreExtensions?[jm,Dm.configure({blockSeparator:(e=this.options.coreExtensionOptions)==null||(e=e.clipboardTextSerializer)==null?void 0:e.blockSeparator}),Om,Nm,Pm,Im.configure({value:(t=this.options.coreExtensionOptions)==null||(t=t.tabindex)==null?void 0:t.value}),Am,Fm,km,Lm.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions!=`object`||this.options.enableCoreExtensions[e.name]!==!1):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type));this.extensionManager=new Em(n,this)}createCommandManager(){this.commandManager=new Bu({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=nf(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(e.message))throw e;let t=nf(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=Ni.create({doc:t,schema:this.schema,selection:pd(t,this.options.autofocus)||void 0}),this.emit(`contentError`,{editor:this,error:e,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),this.editorState.doc}return e}getEditorViewAttributes(){let e=this.options.editorProps?.attributes;return ff(e)?t=>({role:`textbox`,...e(t)}):{role:`textbox`,...e}}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new Gl(e,{...t,attributes:this.getEditorViewAttributes(),dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return jf(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return Hf(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return df(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
|
|
90
90
|
|
|
91
|
-
`,textSerializers:n={}}=e||{};return kf(this.state.doc,{blockSeparator:t,textSerializers:{...Af(this.schema),...n}})}get isEmpty(){return Jf(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit(`destroy`),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new Vm(t,this,!1,n)}get $doc(){return this.$pos(0)}};function Wm(e){return new fm({find:e.find,handler:({state:t,range:n,match:r})=>{let i=I(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(If(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function Gm(e){return new fm({find:e.find,handler:({state:t,range:n,match:r})=>{let i=I(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function Km(e){return new fm({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=I(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function qm(e){return new fm({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=I(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&jr(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Ur(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var Jm=e=>`touches`in e,Ym=class{constructor(e){var t;this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.element.draggable=!1,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min&&(this.minSize={...this.minSize,...e.options.min}),e.options?.max&&(this.maxSize=e.options.max),e!=null&&(t=e.options)!=null&&t.directions&&(this.directions=e.options.directions),e.options?.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className&&(this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizing||``}),e.options?.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(`update`,this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type&&(this.node=e,!this.onUpdate||this.onUpdate(e,t,n))}destroy(){this.isResizing&&(this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off(`update`,this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?`inline-flex`:`flex`,this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement(`div`);return e.style.position=`relative`,e.style.display=`block`,e.dataset.resizeWrapper=``,this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement(`div`);return t.dataset.resizeHandle=e,t.style.position=`absolute`,this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes(`top`),r=t.includes(`bottom`),i=t.includes(`left`),a=t.includes(`right`);n&&(e.style.top=`0`),r&&(e.style.bottom=`0`),i&&(e.style.left=`0`),a&&(e.style.right=`0`),(t===`top`||t===`bottom`)&&(e.style.left=`0`,e.style.right=`0`),(t===`left`||t===`right`)&&(e.style.top=`0`,e.style.bottom=`0`)}attachHandles(){this.directions.forEach(e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,Jm(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=`true`,this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`touchmove`,this.handleTouchMove),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),a=this.applyConstraints(r,i,n);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,a=e.includes(`right`),o=e.includes(`left`),s=e.includes(`bottom`),c=e.includes(`top`);return a?r=this.startWidth+t:o&&(r=this.startWidth-t),s?i=this.startHeight+n:c&&(i=this.startHeight-n),(e===`right`||e===`left`)&&(r=this.startWidth+(a?t:-t)),(e===`top`||e===`bottom`)&&(i=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return this.maxSize?.width&&(n=Math.min(this.maxSize.width,n)),this.maxSize?.height&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let r=e,i=t;return r<this.minSize.width&&(r=this.minSize.width,i=r/this.aspectRatio),i<this.minSize.height&&(i=this.minSize.height,r=i*this.aspectRatio),this.maxSize?.width&&r>this.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(e,t,n){return n===`left`||n===`right`?{width:e,height:e/this.aspectRatio}:n===`top`||n===`bottom`?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}},z=class e extends ym{constructor(...e){super(...e),this.type=`node`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function Xm(e){return new xm({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=I(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(If(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}function Zm(e){return s((t,n)=>({get(){return t(),e},set(t){e=t,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var Qm=class extends Um{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=Zm(this.view.state),this.reactiveExtensionStorage=Zm(this.extensionStorage),this.on(`beforeTransaction`,({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),l(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){let n=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(e){let t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}},$m=de({name:`EditorContent`,props:{editor:{default:null,type:Object}},setup(e){let t=ae(),n=ge();return x(()=>{let r=e.editor;r&&r.options.element&&t.value&&v(()=>{if(!t.value||!r.view.dom?.parentNode)return;let e=w(t.value);t.value.append(...r.view.dom.parentNode.childNodes),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:e}),r.createNodeViews()})}),m(()=>{let t=e.editor;t&&(t.contentComponent=null,t.appContext=null)}),{rootEl:t}},render(){return Fe(`div`,{ref:e=>{this.rootEl=e}})}});de({name:`NodeViewContent`,props:{as:{type:String,default:`div`}},inject:{nodeViewContentRef:{default:void 0}},mounted(){let e=this.nodeViewContentRef;e&&this.$el&&e(this.$el)},beforeUnmount(){let e=this.nodeViewContentRef;e&&e(null)},render(){return Fe(this.as,{style:{whiteSpace:`pre-wrap`},"data-node-view-content":``})}}),de({name:`NodeViewWrapper`,props:{as:{type:String,default:`div`}},inject:[`onDragStart`,`decorationClasses`],render(){var e;return Fe(this.as,{class:this.decorationClasses,style:{whiteSpace:`normal`},"data-node-view-wrapper":``,onDragstart:this.onDragStart},(e=this.$slots).default?.call(e))}}),de({name:`MarkViewContent`,props:{as:{type:String,default:`span`}},render(){return Fe(this.as,{style:{whiteSpace:`inherit`},"data-mark-view-content":``})}});function eh(e,t){if(!t?.schema)return!1;let n=typeof e==`string`?e:e.name;return t.schema.spec.marks.get(n)!==void 0}function th(e,t){if(!e)return!1;let{selection:n}=e.state,{$from:r,to:i}=n;return t.some(t=>e.state.doc.nodesBetween(r.pos,i,e=>e.type.name===t))}function nh(e,t){return e?e.extensionManager.extensions.some(e=>e.name===t):!1}function rh(e){let t=`toggle${e.charAt(0).toUpperCase()}${e.slice(1)}`;return{canExecute:e=>e.can()[t](),execute:e=>e.chain().focus()[t](),isActive:t=>t.isActive(e),isDisabled:e=>th(e,[`image`])||e.isActive(`code`)}}function ih(e){let t=`set${e.charAt(0).toUpperCase()}${e.slice(1)}`;return{canExecute:e=>e.can()[t](),execute:e=>e.chain().focus()[t](),isActive:t=>t.isActive(e),isDisabled:e=>th(e,[`image`])||e.isActive(`code`)}}function ah(e){return{canExecute:t=>t.can()[e](),execute:t=>t.chain()[e](),isActive:()=>!1,isDisabled:void 0}}function oh(){return{canExecute:(e,t)=>e.can().toggleMark(t.mark),execute:(e,t)=>e.chain().focus().toggleMark(t.mark),isActive:(e,t)=>e.isActive(t.mark),isDisabled:(e,t)=>!eh(t.mark,e)||th(e,[`image`])}}function sh(){return{canExecute:(e,t)=>e.can().setTextAlign(t.align),execute:(e,t)=>e.chain().focus().setTextAlign(t.align),isActive:(e,t)=>e.isActive({textAlign:t.align}),isDisabled:e=>!nh(e,`textAlign`)||th(e,[`image`,`horizontalRule`])}}function ch(){return{canExecute:(e,t)=>e.can().toggleHeading({level:t.level}),execute:(e,t)=>e.chain().focus().toggleHeading({level:t.level}),isActive:(e,t)=>e.isActive(`heading`,{level:t.level}),isDisabled:e=>th(e,[`image`])||e.isActive(`code`)}}function lh(){return{canExecute:e=>e.can().setLink({href:``})||e.can().unsetLink(),execute:(e,t)=>{let n=e.chain(),r=e.getAttributes(`link`).href,i=e.isActive(`code`);if(r)return n.focus().unsetLink();let a=t?.href||prompt(`Enter the URL:`);return a?i?n.focus().extendMarkRange(`code`).setLink({href:a}):n.focus().setLink({href:a}):n},isActive:e=>e.isActive(`link`),isDisabled:e=>{if(!nh(e,`link`)||th(e,[`image`]))return!0;let{selection:t}=e.state;return t.empty&&!e.isActive(`link`)}}}function uh(){return{canExecute:e=>e.can().setImage({src:``}),execute:(e,t)=>{let n=e.chain().focus();if(t?.src)return n.setImage({src:t.src});let r=prompt(`Enter the image URL:`);return r?n.setImage({src:r}):n},isActive:e=>e.isActive(`image`),isDisabled:e=>!nh(e,`image`)}}function dh(e){let t={bulletList:`toggleBulletList`,orderedList:`toggleOrderedList`,taskList:`toggleTaskList`}[e],n=e===`taskList`?`taskItem`:`listItem`,r=[`bulletList`,`orderedList`,`taskList`];return{canExecute:e=>e.can()[t]()||e.isActive(`listItem`)||r.some(t=>nh(e,t)&&e.isActive(t)),execute:i=>{let{state:a}=i,{selection:o}=a,s=i.chain().focus();if(o.node){let e=o.node,t=e.firstChild?.firstChild,n=e.lastChild?.lastChild,r=t?o.from+t.nodeSize:o.from+1,i=n?o.to-n.nodeSize:o.to-1;s=s.setTextSelection({from:r,to:i}).clearNodes()}if(i.isActive(e)){let e=s.liftListItem(n);for(let t of r)nh(i,t)&&(e=e.lift(t));return e.selectTextblockEnd()}if(r.some(e=>nh(i,e)&&i.isActive(e))){let e=i.isActive(`taskList`)?`taskItem`:`listItem`,n=s.liftListItem(e);for(let e of r)nh(i,e)&&(n=n.lift(e));return n[t]().selectTextblockEnd()}return s[t]().selectTextblockEnd()},isActive:t=>t.isActive(e),isDisabled:t=>!nh(t,e)||th(t,[`image`])||t.isActive(`code`)}}function fh(e){return{canExecute:(t,n)=>{if(n?.pos==null||!t.state.doc.nodeAt(n.pos))return!1;let r=t.state.doc.resolve(n.pos),i=r.parent,a=r.index();return e===`up`?a>0:a<i.childCount-1},execute:(t,n)=>{if(n?.pos==null)return t.chain();let r=t.state.doc.nodeAt(n.pos);if(!r)return t.chain();let i=t.state.doc.resolve(n.pos),a=i.parent,o=i.index();if(e===`up`&&o>0){let e=a.child(o-1),i=n.pos-e.nodeSize;return t.chain().focus().deleteRange({from:n.pos,to:n.pos+r.nodeSize}).insertContentAt(i,r.toJSON())}if(e===`down`&&o<a.childCount-1){let e=a.child(o+1),i=n.pos+e.nodeSize;return t.chain().focus().deleteRange({from:n.pos,to:n.pos+r.nodeSize}).insertContentAt(i,r.toJSON())}return t.chain()},isActive:()=>!1,isDisabled:void 0}}function ph(){return{mark:oh(),textAlign:sh(),heading:ch(),link:lh(),image:uh(),blockquote:rh(`blockquote`),bulletList:dh(`bulletList`),orderedList:dh(`orderedList`),taskList:dh(`taskList`),codeBlock:rh(`codeBlock`),horizontalRule:ih(`horizontalRule`),paragraph:ih(`paragraph`),undo:ah(`undo`),redo:ah(`redo`),clearFormatting:{canExecute:(e,t)=>t?.pos==null?e.can().clearNodes()||e.can().unsetAllMarks():!!e.state.doc.nodeAt(t.pos),execute:(e,t)=>{if(t?.pos!=null){let n=e.state.doc.nodeAt(t.pos);if(!n)return e.chain();let r=t.pos+1,i=t.pos+n.nodeSize-1;return e.chain().focus().setTextSelection({from:r,to:i}).clearNodes().unsetAllMarks()}return e.chain().focus().clearNodes().unsetAllMarks()},isActive:()=>!1,isDisabled:void 0},duplicate:{canExecute:(e,t)=>t?.pos!=null&&!!e.state.doc.nodeAt(t.pos),execute:(e,t)=>{if(t?.pos==null)return e.chain();let n=e.state.doc.nodeAt(t.pos);return n?e.chain().focus().insertContentAt(t.pos+n.nodeSize,n.toJSON()):e.chain()},isActive:()=>!1,isDisabled:void 0},delete:{canExecute:(e,t)=>t?.pos!=null&&!!e.state.doc.nodeAt(t.pos),execute:(e,t)=>{if(t?.pos==null)return e.chain();let n=e.state.doc.nodeAt(t.pos);return n?e.chain().focus().deleteRange({from:t.pos,to:t.pos+n.nodeSize}):e.chain()},isActive:()=>!1,isDisabled:void 0},moveUp:fh(`up`),moveDown:fh(`down`),suggestion:{canExecute:()=>!0,execute:(e,t)=>{let{state:n}=e,{selection:r}=n,{$from:i}=r;if(t?.pos!==void 0){let r=n.doc.nodeAt(t.pos);if(r){let n=t.pos+r.nodeSize;return e.chain().focus().insertContentAt(n,{type:`paragraph`,content:[{type:`text`,text:`/`}]})}}let a=i.node(i.depth),o=i.before(i.depth)+a.nodeSize;return e.chain().focus().insertContentAt(o,{type:`paragraph`,content:[{type:`text`,text:`/`}]})},isActive:()=>!1,isDisabled:void 0},mention:{canExecute:()=>!0,execute:e=>{let{state:t}=e,{selection:n}=t,{$from:r}=n,i=r.parent.textBetween(Math.max(0,r.parentOffset-1),r.parentOffset,void 0,` `),a=i&&i!==` `;return e.chain().focus().insertContent(a?` @`:`@`)},isActive:()=>!1,isDisabled:void 0},emoji:{canExecute:()=>!0,execute:e=>{let{state:t}=e,{selection:n}=t,{$from:r}=n,i=r.parent.textBetween(Math.max(0,r.parentOffset-1),r.parentOffset,void 0,` `),a=i&&i!==` `;return e.chain().focus().insertContent(a?` :`:`:`)},isActive:()=>!1,isDisabled:void 0}}}var mh,hh;if(typeof WeakMap<`u`){let e=new WeakMap;mh=t=>e.get(t),hh=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;mh=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},hh=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var gh=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 mh(e)||hh(e,_h(e))}};function _h(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=vh(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 gh(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&&yh(s,o,e),s}function vh(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 yh(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||=bh(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function bh(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function xh(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 Sh=new M(`selectingCells`);function Ch(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 wh(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 Th(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 Eh(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=Ch(t.$head)||Dh(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function Dh(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 Oh(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function kh(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function Ah(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function jh(e,t,n){let r=e.node(-1),i=gh.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 Mh(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 Nh(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 Ph(e,t,n){let r=xh(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 B=class e extends O{constructor(e,t=e){let n=e.node(-1),r=gh.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 _i(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(Oh(r)&&Oh(i)&&Ah(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 k.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=gh.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=Mh(e,0,l)),u>0&&(e=Mh(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(T.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new D(T.from(o),1,1)}replace(e,t=D.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?D.empty:t)}let i=O.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new D(T.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=gh.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=gh.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=gh.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=gh.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 Fh(this.$anchorCell.pos,this.$headCell.pos)}};B.prototype.visible=!1,O.jsonID(`cell`,B);var Fh=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&&Ah(t,n)?new B(t,n):O.near(n,1)}};function Ih(e){if(!(e.selection instanceof B))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(ul.node(n,n+e.nodeSize,{class:`selectedCell`}))}),P.create(e.doc,t)}function Lh({$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 Rh({$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 zh(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof A&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=B.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=B.rowSelection(e,e)}else if(!n){let e=gh.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=B.create(i,t+1,n)}}else r instanceof k&&Lh(r)?a=k.create(i,r.from):r instanceof k&&Rh(r)&&(a=k.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var Bh=new M(`fix-tables`);function Vh(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)?Vh(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function Hh(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=Uh(e,t,r,n))};return t?t.doc!=e.doc&&Vh(t.doc,e.doc,0,r):e.doc.descendants(r),n}function Uh(e,t,n,r){let i=gh.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,Mh(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=xh(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(Bh,{fixTables:!0})}function Wh(e){let t=e.selection,n=Eh(e),r=n.node(-1),i=n.start(-1),a=gh.get(r);return{...t instanceof B?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function Gh(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;Ph(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,Nh(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?xh(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 Kh(e,t){if(!Th(e))return!1;if(t){let n=Wh(e);t(Gh(e.tr,n,n.left))}return!0}function qh(e,t){if(!Th(e))return!1;if(t){let n=Wh(e);t(Gh(e.tr,n,n.right))}return!0}function Jh(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,Mh(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 Yh(e,t){if(!Th(e))return!1;if(t){let n=Wh(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;Jh(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=gh.get(e)}t(r)}return!0}function Xh(e,t,n){let r=xh(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 Zh(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;Xh(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?xh(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,xh(r.type.schema).row.create(null,o)),e}function Qh(e,t){if(!Th(e))return!1;if(t){let n=Wh(e);t(Zh(e.tr,n,n.top))}return!0}function $h(e,t){if(!Th(e))return!1;if(t){let n=Wh(e);t(Zh(e.tr,n,n.bottom))}return!0}function eg(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 tg(e,t){if(!Th(e))return!1;if(t){let n=Wh(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;eg(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=gh.get(n.table)}t(r)}return!0}function ng(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function rg({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 ig(e,t){let n=e.selection;if(!(n instanceof B)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=Wh(e),{map:i}=r;if(rg(i,r))return!1;if(t){let n=e.tr,a={},o=T.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!a[l]&&u){if(a[l]=!0,s==null)s=l,c=u;else{ng(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...Nh(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=ng(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new B(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function ag(e,t){let n=xh(e.schema);return og(({node:e})=>n[e.type.spec.tableRole])(e,t)}function og(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof B){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=wh(r.$from),!i)return!1;a=Ch(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=Wh(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 B&&u.setSelection(new B(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function sg(e,t){return function(n,r){if(!Th(n))return!1;let i=Eh(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof B?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 cg(e){return function(t,n){if(!Th(t))return!1;if(n){let r=xh(t.schema),i=Wh(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 lg(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 ug(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?cg(e):function(t,n){if(!Th(t))return!1;if(n){let r=xh(t.schema),i=Wh(t),a=t.tr,o=lg(`row`,i,r),s=lg(`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}}ug(`row`,{useDeprecatedLogic:!0}),ug(`column`,{useDeprecatedLogic:!0});var dg=ug(`cell`,{useDeprecatedLogic:!0});function fg(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 pg(e){return function(t,n){if(!Th(t))return!1;let r=fg(Eh(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(k.between(e,kh(e))).scrollIntoView())}return!0}}function mg(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 hg(e,t){let n=e.selection;if(!(n instanceof B))return!1;if(t){let r=e.tr,i=xh(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 D(i,0,0))}),r.docChanged&&t(r)}return!0}function gg(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=vg(xh(o).row,new D(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?vg(xh(o).row,new D(t,n,r)).content:t);else return null;return _g(o,s)}function _g(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(T.empty),n[i]<r){let a=xh(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(T.from(o))}return{height:t.length,width:r,rows:t}}function vg(e,t){let n=e.createAndFill();return new hi(n).replace(0,n.content.size,t).doc}function yg({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(Mh(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(T.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(T.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function bg(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=xh(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.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==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,T.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function xg(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 Sg(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,Mh(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(Mh(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function Cg(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=gh.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=gh.get(a),f=d.mapping.maps.length}bg(d,o,a,n,l,u,f)&&p(),xg(d,o,a,n,c,l,s,f)&&p(),xg(d,o,a,n,c,l,u,f)&&p(),Sg(d,o,a,n,s,u,c,f)&&p(),Sg(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 D(i.rows[e-s],0,0))}p(),d.setSelection(new B(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var wg=pu({ArrowLeft:Eg(`horiz`,-1),ArrowRight:Eg(`horiz`,1),ArrowUp:Eg(`vert`,-1),ArrowDown:Eg(`vert`,1),"Shift-ArrowLeft":Dg(`horiz`,-1),"Shift-ArrowRight":Dg(`horiz`,1),"Shift-ArrowUp":Dg(`vert`,-1),"Shift-ArrowDown":Dg(`vert`,1),Backspace:hg,"Mod-Backspace":hg,Delete:hg,"Mod-Delete":hg});function Tg(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function Eg(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof B)return Tg(n,r,O.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=jg(i,e,t);if(o==null)return!1;if(e==`horiz`)return Tg(n,r,O.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=jh(i,e,t),s;return s=a?O.near(a,1):t<0?O.near(n.doc.resolve(i.before(-1)),-1):O.near(n.doc.resolve(i.after(-1)),1),Tg(n,r,s)}}}function Dg(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof B)o=a;else{let r=jg(i,e,t);if(r==null)return!1;o=new B(n.doc.resolve(r))}let s=jh(o.$headCell,e,t);return s?Tg(n,r,new B(o.$anchorCell,s)):!1}}function Og(e,t){let n=e.state.doc,r=Ch(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new B(r))),!0):!1}function kg(e,t,n){if(!Th(e.state))return!1;let r=gg(n),i=e.state.selection;if(i instanceof B){r||={width:1,height:1,rows:[T.from(vg(xh(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=gh.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=yg(r,o.right-o.left,o.bottom-o.top),Cg(e.state,e.dispatch,a,o,r),!0}if(r){let t=Eh(e.state),n=t.start(-1);return Cg(e.state,e.dispatch,n,gh.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function Ag(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=Mg(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof B)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=Ch(e.state.selection.$anchor))!=null&&Ng(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=Ng(e,n),i=Sh.getState(e.state)==null;if(!r||!Ah(t,r)){if(i)r=t;else return}let a=new B(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(Sh,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),Sh.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(Sh,-1))}function o(r){let o=r,s=Sh.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(Mg(e,o.target)!=n&&(c=Ng(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 jg(e,t,n){if(!(e.state.selection instanceof k))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 Mg(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function Ng(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&&Ch(e.state.doc.resolve(r))||Ch(e.state.doc.resolve(i))}var Pg=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`)),Fg(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,Fg(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function Fg(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 Ig=new M(`tableColumnResizing`);function Lg({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=Pg,lastColumnResizable:i=!0}={}){let a=new j({key:Ig,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=xh(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new Rg(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=Ig.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{zg(t,n,e,i)},mouseleave:e=>{Bg(e)},mousedown:(e,r)=>{Vg(e,r,t,n)}},decorations:e=>{let t=Ig.getState(e);if(t&&t.activeHandle>-1)return Xg(e,t.activeHandle)},nodeViews:{}}});return a}var Rg=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(Ig);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 Oh(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function zg(e,t,n,r){if(!e.editable)return;let i=Ig.getState(e.state);if(i&&!i.dragging){let a=Ug(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=Wg(e,t,`left`,n):i-t.clientX<=n&&(o=Wg(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=gh.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}Kg(e,o)}}}function Bg(e){if(!e.editable)return;let t=Ig.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&Kg(e,-1)}function Vg(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=Ig.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=Hg(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(Ig,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=Ig.getState(e.state);r?.dragging&&(qg(e,r.activeHandle,Gg(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(Ig,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=Ig.getState(e.state);if(i&&i.dragging){let a=Gg(i.dragging,t,n);Jg(e,i.activeHandle,a,r)}}return Jg(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function Hg(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 Ug(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function Wg(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=Ch(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=gh.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 Gg(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function Kg(e,t){e.dispatch(e.state.tr.setMeta(Ig,{setHandle:t}))}function qg(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=gh.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():Yg(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function Jg(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=gh.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&&Fg(a,c.firstChild,c,r,s,n)}function Yg(e){return Array(e).fill(0)}function Xg(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return P.empty;let a=gh.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`,Ig.getState(e)?.dragging&&n.push(ul.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(ul.widget(s,c))}}return P.create(e.doc,n)}function Zg({allowTableNodeSelection:e=!1}={}){return new j({key:Sh,state:{init(){return null},apply(e,t){let n=e.getMeta(Sh);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:Ih,handleDOMEvents:{mousedown:Ag},createSelectionBetween(e){return Sh.getState(e.state)==null?null:e.state.selection},handleTripleClick:Og,handleKeyDown:wg,handlePaste:kg},appendTransaction(t,n,r){return zh(r,Hh(r,n),e)}})}function Qg(e,t){let n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-i,o=r-n;return new DOMRect(i,n,a,o)}var $g=class{get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(ze(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(Be(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(Ve(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(Qe(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ke(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(lt(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(ct(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(Xe(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}get virtualElement(){var e;let{selection:t}=this.editor.state,n=this.getReferencedVirtualElement?.call(this);if(n)return n;if(!((e=this.view)!=null&&(e=e.dom)!=null&&e.parentNode))return;let r=$f(this.view,t.from,t.to),i={getBoundingClientRect:()=>r,getClientRects:()=>[r]};if(t instanceof A){let e=this.view.nodeDOM(t.from),n=e.dataset.nodeViewWrapper?e:e.querySelector(`[data-node-view-wrapper]`);n&&(e=n),e&&(i={getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>[e.getBoundingClientRect()]})}if(t instanceof B){let{$anchorCell:e,$headCell:n}=t,r=e?e.pos:n.pos,a=n?n.pos:e.pos,o=this.view.nodeDOM(r),s=this.view.nodeDOM(a);if(!o||!s)return;let c=o===s?o.getBoundingClientRect():Qg(o.getBoundingClientRect(),s.getBoundingClientRect());i={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return i}constructor({editor:e,element:t,view:n,pluginKey:r=`bubbleMenu`,updateDelay:i=250,resizeDelay:a=60,shouldShow:o,appendTo:s,getReferencedVirtualElement:c,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:`absolute`,placement:`top`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:t,from:n,to:r})=>{let{doc:i,selection:a}=t,{empty:o}=a,s=!i.textBetween(n,r).length&&fd(t.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||o||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{this.editor.isDestroyed?this.destroy():this.preventHide?this.preventHide=!1:e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);(n||r)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;i||!t&&!n||(this.getShouldShow(r)?(this.show(),this.updatePosition()):this.hide())},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=l?.scrollTarget??window,this.getReferencedVirtualElement=c,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener(`dragstart`,this.dragstartHandler),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;let e=this.virtualElement;e&&Ye(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{this.isVisible&&!this.editor.isDestroyed&&this.element.isConnected&&(r.hide?.referenceHidden||r.hide?.escaped?this.element.style.visibility=`hidden`:(this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()))})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!t?.selection.eq(e.state.selection),a=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,a,t)}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:e,from:i,to:a})||!1}show(){var e;this.isVisible||=(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener(`dragstart`,this.dragstartHandler),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},e_=e=>new j({key:typeof e.pluginKey==`string`?new M(e.pluginKey):e.pluginKey,view:t=>new $g({view:t,...e})});R.create({name:`bubbleMenu`,addOptions(){return{element:null,pluginKey:`bubbleMenu`,updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[e_({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var t_=class{getTextContent(e){return kf(e,{textSerializers:Af(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(ze(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(Be(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(Ve(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(Qe(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ke(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(lt(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(ct(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(Xe(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}constructor({editor:e,element:t,view:n,pluginKey:r=`floatingMenu`,updateDelay:i=250,resizeDelay:a=60,options:o,appendTo:s,shouldShow:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,a=r.depth===1,o=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&r.parent.childCount===0&&!this.getTextContent(r.parent);return!(!e.hasFocus()||!i||!a||!o||!this.editor.isEditable)},this.floatingUIOptions={strategy:`absolute`,placement:`right`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;i||!t&&!n||(this.getShouldShow(r)?(this.updatePosition(),this.show()):this.hide())},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{this.preventHide?this.preventHide=!1:e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=o?.scrollTarget??window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,c&&(this.shouldShow=c),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,view:this.view,state:t,oldState:e,from:i,to:a})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!((e=this.view)!=null&&(e=e.dom)!=null&&e.parentNode))return;let{selection:t}=this.editor.state,n=$f(this.view,t.from,t.to);Ye({getBoundingClientRect:()=>n,getClientRects:()=>[n]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{r.hide?.referenceHidden||r.hide?.escaped?this.element.style.visibility=`hidden`:(this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate())})}update(e,t){let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,r,t)}show(){var e;this.isVisible||=(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},n_=e=>new j({key:typeof e.pluginKey==`string`?new M(e.pluginKey):e.pluginKey,view:t=>new t_({view:t,...e})});R.create({name:`floatingMenu`,addOptions(){return{element:null,options:{},pluginKey:`floatingMenu`,updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,`updatePosition`),!0)}},addProseMirrorPlugins(){return this.options.element?[n_({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});var r_=de({name:`BubbleMenu`,inheritAttrs:!1,props:{pluginKey:{type:[String,Object],default:void 0},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},resizeDelay:{type:Number,default:void 0},options:{type:Object,default:()=>({})},appendTo:{type:[Object,Function],default:void 0},shouldShow:{type:Function,default:null},getReferencedVirtualElement:{type:Function,default:void 0}},setup(e,{slots:t,attrs:n}){let r=ae(null),i=e.pluginKey??new M(`bubbleMenu`);return S(()=>{let{editor:t,options:n,resizeDelay:a,appendTo:o,shouldShow:s,getReferencedVirtualElement:c,updateDelay:l}=e,u=r.value;u&&(u.style.visibility=`hidden`,u.style.position=`absolute`,u.remove(),v(()=>{t.registerPlugin(e_({editor:t,element:u,options:n,pluginKey:i,resizeDelay:a,appendTo:o,shouldShow:s,getReferencedVirtualElement:c,updateDelay:l}))}))}),m(()=>{let{editor:t}=e;t.unregisterPlugin(i)}),()=>Fe(`div`,{ref:r,...n},t.default?.call(t))}}),i_=de({name:`FloatingMenu`,inheritAttrs:!1,props:{pluginKey:{type:null,default:void 0},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},resizeDelay:{type:Number,default:void 0},options:{type:Object,default:()=>({})},appendTo:{type:[Object,Function],default:void 0},shouldShow:{type:Function,default:null}},setup(e,{slots:t,attrs:n}){let r=ae(null),i=e.pluginKey??new M(`floatingMenu`);return S(()=>{let{editor:t,updateDelay:n,resizeDelay:a,options:o,appendTo:s,shouldShow:c}=e,l=r.value;l&&(l.style.visibility=`hidden`,l.style.position=`absolute`,l.remove(),t.registerPlugin(n_({pluginKey:i,editor:t,element:l,updateDelay:n,resizeDelay:a,options:o,appendTo:s,shouldShow:c})))}),m(()=>{let{editor:t}=e;t.unregisterPlugin(i)}),()=>Fe(`div`,{ref:r,...n},t.default?.call(t))}}),a_={slots:{content:`flex items-center gap-1 bg-default text-highlighted shadow-sm rounded-sm ring ring-default h-6 px-2.5 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)] origin-(--reka-tooltip-content-transform-origin) pointer-events-auto`,arrow:`fill-bg stroke-default`,text:`truncate`,kbds:`hidden lg:inline-flex items-center shrink-0 gap-0.5 not-first-of-type:before:content-['·'] not-first-of-type:before:me-0.5`,kbdsSize:`sm`}},o_={__name:`Tooltip`,props:{text:{type:String,required:!1},kbds:{type:Array,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},reference:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},delayDuration:{type:Number,required:!1},disableHoverableContent:{type:Boolean,required:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1}},emits:[`update:open`],setup(r,{emit:i}){let a=r,s=i,c=_e(),l=Ae(`tooltip`,a),u=n(),d=at(),f=se(ye(l,`defaultOpen`,`open`,`delayDuration`,`disableHoverableContent`,`disableClosingTrigger`,`ignoreNonKeyboardFocus`),s),p=rt(Se(()=>l.portal)),m=Se(()=>Ie(l.content,d.content.value,{side:`bottom`,sideOffset:8,collisionPadding:8})),h=Se(()=>Ie(l.arrow,{rounded:!0})),{getKbdKey:_}=Ue(),v=ie(()=>m.value.ariaLabel||c.content?m.value.ariaLabel:[l.text,...(l.kbds||[]).map(e=>_(typeof e==`object`?e.value:e))].filter(Boolean).join(` `)),b=ie(()=>he({extend:a_,...u.ui?.tooltip||{}})({side:m.value.side}));return(n,r)=>(C(),oe(w(wt),g(w(f),{disabled:!(w(l).text||w(l).kbds?.length||c.content)||w(l).disabled}),{default:o(({open:r})=>[c.default||w(l).reference?(C(),oe(w(kt),g({key:0},n.$attrs,{"as-child":``,reference:w(l).reference,class:w(l).class}),{default:o(()=>[me(n.$slots,`default`,{open:r})]),_:2},1040,[`reference`,`class`])):y(``,!0),be(w(Ot),fe(je(w(p))),{default:o(()=>[be(w(ce),null,{default:o(()=>[be(w(Dt),g(m.value,{"aria-label":v.value,"data-slot":`content`,class:b.value.content({class:[!c.default&&w(l).class,w(l).ui?.content]})}),{default:o(()=>[me(n.$slots,`content`,{ui:b.value},()=>[w(l).text?(C(),t(`span`,{key:0,"data-slot":`text`,class:Oe(b.value.text({class:w(l).ui?.text}))},xe(w(l).text),3)):y(``,!0),w(l).kbds?.length?(C(),t(`span`,{key:1,"data-slot":`kbds`,class:Oe(b.value.kbds({class:w(l).ui?.kbds}))},[(C(!0),t(Le,null,e(w(l).kbds,(e,t)=>(C(),oe($e,g({key:t,size:w(l).ui?.kbdsSize||b.value.kbdsSize()},{ref_for:!0},typeof e==`string`?{value:e}:e),null,16,[`size`]))),128))],2)):y(``,!0)]),w(l).arrow?(C(),oe(w(bt),g({key:0},h.value,{"data-slot":`arrow`,class:b.value.arrow({class:w(l).ui?.arrow})}),null,16,[`class`])):y(``,!0)]),_:3},16,[`aria-label`,`class`])]),_:3})]),_:3},16)]),_:3},16,[`disabled`]))}},s_={slots:{root:`focus:outline-none`,base:`flex items-stretch gap-1.5`,group:`flex items-center gap-0.5`,separator:`w-px self-stretch bg-border`},variants:{layout:{bubble:{base:`bg-default border border-default rounded-lg p-1`},floating:{base:`bg-default border border-default rounded-lg p-1`},fixed:{base:``}}}},c_=Object.assign({inheritAttrs:!1},{__name:`EditorToolbar`,props:{as:{type:null,required:!1},color:{type:null,required:!1,default:`neutral`},variant:{type:null,required:!1,default:`ghost`},activeColor:{type:null,required:!1,default:`primary`},activeVariant:{type:null,required:!1,default:`soft`},size:{type:null,required:!1,default:`sm`},items:{type:null,required:!1},editor:{type:Object,required:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},layout:{type:String,required:!1,default:`fixed`},pluginKey:{type:[Object,String],required:!1},updateDelay:{type:Number,required:!1},resizeDelay:{type:Number,required:!1},shouldShow:{type:[Function,null],required:!1},appendTo:{type:Function,required:!1,skipCheck:!0},getReferencedVirtualElement:{type:Function,required:!1},options:{type:Object,required:!1}},setup(r){let i=Ae(`editorToolbar`,r),s=n(),c=a(`editorHandlers`,ie(()=>ph())),l=ie(()=>({bubble:r_,floating:i_,fixed:`template`})[i.layout]),d=se(De(i,`as`,`color`,`variant`,`activeColor`,`activeVariant`,`size`,`items`,`layout`,`editor`,`class`,`ui`)),f=ie(()=>Ie(i.options,{offset:8,shift:{padding:8}})),m=ie(()=>he({extend:s_,...s.ui?.editorToolbar||{}})({layout:i.layout})),_=ie(()=>i.items?.length?h(i.items)?i.items:[i.items]:[]);function v(e){return i.editor?.isEditable?`items`in e&&e.items?.length?e.items?.some(e=>v(e))||!1:`kind`in e?(c?.value?.[e.kind])?.isActive(i.editor,e)||!1:e.active??!1:!1}function x(e){if(!i.editor?.isEditable)return!0;if(`items`in e&&e.items?.length){let t=(h(e.items)?e.items.flat():e.items).filter(e=>e.type!==`separator`&&e.type!==`label`);return t.length===0||t.every(e=>x(e))}if(!(`kind`in e))return e.disabled??!1;let t=c?.value?.[e.kind];return t?t.isDisabled?.(i.editor,e)?!0:!t.canExecute(i.editor,e):!1}function S(e,t){if(!i.editor?.isEditable||x(t))return;if(`items`in t||!(`kind`in t)){if(`onClick`in t)for(let n of Array.isArray(t.onClick)?t.onClick:[t.onClick])n?.(e);return}let n=c?.value?.[t.kind];n&&n.execute(i.editor,t).run()}function ee(e){if(e.items)return(h(e.items)?e.items.flat():e.items).find(e=>`kind`in e&&v(e))}function ne(e){let t=u(e,[`kind`,`mark`,`align`,`level`,`href`,`src`,`pos`,`items`,`slot`,`checkedIcon`,`loadingIcon`,`externalIcon`,`content`,`arrow`,`portal`,`modal`,`tooltip`,`onClick`]);if(`items`in e&&e.items?.length){let n=ee(e);n?.icon&&(t.icon=n.icon),n?.label&&t.label!==void 0&&(t.label=n.label)}return Ie(t,{"aria-label":t.label?void 0:e.tooltip?.text,color:i.color,activeColor:i.activeColor,activeVariant:i.activeVariant,variant:i.variant,size:i.size})}function re(e){let t=p(e,[`size`,`checkedIcon`,`loadingIcon`,`externalIcon`,`content`,`arrow`,`portal`,`modal`,`ui`]);return Ie(t,{modal:!1,size:i.size})}function ae(e){let t=`children`in e&&Array.isArray(e.children)?e.children.map(ae):void 0;if(!(`kind`in e))return t?{...e,children:t}:e;let n=e;return{...n,...t&&{children:t},active:v(n),disabled:x(n),onSelect:e=>S(e,n)}}function ce(e){return e.items?h(e.items)?e.items.map(e=>e.map(ae)):[e.items.map(ae)]:[]}return(n,r)=>(C(),oe(w(b),g({as:l.value},l.value===`template`?{...n.$attrs}:{editor:w(i).editor,tabindex:-1,class:m.value.root({class:w(i).ui?.root}),...w(d),options:f.value,...n.$attrs}),{default:o(()=>[be(w(b),{as:w(i).as,role:`toolbar`,"data-slot":`base`,class:Oe(m.value.base({class:[w(i).ui?.base,w(i).class]}))},{default:o(()=>[(C(!0),t(Le,null,e(_.value,(r,a)=>(C(),t(Le,{key:`group-${a}`},[te(`div`,{role:`group`,"data-slot":`group`,class:Oe(m.value.group({class:w(i).ui?.group}))},[(C(!0),t(Le,null,e(r,(e,t)=>me(n.$slots,e.slot||`item`,{item:e,index:t,isActive:v,isDisabled:x,onClick:S},()=>[`items`in e&&e.items?.length?(C(),oe(it,g({key:0,ref_for:!0},re(e),{items:ce(e)}),{default:o(()=>[e.tooltip?(C(),oe(o_,g({key:0,disabled:x(e)},{ref_for:!0},{...e.tooltip||{}}),{default:o(()=>[be(Ee,g({active:v(e),disabled:x(e)},{ref_for:!0},ne(e),{onClick:t=>S(t,e)}),null,16,[`active`,`disabled`,`onClick`])]),_:2},1040,[`disabled`])):(C(),oe(Ee,g({key:1,active:v(e),disabled:x(e)},{ref_for:!0},ne(e),{onClick:t=>S(t,e)}),null,16,[`active`,`disabled`,`onClick`]))]),_:2},1040,[`items`])):e.tooltip?(C(),oe(o_,g({key:1,disabled:x(e)},{ref_for:!0},{...e.tooltip||{}}),{default:o(()=>[be(Ee,g({active:v(e),disabled:x(e)},{ref_for:!0},ne(e),{ui:e.ui,onClick:t=>S(t,e)}),null,16,[`active`,`disabled`,`ui`,`onClick`])]),_:2},1040,[`disabled`])):(C(),oe(Ee,g({key:2,active:v(e),disabled:x(e)},{ref_for:!0},ne(e),{ui:e.ui,onClick:t=>S(t,e)}),null,16,[`active`,`disabled`,`ui`,`onClick`]))],void 0,`group-${a}-${t}`)),128))],2),a<_.value.length-1?(C(),oe(w(yt),{key:0,"data-slot":`separator`,class:Oe(m.value.separator({class:w(i).ui?.separator})),orientation:`vertical`},null,8,[`class`])):y(``,!0)],64))),128))]),_:3},8,[`as`,`class`])]),_:3},16,[`as`]))}}),l_={slots:{root:``,content:`relative size-full flex-1`,base:[`w-full outline-none *:my-5 *:first:mt-0 *:last:mb-0 sm:px-8 selection:bg-primary/20`,`[&_p]:leading-7`,`[&_a]:text-primary [&_a]:border-b [&_a]:border-transparent [&_a]:hover:border-primary [&_a]:focus-visible:border-transparent [&_a]:font-medium [&_a]:focus-visible:rounded-xs [&_a]:outline-primary/25 [&_a]:focus-visible:outline-3 [&_a:has(>code)]:focus-visible:outline-0`,`[&_a]:transition-colors`,`[&_a:has(>code)]:border-b-0 [&_a>code]:border-dashed [&_a>code]:outline-primary/25 [&_a:focus-visible>code]:outline-3 [&_a:hover>code]:border-primary [&_a:hover>code]:text-primary [&_a:focus-visible>code]:border-primary [&_a:focus-visible>code]:text-primary`,`[&_a>code]:transition-colors`,`[&_.mention]:text-primary [&_.mention]:font-medium`,`[&_:is(h1,h2,h3,h4,h5,h6)]:text-highlighted [&_:is(h1,h2,h3,h4,h5,h6)]:font-bold`,`[&_h1]:text-3xl`,`[&_h2]:text-2xl`,`[&_h3]:text-xl`,`[&_h4]:text-lg`,`[&_h5]:text-base`,`[&_h6]:text-base`,`[&_:is(h1,h2,h3,h4,h5,h6)>code]:border-dashed [&_:is(h1,h2,h3,h4,h5,h6)>code]:font-bold`,`[&_h2>code]:text-xl/6`,`[&_h3>code]:text-lg/5`,`[&_blockquote]:border-s-4 [&_blockquote]:border-accented [&_blockquote]:ps-4 [&_blockquote]:italic`,`[&_[data-type=horizontalRule]]:my-8 [&_[data-type=horizontalRule]]:py-2`,`[&_hr]:border-t [&_hr]:border-default`,`[&_pre]:text-sm/6 [&_pre]:border [&_pre]:border-muted [&_pre]:bg-muted [&_pre]:rounded-md [&_pre]:px-4 [&_pre]:py-3 [&_pre]:whitespace-pre-wrap [&_pre]:wrap-break-word [&_pre]:overflow-x-auto`,`[&_pre_code]:p-0 [&_pre_code]:text-inherit [&_pre_code]:rounded-none [&_pre_code]:inline [&_pre_code]:border-0 [&_pre_code]:bg-transparent`,`[&_code]:px-1.5 [&_code]:py-0.5 [&_code]:text-sm [&_code]:font-mono [&_code]:font-medium [&_code]:rounded-md [&_code]:inline-block [&_code]:border [&_code]:border-muted [&_code]:text-highlighted [&_code]:bg-muted`,`[&_:is(ul,ol)]:ps-6`,`[&_ul]:list-disc [&_ul]:marker:text-(--ui-border-accented)`,`[&_ol]:list-decimal [&_ol]:marker:text-muted`,`[&_li]:my-1.5 [&_li]:ps-1.5`,`[&_img]:rounded-md [&_img]:block [&_img]:max-w-full [&_img.ProseMirror-selectednode]:outline-2 [&_img.ProseMirror-selectednode]:outline-primary`,`[&_.ProseMirror-selectednode:not(img):not(pre):not([data-node-view-wrapper])]:bg-primary/20`]},variants:{placeholderMode:{firstLine:{base:`[&_:is(p,h1,h2,h3,h4,h5,h6).is-editor-empty:first-child]:before:content-[attr(data-placeholder)] [&_:is(p,h1,h2,h3,h4,h5,h6).is-editor-empty:first-child]:before:text-dimmed [&_:is(p,h1,h2,h3,h4,h5,h6).is-editor-empty:first-child]:before:float-start [&_:is(p,h1,h2,h3,h4,h5,h6).is-editor-empty:first-child]:before:h-0 [&_:is(p,h1,h2,h3,h4,h5,h6).is-editor-empty:first-child]:before:pointer-events-none`},everyLine:{base:`[&_:is(p,h1,h2,h3,h4,h5,h6).is-empty]:before:content-[attr(data-placeholder)] [&_:is(p,h1,h2,h3,h4,h5,h6).is-empty]:before:text-dimmed [&_:is(p,h1,h2,h3,h4,h5,h6).is-empty]:before:float-start [&_:is(p,h1,h2,h3,h4,h5,h6).is-empty]:before:h-0 [&_:is(p,h1,h2,h3,h4,h5,h6).is-empty]:before:pointer-events-none`}}},defaultVariants:{placeholderMode:`everyLine`}},u_=e=>Array.isArray(e)&&e[0]!==null,d_=([,,...e])=>e;function f_(e){switch(typeof e){case`string`:return e;case`number`:case`boolean`:case`bigint`:case`symbol`:return String(e);default:return}}function p_(e){let t=[],n=``,r=!1;for(let i=0;i<e.length;i++){let a=e[i],o=a===`|`&&i>0&&e[i-1]===`\\`;a===`|`&&!o?(r&&n&&(t.push(n.length),n=``),r=!0):r&&(n+=a)}return r&&n&&t.push(n.length),t}function m_(e){let t=[],n=``,r=!1;for(let i=0;i<e.length;i++){let a=e[i],o=a===`|`&&i>0&&e[i-1]===`\\`;a===`|`&&!o?(r&&(t.push(n.trim()),n=``),r=!0):r&&(n+=a)}return n.trim()&&t.push(n.trim()),t}function h_(e){let t=e.split(`
|
|
92
|
-
`),n=[],r=-1;for(let e=0;e<t.length;e++)t[e].trim().startsWith(`|`)?r===-1&&(r=e):r!==-1&&(n.push({start:r,end:e-1}),r=-1);if(r!==-1&&n.push({start:r,end:t.length-1}),n.length===0)return e;let{start:i,end:a}=n[n.length-1];t[i].trim().endsWith(`|`)||(t[i]+=` |`);let o=
|
|
93
|
-
`)}function
|
|
91
|
+
`,textSerializers:n={}}=e||{};return Of(this.state.doc,{blockSeparator:t,textSerializers:{...kf(this.schema),...n}})}get isEmpty(){return qf(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit(`destroy`),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new Bm(t,this,!1,n)}get $doc(){return this.$pos(0)}};function Um(e){return new dm({find:e.find,handler:({state:t,range:n,match:r})=>{let i=L(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(Ff(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function Wm(e){return new dm({find:e.find,handler:({state:t,range:n,match:r})=>{let i=L(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function Gm(e){return new dm({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=L(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function Km(e){return new dm({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=L(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&Ar(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Hr(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var qm=e=>`touches`in e,Jm=class{constructor(e){var t;this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.element.draggable=!1,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min&&(this.minSize={...this.minSize,...e.options.min}),e.options?.max&&(this.maxSize=e.options.max),e!=null&&(t=e.options)!=null&&t.directions&&(this.directions=e.options.directions),e.options?.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className&&(this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizing||``}),e.options?.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(`update`,this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type&&(this.node=e,!this.onUpdate||this.onUpdate(e,t,n))}destroy(){this.isResizing&&(this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off(`update`,this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?`inline-flex`:`flex`,this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement(`div`);return e.style.position=`relative`,e.style.display=`block`,e.dataset.resizeWrapper=``,this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement(`div`);return t.dataset.resizeHandle=e,t.style.position=`absolute`,this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes(`top`),r=t.includes(`bottom`),i=t.includes(`left`),a=t.includes(`right`);n&&(e.style.top=`0`),r&&(e.style.bottom=`0`),i&&(e.style.left=`0`),a&&(e.style.right=`0`),(t===`top`||t===`bottom`)&&(e.style.left=`0`,e.style.right=`0`),(t===`left`||t===`right`)&&(e.style.top=`0`,e.style.bottom=`0`)}attachHandles(){this.directions.forEach(e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,qm(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=`true`,this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`touchmove`,this.handleTouchMove),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),a=this.applyConstraints(r,i,n);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,a=e.includes(`right`),o=e.includes(`left`),s=e.includes(`bottom`),c=e.includes(`top`);return a?r=this.startWidth+t:o&&(r=this.startWidth-t),s?i=this.startHeight+n:c&&(i=this.startHeight-n),(e===`right`||e===`left`)&&(r=this.startWidth+(a?t:-t)),(e===`top`||e===`bottom`)&&(i=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return this.maxSize?.width&&(n=Math.min(this.maxSize.width,n)),this.maxSize?.height&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let r=e,i=t;return r<this.minSize.width&&(r=this.minSize.width,i=r/this.aspectRatio),i<this.minSize.height&&(i=this.minSize.height,r=i*this.aspectRatio),this.maxSize?.width&&r>this.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(e,t,n){return n===`left`||n===`right`?{width:e,height:e/this.aspectRatio}:n===`top`||n===`bottom`?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}},B=class e extends vm{constructor(...e){super(...e),this.type=`node`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function Ym(e){return new bm({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=L(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(Ff(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}function Xm(e){return _((t,n)=>({get(){return t(),e},set(t){e=t,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var Zm=class extends Hm{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=Xm(this.view.state),this.reactiveExtensionStorage=Xm(this.extensionStorage),this.on(`beforeTransaction`,({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),c(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){let n=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(e){let t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}},Qm=se({name:`EditorContent`,props:{editor:{default:null,type:Object}},setup(e){let t=d(),n=Ce();return Ie(()=>{let r=e.editor;r&&r.options.element&&t.value&&ye(()=>{if(!t.value||!r.view.dom?.parentNode)return;let e=T(t.value);t.value.append(...r.view.dom.parentNode.childNodes),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:e}),r.createNodeViews()})}),y(()=>{let t=e.editor;t&&(t.contentComponent=null,t.appContext=null)}),{rootEl:t}},render(){return me(`div`,{ref:e=>{this.rootEl=e}})}});se({name:`NodeViewContent`,props:{as:{type:String,default:`div`}},inject:{nodeViewContentRef:{default:void 0}},mounted(){let e=this.nodeViewContentRef;e&&this.$el&&e(this.$el)},beforeUnmount(){let e=this.nodeViewContentRef;e&&e(null)},render(){return me(this.as,{style:{whiteSpace:`pre-wrap`},"data-node-view-content":``})}}),se({name:`NodeViewWrapper`,props:{as:{type:String,default:`div`}},inject:[`onDragStart`,`decorationClasses`],render(){var e;return me(this.as,{class:this.decorationClasses,style:{whiteSpace:`normal`},"data-node-view-wrapper":``,onDragstart:this.onDragStart},(e=this.$slots).default?.call(e))}}),se({name:`MarkViewContent`,props:{as:{type:String,default:`span`}},render(){return me(this.as,{style:{whiteSpace:`inherit`},"data-mark-view-content":``})}});function $m(e,t){if(!t?.schema)return!1;let n=typeof e==`string`?e:e.name;return t.schema.spec.marks.get(n)!==void 0}function eh(e,t){if(!e)return!1;let{selection:n}=e.state,{$from:r,to:i}=n;return t.some(t=>e.state.doc.nodesBetween(r.pos,i,e=>e.type.name===t))}function th(e,t){return e?e.extensionManager.extensions.some(e=>e.name===t):!1}function nh(e){let t=`toggle${e.charAt(0).toUpperCase()}${e.slice(1)}`;return{canExecute:e=>e.can()[t](),execute:e=>e.chain().focus()[t](),isActive:t=>t.isActive(e),isDisabled:e=>eh(e,[`image`])||e.isActive(`code`)}}function rh(e){let t=`set${e.charAt(0).toUpperCase()}${e.slice(1)}`;return{canExecute:e=>e.can()[t](),execute:e=>e.chain().focus()[t](),isActive:t=>t.isActive(e),isDisabled:e=>eh(e,[`image`])||e.isActive(`code`)}}function ih(e){return{canExecute:t=>t.can()[e](),execute:t=>t.chain()[e](),isActive:()=>!1,isDisabled:void 0}}function ah(){return{canExecute:(e,t)=>e.can().toggleMark(t.mark),execute:(e,t)=>e.chain().focus().toggleMark(t.mark),isActive:(e,t)=>e.isActive(t.mark),isDisabled:(e,t)=>!$m(t.mark,e)||eh(e,[`image`])}}function oh(){return{canExecute:(e,t)=>e.can().setTextAlign(t.align),execute:(e,t)=>e.chain().focus().setTextAlign(t.align),isActive:(e,t)=>e.isActive({textAlign:t.align}),isDisabled:e=>!th(e,`textAlign`)||eh(e,[`image`,`horizontalRule`])}}function sh(){return{canExecute:(e,t)=>e.can().toggleHeading({level:t.level}),execute:(e,t)=>e.chain().focus().toggleHeading({level:t.level}),isActive:(e,t)=>e.isActive(`heading`,{level:t.level}),isDisabled:e=>eh(e,[`image`])||e.isActive(`code`)}}function ch(){return{canExecute:e=>e.can().setLink({href:``})||e.can().unsetLink(),execute:(e,t)=>{let n=e.chain(),r=e.getAttributes(`link`).href,i=e.isActive(`code`);if(r)return n.focus().unsetLink();let a=t?.href||prompt(`Enter the URL:`);return a?i?n.focus().extendMarkRange(`code`).setLink({href:a}):n.focus().setLink({href:a}):n},isActive:e=>e.isActive(`link`),isDisabled:e=>{if(!th(e,`link`)||eh(e,[`image`]))return!0;let{selection:t}=e.state;return t.empty&&!e.isActive(`link`)}}}function lh(){return{canExecute:e=>e.can().setImage({src:``}),execute:(e,t)=>{let n=e.chain().focus();if(t?.src)return n.setImage({src:t.src});let r=prompt(`Enter the image URL:`);return r?n.setImage({src:r}):n},isActive:e=>e.isActive(`image`),isDisabled:e=>!th(e,`image`)}}function uh(e){let t={bulletList:`toggleBulletList`,orderedList:`toggleOrderedList`,taskList:`toggleTaskList`}[e],n=e===`taskList`?`taskItem`:`listItem`,r=[`bulletList`,`orderedList`,`taskList`];return{canExecute:e=>e.can()[t]()||e.isActive(`listItem`)||r.some(t=>th(e,t)&&e.isActive(t)),execute:i=>{let{state:a}=i,{selection:o}=a,s=i.chain().focus();if(o.node){let e=o.node,t=e.firstChild?.firstChild,n=e.lastChild?.lastChild,r=t?o.from+t.nodeSize:o.from+1,i=n?o.to-n.nodeSize:o.to-1;s=s.setTextSelection({from:r,to:i}).clearNodes()}if(i.isActive(e)){let e=s.liftListItem(n);for(let t of r)th(i,t)&&(e=e.lift(t));return e.selectTextblockEnd()}if(r.some(e=>th(i,e)&&i.isActive(e))){let e=i.isActive(`taskList`)?`taskItem`:`listItem`,n=s.liftListItem(e);for(let e of r)th(i,e)&&(n=n.lift(e));return n[t]().selectTextblockEnd()}return s[t]().selectTextblockEnd()},isActive:t=>t.isActive(e),isDisabled:t=>!th(t,e)||eh(t,[`image`])||t.isActive(`code`)}}function dh(e){return{canExecute:(t,n)=>{if(n?.pos==null||!t.state.doc.nodeAt(n.pos))return!1;let r=t.state.doc.resolve(n.pos),i=r.parent,a=r.index();return e===`up`?a>0:a<i.childCount-1},execute:(t,n)=>{if(n?.pos==null)return t.chain();let r=t.state.doc.nodeAt(n.pos);if(!r)return t.chain();let i=t.state.doc.resolve(n.pos),a=i.parent,o=i.index();if(e===`up`&&o>0){let e=a.child(o-1),i=n.pos-e.nodeSize;return t.chain().focus().deleteRange({from:n.pos,to:n.pos+r.nodeSize}).insertContentAt(i,r.toJSON())}if(e===`down`&&o<a.childCount-1){let e=a.child(o+1),i=n.pos+e.nodeSize;return t.chain().focus().deleteRange({from:n.pos,to:n.pos+r.nodeSize}).insertContentAt(i,r.toJSON())}return t.chain()},isActive:()=>!1,isDisabled:void 0}}function fh(){return{mark:ah(),textAlign:oh(),heading:sh(),link:ch(),image:lh(),blockquote:nh(`blockquote`),bulletList:uh(`bulletList`),orderedList:uh(`orderedList`),taskList:uh(`taskList`),codeBlock:nh(`codeBlock`),horizontalRule:rh(`horizontalRule`),paragraph:rh(`paragraph`),undo:ih(`undo`),redo:ih(`redo`),clearFormatting:{canExecute:(e,t)=>t?.pos==null?e.can().clearNodes()||e.can().unsetAllMarks():!!e.state.doc.nodeAt(t.pos),execute:(e,t)=>{if(t?.pos!=null){let n=e.state.doc.nodeAt(t.pos);if(!n)return e.chain();let r=t.pos+1,i=t.pos+n.nodeSize-1;return e.chain().focus().setTextSelection({from:r,to:i}).clearNodes().unsetAllMarks()}return e.chain().focus().clearNodes().unsetAllMarks()},isActive:()=>!1,isDisabled:void 0},duplicate:{canExecute:(e,t)=>t?.pos!=null&&!!e.state.doc.nodeAt(t.pos),execute:(e,t)=>{if(t?.pos==null)return e.chain();let n=e.state.doc.nodeAt(t.pos);return n?e.chain().focus().insertContentAt(t.pos+n.nodeSize,n.toJSON()):e.chain()},isActive:()=>!1,isDisabled:void 0},delete:{canExecute:(e,t)=>t?.pos!=null&&!!e.state.doc.nodeAt(t.pos),execute:(e,t)=>{if(t?.pos==null)return e.chain();let n=e.state.doc.nodeAt(t.pos);return n?e.chain().focus().deleteRange({from:t.pos,to:t.pos+n.nodeSize}):e.chain()},isActive:()=>!1,isDisabled:void 0},moveUp:dh(`up`),moveDown:dh(`down`),suggestion:{canExecute:()=>!0,execute:(e,t)=>{let{state:n}=e,{selection:r}=n,{$from:i}=r;if(t?.pos!==void 0){let r=n.doc.nodeAt(t.pos);if(r){let n=t.pos+r.nodeSize;return e.chain().focus().insertContentAt(n,{type:`paragraph`,content:[{type:`text`,text:`/`}]})}}let a=i.node(i.depth),o=i.before(i.depth)+a.nodeSize;return e.chain().focus().insertContentAt(o,{type:`paragraph`,content:[{type:`text`,text:`/`}]})},isActive:()=>!1,isDisabled:void 0},mention:{canExecute:()=>!0,execute:e=>{let{state:t}=e,{selection:n}=t,{$from:r}=n,i=r.parent.textBetween(Math.max(0,r.parentOffset-1),r.parentOffset,void 0,` `),a=i&&i!==` `;return e.chain().focus().insertContent(a?` @`:`@`)},isActive:()=>!1,isDisabled:void 0},emoji:{canExecute:()=>!0,execute:e=>{let{state:t}=e,{selection:n}=t,{$from:r}=n,i=r.parent.textBetween(Math.max(0,r.parentOffset-1),r.parentOffset,void 0,` `),a=i&&i!==` `;return e.chain().focus().insertContent(a?` :`:`:`)},isActive:()=>!1,isDisabled:void 0}}}var ph,mh;if(typeof WeakMap<`u`){let e=new WeakMap;ph=t=>e.get(t),mh=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;ph=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},mh=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var hh=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 ph(e)||mh(e,gh(e))}};function gh(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=_h(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 hh(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&&vh(s,o,e),s}function _h(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 vh(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||=yh(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function yh(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function bh(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 xh=new N(`selectingCells`);function Sh(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 Ch(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 wh(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 Th(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=Sh(t.$head)||Eh(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function Eh(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 Dh(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function Oh(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function kh(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Ah(e,t,n){let r=e.node(-1),i=hh.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 jh(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 Mh(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 Nh(e,t,n){let r=bh(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 V=class e extends k{constructor(e,t=e){let n=e.node(-1),r=hh.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 gi(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(Dh(r)&&Dh(i)&&kh(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 A.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=hh.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=jh(e,0,l)),u>0&&(e=jh(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(E.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new O(E.from(o),1,1)}replace(e,t=O.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?O.empty:t)}let i=k.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new O(E.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=hh.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=hh.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=hh.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=hh.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 Ph(this.$anchorCell.pos,this.$headCell.pos)}};V.prototype.visible=!1,k.jsonID(`cell`,V);var Ph=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&&kh(t,n)?new V(t,n):k.near(n,1)}};function Fh(e){if(!(e.selection instanceof V))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(ll.node(n,n+e.nodeSize,{class:`selectedCell`}))}),F.create(e.doc,t)}function Ih({$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 Lh({$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 Rh(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof j&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=V.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=V.rowSelection(e,e)}else if(!n){let e=hh.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=V.create(i,t+1,n)}}else r instanceof A&&Ih(r)?a=A.create(i,r.from):r instanceof A&&Lh(r)&&(a=A.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var zh=new N(`fix-tables`);function Bh(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)?Bh(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function Vh(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=Hh(e,t,r,n))};return t?t.doc!=e.doc&&Bh(t.doc,e.doc,0,r):e.doc.descendants(r),n}function Hh(e,t,n,r){let i=hh.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,jh(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=bh(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(zh,{fixTables:!0})}function Uh(e){let t=e.selection,n=Th(e),r=n.node(-1),i=n.start(-1),a=hh.get(r);return{...t instanceof V?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function Wh(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;Nh(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,Mh(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?bh(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 Gh(e,t){if(!wh(e))return!1;if(t){let n=Uh(e);t(Wh(e.tr,n,n.left))}return!0}function Kh(e,t){if(!wh(e))return!1;if(t){let n=Uh(e);t(Wh(e.tr,n,n.right))}return!0}function qh(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,jh(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 Jh(e,t){if(!wh(e))return!1;if(t){let n=Uh(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;qh(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=hh.get(e)}t(r)}return!0}function Yh(e,t,n){let r=bh(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 Xh(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;Yh(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?bh(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,bh(r.type.schema).row.create(null,o)),e}function Zh(e,t){if(!wh(e))return!1;if(t){let n=Uh(e);t(Xh(e.tr,n,n.top))}return!0}function Qh(e,t){if(!wh(e))return!1;if(t){let n=Uh(e);t(Xh(e.tr,n,n.bottom))}return!0}function $h(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 eg(e,t){if(!wh(e))return!1;if(t){let n=Uh(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;$h(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=hh.get(n.table)}t(r)}return!0}function tg(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function ng({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 rg(e,t){let n=e.selection;if(!(n instanceof V)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=Uh(e),{map:i}=r;if(ng(i,r))return!1;if(t){let n=e.tr,a={},o=E.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!a[l]&&u){if(a[l]=!0,s==null)s=l,c=u;else{tg(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...Mh(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=tg(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new V(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function ig(e,t){let n=bh(e.schema);return ag(({node:e})=>n[e.type.spec.tableRole])(e,t)}function ag(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof V){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=Ch(r.$from),!i)return!1;a=Sh(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=Uh(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 V&&u.setSelection(new V(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function og(e,t){return function(n,r){if(!wh(n))return!1;let i=Th(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof V?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 sg(e){return function(t,n){if(!wh(t))return!1;if(n){let r=bh(t.schema),i=Uh(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 cg(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 lg(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?sg(e):function(t,n){if(!wh(t))return!1;if(n){let r=bh(t.schema),i=Uh(t),a=t.tr,o=cg(`row`,i,r),s=cg(`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}}lg(`row`,{useDeprecatedLogic:!0}),lg(`column`,{useDeprecatedLogic:!0});var ug=lg(`cell`,{useDeprecatedLogic:!0});function dg(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 fg(e){return function(t,n){if(!wh(t))return!1;let r=dg(Th(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(A.between(e,Oh(e))).scrollIntoView())}return!0}}function pg(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 mg(e,t){let n=e.selection;if(!(n instanceof V))return!1;if(t){let r=e.tr,i=bh(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 O(i,0,0))}),r.docChanged&&t(r)}return!0}function hg(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=_g(bh(o).row,new O(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?_g(bh(o).row,new O(t,n,r)).content:t);else return null;return gg(o,s)}function gg(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(E.empty),n[i]<r){let a=bh(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(E.from(o))}return{height:t.length,width:r,rows:t}}function _g(e,t){let n=e.createAndFill();return new mi(n).replace(0,n.content.size,t).doc}function vg({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(jh(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(E.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(E.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function yg(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=bh(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.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==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,E.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function bg(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 xg(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,jh(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(jh(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function Sg(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=hh.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=hh.get(a),f=d.mapping.maps.length}yg(d,o,a,n,l,u,f)&&p(),bg(d,o,a,n,c,l,s,f)&&p(),bg(d,o,a,n,c,l,u,f)&&p(),xg(d,o,a,n,s,u,c,f)&&p(),xg(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 O(i.rows[e-s],0,0))}p(),d.setSelection(new V(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var Cg=fu({ArrowLeft:Tg(`horiz`,-1),ArrowRight:Tg(`horiz`,1),ArrowUp:Tg(`vert`,-1),ArrowDown:Tg(`vert`,1),"Shift-ArrowLeft":Eg(`horiz`,-1),"Shift-ArrowRight":Eg(`horiz`,1),"Shift-ArrowUp":Eg(`vert`,-1),"Shift-ArrowDown":Eg(`vert`,1),Backspace:mg,"Mod-Backspace":mg,Delete:mg,"Mod-Delete":mg});function wg(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function Tg(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof V)return wg(n,r,k.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=Ag(i,e,t);if(o==null)return!1;if(e==`horiz`)return wg(n,r,k.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=Ah(i,e,t),s;return s=a?k.near(a,1):t<0?k.near(n.doc.resolve(i.before(-1)),-1):k.near(n.doc.resolve(i.after(-1)),1),wg(n,r,s)}}}function Eg(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof V)o=a;else{let r=Ag(i,e,t);if(r==null)return!1;o=new V(n.doc.resolve(r))}let s=Ah(o.$headCell,e,t);return s?wg(n,r,new V(o.$anchorCell,s)):!1}}function Dg(e,t){let n=e.state.doc,r=Sh(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new V(r))),!0):!1}function Og(e,t,n){if(!wh(e.state))return!1;let r=hg(n),i=e.state.selection;if(i instanceof V){r||={width:1,height:1,rows:[E.from(_g(bh(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=hh.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=vg(r,o.right-o.left,o.bottom-o.top),Sg(e.state,e.dispatch,a,o,r),!0}if(r){let t=Th(e.state),n=t.start(-1);return Sg(e.state,e.dispatch,n,hh.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function kg(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=jg(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof V)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=Sh(e.state.selection.$anchor))!=null&&Mg(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=Mg(e,n),i=xh.getState(e.state)==null;if(!r||!kh(t,r)){if(i)r=t;else return}let a=new V(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(xh,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),xh.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(xh,-1))}function o(r){let o=r,s=xh.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(jg(e,o.target)!=n&&(c=Mg(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 Ag(e,t,n){if(!(e.state.selection instanceof A))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 jg(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function Mg(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&&Sh(e.state.doc.resolve(r))||Sh(e.state.doc.resolve(i))}var Ng=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`)),Pg(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,Pg(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function Pg(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 Fg=new N(`tableColumnResizing`);function Ig({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=Ng,lastColumnResizable:i=!0}={}){let a=new M({key:Fg,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=bh(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new Lg(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=Fg.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{Rg(t,n,e,i)},mouseleave:e=>{zg(e)},mousedown:(e,r)=>{Bg(e,r,t,n)}},decorations:e=>{let t=Fg.getState(e);if(t&&t.activeHandle>-1)return Yg(e,t.activeHandle)},nodeViews:{}}});return a}var Lg=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(Fg);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 Dh(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function Rg(e,t,n,r){if(!e.editable)return;let i=Fg.getState(e.state);if(i&&!i.dragging){let a=Hg(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=Ug(e,t,`left`,n):i-t.clientX<=n&&(o=Ug(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=hh.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}Gg(e,o)}}}function zg(e){if(!e.editable)return;let t=Fg.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&Gg(e,-1)}function Bg(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=Fg.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=Vg(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(Fg,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=Fg.getState(e.state);r?.dragging&&(Kg(e,r.activeHandle,Wg(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(Fg,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=Fg.getState(e.state);if(i&&i.dragging){let a=Wg(i.dragging,t,n);qg(e,i.activeHandle,a,r)}}return qg(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function Vg(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 Hg(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function Ug(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=Sh(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=hh.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 Wg(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function Gg(e,t){e.dispatch(e.state.tr.setMeta(Fg,{setHandle:t}))}function Kg(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=hh.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():Jg(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function qg(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=hh.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&&Pg(a,c.firstChild,c,r,s,n)}function Jg(e){return Array(e).fill(0)}function Yg(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return F.empty;let a=hh.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`,Fg.getState(e)?.dragging&&n.push(ll.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(ll.widget(s,c))}}return F.create(e.doc,n)}function Xg({allowTableNodeSelection:e=!1}={}){return new M({key:xh,state:{init(){return null},apply(e,t){let n=e.getMeta(xh);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:Fh,handleDOMEvents:{mousedown:kg},createSelectionBetween(e){return xh.getState(e.state)==null?null:e.state.selection},handleTripleClick:Dg,handleKeyDown:Cg,handlePaste:Og},appendTransaction(t,n,r){return Rh(r,Vh(r,n),e)}})}function Zg(e,t){let n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-i,o=r-n;return new DOMRect(i,n,a,o)}var Qg=class{get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(Re(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(ze(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(Be(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(Ze(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ke(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(ct(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(st(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(Ye(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}get virtualElement(){var e;let{selection:t}=this.editor.state,n=this.getReferencedVirtualElement?.call(this);if(n)return n;if(!((e=this.view)!=null&&(e=e.dom)!=null&&e.parentNode))return;let r=Qf(this.view,t.from,t.to),i={getBoundingClientRect:()=>r,getClientRects:()=>[r]};if(t instanceof j){let e=this.view.nodeDOM(t.from),n=e.dataset.nodeViewWrapper?e:e.querySelector(`[data-node-view-wrapper]`);n&&(e=n),e&&(i={getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>[e.getBoundingClientRect()]})}if(t instanceof V){let{$anchorCell:e,$headCell:n}=t,r=e?e.pos:n.pos,a=n?n.pos:e.pos,o=this.view.nodeDOM(r),s=this.view.nodeDOM(a);if(!o||!s)return;let c=o===s?o.getBoundingClientRect():Zg(o.getBoundingClientRect(),s.getBoundingClientRect());i={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return i}constructor({editor:e,element:t,view:n,pluginKey:r=`bubbleMenu`,updateDelay:i=250,resizeDelay:a=60,shouldShow:o,appendTo:s,getReferencedVirtualElement:c,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:`absolute`,placement:`top`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:t,from:n,to:r})=>{let{doc:i,selection:a}=t,{empty:o}=a,s=!i.textBetween(n,r).length&&dd(t.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||o||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{this.editor.isDestroyed?this.destroy():this.preventHide?this.preventHide=!1:e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);(n||r)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;i||!t&&!n||(this.getShouldShow(r)?(this.show(),this.updatePosition()):this.hide())},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=l?.scrollTarget??window,this.getReferencedVirtualElement=c,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener(`dragstart`,this.dragstartHandler),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;let e=this.virtualElement;e&&Je(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{this.isVisible&&!this.editor.isDestroyed&&this.element.isConnected&&(r.hide?.referenceHidden||r.hide?.escaped?this.element.style.visibility=`hidden`:(this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()))})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!t?.selection.eq(e.state.selection),a=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,a,t)}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:e,from:i,to:a})||!1}show(){var e;this.isVisible||=(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener(`dragstart`,this.dragstartHandler),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},$g=e=>new M({key:typeof e.pluginKey==`string`?new N(e.pluginKey):e.pluginKey,view:t=>new Qg({view:t,...e})});z.create({name:`bubbleMenu`,addOptions(){return{element:null,pluginKey:`bubbleMenu`,updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[$g({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var e_=class{getTextContent(e){return Of(e,{textSerializers:kf(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(Re(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(ze(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(Be(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(Ze(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ke(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(ct(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(st(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(Ye(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}constructor({editor:e,element:t,view:n,pluginKey:r=`floatingMenu`,updateDelay:i=250,resizeDelay:a=60,options:o,appendTo:s,shouldShow:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,a=r.depth===1,o=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&r.parent.childCount===0&&!this.getTextContent(r.parent);return!(!e.hasFocus()||!i||!a||!o||!this.editor.isEditable)},this.floatingUIOptions={strategy:`absolute`,placement:`right`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;i||!t&&!n||(this.getShouldShow(r)?(this.updatePosition(),this.show()):this.hide())},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{this.preventHide?this.preventHide=!1:e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=o?.scrollTarget??window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,c&&(this.shouldShow=c),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,view:this.view,state:t,oldState:e,from:i,to:a})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!((e=this.view)!=null&&(e=e.dom)!=null&&e.parentNode))return;let{selection:t}=this.editor.state,n=Qf(this.view,t.from,t.to);Je({getBoundingClientRect:()=>n,getClientRects:()=>[n]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{r.hide?.referenceHidden||r.hide?.escaped?this.element.style.visibility=`hidden`:(this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate())})}update(e,t){let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,r,t)}show(){var e;this.isVisible||=(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},t_=e=>new M({key:typeof e.pluginKey==`string`?new N(e.pluginKey):e.pluginKey,view:t=>new e_({view:t,...e})});z.create({name:`floatingMenu`,addOptions(){return{element:null,options:{},pluginKey:`floatingMenu`,updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,`updatePosition`),!0)}},addProseMirrorPlugins(){return this.options.element?[t_({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});var n_=se({name:`BubbleMenu`,inheritAttrs:!1,props:{pluginKey:{type:[String,Object],default:void 0},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},resizeDelay:{type:Number,default:void 0},options:{type:Object,default:()=>({})},appendTo:{type:[Object,Function],default:void 0},shouldShow:{type:Function,default:null},getReferencedVirtualElement:{type:Function,default:void 0}},setup(e,{slots:t,attrs:n}){let r=d(null),i=e.pluginKey??new N(`bubbleMenu`);return x(()=>{let{editor:t,options:n,resizeDelay:a,appendTo:o,shouldShow:s,getReferencedVirtualElement:c,updateDelay:l}=e,u=r.value;u&&(u.style.visibility=`hidden`,u.style.position=`absolute`,u.remove(),ye(()=>{t.registerPlugin($g({editor:t,element:u,options:n,pluginKey:i,resizeDelay:a,appendTo:o,shouldShow:s,getReferencedVirtualElement:c,updateDelay:l}))}))}),y(()=>{let{editor:t}=e;t.unregisterPlugin(i)}),()=>me(`div`,{ref:r,...n},t.default?.call(t))}}),r_=se({name:`FloatingMenu`,inheritAttrs:!1,props:{pluginKey:{type:null,default:void 0},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},resizeDelay:{type:Number,default:void 0},options:{type:Object,default:()=>({})},appendTo:{type:[Object,Function],default:void 0},shouldShow:{type:Function,default:null}},setup(e,{slots:t,attrs:n}){let r=d(null),i=e.pluginKey??new N(`floatingMenu`);return x(()=>{let{editor:t,updateDelay:n,resizeDelay:a,options:o,appendTo:s,shouldShow:c}=e,l=r.value;l&&(l.style.visibility=`hidden`,l.style.position=`absolute`,l.remove(),t.registerPlugin(t_({pluginKey:i,editor:t,element:l,updateDelay:n,resizeDelay:a,options:o,appendTo:s,shouldShow:c})))}),y(()=>{let{editor:t}=e;t.unregisterPlugin(i)}),()=>me(`div`,{ref:r,...n},t.default?.call(t))}}),i_={slots:{content:`flex items-center gap-1 bg-default text-highlighted shadow-sm rounded-sm ring ring-default h-6 px-2.5 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_var(--ease-out)] data-[state=closed]:animate-[scale-out_100ms_var(--ease-out)] origin-(--reka-tooltip-content-transform-origin) pointer-events-auto`,arrow:`fill-bg stroke-default`,text:`truncate`,kbds:`hidden lg:inline-flex items-center shrink-0 gap-0.5 not-first-of-type:before:content-['·'] not-first-of-type:before:me-0.5`,kbdsSize:`sm`}},a_={__name:`Tooltip`,props:{text:{type:String,required:!1},kbds:{type:Array,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},reference:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},delayDuration:{type:Number,required:!1},disableHoverableContent:{type:Boolean,required:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1}},emits:[`update:open`],setup(n,{emit:r}){let a=n,o=r,s=we(),c=oe(`tooltip`,a),d=g(),p=it(),m=pe(e(c,`defaultOpen`,`open`,`delayDuration`,`disableHoverableContent`,`disableClosingTrigger`,`ignoreNonKeyboardFocus`),o),_=nt(ue(()=>c.portal)),v=ue(()=>l(c.content,p.content.value,{side:`bottom`,sideOffset:8,collisionPadding:8})),y=ue(()=>l(c.arrow,{rounded:!0})),{getKbdKey:b}=He(),x=h(()=>v.value.ariaLabel||s.content?v.value.ariaLabel:[c.text,...(c.kbds||[]).map(e=>b(typeof e==`object`?e.value:e))].filter(Boolean).join(` `)),S=h(()=>he({extend:i_,...d.ui?.tooltip||{}})({side:v.value.side}));return(e,n)=>(w(),f(T(Ct),t(T(m),{disabled:!(T(c).text||T(c).kbds?.length||s.content)||T(c).disabled}),{default:i(({open:n})=>[s.default||T(c).reference?(w(),f(T(Ot),t({key:0},e.$attrs,{"as-child":``,reference:T(c).reference,class:T(c).class}),{default:i(()=>[ie(e.$slots,`default`,{open:n})]),_:2},1040,[`reference`,`class`])):re(``,!0),De(T(Dt),ce(ge(T(_))),{default:i(()=>[De(T(Se),null,{default:i(()=>[De(T(Et),t(v.value,{"aria-label":x.value,"data-slot":`content`,class:S.value.content({class:[!s.default&&T(c).class,T(c).ui?.content]})}),{default:i(()=>[ie(e.$slots,`content`,{ui:S.value},()=>[T(c).text?(w(),ne(`span`,{key:0,"data-slot":`text`,class:Oe(S.value.text({class:T(c).ui?.text}))},je(T(c).text),3)):re(``,!0),T(c).kbds?.length?(w(),ne(`span`,{key:1,"data-slot":`kbds`,class:Oe(S.value.kbds({class:T(c).ui?.kbds}))},[(w(!0),ne(u,null,te(T(c).kbds,(e,n)=>(w(),f(Qe,t({key:n,size:T(c).ui?.kbdsSize||S.value.kbdsSize()},{ref_for:!0},typeof e==`string`?{value:e}:e),null,16,[`size`]))),128))],2)):re(``,!0)]),T(c).arrow?(w(),f(T(yt),t({key:0},y.value,{"data-slot":`arrow`,class:S.value.arrow({class:T(c).ui?.arrow})}),null,16,[`class`])):re(``,!0)]),_:3},16,[`aria-label`,`class`])]),_:3})]),_:3},16)]),_:3},16,[`disabled`]))}},o_={slots:{root:`focus:outline-none`,base:`flex items-stretch gap-1.5`,group:`flex items-center gap-0.5`,separator:`w-px self-stretch bg-border`},variants:{layout:{bubble:{base:`bg-default border border-default rounded-lg p-1`},floating:{base:`bg-default border border-default rounded-lg p-1`},fixed:{base:``}}}},s_=Object.assign({inheritAttrs:!1},{__name:`EditorToolbar`,props:{as:{type:null,required:!1},color:{type:null,required:!1,default:`neutral`},variant:{type:null,required:!1,default:`ghost`},activeColor:{type:null,required:!1,default:`primary`},activeVariant:{type:null,required:!1,default:`soft`},size:{type:null,required:!1,default:`sm`},items:{type:null,required:!1},editor:{type:Object,required:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},layout:{type:String,required:!1,default:`fixed`},pluginKey:{type:[Object,String],required:!1},updateDelay:{type:Number,required:!1},resizeDelay:{type:Number,required:!1},shouldShow:{type:[Function,null],required:!1},appendTo:{type:Function,required:!1,skipCheck:!0},getReferencedVirtualElement:{type:Function,required:!1},options:{type:Object,required:!1}},setup(e){let n=oe(`editorToolbar`,e),r=g(),a=Pe(`editorHandlers`,h(()=>fh())),s=h(()=>({bubble:n_,floating:r_,fixed:`template`})[n.layout]),c=pe(b(n,`as`,`color`,`variant`,`activeColor`,`activeVariant`,`size`,`items`,`layout`,`editor`,`class`,`ui`)),d=h(()=>l(n.options,{offset:8,shift:{padding:8}})),p=h(()=>he({extend:o_,...r.ui?.editorToolbar||{}})({layout:n.layout})),m=h(()=>n.items?.length?ve(n.items)?n.items:[n.items]:[]);function _(e){return n.editor?.isEditable?`items`in e&&e.items?.length?e.items?.some(e=>_(e))||!1:`kind`in e?(a?.value?.[e.kind])?.isActive(n.editor,e)||!1:e.active??!1:!1}function y(e){if(!n.editor?.isEditable)return!0;if(`items`in e&&e.items?.length){let t=(ve(e.items)?e.items.flat():e.items).filter(e=>e.type!==`separator`&&e.type!==`label`);return t.length===0||t.every(e=>y(e))}if(!(`kind`in e))return e.disabled??!1;let t=a?.value?.[e.kind];return t?t.isDisabled?.(n.editor,e)?!0:!t.canExecute(n.editor,e):!1}function x(e,t){if(!n.editor?.isEditable||y(t))return;if(`items`in t||!(`kind`in t)){if(`onClick`in t)for(let n of Array.isArray(t.onClick)?t.onClick:[t.onClick])n?.(e);return}let r=a?.value?.[t.kind];r&&r.execute(n.editor,t).run()}function S(e){if(e.items)return(ve(e.items)?e.items.flat():e.items).find(e=>`kind`in e&&_(e))}function C(e){let t=v(e,[`kind`,`mark`,`align`,`level`,`href`,`src`,`pos`,`items`,`slot`,`checkedIcon`,`loadingIcon`,`externalIcon`,`content`,`arrow`,`portal`,`modal`,`tooltip`,`onClick`]);if(`items`in e&&e.items?.length){let n=S(e);n?.icon&&(t.icon=n.icon),n?.label&&t.label!==void 0&&(t.label=n.label)}return l(t,{"aria-label":t.label?void 0:e.tooltip?.text,color:n.color,activeColor:n.activeColor,activeVariant:n.activeVariant,variant:n.variant,size:n.size})}function ee(e){let t=o(e,[`size`,`checkedIcon`,`loadingIcon`,`externalIcon`,`content`,`arrow`,`portal`,`modal`,`ui`]);return l(t,{modal:!1,size:n.size})}function ae(e){let t=`children`in e&&Array.isArray(e.children)?e.children.map(ae):void 0;if(!(`kind`in e))return t?{...e,children:t}:e;let n=e;return{...n,...t&&{children:t},active:_(n),disabled:y(n),onSelect:e=>x(e,n)}}function se(e){return e.items?ve(e.items)?e.items.map(e=>e.map(ae)):[e.items.map(ae)]:[]}return(e,r)=>(w(),f(T(Fe),t({as:s.value},s.value===`template`?{...e.$attrs}:{editor:T(n).editor,tabindex:-1,class:p.value.root({class:T(n).ui?.root}),...T(c),options:d.value,...e.$attrs}),{default:i(()=>[De(T(Fe),{as:T(n).as,role:`toolbar`,"data-slot":`base`,class:Oe(p.value.base({class:[T(n).ui?.base,T(n).class]}))},{default:i(()=>[(w(!0),ne(u,null,te(m.value,(r,a)=>(w(),ne(u,{key:`group-${a}`},[Ee(`div`,{role:`group`,"data-slot":`group`,class:Oe(p.value.group({class:T(n).ui?.group}))},[(w(!0),ne(u,null,te(r,(n,r)=>ie(e.$slots,n.slot||`item`,{item:n,index:r,isActive:_,isDisabled:y,onClick:x},()=>[`items`in n&&n.items?.length?(w(),f(rt,t({key:0,ref_for:!0},ee(n),{items:se(n)}),{default:i(()=>[n.tooltip?(w(),f(a_,t({key:0,disabled:y(n)},{ref_for:!0},{...n.tooltip||{}}),{default:i(()=>[De(Ae,t({active:_(n),disabled:y(n)},{ref_for:!0},C(n),{onClick:e=>x(e,n)}),null,16,[`active`,`disabled`,`onClick`])]),_:2},1040,[`disabled`])):(w(),f(Ae,t({key:1,active:_(n),disabled:y(n)},{ref_for:!0},C(n),{onClick:e=>x(e,n)}),null,16,[`active`,`disabled`,`onClick`]))]),_:2},1040,[`items`])):n.tooltip?(w(),f(a_,t({key:1,disabled:y(n)},{ref_for:!0},{...n.tooltip||{}}),{default:i(()=>[De(Ae,t({active:_(n),disabled:y(n)},{ref_for:!0},C(n),{ui:n.ui,onClick:e=>x(e,n)}),null,16,[`active`,`disabled`,`ui`,`onClick`])]),_:2},1040,[`disabled`])):(w(),f(Ae,t({key:2,active:_(n),disabled:y(n)},{ref_for:!0},C(n),{ui:n.ui,onClick:e=>x(e,n)}),null,16,[`active`,`disabled`,`ui`,`onClick`]))],void 0,`group-${a}-${r}`)),128))],2),a<m.value.length-1?(w(),f(T(vt),{key:0,"data-slot":`separator`,class:Oe(p.value.separator({class:T(n).ui?.separator})),orientation:`vertical`},null,8,[`class`])):re(``,!0)],64))),128))]),_:3},8,[`as`,`class`])]),_:3},16,[`as`]))}}),c_={slots:{root:``,content:`relative size-full flex-1`,base:[`w-full outline-none *:my-5 *:first:mt-0 *:last:mb-0 sm:px-8 selection:bg-primary/20`,`[&_p]:leading-7`,`[&_a]:text-primary [&_a]:border-b [&_a]:border-transparent [&_a]:hover:border-primary [&_a]:focus-visible:border-transparent [&_a]:font-medium [&_a]:focus-visible:rounded-xs [&_a]:outline-primary/25 [&_a]:focus-visible:outline-3 [&_a:has(>code)]:focus-visible:outline-0`,`[&_a]:transition-colors`,`[&_a:has(>code)]:border-b-0 [&_a>code]:border-dashed [&_a>code]:outline-primary/25 [&_a:focus-visible>code]:outline-3 [&_a:hover>code]:border-primary [&_a:hover>code]:text-primary [&_a:focus-visible>code]:border-primary [&_a:focus-visible>code]:text-primary`,`[&_a>code]:transition-colors`,`[&_.mention]:text-primary [&_.mention]:font-medium`,`[&_:is(h1,h2,h3,h4,h5,h6)]:text-highlighted [&_:is(h1,h2,h3,h4,h5,h6)]:font-bold`,`[&_h1]:text-3xl`,`[&_h2]:text-2xl`,`[&_h3]:text-xl`,`[&_h4]:text-lg`,`[&_h5]:text-base`,`[&_h6]:text-base`,`[&_:is(h1,h2,h3,h4,h5,h6)>code]:border-dashed [&_:is(h1,h2,h3,h4,h5,h6)>code]:font-bold`,`[&_h2>code]:text-xl/6`,`[&_h3>code]:text-lg/5`,`[&_blockquote]:border-s-4 [&_blockquote]:border-accented [&_blockquote]:ps-4 [&_blockquote]:italic`,`[&_[data-type=horizontalRule]]:my-8 [&_[data-type=horizontalRule]]:py-2`,`[&_hr]:border-t [&_hr]:border-default`,`[&_pre]:text-sm/6 [&_pre]:border [&_pre]:border-muted [&_pre]:bg-muted [&_pre]:rounded-md [&_pre]:px-4 [&_pre]:py-3 [&_pre]:whitespace-pre-wrap [&_pre]:wrap-break-word [&_pre]:overflow-x-auto`,`[&_pre_code]:p-0 [&_pre_code]:text-inherit [&_pre_code]:rounded-none [&_pre_code]:inline [&_pre_code]:border-0 [&_pre_code]:bg-transparent`,`[&_code]:px-1.5 [&_code]:py-0.5 [&_code]:text-sm [&_code]:font-mono [&_code]:font-medium [&_code]:rounded-md [&_code]:inline-block [&_code]:border [&_code]:border-muted [&_code]:text-highlighted [&_code]:bg-muted`,`[&_:is(ul,ol)]:ps-6`,`[&_ul]:list-disc [&_ul]:marker:text-(--ui-border-accented)`,`[&_ol]:list-decimal [&_ol]:marker:text-muted`,`[&_li]:my-1.5 [&_li]:ps-1.5`,`[&_img]:rounded-md [&_img]:block [&_img]:max-w-full [&_img.ProseMirror-selectednode]:outline-2 [&_img.ProseMirror-selectednode]:outline-primary`,`[&_.ProseMirror-selectednode:not(img):not(pre):not([data-node-view-wrapper])]:bg-primary/20`]},variants:{placeholderMode:{firstLine:{base:`[&_:is(p,h1,h2,h3,h4,h5,h6).is-editor-empty:first-child]:before:content-[attr(data-placeholder)] [&_:is(p,h1,h2,h3,h4,h5,h6).is-editor-empty:first-child]:before:text-dimmed [&_:is(p,h1,h2,h3,h4,h5,h6).is-editor-empty:first-child]:before:float-start [&_:is(p,h1,h2,h3,h4,h5,h6).is-editor-empty:first-child]:before:h-0 [&_:is(p,h1,h2,h3,h4,h5,h6).is-editor-empty:first-child]:before:pointer-events-none`},everyLine:{base:`[&_:is(p,h1,h2,h3,h4,h5,h6).is-empty]:before:content-[attr(data-placeholder)] [&_:is(p,h1,h2,h3,h4,h5,h6).is-empty]:before:text-dimmed [&_:is(p,h1,h2,h3,h4,h5,h6).is-empty]:before:float-start [&_:is(p,h1,h2,h3,h4,h5,h6).is-empty]:before:h-0 [&_:is(p,h1,h2,h3,h4,h5,h6).is-empty]:before:pointer-events-none`}}},defaultVariants:{placeholderMode:`everyLine`}},l_=e=>Array.isArray(e)&&e[0]!==null,u_=([,,...e])=>e;function d_(e){switch(typeof e){case`string`:return e;case`number`:case`boolean`:case`bigint`:case`symbol`:return String(e);default:return}}function f_(e){let t=[],n=``,r=!1;for(let i=0;i<e.length;i++){let a=e[i],o=a===`|`&&i>0&&e[i-1]===`\\`;a===`|`&&!o?(r&&n&&(t.push(n.length),n=``),r=!0):r&&(n+=a)}return r&&n&&t.push(n.length),t}function p_(e){let t=[],n=``,r=!1;for(let i=0;i<e.length;i++){let a=e[i],o=a===`|`&&i>0&&e[i-1]===`\\`;a===`|`&&!o?(r&&(t.push(n.trim()),n=``),r=!0):r&&(n+=a)}return n.trim()&&t.push(n.trim()),t}function m_(e){let t=e.split(`
|
|
92
|
+
`),n=[],r=-1;for(let e=0;e<t.length;e++)t[e].trim().startsWith(`|`)?r===-1&&(r=e):r!==-1&&(n.push({start:r,end:e-1}),r=-1);if(r!==-1&&n.push({start:r,end:t.length-1}),n.length===0)return e;let{start:i,end:a}=n[n.length-1];t[i].trim().endsWith(`|`)||(t[i]+=` |`);let o=f_(t[i].trim()).length,s=()=>`| `+Array(o).fill(`---`).join(` | `)+` |`,c=a-i>=1?t[i+1].trim():``,l=c.startsWith(`|`)&&(c.includes(`-`)||c.includes(`:`)),u=t[a].trim();if(u.startsWith(`|`)&&(u.includes(`-`)||u.includes(`:`))){let e=p_(u).map(e=>{let t=e.startsWith(`:`),n=e.endsWith(`:`)&&e.length>1,r=e.replace(/^:/,``).replace(/:$/,``);if(t&&n)return r.length<1&&(r=`-`),`:`+r+`:`;if(t)return r.length<1&&(r=`-`),`:`+r;if(n)return r.length<1&&(r=`-`),r+`:`;for(;r.length<3;)r+=`-`;return r});for(;e.length<o;)e.push(`---`);t[a]=`| `+e.join(` | `)+` |`}else if(u.startsWith(`|`)&&!u.endsWith(`|`)){let e=t[i].trim();for(let n=i+(l?2:1);n<a;n++){let r=t[n].trim();if(r.startsWith(`|`)&&r.endsWith(`|`)&&!r.includes(`-`)){e=r;break}}let n=f_(e),r=p_(u),o=r[r.length-1]??``,s=/(?:\*\*?|__?|~~|`|\$)$/.test(o)||/(?:\*\*|__|~~|`)[^\s*_~`]+$/.test(o),c=`| `+r.map((e,t)=>{let r=n[t]||e.length+2;return e+` `.repeat(Math.max(0,r-e.length-2))}).join(` | `);t[a]=s?c:c+` |`}return l||t.splice(i+1,0,s()),t.join(`
|
|
93
|
+
`)}function h_(e,t={}){if(!e)return e;let n=t.math===!0,r=t.syntax!==!1,i={frontmatter:t.frontmatter===!0,syntax:r,attributes:t.attributes??r,linkMode:t.linkMode??`protocol`,linkPh:t.incompleteLinkPlaceholder??`comark:incomplete-link`,imagePh:t.incompleteImagePlaceholder??`comark:incomplete-image`,blockMath:t.blockMath??n,inlineMath:t.inlineMath??n,links:t.links!==!1,images:t.images!==!1,bold:t.bold!==!1,italic:t.italic!==!1,strikethrough:t.strikethrough!==!1,inlineCode:t.inlineCode!==!1,boldItalic:t.boldItalic!==!1,singleTilde:t.singleTilde!==!1,comparisonOperators:t.comparisonOperators!==!1,htmlTags:t.htmlTags!==!1,tables:t.tables!==!1},a=t.dropTrailingOpeners===!0?Q_(e,i.inlineCode):e,o=v_(a,i),s;return s=o.start<0?o.docEnd===a.length?a:a.slice(0,o.docEnd):a.slice(0,o.start)+L_(a.slice(o.start,o.end),i)+a.slice(o.end,o.docEnd),s=X_(s),i.tables&&o.table&&(s=m_(s)),i.blockMath&&o.mathOpen&&(s+=s.endsWith(`
|
|
94
94
|
`)?`$$`:`
|
|
95
|
-
$$`),o.fmOpen&&o.fmContent&&(s=
|
|
95
|
+
$$`),o.fmOpen&&o.fmContent&&(s=W_(s,`-`,3)),i.syntax&&(s=G_(s,a,o.comps,o.start>=0)),s}var g_=/^<(script|pre|style|textarea)(\s|>|$)/i,__={script:/<\/script\s*>/i,pre:/<\/pre\s*>/i,style:/<\/style\s*>/i,textarea:/<\/textarea\s*>/i};function v_(e,t){let n=e.length,r=[0];for(let t=e.indexOf(`
|
|
96
96
|
`);t!==-1;t=e.indexOf(`
|
|
97
|
-
`,t+1))r.push(t+1);let i=r.length,a=n,o=[],s=0,c=0,l=null,u=!1,d=!1,f=!1,p=!1,m=-1;for(let h=0;h<i;h++){let g=r[h],_=h+1<i?r[h+1]-1:n,v=g;for(;v<_&&
|
|
97
|
+
`,t+1))r.push(t+1);let i=r.length,a=n,o=[],s=0,c=0,l=null,u=!1,d=!1,f=!1,p=!1,m=-1;for(let h=0;h<i;h++){let g=r[h],_=h+1<i?r[h+1]-1:n,v=g;for(;v<_&&C_(e.charCodeAt(v));)v++;let y=_;for(;y>v&&ov(e.charCodeAt(y-1));)y--;let b=v<y?e.charCodeAt(v):-1;if(l!==null){__[l].test(e.slice(g,_))&&(l=null);continue}if(b===60){let t=g_.exec(e.slice(v,y));if(t!==null){let n=t[1].toLowerCase();__[n].test(e.slice(g,_))||(l=n);continue}}if(b===96||b===126){let t=1;for(;v+t<y&&e.charCodeAt(v+t)===b;)t++;if(t>=3){if(s===0){if(!(b===96&&y_(e,v,y))){s=t,c=b,m=h;continue}}else if(b===c&&t>=s&&v+t===y){s=0,m=h;continue}else{m=h;continue}}}if(s!==0)continue;if(b===36&&y-v===2&&e.charCodeAt(v+1)===36){t.blockMath&&(f=!f),m=h;continue}let x=b===45&&y-v===3&&e.charCodeAt(v+1)===45&&e.charCodeAt(v+2)===45;if(h===0&&t.frontmatter&&x)u=!0;else if(u)x?u=!1:b!==-1&&(d=!0);else if(x&&o.length>0){let e=o[o.length-1];e.yaml=!e.yaml}else if(p=b===124,t.syntax&&b===58){let t=1;for(;v+t<y&&e.charCodeAt(v+t)===58;)t++;let n=v+t===y;if(n&&h===i-1&&o.length===0){a=g,i--;break}t>=2&&(!n&&O_(e.charCodeAt(v+t))?o.push({depth:t,indent:e.slice(g,v),yaml:!1}):n&&o.length>0&&o[o.length-1].depth===t&&o.pop())}}let h={start:-1,end:-1,docEnd:a,fmOpen:u,fmContent:d,mathOpen:f,table:p,comps:o};if(s!==0||l!==null||u||f)return h;let g=e=>e+1<i?r[e+1]-1:a,_=i-1;for(;_>0&&g(_)===r[_];)_--;for(;_>m+1&&D_(e,r[_],g(_))&&E_(e,r[_-1],g(_-1));)for(a=r[_]-1,i=_,_--;_>0&&g(_)===r[_];)_--;if(h.docEnd=a,g(_)===r[_]||_<=m)return h;let v=_;for(;v>m+1&&g(v-1)!==r[v-1]&&!w_(e,r[v],g(v));)v--;if(v!==_){let t=!w_(e,r[v],g(v))||E_(e,r[v],g(v));for(let n=v+1;t&&n<=_;n++)w_(e,r[n],g(n))&&(t=!1);t||(v=_)}return v===_&&T_(e,r[_],g(_))&&!E_(e,r[_],g(_))||(h.start=r[v],h.end=g(_)),h}function y_(e,t,n){return n-t<5||e.charCodeAt(n-1)!==96||e.charCodeAt(n-2)!==96||e.charCodeAt(n-3)===96?!1:!e.slice(t+3,n).includes("```")}var b_=/^#{1,6}(\s|$)/,x_=/^(\*{3,}|_{3,}|-{3,})\s*$/,S_=/^\d{1,9}[.)](\s|$)/;function C_(e){return e===32||e===9}function w_(e,t,n){if(t>=n)return!1;if(T_(e,t,n))return!0;let r=t;for(;r<n&&C_(e.charCodeAt(r));)r++;if(r>=n)return!1;let i=e.charCodeAt(r);if(i===96||i===126){let t=1;for(;r+t<n&&e.charCodeAt(r+t)===i;)t++;if(t>=3)return!0}return i===35?b_.test(e.slice(r,n)):i===62||i===124||(i===42||i===95||i===45)&&x_.test(e.slice(r,n))?!0:E_(e,r,n)}function T_(e,t,n){if(t>=n)return!1;if(e.charCodeAt(t)===9)return!0;let r=t;for(;r<n&&e.charCodeAt(r)===32;)r++;return r-t>=4&&r<n}function E_(e,t,n){let r=t;for(;r<n&&C_(e.charCodeAt(r));)r++;if(r>=n)return!1;let i=e.charCodeAt(r);if(i===45||i===43||i===42){let t=r+1<n?e.charCodeAt(r+1):-1;return t===32||t===9}return i>=48&&i<=57&&S_.test(e.slice(r,n))}function D_(e,t,n){let r=t;for(;r<n&&C_(e.charCodeAt(r));)r++;let i=n;for(;i>r&&ov(e.charCodeAt(i-1));)i--;if(r>=i)return!1;let a=e.charCodeAt(r);if(a===45||a===43||a===42)return r+1===i;let o=r;for(;o<i&&e.charCodeAt(o)>=48&&e.charCodeAt(o)<=57;)o++;if(o===r||o===i)return!1;let s=e.charCodeAt(o);return(s===46||s===41)&&o+1===i}function O_(e){return e>=97&&e<=122||e>=65&&e<=90||e===36}var k_=1,A_=2,j_=3,M_=4,N_=5,P_=6,F_=/^\s*(?:[-*+]|\d+[.)]) +$/,I_=/^=?\s*\$?\d/;function L_(e,t){let n=e.length;if(e.charCodeAt(n-1)===32&&e.charCodeAt(n-2)!==32&&n--,n===0)return``;let r=[],i=null,a=0,o=-1,s=0,c=-1,l=!1,u=!1;for(let d=0;d<n;d++){let f=e.charCodeAt(d),p=r.length===0?null:r[r.length-1];if(f===10)a=d+1,l=!1,c=-1;else if(p!==null&&p.k===M_){if(f===96){let t=1;for(;e.charCodeAt(d+t)===96;)t++;t>=p.len?r.pop():d+t===n&&(p.len-=t),d+=t-1}}else if(f===32||f===9||f===13)l=!1;else if(f===92)d++,o=d+1;else if(s>0)f===125&&s--;else if(c>=0)f===62&&(c=-1);else if(f===96){let i=1;for(;e.charCodeAt(d+i)===96;)i++;let a=d+i<n?e.charCodeAt(d+i):-1;t.inlineCode&&a!==-1&&a!==10&&r.push({k:M_,len:i,pos:d}),d+=i-1}else if(f===36){let i=1;for(;e.charCodeAt(d+i)===36;)i++;if(p!==null&&p.k===N_)i>=p.len?r.pop():d+i===n&&(p.len-=i);else{let a=d+i<n?e.charCodeAt(d+i):-1;if(i===1){let n=a>13&&a!==32;t.inlineMath&&n&&!(a>=48&&a<=57)&&e.charCodeAt(d-1)!==58&&r.push({k:N_,len:1,pos:d})}else i===2&&t.blockMath&&a!==-1&&a!==10&&a!==13&&r.push({k:N_,len:2,pos:d})}d+=i-1}else if(p===null||p.k!==N_){if(f===42||f===95){let i=1;for(;e.charCodeAt(d+i)===f;)i++;let a=sv(e,d),s=d+i<n?cv(e,d+i):``,c=a!==``&&!av(a)&&d!==o,m=!c||f===95&&(a===`*`||a===`_`||a===`~`),h=s!==``&&!av(s),g=i===1?t.italic:i===2?t.bold:t.boldItalic;if(f===42){let e=c&&rv(a)&&rv(s);if(!e||l){if(c&&p!==null&&p.k===k_&&(!e||p.len===i)){R_(r,k_,i),l=!0,d+=i-1;continue}if(h&&g){r.push({k:k_,len:i,pos:d}),l=!0,d+=i-1;continue}h&&i===1&&(u=!0)}}else{if(c&&!rv(s)&&p!==null&&p.k===A_){R_(r,A_,i),d+=i-1;continue}m&&h&&g&&r.push({k:A_,len:i,pos:d})}d+=i-1}else if(f===126){let a=1;for(;e.charCodeAt(d+a)===126;)a++;let o=sv(e,d),s=d+a<n?cv(e,d+a):``,c=o!==``&&!av(o);p!==null&&p.k===j_&&c?R_(r,j_,a):a===2&&t.strikethrough&&s!==``&&!av(s)?r.push({k:j_,len:2,pos:d}):a===1&&t.singleTilde&&rv(o)&&rv(s)&&!lv(e,d)&&(i=V_(i,[d,`\\~`])),d+=a-1}else if(f===91){let n=e.charCodeAt(d-1)===33;(n?t.images:t.links)&&r.push({k:P_,len:n?2:1,pos:n?d-1:d})}else{if(f===93){let a=r.length-1;for(;a>=0&&r[a].k!==P_;)a--;if(a<0)continue;let o=r[a];r.length=a;let s=d+1<n?e.charCodeAt(d+1):-1;if(s===40){let t=z_(e,d+2,n);if(t>0){d=t;continue}if(t<0)continue}else if(s===91){let t=d+2;for(;t<n&&e.charCodeAt(t)!==93;)t++;if(t<n){d=t;continue}}else if(!(o.len===2&&d+1===n&&$_(e,o.pos+2,d)))continue;return o.len===2||t.linkMode===`protocol`?H_(e,i,d+1,`(`+(o.len===2?t.imagePh:t.linkPh)+`)`):H_(e,V_(i,[o.pos,``]),d,``)}if(f===60){let t=e.charCodeAt(d+1);(t===47||iv(t))&&(c=d)}else if(f===62)t.comparisonOperators&&F_.test(e.slice(a,d))&&I_.test(e.slice(d+1))&&(i=V_(i,[d,`\\>`]));else if(f===123&&t.attributes){let t=e.charCodeAt(d-1);d>0&&t!==32&&t!==9&&t!==10&&s++}}}}let d=n;if(c>=0&&t.htmlTags){for(d=c;d>0&&(e.charCodeAt(d-1)===32||e.charCodeAt(d-1)===9);)d--;for(;r.length>0&&r[r.length-1].pos>=c;)r.pop()}let f=r.length-1;for(;f>=0&&r[f].k!==P_;)f--;if(f>=0&&$_(e,r[f].pos+r[f].len,d)){let n=r[f];if(n.len===2||t.linkMode===`protocol`)return H_(e,i,d,`](`+(n.len===2?t.imagePh:t.linkPh)+`)`);for(let n=r.length-1;n>=0;n--){let a=r[n];if(a.k===P_){if(r.length=n,a.len===2)return H_(e,i,d,`](`+t.imagePh+`)`);i=V_(i,[a.pos,``])}}}return H_(e,i,d,B_(r,e,t,u))}function R_(e,t,n){let r=n;for(;r>0&&e.length>0;){let n=e[e.length-1];if(n.k!==t)break;r>=n.len?(r-=n.len,e.pop()):(n.len-=r,r=0)}}function z_(e,t,n){let r=1;for(let i=t;i<n;i++){let t=e.charCodeAt(i);if(t===92)i++;else if(t===40)r++;else if(t===41){if(--r===0)return i}else if(t===32||t===9||t===10)return-1}return 0}function B_(e,t,n,r){let i=r&&!n.italic,a=0,o=0,s=-1;for(let t=e.length-1;t>=0;t--)e[t].k===k_&&(a+=e[t].len,o++,s<0&&(s=t));let c=!1;for(let t=s-1;t>=0;t--){let n=e[t].k;if(n===j_||n===A_||n===N_){c=!0;break}}let l=``,u=!1;for(let n=e.length-1;n>=0;n--){let r=e[n];switch(r.k){case k_:if(u||i)break;u=!0,l+=`*`.repeat(o>=2&&c?r.len:a);break;case A_:l+=`_`.repeat(r.len);break;case j_:l+=`~`.repeat(r.len);break;case M_:l+="`".repeat(r.len);break;case N_:l+=r.len===2&&t.lastIndexOf(`
|
|
98
98
|
`)>r.pos?`
|
|
99
|
-
$$`:`$`.repeat(r.len)}}return l}function
|
|
100
|
-
`)+1).trim().replace(
|
|
99
|
+
$$`:`$`.repeat(r.len)}}return l}function V_(e,t){return e===null?[t]:(e.push(t),e)}function H_(e,t,n,r){if(t===null)return n===e.length?r===``?e:e+r:e.slice(0,n)+r;t.length>1&&t.sort(U_);let i=``,a=0;for(let r=0;r<t.length;r++){let[o,s]=t[r];if(o>=n)break;i+=e.slice(a,o)+s,a=o+1}return i+e.slice(a,n)+r}function U_(e,t){return e[0]-t[0]}function W_(e,t,n){let r=e.slice(e.lastIndexOf(`
|
|
100
|
+
`)+1).trim().replace(K_,``);return r.length>0&&r.length<n&&r===t.repeat(r.length)?e.replace(q_,``)+t.repeat(n-r.length):e+(e.endsWith(`
|
|
101
101
|
`)?``:`
|
|
102
|
-
`)+t.repeat(n)}function
|
|
102
|
+
`)+t.repeat(n)}function G_(e,t,n,r){let i=e.lastIndexOf(`
|
|
103
103
|
`)+1,a=r&&/^:[a-z$][\w$-]*\{/i.test(e.slice(i).trimStart());if(!t.includes(`::`)&&!a)return e;let o=-1;for(let t=e.length-1;t>=i;t--){let n=e.charCodeAt(t);if(n===125)break;if(n===123){o=t;break}}if(o>=0){let t=0,n=0;for(let r=o+1;r<e.length;r++){let i=e.charCodeAt(r);i===34?t++:i===39&&n++}e+=(t%2==1?`"`:``)+(n%2==1?`'`:``)+`}`}if(n.length===0)return e;let s=n[n.length-1];if(s.yaml){let t=e.slice(e.lastIndexOf(`
|
|
104
|
-
`)+1).trim().replace(
|
|
104
|
+
`)+1).trim().replace(K_,``);(t===`-`||t===`--`)&&(e=e.replace(q_,``)+`-`.repeat(3-t.length),s.yaml=!1)}let c=e;for(let e=n.length-1;e>=0;e--){let t=n[e];t.yaml&&(c+=`
|
|
105
105
|
`+t.indent+`---`),c+=`
|
|
106
|
-
`+t.indent+`:`.repeat(t.depth)}return c}var
|
|
107
|
-
`);if(t===-1)return e;let n=e.slice(t+1),r=n.trim();if(!
|
|
108
|
-
`)+1).trim();return a===``||a===`---`||
|
|
109
|
-
`,t-1)+1;for(;a<t;){let o=e.charCodeAt(a);if(o===92){a+=2;continue}if(o!==96){a++;continue}let s=1;for(;a+s<t&&e.charCodeAt(a+s)===96;)s++;r===0?(r=s,n=a,i=a+s):s>=r&&(r=0,n=-1,i=-1),a+=s}return r===0?null:{start:n,len:r,end:i}}var
|
|
110
|
-
`||e===`\r`}function sv(e){return e===32||e===9||e===10||e===13}function cv(e,t){if(t<=0)return``;let n=e.charCodeAt(t-1);if(n>=56320&&n<=57343&&t>=2){let n=e.charCodeAt(t-2);if(n>=55296&&n<=56319)return e.slice(t-2,t)}return e[t-1]}function lv(e,t){let n=e.charCodeAt(t);if(n>=55296&&n<=56319){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343)return e.slice(t,t+2)}return e[t]}function uv(e,t){for(let n=t-1;n>=0&&e.charCodeAt(n)!==10;n--)if(e.charCodeAt(n)===126)return dv(e,n,t);for(let n=t+1;n<e.length&&e.charCodeAt(n)!==10;n++)if(e.charCodeAt(n)===126)return dv(e,t,n);return!1}function dv(e,t,n){if(n-t<2||e.charCodeAt(t-1)===126||e.charCodeAt(t+1)===126||e.charCodeAt(n+1)===126)return!1;for(let r=t+1;r<n;r++){let t=e.charCodeAt(r);if(t<48||t>57)return!1}return iv(cv(e,t))&&iv(lv(e,n+1))}var fv=Object.defineProperty,pv=(e,t)=>{let n={};for(var r in e)fv(n,r,{get:e[r],enumerable:!0});return t&&fv(n,Symbol.toStringTag,{value:`Module`}),n},mv=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),hv=String.fromCodePoint??(e=>{let t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t});function gv(e){return e>=55296&&e<=57343||e>1114111?65533:mv.get(e)??e}function _v(e){let t=typeof atob==`function`?atob(e):typeof Buffer.from==`function`?Buffer.from(e,`base64`).toString(`binary`):new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e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(bv||={});var xv=32;function Sv(e){return e>=bv.ZERO&&e<=bv.NINE}function Cv(e){return e>=bv.UPPER_A&&e<=bv.UPPER_F||e>=bv.LOWER_A&&e<=bv.LOWER_F}function wv(e){return e>=bv.UPPER_A&&e<=bv.UPPER_Z||e>=bv.LOWER_A&&e<=bv.LOWER_Z||Sv(e)}function Tv(e){return e===bv.EQUALS||wv(e)}var Ev;(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`})(Ev||={});var Dv;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(Dv||={});var Ov=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Ev.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Dv.Strict,this.runConsumed=0}startEntity(e){this.decodeMode=e,this.state=Ev.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case Ev.EntityStart:return e.charCodeAt(t)===bv.NUM?(this.state=Ev.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Ev.NamedEntity,this.stateNamedEntity(e,t));case Ev.NumericStart:return this.stateNumericStart(e,t);case Ev.NumericDecimal:return this.stateNumericDecimal(e,t);case Ev.NumericHex:return this.stateNumericHex(e,t);case Ev.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|xv)===bv.LOWER_X?(this.state=Ev.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Ev.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(Sv(n)||Cv(n)){let e=n<=bv.NINE?n-bv.ZERO:(n|xv)-bv.LOWER_A+10;this.result=this.result*16+e,this.consumed++,t++}else return this.emitNumericEntity(n,3)}return-1}stateNumericDecimal(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(Sv(n))this.result=this.result*10+(n-bv.ZERO),this.consumed++,t++;else return this.emitNumericEntity(n,2)}return-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===bv.SEMI)this.consumed+=1;else if(this.decodeMode===Dv.Strict)return 0;return this.emitCodePoint(gv(this.result),this.consumed),this.errors&&(e!==bv.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&yv.VALUE_LENGTH)>>14;for(;t<e.length;){if(i===0&&(r&yv.FLAG13)!==0){let a=(r&yv.BRANCH_LENGTH)>>7;if(this.runConsumed===0){let n=r&yv.JUMP_TABLE;if(e.charCodeAt(t)!==n)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed<a;){if(t>=e.length)return-1;let r=this.runConsumed-1,i=n[this.treeIndex+1+(r>>1)],a=r%2==0?i&255:i>>8&255;if(e.charCodeAt(t)!==a)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(a>>1),r=n[this.treeIndex],i=(r&yv.VALUE_LENGTH)>>14}if(t>=e.length)break;let a=e.charCodeAt(t);if(a===bv.SEMI&&i!==0&&(r&yv.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);if(this.treeIndex=Av(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===Dv.Attribute&&(i===0||Tv(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&yv.VALUE_LENGTH)>>14,i!==0){if(a===bv.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Dv.Strict&&(r&yv.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&yv.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~(yv.VALUE_LENGTH|yv.FLAG13):r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case Ev.NamedEntity:return this.result!==0&&(this.decodeMode!==Dv.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ev.NumericDecimal:return this.emitNumericEntity(0,2);case Ev.NumericHex:return this.emitNumericEntity(0,3);case Ev.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ev.EntityStart:return 0}}};function kv(e){let t=``,n=new Ov(e,e=>t+=hv(e));return function(e,r){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);let o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}let o=t+e.slice(i);return t=``,o}}function Av(e,t,n,r){let i=(t&yv.BRANCH_LENGTH)>>7,a=t&yv.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=i+1>>1,s=0,c=i-1;for(;s<=c;){let t=s+c>>>1,i=e[n+(t>>1)]>>(t&1)*8&255;if(i<r)s=t+1;else if(i>r)c=t-1;else return e[n+o+t]}return-1}var jv=kv(vv);function Mv(e,t=Dv.Legacy){return jv(e,t)}function Nv(e){return jv(e,Dv.Strict)}var Pv={};function Fv(e){let t=Pv[e];if(t)return t;t=Pv[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 Iv(e,t){typeof t!=`string`&&(t=Iv.defaultChars);let n=Fv(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})}Iv.defaultChars=`;/?:@&=+$,#`,Iv.componentChars=``;var Lv={};function Rv(e){let t=Lv[e];if(t)return t;t=Lv[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 zv(e,t,n){typeof t!=`string`&&(n=t,t=zv.defaultChars),n===void 0&&(n=!0);let r=Rv(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}zv.defaultChars=`;/?:@&=+$,-_.!~*'()#`,zv.componentChars=`-_.!~*'()`;function Bv(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 Vv(){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 Hv=/^([a-z0-9.+-]+:)/i,Uv=/:[0-9]*$/,Wv=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Gv=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
|
|
111
|
-
`,` `],Kv=[`/`,`?`,`#`],qv=255,Jv=/^[+a-z0-9A-Z_-]{0,63}$/,Yv=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Xv={javascript:!0,"javascript:":!0},Zv={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Qv(e,t){if(e&&e instanceof Vv)return e;let n=new Vv;return n.parse(e,t),n}Vv.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=Wv.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=Hv.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&&Xv[o])&&(a=a.substr(2),this.slashes=!0)),!Xv[o]&&(i||o&&!Zv[o])){let e=-1;for(let t=0;t<Kv.length;t++)r=a.indexOf(Kv[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<Gv.length;t++)r=a.indexOf(Gv[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(Jv)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(Jv)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(Yv);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>qv&&(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),Zv[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},Vv.prototype.parseHost=function(e){let t=Uv.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 $v=Je({decode:()=>Iv,encode:()=>zv,format:()=>Bv,parse:()=>Qv}),ey=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ty=/[\0-\x1F\x7F-\x9F]/,ny=/[\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]/,ry=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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\u1B5A-\u1B60\u1B7D\u1B7E\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\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,iy=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\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-\u20C0\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-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\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-\u31E3\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-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,ay=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,oy=Je({Any:()=>ey,Cc:()=>ty,Cf:()=>ny,P:()=>ry,S:()=>iy,Z:()=>ay});function sy(e){let t={};e||={},t.src_Any=ey.source,t.src_Cc=ty.source,t.src_Z=ay.source,t.src_P=ry.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join(`|`),t.src_ZCc=[t.src_Z,t.src_Cc].join(`|`);let n=`[><|]`;return t.src_pseudo_letter=`(?:(?!${n}|${t.src_ZPCc})${t.src_Any})`,t.src_ip4=`(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)`,t.src_auth=`(?:(?:(?!${t.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,t.src_port=`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`,t.src_host_terminator=`(?=$|${n}|${t.src_ZPCc})(?!${e[`---`]?`-(?!--)|`:`-|`}_|:\\d|\\.-|\\.(?!$|${t.src_ZPCc}))`,t.src_path=`(?:[/?#](?:(?!${t.src_ZCc}|${n}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${t.src_ZCc}|\\]).)*\\]|\\((?:(?!${t.src_ZCc}|[)]).)*\\)|\\{(?:(?!${t.src_ZCc}|[}]).)*\\}|\\"(?:(?!${t.src_ZCc}|["]).)+\\"|\\'(?:(?!${t.src_ZCc}|[']).)+\\'|\\'(?=${t.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${t.src_ZCc}|[.]|$)|`+(e[`---`]?`\\-(?!--(?:[^-]|$))(?:-*)|`:`\\-+|`)+`,(?!${t.src_ZCc}|$)|;(?!${t.src_ZCc}|$)|\\!+(?!${t.src_ZCc}|[!]|$)|\\?(?!${t.src_ZCc}|[?]|$))+|\\/)?`,t.src_email_name=`[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}`,t.src_xn=`xn--[a-z0-9\\-]{1,59}`,t.src_domain_root=`(?:`+t.src_xn+`|${t.src_pseudo_letter}{1,63})`,t.src_domain=`(?:`+t.src_xn+`|(?:${t.src_pseudo_letter})|(?:${t.src_pseudo_letter}(?:-|${t.src_pseudo_letter}){0,61}${t.src_pseudo_letter}))`,t.src_host=`(?:(?:(?:(?:${t.src_domain})\\.)*${t.src_domain}))`,t.tpl_host_fuzzy=`(?:`+t.src_ip4+`|(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${t.src_ZPCc}|>|$))`,t.tpl_email_fuzzy=`(^|${n}|"|\\(|${t.src_ZCc})(${t.src_email_name}@${t.tpl_host_fuzzy_strict})`,t.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${t.src_ZPCc}))((?![$+<=>^\`|\uff5c])${t.tpl_host_port_fuzzy_strict}${t.src_path})`,t.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${t.src_ZPCc}))((?![$+<=>^\`|\uff5c])${t.tpl_host_port_no_ip_fuzzy_strict}${t.src_path})`,t}function cy(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function ly(e){return Object.prototype.toString.call(e)}function uy(e){return ly(e)===`[object String]`}function dy(e){return ly(e)===`[object Object]`}function fy(e){return ly(e)===`[object RegExp]`}function py(e){return ly(e)===`[object Function]`}function my(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var hy={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function gy(e){return Object.keys(e||{}).reduce(function(e,t){return e||hy.hasOwnProperty(t)},!1)}var _y={"http:":{validate:function(e,t,n){let r=e.slice(t);return n.re.http||(n.re.http=RegExp(`^\\/\\/${n.re.src_auth}${n.re.src_host_port_strict}${n.re.src_path}`,`i`)),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":`http:`,"ftp:":`http:`,"//":{validate:function(e,t,n){let r=e.slice(t);return n.re.no_http||(n.re.no_http=RegExp(`^`+n.re.src_auth+`(?:localhost|(?:(?:${n.re.src_domain})\\.)+${n.re.src_domain_root})`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,`i`)),n.re.no_http.test(r)?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){let r=e.slice(t);return n.re.mailto||(n.re.mailto=RegExp(`^${n.re.src_email_name}@${n.re.src_host_strict}`,`i`)),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},vy=`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]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]`,yy=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`.split(`|`);function by(e){return function(t,n){let r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function xy(){return function(e,t){t.normalize(e)}}function Sy(e){let t=e.re=sy(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(vy),n.push(t.src_xn),t.src_tlds=n.join(`|`);function r(e){return e.replace(`%TLDS%`,t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),`i`),t.email_fuzzy_global=RegExp(r(t.tpl_email_fuzzy),`ig`),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),`i`),t.link_fuzzy_global=RegExp(r(t.tpl_link_fuzzy),`ig`),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),`i`),t.link_no_ip_fuzzy_global=RegExp(r(t.tpl_link_no_ip_fuzzy),`ig`),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),`i`);let i=[];e.__compiled__={};function a(e,t){throw Error(`(LinkifyIt) Invalid schema "${e}": ${t}`)}Object.keys(e.__schemas__).forEach(function(t){let n=e.__schemas__[t];if(n===null)return;let r={validate:null,link:null};e.__compiled__[t]=r,dy(n)?(fy(n.validate)?r.validate=by(n.validate):py(n.validate)?r.validate=n.validate:a(t,n),py(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=xy()):uy(n)?i.push(t):a(t,n)}),i.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[``]={validate:null,normalize:xy()};let o=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(my).join(`|`);e.re.schema_test=RegExp(`(^|(?!_)(?:[><\uff5c]|${t.src_ZPCc}))(${o})`,`i`),e.re.schema_search=RegExp(`(^|(?!_)(?:[><\uff5c]|${t.src_ZPCc}))(${o})`,`ig`),e.re.schema_at_start=RegExp(`^${e.re.schema_search.source}`,`i`),e.re.pretest=RegExp(`(${e.re.schema_test.source})|(${e.re.host_fuzzy_test.source})|@`,`i`)}function Cy(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}function wy(e,t){if(!(this instanceof wy))return new wy(e,t);t||gy(e)&&(t=e,e={}),this.__opts__=cy({},hy,t),this.__schemas__=cy({},_y,e),this.__compiled__={},this.__tlds__=yy,this.__tlds_replaced__=!1,this.re={},Sy(this)}wy.prototype.add=function(e,t){return this.__schemas__[e]=t,Sy(this),this},wy.prototype.set=function(e){return this.__opts__=cy(this.__opts__,e),this},wy.prototype.test=function(e){if(!e.length)return!1;let t,n;if(this.re.schema_test.test(e)){for(n=this.re.schema_search,n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__[`http:`]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`]&&e.indexOf(`@`)>=0&&e.match(this.re.email_fuzzy)!==null)},wy.prototype.pretest=function(e){return this.re.pretest.test(e)},wy.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},wy.prototype.match=function(e){let t=[],n=[],r=[],i=[],a,o,s;function c(e,t){return e?t?e.index===t.index?e.lastIndex>=t.lastIndex?e:t:e.index<t.index?e:t:e:t}if(!e.length)return null;if(this.re.schema_test.test(e))for(s=this.re.schema_search,s.lastIndex=0;(a=s.exec(e))!==null;)o=this.testSchemaAt(e,a[2],s.lastIndex),o&&n.push({schema:a[2],index:a.index+a[1].length,lastIndex:a.index+a[0].length+o});if(this.__opts__.fuzzyLink&&this.__compiled__[`http:`])for(s=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)r.push({schema:``,index:a.index+a[1].length,lastIndex:a.index+a[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`])for(s=this.re.email_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)i.push({schema:`mailto:`,index:a.index+a[1].length,lastIndex:a.index+a[0].length});let l=[0,0,0],u=0;for(;;){let a=[n[l[0]],i[l[1]],r[l[2]]],o=c(c(a[0],a[1]),a[2]);if(!o)break;if(o===a[0]?l[0]++:o===a[1]?l[1]++:l[2]++,o.index<u)continue;let s=new Cy(e,o.schema,o.index,o.lastIndex);this.__compiled__[s.schema].normalize(s,this),t.push(s),u=o.lastIndex}return t.length?t:null},wy.prototype.matchAtStart=function(e){if(!e.length)return null;let t=this.re.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 Cy(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r},wy.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),Sy(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Sy(this),this)},wy.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)},wy.prototype.onCompile=function(){};var Ty=2147483647,Ey=36,Dy=1,Oy=26,ky=38,Ay=700,jy=72,My=128,Ny=`-`,Py=/^xn--/,Fy=/[^\0-\x7F]/,Iy=/[\x2E\u3002\uFF0E\uFF61]/g,Ly={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},Ry=35,zy=Math.floor,By=String.fromCharCode;function Vy(e){throw RangeError(Ly[e])}function Hy(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function Uy(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(Iy,`.`);let i=Hy(e.split(`.`),t).join(`.`);return r+i}function Wy(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 Gy=e=>String.fromCodePoint(...e),Ky=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Ey},qy=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Jy=function(e,t,n){let r=0;for(e=n?zy(e/Ay):e>>1,e+=zy(e/t);e>455;r+=Ey)e=zy(e/Ry);return zy(r+36*e/(e+ky))},Yy=function(e){let t=[],n=e.length,r=0,i=My,a=jy,o=e.lastIndexOf(Ny);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&Vy(`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=Ey;;i+=Ey){s>=n&&Vy(`invalid-input`);let o=Ky(e.charCodeAt(s++));o>=Ey&&Vy(`invalid-input`),o>zy((Ty-r)/t)&&Vy(`overflow`),r+=o*t;let c=i<=a?Dy:i>=a+Oy?Oy:i-a;if(o<c)break;let l=Ey-c;t>zy(Ty/l)&&Vy(`overflow`),t*=l}let c=t.length+1;a=Jy(r-o,c,o==0),zy(r/c)>Ty-i&&Vy(`overflow`),i+=zy(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},Xy=function(e){let t=[];e=Wy(e);let n=e.length,r=My,i=0,a=jy;for(let n of e)n<128&&t.push(By(n));let o=t.length,s=o;for(o&&t.push(Ny);s<n;){let n=Ty;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>zy((Ty-i)/c)&&Vy(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>Ty&&Vy(`overflow`),n===r){let e=i;for(let n=Ey;;n+=Ey){let r=n<=a?Dy:n>=a+Oy?Oy:n-a;if(e<r)break;let i=e-r,o=Ey-r;t.push(By(qy(r+i%o,0))),e=zy(i/o)}t.push(By(qy(e,0))),a=Jy(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},Zy={version:`2.3.1`,ucs2:{decode:Wy,encode:Gy},decode:Yy,encode:Xy,toASCII:function(e){return Uy(e,function(e){return Fy.test(e)?`xn--`+Xy(e):e})},toUnicode:function(e){return Uy(e,function(e){return Py.test(e)?Yy(e.slice(4).toLowerCase()):e})}},Qy=pv({arrayReplaceAt:()=>rb,asciiTrim:()=>Tb,assign:()=>nb,escapeHtml:()=>gb,escapeRE:()=>vb,fromCodePoint:()=>ab,has:()=>tb,isMdAsciiPunct:()=>Sb,isPromiseLike:()=>Eb,isPunctChar:()=>bb,isPunctCharCode:()=>xb,isSpace:()=>V,isString:()=>$y,isValidEntityCode:()=>ib,isWhiteSpace:()=>yb,lib:()=>Db,normalizeReference:()=>Cb,unescapeAll:()=>db,unescapeMd:()=>ub});function $y(e){return typeof e==`string`}var eb=Object.prototype.hasOwnProperty;function tb(e,t){return eb.call(e,t)}function nb(e,...t){for(let n of t)if(n){if(typeof n!=`object`)throw TypeError(`source must be object`);Object.assign(e,n)}return e}function rb(e,t,n){return e.slice(0,t).concat(n,e.slice(t+1))}function ib(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 ab(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 ob=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,sb=RegExp(`${ob.source}|&([a-z#][a-z0-9]{1,31});`,`gi`),cb=/^#(x[a-f0-9]{1,8}|\d{1,8})$/i;function lb(e,t){if(t.charCodeAt(0)===35&&cb.test(t)){let n=t[1].toLowerCase()===`x`?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return ib(n)?ab(n):e}let n=Mv(e);return n===e?e:n}function ub(e){return e.includes(`\\`)?e.replace(ob,`$1`):e}function db(e){return!e.includes(`\\`)&&!e.includes(`&`)?e:e.replace(sb,(e,t,n)=>t||lb(e,n))}var fb=/[&<>"]/,pb=/[&<>"]/g,mb={"&":`&`,"<":`<`,">":`>`,'"':`"`};function hb(e){return mb[e]}function gb(e){return fb.test(e)?e.replace(pb,hb):e}var _b=/[.?*+^$[\]\\(){}|-]/g;function vb(e){return e.replace(_b,`\\$&`)}function V(e){switch(e){case 9:case 32:return!0}return!1}function yb(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 bb(e){return ry.test(e)||iy.test(e)}function xb(e){return bb(ab(e))}function Sb(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 Cb(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}function wb(e){return e===32||e===9||e===10||e===13}function Tb(e){let t=0;for(;t<e.length&&wb(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&wb(e.charCodeAt(n));n--);return e.slice(t,n+1)}function Eb(e){return typeof e?.then==`function`}var Db={mdurl:$v,ucmicro:oy},Ob=class{type;tag;attrs=null;map=null;nesting;level=0;children=null;content=``;markup=``;info=``;meta=null;block=!1;hidden=!1;constructor(e,t,n){this.type=e,this.tag=t,this.nesting=n}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}`}},kb=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType=`root`;level=0;Token=Ob;constructor(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r;let i=this.src,a=i.length;for(let e=0;e<a;){let t=i.indexOf(`
|
|
112
|
-
`,e),n=t===-1?a:t,r=0,o=0,s=e;for(;s<n;){let e=i.charCodeAt(s);if(V(e))r++,o+=e===9?4-o%4:1,s++;else break}this.bMarks.push(e),this.eMarks.push(n),this.tShift.push(r),this.sCount.push(o),this.bsCount.push(0),e=n+1}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){let r=new Ob(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e}skipSpaces(e){let t=this.src;for(let n=t.length;e<n&&V(t.charCodeAt(e));e++);return e}skipSpacesBack(e,t){if(e<=t)return e;let n=this.src;for(;e>t;)if(!V(n.charCodeAt(--e)))return e+1;return e}skipChars(e,t){let n=this.src;for(let r=n.length;e<r&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;let r=this.src;for(;e>n;)if(t!==r.charCodeAt(--e))return e+1;return e}getLines(e,t,n,r){if(e>=t)return``;let i=Array(t-e),a=this.src;for(let o=0,s=e;s<t;s++,o++){let e=0,c=this.bMarks[s],l=c,u;for(u=s+1<t||r?this.eMarks[s]+1:this.eMarks[s];l<u&&e<n;){let t=a.charCodeAt(l);if(V(t))t===9?e+=4-(e+this.bsCount[s])%4:e++;else if(l-c<this.tShift[s])e++;else break;l++}e>n?i[o]=` `.repeat(e-n)+this.src.slice(l,u):i[o]=this.src.slice(l,u)}return i.join(``)}},Ab=class{src;env;tokens=[];inlineMode=!1;md;constructor(e,t,n){this.src=e,this.env=n,this.md=t}Token=Ob},jb=class{src;env;md;tokens;tokens_meta;pos=0;posMax;level=0;pending=``;pendingLevel=0;cache={};delimiters=[];_prev_delimiters=[];backticks={};backticksScanned=!1;linkLevel=0;constructor(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.posMax=this.src.length}pushPending(){let e=new Ob(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e}push(e,t,n){this.pending&&this.pushPending();let r=new Ob(e,t,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()??[]),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r}scanDelims(e,t){let n=this.src,r=this.posMax,i=n.charCodeAt(e),a;if(e===0)a=32;else if(e===1)a=this.src.charCodeAt(0),(a&63488)==55296&&(a=65533);else if(a=this.src.charCodeAt(e-1),(a&64512)==56320){let t=this.src.charCodeAt(e-2);a=(t&64512)==55296?65536+(t-55296<<10)+(a-56320):65533}else(a&64512)==55296&&(a=65533);let o=e;for(;o<r&&n.charCodeAt(o)===i;)o++;let s=o-e,c=o<r?this.src.charCodeAt(o):32;if((c&64512)==55296){let e=this.src.charCodeAt(o+1);c=(e&64512)==56320?65536+(c-55296<<10)+(e-56320):65533}else(c&64512)==56320&&(c=65533);let l=Sb(a)||xb(a),u=Sb(c)||xb(c),d=yb(a),f=yb(c),p=!f&&(!u||d||l),m=!d&&(!l||f||u);return{can_open:p&&(t||!m||l),can_close:m&&(t||!p||u),length:s}}Token=Ob},Mb=class{__rules__=[];__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([``]);for(let t of this.__rules__)if(t.enabled)for(let n of t.alt)e.add(n);this.__cache__={};for(let t of e){let e=[];for(let n of this.__rules__)n.enabled&&(!t||n.alt.includes(t))&&e.push(n.fn);this.__cache__[t]=e}}at(e,t,n={}){let r=this.__find__(e),i=n||{};if(r===-1)throw Error(`Parser rule not found: ${e}`);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null}before(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: ${e}`);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null}after(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: ${e}`);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null}push(e,t,n){let r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null}enable(e,t){Array.isArray(e)||(e=[e]);let n=[];for(let r of e){let e=this.__find__(r);if(e<0){if(t)continue;throw Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[e].enabled=!0,n.push(r)}return this.__cache__=null,n}enableOnly(e,t){Array.isArray(e)||(e=[e]);for(let e of this.__rules__)e.enabled=!1;this.enable(e,t)}disable(e,t){Array.isArray(e)||(e=[e]);let n=[];for(let r of e){let e=this.__find__(r);if(e<0){if(t)continue;throw Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[e].enabled=!1,n.push(r)}return this.__cache__=null,n}getRules(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]}};function Nb(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;let s=[],c=[],l=[],u=[],d=e.md.block.ruler.getRules(`blockquote`),f=e.parentType;e.parentType=`blockquote`;let p=!1,m;for(m=t;m<n;m++){let t=e.sCount[m]<e.blkIndent;if(i=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],i>=a)break;if(e.src.charCodeAt(i++)===62&&!t){let t=e.sCount[m]+1,n,r;e.src.charCodeAt(i)===32?(i++,t++,r=!1,n=!0):e.src.charCodeAt(i)===9?(n=!0,(e.bsCount[m]+t)%4==3?(i++,t++,r=!1):r=!0):n=!1;let o=t;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i<a;){let t=e.src.charCodeAt(i);if(V(t))t===9?o+=4-(o+e.bsCount[m]+ +!!r)%4:o++;else break;i++}p=i>=a,c.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+ +!!n,l.push(e.sCount[m]),e.sCount[m]=o-t,u.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let r=!1;for(let t=0,i=d.length;t<i;t++)if(d[t](e,m,n,!0)){r=!0;break}if(r){e.lineMax=m,e.blkIndent!==0&&(s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]-=e.blkIndent);break}s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]=-1}let h=e.blkIndent;e.blkIndent=0;let g=e.push(`blockquote_open`,`blockquote`,1);g.markup=`>`;let _=[t,0];g.map=_,e.md.block.tokenize(e,t,m);let v=e.push(`blockquote_close`,`blockquote`,-1);v.markup=`>`,e.lineMax=o,e.parentType=f,_[1]=e.line;for(let n=0;n<u.length;n++)e.bMarks[n+t]=s[n],e.tShift[n+t]=u[n],e.sCount[n+t]=l[n],e.bsCount[n+t]=c[n];return e.blkIndent=h,!0}function Pb(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;)if(e.isEmpty(r))r++;else if(e.sCount[r]-e.blkIndent>=4)r++,i=r;else break;e.line=i;let a=e.push(`code_block`,`code`,0);return a.content=`${e.getLines(t,i,4+e.blkIndent,!1)}\n`,a.map=[t,e.line],!0}function Fb(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>a)return!1;let o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return!1;let l=e.src.slice(s,i),u=e.src.slice(i,a);if(o===96&&u.includes(String.fromCharCode(o)))return!1;if(r)return!0;let d=t,f=!1;for(;d++,!(d>=n||(i=s=e.bMarks[d]+e.tShift[d],a=e.eMarks[d],i<a&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[d]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-s<c)&&(i=e.skipSpaces(i),!(i<a)))){f=!0;break}c=e.sCount[t],e.line=d+ +!!f;let p=e.push(`fence`,`code`,0);return p.info=u,p.content=e.getLines(t+1,d,c,!0),p.markup=l,p.map=[t,e.line],!0}function Ib(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(i);if(o!==35||i>=a)return!1;let s=1;for(o=e.src.charCodeAt(++i);o===35&&i<a&&s<=6;)s++,o=e.src.charCodeAt(++i);if(s>6||i<a&&!V(o))return!1;if(r)return!0;a=e.skipSpacesBack(a,i);let c=e.skipCharsBack(a,35,i);c>i&&V(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;let l=e.push(`heading_open`,`h${String(s)}`,1);l.markup=`########`.slice(0,s),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=Tb(e.src.slice(i,a)),u.map=[t,e.line],u.children=[];let d=e.push(`heading_close`,`h${String(s)}`,-1);return d.markup=`########`.slice(0,s),!0}function Lb(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t],o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let s=1;for(;a<i;){let t=e.src.charCodeAt(a++);if(t!==o&&!V(t))return!1;t===o&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;let c=e.push(`hr`,`hr`,0);return c.map=[t,e.line],c.markup=String.fromCharCode(o).repeat(s),!0}var Rb=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),zb=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Bb=`<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>`,Vb=RegExp(`^(?:${zb}|${Bb}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),Hb=RegExp(`^(?:${zb}|${Bb})`),Ub=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(${Rb.join(`|`)})(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(`${Hb.source}\\s*$`),/^$/,!1]];function Wb(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<Ub.length&&!Ub[s][0].test(o);s++);if(s===Ub.length)return!1;if(r)return Ub[s][2];let c=t+1,l=Ub[s][1].test(``);if(!Ub[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent&&(l||!e.isEmpty(c)));c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),Ub[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let u=e.push(`html_block`,``,0);return u.map=[t,c],u.content=e.getLines(t,c,e.blkIndent,!0),!0}function Gb(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`);if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.parentType;e.parentType=`paragraph`;let a=0,o,s=t+1;for(;s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let t=e.bMarks[s]+e.tShift[s],n=e.eMarks[s];if(t<n&&(o=e.src.charCodeAt(t),(o===45||o===61)&&(t=e.skipChars(t,o),t=e.skipSpaces(t),t>=n))){a=o===61?1:2;break}}if(e.sCount[s]<0)continue;let t=!1;for(let i=0,a=r.length;i<a;i++)if(r[i](e,s,n,!0)){t=!0;break}if(t)break}if(!a||o===void 0)return e.parentType=i,!1;let c=Tb(e.getLines(t,s,e.blkIndent,!1));e.line=s+1;let l=e.push(`heading_open`,`h${String(a)}`,1);l.markup=String.fromCharCode(o),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=c,u.map=[t,e.line-1],u.children=[];let d=e.push(`heading_close`,`h${String(a)}`,-1);return d.markup=String.fromCharCode(o),e.parentType=i,!0}function Kb(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],i=e.src.charCodeAt(r++);return i!==42&&i!==45&&i!==43||r<n&&!V(e.src.charCodeAt(r))?-1:r}function qb(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],i=n;if(i+1>=r)return-1;let a=e.src.charCodeAt(i++);if(a<48||a>57)return-1;for(;;){if(i>=r)return-1;if(a=e.src.charCodeAt(i++),a>=48&&a<=57){if(i-n>=10)return-1}else{if(a===41||a===46)break;return-1}}return i<r&&(a=e.src.charCodeAt(i),!V(a))?-1:i}function Jb(e,t){let n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type===`paragraph_open`&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function Yb(e,t,n,r){let i,a,o,s,c=t,l=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let u=!1;r&&e.parentType===`paragraph`&&e.sCount[c]>=e.blkIndent&&(u=!0);let d,f,p=qb(e,c);if(p>=0){if(d=!0,o=e.bMarks[c]+e.tShift[c],f=Number(e.src.slice(o,p-1)),u&&f!==1)return!1}else if(p=Kb(e,c),p>=0)d=!1;else return!1;if(u&&e.skipSpaces(p)>=e.eMarks[c])return!1;if(r)return!0;let m=e.src.charCodeAt(p-1),h=e.tokens.length;d?(s=e.push(`ordered_list_open`,`ol`,1),f!==1&&(s.attrs=[[`start`,f.toString()]])):s=e.push(`bullet_list_open`,`ul`,1);let g=[c,0];s.map=g,s.markup=String.fromCharCode(m);let _=!1,v=e.md.block.ruler.getRules(`list`),y=e.parentType;for(e.parentType=`list`;c<n;){a=p,i=e.eMarks[c];let t=e.sCount[c]+p-(e.bMarks[c]+e.tShift[c]),r=t;for(;a<i;){let t=e.src.charCodeAt(a);if(t===9)r+=4-(r+e.bsCount[c])%4;else if(t===32)r++;else break;a++}let u=a,f;f=u>=i?1:r-t,f>4&&(f=1);let h=t+f;s=e.push(`list_item_open`,`li`,1),s.markup=String.fromCharCode(m);let g=[c,0];s.map=g,d&&(s.info=e.src.slice(o,p-1));let y=e.tight,b=e.tShift[c],x=e.sCount[c],S=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=h,e.tight=!0,e.tShift[c]=u-e.bMarks[c],e.sCount[c]=r,u>=i&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||_)&&(l=!1),_=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=S,e.tShift[c]=b,e.sCount[c]=x,e.tight=y,s=e.push(`list_item_close`,`li`,-1),s.markup=String.fromCharCode(m),c=e.line,g[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let ee=!1;for(let t=0,r=v.length;t<r;t++)if(v[t](e,c,n,!0)){ee=!0;break}if(ee)break;if(d){if(p=qb(e,c),p<0)break;o=e.bMarks[c]+e.tShift[c]}else if(p=Kb(e,c),p<0)break;if(m!==e.src.charCodeAt(p-1))break}return s=d?e.push(`ordered_list_close`,`ol`,-1):e.push(`bullet_list_close`,`ul`,-1),s.markup=String.fromCharCode(m),g[1]=c,e.line=c,e.parentType=y,l&&Jb(e,h),!0}function Xb(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`),i=e.parentType,a=t+1;for(e.parentType=`paragraph`;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let t=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,a,n,!0)){t=!0;break}if(t)break}let o=Tb(e.getLines(t,a,e.blkIndent,!1));e.line=a;let s=e.push(`paragraph_open`,`p`,1);s.map=[t,e.line];let c=e.push(`inline`,``,0);return c.content=o,c.map=[t,e.line],c.children=[],e.push(`paragraph_close`,`p`,-1),e.parentType=i,!0}function Zb(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function s(t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let r=e.md.block.ruler.getRules(`reference`),i=e.parentType;e.parentType=`reference`;let a=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,t,n,!0)){a=!0;break}if(e.parentType=i,a)return null}let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return e.src.slice(i,a+1)}let c=e.src.slice(i,a+1);a=c.length;let l=-1;for(i=1;i<a;i++){let e=c.charCodeAt(i);if(e===91)return!1;if(e===93){l=i;break}if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(e===92&&(i++,i<a&&c.charCodeAt(i)===10)){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}}if(l<0||c.charCodeAt(l+1)!==58)return!1;for(i=l+2;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!V(e))break}let u=e.md.helpers.parseLinkDestination(c,i,a);if(!u.ok)return!1;let d=e.md.normalizeLink(u.str);if(!e.md.validateLink(d))return!1;i=u.pos;let f=i,p=o,m=i;for(;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!V(e))break}let h=e.md.helpers.parseLinkTitle(c,i,a);for(;h.can_continue;){let t=s(o);if(t===null)break;c+=t,i=a,a=c.length,o++,h=e.md.helpers.parseLinkTitle(c,i,a,h)}let g;for(i<a&&m!==i&&h.ok?(g=h.str,i=h.pos):(g=``,i=f,o=p);i<a&&V(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10&&g)for(g=``,i=f,o=p;i<a&&V(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10)return!1;let _=Cb(c.slice(1,l));if(!_)return!1;if(r)return!0;e.env.references===void 0&&(e.env.references={}),e.env.references[_]===void 0&&(e.env.references[_]={title:g,href:d}),e.line=o;let v=e.push(`reference`,``,0);return v.map=[t,e.line],v.info=_,v.meta={title:g,href:d},!0}var Qb=65536;function $b(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function ex(e){let t=[],n=e.length,r=0,i=e.charCodeAt(r),a=!1,o=0,s=``;for(;r<n;)i===124&&(a?(s+=e.substring(o,r-1),o=r):(t.push(s+e.substring(o,r)),s=``,o=r+1)),a=i===92,r++,i=e.charCodeAt(r);return t.push(s+e.substring(o)),t}function tx(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let a=e.bMarks[i]+e.tShift[i];if(a>=e.eMarks[i])return!1;let o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[i])return!1;let s=e.src.charCodeAt(a++);if(s!==124&&s!==45&&s!==58&&!V(s)||o===45&&V(s))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!V(t))return!1;a++}let c=$b(e,t+1),l=c.split(`|`),u=[];for(let e=0;e<l.length;e++){let t=l[e].trim();if(!t){if(e===0||e===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(t))return!1;t.charCodeAt(t.length-1)===58?u.push(t.charCodeAt(0)===58?`center`:`right`):t.charCodeAt(0)===58?u.push(`left`):u.push(``)}if(c=$b(e,t).trim(),!c.includes(`|`)||e.sCount[t]-e.blkIndent>=4)return!1;l=ex(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop();let d=l.length;if(d===0||d!==u.length)return!1;if(r)return!0;let f=e.parentType;e.parentType=`table`;let p=e.md.block.ruler.getRules(`blockquote`),m=e.push(`table_open`,`table`,1),h=[t,0];m.map=h;let g=e.push(`thead_open`,`thead`,1);g.map=[t,t+1];let _=e.push(`tr_open`,`tr`,1);_.map=[t,t+1];for(let t=0;t<l.length;t++){let n=e.push(`th_open`,`th`,1);u[t]&&(n.attrs=[[`style`,`text-align:${u[t]}`]]);let r=e.push(`inline`,``,0);r.content=l[t].trim(),r.children=[],e.push(`th_close`,`th`,-1)}e.push(`tr_close`,`tr`,-1),e.push(`thead_close`,`thead`,-1);let v,y=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let r=!1;for(let t=0,a=p.length;t<a;t++)if(p[t](e,i,n,!0)){r=!0;break}if(r||(c=$b(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4||(l=ex(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop(),y+=d-l.length,y>Qb))break;if(i===t+2){let n=e.push(`tbody_open`,`tbody`,1);n.map=v=[t+2,0]}let a=e.push(`tr_open`,`tr`,1);a.map=[i,i+1];for(let t=0;t<d;t++){let n=e.push(`td_open`,`td`,1);u[t]&&(n.attrs=[[`style`,`text-align:${u[t]}`]]);let r=e.push(`inline`,``,0);r.content=l[t]?l[t].trim():``,r.children=[],e.push(`td_close`,`td`,-1)}e.push(`tr_close`,`tr`,-1)}return v&&(e.push(`tbody_close`,`tbody`,-1),v[1]=i),e.push(`table_close`,`table`,-1),h[1]=i,e.parentType=f,e.line=i,!0}var nx=[[`table`,tx,[`paragraph`,`reference`]],[`code`,Pb],[`fence`,Fb,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,Nb,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,Lb,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,Yb,[`paragraph`,`reference`,`blockquote`]],[`reference`,Zb],[`html_block`,Wb,[`paragraph`,`reference`,`blockquote`]],[`heading`,Ib,[`paragraph`,`reference`,`blockquote`]],[`lheading`,Gb],[`paragraph`,Xb]],rx=class{ruler;constructor(){this.ruler=new Mb;for(let e=0;e<nx.length;e++)this.ruler.push(nx[e][0],nx[e][1],{alt:(nx[e][2]||[]).slice()})}tokenize(e,t,n,r){let i=this.ruler.getRules(``),a=i.length,o=e.md.options.maxNesting,s=t,c=!1;for(;s<n&&(e.line=s=e.skipEmptyLines(s),!(s>=n||e.sCount[s]<e.blkIndent));){if(e.level>=o){e.line=n;break}let t=e.line,r=!1;for(let o=0;o<a;o++)if(r=i[o](e,s,n,!1),r){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}if(!r)throw Error(`none of the block rules matched`);e.tight=!c,e.isEmpty(e.line-1)&&(c=!0),s=e.line,s<n&&e.isEmpty(s)&&(c=!0,s++,e.line=s)}}parse(e,t,n,r){if(!e)return;let i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)}State=kb};function ix(e){let t;e.inlineMode?(t=new e.Token(`inline`,``,0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function ax(e){let t=e.tokens;for(let n=0,r=t.length;n<r;n++){let r=t[n];r.type===`inline`&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function ox(e){return/^<a[>\s]/i.test(e)}function sx(e){return/^<\/a\s*>/i.test(e)}function cx(e){if(!e.md.options.linkify)return;let t=e.tokens,n=e.md.linkify;for(let r=0,i=t.length;r<i;r++){if(t[r].type!==`inline`||!n.pretest(t[r].content))continue;let i=t[r].children,a=0;for(let t=i.length-1;t>=0;t--){let r=i[t];if(r.type===`link_close`)for(t--;i[t].level!==r.level&&i[t].type!==`link_open`;)t--;else if(r.type===`html_inline`&&(ox(r.content)&&a>0&&a--,sx(r.content)&&a++),!(a>0)&&r.type===`text`){let a=r.content;if(!n.pretest(a))continue;let o=n.match(a);if(!o?.length)continue;let s=[],c=r.level,l=0,u=+(o[0].index===0&&t>0&&i[t-1].type===`text_special`);for(let t=u;t<o.length;t++){let n=o[t],r=e.md.normalizeLink(n.url);if(!e.md.validateLink(r))continue;let i=n.text;i=n.schema?n.schema===`mailto:`&&!/^mailto:/i.test(i)?e.md.normalizeLinkText(`mailto:${i}`).replace(/^mailto:/,``):e.md.normalizeLinkText(i):e.md.normalizeLinkText(`http://${i}`).replace(/^http:\/\//,``);let u=n.index;if(u>l){let t=new e.Token(`text`,``,0);t.content=a.slice(l,u),t.level=c,s.push(t)}let d=new e.Token(`link_open`,`a`,1);d.attrs=[[`href`,r]],d.level=c++,d.markup=`linkify`,d.info=`auto`,s.push(d);let f=new e.Token(`text`,``,0);f.content=i,f.level=c,s.push(f);let p=new e.Token(`link_close`,`a`,-1);p.level=--c,p.markup=`linkify`,p.info=`auto`,s.push(p),l=n.lastIndex}if(l<a.length){let t=new e.Token(`text`,``,0);t.content=a.slice(l),t.level=c,s.push(t)}i.splice(t,1,...s)}}}}var lx=/\r\n?|\n/g,ux=/\0/g;function dx(e){let t=e.src,n=t.includes(`\r`),r=t.includes(`\0`);(n||r)&&(n&&(t=t.replace(lx,`
|
|
113
|
-
`)),r&&(t=t.replace(ux,`�`)),e.src=t)}var fx=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,px=/\((?:c|tm|r)\)/i,mx=/\((c|tm|r)\)/gi,hx={c:`©`,r:`®`,tm:`™`};function gx(e,t){return hx[t.toLowerCase()]}function _x(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&(r.content=r.content.replace(mx,gx)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function vx(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&fx.test(r.content)&&(r.content=r.content.replace(/\+-/g,`±`).replace(/\.{2,}/g,`…`).replace(/([?!])…/g,`$1..`).replace(/([?!]){4,}/g,`$1$1$1`).replace(/,{2,}/g,`,`).replace(/(^|[^-])---(?=[^-]|$)/gm,`$1—`).replace(/(^|\s)--(?=\s|$)/gm,`$1–`).replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,`$1–`)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function yx(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&(px.test(e.tokens[t].content)&&_x(e.tokens[t].children),fx.test(e.tokens[t].content)&&vx(e.tokens[t].children))}var bx=/['"]/,xx=/['"]/g,Sx=`’`;function Cx(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function wx(e,t){let n=``,r=0;t.sort((e,t)=>e.pos-t.pos);for(let i=0;i<t.length;i++){let a=t[i];n+=e.slice(r,a.pos)+a.ch,r=a.pos+1}return n+e.slice(r)}function Tx(e,t){let n,r=[],i={};for(let a=0;a<e.length;a++){let o=e[a],s=e[a].level;for(n=r.length-1;n>=0&&!(r[n].level<=s);n--);if(r.length=n+1,o.type!==`text`)continue;let c=o.content,l=0,u=c.length;OUTER:for(;l<u;){xx.lastIndex=l;let o=xx.exec(c);if(!o)break;let d=!0,f=!0;l=o.index+1;let p=o[0]===`'`,m=32;if(o.index-1>=0)m=c.charCodeAt(o.index-1);else for(n=a-1;n>=0&&e[n].type!==`softbreak`&&e[n].type!==`hardbreak`;n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let h=32;if(l<u)h=c.charCodeAt(l);else for(n=a+1;n<e.length&&e[n].type!==`softbreak`&&e[n].type!==`hardbreak`;n++)if(e[n].content){h=e[n].content.charCodeAt(0);break}let g=Sb(m)||xb(m),_=Sb(h)||xb(h),v=yb(m),y=yb(h);if(y?d=!1:_&&(v||g||(d=!1)),v?f=!1:g&&(y||_||(f=!1)),h===34&&o[0]===`"`&&m>=48&&m<=57&&(f=d=!1),d&&f&&(d=g,f=_),!d&&!f)p&&Cx(i,a,o.index,Sx);else{if(f)for(n=r.length-1;n>=0;n--){let e=r[n];if(r[n].level<s)break;if(e.single===p&&r[n].level===s){e=r[n];let s,c;p?(s=t.md.options.quotes[2],c=t.md.options.quotes[3]):(s=t.md.options.quotes[0],c=t.md.options.quotes[1]),Cx(i,a,o.index,c),Cx(i,e.token,e.pos,s),r.length=n;continue OUTER}}d?r.push({token:a,pos:o.index,single:p,level:s}):f&&p&&Cx(i,a,o.index,Sx)}}}Object.keys(i).forEach(t=>{e[t].content=wx(e[t].content,i[t])})}function Ex(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&bx.test(e.tokens[t].content)&&Tx(e.tokens[t].children,e)}function Dx(e){let t,n,r=e.tokens,i=r.length;for(let e=0;e<i;e++){if(r[e].type!==`inline`)continue;let i=r[e].children,a=i.length;for(t=0;t<a;t++)i[t].type===`text_special`&&(i[t].type=`text`);for(t=n=0;t<a;t++)i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var Ox=[[`normalize`,dx],[`block`,ix],[`inline`,ax],[`linkify`,cx],[`replacements`,yx],[`smartquotes`,Ex],[`text_join`,Dx]],kx=class{ruler;constructor(){this.ruler=new Mb;for(let e=0;e<Ox.length;e++)this.ruler.push(Ox[e][0],Ox[e][1])}process(e){let t=this.ruler.getRules(``);for(let n=0,r=t.length;n<r;n++)t[n](e)}State=Ab};function Ax(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=db(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)break;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=db(e.slice(t,i)),a.pos=i,a.ok=!0),a}function jx(e,t,n=!1){let r,i=!1,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 Mx(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+=db(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+=db(e.slice(t,a)),o}var Nx={parseLinkDestination:Ax,parseLinkLabel:jx,parseLinkTitle:Mx},Px=/^([\w.!#$%&'*+/=?^`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*)$/i,Fx=/^([a-z][a-z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/i;function Ix(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;let t=e.src.charCodeAt(n);if(t===60)return!1;if(t===62)break}let a=e.src.slice(r+1,n);if(Fx.test(a)){let n=e.md.normalizeLink(a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}if(Px.test(a)){let n=e.md.normalizeLink(`mailto:${a}`);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}return!1}function Lx(e,t){let n=e.pos,r=e.src;if(r.charCodeAt(n)!==96)return!1;let i=n;n++;let a=e.posMax;for(;n<a&&r.charCodeAt(n)===96;)n++;let o=r.slice(i,n),s=o.length;if(e.backticksScanned&&(e.backticks[s]||0)<=i)return t||(e.pending+=o),e.pos+=s,!0;let c=n,l;for(;l=r.indexOf("`",c),l!==-1;){for(c=l+1;c<a&&r.charCodeAt(c)===96;)c++;let i=c-l;if(i===s){if(!t){let t=e.push(`code_inline`,`code`,0);t.markup=o,t.content=r.slice(n,l).replace(/\n/g,` `).replace(/^ (.+) $/,`$1`)}return e.pos=c,!0}e.backticks[i]=l}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=s,!0}function Rx(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,a=[];for(let o=0;o<n;o++){let n=e[o];if(a.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=o),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let s=t[n.marker][(n.open?3:0)+n.length%3],c=r-a[r]-1,l=c;for(;c>s;c-=a[c]+1){let t=e[c];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=c>0&&!e[c-1].open?a[c-1]+1:0;a[o]=o-c+r,a[c]=r,n.open=!1,t.end=o,t.close=!1,l=-1,i=-2;break}}}l!==-1&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=l)}}function zx(e){let t=e.tokens_meta,n=e.tokens_meta.length;Rx(e.delimiters);for(let e=0;e<n;e++){let n=t[e]?.delimiters;n&&Rx(n)}}function Bx(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;let i=e.scanDelims(e.pos,r===42);for(let t=0;t<i.length;t++){let t=e.push(`text`,``,0);t.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function Vx(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let n=t[r];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let i=t[n.end],a=r>0&&t[r-1].end===n.end+1&&t[r-1].marker===n.marker&&t[r-1].token===n.token-1&&t[n.end+1].token===i.token+1,o=String.fromCharCode(n.marker),s=e.tokens[n.token];s.type=a?`strong_open`:`em_open`,s.tag=a?`strong`:`em`,s.nesting=1,s.markup=a?o+o:o,s.content=``;let c=e.tokens[i.token];c.type=a?`strong_close`:`em_close`,c.tag=a?`strong`:`em`,c.nesting=-1,c.markup=a?o+o:o,c.content=``,a&&(e.tokens[t[r-1].token].content=``,e.tokens[t[n.end+1].token].content=``,r--)}}function Hx(e){let t=e.tokens_meta,n=e.tokens_meta.length;Vx(e,e.delimiters);for(let r=0;r<n;r++){let n=t[r]?.delimiters;n&&Vx(e,n)}}var Ux={tokenize:Bx,postProcess:Hx},Wx=/^&#(x[a-f0-9]{1,6}|\d{1,7});/i,Gx=/^&([a-z][a-z0-9]{1,31});/i;function Kx(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let r=e.src.slice(n).match(Wx);if(r){if(!t){let t=r[1][0].toLowerCase()===`x`?Number.parseInt(r[1].slice(1),16):Number.parseInt(r[1],10),n=e.push(`text_special`,``,0);n.content=ib(t)?ab(t):ab(65533),n.markup=r[0],n.info=`entity`}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(Gx);if(r){let n=Nv(r[0]);if(n!==r[0]){if(!t){let t=e.push(`text_special`,``,0);t.content=n,t.markup=r[0],t.info=`entity`}return e.pos+=r[0].length,!0}}}return!1}var qx=[];for(let e=0;e<256;e++)qx.push(0);for(let e of`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.split(``))qx[e.charCodeAt(0)]=1;function Jx(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push(`hardbreak`,`br`,0),n++;n<r&&(i=e.src.charCodeAt(n),V(i));)n++;return e.pos=n,!0}if(i===32){if(!t){let t=e.push(`text_special`,``,0);t.content=`\\`,t.markup=`\\`,t.info=`escape`}return e.pos=n,!0}let a=e.src[n];if(i>=55296&&i<=56319&&n+1<r){let t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(a+=e.src[n+1],n++)}let o=`\\${a}`;if(!t){let t=e.push(`text_special`,``,0);t.content=i<256&&qx[i]!==0?a:o,t.markup=o,t.info=`escape`}return e.pos=n+1,!0}function Yx(e){let t,n,r=0,i=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}function Xx(e){return/^<a[>\s]/i.test(e)}function Zx(e){return/^<\/a\s*>/i.test(e)}function Qx(e){let t=e|32;return t>=97&&t<=122}function $x(e,t){if(!e.md.options.html)return!1;let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!Qx(i))return!1;let a=e.src.slice(r).match(Vb);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],Xx(t.content)&&e.linkLevel++,Zx(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}function eS(e,t){let n,r,i,a,o,s,c,l,u=``,d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(a=m+1,a<f&&e.src.charCodeAt(a)===40){for(a++;a<f&&(n=e.src.charCodeAt(a),V(n)||n===10);a++);if(a>=f)return!1;for(l=a,s=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),s.ok&&(u=e.md.normalizeLink(s.str),e.md.validateLink(u)?a=s.pos:u=``),l=a;a<f&&(n=e.src.charCodeAt(a),V(n)||n===10);a++);if(s=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<f&&l!==a&&s.ok)for(c=s.str,a=s.pos;a<f&&(n=e.src.charCodeAt(a),V(n)||n===10);a++);else c=``;if(a>=f||e.src.charCodeAt(a)!==41)return e.pos=d,!1;a++}else{if(e.env.references===void 0)return!1;if(a<f&&e.src.charCodeAt(a)===91?(l=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?i=e.src.slice(l,a++):a=m+1):a=m+1,i||=e.src.slice(p,m),o=e.env.references[Cb(i)],!o)return e.pos=d,!1;u=o.href,c=o.title}if(!t){r=e.src.slice(p,m);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push(`image`,`img`,0),i=[[`src`,u],[`alt`,``]];n.attrs=i,n.children=t,n.content=r,c&&i.push([`title`,c])}return e.pos=a,e.posMax=f,!0}function tS(e,t){let n,r,i,a,o=``,s=``,c=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let u=e.pos,d=e.posMax,f=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let m=p+1;if(m<d&&e.src.charCodeAt(m)===40){for(l=!1,m++;m<d&&(n=e.src.charCodeAt(m),V(n)||n===10);m++);if(m>=d)return!1;if(c=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?m=i.pos:o=``,c=m;m<d&&(n=e.src.charCodeAt(m),V(n)||n===10);m++);if(i=e.md.helpers.parseLinkTitle(e.src,m,e.posMax),m<d&&c!==m&&i.ok)for(s=i.str,m=i.pos;m<d&&(n=e.src.charCodeAt(m),V(n)||n===10);m++);}(m>=d||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(e.env.references===void 0)return!1;if(m<d&&e.src.charCodeAt(m)===91?(c=m+1,m=e.md.helpers.parseLinkLabel(e,m),m>=0?r=e.src.slice(c,m++):m=p+1):m=p+1,r||=e.src.slice(f,p),a=e.env.references[Cb(r)],!a)return e.pos=u,!1;o=a.href,s=a.title}if(!t){e.pos=f,e.posMax=p;let t=e.push(`link_open`,`a`,1),n=[[`href`,o]];t.attrs=n,s&&n.push([`title`,s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push(`link_close`,`a`,-1)}return e.pos=m,e.posMax=d,!0}var nS=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function rS(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let i=e.pending.match(nS);if(!i)return!1;let a=i[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let s=o.url;if(s.length<=a.length)return!1;let c=s.length;for(;c>0&&s.charCodeAt(c-1)===42;)c--;c!==s.length&&(s=s.slice(0,c));let l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,l]],t.markup=`linkify`,t.info=`auto`;let n=e.push(`text`,``,0);n.content=e.md.normalizeLinkText(s);let r=e.push(`link_close`,`a`,-1);r.markup=`linkify`,r.info=`auto`}return e.pos+=s.length-a.length,!0}function iS(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,i=e.posMax;if(!t){if(r>=0&&e.pending.charCodeAt(r)===32){if(r>=1&&e.pending.charCodeAt(r-1)===32){let t=r-1;for(;t>=1&&e.pending.charCodeAt(t-1)===32;)t--;e.pending=e.pending.slice(0,t),e.push(`hardbreak`,`br`,0)}else e.pending=e.pending.slice(0,-1),e.push(`softbreak`,`br`,0)}else e.push(`softbreak`,`br`,0)}for(n++;n<i&&V(e.src.charCodeAt(n));)n++;return e.pos=n,!0}function aS(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;let s;a%2&&(s=e.push(`text`,``,0),s.content=o,a--);for(let t=0;t<a;t+=2)s=e.push(`text`,``,0),s.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function oS(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==126||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`s_open`,n.tag=`s`,n.nesting=1,n.markup=`~~`,n.content=``,n=e.tokens[o.token],n.type=`s_close`,n.tag=`s`,n.nesting=-1,n.markup=`~~`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`~`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`s_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}function sS(e){let t=e.tokens_meta,n=e.tokens_meta.length;oS(e,e.delimiters);for(let r=0;r<n;r++){let n=t[r]?.delimiters;n&&oS(e,n)}}var cS={tokenize:aS,postProcess:sS};function lS(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function uS(e,t){let n=e.pos,r=e.src;for(;n<e.posMax&&!lS(r.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=r.slice(e.pos,n)),e.pos=n,!0)}var dS=[[`text`,uS],[`linkify`,rS],[`newline`,iS],[`escape`,Jx],[`backticks`,Lx],[`strikethrough`,cS.tokenize],[`emphasis`,Ux.tokenize],[`link`,tS],[`image`,eS],[`autolink`,Ix],[`html_inline`,$x],[`entity`,Kx]],fS=[[`balance_pairs`,zx],[`strikethrough`,cS.postProcess],[`emphasis`,Ux.postProcess],[`fragments_join`,Yx]],pS=class{ruler;ruler2;constructor(){this.ruler=new Mb;for(let e=0;e<dS.length;e++)this.ruler.push(dS[e][0],dS[e][1]);this.ruler2=new Mb;for(let e=0;e<fS.length;e++)this.ruler2.push(fS[e][0],fS[e][1])}skipToken(e){let t=e.pos,n=this.ruler.getRules(``),r=n.length,i=e.md.options.maxNesting,a=e.cache,o=a[t];if(o!==void 0){e.pos=o;return}let s=!1;if(e.level<i){for(let i=0;i<r;i++)if(e.level++,s=n[i](e,!0),e.level--,s){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}else e.pos=e.posMax;s||e.pos++,a[t]=e.pos}tokenize(e){let t=this.ruler.getRules(``),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){let a=e.pos,o=!1;if(e.level<i){for(let r=0;r<n;r++)if(o=t[r](e,!1),o){if(a>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}if(o){if(e.pos>=r)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()}parse(e,t,n,r){let i=new this.State(e,t,n,r);this.tokenize(i);let a=this.ruler2.getRules(``),o=a.length;for(let e=0;e<o;e++)a[e](i)}State=jb},mS=/^(vbscript|javascript|file|data):/,hS=/^data:image\/(gif|png|jpeg|webp);/;function gS(e){let t=e.trim().toLowerCase();return!mS.test(t)||hS.test(t)}var _S=[`http:`,`https:`,`mailto:`];function vS(e){let t=Qv(e,!0);if(t.hostname&&(!t.protocol||_S.includes(t.protocol)))try{t.hostname=Zy.toASCII(t.hostname)}catch{}return zv(Bv(t))}function yS(e){let t=Qv(e,!0);if(t.hostname&&(!t.protocol||_S.includes(t.protocol)))try{t.hostname=Zy.toUnicode(t.hostname)}catch{}return Iv(Bv(t),`${Iv.defaultChars}%`)}var bS={html:!1,linkify:!1,typographer:!1,quotes:`“”‘’`,maxNesting:100},xS=class{inline=new pS;block=new rx;core=new kx;linkify=new wy;validateLink=gS;normalizeLink=vS;normalizeLinkText=yS;helpers={...Nx};options={...bS};parse(e,t={}){if(typeof e!=`string`)throw TypeError(`Input data should be a String`);let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens}parseInline(e,t={}){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens}},SS={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`blockquote`,`code`,`fence`,`heading`,`hr`,`html_block`,`lheading`,`list`,`reference`,`paragraph`]},inline:{rules:[`autolink`,`backticks`,`emphasis`,`entity`,`escape`,`html_inline`,`image`,`link`,`newline`,`text`],rules2:[`balance_pairs`,`emphasis`,`fragments_join`]}}},CS={options:{...bS,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,highlight:null},components:{core:{},block:{},inline:{}}},wS={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`paragraph`]},inline:{rules:[`text`],rules2:[`balance_pairs`,`fragments_join`]}}},TS={};TS.code_inline=function(e,t,n,r,i){let a=e[t];return`<code${i.renderAttrs(a)}>${gb(a.content)}</code>`},TS.code_block=function(e,t,n,r,i){let a=e[t];return`<pre${i.renderAttrs(a)}><code>${gb(e[t].content)}</code></pre>\n`},TS.fence=function(e,t,n,r,i){let a=e[t],o=a.info?db(a.info).trim():``,s=``,c=``;if(o){let e=o.split(/(\s+)/g);s=e[0],c=e.slice(2).join(``)}function l(e){if(e.indexOf(`<pre`)===0)return`${e}\n`;if(o){let t=a.attrIndex(`class`),r=a.attrs?a.attrs.slice():[];t<0?r.push([`class`,n.langPrefix+s]):(r[t]=r[t].slice(),r[t][1]+=` ${n.langPrefix}${s}`);let o={attrs:r};return`<pre><code${i.renderAttrs(o)}>${e}</code></pre>\n`}return`<pre><code${i.renderAttrs(a)}>${e}</code></pre>\n`}let u=(()=>{if(!n.highlight)return gb(a.content);let e=n.highlight(a.content,s,c,r);return Eb(e)?e.then(e=>e||gb(a.content)):e||gb(a.content)})();return Eb(u)?u.then(l):l(u)},TS.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)},TS.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
|
|
106
|
+
`+t.indent+`:`.repeat(t.depth)}return c}var K_=/\u200B/g,q_=/\u200B+$/,J_=/^(?:-{1,2}|={1,2})$/,Y_=/^[A-Za-z_][\w.-]*\s*:/;function X_(e){let t=e.lastIndexOf(`
|
|
107
|
+
`);if(t===-1)return e;let n=e.slice(t+1),r=n.trim();if(!J_.test(r)||n!==r&&/\s$/.test(n))return e;let i=e.slice(0,t),a=i.slice(i.lastIndexOf(`
|
|
108
|
+
`)+1).trim();return a===``||a===`---`||Y_.test(a)?e:e+``}function Z_(e){return e===42||e===95||e===36||e===58||e===96||e===126||e===91||e===123||e===33}function Q_(e,t){let n=e.length;for(;n>0&&ov(e.charCodeAt(n-1));)n--;if(n===0)return e;let r=n;for(;r>0&&Z_(e.charCodeAt(r-1))&&e.charCodeAt(r-2)!==92;)r--;if(r===n)return e;let i=!0,a=!0;for(let t=r;t<n;t++){let n=e.charCodeAt(t);n!==36&&(i=!1),n!==96&&(a=!1)}if(i&&rv(sv(e,r)))return e.slice(0,r)+e.slice(n);if(a&&t){let t=tv(e,r);if(t!==null){if(n-r>=t.len)return e;let i=r-t.end,a=i===1?e.charCodeAt(t.end):-1;return i>1||i===1&&a!==32&&a!==9?e:e.slice(0,ev(e,t.start))+e.slice(n)}}return rv(sv(e,r))?e:e.slice(0,ev(e,r))+e.slice(n)}function $_(e,t,n){for(let r=t;r<n;r++)if(!ov(e.charCodeAt(r)))return!0;return!1}function ev(e,t){let n=e.charCodeAt(t-1);return n===32||n===9?t-1:t}function tv(e,t){let n=-1,r=0,i=-1,a=e.lastIndexOf(`
|
|
109
|
+
`,t-1)+1;for(;a<t;){let o=e.charCodeAt(a);if(o===92){a+=2;continue}if(o!==96){a++;continue}let s=1;for(;a+s<t&&e.charCodeAt(a+s)===96;)s++;r===0?(r=s,n=a,i=a+s):s>=r&&(r=0,n=-1,i=-1),a+=s}return r===0?null:{start:n,len:r,end:i}}var nv=/\p{L}|\p{N}/u;function rv(e){if(e===``)return!1;let t=e.charCodeAt(0);return t<=127?t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122:nv.test(e)}function iv(e){return e>=97&&e<=122||e>=65&&e<=90}function av(e){return e===` `||e===` `||e===`
|
|
110
|
+
`||e===`\r`}function ov(e){return e===32||e===9||e===10||e===13}function sv(e,t){if(t<=0)return``;let n=e.charCodeAt(t-1);if(n>=56320&&n<=57343&&t>=2){let n=e.charCodeAt(t-2);if(n>=55296&&n<=56319)return e.slice(t-2,t)}return e[t-1]}function cv(e,t){let n=e.charCodeAt(t);if(n>=55296&&n<=56319){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343)return e.slice(t,t+2)}return e[t]}function lv(e,t){for(let n=t-1;n>=0&&e.charCodeAt(n)!==10;n--)if(e.charCodeAt(n)===126)return uv(e,n,t);for(let n=t+1;n<e.length&&e.charCodeAt(n)!==10;n++)if(e.charCodeAt(n)===126)return uv(e,t,n);return!1}function uv(e,t,n){if(n-t<2||e.charCodeAt(t-1)===126||e.charCodeAt(t+1)===126||e.charCodeAt(n+1)===126)return!1;for(let r=t+1;r<n;r++){let t=e.charCodeAt(r);if(t<48||t>57)return!1}return rv(sv(e,t))&&rv(cv(e,n+1))}var dv=Object.defineProperty,fv=(e,t)=>{let n={};for(var r in e)dv(n,r,{get:e[r],enumerable:!0});return t&&dv(n,Symbol.toStringTag,{value:`Module`}),n},pv=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),mv=String.fromCodePoint??(e=>{let t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t});function hv(e){return e>=55296&&e<=57343||e>1114111?65533:pv.get(e)??e}function gv(e){let t=typeof atob==`function`?atob(e):typeof Buffer.from==`function`?Buffer.from(e,`base64`).toString(`binary`):new Buffer(e,`base64`).toString(`binary`),n=t.length&-2,r=new Uint16Array(n/2);for(let e=0,i=0;e<n;e+=2){let n=t.charCodeAt(e),a=t.charCodeAt(e+1);r[i++]=n|a<<8}return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WV/LfktAOCLIgD+6SJnemFnAKCaKYADY2Vmb3BycwANLhAuJS4pLiMuLi40LukhcmN1YQABZGkULiEuAAFiZxguHC5hAHIAAKBfKmUAcaAnIgCgWSLlIXJwAKAYIXIAAOA12DTdcABmAADgNdho3WWgQCJhAHQA6ABqD2MAcgAA4DXYzNzjCuQRUC4AAFQuAABYLmIuAAAAAGMubS5wLnQuAAAAAIguki4AAJouJxIqEnQAcgDpAB0ScgAA4DXYNd0AAUFhWy5eLnIA8gDnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg`),vv;(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`})(vv||={});var yv;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(yv||={});var bv=32;function xv(e){return e>=yv.ZERO&&e<=yv.NINE}function Sv(e){return e>=yv.UPPER_A&&e<=yv.UPPER_F||e>=yv.LOWER_A&&e<=yv.LOWER_F}function Cv(e){return e>=yv.UPPER_A&&e<=yv.UPPER_Z||e>=yv.LOWER_A&&e<=yv.LOWER_Z||xv(e)}function wv(e){return e===yv.EQUALS||Cv(e)}var Tv;(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`})(Tv||={});var Ev;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(Ev||={});var Dv=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Tv.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ev.Strict,this.runConsumed=0}startEntity(e){this.decodeMode=e,this.state=Tv.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case Tv.EntityStart:return e.charCodeAt(t)===yv.NUM?(this.state=Tv.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Tv.NamedEntity,this.stateNamedEntity(e,t));case Tv.NumericStart:return this.stateNumericStart(e,t);case Tv.NumericDecimal:return this.stateNumericDecimal(e,t);case Tv.NumericHex:return this.stateNumericHex(e,t);case Tv.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|bv)===yv.LOWER_X?(this.state=Tv.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Tv.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(xv(n)||Sv(n)){let e=n<=yv.NINE?n-yv.ZERO:(n|bv)-yv.LOWER_A+10;this.result=this.result*16+e,this.consumed++,t++}else return this.emitNumericEntity(n,3)}return-1}stateNumericDecimal(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(xv(n))this.result=this.result*10+(n-yv.ZERO),this.consumed++,t++;else return this.emitNumericEntity(n,2)}return-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===yv.SEMI)this.consumed+=1;else if(this.decodeMode===Ev.Strict)return 0;return this.emitCodePoint(hv(this.result),this.consumed),this.errors&&(e!==yv.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&vv.VALUE_LENGTH)>>14;for(;t<e.length;){if(i===0&&(r&vv.FLAG13)!==0){let a=(r&vv.BRANCH_LENGTH)>>7;if(this.runConsumed===0){let n=r&vv.JUMP_TABLE;if(e.charCodeAt(t)!==n)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed<a;){if(t>=e.length)return-1;let r=this.runConsumed-1,i=n[this.treeIndex+1+(r>>1)],a=r%2==0?i&255:i>>8&255;if(e.charCodeAt(t)!==a)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(a>>1),r=n[this.treeIndex],i=(r&vv.VALUE_LENGTH)>>14}if(t>=e.length)break;let a=e.charCodeAt(t);if(a===yv.SEMI&&i!==0&&(r&vv.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);if(this.treeIndex=kv(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===Ev.Attribute&&(i===0||wv(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&vv.VALUE_LENGTH)>>14,i!==0){if(a===yv.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Ev.Strict&&(r&vv.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&vv.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~(vv.VALUE_LENGTH|vv.FLAG13):r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case Tv.NamedEntity:return this.result!==0&&(this.decodeMode!==Ev.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Tv.NumericDecimal:return this.emitNumericEntity(0,2);case Tv.NumericHex:return this.emitNumericEntity(0,3);case Tv.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Tv.EntityStart:return 0}}};function Ov(e){let t=``,n=new Dv(e,e=>t+=mv(e));return function(e,r){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);let o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}let o=t+e.slice(i);return t=``,o}}function kv(e,t,n,r){let i=(t&vv.BRANCH_LENGTH)>>7,a=t&vv.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=i+1>>1,s=0,c=i-1;for(;s<=c;){let t=s+c>>>1,i=e[n+(t>>1)]>>(t&1)*8&255;if(i<r)s=t+1;else if(i>r)c=t-1;else return e[n+o+t]}return-1}var Av=Ov(_v);function jv(e,t=Ev.Legacy){return Av(e,t)}function Mv(e){return Av(e,Ev.Strict)}var Nv={};function Pv(e){let t=Nv[e];if(t)return t;t=Nv[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 Fv(e,t){typeof t!=`string`&&(t=Fv.defaultChars);let n=Pv(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})}Fv.defaultChars=`;/?:@&=+$,#`,Fv.componentChars=``;var Iv={};function Lv(e){let t=Iv[e];if(t)return t;t=Iv[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 Rv(e,t,n){typeof t!=`string`&&(n=t,t=Rv.defaultChars),n===void 0&&(n=!0);let r=Lv(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}Rv.defaultChars=`;/?:@&=+$,-_.!~*'()#`,Rv.componentChars=`-_.!~*'()`;function zv(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 Bv(){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 Vv=/^([a-z0-9.+-]+:)/i,Hv=/:[0-9]*$/,Uv=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Wv=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
|
|
111
|
+
`,` `],Gv=[`/`,`?`,`#`],Kv=255,qv=/^[+a-z0-9A-Z_-]{0,63}$/,Jv=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Yv={javascript:!0,"javascript:":!0},Xv={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Zv(e,t){if(e&&e instanceof Bv)return e;let n=new Bv;return n.parse(e,t),n}Bv.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=Uv.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=Vv.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&&Yv[o])&&(a=a.substr(2),this.slashes=!0)),!Yv[o]&&(i||o&&!Xv[o])){let e=-1;for(let t=0;t<Gv.length;t++)r=a.indexOf(Gv[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<Wv.length;t++)r=a.indexOf(Wv[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(qv)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(qv)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(Jv);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>Kv&&(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),Xv[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},Bv.prototype.parseHost=function(e){let t=Hv.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 Qv=Ue({decode:()=>Fv,encode:()=>Rv,format:()=>zv,parse:()=>Zv}),$v=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ey=/[\0-\x1F\x7F-\x9F]/,ty=/[\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]/,ny=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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\u1B5A-\u1B60\u1B7D\u1B7E\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\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,ry=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\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-\u20C0\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-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\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-\u31E3\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-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,iy=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,ay=Ue({Any:()=>$v,Cc:()=>ey,Cf:()=>ty,P:()=>ny,S:()=>ry,Z:()=>iy});function oy(e){let t={};e||={},t.src_Any=$v.source,t.src_Cc=ey.source,t.src_Z=iy.source,t.src_P=ny.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join(`|`),t.src_ZCc=[t.src_Z,t.src_Cc].join(`|`);let n=`[><|]`;return t.src_pseudo_letter=`(?:(?!${n}|${t.src_ZPCc})${t.src_Any})`,t.src_ip4=`(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)`,t.src_auth=`(?:(?:(?!${t.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,t.src_port=`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`,t.src_host_terminator=`(?=$|${n}|${t.src_ZPCc})(?!${e[`---`]?`-(?!--)|`:`-|`}_|:\\d|\\.-|\\.(?!$|${t.src_ZPCc}))`,t.src_path=`(?:[/?#](?:(?!${t.src_ZCc}|${n}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${t.src_ZCc}|\\]).)*\\]|\\((?:(?!${t.src_ZCc}|[)]).)*\\)|\\{(?:(?!${t.src_ZCc}|[}]).)*\\}|\\"(?:(?!${t.src_ZCc}|["]).)+\\"|\\'(?:(?!${t.src_ZCc}|[']).)+\\'|\\'(?=${t.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${t.src_ZCc}|[.]|$)|`+(e[`---`]?`\\-(?!--(?:[^-]|$))(?:-*)|`:`\\-+|`)+`,(?!${t.src_ZCc}|$)|;(?!${t.src_ZCc}|$)|\\!+(?!${t.src_ZCc}|[!]|$)|\\?(?!${t.src_ZCc}|[?]|$))+|\\/)?`,t.src_email_name=`[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}`,t.src_xn=`xn--[a-z0-9\\-]{1,59}`,t.src_domain_root=`(?:`+t.src_xn+`|${t.src_pseudo_letter}{1,63})`,t.src_domain=`(?:`+t.src_xn+`|(?:${t.src_pseudo_letter})|(?:${t.src_pseudo_letter}(?:-|${t.src_pseudo_letter}){0,61}${t.src_pseudo_letter}))`,t.src_host=`(?:(?:(?:(?:${t.src_domain})\\.)*${t.src_domain}))`,t.tpl_host_fuzzy=`(?:`+t.src_ip4+`|(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${t.src_ZPCc}|>|$))`,t.tpl_email_fuzzy=`(^|${n}|"|\\(|${t.src_ZCc})(${t.src_email_name}@${t.tpl_host_fuzzy_strict})`,t.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${t.src_ZPCc}))((?![$+<=>^\`|\uff5c])${t.tpl_host_port_fuzzy_strict}${t.src_path})`,t.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${t.src_ZPCc}))((?![$+<=>^\`|\uff5c])${t.tpl_host_port_no_ip_fuzzy_strict}${t.src_path})`,t}function sy(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function cy(e){return Object.prototype.toString.call(e)}function ly(e){return cy(e)===`[object String]`}function uy(e){return cy(e)===`[object Object]`}function dy(e){return cy(e)===`[object RegExp]`}function fy(e){return cy(e)===`[object Function]`}function py(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var my={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function hy(e){return Object.keys(e||{}).reduce(function(e,t){return e||my.hasOwnProperty(t)},!1)}var gy={"http:":{validate:function(e,t,n){let r=e.slice(t);return n.re.http||(n.re.http=RegExp(`^\\/\\/${n.re.src_auth}${n.re.src_host_port_strict}${n.re.src_path}`,`i`)),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":`http:`,"ftp:":`http:`,"//":{validate:function(e,t,n){let r=e.slice(t);return n.re.no_http||(n.re.no_http=RegExp(`^`+n.re.src_auth+`(?:localhost|(?:(?:${n.re.src_domain})\\.)+${n.re.src_domain_root})`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,`i`)),n.re.no_http.test(r)?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){let r=e.slice(t);return n.re.mailto||(n.re.mailto=RegExp(`^${n.re.src_email_name}@${n.re.src_host_strict}`,`i`)),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},_y=`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]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]`,vy=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`.split(`|`);function yy(e){return function(t,n){let r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function by(){return function(e,t){t.normalize(e)}}function xy(e){let t=e.re=oy(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(_y),n.push(t.src_xn),t.src_tlds=n.join(`|`);function r(e){return e.replace(`%TLDS%`,t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),`i`),t.email_fuzzy_global=RegExp(r(t.tpl_email_fuzzy),`ig`),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),`i`),t.link_fuzzy_global=RegExp(r(t.tpl_link_fuzzy),`ig`),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),`i`),t.link_no_ip_fuzzy_global=RegExp(r(t.tpl_link_no_ip_fuzzy),`ig`),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),`i`);let i=[];e.__compiled__={};function a(e,t){throw Error(`(LinkifyIt) Invalid schema "${e}": ${t}`)}Object.keys(e.__schemas__).forEach(function(t){let n=e.__schemas__[t];if(n===null)return;let r={validate:null,link:null};e.__compiled__[t]=r,uy(n)?(dy(n.validate)?r.validate=yy(n.validate):fy(n.validate)?r.validate=n.validate:a(t,n),fy(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=by()):ly(n)?i.push(t):a(t,n)}),i.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[``]={validate:null,normalize:by()};let o=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(py).join(`|`);e.re.schema_test=RegExp(`(^|(?!_)(?:[><\uff5c]|${t.src_ZPCc}))(${o})`,`i`),e.re.schema_search=RegExp(`(^|(?!_)(?:[><\uff5c]|${t.src_ZPCc}))(${o})`,`ig`),e.re.schema_at_start=RegExp(`^${e.re.schema_search.source}`,`i`),e.re.pretest=RegExp(`(${e.re.schema_test.source})|(${e.re.host_fuzzy_test.source})|@`,`i`)}function Sy(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}function Cy(e,t){if(!(this instanceof Cy))return new Cy(e,t);t||hy(e)&&(t=e,e={}),this.__opts__=sy({},my,t),this.__schemas__=sy({},gy,e),this.__compiled__={},this.__tlds__=vy,this.__tlds_replaced__=!1,this.re={},xy(this)}Cy.prototype.add=function(e,t){return this.__schemas__[e]=t,xy(this),this},Cy.prototype.set=function(e){return this.__opts__=sy(this.__opts__,e),this},Cy.prototype.test=function(e){if(!e.length)return!1;let t,n;if(this.re.schema_test.test(e)){for(n=this.re.schema_search,n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__[`http:`]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`]&&e.indexOf(`@`)>=0&&e.match(this.re.email_fuzzy)!==null)},Cy.prototype.pretest=function(e){return this.re.pretest.test(e)},Cy.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},Cy.prototype.match=function(e){let t=[],n=[],r=[],i=[],a,o,s;function c(e,t){return e?t?e.index===t.index?e.lastIndex>=t.lastIndex?e:t:e.index<t.index?e:t:e:t}if(!e.length)return null;if(this.re.schema_test.test(e))for(s=this.re.schema_search,s.lastIndex=0;(a=s.exec(e))!==null;)o=this.testSchemaAt(e,a[2],s.lastIndex),o&&n.push({schema:a[2],index:a.index+a[1].length,lastIndex:a.index+a[0].length+o});if(this.__opts__.fuzzyLink&&this.__compiled__[`http:`])for(s=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)r.push({schema:``,index:a.index+a[1].length,lastIndex:a.index+a[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`])for(s=this.re.email_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)i.push({schema:`mailto:`,index:a.index+a[1].length,lastIndex:a.index+a[0].length});let l=[0,0,0],u=0;for(;;){let a=[n[l[0]],i[l[1]],r[l[2]]],o=c(c(a[0],a[1]),a[2]);if(!o)break;if(o===a[0]?l[0]++:o===a[1]?l[1]++:l[2]++,o.index<u)continue;let s=new Sy(e,o.schema,o.index,o.lastIndex);this.__compiled__[s.schema].normalize(s,this),t.push(s),u=o.lastIndex}return t.length?t:null},Cy.prototype.matchAtStart=function(e){if(!e.length)return null;let t=this.re.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 Sy(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r},Cy.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),xy(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,xy(this),this)},Cy.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)},Cy.prototype.onCompile=function(){};var wy=2147483647,Ty=36,Ey=1,Dy=26,Oy=38,ky=700,Ay=72,jy=128,My=`-`,Ny=/^xn--/,Py=/[^\0-\x7F]/,Fy=/[\x2E\u3002\uFF0E\uFF61]/g,Iy={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},Ly=35,Ry=Math.floor,zy=String.fromCharCode;function By(e){throw RangeError(Iy[e])}function Vy(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function Hy(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(Fy,`.`);let i=Vy(e.split(`.`),t).join(`.`);return r+i}function Uy(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 Wy=e=>String.fromCodePoint(...e),Gy=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Ty},Ky=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},qy=function(e,t,n){let r=0;for(e=n?Ry(e/ky):e>>1,e+=Ry(e/t);e>455;r+=Ty)e=Ry(e/Ly);return Ry(r+36*e/(e+Oy))},Jy=function(e){let t=[],n=e.length,r=0,i=jy,a=Ay,o=e.lastIndexOf(My);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&By(`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=Ty;;i+=Ty){s>=n&&By(`invalid-input`);let o=Gy(e.charCodeAt(s++));o>=Ty&&By(`invalid-input`),o>Ry((wy-r)/t)&&By(`overflow`),r+=o*t;let c=i<=a?Ey:i>=a+Dy?Dy:i-a;if(o<c)break;let l=Ty-c;t>Ry(wy/l)&&By(`overflow`),t*=l}let c=t.length+1;a=qy(r-o,c,o==0),Ry(r/c)>wy-i&&By(`overflow`),i+=Ry(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},Yy=function(e){let t=[];e=Uy(e);let n=e.length,r=jy,i=0,a=Ay;for(let n of e)n<128&&t.push(zy(n));let o=t.length,s=o;for(o&&t.push(My);s<n;){let n=wy;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>Ry((wy-i)/c)&&By(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>wy&&By(`overflow`),n===r){let e=i;for(let n=Ty;;n+=Ty){let r=n<=a?Ey:n>=a+Dy?Dy:n-a;if(e<r)break;let i=e-r,o=Ty-r;t.push(zy(Ky(r+i%o,0))),e=Ry(i/o)}t.push(zy(Ky(e,0))),a=qy(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},Xy={version:`2.3.1`,ucs2:{decode:Uy,encode:Wy},decode:Jy,encode:Yy,toASCII:function(e){return Hy(e,function(e){return Py.test(e)?`xn--`+Yy(e):e})},toUnicode:function(e){return Hy(e,function(e){return Ny.test(e)?Jy(e.slice(4).toLowerCase()):e})}},Zy=fv({arrayReplaceAt:()=>nb,asciiTrim:()=>wb,assign:()=>tb,escapeHtml:()=>hb,escapeRE:()=>_b,fromCodePoint:()=>ib,has:()=>eb,isMdAsciiPunct:()=>xb,isPromiseLike:()=>Tb,isPunctChar:()=>yb,isPunctCharCode:()=>bb,isSpace:()=>H,isString:()=>Qy,isValidEntityCode:()=>rb,isWhiteSpace:()=>vb,lib:()=>Eb,normalizeReference:()=>Sb,unescapeAll:()=>ub,unescapeMd:()=>lb});function Qy(e){return typeof e==`string`}var $y=Object.prototype.hasOwnProperty;function eb(e,t){return $y.call(e,t)}function tb(e,...t){for(let n of t)if(n){if(typeof n!=`object`)throw TypeError(`source must be object`);Object.assign(e,n)}return e}function nb(e,t,n){return e.slice(0,t).concat(n,e.slice(t+1))}function rb(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 ib(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 ab=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,ob=RegExp(`${ab.source}|&([a-z#][a-z0-9]{1,31});`,`gi`),sb=/^#(x[a-f0-9]{1,8}|\d{1,8})$/i;function cb(e,t){if(t.charCodeAt(0)===35&&sb.test(t)){let n=t[1].toLowerCase()===`x`?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return rb(n)?ib(n):e}let n=jv(e);return n===e?e:n}function lb(e){return e.includes(`\\`)?e.replace(ab,`$1`):e}function ub(e){return!e.includes(`\\`)&&!e.includes(`&`)?e:e.replace(ob,(e,t,n)=>t||cb(e,n))}var db=/[&<>"]/,fb=/[&<>"]/g,pb={"&":`&`,"<":`<`,">":`>`,'"':`"`};function mb(e){return pb[e]}function hb(e){return db.test(e)?e.replace(fb,mb):e}var gb=/[.?*+^$[\]\\(){}|-]/g;function _b(e){return e.replace(gb,`\\$&`)}function H(e){switch(e){case 9:case 32:return!0}return!1}function vb(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 yb(e){return ny.test(e)||ry.test(e)}function bb(e){return yb(ib(e))}function xb(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 Sb(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}function Cb(e){return e===32||e===9||e===10||e===13}function wb(e){let t=0;for(;t<e.length&&Cb(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&Cb(e.charCodeAt(n));n--);return e.slice(t,n+1)}function Tb(e){return typeof e?.then==`function`}var Eb={mdurl:Qv,ucmicro:ay},Db=class{type;tag;attrs=null;map=null;nesting;level=0;children=null;content=``;markup=``;info=``;meta=null;block=!1;hidden=!1;constructor(e,t,n){this.type=e,this.tag=t,this.nesting=n}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}`}},Ob=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType=`root`;level=0;Token=Db;constructor(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r;let i=this.src,a=i.length;for(let e=0;e<a;){let t=i.indexOf(`
|
|
112
|
+
`,e),n=t===-1?a:t,r=0,o=0,s=e;for(;s<n;){let e=i.charCodeAt(s);if(H(e))r++,o+=e===9?4-o%4:1,s++;else break}this.bMarks.push(e),this.eMarks.push(n),this.tShift.push(r),this.sCount.push(o),this.bsCount.push(0),e=n+1}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){let r=new Db(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e}skipSpaces(e){let t=this.src;for(let n=t.length;e<n&&H(t.charCodeAt(e));e++);return e}skipSpacesBack(e,t){if(e<=t)return e;let n=this.src;for(;e>t;)if(!H(n.charCodeAt(--e)))return e+1;return e}skipChars(e,t){let n=this.src;for(let r=n.length;e<r&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;let r=this.src;for(;e>n;)if(t!==r.charCodeAt(--e))return e+1;return e}getLines(e,t,n,r){if(e>=t)return``;let i=Array(t-e),a=this.src;for(let o=0,s=e;s<t;s++,o++){let e=0,c=this.bMarks[s],l=c,u;for(u=s+1<t||r?this.eMarks[s]+1:this.eMarks[s];l<u&&e<n;){let t=a.charCodeAt(l);if(H(t))t===9?e+=4-(e+this.bsCount[s])%4:e++;else if(l-c<this.tShift[s])e++;else break;l++}e>n?i[o]=` `.repeat(e-n)+this.src.slice(l,u):i[o]=this.src.slice(l,u)}return i.join(``)}},kb=class{src;env;tokens=[];inlineMode=!1;md;constructor(e,t,n){this.src=e,this.env=n,this.md=t}Token=Db},Ab=class{src;env;md;tokens;tokens_meta;pos=0;posMax;level=0;pending=``;pendingLevel=0;cache={};delimiters=[];_prev_delimiters=[];backticks={};backticksScanned=!1;linkLevel=0;constructor(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.posMax=this.src.length}pushPending(){let e=new Db(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e}push(e,t,n){this.pending&&this.pushPending();let r=new Db(e,t,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()??[]),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r}scanDelims(e,t){let n=this.src,r=this.posMax,i=n.charCodeAt(e),a;if(e===0)a=32;else if(e===1)a=this.src.charCodeAt(0),(a&63488)==55296&&(a=65533);else if(a=this.src.charCodeAt(e-1),(a&64512)==56320){let t=this.src.charCodeAt(e-2);a=(t&64512)==55296?65536+(t-55296<<10)+(a-56320):65533}else(a&64512)==55296&&(a=65533);let o=e;for(;o<r&&n.charCodeAt(o)===i;)o++;let s=o-e,c=o<r?this.src.charCodeAt(o):32;if((c&64512)==55296){let e=this.src.charCodeAt(o+1);c=(e&64512)==56320?65536+(c-55296<<10)+(e-56320):65533}else(c&64512)==56320&&(c=65533);let l=xb(a)||bb(a),u=xb(c)||bb(c),d=vb(a),f=vb(c),p=!f&&(!u||d||l),m=!d&&(!l||f||u);return{can_open:p&&(t||!m||l),can_close:m&&(t||!p||u),length:s}}Token=Db},jb=class{__rules__=[];__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([``]);for(let t of this.__rules__)if(t.enabled)for(let n of t.alt)e.add(n);this.__cache__={};for(let t of e){let e=[];for(let n of this.__rules__)n.enabled&&(!t||n.alt.includes(t))&&e.push(n.fn);this.__cache__[t]=e}}at(e,t,n={}){let r=this.__find__(e),i=n||{};if(r===-1)throw Error(`Parser rule not found: ${e}`);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null}before(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: ${e}`);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null}after(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: ${e}`);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null}push(e,t,n){let r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null}enable(e,t){Array.isArray(e)||(e=[e]);let n=[];for(let r of e){let e=this.__find__(r);if(e<0){if(t)continue;throw Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[e].enabled=!0,n.push(r)}return this.__cache__=null,n}enableOnly(e,t){Array.isArray(e)||(e=[e]);for(let e of this.__rules__)e.enabled=!1;this.enable(e,t)}disable(e,t){Array.isArray(e)||(e=[e]);let n=[];for(let r of e){let e=this.__find__(r);if(e<0){if(t)continue;throw Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[e].enabled=!1,n.push(r)}return this.__cache__=null,n}getRules(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]}};function Mb(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;let s=[],c=[],l=[],u=[],d=e.md.block.ruler.getRules(`blockquote`),f=e.parentType;e.parentType=`blockquote`;let p=!1,m;for(m=t;m<n;m++){let t=e.sCount[m]<e.blkIndent;if(i=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],i>=a)break;if(e.src.charCodeAt(i++)===62&&!t){let t=e.sCount[m]+1,n,r;e.src.charCodeAt(i)===32?(i++,t++,r=!1,n=!0):e.src.charCodeAt(i)===9?(n=!0,(e.bsCount[m]+t)%4==3?(i++,t++,r=!1):r=!0):n=!1;let o=t;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i<a;){let t=e.src.charCodeAt(i);if(H(t))t===9?o+=4-(o+e.bsCount[m]+ +!!r)%4:o++;else break;i++}p=i>=a,c.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+ +!!n,l.push(e.sCount[m]),e.sCount[m]=o-t,u.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let r=!1;for(let t=0,i=d.length;t<i;t++)if(d[t](e,m,n,!0)){r=!0;break}if(r){e.lineMax=m,e.blkIndent!==0&&(s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]-=e.blkIndent);break}s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]=-1}let h=e.blkIndent;e.blkIndent=0;let g=e.push(`blockquote_open`,`blockquote`,1);g.markup=`>`;let _=[t,0];g.map=_,e.md.block.tokenize(e,t,m);let v=e.push(`blockquote_close`,`blockquote`,-1);v.markup=`>`,e.lineMax=o,e.parentType=f,_[1]=e.line;for(let n=0;n<u.length;n++)e.bMarks[n+t]=s[n],e.tShift[n+t]=u[n],e.sCount[n+t]=l[n],e.bsCount[n+t]=c[n];return e.blkIndent=h,!0}function Nb(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;)if(e.isEmpty(r))r++;else if(e.sCount[r]-e.blkIndent>=4)r++,i=r;else break;e.line=i;let a=e.push(`code_block`,`code`,0);return a.content=`${e.getLines(t,i,4+e.blkIndent,!1)}\n`,a.map=[t,e.line],!0}function Pb(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>a)return!1;let o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return!1;let l=e.src.slice(s,i),u=e.src.slice(i,a);if(o===96&&u.includes(String.fromCharCode(o)))return!1;if(r)return!0;let d=t,f=!1;for(;d++,!(d>=n||(i=s=e.bMarks[d]+e.tShift[d],a=e.eMarks[d],i<a&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[d]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-s<c)&&(i=e.skipSpaces(i),!(i<a)))){f=!0;break}c=e.sCount[t],e.line=d+ +!!f;let p=e.push(`fence`,`code`,0);return p.info=u,p.content=e.getLines(t+1,d,c,!0),p.markup=l,p.map=[t,e.line],!0}function Fb(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(i);if(o!==35||i>=a)return!1;let s=1;for(o=e.src.charCodeAt(++i);o===35&&i<a&&s<=6;)s++,o=e.src.charCodeAt(++i);if(s>6||i<a&&!H(o))return!1;if(r)return!0;a=e.skipSpacesBack(a,i);let c=e.skipCharsBack(a,35,i);c>i&&H(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;let l=e.push(`heading_open`,`h${String(s)}`,1);l.markup=`########`.slice(0,s),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=wb(e.src.slice(i,a)),u.map=[t,e.line],u.children=[];let d=e.push(`heading_close`,`h${String(s)}`,-1);return d.markup=`########`.slice(0,s),!0}function Ib(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t],o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let s=1;for(;a<i;){let t=e.src.charCodeAt(a++);if(t!==o&&!H(t))return!1;t===o&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;let c=e.push(`hr`,`hr`,0);return c.map=[t,e.line],c.markup=String.fromCharCode(o).repeat(s),!0}var Lb=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Rb=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,zb=`<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>`,Bb=RegExp(`^(?:${Rb}|${zb}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),Vb=RegExp(`^(?:${Rb}|${zb})`),Hb=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(${Lb.join(`|`)})(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(`${Vb.source}\\s*$`),/^$/,!1]];function Ub(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<Hb.length&&!Hb[s][0].test(o);s++);if(s===Hb.length)return!1;if(r)return Hb[s][2];let c=t+1,l=Hb[s][1].test(``);if(!Hb[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent&&(l||!e.isEmpty(c)));c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),Hb[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let u=e.push(`html_block`,``,0);return u.map=[t,c],u.content=e.getLines(t,c,e.blkIndent,!0),!0}function Wb(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`);if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.parentType;e.parentType=`paragraph`;let a=0,o,s=t+1;for(;s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let t=e.bMarks[s]+e.tShift[s],n=e.eMarks[s];if(t<n&&(o=e.src.charCodeAt(t),(o===45||o===61)&&(t=e.skipChars(t,o),t=e.skipSpaces(t),t>=n))){a=o===61?1:2;break}}if(e.sCount[s]<0)continue;let t=!1;for(let i=0,a=r.length;i<a;i++)if(r[i](e,s,n,!0)){t=!0;break}if(t)break}if(!a||o===void 0)return e.parentType=i,!1;let c=wb(e.getLines(t,s,e.blkIndent,!1));e.line=s+1;let l=e.push(`heading_open`,`h${String(a)}`,1);l.markup=String.fromCharCode(o),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=c,u.map=[t,e.line-1],u.children=[];let d=e.push(`heading_close`,`h${String(a)}`,-1);return d.markup=String.fromCharCode(o),e.parentType=i,!0}function Gb(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],i=e.src.charCodeAt(r++);return i!==42&&i!==45&&i!==43||r<n&&!H(e.src.charCodeAt(r))?-1:r}function Kb(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],i=n;if(i+1>=r)return-1;let a=e.src.charCodeAt(i++);if(a<48||a>57)return-1;for(;;){if(i>=r)return-1;if(a=e.src.charCodeAt(i++),a>=48&&a<=57){if(i-n>=10)return-1}else{if(a===41||a===46)break;return-1}}return i<r&&(a=e.src.charCodeAt(i),!H(a))?-1:i}function qb(e,t){let n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type===`paragraph_open`&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function Jb(e,t,n,r){let i,a,o,s,c=t,l=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let u=!1;r&&e.parentType===`paragraph`&&e.sCount[c]>=e.blkIndent&&(u=!0);let d,f,p=Kb(e,c);if(p>=0){if(d=!0,o=e.bMarks[c]+e.tShift[c],f=Number(e.src.slice(o,p-1)),u&&f!==1)return!1}else if(p=Gb(e,c),p>=0)d=!1;else return!1;if(u&&e.skipSpaces(p)>=e.eMarks[c])return!1;if(r)return!0;let m=e.src.charCodeAt(p-1),h=e.tokens.length;d?(s=e.push(`ordered_list_open`,`ol`,1),f!==1&&(s.attrs=[[`start`,f.toString()]])):s=e.push(`bullet_list_open`,`ul`,1);let g=[c,0];s.map=g,s.markup=String.fromCharCode(m);let _=!1,v=e.md.block.ruler.getRules(`list`),y=e.parentType;for(e.parentType=`list`;c<n;){a=p,i=e.eMarks[c];let t=e.sCount[c]+p-(e.bMarks[c]+e.tShift[c]),r=t;for(;a<i;){let t=e.src.charCodeAt(a);if(t===9)r+=4-(r+e.bsCount[c])%4;else if(t===32)r++;else break;a++}let u=a,f;f=u>=i?1:r-t,f>4&&(f=1);let h=t+f;s=e.push(`list_item_open`,`li`,1),s.markup=String.fromCharCode(m);let g=[c,0];s.map=g,d&&(s.info=e.src.slice(o,p-1));let y=e.tight,b=e.tShift[c],x=e.sCount[c],S=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=h,e.tight=!0,e.tShift[c]=u-e.bMarks[c],e.sCount[c]=r,u>=i&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||_)&&(l=!1),_=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=S,e.tShift[c]=b,e.sCount[c]=x,e.tight=y,s=e.push(`list_item_close`,`li`,-1),s.markup=String.fromCharCode(m),c=e.line,g[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let C=!1;for(let t=0,r=v.length;t<r;t++)if(v[t](e,c,n,!0)){C=!0;break}if(C)break;if(d){if(p=Kb(e,c),p<0)break;o=e.bMarks[c]+e.tShift[c]}else if(p=Gb(e,c),p<0)break;if(m!==e.src.charCodeAt(p-1))break}return s=d?e.push(`ordered_list_close`,`ol`,-1):e.push(`bullet_list_close`,`ul`,-1),s.markup=String.fromCharCode(m),g[1]=c,e.line=c,e.parentType=y,l&&qb(e,h),!0}function Yb(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`),i=e.parentType,a=t+1;for(e.parentType=`paragraph`;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let t=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,a,n,!0)){t=!0;break}if(t)break}let o=wb(e.getLines(t,a,e.blkIndent,!1));e.line=a;let s=e.push(`paragraph_open`,`p`,1);s.map=[t,e.line];let c=e.push(`inline`,``,0);return c.content=o,c.map=[t,e.line],c.children=[],e.push(`paragraph_close`,`p`,-1),e.parentType=i,!0}function Xb(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function s(t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let r=e.md.block.ruler.getRules(`reference`),i=e.parentType;e.parentType=`reference`;let a=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,t,n,!0)){a=!0;break}if(e.parentType=i,a)return null}let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return e.src.slice(i,a+1)}let c=e.src.slice(i,a+1);a=c.length;let l=-1;for(i=1;i<a;i++){let e=c.charCodeAt(i);if(e===91)return!1;if(e===93){l=i;break}if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(e===92&&(i++,i<a&&c.charCodeAt(i)===10)){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}}if(l<0||c.charCodeAt(l+1)!==58)return!1;for(i=l+2;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!H(e))break}let u=e.md.helpers.parseLinkDestination(c,i,a);if(!u.ok)return!1;let d=e.md.normalizeLink(u.str);if(!e.md.validateLink(d))return!1;i=u.pos;let f=i,p=o,m=i;for(;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!H(e))break}let h=e.md.helpers.parseLinkTitle(c,i,a);for(;h.can_continue;){let t=s(o);if(t===null)break;c+=t,i=a,a=c.length,o++,h=e.md.helpers.parseLinkTitle(c,i,a,h)}let g;for(i<a&&m!==i&&h.ok?(g=h.str,i=h.pos):(g=``,i=f,o=p);i<a&&H(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10&&g)for(g=``,i=f,o=p;i<a&&H(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10)return!1;let _=Sb(c.slice(1,l));if(!_)return!1;if(r)return!0;e.env.references===void 0&&(e.env.references={}),e.env.references[_]===void 0&&(e.env.references[_]={title:g,href:d}),e.line=o;let v=e.push(`reference`,``,0);return v.map=[t,e.line],v.info=_,v.meta={title:g,href:d},!0}var Zb=65536;function Qb(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function $b(e){let t=[],n=e.length,r=0,i=e.charCodeAt(r),a=!1,o=0,s=``;for(;r<n;)i===124&&(a?(s+=e.substring(o,r-1),o=r):(t.push(s+e.substring(o,r)),s=``,o=r+1)),a=i===92,r++,i=e.charCodeAt(r);return t.push(s+e.substring(o)),t}function ex(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let a=e.bMarks[i]+e.tShift[i];if(a>=e.eMarks[i])return!1;let o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[i])return!1;let s=e.src.charCodeAt(a++);if(s!==124&&s!==45&&s!==58&&!H(s)||o===45&&H(s))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!H(t))return!1;a++}let c=Qb(e,t+1),l=c.split(`|`),u=[];for(let e=0;e<l.length;e++){let t=l[e].trim();if(!t){if(e===0||e===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(t))return!1;t.charCodeAt(t.length-1)===58?u.push(t.charCodeAt(0)===58?`center`:`right`):t.charCodeAt(0)===58?u.push(`left`):u.push(``)}if(c=Qb(e,t).trim(),!c.includes(`|`)||e.sCount[t]-e.blkIndent>=4)return!1;l=$b(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop();let d=l.length;if(d===0||d!==u.length)return!1;if(r)return!0;let f=e.parentType;e.parentType=`table`;let p=e.md.block.ruler.getRules(`blockquote`),m=e.push(`table_open`,`table`,1),h=[t,0];m.map=h;let g=e.push(`thead_open`,`thead`,1);g.map=[t,t+1];let _=e.push(`tr_open`,`tr`,1);_.map=[t,t+1];for(let t=0;t<l.length;t++){let n=e.push(`th_open`,`th`,1);u[t]&&(n.attrs=[[`style`,`text-align:${u[t]}`]]);let r=e.push(`inline`,``,0);r.content=l[t].trim(),r.children=[],e.push(`th_close`,`th`,-1)}e.push(`tr_close`,`tr`,-1),e.push(`thead_close`,`thead`,-1);let v,y=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let r=!1;for(let t=0,a=p.length;t<a;t++)if(p[t](e,i,n,!0)){r=!0;break}if(r||(c=Qb(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4||(l=$b(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop(),y+=d-l.length,y>Zb))break;if(i===t+2){let n=e.push(`tbody_open`,`tbody`,1);n.map=v=[t+2,0]}let a=e.push(`tr_open`,`tr`,1);a.map=[i,i+1];for(let t=0;t<d;t++){let n=e.push(`td_open`,`td`,1);u[t]&&(n.attrs=[[`style`,`text-align:${u[t]}`]]);let r=e.push(`inline`,``,0);r.content=l[t]?l[t].trim():``,r.children=[],e.push(`td_close`,`td`,-1)}e.push(`tr_close`,`tr`,-1)}return v&&(e.push(`tbody_close`,`tbody`,-1),v[1]=i),e.push(`table_close`,`table`,-1),h[1]=i,e.parentType=f,e.line=i,!0}var tx=[[`table`,ex,[`paragraph`,`reference`]],[`code`,Nb],[`fence`,Pb,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,Mb,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,Ib,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,Jb,[`paragraph`,`reference`,`blockquote`]],[`reference`,Xb],[`html_block`,Ub,[`paragraph`,`reference`,`blockquote`]],[`heading`,Fb,[`paragraph`,`reference`,`blockquote`]],[`lheading`,Wb],[`paragraph`,Yb]],nx=class{ruler;constructor(){this.ruler=new jb;for(let e=0;e<tx.length;e++)this.ruler.push(tx[e][0],tx[e][1],{alt:(tx[e][2]||[]).slice()})}tokenize(e,t,n,r){let i=this.ruler.getRules(``),a=i.length,o=e.md.options.maxNesting,s=t,c=!1;for(;s<n&&(e.line=s=e.skipEmptyLines(s),!(s>=n||e.sCount[s]<e.blkIndent));){if(e.level>=o){e.line=n;break}let t=e.line,r=!1;for(let o=0;o<a;o++)if(r=i[o](e,s,n,!1),r){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}if(!r)throw Error(`none of the block rules matched`);e.tight=!c,e.isEmpty(e.line-1)&&(c=!0),s=e.line,s<n&&e.isEmpty(s)&&(c=!0,s++,e.line=s)}}parse(e,t,n,r){if(!e)return;let i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)}State=Ob};function rx(e){let t;e.inlineMode?(t=new e.Token(`inline`,``,0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function ix(e){let t=e.tokens;for(let n=0,r=t.length;n<r;n++){let r=t[n];r.type===`inline`&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function ax(e){return/^<a[>\s]/i.test(e)}function ox(e){return/^<\/a\s*>/i.test(e)}function sx(e){if(!e.md.options.linkify)return;let t=e.tokens,n=e.md.linkify;for(let r=0,i=t.length;r<i;r++){if(t[r].type!==`inline`||!n.pretest(t[r].content))continue;let i=t[r].children,a=0;for(let t=i.length-1;t>=0;t--){let r=i[t];if(r.type===`link_close`)for(t--;i[t].level!==r.level&&i[t].type!==`link_open`;)t--;else if(r.type===`html_inline`&&(ax(r.content)&&a>0&&a--,ox(r.content)&&a++),!(a>0)&&r.type===`text`){let a=r.content;if(!n.pretest(a))continue;let o=n.match(a);if(!o?.length)continue;let s=[],c=r.level,l=0,u=+(o[0].index===0&&t>0&&i[t-1].type===`text_special`);for(let t=u;t<o.length;t++){let n=o[t],r=e.md.normalizeLink(n.url);if(!e.md.validateLink(r))continue;let i=n.text;i=n.schema?n.schema===`mailto:`&&!/^mailto:/i.test(i)?e.md.normalizeLinkText(`mailto:${i}`).replace(/^mailto:/,``):e.md.normalizeLinkText(i):e.md.normalizeLinkText(`http://${i}`).replace(/^http:\/\//,``);let u=n.index;if(u>l){let t=new e.Token(`text`,``,0);t.content=a.slice(l,u),t.level=c,s.push(t)}let d=new e.Token(`link_open`,`a`,1);d.attrs=[[`href`,r]],d.level=c++,d.markup=`linkify`,d.info=`auto`,s.push(d);let f=new e.Token(`text`,``,0);f.content=i,f.level=c,s.push(f);let p=new e.Token(`link_close`,`a`,-1);p.level=--c,p.markup=`linkify`,p.info=`auto`,s.push(p),l=n.lastIndex}if(l<a.length){let t=new e.Token(`text`,``,0);t.content=a.slice(l),t.level=c,s.push(t)}i.splice(t,1,...s)}}}}var cx=/\r\n?|\n/g,lx=/\0/g;function ux(e){let t=e.src,n=t.includes(`\r`),r=t.includes(`\0`);(n||r)&&(n&&(t=t.replace(cx,`
|
|
113
|
+
`)),r&&(t=t.replace(lx,`�`)),e.src=t)}var dx=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,fx=/\((?:c|tm|r)\)/i,px=/\((c|tm|r)\)/gi,mx={c:`©`,r:`®`,tm:`™`};function hx(e,t){return mx[t.toLowerCase()]}function gx(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&(r.content=r.content.replace(px,hx)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function _x(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&dx.test(r.content)&&(r.content=r.content.replace(/\+-/g,`±`).replace(/\.{2,}/g,`…`).replace(/([?!])…/g,`$1..`).replace(/([?!]){4,}/g,`$1$1$1`).replace(/,{2,}/g,`,`).replace(/(^|[^-])---(?=[^-]|$)/gm,`$1—`).replace(/(^|\s)--(?=\s|$)/gm,`$1–`).replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,`$1–`)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function vx(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&(fx.test(e.tokens[t].content)&&gx(e.tokens[t].children),dx.test(e.tokens[t].content)&&_x(e.tokens[t].children))}var yx=/['"]/,bx=/['"]/g,xx=`’`;function Sx(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function Cx(e,t){let n=``,r=0;t.sort((e,t)=>e.pos-t.pos);for(let i=0;i<t.length;i++){let a=t[i];n+=e.slice(r,a.pos)+a.ch,r=a.pos+1}return n+e.slice(r)}function wx(e,t){let n,r=[],i={};for(let a=0;a<e.length;a++){let o=e[a],s=e[a].level;for(n=r.length-1;n>=0&&!(r[n].level<=s);n--);if(r.length=n+1,o.type!==`text`)continue;let c=o.content,l=0,u=c.length;OUTER:for(;l<u;){bx.lastIndex=l;let o=bx.exec(c);if(!o)break;let d=!0,f=!0;l=o.index+1;let p=o[0]===`'`,m=32;if(o.index-1>=0)m=c.charCodeAt(o.index-1);else for(n=a-1;n>=0&&e[n].type!==`softbreak`&&e[n].type!==`hardbreak`;n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let h=32;if(l<u)h=c.charCodeAt(l);else for(n=a+1;n<e.length&&e[n].type!==`softbreak`&&e[n].type!==`hardbreak`;n++)if(e[n].content){h=e[n].content.charCodeAt(0);break}let g=xb(m)||bb(m),_=xb(h)||bb(h),v=vb(m),y=vb(h);if(y?d=!1:_&&(v||g||(d=!1)),v?f=!1:g&&(y||_||(f=!1)),h===34&&o[0]===`"`&&m>=48&&m<=57&&(f=d=!1),d&&f&&(d=g,f=_),!d&&!f)p&&Sx(i,a,o.index,xx);else{if(f)for(n=r.length-1;n>=0;n--){let e=r[n];if(r[n].level<s)break;if(e.single===p&&r[n].level===s){e=r[n];let s,c;p?(s=t.md.options.quotes[2],c=t.md.options.quotes[3]):(s=t.md.options.quotes[0],c=t.md.options.quotes[1]),Sx(i,a,o.index,c),Sx(i,e.token,e.pos,s),r.length=n;continue OUTER}}d?r.push({token:a,pos:o.index,single:p,level:s}):f&&p&&Sx(i,a,o.index,xx)}}}Object.keys(i).forEach(t=>{e[t].content=Cx(e[t].content,i[t])})}function Tx(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&yx.test(e.tokens[t].content)&&wx(e.tokens[t].children,e)}function Ex(e){let t,n,r=e.tokens,i=r.length;for(let e=0;e<i;e++){if(r[e].type!==`inline`)continue;let i=r[e].children,a=i.length;for(t=0;t<a;t++)i[t].type===`text_special`&&(i[t].type=`text`);for(t=n=0;t<a;t++)i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var Dx=[[`normalize`,ux],[`block`,rx],[`inline`,ix],[`linkify`,sx],[`replacements`,vx],[`smartquotes`,Tx],[`text_join`,Ex]],Ox=class{ruler;constructor(){this.ruler=new jb;for(let e=0;e<Dx.length;e++)this.ruler.push(Dx[e][0],Dx[e][1])}process(e){let t=this.ruler.getRules(``);for(let n=0,r=t.length;n<r;n++)t[n](e)}State=kb};function kx(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=ub(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)break;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=ub(e.slice(t,i)),a.pos=i,a.ok=!0),a}function Ax(e,t,n=!1){let r,i=!1,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 jx(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+=ub(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+=ub(e.slice(t,a)),o}var Mx={parseLinkDestination:kx,parseLinkLabel:Ax,parseLinkTitle:jx},Nx=/^([\w.!#$%&'*+/=?^`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*)$/i,Px=/^([a-z][a-z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/i;function Fx(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;let t=e.src.charCodeAt(n);if(t===60)return!1;if(t===62)break}let a=e.src.slice(r+1,n);if(Px.test(a)){let n=e.md.normalizeLink(a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}if(Nx.test(a)){let n=e.md.normalizeLink(`mailto:${a}`);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}return!1}function Ix(e,t){let n=e.pos,r=e.src;if(r.charCodeAt(n)!==96)return!1;let i=n;n++;let a=e.posMax;for(;n<a&&r.charCodeAt(n)===96;)n++;let o=r.slice(i,n),s=o.length;if(e.backticksScanned&&(e.backticks[s]||0)<=i)return t||(e.pending+=o),e.pos+=s,!0;let c=n,l;for(;l=r.indexOf("`",c),l!==-1;){for(c=l+1;c<a&&r.charCodeAt(c)===96;)c++;let i=c-l;if(i===s){if(!t){let t=e.push(`code_inline`,`code`,0);t.markup=o,t.content=r.slice(n,l).replace(/\n/g,` `).replace(/^ (.+) $/,`$1`)}return e.pos=c,!0}e.backticks[i]=l}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=s,!0}function Lx(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,a=[];for(let o=0;o<n;o++){let n=e[o];if(a.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=o),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let s=t[n.marker][(n.open?3:0)+n.length%3],c=r-a[r]-1,l=c;for(;c>s;c-=a[c]+1){let t=e[c];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=c>0&&!e[c-1].open?a[c-1]+1:0;a[o]=o-c+r,a[c]=r,n.open=!1,t.end=o,t.close=!1,l=-1,i=-2;break}}}l!==-1&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=l)}}function Rx(e){let t=e.tokens_meta,n=e.tokens_meta.length;Lx(e.delimiters);for(let e=0;e<n;e++){let n=t[e]?.delimiters;n&&Lx(n)}}function zx(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;let i=e.scanDelims(e.pos,r===42);for(let t=0;t<i.length;t++){let t=e.push(`text`,``,0);t.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function Bx(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let n=t[r];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let i=t[n.end],a=r>0&&t[r-1].end===n.end+1&&t[r-1].marker===n.marker&&t[r-1].token===n.token-1&&t[n.end+1].token===i.token+1,o=String.fromCharCode(n.marker),s=e.tokens[n.token];s.type=a?`strong_open`:`em_open`,s.tag=a?`strong`:`em`,s.nesting=1,s.markup=a?o+o:o,s.content=``;let c=e.tokens[i.token];c.type=a?`strong_close`:`em_close`,c.tag=a?`strong`:`em`,c.nesting=-1,c.markup=a?o+o:o,c.content=``,a&&(e.tokens[t[r-1].token].content=``,e.tokens[t[n.end+1].token].content=``,r--)}}function Vx(e){let t=e.tokens_meta,n=e.tokens_meta.length;Bx(e,e.delimiters);for(let r=0;r<n;r++){let n=t[r]?.delimiters;n&&Bx(e,n)}}var Hx={tokenize:zx,postProcess:Vx},Ux=/^&#(x[a-f0-9]{1,6}|\d{1,7});/i,Wx=/^&([a-z][a-z0-9]{1,31});/i;function Gx(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let r=e.src.slice(n).match(Ux);if(r){if(!t){let t=r[1][0].toLowerCase()===`x`?Number.parseInt(r[1].slice(1),16):Number.parseInt(r[1],10),n=e.push(`text_special`,``,0);n.content=rb(t)?ib(t):ib(65533),n.markup=r[0],n.info=`entity`}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(Wx);if(r){let n=Mv(r[0]);if(n!==r[0]){if(!t){let t=e.push(`text_special`,``,0);t.content=n,t.markup=r[0],t.info=`entity`}return e.pos+=r[0].length,!0}}}return!1}var Kx=[];for(let e=0;e<256;e++)Kx.push(0);for(let e of`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.split(``))Kx[e.charCodeAt(0)]=1;function qx(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push(`hardbreak`,`br`,0),n++;n<r&&(i=e.src.charCodeAt(n),H(i));)n++;return e.pos=n,!0}if(i===32){if(!t){let t=e.push(`text_special`,``,0);t.content=`\\`,t.markup=`\\`,t.info=`escape`}return e.pos=n,!0}let a=e.src[n];if(i>=55296&&i<=56319&&n+1<r){let t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(a+=e.src[n+1],n++)}let o=`\\${a}`;if(!t){let t=e.push(`text_special`,``,0);t.content=i<256&&Kx[i]!==0?a:o,t.markup=o,t.info=`escape`}return e.pos=n+1,!0}function Jx(e){let t,n,r=0,i=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}function Yx(e){return/^<a[>\s]/i.test(e)}function Xx(e){return/^<\/a\s*>/i.test(e)}function Zx(e){let t=e|32;return t>=97&&t<=122}function Qx(e,t){if(!e.md.options.html)return!1;let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!Zx(i))return!1;let a=e.src.slice(r).match(Bb);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],Yx(t.content)&&e.linkLevel++,Xx(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}function $x(e,t){let n,r,i,a,o,s,c,l,u=``,d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(a=m+1,a<f&&e.src.charCodeAt(a)===40){for(a++;a<f&&(n=e.src.charCodeAt(a),H(n)||n===10);a++);if(a>=f)return!1;for(l=a,s=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),s.ok&&(u=e.md.normalizeLink(s.str),e.md.validateLink(u)?a=s.pos:u=``),l=a;a<f&&(n=e.src.charCodeAt(a),H(n)||n===10);a++);if(s=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<f&&l!==a&&s.ok)for(c=s.str,a=s.pos;a<f&&(n=e.src.charCodeAt(a),H(n)||n===10);a++);else c=``;if(a>=f||e.src.charCodeAt(a)!==41)return e.pos=d,!1;a++}else{if(e.env.references===void 0)return!1;if(a<f&&e.src.charCodeAt(a)===91?(l=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?i=e.src.slice(l,a++):a=m+1):a=m+1,i||=e.src.slice(p,m),o=e.env.references[Sb(i)],!o)return e.pos=d,!1;u=o.href,c=o.title}if(!t){r=e.src.slice(p,m);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push(`image`,`img`,0),i=[[`src`,u],[`alt`,``]];n.attrs=i,n.children=t,n.content=r,c&&i.push([`title`,c])}return e.pos=a,e.posMax=f,!0}function eS(e,t){let n,r,i,a,o=``,s=``,c=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let u=e.pos,d=e.posMax,f=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let m=p+1;if(m<d&&e.src.charCodeAt(m)===40){for(l=!1,m++;m<d&&(n=e.src.charCodeAt(m),H(n)||n===10);m++);if(m>=d)return!1;if(c=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?m=i.pos:o=``,c=m;m<d&&(n=e.src.charCodeAt(m),H(n)||n===10);m++);if(i=e.md.helpers.parseLinkTitle(e.src,m,e.posMax),m<d&&c!==m&&i.ok)for(s=i.str,m=i.pos;m<d&&(n=e.src.charCodeAt(m),H(n)||n===10);m++);}(m>=d||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(e.env.references===void 0)return!1;if(m<d&&e.src.charCodeAt(m)===91?(c=m+1,m=e.md.helpers.parseLinkLabel(e,m),m>=0?r=e.src.slice(c,m++):m=p+1):m=p+1,r||=e.src.slice(f,p),a=e.env.references[Sb(r)],!a)return e.pos=u,!1;o=a.href,s=a.title}if(!t){e.pos=f,e.posMax=p;let t=e.push(`link_open`,`a`,1),n=[[`href`,o]];t.attrs=n,s&&n.push([`title`,s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push(`link_close`,`a`,-1)}return e.pos=m,e.posMax=d,!0}var tS=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function nS(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let i=e.pending.match(tS);if(!i)return!1;let a=i[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let s=o.url;if(s.length<=a.length)return!1;let c=s.length;for(;c>0&&s.charCodeAt(c-1)===42;)c--;c!==s.length&&(s=s.slice(0,c));let l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,l]],t.markup=`linkify`,t.info=`auto`;let n=e.push(`text`,``,0);n.content=e.md.normalizeLinkText(s);let r=e.push(`link_close`,`a`,-1);r.markup=`linkify`,r.info=`auto`}return e.pos+=s.length-a.length,!0}function rS(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,i=e.posMax;if(!t){if(r>=0&&e.pending.charCodeAt(r)===32){if(r>=1&&e.pending.charCodeAt(r-1)===32){let t=r-1;for(;t>=1&&e.pending.charCodeAt(t-1)===32;)t--;e.pending=e.pending.slice(0,t),e.push(`hardbreak`,`br`,0)}else e.pending=e.pending.slice(0,-1),e.push(`softbreak`,`br`,0)}else e.push(`softbreak`,`br`,0)}for(n++;n<i&&H(e.src.charCodeAt(n));)n++;return e.pos=n,!0}function iS(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;let s;a%2&&(s=e.push(`text`,``,0),s.content=o,a--);for(let t=0;t<a;t+=2)s=e.push(`text`,``,0),s.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function aS(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==126||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`s_open`,n.tag=`s`,n.nesting=1,n.markup=`~~`,n.content=``,n=e.tokens[o.token],n.type=`s_close`,n.tag=`s`,n.nesting=-1,n.markup=`~~`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`~`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`s_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}function oS(e){let t=e.tokens_meta,n=e.tokens_meta.length;aS(e,e.delimiters);for(let r=0;r<n;r++){let n=t[r]?.delimiters;n&&aS(e,n)}}var sS={tokenize:iS,postProcess:oS};function cS(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function lS(e,t){let n=e.pos,r=e.src;for(;n<e.posMax&&!cS(r.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=r.slice(e.pos,n)),e.pos=n,!0)}var uS=[[`text`,lS],[`linkify`,nS],[`newline`,rS],[`escape`,qx],[`backticks`,Ix],[`strikethrough`,sS.tokenize],[`emphasis`,Hx.tokenize],[`link`,eS],[`image`,$x],[`autolink`,Fx],[`html_inline`,Qx],[`entity`,Gx]],dS=[[`balance_pairs`,Rx],[`strikethrough`,sS.postProcess],[`emphasis`,Hx.postProcess],[`fragments_join`,Jx]],fS=class{ruler;ruler2;constructor(){this.ruler=new jb;for(let e=0;e<uS.length;e++)this.ruler.push(uS[e][0],uS[e][1]);this.ruler2=new jb;for(let e=0;e<dS.length;e++)this.ruler2.push(dS[e][0],dS[e][1])}skipToken(e){let t=e.pos,n=this.ruler.getRules(``),r=n.length,i=e.md.options.maxNesting,a=e.cache,o=a[t];if(o!==void 0){e.pos=o;return}let s=!1;if(e.level<i){for(let i=0;i<r;i++)if(e.level++,s=n[i](e,!0),e.level--,s){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}else e.pos=e.posMax;s||e.pos++,a[t]=e.pos}tokenize(e){let t=this.ruler.getRules(``),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){let a=e.pos,o=!1;if(e.level<i){for(let r=0;r<n;r++)if(o=t[r](e,!1),o){if(a>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}if(o){if(e.pos>=r)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()}parse(e,t,n,r){let i=new this.State(e,t,n,r);this.tokenize(i);let a=this.ruler2.getRules(``),o=a.length;for(let e=0;e<o;e++)a[e](i)}State=Ab},pS=/^(vbscript|javascript|file|data):/,mS=/^data:image\/(gif|png|jpeg|webp);/;function hS(e){let t=e.trim().toLowerCase();return!pS.test(t)||mS.test(t)}var gS=[`http:`,`https:`,`mailto:`];function _S(e){let t=Zv(e,!0);if(t.hostname&&(!t.protocol||gS.includes(t.protocol)))try{t.hostname=Xy.toASCII(t.hostname)}catch{}return Rv(zv(t))}function vS(e){let t=Zv(e,!0);if(t.hostname&&(!t.protocol||gS.includes(t.protocol)))try{t.hostname=Xy.toUnicode(t.hostname)}catch{}return Fv(zv(t),`${Fv.defaultChars}%`)}var yS={html:!1,linkify:!1,typographer:!1,quotes:`“”‘’`,maxNesting:100},bS=class{inline=new fS;block=new nx;core=new Ox;linkify=new Cy;validateLink=hS;normalizeLink=_S;normalizeLinkText=vS;helpers={...Mx};options={...yS};parse(e,t={}){if(typeof e!=`string`)throw TypeError(`Input data should be a String`);let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens}parseInline(e,t={}){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens}},xS={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`blockquote`,`code`,`fence`,`heading`,`hr`,`html_block`,`lheading`,`list`,`reference`,`paragraph`]},inline:{rules:[`autolink`,`backticks`,`emphasis`,`entity`,`escape`,`html_inline`,`image`,`link`,`newline`,`text`],rules2:[`balance_pairs`,`emphasis`,`fragments_join`]}}},SS={options:{...yS,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,highlight:null},components:{core:{},block:{},inline:{}}},CS={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`paragraph`]},inline:{rules:[`text`],rules2:[`balance_pairs`,`fragments_join`]}}},wS={};wS.code_inline=function(e,t,n,r,i){let a=e[t];return`<code${i.renderAttrs(a)}>${hb(a.content)}</code>`},wS.code_block=function(e,t,n,r,i){let a=e[t];return`<pre${i.renderAttrs(a)}><code>${hb(e[t].content)}</code></pre>\n`},wS.fence=function(e,t,n,r,i){let a=e[t],o=a.info?ub(a.info).trim():``,s=``,c=``;if(o){let e=o.split(/(\s+)/g);s=e[0],c=e.slice(2).join(``)}function l(e){if(e.indexOf(`<pre`)===0)return`${e}\n`;if(o){let t=a.attrIndex(`class`),r=a.attrs?a.attrs.slice():[];t<0?r.push([`class`,n.langPrefix+s]):(r[t]=r[t].slice(),r[t][1]+=` ${n.langPrefix}${s}`);let o={attrs:r};return`<pre><code${i.renderAttrs(o)}>${e}</code></pre>\n`}return`<pre><code${i.renderAttrs(a)}>${e}</code></pre>\n`}let u=(()=>{if(!n.highlight)return hb(a.content);let e=n.highlight(a.content,s,c,r);return Tb(e)?e.then(e=>e||hb(a.content)):e||hb(a.content)})();return Tb(u)?u.then(l):l(u)},wS.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)},wS.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
|
|
114
114
|
`:`<br>
|
|
115
|
-
`},
|
|
115
|
+
`},wS.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
116
116
|
`:`<br>
|
|
117
117
|
`:`
|
|
118
|
-
`},
|
|
118
|
+
`},wS.text=function(e,t){return hb(e[t].content)},wS.html_block=function(e,t){return e[t].content},wS.html_inline=function(e,t){return e[t].content},wS.reference=function(e,t){return e[t].content};var TS=class e{rules=tb({},wS);constructor(){}renderAttrs(e){let t=e.attrs;if(!t)return``;let n=t.length;if(n===0)return``;let r=``;for(let e=0;e<n;e++)r+=` ${hb(t[e][0])}="${hb(t[e][1])}"`;return r}renderToken(e,t,n,r={}){let i=e[t],a=``;if(i.hidden)return``;i.block&&i.nesting!==-1&&t&&e[t-1].hidden&&(a+=`
|
|
119
119
|
`),a+=(i.nesting===-1?`</`:`<`)+i.tag,a+=this.renderAttrs(i),i.nesting===0&&n.xhtmlOut&&(a+=` /`);let o=!1;if(i.block&&(o=!0,i.nesting===1&&t+1<e.length)){let n=e[t+1];(n.type===`inline`||n.type===`reference`||n.hidden||n.nesting===-1&&n.tag===i.tag)&&(o=!1)}return a+=o?`>
|
|
120
|
-
`:`>`,a}renderInline(e,t,n={}){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=i[e[a].type];if(o){let i=o(e,a,t,n,this);if(
|
|
121
|
-
`}}return r}render(e,t,n={}){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;if(o===`inline`)r+=this.renderInline(e[a].children,t,n);else{let s=i[o];if(s){let i=s(e,a,t,n,this);if(Eb(i))throw Error(`Renderer.render: async rule detected, use renderAsync()`);r+=i}else r+=this.renderToken(e,a,t,n)}}return r}async renderInlineAsync(t,n,r){let i=this.renderInline;if(i!==e.prototype.renderInline&&this.renderInlineAsync===e.prototype.renderInlineAsync)return i.call(this,t,n,r);let a=[],o=this.rules;for(let e=0,i=t.length;e<i;e++){let i=o[t[e].type];i?a.push(Promise.resolve(i(t,e,n,r,this))):a.push(Promise.resolve(this.renderToken(t,e,n,r)))}return(await Promise.all(a)).join(``)}async renderAsync(t,n,r){let i=this.render;if(i!==e.prototype.render&&this.renderAsync===e.prototype.renderAsync)return i.call(this,t,n,r);let a=[],o=this.rules;for(let e=0,i=t.length;e<i;e++){let i=t[e],s=i.type;if(s===`inline`)a.push(this.renderInlineAsync(i.children,n,r));else{let i=o[s];i?a.push(Promise.resolve(i(t,e,n,r,this))):a.push(Promise.resolve(this.renderToken(t,e,n,r)))}}return(await Promise.all(a)).join(``)}},DS={default:CS,zero:wS,commonmark:SS},OS=class extends xS{renderer=new ES;utils=Qy;options={...DS.default.options};constructor(e,t){super();let[n,r]=typeof e==`string`?[e,t]:[`default`,e];this.configure(n),r&&this.set(r)}set(e){return nb(this.options,e),this}configure(e){if(typeof e==`string`){let t=e;if(e=DS[t],!e)throw Error(`Wrong \`markdown-exit\` preset "${t}", check name`)}if(!e)throw Error("Wrong `markdown-exit` preset, can't be empty");if(e.options&&this.set(e.options),e.components)for(let t of Object.keys(e.components)){let n=e.components[t];n.rules&&this[t].ruler.enableOnly(n.rules),n.rules2&&this[t].ruler2?.enableOnly(n.rules2)}return this}enable(e,t){let n=[];Array.isArray(e)||(e=[e]);for(let t of[`core`,`block`,`inline`])n=n.concat(this[t].ruler.enable(e,!0));n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter(e=>!n.includes(e));if(r.length&&!t)throw Error(`MarkdownExit. Failed to enable unknown rule(s): ${r}`);return this}disable(e,t){let n=[];Array.isArray(e)||(e=[e]);for(let t of[`core`,`block`,`inline`])n=n.concat(this[t].ruler.disable(e,!0));n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter(e=>!n.includes(e));if(r.length&&!t)throw Error(`MarkdownExit. Failed to disable unknown rule(s): ${r}`);return this}use(e,...t){return e.apply(e,[this,...t]),this}render(e,t={}){return this.renderer.render(this.parse(e,t),this.options,t)}renderAsync(e,t={}){return this.renderer.renderAsync(this.parse(e,t),this.options,t)}renderInline(e,t={}){return this.renderer.render(this.parseInline(e,t),this.options,t)}renderInlineAsync(e,t={}){return this.renderer.renderAsync(this.parseInline(e,t),this.options,t)}};function kS(e){function t(...t){return new e(...t)}return Object.setPrototypeOf(t,OS),t.prototype=OS.prototype,t.prototype.constructor=t,t}var AS=kS(OS);function jS(e,t){let n=new Map;for(let t of e)n.set(t.name,t);let r=new Set;for(let e of t)r.has(e.name)||(r.add(e.name),n.delete(e.name),n.set(e.name,e));return[...n.values()]}function MS(e){return e}function NS(e,t){if(e[t]!==`[`)return-1;let n=t+1,r=0;for(;n<e.length;)if(e[n]===`\\`&&n+1<e.length)n+=2;else{if(e[n]===`[`)r++;else if(e[n]===`]`){if(r===0)return n;r--}n+=1}return-1}function PS(e,t){let n=NS(e,t);return n===-1?null:{content:e.slice(t+1,n),endIndex:n+1}}var FS=[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 IS(e){return e===0||e>=55296&&e<=57343||e>1114111}function LS(e){return IS(e)?65533:e>=128&&e<=159&&FS[e-128]||e}function RS(e){return e-1>>>0<127||e-160>>>0<55136?String.fromCharCode(e):String.fromCodePoint(LS(e))}var zS=(()=>{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 BS(e,t,n,r,i,a){let o=e.length,s=a*90,c=0,l=()=>{let t=zS[e.charCodeAt(c++)];return t<a?t:t*91-s+zS[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=zS[e.charCodeAt(c++)];if(t<89)r+=t,f[i++]=r;else if(t===89){let t=zS[e.charCodeAt(c++)]+2;for(;t--;)f[i++]=++r}else{let t=zS[e.charCodeAt(c++)];r+=89+(t<90?t*91+zS[e.charCodeAt(c++)]:zS[e.charCodeAt(c++)]*8281+zS[e.charCodeAt(c++)]*91+zS[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),ee=0;for(;c<o;){let t=zS[e.charCodeAt(c++)];t>=a&&(t=t*91-s+zS[e.charCodeAt(c++)]);let n=f[t];if(n<0){let e=p[t],n=e+m[t];for(;e<n;)S[ee++]=b[e++]}else S[ee++]=n}return S}var VS=BS("!}.&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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uvvNr}: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),HS;(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`})(HS||={});var US;(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`})(US||={});var WS=32,GS=21,KS=2097151,qS=2047,JS=0;function YS(e){let t=e>>>GS;return t===qS?JS:t}function XS(e){return e-US.ZERO>>>0<=9}function ZS(e){return(e|WS)-US.LOWER_A>>>0<=5}function QS(e){return(e|WS)-US.LOWER_A>>>0<=25}function $S(e){return e===US.EQUALS||QS(e)||XS(e)}var eC;(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`})(eC||={});var tC;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(tC||={});function nC(e,t,n,r){let i=(t&HS.BRANCH_LENGTH)>>7,a=t&HS.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 rC(e,t,n){return n===1?String.fromCharCode(e[t]&HS.VALUE_MASK):n===2?String.fromCharCode(e[t+1]):String.fromCharCode(e[t+1],e[t+2])}function iC(e,t,n){let r=t+1,i=0,a=r;if(r<n&&(e.charCodeAt(r)|WS)===US.LOWER_X)for(r+=1,a=r;r<n;){let t=e.charCodeAt(r);if(XS(t))i=i*16+(t-US.ZERO);else if(ZS(t))i=i*16+((t|WS)-US.LOWER_A+10);else break;r+=1}else for(;r<n;){let t=e.charCodeAt(r)-US.ZERO;if(t>>>0>9)break;i=i*10+t,r+=1}if(r===a)return 0;r<n&&e.charCodeAt(r)===US.SEMI&&(r+=1),i>1114111&&(i=1114112);let o=r-t;return o>=qS&&(JS=o,o=qS),o<<GS|i}function aC(e,t,n){let r=VS,i=e.indexOf(`&`);if(i<0)return e;let a=e.length,o=0,s=``,c=r[0],l=c&HS.JUMP_TABLE,u=(c&HS.BRANCH_LENGTH)>>7;do{let c=i+1,d=e.charCodeAt(c),f,p;if(d===US.NUM){let n=iC(e,c,a);f=YS(n),t&&f>0&&e.charCodeAt(c+f-1)!==US.SEMI&&(f=0),p=f===0?``:RS(n&KS)}else if(QS(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&(HS.VALUE_LENGTH|HS.FLAG13))===0&&(m&HS.JUMP_TABLE)!==0;){let t=m&HS.JUMP_TABLE,n=(m&HS.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&(HS.VALUE_LENGTH|HS.FLAG13))===HS.FLAG13){let t=(m&HS.BRANCH_LENGTH)>>7;if(e.charCodeAt(h)!==(m&HS.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===US.SEMI){f=h-c+1,p=n===1?String.fromCharCode(m&HS.VALUE_MASK):rC(r,i,n);break}if(!t&&(m&HS.FLAG13)===0&&(f=h-c,o=i,s=n),n===1)break}let u=nC(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&HS.FLAG13)===0&&(f=h-c,o=i,s=e),f>0&&(p=rC(r,o,s))}}else f=0,p=``;f===0||n&&d!==US.NUM&&e.charCodeAt(c+f-1)!==US.SEMI&&c+f<a&&$S(e.charCodeAt(c+f))?i=c:(o<i&&(s+=e.slice(o,i)),s+=p,i=o=c+f),e.charCodeAt(i)!==US.AMP&&(i=e.indexOf(`&`,i))}while(i>=0);return s+e.slice(o)}function oC(e,t=tC.Legacy){return aC(e,t===tC.Strict,t===tC.Attribute)}var H=Symbol(`NOT_RESOLVED`);function sC(e,t){return{tagName:e,nodeKind:`scalar`,implicit:t.implicit??!1,matchByTagPrefix:t.matchByTagPrefix??!1,implicitFirstChars:t.implicitFirstChars??null,resolve:t.resolve,identify:t.identify,represent:t.represent??(e=>String(e)),representTagName:t.representTagName??(()=>e)}}function cC(e,t){let n=t.finalize===void 0;return{tagName:e,nodeKind:`sequence`,implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addItem:t.addItem,finalize:t.finalize??(e=>e),carrierIsResult:n,identify:t.identify,represent:t.represent??(e=>e),representTagName:t.representTagName??(()=>e)}}function lC(e,t){let n=t.finalize===void 0;return{tagName:e,nodeKind:`mapping`,implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addPair:t.addPair,has:t.has,keys:t.keys,get:t.get,finalize:t.finalize??(e=>e),carrierIsResult:n,identify:t.identify,represent:t.represent??(e=>e),representTagName:t.representTagName??(()=>e)}}var uC=sC(`tag:yaml.org,2002:str`,{resolve:e=>e,identify:e=>typeof e==`string`}),dC=[``,`~`,`null`,`Null`,`NULL`],fC=sC(`tag:yaml.org,2002:null`,{implicit:!0,implicitFirstChars:[``,`~`,`n`,`N`],resolve:e=>dC.indexOf(e)===-1?H:null,identify:e=>e===null,represent:()=>`null`}),pC=sC(`tag:yaml.org,2002:null`,{implicit:!0,implicitFirstChars:[`n`],resolve:(e,t)=>e===`null`||t&&e===``?null:H,identify:e=>e===null,represent:()=>`null`}),mC=[``,`~`,`null`,`Null`,`NULL`],hC=sC(`tag:yaml.org,2002:null`,{implicit:!0,implicitFirstChars:[``,`~`,`n`,`N`],resolve:e=>mC.indexOf(e)===-1?H:null,identify:e=>e===null,represent:()=>`null`}),gC=[`true`,`True`,`TRUE`],_C=[`false`,`False`,`FALSE`],vC=sC(`tag:yaml.org,2002:bool`,{implicit:!0,implicitFirstChars:[`t`,`T`,`f`,`F`],resolve:e=>gC.indexOf(e)!==-1||_C.indexOf(e)===-1&&H,identify:e=>Object.prototype.toString.call(e)===`[object Boolean]`,represent:e=>e?`true`:`false`}),yC=[`true`],bC=[`false`],xC=sC(`tag:yaml.org,2002:bool`,{implicit:!0,implicitFirstChars:[`t`,`f`],resolve:e=>yC.indexOf(e)!==-1||bC.indexOf(e)===-1&&H,identify:e=>Object.prototype.toString.call(e)===`[object Boolean]`,represent:e=>e?`true`:`false`}),SC=[`true`,`True`,`TRUE`,`y`,`Y`,`yes`,`Yes`,`YES`,`on`,`On`,`ON`],CC=[`false`,`False`,`FALSE`,`n`,`N`,`no`,`No`,`NO`,`off`,`Off`,`OFF`],wC=sC(`tag:yaml.org,2002:bool`,{implicit:!0,implicitFirstChars:[`y`,`Y`,`n`,`N`,`t`,`T`,`f`,`F`,`o`,`O`],resolve:e=>SC.indexOf(e)!==-1||CC.indexOf(e)===-1&&H,identify:e=>Object.prototype.toString.call(e)===`[object Boolean]`,represent:e=>e?`true`:`false`}),TC=RegExp(`^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$`),EC=RegExp(`^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$`);function DC(e){let t=e,n=1;return(t[0]===`-`||t[0]===`+`)&&(t[0]===`-`&&(n=-1),t=t.slice(1)),t.startsWith(`0b`)?n*parseInt(t.slice(2),2):t.startsWith(`0o`)?n*parseInt(t.slice(2),8):t.startsWith(`0x`)?n*parseInt(t.slice(2),16):n*parseInt(t,10)}function OC(e,t){if(t){if(!EC.test(e))return H}else if(!TC.test(e))return H;let n=DC(e);return Number.isFinite(n)?n:H}var kC=sC(`tag:yaml.org,2002:int`,{implicit:!0,implicitFirstChars:[`-`,`+`,...`0123456789`],resolve:OC,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf(`e`)<0,represent:e=>e.toString(10)}),AC=RegExp(`^-?(?:0|[1-9][0-9]*)$`),jC=RegExp(`^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$`);function MC(e){let t=e,n=1;return(t[0]===`-`||t[0]===`+`)&&(t[0]===`-`&&(n=-1),t=t.slice(1)),t.startsWith(`0b`)?n*parseInt(t.slice(2),2):t.startsWith(`0o`)?n*parseInt(t.slice(2),8):t.startsWith(`0x`)?n*parseInt(t.slice(2),16):n*parseInt(t,10)}function NC(e,t){if(t){if(!jC.test(e))return H}else if(!AC.test(e))return H;let n=MC(e);return Number.isFinite(n)?n:H}var PC=sC(`tag:yaml.org,2002:int`,{implicit:!0,implicitFirstChars:[`-`,...`0123456789`],resolve:NC,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf(`e`)<0,represent:e=>e.toString(10)}),FC=RegExp(`^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$`);function IC(e){let t=e.replace(/_/g,``),n=1;if((t[0]===`-`||t[0]===`+`)&&(t[0]===`-`&&(n=-1),t=t.slice(1)),t.startsWith(`0b`))return n*parseInt(t.slice(2),2);if(t.startsWith(`0x`))return n*parseInt(t.slice(2),16);if(t.includes(`:`)){let e=0;for(let n of t.split(`:`))e=e*60+Number(n);return n*e}return t!==`0`&&t[0]===`0`?n*parseInt(t,8):n*parseInt(t,10)}function LC(e){if(!FC.test(e))return H;let t=IC(e);return Number.isFinite(t)?t:H}var RC=sC(`tag:yaml.org,2002:int`,{implicit:!0,implicitFirstChars:[`-`,`+`,...`0123456789`],resolve:LC,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf(`e`)<0,represent:e=>e.toString(10)}),zC=RegExp(`^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`),BC=RegExp(`^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function VC(e){if(!zC.test(e))return H;let t=e.toLowerCase(),n=t[0]===`-`?-1:1;if(`+-`.includes(t[0])&&(t=t.slice(1)),t===`.inf`)return n===1?1/0:-1/0;if(t===`.nan`)return NaN;let r=n*parseFloat(t);return Number.isFinite(r)||BC.test(e)?r:H}function HC(e){if(isNaN(e))return`.nan`;if(e===1/0)return`.inf`;if(e===-1/0)return`-.inf`;if(Object.is(e,-0))return`-0.0`;let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace(`e`,`.e`):t}var UC=sC(`tag:yaml.org,2002:float`,{implicit:!0,implicitFirstChars:[`-`,`+`,`.`,...`0123456789`],resolve:VC,identify:e=>typeof e==`number`&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf(`e`)>=0),represent:HC}),WC=RegExp(`^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$`),GC=RegExp(`^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function KC(e,t){if(t){if(!GC.test(e))return H;let t=e.toLowerCase(),n=t[0]===`-`?-1:1;if(`+-`.includes(t[0])&&(t=t.slice(1)),t===`.inf`)return n===1?1/0:-1/0;if(t===`.nan`)return NaN;let r=n*parseFloat(t);return Number.isFinite(r)?r:H}if(!WC.test(e))return H;let n=Number(e);return Number.isFinite(n)?n:H}function qC(e){if(isNaN(e))return`.nan`;if(e===1/0)return`.inf`;if(e===-1/0)return`-.inf`;if(Object.is(e,-0))return`-0.0`;let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace(`e`,`.e`):t}var JC=sC(`tag:yaml.org,2002:float`,{implicit:!0,implicitFirstChars:[`-`,...`0123456789`],resolve:KC,identify:e=>typeof e==`number`&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf(`e`)>=0),represent:qC}),YC=RegExp(`^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`),XC=RegExp(`^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function ZC(e){if(!YC.test(e))return H;let t=e.toLowerCase().replace(/_/g,``),n=t[0]===`-`?-1:1;if(`+-`.includes(t[0])&&(t=t.slice(1)),t===`.inf`)return n===1?1/0:-1/0;if(t===`.nan`)return NaN;let r=0;if(t.includes(`:`)){for(let e of t.split(`:`))r=r*60+Number(e);r*=n}else r=n*parseFloat(t);return Number.isFinite(r)||XC.test(e)?r:H}function QC(e){if(isNaN(e))return`.nan`;if(e===1/0)return`.inf`;if(e===-1/0)return`-.inf`;if(Object.is(e,-0))return`-0.0`;let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace(`e`,`.e`):t}var $C=sC(`tag:yaml.org,2002:float`,{implicit:!0,implicitFirstChars:[`-`,`+`,`.`,...`0123456789`],resolve:ZC,identify:e=>typeof e==`number`&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf(`e`)>=0),represent:QC}),ew=sC(`tag:yaml.org,2002:merge`,{implicit:!0,implicitFirstChars:[`<`],resolve:(e,t)=>e===`<<`||t&&e===``?`<<`:H,identify:()=>!1}),tw=/^[A-Za-z0-9+/]*={0,2}$/;function nw(e){let t=e.replace(/\s/g,``);if(t.length%4!=0||!tw.test(t))return H;let n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}function rw(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}var iw=sC(`tag:yaml.org,2002:binary`,{resolve:nw,identify:e=>Object.prototype.toString.call(e)===`[object Uint8Array]`,represent:rw}),aw=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$`),ow=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$`);function sw(e,t,n,r=0,i=0,a=0,o=0){let s=new Date(Date.UTC(e,t,n,r,i,a,o));return s.setUTCFullYear(e,t,n),s}function cw(e){let t=aw.exec(e);if(t===null&&(t=ow.exec(e)),t===null)return H;let n=+t[1],r=t[2]-1,i=+t[3];if(!t[4]){let e=sw(n,r,i);return e.getUTCFullYear()!==n||e.getUTCMonth()!==r||e.getUTCDate()!==i?H:e}let a=+t[4],o=+t[5],s=+t[6],c=0;if(a>23||o>59||s>59)return H;if(t[7]){let e=t[7].slice(0,3);for(;e.length<3;)e+=`0`;c=+e}let l=sw(n,r,i,a,o,s,c);if(l.getUTCFullYear()!==n||l.getUTCMonth()!==r||l.getUTCDate()!==i)return H;if(t[9]){let e=+t[10],n=+(t[11]||0);if(e>23||n>59)return H;let r=(e*60+n)*6e4;l.setTime(l.getTime()-(t[9]===`-`?-r:r))}return l}var lw=sC(`tag:yaml.org,2002:timestamp`,{implicit:!0,implicitFirstChars:[...`0123456789`],resolve:cw,identify:e=>e instanceof Date,represent:e=>e.toISOString()}),uw=cC(`tag:yaml.org,2002:seq`,{create:()=>[],addItem:(e,t)=>{e.push(t)},identify:Array.isArray});function dw(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function fw(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}var pw=cC(`tag:yaml.org,2002:omap`,{create:()=>({list:[],seen:new Set}),addItem:(e,t)=>{let n;if(t instanceof Map){if(t.size!==1)return`cannot resolve an ordered map item`;n=t.keys().next().value}else if(dw(t)){let e=Object.keys(t);if(e.length!==1)return`cannot resolve an ordered map item`;n=e[0]}else return`cannot resolve an ordered map item`;return e.seen.has(n)?`duplicate key in ordered map`:(e.seen.add(n),e.list.push(t),``)},finalize:e=>e.list,identify:()=>!1}),mw=cC(`tag:yaml.org,2002:pairs`,{create:()=>[],addItem:(e,t)=>{if(t instanceof Map)return t.size===1?(e.push(t.entries().next().value),``):`cannot resolve a pairs item`;if(Object.prototype.toString.call(t)!==`[object Object]`)return`cannot resolve a pairs item`;let n=t,r=Object.keys(n);return r.length===1?(e.push([r[0],n[r[0]]]),``):`cannot resolve a pairs item`},identify:()=>!1}),hw=lC(`tag:yaml.org,2002:map`,{create:()=>({}),identify:dw,represent:e=>{let t=new Map;for(let n of Object.keys(e))t.set(n,e[n]);return t},addPair:(e,t,n)=>{if(typeof t==`object`&&t)return`object-based map does not support complex keys`;let r=String(t);return r===`__proto__`?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,``},has:(e,t)=>typeof t==`object`&&t?!1:Object.prototype.hasOwnProperty.call(e,String(t)),keys:e=>Object.keys(e),get:(e,t)=>{let n=String(t);return Object.prototype.hasOwnProperty.call(e,n)?e[n]:null}}),gw=lC(`tag:yaml.org,2002:set`,{create:()=>new Set,identify:e=>e instanceof Set,represent:e=>{let t=new Map;for(let n of e)t.set(n,null);return t},addPair:(e,t,n)=>n===null?(e.add(t),``):`cannot resolve a set item`,has:(e,t)=>e.has(t),keys:e=>e.keys(),get:()=>null});function _w(){return{scalar:Object.create(null),sequence:Object.create(null),mapping:Object.create(null)}}function vw(){return{scalar:[],sequence:[],mapping:[]}}function yw(e){let t=[];for(let n of e){let e=t.length;for(let r=0;r<t.length;r++){let i=t[r];if(i.nodeKind===n.nodeKind&&i.tagName===n.tagName&&i.matchByTagPrefix===n.matchByTagPrefix){e=r;break}}t[e]=n}return t}var bw=class e{tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(e){let t=yw(e),n=[],r=_w(),i=vw();for(let e of t){if(e.nodeKind===`scalar`&&e.implicit){if(e.matchByTagPrefix)throw Error(`Implicit scalar tags cannot match by tag prefix`);n.push(e)}switch(e.nodeKind){case`scalar`:e.matchByTagPrefix?i.scalar.push(e):r.scalar[e.tagName]=e;break;case`sequence`:e.matchByTagPrefix?i.sequence.push(e):r.sequence[e.tagName]=e;break;case`mapping`:e.matchByTagPrefix?i.mapping.push(e):r.mapping[e.tagName]=e}}let a=n.filter(e=>e.implicitFirstChars===null),o=new Set;for(let e of n)if(e.implicitFirstChars!==null)for(let t of e.implicitFirstChars)o.add(t);let s=new Map;for(let e of o)s.set(e,n.filter(t=>t.implicitFirstChars===null||t.implicitFirstChars.indexOf(e)!==-1));let c=r.scalar[`tag:yaml.org,2002:str`];if(!c)throw Error(`schema does not define the default scalar tag (tag:yaml.org,2002:str)`);this.tags=t,this.implicitScalarTags=n,this.implicitScalarByFirstChar=s,this.implicitScalarAnyFirstChar=a,this.defaultScalarTag=c,this.defaultSequenceTag=r.sequence[`tag:yaml.org,2002:seq`],this.defaultMappingTag=r.mapping[`tag:yaml.org,2002:map`],this.exact=r,this.prefix=i}lookupScalarTag(e){let t=this.exact.scalar[e];if(t)return t;for(let t of this.prefix.scalar)if(e.startsWith(t.tagName))return t}lookupSequenceTag(e){let t=this.exact.sequence[e];if(t)return t;for(let t of this.prefix.sequence)if(e.startsWith(t.tagName))return t}lookupMappingTag(e){let t=this.exact.mapping[e];if(t)return t;for(let t of this.prefix.mapping)if(e.startsWith(t.tagName))return t}resolveImplicitScalarTag(e){let t=this.implicitScalarByFirstChar.get(e.charAt(0))??this.implicitScalarAnyFirstChar;for(let n of t){let t=n.resolve(e,!1,n.tagName);if(t!==H)return{value:t,tag:n}}let n=this.defaultScalarTag;return{value:n.resolve(e,!1,n.tagName),tag:n}}withTags(...t){let n=[];for(let e of t)n=n.concat(e);return new e([...this.tags,...n])}},xw=new bw([uC,uw,hw]),Sw=new bw([...xw.tags,pC,xC,PC,JC]),Cw=new bw([...xw.tags,fC,vC,kC,UC]),ww=new bw([...xw.tags,hC,wC,RC,$C,lw,ew,iw,pw,mw,gw]).withTags({...RC,resolve:(e,t,n)=>{let r=RC.resolve(e,t,n);return r===H?kC.resolve(e,t,n):r}},{...$C,resolve:(e,t,n)=>{let r=$C.resolve(e,t,n);return r===H?UC.resolve(e,t,n):r}});lC(`tag:yaml.org,2002:map`,{create:()=>new Map,addPair:(e,t,n)=>(e.set(t,n),``),has:(e,t)=>e.has(t),keys:e=>e.keys(),get:(e,t)=>e.get(t),identify:e=>e instanceof Map||dw(e),represent:e=>{if(e instanceof Map)return e;let t=new Map,n=e;for(let e of Object.keys(n))t.set(e,n[e]);return t}});function Tw(e){if(Array.isArray(e)){let t=Array.prototype.slice.call(e);for(let e=0;e<t.length;e++){if(Array.isArray(t[e]))return null;typeof t[e]==`object`&&Object.prototype.toString.call(t[e])===`[object Object]`&&(t[e]=`[object Object]`)}return String(t)}return typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`?`[object Object]`:String(e)}lC(`tag:yaml.org,2002:map`,{create:()=>({}),identify:dw,represent:e=>{let t=new Map;for(let n of Object.keys(e))t.set(n,e[n]);return t},addPair:(e,t,n)=>{let r=Tw(t);return r===null?`nested arrays are not supported inside keys`:(r===`__proto__`?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,``)},has:(e,t)=>{let n=Tw(t);return n!==null&&Object.prototype.hasOwnProperty.call(e,n)},keys:e=>Object.keys(e),get:(e,t)=>{let n=String(t);return Object.prototype.hasOwnProperty.call(e,n)?e[n]:null}});var Ew={maxLength:79,indent:1,linesBefore:3,linesAfter:2};function Dw(e,t,n,r,i){let a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}function Ow(e,t){return` `.repeat(Math.max(t-e.length,0))+e}function kw(e,t){if(!e.buffer)return null;let n={...Ew,...t},r=/\r?\n|\r|\0/g,i=[0],a=[],o,s=-1;for(;o=r.exec(e.buffer);)a.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);let c=``,l=Math.min(e.line+n.linesAfter,a.length).toString().length,u=n.maxLength-(n.indent+l+3);for(let t=1;t<=n.linesBefore&&!(s-t<0);t++){let r=Dw(e.buffer,i[s-t],a[s-t],e.position-(i[s]-i[s-t]),u);c=`${` `.repeat(n.indent)}${Ow((e.line-t+1).toString(),l)} | ${r.str}\n${c}`}let d=Dw(e.buffer,i[s],a[s],e.position,u);c+=`${` `.repeat(n.indent)}${Ow((e.line+1).toString(),l)} | ${d.str}\n`,c+=`${`-`.repeat(n.indent+l+3+d.pos)}^\n`;for(let t=1;t<=n.linesAfter&&!(s+t>=a.length);t++){let r=Dw(e.buffer,i[s+t],a[s+t],e.position-(i[s]-i[s+t]),u);c+=`${` `.repeat(n.indent)}${Ow((e.line+t+1).toString(),l)} | ${r.str}\n`}return c.replace(/\n$/,``)}function Aw(e,t){let n=``;return e.mark?(e.mark.name&&(n+=`in "${e.mark.name}" `),n+=`(${e.mark.line+1}:${e.mark.column+1})`,!t&&e.mark.snippet&&(n+=`\n\n${e.mark.snippet}`),`${e.reason} ${n}`):e.reason}var jw=class e extends Error{reason;mark;constructor(e,t){super(),this.name=`YAMLException`,this.reason=e,this.mark=t,this.message=Aw(this,!1),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(e){return`${this.name}: ${Aw(this,e)}`}static throwAt(t,n,r,i=``){let a=0,o=0;for(let e=0;e<n;e++){let n=t.charCodeAt(e);n===10?(a++,o=e+1):n===13&&(a++,t.charCodeAt(e+1)===10&&e++,o=e+1)}let s={name:i,buffer:t,position:n,line:a,column:n-o};throw s.snippet=kw(s),new e(r,s)}},U={DOCUMENT:1,SEQUENCE:2,MAPPING:3,SCALAR:4,ALIAS:5,POP:6},W={PLAIN:1,SINGLE_QUOTED:2,DOUBLE_QUOTED:3,LITERAL_BLOCK:4,FOLDED_BLOCK:5},Mw={BLOCK:1,FLOW:2},Nw={CLIP:1,STRIP:2,KEEP:3},Pw=-1;function Fw(e){switch(e){case 48:return`\0`;case 97:return`\x07`;case 98:return`\b`;case 116:return` `;case 9:return` `;case 110:return`
|
|
122
|
-
`;case 118:return`\v`;case 102:return`\f`;case 114:return`\r`;case 101:return`\x1B`;case 32:return` `;case 34:return`"`;case 47:return`/`;case 92:return`\\`;case 78:return`
`;case 95:return`\xA0`;case 76:return`\u2028`;case 80:return`\u2029`;default:return``}}var
|
|
123
|
-
`.repeat(e-1)}function
|
|
120
|
+
`:`>`,a}renderInline(e,t,n={}){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=i[e[a].type];if(o){let i=o(e,a,t,n,this);if(Tb(i))throw Error(`Renderer.renderInline: async rule detected, use renderInlineAsync()`);r+=i}else r+=this.renderToken(e,a,t,n)}return r}renderInlineAsText(e,t,n={}){let r=``;for(let i=0,a=e.length;i<a;i++){let a=e[i];switch(a.type){case`text`:r+=a.content;break;case`image`:r+=this.renderInlineAsText(a.children,t,n);break;case`html_inline`:case`html_block`:r+=a.content;break;case`softbreak`:case`hardbreak`:r+=`
|
|
121
|
+
`}}return r}render(e,t,n={}){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;if(o===`inline`)r+=this.renderInline(e[a].children,t,n);else{let s=i[o];if(s){let i=s(e,a,t,n,this);if(Tb(i))throw Error(`Renderer.render: async rule detected, use renderAsync()`);r+=i}else r+=this.renderToken(e,a,t,n)}}return r}async renderInlineAsync(t,n,r){let i=this.renderInline;if(i!==e.prototype.renderInline&&this.renderInlineAsync===e.prototype.renderInlineAsync)return i.call(this,t,n,r);let a=[],o=this.rules;for(let e=0,i=t.length;e<i;e++){let i=o[t[e].type];i?a.push(Promise.resolve(i(t,e,n,r,this))):a.push(Promise.resolve(this.renderToken(t,e,n,r)))}return(await Promise.all(a)).join(``)}async renderAsync(t,n,r){let i=this.render;if(i!==e.prototype.render&&this.renderAsync===e.prototype.renderAsync)return i.call(this,t,n,r);let a=[],o=this.rules;for(let e=0,i=t.length;e<i;e++){let i=t[e],s=i.type;if(s===`inline`)a.push(this.renderInlineAsync(i.children,n,r));else{let i=o[s];i?a.push(Promise.resolve(i(t,e,n,r,this))):a.push(Promise.resolve(this.renderToken(t,e,n,r)))}}return(await Promise.all(a)).join(``)}},ES={default:SS,zero:CS,commonmark:xS},DS=class extends bS{renderer=new TS;utils=Zy;options={...ES.default.options};constructor(e,t){super();let[n,r]=typeof e==`string`?[e,t]:[`default`,e];this.configure(n),r&&this.set(r)}set(e){return tb(this.options,e),this}configure(e){if(typeof e==`string`){let t=e;if(e=ES[t],!e)throw Error(`Wrong \`markdown-exit\` preset "${t}", check name`)}if(!e)throw Error("Wrong `markdown-exit` preset, can't be empty");if(e.options&&this.set(e.options),e.components)for(let t of Object.keys(e.components)){let n=e.components[t];n.rules&&this[t].ruler.enableOnly(n.rules),n.rules2&&this[t].ruler2?.enableOnly(n.rules2)}return this}enable(e,t){let n=[];Array.isArray(e)||(e=[e]);for(let t of[`core`,`block`,`inline`])n=n.concat(this[t].ruler.enable(e,!0));n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter(e=>!n.includes(e));if(r.length&&!t)throw Error(`MarkdownExit. Failed to enable unknown rule(s): ${r}`);return this}disable(e,t){let n=[];Array.isArray(e)||(e=[e]);for(let t of[`core`,`block`,`inline`])n=n.concat(this[t].ruler.disable(e,!0));n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter(e=>!n.includes(e));if(r.length&&!t)throw Error(`MarkdownExit. Failed to disable unknown rule(s): ${r}`);return this}use(e,...t){return e.apply(e,[this,...t]),this}render(e,t={}){return this.renderer.render(this.parse(e,t),this.options,t)}renderAsync(e,t={}){return this.renderer.renderAsync(this.parse(e,t),this.options,t)}renderInline(e,t={}){return this.renderer.render(this.parseInline(e,t),this.options,t)}renderInlineAsync(e,t={}){return this.renderer.renderAsync(this.parseInline(e,t),this.options,t)}};function OS(e){function t(...t){return new e(...t)}return Object.setPrototypeOf(t,DS),t.prototype=DS.prototype,t.prototype.constructor=t,t}var kS=OS(DS);function AS(e,t){let n=new Map;for(let t of e)n.set(t.name,t);let r=new Set;for(let e of t)r.has(e.name)||(r.add(e.name),n.delete(e.name),n.set(e.name,e));return[...n.values()]}function jS(e){return e}function MS(e,t){if(e[t]!==`[`)return-1;let n=t+1,r=0;for(;n<e.length;)if(e[n]===`\\`&&n+1<e.length)n+=2;else{if(e[n]===`[`)r++;else if(e[n]===`]`){if(r===0)return n;r--}n+=1}return-1}function NS(e,t){let n=MS(e,t);return n===-1?null:{content:e.slice(t+1,n),endIndex:n+1}}var PS=[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 FS(e){return e===0||e>=55296&&e<=57343||e>1114111}function IS(e){return FS(e)?65533:e>=128&&e<=159&&PS[e-128]||e}function LS(e){return e-1>>>0<127||e-160>>>0<55136?String.fromCharCode(e):String.fromCodePoint(IS(e))}var RS=(()=>{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 zS(e,t,n,r,i,a){let o=e.length,s=a*90,c=0,l=()=>{let t=RS[e.charCodeAt(c++)];return t<a?t:t*91-s+RS[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=RS[e.charCodeAt(c++)];if(t<89)r+=t,f[i++]=r;else if(t===89){let t=RS[e.charCodeAt(c++)]+2;for(;t--;)f[i++]=++r}else{let t=RS[e.charCodeAt(c++)];r+=89+(t<90?t*91+RS[e.charCodeAt(c++)]:RS[e.charCodeAt(c++)]*8281+RS[e.charCodeAt(c++)]*91+RS[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=RS[e.charCodeAt(c++)];t>=a&&(t=t*91-s+RS[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 BS=zS("!}.&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%}&*#%})%#%#)}#&#-#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u,q`xTo]/a5aU!bNaDXbi!b-!ao!b<bwA!#5@B932:aV2G|:d-)Y#hJrL>RhG<7@C5<H|_=Cau:5aj5@B932:bJ|ng>vIbs)#?C2F|9jPv0w.vISh-MKvUaz(.!9ABbb|[5;5<H|Eg>unwfh;9:4E|YjQsBt|vjx'hYq3!(?C2F|J:2<BaY?C2F|GOu!5x,g|p{ah!-(?C2F|c9:4E|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),VS;(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`})(VS||={});var HS;(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`})(HS||={});var US=32,WS=21,GS=2097151,KS=2047,qS=0;function JS(e){let t=e>>>WS;return t===KS?qS:t}function YS(e){return e-HS.ZERO>>>0<=9}function XS(e){return(e|US)-HS.LOWER_A>>>0<=5}function ZS(e){return(e|US)-HS.LOWER_A>>>0<=25}function QS(e){return e===HS.EQUALS||ZS(e)||YS(e)}var $S;(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`})($S||={});var eC;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(eC||={});function tC(e,t,n,r){let i=(t&VS.BRANCH_LENGTH)>>7,a=t&VS.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 nC(e,t,n){return n===1?String.fromCharCode(e[t]&VS.VALUE_MASK):n===2?String.fromCharCode(e[t+1]):String.fromCharCode(e[t+1],e[t+2])}function rC(e,t,n){let r=t+1,i=0,a=r;if(r<n&&(e.charCodeAt(r)|US)===HS.LOWER_X)for(r+=1,a=r;r<n;){let t=e.charCodeAt(r);if(YS(t))i=i*16+(t-HS.ZERO);else if(XS(t))i=i*16+((t|US)-HS.LOWER_A+10);else break;r+=1}else for(;r<n;){let t=e.charCodeAt(r)-HS.ZERO;if(t>>>0>9)break;i=i*10+t,r+=1}if(r===a)return 0;r<n&&e.charCodeAt(r)===HS.SEMI&&(r+=1),i>1114111&&(i=1114112);let o=r-t;return o>=KS&&(qS=o,o=KS),o<<WS|i}function iC(e,t,n){let r=BS,i=e.indexOf(`&`);if(i<0)return e;let a=e.length,o=0,s=``,c=r[0],l=c&VS.JUMP_TABLE,u=(c&VS.BRANCH_LENGTH)>>7;do{let c=i+1,d=e.charCodeAt(c),f,p;if(d===HS.NUM){let n=rC(e,c,a);f=JS(n),t&&f>0&&e.charCodeAt(c+f-1)!==HS.SEMI&&(f=0),p=f===0?``:LS(n&GS)}else if(ZS(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&(VS.VALUE_LENGTH|VS.FLAG13))===0&&(m&VS.JUMP_TABLE)!==0;){let t=m&VS.JUMP_TABLE,n=(m&VS.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&(VS.VALUE_LENGTH|VS.FLAG13))===VS.FLAG13){let t=(m&VS.BRANCH_LENGTH)>>7;if(e.charCodeAt(h)!==(m&VS.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===HS.SEMI){f=h-c+1,p=n===1?String.fromCharCode(m&VS.VALUE_MASK):nC(r,i,n);break}if(!t&&(m&VS.FLAG13)===0&&(f=h-c,o=i,s=n),n===1)break}let u=tC(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&VS.FLAG13)===0&&(f=h-c,o=i,s=e),f>0&&(p=nC(r,o,s))}}else f=0,p=``;f===0||n&&d!==HS.NUM&&e.charCodeAt(c+f-1)!==HS.SEMI&&c+f<a&&QS(e.charCodeAt(c+f))?i=c:(o<i&&(s+=e.slice(o,i)),s+=p,i=o=c+f),e.charCodeAt(i)!==HS.AMP&&(i=e.indexOf(`&`,i))}while(i>=0);return s+e.slice(o)}function aC(e,t=eC.Legacy){return iC(e,t===eC.Strict,t===eC.Attribute)}var U=Symbol(`NOT_RESOLVED`);function oC(e,t){return{tagName:e,nodeKind:`scalar`,implicit:t.implicit??!1,matchByTagPrefix:t.matchByTagPrefix??!1,implicitFirstChars:t.implicitFirstChars??null,resolve:t.resolve,identify:t.identify,represent:t.represent??(e=>String(e)),representTagName:t.representTagName??(()=>e)}}function sC(e,t){let n=t.finalize===void 0;return{tagName:e,nodeKind:`sequence`,implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addItem:t.addItem,finalize:t.finalize??(e=>e),carrierIsResult:n,identify:t.identify,represent:t.represent??(e=>e),representTagName:t.representTagName??(()=>e)}}function cC(e,t){let n=t.finalize===void 0;return{tagName:e,nodeKind:`mapping`,implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addPair:t.addPair,has:t.has,keys:t.keys,get:t.get,finalize:t.finalize??(e=>e),carrierIsResult:n,identify:t.identify,represent:t.represent??(e=>e),representTagName:t.representTagName??(()=>e)}}var lC=oC(`tag:yaml.org,2002:str`,{resolve:e=>e,identify:e=>typeof e==`string`}),uC=[``,`~`,`null`,`Null`,`NULL`],dC=oC(`tag:yaml.org,2002:null`,{implicit:!0,implicitFirstChars:[``,`~`,`n`,`N`],resolve:e=>uC.indexOf(e)===-1?U:null,identify:e=>e===null,represent:()=>`null`}),fC=oC(`tag:yaml.org,2002:null`,{implicit:!0,implicitFirstChars:[`n`],resolve:(e,t)=>e===`null`||t&&e===``?null:U,identify:e=>e===null,represent:()=>`null`}),pC=[``,`~`,`null`,`Null`,`NULL`],mC=oC(`tag:yaml.org,2002:null`,{implicit:!0,implicitFirstChars:[``,`~`,`n`,`N`],resolve:e=>pC.indexOf(e)===-1?U:null,identify:e=>e===null,represent:()=>`null`}),hC=[`true`,`True`,`TRUE`],gC=[`false`,`False`,`FALSE`],_C=oC(`tag:yaml.org,2002:bool`,{implicit:!0,implicitFirstChars:[`t`,`T`,`f`,`F`],resolve:e=>hC.indexOf(e)!==-1||gC.indexOf(e)===-1&&U,identify:e=>Object.prototype.toString.call(e)===`[object Boolean]`,represent:e=>e?`true`:`false`}),vC=[`true`],yC=[`false`],bC=oC(`tag:yaml.org,2002:bool`,{implicit:!0,implicitFirstChars:[`t`,`f`],resolve:e=>vC.indexOf(e)!==-1||yC.indexOf(e)===-1&&U,identify:e=>Object.prototype.toString.call(e)===`[object Boolean]`,represent:e=>e?`true`:`false`}),xC=[`true`,`True`,`TRUE`,`y`,`Y`,`yes`,`Yes`,`YES`,`on`,`On`,`ON`],SC=[`false`,`False`,`FALSE`,`n`,`N`,`no`,`No`,`NO`,`off`,`Off`,`OFF`],CC=oC(`tag:yaml.org,2002:bool`,{implicit:!0,implicitFirstChars:[`y`,`Y`,`n`,`N`,`t`,`T`,`f`,`F`,`o`,`O`],resolve:e=>xC.indexOf(e)!==-1||SC.indexOf(e)===-1&&U,identify:e=>Object.prototype.toString.call(e)===`[object Boolean]`,represent:e=>e?`true`:`false`}),wC=RegExp(`^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$`),TC=RegExp(`^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$`);function EC(e){let t=e,n=1;return(t[0]===`-`||t[0]===`+`)&&(t[0]===`-`&&(n=-1),t=t.slice(1)),t.startsWith(`0b`)?n*parseInt(t.slice(2),2):t.startsWith(`0o`)?n*parseInt(t.slice(2),8):t.startsWith(`0x`)?n*parseInt(t.slice(2),16):n*parseInt(t,10)}function DC(e,t){if(t){if(!TC.test(e))return U}else if(!wC.test(e))return U;let n=EC(e);return Number.isFinite(n)?n:U}var OC=oC(`tag:yaml.org,2002:int`,{implicit:!0,implicitFirstChars:[`-`,`+`,...`0123456789`],resolve:DC,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf(`e`)<0,represent:e=>e.toString(10)}),kC=RegExp(`^-?(?:0|[1-9][0-9]*)$`),AC=RegExp(`^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$`);function jC(e){let t=e,n=1;return(t[0]===`-`||t[0]===`+`)&&(t[0]===`-`&&(n=-1),t=t.slice(1)),t.startsWith(`0b`)?n*parseInt(t.slice(2),2):t.startsWith(`0o`)?n*parseInt(t.slice(2),8):t.startsWith(`0x`)?n*parseInt(t.slice(2),16):n*parseInt(t,10)}function MC(e,t){if(t){if(!AC.test(e))return U}else if(!kC.test(e))return U;let n=jC(e);return Number.isFinite(n)?n:U}var NC=oC(`tag:yaml.org,2002:int`,{implicit:!0,implicitFirstChars:[`-`,...`0123456789`],resolve:MC,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf(`e`)<0,represent:e=>e.toString(10)}),PC=RegExp(`^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$`);function FC(e){let t=e.replace(/_/g,``),n=1;if((t[0]===`-`||t[0]===`+`)&&(t[0]===`-`&&(n=-1),t=t.slice(1)),t.startsWith(`0b`))return n*parseInt(t.slice(2),2);if(t.startsWith(`0x`))return n*parseInt(t.slice(2),16);if(t.includes(`:`)){let e=0;for(let n of t.split(`:`))e=e*60+Number(n);return n*e}return t!==`0`&&t[0]===`0`?n*parseInt(t,8):n*parseInt(t,10)}function IC(e){if(!PC.test(e))return U;let t=FC(e);return Number.isFinite(t)?t:U}var LC=oC(`tag:yaml.org,2002:int`,{implicit:!0,implicitFirstChars:[`-`,`+`,...`0123456789`],resolve:IC,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf(`e`)<0,represent:e=>e.toString(10)}),RC=RegExp(`^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`),zC=RegExp(`^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function BC(e){if(!RC.test(e))return U;let t=e.toLowerCase(),n=t[0]===`-`?-1:1;if(`+-`.includes(t[0])&&(t=t.slice(1)),t===`.inf`)return n===1?1/0:-1/0;if(t===`.nan`)return NaN;let r=n*parseFloat(t);return Number.isFinite(r)||zC.test(e)?r:U}function VC(e){if(isNaN(e))return`.nan`;if(e===1/0)return`.inf`;if(e===-1/0)return`-.inf`;if(Object.is(e,-0))return`-0.0`;let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace(`e`,`.e`):t}var HC=oC(`tag:yaml.org,2002:float`,{implicit:!0,implicitFirstChars:[`-`,`+`,`.`,...`0123456789`],resolve:BC,identify:e=>typeof e==`number`&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf(`e`)>=0),represent:VC}),UC=RegExp(`^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$`),WC=RegExp(`^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function GC(e,t){if(t){if(!WC.test(e))return U;let t=e.toLowerCase(),n=t[0]===`-`?-1:1;if(`+-`.includes(t[0])&&(t=t.slice(1)),t===`.inf`)return n===1?1/0:-1/0;if(t===`.nan`)return NaN;let r=n*parseFloat(t);return Number.isFinite(r)?r:U}if(!UC.test(e))return U;let n=Number(e);return Number.isFinite(n)?n:U}function KC(e){if(isNaN(e))return`.nan`;if(e===1/0)return`.inf`;if(e===-1/0)return`-.inf`;if(Object.is(e,-0))return`-0.0`;let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace(`e`,`.e`):t}var qC=oC(`tag:yaml.org,2002:float`,{implicit:!0,implicitFirstChars:[`-`,...`0123456789`],resolve:GC,identify:e=>typeof e==`number`&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf(`e`)>=0),represent:KC}),JC=RegExp(`^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`),YC=RegExp(`^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function XC(e){if(!JC.test(e))return U;let t=e.toLowerCase().replace(/_/g,``),n=t[0]===`-`?-1:1;if(`+-`.includes(t[0])&&(t=t.slice(1)),t===`.inf`)return n===1?1/0:-1/0;if(t===`.nan`)return NaN;let r=0;if(t.includes(`:`)){for(let e of t.split(`:`))r=r*60+Number(e);r*=n}else r=n*parseFloat(t);return Number.isFinite(r)||YC.test(e)?r:U}function ZC(e){if(isNaN(e))return`.nan`;if(e===1/0)return`.inf`;if(e===-1/0)return`-.inf`;if(Object.is(e,-0))return`-0.0`;let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace(`e`,`.e`):t}var QC=oC(`tag:yaml.org,2002:float`,{implicit:!0,implicitFirstChars:[`-`,`+`,`.`,...`0123456789`],resolve:XC,identify:e=>typeof e==`number`&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf(`e`)>=0),represent:ZC}),$C=oC(`tag:yaml.org,2002:merge`,{implicit:!0,implicitFirstChars:[`<`],resolve:(e,t)=>e===`<<`||t&&e===``?`<<`:U,identify:()=>!1}),ew=/^[A-Za-z0-9+/]*={0,2}$/;function tw(e){let t=e.replace(/\s/g,``);if(t.length%4!=0||!ew.test(t))return U;let n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}function nw(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}var rw=oC(`tag:yaml.org,2002:binary`,{resolve:tw,identify:e=>Object.prototype.toString.call(e)===`[object Uint8Array]`,represent:nw}),iw=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$`),aw=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$`);function ow(e,t,n,r=0,i=0,a=0,o=0){let s=new Date(Date.UTC(e,t,n,r,i,a,o));return s.setUTCFullYear(e,t,n),s}function sw(e){let t=iw.exec(e);if(t===null&&(t=aw.exec(e)),t===null)return U;let n=+t[1],r=t[2]-1,i=+t[3];if(!t[4]){let e=ow(n,r,i);return e.getUTCFullYear()!==n||e.getUTCMonth()!==r||e.getUTCDate()!==i?U:e}let a=+t[4],o=+t[5],s=+t[6],c=0;if(a>23||o>59||s>59)return U;if(t[7]){let e=t[7].slice(0,3);for(;e.length<3;)e+=`0`;c=+e}let l=ow(n,r,i,a,o,s,c);if(l.getUTCFullYear()!==n||l.getUTCMonth()!==r||l.getUTCDate()!==i)return U;if(t[9]){let e=+t[10],n=+(t[11]||0);if(e>23||n>59)return U;let r=(e*60+n)*6e4;l.setTime(l.getTime()-(t[9]===`-`?-r:r))}return l}var cw=oC(`tag:yaml.org,2002:timestamp`,{implicit:!0,implicitFirstChars:[...`0123456789`],resolve:sw,identify:e=>e instanceof Date,represent:e=>e.toISOString()}),lw=sC(`tag:yaml.org,2002:seq`,{create:()=>[],addItem:(e,t)=>{e.push(t)},identify:Array.isArray});function uw(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function dw(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}var fw=sC(`tag:yaml.org,2002:omap`,{create:()=>({list:[],seen:new Set}),addItem:(e,t)=>{let n;if(t instanceof Map){if(t.size!==1)return`cannot resolve an ordered map item`;n=t.keys().next().value}else if(uw(t)){let e=Object.keys(t);if(e.length!==1)return`cannot resolve an ordered map item`;n=e[0]}else return`cannot resolve an ordered map item`;return e.seen.has(n)?`duplicate key in ordered map`:(e.seen.add(n),e.list.push(t),``)},finalize:e=>e.list,identify:()=>!1}),pw=sC(`tag:yaml.org,2002:pairs`,{create:()=>[],addItem:(e,t)=>{if(t instanceof Map)return t.size===1?(e.push(t.entries().next().value),``):`cannot resolve a pairs item`;if(Object.prototype.toString.call(t)!==`[object Object]`)return`cannot resolve a pairs item`;let n=t,r=Object.keys(n);return r.length===1?(e.push([r[0],n[r[0]]]),``):`cannot resolve a pairs item`},identify:()=>!1}),mw=cC(`tag:yaml.org,2002:map`,{create:()=>({}),identify:uw,represent:e=>{let t=new Map;for(let n of Object.keys(e))t.set(n,e[n]);return t},addPair:(e,t,n)=>{if(typeof t==`object`&&t)return`object-based map does not support complex keys`;let r=String(t);return r===`__proto__`?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,``},has:(e,t)=>typeof t==`object`&&t?!1:Object.prototype.hasOwnProperty.call(e,String(t)),keys:e=>Object.keys(e),get:(e,t)=>{let n=String(t);return Object.prototype.hasOwnProperty.call(e,n)?e[n]:null}}),hw=cC(`tag:yaml.org,2002:set`,{create:()=>new Set,identify:e=>e instanceof Set,represent:e=>{let t=new Map;for(let n of e)t.set(n,null);return t},addPair:(e,t,n)=>n===null?(e.add(t),``):`cannot resolve a set item`,has:(e,t)=>e.has(t),keys:e=>e.keys(),get:()=>null});function gw(){return{scalar:Object.create(null),sequence:Object.create(null),mapping:Object.create(null)}}function _w(){return{scalar:[],sequence:[],mapping:[]}}function vw(e){let t=[];for(let n of e){let e=t.length;for(let r=0;r<t.length;r++){let i=t[r];if(i.nodeKind===n.nodeKind&&i.tagName===n.tagName&&i.matchByTagPrefix===n.matchByTagPrefix){e=r;break}}t[e]=n}return t}var yw=class e{tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(e){let t=vw(e),n=[],r=gw(),i=_w();for(let e of t){if(e.nodeKind===`scalar`&&e.implicit){if(e.matchByTagPrefix)throw Error(`Implicit scalar tags cannot match by tag prefix`);n.push(e)}switch(e.nodeKind){case`scalar`:e.matchByTagPrefix?i.scalar.push(e):r.scalar[e.tagName]=e;break;case`sequence`:e.matchByTagPrefix?i.sequence.push(e):r.sequence[e.tagName]=e;break;case`mapping`:e.matchByTagPrefix?i.mapping.push(e):r.mapping[e.tagName]=e}}let a=n.filter(e=>e.implicitFirstChars===null),o=new Set;for(let e of n)if(e.implicitFirstChars!==null)for(let t of e.implicitFirstChars)o.add(t);let s=new Map;for(let e of o)s.set(e,n.filter(t=>t.implicitFirstChars===null||t.implicitFirstChars.indexOf(e)!==-1));let c=r.scalar[`tag:yaml.org,2002:str`];if(!c)throw Error(`schema does not define the default scalar tag (tag:yaml.org,2002:str)`);this.tags=t,this.implicitScalarTags=n,this.implicitScalarByFirstChar=s,this.implicitScalarAnyFirstChar=a,this.defaultScalarTag=c,this.defaultSequenceTag=r.sequence[`tag:yaml.org,2002:seq`],this.defaultMappingTag=r.mapping[`tag:yaml.org,2002:map`],this.exact=r,this.prefix=i}lookupScalarTag(e){let t=this.exact.scalar[e];if(t)return t;for(let t of this.prefix.scalar)if(e.startsWith(t.tagName))return t}lookupSequenceTag(e){let t=this.exact.sequence[e];if(t)return t;for(let t of this.prefix.sequence)if(e.startsWith(t.tagName))return t}lookupMappingTag(e){let t=this.exact.mapping[e];if(t)return t;for(let t of this.prefix.mapping)if(e.startsWith(t.tagName))return t}resolveImplicitScalarTag(e){let t=this.implicitScalarByFirstChar.get(e.charAt(0))??this.implicitScalarAnyFirstChar;for(let n of t){let t=n.resolve(e,!1,n.tagName);if(t!==U)return{value:t,tag:n}}let n=this.defaultScalarTag;return{value:n.resolve(e,!1,n.tagName),tag:n}}withTags(...t){let n=[];for(let e of t)n=n.concat(e);return new e([...this.tags,...n])}},bw=new yw([lC,lw,mw]),xw=new yw([...bw.tags,fC,bC,NC,qC]),Sw=new yw([...bw.tags,dC,_C,OC,HC]),Cw=new yw([...bw.tags,mC,CC,LC,QC,cw,$C,rw,fw,pw,hw]).withTags({...LC,resolve:(e,t,n)=>{let r=LC.resolve(e,t,n);return r===U?OC.resolve(e,t,n):r}},{...QC,resolve:(e,t,n)=>{let r=QC.resolve(e,t,n);return r===U?HC.resolve(e,t,n):r}});cC(`tag:yaml.org,2002:map`,{create:()=>new Map,addPair:(e,t,n)=>(e.set(t,n),``),has:(e,t)=>e.has(t),keys:e=>e.keys(),get:(e,t)=>e.get(t),identify:e=>e instanceof Map||uw(e),represent:e=>{if(e instanceof Map)return e;let t=new Map,n=e;for(let e of Object.keys(n))t.set(e,n[e]);return t}});function ww(e){if(Array.isArray(e)){let t=Array.prototype.slice.call(e);for(let e=0;e<t.length;e++){if(Array.isArray(t[e]))return null;typeof t[e]==`object`&&Object.prototype.toString.call(t[e])===`[object Object]`&&(t[e]=`[object Object]`)}return String(t)}return typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`?`[object Object]`:String(e)}cC(`tag:yaml.org,2002:map`,{create:()=>({}),identify:uw,represent:e=>{let t=new Map;for(let n of Object.keys(e))t.set(n,e[n]);return t},addPair:(e,t,n)=>{let r=ww(t);return r===null?`nested arrays are not supported inside keys`:(r===`__proto__`?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,``)},has:(e,t)=>{let n=ww(t);return n!==null&&Object.prototype.hasOwnProperty.call(e,n)},keys:e=>Object.keys(e),get:(e,t)=>{let n=String(t);return Object.prototype.hasOwnProperty.call(e,n)?e[n]:null}});var Tw={maxLength:79,indent:1,linesBefore:3,linesAfter:2};function Ew(e,t,n,r,i){let a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}function Dw(e,t){return` `.repeat(Math.max(t-e.length,0))+e}function Ow(e,t){if(!e.buffer)return null;let n={...Tw,...t},r=/\r?\n|\r|\0/g,i=[0],a=[],o,s=-1;for(;o=r.exec(e.buffer);)a.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);let c=``,l=Math.min(e.line+n.linesAfter,a.length).toString().length,u=n.maxLength-(n.indent+l+3);for(let t=1;t<=n.linesBefore&&!(s-t<0);t++){let r=Ew(e.buffer,i[s-t],a[s-t],e.position-(i[s]-i[s-t]),u);c=`${` `.repeat(n.indent)}${Dw((e.line-t+1).toString(),l)} | ${r.str}\n${c}`}let d=Ew(e.buffer,i[s],a[s],e.position,u);c+=`${` `.repeat(n.indent)}${Dw((e.line+1).toString(),l)} | ${d.str}\n`,c+=`${`-`.repeat(n.indent+l+3+d.pos)}^\n`;for(let t=1;t<=n.linesAfter&&!(s+t>=a.length);t++){let r=Ew(e.buffer,i[s+t],a[s+t],e.position-(i[s]-i[s+t]),u);c+=`${` `.repeat(n.indent)}${Dw((e.line+t+1).toString(),l)} | ${r.str}\n`}return c.replace(/\n$/,``)}function kw(e,t){let n=``;return e.mark?(e.mark.name&&(n+=`in "${e.mark.name}" `),n+=`(${e.mark.line+1}:${e.mark.column+1})`,!t&&e.mark.snippet&&(n+=`\n\n${e.mark.snippet}`),`${e.reason} ${n}`):e.reason}var Aw=class e extends Error{reason;mark;constructor(e,t){super(),this.name=`YAMLException`,this.reason=e,this.mark=t,this.message=kw(this,!1),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(e){return`${this.name}: ${kw(this,e)}`}static throwAt(t,n,r,i=``){let a=0,o=0;for(let e=0;e<n;e++){let n=t.charCodeAt(e);n===10?(a++,o=e+1):n===13&&(a++,t.charCodeAt(e+1)===10&&e++,o=e+1)}let s={name:i,buffer:t,position:n,line:a,column:n-o};throw s.snippet=Ow(s),new e(r,s)}},W={DOCUMENT:1,SEQUENCE:2,MAPPING:3,SCALAR:4,ALIAS:5,POP:6},G={PLAIN:1,SINGLE_QUOTED:2,DOUBLE_QUOTED:3,LITERAL_BLOCK:4,FOLDED_BLOCK:5},jw={BLOCK:1,FLOW:2},Mw={CLIP:1,STRIP:2,KEEP:3},Nw=-1;function Pw(e){switch(e){case 48:return`\0`;case 97:return`\x07`;case 98:return`\b`;case 116:return` `;case 9:return` `;case 110:return`
|
|
122
|
+
`;case 118:return`\v`;case 102:return`\f`;case 114:return`\r`;case 101:return`\x1B`;case 32:return` `;case 34:return`"`;case 47:return`/`;case 92:return`\\`;case 78:return`
`;case 95:return`\xA0`;case 76:return`\u2028`;case 80:return`\u2029`;default:return``}}var Fw=Array(256),Iw=Array(256);for(let e=0;e<256;e++)Fw[e]=+!!Pw(e),Iw[e]=Pw(e);function Lw(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function Rw(e){return e>=48&&e<=57?e-48:(e|32)-97+10}function zw(e){return e===120?2:e===117?4:8}function Bw(e,t,n){let r=0;for(;t<n;){let n=e.charCodeAt(t);if(n===10)r++,t++;else if(n===13)r++,t++,e.charCodeAt(t)===10&&t++;else if(n===32||n===9)t++;else break}return{position:t,breaks:r}}function Vw(e){return e===1?` `:`
|
|
123
|
+
`.repeat(e-1)}function Hw(e,t,n){let r=``,i=t,a=t,o=t;for(;i<n;){let t=e.charCodeAt(i);if(t===10||t===13){r+=e.slice(a,o);let t=Bw(e,i,n);r+=Vw(t.breaks),i=a=o=t.position}else i++,t!==32&&t!==9&&(o=i)}return r+e.slice(a,o)}function Uw(e,t,n){let r=``,i=t,a=t,o=t;for(;i<n;){let t=e.charCodeAt(i);if(t===39)r+=e.slice(a,i)+`'`,i+=2,a=o=i;else if(t===10||t===13){r+=e.slice(a,o);let t=Bw(e,i,n);r+=Vw(t.breaks),i=a=o=t.position}else i++,t!==32&&t!==9&&(o=i)}return r+e.slice(a,n)}function Ww(e,t,n){let r=``,i=t,a=t,o=t;for(;i<n;){let t=e.charCodeAt(i);if(t===92){r+=e.slice(a,i),i++;let t=e.charCodeAt(i);if(t===10||t===13)i=Bw(e,i,n).position;else if(t<256&&Fw[t])r+=Iw[t],i++;else{let n=zw(t),a=0;for(;n>0;n--){i++;let t=Rw(e.charCodeAt(i));a=(a<<4)+t}r+=Lw(a),i++}a=o=i}else if(t===10||t===13){r+=e.slice(a,o);let t=Bw(e,i,n);r+=Vw(t.breaks),i=a=o=t.position}else i++,t!==32&&t!==9&&(o=i)}return r+e.slice(a,n)}function Gw(e,t,n,r,i,a){let o=r<0?0:r,s=e.slice(t,n).replace(/\r\n?/g,`
|
|
124
124
|
`),c=s===``?[]:(s.endsWith(`
|
|
125
125
|
`)?s.slice(0,-1):s).split(`
|
|
126
126
|
`),l=``,u=!1,d=0,f=!1;for(let e of c){let t=0;for(;t<o&&e.charCodeAt(t)===32;)t++;if(r<0||t>=e.length){d++;continue}let n=e.slice(o),i=n.charCodeAt(0);a?i===32||i===9?(f=!0,l+=`
|
|
127
127
|
`.repeat(u?1+d:d)):f?(f=!1,l+=`
|
|
128
128
|
`.repeat(d+1)):d===0?u&&(l+=` `):l+=`
|
|
129
129
|
`.repeat(d):l+=`
|
|
130
|
-
`.repeat(u?1+d:d),l+=n,u=!0,d=0}return i===
|
|
131
|
-
`.repeat(u?1+d:d):i!==
|
|
132
|
-
`),l}function qw(e,t){if(t.valueStart===Pw)return``;let{valueStart:n,valueEnd:r}=t;if(t.fast)return e.slice(n,r);switch(t.style){case W.SINGLE_QUOTED:return Ww(e,n,r);case W.DOUBLE_QUOTED:return Gw(e,n,r);case W.LITERAL_BLOCK:return Kw(e,n,r,t.indent,t.chomping,!1);case W.FOLDED_BLOCK:return Kw(e,n,r,t.indent,t.chomping,!0);default:return Uw(e,n,r)}}var Jw=Object.assign(Object.create(null),{"!":`!`,"!!":`tag:yaml.org,2002:`}),Yw=`-#;/?:@&=+$_.~*'()`,Xw=Yw+`!,[]`,Zw=`0123456789ABCDEF`;function Qw(e){return`%`+Zw[e>>4]+Zw[e&15]}function $w(e,t){let n=t?Yw:Xw,r=``;for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||n.includes(e[t])?r+=e[t]:(i>=55296&&i<=56319&&(i=65536+((i&1023)<<10)+(e.charCodeAt(++t)&1023)),r+=i<128?Qw(i):i<2048?Qw(192|i>>6)+Qw(128|i&63):i<65536?Qw(224|i>>12)+Qw(128|i>>6&63)+Qw(128|i&63):Qw(240|i>>18)+Qw(128|i>>12&63)+Qw(128|i>>6&63)+Qw(128|i&63))}return r}function eT(e){let t=``,n=0;for(;n<e.length;){if(e.charCodeAt(n)!==37){t+=e[n++];continue}let r=parseInt(e.slice(n+1,n+3),16);if(n+=3,r>=192){let t=r<224?1:r<240?2:3;for(r&=(1<<6-t)-1;t-->0;)r=r<<6|parseInt(e.slice(n+1,n+3),16)&63,n+=3}r<65536?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023))}return t}function tT(e,t){if(e.startsWith(`!<`)&&e.endsWith(`>`))return eT(e.slice(2,-1));let n=e.indexOf(`!`,1),r=n===-1?`!`:e.slice(0,n+1);return eT(t?.[r]??Jw[r]??r)+eT(e.slice(r.length))}function nT(e){let t=e;return t.charCodeAt(0)===33?(t=t.slice(1),`!${$w(t,!0)}`):t.slice(0,18)===`tag:yaml.org,2002:`?`!!${$w(t.slice(18),!0)}`:`!<${$w(t,!1)}>`}var rT=-1,iT=`tag:yaml.org,2002:merge`,aT={filename:``,schema:Cw,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};function oT(e){return`tagStart`in e&&e.tagStart!==rT?e.tagStart:`anchorStart`in e&&e.anchorStart!==rT?e.anchorStart:`valueStart`in e&&e.valueStart!==rT?e.valueStart:`start`in e?e.start:0}function sT(e,t){jw.throwAt(e.source,e.position,t,e.filename)}function cT(e,t,n,r){try{return n.finalize(r)}catch(n){if(n instanceof jw)throw n;jw.throwAt(e.source,t,n instanceof Error?n.message:String(n),e.filename)}}function lT(e,t){let n=qw(e.source,t),r=t.tagStart===rT?``:e.source.slice(t.tagStart,t.tagEnd),i=e.schema.defaultScalarTag;if(r!==``){if(r===`!`)return{value:n,tag:i};let t=tT(r,e.tagHandlers),a=e.schema.lookupScalarTag(t);if(a){let r=a.resolve(n,!0,t);return r===H&&sT(e,`cannot resolve a node with !<${t}> explicit tag`),{value:r,tag:a}}let o=e.schema.lookupMappingTag(t)??e.schema.lookupSequenceTag(t);if(o){n!==``&&sT(e,`cannot resolve a node with !<${t}> explicit tag`);let r=o.create(t);return{value:o.carrierIsResult?r:cT(e,e.position,o,r),tag:o}}sT(e,`unknown scalar tag !<${t}>`)}return t.style===W.PLAIN?e.schema.resolveImplicitScalarTag(n):{value:i.resolve(n,!1,i.tagName),tag:i}}function uT(e,t,n){let r=t.tagStart===rT?``:e.source.slice(t.tagStart,t.tagEnd);return r===``||r===`!`?n:tT(r,e.tagHandlers)}function dT(e){return e.nodeKind===`mapping`}function fT(e){e.totalMergeKeys++,e.maxTotalMergeKeys!==-1&&e.totalMergeKeys>e.maxTotalMergeKeys&&sT(e,`merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`)}function pT(e,t,n,r){fT(e);for(let i of r.keys(n)){if(fT(e),t.tag.has(t.value,i))continue;let a=t.tag.addPair(t.value,i,r.get(n,i));a&&sT(e,a),t.overridable??=new Set,t.overridable.add(i)}}function mT(e,t,n,r){if(e.position=t.keyPosition,dT(r))pT(e,t,n,r);else if(r.nodeKind===`sequence`&&Array.isArray(n)){n.length>100&&sT(e,`abnormal merge sequence size`);for(let r of n){let n=e.nodeTags.get(r);n||sT(e,`cannot merge mappings; the provided source object is unacceptable`),pT(e,t,r,n)}}else sT(e,`cannot merge mappings; the provided source object is unacceptable`)}function hT(e,t,n,r,i){if(e.position=t.keyPosition,t.keyIsMerge){mT(e,t,r,i);return}!e.json&&t.tag.has(t.value,n)&&!t.overridable?.has(n)&&sT(e,`duplicated mapping key`);let a=t.tag.addPair(t.value,n,r);a&&sT(e,a),t.overridable?.delete(n)}function gT(e,t,n){let r=e.frames[e.frames.length-1];if(r.kind===`document`)r.value=t,r.hasValue=!0;else if(r.kind===`sequence`){dT(n)&&e.nodeTags.set(t,n);let i=r.tag.addItem(r.value,t,r.index++);i&&sT(e,i)}else if(r.hasKey){let i=r.key;r.key=void 0,r.hasKey=!1,hT(e,r,i,t,n)}else r.key=t,r.keyPosition=e.position,r.hasKey=!0,r.keyIsMerge=n.tagName===iT}function _T(e,t,n,r,i){if(t.anchorStart!==rT){let a={value:n,tag:r,isValueFinal:i};return e.anchors.set(e.source.slice(t.anchorStart,t.anchorEnd),a),a}return null}function vT(e,t){let n={...aT,...t,events:e,documents:[],eventIndex:0,position:0,frames:[],anchors:new Map,nodeTags:new Map,tagHandlers:Object.create(null),totalMergeKeys:0,aliasCount:0};for(;n.eventIndex<n.events.length;){let e=n.events[n.eventIndex++];switch(n.position=oT(e),e.type){case U.DOCUMENT:n.anchors=new Map,n.nodeTags=new Map,n.aliasCount=0,n.tagHandlers=Object.create(null);for(let t of e.directives)t.kind===`tag`&&(n.tagHandlers[t.handle]=t.prefix);n.frames.push({kind:`document`,position:n.position,value:void 0,hasValue:!1});break;case U.SCALAR:{let{value:t,tag:r}=lT(n,e);_T(n,e,t,r,!0),gT(n,t,r);break}case U.SEQUENCE:{let t=uT(n,e,`tag:yaml.org,2002:seq`),r=n.schema.lookupSequenceTag(t);r||sT(n,`unknown sequence tag !<${t}>`);let i=r.create(t),a=_T(n,e,i,r,r.carrierIsResult);n.frames.push({kind:`sequence`,position:n.position,value:i,tag:r,anchor:a,index:0});break}case U.MAPPING:{let t=uT(n,e,`tag:yaml.org,2002:map`),r=n.schema.lookupMappingTag(t);r||sT(n,`unknown mapping tag !<${t}>`);let i=r.create(t),a=_T(n,e,i,r,r.carrierIsResult);n.frames.push({kind:`mapping`,position:n.position,value:i,tag:r,anchor:a,key:void 0,keyPosition:n.position,hasKey:!1,keyIsMerge:!1,overridable:null});break}case U.ALIAS:{n.maxAliases!==-1&&++n.aliasCount>n.maxAliases&&sT(n,`aliases exceeded maxAliases (${n.maxAliases})`);let t=n.source.slice(e.anchorStart,e.anchorEnd),r=n.anchors.get(t);r||sT(n,`unidentified alias "${t}"`),r.isValueFinal||sT(n,`recursive alias "${t}" is not supported for tag ${r.tag.tagName} because it uses finalize()`),gT(n,r.value,r.tag);break}case U.POP:{let e=n.frames.pop();if(e.kind===`mapping`&&e.hasKey&&(n.position=e.keyPosition,sT(n,`incomplete mapping pair in event stream`)),e.kind===`document`)n.documents.push(e.value);else{let t=e.tag.carrierIsResult?e.value:cT(n,e.position,e.tag,e.value);e.anchor&&(e.anchor.value=t,e.anchor.isValueFinal=!0),gT(n,t,e.tag)}break}}}return n.documents}var G=-1,yT=Object.prototype.hasOwnProperty,bT=1,xT=2,ST=3,CT=4,wT=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,TT=/[,\[\]{}]/,ET=/^(?:!|!!|![0-9A-Za-z-]+!)$/,DT=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,OT=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,kT=RegExp(`^(?:${DT})*$`),AT=RegExp(`^(?:${OT})+$`),jT=RegExp(`^(?:!(?:${DT})*|${OT}(?:${DT})*)$`),MT={filename:``,maxDepth:100};function NT(e,t,n){e.events.push({type:U.DOCUMENT,explicitStart:t,explicitEnd:n,directives:e.directives})}function PT(e,t,n,r,i,a,o){e.events.push({type:U.SEQUENCE,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:a,style:o})}function FT(e,t,n,r,i,a,o){e.events.push({type:U.MAPPING,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:a,style:o})}function IT(e,t){e.events.splice(t.eventsLength,0,{type:U.MAPPING,start:t.position,anchorStart:G,anchorEnd:G,tagStart:G,tagEnd:G,style:Mw.FLOW})}function LT(e,t,n,r,i,a,o,s,c=Nw.CLIP,l=-1,u=!1){e.events.push({type:U.SCALAR,valueStart:t,valueEnd:n,anchorStart:r,anchorEnd:i,tagStart:a,tagEnd:o,style:s,chomping:c,indent:l,fast:u})}function RT(e,t,n){e.events.push({type:U.ALIAS,anchorStart:t,anchorEnd:n})}function zT(e){e.events.push({type:U.POP})}function BT(e){LT(e,G,G,G,G,G,G,W.PLAIN)}function VT(){return{anchorStart:G,anchorEnd:G,tagStart:G,tagEnd:G}}function HT(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,eventsLength:e.events.length}}function UT(e,t){e.position=t.position,e.line=t.line,e.lineStart=t.lineStart,e.lineIndent=t.lineIndent,e.firstTabInLine=t.firstTabInLine,e.events.length=t.eventsLength}function K(e,t){jw.throwAt(e.input.slice(0,e.length),e.position,t,e.filename)}function WT(e){return e===10||e===13}function GT(e){return e===9||e===32}function KT(e){return GT(e)||WT(e)}function qT(e){return e===0||KT(e)}function JT(e){return e===44||e===91||e===93||e===123||e===125}function YT(e){return e>=48&&e<=57?e-48:-1}function XT(e){if(e>=48&&e<=57)return e-48;let t=e|32;return t>=97&&t<=102?t-97+10:-1}function ZT(e){return e===120?2:e===117?4:e===85?8:0}function QT(e){return e===48||e===97||e===98||e===116||e===9||e===110||e===118||e===102||e===114||e===101||e===32||e===34||e===47||e===92||e===78||e===95||e===76||e===80}function $T(e){e.input.charCodeAt(e.position)===10?e.position++:(e.position++,e.input.charCodeAt(e.position)===10&&e.position++),e.line++,e.lineStart=e.position,e.lineIndent=0,e.firstTabInLine=-1}function eE(e,t){let n=0,r=e.input.charCodeAt(e.position),i=e.position===e.lineStart||KT(e.input.charCodeAt(e.position-1));for(;r!==0;){for(;GT(r);)i=!0,r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&i&&r===35)do r=e.input.charCodeAt(++e.position);while(!WT(r)&&r!==0);if(!WT(r))break;for($T(e),n++,i=!0,r=e.input.charCodeAt(e.position);r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return n}function tE(e,t=e.position){let n=e.input.charCodeAt(t);if((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)){let n=e.input.charCodeAt(t+3);return n===0||KT(n)}return!1}function nE(e){e.position===e.lineStart&&e.input.charCodeAt(e.position)===65279&&(e.position++,e.lineStart=e.position)}function rE(e){if(e.position!==e.lineStart)return!1;if(tE(e))return!0;if(e.input.charCodeAt(e.position)!==65279)return!1;let t=HT(e);nE(e),eE(e,!0);let n=e.input.charCodeAt(e.position),r=e.position===e.lineStart&&(n===37||n===45&&tE(e));return UT(e,t),r}function iE(e){let t=e.input.charCodeAt(e.position);for(;t!==0&&!WT(t);)t=e.input.charCodeAt(++e.position)}function aE(e,t,n){let r=wT.exec(e.input.slice(t,n));r!==null&&(e.position=t+r.index+r[0].length-1,K(e,`the stream contains non-printable characters`))}function oE(e,t,n){if(e.input.charCodeAt(e.position)!==33)return!1;t.tagStart!==G&&K(e,`duplication of a tag property`);let r=e.position,i=!1,a=!1,o=`!`,s=e.input.charCodeAt(++e.position);s===60?(i=!0,s=e.input.charCodeAt(++e.position)):s===33&&(a=!0,o=`!!`,s=e.input.charCodeAt(++e.position));let c=e.position,l;if(i){for(;s!==0&&s!==62;)s=e.input.charCodeAt(++e.position);s!==62&&K(e,`unexpected end of the stream within a verbatim tag`),l=e.input.slice(c,e.position),e.position++}else{for(;s!==0&&!KT(s)&&!(n&&JT(s));)s===33&&(a?K(e,`tag suffix cannot contain exclamation marks`):(o=e.input.slice(c-1,e.position+1),ET.test(o)||K(e,`named tag handle cannot contain such characters`),a=!0,c=e.position+1)),s=e.input.charCodeAt(++e.position);l=e.input.slice(c,e.position),TT.test(l)&&K(e,`tag suffix cannot contain flow indicator characters`)}return l&&!(i?kT.test(l):AT.test(l))&&K(e,`tag name cannot contain such characters: ${l}`),!i&&o!==`!`&&o!==`!!`&&!yT.call(e.tagHandlers,o)&&K(e,`undeclared tag handle "${o}"`),t.tagStart=r,t.tagEnd=e.position,!0}function sE(e,t){if(e.input.charCodeAt(e.position)!==38)return!1;t.anchorStart!==G&&K(e,`duplication of an anchor property`),e.position++;let n=e.position;for(;e.input.charCodeAt(e.position)!==0&&!KT(e.input.charCodeAt(e.position))&&!JT(e.input.charCodeAt(e.position));)e.position++;return e.position===n&&K(e,`name of an anchor node must contain at least one character`),t.anchorStart=n,t.anchorEnd=e.position,!0}function cE(e,t){if(e.input.charCodeAt(e.position)!==42)return!1;(t.anchorStart!==G||t.tagStart!==G)&&K(e,`alias node should not have any properties`),e.position++;let n=e.position;for(;e.input.charCodeAt(e.position)!==0&&!KT(e.input.charCodeAt(e.position))&&!JT(e.input.charCodeAt(e.position));)e.position++;return e.position===n&&K(e,`name of an alias node must contain at least one character`),RT(e,n,e.position),!0}function lE(e,t){eE(e,!1),e.lineIndent<t&&K(e,`deficient indentation`)}function uE(e,t,n){if(e.input.charCodeAt(e.position)!==39)return!1;e.position++;let r=e.position,i=!0;for(;e.input.charCodeAt(e.position)!==0;){let a=e.input.charCodeAt(e.position);if(a===39){if(e.input.charCodeAt(e.position+1)===39){i=!1,e.position+=2;continue}let t=e.position;return e.position++,LT(e,r,t,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,W.SINGLE_QUOTED,Nw.CLIP,-1,i),!0}WT(a)?(i=!1,lE(e,t)):e.position===e.lineStart&&tE(e)?K(e,`unexpected end of the document within a single quoted scalar`):a!==9&&a<32?K(e,`expected valid JSON character`):e.position++}K(e,`unexpected end of the stream within a single quoted scalar`)}function dE(e,t,n){if(e.input.charCodeAt(e.position)!==34)return!1;e.position++;let r=e.position,i=!0;for(;e.input.charCodeAt(e.position)!==0;){let a=e.input.charCodeAt(e.position);if(a===34){let t=e.position;return e.position++,LT(e,r,t,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,W.DOUBLE_QUOTED,Nw.CLIP,-1,i),!0}if(a===92){i=!1;let n=e.input.charCodeAt(++e.position);if(WT(n))lE(e,t);else if(QT(n))e.position++;else{let t=ZT(n);for(t===0&&K(e,`unknown escape sequence`);t-->0;)e.position++,XT(e.input.charCodeAt(e.position))<0&&K(e,`expected hexadecimal character`);e.position++}}else WT(a)?(i=!1,lE(e,t)):e.position===e.lineStart&&tE(e)?K(e,`unexpected end of the document within a double quoted scalar`):a!==9&&a<32?K(e,`expected valid JSON character`):e.position++}K(e,`unexpected end of the stream within a double quoted scalar`)}function fE(e,t,n){let r=e.input.charCodeAt(e.position),i=Nw.CLIP,a=-1,o=!1;if(r!==124&&r!==62)return!1;let s=r===124?W.LITERAL_BLOCK:W.FOLDED_BLOCK;for(e.position++;e.input.charCodeAt(e.position)!==0;){let n=e.input.charCodeAt(e.position),r=YT(n);if(n===43||n===45)i!==Nw.CLIP&&K(e,`repeat of a chomping mode identifier`),i=n===43?Nw.KEEP:Nw.STRIP,e.position++;else if(r>=0)r===0&&K(e,`bad explicit indentation width of a block scalar; it cannot be less than one`),o&&K(e,`repeat of an indentation width identifier`),a=t+r-1,o=!0,e.position++;else break}let c=!1;for(;GT(e.input.charCodeAt(e.position));)c=!0,e.position++;c&&e.input.charCodeAt(e.position)===35&&iE(e),WT(e.input.charCodeAt(e.position))?$T(e):e.input.charCodeAt(e.position)!==0&&K(e,`a line break is expected`);let l=o?a:-1,u=0,d=e.position,f=e.position;for(;e.input.charCodeAt(e.position)!==0;){let n=e.position,r=0;for(;e.input.charCodeAt(n+r)===32;)r++;let i=e.input.charCodeAt(n+r);if(i===0){l>=0?r>l&&(f=n+r):r>0&&(f=n+r);break}if(rE(e))break;if(!o&&l===-1&&WT(i)&&(u=Math.max(u,r)),!o&&l===-1&&!WT(i)&&(i===9&&r<t&&(e.position=n+r,K(e,`tab characters must not be used in indentation`)),r>=t&&r<u&&(e.position=n+r,K(e,`bad indentation of a mapping entry`))),l===-1&&i!==0&&!WT(i)&&r<t){e.lineIndent=r,e.position=n+r;break}!o&&i!==0&&!WT(i)&&l===-1&&(l=r);let a=l===-1?t+1:l;if(i!==0&&!WT(i)&&r<a){e.lineIndent=r,e.position=n+r;break}iE(e),f=e.position,WT(e.input.charCodeAt(e.position))&&($T(e),f=e.position)}return aE(e,d,f),LT(e,d,f,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,s,i,l),!0}function pE(e,t){let n=e.input.charCodeAt(e.position),r=t===bT;if(n===0||KT(n)||n===35||n===38||n===42||n===33||n===124||n===62||n===39||n===34||n===37||n===64||n===96||JT(n))return!1;if(n===63||n===45){let t=e.input.charCodeAt(e.position+1);if(qT(t)||r&&JT(t))return!1}return!0}function mE(e,t,n,r){if(!pE(e,n))return!1;let i=e.position,a=e.position,o=e.input.charCodeAt(e.position),s=n===bT,c=!1;for(;o!==0&&!rE(e);){if(o===58){let t=e.input.charCodeAt(e.position+1);if(qT(t)||s&&JT(t))break}else if(o===35){if(KT(e.input.charCodeAt(e.position-1)))break}else if(s&&JT(o))break;else if(WT(o)){let n=e.position,r=e.line,i=e.lineStart,a=e.lineIndent;if(eE(e,!1),e.lineIndent>=t){c=!0,o=e.input.charCodeAt(e.position);continue}e.position=n,e.line=r,e.lineStart=i,e.lineIndent=a;break}GT(o)||(a=e.position+1),o=e.input.charCodeAt(++e.position)}return a!==i&&(aE(e,i,a),LT(e,i,a,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,W.PLAIN,Nw.CLIP,-1,!c),!0)}function hE(e,t){let n=e.line;eE(e,!0),(e.line>n&&e.lineIndent<t||e.firstTabInLine!==-1&&e.lineIndent<t)&&K(e,`deficient indentation`)}function gE(e,t,n){let r=e.input.charCodeAt(e.position),i=r===123,a=e.position,o=!0;if(r!==91&&r!==123)return!1;let s=i?125:93;for(i?FT(e,a,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,Mw.FLOW):PT(e,a,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,Mw.FLOW),e.position++;e.input.charCodeAt(e.position)!==0;){hE(e,t);let n=e.input.charCodeAt(e.position);if(n===s)return e.position++,zT(e),!0;o?n===44&&K(e,`expected the node content, but found ','`):K(e,`missed comma between flow collection entries`);let r=!1,a=!1;n===63&&KT(e.input.charCodeAt(e.position+1))&&(r=a=!0,e.position+=1,hE(e,t));let c=e.line,l=HT(e),u=yE(e,t,bT,!1,!0);hE(e,t),n=e.input.charCodeAt(e.position),(i||a||e.line===c)&&n===58?(r=!0,e.position++,hE(e,t),i||IT(e,l),u||BT(e),yE(e,t,bT,!1,!0)||BT(e),hE(e,t),i||zT(e)):i&&r?(u||BT(e),BT(e)):i?BT(e):r&&(IT(e,l),u||BT(e),BT(e),zT(e)),n=e.input.charCodeAt(e.position),n===44?(o=!0,e.position++):o=!1}K(e,`unexpected end of the stream within a flow collection`)}function _E(e,t,n){if(e.firstTabInLine!==-1||e.input.charCodeAt(e.position)!==45||!qT(e.input.charCodeAt(e.position+1)))return!1;for(PT(e,e.position,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,Mw.BLOCK);e.input.charCodeAt(e.position)===45&&qT(e.input.charCodeAt(e.position+1));){e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,K(e,`tab characters must not be used in indentation`));let n=e.line;e.position++;let r=eE(e,!0)>0;if(e.firstTabInLine!==-1&&e.input.charCodeAt(e.position)===45&&qT(e.input.charCodeAt(e.position+1))&&K(e,`bad indentation of a sequence entry`),r&&e.lineIndent<=t?BT(e):yE(e,t,ST,!1,!0),eE(e,!0),e.lineIndent<t||e.position>=e.length)break;e.lineIndent>t&&K(e,`bad indentation of a sequence entry`),e.line===n&&e.input.charCodeAt(e.position)===45&&qT(e.input.charCodeAt(e.position+1))&&K(e,`bad indentation of a sequence entry`)}return zT(e),!0}function vE(e,t,n,r){let i=!1,a=!1,o=!1,s=!1;if(e.firstTabInLine!==-1)return!1;let c=e.input.charCodeAt(e.position);for(;c!==0;){!i&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,K(e,`tab characters must not be used in indentation`));let l=e.input.charCodeAt(e.position+1),u=e.line;if((c===63||c===58)&&qT(l))o||=(FT(e,e.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,Mw.BLOCK),!0),c===63?(i&&BT(e),a=!0,i=!0):(i||(BT(e),a=!0),i=!1),e.position+=1,s=!0;else{i&&=(BT(e),!1);let t=HT(e);if(!yE(e,n,xT,!1,!0))break;if(e.line===u){for(c=e.input.charCodeAt(e.position);GT(c);)c=e.input.charCodeAt(++e.position);if(c===58)c=e.input.charCodeAt(++e.position),qT(c)||K(e,`a whitespace character is expected after the key-value separator within a block mapping`),o||=(e.events.splice(t.eventsLength,0,{type:U.MAPPING,start:t.position,anchorStart:r.anchorStart,anchorEnd:r.anchorEnd,tagStart:r.tagStart,tagEnd:r.tagEnd,style:Mw.BLOCK}),!0),a=!0,i=!1,s=!1;else if(a)K(e,`expected ':' after a mapping key`);else return r.anchorStart!==G||r.tagStart!==G?(UT(e,t),!1):!0}else if(a)K(e,`can not read a block mapping entry; a multiline key may not be an implicit key`);else return r.anchorStart!==G||r.tagStart!==G?(UT(e,t),!1):!0}if(yE(e,t,CT,!0,s)&&(s=!1),i||(s&&=(BT(e),!1)),eE(e,!0),c=e.input.charCodeAt(e.position),(e.line===u||e.lineIndent>t)&&c!==0)K(e,`bad indentation of a mapping entry`);else if(e.lineIndent<t)break}return a?(i&&BT(e),o&&zT(e),!0):!1}function yE(e,t,n,r,i,a=!0){e.depth>=e.maxDepth&&K(e,`nesting exceeded maxDepth (${e.maxDepth})`),e.depth++;let o=1,s=!1,c=!1,l=null,u=VT(),d=n===CT||n===ST,f=d,p=d;if(r&&eE(e,!0)&&(s=!0,o=e.lineIndent>t?1:e.lineIndent===t?0:-1),o===1)for(;;){let r=e.input.charCodeAt(e.position),i=HT(e);if(s&&o!==1&&(r===33||r===38))break;if(s&&p&&(u.tagStart!==G||u.anchorStart!==G)&&(r===33||r===38)){let n=HT(e),r=t+1;if(vE(e,e.position-e.lineStart,r,u)&&e.events[n.eventsLength]?.type===U.MAPPING)return e.depth--,!0;UT(e,n)}if(s&&(r===33&&u.tagStart!==G||r===38&&u.anchorStart!==G)||!oE(e,u,n===bT)&&!sE(e,u))break;l===null&&(l=i),eE(e,!0)?(s=!0,f=p,o=e.lineIndent>t?1:e.lineIndent===t?0:-1):f=!1}if(f&&=s||i,o===1||n===CT){let r=n===bT||n===xT?t:t+1,i=e.position-e.lineStart;if(o===1){if(f&&(_E(e,i,u)||vE(e,i,r,u))||gE(e,r,u))c=!0;else{let t=e.input.charCodeAt(e.position);if(l!==null&&a&&p&&!f&&t!==124&&t!==62){let t=HT(e),n=l.position-l.lineStart;UT(e,l),vE(e,n,r,VT())&&e.events[t.eventsLength]?.type===U.MAPPING?c=!0:UT(e,t)}!c&&(d&&fE(e,r,u)||uE(e,r,u)||dE(e,r,u)||cE(e,u)||mE(e,r,n,u))&&(c=!0)}}else o===0&&(c=f&&_E(e,i,u))}return d&&=!c,!c&&(u.anchorStart!==G||u.tagStart!==G||d)&&(LT(e,G,G,u.anchorStart,u.anchorEnd,u.tagStart,u.tagEnd,W.PLAIN),c=!0),e.depth--,c||u.anchorStart!==G||u.tagStart!==G}function bE(e){if(e.lineIndent>0||e.input.charCodeAt(e.position)!==37)return!1;e.position++;let t=e.position;for(;e.input.charCodeAt(e.position)!==0&&!KT(e.input.charCodeAt(e.position));)e.position++;let n=e.input.slice(t,e.position),r=[];for(n.length===0&&K(e,`directive name must not be less than one character in length`);e.input.charCodeAt(e.position)!==0&&!WT(e.input.charCodeAt(e.position));){for(;GT(e.input.charCodeAt(e.position));)e.position++;if(e.input.charCodeAt(e.position)===35||WT(e.input.charCodeAt(e.position))||e.input.charCodeAt(e.position)===0)break;let t=e.position;for(;e.input.charCodeAt(e.position)!==0&&!KT(e.input.charCodeAt(e.position));)e.position++;r.push(e.input.slice(t,e.position))}if(WT(e.input.charCodeAt(e.position))&&$T(e),n===`YAML`){e.directives.some(e=>e.kind===`yaml`)&&K(e,`duplication of %YAML directive`),r.length!==1&&K(e,`YAML directive accepts exactly one argument`);let t=/^([0-9]+)\.([0-9]+)$/.exec(r[0]);t===null&&K(e,`ill-formed argument of the YAML directive`),parseInt(t[1],10)!==1&&K(e,`unacceptable YAML version of the document`),e.directives.push({kind:`yaml`,version:r[0]})}else if(n===`TAG`){r.length!==2&&K(e,`TAG directive accepts exactly two arguments`);let[t,n]=r;ET.test(t)||K(e,`ill-formed tag handle (first argument) of the TAG directive`),yT.call(e.tagHandlers,t)&&K(e,`there is a previously declared suffix for "${t}" tag handle`),jT.test(n)||K(e,`ill-formed tag prefix (second argument) of the TAG directive`),e.tagHandlers[t]=n,e.directives.push({kind:`tag`,handle:t,prefix:n})}return!0}function xE(e){e.directives=[],e.tagHandlers=Object.create(null);let t=!1;for(eE(e,!0);bE(e);)t=!0,eE(e,!0);let n=!1,r=!1,i=!0;if(e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45&&qT(e.input.charCodeAt(e.position+3))){n=!0;let t=e.line;e.position+=3,eE(e,!0),i=e.line>t}else t&&K(e,`directives end mark is expected`);let a=e.events.length;if(!n&&e.position===e.lineStart&&e.input.charCodeAt(e.position)===46&&tE(e)){e.position+=3,eE(e,!0);return}if(NT(e,n,!1),yE(e,e.lineIndent-1,CT,!1,i,i)||BT(e),eE(e,!0),e.position===e.lineStart&&tE(e)&&(r=e.input.charCodeAt(e.position)===46,r)){let t=e.line;e.position+=3,eE(e,!0),e.line===t&&e.position<e.length&&K(e,`end of the stream or a document separator is expected`)}let o=e.events[a];o?.type===U.DOCUMENT&&(o.explicitEnd=r),zT(e),!r&&e.position<e.length&&!rE(e)&&K(e,`end of the stream or a document separator is expected`)}function SE(e,t){let n=e.length,r={...MT,...t,input:`${e}\0`,length:n,position:0,line:0,lineStart:0,lineIndent:0,firstTabInLine:-1,depth:0,directives:[],tagHandlers:Object.create(null),events:[]},i=e.indexOf(`\0`);for(i!==-1&&jw.throwAt(e,i,`null byte is not allowed in input`,r.filename);r.position<r.length&&(nE(r),eE(r,!0),!(r.position>=r.length));){let e=r.position;xE(r),r.position===e&&K(r,`can not read a document`)}return r.events}var CE={...MT,...aT};function wE(e,t={}){let n={...CE,...t},r=String(e),i=Object.keys(MT),a=Object.keys(aT);return vT(SE(r,fw(n,i)),{...fw(n,a),source:r})}function TE(e,t,n){let r=null;typeof t==`function`?r=t:typeof t==`object`&&t&&(n=t);let i=wE(e,n);if(r===null)return i;for(let e of i)r(e)}var EE=Symbol(`INVALID`);function DE(e){let t=new Set([e.defaultScalarTag,e.defaultSequenceTag,e.defaultMappingTag].filter(e=>e!==void 0)),n=e.implicitScalarTags,r=e.tags.filter(e=>!(e.nodeKind===`scalar`&&e.implicit)&&!t.has(e)),i=e.tags.filter(e=>t.has(e));return[...n.map(e=>({tag:e,implicitTag:!0})),...r.map(e=>({tag:e,implicitTag:!1})),...i.map(e=>({tag:e,implicitTag:!0}))]}function OE(e,t){for(let n=0,r=e.representTypes.length;n<r;n+=1){let{tag:r,implicitTag:i}=e.representTypes[n];if(r.identify(t)){let e;return e=r.matchByTagPrefix?r.representTagName(t):r.tagName,{tag:r,tagName:e,implicitTag:i}}}return null}function kE(e,t){if(!e.noRefs&&typeof t==`object`&&t){let n=e.refs.get(t);if(n)return n.anchor===void 0&&(n.anchor=`ref_${e.refCounter++}`),{kind:`alias`,anchor:n.anchor}}let n=OE(e,t);if(!n){if(t===void 0||e.skipInvalid)return EE;throw new jw(`unacceptable kind of an object to dump ${Object.prototype.toString.call(t)}`)}let{tag:r,tagName:i,implicitTag:a}=n,o=a?i:nT(i);if(r.nodeKind===`scalar`)return{kind:`scalar`,tag:o,tagged:!a,style:W.PLAIN,value:r.represent(t)};if(r.nodeKind===`sequence`){let n=r.represent(t),i={kind:`sequence`,tag:o,tagged:!a,style:Mw.BLOCK,items:[]};e.noRefs||e.refs.set(t,i);for(let t=0,r=n.length;t<r;t+=1){let r=kE(e,n[t]);r===EE&&n[t]===void 0&&(r=kE(e,null)),r!==EE&&i.items.push(r)}return i}let s=r.represent(t),c={kind:`mapping`,tag:o,tagged:!a,style:Mw.BLOCK,items:[]};e.noRefs||e.refs.set(t,c);for(let[t,n]of s){let r=kE(e,t);if(r===EE)continue;let i=kE(e,n);i!==EE&&c.items.push({key:r,value:i})}return c}function AE(e,t,n={}){let r=kE({representTypes:DE(t),noRefs:n.noRefs??!1,skipInvalid:n.skipInvalid??!1,refs:new Map,refCounter:0},e);return[{contents:r===EE?null:r,directives:[]}]}var jE=Symbol(`visit:break`),ME=Symbol(`visit:skip`);function NE(e,t,n){let r=t(e,n);if(r===jE)return!0;if(r===ME)return!1;let i=n.depth+1;switch(e.kind){case`sequence`:for(let n of e.items)if(NE(n,t,{depth:i,parent:e,isKey:!1}))return!0;break;case`mapping`:for(let{key:n,value:r}of e.items)if(NE(n,t,{depth:i,parent:e,isKey:!0})||NE(r,t,{depth:i,parent:e,isKey:!1}))return!0}return!1}function PE(e,t){for(let n of e)if(n.contents&&NE(n.contents,t,{depth:0,parent:null,isKey:!1}))return}function FE(e,t){return!!(e&1<<t)}var IE={applyQuoteFlowKeysOption:RE,doubleQuoteForInvisibles:zE,doubleQuoteWhitespaceOnly:BE,applyForceQuotesOption:VE,tryLongOrMultilineAsBlock:HE,quoteInvalidPlain:UE,fallbackToDoubleQuoted:WE};function LE(e){return e.presenterOptions.quoteStyle===`single`&&FE(e.allowedStylesMask,W.SINGLE_QUOTED)?W.SINGLE_QUOTED:W.DOUBLE_QUOTED}function RE(e){e.presenterOptions.quoteFlowKeys&&e.isKey&&e.flowOnly&&e.style===W.PLAIN&&(e.style=W.DOUBLE_QUOTED)}function zE(e){e.style===W.PLAIN&&/[\t\x7F-\xA0\u2028\u2029\uFEFF\uFFFE\uFFFF]/.test(e.node.value)&&(e.style=W.DOUBLE_QUOTED)}function BE(e){e.style===W.PLAIN&&/^\s+$/.test(e.node.value)&&(e.style=W.DOUBLE_QUOTED)}function VE(e){e.presenterOptions.forceQuotes&&(e.isKey||e.style!==W.PLAIN||e.node.tag===e.presenterOptions.schema.defaultScalarTag.tagName&&(e.style=e.node.value.includes(`
|
|
133
|
-
`)?
|
|
134
|
-
`)!==-1;if(!
|
|
135
|
-
`,a);n!==-1&&(e=n);let r=t.slice(a,e);if(r.length>i&&r[0]!==` `&&/ [^ \t]/.test(r)&&(o=!0),n===-1)break;a=n+1}o?e.style=
|
|
136
|
-
`);if(e!==-1){let n=t.slice(e+1);if(
|
|
137
|
-
`);if(e!==-1&&
|
|
130
|
+
`.repeat(u?1+d:d),l+=n,u=!0,d=0}return i===Mw.KEEP?l+=`
|
|
131
|
+
`.repeat(u?1+d:d):i!==Mw.STRIP&&u&&(l+=`
|
|
132
|
+
`),l}function Kw(e,t){if(t.valueStart===Nw)return``;let{valueStart:n,valueEnd:r}=t;if(t.fast)return e.slice(n,r);switch(t.style){case G.SINGLE_QUOTED:return Uw(e,n,r);case G.DOUBLE_QUOTED:return Ww(e,n,r);case G.LITERAL_BLOCK:return Gw(e,n,r,t.indent,t.chomping,!1);case G.FOLDED_BLOCK:return Gw(e,n,r,t.indent,t.chomping,!0);default:return Hw(e,n,r)}}var qw=Object.assign(Object.create(null),{"!":`!`,"!!":`tag:yaml.org,2002:`}),Jw=`-#;/?:@&=+$_.~*'()`,Yw=Jw+`!,[]`,Xw=`0123456789ABCDEF`;function Zw(e){return`%`+Xw[e>>4]+Xw[e&15]}function Qw(e,t){let n=t?Jw:Yw,r=``;for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122||n.includes(e[t])?r+=e[t]:(i>=55296&&i<=56319&&(i=65536+((i&1023)<<10)+(e.charCodeAt(++t)&1023)),r+=i<128?Zw(i):i<2048?Zw(192|i>>6)+Zw(128|i&63):i<65536?Zw(224|i>>12)+Zw(128|i>>6&63)+Zw(128|i&63):Zw(240|i>>18)+Zw(128|i>>12&63)+Zw(128|i>>6&63)+Zw(128|i&63))}return r}function $w(e){let t=``,n=0;for(;n<e.length;){if(e.charCodeAt(n)!==37){t+=e[n++];continue}let r=parseInt(e.slice(n+1,n+3),16);if(n+=3,r>=192){let t=r<224?1:r<240?2:3;for(r&=(1<<6-t)-1;t-->0;)r=r<<6|parseInt(e.slice(n+1,n+3),16)&63,n+=3}r<65536?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode(55296|r>>10,56320|r&1023))}return t}function eT(e,t){if(e.startsWith(`!<`)&&e.endsWith(`>`))return $w(e.slice(2,-1));let n=e.indexOf(`!`,1),r=n===-1?`!`:e.slice(0,n+1);return $w(t?.[r]??qw[r]??r)+$w(e.slice(r.length))}function tT(e){let t=e;return t.charCodeAt(0)===33?(t=t.slice(1),`!${Qw(t,!0)}`):t.slice(0,18)===`tag:yaml.org,2002:`?`!!${Qw(t.slice(18),!0)}`:`!<${Qw(t,!1)}>`}var nT=-1,rT=`tag:yaml.org,2002:merge`,iT={filename:``,schema:Sw,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};function aT(e){return`tagStart`in e&&e.tagStart!==nT?e.tagStart:`anchorStart`in e&&e.anchorStart!==nT?e.anchorStart:`valueStart`in e&&e.valueStart!==nT?e.valueStart:`start`in e?e.start:0}function oT(e,t){Aw.throwAt(e.source,e.position,t,e.filename)}function sT(e,t,n,r){try{return n.finalize(r)}catch(n){if(n instanceof Aw)throw n;Aw.throwAt(e.source,t,n instanceof Error?n.message:String(n),e.filename)}}function cT(e,t){let n=Kw(e.source,t),r=t.tagStart===nT?``:e.source.slice(t.tagStart,t.tagEnd),i=e.schema.defaultScalarTag;if(r!==``){if(r===`!`)return{value:n,tag:i};let t=eT(r,e.tagHandlers),a=e.schema.lookupScalarTag(t);if(a){let r=a.resolve(n,!0,t);return r===U&&oT(e,`cannot resolve a node with !<${t}> explicit tag`),{value:r,tag:a}}let o=e.schema.lookupMappingTag(t)??e.schema.lookupSequenceTag(t);if(o){n!==``&&oT(e,`cannot resolve a node with !<${t}> explicit tag`);let r=o.create(t);return{value:o.carrierIsResult?r:sT(e,e.position,o,r),tag:o}}oT(e,`unknown scalar tag !<${t}>`)}return t.style===G.PLAIN?e.schema.resolveImplicitScalarTag(n):{value:i.resolve(n,!1,i.tagName),tag:i}}function lT(e,t,n){let r=t.tagStart===nT?``:e.source.slice(t.tagStart,t.tagEnd);return r===``||r===`!`?n:eT(r,e.tagHandlers)}function uT(e){return e.nodeKind===`mapping`}function dT(e){e.totalMergeKeys++,e.maxTotalMergeKeys!==-1&&e.totalMergeKeys>e.maxTotalMergeKeys&&oT(e,`merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`)}function fT(e,t,n,r){dT(e);for(let i of r.keys(n)){if(dT(e),t.tag.has(t.value,i))continue;let a=t.tag.addPair(t.value,i,r.get(n,i));a&&oT(e,a),t.overridable??=new Set,t.overridable.add(i)}}function pT(e,t,n,r){if(e.position=t.keyPosition,uT(r))fT(e,t,n,r);else if(r.nodeKind===`sequence`&&Array.isArray(n)){n.length>100&&oT(e,`abnormal merge sequence size`);for(let r of n){let n=e.nodeTags.get(r);n||oT(e,`cannot merge mappings; the provided source object is unacceptable`),fT(e,t,r,n)}}else oT(e,`cannot merge mappings; the provided source object is unacceptable`)}function mT(e,t,n,r,i){if(e.position=t.keyPosition,t.keyIsMerge){pT(e,t,r,i);return}!e.json&&t.tag.has(t.value,n)&&!t.overridable?.has(n)&&oT(e,`duplicated mapping key`);let a=t.tag.addPair(t.value,n,r);a&&oT(e,a),t.overridable?.delete(n)}function hT(e,t,n){let r=e.frames[e.frames.length-1];if(r.kind===`document`)r.value=t,r.hasValue=!0;else if(r.kind===`sequence`){uT(n)&&e.nodeTags.set(t,n);let i=r.tag.addItem(r.value,t,r.index++);i&&oT(e,i)}else if(r.hasKey){let i=r.key;r.key=void 0,r.hasKey=!1,mT(e,r,i,t,n)}else r.key=t,r.keyPosition=e.position,r.hasKey=!0,r.keyIsMerge=n.tagName===rT}function gT(e,t,n,r,i){if(t.anchorStart!==nT){let a={value:n,tag:r,isValueFinal:i};return e.anchors.set(e.source.slice(t.anchorStart,t.anchorEnd),a),a}return null}function _T(e,t){let n={...iT,...t,events:e,documents:[],eventIndex:0,position:0,frames:[],anchors:new Map,nodeTags:new Map,tagHandlers:Object.create(null),totalMergeKeys:0,aliasCount:0};for(;n.eventIndex<n.events.length;){let e=n.events[n.eventIndex++];switch(n.position=aT(e),e.type){case W.DOCUMENT:n.anchors=new Map,n.nodeTags=new Map,n.aliasCount=0,n.tagHandlers=Object.create(null);for(let t of e.directives)t.kind===`tag`&&(n.tagHandlers[t.handle]=t.prefix);n.frames.push({kind:`document`,position:n.position,value:void 0,hasValue:!1});break;case W.SCALAR:{let{value:t,tag:r}=cT(n,e);gT(n,e,t,r,!0),hT(n,t,r);break}case W.SEQUENCE:{let t=lT(n,e,`tag:yaml.org,2002:seq`),r=n.schema.lookupSequenceTag(t);r||oT(n,`unknown sequence tag !<${t}>`);let i=r.create(t),a=gT(n,e,i,r,r.carrierIsResult);n.frames.push({kind:`sequence`,position:n.position,value:i,tag:r,anchor:a,index:0});break}case W.MAPPING:{let t=lT(n,e,`tag:yaml.org,2002:map`),r=n.schema.lookupMappingTag(t);r||oT(n,`unknown mapping tag !<${t}>`);let i=r.create(t),a=gT(n,e,i,r,r.carrierIsResult);n.frames.push({kind:`mapping`,position:n.position,value:i,tag:r,anchor:a,key:void 0,keyPosition:n.position,hasKey:!1,keyIsMerge:!1,overridable:null});break}case W.ALIAS:{n.maxAliases!==-1&&++n.aliasCount>n.maxAliases&&oT(n,`aliases exceeded maxAliases (${n.maxAliases})`);let t=n.source.slice(e.anchorStart,e.anchorEnd),r=n.anchors.get(t);r||oT(n,`unidentified alias "${t}"`),r.isValueFinal||oT(n,`recursive alias "${t}" is not supported for tag ${r.tag.tagName} because it uses finalize()`),hT(n,r.value,r.tag);break}case W.POP:{let e=n.frames.pop();if(e.kind===`mapping`&&e.hasKey&&(n.position=e.keyPosition,oT(n,`incomplete mapping pair in event stream`)),e.kind===`document`)n.documents.push(e.value);else{let t=e.tag.carrierIsResult?e.value:sT(n,e.position,e.tag,e.value);e.anchor&&(e.anchor.value=t,e.anchor.isValueFinal=!0),hT(n,t,e.tag)}break}}}return n.documents}var K=-1,vT=Object.prototype.hasOwnProperty,yT=1,bT=2,xT=3,ST=4,CT=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,wT=/[,\[\]{}]/,TT=/^(?:!|!!|![0-9A-Za-z-]+!)$/,ET=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,DT=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,OT=RegExp(`^(?:${ET})*$`),kT=RegExp(`^(?:${DT})+$`),AT=RegExp(`^(?:!(?:${ET})*|${DT}(?:${ET})*)$`),jT={filename:``,maxDepth:100};function MT(e,t,n){e.events.push({type:W.DOCUMENT,explicitStart:t,explicitEnd:n,directives:e.directives})}function NT(e,t,n,r,i,a,o){e.events.push({type:W.SEQUENCE,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:a,style:o})}function PT(e,t,n,r,i,a,o){e.events.push({type:W.MAPPING,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:a,style:o})}function FT(e,t){e.events.splice(t.eventsLength,0,{type:W.MAPPING,start:t.position,anchorStart:K,anchorEnd:K,tagStart:K,tagEnd:K,style:jw.FLOW})}function IT(e,t,n,r,i,a,o,s,c=Mw.CLIP,l=-1,u=!1){e.events.push({type:W.SCALAR,valueStart:t,valueEnd:n,anchorStart:r,anchorEnd:i,tagStart:a,tagEnd:o,style:s,chomping:c,indent:l,fast:u})}function LT(e,t,n){e.events.push({type:W.ALIAS,anchorStart:t,anchorEnd:n})}function RT(e){e.events.push({type:W.POP})}function zT(e){IT(e,K,K,K,K,K,K,G.PLAIN)}function BT(){return{anchorStart:K,anchorEnd:K,tagStart:K,tagEnd:K}}function VT(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,eventsLength:e.events.length}}function HT(e,t){e.position=t.position,e.line=t.line,e.lineStart=t.lineStart,e.lineIndent=t.lineIndent,e.firstTabInLine=t.firstTabInLine,e.events.length=t.eventsLength}function q(e,t){Aw.throwAt(e.input.slice(0,e.length),e.position,t,e.filename)}function UT(e){return e===10||e===13}function WT(e){return e===9||e===32}function GT(e){return WT(e)||UT(e)}function KT(e){return e===0||GT(e)}function qT(e){return e===44||e===91||e===93||e===123||e===125}function JT(e){return e>=48&&e<=57?e-48:-1}function YT(e){if(e>=48&&e<=57)return e-48;let t=e|32;return t>=97&&t<=102?t-97+10:-1}function XT(e){return e===120?2:e===117?4:e===85?8:0}function ZT(e){return e===48||e===97||e===98||e===116||e===9||e===110||e===118||e===102||e===114||e===101||e===32||e===34||e===47||e===92||e===78||e===95||e===76||e===80}function QT(e){e.input.charCodeAt(e.position)===10?e.position++:(e.position++,e.input.charCodeAt(e.position)===10&&e.position++),e.line++,e.lineStart=e.position,e.lineIndent=0,e.firstTabInLine=-1}function $T(e,t){let n=0,r=e.input.charCodeAt(e.position),i=e.position===e.lineStart||GT(e.input.charCodeAt(e.position-1));for(;r!==0;){for(;WT(r);)i=!0,r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&i&&r===35)do r=e.input.charCodeAt(++e.position);while(!UT(r)&&r!==0);if(!UT(r))break;for(QT(e),n++,i=!0,r=e.input.charCodeAt(e.position);r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return n}function eE(e,t=e.position){let n=e.input.charCodeAt(t);if((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)){let n=e.input.charCodeAt(t+3);return n===0||GT(n)}return!1}function tE(e){e.position===e.lineStart&&e.input.charCodeAt(e.position)===65279&&(e.position++,e.lineStart=e.position)}function nE(e){if(e.position!==e.lineStart)return!1;if(eE(e))return!0;if(e.input.charCodeAt(e.position)!==65279)return!1;let t=VT(e);tE(e),$T(e,!0);let n=e.input.charCodeAt(e.position),r=e.position===e.lineStart&&(n===37||n===45&&eE(e));return HT(e,t),r}function rE(e){let t=e.input.charCodeAt(e.position);for(;t!==0&&!UT(t);)t=e.input.charCodeAt(++e.position)}function iE(e,t,n){let r=CT.exec(e.input.slice(t,n));r!==null&&(e.position=t+r.index+r[0].length-1,q(e,`the stream contains non-printable characters`))}function aE(e,t,n){if(e.input.charCodeAt(e.position)!==33)return!1;t.tagStart!==K&&q(e,`duplication of a tag property`);let r=e.position,i=!1,a=!1,o=`!`,s=e.input.charCodeAt(++e.position);s===60?(i=!0,s=e.input.charCodeAt(++e.position)):s===33&&(a=!0,o=`!!`,s=e.input.charCodeAt(++e.position));let c=e.position,l;if(i){for(;s!==0&&s!==62;)s=e.input.charCodeAt(++e.position);s!==62&&q(e,`unexpected end of the stream within a verbatim tag`),l=e.input.slice(c,e.position),e.position++}else{for(;s!==0&&!GT(s)&&!(n&&qT(s));)s===33&&(a?q(e,`tag suffix cannot contain exclamation marks`):(o=e.input.slice(c-1,e.position+1),TT.test(o)||q(e,`named tag handle cannot contain such characters`),a=!0,c=e.position+1)),s=e.input.charCodeAt(++e.position);l=e.input.slice(c,e.position),wT.test(l)&&q(e,`tag suffix cannot contain flow indicator characters`)}return l&&!(i?OT.test(l):kT.test(l))&&q(e,`tag name cannot contain such characters: ${l}`),!i&&o!==`!`&&o!==`!!`&&!vT.call(e.tagHandlers,o)&&q(e,`undeclared tag handle "${o}"`),t.tagStart=r,t.tagEnd=e.position,!0}function oE(e,t){if(e.input.charCodeAt(e.position)!==38)return!1;t.anchorStart!==K&&q(e,`duplication of an anchor property`),e.position++;let n=e.position;for(;e.input.charCodeAt(e.position)!==0&&!GT(e.input.charCodeAt(e.position))&&!qT(e.input.charCodeAt(e.position));)e.position++;return e.position===n&&q(e,`name of an anchor node must contain at least one character`),t.anchorStart=n,t.anchorEnd=e.position,!0}function sE(e,t){if(e.input.charCodeAt(e.position)!==42)return!1;(t.anchorStart!==K||t.tagStart!==K)&&q(e,`alias node should not have any properties`),e.position++;let n=e.position;for(;e.input.charCodeAt(e.position)!==0&&!GT(e.input.charCodeAt(e.position))&&!qT(e.input.charCodeAt(e.position));)e.position++;return e.position===n&&q(e,`name of an alias node must contain at least one character`),LT(e,n,e.position),!0}function cE(e,t){$T(e,!1),e.lineIndent<t&&q(e,`deficient indentation`)}function lE(e,t,n){if(e.input.charCodeAt(e.position)!==39)return!1;e.position++;let r=e.position,i=!0;for(;e.input.charCodeAt(e.position)!==0;){let a=e.input.charCodeAt(e.position);if(a===39){if(e.input.charCodeAt(e.position+1)===39){i=!1,e.position+=2;continue}let t=e.position;return e.position++,IT(e,r,t,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,G.SINGLE_QUOTED,Mw.CLIP,-1,i),!0}UT(a)?(i=!1,cE(e,t)):e.position===e.lineStart&&eE(e)?q(e,`unexpected end of the document within a single quoted scalar`):a!==9&&a<32?q(e,`expected valid JSON character`):e.position++}q(e,`unexpected end of the stream within a single quoted scalar`)}function uE(e,t,n){if(e.input.charCodeAt(e.position)!==34)return!1;e.position++;let r=e.position,i=!0;for(;e.input.charCodeAt(e.position)!==0;){let a=e.input.charCodeAt(e.position);if(a===34){let t=e.position;return e.position++,IT(e,r,t,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,G.DOUBLE_QUOTED,Mw.CLIP,-1,i),!0}if(a===92){i=!1;let n=e.input.charCodeAt(++e.position);if(UT(n))cE(e,t);else if(ZT(n))e.position++;else{let t=XT(n);for(t===0&&q(e,`unknown escape sequence`);t-->0;)e.position++,YT(e.input.charCodeAt(e.position))<0&&q(e,`expected hexadecimal character`);e.position++}}else UT(a)?(i=!1,cE(e,t)):e.position===e.lineStart&&eE(e)?q(e,`unexpected end of the document within a double quoted scalar`):a!==9&&a<32?q(e,`expected valid JSON character`):e.position++}q(e,`unexpected end of the stream within a double quoted scalar`)}function dE(e,t,n){let r=e.input.charCodeAt(e.position),i=Mw.CLIP,a=-1,o=!1;if(r!==124&&r!==62)return!1;let s=r===124?G.LITERAL_BLOCK:G.FOLDED_BLOCK;for(e.position++;e.input.charCodeAt(e.position)!==0;){let n=e.input.charCodeAt(e.position),r=JT(n);if(n===43||n===45)i!==Mw.CLIP&&q(e,`repeat of a chomping mode identifier`),i=n===43?Mw.KEEP:Mw.STRIP,e.position++;else if(r>=0)r===0&&q(e,`bad explicit indentation width of a block scalar; it cannot be less than one`),o&&q(e,`repeat of an indentation width identifier`),a=t+r-1,o=!0,e.position++;else break}let c=!1;for(;WT(e.input.charCodeAt(e.position));)c=!0,e.position++;c&&e.input.charCodeAt(e.position)===35&&rE(e),UT(e.input.charCodeAt(e.position))?QT(e):e.input.charCodeAt(e.position)!==0&&q(e,`a line break is expected`);let l=o?a:-1,u=0,d=e.position,f=e.position;for(;e.input.charCodeAt(e.position)!==0;){let n=e.position,r=0;for(;e.input.charCodeAt(n+r)===32;)r++;let i=e.input.charCodeAt(n+r);if(i===0){l>=0?r>l&&(f=n+r):r>0&&(f=n+r);break}if(nE(e))break;if(!o&&l===-1&&UT(i)&&(u=Math.max(u,r)),!o&&l===-1&&!UT(i)&&(i===9&&r<t&&(e.position=n+r,q(e,`tab characters must not be used in indentation`)),r>=t&&r<u&&(e.position=n+r,q(e,`bad indentation of a mapping entry`))),l===-1&&i!==0&&!UT(i)&&r<t){e.lineIndent=r,e.position=n+r;break}!o&&i!==0&&!UT(i)&&l===-1&&(l=r);let a=l===-1?t+1:l;if(i!==0&&!UT(i)&&r<a){e.lineIndent=r,e.position=n+r;break}rE(e),f=e.position,UT(e.input.charCodeAt(e.position))&&(QT(e),f=e.position)}return iE(e,d,f),IT(e,d,f,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,s,i,l),!0}function fE(e,t){let n=e.input.charCodeAt(e.position),r=t===yT;if(n===0||GT(n)||n===35||n===38||n===42||n===33||n===124||n===62||n===39||n===34||n===37||n===64||n===96||qT(n))return!1;if(n===63||n===45){let t=e.input.charCodeAt(e.position+1);if(KT(t)||r&&qT(t))return!1}return!0}function pE(e,t,n,r){if(!fE(e,n))return!1;let i=e.position,a=e.position,o=e.input.charCodeAt(e.position),s=n===yT,c=!1;for(;o!==0&&!nE(e);){if(o===58){let t=e.input.charCodeAt(e.position+1);if(KT(t)||s&&qT(t))break}else if(o===35){if(GT(e.input.charCodeAt(e.position-1)))break}else if(s&&qT(o))break;else if(UT(o)){let n=e.position,r=e.line,i=e.lineStart,a=e.lineIndent;if($T(e,!1),e.lineIndent>=t){c=!0,o=e.input.charCodeAt(e.position);continue}e.position=n,e.line=r,e.lineStart=i,e.lineIndent=a;break}WT(o)||(a=e.position+1),o=e.input.charCodeAt(++e.position)}return a!==i&&(iE(e,i,a),IT(e,i,a,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,G.PLAIN,Mw.CLIP,-1,!c),!0)}function mE(e,t){let n=e.line;$T(e,!0),(e.line>n&&e.lineIndent<t||e.firstTabInLine!==-1&&e.lineIndent<t)&&q(e,`deficient indentation`)}function hE(e,t,n){let r=e.input.charCodeAt(e.position),i=r===123,a=e.position,o=!0;if(r!==91&&r!==123)return!1;let s=i?125:93;for(i?PT(e,a,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,jw.FLOW):NT(e,a,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,jw.FLOW),e.position++;e.input.charCodeAt(e.position)!==0;){mE(e,t);let n=e.input.charCodeAt(e.position);if(n===s)return e.position++,RT(e),!0;o?n===44&&q(e,`expected the node content, but found ','`):q(e,`missed comma between flow collection entries`);let r=!1,a=!1;n===63&>(e.input.charCodeAt(e.position+1))&&(r=a=!0,e.position+=1,mE(e,t));let c=e.line,l=VT(e),u=vE(e,t,yT,!1,!0);mE(e,t),n=e.input.charCodeAt(e.position),(i||a||e.line===c)&&n===58?(r=!0,e.position++,mE(e,t),i||FT(e,l),u||zT(e),vE(e,t,yT,!1,!0)||zT(e),mE(e,t),i||RT(e)):i&&r?(u||zT(e),zT(e)):i?zT(e):r&&(FT(e,l),u||zT(e),zT(e),RT(e)),n=e.input.charCodeAt(e.position),n===44?(o=!0,e.position++):o=!1}q(e,`unexpected end of the stream within a flow collection`)}function gE(e,t,n){if(e.firstTabInLine!==-1||e.input.charCodeAt(e.position)!==45||!KT(e.input.charCodeAt(e.position+1)))return!1;for(NT(e,e.position,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,jw.BLOCK);e.input.charCodeAt(e.position)===45&&KT(e.input.charCodeAt(e.position+1));){e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,q(e,`tab characters must not be used in indentation`));let n=e.line;e.position++;let r=$T(e,!0)>0;if(e.firstTabInLine!==-1&&e.input.charCodeAt(e.position)===45&&KT(e.input.charCodeAt(e.position+1))&&q(e,`bad indentation of a sequence entry`),r&&e.lineIndent<=t?zT(e):vE(e,t,xT,!1,!0),$T(e,!0),e.lineIndent<t||e.position>=e.length)break;e.lineIndent>t&&q(e,`bad indentation of a sequence entry`),e.line===n&&e.input.charCodeAt(e.position)===45&&KT(e.input.charCodeAt(e.position+1))&&q(e,`bad indentation of a sequence entry`)}return RT(e),!0}function _E(e,t,n,r){let i=!1,a=!1,o=!1,s=!1;if(e.firstTabInLine!==-1)return!1;let c=e.input.charCodeAt(e.position);for(;c!==0;){!i&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,q(e,`tab characters must not be used in indentation`));let l=e.input.charCodeAt(e.position+1),u=e.line;if((c===63||c===58)&&KT(l))o||=(PT(e,e.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,jw.BLOCK),!0),c===63?(i&&zT(e),a=!0,i=!0):(i||(zT(e),a=!0),i=!1),e.position+=1,s=!0;else{i&&=(zT(e),!1);let t=VT(e);if(!vE(e,n,bT,!1,!0))break;if(e.line===u){for(c=e.input.charCodeAt(e.position);WT(c);)c=e.input.charCodeAt(++e.position);if(c===58)c=e.input.charCodeAt(++e.position),KT(c)||q(e,`a whitespace character is expected after the key-value separator within a block mapping`),o||=(e.events.splice(t.eventsLength,0,{type:W.MAPPING,start:t.position,anchorStart:r.anchorStart,anchorEnd:r.anchorEnd,tagStart:r.tagStart,tagEnd:r.tagEnd,style:jw.BLOCK}),!0),a=!0,i=!1,s=!1;else if(a)q(e,`expected ':' after a mapping key`);else return r.anchorStart!==K||r.tagStart!==K?(HT(e,t),!1):!0}else if(a)q(e,`can not read a block mapping entry; a multiline key may not be an implicit key`);else return r.anchorStart!==K||r.tagStart!==K?(HT(e,t),!1):!0}if(vE(e,t,ST,!0,s)&&(s=!1),i||(s&&=(zT(e),!1)),$T(e,!0),c=e.input.charCodeAt(e.position),(e.line===u||e.lineIndent>t)&&c!==0)q(e,`bad indentation of a mapping entry`);else if(e.lineIndent<t)break}return a?(i&&zT(e),o&&RT(e),!0):!1}function vE(e,t,n,r,i,a=!0){e.depth>=e.maxDepth&&q(e,`nesting exceeded maxDepth (${e.maxDepth})`),e.depth++;let o=1,s=!1,c=!1,l=null,u=BT(),d=n===ST||n===xT,f=d,p=d;if(r&&$T(e,!0)&&(s=!0,o=e.lineIndent>t?1:e.lineIndent===t?0:-1),o===1)for(;;){let r=e.input.charCodeAt(e.position),i=VT(e);if(s&&o!==1&&(r===33||r===38))break;if(s&&p&&(u.tagStart!==K||u.anchorStart!==K)&&(r===33||r===38)){let n=VT(e),r=t+1;if(_E(e,e.position-e.lineStart,r,u)&&e.events[n.eventsLength]?.type===W.MAPPING)return e.depth--,!0;HT(e,n)}if(s&&(r===33&&u.tagStart!==K||r===38&&u.anchorStart!==K)||!aE(e,u,n===yT)&&!oE(e,u))break;l===null&&(l=i),$T(e,!0)?(s=!0,f=p,o=e.lineIndent>t?1:e.lineIndent===t?0:-1):f=!1}if(f&&=s||i,o===1||n===ST){let r=n===yT||n===bT?t:t+1,i=e.position-e.lineStart;if(o===1){if(f&&(gE(e,i,u)||_E(e,i,r,u))||hE(e,r,u))c=!0;else{let t=e.input.charCodeAt(e.position);if(l!==null&&a&&p&&!f&&t!==124&&t!==62){let t=VT(e),n=l.position-l.lineStart;HT(e,l),_E(e,n,r,BT())&&e.events[t.eventsLength]?.type===W.MAPPING?c=!0:HT(e,t)}!c&&(d&&dE(e,r,u)||lE(e,r,u)||uE(e,r,u)||sE(e,u)||pE(e,r,n,u))&&(c=!0)}}else o===0&&(c=f&&gE(e,i,u))}return d&&=!c,!c&&(u.anchorStart!==K||u.tagStart!==K||d)&&(IT(e,K,K,u.anchorStart,u.anchorEnd,u.tagStart,u.tagEnd,G.PLAIN),c=!0),e.depth--,c||u.anchorStart!==K||u.tagStart!==K}function yE(e){if(e.lineIndent>0||e.input.charCodeAt(e.position)!==37)return!1;e.position++;let t=e.position;for(;e.input.charCodeAt(e.position)!==0&&!GT(e.input.charCodeAt(e.position));)e.position++;let n=e.input.slice(t,e.position),r=[];for(n.length===0&&q(e,`directive name must not be less than one character in length`);e.input.charCodeAt(e.position)!==0&&!UT(e.input.charCodeAt(e.position));){for(;WT(e.input.charCodeAt(e.position));)e.position++;if(e.input.charCodeAt(e.position)===35||UT(e.input.charCodeAt(e.position))||e.input.charCodeAt(e.position)===0)break;let t=e.position;for(;e.input.charCodeAt(e.position)!==0&&!GT(e.input.charCodeAt(e.position));)e.position++;r.push(e.input.slice(t,e.position))}if(UT(e.input.charCodeAt(e.position))&&QT(e),n===`YAML`){e.directives.some(e=>e.kind===`yaml`)&&q(e,`duplication of %YAML directive`),r.length!==1&&q(e,`YAML directive accepts exactly one argument`);let t=/^([0-9]+)\.([0-9]+)$/.exec(r[0]);t===null&&q(e,`ill-formed argument of the YAML directive`),parseInt(t[1],10)!==1&&q(e,`unacceptable YAML version of the document`),e.directives.push({kind:`yaml`,version:r[0]})}else if(n===`TAG`){r.length!==2&&q(e,`TAG directive accepts exactly two arguments`);let[t,n]=r;TT.test(t)||q(e,`ill-formed tag handle (first argument) of the TAG directive`),vT.call(e.tagHandlers,t)&&q(e,`there is a previously declared suffix for "${t}" tag handle`),AT.test(n)||q(e,`ill-formed tag prefix (second argument) of the TAG directive`),e.tagHandlers[t]=n,e.directives.push({kind:`tag`,handle:t,prefix:n})}return!0}function bE(e){e.directives=[],e.tagHandlers=Object.create(null);let t=!1;for($T(e,!0);yE(e);)t=!0,$T(e,!0);let n=!1,r=!1,i=!0;if(e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45&&KT(e.input.charCodeAt(e.position+3))){n=!0;let t=e.line;e.position+=3,$T(e,!0),i=e.line>t}else t&&q(e,`directives end mark is expected`);let a=e.events.length;if(!n&&e.position===e.lineStart&&e.input.charCodeAt(e.position)===46&&eE(e)){e.position+=3,$T(e,!0);return}if(MT(e,n,!1),vE(e,e.lineIndent-1,ST,!1,i,i)||zT(e),$T(e,!0),e.position===e.lineStart&&eE(e)&&(r=e.input.charCodeAt(e.position)===46,r)){let t=e.line;e.position+=3,$T(e,!0),e.line===t&&e.position<e.length&&q(e,`end of the stream or a document separator is expected`)}let o=e.events[a];o?.type===W.DOCUMENT&&(o.explicitEnd=r),RT(e),!r&&e.position<e.length&&!nE(e)&&q(e,`end of the stream or a document separator is expected`)}function xE(e,t){let n=e.length,r={...jT,...t,input:`${e}\0`,length:n,position:0,line:0,lineStart:0,lineIndent:0,firstTabInLine:-1,depth:0,directives:[],tagHandlers:Object.create(null),events:[]},i=e.indexOf(`\0`);for(i!==-1&&Aw.throwAt(e,i,`null byte is not allowed in input`,r.filename);r.position<r.length&&(tE(r),$T(r,!0),!(r.position>=r.length));){let e=r.position;bE(r),r.position===e&&q(r,`can not read a document`)}return r.events}var SE={...jT,...iT};function CE(e,t={}){let n={...SE,...t},r=String(e),i=Object.keys(jT),a=Object.keys(iT);return _T(xE(r,dw(n,i)),{...dw(n,a),source:r})}function wE(e,t,n){let r=null;typeof t==`function`?r=t:typeof t==`object`&&t&&(n=t);let i=CE(e,n);if(r===null)return i;for(let e of i)r(e)}var TE=Symbol(`INVALID`);function EE(e){let t=new Set([e.defaultScalarTag,e.defaultSequenceTag,e.defaultMappingTag].filter(e=>e!==void 0)),n=e.implicitScalarTags,r=e.tags.filter(e=>!(e.nodeKind===`scalar`&&e.implicit)&&!t.has(e)),i=e.tags.filter(e=>t.has(e));return[...n.map(e=>({tag:e,implicitTag:!0})),...r.map(e=>({tag:e,implicitTag:!1})),...i.map(e=>({tag:e,implicitTag:!0}))]}function DE(e,t){for(let n=0,r=e.representTypes.length;n<r;n+=1){let{tag:r,implicitTag:i}=e.representTypes[n];if(r.identify(t)){let e;return e=r.matchByTagPrefix?r.representTagName(t):r.tagName,{tag:r,tagName:e,implicitTag:i}}}return null}function OE(e,t){if(!e.noRefs&&typeof t==`object`&&t){let n=e.refs.get(t);if(n)return n.anchor===void 0&&(n.anchor=`ref_${e.refCounter++}`),{kind:`alias`,anchor:n.anchor}}let n=DE(e,t);if(!n){if(t===void 0||e.skipInvalid)return TE;throw new Aw(`unacceptable kind of an object to dump ${Object.prototype.toString.call(t)}`)}let{tag:r,tagName:i,implicitTag:a}=n,o=a?i:tT(i);if(r.nodeKind===`scalar`)return{kind:`scalar`,tag:o,tagged:!a,style:G.PLAIN,value:r.represent(t)};if(r.nodeKind===`sequence`){let n=r.represent(t),i={kind:`sequence`,tag:o,tagged:!a,style:jw.BLOCK,items:[]};e.noRefs||e.refs.set(t,i);for(let t=0,r=n.length;t<r;t+=1){let r=OE(e,n[t]);r===TE&&n[t]===void 0&&(r=OE(e,null)),r!==TE&&i.items.push(r)}return i}let s=r.represent(t),c={kind:`mapping`,tag:o,tagged:!a,style:jw.BLOCK,items:[]};e.noRefs||e.refs.set(t,c);for(let[t,n]of s){let r=OE(e,t);if(r===TE)continue;let i=OE(e,n);i!==TE&&c.items.push({key:r,value:i})}return c}function kE(e,t,n={}){let r=OE({representTypes:EE(t),noRefs:n.noRefs??!1,skipInvalid:n.skipInvalid??!1,refs:new Map,refCounter:0},e);return[{contents:r===TE?null:r,directives:[]}]}var AE=Symbol(`visit:break`),jE=Symbol(`visit:skip`);function ME(e,t,n){let r=t(e,n);if(r===AE)return!0;if(r===jE)return!1;let i=n.depth+1;switch(e.kind){case`sequence`:for(let n of e.items)if(ME(n,t,{depth:i,parent:e,isKey:!1}))return!0;break;case`mapping`:for(let{key:n,value:r}of e.items)if(ME(n,t,{depth:i,parent:e,isKey:!0})||ME(r,t,{depth:i,parent:e,isKey:!1}))return!0}return!1}function NE(e,t){for(let n of e)if(n.contents&&ME(n.contents,t,{depth:0,parent:null,isKey:!1}))return}function PE(e,t){return!!(e&1<<t)}var FE={applyQuoteFlowKeysOption:LE,doubleQuoteForInvisibles:RE,doubleQuoteWhitespaceOnly:zE,applyForceQuotesOption:BE,tryLongOrMultilineAsBlock:VE,quoteInvalidPlain:HE,fallbackToDoubleQuoted:UE};function IE(e){return e.presenterOptions.quoteStyle===`single`&&PE(e.allowedStylesMask,G.SINGLE_QUOTED)?G.SINGLE_QUOTED:G.DOUBLE_QUOTED}function LE(e){e.presenterOptions.quoteFlowKeys&&e.isKey&&e.flowOnly&&e.style===G.PLAIN&&(e.style=G.DOUBLE_QUOTED)}function RE(e){e.style===G.PLAIN&&/[\t\x7F-\xA0\u2028\u2029\uFEFF\uFFFE\uFFFF]/.test(e.node.value)&&(e.style=G.DOUBLE_QUOTED)}function zE(e){e.style===G.PLAIN&&/^\s+$/.test(e.node.value)&&(e.style=G.DOUBLE_QUOTED)}function BE(e){e.presenterOptions.forceQuotes&&(e.isKey||e.style!==G.PLAIN||e.node.tag===e.presenterOptions.schema.defaultScalarTag.tagName&&(e.style=e.node.value.includes(`
|
|
133
|
+
`)?G.DOUBLE_QUOTED:IE(e)))}function VE(e){if(e.style!==G.PLAIN||e.isKey)return;let t=e.node.value,n=t.indexOf(`
|
|
134
|
+
`)!==-1;if(!PE(e.allowedStylesMask,G.LITERAL_BLOCK)){n&&(e.style=G.DOUBLE_QUOTED);return}let r=e.presenterOptions.lineWidth;if(r===-1){n&&(e.style=G.LITERAL_BLOCK);return}let i=Math.max(Math.min(r,40),r-e.shiftOfContent),a=0,o=!1;for(;a<=t.length;){let e=t.length,n=t.indexOf(`
|
|
135
|
+
`,a);n!==-1&&(e=n);let r=t.slice(a,e);if(r.length>i&&r[0]!==` `&&/ [^ \t]/.test(r)&&(o=!0),n===-1)break;a=n+1}o?e.style=G.FOLDED_BLOCK:n&&(e.style=G.LITERAL_BLOCK)}function HE(e){e.style===G.PLAIN&&!PE(e.allowedStylesMask,G.PLAIN)&&(e.style=IE(e))}function UE(e){PE(e.allowedStylesMask,e.style)||(e.style=G.DOUBLE_QUOTED)}function WE(e,t){return e|1<<t}var GE=`[\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]`,KE=`[\\n\\r]`,qE=`\\uFEFF`,JE=`[ \\t]`,YE=`(?:(?!(?:${KE}|${qE}))${GE})`,XE=`(?:(?!${JE})${YE})`,ZE=`[\\x09\\x20-\\uD7FF\\uE000-\\uFFFF\\u{10000}-\\u{10FFFF}]`,QE=`[-?:,\\[\\]{}#&*!|>'"%@\`]`,$E=`[,\\[\\]{}]`,eD=XE,tD=`(?:(?!${$E})${XE})`,nD=`(?:(?:(?!${QE})${XE})|[?:-](?=${eD}))`,rD=`(?:(?:(?!${QE})${XE})|[?:-](?=${tD}))`,iD=`(?:(?:(?![:#])${eD})|:(?=${eD}))#*`,aD=`(?:(?:(?![:#])${tD})|:(?=${tD}))#*`,oD=`(?:${JE}*${iD})*`,sD=`(?:${JE}*${aD})*`,cD=`${nD}#*${oD}`,lD=`${rD}#*${sD}`,uD=cD,dD=lD,fD=`\\n+${iD}${oD}`,pD=`\\n+${aD}${sD}`,mD=`${cD}(?:${fD})*`,hD=`${lD}(?:${pD})*`,gD=RegExp(`^(?:${mD})$`,`u`),_D=RegExp(`^(?:${hD})$`,`u`),vD=RegExp(`^(?:${uD})$`,`u`),yD=RegExp(`^(?:${dD})$`,`u`),bD=RegExp(`^(?:${ZE})*$`,`u`),xD=RegExp(`^(?:${ZE}|\\n)*$`,`u`),SD=RegExp(`^(?:${YE}|\\n)*$`,`u`),CD=/^(?:---|\.\.\.)(?=$|[ \t\n\r])/,wD=/^(?:---|\.\.\.)(?=$|[ \t\n\r])/m;function TD(e){let t=e.node.value;if(t!==``){if(!(e.isKey?e.flowOnly?yD:vD:e.flowOnly?_D:gD).test(t)||e.shiftOfFirstLine===0&&CD.test(t))return!1;if(e.shiftOfContent===0){let e=t.indexOf(`
|
|
136
|
+
`);if(e!==-1){let n=t.slice(e+1);if(wD.test(n))return!1}}}let n=e.presenterOptions.schema.resolveImplicitScalarTag(t).tag.tagName;return!(!e.node.tagged&&n!==e.node.tag||!e.node.tagged&&t===`=`&&n===e.presenterOptions.schema.defaultScalarTag.tagName)}function ED(e){let t=e.node.value;if(!(e.isKey?bD:xD).test(t)||/[ \t]\n|\n[ \t]/.test(t))return!1;if(!e.isKey&&e.shiftOfContent===0){let e=t.indexOf(`
|
|
137
|
+
`);if(e!==-1&&wD.test(t.slice(e+1)))return!1}return!0}function DD(e){if(e.flowOnly||!SD.test(e.node.value))return!1;let t=e.shiftOfContent-e.shiftOfParent;return!(t<1||t>9&&/^\n* /.test(e.node.value)||e.shiftOfContent===0&&wD.test(e.node.value))}function OD(e){let t=WE(0,G.DOUBLE_QUOTED);TD(e)&&(t=WE(t,G.PLAIN)),ED(e)&&(t=WE(t,G.SINGLE_QUOTED)),DD(e)&&(t=WE(WE(t,G.LITERAL_BLOCK),G.FOLDED_BLOCK)),e.allowedStylesMask=t}function kD(e){switch(e.style){case G.PLAIN:return AD(e);case G.SINGLE_QUOTED:return jD(e);case G.LITERAL_BLOCK:return MD(e);case G.FOLDED_BLOCK:return ND(e);case G.DOUBLE_QUOTED:return PD(e)}}function AD(e){return FD(e.node.value,e.shiftOfContent)}function jD(e){return`'${FD(e.node.value,e.shiftOfContent).replace(/'/g,`''`)}'`}function MD(e){let t=e.node.value;return`|`+RD(t,e.shiftOfParent,e.shiftOfContent)+zD(ID(t,e.shiftOfContent))}function ND(e){let t=e.node.value,n=e.presenterOptions.lineWidth,r=1/0;return n!==-1&&(r=Math.max(Math.min(n,40),n-e.shiftOfContent)),`>`+RD(t,e.shiftOfParent,e.shiftOfContent)+zD(ID(HD(t,r),e.shiftOfContent))}function PD(e){return`"${GD(e.node.value)}"`}function FD(e,t){let n=e.indexOf(`
|
|
138
138
|
`);if(n===-1)return e;let r=` `.repeat(t),i=e.slice(0,n),a=/(\n+)([^\n]*)/g;a.lastIndex=n;let o;for(;o=a.exec(e);){let e=o[1].length,t=o[2];i+=`
|
|
139
|
-
`.repeat(e+1)+r+t}return i}function
|
|
139
|
+
`.repeat(e+1)+r+t}return i}function ID(e,t){let n=` `.repeat(t),r=0,i=``,a=e.length;for(;r<a;){let t,o=e.indexOf(`
|
|
140
140
|
`,r);o===-1?(t=e.slice(r),r=a):(t=e.slice(r,o+1),r=o+1),t.length&&t!==`
|
|
141
|
-
`&&(i+=n),i+=t}return i}function
|
|
141
|
+
`&&(i+=n),i+=t}return i}function LD(e){return/^\n* /.test(e)}function RD(e,t,n){let r=LD(e)?String(n-t):``,i=e[e.length-1]===`
|
|
142
142
|
`;return`${r}${i&&(e[e.length-2]===`
|
|
143
143
|
`||e===`
|
|
144
|
-
`)?`+`:i?``:`-`}\n`}function
|
|
145
|
-
`?e.slice(0,-1):e}function
|
|
146
|
-
`,e.length-i>t&&o>i?c+=`${e.slice(i,o)}\n${e.slice(o+1)}`:c+=e.slice(i),c.slice(1)}function
|
|
147
|
-
`);r===-1&&(r=e.length),n.lastIndex=r;let i=
|
|
148
|
-
`||
|
|
149
|
-
`:``)+
|
|
150
|
-
`:return`\\n`;case`\v`:return`\\v`;case`\f`:return`\\f`;case`\r`:return`\\r`;case`\x1B`:return`\\e`;case`"`:return`\\"`;case`\\`:return`\\\\`;case`
`:return`\\N`;case`\xA0`:return`\\_`;case`\u2028`:return`\\L`;case`\u2029`:return`\\P`}let t=e.charCodeAt(0),n=t.toString(16).toUpperCase();return t<=255?`\\x${`0`.repeat(2-n.length)}${n}`:`\\u${`0`.repeat(4-n.length)}${n}`}function
|
|
151
|
-
`)!==-1,p=d.length>1024&&/^[\s\S]{1025}/u.test(d),m=l||f||p;m&&(d&&
|
|
144
|
+
`)?`+`:i?``:`-`}\n`}function zD(e){return e[e.length-1]===`
|
|
145
|
+
`?e.slice(0,-1):e}function BD(e){return e===` `||e===` `}function VD(e,t){if(e===``||BD(e[0]))return e;let n=/ [^ \t]/g,r,i=0,a,o=0,s=0,c=``;for(;r=n.exec(e);)s=r.index,s-i>t&&(a=o>i?o:s,c+=`\n${e.slice(i,a)}`,i=a+1),o=s;return c+=`
|
|
146
|
+
`,e.length-i>t&&o>i?c+=`${e.slice(i,o)}\n${e.slice(o+1)}`:c+=e.slice(i),c.slice(1)}function HD(e,t){let n=/(\n+)([^\n]*)/g,r=e.indexOf(`
|
|
147
|
+
`);r===-1&&(r=e.length),n.lastIndex=r;let i=VD(e.slice(0,r),t),a=e[0]===`
|
|
148
|
+
`||BD(e[0]),o,s;for(;s=n.exec(e);){let e=s[1],n=s[2];o=n!==``&&BD(n[0]),i+=e+(!a&&!o&&n!==``?`
|
|
149
|
+
`:``)+VD(n,t),a=o}return i}var UD=/["\\\x00-\x1F\x7F-\xA0\u2028\u2029\uD800-\uDFFF\uFEFF\uFFFE\uFFFF]/gu;function WD(e){switch(e){case`\0`:return`\\0`;case`\x07`:return`\\a`;case`\b`:return`\\b`;case` `:return`\\t`;case`
|
|
150
|
+
`:return`\\n`;case`\v`:return`\\v`;case`\f`:return`\\f`;case`\r`:return`\\r`;case`\x1B`:return`\\e`;case`"`:return`\\"`;case`\\`:return`\\\\`;case`
`:return`\\N`;case`\xA0`:return`\\_`;case`\u2028`:return`\\L`;case`\u2029`:return`\\P`}let t=e.charCodeAt(0),n=t.toString(16).toUpperCase();return t<=255?`\\x${`0`.repeat(2-n.length)}${n}`:`\\u${`0`.repeat(4-n.length)}${n}`}function GD(e){return e.replace(UD,WD)}var KD=10,qD={indent:2,seqNoIndent:!1,seqInlineFirst:!0,lineWidth:80,flowBracketPadding:!1,flowSkipCommaSpace:!1,flowSkipColonSpace:!1,quoteFlowKeys:!1,quoteStyle:`single`,forceQuotes:!1,scalarStyleRules:Object.keys(FE).map(e=>Reflect.get(FE,e)),tagBeforeAnchor:!1};function JD(e){return e.tagged?e.tag:tT(e.tag)}function YD(e){let t={...qD,...e};return t.flowSkipColonSpace&&(t.quoteFlowKeys=!0),{...t,defaultScalarTagName:t.schema.defaultScalarTag.tagName,openEnded:!1}}function XD(e,t){return`\n${` `.repeat(e.indent*t)}`}function ZD(e,t,n,r,i,a){return{node:t,parent:n,level:r,isKey:i,flowOnly:a,shiftOfParent:r===0?-1:e.indent*(r-1),shiftOfContent:e.indent*Math.max(1,r),shiftOfFirstLine:r===0?0:e.indent*r,presenterOptions:e,allowedStylesMask:0,style:t.style}}function QD(e,t,n){let r=``;for(let i=0,a=n.items.length;i<a;i+=1){let a=rO(e,t,n.items[i],n,{}).text;i>0&&(r+=`,${e.flowSkipCommaSpace?``:` `}`),r+=a}let i=e.flowBracketPadding&&n.items.length>0?` `:``;return`[${i}${r}${i}]`}function $D(e,t,n,r){let i=``;for(let a=0,o=n.items.length;a<o;a+=1){let o=rO(e,t+1,n.items[a],n,{block:!0,compact:e.seqInlineFirst,isblockseq:!0}).text;r&&i===``||(i+=XD(e,t)),o===``||KD===o.charCodeAt(0)?i+=`-`:i+=`- `,i+=o}return i}function eO(e,t,n){let r=``;for(let{key:i,value:a}of n.items){let o=``;r!==``&&(o+=`,${e.flowSkipCommaSpace?``:` `}`);let s=rO(e,t,i,n,{iskey:!0}),c=s.text,l=rO(e,t,a,n,{}).text,u=e.flowSkipColonSpace||l===``?``:` `,d=i.kind===`scalar`&&s.noBody&&(i.tagged||i.anchor!==void 0),f=i.kind===`alias`||d?` `:``;o+=`${c}${f}:${u}${l}`,r+=o}let i=e.flowBracketPadding&&r!==``?` `:``;return`{${i}${r}${i}}`}function tO(e,t,n,r){let i=``;for(let a=0,o=n.items.length;a<o;a+=1){let o=``;r&&i===``||(o+=XD(e,t));let{key:s,value:c}=n.items[a],l=(s.kind===`mapping`||s.kind===`sequence`)&&s.style===jw.BLOCK&&s.items.length!==0||s.kind===`scalar`&&(s.style===G.LITERAL_BLOCK||s.style===G.FOLDED_BLOCK),u=l?rO(e,t+1,s,n,{block:!0,compact:!0,isblockseq:!nO(e,s,t+1)}):rO(e,t+1,s,n,{block:!0,compact:!0,iskey:!0}),d=u.text,f=s.kind===`scalar`&&s.value.indexOf(`
|
|
151
|
+
`)!==-1,p=d.length>1024&&/^[\s\S]{1025}/u.test(d),m=l||f||p;m&&(d&&KD===d.charCodeAt(0)?o+=`?`:o+=`? `),o+=d,m&&(o+=XD(e,t));let h=rO(e,t+1,c,n,{block:!0,compact:m,isblockseq:m&&!nO(e,c,t+1)}).text,g=s.kind===`scalar`&&u.noBody&&(s.tagged||s.anchor!==void 0),_=!m&&(s.kind===`alias`||g)?` `:``;h===``||KD===h.charCodeAt(0)?o+=`${_}:`:o+=`${_}: `,o+=h,i+=o}return i}function nO(e,t,n){return t.kind===`alias`||t.tagged||t.anchor!==void 0||e.indent<2&&n>0}function rO(e,t,n,r,i){if(n.kind===`alias`)return e.openEnded=!1,{text:`*${n.anchor}`,noBody:!1};let{block:a=!1,iskey:o=!1,isblockseq:s=!1}=i,c=i.compact??!1,l=n.anchor!==void 0;nO(e,n,t)&&(c=!1);let u,d=n.tagged,f=a&&(n.kind===`mapping`||n.kind===`sequence`)&&n.style===jw.BLOCK&&n.items.length!==0;if(n.kind===`mapping`)u=f?tO(e,t,n,c):eO(e,t,n);else if(n.kind===`sequence`)u=f?e.seqNoIndent&&!s&&t>0?$D(e,t-1,n,c):$D(e,t,n,c):QD(e,t,n);else{let i=ZD(e,n,r,t,o,!a);OD(i);for(let t of e.scalarStyleRules)t(i);u=kD(i),e.openEnded=(i.style===G.LITERAL_BLOCK||i.style===G.FOLDED_BLOCK)&&(n.value===`
|
|
152
152
|
`||n.value.endsWith(`
|
|
153
153
|
|
|
154
|
-
`)),d=n.tagged||u===``&&i.flowOnly&&r?.kind===`sequence`&&!l||i.style!==
|
|
155
|
-
`);else if(c){let e=
|
|
156
|
-
`:` `;r+=`---${t}${e}\n`}else r+=
|
|
154
|
+
`)),d=n.tagged||u===``&&i.flowOnly&&r?.kind===`sequence`&&!l||i.style!==G.PLAIN&&n.tag!==e.defaultScalarTagName}n.kind!==`mapping`&&n.kind!==`sequence`||f||(e.openEnded=!1),f&&c&&t>0&&e.indent>2&&(u=`${` `.repeat(e.indent-2)}${u}`);let p=u===``,m=u;if(d||l){let t=[],r=d?JD(n):null,i=l?`&${n.anchor}`:null;e.tagBeforeAnchor?(r!==null&&t.push(r),i!==null&&t.push(i)):(i!==null&&t.push(i),r!==null&&t.push(r));let a=u===``||u.charCodeAt(0)===KD?``:` `;m=`${t.join(` `)}${a}${u}`}return{text:m,noBody:p}}function iO(e){return(e.kind===`sequence`||e.kind===`mapping`)&&e.style===jw.BLOCK&&e.items.length!==0&&!e.tagged&&e.anchor===void 0}function aO(e){let t=``;for(let n of e.directives){if(n.kind===`yaml`){t+=`%YAML ${n.version}\n`;continue}let{handle:e,prefix:r}=n;t+=`%TAG ${e} ${r}\n`}return t}function oO(e,t){let n=YD(t),r=``,i=!1;for(let t=0;t<e.length;t+=1){let a=e[t];n.openEnded=!1;let o=aO(a),s=o!==``,c=a.explicitStart||s||t>0&&!i;if(r+=o,a.contents===null)c&&(r+=`---
|
|
155
|
+
`);else if(c){let e=rO(n,0,a.contents,null,{block:!0,compact:!0}).text,t=e===``?``:s||iO(a.contents)?`
|
|
156
|
+
`:` `;r+=`---${t}${e}\n`}else r+=rO(n,0,a.contents,null,{block:!0,compact:!0}).text+`
|
|
157
157
|
`;i=a.explicitEnd||n.openEnded,i&&(r+=`...
|
|
158
|
-
`)}return r}var
|
|
158
|
+
`)}return r}var sO={...qD,schema:Cw,skipInvalid:!1,noRefs:!1,flowLevel:-1,sortKeys:!1,transform:()=>{}};function cO(e,t){let n=String(e),r=String(t);return n<r?-1:+(n>r)}function lO(e,t={}){let n={...sO,...t},r=kE(e,n.schema,{noRefs:n.noRefs,skipInvalid:n.skipInvalid});if(n.flowLevel>=0&&NE(r,(e,t)=>{if(!(t.depth<n.flowLevel))return(e.kind===`sequence`||e.kind===`mapping`)&&(e.style=jw.FLOW),jE}),n.sortKeys){let e=n.sortKeys===!0?cO:n.sortKeys;NE(r,t=>{t.kind===`mapping`&&t.items.sort((t,n)=>e(t.key.kind===`scalar`?t.key.value:``,n.key.kind===`scalar`?n.key.value:``))})}return n.transform(r),oO(r,{...dw(n,Object.keys(qD)),schema:n.schema})}W.DOCUMENT,W.SEQUENCE,W.MAPPING,W.SCALAR,W.ALIAS,W.POP,G.PLAIN,G.SINGLE_QUOTED,G.DOUBLE_QUOTED,G.LITERAL_BLOCK,G.FOLDED_BLOCK,jw.BLOCK,jw.FLOW,Mw.CLIP,Mw.STRIP,Mw.KEEP;function uO(e){let t=wE(e,{schema:xw});if(t.length>1)throw new Aw(`expected a single document in the stream, but found more`);return t[0]}function dO(e,t){let n=lO(e,{indent:2,lineWidth:-1,...t}).split(`
|
|
159
159
|
`);for(let e=0;e<n.length;e++){let t=n[e],r=t.trimStart();if(r[0]===`'`||r[0]===`"`){let i=r[0];if(r[1]===`:`){let a=r.indexOf(i,1);if(a>1&&r[a+1]===`:`){let i=t.length-r.length;n[e]=` `.repeat(i)+r.slice(1,a)+r.slice(a+1)}}}}return n.join(`
|
|
160
|
-
`)}var
|
|
161
|
-
`};function
|
|
162
|
-
`)){let e=/^ {0,3}(`+|~+)/.exec(r);if(!e)continue;let i=e[1];i[0]==="`"?i.length>t&&(t=i.length):i.length>n&&(n=i.length)}let r=t<=n?"`":`~`;return r.repeat(Math.max(3,(r==="`"?t:n)+1))}var
|
|
160
|
+
`)}var fO=[`javascript:`,`vbscript:`];function pO(e,t){if(fO.includes(e.protocol))return!0;if(e.protocol!==`data:`)return!1;if(!t)return!0;let n=e.href.slice(5),r=0;for(;r<n.length&&n[r]!==`,`&&n[r]!==`;`;)r++;return!n.slice(0,r).trim().toLowerCase().startsWith(`image/`)}var mO={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`,colon:`:`,sol:`/`,bsol:`\\`,Tab:` `,NewLine:`
|
|
161
|
+
`};function hO(e){let t=e;for(let e=0;e<10;e++){let e=t.replace(/&#x([0-9a-f]+);?/gi,(e,t)=>{let n=Number.parseInt(t,16);return n<=1114111?String.fromCodePoint(n):e}).replace(/&#(\d+);?/g,(e,t)=>{let n=Number.parseInt(t,10);return n<=1114111?String.fromCodePoint(n):e}).replace(/&([a-z]+);?/gi,(e,t)=>mO[t]??e);if(e===t)break;t=e}return t}function gO(e){if(!e.includes(`:`)&&!e.includes(`&`)&&!e.includes(`%`))return!1;let t=e;try{t=decodeURIComponent(e)}catch{}let n=hO(t),r;try{r=new URL(n)}catch{return!1}return pO(r,!0)}var _O=new Set([`to`,`action`,`poster`,`cite`,`background`,`ping`]),vO=/(?:href|src|url|uri|link)s?$/;function yO(e){return _O.has(e)||vO.test(e)}function bO(e){return e.toLowerCase().replace(/^(?:v-bind:|[:.^])+/,``).replace(/^(?:@|v-on:)/,`on`).replace(/[:_-]/g,``)}function xO(e){return yO(bO(e))}function SO(e){let t=0,n=0;for(let r of e.split(`
|
|
162
|
+
`)){let e=/^ {0,3}(`+|~+)/.exec(r);if(!e)continue;let i=e[1];i[0]==="`"?i.length>t&&(t=i.length):i.length>n&&(n=i.length)}let r=t<=n?"`":`~`;return r.repeat(Math.max(3,(r==="`"?t:n)+1))}var CO=new Set([`innerhtml`,`dangerouslysetinnerhtml`,`textcontent`]);function wO(e,t,n={}){let r={};for(let i in e){if(i===`$`)continue;let a=e[i],o=i.charCodeAt(0)===58,s=o?i.slice(1):i,c=s.replace(/^[.^]/,``).toLowerCase();if(CO.has(c))continue;let l,u=i;if(n.parseJson&&o){if(typeof a==`string`)try{l=JSON.parse(a)}catch{l=KO(t,a)}else l=a;u=s}else if(o&&typeof a==`string`){let e=KO(t,a);e===void 0?l=a:(l=e,u=s)}else l=a;o&&xO(s)&&typeof l==`string`&&gO(l)||(r[u]=l)}return r}var TO={blockquote:{drop:[`as`]},ol:{drop:[`start`]},ul:{classBlocklist:[`contains-task-list`]},li:{classBlocklist:[`task-list-item`]},pre:{drop:[`language`,`filename`,`highlights`,`meta`,`style`]}};function EO(e,t){let n=TO[e],r=e===`pre`||e===`code`;if(!n&&!r)return{...t};let i={};for(let[e,a]of Object.entries(t))if(!n?.drop?.includes(e)){if(e===`class`&&n?.classBlocklist&&typeof a==`string`){let t=a.split(/\s+/).filter(e=>e&&!n.classBlocklist.includes(e)).join(` `);t&&(i[e]=t)}else if(e===`class`&&r&&typeof a==`string`&&(a.startsWith(`shiki`)||a.startsWith(`shj`))){let t=a.split(/\s+/),n=t.findIndex(e=>e===`.`),r=n>=0?t.slice(n+1).join(` `):``;r&&(i[e]=r)}else i[e]=a}return i}function DO(e){let t=Object.entries(e).map(([e,t])=>{if(e.startsWith(`:`)&&t===`true`)return e.slice(1);if(e===`id`)return`#${t}`;if(e===`class`)return(Array.isArray(t)?t.join(` `):String(t)).split(` `).filter(Boolean).map(e=>`.${e}`).join(``);if(typeof t==`object`)return`${e}="${JSON.stringify(t).replace(/"/g,`\\"`)}"`;let n=String(t);return n.includes(`"`)&&!n.includes(`'`)?`${e}='${n}'`:`${e}="${n.replace(/"/g,`\\"`)}"`}).join(` `);return t.length>0?`{${t}}`:``}var OO=/^[a-zA-Z_:][a-zA-Z0-9_:.-]*$/;function kO(e){let t=[];for(let[n,r]of Object.entries(e)){let e=n.startsWith(`:`)?n.slice(1):n;if(OO.test(e)){if(n.startsWith(`:`)){if(r===`true`){t.push(e);continue}if(typeof r==`object`&&r){t.push(`${e}="${VO(JSON.stringify(r))}"`);continue}t.push(`${e}="${VO(String(r))}"`)}else r===!0||r===`true`?t.push(e):r!==!1&&r!=null&&(typeof r==`object`?t.push(`${e}="${VO(JSON.stringify(r))}"`):t.push(`${e}="${VO(String(r))}"`))}}return t.join(` `)}function AO(e){return e===`true`||e!==`false`&&e}function jO(e,t=`codeblock`){let n=dO(Object.fromEntries(Object.entries(e).map(([e,t])=>{if(e.startsWith(`:`)){if(typeof t==`string`)try{return[e.slice(1),JSON.parse(t)]}catch{return[e,t]}return[e.slice(1),t]}return[e,AO(t)]}))).trim();if(t===`frontmatter`)return`---\n${n}\n---`;let r=SO(n);return`${r}yaml [props]\n${n}\n${r}`}function MO(e,t={}){if(typeof e==`string`)return t.decodeUnicodeEntities?aC(e):e;let n=``,r=e.length;for(let i=2;i<r;i++)n+=MO(e[i],t);return n}function*NO(e,t){function*n(e,r,i,a){if(a>=50)return r.splice(i,1),!0;let o=e;if(t(e)){let t=yield e;if(t===!1)return r.splice(i,1),!0;t!==void 0&&(r[i]=t,o=t)}if(Array.isArray(o)&&o.length>2){let e=2;for(;e<o.length;)(yield*n(o[e],o,e,a+1))||(e+=1)}return!1}let r=0;for(;r<e.nodes.length;)(yield*n(e.nodes[r],e.nodes,r,0))||(r+=1)}function PO(e,t,n){let r=NO(e,t),i=r.next();for(;!i.done;){let e=n(i.value);i=r.next(e)}}var FO=new Set([`language`,`filename`,`highlights`,`meta`]);function IO(e,t,n){if(e!==`pre`||!Array.isArray(t)||t[1]?.$?.html===1)return n;let r=!1,i={};for(let e in n)if(FO.has(e)){r=!0;let t=n[e];i[`data-${e}`]=typeof t==`object`&&t?JSON.stringify(t):t}else i[e]=n[e];return r?i:n}var LO=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function RO(e){return LO.has(e.toLowerCase())}var zO=/[&<>"]/g,BO=/^&[a-zA-Z][a-zA-Z0-9]*;|#[0-9]+;|#x[0-9a-fA-F]+;/;function VO(e,t){let n={"&":`&`,"<":`<`,">":`>`,'"':`"`};return t&&Object.assign(n,t),e.replace(zO,(t,r)=>{switch(t){case`&`:return n[t]===`&`||e.slice(r).match(BO)?t:n[t]??t;default:return n[t]??t}})}function HO(e,{ignoreFirstLine:t=!1,level:n=1,width:r}={}){let i=r?` `.repeat(r):` `.repeat(n);return e.split(`
|
|
163
163
|
`).map((e,n)=>t&&n===0?e:e&&i+e).join(`
|
|
164
|
-
`)}function
|
|
165
|
-
`,`*`,`_`,`[`,`]`,`}`,`)`,`>`]),
|
|
166
|
-
---`);if(r!==-1){let i=e[r-1]===
|
|
164
|
+
`)}function UO(e){return e?GO(e).map(e=>e?e[0].toUpperCase()+e.slice(1):``).join(``):``}function WO(e){return e?GO(e).map(e=>e.toLowerCase()).join(`-`):``}function GO(e){let t=[];if(!e)return t;let n=``,r,i;for(let a=0;a<e.length;a++){let o=e[a],s=o===`-`||o===`_`||o===`/`||o===`.`;if(s===!0){t.push(n),n=``,r=void 0;continue}let c=o.charCodeAt(0),l=c>=48&&c<=57?void 0:c>=65&&c<=90;if(i===!1){if(r===!1&&l===!0){t.push(n),n=o,r=l;continue}if(r===!0&&l===!1&&n.length>1){let e=n[n.length-1];t.push(n.slice(0,n.length-1)),n=e+o,r=l;continue}}n+=o,r=l,i=s}return t.push(n),t}function KO(e,t){let n=t.split(`.`),r=e;for(let e of n)if(r&&typeof r==`object`&&e in r)r=r[e];else return;return r}var qO={"[":`]`,"{":`}`,"(":`)`},JO={"'":`'`,'"':`"`,"`":"`"};function YO(e,t=0){if(e[t]!==`{`)throw Error(`Invalid props, expected \`{\` but got '${e[t]}'`);let n=[];if(e[t+1]===`{`)return;for(t+=1;t<e.length;)if(e[t]===`\\`)t+=2;else if(e[t]===`}`){t+=1;break}else if(e[t]===` `)t+=1;else if(e[t]===`.`)t+=1,n.push([`class`,r(` #.}`,!0)]);else if(e[t]===`#`)t+=1,n.push([`id`,r(` #.}`)]);else{let r=t;for(;t<e.length&&(t+=1,!` }=`.includes(e[t])););let a=e[t];if(r!==t){let o=e.slice(r,t).trim(),s=``;a===`=`?(t+=1,s=i()):(o=o[0]===`:`?o:`:${o}`,s=`true`),o.match(/^:?[a-z_][a-z0-9_-]*$/gi)&&n.push([o,s])}}function r(n,r=!1){let i=t;for(;t<e.length;){if(t+=1,e[t]===`\\`&&(t+=2),r&&e[t]in qO){let n=t;if(a(qO[e[t]]))continue;t=n}if(n.includes(e[t]))break}return e.slice(i,t)}function i(){let n=t;return e[t]in qO?(a(qO[e[t]]),t+=1,e.slice(n,t)):e[t]in JO?(o(JO[e[t]]),t+=1,e.slice(n,t)):r(` }`)}function a(n){for(;t<e.length;)if(t++,e[t]in JO)o(JO[e[t]]);else if(e[t]in qO){if(!a(qO[e[t]]))return!1}else if(e[t]===n)return!0;return!1}function o(e){return r(e)}return n.forEach(e=>{/^(['"`]).*\1$/.test(e[1])&&(e[1]=e[1].slice(1,-1))}),{props:n,index:t}}var XO=/^[a-z$][$\w.-]*/i;function ZO(e){if(e=e.trim(),!e)return{name:``};let t=e.match(XO)?.[0];if(!t)throw Error(`Invalid block params: ${e}`);let n=e.slice(t.length).trim(),r,i,a;if(n.startsWith(`[`)){let e=NS(n,0);e&&(r=e.content,n=n.slice(e.endIndex).trim())}if(n.startsWith(`{`)){let e=YO(n,0);if(e){i=e.props;let t=n.slice(e.index).trim();t&&(a=t)}}else n&&(a=n);let o={name:WO(t)};return r!==void 0&&(o.content=r),i!==void 0&&(o.props=i),a&&(o.remaining=a),o}function QO(e,t,n){let r=e.bMarks[t],i=e.eMarks[t],a=r,o=0;for(;a<i&&o<n;){let r=e.src.charCodeAt(a);if(r===32)o++;else if(r===9){let r=4-(o+e.bsCount[t])%4;if(o+r>n)return!1;o+=r}else break;a++}return o>0&&(e.bMarks[t]=a,e.bsCount[t]+=o,e.sCount[t]-=o,e.tShift[t]-=a-r),!0}function $O(e,t,n,r){let i=[],a=[],o=[],s=[];for(let c=t;c<n;c++)if(i.push(e.bMarks[c]),a.push(e.bsCount[c]),o.push(e.sCount[c]),s.push(e.tShift[c]),!QO(e,c,r[c-t]))return ek(e,t,i,a,o,s),!1;let c=e.blkIndent;return e.blkIndent=0,e.md.block.tokenize(e,t,n),e.blkIndent=c,ek(e,t,i,a,o,s),!0}function ek(e,t,n,r,i,a){for(let o=0;o<n.length;o++){let s=t+o;e.bMarks[s]=n[o],e.bsCount[s]=r[o],e.sCount[s]=i[o],e.tShift[s]=a[o]}}var tk=/^[a-z$][\w$-]*/i;function nk(e){return tk.test(e)}var rk={"---":`---`,"```yaml [props]":"```","~~~yaml [props]":`~~~`,"```yml [props]":"```","~~~yml [props]":`~~~`},ik=e=>{e.block.ruler.before(`fence`,`comark_block_shorthand`,function(e,t,n,r){let i=e.src.slice(e.bMarks[t]+e.tShift[t],e.eMarks[t]);if(i[0]!==`:`||!nk(i.slice(1)))return!1;let{name:a,content:o,props:s,remaining:c}=ZO(i.slice(1));if(c)return!1;if(!r){if(o!==void 0){let n=e.push(`mdc_block_shorthand_open`,a,1);s?.forEach(([e,t])=>{e===`class`?n.attrJoin(e,t):n.attrSet(e,t)}),n.map=[t,t+1];let r=e.push(`inline`,``,0);r.content=o,r.children=[];let i=e.push(`mdc_block_shorthand_close`,a,-1);i.map=[t,t+1]}else{let n=e.push(`mdc_block_shorthand`,a,0);n.map=[t,t+1],s?.forEach(([e,t])=>{e===`class`?n.attrJoin(e,t):n.attrSet(e,t)})}}return e.line=t+1,!0}),e.block.ruler.before(`fence`,`comark_block`,function(e,t,n,r){let i,a,o=!1,s=e.bMarks[t]+e.tShift[t],c=e.eMarks[t],l=e.sCount[t],u=!1,d=0,f=0,p=0;if(e.src[s]!==`:`)return!1;for(i=s+1;i<=c&&e.src[i]===`:`;i++);let m=Math.floor(i-s);if(m<2)return!1;let h=e.src.slice(s,i),g=e.skipSpaces(i);if(g<c&&!nk(e.src.slice(g,c)))return!1;let _=ZO(e.src.slice(i,c));if(!_.name)return!1;if(r)return!0;let v=[],y=0,b=!1;for(a=t;a++,!(a>=n||(s=e.bMarks[a]+e.tShift[a],c=e.eMarks[a],s<c&&e.sCount[a]<e.blkIndent));){let t=s>=c?l:e.sCount[a];t<l&&(b=!0),v.push(s>=c?0:u?y:Math.min(l,t));let n=e.src.charCodeAt(s);if(u){if(n===d){let t=s+1;for(;t<c&&e.src.charCodeAt(t)===d;)t++;t-s>=f&&e.skipSpaces(t)>=c&&(u=!1)}}else{if(n===96||n===126){let t=s+1;for(;t<c&&e.src.charCodeAt(t)===n;)t++;if(t-s>=3){u=!0,d=n,f=t-s,y=v[v.length-1];continue}}if(n===58){for(i=s+1;i<=c&&e.src[i]===`:`;i++);if(i-s===m){if(i=e.skipSpaces(i),i<c)p++;else if(p>0)p--;else{o=!0;break}}}}}let x=e.parentType,S=e.lineMax;e.parentType=`comark_block`,e.lineMax=a;let C=e.push(`mdc_block_open`,_.name,1);if(C.markup=h,C.block=!0,C.info=_.name,C.map=[t,a],_.props?.forEach(([e,t])=>{e===`class`?C.attrJoin(e,t):C.attrSet(e,t)}),_.content!==void 0){let n=e.push(`paragraph_open`,`p`,1);n.map=[t,t+1];let r=e.push(`inline`,``,0);r.content=_.content,r.children=[],e.push(`paragraph_close`,`p`,-1)}if(e.env.comarkBlockTokens||=[],e.env.comarkBlockTokens.unshift(C),!b||!$O(e,t+1,a,v)){let n=e.blkIndent;e.blkIndent=l,e.md.block.tokenize(e,t+1,a),e.blkIndent=n}e.env.comarkBlockTokens.shift();let ee=e.push(`mdc_block_close`,_.name,-1);return ee.map=[t,a],ee.markup=e.src.slice(s,i),ee.block=!0,e.tokens.slice(e.tokens.indexOf(C)+1,e.tokens.indexOf(ee)).filter(e=>e.level===C.level+1).forEach((e,t,n)=>{n.length<=2&&e.tag===`p`&&(e.hidden=!0)}),e.parentType=x,e.lineMax=S,e.line=a+ +!!o,!0},{alt:[`paragraph`,`reference`,`blockquote`,`list`]}),e.block.ruler.after(`code`,`comark_block_yaml`,function(e,t,n,r){if(!e.env.comarkBlockTokens?.length)return!1;let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=e.src.slice(i,a),s=rk[o]||``;if(!s)return!1;if(o===`---`){let n=e.env.comarkBlockTokens[0].map?.[0];if(n===void 0||t!==n+1)return!1}let c=t+1,l=!1;for(;c<n;){if(e.src.slice(e.bMarks[c]+e.tShift[t],e.eMarks[c])===s){l=!0;break}c+=1}if(!l)return!1;if(!r){let n=uO(e.getLines(t+1,c,e.blkIndent,!1)),r=e.env.comarkBlockTokens[0];Object.entries(n||{}).forEach(([e,t])=>{e===`class`?r.attrJoin(e,t):typeof t==`string`?r.attrSet(e,t):r.attrSet(`:${e}`,JSON.stringify(t))})}return e.line=c+1,!0}),e.block.ruler.after(`code`,`comark_block_slots`,function(e,t,n,r){if(!e.env.comarkBlockTokens?.length)return!1;let i=e.bMarks[t]+e.tShift[t];if(e.src[i]!==`#`||e.src[i+1]===` `||e.src[i+1]===`#`)return!1;let a=e.src.slice(i,e.eMarks[t]).slice(1);if(!nk(a.trimStart()))return!1;let{name:o,props:s,remaining:c}=ZO(a);if(c)return!1;if(r)return!0;let l=t+1,u=!1,d=``,f=0;for(;l<n;){let n=e.src.slice(e.bMarks[l]+e.tShift[t],e.eMarks[l]);if(u){if(n[0]===d){let e=1;for(;e<n.length&&n[e]===d;)e++;e>=f&&n.slice(e).trim()===``&&(u=!1)}l+=1}else{if(n[0]==="`"||n[0]===`~`){let e=n[0],t=1;for(;t<n.length&&n[t]===e;)t++;if(t>=3){u=!0,d=e,f=t,l+=1;continue}}if(/^#\w+/.test(n)||n.startsWith(`::`))break;l+=1}}let p=e.lineMax,m=e.push(`mdc_block_slot_open`,`template`,1);return m.attrSet(`name`,`${o}`),s?.forEach(([e,t])=>{e===`class`?m.attrJoin(e,t):m.attrSet(e,t)}),e.line=t+1,e.lineMax=l,e.md.block.tokenize(e,t+1,l),e.push(`mdc_block_slot_close`,`template`,-1),e.line=l,e.lineMax=p,!0},{alt:[`paragraph`]})},ak=new Set([` `,` `,`
|
|
165
|
+
`,`*`,`_`,`[`,`]`,`}`,`)`,`>`]),ok=e=>{e.inline.ruler.after(`entity`,`comark_inline_component`,(e,t)=>{let n=e.pos;if(e.src[n]!==`:`)return!1;let r=e.src[n-1];if(n>0&&!ak.has(r))return!1;let i=n+1,a=-1,o=-1,s=-1;for(;i<e.src.length;){let t=e.src[i];if(t===`[`){a=i;let t=NS(e.src,i);t&&(o=i+1,s=t.endIndex-1,i=t.endIndex);break}if(!/[\w$-]/.test(t))break;i+=1}if(a===-1&&(a=i),a<=n+1)return!1;let c=e.src.slice(n+1,a);if(!nk(c))return!1;if(e.pos=i,t)return!0;if(o!==-1){e.push(`mdc_inline_component_open`,c,1);let t=e.pos,n=e.posMax;e.pos=o,e.posMax=s,e.md.inline.tokenize(e),e.pos=t,e.posMax=n,e.push(`mdc_inline_component_close`,c,-1)}else e.push(`mdc_inline_component`,c,0);return!0})},sk=e=>{e.inline.ruler.before(`link`,`comark_inline_span`,(e,t)=>{let n=e.pos;if(e.src[n]!==`[`)return!1;let r=MS(e.src,n),i=r===-1?e.src.length:r,a=e.src[i+1];if(a===`(`||a===`[`||e.linkLevel>0&&a!==`{`||t)return!1;e.push(`mdc_inline_span_open`,`span`,1);let o=e.pos,s=e.posMax;return e.pos=n+1,e.posMax=i,e.md.inline.tokenize(e),e.pos=o,e.posMax=s,e.push(`mdc_inline_span_close`,`span`,-1),e.pos=i+1,!0})},ck=e=>{e.use(ik),e.use(sk),e.use(ok)},lk=jS(()=>({name:`components`,markdownItPlugins:[ck]})),uk=e=>{e.inline.ruler.after(`entity`,`comark_inline_props`,(e,t)=>{let n=e.pos;if(e.src[n]!==`{`||e.src[n+1]===`{`||e.src[n-1]===`{`||e.src[n-1]===`$`)return!1;let r=YO(e.src,n);if(!r)return!1;let{props:i,index:a}=r;if(a===n)return!1;if(e.pos=a,t)return!0;let o=e.push(`mdc_inline_props`,`span`,0);return o.attrs=i,o.hidden=!0,!0}),e.renderer.rules.mdc_inline_props=()=>``;let t=e.parse;e.parse=function(e,n){let r=t.call(this,e,n);return r.forEach((e,t)=>{let n=r[t-1],i=r[t+1];if(!n||![`heading_open`,`paragraph_open`,`list_item_open`].includes(n.type)||n.hidden||(e.hidden&&i?.type===`inline`&&(e=i),e.type!==`inline`||!e.children?.length))return;let a=e.children[e.children.length-1];if(a.type!==`mdc_inline_props`)return;let o=e.children.length-2;for(;o>=0;){let t=e.children[o];if(t.type===`text`&&!t.content)o--;else break}let s=o>=0?e.children[o]:void 0;if(!s||s.type!==`text`)return;typeof s.content==`string`&&(s.content=s.content.replace(/[ \t]+$/,``));let c=a.attrs;e.children.length=s.content?o+1:o,c?.forEach(([e,t])=>{e===`class`?n.attrJoin(`class`,t):n.attrSet(e,t)})}),r},e.renderer.renderInline=dk(e.renderer.renderInline),`renderInlineAsync`in e.renderer&&(e.renderer.renderInlineAsync=dk(e.renderer.renderInlineAsync))};function dk(e){return function(t,n,r){return t=[...t],t.forEach((e,n)=>{if(e.type!==`mdc_inline_props`)return;let r=n-1,i=t[r];for(;r>=0&&i.type===`text`&&!i.content.trim();)r--,i=t[r];if(!i.tag&&i.type===`text`){i=new Db(`mdc_inline_span`,`span`,1),t.splice(n-1,0,i);let e=new Db(`mdc_inline_span`,`span`,-1);t.splice(n+2,0,e)}else if(i.nesting===-1){let e=n-1;for(;e>=0;){let n=t[e];if(n.nesting===1&&n.tag===i.tag&&n.level===i.level){i=n;break}e--}}if(i.nesting===-1)throw Error(`No matching opening tag found for ${JSON.stringify(i)}`);e.attrs?.forEach(([e,t])=>{e===`class`?i.attrJoin(`class`,t):i.attrSet(e,t)})}),e.call(this,t,n,r)}}var fk=uk,pk=jS(()=>({name:`attributes`,markdownItPlugins:[fk]}));function mk(e,t,n){let r=e.attrIndex(t),i=[t,n];r<0?(e.attrs||=[],e.attrs.push(i)):e.attrs[r]=i}function hk(e,t){let n=!(t?.enabled??!1);e.core.ruler.before(`inline`,`task-lists-mdc`,e=>{let t=e.tokens,n=[],r=[],i=[];for(let e=0;e<t.length;e++){let a=t[e];if(a.type===`bullet_list_open`||a.type===`ordered_list_open`)i.push(e);else if(a.type===`bullet_list_close`||a.type===`ordered_list_close`)i.pop();else if(a.type===`list_item_open`)n.push(e),r.push(i.length>0?i[i.length-1]:-1);else if(a.type===`list_item_close`)n.pop(),r.pop();else if(a.type===`inline`&&a.content&&n.length>0){let e=a.content.match(/^(\[[ x]\])\s+/i);if(e){let i=e[1].toLowerCase()===`[x]`;mk(t[n[n.length-1]],`class`,`task-list-item`);let o=r[r.length-1];o>=0&&mk(t[o],`class`,`contains-task-list`);let s=`TASK_CHECKBOX_${i?`CHECKED`:`UNCHECKED`} `;a.content=a.content.replace(/^\[[ x]\]\s+/i,s)}}}}),e.core.ruler.after(`inline`,`task-lists-mdc-post`,e=>{let t=e.tokens;for(let r=0;r<t.length;r++){let i=t[r];if(i.type===`inline`&&i.children)for(let t=0;t<i.children.length;t++){let r=i.children[t];if(r.type===`text`&&r.content){let a=r.content.match(/^TASK_CHECKBOX_CHECKED/),o=r.content.match(/^TASK_CHECKBOX_UNCHECKED/);if(a||o){let o=!!a,s=new e.Token(`mdc_inline_component`,`input`,0);s.attrs=[[`class`,`task-list-item-checkbox`],[`type`,`checkbox`]],n&&s.attrs.push([`:disabled`,`true`]),o&&s.attrs.push([`:checked`,`true`]),r.content=r.content.replace(/^TASK_CHECKBOX_(CHECKED|UNCHECKED)/,``),i.children.splice(t,0,s),t++}}}}})}var gk=jS(()=>({name:`task-list`,markdownItPlugins:[hk]})),_k={"!TIP":{type:`tip`,title:`Tip`,color:`#238636`},"!NOTE":{type:`note`,title:`Note`,color:`#1f6feb`},"!IMPORTANT":{type:`important`,title:`Important`,color:`#8957e5`},"!WARNING":{type:`warning`,title:`Warning`,color:`#9e6a03`},"!CAUTION":{type:`caution`,title:`Caution`,color:`#da3633`}},vk=jS(()=>({name:`alert`,post(e){PO(e.tree,e=>Array.isArray(e)&&e[0]===`blockquote`,e=>{let t=e;if(e[2]?.[0]===`span`){let n=_k[String(e[2][2]).toUpperCase()];n&&(typeof e[3]==`string`&&(t[3]=String(t[3]).trimStart()),t.splice(2,1),t[1].as=n.type)}else if(e[2]?.[0]===`p`){let n=e[2];if(n[2]?.[0]===`span`){let e=_k[String(n[2][2]).toUpperCase()];e&&(typeof n[3]==`string`&&(n[3]=String(n[3]).trimStart()),n.splice(2,1),t[1].as=e.type)}}})}})),yk=jS((e={})=>({name:`html`,markdownItPlugins:[e.markdown===!1?bk:xk],markdownItPost:Sk}));function bk(e){e.set({html:!0})}function xk(e){bk(e);let t=e.block.ruler.__rules__.find(e=>e.name===`html_block`),n=t.fn;t.fn=(e,t,r,i)=>{let a=e.bMarks[t]+e.tShift[t];if(Ok(e.src,a)||!i&&e.src.startsWith(`<!--`,a))return n(e,t,r,i)}}function Sk(e){let t=0;for(;t<e.tokens.length;){let n=e.tokens[t];if(n.type!==`html_block`){t+=1;continue}let r=Nk(n.content||``),i=new Db(`paragraph_open`,`p`,1),a=new Db(`inline`,``,0),o=new Db(`paragraph_close`,`p`,-1);a.children=r,a.content=n.content||``,n.map&&(i.map=n.map,a.map=n.map),e.tokens.splice(t,1,i,a,o),t+=3}}var Ck=RegExp(`^(?:<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`);function wk(e){return e>=65&&e<=90||e>=97&&e<=122}var Tk=new Set([`style`,`pre`,`script`,`textarea`]);function Ek(e,t){if(e.charCodeAt(t)!==60)return null;let n=t+1,r=e.charCodeAt(n)===47;r&&(n+=1);let i=n;for(;n<e.length&&wk(e.charCodeAt(n));)n+=1;return n===i?null:{name:e.slice(i,n).toLowerCase(),close:r,after:n}}function Dk(e,t){if(t>=e.length)return!0;let n=e.charCodeAt(t);return n===62||n===47||n<=32}function Ok(e,t){let n=Ek(e,t);return!!n&&!n.close&&Tk.has(n.name)&&Dk(e,n.after)}function kk(e){if(!/[\r\n]/.test(e))return e;let t=0,n=e.length;if(/^\s*[\r\n]/.test(e)){let n=e.search(/\S/);if(n<0)return``;t=n}let r=/[ \t]*(?:\r\n|\n|\r)[ \t]*$/.exec(e);return r&&r.index>=t&&(n=r.index),t>=n?``:e.slice(t,n)}function Ak(e,t,n=!1){let r=n?t:kk(t);if(!r)return;let i=new Db(`text`,``,0);i.content=r,e.push(i)}function jk(e,t){let n=new Db(`html_inline`,``,0);n.content=t,e.push(n)}function Mk(e,t,n){let r=Ek(e,t);if(!r?.close||r.name!==n)return-1;let i=r.after;for(;i<e.length&&e.charCodeAt(i)<=32;)i+=1;return e.charCodeAt(i)===62?i+1:-1}function Nk(e){let t=[],n=e.length,r=0,i=0;for(;r<n;){if(e.charCodeAt(r)===60&&r+1<n){let a=e.charCodeAt(r+1);if(a===33||a===63||a===47||wk(a)){let a=e.slice(r).match(Ck);if(a){r>i&&Ak(t,e.slice(i,r));let o=Ek(a[0],0);if(o&&!o.close&&Tk.has(o.name)&&a[0].charCodeAt(a[0].length-2)!==47){jk(t,a[0]);let s=r+a[0].length,c=-1;for(let i=s;i<n;i+=1)if(e.charCodeAt(i)===60&&(c=Mk(e,i,o.name),!(c<0))){Ak(t,e.slice(s,i),!0),jk(t,e.slice(i,c)),r=c;break}if(c<0)return Ak(t,e.slice(s),!0),t;i=r;continue}jk(t,a[0]),r+=a[0].length,i=r;continue}}}r++}return i<n&&Ak(t,e.slice(i)),t}var Pk=`---`,Fk=`\r`;function Ik(e){let t={},n=``;if(e.startsWith(Pk)){let r=e.indexOf(`
|
|
166
|
+
---`);if(r!==-1){let i=e[r-1]===Fk;n=e.slice(4,r-+!!i),n&&(t=uO(n)??{},e=e.slice(r+4+ +!!i))}}return{content:e,data:t,frontmatterText:n}}function Lk(e,t,n){if(!e||Object.keys(e).length===0)return t?.trim()||``;let r=dO(e,n).trim();return t?`---
|
|
167
167
|
`+r+`
|
|
168
168
|
---
|
|
169
169
|
|
|
170
|
-
`+t.trim():r}var
|
|
171
|
-
`).length+1)}}));function
|
|
170
|
+
`+t.trim():r}var Rk=jS(()=>({name:`frontmatter`,pre(e){let{content:t,data:n,frontmatterText:r}=Ik(e.markdown);e.markdown=t,e.frontmatter=n,e.frontmatterText=r,t&&r&&(e.parsedLines=(e.parsedLines??0)+r.split(`
|
|
171
|
+
`).length+1)}}));function zk(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n!==32&&n!==10&&n!==9&&n!==13&&n!==12)return!1}return!0}function Bk(e){return Vk(e,0)}function Vk(e,t){if(t>=50||typeof e==`string`||e[0]===`p`||e[0]==null)return e;let n=e.length;if(n<3)return e;let r,i=0;for(let t=2;t<n;t++){let n=e[t];if(!(typeof n==`string`&&zk(n))&&(r=n,++i>1))break}if(i===0)return e;if(i===1&&Array.isArray(r)&&r[0]===`p`){let t=r[1],n=e[1];if(t){for(let r in t)if(r!==void 0){n={...t,...e[1]};break}}let i=r.slice();return i[0]=e[0],i[1]=n,i}let a;for(let r=2;r<n;r++){let n=e[r],i=Vk(n,t+1);a===void 0?i!==n&&(a=e.slice(0,r),a.push(i)):a.push(i)}return a===void 0?e:a}function Hk(e,t){let n=-1,r=t.nodes.length-1,i=!1;for(;r>=0;){let e=t.nodes[r];if(e[1]&&e[1].$?.line){if(i){n=r;break}i=!0}r--}let a=n===-1?null:t.nodes[n];if(a){let r=a[1].$?.line??0;return{remainingMarkdownStartLine:r,reusedNodes:t.nodes.slice(0,n+1),remainingMarkdown:e.split(`
|
|
172
172
|
`).slice(r).join(`
|
|
173
|
-
`)||``}}return{remainingMarkdownStartLine:0,remainingMarkdown:e,reusedNodes:[]}}function
|
|
173
|
+
`)||``}}return{remainingMarkdownStartLine:0,remainingMarkdown:e,reusedNodes:[]}}function Uk(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=97&&n<=122)return e}return e.toLowerCase()}function Wk(e){let t=e.trim();if(t.startsWith(`<!--`)&&t.endsWith(`-->`))return{kind:`comment`,content:t.slice(4,-3)};let n=t.match(/^<\/\s*([A-Za-z][\w:-]*)\s*>$/);if(n)return{kind:`close`,tag:Uk(n[1])};let r=t.match(/^<\s*([A-Za-z][\w:-]*)((?:\s+[\s\S]*?)?)\s*(\/?)>$/);if(r){let e=Uk(r[1]),t=r[2]||``,n=r[3]===`/`||RO(e);return{kind:`open`,tag:e,attrs:Gk(t),selfClosing:n}}return{kind:`other`,content:t}}function Gk(e){let t={};if(!e||!e.trim())return t;let n=/([:\w.-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g,r;for(;(r=n.exec(e))!==null;){let e=r[1].toLowerCase(),n=r[2]??r[3]??r[4];t[e]=n===void 0||aC(n)}return t}function Kk(e){return e?e===!0?[`p`]:typeof e==`string`?e.split(/[,\s]/).map(e=>e.trim()).filter(Boolean):e.filter(Boolean):[]}function qk(e){return Array.isArray(e)&&typeof e[0]==`string`}function Jk(e,t){return qk(e)&&(t===`*`||e[0]===t)}function Yk(e,t){if(t.length===0)return e;let[n,...r]=t,i=[];for(let t of e){let e=Jk(t,n)?t.slice(2):[t];for(let t of Yk(e,r))i.push(t)}return i.filter(e=>typeof e!=`string`||e.trim()!==``)}function Xk(e,t){if(t.length===0)return e;let n=Yk(e,t),r=[];for(let e of n)typeof e==`string`&&typeof r[r.length-1]==`string`?r[r.length-1]=r[r.length-1]+e:r.push(e);return r}var Zk={end:()=>{}},Qk={startSpan:()=>Zk,startActiveSpan:(e,t,n)=>(typeof t==`function`?t:n)(Zk)};function $k(e,t,n,r){return e.startActiveSpan(t,r??{},e=>{try{let t=n();return t instanceof Promise?t.finally(()=>e.end()):(e.end(),t)}catch(t){throw e.end(),t}})}var eA=1e3;function tA(e){if(!e)return{};let t={},n=e.trim(),r=n.match(/^([^\s[{}"'<>`]+)/);for(r&&(t.language=r[1],n=n.slice(r[1].length).trim());n&&(n.startsWith(`{`)||n.startsWith(`[`));)if(n.startsWith(`{`)){let e=n.match(/^\{([^}]+)\}/);if(e){let r=e[1];n=n.slice(e[0].length).trim();let i=[],a=r.split(`,`);for(let e of a){let t=e.trim();if(t.includes(`-`)){let[e,n]=t.split(`-`).map(e=>Number.parseInt(e.trim(),10));if(!Number.isNaN(e)&&!Number.isNaN(n)&&n-e<=eA)for(let t=e;t<=n&&i.length<eA;t++)i.push(t)}else{let e=Number.parseInt(t,10);!Number.isNaN(e)&&i.length<eA&&i.push(e)}}i.length>0&&(t.highlights=i)}else break}else if(n.startsWith(`[`)){let e=0,r=0;for(;r<n.length;r++)if(n[r]===`[`)e++;else if(n[r]===`]`&&(e--,e===0)){t.filename=n.slice(1,r).replace(/\\\\/g,``),n=n.slice(r+1).trim();break}if(e!==0)break}return n&&(t.meta=n),t}function nA(e,t={}){let{handleJSON:n=!0,filterEmpty:r=!1}=t,i={};if(!e||!Array.isArray(e))return i;for(let t of e)if(Array.isArray(t)&&t.length>=2){let[e]=t,a=t[1];if(r&&(a===``||a==null))continue;if(n&&typeof a==`string`){if(a.startsWith(`{`)&&a.endsWith(`}`))try{a=JSON.parse(a)}catch{}else if(a.startsWith(`[`)&&a.endsWith(`]`))try{a=JSON.parse(a)}catch{}}i[e]=e===`class`&&typeof i[e]==`string`?`${i[e]} ${a}`:a}return i}function rA(e,t,n=!0){let r=t;if(n)for(;r<e.length&&e[r].type===`text`&&!e[r].content?.trim();)r++;if(r<e.length&&e[r].type===`mdc_inline_props`){let t=e[r];return{attrs:nA(t.attrs),nextIndex:r+1}}return{attrs:{},nextIndex:t}}function iA(e){let t=[];for(let n of e){let e=t[t.length-1];typeof n==`string`&&typeof e==`string`?t[t.length-1]=e+n:t.push(n)}return t}function aA(e=!0){if(e!==!1)return{nested:e===`nested`,slugCounts:new Map,usedIds:new Set,stack:[]}}function oA(e){let t=e.normalize(`NFC`).toLowerCase().trim().replace(/\s+/g,`-`).replace(/[^\p{L}\p{M}\p{Nd}\p{Nl}_-]+/gu,``).replace(/-{2,}/g,`-`).replace(/^(?:\p{M}+|-+)+|-+$/gu,``);return t.charCodeAt(0)>=48&&t.charCodeAt(0)<=57&&(t=`_`+t),t}function sA(e,t){typeof t==`string`&&t&&e.usedIds.add(t)}function cA(e,t,n){let r=oA(e),{stack:i,slugCounts:a,usedIds:o}=n;if(n.nested){for(;i.length>0&&i[i.length-1].level>=t;)i.pop();if(i.length>0){let e=i[i.length-1];e.level>=2&&e.id&&r&&(r=e.id+`-`+r)}i.push({level:t,id:r})}if(!r)return;let s=a.get(r)??0,c=s===0?r:`${r}-${s}`;for(;o.has(c);)s++,c=`${r}-${s}`;return a.set(r,s+1),o.add(c),c}var lA=new Set([`strong`,`em`,`del`,`code`,`a`,`span`,`sub`,`sup`,`kbd`]),uA=new Set([`ul`,`ol`,`table`,`blockquote`,`pre`]);function dA(e,t){return{$:t?{html:1,block:1}:{html:1,block:0},...e}}function fA(e,t){t[0]===`fragment`?e.push(...t.slice(2)):e.push(t)}function pA(e){if(typeof e==`string`)return!0;if(!Array.isArray(e))return!1;let t=e[0];return t===null||lA.has(t)}function mA(e){if(e.pendingInline.length===0)return;let t=e.pendingInline;e.pendingInline=[],e.children.push([`p`,{},...t])}function hA(e){let t=``;for(let n of e)typeof n==`string`?t+=n:Array.isArray(n)&&(t+=hA(n.slice(2)));return t}function gA(e){if(mA(e),e.tag===null){let t=e.children.map(e=>typeof e==`string`?e:hA(Array.isArray(e)&&e[0]===`p`?e.slice(2):[e]));return[null,{},t.length>0?`\n\n${t.join(`
|
|
174
174
|
|
|
175
|
-
`)}\n\n`:``]}return[e.tag,
|
|
176
|
-
`)?i.slice(0,-1):i;return{nextIndex:t+1,node:[`pre`,o,[`code`,s,c]]}}function
|
|
177
|
-
`}),code_block:OA,fenced_code_block:OA,fence:OA,mdc_block_shorthand:kA(e=>[e.tag,rA(e.attrs)]),heading_open(e,t,n){let{nextIndex:r,node:i}=jA(`heading_close`)(e,t,n);if(i.length===2)return{node:void 0,nextIndex:r};if(n.headingIds){let r=Number.parseInt((e[t].tag||`h1`).replace(`h`,``),10)||1,a=lA(NO(i),r,n.headingIds);cA(n.headingIds,i[1].id),a&&(i[1]={id:a,...i[1]})}return{nextIndex:r,node:i}},paragraph_open(e,t,n){let r=e[t+1],i=n.htmlStack.length,a=n.insideMarkdownContainer===0,{children:o,nextIndex:s}=wA(e,t,`paragraph_close`,n,a),c=()=>o.length===0?{nextIndex:s,node:void 0}:{nextIndex:s,node:[`p`,rA(e[t].attrs),...aA(o)]},l=e=>{if(o.length===0)return{nextIndex:s,node:void 0};let t=o.length===1?o[0]:[`fragment`,{},...o];return{nextIndex:s,node:t,siblingOfHtmlStack:e||void 0}};if(i>0&&n.htmlStack.length===0)return o.length===1&&Array.isArray(o[0])?{nextIndex:s,node:o[0]}:c();if(n.htmlStack.length>0){if(a){for(let e of n.htmlStack)hA(e);return l(o.length>0)}return c()}let u=c();if(u.node===void 0)return u;let d=TA(e,{nextIndex:s,node:u.node}),f=d.node;if(Array.isArray(f)&&f.length===3&&Array.isArray(f[2])&&r?.type===`inline`&&r.children?.[0]?.type===`html_inline`&&(!uA.has(f[2]?.[0])||u.node[2][1]?.$?.block)){let e=f[2];return e[1].$&&(e[1].$.block=1),{nextIndex:d.nextIndex,node:e}}return d.node.every((e,t)=>t<2||e?.[1]?.$?.html)&&(d.node[0]=`fragment`),d},mdc_inline_component(e,t){let n=e[t],r=rA(n.attrs),{attrs:i,nextIndex:a}=iA(e,t+1,!1);return{node:[n.tag,{...r,...i}],nextIndex:a}},image(e,t){let n=e[t],r=rA(n.attrs,{handleJSON:!1,filterEmpty:!0});return n.content&&(r.alt=n.content),TA(e,{node:[`img`,r],nextIndex:t+1})},text(e,t,n){let r=e[t].content;if(r===``)return{nextIndex:t+1,node:void 0};let i=bA(r,n);return i?{nextIndex:t+1,node:i.node}:{nextIndex:t+1,node:r}},html_inline(e,t,n){let r=e[t].content||``,i=Gk(r);if(i.kind===`comment`)return{nextIndex:t+1,node:[null,{},i.content]};if(i.kind===`other`){let e=bA(r,n);return e?{nextIndex:t+1,node:e.node}:{nextIndex:t+1,node:[null,{},r]}}if(i.kind===`close`){let e=i.tag.toLowerCase(),r=n.htmlStack.length-1;for(;r>=0;){let t=n.htmlStack[r].tag;if(t!==null&&t.toLowerCase()===e)break;r--}if(r<0)return{nextIndex:t+1,node:void 0};let a;for(;n.htmlStack.length>r;){let e=_A(n.htmlStack.pop());n.htmlStack.length>r?yA(n,e):a=e}return{nextIndex:t+1,node:a}}return i.selfClosing?{nextIndex:t+1,node:[i.tag,fA(i.attrs,!1)]}:(n.htmlStack.push({tag:i.tag,attrs:i.attrs,children:[],block:!1,pendingInline:[]}),{nextIndex:t+1,node:void 0})}};function NA(e,t={}){let n={preservePositions:t.preservePositions??!1,headingIds:oA(t.headingIds??!0),startLine:t.startLine??0,htmlStack:[],insideMarkdownContainer:0},r=[],i=0;for(;i<e.length;){let t=e[i];if(t.type===`inline`){let e=SA(t.children??[],n);if(n.htmlStack.length>0)for(let t of e)n.htmlStack[n.htmlStack.length-1].children.push(t);else r.push(...e);i+=1;continue}let a=xA(e,i,n);if(a){for(let e of n.htmlStack)e.block=!0;if(a.node!==void 0){if(n.preservePositions&&CA(e,a.node,i,a.nextIndex,n),a.siblingOfHtmlStack)pA(r,a.node);else{let e=vA(n,a.node);e!==void 0&&pA(r,e)}}i=a.nextIndex}else r.push([t.tag||`component`,rA(t.attrs,{handleJSON:!1})]),i+=1}for(;n.htmlStack.length>0;){let e=n.htmlStack.pop();e.block=!0;let t=_A(e);n.htmlStack.length>0?n.htmlStack[n.htmlStack.length-1].children.push(t):r.push(t)}return r}var PA=32,FA=0,IA=new WeakMap,LA=new Map;function RA(e={}){let{autoUnwrap:t=!0,autoClose:n=!0,tracer:r=$k}=e,i=qk(e.unwrap),a=e.plugins??[];e.html!==void 0&&console.warn("[comark] `ParserOptions.html` is deprecated and will be removed in a future major version. Use `registerDefaultPlugins: false` and register `html()` from `comark/plugins/html` only when needed.");let o=jS(e.registerDefaultPlugins===!1?[]:[zk(),...e.html===!1?[]:[bk()],yk(),_k(),uk(),mk()],a),s=e=>o.some(t=>t.name===e),c=[];for(let e of o)for(let t of e.markdownItPlugins||[])c.push(t);let l=e.linkify??!0,u=[l,...c.map(e=>IA.get(e)??(IA.set(e,FA),FA++))].join(`,`),d=LA.get(u);if(d)LA.delete(u),LA.set(u,d);else{d=new AS({linkify:l}).enable([`table`,`strikethrough`]);for(let e of c)d.use(e);if(LA.size>=PA){let e=LA.keys().next().value;e!==void 0&&LA.delete(e)}LA.set(u,d)}let f=null,p=null;return async(a,c={})=>await eA(r,`comark:parse`,async()=>{let l={options:e,tokens:[],markdown:a,tree:null,parsedLines:0,reusableNodes:[],frontmatterText:``,frontmatter:{}},u=f,m=a.startsWith(p??``);if(c.streaming&&u&&m&&!a.includes(`]:`)){let{remainingMarkdownStartLine:e,reusedNodes:t,remainingMarkdown:n}=Uk(a,u);if(!n)return u;/#|(?:^|\n)[^\n]*[=-][ \t]*\r?(?:\n|$)/.test(n)||(l.parsedLines=e,l.markdown=n,l.reusableNodes=t)}typeof n==`function`?l.markdown=eA(r,`comark:autoclose`,()=>n(l.markdown)):n&&(l.markdown=eA(r,`comark:autoclose`,()=>g_(l.markdown,{frontmatter:s(`frontmatter`)&&c.streaming,syntax:s(`components`),attributes:s(`components`)||s(`attributes`),math:s(`math`),dropTrailingOpeners:c.streaming===!0})));for(let e of o)e.pre&&await eA(r,`comark:pre:${e.name}`,()=>e.pre(l));try{l.tokens=eA(r,`comark:tokenize`,()=>d.parse(l.markdown,{}))}catch(e){if(c.streaming&&u)return u;throw e}for(let e of o)e.markdownItPost&&eA(r,`comark:markdownItPost:${e.name}`,()=>e.markdownItPost(l));let h=r.startSpan(`comark:nodes`),g=NA(l.tokens,{startLine:l.parsedLines,preservePositions:c.streaming??!1,headingIds:e.headingIds??!0});t&&(g=g.map(e=>Vk(e))),i.length>0&&(g=Zk(g,i)),h.end();let _=l.frontmatter??{},v=l.frontmatterText??``;c.streaming?(l.tree={frontmatter:v||!m?_:u?.frontmatter??_,meta:{},nodes:[...l.reusableNodes,...g]},f=l.tree,p=a):(l.tree={frontmatter:_,meta:{},nodes:g},f=null,p=null);for(let e of o)e.post&&await eA(r,`comark:post:${e.name}`,()=>e.post(l));return l.tree})}async function zA(e,t={}){return await RA(t)(e)}var BA=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],VA=[12288,12288,65281,65376,65504,65510],HA=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],UA=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],WA=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101594,101631,101664,101760,101874,101888,102801,102816,102866,110576,110579,110581,110587,110589,110590,110592,110888,110898,110898,110928,110930,110933,110933,110948,110952,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127406,127406,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128729,128732,128735,128747,128748,128756,128764,128986,128986,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129734,129736,129736,129740,129757,129759,129771,129775,129786,131072,196605,196608,262141],GA=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},KA=19968,[qA,JA]=YA(WA);function YA(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(KA>=i&&KA<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var XA=e=>e<161||e>1114109?!1:GA(BA,e),ZA=e=>e<12288||e>65510?!1:GA(VA,e),QA=e=>e<8361||e>65518?!1:GA(HA,e),$A=e=>e<32||e>10630?!1:GA(UA,e),ej=e=>e>=qA&&e<=JA?!0:e<4352||e>262141?!1:GA(WA,e);function tj(e){return XA(e)?`ambiguous`:ZA(e)?`fullwidth`:QA(e)?`halfwidth`:$A(e)?`narrow`:ej(e)?`wide`:`neutral`}function nj(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function rj(e){return nj(e),tj(e)}function ij(e){return/^\p{Emoji_Presentation}/u.test(String.fromCodePoint(e))}function aj(e){if(e<4352)return!1;switch(rj(e)){case`fullwidth`:case`halfwidth`:return!0;case`wide`:return!ij(e);case`narrow`:return!1;case`ambiguous`:return null;case`neutral`:return/^\p{sc=Hangul}/u.test(String.fromCodePoint(e))}}function oj(e,t){return aj(e)??(t===65025&&n(e));function n(e){return e===8216||e===8217||e===8220||e===8221}}function sj(e){return aj(e)??(917760<=e&&e<=917999)}function cj(e){return aj(e)??!1}function lj(e){return e>=65024&&e<=65038}function uj(e){let t=e.inline.State;class n extends t{scanDelims(t,n){let r=this.posMax,i=this.src.charCodeAt(t),[a,o]=v(this.src,t),s=a,c=null;lj(a)&&(c=v(this.src,o)[0],/^\p{Zs}/u.test(String.fromCodePoint(c))||(s=c));let l=t;for(;l<r&&this.src.charCodeAt(l)===i;)l++;let u=l-t,d=l<r?this.src.codePointAt(l):32,f=e.utils.isWhiteSpace(s),p=e.utils.isWhiteSpace(d);if(f||p)return{can_open:!p,can_close:!f,length:u};let m=e.utils.isMdAsciiPunct(s)||e.utils.isPunctChar(String.fromCodePoint(s)),h=e.utils.isMdAsciiPunct(d)||e.utils.isPunctChar(String.fromCodePoint(d)),g=m,_=h;if(n){let e=cj(d)||(c===null?sj(a):oj(c,a));g||=e||!h,_||=e||!m}return{can_open:g,can_close:_,length:u};function v(e,t){if(t<=0)return[32,-1];let n=e.charCodeAt(t-1);if((n&64512)!=56320)return[n,t-1];let r=e.codePointAt(t-2);return r>65535?[r,t-2]:[n,t-1]}}}e.inline.State=n}var dj=MS(()=>({name:`comark-cjk`,markdownItPlugins:[uj]})),fj=`mdc_inline_span`;function pj(e,t,n,r,i,a){for(let o of n)try{e[t](o,r,i,a);return}catch{}e.push(r,i,a)}function mj(e){let t=new Map;return n=>{let r=JSON.stringify(n)??``,i=t.get(r);return i||t.set(r,i=e(n)),i}}var hj=[[`background`,`ui-bg`,`background`,`#fff`,`#0a0a0a`],[`foreground`,`ui-text-highlighted`,`foreground`,`#0a0a0a`,`#fafafa`],[`muted`,`ui-text-muted`,`muted-foreground`,`#737373`,`#a1a1a1`],[`border`,`ui-border`,`border`,`#e5e5e5`,`rgb(255 255 255/.1)`],[`accent`,`ui-bg-elevated`,`accent`,`#f5f5f5`,`#262626`],[`ring`,`ui-primary`,`ring`,`#a1a1a1`,`#737373`]],gj={status:Object.values({success:[`success`,`ui-success`,`success`,`#259f56`,`#59d38c`],danger:[`danger`,`ui-error`,`destructive`,`#ee3533`,`#fd736d`],warning:[`warning`,`ui-warning`,``,`#d97706`,`#fbbf24`],info:[`info`,`ui-info`,``,`#2563eb`,`#60a5fa`]}),primary:[[`primary`,`ui-primary`,`primary`,`var(--_comark-foreground)`,`var(--_comark-foreground)`],[`primary-foreground`,`ui-text-inverted`,`primary-foreground`,`var(--_comark-background)`,`var(--_comark-background)`],[`secondary`,`ui-secondary`,``,`var(--_comark-muted)`,`var(--_comark-muted)`]],shadow:[[`shadow`,``,``,`0 4px 12px rgb(0 0 0/.12)`,`0 4px 12px rgb(0 0 0/.5)`]]},_j=(e,t)=>{let n=e[2]?`var(--${e[2]},${e[t]})`:e[t],r=e[1]?`var(--${e[1]},${n})`:n;return`var(--comark-${e[0]},${r})`},vj=(e,t)=>e.map(e=>`--_comark-${e[0]}:${_j(e,t)}`).join(`;`);function yj(e,...t){let n=`:where(${e})`,r=t.flatMap(e=>gj[e]),i=[...hj,...r],a=r.filter(e=>e[3]!==e[4]),o=a.length?`:where(.light,.light *)${n}{${vj(a,3)}}:where(.dark,.dark *)${n}{${vj(a,4)}}`:``;return`${n}{${vj(i,3)};--_comark-radius:var(--comark-radius,calc(var(--ui-radius,calc(var(--radius,.625rem)/2))*2));--_comark-font:var(--comark-font,var(--font-sans,ui-sans-serif,system-ui,sans-serif))}@media (prefers-color-scheme:dark){${n}{${vj(i,4)}}}`+o}var bj=`.ccm-ins,.ccm-del,.ccm-mark`;`${[yj(`${bj},.ccm-comment`,`status`),`:where(${bj}){--_ccm-ins:var(--ccm-ins,var(--_comark-success));--_ccm-del:var(--ccm-del,var(--_comark-danger));--_ccm-mark:var(--ccm-mark,#f5b400)}`,`@media (prefers-color-scheme:dark){:where(${bj}){--_ccm-mark:var(--ccm-mark,#f5c84b)}}`,`${bj},.ccm-comment{border-radius:calc(var(--_comark-radius) - 6px);-webkit-box-decoration-break:clone;box-decoration-break:clone}`,`${bj}{padding:0 .125em;color:inherit}`,`.ccm-ins{background:color-mix(in srgb,var(--_ccm-ins) 14%,transparent);box-shadow:inset 0 -1.5px color-mix(in srgb,var(--_ccm-ins) 60%,transparent);text-decoration:none}`,`.ccm-del{background:color-mix(in srgb,var(--_ccm-del) 10%,transparent);color:color-mix(in oklab,var(--_ccm-del) 60%,var(--_comark-foreground));text-decoration:line-through;text-decoration-color:color-mix(in srgb,var(--_ccm-del) 70%,transparent)}`,`.ccm-mark{background:color-mix(in srgb,var(--_ccm-mark) 30%,transparent)}`,`.ccm-comment{margin:0 .125em;padding:.0625em .375em;background:var(--_comark-accent);box-shadow:inset 0 0 0 1px var(--_comark-border);color:var(--_comark-muted);font-size:.8125em;font-style:normal}`].join(``)}`;var xj=`ccm-comment`,Sj={ins:`ccm-ins`,del:`ccm-del`,mark:`ccm-mark`},Cj=new Map([[`{++`,{kind:`ins`,close:`++}`}],[`{--`,{kind:`del`,close:`--}`}],[`{~~`,{kind:`sub`,close:`~~}`}],[`{==`,{kind:`mark`,close:`==}`}],[`{>>`,{kind:`comment`,close:`<<}`}]]),wj=new Set([`view`,`accept`,`reject`]),Tj=`critic_problem`;function Ej(e,t,n,r=``,i=``){let a=e.posMax;if(r){let t=e.push(`${fj}_open`,r,1);i&&(t.attrs=[[`class`,i]])}e.pos=t,e.posMax=n,e.md.inline.tokenize(e),e.posMax=a,r&&(e.push(`${fj}_close`,r,-1).meta={critic:i})}function Dj(e,t,{rule:n,message:r}){let i=e.push(Tj,``,0);return i.content=r,i.meta={rule:n},e.pending+=t,e.pos+=t.length,!0}function Oj(e,t,n,r){for(let i=t;i<=n-r.length;i++)if(e.charCodeAt(i)===92)i++;else{if(e.charCodeAt(i)===96){let t=i+1;for(;e.charCodeAt(t)===96;)t++;let r=e.slice(i,t),a=e.indexOf(r,t);if(a>=0&&a<n){i=a+r.length-1;continue}}if(e[i]===`<`&&!e.startsWith(r,i)){let t=``,r=-1;for(let a=i+1;a<n;a++){let n=e[a];if(t)n===`\\`?a++:n===t&&(t=``);else if(n===`"`||n===`'`)t=n;else if(n===`>`){r=a;break}}if(r>=0){i=r;continue}}if(e[i]===`[`){let t=-1,r=1;for(let a=i+1;a<n;a++)if(e[a]===`\\`)a++;else if(e[a]===`[`)r++;else if(e[a]===`]`&&--r===0){t=a;break}if(t>=0&&t+1<n&&e[t+1]===`(`){let r=1,a=t+2;for(;a<n&&r;a++)e[a]===`\\`?a++:e[a]===`(`?r++:e[a]===`)`&&r--;if(!r){i=a-1;continue}}}if(e[i]===`*`||e[i]===`_`){let t=e[i],r=i+1;for(;e[r]===t;)r++;let a=e.indexOf(e.slice(i,r),r);if(a>=0&&a<n){i=a+(r-i)-1;continue}}if(e.startsWith(r,i))return i}return-1}var kj=e=>(t,n)=>{let r=t.pos;if(t.src.charCodeAt(r)!==123)return!1;let i=t.src.slice(r,r+3),a=Cj.get(i);if(!a)return!1;let o=r+3,s=Oj(t.src,o,t.posMax,a.close);if(s<0||s+3>t.posMax)return!n&&Dj(t,i,{rule:`comark/critic/unclosed-mark`,message:`critic \`${i}\` has no closing \`${a.close}\` in its paragraph; close it there, or write \`\\${i}\` to keep the text.`});let c=a.kind===`sub`?Oj(t.src,o,s,`~>`):-1;if(a.kind===`sub`&&(c<0||c>s))return!n&&Dj(t,i,{rule:`comark/critic/missing-arrow`,message:`critic \`{~~${t.src.slice(o,s)}~~}\` has no \`~>\` between the old and the new text; write \`{~~old~>new~~}\`.`});if(n)return t.pos=s+3,!0;let l=e===`view`;return a.kind===`sub`?(e!==`accept`&&Ej(t,o,c,l?`del`:``,Sj.del),e!==`reject`&&Ej(t,c+2,s,l?`ins`:``,Sj.ins)):a.kind===`comment`?l&&Ej(t,o,s,`span`,xj):a.kind===`mark`?Ej(t,o,s,l?`mark`:``,Sj.mark):l?Ej(t,o,s,a.kind,Sj[a.kind]):a.kind===`ins`==(e===`accept`)&&Ej(t,o,s),t.pos=s+3,!0},Aj=mj(e=>t=>{pj(t.inline.ruler,`before`,[`comark_inline_props`,`entity`],`critic`,kj(e))}),jj=new WeakMap;function Mj(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(r){if(r.children&&Mj(r.children,t),r.type===`mdc_inline_props`&&r.attrGet(`class`)){let t=n-1;for(;e[t]?.type===`text`&&!e[t].content.trim();)t--;let i=e[t]?.meta?.critic;i&&r.attrSet(`class`,`${i} ${r.attrGet(`class`)}`)}r.type===Tj&&(t.unshift({rule:r.meta.rule,message:r.content}),e.splice(n,1))}}}var Nj=MS(e=>{let t=e?.mode??`view`,n=wj.has(t)?t:`view`;return{name:`comark-critic`,markdownItPlugins:[Aj(n)],markdownItPost(e){let t=[];Mj(e.tokens,t),jj.set(e,t)},post(e){let r=jj.get(e)??[];if(n!==t&&r.unshift({rule:`comark/critic/invalid-mode`,message:`critic: \`mode\` must be "view", "accept", or "reject", not "${String(t)}"; until then it shows the changes.`}),!r.length)return;let{meta:i}=e.tree;i.issues=[...i.issues??[],...r.map(e=>e.message)],i.issueRules={...i.issueRules,...Object.fromEntries(r.map(e=>[e.message,e.rule]))}}}}),Pj=`blockquote`;function Fj(e,t,n,r,i,a){for(let o of n)try{e[t](o,r,i,a);return}catch{}e.push(r,i,a)}var Ij=new WeakMap;function Lj(e,t){let n=(e.bMarks[t]??0)+(e.tShift[t]??0),r=e.eMarks[t]??0;if(n>=r||(e.sCount[t]??0)-e.blkIndent>=4)return-1;let i=e.src.charCodeAt(n++);if(i!==126&&i!==58)return-1;let a=e.skipSpaces(n);return n===a&&a<r?-1:n}var Rj=(e,t,n)=>{let r=e.push(`${Pj}_open`,t,1);return r.map=n,r},zj=(e,t)=>e.push(`${Pj}_close`,t,-1);function Bj(e,t){let n=e.level+2,{tokens:r}=e;for(let e=r.length-3;e>t;e--){let t=r[e];t?.level===n&&t.type===`paragraph_open`&&(r.splice(e+2,1),r.splice(e,1))}}function Vj(e,t,n,r){if(r)return(Ij.get(e)??-1)<0?!1:Lj(e,t)>=0;let i=t+1;if(i>=n)return!1;let a=!1;if(e.isEmpty(i)&&(a=!0,++i>=n)||(e.sCount[i]??0)<e.blkIndent)return!1;let o=Lj(e,i);if(o<0)return!1;let s=e.tokens.length,c=!a,l=[t,0];Rj(e,`dl`,l);let u=t,d=i;outer:for(;;){let t=!1;Rj(e,`dt`,[u,u]);let r=e.push(`inline`,``,0);for(r.map=[u,u],r.content=e.getLines(u,u+1,e.blkIndent,!1).trim(),r.children=[],zj(e,`dt`);;){let r=[i,0];Rj(e,`dd`,r);let a=o,s=e.eMarks[d]??0,l=(e.sCount[d]??0)+o-((e.bMarks[d]??0)+(e.tShift[d]??0));for(;a<s;){let t=e.src.charCodeAt(a);if(t===9)l+=4-l%4;else if(t===32)l++;else break;a++}o=a;let u={tight:e.tight,ddIndent:Ij.get(e),blkIndent:e.blkIndent,tShift:e.tShift[d]??0,sCount:e.sCount[d]??0,parentType:e.parentType};if(e.blkIndent=(e.sCount[d]??0)+2,Ij.set(e,e.blkIndent),e.tShift[d]=o-(e.bMarks[d]??0),e.sCount[d]=l,e.tight=!0,e.parentType=`deflist`,e.md.block.tokenize(e,d,n),(!e.tight||t)&&(c=!1),t=e.line-d>1&&e.isEmpty(e.line-1),e.tShift[d]=u.tShift,e.sCount[d]=u.sCount,e.tight=u.tight,e.parentType=u.parentType,e.blkIndent=u.blkIndent,u.ddIndent===void 0?Ij.delete(e):Ij.set(e,u.ddIndent),zj(e,`dd`),r[1]=i=e.line,i>=n||(e.sCount[i]??0)<e.blkIndent)break outer;if(o=Lj(e,i),o<0)break;d=i}if(i>=n||(u=i,e.isEmpty(u))||(e.sCount[u]??0)<e.blkIndent||(d=u+1,d>=n)||(e.isEmpty(d)&&(c=!1,d++),d>=n)||(e.sCount[d]??0)<e.blkIndent||(o=Lj(e,d),o<0))break}return zj(e,`dl`),l[1]=i,e.line=i,c&&Bj(e,s),!0}var Hj=e=>Fj(e.block.ruler,`before`,[`paragraph`],`deflist`,Vj,{alt:[`paragraph`,`reference`,`blockquote`]}),Uj=MS(()=>({name:`comark-deflist`,markdownItPlugins:[Hj]})),Wj=`mdc_inline_span`,Gj=`blockquote`;function Kj(e,t,n,r,i,a){for(let o of n)try{e[t](o,r,i,a);return}catch{}e.push(r,i,a)}var qj=e=>Array.isArray(e)&&e[0]!==null,Jj=`cfn-def:`,Yj=`cfn-ref:`,Xj=`cfn-note`;function Zj(e,t,n,r){let i=(e.bMarks[t]??0)+(e.tShift[t]??0),a=e.eMarks[t]??0;if(i+4>a||e.src.charCodeAt(i)!==91||e.src.charCodeAt(i+1)!==94)return!1;let o=i+2;for(;o<a;o++){let t=e.src.charCodeAt(o);if(t===32)return!1;if(t===93)break}if(o===i+2||o+1>=a||e.src.charCodeAt(++o)!==58)return!1;if(r)return!0;o++;let s=e.src.slice(i+2,o-2),c=e.push(`${Gj}_open`,Jj+s,1);c.map=[t,0];let l={bMark:e.bMarks[t]??0,tShift:e.tShift[t]??0,sCount:e.sCount[t]??0,parentType:e.parentType},u=o,d=l.sCount+o-(l.bMark+l.tShift),f=d;for(;o<a;){let t=e.src.charCodeAt(o);if(t===9)f+=4-f%4;else if(t===32)f++;else break;o++}return e.tShift[t]=o-u,e.sCount[t]=f-d,e.bMarks[t]=u,e.blkIndent+=4,e.parentType=`footnote`,(e.sCount[t]??0)<e.blkIndent&&(e.sCount[t]=(e.sCount[t]??0)+e.blkIndent),e.md.block.tokenize(e,t,n),e.parentType=l.parentType,e.blkIndent-=4,e.tShift[t]=l.tShift,e.sCount[t]=l.sCount,e.bMarks[t]=l.bMark,c.map[1]=e.line,e.push(`${Gj}_close`,Jj+s,-1),!0}function Qj(e,t){let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==91||e.src.charCodeAt(n+1)!==94)return!1;let i=n+2;for(;i<r;i++){let t=e.src.charCodeAt(i);if(t===32||t===10)return!1;if(t===93)break}if(i===n+2||i>=r)return!1;let a=tM(e,i+1),o=e.src.charCodeAt(a);if(a===i+1&&(o===40||o===91))return!1;if(!t){let t=Yj+e.src.slice(n+2,i);e.push(`${Wj}_open`,t,1),e.push(`${Wj}_close`,t,-1)}return e.pos=a,!0}function $j(e,t){let n=e.pos,r=e.posMax;if(n+2>=r||e.src.charCodeAt(n)!==94||e.src.charCodeAt(n+1)!==91)return!1;let i=e.md.helpers.parseLinkLabel(e,n+1);return i<0?!1:(t||(e.push(`${Wj}_open`,Xj,1),e.pos=n+2,e.posMax=i,e.md.inline.tokenize(e),e.push(`${Wj}_close`,Xj,-1)),e.pos=tM(e,i+1),e.posMax=r,!0)}var eM=`(comark:incomplete-link)`,tM=(e,t)=>e.src.startsWith(eM,t)?t+24:t,nM=e=>{Kj(e.block.ruler,`before`,[`reference`],`footnote_def`,Zj,{alt:[`paragraph`,`reference`]}),Kj(e.inline.ruler,`before`,[`comark_inline_span`,`link`],`footnote_inline`,$j),Kj(e.inline.ruler,`before`,[`comark_inline_span`,`link`],`footnote_ref`,Qj)},rM=e=>e.replace(/[^a-zA-Z0-9_-]/g,e=>`-${e.charCodeAt(0).toString(16)}-`),iM=(e,[t])=>t.startsWith(e)?t.slice(e.length):void 0,aM=([,,...e])=>e,oM=new WeakMap,sM=new WeakMap;function cM(e,t,n,r){for(let i=e.length-1;i>=t;i--){let t=e[i];if(!qj(t))continue;let a=iM(Jj,t);if(a!==void 0){e.splice(i,1);let o=aM(t);cM(o,0,n,r),n.has(a)&&r.add(a),n.set(a,o)}else cM(t,2,n,r)}}var lM=MS(e=>{let{label:t=`Footnotes`,hr:n=!0,backRef:r=`↩`}=e??{};return{name:`footnotes`,markdownItPlugins:[nM],post(e){let{tree:i}=e,a=[],o=new Map,s=new Set;cM(i.nodes,0,o,s);let c=new Map,l=new Set,u=new Set([...o.keys()].map(rM)),d=0,f=()=>{let e;do e=`note-${++d}`;while(o.has(e)||c.has(e)||u.has(rM(e)));return u.add(rM(e)),e},p=(e,t)=>{let n=c.get(e);n||(n={label:e,id:rM(e),content:t(),refs:0},c.set(e,n));let r=++n.refs,i=[`sup`,{class:`footnote-ref`},[`a`,{href:`#fn-${n.id}`,id:r===1?`fnref-${n.id}`:`fnref-${n.id}-${r}`},`[${[...c.keys()].indexOf(e)+1}]`]];return oM.set(i,{label:e,content:n.content}),i},m=(e,t)=>{for(let n=t;n<e.length;n++){let t=e[n],r=sM.get(e)?.get(n);if(r!==void 0&&t===`[^${r}]`){let t=o.get(r);if(t){e[n]=p(r,()=>t),sM.get(e)?.delete(n);continue}l.add(r);continue}if(!qj(t))continue;let[i]=t,a=iM(Yj,t),s=i===`sup`?oM.get(t):void 0;if(a!==void 0){let t=o.get(a);if(t)e[n]=p(a,()=>t);else{e[n]=`[^${a}]`;let t=sM.get(e);t||sM.set(e,t=new Map),t.set(n,a),l.add(a)}}else if(i===Xj){let r=aM(t);e[n]=p(f(),()=>r)}else s&&(e[n]=p(s.label,()=>s.content));e[n]===t&&m(t,2)}};m(i.nodes,0);for(let e of c.values())m(e.content,0);for(let e of l)a.push({rule:`comark/footnotes/missing-definition`,message:`footnotes: [^${e}] has no definition; add a "[^${e}]: …" line, or remove the reference.`});for(let e of o.keys())c.has(e)||a.push({rule:`comark/footnotes/unused-definition`,message:`footnotes: [^${e}]: is never referenced; add [^${e}] where it applies, or remove the definition.`});for(let e of s)a.push({rule:`comark/footnotes/duplicate-definition`,message:`footnotes: [^${e}]: is defined more than once, and only the first shows; give the others their own labels, or remove them.`});if(a.length&&(i.meta.issues=[...i.meta.issues??[],...a.map(e=>e.message)],i.meta.issueRules={...i.meta.issueRules,...Object.fromEntries(a.map(e=>[e.message,e.rule]))}),!c.size)return;let h=[...c.values()].map(e=>{let t=Array.from({length:e.refs},(t,n)=>[` `,[`a`,{href:n?`#fnref-${e.id}-${n+1}`:`#fnref-${e.id}`,class:`footnote-backref`},r]]).flat(),n=[...e.content],i=n.at(-1);return qj(i)&&i[0]===`p`?n[n.length-1]=[...i,...t]:n.push(...t),[`li`,{id:`fn-${e.id}`},...n]}),g=n?[[`hr`,{}]]:[],_=t?[[`h2`,{id:`footnotes`},t]]:[];i.nodes.push([`section`,{class:`footnotes`},...g,..._,[`ol`,{class:`footnotes-list`},...h]])}}}),uM=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,dM=z.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`,L(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:r}=this.options.resize,i=new Set([`src`,`width`,`height`]);return({node:a,getPos:o,HTMLAttributes:s,editor:c})=>{let l=document.createElement(`img`);l.draggable=!1;let u=L(this.options.HTMLAttributes,s);Object.entries(u).forEach(([e,t])=>{if(t!=null)switch(e){case`src`:case`width`:case`height`:break;default:l.setAttribute(e,t)}}),u.src!==null&&(l.src=u.src);let d={...s},f=e=>{typeof e==`string`&&e!==``?l.getAttribute(`src`)!==e&&(l.src=e):(l.hasAttribute(`src`)&&l.removeAttribute(`src`),l.src!==``&&(l.src=``))};f(s.src);let p=new Ym({element:l,editor:c,node:a,getPos:o,onResize:(e,t)=>{l.style.width=`${e}px`,l.style.height=`${t}px`},onCommit:(e,t)=>{let n=o();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:e=>{if(e.type!==a.type)return!1;let t=yf(e,c.extensionManager.attributes.filter(t=>t.type===e.type.name));return Object.keys(d).forEach(e=>{!i.has(e)&&!(e in t)&&l.removeAttribute(e)}),Object.entries(t).forEach(([e,t])=>{i.has(e)||(t==null?l.removeAttribute(e):l.setAttribute(e,t))}),f(t.src),d=t,!0},options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),m=p.dom,h=()=>{m.style.visibility=``,m.style.pointerEvents=``};return m.style.visibility=`hidden`,m.style.pointerEvents=`none`,l.complete&&l.naturalWidth>0?h():(l.onload=h,l.onerror=h),p}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Gm({find:uM,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),fM=`listItem`,pM=`textStyle`,mM=/^\s*([-+*])\s$/,hM=z.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,L(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
178
|
-
`):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(
|
|
175
|
+
`)}\n\n`:``]}return[e.tag,dA(e.attrs,e.block),...e.children]}function _A(e,t){if(t===void 0)return;if(e.htmlStack.length===0)return t;let n=e.htmlStack[e.htmlStack.length-1];mA(n),n.children.push(t)}function vA(e,t){if(t===void 0)return;if(e.htmlStack.length===0)return t;let n=e.htmlStack[e.htmlStack.length-1];n.block&&pA(t)?n.pendingInline.push(t):(mA(n),n.children.push(t))}function yA(e,t){if(t.htmlStack[t.htmlStack.length-1]?.tag===null&&e.includes(`-->`)){let n=e.indexOf(`-->`);return n>0&&vA(t,e.slice(0,n)),{nextIndex:-1,node:gA(t.htmlStack.pop())}}if(e.startsWith(`<!--`)&&!e.includes(`-->`)){let n=e.slice(4);return t.htmlStack.push({tag:null,attrs:{},children:n?[n]:[],block:!0,pendingInline:[]}),{nextIndex:-1,node:void 0}}if(e.startsWith(`<!--`)&&e.includes(`-->`)){let t=e.indexOf(`-->`);return{nextIndex:-1,node:[null,{},e.slice(4,t)]}}return null}function bA(e,t,n){return jA[e[t].type]?.(e,t,n)}function xA(e,t,n=!0){let r=[],i=0;for(;i<e.length;){let a=bA(e,i,t);if(!a){i+=1;continue}let o=n?vA(t,a.node):a.node;o!==void 0&&fA(r,o),i=a.nextIndex}return r}function SA(e,t,n,r,i){let a=i.startLine;if(Array.isArray(t)){for(let t=n;t<r;t++)e[t].map&&e[t].map?.[1]&&(a=e[t].map?.[1]+i.startLine+ +!!e[t].type?.endsWith(`_close`));t[1].$||(t[1].$={}),t[1].$.line=a}}function CA(e,t,n,r,i=!1){let a=[],o=t+1;for(;o<e.length;){let t=e[o];if(t.type===n)return{children:a,nextIndex:o+1};if(t.type===`inline`){a.push(...xA(t.children??[],r,i)),o+=1;continue}let s=bA(e,o,r);if(s){let e=i?vA(r,s.node):s.node;e!==void 0&&fA(a,e),o=s.nextIndex}else o+=1}return{children:a,nextIndex:o}}function wA(e,t){let n=rA(e,t.nextIndex);return t.nextIndex<n.nextIndex&&(t.node[1]=Object.assign(t.node[1],n.attrs),t.nextIndex=n.nextIndex),t}function TA(e,t,n,r){let i=[],a=t+1,o=null,s=()=>{o&&=(i.push([o.tag,o.attrs,...iA(o.children)]),null)},c=e=>{e!==void 0&&fA(o?o.children:i,e)};for(;a<e.length;){let t=e[a];if(t.type===n)return s(),{children:i,nextIndex:a+1};if(t.type===`mdc_block_slot_open`){s(),o={tag:t.tag||`template`,attrs:nA(t.attrs),children:[]},a+=1;continue}if(t.type===`mdc_block_slot_close`){a+=1;continue}if(t.type===`inline`){let e=xA(t.children??[],r);o?o.children.push(...e):i.push(...e),a+=1;continue}let l=bA(e,a,r);l?(c(l.node),a=l.nextIndex):a+=1}return s(),{children:i,nextIndex:a}}function EA(e,t,n){let r=e[t];n.insideMarkdownContainer+=1;let{children:i,nextIndex:a}=TA(e,t,`mdc_block_close`,n);--n.insideMarkdownContainer;let o=nA(r.attrs),s=[r.tag||`div`,o,...iA(i)];return uA.has(s[0])&&i.length===1&&i[0][0]===s[0]&&(s=s[2],s[1]={...s[1],...o}),wA(e,{nextIndex:a,node:s})}function DA(e,t,n){let r=e[t],i=r.content||``,a=tA(r.info||r.params||``),o=a,s={};a.language&&a.language.trim()&&(o.language=a.language,s.class=`language-${a.language}`);let c=i.endsWith(`
|
|
176
|
+
`)?i.slice(0,-1):i;return{nextIndex:t+1,node:[`pre`,o,[`code`,s,c]]}}function OA(e){return(t,n)=>wA(t,{nextIndex:n+1,node:e(t[n])})}function kA(e,t){let n=e.htmlStack,r=e.insideMarkdownContainer;e.htmlStack=[],e.insideMarkdownContainer=0;try{let n=t();for(;e.htmlStack.length>0;){let t=e.htmlStack.pop();t.block=!0;let r=gA(t);e.htmlStack.length>0?e.htmlStack[e.htmlStack.length-1].children.push(r):n.children.push(r)}return n}finally{e.htmlStack=n,e.insideMarkdownContainer=r}}function AA(e,t=``,n=!1){return(r,i,a)=>{let o=r[i],{children:s,nextIndex:c}=n?kA(a,()=>CA(r,i,e,a,!0)):CA(r,i,e,a),l=nA(o.attrs);return wA(r,{nextIndex:c,node:[t||o.tag,l,...iA(s)]})}}var jA={mdc_block_slot_open:AA(`mdc_block_slot_close`),mdc_inline_span_open:AA(`mdc_inline_span_close`),mdc_block_shorthand_open:AA(`mdc_block_shorthand_close`),mdc_inline_component_open:AA(`mdc_inline_component_close`),blockquote_open:AA(`blockquote_close`,``,!0),bullet_list_open:AA(`bullet_list_close`,``,!0),ordered_list_open:AA(`ordered_list_close`,``,!0),list_item_open:AA(`list_item_close`,``,!0),strong_open:AA(`strong_close`),link_open:AA(`link_close`),em_open:AA(`em_close`),table_open:AA(`table_close`,``,!0),thead_open:AA(`thead_close`,``,!0),tbody_open:AA(`tbody_close`,``,!0),tr_open:AA(`tr_close`,``,!0),th_open:AA(`th_close`,``,!0),td_open:AA(`td_close`,``,!0),sub_open:AA(`sub_close`),sup_open:AA(`sup_close`),s_open:AA(`s_close`,`del`),mdc_block_open:EA,code_inline:OA(e=>[`code`,{},e.content]),math_inline:OA(e=>[`math`,{class:`math inline`,content:e.content},e.content]),math_block:OA(e=>[`math`,{class:`math block`,content:e.content},e.content]),emoji:OA(e=>e.content),hr:OA(()=>[`hr`,{}]),hardbreak:OA(()=>[`br`,{}]),reference:(e,t)=>({node:void 0,nextIndex:t+1}),softbreak:(e,t,n)=>({nextIndex:t+1,node:n.htmlStack.length>0||e[t-1].type===`html_inline`?void 0:`
|
|
177
|
+
`}),code_block:DA,fenced_code_block:DA,fence:DA,mdc_block_shorthand:OA(e=>[e.tag,nA(e.attrs)]),heading_open(e,t,n){let{nextIndex:r,node:i}=AA(`heading_close`)(e,t,n);if(i.length===2)return{node:void 0,nextIndex:r};if(n.headingIds){let r=Number.parseInt((e[t].tag||`h1`).replace(`h`,``),10)||1,a=cA(MO(i),r,n.headingIds);sA(n.headingIds,i[1].id),a&&(i[1]={id:a,...i[1]})}return{nextIndex:r,node:i}},paragraph_open(e,t,n){let r=e[t+1],i=n.htmlStack.length,a=n.insideMarkdownContainer===0,{children:o,nextIndex:s}=CA(e,t,`paragraph_close`,n,a),c=()=>o.length===0?{nextIndex:s,node:void 0}:{nextIndex:s,node:[`p`,nA(e[t].attrs),...iA(o)]},l=e=>{if(o.length===0)return{nextIndex:s,node:void 0};let t=o.length===1?o[0]:[`fragment`,{},...o];return{nextIndex:s,node:t,siblingOfHtmlStack:e||void 0}};if(i>0&&n.htmlStack.length===0)return o.length===1&&Array.isArray(o[0])?{nextIndex:s,node:o[0]}:c();if(n.htmlStack.length>0){if(a){for(let e of n.htmlStack)mA(e);return l(o.length>0)}return c()}let u=c();if(u.node===void 0)return u;let d=wA(e,{nextIndex:s,node:u.node}),f=d.node;if(Array.isArray(f)&&f.length===3&&Array.isArray(f[2])&&r?.type===`inline`&&r.children?.[0]?.type===`html_inline`&&(!lA.has(f[2]?.[0])||u.node[2][1]?.$?.block)){let e=f[2];return e[1].$&&(e[1].$.block=1),{nextIndex:d.nextIndex,node:e}}return d.node.every((e,t)=>t<2||e?.[1]?.$?.html)&&(d.node[0]=`fragment`),d},mdc_inline_component(e,t){let n=e[t],r=nA(n.attrs),{attrs:i,nextIndex:a}=rA(e,t+1,!1);return{node:[n.tag,{...r,...i}],nextIndex:a}},image(e,t){let n=e[t],r=nA(n.attrs,{handleJSON:!1,filterEmpty:!0});return n.content&&(r.alt=n.content),wA(e,{node:[`img`,r],nextIndex:t+1})},text(e,t,n){let r=e[t].content;if(r===``)return{nextIndex:t+1,node:void 0};let i=yA(r,n);return i?{nextIndex:t+1,node:i.node}:{nextIndex:t+1,node:r}},html_inline(e,t,n){let r=e[t].content||``,i=Wk(r);if(i.kind===`comment`)return{nextIndex:t+1,node:[null,{},i.content]};if(i.kind===`other`){let e=yA(r,n);return e?{nextIndex:t+1,node:e.node}:{nextIndex:t+1,node:[null,{},r]}}if(i.kind===`close`){let e=i.tag.toLowerCase(),r=n.htmlStack.length-1;for(;r>=0;){let t=n.htmlStack[r].tag;if(t!==null&&t.toLowerCase()===e)break;r--}if(r<0)return{nextIndex:t+1,node:void 0};let a;for(;n.htmlStack.length>r;){let e=gA(n.htmlStack.pop());n.htmlStack.length>r?vA(n,e):a=e}return{nextIndex:t+1,node:a}}return i.selfClosing?{nextIndex:t+1,node:[i.tag,dA(i.attrs,!1)]}:(n.htmlStack.push({tag:i.tag,attrs:i.attrs,children:[],block:!1,pendingInline:[]}),{nextIndex:t+1,node:void 0})}};function MA(e,t={}){let n={preservePositions:t.preservePositions??!1,headingIds:aA(t.headingIds??!0),startLine:t.startLine??0,htmlStack:[],insideMarkdownContainer:0},r=[],i=0;for(;i<e.length;){let t=e[i];if(t.type===`inline`){let e=xA(t.children??[],n);if(n.htmlStack.length>0)for(let t of e)n.htmlStack[n.htmlStack.length-1].children.push(t);else r.push(...e);i+=1;continue}let a=bA(e,i,n);if(a){for(let e of n.htmlStack)e.block=!0;if(a.node!==void 0){if(n.preservePositions&&SA(e,a.node,i,a.nextIndex,n),a.siblingOfHtmlStack)fA(r,a.node);else{let e=_A(n,a.node);e!==void 0&&fA(r,e)}}i=a.nextIndex}else r.push([t.tag||`component`,nA(t.attrs,{handleJSON:!1})]),i+=1}for(;n.htmlStack.length>0;){let e=n.htmlStack.pop();e.block=!0;let t=gA(e);n.htmlStack.length>0?n.htmlStack[n.htmlStack.length-1].children.push(t):r.push(t)}return r}var NA=32,PA=0,FA=new WeakMap,IA=new Map;function LA(e={}){let{autoUnwrap:t=!0,autoClose:n=!0,tracer:r=Qk}=e,i=Kk(e.unwrap),a=e.plugins??[];e.html!==void 0&&console.warn("[comark] `ParserOptions.html` is deprecated and will be removed in a future major version. Use `registerDefaultPlugins: false` and register `html()` from `comark/plugins/html` only when needed.");let o=AS(e.registerDefaultPlugins===!1?[]:[Rk(),...e.html===!1?[]:[yk()],vk(),gk(),lk(),pk()],a),s=e=>o.some(t=>t.name===e),c=[];for(let e of o)for(let t of e.markdownItPlugins||[])c.push(t);let l=e.linkify??!0,u=[l,...c.map(e=>FA.get(e)??(FA.set(e,PA),PA++))].join(`,`),d=IA.get(u);if(d)IA.delete(u),IA.set(u,d);else{d=new kS({linkify:l}).enable([`table`,`strikethrough`]);for(let e of c)d.use(e);if(IA.size>=NA){let e=IA.keys().next().value;e!==void 0&&IA.delete(e)}IA.set(u,d)}let f=null,p=null;return async(a,c={})=>await $k(r,`comark:parse`,async()=>{let l={options:e,tokens:[],markdown:a,tree:null,parsedLines:0,reusableNodes:[],frontmatterText:``,frontmatter:{}},u=f,m=a.startsWith(p??``);if(c.streaming&&u&&m&&!a.includes(`]:`)){let{remainingMarkdownStartLine:e,reusedNodes:t,remainingMarkdown:n}=Hk(a,u);if(!n)return u;/#|(?:^|\n)[^\n]*[=-][ \t]*\r?(?:\n|$)/.test(n)||(l.parsedLines=e,l.markdown=n,l.reusableNodes=t)}typeof n==`function`?l.markdown=$k(r,`comark:autoclose`,()=>n(l.markdown)):n&&(l.markdown=$k(r,`comark:autoclose`,()=>h_(l.markdown,{frontmatter:s(`frontmatter`)&&c.streaming,syntax:s(`components`),attributes:s(`components`)||s(`attributes`),math:s(`math`),dropTrailingOpeners:c.streaming===!0})));for(let e of o)e.pre&&await $k(r,`comark:pre:${e.name}`,()=>e.pre(l));try{l.tokens=$k(r,`comark:tokenize`,()=>d.parse(l.markdown,{}))}catch(e){if(c.streaming&&u)return u;throw e}for(let e of o)e.markdownItPost&&$k(r,`comark:markdownItPost:${e.name}`,()=>e.markdownItPost(l));let h=r.startSpan(`comark:nodes`),g=MA(l.tokens,{startLine:l.parsedLines,preservePositions:c.streaming??!1,headingIds:e.headingIds??!0});t&&(g=g.map(e=>Bk(e))),i.length>0&&(g=Xk(g,i)),h.end();let _=l.frontmatter??{},v=l.frontmatterText??``;c.streaming?(l.tree={frontmatter:v||!m?_:u?.frontmatter??_,meta:{},nodes:[...l.reusableNodes,...g]},f=l.tree,p=a):(l.tree={frontmatter:_,meta:{},nodes:g},f=null,p=null);for(let e of o)e.post&&await $k(r,`comark:post:${e.name}`,()=>e.post(l));return l.tree})}async function RA(e,t={}){return await LA(t)(e)}var zA=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],BA=[12288,12288,65281,65376,65504,65510],VA=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],HA=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],UA=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101594,101631,101664,101760,101874,101888,102801,102816,102866,110576,110579,110581,110587,110589,110590,110592,110888,110898,110898,110928,110930,110933,110933,110948,110952,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127406,127406,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128729,128732,128735,128747,128748,128756,128764,128986,128986,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129734,129736,129736,129740,129757,129759,129771,129775,129786,131072,196605,196608,262141],WA=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},GA=19968,[KA,qA]=JA(UA);function JA(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(GA>=i&&GA<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var YA=e=>e<161||e>1114109?!1:WA(zA,e),XA=e=>e<12288||e>65510?!1:WA(BA,e),ZA=e=>e<8361||e>65518?!1:WA(VA,e),QA=e=>e<32||e>10630?!1:WA(HA,e),$A=e=>e>=KA&&e<=qA?!0:e<4352||e>262141?!1:WA(UA,e);function ej(e){return YA(e)?`ambiguous`:XA(e)?`fullwidth`:ZA(e)?`halfwidth`:QA(e)?`narrow`:$A(e)?`wide`:`neutral`}function tj(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function nj(e){return tj(e),ej(e)}function rj(e){return/^\p{Emoji_Presentation}/u.test(String.fromCodePoint(e))}function ij(e){if(e<4352)return!1;switch(nj(e)){case`fullwidth`:case`halfwidth`:return!0;case`wide`:return!rj(e);case`narrow`:return!1;case`ambiguous`:return null;case`neutral`:return/^\p{sc=Hangul}/u.test(String.fromCodePoint(e))}}function aj(e,t){return ij(e)??(t===65025&&n(e));function n(e){return e===8216||e===8217||e===8220||e===8221}}function oj(e){return ij(e)??(917760<=e&&e<=917999)}function sj(e){return ij(e)??!1}function cj(e){return e>=65024&&e<=65038}function lj(e){let t=e.inline.State;class n extends t{scanDelims(t,n){let r=this.posMax,i=this.src.charCodeAt(t),[a,o]=v(this.src,t),s=a,c=null;cj(a)&&(c=v(this.src,o)[0],/^\p{Zs}/u.test(String.fromCodePoint(c))||(s=c));let l=t;for(;l<r&&this.src.charCodeAt(l)===i;)l++;let u=l-t,d=l<r?this.src.codePointAt(l):32,f=e.utils.isWhiteSpace(s),p=e.utils.isWhiteSpace(d);if(f||p)return{can_open:!p,can_close:!f,length:u};let m=e.utils.isMdAsciiPunct(s)||e.utils.isPunctChar(String.fromCodePoint(s)),h=e.utils.isMdAsciiPunct(d)||e.utils.isPunctChar(String.fromCodePoint(d)),g=m,_=h;if(n){let e=sj(d)||(c===null?oj(a):aj(c,a));g||=e||!h,_||=e||!m}return{can_open:g,can_close:_,length:u};function v(e,t){if(t<=0)return[32,-1];let n=e.charCodeAt(t-1);if((n&64512)!=56320)return[n,t-1];let r=e.codePointAt(t-2);return r>65535?[r,t-2]:[n,t-1]}}}e.inline.State=n}var uj=jS(()=>({name:`comark-cjk`,markdownItPlugins:[lj]})),dj=`mdc_inline_span`;function fj(e,t,n,r,i,a){for(let o of n)try{e[t](o,r,i,a);return}catch{}e.push(r,i,a)}function pj(e){let t=new Map;return n=>{let r=JSON.stringify(n)??``,i=t.get(r);return i||t.set(r,i=e(n)),i}}var mj=[[`background`,`ui-bg`,`background`,`#fff`,`#0a0a0a`],[`foreground`,`ui-text-highlighted`,`foreground`,`#0a0a0a`,`#fafafa`],[`muted`,`ui-text-muted`,`muted-foreground`,`#737373`,`#a1a1a1`],[`border`,`ui-border`,`border`,`#e5e5e5`,`rgb(255 255 255/.1)`],[`accent`,`ui-bg-elevated`,`accent`,`#f5f5f5`,`#262626`],[`ring`,`ui-primary`,`ring`,`#a1a1a1`,`#737373`]],hj={status:Object.values({success:[`success`,`ui-success`,`success`,`#259f56`,`#59d38c`],danger:[`danger`,`ui-error`,`destructive`,`#ee3533`,`#fd736d`],warning:[`warning`,`ui-warning`,``,`#d97706`,`#fbbf24`],info:[`info`,`ui-info`,``,`#2563eb`,`#60a5fa`]}),primary:[[`primary`,`ui-primary`,`primary`,`var(--_comark-foreground)`,`var(--_comark-foreground)`],[`primary-foreground`,`ui-text-inverted`,`primary-foreground`,`var(--_comark-background)`,`var(--_comark-background)`],[`secondary`,`ui-secondary`,``,`var(--_comark-muted)`,`var(--_comark-muted)`]],shadow:[[`shadow`,``,``,`0 4px 12px rgb(0 0 0/.12)`,`0 4px 12px rgb(0 0 0/.5)`]]},gj=(e,t)=>{let n=e[2]?`var(--${e[2]},${e[t]})`:e[t],r=e[1]?`var(--${e[1]},${n})`:n;return`var(--comark-${e[0]},${r})`},_j=(e,t)=>e.map(e=>`--_comark-${e[0]}:${gj(e,t)}`).join(`;`);function vj(e,...t){let n=`:where(${e})`,r=t.flatMap(e=>hj[e]),i=[...mj,...r],a=r.filter(e=>e[3]!==e[4]),o=a.length?`:where(.light,.light *)${n}{${_j(a,3)}}:where(.dark,.dark *)${n}{${_j(a,4)}}`:``;return`${n}{${_j(i,3)};--_comark-radius:var(--comark-radius,calc(var(--ui-radius,calc(var(--radius,.625rem)/2))*2));--_comark-font:var(--comark-font,var(--font-sans,ui-sans-serif,system-ui,sans-serif))}@media (prefers-color-scheme:dark){${n}{${_j(i,4)}}}`+o}var yj=`.ccm-ins,.ccm-del,.ccm-mark`;`${[vj(`${yj},.ccm-comment`,`status`),`:where(${yj}){--_ccm-ins:var(--ccm-ins,var(--_comark-success));--_ccm-del:var(--ccm-del,var(--_comark-danger));--_ccm-mark:var(--ccm-mark,#f5b400)}`,`@media (prefers-color-scheme:dark){:where(${yj}){--_ccm-mark:var(--ccm-mark,#f5c84b)}}`,`${yj},.ccm-comment{border-radius:calc(var(--_comark-radius) - 6px);-webkit-box-decoration-break:clone;box-decoration-break:clone}`,`${yj}{padding:0 .125em;color:inherit}`,`.ccm-ins{background:color-mix(in srgb,var(--_ccm-ins) 14%,transparent);box-shadow:inset 0 -1.5px color-mix(in srgb,var(--_ccm-ins) 60%,transparent);text-decoration:none}`,`.ccm-del{background:color-mix(in srgb,var(--_ccm-del) 10%,transparent);color:color-mix(in oklab,var(--_ccm-del) 60%,var(--_comark-foreground));text-decoration:line-through;text-decoration-color:color-mix(in srgb,var(--_ccm-del) 70%,transparent)}`,`.ccm-mark{background:color-mix(in srgb,var(--_ccm-mark) 30%,transparent)}`,`.ccm-comment{margin:0 .125em;padding:.0625em .375em;background:var(--_comark-accent);box-shadow:inset 0 0 0 1px var(--_comark-border);color:var(--_comark-muted);font-size:.8125em;font-style:normal}`].join(``)}`;var bj=`ccm-comment`,xj={ins:`ccm-ins`,del:`ccm-del`,mark:`ccm-mark`},Sj=new Map([[`{++`,{kind:`ins`,close:`++}`}],[`{--`,{kind:`del`,close:`--}`}],[`{~~`,{kind:`sub`,close:`~~}`}],[`{==`,{kind:`mark`,close:`==}`}],[`{>>`,{kind:`comment`,close:`<<}`}]]),Cj=new Set([`view`,`accept`,`reject`]),wj=`critic_problem`;function Tj(e,t,n,r=``,i=``){let a=e.posMax;if(r){let t=e.push(`${dj}_open`,r,1);i&&(t.attrs=[[`class`,i]])}e.pos=t,e.posMax=n,e.md.inline.tokenize(e),e.posMax=a,r&&(e.push(`${dj}_close`,r,-1).meta={critic:i})}function Ej(e,t,{rule:n,message:r}){let i=e.push(wj,``,0);return i.content=r,i.meta={rule:n},e.pending+=t,e.pos+=t.length,!0}function Dj(e,t,n,r){for(let i=t;i<=n-r.length;i++)if(e.charCodeAt(i)===92)i++;else{if(e.charCodeAt(i)===96){let t=i+1;for(;e.charCodeAt(t)===96;)t++;let r=e.slice(i,t),a=e.indexOf(r,t);if(a>=0&&a<n){i=a+r.length-1;continue}}if(e[i]===`<`&&!e.startsWith(r,i)){let t=``,r=-1;for(let a=i+1;a<n;a++){let n=e[a];if(t)n===`\\`?a++:n===t&&(t=``);else if(n===`"`||n===`'`)t=n;else if(n===`>`){r=a;break}}if(r>=0){i=r;continue}}if(e[i]===`[`){let t=-1,r=1;for(let a=i+1;a<n;a++)if(e[a]===`\\`)a++;else if(e[a]===`[`)r++;else if(e[a]===`]`&&--r===0){t=a;break}if(t>=0&&t+1<n&&e[t+1]===`(`){let r=1,a=t+2;for(;a<n&&r;a++)e[a]===`\\`?a++:e[a]===`(`?r++:e[a]===`)`&&r--;if(!r){i=a-1;continue}}}if(e[i]===`*`||e[i]===`_`){let t=e[i],r=i+1;for(;e[r]===t;)r++;let a=e.indexOf(e.slice(i,r),r);if(a>=0&&a<n){i=a+(r-i)-1;continue}}if(e.startsWith(r,i))return i}return-1}var Oj=e=>(t,n)=>{let r=t.pos;if(t.src.charCodeAt(r)!==123)return!1;let i=t.src.slice(r,r+3),a=Sj.get(i);if(!a)return!1;let o=r+3,s=Dj(t.src,o,t.posMax,a.close);if(s<0||s+3>t.posMax)return!n&&Ej(t,i,{rule:`comark/critic/unclosed-mark`,message:`critic \`${i}\` has no closing \`${a.close}\` in its paragraph; close it there, or write \`\\${i}\` to keep the text.`});let c=a.kind===`sub`?Dj(t.src,o,s,`~>`):-1;if(a.kind===`sub`&&(c<0||c>s))return!n&&Ej(t,i,{rule:`comark/critic/missing-arrow`,message:`critic \`{~~${t.src.slice(o,s)}~~}\` has no \`~>\` between the old and the new text; write \`{~~old~>new~~}\`.`});if(n)return t.pos=s+3,!0;let l=e===`view`;return a.kind===`sub`?(e!==`accept`&&Tj(t,o,c,l?`del`:``,xj.del),e!==`reject`&&Tj(t,c+2,s,l?`ins`:``,xj.ins)):a.kind===`comment`?l&&Tj(t,o,s,`span`,bj):a.kind===`mark`?Tj(t,o,s,l?`mark`:``,xj.mark):l?Tj(t,o,s,a.kind,xj[a.kind]):a.kind===`ins`==(e===`accept`)&&Tj(t,o,s),t.pos=s+3,!0},kj=pj(e=>t=>{fj(t.inline.ruler,`before`,[`comark_inline_props`,`entity`],`critic`,Oj(e))}),Aj=new WeakMap;function jj(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(r){if(r.children&&jj(r.children,t),r.type===`mdc_inline_props`&&r.attrGet(`class`)){let t=n-1;for(;e[t]?.type===`text`&&!e[t].content.trim();)t--;let i=e[t]?.meta?.critic;i&&r.attrSet(`class`,`${i} ${r.attrGet(`class`)}`)}r.type===wj&&(t.unshift({rule:r.meta.rule,message:r.content}),e.splice(n,1))}}}var Mj=jS(e=>{let t=e?.mode??`view`,n=Cj.has(t)?t:`view`;return{name:`comark-critic`,markdownItPlugins:[kj(n)],markdownItPost(e){let t=[];jj(e.tokens,t),Aj.set(e,t)},post(e){let r=Aj.get(e)??[];if(n!==t&&r.unshift({rule:`comark/critic/invalid-mode`,message:`critic: \`mode\` must be "view", "accept", or "reject", not "${String(t)}"; until then it shows the changes.`}),!r.length)return;let{meta:i}=e.tree;i.issues=[...i.issues??[],...r.map(e=>e.message)],i.issueRules={...i.issueRules,...Object.fromEntries(r.map(e=>[e.message,e.rule]))}}}}),Nj=`blockquote`;function Pj(e,t,n,r,i,a){for(let o of n)try{e[t](o,r,i,a);return}catch{}e.push(r,i,a)}var Fj=new WeakMap;function Ij(e,t){let n=(e.bMarks[t]??0)+(e.tShift[t]??0),r=e.eMarks[t]??0;if(n>=r||(e.sCount[t]??0)-e.blkIndent>=4)return-1;let i=e.src.charCodeAt(n++);if(i!==126&&i!==58)return-1;let a=e.skipSpaces(n);return n===a&&a<r?-1:n}var Lj=(e,t,n)=>{let r=e.push(`${Nj}_open`,t,1);return r.map=n,r},Rj=(e,t)=>e.push(`${Nj}_close`,t,-1);function zj(e,t){let n=e.level+2,{tokens:r}=e;for(let e=r.length-3;e>t;e--){let t=r[e];t?.level===n&&t.type===`paragraph_open`&&(r.splice(e+2,1),r.splice(e,1))}}function Bj(e,t,n,r){if(r)return(Fj.get(e)??-1)<0?!1:Ij(e,t)>=0;let i=t+1;if(i>=n)return!1;let a=!1;if(e.isEmpty(i)&&(a=!0,++i>=n)||(e.sCount[i]??0)<e.blkIndent)return!1;let o=Ij(e,i);if(o<0)return!1;let s=e.tokens.length,c=!a,l=[t,0];Lj(e,`dl`,l);let u=t,d=i;outer:for(;;){let t=!1;Lj(e,`dt`,[u,u]);let r=e.push(`inline`,``,0);for(r.map=[u,u],r.content=e.getLines(u,u+1,e.blkIndent,!1).trim(),r.children=[],Rj(e,`dt`);;){let r=[i,0];Lj(e,`dd`,r);let a=o,s=e.eMarks[d]??0,l=(e.sCount[d]??0)+o-((e.bMarks[d]??0)+(e.tShift[d]??0));for(;a<s;){let t=e.src.charCodeAt(a);if(t===9)l+=4-l%4;else if(t===32)l++;else break;a++}o=a;let u={tight:e.tight,ddIndent:Fj.get(e),blkIndent:e.blkIndent,tShift:e.tShift[d]??0,sCount:e.sCount[d]??0,parentType:e.parentType};if(e.blkIndent=(e.sCount[d]??0)+2,Fj.set(e,e.blkIndent),e.tShift[d]=o-(e.bMarks[d]??0),e.sCount[d]=l,e.tight=!0,e.parentType=`deflist`,e.md.block.tokenize(e,d,n),(!e.tight||t)&&(c=!1),t=e.line-d>1&&e.isEmpty(e.line-1),e.tShift[d]=u.tShift,e.sCount[d]=u.sCount,e.tight=u.tight,e.parentType=u.parentType,e.blkIndent=u.blkIndent,u.ddIndent===void 0?Fj.delete(e):Fj.set(e,u.ddIndent),Rj(e,`dd`),r[1]=i=e.line,i>=n||(e.sCount[i]??0)<e.blkIndent)break outer;if(o=Ij(e,i),o<0)break;d=i}if(i>=n||(u=i,e.isEmpty(u))||(e.sCount[u]??0)<e.blkIndent||(d=u+1,d>=n)||(e.isEmpty(d)&&(c=!1,d++),d>=n)||(e.sCount[d]??0)<e.blkIndent||(o=Ij(e,d),o<0))break}return Rj(e,`dl`),l[1]=i,e.line=i,c&&zj(e,s),!0}var Vj=e=>Pj(e.block.ruler,`before`,[`paragraph`],`deflist`,Bj,{alt:[`paragraph`,`reference`,`blockquote`]}),Hj=jS(()=>({name:`comark-deflist`,markdownItPlugins:[Vj]})),Uj=`mdc_inline_span`,Wj=`blockquote`;function Gj(e,t,n,r,i,a){for(let o of n)try{e[t](o,r,i,a);return}catch{}e.push(r,i,a)}var Kj=e=>Array.isArray(e)&&e[0]!==null,qj=`cfn-def:`,Jj=`cfn-ref:`,Yj=`cfn-note`;function Xj(e,t,n,r){let i=(e.bMarks[t]??0)+(e.tShift[t]??0),a=e.eMarks[t]??0;if(i+4>a||e.src.charCodeAt(i)!==91||e.src.charCodeAt(i+1)!==94)return!1;let o=i+2;for(;o<a;o++){let t=e.src.charCodeAt(o);if(t===32)return!1;if(t===93)break}if(o===i+2||o+1>=a||e.src.charCodeAt(++o)!==58)return!1;if(r)return!0;o++;let s=e.src.slice(i+2,o-2),c=e.push(`${Wj}_open`,qj+s,1);c.map=[t,0];let l={bMark:e.bMarks[t]??0,tShift:e.tShift[t]??0,sCount:e.sCount[t]??0,parentType:e.parentType},u=o,d=l.sCount+o-(l.bMark+l.tShift),f=d;for(;o<a;){let t=e.src.charCodeAt(o);if(t===9)f+=4-f%4;else if(t===32)f++;else break;o++}return e.tShift[t]=o-u,e.sCount[t]=f-d,e.bMarks[t]=u,e.blkIndent+=4,e.parentType=`footnote`,(e.sCount[t]??0)<e.blkIndent&&(e.sCount[t]=(e.sCount[t]??0)+e.blkIndent),e.md.block.tokenize(e,t,n),e.parentType=l.parentType,e.blkIndent-=4,e.tShift[t]=l.tShift,e.sCount[t]=l.sCount,e.bMarks[t]=l.bMark,c.map[1]=e.line,e.push(`${Wj}_close`,qj+s,-1),!0}function Zj(e,t){let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==91||e.src.charCodeAt(n+1)!==94)return!1;let i=n+2;for(;i<r;i++){let t=e.src.charCodeAt(i);if(t===32||t===10)return!1;if(t===93)break}if(i===n+2||i>=r)return!1;let a=eM(e,i+1),o=e.src.charCodeAt(a);if(a===i+1&&(o===40||o===91))return!1;if(!t){let t=Jj+e.src.slice(n+2,i);e.push(`${Uj}_open`,t,1),e.push(`${Uj}_close`,t,-1)}return e.pos=a,!0}function Qj(e,t){let n=e.pos,r=e.posMax;if(n+2>=r||e.src.charCodeAt(n)!==94||e.src.charCodeAt(n+1)!==91)return!1;let i=e.md.helpers.parseLinkLabel(e,n+1);return i<0?!1:(t||(e.push(`${Uj}_open`,Yj,1),e.pos=n+2,e.posMax=i,e.md.inline.tokenize(e),e.push(`${Uj}_close`,Yj,-1)),e.pos=eM(e,i+1),e.posMax=r,!0)}var $j=`(comark:incomplete-link)`,eM=(e,t)=>e.src.startsWith($j,t)?t+24:t,tM=e=>{Gj(e.block.ruler,`before`,[`reference`],`footnote_def`,Xj,{alt:[`paragraph`,`reference`]}),Gj(e.inline.ruler,`before`,[`comark_inline_span`,`link`],`footnote_inline`,Qj),Gj(e.inline.ruler,`before`,[`comark_inline_span`,`link`],`footnote_ref`,Zj)},nM=e=>e.replace(/[^a-zA-Z0-9_-]/g,e=>`-${e.charCodeAt(0).toString(16)}-`),rM=(e,[t])=>t.startsWith(e)?t.slice(e.length):void 0,iM=([,,...e])=>e,aM=new WeakMap,oM=new WeakMap;function sM(e,t,n,r){for(let i=e.length-1;i>=t;i--){let t=e[i];if(!Kj(t))continue;let a=rM(qj,t);if(a!==void 0){e.splice(i,1);let o=iM(t);sM(o,0,n,r),n.has(a)&&r.add(a),n.set(a,o)}else sM(t,2,n,r)}}var cM=jS(e=>{let{label:t=`Footnotes`,hr:n=!0,backRef:r=`↩`}=e??{};return{name:`footnotes`,markdownItPlugins:[tM],post(e){let{tree:i}=e,a=[],o=new Map,s=new Set;sM(i.nodes,0,o,s);let c=new Map,l=new Set,u=new Set([...o.keys()].map(nM)),d=0,f=()=>{let e;do e=`note-${++d}`;while(o.has(e)||c.has(e)||u.has(nM(e)));return u.add(nM(e)),e},p=(e,t)=>{let n=c.get(e);n||(n={label:e,id:nM(e),content:t(),refs:0},c.set(e,n));let r=++n.refs,i=[`sup`,{class:`footnote-ref`},[`a`,{href:`#fn-${n.id}`,id:r===1?`fnref-${n.id}`:`fnref-${n.id}-${r}`},`[${[...c.keys()].indexOf(e)+1}]`]];return aM.set(i,{label:e,content:n.content}),i},m=(e,t)=>{for(let n=t;n<e.length;n++){let t=e[n],r=oM.get(e)?.get(n);if(r!==void 0&&t===`[^${r}]`){let t=o.get(r);if(t){e[n]=p(r,()=>t),oM.get(e)?.delete(n);continue}l.add(r);continue}if(!Kj(t))continue;let[i]=t,a=rM(Jj,t),s=i===`sup`?aM.get(t):void 0;if(a!==void 0){let t=o.get(a);if(t)e[n]=p(a,()=>t);else{e[n]=`[^${a}]`;let t=oM.get(e);t||oM.set(e,t=new Map),t.set(n,a),l.add(a)}}else if(i===Yj){let r=iM(t);e[n]=p(f(),()=>r)}else s&&(e[n]=p(s.label,()=>s.content));e[n]===t&&m(t,2)}};m(i.nodes,0);for(let e of c.values())m(e.content,0);for(let e of l)a.push({rule:`comark/footnotes/missing-definition`,message:`footnotes: [^${e}] has no definition; add a "[^${e}]: …" line, or remove the reference.`});for(let e of o.keys())c.has(e)||a.push({rule:`comark/footnotes/unused-definition`,message:`footnotes: [^${e}]: is never referenced; add [^${e}] where it applies, or remove the definition.`});for(let e of s)a.push({rule:`comark/footnotes/duplicate-definition`,message:`footnotes: [^${e}]: is defined more than once, and only the first shows; give the others their own labels, or remove them.`});if(a.length&&(i.meta.issues=[...i.meta.issues??[],...a.map(e=>e.message)],i.meta.issueRules={...i.meta.issueRules,...Object.fromEntries(a.map(e=>[e.message,e.rule]))}),!c.size)return;let h=[...c.values()].map(e=>{let t=Array.from({length:e.refs},(t,n)=>[` `,[`a`,{href:n?`#fnref-${e.id}-${n+1}`:`#fnref-${e.id}`,class:`footnote-backref`},r]]).flat(),n=[...e.content],i=n.at(-1);return Kj(i)&&i[0]===`p`?n[n.length-1]=[...i,...t]:n.push(...t),[`li`,{id:`fn-${e.id}`},...n]}),g=n?[[`hr`,{}]]:[],_=t?[[`h2`,{id:`footnotes`},t]]:[];i.nodes.push([`section`,{class:`footnotes`},...g,..._,[`ol`,{class:`footnotes-list`},...h]])}}}),lM=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,uM=B.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`,R(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:r}=this.options.resize,i=new Set([`src`,`width`,`height`]);return({node:a,getPos:o,HTMLAttributes:s,editor:c})=>{let l=document.createElement(`img`);l.draggable=!1;let u=R(this.options.HTMLAttributes,s);Object.entries(u).forEach(([e,t])=>{if(t!=null)switch(e){case`src`:case`width`:case`height`:break;default:l.setAttribute(e,t)}}),u.src!==null&&(l.src=u.src);let d={...s},f=e=>{typeof e==`string`&&e!==``?l.getAttribute(`src`)!==e&&(l.src=e):(l.hasAttribute(`src`)&&l.removeAttribute(`src`),l.src!==``&&(l.src=``))};f(s.src);let p=new Jm({element:l,editor:c,node:a,getPos:o,onResize:(e,t)=>{l.style.width=`${e}px`,l.style.height=`${t}px`},onCommit:(e,t)=>{let n=o();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:e=>{if(e.type!==a.type)return!1;let t=vf(e,c.extensionManager.attributes.filter(t=>t.type===e.type.name));return Object.keys(d).forEach(e=>{!i.has(e)&&!(e in t)&&l.removeAttribute(e)}),Object.entries(t).forEach(([e,t])=>{i.has(e)||(t==null?l.removeAttribute(e):l.setAttribute(e,t))}),f(t.src),d=t,!0},options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),m=p.dom,h=()=>{m.style.visibility=``,m.style.pointerEvents=``};return m.style.visibility=`hidden`,m.style.pointerEvents=`none`,l.complete&&l.naturalWidth>0?h():(l.onload=h,l.onerror=h),p}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Wm({find:lM,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),dM=`listItem`,fM=`textStyle`,pM=/^\s*([-+*])\s$/,mM=B.create({name:`bulletList`,addOptions(){return{itemTypeName:`listItem`,HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:`block list`,content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul`}]},renderHTML({HTMLAttributes:e}){return[`ul`,R(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>e.type!==`list`||e.ordered?[]:{type:`bulletList`,content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
178
|
+
`):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(dM,this.editor.getAttributes(fM)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Km({find:pM,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Km({find:pM,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(fM),editor:this.editor})),[e]}}),hM=(e,t,n)=>{let{selection:r}=e;if(!r.empty)return null;let{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let a=-1;for(let e=i.depth;e>0;--e)if(i.node(e).type.name===t){a=e;break}if(a<0)return null;let o=i.node(a),s=i.index(a);if(s+1>=o.childCount)return null;let c=o.child(s+1);if(!n.includes(c.type.name))return null;let l=e.schema.nodes[t],u=!1;if(c.forEach(e=>{e.type===l&&e.childCount>1&&(u=!0)}),!u)return null;let d=e.doc.resolve(i.after()).nodeAfter;if(!d||!n.includes(d.type.name))return null;let f=[];return d.forEach(e=>{f.push(e)}),f.length===0?null:{listItemDepth:a,nestedList:d,nestedListPos:i.after(),insertPos:i.after(a),items:f}},gM=(e,t,n,r)=>{let i=hM(e,n,r);if(!i)return!1;let{selection:a}=e,{nestedList:o,nestedListPos:s,insertPos:c,items:l}=i,u=e.tr;u.delete(s,s+o.nodeSize);let d=u.mapping.map(c);return u.insert(d,E.from(l)),u.setSelection(a.map(u.doc,u.mapping)),t&&t(u),!0},_M=(e,t,n)=>gM(e.state,e.view.dispatch,t,n),vM=(e,t)=>z.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>_M(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),yM=[[1e3,`m`],[900,`cm`],[500,`d`],[400,`cd`],[100,`c`],[90,`xc`],[50,`l`],[40,`xl`],[10,`x`],[9,`ix`],[5,`v`],[4,`iv`],[1,`i`]],bM=`abcdefghijklmnopqrstuvwxyz`,xM=String.raw`\d+|[ivxlcdmIVXLCDM]+|${`[a-zA-Z]{1,2}`}`;function SM(e){let t=e,n=``;for(let[e,r]of yM)for(;t>=e;)n+=r,t-=e;return n}function CM(e){return SM(e).toUpperCase()}function wM(e){let t=e.toLowerCase(),n=0,r=0;for(;n<t.length;){let e=!1;for(let[i,a]of yM)if(t.startsWith(a,n)){r+=i,n+=a.length,e=!0;break}if(!e)return 0}return r}function TM(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;let t=wM(e);return t<=0?!1:(e===e.toLowerCase()?SM(t):CM(t))===e}function EM(e){let t=e.toLowerCase();if(t.length===1)return t.charCodeAt(0)-97+1;if(t.length===2){let e=t.charCodeAt(0)-97,n=t.charCodeAt(1)-97;return(e+1)*26+n+1}return 0}function DM(e){if(e<=26)return bM[e-1];let t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?bM[n]:bM[t]+bM[n]}function OM(e){if(e&&!/^\d+$/.test(e)){if(TM(e))return e===e.toLowerCase()?`i`:`I`;if(/^[a-z]{1,2}$/.test(e))return`a`;if(/^[A-Z]{1,2}$/.test(e))return`A`}}function kM(e){if(/^\d+$/.test(e))return parseInt(e,10);let t=OM(e);if(t===`i`||t===`I`)return wM(e);if(t===`a`||t===`A`){let t=EM(e);return t>0?t:1}let n=parseInt(e,10);return Number.isNaN(n)?1:n}function AM(e,t){if(e===`numeric`)return String(t);switch(e){case`a`:return DM(t);case`A`:return DM(t).toUpperCase();case`i`:return SM(t);case`I`:return CM(t);default:return String(t)}}function jM(e){if(e.length===0)return!1;let t=OM(e[0])??`numeric`,n=kM(e[0]);if(n<1)return!1;for(let r=0;r<e.length;r++){let i=AM(t,n+r);if(e[r]!==i)return!1}return!0}function MM(e){return{type:OM(e),start:kM(e)}}function NM(e){let{type:t,start:n}=MM(e),r={};return t&&(r.type=t),n!==1&&(r.start=n),r}function PM(e,t,n=`. `){let r=t+1;if(!e||e===`1`)return`${r}${n}`;switch(e){case`a`:return`${DM(r)}${n}`;case`A`:return`${DM(r).toUpperCase()}${n}`;case`i`:return`${SM(r)}${n}`;case`I`:return`${CM(r)}${n}`;default:return`${r}${n}`}}function FM(e){let t=e.tokens?.[0];return!!(e.text&&e.tokens?.length===1&&t?.type===`list`&&t.ordered&&t.raw===e.text)}function IM(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:`text`,raw:e,text:e}])}var LM=B.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,R(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0){if(FM(e))return{type:`listItem`,content:[{type:`paragraph`,content:IM(e.text||``,t)}]};if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>cm(e,t,e=>{if(e.parentType===`bulletList`)return`- `;if(e.parentType===`orderedList`){var t,n;let r=((t=e.meta)==null||(t=t.parentAttrs)==null?void 0:t.start)||1;return PM((n=e.meta)==null||(n=n.parentAttrs)==null?void 0:n.type,r-1+(e.index||0),`. `)}return`- `},n,{alignNestedToPrefix:n?.parentType===`orderedList`}),addExtensions(){return[vM(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),RM=(e,t)=>{let{$from:n}=t.selection,r=Ju(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},zM=(e,t)=>{let n=RM(e,t);if(!n)return!1;let[,r]=If(t,e,n.$pos.pos+4);return r},BM=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},VM=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Vd(e.state,t)&&BM(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!Vd(e.state,t)||!Wf(e.state))return!1;let{$from:r}=e.state.selection,i=r.depth-1;return r.node(i).type!==e.schema.nodes[t]||r.index(i)!==0?!1:e.chain().liftListItem(t).run()},HM=(e,t)=>{let n=zM(e,t),r=RM(e,t);return!r||!n?!1:n>r.depth},UM=(e,t)=>{let n=zM(e,t),r=RM(e,t);return!r||!n?!1:n<r.depth},WM=(e,t)=>{if(!Vd(e.state,t)||!Uf(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:HM(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():UM(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},GM=(e,t,n)=>{let{state:r}=e,{selection:i}=r;if(!i.empty)return!1;let{$from:a}=i;if(a.parentOffset!==0||!a.parent.isTextblock||Vd(r,t))return!1;let o=Lf(a);if(!o||!n.includes(o.type.name))return!1;let s=o.lastChild;if(!s||s.type.name!==t)return!1;let c=a.parent;if(!s.canReplace(s.childCount,s.childCount,E.from(c)))return!1;let l=a.before(),u=a.after(),d=l-2;return e.commands.command(({tr:e,dispatch:t})=>(t&&(e.delete(l,u).insert(d,E.from(c)),e.setSelection(A.create(e.doc,d+1)),e.scrollIntoView()),!0))},KM=z.create({name:`listKeymap`,addOptions(){return{listTypes:[{itemName:`listItem`,wrapperNames:[`bulletList`,`orderedList`]},{itemName:`taskItem`,wrapperNames:[`taskList`]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&WM(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&WM(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&VM(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&VM(e,n,r)&&(t=!0)}),t},Tab:({editor:e})=>{for(let{itemName:t,wrapperNames:n}of this.options.listTypes)if(e.state.schema.nodes[t]!==void 0&&GM(e,t,n))return!0;return!1}}}}),qM=RegExp(`^(\\s*)(${xM})([.)])\\s+(.*)$`),JM=/^\s/,YM={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function XM(e){return qM.test(e.trimStart())}function ZM(e){let t=e.trimStart();return YM.bulletItem.test(t)||XM(t)||YM.heading.test(t)||YM.thematicBreak.test(t)&&!t.startsWith(`-`)||/^>\s?/.test(t)||YM.codeFence.test(t)||YM.blockMath.test(t)}function QM(e){return Object.values(YM).some(t=>t.test(e))}function $M(e){let t=[],n=[],r=!1;return e.forEach(e=>{r?n.push(e):e.trim()===``||t.length>0&&ZM(e)?(r=!0,n.push(e)):t.push(e)}),{paragraphLines:t,blockLines:n}}function eN(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(qM);if(!a)break;let[,o,s,c,l]=a,u=o.length,d=parseInt(s,10),f=isNaN(d)?OM(s):void 0,p=isNaN(d)?kM(s):d,m=[l],h=n+1,g=[i],_=!1;for(;h<e.length;){let t=e[h];if(t.match(qM))break;if(t.trim()===``)g.push(t),m.push(``),_=!0,h+=1;else if(t.match(JM)){let e=t.length-t.trimStart().length,n=u+s.length+1;g.push(t),m.push(t.slice(Math.min(e,n))),h+=1}else{if(_||QM(t))break;g.push(t),m.push(t),h+=1}}t.push({indent:u,number:p,type:f,content:m.join(`
|
|
179
179
|
`).trim(),contentLines:m,raw:g.join(`
|
|
180
|
-
`)}),r=h,n=h}return[t,r]}var
|
|
181
|
-
`).filter(e=>e.trim().length>0);if(t.length===0)return null;let n=[];for(let e of t){let t=e.trim().match(
|
|
180
|
+
`)}),r=h,n=h}return[t,r]}var tN=RegExp(`^(${xM})([.)])\\s+(.+)$`);function nN(e){let t=e.split(`
|
|
181
|
+
`).filter(e=>e.trim().length>0);if(t.length===0)return null;let n=[];for(let e of t){let t=e.trim().match(tN);if(!t)return null;n.push({marker:t[1],content:t[3]})}return jM(n.map(e=>e.marker))?{type:`orderedList`,attrs:NM(n[0].marker),content:n.map(e=>({type:`listItem`,content:[{type:`paragraph`,content:[{type:`text`,text:e.content}]}]}))}:null}function rN(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let{paragraphLines:o,blockLines:s}=$M(a.contentLines),c=o.join(`
|
|
182
182
|
`).trim(),l=[];c&&l.push({type:`paragraph`,raw:c,tokens:n.inlineTokens(c)});let u=s.join(`
|
|
183
|
-
`).trim();if(u){let e=n.blockTokens(u);l.push(...e)}let d=i+1,f=[];for(;d<e.length&&e[d].indent>t;)f.push(e[d]),d+=1;if(f.length>0){let e=
|
|
184
|
-
`)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function
|
|
185
|
-
`,r);if(t===-1)return n.push(e.slice(r)),n;n.push(e.slice(r,t)),r=t+1}return n}function
|
|
186
|
-
`),n=t===-1?e:e.slice(0,t);if(!
|
|
187
|
-
`):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:()=>-1,tokenize:(e,t,n)=>{let[r,i,a]=
|
|
188
|
-
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(
|
|
189
|
-
`):``,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=
|
|
190
|
-
`).map(e=>!e.includes(`|`)||!e.includes("`")?e:
|
|
191
|
-
`)}function
|
|
192
|
-
`):e}function
|
|
193
|
-
`):
|
|
194
|
-
`,d=Array.from({length:i}).map((e,t)=>c&&s[t]&&s[t].text||``);return u+=`| ${d.map((e,t)=>o(e,a[t])).join(` | `)} |\n`,u+=`| ${a.map((e,t)=>{let n=Math.max(3,e),r=l[t];return r===`left`?`:${`-`.repeat(n)}`:r===`right`?`${`-`.repeat(n)}:`:r===`center`?`:${`-`.repeat(n)}:`:`-`.repeat(n)}).join(` | `)} |\n`,(c?r.slice(1):r).forEach(e=>{u+=`| ${Array.from({length:i}).fill(0).map((t,n)=>o(e[n]&&e[n].text||``,a[n])).join(` | `)} |\n`}),u}var
|
|
183
|
+
`).trim();if(u){let e=n.blockTokens(u);l.push(...e)}let d=i+1,f=[];for(;d<e.length&&e[d].indent>t;)f.push(e[d]),d+=1;if(f.length>0){let e=rN(f,Math.min(...f.map(e=>e.indent)),n);l.push({type:`list`,ordered:!0,start:f[0].number,typeMarker:f[0].type,items:e,raw:f.map(e=>e.raw).join(`
|
|
184
|
+
`)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function iN(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var aN=64;function oN(e,t){let n=[],r=0;for(;n.length<t;){let t=e.indexOf(`
|
|
185
|
+
`,r);if(t===-1)return n.push(e.slice(r)),n;n.push(e.slice(r,t)),r=t+1}return n}function sN(e){let t=e.indexOf(`
|
|
186
|
+
`),n=t===-1?e:e.slice(0,t);if(!qM.test(n))return[[],0,[]];let r=aN,i=oN(e,r),a=eN(i);for(;a[1]===i.length&&i.length===r;)r*=2,i=oN(e,r),a=eN(i);return[a[0],a[1],i]}var cN=`listItem`,lN=`textStyle`,uN=/^(\d+)\.\s$/;function dN(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 fN=B.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=dN(n);if(e)return e}let r=e.querySelector(`li`);if(r){let e=r.getAttribute(`style`);if(e){let t=dN(e);if(t)return t}}return null}}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,type:n,...r}=e,i=R(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?iN(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,`
|
|
187
|
+
`):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:()=>-1,tokenize:(e,t,n)=>{let[r,i,a]=sN(e);if(r.length===0)return;let o=rN(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(`
|
|
188
|
+
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(cN,this.editor.getAttributes(lN)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new M({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=nN(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=Km({find:uN,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Km({find:uN,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(lN)}),joinPredicate:e,editor:this.editor})),[t]}}),pN=/^\s*(\[([( |x])?\])\s$/,mN=`position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0`,hN=(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`}`},gN=B.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`,R(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)=>cm(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addExtensions(){return this.options.nested?[vM(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=mN;let l=e=>{let t=hN(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=vf(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[Km({find:pN,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),_N=B.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`,R(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,`
|
|
189
|
+
`):``,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=am(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=am(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()}}});z.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(mM.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(LM.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(KM.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(fN.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(gN.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(_N.configure(this.options.taskList)),e}});function vN(e){return e===`left`||e===`right`||e===`center`?e:null}function yN(e){let t=(e.style.textAlign||``).trim().toLowerCase(),n=(e.getAttribute(`align`)||``).trim().toLowerCase();return vN(t||n)}function bN(e){return vN(e?.align)}function xN(){return{default:null,parseHTML:e=>yN(e),renderHTML:e=>{let t=vN(e.align);return im(t)?{style:`text-align: ${t}`}:{}}}}function SN(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 CN(e){let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):SN(e)}var wN=/[ \t\r\n\f]+/g;function TN(e){return e.children.length>0?!1:(e.textContent??``).replace(wN,``)===``}function EN(e){let t=e.createAndFill();if(!t)throw Error(`[tiptap error]: "${e.name}" has no default content to backfill.`);return t.content}function DN(e,t,n){if(!(n in t))return;let r=t[n];(r===1||r===`1`||r==null)&&delete e[n]}var ON=B.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:CN},align:xN()}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`,getAttrs:e=>TN(e)?{}:!1,getContent:(e,t)=>EN(t.nodes[this.name])},{tag:`td`}]},renderHTML({HTMLAttributes:e}){let t=R(this.options.HTMLAttributes,e);return DN(t,e,`colspan`),DN(t,e,`rowspan`),[`td`,t,0]}}),kN=B.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:CN},align:xN()}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`,getAttrs:e=>TN(e)?{}:!1,getContent:(e,t)=>EN(t.nodes[this.name])},{tag:`th`}]},renderHTML({HTMLAttributes:e}){let t=R(this.options.HTMLAttributes,e);return DN(t,e,`colspan`),DN(t,e,`rowspan`),[`th`,t,0]}}),AN=B.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,R(this.options.HTMLAttributes,e),0]}});function jN(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function MN(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]=jN(r,l);c.style.setProperty(e,t)}c=c.nextSibling}else{let e=document.createElement(`col`),[n,i]=jN(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 NN=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`)),MN(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,MN(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 PN(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]=jN(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 FN(e,t){return t?e.createChecked(null,t):e.createAndFill()}function IN(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 LN(e,t,n,r,i){let a=IN(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=FN(a.cell,i);if(e&&s.push(e),r){let e=FN(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 RN(e){return e instanceof V}var zN=({editor:e})=>{let{selection:t}=e.state;if(!RN(t))return!1;let n=0;return cf(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 BN(e,t){let n=e.mapping.map(t);if(cf(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(A.near(e.doc.resolve(i),-1))}function VN(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 HN(e){return e.split(`
|
|
190
|
+
`).map(e=>!e.includes(`|`)||!e.includes("`")?e:VN(e)).join(`
|
|
191
|
+
`)}function UN(e){return(e||``).replaceAll(``,` `).replace(/\s+/g,` `).trim()}function WN(e,t){return t?e.split(t).join(`
|
|
192
|
+
`):e}function GN(e){return e.replace(/\\.|\|/g,e=>e===`|`?`\\|`:e)}function KN(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=>WN(t.renderChildren(e),n.cellLineSeparator)).join(`
|
|
193
|
+
`):WN(e.content?t.renderChildren(e.content):``,n.cellLineSeparator);let a=GN(UN(r.replace(/[ \t]*\r?\n[ \t]*/g,`<br>`))),o=e.type===`tableHeader`,s=bN(e.attrs);i.push({text:a,isHeader:o,align:s})}),r.push(i)});let i=r.reduce((e,t)=>Math.max(e,t.length),0);if(i===0)return``;let a=Array.from({length:i}).fill(0);r.forEach(e=>{for(let t=0;t<i;t+=1){let n=(e[t]?.text||``).length;n>a[t]&&(a[t]=n),a[t]<3&&(a[t]=3)}});let o=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),s=r[0],c=s.some(e=>e.isHeader),l=Array.from({length:i}).fill(null);r.forEach(e=>{for(let t=0;t<i;t+=1)!l[t]&&e[t]?.align&&(l[t]=e[t].align)});let u=`
|
|
194
|
+
`,d=Array.from({length:i}).map((e,t)=>c&&s[t]&&s[t].text||``);return u+=`| ${d.map((e,t)=>o(e,a[t])).join(` | `)} |\n`,u+=`| ${a.map((e,t)=>{let n=Math.max(3,e),r=l[t];return r===`left`?`:${`-`.repeat(n)}`:r===`right`?`${`-`.repeat(n)}:`:r===`center`?`:${`-`.repeat(n)}:`:`-`.repeat(n)}).join(` | `)} |\n`,(c?r.slice(1):r).forEach(e=>{u+=`| ${Array.from({length:i}).fill(0).map((t,n)=>o(e[n]&&e[n].text||``,a[n])).join(` | `)} |\n`}),u}var qN=new N(`preserveCellSelectionOnContextMenu`);function JN(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(n)return n.pos;if(!(t.target instanceof Node))return null;try{return e.posAtDOM(t.target,0)}catch{return null}}function YN(e,t){let n=!1;return e.forEachCell((e,r)=>{t>=r&&t<r+e.nodeSize&&(n=!0)}),n}function XN(){return new M({key:qN,props:{handleDOMEvents:{mousedown(e,t){if(t.button!==2)return!1;let{selection:n}=e.state;if(!RN(n)||n.ranges.length<2)return!1;let r=JN(e,t);return r==null||!YN(n,r)?!1:(t.preventDefault(),!0)}}}})}var ZN=B.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:NN,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:`tableRow+`,tableRole:`table`,isolating:!0,group:`block`,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=PN(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,R(this.options.HTMLAttributes,t,{style:o()}),n,[`tbody`,0]];return this.options.renderWrapper?[`div`,{class:`tableWrapper`},s]:s},parseMarkdown:(e,t)=>{let n=[],r=Array.isArray(e.align)?e.align:[];if(e.header){let i=[];e.header.forEach((e,n)=>{let a=vN(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableHeader`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}return e.rows&&e.rows.forEach(e=>{let i=[];e.forEach((e,n)=>{let a=vN(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableCell`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>KN(e,t),markdownTokenizer:{name:`table`,level:`block`,start:e=>{let t=e.split(`
|
|
195
195
|
`);if(t.length<2)return-1;let n=t[1];return!/^[ \t|:]*-[ \t|:-]*$/.test(n)||!n.includes(`|`)?-1:t[0].includes(`|`)?0:-1},tokenize(e,t,n){let r=e.indexOf(`
|
|
196
196
|
|
|
197
197
|
`),i=r>=0?e.slice(0,r):e,a=i.split(`
|
|
198
|
-
`);if(a.length<2)return;let o=a[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(o)||!o.includes(`|`))return;let s=
|
|
198
|
+
`);if(a.length<2)return;let o=a[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(o)||!o.includes(`|`))return;let s=HN(i);if(s===i)return;let c=n.blockTokens(s)[0];if(c?.type!==`table`||!c.raw)return;let l=c.raw.split(`
|
|
199
199
|
`).length,u=e.split(`
|
|
200
200
|
`).slice(0,l).join(`
|
|
201
|
-
`);return{...c,raw:u}}},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=
|
|
201
|
+
`);return{...c,raw:u}}},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=LN(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(A.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>Gh(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>Kh(e,t),deleteColumn:()=>({state:e,dispatch:t})=>{let n=cf(e.selection.$from,e=>e.type.name===`table`);return Jh(e,t&&(e=>{n&&BN(e,n.pos),t(e)}))},addRowBefore:()=>({state:e,dispatch:t})=>Zh(e,t),addRowAfter:()=>({state:e,dispatch:t})=>Qh(e,t),deleteRow:()=>({state:e,dispatch:t})=>{let n=cf(e.selection.$from,e=>e.type.name===`table`);return eg(e,t&&(e=>{n&&BN(e,n.pos),t(e)}))},deleteTable:()=>({state:e,dispatch:t})=>pg(e,t),mergeCells:()=>({state:e,dispatch:t})=>rg(e,t),splitCell:()=>({state:e,dispatch:t})=>ig(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>lg(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>lg(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>ug(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>rg(e,t)?!0:ig(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>og(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>fg(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>fg(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&Vh(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=V.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:zN,"Mod-Backspace":zN,Delete:zN,"Mod-Delete":zN}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Ig({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Xg({allowTableNodeSelection:this.options.allowTableNodeSelection}),XN()]},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=R(this.options.HTMLAttributes,r);return new t(e,this.options.cellMinWidth,n,i)}},extendNodeSchema(e){return{tableRole:L(I(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}}),QN=z.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(ZN.configure(this.options.table)),this.options.tableCell!==!1&&e.push(ON.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(kN.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(AN.configure(this.options.tableRow)),e}}),$N=new WeakSet,eP=new WeakSet;function tP(e){let t=e;return $N.add(t),t}function nP(e){return Array.isArray(e)&&$N.has(e)}function rP(e){return e.flatMap(e=>e==null?[]:Array.isArray(e)&&eP.has(e)&&!nP(e)?rP(e):[e])}function iP(e,t){if(e===`slot`)return 0;if(e instanceof Function){let n=e(t);return Array.isArray(n)&&!nP(n)&&!eP.has(n)?tP(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(nP(n))return tP([e,r,n]);if(n.length===0)return tP([e,r]);let t=rP(n);return t.length===0?tP([e,r]):tP([e,r,...t])}return tP(n==null?[e,r]:[e,r,n])}var aP=(e,t)=>iP(e,t),oP=(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 O(n,0,0);return e.replace(l,i.after(),r),e.setSelection(A.create(e.doc,l+n.size)),e.scrollIntoView(),t(e),!0})},sP=/^\s*>\s$/,cP=B.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return aP(`blockquote`,{...R(this.options.HTMLAttributes,e),children:aP(`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(`
|
|
202
202
|
`).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
|
|
203
203
|
`))}),n.join(`
|
|
204
204
|
>
|
|
205
|
-
`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>
|
|
206
|
-
`):`\`\`\`${r}\n\n\`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??
|
|
205
|
+
`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>oP(this.editor,this.type)}},addInputRules(){return[Km({find:sP,type:this.type})]}}),lP=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,uP=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,dP=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,fP=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,pP=ym.create({name:`bold`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`strong`},{tag:`b`,getAttrs:e=>e.style.fontWeight!==`normal`&&null},{style:`font-weight=400`,clearMark:e=>e.type.name===this.name},{style:`font-weight`,getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return aP(`strong`,{...R(this.options.HTMLAttributes,e),children:aP(`slot`,{})})},markdownTokenName:`strong`,parseMarkdown:(e,t)=>t.applyMark(`bold`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<strong>`,close:`</strong>`}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Um({find:lP,type:this.type}),Um({find:dP,type:this.type})]},addPasteRules(){return[Ym({find:uP,type:this.type}),Ym({find:fP,type:this.type})]}}),mP=e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},hP=e=>{let t=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=t.exec(e))!==null;)r.index>0&&e[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n};function gP(e){let t=new Set((e.match(/`+/g)||[]).map(e=>e.length)),n=1;for(;t.has(n);)n+=1;return n}var _P=ym.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,R(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t,n)=>{var r;if(!e.content)return``;let i=typeof(n==null||(r=n.meta)==null?void 0:r.markText)==`string`?n.meta.markText:``,a="`".repeat(gP(i)),o=i.startsWith("`")||i.endsWith("`")?` `:``;return`${a}${o}${t.renderChildren(e.content)}${o}${a}`},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Um({find:mP,type:this.type})]},addPasteRules(){return[Ym({find:hP,type:this.type})]}}),vP=4,yP=/^```([a-z]+)?[\s\n]$/,bP=/^~~~([a-z]+)?[\s\n]$/,xP=B.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:vP,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,R(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
|
|
206
|
+
`):`\`\`\`${r}\n\n\`\`\``,n},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,`paragraph`,e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??vP,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
|
|
207
207
|
`,`
|
|
208
208
|
`).split(`
|
|
209
209
|
`).map(e=>o+e).join(`
|
|
210
|
-
`);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??
|
|
210
|
+
`);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??vP,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,`
|
|
211
211
|
`,`
|
|
212
212
|
`).split(`
|
|
213
|
-
`),c=0,l=0,u=r-a;for(let e=0;e<s.length;e+=1){if(l+s[e].length>=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e<c;e+=1)p+=s[e].length+1;return e.delete(p,p+f),r-p<=f&&e.setSelection(
|
|
213
|
+
`),c=0,l=0,u=r-a;for(let e=0;e<s.length;e+=1){if(l+s[e].length>=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e<c;e+=1)p+=s[e].length+1;return e.delete(p,p+f),r-p<=f&&e.setSelection(A.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
|
|
214
214
|
`,`
|
|
215
215
|
`).split(`
|
|
216
216
|
`).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
|
|
217
217
|
`);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
|
|
218
218
|
|
|
219
|
-
`);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:e})=>{if(!this.options.exitOnArrowUp)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type||r.parentOffset!==0)return!1;let a=r.before();return a>0?!1:e.commands.insertDefaultBlock({pos:a})},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(
|
|
220
|
-
`));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(
|
|
219
|
+
`);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:e})=>{if(!this.options.exitOnArrowUp)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type||r.parentOffset!==0)return!1;let a=r.before();return a>0?!1:e.commands.insertDefaultBlock({pos:a})},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(k.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[Gm({find:yP,type:this.type,getAttributes:e=>({language:e[1]})}),Gm({find:bP,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new M({key:new N(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
|
|
220
|
+
`));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(A.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),SP=B.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
221
221
|
|
|
222
|
-
`):``}),
|
|
222
|
+
`):``}),CP=B.create({name:`hardBreak`,markdownTokenName:`br`,addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,R(this.options.HTMLAttributes,e)]},renderText(){return`
|
|
223
223
|
`},renderMarkdown:()=>`
|
|
224
|
-
`,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),TP=z.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,L(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Km({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),EP=z.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,L(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!em(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return Yf(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(k.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(A.create(t.doc,n.pos)):t.setSelection(k.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(k.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Gm({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),DP=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,OP=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,kP=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,AP=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,jP=bm.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,L(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<em>`,close:`</em>`}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Wm({find:DP,type:this.type}),Wm({find:kP,type:this.type})]},addPasteRules(){return[Xm({find:OP,type:this.type}),Xm({find:AP,type:this.type})]}}),MP=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,NP=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`,PP=`numeric`,FP=`ascii`,IP=`alpha`,LP=`asciinumeric`,RP=`alphanumeric`,zP=`domain`,BP=`emoji`,VP=`scheme`,HP=`slashscheme`,UP=`whitespace`;function WP(e,t){return e in t||(t[e]=[]),t[e]}function GP(e,t,n){t[PP]&&(t[LP]=!0,t[RP]=!0),t[FP]&&(t[LP]=!0,t[IP]=!0),t[LP]&&(t[RP]=!0),t[IP]&&(t[RP]=!0),t[RP]&&(t[zP]=!0),t[BP]&&(t[zP]=!0);for(let r in t){let t=WP(r,n);t.indexOf(e)<0&&t.push(e)}}function KP(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function qP(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}qP.groups={},qP.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=qP.groups;let i;return t&&t.j?i=t:(i=new qP(t),n&&r&&GP(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=qP.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new qP,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new qP,a&&(r&&(o.t&&typeof o.t==`string`?GP(a,Object.assign(KP(o.t,r),n),r):n&&GP(a,n,r)),o.t=a),i.j[e]=o,o}};var q=(e,t,n,r,i)=>e.ta(t,n,r,i),J=(e,t,n,r,i)=>e.tr(t,n,r,i),JP=(e,t,n,r,i)=>e.ts(t,n,r,i),Y=(e,t,n,r,i)=>e.tt(t,n,r,i),YP=`WORD`,XP=`UWORD`,ZP=`ASCIINUMERICAL`,QP=`ALPHANUMERICAL`,$P=`LOCALHOST`,eF=`TLD`,tF=`UTLD`,nF=`SCHEME`,rF=`SLASH_SCHEME`,iF=`NUM`,aF=`WS`,oF=`NL`,sF=`OPENBRACE`,cF=`CLOSEBRACE`,lF=`OPENBRACKET`,uF=`CLOSEBRACKET`,dF=`OPENPAREN`,fF=`CLOSEPAREN`,pF=`OPENANGLEBRACKET`,mF=`CLOSEANGLEBRACKET`,hF=`FULLWIDTHLEFTPAREN`,gF=`FULLWIDTHRIGHTPAREN`,_F=`LEFTCORNERBRACKET`,vF=`RIGHTCORNERBRACKET`,yF=`LEFTWHITECORNERBRACKET`,bF=`RIGHTWHITECORNERBRACKET`,xF=`FULLWIDTHLESSTHAN`,SF=`FULLWIDTHGREATERTHAN`,CF=`AMPERSAND`,wF=`APOSTROPHE`,TF=`ASTERISK`,EF=`AT`,DF=`BACKSLASH`,OF=`BACKTICK`,kF=`CARET`,AF=`COLON`,jF=`COMMA`,MF=`DOLLAR`,NF=`DOT`,PF=`EQUALS`,FF=`EXCLAMATION`,IF=`HYPHEN`,LF=`PERCENT`,RF=`PIPE`,zF=`PLUS`,BF=`POUND`,VF=`QUERY`,HF=`QUOTE`,UF=`FULLWIDTHMIDDLEDOT`,WF=`SEMI`,GF=`SLASH`,KF=`TILDE`,qF=`UNDERSCORE`,JF=`EMOJI`,YF=`SYM`,XF=Object.freeze({__proto__:null,ALPHANUMERICAL:QP,AMPERSAND:CF,APOSTROPHE:wF,ASCIINUMERICAL:ZP,ASTERISK:TF,AT:EF,BACKSLASH:DF,BACKTICK:OF,CARET:kF,CLOSEANGLEBRACKET:mF,CLOSEBRACE:cF,CLOSEBRACKET:uF,CLOSEPAREN:fF,COLON:AF,COMMA:jF,DOLLAR:MF,DOT:NF,EMOJI:JF,EQUALS:PF,EXCLAMATION:FF,FULLWIDTHGREATERTHAN:SF,FULLWIDTHLEFTPAREN:hF,FULLWIDTHLESSTHAN:xF,FULLWIDTHMIDDLEDOT:UF,FULLWIDTHRIGHTPAREN:gF,HYPHEN:IF,LEFTCORNERBRACKET:_F,LEFTWHITECORNERBRACKET:yF,LOCALHOST:$P,NL:oF,NUM:iF,OPENANGLEBRACKET:pF,OPENBRACE:sF,OPENBRACKET:lF,OPENPAREN:dF,PERCENT:LF,PIPE:RF,PLUS:zF,POUND:BF,QUERY:VF,QUOTE:HF,RIGHTCORNERBRACKET:vF,RIGHTWHITECORNERBRACKET:bF,SCHEME:nF,SEMI:WF,SLASH:GF,SLASH_SCHEME:rF,SYM:YF,TILDE:KF,TLD:eF,UNDERSCORE:qF,UTLD:tF,UWORD:XP,WORD:YP,WS:aF}),ZF=/[a-z]/,QF=/\p{L}/u,$F=/\p{Emoji}/u,eI=/\d/,tI=/\s/,nI=`\r`,rI=`
|
|
225
|
-
`,iI=`️`,aI=``,oI=``,sI=null,cI=null;function lI(e=[]){let t={};
|
|
224
|
+
`,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),wP=B.create({name:`heading`,addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:`inline*`,group:`block`,defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,R(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${t.renderChildren(e.content)}`:``},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,`paragraph`,e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Gm({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),TP=B.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,R(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!$p(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return Jf(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(A.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(j.create(t.doc,n.pos)):t.setSelection(A.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(A.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Wm({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),EP=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,DP=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,OP=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,kP=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,AP=ym.create({name:`italic`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`em`},{tag:`i`,getAttrs:e=>e.style.fontStyle!==`normal`&&null},{style:`font-style=normal`,clearMark:e=>e.type.name===this.name},{style:`font-style=italic`}]},renderHTML({HTMLAttributes:e}){return[`em`,R(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:`em`,parseMarkdown:(e,t)=>t.applyMark(`italic`,t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:`<em>`,close:`</em>`}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Um({find:EP,type:this.type}),Um({find:OP,type:this.type})]},addPasteRules(){return[Ym({find:DP,type:this.type}),Ym({find:kP,type:this.type})]}}),jP=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,MP=`ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2`,NP=`numeric`,PP=`ascii`,FP=`alpha`,IP=`asciinumeric`,LP=`alphanumeric`,RP=`domain`,zP=`emoji`,BP=`scheme`,VP=`slashscheme`,HP=`whitespace`;function UP(e,t){return e in t||(t[e]=[]),t[e]}function WP(e,t,n){t[NP]&&(t[IP]=!0,t[LP]=!0),t[PP]&&(t[IP]=!0,t[FP]=!0),t[IP]&&(t[LP]=!0),t[FP]&&(t[LP]=!0),t[LP]&&(t[RP]=!0),t[zP]&&(t[RP]=!0);for(let r in t){let t=UP(r,n);t.indexOf(e)<0&&t.push(e)}}function GP(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function KP(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}KP.groups={},KP.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=KP.groups;let i;return t&&t.j?i=t:(i=new KP(t),n&&r&&WP(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=KP.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new KP,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new KP,a&&(r&&(o.t&&typeof o.t==`string`?WP(a,Object.assign(GP(o.t,r),n),r):n&&WP(a,n,r)),o.t=a),i.j[e]=o,o}};var J=(e,t,n,r,i)=>e.ta(t,n,r,i),qP=(e,t,n,r,i)=>e.tr(t,n,r,i),JP=(e,t,n,r,i)=>e.ts(t,n,r,i),Y=(e,t,n,r,i)=>e.tt(t,n,r,i),YP=`WORD`,XP=`UWORD`,ZP=`ASCIINUMERICAL`,QP=`ALPHANUMERICAL`,$P=`LOCALHOST`,eF=`TLD`,tF=`UTLD`,nF=`SCHEME`,rF=`SLASH_SCHEME`,iF=`NUM`,aF=`WS`,oF=`NL`,sF=`OPENBRACE`,cF=`CLOSEBRACE`,lF=`OPENBRACKET`,uF=`CLOSEBRACKET`,dF=`OPENPAREN`,fF=`CLOSEPAREN`,pF=`OPENANGLEBRACKET`,mF=`CLOSEANGLEBRACKET`,hF=`FULLWIDTHLEFTPAREN`,gF=`FULLWIDTHRIGHTPAREN`,_F=`LEFTCORNERBRACKET`,vF=`RIGHTCORNERBRACKET`,yF=`LEFTWHITECORNERBRACKET`,bF=`RIGHTWHITECORNERBRACKET`,xF=`FULLWIDTHLESSTHAN`,SF=`FULLWIDTHGREATERTHAN`,CF=`AMPERSAND`,wF=`APOSTROPHE`,TF=`ASTERISK`,EF=`AT`,DF=`BACKSLASH`,OF=`BACKTICK`,kF=`CARET`,AF=`COLON`,jF=`COMMA`,MF=`DOLLAR`,NF=`DOT`,PF=`EQUALS`,FF=`EXCLAMATION`,IF=`HYPHEN`,LF=`PERCENT`,RF=`PIPE`,zF=`PLUS`,BF=`POUND`,VF=`QUERY`,HF=`QUOTE`,UF=`FULLWIDTHMIDDLEDOT`,WF=`SEMI`,GF=`SLASH`,KF=`TILDE`,qF=`UNDERSCORE`,JF=`EMOJI`,YF=`SYM`,XF=Object.freeze({__proto__:null,ALPHANUMERICAL:QP,AMPERSAND:CF,APOSTROPHE:wF,ASCIINUMERICAL:ZP,ASTERISK:TF,AT:EF,BACKSLASH:DF,BACKTICK:OF,CARET:kF,CLOSEANGLEBRACKET:mF,CLOSEBRACE:cF,CLOSEBRACKET:uF,CLOSEPAREN:fF,COLON:AF,COMMA:jF,DOLLAR:MF,DOT:NF,EMOJI:JF,EQUALS:PF,EXCLAMATION:FF,FULLWIDTHGREATERTHAN:SF,FULLWIDTHLEFTPAREN:hF,FULLWIDTHLESSTHAN:xF,FULLWIDTHMIDDLEDOT:UF,FULLWIDTHRIGHTPAREN:gF,HYPHEN:IF,LEFTCORNERBRACKET:_F,LEFTWHITECORNERBRACKET:yF,LOCALHOST:$P,NL:oF,NUM:iF,OPENANGLEBRACKET:pF,OPENBRACE:sF,OPENBRACKET:lF,OPENPAREN:dF,PERCENT:LF,PIPE:RF,PLUS:zF,POUND:BF,QUERY:VF,QUOTE:HF,RIGHTCORNERBRACKET:vF,RIGHTWHITECORNERBRACKET:bF,SCHEME:nF,SEMI:WF,SLASH:GF,SLASH_SCHEME:rF,SYM:YF,TILDE:KF,TLD:eF,UNDERSCORE:qF,UTLD:tF,UWORD:XP,WORD:YP,WS:aF}),ZF=/[a-z]/,QF=/\p{L}/u,$F=/\p{Emoji}/u,eI=/\d/,tI=/\s/,nI=`\r`,rI=`
|
|
225
|
+
`,iI=`️`,aI=``,oI=``,sI=null,cI=null;function lI(e=[]){let t={};KP.groups=t;let n=new KP;sI??=pI(jP),cI??=pI(MP),Y(n,`'`,wF),Y(n,`{`,sF),Y(n,`}`,cF),Y(n,`[`,lF),Y(n,`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t),WP(tF,{utld:!0,alpha:!0},t),fI(n,`file`,nF,YP,p),fI(n,`mailto`,nF,YP,p),fI(n,`http`,rF,YP,p),fI(n,`https`,rF,YP,p),fI(n,`ftp`,rF,YP,p),fI(n,`ftps`,rF,YP,p),WP(nF,{scheme:!0,ascii:!0},t),WP(rF,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[BP]:!0}:{[VP]:!0};r.indexOf(`-`)>=0?i[RP]=!0:ZF.test(r)?eI.test(r)?i[IP]=!0:i[PP]=!0:i[NP]=!0,JP(n,r,r,i)}return JP(n,`localhost`,$P,{ascii:!0}),n.jd=new KP(YF),{start:n,tokens:Object.assign({groups:t},XF)}}function uI(e,t){let n=dI(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function dI(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function fI(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new KP(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new KP(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function pI(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var mI={defaultProtocol:`http`,events:null,format:gI,formatHref:gI,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function hI(e,t=null){let n=Object.assign({},mI);e&&(n=Object.assign(n,e instanceof hI?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}hI.prototype={o:mI,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:mI[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function gI(e){return e}function _I(e,t){this.t=`token`,this.v=e,this.tk=t}_I.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=mI.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function vI(e,t){class n extends _I{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var yI=vI(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),bI=vI(`text`),xI=vI(`nl`),SI=vI(`url`,{isLink:!0,toHref(e=mI.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==$P&&e[1].t===AF}}),CI=e=>new KP(e);function wI({groups:e}){let t=e.domain.concat([CF,TF,EF,DF,OF,kF,MF,PF,IF,iF,LF,RF,zF,BF,GF,YF,KF,qF]),n=[wF,AF,jF,NF,FF,LF,VF,HF,WF,pF,mF,sF,cF,uF,lF,dF,fF,hF,gF,_F,vF,yF,bF,xF,SF],r=[CF,wF,TF,DF,OF,kF,MF,PF,IF,sF,cF,LF,RF,zF,BF,VF,GF,YF,KF,qF],i=CI(),a=Y(i,KF);J(a,r,a),J(a,e.domain,a);let o=CI(),s=CI(),c=CI();J(i,e.domain,o),J(i,e.scheme,s),J(i,e.slashscheme,c),J(o,r,a),J(o,e.domain,o);let l=Y(o,EF);Y(a,EF,l),Y(s,EF,l),Y(c,EF,l);let u=Y(a,NF);J(u,r,a),J(u,e.domain,a);let d=CI();J(l,e.domain,d),J(d,e.domain,d);let f=Y(d,NF);J(f,e.domain,d);let p=CI(yI);J(f,e.tld,p),J(f,e.utld,p),Y(l,$P,p);let m=Y(d,IF);Y(m,IF,m),J(m,e.domain,d),J(p,e.domain,d),Y(p,NF,f),Y(p,IF,m);let h=Y(o,IF),g=Y(o,NF);Y(h,IF,h),J(h,e.domain,o),J(g,r,a),J(g,e.domain,o);let _=CI(SI);J(g,e.tld,_),J(g,e.utld,_),J(_,e.domain,o),J(_,r,a),Y(_,NF,g),Y(_,IF,h),Y(_,EF,l);let v=Y(_,AF),y=CI(SI);J(v,e.numeric,y);let b=CI(SI),x=CI();J(b,t,b),J(b,n,x),J(x,t,b),J(x,n,x),Y(_,GF,b),Y(y,GF,b);let S=Y(s,AF),C=Y(Y(Y(c,AF),GF),GF);J(s,e.domain,o),Y(s,NF,g),Y(s,IF,h),J(c,e.domain,o),Y(c,NF,g),Y(c,IF,h),J(S,e.domain,b),Y(S,GF,b),Y(S,VF,b),J(C,e.domain,b),J(C,t,b),Y(C,GF,b);let ee=[[sF,cF],[lF,uF],[dF,fF],[pF,mF],[hF,gF],[_F,vF],[yF,bF],[xF,SF]];for(let e=0;e<ee.length;e++){let[r,i]=ee[e],a=Y(b,r);Y(x,r,a);let o=CI(SI);J(a,t,o);let s=CI();J(a,n,s),Y(a,i,b),J(o,t,o),J(o,n,s),J(s,t,o),J(s,n,s),Y(o,i,b),Y(s,i,b)}return Y(i,$P,_),Y(i,oF,xI),{start:i,tokens:XF}}function TI(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(EI(bI,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(EI(e,t,r))}}return o.length>0&&a.push(EI(bI,t,o)),a}function EI(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var DI=typeof console<`u`&&console&&console.warn||(()=>{}),OI=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,X={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function kI(){return KP.groups={},X.scanner=null,X.parser=null,X.tokenQueue=[],X.pluginQueue=[],X.customSchemes=[],X.initialized=!1,X}function AI(e,t=!1){if(X.initialized&&DI(`linkifyjs: already initialized - will not register custom scheme "${e}" ${OI}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
|
|
226
226
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
227
227
|
2. Cannot start or end with "-"
|
|
228
|
-
3. "-" cannot repeat`);X.customSchemes.push([e,t])}function jI(){X.scanner=lI(X.customSchemes);for(let e=0;e<X.tokenQueue.length;e++)X.tokenQueue[e][1]({scanner:X.scanner});X.parser=wI(X.scanner.tokens);for(let e=0;e<X.pluginQueue.length;e++)X.pluginQueue[e][1]({scanner:X.scanner,parser:X.parser});return X.initialized=!0,X}function MI(e){return X.initialized||jI(),TI(X.parser.start,e,uI(X.scanner.start,e))}MI.scan=uI;function NI(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new hI(n),i=MI(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var PI=`[\0- \xA0 -\u2029 ]`,FI=new RegExp(PI),II=RegExp(`${PI}$`),LI=RegExp(`${PI}+$`),RI=new RegExp(PI,`g`);function zI(e,t,n){let r=e.doc.resolve(t.to);if(!r.nodeBefore?.isText)return;let i=e.doc.textBetween(t.from,t.to,``,``).match(LI)?.[0];if(!i)return;let a=t.to-i.length,o=If(a,t.to,e.doc).filter(e=>e.mark.type===n);if(!o.length)return;let{nodeAfter:s}=r;if(s&&o.some(e=>e.mark.isInSet(s.marks)))return;let c=e.storedMarks;e.removeMark(a,t.to,n),e.setStoredMarks(c),e.selection.empty&&e.selection.from===t.to&&e.removeStoredMark(n)}function BI(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function VI(e){return new j({key:new M(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r,s=sf(n.doc,[...t]);if(!t.some(zu)){let t=[];s.steps.forEach((e,n)=>{if(!(e instanceof Sr)||!e.slice.size)return;let r=s.mapping.slice(n+1),i=r.map(e.from,1),a=r.map(e.from+e.slice.size,-1);i<a&&t.push({from:i,to:a})}),t.sort((e,t)=>t.to-e.to),t.forEach(t=>zI(o,t,e.type))}if(Ff(s).forEach(({newRange:t})=>{let n=cf(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!II.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(FI).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=MI(n).map(t=>t.toObject(e.defaultProtocol));if(!BI(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{If(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function HI(e){return new j({key:new M(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=Mf(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}var UI=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,WI=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function GI(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;--r)n+=1;return n%2==1}function KI(e,t){let n=0,r=0;for(;r<t;){if(e[r]!=="`"||n===0&&GI(e,r)){r+=1;continue}let i=0;for(;r<t&&e[r]==="`";)i+=1,r+=1;n===0?n=i:i===n&&(n=0)}return n>0}function qI(e,t,n){let[,r,i]=t;return(t.index?e[t.index-1]:void 0)===`!`||GI(e,t.index??0)||KI(e,t.index??0)?!1:!!r.trim()&&n(i)}function JI(e){let[t,n,r,,i,a,o]=e,s=i??a??o;return{index:e.index??0,text:t,replaceWith:n,data:{href:r,title:s||null,markdown:!0}}}function YI(e,t){return e.index<t.index+t.text.length&&t.index<e.index+e.text.length}function XI(e){return{href:e.data?.href,title:e.data?.title??null}}function ZI(e){let t=Wm({find:t=>{let n=UI.exec(t);return!n||!qI(t,n,e.isAllowedHref)?null:JI(n)},type:e.type,getAttributes:XI});return new fm({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function QI(e){let t=Xm({find:t=>{let n=[];for(let r of t.matchAll(WI))qI(t,r,e.isAllowedHref)&&n.push(JI(r));let r=(e.findPlainUrls?.call(e,t)??[]).filter(e=>!n.some(t=>YI(t,e)));return[...n,...r]},type:e.type,getAttributes:XI});return new xm({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.match.data?.markdown&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function $I(e){return new j({key:new M(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=NI(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function eL(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(RI,``).match(RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)).join(`|`)}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,`i`))}var tL=bm.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{typeof e==`string`?AI(e):AI(e.scheme,e.optionalSlashes)})},onDestroy(){kI()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!eL(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target??null},rel:{default:this.options.HTMLAttributes.rel??null},class:{default:this.options.HTMLAttributes.class??null},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!eL(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!eL(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,L(this.options.HTMLAttributes,e),0]:[`a`,L(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!eL(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!eL(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addInputRules(){return this.options.markdownLinks?[ZI({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!eL(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){let e=e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options;NI(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!eL(e,n),protocols:n,defaultProtocol:r})).forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t};return this.options.markdownLinks?[QI({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!eL(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:e})]:[Xm({find:e,type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(VI({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!eL(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(HI({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push($I({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),nL=` `,rL=`\xA0`,iL=z.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,L(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===nL||n[0].text===nL||n[0].raw===rL||n[0].text===rL)&&r.length===1&&r[0].type===`text`&&(r[0].text===nL||r[0].text===rL)?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?nL:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),aL=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,oL=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,sL=bm.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`,L(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[Wm({find:aL,type:this.type})]},addPasteRules(){return[Xm({find:oL,type:this.type})]}}),cL=z.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),lL=bm.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`,L(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 uL(e={}){return new j({view(t){return new dL(t,e)}})}var dL=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=Yr(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)}},fL=class e extends O{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):O.near(r)}content(){return D.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 pL(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!hL(e)||!gL(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&&!A.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}}};fL.prototype.visible=!1,fL.findFrom=fL.findGapCursorFrom,O.jsonID(`gapcursor`,fL);var pL=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 fL.valid(t)?new fL(t):O.near(t)}};function mL(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function hL(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||mL(e.type))return!0;if(e.inlineContent)return!1}}return!0}function gL(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||mL(e.type))return!0;if(e.inlineContent)return!1}}return!0}function _L(){return new j({props:{decorations:SL,createSelectionBetween(e,t,n){return t.pos==n.pos&&fL.valid(n)?new fL(n):null},handleClick:bL,handleKeyDown:vL,handleDOMEvents:{beforeinput:xL}}})}var vL=pu({ArrowLeft:yL(`horiz`,-1),ArrowRight:yL(`horiz`,1),ArrowUp:yL(`vert`,-1),ArrowDown:yL(`vert`,1)});function yL(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 k){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=fL.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new fL(c))),!0):!1}}function bL(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!fL.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&A.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new fL(r))),!0)}function xL(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof fL))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=T.empty;for(let e=r.length-1;e>=0;e--)i=T.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new D(i,0,0));return a.setSelection(k.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function SL(e){if(!(e.selection instanceof fL))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,P.create(e.doc,[ul.widget(e.selection.head,t,{key:`gapcursor`})])}R.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 j({key:new M(`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 CL=R.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[uL(this.options)]}});R.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new j({key:new M(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return P.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(ul.node(t,t+e.nodeSize,{class:this.options.className}))}),P.create(e,a)}}})]}});var wL=R.create({name:`gapCursor`,addProseMirrorPlugins(){return[_L()]},extendNodeSchema(e){return{allowGapCursor:I(F(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),TL=`placeholder`,EL=new M(`tiptap__placeholder`);function DL(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),ul.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function OL(e,t){return typeof e==`function`?e(t):e}function kL({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&&Jf(r);return r.type.isTextblock&&(a||!t.showOnlyCurrent)&&o&&c.push(DL({editor:e,isEmptyDoc:l,dataAttribute:n,hasAnchor:a,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:OL(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:a})},node:r,pos:i})),t.includeChildren}),c}function AL({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&&Jf(c)){let r=a>=l&&a<=l+c.nodeSize;o.push(DL({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:OL(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else o.push(...kL({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return P.create(r,o)}function jL(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 ML(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function NL(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 PL(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 FL(e,t){let n=NL(e,t.from,t.to);return n.push(ML(e,jL(e,t.from))),t.to>t.from?n.push(ML(e,jL(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(ML(e,jL(e,Math.min(t.from+1,e.content.size)))),n}function IL(e,t,n){let r=[];if(e.docChanged){let t=Ff(e);for(let e of t)r.push(...FL(n.doc,e.newRange))}return e.selectionSet&&(r.push(ML(n.doc,jL(n.doc,e.mapping.map(t.selection.anchor)))),r.push(ML(n.doc,jL(n.doc,n.selection.anchor)))),PL(r)}function LL(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 RL({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}=LL(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=kL({editor:n,options:r,dataAttribute:i,doc:a,selection:o,from:t,to:c});u.length&&(s=s.add(a,u))}return s}function zL({editor:e,options:t,dataAttribute:n}){return{init(r,i){return AL({editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection})??P.empty},apply(r,i,a,o){return!r.docChanged&&!r.selectionSet?i:RL({decorations:i.map(r.mapping,r.doc),ranges:IL(r,a,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function BL(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function VL({editor:e,options:t}){let n=t.dataAttribute?`data-${BL(t.dataAttribute)}`:`data-${TL}`,r=t.showOnlyCurrent&&!t.includeChildren;return new j({key:EL,...r?{}:{state:zL({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:r,selection:i})=>AL({editor:e,options:t,dataAttribute:n,doc:r,selection:i}):n=>t.showOnlyWhenEditable&&!e.isEditable?P.empty:EL.getState(n)??P.empty}})}R.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:TL,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[VL({editor:this.editor,options:this.options})]}});function HL(e,t){return!e.selection.empty&&!Yf(e.selection)&&t.isEditable}function UL(e,t){return HL(e,t)&&!t.isFocused&&!t.view.dragging}function WL(){var e;(e=window.getSelection())==null||e.removeAllRanges()}function GL(e){e.focus()}R.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new j({key:new M(`selection`),props:{decorations(n){return UL(n,e)?P.create(n.doc,[ul.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(t){return HL(t.state,e)&&WL(),!1},focus(t){return HL(t.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&t.hasFocus()&&GL(t)}),!1}}}})]}});function KL({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var qL=R.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new M(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 j({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!KL({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!KL({node:r,types:n})}}})]}}),JL=R.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>Lu(e,t),redo:()=>({state:e,dispatch:t})=>Ru(e,t)}},addProseMirrorPlugins(){return[Fu(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()}}}),YL=R.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(mP.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(lP.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(hM.configure(this.options.bulletList)),this.options.code!==!1&&e.push(vP.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(SP.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(CP.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(CL.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(wL.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(wP.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(TP.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(JL.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(EP.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(jP.configure(this.options.italic)),this.options.listItem!==!1&&e.push(RM.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(qM.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(tL.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(pN.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(iL.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(sL.configure(this.options.strike)),this.options.text!==!1&&e.push(cL.configure(this.options.text)),this.options.underline!==!1&&e.push(lL.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(qL.configure(this.options?.trailingNode)),e}});function XL(e,t){let[n,r]=e,i=DO(`code`,r),a=Object.keys(i).length>0?OO(i):``,o=NO(e),s=o.includes("`")?"``":"`";return`${s}${o}${s}${a}`}function ZL(e,t){let[n,r,...i]=e,a=i[0]?.[1]?.class,o=r.language||a?.split(` `).find(e=>e.startsWith(`language-`))?.slice(9)||``,s=r.filename?` [`+String(r.filename).split(`]`).join(`\\\\]`)+`]`:``,c=r.highlights?` {`+QL(r.highlights)+`}`:``,l=r.meta?` `+r.meta:``,u=String(e[1]?.code||NO(e)).trimEnd(),d=CO(u),f=d+o+s+c+l+`
|
|
228
|
+
3. "-" cannot repeat`);X.customSchemes.push([e,t])}function jI(){X.scanner=lI(X.customSchemes);for(let e=0;e<X.tokenQueue.length;e++)X.tokenQueue[e][1]({scanner:X.scanner});X.parser=wI(X.scanner.tokens);for(let e=0;e<X.pluginQueue.length;e++)X.pluginQueue[e][1]({scanner:X.scanner,parser:X.parser});return X.initialized=!0,X}function MI(e){return X.initialized||jI(),TI(X.parser.start,e,uI(X.scanner.start,e))}MI.scan=uI;function NI(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new hI(n),i=MI(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var PI=`[\0- \xA0 -\u2029 ]`,FI=new RegExp(PI),II=RegExp(`${PI}$`),LI=RegExp(`${PI}+$`),RI=new RegExp(PI,`g`);function zI(e,t,n){let r=e.doc.resolve(t.to);if(!r.nodeBefore?.isText)return;let i=e.doc.textBetween(t.from,t.to,``,``).match(LI)?.[0];if(!i)return;let a=t.to-i.length,o=Ff(a,t.to,e.doc).filter(e=>e.mark.type===n);if(!o.length)return;let{nodeAfter:s}=r;if(s&&o.some(e=>e.mark.isInSet(s.marks)))return;let c=e.storedMarks;e.removeMark(a,t.to,n),e.setStoredMarks(c),e.selection.empty&&e.selection.from===t.to&&e.removeStoredMark(n)}function BI(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function VI(e){return new M({key:new N(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r,s=of(n.doc,[...t]);if(!t.some(Ru)){let t=[];s.steps.forEach((e,n)=>{if(!(e instanceof xr)||!e.slice.size)return;let r=s.mapping.slice(n+1),i=r.map(e.from,1),a=r.map(e.from+e.slice.size,-1);i<a&&t.push({from:i,to:a})}),t.sort((e,t)=>t.to-e.to),t.forEach(t=>zI(o,t,e.type))}if(Pf(s).forEach(({newRange:t})=>{let n=sf(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!II.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(FI).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=MI(n).map(t=>t.toObject(e.defaultProtocol));if(!BI(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{Ff(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function HI(e){return new M({key:new N(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=jf(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}var UI=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,WI=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function GI(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;--r)n+=1;return n%2==1}function KI(e,t){let n=0,r=0;for(;r<t;){if(e[r]!=="`"||n===0&&GI(e,r)){r+=1;continue}let i=0;for(;r<t&&e[r]==="`";)i+=1,r+=1;n===0?n=i:i===n&&(n=0)}return n>0}function qI(e,t,n){let[,r,i]=t;return(t.index?e[t.index-1]:void 0)===`!`||GI(e,t.index??0)||KI(e,t.index??0)?!1:!!r.trim()&&n(i)}function JI(e){let[t,n,r,,i,a,o]=e,s=i??a??o;return{index:e.index??0,text:t,replaceWith:n,data:{href:r,title:s||null,markdown:!0}}}function YI(e,t){return e.index<t.index+t.text.length&&t.index<e.index+e.text.length}function XI(e){return{href:e.data?.href,title:e.data?.title??null}}function ZI(e){let t=Um({find:t=>{let n=UI.exec(t);return!n||!qI(t,n,e.isAllowedHref)?null:JI(n)},type:e.type,getAttributes:XI});return new dm({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function QI(e){let t=Ym({find:t=>{let n=[];for(let r of t.matchAll(WI))qI(t,r,e.isAllowedHref)&&n.push(JI(r));let r=(e.findPlainUrls?.call(e,t)??[]).filter(e=>!n.some(t=>YI(t,e)));return[...n,...r]},type:e.type,getAttributes:XI});return new bm({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.match.data?.markdown&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function $I(e){return new M({key:new N(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=NI(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function eL(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(RI,``).match(RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)).join(`|`)}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,`i`))}var tL=ym.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{typeof e==`string`?AI(e):AI(e.scheme,e.optionalSlashes)})},onDestroy(){kI()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!eL(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target??null},rel:{default:this.options.HTMLAttributes.rel??null},class:{default:this.options.HTMLAttributes.class??null},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!eL(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!eL(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,R(this.options.HTMLAttributes,e),0]:[`a`,R(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!eL(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!eL(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addInputRules(){return this.options.markdownLinks?[ZI({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!eL(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){let e=e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options;NI(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!eL(e,n),protocols:n,defaultProtocol:r})).forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t};return this.options.markdownLinks?[QI({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!eL(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:e})]:[Ym({find:e,type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(VI({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!eL(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(HI({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push($I({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),nL=` `,rL=`\xA0`,iL=B.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,R(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===nL||n[0].text===nL||n[0].raw===rL||n[0].text===rL)&&r.length===1&&r[0].type===`text`&&(r[0].text===nL||r[0].text===rL)?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?nL:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),aL=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,oL=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,sL=ym.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`,R(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[Um({find:aL,type:this.type})]},addPasteRules(){return[Ym({find:oL,type:this.type})]}}),cL=B.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),lL=ym.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`,R(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 uL(e={}){return new M({view(t){return new dL(t,e)}})}var dL=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=Jr(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)}},fL=class e extends k{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):k.near(r)}content(){return O.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 pL(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!hL(e)||!gL(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&&!j.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}}};fL.prototype.visible=!1,fL.findFrom=fL.findGapCursorFrom,k.jsonID(`gapcursor`,fL);var pL=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 fL.valid(t)?new fL(t):k.near(t)}};function mL(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function hL(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||mL(e.type))return!0;if(e.inlineContent)return!1}}return!0}function gL(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||mL(e.type))return!0;if(e.inlineContent)return!1}}return!0}function _L(){return new M({props:{decorations:SL,createSelectionBetween(e,t,n){return t.pos==n.pos&&fL.valid(n)?new fL(n):null},handleClick:bL,handleKeyDown:vL,handleDOMEvents:{beforeinput:xL}}})}var vL=fu({ArrowLeft:yL(`horiz`,-1),ArrowRight:yL(`horiz`,1),ArrowUp:yL(`vert`,-1),ArrowDown:yL(`vert`,1)});function yL(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 A){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=fL.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new fL(c))),!0):!1}}function bL(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!fL.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&j.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new fL(r))),!0)}function xL(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof fL))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=E.empty;for(let e=r.length-1;e>=0;e--)i=E.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new O(i,0,0));return a.setSelection(A.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function SL(e){if(!(e.selection instanceof fL))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,F.create(e.doc,[ll.widget(e.selection.head,t,{key:`gapcursor`})])}z.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 M({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 CL=z.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[uL(this.options)]}});z.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new M({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 F.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(ll.node(t,t+e.nodeSize,{class:this.options.className}))}),F.create(e,a)}}})]}});var wL=z.create({name:`gapCursor`,addProseMirrorPlugins(){return[_L()]},extendNodeSchema(e){return{allowGapCursor:L(I(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),TL=`placeholder`,EL=new N(`tiptap__placeholder`);function DL(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),ll.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function OL(e,t){return typeof e==`function`?e(t):e}function kL({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&&qf(r);return r.type.isTextblock&&(a||!t.showOnlyCurrent)&&o&&c.push(DL({editor:e,isEmptyDoc:l,dataAttribute:n,hasAnchor:a,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:OL(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:a})},node:r,pos:i})),t.includeChildren}),c}function AL({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&&qf(c)){let r=a>=l&&a<=l+c.nodeSize;o.push(DL({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:OL(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else o.push(...kL({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return F.create(r,o)}function jL(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 ML(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function NL(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 PL(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 FL(e,t){let n=NL(e,t.from,t.to);return n.push(ML(e,jL(e,t.from))),t.to>t.from?n.push(ML(e,jL(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(ML(e,jL(e,Math.min(t.from+1,e.content.size)))),n}function IL(e,t,n){let r=[];if(e.docChanged){let t=Pf(e);for(let e of t)r.push(...FL(n.doc,e.newRange))}return e.selectionSet&&(r.push(ML(n.doc,jL(n.doc,e.mapping.map(t.selection.anchor)))),r.push(ML(n.doc,jL(n.doc,n.selection.anchor)))),PL(r)}function LL(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 RL({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}=LL(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=kL({editor:n,options:r,dataAttribute:i,doc:a,selection:o,from:t,to:c});u.length&&(s=s.add(a,u))}return s}function zL({editor:e,options:t,dataAttribute:n}){return{init(r,i){return AL({editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection})??F.empty},apply(r,i,a,o){return!r.docChanged&&!r.selectionSet?i:RL({decorations:i.map(r.mapping,r.doc),ranges:IL(r,a,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function BL(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function VL({editor:e,options:t}){let n=t.dataAttribute?`data-${BL(t.dataAttribute)}`:`data-${TL}`,r=t.showOnlyCurrent&&!t.includeChildren;return new M({key:EL,...r?{}:{state:zL({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:r,selection:i})=>AL({editor:e,options:t,dataAttribute:n,doc:r,selection:i}):n=>t.showOnlyWhenEditable&&!e.isEditable?F.empty:EL.getState(n)??F.empty}})}z.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:TL,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[VL({editor:this.editor,options:this.options})]}});function HL(e,t){return!e.selection.empty&&!Jf(e.selection)&&t.isEditable}function UL(e,t){return HL(e,t)&&!t.isFocused&&!t.view.dragging}function WL(){var e;(e=window.getSelection())==null||e.removeAllRanges()}function GL(e){e.focus()}z.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new M({key:new N(`selection`),props:{decorations(n){return UL(n,e)?F.create(n.doc,[ll.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(t){return HL(t.state,e)&&WL(),!1},focus(t){return HL(t.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&t.hasFocus()&&GL(t)}),!1}}}})]}});function KL({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var qL=z.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 M({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!KL({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!KL({node:r,types:n})}}})]}}),JL=z.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>Iu(e,t),redo:()=>({state:e,dispatch:t})=>Lu(e,t)}},addProseMirrorPlugins(){return[Pu(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()}}}),YL=z.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(pP.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(cP.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(mM.configure(this.options.bulletList)),this.options.code!==!1&&e.push(_P.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(xP.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(SP.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(CL.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(wL.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(CP.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(wP.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(JL.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(TP.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(AP.configure(this.options.italic)),this.options.listItem!==!1&&e.push(LM.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(KM.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(tL.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(fN.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(iL.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(sL.configure(this.options.strike)),this.options.text!==!1&&e.push(cL.configure(this.options.text)),this.options.underline!==!1&&e.push(lL.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(qL.configure(this.options?.trailingNode)),e}});function XL(e,t){let[n,r]=e,i=EO(`code`,r),a=Object.keys(i).length>0?DO(i):``,o=MO(e),s=o.includes("`")?"``":"`";return`${s}${o}${s}${a}`}function ZL(e,t){let[n,r,...i]=e,a=i[0]?.[1]?.class,o=r.language||a?.split(` `).find(e=>e.startsWith(`language-`))?.slice(9)||``,s=r.filename?` [`+String(r.filename).split(`]`).join(`\\\\]`)+`]`:``,c=r.highlights?` {`+QL(r.highlights)+`}`:``,l=r.meta?` `+r.meta:``,u=String(e[1]?.code||MO(e)).trimEnd(),d=SO(u),f=d+o+s+c+l+`
|
|
229
229
|
`+u+`
|
|
230
|
-
`+d,p=
|
|
231
|
-
`));let a=
|
|
232
|
-
`+
|
|
233
|
-
`+
|
|
234
|
-
`+
|
|
235
|
-
`+
|
|
230
|
+
`+d,p=DO(EO(`pre`,r));return p?`::pre${p}\n${f}\n::`+t.context.blockSeparator:f+t.context.blockSeparator}function QL(e){if(e.length===0)return``;let t=[...e].sort((e,t)=>e-t),n=[],r=t[0],i=t[0];for(let e=1;e<=t.length;e++)e<t.length&&t[e]===i+1?i=t[e]:(r===i?n.push(String(r)):n.push(r+`-`+i),e<t.length&&(r=t[e],i=t[e]));return n.join(`,`)}function $L(e,t,n){return n?.[0]===`p`?`:hr`:`---`+t.context.blockSeparator}var eR=new WeakMap;function tR(e,t,n,r){let i=eR.get(n);if(i===void 0&&(i=aA(n.context.headingIds)??null,eR.set(n,i)),!i)return;let a=cA(e.slice(2).map(e=>MO(e)).join(``),t,i);return sA(i,r),a}async function nR(e,t){let[n]=e,r=Number(n.slice(1)),i=await t.flow(e,t),{id:a,...o}=e[1],s=tR(e,r,t,a),c=DO(a===void 0||a===s?o:{id:a,...o}),l=c?` ${c}`:``;return`#`.repeat(r)+` `+i+l+t.context.blockSeparator}async function rR(e,t,n){let r=e.slice(2),i=``;for(let n of r)i+=await t.one(n,t,e,i===``||i.endsWith(`
|
|
231
|
+
`));let a=DO(e[1]);return a&&(i=`${i.replace(/[ \t]+$/,``)} ${a}`),n?.[0]===`li`?i:i+t.context.blockSeparator}async function iR(e,t){let[n,r]=e,{href:i,...a}=r,o=Object.keys(a).length>0?DO(a):``,s=await t.flow(e,t);return s===i&&!o?`<${i}>`:`[${s}](${i})${o}`}async function aR(e,t){let n=e.slice(2),r=t.applyContext({list:!0,order:!1,listIndent:2}),i=``;for(let e of n)i+=await t.one(e,t);i=i.trim(),t.applyContext(r);let a=DO(EO(`ul`,e[1]));return a?r.list?`
|
|
232
|
+
`+HO(`::ul${a}\n${i}\n::`,{width:r.listIndent||2}):`::ul${a}\n${i}\n::`+t.context.blockSeparator:(r.list?i=`
|
|
233
|
+
`+HO(i,{width:r.listIndent||2}):i+=t.context.blockSeparator,i)}async function oR(e,t){let n=e.slice(2),r=Number(e[1].start),i=Number.isInteger(r)&&r>=1?r:1,a=t.applyContext({list:!0,order:i,listIndent:3}),o=``;for(let e of n)o+=await t.one(e,t);o=o.trim(),t.applyContext(a);let s=DO(EO(`ol`,e[1]));return s?a.list?`
|
|
234
|
+
`+HO(`::ol${s}\n${o}\n::`,{width:a.listIndent||2}):`::ol${s}\n${o}\n::`+t.context.blockSeparator:(a.list?o=`
|
|
235
|
+
`+HO(o,{width:a.listIndent||2}):o+=t.context.blockSeparator,o)}var sR=new Set([`pre`,`blockquote`,`table`]);async function cR(e,t){let n=e.slice(2),r=t.context.order,i=r?`${r}. `:`- `;if((e[1].className&&Array.isArray(e[1].className)?e[1].className.join(` `):String(e[1].className||e[1].class)).includes(`task-list-item`)){let e=n.shift();i+=e[1].checked||e[1][`:checked`]?`[x] `:`[ ] `}let a=i.length,o=n.some(e=>typeof e==`string`),s=``;for(let r of n){if(Array.isArray(r)){let n=r[0];if(s&&sR.has(n)){let n=HO(await t.one(r,t,e),{width:a});s=s.trimEnd()+`
|
|
236
236
|
`+n.trimEnd()+`
|
|
237
|
-
`;continue}if(s&&n===`p`){let n=
|
|
237
|
+
`;continue}if(s&&n===`p`){let n=HO(await t.one(r,t,e),{width:a});s=s.trimEnd()+`
|
|
238
238
|
|
|
239
239
|
`+n.trimEnd()+`
|
|
240
|
-
`;continue}if(!o&&!(n in t.handlers)){let e=
|
|
240
|
+
`;continue}if(!o&&!(n in t.handlers)){let e=HO(await t.one(r,t),{width:a,ignoreFirstLine:!s});s=s?s.trimEnd()+`
|
|
241
241
|
`+e.trimEnd()+`
|
|
242
242
|
`:e.trimEnd()+`
|
|
243
243
|
`;continue}}s+=await t.one(r,t,e,s===``||s.endsWith(`
|
|
244
|
-
`))}s=s.trim();let c=
|
|
245
|
-
`,y=``,b=!0;for(let e=0;e<a.length;e++){let t=_[e],n=a[e],r=typeof n!=`string`&&(fR.has(String(n?.[0]))||!dR.has(String(n?.[0]))&&!d);e>0&&!b&&r&&(y+=v),y+=t,b=r,r&&e<a.length-1&&(y+=v)}g&&t.applyContext(g);let x=
|
|
244
|
+
`))}s=s.trim();let c=DO(EO(`li`,e[1])),l=c?` ${c}`:``;return r&&t.applyContext({order:r+1}),`${i}${s}${l}\n`}var lR=new Set([`p`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`li`,`td`,`th`]),uR=new Set([`br`,`hr`,`img`,`input`,`link`,`meta`,`source`,`track`,`wbr`]),dR=new Set([`strong`,`em`,`del`,`code`,`a`,`br`,`span`,`img`]),fR=new Set([`p`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`li`,`ul`,`ol`,`blockquote`,`hr`,`table`,`td`,`th`]);async function pR(e,t,n){let[r,i,...a]=e,{$:o={},...s}=i,c=Object.keys(s).length>0,l=t.context.html&&c?t.renderData.props:s,u=a.every(e=>typeof e==`string`||dR.has(String(e?.[0]))),d=a.some(e=>typeof e==`string`),f=lR.has(String(r)),p=dR.has(String(r))&&o.block===0,m=f&&u;!m&&dR.has(String(r))&&u&&(m=!0),r===`pre`&&(m=!0),(n?.[0]===`p`||t.context.inline)&&(m=!0),o.block===0&&(m=!0);let h=uR.has(String(r)),g=t.applyContext({inline:m}),_=[];for(let n of a)_.push(await t.one(n,t,e));let v=t.context.html?t.context.blockSeparator:m?``:`
|
|
245
|
+
`,y=``,b=!0;for(let e=0;e<a.length;e++){let t=_[e],n=a[e],r=typeof n!=`string`&&(fR.has(String(n?.[0]))||!dR.has(String(n?.[0]))&&!d);e>0&&!b&&r&&(y+=v),y+=t,b=r,r&&e<a.length-1&&(y+=v)}g&&t.applyContext(g);let x=IO(String(r),e,l),S=Object.keys(x).length>0?` ${kO(x)}`:``;return h?`<${r}${S}>`+(!n&&!p?t.context.blockSeparator:``):(!m&&y&&(y=`
|
|
246
246
|
`+hR(y,t,String(r)).trimEnd()+`
|
|
247
|
-
`),`<${r}${S}>${y}</${r}>`+(!n&&!p?t.context.blockSeparator:``))}var mR=new Set([`code`,`kbd`,`pre`,`samp`,`script`,`style`,`textarea`,`var`]);function hR(e,t,n){return t.context.html?mR.has(n.toLowerCase())?e:
|
|
248
|
-
`));let i=
|
|
247
|
+
`),`<${r}${S}>${y}</${r}>`+(!n&&!p?t.context.blockSeparator:``))}var mR=new Set([`code`,`kbd`,`pre`,`samp`,`script`,`style`,`textarea`,`var`]);function hR(e,t,n){return t.context.html?mR.has(n.toLowerCase())?e:HO(e):(e.trim().startsWith(`<`),``+e+(e.trim().endsWith(`>`),``))}async function gR(e,t){let[n,r,...i]=e,a=``;for(let n of i)a+=await t.one(n,t,e);a=a.trim();let o=Object.keys(r).length>0?DO(r):``;return`**${a}**${o}`}async function _R(e,t){let[n,r,...i]=e,a=``;for(let n of i)a+=await t.one(n,t,e);a=a.trim();let o=Object.keys(r).length>0?DO(r):``;return`*${a}*${o}`}async function vR(e,t){let n=e.slice(2),r=``;for(let i of n)r+=await t.one(i,t,e,r===``||r.endsWith(`
|
|
248
|
+
`));let i=DO(EO(`blockquote`,e[1])),a=n.some(e=>Array.isArray(e));if(i&&a)return`::blockquote${i}\n${r.trim().split(`
|
|
249
249
|
`).map(e=>e?`> ${e}`:`>`).join(`
|
|
250
250
|
`)}\n::`+t.context.blockSeparator;i&&(r=`${r.replace(/[ \t]+$/,``)} ${i}`);let o=r.trim().split(`
|
|
251
251
|
`).map(e=>e?`> ${e}`:`>`).join(`
|
|
252
|
-
`);return e[1].as?`> [!${String(e[1].as).toUpperCase()}]\n`+o+t.context.blockSeparator:o+t.context.blockSeparator}function yR(e,t){let[n,r]=e,{title:i,src:a,alt:o=``,...s}=r,c=Object.keys(s).length>0?
|
|
253
|
-
`}async function wR(e,t,n){let[r,i]=e,a=(await t.flow(e,t)).trimEnd();if(i.name==="default"&&(n?n.slice(2):[]).filter(e=>Array.isArray(e)&&e[0]===`template`).length===1)return a+t.context.blockSeparator;let{name:o,$:s,...c}=i,l=
|
|
252
|
+
`);return e[1].as?`> [!${String(e[1].as).toUpperCase()}]\n`+o+t.context.blockSeparator:o+t.context.blockSeparator}function yR(e,t){let[n,r]=e,{title:i,src:a,alt:o=``,...s}=r,c=Object.keys(s).length>0?DO(s):``;return`${i?``:``}${c}`}async function bR(e,t){let[n,r,...i]=e,a=``;for(let n of i)a+=await t.one(n,t,e);a=a.trim();let o=Object.keys(r).length>0?DO(r):``;return`~~${a}~~${o}`}var xR=new Set([`a`,`strong`,`em`,`span`]);async function SR(e,t,n){let[r,i,...a]=e,{$:o,...s}=i;if(r===`table`)return pR(e,t);let c=Object.entries(s),l=c.some(([,e])=>typeof e==`object`),u=n?.some((e,t)=>t>1&&typeof e==`string`)??!1,d=n!==void 0&&xR.has(String(n[0])),f=u||d||t.context.inline===!0;l&&(f=!1);let p=f?t.applyContext({inline:!0}):void 0,m=``,h={...t,nodeDepthInTree:(t.nodeDepthInTree||0)+1};for(let n of a)m+=await t.one(n,h,e);m=m.trimEnd(),p&&t.applyContext(p);let g=c.length>0?DO(s):``;if(r===`span`)return!g&&n?.[0]==`a`&&(g||=`{}`),`[${m}]${g}`+(f?``:t.context.blockSeparator);let _=`:`.repeat((t.nodeDepthInTree||0)+2),v=`:${r}${m&&`[${m}]`}${g}`+(n?``:t.context.blockSeparator);if(!f){let e=t.context.maxInlineAttributes??3;v=l||e===0||c.length>e?`${_}${r}\n${jO(s,t.context.blockAttributesStyle)}${m?`\n${m}`:``}\n${_}`+t.context.blockSeparator:`${_}${r}${g}${m?`\n${m}`:``}\n${_}`+t.context.blockSeparator}return f?v:HO(v,{level:+!!n})}function CR(e,t){return`
|
|
253
|
+
`}async function wR(e,t,n){let[r,i]=e,a=(await t.flow(e,t)).trimEnd();if(i.name==="default"&&(n?n.slice(2):[]).filter(e=>Array.isArray(e)&&e[0]===`template`).length===1)return a+t.context.blockSeparator;let{name:o,$:s,...c}=i,l=DO(c);return`#${i.name}${l}\n${a}`+t.context.blockSeparator}function TR(e){let t=e.style;if(typeof t!=`string`)return null;let n=t.toLowerCase().split(` `).join(``).split(` `).join(``);return n.includes(`text-align:left`)?`left`:n.includes(`text-align:center`)?`center`:n.includes(`text-align:right`)?`right`:null}async function ER(e,t){if(typeof e==`string`)return DR(e);let[,,...n]=e,r=``;for(let i of n)r+=typeof i==`string`?i:await t.one(i,t,e);return DR(r.trim())}function DR(e){return e.split(`
|
|
254
254
|
`).join(` `).split(`|`).join(`\\|`)}function OR(e){if(typeof e==`string`)return[];let[t,,...n]=e;return t===`tr`?[e]:t===`thead`||t===`tbody`?n.filter(e=>typeof e!=`string`&&e[0]===`tr`):[]}function kR(e){let[,,...t]=e;return t.filter(e=>typeof e!=`string`&&(e[0]===`th`||e[0]===`td`))}async function AR(e,t){let[,,...n]=e,r=[],i=[];for(let e of n){if(typeof e==`string`)continue;let[t]=e;if(t===`thead`)r=OR(e);else if(t===`tbody`)i=OR(e);else if(t===`tr`){let t=kR(e);t.length>0&&t[0][0]===`th`?r.push(e):i.push(e)}}if(r.length===0&&i.length>0){let e=i[0];r=[[`tr`,{},...kR(e).map((e,t)=>[`th`,{},`Column ${t+1}`])]]}if(r.length===0)return``;let a=r[0],o=kR(a),s=[];for(let e of o)s.push(await ER(e,t));let c=o.map(e=>{let[,t]=e;return TR(t)}),l=s.map(e=>Math.max(3,e.length));for(let e of i){let n=kR(e);for(let e=0;e<n.length;e++)if(e<l.length){let r=await ER(n[e],t);l[e]=Math.max(l[e],r.length)}}let u=`| `;u+=s.map((e,t)=>e.padEnd(l[t])).join(` | `),u+=` |
|
|
255
255
|
`,u+=`| `,u+=l.map((e,t)=>{let n=c[t];return n===`left`?`:`+`-`.repeat(e-1):n===`center`?`:`+`-`.repeat(e-2)+`:`:n===`right`?`-`.repeat(e-1)+`:`:`-`.repeat(e)}).join(` | `),u+=` |
|
|
256
256
|
`;for(let e of i){let n=kR(e),r=[];for(let e=0;e<n.length;e++){let i=await ER(n[e],t);r.push(i.padEnd(l[e]||0))}for(;r.length<l.length;)r.push(``.padEnd(l[r.length]));u+=`| `+r.join(` | `)+` |
|
|
257
|
-
`}let d=
|
|
258
|
-
`}function jR(e,t){return``}function MR(e,t){return``}function NR(e,t){return``}function PR(e,t){return``}function FR(e,t){return``}function IR(e,t){return e[0]===null?`<!--${e[2]}-->`+t.context.blockSeparator:``}function LR(e,t,n){let r=
|
|
257
|
+
`}let d=DO(EO(`table`,e[1]));return d?`::table${d}\n${u.trimEnd()}\n::\n\n`:u+`
|
|
258
|
+
`}function jR(e,t){return``}function MR(e,t){return``}function NR(e,t){return``}function PR(e,t){return``}function FR(e,t){return``}function IR(e,t){return e[0]===null?`<!--${e[2]}-->`+t.context.blockSeparator:``}function LR(e,t,n){let r=MO(e),i=e[1].class,a=typeof i==`string`?i.split(` `):[],o=a.includes(`inline`),s=a.includes(`block`),c=n?.some((e,t)=>t>1&&typeof e==`string`)??!1;return o||!s&&c?`$${r}$`:`$$\n${r}\n$$${t.context.blockSeparator}`}function RR(e,t){let[n,r]=e,{content:i,...a}=r,o=DO(a),s=String(i??``).replace(/\n$/,``),c=SO(s);return`${c}mermaid${o?` ${o}`:``}\n${s}\n${c}${t.context.blockSeparator}`}var zR={code:XL,pre:ZL,hr:$L,br:CR,h1:nR,h2:nR,h3:nR,h4:nR,h5:nR,h6:nR,p:rR,a:iR,ul:aR,ol:oR,li:cR,html:pR,strong:gR,em:_R,blockquote:vR,img:yR,del:bR,mdc:SR,template:wR,table:AR,thead:jR,tbody:MR,tr:NR,th:PR,td:FR,comment:IR,math:LR,mermaid:RR};function BR(e,t){let n=t[0],r=(Object.hasOwn(e.handlers,n)?e.handlers[n]:void 0)||(Object.hasOwn(e.handlers,UO(n))?e.handlers[UO(n)]:void 0);if(typeof r==`function`)return r;for(let n of e.conditionalHandlers)if(n?.match(t))return n.handler;return r}async function VR(e,t,n,r=!1){if(typeof e==`string`)return t.context.html?VO(e,{"&":void 0,'"':void 0}):n?.[1].$?.html===1&&n[1].$?.block===1?e:KR(e,r);if(e[0]===null)return await t.handlers.comment(e,t);let i=t.renderData;if(t.renderData&&e[1]){let n=!1;for(let t in e[1])if(t!==`$`){n=!0;break}n&&(t.renderData={...i,props:wO(e[1],i)})}try{let r=BR(t.context,e);if(r)return await r(e,t,n);if(t.context.html||e[1].$?.html===1)return await t.handlers.html(e,t,n);let i=e[0],a=Object.hasOwn(t.handlers,i)?t.handlers[i]:void 0;return a?await a(e,t,n):t.context.format===`markdown/comark`?await t.handlers.mdc(e,t,n):await t.handlers.html(e,t,n)}finally{t.renderData=i}}async function HR(e,t,n){let r=e.slice(2),i=``;for(let a of r)i+=await VR(a,t,n||e);return i}function UR(e={}){let t=[],n={};for(let[r,i]of Object.entries(e.handlers||{}))typeof i==`function`?n[r]=i:t.push(i);let r={...e,blockSeparator:e.blockSeparator||`
|
|
259
259
|
|
|
260
260
|
`,format:e.format||`markdown/comark`,handlers:n,conditionalHandlers:t,blockAttributesStyle:e.blockAttributesStyle||`codeblock`,html:e.format===`text/html`},i=e.tree,a={frontmatter:i?.frontmatter||{},meta:i?.meta||{},data:e.data||{},props:{}},o={handlers:zR,context:r,one:VR,flow:HR,data:e.data||{},renderData:a,render:async e=>{if(Array.isArray(e)&&typeof e[0]==`string`&&e.length>1)return o.one(e,o);let t=``;for(let n of e)t+=await o.one(n,o,void 0,t===``||t.endsWith(`
|
|
261
261
|
`));return t},applyContext:e=>{let t={};for(let[n,i]of Object.entries(e))t[n]=r[n],r[n]=i;return t}};return o}var WR=/[\\`*_<&~[\]{:]/g,GR=new Set([` `,` `,`
|
|
@@ -263,9 +263,9 @@ $$`:`$`.repeat(r.len)}}return l}function H_(e,t){return e===null?[t]:(e.push(t),
|
|
|
263
263
|
`)?n:n.split(`
|
|
264
264
|
`).map((e,n)=>n>0||t?XR(e):e).join(`
|
|
265
265
|
`)}function qR(e){return e!==void 0&&/[a-zA-Z0-9]/.test(e)}function JR(e,t){let n=new Int32Array(e.length+1),r=-1;n[e.length]=-1;for(let i=e.length-1;i>=0;i--)e.charCodeAt(i)===t&&(r=i),n[i]=r;return n}function YR(e){let t;return e.replace(WR,(e,n,r)=>{if(e===`_`&&qR(r[n-1])&&qR(r[n+1]))return e;if(e===`<`){let i=r.charCodeAt(n+1);return!(i>=65&&i<=90||i>=97&&i<=122||i===33||i===63||i===47)||(t??=JR(r,62),t[n+1]===-1)?e:`\\${e}`}if(e===`&`&&!/^&#?[a-zA-Z0-9]+;/.test(r.slice(n)))return e;if(e===`:`){let t=r[n-1],i=t===void 0||GR.has(t),a=r[n+1];return i&&a!==void 0&&/[a-zA-Z$]/.test(a)?`\\${e}`:e}if(e===`{`){let t=r[n-1];return t===`{`||t===`$`?e:/^\{[ \t]{0,3}[.#:a-zA-Z_]/.test(r.slice(n,n+6))?`\\${e}`:e}return`\\${e}`})}function XR(e){if(/^#{1,6}([ \t]|$)/.test(e)||e[0]===`>`)return`\\${e}`;let t=/^(\d{1,9})[.)]([ \t]|$)/.exec(e);return t?`${t[1]}\\${e.slice(t[1].length)}`:/^-([ \t-]|$)/.test(e)||/^\+([ \t]|$)/.test(e)||/^=+[ \t]*$/.test(e)||e[0]===`:`?`\\${e}`:e}async function ZR(e,t={}){let n=UR({...t,tree:e,handlers:t.components}),r=``;for(let t of e.nodes)r+=await VR(t,n);return r.trim()+`
|
|
266
|
-
`}async function QR(e,t){let n=await ZR(e,{format:`markdown/comark`,...t});return
|
|
267
|
-
`:``}${e}\n`:n+=`: ${UO(e,{width:4,ignoreFirstLine:!0})}\n`}return n.trimEnd()+t.context.blockSeparator},Lz=`mdc_inline_span`;function Rz(e,t,n,r,i,a){for(let o of n)try{e[t](o,r,i,a);return}catch{}e.push(r,i,a)}var zz=`critic-sub`,Bz=!1;function Vz(e,t){if(t||Bz||!e.src.startsWith(`{~~`,e.pos))return!1;let n=e.pos,r=e.posMax,i=e.md.inline.ruler.getRules(``),a=i[i.indexOf(Vz)+1];if(!a?.(e,!0))return!1;let o=e.pos;e.pos=n,e.push(`${Lz}_open`,zz,1),e.posMax=o,Bz=!0;try{e.md.inline.tokenize(e)}finally{Bz=!1}return e.posMax=r,e.push(`${Lz}_close`,zz,-1),!0}var Hz=MS(()=>({name:`editor-critic-substitutions`,markdownItPlugins:[e=>Rz(e.inline.ruler,`before`,[`critic`],`critic_substitution`,Vz)]})),Uz=MS(()=>({name:`editor-footnotes`,markdownItPlugins:lM().markdownItPlugins})),Wz=MS(()=>({name:`alert`})),Gz=`data-comark-editor-shorthand`;function Kz(e){for(let t of e)(t.type===`mdc_block_shorthand`||t.type===`mdc_block_shorthand_open`)&&t.attrSet(Gz,``),t.children&&Kz(t.children)}var qz=MS(()=>({name:`editor-shorthands`,markdownItPost:e=>Kz(e.tokens)})),Jz=[Wz(),Nj(),Hz(),Uj(),dj(),Uz(),qz()],Yz={autoUnwrap:!1,headingIds:!1},Xz={...Yz,plugins:Jz},Zz=new Map([[`strong`,`bold`],[`em`,`italic`],[`del`,`strike`],[`code`,`code`],[`a`,`link`]]),Qz=`cfn-def:`,$z=`cfn-ref:`,eB=`cfn-note`,tB=new Map([...Zz].map(([e,t])=>[t,e])),nB=new Set([...Zz.keys(),`br`,`img`,`span`,`input`,`ins`,`mark`,zz,eB]),rB=new Set([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`]),iB=e=>!Array.isArray(e),aB=e=>Array.isArray(e)&&e[0]!==null,oB=e=>e.slice(2),sB=({$:e})=>e instanceof Object&&`block`in e&&e.block===0,cB=e=>iB(e)||aB(e)&&(nB.has(e[0])||e[0].startsWith($z)||sB(e[1])),lB=e=>e.$ instanceof Object;function Z(e,...t){let n=Object.fromEntries(Object.entries(e).filter(([e])=>!t.includes(e)));return Object.keys(n).length?n:void 0}var uB=e=>f_(e.class)?.split(/\s+/)??[];function dB(e,t){let n=uB(e).filter(e=>e&&e!==t),{class:r,...i}=e;return n.length?{...i,class:n.join(` `)}:i}function fB(e,t){return{...e,class:[t,...uB(e).filter(e=>e&&e!==t)].join(` `)}}var Q=(e,t)=>t?{...e,props:t}:e,$=(e,t,n)=>{let r={type:e};return Object.keys(t).length&&(r.attrs=t),n?.length&&(r.content=n),r};function pB(e,t){let n=[],r=[],i=()=>{r.some(e=>!iB(e)||e.trim())&&n.push($(`paragraph`,{},DB(r,[],t))),r=[]};for(let a of e)cB(a)?r.push(a):(i(),n.push(...mB(a,t)));return i(),n}function mB(e,t){if(iB(e))return[];if(!aB(e))return[$(`comarkComment`,{text:e[2]})];let[n,r]=e,i=oB(e);if(`data-comark-editor-shorthand`in r){let{[Gz]:e,...a}=r;return[$(`paragraph`,{},DB([[n,a,...i]],[],t))]}return n===`p`?[$(`paragraph`,Q({},Z(r)),DB(i,[],t))]:rB.has(n)?[$(`heading`,Q({level:Number(n[1])},Z(r)),DB(i,[],t))]:n===`blockquote`?[$(`blockquote`,Q({},Z(r)),pB(i,t))]:n===`hr`?[$(`horizontalRule`,Q({},Z(r)))]:n===`pre`?[vB(r,i)]:n===`table`&&i.length&&i.every(e=>aB(e)&&[`thead`,`tbody`,`tr`].includes(e[0]))?[CB(r,i,t)]:n===`ul`||n===`ol`?[xB(n,r,i,t)]:n.startsWith(Qz)?[$(`footnoteDefinition`,{label:n.slice(8)},hB(pB(i,t)))]:n===`dl`?[gB(r,i,t)]:(n===`template`&&(t.lossy=!0),[$(`comarkBlock`,Q({name:n},Z(r)),_B(i,t))])}var hB=e=>e.length?e:[{type:`paragraph`}];function gB(e,t,n){return $(`definitionList`,Q({},Z(e)),t.flatMap(e=>aB(e)?e[0]===`dt`?[$(`definitionTerm`,Q({},Z(e[1])),DB(oB(e),[],n))]:[$(`definitionDescription`,Q({},Z(e[1])),hB(pB(oB(e),n)))]:[]))}function _B(e,t){let n=[],r=[],i=()=>{n.push(...pB(r,t)),r=[]};for(let a of e)if(aB(a)&&a[0]===`template`){i();let{name:e,...r}=a[1];n.push($(`comarkSlot`,Q({name:f_(e)??`default`},Z(r)),pB(oB(a),t)))}else r.push(a);return i(),n}function vB(e,t){let n=t.find(aB),r=(n?oB(n):t).filter(iB).join(``),i=f_(e.language)??null;return $(`codeBlock`,Q(i?{language:i}:{},Z(e,`language`)),r?[{type:`text`,text:r}]:[])}var yB=e=>aB(e)&&e[0]===`li`&&uB(e[1]).includes(`task-list-item`),bB=e=>aB(e)&&e[0]===`input`&&e[1].type===`checkbox`;function xB(e,t,n,r){let i=n.filter(aB);if(e===`ul`&&i.length&&i.every(yB))return $(`taskList`,Q({},Z(dB(t,`contains-task-list`))),i.map(e=>SB(e,r)));let a=i.map(e=>{let t=pB(oB(e),r);return t[0]?.type!==`paragraph`&&t.unshift({type:`paragraph`}),$(`listItem`,Q({},Z(e[1])),t)});if(e===`ul`)return $(`bulletList`,Q({},Z(t)),a);let o=Number(t.start??1);return $(`orderedList`,Q(o===1?{}:{start:o},Z(t,`start`)),a)}function SB(e,t){let n=!1,r=e=>{let[t,r,...i]=e;return t===void 0||!bB(t)?e:(n=t[1][`:checked`]===`true`||t[1].checked===!0,r===void 0?i:iB(r)?[r.replace(/^\s+/,``),...i]:[r,...i])},[i,...a]=oB(e),o;o=i!==void 0&&aB(i)&&i[0]===`p`?[[i[0],i[1],...r(oB(i))],...a]:r(oB(e));let s=pB(o,t);return s[0]?.type!==`paragraph`&&s.unshift({type:`paragraph`}),$(`taskItem`,Q({checked:n},Z(dB(e[1],`task-list-item`))),s)}function CB(e,t,n){let r=t.filter(aB).flatMap(e=>e[0]===`tr`?[e]:oB(e).filter(aB));return $(`table`,Q({},Z(e)),r.map(e=>$(`tableRow`,Q({},Z(e[1])),oB(e).filter(aB).map(e=>$(e[0]===`th`?`tableHeader`:`tableCell`,Q({},Z(e[1])),[$(`paragraph`,{},DB(oB(e),[],n))])))))}var wB=new Map([[`ins`,{className:`ccm-ins`,type:`criticInsertion`}],[`del`,{className:`ccm-del`,type:`criticDeletion`}],[`mark`,{className:`ccm-mark`,type:`criticHighlight`}]]),TB=`ccm-comment`;function EB([e,t]){let n=wB.get(e);if(n&&uB(t).includes(n.className))return{className:n.className,mark:{type:n.type}}}function DB(e,t,n){let r=[],i=e=>t.length?{...e,marks:t}:e;for(let a of e){if(iB(a)){a&&r.push(i({type:`text`,text:a}));continue}if(!aB(a)){n.lossy=!0;continue}let[e,o]=a,s=oB(a),c=EB(a),l=Zz.get(e);if(c)Z(dB(o,c.className))&&(n.lossy=!0),r.push(...DB(s,[...t,c.mark],n));else if(e===`critic-sub`){let[e,i]=s.filter(aB),a=(e,r)=>e?DB(oB(e),[...t,{type:r,attrs:{substitution:!0}}],n):[];r.push(...a(e,`criticDeletion`),...a(i,`criticInsertion`))}else if(e===`span`&&uB(o).includes(TB))Z(dB(o,TB))&&(n.lossy=!0),r.push(i($(`criticComment`,{},DB(s,[],n))));else if(e.startsWith($z))r.push(i($(`footnoteReference`,{label:e.slice(8)})));else if(e===eB)r.push(i($(`inlineFootnote`,{},DB(s,[],n))));else if(l&&(e!==`code`||s.every(iB))){let e=l===`link`?Q({href:o.href??null,title:o.title??null},Z(o,`href`,`title`)):Q({},Z(o)),i=Object.keys(e).length?{type:l,attrs:e}:{type:l};r.push(...DB(s,[...t,i],n))}else e===`br`?r.push(i($(`hardBreak`,Q({},Z(o))))):e===`img`?r.push(i($(`image`,Q({src:o.src??null,alt:o.alt??null,title:o.title??null},Z(o,`src`,`alt`,`title`))))):r.push(i($(`comarkInline`,Q({name:e},Z(o)),DB(s,[],n))))}return r}var OB=e=>e?.props??{},kB=(e=[])=>e.map(e=>e.text??``).join(``);function AB(e=[]){return e.flatMap(jB)}function jB(e){let t=OB(e.attrs),n=e.attrs??{};switch(e.type){case`paragraph`:return e.content?.length?[[`p`,t,...LB(e.content)]]:[];case`heading`:return[[`h${Number(n.level??1)}`,t,...LB(e.content)]];case`blockquote`:return[[`blockquote`,t,...AB(e.content)]];case`horizontalRule`:return[[`hr`,t]];case`codeBlock`:{let r=f_(n.language)||void 0,i=kB(e.content),a=[`pre`,r?{...t,language:r}:t,[`code`,r?{class:`language-${r}`}:{},i]];return[i.trimEnd()===i?a:wz(a,jz)]}case`bulletList`:return[[`ul`,t,...AB(e.content)]];case`orderedList`:{let r=Number(n.start??1);return[[`ol`,r===1?t:{...t,start:r},...AB(e.content)]]}case`listItem`:return[[`li`,t,...AB(e.content)]];case`taskList`:return[[`ul`,fB(t,`contains-task-list`),...AB(e.content)]];case`taskItem`:return[wz([`li`,t,...AB(e.content)],kz(!!n.checked))];case`table`:return[MB(e,t)];case`comarkBlock`:{let r=[String(n.name),t,...(e.content??[]).flatMap(e=>e.type===`comarkSlot`?[[`template`,{...OB(e.attrs),name:e.attrs?.name},...AB(e.content)]]:jB(e))];return[lB(t)?r:wz(r,Dz)]}case`footnoteDefinition`:{let t=f_(n.label)??``;return[wz([`footnote`,{},...AB(e.content)],Fz(t))]}case`definitionList`:return[wz([`dl`,t,...(e.content??[]).map(e=>e.type===`definitionTerm`?[`dt`,OB(e.attrs),...LB(e.content)]:[`dd`,OB(e.attrs),...AB(e.content)])],Iz)];case`comarkComment`:return[[null,{},f_(n.text)??``]];default:return[]}}function MB(e,t){let n=e.content??[],r=e=>e.content?.every(e=>e.type===`tableHeader`)??!1,i=n.findIndex(e=>!r(e)),a=i===-1?n.length:Math.max(1,i),o=e=>t=>[`tr`,OB(t.attrs),...(t.content??[]).map(t=>[e,OB(t.attrs),...(t.content??[]).flatMap((e,t)=>[...t?[[`br`,{}]]:[],...LB(e.content)])])],s=n.slice(a).map(o(`td`));return[`table`,t,[`thead`,{},...n.slice(0,a).map(o(`th`))],...s.length?[[`tbody`,{},...s]]:[]]}var NB=(e,t)=>e.type===t.type&&JSON.stringify(e.attrs??{})===JSON.stringify(t.attrs??{}),PB=new Map([[`criticInsertion`,[`{++`,`++}`]],[`criticDeletion`,[`{--`,`--}`]],[`criticHighlight`,[`{==`,`==}`]]]);function FB(e,t){let n=PB.get(e.type);if(n)return wz([e.attrs?.substitution?e.type:`critic`,{},...t],Mz(...n));let r=OB(e.attrs);if(e.type!==`link`)return[tB.get(e.type)??`span`,r,...t];let i=f_(e.attrs?.href),a=f_(e.attrs?.title),o={...r,href:i};return a&&(o.title=a),[`a`,o,...t]}function IB(e,t){let n=e.at(-1);n!==void 0&&iB(n)&&iB(t)?e[e.length-1]=n+t:e.push(t)}function LB(e=[]){let t=[],n=[],r=e=>{for(let r=t.pop();r;r=t.length>e?t.pop():void 0)IB(t.at(-1)?.children??n,FB(r.mark,r.children))};for(let i of e){let e=[...i.marks??[]].sort((e,t)=>RB(e)-RB(t)),a=n=>{let r=t[n],i=e[n];return r!==void 0&&i!==void 0&&NB(r.mark,i)},o=0;for(;a(o);)o++;t.length>o&&r(o);for(let n of e.slice(o))t.push({mark:n,children:[]});for(let e of BB(i))IB(t.at(-1)?.children??n,e)}return t.length&&r(0),zB(n)}var RB=e=>PB.has(e.type)?-1:+(e.type===`code`);function zB(e){let t=[];for(let n of e){let e=t.at(-1);aB(n)&&n[0]===`criticInsertion`&&e!==void 0&&aB(e)&&e[0]===`criticDeletion`?t[t.length-1]=wz([zz,{},e,n],Nz):t.push(n)}return t}function BB(e){let t=OB(e.attrs),n=e.attrs??{};if(e.type===`text`)return e.text?[e.text]:[];if(e.type===`hardBreak`)return[[`br`,t]];if(e.type===`image`){let e={...t,src:n.src};return n.alt&&(e.alt=n.alt),n.title&&(e.title=n.title),[[`img`,e]]}if(e.type===`comarkInline`){let r=[String(n.name),t,...LB(e.content)];return[lB(t)?r:wz(r,Oz)]}return e.type===`footnoteReference`?[wz([`footnote`,{}],Pz(f_(n.label)??``))]:e.type===`inlineFootnote`?[wz([`footnote`,{},...LB(e.content)],Mz(`^[`,`]`))]:e.type===`criticComment`?[wz([`span`,{},...LB(e.content)],Mz(`{>>`,`<<}`))]:[]}function VB(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object)||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.entries(e).filter(([,e])=>e!==void 0),r=new Map(Object.entries(t).filter(([,e])=>e!==void 0));return n.length===r.size&&n.every(([e,t])=>r.has(e)&&VB(t,r.get(e)))}async function HB(e){let t=await zA(e,Xz),n={lossy:!1},r=pB(t.nodes,n);return{doc:{type:`doc`,content:r.length?r:[{type:`paragraph`}]},frontmatter:t.frontmatter??{},lossy:n.lossy}}async function UB(e,t={}){let n=await QR({nodes:AB(e.content),frontmatter:{},meta:{}},Tz);return qB(n.trim()?`${n.trimEnd()}\n`:``,t.frontmatter)}function WB(e){if(!e.startsWith(`---`)||!e.includes(`
|
|
268
|
-
---`))return{kind:`none`};let t;try{t=
|
|
266
|
+
`}async function QR(e,t){let n=await ZR(e,{format:`markdown/comark`,...t});return Lk(e.frontmatter||{},n,t?.frontmatterOptions)}var $R=[`paragraph`,`heading`,`blockquote`,`bulletList`,`orderedList`,`listItem`,`taskList`,`taskItem`,`codeBlock`,`horizontalRule`,`hardBreak`,`image`,`table`,`tableRow`,`tableHeader`,`tableCell`,`bold`,`italic`,`strike`,`code`,`link`,`definitionList`,`definitionTerm`,`definitionDescription`];function ez(e){try{return JSON.parse(e.getAttribute(`data-comark-props`)??`null`)}catch{return null}}var tz={default:null,parseHTML:ez,renderHTML:e=>e.props?{"data-comark-props":JSON.stringify(e.props)}:{}},nz=e=>({default:``,parseHTML:t=>t.getAttribute(e)??``,renderHTML:t=>({[e]:t.name})});function rz(e){let t=(e??``).replace(/[?#].*$/,``);return/\.(?:mp4|webm|mov|m4v)$/i.test(t)?`video`:/\.(?:mp3|wav|ogg|m4a)$/i.test(t)?`audio`:void 0}var iz=uM.extend({renderHTML({node:e,HTMLAttributes:t}){let n=rz(e.attrs.src);return n?[n,{src:e.attrs.src,title:e.attrs.title,controls:``,preload:`metadata`}]:this.parent?.({node:e,HTMLAttributes:t})??[`img`,t]}}).configure({inline:!0}),az=B.create({name:`comarkBlock`,group:`block`,content:`(block | comarkSlot)*`,defining:!0,addAttributes:()=>({name:nz(`data-comark-block`),props:tz}),parseHTML:()=>[{tag:`div[data-comark-block]`}],renderHTML:({HTMLAttributes:e})=>[`div`,e,0]}),oz=B.create({name:`comarkSlot`,content:`block*`,defining:!0,addAttributes:()=>({name:nz(`data-comark-slot`),props:tz}),parseHTML:()=>[{tag:`div[data-comark-slot]`}],renderHTML:({HTMLAttributes:e})=>[`div`,e,0]}),sz=B.create({name:`comarkInline`,group:`inline`,inline:!0,content:`inline*`,addAttributes:()=>({name:nz(`data-comark-inline`),props:tz}),parseHTML:()=>[{tag:`span[data-comark-inline]`}],renderHTML:({HTMLAttributes:e})=>[`span`,e,0]}),cz=B.create({name:`comarkComment`,group:`block`,atom:!0,addAttributes:()=>({text:{default:``,parseHTML:e=>e.getAttribute(`data-comark-comment`)??``,renderHTML:e=>({"data-comark-comment":e.text})}}),parseHTML:()=>[{tag:`div[data-comark-comment]`}],renderHTML:({HTMLAttributes:e})=>[`div`,e]}),lz={default:``,parseHTML:e=>e.getAttribute(`data-label`)??``,renderHTML:e=>({"data-label":e.label})},uz=B.create({name:`footnoteReference`,group:`inline`,inline:!0,atom:!0,addAttributes:()=>({label:lz}),parseHTML:()=>[{tag:`sup[data-footnote-reference]`}],renderHTML:({node:e,HTMLAttributes:t})=>[`sup`,{...t,"data-footnote-reference":``},e.attrs.label]}),dz=B.create({name:`inlineFootnote`,group:`inline`,inline:!0,content:`inline*`,parseHTML:()=>[{tag:`span[data-inline-footnote]`}],renderHTML:({HTMLAttributes:e})=>[`span`,{...e,"data-inline-footnote":``},0]}),fz=B.create({name:`footnoteDefinition`,group:`block`,content:`block+`,defining:!0,addAttributes:()=>({label:lz}),parseHTML:()=>[{tag:`div[data-footnote-definition]`}],renderHTML:({HTMLAttributes:e})=>[`div`,{...e,"data-footnote-definition":``},0]}),pz=B.create({name:`definitionList`,group:`block`,content:`(definitionTerm definitionDescription+)+`,parseHTML:()=>[{tag:`dl`}],renderHTML:({HTMLAttributes:e})=>[`dl`,e,0]}),mz=B.create({name:`definitionTerm`,content:`inline*`,defining:!0,parseHTML:()=>[{tag:`dt`}],renderHTML:({HTMLAttributes:e})=>[`dt`,e,0]}),hz=B.create({name:`definitionDescription`,content:`block+`,defining:!0,parseHTML:()=>[{tag:`dd`}],renderHTML:({HTMLAttributes:e})=>[`dd`,e,0]}),gz={default:!1,parseHTML:e=>e.hasAttribute(`data-substitution`),renderHTML:e=>e.substitution?{"data-substitution":``}:{}},_z=ym.create({name:`criticInsertion`,addAttributes:()=>({substitution:gz}),parseHTML:()=>[{tag:`ins`}],renderHTML:({HTMLAttributes:e})=>[`ins`,e,0]}),vz=ym.create({name:`criticDeletion`,addAttributes:()=>({substitution:gz}),parseHTML:()=>[{tag:`del[data-critic]`,priority:60}],renderHTML:({HTMLAttributes:e})=>[`del`,{...e,"data-critic":``},0]}),yz=ym.create({name:`criticHighlight`,parseHTML:()=>[{tag:`mark`}],renderHTML:({HTMLAttributes:e})=>[`mark`,e,0]}),bz=B.create({name:`criticComment`,group:`inline`,inline:!0,content:`inline*`,parseHTML:()=>[{tag:`span[data-critic-comment]`}],renderHTML:({HTMLAttributes:e})=>[`span`,{...e,"data-critic-comment":``},0]}),xz=z.create({name:`comarkKit`,addOptions:()=>({starterKit:{}}),addGlobalAttributes:()=>[{types:$R,attributes:{props:tz}}],addExtensions(){return[YL.extend({addExtensions(){return(this.parent?.()??[]).map(e=>e.name===`code`?e.extend({excludes:``}):e)}}).configure({...this.options.starterKit,underline:!1}),_N,gN.configure({nested:!0}),iz,QN.configure({table:{resizable:!1}}),az,oz,sz,cz,uz,dz,fz,pz,mz,hz,_z,vz,yz,bz]}}),Sz=new WeakMap,Cz=e=>Array.isArray(e)&&e[0]!==null;function wz(e,t){return Sz.set(e,t),e}var Tz={headingIds:!1,maxInlineAttributes:1/0,components:{owned:{match:e=>Sz.has(e),handler:(e,t,n)=>Sz.get(e)?.(e,t,n)??``}}},Ez=`comark-editor-table`,Dz=async(e,t)=>{let[n,r,...i]=e;return n===`table`?(await t.handlers.mdc([Ez,r,...i],t)).replace(Ez,`table`):t.handlers.mdc(e,t)},Oz=async(e,t,n)=>{let r=t.applyContext({inline:!0});try{return await t.handlers.mdc(e,t,n)}finally{t.applyContext(r)}},kz=e=>async(t,n,r)=>(await n.handlers.li(t,n,r)).replace(/^(- |\d+\. )/,`$1[${e?`x`:` `}] `),Az=``,jz=async([e,t,...n],r)=>{let i=await r.handlers.pre([e,t,...n,Az],r),a=i.lastIndexOf(Az);return i.slice(0,a)+i.slice(a+1)},Mz=(e,t)=>async(n,r)=>`${e}${await r.flow(n,r)}${t}`,Nz=async([,,e,t],n)=>{let r=async e=>Cz(e)?n.flow(e,n):``;return`{~~${await r(e)}~>${await r(t)}~~}`},Pz=e=>()=>`[^${e}]`,Fz=e=>async(t,n)=>`[^${e}]: ${HO((await n.flow(t,n)).trim(),{width:4,ignoreFirstLine:!0})}${n.context.blockSeparator}`,Iz=async(e,t)=>{let n=``;for(let r of e.slice(2)){if(!Cz(r))continue;let e=(await t.flow(r,t)).trim();r[0]===`dt`?n+=`${n?`
|
|
267
|
+
`:``}${e}\n`:n+=`: ${HO(e,{width:4,ignoreFirstLine:!0})}\n`}return n.trimEnd()+t.context.blockSeparator},Lz=`mdc_inline_span`;function Rz(e,t,n,r,i,a){for(let o of n)try{e[t](o,r,i,a);return}catch{}e.push(r,i,a)}var zz=`critic-sub`,Bz=!1;function Vz(e,t){if(t||Bz||!e.src.startsWith(`{~~`,e.pos))return!1;let n=e.pos,r=e.posMax,i=e.md.inline.ruler.getRules(``),a=i[i.indexOf(Vz)+1];if(!a?.(e,!0))return!1;let o=e.pos;e.pos=n,e.push(`${Lz}_open`,zz,1),e.posMax=o,Bz=!0;try{e.md.inline.tokenize(e)}finally{Bz=!1}return e.posMax=r,e.push(`${Lz}_close`,zz,-1),!0}var Hz=jS(()=>({name:`editor-critic-substitutions`,markdownItPlugins:[e=>Rz(e.inline.ruler,`before`,[`critic`],`critic_substitution`,Vz)]})),Uz=jS(()=>({name:`editor-footnotes`,markdownItPlugins:cM().markdownItPlugins})),Wz=jS(()=>({name:`alert`})),Gz=`data-comark-editor-shorthand`;function Kz(e){for(let t of e)(t.type===`mdc_block_shorthand`||t.type===`mdc_block_shorthand_open`)&&t.attrSet(Gz,``),t.children&&Kz(t.children)}var qz=jS(()=>({name:`editor-shorthands`,markdownItPost:e=>Kz(e.tokens)})),Jz=[Wz(),Mj(),Hz(),Hj(),uj(),Uz(),qz()],Yz={autoUnwrap:!1,headingIds:!1},Xz={...Yz,plugins:Jz},Zz=new Map([[`strong`,`bold`],[`em`,`italic`],[`del`,`strike`],[`code`,`code`],[`a`,`link`]]),Qz=`cfn-def:`,$z=`cfn-ref:`,eB=`cfn-note`,tB=new Map([...Zz].map(([e,t])=>[t,e])),nB=new Set([...Zz.keys(),`br`,`img`,`span`,`input`,`ins`,`mark`,zz,eB]),rB=new Set([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`]),iB=e=>!Array.isArray(e),aB=e=>Array.isArray(e)&&e[0]!==null,oB=e=>e.slice(2),sB=({$:e})=>e instanceof Object&&`block`in e&&e.block===0,cB=e=>iB(e)||aB(e)&&(nB.has(e[0])||e[0].startsWith($z)||sB(e[1])),lB=e=>e.$ instanceof Object;function Z(e,...t){let n=Object.fromEntries(Object.entries(e).filter(([e])=>!t.includes(e)));return Object.keys(n).length?n:void 0}var uB=e=>d_(e.class)?.split(/\s+/)??[];function dB(e,t){let n=uB(e).filter(e=>e&&e!==t),{class:r,...i}=e;return n.length?{...i,class:n.join(` `)}:i}function fB(e,t){return{...e,class:[t,...uB(e).filter(e=>e&&e!==t)].join(` `)}}var Q=(e,t)=>t?{...e,props:t}:e,$=(e,t,n)=>{let r={type:e};return Object.keys(t).length&&(r.attrs=t),n?.length&&(r.content=n),r};function pB(e,t){let n=[],r=[],i=()=>{r.some(e=>!iB(e)||e.trim())&&n.push($(`paragraph`,{},DB(r,[],t))),r=[]};for(let a of e)cB(a)?r.push(a):(i(),n.push(...mB(a,t)));return i(),n}function mB(e,t){if(iB(e))return[];if(!aB(e))return[$(`comarkComment`,{text:e[2]})];let[n,r]=e,i=oB(e);if(`data-comark-editor-shorthand`in r){let{[Gz]:e,...a}=r;return[$(`paragraph`,{},DB([[n,a,...i]],[],t))]}return n===`p`?[$(`paragraph`,Q({},Z(r)),DB(i,[],t))]:rB.has(n)?[$(`heading`,Q({level:Number(n[1])},Z(r)),DB(i,[],t))]:n===`blockquote`?[$(`blockquote`,Q({},Z(r)),pB(i,t))]:n===`hr`?[$(`horizontalRule`,Q({},Z(r)))]:n===`pre`?[vB(r,i)]:n===`table`&&i.length&&i.every(e=>aB(e)&&[`thead`,`tbody`,`tr`].includes(e[0]))?[CB(r,i,t)]:n===`ul`||n===`ol`?[xB(n,r,i,t)]:n.startsWith(Qz)?[$(`footnoteDefinition`,{label:n.slice(8)},hB(pB(i,t)))]:n===`dl`?[gB(r,i,t)]:(n===`template`&&(t.lossy=!0),[$(`comarkBlock`,Q({name:n},Z(r)),_B(i,t))])}var hB=e=>e.length?e:[{type:`paragraph`}];function gB(e,t,n){return $(`definitionList`,Q({},Z(e)),t.flatMap(e=>aB(e)?e[0]===`dt`?[$(`definitionTerm`,Q({},Z(e[1])),DB(oB(e),[],n))]:[$(`definitionDescription`,Q({},Z(e[1])),hB(pB(oB(e),n)))]:[]))}function _B(e,t){let n=[],r=[],i=()=>{n.push(...pB(r,t)),r=[]};for(let a of e)if(aB(a)&&a[0]===`template`){i();let{name:e,...r}=a[1];n.push($(`comarkSlot`,Q({name:d_(e)??`default`},Z(r)),pB(oB(a),t)))}else r.push(a);return i(),n}function vB(e,t){let n=t.find(aB),r=(n?oB(n):t).filter(iB).join(``),i=d_(e.language)??null;return $(`codeBlock`,Q(i?{language:i}:{},Z(e,`language`)),r?[{type:`text`,text:r}]:[])}var yB=e=>aB(e)&&e[0]===`li`&&uB(e[1]).includes(`task-list-item`),bB=e=>aB(e)&&e[0]===`input`&&e[1].type===`checkbox`;function xB(e,t,n,r){let i=n.filter(aB);if(e===`ul`&&i.length&&i.every(yB))return $(`taskList`,Q({},Z(dB(t,`contains-task-list`))),i.map(e=>SB(e,r)));let a=i.map(e=>{let t=pB(oB(e),r);return t[0]?.type!==`paragraph`&&t.unshift({type:`paragraph`}),$(`listItem`,Q({},Z(e[1])),t)});if(e===`ul`)return $(`bulletList`,Q({},Z(t)),a);let o=Number(t.start??1);return $(`orderedList`,Q(o===1?{}:{start:o},Z(t,`start`)),a)}function SB(e,t){let n=!1,r=e=>{let[t,r,...i]=e;return t===void 0||!bB(t)?e:(n=t[1][`:checked`]===`true`||t[1].checked===!0,r===void 0?i:iB(r)?[r.replace(/^\s+/,``),...i]:[r,...i])},[i,...a]=oB(e),o;o=i!==void 0&&aB(i)&&i[0]===`p`?[[i[0],i[1],...r(oB(i))],...a]:r(oB(e));let s=pB(o,t);return s[0]?.type!==`paragraph`&&s.unshift({type:`paragraph`}),$(`taskItem`,Q({checked:n},Z(dB(e[1],`task-list-item`))),s)}function CB(e,t,n){let r=t.filter(aB).flatMap(e=>e[0]===`tr`?[e]:oB(e).filter(aB));return $(`table`,Q({},Z(e)),r.map(e=>$(`tableRow`,Q({},Z(e[1])),oB(e).filter(aB).map(e=>$(e[0]===`th`?`tableHeader`:`tableCell`,Q({},Z(e[1])),[$(`paragraph`,{},DB(oB(e),[],n))])))))}var wB=new Map([[`ins`,{className:`ccm-ins`,type:`criticInsertion`}],[`del`,{className:`ccm-del`,type:`criticDeletion`}],[`mark`,{className:`ccm-mark`,type:`criticHighlight`}]]),TB=`ccm-comment`;function EB([e,t]){let n=wB.get(e);if(n&&uB(t).includes(n.className))return{className:n.className,mark:{type:n.type}}}function DB(e,t,n){let r=[],i=e=>t.length?{...e,marks:t}:e;for(let a of e){if(iB(a)){a&&r.push(i({type:`text`,text:a}));continue}if(!aB(a)){n.lossy=!0;continue}let[e,o]=a,s=oB(a),c=EB(a),l=Zz.get(e);if(c)Z(dB(o,c.className))&&(n.lossy=!0),r.push(...DB(s,[...t,c.mark],n));else if(e===`critic-sub`){let[e,i]=s.filter(aB),a=(e,r)=>e?DB(oB(e),[...t,{type:r,attrs:{substitution:!0}}],n):[];r.push(...a(e,`criticDeletion`),...a(i,`criticInsertion`))}else if(e===`span`&&uB(o).includes(TB))Z(dB(o,TB))&&(n.lossy=!0),r.push(i($(`criticComment`,{},DB(s,[],n))));else if(e.startsWith($z))r.push(i($(`footnoteReference`,{label:e.slice(8)})));else if(e===eB)r.push(i($(`inlineFootnote`,{},DB(s,[],n))));else if(l&&(e!==`code`||s.every(iB))){let e=l===`link`?Q({href:o.href??null,title:o.title??null},Z(o,`href`,`title`)):Q({},Z(o)),i=Object.keys(e).length?{type:l,attrs:e}:{type:l};r.push(...DB(s,[...t,i],n))}else e===`br`?r.push(i($(`hardBreak`,Q({},Z(o))))):e===`img`?r.push(i($(`image`,Q({src:o.src??null,alt:o.alt??null,title:o.title??null},Z(o,`src`,`alt`,`title`))))):r.push(i($(`comarkInline`,Q({name:e},Z(o)),DB(s,[],n))))}return r}var OB=e=>e?.props??{},kB=(e=[])=>e.map(e=>e.text??``).join(``);function AB(e=[]){return e.flatMap(jB)}function jB(e){let t=OB(e.attrs),n=e.attrs??{};switch(e.type){case`paragraph`:return e.content?.length?[[`p`,t,...LB(e.content)]]:[];case`heading`:return[[`h${Number(n.level??1)}`,t,...LB(e.content)]];case`blockquote`:return[[`blockquote`,t,...AB(e.content)]];case`horizontalRule`:return[[`hr`,t]];case`codeBlock`:{let r=d_(n.language)||void 0,i=kB(e.content),a=[`pre`,r?{...t,language:r}:t,[`code`,r?{class:`language-${r}`}:{},i]];return[i.trimEnd()===i?a:wz(a,jz)]}case`bulletList`:return[[`ul`,t,...AB(e.content)]];case`orderedList`:{let r=Number(n.start??1);return[[`ol`,r===1?t:{...t,start:r},...AB(e.content)]]}case`listItem`:return[[`li`,t,...AB(e.content)]];case`taskList`:return[[`ul`,fB(t,`contains-task-list`),...AB(e.content)]];case`taskItem`:return[wz([`li`,t,...AB(e.content)],kz(!!n.checked))];case`table`:return[MB(e,t)];case`comarkBlock`:{let r=[String(n.name),t,...(e.content??[]).flatMap(e=>e.type===`comarkSlot`?[[`template`,{...OB(e.attrs),name:e.attrs?.name},...AB(e.content)]]:jB(e))];return[lB(t)?r:wz(r,Dz)]}case`footnoteDefinition`:{let t=d_(n.label)??``;return[wz([`footnote`,{},...AB(e.content)],Fz(t))]}case`definitionList`:return[wz([`dl`,t,...(e.content??[]).map(e=>e.type===`definitionTerm`?[`dt`,OB(e.attrs),...LB(e.content)]:[`dd`,OB(e.attrs),...AB(e.content)])],Iz)];case`comarkComment`:return[[null,{},d_(n.text)??``]];default:return[]}}function MB(e,t){let n=e.content??[],r=e=>e.content?.every(e=>e.type===`tableHeader`)??!1,i=n.findIndex(e=>!r(e)),a=i===-1?n.length:Math.max(1,i),o=e=>t=>[`tr`,OB(t.attrs),...(t.content??[]).map(t=>[e,OB(t.attrs),...(t.content??[]).flatMap((e,t)=>[...t?[[`br`,{}]]:[],...LB(e.content)])])],s=n.slice(a).map(o(`td`));return[`table`,t,[`thead`,{},...n.slice(0,a).map(o(`th`))],...s.length?[[`tbody`,{},...s]]:[]]}var NB=(e,t)=>e.type===t.type&&JSON.stringify(e.attrs??{})===JSON.stringify(t.attrs??{}),PB=new Map([[`criticInsertion`,[`{++`,`++}`]],[`criticDeletion`,[`{--`,`--}`]],[`criticHighlight`,[`{==`,`==}`]]]);function FB(e,t){let n=PB.get(e.type);if(n)return wz([e.attrs?.substitution?e.type:`critic`,{},...t],Mz(...n));let r=OB(e.attrs);if(e.type!==`link`)return[tB.get(e.type)??`span`,r,...t];let i=d_(e.attrs?.href),a=d_(e.attrs?.title),o={...r,href:i};return a&&(o.title=a),[`a`,o,...t]}function IB(e,t){let n=e.at(-1);n!==void 0&&iB(n)&&iB(t)?e[e.length-1]=n+t:e.push(t)}function LB(e=[]){let t=[],n=[],r=e=>{for(let r=t.pop();r;r=t.length>e?t.pop():void 0)IB(t.at(-1)?.children??n,FB(r.mark,r.children))};for(let i of e){let e=[...i.marks??[]].sort((e,t)=>RB(e)-RB(t)),a=n=>{let r=t[n],i=e[n];return r!==void 0&&i!==void 0&&NB(r.mark,i)},o=0;for(;a(o);)o++;t.length>o&&r(o);for(let n of e.slice(o))t.push({mark:n,children:[]});for(let e of BB(i))IB(t.at(-1)?.children??n,e)}return t.length&&r(0),zB(n)}var RB=e=>PB.has(e.type)?-1:+(e.type===`code`);function zB(e){let t=[];for(let n of e){let e=t.at(-1);aB(n)&&n[0]===`criticInsertion`&&e!==void 0&&aB(e)&&e[0]===`criticDeletion`?t[t.length-1]=wz([zz,{},e,n],Nz):t.push(n)}return t}function BB(e){let t=OB(e.attrs),n=e.attrs??{};if(e.type===`text`)return e.text?[e.text]:[];if(e.type===`hardBreak`)return[[`br`,t]];if(e.type===`image`){let e={...t,src:n.src};return n.alt&&(e.alt=n.alt),n.title&&(e.title=n.title),[[`img`,e]]}if(e.type===`comarkInline`){let r=[String(n.name),t,...LB(e.content)];return[lB(t)?r:wz(r,Oz)]}return e.type===`footnoteReference`?[wz([`footnote`,{}],Pz(d_(n.label)??``))]:e.type===`inlineFootnote`?[wz([`footnote`,{},...LB(e.content)],Mz(`^[`,`]`))]:e.type===`criticComment`?[wz([`span`,{},...LB(e.content)],Mz(`{>>`,`<<}`))]:[]}function VB(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object)||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.entries(e).filter(([,e])=>e!==void 0),r=new Map(Object.entries(t).filter(([,e])=>e!==void 0));return n.length===r.size&&n.every(([e,t])=>r.has(e)&&VB(t,r.get(e)))}async function HB(e){let t=await RA(e,Xz),n={lossy:!1},r=pB(t.nodes,n);return{doc:{type:`doc`,content:r.length?r:[{type:`paragraph`}]},frontmatter:t.frontmatter??{},lossy:n.lossy}}async function UB(e,t={}){let n=await QR({nodes:AB(e.content),frontmatter:{},meta:{}},Tz);return qB(n.trim()?`${n.trimEnd()}\n`:``,t.frontmatter)}function WB(e){if(!e.startsWith(`---`)||!e.includes(`
|
|
268
|
+
---`))return{kind:`none`};let t;try{t=Ik(e)}catch(t){return{kind:`lost`,problem:`The frontmatter isn't valid YAML (${String(t instanceof Error&&`reason`in t?t.reason:t)}); fix it to edit the document.`,body:e.slice(e.indexOf(`
|
|
269
269
|
---`)+4).replace(/^(?:\r?\n)+/,``)}}let{data:n,frontmatterText:r}=t,i=n;if(!(i instanceof Object)||Array.isArray(i))return{kind:`lost`,problem:`The frontmatter is a YAML ${Array.isArray(i)?`list`:`scalar`}, which a save would rewrite; turn it into \`key: value\` lines to edit the document.`};let a=KB(r);return Object.keys(n).length?a?{kind:`lost`,problem:`The frontmatter has YAML comments, which a save would drop; delete them or move them into the text to edit the document.`}:GB(n)?{kind:`lost`,problem:"The frontmatter has a `__proto__` key, which the room's fields would drop on save; rename it to edit the document."}:{kind:`kept`,body:t.content.replace(/^(?:\r?\n)+/,``),fields:n}:{kind:`lost`,problem:a?`The frontmatter holds only YAML comments, which a save would drop; delete them or move them into the text to edit the document.`:"The frontmatter block is empty, so a save wouldn't write it back; delete its `---` lines or add a `key: value` line to edit the document."}}function GB(e,t=new Set){return!(e instanceof Object)||t.has(e)?!1:(t.add(e),Object.hasOwn(e,`__proto__`)||Object.values(e).some(e=>GB(e,t)))}function KB(e){let t=e.split(`
|
|
270
|
-
`),n=e=>{try{return{value:
|
|
271
|
-
`));return s!==void 0&&VB(s.value,r?.value)}))}function qB(e,t={}){return Object.keys(t).length?`---\n${Rk(t,``)}\n---\n${e?`\n${e}`:``}`:e}async function JB(e,t={}){let n=WB(e);if(n.kind===`lost`)return{editable:!1,reason:n.problem};let r=await HB(e);if(r.lossy)return{editable:!1};let i=await UB(r.doc,r),a=await HB(i);if(a.lossy||!VB(r.doc,a.doc)||!VB(r.frontmatter,a.frontmatter))return{editable:!1};let{plugins:o=[]}=t;if(o.length){let t=async e=>(await zA(e,{...Yz,plugins:[...o]})).nodes.map(e=>NO(e)).join(``).replace(/\s+/g,` `).trim();if(await t(e)!==await t(i))return{editable:!1}}return{editable:!0,markdown:i}}var YB=new M(`comarkUpload`),XB=e=>/^(?:image|video|audio)\//.test(e.type);function ZB(e,t){return YB.getState(e)?.find(void 0,void 0,e=>e.id===t)[0]?.from}function QB(e){let t=document.createElement(`span`);if(t.className=`cue-upload`,t.contentEditable=`false`,t.dataset.kind=e.file.type.split(`/`)[0],e.preview&&t.dataset.kind===`image`){let n=document.createElement(`img`);n.src=e.preview,n.alt=``,t.append(n)}else if(e.preview&&t.dataset.kind===`video`){let n=document.createElement(`video`);n.src=e.preview,n.muted=!0,t.append(n)}let n=document.createElement(`span`);n.className=`cue-upload-label`,n.setAttribute(`role`,`status`),t.append(n);let r=r=>{t.style.setProperty(`--cue-upload`,r===null?`0%`:`${Math.round(r*100)}%`),n.textContent=r===null?`Uploading ${e.file.name}`:`Uploading ${e.file.name}, ${Math.round(r*100)}%`};return r(e.fraction),{root:t,show:r}}function $B(e,t,n,r){let{upload:i}=r;if(!i)return[];let a=Symbol();return t.flatMap(t=>r.accept(t)?[eV(e,t,n,i,r,a)]:[])}function eV(e,t,n,r,i,a){let o={id:nV++,file:t,fraction:null};/^(?:image|video)\//.test(t.type)&&(o.preview=URL.createObjectURL(t)),rV.set(o.id,o),e.dispatch(e.state.tr.setMeta(YB,{add:{id:o.id,pos:n,batch:a}}));let s=()=>{rV.delete(o.id),o.preview&&URL.revokeObjectURL(o.preview)};return r(t,e=>{o.fraction=Math.min(1,Math.max(0,e)),iV.get(o.id)?.show(o.fraction)}).then(n=>{let r=ZB(e.state,o.id),i=e.state.tr.setMeta(YB,{remove:o.id,batch:a});return r!==void 0&&tV(i,r,e.state.schema.nodes.image.create({src:n,alt:t.name})),e.dispatch(i),s(),n},n=>{e.dispatch(e.state.tr.setMeta(YB,{remove:o.id})),s(),i.onError?.(n,t)})}function tV(e,t,n){e.doc.resolve(t).parent.inlineContent?e.insert(t,n):e.insert(t,e.doc.type.schema.nodes.paragraph.create(null,n))}var nV=1,rV=new Map,iV=new Map;function aV(e,t,n){return ul.widget(e,()=>{let e=QB(rV.get(t)??{id:t,file:new File([],``),fraction:null});return iV.set(t,e),e.root},{id:t,batch:n,key:String(t),side:-1,destroy:()=>iV.delete(t)})}function oV(e){let t=t=>Array.from(t??[]).filter(e.accept);return new j({key:YB,state:{init:()=>P.empty,apply(e,t){let n=t.map(e.mapping,e.doc),r=e.getMeta(YB);if(r&&`add`in r){let{id:t,pos:i,batch:a}=r.add;n=n.add(e.doc,[aV(i,t,a)])}else if(r&&`remove`in r){if(r.batch)for(let i of t.find(void 0,void 0,e=>e.batch===r.batch&&e.id>r.remove))n=n.remove(n.find(void 0,void 0,e=>e.id===i.spec.id)),n=n.add(e.doc,[aV(e.mapping.map(i.from,1),i.spec.id,r.batch)]);n=n.remove(n.find(void 0,void 0,e=>e.id===r.remove))}return n}},props:{decorations:e=>YB.getState(e),handlePaste(n,r){let i=t(r.clipboardData?.files);return!i.length||!e.upload?!1:(Promise.all($B(n,i,n.state.selection.from,e)),!0)},handleDrop(n,r,i,a){let o=t(r.dataTransfer?.files);if(a||!o.length||!e.upload)return!1;let s=n.posAtCoords({left:r.clientX,top:r.clientY})?.pos??n.state.selection.from;return Promise.all($B(n,o,s,e)),!0}}})}R.create({name:`comarkUpload`,addOptions:()=>({upload:void 0,accept:XB,onError:void 0}),addProseMirrorPlugins(){return[oV(this.options)]},addCommands(){return{uploadFiles:e=>({view:t})=>this.options.upload?(Promise.all($B(t,e,t.state.selection.from,this.options)),!0):!1}}});var sV=[`status`,`pr`,`author`,`date`,`tags`],cV=new Map([[`pr`,`PR`],[`url`,`URL`]]),lV=/^https:\/\/(?:www\.)?(?:github\.com|gitlab\.com)\/([\w.-]+\/[\w.-]+)\/(?:-\/)?(?:pull|issues|merge_requests)\/(\d+)\/?(?:[?#].*)?$/,uV=(e,t)=>t[e]??cV.get(e)??(e.charAt(0).toUpperCase()+e.slice(1)).replace(/[-_]+/g,` `);function dV(e){let t=lV.exec(e),n=new URL(e),r=t?`${t[1]}#${t[2]}`:`${n.host.replace(/^www\./,``)}${n.pathname===`/`?``:n.pathname}`;return[`a`,{href:n.href},r]}var fV=/^\d{4}-\d{2}-\d{2}$/,pV=new Map([[`status`,`status`],[`pr`,`pr`],[`author`,`person`],[`date`,`date`],[`tags`,`tags`]]);function mV(e,t){let n=pV.get(e);if(n)return n;if(Array.isArray(t))return`tags`;if(Number(t)===t)return`number`;if(t===!0||t===!1)return`boolean`;let r=String(t);return fV.test(r)?`date`:/^https?:\/\//.test(r)?`link`:`text`}function hV(e,t){let n=new Date(`${e}T00:00:00Z`);if(Number.isNaN(n.getTime())||n.toISOString().slice(0,10)!==e)return[`span`,{},e];let r=n.toLocaleDateString(t??`en-US`,{month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`});return[`time`,t?{datetime:e,lang:t}:{datetime:e},r]}function gV(e,t=!1){if(Array.isArray(e)){if(t)return;let n=e.map(e=>gV(e,!0));return n.some(e=>e===void 0)?void 0:n.map(e=>[`span`,{class:`cfm-tag`},...e??[]])}if(e==null||e instanceof Object)return;let n=String(e);return/^https?:\/\/\S+$/.test(n)&&URL.canParse(n)?[dV(n)]:[n]}function _V(e,t={}){let n=t.keys??sV,r=t.labels??{},i=[],a=[],o=t.locale;if(o!==void 0)try{Intl.getCanonicalLocales(o)}catch{o=void 0,i.push({rule:`comark/properties/invalid-locale`,message:"properties: `locale` is not a valid language tag, so dates use the reader's locale. Use a tag such as `de-DE`, or leave `locale` unset."})}for(let t of n){let n=e[t];if(n==null||n===``||Array.isArray(n)&&n.length===0)continue;let s=gV(n);if(!s){i.push({rule:`comark/properties/invalid-value`,message:`properties: \`${t}\` in the frontmatter is neither text, a number, a link, nor a list of them, so it isn't shown. Write it as one of those.`});continue}let c=mV(t,n),l=Array.isArray(n)?void 0:String(n),u=c===`status`&&l!==void 0?[[`span`,{class:`cfm-status`},...s]]:c===`date`&&l!==void 0&&fV.test(l)?[hV(l,o)]:s;a.push([`div`,{"data-key":t,"data-kind":c},[`dt`,{},uV(t,r)],[`dd`,{},...u]])}return{rows:a,issues:i}}var vV=[[`background`,`ui-bg`,`background`,`#fff`,`#0a0a0a`],[`foreground`,`ui-text-highlighted`,`foreground`,`#0a0a0a`,`#fafafa`],[`muted`,`ui-text-muted`,`muted-foreground`,`#737373`,`#a1a1a1`],[`border`,`ui-border`,`border`,`#e5e5e5`,`rgb(255 255 255/.1)`],[`accent`,`ui-bg-elevated`,`accent`,`#f5f5f5`,`#262626`],[`ring`,`ui-primary`,`ring`,`#a1a1a1`,`#737373`]],yV={status:Object.values({success:[`success`,`ui-success`,`success`,`#259f56`,`#59d38c`],danger:[`danger`,`ui-error`,`destructive`,`#ee3533`,`#fd736d`],warning:[`warning`,`ui-warning`,``,`#d97706`,`#fbbf24`],info:[`info`,`ui-info`,``,`#2563eb`,`#60a5fa`]}),primary:[[`primary`,`ui-primary`,`primary`,`var(--_comark-foreground)`,`var(--_comark-foreground)`],[`primary-foreground`,`ui-text-inverted`,`primary-foreground`,`var(--_comark-background)`,`var(--_comark-background)`],[`secondary`,`ui-secondary`,``,`var(--_comark-muted)`,`var(--_comark-muted)`]],shadow:[[`shadow`,``,``,`0 4px 12px rgb(0 0 0/.12)`,`0 4px 12px rgb(0 0 0/.5)`]]},bV=(e,t)=>{let n=e[2]?`var(--${e[2]},${e[t]})`:e[t],r=e[1]?`var(--${e[1]},${n})`:n;return`var(--comark-${e[0]},${r})`},xV=(e,t)=>e.map(e=>`--_comark-${e[0]}:${bV(e,t)}`).join(`;`);function SV(e,...t){let n=`:where(${e})`,r=t.flatMap(e=>yV[e]),i=[...vV,...r],a=r.filter(e=>e[3]!==e[4]),o=a.length?`:where(.light,.light *)${n}{${xV(a,3)}}:where(.dark,.dark *)${n}{${xV(a,4)}}`:``;return`${n}{${xV(i,3)};--_comark-radius:var(--comark-radius,calc(var(--ui-radius,calc(var(--radius,.625rem)/2))*2));--_comark-font:var(--comark-font,var(--font-sans,ui-sans-serif,system-ui,sans-serif))}@media (prefers-color-scheme:dark){${n}{${xV(i,4)}}}`+o}var CV={status:`<path d="M10.1 2.182a10 10 0 0 1 3.8 0m0 19.636a10 10 0 0 1-3.8 0m7.509-18.097a10 10 0 0 1 2.69 2.7M2.182 13.9a10 10 0 0 1 0-3.8m18.097 7.509a10 10 0 0 1-2.7 2.69M21.818 10.1a10 10 0 0 1 0 3.8M3.721 6.391a10 10 0 0 1 2.7-2.69m-.03 16.578a10 10 0 0 1-2.69-2.7"/>`,pr:`<circle cx="18" cy="18" r="3"/><circle cx="6" cy="6" r="3"/><path d="M13 6h3a2 2 0 0 1 2 2v7M6 9v12"/>`,person:`<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>`,date:`<path d="M8 2v3m8-3v3"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M3 9h18"/>`,tags:`<path d="M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1zM2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193"/><circle cx="10.5" cy="6.5" r=".5"/>`,link:`<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/>`,number:`<path d="M4 9h16M4 15h16M10 3L8 21m8-18l-2 18"/>`,boolean:`<rect width="18" height="18" x="3" y="3" rx="2"/><path d="m16 9l-5.5 5.5L8 12"/>`,text:`<path d="M12 4v16M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2M9 20h6"/>`},wV=e=>`url("data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${e}</svg>`)}")`,TV=`@layer comark{${[SV(`.cfm`),`.cfm{container:cfm/inline-size;display:grid;gap:.125rem;margin:0 0 1.5rem;padding:0 0 .75rem;border-bottom:1px solid var(--_comark-border);color:var(--_comark-foreground);font:400 .875rem/1.5rem var(--_comark-font)}`,`.cfm>div{display:grid;grid-template-columns:minmax(0,9rem) minmax(0,1fr);gap:.5rem;align-items:start}`,`.cfm :is(dt,dd){margin:0;padding:0}`,`.cfm dt{overflow:hidden;color:var(--_comark-muted);font-size:.8125rem;line-height:2rem;white-space:nowrap;text-overflow:ellipsis}`,`.cfm dt::before{content:"";display:inline-block;width:1rem;height:1rem;margin-right:.5rem;vertical-align:-.1875rem;background:currentColor;opacity:.7;forced-color-adjust:none;-webkit-mask:var(--cfm-icon,${wV(CV.text)}) center/contain no-repeat;mask:var(--cfm-icon,${wV(CV.text)}) center/contain no-repeat}`,...Object.entries(CV).filter(([e])=>e!==`text`).map(([e,t])=>`.cfm>[data-kind=${e}]{--cfm-icon:${wV(t)}}`),`.cfm dd{display:flex;flex-wrap:wrap;align-items:center;gap:.375rem;min-width:0;min-height:2rem;padding:.25rem 0;overflow-wrap:anywhere}`,`.cfm time{font-variant-numeric:tabular-nums}`,`.cfm a{color:inherit;text-decoration-color:var(--_comark-border);text-underline-offset:4px}`,`.cfm a:hover{text-decoration-color:currentColor}`,`.cfm a:focus-visible{border-radius:calc(var(--_comark-radius)/4);outline:2px solid var(--_comark-ring);outline-offset:2px;box-shadow:0 0 0 3px color-mix(in srgb,var(--_comark-ring) 50%,transparent)}`,`.cfm-tag,.cfm-status{display:inline-flex;align-items:center;padding:0 .5rem;border:1px solid var(--_comark-border);font-size:.75rem;font-weight:500;line-height:1.25rem}`,`.cfm-tag{border-radius:calc(var(--_comark-radius) - 2px);background:var(--_comark-accent)}`,`.cfm-status{gap:.375rem;border-radius:999px}`,`.cfm-status::before{content:"";width:.375rem;height:.375rem;border-radius:50%;background:var(--_comark-muted)}`,`@container cfm (max-width:22rem){.cfm>div{grid-template-columns:minmax(0,1fr);gap:0}.cfm dt{line-height:1.75rem}.cfm dd{min-height:0;padding:0 0 .25rem}}`,`@media print{.cfm{break-inside:avoid}}`].join(``)}}`;function EV(e,t){let n=`data-comark-${e}`;if(document.querySelector(`style[${n}],link[${n}]`))return;let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,document.head.append(r)}var DV=()=>EV(`properties`,TV);function OV(e){for(let t of e.querySelectorAll(`.cfm time[datetime]:not([lang])`))t.textContent=new Date(`${t.dateTime}T00:00:00Z`).toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`})}var kV=de({name:`Properties`,inheritAttrs:!1,setup(e,{slots:t}){let n=pe(),r=()=>n.value&&OV(n.value);return S(()=>{DV(),r()}),d(r),()=>{let e=t.default?.();return e?.length?Fe(`dl`,{class:`cfm`,ref:n},e):null}}});function AV(e,t={}){let n=pe(),r=ae(!1),i=pe({}),a,o=0,s=0;async function c(){let t=n.value;if(!t)return;let r=++s,o=await UB(t.getJSON(),{frontmatter:i.value});r===s&&(a=o,e.value=o)}async function l(e){let a=++o;++s;let[l,u]=await Promise.all([JB(e,{plugins:t.plugins}),HB(e)]);a===o&&(i.value=u.frontmatter,r.value=l.editable,n.value?(n.value.commands.setContent(u.doc,{emitUpdate:!1}),n.value.setEditable(l.editable,!1)):n.value=new Qm({extensions:[xz.configure(t.kit),...t.extensions??[]],content:u.doc,editable:l.editable,onUpdate:()=>void c()}))}return Ne(e,e=>{e!==a&&l(e)},{immediate:!0}),f(()=>n.value?.destroy()),{editor:n,editable:r,frontmatter:i}}function jV(e){return u_(e)?Fe(e[0],e[1],d_(e).map(jV)):Array.isArray(e)?null:e}de({name:`ComarkEditor`,inheritAttrs:!1,props:{properties:{type:[Object,Boolean],default:!0},modelValue:{type:String,required:!0},extensions:{type:Array,default:void 0},plugins:{type:Array,default:void 0}},emits:[`update:modelValue`],setup(e,{attrs:t,emit:n}){let r=ae(e.modelValue);Ne(()=>e.modelValue,e=>r.value=e),Ne(r,t=>{t!==e.modelValue&&n(`update:modelValue`,t)});let{editor:i,frontmatter:a}=AV(r,{extensions:e.extensions,plugins:e.plugins});return()=>{if(!i.value)return null;let n=Fe($m,{...t,editor:i.value});if(e.properties===!1)return n;let r=e.properties===!0?{}:e.properties,{rows:o}=_V(a.value,r);return o.length?[Fe(kV,null,()=>o.map(jV)),n]:n}}});var MV={key:0,class:`rounded-md bg-muted ring ring-accented focus-within:ring-2 focus-within:ring-primary`},NV={key:1,class:`space-y-1`},PV={class:`text-xs text-muted`},FV=de({__name:`RichTextInput`,props:{modelValue:{required:!0},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let n=ve(e,`modelValue`),{editor:r,editable:i}=AV(n,{kit:{starterKit:{link:{openOnClick:!1}}}}),a=he(l_)();Ne(r,e=>{e?.setOptions({editorProps:{attributes:{class:a.base({class:`min-h-28 px-3 py-2 text-base sm:px-3`})}}})}),re(`editorHandlers`,ie(()=>({...ph(),link:{canExecute:e=>e.can().setLink({href:``})||e.can().unsetLink(),execute:e=>{if(e.isActive(`link`))return e.chain().focus().unsetLink();let t=prompt(ot(`linkPrompt`))?.trim();return t?nt(t)?e.chain().focus().extendMarkRange(`link`).setLink({href:t}):(alert(ot(`unsafeHref`)),e.chain()):e.chain()},isActive:e=>e.isActive(`link`),isDisabled:e=>e.state.selection.empty&&!e.isActive(`link`)}})));let o=[[{kind:`mark`,mark:`bold`,icon:`i-lucide-bold`,"aria-label":ot(`bold`)},{kind:`mark`,mark:`italic`,icon:`i-lucide-italic`,"aria-label":ot(`italic`)},{kind:`link`,icon:`i-lucide-link`,"aria-label":ot(`link`)}],[{kind:`heading`,level:2,icon:`i-lucide-heading-2`,"aria-label":ot(`heading`)},{kind:`heading`,level:3,icon:`i-lucide-heading-3`,"aria-label":ot(`subheading`)},{kind:`bulletList`,icon:`i-lucide-list`,"aria-label":ot(`bulletList`)},{kind:`orderedList`,icon:`i-lucide-list-ordered`,"aria-label":ot(`orderedList`)}]];return(e,s)=>{let c=c_,l=Ze;return w(r)&&w(i)?(C(),t(`div`,MV,[be(c,{editor:w(r),items:o,class:`sticky top-14 z-10 overflow-x-auto rounded-t-md border-b border-default bg-muted p-1`},null,8,[`editor`]),be(w($m),{editor:w(r),class:Oe(w(a).content())},null,8,[`editor`,`class`])])):w(r)?(C(),t(`div`,NV,[be(l,{modelValue:n.value,"onUpdate:modelValue":s[0]||=e=>n.value=e,autoresize:``,rows:5,class:`w-full font-mono`},null,8,[`modelValue`]),te(`p`,PV,xe(w(ot)(`richTextRaw`)),1)])):y(``,!0)}}});export{FV as default};
|
|
270
|
+
`),n=e=>{try{return{value:Ik(`---\n${e}\n---\n`).data}}catch{return}},r=n(e);return t.some((e,i)=>[...e.matchAll(/(?:^|\s)#/g)].some(a=>{let o=[...t];o[i]=e.slice(0,a.index);let s=n(o.join(`
|
|
271
|
+
`));return s!==void 0&&VB(s.value,r?.value)}))}function qB(e,t={}){return Object.keys(t).length?`---\n${Lk(t,``)}\n---\n${e?`\n${e}`:``}`:e}async function JB(e,t={}){let n=WB(e);if(n.kind===`lost`)return{editable:!1,reason:n.problem};let r=await HB(e);if(r.lossy)return{editable:!1};let i=await UB(r.doc,r),a=await HB(i);if(a.lossy||!VB(r.doc,a.doc)||!VB(r.frontmatter,a.frontmatter))return{editable:!1};let{plugins:o=[]}=t;if(o.length){let t=async e=>(await RA(e,{...Yz,plugins:[...o]})).nodes.map(e=>MO(e)).join(``).replace(/\s+/g,` `).trim();if(await t(e)!==await t(i))return{editable:!1}}return{editable:!0,markdown:i}}var YB=new N(`comarkUpload`),XB=e=>/^(?:image|video|audio)\//.test(e.type);function ZB(e,t){return YB.getState(e)?.find(void 0,void 0,e=>e.id===t)[0]?.from}function QB(e){let t=document.createElement(`span`);if(t.className=`cue-upload`,t.contentEditable=`false`,t.dataset.kind=e.file.type.split(`/`)[0],e.preview&&t.dataset.kind===`image`){let n=document.createElement(`img`);n.src=e.preview,n.alt=``,t.append(n)}else if(e.preview&&t.dataset.kind===`video`){let n=document.createElement(`video`);n.src=e.preview,n.muted=!0,t.append(n)}let n=document.createElement(`span`);n.className=`cue-upload-label`,n.setAttribute(`role`,`status`),t.append(n);let r=r=>{t.style.setProperty(`--cue-upload`,r===null?`0%`:`${Math.round(r*100)}%`),n.textContent=r===null?`Uploading ${e.file.name}`:`Uploading ${e.file.name}, ${Math.round(r*100)}%`};return r(e.fraction),{root:t,show:r}}function $B(e,t,n,r){let{upload:i}=r;if(!i)return[];let a=Symbol();return t.flatMap(t=>r.accept(t)?[eV(e,t,n,i,r,a)]:[])}function eV(e,t,n,r,i,a){let o={id:nV++,file:t,fraction:null};/^(?:image|video)\//.test(t.type)&&(o.preview=URL.createObjectURL(t)),rV.set(o.id,o),e.dispatch(e.state.tr.setMeta(YB,{add:{id:o.id,pos:n,batch:a}}));let s=()=>{rV.delete(o.id),o.preview&&URL.revokeObjectURL(o.preview)};return r(t,e=>{o.fraction=Math.min(1,Math.max(0,e)),iV.get(o.id)?.show(o.fraction)}).then(n=>{let r=ZB(e.state,o.id),i=e.state.tr.setMeta(YB,{remove:o.id,batch:a});return r!==void 0&&tV(i,r,e.state.schema.nodes.image.create({src:n,alt:t.name})),e.dispatch(i),s(),n},n=>{e.dispatch(e.state.tr.setMeta(YB,{remove:o.id})),s(),i.onError?.(n,t)})}function tV(e,t,n){e.doc.resolve(t).parent.inlineContent?e.insert(t,n):e.insert(t,e.doc.type.schema.nodes.paragraph.create(null,n))}var nV=1,rV=new Map,iV=new Map;function aV(e,t,n){return ll.widget(e,()=>{let e=QB(rV.get(t)??{id:t,file:new File([],``),fraction:null});return iV.set(t,e),e.root},{id:t,batch:n,key:String(t),side:-1,destroy:()=>iV.delete(t)})}function oV(e){let t=t=>Array.from(t??[]).filter(e.accept);return new M({key:YB,state:{init:()=>F.empty,apply(e,t){let n=t.map(e.mapping,e.doc),r=e.getMeta(YB);if(r&&`add`in r){let{id:t,pos:i,batch:a}=r.add;n=n.add(e.doc,[aV(i,t,a)])}else if(r&&`remove`in r){if(r.batch)for(let i of t.find(void 0,void 0,e=>e.batch===r.batch&&e.id>r.remove))n=n.remove(n.find(void 0,void 0,e=>e.id===i.spec.id)),n=n.add(e.doc,[aV(e.mapping.map(i.from,1),i.spec.id,r.batch)]);n=n.remove(n.find(void 0,void 0,e=>e.id===r.remove))}return n}},props:{decorations:e=>YB.getState(e),handlePaste(n,r){let i=t(r.clipboardData?.files);return!i.length||!e.upload?!1:(Promise.all($B(n,i,n.state.selection.from,e)),!0)},handleDrop(n,r,i,a){let o=t(r.dataTransfer?.files);if(a||!o.length||!e.upload)return!1;let s=n.posAtCoords({left:r.clientX,top:r.clientY})?.pos??n.state.selection.from;return Promise.all($B(n,o,s,e)),!0}}})}z.create({name:`comarkUpload`,addOptions:()=>({upload:void 0,accept:XB,onError:void 0}),addProseMirrorPlugins(){return[oV(this.options)]},addCommands(){return{uploadFiles:e=>({view:t})=>this.options.upload?(Promise.all($B(t,e,t.state.selection.from,this.options)),!0):!1}}});var sV=[`status`,`pr`,`author`,`date`,`tags`],cV=new Map([[`pr`,`PR`],[`url`,`URL`]]),lV=/^https:\/\/(?:www\.)?(?:github\.com|gitlab\.com)\/([\w.-]+\/[\w.-]+)\/(?:-\/)?(?:pull|issues|merge_requests)\/(\d+)\/?(?:[?#].*)?$/,uV=(e,t)=>t[e]??cV.get(e)??(e.charAt(0).toUpperCase()+e.slice(1)).replace(/[-_]+/g,` `);function dV(e){let t=lV.exec(e),n=new URL(e),r=t?`${t[1]}#${t[2]}`:`${n.host.replace(/^www\./,``)}${n.pathname===`/`?``:n.pathname}`;return[`a`,{href:n.href},r]}var fV=/^\d{4}-\d{2}-\d{2}$/,pV=new Map([[`status`,`status`],[`pr`,`pr`],[`author`,`person`],[`date`,`date`],[`tags`,`tags`]]);function mV(e,t){let n=pV.get(e);if(n)return n;if(Array.isArray(t))return`tags`;if(Number(t)===t)return`number`;if(t===!0||t===!1)return`boolean`;let r=String(t);return fV.test(r)?`date`:/^https?:\/\//.test(r)?`link`:`text`}function hV(e,t){let n=new Date(`${e}T00:00:00Z`);if(Number.isNaN(n.getTime())||n.toISOString().slice(0,10)!==e)return[`span`,{},e];let r=n.toLocaleDateString(t??`en-US`,{month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`});return[`time`,t?{datetime:e,lang:t}:{datetime:e},r]}function gV(e,t=!1){if(Array.isArray(e)){if(t)return;let n=e.map(e=>gV(e,!0));return n.some(e=>e===void 0)?void 0:n.map(e=>[`span`,{class:`cfm-tag`},...e??[]])}if(e==null||e instanceof Object)return;let n=String(e);return/^https?:\/\/\S+$/.test(n)&&URL.canParse(n)?[dV(n)]:[n]}function _V(e,t={}){let n=t.keys??sV,r=t.labels??{},i=[],a=[],o=t.locale;if(o!==void 0)try{Intl.getCanonicalLocales(o)}catch{o=void 0,i.push({rule:`comark/properties/invalid-locale`,message:"properties: `locale` is not a valid language tag, so dates use the reader's locale. Use a tag such as `de-DE`, or leave `locale` unset."})}for(let t of n){let n=e[t];if(n==null||n===``||Array.isArray(n)&&n.length===0)continue;let s=gV(n);if(!s){i.push({rule:`comark/properties/invalid-value`,message:`properties: \`${t}\` in the frontmatter is neither text, a number, a link, nor a list of them, so it isn't shown. Write it as one of those.`});continue}let c=mV(t,n),l=Array.isArray(n)?void 0:String(n),u=c===`status`&&l!==void 0?[[`span`,{class:`cfm-status`},...s]]:c===`date`&&l!==void 0&&fV.test(l)?[hV(l,o)]:s;a.push([`div`,{"data-key":t,"data-kind":c},[`dt`,{},uV(t,r)],[`dd`,{},...u]])}return{rows:a,issues:i}}var vV=[[`background`,`ui-bg`,`background`,`#fff`,`#0a0a0a`],[`foreground`,`ui-text-highlighted`,`foreground`,`#0a0a0a`,`#fafafa`],[`muted`,`ui-text-muted`,`muted-foreground`,`#737373`,`#a1a1a1`],[`border`,`ui-border`,`border`,`#e5e5e5`,`rgb(255 255 255/.1)`],[`accent`,`ui-bg-elevated`,`accent`,`#f5f5f5`,`#262626`],[`ring`,`ui-primary`,`ring`,`#a1a1a1`,`#737373`]],yV={status:Object.values({success:[`success`,`ui-success`,`success`,`#259f56`,`#59d38c`],danger:[`danger`,`ui-error`,`destructive`,`#ee3533`,`#fd736d`],warning:[`warning`,`ui-warning`,``,`#d97706`,`#fbbf24`],info:[`info`,`ui-info`,``,`#2563eb`,`#60a5fa`]}),primary:[[`primary`,`ui-primary`,`primary`,`var(--_comark-foreground)`,`var(--_comark-foreground)`],[`primary-foreground`,`ui-text-inverted`,`primary-foreground`,`var(--_comark-background)`,`var(--_comark-background)`],[`secondary`,`ui-secondary`,``,`var(--_comark-muted)`,`var(--_comark-muted)`]],shadow:[[`shadow`,``,``,`0 4px 12px rgb(0 0 0/.12)`,`0 4px 12px rgb(0 0 0/.5)`]]},bV=(e,t)=>{let n=e[2]?`var(--${e[2]},${e[t]})`:e[t],r=e[1]?`var(--${e[1]},${n})`:n;return`var(--comark-${e[0]},${r})`},xV=(e,t)=>e.map(e=>`--_comark-${e[0]}:${bV(e,t)}`).join(`;`);function SV(e,...t){let n=`:where(${e})`,r=t.flatMap(e=>yV[e]),i=[...vV,...r],a=r.filter(e=>e[3]!==e[4]),o=a.length?`:where(.light,.light *)${n}{${xV(a,3)}}:where(.dark,.dark *)${n}{${xV(a,4)}}`:``;return`${n}{${xV(i,3)};--_comark-radius:var(--comark-radius,calc(var(--ui-radius,calc(var(--radius,.625rem)/2))*2));--_comark-font:var(--comark-font,var(--font-sans,ui-sans-serif,system-ui,sans-serif))}@media (prefers-color-scheme:dark){${n}{${xV(i,4)}}}`+o}var CV={status:`<path d="M10.1 2.182a10 10 0 0 1 3.8 0m0 19.636a10 10 0 0 1-3.8 0m7.509-18.097a10 10 0 0 1 2.69 2.7M2.182 13.9a10 10 0 0 1 0-3.8m18.097 7.509a10 10 0 0 1-2.7 2.69M21.818 10.1a10 10 0 0 1 0 3.8M3.721 6.391a10 10 0 0 1 2.7-2.69m-.03 16.578a10 10 0 0 1-2.69-2.7"/>`,pr:`<circle cx="18" cy="18" r="3"/><circle cx="6" cy="6" r="3"/><path d="M13 6h3a2 2 0 0 1 2 2v7M6 9v12"/>`,person:`<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>`,date:`<path d="M8 2v3m8-3v3"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M3 9h18"/>`,tags:`<path d="M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1zM2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193"/><circle cx="10.5" cy="6.5" r=".5"/>`,link:`<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/>`,number:`<path d="M4 9h16M4 15h16M10 3L8 21m8-18l-2 18"/>`,boolean:`<rect width="18" height="18" x="3" y="3" rx="2"/><path d="m16 9l-5.5 5.5L8 12"/>`,text:`<path d="M12 4v16M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2M9 20h6"/>`},wV=e=>`url("data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${e}</svg>`)}")`,TV=`@layer comark{${[SV(`.cfm`),`.cfm{container:cfm/inline-size;display:grid;gap:.125rem;margin:0 0 1.5rem;padding:0 0 .75rem;border-bottom:1px solid var(--_comark-border);color:var(--_comark-foreground);font:400 .875rem/1.5rem var(--_comark-font)}`,`.cfm>div{display:grid;grid-template-columns:minmax(0,9rem) minmax(0,1fr);gap:.5rem;align-items:start}`,`.cfm :is(dt,dd){margin:0;padding:0}`,`.cfm dt{overflow:hidden;color:var(--_comark-muted);font-size:.8125rem;line-height:2rem;white-space:nowrap;text-overflow:ellipsis}`,`.cfm dt::before{content:"";display:inline-block;width:1rem;height:1rem;margin-right:.5rem;vertical-align:-.1875rem;background:currentColor;opacity:.7;forced-color-adjust:none;-webkit-mask:var(--cfm-icon,${wV(CV.text)}) center/contain no-repeat;mask:var(--cfm-icon,${wV(CV.text)}) center/contain no-repeat}`,...Object.entries(CV).filter(([e])=>e!==`text`).map(([e,t])=>`.cfm>[data-kind=${e}]{--cfm-icon:${wV(t)}}`),`.cfm dd{display:flex;flex-wrap:wrap;align-items:center;gap:.375rem;min-width:0;min-height:2rem;padding:.25rem 0;overflow-wrap:anywhere}`,`.cfm time{font-variant-numeric:tabular-nums}`,`.cfm a{color:inherit;text-decoration-color:var(--_comark-border);text-underline-offset:4px}`,`.cfm a:hover{text-decoration-color:currentColor}`,`.cfm a:focus-visible{border-radius:calc(var(--_comark-radius)/4);outline:2px solid var(--_comark-ring);outline-offset:2px;box-shadow:0 0 0 3px color-mix(in srgb,var(--_comark-ring) 50%,transparent)}`,`.cfm-tag,.cfm-status{display:inline-flex;align-items:center;padding:0 .5rem;border:1px solid var(--_comark-border);font-size:.75rem;font-weight:500;line-height:1.25rem}`,`.cfm-tag{border-radius:calc(var(--_comark-radius) - 2px);background:var(--_comark-accent)}`,`.cfm-status{gap:.375rem;border-radius:999px}`,`.cfm-status::before{content:"";width:.375rem;height:.375rem;border-radius:50%;background:var(--_comark-muted)}`,`@container cfm (max-width:22rem){.cfm>div{grid-template-columns:minmax(0,1fr);gap:0}.cfm dt{line-height:1.75rem}.cfm dd{min-height:0;padding:0 0 .25rem}}`,`@media print{.cfm{break-inside:avoid}}`].join(``)}}`;function EV(e,t){let n=`data-comark-${e}`;if(document.querySelector(`style[${n}],link[${n}]`))return;let r=document.createElement(`style`);r.setAttribute(n,``),r.textContent=t,document.head.append(r)}var DV=()=>EV(`properties`,TV);function OV(e){for(let t of e.querySelectorAll(`.cfm time[datetime]:not([lang])`))t.textContent=new Date(`${t.dateTime}T00:00:00Z`).toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`})}var kV=se({name:`Properties`,inheritAttrs:!1,setup(e,{slots:t}){let n=ae(),r=()=>n.value&&OV(n.value);return x(()=>{DV(),r()}),C(r),()=>{let e=t.default?.();return e?.length?me(`dl`,{class:`cfm`,ref:n},e):null}}});function AV(e,t={}){let n=ae(),r=d(!1),i=ae({}),a,o=0,s=0;async function c(){let t=n.value;if(!t)return;let r=++s,o=await UB(t.getJSON(),{frontmatter:i.value});r===s&&(a=o,e.value=o)}async function l(e){let a=++o;++s;let[l,u]=await Promise.all([JB(e,{plugins:t.plugins}),HB(e)]);a===o&&(i.value=u.frontmatter,r.value=l.editable,n.value?(n.value.commands.setContent(u.doc,{emitUpdate:!1}),n.value.setEditable(l.editable,!1)):n.value=new Zm({extensions:[xz.configure(t.kit),...t.extensions??[]],content:u.doc,editable:l.editable,onUpdate:()=>void c()}))}return Ne(e,e=>{e!==a&&l(e)},{immediate:!0}),ee(()=>n.value?.destroy()),{editor:n,editable:r,frontmatter:i}}function jV(e){return l_(e)?me(e[0],e[1],u_(e).map(jV)):Array.isArray(e)?null:e}se({name:`ComarkEditor`,inheritAttrs:!1,props:{properties:{type:[Object,Boolean],default:!0},modelValue:{type:String,required:!0},extensions:{type:Array,default:void 0},plugins:{type:Array,default:void 0}},emits:[`update:modelValue`],setup(e,{attrs:t,emit:n}){let r=d(e.modelValue);Ne(()=>e.modelValue,e=>r.value=e),Ne(r,t=>{t!==e.modelValue&&n(`update:modelValue`,t)});let{editor:i,frontmatter:a}=AV(r,{extensions:e.extensions,plugins:e.plugins});return()=>{if(!i.value)return null;let n=me(Qm,{...t,editor:i.value});if(e.properties===!1)return n;let r=e.properties===!0?{}:e.properties,{rows:o}=_V(a.value,r);return o.length?[me(kV,null,()=>o.map(jV)),n]:n}}});var MV={key:0,class:`rounded-md bg-muted ring ring-accented focus-within:ring-2 focus-within:ring-primary`},NV={key:1,class:`space-y-1`},PV={class:`text-xs text-muted`},FV=se({__name:`RichTextInput`,props:{modelValue:{required:!0},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let t=le(e,`modelValue`),{editor:n,editable:r}=AV(t,{kit:{starterKit:{link:{openOnClick:!1}}}}),i=he(c_)();Ne(n,e=>{e?.setOptions({editorProps:{attributes:{class:i.base({class:`min-h-28 px-3 py-2 text-base sm:px-3`})}}})}),m(`editorHandlers`,h(()=>({...fh(),link:{canExecute:e=>e.can().setLink({href:``})||e.can().unsetLink(),execute:e=>{if(e.isActive(`link`))return e.chain().focus().unsetLink();let t=prompt(at(`linkPrompt`))?.trim();return t?tt(t)?e.chain().focus().extendMarkRange(`link`).setLink({href:t}):(alert(at(`unsafeHref`)),e.chain()):e.chain()},isActive:e=>e.isActive(`link`),isDisabled:e=>e.state.selection.empty&&!e.isActive(`link`)}})));let a=[[{kind:`mark`,mark:`bold`,icon:`i-lucide-bold`,"aria-label":at(`bold`)},{kind:`mark`,mark:`italic`,icon:`i-lucide-italic`,"aria-label":at(`italic`)},{kind:`link`,icon:`i-lucide-link`,"aria-label":at(`link`)}],[{kind:`heading`,level:2,icon:`i-lucide-heading-2`,"aria-label":at(`heading`)},{kind:`heading`,level:3,icon:`i-lucide-heading-3`,"aria-label":at(`subheading`)},{kind:`bulletList`,icon:`i-lucide-list`,"aria-label":at(`bulletList`)},{kind:`orderedList`,icon:`i-lucide-list-ordered`,"aria-label":at(`orderedList`)}]];return(e,o)=>{let s=s_,c=Xe;return T(n)&&T(r)?(w(),ne(`div`,MV,[De(s,{editor:T(n),items:a,class:`sticky top-14 z-10 overflow-x-auto rounded-t-md border-b border-default bg-muted p-1`},null,8,[`editor`]),De(T(Qm),{editor:T(n),class:Oe(T(i).content())},null,8,[`editor`,`class`])])):T(n)?(w(),ne(`div`,NV,[De(c,{modelValue:t.value,"onUpdate:modelValue":o[0]||=e=>t.value=e,autoresize:``,rows:5,class:`w-full font-mono`},null,8,[`modelValue`]),Ee(`p`,PV,je(T(at)(`richTextRaw`)),1)])):re(``,!0)}}});export{FV as default};
|