@blocknote/core
Version:
A "Notion-style" block-based extensible text editor built on top of Prosemirror and Tiptap.
21 lines • 92.5 kB
JavaScript
const e=require("./blocks-BqHv0xhc.cjs"),t=require("./BlockNoteExtension-M0znTzxP.cjs"),n=require("./extensions-Ghr9QqqR.cjs"),r=require("./UserStore-DCG6lsla.cjs"),i=require("./en-C5Z4Ag9_.cjs");let a=require("prosemirror-model"),o=require("prosemirror-transform"),s=require("@tiptap/core"),c=require("prosemirror-state"),l=require("@tiptap/pm/model"),u=require("prosemirror-tables"),d=require("@tiptap/pm/state"),f=require("lib0/hash/fnv1a"),p=require("@handlewithcare/prosemirror-inputrules"),m=require("@tiptap/pm/keymap"),h=require("@tiptap/extension-text"),g=require("@tiptap/extensions/gap-cursor");function _(e,t){let n=[{tag:`[data-inline-content-type="${e.type}"]`,contentElement:e=>{let t=e;return t.matches(`[data-editable]`)?t:t.querySelector(`[data-editable]`)||t}}];return t&&n.push({tag:`*`,getAttrs(e){if(typeof e==`string`)return!1;let n=t?.(e);return n===void 0?!1:n}}),n}function ee(t,n){return e.tn(s.Node.create({name:t.type,inline:!0,group:`inline`,draggable:n.meta?.draggable,selectable:t.content===`styled`,atom:t.content===`none`,content:t.content===`styled`?`inline*`:``,addAttributes(){return e.dn(t.propSchema)},addKeyboardShortcuts(){return e.en(t)},parseHTML(){return _(t,n.parse)},renderHTML({node:r}){let i=this.options.editor;return e.$t(n.render.call({renderType:`dom`,props:void 0},e.bn(r,i.schema.inlineContentSchema,i.schema.styleSchema),()=>{},i),t.type,r.attrs,t.propSchema)},addNodeView(){return r=>{let{node:i,getPos:a}=r,o=this.options.editor;return e.$t(n.render.call({renderType:`nodeView`,props:r},e.bn(i,o.schema.inlineContentSchema,o.schema.styleSchema),t=>{let n=e.Mt([t],o.pmSchema),r=a();r&&o.transact(e=>e.replaceWith(r,r+i.nodeSize,n))},o),t.type,i.attrs,t.propSchema)}}}),t.propSchema,{...n,toExternalHTML:n.toExternalHTML,render(r,i,a){return e.$t(n.render(r,i,a),t.type,r.props,t.propSchema)}})}function v(t,n,r,i=`before`){let s=typeof r==`string`?r:r.id,c=e.En(t),l=n.map(t=>{let n=e.jt(t,c);return n.check(),n}),u=e.kt(s,t.doc);if(!u)throw Error(`Block with ID ${s} not found`);let d=u.posBeforeNode;return i===`after`&&(d+=u.node.nodeSize),t.step(new o.ReplaceStep(d,d,new a.Slice(a.Fragment.from(l),0,0))),l.map(n=>e.yn(n,t.doc))}function y(e){if(!e||e.type.name!==`column`)throw Error(`Invalid columnPos: does not point to column node.`);let t=e.firstChild;if(!t)throw Error(`Invalid column: does not have child node.`);let n=t.firstChild;if(!n)throw Error(`Invalid blockContainer: does not have child node.`);return e.childCount===1&&t.childCount===1&&n.type.name===`paragraph`&&n.content.content.length===0}function te(e,t){let n=e.doc.resolve(t),r=n.nodeAfter;if(!r||r.type.name!==`columnList`)throw Error(`Invalid columnListPos: does not point to columnList node.`);for(let t=r.childCount-1;t>=0;t--){let r=e.doc.resolve(n.pos+1).posAtIndex(t),i=e.doc.resolve(r).nodeAfter;if(!i||i.type.name!==`column`)throw Error(`Invalid columnPos: does not point to column node.`);y(i)&&e.delete(r,r+i.nodeSize)}}function b(e,t){te(e,t);let n=e.doc.resolve(t).nodeAfter;if(!n||n.type.name!==`columnList`)throw Error(`Invalid columnListPos: does not point to columnList node.`);if(n.childCount>2)return;if(n.childCount<2)throw Error(`Invalid columnList: contains fewer than two children.`);let r=t+1,i=e.doc.resolve(r).nodeAfter,s=t+n.nodeSize-1,c=e.doc.resolve(s).nodeBefore;if(!i||!c)throw Error(`Invalid columnList: does not contain children.`);let l=y(i),u=y(c);if(l&&u){e.delete(t,t+n.nodeSize);return}if(l){e.step(new o.ReplaceAroundStep(t,t+n.nodeSize,s-c.nodeSize+1,s-1,a.Slice.empty,0,!1));return}if(u){e.step(new o.ReplaceAroundStep(t,t+n.nodeSize,r+1,r+i.nodeSize-1,a.Slice.empty,0,!1));return}}function x(t,n,r,i={}){let a=e.En(t),o=r.map(t=>{let n=e.jt(t,a);return n.check(),n}),s=new Set(n.map(e=>typeof e==`string`?e:e.id)),c=[],l=new Set,u=typeof n[0]==`string`?n[0]:n[0].id,d=0;if(t.doc.descendants((n,i)=>{if(s.size===0)return!1;if(!n.type.isInGroup(`bnBlock`))return!0;let a=e.$n(n,t.doc);if(!s.has(a))return!0;if(c.push(e.yn(n,t.doc)),s.delete(a),r.length>0&&a===u){let e=t.doc.nodeSize;t.insert(i,o);let n=t.doc.nodeSize;d+=e-n}let f=t.doc.nodeSize,p=t.doc.resolve(i-d);p.node().type.name===`column`?l.add(p.before(-1)):p.node().type.name===`columnList`&&l.add(p.before()),p.node().type.name===`blockGroup`&&p.node(p.depth-1).type.name!==`doc`&&p.node().childCount===1?t.delete(p.before(),p.after()):t.delete(i-d,i-d+n.nodeSize);let m=t.doc.nodeSize;return d+=f-m,!1}),s.size>0){let e=[...s].join(`
`);throw Error(`Blocks with the following IDs could not be found in the editor: `+e)}return i.fixColumns!==!1&&l.forEach(e=>b(t,e)),{insertedBlocks:o.map(n=>e.yn(n,t.doc)),removedBlocks:c}}function ne(t,n,r,i,o){let s;if(!n)throw Error(`blockContent is required`);if(typeof n==`string`)s=e.Mt([n],t.pmSchema,i);else if(Array.isArray(n))s=e.Mt(n,t.pmSchema,i);else if(n.type===`tableContent`)s=e.Nt(n,t.pmSchema);else throw new e.In(n.type);let c=(o?.document??document).createDocumentFragment();for(let n of s)if(n.type.name!==`text`&&t.schema.inlineContentSchema[n.type.name]){let i=t.schema.inlineContentSpecs[n.type.name].implementation;if(i){let a=e.bn(n,t.schema.inlineContentSchema,t.schema.styleSchema),s=i.render.call({renderType:`dom`,props:void 0},a,()=>{},t);if(s){if(c.appendChild(s.dom),s.contentDOM){let e=r.serializeFragment(n.content,o);s.contentDOM.dataset.editable=``,s.contentDOM.appendChild(e)}continue}}}else if(n.type.name===`text`){let e=document.createTextNode(n.textContent);for(let r of n.marks.toReversed())if(r.type.name in t.schema.styleSpecs){let n=t.schema.styleSpecs[r.type.name].implementation.render(r.attrs.stringValue,t);n.contentDOM.appendChild(e),e=n.dom}else{let t=r.type.spec.toDOM(r,!0),n=a.DOMSerializer.renderSpec(document,t);n.contentDOM.appendChild(e),e=n.dom}c.appendChild(e)}else{let e=r.serializeFragment(a.Fragment.from([n]),o);c.appendChild(e)}return c}function re(e,t,n,r){let i=e.pmSchema.nodes.blockContainer,a=t.props||{};for(let[n,r]of Object.entries(e.schema.blockSchema[t.type].propSchema))!(n in a)&&r.default!==void 0&&(a[n]=r.default);let o=t.children||[],s=e.blockImplementations[t.type].implementation.render.call({renderType:`dom`,props:void 0},{...t,props:a,children:o},e);if(s.contentDOM&&t.content){let i=ne(e,t.content,n,t.type,r);s.contentDOM.appendChild(i)}if(e.pmSchema.nodes[t.type].isInGroup(`bnBlock`)){if(t.children&&t.children.length>0){let i=ie(e,t.children,n,r);s.contentDOM?.append(i)}return s.dom}let c=i.spec?.toDOM?.(i.create({id:t.id,...a}));return c.contentDOM?.appendChild(s.dom),t.children&&t.children.length>0&&c.contentDOM?.appendChild(ae(e,t.children,n,r)),c.dom}function ie(e,t,n,r){let i=(r?.document??document).createDocumentFragment();for(let a of t){let t=re(e,a,n,r);i.appendChild(t)}return i}var ae=(e,t,n,r)=>{let i=e.pmSchema.nodes.blockGroup,a=i.spec.toDOM(i.create({})),o=ie(e,t,n,r);return a.contentDOM?.appendChild(o),a.dom},oe=e=>(e.querySelectorAll(`[data-content-type="numberedListItem"]`).forEach(e=>{let t=e.closest(`.bn-block-outer`)?.previousElementSibling?.querySelector(`[data-content-type="numberedListItem"]`);if(!t)e.setAttribute(`data-index`,e.getAttribute(`data-start`)||`1`);else{let n=t.getAttribute(`data-index`);e.setAttribute(`data-index`,(parseInt(n||`0`)+1).toString())}}),e),se=e=>(e.querySelectorAll(`[data-content-type="checkListItem"] input`).forEach(e=>{e.disabled=!0}),e),ce=e=>(e.querySelectorAll(`.bn-toggle-wrapper[data-show-children="false"]`).forEach(e=>{e.setAttribute(`data-show-children`,`true`)}),e),le=e=>(e.querySelectorAll(`[data-content-type="table"] table`).forEach(e=>{e.setAttribute(`style`,`--default-cell-min-width: 120px;`),e.setAttribute(`data-show-children`,`true`)}),e),ue=e=>(e.querySelectorAll(`[data-content-type="table"] table`).forEach(e=>{let t=document.createElement(`div`);t.className=`tableWrapper`;let n=document.createElement(`div`);n.className=`tableWrapper-inner`,t.appendChild(n),e.parentElement?.appendChild(t),t.appendChild(e)}),e),de=e=>(e.querySelectorAll(`.bn-inline-content:empty`).forEach(e=>{let t=document.createElement(`span`);t.className=`ProseMirror-trailingBreak`,t.setAttribute(`style`,`display: inline-block;`),e.appendChild(t)}),e),fe=(e,t)=>{let n=a.DOMSerializer.fromSchema(e),r=[oe,se,ce,le,ue,de];return{serializeBlocks:(e,i)=>{let a=ae(t,e,n,i);for(let e of r)a=e(a);return a.outerHTML}}},pe=e=>{let t=0;for(let n=0;n<e.length;n++)t=Math.imul(31,t)+e.charCodeAt(n);return Math.abs(t)},S=[{light:`#fff0c2`,dark:`#8a6d1a`},{light:`#fcc9c3`,dark:`#8a2e24`},{light:`#d4e8eb`,dark:`#4a7178`},{light:`#c2eeff`,dark:`#1a6e8a`},{light:`#bef3ff`,dark:`#0a7a8a`}],me=e=>S[pe(e)%S.length],he=(e,t)=>{if(!t||t.length===0)return S[0];let n=t[0],r=e.getUser(n);return r?.color&&r.colorLight?{light:r.colorLight,dark:r.color}:me(n)},ge=e=>(0,f.digestString)(e).toString(16).padStart(8,`0`),_e=e=>{let t=ge(e);return{light:`--user-color-${t}-light`,dark:`--user-color-${t}-dark`}},C=class{callbacks={};on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),()=>this.off(e,t)}emit(e,...t){let n=this.callbacks[e];n&&n.forEach(e=>e.apply(this,t))}off(e,t){let n=this.callbacks[e];n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e])}removeAllListeners(){this.callbacks={}}};function ve(t){return t.transact(t=>{let n=e.Jn(t,t.selection.anchor),r=e.$n(n.bnBlock.node,t.doc);if(t.selection instanceof u.CellSelection)return{type:`cell`,anchorBlockId:r,anchorCellOffset:t.selection.$anchorCell.pos-n.bnBlock.beforePos,headCellOffset:t.selection.$headCell.pos-n.bnBlock.beforePos};if(t.selection instanceof c.NodeSelection)return{type:`node`,anchorBlockId:r};{let i=e.Jn(t,t.selection.head);return{type:`text`,anchorBlockId:r,headBlockId:e.$n(i.bnBlock.node,t.doc),anchorOffset:t.selection.anchor-n.bnBlock.beforePos,headOffset:t.selection.head-i.bnBlock.beforePos}}})}function ye(t,n){let r=e.kt(n.anchorBlockId,t.doc)?.posBeforeNode;if(r===void 0)throw Error(`Could not find block with ID ${n.anchorBlockId} to update selection`);let i;if(n.type===`cell`)i=u.CellSelection.create(t.doc,r+n.anchorCellOffset,r+n.headCellOffset);else if(n.type===`node`)i=c.NodeSelection.create(t.doc,r+1);else{let a=e.kt(n.headBlockId,t.doc)?.posBeforeNode;if(a===void 0)throw Error(`Could not find block with ID ${n.headBlockId} to update selection`);i=c.TextSelection.create(t.doc,r+n.anchorOffset,a+n.headOffset)}t.setSelection(i)}function be(e){return e.flatMap(e=>e.type===`column`?e.children:[e])}function w(e,t,n,r){e.transact(e=>{x(e,t,[],{fixColumns:!1}),v(e,be(t),n,r)})}function xe(e,t,n){e.transact(r=>{let i=e.getSelection()?.blocks||[e.getTextCursorPosition().block],a=ve(e);w(e,i,t,n),ye(r,a)})}function Se(e){return!e||e.type!==`columnList`}function Ce(e,t,n){let r,i;if(t?t.children.length>0?(r=t.children[t.children.length-1],i=`after`):(r=t,i=`before`):n&&(r=n,i=`before`),!r||!i)return;let a=e.getParentBlock(r);return Se(a)?{referenceBlock:r,placement:i}:Ce(e,i===`after`?r:e.getPrevBlock(r),a)}function we(e,t,n){let r,i;if(t?t.children.length>0?(r=t.children[0],i=`before`):(r=t,i=`after`):n&&(r=n,i=`after`),!r||!i)return;let a=e.getParentBlock(r);return Se(a)?{referenceBlock:r,placement:i}:we(e,i===`before`?r:e.getNextBlock(r),a)}function Te(e,t){e.transact(()=>{let n;if(t){if(n=e.getBlock(t),!n)return}else n=e.getSelection()?.blocks[0]||e.getTextCursorPosition().block;let r=Ce(e,e.getPrevBlock(n),e.getParentBlock(n));r&&(t?w(e,[n],r.referenceBlock,r.placement):xe(e,r.referenceBlock,r.placement))})}function Ee(e,t){e.transact(()=>{let n;if(t){if(n=e.getBlock(t),!n)return}else{let t=e.getSelection();n=t?.blocks[t?.blocks.length-1]||e.getTextCursorPosition().block}let r=we(e,e.getNextBlock(n),e.getParentBlock(n));r&&(t?w(e,[n],r.referenceBlock,r.placement):xe(e,r.referenceBlock,r.placement))})}function De(e,t,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,e=>e.childCount>0&&(e.type.name===`blockGroup`||e.type.name===`column`));if(!s)return!1;let c=s.startIndex;if(c===0)return!1;let l=s.parent.child(c-1);if(l.type!==t)return!1;let u=l.lastChild&&l.lastChild.type===n,d=a.Fragment.from(u?t.create():null),f=new a.Slice(a.Fragment.from(t.create(null,a.Fragment.from(n.create(null,d)))),u?3:1,0),p=s.start,m=s.end;return e.step(new o.ReplaceAroundStep(p-(u?3:1),m,p,m,f,1,!0)).scrollIntoView(),!0}function T(e){return e.transact(t=>De(t,e.pmSchema.nodes.blockContainer,e.pmSchema.nodes.blockGroup))}function Oe(e,t,n,r){let i=r.end,s=r.$to.end(r.depth);if(i<s){let c=r.parent.child(r.endIndex-1),l=c.lastChild&&c.lastChild.type===n;e.step(new o.ReplaceAroundStep(i-(l?2:1),s,i,s,new a.Slice(a.Fragment.from(t.create(null,n.create())),l?2:1,0),+!l,!0)),r=new a.NodeRange(e.doc.resolve(r.$from.pos),e.doc.resolve(s),r.depth)}let c=(0,o.liftTarget)(r);if(c==null)return!1;e.lift(r,c);let l=e.doc.resolve(e.mapping.map(i,-1)-1);return(0,o.canJoin)(e.doc,l.pos)&&l.nodeBefore.type===l.nodeAfter.type&&e.join(l.pos),e.scrollIntoView(),!0}function E(e,t,n){let{$from:r,$to:i}=e.selection,a=r.blockRange(i,e=>e.childCount>0&&(e.type.name===`blockGroup`||e.type.name===`column`));return a&&r.node(a.depth-1).type===t?Oe(e,t,n,a):!1}function D(e){return e.transact(t=>E(t,e.pmSchema.nodes.blockContainer,e.pmSchema.nodes.blockGroup))}function ke(t){return t.transact(t=>{let{bnBlock:n}=e.Xn(t);return t.doc.resolve(n.beforePos).nodeBefore!==null})}function Ae(t){return t.transact(t=>{let{bnBlock:n}=e.Xn(t);return t.doc.resolve(n.beforePos).depth>1})}function O(t,n){let r=e.kt(typeof n==`string`?n:n.id,t);if(r)return e.yn(r.node,t)}function k(t,n){let r=e.kt(typeof n==`string`?n:n.id,t);if(!r)return;let i=t.resolve(r.posBeforeNode).nodeBefore;if(i)return e.yn(i,t)}function A(t,n){let r=e.kt(typeof n==`string`?n:n.id,t);if(!r)return;let i=t.resolve(r.posBeforeNode+r.node.nodeSize).nodeAfter;if(i)return e.yn(i,t)}function j(t,n){let r=e.kt(typeof n==`string`?n:n.id,t);if(!r)return;let i=t.resolve(r.posBeforeNode),a=i.node(),o=i.node(-1),s=o.type.name===`doc`?void 0:a.type.name===`blockGroup`?o:a;if(s)return e.yn(s,t)}var je=class{editor;constructor(e){this.editor=e}get document(){return this.editor.transact(t=>e.vn(t.doc))}getBlock(e){return this.editor.transact(t=>O(t.doc,e))}getPrevBlock(e){return this.editor.transact(t=>k(t.doc,e))}getNextBlock(e){return this.editor.transact(t=>A(t.doc,e))}getParentBlock(e){return this.editor.transact(t=>j(t.doc,e))}forEachBlock(e,t=!1){let n=this.document.slice();t&&n.reverse();function r(n){for(let i of n)if(e(i)===!1||!r(t?i.children.slice().reverse():i.children))return!1;return!0}r(n)}insertBlocks(e,t,n=`before`){return this.editor.transact(r=>v(r,e,t,n))}updateBlock(t,n){return this.editor.transact(r=>e.Et(r,t,n))}removeBlocks(e){return this.editor.transact(t=>x(t,e,[]).removedBlocks)}replaceBlocks(e,t){return this.editor.transact(n=>x(n,e,t))}canNestBlock(){return ke(this.editor)}nestBlock(){T(this.editor)}canUnnestBlock(){return Ae(this.editor)}unnestBlock(){D(this.editor)}moveBlocksUp(e){return Te(this.editor,e)}moveBlocksDown(e){return Ee(this.editor,e)}},Me=class extends C{editor;constructor(e){super(),this.editor=e,e.on(`create`,()=>{e._tiptapEditor.on(`update`,({transaction:t,appendedTransactions:n})=>{this.emit(`onChange`,{editor:e,transaction:t,appendedTransactions:n})}),e._tiptapEditor.on(`selectionUpdate`,({transaction:t})=>{this.emit(`onSelectionChange`,{editor:e,transaction:t})}),e._tiptapEditor.on(`mount`,()=>{this.emit(`onMount`,{editor:e})}),e._tiptapEditor.on(`unmount`,()=>{this.emit(`onUnmount`,{editor:e})})})}onChange(e,t=!0){let r=({transaction:r,appendedTransactions:i})=>{!t&&Ne(r)||e(this.editor,{getChanges(){return n.k(r,i)}})};return this.on(`onChange`,r),()=>{this.off(`onChange`,r)}}onSelectionChange(e,t=!1){let n=n=>{!t&&Ne(n.transaction)||e(this.editor)};return this.on(`onSelectionChange`,n),()=>{this.off(`onSelectionChange`,n)}}onMount(e){return this.on(`onMount`,e),()=>{this.off(`onMount`,e)}}onUnmount(e){return this.on(`onUnmount`,e),()=>{this.off(`onUnmount`,e)}}};function Ne(e){return!!e.getMeta(`y-sync$`)}function Pe(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function Fe(e){return e.nodeType===3&&!/\S/.test(e.nodeValue||``)}function Ie(e){e.querySelectorAll(`li > ul, li > ol`).forEach(e=>{let t=Pe(e),n=e.parentElement,r=Array.from(n.childNodes).slice(t+1);e.remove(),r.forEach(e=>{e.remove()}),n.insertAdjacentElement(`afterend`,e),r.reverse().forEach(t=>{if(Fe(t))return;let n=document.createElement(`li`);n.append(t),e.insertAdjacentElement(`afterend`,n)}),n.childNodes.length===0&&n.remove()})}function Le(e){e.querySelectorAll(`li + ul, li + ol`).forEach(e=>{let t=e.previousElementSibling,n=document.createElement(`div`);t.insertAdjacentElement(`afterend`,n),n.append(t);let r=document.createElement(`div`);for(r.setAttribute(`data-node-type`,`blockGroup`),n.append(r);n.nextElementSibling?.nodeName===`UL`||n.nextElementSibling?.nodeName===`OL`;)r.append(n.nextElementSibling)})}var Re=null;function ze(){return Re||=document.implementation.createHTMLDocument(`title`)}function Be(e){if(typeof e==`string`){let t=ze().createElement(`div`);t.innerHTML=e,e=t}return Ie(e),Le(e),e}function Ve(e){let t=e.ownerDocument.createTreeWalker(e,128),n;for(;n=t.nextNode();)if(/^\s*notionvc:/.test(n.nodeValue||``))return!0;return!1}function He(e){let t=new Set([`PRE`,`CODE`]),n=e.ownerDocument.createTreeWalker(e,4,{acceptNode(n){let r=n.parentElement;for(;r&&r!==e;){if(t.has(r.tagName))return 2;r=r.parentElement}return 1}}),r=[],i;for(;i=n.nextNode();)r.push(i);for(let e of r)e.nodeValue&&/[\r\n]/.test(e.nodeValue)&&(e.nodeValue=e.nodeValue.replace(/[ \t\r\n\f]+/g,` `))}function Ue(e){Ve(e)||He(e)}function M(t,n){let r=Be(t);Ue(r);let i=a.DOMParser.fromSchema(n).parse(r,{topNode:n.nodes.blockGroup.create()}),o=[];for(let t=0;t<i.childCount;t++)o.push(e.yn(i.child(t),i));return o}function N(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function We(e){return e?/\w/.test(e):!1}function P(e,t,n){let r=t>0?e[t-1]:void 0,i=t+n<e.length?e[t+n]:void 0;return We(r)&&We(i)}function Ge(e,t){if(e[t]!==`\\`||t+1>=e.length)return null;let n=e[t+1];return n===`
`?{html:`<br>
`,end:t+2}:"\\`*_{}[]()#+-.!~|>".includes(n)?{html:N(n),end:t+2}:null}function Ke(e,t){return e[t]==="`"?ct(e,t):null}function qe(e,t){return e[t]!==`!`||e[t+1]!==`[`?null:lt(e,t)}function Je(e,t){return e[t]===`[`?ut(e,t):null}function Ye(e,t){return e[t]!==`~`||e[t+1]!==`~`?null:I(e,t,`~~`,`<del>`,`</del>`)}function Xe(e,t){return e[t]===`*`&&e[t+1]===`*`&&e[t+2]===`*`||e[t]===`_`&&e[t+1]===`_`&&e[t+2]===`_`&&!P(e,t,3)?I(e,t,e.substring(t,t+3),`<strong><em>`,`</em></strong>`):null}function Ze(e,t){return e[t]===`*`&&e[t+1]===`*`||e[t]===`_`&&e[t+1]===`_`&&!P(e,t,2)?I(e,t,e.substring(t,t+2),`<strong>`,`</strong>`):null}function Qe(e,t){return e[t]===`*`||e[t]===`_`&&!P(e,t,1)?I(e,t,e[t],`<em>`,`</em>`):null}function $e(e,t){return e[t]===`
`?{html:`<br>
`,end:t+1}:null}var et=/^<\/?[a-zA-Z][a-zA-Z0-9-]*(?:\s+[a-zA-Z_:][a-zA-Z0-9_.:-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*\s*\/?>/,tt=/^<!--[\s\S]*?-->/,nt=/^<!\[CDATA\[[\s\S]*?\]\]>/,rt=/^<\?[\s\S]*?\?>/,it=/^<![A-Za-z][\s\S]*?>/;function at(e,t){if(e[t]!==`<`)return null;let n=e.substring(t);for(let e of[tt,nt,rt,it,et]){let r=n.match(e);if(r)return{html:r[0],end:t+r[0].length}}return null}var ot=new Set(`\\\`![~*_
<`),st=[Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,at,$e];function F(e){let t=``,n=0;for(;n<e.length;){if(e[n]===`
`&&n>=2&&e[n-1]===` `&&e[n-2]===` `){t=t.replace(/ +$/,``),t+=`<br>
`,n++;continue}let r=!1;if(ot.has(e[n]))for(let i of st){let a=i(e,n);if(a){t+=a.html,n=a.end,r=!0;break}}if(!r){let r=n;for(n++;n<e.length&&!ot.has(e[n]);)n++;t+=N(e.substring(r,n))}}return t}function ct(e,t){let n=0,r=t;for(;r<e.length&&e[r]==="`";)n++,r++;let i=r;for(;i<e.length;)if(e[i]==="`"){let t=0,a=i;for(;i<e.length&&e[i]==="`";)t++,i++;if(t===n){let t=e.substring(r,a);return t=t.replace(/\n/g,` `),t.length>=2&&t[0]===` `&&t[t.length-1]===` `&&/[^ ]/.test(t)&&(t=t.substring(1,t.length-1)),{html:`<code>${N(t)}</code>`,end:i}}}else i++;return null}function lt(t,n){let r=dt(t,n+1);if(r===-1)return null;let i=n+2;if(t[r+1]!==`(`)return null;let a=r+2,o=ft(t,a-1);if(o===-1)return null;let s=t.substring(i,r),{url:c,title:l}=pt(t.substring(a,o));if(e.hn(c)){let e=s||l;return{html:`<video src="${N(c)}"${e?` data-name="${N(e)}"`:``} data-url="${N(c)}" controls></video>`,end:o+1}}let u=l===void 0?``:` title="${N(l)}"`;return{html:`<img src="${N(c)}" alt="${N(s)}"${u}>`,end:o+1}}function ut(e,t){let n=t+1,r=dt(e,t);if(r===-1||e[r+1]!==`(`)return null;let i=r+2,a=ft(e,r+1);if(a===-1)return null;let o=e.substring(n,r),{url:s,title:c}=pt(e.substring(i,a)),l=c===void 0?``:` title="${N(c)}"`;return{html:`<a href="${N(s)}"${l}>${F(o)}</a>`,end:a+1}}function dt(e,t){let n=0;for(let r=t;r<e.length;r++){if(e[r]===`\\`&&r+1<e.length){r++;continue}if(e[r]===`[`&&n++,e[r]===`]`&&(n--,n===0))return r}return-1}function ft(e,t){let n=0;for(let r=t;r<e.length;r++){if(e[r]===`\\`&&r+1<e.length){r++;continue}if(e[r]===`(`&&n++,e[r]===`)`&&(n--,n===0))return r}return-1}function pt(e){e=e.trim();let t,n;if(e.startsWith(`<`)){let r=e.indexOf(`>`);r===-1?(t=e.substring(1),n=``):(t=e.substring(1,r),n=e.substring(r+1).trim())}else{let r=e.length;for(let t=0;t<e.length;t++){if(e[t]===`\\`&&t+1<e.length){t++;continue}if(e[t]===` `||e[t]===` `||e[t]===`
`){r=t;break}}t=e.substring(0,r),n=e.substring(r).trim()}let r;if(n.length>0){let e=n.match(/^"([^"]*)"$|^'([^']*)'$|^\(([^)]*)\)$/);e&&(r=e[1]??e[2]??e[3])}return{url:t,title:r}}function I(e,t,n,r,i){let a=n.length,o=t+a;if(o>=e.length||e[o]===` `||e[o]===` `)return null;let s=o;for(;s<e.length;){if(e[s]===`\\`&&s+1<e.length){s+=2;continue}if(e.substring(s,s+a)===n){if(e[s-1]===` `||e[s-1]===` `){s++;continue}if(a===1&&(s>0&&e[s-1]===n[0]&&!(s>=2&&e[s-2]===`\\`)||s+a<e.length&&e[s+a]===n[0])){s++;continue}let t=e.substring(o,s);if(t.length===0){s++;continue}return{html:r+F(t)+i,end:s+a}}s++}return null}var mt=new Set(`address.article.aside.audio.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.section.source.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`));function ht(e){if(/^ {0,3}<(!--|\?|![A-Za-z]|!\[CDATA\[)/.test(e))return!0;let t=e.match(/^ {0,3}<\/?([a-zA-Z][a-zA-Z0-9-]*)(?:\s|\/?>|$)/);return t?mt.has(t[1].toLowerCase()):!1}function L(e){let t=e.split(`
`),n=[],r=0,i=!0;for(;r<t.length;){let e=t[r];if(e.trim()===``){i=!0,r++;continue}let a=e.match(/^ {0,3}(`{3,}|~{3,})(.*)$/);if(a){let e=a[1],o=e[0],s=e.length,c=a[2].trim(),l=[];for(r++;r<t.length;){if(t[r].match(RegExp(`^ {0,3}${o}{${s},}\\s*$`))){r++;break}l.push(t[r]),r++}n.push({type:`codeBlock`,language:c||``,code:l.join(`
`)}),i=!1;continue}let o=e.match(/^(#{1,6})\s+(.+?)(?:\s+#+\s*|\s*)$/);if(o){n.push({type:`heading`,level:o[1].length,content:o[2]}),i=!1,r++;continue}if(/^(\s{0,3})([-*_])\s*(\2\s*){2,}$/.test(e)){let t=n[n.length-1];if(!i&&e.trim().match(/^-+$/)&&t&&t.type===`paragraph`){let e=t;n[n.length-1]={type:`heading`,level:2,content:e.content},i=!1,r++;continue}n.push({type:`hr`}),i=!1,r++;continue}if(r+1<t.length){let a=t[r+1];if(/^={1,}\s*$/.test(a)&&e.trim().length>0){n.push({type:`heading`,level:1,content:e.trim()}),i=!1,r+=2;continue}}let s=gt(t,r);if(s){n.push(s.token),r=s.nextLine,i=!1;continue}if(/^\s{0,3}>/.test(e)){let e=[];for(;r<t.length&&/^\s{0,3}>/.test(t[r]);)e.push(t[r].replace(/^\s{0,3}>\s?/,``)),r++;for(;r<t.length;){let n=t[r];if(n.trim()===``||/^\s{0,3}>/.test(n)||/^(#{1,6})\s/.test(n)||/^(`{3,}|~{3,})/.test(n)||/^(\s{0,3})([-*_])\s*(\2\s*){2,}$/.test(n)||/^\s*([-*+]|\d+[.)])\s+/.test(n)||/^\s*\|(.+\|)+\s*$/.test(n))break;e.push(n),r++}n.push({type:`blockquote`,content:e.join(`
`)}),i=!1;continue}let c=e.match(/^(\s*)([-*+]|\d+[.)])(\s+)(\[[ xX]\] )?(.*)$/);if(c){let e=c[1].length,a=c[2],o=c[3],s=c[4],l=c[5],u,d,f;s?(u=`task`,f=s.trim()!==`[ ]`):/^\d+[.)]$/.test(a)?(u=`ordered`,d=parseInt(a,10)):u=`bullet`;let p=e+a.length+o.length+(s?s.length:0),m=e+1,h=e=>{if(e.trim()===``)return!0;let t=e.match(/^\s*/)[0].length;return!!(t>=p||t>=m&&e.match(/^\s*([-*+]|\d+[.)])\s+/))};r++;let g=[];for(;r<t.length;){let e=t[r];if(e.trim()===``){let e=r+1;for(;e<t.length&&t[e].trim()===``;)e++;if(e<t.length&&h(t[e])){g.push(``),r++;continue}break}if(!h(e))break;e.match(/^\s*/)[0].length>=p?g.push(e.substring(p)):g.push(e.substring(m)),r++}let _=g.join(`
`).replace(/^\n+|\n+$/g,``);n.push({type:`listItem`,listType:u,indent:e,content:l.trim(),start:d,checked:f,childContent:_||void 0}),i=!1;continue}if(ht(e)){let e=[];for(;r<t.length&&t[r].trim()!==``;)e.push(t[r]),r++;n.push({type:`rawHtml`,content:e.join(`
`)}),i=!1;continue}let l=[e];for(r++;r<t.length;){let e=t[r];if(e.trim()===``||/^(#{1,6})\s/.test(e)||/^(`{3,}|~{3,})/.test(e)||/^\s{0,3}>/.test(e)||/^(\s{0,3})([-*_])\s*(\2\s*){2,}$/.test(e)||/^\s*([-*+]|\d+[.)])\s+/.test(e)||/^\s*\|(.+\|)+\s*$/.test(e)||ht(e)||r+1<t.length&&/^[=-]+\s*$/.test(t[r+1])&&e.trim().length>0)break;l.push(e),r++}n.push({type:`paragraph`,content:l.map(e=>e.replace(/^ {1,3}/,``)).join(`
`).replace(/[ \t]+$/,``)}),i=!1}return n}function gt(e,t){if(t+1>=e.length)return null;let n=e[t],r=e[t+1];if(!r.includes(`|`)||!/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/.test(r)||!n.includes(`|`))return null;let i=R(n),a=_t(r),o=[],s=t+2;for(;s<e.length;){let t=e[s];if(!t.includes(`|`))break;o.push(R(t)),s++}return{token:{type:`table`,headers:i,rows:o,alignments:a},nextLine:s}}function R(e){let t=e.trim(),n=t.startsWith(`|`)?t.substring(1):t,r=n.endsWith(`|`)?n.substring(0,n.length-1):n,i=[],a=``;for(let e=0;e<r.length;e++)r[e]===`\\`&&e+1<r.length&&r[e+1]===`|`?(a+=`|`,e++):r[e]===`|`?(i.push(a.trim()),a=``):a+=r[e];return i.push(a.trim()),i}function _t(e){return R(e).map(e=>{let t=e.trim(),n=t.startsWith(`:`),r=t.endsWith(`:`);return n&&r?`center`:r?`right`:n?`left`:null})}function z(e){let t=``,n=0;for(;n<e.length;){let r=e[n];switch(r.type){case`heading`:{let e=r;t+=`<h${e.level}>${F(e.content)}</h${e.level}>`,n++;break}case`paragraph`:t+=`<p>${F(r.content)}</p>`,n++;break;case`codeBlock`:{let e=r,i=e.language?` data-language="${N(e.language)}"`:``;t+=`<pre><code${i}>${N(e.code)}</code></pre>`,n++;break}case`blockquote`:{let e=z(L(r.content));t+=`<blockquote>${e}</blockquote>`,n++;break}case`hr`:t+=`<hr>`,n++;break;case`listItem`:{let r=vt(e,n);t+=r.html,n=r.nextIndex;break}case`table`:t+=bt(r),n++;break;case`rawHtml`:t+=r.content,n++;break;default:n++}}return t}function vt(e,t){let n=``,r=t,i=null;for(;r<e.length&&e[r].type===`listItem`;){let t=e[r],a=yt(t.listType);if(i!==null&&i!==a&&(n+=`</${i===`ordered`?`ol`:`ul`}>`,i=null),i===null){if(a===`ordered`){let e=t.start!==void 0&&t.start!==1?` start="${t.start}"`:``;n+=`<ol${e}>`}else n+=`<ul>`;i=a}if(t.listType===`task`){let e=t.checked?` checked`:``;n+=`<li><input type="checkbox" disabled${e}><p>${F(t.content)}</p>`}else n+=`<li><p>${F(t.content)}</p>`;if(t.childContent){let e=L(t.childContent);n+=z(e)}n+=`</li>`,r++}return i!==null&&(n+=`</${i===`ordered`?`ol`:`ul`}>`),{html:n,nextIndex:r}}function yt(e){return e===`ordered`?`ordered`:`bullet`}function bt(e){let t=`<table>`,n=e.headers.every(e=>e.trim()===``),r=e.headers.length;if(!n){t+=`<thead><tr>`;for(let n=0;n<r;n++){let r=e.alignments[n],i=r?` align="${r}"`:``;t+=`<th${i}>${F(e.headers[n])}</th>`}t+=`</tr></thead>`}if(e.rows.length>0){t+=`<tbody>`;for(let n of e.rows){t+=`<tr>`;for(let i=0;i<r;i++){let r=i<n.length?n[i]:``,a=e.alignments[i],o=a?` align="${a}"`:``;t+=`<td${o}>${F(r)}</td>`}t+=`</tr>`}t+=`</tbody>`}return t+=`</table>`,t}function xt(e){return z(L(e))}function B(e){return xt(e)}function St(e,t){return M(B(e),t)}var Ct=class{editor;constructor(e){this.editor=e}blocksToHTMLLossy(e=this.editor.document){return n.A(this.editor.pmSchema,this.editor).exportBlocks(e,{})}blocksToFullHTML(e=this.editor.document){return fe(this.editor.pmSchema,this.editor).serializeBlocks(e,{})}tryParseHTMLToBlocks(e){return M(e,this.editor.pmSchema)}blocksToMarkdownLossy(e=this.editor.document){return n.g(e,this.editor.pmSchema,this.editor,{})}tryParseMarkdownToBlocks(e){return St(e,this.editor.pmSchema)}pasteHTML(e,t=!1){let n=e;if(!t){let t=this.tryParseHTMLToBlocks(e);n=this.blocksToFullHTML(t)}n&&this.editor.prosemirrorView?.pasteHTML(n)}pasteText(e){return this.editor.prosemirrorView?.pasteText(e)}pasteMarkdown(e){let t=B(e);return this.pasteHTML(t)}};function wt(t){let{bnBlock:n}=e.Xn(t),r=t.doc.resolve(n.beforePos),i=r.nodeBefore,a=t.doc.resolve(n.afterPos).nodeAfter,o;return r.depth>1&&(o=r.node(),o.type.isInGroup(`bnBlock`)||(o=r.node(r.depth-1))),{block:e.yn(n.node,t.doc),prevBlock:i===null?void 0:e.yn(i,t.doc),nextBlock:a===null?void 0:e.yn(a,t.doc),parentBlock:o===void 0?void 0:e.yn(o,t.doc)}}function V(t,n,r=`start`){let i=typeof n==`string`?n:n.id,a=e.Cn(e.En(t.doc)),o=e.kt(i,t.doc);if(!o)throw Error(`Block with ID ${i} not found`);let s=e.qn(o),l=a.blockSchema[s.blockNoteType].content;if(s.isBlockContainer){let n=s.blockContent;if(l===`none`){t.setSelection(c.NodeSelection.create(t.doc,n.beforePos));return}if(l===`inline`||l===`plain`)r===`start`?t.setSelection(c.TextSelection.create(t.doc,n.beforePos+1)):t.setSelection(c.TextSelection.create(t.doc,n.afterPos-1));else if(l===`table`)r===`start`?t.setSelection(c.TextSelection.create(t.doc,n.beforePos+4)):t.setSelection(c.TextSelection.create(t.doc,n.afterPos-4));else throw new e.In(l)}else V(t,e.$n(r===`start`?s.childContainer.node.firstChild:s.childContainer.node.lastChild,t.doc),r)}var H=[`vscode-editor-data`,`blocknote/html`,`text/markdown`,`text/html`,`text/plain`,`Files`];function Tt(e,t){if(!e.startsWith(`.`)||!t.startsWith(`.`))throw Error(`The strings provided are not valid file extensions.`);return e===t}function Et(e,t){let n=e.split(`/`),r=t.split(`/`);if(n.length!==2)throw Error(`The string ${e} is not a valid MIME type.`);if(r.length!==2)throw Error(`The string ${t} is not a valid MIME type.`);return n[1]===`*`||r[1]===`*`?n[0]===r[0]:(n[0]===`*`||r[0]===`*`||n[0]===r[0])&&n[1]===r[1]}function Dt(e,t,n,r=`after`){let i;return i=Array.isArray(t.content)&&t.content.length===0?e.updateBlock(t,n).id:e.insertBlocks([n],t,r)[0].id,i}async function Ot(t,n){if(!n.uploadFile){console.warn(`Attempted ot insert file, but uploadFile is not set in the BlockNote editor options`);return}let r=`dataTransfer`in t?t.dataTransfer:t.clipboardData;if(r===null)return;let i=null;for(let e of H)if(r.types.includes(e)){i=e;break}if(i!==`Files`)return;let a=r.items;if(a){t.preventDefault();for(let r=0;r<a.length;r++){let i=`file`;for(let e of Object.values(n.schema.blockSpecs))for(let t of e.implementation.meta?.fileBlockAccept||[]){let n=t.startsWith(`.`),o=a[r].getAsFile();if(o&&(!n&&o.type&&Et(a[r].type,t)||n&&Tt(`.`+o.name.split(`.`).pop(),t))){i=e.config.type;break}}let o=a[r].getAsFile();if(o){let r={type:i,props:{name:o.name}},a;if(t.type===`paste`){let e=n.getTextCursorPosition().block;a=Dt(n,e,r)}else if(t.type===`drop`){let i={left:t.clientX,top:t.clientY},o=n.prosemirrorView.posAtCoords(i);if(!o)return;a=n.transact(t=>{let a=e.$n(e.Jn(t,o.pos).bnBlock.node,t.doc),s=(n.domElement?.querySelector(`[data-id="${a}"]`))?.getBoundingClientRect();return Dt(n,n.getBlock(a),r,s&&(s.top+s.bottom)/2>i.top?`before`:`after`)})}else return;let s=await n.uploadFile(o,a),c=typeof s==`string`?{props:{url:s}}:{...s};n.updateBlock(a,c)}}}}var kt=e=>s.Extension.create({name:`dropFile`,addProseMirrorPlugins(){return[new c.Plugin({props:{handleDOMEvents:{drop(t,n){if(!e.isEditable)return;let r=null;for(let e of H)if(n.dataTransfer.types.includes(e)){r=e;break}return r===null?!0:r===`Files`?(Ot(n,e),!0):!1}}}})]}}),At=/(^|\n) {0,3}#{1,6} {1,8}[^\n]{1,64}\r?\n\r?\n\s{0,32}\S/,jt=/(_|__|\*|\*\*|~~|==|\+\+)(?!\s)(?:[^\s](?:.{0,62}[^\s])?|\S)(?=\1)/,Mt=/\[[^\]]{1,128}\]\(https?:\/\/\S{1,999}\)/,Nt=/(?:\s|^)`(?!\s)(?:[^\s`](?:[^`]{0,46}[^\s`])?|[^\s`])`([^\w]|$)/,Pt=/(?:^|\n)\s{0,5}-\s{1}[^\n]+\n\s{0,15}-\s/,Ft=/(?:^|\n)\s{0,5}\d+\.\s{1}[^\n]+\n\s{0,15}\d+\.\s/,It=/\n{2} {0,3}-{2,48}\n{2}/,Lt=/(?:\n|^)(```|~~~|\$\$)(?!`|~)[^\s]{0,64} {0,64}[^\n]{0,64}\n[\s\S]{0,9999}?\s*\1 {0,64}(?:\n+|$)/,Rt=/(?:\n|^)(?!\s)\w[^\n]{0,64}\r?\n(-|=)\1{0,64}\n\n\s{0,64}(\w|$)/,zt=/(?:^|(\r?\n\r?\n))( {0,3}>[^\n]{1,333}\n){1,999}($|(\r?\n))/,Bt=/^\s*\|(.+\|)+\s*$/m,Vt=/^\s*\|(\s*[-:]+[-:]\s*\|)+\s*$/m,Ht=/^\s*\|(.+\|)+\s*$/m,Ut=e=>At.test(e)||jt.test(e)||Mt.test(e)||Nt.test(e)||Pt.test(e)||Ft.test(e)||It.test(e)||Lt.test(e)||Rt.test(e)||zt.test(e)||Bt.test(e)||Vt.test(e)||Ht.test(e);function Wt(e,t){let{schema:n}=t.state;if(!e.clipboardData)return!1;let r=e.clipboardData.getData(`text/plain`);if(!r||!n.nodes.codeBlock)return!1;let i=e.clipboardData.getData(`vscode-editor-data`),a=(i?JSON.parse(i):void 0)?.mode;return a?(t.pasteHTML(`<pre><code class="language-${a}">${r.replace(/\r\n?/g,`
`)}</code></pre>`),!0):!1}function Gt({event:e,editor:t,prioritizeMarkdownOverHTML:n,plainTextAsMarkdown:r}){if(t.transact(e=>e.selection.$from.parent.type.spec.code&&e.selection.$to.parent.type.spec.code)){let n=e.clipboardData?.getData(`text/plain`);if(n)return t.pasteText(n),!0}let i;for(let t of H)if(e.clipboardData.types.includes(t)){i=t;break}if(!i)return!0;if(i===`vscode-editor-data`){if(Wt(e,t.prosemirrorView))return!0;i=`text/plain`}if(i===`Files`)return Ot(e,t),!0;let a=e.clipboardData.getData(i);if(i===`blocknote/html`)return t.pasteHTML(a,!0),!0;if(i===`text/markdown`)return t.pasteMarkdown(a),!0;if(n){let n=e.clipboardData.getData(`text/plain`);if(Ut(n))return t.pasteMarkdown(n),!0}return i===`text/html`?(t.pasteHTML(a),!0):r?(t.pasteMarkdown(a),!0):(t.pasteText(a),!0)}var Kt=(e,t)=>s.Extension.create({name:`pasteFromClipboard`,addProseMirrorPlugins(){return[new c.Plugin({props:{handleDOMEvents:{paste(n,r){if(r.preventDefault(),e.isEditable)return t({event:r,editor:e,defaultPasteHandler:({prioritizeMarkdownOverHTML:t=!0,plainTextAsMarkdown:n=!0}={})=>Gt({event:r,editor:e,prioritizeMarkdownOverHTML:t,plainTextAsMarkdown:n})})}}}})]}});function qt(t,r,i){let a=!1,o=t.state.selection instanceof u.CellSelection;if(!o){let e=t.state.doc.slice(t.state.selection.from,t.state.selection.to,!1).content,n=[];for(let t=0;t<e.childCount;t++)n.push(e.child(t));a=n.find(e=>e.type.isInGroup(`bnBlock`)||e.type.name===`blockGroup`||e.type.spec.group===`blockContent`)===void 0,a&&(r=e)}let s,c=n.A(t.state.schema,i);if(o){r.firstChild?.type.name===`table`&&(r=r.firstChild.content);let t=e._n(r,i.schema.inlineContentSchema,i.schema.styleSchema);s=`<table>${c.exportInlineContent(t,{})}</table>`}else if(a){let t=e.gn(r,i.schema.inlineContentSchema,i.schema.styleSchema);s=c.exportInlineContent(t,{})}else{let e=n.h(r);s=c.exportBlocks(e,{})}return s}function U(e,t){`node`in e.state.selection&&e.state.selection.node.type.spec.group===`blockContent`&&t.transact(t=>t.setSelection(new c.NodeSelection(t.doc.resolve(e.state.selection.from-1))));let r=e.serializeForClipboard(e.state.selection.content()).dom.innerHTML,i=e.state.selection.content().content,a=qt(e,i,t),{$from:o,$to:s}=e.state.selection,l=o.parent.type.name,u=t.blockImplementations[l];return{clipboardHTML:r,externalHTML:a,markdown:o.sameParent(s)&&u?.implementation.meta?.code===!0?e.state.doc.textBetween(o.pos,s.pos):n._(a)}}var Jt=e=>{if(e.state.selection.empty)return!0;let t=window.getSelection();if(t&&!t.isCollapsed){let e=t.focusNode;for(;e;){if(e instanceof HTMLElement&&e.getAttribute(`contenteditable`)===`false`)return!0;e=e.parentElement}}return!1},Yt=(e,t,n)=>{n.preventDefault(),n.clipboardData.clearData();let{clipboardHTML:r,externalHTML:i,markdown:a}=U(t,e);n.clipboardData.setData(`blocknote/html`,r),n.clipboardData.setData(`text/html`,i),n.clipboardData.setData(`text/plain`,a)},Xt=e=>s.Extension.create({name:`copyToClipboard`,addProseMirrorPlugins(){return[new c.Plugin({props:{handleDOMEvents:{copy(t,n){return Jt(t)||Yt(e,t,n),!0},cut(t,n){return Jt(t)?!0:(Yt(e,t,n),t.editable&&t.dispatch(t.state.tr.deleteSelection()),!0)},dragstart(t,n){if(!(`node`in t.state.selection)||t.state.selection.node.type.spec.group!==`blockContent`)return;e.transact(e=>e.setSelection(new c.NodeSelection(e.doc.resolve(t.state.selection.from-1)))),n.preventDefault(),n.dataTransfer.clearData();let{clipboardHTML:r,externalHTML:i,markdown:a}=U(t,e);return n.dataTransfer.setData(`blocknote/html`,r),n.dataTransfer.setData(`text/html`,i),n.dataTransfer.setData(`text/plain`,a),!0}}}})]}}),Zt=s.Extension.create({name:`blockBackgroundColor`,addGlobalAttributes(){return[{types:[`tableCell`,`tableHeader`],attributes:{backgroundColor:e.yt()}}]}}),Qt=s.Node.create({name:`hardBreak`,inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,priority:10,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,(0,s.mergeAttributes)(this.options.HTMLAttributes,e)]},renderText(){return`
`}}),$t=(t,n)=>{let r=t.resolve(n),i=r.depth-1;if(i<1)return;let a=r.before(i),o=t.resolve(a).nodeAfter;if(o)return o.type.spec.group?.includes(`bnBlock`)?e.Yn(t.resolve(a)):$t(t,a)},W=(t,n)=>{let r=t.resolve(n),i=r.index();if(i===0)return;let a=r.posAtIndex(i-1);return e.Yn(t.resolve(a))},G=(t,n)=>{let r=t.resolve(n),i=r.index();if(i===r.node().childCount-1)return;let a=r.posAtIndex(i+1);return e.Yn(t.resolve(a))},K=(t,n)=>{for(;n.childContainer;){let r=n.childContainer.node,i=t.resolve(n.childContainer.beforePos+1).posAtIndex(r.childCount-1);n=e.Yn(t.resolve(i))}return n},en=(e,t)=>e.isBlockContainer&&e.blockContent.node.type.spec.content===`inline*`&&e.blockContent.node.childCount>0&&t.isBlockContainer&&t.blockContent.node.type.spec.content===`inline*`,tn=(e,t,n,r)=>{if(!r.isBlockContainer)throw Error(`Attempted to merge block at position ${r.bnBlock.beforePos} into previous block at position ${n.bnBlock.beforePos}, but next block is not a block container`);if(r.childContainer){let n=e.doc.resolve(r.childContainer.beforePos+1),i=e.doc.resolve(r.childContainer.afterPos-1),a=n.blockRange(i);if(t){let t=e.doc.resolve(r.bnBlock.beforePos);e.tr.lift(a,t.depth)}}if(t){if(!n.isBlockContainer)throw Error(`Attempted to merge block at position ${r.bnBlock.beforePos} into previous block at position ${n.bnBlock.beforePos}, but previous block is not a block container`);t(e.tr.delete(n.blockContent.afterPos-1,r.blockContent.beforePos+1))}return!0},nn=t=>({state:n,dispatch:r})=>{let i=e.Yn(n.doc.resolve(t)),a=W(n.doc,i.bnBlock.beforePos);if(!a)return!1;let o=K(n.doc,a);return en(o,i)?tn(n,r,o,i):!1},rn=s.Extension.create({priority:50,addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({chain:t,commands:n})=>[()=>n.deleteSelection(),()=>n.undoInputRule(),()=>n.command(({state:t})=>{let r=e.Xn(t);if(!r.isBlockContainer)return!1;let i=t.selection.from===r.blockContent.beforePos+1,a=r.blockContent.node.type.name===`paragraph`;return i&&!a?n.command(e.Dt(r.bnBlock.beforePos,{type:`paragraph`,props:{}})):!1}),()=>n.command(({state:t,tr:n})=>{let r=e.Xn(t);if(!r.isBlockContainer)return!1;let{blockContent:i}=r;return t.selection.from===i.beforePos+1?E(n,n.doc.type.schema.nodes.blockContainer,n.doc.type.schema.nodes.blockGroup):!1}),()=>n.command(({state:n})=>{let r=e.Xn(n);if(!r.isBlockContainer)return!1;let{bnBlock:i,blockContent:a}=r,o=W(n.doc,r.bnBlock.beforePos);if(!o||!o.isBlockContainer||o.blockContent.node.type.spec.content!==`inline*`)return!1;let s=n.selection.from===a.beforePos+1,c=n.selection.empty,l=i.beforePos;return s&&c?t().command(nn(l)).scrollIntoView().run():!1}),()=>n.command(({state:t,tr:n,dispatch:r})=>{let i=e.Xn(t);if(!i.isBlockContainer||t.selection.from!==i.blockContent.beforePos+1)return!1;let a=W(t.doc,i.bnBlock.beforePos);if(!a||a.isBlockContainer)return!1;if(r){let e=a.bnBlock.afterPos-1,t=n.doc.resolve(e-1);return n.delete(i.bnBlock.beforePos,i.bnBlock.afterPos),n.insert(t.pos,i.bnBlock.node),n.setSelection(c.TextSelection.near(n.doc.resolve(t.pos+1))),!0}return!1}),()=>n.command(({state:t,tr:n,dispatch:r})=>{let i=e.Xn(t);if(!i.isBlockContainer||n.selection.from!==i.blockContent.beforePos+1)return!1;let a=n.doc.resolve(i.bnBlock.beforePos);if(a.nodeBefore||a.node().type.name!==`column`)return!1;let o=n.doc.resolve(i.bnBlock.beforePos),s=n.doc.resolve(o.before()),l=s.before();return r&&(n.delete(i.bnBlock.beforePos,i.bnBlock.afterPos),b(n,l),s.pos===l+1?(n.insert(l,i.bnBlock.node),n.setSelection(c.TextSelection.near(n.doc.resolve(l)))):(n.insert(s.pos-1,i.bnBlock.node),n.setSelection(c.TextSelection.near(n.doc.resolve(s.pos))))),!0}),()=>n.command(({state:n})=>{let r=e.Xn(n);if(!r.isBlockContainer)return!1;if(r.blockContent.node.childCount===0&&r.blockContent.node.type.spec.content===`inline*`){let e=W(n.doc,r.bnBlock.beforePos);if(!e)return!1;let i=K(n.doc,e);if(!i.isBlockContainer||!i||!i.isBlockContainer)return!1;let a=t();if(r.childContainer&&a.insertContentAt(r.bnBlock.afterPos,r.childContainer?.node.content),i.blockContent.node.type.spec.content===`tableRow+`){let e=r.bnBlock.beforePos-1-1-1-1-1;a=a.setTextSelection(e)}else if(i.blockContent.node.type.spec.content===``)a=a.setNodeSelection(i.blockContent.beforePos);else{let e=i.blockContent.afterPos-1;a=a.setTextSelection(e)}return a.deleteRange({from:r.bnBlock.beforePos,to:r.bnBlock.afterPos}).scrollIntoView().run()}return!1}),()=>n.command(({state:n})=>{let r=e.Xn(n);if(!r.isBlockContainer)return!1;let i=n.selection.from===r.blockContent.beforePos+1,a=n.selection.empty,o=W(n.doc,r.bnBlock.beforePos);if(o&&i&&a){let e=K(n.doc,o);if(!e.isBlockContainer)return!1;if(e.blockContent.node.type.spec.content===``||e.blockContent.node.type.spec.content===`inline*`&&e.blockContent.node.childCount===0)return t().cut({from:r.bnBlock.beforePos,to:r.bnBlock.afterPos},e.bnBlock.afterPos).deleteRange({from:e.bnBlock.beforePos,to:e.bnBlock.afterPos}).run()}return!1})]),n=()=>this.editor.commands.first(({chain:t,commands:n})=>[()=>n.deleteSelection(),()=>n.command(({state:n})=>{let r=e.Xn(n);if(!r.isBlockContainer||!r.childContainer)return!1;let{blockContent:i,childContainer:o}=r,s=n.selection.from===i.afterPos-1,c=n.selection.empty,l=e.Yn(n.doc.resolve(o.beforePos+1));if(!l.isBlockContainer)return!1;if(s&&c){let e=l.blockContent.node,r=e.type.spec.content===`inline*`,s=i.node.type.spec.content===`inline*`;return t().insertContentAt(l.bnBlock.afterPos,l.childContainer?.node.content||a.Fragment.empty).deleteRange(o.node.childCount===1?{from:o.beforePos,to:o.afterPos}:{from:l.bnBlock.beforePos,to:l.bnBlock.afterPos}).insertContentAt(n.selection.from,r&&s?e.content:null).setTextSelection(n.selection.from).scrollIntoView().run()}return!1}),()=>n.command(({state:n})=>{let r=e.Xn(n);if(!r.isBlockContainer)return!1;let{bnBlock:i,blockContent:a}=r,o=G(n.doc,r.bnBlock.beforePos);if(!o||!o.isBlockContainer)return!1;let s=n.selection.from===a.afterPos-1,c=n.selection.empty,l=i.afterPos;return s&&c?t().command(nn(l)).scrollIntoView().run():!1}),()=>n.command(({state:t,tr:n,dispatch:r})=>{let i=e.Xn(t);if(!i.isBlockContainer||t.selection.from!==i.blockContent.afterPos-1)return!1;let a=G(t.doc,i.bnBlock.beforePos);if(!a||a.isBlockContainer)return!1;if(r){let e=a.bnBlock.beforePos+1,t=n.doc.resolve(e+1);return n.delete(t.pos,t.pos+t.nodeAfter.nodeSize),b(n,a.bnBlock.beforePos),n.insert(i.bnBlock.afterPos,t.nodeAfter),n.setSelection(c.TextSelection.near(n.doc.resolve(t.pos))),!0}return!1}),()=>n.command(({state:t,tr:n,dispatch:r})=>{let i=e.Xn(t);if(!i.isBlockContainer||n.selection.from!==i.blockContent.afterPos-1)return!1;let a=n.doc.resolve(i.bnBlock.afterPos);if(a.nodeAfter||a.node().type.name!==`column`)return!1;let o=n.doc.resolve(i.bnBlock.afterPos),s=n.doc.resolve(o.after()),l=s.after();if(r){let t=s.pos===l-1?l:s.pos+1,r=e.Yn(n.doc.resolve(t));n.delete(r.bnBlock.beforePos,r.bnBlock.afterPos),b(n,l-s.node().nodeSize),n.insert(o.pos,r.bnBlock.node),n.setSelection(c.TextSelection.near(n.doc.resolve(t)))}return!0}),()=>n.command(({state:n})=>{let r=e.Xn(n);if(!r.isBlockContainer)return!1;let{blockContent:i}=r,o=n.selection.from===i.afterPos-1,s=n.selection.empty;if(o&&s){let e=(t,n)=>{let r=G(t,n);if(r)return r;let i=$t(t,n);if(i)return e(t,i.bnBlock.beforePos)},o=e(n.doc,r.bnBlock.beforePos);if(!o||!o.isBlockContainer)return!1;let s=o.blockContent.node,c=s.type.spec.content===`inline*`,l=i.node.type.spec.content===`inline*`;return t().insertContentAt(o.bnBlock.afterPos,o.childContainer?.node.content||a.Fragment.empty).deleteRange({from:o.bnBlock.beforePos,to:o.bnBlock.afterPos}).insertContentAt(n.selection.from,c&&l?s.content:null).setTextSelection(n.selection.from).scrollIntoView().run()}return!1}),()=>n.command(({state:n})=>{let r=e.Xn(n);if(!r.isBlockContainer)return!1;if(r.blockContent.node.childCount===0&&r.blockContent.node.type.spec.content===`inline*`){let e=G(n.doc,r.bnBlock.beforePos);if(!e||!e.isBlockContainer)return!1;let i=t();if(e.blockContent.node.type.spec.content===`tableRow+`){let e=r.bnBlock.afterPos+1+1+1+1+1;i=i.setTextSelection(e)}else i=e.blockContent.node.type.spec.content===``?i.setNodeSelection(e.blockContent.beforePos):i.setTextSelection(e.blockContent.beforePos+1);return i.deleteRange({from:r.bnBlock.beforePos,to:r.bnBlock.afterPos}).scrollIntoView().run()}return!1}),()=>n.command(({state:n})=>{let r=e.Xn(n);if(!r.isBlockContainer)return!1;let i=n.selection.from===r.blockContent.afterPos-1,a=n.selection.empty,o=G(n.doc,r.bnBlock.beforePos);if(!o||!o.isBlockContainer)return!1;if(o&&i&&a&&(o.blockContent.node.type.spec.content===``||o.blockContent.node.type.spec.content===`inline*`&&o.blockContent.node.childCount===0)){let e=o.bnBlock.node.lastChild.content;return t().deleteRange({from:o.bnBlock.beforePos,to:o.bnBlock.afterPos}).insertContentAt(r.bnBlock.afterPos,o.bnBlock.node.childCount===2?e:null).run()}return!1})]),r=(t=!1)=>this.editor.commands.first(({commands:n,tr:r})=>[()=>n.command(({state:t,tr:n})=>{let r=e.Xn(t);if(!r.isBlockContainer)return!1;let{bnBlock:i,blockContent:a}=r,{depth:o}=t.doc.resolve(i.beforePos),s=t.selection.$anchor.parentOffset===0,c=t.selection.anchor===t.selection.head,l=a.node.childCount===0;return s&&c&&l&&o>1?E(n,n.doc.type.schema.nodes.blockContainer,n.doc.type.schema.nodes.blockGroup):!1}),()=>n.command(({state:n})=>{let i=e.Xn(n),a=this.options.editor.schema.blockSpecs[i.blockNoteType]?.implementation?.meta?.hardBreakShortcut??`shift+enter`;if(a===`none`)return!1;if(a===`shift+enter`&&t||a===`enter`){let e=r.storedMarks||r.selection.$head.marks().filter(e=>this.editor.extensionManager.splittableMarks.includes(e.type.name));return r.insert(r.selection.head,r.doc.type.schema.nodes.hardBreak.create()).ensureMarks(e),!0}return!1}),()=>n.command(({state:t,dispatch:n,tr:r})=>{let i=e.Xn(t);if(!i.isBlockContainer)return!1;let{bnBlock:a,blockContent:o}=i,s=t.selection.$anchor.parentOffset===0,l=t.selection.anchor===t.selection.head,u=o.node.childCount===0;if(s&&l&&u){let e=a.afterPos,o=e+2;if(n){let n=t.schema.nodes.blockContainer.createAndFill(void 0,[t.schema.nodes.paragraph.createAndFill()||void 0,i.childContainer?.node].filter(e=>e!==void 0));r.insert(e,n).setSelection(new c.TextSelection(r.doc.resolve(o))).scrollIntoView(),i.childContainer&&r.delete(i.childContainer.beforePos,i.childContainer.afterPos)}return!0}return!1}),()=>n.command(({state:t,chain:n})=>{let r=e.Xn(t);if(!r.isBlockContainer)return!1;let{blockContent:i}=r,a=t.selection.$anchor.parentOffset===0;return i.node.childCount===0?!1:(n().deleteSelection().command(e.W(t.selection.from,a,a)).scrollIntoView().run(),!0)})]);return{Backspace:t,Delete:n,Enter:()=>r(),"Shift-Enter":()=>r(!0),Tab:()=>this.options.tabBehavior!==`prefer-indent`&&(this.options.editor.getExtension(e.m)?.store.state||this.options.editor.getExtension(e.gt)?.store.state!==void 0)?!1:T(this.options.editor),"Shift-Tab":()=>this.options.tabBehavior!==`prefer-indent`&&(this.options.editor.getExtension(e.m)?.store.state||this.options.editor.getExtension(e.gt)?.store.state!==void 0)?!1:D(this.options.editor),"Shift-Mod-ArrowUp":()=>(this.options.editor.moveBlocksUp(),!0),"Shift-Mod-ArrowDown":()=>(this.options.editor.moveBlocksDown(),!0),"Mod-z":()=>this.options.editor.undo(),"Mod-y":()=>this.options.editor.redo(),"Shift-Mod-z":()=>this.options.editor.redo()}}}),an=s.Extension.create({name:`textAlignment`,addGlobalAttributes(){return[{types:[`tableCell`,`tableHeader`],attributes:{textAlignment:{default:`left`,parseHTML:e=>e.getAttribute(`data-text-alignment`),renderHTML:e=>e.textAlignment===`left`?{}:{"data-text-alignment":e.textAlignment}}}}]}}),on=s.Extension.create({name:`blockTextColor`,addGlobalAttributes(){return[{types:[`table`,`tableCell`,`tableHeader`],attributes:{textColor:e.xt()}}]}}),sn=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`;function cn(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;r+i<e.length&&e.charCodeAt(r+i)>=48&&e.charCodeAt(r+i)<=57;)i++;if(i>0){t.push(n.join(``));let a=parseInt(e.substring(r,r+i),10);for(;a-- >0;)n.pop();r+=i}else n.push(e[r]),r++}return t}var ln=new Set(cn(sn)),un=new Set([`localhost`]),dn=/[.,;:!?"']+$/,fn=/(?:https?|ftp|ftps):\/\/[^\s]+/g,pn=/mailto:[^\s]+/g,mn=/[a-zA-Z0-9._%+-]+@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}/g,hn=/(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(?::\d{1,5})?(?:[/?#][^\s]*)?/g;function gn(e){let t=e,n=!0;for(;n;){n=!1;let e=t;t=t.replace(dn,``),t!==e&&(n=!0);for(let[e,r]of[[`(`,`)`],[`[`,`]`]])for(;t.endsWith(r);){let i=_n(t,e);if(_n(t,r)>i)t=t.slice(0,-1),n=!0;else break}}return t}function _n(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function vn(e){let t=e.split(`.`);return t[t.length-1].toLowerCase()}function yn(e){let t=vn(e);return ln.has(t)}function bn(e,t,n){return t===`email`?`mailto:`+e:/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(e)||/^mailto:/i.test(e)?e:n+`://`+e}function xn(e,t){if(!e)return[];let n=t?.defaultProtocol||`http`,r=[];for(let t of e.matchAll(fn))r.push({type:`url`,value:t[0],start:t.index,end:t.index+t[0].length});for(let t of e.matchAll(pn))r.push({type:`url`,value:t[0],start:t.index,end:t.index+t[0].length});for(let t of e.matchAll(mn))r.push({type:`email`,value:t[0],start:t.index,end:t.index+t[0].length});for(let t of e.matchAll(hn))r.push({type:`url`,value:t[0],start:t.index,end:t.index+t[0].length});r.sort((e,t)=>e.start-t.start||t.end-e.end);let i=[],a=-1;for(let e of r)e.start>=a&&(i.push(e),a=e.end);let o=[];for(let e of i){let t=gn(e.value);if(!t)continue;let r=e.start,i=r+t.length;if(e.type===`url`&&!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t)){let e=new URL(`http://`+t).hostname;if(!yn(e))continue}if(e.type===`email`){let e=t.split(`@`)[1];if(!yn(e))continue}let a=bn(t,e.type,n);o.push({type:e.type,value:t,isLink:!0,href:a,start:r,end:i})}return o}function Sn(e,t=`http`){if(!e)return[Y(e,0,0)];for(let[n,r]of[[`(`,`)`],[`[`,`]`],[`{`,`}`]])if(e.startsWith(n)&&e.endsWith(r)&&e.length>2){let i=e.slice(1,-1);if(q(i))return[Y(n,0,1),J(i,1,1+i.length,t),Y(r,1+i.length,e.length)]}if(e.endsWith(`.`)&&e.length>1){let n=e.slice(0,-1);if(q(n))return[J(n,0,n.length,t),Y(`.`,n.length,e.length)]}return q(e)?[J(e,0,e.length,t)]:[Y(e,0,e.length)]}function q(e){if(/^(?:https?|ftp|ftps):\/\/[^\s]+$/.test(e)||/^mailto:[^\s]+$/.test(e)||un.has(e.toLowerCase()))return!0;let t=e.match(/^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+([a-zA-Z]{2,})(?::\d{1,5})?(?:[/?#][^\s]*)?$/);if(t){let e=t[1].toLowerCase();if(ln.has(e))return!0}return!1}function J(e,t,n,r){let i=e.includes(`@`)&&!e.includes(`://`)&&!e.startsWith(`mailto:`)?`email`:`url`;return{type:i,value:e,isLink:!0,href:bn(e,i,r),start:t,end:n}}function Y(e,t,n){return{type:`text`,value:e,isLink:!1,href:e,start:t,end:n}}var X=`[\0- \xA0 -\u2029 ]`,Cn=new RegExp(X),wn=RegExp(`${X}$`),Tn=new RegExp(X,`g`);function En(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function Dn(e){return new d.Plugin({key:new d.PluginKey(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if((0,s.getChangedRanges)((0,s.combineTransactionSteps)(n.doc,[...t])).forEach(({newRange:t})=>{let n=(0,s.findChildrenInRange)(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!wn.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(Cn).filter(Boolean);if(t.length<=0)return;let n=t[t.length-1],c=i.pos+a.lastIndexOf(n);if(!n)return;let l=Sn(n,e.defaultProtocol);if(!En(l))return;l.filter(e=>e.isLink).map(e=>({...e,from:c+e.start+1,to:c+e.end+1})).filter(e=>r.schema.marks.code?!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code):!0).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{(0,s.getMarksBetween)(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function On(e){return new d.Plugin({key:new d.PluginKey(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement&&r.target.getAttribute(`data-inline-content-type`)===`link`)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.tiptapEditor.view.dom;i=t.closest(`a[data-inline-content-type="link"]`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;if(e.onClick){if(!e.editor)throw Error(`BlockNoteEditor not found in Link click handler`);return e.onClick(r,e.editor)??!0}let a=(0,s.getAttributes)(t.state,e.type.name),o=i.href??a.href,c=i.target??a.target;return o?(window.open(o,c),!0):!1}}})}function kn(e){return new d.Plugin({key:new d.PluginKey(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i,isValidLink:a}=e,{state:o}=t,{selection:s}=o,{empty:c}=s;if(c)return!1;let l=``;r.content.forEach(e=>{l+=e.textContent});let u=xn(l,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===l);return!l||!u||!a(u.value)||i!==void 0&&!i(u.value)?!1:e.editor.commands.setMark(e.type,{href:u.href})}}})}var Z=`https`,An=/^(?:(?:http|https|ftp|ftps|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z0-9+.\-]+(?:[^a-z+.\-:]|$))/i;function jn(e){if(!e)return!0;let t=e.replace(Tn,``);return An.test(t)}function Q(e){let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}var Mn=s.Mark.create({name:`link`,keepOnSplit:!1,exitable:!0,inclusive:!1,addOptions(){return{HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,className:`bn-inline-content-section`,"data-inline-content-type":`link`},editor:void 0,onClick:void 0,isValidLink:jn}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}}}},parseHTML(){let e=this.options.isValidLink;return[{tag:`a[href]`,getAttrs:t=>{let n=t.getAttribute(`href`);return!n||!e(n)?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isValidLink(e.href)?[`a`,(0,s.mergeAttributes)(e,this.options.HTMLAttributes),0]:[`a`,(0,s.mergeAttributes)({...e,href:``},this.options.HTMLAttributes),0]},addPasteRules(){let e=this.options.isValidLink;return[(0,s.markPasteRule)({find:t=>{let n=[];if(t){let r=xn(t,{defaultProtocol:Z}).filter(t=>t.isLink&&e(t.value));for(let e of r)Q(e.value)&&n.push({text:e.value,data:{href:e.href},index:e.start})}return n},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[];return e.push(Dn({type:this.type,defaultProtocol:Z,validate:this.options.isValidLink,shouldAutoLink:Q})),e.push(On({type:this.type,tiptapEditor:this.editor,editor:this.options.editor,onClick:this.options.onClick})),e.push(kn({editor:this.editor,defaultProtocol:Z,type:this.type,shouldAutoLink:Q,isValidLink:this.options.isValidLink})),e}}),Nn=t.t(({editor:e,options:t})=>({key:`link`,tiptapExtensions:[Mn.configure({HTMLAttributes:t.HTMLAttributes??{},editor:e,onClick:t.onClick,...t.isValidLink?{isValidLink:t.isValidLink}:{}})]})),Pn={blockColor:`data-block-color`,blockStyle:`data-block-style`,id:`data-id`,depth:`data-depth`,depthChange:`data-depth-change`},Fn=s.Node.create({name:`blockContainer`,group:`blockGroupChild bnBlock`,content:`blockContent blockGroup?`,priority:50,defining:!0,marks(){return e.O(this.editor)},parseHTML(){return[{tag:`div[data-node-type=`+this.name+`]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t={};for(let[n,r]of Object.entries(Pn))e.getAttribute(r)&&(t[n]=e.getAttribute(r));return t}},{tag:`div[data-node-type="blockOuter"]`,skip:!0}]},renderHTML({HTMLAttributes:t}){let n=document.createElement(`div`);n.className=`bn-block-outer`,n.setAttribute(`data-node-type`,`blockOuter`);for(let[e,r]of Object.entries(t))e!==`class`&&n.setAttribute(e,r);let r={...this.options.domAttributes?.block||{},...t},i=document.createElement(`div`);i.className=e.Fn(`bn-block`,r.class),i.setAttribute(`data-node-type`,this.name);for(let[e,t]of Object.entries(r))e!==`class`&&i.setAttribute(e,t);return n.appendChild(i),{dom:n,contentDOM:i}}}),In=s.Node.create({name:`blockGroup`,group:`childContainer`,content:`blockGroupChild+`,marks(){return e.O(this.editor)},parseHTML(){return[{tag:`div`,getAttrs:e=>typeof e==`string`?!1:e.getAttribute(`data-node-type`)===`blockGroup`?null:!1}]},renderHTML({HTMLAttributes:t}){let n={...this.options.domAttributes?.blockGroup||{},...t},r=document.createElement(`div`);r.className=e.Fn(`bn-block-group`,n.class),r.setAttribute(`data-node-type`,`blockGroup`);for(let[e,t]of Object.entries(n))e!==`class`&&r.setAttribute(e,t);return{dom:r,contentDOM:r}}}),Ln=s.Node.create({name:`doc`,topNode:!0,content:`blockGroup`,marks(){return e.O(this.editor)}});function Rn(t,n){return[s.extensions.ClipboardTextSerializer,s.extensions.Commands,s.extensions.Editable,s.extensions.FocusEvents,s.extensions.Tabindex,g.Gapcursor,e.Kn.configure({types:[`blockContainer`,`columnList`,`column`],setIdAttribute:n.setIdAttribute,isWithinEditor:t.isWithinEditor}),Qt,h.Text,...Object.values(t.schema.styleSpecs).map(e=>e.implementation.mark.configure({editor:t})),on,Zt,an,s.Extension.create({name:`OverrideEscape`,addKeyboardShortcuts:()=>({Escape:()=>t.getExtension(e.f)?.shown()?!1:(t.blur(),!0)})}),Ln,Fn.configure({editor:t,domAttributes:n.domAttributes}),rn.configure({editor:t,tabBehavior:n.tabBehavior}),In.configure({domAttributes:n.domAttributes}),...Object.values(t.schema.inlineContentSpecs).filter(e=>e.config!==`link`&&e.config!==`text`).map(e=>e.implementation.node.configure({editor:t})),...Object.values(t.schema.blockSpecs).flatMap(e=>[...`node`in e.implementation?[e.implementation.node.configure({editor:t,domAttributes:n.domAttributes})]:[]]),Xt(t),Kt(t,n.pasteHandler||(e=>e.defaultPasteHandler())),kt(t)]}function zn(t,i){let a=[n.O(),n.D(i),e.gt(i),e.m(i),Nn({HTMLAttributes:i.links?.HTMLAttributes??{},onClick:i.links?.onClick,...i.links?.isValidLink?{isValidLink:i.links.isValidLink}:{}}),n.w(i),n.x(),n.b(i),r.r(i),n.f(i),e.f(i),n.T(),n.y(),...i.trailingBlock===!1?[]:[n.s()]];return`table`in t.schema.blockSpecs&&a.push(n.c(i)),i.animations!==!1&&a.push(n.v()),a}var Bn=class{editor;options;disabledExtensions=new Set;extensions=[];abortMap=new Map;extensionFactories=new Map;extensionPlugins=new Map;blockNoteExtensionDependents=new Map;constructor(e,t){this.editor=e,this.options=t,e.onMount(()=>{for(let t of this.extensions)if(t.mount){let n=new window.AbortController,r=t.mount({dom:e.prosemirrorView.dom,root:e.prosemirrorView.root,signal:n.signal});r&&n.signal.addEventListener(`abort`,()=>{r()}),this.abortMap.set(t,n)}}),e.onUnmount(()=>{for(let[e,t]of this.abortMap.entries())this.abortMap.delete(e),t.abort()}),this.disabledExtensions=new Set(t.disableExtensions||[]);for(let e of zn(this.editor,this.options))this.addExtension(e);for(let e of this.options.extensions??[])this.addExtension(e);for(let e of Object.values(this.editor.schema.blockSpecs))for(let t of e.extensions??[])this.addExtension(t)}registerExtension(e){this.replaceExtension(void 0,e)}addExtension(e,n){let r;if(r=typeof e==`function`?e({editor:this.editor}):e,!(!r||this.disabledExtensions.has(r.key))){if(n){let e=this.blockNoteExtensionDependents.get(r.key);e||(e=new Set,this.blockNoteExtensionDependents.set(r.key,e)),e.add(n)}if(!this.extensions.some(e=>e.key===r.key)){if(typeof e==`function`){let e=r[t.r];typeof e==`function`&&this.extensionFactories.set(e,r)}if(this.extensions.push(r),r.blockNoteExtensions)for(let e of r.blockNoteExtensions)this.addExtension(e,r.key);return r}}}resolveExtensions(e){let t=[];if(typeof e==`function`){let n=this.extensionFactories.get(e);n&&t.push(n)}else if(Array.isArray(e))for(let n of e)t.push(...this.resolveExtensions(n));else if(typeof e==`object`&&`key`in e)t.push(e);else if(typeof e==`string`){let n=this.extensions.find(t=>t.key===e);n&&t.push(n)}return t}unregisterExtension(e){this.replaceExtension(e,[])}replaceExtension(e,t){let n=this.resolveExtensions(e);e&&!n.length&&console.warn(`No extensions found to unregister`,e);let r=!1,i=new Set,a=new Set;for(let t of n)this.extensions=this.extensions.filter(e=>e!==t),this.extensionFactories.forEach((e,n)=>{e===t&&this.extensionFactories.delete(n)}),this.abortMap.get(t)?.abort(),this.abortMap.delete(t),this.extensionPlugins.get(t)?.forEach(e=>{i.add(e);let t=e.spec?.key,n=typeof t==`object`&&t?t.key:t;typeof n==`string`&&a.add(n)}),this.extensionPlugins.delete(t),t.tiptapExtensions&&!r&&(r=!0,console.warn(`Extension ${t.key} has tiptap extensions, but they will not be removed. Please separate the extension into multiple extensions if you want to remove them, or re-initialize the editor.`,e));let o=[].concat(t).filter(Boolean).map(e=>this.addExtension(e)).filter(Boolean),s=[];for(let e of o)e?.tiptapExtensions&&console.warn(`Extension ${e.key} has tiptap extensions, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`,e),e?.inputRules?.length&&console.warn(`Extension ${e.key} has input rules, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`,e),this.getProsemirrorPluginsFromExtension(e).plugins.forEach(e=>{s.push(e)});!i.size&&!a.size&&!s.length||this.updatePlugins(e=>[...e.filter(e=>{if(i.has(e))return!1;if(a.size){let t=e.spec?.key,n=typeof t==`object`&&t?t.key:t;if(typeof n==`string`&&a.has(n))return!1}return!0}),...s])}updatePlugins(e){let t=this.editor.prosemirrorState,n=t.reconfigure({plugins:e(t.plugins.slice())});this.editor.prosemirrorView.updateState(n)}getTiptapExtensions(){let t=Rn(this.editor,this.options).filter(e=>!this.disabledExtensions.has(e.name)),n=e.Gt(this.extensions.map(e=>{let t=this.blockNoteExtensionDependents.get(e.key);return t?.size?{key:e.key,runsBefore:[...e.runsBefore??[],...t]}:e})),r=new Map;for(let e of this.extensions){e.tiptapExtensions&&t.push(...e.tiptapExtensions);let i=n(e.key),{plugins:a,inputRules:o}=this.getProsemirrorPluginsFromExtension(e);a.length&&t.push(s.Extension.create({name:e.key,priority:i,addProseMirrorPlugins:()=>a})),o.length&&(r.has(i)||r.set(i,[]),r.get(i).push(...o))}t.push(s.Extension.create({name:`blocknote-input-rules`,addProseMirrorPlugins(){let e=[];Array.from(r.keys()).sort((e,t)=>e-t).reverse().forEach(t=>{e.push(...r.get(t))});let t=(0,p.inputRules)({rules:e});return[t,new c.Plugin({props:{handleKeyDown(e,n){if(n.key!==`Enter`||n.shiftKey||n.ctrlKey||n.metaKey||n.altKey)return!1;let{$cursor:r}=e.state.selection;return r?!!t.props.handleTextInput?.call(t,e,r.pos,r.pos,`
`,()=>e.state.tr.insertText(`
`,r.pos,r.pos)):!1}}})]}}));for(let e of this.options._tiptapOptions?.extensions??[])t.push(e);return t}getProsemirrorPluginsFromExtension(t){let n=[...t.prosemirrorPlugins??[]],r=[];return!t.prosemirrorPlugins?.length&&!Object.keys(t.keyboardShortcuts||{}).length&&!t.inputRules?.length?{plugins:n,inputRules:r}:(this.extensionPlugins.set(t,n),t.inputRules?.length&&r.push(...t.inputRules.map(t=>new p.InputRule(t.find,(n,r,i,a)=>{let o=t.replace({match:r,range:{from:i,to:a},editor:this.editor});if(o){let t=n.tr,r=e.Xn(t);return!r.isBlockContainer||this.editor.schema.blockSchema[r.blockNoteType]?.content!==`inline`?null:(t.deleteRange(i,a),e.Ot(t,r.bnBlock.beforePos,o),V(t,e.$n(r.bnBlock.node,t.doc),`start`),t)}return null},{undoable:!0}))),Object.keys(t.keyboardShortcuts||{}).length&&n.push((0,m.keymap)(Object.fromEntries(Object.entries(t.keyboardShortcuts).map(([e,t])=>[e,()=>t({editor:this.editor})])))),{plugins:n,inputRules:r})}getExtensions(){return new Map(this.extensions.map(e=>[e.key,e]))}getExtension(e){if(typeof e==`string`)return this.extensions.find(t=>t.key===e)||void 0;if(typeof e==`function`)return this.extensionFactories.get(e)||void 0;throw Error(`Invalid extension type: ${typeof e}`)}hasExtension(e){return typeof e==`string`?this.extensions.some(t=>t.key===e):typeof e==`object`&&`key`in e?this.extensions.some(t=>t.key===e.key):typeof e==`function`?this.extensionFactories.has(e):!1}};function $(e,t){let{$from:n,$to:r}=t;if(n.pos>n.start()&&n.pos<e.content.size){let t=e.textBetween(n.pos,n.pos+1);if(/^[\w\p{P}]$/u.test(t)){let t=e.textBetween(n.start(),n.pos).match(/[\w\p{P}]+$/u);t&&(n=e.resolve(n.pos-t[0].length))}}if(r.pos<r.end()&&r.pos>0){let t=e.textBetween(r.pos-1,r.pos);if(/^[\w\p{P}]$/u.test(t)){let t=e.textBetween(r.pos,r.end()).match(/^[\w\p{P}]+/u);t&&(r=e.resolve(r.pos+t[0].length))}}return{$from:n,$to:r,from:n.pos,to:r.pos}}function Vn(t){if(t.selection.empty||`node`in t.selection)return;let n=t.doc.resolve(e.Qn(t.doc,t.selection.from).posBeforeNode),r=t.doc.resolve(e.Qn(t.doc,t.selection.to).posBeforeNode),i=(r,i)=>{let a=n.posAtIndex(r,i),o=t.doc.resolve(a).nodeAfter;if(!o)throw Error(`Error getting selection - node not found at position ${a}`);return e.yn(o,t.doc)},a=[],o=n.sharedDepth(r.pos),s=n.index(o),c=r.index(o);if(n.depth>o){a.push(e.yn(n.nodeAfter,t.doc));for(let e=n.depth;e>o;e--)if(n.node(e).type.isInGroup(`childContainer`)){let t=n.index(e)+1,r=n.node(e).childCount;for(let n=t;n<r;n++)a.push(i(n,e))}}else a.push(i(s,o));for(let e=s+1;e<=c;e++)a.push(i(e,o));if(a.length===0)throw Error(`Error getting selection - selection doesn't span any blocks (${t.selection})`);return{blocks:a}}function Hn(t,n,r){let i=typeof n==`string`?n:n.id,a=typeof r==`string`?r:r.id,o=e.Cn(e.En(t));if(i===a)throw Error(`Attempting to set selection with the same anchor and head blocks (id ${i})`);let s=e.kt(i,t.doc);if(!s)throw Error(`Block with ID ${i} not found`);let l=e.kt(a,t.doc);if(!l)throw Error(`Block with ID ${a} not found`);let d=e.qn(s),f=e.qn(l),p=o.blockSchema[d.blockNoteType],m=o.blockSchema[f.blockNoteType];if(!d.isBlockContainer||p.content===`none`)throw Error(`Attempting to set selection anchor in block without content (id ${i})`);if(!f.isBlockContainer||m.content===`none`)throw Error(`Attempting to set selection anchor in block without content (id ${a})`);let h,g;if(p.content===`table`){let e=u.TableMap.get(d.blockContent.node);h=d.blockContent.beforePos+e.positionAt(0,0,d.blockContent.node)+1+2}else h=d.blockContent.beforePos+1;if(m.content===`table`){let e=u.TableMap.get(f.blockContent.node),n=f.blockContent.beforePos+e.positionAt(e.height-1,e.width-1,f.blockContent.node)+1;g=n+t.doc.resolve(n).nodeAfter.nodeSize-2}else g=f.blockContent.afterPos-1;t.setSelection(c.TextSelection.create(t.doc,h,g))}function Un(t,n=!1){let r=n?$(t.doc,t.selection):t.selection,i=r.$from,a=r.$to;for(;a.parentOffset>=a.parent.nodeSize-2&&a.depth>0;)a=t.doc.resolve(a.pos+1);for(;a.parentOffset===0&&a.depth>0;)a=t.doc.resolve(a.pos-1);for(;i.parentOffset===0&&i.depth>0;)i=t.doc.resolve(i.pos-1);for(;i.parentOffset>=i.parent.nodeSize-2&&i.depth>0;)i=t.doc.resolve(i.pos+1);let o=e.xn(t.doc.slice(i.pos,a.pos,!0));return{_meta:{startPos:i.pos,endPos:a.pos},...o}}var Wn=class{editor;constructor(e){this.editor=e}getSelection(){return this.editor.transact(e=>Vn(e))}getSelectionCutBlocks(e=!1){return this.editor.transact(t=>Un(t,e))}setSelection(e,t){return this.editor.transact(n=>Hn(n,e,t))}getTextCursorPosition(){return this.editor.transact(e=>wt(e))}setTextCursorPosition(e,t=`start`){return this.editor.transact(n=>V(n,e,t))}getSelectionBoundingBox(){if(!this.editor.prosemirrorView)return;let{selection:e}=this.editor.prosemirrorState,{ranges:t}=e,n=Math.min(...t.map(e=>e.$from.pos)),r=Math.max(...t.map(e=>e.$to.pos));if((0,s.isNodeSelection)(e)){let e=this.editor.prosemirrorView.nodeDOM(n);if(e)return e.getBoundingClientRect()}return(0,s.posToDOMRect)(this.editor.prosemirrorView,n,r).toJSON()}},Gn=class{editor;constructor(e){this.editor=e}activeTransaction=null;can(e){try{return this.isInCan=!0,e()}finally{this.isInCan=!1}}isInCan=!1;exec(e){if(this.activeTransaction)throw Error("`exec` should not be called within a `transact` call, move the `exec` call outside of the `transact` call");if(this.isInCan)return this.canExec(e);let t=this.prosemirrorState,n=this.prosemirrorView;return e(t,e=>this.prosemirrorView.dispatch(e),n)}canExec(e){if(this.activeTransaction)throw Error("`canExec` should not be called within a `transact` call, move the `canExec` call outside of the `transact` call");let t=this.prosemirrorState,n=this.prosemirrorView;return e(t,void 0,n)}transact(e){if(this.activeTransaction)return e(this.activeTransaction);try{this.activeTransaction=this.editor._tiptapEditor.state.tr;let t=e(this.activeTransaction),n=this.activeTransaction;return this.activeTransaction=null,n&&(n.docChanged||n.selectionSet||n.scrolledIntoView||n.storedMarksSet||!n.isGeneric)&&this.prosemirrorView.dispatch(n),t}finally{this.activeTransaction=null}}get prosemirrorState(){if(this.activeTransaction)throw Error("`prosemirrorState` should not be called within a `transact` call, move the `prosemirrorState` call outside of the `transact` call or use `editor.transact` to read the current editor state");return this.editor._tiptapEditor.state}get prosemirrorView(){return this.editor._tiptapEditor.view}isFocused(){return this.prosemirrorView?.hasFocus()||!1}focus(){this.prosemirrorView?.focus()}get isEditable(){if(!this.editor._tiptapEditor){if(!this.editor.headless)throw Error(`no editor, but also not headless?`);return!1}return this.editor._tiptapEditor.isEditable===void 0?!0:this.editor._tiptapEditor.isEditable}set isEditable(e){if(!this.editor._tiptapEditor){if(!this.editor.headless)throw Error(`no editor, but also not headless?`);return}this.editor._tiptapEditor.options.editable!==e&&this.editor._tiptapEditor.setEditable(e)}undo(){let e=this.editor.getExtension(`yUndo`);if(e)return this.exec(e.undoCommand);let t=this.editor.getExtension(`history`);if(t)return this.exec(t.undoCommand);throw Error(`No undo plugin found`)}redo(){let e=this.editor.getExtension(`yUndo`);if(e)return this.exec(e.redoCommand);let t=this.editor.getExtension(`history`);if(t)return this.exec(t.redoCommand);throw Error(`No redo plugin found`)}};function Kn(e,t,n,r={updateSelection:!0}){let{from:i,to:a}=typeof t==`number`?{from:t,to:t}:{from:t.from,to:t.to},o=!0,c=!0,l=``;if(n.forEach(e=>{e.check(),o&&e.isText&&e.marks.length===0?l+=e.text:o=!1,c=c?e.isBlock:!1}),i===a&&c){let{parent:t}=e.doc.resolve(i);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(--i,a+=1)}return o?e.insertText(l,i,a):e.replaceWith(i,a,n),r.updateSelection&&(0,s.selectionToInsertionEnd)(e,e.steps.length-1,-1),!0}var qn=class{editor;constructor(e){this.editor=e}insertInlineContent(t,{updateSelection:n=!1}={}){let r=e.Mt(t,this.editor.pmSchema);this.editor.transact(e=>{Kn(e,{from:e.selection.from,to:e.selection.to},r,{updateSelection:n})})}getActiveStyles(){return this.editor.transact(e=>{let t={},n=e.selection.$to.marks();for(let e of n){let n=this.editor.schema.styleSchema[e.type.name];if(!n){e.type.name!==`link`&&!e.type.spec.blocknoteIgnore&&console.warn(`mark not found in styleschema`,e.type.name);continue}n.propSchema===`boolean`?t[n.type]=!0:t[n.type]=e.attrs.stringValue}return t})}addStyles(t){for(let[n,r]of Object.entries(t)){let t=this.editor.schema.styleSchema[n];if(!t)throw Error(`style ${n} not found in styleSchema`);if(t.propSchema===`boolean`)this.editor._tiptapEditor.commands.setMark(n);else if(t.propSchema===`string`)this.editor._tiptapEditor.commands.setMark(n,{stringValue:r});else throw new e.In(t.propSchema)}}removeStyles(e){for(let t of Object.keys(e))this.editor._tiptapEditor.commands.unsetMark(t)}toggleStyles(t){for(let[n,r]of Object.entries(t)){let t=this.editor.schema.styleSchema[n];if(!t)throw Error(`style ${n} not found in styleSchema`);if(t.propSchema===`boolean`)this.editor._tiptapEditor.commands.toggleMark(n);else if(t.propSchema===`string`)this.editor._tiptapEditor.commands.toggleMark(n,{stringValue:r});else throw new e.In(t.propSchema)}}getSelectedText(){return this.editor.transact(e=>e.doc.textBetween(e.selection.from,e.selection.to))}getLinkMarkAtPos(e){return this.editor.transact(t=>{let n=t.doc.resolve(e),r=n.marks().find(e=>e.type.name===`link`);if(!r)return;let i=(0,s.getMarkRange)(n,r.type);if(i)return{href:r.attrs.href,from:i.from,to:i.to,text:t.doc.textBetween(i.from,i.to)}})}getSelectedLinkUrl(){return this.editor.transact(e=>this.getLinkMarkAtPos(e.selection.from)?.href)}createLink(e,t){e!==``&&this.editor.transact(n=>{let{from:r,to:i}=n.selection,a=this.editor.pmSchema.mark(`link`,{href:e});t?n.insertText(t,r,i).addMark(r,r+t.length,a):n.addMark(r,i,a)})}editLink(e,t,n=this.editor.transact(e=>e.selection.anchor)){this.editor.transact(r=>{let{from:i,to:a}=this.getLinkMarkAtPos(n+1)||{from:r.selection.from,to:r.selection.to},o=this.editor.pmSchema.mark(`link`,{href:e});t!==r.doc.textBetween(i,a)&&r.insertText(t,i,a),r.addMark(i,i+t.length,o)}),this.editor.prosemirrorView.focus()}deleteLink(e=this.editor.transact(e=>e.selection.anchor)){this.editor.transact(t=>{let{from:n,to:r}=this.getLinkMarkAtPos(e+1)||{from:t.selection.from,to:t.selection.to};t.removeMark(n,r,this.editor.pmSchema.marks.link).setMeta(`preventAutolink`,!0)}),this.editor.prosemirrorView.focus()}};function Jn(e){return(0,s.findParentNodeClosestToPos)(e.state.selection.$from,e=>e.type.name===`tableCell`||e.type.name===`tableHeader`)!==void 0}function Yn(e,t){let n=t.nodes.hardBreak,r=l.Fragment.empty;return e.forEach(e=>{e.isTextblock&&e.childCount>0?(r=r.append(e.content),r=r.addToEnd(n.create())):e.isText?r=r.addToEnd(e):e.isBlock&&e.childCount>0&&(r=r.append(Yn(e.content,t)),r=r.addToEnd(n.create()))}),r.lastChild?.type===n&&(r=r.cut(0,r.size-1)),r}function Xn(e,t){let n=[];return e.forEach((e,r,i)=>{i!==t&&n.push(e)}),l.Fragment.from(n)}function Zn(e,t){let n=[];for(let r=0;r<e.childCount;r++)if(e.child(r).type.name===`tableRow`)if(n.length>0&&n[n.length-1].type.name===`table`){let t=n[n.length-1],i=t.copy(t.content.addToEnd(e.child(r)));n[n.length-1]=i}else{let i=t.nodes.table.createChecked(void 0,e.child(r));n.push(i)}else n.push(e.child(r));return e=l.Fragment.from(n),e}function Qn(e,t){let n=l.Fragment.from(e.content);n=Zn(n,t.state.schema);let r=$n(n,t,e);if(r)return r;if(Jn(t)){let e=!1;if(n.descendants(t=>{t.type.isInGroup(`tableContent`)&&(e=!0)}),!e&&!t.state.schema.nodes.tableParagraph.validContent(n))return new l.Slice(Yn(n,t.state.schema),0,0)}if(!er(n,t))return new l.Slice(n,e.openStart,e.openEnd);for(let e=0;e<n.childCount;e++)if(n.child(e).type.spec.group===`blockContent`){let r=[n.child(e)];if(e+1<n.childCount&&n.child(e+1).type.name===`blockGroup`){let t=n.child(e+1).child(0).child(0);(t.type.name===`bulletListItem`||t.type.name===`numberedListItem`||t.type.name===`checkListItem`)&&(r.push(n.child(e+1)),n=Xn(n,e+1))}let i=t.state.schema.nodes.blockContainer.createChecked(void 0,r);n=n.replaceChild(e,i)}return new l.Slice(n,e.openStart,e.openEnd)}function $n(t,n,r){if(Jn(n)||n.dragging)return null;let i=e.Xn(n.state),a=i.isBlockContainer?i.blockContent.node:null;if(!a||a.type.name===`paragraph`||a.type.spec.content!==`inline*`||a.childCount>0)return null;let o=t.firstChild,s=o?.firstChild,c=s?.firstChild;if(o?.type.name!==`blockGroup`||s?.type.name!==`blockContainer`||c?.type.name!==`paragraph`)return null;let u=a.type.create(a.attrs,c.content),d=s.copy(s.content.replaceChild(0,u)),f=o.copy(o.content.replaceChild(0,d));return new l.Slice(t.replaceChild(0,f),r.openStart,r.openEnd)}function er(t,n){let r=t.childCount===1,i=t.firstChild?.type.spec.content===`inline*`,a=t.firstChild?.type.spec.content===`tableRow+`;if(r){if(i)return!1;if(a){let t=e.Xn(n.state);if(t.isBlockContainer)return t.blockContent.node.type.spec.content!==`tableRow+`}}return!0}var tr={enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!1},nr=class t extends C{options;pmSchema;_tiptapEditor;elementRenderer=null;blockCache=new WeakMap;dictionary;schema;blockImplementations;inlineContentImplementations;styleImplementations;uploadFile;onUploadStartCallbacks=[];onUploadEndCallbacks=[];resolveFileUrl;settings;static create(e){return new t(e??{})}constructor(t){super(),this.options=t,this.dictionary=t.dictionary||i.t,this.settings={tables:{splitCells:t?.tables?.splitCells??!1,cellBackgroundColor:t?.tables?.cellBackgroundColor??!1,cellTextColor:t?.tables?.cellTextColor??!1,headers:t?.tables?.headers??!1}};let n={defaultStyles:!0,schema:t.schema||e.t.create(),...t,placeholders:{...this.dictionary.placeholders,...t.placeholders}};if(this.schema=n.schema,this.blockImplementations=n.schema.blockSpecs,this.inlineContentImplementations=n.schema.inlineContentSpecs,this.styleImplementations=n.schema.styleSpecs,n.uploadFile){let e=n.uploadFile;this.uploadFile=async(t,n)=>{this.onUploadStartCallbacks.forEach(e=>e.apply(this,[n]));try{return await e(t,n)}finally{this.onUploadEndCallbacks.forEach(e=>e.apply(this,[n]))}}}this.resolveFileUrl=n.resolveFileUrl,this._eventManager=new Me(this),this._extensionManager=new Bn(this,n);let r=this._extensionManager.getTiptapExtensions(),a={...tr,...n._tiptapOptions,element:null,autofocus:n.autofocus??!1,extensions:r,editorProps:{scrollMargin:{top:72,bottom:72,left:0,right:0},...n._tiptapOptions?.editorProps,attributes:{tabIndex:`0`,...n._tiptapOptions?.editorProps?.attributes,...n.domAttributes?.editor,class:e.Fn(`bn-editor`,n.defaultStyles?`bn-default-styles`:``,n.domAttributes?.editor?.class||``)},transformPasted:Qn}};try{let t=n.initialContent||[{type:`paragraph`,id:e.Kn.options.generateID()}];if(!Array.isArray(t)||t.length===0)throw Error(`initialContent must be a non-empty array of blocks, received: `+JSON.stringify(t));let r=(0,s.getSchema)(a.extensions);r.cached.blockNoteEditor=this;let i=(0,s.createDocument)({type:`doc`,content:[{type:`blockGroup`,content:t.map(t=>e.jt(t,r,this.schema.styleSchema).toJSON())}]},r,a.parseOptions);this._tiptapEditor=new s.Editor({...a,content:i.toJSON()}),this.pmSchema=this._tiptapEditor.schema}catch(e){throw Error("Error creating document from blocks passed as `initialContent`",{cause:e})}this.pmSchema.cached.blockNoteEditor=this,this._tiptapEditor.on(`mount`,()=>{this.headless=!1}),this._tiptapEditor.on(`unmount`,()=>{this.headless=!0}),this._blockManager=new je(this),this._exportManager=new Ct(this),this._selectionManager=new Wn(this),this._stateManager=new Gn(this),this._styleManager=new qn(this),this.emit(`create`)}_blockManager;_eventManager;_exportManager;_extensionManager;_selectionManager;_stateManager;_styleManager;get extensions(){return this._extensionManager.getExtensions()}exec(e){return this._stateManager.exec(e)}canExec(e){return this._stateManager.canExec(e)}transact(e){return this._stateManager.transact(e)}unregisterExtension=(...e)=>this._extensionManager.unregisterExtension(...e);registerExtension=(...e)=>this._extensionManager.registerExtension(...e);replaceExtension=(...e)=>this._extensionManager.replaceExtension(...e);getExtension=((...e)=>this._extensionManager.getExtension(...e));mount=(e,t)=>{let n=e.getRootNode(),r=typeof ShadowRoot<`u`&&n instanceof ShadowRoot;(t?.portalTarget??e.parentElement??(r?n:document.body)).appendChild(this.portalElement),this._tiptapEditor.mount({mount:e})};unmount=()=>{this.portalElement?.remove(),this._tiptapEditor.unmount()};get prosemirrorState(){return this._stateManager.prosemirrorState}get prosemirrorView(){return this._stateManager.prosemirrorView}get domElement(){if(!this.headless)return this.prosemirrorView?.dom}_portalElement;get portalElement(){if(typeof document>`u`)throw Error(`Portal element accessed, but not available in headless mode`);return this._portalElement||=document.createElement(`div`),this._portalElement}isWithinEditor=e=>!!(this.domElement?.parentElement?.contains(e)||this.portalElement?.contains(e));isFocused(){return this.headless?!1:this.prosemirrorView?.hasFocus()||!1}headless=!0;focus(){this.headless||this.prosemirrorView.focus()}blur(){this.headless||this.domElement?.blur()}onUploadStart(e){return this.onUploadStartCallbacks.push(e),()=>{let t=this.onUploadStartCallbacks.indexOf(e);t>-1&&this.onUploadStartCallbacks.splice(t,1)}}onUploadEnd(e){return this.onUploadEndCallbacks.push(e),()=>{let t=this.onUploadEndCallbacks.indexOf(e);t>-1&&this.onUploadEndCallbacks.splice(t,1)}}get topLevelBlocks(){return this.document}get document(){return this._blockManager.document}getBlock(e){return this._blockManager.getBlock(e)}getPrevBlock(e){return this._blockManager.getPrevBlock(e)}getNextBlock(e){return this._blockManager.getNextBlock(e)}getParentBlock(e){return this._blockManager.getParentBlock(e)}forEachBlock(e,t=!1){this._blockManager.forEachBlock(e,t)}onEditorContentChange(e){this._tiptapEditor.on(`update`,e)}onEditorSelectionChange(e){this._tiptapEditor.on(`selectionUpdate`,e)}onBeforeChange(e){return this._extensionManager.getExtension(n.O).subscribe(e)}getTextCursorPosition(){return this._selectionManager.getTextCursorPosition()}setTextCursorPosition(e,t=`start`){return this._selectionManager.setTextCursorPosition(e,t)}getSelection(){return this._selectionManager.getSelection()}getSelectionCutBlocks(e=!1){return this._selectionManager.getSelectionCutBlocks(e)}setSelection(e,t){return this._selectionManager.setSelection(e,t)}get isEditable(){return this._stateManager.isEditable}set isEditable(e){this._stateManager.isEditable=e}insertBlocks(e,t,n=`before`){return this._blockManager.insertBlocks(e,t,n)}updateBlock(e,t){return this._blockManager.updateBlock(e,t)}removeBlocks(e){return this._blockManager.removeBlocks(e)}replaceBlocks(e,t){return this._blockManager.replaceBlocks(e,t)}undo(){return this._stateManager.undo()}redo(){return this._stateManager.redo()}insertInlineContent(e,{updateSelection:t=!1}={}){this._styleManager.insertInlineContent(e,{updateSelection:t})}getActiveStyles(){return this._styleManager.getActiveStyles()}addStyles(e){this._styleManager.addStyles(e)}removeStyles(e){this._styleManager.removeStyles(e)}toggleStyles(e){this._styleManager.toggleStyles(e)}getSelectedText(){return this._styleManager.getSelectedText()}getSelectedLinkUrl(){return this._styleManager.getSelectedLinkUrl()}createLink(e,t){this._styleManager.createLink(e,t)}getLinkMarkAtPos(e){return this._styleManager.getLinkMarkAtPos(e)}editLink(e,t,n){this._styleManager.editLink(e,t,n)}deleteLink(e){this._styleManager.deleteLink(e)}canNestBlock(){return this._blockManager.canNestBlock()}nestBlock(){this._blockManager.nestBlock()}canUnnestBlock(){return this._blockManager.canUnnestBlock()}unnestBlock(){this._blockManager.unnestBlock()}moveBlocksUp(e){return this._blockManager.moveBlocksUp(e)}moveBlocksDown(e){return this._blockManager.moveBlocksDown(e)}blocksToHTMLLossy(e=this.document){return this._exportManager.blocksToHTMLLossy(e)}blocksToFullHTML(e=this.document){return this._exportManager.blocksToFullHTML(e)}tryParseHTMLToBlocks(e){return this._exportManager.tryParseHTMLToBlocks(e)}blocksToMarkdownLossy(e=this.document){return this._exportManager.blocksToMarkdownLossy(e)}tryParseMarkdownToBlocks(e){return this._exportManager.tryParseMarkdownToBlocks(e)}onChange(e,t){return this._eventManager.onChange(e,t)}onSelectionChange(e,t){return this._eventManager.onSelectionChange(e,t)}onMount(e){return this._eventManager.onMount(e)}onUnmount(e){return this._eventManager.onUnmount(e)}getSelectionBoundingBox(){return this._selectionManager.getSelectionBoundingBox()}get isEmpty(){let e=this.document;return e.length===0||e.length===1&&e[0].type===`paragraph`&&e[0].content.length===0}pasteHTML(e,t=!1){this._exportManager.pasteHTML(e,t)}pasteText(e){return this._exportManager.pasteText(e)}pasteMarkdown(e){return this._exportManager.pasteMarkdown(e)}},rr=class{mappings;options;constructor(e,t,n){this.mappings=t,this.options=n}async resolveFile(e){if(!this.options?.resolveFileUrl)return(await fetch(e)).blob();let t=await this.options.resolveFileUrl(e);return t instanceof Blob?t:(await fetch(t)).blob()}mapStyles(e){return Object.entries(e).map(([e,t])=>this.mappings.styleMapping[e](t,this))}mapInlineContent(e){return this.mappings.inlineContentMapping[e.type](e,this)}transformInlineContent(e){return e.map(e=>this.mapInlineContent(e))}async mapBlock(e,t,n,r){return this.mappings.blockMapping[e.type](e,this,t,n,r)}};function ir(e){return{createBlockMapping:e=>e,createInlineContentMapping:e=>e,createStyleMapping:e=>e}}function ar(e,...t){let n=[...e];for(let e of t)for(let t of e){let e=n.findLastIndex(e=>e.group===t.group);e===-1?n.push(t):n.splice(e+1,0,t)}return n}Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return me}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return he}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return nr}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return ir}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return rr}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return St}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return ar}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return _e}});
//# sourceMappingURL=src-OfbaVbMw.cjs.map