@docx-editor.dev/core 2.26.0 → 2.27.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/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +14 -10
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +8 -8
- package/dist/binding.js +1 -1
- package/dist/chunk-2GK7YQB2.cjs +2 -0
- package/dist/chunk-4KZ6L5YF.cjs +15 -0
- package/dist/chunk-55AT3MOU.cjs +25 -0
- package/dist/chunk-6ZQMII6V.js +1 -0
- package/dist/chunk-7IGCWG4H.js +2 -0
- package/dist/chunk-7MYITTAH.js +5 -0
- package/dist/chunk-AVKVRU7Z.cjs +5 -0
- package/dist/{chunk-7RJSH72J.cjs → chunk-CWRBFNK5.cjs} +5 -5
- package/dist/chunk-DGPA3TST.cjs +27 -0
- package/dist/{chunk-6SEIXJTX.js → chunk-DNXVNQEO.js} +1 -1
- package/dist/chunk-FQN4KSFL.cjs +7 -0
- package/dist/{chunk-ELQFXMJ5.cjs → chunk-GVUOWHTO.cjs} +1 -1
- package/dist/chunk-GWQJ5774.js +5 -0
- package/dist/{chunk-5BIASAN3.js → chunk-HAQ72KD7.js} +1 -1
- package/dist/{chunk-TKR2MXX4.cjs → chunk-HO5XFO32.cjs} +1 -1
- package/dist/{chunk-LWCI65EL.js → chunk-IGR23DV2.js} +1 -1
- package/dist/{chunk-EEAV3WIN.js → chunk-JSIX2EOH.js} +1 -1
- package/dist/{chunk-CYT3OQFZ.cjs → chunk-K246T47S.cjs} +1 -1
- package/dist/chunk-KAXOGCGA.js +1 -0
- package/dist/{chunk-AGKIHLWQ.cjs → chunk-LZLTN5A3.cjs} +1 -1
- package/dist/chunk-NBCVVZOM.cjs +1 -0
- package/dist/{chunk-AJCCS53D.js → chunk-O5INAWZQ.js} +1 -1
- package/dist/{chunk-LZDI4P6I.cjs → chunk-OHAXVTWG.cjs} +1 -1
- package/dist/chunk-S74GRBNE.js +7 -0
- package/dist/chunk-UBLUVNZR.js +27 -0
- package/dist/chunk-UMRSBLO7.js +15 -0
- package/dist/chunk-VIPMGGUT.js +25 -0
- package/dist/chunk-WG4KMSX2.cjs +2 -0
- package/dist/chunk-WRLKVNNR.cjs +1 -0
- package/dist/chunk-ZU7IVN6G.js +2 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +14 -5
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.ts +3 -3
- package/dist/contracts/document.d.ts +2 -2
- package/dist/contracts/editor.d.ts +8 -8
- package/dist/contracts/modules.cjs +1 -1
- package/dist/contracts/modules.d.ts +20 -31
- package/dist/contracts/modules.js +1 -1
- package/dist/contracts/types.d.ts +1 -1
- package/dist/{custom-node-writes-Cy9imOjA.d.ts → custom-node-writes-Vzpq9I8_.d.ts} +2 -2
- package/dist/{document-protection-Bp19Ad4I.d.ts → document-protection-9zpIHWTE.d.ts} +1 -1
- package/dist/{editor-DYUlyKmb.d.ts → editor-B3OBYNrF.d.ts} +29 -34
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +2 -2
- package/dist/editor.d.ts +28 -27
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +26 -14
- package/dist/export.js +1 -1
- package/dist/{font-resolver-u_nE0PI1.d.ts → font-resolver-DN0xNOf_.d.ts} +1 -1
- package/dist/{headless-document-view-R9bzzepb.d.ts → headless-document-view-ICYqNkQ1.d.ts} +2 -2
- package/dist/{image-resources-DfagDguq.d.ts → image-resources-BDFxcu7W.d.ts} +1 -1
- package/dist/{index-Docw8Dcb.d.ts → index-CkQVRJtJ.d.ts} +53 -21
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +18 -17
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-DWitwY73.d.ts → layout-shaping-BvZD_VKP.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +32 -196
- package/dist/layout.js +1 -1
- package/dist/{note-properties-CmfvOJsi.d.ts → note-properties-CkAk7g-n.d.ts} +1 -1
- package/dist/{omml-equation-CZ6IG2ja.d.ts → omml-equation-DuczgG5o.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-DniKeDb8.d.ts → protocol-aKYr8r3u.d.ts} +6 -5
- package/dist/{review-paragraph-order-Dc8Q6tfM.d.ts → review-paragraph-order-Ddj5d6rp.d.ts} +1 -1
- package/dist/{revision-projection-DfWxdBqA.d.ts → revision-projection-CSNFudZY.d.ts} +74 -3
- package/dist/{semantic-cell-selection-Dy_BmmpL.d.ts → semantic-cell-selection-DoqYCz_F.d.ts} +4 -4
- package/dist/{semantic-interaction-CvFAj0GR.d.ts → semantic-interaction-G0bjmmmk.d.ts} +1 -1
- package/dist/{semantic-paint-Bk9wIXdZ.d.ts → semantic-paint-CsMzF8-O.d.ts} +57 -5
- package/dist/semantic-record-queries-1du6lQqS.d.ts +177 -0
- package/dist/{semantic-records-COqi8pjP.d.ts → semantic-records-B9OolWGN.d.ts} +15 -5
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +22 -17
- package/dist/store.js +1 -1
- package/dist/{tree-package-fragment-YPyYC1aD.d.ts → tree-package-fragment-DYZIk1rY.d.ts} +3 -3
- package/dist/{tree-session-contract-AeY2v0x9.d.ts → tree-session-contract-DQVJOOkv.d.ts} +5 -5
- package/dist/{types-barrel-BO73JqHG.d.ts → types-barrel-BFKR8Pzp.d.ts} +134 -110
- package/package.json +3 -3
- package/dist/chunk-2BK4G4ZN.js +0 -2
- package/dist/chunk-2SJX44PC.cjs +0 -2
- package/dist/chunk-73PG6L2X.js +0 -1
- package/dist/chunk-AN6WM4X4.js +0 -2
- package/dist/chunk-ANZ44KQT.cjs +0 -12
- package/dist/chunk-DDGGSBAN.js +0 -12
- package/dist/chunk-EYK4K2J6.js +0 -1
- package/dist/chunk-JNTETUNZ.cjs +0 -1
- package/dist/chunk-L6V3IJ3S.js +0 -5
- package/dist/chunk-NS22DVWT.cjs +0 -2
- package/dist/chunk-QIE3YTU4.cjs +0 -2
- package/dist/chunk-QVBFPAGO.js +0 -5
- package/dist/chunk-RCCOLZEQ.js +0 -2
- package/dist/chunk-SUN62YU6.cjs +0 -5
- package/dist/chunk-TKQH7BNE.cjs +0 -1
- package/dist/chunk-UJL2GDIM.cjs +0 -25
- package/dist/chunk-WQTADNHK.cjs +0 -27
- package/dist/chunk-XSHXBJ2J.js +0 -25
- package/dist/chunk-YXZEBTDF.js +0 -27
package/dist/editor.d.ts
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { O as OoxmlPart, aD as TreeDocColorValue, r as ColorValue, ab as DrawingPositionInput, A as ParagraphTabStop } from './types-barrel-
|
|
2
|
-
export { aE as IMAGE_WRAP_TARGETS, aa as ImageWrapTarget, z as ParagraphFlags, R as ReviewModelInput, aF as TEXT_FORM_FORMATS } from './types-barrel-
|
|
3
|
-
export { D as DEFAULT_IMAGE_RESOURCE_LIMITS, a as ImageDecodePort, I as ImageResourceLimits, R as RenderableImageMime, S as SupportedImageMime, c as VectorImageMime, r as resolveImageResourceLimits, d as resolveSvgIntrinsicSize, s as sniffImageMime, v as validateRasterHeader } from './image-resources-
|
|
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, f as ClearAnchorHighlightOptions, A as AnchorHighlightOptions, S as ScrollToAnchorOptions, g as AnchorHighlightAnimation, H as HighlightRange, h as Editor, i as HighlightResult, j as HighlightOptions, T as TextMatch } from './editor-
|
|
8
|
-
export { k as HighlightHit, l as HighlightRect, I as ImageContext, m as ImageCropPercent, n as ImageCropPermille, o as SelectedImageState, p as TrackedChangeFilterMode, q as TrackedChangePredicate, r as cropPercentFromCropPermille, s as cropPercentFromPermille, t as cropPercentFromSourceCrop, u as cropPermilleFromCropPercent, v as cropPermilleFromPercent, w as sourceCropFromCropPercent, x 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, D as DEFAULT_FONT, 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 ChromeExportError, h as ChromeExportFormat, i as ChromeExportHandlers, j as ChromeExportResult, k as
|
|
14
|
-
import { a as AutomationCapabilities, b as AutomationHost } from './protocol-
|
|
15
|
-
import { S as SemanticLayout } from './semantic-records-
|
|
16
|
-
export { T as TextMeasurer } from './semantic-records-
|
|
17
|
-
export {
|
|
18
|
-
export { S as
|
|
19
|
-
export {
|
|
1
|
+
import { O as OoxmlPart, aD as TreeDocColorValue, r as ColorValue, ab as DrawingPositionInput, A as ParagraphTabStop } from './types-barrel-BFKR8Pzp.js';
|
|
2
|
+
export { aE as IMAGE_WRAP_TARGETS, aa as ImageWrapTarget, z as ParagraphFlags, R as ReviewModelInput, aF as TEXT_FORM_FORMATS } from './types-barrel-BFKR8Pzp.js';
|
|
3
|
+
export { D as DEFAULT_IMAGE_RESOURCE_LIMITS, a as ImageDecodePort, I as ImageResourceLimits, R as RenderableImageMime, S as SupportedImageMime, c as VectorImageMime, r as resolveImageResourceLimits, d as resolveSvgIntrinsicSize, s as sniffImageMime, v as validateRasterHeader } from './image-resources-BDFxcu7W.js';
|
|
4
|
+
export { CollectReviewItems, EditorModule, EditorModuleRegistry, ReviewModuleContribution, RevisionMarkupDialog, RevisionMarkupDialogHost, resolveEditorModules } from './contracts/modules.js';
|
|
5
|
+
import { T as TreeDocxSessionView, f as DocumentThemeColorEntry } from './tree-session-contract-DQVJOOkv.js';
|
|
6
|
+
export { a as TreeApplyResult } from './tree-session-contract-DQVJOOkv.js';
|
|
7
|
+
import { a as FontConfiguration, E as EditorFontError, d as EditorSnapshot, e as EditorCommand, C as CanResult, Z as ZoomMode, f as ClearAnchorHighlightOptions, A as AnchorHighlightOptions, S as ScrollToAnchorOptions, g as AnchorHighlightAnimation, H as HighlightRange, h as Editor, i as HighlightResult, j as HighlightOptions, T as TextMatch } from './editor-B3OBYNrF.js';
|
|
8
|
+
export { k as HighlightHit, l as HighlightRect, I as ImageContext, m as ImageCropPercent, n as ImageCropPermille, o as SelectedImageState, p as TrackedChangeFilterMode, q as TrackedChangePredicate, r as cropPercentFromCropPermille, s as cropPercentFromPermille, t as cropPercentFromSourceCrop, u as cropPermilleFromCropPercent, v as cropPermilleFromPercent, w as sourceCropFromCropPercent, x as validateImageCropPercent } from './editor-B3OBYNrF.js';
|
|
9
|
+
import { L as LayoutShapingInstrumentation, a as LayoutShapingOptions } from './layout-shaping-BvZD_VKP.js';
|
|
10
|
+
export { d as disposeLayoutShaping } from './layout-shaping-BvZD_VKP.js';
|
|
11
|
+
export { C as ComposeFontOriginsOptions, D as DEFAULT_FONT, 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-DN0xNOf_.js';
|
|
12
|
+
import { P as PaginatedSurfaceOptions, O as OpenPaginatedResult, a as PaginatedSurface, T as TableCommandPlan, D as DocxEditorInstance } from './index-CkQVRJtJ.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 ChromeExportError, h as ChromeExportFormat, i as ChromeExportHandlers, j as ChromeExportResult, k as ChromeExportView, l as ChromeGroup, m as ChromeGroupId, n as ChromeMenu, o as ChromeMenuEntry, p as ChromeMenuId, q as ChromeMenuItemEntry, r as ChromeMenuSeparatorEntry, s as ChromeMenuSubmenuEntry, t as ChromePrintError, u as ChromePrintErrorCode, v as ChromePrintJob, w as ChromePrintOptions, x as ChromeSlotId, y as ContentControlWidgetChromeHandlers, z as ContentControlWidgetSession, B as CustomFontsOptions, E as CustomFontsResolver, F as DEFAULT_TABLE_CHROME_DRAFT, G as DocxEditorConfig, H as DrawingSelectionIntent, I as EMU_PER_POINT, J as EditorCommandExecute, K as EquationActivation, L as EquationChromeHandlers, M as EquationOps, N as FinalizedImageOverlayInteraction, Q as FontLoadFailure, R as FontLoadFailureReason, S as FontMeasurementState, U as FontUrlSource, V as HistoryGroupBinding, W as HistoryGroupBindingOptions, X as HyperlinkActivation, Y as HyperlinkChromeHandlers, Z as HyperlinkOps, _ as IMAGE_OVERLAY_NUDGE_PT, $ as IMAGE_OVERLAY_NUDGE_SHIFT_PT, a0 as ImageInteractionSession, a1 as ImageOverlayScrollPort, a2 as ImageResizeHandle, a3 as ImageResizeResult, a4 as InvalidTextFormFieldChromeHandlers, a5 as InvalidTextFormFieldSession, a6 as LoadFontsRequest, a7 as LoadFontsResult, a8 as OverlayFrameRect, a9 as PaginatedSurfaceState, aa as ParagraphPropertyEdit, ab as PopupChromeRegistrationOptions, ac as RemoteCaretLabelAnchor, ad as RemoteCaretLabelHost, ae as ReviewWriteIntent, af as RunTableChromeCommandResult, ag as SectionAnchor, ah as SectionBreakInsertType, ai as SelectedDrawingOverlayTarget, aj as SurfaceEquation, ak as SurfaceFormatting, al as SurfaceHyperlink, am as SurfaceInsertImageInput, an as SurfaceNavigation, ao as SurfaceOverlayCoordinates, ap as SurfaceParagraphFormat, aq as TABLE_BORDER_STYLE_OPTIONS, ar as TABLE_BORDER_TARGET_OPTIONS, as as TABLE_BORDER_WIDTH_OPTIONS, at as TABLE_CHROME_SLOT_IDS, au as TableBorderStyleOption, av as TableBorderTargetOption, aw as TableBorderTargetValue, ax as TableBorderWidthOption, ay as TableChromeDraft, az as TableChromePick, aA as TableChromeSlotId, aB as TableInteractionLabelKey, aC as TextFormFieldChromeHandlers, aD as TextFormFieldDialogSession, aE as ToolbarCommandState, aF as ToolbarSlotValue, aG as ToolbarValueMap, aH as ToolbarValueSlot, aI as applyTableChromePick, aJ as bindHistoryGroup, aK as blankDocumentBytes, aL as canExecuteImageCommand, aM as captureImageMutationPreconditions, aN as chromeControlCount, aO as chromeMenuSlots, aP as chromeProbeForSlot, aQ as chromeSlotId, aR as chromeSlotIsToggle, aS as commandExecOptions, aT as commandForSlot, aU as commandForSlotValue, aV as commandForTableChromeSlotValue, aW as computeImageResizeResult, aX as computeMovedImagePosition, aY as computeResizedImageExtentEmu, aZ as createDocxEditor, a_ as createFontSource, a$ as createImageOverlayScrollPort, b0 as cssPixelsToLayoutPoints, b1 as customFonts, b2 as defaultChromeGroups, b3 as defaultTableLabel, b4 as emuToOverlayPoints, b5 as equationAtPosition, b6 as executeImageCommand, b7 as finalizeImageOverlayInteraction, b8 as formattingBarChromeGroups, b9 as isChromePrintShortcut, ba as isStaleImageInteractionCommit, bb as isTableChromeSlot, bc as layoutPointsToCssPixels, bd as loadFonts, be as overlayFrameToSheetCssPixels, bf as overlayHostOrigin, bg as pointsToEmu, bh as probeTableChromeCommand, bi as resizePreservesAspect, bj as runChromeExport, bk as runChromePrint, bl as runSave, bm as runTableChromeCommand, bn as runTableCommand, bo as runToolbarCommand, bp as selectedDrawingOverlayTargetOf, bq as selectedImageStateOf, br as surfacePaintScale, bs as tableChromeIconPaths, bt as tableChromeLabelKeyForTarget, bu as tableChromeToolbarState, bv as tableChromeVisible, bw as tableCommandToolbarState, bx as toolbarCommandState, by as toolbarCommandStates } from './index-CkQVRJtJ.js';
|
|
14
|
+
import { a as AutomationCapabilities, b as AutomationHost } from './protocol-aKYr8r3u.js';
|
|
15
|
+
import { S as SemanticLayout } from './semantic-records-B9OolWGN.js';
|
|
16
|
+
export { T as TextMeasurer } from './semantic-records-B9OolWGN.js';
|
|
17
|
+
export { D as DEFAULT_REVISION_MARKUP, f as REVISION_MARKUP_COLORS, d as ResolvedRevisionMarkup, a as ReviewDisplayMode, g as RevisionChangedLinesMark, h as RevisionDeletionMark, i as RevisionMarkupChromeHandlers, j as RevisionMarkupColor, R as RevisionMarkupDialogSession, k as RevisionMarkupMark, l as RevisionMarkupNamedColor, e as RevisionMarkupOptions, m as RevisionMarkupStyle, n as RevisionMarkupTextStyle, r as resolveRevisionMarkup } from './revision-projection-CSNFudZY.js';
|
|
18
|
+
export { N as NavigationCommand, S as SemanticPosition, a as SemanticSelection } from './semantic-interaction-G0bjmmmk.js';
|
|
19
|
+
export { S as SectionProperties } from './semantic-cell-selection-DoqYCz_F.js';
|
|
20
|
+
export { F as FieldShadingMode, R as ReviewAuthorInfo, b as RevisionAuthorAssignments, c as RevisionAuthorStyle, d as RevisionStyles } from './semantic-paint-CsMzF8-O.js';
|
|
20
21
|
export { CollaborationModuleContribution } from './collaboration.js';
|
|
21
22
|
import './editor-scope-OHPwVQ5l.js';
|
|
22
|
-
import './
|
|
23
|
-
import './tree-package-fragment-YPyYC1aD.js';
|
|
23
|
+
import './tree-package-fragment-DYZIk1rY.js';
|
|
24
24
|
import './collaboration/replication.js';
|
|
25
25
|
import './failure-BIPVQbRm.js';
|
|
26
|
-
import './custom-node-writes-
|
|
27
|
-
import './headless-document-view-
|
|
26
|
+
import './custom-node-writes-Vzpq9I8_.js';
|
|
27
|
+
import './headless-document-view-ICYqNkQ1.js';
|
|
28
28
|
import 'prosemirror-model';
|
|
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-9zpIHWTE.js';
|
|
32
|
+
import './note-properties-CkAk7g-n.js';
|
|
33
|
+
import './omml-equation-DuczgG5o.js';
|
|
34
|
+
import './semantic-record-queries-1du6lQqS.js';
|
|
34
35
|
|
|
35
36
|
declare function toEditorFontError(error: unknown): EditorFontError;
|
|
36
37
|
declare function createLayoutShaping(configuration: FontConfiguration, instrumentation?: LayoutShapingInstrumentation): Promise<LayoutShapingOptions>;
|
|
@@ -709,7 +710,7 @@ declare function calendarDateFromText(text: string, locale?: string): string | n
|
|
|
709
710
|
declare function calendarMonthNames(locale?: string): readonly string[];
|
|
710
711
|
|
|
711
712
|
/** Shared focus and placement for engine and host value pop-ups. */
|
|
712
|
-
/** Place
|
|
713
|
+
/** Place a popup against an anchor, within the viewport or its visible sheet. @public */
|
|
713
714
|
declare function positionContentControlPopup(panel: HTMLElement, anchor: HTMLElement): void;
|
|
714
715
|
/** Follow scrolling, zoom, and size changes. Call the returned cleanup when the popup closes. @public */
|
|
715
716
|
declare function observeContentControlPopup(panel: HTMLElement, anchor: HTMLElement): () => void;
|
package/dist/editor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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,Mb as ChromeExportError,Ob as ChromePrintError,Y as DEFAULT_TABLE_CHROME_DRAFT,Db as DocumentRefreshError,Q as EMU_PER_POINT,$a as FIT_WIDTH_ZOOM_MODE,Fb as HIGHLIGHT_REFRESH_MS,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,Hb as SEARCH_DEBOUNCE_MS,Kb as SEARCH_HIGHLIGHT_PRIORITY,Jb as SEARCH_HIGHLIGHT_SET,Ib as SEARCH_MATCH_LIMIT,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,zb as alignmentAfterDirectionChange,ea as applyTableChromePick,y as applyThemeShade,x as applyThemeTint,Cb 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,Eb as createDocumentRefresh,Lb as createDocumentSearch,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,Va 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,Pb as isChromePrintShortcut,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,Nb as runChromeExport,Qb as runChromePrint,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,Wa 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,Bb as trapTabWithin,ob as twipsToInches,J as validateImageCropPercent,w as validateThemeModifier,Gb as watchHighlights,Ab as withTabStop}from'./chunk-
|
|
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,Mb as ChromeExportError,Ob as ChromePrintError,Y as DEFAULT_TABLE_CHROME_DRAFT,Db as DocumentRefreshError,Q as EMU_PER_POINT,$a as FIT_WIDTH_ZOOM_MODE,Fb as HIGHLIGHT_REFRESH_MS,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,Hb as SEARCH_DEBOUNCE_MS,Kb as SEARCH_HIGHLIGHT_PRIORITY,Jb as SEARCH_HIGHLIGHT_SET,Ib as SEARCH_MATCH_LIMIT,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,zb as alignmentAfterDirectionChange,ea as applyTableChromePick,y as applyThemeShade,x as applyThemeTint,Cb 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,Eb as createDocumentRefresh,Lb as createDocumentSearch,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,Va 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,Pb as isChromePrintShortcut,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,Nb as runChromeExport,Qb as runChromePrint,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,Wa 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,Bb as trapTabWithin,ob as twipsToInches,J as validateImageCropPercent,w as validateThemeModifier,Gb as watchHighlights,Ab as withTabStop}from'./chunk-UBLUVNZR.js';export{a as resolveEditorModules}from'./chunk-O5INAWZQ.js';import'./chunk-7IGCWG4H.js';export{d as DEFAULT_FONT,i as FONT_RESOLVER_BRAND,h as FONT_RESOLVER_MARK_KEY,c as MAX_RESOLVER_FAMILIES,e as WORD_DEFAULT_FONT,f as composeFontConfiguration,n as composeFontOrigins,j as defineFontResolver,k as isFontResolver}from'./chunk-IGR23DV2.js';export{r as disposeLayoutShaping}from'./chunk-JSIX2EOH.js';import'./chunk-RIYSCEFQ.js';import'./chunk-S74GRBNE.js';import'./chunk-KAXOGCGA.js';export{Sa as DEFAULT_REVISION_MARKUP,Ra as REVISION_MARKUP_COLORS,Ta as resolveRevisionMarkup}from'./chunk-VIPMGGUT.js';import'./chunk-7MYITTAH.js';import'./chunk-HAQ72KD7.js';import'./chunk-ZU7IVN6G.js';import'./chunk-6ZQMII6V.js';import'./chunk-GWQJ5774.js';import'./chunk-6JIJOZDW.js';import'./chunk-DNXVNQEO.js';export{m as DEFAULT_IMAGE_RESOURCE_LIMITS,Oj as DRAWING_REL_FROM_H,Pj as DRAWING_REL_FROM_V,pd as IMAGE_WRAP_TARGETS,wi as TEXT_FORM_FORMATS,Rj as positionInputFromPropertiesCommand,Qj as propertiesCommandHasPositionFields,n as resolveImageResourceLimits,Ud as resolveSvgIntrinsicSize,Qd as sniffImageMime,Nj as validateDrawingPositionInput,Vd as validateRasterHeader,Sj as validateSetImagePositionCommand}from'./chunk-UMRSBLO7.js';import'./chunk-S6J4O5XP.js';
|
package/dist/export.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var chunkLZDI4P6I_cjs=require('./chunk-LZDI4P6I.cjs'),chunkTKR2MXX4_cjs=require('./chunk-TKR2MXX4.cjs'),chunkJNTETUNZ_cjs=require('./chunk-JNTETUNZ.cjs'),chunkUJL2GDIM_cjs=require('./chunk-UJL2GDIM.cjs'),chunkAGKIHLWQ_cjs=require('./chunk-AGKIHLWQ.cjs');require('./chunk-CYT3OQFZ.cjs');var chunkSUN62YU6_cjs=require('./chunk-SUN62YU6.cjs'),chunkANZ44KQT_cjs=require('./chunk-ANZ44KQT.cjs');function _(e,o,t){if(o.environment.features.smcp!==1||!/\p{Ll}/u.test(o.text))return t;let n={...o,environment:{...o.environment,features:{...o.environment.features,smcp:0}}},r=e.shape(n);if(t.glyphs.length!==r.glyphs.length||t.glyphs.some((u,c)=>u.id!==r.glyphs[c]?.id))return t;let i=[],s=0;for(let u of o.text){let c=u.toUpperCase()!==u,y=i.at(-1);y&&(y.lower===c||/\p{M}/u.test(u))?y.text+=u:i.push({text:u,start:s,lower:c}),s+=u.length;}let a=[],p=[],l=[],d=true,g=0;for(let u of o.environment.direction==="rtl"?i.reverse():i){let c=u.lower?.8:1,y=[],R=[],b="",f=u.start;for(let F of u.text){let m=u.lower?F.toUpperCase():F;for(let E=0;E<m.length;E++)y.push(f),R.push(f+F.length);b+=m,f+=F.length;}let h=e.shape({...n,text:b}),x=a.length;for(let[F,m]of h.glyphs.entries()){let E=h.exactAdvancesX?.[F];E===void 0?d=false:l.push(E*c),a.push({...m,cluster:y[m.cluster]??u.start,originX:chunkUJL2GDIM_cjs.n(g+Math.round(m.originX*c)),originY:chunkUJL2GDIM_cjs.n(Math.round(m.originY*c)),offsetX:chunkUJL2GDIM_cjs.n(Math.round(m.offsetX*c)),offsetY:chunkUJL2GDIM_cjs.n(Math.round(m.offsetY*c)),advanceX:chunkUJL2GDIM_cjs.n(Math.round(m.advanceX*c)),advanceY:chunkUJL2GDIM_cjs.n(Math.round(m.advanceY*c)),drawScale:c});}for(let F of h.clusters){let m=y[F.textStart]??u.start,E=R[F.textEnd-1]??f,T=chunkUJL2GDIM_cjs.n(Math.round(F.advance*c)),A=p.at(-1);A&&A.textStart===m&&A.textEnd===E?p[p.length-1]={...A,glyphEnd:x+F.glyphEnd,advance:chunkUJL2GDIM_cjs.n(A.advance+T),caretEdges:[chunkUJL2GDIM_cjs.n(0),chunkUJL2GDIM_cjs.n(A.advance+T)]}:p.push({...F,textStart:m,textEnd:E,glyphStart:x+F.glyphStart,glyphEnd:x+F.glyphEnd,advance:T,caretEdges:F.caretEdges.map(G=>chunkUJL2GDIM_cjs.n(Math.round(G*c))),fontSpan:0});}g+=h.glyphs.reduce((F,m)=>F+Math.round(m.advanceX*c),0);}return {...t,glyphs:a,clusters:p,fontSpans:[{...t.fontSpans[0],glyphStart:0,glyphEnd:a.length}],exactAdvancesX:d&&l.length===a.length?l:void 0}}var st=new WeakMap;function Ut(e){let o=st.get(e);return o===void 0&&(o=zt(e.bytes,e.faceIndex),st.set(e,o)),o}var Bt=new Set(["COLR","CBDT","sbix"]),qt=512;function zt(e,o){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.byteLength<12)return false;let n=0;if(lt(e,0)==="ttcf"){let i=t.getUint32(8);if(o<0||o>=i||12+4*o+4>e.byteLength||(n=t.getUint32(12+4*o),n+12>e.byteLength))return false}let r=Math.min(t.getUint16(n+4),qt);for(let i=0;i<r;i++){let s=n+12+i*16;if(s+4>e.byteLength)return false;if(Bt.has(lt(e,s)))return true}return false}function lt(e,o){return String.fromCharCode(e[o],e[o+1],e[o+2],e[o+3])}var jt=/\p{Emoji_Presentation}|️/u;function Ht(e){return jt.test(e)}function q(e,o){if(e.length<2)return e;let t=e.filter(Ut);if(t.length===0||t.length===e.length)return e;let n=e.filter(r=>!t.includes(r));return Ht(o)?[...t,...n]:[...n,...t]}var Xt=2048;function dt(e,o,t,n){if(!t.clusters.length||t.clusters.length>Xt)return null;let r=(f,h)=>{let{context:x,...F}=o,m={...F,text:h,environment:chunkUJL2GDIM_cjs.p({...o.environment,font:f})};return _(e,m,e.shape(m))},i=[],s=new Map;for(let f of [...t.clusters].sort((h,x)=>h.textStart-x.textStart)){let h=o.environment.font,x=o.text.slice(f.textStart,f.textEnd),F=i.at(-1);if(/^[\uFE0E\uFE0F]$/.test(x)&&F&&F.end===f.textStart){F.end=f.textEnd;continue}if(o.environment.script==="Hebr"&&/^\s+$/u.test(x)&&F&&F.font!==o.environment.font&&F.end===f.textStart){F.end=f.textEnd;continue}if(t.glyphs.slice(f.glyphStart,f.glyphEnd).some(E=>E.id===0)){let E=o.text.slice(f.textStart,f.textEnd+1),T=s.get(x)??q(n,E).find(A=>{try{return !r(A,x).glyphs.some(G=>G.id===0)}catch{return false}});if(!T)return null;s.set(x,T),h=T;}let m=i.at(-1);m&&m.font===h&&m.end===f.textStart?m.end=f.textEnd:i.push({start:f.textStart,end:f.textEnd,font:h});}let a=[],p=[],l=[],d=[],g=true,u=0,c=0,y=0,R=0,b=0;for(let f of o.environment.direction==="rtl"?i.reverse():i){let h=r(f.font,o.text.slice(f.start,f.end));if(h.glyphs.some(m=>m.id===0))return null;let x=a.length,F=l.length;for(let m of h.glyphs)a.push({...m,cluster:f.start+m.cluster,originX:chunkUJL2GDIM_cjs.n(u+m.originX),originY:chunkUJL2GDIM_cjs.n(c+m.originY)});if(h.exactAdvancesX===void 0)g=false;else for(let m of h.exactAdvancesX)d.push(m);for(let m of h.clusters)p.push({...m,textStart:f.start+m.textStart,textEnd:f.start+m.textEnd,glyphStart:x+m.glyphStart,glyphEnd:x+m.glyphEnd,fontSpan:F});h.glyphs.length&&l.push({font:f.font,glyphStart:x,glyphEnd:a.length,fallbackIndex:f.font===o.environment.font?null:n.indexOf(f.font)}),u+=h.glyphs.reduce((m,E)=>m+E.advanceX,0),c+=h.glyphs.reduce((m,E)=>m+E.advanceY,0),y=Math.max(y,h.metrics.ascent),R=Math.max(R,h.metrics.descent),b=Math.max(b,h.metrics.lineGap);}return chunkUJL2GDIM_cjs.s({...t,glyphs:a,clusters:p,fontSpans:l,exactAdvancesX:g&&d.length===a.length?d:void 0,metrics:{ascent:chunkUJL2GDIM_cjs.n(y),descent:chunkUJL2GDIM_cjs.n(R),lineGap:chunkUJL2GDIM_cjs.n(b)}},{...o.environment,fallbackOrder:n})}var Gt=new Map([["Beng",["bng2","beng"]],["Deva",["dev2","deva"]],["Gujr",["gjr2","gujr"]],["Guru",["gur2","guru"]],["Knda",["knd2","knda"]],["Mlym",["mlm2","mlym"]],["Orya",["ory2","orya"]],["Taml",["tml2","taml"]],["Telu",["tel2","telu"]],["Nkoo",["nko "]]]),Vt=512,ut=new WeakMap;function Wt(e,o){let t=new Set,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=c=>c+2<=n.byteLength?n.getUint16(c):-1,i=c=>c+4<=n.byteLength?n.getUint32(c):-1,s=c=>c+4<=n.byteLength?String.fromCharCode(n.getUint8(c),n.getUint8(c+1),n.getUint8(c+2),n.getUint8(c+3)):"",a=0;if(s(0)==="ttcf"){let c=i(8);if(c<0||o<0||o>=c||(a=i(12+o*4),a<0))return t}let p=r(a+4);if(p<0||p>1024)return t;let l=-1;for(let c=0;c<p;c+=1){let y=a+12+c*16;if(s(y)==="GSUB"){l=i(y+8);break}}if(l<0)return t;let d=r(l+4);if(d<=0)return t;let g=l+d,u=r(g);if(u<0)return t;for(let c=0;c<Math.min(u,Vt);c+=1){let y=s(g+2+c*6);y&&t.add(y);}return t}function Yt(e,o){let t=ut.get(e);return t||(t=Wt(e.bytes,e.faceIndex),ut.set(e,t)),(Gt.get(o)??[o.toLowerCase()]).some(r=>t.has(r))}function ct(e,o){let t=e.filter(n=>Yt(n,o));return t.length===0||t.length===e.length?e:[...t,...e.filter(n=>!t.includes(n))]}function J(e,o,t){if(!o.text.includes("\u2011"))return t;let n=new Set(t.glyphs.filter(i=>i.id===0).map(i=>i.cluster));if(!n.size)return t;let r=o.text.replace(/\u2011/g,(i,s)=>n.has(s)?"-":i);if(r===o.text)return t;try{let i=e.shape({...o,text:r});return chunkUJL2GDIM_cjs.s({...i,text:o.text},o.environment)}catch{return t}}function pt(e,o){if(o.length===0)return e;if(o.length>16)throw new RangeError("At most 16 glyph fallback faces are supported");let t=o.map(a=>e.fonts.resolve(a)).filter(a=>!(a instanceof chunkUJL2GDIM_cjs.d)),n={shape(a){return J(e.shaper,a,e.shaper.shape(a))}},r=new WeakMap,i={shape(a){let p=e.shaper.shape(a),l=r.get(p);if(l&&l.input.text===a.text&&l.input.fontSizeHalfPoints===a.fontSizeHalfPoints&&l.input.bidiLevel===a.bidiLevel&&l.input.context?.before===a.context?.before&&l.input.context?.after===a.context?.after&&l.input.environment===a.environment)return l.run;let d=s(a,J(e.shaper,a,p));return r.set(p,{input:a,run:d}),d}},s=(a,p)=>{let l=_(n,a,p);if(!l.glyphs.some(d=>d.id===0)||/^[\t\n\r\f]*$/.test(a.text))return l;if(/^(Latn|Cyrl|Grek|Hebr|Hani|Hira|Kana|Hang|Zyyy|Zinh)$/.test(a.environment.script)){let d=dt(n,a,l,t);if(d)return d}for(let d of ct(q(t,a.text),a.environment.script))if(!(d.hash===a.environment.font.hash&&d.faceIndex===a.environment.font.faceIndex))try{let g={...a,environment:chunkUJL2GDIM_cjs.p({...a.environment,font:d})},u=_(n,g,n.shape(g));if(!u.glyphs.some(c=>c.id===0))return u}catch{}return l};return {...e,shaper:i}}var Q=chunkUJL2GDIM_cjs.b;function ee(e){return typeof e.admittedFontFace=="function"}var $t=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function z(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var ft=new WeakMap;function j(e){let o=ft.get(e);return o||ft.set(e,o=Kt(e)),o}function Kt(e){let o=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:z(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:o?Object.freeze({requested:z(o.requested),resolved:z(o.resolved),...o.lineMetrics?{lineMetrics:Object.freeze({...o.lineMetrics})}:{}}):null})}function Zt(e){return Object.freeze({...j(e),bytes:chunkUJL2GDIM_cjs.i(e)})}function Jt(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof chunkUJL2GDIM_cjs.d?null:Zt(t)}catch{return null}}function mt(e){return o=>{if(e.status()!=="active")throw e.unavailable();return Jt(e.resolve(),o)}}function Qt(e){return Object.freeze(e.slice(0,Q).map(o=>Object.freeze({request:z(o.request),partName:o.partName,reason:o.reason})))}function te(e,o,t,n,r=[]){let i=new Map;for(let a of [...e,o]){let p=a.toLowerCase();i.has(p)||i.set(p,a);}let s=[...i.values()].map(a=>{let p=[];for(let l of $t){let d=n?.({family:a,...l});!d||d instanceof chunkUJL2GDIM_cjs.d||p.push(Object.freeze({...l,sourceFamily:d.family,via:d.substitution?"substitution":"direct",identity:d.identity,id:d.id,hash:d.hash,faceIndex:d.faceIndex,substitution:d.substitution}));}return Object.freeze({family:a,coverage:p.length===4?"complete":p.length>0?"partial":"none",faces:Object.freeze(p)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(s),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:Qt(r)})}function oe(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 ne(e,o,t=[]){let n=l=>l.trim().toLowerCase(),r=new Set([...e.requestedFamilies,e.defaultFamily].map(n)),i=new Set(t.map(l=>n(l.family))),s=l=>{if(!(l instanceof chunkLZDI4P6I_cjs.l))return true;let d=n(l.request.family);return r.has(d)||!i.has(d)},a=e.originFailures.some(({cause:l})=>l instanceof chunkLZDI4P6I_cjs.m?l.causes.length===0||l.causes.some(s):s(l));if(o.fontPolicy!=="strict"||!a&&e.families.every(l=>l.coverage==="complete"))return;let p=e.families.filter(l=>l.coverage!=="complete").map(l=>l.family).join(", ");throw new chunkJNTETUNZ_cjs.d("layoutFailed",`Strict font policy refused export${p?`; incomplete families: ${p}`:"; a font origin failed"}`)}function H(){return new Map}function re(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=chunkUJL2GDIM_cjs.h(r),s=o.get(i);if(!s){try{s=e.fonts.resolve(r);}catch{return null}o.set(i,s);}return s instanceof chunkUJL2GDIM_cjs.d?null:s}function yt(e,o,t){let n=t.fontFamily??e.defaultFont.family;return re(e,o,n,t)}function ie(e){return typeof e.shapeLaidOutText=="function"}function ae(e){let o=H(),t=new WeakMap;return n=>{let r=chunkUJL2GDIM_cjs.ra(n.style,n.fontSlot),i=chunkUJL2GDIM_cjs.cc(n)?chunkUJL2GDIM_cjs.dc(n):chunkUJL2GDIM_cjs._(n.text,r);if(i.length===0)return null;let s=r.fontFamily??e.defaultFont.family,a=re(e,o,s,r);if(!a)return null;try{if(r.smallCaps&&!chunkTKR2MXX4_cjs.$(e.shaper,e.environment,a,r,t))return null;let p=chunkTKR2MXX4_cjs._(e.shaper,e.environment,a,r,i);return Object.freeze({run:p,font:j(p.fontSpans[0]?.font??a),...p.fontSpans.length>1?{fonts:Object.freeze(p.fontSpans.map(l=>j(l.font)))}:{},fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function ht(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var N=new Map,X=new WeakMap,se=0,M,le=32,gt=chunkUJL2GDIM_cjs.c;function xt(){if(M)return M;let e=(async()=>(await chunkTKR2MXX4_cjs.d(),chunkTKR2MXX4_cjs.h(chunkTKR2MXX4_cjs.i)))();return M=e,e.catch(()=>{M===e&&(M=void 0);}),e}function Ft(e){let o=H();return chunkTKR2MXX4_cjs.ba(e,{resolveFont(t){return yt(e,o,t)},fallback:chunkUJL2GDIM_cjs.ea()})}async function Et(e,o,t=[],n=false){if(!chunkTKR2MXX4_cjs.k(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let r=await xt(),i=pt(await chunkTKR2MXX4_cjs.r(e,r,chunkTKR2MXX4_cjs.i,o,n),t);return Object.freeze({createMeasurer:()=>Ft(i),resolveFont:s=>i.fonts.resolve(s),shapeLaidOutText:ae(i),producer:["node-export-session",JSON.stringify(t),e.fingerprint,i.operation.shapingHash,`producer:${i.operation.producerVersion}`,`fallback:${chunkUJL2GDIM_cjs.da}`].join("|"),extensionFingerprint:e.fingerprint})}function eo(e,o){if(!chunkTKR2MXX4_cjs.k(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let t=X.get(e);if(t)return t;let n=chunkTKR2MXX4_cjs.m(e),r=N.get(n);if(!r){if(N.size>=le)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${le} process-wide configurations`));r=(async()=>{let p=chunkTKR2MXX4_cjs.l(e).sources.reduce((d,g)=>d+(g.availability==="forbidden"?0:g.bytes.byteLength),0);if(se+p>gt)throw new RangeError(`Shared exporter shaping font bytes are limited to ${gt} process-wide`);se+=p;let l;try{let d=await xt();l=await chunkTKR2MXX4_cjs.r(e,d,chunkTKR2MXX4_cjs.i,o);}catch(d){throw se-=p,d}return Object.freeze({createMeasurer:()=>Ft(l),shapeLaidOutText:ae(l),shapingHash:l.operation.shapingHash,producerVersion:l.operation.producerVersion})})(),N.set(n,r),r.catch(()=>{N.get(n)===r&&N.delete(n);});}let i=e.fingerprint,s=r.then(a=>Object.freeze({createMeasurer:a.createMeasurer,shapeLaidOutText:a.shapeLaidOutText,producer:["node-export",i,a.shapingHash,`producer:${a.producerVersion}`,`fallback:${chunkUJL2GDIM_cjs.da}`].join("|"),extensionFingerprint:i}));return X.set(e,s),s.catch(()=>{X.get(e)===s&&X.delete(e);}),s}var to="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function oo(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(r=>r.type===to),n;if(t){let r=chunkANZ44KQT_cjs.E(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),chunkANZ44KQT_cjs.Se(o,n)}function bt(e,o){let t=oo(e);if(t.length!==0)return chunkLZDI4P6I_cjs.j(n=>{let r=new Set((n.resolvedFaces??[]).map(s=>chunkUJL2GDIM_cjs.h(s))),i=chunkLZDI4P6I_cjs.r(t,{maxFontBytes:chunkUJL2GDIM_cjs.a,aggregateBudget:no(n),shadowedRequests:r});if(o)for(let s of i.dropped){if(o.dropped.length>=Q)break;o.dropped.push(s);}return {sources:i.sources}})}function no(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?chunkUJL2GDIM_cjs.c:Math.max(0,chunkUJL2GDIM_cjs.c-o)}function ro(e){return ee(e)&&ie(e)}var w=0,Rt=Symbol("font-resolution-timeout");function io(e){let o=0,t=false;return e?.(w),{reserve:r=>{if(t)throw new Error("Document font-byte lease is already released");if(w+r>chunkUJL2GDIM_cjs.c)throw new chunkJNTETUNZ_cjs.d("layoutFailed",`Active document export font bytes are limited to ${chunkUJL2GDIM_cjs.c}; requested ${r} bytes with ${w} bytes already active`);w+=r,o+=r,e?.(w);let i=false;return ()=>{i||t||(i=true,w-=r,o-=r,e?.(w));}},release:()=>{t||(t=true,w-=o,o=0,e?.(w));}}}function ue(e,o){return e.attributes.find(t=>t.localName===o)?.value}function ao(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===chunkANZ44KQT_cjs.fa||t.namespaceUri===""))?.value}async function so(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=chunkSUN62YU6_cjs.ab(e);if(!t.ok)return t;let{fonts:n,lastResortFonts:r,fontResolutionTimeoutMs:i,fontPolicy:s,onFontResolution:a,glyphFallbacks:p,documentLigatures:l,...d}=o,g=Array.isArray(n)?n:[n],u=r===void 0?[]:Array.isArray(r)?r:[r],c,y;try{y=await lo(t.view,g,{signal:o.signal,timeoutMs:i??o.resourceTimeoutMs,fontPolicy:s,glyphFallbacks:p,documentLigatures:l,lastResortFonts:u,onFontResolution:E=>(c=E,a?.(E))});}catch(E){if(E instanceof chunkJNTETUNZ_cjs.d&&E.code==="aborted")return {ok:false,reason:"aborted"};throw E}if(!c)throw y?.dispose(),new chunkJNTETUNZ_cjs.d("layoutFailed","Document font resolution completed without publishing its evidence");let R;try{R=chunkJNTETUNZ_cjs.e(t.view,{...d,reuseAcrossRevisions:!1,...y?{measurer:y.createMeasurer(),producer:o.producer??y.producer}:o.producer?{producer:o.producer}:{}});}catch(E){throw y?.dispose(),E}if(!R.ok)return y?.dispose(),R;let b=R.session,f=y,h="active",x=()=>h==="aborted"?new chunkJNTETUNZ_cjs.d("aborted","Export resource settlement was aborted"):new chunkJNTETUNZ_cjs.d("disposed","Export session has been disposed"),F=E=>{if(h==="active"){h=E,o.signal?.removeEventListener("abort",m);try{b.dispose();}finally{f?.dispose(),f=void 0;}}},m=()=>F("aborted");return o.signal?.addEventListener("abort",m,{once:true}),o.signal?.aborted&&m(),{ok:true,session:Object.freeze({fontResolution:c,layout:()=>h==="active"?b.layout():Promise.reject(x()),layoutFor:E=>h==="active"?b.layoutFor(E):Promise.reject(x()),validatedImageBytes:E=>h==="active"?b.validatedImageBytes(E):null,admittedFontFace:mt({status:()=>h,unavailable:x,resolve:()=>f?.resolveFont}),shapeLaidOutText:ht({status:()=>h,unavailable:x,shaping:()=>f}),dispose:()=>F("disposed")})}}async function lo(e,o,t={}){if((t.glyphFallbacks?.length??0)>16)throw new RangeError("At most 16 glyph fallback faces are supported");let n=uo(t.timeoutMs),r=new AbortController,i=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",i,{once:true}),t.signal?.aborted&&i();let s=setTimeout(()=>r.abort(Rt),n);try{de(r.signal);let a=(async()=>{let p=io(t.onActiveFontBytesChange),l=!1;try{let d=po(e).slice(0,chunkLZDI4P6I_cjs.c),g=[],u={dropped:[]},c=bt(e,u),y=[...o,...c?[c]:[],...t.lastResortFonts??[]],R=await chunkLZDI4P6I_cjs.o(y,{families:[...new Set([...(t.glyphFallbacks??[]).map(x=>x.family),...d])].slice(0,chunkLZDI4P6I_cjs.c),defaultFamily:chunkLZDI4P6I_cjs.d.family,signal:r.signal},{onOriginFailure:x=>g.push(x),reserveOwnedBytes:p.reserve,maxExecutionFontBytes:chunkTKR2MXX4_cjs.i.maxFontBytes});de(r.signal);let b=chunkLZDI4P6I_cjs.f(R??{});if(b.sources.length===0){let x=te(d,b.defaultFont.family,g,void 0,u.dropped);oe(x,t),ne(x,t,t.glyphFallbacks);return}let f=await Et(chunkTKR2MXX4_cjs.o(b),void 0,t.glyphFallbacks,t.documentLigatures);de(r.signal);let h=te(d,b.defaultFont.family,g,f.resolveFont,u.dropped);return oe(h,t),ne(h,t,t.glyphFallbacks),l=!0,Object.freeze({...f,dispose:p.release})}finally{l||p.release();}})();return await Promise.race([a,co(r.signal)])}finally{clearTimeout(s),t.signal?.removeEventListener("abort",i);}}function uo(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 co(e){return new Promise((o,t)=>{let n=()=>{t(St(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function St(e){let o=e.reason===Rt;return new chunkJNTETUNZ_cjs.d(o?"timedOut":"aborted",o?"Font resolution timed out":"Font resolution was aborted",o?void 0:{cause:e.reason})}function de(e){if(e.aborted)throw St(e)}function po(e){let o=[e.part().root],t=[],n=[],r=new Set([e.part().name]),i=(d,g)=>{!g||r.has(g.name)||(r.add(g.name),d.push(g.root));};for(let d of e.headerFooterPartsBySection()){for(let g of d.headers.values())i(t,g);for(let g of d.footers.values())i(t,g);}for(let d of ["footnote","endnote"])n.push(...fo(e,d));let s=e.documentThemeFonts(),a={...s,major:s.major,minor:s.minor,majorEastAsia:s.majorEastAsia??null,minorEastAsia:s.minorEastAsia??null},p=new Map,l=(d,g)=>{let u=chunkAGKIHLWQ_cjs.d(d,e.stylesRoot(),a,yo(d,g)),c=chunkLZDI4P6I_cjs.y(d,e.numberingRoot(),e.stylesRoot(),a);for(let y of [...u.direct,...xo(d),...c,...chunkLZDI4P6I_cjs.v(d,e.stylesRoot(),a),...u.inherited]){let R=y.toLowerCase();p.has(R)||p.set(R,y);}};return l(o,"body"),l(t,"furniture"),l(n,"note"),[...p.values()]}function fo(e,o){let t=chunkANZ44KQT_cjs.Ig(e.currentPackage(),o);if(!t)return [];let n=new Set(chunkANZ44KQT_cjs.Jg(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 s=chunkANZ44KQT_cjs.kc(i),a=chunkANZ44KQT_cjs.jc(i);(s==="separator"||s==="continuationSeparator"||a!==null&&n.has(a))&&r.push(i);}return r}var mo="http://schemas.openxmlformats.org/officeDocument/2006/math";function yo(e,o){let t=new Set;for(let n of e){let r=[],i=[{node:n,context:o}];for(;i.length>0;){let{node:s,context:a}=i.pop();s.namespaceUri===chunkANZ44KQT_cjs.fa&&s.localName==="p"&&r.push({paragraph:s,context:a});let p=s.namespaceUri===chunkANZ44KQT_cjs.fa&&s.localName==="txbxContent"&&(a==="body"||a==="note")?"detached":a;for(let l=s.children.length-1;l>=0;l-=1){let d=s.children[l];d.kind!=="textValue"&&i.push({node:d,context:p});}}for(let s of r)ho(s.paragraph,t,s.context);}return t}function ho(e,o,t){let n=chunkUJL2GDIM_cjs.ib(),r=null,i=null,s="",a=false,p=false,l=false,d=0,g=[];for(let u=e.children.length-1;u>=0;u-=1){let c=e.children[u];c.kind!=="textValue"&&g.push({node:c,runId:null,visibility:D,containerDepth:0});}for(;g.length>0;){let{node:u,runId:c,visibility:y,containerDepth:R}=g.pop();if(R>=chunkANZ44KQT_cjs.oa||u.namespaceUri===chunkANZ44KQT_cjs.fa&&u.localName==="p")continue;let b=u.namespaceUri===chunkANZ44KQT_cjs.fa&&u.localName==="r"?u.id:c;if(u.namespaceUri===chunkANZ44KQT_cjs.fa&&u.localName==="fldSimple"){let f=ue(u,"instr")??"";chunkUJL2GDIM_cjs.dd(f,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&go(u)!==D&&o.add(u.id);}if(u.namespaceUri===chunkANZ44KQT_cjs.fa&&u.localName==="fldChar"){let f=ue(u,"fldCharType");if(f==="begin")chunkUJL2GDIM_cjs.lb(n),n.nesting===1&&(r=b,i=null,s="",a=false,p=false,l=chunkANZ44KQT_cjs.ff(u),d=0);else if(f==="separate"){let h=n.nesting===1;if(chunkUJL2GDIM_cjs.nb(n),h){let x=chunkUJL2GDIM_cjs.kb(n);s=x.instruction,a=x.overflow||n.nestingOverflow,i=b,p=true;}}else if(f==="end"){if(n.nesting===1){if(n.phase==="instruction"){let x=chunkUJL2GDIM_cjs.kb(n);s=x.instruction,a=x.overflow||n.nestingOverflow;}if(!a&&chunkUJL2GDIM_cjs.cd(s,{hasSeparate:p,hasLegacyFormData:l,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&d!==D){let x=i??r;x&&o.add(x);}}chunkUJL2GDIM_cjs.ob(n);}continue}if(u.namespaceUri===chunkANZ44KQT_cjs.fa&&(u.localName==="instrText"||u.localName==="delInstrText")){chunkUJL2GDIM_cjs.mb(n,Lt(u),u.localName==="delInstrText");continue}n.nesting>0&&chunkUJL2GDIM_cjs.pb(n)&&u.namespaceUri===chunkANZ44KQT_cjs.fa&&Ot(u)&&(d|=y);for(let f=u.children.length-1;f>=0;f-=1){let h=u.children[f];h.kind!=="textValue"&&g.push({node:h,runId:b,visibility:y&At(u),containerDepth:chunkANZ44KQT_cjs.pa(u,R)});}}chunkUJL2GDIM_cjs.jb(n);}function Ot(e){return e.localName==="t"||e.localName==="delText"?Lt(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var ce=1,vt=2,wt=4,D=ce|vt|wt;function go(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:D});let t=0;for(;o.length>0;){let{node:n,visibility:r}=o.pop();if(!(n.namespaceUri===chunkANZ44KQT_cjs.fa&&n.localName==="p")){if(n.namespaceUri===chunkANZ44KQT_cjs.fa&&Ot(n)&&(t|=r,t===D))return t;for(let i of n.children)i.kind!=="textValue"&&o.push({node:i,visibility:r&At(n)});}}return t}function At(e){return e.namespaceUri!==chunkANZ44KQT_cjs.fa?D:e.localName==="ins"||e.localName==="moveTo"?ce|vt:e.localName==="del"||e.localName==="moveFrom"?ce|wt:D}function xo(e){let o=new Map,t=n=>{let r=chunkAGKIHLWQ_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===mo&&t(chunkUJL2GDIM_cjs.ac),i.namespaceUri===chunkANZ44KQT_cjs.fa&&i.localName==="sym"&&t(chunkAGKIHLWQ_cjs.b(ao(i,"font"))),i.namespaceUri===chunkANZ44KQT_cjs.fa&&i.localName==="fldSimple"){let s=ue(i,"instr");t(chunkUJL2GDIM_cjs.Zc(s??"")?.font??null);}if(i.namespaceUri===chunkANZ44KQT_cjs.fa&&i.localName==="p")for(let s of chunkLZDI4P6I_cjs.x(i))t(s);for(let s=i.children.length-1;s>=0;s-=1){let a=i.children[s];a.kind!=="textValue"&&r.push(a);}}}return [...o.values()]}function Lt(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 Dt="FILE_TOO_LARGE",Tt=8;function Fo(e){return typeof e=="object"&&e!==null}function kt(e){if(!(!Fo(e)||typeof e.code!="string"))return e.code}function It(e){return e===""||e.toLowerCase()==="localhost"}function Eo(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function _t(e){let o=Eo(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 Nt(e){let o=_t(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function bo(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function Ro(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(!It(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=Nt(o.pathname);if(t===null||bo(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function So(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 Oo(e){let o=So(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>Tt)throw new TypeError(`trustedRoot must not exceed ${Tt} directories`);return o.map(Ro)}function vo(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>chunkUJL2GDIM_cjs.a)throw new TypeError(`maxBytes must not exceed ${chunkUJL2GDIM_cjs.a}`);return e}function wo(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!It(e.host))return null;let t=_t(e.pathname);if(t===null)return null;for(let n of o){let r=Nt(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 Ao(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 Lo(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function Pt(e,o,t){return e.some(n=>Lo(n,o,t))}async function To(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(r){if(kt(r)==="ENOENT")continue;throw r}return t}function Po(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:r,realpath:i},{constants:s},{fileURLToPath:a},p]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),l=e.map(y=>p.resolve(a(y.href))),d=p.resolve(a(typeof o=="string"?o:o.href));if(!Pt(l,d,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let g=typeof s.O_NOFOLLOW=="number"?s.O_RDONLY|s.O_NOFOLLOW:"r",u=await r(d,g),c=()=>{u.close();};t?.addEventListener("abort",c,{once:true});try{if(t?.aborted)throw t.reason;let y=await i(d);if(!Pt(await To(l,i),y,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let R=(await u.stat()).size;if(!Number.isSafeInteger(R)||R<0||R>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:Dt});let b=new Uint8Array(R),f=0;for(;f<b.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:h}=await u.read(b,f,b.byteLength-f,f);if(h===0)break;f+=h;}if(t?.aborted)throw t.reason;return f===b.byteLength?b:b.slice(0,f)}catch(y){throw t?.aborted?t.reason:y}finally{t?.removeEventListener("abort",c),await u.close().catch(()=>{});}}}function Do(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=Oo(e.trustedRoot),t=vo(e.maxBytes),n=e.read??Po(o),r=e.networkFetch??fetch;return(async(i,s)=>{let a=s?.signal;if(a?.aborted)throw a.reason;let p=Ao(i);if(p.protocol!=="file:")return r(p,s);let l=wo(p,o);if(!l)return new Response(null,{status:404});let d=a?new AbortController:void 0,g=()=>d?.abort(a?.reason);a?.addEventListener("abort",g,{once:true});let u;try{if(u=await n(l,{maxBytes:t,...d?{signal:d.signal}:{}}),a?.aborted)throw a.reason;if(u.byteLength>t)return new Response(null,{status:413})}catch(c){if(a?.aborted)throw a.reason;if(d?.signal.aborted)throw d.signal.reason??c;if(c instanceof DOMException&&c.name==="AbortError"||c instanceof Error&&c.name==="AbortError")throw c;let y=kt(c);if(y===Dt)return new Response(null,{status:413});if(y==="ENOENT"||y==="ENOTDIR"||y==="ELOOP")return new Response(null,{status:404});throw c}finally{a?.removeEventListener("abort",g);}return new Response(u,{status:200})})}
|
|
2
|
-
Object.defineProperty(exports,"ExportResourceError",{enumerable:true,get:function(){return
|
|
1
|
+
'use strict';var chunkOHAXVTWG_cjs=require('./chunk-OHAXVTWG.cjs'),chunkHO5XFO32_cjs=require('./chunk-HO5XFO32.cjs'),chunkWRLKVNNR_cjs=require('./chunk-WRLKVNNR.cjs'),chunk55AT3MOU_cjs=require('./chunk-55AT3MOU.cjs'),chunkLZLTN5A3_cjs=require('./chunk-LZLTN5A3.cjs');require('./chunk-K246T47S.cjs');var chunkAVKVRU7Z_cjs=require('./chunk-AVKVRU7Z.cjs'),chunk4KZ6L5YF_cjs=require('./chunk-4KZ6L5YF.cjs');function _(e,o,t){if(o.environment.features.smcp!==1||!/\p{Ll}/u.test(o.text))return t;let n={...o,environment:{...o.environment,features:{...o.environment.features,smcp:0}}},r=e.shape(n);if(t.glyphs.length!==r.glyphs.length||t.glyphs.some((u,c)=>u.id!==r.glyphs[c]?.id))return t;let i=[],s=0;for(let u of o.text){let c=u.toUpperCase()!==u,y=i.at(-1);y&&(y.lower===c||/\p{M}/u.test(u))?y.text+=u:i.push({text:u,start:s,lower:c}),s+=u.length;}let a=[],p=[],l=[],d=true,g=0;for(let u of o.environment.direction==="rtl"?i.reverse():i){let c=u.lower?.8:1,y=[],R=[],b="",f=u.start;for(let F of u.text){let m=u.lower?F.toUpperCase():F;for(let E=0;E<m.length;E++)y.push(f),R.push(f+F.length);b+=m,f+=F.length;}let h=e.shape({...n,text:b}),x=a.length;for(let[F,m]of h.glyphs.entries()){let E=h.exactAdvancesX?.[F];E===void 0?d=false:l.push(E*c),a.push({...m,cluster:y[m.cluster]??u.start,originX:chunk55AT3MOU_cjs.n(g+Math.round(m.originX*c)),originY:chunk55AT3MOU_cjs.n(Math.round(m.originY*c)),offsetX:chunk55AT3MOU_cjs.n(Math.round(m.offsetX*c)),offsetY:chunk55AT3MOU_cjs.n(Math.round(m.offsetY*c)),advanceX:chunk55AT3MOU_cjs.n(Math.round(m.advanceX*c)),advanceY:chunk55AT3MOU_cjs.n(Math.round(m.advanceY*c)),drawScale:c});}for(let F of h.clusters){let m=y[F.textStart]??u.start,E=R[F.textEnd-1]??f,T=chunk55AT3MOU_cjs.n(Math.round(F.advance*c)),A=p.at(-1);A&&A.textStart===m&&A.textEnd===E?p[p.length-1]={...A,glyphEnd:x+F.glyphEnd,advance:chunk55AT3MOU_cjs.n(A.advance+T),caretEdges:[chunk55AT3MOU_cjs.n(0),chunk55AT3MOU_cjs.n(A.advance+T)]}:p.push({...F,textStart:m,textEnd:E,glyphStart:x+F.glyphStart,glyphEnd:x+F.glyphEnd,advance:T,caretEdges:F.caretEdges.map(G=>chunk55AT3MOU_cjs.n(Math.round(G*c))),fontSpan:0});}g+=h.glyphs.reduce((F,m)=>F+Math.round(m.advanceX*c),0);}return {...t,glyphs:a,clusters:p,fontSpans:[{...t.fontSpans[0],glyphStart:0,glyphEnd:a.length}],exactAdvancesX:d&&l.length===a.length?l:void 0}}var st=new WeakMap;function Ut(e){let o=st.get(e);return o===void 0&&(o=zt(e.bytes,e.faceIndex),st.set(e,o)),o}var Bt=new Set(["COLR","CBDT","sbix"]),qt=512;function zt(e,o){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.byteLength<12)return false;let n=0;if(lt(e,0)==="ttcf"){let i=t.getUint32(8);if(o<0||o>=i||12+4*o+4>e.byteLength||(n=t.getUint32(12+4*o),n+12>e.byteLength))return false}let r=Math.min(t.getUint16(n+4),qt);for(let i=0;i<r;i++){let s=n+12+i*16;if(s+4>e.byteLength)return false;if(Bt.has(lt(e,s)))return true}return false}function lt(e,o){return String.fromCharCode(e[o],e[o+1],e[o+2],e[o+3])}var jt=/\p{Emoji_Presentation}|️/u;function Ht(e){return jt.test(e)}function q(e,o){if(e.length<2)return e;let t=e.filter(Ut);if(t.length===0||t.length===e.length)return e;let n=e.filter(r=>!t.includes(r));return Ht(o)?[...t,...n]:[...n,...t]}var Xt=2048;function dt(e,o,t,n){if(!t.clusters.length||t.clusters.length>Xt)return null;let r=(f,h)=>{let{context:x,...F}=o,m={...F,text:h,environment:chunk55AT3MOU_cjs.p({...o.environment,font:f})};return _(e,m,e.shape(m))},i=[],s=new Map;for(let f of [...t.clusters].sort((h,x)=>h.textStart-x.textStart)){let h=o.environment.font,x=o.text.slice(f.textStart,f.textEnd),F=i.at(-1);if(/^[\uFE0E\uFE0F]$/.test(x)&&F&&F.end===f.textStart){F.end=f.textEnd;continue}if(o.environment.script==="Hebr"&&/^\s+$/u.test(x)&&F&&F.font!==o.environment.font&&F.end===f.textStart){F.end=f.textEnd;continue}if(t.glyphs.slice(f.glyphStart,f.glyphEnd).some(E=>E.id===0)){let E=o.text.slice(f.textStart,f.textEnd+1),T=s.get(x)??q(n,E).find(A=>{try{return !r(A,x).glyphs.some(G=>G.id===0)}catch{return false}});if(!T)return null;s.set(x,T),h=T;}let m=i.at(-1);m&&m.font===h&&m.end===f.textStart?m.end=f.textEnd:i.push({start:f.textStart,end:f.textEnd,font:h});}let a=[],p=[],l=[],d=[],g=true,u=0,c=0,y=0,R=0,b=0;for(let f of o.environment.direction==="rtl"?i.reverse():i){let h=r(f.font,o.text.slice(f.start,f.end));if(h.glyphs.some(m=>m.id===0))return null;let x=a.length,F=l.length;for(let m of h.glyphs)a.push({...m,cluster:f.start+m.cluster,originX:chunk55AT3MOU_cjs.n(u+m.originX),originY:chunk55AT3MOU_cjs.n(c+m.originY)});if(h.exactAdvancesX===void 0)g=false;else for(let m of h.exactAdvancesX)d.push(m);for(let m of h.clusters)p.push({...m,textStart:f.start+m.textStart,textEnd:f.start+m.textEnd,glyphStart:x+m.glyphStart,glyphEnd:x+m.glyphEnd,fontSpan:F});h.glyphs.length&&l.push({font:f.font,glyphStart:x,glyphEnd:a.length,fallbackIndex:f.font===o.environment.font?null:n.indexOf(f.font)}),u+=h.glyphs.reduce((m,E)=>m+E.advanceX,0),c+=h.glyphs.reduce((m,E)=>m+E.advanceY,0),y=Math.max(y,h.metrics.ascent),R=Math.max(R,h.metrics.descent),b=Math.max(b,h.metrics.lineGap);}return chunk55AT3MOU_cjs.s({...t,glyphs:a,clusters:p,fontSpans:l,exactAdvancesX:g&&d.length===a.length?d:void 0,metrics:{ascent:chunk55AT3MOU_cjs.n(y),descent:chunk55AT3MOU_cjs.n(R),lineGap:chunk55AT3MOU_cjs.n(b)}},{...o.environment,fallbackOrder:n})}var Gt=new Map([["Beng",["bng2","beng"]],["Deva",["dev2","deva"]],["Gujr",["gjr2","gujr"]],["Guru",["gur2","guru"]],["Knda",["knd2","knda"]],["Mlym",["mlm2","mlym"]],["Orya",["ory2","orya"]],["Taml",["tml2","taml"]],["Telu",["tel2","telu"]],["Nkoo",["nko "]]]),Vt=512,ut=new WeakMap;function Wt(e,o){let t=new Set,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=c=>c+2<=n.byteLength?n.getUint16(c):-1,i=c=>c+4<=n.byteLength?n.getUint32(c):-1,s=c=>c+4<=n.byteLength?String.fromCharCode(n.getUint8(c),n.getUint8(c+1),n.getUint8(c+2),n.getUint8(c+3)):"",a=0;if(s(0)==="ttcf"){let c=i(8);if(c<0||o<0||o>=c||(a=i(12+o*4),a<0))return t}let p=r(a+4);if(p<0||p>1024)return t;let l=-1;for(let c=0;c<p;c+=1){let y=a+12+c*16;if(s(y)==="GSUB"){l=i(y+8);break}}if(l<0)return t;let d=r(l+4);if(d<=0)return t;let g=l+d,u=r(g);if(u<0)return t;for(let c=0;c<Math.min(u,Vt);c+=1){let y=s(g+2+c*6);y&&t.add(y);}return t}function Yt(e,o){let t=ut.get(e);return t||(t=Wt(e.bytes,e.faceIndex),ut.set(e,t)),(Gt.get(o)??[o.toLowerCase()]).some(r=>t.has(r))}function ct(e,o){let t=e.filter(n=>Yt(n,o));return t.length===0||t.length===e.length?e:[...t,...e.filter(n=>!t.includes(n))]}function J(e,o,t){if(!o.text.includes("\u2011"))return t;let n=new Set(t.glyphs.filter(i=>i.id===0).map(i=>i.cluster));if(!n.size)return t;let r=o.text.replace(/\u2011/g,(i,s)=>n.has(s)?"-":i);if(r===o.text)return t;try{let i=e.shape({...o,text:r});return chunk55AT3MOU_cjs.s({...i,text:o.text},o.environment)}catch{return t}}function pt(e,o){if(o.length===0)return e;if(o.length>16)throw new RangeError("At most 16 glyph fallback faces are supported");let t=o.map(a=>e.fonts.resolve(a)).filter(a=>!(a instanceof chunk55AT3MOU_cjs.d)),n={shape(a){return J(e.shaper,a,e.shaper.shape(a))}},r=new WeakMap,i={shape(a){let p=e.shaper.shape(a),l=r.get(p);if(l&&l.input.text===a.text&&l.input.fontSizeHalfPoints===a.fontSizeHalfPoints&&l.input.bidiLevel===a.bidiLevel&&l.input.context?.before===a.context?.before&&l.input.context?.after===a.context?.after&&l.input.environment===a.environment)return l.run;let d=s(a,J(e.shaper,a,p));return r.set(p,{input:a,run:d}),d}},s=(a,p)=>{let l=_(n,a,p);if(!l.glyphs.some(d=>d.id===0)||/^[\t\n\r\f]*$/.test(a.text))return l;if(/^(Latn|Cyrl|Grek|Hebr|Hani|Hira|Kana|Hang|Zyyy|Zinh)$/.test(a.environment.script)){let d=dt(n,a,l,t);if(d)return d}for(let d of ct(q(t,a.text),a.environment.script))if(!(d.hash===a.environment.font.hash&&d.faceIndex===a.environment.font.faceIndex))try{let g={...a,environment:chunk55AT3MOU_cjs.p({...a.environment,font:d})},u=_(n,g,n.shape(g));if(!u.glyphs.some(c=>c.id===0))return u}catch{}return l};return {...e,shaper:i}}var Q=chunk55AT3MOU_cjs.b;function ee(e){return typeof e.admittedFontFace=="function"}var $t=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function z(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var ft=new WeakMap;function j(e){let o=ft.get(e);return o||ft.set(e,o=Kt(e)),o}function Kt(e){let o=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:z(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:o?Object.freeze({requested:z(o.requested),resolved:z(o.resolved),...o.lineMetrics?{lineMetrics:Object.freeze({...o.lineMetrics})}:{}}):null})}function Zt(e){return Object.freeze({...j(e),bytes:chunk55AT3MOU_cjs.i(e)})}function Jt(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof chunk55AT3MOU_cjs.d?null:Zt(t)}catch{return null}}function mt(e){return o=>{if(e.status()!=="active")throw e.unavailable();return Jt(e.resolve(),o)}}function Qt(e){return Object.freeze(e.slice(0,Q).map(o=>Object.freeze({request:z(o.request),partName:o.partName,reason:o.reason})))}function te(e,o,t,n,r=[]){let i=new Map;for(let a of [...e,o]){let p=a.toLowerCase();i.has(p)||i.set(p,a);}let s=[...i.values()].map(a=>{let p=[];for(let l of $t){let d=n?.({family:a,...l});!d||d instanceof chunk55AT3MOU_cjs.d||p.push(Object.freeze({...l,sourceFamily:d.family,via:d.substitution?"substitution":"direct",identity:d.identity,id:d.id,hash:d.hash,faceIndex:d.faceIndex,substitution:d.substitution}));}return Object.freeze({family:a,coverage:p.length===4?"complete":p.length>0?"partial":"none",faces:Object.freeze(p)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(s),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:Qt(r)})}function oe(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 ne(e,o,t=[]){let n=l=>l.trim().toLowerCase(),r=new Set([...e.requestedFamilies,e.defaultFamily].map(n)),i=new Set(t.map(l=>n(l.family))),s=l=>{if(!(l instanceof chunkOHAXVTWG_cjs.l))return true;let d=n(l.request.family);return r.has(d)||!i.has(d)},a=e.originFailures.some(({cause:l})=>l instanceof chunkOHAXVTWG_cjs.m?l.causes.length===0||l.causes.some(s):s(l));if(o.fontPolicy!=="strict"||!a&&e.families.every(l=>l.coverage==="complete"))return;let p=e.families.filter(l=>l.coverage!=="complete").map(l=>l.family).join(", ");throw new chunkWRLKVNNR_cjs.d("layoutFailed",`Strict font policy refused export${p?`; incomplete families: ${p}`:"; a font origin failed"}`)}function H(){return new Map}function re(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=chunk55AT3MOU_cjs.h(r),s=o.get(i);if(!s){try{s=e.fonts.resolve(r);}catch{return null}o.set(i,s);}return s instanceof chunk55AT3MOU_cjs.d?null:s}function yt(e,o,t){let n=t.fontFamily??e.defaultFont.family;return re(e,o,n,t)}function ie(e){return typeof e.shapeLaidOutText=="function"}function ae(e){let o=H(),t=new WeakMap;return n=>{let r=chunk55AT3MOU_cjs.sa(n.style,n.fontSlot),i=chunk55AT3MOU_cjs.ic(n)?chunk55AT3MOU_cjs.jc(n):chunk55AT3MOU_cjs.$(n.text,r);if(i.length===0)return null;let s=r.fontFamily??e.defaultFont.family,a=re(e,o,s,r);if(!a)return null;try{if(r.smallCaps&&!chunkHO5XFO32_cjs.$(e.shaper,e.environment,a,r,t))return null;let p=chunkHO5XFO32_cjs._(e.shaper,e.environment,a,r,i);return Object.freeze({run:p,font:j(p.fontSpans[0]?.font??a),...p.fontSpans.length>1?{fonts:Object.freeze(p.fontSpans.map(l=>j(l.font)))}:{},fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function ht(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var N=new Map,X=new WeakMap,se=0,M,le=32,gt=chunk55AT3MOU_cjs.c;function xt(){if(M)return M;let e=(async()=>(await chunkHO5XFO32_cjs.d(),chunkHO5XFO32_cjs.h(chunkHO5XFO32_cjs.i)))();return M=e,e.catch(()=>{M===e&&(M=void 0);}),e}function Ft(e){let o=H();return chunkHO5XFO32_cjs.ba(e,{resolveFont(t){return yt(e,o,t)},fallback:chunk55AT3MOU_cjs.fa()})}async function Et(e,o,t=[],n=false){if(!chunkHO5XFO32_cjs.k(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let r=await xt(),i=pt(await chunkHO5XFO32_cjs.r(e,r,chunkHO5XFO32_cjs.i,o,n),t);return Object.freeze({createMeasurer:()=>Ft(i),resolveFont:s=>i.fonts.resolve(s),shapeLaidOutText:ae(i),producer:["node-export-session",JSON.stringify(t),e.fingerprint,i.operation.shapingHash,`producer:${i.operation.producerVersion}`,`fallback:${chunk55AT3MOU_cjs.ea}`].join("|"),extensionFingerprint:e.fingerprint})}function eo(e,o){if(!chunkHO5XFO32_cjs.k(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let t=X.get(e);if(t)return t;let n=chunkHO5XFO32_cjs.m(e),r=N.get(n);if(!r){if(N.size>=le)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${le} process-wide configurations`));r=(async()=>{let p=chunkHO5XFO32_cjs.l(e).sources.reduce((d,g)=>d+(g.availability==="forbidden"?0:g.bytes.byteLength),0);if(se+p>gt)throw new RangeError(`Shared exporter shaping font bytes are limited to ${gt} process-wide`);se+=p;let l;try{let d=await xt();l=await chunkHO5XFO32_cjs.r(e,d,chunkHO5XFO32_cjs.i,o);}catch(d){throw se-=p,d}return Object.freeze({createMeasurer:()=>Ft(l),shapeLaidOutText:ae(l),shapingHash:l.operation.shapingHash,producerVersion:l.operation.producerVersion})})(),N.set(n,r),r.catch(()=>{N.get(n)===r&&N.delete(n);});}let i=e.fingerprint,s=r.then(a=>Object.freeze({createMeasurer:a.createMeasurer,shapeLaidOutText:a.shapeLaidOutText,producer:["node-export",i,a.shapingHash,`producer:${a.producerVersion}`,`fallback:${chunk55AT3MOU_cjs.ea}`].join("|"),extensionFingerprint:i}));return X.set(e,s),s.catch(()=>{X.get(e)===s&&X.delete(e);}),s}var to="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function oo(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(r=>r.type===to),n;if(t){let r=chunk4KZ6L5YF_cjs.E(t);r.mode==="Internal"&&r.target.ok&&(n=o.parts.get(r.target.partName));}return n??=o.parts.get("/word/fontTable.xml"),chunk4KZ6L5YF_cjs.Ue(o,n)}function bt(e,o){let t=oo(e);if(t.length!==0)return chunkOHAXVTWG_cjs.j(n=>{let r=new Set((n.resolvedFaces??[]).map(s=>chunk55AT3MOU_cjs.h(s))),i=chunkOHAXVTWG_cjs.r(t,{maxFontBytes:chunk55AT3MOU_cjs.a,aggregateBudget:no(n),shadowedRequests:r});if(o)for(let s of i.dropped){if(o.dropped.length>=Q)break;o.dropped.push(s);}return {sources:i.sources}})}function no(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?chunk55AT3MOU_cjs.c:Math.max(0,chunk55AT3MOU_cjs.c-o)}function ro(e){return ee(e)&&ie(e)}var w=0,Rt=Symbol("font-resolution-timeout");function io(e){let o=0,t=false;return e?.(w),{reserve:r=>{if(t)throw new Error("Document font-byte lease is already released");if(w+r>chunk55AT3MOU_cjs.c)throw new chunkWRLKVNNR_cjs.d("layoutFailed",`Active document export font bytes are limited to ${chunk55AT3MOU_cjs.c}; requested ${r} bytes with ${w} bytes already active`);w+=r,o+=r,e?.(w);let i=false;return ()=>{i||t||(i=true,w-=r,o-=r,e?.(w));}},release:()=>{t||(t=true,w-=o,o=0,e?.(w));}}}function ue(e,o){return e.attributes.find(t=>t.localName===o)?.value}function ao(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===chunk4KZ6L5YF_cjs.fa||t.namespaceUri===""))?.value}async function so(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=chunkAVKVRU7Z_cjs.ab(e);if(!t.ok)return t;let{fonts:n,lastResortFonts:r,fontResolutionTimeoutMs:i,fontPolicy:s,onFontResolution:a,glyphFallbacks:p,documentLigatures:l,...d}=o,g=Array.isArray(n)?n:[n],u=r===void 0?[]:Array.isArray(r)?r:[r],c,y;try{y=await lo(t.view,g,{signal:o.signal,timeoutMs:i??o.resourceTimeoutMs,fontPolicy:s,glyphFallbacks:p,documentLigatures:l,lastResortFonts:u,onFontResolution:E=>(c=E,a?.(E))});}catch(E){if(E instanceof chunkWRLKVNNR_cjs.d&&E.code==="aborted")return {ok:false,reason:"aborted"};throw E}if(!c)throw y?.dispose(),new chunkWRLKVNNR_cjs.d("layoutFailed","Document font resolution completed without publishing its evidence");let R;try{R=chunkWRLKVNNR_cjs.e(t.view,{...d,reuseAcrossRevisions:!1,...y?{measurer:y.createMeasurer(),producer:o.producer??y.producer}:o.producer?{producer:o.producer}:{}});}catch(E){throw y?.dispose(),E}if(!R.ok)return y?.dispose(),R;let b=R.session,f=y,h="active",x=()=>h==="aborted"?new chunkWRLKVNNR_cjs.d("aborted","Export resource settlement was aborted"):new chunkWRLKVNNR_cjs.d("disposed","Export session has been disposed"),F=E=>{if(h==="active"){h=E,o.signal?.removeEventListener("abort",m);try{b.dispose();}finally{f?.dispose(),f=void 0;}}},m=()=>F("aborted");return o.signal?.addEventListener("abort",m,{once:true}),o.signal?.aborted&&m(),{ok:true,session:Object.freeze({fontResolution:c,layout:()=>h==="active"?b.layout():Promise.reject(x()),layoutFor:E=>h==="active"?b.layoutFor(E):Promise.reject(x()),validatedImageBytes:E=>h==="active"?b.validatedImageBytes(E):null,admittedFontFace:mt({status:()=>h,unavailable:x,resolve:()=>f?.resolveFont}),shapeLaidOutText:ht({status:()=>h,unavailable:x,shaping:()=>f}),dispose:()=>F("disposed")})}}async function lo(e,o,t={}){if((t.glyphFallbacks?.length??0)>16)throw new RangeError("At most 16 glyph fallback faces are supported");let n=uo(t.timeoutMs),r=new AbortController,i=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",i,{once:true}),t.signal?.aborted&&i();let s=setTimeout(()=>r.abort(Rt),n);try{de(r.signal);let a=(async()=>{let p=io(t.onActiveFontBytesChange),l=!1;try{let d=po(e).slice(0,chunkOHAXVTWG_cjs.c),g=[],u={dropped:[]},c=bt(e,u),y=[...o,...c?[c]:[],...t.lastResortFonts??[]],R=await chunkOHAXVTWG_cjs.o(y,{families:[...new Set([...(t.glyphFallbacks??[]).map(x=>x.family),...d])].slice(0,chunkOHAXVTWG_cjs.c),defaultFamily:chunkOHAXVTWG_cjs.d.family,signal:r.signal},{onOriginFailure:x=>g.push(x),reserveOwnedBytes:p.reserve,maxExecutionFontBytes:chunkHO5XFO32_cjs.i.maxFontBytes});de(r.signal);let b=chunkOHAXVTWG_cjs.f(R??{});if(b.sources.length===0){let x=te(d,b.defaultFont.family,g,void 0,u.dropped);oe(x,t),ne(x,t,t.glyphFallbacks);return}let f=await Et(chunkHO5XFO32_cjs.o(b),void 0,t.glyphFallbacks,t.documentLigatures);de(r.signal);let h=te(d,b.defaultFont.family,g,f.resolveFont,u.dropped);return oe(h,t),ne(h,t,t.glyphFallbacks),l=!0,Object.freeze({...f,dispose:p.release})}finally{l||p.release();}})();return await Promise.race([a,co(r.signal)])}finally{clearTimeout(s),t.signal?.removeEventListener("abort",i);}}function uo(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 co(e){return new Promise((o,t)=>{let n=()=>{t(St(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function St(e){let o=e.reason===Rt;return new chunkWRLKVNNR_cjs.d(o?"timedOut":"aborted",o?"Font resolution timed out":"Font resolution was aborted",o?void 0:{cause:e.reason})}function de(e){if(e.aborted)throw St(e)}function po(e){let o=[e.part().root],t=[],n=[],r=new Set([e.part().name]),i=(d,g)=>{!g||r.has(g.name)||(r.add(g.name),d.push(g.root));};for(let d of e.headerFooterPartsBySection()){for(let g of d.headers.values())i(t,g);for(let g of d.footers.values())i(t,g);}for(let d of ["footnote","endnote"])n.push(...fo(e,d));let s=e.documentThemeFonts(),a={...s,major:s.major,minor:s.minor,majorEastAsia:s.majorEastAsia??null,minorEastAsia:s.minorEastAsia??null},p=new Map,l=(d,g)=>{let u=chunkLZLTN5A3_cjs.d(d,e.stylesRoot(),a,yo(d,g)),c=chunkOHAXVTWG_cjs.y(d,e.numberingRoot(),e.stylesRoot(),a);for(let y of [...u.direct,...xo(d),...c,...chunkOHAXVTWG_cjs.v(d,e.stylesRoot(),a),...u.inherited]){let R=y.toLowerCase();p.has(R)||p.set(R,y);}};return l(o,"body"),l(t,"furniture"),l(n,"note"),[...p.values()]}function fo(e,o){let t=chunk4KZ6L5YF_cjs.Lg(e.currentPackage(),o);if(!t)return [];let n=new Set(chunk4KZ6L5YF_cjs.Mg(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 s=chunk4KZ6L5YF_cjs.kc(i),a=chunk4KZ6L5YF_cjs.jc(i);(s==="separator"||s==="continuationSeparator"||a!==null&&n.has(a))&&r.push(i);}return r}var mo="http://schemas.openxmlformats.org/officeDocument/2006/math";function yo(e,o){let t=new Set;for(let n of e){let r=[],i=[{node:n,context:o}];for(;i.length>0;){let{node:s,context:a}=i.pop();s.namespaceUri===chunk4KZ6L5YF_cjs.fa&&s.localName==="p"&&r.push({paragraph:s,context:a});let p=s.namespaceUri===chunk4KZ6L5YF_cjs.fa&&s.localName==="txbxContent"&&(a==="body"||a==="note")?"detached":a;for(let l=s.children.length-1;l>=0;l-=1){let d=s.children[l];d.kind!=="textValue"&&i.push({node:d,context:p});}}for(let s of r)ho(s.paragraph,t,s.context);}return t}function ho(e,o,t){let n=chunk55AT3MOU_cjs.zb(),r=null,i=null,s="",a=false,p=false,l=false,d=0,g=[];for(let u=e.children.length-1;u>=0;u-=1){let c=e.children[u];c.kind!=="textValue"&&g.push({node:c,runId:null,visibility:D,containerDepth:0});}for(;g.length>0;){let{node:u,runId:c,visibility:y,containerDepth:R}=g.pop();if(R>=chunk4KZ6L5YF_cjs.oa||u.namespaceUri===chunk4KZ6L5YF_cjs.fa&&u.localName==="p")continue;let b=u.namespaceUri===chunk4KZ6L5YF_cjs.fa&&u.localName==="r"?u.id:c;if(u.namespaceUri===chunk4KZ6L5YF_cjs.fa&&u.localName==="fldSimple"){let f=ue(u,"instr")??"";chunk55AT3MOU_cjs.jd(f,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&go(u)!==D&&o.add(u.id);}if(u.namespaceUri===chunk4KZ6L5YF_cjs.fa&&u.localName==="fldChar"){let f=ue(u,"fldCharType");if(f==="begin")chunk55AT3MOU_cjs.Cb(n),n.nesting===1&&(r=b,i=null,s="",a=false,p=false,l=chunk4KZ6L5YF_cjs.hf(u),d=0);else if(f==="separate"){let h=n.nesting===1;if(chunk55AT3MOU_cjs.Eb(n),h){let x=chunk55AT3MOU_cjs.Bb(n);s=x.instruction,a=x.overflow||n.nestingOverflow,i=b,p=true;}}else if(f==="end"){if(n.nesting===1){if(n.phase==="instruction"){let x=chunk55AT3MOU_cjs.Bb(n);s=x.instruction,a=x.overflow||n.nestingOverflow;}if(!a&&chunk55AT3MOU_cjs.id(s,{hasSeparate:p,hasLegacyFormData:l,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&d!==D){let x=i??r;x&&o.add(x);}}chunk55AT3MOU_cjs.Fb(n);}continue}if(u.namespaceUri===chunk4KZ6L5YF_cjs.fa&&(u.localName==="instrText"||u.localName==="delInstrText")){chunk55AT3MOU_cjs.Db(n,Lt(u),u.localName==="delInstrText");continue}n.nesting>0&&chunk55AT3MOU_cjs.Gb(n)&&u.namespaceUri===chunk4KZ6L5YF_cjs.fa&&Ot(u)&&(d|=y);for(let f=u.children.length-1;f>=0;f-=1){let h=u.children[f];h.kind!=="textValue"&&g.push({node:h,runId:b,visibility:y&At(u),containerDepth:chunk4KZ6L5YF_cjs.pa(u,R)});}}chunk55AT3MOU_cjs.Ab(n);}function Ot(e){return e.localName==="t"||e.localName==="delText"?Lt(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var ce=1,vt=2,wt=4,D=ce|vt|wt;function go(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:D});let t=0;for(;o.length>0;){let{node:n,visibility:r}=o.pop();if(!(n.namespaceUri===chunk4KZ6L5YF_cjs.fa&&n.localName==="p")){if(n.namespaceUri===chunk4KZ6L5YF_cjs.fa&&Ot(n)&&(t|=r,t===D))return t;for(let i of n.children)i.kind!=="textValue"&&o.push({node:i,visibility:r&At(n)});}}return t}function At(e){return e.namespaceUri!==chunk4KZ6L5YF_cjs.fa?D:e.localName==="ins"||e.localName==="moveTo"?ce|vt:e.localName==="del"||e.localName==="moveFrom"?ce|wt:D}function xo(e){let o=new Map,t=n=>{let r=chunkLZLTN5A3_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===mo&&t(chunk55AT3MOU_cjs.gc),i.namespaceUri===chunk4KZ6L5YF_cjs.fa&&i.localName==="sym"&&t(chunkLZLTN5A3_cjs.b(ao(i,"font"))),i.namespaceUri===chunk4KZ6L5YF_cjs.fa&&i.localName==="fldSimple"){let s=ue(i,"instr");t(chunk55AT3MOU_cjs.dd(s??"")?.font??null);}if(i.namespaceUri===chunk4KZ6L5YF_cjs.fa&&i.localName==="p")for(let s of chunkOHAXVTWG_cjs.x(i))t(s);for(let s=i.children.length-1;s>=0;s-=1){let a=i.children[s];a.kind!=="textValue"&&r.push(a);}}}return [...o.values()]}function Lt(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 Dt="FILE_TOO_LARGE",Tt=8;function Fo(e){return typeof e=="object"&&e!==null}function kt(e){if(!(!Fo(e)||typeof e.code!="string"))return e.code}function It(e){return e===""||e.toLowerCase()==="localhost"}function Eo(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function _t(e){let o=Eo(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 Nt(e){let o=_t(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function bo(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function Ro(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(!It(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=Nt(o.pathname);if(t===null||bo(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function So(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 Oo(e){let o=So(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>Tt)throw new TypeError(`trustedRoot must not exceed ${Tt} directories`);return o.map(Ro)}function vo(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>chunk55AT3MOU_cjs.a)throw new TypeError(`maxBytes must not exceed ${chunk55AT3MOU_cjs.a}`);return e}function wo(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!It(e.host))return null;let t=_t(e.pathname);if(t===null)return null;for(let n of o){let r=Nt(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 Ao(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 Lo(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function Pt(e,o,t){return e.some(n=>Lo(n,o,t))}async function To(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(r){if(kt(r)==="ENOENT")continue;throw r}return t}function Po(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:r,realpath:i},{constants:s},{fileURLToPath:a},p]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),l=e.map(y=>p.resolve(a(y.href))),d=p.resolve(a(typeof o=="string"?o:o.href));if(!Pt(l,d,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let g=typeof s.O_NOFOLLOW=="number"?s.O_RDONLY|s.O_NOFOLLOW:"r",u=await r(d,g),c=()=>{u.close();};t?.addEventListener("abort",c,{once:true});try{if(t?.aborted)throw t.reason;let y=await i(d);if(!Pt(await To(l,i),y,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let R=(await u.stat()).size;if(!Number.isSafeInteger(R)||R<0||R>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:Dt});let b=new Uint8Array(R),f=0;for(;f<b.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:h}=await u.read(b,f,b.byteLength-f,f);if(h===0)break;f+=h;}if(t?.aborted)throw t.reason;return f===b.byteLength?b:b.slice(0,f)}catch(y){throw t?.aborted?t.reason:y}finally{t?.removeEventListener("abort",c),await u.close().catch(()=>{});}}}function Do(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=Oo(e.trustedRoot),t=vo(e.maxBytes),n=e.read??Po(o),r=e.networkFetch??fetch;return(async(i,s)=>{let a=s?.signal;if(a?.aborted)throw a.reason;let p=Ao(i);if(p.protocol!=="file:")return r(p,s);let l=wo(p,o);if(!l)return new Response(null,{status:404});let d=a?new AbortController:void 0,g=()=>d?.abort(a?.reason);a?.addEventListener("abort",g,{once:true});let u;try{if(u=await n(l,{maxBytes:t,...d?{signal:d.signal}:{}}),a?.aborted)throw a.reason;if(u.byteLength>t)return new Response(null,{status:413})}catch(c){if(a?.aborted)throw a.reason;if(d?.signal.aborted)throw d.signal.reason??c;if(c instanceof DOMException&&c.name==="AbortError"||c instanceof Error&&c.name==="AbortError")throw c;let y=kt(c);if(y===Dt)return new Response(null,{status:413});if(y==="ENOENT"||y==="ENOTDIR"||y==="ELOOP")return new Response(null,{status:404});throw c}finally{a?.removeEventListener("abort",g);}return new Response(u,{status:200})})}
|
|
2
|
+
Object.defineProperty(exports,"ExportResourceError",{enumerable:true,get:function(){return chunkWRLKVNNR_cjs.d}});Object.defineProperty(exports,"createNodeImageDecodePort",{enumerable:true,get:function(){return chunkWRLKVNNR_cjs.c}});Object.defineProperty(exports,"exportDestinationNamed",{enumerable:true,get:function(){return chunkWRLKVNNR_cjs.b}});Object.defineProperty(exports,"openDocumentForExport",{enumerable:true,get:function(){return chunkWRLKVNNR_cjs.e}});exports.MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS=le;exports.acquireSharedExportShaping=eo;exports.createPackagedFileFetch=Do;exports.hasExportAdmittedFont=ee;exports.hasExportLaidOutText=ie;exports.hasFontBackedExportCapabilities=ro;exports.openFontBackedDocumentForExport=so;
|
package/dist/export.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import { S as SemanticLayout,
|
|
4
|
-
import { D as DocumentProperties, H as HeadlessDocumentView, a as HeadlessDocumentRejection } from './headless-document-view-
|
|
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-
|
|
1
|
+
import { a as ReviewDisplayMode, d as ResolvedRevisionMarkup, e as RevisionMarkupOptions } from './revision-projection-CSNFudZY.js';
|
|
2
|
+
import { P as PreservedImageMime, I as ImageResourceLimits, S as SupportedImageMime, a as ImageDecodePort } from './image-resources-BDFxcu7W.js';
|
|
3
|
+
import { S as SemanticLayout, o as SemanticReviewArtifactRecord, I as InlineDrawingRecord, A as AnchoredDrawingRecord, p as ListMarkerPictureRecord, T as TextMeasurer, n as FontRequest, q as FontSubstitution, r as ShapedRun, e as StyleSpanRecord } from './semantic-records-B9OolWGN.js';
|
|
4
|
+
import { D as DocumentProperties, H as HeadlessDocumentView, a as HeadlessDocumentRejection } from './headless-document-view-ICYqNkQ1.js';
|
|
5
|
+
import { P as PreparedLayoutFontConfiguration, L as LayoutShapingInstrumentation } from './layout-shaping-BvZD_VKP.js';
|
|
6
|
+
import { F as FontOriginFailure, a as FontOrigin } from './font-resolver-DN0xNOf_.js';
|
|
7
|
+
import './types-barrel-BFKR8Pzp.js';
|
|
8
8
|
import './editor-scope-OHPwVQ5l.js';
|
|
9
|
-
import './omml-equation-
|
|
10
|
-
import './tree-package-fragment-
|
|
11
|
-
import './editor-
|
|
9
|
+
import './omml-equation-DuczgG5o.js';
|
|
10
|
+
import './tree-package-fragment-DYZIk1rY.js';
|
|
11
|
+
import './editor-B3OBYNrF.js';
|
|
12
12
|
import './contracts/document.js';
|
|
13
13
|
import './contracts/interaction.js';
|
|
14
|
-
import './semantic-interaction-
|
|
15
|
-
import './document-protection-
|
|
14
|
+
import './semantic-interaction-G0bjmmmk.js';
|
|
15
|
+
import './document-protection-9zpIHWTE.js';
|
|
16
16
|
import './failure-BIPVQbRm.js';
|
|
17
17
|
|
|
18
18
|
/** Source content that cannot be certified by the layout snapshot. @public */
|
|
@@ -76,13 +76,17 @@ declare function createNodeImageDecodePort(options?: {
|
|
|
76
76
|
type ExportDocumentSource = Uint8Array | HeadlessDocumentView;
|
|
77
77
|
/** Shared session options; translators add their own format-specific options. @public */
|
|
78
78
|
interface OpenDocumentForExportOptions {
|
|
79
|
+
/** Viewer markup applied before layout and export. */
|
|
80
|
+
readonly revisionMarkup?: RevisionMarkupOptions;
|
|
81
|
+
/** Stable author color slots captured from the editor session. */
|
|
82
|
+
readonly revisionAuthorSlots?: Readonly<Record<string, number>>;
|
|
79
83
|
/**
|
|
80
84
|
* Revision projection applied before records reach an exporter. Default: `all-markup`.
|
|
81
85
|
*
|
|
82
86
|
* The safe reader default keeps every pending insertion and deletion visible. Choose
|
|
83
87
|
* `proposed` or `original` explicitly only when a resolved view is intended.
|
|
84
88
|
*/
|
|
85
|
-
readonly displayMode?:
|
|
89
|
+
readonly displayMode?: ReviewDisplayMode;
|
|
86
90
|
/**
|
|
87
91
|
* Text measurement used for line wrapping and pagination. Omit only when deterministic
|
|
88
92
|
* approximate pagination is acceptable. Core then uses a fixed-width fallback that neither
|
|
@@ -117,6 +121,14 @@ interface OpenDocumentForExportOptions {
|
|
|
117
121
|
* @public
|
|
118
122
|
*/
|
|
119
123
|
interface ExportSemanticLayout extends SemanticLayout {
|
|
124
|
+
/** Requested review view; Simple Markup uses the proposed text projection. */
|
|
125
|
+
readonly reviewDisplayMode?: ReviewDisplayMode;
|
|
126
|
+
/** Viewer preferences used for this layout. */
|
|
127
|
+
readonly revisionMarkup?: ResolvedRevisionMarkup;
|
|
128
|
+
/** Stable author color slots captured from the editor session. */
|
|
129
|
+
readonly revisionAuthorSlots?: Readonly<Record<string, number>>;
|
|
130
|
+
/** Whether outside change bars alternate page margins. */
|
|
131
|
+
readonly facingPages?: boolean;
|
|
120
132
|
/** Source omissions that cannot be detected by walking laid-out records. */
|
|
121
133
|
readonly contentWarnings?: readonly ExportContentWarning[];
|
|
122
134
|
readonly reviewArtifacts: readonly SemanticReviewArtifactRecord[];
|
|
@@ -138,7 +150,7 @@ interface ExportSession {
|
|
|
138
150
|
/** Settle resources and return the default revision projection. */
|
|
139
151
|
layout(): Promise<ExportSemanticLayout>;
|
|
140
152
|
/** Settle resources and cache one explicit revision projection. */
|
|
141
|
-
layoutFor(displayMode:
|
|
153
|
+
layoutFor(displayMode: ReviewDisplayMode): Promise<ExportSemanticLayout>;
|
|
142
154
|
/**
|
|
143
155
|
* Mint a defensive copy only for a ready image published by this session.
|
|
144
156
|
*
|
package/dist/export.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {c as c$1,o,d as d$1,f,y,v,j as j$2,r,m,x,l as l$1}from'./chunk-LWCI65EL.js';import {j as j$1,l,k,q as q$1,h,n,c as c$2,g,_ as _$2,Z,aa}from'./chunk-EEAV3WIN.js';import'./chunk-RIYSCEFQ.js';import {d,e}from'./chunk-EYK4K2J6.js';export{d as ExportResourceError,c as createNodeImageDecodePort,b as exportDestinationNamed,e as openDocumentForExport}from'./chunk-EYK4K2J6.js';import {c,da,ra,cc,dc,_ as _$1,ea,h as h$1,a,d as d$3,Zc,b as b$1,i,ib,dd,lb,nb,kb,cd,ob,mb,pb,jb,p,s,n as n$1,ac}from'./chunk-XSHXBJ2J.js';import {d as d$2,b,a as a$1}from'./chunk-5BIASAN3.js';import'./chunk-73PG6L2X.js';import {ab}from'./chunk-L6V3IJ3S.js';import {Ig,Jg,kc,jc,fa,E,Se,oa,ff,pa}from'./chunk-DDGGSBAN.js';function _(e,o,t){if(o.environment.features.smcp!==1||!/\p{Ll}/u.test(o.text))return t;let n={...o,environment:{...o.environment,features:{...o.environment.features,smcp:0}}},r=e.shape(n);if(t.glyphs.length!==r.glyphs.length||t.glyphs.some((u,c)=>u.id!==r.glyphs[c]?.id))return t;let i=[],s=0;for(let u of o.text){let c=u.toUpperCase()!==u,y=i.at(-1);y&&(y.lower===c||/\p{M}/u.test(u))?y.text+=u:i.push({text:u,start:s,lower:c}),s+=u.length;}let a=[],p=[],l=[],d=true,g=0;for(let u of o.environment.direction==="rtl"?i.reverse():i){let c=u.lower?.8:1,y=[],R=[],b="",f=u.start;for(let F of u.text){let m=u.lower?F.toUpperCase():F;for(let E=0;E<m.length;E++)y.push(f),R.push(f+F.length);b+=m,f+=F.length;}let h=e.shape({...n,text:b}),x=a.length;for(let[F,m]of h.glyphs.entries()){let E=h.exactAdvancesX?.[F];E===void 0?d=false:l.push(E*c),a.push({...m,cluster:y[m.cluster]??u.start,originX:n$1(g+Math.round(m.originX*c)),originY:n$1(Math.round(m.originY*c)),offsetX:n$1(Math.round(m.offsetX*c)),offsetY:n$1(Math.round(m.offsetY*c)),advanceX:n$1(Math.round(m.advanceX*c)),advanceY:n$1(Math.round(m.advanceY*c)),drawScale:c});}for(let F of h.clusters){let m=y[F.textStart]??u.start,E=R[F.textEnd-1]??f,T=n$1(Math.round(F.advance*c)),A=p.at(-1);A&&A.textStart===m&&A.textEnd===E?p[p.length-1]={...A,glyphEnd:x+F.glyphEnd,advance:n$1(A.advance+T),caretEdges:[n$1(0),n$1(A.advance+T)]}:p.push({...F,textStart:m,textEnd:E,glyphStart:x+F.glyphStart,glyphEnd:x+F.glyphEnd,advance:T,caretEdges:F.caretEdges.map(G=>n$1(Math.round(G*c))),fontSpan:0});}g+=h.glyphs.reduce((F,m)=>F+Math.round(m.advanceX*c),0);}return {...t,glyphs:a,clusters:p,fontSpans:[{...t.fontSpans[0],glyphStart:0,glyphEnd:a.length}],exactAdvancesX:d&&l.length===a.length?l:void 0}}var st=new WeakMap;function Ut(e){let o=st.get(e);return o===void 0&&(o=zt(e.bytes,e.faceIndex),st.set(e,o)),o}var Bt=new Set(["COLR","CBDT","sbix"]),qt=512;function zt(e,o){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.byteLength<12)return false;let n=0;if(lt(e,0)==="ttcf"){let i=t.getUint32(8);if(o<0||o>=i||12+4*o+4>e.byteLength||(n=t.getUint32(12+4*o),n+12>e.byteLength))return false}let r=Math.min(t.getUint16(n+4),qt);for(let i=0;i<r;i++){let s=n+12+i*16;if(s+4>e.byteLength)return false;if(Bt.has(lt(e,s)))return true}return false}function lt(e,o){return String.fromCharCode(e[o],e[o+1],e[o+2],e[o+3])}var jt=/\p{Emoji_Presentation}|️/u;function Ht(e){return jt.test(e)}function q(e,o){if(e.length<2)return e;let t=e.filter(Ut);if(t.length===0||t.length===e.length)return e;let n=e.filter(r=>!t.includes(r));return Ht(o)?[...t,...n]:[...n,...t]}var Xt=2048;function dt(e,o,t,n){if(!t.clusters.length||t.clusters.length>Xt)return null;let r=(f,h)=>{let{context:x,...F}=o,m={...F,text:h,environment:p({...o.environment,font:f})};return _(e,m,e.shape(m))},i=[],s$1=new Map;for(let f of [...t.clusters].sort((h,x)=>h.textStart-x.textStart)){let h=o.environment.font,x=o.text.slice(f.textStart,f.textEnd),F=i.at(-1);if(/^[\uFE0E\uFE0F]$/.test(x)&&F&&F.end===f.textStart){F.end=f.textEnd;continue}if(o.environment.script==="Hebr"&&/^\s+$/u.test(x)&&F&&F.font!==o.environment.font&&F.end===f.textStart){F.end=f.textEnd;continue}if(t.glyphs.slice(f.glyphStart,f.glyphEnd).some(E=>E.id===0)){let E=o.text.slice(f.textStart,f.textEnd+1),T=s$1.get(x)??q(n,E).find(A=>{try{return !r(A,x).glyphs.some(G=>G.id===0)}catch{return false}});if(!T)return null;s$1.set(x,T),h=T;}let m=i.at(-1);m&&m.font===h&&m.end===f.textStart?m.end=f.textEnd:i.push({start:f.textStart,end:f.textEnd,font:h});}let a=[],p$1=[],l=[],d=[],g=true,u=0,c=0,y=0,R=0,b=0;for(let f of o.environment.direction==="rtl"?i.reverse():i){let h=r(f.font,o.text.slice(f.start,f.end));if(h.glyphs.some(m=>m.id===0))return null;let x=a.length,F=l.length;for(let m of h.glyphs)a.push({...m,cluster:f.start+m.cluster,originX:n$1(u+m.originX),originY:n$1(c+m.originY)});if(h.exactAdvancesX===void 0)g=false;else for(let m of h.exactAdvancesX)d.push(m);for(let m of h.clusters)p$1.push({...m,textStart:f.start+m.textStart,textEnd:f.start+m.textEnd,glyphStart:x+m.glyphStart,glyphEnd:x+m.glyphEnd,fontSpan:F});h.glyphs.length&&l.push({font:f.font,glyphStart:x,glyphEnd:a.length,fallbackIndex:f.font===o.environment.font?null:n.indexOf(f.font)}),u+=h.glyphs.reduce((m,E)=>m+E.advanceX,0),c+=h.glyphs.reduce((m,E)=>m+E.advanceY,0),y=Math.max(y,h.metrics.ascent),R=Math.max(R,h.metrics.descent),b=Math.max(b,h.metrics.lineGap);}return s({...t,glyphs:a,clusters:p$1,fontSpans:l,exactAdvancesX:g&&d.length===a.length?d:void 0,metrics:{ascent:n$1(y),descent:n$1(R),lineGap:n$1(b)}},{...o.environment,fallbackOrder:n})}var Gt=new Map([["Beng",["bng2","beng"]],["Deva",["dev2","deva"]],["Gujr",["gjr2","gujr"]],["Guru",["gur2","guru"]],["Knda",["knd2","knda"]],["Mlym",["mlm2","mlym"]],["Orya",["ory2","orya"]],["Taml",["tml2","taml"]],["Telu",["tel2","telu"]],["Nkoo",["nko "]]]),Vt=512,ut=new WeakMap;function Wt(e,o){let t=new Set,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=c=>c+2<=n.byteLength?n.getUint16(c):-1,i=c=>c+4<=n.byteLength?n.getUint32(c):-1,s=c=>c+4<=n.byteLength?String.fromCharCode(n.getUint8(c),n.getUint8(c+1),n.getUint8(c+2),n.getUint8(c+3)):"",a=0;if(s(0)==="ttcf"){let c=i(8);if(c<0||o<0||o>=c||(a=i(12+o*4),a<0))return t}let p=r(a+4);if(p<0||p>1024)return t;let l=-1;for(let c=0;c<p;c+=1){let y=a+12+c*16;if(s(y)==="GSUB"){l=i(y+8);break}}if(l<0)return t;let d=r(l+4);if(d<=0)return t;let g=l+d,u=r(g);if(u<0)return t;for(let c=0;c<Math.min(u,Vt);c+=1){let y=s(g+2+c*6);y&&t.add(y);}return t}function Yt(e,o){let t=ut.get(e);return t||(t=Wt(e.bytes,e.faceIndex),ut.set(e,t)),(Gt.get(o)??[o.toLowerCase()]).some(r=>t.has(r))}function ct(e,o){let t=e.filter(n=>Yt(n,o));return t.length===0||t.length===e.length?e:[...t,...e.filter(n=>!t.includes(n))]}function J(e,o,t){if(!o.text.includes("\u2011"))return t;let n=new Set(t.glyphs.filter(i=>i.id===0).map(i=>i.cluster));if(!n.size)return t;let r=o.text.replace(/\u2011/g,(i,s)=>n.has(s)?"-":i);if(r===o.text)return t;try{let i=e.shape({...o,text:r});return s({...i,text:o.text},o.environment)}catch{return t}}function pt(e,o){if(o.length===0)return e;if(o.length>16)throw new RangeError("At most 16 glyph fallback faces are supported");let t=o.map(a=>e.fonts.resolve(a)).filter(a=>!(a instanceof d$3)),n={shape(a){return J(e.shaper,a,e.shaper.shape(a))}},r=new WeakMap,i={shape(a){let p=e.shaper.shape(a),l=r.get(p);if(l&&l.input.text===a.text&&l.input.fontSizeHalfPoints===a.fontSizeHalfPoints&&l.input.bidiLevel===a.bidiLevel&&l.input.context?.before===a.context?.before&&l.input.context?.after===a.context?.after&&l.input.environment===a.environment)return l.run;let d=s(a,J(e.shaper,a,p));return r.set(p,{input:a,run:d}),d}},s=(a,p$1)=>{let l=_(n,a,p$1);if(!l.glyphs.some(d=>d.id===0)||/^[\t\n\r\f]*$/.test(a.text))return l;if(/^(Latn|Cyrl|Grek|Hebr|Hani|Hira|Kana|Hang|Zyyy|Zinh)$/.test(a.environment.script)){let d=dt(n,a,l,t);if(d)return d}for(let d of ct(q(t,a.text),a.environment.script))if(!(d.hash===a.environment.font.hash&&d.faceIndex===a.environment.font.faceIndex))try{let g={...a,environment:p({...a.environment,font:d})},u=_(n,g,n.shape(g));if(!u.glyphs.some(c=>c.id===0))return u}catch{}return l};return {...e,shaper:i}}var Q=b$1;function ee(e){return typeof e.admittedFontFace=="function"}var $t=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function z(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var ft=new WeakMap;function j(e){let o=ft.get(e);return o||ft.set(e,o=Kt(e)),o}function Kt(e){let o=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:z(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:o?Object.freeze({requested:z(o.requested),resolved:z(o.resolved),...o.lineMetrics?{lineMetrics:Object.freeze({...o.lineMetrics})}:{}}):null})}function Zt(e){return Object.freeze({...j(e),bytes:i(e)})}function Jt(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof d$3?null:Zt(t)}catch{return null}}function mt(e){return o=>{if(e.status()!=="active")throw e.unavailable();return Jt(e.resolve(),o)}}function Qt(e){return Object.freeze(e.slice(0,Q).map(o=>Object.freeze({request:z(o.request),partName:o.partName,reason:o.reason})))}function te(e,o,t,n,r=[]){let i=new Map;for(let a of [...e,o]){let p=a.toLowerCase();i.has(p)||i.set(p,a);}let s=[...i.values()].map(a=>{let p=[];for(let l of $t){let d=n?.({family:a,...l});!d||d instanceof d$3||p.push(Object.freeze({...l,sourceFamily:d.family,via:d.substitution?"substitution":"direct",identity:d.identity,id:d.id,hash:d.hash,faceIndex:d.faceIndex,substitution:d.substitution}));}return Object.freeze({family:a,coverage:p.length===4?"complete":p.length>0?"partial":"none",faces:Object.freeze(p)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(s),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:Qt(r)})}function oe(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 ne(e,o,t=[]){let n=l=>l.trim().toLowerCase(),r=new Set([...e.requestedFamilies,e.defaultFamily].map(n)),i=new Set(t.map(l=>n(l.family))),s=l=>{if(!(l instanceof l$1))return true;let d=n(l.request.family);return r.has(d)||!i.has(d)},a=e.originFailures.some(({cause:l})=>l instanceof m?l.causes.length===0||l.causes.some(s):s(l));if(o.fontPolicy!=="strict"||!a&&e.families.every(l=>l.coverage==="complete"))return;let p=e.families.filter(l=>l.coverage!=="complete").map(l=>l.family).join(", ");throw new d("layoutFailed",`Strict font policy refused export${p?`; incomplete families: ${p}`:"; a font origin failed"}`)}function H(){return new Map}function re(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=h$1(r),s=o.get(i);if(!s){try{s=e.fonts.resolve(r);}catch{return null}o.set(i,s);}return s instanceof d$3?null:s}function yt(e,o,t){let n=t.fontFamily??e.defaultFont.family;return re(e,o,n,t)}function ie(e){return typeof e.shapeLaidOutText=="function"}function ae(e){let o=H(),t=new WeakMap;return n=>{let r=ra(n.style,n.fontSlot),i=cc(n)?dc(n):_$1(n.text,r);if(i.length===0)return null;let s=r.fontFamily??e.defaultFont.family,a=re(e,o,s,r);if(!a)return null;try{if(r.smallCaps&&!_$2(e.shaper,e.environment,a,r,t))return null;let p=Z(e.shaper,e.environment,a,r,i);return Object.freeze({run:p,font:j(p.fontSpans[0]?.font??a),...p.fontSpans.length>1?{fonts:Object.freeze(p.fontSpans.map(l=>j(l.font)))}:{},fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function ht(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var N=new Map,X=new WeakMap,se=0,M,le=32,gt=c;function xt(){if(M)return M;let e=(async()=>(await c$2(),g(h)))();return M=e,e.catch(()=>{M===e&&(M=void 0);}),e}function Ft(e){let o=H();return aa(e,{resolveFont(t){return yt(e,o,t)},fallback:ea()})}async function Et(e,o,t=[],n=false){if(!j$1(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let r=await xt(),i=pt(await q$1(e,r,h,o,n),t);return Object.freeze({createMeasurer:()=>Ft(i),resolveFont:s=>i.fonts.resolve(s),shapeLaidOutText:ae(i),producer:["node-export-session",JSON.stringify(t),e.fingerprint,i.operation.shapingHash,`producer:${i.operation.producerVersion}`,`fallback:${da}`].join("|"),extensionFingerprint:e.fingerprint})}function eo(e,o){if(!j$1(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let t=X.get(e);if(t)return t;let n=l(e),r=N.get(n);if(!r){if(N.size>=le)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${le} process-wide configurations`));r=(async()=>{let p=k(e).sources.reduce((d,g)=>d+(g.availability==="forbidden"?0:g.bytes.byteLength),0);if(se+p>gt)throw new RangeError(`Shared exporter shaping font bytes are limited to ${gt} process-wide`);se+=p;let l;try{let d=await xt();l=await q$1(e,d,h,o);}catch(d){throw se-=p,d}return Object.freeze({createMeasurer:()=>Ft(l),shapeLaidOutText:ae(l),shapingHash:l.operation.shapingHash,producerVersion:l.operation.producerVersion})})(),N.set(n,r),r.catch(()=>{N.get(n)===r&&N.delete(n);});}let i=e.fingerprint,s=r.then(a=>Object.freeze({createMeasurer:a.createMeasurer,shapeLaidOutText:a.shapeLaidOutText,producer:["node-export",i,a.shapingHash,`producer:${a.producerVersion}`,`fallback:${da}`].join("|"),extensionFingerprint:i}));return X.set(e,s),s.catch(()=>{X.get(e)===s&&X.delete(e);}),s}var to="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function oo(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(r=>r.type===to),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"),Se(o,n)}function bt(e,o){let t=oo(e);if(t.length!==0)return j$2(n=>{let r$1=new Set((n.resolvedFaces??[]).map(s=>h$1(s))),i=r(t,{maxFontBytes:a,aggregateBudget:no(n),shadowedRequests:r$1});if(o)for(let s of i.dropped){if(o.dropped.length>=Q)break;o.dropped.push(s);}return {sources:i.sources}})}function no(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?c:Math.max(0,c-o)}function ro(e){return ee(e)&&ie(e)}var w=0,Rt=Symbol("font-resolution-timeout");function io(e){let o=0,t=false;return e?.(w),{reserve:r=>{if(t)throw new Error("Document font-byte lease is already released");if(w+r>c)throw new d("layoutFailed",`Active document export font bytes are limited to ${c}; requested ${r} bytes with ${w} bytes already active`);w+=r,o+=r,e?.(w);let i=false;return ()=>{i||t||(i=true,w-=r,o-=r,e?.(w));}},release:()=>{t||(t=true,w-=o,o=0,e?.(w));}}}function ue(e,o){return e.attributes.find(t=>t.localName===o)?.value}function ao(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===fa||t.namespaceUri===""))?.value}async function so(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=ab(e$1);if(!t.ok)return t;let{fonts:n,lastResortFonts:r,fontResolutionTimeoutMs:i,fontPolicy:s,onFontResolution:a,glyphFallbacks:p,documentLigatures:l,...d$1}=o,g=Array.isArray(n)?n:[n],u=r===void 0?[]:Array.isArray(r)?r:[r],c,y;try{y=await lo(t.view,g,{signal:o.signal,timeoutMs:i??o.resourceTimeoutMs,fontPolicy:s,glyphFallbacks:p,documentLigatures:l,lastResortFonts:u,onFontResolution:E=>(c=E,a?.(E))});}catch(E){if(E instanceof d&&E.code==="aborted")return {ok:false,reason:"aborted"};throw E}if(!c)throw y?.dispose(),new d("layoutFailed","Document font resolution completed without publishing its evidence");let R;try{R=e(t.view,{...d$1,reuseAcrossRevisions:!1,...y?{measurer:y.createMeasurer(),producer:o.producer??y.producer}:o.producer?{producer:o.producer}:{}});}catch(E){throw y?.dispose(),E}if(!R.ok)return y?.dispose(),R;let b=R.session,f=y,h="active",x=()=>h==="aborted"?new d("aborted","Export resource settlement was aborted"):new d("disposed","Export session has been disposed"),F=E=>{if(h==="active"){h=E,o.signal?.removeEventListener("abort",m);try{b.dispose();}finally{f?.dispose(),f=void 0;}}},m=()=>F("aborted");return o.signal?.addEventListener("abort",m,{once:true}),o.signal?.aborted&&m(),{ok:true,session:Object.freeze({fontResolution:c,layout:()=>h==="active"?b.layout():Promise.reject(x()),layoutFor:E=>h==="active"?b.layoutFor(E):Promise.reject(x()),validatedImageBytes:E=>h==="active"?b.validatedImageBytes(E):null,admittedFontFace:mt({status:()=>h,unavailable:x,resolve:()=>f?.resolveFont}),shapeLaidOutText:ht({status:()=>h,unavailable:x,shaping:()=>f}),dispose:()=>F("disposed")})}}async function lo(e,o$1,t={}){if((t.glyphFallbacks?.length??0)>16)throw new RangeError("At most 16 glyph fallback faces are supported");let n$1=uo(t.timeoutMs),r=new AbortController,i=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",i,{once:true}),t.signal?.aborted&&i();let s=setTimeout(()=>r.abort(Rt),n$1);try{de(r.signal);let a=(async()=>{let p=io(t.onActiveFontBytesChange),l=!1;try{let d=po(e).slice(0,c$1),g=[],u={dropped:[]},c=bt(e,u),y=[...o$1,...c?[c]:[],...t.lastResortFonts??[]],R=await o(y,{families:[...new Set([...(t.glyphFallbacks??[]).map(x=>x.family),...d])].slice(0,c$1),defaultFamily:d$1.family,signal:r.signal},{onOriginFailure:x=>g.push(x),reserveOwnedBytes:p.reserve,maxExecutionFontBytes:h.maxFontBytes});de(r.signal);let b=f(R??{});if(b.sources.length===0){let x=te(d,b.defaultFont.family,g,void 0,u.dropped);oe(x,t),ne(x,t,t.glyphFallbacks);return}let f$1=await Et(n(b),void 0,t.glyphFallbacks,t.documentLigatures);de(r.signal);let h$1=te(d,b.defaultFont.family,g,f$1.resolveFont,u.dropped);return oe(h$1,t),ne(h$1,t,t.glyphFallbacks),l=!0,Object.freeze({...f$1,dispose:p.release})}finally{l||p.release();}})();return await Promise.race([a,co(r.signal)])}finally{clearTimeout(s),t.signal?.removeEventListener("abort",i);}}function uo(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 co(e){return new Promise((o,t)=>{let n=()=>{t(St(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function St(e){let o=e.reason===Rt;return new d(o?"timedOut":"aborted",o?"Font resolution timed out":"Font resolution was aborted",o?void 0:{cause:e.reason})}function de(e){if(e.aborted)throw St(e)}function po(e){let o=[e.part().root],t=[],n=[],r=new Set([e.part().name]),i=(d,g)=>{!g||r.has(g.name)||(r.add(g.name),d.push(g.root));};for(let d of e.headerFooterPartsBySection()){for(let g of d.headers.values())i(t,g);for(let g of d.footers.values())i(t,g);}for(let d of ["footnote","endnote"])n.push(...fo(e,d));let s=e.documentThemeFonts(),a={...s,major:s.major,minor:s.minor,majorEastAsia:s.majorEastAsia??null,minorEastAsia:s.minorEastAsia??null},p=new Map,l=(d,g)=>{let u=d$2(d,e.stylesRoot(),a,yo(d,g)),c=y(d,e.numberingRoot(),e.stylesRoot(),a);for(let y of [...u.direct,...xo(d),...c,...v(d,e.stylesRoot(),a),...u.inherited]){let R=y.toLowerCase();p.has(R)||p.set(R,y);}};return l(o,"body"),l(t,"furniture"),l(n,"note"),[...p.values()]}function fo(e,o){let t=Ig(e.currentPackage(),o);if(!t)return [];let n=new Set(Jg(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 s=kc(i),a=jc(i);(s==="separator"||s==="continuationSeparator"||a!==null&&n.has(a))&&r.push(i);}return r}var mo="http://schemas.openxmlformats.org/officeDocument/2006/math";function yo(e,o){let t=new Set;for(let n of e){let r=[],i=[{node:n,context:o}];for(;i.length>0;){let{node:s,context:a}=i.pop();s.namespaceUri===fa&&s.localName==="p"&&r.push({paragraph:s,context:a});let p=s.namespaceUri===fa&&s.localName==="txbxContent"&&(a==="body"||a==="note")?"detached":a;for(let l=s.children.length-1;l>=0;l-=1){let d=s.children[l];d.kind!=="textValue"&&i.push({node:d,context:p});}}for(let s of r)ho(s.paragraph,t,s.context);}return t}function ho(e,o,t){let n=ib(),r=null,i=null,s="",a=false,p=false,l=false,d=0,g=[];for(let u=e.children.length-1;u>=0;u-=1){let c=e.children[u];c.kind!=="textValue"&&g.push({node:c,runId:null,visibility:D,containerDepth:0});}for(;g.length>0;){let{node:u,runId:c,visibility:y,containerDepth:R}=g.pop();if(R>=oa||u.namespaceUri===fa&&u.localName==="p")continue;let b=u.namespaceUri===fa&&u.localName==="r"?u.id:c;if(u.namespaceUri===fa&&u.localName==="fldSimple"){let f=ue(u,"instr")??"";dd(f,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&go(u)!==D&&o.add(u.id);}if(u.namespaceUri===fa&&u.localName==="fldChar"){let f=ue(u,"fldCharType");if(f==="begin")lb(n),n.nesting===1&&(r=b,i=null,s="",a=false,p=false,l=ff(u),d=0);else if(f==="separate"){let h=n.nesting===1;if(nb(n),h){let x=kb(n);s=x.instruction,a=x.overflow||n.nestingOverflow,i=b,p=true;}}else if(f==="end"){if(n.nesting===1){if(n.phase==="instruction"){let x=kb(n);s=x.instruction,a=x.overflow||n.nestingOverflow;}if(!a&&cd(s,{hasSeparate:p,hasLegacyFormData:l,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&d!==D){let x=i??r;x&&o.add(x);}}ob(n);}continue}if(u.namespaceUri===fa&&(u.localName==="instrText"||u.localName==="delInstrText")){mb(n,Lt(u),u.localName==="delInstrText");continue}n.nesting>0&&pb(n)&&u.namespaceUri===fa&&Ot(u)&&(d|=y);for(let f=u.children.length-1;f>=0;f-=1){let h=u.children[f];h.kind!=="textValue"&&g.push({node:h,runId:b,visibility:y&At(u),containerDepth:pa(u,R)});}}jb(n);}function Ot(e){return e.localName==="t"||e.localName==="delText"?Lt(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var ce=1,vt=2,wt=4,D=ce|vt|wt;function go(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:D});let t=0;for(;o.length>0;){let{node:n,visibility:r}=o.pop();if(!(n.namespaceUri===fa&&n.localName==="p")){if(n.namespaceUri===fa&&Ot(n)&&(t|=r,t===D))return t;for(let i of n.children)i.kind!=="textValue"&&o.push({node:i,visibility:r&At(n)});}}return t}function At(e){return e.namespaceUri!==fa?D:e.localName==="ins"||e.localName==="moveTo"?ce|vt:e.localName==="del"||e.localName==="moveFrom"?ce|wt:D}function xo(e){let o=new Map,t=n=>{let r=a$1(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===mo&&t(ac),i.namespaceUri===fa&&i.localName==="sym"&&t(b(ao(i,"font"))),i.namespaceUri===fa&&i.localName==="fldSimple"){let s=ue(i,"instr");t(Zc(s??"")?.font??null);}if(i.namespaceUri===fa&&i.localName==="p")for(let s of x(i))t(s);for(let s=i.children.length-1;s>=0;s-=1){let a=i.children[s];a.kind!=="textValue"&&r.push(a);}}}return [...o.values()]}function Lt(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 Dt="FILE_TOO_LARGE",Tt=8;function Fo(e){return typeof e=="object"&&e!==null}function kt(e){if(!(!Fo(e)||typeof e.code!="string"))return e.code}function It(e){return e===""||e.toLowerCase()==="localhost"}function Eo(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function _t(e){let o=Eo(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 Nt(e){let o=_t(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function bo(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function Ro(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(!It(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=Nt(o.pathname);if(t===null||bo(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function So(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 Oo(e){let o=So(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>Tt)throw new TypeError(`trustedRoot must not exceed ${Tt} directories`);return o.map(Ro)}function vo(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>a)throw new TypeError(`maxBytes must not exceed ${a}`);return e}function wo(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!It(e.host))return null;let t=_t(e.pathname);if(t===null)return null;for(let n of o){let r=Nt(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 Ao(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 Lo(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function Pt(e,o,t){return e.some(n=>Lo(n,o,t))}async function To(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(r){if(kt(r)==="ENOENT")continue;throw r}return t}function Po(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:r,realpath:i},{constants:s},{fileURLToPath:a},p]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),l=e.map(y=>p.resolve(a(y.href))),d=p.resolve(a(typeof o=="string"?o:o.href));if(!Pt(l,d,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let g=typeof s.O_NOFOLLOW=="number"?s.O_RDONLY|s.O_NOFOLLOW:"r",u=await r(d,g),c=()=>{u.close();};t?.addEventListener("abort",c,{once:true});try{if(t?.aborted)throw t.reason;let y=await i(d);if(!Pt(await To(l,i),y,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let R=(await u.stat()).size;if(!Number.isSafeInteger(R)||R<0||R>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:Dt});let b=new Uint8Array(R),f=0;for(;f<b.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:h}=await u.read(b,f,b.byteLength-f,f);if(h===0)break;f+=h;}if(t?.aborted)throw t.reason;return f===b.byteLength?b:b.slice(0,f)}catch(y){throw t?.aborted?t.reason:y}finally{t?.removeEventListener("abort",c),await u.close().catch(()=>{});}}}function Do(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=Oo(e.trustedRoot),t=vo(e.maxBytes),n=e.read??Po(o),r=e.networkFetch??fetch;return(async(i,s)=>{let a=s?.signal;if(a?.aborted)throw a.reason;let p=Ao(i);if(p.protocol!=="file:")return r(p,s);let l=wo(p,o);if(!l)return new Response(null,{status:404});let d=a?new AbortController:void 0,g=()=>d?.abort(a?.reason);a?.addEventListener("abort",g,{once:true});let u;try{if(u=await n(l,{maxBytes:t,...d?{signal:d.signal}:{}}),a?.aborted)throw a.reason;if(u.byteLength>t)return new Response(null,{status:413})}catch(c){if(a?.aborted)throw a.reason;if(d?.signal.aborted)throw d.signal.reason??c;if(c instanceof DOMException&&c.name==="AbortError"||c instanceof Error&&c.name==="AbortError")throw c;let y=kt(c);if(y===Dt)return new Response(null,{status:413});if(y==="ENOENT"||y==="ENOTDIR"||y==="ELOOP")return new Response(null,{status:404});throw c}finally{a?.removeEventListener("abort",g);}return new Response(u,{status:200})})}
|
|
1
|
+
import {c as c$1,o,d as d$1,f,y,v,j as j$2,r,m,x,l as l$1}from'./chunk-IGR23DV2.js';import {j as j$1,l,k,q as q$1,h,n,c as c$2,g,_ as _$1,Z,aa}from'./chunk-JSIX2EOH.js';import'./chunk-RIYSCEFQ.js';import {d,e}from'./chunk-KAXOGCGA.js';export{d as ExportResourceError,c as createNodeImageDecodePort,b as exportDestinationNamed,e as openDocumentForExport}from'./chunk-KAXOGCGA.js';import {c,ea,sa,ic,jc as jc$1,$,fa,h as h$1,a,d as d$3,dd,b as b$1,i,zb,jd,Cb,Eb,Bb,id,Fb,Db,Gb,Ab,p,s,n as n$1,gc}from'./chunk-VIPMGGUT.js';import {d as d$2,b,a as a$1}from'./chunk-HAQ72KD7.js';import'./chunk-6ZQMII6V.js';import {ab}from'./chunk-GWQJ5774.js';import {Lg,Mg,kc,jc,fa as fa$1,E,Ue,oa,hf,pa}from'./chunk-UMRSBLO7.js';function _(e,o,t){if(o.environment.features.smcp!==1||!/\p{Ll}/u.test(o.text))return t;let n={...o,environment:{...o.environment,features:{...o.environment.features,smcp:0}}},r=e.shape(n);if(t.glyphs.length!==r.glyphs.length||t.glyphs.some((u,c)=>u.id!==r.glyphs[c]?.id))return t;let i=[],s=0;for(let u of o.text){let c=u.toUpperCase()!==u,y=i.at(-1);y&&(y.lower===c||/\p{M}/u.test(u))?y.text+=u:i.push({text:u,start:s,lower:c}),s+=u.length;}let a=[],p=[],l=[],d=true,g=0;for(let u of o.environment.direction==="rtl"?i.reverse():i){let c=u.lower?.8:1,y=[],R=[],b="",f=u.start;for(let F of u.text){let m=u.lower?F.toUpperCase():F;for(let E=0;E<m.length;E++)y.push(f),R.push(f+F.length);b+=m,f+=F.length;}let h=e.shape({...n,text:b}),x=a.length;for(let[F,m]of h.glyphs.entries()){let E=h.exactAdvancesX?.[F];E===void 0?d=false:l.push(E*c),a.push({...m,cluster:y[m.cluster]??u.start,originX:n$1(g+Math.round(m.originX*c)),originY:n$1(Math.round(m.originY*c)),offsetX:n$1(Math.round(m.offsetX*c)),offsetY:n$1(Math.round(m.offsetY*c)),advanceX:n$1(Math.round(m.advanceX*c)),advanceY:n$1(Math.round(m.advanceY*c)),drawScale:c});}for(let F of h.clusters){let m=y[F.textStart]??u.start,E=R[F.textEnd-1]??f,T=n$1(Math.round(F.advance*c)),A=p.at(-1);A&&A.textStart===m&&A.textEnd===E?p[p.length-1]={...A,glyphEnd:x+F.glyphEnd,advance:n$1(A.advance+T),caretEdges:[n$1(0),n$1(A.advance+T)]}:p.push({...F,textStart:m,textEnd:E,glyphStart:x+F.glyphStart,glyphEnd:x+F.glyphEnd,advance:T,caretEdges:F.caretEdges.map(G=>n$1(Math.round(G*c))),fontSpan:0});}g+=h.glyphs.reduce((F,m)=>F+Math.round(m.advanceX*c),0);}return {...t,glyphs:a,clusters:p,fontSpans:[{...t.fontSpans[0],glyphStart:0,glyphEnd:a.length}],exactAdvancesX:d&&l.length===a.length?l:void 0}}var st=new WeakMap;function Ut(e){let o=st.get(e);return o===void 0&&(o=zt(e.bytes,e.faceIndex),st.set(e,o)),o}var Bt=new Set(["COLR","CBDT","sbix"]),qt=512;function zt(e,o){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.byteLength<12)return false;let n=0;if(lt(e,0)==="ttcf"){let i=t.getUint32(8);if(o<0||o>=i||12+4*o+4>e.byteLength||(n=t.getUint32(12+4*o),n+12>e.byteLength))return false}let r=Math.min(t.getUint16(n+4),qt);for(let i=0;i<r;i++){let s=n+12+i*16;if(s+4>e.byteLength)return false;if(Bt.has(lt(e,s)))return true}return false}function lt(e,o){return String.fromCharCode(e[o],e[o+1],e[o+2],e[o+3])}var jt=/\p{Emoji_Presentation}|️/u;function Ht(e){return jt.test(e)}function q(e,o){if(e.length<2)return e;let t=e.filter(Ut);if(t.length===0||t.length===e.length)return e;let n=e.filter(r=>!t.includes(r));return Ht(o)?[...t,...n]:[...n,...t]}var Xt=2048;function dt(e,o,t,n){if(!t.clusters.length||t.clusters.length>Xt)return null;let r=(f,h)=>{let{context:x,...F}=o,m={...F,text:h,environment:p({...o.environment,font:f})};return _(e,m,e.shape(m))},i=[],s$1=new Map;for(let f of [...t.clusters].sort((h,x)=>h.textStart-x.textStart)){let h=o.environment.font,x=o.text.slice(f.textStart,f.textEnd),F=i.at(-1);if(/^[\uFE0E\uFE0F]$/.test(x)&&F&&F.end===f.textStart){F.end=f.textEnd;continue}if(o.environment.script==="Hebr"&&/^\s+$/u.test(x)&&F&&F.font!==o.environment.font&&F.end===f.textStart){F.end=f.textEnd;continue}if(t.glyphs.slice(f.glyphStart,f.glyphEnd).some(E=>E.id===0)){let E=o.text.slice(f.textStart,f.textEnd+1),T=s$1.get(x)??q(n,E).find(A=>{try{return !r(A,x).glyphs.some(G=>G.id===0)}catch{return false}});if(!T)return null;s$1.set(x,T),h=T;}let m=i.at(-1);m&&m.font===h&&m.end===f.textStart?m.end=f.textEnd:i.push({start:f.textStart,end:f.textEnd,font:h});}let a=[],p$1=[],l=[],d=[],g=true,u=0,c=0,y=0,R=0,b=0;for(let f of o.environment.direction==="rtl"?i.reverse():i){let h=r(f.font,o.text.slice(f.start,f.end));if(h.glyphs.some(m=>m.id===0))return null;let x=a.length,F=l.length;for(let m of h.glyphs)a.push({...m,cluster:f.start+m.cluster,originX:n$1(u+m.originX),originY:n$1(c+m.originY)});if(h.exactAdvancesX===void 0)g=false;else for(let m of h.exactAdvancesX)d.push(m);for(let m of h.clusters)p$1.push({...m,textStart:f.start+m.textStart,textEnd:f.start+m.textEnd,glyphStart:x+m.glyphStart,glyphEnd:x+m.glyphEnd,fontSpan:F});h.glyphs.length&&l.push({font:f.font,glyphStart:x,glyphEnd:a.length,fallbackIndex:f.font===o.environment.font?null:n.indexOf(f.font)}),u+=h.glyphs.reduce((m,E)=>m+E.advanceX,0),c+=h.glyphs.reduce((m,E)=>m+E.advanceY,0),y=Math.max(y,h.metrics.ascent),R=Math.max(R,h.metrics.descent),b=Math.max(b,h.metrics.lineGap);}return s({...t,glyphs:a,clusters:p$1,fontSpans:l,exactAdvancesX:g&&d.length===a.length?d:void 0,metrics:{ascent:n$1(y),descent:n$1(R),lineGap:n$1(b)}},{...o.environment,fallbackOrder:n})}var Gt=new Map([["Beng",["bng2","beng"]],["Deva",["dev2","deva"]],["Gujr",["gjr2","gujr"]],["Guru",["gur2","guru"]],["Knda",["knd2","knda"]],["Mlym",["mlm2","mlym"]],["Orya",["ory2","orya"]],["Taml",["tml2","taml"]],["Telu",["tel2","telu"]],["Nkoo",["nko "]]]),Vt=512,ut=new WeakMap;function Wt(e,o){let t=new Set,n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=c=>c+2<=n.byteLength?n.getUint16(c):-1,i=c=>c+4<=n.byteLength?n.getUint32(c):-1,s=c=>c+4<=n.byteLength?String.fromCharCode(n.getUint8(c),n.getUint8(c+1),n.getUint8(c+2),n.getUint8(c+3)):"",a=0;if(s(0)==="ttcf"){let c=i(8);if(c<0||o<0||o>=c||(a=i(12+o*4),a<0))return t}let p=r(a+4);if(p<0||p>1024)return t;let l=-1;for(let c=0;c<p;c+=1){let y=a+12+c*16;if(s(y)==="GSUB"){l=i(y+8);break}}if(l<0)return t;let d=r(l+4);if(d<=0)return t;let g=l+d,u=r(g);if(u<0)return t;for(let c=0;c<Math.min(u,Vt);c+=1){let y=s(g+2+c*6);y&&t.add(y);}return t}function Yt(e,o){let t=ut.get(e);return t||(t=Wt(e.bytes,e.faceIndex),ut.set(e,t)),(Gt.get(o)??[o.toLowerCase()]).some(r=>t.has(r))}function ct(e,o){let t=e.filter(n=>Yt(n,o));return t.length===0||t.length===e.length?e:[...t,...e.filter(n=>!t.includes(n))]}function J(e,o,t){if(!o.text.includes("\u2011"))return t;let n=new Set(t.glyphs.filter(i=>i.id===0).map(i=>i.cluster));if(!n.size)return t;let r=o.text.replace(/\u2011/g,(i,s)=>n.has(s)?"-":i);if(r===o.text)return t;try{let i=e.shape({...o,text:r});return s({...i,text:o.text},o.environment)}catch{return t}}function pt(e,o){if(o.length===0)return e;if(o.length>16)throw new RangeError("At most 16 glyph fallback faces are supported");let t=o.map(a=>e.fonts.resolve(a)).filter(a=>!(a instanceof d$3)),n={shape(a){return J(e.shaper,a,e.shaper.shape(a))}},r=new WeakMap,i={shape(a){let p=e.shaper.shape(a),l=r.get(p);if(l&&l.input.text===a.text&&l.input.fontSizeHalfPoints===a.fontSizeHalfPoints&&l.input.bidiLevel===a.bidiLevel&&l.input.context?.before===a.context?.before&&l.input.context?.after===a.context?.after&&l.input.environment===a.environment)return l.run;let d=s(a,J(e.shaper,a,p));return r.set(p,{input:a,run:d}),d}},s=(a,p$1)=>{let l=_(n,a,p$1);if(!l.glyphs.some(d=>d.id===0)||/^[\t\n\r\f]*$/.test(a.text))return l;if(/^(Latn|Cyrl|Grek|Hebr|Hani|Hira|Kana|Hang|Zyyy|Zinh)$/.test(a.environment.script)){let d=dt(n,a,l,t);if(d)return d}for(let d of ct(q(t,a.text),a.environment.script))if(!(d.hash===a.environment.font.hash&&d.faceIndex===a.environment.font.faceIndex))try{let g={...a,environment:p({...a.environment,font:d})},u=_(n,g,n.shape(g));if(!u.glyphs.some(c=>c.id===0))return u}catch{}return l};return {...e,shaper:i}}var Q=b$1;function ee(e){return typeof e.admittedFontFace=="function"}var $t=Object.freeze([{weight:400,style:"normal"},{weight:700,style:"normal"},{weight:400,style:"italic"},{weight:700,style:"italic"}]);function z(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var ft=new WeakMap;function j(e){let o=ft.get(e);return o||ft.set(e,o=Kt(e)),o}function Kt(e){let o=e.substitution;return Object.freeze({id:e.id,identity:e.identity,family:e.family,request:z(e.request),byteLength:e.byteLength,hash:e.hash,faceIndex:e.faceIndex,substitution:o?Object.freeze({requested:z(o.requested),resolved:z(o.resolved),...o.lineMetrics?{lineMetrics:Object.freeze({...o.lineMetrics})}:{}}):null})}function Zt(e){return Object.freeze({...j(e),bytes:i(e)})}function Jt(e,o){if(!e)return null;try{let t=e(o);return !t||t instanceof d$3?null:Zt(t)}catch{return null}}function mt(e){return o=>{if(e.status()!=="active")throw e.unavailable();return Jt(e.resolve(),o)}}function Qt(e){return Object.freeze(e.slice(0,Q).map(o=>Object.freeze({request:z(o.request),partName:o.partName,reason:o.reason})))}function te(e,o,t,n,r=[]){let i=new Map;for(let a of [...e,o]){let p=a.toLowerCase();i.has(p)||i.set(p,a);}let s=[...i.values()].map(a=>{let p=[];for(let l of $t){let d=n?.({family:a,...l});!d||d instanceof d$3||p.push(Object.freeze({...l,sourceFamily:d.family,via:d.substitution?"substitution":"direct",identity:d.identity,id:d.id,hash:d.hash,faceIndex:d.faceIndex,substitution:d.substitution}));}return Object.freeze({family:a,coverage:p.length===4?"complete":p.length>0?"partial":"none",faces:Object.freeze(p)})});return Object.freeze({requestedFamilies:Object.freeze([...e]),defaultFamily:o,families:Object.freeze(s),originFailures:Object.freeze([...t]),droppedEmbeddedFonts:Qt(r)})}function oe(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 ne(e,o,t=[]){let n=l=>l.trim().toLowerCase(),r=new Set([...e.requestedFamilies,e.defaultFamily].map(n)),i=new Set(t.map(l=>n(l.family))),s=l=>{if(!(l instanceof l$1))return true;let d=n(l.request.family);return r.has(d)||!i.has(d)},a=e.originFailures.some(({cause:l})=>l instanceof m?l.causes.length===0||l.causes.some(s):s(l));if(o.fontPolicy!=="strict"||!a&&e.families.every(l=>l.coverage==="complete"))return;let p=e.families.filter(l=>l.coverage!=="complete").map(l=>l.family).join(", ");throw new d("layoutFailed",`Strict font policy refused export${p?`; incomplete families: ${p}`:"; a font origin failed"}`)}function H(){return new Map}function re(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=h$1(r),s=o.get(i);if(!s){try{s=e.fonts.resolve(r);}catch{return null}o.set(i,s);}return s instanceof d$3?null:s}function yt(e,o,t){let n=t.fontFamily??e.defaultFont.family;return re(e,o,n,t)}function ie(e){return typeof e.shapeLaidOutText=="function"}function ae(e){let o=H(),t=new WeakMap;return n=>{let r=sa(n.style,n.fontSlot),i=ic(n)?jc$1(n):$(n.text,r);if(i.length===0)return null;let s=r.fontFamily??e.defaultFont.family,a=re(e,o,s,r);if(!a)return null;try{if(r.smallCaps&&!_$1(e.shaper,e.environment,a,r,t))return null;let p=Z(e.shaper,e.environment,a,r,i);return Object.freeze({run:p,font:j(p.fontSpans[0]?.font??a),...p.fontSpans.length>1?{fonts:Object.freeze(p.fontSpans.map(l=>j(l.font)))}:{},fixedPointScale:e.environment.fixedPointScale})}catch{return null}}}function ht(e){return o=>{if(e.status()!=="active")throw e.unavailable();return e.shaping()?.shapeLaidOutText(o)??null}}var N=new Map,X=new WeakMap,se=0,M,le=32,gt=c;function xt(){if(M)return M;let e=(async()=>(await c$2(),g(h)))();return M=e,e.catch(()=>{M===e&&(M=void 0);}),e}function Ft(e){let o=H();return aa(e,{resolveFont(t){return yt(e,o,t)},fallback:fa()})}async function Et(e,o,t=[],n=false){if(!j$1(e))throw new TypeError("Session exporter shaping requires a prepared font handle");let r=await xt(),i=pt(await q$1(e,r,h,o,n),t);return Object.freeze({createMeasurer:()=>Ft(i),resolveFont:s=>i.fonts.resolve(s),shapeLaidOutText:ae(i),producer:["node-export-session",JSON.stringify(t),e.fingerprint,i.operation.shapingHash,`producer:${i.operation.producerVersion}`,`fallback:${ea}`].join("|"),extensionFingerprint:e.fingerprint})}function eo(e,o){if(!j$1(e))return Promise.reject(new TypeError("Shared exporter shaping requires a prepared font handle"));let t=X.get(e);if(t)return t;let n=l(e),r=N.get(n);if(!r){if(N.size>=le)return Promise.reject(new RangeError(`Shared exporter shaping is limited to ${le} process-wide configurations`));r=(async()=>{let p=k(e).sources.reduce((d,g)=>d+(g.availability==="forbidden"?0:g.bytes.byteLength),0);if(se+p>gt)throw new RangeError(`Shared exporter shaping font bytes are limited to ${gt} process-wide`);se+=p;let l;try{let d=await xt();l=await q$1(e,d,h,o);}catch(d){throw se-=p,d}return Object.freeze({createMeasurer:()=>Ft(l),shapeLaidOutText:ae(l),shapingHash:l.operation.shapingHash,producerVersion:l.operation.producerVersion})})(),N.set(n,r),r.catch(()=>{N.get(n)===r&&N.delete(n);});}let i=e.fingerprint,s=r.then(a=>Object.freeze({createMeasurer:a.createMeasurer,shapeLaidOutText:a.shapeLaidOutText,producer:["node-export",i,a.shapingHash,`producer:${a.producerVersion}`,`fallback:${ea}`].join("|"),extensionFingerprint:i}));return X.set(e,s),s.catch(()=>{X.get(e)===s&&X.delete(e);}),s}var to="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";function oo(e){let o=e.currentPackage(),t=(o.relationships.get(o.mainDocumentPart)??[]).find(r=>r.type===to),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"),Ue(o,n)}function bt(e,o){let t=oo(e);if(t.length!==0)return j$2(n=>{let r$1=new Set((n.resolvedFaces??[]).map(s=>h$1(s))),i=r(t,{maxFontBytes:a,aggregateBudget:no(n),shadowedRequests:r$1});if(o)for(let s of i.dropped){if(o.dropped.length>=Q)break;o.dropped.push(s);}return {sources:i.sources}})}function no(e){let o=e.committedSourceBytes;return o===void 0||!Number.isSafeInteger(o)||o<=0?c:Math.max(0,c-o)}function ro(e){return ee(e)&&ie(e)}var w=0,Rt=Symbol("font-resolution-timeout");function io(e){let o=0,t=false;return e?.(w),{reserve:r=>{if(t)throw new Error("Document font-byte lease is already released");if(w+r>c)throw new d("layoutFailed",`Active document export font bytes are limited to ${c}; requested ${r} bytes with ${w} bytes already active`);w+=r,o+=r,e?.(w);let i=false;return ()=>{i||t||(i=true,w-=r,o-=r,e?.(w));}},release:()=>{t||(t=true,w-=o,o=0,e?.(w));}}}function ue(e,o){return e.attributes.find(t=>t.localName===o)?.value}function ao(e,o){return e.attributes.find(t=>t.localName===o&&(t.namespaceUri===fa$1||t.namespaceUri===""))?.value}async function so(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=ab(e$1);if(!t.ok)return t;let{fonts:n,lastResortFonts:r,fontResolutionTimeoutMs:i,fontPolicy:s,onFontResolution:a,glyphFallbacks:p,documentLigatures:l,...d$1}=o,g=Array.isArray(n)?n:[n],u=r===void 0?[]:Array.isArray(r)?r:[r],c,y;try{y=await lo(t.view,g,{signal:o.signal,timeoutMs:i??o.resourceTimeoutMs,fontPolicy:s,glyphFallbacks:p,documentLigatures:l,lastResortFonts:u,onFontResolution:E=>(c=E,a?.(E))});}catch(E){if(E instanceof d&&E.code==="aborted")return {ok:false,reason:"aborted"};throw E}if(!c)throw y?.dispose(),new d("layoutFailed","Document font resolution completed without publishing its evidence");let R;try{R=e(t.view,{...d$1,reuseAcrossRevisions:!1,...y?{measurer:y.createMeasurer(),producer:o.producer??y.producer}:o.producer?{producer:o.producer}:{}});}catch(E){throw y?.dispose(),E}if(!R.ok)return y?.dispose(),R;let b=R.session,f=y,h="active",x=()=>h==="aborted"?new d("aborted","Export resource settlement was aborted"):new d("disposed","Export session has been disposed"),F=E=>{if(h==="active"){h=E,o.signal?.removeEventListener("abort",m);try{b.dispose();}finally{f?.dispose(),f=void 0;}}},m=()=>F("aborted");return o.signal?.addEventListener("abort",m,{once:true}),o.signal?.aborted&&m(),{ok:true,session:Object.freeze({fontResolution:c,layout:()=>h==="active"?b.layout():Promise.reject(x()),layoutFor:E=>h==="active"?b.layoutFor(E):Promise.reject(x()),validatedImageBytes:E=>h==="active"?b.validatedImageBytes(E):null,admittedFontFace:mt({status:()=>h,unavailable:x,resolve:()=>f?.resolveFont}),shapeLaidOutText:ht({status:()=>h,unavailable:x,shaping:()=>f}),dispose:()=>F("disposed")})}}async function lo(e,o$1,t={}){if((t.glyphFallbacks?.length??0)>16)throw new RangeError("At most 16 glyph fallback faces are supported");let n$1=uo(t.timeoutMs),r=new AbortController,i=()=>r.abort(t.signal?.reason);t.signal?.addEventListener("abort",i,{once:true}),t.signal?.aborted&&i();let s=setTimeout(()=>r.abort(Rt),n$1);try{de(r.signal);let a=(async()=>{let p=io(t.onActiveFontBytesChange),l=!1;try{let d=po(e).slice(0,c$1),g=[],u={dropped:[]},c=bt(e,u),y=[...o$1,...c?[c]:[],...t.lastResortFonts??[]],R=await o(y,{families:[...new Set([...(t.glyphFallbacks??[]).map(x=>x.family),...d])].slice(0,c$1),defaultFamily:d$1.family,signal:r.signal},{onOriginFailure:x=>g.push(x),reserveOwnedBytes:p.reserve,maxExecutionFontBytes:h.maxFontBytes});de(r.signal);let b=f(R??{});if(b.sources.length===0){let x=te(d,b.defaultFont.family,g,void 0,u.dropped);oe(x,t),ne(x,t,t.glyphFallbacks);return}let f$1=await Et(n(b),void 0,t.glyphFallbacks,t.documentLigatures);de(r.signal);let h$1=te(d,b.defaultFont.family,g,f$1.resolveFont,u.dropped);return oe(h$1,t),ne(h$1,t,t.glyphFallbacks),l=!0,Object.freeze({...f$1,dispose:p.release})}finally{l||p.release();}})();return await Promise.race([a,co(r.signal)])}finally{clearTimeout(s),t.signal?.removeEventListener("abort",i);}}function uo(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 co(e){return new Promise((o,t)=>{let n=()=>{t(St(e));};e.aborted?n():e.addEventListener("abort",n,{once:true});})}function St(e){let o=e.reason===Rt;return new d(o?"timedOut":"aborted",o?"Font resolution timed out":"Font resolution was aborted",o?void 0:{cause:e.reason})}function de(e){if(e.aborted)throw St(e)}function po(e){let o=[e.part().root],t=[],n=[],r=new Set([e.part().name]),i=(d,g)=>{!g||r.has(g.name)||(r.add(g.name),d.push(g.root));};for(let d of e.headerFooterPartsBySection()){for(let g of d.headers.values())i(t,g);for(let g of d.footers.values())i(t,g);}for(let d of ["footnote","endnote"])n.push(...fo(e,d));let s=e.documentThemeFonts(),a={...s,major:s.major,minor:s.minor,majorEastAsia:s.majorEastAsia??null,minorEastAsia:s.minorEastAsia??null},p=new Map,l=(d,g)=>{let u=d$2(d,e.stylesRoot(),a,yo(d,g)),c=y(d,e.numberingRoot(),e.stylesRoot(),a);for(let y of [...u.direct,...xo(d),...c,...v(d,e.stylesRoot(),a),...u.inherited]){let R=y.toLowerCase();p.has(R)||p.set(R,y);}};return l(o,"body"),l(t,"furniture"),l(n,"note"),[...p.values()]}function fo(e,o){let t=Lg(e.currentPackage(),o);if(!t)return [];let n=new Set(Mg(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 s=kc(i),a=jc(i);(s==="separator"||s==="continuationSeparator"||a!==null&&n.has(a))&&r.push(i);}return r}var mo="http://schemas.openxmlformats.org/officeDocument/2006/math";function yo(e,o){let t=new Set;for(let n of e){let r=[],i=[{node:n,context:o}];for(;i.length>0;){let{node:s,context:a}=i.pop();s.namespaceUri===fa$1&&s.localName==="p"&&r.push({paragraph:s,context:a});let p=s.namespaceUri===fa$1&&s.localName==="txbxContent"&&(a==="body"||a==="note")?"detached":a;for(let l=s.children.length-1;l>=0;l-=1){let d=s.children[l];d.kind!=="textValue"&&i.push({node:d,context:p});}}for(let s of r)ho(s.paragraph,t,s.context);}return t}function ho(e,o,t){let n=zb(),r=null,i=null,s="",a=false,p=false,l=false,d=0,g=[];for(let u=e.children.length-1;u>=0;u-=1){let c=e.children[u];c.kind!=="textValue"&&g.push({node:c,runId:null,visibility:D,containerDepth:0});}for(;g.length>0;){let{node:u,runId:c,visibility:y,containerDepth:R}=g.pop();if(R>=oa||u.namespaceUri===fa$1&&u.localName==="p")continue;let b=u.namespaceUri===fa$1&&u.localName==="r"?u.id:c;if(u.namespaceUri===fa$1&&u.localName==="fldSimple"){let f=ue(u,"instr")??"";jd(f,{allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&go(u)!==D&&o.add(u.id);}if(u.namespaceUri===fa$1&&u.localName==="fldChar"){let f=ue(u,"fldCharType");if(f==="begin")Cb(n),n.nesting===1&&(r=b,i=null,s="",a=false,p=false,l=hf(u),d=0);else if(f==="separate"){let h=n.nesting===1;if(Eb(n),h){let x=Bb(n);s=x.instruction,a=x.overflow||n.nestingOverflow,i=b,p=true;}}else if(f==="end"){if(n.nesting===1){if(n.phase==="instruction"){let x=Bb(n);s=x.instruction,a=x.overflow||n.nestingOverflow;}if(!a&&id(s,{hasSeparate:p,hasLegacyFormData:l,allowPageFields:t==="body"||t==="furniture",allowRefFields:t==="body"||t==="note",allowPageRef:t==="body",allowAutonum:t==="body"||t==="note"})&&d!==D){let x=i??r;x&&o.add(x);}}Fb(n);}continue}if(u.namespaceUri===fa$1&&(u.localName==="instrText"||u.localName==="delInstrText")){Db(n,Lt(u),u.localName==="delInstrText");continue}n.nesting>0&&Gb(n)&&u.namespaceUri===fa$1&&Ot(u)&&(d|=y);for(let f=u.children.length-1;f>=0;f-=1){let h=u.children[f];h.kind!=="textValue"&&g.push({node:h,runId:b,visibility:y&At(u),containerDepth:pa(u,R)});}}Ab(n);}function Ot(e){return e.localName==="t"||e.localName==="delText"?Lt(e).length>0:e.localName==="sym"||e.localName==="tab"||e.localName==="br"}var ce=1,vt=2,wt=4,D=ce|vt|wt;function go(e){let o=[];for(let n of e.children)n.kind!=="textValue"&&o.push({node:n,visibility:D});let t=0;for(;o.length>0;){let{node:n,visibility:r}=o.pop();if(!(n.namespaceUri===fa$1&&n.localName==="p")){if(n.namespaceUri===fa$1&&Ot(n)&&(t|=r,t===D))return t;for(let i of n.children)i.kind!=="textValue"&&o.push({node:i,visibility:r&At(n)});}}return t}function At(e){return e.namespaceUri!==fa$1?D:e.localName==="ins"||e.localName==="moveTo"?ce|vt:e.localName==="del"||e.localName==="moveFrom"?ce|wt:D}function xo(e){let o=new Map,t=n=>{let r=a$1(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===mo&&t(gc),i.namespaceUri===fa$1&&i.localName==="sym"&&t(b(ao(i,"font"))),i.namespaceUri===fa$1&&i.localName==="fldSimple"){let s=ue(i,"instr");t(dd(s??"")?.font??null);}if(i.namespaceUri===fa$1&&i.localName==="p")for(let s of x(i))t(s);for(let s=i.children.length-1;s>=0;s-=1){let a=i.children[s];a.kind!=="textValue"&&r.push(a);}}}return [...o.values()]}function Lt(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 Dt="FILE_TOO_LARGE",Tt=8;function Fo(e){return typeof e=="object"&&e!==null}function kt(e){if(!(!Fo(e)||typeof e.code!="string"))return e.code}function It(e){return e===""||e.toLowerCase()==="localhost"}function Eo(e){try{let o=decodeURIComponent(e);return o.includes("\0")?null:o}catch{return null}}function _t(e){let o=Eo(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 Nt(e){let o=_t(e);return o===null?null:o.endsWith("/")?o:`${o}/`}function bo(e){return e==="/"||/^\/[A-Za-z]:\/$/.test(e)}function Ro(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(!It(o.host))throw new TypeError("trustedRoot must be a local file: URL");let t=Nt(o.pathname);if(t===null||bo(t))throw new TypeError("trustedRoot must be a directory inside the filesystem");let n=new URL("file:///");return n.pathname=t,n}function So(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 Oo(e){let o=So(e);if(o.length===0)throw new TypeError("trustedRoot must name at least one directory");if(o.length>Tt)throw new TypeError(`trustedRoot must not exceed ${Tt} directories`);return o.map(Ro)}function vo(e){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxBytes must be a positive safe integer");if(e>a)throw new TypeError(`maxBytes must not exceed ${a}`);return e}function wo(e,o){if(e.protocol!=="file:"||e.username!==""||e.password!==""||!It(e.host))return null;let t=_t(e.pathname);if(t===null)return null;for(let n of o){let r=Nt(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 Ao(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 Lo(e,o,t){let n=t.relative(t.resolve(e),t.resolve(o));return n!==""&&!n.startsWith("..")&&!t.isAbsolute(n)}function Pt(e,o,t){return e.some(n=>Lo(n,o,t))}async function To(e,o){let t=[];for(let n of e)try{t.push(await o(n));}catch(r){if(kt(r)==="ENOENT")continue;throw r}return t}function Po(e){return async(o,{signal:t,maxBytes:n})=>{if(t?.aborted)throw t.reason;let[{open:r,realpath:i},{constants:s},{fileURLToPath:a},p]=await Promise.all([import('fs/promises'),import('fs'),import('url'),import('path')]),l=e.map(y=>p.resolve(a(y.href))),d=p.resolve(a(typeof o=="string"?o:o.href));if(!Pt(l,d,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let g=typeof s.O_NOFOLLOW=="number"?s.O_RDONLY|s.O_NOFOLLOW:"r",u=await r(d,g),c=()=>{u.close();};t?.addEventListener("abort",c,{once:true});try{if(t?.aborted)throw t.reason;let y=await i(d);if(!Pt(await To(l,i),y,p))throw Object.assign(new Error("packaged file is outside trustedRoot"),{code:"ENOENT"});let R=(await u.stat()).size;if(!Number.isSafeInteger(R)||R<0||R>n)throw Object.assign(new Error("packaged file exceeds maxBytes"),{code:Dt});let b=new Uint8Array(R),f=0;for(;f<b.byteLength;){if(t?.aborted)throw t.reason;let{bytesRead:h}=await u.read(b,f,b.byteLength-f,f);if(h===0)break;f+=h;}if(t?.aborted)throw t.reason;return f===b.byteLength?b:b.slice(0,f)}catch(y){throw t?.aborted?t.reason:y}finally{t?.removeEventListener("abort",c),await u.close().catch(()=>{});}}}function Do(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=Oo(e.trustedRoot),t=vo(e.maxBytes),n=e.read??Po(o),r=e.networkFetch??fetch;return(async(i,s)=>{let a=s?.signal;if(a?.aborted)throw a.reason;let p=Ao(i);if(p.protocol!=="file:")return r(p,s);let l=wo(p,o);if(!l)return new Response(null,{status:404});let d=a?new AbortController:void 0,g=()=>d?.abort(a?.reason);a?.addEventListener("abort",g,{once:true});let u;try{if(u=await n(l,{maxBytes:t,...d?{signal:d.signal}:{}}),a?.aborted)throw a.reason;if(u.byteLength>t)return new Response(null,{status:413})}catch(c){if(a?.aborted)throw a.reason;if(d?.signal.aborted)throw d.signal.reason??c;if(c instanceof DOMException&&c.name==="AbortError"||c instanceof Error&&c.name==="AbortError")throw c;let y=kt(c);if(y===Dt)return new Response(null,{status:413});if(y==="ENOENT"||y==="ENOTDIR"||y==="ELOOP")return new Response(null,{status:404});throw c}finally{a?.removeEventListener("abort",g);}return new Response(u,{status:200})})}
|
|
2
2
|
export{le as MAX_SHARED_EXPORT_SHAPING_CONFIGURATIONS,eo as acquireSharedExportShaping,Do as createPackagedFileFetch,ee as hasExportAdmittedFont,ie as hasExportLaidOutText,ro as hasFontBackedExportCapabilities,so 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-B3OBYNrF.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 { Q as OoxmlPackage, O as OoxmlPart, Z as OoxmlElement, Y as OoxmlPackageRejection } from './types-barrel-
|
|
1
|
+
import { H as HeaderFooterParts, b as HeaderFooterSectionResolution, T as TreePackageStore } from './tree-package-fragment-DYZIk1rY.js';
|
|
2
|
+
import { Q as OoxmlPackage, O as OoxmlPart, Z as OoxmlElement, Y as OoxmlPackageRejection } from './types-barrel-BFKR8Pzp.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 { a0 as DrawingProjection, Q as OoxmlPackage } from './types-barrel-
|
|
1
|
+
import { a0 as DrawingProjection, Q as OoxmlPackage } from './types-barrel-BFKR8Pzp.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The engine's trust-boundary caps: recursion depth, element counts, and the rest.
|