@eigenpal/docx-js-editor 0.0.13 → 0.0.14

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.
Files changed (79) hide show
  1. package/README.md +0 -3
  2. package/dist/FindReplaceDialog-46BE7Q2G.cjs +1 -0
  3. package/dist/{FindReplaceDialog-RWYDRWHF.js → FindReplaceDialog-UMXCBBST.js} +1 -1
  4. package/dist/{FootnotePropertiesDialog-BC6JIPDA.cjs → FootnotePropertiesDialog-OBQXOBJE.cjs} +1 -1
  5. package/dist/{FootnotePropertiesDialog-CWQF5EBK.js → FootnotePropertiesDialog-TYQGPWPX.js} +1 -1
  6. package/dist/{HyperlinkDialog-EG2BSLPD.cjs → HyperlinkDialog-22NH7ZLP.cjs} +1 -1
  7. package/dist/{HyperlinkDialog-YAVK64F4.js → HyperlinkDialog-UOERZIBM.js} +1 -1
  8. package/dist/{ImagePositionDialog-S6SMH7XH.js → ImagePositionDialog-52FDANUK.js} +1 -1
  9. package/dist/{ImagePositionDialog-IGYS5KMK.cjs → ImagePositionDialog-ZK5WFBRC.cjs} +1 -1
  10. package/dist/{ImagePropertiesDialog-VGV4E4SN.cjs → ImagePropertiesDialog-LU44RDIY.cjs} +1 -1
  11. package/dist/{ImagePropertiesDialog-UO5QUIBS.js → ImagePropertiesDialog-YPSLPSF6.js} +1 -1
  12. package/dist/{TablePropertiesDialog-WRM47JI6.cjs → TablePropertiesDialog-KMOYHPGF.cjs} +1 -1
  13. package/dist/{TablePropertiesDialog-VBOU4DID.js → TablePropertiesDialog-OUUJAA7D.js} +1 -1
  14. package/dist/{chunk-M7F2CUUD.js → chunk-3VOXZKGT.js} +1 -1
  15. package/dist/{chunk-OTG4NABM.js → chunk-5MWH4N7I.js} +1 -1
  16. package/dist/chunk-5WBRHVOE.js +258 -0
  17. package/dist/chunk-6YFGCUHU.js +4 -0
  18. package/dist/{chunk-MDPDH7KS.js → chunk-7H2HP242.js} +1 -1
  19. package/dist/{chunk-KVAT5SVD.js → chunk-CTYOM6BE.js} +1 -1
  20. package/dist/{chunk-A7VY2V4X.cjs → chunk-FYAWM7MP.cjs} +1 -1
  21. package/dist/{chunk-EPCZ24TY.cjs → chunk-IHZIA6JP.cjs} +1 -1
  22. package/dist/{chunk-PNMZPPPI.cjs → chunk-JGPRSZPI.cjs} +1 -1
  23. package/dist/chunk-JS7TPZTF.cjs +10 -0
  24. package/dist/chunk-L7UKJGRK.js +10 -0
  25. package/dist/{chunk-6MBDPZVD.js → chunk-MLSHZVL7.js} +2 -2
  26. package/dist/chunk-O7QVCJN6.cjs +4 -0
  27. package/dist/{chunk-W4DUKACP.cjs → chunk-OEOUMSWH.cjs} +3 -3
  28. package/dist/chunk-OWMXCVKB.js +1 -0
  29. package/dist/{chunk-XVFMG77A.cjs → chunk-PXC7ARQB.cjs} +1 -1
  30. package/dist/chunk-QVVLXLRZ.cjs +258 -0
  31. package/dist/{chunk-QHWHCIUW.js → chunk-R5SKERM2.js} +1 -1
  32. package/dist/{chunk-FLECKDK4.cjs → chunk-UAME5JHZ.cjs} +2 -2
  33. package/dist/chunk-VOWKSURW.cjs +1 -0
  34. package/dist/{chunk-CZ7W7MCM.cjs → chunk-VTAS7VZ6.cjs} +1 -1
  35. package/dist/{chunk-MMJD2DLL.js → chunk-WFWLPKQA.js} +1 -1
  36. package/dist/core-plugins.cjs +1 -1
  37. package/dist/core-plugins.d.cts +7 -4
  38. package/dist/core-plugins.d.ts +7 -4
  39. package/dist/core-plugins.js +1 -1
  40. package/dist/core.cjs +1 -1
  41. package/dist/core.js +1 -1
  42. package/dist/executor-ITYZTNSH.cjs +1 -0
  43. package/dist/executor-TC7CLATE.js +1 -0
  44. package/dist/headless.cjs +2 -2
  45. package/dist/headless.js +1 -1
  46. package/dist/index.cjs +5 -5
  47. package/dist/index.d.cts +3 -3
  48. package/dist/index.d.ts +3 -3
  49. package/dist/index.js +5 -5
  50. package/dist/mcp-cli.js +21 -21
  51. package/dist/mcp.cjs +8 -8
  52. package/dist/mcp.js +1 -1
  53. package/dist/{processTemplate-QOEAXCKA.cjs → processTemplate-525HZL4S.cjs} +1 -1
  54. package/dist/{processTemplate-BHBTDAIC.js → processTemplate-RJN6452W.js} +1 -1
  55. package/dist/{react-Be1YOl4z.d.ts → react-BZxD04XV.d.ts} +2 -8
  56. package/dist/{react-DPuSVbgY.d.cts → react-D8eAYckC.d.cts} +2 -8
  57. package/dist/react.cjs +1 -1
  58. package/dist/react.d.cts +1 -1
  59. package/dist/react.d.ts +1 -1
  60. package/dist/react.js +1 -1
  61. package/dist/{selectionRects-LO3FJT47.js → selectionRects-42JURU6D.js} +1 -1
  62. package/dist/{selectionRects-I5JVL73G.cjs → selectionRects-XGMQBMC5.cjs} +1 -1
  63. package/dist/styles.css +1 -1
  64. package/dist/ui.cjs +1 -1
  65. package/dist/ui.d.cts +1 -53
  66. package/dist/ui.d.ts +1 -53
  67. package/dist/ui.js +1 -1
  68. package/package.json +1 -2
  69. package/dist/FindReplaceDialog-BAACAU67.cjs +0 -1
  70. package/dist/chunk-3IYNTJO5.js +0 -1
  71. package/dist/chunk-6YLNNCRZ.cjs +0 -10
  72. package/dist/chunk-BVQ2QRHA.cjs +0 -4
  73. package/dist/chunk-COP5BIBZ.js +0 -10
  74. package/dist/chunk-E6XDMUAM.js +0 -4
  75. package/dist/chunk-MTX3EEBJ.js +0 -258
  76. package/dist/chunk-RTESADL3.cjs +0 -1
  77. package/dist/chunk-VN7XH644.cjs +0 -258
  78. package/dist/executor-44OB3DFD.js +0 -1
  79. package/dist/executor-U3BZPPGN.cjs +0 -1
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export{n as countPageBreaks,b as createColumnBreak,g as createHorizontalRule,c as createLineBreak,a as createPageBreak,e as createPageBreakParagraph,d as createPageBreakRun,o as findPageBreaks,m as hasPageBreakBefore,h as insertHorizontalRule,f as insertPageBreak,l as isBreakContent,j as isColumnBreak,k as isLineBreak,i as isPageBreak,p as removePageBreak}from'./chunk-KESNGXGO.js';export{e as buildExtendedSelectionContext,d as buildSelectionContext,h as createDocumentWithText,g as createEmptyDocument,a as getAgentContext,c as getDocumentSummary}from'./chunk-TOI5W3HK.js';export{B as DEFAULT_SELECTION_STYLE,j as DocxEditor,c as ErrorBoundary,b as ErrorProvider,C as HIGH_CONTRAST_SELECTION_STYLE,$ as PLUGIN_HOST_STYLES,d as ParseErrorDisplay,aa as PluginHost,D as SELECTION_CSS_VARS,h as TABLE_DATA_ATTRIBUTES,e as UnsupportedFeatureWarning,r as ZOOM_PRESETS,U as areSelectionStylesInjected,A as clampZoom,P as clearSelection,V as createSelectionChangeHandler,Z as createSelectionFromDOM,u as findNearestZoomPreset,m as formatLastSaveTime,p as formatStorageSize,x as formatZoom,X as generateOverlayElements,I as generateSelectionCSS,n as getAutoSaveStatusLabel,o as getAutoSaveStorageSize,H as getHighlightRectStyle,G as getMergedSelectionRects,v as getNextZoomPreset,w as getPreviousZoomPreset,K as getSelectedText,M as getSelectionBoundingRect,E as getSelectionRects,Y as getSelectionRuns,g as getUserFriendlyMessage,t as getZoomPresets,J as hasActiveSelection,N as highlightTextRange,S as injectSelectionStyles,q as isAutoSaveSupported,f as isParseError,Q as isSelectionBackwards,L as isSelectionWithin,z as isZoomPreset,F as mergeAdjacentRects,R as normalizeSelectionDirection,y as parseZoom,T as removeSelectionStyles,k as renderAsync,O as selectRange,l as useAutoSave,_ as useClipboard,a as useErrorNotifications,W as useSelectionHighlight,i as useTableSelection,s as useWheelZoom}from'./chunk-MTX3EEBJ.js';import'./chunk-S6FZ7HL6.js';export{a as DocumentAgent}from'./chunk-M7F2CUUD.js';export{B as CellBackgroundPicker,a as ContextMenu,A as DEFAULT_CELL_COLORS,ha as InsertImageDialog,ra as InsertSymbolDialog,aa as InsertTableDialog,Ea as KeyboardShortcutsDialog,P as LoadingIndicator,ya as PasteSpecialDialog,q as PrintButton,r as PrintStyles,g as ResponsePreview,X as ResponsiveToolbar,Y as ResponsiveToolbarGroup,qa as SYMBOL_CATEGORIES,z as TableInsertButtons,y as TableMergeButton,k as TextContextMenu,J as UnsavedIndicator,ma as calculateFitDimensions,ea as clampTableConfig,D as createCellColorOption,O as createChangeTracker,ca as createDefaultTableConfig,j as createErrorResponse,i as createMockResponse,G as createShadingFromColor,Z as createToolbarItem,_ as createToolbarItems,na as dataUrlToBlob,V as delay,pa as formatFileSize,w as formatPrintPageRange,La as formatShortcutKeys,fa as formatTableDimensions,c as getActionShortcut,f as getAllActions,Ka as getAllCategories,N as getAllIndicatorPositions,M as getAllIndicatorVariants,U as getAllLoadingSizes,T as getAllLoadingVariants,Ba as getAllPasteOptions,Ja as getCategoryLabel,F as getCellColorName,H as getColorFromShading,Ia as getCommonShortcuts,I as getContrastingTextColor,e as getDefaultActions,C as getDefaultCellColors,Ca as getDefaultPasteOption,u as getDefaultPrintOptions,Ga as getDefaultShortcuts,o as getDefaultTextContextMenuItems,la as getImageAcceptString,oa as getImageDimensions,S as getLoadingVariantLabel,Aa as getPasteOption,$ as getRecommendedPriority,Ha as getShortcutsByCategory,ka as getSupportedImageExtensions,ta as getSymbolCategories,va as getSymbolUnicodeInfo,ua as getSymbolsByCategory,ga as getTablePresets,m as getTextActionLabel,n as getTextActionShortcut,L as getVariantLabel,d as isActionAvailable,E as isDefaultCellColor,Da as isPasteSpecialShortcut,x as isPrintSupported,p as isTextActionAvailable,ja as isValidImageFile,da as isValidTableConfig,t as openPrintWindow,v as parsePageRange,wa as searchSymbols,xa as symbolFromCodePoint,s as triggerPrint,b as useContextMenu,ia as useInsertImageDialog,sa as useInsertSymbolDialog,ba as useInsertTableDialog,Fa as useKeyboardShortcutsDialog,Q as useLoading,R as useLoadingOperations,za as usePasteSpecial,h as useResponsePreview,W as useResponsiveToolbar,l as useTextContextMenu,K as useUnsavedChanges}from'./chunk-6MBDPZVD.js';import'./chunk-EMKABJPH.js';import {ra}from'./chunk-E6XDMUAM.js';export{i as AlignmentButtons,ca as CLIPBOARD_TYPES,g as ColorPicker,b as FontPicker,f as FontSizePicker,O as HorizontalRuler,ba as INTERNAL_CLIPBOARD_TYPE,l as LineSpacingPicker,j as ListButtons,H as PageNavigator,z as PageNumberIndicator,m as StylePicker,p as TableBorderColorPicker,o as TableBorderPicker,q as TableBorderWidthPicker,r as TableCellFillPicker,s as TableMoreDropdown,T as TableToolbar,x as Toolbar,u as ToolbarButton,v as ToolbarGroup,w as ToolbarSeparator,y as VariablePanel,n as ZoomControl,Z as addColumn,X as addRow,N as calculateProgress,G as calculateScrollToPage,F as calculateVisiblePage,K as clampPageNumber,na as cleanWordHtml,ea as copyParagraphs,da as copyRuns,pa as createClipboardHandlers,k as createDefaultListState,B as createPageFormat,U as createTableContext,_ as deleteColumn,Y as deleteRow,A as formatPageOrdinal,M as formatPageRange,W as getCellAt,V as getColumnCount,R as getMarginInUnits,L as getNavigationShortcuts,C as getPageProgress,Q as getRulerDimensions,ja as handlePasteEvent,oa as htmlToRuns,ma as isEditorHtml,D as isFirstPage,E as isLastPage,J as isValidPageNumber,la as isWordHtml,$ as mergeCells,ga as paragraphsToClipboardContent,ka as parseClipboardHtml,S as parseMarginFromUnits,I as parsePageInput,P as positionToMargin,ia as readFromClipboard,fa as runsToClipboardContent,aa as splitCell,ha as writeToClipboard}from'./chunk-E6XDMUAM.js';export{d as HyperlinkDialog,m as useHyperlinkDialog}from'./chunk-PJVI53AH.js';export{l as blendColors,m as colorsEqual,i as createRgbColor,h as createThemeColor,j as darkenColor,p as emuToPixels,r as emuToTwips,x as formatPx,f as getContrastingColor,u as halfPointsToPixels,d as isBlack,e as isWhite,k as lightenColor,g as parseColorString,q as pixelsToEmu,o as pixelsToTwips,t as pointsToPixels,a as resolveColor,b as resolveHighlightColor,c as resolveShadingColor,s as twipsToEmu,n as twipsToPixels}from'./chunk-ZDYHAYN6.js';export{b as docxtemplaterPlugin}from'./chunk-COP5BIBZ.js';export{e as getTemplateTags,a as processTemplate,c as processTemplateAsBlob,b as processTemplateDetailed,f as validateTemplate}from'./chunk-ESI4BSBF.js';import'./chunk-2ASOEN3V.js';export{b as serializeDocumentBody,c as serializeDocx,a as serializeSectionProperties}from'./chunk-MDPDH7KS.js';export{a as executeCommand,b as executeCommands}from'./chunk-MMJD2DLL.js';export{k as canRenderFont,i as getLoadedFonts,g as isFontLoaded,h as isFontsLoading,e as loadFont,l as loadFontFromBuffer,f as loadFonts,j as onFontsLoaded,p as parseDocx,m as preloadCommonFonts,o as toArrayBuffer}from'./chunk-OTG4NABM.js';export{a as PluginRegistry,b as pluginRegistry,c as registerPlugins}from'./chunk-QHWHCIUW.js';export{n as FindReplaceDialog,a as createDefaultFindOptions,c as createSearchPattern,b as escapeRegexString,d as findAllMatches,j as findInDocument,k as findInParagraph,i as getDefaultHighlightOptions,g as getMatchCountText,h as isEmptySearch,e as replaceAllInContent,f as replaceFirstInContent,l as scrollToMatch,m as useFindReplace}from'./chunk-KVAT5SVD.js';import'./chunk-3IYNTJO5.js';import ye,{useState,useRef,useMemo,useCallback,useEffect}from'react';import {PluginKey,TextSelection,Plugin}from'prosemirror-state';import {DecorationSet,Decoration}from'prosemirror-view';import {jsx,jsxs}from'react/jsx-runtime';var Xa=/[\p{L}\p{N}''\-]/u,qa=/\s/;function M(e){return !e||e.length===0?false:Xa.test(e)}function K(e){return !e||e.length===0?false:qa.test(e)}function R(e,t){if(!e||e.length===0)return [0,0];t=Math.max(0,Math.min(t,e.length-1));let o=e[t];if(K(o)){let n=t,r=t;for(;n>0&&K(e[n-1]);)n--;for(;r<e.length&&K(e[r]);)r++;return [n,r]}if(M(o)){let n=t,r=t;for(;n>0&&M(e[n-1]);)n--;for(;r<e.length&&M(e[r]);)r++;return [n,r]}return [t,t+1]}function ja(e,t){let[o,n]=R(e,t);return e.slice(o,n)}function Ja(e,t){let[o,n]=R(e,t);return {word:e.slice(o,n),startIndex:o,endIndex:n}}function $(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.getRangeAt(0),o=t.startContainer;if(o.nodeType===Node.TEXT_NODE){let n=o.textContent||"",r=t.startOffset,[a,i]=R(n,r);if(i>a)return t.setStart(o,a),t.setEnd(o,i),e.removeAllRanges(),e.addRange(t),true}if(o.nodeType===Node.ELEMENT_NODE){let n=o,r=q(n);if(r.length>0){let a=t.startOffset,i=null,l=a;if(a<n.childNodes.length){let p=n.childNodes[a];if(p.nodeType===Node.TEXT_NODE)i=p,l=0;else if(p instanceof Element){let d=q(p);d.length>0&&(i=d[0],l=0);}}if(!i&&r.length>0&&(i=r[0],l=0),i){let p=i.textContent||"",[d,c]=R(p,l);if(c>d){let u=document.createRange();return u.setStart(i,d),u.setEnd(i,c),e.removeAllRanges(),e.addRange(u),true}}}}return false}function Qa(e,t){let o=window.getSelection();if(!o)return false;let n=e.textContent||"",[r,a]=R(n,t);if(a>r){let i=document.createRange();return i.setStart(e,r),i.setEnd(e,a),o.removeAllRanges(),o.addRange(i),true}return false}function ei(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.getRangeAt(0);if(t.collapsed)return $();let o=t.startContainer,n=t.endContainer,r=t.startOffset,a=t.endOffset;if(o.nodeType===Node.TEXT_NODE){let i=o.textContent||"",[l]=R(i,t.startOffset);r=l;}if(n.nodeType===Node.TEXT_NODE){let i=n.textContent||"",l=Math.max(0,t.endOffset-1),[,p]=R(i,l);a=p;}try{return t.setStart(o,r),t.setEnd(n,a),e.removeAllRanges(),e.addRange(t),!0}catch(i){return console.warn("Could not expand selection to word boundaries:",i),false}}function J(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let o=e.getRangeAt(0).commonAncestorContainer,n=ti(o);if(n){let r=document.createRange();return r.selectNodeContents(n),e.removeAllRanges(),e.addRange(r),true}return false}function ti(e){if(!e)return null;let t=e;for(;t;){if(t instanceof Element&&t.hasAttribute("data-paragraph-index"))return t;t=t.parentNode;}return null}function q(e){let t=[],o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null),n;for(;n=o.nextNode();)n.nodeType===Node.TEXT_NODE&&t.push(n);return t}var V=0,O=null,G=null,oi=500;function j(){V=0,G=null,O&&(clearTimeout(O),O=null);}function Q(e){return e.target!==G&&j(),V++,G=e.target,O&&clearTimeout(O),O=setTimeout(j,oi),Math.min(V,3)}function ni(){return e=>{e.ctrlKey||e.metaKey||e.altKey||$();}}function ri(){return e=>{if(Q(e)===3){if(e.ctrlKey||e.metaKey||e.altKey)return;J();}}}function P(e){return e?/[\p{L}\p{N}_]/u.test(e):false}function Y(e){return e?/\s/.test(e):false}function ai(e){return e?/[\p{P}]/u.test(e):false}function ii(e,t){if(t<=0)return 0;t>e.length&&(t=e.length);let o=t;for(;o>0&&Y(e[o-1]);)o--;if(o===0)return 0;for(;o>0&&P(e[o-1]);)o--;return o}function si(e,t){if(t>=e.length)return e.length;t<0&&(t=0);let o=t;for(;o<e.length&&P(e[o]);)o++;for(;o<e.length&&Y(e[o]);)o++;return o}function ee(e,t){if(t>=e.length)return e.length;let o=t;for(;o<e.length&&P(e[o]);)o++;for(;o<e.length&&!P(e[o]);)o++;return o}function te(e,t){if(t<=0)return 0;let o=t;for(;o>0&&!P(e[o-1]);)o--;for(;o>0&&P(e[o-1]);)o--;return o}function oe(e,t){if(!window.getSelection())return null;let n=document.createRange();if(e.nodeType===Node.TEXT_NODE){n.setStart(e,Math.min(t,e.textContent?.length||0)),n.collapse(true);let a=n.getBoundingClientRect().top,i=0,l=t;for(;i<l;){let p=Math.floor((i+l)/2);n.setStart(e,p),n.collapse(true);let d=n.getBoundingClientRect();Math.abs(d.top-a)<2?l=p:i=p+1;}return {node:e,offset:i}}return null}function ne(e,t){if(!window.getSelection())return null;let n=e.textContent?.length||0,r=document.createRange();if(e.nodeType===Node.TEXT_NODE){r.setStart(e,Math.min(t,n)),r.collapse(true);let i=r.getBoundingClientRect().top,l=t,p=n;for(;l<p;){let d=Math.ceil((l+p)/2);r.setStart(e,d),r.collapse(true);let c=r.getBoundingClientRect();Math.abs(c.top-i)<2?l=d:p=d-1;}return {node:e,offset:l}}return null}function li(){let e=window.getSelection();if(!e||e.rangeCount===0)return null;let t=e.getRangeAt(0);return {node:t.startContainer,offset:t.startOffset,anchorNode:e.anchorNode,anchorOffset:e.anchorOffset,focusNode:e.focusNode,focusOffset:e.focusOffset,isCollapsed:e.isCollapsed,text:e.toString()}}function H(e,t){let o=window.getSelection();if(!o)return;let n=document.createRange(),r=e.nodeType===Node.TEXT_NODE?e.textContent?.length||0:e.childNodes.length;n.setStart(e,Math.min(t,r)),n.collapse(true),o.removeAllRanges(),o.addRange(n);}function _(e,t){let o=window.getSelection();if(!(!o||!o.anchorNode))try{o.extend(e,Math.min(t,e.textContent?.length||0));}catch{let n=e.nodeType===Node.TEXT_NODE?e.textContent?.length||0:e.childNodes.length;o.setBaseAndExtent(o.anchorNode,o.anchorOffset,e,Math.min(t,n));}}function re(e,t=false){let o=window.getSelection();if(!o||o.rangeCount===0)return false;let n=o.focusNode;if(!n||n.nodeType!==Node.TEXT_NODE)return false;let r=n.textContent||"",a=o.focusOffset,i;return e==="left"?i=te(r,a):i=ee(r,a),t?_(n,i):H(n,i),true}function ae(e,t=false){let o=window.getSelection();if(!o||o.rangeCount===0)return false;let n=o.focusNode;if(!n)return false;if(n.nodeType===Node.TEXT_NODE){let i=e==="start"?oe(n,o.focusOffset):ne(n,o.focusOffset);if(i)return t?_(i.node,i.offset):H(i.node,i.offset),true}let r=n.textContent||"",a=e==="start"?0:r.length;return t?_(n,a):H(n,a),true}function ie(e){let{key:t,ctrlKey:o,metaKey:n,shiftKey:r,altKey:a}=e,i=o||n;switch(t){case "ArrowLeft":if(i)return {direction:"left",unit:"word",extend:r};break;case "ArrowRight":if(i)return {direction:"right",unit:"word",extend:r};break;case "Home":return i?{direction:"left",unit:"document",extend:r}:{direction:"left",unit:"line",extend:r};case "End":return i?{direction:"right",unit:"document",extend:r}:{direction:"right",unit:"line",extend:r}}return null}function ci(e,t){let o=ie(e);if(!o)return false;switch(o.unit){case "word":if((o.direction==="left"||o.direction==="right")&&re(o.direction,o.extend))return e.preventDefault(),true;break;case "line":let n=o.direction==="left"?"start":"end";if(ae(n,o.extend))return e.preventDefault(),true;break;case "document":if(o.direction==="left"&&t?.onDocumentStart)return e.preventDefault(),t.onDocumentStart(),true;if(o.direction==="right"&&t?.onDocumentEnd)return e.preventDefault(),t.onDocumentEnd(),true;break}return false}function pi(e){let{key:t,ctrlKey:o,metaKey:n}=e;return !!((o||n)&&(t==="ArrowLeft"||t==="ArrowRight")||t==="Home"||t==="End")}function di(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.focusNode;if(!t||t.nodeType!==Node.TEXT_NODE)return false;let o=t.textContent||"",n=e.focusOffset,r=n,a=n;for(;r>0&&P(o[r-1]);)r--;for(;a<o.length&&P(o[a]);)a++;if(r===a)return false;let i=document.createRange();return i.setStart(t,r),i.setEnd(t,a),e.removeAllRanges(),e.addRange(i),true}function ui(){let e=window.getSelection();if(!e||e.rangeCount===0)return null;let t=e.focusNode;if(!t||t.nodeType!==Node.TEXT_NODE)return null;let o=t.textContent||"",n=e.focusOffset,r=n,a=n;for(;r>0&&P(o[r-1]);)r--;for(;a<o.length&&P(o[a]);)a++;return r===a?null:o.slice(r,a)}function gi(e,t){let o=e.ctrlKey||e.metaKey,n=t.ctrlKey||t.metaKey;return e.key.toLowerCase()===t.key.toLowerCase()&&o===!!n&&e.shiftKey===!!t.shiftKey&&e.altKey===!!t.altKey}var T={wordLeft:{key:"ArrowLeft",ctrlKey:true},wordRight:{key:"ArrowRight",ctrlKey:true},selectWordLeft:{key:"ArrowLeft",ctrlKey:true,shiftKey:true},selectWordRight:{key:"ArrowRight",ctrlKey:true,shiftKey:true},lineStart:{key:"Home"},lineEnd:{key:"End"},selectToLineStart:{key:"Home",shiftKey:true},selectToLineEnd:{key:"End",shiftKey:true},documentStart:{key:"Home",ctrlKey:true},documentEnd:{key:"End",ctrlKey:true},selectToDocumentStart:{key:"Home",ctrlKey:true,shiftKey:true},selectToDocumentEnd:{key:"End",ctrlKey:true,shiftKey:true}};function S(e){let t=[];if(e.ctrlKey||e.metaKey){let n=typeof navigator<"u"&&/Mac/i.test(navigator.platform);t.push(n?"\u2318":"Ctrl");}e.shiftKey&&t.push("Shift"),e.altKey&&t.push("Alt");let o=e.key;return o==="ArrowLeft"?o="\u2190":o==="ArrowRight"?o="\u2192":o==="ArrowUp"?o="\u2191":o==="ArrowDown"&&(o="\u2193"),t.push(o),t.join("+")}function fi(){return [{action:"Move by word (left)",shortcut:S(T.wordLeft)},{action:"Move by word (right)",shortcut:S(T.wordRight)},{action:"Select word (left)",shortcut:S(T.selectWordLeft)},{action:"Select word (right)",shortcut:S(T.selectWordRight)},{action:"Go to line start",shortcut:S(T.lineStart)},{action:"Go to line end",shortcut:S(T.lineEnd)},{action:"Select to line start",shortcut:S(T.selectToLineStart)},{action:"Select to line end",shortcut:S(T.selectToLineEnd)},{action:"Go to document start",shortcut:S(T.documentStart)},{action:"Go to document end",shortcut:S(T.documentEnd)},{action:"Select to document start",shortcut:S(T.selectToDocumentStart)},{action:"Select to document end",shortcut:S(T.selectToDocumentEnd)}]}ra();var se=/\{([#/^@]?)([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}/g,m=new PluginKey("template");function Ti(e,t,o){return `${e}:${t}:${o}`}function le(e){let t=[];e.descendants((p,d)=>(p.isText&&p.text&&t.push({text:p.text,pos:d}),true));let o="",n=[];for(let p of t){for(let d=0;d<p.text.length;d++)n.push(p.pos+d);o+=p.text;}let r=[],a=[],i=new Map,l;for(se.lastIndex=0;(l=se.exec(o))!==null;){let[p,d,c]=l,u=n[l.index],x=n[l.index+p.length-1]+1,g;d==="#"?g="sectionStart":d==="/"?g="sectionEnd":d==="^"?g="invertedStart":d==="@"?g="raw":g="variable";let b=`${g}:${c}`,k=i.get(b)??0;i.set(b,k+1);let N={id:Ti(g,c,k),type:g,name:c,rawTag:p,from:u,to:x};if(g==="sectionStart"||g==="invertedStart")N.nestedVars=[],a.push(N);else if(g==="sectionEnd"){for(let s=a.length-1;s>=0;s--)if(a[s].name===c){a.splice(s,1);break}}else g==="variable"&&a.length>0&&(a[a.length-1].nestedVars?.push(c),N.insideSection=true);r.push(N);}return r}function Si(e){switch(e){case "sectionStart":case "sectionEnd":return "#3b82f6";case "invertedStart":return "#8b5cf6";case "raw":return "#ef4444";default:return "#f59e0b"}}function Z(e,t,o,n){let r=[];for(let a of t){let i=a.id===o,l=a.id===n,p=Si(a.type),d=["docx-template-tag"];i&&d.push("hovered"),l&&d.push("selected"),r.push(Decoration.inline(a.from,a.to,{class:d.join(" "),"data-tag-id":a.id,style:`background-color: ${p}22; border-radius: 2px;`}));}return DecorationSet.create(e,r)}function xi(e,t){if(e.length!==t.length)return false;for(let o=0;o<e.length;o++)if(e[o].id!==t[o].id)return false;return true}function B(){return new Plugin({key:m,state:{init(e,t){let o=le(t.doc);return {tags:o,decorations:Z(t.doc,o)}},apply(e,t,o,n){if(e.docChanged){let a=le(n.doc),i=xi(t.tags,a);return {tags:a,decorations:i?t.decorations.map(e.mapping,e.doc):Z(n.doc,a,t.hoveredId,t.selectedId),hoveredId:t.hoveredId,selectedId:t.selectedId}}let r=e.getMeta(m);if(r){let a=r.hoveredId??t.hoveredId,i=r.selectedId??t.selectedId;return {...t,hoveredId:a,selectedId:i,decorations:Z(n.doc,t.tags,a,i)}}return {...t,decorations:t.decorations.map(e.mapping,e.doc)}}},props:{decorations(e){return m.getState(e)?.decorations??DecorationSet.empty},handleClick(e,t){let n=(m.getState(e.state)?.tags??[]).find(a=>t>=a.from&&t<=a.to);return n?(e.dispatch(e.state.tr.setMeta(m,{selectedId:n.id})),true):(m.getState(e.state)?.selectedId&&e.dispatch(e.state.tr.setMeta(m,{selectedId:void 0})),false)},handleDOMEvents:{mouseover(e,t){let n=t.target.closest?.("[data-tag-id]")?.getAttribute("data-tag-id")||void 0,r=m.getState(e.state)?.hoveredId;return n!==r&&e.dispatch(e.state.tr.setMeta(m,{hoveredId:n})),false},mouseout(e,t){return t.relatedTarget?.closest?.("[data-tag-id]")||m.getState(e.state)?.hoveredId&&e.dispatch(e.state.tr.setMeta(m,{hoveredId:void 0})),false}}}})}function pe(e){return m.getState(e)?.tags??[]}function D(e,t){e.dispatch(e.state.tr.setMeta(m,{hoveredId:t}));}function L(e,t){e.dispatch(e.state.tr.setMeta(m,{selectedId:t}));}var F=`
1
+ export{n as countPageBreaks,b as createColumnBreak,g as createHorizontalRule,c as createLineBreak,a as createPageBreak,e as createPageBreakParagraph,d as createPageBreakRun,o as findPageBreaks,m as hasPageBreakBefore,h as insertHorizontalRule,f as insertPageBreak,l as isBreakContent,j as isColumnBreak,k as isLineBreak,i as isPageBreak,p as removePageBreak}from'./chunk-KESNGXGO.js';export{e as buildExtendedSelectionContext,d as buildSelectionContext,h as createDocumentWithText,g as createEmptyDocument,a as getAgentContext,c as getDocumentSummary}from'./chunk-TOI5W3HK.js';export{B as DEFAULT_SELECTION_STYLE,j as DocxEditor,c as ErrorBoundary,b as ErrorProvider,C as HIGH_CONTRAST_SELECTION_STYLE,$ as PLUGIN_HOST_STYLES,d as ParseErrorDisplay,aa as PluginHost,D as SELECTION_CSS_VARS,h as TABLE_DATA_ATTRIBUTES,e as UnsupportedFeatureWarning,r as ZOOM_PRESETS,U as areSelectionStylesInjected,A as clampZoom,P as clearSelection,V as createSelectionChangeHandler,Z as createSelectionFromDOM,u as findNearestZoomPreset,m as formatLastSaveTime,p as formatStorageSize,x as formatZoom,X as generateOverlayElements,I as generateSelectionCSS,n as getAutoSaveStatusLabel,o as getAutoSaveStorageSize,H as getHighlightRectStyle,G as getMergedSelectionRects,v as getNextZoomPreset,w as getPreviousZoomPreset,K as getSelectedText,M as getSelectionBoundingRect,E as getSelectionRects,Y as getSelectionRuns,g as getUserFriendlyMessage,t as getZoomPresets,J as hasActiveSelection,N as highlightTextRange,S as injectSelectionStyles,q as isAutoSaveSupported,f as isParseError,Q as isSelectionBackwards,L as isSelectionWithin,z as isZoomPreset,F as mergeAdjacentRects,R as normalizeSelectionDirection,y as parseZoom,T as removeSelectionStyles,k as renderAsync,O as selectRange,l as useAutoSave,_ as useClipboard,a as useErrorNotifications,W as useSelectionHighlight,i as useTableSelection,s as useWheelZoom}from'./chunk-5WBRHVOE.js';import'./chunk-S6FZ7HL6.js';export{a as DocumentAgent}from'./chunk-3VOXZKGT.js';export{B as CellBackgroundPicker,a as ContextMenu,A as DEFAULT_CELL_COLORS,ha as InsertImageDialog,ra as InsertSymbolDialog,aa as InsertTableDialog,Ea as KeyboardShortcutsDialog,P as LoadingIndicator,ya as PasteSpecialDialog,q as PrintButton,r as PrintStyles,g as ResponsePreview,X as ResponsiveToolbar,Y as ResponsiveToolbarGroup,qa as SYMBOL_CATEGORIES,z as TableInsertButtons,y as TableMergeButton,k as TextContextMenu,J as UnsavedIndicator,ma as calculateFitDimensions,ea as clampTableConfig,D as createCellColorOption,O as createChangeTracker,ca as createDefaultTableConfig,j as createErrorResponse,i as createMockResponse,G as createShadingFromColor,Z as createToolbarItem,_ as createToolbarItems,na as dataUrlToBlob,V as delay,pa as formatFileSize,w as formatPrintPageRange,La as formatShortcutKeys,fa as formatTableDimensions,c as getActionShortcut,f as getAllActions,Ka as getAllCategories,N as getAllIndicatorPositions,M as getAllIndicatorVariants,U as getAllLoadingSizes,T as getAllLoadingVariants,Ba as getAllPasteOptions,Ja as getCategoryLabel,F as getCellColorName,H as getColorFromShading,Ia as getCommonShortcuts,I as getContrastingTextColor,e as getDefaultActions,C as getDefaultCellColors,Ca as getDefaultPasteOption,u as getDefaultPrintOptions,Ga as getDefaultShortcuts,o as getDefaultTextContextMenuItems,la as getImageAcceptString,oa as getImageDimensions,S as getLoadingVariantLabel,Aa as getPasteOption,$ as getRecommendedPriority,Ha as getShortcutsByCategory,ka as getSupportedImageExtensions,ta as getSymbolCategories,va as getSymbolUnicodeInfo,ua as getSymbolsByCategory,ga as getTablePresets,m as getTextActionLabel,n as getTextActionShortcut,L as getVariantLabel,d as isActionAvailable,E as isDefaultCellColor,Da as isPasteSpecialShortcut,x as isPrintSupported,p as isTextActionAvailable,ja as isValidImageFile,da as isValidTableConfig,t as openPrintWindow,v as parsePageRange,wa as searchSymbols,xa as symbolFromCodePoint,s as triggerPrint,b as useContextMenu,ia as useInsertImageDialog,sa as useInsertSymbolDialog,ba as useInsertTableDialog,Fa as useKeyboardShortcutsDialog,Q as useLoading,R as useLoadingOperations,za as usePasteSpecial,h as useResponsePreview,W as useResponsiveToolbar,l as useTextContextMenu,K as useUnsavedChanges}from'./chunk-MLSHZVL7.js';import'./chunk-EMKABJPH.js';import {qa as qa$1}from'./chunk-6YFGCUHU.js';export{i as AlignmentButtons,ba as CLIPBOARD_TYPES,g as ColorPicker,b as FontPicker,f as FontSizePicker,N as HorizontalRuler,aa as INTERNAL_CLIPBOARD_TYPE,l as LineSpacingPicker,j as ListButtons,G as PageNavigator,y as PageNumberIndicator,m as StylePicker,p as TableBorderColorPicker,o as TableBorderPicker,q as TableBorderWidthPicker,r as TableCellFillPicker,s as TableMoreDropdown,S as TableToolbar,x as Toolbar,u as ToolbarButton,v as ToolbarGroup,w as ToolbarSeparator,n as ZoomControl,Y as addColumn,W as addRow,M as calculateProgress,F as calculateScrollToPage,E as calculateVisiblePage,J as clampPageNumber,ma as cleanWordHtml,da as copyParagraphs,ca as copyRuns,oa as createClipboardHandlers,k as createDefaultListState,A as createPageFormat,T as createTableContext,Z as deleteColumn,X as deleteRow,z as formatPageOrdinal,L as formatPageRange,V as getCellAt,U as getColumnCount,Q as getMarginInUnits,K as getNavigationShortcuts,B as getPageProgress,P as getRulerDimensions,ia as handlePasteEvent,na as htmlToRuns,la as isEditorHtml,C as isFirstPage,D as isLastPage,I as isValidPageNumber,ka as isWordHtml,_ as mergeCells,fa as paragraphsToClipboardContent,ja as parseClipboardHtml,R as parseMarginFromUnits,H as parsePageInput,O as positionToMargin,ha as readFromClipboard,ea as runsToClipboardContent,$ as splitCell,ga as writeToClipboard}from'./chunk-6YFGCUHU.js';export{d as HyperlinkDialog,m as useHyperlinkDialog}from'./chunk-PJVI53AH.js';export{l as blendColors,m as colorsEqual,i as createRgbColor,h as createThemeColor,j as darkenColor,p as emuToPixels,r as emuToTwips,x as formatPx,f as getContrastingColor,u as halfPointsToPixels,d as isBlack,e as isWhite,k as lightenColor,g as parseColorString,q as pixelsToEmu,o as pixelsToTwips,t as pointsToPixels,a as resolveColor,b as resolveHighlightColor,c as resolveShadingColor,s as twipsToEmu,n as twipsToPixels}from'./chunk-ZDYHAYN6.js';export{b as docxtemplaterPlugin}from'./chunk-L7UKJGRK.js';export{e as getTemplateTags,a as processTemplate,c as processTemplateAsBlob,b as processTemplateDetailed,f as validateTemplate}from'./chunk-ESI4BSBF.js';import'./chunk-2ASOEN3V.js';export{b as serializeDocumentBody,c as serializeDocx,a as serializeSectionProperties}from'./chunk-7H2HP242.js';export{a as executeCommand,b as executeCommands}from'./chunk-WFWLPKQA.js';export{k as canRenderFont,i as getLoadedFonts,g as isFontLoaded,h as isFontsLoading,e as loadFont,l as loadFontFromBuffer,f as loadFonts,j as onFontsLoaded,p as parseDocx,m as preloadCommonFonts,o as toArrayBuffer}from'./chunk-5MWH4N7I.js';export{a as PluginRegistry,b as pluginRegistry,c as registerPlugins}from'./chunk-R5SKERM2.js';export{n as FindReplaceDialog,a as createDefaultFindOptions,c as createSearchPattern,b as escapeRegexString,d as findAllMatches,j as findInDocument,k as findInParagraph,i as getDefaultHighlightOptions,g as getMatchCountText,h as isEmptySearch,e as replaceAllInContent,f as replaceFirstInContent,l as scrollToMatch,m as useFindReplace}from'./chunk-CTYOM6BE.js';import'./chunk-OWMXCVKB.js';import ye,{useState,useRef,useMemo,useCallback,useEffect}from'react';import {PluginKey,TextSelection,Plugin}from'prosemirror-state';import {DecorationSet,Decoration}from'prosemirror-view';import {jsx,jsxs}from'react/jsx-runtime';var Za=/[\p{L}\p{N}''\-]/u,Xa=/\s/;function M(e){return !e||e.length===0?false:Za.test(e)}function K(e){return !e||e.length===0?false:Xa.test(e)}function R(e,t){if(!e||e.length===0)return [0,0];t=Math.max(0,Math.min(t,e.length-1));let o=e[t];if(K(o)){let n=t,r=t;for(;n>0&&K(e[n-1]);)n--;for(;r<e.length&&K(e[r]);)r++;return [n,r]}if(M(o)){let n=t,r=t;for(;n>0&&M(e[n-1]);)n--;for(;r<e.length&&M(e[r]);)r++;return [n,r]}return [t,t+1]}function qa(e,t){let[o,n]=R(e,t);return e.slice(o,n)}function ja(e,t){let[o,n]=R(e,t);return {word:e.slice(o,n),startIndex:o,endIndex:n}}function $(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.getRangeAt(0),o=t.startContainer;if(o.nodeType===Node.TEXT_NODE){let n=o.textContent||"",r=t.startOffset,[a,i]=R(n,r);if(i>a)return t.setStart(o,a),t.setEnd(o,i),e.removeAllRanges(),e.addRange(t),true}if(o.nodeType===Node.ELEMENT_NODE){let n=o,r=q(n);if(r.length>0){let a=t.startOffset,i=null,l=a;if(a<n.childNodes.length){let p=n.childNodes[a];if(p.nodeType===Node.TEXT_NODE)i=p,l=0;else if(p instanceof Element){let d=q(p);d.length>0&&(i=d[0],l=0);}}if(!i&&r.length>0&&(i=r[0],l=0),i){let p=i.textContent||"",[d,c]=R(p,l);if(c>d){let u=document.createRange();return u.setStart(i,d),u.setEnd(i,c),e.removeAllRanges(),e.addRange(u),true}}}}return false}function Ja(e,t){let o=window.getSelection();if(!o)return false;let n=e.textContent||"",[r,a]=R(n,t);if(a>r){let i=document.createRange();return i.setStart(e,r),i.setEnd(e,a),o.removeAllRanges(),o.addRange(i),true}return false}function Qa(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.getRangeAt(0);if(t.collapsed)return $();let o=t.startContainer,n=t.endContainer,r=t.startOffset,a=t.endOffset;if(o.nodeType===Node.TEXT_NODE){let i=o.textContent||"",[l]=R(i,t.startOffset);r=l;}if(n.nodeType===Node.TEXT_NODE){let i=n.textContent||"",l=Math.max(0,t.endOffset-1),[,p]=R(i,l);a=p;}try{return t.setStart(o,r),t.setEnd(n,a),e.removeAllRanges(),e.addRange(t),!0}catch(i){return console.warn("Could not expand selection to word boundaries:",i),false}}function J(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let o=e.getRangeAt(0).commonAncestorContainer,n=ei(o);if(n){let r=document.createRange();return r.selectNodeContents(n),e.removeAllRanges(),e.addRange(r),true}return false}function ei(e){if(!e)return null;let t=e;for(;t;){if(t instanceof Element&&t.hasAttribute("data-paragraph-index"))return t;t=t.parentNode;}return null}function q(e){let t=[],o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null),n;for(;n=o.nextNode();)n.nodeType===Node.TEXT_NODE&&t.push(n);return t}var V=0,O=null,G=null,ti=500;function j(){V=0,G=null,O&&(clearTimeout(O),O=null);}function Q(e){return e.target!==G&&j(),V++,G=e.target,O&&clearTimeout(O),O=setTimeout(j,ti),Math.min(V,3)}function oi(){return e=>{e.ctrlKey||e.metaKey||e.altKey||$();}}function ni(){return e=>{if(Q(e)===3){if(e.ctrlKey||e.metaKey||e.altKey)return;J();}}}function P(e){return e?/[\p{L}\p{N}_]/u.test(e):false}function Y(e){return e?/\s/.test(e):false}function ri(e){return e?/[\p{P}]/u.test(e):false}function ai(e,t){if(t<=0)return 0;t>e.length&&(t=e.length);let o=t;for(;o>0&&Y(e[o-1]);)o--;if(o===0)return 0;for(;o>0&&P(e[o-1]);)o--;return o}function ii(e,t){if(t>=e.length)return e.length;t<0&&(t=0);let o=t;for(;o<e.length&&P(e[o]);)o++;for(;o<e.length&&Y(e[o]);)o++;return o}function ee(e,t){if(t>=e.length)return e.length;let o=t;for(;o<e.length&&P(e[o]);)o++;for(;o<e.length&&!P(e[o]);)o++;return o}function te(e,t){if(t<=0)return 0;let o=t;for(;o>0&&!P(e[o-1]);)o--;for(;o>0&&P(e[o-1]);)o--;return o}function oe(e,t){if(!window.getSelection())return null;let n=document.createRange();if(e.nodeType===Node.TEXT_NODE){n.setStart(e,Math.min(t,e.textContent?.length||0)),n.collapse(true);let a=n.getBoundingClientRect().top,i=0,l=t;for(;i<l;){let p=Math.floor((i+l)/2);n.setStart(e,p),n.collapse(true);let d=n.getBoundingClientRect();Math.abs(d.top-a)<2?l=p:i=p+1;}return {node:e,offset:i}}return null}function ne(e,t){if(!window.getSelection())return null;let n=e.textContent?.length||0,r=document.createRange();if(e.nodeType===Node.TEXT_NODE){r.setStart(e,Math.min(t,n)),r.collapse(true);let i=r.getBoundingClientRect().top,l=t,p=n;for(;l<p;){let d=Math.ceil((l+p)/2);r.setStart(e,d),r.collapse(true);let c=r.getBoundingClientRect();Math.abs(c.top-i)<2?l=d:p=d-1;}return {node:e,offset:l}}return null}function si(){let e=window.getSelection();if(!e||e.rangeCount===0)return null;let t=e.getRangeAt(0);return {node:t.startContainer,offset:t.startOffset,anchorNode:e.anchorNode,anchorOffset:e.anchorOffset,focusNode:e.focusNode,focusOffset:e.focusOffset,isCollapsed:e.isCollapsed,text:e.toString()}}function H(e,t){let o=window.getSelection();if(!o)return;let n=document.createRange(),r=e.nodeType===Node.TEXT_NODE?e.textContent?.length||0:e.childNodes.length;n.setStart(e,Math.min(t,r)),n.collapse(true),o.removeAllRanges(),o.addRange(n);}function _(e,t){let o=window.getSelection();if(!(!o||!o.anchorNode))try{o.extend(e,Math.min(t,e.textContent?.length||0));}catch{let n=e.nodeType===Node.TEXT_NODE?e.textContent?.length||0:e.childNodes.length;o.setBaseAndExtent(o.anchorNode,o.anchorOffset,e,Math.min(t,n));}}function re(e,t=false){let o=window.getSelection();if(!o||o.rangeCount===0)return false;let n=o.focusNode;if(!n||n.nodeType!==Node.TEXT_NODE)return false;let r=n.textContent||"",a=o.focusOffset,i;return e==="left"?i=te(r,a):i=ee(r,a),t?_(n,i):H(n,i),true}function ae(e,t=false){let o=window.getSelection();if(!o||o.rangeCount===0)return false;let n=o.focusNode;if(!n)return false;if(n.nodeType===Node.TEXT_NODE){let i=e==="start"?oe(n,o.focusOffset):ne(n,o.focusOffset);if(i)return t?_(i.node,i.offset):H(i.node,i.offset),true}let r=n.textContent||"",a=e==="start"?0:r.length;return t?_(n,a):H(n,a),true}function ie(e){let{key:t,ctrlKey:o,metaKey:n,shiftKey:r,altKey:a}=e,i=o||n;switch(t){case "ArrowLeft":if(i)return {direction:"left",unit:"word",extend:r};break;case "ArrowRight":if(i)return {direction:"right",unit:"word",extend:r};break;case "Home":return i?{direction:"left",unit:"document",extend:r}:{direction:"left",unit:"line",extend:r};case "End":return i?{direction:"right",unit:"document",extend:r}:{direction:"right",unit:"line",extend:r}}return null}function li(e,t){let o=ie(e);if(!o)return false;switch(o.unit){case "word":if((o.direction==="left"||o.direction==="right")&&re(o.direction,o.extend))return e.preventDefault(),true;break;case "line":let n=o.direction==="left"?"start":"end";if(ae(n,o.extend))return e.preventDefault(),true;break;case "document":if(o.direction==="left"&&t?.onDocumentStart)return e.preventDefault(),t.onDocumentStart(),true;if(o.direction==="right"&&t?.onDocumentEnd)return e.preventDefault(),t.onDocumentEnd(),true;break}return false}function ci(e){let{key:t,ctrlKey:o,metaKey:n}=e;return !!((o||n)&&(t==="ArrowLeft"||t==="ArrowRight")||t==="Home"||t==="End")}function pi(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.focusNode;if(!t||t.nodeType!==Node.TEXT_NODE)return false;let o=t.textContent||"",n=e.focusOffset,r=n,a=n;for(;r>0&&P(o[r-1]);)r--;for(;a<o.length&&P(o[a]);)a++;if(r===a)return false;let i=document.createRange();return i.setStart(t,r),i.setEnd(t,a),e.removeAllRanges(),e.addRange(i),true}function di(){let e=window.getSelection();if(!e||e.rangeCount===0)return null;let t=e.focusNode;if(!t||t.nodeType!==Node.TEXT_NODE)return null;let o=t.textContent||"",n=e.focusOffset,r=n,a=n;for(;r>0&&P(o[r-1]);)r--;for(;a<o.length&&P(o[a]);)a++;return r===a?null:o.slice(r,a)}function ui(e,t){let o=e.ctrlKey||e.metaKey,n=t.ctrlKey||t.metaKey;return e.key.toLowerCase()===t.key.toLowerCase()&&o===!!n&&e.shiftKey===!!t.shiftKey&&e.altKey===!!t.altKey}var T={wordLeft:{key:"ArrowLeft",ctrlKey:true},wordRight:{key:"ArrowRight",ctrlKey:true},selectWordLeft:{key:"ArrowLeft",ctrlKey:true,shiftKey:true},selectWordRight:{key:"ArrowRight",ctrlKey:true,shiftKey:true},lineStart:{key:"Home"},lineEnd:{key:"End"},selectToLineStart:{key:"Home",shiftKey:true},selectToLineEnd:{key:"End",shiftKey:true},documentStart:{key:"Home",ctrlKey:true},documentEnd:{key:"End",ctrlKey:true},selectToDocumentStart:{key:"Home",ctrlKey:true,shiftKey:true},selectToDocumentEnd:{key:"End",ctrlKey:true,shiftKey:true}};function S(e){let t=[];if(e.ctrlKey||e.metaKey){let n=typeof navigator<"u"&&/Mac/i.test(navigator.platform);t.push(n?"\u2318":"Ctrl");}e.shiftKey&&t.push("Shift"),e.altKey&&t.push("Alt");let o=e.key;return o==="ArrowLeft"?o="\u2190":o==="ArrowRight"?o="\u2192":o==="ArrowUp"?o="\u2191":o==="ArrowDown"&&(o="\u2193"),t.push(o),t.join("+")}function gi(){return [{action:"Move by word (left)",shortcut:S(T.wordLeft)},{action:"Move by word (right)",shortcut:S(T.wordRight)},{action:"Select word (left)",shortcut:S(T.selectWordLeft)},{action:"Select word (right)",shortcut:S(T.selectWordRight)},{action:"Go to line start",shortcut:S(T.lineStart)},{action:"Go to line end",shortcut:S(T.lineEnd)},{action:"Select to line start",shortcut:S(T.selectToLineStart)},{action:"Select to line end",shortcut:S(T.selectToLineEnd)},{action:"Go to document start",shortcut:S(T.documentStart)},{action:"Go to document end",shortcut:S(T.documentEnd)},{action:"Select to document start",shortcut:S(T.selectToDocumentStart)},{action:"Select to document end",shortcut:S(T.selectToDocumentEnd)}]}qa$1();var se=/\{([#/^@]?)([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\}/g,m=new PluginKey("template");function yi(e,t,o){return `${e}:${t}:${o}`}function le(e){let t=[];e.descendants((p,d)=>(p.isText&&p.text&&t.push({text:p.text,pos:d}),true));let o="",n=[];for(let p of t){for(let d=0;d<p.text.length;d++)n.push(p.pos+d);o+=p.text;}let r=[],a=[],i=new Map,l;for(se.lastIndex=0;(l=se.exec(o))!==null;){let[p,d,c]=l,u=n[l.index],x=n[l.index+p.length-1]+1,g;d==="#"?g="sectionStart":d==="/"?g="sectionEnd":d==="^"?g="invertedStart":d==="@"?g="raw":g="variable";let b=`${g}:${c}`,k=i.get(b)??0;i.set(b,k+1);let N={id:yi(g,c,k),type:g,name:c,rawTag:p,from:u,to:x};if(g==="sectionStart"||g==="invertedStart")N.nestedVars=[],a.push(N);else if(g==="sectionEnd"){for(let s=a.length-1;s>=0;s--)if(a[s].name===c){a.splice(s,1);break}}else g==="variable"&&a.length>0&&(a[a.length-1].nestedVars?.push(c),N.insideSection=true);r.push(N);}return r}function Ti(e){switch(e){case "sectionStart":case "sectionEnd":return "#3b82f6";case "invertedStart":return "#8b5cf6";case "raw":return "#ef4444";default:return "#f59e0b"}}function Z(e,t,o,n){let r=[];for(let a of t){let i=a.id===o,l=a.id===n,p=Ti(a.type),d=["docx-template-tag"];i&&d.push("hovered"),l&&d.push("selected"),r.push(Decoration.inline(a.from,a.to,{class:d.join(" "),"data-tag-id":a.id,style:`background-color: ${p}22; border-radius: 2px;`}));}return DecorationSet.create(e,r)}function Si(e,t){if(e.length!==t.length)return false;for(let o=0;o<e.length;o++)if(e[o].id!==t[o].id)return false;return true}function B(){return new Plugin({key:m,state:{init(e,t){let o=le(t.doc);return {tags:o,decorations:Z(t.doc,o)}},apply(e,t,o,n){if(e.docChanged){let a=le(n.doc),i=Si(t.tags,a);return {tags:a,decorations:i?t.decorations.map(e.mapping,e.doc):Z(n.doc,a,t.hoveredId,t.selectedId),hoveredId:t.hoveredId,selectedId:t.selectedId}}let r=e.getMeta(m);if(r){let a=r.hoveredId??t.hoveredId,i=r.selectedId??t.selectedId;return {...t,hoveredId:a,selectedId:i,decorations:Z(n.doc,t.tags,a,i)}}return {...t,decorations:t.decorations.map(e.mapping,e.doc)}}},props:{decorations(e){return m.getState(e)?.decorations??DecorationSet.empty},handleClick(e,t){let n=(m.getState(e.state)?.tags??[]).find(a=>t>=a.from&&t<=a.to);return n?(e.dispatch(e.state.tr.setMeta(m,{selectedId:n.id})),true):(m.getState(e.state)?.selectedId&&e.dispatch(e.state.tr.setMeta(m,{selectedId:void 0})),false)},handleDOMEvents:{mouseover(e,t){let n=t.target.closest?.("[data-tag-id]")?.getAttribute("data-tag-id")||void 0,r=m.getState(e.state)?.hoveredId;return n!==r&&e.dispatch(e.state.tr.setMeta(m,{hoveredId:n})),false},mouseout(e,t){return t.relatedTarget?.closest?.("[data-tag-id]")||m.getState(e.state)?.hoveredId&&e.dispatch(e.state.tr.setMeta(m,{hoveredId:void 0})),false}}}})}function pe(e){return m.getState(e)?.tags??[]}function D(e,t){e.dispatch(e.state.tr.setMeta(m,{hoveredId:t}));}function L(e,t){e.dispatch(e.state.tr.setMeta(m,{selectedId:t}));}var F=`
2
2
  .docx-template-tag {
3
3
  cursor: pointer;
4
4
  transition: background-color 0.1s;
@@ -12,7 +12,7 @@ export{n as countPageBreaks,b as createColumnBreak,g as createHorizontalRule,c a
12
12
  .docx-template-tag.selected {
13
13
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
14
14
  }
15
- `;var Ei={variable:"#f59e0b",sectionStart:"#3b82f6",sectionEnd:"#3b82f6",invertedStart:"#8b5cf6",raw:"#ef4444"};function vi(e){switch(e){case "sectionStart":return "LOOP / IF";case "invertedStart":return "IF NOT";case "raw":return "HTML";default:return ""}}function U({editorView:e,pluginState:t,renderedDomContext:o}){let n=t?.tags??[],r=t?.hoveredId,a=t?.selectedId,[i,l]=useState(0),p=useRef(null),d=useRef(new Map),c=useRef([]),u=useMemo(()=>n.filter(s=>s.type!=="sectionEnd"&&!s.insideSection),[n]),x=useCallback(()=>{if(u.length===0||!o)return c.current;let s=[],h=o.getContainerOffset(),C=new Map;for(let f of c.current)C.set(f.tag.id,f.top);for(let f of u){let y=o.getRectsForRange(f.from,f.from+1);if(y.length>0){let v=y[0].y+h.y-40;s.push({tag:f,top:v});}else {let v=C.get(f.id);v!==void 0&&s.push({tag:f,top:v});}}s.sort((f,y)=>f.top-y.top);let I=6;for(let f=1;f<s.length;f++){let y=s[f-1],v=s[f],E=d.current.get(y.tag.id),w=32;E?w=E.offsetHeight:y.tag.nestedVars&&y.tag.nestedVars.length>0&&(w=42+y.tag.nestedVars.length*26),v.top<y.top+w+I&&(v.top=y.top+w+I);}return c.current=s,s},[u,o]),g=useMemo(()=>x(),[x,i]);useEffect(()=>{if(!o)return;let s=new ResizeObserver(()=>{requestAnimationFrame(()=>l(h=>h+1));});return s.observe(o.pagesContainer),()=>s.disconnect()},[o]),useEffect(()=>{let s=()=>{requestAnimationFrame(()=>l(h=>h+1));};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]);let b=useRef("");useEffect(()=>{let s=u.map(h=>h.id).join(",");if(s&&b.current!==s){let h=setTimeout(()=>{b.current=s,l(C=>C+1);},50);return ()=>clearTimeout(h)}},[u]);let k=s=>{e&&D(e,s);},N=s=>{if(!e)return;L(e,s.id);let{state:h}=e,C=h.tr.setSelection(TextSelection.near(h.doc.resolve(s.from)));e.dispatch(C),e.focus();};return u.length===0?null:jsx("div",{className:"template-panel",ref:p,children:jsx("div",{className:"template-panel-annotations",children:g.map(({tag:s,top:h})=>{let C=vi(s.type),I=Ei[s.type],f=s.type==="sectionStart"||s.type==="invertedStart",y=s.id===r,v=s.id===a;return jsxs("div",{className:"template-annotation-anchor",style:{top:`${h}px`},children:[jsx("div",{className:"template-annotation-connector"}),jsxs("div",{ref:E=>{E?d.current.set(s.id,E):d.current.delete(s.id);},className:`template-annotation-chip ${y?"hovered":""} ${v?"selected":""}`,style:{borderLeftColor:I},onMouseEnter:()=>k(s.id),onMouseLeave:()=>k(void 0),onClick:()=>N(s),title:f?`${s.rawTag}
15
+ `;var Ci={variable:"#f59e0b",sectionStart:"#3b82f6",sectionEnd:"#3b82f6",invertedStart:"#8b5cf6",raw:"#ef4444"};function Ei(e){switch(e){case "sectionStart":return "LOOP / IF";case "invertedStart":return "IF NOT";case "raw":return "HTML";default:return ""}}function U({editorView:e,pluginState:t,renderedDomContext:o}){let n=t?.tags??[],r=t?.hoveredId,a=t?.selectedId,[i,l]=useState(0),p=useRef(null),d=useRef(new Map),c=useRef([]),u=useMemo(()=>n.filter(s=>s.type!=="sectionEnd"&&!s.insideSection),[n]),x=useCallback(()=>{if(u.length===0||!o)return c.current;let s=[],h=o.getContainerOffset(),C=new Map;for(let f of c.current)C.set(f.tag.id,f.top);for(let f of u){let y=o.getRectsForRange(f.from,f.from+1);if(y.length>0){let v=y[0].y+h.y-40;s.push({tag:f,top:v});}else {let v=C.get(f.id);v!==void 0&&s.push({tag:f,top:v});}}s.sort((f,y)=>f.top-y.top);let I=6;for(let f=1;f<s.length;f++){let y=s[f-1],v=s[f],E=d.current.get(y.tag.id),w=32;E?w=E.offsetHeight:y.tag.nestedVars&&y.tag.nestedVars.length>0&&(w=42+y.tag.nestedVars.length*26),v.top<y.top+w+I&&(v.top=y.top+w+I);}return c.current=s,s},[u,o]),g=useMemo(()=>x(),[x,i]);useEffect(()=>{if(!o)return;let s=new ResizeObserver(()=>{requestAnimationFrame(()=>l(h=>h+1));});return s.observe(o.pagesContainer),()=>s.disconnect()},[o]),useEffect(()=>{let s=()=>{requestAnimationFrame(()=>l(h=>h+1));};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]);let b=useRef("");useEffect(()=>{let s=u.map(h=>h.id).join(",");if(s&&b.current!==s){let h=setTimeout(()=>{b.current=s,l(C=>C+1);},50);return ()=>clearTimeout(h)}},[u]);let k=s=>{e&&D(e,s);},N=s=>{if(!e)return;L(e,s.id);let{state:h}=e,C=h.tr.setSelection(TextSelection.near(h.doc.resolve(s.from)));e.dispatch(C),e.focus();};return u.length===0?null:jsx("div",{className:"template-panel",ref:p,children:jsx("div",{className:"template-panel-annotations",children:g.map(({tag:s,top:h})=>{let C=Ei(s.type),I=Ci[s.type],f=s.type==="sectionStart"||s.type==="invertedStart",y=s.id===r,v=s.id===a;return jsxs("div",{className:"template-annotation-anchor",style:{top:`${h}px`},children:[jsx("div",{className:"template-annotation-connector"}),jsxs("div",{ref:E=>{E?d.current.set(s.id,E):d.current.delete(s.id);},className:`template-annotation-chip ${y?"hovered":""} ${v?"selected":""}`,style:{borderLeftColor:I},onMouseEnter:()=>k(s.id),onMouseLeave:()=>k(void 0),onClick:()=>N(s),title:f?`${s.rawTag}
16
16
  Iterates over ${s.name}[]. Access nested properties via ${s.name}.property`:s.rawTag,children:[C&&jsx("span",{className:"template-chip-badge",style:{background:I},children:C}),!C&&jsx("span",{className:"template-chip-dot",style:{color:I},children:"\u25CF"}),jsx("span",{className:"template-chip-name",children:s.name}),f&&s.nestedVars&&s.nestedVars.length>0&&jsx("div",{className:"template-chip-nested",children:s.nestedVars.map((E,w)=>jsx("span",{className:"template-nested-var",title:`Access: ${s.name}.${E}`,children:E.includes(".")?E.split(".").pop():E},w))})]})]},s.id)})})})}var z=`
17
17
  .template-panel {
18
18
  display: flex;
@@ -124,7 +124,7 @@ Iterates over ${s.name}[]. Access nested properties via ${s.name}.property`:s.ra
124
124
  background: rgba(59, 130, 246, 0.15);
125
125
  color: #1e40af;
126
126
  }
127
- `;var Ii={variable:"rgba(245, 158, 11, 0.3)",sectionStart:"rgba(59, 130, 246, 0.3)",sectionEnd:"rgba(59, 130, 246, 0.3)",invertedStart:"rgba(139, 92, 246, 0.3)",raw:"rgba(239, 68, 68, 0.3)"},wi={variable:"rgba(245, 158, 11, 0.5)",sectionStart:"rgba(59, 130, 246, 0.5)",sectionEnd:"rgba(59, 130, 246, 0.5)",invertedStart:"rgba(139, 92, 246, 0.5)",raw:"rgba(239, 68, 68, 0.5)"};function me({context:e,tags:t,hoveredId:o,selectedId:n,onHover:r,onSelect:a}){let[i,l]=useState(0),p=useCallback(()=>{let c=e.getContainerOffset(),u=[];for(let x of t){let g=e.getRectsForRange(x.from,x.to);for(let b of g)u.push({tagId:x.id,tagType:x.type,x:b.x+c.x,y:b.y+c.y,width:b.width,height:b.height});}return u},[e,t]),d=useMemo(()=>p(),[p,i]);return useEffect(()=>{let c=()=>{requestAnimationFrame(()=>l(u=>u+1));};return window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[]),useEffect(()=>{let c=new ResizeObserver(()=>{requestAnimationFrame(()=>l(u=>u+1));});return c.observe(e.pagesContainer),()=>c.disconnect()},[e.pagesContainer]),d.length===0?null:jsx("div",{className:"template-highlight-overlay",children:d.map((c,u)=>{let x=c.tagId===o,g=c.tagId===n,b=x||g?wi[c.tagType]:Ii[c.tagType];return jsx("div",{className:`template-highlight ${x?"hovered":""} ${g?"selected":""}`,style:{position:"absolute",left:c.x,top:c.y,width:c.width,height:c.height,backgroundColor:b,borderRadius:2,cursor:"pointer"},onMouseEnter:()=>r?.(c.tagId),onMouseLeave:()=>r?.(void 0),onClick:()=>a?.(c.tagId)},`${c.tagId}-${u}`)})})}var he=`
127
+ `;var Ni={variable:"rgba(245, 158, 11, 0.3)",sectionStart:"rgba(59, 130, 246, 0.3)",sectionEnd:"rgba(59, 130, 246, 0.3)",invertedStart:"rgba(139, 92, 246, 0.3)",raw:"rgba(239, 68, 68, 0.3)"},Ii={variable:"rgba(245, 158, 11, 0.5)",sectionStart:"rgba(59, 130, 246, 0.5)",sectionEnd:"rgba(59, 130, 246, 0.5)",invertedStart:"rgba(139, 92, 246, 0.5)",raw:"rgba(239, 68, 68, 0.5)"};function me({context:e,tags:t,hoveredId:o,selectedId:n,onHover:r,onSelect:a}){let[i,l]=useState(0),p=useCallback(()=>{let c=e.getContainerOffset(),u=[];for(let x of t){let g=e.getRectsForRange(x.from,x.to);for(let b of g)u.push({tagId:x.id,tagType:x.type,x:b.x+c.x,y:b.y+c.y,width:b.width,height:b.height});}return u},[e,t]),d=useMemo(()=>p(),[p,i]);return useEffect(()=>{let c=()=>{requestAnimationFrame(()=>l(u=>u+1));};return window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[]),useEffect(()=>{let c=new ResizeObserver(()=>{requestAnimationFrame(()=>l(u=>u+1));});return c.observe(e.pagesContainer),()=>c.disconnect()},[e.pagesContainer]),d.length===0?null:jsx("div",{className:"template-highlight-overlay",children:d.map((c,u)=>{let x=c.tagId===o,g=c.tagId===n,b=x||g?Ii[c.tagType]:Ni[c.tagType];return jsx("div",{className:`template-highlight ${x?"hovered":""} ${g?"selected":""}`,style:{position:"absolute",left:c.x,top:c.y,width:c.width,height:c.height,backgroundColor:b,borderRadius:2,cursor:"pointer"},onMouseEnter:()=>r?.(c.tagId),onMouseLeave:()=>r?.(void 0),onClick:()=>a?.(c.tagId)},`${c.tagId}-${u}`)})})}var he=`
128
128
  .template-highlight-overlay {
129
129
  position: absolute;
130
130
  top: 0;
@@ -148,8 +148,8 @@ Iterates over ${s.name}[]. Access nested properties via ${s.name}.property`:s.ra
148
148
  .template-highlight.selected {
149
149
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.6);
150
150
  }
151
- `;var Di=ye.memo(U,(e,t)=>{let o=e.pluginState,n=t.pluginState;if(o?.hoveredId!==n?.hoveredId||o?.selectedId!==n?.selectedId)return false;let r=o?.tags??[],a=n?.tags??[];if(r.length!==a.length)return false;for(let i=0;i<r.length;i++)if(r[i].id!==a[i].id)return false;return e.renderedDomContext===t.renderedDomContext});function Te(e={}){return {id:"template",name:"Template",proseMirrorPlugins:[B()],Panel:Di,panelConfig:{position:e.panelPosition??"right",defaultSize:e.panelWidth??280,minSize:200,maxSize:400,resizable:true,collapsible:true,defaultCollapsed:e.defaultCollapsed??false},onStateChange:o=>{let n=m.getState(o.state);if(n)return {tags:n.tags,hoveredId:n.hoveredId,selectedId:n.selectedId}},initialize:o=>({tags:[]}),renderOverlay:(o,n,r)=>!n||n.tags.length===0?null:ye.createElement(me,{context:o,tags:n.tags,hoveredId:n.hoveredId,selectedId:n.selectedId,onHover:a=>{r&&D(r,a);},onSelect:a=>{if(r){L(r,a);let i=n.tags.find(l=>l.id===a);if(i){let l=r.state.tr.setSelection(TextSelection.near(r.state.doc.resolve(i.from)));r.dispatch(l),r.focus();}}}}),styles:`
151
+ `;var Oi=ye.memo(U,(e,t)=>{let o=e.pluginState,n=t.pluginState;if(o?.hoveredId!==n?.hoveredId||o?.selectedId!==n?.selectedId)return false;let r=o?.tags??[],a=n?.tags??[];if(r.length!==a.length)return false;for(let i=0;i<r.length;i++)if(r[i].id!==a[i].id)return false;return e.renderedDomContext===t.renderedDomContext});function Te(e={}){return {id:"template",name:"Template",proseMirrorPlugins:[B()],Panel:Oi,panelConfig:{position:e.panelPosition??"right",defaultSize:e.panelWidth??280,minSize:200,maxSize:400,resizable:true,collapsible:true,defaultCollapsed:e.defaultCollapsed??false},onStateChange:o=>{let n=m.getState(o.state);if(n)return {tags:n.tags,hoveredId:n.hoveredId,selectedId:n.selectedId}},initialize:o=>({tags:[]}),renderOverlay:(o,n,r)=>!n||n.tags.length===0?null:ye.createElement(me,{context:o,tags:n.tags,hoveredId:n.hoveredId,selectedId:n.selectedId,onHover:a=>{r&&D(r,a);},onSelect:a=>{if(r){L(r,a);let i=n.tags.find(l=>l.id===a);if(i){let l=r.state.tr.setSelection(TextSelection.near(r.state.doc.resolve(i.from)));r.dispatch(l),r.focus();}}}}),styles:`
152
152
  ${F}
153
153
  ${z}
154
154
  ${he}
155
- `}}var Li=Te();var ts="0.0.2";export{z as ANNOTATION_PANEL_STYLES,U as AnnotationPanel,T as NAVIGATION_SHORTCUTS,F as TEMPLATE_DECORATION_STYLES,ts as VERSION,ni as createDoubleClickWordSelector,Te as createTemplatePlugin,B as createTemplateProseMirrorPlugin,ri as createTripleClickParagraphSelector,S as describeShortcut,di as expandSelectionToWord,ei as expandSelectionToWordBoundaries,_ as extendSelectionTo,ee as findNextWordStart,te as findPreviousWordStart,ne as findVisualLineEnd,oe as findVisualLineStart,Ja as findWordAt,R as findWordBoundaries,si as findWordEnd,ii as findWordStart,fi as getNavigationShortcutDescriptions,li as getSelectionInfo,pe as getTemplatePluginTags,ja as getWordAt,ui as getWordAtCursor,Q as handleClickForMultiClick,ci as handleNavigationKey,pi as isNavigationKey,ai as isPunctuation,K as isWhitespace,Y as isWhitespaceChar,P as isWordChar,M as isWordCharacter,gi as matchesShortcut,re as moveByWord,ae as moveToLineEdge,ie as parseNavigationAction,J as selectParagraphAtCursor,$ as selectWordAtCursor,Qa as selectWordInTextNode,D as setHoveredElement,L as setSelectedElement,H as setSelectionPosition,Li as templatePlugin,m as templatePluginKey};
155
+ `}}var Di=Te();var es="0.0.2";export{z as ANNOTATION_PANEL_STYLES,U as AnnotationPanel,T as NAVIGATION_SHORTCUTS,F as TEMPLATE_DECORATION_STYLES,es as VERSION,oi as createDoubleClickWordSelector,Te as createTemplatePlugin,B as createTemplateProseMirrorPlugin,ni as createTripleClickParagraphSelector,S as describeShortcut,pi as expandSelectionToWord,Qa as expandSelectionToWordBoundaries,_ as extendSelectionTo,ee as findNextWordStart,te as findPreviousWordStart,ne as findVisualLineEnd,oe as findVisualLineStart,ja as findWordAt,R as findWordBoundaries,ii as findWordEnd,ai as findWordStart,gi as getNavigationShortcutDescriptions,si as getSelectionInfo,pe as getTemplatePluginTags,qa as getWordAt,di as getWordAtCursor,Q as handleClickForMultiClick,li as handleNavigationKey,ci as isNavigationKey,ri as isPunctuation,K as isWhitespace,Y as isWhitespaceChar,P as isWordChar,M as isWordCharacter,ui as matchesShortcut,re as moveByWord,ae as moveToLineEdge,ie as parseNavigationAction,J as selectParagraphAtCursor,$ as selectWordAtCursor,Ja as selectWordInTextNode,D as setHoveredElement,L as setSelectedElement,H as setSelectionPosition,Di as templatePlugin,m as templatePluginKey};