PageSourceSearch

https://whitetable.ai/_next/static/chunks/520c8229-5e6b39b47ceccdb7.js

js whitetable.ai collected 2026-10-05 13:19:30 UTC 62,416 bytes, 75 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1509],{5865:function(e,t,n){n.d(t,{Cf:function(){return tT},EG:function(){return e6},Is:function(){return F},K9:function(){return tB},ML:function(){return tP},NB:function(){return tI},Nl:function(){return h},P1:function(){return y},Q:function(){return eQ},QC:function(){return eZ},S0:function(){return tj},XP:function(){return eU},b5:function(){return eY},bR:function(){return e5},hj:function(){return H},nU:function(){return k},pr:function(){return e8},tI:function(){return e0},u9:function(){return eX},vc:function(){return I},x2:function(){return tA},xh:function(){return el},zK:function(){return t$}});var r=n(2376),o=n(4348),i=n(2696),s=n(2806),a=n(6560),l=n(5804),d=n(3833);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{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])=>{let n=(...e)=>{let n=t(...e)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n};return[e,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=()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(l),s.every(e=>!0===e)),c={...Object.fromEntries(Object.entries(n).map(([e,n])=>{let r=(...e)=>{let r=this.buildProps(l,t),o=n(...e)(r);return s.push(o),c};return[e,r]})),run:d};return c}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,o=this.buildProps(r,!1),i=Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...o,dispatch:void 0})]));return{...i,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: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,t])=>[e,(...e)=>t(...e)(s)]))}};return s}}class p{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={}}}function h(e,t,n){if(void 0===e.config[t]&&e.parent)return h(e.parent,t,n);if("function"==typeof e.config[t]){let r=e.config[t].bind({...n,parent:e.parent?h(e.parent,t,n):null});return r}return e.config[t]}function f(e){let t=e.filter(e=>"extension"===e.type),n=e.filter(e=>"node"===e.type),r=e.filter(e=>"mark"===e.type);return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}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);if(!r)return;let s=r();s.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=h(e,"addAttributes",n);if(!r)return;let o=r();Object.entries(o).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 g(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}function y(...e){return e.filter(e=>!!e).reduce((e,t)=>
1{let n={...e};return Object.entries(t).forEach(([e,t])=>{let r=n[e];if(!r){n[e]=t;return}if("class"===e){let o=t?t.split(" "):[],i=n[e]?n[e].split(" "):[],s=o.filter(e=>!i.includes(e));n[e]=[...i,...s].join(" ")}else if("style"===e){let a=t?t.split(";").map(e=>e.trim()).filter(Boolean):[],l=n[e]?n[e].split(";").map(e=>e.trim()).filter(Boolean):[],d=new Map;l.forEach(e=>{let[t,n]=e.split(":").map(e=>e.trim());d.set(t,n)}),a.forEach(e=>{let[t,n]=e.split(":").map(e=>e.trim());d.set(t,n)}),n[e]=Array.from(d.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else n[e]=t}),n},{})}function v(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)=>y(e,t),{})}function b(e){return"function"==typeof e}function k(e,t,...n){return b(e)?t?e.bind(t)(...n):e(...n):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 x(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 M(e,t){return t.nodes[e]||t.marks[e]||null}function O(e,t){return Array.isArray(t)?t.some(t=>{let n="string"==typeof t?t:t.name;return n===e.name}):t}function S(e,t){let n=s.PW.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument(),o=r.createElement("div");return o.appendChild(n),o.innerHTML}let E=(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?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 C(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class P{constructor(e){this.find=e.find,this.handler=e.handler}}let T=(e,t)=>{if(C(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 A(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?void 0:t.marks.find(e=>e.type.spec.code)))return!1;let p=!1,h=E(d)+i;return s.forEach(e=>{if(p)return;let t=T(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:y}=new u({editor:n,state:d}),v=e.handler({state:d,range:f,match:t,commands:m,chain:g,can:y});null!==v&&s.steps.length&&(s.setMeta(a,{transform:s,from:r,to:o,text:i}),l.dispatch(s),p=!0)}),p}function $(e){return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function j(e,t){let n={...e};return $(e)&&$(t)&&Object.keys(t).forEach(r=>{$(t[r])&&$(e[r])?n[r]=j(e[r],t[r]):n[r]=t[r]}),n}class I{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: "${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}))||{}}static create(e={}){return new I(e)}configure(e={}){let t=this.extend({...this.config,addOptions:()=>j(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new I(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: "${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({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from,o=r.pos===r.end();if(o){let i=r.marks(),s=!!i.find(e=>
1(null==e?void 0:e.type.name)===t.name);if(!s)return!1;let a=i.find(e=>(null==e?void 0:e.type.name)===t.name);return a&&n.removeStoredMark(a),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}}class B{constructor(e){this.find=e.find,this.handler=e.handler}}let N=(e,t,n)=>{if(C(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}):[]},R=null,D=e=>{var t;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null===(t=n.clipboardData)||void 0===t||t.setData("text/html",e),n};class z{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=z.resolve(e),this.schema=function(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?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=e.reduce((e,t)=>{let r=h(t,"extendNodeSchema",i);return{...e,...r?r(n):{}}},{}),a=x({...s,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?void 0:t.default}]}))}),l=k(h(n,"parseHTML",i));l&&(a.parseDOM=l.map(e=>w(e,o)));let d=h(n,"renderHTML",i);d&&(a.toDOM=e=>d({node:e,HTMLAttributes:v(e,o)}));let c=h(n,"renderText",i);return c&&(a.toText=c),[n.name,a]})),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=e.reduce((e,t)=>{let r=h(t,"extendMarkSchema",i);return{...e,...r?r(n):{}}},{}),a=x({...s,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?void 0:t.default}]}))}),l=k(h(n,"parseHTML",i));l&&(a.parseDOM=l.map(e=>w(e,o)));let d=h(n,"renderHTML",i);return d&&(a.toDOM=e=>d({mark:e,HTMLAttributes:v(e,o)})),[n.name,a]}));return new s.V_({topNode:a,nodes:l,marks:d})}(this.extensions,t),this.setupExtensions()}static resolve(e){let t=z.sort(z.flatten(e)),n=function(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(", ")}]. This can lead to issues.`),t}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?1:0})}get commands(){return this.extensions.reduce((e,t)=>{let n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:M(t.name,this.schema)},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:M(t.name,this.schema)},s=[],a=h(t,"addKeyboardShortcuts",r),l={};if("mark"===t.type&&h(t,"exitable",r)&&(l.ArrowRight=()=>I.handleExit({editor:e,mark:t})),a){let d=Object.fromEntries(Object.entries(a()).map(([t,n])=>[t,()=>n({editor:e})]));l={...l,...d}}let c=(0,i.h)(l);s.push(c);let u=h(t,"addInputRules",r);O(t,e.options.enableInputRules)&&u&&n.push(...u());let p=h(t,"addPasteRules",r);O(t,e.options.enablePasteRules)&&p&&o.push(...p());let f=h(t,"addProseMirrorPlugins",r);if(f){let m=f();s.push(...m)}return s}).flat();return[function(e){let{editor:t,rules:n}=e,o=new r.Sy({state:{init:()=>
1null,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.HY.from(e),i.schema));let{from:r}=l,a=r+e.length;A({editor:t,from:r,to:a,text:e,rules:n,plugin:o})}),e.selectionSet||e.docChanged?null:r}},props:{handleTextInput:(e,r,i,s)=>A({editor:t,from:r,to:i,text:s,rules:n,plugin:o}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:r}=e.state.selection;r&&A({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&&A({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;let{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(p){t=null}let h=({state:e,from:r,to:o,rule:i,pasteEvt:s})=>{let a=e.tr,l=c({state:e,transaction:a}),p=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=[];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),f=e.textBetween(u-t,h-t,void 0,""),m=N(f,i.find,s);m.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)})});let h=p.every(e=>null!==e);return h}({editor:n,state:l,from:Math.max(r-1,0),to:o.b-1,rule:i,pasteEvent:s,dropEvent:t});if(p&&a.steps.length){try{t="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch(h){t=null}return d="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,a}},f=o.map(e=>new r.Sy({view(e){let t=t=>{var r;(i=(null===(r=e.dom.parentElement)||void 0===r?void 0:r.contains(t.target))?e.dom.parentElement:null)&&(R=n)},r=()=>{R&&(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 r=R;r&&setTimeout(()=>{let e=r.state.selection;e&&r.commands.deleteRange({from:e.from,to:e.to})},10)}return!1},paste(e,t){var n;let r=null===(n=t.clipboardData)||void 0===n?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"),p=!!u;if(!i&&!c&&!p)return;if(p){let{text:f}=u;"string"==typeof f||(f=S(s.HY.from(f),r.schema));let{from:m}=u,g=m+f.length,y=D(f);return h({rule:e,state:r,from:m,to:{b:g},pasteEvt:y})}let v=n.doc.content.findDiffStart(r.doc.content),b=n.doc.content.findDiffEnd(r.doc.content);if("number"==typeof v&&b&&v!==b.b)return h({rule:e,state:r,from:v,to:b,pasteEvt:d})}}));return f}({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);if(!o)return[];let i=(r,i,s,a,l)=>{let d=v(r,n);return o()({node:r,view:i,getPos:s,decorations:a,innerDecorations:l,editor:e,extension:t,HTMLAttributes:d})};return[t.name,i]}))}setupExtensions(){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:M(e.name,this.schema)};if("mark"===e.type){let r=null===(t=k(h(e,"keepOnSplit",n)))||void 0===t||t;r&&this.splittableMarks.push(e.name)}let o=h(e,"onBeforeCreate",n),i=h(e,"onCreate",n),s=h(e,"onUpdate",n),a=h(e,"onSelectionUpdate",n),l=h(e,"onTransaction",n),d=h(e,"onFocus",n),c=h(e,"onBlur",n),u=h(e,"onDestroy",n);o&&this.editor.on("beforeCreate",o),i&&this.editor.on("create",i),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),d&&this.editor.on("focus",d),c&&this.editor.on("blur",c),u&&this.editor.on("destroy",u)})}}class H{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: "${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}))||{}}static create(e={}){return new H(e)}configure(e={}){let t=this.extend({...this.config,addOptions:()=>j(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new H({...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: "${t.name}".`),t.options=k(h(t,"addOptions",{name:t.name})),t.storage=k(h(t,"addStorage",{name:t.name,options:t.options})),t}}function L(e,t,n){let{from:r,to:o}
1=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?void 0:c.slice(Math.max(r,n)-n,o-n))}),a}function F(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}let V=H.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new r.Sy({key:new r.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=F(n);return L(r,{from:s,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),_=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),null===(n=null==window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())}),!0),K=(e=!1)=>({commands:t})=>t.setContent("",e),W=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:o}=r;return!n||(o.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:o}=t,i=r.resolve(o.map(n)),s=r.resolve(o.map(n+e.nodeSize)),l=i.blockRange(s);if(!l)return;let d=(0,a.k9)(l);if(e.type.isTextblock){let{defaultType:c}=i.parent.contentMatchAt(i.index());t.setNodeMarkup(l.start,c)}(d||0===d)&&t.lift(l,d)})}),!0)},q=e=>t=>e(t),G=()=>({state:e,dispatch:t})=>(0,l.mD)(e,t),U=(e,t)=>({editor:n,tr:o})=>{let{state:i}=n,s=i.doc.slice(e.from,e.to);o.deleteRange(e.from,e.to);let a=o.mapping.map(t);return o.insert(a,s.content),o.setSelection(new r.Bs(o.doc.resolve(a-1))),!0},Y=()=>({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 i=o.depth;i>0;i-=1){let s=o.node(i);if(s.type===r.type){if(t){let a=o.before(i),l=o.after(i);e.delete(a,l).scrollIntoView()}return!0}}return!1},J=e=>({tr:t,state:n,dispatch:r})=>{let o=g(e,n.schema),i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1){let a=i.node(s);if(a.type===o){if(r){let l=i.before(s),d=i.after(s);t.delete(l,d).scrollIntoView()}return!0}}return!1},Q=e=>({tr:t,dispatch:n})=>{let{from:r,to:o}=e;return n&&t.delete(r,o),!0},X=()=>({state:e,dispatch:t})=>(0,l.NE)(e,t),Z=()=>({commands:e})=>e.keyboardShortcut("Enter"),ee=()=>({state:e,dispatch:t})=>(0,l.uo)(e,t);function et(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:C(t[r])?t[r].test(e[r]):t[r]===e[r])}function en(e,t,n={}){return e.find(e=>e.type===t&&et(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function er(e,t,n={}){return!!en(e,t,n)}function eo(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))return;n=n||(null===(r=o.node.marks[0])||void 0===r?void 0:r.attrs);let i=en([...o.node.marks],t,n);if(!i)return;let s=o.index,a=e.start()+o.offset,l=s+1,d=a+o.node.nodeSize;for(;s>0&&er([...e.parent.child(s-1).marks],t,n);)s-=1,a-=e.parent.child(s).nodeSize;for(;l<e.parent.childCount&&er([...e.parent.child(l).marks],t,n);)d+=e.parent.child(l).nodeSize,l+=1;return{from:a,to:d}}function ei(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}let es=(e,t={})=>({tr:n,state:o,dispatch:i})=>{let s=ei(e,o.schema),{doc:a,selection:l}=n,{$from:d,from:c,to:u}=l;if(i){let p=eo(d,s,t);if(p&&p.from<=c&&p.to>=u){let h=r.Bs.create(a,p.from,p.to);n.setSelection(h)}}return!0},ea=e=>t=>{let n="function"==typeof e?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function el(e){return e instanceof r.Bs}function ed(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function ec(e,t=null){if(!t)return null;let n=r.Y1.atStart(e),o=r.Y1.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.Bs.create(e,ed(0,i,s),ed(e.content.size,i,s)):r.Bs.create(e,ed(t,i,s),ed(t,i,s))}let eu=(e=null,t={})=>({editor:n,view:r,tr:o,dispatch:i})=>{t={scrollIntoView:!0,...t};let s=()=>{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&&!el(n.state.selection))return s(),!0;let a=ec(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},ep=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),eh=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),ef=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&&ef(r)}return e};function em(e){let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return ef(n)}function eg(e,t,n){if(e instanceof s.NB||e instanceof s.HY)return e;if(n={slice:!0,parseOptions:{},...n},"object"==typeof e&&null!==e)try{let r=Array.isArray(e)&&e.length>0;if(r)return s.HY.fromArray(e.map(e=>t.nodeFromJSON(e)));let o=t.nodeFromJSON(e);return n.errorOnInvalidContent&&o.check(),o}catch(i){if(n.errorOnInvalidContent)throw Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",i),eg("",t,n)}if("string"==typeof e){if(n.errorOnInvalidContent){let a=!1,l="",d=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=>(a=!0,l="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?s.aw.fromSchema(d).parseSlice(em(e),n.parseOptions):s.aw.fromSchema(d).parse(em(e),n.parseOptions),n.errorOnInvalidContent&&a)throw Error("[tiptap error]: Invalid HTML content",{cause:Error(`Invalid element found: ${l}`)})}let c=s.aw.fromSchema(t);return n.slice?c.parseSlice(em(e),n.parseOptions).content:c.parse(em(e),n.parseOptions)}return eg("",t,n)}let ey=e=>!("type"in e),ev=(e,t,n)=>({tr:o,dispatch:i,editor:l})=>{var d;if(i){let c,u;n={parseOptions:l.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};try{c=eg(t,l.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:null!==(d=n.errorOnInvalidContent)&&void 0!==d?d:l.options.enableContentCheck})}catch(p){return l.emit("contentError",{editor:l,error:p,disableCollaboration(){l.storage.collaboration&&(l.storage.collaboration.isDisabled=!0)}}),!1}let{from:h,to:f}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},m=!0,g=!0,y=ey(c)?c:[c];if(y.forEach(e=>{e.check(),m=!!m&&e.isText&&0===e.marks.length,g=!!g&&e.isBlock}),h===f&&g){let{parent:v}=o.doc.resolve(h),b=v.isTextblock&&!v.type.spec.code&&!v.childCount;b&&(h-=1,f+=1)}if(m){if(Array.isArray(t))u=t.map(e=>e.text||"").join("");else if(t instanceof s.HY){let k="";t.forEach(e=>{e.text&&(k+=e.text)}),u=k}else u="object"==typeof t&&t&&t.text?t.text:t;o.insertText(u,h,f)}else u=c,o.replaceWith(h,f,u);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.Pu||i instanceof a.FC))return;let s=e.mapping.maps[o],l=0;s.forEach((e,t,n,r)=>{0===l&&(l=r)}),e.setSelection(r.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},eb=()=>({state:e,dispatch:t})=>(0,l.MI)(e,t),ek=()=>({state:e,dispatch:t})=>(0,l.Ig)(e,t),ew=()=>({state:e,dispatch:t})=>(0,l.al)(e,t),ex=()=>({state:e,dispatch:t})=>(0,l.Y_)(e,t),eM=()=>({state:e,dispatch:t,tr:n})=>{try{let r=(0,a.GJ)(e.doc,e.selection.$from.pos,-1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch(o){return!1}},eO=()=>({state:e,dispatch:t,tr:n})=>{try{let r=(0,a.GJ)(e.doc,e.selection.$from.pos,1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch(o){return!1}},eS=()=>({state:e,dispatch:t})=>(0,l.rr)(e,t),eE=()=>({state:e,dispatch:t})=>(0,l.cR)(e,t);function eC(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function eP(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}let eT=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 a=0;a<i.length-1;a+=1){let l=i[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))t=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else if(/^s(hift)?$/i.test(l))r=!0;else if(/^mod$/i.test(l))eC()||eP()?o=!0:n=!0;else throw Error(`Unrecognized modifier name: ${l}`)}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 eA(e,t,n={}){let{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.min(o,t+e.nodeSize);a.push({node:e,from:Math.max(r,t),to:n})});let l=a.filter(e=>!s||s.name===e.node.type.name).filter(e=>et(e.node.attrs,n,{strict:!1}));if(i)return!!l.length;let d=l.reduce((e,t)=>e+t.to-t.from,0);return d>=o-r}let e$=(e,t={})=>({state:n,dispatch:r})=>{let o=g(e,n.schema),i=eA(n,o,t);return!!i&&(0,l.xb)(n,r)},ej=()=>({state:e,dispatch:t})=>(0,l.X0)(e,t),eI=e=>({state:t,dispatch:n})=>{let r=g(e,t.schema);return(0,d.IB)(r)(t,n)},eB=()=>({state:e,dispatch:t})=>(0,l.QK)(e,t);function eN(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function eR(e,t){let n="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}let eD=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null,a=eN("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(i=g(e,r.schema)),"mark"===a&&(s=ei(e,r.schema)),o&&n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{i&&i===e.type&&n.setNodeMarkup(r,void 0,eR(e.attrs,t)),s&&e.marks.length&&e.marks.forEach(o=>{s===o.type&&n.addMark(r,r+e.nodeSize,s.create(eR(o.attrs,t)))})})}),!0)},ez=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),eH=()=>({tr:e,dispatch:t})=>{if(t){let n=new r.C1(e.doc);e.setSelection(n)}return!0},eL=()=>({state:e,dispatch:t})=>(0,l._M)(e,t),eF=()=>({state:e,dispatch:t})=>(0,l.o)(e,t),eV=()=>({state:e,dispatch:t})=>(0,l.N0)(e,t),e_=()=>({state:e,dispatch:t})=>(0,l.nw)(e,t),eK=()=>({state:e,dispatch:t})=>(0,l.U9)(e,t);function eW(e,t,n={},r={}){return eg(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}let eq=(e,t=!1,n={},r={})=>({editor:o,tr:i,dispatch:s,commands:a})=>{var l,d;let{doc:c}=i;if("full"!==n.preserveWhitespace){let u=eW(e,o.schema,n,{errorOnInvalidContent:null!==(l=r.errorOnInvalidContent)&&void 0!==l?l:o.options.enableContentCheck});return s&&i.replaceWith(0,c.content.size,u).setMeta("preventUpdate",!t),!0}return s&&i.setMeta("preventUpdate",!t),a.insertContentAt({from:0,to:c.content.size},e,{parseOptions:n,errorOnInvalidContent:null!==(d=r.errorOnInvalidContent)&&void 0!==d?d:o.options.enableContentCheck})};function eG(e,t){let n=ei(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 eU(e,t){let n=new a.wx(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function eY(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function eJ(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 eQ(e,t){let n={from:0,to:e.content.size};return L(e,n,t)}function eX(e,t){let n=eN("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){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=>e.type.name===n.name);return s?{...s.attrs}:{}}(e,t):"mark"===n?eG(e,t):{}}function eZ(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:s,to:a}=n[o];if(void 0===s||void 0===a)return;i.push({from:s,to:a})}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);
1return 1===t.length?t:t.filter((e,n)=>{let r=t.filter((e,t)=>t!==n);return!r.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)}function e0(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let o=n.resolve(e),i=eo(o,t.type);i&&r.push({mark:t,...i})}):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 e1(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}))}function e2(e,t,n={}){let{empty:r,ranges:o}=e.selection,i=t?ei(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!i||i.name===e.type.name).find(e=>et(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=>et(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 e3(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 e5(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)&&void 0!==r?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let o=!0;return e.content.forEach(e=>{!1!==o&&(e5(e,{ignoreWhitespace:n,checkChildren:t})||(o=!1))}),o}return!1}function e6(e){return e instanceof r.qv}function e8(e,t,n){let r=e.state.doc.content.size,o=ed(t,0,r),i=ed(n,0,r),s=e.coordsAtPos(o),a=e.coordsAtPos(i,-1),l=Math.min(s.top,a.top),d=Math.max(s.bottom,a.bottom),c=Math.min(s.left,a.left),u=Math.max(s.right,a.right),p={top:l,bottom:d,left:c,right:u,width:u-c,height:d-l,x:c,y:l};return{...p,toJSON:()=>p}}let e9=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let{selection:i}=n,{empty:s,ranges:a}=i,l=ei(e,r.schema);if(o){if(s){let d=eG(r,l);n.addStoredMark(l.create({...d,...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),d=e.marks.find(e=>e.type===l);d?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(el(o)&&(i=o.$cursor),i){let s=null!==(r=e.storedMarks)&&void 0!==r?r:i.marks();return!!n.isInSet(s)||!s.some(e=>e.type.excludes(n))}let{ranges:a}=o;return a.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 i=!r||r.type.allowsMarkType(n),s=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));o=i&&s}return!o}),o})}(r,n,l)},e4=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),e7=(e,t={})=>({state:n,dispatch:r,chain:o})=>{let i;let s=g(e,n.schema);return(n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),s.isTextblock)?o().command(({commands:e})=>{let r=(0,l.uJ)(s,{...i,...t})(n);return!!r||e.clearNodes()}).command(({state:e})=>(0,l.uJ)(s,{...i,...t})(e,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},te=e=>({tr:t,dispatch:n})=>{if(n){let{doc:o}=t,i=ed(e,0,o.content.size),s=r.qv.create(o,i);t.setSelection(s)}return!0},tt=e=>({tr:t,dispatch:n})=>{if(n){let{doc:o}=t,{from:i,to:s}="number"==typeof e?{from:e,to:e}:e,a=r.Bs.atStart(o).from,l=r.Bs.atEnd(o).to,d=ed(i,a,l),c=ed(s,a,l),u=r.Bs.create(o,d,c);t.setSelection(u)}return!0},tn=e=>({state:t,dispatch:n})=>{let r=g(e,t.schema);return(0,d.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=>
1null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}let to=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:o,editor:i})=>{let{selection:s,doc:l}=t,{$from:d,$to:c}=s,u=i.extensionManager.attributes,p=e1(u,d.node().type.name,d.node().attrs);if(s instanceof r.qv&&s.node.isBlock)return!!(d.parentOffset&&(0,a.Ax)(l,d.pos))&&(o&&(e&&tr(n,i.extensionManager.splittableMarks),t.split(d.pos).scrollIntoView()),!0);if(!d.parent.isBlock)return!1;let h=c.parentOffset===c.parent.content.size,f=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=h&&f?[{type:f,attrs:p}]:void 0,g=(0,a.Ax)(t.doc,t.mapping.map(d.pos),1,m);if(!m&&!g&&(0,a.Ax)(t.doc,t.mapping.map(d.pos),1,f?[{type:f}]:void 0)&&(g=!0,m=f?[{type:f,attrs:p}]:void 0),o){if(g&&(s instanceof r.Bs&&t.deleteSelection(),t.split(t.mapping.map(d.pos),1,m),f&&!h&&!d.parentOffset&&d.parent.type!==f)){let y=t.mapping.map(d.before()),v=t.doc.resolve(y);d.node(-1).canReplaceWith(v.index(),v.index()+1,f)&&t.setNodeMarkup(t.mapping.map(d.before()),f)}e&&tr(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return g},ti=(e,t={})=>({tr:n,state:o,dispatch:i,editor:l})=>{var d;let c=g(e,o.schema),{$from:u,$to:p}=o.selection,h=o.selection.node;if(h&&h.isBlock||u.depth<2||!u.sameParent(p))return!1;let f=u.node(-1);if(f.type!==c)return!1;let m=l.extensionManager.attributes;if(0===u.parent.content.size&&u.node(-1).childCount===u.indexAfter(-1)){if(2===u.depth||u.node(-3).type!==c||u.index(-2)!==u.node(-2).childCount-1)return!1;if(i){let y=s.HY.empty,v=u.index(-1)?1:u.index(-2)?2:3;for(let b=u.depth-v;b>=u.depth-3;b-=1)y=s.HY.from(u.node(b).copy(y));let k=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,w={...e1(m,u.node().type.name,u.node().attrs),...t},x=(null===(d=c.contentMatch.defaultType)||void 0===d?void 0:d.createAndFill(w))||void 0;y=y.append(s.HY.from(c.createAndFill(null,x)||void 0));let M=u.before(u.depth-(v-1));n.replace(M,u.after(-k),new s.p2(y,4-v,0));let O=-1;n.doc.nodesBetween(M,n.doc.content.size,(e,t)=>{if(O>-1)return!1;e.isTextblock&&0===e.content.size&&(O=t+1)}),O>-1&&n.setSelection(r.Bs.near(n.doc.resolve(O))),n.scrollIntoView()}return!0}let S=p.pos===u.end()?f.contentMatchAt(0).defaultType:null,E={...e1(m,f.type.name,f.attrs),...t},C={...e1(m,u.node().type.name,u.node().attrs),...t};if(n.delete(u.pos,p.pos),!(0,a.Ax)(n.doc,u.pos,2))return!1;if(i){let{selection:P,storedMarks:T}=o,{splittableMarks:A}=l.extensionManager,$=T||P.$to.parentOffset&&P.$from.marks();if(n.split(u.pos,2,S?[{type:c,attrs:E},{type:S,attrs:C}]:[{type:c,attrs:E}]).scrollIntoView(),!$||!i)return!0;let j=$.filter(e=>A.includes(e.type.name));n.ensureMarks(j)}return!0},ts=(e,t)=>{let n=eJ(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),i=n.node.type===(null==o?void 0:o.type)&&(0,a.Mn)(e.doc,n.pos);return!i||(e.join(n.pos),!0)},ta=(e,t)=>{let n=eJ(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),i=n.node.type===(null==o?void 0:o.type)&&(0,a.Mn)(e.doc,r);return!i||(e.join(r),!0)},tl=(e,t,n,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:l,commands:d,can:c})=>{let{extensions:u,splittableMarks:p}=o.extensionManager,h=g(e,s.schema),f=g(t,s.schema),{selection:m,storedMarks:y}=s,{$from:v,$to:b}=m,k=v.blockRange(b),w=y||m.$to.parentOffset&&m.$from.marks();if(!k)return!1;let x=eJ(e=>e3(e.type.name,u))(m);if(k.depth>=1&&x&&k.depth-x.depth<=1){if(x.node.type===h)return d.liftListItem(f);if(e3(x.node.type.name,u)&&h.validContent(x.node.content)&&a)return l().command(()=>(i.setNodeMarkup(x.pos,h),!0)).command(()=>ts(i,h)).command(()=>ta(i,h)).run()}return n&&w&&a?l().command(()=>{let e=c().wrapInList(h,r),t=w.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(()=>{let e=c().wrapInList(h,r);return!!e||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=ei(e,r.schema),a=e2(r,s,t);return a?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,t)},tc=(e,t,n={})=>({state:r,commands:o})=>{let i;let s=g(e,r.schema),a=g(t,r.schema),l=eA(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})},tu=(e,t={})=>({state:n,commands:r})=>{let o=g(e,n.schema),i=eA(n,o,t);return i?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 s=e.tr,a=o.transform;
1for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){let d=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,e.schema.text(o.text,d))}else s.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)},tf=(e,t={})=>({tr:n,state:r,dispatch:o})=>{var i;let{extendEmptyMarkRange:s=!1}=t,{selection:a}=n,l=ei(e,r.schema),{$from:d,empty:c,ranges:u}=a;if(!o)return!0;if(c&&s){let{from:p,to:h}=a,f=null===(i=d.marks().find(e=>e.type===l))||void 0===i?void 0:i.attrs,m=eo(d,l,f);m&&(p=m.from,h=m.to),n.removeMark(p,h,l)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,l)});return n.removeStoredMark(l),!0},tm=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null,a=eN("string"==typeof e?e:e.name,r.schema);return!!a&&("node"===a&&(i=g(e,r.schema)),"mark"===a&&(s=ei(e,r.schema)),o&&n.selection.ranges.forEach(e=>{let o,a,l,d;let c=e.$from.pos,u=e.$to.pos;n.selection.empty?r.doc.nodesBetween(c,u,(e,t)=>{i&&i===e.type&&(l=Math.max(t,c),d=Math.min(t+e.nodeSize,u),o=t,a=e)}):r.doc.nodesBetween(c,u,(e,r)=>{r<c&&i&&i===e.type&&(l=Math.max(r,c),d=Math.min(r+e.nodeSize,u),o=r,a=e),r>=c&&r<=u&&(i&&i===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),s&&e.marks.length&&e.marks.forEach(o=>{if(s===o.type){let i=Math.min(r+e.nodeSize,u);n.addMark(Math.max(r,c),i,s.create({...o.attrs,...t}))}}))}),a&&(void 0!==o&&n.setNodeMarkup(o,void 0,{...a.attrs,...t}),s&&a.marks.length&&a.marks.forEach(e=>{s===e.type&&n.addMark(l,d,s.create({...e.attrs,...t}))}))}),!0)},tg=(e,t={})=>({state:n,dispatch:r})=>{let o=g(e,n.schema);return(0,l.ym)(o,t)(n,r)},ty=(e,t={})=>({state:n,dispatch:r})=>{let o=g(e,n.schema);return(0,d.KI)(o,t)(n,r)};var tv=Object.freeze({__proto__:null,blur:_,clearContent:K,clearNodes:W,command:q,createParagraphNear:G,cut:U,deleteCurrentNode:Y,deleteNode:J,deleteRange:Q,deleteSelection:X,enter:Z,exitCode:ee,extendMarkRange:es,first:ea,focus:eu,forEach:ep,insertContent:eh,insertContentAt:ev,joinBackward:ew,joinDown:ek,joinForward:ex,joinItemBackward:eM,joinItemForward:eO,joinTextblockBackward:eS,joinTextblockForward:eE,joinUp:eb,keyboardShortcut:eT,lift:e$,liftEmptyBlock:ej,liftListItem:eI,newlineInCode:eB,resetAttributes:eD,scrollIntoView:ez,selectAll:eH,selectNodeBackward:eL,selectNodeForward:eF,selectParentNode:eV,selectTextblockEnd:e_,selectTextblockStart:eK,setContent:eq,setMark:e9,setMeta:e4,setNode:e7,setNodeSelection:te,setTextSelection:tt,sinkListItem:tn,splitBlock:to,splitListItem:ti,toggleList:tl,toggleMark:td,toggleNode:tc,toggleWrap:tu,undoInputRule:tp,unsetAllMarks:th,unsetMark:tf,updateAttributes:tm,wrapIn:tg,wrapInList:ty});let tb=H.create({name:"commands",addCommands:()=>({...tv})}),tk=H.create({name:"drop",addProseMirrorPlugins(){return[new r.Sy({key:new r.H$("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),tw=H.create({name:"editable",addProseMirrorPlugins(){return[new r.Sy({key:new r.H$("editable"),props:{editable:()=>this.editor.options.editable}})]}}),tx=H.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;return[new r.Sy({key:new r.H$("focusEvents"),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}}}})]}}),tM=H.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:o}=t,{empty:i,$anchor:s}=n,{pos:a,parent:l}=s,d=s.parent.isTextblock&&a>0?t.doc.resolve(a-1):s,c=d.parent.type.spec.isolating,u=s.pos-s.parentOffset,p=c&&1===d.parent.childCount?u===s.pos:r.Y1.atStart(o).from===a;return!!i&&!!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=()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),o={Enter:n,"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()},i={...o},s={...o,"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 eC()||eP()?s:i},addProseMirrorPlugins(){return[new r.Sy({key:new r.H$("clearDocument"),appendTransaction:(e,t,n)=>{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.Y1.atStart(t.doc).from,p=r.Y1.atEnd(t.doc).to;
1if(s||!(a===d&&l===p))return;let h=e5(n.doc);if(!h)return;let f=n.tr,m=c({state:n,transaction:f}),{commands:g}=new u({editor:this.editor,state:m});if(g.clearNodes(),f.steps.length)return f}})]}}),tO=H.create({name:"paste",addProseMirrorPlugins(){return[new r.Sy({key:new r.H$("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),tS=H.create({name:"tabindex",addProseMirrorPlugins(){return[new r.Sy({key:new r.H$("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class tE{get name(){return this.node.type.name}constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return null!==(e=this.actualDepth)&&void 0!==e?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’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(0===this.depth)return null;let e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new tE(t,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 tE(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 tE(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?0:1),s=this.resolvedPos.doc.resolve(i);if(!r&&s.depth<=this.depth)return;let a=new tE(s,this.editor,r,r?t:null);r&&(a.actualDepth=this.depth+1),e.push(new tE(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,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e){if(Object.keys(t).length>0){let o=r.node.attrs,i=Object.keys(t);for(let s=0;s<i.length;s+=1){let a=i[s];if(o[a]!==t[a])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=>{if(!n||!(r.length>0)){if(i.node.type.name===e){let s=o.every(e=>t[e]===i.node.attrs[e]);s&&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)}}let tC=`.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}
72
73.tippy-box[data-animation=fade][data-state=hidden] {
74  opacity: 0
75}`;class tP extends p{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,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError({error:e}){throw e},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("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",({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on("paste",({event:e,slice:t})=>this.options.onPaste(e,t)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}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${n?`-${n}`:""}]`);if(null!==r)return r;let o=document.createElement("style");return t&&o.setAttribute("nonce",t),o.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),o.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(o),o}(tC,this.options.injectNonce))}setOptions(e={}){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,t=!0){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=>{let r="string"==typeof e?`${e}$`:e.key;n=t.filter(e=>!e.key.startsWith(r))}),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?[tw,V.configure({blockSeparator:null===(t=null===(e=this.options.coreExtensionOptions)||void 0===e?void 0:e.clipboardTextSerializer)||void 0===t?void 0:t.blockSeparator}),tb,tx,tM,tS,tk,tO].filter(e=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[e.name]):[],r=[...n,...this.options.extensions].filter(e=>["extension","node","mark"].includes(null==e?void 0:e.type));this.extensionManager=new z(r,this)}createCommandManager(){this.commandManager=new u({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let t;try{t=eW(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(n){if(!(n instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(n.message))throw n;
75this.emit("contentError",{editor:this,error:n,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>"collaboration"!==e.name),this.createExtensionManager()}}),t=eW(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}let i=ec(t,this.options.autofocus);this.view=new o.tk(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...null===(e=this.options.editorProps)||void 0===e?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:r.yy.create({doc:t,selection:i||void 0})});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.createNodeViews(),this.prependClass();let a=this.view.dom;a.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${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?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 eX(this.state,e)}isActive(e,t){return function(e,t,n={}){if(!t)return eA(e,null,n)||e2(e,null,n);let r=eN(t,e.schema);return"node"===r?eA(e,t,n):"mark"===r&&e2(e,t,n)}(this.state,"string"==typeof e?e:null,"string"==typeof e?t:e)}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 eQ(this.state.doc,{blockSeparator:t,textSerializers:{...F(this.schema),...n}})}get isEmpty(){return e5(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?void 0:e.docView)}$node(e,t){var n;return(null===(n=this.$doc)||void 0===n?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return(null===(n=this.$doc)||void 0===n?void 0:n.querySelectorAll(e,t))||null}$pos(e){let t=this.state.doc.resolve(e);return new tE(t,this)}get $doc(){return this.$pos(0)}}function tT(e){return new P({find:e.find,handler({state:t,range:n,match:r}){let o=k(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 l=a.search(/\S/),d=n.from+a.indexOf(s),c=d+s.length,u=e0(n.from,n.to,t.doc).filter(t=>{let n=t.mark.type.excluded;return n.find(n=>n===e.type&&n!==t.mark.type)}).filter(e=>e.to>d);if(u.length)return null;c<n.to&&i.delete(c,n.to),d>n.from&&i.delete(n.from+l,d);let p=n.from+l+s.length;i.addMark(n.from+l,p,e.type.create(o||{})),i.removeStoredMark(e.type)}}})}function tA(e){return new P({find:e.find,handler({state:t,range:n,match:r}){let o=k(e.getAttributes,void 0,r)||{},{tr:i}=t,s=n.from,a=n.to,l=e.type.create(o);if(r[1]){let d=r[0].lastIndexOf(r[1]),c=s+d;c>a?c=a:a=c+r[1].length;let u=r[0][r[0].length-1];i.insertText(u,s+r[0].length-1),i.replaceWith(c,a,l)}else if(r[0]){let p=e.type.isInline?s:s-1;i.insert(p,e.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()}})}function t$(e){return new P({find:e.find,handler({state:t,range:n,match:r}){let o=t.doc.resolve(n.from),i=k(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)}})}function tj(e){return new P({find:e.find,handler({state:t,range:n,match:r,chain:o}){let i=k(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),l=s.doc.resolve(n.from),d=l.blockRange(),c=d&&(0,a.nd
75)(d,e.type,i);if(!c)return null;if(s.wrap(d,c),e.keepMarks&&e.editor){let{selection:u,storedMarks:p}=t,{splittableMarks:h}=e.editor.extensionManager,f=p||u.$to.parentOffset&&u.$from.marks();if(f){let m=f.filter(e=>h.includes(e.type.name));s.ensureMarks(m)}}if(e.keepAttributes){let g="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";o().updateAttributes(g,i).run()}let y=s.doc.resolve(n.from-1).nodeBefore;y&&y.type===e.type&&(0,a.Mn)(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,y))&&s.join(n.from-1)}})}class tI{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: "${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}))||{}}static create(e={}){return new tI(e)}configure(e={}){let t=this.extend({...this.config,addOptions:()=>j(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new tI(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: "${t.name}".`),t.options=k(h(t,"addOptions",{name:t.name})),t.storage=k(h(t,"addStorage",{name:t.name,options:t.options})),t}}function tB(e){return new B({find:e.find,handler({state:t,range:n,match:r,pasteEvent:o}){let i=k(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 c=l.search(/\S/),u=n.from+l.indexOf(a),p=u+a.length,h=e0(n.from,n.to,t.doc).filter(t=>{let n=t.mark.type.excluded;return n.find(n=>n===e.type&&n!==t.mark.type)}).filter(e=>e.to>u);if(h.length)return null;p<n.to&&s.delete(p,n.to),u>n.from&&s.delete(n.from+c,u),d=n.from+c+a.length,s.addMark(n.from+c,d,e.type.create(i||{})),s.removeStoredMark(e.type)}}})}}}]);

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.