@docx-editor.dev/core 2.16.2 → 2.18.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 (107) hide show
  1. package/README.md +1 -1
  2. package/THIRD_PARTY_NOTICES.md +2 -2
  3. package/dist/automation.cjs +1 -1
  4. package/dist/automation.d.ts +35 -8
  5. package/dist/automation.js +1 -1
  6. package/dist/binding.cjs +1 -1
  7. package/dist/binding.d.ts +9 -11
  8. package/dist/binding.js +1 -1
  9. package/dist/chunk-2ZEU42EA.js +2 -0
  10. package/dist/chunk-4DB7ZFQN.js +1 -0
  11. package/dist/chunk-4KMSEFIG.js +3 -0
  12. package/dist/chunk-72BDQFHY.js +18 -0
  13. package/dist/chunk-77DD4EBC.cjs +11 -0
  14. package/dist/chunk-BEOPUDAB.js +5 -0
  15. package/dist/chunk-CG7CP632.cjs +1 -0
  16. package/dist/chunk-CJCFEXTA.js +11 -0
  17. package/dist/chunk-DQS4KZUX.js +4 -0
  18. package/dist/chunk-FZ2BIMCY.cjs +2 -0
  19. package/dist/chunk-GUPITGJQ.cjs +2 -0
  20. package/dist/chunk-KDYD5TAW.cjs +1 -0
  21. package/dist/chunk-LQ6XWTKQ.cjs +18 -0
  22. package/dist/chunk-MDP5SNK4.cjs +3 -0
  23. package/dist/chunk-MRPPCGCX.cjs +20 -0
  24. package/dist/chunk-MSIFK7TJ.js +1 -0
  25. package/dist/chunk-NJONXJJY.cjs +4 -0
  26. package/dist/chunk-OODFC5R2.js +1 -0
  27. package/dist/chunk-P6VGDI57.js +2 -0
  28. package/dist/{chunk-UIB2MDE3.cjs → chunk-PBM6WERF.cjs} +1 -1
  29. package/dist/chunk-QBMAXYN7.js +20 -0
  30. package/dist/chunk-SUEX3CL7.cjs +5 -0
  31. package/dist/{chunk-UXAWPVH6.js → chunk-THCGTV53.js} +1 -1
  32. package/dist/{chunk-NO7U62I2.cjs → chunk-YVYEJBLL.cjs} +1 -1
  33. package/dist/chunk-ZKQX2PNF.cjs +1 -0
  34. package/dist/{chunk-XXLS6O6B.js → chunk-ZMM5RNM6.js} +1 -1
  35. package/dist/collaboration/replication.cjs +1 -1
  36. package/dist/collaboration/replication.d.ts +2 -4
  37. package/dist/collaboration/replication.js +1 -1
  38. package/dist/collaboration.cjs +1 -1
  39. package/dist/collaboration.d.ts +4 -6
  40. package/dist/collaboration.js +1 -1
  41. package/dist/contracts/editor.d.ts +9 -8
  42. package/dist/contracts/modules.d.ts +7 -9
  43. package/dist/{custom-node-writes-ClTkWM7s.d.ts → custom-node-writes-BqIv94ei.d.ts} +14 -2
  44. package/dist/document-protection-BL5zp8cU.d.ts +19 -0
  45. package/dist/{editor-BlerWPyk.d.ts → editor-WXbTSXx1.d.ts} +14 -7
  46. package/dist/editor.cjs +1 -1
  47. package/dist/editor.css +1 -1
  48. package/dist/editor.d.ts +271 -30
  49. package/dist/editor.js +1 -1
  50. package/dist/export.cjs +2 -2
  51. package/dist/export.d.ts +15 -12
  52. package/dist/export.js +2 -2
  53. package/dist/{failure-BnGjoXf0.d.ts → failure-DNNmwsgD.d.ts} +1 -1
  54. package/dist/{font-resolver-DtADJcLL.d.ts → font-resolver-BSrKnTeR.d.ts} +5 -3
  55. package/dist/harfbuzz.wasm +0 -0
  56. package/dist/{headless-document-view-BDSeMGoK.d.ts → headless-document-view-C4ttQJ5H.d.ts} +11 -3
  57. package/dist/{index-D51bUVBE.d.ts → index-C3As-Xxp.d.ts} +133 -19
  58. package/dist/index.cjs +1 -1
  59. package/dist/index.d.ts +18 -19
  60. package/dist/index.js +1 -1
  61. package/dist/{layout-shaping-rTElghj2.d.ts → layout-shaping-Dqu3JW3p.d.ts} +1 -1
  62. package/dist/layout.cjs +1 -1
  63. package/dist/layout.d.ts +23 -20
  64. package/dist/layout.js +1 -1
  65. package/dist/{note-properties-D5_fXW9K.d.ts → note-properties-RjYgbmXe.d.ts} +2 -2
  66. package/dist/{omml-equation-C9AJfWy5.d.ts → omml-equation-hcP9AUFX.d.ts} +1 -1
  67. package/dist/output.cjs +1 -1
  68. package/dist/output.d.ts +16 -6
  69. package/dist/output.js +1 -1
  70. package/dist/{protocol-K-Djpjjw.d.ts → protocol-OdRd17KZ.d.ts} +172 -7
  71. package/dist/{review-items-CiliAz8H.d.ts → review-items-CJz-kAW8.d.ts} +2 -2
  72. package/dist/{review-paragraph-order-BlSnyg9a.d.ts → review-paragraph-order--jLHXIcd.d.ts} +3 -3
  73. package/dist/{revision-projection-JiDclAFU.d.ts → revision-projection-BIHO_qvw.d.ts} +1 -1
  74. package/dist/{semantic-cell-selection-C-VsxNee.d.ts → semantic-cell-selection-lCYAVCCF.d.ts} +6 -24
  75. package/dist/{semantic-interaction-2vPh96Ey.d.ts → semantic-interaction-0vQXcMZk.d.ts} +2 -19
  76. package/dist/{semantic-paint-BEjYcsPK.d.ts → semantic-paint-BSan4pBk.d.ts} +10 -2
  77. package/dist/{semantic-records-Bc-MGXbM.d.ts → semantic-records-ZcYuB4-H.d.ts} +59 -13
  78. package/dist/store.cjs +1 -1
  79. package/dist/store.d.ts +49 -42
  80. package/dist/store.js +1 -1
  81. package/dist/{tree-op-types-C71G7rIv.d.ts → tree-op-types-DbdM7fJV.d.ts} +84 -4
  82. package/dist/{tree-package-fragment-DRJkmfTW.d.ts → tree-package-fragment-1pdDnhZ_.d.ts} +491 -23
  83. package/dist/{tree-session-contract-Cp5W25RC.d.ts → tree-session-contract-Cgn6fQ-M.d.ts} +34 -9
  84. package/package.json +4 -4
  85. package/dist/chunk-4RDCLCLB.js +0 -2
  86. package/dist/chunk-7QG5FJ4X.js +0 -1
  87. package/dist/chunk-BML3CNUT.js +0 -2
  88. package/dist/chunk-FRRMJK2G.js +0 -5
  89. package/dist/chunk-G5GLQ4SX.cjs +0 -1
  90. package/dist/chunk-JP253KIZ.cjs +0 -2
  91. package/dist/chunk-JROG4U3Z.cjs +0 -21
  92. package/dist/chunk-MBXGQN6J.js +0 -1
  93. package/dist/chunk-MDMM3XVQ.js +0 -11
  94. package/dist/chunk-NPZX5O23.cjs +0 -2
  95. package/dist/chunk-OISZDVXT.cjs +0 -5
  96. package/dist/chunk-PRNYSOQL.cjs +0 -1
  97. package/dist/chunk-QQP2SGAT.js +0 -20
  98. package/dist/chunk-RXPOTTQQ.js +0 -21
  99. package/dist/chunk-T7JERNXT.cjs +0 -2
  100. package/dist/chunk-TDMGSCCL.cjs +0 -1
  101. package/dist/chunk-VYQTZIYH.js +0 -1
  102. package/dist/chunk-W7GY2IJC.js +0 -2
  103. package/dist/chunk-XC7YDJBL.cjs +0 -20
  104. package/dist/chunk-ZFBNCHRP.cjs +0 -11
  105. package/dist/hf-references-kSSFMq9X.d.ts +0 -70
  106. package/dist/tree-store-BRfhZceK.d.ts +0 -416
  107. /package/dist/{dist-OSUJGKTK.js → dist-PKZR6RSH.js} +0 -0
package/dist/editor.d.ts CHANGED
@@ -1,39 +1,38 @@
1
- import { O as OoxmlPart, H as TreeDocColorValue, v as DrawingPositionInput } from './tree-op-types-C71G7rIv.js';
2
- export { J as DEFAULT_IMAGE_RESOURCE_LIMITS, K as IMAGE_WRAP_TARGETS, E as ImageDecodePort, G as ImageResourceLimits, u as ImageWrapTarget, t as RenderableImageMime, y as SupportedImageMime, B as VectorImageMime, L as resolveImageResourceLimits, M as resolveSvgIntrinsicSize, N as sniffImageMime, Q as validateRasterHeader } from './tree-op-types-C71G7rIv.js';
3
- import { ColorValue } from './contracts/types.js';
4
- export { ParagraphFlags, ParagraphTabStop } from './contracts/types.js';
5
- export { R as ReviewModelInput } from './review-items-CiliAz8H.js';
1
+ import { O as OoxmlPart, J as TreeDocColorValue, m as DrawingPositionInput } from './tree-op-types-DbdM7fJV.js';
2
+ export { K as DEFAULT_IMAGE_RESOURCE_LIMITS, L as IMAGE_WRAP_TARGETS, t as ImageDecodePort, v as ImageResourceLimits, I as ImageWrapTarget, k as RenderableImageMime, p as SupportedImageMime, M as TEXT_FORM_FORMATS, s as VectorImageMime, N as resolveImageResourceLimits, Q as resolveSvgIntrinsicSize, U as sniffImageMime, W as validateRasterHeader } from './tree-op-types-DbdM7fJV.js';
3
+ import { ColorValue, ParagraphTabStop } from './contracts/types.js';
4
+ export { ParagraphFlags } from './contracts/types.js';
5
+ export { R as ReviewModelInput } from './review-items-CJz-kAW8.js';
6
6
  export { CollectReviewItems, EditorModule, EditorModuleRegistry, ReviewModuleContribution, resolveEditorModules } from './contracts/modules.js';
