@docx-editor.dev/core 2.20.0 → 2.21.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.
- package/README.md +11 -32
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +11 -10
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +9 -9
- package/dist/binding.js +1 -1
- package/dist/chunk-44LQJIKH.cjs +20 -0
- package/dist/chunk-4EHMMSFR.cjs +1 -0
- package/dist/{chunk-D2V4YBWJ.cjs → chunk-AFG7Q622.cjs} +1 -1
- package/dist/chunk-AJCCS53D.js +1 -0
- package/dist/{chunk-3EZO3O6I.js → chunk-AYMSP25Q.js} +3 -3
- package/dist/{chunk-44SIVFJT.cjs → chunk-B4KZSKF7.cjs} +5 -5
- package/dist/chunk-BDAY2ETZ.js +1 -0
- package/dist/chunk-BNZF6DYC.cjs +18 -0
- package/dist/chunk-BQXF2PFF.js +2 -0
- package/dist/chunk-GIHKVXEO.js +2 -0
- package/dist/chunk-ITNK6C5M.cjs +3 -0
- package/dist/chunk-MP3K4LC5.js +1 -0
- package/dist/chunk-MXOO7KRI.cjs +11 -0
- package/dist/chunk-NG6IQ4SI.js +11 -0
- package/dist/{chunk-2HQXLL5L.cjs → chunk-PYXMAUNR.cjs} +1 -1
- package/dist/chunk-Q2B6HX3R.js +1 -0
- package/dist/chunk-Q5JPPUNR.js +5 -0
- package/dist/chunk-S35UK656.cjs +2 -0
- package/dist/chunk-S6J4O5XP.js +1 -0
- package/dist/{chunk-GSEUM6AI.cjs → chunk-TE43S3LX.cjs} +1 -1
- package/dist/chunk-TKQH7BNE.cjs +1 -0
- package/dist/chunk-UKVVUHZL.cjs +1 -0
- package/dist/chunk-VH2DLEZK.js +20 -0
- package/dist/{chunk-OHVJYJOA.js → chunk-VUNFWXHF.js} +1 -1
- package/dist/{chunk-OA6LFCTG.cjs → chunk-WQFNWLNY.cjs} +3 -3
- package/dist/chunk-WZX4UGRQ.js +3 -0
- package/dist/{chunk-CAIWEQLC.js → chunk-X5QNSISI.js} +1 -1
- package/dist/chunk-XS4FOHH6.js +18 -0
- package/dist/{chunk-PIBYJZIH.cjs → chunk-XZY4Q6PJ.cjs} +1 -1
- package/dist/{chunk-WTILOUPG.cjs → chunk-Z2ETEZRU.cjs} +1 -1
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +13 -4
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.ts +4 -3
- package/dist/contracts/document.d.ts +3 -2
- package/dist/contracts/editor.cjs +1 -1
- package/dist/contracts/editor.d.ts +9 -9
- package/dist/contracts/editor.js +1 -1
- package/dist/contracts/interaction.d.ts +2 -2
- package/dist/contracts/modules.cjs +1 -1
- package/dist/contracts/modules.d.ts +9 -7
- package/dist/contracts/modules.js +1 -1
- package/dist/contracts/types.d.ts +2 -1
- package/dist/{custom-node-writes-piokwVR5.d.ts → custom-node-writes-05qS32px.d.ts} +2 -2
- package/dist/{document-protection-C6RvCHx-.d.ts → document-protection-Cr59VKLO.d.ts} +1 -1
- package/dist/{editor-BgtcHulQ.d.ts → editor-BsLSz_7y.d.ts} +28 -29
- package/dist/editor-scope-OHPwVQ5l.d.ts +84 -0
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.d.ts +130 -27
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +13 -13
- package/dist/export.js +1 -1
- package/dist/{font-resolver-Bv2Z25-J.d.ts → font-resolver-CzwdBJDE.d.ts} +1 -1
- package/dist/{headless-document-view-DHKMN_3Y.d.ts → headless-document-view-B7nAiR7P.d.ts} +2 -2
- package/dist/{image-resources-C51LuAAu.d.ts → image-resources-C4ilLzog.d.ts} +1 -1
- package/dist/{index-3lr8xXF8.d.ts → index-zkvqBQ9o.d.ts} +117 -26
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +18 -18
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-CKBUSaS7.d.ts → layout-shaping-BJKVTI6i.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +41 -18
- package/dist/layout.js +1 -1
- package/dist/{note-properties-CcXUgqr8.d.ts → note-properties-MNztEj5s.d.ts} +1 -1
- package/dist/{omml-equation-C5P6Ym3v.d.ts → omml-equation-CbnW9yXd.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +8 -7
- package/dist/output.js +1 -1
- package/dist/{protocol-CsawNZkt.d.ts → protocol-Co_r0SZQ.d.ts} +2 -2
- package/dist/{review-paragraph-order-BCIqjopY.d.ts → review-paragraph-order-EFaU7TqH.d.ts} +1 -1
- package/dist/{revision-projection-BcRnC4Yj.d.ts → revision-projection-DEIvpxiq.d.ts} +16 -2
- package/dist/{semantic-cell-selection-R9wrenwR.d.ts → semantic-cell-selection-DXmfnDCw.d.ts} +9 -4
- package/dist/{semantic-interaction-B7beVwH7.d.ts → semantic-interaction-BLu3M6Nn.d.ts} +1 -1
- package/dist/{semantic-paint-CLvHwf8y.d.ts → semantic-paint-CPsihA6k.d.ts} +18 -2
- package/dist/{semantic-records-CbXwnS80.d.ts → semantic-records-CqD0b5Ex.d.ts} +146 -6
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +462 -427
- package/dist/store.js +1 -1
- package/dist/{note-lifecycle-D4AOFCAt.d.ts → tree-package-fragment-CwJDixNs.d.ts} +183 -143
- package/dist/{tree-session-contract-DTQxw2zL.d.ts → tree-session-contract-D9RRWE0C.d.ts} +8 -8
- package/dist/{types-barrel-CEOy-Jv0.d.ts → types-barrel-DLB11iSY.d.ts} +1470 -1426
- package/package.json +2 -2
- package/dist/chunk-2H4ABRMB.cjs +0 -20
- package/dist/chunk-6UCDHGXI.js +0 -1
- package/dist/chunk-7VMVDRRU.js +0 -2
- package/dist/chunk-CEXC2VHI.cjs +0 -1
- package/dist/chunk-CF3JR35B.js +0 -11
- package/dist/chunk-D5EHDHYV.js +0 -1
- package/dist/chunk-DGSJZMAE.cjs +0 -11
- package/dist/chunk-EHBPYFRE.js +0 -20
- package/dist/chunk-GOEBQ26R.js +0 -1
- package/dist/chunk-H6WDEAOJ.js +0 -18
- package/dist/chunk-I6LSEDUL.cjs +0 -18
- package/dist/chunk-IW35GWJN.js +0 -1
- package/dist/chunk-JRBGCIR2.js +0 -5
- package/dist/chunk-K5HIOS6J.cjs +0 -3
- package/dist/chunk-KLQXP27K.js +0 -3
- package/dist/chunk-MZFFU66H.cjs +0 -2
- package/dist/chunk-MZPNLIP3.js +0 -2
- package/dist/chunk-OHJQ7GPZ.cjs +0 -1
- package/dist/chunk-P4TGGDK3.js +0 -1
- package/dist/chunk-ZKWRCLT2.cjs +0 -1
- package/dist/editor-scope-DZJT4ukT.d.ts +0 -53
package/dist/editor.d.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
1
|
+
import { O as OoxmlPart, aD as TreeDocColorValue, t as ColorValue, aa as DrawingPositionInput, G as ParagraphTabStop } from './types-barrel-DLB11iSY.js';
|
|
2
|
+
export { aE as IMAGE_WRAP_TARGETS, a9 as ImageWrapTarget, F as ParagraphFlags, R as ReviewModelInput, aF as TEXT_FORM_FORMATS } from './types-barrel-DLB11iSY.js';
|
|
3
|
+
export { D as DEFAULT_IMAGE_RESOURCE_LIMITS, b as ImageDecodePort, c as ImageResourceLimits, R as RenderableImageMime, S as SupportedImageMime, a as VectorImageMime, r as resolveImageResourceLimits, d as resolveSvgIntrinsicSize, s as sniffImageMime, v as validateRasterHeader } from './image-resources-C4ilLzog.js';
|
|
4
4
|
export { CollectReviewItems, EditorModule, EditorModuleRegistry, ReviewModuleContribution, resolveEditorModules } from './contracts/modules.js';
|
|
5
|
-
import { T as TreeDocxSessionView, f as DocumentThemeColorEntry } from './tree-session-contract-
|
|
6
|
-
export { a as TreeApplyResult } from './tree-session-contract-
|
|
7
|
-
import { a as FontConfiguration, E as EditorFontError, d as EditorSnapshot, e as EditorCommand, C as CanResult, Z as ZoomMode } from './editor-
|
|
8
|
-
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-
|
|
9
|
-
import { L as LayoutShapingInstrumentation, a as LayoutShapingOptions } from './layout-shaping-
|
|
10
|
-
export { d as disposeLayoutShaping } from './layout-shaping-
|
|
11
|
-
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-
|
|
12
|
-
import { P as PaginatedSurfaceOptions, O as OpenPaginatedResult, a as PaginatedSurface, T as TableCommandPlan, D as DocxEditorInstance } from './index-
|
|
13
|
-
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
|
|
14
|
-
import { A as AutomationCapabilities, a as AutomationHost } from './protocol-
|
|
15
|
-
import { S as SemanticLayout } from './semantic-records-
|
|
16
|
-
export { T as TextMeasurer } from './semantic-records-
|
|
17
|
-
export { N as NavigationCommand, S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-
|
|
18
|
-
export { S as SectionProperties } from './semantic-cell-selection-
|
|
19
|
-
export { F as FieldShadingMode, R as ReviewAuthorInfo, a as RevisionAuthorAssignments, b as RevisionAuthorStyle, c as RevisionStyles } from './semantic-paint-
|
|
5
|
+
import { T as TreeDocxSessionView, f as DocumentThemeColorEntry } from './tree-session-contract-D9RRWE0C.js';
|
|
6
|
+
export { a as TreeApplyResult } from './tree-session-contract-D9RRWE0C.js';
|
|
7
|
+
import { a as FontConfiguration, E as EditorFontError, d as EditorSnapshot, e as EditorCommand, C as CanResult, Z as ZoomMode } from './editor-BsLSz_7y.js';
|
|
8
|
+
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-BsLSz_7y.js';
|
|
9
|
+
import { L as LayoutShapingInstrumentation, a as LayoutShapingOptions } from './layout-shaping-BJKVTI6i.js';
|
|
10
|
+
export { d as disposeLayoutShaping } from './layout-shaping-BJKVTI6i.js';
|
|
11
|
+
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-CzwdBJDE.js';
|
|
12
|
+
import { P as PaginatedSurfaceOptions, O as OpenPaginatedResult, a as PaginatedSurface, T as TableCommandPlan, D as DocxEditorInstance } from './index-zkvqBQ9o.js';
|
|
13
|
+
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 EditorCommandExecute, x as EquationActivation, y as EquationChromeHandlers, z as EquationOps, F as FinalizedImageOverlayInteraction, B as FontLoadFailure, G as FontLoadFailureReason, H as FontMeasurementState, I as FontUrlSource, J as HistoryGroupBinding, K as HistoryGroupBindingOptions, L as HyperlinkActivation, M as HyperlinkChromeHandlers, N as HyperlinkOps, Q as IMAGE_OVERLAY_NUDGE_PT, R as IMAGE_OVERLAY_NUDGE_SHIFT_PT, S as ImageInteractionSession, U as ImageOverlayScrollPort, V as ImageResizeHandle, W as ImageResizeResult, X as InvalidTextFormFieldChromeHandlers, Y as InvalidTextFormFieldSession, Z as LoadFontsRequest, _ as LoadFontsResult, $ as OverlayFrameRect, a0 as PaginatedSurfaceState, a1 as ParagraphPropertyEdit, a2 as PopupChromeRegistrationOptions, a3 as RemoteCaretLabelAnchor, a4 as RemoteCaretLabelHost, a5 as ReviewWriteIntent, a6 as RunTableChromeCommandResult, a7 as SectionAnchor, a8 as SectionBreakInsertType, a9 as SelectedDrawingOverlayTarget, aa as SurfaceEquation, ab as SurfaceFormatting, ac as SurfaceHyperlink, ad as SurfaceInsertImageInput, ae as SurfaceNavigation, af as SurfaceOverlayCoordinates, ag as SurfaceParagraphFormat, ah as TABLE_BORDER_STYLE_OPTIONS, ai as TABLE_BORDER_TARGET_OPTIONS, aj as TABLE_BORDER_WIDTH_OPTIONS, ak as TABLE_CHROME_SLOT_IDS, al as TableBorderStyleOption, am as TableBorderTargetOption, an as TableBorderTargetValue, ao as TableBorderWidthOption, ap as TableChromeDraft, aq as TableChromePick, ar as TableChromeSlotId, as as TableInteractionLabelKey, at as TextFormFieldChromeHandlers, au as TextFormFieldDialogSession, av as ToolbarCommandState, aw as ToolbarSlotValue, ax as ToolbarValueMap, ay as ToolbarValueSlot, az as applyTableChromePick, aA as bindHistoryGroup, aB as blankDocumentBytes, aC as canExecuteImageCommand, aD as captureImageMutationPreconditions, aE as chromeControlCount, aF as chromeMenuSlots, aG as chromeProbeForSlot, aH as chromeSlotId, aI as chromeSlotIsToggle, aJ as commandExecOptions, aK as commandForSlot, aL as commandForSlotValue, aM as commandForTableChromeSlotValue, aN as computeImageResizeResult, aO as computeMovedImagePosition, aP as computeResizedImageExtentEmu, aQ as createDocxEditor, aR as createFontSource, aS as createImageOverlayScrollPort, aT as cssPixelsToLayoutPoints, aU as customFonts, aV as defaultChromeGroups, aW as defaultTableLabel, aX as emuToOverlayPoints, aY as equationAtPosition, aZ as executeImageCommand, a_ as finalizeImageOverlayInteraction, a$ as formattingBarChromeGroups, b0 as isStaleImageInteractionCommit, b1 as isTableChromeSlot, b2 as layoutPointsToCssPixels, b3 as loadFonts, b4 as overlayFrameToSheetCssPixels, b5 as overlayHostOrigin, b6 as pointsToEmu, b7 as probeTableChromeCommand, b8 as resizePreservesAspect, b9 as runSave, ba as runTableChromeCommand, bb as runTableCommand, bc as runToolbarCommand, bd as selectedDrawingOverlayTargetOf, be as selectedImageStateOf, bf as surfacePaintScale, bg as tableChromeIconPaths, bh as tableChromeLabelKeyForTarget, bi as tableChromeToolbarState, bj as tableChromeVisible, bk as tableCommandToolbarState, bl as toolbarCommandState, bm as toolbarCommandStates } from './index-zkvqBQ9o.js';
|
|
14
|
+
import { A as AutomationCapabilities, a as AutomationHost } from './protocol-Co_r0SZQ.js';
|
|
15
|
+
import { S as SemanticLayout } from './semantic-records-CqD0b5Ex.js';
|
|
16
|
+
export { T as TextMeasurer } from './semantic-records-CqD0b5Ex.js';
|
|
17
|
+
export { N as NavigationCommand, S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-BLu3M6Nn.js';
|
|
18
|
+
export { S as SectionProperties } from './semantic-cell-selection-DXmfnDCw.js';
|
|
19
|
+
export { F as FieldShadingMode, R as ReviewAuthorInfo, a as RevisionAuthorAssignments, b as RevisionAuthorStyle, c as RevisionStyles } from './semantic-paint-CPsihA6k.js';
|
|
20
20
|
export { CollaborationModuleContribution } from './collaboration.js';
|
|
21
|
-
import './
|
|
22
|
-
import './
|
|
21
|
+
import './editor-scope-OHPwVQ5l.js';
|
|
22
|
+
import './revision-projection-DEIvpxiq.js';
|
|
23
|
+
import './tree-package-fragment-CwJDixNs.js';
|
|
23
24
|
import './collaboration/replication.js';
|
|
24
25
|
import './failure-DNNmwsgD.js';
|
|
25
|
-
import './custom-node-writes-
|
|
26
|
-
import './headless-document-view-
|
|
26
|
+
import './custom-node-writes-05qS32px.js';
|
|
27
|
+
import './headless-document-view-B7nAiR7P.js';
|
|
27
28
|
import 'prosemirror-model';
|
|
28
|
-
import './editor-scope-DZJT4ukT.js';
|
|
29
29
|
import './contracts/document.js';
|
|
30
30
|
import './contracts/interaction.js';
|
|
31
|
-
import './document-protection-
|
|
32
|
-
import './note-properties-
|
|
33
|
-
import './omml-equation-
|
|
31
|
+
import './document-protection-Cr59VKLO.js';
|
|
32
|
+
import './note-properties-MNztEj5s.js';
|
|
33
|
+
import './omml-equation-CbnW9yXd.js';
|
|
34
34
|
|
|
35
35
|
declare function toEditorFontError(error: unknown): EditorFontError;
|
|
36
36
|
declare function createLayoutShaping(configuration: FontConfiguration, instrumentation?: LayoutShapingInstrumentation): Promise<LayoutShapingOptions>;
|
|
@@ -604,4 +604,107 @@ declare function withTabStop(stops: readonly ParagraphTabStop[], stop: Paragraph
|
|
|
604
604
|
*/
|
|
605
605
|
declare function trapTabWithin(panel: HTMLElement, event: KeyboardEvent): boolean;
|
|
606
606
|
|
|
607
|
-
|
|
607
|
+
/** One cell of a month grid. @public */
|
|
608
|
+
interface CalendarDay {
|
|
609
|
+
/** Local calendar date as `YYYY-MM-DD`. */
|
|
610
|
+
readonly iso: string;
|
|
611
|
+
/** Day of the month, 1-based. */
|
|
612
|
+
readonly day: number;
|
|
613
|
+
/** Accessible name, spelled out in the calendar locale. */
|
|
614
|
+
readonly label: string;
|
|
615
|
+
/** The cell pads the grid from the previous or next month. */
|
|
616
|
+
readonly otherMonth: boolean;
|
|
617
|
+
/** The cell is the control's current value. */
|
|
618
|
+
readonly selected: boolean;
|
|
619
|
+
/** The cell is the current local date. */
|
|
620
|
+
readonly today: boolean;
|
|
621
|
+
}
|
|
622
|
+
/** A six-week month grid plus its labels. @public */
|
|
623
|
+
interface CalendarMonth {
|
|
624
|
+
readonly year: number;
|
|
625
|
+
/** Zero-based, like `Date#getMonth`. */
|
|
626
|
+
readonly month: number;
|
|
627
|
+
/** Month and year, formatted in the calendar locale. */
|
|
628
|
+
readonly title: string;
|
|
629
|
+
/** Seven weekday labels, starting on the locale's first day of the week. */
|
|
630
|
+
readonly weekdays: readonly string[];
|
|
631
|
+
/** Exactly 42 cells, so the pop-up keeps one height across months. */
|
|
632
|
+
readonly days: readonly CalendarDay[];
|
|
633
|
+
}
|
|
634
|
+
/** Inputs for {@link calendarMonth}. @public */
|
|
635
|
+
interface CalendarMonthOptions {
|
|
636
|
+
/** BCP 47 tag; an unsupported tag falls back to `en-US`. */
|
|
637
|
+
readonly locale?: string;
|
|
638
|
+
/** The control's current value as `YYYY-MM-DD`, or empty. */
|
|
639
|
+
readonly selected?: string | null;
|
|
640
|
+
/** The reference "today"; defaults to the current local date. */
|
|
641
|
+
readonly today?: Date;
|
|
642
|
+
}
|
|
643
|
+
/** Format a local date as `YYYY-MM-DD`. @public */
|
|
644
|
+
declare function isoDateOf(date: Date): string;
|
|
645
|
+
/**
|
|
646
|
+
* Parse the leading `YYYY-MM-DD` of an ISO value as a LOCAL date, or null.
|
|
647
|
+
*
|
|
648
|
+
* A control's `w:fullDate` is `YYYY-MM-DDT00:00:00Z`; only its calendar date matters here,
|
|
649
|
+
* and reading it through `Date` in a western time zone would show the previous day.
|
|
650
|
+
* @public
|
|
651
|
+
*/
|
|
652
|
+
declare function parseIsoDate(value: string): Date | null;
|
|
653
|
+
/**
|
|
654
|
+
* First day of the week for a locale, as `Date#getDay` counts it (0 = Sunday).
|
|
655
|
+
*
|
|
656
|
+
* Asks the runtime's week data when it has any, and otherwise falls back to a region table
|
|
657
|
+
* so a server without ICU week info still starts a US calendar on Sunday.
|
|
658
|
+
* @public
|
|
659
|
+
*/
|
|
660
|
+
declare function firstDayOfWeek(locale?: string): number;
|
|
661
|
+
/** Month-and-year title for a grid, formatted in the calendar locale. @public */
|
|
662
|
+
declare function calendarMonthTitle(year: number, month: number, locale?: string): string;
|
|
663
|
+
/** Seven weekday labels starting on the locale's first weekday. @public */
|
|
664
|
+
declare function calendarWeekdays(locale?: string): readonly string[];
|
|
665
|
+
/**
|
|
666
|
+
* Build the six-week grid for one month.
|
|
667
|
+
*
|
|
668
|
+
* Bounded by construction: 42 cells whatever the month, and every value is derived from the
|
|
669
|
+
* year and month numbers, never from document text.
|
|
670
|
+
* @public
|
|
671
|
+
*/
|
|
672
|
+
declare function calendarMonth(year: number, month: number, options?: CalendarMonthOptions): CalendarMonth;
|
|
673
|
+
/** The month after or before `(year, month)`, wrapping the year. @public */
|
|
674
|
+
declare function shiftMonth(year: number, month: number, delta: 1 | -1): {
|
|
675
|
+
readonly year: number;
|
|
676
|
+
readonly month: number;
|
|
677
|
+
};
|
|
678
|
+
/** Calendar keyboard destination. Shift+PageUp/PageDown moves one year. @public */
|
|
679
|
+
declare function calendarDateForKey(iso: string, key: string, locale?: string, shift?: boolean): string | null;
|
|
680
|
+
/** Format an ISO date for numeric entry in the editor locale. @public */
|
|
681
|
+
declare function calendarDateText(iso: string, locale?: string): string;
|
|
682
|
+
/** Parse a complete ISO or regional numeric date; ambiguous two-digit years are refused. @public */
|
|
683
|
+
declare function calendarDateFromText(text: string, locale?: string): string | null;
|
|
684
|
+
/** The twelve Gregorian month names for a month selector. @public */
|
|
685
|
+
declare function calendarMonthNames(locale?: string): readonly string[];
|
|
686
|
+
|
|
687
|
+
/** Shared focus and placement for engine and host value pop-ups. */
|
|
688
|
+
/** Place an absolute popup against an anchor, within the sheet and visible scroller. @public */
|
|
689
|
+
declare function positionContentControlPopup(panel: HTMLElement, anchor: HTMLElement): void;
|
|
690
|
+
/** Follow scrolling, zoom, and size changes. Call the returned cleanup when the popup closes. @public */
|
|
691
|
+
declare function observeContentControlPopup(panel: HTMLElement, anchor: HTMLElement): () => void;
|
|
692
|
+
/** Keep keyboard input inside a popup; Escape cancels and Tab wraps visible controls. @public */
|
|
693
|
+
declare function contentControlPopupKeyDown(panel: HTMLElement, event: KeyboardEvent, cancel: () => void): void;
|
|
694
|
+
/** Capture a popup's opener, with the editable pages as fallback when no control had focus. @public */
|
|
695
|
+
declare function contentControlPopupOpener(anchor: HTMLElement | null): HTMLElement | null;
|
|
696
|
+
|
|
697
|
+
/** The stateful keyboard behavior used by all value lists. @public */
|
|
698
|
+
interface ContentControlListNavigation {
|
|
699
|
+
/** Handle list keys on a popup root. Input editing keys remain native. */
|
|
700
|
+
keyDown(event: KeyboardEvent, root: HTMLElement): void;
|
|
701
|
+
/** Reset typeahead when opening a different session. */
|
|
702
|
+
reset(): void;
|
|
703
|
+
}
|
|
704
|
+
/** Create bounded, locale-aware typeahead and roving focus for a popup's options. @public */
|
|
705
|
+
declare function createContentControlListNavigation(locale?: string): ContentControlListNavigation;
|
|
706
|
+
|
|
707
|
+
/** The `accept` list of the engine's picker: what `replaceImage` takes. */
|
|
708
|
+
declare const CONTENT_CONTROL_PICTURE_ACCEPT = "image/png,image/jpeg,image/gif,image/bmp,image/webp";
|
|
709
|
+
|
|
710
|
+
export { AUTO_ZOOM_MODE, BROWSER_AUTOMATION_CAPABILITIES, CONTENT_CONTROL_PICTURE_ACCEPT, type CalendarDay, type CalendarMonth, type CalendarMonthOptions, type ColorLowerResult, type ContentControlListNavigation, 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, calendarDateForKey, calendarDateFromText, calendarDateText, calendarMonth, calendarMonthNames, calendarMonthTitle, calendarWeekdays, changedFields, clipboardDropLandsText, clipboardPasteLandsContent, contentControlPopupKeyDown, contentControlPopupOpener, createBrowserAutomationHost, createContentControlListNavigation, createLayoutShaping, dragIndent, editorCommandKey, firstDayOfWeek, formatInches, generateRulerTicks, handlePosition, inchesToTwips, isoDateOf, lowerColorValueForBorder, lowerColorValueForFill, mixedFieldsOf, mountPaginatedSurface, observeContentControlPopup, parseIsoDate, partOfNodeId, positionContentControlPopup, positionInputFromPropertiesCommand, propertiesCommandHasPositionFields, resolveColorValueToCss, resolveThemeColorHex, resolveZoomMode, rulerPageBox, sameTabStops, sameZoomMode, seedFields, shiftMonth, signedFirstLineOf, snapTwips, specialOf, surfaceExtent, tableCommandState, toEditorFontError, trapTabWithin, twipsToInches, validateDrawingPositionInput, validateSetImagePositionCommand, validateThemeModifier, withTabStop };
|
package/dist/editor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{_a as AUTO_ZOOM_MODE,db as BROWSER_AUTOMATION_CAPABILITIES,wa as CHROME_GROUPS,Aa as CHROME_MENUS,Da as CHROME_UNAVAILABLE_KEY,Ia as CONTENT_CONTROL_PICTURE_ACCEPT,Y as DEFAULT_TABLE_CHROME_DRAFT,Q as EMU_PER_POINT,$a as FIT_WIDTH_ZOOM_MODE,O as IMAGE_OVERLAY_NUDGE_PT,P as IMAGE_OVERLAY_NUDGE_SHIFT_PT,c as LOADING_SNAPSHOT,vb as NO_MIXED_FIELDS,l as PX_PER_CM,k as PX_PER_INCH,r as SNAP_TWIPS_CM,q as SNAP_TWIPS_INCH,ca as TABLE_BORDER_STYLE_OPTIONS,ba as TABLE_BORDER_TARGET_OPTIONS,da as TABLE_BORDER_WIDTH_OPTIONS,Z as TABLE_CHROME_SLOT_IDS,rb as TAB_ALIGNMENT_LABELS,p as TWIPS_PER_CM,o as TWIPS_PER_INCH,Za as ZOOM_MAX,Ya as ZOOM_MIN,ea as applyTableChromePick,y as applyThemeShade,x as applyThemeTint,Bb as bindHistoryGroup,d as blankDocumentBytes,Qa as calendarDateForKey,Sa as calendarDateFromText,Ra as calendarDateText,Oa as calendarMonth,Ta as calendarMonthNames,Ma as calendarMonthTitle,Na as calendarWeekdays,M as canExecuteImageCommand,L as captureImageMutationPreconditions,yb as changedFields,Ca as chromeControlCount,Ba as chromeMenuSlots,ia as chromeProbeForSlot,xa as chromeSlotId,oa as chromeSlotIsToggle,f as clipboardDropLandsText,e as clipboardPasteLandsContent,v as commandExecOptions,ja as commandForSlot,la as commandForSlotValue,ka as commandForTableChromeSlotValue,lb as computeImageResizeResult,V as computeMovedImagePosition,U as computeResizedImageExtentEmu,Ga as contentControlPopupKeyDown,Ha as contentControlPopupOpener,eb as createBrowserAutomationHost,Ua as createContentControlListNavigation,cb as createDocxEditor,i as createFontSource,mb as createImageOverlayScrollPort,b as createLayoutShaping,I as cropPercentFromCropPermille,G as cropPercentFromPermille,D as cropPercentFromSourceCrop,H as cropPermilleFromCropPercent,F as cropPermilleFromPercent,hb as cssPixelsToLayoutPoints,j as customFonts,ya as defaultChromeGroups,_ as defaultTableLabel,u as dragIndent,va as editorCommandKey,T as emuToOverlayPoints,Wa as equationAtPosition,N as executeImageCommand,nb as finalizeImageOverlayInteraction,La as firstDayOfWeek,pb as formatInches,za as formattingBarChromeGroups,m as generateRulerTicks,s as handlePosition,qb as inchesToTwips,W as isStaleImageInteractionCommit,$ as isTableChromeSlot,Ja as isoDateOf,gb as layoutPointsToCssPixels,h as loadFonts,A as lowerColorValueForBorder,B as lowerColorValueForFill,wb as mixedFieldsOf,Xa as mountPaginatedSurface,Fa as observeContentControlPopup,ib as overlayFrameToSheetCssPixels,jb as overlayHostOrigin,Ka as parseIsoDate,g as partOfNodeId,S as pointsToEmu,Ea as positionContentControlPopup,fa as probeTableChromeCommand,kb as resizePreservesAspect,C as resolveColorValueToCss,z as resolveThemeColorHex,ab as resolveZoomMode,n as rulerPageBox,sa as runSave,qa as runTableChromeCommand,ua as runTableCommand,ra as runToolbarCommand,xb as sameTabStops,bb as sameZoomMode,ub as seedFields,R as selectedDrawingOverlayTargetOf,K as selectedImageStateOf,Pa as shiftMonth,tb as signedFirstLineOf,t as snapTwips,E as sourceCropFromCropPercent,sb as specialOf,Va as surfaceExtent,fb as surfacePaintScale,ha as tableChromeIconPaths,ga as tableChromeLabelKeyForTarget,ma as tableChromeToolbarState,aa as tableChromeVisible,X as tableCommandState,ta as tableCommandToolbarState,a as toEditorFontError,na as toolbarCommandState,pa as toolbarCommandStates,Ab as trapTabWithin,ob as twipsToInches,J as validateImageCropPercent,w as validateThemeModifier,zb as withTabStop}from'./chunk-VH2DLEZK.js';export{a as resolveEditorModules}from'./chunk-AJCCS53D.js';import'./chunk-BQXF2PFF.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-VUNFWXHF.js';export{H as disposeLayoutShaping}from'./chunk-AYMSP25Q.js';import'./chunk-RIYSCEFQ.js';import'./chunk-GIHKVXEO.js';import'./chunk-MP3K4LC5.js';import'./chunk-XS4FOHH6.js';import'./chunk-Q5JPPUNR.js';import'./chunk-X5QNSISI.js';import'./chunk-BDAY2ETZ.js';import'./chunk-VP7SDFCM.js';import'./chunk-WZX4UGRQ.js';import'./chunk-6JIJOZDW.js';import'./chunk-Q2B6HX3R.js';export{m as DEFAULT_IMAGE_RESOURCE_LIMITS,li as DRAWING_REL_FROM_H,mi as DRAWING_REL_FROM_V,db as IMAGE_WRAP_TARGETS,lh as TEXT_FORM_FORMATS,oi as positionInputFromPropertiesCommand,ni as propertiesCommandHasPositionFields,n as resolveImageResourceLimits,yb as resolveSvgIntrinsicSize,ub as sniffImageMime,ki as validateDrawingPositionInput,zb as validateRasterHeader,pi as validateSetImagePositionCommand}from'./chunk-NG6IQ4SI.js';import'./chunk-S6J4O5XP.js';
|
package/dist/export.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunkPIBYJZIH_cjs=require('./chunk-PIBYJZIH.cjs'),chunkOA6LFCTG_cjs=require('./chunk-OA6LFCTG.cjs'),chunkGSEUM6AI_cjs=require('./chunk-GSEUM6AI.cjs'),chunkI6LSEDUL_cjs=require('./chunk-I6LSEDUL.cjs'),chunkWTILOUPG_cjs=require('./chunk-WTILOUPG.cjs');require('./chunk-FGBADUSK.cjs');var chunkK5HIOS6J_cjs=require('./chunk-K5HIOS6J.cjs'),chunkDGSJZMAE_cjs=require('./chunk-DGSJZMAE.cjs');var B=chunkOA6LFCTG_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:chunkOA6LFCTG_cjs.h(e)})}function Ft(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof chunkOA6LFCTG_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 chunkOA6LFCTG_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 chunkGSEUM6AI_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=chunkOA6LFCTG_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 chunkOA6LFCTG_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=chunkI6LSEDUL_cjs.z(n.style,n.fontSlot),i=chunkI6LSEDUL_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&&!chunkOA6LFCTG_cjs.na(e.shaper,e.environment,l,r,t))return null;let u=chunkOA6LFCTG_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=chunkOA6LFCTG_cjs.c;function Ye(){if(T)return T;let e=(async()=>(await chunkOA6LFCTG_cjs.s(),chunkOA6LFCTG_cjs.x(chunkOA6LFCTG_cjs.y)))();return T=e,e.catch(()=>{T===e&&(T=void 0);}),e}function Ke(e){let o=N();return chunkOA6LFCTG_cjs.pa(e,{resolveFont(t){return Xe(e,o,t)},fallback:chunkI6LSEDUL_cjs.b()})}async function Ze(e,o){if(!chunkOA6LFCTG_cjs.A(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let t=await Ye(),n=await chunkOA6LFCTG_cjs.H(e,t,chunkOA6LFCTG_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:${chunkI6LSEDUL_cjs.a}`].join("|"),extensionFingerprint:e.fingerprint})}function gt(e,o){if(!chunkOA6LFCTG_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=chunkOA6LFCTG_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=chunkOA6LFCTG_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 chunkOA6LFCTG_cjs.H(e,s,chunkOA6LFCTG_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:${chunkI6LSEDUL_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=chunkDGSJZMAE_cjs.E(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),chunkDGSJZMAE_cjs.Sd(o,n)}function Qe(e,o){let t=bt(e);if(t.length!==0)return chunkPIBYJZIH_cjs.i(n=>{let r=new Set((n.resolvedFaces??[]).map(a=>chunkOA6LFCTG_cjs.g(a))),i=chunkPIBYJZIH_cjs.o(t,{maxFontBytes:chunkOA6LFCTG_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?chunkOA6LFCTG_cjs.c:Math.max(0,chunkOA6LFCTG_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>chunkOA6LFCTG_cjs.c)throw new chunkGSEUM6AI_cjs.d("layoutFailed",`Active document export font bytes are limited to ${chunkOA6LFCTG_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===chunkDGSJZMAE_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=chunkK5HIOS6J_cjs._a(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 chunkGSEUM6AI_cjs.d&&y.code==="aborted")return {ok:false,reason:"aborted"};throw y}if(!c)throw s?.dispose(),new chunkGSEUM6AI_cjs.d("layoutFailed","Document font resolution completed without publishing its evidence");let p;try{p=chunkGSEUM6AI_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 chunkGSEUM6AI_cjs.d("aborted","Export resource settlement was aborted"):new chunkGSEUM6AI_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,chunkPIBYJZIH_cjs.c),p=[],d={dropped:[]},m=Qe(e,d),f=m?[...o,m]:o,x=await chunkPIBYJZIH_cjs.l(f,{families:s,defaultFamily:chunkPIBYJZIH_cjs.d.family,signal:r.signal},{onOriginFailure:E=>p.push(E),reserveOwnedBytes:u.reserve});K(r.signal);let F=chunkPIBYJZIH_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(chunkOA6LFCTG_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 chunkGSEUM6AI_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=chunkWTILOUPG_cjs.d(s,e.stylesRoot(),l,It(s,p)),m=chunkPIBYJZIH_cjs.v(s,e.numberingRoot(),e.stylesRoot(),l);for(let f of [...d.direct,...Ut(s),...m,...chunkPIBYJZIH_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=chunkDGSJZMAE_cjs.Pf(e.currentPackage(),o);if(!t)return [];let n=new Set(chunkDGSJZMAE_cjs.Qf(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=chunkDGSJZMAE_cjs.id(i),l=chunkDGSJZMAE_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===chunkDGSJZMAE_cjs.da&&a.localName==="p"&&r.push({paragraph:a,context:l});let u=a.namespaceUri===chunkDGSJZMAE_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=chunkI6LSEDUL_cjs.ga(),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>=chunkDGSJZMAE_cjs.la||d.namespaceUri===chunkDGSJZMAE_cjs.da&&d.localName==="p")continue;let F=d.namespaceUri===chunkDGSJZMAE_cjs.da&&d.localName==="r"?d.id:m;if(d.namespaceUri===chunkDGSJZMAE_cjs.da&&d.localName==="fldSimple"){let h=Z(d,"instr")??"";chunkI6LSEDUL_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===chunkDGSJZMAE_cjs.da&&d.localName==="fldChar"){let h=Z(d,"fldCharType");if(h==="begin")chunkI6LSEDUL_cjs.ja(n),n.nesting===1&&(r=F,i=null,a="",l=false,u=false,c=chunkDGSJZMAE_cjs.ke(d),s=0);else if(h==="separate"){let y=n.nesting===1;if(chunkI6LSEDUL_cjs.la(n),y){let E=chunkI6LSEDUL_cjs.ia(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=chunkI6LSEDUL_cjs.ia(n);a=E.instruction,l=E.overflow||n.nestingOverflow;}if(!l&&chunkI6LSEDUL_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);}}chunkI6LSEDUL_cjs.ma(n);}continue}if(d.namespaceUri===chunkDGSJZMAE_cjs.da&&(d.localName==="instrText"||d.localName==="delInstrText")){chunkI6LSEDUL_cjs.ka(n,it(d),d.localName==="delInstrText");continue}n.nesting>0&&chunkI6LSEDUL_cjs.na(n)&&d.namespaceUri===chunkDGSJZMAE_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:chunkDGSJZMAE_cjs.ma(d,x)});}}chunkI6LSEDUL_cjs.ha(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===chunkDGSJZMAE_cjs.da&&n.localName==="p")){if(n.namespaceUri===chunkDGSJZMAE_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!==chunkDGSJZMAE_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=chunkWTILOUPG_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(chunkI6LSEDUL_cjs.wb),i.namespaceUri===chunkDGSJZMAE_cjs.da&&i.localName==="sym"&&t(chunkWTILOUPG_cjs.b(wt(i,"font"))),i.namespaceUri===chunkDGSJZMAE_cjs.da&&i.localName==="fldSimple"){let a=Z(i,"instr");t(chunkI6LSEDUL_cjs.fc(a??"")?.font??null);}if(i.namespaceUri===chunkDGSJZMAE_cjs.da&&i.localName==="p")for(let a of chunkPIBYJZIH_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>chunkOA6LFCTG_cjs.a)throw new TypeError(`maxBytes must not exceed ${chunkOA6LFCTG_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
|
|
1
|
+
'use strict';var chunkXZY4Q6PJ_cjs=require('./chunk-XZY4Q6PJ.cjs'),chunkWQFNWLNY_cjs=require('./chunk-WQFNWLNY.cjs'),chunkTE43S3LX_cjs=require('./chunk-TE43S3LX.cjs'),chunkBNZF6DYC_cjs=require('./chunk-BNZF6DYC.cjs'),chunkZ2ETEZRU_cjs=require('./chunk-Z2ETEZRU.cjs');require('./chunk-FGBADUSK.cjs');var chunkITNK6C5M_cjs=require('./chunk-ITNK6C5M.cjs'),chunkMXOO7KRI_cjs=require('./chunk-MXOO7KRI.cjs');var B=chunkWQFNWLNY_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:chunkWQFNWLNY_cjs.h(e)})}function Ft(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof chunkWQFNWLNY_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 chunkWQFNWLNY_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 chunkTE43S3LX_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=chunkWQFNWLNY_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 chunkWQFNWLNY_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=chunkBNZF6DYC_cjs.z(n.style,n.fontSlot),i=chunkBNZF6DYC_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&&!chunkWQFNWLNY_cjs.na(e.shaper,e.environment,l,r,t))return null;let u=chunkWQFNWLNY_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=chunkWQFNWLNY_cjs.c;function Ye(){if(T)return T;let e=(async()=>(await chunkWQFNWLNY_cjs.s(),chunkWQFNWLNY_cjs.x(chunkWQFNWLNY_cjs.y)))();return T=e,e.catch(()=>{T===e&&(T=void 0);}),e}function Ke(e){let o=N();return chunkWQFNWLNY_cjs.pa(e,{resolveFont(t){return Xe(e,o,t)},fallback:chunkBNZF6DYC_cjs.b()})}async function Ze(e,o){if(!chunkWQFNWLNY_cjs.A(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let t=await Ye(),n=await chunkWQFNWLNY_cjs.H(e,t,chunkWQFNWLNY_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:${chunkBNZF6DYC_cjs.a}`].join("|"),extensionFingerprint:e.fingerprint})}function gt(e,o){if(!chunkWQFNWLNY_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=chunkWQFNWLNY_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=chunkWQFNWLNY_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 chunkWQFNWLNY_cjs.H(e,s,chunkWQFNWLNY_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:${chunkBNZF6DYC_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=chunkMXOO7KRI_cjs.E(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),chunkMXOO7KRI_cjs.Td(o,n)}function Qe(e,o){let t=bt(e);if(t.length!==0)return chunkXZY4Q6PJ_cjs.i(n=>{let r=new Set((n.resolvedFaces??[]).map(a=>chunkWQFNWLNY_cjs.g(a))),i=chunkXZY4Q6PJ_cjs.o(t,{maxFontBytes:chunkWQFNWLNY_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?chunkWQFNWLNY_cjs.c:Math.max(0,chunkWQFNWLNY_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>chunkWQFNWLNY_cjs.c)throw new chunkTE43S3LX_cjs.d("layoutFailed",`Active document export font bytes are limited to ${chunkWQFNWLNY_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===chunkMXOO7KRI_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=chunkITNK6C5M_cjs.$a(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 chunkTE43S3LX_cjs.d&&y.code==="aborted")return {ok:false,reason:"aborted"};throw y}if(!c)throw s?.dispose(),new chunkTE43S3LX_cjs.d("layoutFailed","Document font resolution completed without publishing its evidence");let p;try{p=chunkTE43S3LX_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 chunkTE43S3LX_cjs.d("aborted","Export resource settlement was aborted"):new chunkTE43S3LX_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,chunkXZY4Q6PJ_cjs.c),p=[],d={dropped:[]},m=Qe(e,d),f=m?[...o,m]:o,x=await chunkXZY4Q6PJ_cjs.l(f,{families:s,defaultFamily:chunkXZY4Q6PJ_cjs.d.family,signal:r.signal},{onOriginFailure:E=>p.push(E),reserveOwnedBytes:u.reserve});K(r.signal);let F=chunkXZY4Q6PJ_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(chunkWQFNWLNY_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 chunkTE43S3LX_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=chunkZ2ETEZRU_cjs.d(s,e.stylesRoot(),l,It(s,p)),m=chunkXZY4Q6PJ_cjs.v(s,e.numberingRoot(),e.stylesRoot(),l);for(let f of [...d.direct,...Ut(s),...m,...chunkXZY4Q6PJ_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=chunkMXOO7KRI_cjs.Wf(e.currentPackage(),o);if(!t)return [];let n=new Set(chunkMXOO7KRI_cjs.Xf(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=chunkMXOO7KRI_cjs.jd(i),l=chunkMXOO7KRI_cjs.id(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===chunkMXOO7KRI_cjs.da&&a.localName==="p"&&r.push({paragraph:a,context:l});let u=a.namespaceUri===chunkMXOO7KRI_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=chunkBNZF6DYC_cjs.ia(),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>=chunkMXOO7KRI_cjs.la||d.namespaceUri===chunkMXOO7KRI_cjs.da&&d.localName==="p")continue;let F=d.namespaceUri===chunkMXOO7KRI_cjs.da&&d.localName==="r"?d.id:m;if(d.namespaceUri===chunkMXOO7KRI_cjs.da&&d.localName==="fldSimple"){let h=Z(d,"instr")??"";chunkBNZF6DYC_cjs.qc(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===chunkMXOO7KRI_cjs.da&&d.localName==="fldChar"){let h=Z(d,"fldCharType");if(h==="begin")chunkBNZF6DYC_cjs.la(n),n.nesting===1&&(r=F,i=null,a="",l=false,u=false,c=chunkMXOO7KRI_cjs.le(d),s=0);else if(h==="separate"){let y=n.nesting===1;if(chunkBNZF6DYC_cjs.na(n),y){let E=chunkBNZF6DYC_cjs.ka(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=chunkBNZF6DYC_cjs.ka(n);a=E.instruction,l=E.overflow||n.nestingOverflow;}if(!l&&chunkBNZF6DYC_cjs.pc(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);}}chunkBNZF6DYC_cjs.oa(n);}continue}if(d.namespaceUri===chunkMXOO7KRI_cjs.da&&(d.localName==="instrText"||d.localName==="delInstrText")){chunkBNZF6DYC_cjs.ma(n,it(d),d.localName==="delInstrText");continue}n.nesting>0&&chunkBNZF6DYC_cjs.pa(n)&&d.namespaceUri===chunkMXOO7KRI_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:chunkMXOO7KRI_cjs.ma(d,x)});}}chunkBNZF6DYC_cjs.ja(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===chunkMXOO7KRI_cjs.da&&n.localName==="p")){if(n.namespaceUri===chunkMXOO7KRI_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!==chunkMXOO7KRI_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=chunkZ2ETEZRU_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(chunkBNZF6DYC_cjs.yb),i.namespaceUri===chunkMXOO7KRI_cjs.da&&i.localName==="sym"&&t(chunkZ2ETEZRU_cjs.b(wt(i,"font"))),i.namespaceUri===chunkMXOO7KRI_cjs.da&&i.localName==="fldSimple"){let a=Z(i,"instr");t(chunkBNZF6DYC_cjs.kc(a??"")?.font??null);}if(i.namespaceUri===chunkMXOO7KRI_cjs.da&&i.localName==="p")for(let a of chunkXZY4Q6PJ_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>chunkWQFNWLNY_cjs.a)throw new TypeError(`maxBytes must not exceed ${chunkWQFNWLNY_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 chunkTE43S3LX_cjs.d}});Object.defineProperty(exports,"createNodeImageDecodePort",{enumerable:true,get:function(){return chunkTE43S3LX_cjs.c}});Object.defineProperty(exports,"exportDestinationNamed",{enumerable:true,get:function(){return chunkTE43S3LX_cjs.b}});Object.defineProperty(exports,"openDocumentForExport",{enumerable:true,get:function(){return chunkTE43S3LX_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,18 +1,18 @@
|
|
|
1
|
-
import { P as PreservedImageMime, c as ImageResourceLimits, S as SupportedImageMime, b as ImageDecodePort } from './image-resources-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { P as PreparedLayoutFontConfiguration, L as LayoutShapingInstrumentation } from './layout-shaping-
|
|
6
|
-
import { F as FontOriginFailure, a as FontOrigin } from './font-resolver-
|
|
7
|
-
import './types-barrel-
|
|
8
|
-
import './
|
|
9
|
-
import './
|
|
10
|
-
import './
|
|
1
|
+
import { P as PreservedImageMime, c as ImageResourceLimits, S as SupportedImageMime, b as ImageDecodePort } from './image-resources-C4ilLzog.js';
|
|
2
|
+
import { a as RevisionDisplayMode } from './revision-projection-DEIvpxiq.js';
|
|
3
|
+
import { S as SemanticLayout, j as SemanticReviewArtifactRecord, I as InlineDrawingRecord, A as AnchoredDrawingRecord, T as TextMeasurer, i as FontRequest, k as FontSubstitution, l as ShapedRun, a as StyleSpanRecord } from './semantic-records-CqD0b5Ex.js';
|
|
4
|
+
import { D as DocumentProperties, H as HeadlessDocumentView, a as HeadlessDocumentRejection } from './headless-document-view-B7nAiR7P.js';
|
|
5
|
+
import { P as PreparedLayoutFontConfiguration, L as LayoutShapingInstrumentation } from './layout-shaping-BJKVTI6i.js';
|
|
6
|
+
import { F as FontOriginFailure, a as FontOrigin } from './font-resolver-CzwdBJDE.js';
|
|
7
|
+
import './types-barrel-DLB11iSY.js';
|
|
8
|
+
import './editor-scope-OHPwVQ5l.js';
|
|
9
|
+
import './omml-equation-CbnW9yXd.js';
|
|
10
|
+
import './tree-package-fragment-CwJDixNs.js';
|
|
11
|
+
import './editor-BsLSz_7y.js';
|
|
11
12
|
import './contracts/document.js';
|
|
12
|
-
import './editor-scope-DZJT4ukT.js';
|
|
13
13
|
import './contracts/interaction.js';
|
|
14
|
-
import './semantic-interaction-
|
|
15
|
-
import './document-protection-
|
|
14
|
+
import './semantic-interaction-BLu3M6Nn.js';
|
|
15
|
+
import './document-protection-Cr59VKLO.js';
|
|
16
16
|
import './failure-DNNmwsgD.js';
|
|
17
17
|
|
|
18
18
|
/** Source content that cannot be certified by the layout snapshot. @public */
|
package/dist/export.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {c as c$1,l,d as d$1,e as e$1,v,s,i,o,u}from'./chunk-OHVJYJOA.js';import {z as z$1,B as B$1,A as A$1,c,G as G$1,x,D,r,w,ma,la,oa,g,a as a$1,d as d$3,b as b$2,h}from'./chunk-3EZO3O6I.js';import'./chunk-RIYSCEFQ.js';import {d,e}from'./chunk-6UCDHGXI.js';export{d as ExportResourceError,c as createNodeImageDecodePort,b as exportDestinationNamed,e as openDocumentForExport}from'./chunk-6UCDHGXI.js';import {a,z as z$2,j as j$1,b,fc,ga,lc,ja,la as la$2,ia,kc,ma as ma$1,ka,na,ha,wb}from'./chunk-H6WDEAOJ.js';import {d as d$2,b as b$1,a as a$2}from'./chunk-CAIWEQLC.js';import'./chunk-VP7SDFCM.js';import {_a}from'./chunk-KLQXP27K.js';import {Pf,Qf,id,hd,da,E,Sd,la as la$1,ke,ma as ma$2}from'./chunk-CF3JR35B.js';var B=b$2;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:h(e)})}function Ft(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof d$3?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 d$3||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 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=g(r),a=o.get(i);if(!a){try{a=e.fonts.resolve(r);}catch{return null}o.set(i,a);}return a instanceof d$3?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=z$2(n.style,n.fontSlot),i=j$1(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&&!ma(e.shaper,e.environment,l,r,t))return null;let u=la(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=c;function Ye(){if(T)return T;let e=(async()=>(await r(),w(x)))();return T=e,e.catch(()=>{T===e&&(T=void 0);}),e}function Ke(e){let o=N();return oa(e,{resolveFont(t){return Xe(e,o,t)},fallback:b()})}async function Ze(e,o){if(!z$1(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let t=await Ye(),n=await G$1(e,t,x,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:${a}`].join("|"),extensionFingerprint:e.fingerprint})}function gt(e,o){if(!z$1(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=B$1(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=A$1(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 G$1(e,s,x,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$1=r.then(l=>Object.freeze({createMeasurer:l.createMeasurer,shapeLaidOutText:l.shapeLaidOutText,producer:["node-export",i,l.shapingHash,`producer:${l.producerVersion}`,`fallback:${a}`].join("|"),extensionFingerprint:i}));return I.set(e,a$1),a$1.catch(()=>{I.get(e)===a$1&&I.delete(e);}),a$1}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=E(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),Sd(o,n)}function Qe(e,o$1){let t=bt(e);if(t.length!==0)return i(n=>{let r=new Set((n.resolvedFaces??[]).map(a=>g(a))),i=o(t,{maxFontBytes:a$1,aggregateBudget:Rt(n),shadowedRequests:r});if(o$1)for(let a of i.dropped){if(o$1.dropped.length>=B)break;o$1.dropped.push(a);}return {sources:i.sources}})}function Rt(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?c:Math.max(0,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>c)throw new d("layoutFailed",`Active document export font bytes are limited to ${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===da||t.namespaceUri===""))?.value}async function vt(e$1,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=_a(e$1);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 d&&y.code==="aborted")return {ok:false,reason:"aborted"};throw y}if(!c)throw s?.dispose(),new d("layoutFailed","Document font resolution completed without publishing its evidence");let p;try{p=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$1=p.session,m=s,f="active",x=()=>f==="aborted"?new d("aborted","Export resource settlement was aborted"):new d("disposed","Export session has been disposed"),F=y=>{if(f==="active"){f=y,o.signal?.removeEventListener("abort",h);try{d$1.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$1.layout():Promise.reject(x()),layoutFor:y=>f==="active"?d$1.layoutFor(y):Promise.reject(x()),validatedImageBytes:y=>f==="active"?d$1.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$1=(async()=>{let u=St(t.onActiveFontBytesChange),c=!1;try{let s=Dt(e).slice(0,c$1),p=[],d={dropped:[]},m=Qe(e,d),f=m?[...o,m]:o,x=await l(f,{families:s,defaultFamily:d$1.family,signal:r.signal},{onOriginFailure:E=>p.push(E),reserveOwnedBytes:u.reserve});K(r.signal);let F=e$1(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(D(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$1,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 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$1,p)=>{let d=d$2(s$1,e.stylesRoot(),l,It(s$1,p)),m=v(s$1,e.numberingRoot(),e.stylesRoot(),l);for(let f of [...d.direct,...Ut(s$1),...m,...s(s$1,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=Pf(e.currentPackage(),o);if(!t)return [];let n=new Set(Qf(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=id(i),l=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===da&&a.localName==="p"&&r.push({paragraph:a,context:l});let u=a.namespaceUri===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=ga(),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>=la$1||d.namespaceUri===da&&d.localName==="p")continue;let F=d.namespaceUri===da&&d.localName==="r"?d.id:m;if(d.namespaceUri===da&&d.localName==="fldSimple"){let h=Z(d,"instr")??"";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===da&&d.localName==="fldChar"){let h=Z(d,"fldCharType");if(h==="begin")ja(n),n.nesting===1&&(r=F,i=null,a="",l=false,u=false,c=ke(d),s=0);else if(h==="separate"){let y=n.nesting===1;if(la$2(n),y){let E=ia(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=ia(n);a=E.instruction,l=E.overflow||n.nestingOverflow;}if(!l&&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);}}ma$1(n);}continue}if(d.namespaceUri===da&&(d.localName==="instrText"||d.localName==="delInstrText")){ka(n,it(d),d.localName==="delInstrText");continue}n.nesting>0&&na(n)&&d.namespaceUri===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:ma$2(d,x)});}}ha(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===da&&n.localName==="p")){if(n.namespaceUri===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!==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=a$2(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(wb),i.namespaceUri===da&&i.localName==="sym"&&t(b$1(wt(i,"font"))),i.namespaceUri===da&&i.localName==="fldSimple"){let a=Z(i,"instr");t(fc(a??"")?.font??null);}if(i.namespaceUri===da&&i.localName==="p")for(let a of 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>a$1)throw new TypeError(`maxBytes must not exceed ${a$1}`);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})})}
|
|
1
|
+
import {c as c$1,l,d as d$1,e as e$1,v,s,i,o,u}from'./chunk-VUNFWXHF.js';import {z as z$1,B as B$1,A as A$1,c,G as G$1,x,D,r,w,ma,la,oa,g,a as a$1,d as d$3,b as b$2,h}from'./chunk-AYMSP25Q.js';import'./chunk-RIYSCEFQ.js';import {d,e}from'./chunk-MP3K4LC5.js';export{d as ExportResourceError,c as createNodeImageDecodePort,b as exportDestinationNamed,e as openDocumentForExport}from'./chunk-MP3K4LC5.js';import {a,z as z$2,j as j$1,b,kc,ia,qc,la as la$2,na,ka,pc,oa as oa$1,ma as ma$1,pa,ja,yb}from'./chunk-XS4FOHH6.js';import {d as d$2,b as b$1,a as a$2}from'./chunk-X5QNSISI.js';import'./chunk-VP7SDFCM.js';import {$a}from'./chunk-WZX4UGRQ.js';import {Wf,Xf,jd,id,da,E,Td,la as la$1,le,ma as ma$2}from'./chunk-NG6IQ4SI.js';var B=b$2;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:h(e)})}function Ft(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof d$3?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 d$3||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 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=g(r),a=o.get(i);if(!a){try{a=e.fonts.resolve(r);}catch{return null}o.set(i,a);}return a instanceof d$3?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=z$2(n.style,n.fontSlot),i=j$1(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&&!ma(e.shaper,e.environment,l,r,t))return null;let u=la(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=c;function Ye(){if(T)return T;let e=(async()=>(await r(),w(x)))();return T=e,e.catch(()=>{T===e&&(T=void 0);}),e}function Ke(e){let o=N();return oa(e,{resolveFont(t){return Xe(e,o,t)},fallback:b()})}async function Ze(e,o){if(!z$1(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let t=await Ye(),n=await G$1(e,t,x,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:${a}`].join("|"),extensionFingerprint:e.fingerprint})}function gt(e,o){if(!z$1(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=B$1(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=A$1(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 G$1(e,s,x,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$1=r.then(l=>Object.freeze({createMeasurer:l.createMeasurer,shapeLaidOutText:l.shapeLaidOutText,producer:["node-export",i,l.shapingHash,`producer:${l.producerVersion}`,`fallback:${a}`].join("|"),extensionFingerprint:i}));return I.set(e,a$1),a$1.catch(()=>{I.get(e)===a$1&&I.delete(e);}),a$1}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=E(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),Td(o,n)}function Qe(e,o$1){let t=bt(e);if(t.length!==0)return i(n=>{let r=new Set((n.resolvedFaces??[]).map(a=>g(a))),i=o(t,{maxFontBytes:a$1,aggregateBudget:Rt(n),shadowedRequests:r});if(o$1)for(let a of i.dropped){if(o$1.dropped.length>=B)break;o$1.dropped.push(a);}return {sources:i.sources}})}function Rt(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?c:Math.max(0,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>c)throw new d("layoutFailed",`Active document export font bytes are limited to ${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===da||t.namespaceUri===""))?.value}async function vt(e$1,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=$a(e$1);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 d&&y.code==="aborted")return {ok:false,reason:"aborted"};throw y}if(!c)throw s?.dispose(),new d("layoutFailed","Document font resolution completed without publishing its evidence");let p;try{p=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$1=p.session,m=s,f="active",x=()=>f==="aborted"?new d("aborted","Export resource settlement was aborted"):new d("disposed","Export session has been disposed"),F=y=>{if(f==="active"){f=y,o.signal?.removeEventListener("abort",h);try{d$1.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$1.layout():Promise.reject(x()),layoutFor:y=>f==="active"?d$1.layoutFor(y):Promise.reject(x()),validatedImageBytes:y=>f==="active"?d$1.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$1=(async()=>{let u=St(t.onActiveFontBytesChange),c=!1;try{let s=Dt(e).slice(0,c$1),p=[],d={dropped:[]},m=Qe(e,d),f=m?[...o,m]:o,x=await l(f,{families:s,defaultFamily:d$1.family,signal:r.signal},{onOriginFailure:E=>p.push(E),reserveOwnedBytes:u.reserve});K(r.signal);let F=e$1(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(D(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$1,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 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$1,p)=>{let d=d$2(s$1,e.stylesRoot(),l,It(s$1,p)),m=v(s$1,e.numberingRoot(),e.stylesRoot(),l);for(let f of [...d.direct,...Ut(s$1),...m,...s(s$1,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=Wf(e.currentPackage(),o);if(!t)return [];let n=new Set(Xf(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=jd(i),l=id(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===da&&a.localName==="p"&&r.push({paragraph:a,context:l});let u=a.namespaceUri===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=ia(),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>=la$1||d.namespaceUri===da&&d.localName==="p")continue;let F=d.namespaceUri===da&&d.localName==="r"?d.id:m;if(d.namespaceUri===da&&d.localName==="fldSimple"){let h=Z(d,"instr")??"";qc(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===da&&d.localName==="fldChar"){let h=Z(d,"fldCharType");if(h==="begin")la$2(n),n.nesting===1&&(r=F,i=null,a="",l=false,u=false,c=le(d),s=0);else if(h==="separate"){let y=n.nesting===1;if(na(n),y){let E=ka(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=ka(n);a=E.instruction,l=E.overflow||n.nestingOverflow;}if(!l&&pc(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);}}oa$1(n);}continue}if(d.namespaceUri===da&&(d.localName==="instrText"||d.localName==="delInstrText")){ma$1(n,it(d),d.localName==="delInstrText");continue}n.nesting>0&&pa(n)&&d.namespaceUri===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:ma$2(d,x)});}}ja(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===da&&n.localName==="p")){if(n.namespaceUri===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!==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=a$2(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(yb),i.namespaceUri===da&&i.localName==="sym"&&t(b$1(wt(i,"font"))),i.namespaceUri===da&&i.localName==="fldSimple"){let a=Z(i,"instr");t(kc(a??"")?.font??null);}if(i.namespaceUri===da&&i.localName==="p")for(let a of 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>a$1)throw new TypeError(`maxBytes must not exceed ${a$1}`);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
2
|
export{Y as MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS,gt as acquireSharedExportShaping,Yt as createPackagedFileFetch,q as hasExportAdmittedFont,X as hasExportLaidOutText,Ot as hasFontBackedExportCapabilities,vt as openFontBackedDocumentForExport};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as FontFaceRequest, a as FontConfiguration, b as FontSource, c as FontSourceSubstitution } from './editor-
|
|
1
|
+
import { F as FontFaceRequest, a as FontConfiguration, b as FontSource, c as FontSourceSubstitution } from './editor-BsLSz_7y.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A partial font configuration one origin contributes: sources, substitutions, or both.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { j as OoxmlPackage, O as OoxmlPart, a1 as OoxmlElement, Y as OoxmlPackageRejection } from './types-barrel-
|
|
1
|
+
import { d as HeaderFooterParts, e as HeaderFooterSectionResolution, T as TreePackageStore } from './tree-package-fragment-CwJDixNs.js';
|
|
2
|
+
import { j as OoxmlPackage, O as OoxmlPart, a1 as OoxmlElement, Y as OoxmlPackageRejection } from './types-barrel-DLB11iSY.js';
|
|
3
3
|
|
|
4
4
|
/** The package with a hyperlink relationship guaranteed present, and that relationship's id. */
|
|
5
5
|
interface EnsuredHyperlinkRelationship {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a4 as DrawingProjection, j as OoxmlPackage } from './types-barrel-
|
|
1
|
+
import { a4 as DrawingProjection, j as OoxmlPackage } from './types-barrel-DLB11iSY.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The engine's trust-boundary caps: recursion depth, element counts, and the rest.
|