PageSourceSearch

https://xroid.ai/_next/static/chunks/54a60aa6.b7975ef0785a05f2.js

js xroid.ai collected 2026-10-05 14:50:03 UTC 91,761 bytes, 78 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[60277],{419346:(e,t,n)=>{n.d(t,{AB:()=>tH,BQ:()=>tr,CU:()=>ne,Ce:()=>nC,Db:()=>t4,Dd:()=>t1,FF:()=>e0,H_:()=>e3,JJ:()=>nO,J_:()=>e8,KE:()=>nk,KV:()=>e_,Nx:()=>e$,OF:()=>U,OX:()=>nT,Pg:()=>x,QN:()=>e6,T7:()=>eD,YY:()=>ns,Yv:()=>nD,Zc:()=>n$,_n:()=>nt,_w:()=>eZ,bP:()=>nP,eE:()=>L,fV:()=>t7,fl:()=>e2,gu:()=>eQ,hO:()=>e1,kj:()=>t3,m0:()=>_,oE:()=>tJ,rU:()=>eh,tG:()=>nA,zU:()=>eU});var r=n(991413),o=n(472093),i=n(493221),s=n(255526),a=n(798836),l=n(394199),d=n(227296),c=n(506010),u=n(275013),p=n(702818);function h(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}var f=class e{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s=[],a=!!e,l=e||o.tr,d={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(l,t),o=n(...e)(r);return s.push(o),d}])),run:()=>(a||!t||l.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(l),s.every(e=>!0===e))};return d}static createFakeChain(){let e=new Proxy({},{get:(t,n)=>{if("then"!==n)return"run"===n?()=>!1:()=>e}});return e}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,o=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...o,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}static createFallbackCan(){let t=e.createFakeChain();return new Proxy({chain:()=>t},{get:(e,t)=>{if("then"!==t)return"chain"===t?e.chain:()=>!1}})}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s={tr:e,editor:r,view:i,state:h({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}};let m=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{if(!e.isDestroyed){var n;t.dom.blur(),null===(n=window)||void 0===n||null===(n=n.getSelection())||void 0===n||n.removeAllRanges()}}),!0),g=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),y=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return!n||(i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,s=r.resolve(i.map(n)),a=r.resolve(i.map(n+e.nodeSize)),l=s.blockRange(a);if(!l)return;let d=(0,o.jP)(l);if(e.type.isTextblock){let{defaultType:e}=s.parent.contentMatchAt(s.index());t.setNodeMarkup(l.start,e)}(d||0===d)&&t.lift(l,d)})}),!0)},v=e=>t=>e(t),b=()=>({state:e,dispatch:t})=>(0,i.Z1)(e,t),w=(e,t)=>({editor:n,tr:r})=>{let{state:o}=n,i=o.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let a=r.mapping.map(t);return r.insert(a,i.content),r.setSelection(new s.U3(r.doc.resolve(Math.max(a-1,0)))),!0},k=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let o=e.selection.$anchor;for(let n=o.depth;n>0;n-=1)if(o.node(n).type===r.type){if(t){let t=o.before(n),r=o.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function x(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}let M=e=>({tr:t,state:n,dispatch:r})=>{let o=x(e,n.schema),i=t.selection.$anchor;for(let e=i.depth;e>0;e-=1)if(i.node(e).type===o){if(r){let n=i.before(e),r=i.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},S=e=>({tr:t,dispatch:n})=>{let{from:r,to:o}=e;return n&&t.delete(r,o),!0},E=e=>
1!!e.content&&/^text(\*|\+)/.test(e.content),T=(e,t,n)=>!e.parent.isInline||"left"===n&&e.pos>e.start()||"right"===n&&e.pos<e.end()||!E(t.nodes[e.parent.type.name].spec)?e.pos:"left"===n?e.start()-1:e.end()+1,C=(e,t,n)=>({from:T(e,n,"left"),to:T(t,n,"right")}),O=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){let n=e.tr,{ranges:r}=e.selection,o=n.steps.length;r.forEach(t=>{let r=n.mapping.slice(o),{from:i,to:s}=C(n.doc.resolve(r.map(t.$from.pos)),n.doc.resolve(r.map(t.$to.pos)),e.schema);n.deleteRange(i,s)}),n.selection.empty||n.setSelection(s.U3.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),t(n)}return!0},A=()=>({commands:e})=>e.keyboardShortcut("Enter"),P=()=>({state:e,dispatch:t})=>(0,i.I$)(e,t);function D(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function $(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:D(t[r])?t[r].test(e[r]):t[r]===e[r])}function I(e,t,n={}){return e.find(e=>e.type===t&&$(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function R(e,t,n={}){return!!I(e,t,n)}function N(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(r.node&&r.node.marks.some(e=>e.type===t)||(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!I([...r.node.marks],t,n))return;let o=r.index,i=e.start()+r.offset,s=o+1,a=i+r.node.nodeSize;for(;o>0&&R([...e.parent.child(o-1).marks],t,n);)o-=1,i-=e.parent.child(o).nodeSize;for(;s<e.parent.childCount&&R([...e.parent.child(s).marks],t,n);)a+=e.parent.child(s).nodeSize,s+=1;return{from:i,to:a}}function j(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 B=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=j(e,r.schema),{doc:a,selection:l}=n,{$from:d,from:c,to:u}=l;if(o){let e=N(d,i,t);if(e&&e.from<=c&&e.to>=u){let t=s.U3.create(a,e.from,e.to);n.setSelection(t)}}return!0},z=e=>t=>{let n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function L(e){return e instanceof s.U3}function V(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function F(e,t=null){if(!t)return null;let n=s.LN.atStart(e),r=s.LN.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;let o=n.from,i=r.to;return"all"===t?s.U3.create(e,V(0,o,i),V(e.content.size,o,i)):s.U3.create(e,V(t,o,i),V(t,o,i))}function _(){return["Android"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function U(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}let K=(e=null,t={})=>({editor:n,view:r,tr:o,dispatch:i})=>{t={scrollIntoView:!0,...t};let s=()=>{(U()||_())&&r.dom.focus(),"undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!U()&&!_()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{!n.isDestroyed&&(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&null===e||!1===e)return!0}catch{return!1}if(i&&null===e&&!L(n.state.selection))return s(),!0;let a=F(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},W=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),H=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),q=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&&q(r)}return e};function J(e){if("undefined"==typeof window)throw Error("[tiptap error]: there is no window object available, so this function cannot be used");let t=`<body>${e}</body>`;return q(new window.DOMParser().parseFromString(t,"text/html").body)}function Y(e){return"function"==typeof(null==e?void 0:e.nodesBetween)}function Z(e,t,n){if(Y(e))return e;let r="object"==typeof e&&null!==e;n={slice:!0,parseOptions:{},...n};let o="string"==typeof e;if(r)try{if(Array.isArray(e)&&e.length>0)return a.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),Z("",t,n)}if(o){if(n.errorOnInvalidContent){let r=!1,o="",i=new a.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?a.S4.fromSchema(i).parseSlice(J(e),n.parseOptions):a.S4.fromSchema(i).parse(J(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error("[tiptap error]: Invalid HTML content",{cause:Error(`Invalid element found: ${o}`)})}let r=a.S4.fromSchema(t);return n.slice?r.parseSlice(J(e),n.parseOptions).content:r.parse(J(e),n.parseOptions)}return Z("",t,n)}function G(e){return!("type"in e)}
1function X(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof o.Ln||i instanceof o.Wg))return;let a=e.mapping.maps[r],l=0;a.forEach((e,t,n,r)=>{0===l&&(l=r)}),e.setSelection(s.LN.near(e.doc.resolve(l),n))}let Q=(e,t,n)=>({tr:r,dispatch:o,editor:i})=>{if(o){let o,l;n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let d=e=>{i.emit("contentError",{editor:i,error:e,disableCollaboration:()=>{"collaboration"in i.storage&&"object"==typeof i.storage.collaboration&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{Z(t,i.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(e){d(e)}try{var s;o=Z(t,i.schema,{parseOptions:c,errorOnInvalidContent:null!==(s=n.errorOnInvalidContent)&&void 0!==s?s:i.options.enableContentCheck})}catch(e){return d(e),!1}let{from:u,to:p}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},h=!0,f=!0,m=G(o)?o.content:[o];if(m.forEach(e=>{e.check(),h=!!h&&e.isText&&0===e.marks.length,f=!!f&&e.isBlock}),u===p&&f){let{parent:e}=r.doc.resolve(u);!e.isTextblock||e.type.spec.code||e.childCount||(u-=1,p+=1)}if(h)l=Array.isArray(t)?t.map(e=>e.text||"").join(""):Y(t)?m.map(e=>{var t;return null!==(t=e.text)&&void 0!==t?t:""}).join(""):"object"==typeof t&&t&&t.text?t.text:t,r.insertText(l,u,p);else{l=a.FK.from(m);let e=r.doc.resolve(u),t=e.node(),n=0===e.parentOffset,o=t.isText||t.isTextblock,i=t.content.size>0;n&&o&&i&&f&&(u=Math.max(0,u-1)),r.replaceWith(u,p,m)}n.updateSelection&&X(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:l}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:l})}return!0};function ee(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}let et=(e={})=>({tr:t,dispatch:n,editor:r})=>{let o,i;let{pos:s,attrs:a,content:l,updateSelection:d=!0}=e,c=ee((o="number"==typeof s?t.doc.resolve(s):s||t.selection.$from).parent.contentMatchAt(o.index()));if(!c)return!1;let u=Object.keys(c.spec.attrs||{}),p=a?Object.fromEntries(Object.entries(a).filter(([e])=>u.includes(e))):{};if(l){let e=Z(l,r.schema);i=c.createAndFill(p,e)}else i=c.createAndFill(p);return!!i&&(n&&(t.insert(o.pos,i),d&&X(t,t.steps.length-1,-1)),!0)},en=()=>({state:e,dispatch:t})=>(0,i.G2)(e,t),er=()=>({state:e,dispatch:t})=>(0,i.bh)(e,t),eo=()=>({state:e,dispatch:t})=>(0,i.Qv)(e,t),ei=()=>({state:e,dispatch:t})=>(0,i.eT)(e,t),es=(e,t)=>{let n=e.resolve(t),r=n.nodeBefore,o=n.nodeAfter;return!!r&&!!o&&!r.type.spec.isolating&&!o.type.spec.isolating},ea=()=>({state:e,dispatch:t,tr:n})=>{try{let r=(0,o.N0)(e.doc,e.selection.$from.pos,-1);if(null==r||!es(e.doc,r))return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},el=()=>({state:e,dispatch:t,tr:n})=>{try{let r=(0,o.N0)(e.doc,e.selection.$from.pos,1);if(null==r||!es(e.doc,r))return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},ed=()=>({state:e,dispatch:t})=>(0,i.eB)(e,t),ec=()=>({state:e,dispatch:t})=>(0,i._G)(e,t);function eu(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}let ep=e=>({editor:t,view:n,tr:r,dispatch:o})=>{let i=(function(e){let t,n,r,o;let i=e.split(/-(?!$)/),s=i[i.length-1];"Space"===s&&(s=" ");for(let e=0;e<i.length-1;e+=1){let s=i[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))U()||eu()?o=!0:n=!0;else throw Error(`Unrecognized modifier name: ${s}`)}return t&&(s=`Alt-${s}`),n&&(s=`Ctrl-${s}`),o&&(s=`Meta-${s}`),r&&(s=`Shift-${s}`),s})(e).split(/-(?!$)/),s=i.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),a=new KeyboardEvent("keydown",{key:"Space"===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))});
1return null==l||l.steps.forEach(e=>{let t=e.map(r.mapping);t&&o&&r.maybeStep(t)}),!0};function eh(e,t,n={}){let{from:r,to:o,empty:i}=e.selection,s=t?x(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=>$(e.node.attrs,n,{strict:!1}));return i?!!d.length:d.reduce((e,t)=>e+t.to-t.from,0)>=l}let ef=(e,t={})=>({state:n,dispatch:r})=>!!eh(n,x(e,n.schema),t)&&(0,i.yY)(n,r),em=()=>({state:e,dispatch:t})=>(0,i.iz)(e,t),eg=e=>({state:t,dispatch:n})=>{let r=x(e,t.schema);return(0,l.T2)(r)(t,n)},ey=()=>({state:e,dispatch:t})=>(0,i.pC)(e,t);function ev(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function eb(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 ew=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null,a=ev("string"==typeof e?e:e.name,r.schema);if(!a)return!1;"node"===a&&(i=x(e,r.schema)),"mark"===a&&(s=j(e,r.schema));let l=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{i&&i===e.type&&(l=!0,o&&n.setNodeMarkup(r,void 0,eb(e.attrs,t))),s&&e.marks.length&&e.marks.forEach(i=>{s===i.type&&(l=!0,o&&n.addMark(r,r+e.nodeSize,s.create(eb(i.attrs,t))))})})}),l},ek=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),ex=()=>({tr:e,dispatch:t})=>{if(t){let t=new s.i5(e.doc);e.setSelection(t)}return!0},eM=()=>({state:e,dispatch:t})=>(0,i._e)(e,t),eS=()=>({state:e,dispatch:t})=>(0,i.Sd)(e,t),eE=()=>({state:e,dispatch:t})=>(0,i.hy)(e,t),eT=()=>({state:e,dispatch:t})=>(0,i.ec)(e,t),eC=()=>({state:e,dispatch:t})=>(0,i.$f)(e,t);function eO(e,t,n={},r={}){return Z(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}let eA=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:i,dispatch:s,commands:a})=>{let{doc:l}=i;if("full"!==r.preserveWhitespace){let a=eO(e,o.schema,r,{errorOnInvalidContent:null!=t?t:o.options.enableContentCheck});if(s){let e=G(a)?a.content:[a];i.replaceWith(0,l.content.size,e).setMeta("preventUpdate",!n)}return!0}return s&&i.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:o.options.enableContentCheck})};function eP(e,t){let n=j(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 eD(e,t){let n=new o.dL(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function e$(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function eI(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 eR(e,t,n){return void 0===e.config[t]&&e.parent?eR(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?eR(e.parent,t,n):null}):e.config[t]}function eN(e){return e.map(e=>{let t=eR(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...eN(t())]:e}).flat(10)}function ej(e,t){let n=a.ZF.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function eB(e){return"function"==typeof e}function ez(e,t,...n){return eB(e)?t?e.bind(t)(...n):e(...n):e}function eL(e){return{baseExtensions:e.filter(e=>"extension"===e.type),nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function eV(e){let t=[],{nodeExtensions:n,markExtensions:r}=eL(e),o=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=n.filter(e=>"text"!==e.name).map(e=>e.name),a=r.map(e=>e.name),l=[...s,...a];return e.forEach(e=>{let n=eR(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage,extensions:o});
1n&&n().forEach(e=>{(Array.isArray(e.types)?e.types:"*"===e.types?l:"nodes"===e.types?s:"marks"===e.types?a:[]).forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...i,...r}})})})})}),o.forEach(e=>{let n=eR(e,"addAttributes",{name:e.name,options:e.options,storage:e.storage});n&&Object.entries(n()).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 eF(e){let t=[],n=function(e){let t=[],n="",r=!1,o=!1,i=0,s=e.length;for(let a=0;a<s;a+=1){let s=e[a];if("'"===s&&!o){r=!r,n+=s;continue}if('"'===s&&!r){o=!o,n+=s;continue}if(!r&&!o){if("("===s){i+=1,n+=s;continue}if(")"===s&&i>0){i-=1,n+=s;continue}if(";"===s&&0===i){t.push(n),n="";continue}}n+=s}return n&&t.push(n),t}(e||""),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],o=r.indexOf(":");if(-1===o)continue;let i=r.slice(0,o).trim(),s=r.slice(o+1).trim();i&&s&&t.push([i,s])}return t}function e_(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if("__proto__"===e){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0});return}if(!n[e]){n[e]=t;return}if("class"===e){let r=t?String(t).split(" "):[],o=n[e]?n[e].split(" "):[],i=r.filter(e=>!o.includes(e));n[e]=[...o,...i].join(" ")}else if("style"===e){let r=new Map([...eF(n[e]),...eF(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else n[e]=t}),n},{})}function eU(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)=>e_(e,t),{})}function eK(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 eW(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 eH(e){var t,n;let r={};return!(null==e||null===(t=e.attribute)||void 0===t?void 0:t.isRequired)&&"default"in((null==e?void 0:e.attribute)||{})&&(r.default=e.attribute.default),(null==e||null===(n=e.attribute)||void 0===n?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function eq(e,t){var n;let r=eV(e),{nodeExtensions:o,markExtensions:i}=eL(e),s=null===(n=o.find(e=>eR(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=eW({...e.reduce((e,t)=>{let r=eR(t,"extendNodeSchema",i);return{...e,...r?r(n):{}}},{}),content:ez(eR(n,"content",i)),marks:ez(eR(n,"marks",i)),group:ez(eR(n,"group",i)),inline:ez(eR(n,"inline",i)),atom:ez(eR(n,"atom",i)),selectable:ez(eR(n,"selectable",i)),draggable:ez(eR(n,"draggable",i)),code:ez(eR(n,"code",i)),whitespace:ez(eR(n,"whitespace",i)),linebreakReplacement:ez(eR(n,"linebreakReplacement",i)),defining:ez(eR(n,"defining",i)),isolating:ez(eR(n,"isolating",i)),attrs:Object.fromEntries(o.map(eH))}),a=ez(eR(n,"parseHTML",i));a&&(s.parseDOM=a.map(e=>eK(e,o)));let l=eR(n,"renderHTML",i);l&&(s.toDOM=e=>l({node:e,HTMLAttributes:eU(e,o)}));let d=eR(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=eW({...e.reduce((e,t)=>{let r=eR(t,"extendMarkSchema",i);return{...e,...r?r(n):{}}},{}),inclusive:ez(eR(n,"inclusive",i)),excludes:ez(eR(n,"excludes",i)),group:ez(eR(n,"group",i)),spanning:ez(eR(n,"spanning",i)),code:ez(eR(n,"code",i)),attrs:Object.fromEntries(o.map(eH))}),a=ez(eR(n,"parseHTML",i));a&&(s.parseDOM=a.map(e=>eK(e,o)));let l=eR(n,"renderHTML",i);return l&&(s.toDOM=e=>l({mark:e,HTMLAttributes:eU(e,o)})),[n.name,s]}));return new a.Sj({topNode:s,nodes:l,marks:d})}function eJ(e){return e.sort((e,t)=>
1{let n=eR(e,"priority")||100,r=eR(t,"priority")||100;return n>r?-1:n<r?1:0})}function eY(e){var t;let n=eJ(eN(e)),r=Array.from(new Set((t=n.map(e=>e.name)).filter((e,n)=>t.indexOf(e)!==n)));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(e=>`'${e}'`).join(", ")}]. This can lead to issues.`),n}function eZ(e,t){return eq(eY(e),t)}function eG(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)=>{e.isBlock&&n>r&&(a+=i);let c=null==s?void 0:s[e.type.name];if(c)return l&&(a+=c({node:e,pos:n,parent:l,index:d,range:t})),!1;if(e.isText){var u;a+=null==e||null===(u=e.text)||void 0===u?void 0:u.slice(Math.max(r,n)-n,o-n)}}),a}function eX(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function eQ(e,t){let n=ev("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){let n=x(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?eP(e,t):{}}function e0(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,o)=>{let i=[];if(e.ranges.length)e.forEach((e,t)=>{i.push({from:e,to:t})});else{let{from:e,to:t}=n[o];if(void 0===e||void 0===t)return;i.push({from:e,to:t})}i.forEach(({from:e,to:n})=>{let i=t.slice(o).map(e,-1),s=t.slice(o).map(n),a=t.invert().map(i,-1),l=t.invert().map(s);r.push({oldRange:{from:a,to:l},newRange:{from:i,to:s}})})}),function(e){let t=function(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}(e);return 1===t.length?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}(r)}function e1(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let o=N(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}let e2=(e,t,n,r=20)=>{let o=e.doc.resolve(n),i=r,s=null;for(;i>0&&null===s;){let e=o.node(i);(null==e?void 0:e.type.name)===t?s=e:i-=1}return[s,i]},e3=e=>{let t=e.depth-1;if(t<0)return null;let n=e.index(t);return 0===n?null:e.node(t).child(n-1)};function e9(e,t){return t.nodes[e]||t.marks[e]||null}function e4(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}))}let e7=(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===(s=(a=e.type.spec).toText)||void 0===s?void 0:s.call(a,{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 e5(e,t,n={}){let{empty:r,ranges:o}=e.selection,i=t?j(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!i||i.name===e.type.name).find(e=>$(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(i&&e.inlineContent&&!e.type.allowsMarkType(i))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),l=Math.min(o,t+e.nodeSize);s+=l-n,a.push(...e.marks.map(e=>({mark:e,from:n,to:l})))})}),0===s)return!1;let l=a.filter(e=>!i||i.name===e.mark.type.name).filter(e=>$(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}let e6=(e,t)=>{let{$from:n,$to:r,$anchor:o}=e.selection;if(t){let n=eI(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return o.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2)&&n.pos===r.pos},e8=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0)&&t.pos===n.pos};function te(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function tt(e,t){let{nodeExtensions:n}=eL(t),r=n.find(t=>t.name===e);if(!r)return!1;let o=ez(eR(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}function tn(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}
1){if(n){if("hardBreak"===e.type.name)return!0;if(e.isText){var r;return!/\S/.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 r=!0;return e.content.forEach(e=>{!1===r||tn(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1)}),r}return!1}function tr(e){return e instanceof s.nh}var to=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function ti(e,t){let n=t.mapping.mapResult(e.position);return{position:new to(n.pos),mapResult:n}}function ts(e){return new to(e)}let ta=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let{selection:i}=n,{empty:s,ranges:a}=i,l=j(e,r.schema);if(o){if(s){let e=eP(r,l);n.addStoredMark(l.create({...e,...t}))}else a.forEach(e=>{let o=e.$from.pos,i=e.$to.pos;r.doc.nodesBetween(o,i,(e,r)=>{let s=Math.max(r,o),a=Math.min(r+e.nodeSize,i);e.marks.find(e=>e.type===l)?e.marks.forEach(e=>{l===e.type&&n.addMark(s,a,l.create({...e.attrs,...t}))}):n.addMark(s,a,l.create(t))})})}return function(e,t,n){let{selection:r}=t,o=null;if(L(r)&&(o=r.$cursor),o){var i;let t=null!==(i=e.storedMarks)&&void 0!==i?i:o.marks();return o.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:s}=r;return s.some(({$from:t,$to:r})=>{let o=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(o)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),i=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));o=t&&i}return!o}),o})}(r,n,l)},tl=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),td=(e,t={})=>({state:n,dispatch:r,chain:o})=>{let s;let a=x(e,n.schema);return(n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),a.isTextblock)?o().command(({commands:e})=>!!(0,i.y_)(a,{...s,...t})(n)||e.clearNodes()).command(({state:e})=>(0,i.y_)(a,{...s,...t})(e,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},tc=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=V(e,0,n.content.size),o=s.nh.create(n,r);t.setSelection(o)}return!0},tu=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i,s;let{selection:a}=r;return"number"==typeof t?(i=t,s=t):t&&"from"in t&&"to"in t?(i=t.from,s=t.to):(i=a.from,s=a.to),o&&n.doc.nodesBetween(i,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},tp=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:o}="number"==typeof e?{from:e,to:e}:e,i=s.U3.atStart(n).from,a=s.U3.atEnd(n).to,l=V(r,i,a),d=V(o,i,a),c=s.U3.create(n,l,d);t.setSelection(c)}return!0},th=e=>({state:t,dispatch:n})=>{let r=x(e,t.schema);return(0,l.$B)(r)(t,n)};function tf(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 tm=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:l}=t,{$from:d,$to:c}=a,u=e4(i.extensionManager.attributes,d.node().type.name,d.node().attrs);if(a instanceof s.nh&&a.node.isBlock)return!!(d.parentOffset&&(0,o.zy)(l,d.pos))&&(r&&(e&&tf(n,i.extensionManager.splittableMarks),t.split(d.pos).scrollIntoView()),!0);if(!d.parent.isBlock)return!1;let p=c.parentOffset===c.parent.content.size,h=0===d.depth?void 0:ee(d.node(-1).contentMatchAt(d.indexAfter(-1))),f=p&&h?[{type:h,attrs:u}]:void 0,m=a instanceof s.U3&&!a.empty?s.$t.create({doc:t.doc,selection:a}).tr.deleteSelection():null,g=m?m.doc:t.doc,y=m?m.mapping.map(d.pos):d.pos,v=(0,o.zy)(g,y,1,f);if(!f&&!v&&(0,o.zy)(g,y,1,h?[{type:h}]:void 0)&&(v=!0,f=h?[{type:h,attrs:u}]:void 0),r){if(v){let e=t.steps.length;if(a instanceof s.U3&&t.deleteSelection(),t.split(t.mapping.slice(e).map(d.pos),1,f),h&&!p&&!d.parentOffset&&d.parent.type!==h){let n=t.mapping.slice(e).map(d.before()),r=t.doc.resolve(n);d.node(-1).canReplaceWith(r.index(),r.index()+1,h)&&t.setNodeMarkup(t.mapping.slice(e).map(d.before()),h)}}e&&tf(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return v},tg=(e,t={})=>({tr:n,state:r,dispatch:i,editor:l})=>{let d=x(e,r.schema),{$from:c,$to:u}=r.selection,p=r.selection.node;if(p&&p.isBlock||c.depth<2||!c.sameParent(u))return!1;let h=c.node(-1);if(h.type!==d)return!1;let f=l.extensionManager.attributes;if(0===c.parent.content.size&&c.node(-1).childCount===c.indexAfter(-1)){if
1(2===c.depth||c.node(-3).type!==d||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){var m;let e=a.FK.empty,r=c.index(-1)?1:c.index(-2)?2:3;for(let t=c.depth-r;t>=c.depth-3;t-=1)e=a.FK.from(c.node(t).copy(e));let o=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,i={...e4(f,c.node().type.name,c.node().attrs),...t},l=(null===(m=d.contentMatch.defaultType)||void 0===m?void 0:m.createAndFill(i))||void 0;e=e.append(a.FK.from(d.createAndFill(null,l)||void 0));let u=c.before(c.depth-(r-1));n.replace(u,c.after(-o),new a.Ji(e,4-r,0));let p=-1;n.doc.nodesBetween(u,n.doc.content.size,(e,t)=>{if(p>-1)return!1;e.isTextblock&&0===e.content.size&&(p=t+1)}),p>-1&&n.setSelection(s.U3.near(n.doc.resolve(p))),n.scrollIntoView()}return!0}let g=u.pos===c.end()?h.contentMatchAt(0).defaultType:null,y={...e4(f,h.type.name,h.attrs),...t},v={...e4(f,c.node().type.name,c.node().attrs),...t},b=0===c.parentOffset&&0===c.index(-1),w=c.before(-1);n.delete(c.pos,u.pos);let k=b?h.attrs:y,M=g?[{type:d,attrs:k},{type:g,attrs:v}]:[{type:d,attrs:k}];if(!(0,o.zy)(n.doc,c.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=l.extensionManager,s=t||e.$to.parentOffset&&e.$from.marks();if(n.split(c.pos,2,M).scrollIntoView(),b&&n.setNodeMarkup(w,void 0,y),!s||!i)return!0;let a=s.filter(e=>o.includes(e.type.name));n.ensureMarks(a)}return!0};function ty(e){return e&&"1"!==e?e:null}let tv=(e,t)=>{var n,r;let i=eI(e=>e.type===t)(e.selection);if(!i)return!0;let s=e.doc.resolve(Math.max(0,i.pos-1)).before(i.depth);if(void 0===s)return!0;let a=e.doc.nodeAt(s);return!(i.node.type===(null==a?void 0:a.type)&&(0,o.n9)(e.doc,i.pos))||(n=i.node.attrs.type,r=null==a?void 0:a.attrs.type,ty(n)!==ty(r)||(e.join(i.pos),!0))},tb=(e,t)=>{var n,r;let i=eI(e=>e.type===t)(e.selection);if(!i)return!0;let s=e.doc.resolve(i.start).after(i.depth);if(void 0===s)return!0;let a=e.doc.nodeAt(s);return!(i.node.type===(null==a?void 0:a.type)&&(0,o.n9)(e.doc,s))||(n=i.node.attrs.type,r=null==a?void 0:a.attrs.type,ty(n)!==ty(r)||(e.join(s),!0))},tw=(e,t,n,r={})=>({editor:o,tr:i,state:a,dispatch:l,chain:d,commands:c,can:u})=>{let{extensions:p,splittableMarks:h}=o.extensionManager,f=x(e,a.schema),m=x(t,a.schema),{selection:g,storedMarks:y}=a,{$from:v,$to:b}=g,w=v.blockRange(b),k=y||g.$to.parentOffset&&g.$from.marks();if(!w)return!1;let M=eI(e=>tt(e.type.name,p))(g),S=0===g.from&&g.to===a.doc.content.size,E=a.doc.content.content,T=1===E.length?E[0]:null,C=S&&T&&tt(T.type.name,p)?{node:T,pos:0,depth:0}:null,O=null!=M?M:C,A=!!M&&w.depth>=1&&w.depth-M.depth<=1,P=!!C;
1if((A||P)&&O){if(O.node.type===f)return S&&P?d().command(({tr:e,dispatch:t})=>{let n=function(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),o=t.resolve(n.nodeSize-1);return s.U3.between(r,o)}(e);return!!n&&(e.setSelection(n),t&&t(e),!0)}).liftListItem(m).run():c.liftListItem(m);if(tt(O.node.type.name,p)&&f.validContent(O.node.content))return d().command(()=>(i.setNodeMarkup(O.pos,f),!0)).command(()=>tv(i,f)).command(()=>tb(i,f)).run()}return n&&k&&l?d().command(()=>{let e=u().wrapInList(f,r),t=k.filter(e=>h.includes(e.type.name));return i.ensureMarks(t),!!e||c.clearNodes()}).wrapInList(f,r).command(()=>tv(i,f)).command(()=>tb(i,f)).run():d().command(()=>!!u().wrapInList(f,r)||c.clearNodes()).wrapInList(f,r).command(()=>tv(i,f)).command(()=>tb(i,f)).run()},tk=(e,t={},n={})=>({state:r,commands:o})=>{let{extendEmptyMarkRange:i=!1}=n,s=j(e,r.schema);return e5(r,s,t)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,t)},tx=(e,t,n={})=>({state:r,commands:o})=>{let i;let s=x(e,r.schema),a=x(t,r.schema),l=eh(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})},tM=(e,t={})=>({state:n,commands:r})=>{let o=x(e,n.schema);return eh(n,o,t)?r.lift(o):r.wrapIn(o,t)},tS=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let o;let i=n[r];if(i.spec.isInputRules&&(o=i.getState(e))){if(t){let t=e.tr,n=o.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(o.text){let n=t.doc.resolve(o.from).marks();t.replaceWith(o.from,o.to,e.schema.text(o.text,n))}else t.delete(o.from,o.to)}return!0}}return!1},tE=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:o=!1}=e,{selection:i}=t,{empty:s,ranges:a}=i;if(s)return!0;let{nonClearableMarks:l}=r.extensionManager;if(n){let e=Object.values(r.schema.marks).filter(e=>o||!l.includes(e.name));a.forEach(n=>{for(let r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},tT=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let{extendEmptyMarkRange:i=!1}=t,{selection:s}=n,a=j(e,r.schema),{$from:l,empty:d,ranges:c}=s;if(!o)return!0;if(d&&i){var u;let{from:e,to:t}=s,r=N(l,a,null===(u=l.marks().find(e=>e.type===a))||void 0===u?void 0:u.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,a)}else c.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,a)});return n.removeStoredMark(a),!0},tC=e=>({tr:t,state:n,dispatch:r})=>{let o,i;let{selection:s}=n;return"number"==typeof e?(o=e,i=e):e&&"from"in e&&"to"in e?(o=e.from,i=e.to):(o=s.from,i=s.to),r&&t.doc.nodesBetween(o,i,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},tO=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null,a=ev("string"==typeof e?e:e.name,r.schema);if(!a)return!1;"node"===a&&(i=x(e,r.schema)),"mark"===a&&(s=j(e,r.schema));let l=!1;return n.selection.ranges.forEach(e=>{let a,d,c,u;let p=e.$from.pos,h=e.$to.pos;n.selection.empty?r.doc.nodesBetween(p,h,(e,t)=>{i&&i===e.type&&(l=!0,c=Math.max(t,p),u=Math.min(t+e.nodeSize,h),a=t,d=e)}):r.doc.nodesBetween(p,h,(e,r)=>{r<p&&i&&i===e.type&&(l=!0,c=Math.max(r,p),u=Math.min(r+e.nodeSize,h),a=r,d=e),r>=p&&r<=h&&(i&&i===e.type&&(l=!0,o&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),s&&e.marks.length&&e.marks.forEach(i=>{if(s===i.type&&(l=!0,o)){let o=Math.max(r,p),a=Math.min(r+e.nodeSize,h);n.addMark(o,a,s.create({...i.attrs,...t}))}}))}),d&&(void 0!==a&&o&&n.setNodeMarkup(a,void 0,{...d.attrs,...t}),s&&d.marks.length&&d.marks.forEach(e=>{s===e.type&&o&&n.addMark(c,u,s.create({...e.attrs,...t}))}))}),l},tA=new s.hs("__tiptap_decorations__"),tP=e=>({tr:t,dispatch:n})=>(n&&t.setMeta(tA,{type:"force",name:e}),!0),tD=(e,t={})=>({state:n,dispatch:r})=>{let o=x(e,n.schema);return(0,i.Im)(o,t)(n,r)},t$=(e,t={})=>({state:n,dispatch:r})=>{let o=x(e,n.schema);return(0,l.Sd)(o,t)(n,r)};var tI=(0,r.t)({blur:()=>m,clearContent:()=>g,clearNodes:()=>y,command:()=>v,createParagraphNear:()=>b,cut:()=>w,deleteCurrentNode:()=>k,deleteNode:()=>M,deleteRange:()=>S,deleteSelection:()=>O,enter:()=>A,exitCode:()=>P,extendMarkRange:()=>B,first:()=>z,focus:()=>K,forEach:()=>W,insertContent:()=>H,insertContentAt:()=>Q,insertDefaultBlock:()=>et,joinBackward:()=>eo,joinDown:()=>er,joinForward:()=>ei,joinItemBackward:()=>ea,joinItemForward:()=>el,joinTextblockBackward:()=>ed,joinTextblockForward:()=>ec,joinUp:()=>en,keyboardShortcut:()=>ep,lift:()=>ef,liftEmptyBlock:()=>em,liftListItem:()=>eg,newlineInCode:()=>ey,resetAttributes:()=>ew,scrollIntoView:()=>ek,selectAll:()=>ex,selectNodeBackward:()=>eM,selectNodeForward:()=>eS,selectParentNode:()=>eE,selectTextblockEnd:()=>eT,selectTextblockStart:()=>eC,setContent:()=>eA,setMark:()=>ta,setMeta:()=>tl,setNode:()=>td,setNodeSelection:()=>tc,setTextDirection:()=>tu,setTextSelection:()=>tp,sinkListItem:()=>th,splitBlock:()=>tm,splitListItem:()=>tg,toggleList:()=>tw,toggleMark:()=>tk,toggleNode:()=>tx,toggleWrap:()=>tM,undoInputRule:()=>tS,unsetAllMarks:()=>tE,unsetMark:()=>tT,unsetTextDirection:()=>tC,updateAttributes:()=>tO,updateDecorations:()=>tP,wrapIn:()=>tD,wrapInList:()=>t$});let tR=new WeakMap;var tN=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];
1return 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={}}};let tj=void 0!==p&&!1;function tB(e,t){let n=[],r=new Set;for(let o of e)"widget"===o.kind&&"widget"===o.kind&&r.add(o.key),n.push(o.toPMDecoration(t));return{decorations:n,widgetKeys:r}}function tz({position:e,from:t,to:n,docSize:r}){return!(e<t)&&(e<n||e===n&&n===r)}function tL(e){var t;let n=null===(t=e.spec)||void 0===t?void 0:t.key;return"string"==typeof n?n:void 0}function tV(e){return"attr"===e.jsonID}function tF(e,t,n,r){return e.map(t,n,{onRemove:e=>{let t=null==e?void 0:e.key;"string"==typeof t&&r.delete(t)}})}function t_(e,t){let n=Object.values(t).flatMap(e=>e.find());return d.zF.create(e,n)}function tU(e){let t=new Set;for(let n of Object.values(e))for(let e of n)t.add(e);return t}let tK=new Set;var tW=class{constructor(e){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{let t=tA.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach(({name:e,spec:t})=>(function(e,t){var n;switch(null!==(n=t.update)&&void 0!==n?n:"document"){case"document":if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case"changedRanges":if(!t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case"manual":if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(t.shouldUpdate)throw Error(`[tiptap error]: Extension "${e}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}})(e,t)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on("beforeTransaction",this.handleBeforeTransaction)}destroy(){this.editor.off("beforeTransaction",this.handleBeforeTransaction)}liveWidgetKeys(){var e,t;return null!==(e=null===(t=tA.getState(this.editor.state))||void 0===t?void 0:t.widgetKeys)&&void 0!==e?e:tK}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(e){let t=[];for(let{name:n,addDecorations:r}of e){let e=r();e&&t.push({name:n,spec:e})}return t}createPlugin(){let{editor:e,entries:t}=this;return new s.k_({key:tA,state:{init:(e,n)=>{let r={},o={};for(let{name:e,spec:i}of t){let{set:t,widgetKeys:s}=this.buildFullSet(e,i,n);r[e]=t,o[e]=s}let i={decorationSetsByExtension:r,widgetKeysByExtension:o,mergedDecorationSet:this.buildMergedSet(n.doc,r),widgetKeys:tU(o)};return this.warnDuplicateWidgetKeys(i),i},apply:(n,r,o,i)=>{let s=n.getMeta(tA),a=(null==s?void 0:s.type)==="force"&&!s.name,l=(null==s?void 0:s.type)==="force"?s.name:void 0,c={},u={},p=new Set;return(!function(e,t){var n,r;tR.set(e,(null!==(n=tR.get(e))&&void 0!==n?n:0)+1);try{return t()}finally{let t=(null!==(r=tR.get(e))&&void 0!==r?r:1)-1;t>0?tR.set(e,t):tR.delete(e)}}(e,()=>{for(let{name:h,spec:f}of t){var s;let t=a||l===h;if(s={editor:e,tr:n,oldState:o,newState:i},t||"manual"!==f.update&&(f.shouldUpdate?f.shouldUpdate(s):s.tr.docChanged)){if("changedRanges"===f.update&&n.docChanged&&!t){let e=this.applyChangedRangesRecompute(h,f,r,n,i);c[h]=e.set,u[h]=e.widgetKeys,p.add(h)}else{let{set:e,widgetKeys:t}=this.buildFullSet(h,f,i);c[h]=e,u[h]=t,p.add(h)}}else{let e=function(e,t,n){var r,o;let i=null!==(r=t.decorationSetsByExtension[e])&&void 0!==r?r:d.zF.empty,s=new Set(null!==(o=t.widgetKeysByExtension[e])&&void 0!==o?o:[]);return{set:tF(i,n.mapping,n.doc,s),widgetKeys:s}}(h,r,n);c[h]=e.set,u[h]=e.widgetKeys}}}),0!==p.size||n.docChanged)?{decorationSetsByExtension:c,widgetKeysByExtension:u,mergedDecorationSet:this.mergeAfterApply({entries:t,previous:r,tr:n,decorationSetsByExtension:c,recomputedNames:p}),widgetKeys:tU(u)}:r}},props:{decorations(e){var t,n;return null!==(t=null===(n=tA.getState(e))||void 0===n?void 0:n.mergedDecorationSet)&&void 0!==t?t:d.zF.empty}}})}applyChangedRangesRecompute(e,t,n,r,o){let i=function(e,t){if(e.steps.some(e=>{let t;
1return t=!1,e.getMap().forEach(()=>{t=!0}),!(t||tV(e))&&("number"!=typeof e.from||"number"!=typeof e.to)}))return{type:"full"};let n=e0(e).map(({newRange:e})=>e);e.steps.forEach((t,r)=>{if(!tV(t))return;let o=e.mapping.slice(r);n.push({from:o.map(t.pos,-1),to:o.map(t.pos+1)})});let r=[];for(let e of n){let n=function(e,t){let n=null,r=0,o=0;for(let i=0;i<e.childCount&&!(o>t.to);i+=1){let s=o+e.child(i).nodeSize;s>=t.from&&(null===n&&(n=o),r=s),o=s}return null===n?null:{from:n,to:r}}(t,e);n&&r.push(n)}r.sort((e,t)=>e.from-t.from);let o=[];for(let e of r){let t=o[o.length-1];t&&e.from<=t.to?t.to=Math.max(t.to,e.to):o.push({...e})}return{type:"ranges",ranges:o}}(r,o.doc);return"full"===i.type?this.buildFullSet(e,t,o):this.rebuildRanges(e,t,n,r,o,i.ranges)}rebuildRanges(e,t,n,r,o,i){var s,a;let l=null!==(s=n.decorationSetsByExtension[e])&&void 0!==s?s:d.zF.empty,c=new Set(null!==(a=n.widgetKeysByExtension[e])&&void 0!==a?a:[]),u=tF(l,r.mapping,r.doc,c),p=o.doc.content.size;for(let{from:n,to:r}of i){let i=u.find(n,r).filter(e=>tz({position:e.from,from:n,to:r,docSize:p}));for(let e of i){let t=tL(e);t&&c.delete(t)}u=u.remove(i);let{decorations:s,widgetKeys:a}=tB(function({decorations:e,from:t,to:n,docSize:r,extensionName:o,warnedExtensions:i}){return e.filter(e=>!!tz({position:e.anchor,from:t,to:n,docSize:r})||e.anchor!==n&&(i.has(o)||(i.add(o),console.warn(`[tiptap warn]: Extension "${o}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)),!1))}({decorations:this.runCreate(e,"createInRange",()=>t.createInRange({editor:this.editor,state:o,view:this.mountedView,from:n,to:r})),from:n,to:r,docSize:p,extensionName:e,warnedExtensions:this.warnedOutOfRangeExtensions}),e);for(let e of(u=u.add(o.doc,s),a))c.add(e)}return{set:u,widgetKeys:c}}buildFullSet(e,t,n){let r=this.runCreate(e,"create",()=>t.create({editor:this.editor,state:n,view:this.mountedView}));
1return function(e,t,n){let{decorations:r,widgetKeys:o}=tB(t,n);return{set:d.zF.create(e,r),widgetKeys:o}}(n.doc,r,e)}runCreate(e,t,n){try{return n()}catch(n){return console.error(`[tiptap error]: Extension "${e}" threw in \`addDecorations().${t}()\`. Its decorations were dropped for this update.`,n),[]}}warnDuplicateWidgetKeys(e){if(!tj)return;if(0===e.widgetKeys.size){this.warnedWidgetKeys.clear();return}let t=function(e){let t=new Map,n=new Map;for(let s of e.find()){var r,o,i;let e=tL(s);if(!e)continue;let a=null!==(r=s.spec.extensionName)&&void 0!==r?r:"unknown",l=null!==(o=t.get(e))&&void 0!==o?o:new Set;l.add(a),t.set(e,l),n.set(e,(null!==(i=n.get(e))&&void 0!==i?i:0)+1)}return Array.from(t,([e,t])=>({key:e,extensions:t})).filter(({key:e})=>{var t;return(null!==(t=n.get(e))&&void 0!==t?t:0)>1})}(e.mergedDecorationSet),n=new Set(t.map(({key:e})=>e));for(let{key:e,extensions:n}of t){if(this.warnedWidgetKeys.has(e))continue;let t=Array.from(n).map(e=>`"${e}"`).join(", ");console.warn(`[tiptap warn]: Duplicate widget decoration key "${e}" in extension${1===n.size?"":"s"} ${t}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \`comment-\${id}\`).`)}this.warnedWidgetKeys=n}buildMergedSet(e,t){let n=Object.keys(t);return 1===n.length?t[n[0]]:t_(e,t)}mergeAfterApply({entries:e,previous:t,tr:n,decorationSetsByExtension:r,recomputedNames:o}){return 1===e.length?r[e[0].name]:0===o.size?t.mergedDecorationSet.map(n.mapping,n.doc):t_(n.doc,r)}};function tH(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof s.nh){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let o=r.depth;for(;o>=0;){let e=r.index(o);if(r.node(o).contentMatchAt(e).matchType(t))return!0;o-=1}return!1}function tq(e){return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function tJ(e){return"string"==typeof e&&e.trim().length>0&&!/[;{}]/.test(e)}function tY(e){return/\s/.test(e)}function tZ(e){return/^\w$/.test(e)}function tG(e,t){for(;t<e.length&&tY(e[t]);)t+=1;return t}function tX(e,t){for(;t<e.length&&!tY(e[t]);)t+=1;return t}function tQ(e,t,n){for(;t<e.length&&(tZ(e[t])||n&&"-"===e[t]);)t+=1;return t}function t0(e,t){let n=[],r=0;for(;r<e.length&&!((r=tG(e,r))>=e.length);){let o=function(e,t,n){let r=e[t];return"pandoc"===n&&("."===r||"#"===r)?function(e,t){let n=e[t],r=t+1,o=tQ(e,r,!0);return o===r?{nextIndex:tX(e,o)}:{token:{type:"."===n?"class":"id",name:e.slice(r,o)},nextIndex:tX(e,o)}}(e,t):'"'===r||"'"===r?function(e,t){let n=e.indexOf(e[t],t+1);return{nextIndex:tX(e,-1===n?t:n+1)}}(e,t):("pandoc"===n?/^[a-zA-Z]$/.test(r):tZ(r))?function(e,t,n){let r="pandoc"===n,o=tQ(e,t+1,r),i=e.slice(t,o),s=function(e,t,n,r){let o=r?tG(e,n):n;if("="!==e[o])return;o=r?tG(e,o+1):o+1;let i=e[o];if('"'!==i&&"'"!==i)return;let s=e.indexOf(i,o+1);if(-1!==s)return{token:{type:"keyValue",name:t,value:e.slice(o+1,s)},nextIndex:tX(e,s+1)}}(e,i,o,r);if(s)return s;let a=o===e.length||tY(e[o]);return{token:r&&a?{type:"boolean",name:i}:void 0,nextIndex:"shortcode"===n?tX(e,o):o}}(e,t,n):{nextIndex:tX(e,t)}}(e,r,t);o.token&&n.push(o.token),r=o.nextIndex}return n}function t1(e,t,n){let r=e.split("\n"),o=[],i="",s=0,a=t.baseIndentSize||2;for(;s<r.length;){let e;let c=r[s],u=c.match(t.itemPattern);if(!u){if(o.length>0)break;if(""!==c.trim())return;s+=1,i=`${i}${c}
2`;continue}let p=t.extractItemData(u),{indentLevel:h,mainContent:f}=p;i=`${i}${c}
3`;let m=[f];for(s+=1;s<r.length;){var l,d;let e=r[s];if(""===e.trim()){let t=r.slice(s+1).findIndex(e=>""!==e.trim());if(-1===t)break;if(((null===(d=r[s+1+t].match(/^(\s*)/))||void 0===d||null===(d=d[1])||void 0===d?void 0:d.length)||0)>h){m.push(e),i=`${i}${e}
4`,s+=1;continue}break}if(((null===(l=e.match(/^(\s*)/))||void 0===l||null===(l=l[1])||void 0===l?void 0:l.length)||0)>h)m.push(e),i=`${i}${e}
5`,s+=1;else break}let g=m.slice(1);if(g.length>0){let r=g.map(e=>e.slice(h+a)).join("\n");r.trim()&&(e=t.customNestedParser?t.customNestedParser(r):n.blockTokens(r))}let y=t.createToken(p,e);o.push(y)}if(0!==o.length)return{items:o,raw:i}}function t2(e){let t=0;for(let n of e)t="	"===n?t+4-t%4:t+1;return t}function t3(e,t,n,r,o){if(!e||!Array.isArray(e.content))return"";let i="function"==typeof n?n(r):n,[s,...a]=e.content,l=`${i}${t.renderChildren([s])}`;return a&&a.length>0&&a.forEach((e,n)=>{var r,s;let a=null!==(r=null===(s=t.renderChild)||void 0===s?void 0:s.call(t,e,n+1))&&void 0!==r?r:t.renderChildren([e]);if(null!=a){let n=e=>{if(!(null==o?void 0:o.alignNestedToPrefix))return t.indent(e);let n=t.indent(""),r=t2(i);return(t2(n)>=r?n:" ".repeat(r))+e},r=a.split("\n").map(e=>e?n(e):n("")).join("\n");l+="paragraph"===e.type?`
6
7${r}`:`
8${r}`}}),l}function t9(e,t,n={}){let{state:r}=t,{doc:o,tr:i}=r;o.descendants((t,r)=>{let o=i.mapping.map(r),s=i.mapping.map(r)+t.nodeSize,a=null;if(t.marks.forEach(t=>{if(t!==e)return!1;a=t}),!a)return;let l=!1;
8if(Object.keys(n).forEach(e=>{n[e]!==a.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});i.removeMark(o,s,e.type),i.addMark(o,s,t)}}),i.docChanged&&t.view.dispatch(i)}var t4=class{constructor(e,t,n){this.component=e,this.editor=t.editor,this.options={...n},this.mark=t.mark,this.HTMLAttributes=t.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(e,t){t9(t||this.mark,this.editor,e)}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!("selection"===e.type||this.contentDOM.contains(e.target)&&"childList"===e.type&&(U()||_())&&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)))}},t7=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=null===(t=e.undoable)||void 0===t||t}};let t5=(e,t)=>{if(D(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 t6(e){var t;let{editor:n,from:r,to:o,text:i,rules:a,plugin:l,insertText:d}=e,{view:c}=n;if(c.composing)return!1;let p=c.state.doc.resolve(r);if(p.parent.type.spec.code||(null===(t=p.nodeBefore||p.nodeAfter)||void 0===t?void 0:t.marks.find(e=>e.type.spec.code)))return!1;let m=e7(p)+i;for(let e of a){let t=t5(m,e.find);if(t&&function(e,t,n){let r=t[0].length-n.length;if(r<=0)return!0;let o=e.parentOffset-r;return o>=0&&e.parent.textBetween(o,e.parentOffset)===t[0].slice(0,r)}(p,t,i)&&function(e){let{editor:t,from:n,to:r,text:o,rule:i,match:a,plugin:l,insertText:d}=e,{view:c}=t,{inputTransaction:p,tr:m}=function(e){let{editor:t,from:n,to:r,text:o,insertText:i}=e;if(!i)return{inputTransaction:null,tr:t.view.state.tr};let a=t.view.state.tr.insertText(o,n,r);return{inputTransaction:a,tr:s.$t.create({doc:a.doc,selection:a.selection,storedMarks:a.storedMarks}).tr}}({editor:t,from:n,to:r,text:o,insertText:d}),g=p?n+o.length:r,y=h({state:c.state,transaction:m}),v={from:n-(a[0].length-o.length),to:g},{commands:b,chain:w,can:k}=new f({editor:t,state:y});return null!==i.handler({state:y,range:v,match:a,commands:b,chain:w,can:k})&&!!m.steps.length&&(!!p&&(c.dispatch(p),!c.state.doc.eq(p.doc))||((0,u.xq)(m),m.setMeta("inputRule",!0),i.undoable&&m.setMeta(l,{transform:m,from:n,to:g,text:o}),c.dispatch(m),!0))}({editor:n,from:r,to:o,text:i,rule:e,match:t,plugin:l,insertText:d}))return!0}return!1}var t8=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...ez(eR(this,"addOptions",{name:this.name}))}}get storage(){return{...ez(eR(this,"addStorage",{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>(function e(t,n){let r={...t};return tq(t)&&tq(n)&&Object.keys(n).forEach(o=>{tq(n[o])&&tq(t[o])?r[o]=e(t[o],n[o]):r[o]=n[o]}),r})(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},ne=class e extends t8{constructor(...e){super(...e),this.type="mark"}static create(t={}){return new e("function"==typeof t?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let o=r.marks();if(!o.find(e=>(null==e?void 0:e.type.name)===t.name))return!1;let i=o.find(e=>(null==e?void 0:e.type.name)===t.name);return i&&n.removeStoredMark(i),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},nt=class{constructor(e){this.find=e.find,this.handler=e.handler}};let nn=(e,t,n)=>{if(D(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}):[]},nr=null,no=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};var ni=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=eY(e),this.schema=eq(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>
8{let n=eR(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:e9(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this,t=eJ([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:e9(t.name,this.schema)},r=[],o=eR(t,"addKeyboardShortcuts",n),i={};if("mark"===t.type&&eR(t,"exitable",n)&&(i.ArrowRight=()=>ne.handleExit({editor:e,mark:t})),o){let t=Object.fromEntries(Object.entries(o()).map(([t,n])=>[t,()=>n({editor:e})]));i={...i,...t}}let l=(0,c.w)(i);r.push(l);let d=eR(t,"addInputRules",n);if(te(t,e.options.enableInputRules)&&d){let t=d();if(t&&t.length){let n=function(e){let{editor:t,rules:n}=e,r=new s.k_({state:{init:()=>null,apply(e,o,i){let s=e.getMeta(r);if(s)return s;let l=e.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:e}=l;"string"==typeof e||(e=ej(a.FK.from(e),i.schema));let{from:o}=l,s=o+e.length;t6({editor:t,from:o,to:s,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:o}},props:{handleTextInput:(e,o,i,s)=>t6({editor:t,from:o,to:i,text:s,rules:n,plugin:r,insertText:!0}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:o}=e.state.selection;o&&t6({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(e,o){if("Enter"!==o.key)return!1;let{$cursor:i}=e.state.selection;return!!i&&t6({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),o=Array.isArray(n)?n:[n];r.push(...o)}}let u=eR(t,"addPasteRules",n);if(te(t,e.options.enablePasteRules)&&u){let t=u();if(t&&t.length){let n=function(e){let t;let{editor:n,rules:r}=e,o=null,i=!1,l=!1,d="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{t="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{t=null}let c=({state:e,from:r,to:o,rule:i,pasteEvt:s})=>{let a=e.tr;if(function(e){let{editor:t,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:a}=e,{commands:l,chain:d,can:c}=new f({editor:t,state:n}),u=[];return n.doc.nodesBetween(r,o,(e,t)=>{var p,h,f,m;if((null===(p=e.type)||void 0===p||null===(p=p.spec)||void 0===p?void 0:p.code)||!(e.isText||e.isTextblock||e.isInline))return;let g=null!==(h=null!==(f=null===(m=e.content)||void 0===m?void 0:m.size)&&void 0!==f?f:e.nodeSize)&&void 0!==h?h:0,y=Math.max(r,t),v=Math.min(o,t+g);y>=v||nn(e.isText?e.text||"":e.textBetween(y-t,v-t,void 0,""),i.find,s).forEach(e=>{if(void 0===e.index)return;let t=y+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},p=i.handler({state:n,range:o,match:e,commands:l,chain:d,can:c,pasteEvent:s,dropEvent:a});u.push(p)})}),u.every(e=>null!==e)}({editor:n,state:h({state:e,transaction:a}),from:Math.max(r-1,0),to:o.b-1,rule:i,pasteEvent:s,dropEvent:t})&&a.steps.length){try{t="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{t=null}return d="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,a}};return n.on("destroy",()=>{nr===n&&(nr=null)}),r.map(e=>new s.k_({view(e){let t=t=>{var r;(o=(null===(r=e.dom.parentElement)||void 0===r?void 0:r.contains(t.target))?e.dom.parentElement:null)&&(nr=n)},r=()=>{nr&&(nr=null)};return window.addEventListener("dragstart",t),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",t),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,n)=>{if(l=o===e.dom.parentElement,t=n,!l){let e=nr;(null==e?void 0:e.isEditable)&&setTimeout(()=>{if(e.isDestroyed)return;let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{var n;let r=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return d=t,i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{let o=t[0],s="paste"===o.getMeta("uiEvent")&&!i,u="drop"===o.getMeta("uiEvent")&&!l,p=o.getMeta("applyPasteRules"),h=!!p;if(!s&&!u&&!h)return;if(h){let{text:t}=p;"string"==typeof t||(t=ej(a.FK.from(t),r.schema));let{from:n}=p,o=n+t.length;return c({rule:e,state:r,from:n,to:{b:o},pasteEvt:no(t)})}
8let 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 c({rule:e,state:r,from:f,to:m,pasteEvt:d})}}))}({editor:e,rules:t});r.push(...n)}}let p=eR(t,"addProseMirrorPlugins",n);if(p){let e=p();r.push(...e)}return r}),n=this.createDecorationPlugin();return n&&t.push(n),t}createDecorationPlugin(){var e;let{editor:t}=this;null===(e=this.decorationManager)||void 0===e||e.destroy();let n=[];return this.extensions.forEach(e=>{let r=eR(e,"addDecorations",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:e9(e.name,this.schema)});r&&n.push({name:e.name,addDecorations:r})}),this.decorationManager=new tW({editor:t,entries:n}),this.decorationManager.plugin}get attributes(){return eV(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=eL(this.extensions);return Object.fromEntries(t.filter(e=>!!eR(e,"addNodeView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=eR(t,"addNodeView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:x(t.name,this.schema)});if(!r)return[];let o=r();return o?[t.name,(r,i,s,a,l)=>{let d=eU(r,n);return o({node:r,view:i,getPos:s,decorations:a,innerDecorations:l,editor:e,extension:t,HTMLAttributes:d})}]:[]}))}dispatchTransaction(e){let{editor:t}=this;return eJ([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:e9(n.name,this.schema)},o=eR(n,"dispatchTransaction",r);return o?t=>{o.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return eJ([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:e9(n.name,this.schema)},o=eR(n,"transformPastedHTML",r);return o?(t,n)=>{let i=e(t,n);return o.call(r,i)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=eL(this.extensions);return Object.fromEntries(t.filter(e=>!!eR(e,"addMarkView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=eR(t,"addMarkView",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:j(t.name,this.schema)});return r?[t.name,(o,i,s)=>{let a=eU(o,n);return r()({mark:o,view:i,inline:s,editor:e,extension:t,HTMLAttributes:a,updateAttributes:t=>{t9(o,e,t)}})}]:[]}))}destroy(){var e;null===(e=this.decorationManager)||void 0===e||e.destroy(),this.extensions.forEach(e=>{let t=e;for(;t.parent;){let e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:e9(e.name,this.schema)};if("mark"===e.type){var n,r;(null===(n=ez(eR(e,"keepOnSplit",t)))||void 0===n||n)&&this.splittableMarks.push(e.name),null===(r=ez(eR(e,"clearable",t)))||void 0===r||r||this.nonClearableMarks.push(e.name)}let o=eR(e,"onBeforeCreate",t),i=eR(e,"onCreate",t),s=eR(e,"onUpdate",t),a=eR(e,"onSelectionUpdate",t),l=eR(e,"onTransaction",t),d=eR(e,"onFocus",t),c=eR(e,"onBlur",t),u=eR(e,"onDestroy",t);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)})}};ni.resolve=eY,ni.sort=eJ,ni.flatten=eN;var ns=class e extends t8{constructor(...e){super(...e),this.type="extension"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}};let na=ns.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new s.k_({key:new s.hs("clipboardTextSerializer"),props:{clipboardTextSeri
8alizer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,i=eX(n),{blockSeparator:s}=this.options,a={...void 0!==s?{blockSeparator:s}:{},textSerializers:i};return[...o.ranges].sort((e,t)=>e.$from.pos-t.$from.pos).map(({$from:e,$to:t})=>eG(r,{from:e.pos,to:t.pos},a)).join(null!=s?s:"\n\n")}}})]}}),nl=ns.create({name:"commands",addCommands:()=>({...tI})}),nd=ns.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r;let i=()=>{var n,r,i;if(null!==(n=null===(r=this.editor.options.coreExtensionOptions)||void 0===r||null===(r=r.delete)||void 0===r||null===(i=r.filterTransaction)||void 0===i?void 0:i.call(r,e))&&void 0!==n?n:e.getMeta("y-sync$"))return;let s=eD(e.before,[e,...t]);e0(s).forEach(t=>{s.mapping.mapResult(t.oldRange.from).deletedAfter&&s.mapping.mapResult(t.oldRange.to).deletedBefore&&s.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let o=r+n.nodeSize-2,i=t.oldRange.from<=r&&o<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:o,newFrom:s.mapping.map(r),newTo:s.mapping.map(o),deletedRange:t.oldRange,newRange:t.newRange,partial:!i,editor:this.editor,transaction:e,combinedTransform:s})})});let a=s.mapping;s.steps.forEach((t,n)=>{if(t instanceof o.Ys){var r,i;let o=a.slice(n).map(t.from,-1),l=a.slice(n).map(t.to),d=a.invert().map(o,-1),c=a.invert().map(l),u=o>0&&(null===(r=s.doc.nodeAt(o-1))||void 0===r?void 0:r.marks.some(e=>e.eq(t.mark))),p=null===(i=s.doc.nodeAt(l))||void 0===i?void 0:i.marks.some(e=>e.eq(t.mark));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:d,to:c},newRange:{from:o,to:l},partial:!!(p||u),editor:this.editor,transaction:e,combinedTransform:s})}})};null===(n=null===(r=this.editor.options.coreExtensionOptions)||void 0===r||null===(r=r.delete)||void 0===r?void 0:r.async)||void 0===n||n?setTimeout(i,0):i()}}),nc=ns.create({name:"drop",addProseMirrorPlugins(){return[new s.k_({key:new s.hs("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),nu=ns.create({name:"editable",addProseMirrorPlugins(){return[new s.k_({key:new s.hs("editable"),props:{editable:()=>this.editor.options.editable}})]}}),np=new s.hs("focusEvents"),nh=ns.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;return[new s.k_({key:np,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}}}})]}}),nf=ns.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:o,$anchor:i}=n,{pos:a,parent:l}=i,d=i.parent.isTextblock&&a>0?t.doc.resolve(a-1):i,c=d.parent.type.spec.isolating,u=i.pos-i.parentOffset,p=c&&1===d.parent.childCount?u===i.pos:s.LN.atStart(r).from===a;return!!o&&!!l.type.isTextblock&&!l.textContent.length&&!!p&&(!p||"paragraph"!==i.parent.type.name)&&e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},o={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return U()||eu()?o:r},addProseMirrorPlugins(){return[new s.k_({key:new s.hs("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta("composition")))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),o=e.some(e=>e.getMeta("preventClearDocument"));if(!r||o)return;let{empty:i,from:a,to:l}=t.selection,d=s.LN.atStart(t.doc).from,c=s.LN.atEnd(t.doc).to;
8if(i||!(a===d&&l===c)||!tn(n.doc))return;let u=n.tr,p=h({state:n,transaction:u}),{commands:m}=new f({editor:this.editor,state:p});if(m.clearNodes(),u.steps.length)return u}})]}}),nm=ns.create({name:"paste",addProseMirrorPlugins(){return[new s.k_({key:new s.hs("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),ng=ns.create({name:"tabindex",addOptions:()=>({value:void 0}),addProseMirrorPlugins(){return[new s.k_({key:new s.hs("tabindex"),props:{attributes:()=>{var e;return this.editor.isEditable||void 0!==this.options.value?{tabindex:null!==(e=this.options.value)&&void 0!==e?e:"0"}:{}}}})]}}),ny=ns.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=eL(this.extensions);return[{types:e.filter(e=>"text"!==e.name).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute("dir");return t&&("ltr"===t||"rtl"===t||"auto"===t)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new s.k_({key:new s.hs("textDirection"),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),nv=!1;var nb=class e{get name(){return this.node.type.name}constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){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 t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let o=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,s=n.isInline,a=this.pos+r+(i?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;let l=this.resolvedPos.doc.resolve(a);if(!o&&!s&&l.depth<=this.depth)return;let d=new e(l,this.editor,o,o||s?n:null);o&&(d.actualDepth=this.depth+1),t.push(d)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e){if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let o=n[r];if(e[o]!==t[o])break}}else n=r}r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||0===this.children.length)return r;let o=Object.keys(t);return this.children.forEach(i=>{(!n||!(r.length>0))&&(i.node.type.name===e&&o.every(e=>t[e]===i.node.attrs[e])&&r.push(i),n&&r.length>0||(r=r.concat(i.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}};let nw=`.ProseMirror {
9  position: relative;
10}
11
12.ProseMirror {
13  word-wrap: break-word;
14  white-space: pre-wrap;
15  white-space: break-spaces;
16  -webkit-font-variant-ligatures: none;
17  font-variant-ligatures: none;
18  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
19}
20
21.ProseMirror [contenteditable="false"] {
22  white-space: normal;
23}
24
25.ProseMirror [contenteditable="false"] [contenteditable="true"] {
26  white-space: pre-wrap;
27}
28
29.ProseMirror pre {
30  white-space: pre-wrap;
31}
32
33img.ProseMirror-separator {
34  display: inline !important;
35  border: none !important;
36  margin: 0 !important;
37  width: 0 !important;
38  height: 0 !important;
39}
40
41.ProseMirror-gapcursor {
42  display: none;
43  pointer-events: none;
44  position: absolute;
45  margin: 0;
46}
47
48.ProseMirror-gapcursor:after {
49  content: "";
50  display: block;
51  position: absolute;
52  top: -2px;
53  width: 20px;
54  border-top: 1px solid black;
55  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
56}
57
58@keyframes ProseMirror-cursor-blink {
59  to {
60    visibility: hidden;
61  }
62}
63
64.ProseMirror-hideselection *::selection {
65  background: transparent;
66}
67
68.ProseMirror-hideselection *::-moz-selection {
69  background: transparent;
70}
71
72.ProseMirror-hideselection * {
73  caret-color: transparent;
74}
75
76.ProseMirror-focused .ProseMirror-gapcursor {
77  display: block;
78}`;var nk=class extends tN{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:"undefined"!=typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:ti,createMappablePosition:ts},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on("paste",({event:e,slice:t})=>this.options.onPaste(e,t)),this.on("delete",this.options.onDelete);let t=this.createDoc();if(!this.editorState){let e=F(t,this.options.autofocus);this.editorState=s.$t.create({doc:t,schema:this.schema,selection:e||void 0})}!function(e){let t;if(!nv){nv=!0;try{t=o.Ln.fromJSON(e,{from:0,to:0}).slice.content}catch{return}t instanceof a.FK||console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.")}}(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){if("undefined"==typeof document)throw Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;let e=this.editorView.dom;(null==e?void 0:e.editor)&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{"function"==typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():f.createFakeChain()}can(){return this.commandManager?this.commandManager.can():f.createFallbackCan()}injectCSS(){this.options.injectCSS&&"undefined"!=typeof document&&(this.css=function(e,t,n){let r=document.querySelector("style[data-tiptap-style]");if(null!==r)return r;let o=document.createElement("style");return t&&o.setAttribute("nonce",t),o.setAttribute("data-tiptap-style",""),o.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(o),o}(nw,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps({...this.options.editorProps,attributes:this.getEditorViewAttributes()}),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}
78),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if("state"===t)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return tj&&!this.hasWarnedStaleDecorationRead&&tR.has(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=eB(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t="string"==typeof e?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;let n=[...this.options.enableCoreExtensions?[nu,na.configure({blockSeparator:null===(e=this.options.coreExtensionOptions)||void 0===e||null===(e=e.clipboardTextSerializer)||void 0===e?void 0:e.blockSeparator}),nl,nh,nf,ng.configure({value:null===(t=this.options.coreExtensionOptions)||void 0===t||null===(t=t.tabindex)||void 0===t?void 0:t.value}),nc,nm,nd,ny.configure({direction:this.options.textDirection})].filter(e=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[e.name]):[],...this.options.extensions].filter(e=>["extension","node","mark"].includes(null==e?void 0:e.type));this.extensionManager=new ni(n,this)}createCommandManager(){this.commandManager=new f({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=eO(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;let e=eO(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=s.$t.create({doc:e,schema:this.schema,selection:F(e,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>"collaboration"!==e.name),this.createExtensionManager()}}),this.editorState.doc}return e}getEditorViewAttributes(){var e;let t=null===(e=this.options.editorProps)||void 0===e?void 0:e.attributes;return eB(t)?e=>({role:"textbox",...t(e)}):{role:"textbox",...t}}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),o=n?this.extensionManager.dispatchTransaction(r):r,i=t.transformPastedHTML,s=this.extensionManager.transformPastedHTML(i);this.editorView=new d.Lz(e,{...t,attributes:this.getEditorViewAttributes(),dispatchTransaction:o,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS(),this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}
78e.steps.forEach(e=>{var t;return null===(t=this.capturedTransaction)||void 0===t?void 0:t.step(e)});return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),o=n.includes(e),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!o)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});let s=n.findLast(e=>e.getMeta("focus")||e.getMeta("blur")),a=null==s?void 0:s.getMeta("focus"),l=null==s?void 0:s.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:s}),l&&this.emit("blur",{editor:this,event:l.event,transaction:s}),e.getMeta("preventUpdate")||!n.some(e=>e.docChanged)||i.doc.eq(t.doc)||this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return eQ(this.state,e)}isActive(e,t){let n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return eh(e,null,n)||e5(e,null,n);let r=ev(t,e.schema);return"node"===r?eh(e,t,n):"mark"===r&&e5(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ej(this.state.doc.content,this.schema)}getText(e){var t,n;let{blockSeparator:r="\n\n",textSerializers:o={}}=e||{};return t=this.state.doc,n={blockSeparator:r,textSerializers:{...eX(this.schema),...o}},eG(t,{from:0,to:t.content.size},n)}get isEmpty(){return tn(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var e,t;return null===(e=null===(t=this.editorView)||void 0===t?void 0:t.isDestroyed)||void 0===e||e}$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),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new nb(t,this,!1,n)}get $doc(){return this.$pos(0)}},nx=class{static Inline(e,t,n={},r){return new nM(e,t,n,r)}static Node(e,t,n={},r){return new nS(e,t,n,r)}static Widget(e,t,n){let{key:r,...o}=n;return new nE(e,t,r,o)}},nM=class extends nx{constructor(e,t,n={},r){super(),this.kind="inline",this.from=e,this.to=t,this.attrs=n,this.spec=r}get anchor(){return this.from}toPMDecoration(e){let t=e?{...this.spec,extensionName:e}:this.spec;return d.NZ.inline(this.from,this.to,this.attrs,t)}},nS=class extends nx{constructor(e,t,n={},r){super(),this.kind="node",this.from=e,this.to=t,this.attrs=n,this.spec=r}get anchor(){return this.from}toPMDecoration(e){let t=e?{...this.spec,extensionName:e}:this.spec;return d.NZ.node(this.from,this.to,this.attrs,t)}},nE=class extends nx{constructor(e,t,n,r){super(),this.kind="widget",this.pos=e,this.render=t,this.key=n,this.spec=r}get anchor(){return this.pos}toPMDecoration(e){let t=e?{...this.spec,key:this.key,extensionName:e}:{...this.spec,key:this.key};return d.NZ.widget(this.pos,this.render,t)}};function nT(e){return new t7({find:e.find,handler:({state:t,range:n,match:r})=>{let o=ez(e.getAttributes,void 0,r);if(!1===o||null===o)return null;let{tr:i}=t,s=r[r.length-1],a=r[0];if(s){let r=a.search(/\S/),l=n.from+a.indexOf(s),d=l+s.length;if(e1(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>l).length)return null;d<n.to&&i.delete(d,n.to),l>n.from&&i.delete(n.from+r,l);let c=n.from+r+s.length;i.addMark(n.from+r,c,e.type.create(o||{})),i.removeStoredMark(e.type)}},undoable:e.undoable})}function nC(e){return new t7({find:e.find,handler:({state:t,range:n,match:r})=>{let o=ez(e.getAttributes,void 0,r)||{},{tr:i}=t,s=n.from,a=n.to,l=e.type.create(o);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>a?e=a:a=e+r[1].length;let t=r[0][r[0].length-1];i.insertText(t,s+r[0].length-1),i.replaceWith(e,a,l)}else if(r[0]){let t=e.type.isInline?s:s-1;i.insert(t,e.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()},undoable:e.undoable})}function nO(e){return new t7({find:e.find,handler:({state:t,range:n,match:r})=>{let o=t.doc.resolve(n.from),i=ez(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)},undoable:e.undoable})}function nA(e){return new t7({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let s=ez(e.getAttributes,void 0,r)||{},a=t.tr.delete(n.from,n.to),l=a.doc.resolve(n.from).blockRange(),d=l&&(0,o.oM)(l,e.type,s);if(!d)return null;if(a.wrap(l,d),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:o}=e.editor.extensionManager,i=r||n.$to.parentOffset&&n.$from.marks();if(i){let e=i.filter(e=>
78o.includes(e.type.name));a.ensureMarks(e)}}if(e.keepAttributes){let t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";i().updateAttributes(t,s).run()}let c=a.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&(0,o.n9)(a.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&a.join(n.from-1)},undoable:e.undoable})}var nP=class e extends t8{constructor(...e){super(...e),this.type="node"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},nD=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=()=>{try{return t.getPos()}catch{return}},this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,o,i,a,l;let{view:d}=this.editor,c=e.target,u=3===c.nodeType?null===(t=c.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(c))||!u)return;let p=0,h=0;if(this.dom!==u){let t=this.dom.getBoundingClientRect(),n=u.getBoundingClientRect(),s=null!==(r=e.offsetX)&&void 0!==r?r:null===(o=e.nativeEvent)||void 0===o?void 0:o.offsetX,l=null!==(i=e.offsetY)&&void 0!==i?i:null===(a=e.nativeEvent)||void 0===a?void 0:a.offsetY;p=n.x-t.x+s,h=n.y-t.y+l}let f=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();f.style.width=`${Math.round(e.width)}px`,f.style.height=`${Math.round(e.height)}px`,f.style.boxSizing="border-box",f.style.pointerEvents="none"}catch{}let m=null;try{(m=document.createElement("div")).style.position="absolute",m.style.top="-9999px",m.style.left="-9999px",m.style.pointerEvents="none",m.appendChild(f),document.body.appendChild(m),null===(l=e.dataTransfer)||void 0===l||l.setDragImage(f,p,h)}finally{m&&setTimeout(()=>{try{null==m||m.remove()}catch{}},0)}let g=this.getPos();if("number"!=typeof g)return;let y=s.nh.create(d.state.doc,g),v=d.state.tr.setSelection(y);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?void 0:t.contains(n))))return!1;let r=e.type.startsWith("drag"),o="dragover"===e.type||"dragenter"===e.type,i="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!i&&!r)return!0;let{isEditable:a}=this.editor,{isDragging:l}=this,d=!!this.node.type.spec.draggable,c=s.nh.isSelectable(this.node),u="copy"===e.type,p="paste"===e.type,h="cut"===e.type,f="mousedown"===e.type;if(!d&&c&&r&&e.target===this.dom&&e.preventDefault(),d&&r&&!l&&e.target===this.dom)return e.preventDefault(),!1;if(d&&a&&!l&&f){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!l&&!o&&!i&&!u&&!p&&!h&&(!f||!c)}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.contentDOM.contains(e.target)&&"childList"===e.type&&(U()||_())&&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)):"selection"!==e.type)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return"number"==typeof n&&(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){let e=this.getPos();if("number"!=typeof e)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function n$(e){return new nt({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:o})=>{let i=ez(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 o=l.search(/\S/),c=n.from+l.indexOf(a),u=c+a.length;if(e1(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;u<n.to&&s.delete(u,n.to),c>n.from&&s.delete(n.from+o,c),d=n.from+o+a.length,s.addMark(n.from+o,d,e.type.create(i||{})),void 0!==r.index&&void 0!==r.input&&r.index+r[0].length>=r.input.length||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.