@betteroffice/docx 0.4.3 → 0.5.0

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 (124) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +108 -598
  3. package/dist/chunk-25WGDXBF.mjs +1 -0
  4. package/dist/chunk-2CCPNW44.mjs +1 -0
  5. package/dist/chunk-32A4I3T4.mjs +1 -0
  6. package/dist/chunk-4LO3PSLZ.mjs +2 -0
  7. package/dist/chunk-67MGRMP3.mjs +1 -0
  8. package/dist/chunk-6AUR4AA2.mjs +1 -0
  9. package/dist/chunk-6WT6HKAY.mjs +1 -0
  10. package/dist/chunk-77ZWGQZN.mjs +1 -0
  11. package/dist/chunk-7C3Y7LIH.mjs +1 -0
  12. package/dist/chunk-7WIUNGQW.mjs +1 -0
  13. package/dist/chunk-7WWFGMMF.mjs +1 -0
  14. package/dist/chunk-AK2NG7PT.mjs +1 -0
  15. package/dist/chunk-BR5BFOHF.mjs +1 -0
  16. package/dist/chunk-CDNWHQH2.mjs +1 -0
  17. package/dist/chunk-CRTTEHZN.mjs +1 -0
  18. package/dist/chunk-ETDMQ5GE.mjs +1 -0
  19. package/dist/{wasm-KSZTTO3B.mjs → chunk-GBOHQ3CJ.mjs} +1 -1
  20. package/dist/chunk-H7K4SJKK.mjs +1 -0
  21. package/dist/chunk-ICJH7QUY.mjs +1 -0
  22. package/dist/chunk-IHETKRDA.mjs +1 -0
  23. package/dist/chunk-ISBZLVIF.mjs +1 -0
  24. package/dist/chunk-JSYH6HNV.mjs +2 -0
  25. package/dist/chunk-KICHSQFN.mjs +1 -0
  26. package/dist/chunk-KXIGXLFA.mjs +5 -0
  27. package/dist/chunk-KXLTK7AT.mjs +57 -0
  28. package/dist/chunk-L3JRNJ34.mjs +1 -0
  29. package/dist/chunk-LKDHP22R.mjs +1 -0
  30. package/dist/chunk-LPOEM5WH.mjs +1 -0
  31. package/dist/chunk-M44BABH2.mjs +1 -0
  32. package/dist/chunk-MAYPJU23.mjs +1 -0
  33. package/dist/chunk-N5RE2S3U.mjs +2 -0
  34. package/dist/chunk-NLYHFVF5.mjs +1 -0
  35. package/dist/chunk-ONYCW7VV.mjs +4 -0
  36. package/dist/chunk-QGZ2AB3M.mjs +1 -0
  37. package/dist/chunk-QWHU7YIW.mjs +2 -0
  38. package/dist/{chunk-VH7P4734.mjs → chunk-QX2CDKPG.mjs} +1 -1
  39. package/dist/chunk-RGDE6YQB.mjs +1 -0
  40. package/dist/chunk-TE3AU2JK.mjs +1 -0
  41. package/dist/chunk-UDVEZ722.mjs +1 -0
  42. package/dist/chunk-UQSVFDRV.mjs +2 -0
  43. package/dist/chunk-VHOOSS4D.mjs +1 -0
  44. package/dist/chunk-WIDM4EMT.mjs +1 -0
  45. package/dist/chunk-YITJ4QAO.mjs +1 -0
  46. package/dist/collaboration/index.d.mts +111 -11
  47. package/dist/collaboration/index.mjs +1 -1
  48. package/dist/{content-DSb-6a9T.d.mts → content-DVT06V_6.d.mts} +24 -3
  49. package/dist/core.d.mts +9 -9
  50. package/dist/core.mjs +1 -1
  51. package/dist/displayListQueries-6XjS7B5e.d.mts +1473 -0
  52. package/dist/docx/index.d.mts +8 -7
  53. package/dist/docx/index.mjs +1 -2
  54. package/dist/docxWorker.mjs +1 -0
  55. package/dist/editor/index.d.mts +14 -12
  56. package/dist/editor/index.mjs +1 -1
  57. package/dist/{fontLoader-BNSs0E8K.d.mts → fontLoader-CBkmh4ps.d.mts} +1 -1
  58. package/dist/{formatting-gqLFeJ9X.d.mts → formatting-p5MneNuy.d.mts} +32 -1
  59. package/dist/generated/edit/docx_edit_bg.wasm +0 -0
  60. package/dist/generated/layout/docx_layout_bg.wasm +0 -0
  61. package/dist/generated/opc/ooxml_opc_bg.wasm +0 -0
  62. package/dist/generated/parse/docx_parse_bg.wasm +0 -0
  63. package/dist/index-C-KKULi5.d.mts +5596 -0
  64. package/dist/layout/index.d.mts +4 -4
  65. package/dist/layout/index.mjs +1 -1
  66. package/dist/layout/pagination/index.d.mts +4 -4
  67. package/dist/layout/render/index.d.mts +37 -53
  68. package/dist/layout/render/index.mjs +3 -1
  69. package/dist/{pagedExport-BmSlEhoP.d.mts → pagedExport-DDgA5O7E.d.mts} +92 -9
  70. package/dist/plugin-api/RenderedDomContext.d.mts +5 -7
  71. package/dist/plugin-api/index.d.mts +3 -3
  72. package/dist/plugin-api/resolveItemPositions.d.mts +3 -3
  73. package/dist/{rezip-Bxiq4Z_R.d.mts → rezip-CfwAYdV4.d.mts} +7 -1
  74. package/dist/styles/index.d.mts +3 -3
  75. package/dist/styles/index.mjs +1 -1
  76. package/dist/{styles-AryxLAhx.d.mts → styles-DZZz2oRy.d.mts} +2 -2
  77. package/dist/types/content.d.mts +2 -2
  78. package/dist/types/document.d.mts +6 -6
  79. package/dist/{types-Cz7S77Ut.d.mts → types-bvPg3KsF.d.mts} +16 -3
  80. package/dist/utils/comments.d.mts +2 -2
  81. package/dist/utils/findReplace.mjs +1 -2
  82. package/dist/utils/index.d.mts +5 -5
  83. package/dist/utils/index.mjs +1 -1
  84. package/dist/utils/listState.d.mts +2 -5
  85. package/dist/utils/stylePreview.d.mts +2 -2
  86. package/dist/utils/stylePreview.mjs +1 -1
  87. package/dist/wasm-edit.d.mts +233 -48
  88. package/dist/wasm-edit.mjs +1 -1
  89. package/dist/wasm-layout.d.mts +7 -1
  90. package/dist/wasm-layout.mjs +1 -1
  91. package/dist/wasm-opc.mjs +1 -1
  92. package/dist/wasm-parse.d.mts +7 -1
  93. package/dist/wasm-parse.mjs +1 -1
  94. package/dist/worker.d.mts +60 -0
  95. package/dist/worker.mjs +1 -0
  96. package/dist/yrs/docxWorker.d.mts +20 -0
  97. package/dist/yrs/docxWorker.mjs +3 -0
  98. package/dist/yrs/index.d.mts +12 -7
  99. package/dist/yrs/index.mjs +1 -1
  100. package/package.json +14 -4
  101. package/dist/chunk-3RPZ44TT.mjs +0 -1
  102. package/dist/chunk-47Q2FMFF.mjs +0 -1
  103. package/dist/chunk-5Z22FORG.mjs +0 -1
  104. package/dist/chunk-7ZV6P6NZ.mjs +0 -57
  105. package/dist/chunk-AXFMDV66.mjs +0 -1
  106. package/dist/chunk-EBYC3CX7.mjs +0 -1
  107. package/dist/chunk-FK7X7557.mjs +0 -1
  108. package/dist/chunk-GKWXOZZH.mjs +0 -1
  109. package/dist/chunk-LIOWZSE7.mjs +0 -1
  110. package/dist/chunk-ML6E23W2.mjs +0 -1
  111. package/dist/chunk-MLEMGJP7.mjs +0 -1
  112. package/dist/chunk-QBMNRD5V.mjs +0 -2
  113. package/dist/chunk-SHVHVJUB.mjs +0 -1
  114. package/dist/compareDocx-URPCPAQT.mjs +0 -1
  115. package/dist/computeLayout-ZTO6TBWX.mjs +0 -1
  116. package/dist/displayListQueries-BVBDVXoP.d.mts +0 -306
  117. package/dist/frameDelta-CLeO7K5z.d.mts +0 -807
  118. package/dist/index-DzZVJC8-.d.mts +0 -2467
  119. package/dist/parseWasm-BESKFFA3.mjs +0 -1
  120. package/dist/rustDisplayList-B7uPoItK.d.mts +0 -315
  121. package/dist/wasm-JPDPN2B2.mjs +0 -1
  122. package/dist/wasm-QI7MWC5D.mjs +0 -1
  123. package/dist/yrs/residentEngineWorker.d.mts +0 -2
  124. package/dist/yrs/residentEngineWorker.mjs +0 -1
@@ -1,3 +1,24 @@
1
+ import { f as SectionProperties } from './content-DVT06V_6.mjs';
2
+
3
+ type SectionStartKind = 'nextPage' | 'continuous' | 'evenPage' | 'oddPage';
4
+ interface SectionPropertyPatch {
5
+ orientation?: 'portrait' | 'landscape';
6
+ pageWidth?: number;
7
+ pageHeight?: number;
8
+ margins?: Partial<Record<'top' | 'bottom' | 'left' | 'right' | 'header' | 'footer' | 'gutter', number>>;
9
+ }
10
+ interface SectionInfo {
11
+ closingParagraphId: string;
12
+ firstParagraph: number;
13
+ lastParagraph: number;
14
+ authored: SectionProperties;
15
+ resolved: SectionProperties;
16
+ }
17
+ declare class DocxSectionError extends Error {
18
+ readonly code: string;
19
+ constructor(code: string, message: string);
20
+ }
21
+
1
22
  /**
2
23
  * Result envelopes shared by the formats' host edit APIs. Targets, steps, receipts and failure
3
24
  * codes stay format-owned; these shapes only fix how every format reports success and refusal.
@@ -493,14 +514,35 @@ type DocxContentControlsResult = {
493
514
  } | OperationRefusal<DocxContentControlReadFailure>;
494
515
 
495
516
  /**
496
- * Versioned reads and version-checked edit batches over one DOCX session. Every shape here is
497
- * plain JSON so it can cross a worker boundary unchanged; the semantics live in Rust.
498
- *
499
- * Offsets are half-open UTF-16 positions into a paragraph's projected text. Each inline atom
500
- * (hard break, image, content control, note reference, field or other embed) occupies one
501
- * U+FFFC, tabs stay `\t`, and paragraph marks are not part of the text. The accepted view shows
502
- * pending insertions and hides pending deletions; the original view does the reverse.
517
+ * What a session story holds. Comment bodies live outside the session's stories, so there is no
518
+ * comment kind; `other` is a story the session cannot place, such as a header or footer story
519
+ * whose part it does not know.
503
520
  */
