var d=globalThis.__LEPTOS_TIPTAP_BRIDGE__;if(d==null||d.modules==null)throw new Error("leptos-tiptap bridge bindings are unavailable");var e=d.modules["@tiptap/core"];if(e==null)throw new Error('leptos-tiptap bridge module "@tiptap/core" is unavailable');var N=e.CommandManager,O=e.Editor,B=e.Extension,w=e.InputRule,v=e.Mark,m=e.Node,I=e.NodePos,M=e.NodeView,F=e.PasteRule,D=e.Tracker,j=e.callOrReturn,k=e.canInsertNode,L=e.combineTransactionSteps,H=e.createChainableState,K=e.createDocument,z=e.createNodeFromContent,G=e.createStyleTag,q=e.defaultBlockAt,$=e.deleteProps,J=e.elementFromString,V=e.escapeForRegEx,U=e.extensions,Y=e.findChildren,Q=e.findChildrenInRange,W=e.findDuplicates,X=e.findParentNode,Z=e.findParentNodeClosestToPos,ee=e.fromString,te=e.generateHTML,ne=e.generateJSON,oe=e.generateText,ie=e.getAttributes,re=e.getAttributesFromExtensions,se=e.getChangedRanges,le=e.getDebugJSON,ae=e.getExtensionField,pe=e.getHTMLFromFragment,de=e.getMarkAttributes,ce=e.getMarkRange,ue=e.getMarkType,ge=e.getMarksBetween,_e=e.getNodeAtPosition,xe=e.getNodeAttributes,me=e.getNodeType,ke=e.getRenderedAttributes,be=e.getSchema,ye=e.getSchemaByResolvedExtensions,fe=e.getSchemaTypeByName,he=e.getSchemaTypeNameByName,Ee=e.getSplittedAttributes,Re=e.getText,Se=e.getTextBetween,Te=e.getTextContentFromNodes,Pe=e.getTextSerializersFromSchema,Ae=e.injectExtensionAttributesToParseRule,Ce=e.inputRulesPlugin,Ne=e.isActive,Oe=e.isAtEndOfNode,Be=e.isAtStartOfNode,we=e.isEmptyObject,ve=e.isExtensionRulesEnabled,Ie=e.isFunction,Me=e.isList,Fe=e.isMacOS,De=e.isMarkActive,je=e.isNodeActive,Le=e.isNodeEmpty,b=e.isNodeSelection,He=e.isNumber,Ke=e.isPlainObject,ze=e.isRegExp,Ge=e.isSafari,qe=e.isString,$e=e.isTextSelection,Je=e.isiOS,Ve=e.markInputRule,Ue=e.markPasteRule,y=e.mergeAttributes,Ye=e.mergeDeep,Qe=e.minMax,f=e.nodeInputRule,We=e.nodePasteRule,Xe=e.objectIncludes,Ze=e.pasteRulesPlugin,et=e.posToDOMRect,tt=e.removeDuplicates,nt=e.resolveFocusPosition,ot=e.rewriteUnknownContent,it=e.selectionToInsertionEnd,rt=e.splitExtensions,st=e.textInputRule,lt=e.textPasteRule,at=e.textblockTypeInputRule,pt=e.wrappingInputRule;var c=globalThis.__LEPTOS_TIPTAP_BRIDGE__;if(c==null||c.modules==null)throw new Error("leptos-tiptap bridge bindings are unavailable");var o=c.modules["@tiptap/pm/state"];if(o==null)throw new Error('leptos-tiptap bridge module "@tiptap/pm/state" is unavailable');var ct=o.AllSelection,ut=o.EditorState,h=o.NodeSelection,gt=o.Plugin,_t=o.PluginKey,xt=o.Selection,mt=o.SelectionRange,a=o.TextSelection,kt=o.Transaction;var E=m.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",y(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:r})=>{if(!k(r,r.schema.nodes[this.name]))return!1;let{selection:s}=r,{$from:u,$to:g}=s,l=n();return u.parentOffset===0?l.insertContentAt({from:Math.max(u.pos-1,0),to:g.pos},{type:this.name}):b(s)?l.insertContentAt(g.pos,{type:this.name}):l.insertContent({type:this.name}),l.command(({tr:t,dispatch:P})=>{var p;if(P){let{$to:i}=t.selection,_=i.end();if(i.nodeAfter)i.nodeAfter.isTextblock?t.setSelection(a.create(t.doc,i.pos+1)):i.nodeAfter.isBlock?t.setSelection(h.create(t.doc,i.pos)):t.setSelection(a.create(t.doc,i.pos));else{let x=(p=i.parent.type.contentMatch.defaultType)===null||p===void 0?void 0:p.create();x&&(t.insert(_,x),t.setSelection(a.create(t.doc,_+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[f({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var R="__LEPTOS_TIPTAP_BRIDGE__";function A(){let n=globalThis,r=n[R];if(r!=null)return r;let s={modules:{},registerExtension:()=>{throw new Error("leptos-tiptap bridge runtime is not initialized")}};return n[R]=s,s}function S(){return A()}function T(n){S().registerExtension(n)}var C={name:"horizontal_rule",create:()=>E,commands:{set_horizontal_rule:n=>n.chain().focus().setHorizontalRule().run()}};function At(){T(C)}export{At as register_horizontal_rule};
