1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[51296],{1790:(e,t,n)=>{n.d(t,{$Z:()=>H,VR:()=>Y,gu:()=>er,NV:()=>et,hG:()=>Z});var r=n(37343),i=n(94190),s=n(12445),o=n(33463),l=n(30865);let{getOwnPropertyNames:a,getOwnPropertySymbols:h}=Object,{hasOwnProperty:c}=Object.prototype;function p(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function u(e){return function(t,n,r){if(!t||!n||"object"!=typeof t||"object"!=typeof n)return e(t,n,r);let{cache:i}=r,s=i.get(t),o=i.get(n);if(s&&o)return s===n&&o===t;i.set(t,n),i.set(n,t);let l=e(t,n,r);return i.delete(t),i.delete(n),l}}function d(e){return a(e).concat(h(e))}let f=Object.hasOwn||((e,t)=>c.call(e,t));function m(e,t){return e===t||!e&&!t&&e!=e&&t!=t}let g="u">typeof Float16Array,{getOwnPropertyDescriptor:k,keys:y}=Object;function x(e,t){return e.byteLength===t.byteLength&&O(new Uint8Array(e),new Uint8Array(t))}function w(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function b(e,t){return e.byteLength===t.byteLength&&O(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function v(e,t){return m(e.getTime(),t.getTime())}function S(e,t,n){return e.name===t.name&&e.message===t.message&&e.stack===t.stack&&n.equals(e.cause,t.cause,"cause","cause",e,t,n)}function T(e,t){return e===t}function M(e,t,n){let r,i,s=e.size;if(s!==t.size)return!1;if(!s)return!0;let o=Array(s),l=e.entries(),a=0;for(;(r=l.next())&&!r.done;){let s=t.entries(),l=!1,h=0;for(;(i=s.next())&&!i.done;){if(o[h]){h++;continue}let s=r.value,c=i.value;if(n.equals(s[0],c[0],a,h,e,t,n)&&n.equals(s[1],c[1],s[0],c[0],e,t,n)){l=o[h]=!0;break}h++}if(!l)return!1;a++}return!0}function C(e,t,n){let r=y(e),i=r.length;if(y(t).length!==i)return!1;for(;i-- >0;)if(!z(e,t,n,r[i]))return!1;return!0}function A(e,t,n){let r,i,s,o=d(e),l=o.length;if(d(t).length!==l)return!1;for(;l-- >0;)if(!z(e,t,n,r=o[l])||(i=k(e,r),s=k(t,r),(i||s)&&(!i||!s||i.configurable!==s.configurable||i.enumerable!==s.enumerable||i.writable!==s.writable)))return!1;return!0}function E(e,t){return m(e.valueOf(),t.valueOf())}function R(e,t){return e.source===t.source&&e.flags===t.flags}function I(e,t,n){let r,i,s=e.size;if(s!==t.size)return!1;if(!s)return!0;let o=Array(s),l=e.values();for(;(r=l.next())&&!r.done;){let s=t.values(),l=!1,a=0;for(;(i=s.next())&&!i.done;){if(!o[a]&&n.equals(r.value,i.value,r.value,i.value,e,t,n)){l=o[a]=!0;break}a++}if(!l)return!1}return!0}function O(e,t){let n=e.length;if(t.length!==n||e.byteOffset!==t.byteOffset)return!1;if(e instanceof Float64Array||e instanceof Float32Array||g&&e instanceof Float16Array){for(;n-- >0;)if(e[n]!==t[n]&&(e[n]==e[n]||t[n]==t[n]))return!1;return!0}for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function N(e,t){var n,r;let i,s;return e.href===t.href||e.protocol===t.protocol&&e.username===t.username&&e.password===t.password&&e.host===t.host&&e.pathname===t.pathname&&e.hash===t.hash&&(n=e.searchParams,r=t.searchParams,i=n.toString(),i===(s=r.toString())||$(i)===$(s))}function $(e){return e.split("&").sort().join("&")}function z(e,t,n,r){return("_owner"===r||"__o"===r||"__v"===r)&&(!!e.$$typeof||!!t.$$typeof)||f(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}let L={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},P=Object.prototype.toString,F=D();function D(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,s=function({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:h,areRegExpsEqual:c,areSetsEqual:p,areTypedArraysEqual:u,areUrlsEqual:d,unknownTagComparators:f}){return function(m,g,k){if(m===g)return!0;if(null==m||null==g)return!1;let y=typeof m;if(y!==typeof g)return!1;if("object"!==y)return"number"===y?l(m,g,k):"function"===y&&s(m,g,k);let x=m.constructor;if(x!==g.constructor)return!1;if(x===Object)return a(m,g,k);if(Array.isArray(m))return t(m,g,k);if(x===Date)return r(m,g,k);if(x===RegExp)return c(m,g,k);if(x===Map)return o(m,g,k);if(x===Set)return p(m,g,k);let w=P.call(m);if("[object Date]"===w)return r(m,g,k);if("[object RegExp]"===w)return c(m,g,k);if("[object Map]"===w)return o(m,g,k);if("[object Set]"===w)return p(m,g,k);if("[object Object]"===w)return"function"!=typeof m.then&&"function"!=typeof g.then&&a(m,g,k);if("[object URL]"===w)return d(m,g,k);if("[object Error]"===w)return i(m,g,k);if("[object Arguments]"===w)return a(m,g,k);if(L[w])return u(m,g,k);if("[object ArrayBuffer]"===w)return e(m,g,k);if("[object DataView]"===w)return n(m,g,k);if("[object Boolean]"===w||"[object Number]"===w||"[object String]"===w)return h(m,g,k);if(f){let e=f[w];if(!e){let t=null!=m?m[Symbol.toStringTag]:void 0;t&&(e=f[t])}if(e)return e(m,g,k)}return!1}}(function({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:x,areArraysEqual:n?A:w,areDataViewsEqual:b,areDatesEqual:v,areErrorsEqual:n?p(S,A):p(S,C),areFunctionsEqual:T,areMapsEqual:n?p(M,A):M,areNumbersEqual:m,areObjectsEqual:n?A:C,arePrimitiveWrappersEqual:E,areRegExpsEqual:R,areSetsEqual:n?p(I,A):I,areTypedArraysEqual:n?p(O,A):O,areUrlsEqual:N,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=u(r.areArraysEqual),t=u(r.areErrorsEqual),n=u(r.areMapsEqual),i=u(r.areObjectsEqual),s=u(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areErrorsEqual:t,areMapsEqual:n,areObjectsEqual:i,areSetsEqual:s})}return r}(e)),o=n?n(s):function(e,t,n,r,i,o,l){return s(e,t,l)};return function({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(s,o){let{cache:l=e?new WeakMap:void 0,meta:a}=n();return t(s,o,{cache:l,equals:r,meta:a,strict:i})};
1if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let s={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,s)}}({circular:t,comparator:s,createState:r,equals:o,strict:i})}D({strict:!0}),D({circular:!0}),D({circular:!0,strict:!0}),D({createInternalComparator:()=>m}),D({strict:!0,createInternalComparator:()=>m}),D({circular:!0,createInternalComparator:()=>m}),D({circular:!0,createInternalComparator:()=>m,strict:!0});var B=n(98663),_=({contentComponent:e})=>{let t=(0,s.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,o.jsx)(o.Fragment,{children:Object.values(t)})},j=class extends r.Component{constructor(e){super(e),this.editorContentRef=r.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;let t=this.props.editor;if(t&&!t.isDestroyed&&(null==(e=t.view.dom)?void 0:e.parentNode)){let e,n,r,s;if(t.contentComponent)return;let o=this.editorContentRef.current;o.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:o}),e=new Set,n={},r=!1,s=()=>{!r&&e.size&&(r=!0,queueMicrotask(()=>{r=!1,e.forEach(e=>e())}))},t.contentComponent={subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>n,getServerSnapshot:()=>n,setRenderer(e,t){n={...n,[e]:i.createPortal(t.reactElement,t.element,e)},s()},removeRenderer(e){let t={...n};delete t[e],n=t,s()}},t.createNodeViews(),t.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var e;let t=this.props.editor;if(t){t.isEditorContentInitialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null;try{if(!(null==(e=t.view.dom)?void 0:e.parentNode))return;let n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{ref:((...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})})(t,this.editorContentRef),...n}),(null==e?void 0:e.contentComponent)&&(0,o.jsx)(_,{contentComponent:e.contentComponent})]})}},J=(0,r.forwardRef)((e,t)=>{let n=r.useMemo(()=>Math.floor(0xffffffff*Math.random()).toString(),[e.editor]);return r.createElement(j,{key:n,innerRef:t,...e})}),H=r.memo(J),K="u">typeof window?r.useLayoutEffect:r.useEffect,q=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e,t=t=>{((null==t?void 0:t.transaction)===void 0||t.transaction!==e)&&(e=null==t?void 0:t.transaction,this.transactionNumber+=1,this.subscribers.forEach(e=>e()))},n=this.editor;return n.on("transaction",t),n.on("update",t),()=>{n.off("transaction",t),n.off("update",t)}}}},V="u"<typeof window,U=V||!!("u">typeof window&&window.next),W=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e
1=>e())}getInitialEditor(){let e=this.options.current.immediatelyRender,t=null==e||e;return V?t=!1:U&&void 0===e&&(t=!1),t?this.createEditor():null}createEditor(){let e={...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBeforeCreate)?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBlur)?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onCreate)?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDestroy)?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null==(n=(t=this.options.current).onFocus)?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onSelectionUpdate)?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null==(n=(t=this.options.current).onTransaction)?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUpdate)?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null==(n=(t=this.options.current).onContentError)?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDrop)?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null==(n=(t=this.options.current).onPaste)?void 0:n.call(t,...e)},onDelete:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDelete)?void 0:n.call(t,...e)},onMount:(...e)=>{var t,n;return null==(n=(t=this.options.current).onMount)?void 0:n.call(t,...e)},onUnmount:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUnmount)?void 0:n.call(t,...e)}};return new l.KE(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,n)=>{var r;return e===(null==(r=t.extensions)?void 0:r[n])}):e[n]===t[n]))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Z(e={},t=[]){let n=(0,r.useRef)(e);n.current=e;let[i]=(0,r.useState)(()=>new W(n)),o=(0,s.useSyncExternalStore)(i.subscribe,i.getEditor,i.getServerSnapshot);return(0,r.useDebugValue)(o),(0,r.useEffect)(i.onRender(t)),!function(e){var t;let[n]=(0,r.useState)(()=>new q(e.editor)),i=(0,B.useSyncExternalStoreWithSelector)(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,null!=(t=e.equalityFn)?t:F);K(()=>n.watch(e.editor),[e.editor,n]),(0,r.useDebugValue)(i)}({editor:o,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),o}var G=(0,r.createContext)({editor:null});G.Consumer;var X=(0,r.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Y=r.forwardRef((e,t)=>{let{onDragStart:n}=(0,r.useContext)(X),i=e.as||"div";return(0,o.jsx)(i,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});function Q(e){return!!("function"==typeof e&&e.prototype&&e.prototype.isReactComponent)}function ee(e){return!!("object"==typeof e&&e.$$typeof&&("Symbol(react.forward_ref)"===e.$$typeof.toString()||"react.forward_ref"===e.$$typeof.description))}var et=class{constructor(e,{editor:t,props:n={},as:r="div",className:s=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(0xffffffff*Math.random()).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add("react-renderer"),s&&this.element.classList.add(...s.split(" ")),this.editor.isEditorContentInitialized?(0,i.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;let t=this.component,n=this.props,i=this.editor,s=function(){try{if(r.version)return parseInt(r.version.split(".")[0],10)>=19}catch{}return!1}(),l=function(e){if(Q(e)||ee(e))return!0;
1if("object"==typeof e&&e.$$typeof&&("Symbol(react.memo)"===e.$$typeof.toString()||"react.memo"===e.$$typeof.description)){let t=e.type;if(t)return Q(t)||ee(t)}return!1}(t),a={...n};a.ref&&!(s||l)&&delete a.ref,!a.ref&&(s||l)&&(a.ref=e=>{this.ref=e}),this.reactElement=(0,o.jsx)(t,{...a}),null==(e=null==i?void 0:i.contentComponent)||e.setRenderer(this.id,this)}updateProps(e={}){if(this.destroyed)return;let t=!1,n=Object.keys(e);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==this.props[i]){t=!0;break}}t&&(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0;let t=this.editor;null==(e=null==t?void 0:t.contentComponent)||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};l.Db;var en=class extends l.Yv{constructor(e,t,n){if(super(e,t,n),this.selectionRafId=null,this.handlePositionUpdate=()=>{let e=this.getPos();"number"==typeof e&&e!==this.currentPos&&(this.currentPos=e,this.renderer.updateProps({getPos:()=>this.getPos()}),"function"==typeof this.options.attrs&&this.updateElementAttributes())},this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const e=this.dom.querySelector("[data-node-view-content]");e?e.appendChild(this.contentDOMElement):this.dom.appendChild(this.contentDOMElement)}this.options.trackNodeViewPosition&&this.editor.on("update",this.handlePositionUpdate)}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){let e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,i){var s;return"storage"===r?null!=(s=e.storage[t.name])?s:{}:Reflect.get(n,r,i)}})}return this.cachedExtensionWithSyncedStorage}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode(),ref:(0,r.createRef)()};if(!this.component.displayName){let e;this.component.displayName=(e=this.extension.name).charAt(0).toUpperCase()+e.substring(1)}let t={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:e=>{if(e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement){e.hasAttribute("data-node-view-wrapper")&&e.removeAttribute("data-node-view-wrapper");let t=function(e){var t,n;let r=e.getRootNode(),i="function"==typeof r.getSelection?r.getSelection():null==(n=null==(t=e.ownerDocument)?void 0:t.defaultView)?void 0:n.getSelection();if(!i||0===i.rangeCount)return null;let{anchorNode:s,anchorOffset:o,focusNode:l,focusOffset:a}=i;return s&&l&&e.contains(s)&&e.contains(l)?()=>{try{i.setBaseAndExtent(s,o,l,a)}catch{}}:null}(this.contentDOMElement);e.appendChild(this.contentDOMElement),null==t||t()}}},n=this.component,i=(0,r.memo)(e=>(0,o.jsx)(X.Provider,{value:t,children:(0,r.createElement)(n,e)}));i.displayName="ReactNodeView";let s=this.node.isInline?"span":"div";this.options.as&&(s=this.options.as);let{className:l=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new et(i,{editor:this.editor,props:e,as:s,className:`node-${this.node.type.name} ${l}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes(),this.currentPos=this.getPos()}get dom(){var e;if(this.renderer.element.firstElementChild&&!(null==(e=this.renderer.element.firstElementChild)?void 0:e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}
1get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{var e;this.selectionRafId=null;let t=null!=(e=this.getPos())?e:this.currentPos;if("number"==typeof t)if((0,l.FA)({selection:this.editor.state.selection,pos:t,nodeSize:this.node.nodeSize,selectedOnTextSelection:this.options.selectedOnTextSelection})){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(e,t,n){let r=e=>{this.renderer.updateProps(e),"function"==typeof this.options.attrs&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if("function"==typeof this.options.update){let i=this.node,s=this.decorations,o=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:i,oldDecorations:s,newNode:e,newDecorations:t,oldInnerDecorations:o,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}if(e===this.node)return this.node=e,this.decorations=t,this.innerDecorations=n,!0;let i=this.getPos();this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=i;let s={node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage};return this.options.trackNodeViewPosition&&(s.getPos=()=>this.getPos()),r(s),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.options.trackNodeViewPosition&&this.editor.off("update",this.handlePositionUpdate),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let e={};if("function"==typeof this.options.attrs){let t=this.editor.extensionManager.attributes,n=(0,l.zU)(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function er(e,t){return n=>n.editor.contentComponent?new en(e,n,t):{}}var ei=(0,r.createContext)({get editor(){throw Error("useTiptap must be used within a <Tiptap> provider")}});function es({children:e,...t}){let n="editor"in t?t.editor:t.instance;if(!n)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let i=(0,r.useMemo)(()=>({editor:n}),[n]),s=(0,r.useMemo)(()=>({editor:n}),[n]);return(0,o.jsx)(G.Provider,{value:s,children:(0,o.jsx)(ei.Provider,{value:i,children:e})})}function eo({...e}){let{editor:t}=(0,r.useContext)(ei);return(0,o.jsx)(H,{editor:t,...e})}ei.displayName="TiptapContext",es.displayName="Tiptap",eo.displayName="Tiptap.Content",Object.assign(es,{Content:eo})},6678:(e,t,n)=>{n.d(t,{oz:()=>eA,db:()=>eC});var r=n(30865);function i(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var s=i(),o={exec:()=>null};function l(e,t=""){let n="string"==typeof e?e:e.source,r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(h.caret,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var a=(()=>{try{return!!RegExp("(?<=1)(?<!1)")}catch{return!1}})(),h={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine
vendor: 4,141 bytes, line 1
1:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},c=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,p=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,u=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,d=l(u).replace(/bull/g,p).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),f=l(u).replace(/bull/g,p).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),m=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,g=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,k=l(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",g).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),y=l(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,p).getRegex(),x="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",w=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,b=l("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",w).replace("tag",x).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),v=l(m).replace("hr",c).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",x).getRegex(),S={blockquote:l(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",v).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:k,fences:/^ {0,3}(`{3,}
vendor: 9,808 bytes, lines 1-17
1(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:c,html:b,lheading:d,list:y,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:v,table:o,text:/^[^\n]+/},T=l("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",c).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",x).getRegex(),M={...S,lheading:f,table:T,paragraph:l(m).replace("hr",c).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",T).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",x).getRegex()},C={...S,html:l("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",w).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:o,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:l(m).replace("hr",c).replace("heading",` *#{1,6} *[^ 2]`).replace("lheading",d).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},A=/^( {2,}|\\)\n(?!\s*$)/,E=/[\p{P}\p{S}]/u,R=/[\s\p{P}\p{S}]/u,I=/[^\s\p{P}\p{S}]/u,O=l(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,R).getRegex(),N=/(?!~)[\p{P}\p{S}]/u,$=l(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",a?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),z=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,L=l(z,"u").replace(/punct/g,E).getRegex(),P=l(z,"u").replace(/punct/g,N).getRegex(),F="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",D=l(F,"gu").replace(/notPunctSpace/g,I).replace(/punctSpace/g,R).replace(/punct/g,E).getRegex(),B=l(F,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,N).getRegex(),_=l("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,I).replace(/punctSpace/g,R).replace(/punct/g,E).getRegex(),j=l(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,E).getRegex(),J=l("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,I).replace(/punctSpace/g,R).replace(/punct/g,E).getRegex(),H=l(/\\(punct)/,"gu").replace(/punct/g,E).getRegex(),K=l(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),q=l(w).replace("(?:--\x3e|$)","--\x3e").getRegex(),V=l("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",q).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),U=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,W=l(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",U).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Z=l(/^!?\[(label)\]\[(ref)\]/).replace("label",U).replace("ref",g).getRegex(),G=l(/^!?\[(ref)\](?:\[\])?/).replace("ref",g).getRegex(),X=l("reflink|nolink(?!\\()","g").replace("reflink",Z).replace("nolink",G).getRegex(),Y=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Q={_backpedal:o,anyPunctuation:H,autolink:K,blockSkip:$,br:A,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:o,delLDelim:o,delRDelim:o,emStrongLDelim:L,emStrongRDelimAst:D,emStrongRDelimUnd:_,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:W,nolink:G,punctuation:O,reflink:Z,reflinkSearch:X,tag:V,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:o},ee={...Q,link:l(/^!?\[(label)\]\((.*?)\)/).replace("label",U).getRegex(),reflink:l(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",U).getRegex()},et={...Q,emStrongRDelimAst:B,emStrongLDelim:P,delLDelim:j,delRDelim:J,url:l(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Y).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:l(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Y).getRegex()},en={...et,br:l(A).replace("{2,}","*").getRegex(),text:l(et.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},er={normal:S,gfm:M,pedantic:C},ei={normal:Q,gfm:et,breaks:en,pedantic:ee},es={"&":"&","<":"<",">":">",'"':""","'":"'"},eo=e=>es[e];function el(e,t){if(t){if(h.escapeTest.test(e))return e.replace(h.escapeReplace,eo)}else if(h.escapeTestNoEncode.test(e))return e.replace(h.escapeReplaceNoEncode,eo);return e}function ea(e){try{e=encodeURI(e).replace(h.percentDecode,"%")}catch{return null}return e}function eh(e,t){let n=e.replace(h.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"}).split(h.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(h.slashPipe,"|");return n}function ec(e,t,n){let r=e.length;if(0===r)return"";let i=0;for(;i<r;){let s=e.charAt(r-i-1);if(s!==t||n)if(s!==t&&n)i++;else break;else i++}return e.slice(0,r-i)}function ep(e,t,n,r,i){let s=t.href,o=t.title||null,l=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let a={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:s,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,a}var eu=class{options;rules;lexer;constructor(e){this.options=e||s}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ec(e,` 3`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(null===r)return t;let i=r[1];return t.split(` 4`).map(e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(` 5`)}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=ec(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:ec(t[0],` 6`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=ec(t[0],` 7`).split(` 8`),n="",r="",i=[];for(;e.length>0;){let t=!1,s=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))s.push(e[o]),t=!0;else if(t)break;else s.push(e[o]);e=e.slice(o);let l=s.join(` 9`),a=l.replace(this.rules.other.blockquoteSetextReplace,` 10 $1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n} 11${l}`:l,r=r?`${r} 12${a}`:a;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(a,i,!0),this.lexer.state.top=h,0===e.length)break;let c=i.at(-1);if(c?.type==="code")break;if(c?.type==="blockquote"){let t=c.raw+` 13`+e.join(` 14`),s=this.blockquote(t);i[i.length-1]=s,n=n.substring(0,n.length-c.raw.length)+s.raw,r=r.substring(0,r.length-c.text.length)+s.text;break}if(c?.type==="list"){let t=c.raw+` 15`+e.join(` 16`),s=this.list(t);i[i.length-1]=s,n=n.substring(0,n.length-c.raw.length)+s.raw,r=r.substring(0,r.length-c.raw.length)+s.raw,e=t.substring(i.at(-1).raw.length).split(` 17`);continue}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);
17if(t){let n=t[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r="",l="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let a=function(e,t=0){let n=t,r="";for(let t of e)if(" "===t){let e=4-n%4;r+=" ".repeat(e),n+=e}else r+=t,n++;return r}(t[2].split(` 18`,1)[0],t[1].length),h=e.split(` 19`,1)[0],c=!a.trim(),p=0;if(this.options.pedantic?(p=2,l=a.trimStart()):c?p=t[1].length+1:(p=(p=a.search(this.rules.other.nonSpaceChar))>4?1:p,l=a.slice(p),p+=t[1].length),c&&this.rules.other.blankLine.test(h)&&(r+=h+` 20`,e=e.substring(h.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),s=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p),u=this.rules.other.blockquoteBeginRegex(p);for(;e;){let d=e.split(` 21`,1)[0],f;if(h=d,f=this.options.pedantic?h=h.replace(this.rules.other.listReplaceNesting," "):h.replace(this.rules.other.tabCharGlobal," "),i.test(h)||s.test(h)||o.test(h)||u.test(h)||t.test(h)||n.test(h))break;if(f.search(this.rules.other.nonSpaceChar)>=p||!h.trim())l+=` 22`+f.slice(p);else{if(c||a.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||i.test(a)||s.test(a)||n.test(a))break;l+=` 23`+h}c=!h.trim(),r+=d+` 24`,e=e.substring(d.length+1),a=f.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:"list_item",raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(l),loose:!1,text:l,tokens:[]}),i.raw+=r}let l=i.items.at(-1);if(!l)return;for(let e of(l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd(),i.raw=i.raw.trimEnd(),i.items)){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,""),e.tokens[0]?.type==="text"||e.tokens[0]?.type==="paragraph"){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,"");break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:"checkbox",raw:t[0]+" ",checked:"[ ]"!==t[0]};e.checked=n.checked,i.loose?e.tokens[0]&&["paragraph","text"].includes(e.tokens[0].type)&&"tokens"in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:"paragraph",raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>"space"===e.type);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items)for(let t of(e.loose=!0,e.tokens))"text"===t.type&&(t.type="paragraph");return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=eh(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(` 25`):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?s.align.push("right"):this.rules.other.tableAlignCenter.test(e)?s.align.push("center"):this.rules.other.tableAlignLeft.test(e)?s.align.push("left"):s.align.push(null);for(let e=0;e<n.length;e++)s.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:s.align[e]});for(let e of i)s.rows.push(eh(e,s.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:s.align[t]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===` 26`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=ec(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e){if(-1===e.indexOf(")"))return -1;let t=0;for(let n=0;n<e.length;n++)if("\\"===e[n])n++;else if("("===e[n])t++;else if(")"===e[n]&&--t<0)return n;return t>0?-2:-1}(t[2]);if(-2===e)return;if(e>-1){let n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),ep(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return ep(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,s,o=n,l=0,a="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+n);null!==(r=a.exec(t));){if(!(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6]))continue;if(s=[...i].length,r[3]||r[4]){o+=s;continue}if((r[5]||r[6])&&n%3&&!((n+s)%3)){l+=s;continue}if((o-=s)>0)continue;s=Math.min(s,s+o+l);let t=[...r[0]][0].length,a=e.slice(0,n+r.index+t+s);if(Math.min(n,s)%2){let e=a.slice(1,-1);return{type:"em",raw:a,text:e,tokens:this.lexer.inlineTokens(e)}}let h=a.slice(2,-2);return{type:"strong",raw:a,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,n=""){let r=this.rules.inline.delLDelim.exec(e);
26if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,s,o=n,l=this.rules.inline.delRDelim;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!==(r=l.exec(t));){if(!(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6])||(s=[...i].length)!==n)continue;if(r[3]||r[4]){o+=s;continue}if((o-=s)>0)continue;s=Math.min(s,s+o);let t=[...r[0]][0].length,l=e.slice(0,n+r.index+t+s),a=l.slice(n,-n);return{type:"del",raw:l,text:a,tokens:this.lexer.inlineTokens(a)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return n="@"===t[2]?"mailto:"+(e=t[1]):e=t[1],{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])n="mailto:"+(e=t[0]);else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},ed=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||s,this.options.tokenizer=this.options.tokenizer||new eu,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:h,block:er.normal,inline:ei.normal};this.options.pedantic?(t.block=er.pedantic,t.inline=ei.pedantic):this.options.gfm&&(t.block=er.gfm,this.options.breaks?t.inline=ei.breaks:t.inline=ei.gfm),this.tokenizer.rules=t}static get rules(){return{block:er,inline:ei}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(h.carriageReturn,` 27`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(h.tabCharGlobal," ").replace(h.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+=` 28`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type==="paragraph"||n?.type==="text"?(n.raw+=(n.raw.endsWith(` 29`)?"":` 30`)+r.raw,n.text+=` 31`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if((r=this.tokenizer.fences(e))||(r=this.tokenizer.heading(e))||(r=this.tokenizer.hr(e))||(r=this.tokenizer.blockquote(e))||(r=this.tokenizer.list(e))||(r=this.tokenizer.html(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type==="paragraph"||n?.type==="text"?(n.raw+=(n.raw.endsWith(` 32`)?"":` 33`)+r.raw,n.text+=` 34`+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if((r=this.tokenizer.table(e))||(r=this.tokenizer.lheading(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{"number"==typeof(r=e.call({lexer:this},n))&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let s=t.at(-1);n&&s?.type==="paragraph"?(s.raw+=(s.raw.endsWith(` 35`)?"":` 36`)+r.raw,s.text+=` 37`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type==="text"?(n.raw+=(n.raw.endsWith(` 38`)?"":` 39`)+r.raw,n.text+=` 40`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n;this.tokenizer.lexer=this;let r=e,i=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!==(i=this.tokenizer.rules.inline.reflinkSearch.exec(r));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!==(i=this.tokenizer.rules.inline.anyPunctuation.exec(r));)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!==(i=this.tokenizer.rules.inline.blockSkip.exec(r));)n=i[2]?i[2].length:0,r=r.slice(0,i.index+n)+"["+"a".repeat(i[0].length-n-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let s=!1,o="";for(;e;){let n;if(s||(o=""),s=!1,this.options.extensions?.inline?.some(r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))continue;if((n=this.tokenizer.escape(e))||(n=this.tokenizer.tag(e))||(n=this.tokenizer.link(e))){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length);let r=t.at(-1);"text"===n.type&&r?.type==="text"?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if((n=this.tokenizer.emStrong(e,r,o))||(n=this.tokenizer.codespan(e))||(n=this.tokenizer.br(e))||(n=this.tokenizer.del(e,r,o))||(n=this.tokenizer.autolink(e))||!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;
40this.options.extensions.startInline.forEach(e=>{"number"==typeof(r=e.call({lexer:this},n))&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i)){e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(o=n.raw.slice(-1)),s=!0;let r=t.at(-1);r?.type==="text"?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},ef=class{options;parser;constructor(e){this.options=e||s}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(h.notSpaceStart)?.[0],i=e.replace(h.endingNewline,"")+` 41`;return r?'<pre><code class="language-'+el(r)+'">'+(n?i:el(i,!0))+`</code></pre> 42`:"<pre><code>"+(n?i:el(i,!0))+`</code></pre> 43`}blockquote({tokens:e}){return`<blockquote> 44${this.parser.parse(e)}</blockquote> 45`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}> 46`}hr(e){return`<hr> 47`}list(e){let t=e.ordered,n=e.start,r="";for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+`> 48`+r+"</"+i+`> 49`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li> 50`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p> 51`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n="";for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table> 52<thead> 53`+t+`</thead> 54`+r+`</table> 55`}tablerow({text:e}){return`<tr> 56${e}</tr> 57`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}> 58`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${el(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=ea(e);if(null===i)return r;let s='<a href="'+(e=i)+'"';return t&&(s+=' title="'+el(t)+'"'),s+=">"+r+"</a>"}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=ea(e);if(null===i)return el(n);e=i;let s=`<img src="${e}" alt="${el(n)}"`;return t&&(s+=` title="${el(t)}"`),s+=">"}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:el(e.text)}},em=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},eg=class e{options;renderer;textRenderer;constructor(e){this.options=e||s,this.options.renderer=this.options.renderer||new ef,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new em}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t="";for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=this.options.extensions.renderers[r.type].call({parser:this},r);if(!1!==e||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(r.type)){t+=e||"";continue}}switch(r.type){case"space":t+=this.renderer.space(r);break;case"hr":t+=this.renderer.hr(r);break;case"heading":t+=this.renderer.heading(r);break;case"code":t+=this.renderer.code(r);break;case"table":t+=this.renderer.table(r);break;case"blockquote":t+=this.renderer.blockquote(r);break;case"list":t+=this.renderer.list(r);break;case"checkbox":t+=this.renderer.checkbox(r);break;case"html":t+=this.renderer.html(r);break;case"def":t+=this.renderer.def(r);break;case"paragraph":t+=this.renderer.paragraph(r);break;case"text":t+=this.renderer.text(r);break;default:{let e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=e||"";continue}}switch(i.type){case"escape":case"text":n+=t.text(i);break;case"html":n+=t.html(i);break;case"link":n+=t.link(i);break;case"image":n+=t.image(i);break;case"checkbox":n+=t.checkbox(i);break;case"strong":n+=t.strong(i);break;case"em":n+=t.em(i);break;case"codespan":n+=t.codespan(i);break;case"br":n+=t.br(i);break;case"del":n+=t.del(i);break;default:{let e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw Error(e)}}}return n}},ek=class{options;block;constructor(e){this.options=e||s}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?ed.lex:ed.lexInline}provideParser(e=this.block){return e?eg.parse:eg.parseInline}},ey=new class{defaults=i();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=eg;Renderer=ef;TextRenderer=em;Lexer=ed;Tokenizer=eu;Hooks=ek;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":for(let e of r.header)n=n.concat(this.walkTokens(e.tokens,t));for(let e of r.rows)for(let r of e)n=n.concat(this.walkTokens(r.tokens,t));break;case"list":n=n.concat(this.walkTokens(r.items,t));break;default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};
58return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error("extension name required");if("renderer"in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw Error("extension level must be 'block' or 'inline'");let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ef(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let r=e.renderer[n],i=t[n];t[n]=(...e)=>{let n=r.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new eu(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let r=e.tokenizer[n],i=t[n];t[n]=(...e)=>{let n=r.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new ek;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let r=e.hooks[n],i=t[n];ek.passThroughHooks.has(n)?t[n]=e=>{if(this.defaults.async&&ek.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await r.call(t,e);return i.call(t,n)})();let s=r.call(t,e);return i.call(t,s)}:t[n]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await r.apply(t,e);return!1===n&&(n=await i.apply(t,e)),n})();let n=r.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ed.lex(e,t??this.defaults)}parser(e,t){return eg.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===r.async)return s(Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return s(Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return s(Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await (i.hooks?await i.hooks.provideLexer(e):e?ed.lex:ed.lexInline)(n,i),s=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(s,i.walkTokens));let o=await (i.hooks?await i.hooks.provideParser(e):e?eg.parse:eg.parseInline)(s,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(s);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?ed.lex:ed.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?eg.parse:eg.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return s(e)}}}onError(e,t){return n=>{if(n.message+=` 59Please report this to https://github.com/markedjs/marked.`,e){let e="<p>An error occurred:</p><pre>"+el(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function ex(e,t){return ey.parse(e,t)}ex.options=ex.setOptions=function(e){return ey.setOptions(e),ex.defaults=ey.defaults,s=ex.defaults,ex},ex.getDefaults=i,ex.defaults=s,ex.use=function(...e){return ey.use(...e),ex.defaults=ey.defaults,s=ex.defaults,ex},ex.walkTokens=function(e,t){return ey.walkTokens(e,t)},ex.parseInline=ey.parseInline,ex.Parser=eg,ex.parser=eg.parse,ex.Renderer=ef,ex.TextRenderer=em,ex.Lexer=ed,ex.lexer=ed.lex,ex.Tokenizer=eu,ex.Hooks=ek,ex.parse=ex,ex.options,ex.setOptions,ex.use,ex.walkTokens,ex.parseInline,eg.parse,ed.lex;var ew=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function eb(e,t){let n=t.split("\n").flatMap(e=>[e,""]).map(t=>`${e}${t}`).join("\n");return n.slice(0,n.length-1)}function ev(e){let t=(e.raw||e.text||"").match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return t?{isTask:!0,checked:"x"===t[2].toLowerCase(),indentLevel:t[1].length}:{isTask:!1,indentLevel:0}}function eS(e,t){return"string"!=typeof e?"json":t}var eT=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","circle","clippath","defs","ellipse","foreignobject","g","image","line","lineargradient","mask","path","polygon","polyline","radialgradient","rect","stop","switch","symbol","textpath","tspan","use","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),eM=/<\/?([a-zA-Z][\
59w-]*)/g,eC=class{constructor(e){var t,n,i,s,o;this.activeParseLexer=null,this.extensionRanks=new Map,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.schemaParseDomTagsCache=null,this.inlineNodeTypesCache=null,this.lastParseResult=null,this.markedInstance=null!=(t=null==e?void 0:e.marked)?t:ex,this.indentStyle=null!=(i=null==(n=null==e?void 0:e.indentation)?void 0:n.style)?i:"space",this.indentSize=null!=(o=null==(s=null==e?void 0:e.indentation)?void 0:s.size)?o:2,this.baseExtensions=(null==e?void 0:e.extensions)||[],(null==e?void 0:e.markedOptions)&&"function"==typeof this.markedInstance.setOptions&&this.markedInstance.setOptions(e.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,(null==e?void 0:e.extensions)&&(this.baseExtensions=e.extensions,(0,r.xf)((0,r.tp)(e.extensions)).forEach(e=>this.registerExtension(e)))}get instance(){return this.markedInstance}get indentCharacter(){return"space"===this.indentStyle?" ":" "}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(e){var t,n;this.extensions.push(e);let i=(0,r.gk)((0,r.iI)(e,"code")),s=e.name;i&&this.codeTypes.add(s),this.extensionRanks.has(s)||this.extensionRanks.set(s,this.extensionRanks.size);let o=(0,r.iI)(e,"markdownTokenName")||s,l=(0,r.iI)(e,"parseMarkdown"),a=(0,r.iI)(e,"renderMarkdown"),h=(0,r.iI)(e,"markdownTokenizer"),c=null!=(t=(0,r.iI)(e,"markdownOptions"))?t:null,p={tokenName:o,nodeName:s,parseMarkdown:l,renderMarkdown:a,isIndenting:null!=(n=null==c?void 0:c.indentsContent)&&n,htmlReopen:null==c?void 0:c.htmlReopen,tokenizer:h};if(o&&l){let e=this.registry.get(o)||[];e.push(p),this.registry.set(o,e)}if(a){let e=this.nodeTypeRegistry.get(s)||[];e.push(p),this.nodeTypeRegistry.set(s,e)}h&&this.hasMarked()&&this.registerTokenizer(h)}createLexer(){return new this.markedInstance.Lexer(this.markedInstance.defaults)}createTokenizerHelpers(e){return{inlineTokens:t=>e.inlineTokens(t),blockTokens:t=>e.blockTokens(t)}}tokenizeInline(e){var t;return(null!=(t=this.activeParseLexer)?t:this.createLexer()).inlineTokens(e)}registerTokenizer(e){if(!this.hasMarked())return;let{name:t,start:n,level:r="inline",tokenize:i}=e,s=this.createTokenizerHelpers.bind(this),o=this.createLexer.bind(this);this.markedInstance.use({extensions:[{name:t,level:r,start:n?"function"==typeof n?n:e=>e.indexOf(n):e=>{let t=i(e,[],this.createTokenizerHelpers(this.createLexer()));return t&&t.raw?e.indexOf(t.raw):-1},tokenizer(e,n){let r=i(e,n,this.lexer?s(this.lexer):s(o()));if(r&&r.type)return{...r,type:r.type||t,raw:r.raw||"",tokens:r.tokens||[]}},childTokens:[]}]})}getHandlersForToken(e){try{return this.registry.get(e)||[]}catch{return[]}}getHandlerForToken(e){let t=this.getHandlersForToken(e);if(t.length>0)return t[0];let n=this.getHandlersForNodeType(e);return n.length>0?n[0]:void 0}getHandlersForNodeType(e){try{return this.nodeTypeRegistry.get(e)||[]}catch{return[]}}serialize(e){if(!e)return"";let t=this.renderNodes(e,e);return this.isEmptyOutput(t)?"":t}isEmptyOutput(e){return!e||""===e.trim()||""===e.replace(/ /g,"").replace(/\u00A0/g,"").trim()}parse(e){if(!this.hasMarked())throw Error("No marked instance available for parsing");let t=this.activeParseLexer,n=this.createLexer();this.activeParseLexer=n;try{let t=n.lex(e),r=this.parseTokens(t,!0);return{type:"doc",content:r}}finally{this.activeParseLexer=t}}parseTokens(e,t=!1){let n=t?e.flatMap((t,n)=>{var r;if("space"===t.type||(null==(r=e[n+1])?void 0:r.type)==="space")return[t];let i=(t.raw||"").match(ew);return i?[{...t,raw:(t.raw||"").slice(0,-i[0].length)},{type:"space",raw:i[0]}]:[t]}):e,r=n.reduce((e,t,n)=>("space"!==t.type&&e.push(n),e),[]),i=-1,s=0;return n.flatMap((e,n)=>{for(var o;s<r.length&&r[s]<n;)i=r[s],s+=1;if(t&&"space"===e.type){let t=null!=(o=r[s])?o:-1;return this.createImplicitEmptyParagraphsFromSpace(e,i,t)}let l=this.parseToken(e,t);return null===l?[]:Array.isArray(l)?l:[l]})}createImplicitEmptyParagraphsFromSpace(e,t,n){let r=this.countParagraphSeparators(e.raw||"");return 0===r?[]:Array.from({length:Math.max(r-(-1!==t&&-1!==n),0)},()=>({type:"paragraph",content:[]}))}countParagraphSeparators(e){return(e.replace(/\r\n/g,"\n").match(/\n\n/g)||[]).length}parseToken(e,t=!1){if(!e.type)return null;if("list"===e.type)return this.parseListToken(e);let n=this.getHandlersForToken(e.type),r=this.createParseHelpers();if(n.find(t=>{if(!t.parseMarkdown)return!1;let n=t.parseMarkdown(e,r),i=this.normalizeParseResult(n);return!(!i||Array.isArray(i)&&!(i.length>0))&&(this.lastParseResult=i,!0)})&&this.lastParseResult){let e=this.lastParseResult;return this.lastParseResult=null,e}return this.parseFallbackToken(e,t)}parseListToken(e){if(!e.items||0===e.items.length)return this.parseTokenWithHandlers(e);let t=e.items.some(e=>ev(e).isTask),n=e.items.some(e=>!ev(e).isTask);if(!t||!n||0===this.getHandlersForToken("taskList").length)return this.parseTokenWithHandlers(e);let r=[],i=[],s=null;for(let t=0;t<e.items.length;t+=1){let n=e.items[t],{isTask:o,checked:l,indentLevel:a}=ev(n),h=n;if(o){let e=(n.raw||n.text||"").split("\n"),t=e[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),r=t?t[2]:"",i=[];if(e.length>1&&e.slice(1).join("\n").trim()){let t=e.slice(1),n=t.filter(e=>e.trim());if(n.length>0){let e=Math.min(...n.map(e=>e.length-e.trimStart().length)),r=t.map(t=>t.trim()?t.slice(e):"").join("\n").trim();r&&(i=this.markedInstance.lexer(`${r} 60`))}}h={type:"taskItem",raw:"",mainContent:r,indentLevel:a,checked:null!=l&&l,text:r,tokens:this.tokenizeInline(r),nestedTokens:i}}let c=o?"taskList":"list";s!==c?(i.length>0&&r.push({type:s,items:i}),i=[h],s=c):i.push(h)}i.length>0&&r.push({type:s,items:i});let o=[];for(let t=0;t<r.length;t+=1){let n=r[t],i={...e,type:n.type,items:n.items},s=this.parseToken(i);s&&(Array.isArray(s)?o.push(...s):o.push(s))}return o.length>0?o:null}parseTokenWithHandlers(e){if(!e.type)return null;let t=this.getHandlersForToken(e.type),n=this.createParseHelpers();if(t.find(t=>{if(!t.parseMarkdown)return!1;let r=t.parseMarkdown(e,n),i=this.normalizeParseResult(r);return!(!i||Array.isArray(i)&&!(i.length>0))&&(this.lastParseResult=i,!0)})&&this.lastParseResult){let e=this.lastParseResult;return this.lastParseResult=null,e}return this.parseFallbackToken(e)}createParseHelpers(){return{parseInline:e=>this.parseInlineTokens(e),tokenizeInline:e=>this.tokenizeInline(e),parseChildren:e=>this.parseTokens(e),parseBlockChildren:e=>this.parseTokens(e,!0),createTextNode:(e,t)=>({type:"text",text:e,marks:t||void 0}),createNode:(e,t,n)=>{let r={type:e,attrs:t||void 0,content:n||void 0};return t&&0!==Object.keys(t).length||delete r.attrs,r},applyMark:(e,t,n)=>({mark:e,content:t,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}parseInlineTokens(e){var t,n,i,s;let o=[];for(let l=0;l<e.length;l+=1){let a=e[l];
60if("text"===a.type)o.push({type:"text",text:(0,r.jT)(a.text||"")});else if("escape"===a.type)o.push({type:"text",text:a.text||""});else if("html"===a.type){let r=(null!=(n=null!=(t=a.raw)?t:a.text)?n:"").toString(),h=/^<\/[\s]*[\w-]+/i.test(r),c=r.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!h&&c&&!/\/>$/.test(r)){let t=c[1],n=this.escapeRegex(t),a=RegExp(`^<\\/\\s*${n}\\b`,"i"),h=-1,p=[r];for(let t=l+1;t<e.length;t+=1){let n=e[t],r=(null!=(s=null!=(i=n.raw)?i:n.text)?s:"").toString();if(p.push(r),"html"===n.type&&a.test(r)){h=t;break}}if(-1!==h){let e=p.join(""),t={type:"html",raw:e,text:e,block:!1},n=this.parseHTMLToken(t);if(n){let e=this.normalizeParseResult(n);Array.isArray(e)?o.push(...e):e&&o.push(e)}l=h;continue}}let p=this.parseHTMLToken(a);if(p){let e=this.normalizeParseResult(p);Array.isArray(e)?o.push(...e):e&&o.push(e)}}else if(a.type){let e=this.getHandlerForToken(a.type);if(e&&e.parseMarkdown){let t=this.createParseHelpers(),n=e.parseMarkdown(a,t);if(this.isMarkResult(n)){let e=this.applyMarkToContent(n.mark,n.content,n.attrs);o.push(...e)}else{let e=this.normalizeParseResult(n);Array.isArray(e)?o.push(...e):e&&o.push(e)}}else a.tokens&&o.push(...this.parseInlineTokens(a.tokens))}}for(let e=o.length-1;e>0;e-=1){let t=o[e],n=o[e-1];if("text"===t.type&&"text"===n.type){let i=t.marks||[],s=n.marks||[];(0,r.Xu)(i,s)&&(n.text=(n.text||"")+(t.text||""),o.splice(e,1))}}return o}applyMarkToContent(e,t,n){return t.map(t=>{if("text"===t.type){let r=t.marks||[],i=n?{type:e,attrs:n}:{type:e};return{...t,marks:[...r,i]}}return{...t,content:t.content?this.applyMarkToContent(e,t.content,n):void 0}})}isMarkResult(e){return e&&"object"==typeof e&&"mark"in e}normalizeParseResult(e){return e?this.isMarkResult(e)?e.content:e:null}parseFallbackToken(e,t=!1){switch(e.type){case"paragraph":return{type:"paragraph",content:e.tokens?this.parseInlineTokens(e.tokens):[]};case"heading":return{type:"heading",attrs:{level:e.depth||1},content:e.tokens?this.parseInlineTokens(e.tokens):[]};case"text":return{type:"text",text:(0,r.jT)(e.text||"")};case"html":return this.parseHTMLToken(e);case"escape":return{type:"text",text:e.text||""};case"space":return null;default:if(e.tokens)return this.parseTokens(e.tokens,t);return null}}parseHTMLToken(e){let t=e.text||e.raw||"";if(!t.trim())return null;if(this.isUnrecognizedHtml(t)||"u"<typeof window||void 0===window.DOMParser)return this.htmlAsLiteralText(t,!!e.block);try{let n=(0,r.yQ)(t,this.baseExtensions);if("doc"===n.type&&n.content){if(e.block)return n.content;let t=this.toInlineContent(n.content);return t.length>0?t:null}return n}catch(e){throw Error(`Failed to parse HTML in markdown: ${e}`)}}toInlineContent(e){let t=this.getInlineNodeTypes();return e.flatMap(e=>e.type&&t.has(e.type)?[e]:e.content?this.toInlineContent(e.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;let e=new Set(["text"]);try{let t=(0,r._w)(this.baseExtensions);Object.values(t.nodes).forEach(t=>{t.isInline&&e.add(t.name)})}catch{}return this.inlineNodeTypesCache=e,e}isUnrecognizedHtml(e){var t;return t=this.getSchemaParseDomTags(),(function(e){let t,n=[];for(;null!==(t=eM.exec(e));)n.push(t[1].toLowerCase());return n})(e).some(e=>{let n;return!((n=e.toLowerCase()).includes("-")||eT.has(n))&&!t.has(e)})}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;let e=new Set;try{let t=(0,r._w)(this.baseExtensions),n=t=>{let n=null==t?void 0:t.parseDOM;Array.isArray(n)&&n.forEach(t=>{if("string"==typeof(null==t?void 0:t.tag)){let n=t.tag.match(/^[a-zA-Z][\
60w-]*/);n&&e.add(n[0].toLowerCase())}})};Object.values(t.nodes).forEach(e=>n(e.spec)),Object.values(t.marks).forEach(e=>n(e.spec))}catch{}return this.schemaParseDomTagsCache=e,e}htmlAsLiteralText(e,t){let n=e.replace(/\s+$/,"");return n?t?{type:"paragraph",content:[{type:"text",text:n}]}:{type:"text",text:n}:null}encodeTextForMarkdown(e,t,n){return(null==n?void 0:n.type)!=null&&this.codeTypes.has(n.type)||(t.marks||[]).some(e=>this.codeTypes.has("string"==typeof e?e:e.type))?e:this.escapeMarkdownSyntax((0,r.zb)(e))}escapeMarkdownSyntax(e){return e.replace(/([\\`*_[\]~])/g,"\\$1")}renderNodeToMarkdown(e,t,n=0,r=0,i={}){var s;if("text"===e.type)return this.encodeTextForMarkdown(e.text||"",e,t);if(!e.type)return"";let o=this.getHandlerForToken(e.type);if(!o)return"";let l=Array.isArray(null==t?void 0:t.content)&&n>0?t.content[n-1]:void 0,a={index:n,level:r,parentType:null==t?void 0:t.type,previousNode:l,meta:{parentAttrs:null==t?void 0:t.attrs,...i}};return(null==(s=o.renderMarkdown)?void 0:s.call(o,e,{renderChildren:(t,i)=>{let s=o.isIndenting?r+1:r;return!Array.isArray(t)&&t.content?this.renderNodes(t.content,e,i||"",n,s):this.renderNodes(t,e,i||"",n,s)},renderChild:(t,n)=>{let i=o.isIndenting?r+1:r;return this.renderNodeToMarkdown(t,e,n,i)},indent:e=>this.indentString+e,wrapInBlock:eb},a))||""}renderNodes(e,t,n="",r=0,i=0){return Array.isArray(e)?this.renderNodesWithMarkBoundaries(e,t,n,i):e.type?this.renderNodeToMarkdown(e,t,r,i):""}renderNodesWithMarkBoundaries(e,t,n="",i=0){let s=[],o=new Map,l=new Set,a=new Map;return e.forEach((n,h)=>{var c,p,u;let d=h<e.length-1?e[h+1]:null;if(n.type)if("text"===n.type){let e,i,h=this.encodeTextForMarkdown(n.text||"",n,t),p=new Map((n.marks||[]).map(e=>[e.type,e])),u=this.getMarksToOpenForSerialization(o,p,d),f=(e=[],Array.from(p.entries()).forEach(([t,n])=>{d&&(d.marks||[]).find(e=>e.type===t&&(0,r.Xh)(e.attrs,n.attrs))||e.push(t)}),e),m=f.filter(e=>o.has(e)),g=m.length>0&&u.length>0,k="";if(f.length>0&&!g){let e=h.match(/(\s+)$/);e&&(k=e[1],h=h.slice(0,-k.length))}g||f.slice().reverse().forEach(e=>{if(!o.has(e))return;let t=p.get(e),n=this.getMarkClosing(e,t,a.get(e));n&&(h+=n),o.has(e)&&(o.delete(e),a.delete(e))});let y="";if(u.length>0){let e=h.match(/^(\s+)/);e&&(y=e[1],h=h.slice(y.length))}if(u.forEach(({type:e,mark:t})=>{let n=l.has(e)?"html":"markdown",r=this.getMarkOpening(e,t,n);r&&(h=r+h),a.set(e,n),l.delete(e)}),g||u.slice().reverse().forEach(({type:e,mark:t})=>{o.set(e,t)}),h=y+h,g){let e=new Set(((null==d?void 0:d.marks)||[]).map(e=>e.type));u.forEach(({type:t})=>{e.has(t)&&this.getHtmlReopenTags(t)&&l.add(t)});let t=Array.from(o.keys()),n=m.slice().sort((e,n)=>t.indexOf(n)-t.indexOf(e));i=[...u.map(e=>e.type),...n]}else{let e,t,n,s;c=this.markSetsEqual.bind(this),e=!d,t=d&&(!d.marks||0===d.marks.length),n=d&&d.marks&&!c(p,new Map(d.marks.map(e=>[e.type,e]))),s=[],(e||t||n)&&(d&&d.marks?Array.from(o.entries()).reverse().forEach(([e,t])=>{d.marks.find(n=>n.type===e&&(0,r.Xh)(n.attrs,t.attrs))||s.push(e)}):(e||t)&&s.push(...Array.from(o.keys()).reverse())),i=s}let x="";if(i.length>0){let e=h.match(/(\s+)$/);e&&(x=e[1],h=h.slice(0,-x.length))}i.forEach(e=>{var t;let n=null!=(t=o.get(e))?t:p.get(e),r=this.getMarkClosing(e,n,a.get(e));r&&(h+=r),o.delete(e),a.delete(e)}),h+=x,h+=k,s.push(h)}else{let e,r,l=new Set((n.marks||[]).map(e=>e.type)),c=new Map,d=new Map;o.forEach((e,t)=>{var n;l.has(t)&&(c.set(t,e),d.set(t,null!=(n=a.get(t))?n:"markdown"))});let f=(p=(e,t)=>this.getMarkClosing(e,t,a.get(e)),e="",Array.from(o.keys()).reverse().forEach(t=>{let n=o.get(t),r=p(t,n);r&&(e=r+e)}),o.clear(),e);a.clear();let m=this.renderNodeToMarkdown(n,t,h,i),g="hardBreak"===n.type?"":(u=(e,t)=>{var n;let r=null!=(n=d.get(e))?n:"markdown";return a.set(e,r),this.getMarkOpening(e,t,r)},r="",Array.from(c.entries()).forEach(([e,t])=>{let n=u(e,t);n&&(r+=n),o.set(e,t)}),r);s.push(f+m+g)}}),s.join(n)}getMarkOpening(e,t,n="markdown"){var r;if("html"===n)return(null==(r=this.getHtmlReopenTags(e))?void 0:r.open)||"";let i=this.getHandlersForNodeType(e),s=i.length>0?i[0]:void 0;if(!s||!s.renderMarkdown)return"";let o="î__TIPTAP_MARKDOWN_PLACEHOLDER__î",l={type:e,attrs:t.attrs||{},content:[{type:"text",text:o}]};try{let e=s.renderMarkdown(l,{renderChildren:()=>o,renderChild:()=>o,indent:e=>e,wrapInBlock:(e,t)=>e+t},{index:0,level:0,parentType:"text",meta:{}}),t=e.indexOf(o);return t>=0?e.substring(0,t):""}catch(t){throw Error(`Failed to get mark opening for ${e}: ${t}`)}}getMarkClosing(e,t,n="markdown"){var r;if("html"===n)return(null==(r=this.getHtmlReopenTags(e))?void 0:r.close)||"";let i=this.getHandlersForNodeType(e),s=i.length>0?i[0]:void 0;if(!s||!s.renderMarkdown)return"";let o="î__TIPTAP_MARKDOWN_PLACEHOLDER__î",l={type:e,attrs:t.attrs||{},content:[{type:"text",text:o}]};try{let e=s.renderMarkdown(l,{renderChildren:()=>o,renderChild:()=>o,indent:e=>e,wrapInBlock:(e,t)=>e+t},{index:0,level:0,parentType:"text",meta:{}}),t=e.indexOf(o),n=t+o.length;return t>=0?e.substring(n):""}catch(t){throw Error(`Failed to get mark closing for ${e}: ${t}`)}}getHtmlReopenTags(e){let t=this.getHandlersForNodeType(e),n=t.length>0?t[0]:void 0;return null==n?void 0:n.htmlReopen}markSetsEqual(e,t){return e.size===t.size&&Array.from(e.entries()).every(([e,n])=>{let i=t.get(e);return i&&(0,r.Xh)(n.attrs,i.attrs)})}getMarksToOpenForSerialization(e,t,n){let i,s=(i=[],Array.from(t.entries()).forEac
60h(([t,n])=>{let s=e.get(t);s&&(0,r.Xh)(s.attrs,n.attrs)||i.push({type:t,mark:n})}),i);if(s.length<=1)return s;let o=(null==n?void 0:n.marks)||[],l=(e,t)=>o.some(n=>n.type===e&&(0,r.Xh)(n.attrs,t)),a=(e,t)=>{var n,r;let i=null!=(n=this.extensionRanks.get(e.type))?n:Number.MAX_SAFE_INTEGER,s=null!=(r=this.extensionRanks.get(t.type))?r:Number.MAX_SAFE_INTEGER;return i!==s?s-i:e.type.localeCompare(t.type)};return[...s.filter(e=>!l(e.type,e.mark.attrs)).sort(a),...s.filter(e=>l(e.type,e.mark.attrs)).sort(a)]}},eA=r.YY.create({name:"markdown",addOptions:()=>({indentation:{style:"space",size:2},marked:void 0,markedOptions:{}}),addCommands(){return{setContent:(e,t)=>{if(!(null==t?void 0:t.contentType)||"markdown"!==eS(e,null==t?void 0:t.contentType)||!this.editor.markdown)return r.Pi.setContent(e,t);let n=this.editor.markdown.parse(e);return r.Pi.setContent(n,t)},insertContent:(e,t)=>{if(!(null==t?void 0:t.contentType)||"markdown"!==eS(e,null==t?void 0:t.contentType)||!this.editor.markdown)return r.Pi.insertContent(e,t);let n=this.editor.markdown.parse(e);return r.Pi.insertContent(n,t)},insertContentAt:(e,t,n)=>{if(!(null==n?void 0:n.contentType)||"markdown"!==eS(t,null==n?void 0:n.contentType)||!this.editor.markdown)return r.Pi.insertContentAt(e,t,n);let i=this.editor.markdown.parse(t);return r.Pi.insertContentAt(e,i,n)}}},addStorage(){return{manager:new eC({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){var e;if(this.editor.markdown)return void console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");if(this.storage.manager=new eC({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||"markdown"!==eS(this.editor.options.content,this.editor.options.contentType))return;if(!this.editor.markdown)throw Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(void 0===this.editor.options.content||"string"!=typeof this.editor.options.content)throw Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');let t=this.editor.markdown.parse(this.editor.options.content);(null==(e=t.content)?void 0:e.length)&&(this.editor.options.content=t)}})},27767:(e,t,n)=>{n.d(t,{QO:()=>L,vR:()=>P,Or:()=>q,JU:()=>W,lb:()=>Z});var r=n(30865),i=n(51087),s=n(71930);class o{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=null!=(n=t.width)?n:1,this.color=!1===t.color?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.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(null!=this.cursorPos&&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,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t,n=this.editorView.state.doc.resolve(this.cursorPos),r=!n.parent.inlineContent,i,s=this.editorView.dom,o=s.getBoundingClientRect(),l=o.width/s.offsetWidth,a=o.height/s.offsetHeight;if(r){let e=n.nodeBefore,t=n.nodeAfter;if(e||t){let n=this.editorView.nodeDOM(this.cursorPos-(e?e.nodeSize:0));if(n){let r=n.getBoundingClientRect(),s=e?r.bottom:r.top;e&&t&&(s=(s+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let o=this.width/2*a;i={left:r.left,right:r.right,top:s-o,bottom:s+o}}}}if(!i){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*l;i={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let h=this.editorView.dom.offsetParent;if(!this.element&&(this.element=h.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",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r),h&&(h!=document.body||"static"!=getComputedStyle(h).position)){let n=h.getBoundingClientRect(),r=n.width/h.offsetWidth,i=n.height/h.offsetHeight;e=n.left-h.scrollLeft*r,t=n.top-h.scrollTop*i}else e=-pageXOffset,t=-pageYOffset;this.element.style.left=(i.left-e)/l+"px",this.element.style.top=(i.top-t)/a+"px",this.element.style.width=(i.right-i.left)/l+"px",this.element.style.height=(i.bottom-i.top)/a+"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="function"==typeof r?r(this.editorView,t,e):r;if(!t||i)return null;let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=(0,s.Um)(this.editorView.state.doc,o,this.editorView.dragging.slice);null!=e&&(o=e)}return o}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);null!=t&&(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)}}var l=n(894),a=n(91698),h=n(28745);class c extends i.LN{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return c.valid(n)?new c(n):i.LN.near(n)}content(){return h.Ji.empty}eq(e){return e instanceof c&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new c(e.resolve(t.pos))}getBookmark(){return new p(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0==n){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||u(e.type))return!0;
60if(e.inlineContent)return!1}}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||u(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&c.valid(e))return e;let r=e.pos,s=null;for(let n=e.depth;;n--){let i=e.node(n);if(t>0?e.indexAfter(n)<i.childCount:e.index(n)>0){s=i.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let o=e.doc.resolve(r);if(c.valid(o))return o}for(;;){let o=t>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!i.nh.isSelectable(s)){e=e.doc.resolve(r+s.nodeSize*t),n=!1;continue e}break}s=o,r+=t;let l=e.doc.resolve(r);if(c.valid(l))return l}return null}}}c.prototype.visible=!1,c.findFrom=c.findGapCursorFrom,i.LN.jsonID("gapcursor",c);class p{constructor(e){this.pos=e}map(e){return new p(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return c.valid(t)?new c(t):i.LN.near(t)}}function u(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}let d=(0,a.K)({ArrowLeft:f("horiz",-1),ArrowRight:f("horiz",1),ArrowUp:f("vert",-1),ArrowDown:f("vert",1)});function f(e,t){let n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,s){let o=e.selection,l=t>0?o.$to:o.$from,a=o.empty;if(o instanceof i.U3){if(!s.endOfTextblock(n)||0==l.depth)return!1;a=!1,l=e.doc.resolve(t>0?l.after():l.before())}let h=c.findGapCursorFrom(l,t,a);return!!h&&(r&&r(e.tr.setSelection(new c(h))),!0)}}function m(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!c.valid(r))return!1;let s=e.posAtCoords({left:n.clientX,top:n.clientY});return!(s&&s.inside>-1&&i.nh.isSelectable(e.state.doc.nodeAt(s.inside)))&&(e.dispatch(e.state.tr.setSelection(new c(r))),!0)}function g(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof c))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 s=h.FK.empty;for(let e=r.length-1;e>=0;e--)s=h.FK.from(r[e].createAndFill(null,s));let o=e.state.tr.replace(n.pos,n.pos,new h.Ji(s,0,0));return o.setSelection(i.U3.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function k(e){if(!(e.selection instanceof c))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",l.zF.create(e.doc,[l.NZ.widget(e.selection.head,t,{key:"gapcursor"})])}var y=function(){};y.prototype.append=function(e){return e.length?(e=y.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},y.prototype.prepend=function(e){return e.length?y.from(e).append(this):this},y.prototype.appendInner=function(e){return new w(this,e)},y.prototype.slice=function(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t)?y.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},y.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e)},y.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},y.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},y.from=function(e){return e instanceof y?e:e&&e.length?new x(e):y.empty};var x=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 0==e&&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(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)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}(y);y.empty=new x([]);var w=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&&!1===this.left.forEachInner(e,t,Math.min(n,i),r)||n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)||n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))return!1},t.prototype.sliceInner=function(e,t){if(0==e&&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}(y);class b{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){let n,r,i,s;if(0==this.eventCount)return null;let o=this.items.length;for(;;o--)if(this.items.get(o-1).selection){--o;break}t&&(r=(n=this.remapping(o,this.items.length)).maps.length);let l=e.tr,a=[],h=[];
60return this.items.forEach((e,t)=>{if(!e.step){n||(r=(n=this.remapping(o,t+1)).maps.length),r--,h.push(e);return}if(n){h.push(new v(e.map));let t=e.step.map(n.slice(r)),i;t&&l.maybeStep(t).doc&&(i=l.mapping.maps[l.mapping.maps.length-1],a.push(new v(i,void 0,void 0,a.length+h.length))),r--,i&&n.appendMap(i,r)}else l.maybeStep(e.step);if(e.selection)return i=n?e.selection.map(n.slice(r)):e.selection,s=new b(this.items.slice(0,o).append(h.reverse().concat(a)),this.eventCount-1),!1},this.items.length,0),{remaining:s,transform:l,selection:i}}addTransform(e,t,n,r){var i,s;let o,l=[],a=this.eventCount,h=this.items,c=!r&&h.length?h.get(h.length-1):null;for(let n=0;n<e.steps.length;n++){let i=e.steps[n].invert(e.docs[n]),s=new v(e.mapping.maps[n],i,t),o;(o=c&&c.merge(s))&&(s=o,n?l.pop():h=h.slice(0,h.length-1)),l.push(s),t&&(a++,t=void 0),r||(c=s)}let p=a-n.depth;return p>T&&(i=h,s=p,i.forEach((e,t)=>{if(e.selection&&0==s--)return o=t,!1}),h=i.slice(o),a-=p),new b(h.append(l),a)}remapping(e,t){let n=new s.X9;return this.items.forEach((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(e){return 0==this.eventCount?this:new b(this.items.append(e.map(e=>new v(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,s=e.steps.length,o=this.eventCount;this.items.forEach(e=>{e.selection&&o--},r);let l=t;this.items.forEach(t=>{let r=i.getMirror(--l);if(null==r)return;s=Math.min(s,r);let a=i.maps[r];if(t.step){let s=e.steps[r].invert(e.docs[r]),h=t.selection&&t.selection.map(i.slice(l+1,r));h&&o++,n.push(new v(a,s,h))}else n.push(new v(a))},r);let a=[];for(let e=t;e<s;e++)a.push(new v(i.maps[e]));let h=new b(this.items.slice(0,r).append(a).append(n),o);return h.emptyItemCount()>500&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let e=0;return this.items.forEach(t=>{!t.step&&e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach((s,o)=>{if(o>=e)r.push(s),s.selection&&i++;else if(s.step){let e=s.step.map(t.slice(n)),o=e&&e.getMap();if(n--,o&&t.appendMap(o,n),e){let l=s.selection&&s.selection.map(t.slice(n));l&&i++;let a=new v(o.invert(),e,l),h,c=r.length-1;(h=r.length&&r[c].merge(a))?r[c]=h:r.push(a)}}else s.map&&n--},this.items.length,0),new b(y.from(r.reverse()),i)}}b.empty=new b(y.empty,0);class v{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new v(t.getMap().invert(),t,this.selection)}}}class S{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}let T=20;function M(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function C(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),s=t.map(e[r+1],-1);i<=s&&n.push(i,s)}return n}let A=!1,E=null;function R(e){let t=e.plugins;if(E!=t){A=!1,E=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){A=!0;break}}return A}let I=new i.hs("history"),O=new i.hs("closeHistory");function N(e,t){return(n,r)=>{let i=I.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){let s=function(e,t,n){let r=R(t),i=I.get(t).spec.config,s=(n?e.undone:e.done).popEvent(t,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),l=(n?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),i,r),a=new S(n?l:s.remaining,n?s.remaining:l,null,0,-1);return s.transform.setSelection(o).setMeta(I,{redo:n,historyState:a})}(i,n,e);s&&r(t?s.scrollIntoView():s)}return!0}}let $=N(!1,!0),z=N(!0,!0);N(!1,!1),N(!0,!1),r.YY.create({name:"characterCount",addOptions:()=>({limit:null,autoTrim:!0,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(e=>""!==e).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){let e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new i.k_({key:new i.hs("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,s=this.options.autoTrim;if(null==i||0===i||!1===s){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let t=r.tr.deleteRange(0,o-i);return e=!0,t}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||0===n||null==n)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;
60if(r>n&&i>n&&i>r||!e.getMeta("paste"))return!1;let s=e.selection.$head.pos;return e.deleteRange(s-(i-n),s),!(this.storage.characters({node:e.doc})>n)}})]}});var L=r.YY.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[function(e={}){return new i.k_({view:t=>new o(t,e)})}(this.options)]}});r.YY.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new i.k_({key:new i.hs("focus"),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,s=[];if(!n||!r)return l.zF.create(e,[]);let o=0;"deepest"===this.options.mode&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let a=0;return e.descendants((e,t)=>!e.isText&&!!(i>=t&&i<=t+e.nodeSize-1)&&((a+=1,"deepest"===this.options.mode&&o-a>0||"shallowest"===this.options.mode&&a>1)?"deepest"===this.options.mode:void s.push(l.NZ.node(t,t+e.nodeSize,{class:this.options.className})))),l.zF.create(e,s)}}})]}});var P=r.YY.create({name:"gapCursor",addProseMirrorPlugins:()=>[new i.k_({props:{decorations:k,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&c.valid(n)?new c(n):null,handleClick:m,handleKeyDown:d,handleDOMEvents:{beforeinput
60:g}}})],extendNodeSchema(e){var t;let n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:null!=(t=(0,r.gk)((0,r.iI)(e,"allowGapCursor",n)))?t:null}}}),F="placeholder",D=new i.hs("tiptap__placeholder");function B(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:s,isEmptyDoc:o,hasAnchor:a,classes:{emptyNode:h,emptyEditor:c}}=e,p=[h];return o&&p.push(c),l.NZ.node(i,i+s.nodeSize,{class:p.join(" "),[r]:"function"==typeof n?n({editor:t,node:s,pos:i,hasAnchor:a}):n})}function _(e,t){return"function"==typeof e?e(t):e}function j({editor:e,options:t,dataAttribute:n,doc:i,selection:s,from:o,to:l}){let{anchor:a}=s,h=[],c=e.isEmpty;return i.nodesBetween(o,l,(i,s)=>{let o=a>=s&&a<=s+i.nodeSize,l=!i.isLeaf&&(0,r.Op)(i);return i.type.isTextblock&&(o||!t.showOnlyCurrent)&&l&&h.push(B({editor:e,isEmptyDoc:c,dataAttribute:n,hasAnchor:o,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:_(t.emptyNodeClass,{editor:e,node:i,pos:s,hasAnchor:o})},node:i,pos:s})),t.includeChildren}),h}function J({editor:e,options:t,dataAttribute:n,doc:i,selection:s}){if(!(e.isEditable||!t.showOnlyWhenEditable))return null;let{anchor:o}=s,a=[],h=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){let s=i.resolve(o),l=s.depth>0?s.node(1):s.nodeAfter,c=s.depth>0?s.before(1):o;if(l&&l.type.isTextblock&&(0,r.Op)(l)){let r=o>=c&&o<=c+l.nodeSize;a.push(B({editor:e,isEmptyDoc:h,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:_(t.emptyNodeClass,{editor:e,node:l,pos:c,hasAnchor:r})},node:l,pos:c}))}}else a.push(...j({editor:e,options:t,dataAttribute:n,doc:i,selection:s,from:0,to:i.content.size}));return l.zF.create(i,a)}function H(e,t){var n;let r=e.resolve(t);if(0===r.depth){let e=null!=(n=r.nodeAfter)?n:r.nodeBefore;if(!e)return{from:t,to:t};let i=r.nodeAfter?t:t-e.nodeSize;return{from:i,to:i+e.nodeSize}}let i=r.before(1);return{from:i,to:i+r.node(1).nodeSize}}function K(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}var q=r.YY.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:F,placeholder:"Write something â¦",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[function({editor:e,options:t}){let n=t.dataAttribute?`data-${t.dataAttribute.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}`:`data-${F}`,s=t.showOnlyCurrent&&!t.includeChildren;return new i.k_({key:D,...s?{}:{state:function({editor:e,options:t,dataAttribute:n}){return{init(r,i){let s=J({editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection});return null!=s?s:l.zF.empty},apply:(i,s,o,l)=>i.docChanged||i.selectionSet?function({decorations:e,ranges:t,editor:n,options:r,dataAttribute:i,doc:s,selection:o}){let l=e;for(let e of t){let{from:t,to:a}=function(e,t,n){let r=Math.max(0,Math.min(e,n.content.size)),i=Math.max(r,Math.min(t,n.content.size));return{from:r,to:i}}(e.from,e.to,s),h=l.find(t,a).filter(e=>e.from>=t&&e.to<=a);h.length&&(l=l.remove(h));let c=j({editor:n,options:r,dataAttribute:i,doc:s,selection:o,from:t,to:a});c.length&&(l=l.add(s,c))}return l}({decorations:s.map(i.mapping,i.doc),ranges:function(e,t,n){let i=[];if(e.docChanged)for(let t of(0,r.FF)(e))i.push(...function(e,t){var n,r;let i,s=(n=t.from,r=t.to,i=[],e.forEach((e,t)=>{let s=t+e.nodeSize,o=s+1;t+1<r&&o>n&&i.push({from:t,to:s})}),i);return s.push(K(e,H(e,t.from))),t.to>t.from?s.push(K(e,H(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&s.push(K(e,H(e,Math.min(t.from+1,e.content.size)))),s}(n.doc,t.newRange));return e.selectionSet&&(i.push(K(n.doc,H(n.doc,e.mapping.map(t.selection.anchor)))),i.push(K(n.doc,H(n.doc,n.selection.anchor)))),function(e){if(0===e.length)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}(i)}(i,o,l),editor:e,options:t,dataAttribute:n,doc:l.doc,selection:l.selection}):s}}({editor:e,options:t,dataAttribute:n})},props:{decorations:s?({doc:r,selection:i})=>J({editor:e,options:t,dataAttribute:n,doc:r,selection:i}):n=>{var r;return t.showOnlyWhenEditable&&!e.isEditable?l.zF.empty:null!=(r=D.getState(n))?r:l.zF.empty}}})}({editor:this.editor,options:this.options})]}});function V(e,t){return!e.selection.empty&&!(0,r.BQ)(e.selection)&&t.isEditable}function U({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}r.YY.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new i.k_({key:new i.hs("selection"),props:{decorations:n=>!V(n,e)||e.isFocused||e.view.dragging?null:l.zF.create(n.doc,[l.NZ.inline(n.selection.from,n.selection.to,{class:t.className})]),handleDOMEvents:{blur(t){var n;return!!V(t.state,e)&&(null==(n=window.getSelection())||n.removeAllRanges(),!1)},focus:t=>!!V(t.state,e)&&(requestAnimationFrame(()=>
60{!e.isDestroyed&&t.hasFocus()&&t.focus()}),!1)}}})]}});var W=r.YY.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var e;let t=new i.hs(this.name),n=this.options.node||(null==(e=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(n).includes(e.name));return[new i.k_({key:t,appendTransaction:(e,r,i)=>{let{doc:s,tr:o,schema:l}=i,a=t.getState(i),h=s.content.size,c=l.nodes[n];if(!e.some(e=>e.getMeta("skipTrailingNode"))&&a)return o.insert(h,c.create())},state:{init:(e,t)=>!U({node:t.tr.doc.lastChild,types:r}),apply:(e,t)=>!e.docChanged||e.getMeta("__uniqueIDTransaction")?t:!U({node:e.doc.lastChild,types:r})}})]}}),Z=r.YY.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>$(e,t),redo:()=>({state:e,dispatch:t})=>z(e,t)}),addProseMirrorPlugins(){return[function(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new i.k_({key:I,state:{init:()=>new S(b.empty,b.empty,null,0,-1),apply:(t,n,r)=>(function(e,t,n,r){let i=n.getMeta(I),s;if(i)return i.historyState;n.getMeta(O)&&(e=new S(e.done,e.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(o&&o.getMeta(I))if(o.getMeta(I).redo)return new S(e.done.addTransform(n,void 0,r,R(t)),e.undone,M(n.mapping.maps),e.prevTime,e.prevComposition);else return new S(e.done,e.undone.addTransform(n,void 0,r,R(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||o&&!1===o.getMeta("addToHistory"))if(s=n.getMeta("rebased"))return new S(e.done.rebased(n,s),e.undone.rebased(n,s),C(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new S(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),C(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),s=0==e.prevTime||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(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}(n,e.prevRanges)),l=o?C(e.prevRanges,n.mapping):M(n.mapping.maps);return new S(e.done.addTransform(n,s?t.selection.getBookmark():void 0,r,R(t)),b.empty,l,n.time,null==i?e.prevComposition:i)}})(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?$:"historyRedo"==n?z:null;return!!r&&!!e.editable&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}(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()}}})},28745:(e,t,n)=>{function r(e){this.content=e}function i(e){return e>=56320&&e<57344}function s(e){return e>=55296&&e<56320}n.d(t,{S4:()=>J,ZF:()=>X,FK:()=>o,CU:()=>c,sX:()=>B,bP:()=>M,u$:()=>S,vI:()=>p,Sj:()=>_,Ji:()=>u}),r.prototype={constructor:r,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 -1==t?void 0:this.content[t+1]},update:function(e,t,n){var i=n&&n!=e?this.remove(n):this,s=i.find(e),o=i.content.slice();return -1==s?o.push(n||e,t):(o[s+1]=t,n&&(o[s]=n)),new r(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new r(n)},addToStart:function(e,t){return new r([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new r(n)},addBefore:function(e,t,n){var i=this.remove(t),s=i.content.slice(),o=i.find(e);return s.splice(-1==o?s.length:o,0,t,n),new r(s)},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=r.from(e)).size?new r(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=r.from(e)).size?new r(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=r.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}},r.from=function(e){if(e instanceof r)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new r(t)};class o{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let s=0,o=0;o<t;s++){let l=this.content[s],a=o+l.nodeSize;if(a>e&&!1!==n(l,r+o,i||null,s)&&l.content.size){let i=o+1;l.nodesBetween(Math.max(0,e-i),Math.min(l.content.size,t-i),n,r+i)}o=a}}descendants(e){this.nodesBetween(0,this.size,e)}
60textBetween(e,t,n,r){let i="",s=!0;return this.nodesBetween(e,t,(o,l)=>{let a=o.isText?o.text.slice(Math.max(e,l)-l,t-l):o.isLeaf?r?"function"==typeof r?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&a||o.isTextblock)&&n&&(s?s=!1:i+=n),i+=a},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new o(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,s=0;s<t;i++){let o=this.content[i],l=s+o.nodeSize;l>e&&((s<e||l>t)&&(o=o.isText?o.cut(Math.max(0,e-s),Math.min(o.text.length,t-s)):o.cut(Math.max(0,e-s-1),Math.min(o.content.size,t-s-1))),n.push(o),r+=o.nodeSize),s=l}return new o(n,r)}cutByIndex(e,t){return e==t?o.empty:0==e&&t==this.content.length?this:new o(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new o(r,i)}addToStart(e){return new o([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new o(this.content.concat(e),this.size+e.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 function e(t,n,r){for(let o=0;;o++){if(o==t.childCount||o==n.childCount)return t.childCount==n.childCount?null:r;let l=t.child(o),a=n.child(o);if(l==a){r+=l.nodeSize;continue}if(!l.sameMarkup(a))return r;if(l.isText&&l.text!=a.text){let e=l.text,t=a.text,n=0;for(;e[n]==t[n];n++)r++;return n&&n<e.length&&n<t.length&&s(e.charCodeAt(n-1))&&i(e.charCodeAt(n))&&r--,r}if(l.content.size||a.content.size){let t=e(l.content,a.content,r+1);if(null!=t)return t}r+=l.nodeSize}}(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return function e(t,n,r,o){for(let l=t.childCount,a=n.childCount;;){if(0==l||0==a)return l==a?null:{a:r,b:o};let h=t.child(--l),c=n.child(--a),p=h.nodeSize;if(h==c){r-=p,o-=p;continue}if(!h.sameMarkup(c))return{a:r,b:o};if(h.isText&&h.text!=c.text){let e=h.text,t=c.text,n=e.length,l=t.length;for(;n>0&&l>0&&e[n-1]==t[l-1];)n--,l--,r--,o--;return n&&l&&n<e.length&&s(e.charCodeAt(n-1))&&i(e.charCodeAt(n))&&(r++,o++),{a:r,b:o}}if(h.content.size||c.content.size){let t=e(h.content,c.content,r-1,o-1);if(t)return t}r-=p,o-=p}}(this,e,t,n)}findIndex(e){if(0==e)return a(0,e);if(e==this.size)return a(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=n+this.child(t).nodeSize;if(r>=e){if(r==e)return a(t+1,r);return a(t,n)}n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return o.empty;if(!Array.isArray(t))throw RangeError("Invalid input for Fragment.fromJSON");return o.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return o.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new o(t||e,n)}static from(e){if(!e)return o.empty;if(e instanceof o)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new o([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}o.empty=new o([],0);let l={index:0,offset:0};function a(e,t){return l.index=e,l.offset=t,l}function h(e,t){if(e===t)return!0;
vendor: 1,543 bytes, line 60
60if(!(e&&"object"==typeof e)||!(t&&"object"==typeof t))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(!h(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!h(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class c{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||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(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&&h(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`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}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(e){if(!e||Array.isArray(e)&&0==e.length)return c.none;if(e instanceof c)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}c.none=[];
vendor: 5,419 bytes, line 60
60class p extends Error{}class u{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=function e(t,n,r,i,s,o){let{index:l,offset:a}=t.findIndex(n),h=t.maybeChild(l);if(a==n||h.isText)return o&&i<=0&&s<=0&&!o.canReplace(l,l,r)?null:t.cut(0,n).append(r).append(t.cut(n));let c=e(h.content,n-a-1,r,0==l?i-1:0,l==t.childCount-1?s-1:0,h);return c&&t.replaceChild(l,h.copy(c))}(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return n&&new u(n,this.openStart,this.openEnd)}removeBetween(e,t){return new u(function e(t,n,r){let{index:i,offset:s}=t.findIndex(n),o=t.maybeChild(i),{index:l,offset:a}=t.findIndex(r);if(s==n||o.isText){if(a!=r&&!t.child(l).isText)throw RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(i!=l)throw RangeError("Removing non-flat range");return t.replaceChild(i,o.copy(e(o.content,n-s-1,r-s-1)))}(this.content,e+this.openStart,t+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(e,t){if(!t)return u.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new u(o.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new u(e,n,r)}}function d(e,t){if(!t.type.compatibleContent(e.type))throw new p("Cannot join "+t.type.name+" onto "+e.type.name)}function f(e,t,n){let r=e.node(n);return d(r,t.node(n)),r}function m(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 g(e,t,n,r){let i=(t||e).node(n),s=0,o=t?t.index(n):i.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(m(e.nodeAfter,r),s++));for(let e=s;e<o;e++)m(i.child(e),r);t&&t.depth==n&&t.textOffset&&m(t.nodeBefore,r)}function k(e,t){if(!e.type.validContent(t))throw new p("Invalid content for node "+e.type.name);return e.copy(t)}function y(e,t,n){let r=[];return g(null,e,n,r),e.depth>n&&m(k(f(e,t,n+1),y(e,t,n+1)),r),g(t,null,n,r),new o(r)}u.empty=new u(o.empty,0,0);class x{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?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[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].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):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-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(0==e.content.size)return c.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 s=0;s<i.length;s++)!1!==i[s].type.spec.inclusive||r&&i[s].isInSet(r.marks)||(i=i[s--].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++)!1!==n[i].type.spec.inclusive||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 S(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(e,t){if(!(t>=0&&t<=e.content.size))throw RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:s}=t.content.findIndex(i),o=i-s;if(n.push(t,e,r+s),!o||(t=t.child(e)).isText)break;
60i=o-1,r+=s+1}return new x(t,n,i)}static resolveCached(e,t){let n=v.get(e);if(n)for(let e=0;e<n.elts.length;e++){let r=n.elts[e];if(r.pos==t)return r}else v.set(e,n=new w);let r=n.elts[n.i]=x.resolve(e,t);return n.i=(n.i+1)%b,r}}class w{constructor(){this.elts=[],this.i=0}}let b=12,v=new WeakMap;class S{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)}}let T=Object.create(null);class M{constructor(e,t,n,r=c.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||o.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&&h(this.attrs,t||e.defaultAttrs||T)&&c.sameSet(this.marks,n||c.none)}copy(e=null){return e==this.content?this:new M(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new M(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return u.empty;let r=this.resolve(e),i=this.resolve(t),s=n?0:r.sharedDepth(t),o=r.start(s);return new u(r.node(s).content.cut(r.pos-o,i.pos-o),r.depth-s,i.depth-s)}replace(e,t,n){var r=this.resolve(e),i=this.resolve(t);if(n.openStart>r.depth)throw new p("Inserted content deeper than insertion position");if(r.depth-n.openStart!=i.depth-n.openEnd)throw new p("Inconsistent open depths");return function e(t,n,r,i){let s=t.index(i),l=t.node(i);if(s==n.index(i)&&i<t.depth-r.openStart){let o=e(t,n,r,i+1);return l.copy(l.content.replaceChild(s,o))}if(!r.content.size)return k(l,y(t,n,i));if(r.openStart||r.openEnd||t.depth!=i||n.depth!=i){let{start:e,end:s}=function(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(o.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(r,t);return k(l,function e(t,n,r,i,s){let l=t.depth>s&&f(t,n,s+1),a=i.depth>s&&f(r,i,s+1),h=[];return g(null,t,s,h),l&&a&&n.index(s)==r.index(s)?(d(l,a),m(k(l,e(t,n,r,i,s+1)),h)):(l&&m(k(l,y(t,n,s+1)),h),g(n,r,s,h),a&&m(k(a,y(r,i,s+1)),h)),g(i,null,s,h),new o(h)}(t,e,s,n,i))}{let e=t.parent,i=e.content;return k(e,i.cut(0,t.parentOffset).append(r.content).append(i.cut(n.parentOffset)))}}(r,i,n,0)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(!(t=t.maybeChild(n)))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(0==e)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 x.resolveCached(this,e)}resolveNoCache(e){return x.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}
60toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),A(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=o.empty,r=0,i=n.childCount){let s=this.contentMatchAt(e).matchFragment(n,r,i),l=s&&s.matchFragment(this.content,t);if(!l||!l.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),s=i&&i.matchFragment(this.content,t);return!!s&&s.validEnd}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),this.type.checkAttrs(this.attrs);let e=c.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!c.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){let n;if(!t)throw RangeError("Invalid input for Node.fromJSON");if(t.marks){if(!Array.isArray(t.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=o.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}}M.prototype.text=void 0;class C extends M{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):A(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(e){return e==this.marks?this:new C(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new C(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&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 A(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class E{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){var n;let r,i=new R(e,t);if(null==i.next)return E.empty;let s=function e(t){let n=[];do n.push(function(t){let n=[];do n.push(function(t){let n=function(t){if(t.eat("(")){let n=e(t);return t.eat(")")||t.err("Missing closing paren"),n}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=(function(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 0==i.length&&e.err("No node type or group '"+t+"' found"),i})(t,t.next).map(e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}}(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=function(e,t){let n=I(e),r=n;return e.eat(",")&&(r="}"!=e.next?I(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}(t,n);else break;return n}(t));while(t.next&&")"!=t.next&&"|"!=t.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}(t));while(t.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}(i);i.next&&i.err("Unexpected trailing text");let o=(n=function(e){let t=[[]];return i(function e(t,s){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,s)),[]);if("seq"==t.type)for(let r=0;;r++){let o=e(t.exprs[r],s);if(r==t.exprs.length-1)return o;i(o,s=n())}else if("star"==t.type){let o=n();return r(s,o),i(e(t.expr,o),o),[r(o)]}else if("plus"==t.type){let o=n();return i(e(t.expr,s),o),i(e(t.expr,o),o),[r(o)]}else if("opt"==t.type)return[r(s)].concat(e(t.expr,s));else if("range"==t.type){let o=s;for(let r=0;r<t.min;r++){let r=n();i(e(t.expr,o),r),o=r}if(-1==t.max)i(e(t.expr,o),o);else for(let s=t.min;s<t.max;s++){let s=n();r(o,s),i(e(t.expr,o),s),o=s}return[r(o)]}else if("name"==t.type)return[r(s,void 0,t.value)];else throw Error("Unknown expr type")}(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}
vendor: 5,540 bytes, line 60
60function i(e,t){e.forEach(e=>e.to=t)}}(s),r=Object.create(null),function e(t){let i=[];t.forEach(e=>{n[e].forEach(({term:e,to:t})=>{let r;if(e){for(let t=0;t<i.length;t++)i[t][0]==e&&(r=i[t][1]);N(n,t).forEach(t=>{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)})}})});let s=r[t.join(",")]=new E(t.indexOf(n.length-1)>-1);for(let t=0;t<i.length;t++){let n=i[t][1].sort(O);s.next.push({type:i[t][0],next:r[n.join(",")]||e(n)})}return s}(N(n,0)));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,s=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];s.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),-1==r.indexOf(o)&&r.push(o)}i&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,i),o}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 0!=this.next.length&&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];return function i(s,l){let a=s.matchFragment(e,n);if(a&&(!t||a.validEnd))return o.from(l.map(e=>e.createAndFill()));for(let e=0;e<s.next.length;e++){let{type:t,next:n}=s.next[e];if(!(t.isText||t.hasRequiredAttrs())&&-1==r.indexOf(n)){r.push(n);let e=i(n,l.concat(t));if(e)return e}}return null}(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:s,next:o}=i.next[e];s.isLeaf||s.hasRequiredAttrs()||s.name in t||r.type&&!o.validEnd||(n.push({match:s.contentMatch,type:s,via:r}),t[s.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=[];return!function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(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("\n")}}E.empty=new E(!0);class R{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 I(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function O(e,t){return t-e}function N(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:s}=i[e];r||-1!=n.indexOf(s)||t(s)}}(t),n.sort(O)}function $(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 z(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function L(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])}function P(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new D(e,r,t[r]);return n}class F{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=P(e,n.attrs),this.defaultAttrs=$(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==E.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:z(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new M(this,this.computeAttrs(e),o.from(t),c.setFrom(n))}createChecked(e=null,t,n){return t=o.from(t),this.checkContent(t),new M(this,this.computeAttrs(e),t,c.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=o.from(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(o.empty,!0);return i?new M(this,e,t.append(i),c.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);
60if(!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){L(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){let t;if(null==this.markSet)return e;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:c.none:e}static compile(e,t){let n=Object.create(null);e.forEach((e,r)=>n[e]=new F(e,t,r));let r=t.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw RangeError("The text node type should not have attributes");return n}}class D{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let i=null===n?"null":typeof n;if(0>r.indexOf(i))throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class B{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=P(e,r.attrs),this.excluded=null;let i=$(this.attrs);this.instance=i?new c(this,i):null}create(e=null){return!e&&this.instance?this.instance:new c(this,z(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,i)=>n[e]=new B(e,r++,t,i)),n}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]}checkAttrs(e){L(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}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=r.from(e.nodes),t.marks=r.from(e.marks||{}),this.nodes=F.compile(this.spec.nodes,this),this.marks=B.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]=E.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?j(this,i.split(" ")):""!=i&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:j(this,n.split(" "))}this.nodeFromJSON=e=>M.fromJSON(this,e),this.markFromJSON=e=>c.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else if(e instanceof F){if(e.schema!=this)throw RangeError("Node type from different schema used ("+e.name+")")}else throw RangeError("Invalid node type: "+e);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new C(n,n.defaultAttrs,e,c.setFrom(t))}mark(e,t){return"string"==typeof e&&(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 j(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],s=e.marks[i],o=s;if(s)n.push(s);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}class J{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];
60t.forEach(e=>{if(null!=e.tag)this.tags.push(e);else if(null!=e.style){let t=/[^=]*/.exec(e.style)[0];0>n.indexOf(t)&&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 W(this,t,!1);return n.addAll(e,c.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new W(this,t,!0);return n.addAll(e,c.none,t.from,t.to),u.maxOpen(n.finish())}matchTag(e,t,n){for(let s=n?this.tags.indexOf(n)+1:0;s<this.tags.length;s++){var r,i;let n=this.tags[s];if(r=e,i=n.tag,(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,i)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)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],s=r.style;if(0==s.indexOf(e)&&(!r.context||n.matchesContext(r.context))&&(!(s.length>e.length)||61==s.charCodeAt(e.length)&&s.slice(e.length+1)==t)){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?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=Z(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=Z(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new J(e,J.schemaRules(e)))}}let H={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},K={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},q={ol:!0,ul:!0};function V(e,t,n){return null!=t?!!t|2*("full"===t):e&&"pre"==e.whitespace?3:-5&n}class U{constructor(e,t,n,r,i,s){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=s,this.content=[],this.activeMarks=c.none,this.match=i||(4&s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(o.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(!(1&this.options)){let e=this.content[this.content.length-1],t;e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))&&(e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=e.withText(e.text.slice(0,e.text.length-t[0].length)))}let t=o.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(o.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&&!H.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class W{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,s=V(null,t.preserveWhitespace,0)|4*!!n;i=r?new U(r.type,r.attrs,c.none,!0,t.topMatch||r.type.contentMatch,s):n?new U(null,null,c.none,!0,null,s):new U(e.schema.topNodeType,null,c.none,!0,null,s),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:s}=this.parser;if("full"===i||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i)if("full"===i)n=n.replace(/\r\n?/g,"\n");else if(s.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(s.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(s.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(s.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else 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&&"BR"==i.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(s.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),o;q.hasOwnProperty(s)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&q.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));t:if(l?l.ignore:K.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let n,r=this.needsBlock;if(H.hasOwnProperty(s))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 t}let o=l&&l.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,l,n,!1===l.consuming?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||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)),!1===n.consuming)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,s;
vendor: 4,107 bytes, line 60
60if(t.node)if((s=this.parser.schema.nodes[t.node]).isLeaf)this.insertNode(s.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(s,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(s&&s.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;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?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 s=n?e.childNodes[n]:e.firstChild,o=null==r?null:e.childNodes[r];s!=o;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,s=0;t>=0;t--){let o=this.nodes[t],l=o.findWrapping(e);if(l&&(!r||r.length>l.length+s)&&(r=l,i=o,!l.length))break;if(o.solid){if(n)break;s+=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=t.match.matchType(e.type));let n=c.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):G(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&&(i=this.enterInner(e,t,n,!0,r)),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let o=V(e,i,s.options);4&s.options&&0==s.content.length&&(o|=4);let l=c.none;return n=n.filter(t=>(s.type?!s.type.allowsMarkType(t.type):!G(t.type,e))||(l=t.addToSet(l),!1)),this.nodes.push(new U(e,t,l,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|=1);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++)null==this.find[t].pos&&1==e.nodeType&&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++)null==this.find[r].pos&&1==e.nodeType&&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,s=(e,o)=>{for(;e>=0;e--){let l=t[e];if(""==l){if(e==t.length-1||0==e)continue;for(;o>=i;o--)if(s(e-1,o))return!0;return!1}{let e=o>0||0==o&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=l&&!e.isInGroup(l))return!1;o--}}return!0};return s(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];
60if(t.isTextblock&&t.defaultAttrs)return t}}}function Z(e){let t={};for(let n in e)t[n]=e[n];return t}function G(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let s=[],o=e=>{s.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||0>s.indexOf(i)&&o(i))return!0}};if(o(i.contentMatch))return!0}}class X{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Q(t).createDocumentFragment());let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,s=0;for(;n<i.length&&s<e.marks.length;){let t=e.marks[s];if(!this.marks[t.type.name]){s++;continue}if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,s++}for(;n<i.length;)r=i.pop()[1];for(;s<e.marks.length;){let n=e.marks[s++],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 Q(t).createTextNode(e.text);let{dom:n,contentDOM:r}=et(Q(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&&et(Q(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return"string"==typeof t?{dom:e.createTextNode(t)}:et(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new X(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Y(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return Y(e.marks)}}function Y(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Q(e){return e.document||window.document}let ee=new WeakMap;function et(e,t,n,r){let i,s,o;if(1==t.nodeType)return{dom:t};if(t.dom&&1==t.dom.nodeType)return t;let l=t[0],a;if("string"!=typeof l)throw RangeError("Invalid array passed to renderSpec");if(r&&(void 0===(s=ee.get(r))&&ee.set(r,(o=null,!function e(t){if(t&&"object"==typeof t)if(Array.isArray(t))if("string"==typeof t[0])o||(o=[]),o.push(t);else for(let n=0;n<t.length;n++)e(t[n]);else for(let n in t)e(t[n])}(r),s=o)),a=s)&&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 h=l.indexOf(" ");h>0&&(n=l.slice(0,h),l=l.slice(h+1));let c=n?e.createElementNS(n,l):e.createElement(l),p=t[1],u=1;if(p&&"object"==typeof p&&null==p.nodeType&&!Array.isArray(p)){for(let e in u=2,p)if(null!=p[e]){let t=e.indexOf(" ");t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),p[e]):"style"==e&&c.style?c.style.cssText=p[e]:c.setAttribute(e,p[e])}}for(let s=u;s<t.length;s++){let o=t[s];if(0===o){if(s<t.length-1||s>u)throw RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}if("string"==typeof o)c.appendChild(e.createTextNode(o));else{let{dom:t,contentDOM:s}=et(e,o,n,r);if(c.appendChild(t),s){if(i)throw RangeError("Multiple content holes");i=s}}}return{dom:c,contentDOM:i}}},29712:(e,t,n)=>{n.d(t,{$f:()=>I,G2:()=>x,I$:()=>T,Im:()=>N,Qv:()=>a,Sd:()=>k,Z1:()=>M,_G:()=>c,_e:()=>d,bh:()=>w,eB:()=>h,eT:()=>g,ec:()=>O,hy:()=>A,iz:()=>C,pC:()=>v,yY:()=>b,y_:()=>$});var r=n(71930),i=n(28745),s=n(51087);let o=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function l(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("backward",e):!(n.parentOffset>0))?n:null}let a=(e,t,n)=>{let o=l(e,n);if(!o)return!1;let a=f(o);if(!a){let n=o.blockRange(),i=n&&(0,r.jP)(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let h=a.nodeBefore;if(E(e,a,t,-1))return!0;if(0==o.parent.content.size&&(u(h,"end")||s.nh.isSelectable(h)))for(let n=o.depth;;n--){let l=(0,r.$L)(e.doc,o.before(n),o.after(n),i.Ji.empty);if(l&&l.slice.size<l.to-l.from){if(t){let n=e.tr.step(l);n.setSelection(u(h,"end")?s.LN.findFrom(n.doc.resolve(n.mapping.map(a.pos,-1)),-1):s.nh.create(n.doc,a.pos-h.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||o.node(n-1).childCount>1)break}return!!h.isAtom&&a.depth==o.depth-1&&(t&&t(e.tr.delete(a.pos-h.nodeSize,a.pos).scrollIntoView()),!0)},h=(e,t,n)=>{let r=l(e,n);if(!r)return!1;let i=f(r);return!!i&&p(e,i,t)},c=(e,t,n)=>{let r=m(e,n);if(!r)return!1;let i=y(r);return!!i&&p(e,i,t)};function p(e,t,n){let o=t.nodeBefore,l=t.pos-1;for(;!o.isTextblock;l--){if(o.type.spec.isolating)return!1;let e=o.lastChild;if(!e)return!1;o=e}let a=t.nodeAfter,h=t.pos+1;for(;!a.isTextblock;h++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let c=(0,r.$L)(e.doc,l,h,i.Ji.empty);if(!c||c.from!=l||c instanceof r.Ln&&c.slice.size>=h-l)return!1;if(n){let t=e.tr.step(c);t.setSelection(s.U3.create(t.doc,l)),n(t.scrollIntoView())}return!0}function u(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;
60if(n&&1!=r.childCount)break}return!1}let d=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=f(r)}let l=o&&o.nodeBefore;return!!l&&!!s.nh.isSelectable(l)&&(t&&t(e.tr.setSelection(s.nh.create(e.doc,o.pos-l.nodeSize)).scrollIntoView()),!0)};function f(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 m(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("forward",e):!(n.parentOffset<n.parent.content.size))?n:null}let g=(e,t,n)=>{let o=m(e,n);if(!o)return!1;let l=y(o);if(!l)return!1;let a=l.nodeAfter;if(E(e,l,t,1))return!0;if(0==o.parent.content.size&&(u(a,"start")||s.nh.isSelectable(a))){let n=(0,r.$L)(e.doc,o.before(),o.after(),i.Ji.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(u(a,"start")?s.LN.findFrom(r.doc.resolve(r.mapping.map(l.pos)),1):s.nh.create(r.doc,r.mapping.map(l.pos))),t(r.scrollIntoView())}return!0}}return!!a.isAtom&&l.depth==o.depth-1&&(t&&t(e.tr.delete(l.pos,l.pos+a.nodeSize).scrollIntoView()),!0)},k=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=y(r)}let l=o&&o.nodeAfter;return!!l&&!!s.nh.isSelectable(l)&&(t&&t(e.tr.setSelection(s.nh.create(e.doc,o.pos)).scrollIntoView()),!0)};function y(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}let x=(e,t)=>{let n=e.selection,i=n instanceof s.nh,o;if(i){if(n.node.isTextblock||!(0,r.n9)(e.doc,n.from))return!1;o=n.from}else if(null==(o=(0,r.N0)(e.doc,n.from,-1)))return!1;if(t){let n=e.tr.join(o);i&&n.setSelection(s.nh.create(n.doc,o-e.doc.resolve(o).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},w=(e,t)=>{let n=e.selection,i;if(n instanceof s.nh){if(n.node.isTextblock||!(0,r.n9)(e.doc,n.to))return!1;i=n.to}else if(null==(i=(0,r.N0)(e.doc,n.to,1)))return!1;return t&&t(e.tr.join(i).scrollIntoView()),!0},b=(e,t)=>{let{$from:n,$to:i}=e.selection,s=n.blockRange(i),o=s&&(0,r.jP)(s);return null!=o&&(t&&t(e.tr.lift(s,o).scrollIntoView()),!0)},v=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!!n.parent.type.spec.code&&!!n.sameParent(r)&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function S(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let T=(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),o=n.indexAfter(-1),l=S(i.contentMatchAt(o));if(!l||!i.canReplaceWith(o,o,l))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,l.createAndFill());i.setSelection(s.LN.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},M=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof s.i5||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=S(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=e.tr.insert(n,o.createAndFill());l.setSelection(s.U3.create(l.doc,n+1)),t(l.scrollIntoView())}return!0},C=(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 i=n.before();if((0,r.zy)(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let i=n.blockRange(),s=i&&(0,r.jP)(i);return null!=s&&(t&&t(e.tr.lift(i,s).scrollIntoView()),!0)},A=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return 0!=o&&(i=n.before(o),t&&t(e.tr.setSelection(s.nh.create(e.doc,i))),!0)};function E(e,t,n,o){let l,a,h,c=t.nodeBefore,p=t.nodeAfter,d,f,m=c.type.spec.isolating||p.type.spec.isolating;if(!m&&(l=t.nodeBefore,a=t.nodeAfter,h=t.index(),l&&a&&l.type.compatibleContent(a.type)&&(!l.content.size&&t.parent.canReplace(h-1,h)?(n&&n(e.tr.delete(t.pos-l.nodeSize,t.pos).scrollIntoView()),!0):!!t.parent.canReplace(h,h+1)&&!!(a.isTextblock||(0,r.n9)(e.doc,t.pos))&&(n&&n(e.tr.join(t.pos).scrollIntoView()),!0))))return!0;let g=!m&&t.parent.canReplace(t.index(),t.index()+1);if(g&&(d=(f=c.contentMatchAt(c.childCount)).findWrapping(p.type))&&f.matchType(d[0]||p.type).validEnd){if(n){let s=t.pos+p.nodeSize,o=i.FK.empty;for(let e=d.length-1;e>=0;e--)o=i.FK.from(d[e].create(null,o));o=i.FK.from(c.copy(o));let l=e.tr.step(new r.Wg(t.pos-1,s,t.pos,s,new i.Ji(o,1,0),d.length,!0)),a=l.doc.resolve(s+2*d.length);a.nodeAfter&&a.nodeAfter.type==c.type&&(0,r.n9)(l.doc,a.pos)&&l.join(a.pos),n(l.scrollIntoView())}return!0}let k=p.type.spec.isolating||o>0&&m?null:s.LN.findFrom(t,1),y=k&&k.$from.blockRange(k.$to),x=y&&(0,r.jP)(y);if(null!=x&&x>=t.depth)return n&&n(e.tr.lift(y,x).scrollIntoView()),!0;if(g&&u(p,"start",!0)&&u(c,"end")){let s=c,o=[];for(;o.push(s),!s.isTextblock;)s=s.lastChild;let l=p,a=1;for(;!l.isTextblock;l=l.firstChild)a++;if(s.canReplace(s.childCount,s.childCount,l.content)){if(n){let s=i.FK.empty;for(let e=o.length-1;e>=0;e--)s=i.FK.from(o[e].copy(s));n(e.tr.step(new r.Wg(t.pos-o.length,t.pos+p.nodeSize,t.pos+a,t.pos+p.nodeSize-a,new i.Ji(s,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function R(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(s.U3.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}let I=R(-1),O=R(1);function N(e,t=null){return function(n,i){let{$from:s,$to:o}=n.selection,l=s.blockRange(o),a=l&&(0,r.oM)(l,e,t);return!!a&&(i&&i(n.tr.wrap(l,a).scrollIntoView()),!0)}}function $(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:s},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(s,o,(r,s)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(s),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:s},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(s,o,e,t)}r(i.scrollIntoView())}return!0}}function z(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let L=z(o,a,d),P=z(o,g,k),F={Enter:z(v,M,C,(e,t)=>{if(e.selection instanceof s.nh&&e.selection.node.isBlock){let{$from:n}=e.selection;return!!n.parentOffset&&!!(0,r.zy)(e.doc,n.pos)&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0)}if(!e.selection.$from.depth)return!1;let n=e.tr;!e.selection.empty&&(e.selection instanceof s.U3||e.selection instanceof s.i5)&&n.deleteSelection();let{$from:i}=n.selection,o=n.steps.length,l=[],a,h,c=!1,p=!1;for(let e=i.depth;;e--){if(i.node(e).isBlock){let t;c=i.end(e)==i.pos+(i.depth-e),p=i.start(e)==i.pos-(i.depth-e),h=S(i.node(e-1).contentMatchAt(i.indexAfter(e-1)));l.unshift(t||(c&&h?{type:h}:null)),a=e;break}if(1==e)return!1;l.unshift(null)}let u=i.pos,d=(0,r.zy)(n.doc,u,l.length,l);if(d||(l[0]=h?{type:h}:null,d=(0,r.zy)(n.doc,u,l.length,l)),!d)return!1;if(n.split(u,l.length,l),!c&&p&&i.node(a).type!=h){let e=n.mapping.slice(o),t=e.map(i.before(a)),r=n.doc.resolve(t);h&&i.node(a-1).canReplaceWith(r.index(),r.index()+1,h)&&n.setNodeMarkup(e.map(i.before(a)),h)}return t&&t(n.scrollIntoView()),!0}),"Mod-Enter":T,Backspace:L,"Mod-Backspace":L,"Shift-Backspace":L,Delete:P,"Mod-Delete":P,"Mod-a":(e,t)=>
60(t&&t(e.tr.setSelection(new s.i5(e.doc))),!0)},D={"Ctrl-h":F.Backspace,"Alt-Backspace":F["Mod-Backspace"],"Ctrl-d":F.Delete,"Ctrl-Alt-Backspace":F["Mod-Delete"],"Alt-Delete":F["Mod-Delete"],"Alt-d":F["Mod-Delete"],"Ctrl-a":I,"Ctrl-e":O};for(let e in F)D[e]=F[e];"u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&os.platform&&os.platform()},32671:(e,t,n)=>{var r=n(37343),i=n(12445),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=i.useSyncExternalStore,l=r.useRef,a=r.useEffect,h=r.useMemo,c=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var p=l(null);if(null===p.current){var u={hasValue:!1,value:null};p.current=u}else u=p.current;var d=o(e,(p=h(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),void 0!==i&&u.hasValue){var t=u.value;if(i(t,e))return l=t}return l=e}if(t=l,s(o,e))return t;var n=r(e);return void 0!==i&&i(t,n)?(o=e,t):(o=e,l=n)}var o,l,a=!1,h=void 0===n?null:n;return[function(){return e(t())},null===h?void 0:function(){return e(h())}]},[t,n,r,i]))[0],p[1]);return a(function(){u.hasValue=!0,u.value=d},[d]),c(d),d}},51087:(e,t,n)=>{n.d(t,{$t:()=>S,LN:()=>o,U3:()=>c,hs:()=>A,i5:()=>f,k_:()=>T,nh:()=>u});var r=n(28745),i=n(71930);let s=Object.create(null);class o{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new l(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=r.Ji.empty){let n=t.content.lastChild,i=null;for(let e=0;e<t.openEnd;e++)i=n,n=n.lastChild;let s=e.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:a,$to:h}=o[l],c=e.mapping.slice(s);e.replaceRange(c.map(a.pos),c.map(h.pos),l?r.Ji.empty:t),0==l&&k(e,s,(n?n.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:s,$to:o}=r[i],l=e.mapping.slice(n),a=l.map(s.pos),h=l.map(o.pos);i?e.deleteRange(a,h):(e.replaceRangeWith(a,h,t),k(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new c(e):g(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?g(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):g(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}
60static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new f(e.node(0))}static atStart(e){return g(e,e,0,0,1)||new f(e)}static atEnd(e){return g(e,e,e.content.size,e.childCount,-1)||new f(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError("Invalid input for Selection.fromJSON");let n=s[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in s)throw RangeError("Duplicate use of selection JSON ID "+e);return s[e]=t,t.prototype.jsonID=e,t}getBookmark(){return c.between(this.$anchor,this.$head).getBookmark()}}o.prototype.visible=!0;class l{constructor(e,t){this.$from=e,this.$to=t}}let a=!1;function h(e){a||e.parent.inlineContent||(a=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class c extends o{constructor(e,t=e){h(e),h(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return o.near(n);let r=e.resolve(t.map(this.anchor));return new c(r.parent.inlineContent?r:n,n)}replace(e,t=r.Ji.empty){if(super.replace(e,t),t==r.Ji.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof c&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new p(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new c(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if((!n||r)&&(n=r>=0?1:-1),!t.parent.inlineContent){let e=o.findFrom(t,n,!0)||o.findFrom(t,-n,!0);if(!e)return o.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r?e=t:(e=(o.findFrom(e,-n,!0)||o.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0&&(e=t)),new c(e,t)}}o.jsonID("text",c);class p{constructor(e,t){this.anchor=e,this.head=t}map(e){return new p(e.map(this.anchor),e.map(this.head))}resolve(e){return c.between(e.resolve(this.anchor),e.resolve(this.head))}}class u extends o{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?o.near(i):new u(i)}content(){return new r.Ji(r.FK.from(this.node),0,0)}eq(e){return e instanceof u&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new d(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new u(e.resolve(t.anchor))}static create(e,t){return new u(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}u.prototype.visible=!1,o.jsonID("node",u);class d{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new p(n,n):new d(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&u.isSelectable(n)?new u(t):o.near(t)}}class f extends o{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=r.Ji.empty){if(t==r.Ji.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(e){return new f(e)}map(e){return new f(e)}eq(e){return e instanceof f}getBookmark(){return m}}o.jsonID("all",f);let m={map(){return this},resolve:e=>new f(e)};function g(e,t,n,r,i,s=!1){if(t.inlineContent)return c.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){if(!s&&u.isSelectable(r))return u.create(e,n-(i<0?r.nodeSize:0))}else{let t=g(e,r,n+i,i<0?r.childCount:0,i,s);if(t)return t}n+=r.nodeSize*i}return null}function k(e,t,n){let r,s=e.steps.length-1;if(s<t)return;let l=e.steps[s];(l instanceof i.Ln||l instanceof i.Wg)&&(e.mapping.maps[s].forEach((e,t,n,i)=>{null==r&&(r=i)}),e.setSelection(o.near(e.doc.resolve(r),n)))}class y extends i.dL{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=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return r.CU.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(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,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)||r.CU.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(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["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function x(e,t){return t&&e?e.bind(t):e}class w{constructor(e,t,n){this.name=e,this.init=x(t.init,n),this.apply=x(t.apply,n)}}let b=[new w("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new w("selection",{init:(e,t)=>
60e.selection||o.atStart(t.doc),apply:e=>e.selection}),new w("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new w("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class v{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=b.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 w(e.key,e.spec.state,e))})}}class S{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 s=0;s<this.config.plugins.length;s++){let o=this.config.plugins[s];if(o.spec.appendTransaction){let l=r?r[s].n:0,a=r?r[s].state:this,h=l<t.length&&o.spec.appendTransaction.call(o,l?t.slice(l):t,a,n);if(h&&n.filterTransaction(h,s)){if(h.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<s?{state:n,n:t.length}:{state:this,n:0})}t.push(h),n=n.applyInner(h),i=!0}r&&(r[s]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let t=new S(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new y(this)}static create(e){let t=new v(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new S(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new v(this.schema,e.plugins),n=t.fields,r=new S(t);for(let t=0;t<n.length;t++){let i=n[t].name;r[i]=this.hasOwnProperty(i)?this[i]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)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(e,t,n){if(!t)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");let i=new v(e.schema,e.plugins),s=new S(i);return i.fields.forEach(i=>{if("doc"==i.name)s.doc=r.bP.fromJSON(e.schema,t.doc);else if("selection"==i.name)s.selection=o.fromJSON(s.doc,t.selection);else if("storedMarks"==i.name)t.storedMarks&&(s.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let r in n){let o=n[r],l=o.spec.state;if(o.key==i.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(t,r)){s[i.name]=l.fromJSON.call(o,e,t[r],s);return}}s[i.name]=i.init(e,s)}}),s}}class T{constructor(e){this.spec=e,this.props={},e.props&&function e(t,n,r){for(let i in t){let s=t[i];s instanceof Function?s=s.bind(n):"handleDOMEvents"==i&&(s=e(s,n,{})),r[i]=s}return r}(e.props,this,this.props),this.key=e.key?e.key.key:C("plugin")}getState(e){return e[this.key]}}let M=Object.create(null);function C(e){return e in M?e+"$"+ ++M[e]:(M[e]=0,e+"$")}class A{constructor(e="key"){this.key=C(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}},68985:(e,t,n)=>{n.d(t,{$B:()=>l,Sd:()=>s,T2:()=>o});var r=n(71930),i=n(28745);function s(e,t=null){return function(n,s){let{$from:o,$to:l}=n.selection,a=o.blockRange(l);if(!a)return!1;let h=s?n.tr:null;return!!function(e,t,n,s=null){let o=!1,l=t,a=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&0==t.startIndex){if(0==t.$from.index(t.depth-1))return!1;let e=a.resolve(t.start-2);
60l=new i.u$(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new i.u$(t.$from,a.resolve(t.$to.end(t.depth)),t.depth)),o=!0}let h=(0,r.oM)(l,n,s,t);return!!h&&(e&&function(e,t,n,s,o){let l=i.FK.empty;for(let e=n.length-1;e>=0;e--)l=i.FK.from(n[e].type.create(n[e].attrs,l));e.step(new r.Wg(t.start-2*!!s,t.end,t.start,t.end,new i.Ji(l,0,0),n.length,!0));let a=0;for(let e=0;e<n.length;e++)n[e].type==o&&(a=e+1);let h=n.length-a,c=t.start+n.length-2*!!s,p=t.parent;for(let n=t.startIndex,i=t.endIndex,s=!0;n<i;n++,s=!1)!s&&(0,r.zy)(e.doc,c,h)&&(e.split(c,h),c+=2*h),c+=p.child(n).nodeSize}(e,t,h,o,n),!0)}(h,a,e,t)&&(s&&s(h.scrollIntoView()),!0)}}function o(e){return function(t,n){let{$from:s,$to:o}=t.selection,l=s.blockRange(o,t=>t.childCount>0&&t.firstChild.type==e);return!!l&&(!n||(s.node(l.depth-1).type==e?function(e,t,n,s){let o=e.tr,l=s.end,a=s.$to.end(s.depth);l<a&&(o.step(new r.Wg(l-1,a,l,a,new i.Ji(i.FK.from(n.create(null,s.parent.copy())),1,0),1,!0)),s=new i.u$(o.doc.resolve(s.$from.pos),o.doc.resolve(a),s.depth));let h=(0,r.jP)(s);if(null==h)return!1;o.lift(s,h);let c=o.doc.resolve(o.mapping.map(l,-1)-1);return(0,r.n9)(o.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&o.join(c.pos),t(o.scrollIntoView()),!0}(t,n,e,l):function(e,t,n){let s=e.tr,o=n.parent;for(let e=n.end,t=n.endIndex-1,r=n.startIndex;t>r;t--)e-=o.child(t).nodeSize,s.delete(e-1,e+1);let l=s.doc.resolve(n.start),a=l.nodeAfter;if(s.mapping.map(n.end)!=n.start+l.nodeAfter.nodeSize)return!1;
60let h=0==n.startIndex,c=n.endIndex==o.childCount,p=l.node(-1),u=l.index(-1);if(!p.canReplace(u+ +!h,u+1,a.content.append(c?i.FK.empty:i.FK.from(o))))return!1;let d=l.pos,f=d+a.nodeSize;return s.step(new r.Wg(d-!!h,f+ +!!c,d+1,f-1,new i.Ji((h?i.FK.empty:i.FK.from(o.copy(i.FK.empty))).append(c?i.FK.empty:i.FK.from(o.copy(i.FK.empty))),+!h,+!c),+!h)),t(s.scrollIntoView()),!0}(t,n,l)))}}function l(e){return function(t,n){let{$from:s,$to:o}=t.selection,l=s.blockRange(o,t=>t.childCount>0&&t.firstChild.type==e);if(!l)return!1;let a=l.startIndex;if(0==a)return!1;let h=l.parent,c=h.child(a-1);if(c.type!=e)return!1;if(n){let s=c.lastChild&&c.lastChild.type==h.type,o=i.FK.from(s?e.create():null),a=new i.Ji(i.FK.from(e.create(null,i.FK.from(h.type.create(null,o)))),s?3:1,0),p=l.start,u=l.end;n(t.tr.step(new r.Wg(p-(s?3:1),u,p,u,a,1,!0)).scrollIntoView())}return!0}}},71930:(e,t,n)=>{n.d(t,{$L:()=>R,Ln:()=>m,N0:()=>A,Um:()=>E,Wg:()=>g,X9:()=>o,Ys:()=>u,dL:()=>_,jP:()=>x,n9:()=>M,oM:()=>w,zy:()=>T});var r=n(28745);class i{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class s{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&s.empty)return s.empty}recover(e){let t=0,n=65535&e;if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+(e-(65535&e))/65536}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,s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let h=this.ranges[l+s],c=this.ranges[l+o],p=a+h;if(e<=p){let s=h?e==a?-1:e==p?1:t:t,o=a+r+(s<0?0:c);if(n)return o;let u=e==(t<0?a:p)?null:l/3+(e-a)*65536,d=e==a?2:e==p?1:4;return(t<0?e!=a:e!=p)&&(d|=8),new i(o,d,u)}r+=c-h}return n?e+r:new i(e+r,0,null)}touches(e,t){let n=0,r=65535&t,i=this.inverted?2:1,s=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 l=this.ranges[t+i];if(e<=o+l&&t==3*r)return!0;n+=this.ranges[t+s]-l}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 s=this.ranges[r],o=s-(this.inverted?i:0),l=s+(this.inverted?0:i),a=this.ranges[r+t],h=this.ranges[r+n];e(o,o+a,l,l+h),i+=h-a}}invert(){return new s(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?s.empty:new s(e<0?[0,-e,0]:[0,0,e])}}s.empty=new s([]);class o{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(e=0,t=this.maps.length){return new o(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&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],null!=r&&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=[]),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(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new o;return e.appendMappingInverted(this),e}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(null!=i.recover){let t=this.getMirror(n);if(null!=t&&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 i(e,r,null)}}let l=Object.create(null);class a{getMap(){return s.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=l[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in l)throw RangeError("Duplicate use of step JSON ID "+e);return l[e]=t,t.prototype.jsonID=e,t}}class h{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new h(e,null)}static fail(e){return new h(null,e)}static fromReplace(e,t,n,i){try{return h.ok(e.replace(t,n,i))}catch(e){if(e instanceof r.vI)return h.fail(e.message);throw e}}}
vendor: 7,099 bytes, line 60
60function c(e,t,n){let i=[];for(let r=0;r<e.childCount;r++){let s=e.child(r);s.content.size&&(s=s.copy(c(s.content,t,s))),s.isInline&&(s=t(s,n,r)),i.push(s)}return r.FK.fromArray(i)}class p extends a{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),i=n.node(n.sharedDepth(this.to)),s=new r.Ji(c(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,i),t.openStart,t.openEnd);return h.fromReplace(e,this.from,this.to,s)}invert(){return new u(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new p(t.pos,n.pos,this.mark)}merge(e){return e instanceof p&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new p(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new p(t.from,t.to,e.markFromJSON(t.mark))}}a.jsonID("addMark",p);class u extends a{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 r.Ji(c(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return h.fromReplace(e,this.from,this.to,n)}invert(){return new p(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new u(t.pos,n.pos,this.mark)}merge(e){return e instanceof u&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new u(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new u(t.from,t.to,e.markFromJSON(t.mark))}}a.jsonID("removeMark",u);class d extends a{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return h.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return h.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new d(this.pos,t.marks[n]);return new d(this.pos,this.mark)}}return new f(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new d(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new d(t.pos,e.markFromJSON(t.mark))}}a.jsonID("addNodeMark",d);class f extends a{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return h.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return h.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new d(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new f(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new f(t.pos,e.markFromJSON(t.mark))}}a.jsonID("removeNodeMark",f);class m extends a{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&k(e,this.from,this.to)?h.fail("Structure replace would overwrite content"):h.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new s([this.from,this.to-this.from,this.slice.size])}invert(e){return new m(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),n=this.from==this.to&&m.MAP_BIAS<0?t:e.mapResult(this.from,1);return n.deletedAcross&&t.deletedAcross?null:new m(n.pos,Math.max(n.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof m)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart)if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;else{let t=this.slice.size+e.slice.size==0?r.Ji.empty:new r.Ji(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new m(e.from,this.to,t,this.structure)}{let t=this.slice.size+e.slice.size==0?r.Ji.empty:new r.Ji(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new m(this.from,this.to+(e.to-e.from),t,this.structure)}}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(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new m(t.from,t.to,r.Ji.fromJSON(e,t.slice),!!t.structure)}}m.MAP_BIAS=1,a.jsonID("replace",m);class g extends a{constructor(e,t,n,r,i,s,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=s,this.structure=o}apply(e){if(this.structure&&(k(e,this.from,this.gapFrom)||k(e,this.gapTo,this.to)))return h.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return h.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?h.fromReplace(e,this.from,this.to,n):h.fail("Content does not fit in gap")}getMap(){return new s([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new g(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new g(t.pos,n.pos,r,i,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(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new g(t.from,t.to,t.gapFrom,t.gapTo,r.Ji.fromJSON(e,t.slice),t.insert,!!t.structure)}}
60function k(e,t,n){let r=e.resolve(t),i=n-t,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let e=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function y(e,t,n,i=n.contentMatch,s=!0){let o=e.doc.nodeAt(t),l=[],a=t+1;for(let t=0;t<o.childCount;t++){let h=o.child(t),c=a+h.nodeSize,p=i.matchType(h.type);if(p){i=p;for(let t=0;t<h.marks.length;t++)n.allowsMarkType(h.marks[t].type)||e.step(new u(a,c,h.marks[t]));if(s&&h.isText&&"pre"!=n.whitespace){let e,t=/\r?\n|\r/g,i;for(;e=t.exec(h.text);)i||(i=new r.Ji(r.FK.from(n.schema.text(" ",n.allowedMarks(h.marks))),0,0)),l.push(new m(a+e.index,a+e.index+e[0].length,i))}}else l.push(new m(a,c,r.Ji.empty));a=c}if(!i.validEnd){let t=i.fillBefore(r.FK.empty,!0);e.replace(a,a,new r.Ji(t,0,0))}for(let t=l.length-1;t>=0;t--)e.step(l[t])}function x(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let s=e.$from.node(n),o=e.$from.index(n)+r,l=e.$to.indexAfter(n)-i;if(n<e.depth&&s.canReplace(o,l,t))return n;if(0==n||s.type.spec.isolating||!((0==o||s.canReplace(o,s.childCount))&&(l==s.childCount||s.canReplace(0,l))))break;o&&(r=1),l<s.childCount&&(i=1)}return null}function w(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,s=n.contentMatchAt(r).findWrapping(t);if(!s)return null;let o=s.length?s[0]:t;return n.canReplaceWith(r,i,o)?s:null}(e,t),s=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,s=n.child(r),o=t.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;l&&e<i;e++)l=l.matchType(n.child(e).type);return l&&l.validEnd?o:null}(r,t);return s?i.map(b).concat({type:t,attrs:n}).concat(s.map(b)):null}function b(e){return{type:e,attrs:null}}function v(e,t,n,r){t.forEach((i,s)=>{if(i.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(i.text);){let i=e.mapping.slice(r).map(n+1+s+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function S(e,t,n,r){t.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+s);e.replaceWith(i,i+1,t.type.schema.text("\n"))}})}function T(e,t,n=1,r){let i=e.resolve(t),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<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>s;e--,t--){let n=i.node(e),s=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(s,n.childCount),l=r&&r[t+1];l&&(o=o.replaceChild(0,l.type.create(l.attrs)));let a=r&&r[t]||n;if(!n.canReplace(s+1,n.childCount)||!a.type.validContent(o))return!1}let l=i.indexAfter(s),a=r&&r[0];return i.node(s).canReplaceWith(l,l,a?a.type:i.node(s+1).type)}function M(e,t){let n=e.resolve(t),r=n.index();return C(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function C(e,t){return!!(e&&t&&!e.isLeaf&&function(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 s=t.child(i),o=s.type==r?e.type.schema.nodes.text:s.type;if(!(n=n.matchType(o))||!e.type.allowsMarks(s.marks))return!1}return n.validEnd}(e,t))}function A(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,s,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(e+1),o++,s=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),s=r.node(e+1)),i&&!i.isTextblock&&C(i,s)&&r.node(e).canReplace(o,o+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function E(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<=(0==n.openStart&&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,s=r.index(t)+ +(n>0),o=r.node(t),l=!1;if(1==e)l=o.canReplace(s,s,i);else{let e=o.contentMatchAt(s).findWrapping(i.firstChild.type);l=e&&o.canReplaceWith(s,s,e[0])}if(l)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}
60function R(e,t,n=t,i=r.Ji.empty){if(t==n&&!i.size)return null;let s=e.resolve(t),o=e.resolve(n);return I(s,o,i)?new m(t,n,i):new O(s,o,i).fit()}function I(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}a.jsonID("replaceAround",g);class O{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=r.FK.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=r.FK.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,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let s=this.placed,o=n.depth,l=i.depth;for(;o&&l&&1==s.childCount;)s=s.firstChild.content,o--,l--;let a=new r.Ji(s,o,l);return e>-1?new g(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new m(n.pos,i.pos,a):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=1==t?e:this.unplaced.openStart;n>=0;n--){let e=null,i=(n?(e=z(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let s=this.depth;s>=0;s--){let{type:o,match:l}=this.frontier[s],a,h=null;if(1==t&&(i?l.matchType(i.type)||(h=l.fillBefore(r.FK.from(i),!1)):e&&o.compatibleContent(e.type)))return{sliceDepth:n,frontierDepth:s,parent:e,inject:h};if(2==t&&i&&(a=l.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:s,parent:e,wrap:a};if(e&&l.matchType(e.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=z(e,t);return!!i.childCount&&!i.firstChild.isLeaf&&(this.unplaced=new r.Ji(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=z(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new r.Ji(N(e,t-1,1),t-1,s?t-1:n)}else this.unplaced=new r.Ji(N(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let e=0;e<s.length;e++)this.openFrontierNode(s[e]);let o=this.unplaced,l=n?n.content:o.content,a=o.openStart-e,h=0,c=[],{match:p,type:u}=this.frontier[t];if(i){for(let e=0;e<i.childCount;e++)c.push(i.child(e));p=p.matchFragment(i)}let d=l.size+e-(o.content.size-o.openEnd);for(;h<l.childCount;){let e=l.child(h),t=p.matchType(e.type);if(!t)break;(++h>1||0==a||e.content.size)&&(p=t,c.push(function e(t,n,i){if(n<=0)return t;let s=t.content;return n>1&&(s=s.replaceChild(0,e(s.firstChild,n-1,1==s.childCount?i-1:0))),n>0&&(s=t.type.contentMatch.fillBefore(s).append(s),i<=0&&(s=s.append(t.type.contentMatch.matchFragment(s).fillBefore(r.FK.empty,!0)))),t.copy(s)}(e.mark(u.allowedMarks(e.marks)),1==h?a:0,h==l.childCount?d:-1)))}let f=h==l.childCount;f||(d=-1),this.placed=$(this.placed,t,r.FK.from(c)),this.frontier[t].match=p,f&&d<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=l;e<d;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=f?0==e?r.Ji.empty:new r.Ji(N(o.content,e-1,1),e-1,d<0?o.openEnd:e-1):new r.Ji(N(o.content,e,h),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!L(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){n: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)),s=L(e,t,r,n,i);if(s){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=L(e,n,r,t,!0);if(!i||i.childCount)continue n}return{depth:t,fit:s,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=$(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 i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=$(this.placed,this.depth,r.FK.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(r.FK.empty,!0);e.childCount&&(this.placed=$(this.placed,this.frontier.length,e))}}function N(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(N(e.firstChild.content,t-1,n)))}function $(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy($(e.lastChild.content,t-1,n)))}function z(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function L(e,t,n,r,i){let s=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let l=r.fillBefore(s.content,!0,o);return l&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,s.content,o)?l:null}function P(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}class F extends a{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 h.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 i=t.type.create(n,null,t.marks);return h.fromReplace(e,this.pos,this.pos+1,new r.Ji(r.FK.from(i),0,+!t.isLeaf))}getMap(){return s.empty}invert(e){return new F(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new F(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new F(t.pos,t.attr,t.value)}}a.jsonID("attr",F);class D extends a{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 h.ok(n)}getMap(){return s.empty}invert(e){return new D(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new D(t.attr,t.value)}}a.jsonID("docAttr",D);
60let B=class extends Error{};(B=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype),B.prototype.constructor=B,B.prototype.name="TransformError";class _{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new o}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new B(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,s)=>{e=Math.min(e,i),t=Math.max(t,s)})}return 1e9==e?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=r.Ji.empty){let i=R(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new r.Ji(r.FK.from(n),0,0))}delete(e,t){return this.replace(e,t,r.Ji.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return!function(e,t,n,i){if(!i.size)return e.deleteRange(t,n);let s=e.doc.resolve(t),o=e.doc.resolve(n);if(I(s,o,i))return e.step(new m(t,n,i));let l=P(s,o);0==l[l.length-1]&&l.pop();let a=-(s.depth+1);l.unshift(a);for(let e=s.depth,t=s.pos-1;e>0;e--,t--){let n=s.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;l.indexOf(e)>-1?a=e:s.before(e)==t&&l.splice(1,0,-e)}let h=l.indexOf(a),c=[],p=i.openStart;for(let e=i.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==i.openStart)break;e=n.content}for(let e=p-1;e>=0;e--){var u;let t=c[e],n=(u=t.type).spec.defining||u.spec.definingForContent;if(n&&!t.sameMarkup(s.node(Math.abs(a)-1)))p=e;else if(n||!t.type.isTextblock)break}for(let t=i.openStart;t>=0;t--){let a=(t+p+1)%(i.openStart+1),u=c[a];if(u)for(let t=0;t<l.length;t++){let c=l[(t+h)%l.length],p=!0;c<0&&(p=!1,c=-c);let d=s.node(c-1),f=s.index(c-1);if(d.canReplaceWith(f,f,u.type,u.marks))return e.replace(s.before(c),p?o.after(c):n,new r.Ji(function e(t,n,i,s,o){if(n<i){let r=t.firstChild;t=t.replaceChild(0,r.copy(e(r.content,n+1,i,s,r)))}if(n>s){let e=o.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(r.FK.empty,!0))}return t}(i.content,0,i.openStart,a),a,i.openEnd))}}let d=e.steps.length;for(let r=l.length-1;r>=0&&(e.replace(t,n,i),!(e.steps.length>d));r--){let e=l[r];e<0||(t=s.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){var i=e,s=t;if(!n.isInline&&i==s&&this.doc.resolve(i).parent.content.size){let e=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)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)break}return null}(this.doc,i,n.type);null!=e&&(i=s=e)}return this.replaceRange(i,s,new r.Ji(r.FK.from(n),0,0)),this}deleteRange(e,t){return!function(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()&&0==r.parentOffset&&0==i.parentOffset){let s=r.sharedDepth(n),o=!1;for(let e=r.depth;e>s;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>s;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 s=P(r,i);for(let t=0;t<s.length;t++){let n=s[t],o=t==s.length-1;if(o&&0==n||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 s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return e.delete(r.before(s),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return!function(e,t,n){let{$from:i,$to:s,depth:o}=t,l=i.before(o+1),a=s.after(o+1),h=l,c=a,p=r.FK.empty,u=0;for(let e=o,t=!1;e>n;e--)t||i.index(e)>
600?(t=!0,p=r.FK.from(i.node(e).copy(p)),u++):h--;let d=r.FK.empty,f=0;for(let e=o,t=!1;e>n;e--)t||s.after(e+1)<s.end(e)?(t=!0,d=r.FK.from(s.node(e).copy(d)),f++):c++;e.step(new g(h,c,l,a,new r.Ji(p.append(d),u,f),p.size-u,!0))}(this,e,t),this}join(e,t=1){return!function(e,t,n){let i=null,{linebreakReplacement:s}=e.doc.type.schema,o=e.doc.resolve(t-n),l=o.node().type;if(s&&l.inlineContent){let e="pre"==l.whitespace,t=!!l.contentMatch.matchType(s);e&&!t?i=!1:!e&&t&&(i=!0)}let a=e.steps.length;if(!1===i){let r=e.doc.resolve(t+n);S(e,r.node(),r.before(),a)}l.inlineContent&&y(e,t+n-1,l,o.node().contentMatchAt(o.index()),null==i);let h=e.mapping.slice(a),c=h.map(t-n);if(e.step(new m(c,h.map(t+n,-1),r.Ji.empty,!0)),!0===i){let t=e.doc.resolve(c);v(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return!function(e,t,n){let i=r.FK.empty;for(let e=n.length-1;e>=0;e--){if(i.size){let t=n[e].type.contentMatch.matchFragment(i);if(!t||!t.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=r.FK.from(n[e].type.create(n[e].attrs,i))}let s=t.start,o=t.end;e.step(new g(s,o,s,o,new r.Ji(i,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,i=null){var s=this;if(!n.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let o=s.steps.length;return s.doc.nodesBetween(e,t,(e,t)=>{var l,a,h;let c,p,u="function"==typeof i?i(e):i;if(e.isTextblock&&!e.hasMarkup(n,u)&&(l=s.doc,a=s.mapping.slice(o).map(t),h=n,p=(c=l.resolve(a)).index(),c.parent.canReplaceWith(p,p+1,h))){let i=null;if(n.schema.linebreakReplacement){let e="pre"==n.whitespace,t=!!n.contentMatch.matchType(n.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}!1===i&&S(s,e,t,o),y(s,s.mapping.slice(o).map(t,1),n,void 0,null===i);let l=s.mapping.slice(o),a=l.map(t,1),h=l.map(t+e.nodeSize,1);return s.step(new g(a,h,a+1,h-1,new r.Ji(r.FK.from(n.create(u,null,e.marks)),0,0),1,!0)),!0===i&&v(s,e,t,o),!1}}),this}setNodeMarkup(e,t,n=null,i){return!function(e,t,n,i,s){let o=e.doc.nodeAt(t);if(!o)throw RangeError("No node at given position");n||(n=o.type);let l=n.create(i,null,s||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,l);if(!n.validContent(o.content))throw RangeError("Invalid content for node type "+n.name);e.step(new g(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new r.Ji(r.FK.from(l),0,0),1,!0))}(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new F(e,t,n)),this}setDocAttribute(e,t){return this.step(new D(e,t)),this}addNodeMark(e,t){return this.step(new d(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError("No node at position "+e);if(t instanceof r.CU)t.isInSet(n.marks)&&this.step(new f(e,t));else{let r=n.marks,i,s=[];for(;i=t.isInSet(r);)s.push(new f(e,i)),r=i.removeFromSet(r);for(let e=s.length-1;e>=0;e--)this.step(s[e])}return this}split(e,t=1,n){return!function(e,t,n=1,i){let s=e.doc.resolve(t),o=r.FK.empty,l=r.FK.empty;for(let e=s.depth,t=s.depth-n,a=n-1;e>t;e--,a--){o=r.FK.from(s.node(e).copy(o));let t=i&&i[a];l=r.FK.from(t?t.type.create(t.attrs,l):s.node(e).copy(l))}e.step(new m(t,t,new r.Ji(o.append(l),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){var r;let i,s,o,l;return r=this,o=[],l=[],r.doc.nodesBetween(e,t,(r,a,h)=>{if(!r.isInline)return;let c=r.marks;if(!n.isInSet(c)&&h.type.allowsMarkType(n.type)){let h=Math.max(a,e),d=Math.min(a+r.nodeSize,t),f=n.addToSet(c);for(let e=0;e<c.length;e++)c[e].isInSet(f)||(i&&i.to==h&&i.mark.eq(c[e])?i.to=d:o.push(i=new u(h,d,c[e])));s&&s.to==h?s.to=d:l.push(s=new p(h,d,n))}}),o.forEach(e=>r.step(e)),l.forEach(e=>r.step(e)),this}removeMark(e,t,n){var i;let s,o;return i=this,s=[],o=0,i.doc.nodesBetween(e,t,(i,l)=>{if(!i.isInline)return;o++;let a=null;if(n instanceof r.sX){let e=i.marks,t;for(;t=n.isInSet(e);)(a||(a=[])).push(t),e=t.removeFromSet(e)}else n?n.isInSet(i.marks)&&(a=[n]):a=i.marks;if(a&&a.length){let n=Math.min(l+i.nodeSize,t);for(let t=0;t<a.length;t++){let r=a[t],i;for(let e=0;e<s.length;e++){let t=s[e];t.step==o-1&&r.eq(s[e].style)&&(i=t)}i?(i.to=n,i.step=o):s.push({style:r,from:Math.max(l,e),to:n,step:o})}}}
60),s.forEach(e=>i.step(new u(e.from,e.to,e.style))),this}clearIncompatible(e,t,n){return y(this,e,t,n),this}}},82641:(e,t,n)=>{n.d(t,{W:()=>eF});var r=n(30865),i=n(28745),s=n(51087),o=(e,t)=>{if("slot"===e)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=null!=t?t:{};if("svg"===e)throw Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},l=/^\s*>\s$/,a=r.bP.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return o("blockquote",{...(0,r.KV)(this.options.HTMLAttributes,e),children:o("slot",{})})},parseMarkdown:(e,t)=>{var n;let r=null!=(n=t.parseBlockChildren)?n:t.parseChildren;return t.createNode("blockquote",void 0,r(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return"";let n=[];return e.content.forEach((e,r)=>{var i,s;let o=(null!=(s=null==(i=t.renderChild)?void 0:i.call(t,e,r))?s:t.renderChildren([e])).split("\n").map(e=>""===e.trim()?">":`> ${e}`);n.push(o.join("\n"))}),n.join(` 61> 62`)},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:()=>((e,t)=>{var n;let{state:r}=e,{selection:o}=r;if(!o.empty)return!1;let{$from:l}=o;if(0!==l.parentOffset)return!1;let a=l.depth-1;if(a<0)return!1;let h=l.node(a),c=l.index(a);if(0===c)return!1;if(h.type===t)return e.commands.lift(t.name);let p=h.child(c-1);if(p.type!==t||!(null==(n=p.lastChild)?void 0:n.isTextblock))return!1;let u=l.before()-1-1;return e.commands.command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=l.parent.content,r=new i.Ji(n,0,0);return e.replace(u,l.after(),r),e.setSelection(s.U3.create(e.doc,u+n.size)),e.scrollIntoView(),t(e),!0})})(this.editor,this.type)}},addInputRules(){return[(0,r.tG)({find:l,type:this.type})]}}),h=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,c=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,p=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,u=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,d=r.CU.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&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 o("strong",{...(0,r.KV)(this.options.HTMLAttributes,e),children:o("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()}}
62,addInputRules(){return[(0,r.OX)({find:h,type:this.type}),(0,r.OX)({find:p,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:c,type:this.type}),(0,r.Zc)({find:u,type:this.type})]}}),f=e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&"`"===e[t.index-1]?null:{index:t.index,text:t[0],replaceWith:t[1]}},m=e=>{let t,n=/`([^`]+)`(?!`)/g,r=[];for(;null!==(t=n.exec(e));)t.index>0&&"`"===e[t.index-1]||r.push({index:t.index,text:t[0],replaceWith:t[1]});return r},g=r.CU.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",(0,r.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",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[(0,r.OX)({find:f,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:m,type:this.type})]}}),k=/^```([a-z]+)?[\s\n]$/,y=/^~~~([a-z]+)?[\s\n]$/,x=r.bP.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;let{languageClassPrefix:n}=this.options;if(!n)return null;let r=[...(null==(t=e.firstElementChild)?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",(0,r.KV)(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n,r;return(null==(n=e.raw)?void 0:n.startsWith("```"))===!1&&(null==(r=e.raw)?void 0:r.startsWith("~~~"))===!1&&"indented"!==e.codeBlockStyle?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r=(null==(n=e.attrs)?void 0:n.language)||"";return e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join("\n"):`\`\`\`${r} 63 64\`\`\``},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=1===t.pos;return!!e&&t.parent.type.name===this.name&&(!!n||!t.parent.textContent.length)&&this.editor.commands.clearNodes()},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;let n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:i}=r,{$from:s,empty:o}=i;if(s.parent.type!==this.type)return!1;let l=" ".repeat(n);return o?e.commands.insertContent(l):e.commands.command(({tr:e})=>{let{from:t,to:n}=i,s=r.doc.textBetween(t,n,"\n","\n").split("\n").map(e=>l+e).join("\n");return e.replaceWith(t,n,r.schema.text(s)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;let n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:i}=r,{$from:o,empty:l}=i;return o.parent.type===this.type&&(l?e.commands.command(({tr:e})=>{var t;let{pos:i}=o,l=o.start(),a=o.end(),h=r.doc.textBetween(l,a,"\n","\n").split("\n"),c=0,p=0,u=i-l;for(let e=0;e<h.length;e+=1){if(p+h[e].length>=u){c=e;break}p+=h[e].length+1}let d=Math.min(((null==(t=h[c].match(/^ */))?void 0:t[0])||"").length,n);if(0===d)return!0;let f=l;for(let e=0;e<c;e+=1)f+=h[e].length+1;return e.delete(f,f+d),i-f<=d&&e.setSelection(s.U3.create(e.doc,f)),!0}):e.commands.command(({tr:e})=>{let{from:t,to:s}=i,o=r.doc.textBetween(t,s,"\n","\n").split("\n").map(e=>{var t;let r=Math.min(((null==(t=e.match(/^ */))?void 0:t[0])||"").length,n);return e.slice(r)}).join("\n");return e.replaceWith(t,s,r.schema.text(o)),!0}))},Enter:({editor:e})=>
64{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 s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith("\n\n");return!!s&&!!o&&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||0!==r.parentOffset)return!1;let s=r.before();return!(s>0)&&e.commands.insertDefaultBlock({pos:s})},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let l=i.after();return void 0!==l&&(r.nodeAt(l)?e.commands.command(({tr:e})=>(e.setSelection(s.LN.near(r.resolve(l))),!0)):e.commands.exitCode())}}},addInputRules(){return[(0,r.JJ)({find:k,type:this.type,getAttributes:e=>({language:e[1]})}),(0,r.JJ)({find:y,type:this.t
64ype,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new s.k_({key:new s.hs("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,o=null==i?void 0:i.mode;if(!n||!o)return!1;let{tr:l,schema:a}=e.state,h=a.text(n.replace(/\r\n?/g,"\n"));return l.replaceSelectionWith(this.type.create({language:o},h)),l.selection.$from.parent.type!==this.type&&l.setSelection(s.U3.near(l.doc.resolve(Math.max(0,l.selection.from-2)))),l.setMeta("paste",!0),e.dispatch(l),!0}}})]}}),w=r.bP.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n\n"):""}),b=r.bP.create({name:"hardBreak",markdownTokenName:"br",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",(0,r.KV)(this.options.HTMLAttributes,e)]},renderText:()=>"\n",renderMarkdown:()=>` 65`,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:s}=this.options,{splittableMarks:o}=r.extensionManager,l=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&l&&s){let t=l.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()}}}),v=r.bP.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){let n=this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0];return[`h${n}`,(0,r.KV)(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;let r=(null==(n=e.attrs)?void 0:n.level)?parseInt(e.attrs.level,10):1,i="#".repeat(r);return e.content?`${i} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},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=>(0,r.JJ)({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}}
65)\\s$`),type:this.type,getAttributes:{level:e}}))}}),S=r.bP.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",(0,r.KV)(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!(0,r.AB)(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:i}=n,o=e();return(0,r.BQ)(n)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.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(s.U3.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(s.nh.create(t.doc,n.pos)):t.setSelection(s.U3.create(t.doc,n.pos));else{let i=e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType,o=null==i?void 0:i.create();o&&(t.insert(r,o),t.setSelection(s.U3.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[(0,r.Ce)({find:/^(?:---|â-|___\s|\*\*\*\s)$/,type:this.t
65ype})]}}),T=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,M=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,C=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,A=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,E=r.CU.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",(0,r.KV)(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[(0,r.OX)({find:T,type:this.type}
65),(0,r.OX)({find:C,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:M,type:this.type}),(0,r.Zc)({find:A,type:this.type})]}}),R=n(60568),I="[\0- \xa0áá â-\u2029âã]",O=new RegExp(I),N=RegExp(`${I}$`),$=RegExp(I,"g"),z=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|â(.*?)â|â(.*?)â))?\)$/,L=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|â(.*?)â|â(.*?)â))?\)/g;function P(e,t){let n=0;for(let r=t-1;r>=0&&"\\"===e[r];r-=1)n+=1;return n%2==1}function F(e,t,n){var r,i;let[,s,o]=t;return!("!"===(t.index?e[t.index-1]:void 0)||P(e,null!=(r=t.index)?r:0)||function(e,t){let n=0,r=0;for(;r<t;){if("`"!==e[r]||0===n&&P(e,r)){r+=1;continue}let i=0;for(;r<t&&"`"===e[r];)i+=1,r+=1;0===n?n=i:i===n&&(n=0)}return n>0}(e,null!=(i=t.index)?i:0))&&!!s.trim()&&n(o)}function D(e){var t,n;let[r,i,s,,o,l,a]=e,h=null!=(t=null!=o?o:l)?t:a;return{index:null!=(n=e.index)?n:0,text:r,replaceWith:i,data:{href:s,title:h||null,markdown:!0}}}function B(e){var t,n,r;return{href:null==(t=e.data)?void 0:t.href,title:null!=(r=null==(n=e.data)?void 0:n.title)?r:null}}function _(e,t){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(e=>{let t="string"==typeof e?e:e.scheme;t&&n.push(t)}),!e||e.replace($,"").match(RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}var j=r.CU.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=>{"string"==typeof e?(0,R.ZV)(e):(0,R.ZV)(e.scheme,e.optionalSlashes)})},onDestroy(){(0,R.cL)()},inclusive(){return this.options.autolink},addOptions:()=>({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)=>!!_(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(){var e,t,n;return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:null!=(e=this.options.HTMLAttributes.target)?e:null},rel:{default:null!=(t=this.options.HTMLAttributes.rel)?t:null},class:{default:null!=(n=this.options.HTMLAttributes.class)?n:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{let t=e.getAttribute("href");return!!t&&!!this.options.isAllowedUri(t,{defaultValidate:e=>!!_(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!_(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",(0,r.KV)(this.options.HTMLAttributes,e),0]:["a",(0,r.KV)(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)=>{var n,r,i,s;let o=null!=(r=null==(n=e.attrs)?void 0:n.href)?r:"",l=null!=(s=null==(i=e.attrs)?void 0:i.title)?s:"",a=t.renderChildren(e);return l?`[${a}](${o} "${l}")`:`[${a}](${o})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!_(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return(!n||!!this.options.isAllowedUri(n,{defaultValidate:e=>!!_(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&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(){var e;let t;
65return this.options.markdownLinks?[(e={type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!_(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})},t=(0,r.OX)({find:t=>{let n=z.exec(t);return n&&F(t,n,e.isAllowedHref)?D(n):null},type:e.type,getAttributes:B}),new r.fV({find:t.find,handler:e=>{let n=t.handler(e);return null!==n&&e.state.tr.steps.length&&e.state.tr.setMeta("preventAutolink",!0),n}}))]:[]},addPasteRules(){let e=e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options;(0,R.I6)(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!_(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};if(this.options.markdownLinks){var t;let n;return[(t={type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!_(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:e},n=(0,r.Zc)({find:e=>{var n,r;let i=[];for(let n of e.matchAll(L))F(e,n,t.isAllowedHref)&&i.push(D(n));let s=(null!=(r=null==(n=t.findPlainUrls)?void 0:n.call(t,e))?r:[]).filter(e=>!i.some(t=>t.index<e.index+e.text.length&&e.index<t.index+t.text.length));return[...i,...s]},type:t.type,getAttributes:B}),new r._n({find:n.find,handler:e=>{var t;let r=n.handler(e);return null!==r&&e.state.tr.steps.length&&(null==(t=e.match.data)?void 0:t.markdown)&&e.state.tr.setMeta("preventAutolink",!0),r}}))]}return[(0,r.Zc)({find:e,type:this.type,getAttributes:e=>{var t;return{href:null==(t=e.data)?void 0:t.href}}})]},addProseMirrorPlugins(){var e,t,n;let i=[],{protocols:o,defaultProtocol:l}=this.options;return this.options.autolink&&i.push((e={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!_(e,o),protocols:o,defaultProtocol:l}),shouldAutoLink:this.options.shouldAutoLink},new s.k_({key:new s.hs("autolink"),appendTransaction:(t,n,i)=>{let s=t.some(e=>e.docChanged)&&!n.doc.eq(i.doc),o=t.some(e=>e.getMeta("preventAutolink"));if(!s||o)return;let{tr:l}=i,a=(0,r.T7)(n.doc,[...t]);if((0,r.FF)(a).forEach(({newRange:t})=>{let n,s,o=(0,r.Nx)(i.doc,t,e=>e.isTextblock);if(o.length>1)n=o[0],s=i.doc.textBetween(n.pos,n.pos+n.node.nodeSize,void 0," ");else if(o.length){let e=i.doc.textBetween(t.from,t.to," "," ");if(!N.test(e))return;n=o[0],s=i.doc.textBetween(n.pos,t.to,void 0," ")}if(n&&s){let t=s.split(O).filter(Boolean);if(t.length<=0)return!1;let o=t[t.length-1],a=n.pos+s.lastIndexOf(o);if(!o)return!1;let h=(0,R.qw)(o).map(t=>t.toObject(e.defaultProtocol));if(!(1===h.length?h[0].isLink:3===h.length&&!!h[1].isLink&&["()","[]"].includes(h[0].value+h[2].value)))return!1;h.filter(e=>e.isLink).map(e=>({...e,from:a+e.start+1,to:a+e.end+1})).filter(e=>!i.schema.marks.code||!i.doc.rangeHasMark(e.from,e.to,i.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{(0,r.hO)(t.from,t.to,i.doc).some(t=>t.mark.type===e.type)||l.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),l.steps.length)return l}}))),i.push((t={type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection},new s.k_({key:new s.hs("handleClickLink"),props:{handleClick:(e,n,i)=>{var s,o;if(0!==i.button||!e.editable)return!1;let l=null;if(i.target instanceof HTMLAnchorElement)l=i.target;else{let e=i.target;if(!e)return!1;let n=t.editor.view.dom;(l=e.closest("a"))&&!n.contains(l)&&(l=null)}if(!l)return!1;let a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){let n=(0,r.gu)(e.state,t.type.name),i=null!=(s=l.href)?s:n.href,h=null!=(o=l.target)?o:n.target;i&&(window.open(i,h),a=!0)}return a}}}))),this.options.linkOnPaste&&i.push((n={editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink},new s.k_({key:new s.hs("handlePasteLink"),props:{handlePaste:(e,t,r)=>{let{shouldAutoLink:i}=n,{state:s}=e,{selection:o}=s,{empty:l}=o;if(l)return!1;let a="";
65r.content.forEach(e=>{a+=e.textContent});let h=(0,R.I6)(a,{defaultProtocol:n.defaultProtocol}).find(e=>e.isLink&&e.value===a);return!!a&&!!h&&(void 0===i||!!i(h.value))&&n.editor.commands.setMark(n.type,{href:h.href})}}}))),i}}),J=Object.defineProperty,H="textStyle",K=/^\s*([-+*])\s$/,q=r.bP.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",(0,r.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>"list"!==e.type||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(H)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}}
65,addInputRules(){let e=(0,r.tG)({find:K,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,r.tG)({find:K,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(H),editor:this.editor})),[e]}}),V=(e,t)=>r.YY.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>{let n;return n=this.editor,((e,t,n,r)=>{let s=((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 s=-1;for(let e=i.depth;e>0;e-=1)if(i.node(e).type.name===t){s=e;break}if(s<0)return null;let o=i.node(s),l=i.index(s);if(l+1>=o.childCount)return null;let a=o.child(l+1);if(!n.includes(a.type.name))return null;let h=e.schema.nodes[t],c=!1;if(a.forEach(e=>{e.type===h&&e.childCount>1&&(c=!0)}),!c)return null;let p=e.doc.resolve(i.after()).nodeAfter;if(!p||!n.includes(p.type.name))return null;let u=[];return(p.forEach(e=>{u.push(e)}),0===u.length)?null:{listItemDepth:s,nestedList:p,nestedListPos:i.after(),insertPos:i.after(s),items:u}})(e,n,r);if(!s)return!1;let{selection:o}=e,{nestedList:l,nestedListPos:a,insertPos:h,items:c}=s,p=e.tr;p.delete(a,a+l.nodeSize);let u=p.mapping.map(h);return p.insert(u,i.FK.from(c)),p.setSelection(o.map(p.doc,p.mapping)),t&&t(p),!0})(n.state,n.view.dispatch,e,t)};return{Delete:n,"Mod-Delete":n}}}),U=[[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"]],W="abcdefghijklmnopqrstuvwxyz",Z=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function G(e){let t=e,n="";for(let[e,r]of U)for(;t>=e;)n+=r,t-=e;return n}function X(e){return G(e).toUpperCase()}function Y(e){let t=e.toLowerCase(),n=0,r=0;for(;n<t.length;){let e=!1;for(let[i,s]of U)if(t.startsWith(s,n)){r+=i,n+=s.length,e=!0;break}if(!e)return 0}return r}function Q(e){if(e<=26)return W[e-1];let t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?W[n]:W[t]+W[n]}function ee(e){if(!(!e||/^\d+$/.test(e))){if(function(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;let t=Y(e);return!(t<=0)&&(e===e.toLowerCase()?G(t):X(t))===e}(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 et(e){if(/^\d+$/.test(e))return parseInt(e,10);let t=ee(e);if("i"===t||"I"===t)return Y(e);if("a"===t||"A"===t){let t,n=1===(t=e.toLowerCase()).length?t.charCodeAt(0)-97+1:2===t.length?(t.charCodeAt(0)-97+1)*26+(t.charCodeAt(1)-97)+1:0;return n>0?n:1}let n=parseInt(e,10);return Number.isNaN(n)?1:n}var en=r.bP.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",(0,r.KV)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{var n,r,i,s;if("list_item"!==e.type)return[];let o=null!=(n=t.parseBlockChildren)?n:t.parseChildren,l=[];if(e.tokens&&e.tokens.length>0){let n;if(n=null==(r=e.tokens)?void 0:r[0],e.text&&(null==(i=e.tokens)?void 0:i.length)===1&&(null==n?void 0:n.type)==="list"&&n.ordered&&n.raw===e.text)return{type:"listItem",content:[{type:"paragraph",content:(s=e.text||"",t.tokenizeInline?t.parseInline(t.tokenizeInline(s)):t.parseInline([{type:"text",raw:s,text:s}]))}]};if(e.tokens.some(e=>"paragraph"===e.type))l=o(e.tokens);else{let n=e.tokens[0];if(n&&"text"===n.type&&n.tokens&&n.tokens.length>0){if(l=[{type:"paragraph",content:t.parseInline(n.tokens)}],e.tokens.length>1){let t=o(e.tokens.slice(1));l.push(...t)}}else l=o(e.tokens)}}return 0===l.length&&(l=[{type:"paragraph",content:[]}]),{type:"listItem",content:l}},renderMarkdown:(e,t,n)=>(0,r.kj)(e,t,e=>{var t,n,r,i;if("bulletList"===e.parentType)return"- ";if("orderedList"===e.parentType){let s=(null==(n=null==(t=e.meta)?void 0:t.parentAttrs)?void 0:n.start)||1;return function(e,t,n=". "){let r=t+1;if(!e||"1"===e)return`${r}${n}`;switch(e){case"a":return`${Q(r)}${n}`;case"A":return`${Q(r).toUpperCase()}${n}`;case"i":return`${G(r)}${n}`;case"I":return`${X(r)}${n}`;default:return`${r}${n}`}}(null==(i=null==(r=e.meta)?void 0:r.parentAttrs)?void 0:i.type,s-1+(e.index||0),". ")}return"- "},n),addExtensions(){return[V(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)}}}),er={},ei={findListItemPos:()=>eo,getNextListDepth:()=>el,handleBackspace:()=>eh,handleDelete:()=>eu,handleTab:()=>ed,hasListBefore:()=>ea,hasListItemAfter:()=>ef,hasListItemBefore:()=>em,listItemHasSubList:()=>eg,nextListIsDeeper:()=>ec,nextListIsHigher:()=>ep};for(var es in ei)J(er,es,{get:ei[es],enumerable:!0});var eo=(e,t)=>{let{$from:n}=t.selection,i=(0,r.Pg)(e,t.schema),s=n.depth,o=n.pos,l=null;for(;s>0&&null===l;)n.node(s).type===i?l=s:(s-=1,o-=1);return null===l?null:{$pos:t.doc.resolve(o),depth:l}},el=(e,t)=>
65{let n=eo(e,t);if(!n)return!1;let[,i]=(0,r.fl)(t,e,n.$pos.pos+4);return i},ea=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),s=e.doc.resolve(i).node();return!!s&&!!n.includes(s.type.name)},eh=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!(0,r.rU)(e.state,t)&&ea(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 s=i.at(-1);if(!s)return!1;let o=e.state.doc.resolve(r.start()+s.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!(0,r.rU)(e.state,t)||!(0,r.J_)(e.state))return!1;let{$from:i}=e.state.selection,s=i.depth-1;return i.node(s).type===e.schema.nodes[t]&&0===i.index(s)&&e.chain().liftListItem(t).run()},ec=(e,t)=>{let n=el(e,t),r=eo(e,t);return!!r&&!!n&&n>r.depth},ep=(e,t)=>{let n=el(e,t),r=eo(e,t);return!!r&&!!n&&n<r.depth},eu=(e,t)=>{if(!(0,r.rU)(e.state,t)||!(0,r.QN)(e.state,t))return!1;let{selection:n}=e.state,{$from:i,$to:s}=n;return!(!n.empty&&i.sameParent(s))&&(ec(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():ep(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward())},ed=(e,t,n)=>{let{state:o}=e,{selection:l}=o;if(!l.empty)return!1;let{$from:a}=l;if(0!==a.parentOffset||!a.parent.isTextblock||(0,r.rU)(o,t))return!1;let h=(0,r.H_)(a);if(!h||!n.includes(h.type.name))return!1;let c=h.lastChild;if(!c||c.type.name!==t)return!1;let p=a.parent;if(!c.canReplace(c.childCount,c.childCount,i.FK.from(p)))return!1;let u=a.before(),d=a.after(),f=u-2;return e.commands.command(({tr:e,dispatch:t})=>(t&&(e.delete(u,d).insert(f,i.FK.from(p)),e.setSelection(s.U3.create(e.doc,f+1)),e.scrollIntoView()),!0))},ef=(e,t)=>{var n;let{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-r.parentOffset-2);return i.index()!==i.parent.childCount-1&&(null==(n=i.nodeAfter)?void 0:n.type.name)===e},em=(e,t)=>{var n;let{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-2);return 0!==i.index()&&(null==(n=i.nodeBefore)?void 0:n.type.name)===e},eg=(e,t,n)=>{if(!n)return!1;let i=(0,r.Pg)(e,t.schema),s=!1;return n.descendants(e=>{e.type===i&&(s=!0)}),s},ek=r.YY.create({name:"listKeymap",addOptions:()=>({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})=>{void 0!==e.state.schema.nodes[n]&&eu(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&eu(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&eh(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&eh(e,n,r)&&(t=!0)}),t},Tab:({editor:e})=>{for(let{itemName:t,wrapperNames:n}of this.options.listTypes)if(void 0!==e.state.schema.nodes[t]&&ed(e,t,n))return!0;return!1}}}}),ey=RegExp(`^(\\s*)(${Z})([.)])\\s+(.*)$`),ex=/^\s/,ew={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/}
65,eb=RegExp(`^(${Z})([.)])\\s+(.+)$`),ev="textStyle",eS=/^(\d+)\.\s$/;function eT(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 eM=r.bP.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({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=eT(n);if(e)return e}let r=e.querySelector("li");if(r){let e=r.getAttribute("style");if(e){let t=eT(e);if(t)return t}}return null}}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){let{start:t,type:n,...i}=e,s=(0,r.KV)(this.options.HTMLAttributes,i);return 1!==t&&(s.start=t),n&&"1"!==n&&(s.type=n),["ol",s,0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{var n;if("list"!==e.type||!e.ordered)return[];let r=e.start||1,i=e.typeMarker,s=e.items?(n=e.items,n.map(e=>{if("list_item"!==e.type)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if("paragraph"===e.type||"list"===e.type||"blockquote"===e.type||"code"===e.type)n.push(...t.parseChildren([e]));else if("text"===e.type&&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}})):[],o={};return(1!==r&&(o.start=r),i&&(o.type=i),Object.keys(o).length>0)?{type:"orderedList",attrs:o,content:s}:{type:"orderedList",content:s}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(e,t,n)=>{var r,i;let s=e.split("\n"),[o,l]=function(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],s=i.match(ey);if(!s)break;let[,o,l,a,h]=s,c=o.length,p=parseInt(l,10),u=isNaN(p)?ee(l):void 0,d=isNaN(p)?et(l):p,f=[h],m=n+1,g=[i],k=!1;for(;m<e.length;){let t=e[m];if(t.match(ey))break;if(""===t.trim())g.push(t),f.push(""),k=!0,m+=1;else if(t.match(ex)){let e=t.length-t.trimStart().length,n=c+l.length+1;g.push(t),f.push(t.slice(Math.min(e,n))),m+=1}else{if(k||function(e){return Object.values(ew).some(t=>t.test(e))}(t))break;g.push(t),f.push(t),m+=1}}t.push({indent:c,number:d,type:u,content:f.join("\n").trim(),contentLines:f,raw:g.join("\n")}),r=m,n=m}return[t,r]}(s);if(0===o.length)return;let a=function e(t,n,r){let i=[],s=0;for(;s<t.length;){let o=t[s];if(o.indent===n){let{paragraphLines:l,blockLines:a}=function(e){let t=[],n=[],r=!1;return e.forEach(e=>{let i;if(r)return void n.push(e);if(""===e.trim()||t.length>0&&(i=e.trimStart(),ew.bulletItem.test(i)||ey.test(i.trimStart())||ew.heading.test(i)||ew.thematicBreak.test(i)&&!i.startsWith("-")||/^>\s?/.test(i)||ew.codeFence.test(i)||ew.blockMath.test(i))){r=!0,n.push(e);return}t.push(e)}),{paragraphLines:t,blockLines:n}}(o.contentLines),h=l.join("\n").trim(),c=[];h&&c.push({type:"paragraph",raw:h,tokens:r.inlineTokens(h)});let p=a.join("\n").trim();if(p){let e=r.blockTokens(p);c.push(...e)}let u=s+1,d=[];for(;u<t.length&&t[u].indent>n;)d.push(t[u]),u+=1;if(d.length>0){let t=Math.min(...d.map(e=>e.indent)),n=e(d,t,r);c.push({type:"list",ordered:!0,start:d[0].number,typeMarker:d[0].type,items:n,raw:d.map(e=>e.raw).join("\n")})}i.push({type:"list_item",raw:o.raw,tokens:c}),s=u}else s+=1}return i}(o,o[0].indent,n);if(0!==a.length)return{type:"list",ordered:!0,start:(null==(r=o[0])?void 0:r.number)||1,typeMarker:null==(i=o[0])?void 0:i.type,items:a,raw:s.slice(0,l).join("\n")}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(ev)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}}
65,addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins:()=>[new s.k_({props:{handlePaste:(e,t)=>{var n,r;let i=null==(n=t.clipboardData)?void 0:n.getData("text/html");if(null==i?void 0:i.trim())return!1;let s=null==(r=t.clipboardData)?void 0:r.getData("text/plain");if(!s)return!1;let o=function(e){let t=e.split("\n").filter(e=>e.trim().length>0);if(0===t.length)return null;let n=[];for(let e of t){let t=e.trim().match(eb);if(!t)return null;n.push({marker:t[1],content:t[3]})}return!function(e){var t;if(0===e.length)return!1;let n=null!=(t=ee(e[0]))?t:"numeric",r=et(e[0]);if(r<1)return!1;for(let t=0;t<e.length;t++){let i=function(e,t){if("numeric"===e)return String(t);switch(e){case"a":return Q(t);case"A":return Q(t).toUpperCase();case"i":return G(t);case"I":return X(t);default:return String(t)}}(n,r+t);if(e[t]!==i)return!1}return!0}(n.map(e=>e.marker))?null:{type:"orderedList",attrs:function(e){let{type:t,start:n}={type:ee(e),start:et(e)},r={};return t&&(r.type=t),1!==n&&(r.start=n),r}(n[0].marker),content:n.map(e=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:e.content}]}]}))}}(s);if(!o)return!1;try{let t=e.state.schema.nodeFromJSON(o),n=e.state.tr.replaceSelectionWith(t);return e.dispatch(n),!0}catch{return!1}}}})],addInputRules(){let e=(e,t)=>(!t.attrs.type||"1"===t.attrs.type)&&t.childCount+t.attrs.start===+e[1],t=(0,r.tG)({find:eS,type:this.t
65ype,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=(0,r.tG)({find:eS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(ev)}),joinPredicate:e,editor:this.editor})),[t]}}),eC=/^\s*(\[([( |x])?\])\s$/,eA=r.bP.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute("data-checked");return""===t||"true"===t},renderHTML:e=>({"data-checked":e.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:e=>{var t;return null!=(t=e.querySelector("div"))?t:e}}]},renderHTML({node:e,HTMLAttributes:t}){return["li",(0,r.KV)(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)=>{var n;let i=(null==(n=e.attrs)?void 0:n.checked)?"x":" ",s=`- [${i}] `;return(0,r.kj)(e,t,s)},addExtensions(){return this.options.nested?[V(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:i})=>{let s=document.createElement("li"),o=document.createElement("label"),l=document.createElement("span"),a=document.createElement("input"),h=document.createElement("div");l.style.cssText="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";let c=e=>{var t,n,r;let i=(t=e.attrs.checked,(null==(r=null==(n=this.options.a11y)?void 0:n.checkboxLabel)?void 0:r.call(n,e,t))||`Task item checkbox for ${e.textContent||"empty task item"}`);a.setAttribute("aria-label",i),l.textContent=i};c(e),o.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",e=>e.preventDefault()),a.addEventListener("change",t=>{if(!i.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}let{checked:r}=t.target;i.isEditable&&"function"==typeof n&&i.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if("number"!=typeof t)return!1;let i=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...null==i?void 0:i.attrs,checked:r}),!0}).run(),i.isEditable||!this.options.onReadOnlyChecked||this.options.onReadOnlyChecked(e,r)||(a.checked=!a.checked)}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{s.setAttribute(e,t)}),s.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,o.append(a,l),s.append(o,h),Object.entries(t).forEach(([e,t])=>{s.setAttribute(e,t)});let p=new Set(Object.keys(t));return{dom:s,contentDOM:h,update:e=>{if(e.type!==this.type)return!1;s.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,c(e);let t=i.extensionManager.attributes,n=(0,r.zU)(e,t),o=new Set(Object.keys(n)),l=this.options.HTMLAttributes;return p.forEach(e=>{o.has(e)||(e in l?s.setAttribute(e,l[e]):s.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{null==t?e in l?s.setAttribute(e,l[e]):s.removeAttribute(e):s.setAttribute(e,t)}),p=o,!0}}}}
65,addInputRules(){return[(0,r.tG)({find:eC,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),eE=r.bP.create({name:"taskList",addOptions:()=>({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",(0,r.KV)(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,"\n"):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;let n=null==(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))?void 0:t.index;return void 0!==n?n:-1},tokenize(e,t,n){let i=e=>{let t=(0,r.Dd)(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),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:i},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)},s=(0,r.Dd)(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),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:i},n);if(s)return{type:"taskList",raw:s.raw,items:s.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()}}});r.YY.create({name:"listKit",addExtensions(){let e=[];return!1!==this.options.bulletList&&e.push(q.configure(this.options.bulletList)),!1!==this.options.listItem&&e.push(en.configure(this.options.listItem)),!1!==this.options.listKeymap&&e.push(ek.configure(this.options.listKeymap)),!1!==this.options.orderedList&&e.push(eM.configure(this.options.orderedList)),!1!==this.options.taskItem&&e.push(eA.configure(this.options.taskItem)),!1!==this.options.taskList&&e.push(eE.configure(this.options.taskList)),e}});var eR=" ",eI=r.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,r.KV)(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(1===n.length&&"image"===n[0].type)return t.parseChildren([n[0]]);let r=t.parseInline(n);return 1===n.length&&"text"===n[0].type&&(n[0].raw===eR||n[0].text===eR||"\xa0"===n[0].raw||"\xa0"===n[0].text)&&1===r.length&&"text"===r[0].type&&(r[0].text===eR||"\xa0"===r[0].text)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t,n)=>{var r,i;if(!e)return"";let s=Array.isArray(e.content)?e.content:[];if(0===s.length){let e=Array.isArray(null==(r=null==n?void 0:n.previousNode)?void 0:r.content)?n.previousNode.content:[];return(null==(i=null==n?void 0:n.previousNode)?void 0:i.type)==="paragraph"&&0===e.length?eR:""}return t.renderChildren(s)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),eO=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,eN=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,e$=r.CU.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",(0,r.KV)(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)}}
65,addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[(0,r.OX)({find:eO,type:this.type})]},addPasteRules(){return[(0,r.Zc)({find:eN,type:this.type})]}}),ez=r.bP.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),eL=r.CU.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",(0,r.KV)(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown:(e,t)=>`++${t.renderChildren(e)}++`,markdownTokenizer:{name:"underline",level:"inline",start:e=>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()}}}),eP=n(27767),eF=r.YY.create({name:"starterKit",addExtensions(){var e,t,n,r;let i=[];return!1!==this.options.bold&&i.push(d.configure(this.options.bold)),!1!==this.options.blockquote&&i.push(a.configure(this.options.blockquote)),!1!==this.options.bulletList&&i.push(q.configure(this.options.bulletList)),!1!==this.options.code&&i.push(g.configure(this.options.code)),!1!==this.options.codeBlock&&i.push(x.configure(this.options.codeBlock)),!1!==this.options.document&&i.push(w.configure(this.options.document)),!1!==this.options.dropcursor&&i.push(eP.QO.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&i.push(eP.vR.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&i.push(b.configure(this.options.hardBreak)),!1!==this.options.heading&&i.push(v.configure(this.options.heading)),!1!==this.options.undoRedo&&i.push(eP.lb.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&i.push(S.configure(this.options.horizontalRule)),!1!==this.options.italic&&i.push(E.configure(this.options.italic)),!1!==this.options.listItem&&i.push(en.configure(this.options.listItem)),!1!==this.options.listKeymap&&i.push(ek.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&i.push(j.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&i.push(eM.configure(this.options.orderedList)),!1!==this.options.paragraph&&i.push(eI.configure(this.options.paragraph)),!1!==this.options.strike&&i.push(e$.configure(this.options.strike)),!1!==this.options.text&&i.push(ez.configure(this.options.text)),!1!==this.options.underline&&i.push(eL.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&i.push(eP.JU.configure(null==(r=this.options)?void 0:r.trailingNode)),i}})},91698:(e,t,n)=>{n.d(t,{K:()=>f,w:()=>d});for(var r={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:"'"},i={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},s="u">typeof navigator&&/Mac/.test(navigator.platform),o="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),l=0;l<10;l++)r[48+l]=r[96+l]=String(l);for(var l=1;l<=24;l++)r[l+111]="F"+l;for(var l=65;l<=90;l++)r[l]=String.fromCharCode(l+32),i[l]=String.fromCharCode(l);for(var a in r)i.hasOwnProperty(a)||(i[a]=r[a]);var h=n(51087);let c="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),p="u">typeof navigator&&/Win/.test(navigator.platform);
65function u(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 d(e){return new h.k_({props:{handleKeyDown:f(e)}})}function f(e){let t=function(e){let t=Object.create(null);for(let n in e)t[function(e){let t,n,r,i,s=e.split(/-(?!$)/),o=s[s.length-1];"Space"==o&&(o=" ");for(let e=0;e<s.length-1;e++){let o=s[e];if(/^(cmd|meta|m)$/i.test(o))i=!0;else if(/^a(lt)?$/i.test(o))t=!0;else if(/^(c|ctrl|control)$/i.test(o))n=!0;else if(/^s(hift)?$/i.test(o))r=!0;else if(/^mod$/i.test(o))c?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+o)}return t&&(o="Alt-"+o),n&&(o="Ctrl-"+o),i&&(o="Meta-"+o),r&&(o="Shift-"+o),o}(n)]=e[n];return t}(e);return function(e,n){var l;let a=("Esc"==(l=!(s&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||o&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?i:r)[n.keyCode]||n.key||"Unidentified")&&(l="Escape"),"Del"==l&&(l="Delete"),"Left"==l&&(l="ArrowLeft"),"Up"==l&&(l="ArrowUp"),"Right"==l&&(l="ArrowRight"),"Down"==l&&(l="ArrowDown"),l),h,c=t[u(a,n)];if(c&&c(e.state,e.dispatch,e))return!0;if(1==a.length&&" "!=a){if(n.shiftKey){let r=t[u(a,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(p&&n.ctrlKey&&n.altKey)&&(h=r[n.keyCode])&&h!=a){let r=t[u(h,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}},98663:(e,t,n)=>{e.exports=n(32671)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.