521
+ type DocxStoryInfoKind = 'body' | 'tableCell' | 'contentControl' | 'header' | 'footer' | 'footnote' | 'endnote' | 'other';
522
+ /** A section that references a header or footer part, as the structured export reports it. */
523
+ type DocxStoryUse = DocxExportStory['uses'][number];
524
+ interface DocxStoryInfo {
525
+ story: string;
526
+ kind: DocxStoryInfoKind;
527
+ /** The story a table cell or block content control sits in. */
528
+ parent?: string;
529
+ /** The top-level story this one belongs to; itself for a top-level story. */
530
+ root: string;
531
+ /** A header's or footer's package part, when the session was opened from DOCX bytes. */
532
+ part?: string;
533
+ /**
534
+ * A header's or footer's sections whose properties reference the part, inheritance applied,
535
+ * whether or not a page shows it; plugin anchor geometry tells where it is painted. A
536
+ * first-page preview reads only the sections it holds, so its uses may be incomplete.
537
+ */
538
+ uses?: DocxStoryUse[];
539
+ }
540
+ /** Every story of the session at one version, sorted by id. */
541
+ interface DocxListStoriesResult {
542
+ ok: true;
543
+ version: string;
544
+ stories: DocxStoryInfo[];
545
+ }
504
546
 
505
547
  type DocxTextView = 'accepted' | 'original';
506
548
  /** Provenance only: history and revision authorship are chosen separately. */
