PageSourceSearch

https://www.idntimes.com/_next/static/chunks/tiptap.7e2e14f759134dc5.js

js idntimes.com collected 2026-09-24 08:57:40 UTC 139,775 bytes, 88 lines download raw bytes

1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6cb459a0-b6d7-4c6e-87e3-92d3f348c71b",e._sentryDebugIdIdentifier="sentry-dbid-6cb459a0-b6d7-4c6e-87e3-92d3f348c71b")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9008],{8646:function(e,t,n){n.d(t,{Cf:function(){return tq},DK:function(){return t7},EG:function(){return e2},FZ:function(){return tX},Ig:function(){return ei},K9:function(){return ne},ML:function(){return tU},NB:function(){return t5},NI:function(){return t6},NY:function(){return eq},Nl:function(){return eE},P1:function(){return eI},QC:function(){return eK},S0:function(){return tJ},Sz:function(){return eQ},WR:function(){return t8},XP:function(){return ex},b5:function(){return eC},bR:function(){return e1},hj:function(){return tN},jo:function(){return w},m7:function(){return eH},nU:function(){return eN},qv:function(){return eT},rI:function(){return eG},tI:function(){return eU},u9:function(){return eW},vc:function(){return tT},wm:function(){return t9},x2:function(){return tF},zK:function(){return tY}});var r=n(66570),o=n(94956),i=n(40160),s=n(69323),a=n(33120),l=n(38280),d=n(40936),u=Object.defineProperty,c=(e,t)=>{for(var n in t)u(e,n,{get:t[n],enumerable:!0})};function p(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}var h=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s=[],a=!!e,l=e||o.tr,d={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(l,t),o=n(...e)(r);return s.push(o),d}])),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(l),s.every(e=>!0===e))};return d}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,o=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...o,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s={tr:e,editor:r,view:i,state:p({state:o,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(s)]))}};return s}},m={};c(m,{blur:()=>f,clearContent:()=>g,clearNodes:()=>b,command:()=>y,createParagraphNear:()=>k,cut:()=>v,deleteCurrentNode:()=>M,deleteNode:()=>x,deleteRange:()=>C,deleteSelection:()=>T,enter:()=>S,exitCode:()=>E,extendMarkRange:()=>I,first:()=>H,focus:()=>_,forEach:()=>V,insertContent:()=>W,insertContentAt:()=>Y,joinBackward:()=>G,joinDown:()=>X,joinForward:()=>Q,joinItemBackward:()=>Z,joinItemForward:()=>ee,joinTextblockBackward:()=>et,joinTextblockForward:()=>en,joinUp:()=>J,keyboardShortcut:()=>eo,lift:()=>es,liftEmptyBlock:()=>ea,liftListItem:()=>el,newlineInCode:()=>ed,resetAttributes:()=>ep,scrollIntoView:()=>eh,selectAll:()=>em,selectNodeBackward:()=>ef,selectNodeForward:()=>eg,selectParentNode:()=>eb,selectTextblockEnd:()=>ey,selectTextblockStart:()=>ek,setContent:()=>eM,setMark:()=>e4,setMeta:()=>e8,setNode:()=>e5,setNodeSelection:()=>e7,setTextDirection:()=>te,setTextSelection:()=>tt,sinkListItem:()=>tn,splitBlock:()=>to,splitListItem:()=>ti,toggleList:()=>tl,toggleMark:()=>td,toggleNode:()=>tu,toggleWrap:()=>
1tc,undoInputRule:()=>tp,unsetAllMarks:()=>th,unsetMark:()=>tm,unsetTextDirection:()=>tf,updateAttributes:()=>tg,wrapIn:()=>tb,wrapInList:()=>ty});var f=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())}),!0),g=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),b=()=>({state:e,tr:t,dispatch:n})=>{let{selection:o}=t,{ranges:i}=o;return!n||(i.forEach(({$from:n,$to:o})=>{e.doc.nodesBetween(n.pos,o.pos,(e,n)=>{if(e.type.isText)return;let{doc:o,mapping:i}=t,s=o.resolve(i.map(n)),a=o.resolve(i.map(n+e.nodeSize)),l=s.blockRange(a);if(!l)return;let d=(0,r.k9)(l);if(e.type.isTextblock){let{defaultType:e}=s.parent.contentMatchAt(s.index());t.setNodeMarkup(l.start,e)}(d||0===d)&&t.lift(l,d)})}),!0)},y=e=>t=>e(t),k=()=>({state:e,dispatch:t})=>(0,o.mD)(e,t),v=(e,t)=>({editor:n,tr:r})=>{let{state:o}=n,s=o.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let a=r.mapping.map(t);return r.insert(a,s.content),r.setSelection(new i.Bs(r.doc.resolve(Math.max(a-1,0)))),!0},M=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let o=e.selection.$anchor;for(let n=o.depth;n>0;n-=1)if(o.node(n).type===r.type){if(t){let t=o.before(n),r=o.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function w(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var x=e=>({tr:t,state:n,dispatch:r})=>{let o=w(e,n.schema),i=t.selection.$anchor;for(let e=i.depth;e>0;e-=1)if(i.node(e).type===o){if(r){let n=i.before(e),r=i.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},C=e=>({tr:t,dispatch:n})=>{let{from:r,to:o}=e;return n&&t.delete(r,o),!0},T=()=>({state:e,dispatch:t})=>(0,o.NE)(e,t),S=()=>({commands:e})=>e.keyboardShortcut("Enter"),E=()=>({state:e,dispatch:t})=>(0,o.uo)(e,t);function A(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function L(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:A(t[r])?t[r].test(e[r]):t[r]===e[r])}function O(e,t,n={}){return e.find(e=>e.type===t&&L(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function N(e,t,n={}){return!!O(e,t,n)}function $(e,t,n){var r;if(!e||!t)return;let o=e.parent.childAfter(e.parentOffset);if(o.node&&o.node.marks.some(e=>e.type===t)||(o=e.parent.childBefore(e.parentOffset)),!o.node||!o.node.marks.some(e=>e.type===t)||(n=n||(null==(r=o.node.marks[0])?void 0:r.attrs),!O([...o.node.marks],t,n)))return;let i=o.index,s=e.start()+o.offset,a=i+1,l=s+o.node.nodeSize;for(;i>0&&N([...e.parent.child(i-1).marks],t,n);)i-=1,s-=e.parent.child(i).nodeSize;for(;a<e.parent.childCount&&N([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function P(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var I=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let s=P(e,r.schema),{doc:a,selection:l}=n,{$from:d,from:u,to:c}=l;if(o){let e=$(d,s,t);if(e&&e.from<=u&&e.to>=c){let t=i.Bs.create(a,e.from,e.to);n.setSelection(t)}}return!0},H=e=>t=>{let n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function R(e){return e instanceof i.Bs}function B(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function D(e,t=null){if(!t)return null;let n=i.Y1.atStart(e),r=i.Y1.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;let o=n.from,s=r.to;return"all"===t?i.Bs.create(e,B(0,o,s),B(e.content.size,o,s)):i.Bs.create(e,B(t,o,s),B(t,o,s))}function j(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function z(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var _=(e=null,t={})=>({editor:n,view:r,tr:o,dispatch:i})=>{t={scrollIntoView:!0,...t};let s=()=>{(z()||j())&&r.dom.focus(),requestAnimationFrame(()=>{!n.isDestroyed&&(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())})};if(r.hasFocus()&&null===e||!1===e)return!0;
1if(i&&null===e&&!R(n.state.selection))return s(),!0;let a=D(o.doc,e)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},V=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),W=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),K=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){let r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&K(r)}return e};function U(e){if("undefined"==typeof window)throw Error("[tiptap error]: there is no window object available, so this function cannot be used");let t=`<body>${e}</body>`;return K(new window.DOMParser().parseFromString(t,"text/html").body)}function q(e,t,n){if(e instanceof s.NB||e instanceof s.HY)return e;n={slice:!0,parseOptions:{},...n};let r="object"==typeof e&&null!==e,o="string"==typeof e;if(r)try{if(Array.isArray(e)&&e.length>0)return s.HY.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),q("",t,n)}if(o){if(n.errorOnInvalidContent){let r=!1,o="",i=new s.V_({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:e=>(r=!0,o="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?s.aw.fromSchema(i).parseSlice(U(e),n.parseOptions):s.aw.fromSchema(i).parse(U(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error("[tiptap error]: Invalid HTML content",{cause:Error(`Invalid element found: ${o}`)})}let r=s.aw.fromSchema(t);return n.slice?r.parseSlice(U(e),n.parseOptions).content:r.parse(U(e),n.parseOptions)}return q("",t,n)}var F=e=>!("type"in e),Y=(e,t,n)=>({tr:o,dispatch:a,editor:l})=>{var d;if(a){let a,u;n={parseOptions:l.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let c=e=>{l.emit("contentError",{editor:l,error:e,disableCollaboration:()=>{"collaboration"in l.storage&&"object"==typeof l.storage.collaboration&&l.storage.collaboration&&(l.storage.collaboration.isDisabled=!0)}})},p={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!l.options.enableContentCheck&&l.options.emitContentError)try{q(t,l.schema,{parseOptions:p,errorOnInvalidContent:!0})}catch(e){c(e)}try{a=q(t,l.schema,{parseOptions:p,errorOnInvalidContent:null!=(d=n.errorOnInvalidContent)?d:l.options.enableContentCheck})}catch(e){return c(e),!1}let{from:h,to:m}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},f=!0,g=!0;if((F(a)?a:[a]).forEach(e=>{e.check(),f=!!f&&e.isText&&0===e.marks.length,g=!!g&&e.isBlock}),h===m&&g){let{parent:e}=o.doc.resolve(h);!e.isTextblock||e.type.spec.code||e.childCount||(h-=1,m+=1)}if(f){if(Array.isArray(t))u=t.map(e=>e.text||"").join("");else if(t instanceof s.HY){let e="";t.forEach(t=>{t.text&&(e+=t.text)}),u=e}else u="object"==typeof t&&t&&t.text?t.text:t;o.insertText(u,h,m)}else{u=a;let e=o.doc.resolve(h),t=e.node(),n=0===e.parentOffset,r=t.isText||t.isTextblock,i=t.content.size>0;n&&r&&i&&(h=Math.max(0,h-1)),o.replaceWith(h,m,u)}n.updateSelection&&function(e,t,n){let o=e.steps.length-1;if(o<t)return;let s=e.steps[o];if(!(s instanceof r.Pu||s instanceof r.FC))return;let a=e.mapping.maps[o],l=0;a.forEach((e,t,n,r)=>{0===l&&(l=r)}),e.setSelection(i.Y1.near(e.doc.resolve(l),-1))}(o,o.steps.length-1,0),n.applyInputRules&&o.setMeta("applyInputRules",{from:h,text:u}),n.applyPasteRules&&o.setMeta("applyPasteRules",{from:h,text:u})}return!0},J=()=>({state:e,dispatch:t})=>(0,o.MI)(e,t),X=()=>({state:e,dispatch:t})=>(0,o.Ig)(e,t),G=()=>({state:e,dispatch:t})=>(0,o.al)(e,t),Q=()=>({state:e,dispatch:t})=>(0,o.Y_)(e,t),Z=()=>({state:e,dispatch:t,tr:n})=>{try{let o=(0,r.GJ)(e.doc,e.selection.$from.pos,-1);if(null==o)return!1;return n.join(o,2),t&&t(n),!0}catch{return!1}},ee=()=>({state:e,dispatch:t,tr:n})=>{try{let o=(0,r.GJ)(e.doc,e.selection.$from.pos,1);if(null==o)return!1;return n.join(o,2),t&&t(n),!0}catch{return!1}},et=()=>({state:e,dispatch:t})=>(0,o.rr)(e,t),en=()=>({state:e,dispatch:t})=>(0,o.cR)(e,t);function er(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var eo=e=>({editor:t,view:n,tr:r,dispatch:o})=>{let i=(function(e){let t,n,r,o;let i=e.split(/-(?!$)/),s=i[i.length-1];"Space"===s&&(s=" ");for(let e=0;e<i.length-1;e+=1){let s=i[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))z()||er()?o=!0:n=!0;else throw Error(`Unrecognized modifier name: ${s}`)}return t&&(s=`Alt-${s}`),n&&(s=`Ctrl-${s}`),o&&(s=`Meta-${s}`),r&&(s=`Shift-${s}`),s})(e).split(/-(?!$)/),s=i.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),a=new KeyboardEvent("keydown",{key:"Space"
1===s?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction(()=>{n.someProp("handleKeyDown",e=>e(n,a))});return null==l||l.steps.forEach(e=>{let t=e.map(r.mapping);t&&o&&r.maybeStep(t)}),!0};function ei(e,t,n={}){let{from:r,to:o,empty:i}=e.selection,s=t?w(t,e.schema):null,a=[];e.doc.nodesBetween(r,o,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);a.push({node:e,from:n,to:i})});let l=o-r,d=a.filter(e=>!s||s.name===e.node.type.name).filter(e=>L(e.node.attrs,n,{strict:!1}));return i?!!d.length:d.reduce((e,t)=>e+t.to-t.from,0)>=l}var es=(e,t={})=>({state:n,dispatch:r})=>{let i=w(e,n.schema);return!!ei(n,i,t)&&(0,o.xb)(n,r)},ea=()=>({state:e,dispatch:t})=>(0,o.X0)(e,t),el=e=>({state:t,dispatch:n})=>{let r=w(e,t.schema);return(0,a.IB)(r)(t,n)},ed=()=>({state:e,dispatch:t})=>(0,o.QK)(e,t);function eu(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function ec(e,t){let n="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var ep=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null,a=eu("string"==typeof e?e:e.name,r.schema);if(!a)return!1;"node"===a&&(i=w(e,r.schema)),"mark"===a&&(s=P(e,r.schema));let l=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{i&&i===e.type&&(l=!0,o&&n.setNodeMarkup(r,void 0,ec(e.attrs,t))),s&&e.marks.length&&e.marks.forEach(i=>{s===i.type&&(l=!0,o&&n.addMark(r,r+e.nodeSize,s.create(ec(i.attrs,t))))})})}),l},eh=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),em=()=>({tr:e,dispatch:t})=>{if(t){let t=new i.C1(e.doc);e.setSelection(t)}return!0},ef=()=>({state:e,dispatch:t})=>(0,o._M)(e,t),eg=()=>({state:e,dispatch:t})=>(0,o.o)(e,t),eb=()=>({state:e,dispatch:t})=>(0,o.N0)(e,t),ey=()=>({state:e,dispatch:t})=>(0,o.nw)(e,t),ek=()=>({state:e,dispatch:t})=>(0,o.U9)(e,t);function ev(e,t,n={},r={}){return q(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var eM=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:i,dispatch:s,commands:a})=>{let{doc:l}=i;if("full"!==r.preserveWhitespace){let a=ev(e,o.schema,r,{errorOnInvalidContent:null!=t?t:o.options.enableContentCheck});return s&&i.replaceWith(0,l.content.size,a).setMeta("preventUpdate",!n),!0}return s&&i.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:o.options.enableContentCheck})};function ew(e,t){let n=P(t,e.schema),{from:r,to:o,empty:i}=e.selection,s=[];i?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,e=>{s.push(...e.marks)});let a=s.find(e=>e.type.name===n.name);return a?{...a.attrs}:{}}function ex(e,t){let n=new r.wx(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function eC(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function eT(e,t){for(let n=e.depth;n>0;n-=1){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function eS(e){return t=>eT(t.$from,e)}function eE(e,t,n){return void 0===e.config[t]&&e.parent?eE(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?eE(e.parent,t,n):null}):e.config[t]}function eA(e){return e.map(e=>{let t={name:e.name,options:e.options,storage:e.storage},n=eE(e,"addExtensions",t);return n?[e,...eA(n())]:e}).flat(10)}function eL(e,t){let n=s.PW.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function eO(e){return"function"==typeof e}function eN(e,t,...n){return eO(e)?t?e.bind(t)(...n):e(...n):e}function e$(e){return{baseExtensions:e.filter(e=>"extension"===e.type),nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function eP(e){let t=[],{nodeExtensions:n,markExtensions:r}=e$(e),o=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};
1return e.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage,extensions:o},r=eE(e,"addGlobalAttributes",n);r&&r().forEach(e=>{e.types.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...i,...r}})})})})}),o.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage},r=eE(e,"addAttributes",n);r&&Object.entries(r()).forEach(([n,r])=>{let o={...i,...r};"function"==typeof(null==o?void 0:o.default)&&(o.default=o.default()),(null==o?void 0:o.isRequired)&&(null==o?void 0:o.default)===void 0&&delete o.default,t.push({type:e.name,name:n,attribute:o})})}),t}function eI(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if("class"===e){let r=t?String(t).split(" "):[],o=n[e]?n[e].split(" "):[],i=r.filter(e=>!o.includes(e));n[e]=[...o,...i].join(" ")}else if("style"===e){let r=t?t.split(";").map(e=>e.trim()).filter(Boolean):[],o=n[e]?n[e].split(";").map(e=>e.trim()).filter(Boolean):[],i=new Map;o.forEach(e=>{let[t,n]=e.split(":").map(e=>e.trim());i.set(t,n)}),r.forEach(e=>{let[t,n]=e.split(":").map(e=>e.trim());i.set(t,n)}),n[e]=Array.from(i.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else n[e]=t}),n},{})}function eH(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>eI(e,t),{})}function eR(e,t){return"style"in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;let o=t.reduce((e,t)=>{var r;let o=t.attribute.parseHTML?t.attribute.parseHTML(n):"string"!=typeof(r=n.getAttribute(t.name))?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):"true"===r||"false"!==r&&r;return null==o?e:{...e,[t.name]:o}},{});return{...r,...o}}}}function eB(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!("attrs"===e&&function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t))}function eD(e){var t,n;let r={};return!(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)&&"default"in((null==e?void 0:e.attribute)||{})&&(r.default=e.attribute.default),(null==(n=null==e?void 0:e.attribute)?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function ej(e){return e.sort((e,t)=>{let n=eE(e,"priority")||100,r=eE(t,"priority")||100;return n>r?-1:n<r?1:0})}function ez(e){var t;let n=ej(eA(e)),r=Array.from(new Set((t=n.map(e=>e.name)).filter((e,n)=>t.indexOf(e)!==n)));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(e=>`'${e}'`).join(", ")}]. This can lead to issues.`),n}function e_(e,t,n){let{from:r,to:o}=t,{blockSeparator:i="\n\n",textSerializers:s={}}=n||{},a="";return e.nodesBetween(r,o,(e,n,l,d)=>{var u;e.isBlock&&n>r&&(a+=i);let c=null==s?void 0:s[e.type.name];if(c)return l&&(a+=c({node:e,pos:n,parent:l,index:d,range:t})),!1;e.isText&&(a+=null==(u=null==e?void 0:e.text)?void 0:u.slice(Math.max(r,n)-n,o-n))}),a}function eV(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function eW(e,t){let n=eu("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){let n=w(t,e.schema),{from:r,to:o}=e.selection,i=[];e.doc.nodesBetween(r,o,e=>{i.push(e)});let s=i.reverse().find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}(e,t):"mark"===n?ew(e,t):{}}function eK(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,o)=>{let i=[];if(e.ranges.length)e.forEach((e,t)=>{i.push({from:e,to:t})});else{let{from:e,to:t}=n[o];if(void 0===e||void 0===t)return;i.push({from:e,to:t})}i.forEach(({from:e,to:n})=>{let i=t.slice(o).map(e,-1),s=t.slice(o).map(n),a=t.invert().map(i,-1),l=t.invert().map(s);r.push({oldRange:{from:a,to:l},newRange:{from:i,to:s}})})}),function(e){let t=function(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}(e);return 1===t.length?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}(r)}
1function eU(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let o=$(n.resolve(e),t.type);o&&r.push({mark:t,...o})}):n.nodesBetween(e,t,(e,t)=>{e&&(null==e?void 0:e.nodeSize)!==void 0&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var eq=(e,t,n,r=20)=>{let o=e.doc.resolve(n),i=r,s=null;for(;i>0&&null===s;){let e=o.node(i);(null==e?void 0:e.type.name)===t?s=e:i-=1}return[s,i]};function eF(e,t){return t.nodes[e]||t.marks[e]||null}function eY(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return!!r&&r.attribute.keepOnSplit}))}var eJ=(e,t=500)=>{let n="",r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,o,i)=>{var s,a;let l=(null==(a=(s=e.type.spec).toText)?void 0:a.call(s,{node:e,pos:t,parent:o,index:i}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?l:l.slice(0,Math.max(0,r-t))}),n};function eX(e,t,n={}){let{empty:r,ranges:o}=e.selection,i=t?P(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!i||i.name===e.type.name).find(e=>L(e.attrs,n,{strict:!1}));let s=0,a=[];if(o.forEach(({$from:t,$to:n})=>{let r=t.pos,o=n.pos;e.doc.nodesBetween(r,o,(e,t)=>{if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);s+=i-n,a.push(...e.marks.map(e=>({mark:e,from:n,to:i})))})}),0===s)return!1;let l=a.filter(e=>!i||i.name===e.mark.type.name).filter(e=>L(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),d=a.filter(e=>!i||e.mark.type!==i&&e.mark.type.excludes(i)).reduce((e,t)=>e+t.to-t.from,0);return(l>0?l+d:l)>=s}var eG=(e,t)=>{let{$from:n,$to:r,$anchor:o}=e.selection;if(t){let n=eS(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return o.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2)&&n.pos===r.pos},eQ=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0)&&t.pos===n.pos};function eZ(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function e0(e,t){let{nodeExtensions:n}=e$(t),r=n.find(t=>t.name===e);if(!r)return!1;let o={name:r.name,options:r.options,storage:r.storage},i=eN(eE(r,"group",o));return"string"==typeof i&&i.split(" ").includes("list")}function e1(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return/^\s*$/m.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach(e=>{!1!==r&&(e1(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function e2(e){return e instanceof i.qv}var e3=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function e6(e,t){let n=t.mapping.mapResult(e.position);return{position:new e3(n.pos),mapResult:n}}function e9(e){return new e3(e)}var e4=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let{selection:i}=n,{empty:s,ranges:a}=i,l=P(e,r.schema);if(o){if(s){let e=ew(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach(e=>{let o=e.$from.pos,i=e.$to.pos;r.doc.nodesBetween(o,i,(e,r)=>{let s=Math.max(r,o),a=Math.min(r+e.nodeSize,i);e.marks.find(e=>e.type===l)?e.marks.forEach(e=>{l===e.type&&n.addMark(s,a,l.create({...e.attrs,...t}))}):n.addMark(s,a,l.create(t))})})}return function(e,t,n){var r;let{selection:o}=t,i=null;if(R(o)&&(i=o.$cursor),i){let t=null!=(r=e.storedMarks)?r:i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:s}=o;return s.some(({$from:t,$to:r})=>{let o=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(o)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),i=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));o=t&&i}return!o}),o})}(r,n,l)},e8=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),e5=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let s;let a=w(e,n.schema);return(n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),a.isTextblock)?i().command(({commands:e})=>!!(0,o.uJ)(a,{...s,...t})(n)||e.clearNodes()).command(({state:e})=>(0,o.uJ)(a,{...s,...t})(e,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},e7=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=B(e,0,n.content.size),o=i.qv.create(n,r);t.setSelection(o)}return!0},te=(e,t)=>
1({tr:n,state:r,dispatch:o})=>{let i,s;let{selection:a}=r;return"number"==typeof t?(i=t,s=t):t&&"from"in t&&"to"in t?(i=t.from,s=t.to):(i=a.from,s=a.to),o&&n.doc.nodesBetween(i,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},tt=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:o}="number"==typeof e?{from:e,to:e}:e,s=i.Bs.atStart(n).from,a=i.Bs.atEnd(n).to,l=B(r,s,a),d=B(o,s,a),u=i.Bs.create(n,l,d);t.setSelection(u)}return!0},tn=e=>({state:t,dispatch:n})=>{let r=w(e,t.schema);return(0,a.bw)(r)(t,n)};function tr(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}var to=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:o,editor:s})=>{let{selection:a,doc:l}=t,{$from:d,$to:u}=a,c=eY(s.extensionManager.attributes,d.node().type.name,d.node().attrs);if(a instanceof i.qv&&a.node.isBlock)return!!(d.parentOffset&&(0,r.Ax)(l,d.pos))&&(o&&(e&&tr(n,s.extensionManager.splittableMarks),t.split(d.pos).scrollIntoView()),!0);if(!d.parent.isBlock)return!1;let p=u.parentOffset===u.parent.content.size,h=0===d.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(d.node(-1).contentMatchAt(d.indexAfter(-1))),m=p&&h?[{type:h,attrs:c}]:void 0,f=(0,r.Ax)(t.doc,t.mapping.map(d.pos),1,m);if(!m&&!f&&(0,r.Ax)(t.doc,t.mapping.map(d.pos),1,h?[{type:h}]:void 0)&&(f=!0,m=h?[{type:h,attrs:c}]:void 0),o){if(f&&(a instanceof i.Bs&&t.deleteSelection(),t.split(t.mapping.map(d.pos),1,m),h&&!p&&!d.parentOffset&&d.parent.type!==h)){let e=t.mapping.map(d.before()),n=t.doc.resolve(e);d.node(-1).canReplaceWith(n.index(),n.index()+1,h)&&t.setNodeMarkup(t.mapping.map(d.before()),h)}e&&tr(n,s.extensionManager.splittableMarks),t.scrollIntoView()}return f},ti=(e,t={})=>({tr:n,state:o,dispatch:a,editor:l})=>{var d;let u=w(e,o.schema),{$from:c,$to:p}=o.selection,h=o.selection.node;if(h&&h.isBlock||c.depth<2||!c.sameParent(p))return!1;let m=c.node(-1);if(m.type!==u)return!1;let f=l.extensionManager.attributes;if(0===c.parent.content.size&&c.node(-1).childCount===c.indexAfter(-1)){if(2===c.depth||c.node(-3).type!==u||c.index(-2)!==c.node(-2).childCount-1)return!1;if(a){let e=s.HY.empty,r=c.index(-1)?1:c.index(-2)?2:3;for(let t=c.depth-r;t>=c.depth-3;t-=1)e=s.HY.from(c.node(t).copy(e));let o=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,a={...eY(f,c.node().type.name,c.node().attrs),...t},l=(null==(d=u.contentMatch.defaultType)?void 0:d.createAndFill(a))||void 0;e=e.append(s.HY.from(u.createAndFill(null,l)||void 0));let p=c.before(c.depth-(r-1));n.replace(p,c.after(-o),new s.p2(e,4-r,0));let h=-1;n.doc.nodesBetween(p,n.doc.content.size,(e,t)=>{if(h>-1)return!1;e.isTextblock&&0===e.content.size&&(h=t+1)}),h>-1&&n.setSelection(i.Bs.near(n.doc.resolve(h))),n.scrollIntoView()}return!0}let g=p.pos===c.end()?m.contentMatchAt(0).defaultType:null,b={...eY(f,m.type.name,m.attrs),...t},y={...eY(f,c.node().type.name,c.node().attrs),...t};if(n.delete(c.pos,p.pos),!(0,r.Ax)(n.doc,c.pos,2))return!1;if(a){let{selection:e,storedMarks:t}=o,{splittableMarks:r}=l.extensionManager,i=t||e.$to.parentOffset&&e.$from.marks();if(n.split(c.pos,2,g?[{type:u,attrs:b},{type:g,attrs:y}]:[{type:u,attrs:b}]).scrollIntoView(),!i||!a)return!0;let s=i.filter(e=>r.includes(e.type.name));n.ensureMarks(s)}return!0},ts=(e,t)=>{let n=eS(e=>e.type===t)(e.selection);if(!n)return!0;let o=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===o)return!0;let i=e.doc.nodeAt(o);return!(n.node.type===(null==i?void 0:i.type)&&(0,r.Mn)(e.doc,n.pos))||(e.join(n.pos),!0)},ta=(e,t)=>{let n=eS(e=>e.type===t)(e.selection);if(!n)return!0;let o=e.doc.resolve(n.start).after(n.depth);if(void 0===o)return!0;let i=e.doc.nodeAt(o);return!(n.node.type===(null==i?void 0:i.type)&&(0,r.Mn)(e.doc,o))||(e.join(o),!0)},tl=(e,t,n,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:l,commands:d,can:u})=>{let{extensions:c,splittableMarks:p}=o.extensionManager,h=w(e,s.schema),m=w(t,s.schema),{selection:f,storedMarks:g}=s,{$from:b,$to:y}=f,k=b.blockRange(y),v=g||f.$to.parentOffset&&f.$from.marks();if(!k)return!1;let M=eS(e=>
1e0(e.type.name,c))(f);if(k.depth>=1&&M&&k.depth-M.depth<=1){if(M.node.type===h)return d.liftListItem(m);if(e0(M.node.type.name,c)&&h.validContent(M.node.content)&&a)return l().command(()=>(i.setNodeMarkup(M.pos,h),!0)).command(()=>ts(i,h)).command(()=>ta(i,h)).run()}return n&&v&&a?l().command(()=>{let e=u().wrapInList(h,r),t=v.filter(e=>p.includes(e.type.name));return i.ensureMarks(t),!!e||d.clearNodes()}).wrapInList(h,r).command(()=>ts(i,h)).command(()=>ta(i,h)).run():l().command(()=>!!u().wrapInList(h,r)||d.clearNodes()).wrapInList(h,r).command(()=>ts(i,h)).command(()=>ta(i,h)).run()},td=(e,t={},n={})=>({state:r,commands:o})=>{let{extendEmptyMarkRange:i=!1}=n,s=P(e,r.schema);return eX(r,s,t)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,t)},tu=(e,t,n={})=>({state:r,commands:o})=>{let i;let s=w(e,r.schema),a=w(t,r.schema),l=ei(r,s,n);return(r.selection.$anchor.sameParent(r.selection.$head)&&(i=r.selection.$anchor.parent.attrs),l)?o.setNode(a,i):o.setNode(s,{...i,...n})},tc=(e,t={})=>({state:n,commands:r})=>{let o=w(e,n.schema);return ei(n,o,t)?r.lift(o):r.wrapIn(o,t)},tp=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let o;let i=n[r];if(i.spec.isInputRules&&(o=i.getState(e))){if(t){let t=e.tr,n=o.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(o.text){let n=t.doc.resolve(o.from).marks();t.replaceWith(o.from,o.to,e.schema.text(o.text,n))}else t.delete(o.from,o.to)}return!0}}return!1},th=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:o}=n;return!!r||(t&&o.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0)},tm=(e,t={})=>({tr:n,state:r,dispatch:o})=>{var i;let{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=P(e,r.schema),{$from:d,empty:u,ranges:c}=a;if(!o)return!0;if(u&&s){let{from:e,to:t}=a,r=null==(i=d.marks().find(e=>e.type===l))?void 0:i.attrs,o=$(d,l,r);o&&(e=o.from,t=o.to),n.removeMark(e,t,l)}else c.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,l)});return n.removeStoredMark(l),!0},tf=e=>({tr:t,state:n,dispatch:r})=>{let o,i;let{selection:s}=n;return"number"==typeof e?(o=e,i=e):e&&"from"in e&&"to"in e?(o=e.from,i=e.to):(o=s.from,i=s.to),r&&t.doc.nodesBetween(o,i,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},tg=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null,a=eu("string"==typeof e?e:e.name,r.schema);if(!a)return!1;"node"===a&&(i=w(e,r.schema)),"mark"===a&&(s=P(e,r.schema));let l=!1;return n.selection.ranges.forEach(e=>{let a,d,u,c;let p=e.$from.pos,h=e.$to.pos;n.selection.empty?r.doc.nodesBetween(p,h,(e,t)=>{i&&i===e.type&&(l=!0,u=Math.max(t,p),c=Math.min(t+e.nodeSize,h),a=t,d=e)}):r.doc.nodesBetween(p,h,(e,r)=>{r<p&&i&&i===e.type&&(l=!0,u=Math.max(r,p),c=Math.min(r+e.nodeSize,h),a=r,d=e),r>=p&&r<=h&&(i&&i===e.type&&(l=!0,o&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),s&&e.marks.length&&e.marks.forEach(i=>{if(s===i.type&&(l=!0,o)){let o=Math.max(r,p),a=Math.min(r+e.nodeSize,h);n.addMark(o,a,s.create({...i.attrs,...t}))}}))}),d&&(void 0!==a&&o&&n.setNodeMarkup(a,void 0,{...d.attrs,...t}),s&&d.marks.length&&d.marks.forEach(e=>{s===e.type&&o&&n.addMark(u,c,s.create({...e.attrs,...t}))}))}),l},tb=(e,t={})=>({state:n,dispatch:r})=>{let i=w(e,n.schema);return(0,o.ym)(i,t)(n,r)},ty=(e,t={})=>({state:n,dispatch:r})=>{let o=w(e,n.schema);return(0,a.KI)(o,t)(n,r)},tk=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},tv=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=null==(t=e.undoable)||t}},tM=(e,t)=>{if(A(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function tw(e){var t;let{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=e,{view:l}=n;if(l.composing)return!1;let d=l.state.doc.resolve(r);if(d.parent.type.spec.code||(null==(t=d.nodeBefore||d.nodeAfter)?void 0:t.marks.find(e=>e.type.spec.code)))return!1;
1let u=!1,c=eJ(d)+i;return s.forEach(e=>{if(u)return;let t=tM(c,e.find);if(!t)return;let s=l.state.tr,d=p({state:l.state,transaction:s}),m={from:r-(t[0].length-i.length),to:o},{commands:f,chain:g,can:b}=new h({editor:n,state:d});null!==e.handler({state:d,range:m,match:t,commands:f,chain:g,can:b})&&s.steps.length&&(e.undoable&&s.setMeta(a,{transform:s,from:r,to:o,text:i}),l.dispatch(s),u=!0)}),u}function tx(e){return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}var tC=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...eN(eE(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...eN(eE(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>(function e(t,n){let r={...t};return tx(t)&&tx(n)&&Object.keys(n).forEac
1h(o=>{tx(n[o])&&tx(t[o])?r[o]=e(t[o],n[o]):r[o]=n[o]}),r})(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},tT=class e extends tC{constructor(){super(...arguments),this.type="mark"}static create(t={}){return new e("function"==typeof t?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let o=r.marks();if(!o.find(e=>(null==e?void 0:e.type.name)===t.name))return!1;let i=o.find(e=>(null==e?void 0:e.type.name)===t.name);return i&&n.removeStoredMark(i),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},tS=class{constructor(e){this.find=e.find,this.handler=e.handler}},tE=(e,t,n)=>{if(A(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n}):[]},tA=null,tL=e=>{var t;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n},tO=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=ez(e),this.schema=function(e,t){var n;let r=eP(e),{nodeExtensions:o,markExtensions:i}=e$(e),a=null==(n=o.find(e=>eE(e,"topNode")))?void 0:n.name,l=Object.fromEntries(o.map(n=>{let o=r.filter(e=>e.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:t},s=eB({...e.reduce((e,t)=>{let r=eE(t,"extendNodeSchema",i);return{...e,...r?r(n):{}}},{}),content:eN(eE(n,"content",i)),marks:eN(eE(n,"marks",i)),group:eN(eE(n,"group",i)),inline:eN(eE(n,"inline",i)),atom:eN(eE(n,"atom",i)),selectable:eN(eE(n,"selectable",i)),draggable:eN(eE(n,"draggable",i)),code:eN(eE(n,"code",i)),whitespace:eN(eE(n,"whitespace",i)),linebreakReplacement:eN(eE(n,"linebreakReplacement",i)),defining:eN(eE(n,"defining",i)),isolating:eN(eE(n,"isolating",i)),attrs:Object.fromEntries(o.map(eD))}),a=eN(eE(n,"parseHTML",i));a&&(s.parseDOM=a.map(e=>eR(e,o)));let l=eE(n,"renderHTML",i);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:eH(e,o)}));let d=eE(n,"renderText",i);return d&&(s.toText=d),[n.name,s]})),d=Object.fromEntries(i.map(n=>{let o=r.filter(e=>e.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:t},s=eB({...e.reduce((e,t)=>{let r=eE(t,"extendMarkSchema",i);return{...e,...r?r(n):{}}},{}),inclusive:eN(eE(n,"inclusive",i)),excludes:eN(eE(n,"excludes",i)),group:eN(eE(n,"group",i)),spanning:eN(eE(n,"spanning",i)),code:eN(eE(n,"code",i)),attrs:Object.fromEntries(o.map(eD))}),a=eN(eE(n,"parseHTML",i));a&&(s.parseDOM=a.map(e=>eR(e,o)));let l=eE(n,"renderHTML",i);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:eH(e,o)})),[n.name,s]}));return new s.V_({topNode:a,nodes:l,marks:d})}(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:eF(t.name,this.schema)},r=eE(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){let{editor:e}=this;return ej([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:eF(t.name,this.schema)},r=[],o=eE(t,"addKeyboardShortcuts",n),a={};if("mark"===t.type&&eE(t,"exitable",n)&&(a.ArrowRight=()=>tT.handleExit({editor:e,mark:t})),o){let t=Object.fromEntries(Object.entries(o()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let l=(0,d.h)(a);r.push(l);let u=eE(t,"addInputRules",n);if(eZ(t,e.options.enableInputRules)&&u){let t=u();if(t&&t.length){let n=function(e){let{editor:t,rules:n}=e,r=new i.Sy({state:{init:()=>null,apply(e,o,i){let a=e.getMeta(r);if(a)return a;let l=e.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:e}=l;"string"==typeof e||(e=eL(s.HY.from(e),i.schema));let{from:o}=l,a=o+e.length;tw({editor:t,from:o,to:a,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:o}},props:{handleTextInput:(e,o,i,s)=>tw({editor:t,from:o,to:i,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:o}=e.state.selection;o&&tw({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(e,o){if("Enter"!==o.key)return!1;let{$cursor:i}=e.state.selection;return!!i&&tw({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),o=Array.isArray(n)?n:[n];r.push(...o)}}let c=eE(t,"addPasteRules",n);if(eZ(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=function(e){let t;let{editor:n,rules:r}=e,o=null,a=!1,l=!1,d="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{t="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{t=null}let u=({state:e,from:r,to:o,rule:i,pasteEvt:s})=>{let a=e.tr;if(function(e){let{editor:t,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:a}=e,{commands:l,chain:d,can:u}=new h({editor:t,state:n}),c=[];return n.doc.nodesBetween(r,o,(e,t)=>{var p,h,m,f,g;if((null==(h=null==(p=e.type)?void 0:p.spec)?void 0:h.code)||!(e.isText||e.isTextblock||e.isInline))return;let b=null!=(g=null!=(f=null==(m=e.content)?void 0:m.size)?f:e.nodeSize)?g:0,y=Math.max(r,t),k=Math.min(o,t+b);y>=k||tE(e.isText?e.text||"":e.textBetween(y-t,k-t,void 0,""),i.find,s).forEac
1h(e=>{if(void 0===e.index)return;let t=y+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},p=i.handler({state:n,range:o,match:e,commands:l,chain:d,can:u,pasteEvent:s,dropEvent:a});c.push(p)})}),c.every(e=>null!==e)}({editor:n,state:p({state:e,transaction:a}),from:Math.max(r-1,0),to:o.b-1,rule:i,pasteEvent:s,dropEvent:t})&&a.steps.length){try{t="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{t=null}return d="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,a}};return r.map(e=>new i.Sy({view(e){let t=t=>{var r;(o=(null==(r=e.dom.parentElement)?void 0:r.contains(t.target))?e.dom.parentElement:null)&&(tA=n)},r=()=>{tA&&(tA=null)};return window.addEventListener("dragstart",t),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",t),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,n)=>{if(l=o===e.dom.parentElement,t=n,!l){let e=tA;(null==e?void 0:e.isEditable)&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{var n;let r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return d=t,a=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{let o=t[0],i="paste"===o.getMeta("uiEvent")&&!a,c="drop"===o.getMeta("uiEvent")&&!l,p=o.getMeta("applyPasteRules"),h=!!p;if(!i&&!c&&!h)return;if(h){let{text:t}=p;"string"==typeof t||(t=eL(s.HY.from(t),r.schema));let{from:n}=p,o=n+t.length;return u({rule:e,state:r,from:n,to:{b:o},pasteEvt:tL(t)})}let m=n.doc.content.findDiffStart(r.doc.content),f=n.doc.content.findDiffEnd(r.doc.content);if("number"==typeof m&&f&&m!==f.b)return u({rule:e,state:r,from:m,to:f,pasteEvt:d})}}))}({editor:e,rules:t});r.push(...n)}}let m=eE(t,"addProseMirrorPlugins",n);if(m){let e=m();r.push(...e)}return r})}get attributes(){return eP(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=e$(this.extensions);return Object.fromEntries(t.filter(e=>!!eE(e,"addNodeView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:w(t.name,this.schema)},o=eE(t,"addNodeView",r);if(!o)return[];let i=o();return i?[t.name,(r,o,s,a,l)=>{let d=eH(r,n);return i({node:r,view:o,getPos:s,decorations:a,innerDecorations:l,editor:e,extension:t,HTMLAttributes:d})}]:[]}))}get markViews(){let{editor:e}=this,{markExtensions:t}=e$(this.extensions);return Object.fromEntries(t.filter(e=>!!eE(e,"addMarkView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:P(t.name,this.schema)},o=eE(t,"addMarkView",r);return o?[t.name,(r,i,s)=>{let a=eH(r,n);return o()({mark:r,view:i,inline:s,editor:e,extension:t,HTMLAttributes:a,updateAttributes:t=>{t4(r,e,t)}})}]:[]}))}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{var t;let n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:eF(e.name,this.schema)};"mark"===e.type&&(null==(t=eN(eE(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name);let r=eE(e,"onBeforeCreate",n),o=eE(e,"onCreate",n),i=eE(e,"onUpdate",n),s=eE(e,"onSelectionUpdate",n),a=eE(e,"onTransaction",n),l=eE(e,"onFocus",n),d=eE(e,"onBlur",n),u=eE(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),o&&this.editor.on("create",o),i&&this.editor.on("update",i),s&&this.editor.on("selectionUpdate",s),a&&this.editor.on("transaction",a),l&&this.editor.on("focus",l),d&&this.editor.on("blur",d),u&&this.editor.on("destroy",u)})}};tO.resolve=ez,tO.sort=ej,tO.flatten=eA,c({},{ClipboardTextSerializer:()=>t$,Commands:()=>tP,Delete:()=>tI,Drop:()=>tH,Editable:()=>tR,FocusEvents:()=>tD,Keymap:()=>tj,Paste:()=>tz,Tabindex:()=>t_,TextDirection:()=>tV,focusEventsPluginKey:()=>tB});var tN=class e extends tC{constructor(){super(...arguments),this.type="extension"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}}
1,t$=tN.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new i.Sy({key:new i.H$("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,{ranges:i}=o,s=Math.min(...i.map(e=>e.$from.pos)),a=Math.max(...i.map(e=>e.$to.pos)),l=eV(n);return e_(r,{from:s,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),tP=tN.create({name:"commands",addCommands:()=>({...m})}),tI=tN.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,o,i;let s=()=>{var n,o,i,s;if(null!=(s=null==(i=null==(o=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:o.filterTransaction)?void 0:i.call(o,e))?s:e.getMeta("y-sync$"))return;let a=ex(e.before,[e,...t]);eK(a).forEach(t=>{a.mapping.mapResult(t.oldRange.from).deletedAfter&&a.mapping.mapResult(t.oldRange.to).deletedBefore&&a.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let o=r+n.nodeSize-2,i=t.oldRange.from<=r&&o<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:o,newFrom:a.mapping.map(r),newTo:a.mapping.map(o),deletedRange:t.oldRange,newRange:t.newRange,partial:!i,editor:this.editor,transaction:e,combinedTransform:a})})});let l=a.mapping;a.steps.forEach((t,n)=>{var o,i;if(t instanceof r.xu){let r=l.slice(n).map(t.from,-1),s=l.slice(n).map(t.to),d=l.invert().map(r,-1),u=l.invert().map(s),c=null==(o=a.doc.nodeAt(r-1))?void 0:o.marks.some(e=>e.eq(t.mark)),p=null==(i=a.doc.nodeAt(s))?void 0:i.marks.some(e=>e.eq(t.mark));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:d,to:u},newRange:{from:r,to:s},partial:!!(p||c),editor:this.editor,transaction:e,combinedTransform:a})}})};null==(i=null==(o=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:o.async)||i?setTimeout(s,0):s()}}),tH=tN.create({name:"drop",addProseMirrorPlugins(){return[new i.Sy({key:new i.H$("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),tR=tN.create({name:"editable",addProseMirrorPlugins(){return[new i.Sy({key:new i.H$("editable"),props:{editable:()=>this.editor.options.editable}})]}}),tB=new i.H$("focusEvents"),tD=tN.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;return[new i.Sy({key:tB,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),tj=tN.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:o,$anchor:s}=n,{pos:a,parent:l}=s,d=s.parent.isTextblock&&a>0?t.doc.resolve(a-1):s,u=d.parent.type.spec.isolating,c=s.pos-s.parentOffset,p=u&&1===d.parent.childCount?c===s.pos:i.Y1.atStart(r).from===a;return!!o&&!!l.type.isTextblock&&!l.textContent.length&&!!p&&(!p||"paragraph"!==s.parent.type.name)&&e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return z()||er()?o:r},addProseMirrorPlugins(){return[new i.Sy({key:new i.H$("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta("composition")))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),o=e.some(e=>e.getMeta("preventClearDocument"));if(!r||o)return;let{empty:s,from:a,to:l}=t.selection,d=i.Y1.atStart(t.doc).from,u=i.Y1.atEnd(t.doc).to;
1if(s||!(a===d&&l===u)||!e1(n.doc))return;let c=n.tr,m=p({state:n,transaction:c}),{commands:f}=new h({editor:this.editor,state:m});if(f.clearNodes(),c.steps.length)return c}})]}}),tz=tN.create({name:"paste",addProseMirrorPlugins(){return[new i.Sy({key:new i.H$("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),t_=tN.create({name:"tabindex",addProseMirrorPlugins(){return[new i.Sy({key:new i.H$("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),tV=tN.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=e$(this.extensions);return[{types:e.filter(e=>"text"!==e.name).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute("dir");return t&&("ltr"===t||"rtl"===t||"auto"===t)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new i.Sy({key:new i.H$("textDirection"),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),tW=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return null!=(e=this.actualDepth)?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(0===this.content.size){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(0===this.depth)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let o=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,s=this.pos+r+(i?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let a=this.resolvedPos.doc.resolve(s);if(!o&&a.depth<=this.depth)return;let l=new e(a,this.editor,o,o?n:null);o&&(l.actualDepth=this.depth+1),t.push(new e(a,this.editor,o,o?n:null))}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e){if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let o=n[r];if(e[o]!==t[o])break}}else n=r}r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||0===this.children.length)return r;let o=Object.keys(t);return this.children.forEach(i=>{(!n||!(r.length>0))&&(i.node.type.name===e&&o.every(e=>t[e]===i.node.attrs[e])&&r.push(i),n&&r.length>0||(r=r.concat(i.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},tK=`.ProseMirror {
2  position: relative;
3}
4
5.ProseMirror {
6  word-wrap: break-word;
7  white-space: pre-wrap;
8  white-space: break-spaces;
9  -webkit-font-variant-ligatures: none;
10  font-variant-ligatures: none;
11  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
12}
13
14.ProseMirror [contenteditable="false"] {
15  white-space: normal;
16}
17
18.ProseMirror [contenteditable="false"] [contenteditable="true"] {
19  white-space: pre-wrap;
20}
21
22.ProseMirror pre {
23  white-space: pre-wrap;
24}
25
26img.ProseMirror-separator {
27  display: inline !important;
28  border: none !important;
29  margin: 0 !important;
30  width: 0 !important;
31  height: 0 !important;
32}
33
34.ProseMirror-gapcursor {
35  display: none;
36  pointer-events: none;
37  position: absolute;
38  margin: 0;
39}
40
41.ProseMirror-gapcursor:after {
42  content: "";
43  display: block;
44  position: absolute;
45  top: -2px;
46  width: 20px;
47  border-top: 1px solid black;
48  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
49}
50
51@keyframes ProseMirror-cursor-blink {
52  to {
53    visibility: hidden;
54  }
55}
56
57.ProseMirror-hideselection *::selection {
58  background: transparent;
59}
60
61.ProseMirror-hideselection *::-moz-selection {
62  background: transparent;
63}
64
65.ProseMirror-hideselection * {
66  caret-color: transparent;
67}
68
69.ProseMirror-focused .ProseMirror-gapcursor {
70  display: block;
71}`,tU=class extends tk{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:"undefined"!=typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:e6,createMappablePosition:e9},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on("paste",({event:e,slice:t})=>this.options.onPaste(e,t)),this.on("delete",this.options.onDelete);let t=this.createDoc(),n=D(t,this.options.autofocus);this.editorState=i.yy.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if("undefined"==typeof document)throw Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let e=this.editorView.dom;(null==e?void 0:e.editor)&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{"function"==typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&"undefined"!=typeof document&&(this.css=function(e,t,n){let r=document.querySelector("style[data-tiptap-style]");if(null!==r)return r;let o=document.createElement("style");return t&&o.setAttribute("nonce",t),o.setAttribute("data-tiptap-style",""),o.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(o),o}(tK,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}
71),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if("state"===t)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=eO(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t="string"==typeof e?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;let n=[...this.options.enableCoreExtensions?[tR,t$.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),tP,tD,tj,t_,tH,tz,tI,tV.configure({direction:this.options.textDirection})].filter(e=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[e.name]):[],...this.options.extensions].filter(e=>["extension","node","mark"].includes(null==e?void 0:e.type));this.extensionManager=new tO(n,this)}createCommandManager(){this.commandManager=new h({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=ev(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>"collaboration"!==e.name),this.createExtensionManager()}}),e=ev(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){var t;this.editorView=new l.tk(e,{...this.options.editorProps,attributes:{role:"textbox",...null==(t=this.options.editorProps)?void 0:t.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.prependClass(),this.injectCSS(),this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>{var t;return null==(t=this.capturedTransaction)?void 0:t.step(e)});return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),o=n.includes(e),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!o)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});let s=n.findLast(e=>e.getMeta("focus")||e.getMeta("blur")),a=null==s?void 0:s.getMeta("focus"),l=null==s?void 0:s.getMeta("blur");
71a&&this.emit("focus",{editor:this,event:a.event,transaction:s}),l&&this.emit("blur",{editor:this,event:l.event,transaction:s}),e.getMeta("preventUpdate")||!n.some(e=>e.docChanged)||i.doc.eq(t.doc)||this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return eW(this.state,e)}isActive(e,t){let n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return ei(e,null,n)||eX(e,null,n);let r=eu(t,e.schema);return"node"===r?ei(e,t,n):"mark"===r&&eX(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return eL(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){let n={from:0,to:e.content.size};return e_(e,n,t)}(this.state.doc,{blockSeparator:t,textSerializers:{...eV(this.schema),...n}})}get isEmpty(){return e1(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,t;return null==(t=null==(e=this.editorView)?void 0:e.isDestroyed)||t}$node(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(e,t))||null}$pos(e){return new tW(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}};function tq(e){return new tv({find:e.find,handler:({state:t,range:n,match:r})=>{let o=eN(e.getAttributes,void 0,r);if(!1===o||null===o)return null;let{tr:i}=t,s=r[r.length-1],a=r[0];if(s){let r=a.search(/\S/),l=n.from+a.indexOf(s),d=l+s.length;if(eU(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>l).length)return null;d<n.to&&i.delete(d,n.to),l>n.from&&i.delete(n.from+r,l);let u=n.from+r+s.length;i.addMark(n.from+r,u,e.type.create(o||{})),i.removeStoredMark(e.type)}},undoable:e.undoable})}function tF(e){return new tv({find:e.find,handler:({state:t,range:n,match:r})=>{let o=eN(e.getAttributes,void 0,r)||{},{tr:i}=t,s=n.from,a=n.to,l=e.type.create(o);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>a?e=a:a=e+r[1].length;let t=r[0][r[0].length-1];i.insertText(t,s+r[0].length-1),i.replaceWith(e,a,l)}else if(r[0]){let t=e.type.isInline?s:s-1;i.insert(t,e.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()},undoable:e.undoable})}function tY(e){return new tv({find:e.find,handler:({state:t,range:n,match:r})=>{let o=t.doc.resolve(n.from),i=eN(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)},undoable:e.undoable})}function tJ(e){return new tv({find:e.find,handler:({state:t,range:n,match:o,chain:i})=>{let s=eN(e.getAttributes,void 0,o)||{},a=t.tr.delete(n.from,n.to),l=a.doc.resolve(n.from).blockRange(),d=l&&(0,r.nd)(l,e.type,s);if(!d)return null;if(a.wrap(l,d),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:o}=e.editor.extensionManager,i=r||n.$to.parentOffset&&n.$from.marks();if(i){let e=i.filter(e=>o.includes(e.type.name));a.ensureMarks(e)}}if(e.keepAttributes){let t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";i().updateAttributes(t,s).run()}let u=a.doc.resolve(n.from-1).nodeBefore;u&&u.type===e.type&&(0,r.Mn)(a.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(o,u))&&a.join(n.from-1)},undoable:e.undoable})}function tX(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof i.qv){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let o=r.depth;for(;o>=0;){let e=r.index(o);if(r.node(o).contentMatchAt(e).matchType(t))return!0;o-=1}return!1}function tG(e){if(!(null==e?void 0:e.trim()))return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),o=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(o){let e=o.map(e=>e.trim().slice(1));t.class=e.join(" ")}let i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(t.id=i[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{var o;let i=n[parseInt((null==(o=r.match(/__QUOTED_(\d+)__/))?void 0:o[1])||"0",10)];i&&(t[e]=i.slice(1,-1))});
71let s=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return s&&s.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function tQ(e){if(!e||0===Object.keys(e).length)return"";let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))}),t.join(" ")}function tZ(e){let{nodeName:t,name:n,parseAttributes:r=tG,serializeAttributes:o=tQ,defaultAttributes:i={},requiredAttributes:s=[],allowedAttributes:a}=e,l=n||t,d=e=>{if(!a)return e;let t={};return a.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...i,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;let n=RegExp(`^:::${l}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,o){let i=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),a=e.match(i);if(!a)return;let d=r(a[1]||"");if(!s.find(e=>!(e in d)))return{type:t,raw:a[0],attributes:d}}},renderMarkdown:e=>{let t=o(d(e.attrs||{})),n=t?` {${t}}`:"";return`:::${l}${n} :::`}}}function t0(e){let{nodeName:t,name:n,getContent:r,parseAttributes:o=tG,serializeAttributes:i=tQ,defaultAttributes:s={},content:a="block",allowedAttributes:l}=e,d=n||t,u=e=>{if(!l)return e;let t={};return l.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let o;if(r){let t=r(e);o="string"==typeof t?[{type:"text",text:t}]:t}else o="block"===a?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let i={...s,...e.attributes};return n.createNode(t,i,o)},markdownTokenizer:{name:t,level:"block",start(e){var t;let n=RegExp(`^:::${d}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var i;let s=RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),l=e.match(s);if(!l)return;let[u,c=""]=l,p=o(c),h=1,m=u.length,f="",g=/^:::([\w-]*)(\s.*)?/gm,b=e.slice(m);for(g.lastIndex=0;;){let n=g.exec(b);if(null===n)break;let o=n.index,s=n[1];if(null==(i=n[2])||!i.endsWith(":::")){if(s)h+=1;else if(0==(h-=1)){let i=b.slice(0,o);f=i.trim();let s=e.slice(0,m+o+n[0].length),l=[];if(f){if("block"===a)for((l=r.blockTokens(i)).forEach(e=>{e.text&&(!e.tokens||0===e.tokens.length)&&(e.tokens=r.inlineTokens(e.text))});l.length>0;){let e=l[l.length-1];if("paragraph"!==e.type||e.text&&""!==e.text.trim())break;l.pop()}else l=r.inlineTokens(f)}return{type:t,raw:s,attributes:p,content:f,tokens:l}}}}}},renderMarkdown:(e,t)=>{let n=i(u(e.attrs||{})),r=n?` {${n}}`:"",o=t.renderChildren(e.content||[],"\n\n");return`:::${d}${r}
72
73${o}
74
75:::`}}}function t1(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;null!==r;){let[,o,i,s]=r;t[o]=i||s,r=n.exec(e)}return t}function t2(e){return Object.entries(e).filter(([,e])=>null!=e).map(([e,t])=>`${e}="${t}"`).join(" ")}function t3(e){let{nodeName:t,name:n,getContent:r,parseAttributes:o=t1,serializeAttributes:i=t2,defaultAttributes:s={},selfClosing:a=!1,allowedAttributes:l}=e,d=n||t,u=e=>{if(!l)return e;let t={};return l.forEach(n=>{let r="string"==typeof n?n:n.name,o="string"==typeof n?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(void 0!==o&&n===o)return;t[r]=n}}),t},c=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{let o={...s,...e.attributes};if(a)return n.createNode(t,o);let i=r?r(e):e.content||"";return i?n.createNode(t,o,[n.createTextNode(i)]):n.createNode(t,o,[])},markdownTokenizer:{name:t,level:"inline",start(e){let t=a?RegExp(`\\[${c}\\s*[^\\]]*\\]`):RegExp(`\\[${c}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${c}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){let i=a?RegExp(`^\\[${c}\\s*([^\\]]*)\\]`):RegExp(`^\\[${c}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${c}\\]`),s=e.match(i);if(!s)return;let l="",d="";if(a){let[,e]=s;d=e}else{let[,e,t]=s;d=e,l=t||""}let u=o(d.trim());return{type:t,raw:s[0],content:l.trim(),attributes:u}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>"text"===e.type).map(e=>e.text).join(""));let n=i(u(e.attrs||{})),o=n?` ${n}`:"";return a?`[${d}${o}]`:`[${d}${o}]${t}[/${d}]`}}}
75function t6(e,t,n){var r,o,i,s;let a=e.split("\n"),l=[],d="",u=0,c=t.baseIndentSize||2;for(;u<a.length;){let e;let p=a[u],h=p.match(t.itemPattern);if(!h){if(l.length>0)break;if(""!==p.trim())return;u+=1,d=`${d}${p}
76`;continue}let m=t.extractItemData(h),{indentLevel:f,mainContent:g}=m;d=`${d}${p}
77`;let b=[g];for(u+=1;u<a.length;){let e=a[u];if(""===e.trim()){let t=a.slice(u+1).findIndex(e=>""!==e.trim());if(-1===t)break;if(((null==(o=null==(r=a[u+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:o.length)||0)>f){b.push(e),d=`${d}${e}
78`,u+=1;continue}break}if(((null==(s=null==(i=e.match(/^(\s*)/))?void 0:i[1])?void 0:s.length)||0)>f)b.push(e),d=`${d}${e}
79`,u+=1;else break}let y=b.slice(1);if(y.length>0){let r=y.map(e=>e.slice(f+c)).join("\n");r.trim()&&(e=t.customNestedParser?t.customNestedParser(r):n.blockTokens(r))}let k=t.createToken(m,e);l.push(k)}if(0!==l.length)return{items:l,raw:d}}function t9(e,t,n,r){if(!e||!Array.isArray(e.content))return"";let o="function"==typeof n?n(r):n,[i,...s]=e.content,a=t.renderChildren([i]),l=[`${o}${a}`];return s&&s.length>0&&s.forEach(e=>{let n=t.renderChildren([e]);if(n){let e=n.split("\n").map(e=>e?t.indent(e):"").join("\n");l.push(e)}}),l.join("\n")}function t4(e,t,n={}){let{state:r}=t,{doc:o,tr:i}=r;o.descendants((t,r)=>{let o=i.mapping.map(r),s=i.mapping.map(r)+t.nodeSize,a=null;if(t.marks.forEach(t=>{if(t!==e)return!1;a=t}),!a)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==a.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});i.removeMark(o,s,e.type),i.addMark(o,s,t)}}),i.docChanged&&t.view.dispatch(i)}c({},{createAtomBlockMarkdownSpec:()=>tZ,createBlockMarkdownSpec:()=>t0,createInlineMarkdownSpec:()=>t3,parseAttributes:()=>tG,parseIndentedBlocks:()=>t6,renderNestedMarkdownContent:()=>t9,serializeAttributes:()=>tQ});var t8=class{constructor(e,t,n){this.component=e,this.editor=t.editor,this.options={...n},this.mark=t.mark,this.HTMLAttributes=t.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(e,t){t4(t||this.mark,this.editor,e)}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(z()||j())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)))}},t5=class e extends tC{constructor(){super(...arguments),this.type="node"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},t7=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,o,s,a,l;let{view:d}=this.editor,u=e.target,c=3===u.nodeType?null==(t=u.parentElement)?void 0:t.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||(null==(n=this.contentDOM)?void 0:n.contains(u))||!c)return;let p=0,h=0;if(this.dom!==c){let t=this.dom.getBoundingClientRect(),n=c.getBoundingClientRect(),i=null!=(o=e.offsetX)?o:null==(r=e.nativeEvent)?void 0:r.offsetX,l=null!=(a=e.offsetY)?a:null==(s=e.nativeEvent)?void 0:s.offsetY;p=n.x-t.x+i,h=n.y-t.y+l}let m=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();m.style.width=`${Math.round(e.width)}px`,m.style.height=`${Math.round(e.height)}px`,m.style.boxSizing="border-box",m.style.pointerEvents="none"}catch{}let f=null;try{(f=document.createElement("div")).style.position="absolute",f.style.top="-9999px",f.style.left="-9999px",f.style.pointerEvents="none",f.appendChild(m),document.body.appendChild(f),null==(l=e.dataTransfer)||l.setDragImage(m,p,h)}finally{f&&setTimeout(()=>{try{null==f||f.remove()}catch{}},0)}let g=this.getPos();if("number"!=typeof g)return;let b=i.qv.create(d.state.doc,g),y=d.state.tr.setSelection(b);d.dispatch(y)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});let n=e.target;if(!(this.dom.contains(n)&&!(null==(t=this.contentDOM)?void 0:t.contains(n))))return!1;let r=e.type.startsWith("drag"),o="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o&&!r)return!0;let{isEditable:s}=this.editor,{isDragging:a}=this,l=!!this.node.type.spec.draggable,d=i.qv.isSelectable(this.node),u="copy"===e.type,c="paste"===e.type,p="cut"
79===e.type,h="mousedown"===e.type;if(!l&&d&&r&&e.target===this.dom&&e.preventDefault(),l&&r&&!a&&e.target===this.dom)return e.preventDefault(),!1;if(l&&s&&!a&&h){let e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!a&&!o&&!u&&!c&&!p&&(!h||!d)}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!!this.node.isLeaf||!!this.node.isAtom||!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(z()||j())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)))}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return"number"==typeof n&&(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){let e=this.getPos();if("number"!=typeof e)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function ne(e){return new tS({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:o})=>{let i=eN(e.getAttributes,void 0,r,o);if(!1===i||null===i)return null;let{tr:s}=t,a=r[r.length-1],l=r[0],d=n.to;if(a){let r=l.search(/\S/),o=n.from+l.indexOf(a),u=o+a.length;if(eU(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>o).length)return null;u<n.to&&s.delete(u,n.to),o>n.from&&s.delete(n.from+r,o),d=n.from+r+a.length,s.addMark(n.from+r,d,e.type.create(i||{})),s.removeStoredMark(e.type)}}})}},76305:function(e,t,n){n.d(t,{H:function(){return r.Ht}});var r=n(23164)},57686:function(e,t,n){n.d(t,{p:function(){return r.pj}});var r=n(33132)},20102:function(e,t,n){n.d(t,{x:function(){return r.xD}});var r=n(33132)},66736:function(e,t,n){n.d(t,{S:function(){return r.SC}});var r=n(33132)},33132:function(e,t,n){n.d(t,{iA:function(){return f},pj:function(){return s},xD:function(){return a},SC:function(){return l}});var r=n(8646),o=n(40160),i=n(1661),s=r.NB.create({name:"tableCell",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{var t,n;let r=e.getAttribute("colwidth"),o=r?r.split(",").map(e=>parseInt(e,10)):null;if(!o){let r=null==(t=e.closest("table"))?void 0:t.querySelectorAll("colgroup > col"),o=Array.from((null==(n=e.parentElement)?void 0:n.children)||[]).indexOf(e);if(o&&o>-1&&r&&r[o]){let e=r[o].getAttribute("width");return e?[parseInt(e,10)]:null}}return o}}}),tableRole:"cell",isolating:!0,parseHTML:()=>[{tag:"td"}],renderHTML({HTMLAttributes:e}){return["td",(0,r.P1)(this.options.HTMLAttributes,e),0]}}),a=r.NB.create({name:"tableHeader",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute("colwidth");return t?t.split(",").map(e=>parseInt(e,10)):null}}}),tableRole:"header_cell",isolating:!0,parseHTML:()=>[{tag:"th"}],renderHTML({HTMLAttributes:e}){return["th",(0,r.P1)(this.options.HTMLAttributes,e),0]}}),l=r.NB.create({name:"tableRow",addOptions:()=>({HTMLAttributes:{}}),content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML:()=>[{tag:"tr"}],renderHTML({HTMLAttributes:e}){return["tr",(0,r.P1)(this.options.HTMLAttributes,e),0]}});function d(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function u(e,t,n,r,o,i){var s;let a=0,l=!0,u=t.firstChild,c=e.firstChild;if(null!==c)for(let e=0,n=0;e<c.childCount;e+=1){let{colspan:s,colwidth:p}=c.child(e).attrs;for(let e=0;e<s;e+=1,n+=1){let s=o===n?i:p&&p[e],c=s?`${s}px`:"";if(a+=s||r,s||(l=!1),u){if(u.style.width!==c){let[e,t]=d(r,s);u.style.setProperty(e,t)}u=u.nextSibling}else{let e=document.createElement("col"),[n,o]=d(r,s);e.style.setProperty(n,o),t.appendChild(e)}}}for(;u;){let e=u.nextSibling;null==(s=u.parentNode)||s.removeChild(u),u=e}let p=e.attrs.style&&"string"==typeof e.attrs.style&&/\bwidth\s*:/i.test(e.attrs.style);l&&!p?(n.style.width=`${a}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${a}px`)}var c=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),u(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type===this.node.type&&(this.node=e,u(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!n&&!r&&("attributes"===e.type||"childList"===e.type||"characterData"===e.type)}};function p(e,t){return t?e.createChecked(null,t):e.createAndFill()}var h=({editor:e})=>{let{selection:t}=e.state;if(!(t instanceof i.Xc))return!1;let n=0,o=(0,r.qv)(t.ranges[0].$from,e=>
79"table"===e.type.name);return null==o||o.node.descendants(e=>{if("table"===e.type.name)return!1;["tableCell","tableHeader"].includes(e.type.name)&&(n+=1)}),n===t.ranges.length&&(e.commands.deleteTable(),!0)},m=function(e,t,n={}){var r;let o=null!=(r=n.cellLineSeparator)?r:"\x1f";if(!e||!e.content||0===e.content.length)return"";let i=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{let r=((e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(o):e.content?t.renderChildren(e.content):"")||"").replace(/\s+/g," ").trim(),i="tableHeader"===e.type;n.push({text:r,isHeader:i})}),i.push(n)});let s=i.reduce((e,t)=>Math.max(e,t.length),0);if(0===s)return"";let a=Array(s).fill(0);i.forEach(e=>{var t;for(let n=0;n<s;n+=1){let r=((null==(t=e[n])?void 0:t.text)||"").length;r>a[n]&&(a[n]=r),a[n]<3&&(a[n]=3)}});let l=(e,t)=>e+" ".repeat(Math.max(0,t-e.length)),d=i[0],u=d.some(e=>e.isHeader),c="\n",p=Array(s).fill(0).map((e,t)=>u&&d[t]&&d[t].text||"");return c+=`| ${p.map((e,t)=>l(e,a[t])).join(" | ")} |
80| ${a.map(e=>"-".repeat(Math.max(3,e))).join(" | ")} |
81`,(u?i.slice(1):i).forEach(e=>{c+=`| ${Array(s).fill(0).map((t,n)=>l(e[n]&&e[n].text||"",a[n])).join(" | ")} |
82`}),c},f=r.NB.create({name:"table",addOptions:()=>({HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:c,lastColumnResizable:!0,allowTableNodeSelection:!1}),content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML:()=>[{tag:"table"}],renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:o,tableMinWidth:i}=function(e,t,n,r){let o=0,i=!0,s=[],a=e.firstChild;if(!a)return{};for(let e=0,n=0;e<a.childCount;e+=1){let{colspan:r,colwidth:l}=a.child(e).attrs;for(let e=0;e<r;e+=1,n+=1){let r=void 0===n?void 0:l&&l[e];o+=r||t,r||(i=!1);let[a,u]=d(t,r);s.push(["col",{style:`${a}: ${u}`}])}}return{colgroup:["colgroup",{},...s],tableWidth:i?`${o}px`:"",tableMinWidth:i?"":`${o}px`}}(e,this.options.cellMinWidth),s=t.style,a=["table",(0,r.P1)(this.options.HTMLAttributes,t,{style:s||(o?`width: ${o}`:`min-width: ${i}`)}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},a]:a},parseMarkdown:(e,t)=>{let n=[];if(e.header){let r=[];e.header.forEach(e=>{r.push(t.createNode("tableHeader",{},[{type:"paragraph",content:t.parseInline(e.tokens)}]))}),n.push(t.createNode("tableRow",{},r))}return e.rows&&e.rows.forEach(e=>{let r=[];e.forEach(e=>{r.push(t.createNode("tableCell",{},[{type:"paragraph",content:t.parseInline(e.tokens)}]))}),n.push(t.createNode("tableRow",{},r))}),t.createNode("table",void 0,n)},renderMarkdown:(e,t)=>m(e,t),addCommands:()=>({insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:s})=>{let a=function(e,t,n,r,o){let i=function(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}(e),s=[],a=[];for(let e=0;e<n;e+=1){let e=p(i.cell,void 0);if(e&&a.push(e),r){let e=p(i.header_cell,void 0);e&&s.push(e)}}let l=[];for(let e=0;e<t;e+=1)l.push(i.row.createChecked(null,r&&0===e?s:a));return i.table.createChecked(null,l)}(s.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(a).scrollIntoView().setSelection(o.Bs.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>(0,i.I_)(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>(0,i.e2)(e,t),deleteColumn:()=>({state:e,dispatch:t})=>(0,i.eA)(e,t),addRowBefore:()=>({state:e,dispatch:t})=>(0,i.z2)(e,t),addRowAfter:()=>({state:e,dispatch:t})=>(0,i.dl)(e,t),deleteRow:()=>({state:e,dispatch:t})=>(0,i.qK)(e,t),deleteTable:()=>({state:e,dispatch:t})=>(0,i.WQ)(e,t),mergeCells:()=>({state:e,dispatch:t})=>(0,i.JX)(e,t),splitCell:()=>({state:e,dispatch:t})=>(0,i.Cr)(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>(0,i.dO)("column")(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>(0,i.dO)("row")(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>(0,i.II)(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>!!(0,i.JX)(e,t)||(0,i.Cr)(e,t),setCellAttribute:(e,t)=>
82({state:n,dispatch:r})=>(0,i.wb)(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>(0,i.nA)(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>(0,i.nA)(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&(0,i.tp)(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=i.Xc.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}),addKeyboardShortcuts(){return{Tab:()=>!!this.editor.commands.goToNextCell()||!!this.editor.can().addRowAfter()&&this.editor.chain().addRowAfter().goToNextCell().run(),"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:h,"Mod-Backspace":h,Delete:h,"Mod-Delete":h}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[(0,i.VH)({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],(0,i.G3)({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){let t={name:e.name,options:e.options,storage:e.storage};return{tableRole:(0,r.nU)((0,r.Nl)(e,"tableRole",t))}}});r.hj.create({name:"tableKit",addExtensions(){let e=[];return!1!==this.options.table&&e.push(f.configure(this.options.table)),!1!==this.options.tableCell&&e.push(s.configure(this.options.tableCell)),!1!==this.options.tableHeader&&e.push(a.configure(this.options.tableHeader)),!1!==this.options.tableRow&&e.push(l.configure(this.options.tableRow)),e}})},26008:function(e,t,n){n.d(t,{P:function(){return r}});var r=n(8646).hj.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>!!this.options.alignments.includes(e)&&this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).some(e=>e),unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,"textAlign")).some(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>!!this.options.alignments.includes(e)&&(t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}})},84749:function(e,t,n){n.d(t,{v:function(){return o}});var r=n(8646),o=r.vc.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.P1)(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 o=r[2].trim();return{type:"underline",raw:r[0],text:o,tokens:n.inlineTokens(o)}}},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()}}})},23164:function(e,t,n){n.d(t,{Ht:function(){return d},QA:function(){return m},eh:function(){return h},fj:function(){return c},m$:function(){return u}});var r=n(8646),o=n(40160),i=n(36550),s=n(38280),a=n(99049),l=n(84003),d=r.hj.create({name:"characterCount",addOptions:()=>({limit:null,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 o.Sy({key:new o.H$("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;let o=this.options.limit;if(null==o||0===o){e=!0;return}let i=this.storage.characters({node:r.doc});if(i>o){console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);let t=r.tr.deleteRange(0,i-o);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}),o=this.storage.characters({node:e.doc});if(o<=n||r>n&&o>n&&o<=r)return!0;
82if(r>n&&o>n&&o>r||!e.getMeta("paste"))return!1;let i=e.selection.$head.pos;return e.deleteRange(i-(o-n),i),!(this.storage.characters({node:e.doc})>n)}})]}}),u=r.hj.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[(0,i.q)(this.options)]}});r.hj.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new o.Sy({key:new o.H$("focus"),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:o}=t,i=[];if(!n||!r)return s.EH.create(e,[]);let a=0;"deepest"===this.options.mode&&e.descendants((e,t)=>{if(!e.isText){if(!(o>=t&&o<=t+e.nodeSize-1))return!1;a+=1}});let l=0;return e.descendants((e,t)=>!e.isText&&!!(o>=t&&o<=t+e.nodeSize-1)&&((l+=1,"deepest"===this.options.mode&&a-l>0||"shallowest"===this.options.mode&&l>1)?"deepest"===this.options.mode:void i.push(s.p.node(t,t+e.nodeSize,{class:this.options.className})))),s.EH.create(e,i)}}})]}});var c=r.hj.create({name:"gapCursor",addProseMirrorPlugins:()=>[(0,a.d)()],extendNodeSchema(e){var t;let n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:null!=(t=(0,r.nU)((0,r.Nl)(e,"allowGapCursor",n)))?t:null}}});function p({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}r.hj.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new o.Sy({key:new o.H$("placeholder"),props:{decorations:({doc:e,selection:t})=>{let n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:o}=t,i=[];if(!n)return null;let a=this.editor.isEmpty;return e.descendants((e,t)=>{let n=o>=t&&o<=t+e.nodeSize,l=!e.isLeaf&&(0,r.bR)(e);if((n||!this.options.showOnlyCurrent)&&l){let r=[this.options.emptyNodeClass];a&&r.push(this.options.emptyEditorClass);let o=s.p.node(t,t+e.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t,hasAnchor:n}):this.options.placeholder});i.push(o)}return this.options.includeChildren}),s.EH.create(e,i)}}})]}}),r.hj.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new o.Sy({key:new o.H$("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||(0,r.EG)(n.selection)||e.view.dragging?null:s.EH.create(n.doc,[s.p.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}});var h=r.hj.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var e;let t=new o.H$(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 o.Sy({key:t,appendTransaction:(e,r,o)=>{let{doc:i,tr:s,schema:a}=o,l=t.getState(o),d=i.content.size,u=a.nodes[n];if(l)return s.insert(d,u.create())},state:{init:(e,t)=>!p({node:t.tr.doc.lastChild,types:r}),apply:(e,t)=>!e.docChanged||e.getMeta("__uniqueIDTransaction")?t:!p({node:e.doc.lastChild,types:r})}})]}}),m=r.hj.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>(0,l.Yw)(e,t),redo:()=>({state:e,dispatch:t})=>(0,l.KX)(e,t)}),addProseMirrorPlugins(){return[(0,l.m8)(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()}}})},36016:function(e,t,n){n.d(t,{jE:function(){return v},kg:function(){return m}});var r=n(23329),o=n(47446),i=n(82221),s=n(57827),a=n(8646),l=n(12651),d=n(93442),u=(...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})},c=({contentComponent:e})=>{let t=(0,i.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,s.jsx)(s.Fragment,{children:Object.values(t)})},p=class extends r.Component{constructor(e){var t;super(e),this.editorContentRef=r.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(null==(t=e.editor)?void 0:t.contentComponent)}}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)){if(t.contentComponent)return;let e=this.editorContentRef.current;e.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:e}),t.contentComponent=function(){let e=new Set,t={};return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>t,getServerSnapshot:()=>
82t,setRenderer(n,r){t={...t,[n]:o.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(e=>e.hasContentComponentInitialized?e:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;let t=this.props.editor;if(t){this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),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,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{ref:u(t,this.editorContentRef),...n}),(null==e?void 0:e.contentComponent)&&(0,s.jsx)(c,{contentComponent:e.contentComponent})]})}},h=(0,r.forwardRef)((e,t)=>{let n=r.useMemo(()=>Math.floor(4294967295*Math.random()).toString(),[e.editor]);return r.createElement(p,{key:n,innerRef:t,...e})}),m=r.memo(h),f="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,g=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=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}},b="undefined"==typeof window,y=b||!!("undefined"!=typeof window&&window.next),k=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=>e())}getInitialEditor(){return void 0===this.options.current.immediatelyRender?b||y?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?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)}};return new a.ML(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){
82if(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 v(e={},t=[]){let n=(0,r.useRef)(e);n.current=e;let[o]=(0,r.useState)(()=>new k(n)),s=(0,i.useSyncExternalStore)(o.subscribe,o.getEditor,o.getServerSnapshot);return(0,r.useDebugValue)(s),(0,r.useEffect)(o.onRender(t)),!function(e){var t;let[n]=(0,r.useState)(()=>new g(e.editor)),o=(0,d.useSyncExternalStoreWithSelector)(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,null!=(t=e.equalityFn)?t:l.vZ);f(()=>n.watch(e.editor),[e.editor,n]),(0,r.useDebugValue)(o)}({editor:s,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),s}(0,r.createContext)({editor:null}).Consumer;var M=(0,r.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),w=()=>(0,r.useContext)(M);r.forwardRef((e,t)=>{let{onDragStart:n}=w(),r=e.as||"div";return(0,s.jsx)(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})}),r.createContext({markViewContentRef:()=>{}}),a.WR,a.DK},78683:function(e,t,n){n.d(t,{V:function(){return ep}});var r=n(8646),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]},i=/^\s*>\s$/,s=r.NB.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return o("blockquote",{...(0,r.P1)(this.options.HTMLAttributes,e),children:o("slot",{})})},parseMarkdown:(e,t)=>t.createNode("blockquote",void 0,t.parseChildren(e.tokens||[])),renderMarkdown:(e,t)=>{if(!e.content)return"";let n=[];return e.content.forEach(e=>{let r=t.renderChildren([e]).split("\n").map(e=>""===e.trim()?">":`> ${e}`);n.push(r.join("\n"))}),n.join(`
83>
84`)},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()}}
84,addInputRules(){return[(0,r.S0)({find:i,type:this.type})]}}),a=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,l=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,d=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,u=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,c=r.vc.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.P1)(this.options.HTMLAttributes,e),children:o("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),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()}}
84,addInputRules(){return[(0,r.Cf)({find:a,type:this.type}),(0,r.Cf)({find:d,type:this.type})]},addPasteRules(){return[(0,r.K9)({find:l,type:this.type}),(0,r.K9)({find:u,type:this.type})]}}),p=/(^|[^`])`([^`]+)`(?!`)$/,h=/(^|[^`])`([^`]+)`(?!`)/g,m=r.vc.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",(0,r.P1)(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.Cf)({find:p,type:this.type})]},addPasteRules(){return[(0,r.K9)({find:h,type:this.type})]}}),f=n(40160),g=/^```([a-z]+)?[\s\n]$/,b=/^~~~([a-z]+)?[\s\n]$/,y=r.NB.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!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;return n&&[...(null==(t=e.firstElementChild)?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0]||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",(0,r.P1)(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n;return(null==(n=e.raw)?void 0:n.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}
85
86\`\`\``},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:o}=r,{$from:i,empty:s}=o;if(i.parent.type!==this.type)return!1;let a=" ".repeat(n);return s?e.commands.insertContent(a):e.commands.command(({tr:e})=>{let{from:t,to:n}=o,i=r.doc.textBetween(t,n,"\n","\n").split("\n").map(e=>a+e).join("\n");return e.replaceWith(t,n,r.schema.text(i)),!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:o}=r,{$from:i,empty:s}=o;return i.parent.type===this.type&&(s?e.commands.command(({tr:e})=>{var t;let{pos:o}=i,s=i.start(),a=i.end(),l=r.doc.textBetween(s,a,"\n","\n").split("\n"),d=0,u=0,c=o-s;for(let e=0;e<l.length;e+=1){if(u+l[e].length>=c){d=e;break}u+=l[e].length+1}let p=Math.min(((null==(t=l[d].match(/^ */))?void 0:t[0])||"").length,n);if(0===p)return!0;let h=s;for(let e=0;e<d;e+=1)h+=l[e].length+1;return e.delete(h,h+p),o-h<=p&&e.setSelection(f.Bs.create(e.doc,h)),!0}):e.commands.command(({tr:e})=>{let{from:t,to:i}=o,s=r.doc.textBetween(t,i,"\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,i,r.schema.text(s)),!0}))},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;let i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!!i&&!!s&&e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>
86{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type||o.parentOffset!==o.parent.nodeSize-2)return!1;let s=o.after();return void 0!==s&&(r.nodeAt(s)?e.commands.command(({tr:e})=>(e.setSelection(f.Y1.near(r.resolve(s))),!0)):e.commands.exitCode())}}},addInputRules(){return[(0,r.zK)({find:g,type:this.type,getAttributes:e=>({language:e[1]})}),(0,r.zK)({find:b,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new f.Sy({key:new f.H$("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"),o=r?JSON.parse(r):void 0,i=null==o?void 0:o.mode;if(!n||!i)return!1;let{tr:s,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:i},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(f.Bs.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),k=r.NB.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n\n"):""}),v=r.NB.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.P1)(this.options.HTMLAttributes,e)]},renderText:()=>"\n",renderMarkdown:()=>`  
87`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:o}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:i}=this.options,{splittableMarks:s}=r.extensionManager,a=o||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&a&&i){let t=a.filter(e=>s.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),M=r.NB.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.P1)(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,o="#".repeat(r);return e.content?`${o} ${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.zK)({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}}
87)\\s$`),type:this.type,getAttributes:{level:e}}))}}),w=r.NB.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",(0,r.P1)(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!(0,r.FZ)(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:o}=n,i=e();return(0,r.EG)(n)?i.insertContentAt(o.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(f.Bs.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(f.qv.create(t.doc,n.pos)):t.setSelection(f.Bs.create(t.doc,n.pos));else{let o=e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType,i=null==o?void 0:o.create();i&&(t.insert(r,i),t.setSelection(f.Bs.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[(0,r.x2)({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.t
87ype})]}}),x=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,C=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,T=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,S=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,E=r.vc.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.P1)(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||[])),renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[(0,r.Cf)({find:x,type:this.t
87ype}),(0,r.Cf)({find:T,type:this.type})]},addPasteRules(){return[(0,r.K9)({find:C,type:this.type}),(0,r.K9)({find:S,type:this.type})]}}),A=n(72071),L="[\0- \xa0 ᠎ -\u2029  ]",O=new RegExp(L),N=RegExp(`${L}$`),$=RegExp(L,"g");function P(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.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var I=r.vc.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=>{if("string"==typeof e){(0,A.zR)(e);return}(0,A.zR)(e.scheme,e.optionalSlashes)})},onDestroy(){(0,A.mc)()},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!P(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}),addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{let t=e.getAttribute("href");return!!(t&&this.options.isAllowedUri(t,{defaultValidate:e=>!!P(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!P(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",(0,r.P1)(this.options.HTMLAttributes,e),0]:["a",(0,r.P1)(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;let r=(null==(n=e.attrs)?void 0:n.href)||"",o=t.renderChildren(e);return`[${o}](${r})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!P(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=>!!P(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()}},addPasteRules(){return[(0,r.K9)({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,o=(0,A.sE)(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!P(e,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t}
87,type:this.type,getAttributes:e=>{var t;return{href:null==(t=e.data)?void 0:t.href}}})]},addProseMirrorPlugins(){var e,t,n;let o=[],{protocols:i,defaultProtocol:s}=this.options;return this.options.autolink&&o.push((e={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!P(e,i),protocols:i,defaultProtocol:s}),shouldAutoLink:this.options.shouldAutoLink},new f.Sy({key:new f.H$("autolink"),appendTransaction:(t,n,o)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(o.doc),s=t.some(e=>e.getMeta("preventAutolink"));if(!i||s)return;let{tr:a}=o,l=(0,r.XP)(n.doc,[...t]);if((0,r.QC)(l).forEach(({newRange:t})=>{let n,i;let s=(0,r.b5)(o.doc,t,e=>e.isTextblock);if(s.length>1)n=s[0],i=o.doc.textBetween(n.pos,n.pos+n.node.nodeSize,void 0," ");else if(s.length){let e=o.doc.textBetween(t.from,t.to," "," ");if(!N.test(e))return;n=s[0],i=o.doc.textBetween(n.pos,t.to,void 0," ")}if(n&&i){let t=i.split(O).filter(Boolean);if(t.length<=0)return!1;let s=t[t.length-1],l=n.pos+i.lastIndexOf(s);if(!s)return!1;let d=(0,A.wS)(s).map(t=>t.toObject(e.defaultProtocol));if(!(1===d.length?d[0].isLink:3===d.length&&!!d[1].isLink&&["()","[]"].includes(d[0].value+d[2].value)))return!1;d.filter(e=>e.isLink).map(e=>({...e,from:l+e.start+1,to:l+e.end+1})).filter(e=>!o.schema.marks.code||!o.doc.rangeHasMark(e.from,e.to,o.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{(0,r.tI)(t.from,t.to,o.doc).some(t=>t.mark.type===e.type)||a.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),a.steps.length)return a}}))),o.push((t={type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection},new f.Sy({key:new f.H$("handleClickLink"),props:{handleClick:(e,n,o)=>{var i,s;if(0!==o.button||!e.editable)return!1;let a=!1;if(t.enableClickSelection&&(a=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){let n=null;if(o.target instanceof HTMLAnchorElement)n=o.target;else{let e=o.target,t=[];for(;"DIV"!==e.nodeName;)t.push(e),e=e.parentNode;n=t.find(e=>"A"===e.nodeName)}if(!n)return a;let l=(0,r.u9)(e.state,t.type.name),d=null!=(i=null==n?void 0:n.href)?i:l.href,u=null!=(s=null==n?void 0:n.target)?s:l.target;n&&d&&(window.open(d,u),a=!0)}return a}}}))),this.options.linkOnPaste&&o.push((n={editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink},new f.Sy({key:new f.H$("handlePasteLink"),props:{handlePaste:(e,t,r)=>{let{shouldAutoLink:o}=n,{state:i}=e,{selection:s}=i,{empty:a}=s;if(a)return!1;let l="";r.content.forEach(e=>{l+=e.textContent});let d=(0,A.sE)(l,{defaultProtocol:n.defaultProtocol}).find(e=>e.isLink&&e.value===l);return!!(l&&d&&(void 0===o||o(d.href)))&&n.editor.commands.setMark(n.type,{href:d.href})}}}))),o}}),H=Object.defineProperty,R="textStyle",B=/^\s*([-+*])\s$/,D=r.NB.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.P1)(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(R)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}}
87,addInputRules(){let e=(0,r.S0)({find:B,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,r.S0)({find:B,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(R),editor:this.editor})),[e]}}),j=r.NB.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",(0,r.P1)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{if("list_item"!==e.type)return[];let n=[];if(e.tokens&&e.tokens.length>0){if(e.tokens.some(e=>"paragraph"===e.type))n=t.parseChildren(e.tokens);else{let r=e.tokens[0];if(r&&"text"===r.type&&r.tokens&&r.tokens.length>0){if(n=[{type:"paragraph",content:t.parseInline(r.tokens)}],e.tokens.length>1){let r=e.tokens.slice(1),o=t.parseChildren(r);n.push(...o)}}else n=t.parseChildren(e.tokens)}}return 0===n.length&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(e,t,n)=>(0,r.wm)(e,t,e=>"bulletList"===e.parentType?"- ":"orderedList"===e.parentType?`${e.index+1}. `:"- ",n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});((e,t)=>{for(var n in t)H(e,n,{get:t[n],enumerable:!0})})({},{findListItemPos:()=>z,getNextListDepth:()=>_,handleBackspace:()=>U,handleDelete:()=>Y,hasListBefore:()=>V,hasListItemAfter:()=>J,hasListItemBefore:()=>W,listItemHasSubList:()=>K,nextListIsDeeper:()=>q,nextListIsHigher:()=>F});var z=(e,t)=>{let{$from:n}=t.selection,o=(0,r.jo)(e,t.schema),i=n.depth,s=n.pos,a=null;for(;i>0&&null===a;)n.node(i).type===o?a=i:(i-=1,s-=1);return null===a?null:{$pos:t.doc.resolve(s),depth:a}},_=(e,t)=>{let n=z(e,t);if(!n)return!1;let[,o]=(0,r.NY)(t,e,n.$pos.pos+4);return o},V=(e,t,n)=>{let{$anchor:r}=e.selection,o=Math.max(0,r.pos-2),i=e.doc.resolve(o).node();return!!(i&&n.includes(i.type.name))},W=(e,t)=>{var n;let{$anchor:r}=t.selection,o=t.doc.resolve(r.pos-2);return 0!==o.index()&&(null==(n=o.nodeBefore)?void 0:n.type.name)===e},K=(e,t,n)=>{if(!n)return!1;let o=(0,r.jo)(e,t.schema),i=!1;return n.descendants(e=>{e.type===o&&(i=!0)}),i},U=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!(0,r.Ig)(e.state,t)&&V(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),o=[];r.node().descendants((e,n)=>{e.type.name===t&&o.push({node:e,pos:n})});let i=o.at(-1);if(!i)return!1;let s=e.state.doc.resolve(r.start()+i.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},s.end()).joinForward().run()}if(!(0,r.Ig)(e.state,t)||!(0,r.Sz)(e.state))return!1;let o=z(t,e.state);if(!o)return!1;let i=e.state.doc.resolve(o.$pos.pos-2).node(o.depth),s=K(t,e.state,i);return W(t,e.state)&&!s?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},q=(e,t)=>{let n=_(e,t),r=z(e,t);return!!r&&!!n&&n>r.depth},F=(e,t)=>{let n=_(e,t),r=z(e,t);return!!r&&!!n&&n<r.depth},Y=(e,t)=>{if(!(0,r.Ig)(e.state,t)||!(0,r.rI)(e.state,t))return!1;let{selection:n}=e.state,{$from:o,$to:i}=n;return!(!n.empty&&o.sameParent(i))&&(q(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():F(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward())},J=(e,t)=>{var n;let{$anchor:r}=t.selection,o=t.doc.resolve(r.pos-r.parentOffset-2);return o.index()!==o.parent.childCount-1&&(null==(n=o.nodeAfter)?void 0:n.type.name)===e},X=r.hj.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]&&Y(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;
87return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&Y(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]&&U(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]&&U(e,n,r)&&(t=!0)}),t}}}}),G=/^(\s*)(\d+)\.\s+(.*)$/,Q=/^\s/,Z="textStyle",ee=/^(\d+)\.\s$/,et=r.NB.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=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return 1===t?["ol",(0,r.P1)(this.options.HTMLAttributes,n),0]:["ol",(0,r.P1)(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{if("list"!==e.type||!e.ordered)return[];let n=e.start||1,r=e.items?e.items.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}}):[];return 1!==n?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/),n=null==t?void 0:t.index;return void 0!==n?n:-1},tokenize:(e,t,n)=>{var r;let o=e.split("\n"),[i,s]=function(e){let t=[],n=0,r=0;for(;n<e.length;){let o=e[n],i=o.match(G);if(!i)break;let[,s,a,l]=i,d=s.length,u=l,c=n+1,p=[o];for(;c<e.length;){let t=e[c];if(t.match(G))break;if(""===t.trim())p.push(t),u+="\n",c+=1;else if(t.match(Q))p.push(t),u+=`
88${t.slice(d+2)}`,c+=1;else break}t.push({indent:d,number:parseInt(a,10),content:u.trim(),raw:p.join("\n")}),r=c,n=c}return[t,r]}(o);if(0===i.length)return;let a=function e(t,n,r){var o;let i=[],s=0;for(;s<t.length;){let a=t[s];if(a.indent===n){let l=a.content.split("\n"),d=(null==(o=l[0])?void 0:o.trim())||"",u=[];d&&u.push({type:"paragraph",raw:d,tokens:r.inlineTokens(d)});let c=l.slice(1).join("\n").trim();if(c){let e=r.blockTokens(c);u.push(...e)}let p=s+1,h=[];for(;p<t.length&&t[p].indent>n;)h.push(t[p]),p+=1;if(h.length>0){let t=Math.min(...h.map(e=>e.indent)),n=e(h,t,r);u.push({type:"list",ordered:!0,start:h[0].number,items:n,raw:h.map(e=>e.raw).join("\n")})}i.push({type:"list_item",raw:a.raw,tokens:u}),s=p}else s+=1}return i}(i,0,n);if(0!==a.length)return{type:"list",ordered:!0,start:(null==(r=i[0])?void 0:r.number)||1,items:a,raw:o.slice(0,s).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(Z)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=(0,r.S0)({find:ee,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,r.S0)({find:ee,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Z)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),en=/^\s*(\[([( |x])?\])\s$/,er=r.NB.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}]},renderHTML({node:e,HTMLAttributes:t}){return["li",(0,r.P1)(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 o=(null==(n=e.attrs)?void 0:n.checked)?"x":" ",i=`- [${o}] `;return(0,r.wm)(e,t,i)},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),d=e=>{var t,n;a.ariaLabel=(null==(n=null==(t=this.options.a11y)?void 0:t.checkboxLabel)?void 0:n.call(t,e,a.checked))||`Task item checkbox for ${e.textContent||"empty task item"}`};return d(e),i.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",e=>e.preventDefault()),a.addEventListener("change",t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}let{checked:o}=t.target;r.isEditable&&"function"==typeof n&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if("number"!=typeof t)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...null==r?void 0:r.attrs,checked:o}),!0}).run(),r.isEditable||!this.options.onReadOnlyChecked||this.options.onReadOnlyChecked(e,o)||(a.checked=!a.checked)}
88),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{o.setAttribute(e,t)}),o.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,i.append(a,s),o.append(i,l),Object.entries(t).forEach(([e,t])=>{o.setAttribute(e,t)}),{dom:o,contentDOM:l,update:e=>e.type===this.type&&(o.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,d(e),!0)}}},addInputRules(){return[(0,r.S0)({find:en,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),eo=r.NB.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.P1)(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 o=e=>{let t=(0,r.NI)(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:o},n);return t?[{type:"taskList",raw:t.raw,items:t.items}]:n.blockTokens(e)},i=(0,r.NI)(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:o},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});r.hj.create({name:"listKit",addExtensions(){let e=[];return!1!==this.options.bulletList&&e.push(D.configure(this.options.bulletList)),!1!==this.options.listItem&&e.push(j.configure(this.options.listItem)),!1!==this.options.listKeymap&&e.push(X.configure(this.options.listKeymap)),!1!==this.options.orderedList&&e.push(et.configure(this.options.orderedList)),!1!==this.options.taskItem&&e.push(er.configure(this.options.taskItem)),!1!==this.options.taskList&&e.push(eo.configure(this.options.taskList)),e}});var ei=r.NB.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,r.P1)(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];return 1===n.length&&"image"===n[0].type?t.parseChildren([n[0]]):t.createNode("paragraph",void 0,t.parseInline(n))},renderMarkdown:(e,t)=>e&&Array.isArray(e.content)?t.renderChildren(e.content):"",addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),es=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,ea=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,el=r.vc.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.P1)(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)}}
88,addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[(0,r.Cf)({find:es,type:this.type})]},addPasteRules(){return[(0,r.K9)({find:ea,type:this.type})]}}),ed=r.NB.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),eu=n(84749),ec=n(23164),ep=r.hj.create({name:"starterKit",addExtensions(){var e,t,n,r;let o=[];return!1!==this.options.bold&&o.push(c.configure(this.options.bold)),!1!==this.options.blockquote&&o.push(s.configure(this.options.blockquote)),!1!==this.options.bulletList&&o.push(D.configure(this.options.bulletList)),!1!==this.options.code&&o.push(m.configure(this.options.code)),!1!==this.options.codeBlock&&o.push(y.configure(this.options.codeBlock)),!1!==this.options.document&&o.push(k.configure(this.options.document)),!1!==this.options.dropcursor&&o.push(ec.m$.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&o.push(ec.fj.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&o.push(v.configure(this.options.hardBreak)),!1!==this.options.heading&&o.push(M.configure(this.options.heading)),!1!==this.options.undoRedo&&o.push(ec.QA.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&o.push(w.configure(this.options.horizontalRule)),!1!==this.options.italic&&o.push(E.configure(this.options.italic)),!1!==this.options.listItem&&o.push(j.configure(this.options.listItem)),!1!==this.options.listKeymap&&o.push(X.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&o.push(I.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&o.push(et.configure(this.options.orderedList)),!1!==this.options.paragraph&&o.push(ei.configure(this.options.paragraph)),!1!==this.options.strike&&o.push(el.configure(this.options.strike)),!1!==this.options.text&&o.push(ed.configure(this.options.text)),!1!==this.options.underline&&o.push(eu.v.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&o.push(ec.eh.configure(null==(r=this.options)?void 0:r.trailingNode)),o}})}}]);

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.