@instincthub/react-ui 0.1.36 → 0.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/createPopper.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/createPopper.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/contains.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/contains.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getNodeName.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getNodeName.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getParentNode.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getParentNode.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getWindow.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getWindow.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/instanceOf.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/instanceOf.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/isTableElement.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/isTableElement.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/enums.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/enums.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/applyStyles.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/applyStyles.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/arrow.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/arrow.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/computeStyles.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/computeStyles.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/eventListeners.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/eventListeners.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/flip.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/flip.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/hide.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/hide.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/offset.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/offset.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/popperOffsets.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/popperOffsets.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/preventOverflow.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/modifiers/preventOverflow.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/popper.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/popper.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/computeOffsets.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/computeOffsets.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/debounce.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/debounce.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/detectOverflow.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/detectOverflow.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/expandToHashMap.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/expandToHashMap.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getAltAxis.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getAltAxis.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getBasePlacement.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getBasePlacement.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getFreshSideObject.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getFreshSideObject.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getOppositePlacement.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getOppositePlacement.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getVariation.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/getVariation.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/math.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/math.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/mergeByName.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/mergeByName.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/mergePaddingObject.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/mergePaddingObject.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/orderModifiers.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/orderModifiers.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/rectToClientRect.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/rectToClientRect.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/userAgent.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/userAgent.js.map +1 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/within.js +2 -0
- package/dist/node_modules/.pnpm/@popperjs_core@2.11.8/node_modules/@popperjs/core/lib/utils/within.js.map +1 -0
- package/dist/node_modules/.pnpm/@tiptap_core@2.27.1_@tiptap_pm@2.27.1/node_modules/@tiptap/core/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@tiptap_core@2.27.1_@tiptap_pm@2.27.1/node_modules/@tiptap/core/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/@tiptap_extension-bubble-menu@2.27.1_@tiptap_core@2.27.1_@tiptap_pm@2.27.1__@tiptap_pm@2.27.1/node_modules/@tiptap/extension-bubble-menu/dist/index.js +2 -0
- package/dist/node_modules/.pnpm/@tiptap_extension-bubble-menu@2.27.1_@tiptap_core@2.27.1_@tiptap_pm@2.27.1__@tiptap_pm@2.27.1/node_modules/@tiptap/extension-bubble-menu/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@tiptap_extension-color@2.27.2_@tiptap_core@2.27.1_@tiptap_pm@2.27.1__@tiptap_extension_3361c5fd95bc28ff82624b8eb98b2834/node_modules/@tiptap/extension-color/dist/index.js +2 -0
- package/dist/node_modules/.pnpm/@tiptap_extension-color@2.27.2_@tiptap_core@2.27.1_@tiptap_pm@2.27.1__@tiptap_extension_3361c5fd95bc28ff82624b8eb98b2834/node_modules/@tiptap/extension-color/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@tiptap_extension-floating-menu@2.27.1_@tiptap_core@2.27.1_@tiptap_pm@2.27.1__@tiptap_pm@2.27.1/node_modules/@tiptap/extension-floating-menu/dist/index.js +2 -0
- package/dist/node_modules/.pnpm/@tiptap_extension-floating-menu@2.27.1_@tiptap_core@2.27.1_@tiptap_pm@2.27.1__@tiptap_pm@2.27.1/node_modules/@tiptap/extension-floating-menu/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@tiptap_extension-focus@2.27.2_@tiptap_core@2.27.1_@tiptap_pm@2.27.1__@tiptap_pm@2.27.1/node_modules/@tiptap/extension-focus/dist/index.js +2 -0
- package/dist/node_modules/.pnpm/@tiptap_extension-focus@2.27.2_@tiptap_core@2.27.1_@tiptap_pm@2.27.1__@tiptap_pm@2.27.1/node_modules/@tiptap/extension-focus/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@tiptap_extension-text-align@2.27.2_@tiptap_core@2.27.1_@tiptap_pm@2.27.1_/node_modules/@tiptap/extension-text-align/dist/index.js +2 -0
- package/dist/node_modules/.pnpm/@tiptap_extension-text-align@2.27.2_@tiptap_core@2.27.1_@tiptap_pm@2.27.1_/node_modules/@tiptap/extension-text-align/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@tiptap_extension-text-style@2.27.1_@tiptap_core@2.27.1_@tiptap_pm@2.27.1_/node_modules/@tiptap/extension-text-style/dist/index.js +2 -0
- package/dist/node_modules/.pnpm/@tiptap_extension-text-style@2.27.1_@tiptap_core@2.27.1_@tiptap_pm@2.27.1_/node_modules/@tiptap/extension-text-style/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@tiptap_extension-typography@2.27.2_@tiptap_core@2.27.1_@tiptap_pm@2.27.1_/node_modules/@tiptap/extension-typography/dist/index.js +2 -0
- package/dist/node_modules/.pnpm/@tiptap_extension-typography@2.27.2_@tiptap_core@2.27.1_@tiptap_pm@2.27.1_/node_modules/@tiptap/extension-typography/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@tiptap_extension-underline@2.27.2_@tiptap_core@2.27.1_@tiptap_pm@2.27.1_/node_modules/@tiptap/extension-underline/dist/index.js +2 -0
- package/dist/node_modules/.pnpm/@tiptap_extension-underline@2.27.2_@tiptap_core@2.27.1_@tiptap_pm@2.27.1_/node_modules/@tiptap/extension-underline/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@tiptap_extension-youtube@2.27.2_@tiptap_core@2.27.1_@tiptap_pm@2.27.1_/node_modules/@tiptap/extension-youtube/dist/index.js +2 -0
- package/dist/node_modules/.pnpm/@tiptap_extension-youtube@2.27.2_@tiptap_core@2.27.1_@tiptap_pm@2.27.1_/node_modules/@tiptap/extension-youtube/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@tiptap_react@2.27.1_@tiptap_core@2.27.1_@tiptap_pm@2.27.1__@tiptap_pm@2.27.1_react-dom_3687a02a33de69fe477ccd0d970063c0/node_modules/@tiptap/react/dist/index.js +3 -3
- package/dist/node_modules/.pnpm/@tiptap_react@2.27.1_@tiptap_core@2.27.1_@tiptap_pm@2.27.1__@tiptap_pm@2.27.1_react-dom_3687a02a33de69fe477ccd0d970063c0/node_modules/@tiptap/react/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/@tiptap_suggestion@2.27.2_@tiptap_core@2.27.1_@tiptap_pm@2.27.1__@tiptap_pm@2.27.1/node_modules/@tiptap/suggestion/dist/index.js +2 -0
- package/dist/node_modules/.pnpm/@tiptap_suggestion@2.27.2_@tiptap_core@2.27.1_@tiptap_pm@2.27.1__@tiptap_pm@2.27.1/node_modules/@tiptap/suggestion/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/bold.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/bold.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/code-xml.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/code-xml.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/code.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/code.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/columns-3.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/columns-3.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/external-link.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/external-link.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/grip-vertical.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/grip-vertical.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/heading-2.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/heading-2.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/heading-3.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/heading-3.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/highlighter.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/highlighter.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/image.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/image.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/italic.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/italic.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/link.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/link.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/list-checks.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/list-checks.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/list-ordered.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/list-ordered.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/list.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/list.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/merge.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/merge.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/message-square-quote.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/message-square-quote.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/minus.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/minus.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/plus.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/plus.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/quote.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/quote.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/rows-3.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/rows-3.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/split.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/split.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/strikethrough.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/strikethrough.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/table.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/table.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/trash-2.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/trash-2.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/underline.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/underline.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/unlink.js +2 -2
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/unlink.js.map +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/youtube.js +1 -1
- package/dist/node_modules/.pnpm/lucide-react@0.525.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/youtube.js.map +1 -1
- package/dist/node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/dist/tippy.esm.js +7 -0
- package/dist/node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/dist/tippy.esm.js.map +1 -0
- package/dist/src/assets/css/modals.css +189 -0
- package/dist/src/assets/css/ui/content-viewer.css +273 -58
- package/dist/src/assets/css/ui/ihub-text-editor.css +883 -0
- package/dist/src/assets/css/ui/ui-index.css +1 -0
- package/dist/src/components/forms/FilterObjects.js +1 -1
- package/dist/src/components/lib/modals/modals.js +1 -1
- package/dist/src/components/lib/modals/modals.js.map +1 -1
- package/dist/src/components/ui/ComponentLists.js +1 -1
- package/dist/src/components/ui/editor/ihub-editor/IHubTextEditor.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/IHubTextEditor.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/components/BubbleToolbar.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/components/BubbleToolbar.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/components/EditorFooter.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/components/EditorFooter.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/components/FloatingAddButton.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/components/FloatingAddButton.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/components/LinkPopover.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/components/LinkPopover.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/components/SlashCommandMenu.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/components/SlashCommandMenu.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/components/TableToolbar.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/components/TableToolbar.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/constants.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/constants.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/EmbedExtension.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/EmbedExtension.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/ImageWithCaption.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/ImageWithCaption.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/PullQuoteExtension.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/PullQuoteExtension.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/SlashCommandExtension.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/extensions/SlashCommandExtension.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/hooks/useIHubEditor.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/hooks/useIHubEditor.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/hooks/useImageUpload.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/hooks/useImageUpload.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/hooks/useMediaEmbed.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/hooks/useMediaEmbed.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/hooks/useSlashCommands.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/hooks/useSlashCommands.js.map +1 -0
- package/dist/src/components/ui/editor/ihub-editor/types.js +2 -0
- package/dist/src/components/ui/editor/ihub-editor/types.js.map +1 -0
- package/dist/src/components/ui/viewer/ContentViewer.js +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/types/components/lib/modals/modals.d.ts +134 -0
- package/dist/src/types/components/ui/editor/ihub-editor/IHubTextEditor.d.ts +2 -0
- package/dist/src/types/components/ui/editor/ihub-editor/components/BubbleToolbar.d.ts +6 -0
- package/dist/src/types/components/ui/editor/ihub-editor/components/DragHandle.d.ts +5 -0
- package/dist/src/types/components/ui/editor/ihub-editor/components/EditorFooter.d.ts +8 -0
- package/dist/src/types/components/ui/editor/ihub-editor/components/EmbedBlock.d.ts +6 -0
- package/dist/src/types/components/ui/editor/ihub-editor/components/FloatingAddButton.d.ts +7 -0
- package/dist/src/types/components/ui/editor/ihub-editor/components/ImageBlock.d.ts +12 -0
- package/dist/src/types/components/ui/editor/ihub-editor/components/LinkPopover.d.ts +7 -0
- package/dist/src/types/components/ui/editor/ihub-editor/components/PullQuote.d.ts +6 -0
- package/dist/src/types/components/ui/editor/ihub-editor/components/SlashCommandMenu.d.ts +9 -0
- package/dist/src/types/components/ui/editor/ihub-editor/components/TableToolbar.d.ts +6 -0
- package/dist/src/types/components/ui/editor/ihub-editor/constants.d.ts +3 -0
- package/dist/src/types/components/ui/editor/ihub-editor/extensions/EmbedExtension.d.ts +13 -0
- package/dist/src/types/components/ui/editor/ihub-editor/extensions/ImageWithCaption.d.ts +14 -0
- package/dist/src/types/components/ui/editor/ihub-editor/extensions/PullQuoteExtension.d.ts +11 -0
- package/dist/src/types/components/ui/editor/ihub-editor/extensions/SlashCommandExtension.d.ts +3 -0
- package/dist/src/types/components/ui/editor/ihub-editor/hooks/useIHubEditor.d.ts +16 -0
- package/dist/src/types/components/ui/editor/ihub-editor/hooks/useImageUpload.d.ts +11 -0
- package/dist/src/types/components/ui/editor/ihub-editor/hooks/useMediaEmbed.d.ts +7 -0
- package/dist/src/types/components/ui/editor/ihub-editor/hooks/useSlashCommands.d.ts +10 -0
- package/dist/src/types/components/ui/editor/ihub-editor/index.d.ts +2 -0
- package/dist/src/types/components/ui/editor/ihub-editor/types.d.ts +48 -0
- package/dist/src/types/index.d.ts +2 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +13 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Plugin as t,PluginKey as e,NodeSelection as n,Selection as o,TextSelection as r,AllSelection as s,EditorState as i}from"../../../../../prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.js";import{EditorView as a}from"../../../../../prosemirror-view@1.41.3/node_modules/prosemirror-view/dist/index.js";import{keymap as c}from"../../../../../prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.js";import{Fragment as d,Slice as l,DOMSerializer as p,Node as u,Schema as h,DOMParser as m}from"../../../../../prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.js";import{findWrapping as f,canJoin as g,Transform as v,liftTarget as y,joinPoint as b,canSplit as k,ReplaceStep as w,ReplaceAroundStep as x}from"../../../../../prosemirror-transform@1.10.5/node_modules/prosemirror-transform/dist/index.js";import{createParagraphNear as M,deleteSelection as E,exitCode as O,joinUp as S,joinDown as C,joinBackward as T,joinForward as P,joinTextblockBackward as $,joinTextblockForward as A,lift as j,liftEmptyBlock as I,newlineInCode as N,selectNodeBackward as B,selectNodeForward as R,selectParentNode as D,selectTextblockEnd as z,selectTextblockStart as L,setBlockType as F,wrapIn as H}from"../../../../../prosemirror-commands@1.7.1/node_modules/prosemirror-commands/dist/index.js";import{liftListItem as V,sinkListItem as _,wrapInList as W}from"../../../../../prosemirror-schema-list@1.5.1/node_modules/prosemirror-schema-list/dist/index.js";function q(t){const{state:e,transaction:n}=t;let{selection:o}=n,{doc:r}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return o},get doc(){return r},get tr(){return o=n.selection,r=n.doc,s=n.storedMarks,n}}}class K{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:o}=e,{tr:r}=n,s=this.buildProps(r);return Object.fromEntries(Object.entries(t).map(([t,e])=>[t,(...t)=>{const n=e(...t)(s);return r.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(r),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:o,state:r}=this,{view:s}=o,i=[],a=!!t,c=t||r.tr,d={...Object.fromEntries(Object.entries(n).map(([t,n])=>[t,(...t)=>{const o=this.buildProps(c,e),r=n(...t)(o);return i.push(r),d}])),run:()=>(a||!e||c.getMeta("preventDispatch")||this.hasCustomState||s.dispatch(c),i.every(t=>!0===t))};return d}createCan(t){const{rawCommands:e,state:n}=this,o=!1,r=t||n.tr,s=this.buildProps(r,o),i=Object.fromEntries(Object.entries(e).map(([t,e])=>[t,(...t)=>e(...t)({...s,dispatch:void 0})]));return{...i,chain:()=>this.createChain(r,o)}}buildProps(t,e=!0){const{rawCommands:n,editor:o,state:r}=this,{view:s}=o,i={tr:t,editor:o,view:s,state:q({state:r,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([t,e])=>[t,(...t)=>e(...t)(i)]))}};return i}}class U{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(t=>t.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(t=>t!==e):delete this.callbacks[t]),this}once(t,e){const n=(...o)=>{this.off(t,n),e.apply(this,o)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}}function G(t,e,n){if(void 0===t.config[e]&&t.parent)return G(t.parent,e,n);if("function"==typeof t.config[e]){return t.config[e].bind({...n,parent:t.parent?G(t.parent,e,n):null})}return t.config[e]}function J(t){return{baseExtensions:t.filter(t=>"extension"===t.type),nodeExtensions:t.filter(t=>"node"===t.type),markExtensions:t.filter(t=>"mark"===t.type)}}function Y(t){const e=[],{nodeExtensions:n,markExtensions:o}=J(t),r=[...n,...o],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(t=>{const n=G(t,"addGlobalAttributes",{name:t.name,options:t.options,storage:t.storage,extensions:r});if(!n)return;n().forEach(t=>{t.types.forEach(n=>{Object.entries(t.attributes).forEach(([t,o])=>{e.push({type:n,name:t,attribute:{...s,...o}})})})})}),r.forEach(t=>{const n={name:t.name,options:t.options,storage:t.storage},o=G(t,"addAttributes",n);if(!o)return;const r=o();Object.entries(r).forEach(([n,o])=>{const r={...s,...o};"function"==typeof(null==r?void 0:r.default)&&(r.default=r.default()),(null==r?void 0:r.isRequired)&&void 0===(null==r?void 0:r.default)&&delete r.default,e.push({type:t.name,name:n,attribute:r})})}),e}function Q(t,e){if("string"==typeof t){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function X(...t){return t.filter(t=>!!t).reduce((t,e)=>{const n={...t};return Object.entries(e).forEach(([t,e])=>{if(n[t])if("class"===t){const o=e?String(e).split(" "):[],r=n[t]?n[t].split(" "):[],s=o.filter(t=>!r.includes(t));n[t]=[...r,...s].join(" ")}else if("style"===t){const o=e?e.split(";").map(t=>t.trim()).filter(Boolean):[],r=n[t]?n[t].split(";").map(t=>t.trim()).filter(Boolean):[],s=new Map;r.forEach(t=>{const[e,n]=t.split(":").map(t=>t.trim());s.set(e,n)}),o.forEach(t=>{const[e,n]=t.split(":").map(t=>t.trim());s.set(e,n)}),n[t]=Array.from(s.entries()).map(([t,e])=>`${t}: ${e}`).join("; ")}else n[t]=e;else n[t]=e}),n},{})}function Z(t,e){return e.filter(e=>e.type===t.type.name).filter(t=>t.attribute.rendered).map(e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]}).reduce((t,e)=>X(t,e),{})}function tt(t){return"function"==typeof t}function et(t,e=void 0,...n){return tt(t)?e?t.bind(e)(...n):t(...n):t}function nt(t={}){return 0===Object.keys(t).length&&t.constructor===Object}function ot(t){return"string"!=typeof t?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):"true"===t||"false"!==t&&t}function rt(t,e){return"style"in t?t:{...t,getAttrs:n=>{const o=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===o)return!1;const r=e.reduce((t,e)=>{const o=e.attribute.parseHTML?e.attribute.parseHTML(n):ot(n.getAttribute(e.name));return null==o?t:{...t,[e.name]:o}},{});return{...o,...r}}}}function st(t){return Object.fromEntries(Object.entries(t).filter(([t,e])=>("attrs"!==t||!nt(e))&&null!=e))}function it(t,e){var n;const o=Y(t),{nodeExtensions:r,markExtensions:s}=J(t),i=null===(n=r.find(t=>G(t,"topNode")))||void 0===n?void 0:n.name,a=Object.fromEntries(r.map(n=>{const r=o.filter(t=>t.type===n.name),s={name:n.name,options:n.options,storage:n.storage,editor:e},i=st({...t.reduce((t,e)=>{const o=G(e,"extendNodeSchema",s);return{...t,...o?o(n):{}}},{}),content:et(G(n,"content",s)),marks:et(G(n,"marks",s)),group:et(G(n,"group",s)),inline:et(G(n,"inline",s)),atom:et(G(n,"atom",s)),selectable:et(G(n,"selectable",s)),draggable:et(G(n,"draggable",s)),code:et(G(n,"code",s)),whitespace:et(G(n,"whitespace",s)),linebreakReplacement:et(G(n,"linebreakReplacement",s)),defining:et(G(n,"defining",s)),isolating:et(G(n,"isolating",s)),attrs:Object.fromEntries(r.map(t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]}))}),a=et(G(n,"parseHTML",s));a&&(i.parseDOM=a.map(t=>rt(t,r)));const c=G(n,"renderHTML",s);c&&(i.toDOM=t=>c({node:t,HTMLAttributes:Z(t,r)}));const d=G(n,"renderText",s);return d&&(i.toText=d),[n.name,i]})),c=Object.fromEntries(s.map(n=>{const r=o.filter(t=>t.type===n.name),s={name:n.name,options:n.options,storage:n.storage,editor:e},i=st({...t.reduce((t,e)=>{const o=G(e,"extendMarkSchema",s);return{...t,...o?o(n):{}}},{}),inclusive:et(G(n,"inclusive",s)),excludes:et(G(n,"excludes",s)),group:et(G(n,"group",s)),spanning:et(G(n,"spanning",s)),code:et(G(n,"code",s)),attrs:Object.fromEntries(r.map(t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]}))}),a=et(G(n,"parseHTML",s));a&&(i.parseDOM=a.map(t=>rt(t,r)));const c=G(n,"renderHTML",s);return c&&(i.toDOM=t=>c({mark:t,HTMLAttributes:Z(t,r)})),[n.name,i]}));return new h({topNode:i,nodes:a,marks:c})}function at(t,e){return e.nodes[t]||e.marks[t]||null}function ct(t,e){return Array.isArray(e)?e.some(e=>("string"==typeof e?e:e.name)===t.name):e}function dt(t,e){const n=p.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}const lt=(t,e=500)=>{let n="";const o=t.parentOffset;return t.parent.nodesBetween(Math.max(0,o-e),o,(t,e,r,s)=>{var i,a;const c=(null===(a=(i=t.type.spec).toText)||void 0===a?void 0:a.call(i,{node:t,pos:e,parent:r,index:s}))||t.textContent||"%leaf%";n+=t.isAtom&&!t.isText?c:c.slice(0,Math.max(0,o-e))}),n};function pt(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class ut{constructor(t){this.find=t.find,this.handler=t.handler}}function ht(t){var e;const{editor:n,from:o,to:r,text:s,rules:i,plugin:a}=t,{view:c}=n;if(c.composing)return!1;const d=c.state.doc.resolve(o);if(d.parent.type.spec.code||(null===(e=d.nodeBefore||d.nodeAfter)||void 0===e?void 0:e.marks.find(t=>t.type.spec.code)))return!1;let l=!1;const p=lt(d)+s;return i.forEach(t=>{if(l)return;const e=((t,e)=>{if(pt(e))return e.exec(t);const n=e(t);if(!n)return null;const o=[n.text];return o.index=n.index,o.input=t,o.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),o.push(n.replaceWith)),o})(p,t.find);if(!e)return;const i=c.state.tr,d=q({state:c.state,transaction:i}),u={from:o-(e[0].length-s.length),to:r},{commands:h,chain:m,can:f}=new K({editor:n,state:d});null!==t.handler({state:d,range:u,match:e,commands:h,chain:m,can:f})&&i.steps.length&&(i.setMeta(a,{transform:i,from:o,to:r,text:s}),c.dispatch(i),l=!0)}),l}function mt(e){const{editor:n,rules:o}=e,r=new t({state:{init:()=>null,apply(t,e,s){const i=t.getMeta(r);if(i)return i;const a=t.getMeta("applyInputRules");return!!a&&setTimeout(()=>{let{text:t}=a;"string"==typeof t||(t=dt(d.from(t),s.schema));const{from:e}=a,i=e+t.length;ht({editor:n,from:e,to:i,text:t,rules:o,plugin:r})}),t.selectionSet||t.docChanged?null:e}},props:{handleTextInput:(t,e,s,i)=>ht({editor:n,from:e,to:s,text:i,rules:o,plugin:r}),handleDOMEvents:{compositionend:t=>(setTimeout(()=>{const{$cursor:e}=t.state.selection;e&&ht({editor:n,from:e.pos,to:e.pos,text:"",rules:o,plugin:r})}),!1)},handleKeyDown(t,e){if("Enter"!==e.key)return!1;const{$cursor:s}=t.state.selection;return!!s&&ht({editor:n,from:s.pos,to:s.pos,text:"\n",rules:o,plugin:r})}},isInputRules:!0});return r}function ft(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&(t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype)}function gt(t,e){const n={...t};return ft(t)&&ft(e)&&Object.keys(e).forEach(o=>{ft(e[o])&&ft(t[o])?n[o]=gt(t[o],e[o]):n[o]=e[o]}),n}class vt{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=et(G(this,"addOptions",{name:this.name}))),this.storage=et(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new vt(t)}configure(t={}){const e=this.extend({...this.config,addOptions:()=>gt(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new vt(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=et(G(e,"addOptions",{name:e.name})),e.storage=et(G(e,"addStorage",{name:e.name,options:e.options})),e}static handleExit({editor:t,mark:e}){const{tr:n}=t.state,o=t.state.selection.$from;if(o.pos===o.end()){const r=o.marks();if(!!!r.find(t=>(null==t?void 0:t.type.name)===e.name))return!1;const s=r.find(t=>(null==t?void 0:t.type.name)===e.name);return s&&n.removeStoredMark(s),n.insertText(" ",o.pos),t.view.dispatch(n),!0}return!1}}function yt(t){return"number"==typeof t}class bt{constructor(t){this.find=t.find,this.handler=t.handler}}function kt(t){const{editor:e,state:n,from:o,to:r,rule:s,pasteEvent:i,dropEvent:a}=t,{commands:c,chain:d,can:l}=new K({editor:e,state:n}),p=[];n.doc.nodesBetween(o,r,(t,e)=>{if(!t.isTextblock||t.type.spec.code)return;const u=Math.max(o,e),h=Math.min(r,e+t.content.size);((t,e,n)=>{if(pt(e))return[...t.matchAll(e)];const o=e(t,n);return o?o.map(e=>{const n=[e.text];return n.index=e.index,n.input=t,n.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(e.replaceWith)),n}):[]})(t.textBetween(u-e,h-e,void 0,""),s.find,i).forEach(t=>{if(void 0===t.index)return;const e=u+t.index+1,o=e+t[0].length,r={from:n.tr.mapping.map(e),to:n.tr.mapping.map(o)},h=s.handler({state:n,range:r,match:t,commands:c,chain:d,can:l,pasteEvent:i,dropEvent:a});p.push(h)})});return p.every(t=>null!==t)}let wt=null;function xt(e){const{editor:n,rules:o}=e;let r,s=null,i=!1,a=!1,c="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}const l=({state:t,from:e,to:o,rule:s,pasteEvt:i})=>{const a=t.tr,d=q({state:t,transaction:a});if(kt({editor:n,state:d,from:Math.max(e-1,0),to:o.b-1,rule:s,pasteEvent:i,dropEvent:r})&&a.steps.length){try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}return c="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,a}};return o.map(e=>new t({view(t){const e=e=>{var o;s=(null===(o=t.dom.parentElement)||void 0===o?void 0:o.contains(e.target))?t.dom.parentElement:null,s&&(wt=n)},o=()=>{wt&&(wt=null)};return window.addEventListener("dragstart",e),window.addEventListener("dragend",o),{destroy(){window.removeEventListener("dragstart",e),window.removeEventListener("dragend",o)}}},props:{handleDOMEvents:{drop:(t,e)=>{if(a=s===t.dom.parentElement,r=e,!a){const t=wt;(null==t?void 0:t.isEditable)&&setTimeout(()=>{const e=t.state.selection;e&&t.commands.deleteRange({from:e.from,to:e.to})},10)}return!1},paste:(t,e)=>{var n;const o=null===(n=e.clipboardData)||void 0===n?void 0:n.getData("text/html");return c=e,i=!!(null==o?void 0:o.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,o)=>{const r=t[0],s="paste"===r.getMeta("uiEvent")&&!i,p="drop"===r.getMeta("uiEvent")&&!a,u=r.getMeta("applyPasteRules"),h=!!u;if(!s&&!p&&!h)return;if(h){let{text:t}=u;"string"==typeof t||(t=dt(d.from(t),o.schema));const{from:n}=u,r=n+t.length,s=(t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null===(e=n.clipboardData)||void 0===e||e.setData("text/html",t),n})(t);return l({rule:e,state:o,from:n,to:{b:r},pasteEvt:s})}const m=n.doc.content.findDiffStart(o.doc.content),f=n.doc.content.findDiffEnd(o.doc.content);return yt(m)&&f&&m!==f.b?l({rule:e,state:o,from:m,to:f,pasteEvt:c}):void 0}}))}function Mt(t){const e=t.filter((e,n)=>t.indexOf(e)!==n);return Array.from(new Set(e))}class Et{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=Et.resolve(t),this.schema=it(this.extensions,e),this.setupExtensions()}static resolve(t){const e=Et.sort(Et.flatten(t)),n=Mt(e.map(t=>t.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(t=>`'${t}'`).join(", ")}]. This can lead to issues.`),e}static flatten(t){return t.map(t=>{const e=G(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return e?[t,...this.flatten(e())]:t}).flat(10)}static sort(t){return t.sort((t,e)=>{const n=G(t,"priority")||100,o=G(e,"priority")||100;return n>o?-1:n<o?1:0})}get commands(){return this.extensions.reduce((t,e)=>{const n=G(e,"addCommands",{name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:at(e.name,this.schema)});return n?{...t,...n()}:t},{})}get plugins(){const{editor:t}=this,e=Et.sort([...this.extensions].reverse()),n=[],o=[],r=e.map(e=>{const r={name:e.name,options:e.options,storage:e.storage,editor:t,type:at(e.name,this.schema)},s=[],i=G(e,"addKeyboardShortcuts",r);let a={};if("mark"===e.type&&G(e,"exitable",r)&&(a.ArrowRight=()=>vt.handleExit({editor:t,mark:e})),i){const e=Object.fromEntries(Object.entries(i()).map(([e,n])=>[e,()=>n({editor:t})]));a={...a,...e}}const d=c(a);s.push(d);const l=G(e,"addInputRules",r);ct(e,t.options.enableInputRules)&&l&&n.push(...l());const p=G(e,"addPasteRules",r);ct(e,t.options.enablePasteRules)&&p&&o.push(...p());const u=G(e,"addProseMirrorPlugins",r);if(u){const t=u();s.push(...t)}return s}).flat();return[mt({editor:t,rules:n}),...xt({editor:t,rules:o}),...r]}get attributes(){return Y(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=J(this.extensions);return Object.fromEntries(e.filter(t=>!!G(t,"addNodeView")).map(e=>{const n=this.attributes.filter(t=>t.type===e.name),o={name:e.name,options:e.options,storage:e.storage,editor:t,type:Q(e.name,this.schema)},r=G(e,"addNodeView",o);if(!r)return[];return[e.name,(o,s,i,a,c)=>{const d=Z(o,n);return r()({node:o,view:s,getPos:i,decorations:a,innerDecorations:c,editor:t,extension:e,HTMLAttributes:d})}]}))}setupExtensions(){this.extensions.forEach(t=>{var e;this.editor.extensionStorage[t.name]=t.storage;const n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:at(t.name,this.schema)};if("mark"===t.type){(null===(e=et(G(t,"keepOnSplit",n)))||void 0===e||e)&&this.splittableMarks.push(t.name)}const o=G(t,"onBeforeCreate",n),r=G(t,"onCreate",n),s=G(t,"onUpdate",n),i=G(t,"onSelectionUpdate",n),a=G(t,"onTransaction",n),c=G(t,"onFocus",n),d=G(t,"onBlur",n),l=G(t,"onDestroy",n);o&&this.editor.on("beforeCreate",o),r&&this.editor.on("create",r),s&&this.editor.on("update",s),i&&this.editor.on("selectionUpdate",i),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),d&&this.editor.on("blur",d),l&&this.editor.on("destroy",l)})}}class Ot{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=et(G(this,"addOptions",{name:this.name}))),this.storage=et(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Ot(t)}configure(t={}){const e=this.extend({...this.config,addOptions:()=>gt(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new Ot({...this.config,...t});return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=et(G(e,"addOptions",{name:e.name})),e.storage=et(G(e,"addStorage",{name:e.name,options:e.options})),e}}function St(t,e,n){const{from:o,to:r}=e,{blockSeparator:s="\n\n",textSerializers:i={}}=n||{};let a="";return t.nodesBetween(o,r,(t,n,c,d)=>{var l;t.isBlock&&n>o&&(a+=s);const p=null==i?void 0:i[t.type.name];if(p)return c&&(a+=p({node:t,pos:n,parent:c,index:d,range:e})),!1;t.isText&&(a+=null===(l=null==t?void 0:t.text)||void 0===l?void 0:l.slice(Math.max(o,n)-n,r-n))}),a}function Ct(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,t])=>t.spec.toText).map(([t,e])=>[t,e.spec.toText]))}const Tt=Ot.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new t({key:new e("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:o,selection:r}=e,{ranges:s}=r,i=Math.min(...s.map(t=>t.$from.pos)),a=Math.max(...s.map(t=>t.$to.pos)),c=Ct(n);return St(o,{from:i,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}});function Pt(t,e,n={strict:!0}){const o=Object.keys(e);return!o.length||o.every(o=>n.strict?e[o]===t[o]:pt(e[o])?e[o].test(t[o]):e[o]===t[o])}function $t(t,e,n={}){return t.find(t=>t.type===e&&Pt(Object.fromEntries(Object.keys(n).map(e=>[e,t.attrs[e]])),n))}function At(t,e,n={}){return!!$t(t,e,n)}function jt(t,e,n){var o;if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(r.node&&r.node.marks.some(t=>t.type===e)||(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(t=>t.type===e))return;n=n||(null===(o=r.node.marks[0])||void 0===o?void 0:o.attrs);if(!$t([...r.node.marks],e,n))return;let s=r.index,i=t.start()+r.offset,a=s+1,c=i+r.node.nodeSize;for(;s>0&&At([...t.parent.child(s-1).marks],e,n);)s-=1,i-=t.parent.child(s).nodeSize;for(;a<t.parent.childCount&&At([...t.parent.child(a).marks],e,n);)c+=t.parent.child(a).nodeSize,a+=1;return{from:i,to:c}}function It(t,e){if("string"==typeof t){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function Nt(t){return t instanceof r}function Bt(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Rt(t,e=null){if(!e)return null;const n=o.atStart(t),s=o.atEnd(t);if("start"===e||!0===e)return n;if("end"===e)return s;const i=n.from,a=s.to;return"all"===e?r.create(t,Bt(0,i,a),Bt(t.content.size,i,a)):r.create(t,Bt(e,i,a),Bt(e,i,a))}function Dt(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const zt=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const o=e[n];3===o.nodeType&&o.nodeValue&&/^(\n\s\s|\n)$/.test(o.nodeValue)?t.removeChild(o):1===o.nodeType&&zt(o)}return t};function Lt(t){const e=`<body>${t}</body>`,n=(new window.DOMParser).parseFromString(e,"text/html").body;return zt(n)}function Ft(t,e,n){if(t instanceof u||t instanceof d)return t;n={slice:!0,parseOptions:{},...n};const o="string"==typeof t;if("object"==typeof t&&null!==t)try{if(Array.isArray(t)&&t.length>0)return d.fromArray(t.map(t=>e.nodeFromJSON(t)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),Ft("",e,n)}if(o){if(n.errorOnInvalidContent){let o=!1,r="";const s=new h({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:t=>(o=!0,r="string"==typeof t?t:t.outerHTML,null)}]}})});if(n.slice?m.fromSchema(s).parseSlice(Lt(t),n.parseOptions):m.fromSchema(s).parse(Lt(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${r}`)})}const o=m.fromSchema(e);return n.slice?o.parseSlice(Lt(t),n.parseOptions).content:o.parse(Lt(t),n.parseOptions)}return Ft("",e,n)}function Ht(t,e,n){const r=t.steps.length-1;if(r<e)return;const s=t.steps[r];if(!(s instanceof w||s instanceof x))return;const i=t.mapping.maps[r];let a=0;i.forEach((t,e,n,o)=>{0===a&&(a=o)}),t.setSelection(o.near(t.doc.resolve(a),n))}function Vt(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function _t(t,e,n={}){const{from:o,to:r,empty:s}=t.selection,i=e?Q(e,t.schema):null,a=[];t.doc.nodesBetween(o,r,(t,e)=>{if(t.isText)return;const n=Math.max(o,e),s=Math.min(r,e+t.nodeSize);a.push({node:t,from:n,to:s})});const c=r-o,d=a.filter(t=>!i||i.name===t.node.type.name).filter(t=>Pt(t.node.attrs,n,{strict:!1}));if(s)return!!d.length;return d.reduce((t,e)=>t+e.to-e.from,0)>=c}function Wt(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function qt(t,e){const n="string"==typeof e?[e]:e;return Object.keys(t).reduce((e,o)=>(n.includes(o)||(e[o]=t[o]),e),{})}function Kt(t,e,n={},o={}){return Ft(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:o.errorOnInvalidContent})}function Ut(t,e){const n=It(e,t.schema),{from:o,to:r,empty:s}=t.selection,i=[];s?(t.storedMarks&&i.push(...t.storedMarks),i.push(...t.selection.$head.marks())):t.doc.nodesBetween(o,r,t=>{i.push(...t.marks)});const a=i.find(t=>t.type.name===n.name);return a?{...a.attrs}:{}}function Gt(t,e){const n=new v(t);return e.forEach(t=>{t.steps.forEach(t=>{n.step(t)})}),n}function Jt(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Yt(t,e,n){const o=[];return t.nodesBetween(e.from,e.to,(t,e)=>{n(t)&&o.push({node:t,pos:e})}),o}function Qt(t,e){for(let n=t.depth;n>0;n-=1){const o=t.node(n);if(e(o))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:o}}}function Xt(t){return e=>Qt(e.$from,t)}function Zt(t,e){return St(t,{from:0,to:t.content.size},e)}function te(t,e){const n=Q(e,t.schema),{from:o,to:r}=t.selection,s=[];t.doc.nodesBetween(o,r,t=>{s.push(t)});const i=s.reverse().find(t=>t.type.name===n.name);return i?{...i.attrs}:{}}function ee(t,e){const n=Wt("string"==typeof e?e:e.name,t.schema);return"node"===n?te(t,e):"mark"===n?Ut(t,e):{}}function ne(t,e=JSON.stringify){const n={};return t.filter(t=>{const o=e(t);return!Object.prototype.hasOwnProperty.call(n,o)&&(n[o]=!0)})}function oe(t){const{mapping:e,steps:n}=t,o=[];return e.maps.forEach((t,r)=>{const s=[];if(t.ranges.length)t.forEach((t,e)=>{s.push({from:t,to:e})});else{const{from:t,to:e}=n[r];if(void 0===t||void 0===e)return;s.push({from:t,to:e})}s.forEach(({from:t,to:n})=>{const s=e.slice(r).map(t,-1),i=e.slice(r).map(n),a=e.invert().map(s,-1),c=e.invert().map(i);o.push({oldRange:{from:a,to:c},newRange:{from:s,to:i}})})}),function(t){const e=ne(t);return 1===e.length?e:e.filter((t,n)=>!e.filter((t,e)=>e!==n).some(e=>t.oldRange.from>=e.oldRange.from&&t.oldRange.to<=e.oldRange.to&&t.newRange.from>=e.newRange.from&&t.newRange.to<=e.newRange.to))}(o)}function re(t,e,n){const o=[];return t===e?n.resolve(t).marks().forEach(e=>{const r=jt(n.resolve(t),e.type);r&&o.push({mark:e,...r})}):n.nodesBetween(t,e,(t,e)=>{t&&void 0!==(null==t?void 0:t.nodeSize)&&o.push(...t.marks.map(n=>({from:e,to:e+t.nodeSize,mark:n})))}),o}function se(t,e,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{const o=t.find(t=>t.type===e&&t.name===n);return!!o&&o.attribute.keepOnSplit}))}function ie(t,e,n={}){const{empty:o,ranges:r}=t.selection,s=e?It(e,t.schema):null;if(o)return!!(t.storedMarks||t.selection.$from.marks()).filter(t=>!s||s.name===t.type.name).find(t=>Pt(t.attrs,n,{strict:!1}));let i=0;const a=[];if(r.forEach(({$from:e,$to:n})=>{const o=e.pos,r=n.pos;t.doc.nodesBetween(o,r,(t,e)=>{if(!t.isText&&!t.marks.length)return;const n=Math.max(o,e),s=Math.min(r,e+t.nodeSize);i+=s-n,a.push(...t.marks.map(t=>({mark:t,from:n,to:s})))})}),0===i)return!1;const c=a.filter(t=>!s||s.name===t.mark.type.name).filter(t=>Pt(t.mark.attrs,n,{strict:!1})).reduce((t,e)=>t+e.to-e.from,0),d=a.filter(t=>!s||t.mark.type!==s&&t.mark.type.excludes(s)).reduce((t,e)=>t+e.to-e.from,0);return(c>0?c+d:c)>=i}function ae(t,e,n={}){if(!e)return _t(t,null,n)||ie(t,null,n);const o=Wt(e,t.schema);return"node"===o?_t(t,e,n):"mark"===o&&ie(t,e,n)}function ce(t,e){const{nodeExtensions:n}=J(e),o=n.find(e=>e.name===t);if(!o)return!1;const r=et(G(o,"group",{name:o.name,options:o.options,storage:o.storage}));return"string"==typeof r&&r.split(" ").includes("list")}function de(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var o;if(n){if("hardBreak"===t.type.name)return!0;if(t.isText)return/^\s*$/m.test(null!==(o=t.text)&&void 0!==o?o:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(0===t.content.childCount)return!0;if(e){let o=!0;return t.content.forEach(t=>{!1!==o&&(de(t,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function le(t){return t instanceof n}function pe(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const o=n.filter(t=>null==e?void 0:e.includes(t.type.name));t.tr.ensureMarks(o)}}const ue=(t,e)=>{const n=Xt(t=>t.type===e)(t.selection);if(!n)return!0;const o=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===o)return!0;const r=t.doc.nodeAt(o);return n.node.type!==(null==r?void 0:r.type)||!g(t.doc,n.pos)||(t.join(n.pos),!0)},he=(t,e)=>{const n=Xt(t=>t.type===e)(t.selection);if(!n)return!0;const o=t.doc.resolve(n.start).after(n.depth);if(void 0===o)return!0;const r=t.doc.nodeAt(o);return n.node.type!==(null==r?void 0:r.type)||!g(t.doc,o)||(t.join(o),!0)};var me=Object.freeze({__proto__:null,blur:()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())}),!0),clearContent:(t=!1)=>({commands:e})=>e.setContent("",t),clearNodes:()=>({state:t,tr:e,dispatch:n})=>{const{selection:o}=e,{ranges:r}=o;return!n||(r.forEach(({$from:n,$to:o})=>{t.doc.nodesBetween(n.pos,o.pos,(t,n)=>{if(t.type.isText)return;const{doc:o,mapping:r}=e,s=o.resolve(r.map(n)),i=o.resolve(r.map(n+t.nodeSize)),a=s.blockRange(i);if(!a)return;const c=y(a);if(t.type.isTextblock){const{defaultType:t}=s.parent.contentMatchAt(s.index());e.setNodeMarkup(a.start,t)}(c||0===c)&&e.lift(a,c)})}),!0)},command:t=>e=>t(e),createParagraphNear:()=>({state:t,dispatch:e})=>M(t,e),cut:(t,e)=>({editor:n,tr:o})=>{const{state:s}=n,i=s.doc.slice(t.from,t.to);o.deleteRange(t.from,t.to);const a=o.mapping.map(e);return o.insert(a,i.content),o.setSelection(new r(o.doc.resolve(Math.max(a-1,0)))),!0},deleteCurrentNode:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,o=n.$anchor.node();if(o.content.size>0)return!1;const r=t.selection.$anchor;for(let n=r.depth;n>0;n-=1){if(r.node(n).type===o.type){if(e){const e=r.before(n),o=r.after(n);t.delete(e,o).scrollIntoView()}return!0}}return!1},deleteNode:t=>({tr:e,state:n,dispatch:o})=>{const r=Q(t,n.schema),s=e.selection.$anchor;for(let t=s.depth;t>0;t-=1){if(s.node(t).type===r){if(o){const n=s.before(t),o=s.after(t);e.delete(n,o).scrollIntoView()}return!0}}return!1},deleteRange:t=>({tr:e,dispatch:n})=>{const{from:o,to:r}=t;return n&&e.delete(o,r),!0},deleteSelection:()=>({state:t,dispatch:e})=>E(t,e),enter:()=>({commands:t})=>t.keyboardShortcut("Enter"),exitCode:()=>({state:t,dispatch:e})=>O(t,e),extendMarkRange:(t,e={})=>({tr:n,state:o,dispatch:s})=>{const i=It(t,o.schema),{doc:a,selection:c}=n,{$from:d,from:l,to:p}=c;if(s){const t=jt(d,i,e);if(t&&t.from<=l&&t.to>=p){const e=r.create(a,t.from,t.to);n.setSelection(e)}}return!0},first:t=>e=>{const n="function"==typeof t?t(e):t;for(let t=0;t<n.length;t+=1)if(n[t](e))return!0;return!1},focus:(t=null,e={})=>({editor:n,view:o,tr:r,dispatch:s})=>{e={scrollIntoView:!0,...e};const i=()=>{(Dt()||"Android"===navigator.platform||/android/i.test(navigator.userAgent))&&o.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(o.focus(),(null==e?void 0:e.scrollIntoView)&&n.commands.scrollIntoView())})};if(o.hasFocus()&&null===t||!1===t)return!0;if(s&&null===t&&!Nt(n.state.selection))return i(),!0;const a=Rt(r.doc,t)||n.state.selection,c=n.state.selection.eq(a);return s&&(c||r.setSelection(a),c&&r.storedMarks&&r.setStoredMarks(r.storedMarks),i()),!0},forEach:(t,e)=>n=>t.every((t,o)=>e(t,{...n,index:o})),insertContent:(t,e)=>({tr:n,commands:o})=>o.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),insertContentAt:(t,e,n)=>({tr:o,dispatch:r,editor:s})=>{var i;if(r){let r;const a=t=>{s.emit("contentError",{editor:s,error:t,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...(n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Ft(e,s.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(t){a(t)}try{r=Ft(e,s.schema,{parseOptions:c,errorOnInvalidContent:null!==(i=n.errorOnInvalidContent)&&void 0!==i?i:s.options.enableContentCheck})}catch(t){return a(t),!1}let{from:l,to:p}="number"==typeof t?{from:t,to:t}:{from:t.from,to:t.to},u=!0,h=!0;if(("type"in r?[r]:r).forEach(t=>{t.check(),u=!!u&&(t.isText&&0===t.marks.length),h=!!h&&t.isBlock}),l===p&&h){const{parent:t}=o.doc.resolve(l);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(l-=1,p+=1)}let m;if(u){if(Array.isArray(e))m=e.map(t=>t.text||"").join("");else if(e instanceof d){let t="";e.forEach(e=>{e.text&&(t+=e.text)}),m=t}else m="object"==typeof e&&e&&e.text?e.text:e;o.insertText(m,l,p)}else m=r,o.replaceWith(l,p,m);n.updateSelection&&Ht(o,o.steps.length-1,-1),n.applyInputRules&&o.setMeta("applyInputRules",{from:l,text:m}),n.applyPasteRules&&o.setMeta("applyPasteRules",{from:l,text:m})}return!0},joinBackward:()=>({state:t,dispatch:e})=>T(t,e),joinDown:()=>({state:t,dispatch:e})=>C(t,e),joinForward:()=>({state:t,dispatch:e})=>P(t,e),joinItemBackward:()=>({state:t,dispatch:e,tr:n})=>{try{const o=b(t.doc,t.selection.$from.pos,-1);return null!=o&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},joinItemForward:()=>({state:t,dispatch:e,tr:n})=>{try{const o=b(t.doc,t.selection.$from.pos,1);return null!=o&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},joinTextblockBackward:()=>({state:t,dispatch:e})=>$(t,e),joinTextblockForward:()=>({state:t,dispatch:e})=>A(t,e),joinUp:()=>({state:t,dispatch:e})=>S(t,e),keyboardShortcut:t=>({editor:e,view:n,tr:o,dispatch:r})=>{const s=function(t){const e=t.split(/-(?!$)/);let n,o,r,s,i=e[e.length-1];"Space"===i&&(i=" ");for(let t=0;t<e.length-1;t+=1){const i=e[t];if(/^(cmd|meta|m)$/i.test(i))s=!0;else if(/^a(lt)?$/i.test(i))n=!0;else if(/^(c|ctrl|control)$/i.test(i))o=!0;else if(/^s(hift)?$/i.test(i))r=!0;else{if(!/^mod$/i.test(i))throw new Error(`Unrecognized modifier name: ${i}`);Dt()||Vt()?s=!0:o=!0}}return n&&(i=`Alt-${i}`),o&&(i=`Ctrl-${i}`),s&&(i=`Meta-${i}`),r&&(i=`Shift-${i}`),i}(t).split(/-(?!$)/),i=s.find(t=>!["Alt","Ctrl","Meta","Shift"].includes(t)),a=new KeyboardEvent("keydown",{key:"Space"===i?" ":i,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{n.someProp("handleKeyDown",t=>t(n,a))});return null==c||c.steps.forEach(t=>{const e=t.map(o.mapping);e&&r&&o.maybeStep(e)}),!0},lift:(t,e={})=>({state:n,dispatch:o})=>!!_t(n,Q(t,n.schema),e)&&j(n,o),liftEmptyBlock:()=>({state:t,dispatch:e})=>I(t,e),liftListItem:t=>({state:e,dispatch:n})=>{const o=Q(t,e.schema);return V(o)(e,n)},newlineInCode:()=>({state:t,dispatch:e})=>N(t,e),resetAttributes:(t,e)=>({tr:n,state:o,dispatch:r})=>{let s=null,i=null;const a=Wt("string"==typeof t?t:t.name,o.schema);return!!a&&("node"===a&&(s=Q(t,o.schema)),"mark"===a&&(i=It(t,o.schema)),r&&n.selection.ranges.forEach(t=>{o.doc.nodesBetween(t.$from.pos,t.$to.pos,(t,o)=>{s&&s===t.type&&n.setNodeMarkup(o,void 0,qt(t.attrs,e)),i&&t.marks.length&&t.marks.forEach(r=>{i===r.type&&n.addMark(o,o+t.nodeSize,i.create(qt(r.attrs,e)))})})}),!0)},scrollIntoView:()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),selectAll:()=>({tr:t,dispatch:e})=>{if(e){const e=new s(t.doc);t.setSelection(e)}return!0},selectNodeBackward:()=>({state:t,dispatch:e})=>B(t,e),selectNodeForward:()=>({state:t,dispatch:e})=>R(t,e),selectParentNode:()=>({state:t,dispatch:e})=>D(t,e),selectTextblockEnd:()=>({state:t,dispatch:e})=>z(t,e),selectTextblockStart:()=>({state:t,dispatch:e})=>L(t,e),setContent:(t,e=!1,n={},o={})=>({editor:r,tr:s,dispatch:i,commands:a})=>{var c,d;const{doc:l}=s;if("full"!==n.preserveWhitespace){const a=Kt(t,r.schema,n,{errorOnInvalidContent:null!==(c=o.errorOnInvalidContent)&&void 0!==c?c:r.options.enableContentCheck});return i&&s.replaceWith(0,l.content.size,a).setMeta("preventUpdate",!e),!0}return i&&s.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:n,errorOnInvalidContent:null!==(d=o.errorOnInvalidContent)&&void 0!==d?d:r.options.enableContentCheck})},setMark:(t,e={})=>({tr:n,state:o,dispatch:r})=>{const{selection:s}=n,{empty:i,ranges:a}=s,c=It(t,o.schema);if(r)if(i){const t=Ut(o,c);n.addStoredMark(c.create({...t,...e}))}else a.forEach(t=>{const r=t.$from.pos,s=t.$to.pos;o.doc.nodesBetween(r,s,(t,o)=>{const i=Math.max(o,r),a=Math.min(o+t.nodeSize,s);t.marks.find(t=>t.type===c)?t.marks.forEach(t=>{c===t.type&&n.addMark(i,a,c.create({...t.attrs,...e}))}):n.addMark(i,a,c.create(e))})});return function(t,e,n){var o;const{selection:r}=e;let s=null;if(Nt(r)&&(s=r.$cursor),s){const e=null!==(o=t.storedMarks)&&void 0!==o?o:s.marks();return!!n.isInSet(e)||!e.some(t=>t.type.excludes(n))}const{ranges:i}=r;return i.some(({$from:e,$to:o})=>{let r=0===e.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(n);return t.doc.nodesBetween(e.pos,o.pos,(t,e,o)=>{if(r)return!1;if(t.isInline){const e=!o||o.type.allowsMarkType(n),s=!!n.isInSet(t.marks)||!t.marks.some(t=>t.type.excludes(n));r=e&&s}return!r}),r})}(o,n,c)},setMeta:(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),setNode:(t,e={})=>({state:n,dispatch:o,chain:r})=>{const s=Q(t,n.schema);let i;return n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),s.isTextblock?r().command(({commands:t})=>!!F(s,{...i,...e})(n)||t.clearNodes()).command(({state:t})=>F(s,{...i,...e})(t,o)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:t=>({tr:e,dispatch:o})=>{if(o){const{doc:o}=e,r=Bt(t,0,o.content.size),s=n.create(o,r);e.setSelection(s)}return!0},setTextSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,{from:o,to:s}="number"==typeof t?{from:t,to:t}:t,i=r.atStart(n).from,a=r.atEnd(n).to,c=Bt(o,i,a),d=Bt(s,i,a),l=r.create(n,c,d);e.setSelection(l)}return!0},sinkListItem:t=>({state:e,dispatch:n})=>{const o=Q(t,e.schema);return _(o)(e,n)},splitBlock:({keepMarks:t=!0}={})=>({tr:e,state:o,dispatch:s,editor:i})=>{const{selection:a,doc:c}=e,{$from:d,$to:l}=a,p=se(i.extensionManager.attributes,d.node().type.name,d.node().attrs);if(a instanceof n&&a.node.isBlock)return!(!d.parentOffset||!k(c,d.pos))&&(s&&(t&&pe(o,i.extensionManager.splittableMarks),e.split(d.pos).scrollIntoView()),!0);if(!d.parent.isBlock)return!1;const u=l.parentOffset===l.parent.content.size,h=0===d.depth?void 0:Jt(d.node(-1).contentMatchAt(d.indexAfter(-1)));let m=u&&h?[{type:h,attrs:p}]:void 0,f=k(e.doc,e.mapping.map(d.pos),1,m);if(m||f||!k(e.doc,e.mapping.map(d.pos),1,h?[{type:h}]:void 0)||(f=!0,m=h?[{type:h,attrs:p}]:void 0),s){if(f&&(a instanceof r&&e.deleteSelection(),e.split(e.mapping.map(d.pos),1,m),h&&!u&&!d.parentOffset&&d.parent.type!==h)){const t=e.mapping.map(d.before()),n=e.doc.resolve(t);d.node(-1).canReplaceWith(n.index(),n.index()+1,h)&&e.setNodeMarkup(e.mapping.map(d.before()),h)}t&&pe(o,i.extensionManager.splittableMarks),e.scrollIntoView()}return f},splitListItem:(t,e={})=>({tr:n,state:o,dispatch:s,editor:i})=>{var a;const c=Q(t,o.schema),{$from:p,$to:u}=o.selection,h=o.selection.node;if(h&&h.isBlock||p.depth<2||!p.sameParent(u))return!1;const m=p.node(-1);if(m.type!==c)return!1;const f=i.extensionManager.attributes;if(0===p.parent.content.size&&p.node(-1).childCount===p.indexAfter(-1)){if(2===p.depth||p.node(-3).type!==c||p.index(-2)!==p.node(-2).childCount-1)return!1;if(s){let t=d.empty;const o=p.index(-1)?1:p.index(-2)?2:3;for(let e=p.depth-o;e>=p.depth-3;e-=1)t=d.from(p.node(e).copy(t));const s=p.indexAfter(-1)<p.node(-2).childCount?1:p.indexAfter(-2)<p.node(-3).childCount?2:3,i={...se(f,p.node().type.name,p.node().attrs),...e},u=(null===(a=c.contentMatch.defaultType)||void 0===a?void 0:a.createAndFill(i))||void 0;t=t.append(d.from(c.createAndFill(null,u)||void 0));const h=p.before(p.depth-(o-1));n.replace(h,p.after(-s),new l(t,4-o,0));let m=-1;n.doc.nodesBetween(h,n.doc.content.size,(t,e)=>{if(m>-1)return!1;t.isTextblock&&0===t.content.size&&(m=e+1)}),m>-1&&n.setSelection(r.near(n.doc.resolve(m))),n.scrollIntoView()}return!0}const g=u.pos===p.end()?m.contentMatchAt(0).defaultType:null,v={...se(f,m.type.name,m.attrs),...e},y={...se(f,p.node().type.name,p.node().attrs),...e};n.delete(p.pos,u.pos);const b=g?[{type:c,attrs:v},{type:g,attrs:y}]:[{type:c,attrs:v}];if(!k(n.doc,p.pos,2))return!1;if(s){const{selection:t,storedMarks:e}=o,{splittableMarks:r}=i.extensionManager,a=e||t.$to.parentOffset&&t.$from.marks();if(n.split(p.pos,2,b).scrollIntoView(),!a||!s)return!0;const c=a.filter(t=>r.includes(t.type.name));n.ensureMarks(c)}return!0},toggleList:(t,e,n,o={})=>({editor:r,tr:s,state:i,dispatch:a,chain:c,commands:d,can:l})=>{const{extensions:p,splittableMarks:u}=r.extensionManager,h=Q(t,i.schema),m=Q(e,i.schema),{selection:f,storedMarks:g}=i,{$from:v,$to:y}=f,b=v.blockRange(y),k=g||f.$to.parentOffset&&f.$from.marks();if(!b)return!1;const w=Xt(t=>ce(t.type.name,p))(f);if(b.depth>=1&&w&&b.depth-w.depth<=1){if(w.node.type===h)return d.liftListItem(m);if(ce(w.node.type.name,p)&&h.validContent(w.node.content)&&a)return c().command(()=>(s.setNodeMarkup(w.pos,h),!0)).command(()=>ue(s,h)).command(()=>he(s,h)).run()}return n&&k&&a?c().command(()=>{const t=l().wrapInList(h,o),e=k.filter(t=>u.includes(t.type.name));return s.ensureMarks(e),!!t||d.clearNodes()}).wrapInList(h,o).command(()=>ue(s,h)).command(()=>he(s,h)).run():c().command(()=>!!l().wrapInList(h,o)||d.clearNodes()).wrapInList(h,o).command(()=>ue(s,h)).command(()=>he(s,h)).run()},toggleMark:(t,e={},n={})=>({state:o,commands:r})=>{const{extendEmptyMarkRange:s=!1}=n,i=It(t,o.schema);return ie(o,i,e)?r.unsetMark(i,{extendEmptyMarkRange:s}):r.setMark(i,e)},toggleNode:(t,e,n={})=>({state:o,commands:r})=>{const s=Q(t,o.schema),i=Q(e,o.schema),a=_t(o,s,n);let c;return o.selection.$anchor.sameParent(o.selection.$head)&&(c=o.selection.$anchor.parent.attrs),a?r.setNode(i,c):r.setNode(s,{...c,...n})},toggleWrap:(t,e={})=>({state:n,commands:o})=>{const r=Q(t,n.schema);return _t(n,r,e)?o.lift(r):o.wrapIn(r,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let o=0;o<n.length;o+=1){const r=n[o];let s;if(r.spec.isInputRules&&(s=r.getState(t))){if(e){const e=t.tr,n=s.transform;for(let t=n.steps.length-1;t>=0;t-=1)e.step(n.steps[t].invert(n.docs[t]));if(s.text){const n=e.doc.resolve(s.from).marks();e.replaceWith(s.from,s.to,t.schema.text(s.text,n))}else e.delete(s.from,s.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:o,ranges:r}=n;return o||e&&r.forEach(e=>{t.removeMark(e.$from.pos,e.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:o,dispatch:r})=>{var s;const{extendEmptyMarkRange:i=!1}=e,{selection:a}=n,c=It(t,o.schema),{$from:d,empty:l,ranges:p}=a;if(!r)return!0;if(l&&i){let{from:t,to:e}=a;const o=null===(s=d.marks().find(t=>t.type===c))||void 0===s?void 0:s.attrs,r=jt(d,c,o);r&&(t=r.from,e=r.to),n.removeMark(t,e,c)}else p.forEach(t=>{n.removeMark(t.$from.pos,t.$to.pos,c)});return n.removeStoredMark(c),!0},updateAttributes:(t,e={})=>({tr:n,state:o,dispatch:r})=>{let s=null,i=null;const a=Wt("string"==typeof t?t:t.name,o.schema);return!!a&&("node"===a&&(s=Q(t,o.schema)),"mark"===a&&(i=It(t,o.schema)),r&&n.selection.ranges.forEach(t=>{const r=t.$from.pos,a=t.$to.pos;let c,d,l,p;n.selection.empty?o.doc.nodesBetween(r,a,(t,e)=>{s&&s===t.type&&(l=Math.max(e,r),p=Math.min(e+t.nodeSize,a),c=e,d=t)}):o.doc.nodesBetween(r,a,(t,o)=>{o<r&&s&&s===t.type&&(l=Math.max(o,r),p=Math.min(o+t.nodeSize,a),c=o,d=t),o>=r&&o<=a&&(s&&s===t.type&&n.setNodeMarkup(o,void 0,{...t.attrs,...e}),i&&t.marks.length&&t.marks.forEach(s=>{if(i===s.type){const c=Math.max(o,r),d=Math.min(o+t.nodeSize,a);n.addMark(c,d,i.create({...s.attrs,...e}))}}))}),d&&(void 0!==c&&n.setNodeMarkup(c,void 0,{...d.attrs,...e}),i&&d.marks.length&&d.marks.forEach(t=>{i===t.type&&n.addMark(l,p,i.create({...t.attrs,...e}))}))}),!0)},wrapIn:(t,e={})=>({state:n,dispatch:o})=>{const r=Q(t,n.schema);return H(r,e)(n,o)},wrapInList:(t,e={})=>({state:n,dispatch:o})=>{const r=Q(t,n.schema);return W(r,e)(n,o)}});const fe=Ot.create({name:"commands",addCommands:()=>({...me})}),ge=Ot.create({name:"drop",addProseMirrorPlugins(){return[new t({key:new e("tiptapDrop"),props:{handleDrop:(t,e,n,o)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:o})}}})]}}),ve=Ot.create({name:"editable",addProseMirrorPlugins(){return[new t({key:new e("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ye=new e("focusEvents"),be=Ot.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new t({key:ye,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const o=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(o),!1},blur:(t,n)=>{e.isFocused=!1;const o=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(o),!1}}}})]}}),ke=Ot.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:t})=>[()=>t.undoInputRule(),()=>t.command(({tr:e})=>{const{selection:n,doc:r}=e,{empty:s,$anchor:i}=n,{pos:a,parent:c}=i,d=i.parent.isTextblock&&a>0?e.doc.resolve(a-1):i,l=d.parent.type.spec.isolating,p=i.pos-i.parentOffset,u=l&&1===d.parent.childCount?p===i.pos:o.atStart(r).from===a;return!(!s||!c.type.isTextblock||c.textContent.length||!u||u&&"paragraph"===i.parent.type.name)&&t.clearNodes()}),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:t})=>[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},s={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Dt()||Vt()?s:r},addProseMirrorPlugins(){return[new t({key:new e("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(t=>t.getMeta("composition")))return;const r=t.some(t=>t.docChanged)&&!e.doc.eq(n.doc),s=t.some(t=>t.getMeta("preventClearDocument"));if(!r||s)return;const{empty:i,from:a,to:c}=e.selection,d=o.atStart(e.doc).from,l=o.atEnd(e.doc).to;if(i||!(a===d&&c===l))return;if(!de(n.doc))return;const p=n.tr,u=q({state:n,transaction:p}),{commands:h}=new K({editor:this.editor,state:u});return h.clearNodes(),p.steps.length?p:void 0}})]}}),we=Ot.create({name:"paste",addProseMirrorPlugins(){return[new t({key:new e("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),xe=Ot.create({name:"tabindex",addProseMirrorPlugins(){return[new t({key:new e("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Me{get name(){return this.node.type.name}constructor(t,e,n=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=t,this.editor=e,this.currentNode=o}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return null!==(t=this.actualDepth)&&void 0!==t?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let e=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);e=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:e,to:n},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(0===this.depth)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),e=this.resolvedPos.doc.resolve(t);return new Me(e,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new Me(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new Me(t,this.editor)}get children(){const t=[];return this.node.content.forEach((e,n)=>{const o=e.isBlock&&!e.isTextblock,r=e.isAtom&&!e.isText,s=this.pos+n+(r?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;const i=this.resolvedPos.doc.resolve(s);if(!o&&i.depth<=this.depth)return;const a=new Me(i,this.editor,o,o?e:null);o&&(a.actualDepth=this.depth+1),t.push(new Me(i,this.editor,o,o?e:null))}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,e={}){let n=null,o=this.parent;for(;o&&!n;){if(o.node.type.name===t)if(Object.keys(e).length>0){const t=o.node.attrs,n=Object.keys(e);for(let o=0;o<n.length;o+=1){const r=n[o];if(t[r]!==e[r])break}}else n=o;o=o.parent}return n}querySelector(t,e={}){return this.querySelectorAll(t,e,!0)[0]||null}querySelectorAll(t,e={},n=!1){let o=[];if(!this.children||0===this.children.length)return o;const r=Object.keys(e);return this.children.forEach(s=>{if(!(n&&o.length>0)){if(s.node.type.name===t){r.every(t=>e[t]===s.node.attrs[t])&&o.push(s)}n&&o.length>0||(o=o.concat(s.querySelectorAll(t,e,n)))}}),o}setAttribute(t){const{tr:e}=this.editor.state;e.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(e)}}function Ee(t,e,n){const o=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(null!==o)return o;const r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.setAttribute("data-tiptap-style"+(n?`-${n}`:""),""),r.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(r),r}class Oe extends U{constructor(t={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:t})=>{throw t},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:t,slice:e,moved:n})=>this.options.onDrop(t,e,n)),this.on("paste",({event:t,slice:e})=>this.options.onPaste(t,e)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=Ee('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}',this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,e){const n=tt(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],o=this.state.reconfigure({plugins:n});return this.view.updateState(o),o}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(t=>{const e="string"==typeof t?`${t}$`:t.key;n=n.filter(t=>!t.key.startsWith(e))}),e.length===n.length)return;const o=this.state.reconfigure({plugins:n});return this.view.updateState(o),o}createExtensionManager(){var t,e;const n=[...this.options.enableCoreExtensions?[ve,Tt.configure({blockSeparator:null===(e=null===(t=this.options.coreExtensionOptions)||void 0===t?void 0:t.clipboardTextSerializer)||void 0===e?void 0:e.blockSeparator}),fe,be,ke,xe,ge,we].filter(t=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[t.name]):[],...this.options.extensions].filter(t=>["extension","node","mark"].includes(null==t?void 0:t.type));this.extensionManager=new Et(n,this)}createCommandManager(){this.commandManager=new K({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var t;let e;try{e=Kt(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message)))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(t=>"collaboration"!==t.name),this.createExtensionManager()}}),e=Kt(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=Rt(e,this.options.autofocus);this.view=new a(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...null===(t=this.options.editorProps)||void 0===t?void 0:t.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:i.create({doc:e,selection:n||void 0})});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.createNodeViews(),this.prependClass();this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void t.steps.forEach(t=>{var e;return null===(e=this.capturedTransaction)||void 0===e?void 0:e.step(t)}):void(this.capturedTransaction=t);const e=this.state.apply(t),n=!this.state.selection.eq(e.selection);this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=t.getMeta("focus"),r=t.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:t}),r&&this.emit("blur",{editor:this,event:r.event,transaction:t}),t.docChanged&&!t.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return ee(this.state,t)}isActive(t,e){const n="string"==typeof t?t:null,o="string"==typeof t?e:t;return ae(this.state,n,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return dt(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e="\n\n",textSerializers:n={}}=t||{};return Zt(this.state.doc,{blockSeparator:e,textSerializers:{...Ct(this.schema),...n}})}get isEmpty(){return de(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const t=this.view.dom;t&&t.editor&&delete t.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var t;return!(null===(t=this.view)||void 0===t?void 0:t.docView)}$node(t,e){var n;return(null===(n=this.$doc)||void 0===n?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return(null===(n=this.$doc)||void 0===n?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new Me(e,this)}get $doc(){return this.$pos(0)}}function Se(t){return new ut({find:t.find,handler:({state:e,range:n,match:o})=>{const r=et(t.getAttributes,void 0,o);if(!1===r||null===r)return null;const{tr:s}=e,i=o[o.length-1],a=o[0];if(i){const o=a.search(/\S/),c=n.from+a.indexOf(i),d=c+i.length;if(re(n.from,n.to,e.doc).filter(e=>e.mark.type.excluded.find(n=>n===t.type&&n!==e.mark.type)).filter(t=>t.to>c).length)return null;d<n.to&&s.delete(d,n.to),c>n.from&&s.delete(n.from+o,c);const l=n.from+o+i.length;s.addMark(n.from+o,l,t.type.create(r||{})),s.removeStoredMark(t.type)}}})}function Ce(t){return new ut({find:t.find,handler:({state:e,range:n,match:o})=>{const r=et(t.getAttributes,void 0,o)||{},{tr:s}=e,i=n.from;let a=n.to;const c=t.type.create(r);if(o[1]){let t=i+o[0].lastIndexOf(o[1]);t>a?t=a:a=t+o[1].length;const e=o[0][o[0].length-1];s.insertText(e,i+o[0].length-1),s.replaceWith(t,a,c)}else if(o[0]){const e=t.type.isInline?i:i-1;s.insert(e,t.type.create(r)).delete(s.mapping.map(i),s.mapping.map(a))}s.scrollIntoView()}})}function Te(t){return new ut({find:t.find,handler:({state:e,range:n,match:o})=>{const r=e.doc.resolve(n.from),s=et(t.getAttributes,void 0,o)||{};if(!r.node(-1).canReplaceWith(r.index(-1),r.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)}})}function Pe(t){return new ut({find:t.find,handler:({state:e,range:n,match:o,chain:r})=>{const s=et(t.getAttributes,void 0,o)||{},i=e.tr.delete(n.from,n.to),a=i.doc.resolve(n.from).blockRange(),c=a&&f(a,t.type,s);if(!c)return null;if(i.wrap(a,c),t.keepMarks&&t.editor){const{selection:n,storedMarks:o}=e,{splittableMarks:r}=t.editor.extensionManager,s=o||n.$to.parentOffset&&n.$from.marks();if(s){const t=s.filter(t=>r.includes(t.type.name));i.ensureMarks(t)}}if(t.keepAttributes){const e="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";r().updateAttributes(e,s).run()}const d=i.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&g(i.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(o,d))&&i.join(n.from-1)}})}class $e{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=et(G(this,"addOptions",{name:this.name}))),this.storage=et(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new $e(t)}configure(t={}){const e=this.extend({...this.config,addOptions:()=>gt(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new $e(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=et(G(e,"addOptions",{name:e.name})),e.storage=et(G(e,"addStorage",{name:e.name,options:e.options})),e}}function Ae(t){return new bt({find:t.find,handler:({state:e,range:n,match:o,pasteEvent:r})=>{const s=et(t.getAttributes,void 0,o,r);if(!1===s||null===s)return null;const{tr:i}=e,a=o[o.length-1],c=o[0];let d=n.to;if(a){const o=c.search(/\S/),r=n.from+c.indexOf(a),l=r+a.length;if(re(n.from,n.to,e.doc).filter(e=>e.mark.type.excluded.find(n=>n===t.type&&n!==e.mark.type)).filter(t=>t.to>r).length)return null;l<n.to&&i.delete(l,n.to),r>n.from&&i.delete(n.from+o,r),d=n.from+o+a.length,i.addMark(n.from+o,d,t.type.create(s||{})),i.removeStoredMark(t.type)}}})}function je(t,e){const{selection:o}=t,{$from:r}=o;if(o instanceof n){const t=r.index();return r.parent.canReplaceWith(t,t+1,e)}let s=r.depth;for(;s>=0;){const t=r.index(s);if(r.node(s).contentMatchAt(t).matchType(e))return!0;s-=1}return!1}export{K as CommandManager,Oe as Editor,Ot as Extension,ut as InputRule,vt as Mark,$e as Node,Me as NodePos,bt as PasteRule,et as callOrReturn,je as canInsertNode,Gt as combineTransactionSteps,q as createChainableState,Kt as createDocument,Ft as createNodeFromContent,Ee as createStyleTag,Jt as defaultBlockAt,qt as deleteProps,Lt as elementFromString,Yt as findChildrenInRange,Mt as findDuplicates,Xt as findParentNode,Qt as findParentNodeClosestToPos,ot as fromString,ee as getAttributes,Y as getAttributesFromExtensions,oe as getChangedRanges,G as getExtensionField,dt as getHTMLFromFragment,Ut as getMarkAttributes,jt as getMarkRange,It as getMarkType,re as getMarksBetween,te as getNodeAttributes,Q as getNodeType,Z as getRenderedAttributes,it as getSchemaByResolvedExtensions,at as getSchemaTypeByName,Wt as getSchemaTypeNameByName,se as getSplittedAttributes,Zt as getText,St as getTextBetween,lt as getTextContentFromNodes,Ct as getTextSerializersFromSchema,rt as injectExtensionAttributesToParseRule,mt as inputRulesPlugin,ae as isActive,nt as isEmptyObject,ct as isExtensionRulesEnabled,tt as isFunction,ce as isList,Vt as isMacOS,ie as isMarkActive,_t as isNodeActive,de as isNodeEmpty,le as isNodeSelection,yt as isNumber,ft as isPlainObject,pt as isRegExp,Nt as isTextSelection,Dt as isiOS,Se as markInputRule,Ae as markPasteRule,X as mergeAttributes,gt as mergeDeep,Bt as minMax,Ce as nodeInputRule,Pt as objectIncludes,xt as pasteRulesPlugin,ne as removeDuplicates,Rt as resolveFocusPosition,Ht as selectionToInsertionEnd,J as splitExtensions,Te as textblockTypeInputRule,Pe as wrappingInputRule};
|
|
1
|
+
import{Plugin as t,PluginKey as e,NodeSelection as n,Selection as o,TextSelection as r,AllSelection as s,EditorState as i}from"../../../../../prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.js";import{EditorView as a}from"../../../../../prosemirror-view@1.41.3/node_modules/prosemirror-view/dist/index.js";import{keymap as c}from"../../../../../prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.js";import{Fragment as d,Slice as l,DOMSerializer as p,Node as u,Schema as h,DOMParser as m}from"../../../../../prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.js";import{findWrapping as f,canJoin as g,Transform as v,liftTarget as y,joinPoint as b,canSplit as k,ReplaceStep as w,ReplaceAroundStep as x}from"../../../../../prosemirror-transform@1.10.5/node_modules/prosemirror-transform/dist/index.js";import{createParagraphNear as M,deleteSelection as E,exitCode as O,joinUp as S,joinDown as C,joinBackward as T,joinForward as P,joinTextblockBackward as $,joinTextblockForward as A,lift as j,liftEmptyBlock as I,newlineInCode as N,selectNodeBackward as B,selectNodeForward as R,selectParentNode as D,selectTextblockEnd as z,selectTextblockStart as L,setBlockType as F,wrapIn as H}from"../../../../../prosemirror-commands@1.7.1/node_modules/prosemirror-commands/dist/index.js";import{liftListItem as V,sinkListItem as _,wrapInList as W}from"../../../../../prosemirror-schema-list@1.5.1/node_modules/prosemirror-schema-list/dist/index.js";function q(t){const{state:e,transaction:n}=t;let{selection:o}=n,{doc:r}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return o},get doc(){return r},get tr(){return o=n.selection,r=n.doc,s=n.storedMarks,n}}}class K{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:o}=e,{tr:r}=n,s=this.buildProps(r);return Object.fromEntries(Object.entries(t).map(([t,e])=>[t,(...t)=>{const n=e(...t)(s);return r.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(r),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:o,state:r}=this,{view:s}=o,i=[],a=!!t,c=t||r.tr,d={...Object.fromEntries(Object.entries(n).map(([t,n])=>[t,(...t)=>{const o=this.buildProps(c,e),r=n(...t)(o);return i.push(r),d}])),run:()=>(a||!e||c.getMeta("preventDispatch")||this.hasCustomState||s.dispatch(c),i.every(t=>!0===t))};return d}createCan(t){const{rawCommands:e,state:n}=this,o=!1,r=t||n.tr,s=this.buildProps(r,o),i=Object.fromEntries(Object.entries(e).map(([t,e])=>[t,(...t)=>e(...t)({...s,dispatch:void 0})]));return{...i,chain:()=>this.createChain(r,o)}}buildProps(t,e=!0){const{rawCommands:n,editor:o,state:r}=this,{view:s}=o,i={tr:t,editor:o,view:s,state:q({state:r,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([t,e])=>[t,(...t)=>e(...t)(i)]))}};return i}}class U{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(t=>t.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(t=>t!==e):delete this.callbacks[t]),this}once(t,e){const n=(...o)=>{this.off(t,n),e.apply(this,o)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}}function G(t,e,n){if(void 0===t.config[e]&&t.parent)return G(t.parent,e,n);if("function"==typeof t.config[e]){return t.config[e].bind({...n,parent:t.parent?G(t.parent,e,n):null})}return t.config[e]}function J(t){return{baseExtensions:t.filter(t=>"extension"===t.type),nodeExtensions:t.filter(t=>"node"===t.type),markExtensions:t.filter(t=>"mark"===t.type)}}function Y(t){const e=[],{nodeExtensions:n,markExtensions:o}=J(t),r=[...n,...o],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(t=>{const n=G(t,"addGlobalAttributes",{name:t.name,options:t.options,storage:t.storage,extensions:r});if(!n)return;n().forEach(t=>{t.types.forEach(n=>{Object.entries(t.attributes).forEach(([t,o])=>{e.push({type:n,name:t,attribute:{...s,...o}})})})})}),r.forEach(t=>{const n={name:t.name,options:t.options,storage:t.storage},o=G(t,"addAttributes",n);if(!o)return;const r=o();Object.entries(r).forEach(([n,o])=>{const r={...s,...o};"function"==typeof(null==r?void 0:r.default)&&(r.default=r.default()),(null==r?void 0:r.isRequired)&&void 0===(null==r?void 0:r.default)&&delete r.default,e.push({type:t.name,name:n,attribute:r})})}),e}function Q(t,e){if("string"==typeof t){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function X(...t){return t.filter(t=>!!t).reduce((t,e)=>{const n={...t};return Object.entries(e).forEach(([t,e])=>{if(n[t])if("class"===t){const o=e?String(e).split(" "):[],r=n[t]?n[t].split(" "):[],s=o.filter(t=>!r.includes(t));n[t]=[...r,...s].join(" ")}else if("style"===t){const o=e?e.split(";").map(t=>t.trim()).filter(Boolean):[],r=n[t]?n[t].split(";").map(t=>t.trim()).filter(Boolean):[],s=new Map;r.forEach(t=>{const[e,n]=t.split(":").map(t=>t.trim());s.set(e,n)}),o.forEach(t=>{const[e,n]=t.split(":").map(t=>t.trim());s.set(e,n)}),n[t]=Array.from(s.entries()).map(([t,e])=>`${t}: ${e}`).join("; ")}else n[t]=e;else n[t]=e}),n},{})}function Z(t,e){return e.filter(e=>e.type===t.type.name).filter(t=>t.attribute.rendered).map(e=>e.attribute.renderHTML?e.attribute.renderHTML(t.attrs)||{}:{[e.name]:t.attrs[e.name]}).reduce((t,e)=>X(t,e),{})}function tt(t){return"function"==typeof t}function et(t,e=void 0,...n){return tt(t)?e?t.bind(e)(...n):t(...n):t}function nt(t={}){return 0===Object.keys(t).length&&t.constructor===Object}function ot(t){return"string"!=typeof t?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):"true"===t||"false"!==t&&t}function rt(t,e){return"style"in t?t:{...t,getAttrs:n=>{const o=t.getAttrs?t.getAttrs(n):t.attrs;if(!1===o)return!1;const r=e.reduce((t,e)=>{const o=e.attribute.parseHTML?e.attribute.parseHTML(n):ot(n.getAttribute(e.name));return null==o?t:{...t,[e.name]:o}},{});return{...o,...r}}}}function st(t){return Object.fromEntries(Object.entries(t).filter(([t,e])=>("attrs"!==t||!nt(e))&&null!=e))}function it(t,e){var n;const o=Y(t),{nodeExtensions:r,markExtensions:s}=J(t),i=null===(n=r.find(t=>G(t,"topNode")))||void 0===n?void 0:n.name,a=Object.fromEntries(r.map(n=>{const r=o.filter(t=>t.type===n.name),s={name:n.name,options:n.options,storage:n.storage,editor:e},i=st({...t.reduce((t,e)=>{const o=G(e,"extendNodeSchema",s);return{...t,...o?o(n):{}}},{}),content:et(G(n,"content",s)),marks:et(G(n,"marks",s)),group:et(G(n,"group",s)),inline:et(G(n,"inline",s)),atom:et(G(n,"atom",s)),selectable:et(G(n,"selectable",s)),draggable:et(G(n,"draggable",s)),code:et(G(n,"code",s)),whitespace:et(G(n,"whitespace",s)),linebreakReplacement:et(G(n,"linebreakReplacement",s)),defining:et(G(n,"defining",s)),isolating:et(G(n,"isolating",s)),attrs:Object.fromEntries(r.map(t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]}))}),a=et(G(n,"parseHTML",s));a&&(i.parseDOM=a.map(t=>rt(t,r)));const c=G(n,"renderHTML",s);c&&(i.toDOM=t=>c({node:t,HTMLAttributes:Z(t,r)}));const d=G(n,"renderText",s);return d&&(i.toText=d),[n.name,i]})),c=Object.fromEntries(s.map(n=>{const r=o.filter(t=>t.type===n.name),s={name:n.name,options:n.options,storage:n.storage,editor:e},i=st({...t.reduce((t,e)=>{const o=G(e,"extendMarkSchema",s);return{...t,...o?o(n):{}}},{}),inclusive:et(G(n,"inclusive",s)),excludes:et(G(n,"excludes",s)),group:et(G(n,"group",s)),spanning:et(G(n,"spanning",s)),code:et(G(n,"code",s)),attrs:Object.fromEntries(r.map(t=>{var e;return[t.name,{default:null===(e=null==t?void 0:t.attribute)||void 0===e?void 0:e.default}]}))}),a=et(G(n,"parseHTML",s));a&&(i.parseDOM=a.map(t=>rt(t,r)));const c=G(n,"renderHTML",s);return c&&(i.toDOM=t=>c({mark:t,HTMLAttributes:Z(t,r)})),[n.name,i]}));return new h({topNode:i,nodes:a,marks:c})}function at(t,e){return e.nodes[t]||e.marks[t]||null}function ct(t,e){return Array.isArray(e)?e.some(e=>("string"==typeof e?e:e.name)===t.name):e}function dt(t,e){const n=p.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}const lt=(t,e=500)=>{let n="";const o=t.parentOffset;return t.parent.nodesBetween(Math.max(0,o-e),o,(t,e,r,s)=>{var i,a;const c=(null===(a=(i=t.type.spec).toText)||void 0===a?void 0:a.call(i,{node:t,pos:e,parent:r,index:s}))||t.textContent||"%leaf%";n+=t.isAtom&&!t.isText?c:c.slice(0,Math.max(0,o-e))}),n};function pt(t){return"[object RegExp]"===Object.prototype.toString.call(t)}class ut{constructor(t){this.find=t.find,this.handler=t.handler}}function ht(t){var e;const{editor:n,from:o,to:r,text:s,rules:i,plugin:a}=t,{view:c}=n;if(c.composing)return!1;const d=c.state.doc.resolve(o);if(d.parent.type.spec.code||(null===(e=d.nodeBefore||d.nodeAfter)||void 0===e?void 0:e.marks.find(t=>t.type.spec.code)))return!1;let l=!1;const p=lt(d)+s;return i.forEach(t=>{if(l)return;const e=((t,e)=>{if(pt(e))return e.exec(t);const n=e(t);if(!n)return null;const o=[n.text];return o.index=n.index,o.input=t,o.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),o.push(n.replaceWith)),o})(p,t.find);if(!e)return;const i=c.state.tr,d=q({state:c.state,transaction:i}),u={from:o-(e[0].length-s.length),to:r},{commands:h,chain:m,can:f}=new K({editor:n,state:d});null!==t.handler({state:d,range:u,match:e,commands:h,chain:m,can:f})&&i.steps.length&&(i.setMeta(a,{transform:i,from:o,to:r,text:s}),c.dispatch(i),l=!0)}),l}function mt(e){const{editor:n,rules:o}=e,r=new t({state:{init:()=>null,apply(t,e,s){const i=t.getMeta(r);if(i)return i;const a=t.getMeta("applyInputRules");return!!a&&setTimeout(()=>{let{text:t}=a;"string"==typeof t||(t=dt(d.from(t),s.schema));const{from:e}=a,i=e+t.length;ht({editor:n,from:e,to:i,text:t,rules:o,plugin:r})}),t.selectionSet||t.docChanged?null:e}},props:{handleTextInput:(t,e,s,i)=>ht({editor:n,from:e,to:s,text:i,rules:o,plugin:r}),handleDOMEvents:{compositionend:t=>(setTimeout(()=>{const{$cursor:e}=t.state.selection;e&&ht({editor:n,from:e.pos,to:e.pos,text:"",rules:o,plugin:r})}),!1)},handleKeyDown(t,e){if("Enter"!==e.key)return!1;const{$cursor:s}=t.state.selection;return!!s&&ht({editor:n,from:s.pos,to:s.pos,text:"\n",rules:o,plugin:r})}},isInputRules:!0});return r}function ft(t){return"Object"===function(t){return Object.prototype.toString.call(t).slice(8,-1)}(t)&&(t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype)}function gt(t,e){const n={...t};return ft(t)&&ft(e)&&Object.keys(e).forEach(o=>{ft(e[o])&&ft(t[o])?n[o]=gt(t[o],e[o]):n[o]=e[o]}),n}class vt{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=et(G(this,"addOptions",{name:this.name}))),this.storage=et(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new vt(t)}configure(t={}){const e=this.extend({...this.config,addOptions:()=>gt(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new vt(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=et(G(e,"addOptions",{name:e.name})),e.storage=et(G(e,"addStorage",{name:e.name,options:e.options})),e}static handleExit({editor:t,mark:e}){const{tr:n}=t.state,o=t.state.selection.$from;if(o.pos===o.end()){const r=o.marks();if(!!!r.find(t=>(null==t?void 0:t.type.name)===e.name))return!1;const s=r.find(t=>(null==t?void 0:t.type.name)===e.name);return s&&n.removeStoredMark(s),n.insertText(" ",o.pos),t.view.dispatch(n),!0}return!1}}function yt(t){return"number"==typeof t}class bt{constructor(t){this.find=t.find,this.handler=t.handler}}function kt(t){const{editor:e,state:n,from:o,to:r,rule:s,pasteEvent:i,dropEvent:a}=t,{commands:c,chain:d,can:l}=new K({editor:e,state:n}),p=[];n.doc.nodesBetween(o,r,(t,e)=>{if(!t.isTextblock||t.type.spec.code)return;const u=Math.max(o,e),h=Math.min(r,e+t.content.size);((t,e,n)=>{if(pt(e))return[...t.matchAll(e)];const o=e(t,n);return o?o.map(e=>{const n=[e.text];return n.index=e.index,n.input=t,n.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(e.replaceWith)),n}):[]})(t.textBetween(u-e,h-e,void 0,""),s.find,i).forEach(t=>{if(void 0===t.index)return;const e=u+t.index+1,o=e+t[0].length,r={from:n.tr.mapping.map(e),to:n.tr.mapping.map(o)},h=s.handler({state:n,range:r,match:t,commands:c,chain:d,can:l,pasteEvent:i,dropEvent:a});p.push(h)})});return p.every(t=>null!==t)}let wt=null;function xt(e){const{editor:n,rules:o}=e;let r,s=null,i=!1,a=!1,c="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}const l=({state:t,from:e,to:o,rule:s,pasteEvt:i})=>{const a=t.tr,d=q({state:t,transaction:a});if(kt({editor:n,state:d,from:Math.max(e-1,0),to:o.b-1,rule:s,pasteEvent:i,dropEvent:r})&&a.steps.length){try{r="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{r=null}return c="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,a}};return o.map(e=>new t({view(t){const e=e=>{var o;s=(null===(o=t.dom.parentElement)||void 0===o?void 0:o.contains(e.target))?t.dom.parentElement:null,s&&(wt=n)},o=()=>{wt&&(wt=null)};return window.addEventListener("dragstart",e),window.addEventListener("dragend",o),{destroy(){window.removeEventListener("dragstart",e),window.removeEventListener("dragend",o)}}},props:{handleDOMEvents:{drop:(t,e)=>{if(a=s===t.dom.parentElement,r=e,!a){const t=wt;(null==t?void 0:t.isEditable)&&setTimeout(()=>{const e=t.state.selection;e&&t.commands.deleteRange({from:e.from,to:e.to})},10)}return!1},paste:(t,e)=>{var n;const o=null===(n=e.clipboardData)||void 0===n?void 0:n.getData("text/html");return c=e,i=!!(null==o?void 0:o.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,o)=>{const r=t[0],s="paste"===r.getMeta("uiEvent")&&!i,p="drop"===r.getMeta("uiEvent")&&!a,u=r.getMeta("applyPasteRules"),h=!!u;if(!s&&!p&&!h)return;if(h){let{text:t}=u;"string"==typeof t||(t=dt(d.from(t),o.schema));const{from:n}=u,r=n+t.length,s=(t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null===(e=n.clipboardData)||void 0===e||e.setData("text/html",t),n})(t);return l({rule:e,state:o,from:n,to:{b:r},pasteEvt:s})}const m=n.doc.content.findDiffStart(o.doc.content),f=n.doc.content.findDiffEnd(o.doc.content);return yt(m)&&f&&m!==f.b?l({rule:e,state:o,from:m,to:f,pasteEvt:c}):void 0}}))}function Mt(t){const e=t.filter((e,n)=>t.indexOf(e)!==n);return Array.from(new Set(e))}class Et{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=Et.resolve(t),this.schema=it(this.extensions,e),this.setupExtensions()}static resolve(t){const e=Et.sort(Et.flatten(t)),n=Mt(e.map(t=>t.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(t=>`'${t}'`).join(", ")}]. This can lead to issues.`),e}static flatten(t){return t.map(t=>{const e=G(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return e?[t,...this.flatten(e())]:t}).flat(10)}static sort(t){return t.sort((t,e)=>{const n=G(t,"priority")||100,o=G(e,"priority")||100;return n>o?-1:n<o?1:0})}get commands(){return this.extensions.reduce((t,e)=>{const n=G(e,"addCommands",{name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:at(e.name,this.schema)});return n?{...t,...n()}:t},{})}get plugins(){const{editor:t}=this,e=Et.sort([...this.extensions].reverse()),n=[],o=[],r=e.map(e=>{const r={name:e.name,options:e.options,storage:e.storage,editor:t,type:at(e.name,this.schema)},s=[],i=G(e,"addKeyboardShortcuts",r);let a={};if("mark"===e.type&&G(e,"exitable",r)&&(a.ArrowRight=()=>vt.handleExit({editor:t,mark:e})),i){const e=Object.fromEntries(Object.entries(i()).map(([e,n])=>[e,()=>n({editor:t})]));a={...a,...e}}const d=c(a);s.push(d);const l=G(e,"addInputRules",r);ct(e,t.options.enableInputRules)&&l&&n.push(...l());const p=G(e,"addPasteRules",r);ct(e,t.options.enablePasteRules)&&p&&o.push(...p());const u=G(e,"addProseMirrorPlugins",r);if(u){const t=u();s.push(...t)}return s}).flat();return[mt({editor:t,rules:n}),...xt({editor:t,rules:o}),...r]}get attributes(){return Y(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=J(this.extensions);return Object.fromEntries(e.filter(t=>!!G(t,"addNodeView")).map(e=>{const n=this.attributes.filter(t=>t.type===e.name),o={name:e.name,options:e.options,storage:e.storage,editor:t,type:Q(e.name,this.schema)},r=G(e,"addNodeView",o);if(!r)return[];return[e.name,(o,s,i,a,c)=>{const d=Z(o,n);return r()({node:o,view:s,getPos:i,decorations:a,innerDecorations:c,editor:t,extension:e,HTMLAttributes:d})}]}))}setupExtensions(){this.extensions.forEach(t=>{var e;this.editor.extensionStorage[t.name]=t.storage;const n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:at(t.name,this.schema)};if("mark"===t.type){(null===(e=et(G(t,"keepOnSplit",n)))||void 0===e||e)&&this.splittableMarks.push(t.name)}const o=G(t,"onBeforeCreate",n),r=G(t,"onCreate",n),s=G(t,"onUpdate",n),i=G(t,"onSelectionUpdate",n),a=G(t,"onTransaction",n),c=G(t,"onFocus",n),d=G(t,"onBlur",n),l=G(t,"onDestroy",n);o&&this.editor.on("beforeCreate",o),r&&this.editor.on("create",r),s&&this.editor.on("update",s),i&&this.editor.on("selectionUpdate",i),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),d&&this.editor.on("blur",d),l&&this.editor.on("destroy",l)})}}class Ot{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=et(G(this,"addOptions",{name:this.name}))),this.storage=et(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Ot(t)}configure(t={}){const e=this.extend({...this.config,addOptions:()=>gt(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new Ot({...this.config,...t});return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=et(G(e,"addOptions",{name:e.name})),e.storage=et(G(e,"addStorage",{name:e.name,options:e.options})),e}}function St(t,e,n){const{from:o,to:r}=e,{blockSeparator:s="\n\n",textSerializers:i={}}=n||{};let a="";return t.nodesBetween(o,r,(t,n,c,d)=>{var l;t.isBlock&&n>o&&(a+=s);const p=null==i?void 0:i[t.type.name];if(p)return c&&(a+=p({node:t,pos:n,parent:c,index:d,range:e})),!1;t.isText&&(a+=null===(l=null==t?void 0:t.text)||void 0===l?void 0:l.slice(Math.max(o,n)-n,r-n))}),a}function Ct(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,t])=>t.spec.toText).map(([t,e])=>[t,e.spec.toText]))}const Tt=Ot.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new t({key:new e("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:o,selection:r}=e,{ranges:s}=r,i=Math.min(...s.map(t=>t.$from.pos)),a=Math.max(...s.map(t=>t.$to.pos)),c=Ct(n);return St(o,{from:i,to:a},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}});function Pt(t,e,n={strict:!0}){const o=Object.keys(e);return!o.length||o.every(o=>n.strict?e[o]===t[o]:pt(e[o])?e[o].test(t[o]):e[o]===t[o])}function $t(t,e,n={}){return t.find(t=>t.type===e&&Pt(Object.fromEntries(Object.keys(n).map(e=>[e,t.attrs[e]])),n))}function At(t,e,n={}){return!!$t(t,e,n)}function jt(t,e,n){var o;if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(r.node&&r.node.marks.some(t=>t.type===e)||(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(t=>t.type===e))return;n=n||(null===(o=r.node.marks[0])||void 0===o?void 0:o.attrs);if(!$t([...r.node.marks],e,n))return;let s=r.index,i=t.start()+r.offset,a=s+1,c=i+r.node.nodeSize;for(;s>0&&At([...t.parent.child(s-1).marks],e,n);)s-=1,i-=t.parent.child(s).nodeSize;for(;a<t.parent.childCount&&At([...t.parent.child(a).marks],e,n);)c+=t.parent.child(a).nodeSize,a+=1;return{from:i,to:c}}function It(t,e){if("string"==typeof t){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function Nt(t){return t instanceof r}function Bt(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Rt(t,e=null){if(!e)return null;const n=o.atStart(t),s=o.atEnd(t);if("start"===e||!0===e)return n;if("end"===e)return s;const i=n.from,a=s.to;return"all"===e?r.create(t,Bt(0,i,a),Bt(t.content.size,i,a)):r.create(t,Bt(e,i,a),Bt(e,i,a))}function Dt(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const zt=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const o=e[n];3===o.nodeType&&o.nodeValue&&/^(\n\s\s|\n)$/.test(o.nodeValue)?t.removeChild(o):1===o.nodeType&&zt(o)}return t};function Lt(t){const e=`<body>${t}</body>`,n=(new window.DOMParser).parseFromString(e,"text/html").body;return zt(n)}function Ft(t,e,n){if(t instanceof u||t instanceof d)return t;n={slice:!0,parseOptions:{},...n};const o="string"==typeof t;if("object"==typeof t&&null!==t)try{if(Array.isArray(t)&&t.length>0)return d.fromArray(t.map(t=>e.nodeFromJSON(t)));const o=e.nodeFromJSON(t);return n.errorOnInvalidContent&&o.check(),o}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),Ft("",e,n)}if(o){if(n.errorOnInvalidContent){let o=!1,r="";const s=new h({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:t=>(o=!0,r="string"==typeof t?t:t.outerHTML,null)}]}})});if(n.slice?m.fromSchema(s).parseSlice(Lt(t),n.parseOptions):m.fromSchema(s).parse(Lt(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${r}`)})}const o=m.fromSchema(e);return n.slice?o.parseSlice(Lt(t),n.parseOptions).content:o.parse(Lt(t),n.parseOptions)}return Ft("",e,n)}function Ht(t,e,n){const r=t.steps.length-1;if(r<e)return;const s=t.steps[r];if(!(s instanceof w||s instanceof x))return;const i=t.mapping.maps[r];let a=0;i.forEach((t,e,n,o)=>{0===a&&(a=o)}),t.setSelection(o.near(t.doc.resolve(a),n))}function Vt(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function _t(t,e,n={}){const{from:o,to:r,empty:s}=t.selection,i=e?Q(e,t.schema):null,a=[];t.doc.nodesBetween(o,r,(t,e)=>{if(t.isText)return;const n=Math.max(o,e),s=Math.min(r,e+t.nodeSize);a.push({node:t,from:n,to:s})});const c=r-o,d=a.filter(t=>!i||i.name===t.node.type.name).filter(t=>Pt(t.node.attrs,n,{strict:!1}));if(s)return!!d.length;return d.reduce((t,e)=>t+e.to-e.from,0)>=c}function Wt(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function qt(t,e){const n="string"==typeof e?[e]:e;return Object.keys(t).reduce((e,o)=>(n.includes(o)||(e[o]=t[o]),e),{})}function Kt(t,e,n={},o={}){return Ft(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:o.errorOnInvalidContent})}function Ut(t,e){const n=It(e,t.schema),{from:o,to:r,empty:s}=t.selection,i=[];s?(t.storedMarks&&i.push(...t.storedMarks),i.push(...t.selection.$head.marks())):t.doc.nodesBetween(o,r,t=>{i.push(...t.marks)});const a=i.find(t=>t.type.name===n.name);return a?{...a.attrs}:{}}function Gt(t,e){const n=new v(t);return e.forEach(t=>{t.steps.forEach(t=>{n.step(t)})}),n}function Jt(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Yt(t,e,n){const o=[];return t.nodesBetween(e.from,e.to,(t,e)=>{n(t)&&o.push({node:t,pos:e})}),o}function Qt(t,e){for(let n=t.depth;n>0;n-=1){const o=t.node(n);if(e(o))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:o}}}function Xt(t){return e=>Qt(e.$from,t)}function Zt(t,e){return St(t,{from:0,to:t.content.size},e)}function te(t,e){const n=Q(e,t.schema),{from:o,to:r}=t.selection,s=[];t.doc.nodesBetween(o,r,t=>{s.push(t)});const i=s.reverse().find(t=>t.type.name===n.name);return i?{...i.attrs}:{}}function ee(t,e){const n=Wt("string"==typeof e?e:e.name,t.schema);return"node"===n?te(t,e):"mark"===n?Ut(t,e):{}}function ne(t,e=JSON.stringify){const n={};return t.filter(t=>{const o=e(t);return!Object.prototype.hasOwnProperty.call(n,o)&&(n[o]=!0)})}function oe(t){const{mapping:e,steps:n}=t,o=[];return e.maps.forEach((t,r)=>{const s=[];if(t.ranges.length)t.forEach((t,e)=>{s.push({from:t,to:e})});else{const{from:t,to:e}=n[r];if(void 0===t||void 0===e)return;s.push({from:t,to:e})}s.forEach(({from:t,to:n})=>{const s=e.slice(r).map(t,-1),i=e.slice(r).map(n),a=e.invert().map(s,-1),c=e.invert().map(i);o.push({oldRange:{from:a,to:c},newRange:{from:s,to:i}})})}),function(t){const e=ne(t);return 1===e.length?e:e.filter((t,n)=>!e.filter((t,e)=>e!==n).some(e=>t.oldRange.from>=e.oldRange.from&&t.oldRange.to<=e.oldRange.to&&t.newRange.from>=e.newRange.from&&t.newRange.to<=e.newRange.to))}(o)}function re(t,e,n){const o=[];return t===e?n.resolve(t).marks().forEach(e=>{const r=jt(n.resolve(t),e.type);r&&o.push({mark:e,...r})}):n.nodesBetween(t,e,(t,e)=>{t&&void 0!==(null==t?void 0:t.nodeSize)&&o.push(...t.marks.map(n=>({from:e,to:e+t.nodeSize,mark:n})))}),o}function se(t,e,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{const o=t.find(t=>t.type===e&&t.name===n);return!!o&&o.attribute.keepOnSplit}))}function ie(t,e,n={}){const{empty:o,ranges:r}=t.selection,s=e?It(e,t.schema):null;if(o)return!!(t.storedMarks||t.selection.$from.marks()).filter(t=>!s||s.name===t.type.name).find(t=>Pt(t.attrs,n,{strict:!1}));let i=0;const a=[];if(r.forEach(({$from:e,$to:n})=>{const o=e.pos,r=n.pos;t.doc.nodesBetween(o,r,(t,e)=>{if(!t.isText&&!t.marks.length)return;const n=Math.max(o,e),s=Math.min(r,e+t.nodeSize);i+=s-n,a.push(...t.marks.map(t=>({mark:t,from:n,to:s})))})}),0===i)return!1;const c=a.filter(t=>!s||s.name===t.mark.type.name).filter(t=>Pt(t.mark.attrs,n,{strict:!1})).reduce((t,e)=>t+e.to-e.from,0),d=a.filter(t=>!s||t.mark.type!==s&&t.mark.type.excludes(s)).reduce((t,e)=>t+e.to-e.from,0);return(c>0?c+d:c)>=i}function ae(t,e,n={}){if(!e)return _t(t,null,n)||ie(t,null,n);const o=Wt(e,t.schema);return"node"===o?_t(t,e,n):"mark"===o&&ie(t,e,n)}function ce(t,e){const{nodeExtensions:n}=J(e),o=n.find(e=>e.name===t);if(!o)return!1;const r=et(G(o,"group",{name:o.name,options:o.options,storage:o.storage}));return"string"==typeof r&&r.split(" ").includes("list")}function de(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var o;if(n){if("hardBreak"===t.type.name)return!0;if(t.isText)return/^\s*$/m.test(null!==(o=t.text)&&void 0!==o?o:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(0===t.content.childCount)return!0;if(e){let o=!0;return t.content.forEach(t=>{!1!==o&&(de(t,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function le(t){return t instanceof n}function pe(t,e,n){const o=t.state.doc.content.size,r=Bt(e,0,o),s=Bt(n,0,o),i=t.coordsAtPos(r),a=t.coordsAtPos(s,-1),c=Math.min(i.top,a.top),d=Math.max(i.bottom,a.bottom),l=Math.min(i.left,a.left),p=Math.max(i.right,a.right),u={top:c,bottom:d,left:l,right:p,width:p-l,height:d-c,x:l,y:c};return{...u,toJSON:()=>u}}function ue(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const o=n.filter(t=>null==e?void 0:e.includes(t.type.name));t.tr.ensureMarks(o)}}const he=(t,e)=>{const n=Xt(t=>t.type===e)(t.selection);if(!n)return!0;const o=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===o)return!0;const r=t.doc.nodeAt(o);return n.node.type!==(null==r?void 0:r.type)||!g(t.doc,n.pos)||(t.join(n.pos),!0)},me=(t,e)=>{const n=Xt(t=>t.type===e)(t.selection);if(!n)return!0;const o=t.doc.resolve(n.start).after(n.depth);if(void 0===o)return!0;const r=t.doc.nodeAt(o);return n.node.type!==(null==r?void 0:r.type)||!g(t.doc,o)||(t.join(o),!0)};var fe=Object.freeze({__proto__:null,blur:()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),null===(n=null===window||void 0===window?void 0:window.getSelection())||void 0===n||n.removeAllRanges())}),!0),clearContent:(t=!1)=>({commands:e})=>e.setContent("",t),clearNodes:()=>({state:t,tr:e,dispatch:n})=>{const{selection:o}=e,{ranges:r}=o;return!n||(r.forEach(({$from:n,$to:o})=>{t.doc.nodesBetween(n.pos,o.pos,(t,n)=>{if(t.type.isText)return;const{doc:o,mapping:r}=e,s=o.resolve(r.map(n)),i=o.resolve(r.map(n+t.nodeSize)),a=s.blockRange(i);if(!a)return;const c=y(a);if(t.type.isTextblock){const{defaultType:t}=s.parent.contentMatchAt(s.index());e.setNodeMarkup(a.start,t)}(c||0===c)&&e.lift(a,c)})}),!0)},command:t=>e=>t(e),createParagraphNear:()=>({state:t,dispatch:e})=>M(t,e),cut:(t,e)=>({editor:n,tr:o})=>{const{state:s}=n,i=s.doc.slice(t.from,t.to);o.deleteRange(t.from,t.to);const a=o.mapping.map(e);return o.insert(a,i.content),o.setSelection(new r(o.doc.resolve(Math.max(a-1,0)))),!0},deleteCurrentNode:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,o=n.$anchor.node();if(o.content.size>0)return!1;const r=t.selection.$anchor;for(let n=r.depth;n>0;n-=1){if(r.node(n).type===o.type){if(e){const e=r.before(n),o=r.after(n);t.delete(e,o).scrollIntoView()}return!0}}return!1},deleteNode:t=>({tr:e,state:n,dispatch:o})=>{const r=Q(t,n.schema),s=e.selection.$anchor;for(let t=s.depth;t>0;t-=1){if(s.node(t).type===r){if(o){const n=s.before(t),o=s.after(t);e.delete(n,o).scrollIntoView()}return!0}}return!1},deleteRange:t=>({tr:e,dispatch:n})=>{const{from:o,to:r}=t;return n&&e.delete(o,r),!0},deleteSelection:()=>({state:t,dispatch:e})=>E(t,e),enter:()=>({commands:t})=>t.keyboardShortcut("Enter"),exitCode:()=>({state:t,dispatch:e})=>O(t,e),extendMarkRange:(t,e={})=>({tr:n,state:o,dispatch:s})=>{const i=It(t,o.schema),{doc:a,selection:c}=n,{$from:d,from:l,to:p}=c;if(s){const t=jt(d,i,e);if(t&&t.from<=l&&t.to>=p){const e=r.create(a,t.from,t.to);n.setSelection(e)}}return!0},first:t=>e=>{const n="function"==typeof t?t(e):t;for(let t=0;t<n.length;t+=1)if(n[t](e))return!0;return!1},focus:(t=null,e={})=>({editor:n,view:o,tr:r,dispatch:s})=>{e={scrollIntoView:!0,...e};const i=()=>{(Dt()||"Android"===navigator.platform||/android/i.test(navigator.userAgent))&&o.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(o.focus(),(null==e?void 0:e.scrollIntoView)&&n.commands.scrollIntoView())})};if(o.hasFocus()&&null===t||!1===t)return!0;if(s&&null===t&&!Nt(n.state.selection))return i(),!0;const a=Rt(r.doc,t)||n.state.selection,c=n.state.selection.eq(a);return s&&(c||r.setSelection(a),c&&r.storedMarks&&r.setStoredMarks(r.storedMarks),i()),!0},forEach:(t,e)=>n=>t.every((t,o)=>e(t,{...n,index:o})),insertContent:(t,e)=>({tr:n,commands:o})=>o.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),insertContentAt:(t,e,n)=>({tr:o,dispatch:r,editor:s})=>{var i;if(r){let r;const a=t=>{s.emit("contentError",{editor:s,error:t,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...(n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Ft(e,s.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(t){a(t)}try{r=Ft(e,s.schema,{parseOptions:c,errorOnInvalidContent:null!==(i=n.errorOnInvalidContent)&&void 0!==i?i:s.options.enableContentCheck})}catch(t){return a(t),!1}let{from:l,to:p}="number"==typeof t?{from:t,to:t}:{from:t.from,to:t.to},u=!0,h=!0;if(("type"in r?[r]:r).forEach(t=>{t.check(),u=!!u&&(t.isText&&0===t.marks.length),h=!!h&&t.isBlock}),l===p&&h){const{parent:t}=o.doc.resolve(l);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(l-=1,p+=1)}let m;if(u){if(Array.isArray(e))m=e.map(t=>t.text||"").join("");else if(e instanceof d){let t="";e.forEach(e=>{e.text&&(t+=e.text)}),m=t}else m="object"==typeof e&&e&&e.text?e.text:e;o.insertText(m,l,p)}else m=r,o.replaceWith(l,p,m);n.updateSelection&&Ht(o,o.steps.length-1,-1),n.applyInputRules&&o.setMeta("applyInputRules",{from:l,text:m}),n.applyPasteRules&&o.setMeta("applyPasteRules",{from:l,text:m})}return!0},joinBackward:()=>({state:t,dispatch:e})=>T(t,e),joinDown:()=>({state:t,dispatch:e})=>C(t,e),joinForward:()=>({state:t,dispatch:e})=>P(t,e),joinItemBackward:()=>({state:t,dispatch:e,tr:n})=>{try{const o=b(t.doc,t.selection.$from.pos,-1);return null!=o&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},joinItemForward:()=>({state:t,dispatch:e,tr:n})=>{try{const o=b(t.doc,t.selection.$from.pos,1);return null!=o&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},joinTextblockBackward:()=>({state:t,dispatch:e})=>$(t,e),joinTextblockForward:()=>({state:t,dispatch:e})=>A(t,e),joinUp:()=>({state:t,dispatch:e})=>S(t,e),keyboardShortcut:t=>({editor:e,view:n,tr:o,dispatch:r})=>{const s=function(t){const e=t.split(/-(?!$)/);let n,o,r,s,i=e[e.length-1];"Space"===i&&(i=" ");for(let t=0;t<e.length-1;t+=1){const i=e[t];if(/^(cmd|meta|m)$/i.test(i))s=!0;else if(/^a(lt)?$/i.test(i))n=!0;else if(/^(c|ctrl|control)$/i.test(i))o=!0;else if(/^s(hift)?$/i.test(i))r=!0;else{if(!/^mod$/i.test(i))throw new Error(`Unrecognized modifier name: ${i}`);Dt()||Vt()?s=!0:o=!0}}return n&&(i=`Alt-${i}`),o&&(i=`Ctrl-${i}`),s&&(i=`Meta-${i}`),r&&(i=`Shift-${i}`),i}(t).split(/-(?!$)/),i=s.find(t=>!["Alt","Ctrl","Meta","Shift"].includes(t)),a=new KeyboardEvent("keydown",{key:"Space"===i?" ":i,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{n.someProp("handleKeyDown",t=>t(n,a))});return null==c||c.steps.forEach(t=>{const e=t.map(o.mapping);e&&r&&o.maybeStep(e)}),!0},lift:(t,e={})=>({state:n,dispatch:o})=>!!_t(n,Q(t,n.schema),e)&&j(n,o),liftEmptyBlock:()=>({state:t,dispatch:e})=>I(t,e),liftListItem:t=>({state:e,dispatch:n})=>{const o=Q(t,e.schema);return V(o)(e,n)},newlineInCode:()=>({state:t,dispatch:e})=>N(t,e),resetAttributes:(t,e)=>({tr:n,state:o,dispatch:r})=>{let s=null,i=null;const a=Wt("string"==typeof t?t:t.name,o.schema);return!!a&&("node"===a&&(s=Q(t,o.schema)),"mark"===a&&(i=It(t,o.schema)),r&&n.selection.ranges.forEach(t=>{o.doc.nodesBetween(t.$from.pos,t.$to.pos,(t,o)=>{s&&s===t.type&&n.setNodeMarkup(o,void 0,qt(t.attrs,e)),i&&t.marks.length&&t.marks.forEach(r=>{i===r.type&&n.addMark(o,o+t.nodeSize,i.create(qt(r.attrs,e)))})})}),!0)},scrollIntoView:()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),selectAll:()=>({tr:t,dispatch:e})=>{if(e){const e=new s(t.doc);t.setSelection(e)}return!0},selectNodeBackward:()=>({state:t,dispatch:e})=>B(t,e),selectNodeForward:()=>({state:t,dispatch:e})=>R(t,e),selectParentNode:()=>({state:t,dispatch:e})=>D(t,e),selectTextblockEnd:()=>({state:t,dispatch:e})=>z(t,e),selectTextblockStart:()=>({state:t,dispatch:e})=>L(t,e),setContent:(t,e=!1,n={},o={})=>({editor:r,tr:s,dispatch:i,commands:a})=>{var c,d;const{doc:l}=s;if("full"!==n.preserveWhitespace){const a=Kt(t,r.schema,n,{errorOnInvalidContent:null!==(c=o.errorOnInvalidContent)&&void 0!==c?c:r.options.enableContentCheck});return i&&s.replaceWith(0,l.content.size,a).setMeta("preventUpdate",!e),!0}return i&&s.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:n,errorOnInvalidContent:null!==(d=o.errorOnInvalidContent)&&void 0!==d?d:r.options.enableContentCheck})},setMark:(t,e={})=>({tr:n,state:o,dispatch:r})=>{const{selection:s}=n,{empty:i,ranges:a}=s,c=It(t,o.schema);if(r)if(i){const t=Ut(o,c);n.addStoredMark(c.create({...t,...e}))}else a.forEach(t=>{const r=t.$from.pos,s=t.$to.pos;o.doc.nodesBetween(r,s,(t,o)=>{const i=Math.max(o,r),a=Math.min(o+t.nodeSize,s);t.marks.find(t=>t.type===c)?t.marks.forEach(t=>{c===t.type&&n.addMark(i,a,c.create({...t.attrs,...e}))}):n.addMark(i,a,c.create(e))})});return function(t,e,n){var o;const{selection:r}=e;let s=null;if(Nt(r)&&(s=r.$cursor),s){const e=null!==(o=t.storedMarks)&&void 0!==o?o:s.marks();return!!n.isInSet(e)||!e.some(t=>t.type.excludes(n))}const{ranges:i}=r;return i.some(({$from:e,$to:o})=>{let r=0===e.depth&&t.doc.inlineContent&&t.doc.type.allowsMarkType(n);return t.doc.nodesBetween(e.pos,o.pos,(t,e,o)=>{if(r)return!1;if(t.isInline){const e=!o||o.type.allowsMarkType(n),s=!!n.isInSet(t.marks)||!t.marks.some(t=>t.type.excludes(n));r=e&&s}return!r}),r})}(o,n,c)},setMeta:(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),setNode:(t,e={})=>({state:n,dispatch:o,chain:r})=>{const s=Q(t,n.schema);let i;return n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),s.isTextblock?r().command(({commands:t})=>!!F(s,{...i,...e})(n)||t.clearNodes()).command(({state:t})=>F(s,{...i,...e})(t,o)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:t=>({tr:e,dispatch:o})=>{if(o){const{doc:o}=e,r=Bt(t,0,o.content.size),s=n.create(o,r);e.setSelection(s)}return!0},setTextSelection:t=>({tr:e,dispatch:n})=>{if(n){const{doc:n}=e,{from:o,to:s}="number"==typeof t?{from:t,to:t}:t,i=r.atStart(n).from,a=r.atEnd(n).to,c=Bt(o,i,a),d=Bt(s,i,a),l=r.create(n,c,d);e.setSelection(l)}return!0},sinkListItem:t=>({state:e,dispatch:n})=>{const o=Q(t,e.schema);return _(o)(e,n)},splitBlock:({keepMarks:t=!0}={})=>({tr:e,state:o,dispatch:s,editor:i})=>{const{selection:a,doc:c}=e,{$from:d,$to:l}=a,p=se(i.extensionManager.attributes,d.node().type.name,d.node().attrs);if(a instanceof n&&a.node.isBlock)return!(!d.parentOffset||!k(c,d.pos))&&(s&&(t&&ue(o,i.extensionManager.splittableMarks),e.split(d.pos).scrollIntoView()),!0);if(!d.parent.isBlock)return!1;const u=l.parentOffset===l.parent.content.size,h=0===d.depth?void 0:Jt(d.node(-1).contentMatchAt(d.indexAfter(-1)));let m=u&&h?[{type:h,attrs:p}]:void 0,f=k(e.doc,e.mapping.map(d.pos),1,m);if(m||f||!k(e.doc,e.mapping.map(d.pos),1,h?[{type:h}]:void 0)||(f=!0,m=h?[{type:h,attrs:p}]:void 0),s){if(f&&(a instanceof r&&e.deleteSelection(),e.split(e.mapping.map(d.pos),1,m),h&&!u&&!d.parentOffset&&d.parent.type!==h)){const t=e.mapping.map(d.before()),n=e.doc.resolve(t);d.node(-1).canReplaceWith(n.index(),n.index()+1,h)&&e.setNodeMarkup(e.mapping.map(d.before()),h)}t&&ue(o,i.extensionManager.splittableMarks),e.scrollIntoView()}return f},splitListItem:(t,e={})=>({tr:n,state:o,dispatch:s,editor:i})=>{var a;const c=Q(t,o.schema),{$from:p,$to:u}=o.selection,h=o.selection.node;if(h&&h.isBlock||p.depth<2||!p.sameParent(u))return!1;const m=p.node(-1);if(m.type!==c)return!1;const f=i.extensionManager.attributes;if(0===p.parent.content.size&&p.node(-1).childCount===p.indexAfter(-1)){if(2===p.depth||p.node(-3).type!==c||p.index(-2)!==p.node(-2).childCount-1)return!1;if(s){let t=d.empty;const o=p.index(-1)?1:p.index(-2)?2:3;for(let e=p.depth-o;e>=p.depth-3;e-=1)t=d.from(p.node(e).copy(t));const s=p.indexAfter(-1)<p.node(-2).childCount?1:p.indexAfter(-2)<p.node(-3).childCount?2:3,i={...se(f,p.node().type.name,p.node().attrs),...e},u=(null===(a=c.contentMatch.defaultType)||void 0===a?void 0:a.createAndFill(i))||void 0;t=t.append(d.from(c.createAndFill(null,u)||void 0));const h=p.before(p.depth-(o-1));n.replace(h,p.after(-s),new l(t,4-o,0));let m=-1;n.doc.nodesBetween(h,n.doc.content.size,(t,e)=>{if(m>-1)return!1;t.isTextblock&&0===t.content.size&&(m=e+1)}),m>-1&&n.setSelection(r.near(n.doc.resolve(m))),n.scrollIntoView()}return!0}const g=u.pos===p.end()?m.contentMatchAt(0).defaultType:null,v={...se(f,m.type.name,m.attrs),...e},y={...se(f,p.node().type.name,p.node().attrs),...e};n.delete(p.pos,u.pos);const b=g?[{type:c,attrs:v},{type:g,attrs:y}]:[{type:c,attrs:v}];if(!k(n.doc,p.pos,2))return!1;if(s){const{selection:t,storedMarks:e}=o,{splittableMarks:r}=i.extensionManager,a=e||t.$to.parentOffset&&t.$from.marks();if(n.split(p.pos,2,b).scrollIntoView(),!a||!s)return!0;const c=a.filter(t=>r.includes(t.type.name));n.ensureMarks(c)}return!0},toggleList:(t,e,n,o={})=>({editor:r,tr:s,state:i,dispatch:a,chain:c,commands:d,can:l})=>{const{extensions:p,splittableMarks:u}=r.extensionManager,h=Q(t,i.schema),m=Q(e,i.schema),{selection:f,storedMarks:g}=i,{$from:v,$to:y}=f,b=v.blockRange(y),k=g||f.$to.parentOffset&&f.$from.marks();if(!b)return!1;const w=Xt(t=>ce(t.type.name,p))(f);if(b.depth>=1&&w&&b.depth-w.depth<=1){if(w.node.type===h)return d.liftListItem(m);if(ce(w.node.type.name,p)&&h.validContent(w.node.content)&&a)return c().command(()=>(s.setNodeMarkup(w.pos,h),!0)).command(()=>he(s,h)).command(()=>me(s,h)).run()}return n&&k&&a?c().command(()=>{const t=l().wrapInList(h,o),e=k.filter(t=>u.includes(t.type.name));return s.ensureMarks(e),!!t||d.clearNodes()}).wrapInList(h,o).command(()=>he(s,h)).command(()=>me(s,h)).run():c().command(()=>!!l().wrapInList(h,o)||d.clearNodes()).wrapInList(h,o).command(()=>he(s,h)).command(()=>me(s,h)).run()},toggleMark:(t,e={},n={})=>({state:o,commands:r})=>{const{extendEmptyMarkRange:s=!1}=n,i=It(t,o.schema);return ie(o,i,e)?r.unsetMark(i,{extendEmptyMarkRange:s}):r.setMark(i,e)},toggleNode:(t,e,n={})=>({state:o,commands:r})=>{const s=Q(t,o.schema),i=Q(e,o.schema),a=_t(o,s,n);let c;return o.selection.$anchor.sameParent(o.selection.$head)&&(c=o.selection.$anchor.parent.attrs),a?r.setNode(i,c):r.setNode(s,{...c,...n})},toggleWrap:(t,e={})=>({state:n,commands:o})=>{const r=Q(t,n.schema);return _t(n,r,e)?o.lift(r):o.wrapIn(r,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let o=0;o<n.length;o+=1){const r=n[o];let s;if(r.spec.isInputRules&&(s=r.getState(t))){if(e){const e=t.tr,n=s.transform;for(let t=n.steps.length-1;t>=0;t-=1)e.step(n.steps[t].invert(n.docs[t]));if(s.text){const n=e.doc.resolve(s.from).marks();e.replaceWith(s.from,s.to,t.schema.text(s.text,n))}else e.delete(s.from,s.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:o,ranges:r}=n;return o||e&&r.forEach(e=>{t.removeMark(e.$from.pos,e.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:o,dispatch:r})=>{var s;const{extendEmptyMarkRange:i=!1}=e,{selection:a}=n,c=It(t,o.schema),{$from:d,empty:l,ranges:p}=a;if(!r)return!0;if(l&&i){let{from:t,to:e}=a;const o=null===(s=d.marks().find(t=>t.type===c))||void 0===s?void 0:s.attrs,r=jt(d,c,o);r&&(t=r.from,e=r.to),n.removeMark(t,e,c)}else p.forEach(t=>{n.removeMark(t.$from.pos,t.$to.pos,c)});return n.removeStoredMark(c),!0},updateAttributes:(t,e={})=>({tr:n,state:o,dispatch:r})=>{let s=null,i=null;const a=Wt("string"==typeof t?t:t.name,o.schema);return!!a&&("node"===a&&(s=Q(t,o.schema)),"mark"===a&&(i=It(t,o.schema)),r&&n.selection.ranges.forEach(t=>{const r=t.$from.pos,a=t.$to.pos;let c,d,l,p;n.selection.empty?o.doc.nodesBetween(r,a,(t,e)=>{s&&s===t.type&&(l=Math.max(e,r),p=Math.min(e+t.nodeSize,a),c=e,d=t)}):o.doc.nodesBetween(r,a,(t,o)=>{o<r&&s&&s===t.type&&(l=Math.max(o,r),p=Math.min(o+t.nodeSize,a),c=o,d=t),o>=r&&o<=a&&(s&&s===t.type&&n.setNodeMarkup(o,void 0,{...t.attrs,...e}),i&&t.marks.length&&t.marks.forEach(s=>{if(i===s.type){const c=Math.max(o,r),d=Math.min(o+t.nodeSize,a);n.addMark(c,d,i.create({...s.attrs,...e}))}}))}),d&&(void 0!==c&&n.setNodeMarkup(c,void 0,{...d.attrs,...e}),i&&d.marks.length&&d.marks.forEach(t=>{i===t.type&&n.addMark(l,p,i.create({...t.attrs,...e}))}))}),!0)},wrapIn:(t,e={})=>({state:n,dispatch:o})=>{const r=Q(t,n.schema);return H(r,e)(n,o)},wrapInList:(t,e={})=>({state:n,dispatch:o})=>{const r=Q(t,n.schema);return W(r,e)(n,o)}});const ge=Ot.create({name:"commands",addCommands:()=>({...fe})}),ve=Ot.create({name:"drop",addProseMirrorPlugins(){return[new t({key:new e("tiptapDrop"),props:{handleDrop:(t,e,n,o)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:o})}}})]}}),ye=Ot.create({name:"editable",addProseMirrorPlugins(){return[new t({key:new e("editable"),props:{editable:()=>this.editor.options.editable}})]}}),be=new e("focusEvents"),ke=Ot.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new t({key:be,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const o=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(o),!1},blur:(t,n)=>{e.isFocused=!1;const o=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(o),!1}}}})]}}),we=Ot.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:t})=>[()=>t.undoInputRule(),()=>t.command(({tr:e})=>{const{selection:n,doc:r}=e,{empty:s,$anchor:i}=n,{pos:a,parent:c}=i,d=i.parent.isTextblock&&a>0?e.doc.resolve(a-1):i,l=d.parent.type.spec.isolating,p=i.pos-i.parentOffset,u=l&&1===d.parent.childCount?p===i.pos:o.atStart(r).from===a;return!(!s||!c.type.isTextblock||c.textContent.length||!u||u&&"paragraph"===i.parent.type.name)&&t.clearNodes()}),()=>t.deleteSelection(),()=>t.joinBackward(),()=>t.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:t})=>[()=>t.deleteSelection(),()=>t.deleteCurrentNode(),()=>t.joinForward(),()=>t.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:t})=>[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),()=>t.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},s={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Dt()||Vt()?s:r},addProseMirrorPlugins(){return[new t({key:new e("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(t=>t.getMeta("composition")))return;const r=t.some(t=>t.docChanged)&&!e.doc.eq(n.doc),s=t.some(t=>t.getMeta("preventClearDocument"));if(!r||s)return;const{empty:i,from:a,to:c}=e.selection,d=o.atStart(e.doc).from,l=o.atEnd(e.doc).to;if(i||!(a===d&&c===l))return;if(!de(n.doc))return;const p=n.tr,u=q({state:n,transaction:p}),{commands:h}=new K({editor:this.editor,state:u});return h.clearNodes(),p.steps.length?p:void 0}})]}}),xe=Ot.create({name:"paste",addProseMirrorPlugins(){return[new t({key:new e("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),Me=Ot.create({name:"tabindex",addProseMirrorPlugins(){return[new t({key:new e("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Ee{get name(){return this.node.type.name}constructor(t,e,n=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=t,this.editor=e,this.currentNode=o}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return null!==(t=this.actualDepth)&&void 0!==t?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let e=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);e=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:e,to:n},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(0===this.depth)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),e=this.resolvedPos.doc.resolve(t);return new Ee(e,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new Ee(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new Ee(t,this.editor)}get children(){const t=[];return this.node.content.forEach((e,n)=>{const o=e.isBlock&&!e.isTextblock,r=e.isAtom&&!e.isText,s=this.pos+n+(r?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;const i=this.resolvedPos.doc.resolve(s);if(!o&&i.depth<=this.depth)return;const a=new Ee(i,this.editor,o,o?e:null);o&&(a.actualDepth=this.depth+1),t.push(new Ee(i,this.editor,o,o?e:null))}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,e={}){let n=null,o=this.parent;for(;o&&!n;){if(o.node.type.name===t)if(Object.keys(e).length>0){const t=o.node.attrs,n=Object.keys(e);for(let o=0;o<n.length;o+=1){const r=n[o];if(t[r]!==e[r])break}}else n=o;o=o.parent}return n}querySelector(t,e={}){return this.querySelectorAll(t,e,!0)[0]||null}querySelectorAll(t,e={},n=!1){let o=[];if(!this.children||0===this.children.length)return o;const r=Object.keys(e);return this.children.forEach(s=>{if(!(n&&o.length>0)){if(s.node.type.name===t){r.every(t=>e[t]===s.node.attrs[t])&&o.push(s)}n&&o.length>0||(o=o.concat(s.querySelectorAll(t,e,n)))}}),o}setAttribute(t){const{tr:e}=this.editor.state;e.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(e)}}function Oe(t,e,n){const o=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(null!==o)return o;const r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.setAttribute("data-tiptap-style"+(n?`-${n}`:""),""),r.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(r),r}class Se extends U{constructor(t={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:t})=>{throw t},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:t,slice:e,moved:n})=>this.options.onDrop(t,e,n)),this.on("paste",({event:t,slice:e})=>this.options.onPaste(t,e)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=Oe('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 0 !important;\n height: 0 !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}',this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,e){const n=tt(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],o=this.state.reconfigure({plugins:n});return this.view.updateState(o),o}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(t=>{const e="string"==typeof t?`${t}$`:t.key;n=n.filter(t=>!t.key.startsWith(e))}),e.length===n.length)return;const o=this.state.reconfigure({plugins:n});return this.view.updateState(o),o}createExtensionManager(){var t,e;const n=[...this.options.enableCoreExtensions?[ye,Tt.configure({blockSeparator:null===(e=null===(t=this.options.coreExtensionOptions)||void 0===t?void 0:t.clipboardTextSerializer)||void 0===e?void 0:e.blockSeparator}),ge,ke,we,Me,ve,xe].filter(t=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[t.name]):[],...this.options.extensions].filter(t=>["extension","node","mark"].includes(null==t?void 0:t.type));this.extensionManager=new Et(n,this)}createCommandManager(){this.commandManager=new K({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var t;let e;try{e=Kt(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message)))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(t=>"collaboration"!==t.name),this.createExtensionManager()}}),e=Kt(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=Rt(e,this.options.autofocus);this.view=new a(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...null===(t=this.options.editorProps)||void 0===t?void 0:t.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:i.create({doc:e,selection:n||void 0})});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.createNodeViews(),this.prependClass();this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void t.steps.forEach(t=>{var e;return null===(e=this.capturedTransaction)||void 0===e?void 0:e.step(t)}):void(this.capturedTransaction=t);const e=this.state.apply(t),n=!this.state.selection.eq(e.selection);this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=t.getMeta("focus"),r=t.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:t}),r&&this.emit("blur",{editor:this,event:r.event,transaction:t}),t.docChanged&&!t.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return ee(this.state,t)}isActive(t,e){const n="string"==typeof t?t:null,o="string"==typeof t?e:t;return ae(this.state,n,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return dt(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e="\n\n",textSerializers:n={}}=t||{};return Zt(this.state.doc,{blockSeparator:e,textSerializers:{...Ct(this.schema),...n}})}get isEmpty(){return de(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const t=this.view.dom;t&&t.editor&&delete t.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var t;return!(null===(t=this.view)||void 0===t?void 0:t.docView)}$node(t,e){var n;return(null===(n=this.$doc)||void 0===n?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return(null===(n=this.$doc)||void 0===n?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new Ee(e,this)}get $doc(){return this.$pos(0)}}function Ce(t){return new ut({find:t.find,handler:({state:e,range:n,match:o})=>{const r=et(t.getAttributes,void 0,o);if(!1===r||null===r)return null;const{tr:s}=e,i=o[o.length-1],a=o[0];if(i){const o=a.search(/\S/),c=n.from+a.indexOf(i),d=c+i.length;if(re(n.from,n.to,e.doc).filter(e=>e.mark.type.excluded.find(n=>n===t.type&&n!==e.mark.type)).filter(t=>t.to>c).length)return null;d<n.to&&s.delete(d,n.to),c>n.from&&s.delete(n.from+o,c);const l=n.from+o+i.length;s.addMark(n.from+o,l,t.type.create(r||{})),s.removeStoredMark(t.type)}}})}function Te(t){return new ut({find:t.find,handler:({state:e,range:n,match:o})=>{const r=et(t.getAttributes,void 0,o)||{},{tr:s}=e,i=n.from;let a=n.to;const c=t.type.create(r);if(o[1]){let t=i+o[0].lastIndexOf(o[1]);t>a?t=a:a=t+o[1].length;const e=o[0][o[0].length-1];s.insertText(e,i+o[0].length-1),s.replaceWith(t,a,c)}else if(o[0]){const e=t.type.isInline?i:i-1;s.insert(e,t.type.create(r)).delete(s.mapping.map(i),s.mapping.map(a))}s.scrollIntoView()}})}function Pe(t){return new ut({find:t.find,handler:({state:e,range:n,match:o})=>{const r=e.doc.resolve(n.from),s=et(t.getAttributes,void 0,o)||{};if(!r.node(-1).canReplaceWith(r.index(-1),r.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)}})}function $e(t){return new ut({find:t.find,handler:({state:e,range:n,match:o})=>{let r=t.replace,s=n.from;const i=n.to;if(o[1]){const t=o[0].lastIndexOf(o[1]);r+=o[0].slice(t+o[1].length),s+=t;const e=s-i;e>0&&(r=o[0].slice(t-e,t)+r,s=i)}e.tr.insertText(r,s,i)}})}function Ae(t){return new ut({find:t.find,handler:({state:e,range:n,match:o,chain:r})=>{const s=et(t.getAttributes,void 0,o)||{},i=e.tr.delete(n.from,n.to),a=i.doc.resolve(n.from).blockRange(),c=a&&f(a,t.type,s);if(!c)return null;if(i.wrap(a,c),t.keepMarks&&t.editor){const{selection:n,storedMarks:o}=e,{splittableMarks:r}=t.editor.extensionManager,s=o||n.$to.parentOffset&&n.$from.marks();if(s){const t=s.filter(t=>r.includes(t.type.name));i.ensureMarks(t)}}if(t.keepAttributes){const e="bulletList"===t.type.name||"orderedList"===t.type.name?"listItem":"taskList";r().updateAttributes(e,s).run()}const d=i.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&g(i.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(o,d))&&i.join(n.from-1)}})}class je{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=et(G(this,"addOptions",{name:this.name}))),this.storage=et(G(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new je(t)}configure(t={}){const e=this.extend({...this.config,addOptions:()=>gt(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new je(t);return e.parent=this,this.child=e,e.name=t.name?t.name:e.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${e.name}".`),e.options=et(G(e,"addOptions",{name:e.name})),e.storage=et(G(e,"addStorage",{name:e.name,options:e.options})),e}}function Ie(t){return new bt({find:t.find,handler:({state:e,range:n,match:o,pasteEvent:r})=>{const s=et(t.getAttributes,void 0,o,r);if(!1===s||null===s)return null;const{tr:i}=e,a=o[o.length-1],c=o[0];let d=n.to;if(a){const o=c.search(/\S/),r=n.from+c.indexOf(a),l=r+a.length;if(re(n.from,n.to,e.doc).filter(e=>e.mark.type.excluded.find(n=>n===t.type&&n!==e.mark.type)).filter(t=>t.to>r).length)return null;l<n.to&&i.delete(l,n.to),r>n.from&&i.delete(n.from+o,r),d=n.from+o+a.length,i.addMark(n.from+o,d,t.type.create(s||{})),i.removeStoredMark(t.type)}}})}function Ne(t,e){const{selection:o}=t,{$from:r}=o;if(o instanceof n){const t=r.index();return r.parent.canReplaceWith(t,t+1,e)}let s=r.depth;for(;s>=0;){const t=r.index(s);if(r.node(s).contentMatchAt(t).matchType(e))return!0;s-=1}return!1}function Be(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function Re(t){return new bt({find:t.find,handler({match:e,chain:n,range:o,pasteEvent:r}){const s=et(t.getAttributes,void 0,e,r),i=et(t.getContent,void 0,s);if(!1===s||null===s)return null;const a={type:t.type.name,attrs:s};i&&(a.content=i),e.input&&n().deleteRange(o).insertContentAt(o.from,a)}})}export{K as CommandManager,Se as Editor,Ot as Extension,ut as InputRule,vt as Mark,je as Node,Ee as NodePos,bt as PasteRule,et as callOrReturn,Ne as canInsertNode,Gt as combineTransactionSteps,q as createChainableState,Kt as createDocument,Ft as createNodeFromContent,Oe as createStyleTag,Jt as defaultBlockAt,qt as deleteProps,Lt as elementFromString,Be as escapeForRegEx,Yt as findChildrenInRange,Mt as findDuplicates,Xt as findParentNode,Qt as findParentNodeClosestToPos,ot as fromString,ee as getAttributes,Y as getAttributesFromExtensions,oe as getChangedRanges,G as getExtensionField,dt as getHTMLFromFragment,Ut as getMarkAttributes,jt as getMarkRange,It as getMarkType,re as getMarksBetween,te as getNodeAttributes,Q as getNodeType,Z as getRenderedAttributes,it as getSchemaByResolvedExtensions,at as getSchemaTypeByName,Wt as getSchemaTypeNameByName,se as getSplittedAttributes,Zt as getText,St as getTextBetween,lt as getTextContentFromNodes,Ct as getTextSerializersFromSchema,rt as injectExtensionAttributesToParseRule,mt as inputRulesPlugin,ae as isActive,nt as isEmptyObject,ct as isExtensionRulesEnabled,tt as isFunction,ce as isList,Vt as isMacOS,ie as isMarkActive,_t as isNodeActive,de as isNodeEmpty,le as isNodeSelection,yt as isNumber,ft as isPlainObject,pt as isRegExp,Nt as isTextSelection,Dt as isiOS,Ce as markInputRule,Ie as markPasteRule,X as mergeAttributes,gt as mergeDeep,Bt as minMax,Te as nodeInputRule,Re as nodePasteRule,Pt as objectIncludes,xt as pasteRulesPlugin,pe as posToDOMRect,ne as removeDuplicates,Rt as resolveFocusPosition,Ht as selectionToInsertionEnd,J as splitExtensions,$e as textInputRule,Pe as textblockTypeInputRule,Ae as wrappingInputRule};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|