@@ -586,6 +628,14 @@ type DocxEditOperation = {
586
628
  story: string;
587
629
  firstParaId: string;
588
630
  lastParaId: string;
631
+ } | {
632
+ op: 'insertSectionBreakAfter';
633
+ target: DocxParagraphTarget;
634
+ kind: SectionStartKind;
635
+ } | {
636
+ op: 'setSectionProperties';
637
+ section: string;
638
+ properties: SectionPropertyPatch;
589
639
  } | {
590
640
  op: 'setParagraphStyle';
591
641
  target: DocxParagraphTarget;
@@ -688,6 +738,39 @@ type DocxReadParagraphsResult = {
688
738
  view: DocxTextView;
689
739
  paragraphs: DocxParagraphText[];
690
740
  } | DocxEditRefusal;
741
+ interface DocxReadStoriesRequest {
742
+ /**
743
+ * `'all'` (the default) reads every story in id order. Listed entries are read in their order
744
+ * without repeats; an entry naming a kind stands for its stories in id order.
745
+ */
746
+ stories?: 'all' | ReadonlyArray<DocxStoryInfoKind | (string & {})>;
747
+ /** Matches listed kinds against each story's root, so `header` also selects header cells. */
748
+ byRoot?: boolean;
749
+ view: DocxTextView;
750
+ /** Refuses with `stale-version` when the document is at another version. */
751
+ expectVersion?: string;
752
+ }
753
+ /** One story's paragraphs, or why it could not be read. */
754
+ type DocxStoryText = {
755
+ story: string;
756
+ ok: true;
757
+ paragraphs: DocxParagraphText[];
758
+ } | {
759
+ story: string;
760
+ ok: false;
761
+ failure: DocxEditFailure;
762
+ };
763
+ type DocxReadStoriesResult = {
764
+ ok: true;
765
+ version: string;
766
+ view: DocxTextView;
767
+ stories: DocxStoryText[];
768
+ /**
769
+ * The read limits stopped the read before the next selected story. A story larger than the
770
+ * limits on its own reports `limit-exceeded` instead; page it with `readParagraphs` `paraIds`.
771
+ */
772
+ truncated: boolean;
773
+ } | DocxEditRefusal;
691
774
  interface DocxFindTextRequest {
692
775
  text: string;
693
776
  within: DocxSearchScope;
@@ -858,7 +941,7 @@ interface DocxFragmentGeometry {
858
941
  }>;
859
942
  }
860
943
  interface DocxPageDiagnostic {
861
- code: 'unmapped-content' | 'anchor-only' | 'not-laid-out' | 'unsupported-numbering' | 'unsupported-note-layout' | 'clipped-content' | 'geometry-unavailable' | 'truncated';
944
+ code: 'unmapped-content' | 'anchor-only' | 'not-laid-out' | 'unsupported-numbering' | 'unsupported-note-layout' | 'clipped-content' | 'geometry-unavailable' | 'truncated' | 'note-layout-fallback';
862
945
  nodeId: string | null;
863
946
  pageIndex: number | null;
864
947
  message: string;
@@ -904,4 +987,4 @@ interface DocxHeadlessLayoutOptions {
904
987
  };
905
988
  }
906
989
 
907
- export type { DocxUnlocatedReason as $, DocxExportDiagnostic as A, DocxExportDiagnosticCode as B, DocxExportFailureCode as C, DocxExportFailure as D, DocxExportInline as E, DocxExportPage as F, DocxExportRefusal as G, DocxExportResult as H, DocxExportStory as I, DocxExportTable as J, DocxFormattingMark as K, DocxFragmentGeometry as L, DocxHeadingInfo as M, DocxHeadlessFont as N, DocxInlineRevision as O, DocxLayoutProvenance as P, DocxListInfo as Q, DocxPageDiagnostic as R, DocxPageFragment as S, DocxPageMapContent as T, DocxParagraphData as U, DocxParagraphHeading as V, DocxRevisionView as W, DocxSnapshotLayoutProvenance as X, DocxStoryKind as Y, DocxStoryOccurrence as Z, DocxStorySelection as _, DocxExportOptions as a, DocxEditSuggestion as a0, DocxEditFailure as a1, DocxEditFailureCode as a2, DocxTextRange as a3, DocxReadParagraphsRequest as a4, DocxReadParagraphsResult as a5, DocxFindTextRequest as a6, DocxFindTextResult as a7, DocxEditRequest as a8, DocxValidationResult as a9, ValidationSuccess as aA, DocxEditResult as aa, DocxTextTarget as ab, DocxEditRefusal as ac, DocxAtomKind as ad, DocxEditFailureReason as ae, DocxEditGuard as af, DocxEditHistory as ag, DocxEditOperation as ah, DocxEditPreview as ai, DocxEditReceipt as aj, DocxEditSource as ak, DocxEditStep as al, DocxEditTarget as am, DocxParagraphInput as an, DocxParagraphTarget as ao, DocxParagraphText as ap, DocxResolvedControl as aq, DocxSearchScope as ar, DocxSetContentControlTextStep as as, DocxTextAtom as at, DocxTextMatch as au, DocxTextPosition as av, DocxTextView as aw, EditSuccess as ax, OperationFailure as ay, OperationRefusal as az, DocxMarkdownContent as b, DocxStructuredContent as c, DocxPageExportOptions as d, DocxHeadlessLayoutOptions as e, DocxPagedStructuredContent as f, DocxSnapshotLayoutMap as g, DocxMarkdownOptions as h, DocxLayoutMap as i, DocxPageMarkdownOptions as j, DocxContentControlReadFailure as k, DocxContentControlQuery as l, DocxContentControlsOptions as m, DocxContentControlsSnapshot as n, DocxAnchor as o, DocxAnchorScope as p, DocxCachedResult as q, DocxCommentMetadata as r, DocxContentControl as s, DocxContentControlDiagnostic as t, DocxContentControlSelector as u, DocxContentControlValue as v, DocxContentControlsResult as w, DocxControlMetadata as x, DocxExportBlock as y, DocxExportCell as z };
990
+ export { type DocxUnlocatedReason as $, type DocxExportDiagnostic as A, type DocxExportDiagnosticCode as B, type DocxExportFailureCode as C, type DocxExportFailure as D, type DocxExportInline as E, type DocxExportPage as F, type DocxExportRefusal as G, type DocxExportResult as H, type DocxExportStory as I, type DocxExportTable as J, type DocxFormattingMark as K, type DocxFragmentGeometry as L, type DocxHeadingInfo as M, type DocxHeadlessFont as N, type DocxInlineRevision as O, type DocxLayoutProvenance as P, type DocxListInfo as Q, type DocxPageDiagnostic as R, type DocxPageFragment as S, type DocxPageMapContent as T, type DocxParagraphData as U, type DocxParagraphHeading as V, type DocxRevisionView as W, type DocxSnapshotLayoutProvenance as X, type DocxStoryKind as Y, type DocxStoryOccurrence as Z, type DocxStorySelection as _, type DocxExportOptions as a, type DocxEditSuggestion as a0, type DocxEditFailure as a1, type DocxEditFailureCode as a2, type DocxFindTextRequest as a3, type DocxFindTextResult as a4, type DocxReadParagraphsRequest as a5, type DocxReadParagraphsResult as a6, type DocxEditRequest as a7, type DocxEditResult as a8, type DocxTextRange as a9, type DocxStoryInfo as aA, type DocxStoryInfoKind as aB, type DocxStoryText as aC, type DocxStoryUse as aD, type DocxTextAtom as aE, type DocxTextMatch as aF, type DocxTextPosition as aG, type DocxTextView as aH, type EditSuccess as aI, type OperationFailure as aJ, type OperationRefusal as aK, type ValidationSuccess as aL, type DocxReadStoriesRequest as aa, type DocxValidationResult as ab, type DocxListStoriesResult as ac, type DocxReadStoriesResult as ad, type SectionStartKind as ae, type SectionPropertyPatch as af, type SectionInfo as ag, type DocxTextTarget as ah, type DocxEditRefusal as ai, type DocxAtomKind as aj, type DocxEditFailureReason as ak, type DocxEditGuard as al, type DocxEditHistory as am, type DocxEditOperation as an, type DocxEditPreview as ao, type DocxEditReceipt as ap, type DocxEditSource as aq, type DocxEditStep as ar, type DocxEditTarget as as, type DocxParagraphInput as at, type DocxParagraphTarget as au, type DocxParagraphText as av, type DocxResolvedControl as aw, type DocxSearchScope as ax, DocxSectionError as ay, type DocxSetContentControlTextStep as az, type DocxMarkdownContent as b, type DocxStructuredContent as c, type DocxPageExportOptions as d, type DocxHeadlessLayoutOptions as e, type DocxPagedStructuredContent as f, type DocxSnapshotLayoutMap as g, type DocxMarkdownOptions as h, type DocxLayoutMap as i, type DocxPageMarkdownOptions as j, type DocxContentControlReadFailure as k, type DocxContentControlQuery as l, type DocxContentControlsOptions as m, type DocxContentControlsSnapshot as n, type DocxAnchor as o, type DocxAnchorScope as p, type DocxCachedResult as q, type DocxCommentMetadata as r, type DocxContentControl as s, type DocxContentControlDiagnostic as t, type DocxContentControlSelector as u, type DocxContentControlValue as v, type DocxContentControlsResult as w, type DocxControlMetadata as x, type DocxExportBlock as y, type DocxExportCell as z };
@@ -1,13 +1,11 @@
1
1
  import { RenderedDomContext, PositionCoordinates, PointPosition } from './index.mjs';
2
- import { D as DisplayListRect, a as DisplayListQueries } from '../displayListQueries-BVBDVXoP.mjs';
2
+ import { D as DisplayListRect, a as DisplayListQueries } from '../displayListQueries-6XjS7B5e.mjs';
3
3
  import '../types/document.mjs';
4
- import '../content-DSb-6a9T.mjs';
5
- import '../formatting-gqLFeJ9X.mjs';
4
+ import '../content-DVT06V_6.mjs';
5
+ import '../formatting-p5MneNuy.mjs';
6
6
  import '../docx/wrapTypes.mjs';
7
- import '../styles-AryxLAhx.mjs';
8
- import '../frameDelta-CLeO7K5z.mjs';
9
- import '../rustDisplayList-B7uPoItK.mjs';
10
- import '../types-Cz7S77Ut.mjs';
7
+ import '../styles-DZZz2oRy.mjs';
8
+ import '../types-bvPg3KsF.mjs';
11
9
  import '../layout/pagination/index.mjs';
12
10
 
13
11
  /**
@@ -1,8 +1,8 @@
1
1
  import { Document } from '../types/document.mjs';
2
- import '../content-DSb-6a9T.mjs';
3
- import '../formatting-gqLFeJ9X.mjs';
2
+ import '../content-DVT06V_6.mjs';
3
+ import '../formatting-p5MneNuy.mjs';
4
4
  import '../docx/wrapTypes.mjs';
5
- import '../styles-AryxLAhx.mjs';
5
+ import '../styles-DZZz2oRy.mjs';
6
6
 
7
7
  /**
8
8
  * Framework-Agnostic Plugin Interface for the DOCX Editor
@@ -1,9 +1,9 @@
1
1
  import { SidebarItem, RenderedDomContext } from './index.mjs';
2
2
  import '../types/document.mjs';
3
- import '../content-DSb-6a9T.mjs';
4
- import '../formatting-gqLFeJ9X.mjs';
3
+ import '../content-DVT06V_6.mjs';
4
+ import '../formatting-p5MneNuy.mjs';
5
5
  import '../docx/wrapTypes.mjs';
6
- import '../styles-AryxLAhx.mjs';
6
+ import '../styles-DZZz2oRy.mjs';
7
7
 
8
8
  /**
9
9
  * Pure layout algorithm: given a list of sidebar items + their
@@ -18,7 +18,13 @@ interface RepackOptions {
18
18
  }
19
19
  /** Repack a public Document through the Rust package writer. */
20
20
  declare function repackDocx(doc: Document, options?: RepackOptions): Promise<ArrayBuffer>;
21
+ interface RepackResult {
22
+ buffer: ArrayBuffer;
23
+ warnings: string[];
24
+ }
25
+ /** [`repackDocx`], also returning the non-fatal save diagnostics. */
26
+ declare function repackDocxWithWarnings(doc: Document, options?: RepackOptions): Promise<RepackResult>;
21
27
  declare function updateMultipleFiles(originalBuffer: ArrayBuffer, updates: Map<string, string | ArrayBuffer>, options?: RepackOptions): Promise<ArrayBuffer>;
22
28
  declare function createDocx(doc: Document): Promise<ArrayBuffer>;
23
29
 
24
- export { type RepackOptions as R, createDocx as c, repackDocx as r, updateMultipleFiles as u };
30
+ export { type RepackResult as R, repackDocxWithWarnings as a, type RepackOptions as b, createDocx as c, repackDocx as r, updateMultipleFiles as u };
@@ -1,5 +1,5 @@
1
- import { a as ParagraphFormatting, b as TextFormatting } from '../formatting-gqLFeJ9X.mjs';
2
- import { S as StyleDefinitions, a as Style, D as DocDefaults } from '../styles-AryxLAhx.mjs';
1
+ import { P as ParagraphFormatting, T as TextFormatting } from '../formatting-p5MneNuy.mjs';
2
+ import { S as StyleDefinitions, a as Style, D as DocDefaults } from '../styles-DZZz2oRy.mjs';
3
3
 
4
4
  /**
5
5
  * Style Resolver
@@ -54,7 +54,7 @@ declare class StyleResolver {
54
54
  * @param styleId - The style ID to resolve (e.g., 'Heading1', 'Normal')
55
55
  * @returns Resolved paragraph and run formatting
56
56
  */
57
- resolveParagraphStyle(styleId: string | undefined | null, tableParagraphFormatting?: ParagraphFormatting): ResolvedParagraphStyle;
57
+ resolveParagraphStyle(styleId: string | undefined | null, tableParagraphFormatting?: ParagraphFormatting, tableRunFormatting?: TextFormatting): ResolvedParagraphStyle;
58
58
  /**
59
59
  * Resolve the style applied to the paragraph that follows one styled with
60
60
  * `styleId` when the user presses Enter (OOXML `w:next`, §17.7.4.10).
@@ -1 +1 @@
1
- export{c as StyleResolver,d as createStyleResolver}from'../chunk-47Q2FMFF.mjs';import'../chunk-TTRUPDAB.mjs';
1
+ export{d as StyleResolver,e as createStyleResolver}from'../chunk-ISBZLVIF.mjs';import'../chunk-TTRUPDAB.mjs';
@@ -1,4 +1,4 @@
1
- import { b as TextFormatting, a as ParagraphFormatting, c as TableFormatting, d as TableRowFormatting, e as TableCellFormatting } from './formatting-gqLFeJ9X.mjs';
1
+ import { T as TextFormatting, P as ParagraphFormatting, c as TableFormatting, d as TableRowFormatting, e as TableCellFormatting } from './formatting-p5MneNuy.mjs';
2
2
 
3
3
  /**
4
4
  * Styles, Theme, Font Table, Relationships & Media Types
@@ -58,7 +58,7 @@ interface Style {
58
58
  tcPr?: TableCellFormatting;
59
59
  /** Conditional table style parts */
60
60
  tblStylePr?: Array<{
61
- type: 'band1Horz' | 'band1Vert' | 'band2Horz' | 'band2Vert' | 'firstCol' | 'firstRow' | 'lastCol' | 'lastRow' | 'neCell' | 'nwCell' | 'seCell' | 'swCell';
61
+ type: 'wholeTable' | 'band1Horz' | 'band1Vert' | 'band2Horz' | 'band2Vert' | 'firstCol' | 'firstRow' | 'lastCol' | 'lastRow' | 'neCell' | 'nwCell' | 'seCell' | 'swCell';
62
62
  pPr?: ParagraphFormatting;
63
63
  rPr?: TextFormatting;
64
64
  tblPr?: TableFormatting;
@@ -1,3 +1,3 @@
1
- export { B as BlockContent, l as BlockSdt, m as BookmarkEnd, n as BookmarkStart, o as BreakContent, d as Chart, p as ChartAxis, q as ChartContent, t as ChartLegend, x as ChartSeries, y as ChartType, z as Column, e as Comment, J as CommentRangeEnd, K as CommentRangeStart, M as ComplexField, Q as DEFAULT_WATERMARK_PRESETS, T as Deletion, g as DocumentBody, U as DrawingContent, j as Endnote, X as EndnotePosition, E as EndnoteProperties, Y as Field, Z as FieldCharContent, a0 as FieldType, a1 as FooterReference, i as Footnote, a2 as FootnotePosition, F as FootnoteProperties, H as HeaderFooter, a3 as HeaderFooterType, a4 as HeaderReference, a6 as Hyperlink, a8 as Image, a9 as ImageCrop, ac as ImagePadding, ad as ImagePosition, af as ImageSize, ag as ImageTransform, ah as ImageWrap, aj as InlineSdt, ak as Insertion, al as InstrTextContent, an as LineNumberRestart, aq as MathEquation, ar as MoveFrom, as as MoveFromRangeEnd, at as MoveFromRangeStart, au as MoveTo, av as MoveToRangeEnd, aw as MoveToRangeStart, ax as NoBreakHyphenContent, ay as NoteNumberRestart, az as NoteRefMarkContent, aA as NoteReferenceContent, aF as PageOrientation, P as Paragraph, aG as ParagraphContent, aH as ParagraphPropertyChange, aI as PictureWatermark, aJ as PropertyChangeInfo, bi as RawXml, aK as Run, aL as RunContent, aM as RunPropertyChange, aO as SdtDataBinding, a as SdtProperties, aR as SdtType, aS as Section, f as SectionProperties, aT as SectionStart, aU as SeparatorContent, aV as Shape, aW as ShapeContent, aZ as ShapeTextBody, a_ as SimpleField, a$ as SoftHyphenContent, b2 as SymbolContent, b3 as TabContent, b4 as Table, b5 as TableCell, b6 as TableCellPropertyChange, b7 as TablePropertyChange, b8 as TableRow, b9 as TableRowPropertyChange, ba as TableStructuralChangeInfo, bb as TextBox, bc as TextContent, bd as TextWatermark, be as TrackedChangeInfo, bf as TrackedRunChange, bg as VerticalAlign, W as Watermark, bh as pictureWatermarkDisplayEmu } from '../content-DSb-6a9T.mjs';
2
- export { k as ShapeFill, l as ShapeOutline, m as ShapeType } from '../formatting-gqLFeJ9X.mjs';
1
+ export { B as BlockContent, l as BlockSdt, m as BookmarkEnd, n as BookmarkStart, o as BreakContent, d as Chart, p as ChartAxis, q as ChartContent, t as ChartLegend, x as ChartSeries, y as ChartType, z as Column, e as Comment, J as CommentRangeEnd, K as CommentRangeStart, M as ComplexField, Q as DEFAULT_WATERMARK_PRESETS, T as Deletion, g as DocumentBody, U as DrawingContent, j as Endnote, X as EndnotePosition, E as EndnoteProperties, Y as Field, Z as FieldCharContent, a0 as FieldType, a1 as FooterReference, i as Footnote, a2 as FootnotePosition, F as FootnoteProperties, H as HeaderFooter, a3 as HeaderFooterType, a4 as HeaderReference, a6 as Hyperlink, a8 as Image, a9 as ImageCrop, ac as ImagePadding, ad as ImagePosition, af as ImageSize, ag as ImageTransform, ah as ImageWrap, aj as InlineSdt, ak as Insertion, al as InstrTextContent, an as LineNumberRestart, aq as MathEquation, ar as MoveFrom, as as MoveFromRangeEnd, at as MoveFromRangeStart, au as MoveTo, av as MoveToRangeEnd, aw as MoveToRangeStart, ax as NoBreakHyphenContent, ay as NoteNumberRestart, az as NoteRefMarkContent, aA as NoteReferenceContent, aE as OpaqueDrawingContent, aG as PageOrientation, P as Paragraph, aH as ParagraphContent, aI as ParagraphPropertyChange, aJ as PictureWatermark, aK as PropertyChangeInfo, bj as RawXml, aL as Run, aM as RunContent, aN as RunPropertyChange, aP as SdtDataBinding, a as SdtProperties, aS as SdtType, aT as Section, f as SectionProperties, aU as SectionStart, aV as SeparatorContent, aW as Shape, aX as ShapeContent, a_ as ShapeTextBody, a$ as SimpleField, b0 as SoftHyphenContent, b3 as SymbolContent, b4 as TabContent, b5 as Table, b6 as TableCell, b7 as TableCellPropertyChange, b8 as TablePropertyChange, b9 as TableRow, ba as TableRowPropertyChange, bb as TableStructuralChangeInfo, bc as TextBox, bd as TextContent, be as TextWatermark, bf as TrackedChangeInfo, bg as TrackedRunChange, bh as VerticalAlign, W as Watermark, bi as pictureWatermarkDisplayEmu } from '../content-DVT06V_6.mjs';
2
+ export { m as ShapeFill, n as ShapeOutline, o as ShapeType } from '../formatting-p5MneNuy.mjs';
3
3
  import '../docx/wrapTypes.mjs';
@@ -1,9 +1,9 @@
1
- import { F as FootnoteProperties, E as EndnoteProperties, g as DocumentBody, h as NumberingDefinitions, i as Footnote, j as Endnote, H as HeaderFooter, d as Chart, k as BookmarkRange } from '../content-DSb-6a9T.mjs';
2
- export { A as AbstractNumbering, B as BlockContent, l as BlockSdt, m as BookmarkEnd, n as BookmarkStart, o as BreakContent, p as ChartAxis, q as ChartContent, r as ChartDataLabels, s as ChartGrouping, t as ChartLegend, u as ChartPlotGroup, v as ChartPoint, w as ChartPointLabel, x as ChartSeries, y as ChartType, z as Column, e as Comment, G as CommentAnchorRange, I as CommentAuthor, J as CommentRangeEnd, K as CommentRangeStart, L as CommentReferenceContent, M as ComplexField, O as ContentPosition, Q as DEFAULT_WATERMARK_PRESETS, T as Deletion, U as DrawingContent, D as DrawingScene, V as DrawingSceneNode, X as EndnotePosition, Y as Field, Z as FieldCharContent, _ as FieldFormData, $ as FieldInlineContent, a0 as FieldType, a1 as FooterReference, a2 as FootnotePosition, a3 as HeaderFooterType, a4 as HeaderReference, a5 as HorizontalRuleContent, a6 as Hyperlink, a7 as HyperlinkContent, a8 as Image, a9 as ImageCrop, aa as ImageEffect, ab as ImageHyperlink, ac as ImagePadding, ad as ImagePosition, ae as ImageRotationBounds, af as ImageSize, ag as ImageTransform, ah as ImageWrap, ai as ImageWrapPoint, aj as InlineSdt, ak as Insertion, al as InstrTextContent, am as LevelSuffix, an as LineNumberRestart, ao as ListLevel, ap as ListRendering, aq as MathEquation, ar as MoveFrom, as as MoveFromRangeEnd, at as MoveFromRangeStart, au as MoveTo, av as MoveToRangeEnd, aw as MoveToRangeStart, ax as NoBreakHyphenContent, N as NoteKind, ay as NoteNumberRestart, az as NoteRefMarkContent, aA as NoteReferenceContent, aB as NoteSeparatorReference, aC as NumberFormat, aD as NumberingInstance, aE as PageNumberingProperties, aF as PageOrientation, P as Paragraph, aG as ParagraphContent, aH as ParagraphPropertyChange, aI as PictureWatermark, aJ as PropertyChangeInfo, aK as Run, aL as RunContent, aM as RunPropertyChange, aN as SdtCheckboxGlyph, S as SdtControlState, aO as SdtDataBinding, aP as SdtDateState, aQ as SdtGalleryState, a as SdtProperties, aR as SdtType, aS as Section, f as SectionProperties, aT as SectionStart, aU as SeparatorContent, aV as Shape, aW as ShapeContent, b as ShapeEffect, aX as ShapeFillPaint, aY as ShapeStrokePaint, aZ as ShapeTextBody, c as ShapeTextBodyProperties, a_ as SimpleField, a$ as SoftHyphenContent, b0 as StructuredFieldContent, b1 as StructuredFieldTree, b2 as SymbolContent, b3 as TabContent, b4 as Table, b5 as TableCell, b6 as TableCellPropertyChange, b7 as TablePropertyChange, b8 as TableRow, b9 as TableRowPropertyChange, ba as TableStructuralChangeInfo, bb as TextBox, bc as TextContent, bd as TextWatermark, be as TrackedChangeInfo, bf as TrackedRunChange, bg as VerticalAlign, W as Watermark, bh as pictureWatermarkDisplayEmu } from '../content-DSb-6a9T.mjs';
3
- import { f as Theme, C as ColorValue } from '../formatting-gqLFeJ9X.mjs';
4
- export { B as BorderSpec, g as CellMargins, h as ConditionalFormatStyle, E as EmphasisMark, F as FloatingTableProperties, L as LineSpacingRule, i as ParagraphAlignment, a as ParagraphFormatting, R as RunFontHint, j as RunLanguage, S as ShadingProperties, k as ShapeFill, l as ShapeOutline, m as ShapeType, n as TabLeader, o as TabStop, p as TabStopAlignment, q as TableBorders, e as TableCellFormatting, c as TableFormatting, r as TableLook, s as TableMeasurement, d as TableRowFormatting, t as TableStyleCascade, u as TableStyleRegion, v as TableWidthType, w as TextEffect, b as TextFormatting, T as TextModernEffects, x as ThemeColorScheme, y as ThemeColorSlot, z as ThemeFont, A as ThemeFontScheme, U as UnderlineStyle } from '../formatting-gqLFeJ9X.mjs';
5
- import { S as StyleDefinitions, F as FontTable, R as RelationshipMap, M as MediaFile } from '../styles-AryxLAhx.mjs';
6
- export { D as DocDefaults, b as FontEmbed, c as FontInfo, d as Relationship, e as RelationshipType, a as Style, f as StyleType } from '../styles-AryxLAhx.mjs';
1
+ import { F as FootnoteProperties, E as EndnoteProperties, g as DocumentBody, h as NumberingDefinitions, i as Footnote, j as Endnote, H as HeaderFooter, d as Chart, k as BookmarkRange } from '../content-DVT06V_6.mjs';
2
+ export { A as AbstractNumbering, B as BlockContent, l as BlockSdt, m as BookmarkEnd, n as BookmarkStart, o as BreakContent, p as ChartAxis, q as ChartContent, r as ChartDataLabels, s as ChartGrouping, t as ChartLegend, u as ChartPlotGroup, v as ChartPoint, w as ChartPointLabel, x as ChartSeries, y as ChartType, z as Column, e as Comment, G as CommentAnchorRange, I as CommentAuthor, J as CommentRangeEnd, K as CommentRangeStart, L as CommentReferenceContent, M as ComplexField, O as ContentPosition, Q as DEFAULT_WATERMARK_PRESETS, T as Deletion, U as DrawingContent, D as DrawingScene, V as DrawingSceneNode, X as EndnotePosition, Y as Field, Z as FieldCharContent, _ as FieldFormData, $ as FieldInlineContent, a0 as FieldType, a1 as FooterReference, a2 as FootnotePosition, a3 as HeaderFooterType, a4 as HeaderReference, a5 as HorizontalRuleContent, a6 as Hyperlink, a7 as HyperlinkContent, a8 as Image, a9 as ImageCrop, aa as ImageEffect, ab as ImageHyperlink, ac as ImagePadding, ad as ImagePosition, ae as ImageRotationBounds, af as ImageSize, ag as ImageTransform, ah as ImageWrap, ai as ImageWrapPoint, aj as InlineSdt, ak as Insertion, al as InstrTextContent, am as LevelSuffix, an as LineNumberRestart, ao as ListLevel, ap as ListRendering, aq as MathEquation, ar as MoveFrom, as as MoveFromRangeEnd, at as MoveFromRangeStart, au as MoveTo, av as MoveToRangeEnd, aw as MoveToRangeStart, ax as NoBreakHyphenContent, N as NoteKind, ay as NoteNumberRestart, az as NoteRefMarkContent, aA as NoteReferenceContent, aB as NoteSeparatorReference, aC as NumberFormat, aD as NumberingInstance, aE as OpaqueDrawingContent, aF as PageNumberingProperties, aG as PageOrientation, P as Paragraph, aH as ParagraphContent, aI as ParagraphPropertyChange, aJ as PictureWatermark, aK as PropertyChangeInfo, aL as Run, aM as RunContent, aN as RunPropertyChange, aO as SdtCheckboxGlyph, S as SdtControlState, aP as SdtDataBinding, aQ as SdtDateState, aR as SdtGalleryState, a as SdtProperties, aS as SdtType, aT as Section, f as SectionProperties, aU as SectionStart, aV as SeparatorContent, aW as Shape, aX as ShapeContent, b as ShapeEffect, aY as ShapeFillPaint, aZ as ShapeStrokePaint, a_ as ShapeTextBody, c as ShapeTextBodyProperties, a$ as SimpleField, b0 as SoftHyphenContent, b1 as StructuredFieldContent, b2 as StructuredFieldTree, b3 as SymbolContent, b4 as TabContent, b5 as Table, b6 as TableCell, b7 as TableCellPropertyChange, b8 as TablePropertyChange, b9 as TableRow, ba as TableRowPropertyChange, bb as TableStructuralChangeInfo, bc as TextBox, bd as TextContent, be as TextWatermark, bf as TrackedChangeInfo, bg as TrackedRunChange, bh as VerticalAlign, W as Watermark, bi as pictureWatermarkDisplayEmu } from '../content-DVT06V_6.mjs';
3
+ import { f as Theme, C as ColorValue } from '../formatting-p5MneNuy.mjs';
4
+ export { B as BorderSpec, g as CellMargins, h as ColorTransform, i as ConditionalFormatStyle, E as EmphasisMark, F as FloatingTableProperties, L as LineSpacingRule, j as ParagraphAlignment, k as ParagraphCnfStyle, P as ParagraphFormatting, R as RunFontHint, l as RunLanguage, S as ShadingProperties, m as ShapeFill, n as ShapeOutline, o as ShapeType, p as TabLeader, q as TabStop, r as TabStopAlignment, s as TableBorders, e as TableCellFormatting, c as TableFormatting, t as TableLook, u as TableMeasurement, d as TableRowFormatting, v as TableStyleCascade, w as TableStyleRegion, x as TableWidthType, y as TextEffect, T as TextFormatting, a as TextModernEffects, z as ThemeColorScheme, A as ThemeColorSlot, D as ThemeFont, G as ThemeFontScheme, U as UnderlineStyle } from '../formatting-p5MneNuy.mjs';
5
+ import { S as StyleDefinitions, F as FontTable, R as RelationshipMap, M as MediaFile } from '../styles-DZZz2oRy.mjs';
6
+ export { D as DocDefaults, b as FontEmbed, c as FontInfo, d as Relationship, e as RelationshipType, a as Style, f as StyleType } from '../styles-DZZz2oRy.mjs';
7
7
  import '../docx/wrapTypes.mjs';
8
8
 
9
9
  interface CompatibilityFlags {
@@ -1,5 +1,5 @@
1
- import { S as SdtControlState, a as SdtProperties, R as RevisionInfo, C as CellMarker, D as DrawingScene, b as ShapeEffect, c as ShapeTextBodyProperties, d as Chart, W as Watermark, F as FootnoteProperties, E as EndnoteProperties } from './content-DSb-6a9T.mjs';
2
- import { T as TextModernEffects, P as PresetGeometryPathCommand, B as BorderSpec } from './formatting-gqLFeJ9X.mjs';
1
+ import { S as SdtControlState, a as SdtProperties, R as RevisionInfo, C as CellMarker, D as DrawingScene, b as ShapeEffect, c as ShapeTextBodyProperties, d as Chart, W as Watermark, F as FootnoteProperties, E as EndnoteProperties } from './content-DVT06V_6.mjs';
2
+ import { a as TextModernEffects, b as PresetGeometryPathCommand, B as BorderSpec } from './formatting-p5MneNuy.mjs';
3
3
 
4
4
  /**
5
5
  * Inline SDT widget metadata carried by a painted text run.
@@ -301,6 +301,9 @@ type ImageRun = {
301
301
  allowOverlap?: boolean;
302
302
  /** `wp:anchor/@layoutInCell`; undefined = true. */
303
303
  layoutInCell?: boolean;
304
+ noChangeAspect?: boolean;
305
+ /** VML `o:hr` picture: alone on its line, the line is the picture's height. */
306
+ horizontalRule?: boolean;
304
307
  /** Effect extent in px. Undefined = zero. */
305
308
  effectExtent?: {
306
309
  top?: number;
@@ -532,6 +535,7 @@ type CellBorderSpec = {
532
535
  width?: number;
533
536
  color?: string;
534
537
  style?: string;
538
+ ooxmlStyle?: string;
535
539
  };
536
540
  /**
537
541
  * Border edges of a single cell.
@@ -655,8 +659,10 @@ type TableBlock = {
655
659
  value?: number;
656
660
  type?: 'auto' | 'pct' | 'dxa' | 'nil';
657
661
  };
658
- /** `w:tblLayout`; undefined preserves the legacy resolver. */
662
+ /** Width layout policy; undefined preserves the legacy resolver. */
659
663
  layoutMode?: 'fixed' | 'autofit';
664
+ /** DOCX `w:tblLayout`, applied only when all cell content widths are known. */
665
+ tableLayout?: 'fixed' | 'autofit';
660
666
  /** Intrinsic sizing policy. Undefined = legacy fill-available-width. */
661
667
  widthAlgorithm?: 'legacy' | 'fixed' | 'autofit';
662
668
  /** Resolved table-style provenance/conditionals. */
@@ -1291,6 +1297,12 @@ type TableFragment = FragmentBase & {
1291
1297
  * visible band of that single row is `[clipTop, clipBottom)`.
1292
1298
  */
1293
1299
  clipBottom?: number;
1300
+ cellClips?: {
1301
+ row: number;
1302
+ cell: number;
1303
+ top: number;
1304
+ bottom: number;
1305
+ }[];
1294
1306
  };
1295
1307
  /**
1296
1308
  * An image placed on a page.
@@ -1509,6 +1521,7 @@ type HeaderFooterLayout = {
1509
1521
  * The paginator's complete result — everything the painter needs.
1510
1522
  */
1511
1523
  type Layout = {
1524
+ summaryOnly?: true;
1512
1525
  /** Serialization contract version. Undefined reads as legacy version 0. */
1513
1526
  contractVersion?: number;
1514
1527
  /** Default page size for the document. */
@@ -1,5 +1,5 @@
1
- import { P as Paragraph, B as BlockContent, e as Comment } from '../content-DSb-6a9T.mjs';
2
- import '../formatting-gqLFeJ9X.mjs';
1
+ import { P as Paragraph, B as BlockContent, e as Comment } from '../content-DVT06V_6.mjs';
2
+ import '../formatting-p5MneNuy.mjs';
3
3
  import '../docx/wrapTypes.mjs';
4
4
 
5
5
  /**
@@ -1,2 +1 @@
1
- import'../chunk-TTRUPDAB.mjs';function F(){return {matchCase:false,matchWholeWord:false,useRegex:false}}function g(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function p(t,e){if(!t)return null;try{let n;e.useRegex?n=t:n=g(t),e.matchWholeWord&&(n=`\\b${n}\\b`);let r=e.matchCase?"g":"gi";return new RegExp(n,r)}catch{return null}}function l(t,e,n){if(!t||!e)return [];let r=[],o=e;n.matchCase||(o=e.toLowerCase());let c=h=>h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i;n.matchWholeWord?i=`\\b${c(o)}\\b`:i=c(o);let a=n.matchCase?"g":"gi",s=new RegExp(i,a),f;for(;(f=s.exec(t))!==null;)r.push({start:f.index,end:f.index+f[0].length}),f[0].length===0&&s.lastIndex++;return r}function y(t,e,n,r){let o=p(e,r);return o?t.replace(o,n):t}function C(t,e,n,r,o=0){let c=l(t,e,r),i=c.find(s=>s.start>=o)||c[0];return i?{content:t.substring(0,i.start)+n+t.substring(i.end),replaced:true,matchStart:i.start,matchEnd:i.start+n.length}:{content:t,replaced:false,matchStart:-1,matchEnd:-1}}function M(t){return t?t.totalCount===0?"No results":t.totalCount===1?"1 match":`${t.currentIndex+1} of ${t.totalCount} matches`:""}function O(t){return !t||t.trim()===""}function R(){return {currentMatchColor:"#FFFF00",otherMatchColor:"#FFFFAA"}}function u(t){if(!t||!t.content)return "";let e="";for(let n of t.content)n.type==="text"?e+=n.text||"":n.type==="tab"?e+=" ":n.type==="break"&&n.breakType==="textWrapping"&&(e+=`
2
- `);return e}function d(t){if(!t||!t.content)return "";let e="";for(let n of t.content)if(n.type==="run")e+=u(n);else if(n.type==="hyperlink")for(let r of n.children||[])r.type==="run"&&(e+=u(r));return e}function E(t,e,n){if(!t||!e)return [];let r=[],o=t.package?.document||t.package?.document;if(!o||!o.content)return r;let c=0;for(let i of o.content)if(i.type==="paragraph"){let a=x(i,e,n,c);r.push(...a),c++;}else if(i.type==="table")for(let a of i.rows||[])for(let s of a.cells||[])for(let f of s.content||[])f.type;return r}function x(t,e,n,r){let o=[],c=d(t);if(!c)return o;let i=l(c,e,n);for(let a of i){let s=m(t,a.start);o.push({paragraphIndex:r,contentIndex:s.contentIndex,startOffset:s.offsetInContent,endOffset:s.offsetInContent+(a.end-a.start),text:c.substring(a.start,a.end)});}return o}function m(t,e){if(!t||!t.content)return {contentIndex:0,runIndex:0,offsetInContent:e};let n=0,r=0;for(let o of t.content){let c="";if(o.type==="run")c=u(o);else if(o.type==="hyperlink")for(let a of o.children||[])a.type==="run"&&(c+=u(a));let i=c.length;if(n+i>e)return {contentIndex:r,runIndex:r,offsetInContent:e-n};n+=i,r++;}return {contentIndex:Math.max(0,t.content.length-1),runIndex:Math.max(0,t.content.length-1),offsetInContent:0}}function w(t,e){if(!t||!e)return;let n=t.querySelector(`[data-paragraph-index="${e.paragraphIndex}"]`);n&&n.scrollIntoView({behavior:"smooth",block:"center"});}export{F as createDefaultFindOptions,p as createSearchPattern,g as escapeRegexString,l as findAllMatches,E as findInDocument,x as findInParagraph,R as getDefaultHighlightOptions,M as getMatchCountText,O as isEmptySearch,y as replaceAllInContent,C as replaceFirstInContent,w as scrollToMatch};
1
+ export{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}from'../chunk-N5RE2S3U.mjs';import'../chunk-TTRUPDAB.mjs';
@@ -1,13 +1,13 @@
1
1
  export { PIXELS_PER_INCH, TWIPS_PER_INCH, clamp, eighthsToPixels, emuToPixels, emuToTwips, formatPx, halfPointsToPixels, halfPointsToPoints, pixelsToEmu, pixelsToTwips, pointsToHalfPoints, pointsToPixels, roundPixels, twipsToEmu, twipsToPixels } from './units.mjs';
2
- import { F as FontLoadScope } from '../fontLoader-BNSs0E8K.mjs';
3
- export { C as BufferFaceInput, D as FONT_MAPPING, E as FontDefinition, T as ThemeMatrixCell, b as blendColors, c as canRenderFont, a as colorsEqual, G as createFontLoadScope, d as createRgbColor, e as createThemeColor, f as darkenColor, g as ensureHexPrefix, H as extractFontsFromDocument, h as generateThemeTintShadeMatrix, i as getContrastingColor, I as getGoogleFontEquivalent, j as getLoadedFonts, k as getThemeTintShadeHex, l as isBlack, m as isFontLoaded, o as isGoogleFontsEnabled, n as isLoading, p as isWhite, q as lightenColor, J as loadDocumentFonts, r as loadFont, K as loadFontDefinitions, s as loadFontFromBuffer, L as loadFontFromUrl, M as loadFontWithMapping, t as loadFonts, N as loadFontsWithMapping, O as onFontError, u as onFontsLoaded, v as parseColorString, w as preloadCommonFonts, P as registerDocumentFaces, x as resolveColor, Q as resolveColorToHex, y as resolveHighlightColor, z as resolveHighlightToCss, A as resolveShadingColor, B as setGoogleFontsEnabled } from '../fontLoader-BNSs0E8K.mjs';
2
+ import { F as FontLoadScope } from '../fontLoader-CBkmh4ps.mjs';
3
+ export { C as BufferFaceInput, D as FONT_MAPPING, E as FontDefinition, T as ThemeMatrixCell, b as blendColors, c as canRenderFont, a as colorsEqual, G as createFontLoadScope, d as createRgbColor, e as createThemeColor, f as darkenColor, g as ensureHexPrefix, H as extractFontsFromDocument, h as generateThemeTintShadeMatrix, i as getContrastingColor, I as getGoogleFontEquivalent, j as getLoadedFonts, k as getThemeTintShadeHex, l as isBlack, m as isFontLoaded, o as isGoogleFontsEnabled, n as isLoading, p as isWhite, q as lightenColor, J as loadDocumentFonts, r as loadFont, K as loadFontDefinitions, s as loadFontFromBuffer, L as loadFontFromUrl, M as loadFontWithMapping, t as loadFonts, N as loadFontsWithMapping, O as onFontError, u as onFontsLoaded, v as parseColorString, w as preloadCommonFonts, P as registerDocumentFaces, x as resolveColor, Q as resolveColorToHex, y as resolveHighlightColor, z as resolveHighlightToCss, A as resolveShadingColor, B as setGoogleFontsEnabled } from '../fontLoader-CBkmh4ps.mjs';
4
4
  export { D as DocxInput, t as toArrayBuffer } from '../docxInput-DTbCa48g.mjs';
5
- import { F as FontTable } from '../styles-AryxLAhx.mjs';
5
+ import { F as FontTable } from '../styles-DZZz2oRy.mjs';
6
6
  import { Document } from '../types/document.mjs';
7
7
  import { FontOption } from './fontOptions.mjs';
8
8
  export { MIN_CARD_GAP, SIDEBAR_DOCUMENT_SHIFT, SIDEBAR_PAGE_GAP, SIDEBAR_WIDTH } from './sidebarConstants.mjs';
9
- import { e as Comment } from '../content-DSb-6a9T.mjs';
10
- import '../formatting-gqLFeJ9X.mjs';
9
+ import { e as Comment } from '../content-DVT06V_6.mjs';
10
+ import '../formatting-p5MneNuy.mjs';
11
11
  import '../docx/wrapTypes.mjs';
12
12
 
13
13
  /**
@@ -1 +1 @@
1
- export{d as MIN_CARD_GAP,c as SIDEBAR_DOCUMENT_SHIFT,b as SIDEBAR_PAGE_GAP,a as SIDEBAR_WIDTH}from'../chunk-YUOKI2HB.mjs';export{f as blendColors,r as colorsEqual,o as createRgbColor,n as createThemeColor,d as darkenColor,p as ensureHexPrefix,h as generateThemeTintShadeMatrix,c as getContrastingColor,g as getThemeTintShadeHex,k as isBlack,l as isWhite,e as lightenColor,m as parseColorString,a as resolveColor,b as resolveColorToHex,i as resolveHighlightColor,q as resolveHighlightToCss,j as resolveShadingColor}from'../chunk-LTVVQMHB.mjs';export{a as PIXELS_PER_INCH,e as TWIPS_PER_INCH,p as clamp,n as eighthsToPixels,b as emuToPixels,i as emuToTwips,q as formatPx,k as halfPointsToPixels,l as halfPointsToPoints,c as pixelsToEmu,h as pixelsToTwips,m as pointsToHalfPoints,d as pointsToPixels,o as roundPixels,j as twipsToEmu,g as twipsToPixels}from'../chunk-CTBUQRYQ.mjs';import {n,d}from'../chunk-VH7P4734.mjs';export{s as FONT_MAPPING,n as canRenderFont,z as createFontLoadScope,c as deobfuscateFont,C as extractEmbeddedFontFaces,x as extractFontsFromDocument,B as getEmbeddedFontFaces,A as getEmbeddedFontFamilies,t as getGoogleFontEquivalent,k as getLoadedFonts,g as isFontLoaded,i as isGoogleFontsEnabled,j as isLoading,b as isValidFontKey,y as loadDocumentFonts,E as loadEmbeddedFontFamilies,D as loadEmbeddedFonts,e as loadFont,r as loadFontDefinitions,o as loadFontFromBuffer,q as loadFontFromUrl,u as loadFontWithMapping,f as loadFonts,v as loadFontsWithMapping,m as onFontError,l as onFontsLoaded,w as preloadCommonFonts,p as registerDocumentFaces,h as setGoogleFontsEnabled,a as toArrayBuffer}from'../chunk-VH7P4734.mjs';import'../chunk-EBYC3CX7.mjs';import {a}from'../chunk-UBUTIWXN.mjs';import'../chunk-LT2GCWZ3.mjs';import'../chunk-HPZFJGGM.mjs';import'../chunk-AXFMDV66.mjs';import'../chunk-GKWXOZZH.mjs';import'../chunk-HGKSOBXK.mjs';import'../chunk-DLXIZBB6.mjs';import'../chunk-TTRUPDAB.mjs';function L(e){let t=new Set,o=e.package;if(o.theme&&it(o.theme,t),o.styles&&lt(o.styles,t),o.document)for(let n of o.document.content)y(n,t);if(o.headers)for(let n of o.headers.values())H(n,t);if(o.footers)for(let n of o.footers.values())H(n,t);if(o.footnotes)for(let n of o.footnotes)ht(n,t);if(o.endnotes)for(let n of o.endnotes)xt(n,t);return Array.from(t).sort()}function it(e,t){let o=e.fontScheme;o&&(o.majorFont&&O(o.majorFont,t),o.minorFont&&O(o.minorFont,t));}function O(e,t){if(e.latin&&t.add(e.latin),e.ea&&t.add(e.ea),e.cs&&t.add(e.cs),e.fonts)for(let o of Object.values(e.fonts))o&&t.add(o);}function lt(e,t){e.docDefaults&&(e.docDefaults.rPr&&x(e.docDefaults.rPr,t),e.docDefaults.pPr?.runProperties&&x(e.docDefaults.pPr.runProperties,t));for(let o of e.styles)o.rPr&&x(o.rPr,t),o.pPr?.runProperties&&x(o.pPr.runProperties,t);}function x(e,t){let o=e.fontFamily;o&&(o.ascii&&t.add(o.ascii),o.hAnsi&&t.add(o.hAnsi),o.eastAsia&&t.add(o.eastAsia),o.cs&&t.add(o.cs));}function ct(e,t){e.runProperties&&x(e.runProperties,t);}function y(e,t){e.type==="paragraph"?ft(e,t):e.type==="table"&&mt(e,t);}function ft(e,t){e.formatting&&ct(e.formatting,t);for(let o of e.content)dt(o,t);}function dt(e,t){if(e.type==="run")h(e,t);else if(e.type==="hyperlink")ut(e,t),a(e,o=>{o.type==="run"&&h(o,t);});else if(e.type==="inlineSdt"||e.type==="insertion"||e.type==="deletion"||e.type==="moveFrom"||e.type==="moveTo")a(e,o=>{o.type==="run"&&h(o,t);});else if(e.type==="simpleField"||e.type==="complexField"){if("content"in e)for(let o of e.content)o.type==="run"&&h(o,t);if("fieldResult"in e)for(let o of e.fieldResult)h(o,t);a(e,o=>{o.type==="run"&&h(o,t);});}}function h(e,t){e.formatting&&x(e.formatting,t);}function ut(e,t){for(let o of e.children)o.type==="run"&&h(o,t);}function mt(e,t){for(let o of e.rows)pt(o,t);}function pt(e,t){for(let o of e.cells)gt(o,t);}function gt(e,t){for(let o of e.content)y(o,t);}function H(e,t){for(let o of e.content)y(o,t);}function ht(e,t){for(let o of e.content)y(o,t);}function xt(e,t){for(let o of e.content)y(o,t);}var Ft=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui"]);function N(e,t={}){let o=t.canRender??n,n$1=new Set;for(let i of t.exclude??[])n$1.add(i.trim().toLowerCase());let r=new Set;for(let i of t.embeddedFamilies??[])r.add(i.trim().toLowerCase());let s=[],a=new Set;for(let i of e){let c=i.trim(),f=c.toLowerCase();!c||Ft.has(f)||n$1.has(f)||a.has(f)||!r.has(f)&&!o(c)||(a.add(f),s.push({name:c,fontFamily:d(c).cssFallback,category:"other"}));}return s}function Tt(e,t={}){return N(L(e),t)}function yt(e,t){if(!e||e.length===0)return [];let o=new Set;for(let s of t)o.add(s.trim().toLowerCase());let n=new Set,r=[];for(let s of e){let a=s.name.trim().toLowerCase();o.has(a)||n.has(a)||(n.add(a),r.push(s));}return r}function bt(e){let t=[];return e.descendants((o,n)=>{if(o.type.name==="paragraph"){let r=o.attrs.outlineLevel,s=o.attrs.styleId,a=r;if(a==null&&s){let i=s.match(/^[Hh]eading(\d)$/);i&&(a=parseInt(i[1],10)-1);}if(a!=null&&a>=0&&a<=8){let i="";o.forEach(c=>{c.isText&&(i+=c.text||"");}),i.trim()&&t.push({text:i.trim(),level:a,pmPos:n});}}}),t}var k="rgba(255, 235, 59, 0.55)",Ct=1200,C="docx-paragraph-flash",E=new WeakMap;function At(e){let t=globalThis;return typeof t.CSS?.escape=="function"?t.CSS.escape(e):e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function St(e){return e?.color?.trim()||k}function Et(e){let t=e?.durationMs;return t==null||!Number.isFinite(t)||t<0?1200:t}function W(e,t){if(!t||!t.trim())return [];let o=At(t);return Array.from(e.querySelectorAll(`.layout-paragraph[data-para-id="${o}"]`))}function B(e,t){let o=0,n=St(t),r=Et(t);for(let s of e){o++;let a=E.get(s);a!==void 0&&clearTimeout(a),s.classList.remove(C),s.offsetWidth,s.style.setProperty("--docx-paragraph-flash-color",n),s.style.setProperty("--docx-paragraph-flash-duration",`${r}ms`),s.classList.add(C);let i=setTimeout(()=>{s.classList.remove(C),s.style.removeProperty("--docx-paragraph-flash-color"),s.style.removeProperty("--docx-paragraph-flash-duration"),E.delete(s);},r);E.set(s,i);}return o}function wt(e,t,o){let n=W(e,t);return B(n,o)>0}function G(e,t,o){let n=0;for(let r=t;r<t+o&&r<e.length;r++)n+=e[r];return n}function Pt(e,t,o,n){let r=G(e,t,o),s=Math.floor(r/Math.max(n,1)),a=r-s*n,i=Array.from({length:n},(c,f)=>s+(f<a?1:0));return [...e.slice(0,t),...i,...e.slice(t+o)]}function Rt(e,t,o,n,r,s){let a=o-t.rowspan,i=n-t.colspan,c=r+a,f=t.row+t.rowspan,T=t.col+t.colspan,p=[];for(let l of e){if(l===t)continue;let g=l.row+l.rowspan,A=l.col+l.colspan,I=l.row<f&&g>t.row,M=l.col<T&&A>t.col;p.push({data:l.data,row:l.row>=f?l.row+a:l.row,col:l.col>=T?l.col+i:l.col,rowspan:l.rowspan+(a>0&&I&&!M?a:0),colspan:l.colspan+(i>0&&M&&!I?i:0)});}for(let l=0;l<o;l++)for(let g=0;g<n;g++){let A=l===0&&g===0;p.push({data:s(A,l,g),row:t.row+l,col:t.col+g,rowspan:1,colspan:1});}return {anchors:p,deltaRows:a,deltaCols:i,newRowCount:c}}function Dt(e){let t=new Map,o=new Map;for(let n of e){t.set(`${n.row}-${n.col}`,n);for(let r=n.row;r<n.row+n.rowspan;r++)for(let s=n.col;s<n.col+n.colspan;s++)o.set(`${r}-${s}`,n);}return {byStart:t,byCoveredSlot:o}}function vt(e,t){let o=e>1||t>1;return {minRows:e,minCols:t,initialRows:e,initialCols:o?t:t+1}}var It=/[\p{L}\p{N}\p{M}_''\-]/u,Mt=/\s/;function w(e){return !e||e.length===0?false:It.test(e)}function P(e){return !e||e.length===0?false:Mt.test(e)}function m(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(P(o)){let n=t,r=t;for(;n>0&&P(e[n-1]);)n--;for(;r<e.length&&P(e[r]);)r++;return [n,r]}if(w(o)){let n=t,r=t;for(;n>0&&w(e[n-1]);)n--;for(;r<e.length&&w(e[r]);)r++;return [n,r]}return [t,t+1]}function _t(e,t){let[o,n]=m(e,t);return e.slice(o,n)}function Ot(e,t){let[o,n]=m(e,t);return {word:e.slice(o,n),startIndex:o,endIndex:n}}function v(){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,[s,a]=m(n,r);if(a>s)return t.setStart(o,s),t.setEnd(o,a),e.removeAllRanges(),e.addRange(t),true}if(o.nodeType===Node.ELEMENT_NODE){let n=o,r=U(n);if(r.length>0){let s=t.startOffset,a=null,i=s;if(s<n.childNodes.length){let c=n.childNodes[s];if(c.nodeType===Node.TEXT_NODE)a=c,i=0;else if(c instanceof Element){let f=U(c);f.length>0&&(a=f[0],i=0);}}if(!a&&r.length>0&&(a=r[0],i=0),a){let c=a.textContent||"",[f,T]=m(c,i);if(T>f){let p=document.createRange();return p.setStart(a,f),p.setEnd(a,T),e.removeAllRanges(),e.addRange(p),true}}}}return false}function Ht(e,t){let o=window.getSelection();if(!o)return false;let n=e.textContent||"",[r,s]=m(n,t);if(s>r){let a=document.createRange();return a.setStart(e,r),a.setEnd(e,s),o.removeAllRanges(),o.addRange(a),true}return false}function Lt(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.getRangeAt(0);if(t.collapsed)return v();let o=t.startContainer,n=t.endContainer,r=t.startOffset,s=t.endOffset;if(o.nodeType===Node.TEXT_NODE){let a=o.textContent||"",[i]=m(a,t.startOffset);r=i;}if(n.nodeType===Node.TEXT_NODE){let a=n.textContent||"",i=Math.max(0,t.endOffset-1),[,c]=m(a,i);s=c;}try{return t.setStart(o,r),t.setEnd(n,s),e.removeAllRanges(),e.addRange(t),!0}catch(a){return console.warn("Could not expand selection to word boundaries:",a),false}}function K(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let o=e.getRangeAt(0).commonAncestorContainer,n=Nt(o);if(n){let r=document.createRange();return r.selectNodeContents(n),e.removeAllRanges(),e.addRange(r),true}return false}function Nt(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 U(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 R=0,F=null,D=null,kt=500;function X(){R=0,D=null,F&&(clearTimeout(F),F=null);}function $(e){return e.target!==D&&X(),R++,D=e.target,F&&clearTimeout(F),F=setTimeout(X,kt),Math.min(R,3)}function Wt(){return e=>{e.ctrlKey||e.metaKey||e.altKey||v();}}function Bt(){return e=>{if($(e)===3){if(e.ctrlKey||e.metaKey||e.altKey)return;K();}}}async function Gt(e){let t=e.target;if(!t||!t.files)return null;let o=t.files[0];return t.value="",o?{buffer:await o.arrayBuffer(),name:o.name.replace(/\.docx$/i,"")}:null}var z="(prefers-color-scheme: dark)";function j(){return typeof window<"u"&&typeof window.matchMedia=="function"}function Ut(){return j()?window.matchMedia(z).matches:false}function Xt(e,t){return e==="dark"||e==="system"&&t}function Kt(e){if(!j())return ()=>{};let t=window.matchMedia(z);e(t.matches);let o=n=>e(n.matches);return t.addEventListener("change",o),()=>t.removeEventListener("change",o)}var $t=-1;function zt(){let e=1;return {next:()=>e++,seedAbove(t){t>=e&&(e=t+1);}}}function jt(e,t,o,n){return {id:e.next(),author:o,date:new Date().toISOString(),content:[{type:"paragraph",formatting:{},content:[{type:"run",formatting:{},content:[{type:"text",text:t}]}]}],...n!==void 0&&{parentId:n}}}var qt=/^[a-z][a-z0-9+.-]*:/i,Qt=/^(https?|mailto|tel|ftp):/i;function Vt(e){if(!e)return;let t=e.replace(/[\t\n\r]/g,"").replace(/^[\x00-\x20]+/,"");if(t)return qt.test(t)?Qt.test(t)?e:void 0:e}export{k as DEFAULT_PARAGRAPH_FLASH_COLOR,Ct as DEFAULT_PARAGRAPH_FLASH_DURATION_MS,C as PARAGRAPH_FLASH_CLASS_NAME,$t as PENDING_COMMENT_ID,Dt as buildAnchorMaps,bt as collectHeadings,vt as computeSplitDialogDefaults,Rt as computeSplitLayout,jt as createComment,zt as createCommentIdAllocator,Wt as createDoubleClickWordSelector,Bt as createTripleClickParagraphSelector,yt as excludeFontsByName,Lt as expandSelectionToWordBoundaries,W as findParagraphFragmentsByParaId,Ot as findWordAt,m as findWordBoundaries,B as flashParagraphElements,wt as flashParagraphFragmentsByParaId,Tt as getRenderableDocumentFonts,_t as getWordAt,$ as handleClickForMultiClick,Ut as prefersColorSchemeDark,Gt as readDocxFileFromInput,Pt as redistributeColumnWidths,Xt as resolveIsDark,Vt as sanitizeHref,K as selectParagraphAtCursor,N as selectRenderableFonts,v as selectWordAtCursor,Ht as selectWordInTextNode,Kt as subscribeSystemDark,G as sumColumnWidths};
1
+ export{i as createDoubleClickWordSelector,j as createTripleClickParagraphSelector,f as expandSelectionToWordBoundaries,c as findWordAt,a as findWordBoundaries,b as getWordAt,h as handleClickForMultiClick,g as selectParagraphAtCursor,d as selectWordAtCursor,e as selectWordInTextNode}from'../chunk-32A4I3T4.mjs';export{d as MIN_CARD_GAP,c as SIDEBAR_DOCUMENT_SHIFT,b as SIDEBAR_PAGE_GAP,a as SIDEBAR_WIDTH}from'../chunk-YUOKI2HB.mjs';export{f as blendColors,r as colorsEqual,o as createRgbColor,n as createThemeColor,d as darkenColor,p as ensureHexPrefix,h as generateThemeTintShadeMatrix,c as getContrastingColor,g as getThemeTintShadeHex,k as isBlack,l as isWhite,e as lightenColor,m as parseColorString,a as resolveColor,b as resolveColorToHex,i as resolveHighlightColor,q as resolveHighlightToCss,j as resolveShadingColor}from'../chunk-LTVVQMHB.mjs';export{a as PIXELS_PER_INCH,e as TWIPS_PER_INCH,p as clamp,n as eighthsToPixels,b as emuToPixels,i as emuToTwips,q as formatPx,k as halfPointsToPixels,l as halfPointsToPoints,c as pixelsToEmu,h as pixelsToTwips,m as pointsToHalfPoints,d as pointsToPixels,o as roundPixels,j as twipsToEmu,g as twipsToPixels}from'../chunk-CTBUQRYQ.mjs';import {n,d}from'../chunk-QX2CDKPG.mjs';export{s as FONT_MAPPING,n as canRenderFont,z as createFontLoadScope,c as deobfuscateFont,C as extractEmbeddedFontFaces,x as extractFontsFromDocument,B as getEmbeddedFontFaces,A as getEmbeddedFontFamilies,t as getGoogleFontEquivalent,k as getLoadedFonts,g as isFontLoaded,i as isGoogleFontsEnabled,j as isLoading,b as isValidFontKey,y as loadDocumentFonts,E as loadEmbeddedFontFamilies,D as loadEmbeddedFonts,e as loadFont,r as loadFontDefinitions,o as loadFontFromBuffer,q as loadFontFromUrl,u as loadFontWithMapping,f as loadFonts,v as loadFontsWithMapping,m as onFontError,l as onFontsLoaded,w as preloadCommonFonts,p as registerDocumentFaces,h as setGoogleFontsEnabled,a as toArrayBuffer}from'../chunk-QX2CDKPG.mjs';import'../chunk-HPZFJGGM.mjs';import'../chunk-QGZ2AB3M.mjs';import'../chunk-LT2GCWZ3.mjs';import'../chunk-YITJ4QAO.mjs';import {a}from'../chunk-UBUTIWXN.mjs';import'../chunk-7WIUNGQW.mjs';import'../chunk-DLXIZBB6.mjs';import'../chunk-HGKSOBXK.mjs';import'../chunk-TTRUPDAB.mjs';function D(t){let e=new Set,o=t.package;if(o.theme&&at(o.theme,e),o.styles&&st(o.styles,e),o.document)for(let r of o.document.content)F(r,e);if(o.headers)for(let r of o.headers.values())E(r,e);if(o.footers)for(let r of o.footers.values())E(r,e);if(o.footnotes)for(let r of o.footnotes)gt(r,e);if(o.endnotes)for(let r of o.endnotes)Ft(r,e);return Array.from(e).sort()}function at(t,e){let o=t.fontScheme;o&&(o.majorFont&&R(o.majorFont,e),o.minorFont&&R(o.minorFont,e));}function R(t,e){if(t.latin&&e.add(t.latin),t.ea&&e.add(t.ea),t.cs&&e.add(t.cs),t.fonts)for(let o of Object.values(t.fonts))o&&e.add(o);}function st(t,e){t.docDefaults&&(t.docDefaults.rPr&&g(t.docDefaults.rPr,e),t.docDefaults.pPr?.runProperties&&g(t.docDefaults.pPr.runProperties,e));for(let o of t.styles)o.rPr&&g(o.rPr,e),o.pPr?.runProperties&&g(o.pPr.runProperties,e);}function g(t,e){let o=t.fontFamily;o&&(o.ascii&&e.add(o.ascii),o.hAnsi&&e.add(o.hAnsi),o.eastAsia&&e.add(o.eastAsia),o.cs&&e.add(o.cs));}function lt(t,e){t.runProperties&&g(t.runProperties,e);}function F(t,e){t.type==="paragraph"?ct(t,e):t.type==="table"&&mt(t,e);}function ct(t,e){t.formatting&&lt(t.formatting,e);for(let o of t.content)ft(o,e);}function ft(t,e){if(t.type==="run")u(t,e);else if(t.type==="hyperlink")dt(t,e),a(t,o=>{o.type==="run"&&u(o,e);});else if(t.type==="inlineSdt"||t.type==="insertion"||t.type==="deletion"||t.type==="moveFrom"||t.type==="moveTo")a(t,o=>{o.type==="run"&&u(o,e);});else if(t.type==="simpleField"||t.type==="complexField"){if("content"in t)for(let o of t.content)o.type==="run"&&u(o,e);if("fieldResult"in t)for(let o of t.fieldResult)u(o,e);a(t,o=>{o.type==="run"&&u(o,e);});}}function u(t,e){t.formatting&&g(t.formatting,e);}function dt(t,e){for(let o of t.children)o.type==="run"&&u(o,e);}function mt(t,e){for(let o of t.rows)pt(o,e);}function pt(t,e){for(let o of t.cells)ut(o,e);}function ut(t,e){for(let o of t.content)F(o,e);}function E(t,e){for(let o of t.content)F(o,e);}function gt(t,e){for(let o of t.content)F(o,e);}function Ft(t,e){for(let o of t.content)F(o,e);}var ht=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui"]);function v(t,e={}){let o=e.canRender??n,r=new Set;for(let l of e.exclude??[])r.add(l.trim().toLowerCase());let i=new Set;for(let l of e.embeddedFamilies??[])i.add(l.trim().toLowerCase());let n$1=[],a=new Set;for(let l of t){let c=l.trim(),f=c.toLowerCase();!c||ht.has(f)||r.has(f)||a.has(f)||!i.has(f)&&!o(c)||(a.add(f),n$1.push({name:c,fontFamily:d(c).cssFallback,category:"other"}));}return n$1}function xt(t,e={}){return v(D(t),e)}function yt(t,e){if(!t||t.length===0)return [];let o=new Set;for(let n of e)o.add(n.trim().toLowerCase());let r=new Set,i=[];for(let n of t){let a=n.name.trim().toLowerCase();o.has(a)||r.has(a)||(r.add(a),i.push(n));}return i}function bt(t){let e=[];return t.descendants((o,r)=>{if(o.type.name==="paragraph"){let i=o.attrs.outlineLevel,n=o.attrs.styleId,a=i;if(a==null&&n){let l=n.match(/^[Hh]eading(\d)$/);l&&(a=parseInt(l[1],10)-1);}if(a!=null&&a>=0&&a<=8){let l="";o.forEach(c=>{c.isText&&(l+=c.text||"");}),l.trim()&&e.push({text:l.trim(),level:a,pmPos:r});}}}),e}var I="rgba(255, 235, 59, 0.55)",At=1200,x="docx-paragraph-flash",S=new WeakMap;function St(t){let e=globalThis;return typeof e.CSS?.escape=="function"?e.CSS.escape(t):t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Tt(t){return t?.color?.trim()||I}function Pt(t){let e=t?.durationMs;return e==null||!Number.isFinite(e)||e<0?1200:e}function H(t,e){if(!e||!e.trim())return [];let o=St(e);return Array.from(t.querySelectorAll(`.layout-paragraph[data-para-id="${o}"]`))}function L(t,e){let o=0,r=Tt(e),i=Pt(e);for(let n of t){o++;let a=S.get(n);a!==void 0&&clearTimeout(a),n.classList.remove(x),n.offsetWidth,n.style.setProperty("--docx-paragraph-flash-color",r),n.style.setProperty("--docx-paragraph-flash-duration",`${i}ms`),n.classList.add(x);let l=setTimeout(()=>{n.classList.remove(x),n.style.removeProperty("--docx-paragraph-flash-color"),n.style.removeProperty("--docx-paragraph-flash-duration"),S.delete(n);},i);S.set(n,l);}return o}function Ct(t,e,o){let r=H(t,e);return L(r,o)>0}function M(t,e,o){let r=0;for(let i=e;i<e+o&&i<t.length;i++)r+=t[i];return r}function wt(t,e,o,r){let i=M(t,e,o),n=Math.floor(i/Math.max(r,1)),a=i-n*r,l=Array.from({length:r},(c,f)=>n+(f<a?1:0));return [...t.slice(0,e),...l,...t.slice(e+o)]}function Rt(t,e,o,r,i,n){let a=o-e.rowspan,l=r-e.colspan,c=i+a,f=e.row+e.rowspan,T=e.col+e.colspan,y=[];for(let s of t){if(s===e)continue;let p=s.row+s.rowspan,b=s.col+s.colspan,P=s.row<f&&p>e.row,C=s.col<T&&b>e.col;y.push({data:s.data,row:s.row>=f?s.row+a:s.row,col:s.col>=T?s.col+l:s.col,rowspan:s.rowspan+(a>0&&P&&!C?a:0),colspan:s.colspan+(l>0&&C&&!P?l:0)});}for(let s=0;s<o;s++)for(let p=0;p<r;p++){let b=s===0&&p===0;y.push({data:n(b,s,p),row:e.row+s,col:e.col+p,rowspan:1,colspan:1});}return {anchors:y,deltaRows:a,deltaCols:l,newRowCount:c}}function Et(t){let e=new Map,o=new Map;for(let r of t){e.set(`${r.row}-${r.col}`,r);for(let i=r.row;i<r.row+r.rowspan;i++)for(let n=r.col;n<r.col+r.colspan;n++)o.set(`${i}-${n}`,r);}return {byStart:e,byCoveredSlot:o}}function Dt(t,e){let o=t>1||e>1;return {minRows:t,minCols:e,initialRows:t,initialCols:o?e:e+1}}async function vt(t){let e=t.target;if(!e||!e.files)return null;let o=e.files[0];return e.value="",o?{buffer:await o.arrayBuffer(),name:o.name.replace(/\.docx$/i,"")}:null}var _="(prefers-color-scheme: dark)";function O(){return typeof window<"u"&&typeof window.matchMedia=="function"}function It(){return O()?window.matchMedia(_).matches:false}function Ht(t,e){return t==="dark"||t==="system"&&e}function Lt(t){if(!O())return ()=>{};let e=window.matchMedia(_);t(e.matches);let o=r=>t(r.matches);return e.addEventListener("change",o),()=>e.removeEventListener("change",o)}var Mt=-1;function _t(){let t=1;return {next:()=>t++,seedAbove(e){e>=t&&(t=e+1);}}}function Ot(t,e,o,r){return {id:t.next(),author:o,date:new Date().toISOString(),content:[{type:"paragraph",formatting:{},content:[{type:"run",formatting:{},content:[{type:"text",text:e}]}]}],...r!==void 0&&{parentId:r}}}var kt=/^[a-z][a-z0-9+.-]*:/i,Nt=/^(https?|mailto|tel|ftp):/i;function Bt(t){if(!t)return;let e=t.replace(/[\t\n\r]/g,"").replace(/^[\x00-\x20]+/,"");if(e)return kt.test(e)?Nt.test(e)?t:void 0:t}export{I as DEFAULT_PARAGRAPH_FLASH_COLOR,At as DEFAULT_PARAGRAPH_FLASH_DURATION_MS,x as PARAGRAPH_FLASH_CLASS_NAME,Mt as PENDING_COMMENT_ID,Et as buildAnchorMaps,bt as collectHeadings,Dt as computeSplitDialogDefaults,Rt as computeSplitLayout,Ot as createComment,_t as createCommentIdAllocator,yt as excludeFontsByName,H as findParagraphFragmentsByParaId,L as flashParagraphElements,Ct as flashParagraphFragmentsByParaId,xt as getRenderableDocumentFonts,It as prefersColorSchemeDark,vt as readDocxFileFromInput,wt as redistributeColumnWidths,Ht as resolveIsDark,Bt as sanitizeHref,v as selectRenderableFonts,Lt as subscribeSystemDark,M as sumColumnWidths};
@@ -1,9 +1,6 @@
1
1
  /**
2
- * Pure list-state helpers used by both adapter toolbars to track
3
- * whether the selection is in a bullet/numbered list and at what
4
- * indent level. Lifted from packages/docx-react/src/components/ui/
5
- * ListButtons.tsx so the React + Vue toolbars share identical
6
- * state-mutation logic.
2
+ * Pure list-state helpers that track whether the selection is in a
3
+ * bullet or numbered list and at what indent level.
7
4
  * @packageDocumentation
8
5
  * @public
9
6
  */
@@ -1,5 +1,5 @@
1
- import { a as Style } from '../styles-AryxLAhx.mjs';
2
- import '../formatting-gqLFeJ9X.mjs';
1
+ import { a as Style } from '../styles-DZZz2oRy.mjs';
2
+ import '../formatting-p5MneNuy.mjs';
3
3
 
4
4
  /**
5
5
  * Paragraph-style preview + option resolution — shared between the React and
@@ -1 +1 @@
1
- import'../chunk-TTRUPDAB.mjs';var n={Title:26,Subtitle:18,Heading1:24,Heading2:18,Heading3:16,Heading4:14,Heading5:13,Heading6:13,Normal:14},l=new Set(["Title","Heading1","Heading2","Heading3"]),a={Subtitle:"666666"},d="#4a6c8c";function g(t){let e=n[t.styleId],o={fontSize:e?`${e}px`:`${Math.min(Math.max(t.fontSize?t.fontSize/2:11,11),20)}px`,lineHeight:"1.3"};(t.bold??l.has(t.styleId))&&(o.fontWeight="bold"),t.italic&&(o.fontStyle="italic");let i=t.color??a[t.styleId];return i?o.color=`#${i}`:t.styleId.startsWith("Heading")&&(o.color=d),o}function S(t){return !t||t.length===0?[]:t.filter(e=>e.type==="paragraph").filter(e=>e.qFormat?true:!(e.hidden||e.semiHidden)).map(e=>({styleId:e.styleId,name:e.name||e.styleId,priority:e.uiPriority??99,fontSize:e.rPr?.fontSize,bold:e.rPr?.bold,italic:e.rPr?.italic,color:e.rPr?.color?.rgb})).sort((e,r)=>e.priority-r.priority)}export{d as HEADING_COLOR,l as STYLE_DEFAULT_BOLD,a as STYLE_DEFAULT_COLOR,n as STYLE_PREVIEW_SIZES,g as getStylePreviewProps,S as resolveParagraphStyleOptions};
1
+ export{d as HEADING_COLOR,b as STYLE_DEFAULT_BOLD,c as STYLE_DEFAULT_COLOR,a as STYLE_PREVIEW_SIZES,e as getStylePreviewProps,f as resolveParagraphStyleOptions}from'../chunk-UDVEZ722.mjs';import'../chunk-TTRUPDAB.mjs';