1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[277],{4701:(e,t,n)=>{n.d(t,{AB:()=>eH,BQ:()=>ek,CU:()=>B,FF:()=>ef,GG:()=>eU,JJ:()=>e$,KE:()=>eB,KV:()=>v,Nx:()=>eu,OX:()=>eD,Op:()=>eb,T7:()=>ec,YY:()=>F,Yv:()=>eF,Zc:()=>e_,bP:()=>ez,gk:()=>k,gu:()=>eh,hO:()=>em,iI:()=>h,jT:()=>eR,tG:()=>eL,zU:()=>y});var r=n(52571),o=n(42695),i=n(96770),s=n(10156),a=n(808),l=n(90290),d=n(61514);function c(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}}}class u{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=>{let[t,n]=e;var s=this;return[t,function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];let l=n(...t)(i);return o.getMeta("preventDispatch")||s.hasCustomState||r.dispatch(o),l}]}))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],{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=>{let[n,r]=e;var o=this;return[n,function(){for(var e=arguments.length,n=Array(e),i=0;i<e;i++)n[i]=arguments[i];let a=o.buildProps(l,t),c=r(...n)(a);return s.push(c),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=>{let[t,n]=e;return[t,function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n(...t)({...o,dispatch:void 0})}]})),chain:()=>this.createChain(r,!1)}}buildProps(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s={tr:e,editor:r,view:i,state:c({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=>{let[t,n]=e;return[t,function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n(...t)(s)}]}))}};return s}constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}}class p{on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];let o=this.callbacks[e];return o&&o.forEach(e=>e.apply(this,n)),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){var n=this;let r=function(){for(var o=arguments.length,i=Array(o),s=0;s<o;s++)i[s]=arguments[s];n.off(e,r),t.apply(n,i)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}constructor(){this.callbacks={}}}function h(e,t,n){return void 0===e.config[t]&&e.parent?h(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?h(e.parent,t,n):null}):e.config[t]}function f(e){let t=e.filter(e=>"extension"===e.type);return{baseExtensions:t,nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function m(e){let t=[],{nodeExtensions:n,markExtensions:r}=f(e),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage,extensions:o},r=h(e,"addGlobalAttributes",n);r&&r().forEach(e=>{e.types.forEach(n=>{Object.entries(e.attributes).forEach(e=>{let[r,o]=e;t.push({type:n,name:r,attribute:{...i,...o}})})})})}),o.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage},r=h(e,"addAttributes",n);
1r&&Object.entries(r()).forEach(n=>{let[r,o]=n,s={...i,...o};"function"==typeof(null==s?void 0:s.default)&&(s.default=s.default()),(null==s?void 0:s.isRequired)&&(null==s?void 0:s.default)===void 0&&delete s.default,t.push({type:e.name,name:r,attribute:s})})}),t}function g(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error("There is no node type named '".concat(e,"'. Maybe you forgot to add the extension?"));return t.nodes[e]}return e}function v(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(e=>{let[t,r]=e;if(!n[t]){n[t]=r;return}if("class"===t){let e=r?String(r).split(" "):[],o=n[t]?n[t].split(" "):[],i=e.filter(e=>!o.includes(e));n[t]=[...o,...i].join(" ")}else if("style"===t){let e=r?r.split(";").map(e=>e.trim()).filter(Boolean):[],o=n[t]?n[t].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)}),e.forEach(e=>{let[t,n]=e.split(":").map(e=>e.trim());i.set(t,n)}),n[t]=Array.from(i.entries()).map(e=>{let[t,n]=e;return"".concat(t,": ").concat(n)}).join("; ")}else n[t]=r}),n},{})}function y(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)=>v(e,t),{})}function b(e){return"function"==typeof e}function k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return b(e)?t?e.bind(t)(...r):e(...r):e}function w(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 M(e){return Object.fromEntries(Object.entries(e).filter(e=>{let[t,n]=e;return!("attrs"===t&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 0===Object.keys(e).length&&e.constructor===Object}(n))&&null!=n}))}function x(e,t){var n;let r=m(e),{nodeExtensions:o,markExtensions:i}=f(e),a=null==(n=o.find(e=>h(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=M({...e.reduce((e,t)=>{let r=h(t,"extendNodeSchema",i);return{...e,...r?r(n):{}}},{}),content:k(h(n,"content",i)),marks:k(h(n,"marks",i)),group:k(h(n,"group",i)),inline:k(h(n,"inline",i)),atom:k(h(n,"atom",i)),selectable:k(h(n,"selectable",i)),draggable:k(h(n,"draggable",i)),code:k(h(n,"code",i)),whitespace:k(h(n,"whitespace",i)),linebreakReplacement:k(h(n,"linebreakReplacement",i)),defining:k(h(n,"defining",i)),isolating:k(h(n,"isolating",i)),attrs:Object.fromEntries(o.map(e=>{var t;return[e.name,{default:null==(t=null==e?void 0:e.attribute)?void 0:t.default}]}))}),a=k(h(n,"parseHTML",i));a&&(s.parseDOM=a.map(e=>w(e,o)));let l=h(n,"renderHTML",i);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:y(e,o)}));let d=h(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=M({...e.reduce((e,t)=>{let r=h(t,"extendMarkSchema",i);return{...e,...r?r(n):{}}},{}),inclusive:k(h(n,"inclusive",i)),excludes:k(h(n,"excludes",i)),group:k(h(n,"group",i)),spanning:k(h(n,"spanning",i)),code:k(h(n,"code",i)),attrs:Object.fromEntries(o.map(e=>{var t;return[e.name,{default:null==(t=null==e?void 0:e.attribute)?void 0:t.default}]}))}),a=k(h(n,"parseHTML",i));a&&(s.parseDOM=a.map(e=>w(e,o)));let l=h(n,"renderHTML",i);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:y(e,o)})),[n.name,s]}));return new s.Sj({topNode:a,nodes:l,marks:d})}function O(e,t){return t.nodes[e]||t.marks[e]||null}function E(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function S(e,t){let n=s.ZF.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}let C=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,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 T(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class A{constructor(e){this.find=e.find,this.handler=e.handler}}let P=(e,t)=>{if(T(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];
1return 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 N(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;let p=!1,h=C(d)+i;return s.forEach(e=>{if(p)return;let t=P(h,e.find);if(!t)return;let s=l.state.tr,d=c({state:l.state,transaction:s}),f={from:r-(t[0].length-i.length),to:o},{commands:m,chain:g,can:v}=new u({editor:n,state:d});null!==e.handler({state:d,range:f,match:t,commands:m,chain:g,can:v})&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:o,text:i}),l.dispatch(s),p=!0)}),p}function j(e){return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function I(e,t){let n={...e};return j(e)&&j(t)&&Object.keys(t).forEach(r=>{j(t[r])&&j(e[r])?n[r]=I(e[r],t[r]):n[r]=t[r]}),n}class B{static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new B(e)}configure(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend({...this.config,addOptions:()=>I(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new B(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(t.name,'".')),t.options=k(h(t,"addOptions",{name:t.name})),t.storage=k(h(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit(e){let{editor:t,mark:n}=e,{tr:r}=t.state,o=t.state.selection.$from;if(o.pos===o.end()){let e=o.marks();if(!e.find(e=>(null==e?void 0:e.type.name)===n.name))return!1;let i=e.find(e=>(null==e?void 0:e.type.name)===n.name);return i&&r.removeStoredMark(i),r.insertText(" ",o.pos),t.view.dispatch(r),!0}return!1}constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=k(h(this,"addOptions",{name:this.name}))),this.storage=k(h(this,"addStorage",{name:this.name,options:this.options}))||{}}}class D{constructor(e){this.find=e.find,this.handler=e.handler}}let R=(e,t,n)=>{if(T(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}):[]},$=null,L=e=>{var t;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n};class z{static resolve(e){var t;let n=z.sort(z.flatten(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: [".concat(r.map(e=>"'".concat(e,"'")).join(", "),"]. This can lead to issues.")),n}static flatten(e){return e.map(e=>{let t={name:e.name,options:e.options,storage:e.storage},n=h(e,"addExtensions",t);return n?[e,...this.flatten(n())]:e}).flat(10)}static sort(e){return e.sort((e,t)=>{let n=h(e,"priority")||100,r=h(t,"priority")||100;return n>r?-1:+(n<r)})}get commands(){return this.extensions.reduce((e,t)=>{let n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:O(t.name,this.schema)}
1,r=h(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){let{editor:e}=this,t=z.sort([...this.extensions].reverse()),n=[],o=[],a=t.map(t=>{let r={name:t.name,options:t.options,storage:t.storage,editor:e,type:O(t.name,this.schema)},s=[],a=h(t,"addKeyboardShortcuts",r),l={};if("mark"===t.type&&h(t,"exitable",r)&&(l.ArrowRight=()=>B.handleExit({editor:e,mark:t})),a){let t=Object.fromEntries(Object.entries(a()).map(t=>{let[n,r]=t;return[n,()=>r({editor:e})]}));l={...l,...t}}let d=(0,i.w)(l);s.push(d);let c=h(t,"addInputRules",r);E(t,e.options.enableInputRules)&&c&&n.push(...c());let u=h(t,"addPasteRules",r);E(t,e.options.enablePasteRules)&&u&&o.push(...u());let p=h(t,"addProseMirrorPlugins",r);if(p){let e=p();s.push(...e)}return s}).flat();return[function(e){let{editor:t,rules:n}=e,o=new r.k_({state:{init:()=>null,apply(e,r,i){let a=e.getMeta(o);if(a)return a;let l=e.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:e}=l;"string"==typeof e||(e=S(s.FK.from(e),i.schema));let{from:r}=l,a=r+e.length;N({editor:t,from:r,to:a,text:e,rules:n,plugin:o})}),e.selectionSet||e.docChanged?null:r}},props:{handleTextInput:(e,r,i,s)=>N({editor:t,from:r,to:i,text:s,rules:n,plugin:o}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:r}=e.state.selection;r&&N({editor:t,from:r.pos,to:r.pos,text:"",rules:n,plugin:o})}),!1)},handleKeyDown(e,r){if("Enter"!==r.key)return!1;let{$cursor:i}=e.state.selection;return!!i&&N({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:o})}},isInputRules:!0});return o}({editor:e,rules:n}),...function(e){let t,{editor:n,rules:o}=e,i=null,a=!1,l=!1,d="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{t="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch(e){t=null}let p=e=>{let{state:r,from:o,to:i,rule:s,pasteEvt:a}=e,l=r.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:c}=new u({editor:t,state:n}),p=[];return n.doc.nodesBetween(r,o,(e,t)=>{if(!e.isTextblock||e.type.spec.code)return;let u=Math.max(r,t),h=Math.min(o,t+e.content.size);R(e.textBetween(u-t,h-t,void 0,""),i.find,s).forEach(e=>{if(void 0===e.index)return;let t=u+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},h=i.handler({state:n,range:o,match:e,commands:l,chain:d,can:c,pasteEvent:s,dropEvent:a});p.push(h)})}),p.every(e=>null!==e)}({editor:n,state:c({state:r,transaction:l}),from:Math.max(o-1,0),to:i.b-1,rule:s,pasteEvent:a,dropEvent:t})&&l.steps.length){try{t="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch(e){t=null}return d="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}};return o.map(e=>new r.k_({view(e){let t=t=>{var r;(i=(null==(r=e.dom.parentElement)?void 0:r.contains(t.target))?e.dom.parentElement:null)&&($=n)},r=()=>{$&&($=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=i===e.dom.parentElement,t=n,!l){let e=$;(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,u=o.getMeta("applyPasteRules"),h=!!u;if(!i&&!c&&!h)return;if(h){let{text:t}=u;"string"==typeof t||(t=S(s.FK.from(t),r.schema));let{from:n}=u,o=n+t.length;return p({rule:e,state:r,from:n,to:{b:o},pasteEvt:L(t)})}let f=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if("number"==typeof f&&m&&f!==m.b)return p({rule:e,state:r,from:f,to:m,pasteEvt:d})}}))}({editor:e,rules:o}),...a]}get attributes(){return m(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=f(this.extensions);return Object.fromEntries(t.filter(e=>!!h(e,"addNodeView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:t.storage,editor:e,type:g(t.name,this.schema)},o=h(t,"addNodeView",r);return o?[t.name,(r,i,s,a,l)=>{let d=y(r,n);return o()({node:r,view:i,getPos:s,decorations:a,innerDecorations:l,editor:e,extension:t,HTMLAttributes:d})}]:[]}))}
1setupExtensions(){this.extensions.forEach(e=>{var t;this.editor.extensionStorage[e.name]=e.storage;let n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:O(e.name,this.schema)};"mark"===e.type&&(null==(t=k(h(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name);let r=h(e,"onBeforeCreate",n),o=h(e,"onCreate",n),i=h(e,"onUpdate",n),s=h(e,"onSelectionUpdate",n),a=h(e,"onTransaction",n),l=h(e,"onFocus",n),d=h(e,"onBlur",n),c=h(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),c&&this.editor.on("destroy",c)})}constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=z.resolve(e),this.schema=x(this.extensions,t),this.setupExtensions()}}class F{static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new F(e)}configure(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend({...this.config,addOptions:()=>I(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new F({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(t.name,'".')),t.options=k(h(t,"addOptions",{name:t.name})),t.storage=k(h(t,"addStorage",{name:t.name,options:t.options})),t}constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=k(h(this,"addOptions",{name:this.name}))),this.storage=k(h(this,"addStorage",{name:this.name,options:this.options}))||{}}}function _(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 c;e.isBlock&&n>r&&(a+=i);let u=null==s?void 0:s[e.type.name];if(u)return l&&(a+=u({node:e,pos:n,parent:l,index:d,range:t})),!1;e.isText&&(a+=null==(c=null==e?void 0:e.text)?void 0:c.slice(Math.max(r,n)-n,o-n))}),a}function H(e){return Object.fromEntries(Object.entries(e.nodes).filter(e=>{let[,t]=e;return t.spec.toText}).map(e=>{let[t,n]=e;return[t,n.spec.toText]}))}let U=F.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new r.k_({key:new r.hs("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=H(n);return _(r,{from:s,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}});function K(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{strict:!0},r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:T(t[r])?t[r].test(e[r]):t[r]===e[r])}function V(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.find(e=>e.type===t&&K(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function W(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!!V(e,t,n)}function G(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),!V([...o.node.marks],t,n)))return;let i=o.index,s=e.start()+o.offset,a=i+1,l=s+o.node.nodeSize;
1for(;i>0&&W([...e.parent.child(i-1).marks],t,n);)i-=1,s-=e.parent.child(i).nodeSize;for(;a<e.parent.childCount&&W([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function q(e,t){if("string"==typeof e){if(!t.marks[e])throw Error("There is no mark type named '".concat(e,"'. Maybe you forgot to add the extension?"));return t.marks[e]}return e}function J(e){return e instanceof r.U3}function Y(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Math.min(Math.max(e,t),n)}function X(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)return null;let n=r.LN.atStart(e),o=r.LN.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return o;let i=n.from,s=o.to;return"all"===t?r.U3.create(e,Y(0,i,s),Y(e.content.size,i,s)):r.U3.create(e,Y(t,i,s),Y(t,i,s))}function Z(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function Q(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}let ee=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&&ee(r)}return e};function et(e){return ee(new window.DOMParser().parseFromString("<body>".concat(e,"</body>"),"text/html").body)}function en(e,t,n){if(e instanceof s.bP||e instanceof s.FK)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.FK.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),en("",t,n)}if(o){if(n.errorOnInvalidContent){let r=!1,o="",i=new s.Sj({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.S4.fromSchema(i).parseSlice(et(e),n.parseOptions):s.S4.fromSchema(i).parse(et(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error("[tiptap error]: Invalid HTML content",{cause:Error("Invalid element found: ".concat(o))})}let r=s.S4.fromSchema(t);return n.slice?r.parseSlice(et(e),n.parseOptions).content:r.parse(et(e),n.parseOptions)}return en("",t,n)}let er=e=>!("type"in e);function eo(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function ei(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{from:r,to:o,empty:i}=e.selection,s=t?g(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=>K(e.node.attrs,n,{strict:!1}));return i?!!d.length:d.reduce((e,t)=>e+t.to-t.from,0)>=l}function es(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function ea(e,t){let n="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}function el(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return en(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}function ed(e,t){let n=q(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 ec(e,t){let n=new a.dL(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function eu(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function ep(e){return t=>(function(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}}})(t.$from,e)}function eh(e,t){let n=es("string"==typeof t?t:t.name,e.schema);if("node"===n){let n=g(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=>
1e.type.name===n.name);return s?{...s.attrs}:{}}return"mark"===n?ed(e,t):{}}function ef(e){let{mapping:t,steps:n}=e,r=[];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(e=>{let{from:n,to:i}=e,s=t.slice(o).map(n,-1),a=t.slice(o).map(i),l=t.invert().map(s,-1),d=t.invert().map(a);r.push({oldRange:{from:l,to:d},newRange:{from:s,to:a}})})});let o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JSON.stringify,n={};return e.filter(e=>{let r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}(r);return 1===o.length?o:o.filter((e,t)=>!o.filter((e,n)=>n!==t).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function em(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let o=G(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}function eg(e,t,n){return Object.fromEntries(Object.entries(n).filter(n=>{let[r]=n,o=e.find(e=>e.type===t&&e.name===r);return!!o&&o.attribute.keepOnSplit}))}function ev(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{empty:r,ranges:o}=e.selection,i=t?q(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!i||i.name===e.type.name).find(e=>K(e.attrs,n,{strict:!1}));let s=0,a=[];if(o.forEach(t=>{let{$from:n,$to:r}=t,o=n.pos,i=r.pos;e.doc.nodesBetween(o,i,(e,t)=>{if(!e.isText&&!e.marks.length)return;let n=Math.max(o,t),r=Math.min(i,t+e.nodeSize);s+=r-n,a.push(...e.marks.map(e=>({mark:e,from:n,to:r})))})}),0===s)return!1;let l=a.filter(e=>!i||i.name===e.mark.type.name).filter(e=>K(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}function ey(e,t){let{nodeExtensions:n}=f(t),r=n.find(t=>t.name===e);if(!r)return!1;let o={name:r.name,options:r.options,storage:r.storage},i=k(h(r,"group",o));return"string"==typeof i&&i.split(" ").includes("list")}function eb(e){var t;let{checkChildren:n=!0,ignoreWhitespace:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r){if("hardBreak"===e.type.name)return!0;if(e.isText)return/^\s*$/m.test(null!=(t=e.text)?t:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(n){let t=!0;return e.content.forEach(e=>{!1!==t&&(eb(e,{ignoreWhitespace:r,checkChildren:n})||(t=!1))}),t}return!1}function ek(e){return e instanceof r.nh}function ew(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)}}let eM=(e,t)=>{let n=ep(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;let o=e.doc.nodeAt(r);return!(n.node.type===(null==o?void 0:o.type)&&(0,a.n9)(e.doc,n.pos))||(e.join(n.pos),!0)},ex=(e,t)=>{let n=ep(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;let o=e.doc.nodeAt(r);return!(n.node.type===(null==o?void 0:o.type)&&(0,a.n9)(e.doc,r))||(e.join(r),!0)};var eO=Object.freeze({__proto__:null,blur:()=>e=>{let{editor:t,view:n}=e;return requestAnimationFrame(()=>{var e;t.isDestroyed||(n.dom.blur(),null==(e=null==window?void 0:window.getSelection())||e.removeAllRanges())}),!0},clearContent:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t=>{let{commands:n}=t;return n.setContent("",e)}},clearNodes:()=>e=>{let{state:t,tr:n,dispatch:r}=e,{selection:o}=n,{ranges:i}=o;return!r||(i.forEach(e=>{let{$from:r,$to:o}=e;t.doc.nodesBetween(r.pos,o.pos,(e,t)=>{if(e.type.isText)return;let{doc:r,mapping:o}=n,i=r.resolve(o.map(t)),s=r.resolve(o.map(t+e.nodeSize)),l=i.blockRange(s);if(!l)return;let d=(0,a.jP)(l);if(e.type.isTextblock){let{defaultType:e}=i.parent.contentMatchAt(i.index());n.setNodeMarkup(l.start,e)}(d||0===d)&&n.lift(l,d)})}),!0)},command:e=>t=>e(t),createParagraphNear:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.Z1)(t,n)},cut:(e,t)=>n=>{let{editor:o,tr:i}=n,{state:s}=o,a=s.doc.slice(e.from,e.to);i.deleteRange(e.from,e.to);let l=i.mapping.map(t);
1return i.insert(l,a.content),i.setSelection(new r.U3(i.doc.resolve(Math.max(l-1,0)))),!0},deleteCurrentNode:()=>e=>{let{tr:t,dispatch:n}=e,{selection:r}=t,o=r.$anchor.node();if(o.content.size>0)return!1;let i=t.selection.$anchor;for(let e=i.depth;e>0;e-=1)if(i.node(e).type===o.type){if(n){let n=i.before(e),r=i.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},deleteNode:e=>t=>{let{tr:n,state:r,dispatch:o}=t,i=g(e,r.schema),s=n.selection.$anchor;for(let e=s.depth;e>0;e-=1)if(s.node(e).type===i){if(o){let t=s.before(e),r=s.after(e);n.delete(t,r).scrollIntoView()}return!0}return!1},deleteRange:e=>t=>{let{tr:n,dispatch:r}=t,{from:o,to:i}=e;return r&&n.delete(o,i),!0},deleteSelection:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.ic)(t,n)},enter:()=>e=>{let{commands:t}=e;return t.keyboardShortcut("Enter")},exitCode:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.I$)(t,n)},extendMarkRange:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{tr:o,state:i,dispatch:s}=n,a=q(e,i.schema),{doc:l,selection:d}=o,{$from:c,from:u,to:p}=d;if(s){let e=G(c,a,t);if(e&&e.from<=u&&e.to>=p){let t=r.U3.create(l,e.from,e.to);o.setSelection(t)}}return!0}},first: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},focus:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{editor:r,view:o,tr:i,dispatch:s}=n;t={scrollIntoView:!0,...t};let a=()=>{(Q()||Z())&&o.dom.focus(),requestAnimationFrame(()=>{!r.isDestroyed&&(o.focus(),"undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!Q()&&!Z()&&o.dom.focus({preventScroll:!0}))})};if(o.hasFocus()&&null===e||!1===e)return!0;if(s&&null===e&&!J(r.state.selection))return a(),!0;let l=X(i.doc,e)||r.state.selection,d=r.state.selection.eq(l);return s&&(d||i.setSelection(l),d&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0}},forEach:(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),insertContent:(e,t)=>n=>{let{tr:r,commands:o}=n;return o.insertContentAt({from:r.selection.from,to:r.selection.to},e,t)},insertContentAt:(e,t,n)=>o=>{var i;let{tr:l,dispatch:d,editor:c}=o;if(d){let o,d;n={parseOptions:c.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let u=e=>{c.emit("contentError",{editor:c,error:e,disableCollaboration:()=>{c.storage.collaboration&&(c.storage.collaboration.isDisabled=!0)}})},p={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!c.options.enableContentCheck&&c.options.emitContentError)try{en(t,c.schema,{parseOptions:p,errorOnInvalidContent:!0})}catch(e){u(e)}try{o=en(t,c.schema,{parseOptions:p,errorOnInvalidContent:null!=(i=n.errorOnInvalidContent)?i:c.options.enableContentCheck})}catch(e){return u(e),!1}let{from:h,to:f}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},m=!0,g=!0;if((er(o)?o:[o]).forEach(e=>{e.check(),m=!!m&&e.isText&&0===e.marks.length,g=!!g&&e.isBlock}),h===f&&g){let{parent:e}=l.doc.resolve(h);!e.isTextblock||e.type.spec.code||e.childCount||(h-=1,f+=1)}if(m){if(Array.isArray(t))d=t.map(e=>e.text||"").join("");else if(t instanceof s.FK){let e="";t.forEach(t=>{t.text&&(e+=t.text)}),d=e}else d="object"==typeof t&&t&&t.text?t.text:t;l.insertText(d,h,f)}else d=o,l.replaceWith(h,f,d);n.updateSelection&&function(e,t,n){let o=e.steps.length-1;if(o<t)return;let i=e.steps[o];if(!(i instanceof a.Ln||i instanceof a.Wg))return;let s=e.mapping.maps[o],l=0;s.forEach((e,t,n,r)=>{0===l&&(l=r)}),e.setSelection(r.LN.near(e.doc.resolve(l),-1))}(l,l.steps.length-1,0),n.applyInputRules&&l.setMeta("applyInputRules",{from:h,text:d}),n.applyPasteRules&&l.setMeta("applyPasteRules",{from:h,text:d})}return!0},joinBackward:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.Qv)(t,n)},joinDown:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.bh)(t,n)},joinForward:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.eT)(t,n)},joinItemBackward:()=>e=>{let{state:t,dispatch:n,tr:r}=e;try{let e=(0,a.N0)(t.doc,t.selection.$from.pos,-1);if(null==e)return!1;return r.join(e,2),n&&n(r),!0}catch(e){return!1}},joinItemForward:()=>e=>{let{state:t,dispatch:n,tr:r}=e;try{let e=(0,a.N0)(t.doc,t.selection.$from.pos,1);if(null==e)return!1;return r.join(e,2),n&&n(r),!0}catch(e){return!1}},joinTextblockBackward:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.eB)(t,n)},joinTextblockForward:()=>e=>{let{state:t,dispatch:n}=e;return(0,l._G)(t,n)},joinUp:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.G2)(t,n)},keyboardShortcut:e=>t=>{let{editor:n,view:r,tr:o,dispatch:i}=t,s=(function(e){let t,n,r,o,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))Q()||eo()?o=!0:n=!0;else throw Error("Unrecognized modifier name: ".concat(s))}return t&&(s="Alt-".concat(s)),n&&(s="Ctrl-".concat(s)),o&&(s="Meta-".concat(s)),r&&(s="Shift-".concat(s)),s})(e).split(/-(?!$)/),a=s.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),l=new KeyboardEvent("keydown",{key:"Space"
1===a?" ":a,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),d=n.captureTransaction(()=>{r.someProp("handleKeyDown",e=>e(r,l))});return null==d||d.steps.forEach(e=>{let t=e.map(o.mapping);t&&i&&o.maybeStep(t)}),!0},lift:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{state:r,dispatch:o}=n,i=g(e,r.schema);return!!ei(r,i,t)&&(0,l.yY)(r,o)}},liftEmptyBlock:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.iz)(t,n)},liftListItem:e=>t=>{let{state:n,dispatch:r}=t,o=g(e,n.schema);return(0,d.T2)(o)(n,r)},newlineInCode:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.pC)(t,n)},resetAttributes:(e,t)=>n=>{let{tr:r,state:o,dispatch:i}=n,s=null,a=null,l=es("string"==typeof e?e:e.name,o.schema);return!!l&&("node"===l&&(s=g(e,o.schema)),"mark"===l&&(a=q(e,o.schema)),i&&r.selection.ranges.forEach(e=>{o.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,n)=>{s&&s===e.type&&r.setNodeMarkup(n,void 0,ea(e.attrs,t)),a&&e.marks.length&&e.marks.forEach(o=>{a===o.type&&r.addMark(n,n+e.nodeSize,a.create(ea(o.attrs,t)))})})}),!0)},scrollIntoView:()=>e=>{let{tr:t,dispatch:n}=e;return n&&t.scrollIntoView(),!0},selectAll:()=>e=>{let{tr:t,dispatch:n}=e;if(n){let e=new r.i5(t.doc);t.setSelection(e)}return!0},selectNodeBackward:()=>e=>{let{state:t,dispatch:n}=e;return(0,l._e)(t,n)},selectNodeForward:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.Sd)(t,n)},selectParentNode:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.hy)(t,n)},selectTextblockEnd:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.ec)(t,n)},selectTextblockStart:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.$f)(t,n)},setContent:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return o=>{var i,s;let{editor:a,tr:l,dispatch:d,commands:c}=o,{doc:u}=l;if("full"!==n.preserveWhitespace){let o=el(e,a.schema,n,{errorOnInvalidContent:null!=(i=r.errorOnInvalidContent)?i:a.options.enableContentCheck});return d&&l.replaceWith(0,u.content.size,o).setMeta("preventUpdate",!t),!0}return d&&l.setMeta("preventUpdate",!t),c.insertContentAt({from:0,to:u.content.size},e,{parseOptions:n,errorOnInvalidContent:null!=(s=r.errorOnInvalidContent)?s:a.options.enableContentCheck})}},setMark:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{tr:r,state:o,dispatch:i}=n,{selection:s}=r,{empty:a,ranges:l}=s,d=q(e,o.schema);if(i)if(a){let e=ed(o,d);r.addStoredMark(d.create({...e,...t}))}else l.forEach(e=>{let n=e.$from.pos,i=e.$to.pos;o.doc.nodesBetween(n,i,(e,o)=>{let s=Math.max(o,n),a=Math.min(o+e.nodeSize,i);e.marks.find(e=>e.type===d)?e.marks.forEach(e=>{d===e.type&&r.addMark(s,a,d.create({...e.attrs,...t}))}):r.addMark(s,a,d.create(t))})});return function(e,t,n){var r;let{selection:o}=t,i=null;if(J(o)&&(i=o.$cursor),i){let t=null!=(r=e.storedMarks)?r:i.marks();return!!n.isInSet(t)||!t.some(e=>e.type.excludes(n))}let{ranges:s}=o;return s.some(t=>{let{$from:r,$to:o}=t,i=0===r.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(r.pos,o.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),o=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&o}return!i}),i})}(o,r,d)}},setMeta:(e,t)=>n=>{let{tr:r}=n;return r.setMeta(e,t),!0},setNode:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let r,{state:o,dispatch:i,chain:s}=n,a=g(e,o.schema);return(o.selection.$anchor.sameParent(o.selection.$head)&&(r=o.selection.$anchor.parent.attrs),a.isTextblock)?s().command(e=>{let{commands:n}=e;return!!(0,l.y_)(a,{...r,...t})(o)||n.clearNodes()}).command(e=>{let{state:n}=e;return(0,l.y_)(a,{...r,...t})(n,i)}).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)}},setNodeSelection:e=>t=>{let{tr:n,dispatch:o}=t;if(o){let{doc:t}=n,o=Y(e,0,t.content.size),i=r.nh.create(t,o);n.setSelection(i)}return!0},setTextSelection:e=>t=>{let{tr:n,dispatch:o}=t;if(o){let{doc:t}=n,{from:o,to:i}="number"==typeof e?{from:e,to:e}:e,s=r.U3.atStart(t).from,a=r.U3.atEnd(t).to,l=Y(o,s,a),d=Y(i,s,a),c=r.U3.create(t,l,d);n.setSelection(c)}return!0},sinkListItem:e=>t=>{let{state:n,dispatch:r}=t,o=g(e,n.schema);return(0,d.$B)(o)(n,r)},splitBlock:function(){let{keepMarks:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let{tr:n,state:o,dispatch:i,editor:s}=t,{selection:l,doc:d}=n,{$from:c,$to:u}=l,p=eg(s.extensionManager.attributes,c.node().type.name,c.node().attrs);if(l instanceof r.nh&&l.node.isBlock)return!!c.parentOffset&&!!(0,a.zy)(d,c.pos)&&(i&&(e&&ew(o,s.extensionManager.splittableMarks),n.split(c.pos).scrollIntoView()),!0);if(!c.parent.isBlock)return!1;
1let h=u.parentOffset===u.parent.content.size,f=0===c.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}(c.node(-1).contentMatchAt(c.indexAfter(-1))),m=h&&f?[{type:f,attrs:p}]:void 0,g=(0,a.zy)(n.doc,n.mapping.map(c.pos),1,m);if(!m&&!g&&(0,a.zy)(n.doc,n.mapping.map(c.pos),1,f?[{type:f}]:void 0)&&(g=!0,m=f?[{type:f,attrs:p}]:void 0),i){if(g&&(l instanceof r.U3&&n.deleteSelection(),n.split(n.mapping.map(c.pos),1,m),f&&!h&&!c.parentOffset&&c.parent.type!==f)){let e=n.mapping.map(c.before()),t=n.doc.resolve(e);c.node(-1).canReplaceWith(t.index(),t.index()+1,f)&&n.setNodeMarkup(n.mapping.map(c.before()),f)}e&&ew(o,s.extensionManager.splittableMarks),n.scrollIntoView()}return g}},splitListItem:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{var o;let{tr:i,state:l,dispatch:d,editor:c}=n,u=g(e,l.schema),{$from:p,$to:h}=l.selection,f=l.selection.node;if(f&&f.isBlock||p.depth<2||!p.sameParent(h))return!1;let m=p.node(-1);if(m.type!==u)return!1;let v=c.extensionManager.attributes;if(0===p.parent.content.size&&p.node(-1).childCount===p.indexAfter(-1)){if(2===p.depth||p.node(-3).type!==u||p.index(-2)!==p.node(-2).childCount-1)return!1;if(d){let e=s.FK.empty,n=p.index(-1)?1:p.index(-2)?2:3;for(let t=p.depth-n;t>=p.depth-3;t-=1)e=s.FK.from(p.node(t).copy(e));let a=p.indexAfter(-1)<p.node(-2).childCount?1:p.indexAfter(-2)<p.node(-3).childCount?2:3,l={...eg(v,p.node().type.name,p.node().attrs),...t},d=(null==(o=u.contentMatch.defaultType)?void 0:o.createAndFill(l))||void 0;e=e.append(s.FK.from(u.createAndFill(null,d)||void 0));let c=p.before(p.depth-(n-1));i.replace(c,p.after(-a),new s.Ji(e,4-n,0));let h=-1;i.doc.nodesBetween(c,i.doc.content.size,(e,t)=>{if(h>-1)return!1;e.isTextblock&&0===e.content.size&&(h=t+1)}),h>-1&&i.setSelection(r.U3.near(i.doc.resolve(h))),i.scrollIntoView()}return!0}let y=h.pos===p.end()?m.contentMatchAt(0).defaultType:null,b={...eg(v,m.type.name,m.attrs),...t},k={...eg(v,p.node().type.name,p.node().attrs),...t};i.delete(p.pos,h.pos);let w=y?[{type:u,attrs:b},{type:y,attrs:k}]:[{type:u,attrs:b}];if(!(0,a.zy)(i.doc,p.pos,2))return!1;if(d){let{selection:e,storedMarks:t}=l,{splittableMarks:n}=c.extensionManager,r=t||e.$to.parentOffset&&e.$from.marks();if(i.split(p.pos,2,w).scrollIntoView(),!r||!d)return!0;let o=r.filter(e=>n.includes(e.type.name));i.ensureMarks(o)}return!0}},toggleList:function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return o=>{let{editor:i,tr:s,state:a,dispatch:l,chain:d,commands:c,can:u}=o,{extensions:p,splittableMarks:h}=i.extensionManager,f=g(e,a.schema),m=g(t,a.schema),{selection:v,storedMarks:y}=a,{$from:b,$to:k}=v,w=b.blockRange(k),M=y||v.$to.parentOffset&&v.$from.marks();if(!w)return!1;let x=ep(e=>ey(e.type.name,p))(v);if(w.depth>=1&&x&&w.depth-x.depth<=1){if(x.node.type===f)return c.liftListItem(m);if(ey(x.node.type.name,p)&&f.validContent(x.node.content)&&l)return d().command(()=>(s.setNodeMarkup(x.pos,f),!0)).command(()=>eM(s,f)).command(()=>ex(s,f)).run()}return n&&M&&l?d().command(()=>{let e=u().wrapInList(f,r),t=M.filter(e=>h.includes(e.type.name));return s.ensureMarks(t),!!e||c.clearNodes()}).wrapInList(f,r).command(()=>eM(s,f)).command(()=>ex(s,f)).run():d().command(()=>!!u().wrapInList(f,r)||c.clearNodes()).wrapInList(f,r).command(()=>eM(s,f)).command(()=>ex(s,f)).run()}},toggleMark:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r=>{let{state:o,commands:i}=r,{extendEmptyMarkRange:s=!1}=n,a=q(e,o.schema);return ev(o,a,t)?i.unsetMark(a,{extendEmptyMarkRange:s}):i.setMark(a,t)}},toggleNode:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r=>{let o,{state:i,commands:s}=r,a=g(e,i.schema),l=g(t,i.schema),d=ei(i,a,n);return(i.selection.$anchor.sameParent(i.selection.$head)&&(o=i.selection.$anchor.parent.attrs),d)?s.setNode(l,o):s.setNode(a,{...o,...n})}},toggleWrap:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{state:r,commands:o}=n,i=g(e,r.schema);return ei(r,i,t)?o.lift(i):o.wrapIn(i,t)}},undoInputRule:()=>e=>{let{state:t,dispatch:n}=e,r=t.plugins;for(let e=0;e<r.length;e+=1){let o,i=r[e];
1if(i.spec.isInputRules&&(o=i.getState(t))){if(n){let e=t.tr,n=o.transform;for(let t=n.steps.length-1;t>=0;t-=1)e.step(n.steps[t].invert(n.docs[t]));if(o.text){let n=e.doc.resolve(o.from).marks();e.replaceWith(o.from,o.to,t.schema.text(o.text,n))}else e.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>e=>{let{tr:t,dispatch:n}=e,{selection:r}=t,{empty:o,ranges:i}=r;return!!o||(n&&i.forEach(e=>{t.removeMark(e.$from.pos,e.$to.pos)}),!0)},unsetMark:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{var r;let{tr:o,state:i,dispatch:s}=n,{extendEmptyMarkRange:a=!1}=t,{selection:l}=o,d=q(e,i.schema),{$from:c,empty:u,ranges:p}=l;if(!s)return!0;if(u&&a){let{from:e,to:t}=l,n=null==(r=c.marks().find(e=>e.type===d))?void 0:r.attrs,i=G(c,d,n);i&&(e=i.from,t=i.to),o.removeMark(e,t,d)}else p.forEach(e=>{o.removeMark(e.$from.pos,e.$to.pos,d)});return o.removeStoredMark(d),!0}},updateAttributes:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{tr:r,state:o,dispatch:i}=n,s=null,a=null,l=es("string"==typeof e?e:e.name,o.schema);return!!l&&("node"===l&&(s=g(e,o.schema)),"mark"===l&&(a=q(e,o.schema)),i&&r.selection.ranges.forEach(e=>{let n,i,l,d,c=e.$from.pos,u=e.$to.pos;r.selection.empty?o.doc.nodesBetween(c,u,(e,t)=>{s&&s===e.type&&(l=Math.max(t,c),d=Math.min(t+e.nodeSize,u),n=t,i=e)}):o.doc.nodesBetween(c,u,(e,o)=>{o<c&&s&&s===e.type&&(l=Math.max(o,c),d=Math.min(o+e.nodeSize,u),n=o,i=e),o>=c&&o<=u&&(s&&s===e.type&&r.setNodeMarkup(o,void 0,{...e.attrs,...t}),a&&e.marks.length&&e.marks.forEach(n=>{if(a===n.type){let i=Math.max(o,c),s=Math.min(o+e.nodeSize,u);r.addMark(i,s,a.create({...n.attrs,...t}))}}))}),i&&(void 0!==n&&r.setNodeMarkup(n,void 0,{...i.attrs,...t}),a&&i.marks.length&&i.marks.forEach(e=>{a===e.type&&r.addMark(l,d,a.create({...e.attrs,...t}))}))}),!0)}},wrapIn:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{state:r,dispatch:o}=n,i=g(e,r.schema);return(0,l.Im)(i,t)(r,o)}},wrapInList:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=>{let{state:r,dispatch:o}=n,i=g(e,r.schema);return(0,d.Sd)(i,t)(r,o)}}});let eE=F.create({name:"commands",addCommands:()=>({...eO})}),eS=F.create({name:"drop",addProseMirrorPlugins(){return[new r.k_({key:new r.hs("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),eC=F.create({name:"editable",addProseMirrorPlugins(){return[new r.k_({key:new r.hs("editable"),props:{editable:()=>this.editor.options.editable}})]}}),eT=new r.hs("focusEvents"),eA=F.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;return[new r.k_({key:eT,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}}}})]}}),eP=F.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(e=>{let{commands:t}=e;return[()=>t.undoInputRule(),()=>t.command(e=>{let{tr:n}=e,{selection:o,doc:i}=n,{empty:s,$anchor:a}=o,{pos:l,parent:d}=a,c=a.parent.isTextblock&&l>0?n.doc.resolve(l-1):a,u=c.parent.type.spec.isolating,p=a.pos-a.parentOffset,h=u&&1===c.parent.childCount?p===a.pos:r.LN.atStart(i).from===l;return!!s&&!!d.type.isTextblock&&!d.textContent.length&&!!h&&(!h||"paragraph"!==a.parent.type.name)&&t.clearNodes()}),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()]}),t=()=>this.editor.commands.first(e=>{let{commands:t}=e;return[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()]}),n={Enter:()=>this.editor.commands.first(e=>{let{commands:t}=e;return[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.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()},o={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Q()||eo()?i:o},addProseMirrorPlugins(){return[new r.k_({key:new r.hs("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta("composition")))return;let o=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta("preventClearDocument"));if(!o||i)return;let{empty:s,from:a,to:l}=t.selection,d=r.LN.atStart(t.doc).from,p=r.LN.atEnd(t.doc).to;
1if(s||a!==d||l!==p||!eb(n.doc))return;let h=n.tr,f=c({state:n,transaction:h}),{commands:m}=new u({editor:this.editor,state:f});if(m.clearNodes(),h.steps.length)return h}})]}}),eN=F.create({name:"paste",addProseMirrorPlugins(){return[new r.k_({key:new r.hs("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),ej=F.create({name:"tabindex",addProseMirrorPlugins(){return[new r.k_({key:new r.hs("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class eI{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)return void console.error("You canât set content on a block node. Tried to set content on ".concat(this.name," at ").concat(this.pos));t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(0===this.depth)return null;let e=this.resolvedPos.start(this.resolvedPos.depth-1);return new eI(this.resolvedPos.doc.resolve(e),this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new eI(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new eI(e,this.editor)}get children(){let e=[];return this.node.content.forEach((t,n)=>{let r=t.isBlock&&!t.isTextblock,o=t.isAtom&&!t.isText,i=this.pos+n+ +!o;if(i<0||i>this.resolvedPos.doc.nodeSize-2)return;let s=this.resolvedPos.doc.resolve(i);if(!r&&s.depth<=this.depth)return;let a=new eI(s,this.editor,r,r?t:null);r&&(a.actualDepth=this.depth+1),e.push(new eI(s,this.editor,r,r?t:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},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){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],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)}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}}class eB extends p{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&&document&&(this.css=function(e,t,n){let r=document.querySelector("style[data-tiptap-style".concat("","]"));if(null!==r)return r;let o=document.createElement("style");return t&&o.setAttribute("nonce",t),o.setAttribute("data-tiptap-style".concat(""),""),o.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(o),o}('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}
1\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}',this.options.injectNonce))}setOptions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options={...this.options,...e},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){let n=b(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=>
1{let t="string"==typeof e?"".concat(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?[eC,U.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),eE,eA,eP,ej,eS,eN].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 z(n,this)}createCommandManager(){this.commandManager=new u({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let t;try{t=el(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>"collaboration"!==e.name),this.createExtensionManager()}}),t=el(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}let n=X(t,this.options.autofocus);this.view=new o.Lz(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...null==(e=this.options.editorProps)?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:r.$t.create({doc:t,selection:n||void 0})});let i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews(),this.prependClass(),this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className="tiptap ".concat(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 t=this.state.apply(e),n=!this.state.selection.eq(t.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});let r=e.getMeta("focus"),o=e.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!e.docChanged||e.getMeta("preventUpdate")||this.emit("update",{editor:this,transaction:e})}getAttributes(e){return eh(this.state,e)}isActive(e,t){let n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return ei(e,null,n)||ev(e,null,n);let r=es(t,e.schema);return"node"===r?ei(e,t,n):"mark"===r&&ev(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return S(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,n,t)}(this.state.doc,{blockSeparator:t,textSerializers:{...H(this.schema),...n}})}get isEmpty(){return eb(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){let e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(null==(e=this.view)?void 0:e.docView)}$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 eI(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:e=>{let{error:t}=e;throw t},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit
1("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),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",e=>{let{event:t,slice:n,moved:r}=e;return this.options.onDrop(t,n,r)}),this.on("paste",e=>{let{event:t,slice:n}=e;return this.options.onPaste(t,n)}),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}}function eD(e){return new A({find:e.find,handler:t=>{let{state:n,range:r,match:o}=t,i=k(e.getAttributes,void 0,o);if(!1===i||null===i)return null;let{tr:s}=n,a=o[o.length-1],l=o[0];if(a){let t=l.search(/\S/),o=r.from+l.indexOf(a),d=o+a.length;if(em(r.from,r.to,n.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>o).length)return null;d<r.to&&s.delete(d,r.to),o>r.from&&s.delete(r.from+t,o);let c=r.from+t+a.length;s.addMark(r.from+t,c,e.type.create(i||{})),s.removeStoredMark(e.type)}}})}function eR(e){return new A({find:e.find,handler:t=>{let{state:n,range:r,match:o}=t,i=k(e.getAttributes,void 0,o)||{},{tr:s}=n,a=r.from,l=r.to,d=e.type.create(i);if(o[1]){let e=a+o[0].lastIndexOf(o[1]);e>l?e=l:l=e+o[1].length;let t=o[0][o[0].length-1];s.insertText(t,a+o[0].length-1),s.replaceWith(e,l,d)}else if(o[0]){let t=e.type.isInline?a:a-1;s.insert(t,e.type.create(i)).delete(s.mapping.map(a),s.mapping.map(l))}s.scrollIntoView()}})}function e$(e){return new A({find:e.find,handler:t=>{let{state:n,range:r,match:o}=t,i=n.doc.resolve(r.from),s=k(e.getAttributes,void 0,o)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;n.tr.delete(r.from,r.to).setBlockType(r.from,r.from,e.type,s)}})}function eL(e){return new A({find:e.find,handler:t=>{let{state:n,range:r,match:o,chain:i}=t,s=k(e.getAttributes,void 0,o)||{},l=n.tr.delete(r.from,r.to),d=l.doc.resolve(r.from).blockRange(),c=d&&(0,a.oM)(d,e.type,s);if(!c)return null;if(l.wrap(d,c),e.keepMarks&&e.editor){let{selection:t,storedMarks:r}=n,{splittableMarks:o}=e.editor.extensionManager,i=r||t.$to.parentOffset&&t.$from.marks();if(i){let e=i.filter(e=>o.includes(e.type.name));l.ensureMarks(e)}}if(e.keepAttributes){let t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";i().updateAttributes(t,s).run()}let u=l.doc.resolve(r.from-1).nodeBefore;u&&u.type===e.type&&(0,a.n9)(l.doc,r.from-1)&&(!e.joinPredicate||e.joinPredicate(o,u))&&l.join(r.from-1)}})}class ez{static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new ez(e)}configure(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend({...this.config,addOptions:()=>I(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new ez(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(t.name,'".')),t.options=k(h(t,"addOptions",{name:t.name})),t.storage=k(h(t,"addStorage",{name:t.name,options:t.options})),t}constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=k(h(this,"addOptions",{name:this.name}))),this.storage=k(h(this,"addStorage",{name:this.name,options:this.options}))||{}}}class eF{mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,o,i,s,a,l;let{view:d}=this.editor,c=e.target,u=3===c.nodeType?null==(t=c.parentElement)?void 0:t.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(null==(n=this.contentDOM)?void 0:n.contains(c))||!u)return;let p=0,h=0;if(this.dom!==u){let t=this.dom.getBoundingClientRect(),n=u.getBoundingClientRect(),r=null!=(o=e.offsetX)?o:null==(i=e.nativeEvent)?void 0:i.offsetX,l=null!=(s=e.offsetY)?s:null==(a=e.nativeEvent)?void 0:a.offsetY;p=n.x-t.x+r,h=n.y-t.y+l}let f=this.dom.cloneNode(!0);null==(l=e.dataTransfer)||l.setDragImage(f,p,h);let m=this.getPos();if("number"!=typeof m)return;let g=r.nh.create(d.state.doc,m),v=d.state.tr.setSelection(g);d.dispatch(v)}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 o=e.type.startsWith("drag"),i="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!i&&!o)return!0;let{isEditable:s}=this.editor,{isDragging:a}=this,l=!!this.node.type.spec.draggable,d=r.nh.isSelectable(this.node),c="copy"===e.type,u="paste"===e.type,p="cut"
1===e.type,h="mousedown"===e.type;if(!l&&d&&o&&e.target===this.dom&&e.preventDefault(),l&&o&&!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&&!i&&!c&&!u&&!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&&(Q()||Z())&&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(t=>{let{tr:n}=t,r=this.getPos();return"number"==typeof r&&(n.setNodeMarkup(r,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})}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()}}function e_(e){return new D({find:e.find,handler:t=>{let{state:n,range:r,match:o,pasteEvent:i}=t,s=k(e.getAttributes,void 0,o,i);if(!1===s||null===s)return null;let{tr:a}=n,l=o[o.length-1],d=o[0],c=r.to;if(l){let t=d.search(/\S/),o=r.from+d.indexOf(l),i=o+l.length;if(em(r.from,r.to,n.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>o).length)return null;i<r.to&&a.delete(i,r.to),o>r.from&&a.delete(r.from+t,o),c=r.from+t+l.length,a.addMark(r.from+t,c,e.type.create(s||{})),a.removeStoredMark(e.type)}}})}function eH(e,t){let{selection:n}=e,{$from:o}=n;if(n instanceof r.nh){let e=o.index();return o.parent.canReplaceWith(e,e+1,t)}let i=o.depth;for(;i>=0;){let e=o.index(i);if(o.node(i).contentMatchAt(e).matchType(t))return!0;i-=1}return!1}function eU(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}}}]);
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.