7
- import { T as TreeDocxSessionView, f as DocumentThemeColorEntry } from './tree-session-contract-Cp5W25RC.js';
8
- export { a as TreeApplyResult } from './tree-session-contract-Cp5W25RC.js';
9
- import { c as FontConfiguration, E as EditorFontError, d as EditorSnapshot, e as EditorCommand, C as CanResult, Z as ZoomMode } from './editor-BlerWPyk.js';
10
- export { I as ImageContext, f as ImageCropPercent, g as ImageCropPermille, S as SelectedImageState, T as TrackedChangeFilterMode, h as TrackedChangePredicate, i as cropPercentFromCropPermille, j as cropPercentFromPermille, k as cropPercentFromSourceCrop, l as cropPermilleFromCropPercent, m as cropPermilleFromPercent, s as sourceCropFromCropPercent, v as validateImageCropPercent } from './editor-BlerWPyk.js';
11
- import { L as LayoutShapingInstrumentation, a as LayoutShapingOptions } from './layout-shaping-rTElghj2.js';
12
- export { d as disposeLayoutShaping } from './layout-shaping-rTElghj2.js';
13
- export { C as ComposeFontOriginsOptions, b as FONT_RESOLVER_BRAND, c as FONT_RESOLVER_MARK_KEY, d as FontConfigurationBase, e as FontConfigurationFragment, a as FontOrigin, F as FontOriginFailure, f as FontResolutionRequest, g as FontResolver, h as FontResolverMark, M as MAX_RESOLVER_FAMILIES, i as MarkedFontResolver, W as WORD_DEFAULT_FONT, j as composeFontConfiguration, k as composeFontOrigins, l as defineFontResolver, m as isFontResolver } from './font-resolver-DtADJcLL.js';
14
- import { P as PaginatedSurfaceOptions, O as OpenPaginatedResult, a as PaginatedSurface, T as TableCommandPlan, D as DocxEditorInstance } from './index-D51bUVBE.js';
15
- export { A as AnchorFrameOrigin, C as CHROME_GROUPS, b as CHROME_MENUS, c as CHROME_UNAVAILABLE_KEY, d as ChromeControl, e as ChromeControlId, f as ChromeControlState, g as ChromeGroup, h as ChromeGroupId, i as ChromeMenu, j as ChromeMenuEntry, k as ChromeMenuId, l as ChromeMenuItemEntry, m as ChromeMenuSeparatorEntry, n as ChromeMenuSubmenuEntry, o as ChromeSlotId, p as DEFAULT_TABLE_CHROME_DRAFT, q as DocxEditorConfig, r as DrawingSelectionIntent, E as EMU_PER_POINT, s as EquationActivation, t as EquationChromeHandlers, u as EquationOps, F as FinalizedImageOverlayInteraction, v as FontLoadFailure, w as FontLoadFailureReason, x as FontMeasurementState, y as FontUrlSource, H as HyperlinkActivation, z as HyperlinkChromeHandlers, B as HyperlinkOps, I as IMAGE_OVERLAY_NUDGE_PT, G as IMAGE_OVERLAY_NUDGE_SHIFT_PT, J as ImageInteractionSession, K as ImageOverlayScrollPort, L as ImageResizeHandle, M as ImageResizeResult, N as LoadFontsRequest, Q as LoadFontsResult, R as OverlayFrameRect, S as PaginatedSurfaceState, U as ParagraphPropertyEdit, V as RemoteCaretLabelAnchor, W as RemoteCaretLabelHost, X as ReviewWriteIntent, Y as RunTableChromeCommandResult, Z as SectionAnchor, _ as SectionBreakInsertType, $ as SelectedDrawingOverlayTarget, a0 as SurfaceEquation, a1 as SurfaceFormatting, a2 as SurfaceHyperlink, a3 as SurfaceInsertImageInput, a4 as SurfaceNavigation, a5 as SurfaceOverlayCoordinates, a6 as SurfaceParagraphFormat, a7 as TABLE_BORDER_STYLE_OPTIONS, a8 as TABLE_BORDER_TARGET_OPTIONS, a9 as TABLE_BORDER_WIDTH_OPTIONS, aa as TABLE_CHROME_SLOT_IDS, ab as TableBorderStyleOption, ac as TableBorderTargetOption, ad as TableBorderTargetValue, ae as TableBorderWidthOption, af as TableChromeDraft, ag as TableChromePick, ah as TableChromeSlotId, ai as TableInteractionLabelKey, aj as ToolbarCommandState, ak as applyTableChromePick, al as blankDocumentBytes, am as canExecuteImageCommand, an as captureImageMutationPreconditions, ao as chromeControlCount, ap as chromeMenuSlots, aq as chromeProbeForSlot, ar as chromeSlotId, as as chromeSlotIsToggle, at as commandForSlot, au as commandForSlotValue, av as commandForTableChromeSlotValue, aw as computeImageResizeResult, ax as computeMovedImagePosition, ay as computeResizedImageExtentEmu, az as createDocxEditor, aA as createFontSource, aB as createImageOverlayScrollPort, aC as cssPixelsToLayoutPoints, aD as defaultChromeGroups, aE as defaultTableLabel, aF as emuToOverlayPoints, aG as equationAtPosition, aH as executeImageCommand, aI as finalizeImageOverlayInteraction, aJ as formattingBarChromeGroups, aK as isStaleImageInteractionCommit, aL as isTableChromeSlot, aM as layoutPointsToCssPixels, aN as loadFonts, aO as overlayFrameToSheetCssPixels, aP as overlayHostOrigin, aQ as pointsToEmu, aR as probeTableChromeCommand, aS as resizePreservesAspect, aT as runSave, aU as runTableChromeCommand, aV as runTableCommand, aW as runToolbarCommand, aX as selectedDrawingOverlayTargetOf, aY as selectedImageStateOf, aZ as surfacePaintScale, a_ as tableChromeIconPaths, a$ as tableChromeLabelKeyForTarget, b0 as tableChromeToolbarState, b1 as tableChromeVisible, b2 as tableCommandToolbarState, b3 as toolbarCommandState, b4 as toolbarCommandStates } from './index-D51bUVBE.js';
16
- import { A as AutomationCapabilities, a as AutomationHost } from './protocol-K-Djpjjw.js';
17
- import { S as SemanticLayout } from './semantic-records-Bc-MGXbM.js';
18
- export { T as TextMeasurer } from './semantic-records-Bc-MGXbM.js';
19
- export { N as NavigationCommand, S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-2vPh96Ey.js';
20
- export { S as SectionProperties } from './semantic-cell-selection-C-VsxNee.js';
21
- export { F as FieldShadingMode, R as ReviewAuthorInfo, a as RevisionAuthorAssignments, b as RevisionAuthorStyle, c as RevisionStyles } from './semantic-paint-BEjYcsPK.js';
7
+ import { T as TreeDocxSessionView, f as DocumentThemeColorEntry } from './tree-session-contract-Cgn6fQ-M.js';
8
+ export { a as TreeApplyResult } from './tree-session-contract-Cgn6fQ-M.js';
9
+ import { a as FontConfiguration, E as EditorFontError, d as EditorSnapshot, e as EditorCommand, C as CanResult, Z as ZoomMode } from './editor-WXbTSXx1.js';
10
+ export { I as ImageContext, f as ImageCropPercent, g as ImageCropPermille, S as SelectedImageState, T as TrackedChangeFilterMode, h as TrackedChangePredicate, i as cropPercentFromCropPermille, j as cropPercentFromPermille, k as cropPercentFromSourceCrop, l as cropPermilleFromCropPercent, m as cropPermilleFromPercent, s as sourceCropFromCropPercent, v as validateImageCropPercent } from './editor-WXbTSXx1.js';
11
+ import { L as LayoutShapingInstrumentation, a as LayoutShapingOptions } from './layout-shaping-Dqu3JW3p.js';
12
+ export { d as disposeLayoutShaping } from './layout-shaping-Dqu3JW3p.js';
13
+ export { C as ComposeFontOriginsOptions, b as FONT_RESOLVER_BRAND, c as FONT_RESOLVER_MARK_KEY, d as FontConfigurationBase, e as FontConfigurationFragment, a as FontOrigin, F as FontOriginFailure, f as FontResolutionRequest, g as FontResolver, h as FontResolverMark, M as MAX_RESOLVER_FAMILIES, i as MarkedFontResolver, W as WORD_DEFAULT_FONT, j as composeFontConfiguration, k as composeFontOrigins, l as defineFontResolver, m as isFontResolver } from './font-resolver-BSrKnTeR.js';
14
+ import { P as PaginatedSurfaceOptions, O as OpenPaginatedResult, a as PaginatedSurface, T as TableCommandPlan, D as DocxEditorInstance } from './index-C3As-Xxp.js';
15
+ export { A as AnchorFrameOrigin, C as CHROME_GROUPS, b as CHROME_MENUS, c as CHROME_UNAVAILABLE_KEY, d as ChromeControl, e as ChromeControlId, f as ChromeControlState, g as ChromeGroup, h as ChromeGroupId, i as ChromeMenu, j as ChromeMenuEntry, k as ChromeMenuId, l as ChromeMenuItemEntry, m as ChromeMenuSeparatorEntry, n as ChromeMenuSubmenuEntry, o as ChromeSlotId, p as ContentControlWidgetChromeHandlers, q as ContentControlWidgetSession, r as CustomFontsOptions, s as CustomFontsResolver, t as DEFAULT_TABLE_CHROME_DRAFT, u as DocxEditorConfig, v as DrawingSelectionIntent, E as EMU_PER_POINT, w as EquationActivation, x as EquationChromeHandlers, y as EquationOps, F as FinalizedImageOverlayInteraction, z as FontLoadFailure, B as FontLoadFailureReason, G as FontMeasurementState, H as FontUrlSource, I as HyperlinkActivation, J as HyperlinkChromeHandlers, K as HyperlinkOps, L as IMAGE_OVERLAY_NUDGE_PT, M as IMAGE_OVERLAY_NUDGE_SHIFT_PT, N as ImageInteractionSession, Q as ImageOverlayScrollPort, R as ImageResizeHandle, S as ImageResizeResult, U as InvalidTextFormFieldChromeHandlers, V as InvalidTextFormFieldSession, W as LoadFontsRequest, X as LoadFontsResult, Y as OverlayFrameRect, Z as PaginatedSurfaceState, _ as ParagraphPropertyEdit, $ as PopupChromeRegistrationOptions, a0 as RemoteCaretLabelAnchor, a1 as RemoteCaretLabelHost, a2 as ReviewWriteIntent, a3 as RunTableChromeCommandResult, a4 as SectionAnchor, a5 as SectionBreakInsertType, a6 as SelectedDrawingOverlayTarget, a7 as SurfaceEquation, a8 as SurfaceFormatting, a9 as SurfaceHyperlink, aa as SurfaceInsertImageInput, ab as SurfaceNavigation, ac as SurfaceOverlayCoordinates, ad as SurfaceParagraphFormat, ae as TABLE_BORDER_STYLE_OPTIONS, af as TABLE_BORDER_TARGET_OPTIONS, ag as TABLE_BORDER_WIDTH_OPTIONS, ah as TABLE_CHROME_SLOT_IDS, ai as TableBorderStyleOption, aj as TableBorderTargetOption, ak as TableBorderTargetValue, al as TableBorderWidthOption, am as TableChromeDraft, an as TableChromePick, ao as TableChromeSlotId, ap as TableInteractionLabelKey, aq as TextFormFieldChromeHandlers, ar as TextFormFieldDialogSession, as as ToolbarCommandState, at as applyTableChromePick, au as blankDocumentBytes, av as canExecuteImageCommand, aw as captureImageMutationPreconditions, ax as chromeControlCount, ay as chromeMenuSlots, az as chromeProbeForSlot, aA as chromeSlotId, aB as chromeSlotIsToggle, aC as commandForSlot, aD as commandForSlotValue, aE as commandForTableChromeSlotValue, aF as computeImageResizeResult, aG as computeMovedImagePosition, aH as computeResizedImageExtentEmu, aI as createDocxEditor, aJ as createFontSource, aK as createImageOverlayScrollPort, aL as cssPixelsToLayoutPoints, aM as customFonts, aN as defaultChromeGroups, aO as defaultTableLabel, aP as emuToOverlayPoints, aQ as equationAtPosition, aR as executeImageCommand, aS as finalizeImageOverlayInteraction, aT as formattingBarChromeGroups, aU as isStaleImageInteractionCommit, aV as isTableChromeSlot, aW as layoutPointsToCssPixels, aX as loadFonts, aY as overlayFrameToSheetCssPixels, aZ as overlayHostOrigin, a_ as pointsToEmu, a$ as probeTableChromeCommand, b0 as resizePreservesAspect, b1 as runSave, b2 as runTableChromeCommand, b3 as runTableCommand, b4 as runToolbarCommand, b5 as selectedDrawingOverlayTargetOf, b6 as selectedImageStateOf, b7 as surfacePaintScale, b8 as tableChromeIconPaths, b9 as tableChromeLabelKeyForTarget, ba as tableChromeToolbarState, bb as tableChromeVisible, bc as tableCommandToolbarState, bd as toolbarCommandState, be as toolbarCommandStates } from './index-C3As-Xxp.js';
16
+ import { A as AutomationCapabilities, a as AutomationHost } from './protocol-OdRd17KZ.js';
17
+ import { S as SemanticLayout } from './semantic-records-ZcYuB4-H.js';
18
+ export { T as TextMeasurer } from './semantic-records-ZcYuB4-H.js';
19
+ export { N as NavigationCommand, S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-0vQXcMZk.js';
20
+ export { S as SectionProperties } from './semantic-cell-selection-lCYAVCCF.js';
21
+ export { F as FieldShadingMode, R as ReviewAuthorInfo, a as RevisionAuthorAssignments, b as RevisionAuthorStyle, c as RevisionStyles } from './semantic-paint-BSan4pBk.js';
22
22
  export { CollaborationModuleContribution } from './collaboration.js';
23
- import './revision-projection-JiDclAFU.js';
24
- import './tree-package-fragment-DRJkmfTW.js';
25
- import './hf-references-kSSFMq9X.js';
26
- import './tree-store-BRfhZceK.js';
23
+ import './revision-projection-BIHO_qvw.js';
24
+ import './tree-package-fragment-1pdDnhZ_.js';
27
25
  import './collaboration/replication.js';
28
- import './failure-BnGjoXf0.js';
29
- import './custom-node-writes-ClTkWM7s.js';
30
- import './headless-document-view-BDSeMGoK.js';
26
+ import './failure-DNNmwsgD.js';
27
+ import './custom-node-writes-BqIv94ei.js';
28
+ import './headless-document-view-C4ttQJ5H.js';
31
29
  import 'prosemirror-model';
32
30
  import './editor-scope-DZJT4ukT.js';
33
31
  import './contracts/document.js';
34
32
  import './contracts/interaction.js';
35
- import './note-properties-D5_fXW9K.js';
36
- import './omml-equation-C9AJfWy5.js';
33
+ import './document-protection-BL5zp8cU.js';
34
+ import './note-properties-RjYgbmXe.js';
35
+ import './omml-equation-hcP9AUFX.js';
37
36
 
38
37
  declare function toEditorFontError(error: unknown): EditorFontError;
39
38
  declare function createLayoutShaping(configuration: FontConfiguration, instrumentation?: LayoutShapingInstrumentation): Promise<LayoutShapingOptions>;
@@ -365,4 +364,246 @@ declare function validateSetImagePositionCommand(command: {
365
364
  readonly relativeToV?: string;
366
365
  }, mode: 'frame' | 'simple'): boolean;
367
366
 
368
- export { AUTO_ZOOM_MODE, BROWSER_AUTOMATION_CAPABILITIES, type ColorLowerResult, DRAWING_REL_FROM_H, DRAWING_REL_FROM_V, DocxEditorInstance, DrawingPositionInput, FIT_WIDTH_ZOOM_MODE, LOADING_SNAPSHOT, OpenPaginatedResult, PX_PER_CM, PX_PER_INCH, PaginatedSurface, PaginatedSurfaceOptions, type RulerDragOptions, type RulerIndent, type RulerIndentHandle, type RulerPageMetrics, type RulerTick, type RulerUnit, SNAP_TWIPS_CM, SNAP_TWIPS_INCH, type SurfaceExtent, TWIPS_PER_CM, TWIPS_PER_INCH, TreeDocxSessionView, ZOOM_MAX, ZOOM_MIN, applyThemeShade, applyThemeTint, clipboardDropLandsText, clipboardPasteLandsContent, createBrowserAutomationHost, createLayoutShaping, dragIndent, editorCommandKey, generateRulerTicks, handlePosition, lowerColorValueForBorder, lowerColorValueForFill, mountPaginatedSurface, partOfNodeId, positionInputFromPropertiesCommand, propertiesCommandHasPositionFields, resolveColorValueToCss, resolveThemeColorHex, resolveZoomMode, rulerPageBox, sameZoomMode, snapTwips, surfaceExtent, tableCommandState, toEditorFontError, validateDrawingPositionInput, validateSetImagePositionCommand, validateThemeModifier };
367
+ /** One tri-state paragraph flag: on, off, or "the selection disagrees". @public */
368
+ type ParagraphFlagState = boolean | null;
369
+ /**
370
+ * What the Paragraph dialog reads: every field, as the selection currently stands.
371
+ *
372
+ * A `null` means the selection's paragraphs DISAGREE about that field, which a control
373
+ * shows as an indeterminate checkbox or an empty box rather than as a value. `indent` is
374
+ * the exception the engine already documents — it reports the first touched paragraph and
375
+ * flags disagreement per field, because a ruler has to draw its handles somewhere.
376
+ *
377
+ * @public
378
+ */
379
+ interface ParagraphFormatRead {
380
+ /**
381
+ * `justify`, not OOXML's `both`. The engine speaks `w:jc` values; an adapter speaks the
382
+ * word its consumers write. Read and write use the SAME spelling here, so a value that
383
+ * comes out of `format` can go straight back into `apply`.
384
+ */
385
+ readonly alignment: 'left' | 'center' | 'right' | 'justify' | null;
386
+ readonly spaceBeforePt: number | null;
387
+ readonly spaceAfterPt: number | null;
388
+ readonly lineSpacing: {
389
+ readonly rule: 'multiple' | 'exact' | 'atLeast';
390
+ readonly value: number;
391
+ } | null;
392
+ readonly indentLeftTwips: number | null;
393
+ readonly indentRightTwips: number | null;
394
+ /** ONE signed first-line offset: negative is a hanging indent. */
395
+ readonly indentFirstLineTwips: number | null;
396
+ readonly contextualSpacing: ParagraphFlagState;
397
+ readonly keepNext: ParagraphFlagState;
398
+ readonly keepLines: ParagraphFlagState;
399
+ readonly widowControl: ParagraphFlagState;
400
+ readonly pageBreakBefore: ParagraphFlagState;
401
+ /** Custom tab stops, cascade included. Null when the selection disagrees. */
402
+ readonly tabStops: readonly ParagraphTabStop[] | null;
403
+ /**
404
+ * Which fields are `null` because the selection DISAGREES, as opposed to because nothing
405
+ * states them.
406
+ *
407
+ * A `null` alone cannot tell those apart, and both readings shipped as bugs: a
408
+ * disagreement rendered as a concrete value is uncorrectable, because the value that
409
+ * would fix it is the one already on screen; an absent value rendered as "mixed" tells a
410
+ * single paragraph it disagrees with itself.
411
+ */
412
+ readonly disagrees: {
413
+ readonly alignment: boolean;
414
+ readonly spaceBeforePt: boolean;
415
+ readonly spaceAfterPt: boolean;
416
+ readonly lineSpacing: boolean;
417
+ readonly tabStops: boolean;
418
+ readonly indentLeft: boolean;
419
+ readonly indentRight: boolean;
420
+ readonly indentFirstLine: boolean;
421
+ };
422
+ /**
423
+ * Whether the indent reads are UNKNOWN rather than disagreed.
424
+ *
425
+ * The engine reports no indent at all for a paragraph inside a table — correct, but not
426
+ * placeable on a ruler. A control must not call that "mixed": one paragraph cannot
427
+ * disagree with itself, and the commonest paragraph in a real document is in a cell.
428
+ */
429
+ readonly indentUnknown: boolean;
430
+ }
431
+ /**
432
+ * The fields `apply` accepts. Omitted fields are left as authored; `null` where allowed
433
+ * REMOVES the setting so the style supplies it again, which is not the same as a zero.
434
+ *
435
+ * @public
436
+ */
437
+ interface ParagraphFormatUpdate {
438
+ readonly alignment?: 'left' | 'center' | 'right' | 'justify';
439
+ readonly spaceBeforePt?: number | null;
440
+ readonly spaceAfterPt?: number | null;
441
+ readonly lineSpacing?: {
442
+ readonly rule: 'multiple' | 'exact' | 'atLeast';
443
+ readonly value: number;
444
+ } | null;
445
+ readonly indentLeftTwips?: number | null;
446
+ readonly indentRightTwips?: number | null;
447
+ readonly indentFirstLineTwips?: number | null;
448
+ readonly contextualSpacing?: boolean;
449
+ readonly keepNext?: boolean;
450
+ readonly keepLines?: boolean;
451
+ readonly widowControl?: boolean;
452
+ readonly pageBreakBefore?: boolean;
453
+ /** Replace the custom tab stops. An EMPTY list clears them; omit to leave them alone. */
454
+ readonly tabStops?: readonly ParagraphTabStop[];
455
+ }
456
+
457
+ /** Shared draft conversion and mixed-value handling for Paragraph dialogs. */
458
+
459
+ /** @public */
460
+ declare const twipsToInches: (twips: number) => number;
461
+ /**
462
+ * Inches for DISPLAY, in the BROWSER's number format.
463
+ *
464
+ * `0.5` and `0,5` are the same measurement, and roughly half the locales this ships with
465
+ * write the second one. Interpolating a raw `Number` into a string picks the first for
466
+ * everyone. The catalogue supplies the surrounding words; this supplies the number.
467
+ *
468
+ * Not the editor's locale: nothing in the i18n layer exposes one to read, so a German
469
+ * editor in an American browser still renders `0.5`. The browser's guess beats a hardcoded
470
+ * `.` for every reader whose browser matches their language, which is most of them.
471
+ * @public
472
+ */
473
+ declare const formatInches: (twips: number) => string;
474
+ /** @public */
475
+ declare const inchesToTwips: (inches: number) => number;
476
+ /** @public */
477
+ type TabAlignment = 'left' | 'center' | 'right' | 'decimal' | 'bar';
478
+ /** @public */
479
+ type TabLeaderName = 'none' | 'dot' | 'hyphen' | 'underscore';
480
+ /** One label key per alignment, so the rows read as words rather than as `w:val` values. * @public
481
+ */
482
+ declare const TAB_ALIGNMENT_LABELS: {
483
+ readonly left: "dialogs.paragraph.tabAlignLeft";
484
+ readonly center: "dialogs.paragraph.tabAlignCenter";
485
+ readonly right: "dialogs.paragraph.tabAlignRight";
486
+ readonly decimal: "dialogs.paragraph.tabAlignDecimal";
487
+ readonly bar: "dialogs.paragraph.tabAlignBar";
488
+ };
489
+ /** The "Special" pair: the signed first-line offset, split into a kind and a magnitude. * @public
490
+ */
491
+ type SpecialIndent = 'none' | 'firstLine' | 'hanging';
492
+ /** @public */
493
+ declare const specialOf: (signedTwips: number | null) => SpecialIndent;
494
+ /** Fold the "Special" pair back into the ONE signed value the engine takes. * @public
495
+ */
496
+ declare const signedFirstLineOf: (kind: SpecialIndent, magnitudeTwips: number) => number;
497
+ /**
498
+ * Every field of the form, in the shape the controls hold it.
499
+ *
500
+ * Deliberately flat and all-defined: this is what the dialog SHOWS, and a control cannot
501
+ * show "mixed" and a number at once. The disagreement itself is remembered by comparing
502
+ * against the seed, not by keeping a null in here.
503
+ * @public
504
+ */
505
+ interface ParagraphDialogFields {
506
+ alignment: 'left' | 'center' | 'right' | 'justify';
507
+ indentLeft: number;
508
+ indentRight: number;
509
+ special: SpecialIndent;
510
+ specialBy: number;
511
+ spaceBefore: number;
512
+ spaceAfter: number;
513
+ lineRule: 'multiple' | 'exact' | 'atLeast';
514
+ lineValue: number;
515
+ contextualSpacing: boolean;
516
+ keepNext: boolean;
517
+ keepLines: boolean;
518
+ widowControl: boolean;
519
+ pageBreakBefore: boolean;
520
+ tabStops: readonly ParagraphTabStop[];
521
+ /** The user pressed "Clear all", which is a decision even when the list already looked empty. */
522
+ clearedAllTabStops: boolean;
523
+ }
524
+ /**
525
+ * Open the form on the selection.
526
+ *
527
+ * A `null` field means the selection DISAGREES about that setting. There is no third
528
+ * checkbox state to show it with, so the control opens on the least surprising value and
529
+ * {@link changedFields} keeps the disagreement alive by not writing what the user did not
530
+ * touch. `widowControl` opens ON because that is the Word default a document inherits
531
+ * when nothing says otherwise.
532
+ * @public
533
+ */
534
+ declare function seedFields(format: ParagraphFormatRead): ParagraphDialogFields;
535
+ /**
536
+ * Which settings the selection DISAGREES about, so a control can show it.
537
+ *
538
+ * The value fields need this as much as the checkboxes do. A control that renders a
539
+ * disagreement as a plausible-looking number is not just unhelpful — it makes the
540
+ * disagreement uncorrectable, because the value that would fix it is the one already on
541
+ * screen, so `changedFields` sees nothing move and writes nothing. Four paragraphs at
542
+ * mixed alignments showed "Left" and could not be set to Left.
543
+ * @public
544
+ */
545
+ interface ParagraphDialogMixed {
546
+ readonly contextualSpacing: boolean;
547
+ readonly keepNext: boolean;
548
+ readonly keepLines: boolean;
549
+ readonly widowControl: boolean;
550
+ readonly pageBreakBefore: boolean;
551
+ /** The selection's paragraphs carry DIFFERENT tab stops, so the list shows none of them. */
552
+ readonly tabStops: boolean;
553
+ readonly alignment: boolean;
554
+ readonly indentLeft: boolean;
555
+ readonly indentRight: boolean;
556
+ readonly special: boolean;
557
+ readonly spaceBefore: boolean;
558
+ readonly spaceAfter: boolean;
559
+ readonly lineSpacing: boolean;
560
+ }
561
+ /** The five members that are checkboxes, and so share a label key with their control. * @public
562
+ */
563
+ type ParagraphFlagKey = 'contextualSpacing' | 'keepNext' | 'keepLines' | 'widowControl' | 'pageBreakBefore';
564
+ /** @public */
565
+ declare const NO_MIXED_FIELDS: ParagraphDialogMixed;
566
+ /**
567
+ * A checkbox over a setting the selection disagrees about is INDETERMINATE, not unchecked
568
+ * — unchecked would claim the paragraphs agree it is off. The read reports `null` for
569
+ * exactly this, and a control that collapses it to a boolean throws the distinction away.
570
+ * @public
571
+ */
572
+ declare function mixedFieldsOf(format: ParagraphFormatRead): ParagraphDialogMixed;
573
+ /** Whether two stop lists say the same thing. A list needs more than reference equality. * @public
574
+ */
575
+ declare function sameTabStops(a: readonly ParagraphTabStop[], b: readonly ParagraphTabStop[]): boolean;
576
+ /**
577
+ * The submission: ONLY the fields that moved since the dialog opened.
578
+ *
579
+ * Sending the whole form would flatten every setting the selection disagrees about. A
580
+ * mixed `keepNext` would become off on every paragraph, and a mixed left indent would
581
+ * become an explicit zero — which is worse than wrong, because a zero BLOCKS the style
582
+ * cascade where leaving the setting alone would let the style keep supplying it. An
583
+ * untouched field is not a decision, so it is not written.
584
+ *
585
+ * Returns null when nothing moved, which the caller treats as "just close": an empty
586
+ * write would still push an undo entry that restores nothing.
587
+ * @public
588
+ */
589
+ declare function changedFields(seed: ParagraphDialogFields, current: ParagraphDialogFields,
590
+ /** What the selection disagreed about when the dialog opened. */
591
+ seedMixed?: ParagraphDialogMixed,
592
+ /** What it still disagrees about now. A field that left this set was RESOLVED. */
593
+ currentMixed?: ParagraphDialogMixed): ParagraphFormatUpdate | null;
594
+ /** Add one stop, replacing any stop already at that position, and keep the list sorted. * @public
595
+ */
596
+ declare function withTabStop(stops: readonly ParagraphTabStop[], stop: ParagraphTabStop): readonly ParagraphTabStop[];
597
+ /**
598
+ * Keep Tab inside the dialog.
599
+ *
600
+ * `aria-modal` tells assistive tech the rest of the page is inert; it does not stop Tab,
601
+ * so without this the third Tab lands on the document behind the dialog — which is the
602
+ * editable surface, so the next keystroke types into the paragraph being formatted.
603
+ *
604
+ * Returns true when the event was handled, so a caller only has to call `preventDefault`.
605
+ * @public
606
+ */
607
+ declare function trapTabWithin(panel: HTMLElement, event: KeyboardEvent): boolean;
608
+
609
+ export { AUTO_ZOOM_MODE, BROWSER_AUTOMATION_CAPABILITIES, type ColorLowerResult, DRAWING_REL_FROM_H, DRAWING_REL_FROM_V, DocxEditorInstance, DrawingPositionInput, FIT_WIDTH_ZOOM_MODE, LOADING_SNAPSHOT, NO_MIXED_FIELDS, OpenPaginatedResult, PX_PER_CM, PX_PER_INCH, PaginatedSurface, PaginatedSurfaceOptions, type ParagraphDialogFields, type ParagraphDialogMixed, type ParagraphFlagKey, type ParagraphFlagState, type ParagraphFormatRead, type ParagraphFormatUpdate, ParagraphTabStop, type RulerDragOptions, type RulerIndent, type RulerIndentHandle, type RulerPageMetrics, type RulerTick, type RulerUnit, SNAP_TWIPS_CM, SNAP_TWIPS_INCH, type SpecialIndent, type SurfaceExtent, TAB_ALIGNMENT_LABELS, TWIPS_PER_CM, TWIPS_PER_INCH, type TabAlignment, type TabLeaderName, TreeDocxSessionView, ZOOM_MAX, ZOOM_MIN, applyThemeShade, applyThemeTint, changedFields, clipboardDropLandsText, clipboardPasteLandsContent, createBrowserAutomationHost, createLayoutShaping, dragIndent, editorCommandKey, formatInches, generateRulerTicks, handlePosition, inchesToTwips, lowerColorValueForBorder, lowerColorValueForFill, mixedFieldsOf, mountPaginatedSurface, partOfNodeId, positionInputFromPropertiesCommand, propertiesCommandHasPositionFields, resolveColorValueToCss, resolveThemeColorHex, resolveZoomMode, rulerPageBox, sameTabStops, sameZoomMode, seedFields, signedFirstLineOf, snapTwips, specialOf, surfaceExtent, tableCommandState, toEditorFontError, trapTabWithin, twipsToInches, validateDrawingPositionInput, validateSetImagePositionCommand, validateThemeModifier, withTabStop };
package/dist/editor.js CHANGED
@@ -1 +1 @@
1
- export{Ha as AUTO_ZOOM_MODE,Ma as BROWSER_AUTOMATION_CAPABILITIES,ua as CHROME_GROUPS,ya as CHROME_MENUS,Ba as CHROME_UNAVAILABLE_KEY,W as DEFAULT_TABLE_CHROME_DRAFT,O as EMU_PER_POINT,Ia as FIT_WIDTH_ZOOM_MODE,M as IMAGE_OVERLAY_NUDGE_PT,N as IMAGE_OVERLAY_NUDGE_SHIFT_PT,c as LOADING_SNAPSHOT,k as PX_PER_CM,j as PX_PER_INCH,q as SNAP_TWIPS_CM,p as SNAP_TWIPS_INCH,aa as TABLE_BORDER_STYLE_OPTIONS,$ as TABLE_BORDER_TARGET_OPTIONS,ba as TABLE_BORDER_WIDTH_OPTIONS,X as TABLE_CHROME_SLOT_IDS,o as TWIPS_PER_CM,n as TWIPS_PER_INCH,Ga as ZOOM_MAX,Fa as ZOOM_MIN,ca as applyTableChromePick,w as applyThemeShade,v as applyThemeTint,d as blankDocumentBytes,K as canExecuteImageCommand,J as captureImageMutationPreconditions,Aa as chromeControlCount,za as chromeMenuSlots,ga as chromeProbeForSlot,va as chromeSlotId,ma as chromeSlotIsToggle,f as clipboardDropLandsText,e as clipboardPasteLandsContent,ha as commandForSlot,ja as commandForSlotValue,ia as commandForTableChromeSlotValue,Ua as computeImageResizeResult,T as computeMovedImagePosition,S as computeResizedImageExtentEmu,Na as createBrowserAutomationHost,La as createDocxEditor,i as createFontSource,Va as createImageOverlayScrollPort,b as createLayoutShaping,G as cropPercentFromCropPermille,E as cropPercentFromPermille,B as cropPercentFromSourceCrop,F as cropPermilleFromCropPercent,D as cropPermilleFromPercent,Qa as cssPixelsToLayoutPoints,wa as defaultChromeGroups,Y as defaultTableLabel,t as dragIndent,ta as editorCommandKey,R as emuToOverlayPoints,Da as equationAtPosition,L as executeImageCommand,Wa as finalizeImageOverlayInteraction,xa as formattingBarChromeGroups,l as generateRulerTicks,r as handlePosition,U as isStaleImageInteractionCommit,Z as isTableChromeSlot,Pa as layoutPointsToCssPixels,h as loadFonts,y as lowerColorValueForBorder,z as lowerColorValueForFill,Ea as mountPaginatedSurface,Ra as overlayFrameToSheetCssPixels,Sa as overlayHostOrigin,g as partOfNodeId,Q as pointsToEmu,da as probeTableChromeCommand,Ta as resizePreservesAspect,A as resolveColorValueToCss,x as resolveThemeColorHex,Ja as resolveZoomMode,m as rulerPageBox,qa as runSave,oa as runTableChromeCommand,sa as runTableCommand,pa as runToolbarCommand,Ka as sameZoomMode,P as selectedDrawingOverlayTargetOf,I as selectedImageStateOf,s as snapTwips,C as sourceCropFromCropPercent,Ca as surfaceExtent,Oa as surfacePaintScale,fa as tableChromeIconPaths,ea as tableChromeLabelKeyForTarget,ka as tableChromeToolbarState,_ as tableChromeVisible,V as tableCommandState,ra as tableCommandToolbarState,a as toEditorFontError,la as toolbarCommandState,na as toolbarCommandStates,H as validateImageCropPercent,u as validateThemeModifier}from'./chunk-QQP2SGAT.js';export{a as resolveEditorModules}from'./chunk-D5EHDHYV.js';import'./chunk-4RDCLCLB.js';export{g as FONT_RESOLVER_BRAND,f as FONT_RESOLVER_MARK_KEY,b as MAX_RESOLVER_FAMILIES,c as WORD_DEFAULT_FONT,d as composeFontConfiguration,j as composeFontOrigins,h as defineFontResolver,i as isFontResolver}from'./chunk-MBXGQN6J.js';export{J as disposeLayoutShaping}from'./chunk-RXPOTTQQ.js';import'./chunk-RIYSCEFQ.js';import'./chunk-7QG5FJ4X.js';import'./chunk-FRRMJK2G.js';import'./chunk-VYQTZIYH.js';import'./chunk-VP7SDFCM.js';import'./chunk-BML3CNUT.js';import'./chunk-UXAWPVH6.js';import'./chunk-W7GY2IJC.js';import'./chunk-6JIJOZDW.js';import'./chunk-XXLS6O6B.js';export{m as DEFAULT_IMAGE_RESOURCE_LIMITS,Ch as DRAWING_REL_FROM_H,Dh as DRAWING_REL_FROM_V,cb as IMAGE_WRAP_TARGETS,Fh as positionInputFromPropertiesCommand,Eh as propertiesCommandHasPositionFields,n as resolveImageResourceLimits,xb as resolveSvgIntrinsicSize,tb as sniffImageMime,Bh as validateDrawingPositionInput,yb as validateRasterHeader,Gh as validateSetImagePositionCommand}from'./chunk-MDMM3XVQ.js';import'./chunk-GOEBQ26R.js';
1
+ export{Ia as AUTO_ZOOM_MODE,Na as BROWSER_AUTOMATION_CAPABILITIES,va as CHROME_GROUPS,za as CHROME_MENUS,Ca as CHROME_UNAVAILABLE_KEY,X as DEFAULT_TABLE_CHROME_DRAFT,P as EMU_PER_POINT,Ja as FIT_WIDTH_ZOOM_MODE,N as IMAGE_OVERLAY_NUDGE_PT,O as IMAGE_OVERLAY_NUDGE_SHIFT_PT,c as LOADING_SNAPSHOT,db as NO_MIXED_FIELDS,l as PX_PER_CM,k as PX_PER_INCH,r as SNAP_TWIPS_CM,q as SNAP_TWIPS_INCH,ba as TABLE_BORDER_STYLE_OPTIONS,aa as TABLE_BORDER_TARGET_OPTIONS,ca as TABLE_BORDER_WIDTH_OPTIONS,Y as TABLE_CHROME_SLOT_IDS,$a as TAB_ALIGNMENT_LABELS,p as TWIPS_PER_CM,o as TWIPS_PER_INCH,Ha as ZOOM_MAX,Ga as ZOOM_MIN,da as applyTableChromePick,x as applyThemeShade,w as applyThemeTint,d as blankDocumentBytes,L as canExecuteImageCommand,K as captureImageMutationPreconditions,gb as changedFields,Ba as chromeControlCount,Aa as chromeMenuSlots,ha as chromeProbeForSlot,wa as chromeSlotId,na as chromeSlotIsToggle,f as clipboardDropLandsText,e as clipboardPasteLandsContent,ia as commandForSlot,ka as commandForSlotValue,ja as commandForTableChromeSlotValue,Va as computeImageResizeResult,U as computeMovedImagePosition,T as computeResizedImageExtentEmu,Oa as createBrowserAutomationHost,Ma as createDocxEditor,i as createFontSource,Wa as createImageOverlayScrollPort,b as createLayoutShaping,H as cropPercentFromCropPermille,F as cropPercentFromPermille,C as cropPercentFromSourceCrop,G as cropPermilleFromCropPercent,E as cropPermilleFromPercent,Ra as cssPixelsToLayoutPoints,j as customFonts,xa as defaultChromeGroups,Z as defaultTableLabel,u as dragIndent,ua as editorCommandKey,S as emuToOverlayPoints,Ea as equationAtPosition,M as executeImageCommand,Xa as finalizeImageOverlayInteraction,Za as formatInches,ya as formattingBarChromeGroups,m as generateRulerTicks,s as handlePosition,_a as inchesToTwips,V as isStaleImageInteractionCommit,_ as isTableChromeSlot,Qa as layoutPointsToCssPixels,h as loadFonts,z as lowerColorValueForBorder,A as lowerColorValueForFill,eb as mixedFieldsOf,Fa as mountPaginatedSurface,Sa as overlayFrameToSheetCssPixels,Ta as overlayHostOrigin,g as partOfNodeId,R as pointsToEmu,ea as probeTableChromeCommand,Ua as resizePreservesAspect,B as resolveColorValueToCss,y as resolveThemeColorHex,Ka as resolveZoomMode,n as rulerPageBox,ra as runSave,pa as runTableChromeCommand,ta as runTableCommand,qa as runToolbarCommand,fb as sameTabStops,La as sameZoomMode,cb as seedFields,Q as selectedDrawingOverlayTargetOf,J as selectedImageStateOf,bb as signedFirstLineOf,t as snapTwips,D as sourceCropFromCropPercent,ab as specialOf,Da as surfaceExtent,Pa as surfacePaintScale,ga as tableChromeIconPaths,fa as tableChromeLabelKeyForTarget,la as tableChromeToolbarState,$ as tableChromeVisible,W as tableCommandState,sa as tableCommandToolbarState,a as toEditorFontError,ma as toolbarCommandState,oa as toolbarCommandStates,ib as trapTabWithin,Ya as twipsToInches,I as validateImageCropPercent,v as validateThemeModifier,hb as withTabStop}from'./chunk-QBMAXYN7.js';export{a as resolveEditorModules}from'./chunk-D5EHDHYV.js';import'./chunk-2ZEU42EA.js';export{h as FONT_RESOLVER_BRAND,g as FONT_RESOLVER_MARK_KEY,c as MAX_RESOLVER_FAMILIES,d as WORD_DEFAULT_FONT,e as composeFontConfiguration,k as composeFontOrigins,i as defineFontResolver,j as isFontResolver}from'./chunk-OODFC5R2.js';export{H as disposeLayoutShaping}from'./chunk-DQS4KZUX.js';import'./chunk-RIYSCEFQ.js';import'./chunk-P6VGDI57.js';import'./chunk-MSIFK7TJ.js';import'./chunk-72BDQFHY.js';import'./chunk-BEOPUDAB.js';import'./chunk-4DB7ZFQN.js';import'./chunk-THCGTV53.js';import'./chunk-VP7SDFCM.js';import'./chunk-4KMSEFIG.js';import'./chunk-6JIJOZDW.js';import'./chunk-ZMM5RNM6.js';export{m as DEFAULT_IMAGE_RESOURCE_LIMITS,Sh as DRAWING_REL_FROM_H,Th as DRAWING_REL_FROM_V,cb as IMAGE_WRAP_TARGETS,ah as TEXT_FORM_FORMATS,Vh as positionInputFromPropertiesCommand,Uh as propertiesCommandHasPositionFields,n as resolveImageResourceLimits,xb as resolveSvgIntrinsicSize,tb as sniffImageMime,Rh as validateDrawingPositionInput,yb as validateRasterHeader,Wh as validateSetImagePositionCommand}from'./chunk-CJCFEXTA.js';import'./chunk-GOEBQ26R.js';
package/dist/export.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkG5GLQ4SX_cjs=require('./chunk-G5GLQ4SX.cjs'),chunkJROG4U3Z_cjs=require('./chunk-JROG4U3Z.cjs'),chunkPRNYSOQL_cjs=require('./chunk-PRNYSOQL.cjs');require('./chunk-FGBADUSK.cjs');var chunkNPZX5O23_cjs=require('./chunk-NPZX5O23.cjs'),chunkJP253KIZ_cjs=require('./chunk-JP253KIZ.cjs'),chunkZFBNCHRP_cjs=require('./chunk-ZFBNCHRP.cjs');var mn=new WeakMap,ar=new Set(["shape","rect","roundrect","oval","line","group","arc","curve","polyline","image"]);function ir(e){let t=mn.get(e.root);if(t)return t;let n=new Set,r=[{node:e.root,scope:chunkZFBNCHRP_cjs.Va(),depth:0,mcSelected:false}],o=0;for(;r.length;){let{node:i,scope:s,depth:u,mcSelected:f}=r.pop();if(++o>chunkZFBNCHRP_cjs.fb||u>chunkZFBNCHRP_cjs.W){n.add("scan-limit");break}if(i.kind==="textValue")continue;if(o+r.length+i.children.length>chunkZFBNCHRP_cjs.fb){n.add("scan-limit");break}let l=chunkZFBNCHRP_cjs.Ua(s,i),d=chunkZFBNCHRP_cjs.Ta(i)?i:void 0;if(d){if(chunkZFBNCHRP_cjs.jb(d,l).drawing)continue;let c=chunkZFBNCHRP_cjs.ib(d,l);c.refused&&n.add("scan-limit"),c.branch&&r.push({node:c.branch,scope:l,depth:u+1,mcSelected:true});continue}if(!(!f&&chunkZFBNCHRP_cjs.Sa(i))){if(i.namespaceUri==="urn:schemas-microsoft-com:vml"&&i.localName==="textbox"){n.add("legacy-textbox");continue}i.namespaceUri==="urn:schemas-microsoft-com:vml"&&ar.has(i.localName)&&!i.children.some(c=>c.kind!=="textValue"&&c.namespaceUri==="urn:schemas-microsoft-com:vml"&&c.localName==="textbox")&&n.add("legacy-drawing");for(let c of i.children)r.push({node:c,scope:l,depth:u+1,mcSelected:f});}}let a=Object.freeze([...n]);return mn.set(e.root,a),a}function yn(e){let t=new Set([e.part()]);for(let n of e.headerFooterPartsBySection())for(let r of [n.headers,n.footers])for(let o of r.values())t.add(o);for(let n of ["footnote","endnote"]){let r=chunkZFBNCHRP_cjs.Jf(e.currentPackage(),n);r&&t.add(r);}return Object.freeze([...t].flatMap(n=>ir(n).map(r=>Object.freeze({code:r,partName:n.name}))))}var sr=Object.freeze({}),cr=Object.freeze([]);function dr(e){let t=Object.keys(e);if(t.length===0)return sr;let n={};for(let r of t){let o=e[r];o!==void 0&&(n[r]=o);}return Object.freeze(n)}function lr(e){let t=new Map(chunkZFBNCHRP_cjs.Te(e.part())),n=new Set([e.part()]);for(let o of e.headerFooterPartsBySection())for(let a of [o.headers,o.footers])for(let i of a.values())if(!n.has(i)){n.add(i);for(let[s,u]of chunkZFBNCHRP_cjs.Te(i))t.has(s)||t.set(s,u);}let r=e.currentPackage();for(let o of ["footnote","endnote"]){let a=chunkZFBNCHRP_cjs.Jf(r,o);if(!(!a||n.has(a))){n.add(a);for(let[i,s]of chunkZFBNCHRP_cjs.Te(a))t.has(i)||t.set(i,s);}}return t}function ur(e,t){let n=chunkJROG4U3Z_cjs.kf(e,t);if(!n)return null;let r=e.pages[n.pageIndex];if(!r)return null;let o=chunkJROG4U3Z_cjs.bf(r),a=chunkJROG4U3Z_cjs.df(e,t.paragraphId,n.pageIndex),i=Object.freeze({x:n.x+a.x,y:n.y+a.y,height:n.height});return Object.freeze({anchor:Object.freeze({...t}),pageIndex:n.pageIndex,pageContent:i,pageStack:Object.freeze({x:o.x+i.x,y:o.y+i.y})})}function pr(e,t){let n=[];for(let r of t.values()){let o=ur(e,r);o&&n.push(o);}return n.length===0?cr:Object.freeze(n)}function gn(e,t){return {documentMetadata:dr(e.documentProperties()),destinations:pr(t,lr(e))}}function fr(e,t){let n=e.destinations;if(n){for(let r of n)if(r.anchor.name===t)return r}}function Oe(e={}){return Object.freeze({async decode(t,n,r){let o=chunkZFBNCHRP_cjs.yb(t,n);if(!o)throw new Error(`Unsupported or malformed ${n} image`);if(o.pixelWidth>r.maxDimension||o.pixelHeight>r.maxDimension||o.pixelWidth>r.maxPixels/o.pixelHeight)throw new Error("Image dimensions exceed resource limits");return Object.freeze({pixelWidth:o.pixelWidth,pixelHeight:o.pixelHeight,dpiX:o.dpiX??96,dpiY:o.dpiY??96})},...e.convertPreserved?{convertPreserved:e.convertPreserved}:{}})}var mr=65536;function bn(e,t){return {x:t.x-e.contentBox.x,y:t.y-e.contentBox.y}}function yr(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function gr(e,t,n){return e.rootStory!==t?false:t==="footnote"||t==="endnote"?e.noteScopeId===n:true}function hr(e,t){if(t.story!=="textbox"||t.textboxPath.length===0)return null;let n=null;return chunkJROG4U3Z_cjs.Da(e,r=>{if(n||!gr(t,r.story,r.noteScopeId))return;let o=r.story==="header"||r.story==="footer"?a=>chunkJROG4U3Z_cjs.ya(a,r.origin,{x:e.box.x,y:e.box.y}):void 0;chunkJROG4U3Z_cjs.Ha(r.host,(a,i)=>{if(n||i.textboxDepth===0)return;let s=i.textboxPath.map(u=>u.drawingNodeId);yr(s,t.textboxPath)&&(n=bn(e,i.storyOrigin));},r.origin,o);}),n}function xr(e,t){if(t.story==="textbox")return hr(e,t)??{x:0,y:0};switch(t.rootStory){case "body":return {x:0,y:0};case "header":return e.header?chunkJROG4U3Z_cjs.cf(e,e.header.box):{x:0,y:0};case "footer":return e.footer?chunkJROG4U3Z_cjs.cf(e,e.footer.box):{x:0,y:0};case "footnote":case "endnote":{let r=(t.rootStory==="footnote"?e.footnotes:e.endnotes)?.notes.find(o=>o.scopeId===t.noteScopeId);return r?chunkJROG4U3Z_cjs.cf(e,r.box):{x:0,y:0}}case "note-separator":{let n=t.noteAreaKind==="endnotes"?e.endnotes:e.footnotes;return n?.separator?chunkJROG4U3Z_cjs.cf(e,n.separator.box):{x:0,y:0}}default:return {x:0,y:0}}}function Rn(e){return Object.freeze({x:e.x,y:e.y,width:e.width,height:e.height})}function En(e,t){let n=chunkJROG4U3Z_cjs.bf(e);return Object.freeze({x:n.x+t.x,y:n.y+t.y,width:t.width,height:t.height})}function br(e,t){let n=chunkJROG4U3Z_cjs.kf(e,{paragraphId:t.source.start.paragraphId,offset:t.source.start.offset},{preferredPageIndex:t.pageIndex});if(!n||n.pageIndex!==t.pageIndex)return;let r=e.pages[n.pageIndex];if(!r)return;let o=xr(r,t),a=Object.freeze([Rn({x:n.x+o.x,y:n.y+o.y,width:0,height:n.height})]);return Object.freeze({pageContent:a,pageStack:Object.freeze(a.map(i=>En(r,i)))})}function Rr(e,t,n){let r=n.filter(i=>i.pageIndex===t.pageIndex);if(r.length===0)return wn(t)?br(e,t):void 0;let o=e.pages[t.pageIndex];if(!o)return;let a=Object.freeze(r.map(i=>Rn(i)));return Object.freeze({pageContent:a,pageStack:Object.freeze(a.map(i=>En(o,i)))})}function wn(e){return e.source.start.paragraphId===e.source.end.paragraphId&&e.source.start.offset===e.source.end.offset}function xn(e,t){return `${e}\0${t}`}function Er(e,t,n){let r=Math.max(e.start,t.offset),o=Math.min(e.end,n.offset);return o>r?{start:r,end:o}:null}function wr(e,t){let n=new Map,r=new Map,o=new Set,a=0;let i=(s,u)=>{if(a>=mr)return false;a+=1;let f=xn(s.pageIndex,u),l=r.get(f);return l?l.push(s):r.set(f,[s]),true};for(let[s,u]of t.entries())for(let[f,l]of u.occurrences.entries()){if(wn(l)||l.source.start.paragraphId!==l.source.end.paragraphId)continue;o.add(l.pageIndex);let d=`${s}\0${f}`,c={paragraphId:l.source.start.paragraphId,offset:l.source.start.offset},m={paragraphId:l.source.end.paragraphId,offset:l.source.end.offset},y=c.offset<=m.offset?{from:c,to:m}:{from:m,to:c};i({key:d,from:y.from,to:y.to,pageIndex:l.pageIndex},y.from.paragraphId);}if(r.size===0)return n;for(let s of e.pages)o.has(s.index)&&chunkJROG4U3Z_cjs.Da(s,u=>{let f=u.story==="header"||u.story==="footer"?l=>chunkJROG4U3Z_cjs.ya(l,u.origin,{x:s.box.x,y:s.box.y}):void 0;chunkJROG4U3Z_cjs.Ha(u.host,(l,d)=>{let c=bn(s,d.storyOrigin);for(let m of l.lines)for(let y of chunkJROG4U3Z_cjs.Oa(m)){let p=r.get(xn(s.index,y.paragraphId));if(p)for(let x of p){let h=Er(y,x.from,x.to);if(!h)continue;let b=chunkJROG4U3Z_cjs.Ze(m,h.start,void 0,y),E=chunkJROG4U3Z_cjs.Ze(m,h.end,void 0,y),P=n.get(x.key)??[];P.push({pageIndex:s.index,x:Math.min(b,E)+c.x,y:m.box.y+c.y,width:Math.abs(E-b),height:m.box.height}),n.set(x.key,P);}}},u.origin,f);});return n}function Fn(e,t){let n=false;for(let o of t)if(o.occurrences.length!==0){n=true;break}if(!n)return t;let r=wr(e,t);return t.map((o,a)=>{if(o.occurrences.length===0)return o;let i=o.occurrences.map((s,u)=>{let f=`${a}\0${u}`,l=Rr(e,s,r.get(f)??[]);return l?{...s,geometry:l}:s});return {...o,occurrences:Object.freeze(i)}})}function Fr(e){let t=new Map,n=[{node:e.root,depth:0}];for(;n.length>0;){let{node:r,depth:o}=n.pop();if(!(r.kind==="textValue"||o>64)){r.kind==="paragraph"&&!t.has(r.id)&&t.set(r.id,t.size);for(let a=r.children.length-1;a>=0;a-=1)n.push({node:r.children[a],depth:o+1});}}return t}function Sn(){let e=new Map,t=r=>{let o=e.get(r.root);if(o)return o;let a=Fr(r);return e.set(r.root,a),a},n={retainRevisionItems:false,revisionSites:chunkZFBNCHRP_cjs.nh,locations:chunkJP253KIZ_cjs.Fa,commentAnchors:chunkZFBNCHRP_cjs.kg,deepOrder:t};return Object.freeze({collectReviewItems:r=>chunkJP253KIZ_cjs.La(r,n),deepParagraphOrderOfPart:t})}function Sr(e,t){if(t)return true;let n=e.map(r=>r.root);for(;n.length>0;){let r=n.pop();if(chunkZFBNCHRP_cjs.lh(r))return true;if(r.kind!=="textValue")for(let o of r.children)n.push(o);}return false}function vr(e,t){let n=[],r=new Set([t.name]),o=a=>{!a||r.has(a.name)||(r.add(a.name),n.push(a));};for(let a of chunkZFBNCHRP_cjs.Od(e)){for(let i of a.headers.values())o(i);for(let i of a.footers.values())o(i);}return o(chunkZFBNCHRP_cjs.Jf(e,"footnote")),o(chunkZFBNCHRP_cjs.Jf(e,"endnote")),n}function Or(e,t){switch(t.story){case "body":return e.mainDocumentPart;case "header":case "footer":return t.host.partName;case "footnote":return chunkZFBNCHRP_cjs.Jf(e,"footnote")?.name??null;case "endnote":return chunkZFBNCHRP_cjs.Jf(e,"endnote")?.name??null;case "note-separator":return chunkZFBNCHRP_cjs.Jf(e,t.noteAreaKind==="footnotes"?"footnote":"endnote")?.name??null;default:return t}}function Pr(e,t){let n=new Map;for(let r of e){let o=t.get(r.partName),a=o?.get(r.start.paragraphId),i=o?.get(r.end.paragraphId);if(a===void 0||i===void 0)continue;let s=Math.min(a,i),u=Math.max(a,i),f=n.get(r.partName);n.set(r.partName,{lower:Math.min(f?.lower??s,s),upper:Math.max(f?.upper??u,u)});}return n}function Ir(e,t,n,r,o){let a=new Map(n.map(d=>[d.name,o(d)])),i=Pr(r,a),s=new Map,u=new Map,f=(d,c,m,y,p,x,h)=>{let b=a.get(d)?.get(p),E=i.get(d);if(b===void 0||!E||b<E.lower||b>E.upper)return;let P=s.get(d)??new Map;s.set(d,P);let q=u.get(d)??new Map;u.set(d,q);let z=JSON.stringify([c.story,c.noteScopeId,c.noteAreaKind]),ne=m==="textbox"?JSON.stringify([z,"textbox",y]):z,$=P.get(p)??[],G=`${p}\0${c.page.index}\0${ne}`,B=q.get(G);B||(B={pageIndex:c.page.index,story:m,rootStory:c.story,textboxPath:y,noteScopeId:c.noteScopeId,noteAreaKind:c.noteAreaKind,laneKey:ne,intervals:[],intervalKeys:new Set},q.set(G,B),$.push(B),P.set(p,$));let R=`${x}\0${h}`;B.intervalKeys?.has(R)||(B.intervalKeys?.add(R),B.intervals.push({start:x,end:h}));};chunkJROG4U3Z_cjs.Ea(e,d=>{let c=Or(t,d);!c||!i.has(c)||chunkJROG4U3Z_cjs.Ha(d.host,(m,y)=>{let p=y.textboxDepth>0?"textbox":d.story,x=y.textboxPath.map(b=>b.drawingNodeId),h=[];for(let b of m.lines){for(let E of b.spans)h.push(E.range);for(let E of b.drawings??[])h.push({paragraphId:E.paragraphId,start:E.start,end:E.start+1});}h.length===0&&h.push({paragraphId:m.range.paragraphId,start:m.range.start,end:m.range.end});for(let{paragraphId:b,start:E,end:P}of h)f(c,d,p,x,b,E,P);});}),chunkJROG4U3Z_cjs.Ga(e,d=>{let c=d.drawing.ownerPartName;i.has(c)&&f(c,d.root,d.story,d.textboxPath.map(m=>m.drawingNodeId),d.drawing.paragraphId,d.drawing.start,d.drawing.start+1);});for(let d of s.values())for(let c of d.values())for(let m of c){m.intervals.sort((p,x)=>p.start-x.start||p.end-x.end);let y=[];for(let p of m.intervals){let x=y.at(-1);x&&p.start<=x.end?x.end=Math.max(x.end,p.end):y.push({...p});}m.intervals.splice(0,m.intervals.length,...y),m.intervalKeys=void 0;}let l=new Map;for(let[d,c]of s){let m=a.get(d);if(!m)continue;let y=[];for(let[p,x]of c){let h=m.get(p);h!==void 0&&y.push({paragraphId:p,position:h,laneKeys:new Set(x.map(({laneKey:b})=>b))});}y.sort((p,x)=>p.position-x.position),l.set(d,y);}return {byPart:s,orderByPart:a,visibleByPart:l}}function vn(e,t){let n=0,r=e.length;for(;n<r;){let o=n+r>>>1;e[o].position<t?n=o+1:r=o;}return n}function Ar(e,t){if(e.start.paragraphId===e.end.paragraphId)return [e.start.paragraphId];let n=t.orderByPart.get(e.partName),r=t.visibleByPart.get(e.partName),o=n?.get(e.start.paragraphId),a=n?.get(e.end.paragraphId);if(!n||!r||o===void 0||a===void 0)return [e.start.paragraphId,e.end.paragraphId];let i=Math.min(o,a),s=Math.max(o,a),u=new Set(t.byPart.get(e.partName)?.get(e.start.paragraphId)?.map(({laneKey:d})=>d)??[]),f=new Set(t.byPart.get(e.partName)?.get(e.end.paragraphId)?.map(({laneKey:d})=>d)??[]),l=new Set([...u].filter(d=>f.has(d)));return l.size===0?[e.start.paragraphId,e.end.paragraphId]:r.slice(vn(r,i),vn(r,s+1)).filter(d=>[...d.laneKeys].some(c=>l.has(c))).map(d=>d.paragraphId)}function Dr(e,t,n,r){return r?e.intervals.filter(a=>a.start<=t&&t<a.end).length>0?[{start:t,end:t}]:[]:e.intervals.flatMap(o=>{if(o.start===o.end)return [];let a={start:Math.max(o.start,t),end:Math.min(o.end,n)};return a.end>a.start?[a]:[]})}function Lr(e,t){let n=Number.NEGATIVE_INFINITY;for(let r of e)for(let o of r.intervals)n=Math.max(n,o.end);return t!==n?new Set:new Set(e.filter(r=>r.intervals.some(o=>o.end===n)))}function On(e,t,n){let r=[],o=new Set;for(let[a,i]of e.entries()){let s=n===void 0?void 0:n===null?"neutral":a<n?"replaced":"replacement";for(let u of Ar(i,t)){let f=t.byPart.get(i.partName)?.get(u)??[],d=i.start.paragraphId===i.end.paragraphId&&i.start.offset===i.end.offset,c=u===i.start.paragraphId?i.start.offset:0,m=u===i.end.paragraphId?i.end.offset:Number.POSITIVE_INFINITY,y=d?Lr(f,c):new Set;for(let p of f){let x=Dr(p,c,m,d);d&&x.length===0&&y.has(p)&&(x=[{start:c,end:c}]);for(let h of x){let b=`${p.pageIndex}\0${p.story}\0${p.noteScopeId??""}\0${p.noteAreaKind??""}\0${p.textboxPath.join("\0")}\0${i.partName}\0${u}\0${h.start}\0${h.end}\0${s??""}`;o.has(b)||(o.add(b),r.push({pageIndex:p.pageIndex,physicalPageNumber:p.pageIndex+1,story:p.story,rootStory:p.rootStory,textboxPath:p.textboxPath,noteScopeId:p.noteScopeId,noteAreaKind:p.noteAreaKind,...s?{revisionRole:s}:{},source:{partName:i.partName,start:{paragraphId:u,offset:h.start},end:{paragraphId:u,offset:h.end}}}));}}}}return r}function In(e,t){let n=2166136261,r=2654435769;for(let o=0;o<t.length;o+=1){let a=t.charCodeAt(o);n=Math.imul(n^a,16777619)>>>0,r=Math.imul(r^a+o,2246822507)>>>0,r^=r>>>13;}return `${e}_${t.length.toString(36)}_${n.toString(36)}_${r.toString(36)}`}function Pn(e,t,n=In){let r=new Map;for(let a of t){let i=n(e,a),s=r.get(i)??new Set;s.add(a),r.set(i,s);}let o=new Map;for(let[a,i]of r){let s=[...i].sort();for(let[u,f]of s.entries())o.set(f,s.length===1?a:`${a}_${u.toString(36)}`);}return o}function Tr(e){let t=new Set,n=new Set;for(let r of e){if(r.kind==="comment"){t.add(r.id),r.parentId!==void 0&&t.add(r.parentId),r.parentRevisionId!==void 0&&n.add(r.parentRevisionId);for(let o of r.replyIds)t.add(o);}if(r.kind==="revision"){n.add(r.id),r.pairedWith!==void 0&&n.add(r.pairedWith);for(let o of r.replyIds)t.add(o);}}return {comment:Pn("comment",t),revision:Pn("change",n)}}function V(e,t,n){return e.get(n)??In(t,n)}function Mr(e,t,n){return e.kind==="revision"?{kind:"tracked-change",id:V(n.revision,"change",e.id),change:e.revisionKind,...e.markDirection?{markDirection:e.markDirection}:{},author:e.author,...e.date!==void 0?{date:e.date}:{},text:e.text,replacedText:e.replacedText,nesting:e.nesting,...e.replacedRangeCount!==void 0?{replacedRangeCount:e.replacedRangeCount}:{},readOnly:e.readOnly,...e.pairedWith!==void 0?{pairedWith:V(n.revision,"change",e.pairedWith)}:{},replyIds:e.replyIds.map(r=>V(n.comment,"comment",r)),occurrences:t?On(e.ranges,t,e.revisionKind==="replace"?e.replacedRangeCount??null:void 0):[]}:e.kind!=="comment"?null:{kind:"comment",id:V(n.comment,"comment",e.id),author:e.comment.author,initials:chunkJP253KIZ_cjs.va(e.comment),...e.comment.date!==void 0?{date:e.comment.date}:{},text:chunkJP253KIZ_cjs.ua(e.comment),resolved:e.resolved,...e.parentId!==void 0?{parentId:V(n.comment,"comment",e.parentId)}:{},...e.parentRevisionId!==void 0?{parentRevisionId:V(n.revision,"change",e.parentRevisionId)}:{},replyIds:e.replyIds.map(r=>V(n.comment,"comment",r)),orphaned:e.orphaned,occurrences:t&&e.range?On([e.range],t):[]}}function An(e,t){let n=t.parts.get(t.mainDocumentPart);if(!n)return [];let r=vr(t,n),o=[n,...r],a=t.parts.get(chunkJP253KIZ_cjs.P(t,n.name));if(!Sr(o,a))return [];let i=Sn(),s=i.collectReviewItems({storyPart:n,furnitureParts:r,commentsPart:a,commentsExtendedPart:t.parts.get(chunkJP253KIZ_cjs.Q(t,n.name))});if(s.length===0)return [];let u=s.flatMap(d=>chunkJP253KIZ_cjs.ya(d)),f=u.length>0?Ir(e,t,o,u,i.deepParagraphOrderOfPart):null,l=Tr(s);return s.map(d=>Mr(d,f,l)).filter(d=>d!==null)}var kr=new Set(["part","validatedHandle"]);function Dn(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function J(e,t,n,r,o){if(!(r!==void 0&&kr.has(r))){if(typeof e=="function")throw new TypeError("Semantic layout publication encountered a function value");if(!(e===null||typeof e!="object")&&!o?.has(e)){if(n.has(e))throw new TypeError("Semantic layout publication encountered a cyclic record graph");if(!t.has(e)){t.add(e),n.add(e);try{if(Array.isArray(e)){for(let a of e)J(a,t,n,void 0,o);Object.freeze(e);return}if(!Dn(e))throw new TypeError("Semantic layout publication encountered a non-record value");for(let a of Reflect.ownKeys(e)){let i=Object.getOwnPropertyDescriptor(e,a);if(i){if(!("value"in i))throw new TypeError("Semantic layout publication encountered an accessor property");J(i.value,t,n,a,o);}}Object.freeze(e);}finally{n.delete(e);}}}}}function Ln(e){if(!Dn(e))throw new TypeError("Semantic layout publication encountered a non-record value");let t=new Set;for(let r of e.pages)if(!(r===null||typeof r!="object"))for(let o of ["header","footer"]){let a=Object.getOwnPropertyDescriptor(r,o);if(!a||!("value"in a))continue;let i=a.value;if(i===null||typeof i!="object"||t.has(i))continue;let s=new Set;s.add(e),J(i,new Set,s,o),t.add(i);}let n=(r,o)=>{let a=new Set;for(let i of r){let s=new Set;s.add(e),J(i,a,s,void 0,o);}Object.freeze(r);};for(let r of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,r);if(!o)continue;if(!("value"in o))throw new TypeError("Semantic layout publication encountered an accessor property");if(r==="pages"&&Array.isArray(o.value)){n(o.value,t);continue}if(r==="reviewArtifacts"&&Array.isArray(o.value)){n(o.value);continue}let a=new Set;a.add(e),J(o.value,new Set,a,r);}return Object.freeze(e),e}var Nr=Object.freeze([]),w=class extends Error{constructor(n,r,o){super(r,o);this.code=n;this.name="ExportResourceError";}code};function Br(e){try{return e instanceof w}catch{return false}}function Cr(e){try{return e instanceof chunkJROG4U3Z_cjs.Wd}catch{return false}}function _r(e){try{return e instanceof Error&&typeof e.message=="string"&&e.message.length>0?e.message:null}catch{return null}}function jr(e){if(Br(e))return e;let t=Cr(e),n=_r(e),r=n?`: ${n}`:"",o=new w(t?"layoutInvariant":"layoutFailed",t?`Authored geometry could not be represented within the bounded page model${r}`:`Export layout failed${r}`);return Object.defineProperty(o,"cause",{configurable:true,value:e}),o}function zr(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("resourceTimeoutMs must be a positive finite number");return Math.max(1,e)}function Tn(e){if(e==="all-markup"||e==="proposed"||e==="original")return e;throw new RangeError("displayMode must be all-markup, proposed, or original")}var Ur=50,Pe=64;function Vr(e){switch(e.kind){case "pending":return true;case "ready":case "unrenderable":case "external":case "missing":return false;default:return e}}function Hr(e){let t=false;return chunkJROG4U3Z_cjs.Ga(e,({drawing:n})=>{Vr(n.resource)&&(t=true);}),t}function Mn(e){return !ArrayBuffer.isView(e)}function Ie(e,t={}){if(t.signal?.aborted)return {ok:false,reason:"aborted"};let n=Tn(t.displayMode??chunkJROG4U3Z_cjs.rb),r=Mn(e),o=Mn(e)?{ok:true,view:e}:chunkNPZX5O23_cjs.I(e);if(!o.ok)return o;let a=o.view,i=t.reuseAcrossRevisions??r,s=zr(t.resourceTimeoutMs),u=t.measurer??chunkJROG4U3Z_cjs.z(),f=t.producer??(t.measurer?"host-export-measurer":"export-fixed-measurer"),l=chunkJROG4U3Z_cjs.Jb({retainAcrossPasses:i}),d=0,c=new Set,m=()=>{d+=1;for(let R of c)R();c.clear();},y=chunkJROG4U3Z_cjs.nd({session:a,decodePort:t.imageDecodePort??Oe(t.convertPreservedImage?{convertPreserved:t.convertPreservedImage}:void 0),onResourcesChanged:m}),p={view:a,measurer:u,paragraphCache:l,sessions:new Map,completed:new Map,inFlight:new Map,styles:chunkJROG4U3Z_cjs.md(a),fieldLinks:new Map,links:chunkJROG4U3Z_cjs.be(a),drawingBundle:y,furniture:new Map},x=new AbortController,h=t.signal,b=false,E=()=>b?new w("aborted","Export resource settlement was aborted"):new w("disposed","Export session has been disposed"),P=()=>{b=true,q();};function q(){let R=p;if(R){p=null,h?.removeEventListener("abort",P),x.abort(h?.reason),R.drawingBundle.dispose(),R.paragraphCache.clear();for(let F of R.completed.values())chunkJROG4U3Z_cjs.ob(F.internal),chunkJROG4U3Z_cjs.he(F.internal);for(let F of R.fieldLinks.values())F.registry.clear();R.fieldLinks.clear(),R.completed.clear(),R.inFlight.clear(),R.furniture.clear(),R.sessions.clear(),m();}}h?.addEventListener("abort",P,{once:true}),h?.aborted&&P();let z=()=>{if(!p)throw E();if(x.signal.aborted)throw new w("aborted","Export resource settlement was aborted")},ne=(R,F,D,g)=>d!==R||p?.view.packageRevision()!==F||p?.view.currentPackage()!==D?Promise.resolve():(z(),new Promise((U,I)=>{let L=false,C,T=k=>{L||(L=true,C!==void 0&&clearTimeout(C),c.delete(M),x.signal.removeEventListener("abort",W),k?I(k):U());},M=()=>T(),W=()=>T(new w("aborted","Export resource settlement was aborted")),K=()=>{if(p?.view.packageRevision()!==F||p?.view.currentPackage()!==D){T();return}let k=g-Date.now();if(k<=0){T(new w("timedOut",`Image resources did not settle within ${s}ms`));return}C=setTimeout(K,Math.min(Ur,k));};if(c.add(M),x.signal.addEventListener("abort",W,{once:true}),d!==R||p?.view.packageRevision()!==F||p?.view.currentPackage()!==D){T();return}K();})),$=async(R,F=0,D=Date.now()+s)=>{if(z(),Date.now()>=D)throw new w("timedOut",`Export layout did not stabilize within ${s}ms`);let g=p,U=D,I=g.view.packageRevision(),L=g.view.currentPackage(),C=g.completed.get(R);if(C&&C.revision===I&&C.pkg===L)return C.published;let T=()=>{if(g.view.packageRevision()===I&&g.view.currentPackage()===L)return null;if(F>=Pe-1)throw new w("nonConvergent","Document revision did not stabilize during export layout");return $(R,F+1,U)},M=g.fieldLinks.get(R);if(!M||M.revision!==I||M.pkg!==L){let O=M?.registry??chunkJROG4U3Z_cjs.ce();O.clear(),M={revision:I,pkg:L,registry:O},g.fieldLinks.set(R,M),g.furniture.delete(R);}let W=M.registry,K=g.sessions.get(R)??chunkJROG4U3Z_cjs.Fe();g.sessions.set(R,K);let k=g.furniture.get(R);k||(k=chunkJROG4U3Z_cjs._d({view:g.view,measurer:g.measurer,producer:f,cache:g.paragraphCache,styleCascade:g.styles.styleCascade,numberingIndex:g.styles.numberingIndex,defaultTabStopPt:g.styles.defaultTabStopPt,compatibilityMode:g.styles.compatibilityMode,displayMode:R,revisionAuthorFilter:void 0,inlineDrawingLayoutForPart:O=>g.drawingBundle.contextForPart(O),drawingLayoutTokenForPart:O=>g.drawingBundle.cacheTokenForPart(O),drawingTokenForParagraphForPart:(O,ye)=>g.drawingBundle.drawingTokenForParagraph(ye,O),linkProjectors:g.links,projectFieldLink:O=>W.project(O)}),g.furniture.set(R,k));for(let O=0;O<Pe;O+=1){let ye=d;g.drawingBundle.sync(g.view);let He=T();if(He)return He;let _=chunkG5GLQ4SX_cjs.l({view:g.view,revision:g.view.packageRevision(),measurer:g.measurer,cache:g.paragraphCache,session:K,producer:f,styleCascade:g.styles.styleCascade,defaultTabStopPt:g.styles.defaultTabStopPt,numberingIndex:g.styles.numberingIndex,furniture:k,compatibilityMode:g.styles.compatibilityMode,linkProjectors:g.links,projectFieldLink:v=>W.project(v),inlineDrawingLayout:g.drawingBundle.bodyContext,inlineDrawingLayoutForPart:v=>g.drawingBundle.contextForPart(v),drawingTokenForParagraph:v=>g.drawingBundle.drawingTokenForParagraph(v,g.view.part().name),drawingTokenForParagraphForPart:(v,re)=>g.drawingBundle.drawingTokenForParagraph(re,v),drawingLayoutEpoch:g.drawingBundle.cacheTokenForPart(g.view.part().name),drawingLayoutEpochForPart:v=>g.drawingBundle.cacheTokenForPart(v),displayMode:R,revisionAuthorFilter:void 0});if(!Hr(_)){let v=T();if(v)return v;i||(chunkJROG4U3Z_cjs.ob(_),chunkJROG4U3Z_cjs.he(_),g.paragraphCache.clear(),g.sessions.delete(R),g.furniture.delete(R));let re=An(_,L),nr=re.length===0?Nr:Object.freeze(Fn(_,re)),rr=gn(g.view,_),or={..._,...rr,contentWarnings:yn(g.view),reviewArtifacts:nr},Ge=Ln(or);return g.completed.set(R,{revision:I,pkg:L,internal:_,published:Ge}),Ge}let qe=ye;for(;g.drawingBundle.pendingResourceCount()>0;){await ne(qe,I,L,U),qe=d,z();let v=T();if(v)return v}z();let $e=T();if($e)return $e}throw new w("nonConvergent",`Image resources did not reach quiescence after ${Pe} layout passes`)},G=R=>{let F;try{F=Tn(R);}catch(I){return Promise.reject(I)}if(!p)return Promise.reject(E());let D=p,g=D.inFlight.get(F);if(g)return g;let U=$(F).catch(I=>{throw jr(I)}).finally(()=>D.inFlight.delete(F));return D.inFlight.set(F,U),U};return {ok:true,session:{layout:()=>G(n),layoutFor:G,validatedImageBytes(R){let F=p;return !F||R.resource.kind!=="ready"?null:F.drawingBundle.mintValidatedBytes(R.resource.validatedHandle,R.resource.contentId)?.slice()??null},dispose:q}}}var Ae=chunkJROG4U3Z_cjs.b;function De(e){return typeof e.admittedFontFace=="function"}var qr=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function pe(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}function Le(e){let t=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:pe(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:t?Object.freeze({requested:pe(t.requested),resolved:pe(t.resolved),...t.lineMetrics?{lineMetrics:Object.freeze({...t.lineMetrics})}:{}}):null})}function $r(e){return Object.freeze({...Le(e),bytes:chunkJROG4U3Z_cjs.h(e)})}function Gr(e,t){if(!e)return null;try{let n=e(t);return !n||n instanceof chunkJROG4U3Z_cjs.d?null:$r(n)}catch{return null}}function kn(e){return t=>{if(e.status()!=="active")throw e.unavailable();return Gr(e.resolve(),t)}}function Wr(e){return Object.freeze(e.slice(0,Ae).map(t=>Object.freeze({request:pe(t.request),partName:t.partName,reason:t.reason})))}function Te(e,t,n,r,o=[]){let a=new Map;for(let s of [...e,t]){let u=s.toLowerCase();a.has(u)||a.set(u,s);}let i=[...a.values()].map(s=>{let u=[];for(let f of qr){let l=r?.({family:s,...f});!l||l instanceof chunkJROG4U3Z_cjs.d||u.push(Object.freeze({...f,sourceFamily:l.family,via:l.substitution?"substitution":"direct",identity:l.identity,id:l.id,hash:l.hash,faceIndex:l.faceIndex,substitution:l.substitution}));}return Object.freeze({family:s,coverage:u.length===4?"complete":u.length>0?"partial":"none",faces:Object.freeze(u)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:t,families:Object.freeze(i),originFailures:Object.freeze([...n]),droppedEmbeddedFonts:Wr(o)})}function Me(e,t){if(t.onFontResolution){try{let n=t.onFontResolution(e);Promise.resolve(n).catch(r=>{console.warn("[fonts] font-resolution diagnostics callback failed",r);});}catch(n){console.warn("[fonts] font-resolution diagnostics callback failed",n);}return}for(let n of e.originFailures)console.warn("[fonts] a document export font origin failed and was skipped",n);for(let n of e.droppedEmbeddedFonts??[])console.warn("[fonts] a document embedded font face was dropped during export",n);}function ke(e,t){if(t.fontPolicy!=="strict"||e.originFailures.length===0&&e.families.every(r=>r.coverage==="complete"))return;let n=e.families.filter(r=>r.coverage!=="complete").map(r=>r.family).join(", ");throw new w("layoutFailed",`Strict font policy refused export${n?`; incomplete families: ${n}`:"; a font origin failed"}`)}function fe(){return new Map}function Ne(e,t,n,r){if(n.trim().length===0)return null;let o={family:n,weight:r.bold?700:400,style:r.italic?"italic":"normal"},a=chunkJROG4U3Z_cjs.g(o),i=t.get(a);if(!i){try{i=e.fonts.resolve(o);}catch{return null}t.set(a,i);}return i instanceof chunkJROG4U3Z_cjs.d?null:i}function Nn(e,t,n){let r=n.fontFamily??e.defaultFont.family;return Ne(e,t,r,n)}function Be(e){return typeof e.shapeLaidOutText=="function"}function Ce(e){let t=fe(),n=new WeakMap;return r=>{let o=chunkJROG4U3Z_cjs.ga(r.style,r.fontSlot),a=chunkJROG4U3Z_cjs.S(r.text,o);if(a.length===0)return null;let i=o.fontFamily??e.defaultFont.family,s=Ne(e,t,i,o);if(!s)return null;try{if(o.smallCaps&&!chunkJROG4U3Z_cjs.Ue(e.shaper,e.environment,s,o,n))return null;let u=chunkJROG4U3Z_cjs.Te(e.shaper,e.environment,s,o,a);return Object.freeze({run:u,font:Le(s),fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function Bn(e){return t=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(t)??null}}var ee=new Map,me=new WeakMap,_e=0,te,je=32,Cn=chunkJROG4U3Z_cjs.c;function _n(){if(te)return te;let e=(async()=>(await chunkJROG4U3Z_cjs.s(),chunkJROG4U3Z_cjs.x(chunkJROG4U3Z_cjs.A)))();return te=e,e.catch(()=>{te===e&&(te=void 0);}),e}function jn(e){let t=fe();return chunkJROG4U3Z_cjs.We(e,{resolveFont(n){return Nn(e,t,n)},fallback:chunkJROG4U3Z_cjs.z()})}async function zn(e,t){if(!chunkJROG4U3Z_cjs.C(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let n=await _n(),r=await chunkJROG4U3Z_cjs.J(e,n,chunkJROG4U3Z_cjs.A,t);return Object.freeze({createMeasurer:()=>jn(r),resolveFont:o=>r.fonts.resolve(o),shapeLaidOutText:Ce(r),producer:["node-export-session",e.fingerprint,r.operation.shapingHash,`producer:${r.operation.producerVersion}`,`fallback:${chunkJROG4U3Z_cjs.y}`].join("|"),extensionFingerprint:e.fingerprint})}function Kr(e,t){if(!chunkJROG4U3Z_cjs.C(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let n=me.get(e);if(n)return n;let r=chunkJROG4U3Z_cjs.E(e),o=ee.get(r);if(!o){if(ee.size>=je)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${je} process-wide configurations`));o=(async()=>{let u=chunkJROG4U3Z_cjs.D(e).sources.reduce((l,d)=>l+(d.availability==="forbidden"?0:d.bytes.byteLength),0);if(_e+u>Cn)throw new RangeError(`Shared exporter shaping font bytes are limited to ${Cn} process-wide`);_e+=u;let f;try{let l=await _n();f=await chunkJROG4U3Z_cjs.J(e,l,chunkJROG4U3Z_cjs.A,t);}catch(l){throw _e-=u,l}return Object.freeze({createMeasurer:()=>jn(f),shapeLaidOutText:Ce(f),shapingHash:f.operation.shapingHash,producerVersion:f.operation.producerVersion})})(),ee.set(r,o),o.catch(()=>{ee.get(r)===o&&ee.delete(r);});}let a=e.fingerprint,i=o.then(s=>Object.freeze({createMeasurer:s.createMeasurer,shapeLaidOutText:s.shapeLaidOutText,producer:["node-export",a,s.shapingHash,`producer:${s.producerVersion}`,`fallback:${chunkJROG4U3Z_cjs.y}`].join("|"),extensionFingerprint:a}));return me.set(e,i),i.catch(()=>{me.get(e)===i&&me.delete(e);}),i}var Xr="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function Yr(e){let t=e.currentPackage(),n=(t.relationships.get(t.mainDocumentPart)??[]).find(o=>o.type===Xr),r;if(n){let o=chunkZFBNCHRP_cjs.E(n);o.mode==="Internal"&&o.target.ok&&(r=t.parts.get(o.target.partName));}return r??=t.parts.get("/word/fontTable.xml"),chunkZFBNCHRP_cjs.Rd(t,r)}function Un(e,t){let n=Yr(e);if(n.length!==0)return chunkG5GLQ4SX_cjs.h(r=>{let o=new Set((r.resolvedFaces??[]).map(i=>chunkJROG4U3Z_cjs.g(i))),a=chunkG5GLQ4SX_cjs.o(n,{maxFontBytes:chunkJROG4U3Z_cjs.a,aggregateBudget:Qr(r),shadowedRequests:o});if(t)for(let i of a.dropped){if(t.dropped.length>=Ae)break;t.dropped.push(i);}return {sources:a.sources}})}function Qr(e){let t=e.committedSourceBytes;return t===void 0||!Number.isSafeInteger(t)||t<=0?chunkJROG4U3Z_cjs.c:Math.max(0,chunkJROG4U3Z_cjs.c-t)}function Zr(e){return De(e)&&Be(e)}var N=0,Vn=Symbol("font-resolution-timeout");function Jr(e){let t=0,n=false;return e?.(N),{reserve:o=>{if(n)throw new Error("Document font-byte lease is already released");if(N+o>chunkJROG4U3Z_cjs.c)throw new w("layoutFailed",`Active document export font bytes are limited to ${chunkJROG4U3Z_cjs.c}; requested ${o} bytes with ${N} bytes already active`);N+=o,t+=o,e?.(N);let a=false;return ()=>{a||n||(a=true,N-=o,t-=o,e?.(N));}},release:()=>{n||(n=true,N-=t,t=0,e?.(N));}}}function Ue(e,t){return e.attributes.find(n=>n.localName===t)?.value}function eo(e,t){return e.attributes.find(n=>n.localName===t&&(n.namespaceUri===chunkZFBNCHRP_cjs.da||n.namespaceUri===""))?.value}async function to(e,t){if(t.reuseAcrossRevisions===true)throw new TypeError("reuseAcrossRevisions requires a live view or caller-supplied measurer; document-aware byte sessions are immutable");if(t.signal?.aborted)return {ok:false,reason:"aborted"};let n=chunkNPZX5O23_cjs.I(e);if(!n.ok)return n;let{fonts:r,fontResolutionTimeoutMs:o,fontPolicy:a,onFontResolution:i,...s}=t,u=Array.isArray(r)?r:[r],f,l;try{l=await no(n.view,u,{signal:t.signal,timeoutMs:o??t.resourceTimeoutMs,fontPolicy:a,onFontResolution:b=>(f=b,i?.(b))});}catch(b){if(b instanceof w&&b.code==="aborted")return {ok:false,reason:"aborted"};throw b}if(!f)throw l?.dispose(),new w("layoutFailed","Document font resolution completed without publishing its evidence");let d;try{d=Ie(n.view,{...s,reuseAcrossRevisions:!1,...l?{measurer:l.createMeasurer(),producer:t.producer??l.producer}:t.producer?{producer:t.producer}:{}});}catch(b){throw l?.dispose(),b}if(!d.ok)return l?.dispose(),d;let c=d.session,m=l,y="active",p=()=>y==="aborted"?new w("aborted","Export resource settlement was aborted"):new w("disposed","Export session has been disposed"),x=b=>{if(y==="active"){y=b,t.signal?.removeEventListener("abort",h);try{c.dispose();}finally{m?.dispose(),m=void 0;}}},h=()=>x("aborted");return t.signal?.addEventListener("abort",h,{once:true}),t.signal?.aborted&&h(),{ok:true,session:Object.freeze({fontResolution:f,layout:()=>y==="active"?c.layout():Promise.reject(p()),layoutFor:b=>y==="active"?c.layoutFor(b):Promise.reject(p()),validatedImageBytes:b=>y==="active"?c.validatedImageBytes(b):null,admittedFontFace:kn({status:()=>y,unavailable:p,resolve:()=>m?.resolveFont}),shapeLaidOutText:Bn({status:()=>y,unavailable:p,shaping:()=>m}),dispose:()=>x("disposed")})}}async function no(e,t,n={}){let r=ro(n.timeoutMs),o=new AbortController,a=()=>o.abort(n.signal?.reason);n.signal?.addEventListener("abort",a,{once:true}),n.signal?.aborted&&a();let i=setTimeout(()=>o.abort(Vn),r);try{ze(o.signal);let s=(async()=>{let u=Jr(n.onActiveFontBytesChange),f=!1;try{let l=ao(e).slice(0,chunkG5GLQ4SX_cjs.b),d=[],c={dropped:[]},m=Un(e,c),y=m?[...t,m]:t,p=await chunkG5GLQ4SX_cjs.k(y,{families:l,defaultFamily:chunkG5GLQ4SX_cjs.c.family,signal:o.signal},{onOriginFailure:E=>d.push(E),reserveOwnedBytes:u.reserve});ze(o.signal);let x=chunkG5GLQ4SX_cjs.d(p??{});if(x.sources.length===0){let E=Te(l,x.defaultFont.family,d,void 0,c.dropped);Me(E,n),ke(E,n);return}let h=await zn(chunkJROG4U3Z_cjs.G(x));ze(o.signal);let b=Te(l,x.defaultFont.family,d,h.resolveFont,c.dropped);return Me(b,n),ke(b,n),f=!0,Object.freeze({...h,dispose:u.release})}finally{f||u.release();}})();return await Promise.race([s,oo(o.signal)])}finally{clearTimeout(i),n.signal?.removeEventListener("abort",a);}}function ro(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("timeoutMs must be a positive finite number");return Math.max(1,e)}function oo(e){return new Promise((t,n)=>{let r=()=>{n(Hn(e));};e.aborted?r():e.addEventListener("abort",r,{once:true});})}function Hn(e){let t=e.reason===Vn;return new w(t?"timedOut":"aborted",t?"Font resolution timed out":"Font resolution was aborted",t?void 0:{cause:e.reason})}function ze(e){if(e.aborted)throw Hn(e)}function ao(e){let t=[e.part().root],n=[],r=[],o=new Set([e.part().name]),a=(l,d)=>{!d||o.has(d.name)||(o.add(d.name),l.push(d.root));};for(let l of e.headerFooterPartsBySection()){for(let d of l.headers.values())a(n,d);for(let d of l.footers.values())a(n,d);}for(let l of ["footnote","endnote"])r.push(...io(e,l));let i=e.documentThemeFonts(),s={major:i.major,minor:i.minor,majorEastAsia:i.majorEastAsia??null,minorEastAsia:i.minorEastAsia??null},u=new Map,f=(l,d)=>{let c=chunkPRNYSOQL_cjs.d(l,e.stylesRoot(),s,co(l,d)),m=chunkG5GLQ4SX_cjs.r(l,e.numberingRoot(),e.stylesRoot(),s);for(let y of [...c.direct,...po(l),...m,...c.inherited]){let p=y.toLowerCase();u.has(p)||u.set(p,y);}};return f(t,"body"),f(n,"furniture"),f(r,"note"),[...u.values()]}function io(e,t){let n=chunkZFBNCHRP_cjs.Jf(e.currentPackage(),t);if(!n)return [];let r=new Set(chunkZFBNCHRP_cjs.Kf(e.part()).filter(a=>a.noteKind===t).map(a=>a.noteId)),o=[];for(let a of n.root.children){if(a.kind==="textValue")continue;let i=chunkZFBNCHRP_cjs.hd(a),s=chunkZFBNCHRP_cjs.gd(a);(i==="separator"||i==="continuationSeparator"||s!==null&&r.has(s))&&o.push(a);}return o}var so="http://schemas.openxmlformats.org/officeDocument/2006/math";function co(e,t){let n=new Set;for(let r of e){let o=[],a=[{node:r,context:t}];for(;a.length>0;){let{node:i,context:s}=a.pop();i.namespaceUri===chunkZFBNCHRP_cjs.da&&i.localName==="p"&&o.push({paragraph:i,context:s});let u=i.namespaceUri===chunkZFBNCHRP_cjs.da&&i.localName==="txbxContent"&&(s==="body"||s==="note")?"detached":s;for(let f=i.children.length-1;f>=0;f-=1){let l=i.children[f];l.kind!=="textValue"&&a.push({node:l,context:u});}}for(let i of o)lo(i.paragraph,n,i.context);}return n}function lo(e,t,n){let r=chunkJROG4U3Z_cjs.Wa(),o=null,a=null,i="",s=false,u=false,f=false,l=0,d=[];for(let c=e.children.length-1;c>=0;c-=1){let m=e.children[c];m.kind!=="textValue"&&d.push({node:m,runId:null,visibility:H,containerDepth:0});}for(;d.length>0;){let{node:c,runId:m,visibility:y,containerDepth:p}=d.pop();if(p>=chunkZFBNCHRP_cjs.la||c.namespaceUri===chunkZFBNCHRP_cjs.da&&c.localName==="p")continue;let x=c.namespaceUri===chunkZFBNCHRP_cjs.da&&c.localName==="r"?c.id:m;if(c.namespaceUri===chunkZFBNCHRP_cjs.da&&c.localName==="fldSimple"){let h=Ue(c,"instr")??"";chunkJROG4U3Z_cjs.ed(h,{allowPageFields:n==="body"||n==="furniture",allowRefFields:n==="body"||n==="note",allowPageRef:n==="body",allowAutonum:n==="body"||n==="note"})&&uo(c)!==H&&t.add(c.id);}if(c.namespaceUri===chunkZFBNCHRP_cjs.da&&c.localName==="fldChar"){let h=Ue(c,"fldCharType");if(h==="begin")chunkJROG4U3Z_cjs.Za(r),r.nesting===1&&(o=x,a=null,i="",s=false,u=false,f=chunkZFBNCHRP_cjs.je(c),l=0);else if(h==="separate"){let b=r.nesting===1;if(chunkJROG4U3Z_cjs.$a(r),b){let E=chunkJROG4U3Z_cjs.Ya(r);i=E.instruction,s=E.overflow||r.nestingOverflow,a=x,u=true;}}else if(h==="end"){if(r.nesting===1){if(r.phase==="instruction"){let E=chunkJROG4U3Z_cjs.Ya(r);i=E.instruction,s=E.overflow||r.nestingOverflow;}if(!s&&chunkJROG4U3Z_cjs.dd(i,{hasSeparate:u,hasLegacyFormData:f,allowPageFields:n==="body"||n==="furniture",allowRefFields:n==="body"||n==="note",allowPageRef:n==="body",allowAutonum:n==="body"||n==="note"})&&l!==H){let E=a??o;E&&t.add(E);}}chunkJROG4U3Z_cjs.ab(r);}continue}if(c.namespaceUri===chunkZFBNCHRP_cjs.da&&(c.localName==="instrText"||c.localName==="delInstrText")){chunkJROG4U3Z_cjs._a(r,Kn(c),c.localName==="delInstrText");continue}r.nesting>0&&chunkJROG4U3Z_cjs.bb(r)&&c.namespaceUri===chunkZFBNCHRP_cjs.da&&qn(c)&&(l|=y);for(let h=c.children.length-1;h>=0;h-=1){let b=c.children[h];b.kind!=="textValue"&&d.push({node:b,runId:x,visibility:y&Wn(c),containerDepth:chunkZFBNCHRP_cjs.ma(c,p)});}}chunkJROG4U3Z_cjs.Xa(r);}function qn(e){return e.localName==="t"||e.localName==="delText"?Kn(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var Ve=1,$n=2,Gn=4,H=Ve|$n|Gn;function uo(e){let t=[];for(let r of e.children)r.kind!=="textValue"&&t.push({node:r,visibility:H});let n=0;for(;t.length>0;){let{node:r,visibility:o}=t.pop();if(!(r.namespaceUri===chunkZFBNCHRP_cjs.da&&r.localName==="p")){if(r.namespaceUri===chunkZFBNCHRP_cjs.da&&qn(r)&&(n|=o,n===H))return n;for(let a of r.children)a.kind!=="textValue"&&t.push({node:a,visibility:o&Wn(r)});}}return n}function Wn(e){return e.namespaceUri!==chunkZFBNCHRP_cjs.da?H:e.localName==="ins"||e.localName==="moveTo"?Ve|$n:e.localName==="del"||e.localName==="moveFrom"?Ve|Gn:H}function po(e){let t=new Map,n=r=>{let o=chunkPRNYSOQL_cjs.a(r??void 0);if(o===null)return;let a=o.toLowerCase();t.has(a)||t.set(a,o);};for(let r of e){let o=[r];for(;o.length>0;){let a=o.pop();if(a.namespaceUri===so&&n(chunkJROG4U3Z_cjs.vc),a.namespaceUri===chunkZFBNCHRP_cjs.da&&a.localName==="sym"&&n(chunkPRNYSOQL_cjs.b(eo(a,"font"))),a.namespaceUri===chunkZFBNCHRP_cjs.da&&a.localName==="fldSimple"){let i=Ue(a,"instr");n(chunkJROG4U3Z_cjs.cd(i??"")?.font??null);}if(a.namespaceUri===chunkZFBNCHRP_cjs.da&&a.localName==="p")for(let i of chunkG5GLQ4SX_cjs.q(a))n(i);for(let i=a.children.length-1;i>=0;i-=1){let s=a.children[i];s.kind!=="textValue"&&o.push(s);}}}return [...t.values()]}function Kn(e){let t="",n=[...e.children].reverse();for(;n.length>0&&t.length<=256;){let r=n.pop();if(r.kind==="textValue")t+=r.value;else for(let o=r.children.length-1;o>=0;o-=1)n.push(r.children[o]);}return t}var Qn="FILE_TOO_LARGE",Xn=8;function fo(e){return typeof e=="object"&&e!==null}function Zn(e){if(!(!fo(e)||typeof e.code!="string"))return e.code}function Jn(e){return e===""||e.toLowerCase()==="localhost"}function mo(e){try{let t=decodeURIComponent(e);return t.includes("\0")?null:t}catch{return null}}function er(e){let t=mo(e);if(t===null)return null;let n=[];for(let r of t.split(/[/\\]/))if(!(r===""||r===".")){if(r===".."){if(n.length===0)return null;n.pop();continue}n.push(r);}return `/${n.join("/")}`}function tr(e){let t=er(e);return t===null?null:t.endsWith("/")?t:`${t}/`}function yo(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function go(e){let t;try{t=typeof e=="string"?new URL(e):new URL("href"in e?e.href:String(e));}catch{throw new TypeError("trustedRoot must be an absolute file: URL")}if(t.protocol!=="file:")throw new TypeError("trustedRoot must use the file: protocol");if(t.username!==""||t.password!=="")throw new TypeError("trustedRoot must not include credentials");if(!Jn(t.host))throw new TypeError("trustedRoot must be a local file: URL");let n=tr(t.pathname);if(n===null||yo(n))throw new TypeError("trustedRoot must be a directory inside the filesystem");let r=new URL("file:///");return r.pathname=n,r}function ho(e){if(typeof e=="string")return [e];if(typeof e=="object"&&e!==null&&"href"in e)return [e];if(Array.isArray(e))return e;throw new TypeError("trustedRoot must be an absolute file: URL")}function xo(e){let t=ho(e);if(t.length===0)throw new TypeError("trustedRoot must name at least one directory");if(t.length>Xn)throw new TypeError(`trustedRoot must not exceed ${Xn} directories`);return t.map(go)}function bo(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>chunkJROG4U3Z_cjs.a)throw new TypeError(`maxBytes must not exceed ${chunkJROG4U3Z_cjs.a}`);return e}function Ro(e,t){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!Jn(e.host))return null;let n=er(e.pathname);if(n===null)return null;for(let r of t){let o=tr(r.pathname);if(o===null||!n.startsWith(o)||n.length<=o.length)continue;let a=new URL("file:///");return a.pathname=n,a}return null}function Eo(e){return typeof e=="string"?new URL(e):"href"in e&&typeof e.href=="string"?new URL(e.href):new URL("url"in e?e.url:String(e))}function wo(e,t,n){let r=n.relative(n.resolve(e),n.resolve(t));return r!==""&&!r.startsWith("..")&&!n.isAbsolute(r)}function Yn(e,t,n){return e.some(r=>wo(r,t,n))}async function Fo(e,t){let n=[];for(let r of e)try{n.push(await t(r));}catch(o){if(Zn(o)==="ENOENT")continue;throw o}return n}function So(e){return async(t,{signal:n,maxBytes:r})=>{if(n?.aborted)throw n.reason;let[{open:o,realpath:a},{constants:i},{fileURLToPath:s},u]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),f=e.map(y=>u.resolve(s(y.href))),l=u.resolve(s(typeof t=="string"?t:t.href));if(!Yn(f,l,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let d=typeof i.O_NOFOLLOW=="number"?i.O_RDONLY|i.O_NOFOLLOW:"r",c=await o(l,d),m=()=>{c.close();};n?.addEventListener("abort",m,{once:true});try{if(n?.aborted)throw n.reason;let y=await a(l);if(!Yn(await Fo(f,a),y,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let p=(await c.stat()).size;if(!Number.isSafeInteger(p)||p<0||p>r)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:Qn});let x=new Uint8Array(p),h=0;for(;h<x.byteLength;){if(n?.aborted)throw n.reason;let{bytesRead:b}=await c.read(x,h,x.byteLength-h,h);if(b===0)break;h+=b;}if(n?.aborted)throw n.reason;return h===x.byteLength?x:x.slice(0,h)}catch(y){throw n?.aborted?n.reason:y}finally{n?.removeEventListener("abort",m),await c.close().catch(()=>{});}}}function vo(e){if(e===null||typeof e!="object")throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");if(e.trustedRoot===void 0||e.maxBytes===void 0)throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");let t=xo(e.trustedRoot),n=bo(e.maxBytes),r=e.read??So(t),o=e.networkFetch??fetch;return(async(a,i)=>{let s=i?.signal;if(s?.aborted)throw s.reason;let u=Eo(a);if(u.protocol!=="file:")return o(u,i);let f=Ro(u,t);if(!f)return new Response(null,{status:404});let l=s?new AbortController:void 0,d=()=>l?.abort(s?.reason);s?.addEventListener("abort",d,{once:true});let c;try{if(c=await r(f,{maxBytes:n,...l?{signal:l.signal}:{}}),s?.aborted)throw s.reason;if(c.byteLength>n)return new Response(null,{status:413})}catch(m){if(s?.aborted)throw s.reason;if(l?.signal.aborted)throw l.signal.reason??m;if(m instanceof DOMException&&m.name==="AbortError"||m instanceof Error&&m.name==="AbortError")throw m;let y=Zn(m);if(y===Qn)return new Response(null,{status:413});if(y==="ENOENT"||y==="ENOTDIR"||y==="ELOOP")return new Response(null,{status:404});throw m}finally{s?.removeEventListener("abort",d);}return new Response(c,{status:200})})}
2
- exports.ExportResourceError=w;exports.MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS=je;exports.acquireSharedExportShaping=Kr;exports.createNodeImageDecodePort=Oe;exports.createPackagedFileFetch=vo;exports.exportDestinationNamed=fr;exports.hasExportAdmittedFont=De;exports.hasExportLaidOutText=Be;exports.hasFontBackedExportCapabilities=Zr;exports.openDocumentForExport=Ie;exports.openFontBackedDocumentForExport=to;
1
+ 'use strict';var chunkKDYD5TAW_cjs=require('./chunk-KDYD5TAW.cjs'),chunkNJONXJJY_cjs=require('./chunk-NJONXJJY.cjs'),chunkZKQX2PNF_cjs=require('./chunk-ZKQX2PNF.cjs'),chunkLQ6XWTKQ_cjs=require('./chunk-LQ6XWTKQ.cjs'),chunkCG7CP632_cjs=require('./chunk-CG7CP632.cjs');require('./chunk-FGBADUSK.cjs');var chunkMDP5SNK4_cjs=require('./chunk-MDP5SNK4.cjs'),chunk77DD4EBC_cjs=require('./chunk-77DD4EBC.cjs');var B=chunkNJONXJJY_cjs.b;function q(e){return typeof e.admittedFontFace=="function"}var yt=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function P(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}function j(e){let o=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:P(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:o?Object.freeze({requested:P(o.requested),resolved:P(o.resolved),...o.lineMetrics?{lineMetrics:Object.freeze({...o.lineMetrics})}:{}}):null})}function ht(e){return Object.freeze({...j(e),bytes:chunkNJONXJJY_cjs.h(e)})}function Ft(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof chunkNJONXJJY_cjs.d?null:ht(t)}catch{return null}}function Ge(e){return o=>{if(e.status()!=="active")throw e.unavailable();return Ft(e.resolve(),o)}}function xt(e){return Object.freeze(e.slice(0,B).map(o=>Object.freeze({request:P(o.request),partName:o.partName,reason:o.reason})))}function z(e,o,t,n,r=[]){let i=new Map;for(let l of [...e,o]){let u=l.toLowerCase();i.has(u)||i.set(u,l);}let a=[...i.values()].map(l=>{let u=[];for(let c of yt){let s=n?.({family:l,...c});!s||s instanceof chunkNJONXJJY_cjs.d||u.push(Object.freeze({...c,sourceFamily:s.family,via:s.substitution?"substitution":"direct",identity:s.identity,id:s.id,hash:s.hash,faceIndex:s.faceIndex,substitution:s.substitution}));}return Object.freeze({family:l,coverage:u.length===4?"complete":u.length>0?"partial":"none",faces:Object.freeze(u)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(a),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:xt(r)})}function V(e,o){if(o.onFontResolution){try{let t=o.onFontResolution(e);Promise.resolve(t).catch(n=>{console.warn("[fonts] font-resolution diagnostics callback failed",n);});}catch(t){console.warn("[fonts] font-resolution diagnostics callback failed",t);}return}for(let t of e.originFailures)console.warn("[fonts] a document export font origin failed and was skipped",t);for(let t of e.droppedEmbeddedFonts??[])console.warn("[fonts] a document embedded font face was dropped during export",t);}function H(e,o){if(o.fontPolicy!=="strict"||e.originFailures.length===0&&e.families.every(n=>n.coverage==="complete"))return;let t=e.families.filter(n=>n.coverage!=="complete").map(n=>n.family).join(", ");throw new chunkZKQX2PNF_cjs.d("layoutFailed",`Strict font policy refused export${t?`; incomplete families: ${t}`:"; a font origin failed"}`)}function N(){return new Map}function G(e,o,t,n){if(t.trim().length===0)return null;let r={family:t,weight:n.bold?700:400,style:n.italic?"italic":"normal"},i=chunkNJONXJJY_cjs.g(r),a=o.get(i);if(!a){try{a=e.fonts.resolve(r);}catch{return null}o.set(i,a);}return a instanceof chunkNJONXJJY_cjs.d?null:a}function Xe(e,o,t){let n=t.fontFamily??e.defaultFont.family;return G(e,o,n,t)}function X(e){return typeof e.shapeLaidOutText=="function"}function W(e){let o=N(),t=new WeakMap;return n=>{let r=chunkLQ6XWTKQ_cjs.z(n.style,n.fontSlot),i=chunkLQ6XWTKQ_cjs.j(n.text,r);if(i.length===0)return null;let a=r.fontFamily??e.defaultFont.family,l=G(e,o,a,r);if(!l)return null;try{if(r.smallCaps&&!chunkNJONXJJY_cjs.na(e.shaper,e.environment,l,r,t))return null;let u=chunkNJONXJJY_cjs.ma(e.shaper,e.environment,l,r,i);return Object.freeze({run:u,font:j(l),fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function We(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var A=new Map,I=new WeakMap,$=0,T,Y=32,$e=chunkNJONXJJY_cjs.c;function Ye(){if(T)return T;let e=(async()=>(await chunkNJONXJJY_cjs.s(),chunkNJONXJJY_cjs.x(chunkNJONXJJY_cjs.y)))();return T=e,e.catch(()=>{T===e&&(T=void 0);}),e}function Ke(e){let o=N();return chunkNJONXJJY_cjs.pa(e,{resolveFont(t){return Xe(e,o,t)},fallback:chunkLQ6XWTKQ_cjs.b()})}async function Ze(e,o){if(!chunkNJONXJJY_cjs.A(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let t=await Ye(),n=await chunkNJONXJJY_cjs.H(e,t,chunkNJONXJJY_cjs.y,o);return Object.freeze({createMeasurer:()=>Ke(n),resolveFont:r=>n.fonts.resolve(r),shapeLaidOutText:W(n),producer:["node-export-session",e.fingerprint,n.operation.shapingHash,`producer:${n.operation.producerVersion}`,`fallback:${chunkLQ6XWTKQ_cjs.a}`].join("|"),extensionFingerprint:e.fingerprint})}function gt(e,o){if(!chunkNJONXJJY_cjs.A(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let t=I.get(e);if(t)return t;let n=chunkNJONXJJY_cjs.C(e),r=A.get(n);if(!r){if(A.size>=Y)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${Y} process-wide configurations`));r=(async()=>{let u=chunkNJONXJJY_cjs.B(e).sources.reduce((s,p)=>s+(p.availability==="forbidden"?0:p.bytes.byteLength),0);if($+u>$e)throw new RangeError(`Shared exporter shaping font bytes are limited to ${$e} process-wide`);$+=u;let c;try{let s=await Ye();c=await chunkNJONXJJY_cjs.H(e,s,chunkNJONXJJY_cjs.y,o);}catch(s){throw $-=u,s}return Object.freeze({createMeasurer:()=>Ke(c),shapeLaidOutText:W(c),shapingHash:c.operation.shapingHash,producerVersion:c.operation.producerVersion})})(),A.set(n,r),r.catch(()=>{A.get(n)===r&&A.delete(n);});}let i=e.fingerprint,a=r.then(l=>Object.freeze({createMeasurer:l.createMeasurer,shapeLaidOutText:l.shapeLaidOutText,producer:["node-export",i,l.shapingHash,`producer:${l.producerVersion}`,`fallback:${chunkLQ6XWTKQ_cjs.a}`].join("|"),extensionFingerprint:i}));return I.set(e,a),a.catch(()=>{I.get(e)===a&&I.delete(e);}),a}var Et="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function bt(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(r=>r.type===Et),n;if(t){let r=chunk77DD4EBC_cjs.E(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),chunk77DD4EBC_cjs.Sd(o,n)}function Qe(e,o){let t=bt(e);if(t.length!==0)return chunkKDYD5TAW_cjs.i(n=>{let r=new Set((n.resolvedFaces??[]).map(a=>chunkNJONXJJY_cjs.g(a))),i=chunkKDYD5TAW_cjs.o(t,{maxFontBytes:chunkNJONXJJY_cjs.a,aggregateBudget:Rt(n),shadowedRequests:r});if(o)for(let a of i.dropped){if(o.dropped.length>=B)break;o.dropped.push(a);}return {sources:i.sources}})}function Rt(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?chunkNJONXJJY_cjs.c:Math.max(0,chunkNJONXJJY_cjs.c-o)}function Ot(e){return q(e)&&X(e)}var R=0,Je=Symbol("font-resolution-timeout");function St(e){let o=0,t=false;return e?.(R),{reserve:r=>{if(t)throw new Error("Document font-byte lease is already released");if(R+r>chunkNJONXJJY_cjs.c)throw new chunkZKQX2PNF_cjs.d("layoutFailed",`Active document export font bytes are limited to ${chunkNJONXJJY_cjs.c}; requested ${r} bytes with ${R} bytes already active`);R+=r,o+=r,e?.(R);let i=false;return ()=>{i||t||(i=true,R-=r,o-=r,e?.(R));}},release:()=>{t||(t=true,R-=o,o=0,e?.(R));}}}function Z(e,o){return e.attributes.find(t=>t.localName===o)?.value}function wt(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===chunk77DD4EBC_cjs.da||t.namespaceUri===""))?.value}async function vt(e,o){if(o.reuseAcrossRevisions===true)throw new TypeError("reuseAcrossRevisions requires a live view or caller-supplied measurer; document-aware byte sessions are immutable");if(o.signal?.aborted)return {ok:false,reason:"aborted"};let t=chunkMDP5SNK4_cjs.Za(e);if(!t.ok)return t;let{fonts:n,fontResolutionTimeoutMs:r,fontPolicy:i,onFontResolution:a,...l}=o,u=Array.isArray(n)?n:[n],c,s;try{s=await At(t.view,u,{signal:o.signal,timeoutMs:r??o.resourceTimeoutMs,fontPolicy:i,onFontResolution:y=>(c=y,a?.(y))});}catch(y){if(y instanceof chunkZKQX2PNF_cjs.d&&y.code==="aborted")return {ok:false,reason:"aborted"};throw y}if(!c)throw s?.dispose(),new chunkZKQX2PNF_cjs.d("layoutFailed","Document font resolution completed without publishing its evidence");let p;try{p=chunkZKQX2PNF_cjs.e(t.view,{...l,reuseAcrossRevisions:!1,...s?{measurer:s.createMeasurer(),producer:o.producer??s.producer}:o.producer?{producer:o.producer}:{}});}catch(y){throw s?.dispose(),y}if(!p.ok)return s?.dispose(),p;let d=p.session,m=s,f="active",x=()=>f==="aborted"?new chunkZKQX2PNF_cjs.d("aborted","Export resource settlement was aborted"):new chunkZKQX2PNF_cjs.d("disposed","Export session has been disposed"),F=y=>{if(f==="active"){f=y,o.signal?.removeEventListener("abort",h);try{d.dispose();}finally{m?.dispose(),m=void 0;}}},h=()=>F("aborted");return o.signal?.addEventListener("abort",h,{once:true}),o.signal?.aborted&&h(),{ok:true,session:Object.freeze({fontResolution:c,layout:()=>f==="active"?d.layout():Promise.reject(x()),layoutFor:y=>f==="active"?d.layoutFor(y):Promise.reject(x()),validatedImageBytes:y=>f==="active"?d.validatedImageBytes(y):null,admittedFontFace:Ge({status:()=>f,unavailable:x,resolve:()=>m?.resolveFont}),shapeLaidOutText:We({status:()=>f,unavailable:x,shaping:()=>m}),dispose:()=>F("disposed")})}}async function At(e,o,t={}){let n=Tt(t.timeoutMs),r=new AbortController,i=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",i,{once:true}),t.signal?.aborted&&i();let a=setTimeout(()=>r.abort(Je),n);try{K(r.signal);let l=(async()=>{let u=St(t.onActiveFontBytesChange),c=!1;try{let s=Dt(e).slice(0,chunkKDYD5TAW_cjs.c),p=[],d={dropped:[]},m=Qe(e,d),f=m?[...o,m]:o,x=await chunkKDYD5TAW_cjs.l(f,{families:s,defaultFamily:chunkKDYD5TAW_cjs.d.family,signal:r.signal},{onOriginFailure:E=>p.push(E),reserveOwnedBytes:u.reserve});K(r.signal);let F=chunkKDYD5TAW_cjs.e(x??{});if(F.sources.length===0){let E=z(s,F.defaultFont.family,p,void 0,d.dropped);V(E,t),H(E,t);return}let h=await Ze(chunkNJONXJJY_cjs.E(F));K(r.signal);let y=z(s,F.defaultFont.family,p,h.resolveFont,d.dropped);return V(y,t),H(y,t),c=!0,Object.freeze({...h,dispose:u.release})}finally{c||u.release();}})();return await Promise.race([l,Lt(r.signal)])}finally{clearTimeout(a),t.signal?.removeEventListener("abort",i);}}function Tt(e){if(e===void 0)return 6e4;if(!Number.isFinite(e)||e<=0)throw new RangeError("timeoutMs must be a positive finite number");return Math.max(1,e)}function Lt(e){return new Promise((o,t)=>{let n=()=>{t(et(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function et(e){let o=e.reason===Je;return new chunkZKQX2PNF_cjs.d(o?"timedOut":"aborted",o?"Font resolution timed out":"Font resolution was aborted",o?void 0:{cause:e.reason})}function K(e){if(e.aborted)throw et(e)}function Dt(e){let o=[e.part().root],t=[],n=[],r=new Set([e.part().name]),i=(s,p)=>{!p||r.has(p.name)||(r.add(p.name),s.push(p.root));};for(let s of e.headerFooterPartsBySection()){for(let p of s.headers.values())i(t,p);for(let p of s.footers.values())i(t,p);}for(let s of ["footnote","endnote"])n.push(...Pt(e,s));let a=e.documentThemeFonts(),l={...a,major:a.major,minor:a.minor,majorEastAsia:a.majorEastAsia??null,minorEastAsia:a.minorEastAsia??null},u=new Map,c=(s,p)=>{let d=chunkCG7CP632_cjs.d(s,e.stylesRoot(),l,It(s,p)),m=chunkKDYD5TAW_cjs.v(s,e.numberingRoot(),e.stylesRoot(),l);for(let f of [...d.direct,...Ut(s),...m,...chunkKDYD5TAW_cjs.s(s,e.stylesRoot(),l),...d.inherited]){let x=f.toLowerCase();u.has(x)||u.set(x,f);}};return c(o,"body"),c(t,"furniture"),c(n,"note"),[...u.values()]}function Pt(e,o){let t=chunk77DD4EBC_cjs.Nf(e.currentPackage(),o);if(!t)return [];let n=new Set(chunk77DD4EBC_cjs.Of(e.part()).filter(i=>i.noteKind===o).map(i=>i.noteId)),r=[];for(let i of t.root.children){if(i.kind==="textValue")continue;let a=chunk77DD4EBC_cjs.id(i),l=chunk77DD4EBC_cjs.hd(i);(a==="separator"||a==="continuationSeparator"||l!==null&&n.has(l))&&r.push(i);}return r}var Nt="http://schemas.openxmlformats.org/officeDocument/2006/math";function It(e,o){let t=new Set;for(let n of e){let r=[],i=[{node:n,context:o}];for(;i.length>0;){let{node:a,context:l}=i.pop();a.namespaceUri===chunk77DD4EBC_cjs.da&&a.localName==="p"&&r.push({paragraph:a,context:l});let u=a.namespaceUri===chunk77DD4EBC_cjs.da&&a.localName==="txbxContent"&&(l==="body"||l==="note")?"detached":l;for(let c=a.children.length-1;c>=0;c-=1){let s=a.children[c];s.kind!=="textValue"&&i.push({node:s,context:u});}}for(let a of r)_t(a.paragraph,t,a.context);}return t}function _t(e,o,t){let n=chunkLQ6XWTKQ_cjs.X(),r=null,i=null,a="",l=false,u=false,c=false,s=0,p=[];for(let d=e.children.length-1;d>=0;d-=1){let m=e.children[d];m.kind!=="textValue"&&p.push({node:m,runId:null,visibility:S,containerDepth:0});}for(;p.length>0;){let{node:d,runId:m,visibility:f,containerDepth:x}=p.pop();if(x>=chunk77DD4EBC_cjs.la||d.namespaceUri===chunk77DD4EBC_cjs.da&&d.localName==="p")continue;let F=d.namespaceUri===chunk77DD4EBC_cjs.da&&d.localName==="r"?d.id:m;if(d.namespaceUri===chunk77DD4EBC_cjs.da&&d.localName==="fldSimple"){let h=Z(d,"instr")??"";chunkLQ6XWTKQ_cjs.lc(h,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&kt(d)!==S&&o.add(d.id);}if(d.namespaceUri===chunk77DD4EBC_cjs.da&&d.localName==="fldChar"){let h=Z(d,"fldCharType");if(h==="begin")chunkLQ6XWTKQ_cjs._(n),n.nesting===1&&(r=F,i=null,a="",l=false,u=false,c=chunk77DD4EBC_cjs.ke(d),s=0);else if(h==="separate"){let y=n.nesting===1;if(chunkLQ6XWTKQ_cjs.aa(n),y){let E=chunkLQ6XWTKQ_cjs.Z(n);a=E.instruction,l=E.overflow||n.nestingOverflow,i=F,u=true;}}else if(h==="end"){if(n.nesting===1){if(n.phase==="instruction"){let E=chunkLQ6XWTKQ_cjs.Z(n);a=E.instruction,l=E.overflow||n.nestingOverflow;}if(!l&&chunkLQ6XWTKQ_cjs.kc(a,{hasSeparate:u,hasLegacyFormData:c,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&s!==S){let E=i??r;E&&o.add(E);}}chunkLQ6XWTKQ_cjs.ba(n);}continue}if(d.namespaceUri===chunk77DD4EBC_cjs.da&&(d.localName==="instrText"||d.localName==="delInstrText")){chunkLQ6XWTKQ_cjs.$(n,it(d),d.localName==="delInstrText");continue}n.nesting>0&&chunkLQ6XWTKQ_cjs.ca(n)&&d.namespaceUri===chunk77DD4EBC_cjs.da&&tt(d)&&(s|=f);for(let h=d.children.length-1;h>=0;h-=1){let y=d.children[h];y.kind!=="textValue"&&p.push({node:y,runId:F,visibility:f&rt(d),containerDepth:chunk77DD4EBC_cjs.ma(d,x)});}}chunkLQ6XWTKQ_cjs.Y(n);}function tt(e){return e.localName==="t"||e.localName==="delText"?it(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var Q=1,ot=2,nt=4,S=Q|ot|nt;function kt(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:S});let t=0;for(;o.length>0;){let{node:n,visibility:r}=o.pop();if(!(n.namespaceUri===chunk77DD4EBC_cjs.da&&n.localName==="p")){if(n.namespaceUri===chunk77DD4EBC_cjs.da&&tt(n)&&(t|=r,t===S))return t;for(let i of n.children)i.kind!=="textValue"&&o.push({node:i,visibility:r&rt(n)});}}return t}function rt(e){return e.namespaceUri!==chunk77DD4EBC_cjs.da?S:e.localName==="ins"||e.localName==="moveTo"?Q|ot:e.localName==="del"||e.localName==="moveFrom"?Q|nt:S}function Ut(e){let o=new Map,t=n=>{let r=chunkCG7CP632_cjs.a(n??void 0);if(r===null)return;let i=r.toLowerCase();o.has(i)||o.set(i,r);};for(let n of e){let r=[n];for(;r.length>0;){let i=r.pop();if(i.namespaceUri===Nt&&t(chunkLQ6XWTKQ_cjs.Ab),i.namespaceUri===chunk77DD4EBC_cjs.da&&i.localName==="sym"&&t(chunkCG7CP632_cjs.b(wt(i,"font"))),i.namespaceUri===chunk77DD4EBC_cjs.da&&i.localName==="fldSimple"){let a=Z(i,"instr");t(chunkLQ6XWTKQ_cjs.jc(a??"")?.font??null);}if(i.namespaceUri===chunk77DD4EBC_cjs.da&&i.localName==="p")for(let a of chunkKDYD5TAW_cjs.u(i))t(a);for(let a=i.children.length-1;a>=0;a-=1){let l=i.children[a];l.kind!=="textValue"&&r.push(l);}}}return [...o.values()]}function it(e){let o="",t=[...e.children].reverse();for(;t.length>0&&o.length<=256;){let n=t.pop();if(n.kind==="textValue")o+=n.value;else for(let r=n.children.length-1;r>=0;r-=1)t.push(n.children[r]);}return o}var lt="FILE_TOO_LARGE",at=8;function Mt(e){return typeof e=="object"&&e!==null}function dt(e){if(!(!Mt(e)||typeof e.code!="string"))return e.code}function ut(e){return e===""||e.toLowerCase()==="localhost"}function Ct(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function ct(e){let o=Ct(e);if(o===null)return null;let t=[];for(let n of o.split(/[/\\]/))if(!(n===""||n===".")){if(n===".."){if(t.length===0)return null;t.pop();continue}t.push(n);}return `/${t.join("/")}`}function pt(e){let o=ct(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function Bt(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function qt(e){let o;try{o=typeof e=="string"?new URL(e):new URL("href"in e?e.href:String(e));}catch{throw new TypeError("trustedRoot must be an absolute file: URL")}if(o.protocol!=="file:")throw new TypeError("trustedRoot must use the file: protocol");if(o.username!==""||o.password!=="")throw new TypeError("trustedRoot must not include credentials");if(!ut(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=pt(o.pathname);if(t===null||Bt(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function jt(e){if(typeof e=="string")return [e];if(typeof e=="object"&&e!==null&&"href"in e)return [e];if(Array.isArray(e))return e;throw new TypeError("trustedRoot must be an absolute file: URL")}function zt(e){let o=jt(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>at)throw new TypeError(`trustedRoot must not exceed ${at} directories`);return o.map(qt)}function Vt(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>chunkNJONXJJY_cjs.a)throw new TypeError(`maxBytes must not exceed ${chunkNJONXJJY_cjs.a}`);return e}function Ht(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!ut(e.host))return null;let t=ct(e.pathname);if(t===null)return null;for(let n of o){let r=pt(n.pathname);if(r===null||!t.startsWith(r)||t.length<=r.length)continue;let i=new URL("file:///");return i.pathname=t,i}return null}function Gt(e){return typeof e=="string"?new URL(e):"href"in e&&typeof e.href=="string"?new URL(e.href):new URL("url"in e?e.url:String(e))}function Xt(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function st(e,o,t){return e.some(n=>Xt(n,o,t))}async function Wt(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(r){if(dt(r)==="ENOENT")continue;throw r}return t}function $t(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:r,realpath:i},{constants:a},{fileURLToPath:l},u]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),c=e.map(f=>u.resolve(l(f.href))),s=u.resolve(l(typeof o=="string"?o:o.href));if(!st(c,s,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let p=typeof a.O_NOFOLLOW=="number"?a.O_RDONLY|a.O_NOFOLLOW:"r",d=await r(s,p),m=()=>{d.close();};t?.addEventListener("abort",m,{once:true});try{if(t?.aborted)throw t.reason;let f=await i(s);if(!st(await Wt(c,i),f,u))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let x=(await d.stat()).size;if(!Number.isSafeInteger(x)||x<0||x>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:lt});let F=new Uint8Array(x),h=0;for(;h<F.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:y}=await d.read(F,h,F.byteLength-h,h);if(y===0)break;h+=y;}if(t?.aborted)throw t.reason;return h===F.byteLength?F:F.slice(0,h)}catch(f){throw t?.aborted?t.reason:f}finally{t?.removeEventListener("abort",m),await d.close().catch(()=>{});}}}function Yt(e){if(e===null||typeof e!="object")throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");if(e.trustedRoot===void 0||e.maxBytes===void 0)throw new TypeError("createPackagedFileFetch requires trustedRoot and maxBytes");let o=zt(e.trustedRoot),t=Vt(e.maxBytes),n=e.read??$t(o),r=e.networkFetch??fetch;return(async(i,a)=>{let l=a?.signal;if(l?.aborted)throw l.reason;let u=Gt(i);if(u.protocol!=="file:")return r(u,a);let c=Ht(u,o);if(!c)return new Response(null,{status:404});let s=l?new AbortController:void 0,p=()=>s?.abort(l?.reason);l?.addEventListener("abort",p,{once:true});let d;try{if(d=await n(c,{maxBytes:t,...s?{signal:s.signal}:{}}),l?.aborted)throw l.reason;if(d.byteLength>t)return new Response(null,{status:413})}catch(m){if(l?.aborted)throw l.reason;if(s?.signal.aborted)throw s.signal.reason??m;if(m instanceof DOMException&&m.name==="AbortError"||m instanceof Error&&m.name==="AbortError")throw m;let f=dt(m);if(f===lt)return new Response(null,{status:413});if(f==="ENOENT"||f==="ENOTDIR"||f==="ELOOP")return new Response(null,{status:404});throw m}finally{l?.removeEventListener("abort",p);}return new Response(d,{status:200})})}
2
+ Object.defineProperty(exports,"ExportResourceError",{enumerable:true,get:function(){return chunkZKQX2PNF_cjs.d}});Object.defineProperty(exports,"createNodeImageDecodePort",{enumerable:true,get:function(){return chunkZKQX2PNF_cjs.c}});Object.defineProperty(exports,"exportDestinationNamed",{enumerable:true,get:function(){return chunkZKQX2PNF_cjs.b}});Object.defineProperty(exports,"openDocumentForExport",{enumerable:true,get:function(){return chunkZKQX2PNF_cjs.e}});exports.MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS=Y;exports.acquireSharedExportShaping=gt;exports.createPackagedFileFetch=Yt;exports.hasExportAdmittedFont=q;exports.hasExportLaidOutText=X;exports.hasFontBackedExportCapabilities=Ot;exports.openFontBackedDocumentForExport=vt;
package/dist/export.d.ts CHANGED
@@ -1,19 +1,20 @@
1
- import { P as PreservedImageMime, G as ImageResourceLimits, y as SupportedImageMime, E as ImageDecodePort } from './tree-op-types-C71G7rIv.js';
2
- import { D as DocumentProperties, H as HeadlessDocumentView, a as HeadlessDocumentRejection } from './headless-document-view-BDSeMGoK.js';
3
- import { S as SemanticLayout, i as SemanticReviewArtifactRecord, I as InlineDrawingRecord, A as AnchoredDrawingRecord, T as TextMeasurer, h as FontRequest, j as FontSubstitution, k as ShapedRun, a as StyleSpanRecord } from './semantic-records-Bc-MGXbM.js';
4
- import { R as RevisionDisplayMode } from './revision-projection-JiDclAFU.js';
5
- import { P as PreparedLayoutFontConfiguration, L as LayoutShapingInstrumentation } from './layout-shaping-rTElghj2.js';
6
- import { F as FontOriginFailure, a as FontOrigin } from './font-resolver-DtADJcLL.js';
1
+ import { P as PreservedImageMime, v as ImageResourceLimits, p as SupportedImageMime, t as ImageDecodePort } from './tree-op-types-DbdM7fJV.js';
2
+ import { D as DocumentProperties, H as HeadlessDocumentView, a as HeadlessDocumentRejection } from './headless-document-view-C4ttQJ5H.js';
3
+ import { S as SemanticLayout, i as SemanticReviewArtifactRecord, I as InlineDrawingRecord, A as AnchoredDrawingRecord, T as TextMeasurer, h as FontRequest, j as FontSubstitution, k as ShapedRun, a as StyleSpanRecord } from './semantic-records-ZcYuB4-H.js';
4
+ import { R as RevisionDisplayMode } from './revision-projection-BIHO_qvw.js';
5
+ import { P as PreparedLayoutFontConfiguration, L as LayoutShapingInstrumentation } from './layout-shaping-Dqu3JW3p.js';
6
+ import { F as FontOriginFailure, a as FontOrigin } from './font-resolver-BSrKnTeR.js';
7
7
  import './contracts/types.js';
8
- import './hf-references-kSSFMq9X.js';
9
- import './omml-equation-C9AJfWy5.js';
10
- import './editor-BlerWPyk.js';
8
+ import './tree-package-fragment-1pdDnhZ_.js';
9
+ import './omml-equation-hcP9AUFX.js';
10
+ import './editor-WXbTSXx1.js';
11
11
  import './contracts/document.js';
12
12
  import './editor-scope-DZJT4ukT.js';
13
- import './review-items-CiliAz8H.js';
13
+ import './review-items-CJz-kAW8.js';
14
14
  import './contracts/interaction.js';
15
- import './semantic-interaction-2vPh96Ey.js';
16
- import './failure-BnGjoXf0.js';
15
+ import './semantic-interaction-0vQXcMZk.js';
16
+ import './document-protection-BL5zp8cU.js';
17
+ import './failure-DNNmwsgD.js';
17
18
 
18
19
  /** Source content that cannot be certified by the layout snapshot. @public */
19
20
  interface ExportContentWarning {
@@ -235,6 +236,8 @@ declare function hasExportAdmittedFont<T extends object>(value: T): value is T &
235
236
  *
236
237
  * The run is shaped at the base size measurement uses. Callers apply the span's drawn-size
237
238
  * factor, horizontal scale, and character spacing from {@link StyleSpanRecord.style}.
239
+ * The glyph origin is `span.box.x + (span.glyphOffsetPt ?? 0)`; the offset is
240
+ * already in layout points and must not be scaled a second time by horizontal scale.
238
241
  * `font` is a frozen byte-free descriptor; obtain bytes from the session font capability.
239
242
  * @public
240
243
  */