ooxml-core 1.32.1 → 1.33.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/{PptxHandler-TESZUH66.cjs → PptxHandler-MGKMIK22.cjs} +3 -3
- package/dist/PptxHandler-Q7CFNKOU.mjs +7 -0
- package/dist/PptxHandler-TEC7SWBU.mjs +4 -0
- package/dist/{PresentationBuilder-3CH5TR4W.mjs → PresentationBuilder-PJMQRZI6.mjs} +2 -2
- package/dist/{PresentationBuilder-S6HXHKEJ.mjs → PresentationBuilder-SADKXDWC.mjs} +4 -4
- package/dist/{PresentationBuilder-5NFBUP7Y.cjs → PresentationBuilder-VP2637RH.cjs} +5 -5
- package/dist/automation/index.cjs +4398 -2262
- package/dist/automation/index.mjs +4398 -2262
- package/dist/chart/funnel-geometry.d.ts +1 -1
- package/dist/chart/funnel-geometry.d.ts.map +1 -1
- package/dist/chart/index.cjs +5743 -3820
- package/dist/chart/index.mjs +5736 -3821
- package/dist/chart/region-map/alias.d.ts +12 -0
- package/dist/chart/region-map/alias.d.ts.map +1 -0
- package/dist/chart/region-map/cache.d.ts +20 -0
- package/dist/chart/region-map/cache.d.ts.map +1 -0
- package/dist/chart/region-map/colors.d.ts +4 -0
- package/dist/chart/region-map/colors.d.ts.map +1 -0
- package/dist/chart/region-map/data.d.ts +45 -0
- package/dist/chart/region-map/data.d.ts.map +1 -0
- package/dist/chart/region-map/geographic-projection.d.ts +4 -0
- package/dist/chart/region-map/geographic-projection.d.ts.map +1 -0
- package/dist/chart/region-map/geometry.d.ts +10 -0
- package/dist/chart/region-map/geometry.d.ts.map +1 -0
- package/dist/chart/region-map/index.cjs +892 -0
- package/dist/chart/region-map/index.d.ts +12 -0
- package/dist/chart/region-map/index.d.ts.map +1 -0
- package/dist/chart/region-map/index.mjs +870 -0
- package/dist/chart/region-map/projection.d.ts +19 -0
- package/dist/chart/region-map/projection.d.ts.map +1 -0
- package/dist/chart/region-map/types.d.ts +39 -0
- package/dist/chart/region-map/types.d.ts.map +1 -0
- package/dist/chart/region-map/value-color-positions.d.ts +4 -0
- package/dist/chart/region-map/value-color-positions.d.ts.map +1 -0
- package/dist/chart/region-map/value-colors.d.ts +4 -0
- package/dist/chart/region-map/value-colors.d.ts.map +1 -0
- package/dist/chart/region-map/world-regions.d.ts +22 -0
- package/dist/chart/region-map/world-regions.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-camera.d.ts +26 -0
- package/dist/chart/render/chart-3d-camera.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-layout.d.ts +27 -0
- package/dist/chart/render/chart-3d-layout.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-marks.d.ts +10 -0
- package/dist/chart/render/chart-3d-marks.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-mesh.d.ts +32 -0
- package/dist/chart/render/chart-3d-mesh.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-pie.d.ts +16 -0
- package/dist/chart/render/chart-3d-pie.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-projection.d.ts +37 -0
- package/dist/chart/render/chart-3d-projection.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-scene.d.ts +9 -0
- package/dist/chart/render/chart-3d-scene.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-shading.d.ts +10 -0
- package/dist/chart/render/chart-3d-shading.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-surface.d.ts +5 -0
- package/dist/chart/render/chart-3d-surface.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-svg.d.ts +7 -0
- package/dist/chart/render/chart-3d-svg.d.ts.map +1 -0
- package/dist/chart/render/chart-3d-walls.d.ts +13 -0
- package/dist/chart/render/chart-3d-walls.d.ts.map +1 -0
- package/dist/chart/render/chart-svg-funnel.d.ts.map +1 -1
- package/dist/chart/render/chart-svg-region-map.d.ts +4 -0
- package/dist/chart/render/chart-svg-region-map.d.ts.map +1 -0
- package/dist/chart/render/chart-svg-text-metrics.d.ts +2 -0
- package/dist/chart/render/chart-svg-text-metrics.d.ts.map +1 -1
- package/dist/chart/render/chart-svg.d.ts.map +1 -1
- package/dist/chart/render/chart-view.d.ts +5 -1
- package/dist/chart/render/chart-view.d.ts.map +1 -1
- package/dist/chart/render/index.d.ts +5 -0
- package/dist/chart/render/index.d.ts.map +1 -1
- package/dist/chart/render/render-space.d.ts.map +1 -1
- package/dist/chart/render/summary-ex-formatting.d.ts +5 -0
- package/dist/chart/render/summary-ex-formatting.d.ts.map +1 -0
- package/dist/chart/render/summary-ex-series.d.ts.map +1 -1
- package/dist/chart/render/summary-from-chartex.d.ts.map +1 -1
- package/dist/chart/render/summary-from-space.d.ts.map +1 -1
- package/dist/chart/render/summary.d.ts +5 -1
- package/dist/chart/render/summary.d.ts.map +1 -1
- package/dist/{chunk-Q6NM64J2.cjs → chunk-2LTIDUXH.cjs} +4791 -950
- package/dist/chunk-2N7RZQLC.mjs +8 -0
- package/dist/{chunk-NAWLWKOJ.mjs → chunk-3LMHYL4W.mjs} +2 -2
- package/dist/{chunk-O7SVHLD7.mjs → chunk-6LJW76BZ.mjs} +4756 -951
- package/dist/{chunk-X6VNUBES.cjs → chunk-BDZR4DZ6.cjs} +2058 -1748
- package/dist/{chunk-IOTGRLJH.mjs → chunk-BQGLWC6N.mjs} +867 -557
- package/dist/{chunk-N6424WKA.mjs → chunk-EBBWRRSB.mjs} +1 -1
- package/dist/{chunk-UYMSFJQZ.mjs → chunk-JQVOUS6B.mjs} +5 -5
- package/dist/{chunk-3H5UAJB3.mjs → chunk-QRXMYOVN.mjs} +870 -525
- package/dist/{chunk-54S5A5PZ.mjs → chunk-VDUNZTJC.mjs} +36 -1
- package/dist/{chunk-4R65YYAD.mjs → chunk-Y2RH4QWG.mjs} +4228 -1070
- package/dist/diagram/drawing-resolve.d.ts.map +1 -1
- package/dist/diagram/drawing-view.d.ts +6 -0
- package/dist/diagram/drawing-view.d.ts.map +1 -1
- package/dist/diagram/engine/engine-to-result.d.ts.map +1 -1
- package/dist/diagram/index.cjs +786 -145
- package/dist/diagram/index.d.ts +1 -0
- package/dist/diagram/index.d.ts.map +1 -1
- package/dist/diagram/index.mjs +783 -147
- package/dist/diagram/layout/smartart-layout-types.d.ts +7 -0
- package/dist/diagram/layout/smartart-layout-types.d.ts.map +1 -1
- package/dist/diagram/layout-preview.d.ts +4 -0
- package/dist/diagram/layout-preview.d.ts.map +1 -1
- package/dist/diagram/layout-role-style.d.ts +4 -0
- package/dist/diagram/layout-role-style.d.ts.map +1 -0
- package/dist/diagram/load.d.ts.map +1 -1
- package/dist/diagram/picture-layout.d.ts +23 -0
- package/dist/diagram/picture-layout.d.ts.map +1 -0
- package/dist/diagram/types.d.ts +6 -0
- package/dist/diagram/types.d.ts.map +1 -1
- package/dist/diagram/write/cache.d.ts +1 -0
- package/dist/diagram/write/cache.d.ts.map +1 -1
- package/dist/digest/crc32.d.ts +2 -0
- package/dist/digest/crc32.d.ts.map +1 -0
- package/dist/digest/index.cjs +11 -0
- package/dist/digest/index.d.ts +1 -0
- package/dist/digest/index.d.ts.map +1 -1
- package/dist/digest/index.mjs +11 -1
- package/dist/docx/diagram-cache.d.ts.map +1 -1
- package/dist/docx/diagram-save.d.ts.map +1 -1
- package/dist/docx/drawing.d.ts.map +1 -1
- package/dist/docx/embedded.cjs +882 -212
- package/dist/docx/embedded.mjs +882 -212
- package/dist/docx/index.cjs +3082 -866
- package/dist/docx/index.mjs +3082 -866
- package/dist/docx/inline-model.d.ts +4 -0
- package/dist/docx/inline-model.d.ts.map +1 -1
- package/dist/docx/layout/adapt-floats.d.ts.map +1 -1
- package/dist/docx/layout/adapter.d.ts.map +1 -1
- package/dist/docx/layout/floats.d.ts.map +1 -1
- package/dist/docx/layout/index.cjs +2200 -438
- package/dist/docx/layout/index.mjs +2200 -438
- package/dist/docx/layout/input.d.ts +3 -0
- package/dist/docx/layout/input.d.ts.map +1 -1
- package/dist/docx/layout/result.d.ts +3 -0
- package/dist/docx/layout/result.d.ts.map +1 -1
- package/dist/docx/load/index.cjs +1311 -641
- package/dist/docx/load/index.mjs +1311 -641
- package/dist/docx/parse.d.ts.map +1 -1
- package/dist/docx/ui/index.cjs +2832 -842
- package/dist/docx/ui/index.mjs +2832 -842
- package/dist/docx/ui/inline-content-schema.d.ts.map +1 -1
- package/dist/docx/ui/run-adapter.d.ts.map +1 -1
- package/dist/docx/write-drawing.d.ts.map +1 -1
- package/dist/drawingml/index.cjs +707 -111
- package/dist/drawingml/index.d.ts +7 -0
- package/dist/drawingml/index.d.ts.map +1 -1
- package/dist/drawingml/index.mjs +697 -113
- package/dist/drawingml/picture-artistic.d.ts +14 -0
- package/dist/drawingml/picture-artistic.d.ts.map +1 -0
- package/dist/drawingml/picture-effects.d.ts +4 -1
- package/dist/drawingml/picture-effects.d.ts.map +1 -1
- package/dist/drawingml/picture-fill.d.ts.map +1 -1
- package/dist/drawingml/picture-hsl-pixels.d.ts +4 -0
- package/dist/drawingml/picture-hsl-pixels.d.ts.map +1 -0
- package/dist/drawingml/picture-layout.d.ts +25 -0
- package/dist/drawingml/picture-layout.d.ts.map +1 -0
- package/dist/drawingml/picture-standard-effects.d.ts +15 -0
- package/dist/drawingml/picture-standard-effects.d.ts.map +1 -0
- package/dist/drawingml/picture-transfer.d.ts +11 -0
- package/dist/drawingml/picture-transfer.d.ts.map +1 -0
- package/dist/drawingml/raster-image.d.ts +29 -0
- package/dist/drawingml/raster-image.d.ts.map +1 -0
- package/dist/drawingml/types.d.ts +1 -0
- package/dist/drawingml/types.d.ts.map +1 -1
- package/dist/drawingml/write-pattern-picture.d.ts.map +1 -1
- package/dist/geometry/index.cjs +38 -0
- package/dist/geometry/index.d.ts +1 -0
- package/dist/geometry/index.d.ts.map +1 -1
- package/dist/geometry/index.mjs +36 -1
- package/dist/geometry/picture-tile.d.ts +29 -0
- package/dist/geometry/picture-tile.d.ts.map +1 -0
- package/dist/index.cjs +15164 -12669
- package/dist/index.mjs +15164 -12669
- package/dist/pptx/automation/index.cjs +7431 -2967
- package/dist/pptx/automation/index.d.ts +5 -5
- package/dist/pptx/automation/index.mjs +7 -7
- package/dist/pptx/chunks/{elements-mSCZ84Tc.d.ts → elements-f3UbFph-.d.ts} +7 -2
- package/dist/pptx/chunks/elements-f3UbFph-.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-DnWlmYCy.d.ts → index-BnH2QjYm.d.ts} +4 -4
- package/dist/pptx/chunks/{index-DnWlmYCy.d.ts.map → index-BnH2QjYm.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-D-FdgqrP.d.ts → index-Bp-1pGo1.d.ts} +4 -4
- package/dist/pptx/chunks/{index-D-FdgqrP.d.ts.map → index-Bp-1pGo1.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-DKybuHPT.d.ts → index-BuMPQDQb.d.ts} +27 -16
- package/dist/pptx/chunks/index-BuMPQDQb.d.ts.map +1 -0
- package/dist/pptx/chunks/{smart-art-DLumQo90.d.ts → smart-art-CmOrPLLQ.d.ts} +86 -2
- package/dist/pptx/chunks/smart-art-CmOrPLLQ.d.ts.map +1 -0
- package/dist/pptx/chunks/{text-operations-hyPODwIQ.d.ts → text-operations-D5sgspO6.d.ts} +2 -2
- package/dist/pptx/chunks/{text-operations-hyPODwIQ.d.ts.map → text-operations-D5sgspO6.d.ts.map} +1 -1
- package/dist/pptx/cli/index.cjs +7196 -2732
- package/dist/pptx/cli/index.d.ts +1 -1
- package/dist/pptx/cli/index.mjs +6 -6
- package/dist/pptx/converter/index.cjs +3895 -503
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +3 -3
- package/dist/pptx/editor/render/find-replace.cjs +14 -14
- package/dist/pptx/editor/render/find-replace.d.ts +2 -2
- package/dist/pptx/editor/render/find-replace.mjs +1 -1
- package/dist/pptx/editor/render/slide-operations.cjs +8 -8
- package/dist/pptx/editor/render/slide-operations.mjs +2 -2
- package/dist/pptx/editor/render/text-runs-style-patch.d.ts +1 -1
- package/dist/pptx/editor/render/text-style-scope.d.ts +1 -1
- package/dist/pptx/index.cjs +6828 -2969
- package/dist/pptx/index.d.ts +7 -7
- package/dist/pptx/index.mjs +7 -7
- package/dist/pptx/node/index.d.ts +1 -1
- package/dist/pptx/smartart-layouts/index.d.ts +1 -1
- package/dist/pptx/smartart-layouts/index.mjs +2 -2
- package/dist/teams/index.cjs +1964 -726
- package/dist/teams/index.mjs +1964 -726
- package/dist/visio/cell-formula.d.ts +5 -1
- package/dist/visio/cell-formula.d.ts.map +1 -1
- package/dist/visio/collab/index.cjs +3 -1
- package/dist/visio/collab/index.mjs +3 -1
- package/dist/visio/container-relationships.d.ts +19 -0
- package/dist/visio/container-relationships.d.ts.map +1 -0
- package/dist/visio/edit-container-fit.d.ts +19 -0
- package/dist/visio/edit-container-fit.d.ts.map +1 -0
- package/dist/visio/edit-container-members.d.ts +21 -0
- package/dist/visio/edit-container-members.d.ts.map +1 -0
- package/dist/visio/edit-delete.d.ts.map +1 -1
- package/dist/visio/edit-diagram-parts-commands.d.ts +23 -1
- package/dist/visio/edit-diagram-parts-commands.d.ts.map +1 -1
- package/dist/visio/edit-diagram-parts.d.ts +3 -2
- package/dist/visio/edit-diagram-parts.d.ts.map +1 -1
- package/dist/visio/edit-geometry.d.ts +4 -1
- package/dist/visio/edit-geometry.d.ts.map +1 -1
- package/dist/visio/edit-recalculate-index.d.ts +13 -0
- package/dist/visio/edit-recalculate-index.d.ts.map +1 -1
- package/dist/visio/edit-recalculate-values.d.ts.map +1 -1
- package/dist/visio/edit-recalculate.d.ts.map +1 -1
- package/dist/visio/edit.d.ts.map +1 -1
- package/dist/visio/formula-analyze.d.ts +2 -0
- package/dist/visio/formula-analyze.d.ts.map +1 -1
- package/dist/visio/formula-evaluate.d.ts.map +1 -1
- package/dist/visio/formula-master.d.ts +1 -0
- package/dist/visio/formula-master.d.ts.map +1 -1
- package/dist/visio/index.cjs +2771 -1312
- package/dist/visio/index.d.ts +1 -1
- package/dist/visio/index.d.ts.map +1 -1
- package/dist/visio/index.mjs +2771 -1312
- package/dist/visio/media.d.ts +4 -23
- package/dist/visio/media.d.ts.map +1 -1
- package/dist/visio/package-common.d.ts +1 -1
- package/dist/visio/package-common.d.ts.map +1 -1
- package/dist/visio/shape-structure.d.ts +6 -3
- package/dist/visio/shape-structure.d.ts.map +1 -1
- package/dist/visio/ui/diagram-parts.d.ts +12 -1
- package/dist/visio/ui/diagram-parts.d.ts.map +1 -1
- package/dist/visio/ui/index.cjs +2679 -1201
- package/dist/visio/ui/index.mjs +2679 -1202
- package/dist/xlsx/edit/cell-values.d.ts.map +1 -1
- package/dist/xlsx/edit/chart-ex.d.ts +1 -0
- package/dist/xlsx/edit/chart-ex.d.ts.map +1 -1
- package/dist/xlsx/edit/filter.d.ts +5 -1
- package/dist/xlsx/edit/filter.d.ts.map +1 -1
- package/dist/xlsx/edit/index.d.ts +1 -0
- package/dist/xlsx/edit/index.d.ts.map +1 -1
- package/dist/xlsx/edit/session-calc.d.ts +5 -0
- package/dist/xlsx/edit/session-calc.d.ts.map +1 -1
- package/dist/xlsx/edit/session.d.ts.map +1 -1
- package/dist/xlsx/edit/text-columns.d.ts +21 -0
- package/dist/xlsx/edit/text-columns.d.ts.map +1 -0
- package/dist/xlsx/edit/types.d.ts +5 -1
- package/dist/xlsx/edit/types.d.ts.map +1 -1
- package/dist/xlsx/embedded-chart-ex-space.d.ts +18 -0
- package/dist/xlsx/embedded-chart-ex-space.d.ts.map +1 -0
- package/dist/xlsx/filter-criteria.d.ts +22 -0
- package/dist/xlsx/filter-criteria.d.ts.map +1 -0
- package/dist/xlsx/filter-dynamic.d.ts +8 -0
- package/dist/xlsx/filter-dynamic.d.ts.map +1 -0
- package/dist/xlsx/filter-menu.d.ts +49 -0
- package/dist/xlsx/filter-menu.d.ts.map +1 -0
- package/dist/xlsx/filter-rows.d.ts +4 -4
- package/dist/xlsx/filter-rows.d.ts.map +1 -1
- package/dist/xlsx/index.cjs +5856 -2934
- package/dist/xlsx/index.d.ts +4 -0
- package/dist/xlsx/index.d.ts.map +1 -1
- package/dist/xlsx/index.mjs +5839 -2934
- package/dist/xlsx/load/index.cjs +1871 -585
- package/dist/xlsx/load/index.mjs +1871 -585
- package/dist/xlsx/model-filter.d.ts +54 -0
- package/dist/xlsx/model-filter.d.ts.map +1 -0
- package/dist/xlsx/model.d.ts +42 -3
- package/dist/xlsx/model.d.ts.map +1 -1
- package/dist/xlsx/read/chart.d.ts.map +1 -1
- package/dist/xlsx/read/drawing.d.ts.map +1 -1
- package/dist/xlsx/read/filter-columns.d.ts +5 -0
- package/dist/xlsx/read/filter-columns.d.ts.map +1 -0
- package/dist/xlsx/read/shared-strings.d.ts +5 -3
- package/dist/xlsx/read/shared-strings.d.ts.map +1 -1
- package/dist/xlsx/read/sheet-data.d.ts.map +1 -1
- package/dist/xlsx/read/sheet-props.d.ts +2 -2
- package/dist/xlsx/read/sheet-props.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/i18n/filters.d.ts +3 -0
- package/dist/xlsx/ui/commands/i18n/filters.d.ts.map +1 -0
- package/dist/xlsx/ui/commands/i18n/index.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/i18n/tools.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/sort-filter.d.ts.map +1 -1
- package/dist/xlsx/ui/dialogs/grid-chart.d.ts.map +1 -1
- package/dist/xlsx/ui/index.cjs +7177 -4234
- package/dist/xlsx/ui/index.mjs +7177 -4234
- package/dist/xlsx/write/drawing.d.ts.map +1 -1
- package/dist/xlsx/write/filter-columns.d.ts +39 -0
- package/dist/xlsx/write/filter-columns.d.ts.map +1 -0
- package/dist/xlsx/write/shared-strings.d.ts +4 -4
- package/dist/xlsx/write/shared-strings.d.ts.map +1 -1
- package/dist/xlsx/write/sheet-props.d.ts +2 -1
- package/dist/xlsx/write/sheet-props.d.ts.map +1 -1
- package/dist/xlsx/write/smart-art-cache.d.ts.map +1 -1
- package/dist/xlsx/write/smart-art.d.ts.map +1 -1
- package/dist/xlsx/write/workbook-part.d.ts.map +1 -1
- package/package.json +6 -1
- package/dist/PptxHandler-QY5VL3CY.mjs +0 -7
- package/dist/PptxHandler-SJ5ZUIUX.mjs +0 -4
- package/dist/chunk-3GXV5MPC.mjs +0 -41
- package/dist/pptx/chunks/elements-mSCZ84Tc.d.ts.map +0 -1
- package/dist/pptx/chunks/index-DKybuHPT.d.ts.map +0 -1
- package/dist/pptx/chunks/smart-art-DLumQo90.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NS, SMART_ART_DEFINITION_PARTS, VML_SHAPE_TAGS, isAlternateContentChoiceXmlSupported, parseVmlElement, unwrapAlternateContent, xmlChild, xmlAttr, parseDrawingMediaReference, cropShapeForPresetGeometry, isHeaderFooterPlaceholder, xmlPath, inheritedPlaceholderFieldType, parseParagraphLevel, xmlHasChild, parseParagraphExtraAttributes, parseParagraphMargins, parseAlignmentAttr, parseParagraphRtl, parseTabStops, resolveParagraphAlignment, xmlText, parseBodyPrBooleanAttrs, selectAlternateContentBranch, parseBulletSizePercent, extractColorChoiceXml, themeColorRefFromColorChoice, formatAutoNumberMarker, cloneXmlObject, parseParagraphSpacingPx, parseOoxmlPercent,
|
|
1
|
+
import { NS, RELATIONSHIP_TYPES, SMART_ART_DEFINITION_PARTS, VML_SHAPE_TAGS, isAlternateContentChoiceXmlSupported, parseVmlElement, unwrapAlternateContent, xmlChild, xmlAttr, parseDrawingMediaReference, cropShapeForPresetGeometry, isHeaderFooterPlaceholder, xmlPath, inheritedPlaceholderFieldType, parseParagraphLevel, xmlHasChild, parseParagraphExtraAttributes, parseParagraphMargins, parseAlignmentAttr, parseParagraphRtl, parseTabStops, resolveParagraphAlignment, xmlText, parseBodyPrBooleanAttrs, selectAlternateContentBranch, parseBulletSizePercent, extractColorChoiceXml, themeColorRefFromColorChoice, formatAutoNumberMarker, readText3DValues, cloneXmlObject, readScene3DValues, parseParagraphSpacingPx, parseOoxmlPercent, createBuiltinVariables, resolveCoordinate, readPathListCommandOrder, parseAdjustmentValues, parseGuideDefinitions, evaluateGuides, orderedPathCommandEntries, ooxmlArcToSvg, inheritCustomGeometryCommandOrder, parseInkMlContent, parseModel3DScene, nextRelationshipId, remapElementShapeIds, parseShapeId, isTemplateElementId, remapShapeIdReferences, reapplyAlternateContentToTree, openPptxZip, buildOle2, SHAPE_TREE_ELEMENT_TAGS, MAX_SHAPE_ID, parseRelationships, resolvePartPath, orderedXmlKey, safeResolveZipPath, parseDataUrlToBytes, base64Decode, reorderObjectKeys, encodeCompressedPng, zlibStore, hash, concatArrays, encodePasswordUtf16LE, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, uint32LE, LN_CHILD_ORDER, pptxActionToElementAction, buildClrMapOverrideXml, applyActiveXControlsToSlide, BLIP_FILL_ORDER, SP_PR_ORDER, ensureXmlChild, inkElementToStrokes, buildInkMlContent, ensureXmlChildOrCreate, isXmlNode, applyChartLayouts, stripXmlOrderSuffix, serializeTabStop, readCommentMentions, rebaseCommentMentions, applyCommentMentions, colorsEqual, generateFontGuid, applyBubbleChartOptions, applyChartUpDownBars, applyDataLabelsRangeToDLbls, applyChartAxisScaling, applyChartAxisLabelFormatting, upsertChartAxisChild, applyChartDateAxisUnits, applyChartAxisDisplayUnitsToXml, writeChartShapeProps, resolveTxPrDefRPr, buildDefRPrTextProperties, buildChartGradFillXml, applySeriesMarkerToXml, applySeriesDataPointsToXml, chartColorHex, drawingLineXml, parseDrawingTextBody, parseXml, parseDrawingFill, parseDrawingLine, first, buildXml, setDrawingFillXml, fillElementOf, patchDrawingLine, elements, drawingFillXml, applyChartManualLayout, serializeColorChoice, replaceOleEmbedding, findKey, collectAllText, buildNodeGuidMap, buildPresentationGuidMap, regenerateSmartArtDrawingShapes, buildFabricatedDrawingXml, buildFabricatedDiagramDataXml, DIAGRAM_DRAWING_CONTENT_TYPE, DIAGRAM_DRAWING_REL_TYPE, drawingColorXml, applyDiagramRelationshipIds, applyDrawingMediaReference, DIAGRAM_XML_PROLOG, DIAGRAM_DATA_XMLNS, escapeDiagramXml, writeBodyPrBooleanAttrs, applyTextBodySp3d, customGeometryPathsToXml, ensureArrayValue, lookupPresetShape, writeShapeEffects, SHAPE_STYLE_ORDER, CAMERA_PRESETS, LIGHT_RIGS, LIGHT_DIRECTIONS, roundCoordinate, scaleVectorToIntegers, P14_GUIDE_URI, P15_GUIDE_URI, buildGuideListExtension, resetSpPrFormattingForStyleMatrix, restorePathListCommandOrder, fillIsPurelyStyleMatrix, serializeColorChoiceWithRef, createLineStyleGate, applyDrawingLineDash, reorderObjectKeysByLocalName, getSignaturePathsToStrip, DIGITAL_SIGNATURE_ORIGIN_REL_TYPE, mergeSmartArtPointXml, mergeSmartArtConnectionXml, withDiagramPictureSources, diagramPictureRelationships, applySmartArtLayoutDefinition, obfuscateFont, containsConvertibleStrictNamespaceAttribute, convertXmlToStrict, applySeriesPictureOptionsToXml, findChartExtByUri, findChildByLocalName, regenerateClonedUniqueId, buildChartUniqueIdExtLst, createOfficeGuid, isContentPoint, newSmartArtGuid, parseDiagramDataModel, DEFAULT_GENERATED_DIAGRAM_SCHEME, previewDiagramLayout, parseDiagramColors, resolveDrawingColor, children, parseDrawingRichTextBody, writeGeneratedDiagramDrawing, descendants, GENERATED_DIAGRAM_CACHE_NS, generatedDrawingDigest, parseChartUserShapesDrawing, DEFAULT_ROW_HEIGHT_EMU, createDefaultXmlCell, xmlChildren, applyChartGradientToSpPr, setAutoTitleDeleted, insertAt, replaceFirstText, shouldRebuildFromParagraphs, buildPointFromParagraphs, shouldRebuildFromRuns, buildPointFromRuns, buildPointText, resolveThemeFillStyle, resolveThemeLineStyle, resolveThemeEffectStyle, relAttr, tableCellTextBodyMatches, ensureXmlChildren, TC_PR_BORDERS_ORDER, writeChartColorChoice, relationshipsPartFor, stripParentDirSegments, parseChartUniqueId, buildChartMarkerXml, chartGradientsEqual, chartColorChoiceValue, openZip, attr, parseDrawingEffects, drawingEffectsXml, readChartManualLayoutValues, buildEffectDagTreeFromXml, appendInSchemaOrder, RUN_PROPERTIES_ORDER, syncPictureShapeTypeWithCropShape, buildSrgbColorChoice, picturePercentage, ARTISTIC_PRIMARY_ATTRIBUTE, fetchUrlToBytes, parseChartWideTextStyle, hasLocalName, parseDefRPrTextStyle, parseChartDataLabelOptions, shadowOffsetToDistanceAndDirection, positiveFixedAngleAttribute, xmlAttrNumber, parseCustomShows, parseShapeProps, parseActiveXControlsFromSlide, convertMetafileToDataUrl, readPictureEffect, ooxmlGradientAngleToCssDegrees, isAlternateContentChoiceSupported, detectStrictConformance, normalizeStrictXml, relayoutSmartArt, patchDrawingColorIn, themeColorRefToSolidFillWithOpacity, FONT_ADVANCE_TABLES, DEFAULT_FONT_ADVANCE_TABLE, measureTextWidth, applyDrawingColorTransforms, applyThemeToData, detectFileFormat, parseOle2, EncryptedFileError, decryptPptx, encryptPptx, MAX_ZIP_ENTRY_COUNT, DEFAULT_MAX_UNCOMPRESSED_BYTES, encodeXmlAttributeValue, encodeXmlTextValue, svgToCustomGeometryPaths, IncorrectPasswordError, parseEncryptionInfo, RC4_ALG_ID, isOle2CompoundFile, ENTRY_TYPE_ROOT, supportsChartGradientFill, DEFAULT_CHART_GRADIENT_ANGLE, decodeXmlEntities, preservesXmlWhitespace, annotateCustomGeometryCommandOrder, annotateSmartArtTextOrder, stripXmlOrderMarkers, normalizeStShapeType, applyCustomShows, applySections, PRESENTATION_CHILD_ORDER, applyKinsokuToXml, normalizeNamespaceUri, backgroundStyleRefIsCurrent, backgroundRefNode, captureStyleBaseline, STYLE_MATRIX_FILL_KEYS, STYLE_MATRIX_LINE_KEYS, STYLE_MATRIX_EFFECT_KEYS, detectOleObjectType, inferOleExtensionFromTarget, backgroundStylePreset, isDarkColorMap, backgroundStyleColorMap, reResolveElementsForColorMapChange, deriveSlideTitles, parseP14DirectChild, parseP14FromExtLst, P14_TRANSITION_TYPES, parseSlideDrawingGuides, slideBackgroundStyleRefFromNode, cloneSlide, parseDrawingFraction, scrgbLinearToSrgb8, parseDrawingHueDegrees, hslToRgb, themeColorRefToXml, effectChild, mergeEffectNode, mergeAttributeEffectNode, findThemeEffectScheme, wrapFormatSchemeXml, effectIsPurelyStyleMatrix, prismFamilyFlags, prismFamilyTypeOfNode, prismFamilyTypeForFlags, P14_DIR_IS_ORIENTATION_TYPE, estimateMediaDurationMs, parseVmlElements, parseDrawingLineDash, parseLineSpacingMultiplier, parseLineSpacingExactPt, formatSchemeKey, buildRelationshipsXml, loadThemeVariants, parsePresentationDrawingGuides, parsePresentationSmartTags, resolveLayoutDisplayName, guardZip, detectDigitalSignatures, unwrapOleEmbedding, mimeTypeForOleFile, oleBytesToDataUrl, themeColorRefFromSchemeClr, ZipBombError, parseKinsoku, deobfuscateFont, detectFontFormat, parseDataTable, parseChartAxes, parseBubbleChartOptions, extractGuidFromPartName, parseChartLayouts, parseCxChartSeries, parseChartDataPointPictureBlipRel, extractCxSeriesColor, parseCxDataLabels, parseCxRegionMapOptions, parseCxAxes, parseSeriesDataLabels, parseChartDataPointPicture, parseImplicitBlipPictureFill, parseEmbeddedXlsx, parseChartManualLayout, parseDiagramRelationshipIds, parseSmartArtTextParagraphs, firstParagraphRuns, smartArtParagraphsText, parseSmartArtLayoutDefinition, decodeBase64, parseSmartArtPresLayoutVars, parseDrawingColorIn, parseSmartArtConnection, connectionLabel, projectSmartArtNodeText, resolveSmartArtNodeStyleRoles, resolveSmartArtNodeCoherent3DOff, resolveDiagramLayoutCategory, captureDiagramPictures, parseDiagramDrawing, parseSmartArtDefinitionMetadata, parseSmartArtColorStyleLabels, buildSmartArtColorLists, buildSmartArtColorRoleMap, collectTransitionText, parseSmartArtQuickStyleLabels, parseDiagramQuickStyle, parseDiagramLayoutSummary, resolveSmartArtEffectIntensity, parseSmartArtStyleLabelRefs, extractStyleReferenceColorXml, withThemePlaceholderColor, blendColorOntoWhite } from './chunk-6LJW76BZ.mjs';
|
|
2
2
|
import { hasShapeProperties, hasTextProperties } from './chunk-GXHKNSZX.mjs';
|
|
3
3
|
import { EMU_PER_PX, EMU_PER_PIXEL, SYSTEM_COLOR_MAP, PRESET_COLOR_MAP, OOXML_PERCENT_UNITS, EMU_PER_POINT } from './chunk-CA7KCNL3.mjs';
|
|
4
4
|
import JSZip2 from 'jszip';
|
|
@@ -914,196 +914,49 @@ function applyCellWritesToWorksheet(doc, writes, sharedStrings = []) {
|
|
|
914
914
|
return changed;
|
|
915
915
|
}
|
|
916
916
|
|
|
917
|
-
//
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
"legacyObliqueBottom",
|
|
927
|
-
"legacyObliqueBottomRight",
|
|
928
|
-
"legacyPerspectiveTopLeft",
|
|
929
|
-
"legacyPerspectiveTop",
|
|
930
|
-
"legacyPerspectiveTopRight",
|
|
931
|
-
"legacyPerspectiveLeft",
|
|
932
|
-
"legacyPerspectiveFront",
|
|
933
|
-
"legacyPerspectiveRight",
|
|
934
|
-
"legacyPerspectiveBottomLeft",
|
|
935
|
-
"legacyPerspectiveBottom",
|
|
936
|
-
"legacyPerspectiveBottomRight",
|
|
937
|
-
"orthographicFront",
|
|
938
|
-
"isometricTopUp",
|
|
939
|
-
"isometricTopDown",
|
|
940
|
-
"isometricBottomUp",
|
|
941
|
-
"isometricBottomDown",
|
|
942
|
-
"isometricLeftUp",
|
|
943
|
-
"isometricLeftDown",
|
|
944
|
-
"isometricRightUp",
|
|
945
|
-
"isometricRightDown",
|
|
946
|
-
"isometricOffAxis1Left",
|
|
947
|
-
"isometricOffAxis1Right",
|
|
948
|
-
"isometricOffAxis1Top",
|
|
949
|
-
"isometricOffAxis2Left",
|
|
950
|
-
"isometricOffAxis2Right",
|
|
951
|
-
"isometricOffAxis2Top",
|
|
952
|
-
"isometricOffAxis3Left",
|
|
953
|
-
"isometricOffAxis3Right",
|
|
954
|
-
"isometricOffAxis3Bottom",
|
|
955
|
-
"isometricOffAxis4Left",
|
|
956
|
-
"isometricOffAxis4Right",
|
|
957
|
-
"isometricOffAxis4Bottom",
|
|
958
|
-
"obliqueTopLeft",
|
|
959
|
-
"obliqueTop",
|
|
960
|
-
"obliqueTopRight",
|
|
961
|
-
"obliqueLeft",
|
|
962
|
-
"obliqueRight",
|
|
963
|
-
"obliqueBottomLeft",
|
|
964
|
-
"obliqueBottom",
|
|
965
|
-
"obliqueBottomRight",
|
|
966
|
-
"perspectiveFront",
|
|
967
|
-
"perspectiveLeft",
|
|
968
|
-
"perspectiveRight",
|
|
969
|
-
"perspectiveAbove",
|
|
970
|
-
"perspectiveBelow",
|
|
971
|
-
"perspectiveAboveLeftFacing",
|
|
972
|
-
"perspectiveAboveRightFacing",
|
|
973
|
-
"perspectiveContrastingLeftFacing",
|
|
974
|
-
"perspectiveContrastingRightFacing",
|
|
975
|
-
"perspectiveHeroicLeftFacing",
|
|
976
|
-
"perspectiveHeroicRightFacing",
|
|
977
|
-
"perspectiveHeroicExtremeLeftFacing",
|
|
978
|
-
"perspectiveHeroicExtremeRightFacing",
|
|
979
|
-
"perspectiveRelaxed",
|
|
980
|
-
"perspectiveRelaxedModerately"
|
|
981
|
-
]);
|
|
982
|
-
var LIGHT_RIGS = /* @__PURE__ */ new Set([
|
|
983
|
-
"legacyFlat1",
|
|
984
|
-
"legacyFlat2",
|
|
985
|
-
"legacyFlat3",
|
|
986
|
-
"legacyFlat4",
|
|
987
|
-
"legacyNormal1",
|
|
988
|
-
"legacyNormal2",
|
|
989
|
-
"legacyNormal3",
|
|
990
|
-
"legacyNormal4",
|
|
991
|
-
"legacyHarsh1",
|
|
992
|
-
"legacyHarsh2",
|
|
993
|
-
"legacyHarsh3",
|
|
994
|
-
"legacyHarsh4",
|
|
995
|
-
"threePt",
|
|
996
|
-
"balanced",
|
|
997
|
-
"soft",
|
|
998
|
-
"harsh",
|
|
999
|
-
"flood",
|
|
1000
|
-
"contrasting",
|
|
1001
|
-
"morning",
|
|
1002
|
-
"sunrise",
|
|
1003
|
-
"sunset",
|
|
1004
|
-
"chilly",
|
|
1005
|
-
"freezing",
|
|
1006
|
-
"flat",
|
|
1007
|
-
"twoPt",
|
|
1008
|
-
"glow",
|
|
1009
|
-
"brightRoom"
|
|
1010
|
-
]);
|
|
1011
|
-
var LIGHT_DIRECTIONS = /* @__PURE__ */ new Set(["tl", "t", "tr", "l", "r", "bl", "b", "br"]);
|
|
1012
|
-
|
|
1013
|
-
// drawingml/read-3d-values.ts
|
|
1014
|
-
var integer = (value) => {
|
|
1015
|
-
if (value === void 0 || value === null || String(value).trim() === "") return void 0;
|
|
1016
|
-
const n = Number(value);
|
|
1017
|
-
return Number.isSafeInteger(n) ? n : void 0;
|
|
1018
|
-
};
|
|
1019
|
-
function readScene3DValues(node, read) {
|
|
1020
|
-
const out = {};
|
|
1021
|
-
const camera = read.child(node, "camera");
|
|
1022
|
-
const light = read.child(node, "lightRig");
|
|
1023
|
-
for (const [key2, source, attribute2, choices] of [
|
|
1024
|
-
["cameraPreset", camera, "prst", CAMERA_PRESETS],
|
|
1025
|
-
["lightRigType", light, "rig", LIGHT_RIGS],
|
|
1026
|
-
["lightRigDirection", light, "dir", LIGHT_DIRECTIONS]
|
|
1027
|
-
]) {
|
|
1028
|
-
const token2 = String(read.attribute(source, attribute2) ?? "").trim();
|
|
1029
|
-
if (choices.has(token2)) out[key2] = token2;
|
|
1030
|
-
}
|
|
1031
|
-
const fov = integer(read.attribute(camera, "fov"));
|
|
1032
|
-
if (fov !== void 0 && fov >= 0 && fov <= 108e5) out.cameraFieldOfView = fov;
|
|
1033
|
-
const zoom = picturePercentage(read.attribute(camera, "zoom"));
|
|
1034
|
-
if (zoom !== void 0 && zoom > 0) out.cameraZoom = zoom;
|
|
1035
|
-
for (const [prefix, source] of [
|
|
1036
|
-
["camera", camera],
|
|
1037
|
-
["lightRig", light]
|
|
1038
|
-
]) {
|
|
1039
|
-
const rot = read.child(source, "rot");
|
|
1040
|
-
for (const [axis, key2] of [
|
|
1041
|
-
["lat", "RotX"],
|
|
1042
|
-
["lon", "RotY"],
|
|
1043
|
-
["rev", "RotZ"]
|
|
1044
|
-
]) {
|
|
1045
|
-
const value = integer(read.attribute(rot, axis));
|
|
1046
|
-
if (value !== void 0 && value >= 0 && value < 216e5) out[`${prefix}${key2}`] = value;
|
|
1047
|
-
}
|
|
917
|
+
// diagram/edit/node-tree.ts
|
|
918
|
+
function treeOrderDiagramNodes(nodes) {
|
|
919
|
+
const ids = new Set(nodes.map((node) => node.id));
|
|
920
|
+
const childrenOf = /* @__PURE__ */ new Map();
|
|
921
|
+
for (const node of nodes) {
|
|
922
|
+
const parent = node.parentId && ids.has(node.parentId) ? node.parentId : void 0;
|
|
923
|
+
const list2 = childrenOf.get(parent) ?? [];
|
|
924
|
+
list2.push(node);
|
|
925
|
+
childrenOf.set(parent, list2);
|
|
1048
926
|
}
|
|
1049
|
-
const
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
for (const
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
const point = read.child(backdrop, name);
|
|
1058
|
-
for (const [axis, suffix] of [
|
|
1059
|
-
["x", "X"],
|
|
1060
|
-
["y", "Y"],
|
|
1061
|
-
["z", "Z"]
|
|
1062
|
-
]) {
|
|
1063
|
-
const value = integer(read.attribute(point, `${attr5}${axis}`));
|
|
1064
|
-
if (value !== void 0) out[`${prefix}${suffix}`] = value;
|
|
1065
|
-
}
|
|
927
|
+
const ordered3 = [];
|
|
928
|
+
const seen = /* @__PURE__ */ new Set();
|
|
929
|
+
const visit = (parent) => {
|
|
930
|
+
for (const node of childrenOf.get(parent) ?? []) {
|
|
931
|
+
if (seen.has(node.id)) continue;
|
|
932
|
+
seen.add(node.id);
|
|
933
|
+
ordered3.push(node);
|
|
934
|
+
visit(node.id);
|
|
1066
935
|
}
|
|
1067
|
-
}
|
|
1068
|
-
|
|
936
|
+
};
|
|
937
|
+
visit(void 0);
|
|
938
|
+
for (const node of nodes) if (!seen.has(node.id)) ordered3.push(node);
|
|
939
|
+
return ordered3;
|
|
1069
940
|
}
|
|
1070
|
-
function
|
|
1071
|
-
const
|
|
1072
|
-
for (const
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
["bevelT", "bevelTop"],
|
|
1084
|
-
["bevelB", "bevelBottom"]
|
|
1085
|
-
]) {
|
|
1086
|
-
const bevel = read.child(node, name);
|
|
1087
|
-
if (!bevel) continue;
|
|
1088
|
-
out[`${prefix}Type`] = String(read.attribute(bevel, "prst") || "circle").trim();
|
|
1089
|
-
for (const [attribute2, suffix] of [
|
|
1090
|
-
["w", "Width"],
|
|
1091
|
-
["h", "Height"]
|
|
1092
|
-
]) {
|
|
1093
|
-
const value = integer(read.attribute(bevel, attribute2));
|
|
1094
|
-
if (value !== void 0) out[`${prefix}${suffix}`] = value;
|
|
941
|
+
function diagramNodesInTreeOrder(data) {
|
|
942
|
+
const order = /* @__PURE__ */ new Map();
|
|
943
|
+
for (const connection of data.connections)
|
|
944
|
+
if ((connection.type ?? "parOf") === "parOf" && !order.has(connection.destId))
|
|
945
|
+
order.set(connection.destId, connection.srcOrd ?? 0);
|
|
946
|
+
const nodes = data.nodes.map((node, index) => ({
|
|
947
|
+
index,
|
|
948
|
+
node: {
|
|
949
|
+
id: node.modelId,
|
|
950
|
+
text: node.text,
|
|
951
|
+
...node.textParagraphs ? { paragraphs: node.textParagraphs } : {},
|
|
952
|
+
...data.parentById.get(node.modelId) ? { parentId: data.parentById.get(node.modelId) } : {},
|
|
953
|
+
...node.type === "asst" ? { nodeType: "asst" } : {}
|
|
1095
954
|
}
|
|
1096
|
-
}
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
function appendInSchemaOrder(parent, order, entries) {
|
|
1102
|
-
const rank = (name) => {
|
|
1103
|
-
const index = order.indexOf(name);
|
|
1104
|
-
return index < 0 ? order.length : index;
|
|
1105
|
-
};
|
|
1106
|
-
entries.map((entry2, index) => ({ entry: entry2, index })).sort((a, b) => rank(a.entry.name) - rank(b.entry.name) || a.index - b.index).forEach(({ entry: entry2 }) => parent.appendChild(entry2.node));
|
|
955
|
+
}));
|
|
956
|
+
nodes.sort(
|
|
957
|
+
(a, b) => (order.get(a.node.id) ?? Number.MAX_SAFE_INTEGER) - (order.get(b.node.id) ?? Number.MAX_SAFE_INTEGER) || a.index - b.index
|
|
958
|
+
);
|
|
959
|
+
return treeOrderDiagramNodes(nodes.map((entry2) => entry2.node));
|
|
1107
960
|
}
|
|
1108
961
|
|
|
1109
962
|
// diagram/write/fabricated-styles.ts
|
|
@@ -1150,185 +1003,31 @@ function buildFabricatedColorsXml(scheme) {
|
|
|
1150
1003
|
).join("")}</dgm:colorsDef>`;
|
|
1151
1004
|
}
|
|
1152
1005
|
|
|
1153
|
-
// drawingml/
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
"grpFill",
|
|
1162
|
-
"effectLst",
|
|
1163
|
-
"effectDag",
|
|
1164
|
-
"highlight",
|
|
1165
|
-
"uLnTx",
|
|
1166
|
-
"uLn",
|
|
1167
|
-
"uFillTx",
|
|
1168
|
-
"uFill",
|
|
1169
|
-
"latin",
|
|
1170
|
-
"ea",
|
|
1171
|
-
"cs",
|
|
1172
|
-
"sym",
|
|
1173
|
-
"hlinkClick",
|
|
1174
|
-
"hlinkMouseOver",
|
|
1175
|
-
"rtl",
|
|
1176
|
-
"extLst"
|
|
1177
|
-
];
|
|
1178
|
-
|
|
1179
|
-
// diagram/data-model.ts
|
|
1180
|
-
var TRANSITION_TYPES = /* @__PURE__ */ new Set(["parTrans", "sibTrans"]);
|
|
1181
|
-
function collectTransitionText(points7, describe, text) {
|
|
1182
|
-
const byId = /* @__PURE__ */ new Map();
|
|
1183
|
-
for (const point of points7) {
|
|
1184
|
-
const { type, modelId } = describe(point);
|
|
1185
|
-
if (!TRANSITION_TYPES.has((type ?? "").trim())) continue;
|
|
1186
|
-
const id = (modelId ?? "").trim();
|
|
1187
|
-
if (!id) continue;
|
|
1188
|
-
const value = text(point).trim();
|
|
1189
|
-
if (value.length > 0) byId.set(id, value);
|
|
1190
|
-
}
|
|
1191
|
-
return byId;
|
|
1192
|
-
}
|
|
1193
|
-
function connectionLabel(connection, transitionText) {
|
|
1194
|
-
const parent = connection.parentTransitionId ? transitionText.get(connection.parentTransitionId) : void 0;
|
|
1195
|
-
const sibling = connection.siblingTransitionId ? transitionText.get(connection.siblingTransitionId) : void 0;
|
|
1196
|
-
return parent ?? sibling;
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
// diagram/layout-category.ts
|
|
1200
|
-
var CATEGORY_FAMILY = {
|
|
1201
|
-
list: "list",
|
|
1202
|
-
process: "process",
|
|
1203
|
-
cycle: "cycle",
|
|
1204
|
-
hierarchy: "hierarchy",
|
|
1205
|
-
relationship: "relationship",
|
|
1206
|
-
matrix: "matrix",
|
|
1207
|
-
pyramid: "pyramid"
|
|
1208
|
-
};
|
|
1209
|
-
var UNIQUE_ID_KEYWORDS = [
|
|
1210
|
-
[/hier|org/u, "hierarchy"],
|
|
1211
|
-
[/cycle|radial|circular/u, "cycle"],
|
|
1212
|
-
[/process|flow|chevron|arrow|equation/u, "process"],
|
|
1213
|
-
[/timeline/u, "timeline"],
|
|
1214
|
-
[/matrix|grid/u, "matrix"],
|
|
1215
|
-
[/pyramid/u, "pyramid"],
|
|
1216
|
-
[/venn/u, "venn"],
|
|
1217
|
-
[/funnel/u, "funnel"],
|
|
1218
|
-
[/gear/u, "gear"],
|
|
1219
|
-
[/target/u, "target"],
|
|
1220
|
-
[/list/u, "list"]
|
|
1221
|
-
];
|
|
1222
|
-
function resolveDiagramLayoutCategory(uniqueId, categories) {
|
|
1223
|
-
for (const category of categories) {
|
|
1224
|
-
const family = CATEGORY_FAMILY[category.trim().toLowerCase()];
|
|
1225
|
-
if (family) return family;
|
|
1226
|
-
}
|
|
1227
|
-
const lowerId = uniqueId.toLowerCase();
|
|
1228
|
-
if (lowerId.length > 0) {
|
|
1229
|
-
for (const [pattern, family] of UNIQUE_ID_KEYWORDS) if (pattern.test(lowerId)) return family;
|
|
1230
|
-
}
|
|
1231
|
-
return void 0;
|
|
1232
|
-
}
|
|
1233
|
-
|
|
1234
|
-
// opc/relationship-types.ts
|
|
1235
|
-
var BASE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
|
1236
|
-
var RELATIONSHIP_TYPES = {
|
|
1237
|
-
officeDocument: `${BASE}/officeDocument`,
|
|
1238
|
-
styles: `${BASE}/styles`,
|
|
1239
|
-
numbering: `${BASE}/numbering`,
|
|
1240
|
-
settings: `${BASE}/settings`,
|
|
1241
|
-
theme: `${BASE}/theme`,
|
|
1242
|
-
fontTable: `${BASE}/fontTable`,
|
|
1243
|
-
webSettings: `${BASE}/webSettings`,
|
|
1244
|
-
header: `${BASE}/header`,
|
|
1245
|
-
footer: `${BASE}/footer`,
|
|
1246
|
-
footnotes: `${BASE}/footnotes`,
|
|
1247
|
-
endnotes: `${BASE}/endnotes`,
|
|
1248
|
-
comments: `${BASE}/comments`,
|
|
1249
|
-
image: `${BASE}/image`,
|
|
1250
|
-
hyperlink: `${BASE}/hyperlink`,
|
|
1251
|
-
oleObject: `${BASE}/oleObject`,
|
|
1252
|
-
chart: `${BASE}/chart`,
|
|
1253
|
-
package: `${BASE}/package`,
|
|
1254
|
-
slide: `${BASE}/slide`,
|
|
1255
|
-
slideLayout: `${BASE}/slideLayout`,
|
|
1256
|
-
slideMaster: `${BASE}/slideMaster`,
|
|
1257
|
-
notesSlide: `${BASE}/notesSlide`,
|
|
1258
|
-
diagramData: `${BASE}/diagramData`,
|
|
1259
|
-
diagramLayout: `${BASE}/diagramLayout`,
|
|
1260
|
-
diagramQuickStyle: `${BASE}/diagramQuickStyle`,
|
|
1261
|
-
diagramColors: `${BASE}/diagramColors`,
|
|
1262
|
-
diagramDrawing: "http://schemas.microsoft.com/office/2007/relationships/diagramDrawing",
|
|
1263
|
-
coreProperties: "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",
|
|
1264
|
-
extendedProperties: `${BASE}/extended-properties`,
|
|
1265
|
-
customProperties: `${BASE}/custom-properties`,
|
|
1266
|
-
customXml: `${BASE}/customXml`,
|
|
1267
|
-
worksheet: `${BASE}/worksheet`,
|
|
1268
|
-
chartsheet: `${BASE}/chartsheet`,
|
|
1269
|
-
dialogsheet: `${BASE}/dialogsheet`,
|
|
1270
|
-
xlMacrosheet: "http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet",
|
|
1271
|
-
sharedStrings: `${BASE}/sharedStrings`,
|
|
1272
|
-
drawing: `${BASE}/drawing`,
|
|
1273
|
-
table: `${BASE}/table`,
|
|
1274
|
-
threadedComment: "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",
|
|
1275
|
-
person: "http://schemas.microsoft.com/office/2017/10/relationships/person",
|
|
1276
|
-
vmlDrawing: `${BASE}/vmlDrawing`,
|
|
1277
|
-
calcChain: `${BASE}/calcChain`,
|
|
1278
|
-
vbaProject: "http://schemas.microsoft.com/office/2006/relationships/vbaProject",
|
|
1279
|
-
pivotTable: `${BASE}/pivotTable`,
|
|
1280
|
-
pivotCacheDefinition: `${BASE}/pivotCacheDefinition`,
|
|
1281
|
-
externalLink: `${BASE}/externalLink`,
|
|
1282
|
-
printerSettings: `${BASE}/printerSettings`,
|
|
1283
|
-
sheetMetadata: `${BASE}/sheetMetadata`
|
|
1284
|
-
};
|
|
1285
|
-
|
|
1286
|
-
// opc/relationships.ts
|
|
1287
|
-
function parseRelationships(xml) {
|
|
1288
|
-
const map = /* @__PURE__ */ new Map();
|
|
1289
|
-
if (!xml) return map;
|
|
1290
|
-
const root = parseXml(xml).documentElement;
|
|
1291
|
-
for (const node of elements(root)) {
|
|
1292
|
-
if (node.localName !== "Relationship") continue;
|
|
1293
|
-
const id = node.getAttribute("Id");
|
|
1294
|
-
const target = node.getAttribute("Target");
|
|
1295
|
-
if (!id || target == null) continue;
|
|
1296
|
-
map.set(id, {
|
|
1297
|
-
id,
|
|
1298
|
-
type: node.getAttribute("Type") ?? "",
|
|
1299
|
-
target,
|
|
1300
|
-
mode: node.getAttribute("TargetMode") === "External" ? "External" : "Internal"
|
|
1301
|
-
});
|
|
1302
|
-
}
|
|
1303
|
-
return map;
|
|
1304
|
-
}
|
|
1305
|
-
var escapeAttr = (value) => value.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<");
|
|
1306
|
-
function buildRelationshipsXml(relationships2) {
|
|
1307
|
-
const items = Array.from(relationships2).map(([id, rel]) => {
|
|
1308
|
-
const mode = rel.mode === "External" ? ' TargetMode="External"' : "";
|
|
1309
|
-
return `<Relationship Id="${escapeAttr(id)}" Type="${escapeAttr(rel.type)}" Target="${escapeAttr(rel.target)}"${mode}/>`;
|
|
1310
|
-
}).join("");
|
|
1311
|
-
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${NS.rels}">${items}</Relationships>`;
|
|
1312
|
-
}
|
|
1313
|
-
function resolvePartPath(basePart, target) {
|
|
1314
|
-
if (target.startsWith("/")) return target.slice(1);
|
|
1315
|
-
const baseDir = basePart.slice(0, basePart.lastIndexOf("/") + 1);
|
|
1316
|
-
const resolved = [];
|
|
1317
|
-
for (const segment of `${baseDir}${target}`.split("/")) {
|
|
1318
|
-
if (segment === "." || segment === "") continue;
|
|
1319
|
-
if (segment === "..") resolved.pop();
|
|
1320
|
-
else resolved.push(segment);
|
|
1006
|
+
// drawingml/drawing-shadow.ts
|
|
1007
|
+
function resolveDrawingOuterShadow(effect, theme) {
|
|
1008
|
+
if (effect.sourceXml) {
|
|
1009
|
+
const source = parseXml(effect.sourceXml).documentElement;
|
|
1010
|
+
for (const attribute2 of ["blurRad", "dist", "dir", "sx", "sy", "kx", "ky"]) {
|
|
1011
|
+
const value = source.getAttribute(attribute2);
|
|
1012
|
+
if (value !== null && !Number.isFinite(Number(value))) return void 0;
|
|
1013
|
+
}
|
|
1321
1014
|
}
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
const
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
return
|
|
1015
|
+
if ((effect.scaleX ?? 1e5) !== 1e5 || (effect.scaleY ?? 1e5) !== 1e5 || (effect.skewXAngle ?? 0) !== 0 || (effect.skewYAngle ?? 0) !== 0)
|
|
1016
|
+
return void 0;
|
|
1017
|
+
const color3 = effect.color;
|
|
1018
|
+
const resolved = color3 && resolveDrawingColor(color3, theme, { transformOrder: "document" });
|
|
1019
|
+
const blur = (effect.blurRadiusEmu ?? 0) / EMU_PER_PIXEL;
|
|
1020
|
+
const distance = (effect.distanceEmu ?? 0) / EMU_PER_PIXEL;
|
|
1021
|
+
const angle = (effect.directionAngle ?? 0) / 6e4 * Math.PI / 180;
|
|
1022
|
+
if (!resolved || ![blur, distance, angle].every(Number.isFinite) || blur < 0 || distance < 0)
|
|
1023
|
+
return void 0;
|
|
1024
|
+
return {
|
|
1025
|
+
color: resolved.hex,
|
|
1026
|
+
opacity: resolved.alpha,
|
|
1027
|
+
blur,
|
|
1028
|
+
dx: Math.cos(angle) * distance,
|
|
1029
|
+
dy: Math.sin(angle) * distance
|
|
1030
|
+
};
|
|
1332
1031
|
}
|
|
1333
1032
|
|
|
1334
1033
|
// opc/content-types.ts
|
|
@@ -1907,6 +1606,215 @@ function replaceTitleGroup(headingPairs, titlesOfParts, group) {
|
|
|
1907
1606
|
return fromTitleGroups(groups);
|
|
1908
1607
|
}
|
|
1909
1608
|
|
|
1609
|
+
// diagram/drawing-theme.ts
|
|
1610
|
+
function resolveDiagramDrawingStyles(drawing, scheme) {
|
|
1611
|
+
if (!scheme) return drawing;
|
|
1612
|
+
return {
|
|
1613
|
+
...drawing,
|
|
1614
|
+
shapes: drawing.shapes.map((shape2) => {
|
|
1615
|
+
const refs = shape2.style;
|
|
1616
|
+
if (!refs) return shape2;
|
|
1617
|
+
const fill3 = !shape2.fill && refs.fill?.index !== void 0 ? refs.fill.index === 0 ? { kind: "none" } : resolveThemeFillStyle(scheme, refs.fill.index, refs.fill.color) : void 0;
|
|
1618
|
+
const inheritedLine = refs.line?.index !== void 0 ? refs.line.index === 0 ? { fill: { kind: "none" } } : resolveThemeLineStyle(scheme, refs.line.index, refs.line.color) : void 0;
|
|
1619
|
+
const line = inheritedLine ? { ...inheritedLine, ...shape2.line } : void 0;
|
|
1620
|
+
const effects2 = !shape2.effects && refs.effect?.index !== void 0 ? resolveThemeEffectStyle(scheme, refs.effect.index, refs.effect.color) : void 0;
|
|
1621
|
+
return {
|
|
1622
|
+
...shape2,
|
|
1623
|
+
...fill3 ? { fill: fill3 } : {},
|
|
1624
|
+
...line ? { line } : {},
|
|
1625
|
+
...effects2 ? { effects: effects2 } : {}
|
|
1626
|
+
};
|
|
1627
|
+
})
|
|
1628
|
+
};
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
// diagram/write/cache.ts
|
|
1632
|
+
var DSP = "http://schemas.microsoft.com/office/drawing/2008/diagram";
|
|
1633
|
+
function add(parent, namespace, name, attrs3 = {}) {
|
|
1634
|
+
const child17 = parent.ownerDocument.createElementNS(namespace, name);
|
|
1635
|
+
for (const [key2, value] of Object.entries(attrs3)) child17.setAttribute(key2, value);
|
|
1636
|
+
parent.appendChild(child17);
|
|
1637
|
+
return child17;
|
|
1638
|
+
}
|
|
1639
|
+
function withDiagramDrawingRelationship(xml, relationshipId) {
|
|
1640
|
+
const doc = parseXml(xml);
|
|
1641
|
+
const model = doc.documentElement;
|
|
1642
|
+
let extension = descendants(model, "dataModelExt").find((node) => node.namespaceURI === DSP);
|
|
1643
|
+
if (!extension) {
|
|
1644
|
+
const extLst = first(model, "extLst", NS.dgm) ?? add(model, NS.dgm, "dgm:extLst");
|
|
1645
|
+
extension = add(add(extLst, NS.a, "a:ext", { uri: DSP }), DSP, "dsp:dataModelExt", {
|
|
1646
|
+
minVer: NS.dgm
|
|
1647
|
+
});
|
|
1648
|
+
}
|
|
1649
|
+
extension.setAttribute("relId", relationshipId);
|
|
1650
|
+
return buildXml(doc);
|
|
1651
|
+
}
|
|
1652
|
+
function buildGeneratedDiagramCache(dataXml2, input) {
|
|
1653
|
+
dataXml2 = withDiagramPictureSources(dataXml2, input.source);
|
|
1654
|
+
const source = { ...input.source, dataXml: dataXml2 };
|
|
1655
|
+
const model = parseDiagramDataModel(dataXml2);
|
|
1656
|
+
const scheme = { ...DEFAULT_GENERATED_DIAGRAM_SCHEME, ...input.scheme };
|
|
1657
|
+
const preview = previewDiagramLayout({
|
|
1658
|
+
...input,
|
|
1659
|
+
source,
|
|
1660
|
+
scheme,
|
|
1661
|
+
nodes: diagramNodesInTreeOrder(model)
|
|
1662
|
+
});
|
|
1663
|
+
if (preview.mode !== "interpreted" || preview.issues.length || !preview.drawing?.shapes.length)
|
|
1664
|
+
return void 0;
|
|
1665
|
+
const drawing = resolveDiagramDrawingStyles(preview.drawing, input.formatScheme);
|
|
1666
|
+
const doc = parseXml(dataXml2);
|
|
1667
|
+
const root = doc.documentElement;
|
|
1668
|
+
const points7 = first(root, "ptLst", NS.dgm);
|
|
1669
|
+
const connections = first(root, "cxnLst", NS.dgm);
|
|
1670
|
+
if (!points7 || !connections) return void 0;
|
|
1671
|
+
const colors = source.colorsXml ? parseDiagramColors(source.colorsXml).labels : [];
|
|
1672
|
+
const authoredColors = colors.flatMap((label2) => [...label2.fill.colors, ...label2.line.colors]);
|
|
1673
|
+
const themed = /* @__PURE__ */ new Map();
|
|
1674
|
+
for (const color3 of authoredColors) {
|
|
1675
|
+
const resolved = resolveDrawingColor(color3, { scheme: (name) => scheme[name] });
|
|
1676
|
+
if (resolved && !resolved.unapplied.length) themed.set(resolved.hex.toUpperCase(), color3);
|
|
1677
|
+
}
|
|
1678
|
+
for (const shape2 of drawing.shapes) {
|
|
1679
|
+
if (shape2.has3d || shape2.foldedNodeIds?.length) return void 0;
|
|
1680
|
+
if (shape2.fill && !["none", "solid", "gradient", "picture"].includes(shape2.fill.kind))
|
|
1681
|
+
return void 0;
|
|
1682
|
+
if (shape2.fill?.kind === "picture" && (!shape2.fill.relId || !drawing.pictureParts?.[shape2.fill.relId]))
|
|
1683
|
+
return void 0;
|
|
1684
|
+
if (shape2.fill?.kind === "gradient" && shape2.fill.path && !["circle", "rect"].includes(shape2.fill.path))
|
|
1685
|
+
return void 0;
|
|
1686
|
+
if (shape2.effects?.effects.some(
|
|
1687
|
+
(effect) => effect.kind !== "outerShadow" || !resolveDrawingOuterShadow(effect, { scheme: (name) => scheme[name] })
|
|
1688
|
+
))
|
|
1689
|
+
return void 0;
|
|
1690
|
+
const point = children(points7, "pt", NS.dgm).find(
|
|
1691
|
+
(point2) => point2.getAttribute("modelId") === shape2.sourceNodeId
|
|
1692
|
+
);
|
|
1693
|
+
const direct = model.nodes.find((node) => node.modelId === shape2.sourceNodeId);
|
|
1694
|
+
const fillIndex = shape2.style?.fill?.index;
|
|
1695
|
+
const template = fillIndex ? input.formatScheme?.fillStyles[fillIndex - 1]?.fill : void 0;
|
|
1696
|
+
if (!direct?.fill && shape2.fill?.kind === "solid" && shape2.fill.color.kind === "srgb" && (!template || template.kind === "solid" && template.color.kind === "scheme" && template.color.value === "phClr")) {
|
|
1697
|
+
const original = themed.get(`#${shape2.fill.color.value}`.toUpperCase());
|
|
1698
|
+
if (original)
|
|
1699
|
+
shape2.fill.color = {
|
|
1700
|
+
...original,
|
|
1701
|
+
transforms: [...original.transforms, ...shape2.fill.color.transforms]
|
|
1702
|
+
};
|
|
1703
|
+
}
|
|
1704
|
+
if (!direct?.fill && shape2.fill?.kind === "gradient" && template?.kind === "gradient") {
|
|
1705
|
+
shape2.fill.stops.forEach((stop, index) => {
|
|
1706
|
+
const authored = template.stops[index]?.color;
|
|
1707
|
+
if (authored?.kind === "scheme" && authored.value === "phClr" && stop.color.kind === "srgb") {
|
|
1708
|
+
const original = themed.get(`#${stop.color.value}`.toUpperCase());
|
|
1709
|
+
if (original)
|
|
1710
|
+
stop.color = {
|
|
1711
|
+
...original,
|
|
1712
|
+
transforms: [...original.transforms, ...stop.color.transforms]
|
|
1713
|
+
};
|
|
1714
|
+
}
|
|
1715
|
+
});
|
|
1716
|
+
}
|
|
1717
|
+
const role = colors.find((label2) => label2.name === shape2.sourceStyleLabel) ?? colors.find((label2) => label2.name === "node0");
|
|
1718
|
+
const fallbackColor = role?.textFill.colors[0] ?? {
|
|
1719
|
+
kind: "scheme",
|
|
1720
|
+
value: "tx1",
|
|
1721
|
+
transforms: []
|
|
1722
|
+
};
|
|
1723
|
+
const body = parseDrawingRichTextBody(first(point, "t", NS.dgm));
|
|
1724
|
+
if (body) {
|
|
1725
|
+
const props = body.bodyProperties;
|
|
1726
|
+
if (props && (props.vertical && props.vertical !== "horz" || (props.columnCount ?? 1) > 1 || props.rotation || props.extraXml?.length || props.autofit?.kind === "shape"))
|
|
1727
|
+
return void 0;
|
|
1728
|
+
for (const paragraph2 of body.paragraphs) {
|
|
1729
|
+
if (paragraph2.properties?.bullet && paragraph2.properties.bullet.kind !== "none" || paragraph2.properties?.tabStops?.length || paragraph2.items.some((item) => item.kind === "unknown"))
|
|
1730
|
+
return void 0;
|
|
1731
|
+
if (paragraph2.properties?.extraXml?.length || paragraph2.items.some((item) => {
|
|
1732
|
+
const properties = "properties" in item ? item.properties : void 0;
|
|
1733
|
+
return properties && (properties.baseline || properties.spacingPt || properties.rightToLeft || properties.highlight || properties.line || properties.caps && properties.caps !== "none" || properties.strike && properties.strike !== "noStrike" || properties.extraXml?.length);
|
|
1734
|
+
}))
|
|
1735
|
+
return void 0;
|
|
1736
|
+
paragraph2.properties = {
|
|
1737
|
+
...paragraph2.properties,
|
|
1738
|
+
defaultRunProperties: {
|
|
1739
|
+
sizePt: shape2.text?.paragraphs[0]?.runs[0]?.sizePt ?? 12,
|
|
1740
|
+
fill: { kind: "solid", color: fallbackColor },
|
|
1741
|
+
latin: { typeface: "+mn-lt" },
|
|
1742
|
+
...paragraph2.properties?.defaultRunProperties
|
|
1743
|
+
}
|
|
1744
|
+
};
|
|
1745
|
+
}
|
|
1746
|
+
body.bodyProperties = { anchor: "ctr", ...body.bodyProperties };
|
|
1747
|
+
shape2.body = body;
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
let serialized;
|
|
1751
|
+
try {
|
|
1752
|
+
serialized = writeGeneratedDiagramDrawing(drawing);
|
|
1753
|
+
} catch {
|
|
1754
|
+
return void 0;
|
|
1755
|
+
}
|
|
1756
|
+
const oldMarkers = descendants(root, "generatedCache").filter(
|
|
1757
|
+
(node) => node.namespaceURI === GENERATED_DIAGRAM_CACHE_NS
|
|
1758
|
+
);
|
|
1759
|
+
const oldIds = new Set(
|
|
1760
|
+
oldMarkers.flatMap(
|
|
1761
|
+
(marker3) => descendants(marker3, "shape").map((node) => node.getAttribute("id"))
|
|
1762
|
+
)
|
|
1763
|
+
);
|
|
1764
|
+
for (const point of children(points7, "pt", NS.dgm))
|
|
1765
|
+
if (oldIds.has(point.getAttribute("modelId"))) points7.removeChild(point);
|
|
1766
|
+
for (const edge of children(connections, "cxn", NS.dgm))
|
|
1767
|
+
if (oldIds.has(edge.getAttribute("destId"))) connections.removeChild(edge);
|
|
1768
|
+
for (const marker3 of oldMarkers) {
|
|
1769
|
+
const parent = marker3.parentNode;
|
|
1770
|
+
if (parent && children(parent, "generatedCache", GENERATED_DIAGRAM_CACHE_NS).length === 1 && parent.childNodes.length === 1)
|
|
1771
|
+
parent.parentNode?.removeChild(parent);
|
|
1772
|
+
else parent?.removeChild(marker3);
|
|
1773
|
+
}
|
|
1774
|
+
const extLst = first(root, "extLst", NS.dgm) ?? add(root, NS.dgm, "dgm:extLst");
|
|
1775
|
+
const marker2 = add(
|
|
1776
|
+
add(extLst, NS.a, "a:ext", { uri: GENERATED_DIAGRAM_CACHE_NS }),
|
|
1777
|
+
GENERATED_DIAGRAM_CACHE_NS,
|
|
1778
|
+
"oc:generatedCache",
|
|
1779
|
+
{
|
|
1780
|
+
engine: "ordered-2d",
|
|
1781
|
+
approximate: "1",
|
|
1782
|
+
drawingSha256: generatedDrawingDigest(serialized.xml)
|
|
1783
|
+
}
|
|
1784
|
+
);
|
|
1785
|
+
drawing.shapes.forEach((shape2, index) => {
|
|
1786
|
+
const id = serialized.modelIds.get(shape2.modelId);
|
|
1787
|
+
const point = add(points7, NS.dgm, "dgm:pt", { modelId: id, type: "pres" });
|
|
1788
|
+
add(point, NS.dgm, "dgm:prSet", {
|
|
1789
|
+
...shape2.sourceNodeId ? { presAssocID: shape2.sourceNodeId } : {},
|
|
1790
|
+
presName: shape2.sourceLayoutRole ?? "node",
|
|
1791
|
+
presStyleLbl: shape2.sourceStyleLabel ?? "node1",
|
|
1792
|
+
presStyleIdx: String(index),
|
|
1793
|
+
presStyleCnt: String(drawing.shapes.length)
|
|
1794
|
+
});
|
|
1795
|
+
const properties = add(point, NS.dgm, "dgm:spPr");
|
|
1796
|
+
if (shape2.fill?.kind === "picture" && shape2.fill.sourceXml) {
|
|
1797
|
+
properties.appendChild(doc.importNode(parseXml(shape2.fill.sourceXml).documentElement, true));
|
|
1798
|
+
}
|
|
1799
|
+
if (shape2.sourceNodeId)
|
|
1800
|
+
add(connections, NS.dgm, "dgm:cxn", {
|
|
1801
|
+
modelId: createOfficeGuid(),
|
|
1802
|
+
type: "presOf",
|
|
1803
|
+
srcId: shape2.sourceNodeId,
|
|
1804
|
+
destId: id,
|
|
1805
|
+
srcOrd: "0",
|
|
1806
|
+
destOrd: "0",
|
|
1807
|
+
presId: input.layoutId ?? ""
|
|
1808
|
+
});
|
|
1809
|
+
add(marker2, GENERATED_DIAGRAM_CACHE_NS, "oc:shape", { id });
|
|
1810
|
+
});
|
|
1811
|
+
return {
|
|
1812
|
+
dataXml: buildXml(doc),
|
|
1813
|
+
drawingXml: serialized.xml,
|
|
1814
|
+
...drawing.pictureParts ? { pictureParts: drawing.pictureParts } : {}
|
|
1815
|
+
};
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1910
1818
|
// diagram/relationships.ts
|
|
1911
1819
|
function diagramRelationshipsPart(partPath) {
|
|
1912
1820
|
const dir = partPath.replace(/\/[^/]+$/u, "");
|
|
@@ -1935,84 +1843,164 @@ async function resolveDiagramDrawingPart(hostPart, dataRelId, drawingExtensionRe
|
|
|
1935
1843
|
if (id.length === 0 || target.length === 0) return void 0;
|
|
1936
1844
|
return { relId: id, path: host.resolvePath(dataPath, target), ownerPart: dataPath };
|
|
1937
1845
|
}
|
|
1846
|
+
({
|
|
1847
|
+
data: RELATIONSHIP_TYPES.diagramData,
|
|
1848
|
+
layout: RELATIONSHIP_TYPES.diagramLayout,
|
|
1849
|
+
quickStyle: RELATIONSHIP_TYPES.diagramQuickStyle,
|
|
1850
|
+
colors: RELATIONSHIP_TYPES.diagramColors,
|
|
1851
|
+
drawing: RELATIONSHIP_TYPES.diagramDrawing
|
|
1852
|
+
});
|
|
1938
1853
|
|
|
1939
|
-
//
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
]
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1854
|
+
// diagram/load.ts
|
|
1855
|
+
var slot = [
|
|
1856
|
+
["data", "dataRelId"],
|
|
1857
|
+
["layout", "layoutRelId"],
|
|
1858
|
+
["quickStyle", "styleRelId"],
|
|
1859
|
+
["colors", "colorsRelId"]
|
|
1860
|
+
];
|
|
1861
|
+
async function loadDiagram(hostPart, relationshipIds, host) {
|
|
1862
|
+
const issues = [];
|
|
1863
|
+
const paths = {};
|
|
1864
|
+
const hostRels = host.hostRelationships(hostPart);
|
|
1865
|
+
for (const [name, key2] of slot) {
|
|
1866
|
+
const relId = relationshipIds[key2];
|
|
1867
|
+
if (!relId) {
|
|
1868
|
+
issues.push({
|
|
1869
|
+
code: "DIAGRAM_RELATIONSHIP_MISSING",
|
|
1870
|
+
message: `The diagram has no ${name} relationship id.`
|
|
1871
|
+
});
|
|
1872
|
+
continue;
|
|
1873
|
+
}
|
|
1874
|
+
const target = hostRels?.get(relId);
|
|
1875
|
+
if (target === void 0)
|
|
1876
|
+
issues.push({
|
|
1877
|
+
code: "DIAGRAM_RELATIONSHIP_UNRESOLVED",
|
|
1878
|
+
message: `Relationship ${relId} (${name}) is not in ${hostPart}.`
|
|
1879
|
+
});
|
|
1880
|
+
else paths[name] = host.resolvePath(hostPart, target);
|
|
1949
1881
|
}
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1882
|
+
const layoutSource = {};
|
|
1883
|
+
const read = async (name, parse) => {
|
|
1884
|
+
const part = paths[name];
|
|
1885
|
+
if (!part) return void 0;
|
|
1886
|
+
try {
|
|
1887
|
+
const xml = await host.readText(part);
|
|
1888
|
+
if (xml === void 0) {
|
|
1889
|
+
issues.push({
|
|
1890
|
+
code: "DIAGRAM_PART_MISSING",
|
|
1891
|
+
message: `Part ${part} is not in the package.`,
|
|
1892
|
+
part
|
|
1893
|
+
});
|
|
1894
|
+
return void 0;
|
|
1895
|
+
}
|
|
1896
|
+
if (name === "layout") layoutSource.layoutXml = xml;
|
|
1897
|
+
if (name === "data") layoutSource.dataXml = xml;
|
|
1898
|
+
if (name === "colors") layoutSource.colorsXml = xml;
|
|
1899
|
+
if (name === "quickStyle") layoutSource.quickStyleXml = xml;
|
|
1900
|
+
return parse(xml, part);
|
|
1901
|
+
} catch (error) {
|
|
1902
|
+
issues.push({
|
|
1903
|
+
code: "DIAGRAM_PART_UNREADABLE",
|
|
1904
|
+
message: `Part ${part} could not be parsed: ${error instanceof Error ? error.message : String(error)}`,
|
|
1905
|
+
part
|
|
1906
|
+
});
|
|
1907
|
+
return void 0;
|
|
1908
|
+
}
|
|
1972
1909
|
};
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
const
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1910
|
+
const data = await read("data", (xml, part) => parseDiagramDataModel(xml, part));
|
|
1911
|
+
if (data) issues.push(...data.issues);
|
|
1912
|
+
const layout = await read("layout", (xml) => parseDiagramLayoutSummary(xml));
|
|
1913
|
+
const colors = await read("colors", (xml) => parseDiagramColors(xml));
|
|
1914
|
+
const quickStyle = await read("quickStyle", (xml) => parseDiagramQuickStyle(xml));
|
|
1915
|
+
let drawingResolution;
|
|
1916
|
+
try {
|
|
1917
|
+
drawingResolution = await resolveDiagramDrawingPart(
|
|
1918
|
+
hostPart,
|
|
1919
|
+
relationshipIds.dataRelId ?? "",
|
|
1920
|
+
data?.drawingRelId ?? "",
|
|
1921
|
+
host
|
|
1922
|
+
);
|
|
1923
|
+
} catch (error) {
|
|
1924
|
+
issues.push({
|
|
1925
|
+
code: "DIAGRAM_DRAWING_UNRESOLVED",
|
|
1926
|
+
message: `The cached drawing could not be located: ${error instanceof Error ? error.message : String(error)}`
|
|
1927
|
+
});
|
|
1928
|
+
}
|
|
1929
|
+
let drawing;
|
|
1930
|
+
let generatedCache = false;
|
|
1931
|
+
if (drawingResolution) {
|
|
1932
|
+
paths.drawing = drawingResolution.path;
|
|
1933
|
+
drawing = await read("drawing", (xml, part) => {
|
|
1934
|
+
generatedCache = Boolean(
|
|
1935
|
+
data?.generatedCacheDigest && data.generatedCacheDigest === generatedDrawingDigest(xml)
|
|
1936
|
+
);
|
|
1937
|
+
return parseDiagramDrawing(xml, part);
|
|
1938
|
+
});
|
|
1939
|
+
if (drawing) {
|
|
1940
|
+
try {
|
|
1941
|
+
const entries = await host.readRelationshipEntries(
|
|
1942
|
+
diagramRelationshipsPart(drawingResolution.path)
|
|
1943
|
+
);
|
|
1944
|
+
const pictures = (entries ?? []).filter(
|
|
1945
|
+
(entry2) => entry2.type.endsWith("/image") && entry2.mode !== "External" && !/^[a-z][a-z0-9+.-]*:/i.test(entry2.target)
|
|
1946
|
+
);
|
|
1947
|
+
if (pictures.length)
|
|
1948
|
+
drawing.pictureParts = Object.fromEntries(
|
|
1949
|
+
pictures.map((entry2) => [
|
|
1950
|
+
entry2.id,
|
|
1951
|
+
host.resolvePath(drawingResolution.path, entry2.target)
|
|
1952
|
+
])
|
|
1953
|
+
);
|
|
1954
|
+
} catch {
|
|
1955
|
+
issues.push({
|
|
1956
|
+
code: "DIAGRAM_PICTURE_RELATIONSHIPS_UNREADABLE",
|
|
1957
|
+
message: "Picture relationships in the cached drawing could not be read."
|
|
1958
|
+
});
|
|
1959
|
+
}
|
|
1960
|
+
issues.push(...drawing.issues);
|
|
1961
|
+
}
|
|
1962
|
+
} else if (data)
|
|
1963
|
+
issues.push({
|
|
1964
|
+
code: "DIAGRAM_DRAWING_ABSENT",
|
|
1965
|
+
message: "The package has no cached drawing for this diagram; its layout can only be recomputed from the layout definition."
|
|
1966
|
+
});
|
|
1967
|
+
if (data && layoutSource.dataXml) {
|
|
1968
|
+
let pictureParts = {};
|
|
1969
|
+
if (paths.data) {
|
|
1970
|
+
const owner = paths.data;
|
|
1971
|
+
try {
|
|
1972
|
+
const entries = await host.readRelationshipEntries(diagramRelationshipsPart(owner));
|
|
1973
|
+
pictureParts = Object.fromEntries(
|
|
1974
|
+
(entries ?? []).filter(
|
|
1975
|
+
(entry2) => entry2.type.endsWith("/image") && entry2.mode !== "External" && !/^[a-z][a-z0-9+.-]*:/i.test(entry2.target)
|
|
1976
|
+
).map((entry2) => [entry2.id, host.resolvePath(owner, entry2.target)])
|
|
1977
|
+
);
|
|
1978
|
+
} catch {
|
|
1979
|
+
issues.push({
|
|
1980
|
+
code: "DIAGRAM_PICTURE_RELATIONSHIPS_UNREADABLE",
|
|
1981
|
+
message: "Picture relationships in the diagram data could not be read."
|
|
1982
|
+
});
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
Object.assign(
|
|
1986
|
+
layoutSource,
|
|
1987
|
+
captureDiagramPictures(data, layoutSource.dataXml, pictureParts, drawing)
|
|
1988
|
+
);
|
|
1989
|
+
}
|
|
1985
1990
|
return {
|
|
1986
|
-
|
|
1987
|
-
...
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
...
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
}
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
const result = {
|
|
1999
|
-
paragraphs,
|
|
2000
|
-
text: paragraphs.map((paragraph2) => paragraph2.runs.map((run2) => run2.text).join("")).join("\n")
|
|
1991
|
+
layoutSource,
|
|
1992
|
+
...generatedCache ? { generatedCache: true } : {},
|
|
1993
|
+
relationshipIds,
|
|
1994
|
+
paths,
|
|
1995
|
+
...drawingResolution ? { drawingRelId: drawingResolution.relId } : {},
|
|
1996
|
+
...drawingResolution?.ownerPart ? { drawingOwnerPart: drawingResolution.ownerPart } : {},
|
|
1997
|
+
...data ? { data } : {},
|
|
1998
|
+
...layout ? { layout } : {},
|
|
1999
|
+
...colors ? { colors } : {},
|
|
2000
|
+
...quickStyle ? { quickStyle } : {},
|
|
2001
|
+
...drawing ? { drawing } : {},
|
|
2002
|
+
issues
|
|
2001
2003
|
};
|
|
2002
|
-
const anchor = properties?.getAttribute("anchor");
|
|
2003
|
-
if (anchor) result.anchor = anchor;
|
|
2004
|
-
const insets = {};
|
|
2005
|
-
for (const [key2, attribute2] of [
|
|
2006
|
-
["left", "lIns"],
|
|
2007
|
-
["top", "tIns"],
|
|
2008
|
-
["right", "rIns"],
|
|
2009
|
-
["bottom", "bIns"]
|
|
2010
|
-
]) {
|
|
2011
|
-
const value = Number.parseInt(properties?.getAttribute(attribute2) ?? "", 10);
|
|
2012
|
-
if (Number.isFinite(value)) insets[key2] = value;
|
|
2013
|
-
}
|
|
2014
|
-
if (Object.keys(insets).length > 0) result.insetsEmu = insets;
|
|
2015
|
-
return result;
|
|
2016
2004
|
}
|
|
2017
2005
|
|
|
2018
2006
|
// chart/model-analysis.ts
|
|
@@ -3491,7 +3479,7 @@ function findSectionList(presentation, lookup) {
|
|
|
3491
3479
|
}
|
|
3492
3480
|
return void 0;
|
|
3493
3481
|
}
|
|
3494
|
-
function
|
|
3482
|
+
function booleanAttribute(value) {
|
|
3495
3483
|
const normalized = String(value ?? "").trim().toLowerCase();
|
|
3496
3484
|
if (normalized === "1" || normalized === "true") {
|
|
3497
3485
|
return true;
|
|
@@ -3527,7 +3515,7 @@ function extractSectionMap(presentationData, lookup) {
|
|
|
3527
3515
|
id: sectionId,
|
|
3528
3516
|
name: sectionName,
|
|
3529
3517
|
slideIds,
|
|
3530
|
-
collapsed:
|
|
3518
|
+
collapsed: booleanAttribute(sectionPr?.["@_collapsed"]),
|
|
3531
3519
|
color: colorRaw ? colorRaw.startsWith("#") ? colorRaw : `#${colorRaw}` : void 0,
|
|
3532
3520
|
rawXml: cloneXmlObject(section)
|
|
3533
3521
|
});
|
|
@@ -6236,7 +6224,7 @@ function extractFillOverlayAttributes(shapeProps, context) {
|
|
|
6236
6224
|
|
|
6237
6225
|
// pptx/core/core/builders/effect-style-extractor-reflection.ts
|
|
6238
6226
|
var VALID_ALIGNMENTS = /* @__PURE__ */ new Set(["tl", "t", "tr", "l", "ctr", "r", "bl", "b", "br"]);
|
|
6239
|
-
function
|
|
6227
|
+
function integer(value) {
|
|
6240
6228
|
if (value === void 0 || value === null || value === "") {
|
|
6241
6229
|
return void 0;
|
|
6242
6230
|
}
|
|
@@ -6253,19 +6241,19 @@ function boolean(value) {
|
|
|
6253
6241
|
return void 0;
|
|
6254
6242
|
}
|
|
6255
6243
|
function fixedFraction(value) {
|
|
6256
|
-
const parsed =
|
|
6244
|
+
const parsed = integer(value);
|
|
6257
6245
|
return parsed !== void 0 && parsed >= 0 && parsed <= 1e5 ? parsed / 1e5 : void 0;
|
|
6258
6246
|
}
|
|
6259
6247
|
function extractReflectionAttributes(node, emuPerPx) {
|
|
6260
|
-
const blur =
|
|
6261
|
-
const distance =
|
|
6262
|
-
const startOpacity =
|
|
6263
|
-
const endOpacity =
|
|
6264
|
-
const startPosition =
|
|
6265
|
-
const endPosition =
|
|
6266
|
-
const direction =
|
|
6267
|
-
const rotation =
|
|
6268
|
-
const fadeDirection =
|
|
6248
|
+
const blur = integer(node["@_blurRad"]);
|
|
6249
|
+
const distance = integer(node["@_dist"]);
|
|
6250
|
+
const startOpacity = integer(node["@_stA"]);
|
|
6251
|
+
const endOpacity = integer(node["@_endA"]);
|
|
6252
|
+
const startPosition = integer(node["@_stPos"]);
|
|
6253
|
+
const endPosition = integer(node["@_endPos"]);
|
|
6254
|
+
const direction = integer(node["@_dir"]);
|
|
6255
|
+
const rotation = integer(node["@_rot"]);
|
|
6256
|
+
const fadeDirection = integer(node["@_fadeDir"]);
|
|
6269
6257
|
const alignment = String(node["@_algn"] ?? "").trim();
|
|
6270
6258
|
return {
|
|
6271
6259
|
reflectionBlurRadius: blur !== void 0 && blur >= 0 ? blur / emuPerPx : void 0,
|
|
@@ -6277,10 +6265,10 @@ function extractReflectionAttributes(node, emuPerPx) {
|
|
|
6277
6265
|
reflectionRotation: rotation !== void 0 ? rotation / 6e4 : void 0,
|
|
6278
6266
|
reflectionDistance: distance !== void 0 && distance >= 0 ? distance / emuPerPx : void 0,
|
|
6279
6267
|
reflectionFadeDirection: fadeDirection !== void 0 ? fadeDirection / 6e4 : void 0,
|
|
6280
|
-
reflectionScaleX:
|
|
6281
|
-
reflectionScaleY:
|
|
6282
|
-
reflectionSkewX:
|
|
6283
|
-
reflectionSkewY:
|
|
6268
|
+
reflectionScaleX: integer(node["@_sx"]),
|
|
6269
|
+
reflectionScaleY: integer(node["@_sy"]),
|
|
6270
|
+
reflectionSkewX: integer(node["@_kx"]),
|
|
6271
|
+
reflectionSkewY: integer(node["@_ky"]),
|
|
6284
6272
|
reflectionAlignment: VALID_ALIGNMENTS.has(alignment) ? alignment : void 0,
|
|
6285
6273
|
reflectionRotateWithShape: boolean(node["@_rotWithShape"])
|
|
6286
6274
|
};
|
|
@@ -10839,12 +10827,12 @@ var PptxShapeIdValidator = class {
|
|
|
10839
10827
|
return { reassigned: 0, ids };
|
|
10840
10828
|
}
|
|
10841
10829
|
const usedIds = /* @__PURE__ */ new Set();
|
|
10842
|
-
const
|
|
10830
|
+
const invalid2 = [];
|
|
10843
10831
|
let maxId = 0;
|
|
10844
10832
|
for (const cNvPr of cNvPrNodes) {
|
|
10845
10833
|
const id = parseShapeId(cNvPr["@_id"], true);
|
|
10846
10834
|
if (id === void 0 || id === 0 || usedIds.has(id)) {
|
|
10847
|
-
|
|
10835
|
+
invalid2.push(cNvPr);
|
|
10848
10836
|
continue;
|
|
10849
10837
|
}
|
|
10850
10838
|
usedIds.add(id);
|
|
@@ -10853,7 +10841,7 @@ var PptxShapeIdValidator = class {
|
|
|
10853
10841
|
}
|
|
10854
10842
|
}
|
|
10855
10843
|
const allocator = new ShapeIdAllocator(usedIds, maxId);
|
|
10856
|
-
for (const cNvPr of
|
|
10844
|
+
for (const cNvPr of invalid2) {
|
|
10857
10845
|
const oldId = String(cNvPr["@_id"] ?? "").trim();
|
|
10858
10846
|
const fresh = String(allocator.next());
|
|
10859
10847
|
cNvPr["@_id"] = fresh;
|
|
@@ -10862,7 +10850,7 @@ var PptxShapeIdValidator = class {
|
|
|
10862
10850
|
}
|
|
10863
10851
|
}
|
|
10864
10852
|
remapShapeIdReferences(referenceRoot, ids);
|
|
10865
|
-
return { reassigned:
|
|
10853
|
+
return { reassigned: invalid2.length, ids };
|
|
10866
10854
|
}
|
|
10867
10855
|
};
|
|
10868
10856
|
|
|
@@ -35271,7 +35259,7 @@ function collectDesiredEffects(animations) {
|
|
|
35271
35259
|
const desired = [];
|
|
35272
35260
|
animations.forEach((anim, index) => {
|
|
35273
35261
|
const order = anim.order ?? index;
|
|
35274
|
-
const
|
|
35262
|
+
const add2 = (presetClass) => {
|
|
35275
35263
|
desired.push({
|
|
35276
35264
|
anim,
|
|
35277
35265
|
key: effectOwnershipKey(anim.elementId, presetClass),
|
|
@@ -35280,16 +35268,16 @@ function collectDesiredEffects(animations) {
|
|
|
35280
35268
|
});
|
|
35281
35269
|
};
|
|
35282
35270
|
if (anim.entrance && anim.entrance !== "none") {
|
|
35283
|
-
|
|
35271
|
+
add2("entr");
|
|
35284
35272
|
}
|
|
35285
35273
|
if (anim.emphasis && anim.emphasis !== "none") {
|
|
35286
|
-
|
|
35274
|
+
add2("emph");
|
|
35287
35275
|
}
|
|
35288
35276
|
if (anim.exit && anim.exit !== "none") {
|
|
35289
|
-
|
|
35277
|
+
add2("exit");
|
|
35290
35278
|
}
|
|
35291
35279
|
if (anim.motionPath) {
|
|
35292
|
-
|
|
35280
|
+
add2("path");
|
|
35293
35281
|
}
|
|
35294
35282
|
});
|
|
35295
35283
|
return desired;
|
|
@@ -38920,9 +38908,9 @@ function parseDimension(context, element2) {
|
|
|
38920
38908
|
var DATA = /* @__PURE__ */ new Set(["numDim", "strDim", "extLst"]);
|
|
38921
38909
|
function parseData(context, element2) {
|
|
38922
38910
|
reportUnmodelled2(context, element2, DATA);
|
|
38923
|
-
const
|
|
38911
|
+
const dimensions2 = elements(element2).filter((child17) => child17.localName === "numDim" || child17.localName === "strDim").map((child17) => parseDimension(context, child17));
|
|
38924
38912
|
return assignDefined(
|
|
38925
|
-
{ dimensions },
|
|
38913
|
+
{ dimensions: dimensions2 },
|
|
38926
38914
|
{ id: indexAttribute(context, element2, "id"), extLst: extensionList2(element2) }
|
|
38927
38915
|
);
|
|
38928
38916
|
}
|
|
@@ -39346,7 +39334,7 @@ function numberFormatXml2(format) {
|
|
|
39346
39334
|
|
|
39347
39335
|
// chart/ex/write-series.ts
|
|
39348
39336
|
function dataXml(context, data) {
|
|
39349
|
-
const
|
|
39337
|
+
const dimensions2 = data.dimensions.map((dimension2) => {
|
|
39350
39338
|
const levels = dimension2.levels.map(
|
|
39351
39339
|
(level) => cxElement(
|
|
39352
39340
|
"lvl",
|
|
@@ -39364,7 +39352,7 @@ function dataXml(context, data) {
|
|
|
39364
39352
|
attributes([["type", dimension2.type]])
|
|
39365
39353
|
);
|
|
39366
39354
|
}).join("");
|
|
39367
|
-
return cxElement("data",
|
|
39355
|
+
return cxElement("data", dimensions2 + raw(context, data.extLst), attributes([["id", data.id]]));
|
|
39368
39356
|
}
|
|
39369
39357
|
function chartDataXml(context, chartData) {
|
|
39370
39358
|
const external = chartData.externalData;
|
|
@@ -40671,6 +40659,236 @@ function createChartExSpace(data, layout, options2 = {}) {
|
|
|
40671
40659
|
return space;
|
|
40672
40660
|
}
|
|
40673
40661
|
|
|
40662
|
+
// digest/crc32.ts
|
|
40663
|
+
var crcTable = Uint32Array.from({ length: 256 }, (_, value) => {
|
|
40664
|
+
for (let i = 0; i < 8; i++) value = value & 1 ? 3988292384 ^ value >>> 1 : value >>> 1;
|
|
40665
|
+
return value >>> 0;
|
|
40666
|
+
});
|
|
40667
|
+
function crc32(bytes, crc = 4294967295) {
|
|
40668
|
+
for (const byte of bytes) crc = (crcTable[(crc ^ byte) & 255] ?? 0) ^ crc >>> 8;
|
|
40669
|
+
return crc >>> 0;
|
|
40670
|
+
}
|
|
40671
|
+
|
|
40672
|
+
// drawingml/raster-image.ts
|
|
40673
|
+
var RASTER_IMAGE_LIMITS = Object.freeze({
|
|
40674
|
+
maxImageBytes: 8 * 1024 * 1024,
|
|
40675
|
+
maxPixels: 16e6,
|
|
40676
|
+
maxDimension: 16384
|
|
40677
|
+
});
|
|
40678
|
+
var RasterImageError = class extends Error {
|
|
40679
|
+
constructor(code, message) {
|
|
40680
|
+
super(message);
|
|
40681
|
+
this.code = code;
|
|
40682
|
+
this.name = "RasterImageError";
|
|
40683
|
+
}
|
|
40684
|
+
code;
|
|
40685
|
+
};
|
|
40686
|
+
var invalid = (message) => {
|
|
40687
|
+
throw new RasterImageError("invalid-image", message);
|
|
40688
|
+
};
|
|
40689
|
+
var unsupported2 = (message) => {
|
|
40690
|
+
throw new RasterImageError("unsupported-image", message);
|
|
40691
|
+
};
|
|
40692
|
+
function dimensions(width, height, limits) {
|
|
40693
|
+
if (!width || !height) invalid("Raster image has zero dimensions.");
|
|
40694
|
+
if (width > limits.maxDimension || height > limits.maxDimension || width * height > limits.maxPixels)
|
|
40695
|
+
throw new RasterImageError(
|
|
40696
|
+
"image-limit",
|
|
40697
|
+
"Raster image dimensions exceed the configured limit."
|
|
40698
|
+
);
|
|
40699
|
+
}
|
|
40700
|
+
var ascii = (bytes, start, length) => String.fromCharCode(...bytes.subarray(start, start + length));
|
|
40701
|
+
function png(bytes, limits) {
|
|
40702
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
40703
|
+
if (bytes.length < 33 || view.getUint32(8) !== 13 || ascii(bytes, 12, 4) !== "IHDR")
|
|
40704
|
+
return invalid("PNG is missing a complete IHDR header.");
|
|
40705
|
+
const width = view.getUint32(16), height = view.getUint32(20);
|
|
40706
|
+
dimensions(width, height, limits);
|
|
40707
|
+
const depth = bytes[24], color3 = bytes[25];
|
|
40708
|
+
const depths = {
|
|
40709
|
+
0: [1, 2, 4, 8, 16],
|
|
40710
|
+
2: [8, 16],
|
|
40711
|
+
3: [1, 2, 4, 8],
|
|
40712
|
+
4: [8, 16],
|
|
40713
|
+
6: [8, 16]
|
|
40714
|
+
};
|
|
40715
|
+
if (!depths[color3]?.includes(depth) || bytes[26] !== 0 || bytes[27] !== 0 || bytes[28] > 1)
|
|
40716
|
+
invalid("PNG header uses invalid color, compression, filter, or interlace values.");
|
|
40717
|
+
let data = false;
|
|
40718
|
+
for (let at = 8; at < bytes.length; ) {
|
|
40719
|
+
if (at + 12 > bytes.length) invalid("Truncated PNG chunk.");
|
|
40720
|
+
const length = view.getUint32(at), type = ascii(bytes, at + 4, 4), end = at + length + 12;
|
|
40721
|
+
if (end > bytes.length) invalid("Truncated PNG chunk payload.");
|
|
40722
|
+
if ((crc32(bytes.subarray(at + 4, end - 4)) ^ 4294967295) >>> 0 !== view.getUint32(end - 4))
|
|
40723
|
+
invalid("PNG chunk checksum mismatch.");
|
|
40724
|
+
if (type === "acTL") unsupported2("Animated PNG is not supported.");
|
|
40725
|
+
if (type === "IHDR" && at !== 8) invalid("PNG contains multiple image headers.");
|
|
40726
|
+
if (type === "IDAT" && length) data = true;
|
|
40727
|
+
if (type === "IEND") {
|
|
40728
|
+
if (length || end !== bytes.length || !data) invalid("PNG has an invalid image terminator.");
|
|
40729
|
+
return [width, height];
|
|
40730
|
+
}
|
|
40731
|
+
at = end;
|
|
40732
|
+
}
|
|
40733
|
+
return invalid("PNG has no image terminator.");
|
|
40734
|
+
}
|
|
40735
|
+
function gif(bytes, limits) {
|
|
40736
|
+
if (bytes.length < 13) return invalid("GIF is missing a complete screen descriptor.");
|
|
40737
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
40738
|
+
const width = view.getUint16(6, true), height = view.getUint16(8, true);
|
|
40739
|
+
dimensions(width, height, limits);
|
|
40740
|
+
let at = 13 + (bytes[10] & 128 ? 3 * 2 ** ((bytes[10] & 7) + 1) : 0);
|
|
40741
|
+
let frames = 0, pixels = 0;
|
|
40742
|
+
const blocks = () => {
|
|
40743
|
+
for (; ; ) {
|
|
40744
|
+
if (at >= bytes.length) invalid("GIF has truncated data blocks.");
|
|
40745
|
+
const size = bytes[at++];
|
|
40746
|
+
if (!size) return;
|
|
40747
|
+
at += size;
|
|
40748
|
+
if (at > bytes.length) invalid("GIF has a truncated data block.");
|
|
40749
|
+
}
|
|
40750
|
+
};
|
|
40751
|
+
while (at < bytes.length) {
|
|
40752
|
+
const marker2 = bytes[at++];
|
|
40753
|
+
if (marker2 === 59) {
|
|
40754
|
+
if (!frames || at !== bytes.length) invalid("GIF has an invalid image terminator.");
|
|
40755
|
+
return [width, height];
|
|
40756
|
+
}
|
|
40757
|
+
if (marker2 === 33) {
|
|
40758
|
+
if (at >= bytes.length) invalid("GIF has a truncated extension.");
|
|
40759
|
+
at++;
|
|
40760
|
+
blocks();
|
|
40761
|
+
continue;
|
|
40762
|
+
}
|
|
40763
|
+
if (marker2 !== 44 || at + 9 > bytes.length) invalid("GIF has an invalid image descriptor.");
|
|
40764
|
+
const left = view.getUint16(at, true), top = view.getUint16(at + 2, true);
|
|
40765
|
+
const frameWidth = view.getUint16(at + 4, true), frameHeight = view.getUint16(at + 6, true);
|
|
40766
|
+
dimensions(frameWidth, frameHeight, limits);
|
|
40767
|
+
if (left + frameWidth > width || top + frameHeight > height)
|
|
40768
|
+
invalid("GIF frame exceeds its screen.");
|
|
40769
|
+
pixels += width * height;
|
|
40770
|
+
if (pixels > limits.maxPixels)
|
|
40771
|
+
throw new RasterImageError("image-limit", "GIF animation exceeds the pixel limit.");
|
|
40772
|
+
const packed = bytes[at + 8];
|
|
40773
|
+
at += 9 + (packed & 128 ? 3 * 2 ** ((packed & 7) + 1) : 0);
|
|
40774
|
+
if (at >= bytes.length || bytes[at] < 2 || bytes[at] > 8)
|
|
40775
|
+
invalid("GIF has an invalid LZW header.");
|
|
40776
|
+
at++;
|
|
40777
|
+
blocks();
|
|
40778
|
+
frames++;
|
|
40779
|
+
}
|
|
40780
|
+
return invalid("GIF has no image terminator.");
|
|
40781
|
+
}
|
|
40782
|
+
function jpeg(bytes, limits) {
|
|
40783
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
40784
|
+
let at = 2, width = 0, height = 0, scan2 = false;
|
|
40785
|
+
while (at < bytes.length) {
|
|
40786
|
+
if (bytes[at++] !== 255) invalid("JPEG has an invalid segment marker.");
|
|
40787
|
+
while (bytes[at] === 255) at++;
|
|
40788
|
+
const marker2 = bytes[at++];
|
|
40789
|
+
if (marker2 === 217) {
|
|
40790
|
+
if (!width || !scan2 || at !== bytes.length) invalid("JPEG has an invalid image terminator.");
|
|
40791
|
+
return [width, height];
|
|
40792
|
+
}
|
|
40793
|
+
if (marker2 === void 0 || marker2 === 0 || marker2 === 216 || marker2 === 1 || marker2 >= 208 && marker2 <= 215)
|
|
40794
|
+
invalid("JPEG has an unexpected standalone marker.");
|
|
40795
|
+
if (at + 2 > bytes.length) invalid("JPEG has a truncated segment header.");
|
|
40796
|
+
const length = view.getUint16(at), end = at + length;
|
|
40797
|
+
if (length < 2 || end > bytes.length) invalid("JPEG has a truncated segment.");
|
|
40798
|
+
if (marker2 >= 192 && marker2 <= 207 && ![196, 200, 204].includes(marker2)) {
|
|
40799
|
+
if (![192, 193, 194].includes(marker2))
|
|
40800
|
+
unsupported2("This JPEG frame coding is unsupported.");
|
|
40801
|
+
if (width || length < 11 || bytes[at + 2] !== 8 || length !== 8 + 3 * bytes[at + 7])
|
|
40802
|
+
invalid("JPEG has an invalid frame header.");
|
|
40803
|
+
height = view.getUint16(at + 3);
|
|
40804
|
+
width = view.getUint16(at + 5);
|
|
40805
|
+
dimensions(width, height, limits);
|
|
40806
|
+
}
|
|
40807
|
+
if (marker2 === 220) unsupported2("JPEG deferred dimensions are unsupported.");
|
|
40808
|
+
at = end;
|
|
40809
|
+
if (marker2 === 218) {
|
|
40810
|
+
if (!width || length < 8 || length !== 6 + 2 * bytes[end - length + 2])
|
|
40811
|
+
invalid("JPEG has an invalid scan header.");
|
|
40812
|
+
scan2 = true;
|
|
40813
|
+
while (at < bytes.length) {
|
|
40814
|
+
if (bytes[at] !== 255) {
|
|
40815
|
+
at++;
|
|
40816
|
+
continue;
|
|
40817
|
+
}
|
|
40818
|
+
const next = bytes[at + 1];
|
|
40819
|
+
if (next === 0 || next !== void 0 && next >= 208 && next <= 215) {
|
|
40820
|
+
at += 2;
|
|
40821
|
+
continue;
|
|
40822
|
+
}
|
|
40823
|
+
break;
|
|
40824
|
+
}
|
|
40825
|
+
}
|
|
40826
|
+
}
|
|
40827
|
+
return invalid("JPEG has no image terminator.");
|
|
40828
|
+
}
|
|
40829
|
+
function inspectRasterImage(bytes, options2 = {}) {
|
|
40830
|
+
if (!options2 || typeof options2 !== "object" || Array.isArray(options2))
|
|
40831
|
+
throw new RasterImageError("invalid-limit", "Image limits must be an options object.");
|
|
40832
|
+
const limits = { ...RASTER_IMAGE_LIMITS, ...options2 };
|
|
40833
|
+
for (const key2 of Object.keys(RASTER_IMAGE_LIMITS)) {
|
|
40834
|
+
const value = limits[key2];
|
|
40835
|
+
if (!Number.isSafeInteger(value) || value <= 0 || value > RASTER_IMAGE_LIMITS[key2])
|
|
40836
|
+
throw new RasterImageError("invalid-limit", `Invalid raster image limit: ${key2}.`);
|
|
40837
|
+
}
|
|
40838
|
+
if (!(bytes instanceof Uint8Array)) invalid("Raster image bytes must be a Uint8Array.");
|
|
40839
|
+
if (bytes.byteLength > limits.maxImageBytes)
|
|
40840
|
+
throw new RasterImageError("image-limit", "Raster image bytes exceed the configured limit.");
|
|
40841
|
+
return inspectRasterImageStructure(bytes, limits);
|
|
40842
|
+
}
|
|
40843
|
+
function inspectRasterImageStructure(bytes, limits) {
|
|
40844
|
+
let mimeType, size;
|
|
40845
|
+
if ([137, 80, 78, 71, 13, 10, 26, 10].every((value, index) => bytes[index] === value)) {
|
|
40846
|
+
mimeType = "image/png";
|
|
40847
|
+
size = png(bytes, limits);
|
|
40848
|
+
} else if (["GIF87a", "GIF89a"].includes(ascii(bytes, 0, 6))) {
|
|
40849
|
+
mimeType = "image/gif";
|
|
40850
|
+
size = gif(bytes, limits);
|
|
40851
|
+
} else if (bytes[0] === 255 && bytes[1] === 216) {
|
|
40852
|
+
mimeType = "image/jpeg";
|
|
40853
|
+
size = jpeg(bytes, limits);
|
|
40854
|
+
} else return unsupported2("Foreign data is not a supported PNG, JPEG, or GIF raster image.");
|
|
40855
|
+
return { mimeType, pixelWidth: size[0], pixelHeight: size[1] };
|
|
40856
|
+
}
|
|
40857
|
+
|
|
40858
|
+
// chart/region-map/value-color-positions.ts
|
|
40859
|
+
function schemaPosition(node, end) {
|
|
40860
|
+
for (const kind of ["number", "percent"]) {
|
|
40861
|
+
const element2 = first(node, kind, NS.cx), raw2 = element2?.getAttribute("val");
|
|
40862
|
+
const value = raw2 === null || raw2 === void 0 || raw2 === "" ? NaN : Number(raw2);
|
|
40863
|
+
if (Number.isFinite(value)) return { kind, value };
|
|
40864
|
+
}
|
|
40865
|
+
return end === "mid" ? { kind: "percent", value: 50 } : { kind: end };
|
|
40866
|
+
}
|
|
40867
|
+
function parseRegionValueColorPositions(xml) {
|
|
40868
|
+
if (!xml) return void 0;
|
|
40869
|
+
const root = parseXml(`<cx:root xmlns:cx="${NS.cx}">${xml}</cx:root>`).documentElement;
|
|
40870
|
+
const positions2 = first(root, "valueColorPositions", NS.cx);
|
|
40871
|
+
if (!positions2) return void 0;
|
|
40872
|
+
const count2 = positions2.getAttribute("count");
|
|
40873
|
+
const native = ["min", "mid", "max"].some((key2) => first(positions2, key2, NS.cx));
|
|
40874
|
+
if (native || count2 !== null && children(positions2, "pos", NS.cx).length === 0) {
|
|
40875
|
+
const keys = count2 === "3" || first(positions2, "mid", NS.cx) ? ["min", "mid", "max"] : ["min", "max"];
|
|
40876
|
+
return keys.map((key2) => schemaPosition(first(positions2, key2, NS.cx), key2));
|
|
40877
|
+
}
|
|
40878
|
+
const legacy = children(positions2, "pos", NS.cx).flatMap(
|
|
40879
|
+
(element2) => {
|
|
40880
|
+
const type = element2.getAttribute("type");
|
|
40881
|
+
if (type === "min" || type === "max") return [{ kind: type }];
|
|
40882
|
+
if (type !== "num" && type !== "percent") return [];
|
|
40883
|
+
const raw2 = element2.getAttribute("val"), value = raw2 === null || raw2 === "" ? NaN : Number(raw2);
|
|
40884
|
+
return [
|
|
40885
|
+
{ kind: type === "num" ? "number" : type, ...Number.isFinite(value) ? { value } : {} }
|
|
40886
|
+
];
|
|
40887
|
+
}
|
|
40888
|
+
);
|
|
40889
|
+
return legacy.length ? legacy : void 0;
|
|
40890
|
+
}
|
|
40891
|
+
|
|
40674
40892
|
// text/wrap-styled-runs.ts
|
|
40675
40893
|
var graphemes = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
40676
40894
|
function wrapStyledRuns(runs, maxWidth, measure, options2 = {}) {
|
|
@@ -41476,10 +41694,10 @@ function holders(draft, target, create2 = false) {
|
|
|
41476
41694
|
throw new RangeError("This chart target has no text");
|
|
41477
41695
|
}
|
|
41478
41696
|
}
|
|
41479
|
-
function
|
|
41697
|
+
function descendants2(root, names) {
|
|
41480
41698
|
return elements(root).flatMap((node) => [
|
|
41481
41699
|
...node.namespaceURI === NS.a && names.includes(node.localName) ? [node] : [],
|
|
41482
|
-
...
|
|
41700
|
+
...descendants2(node, names)
|
|
41483
41701
|
]);
|
|
41484
41702
|
}
|
|
41485
41703
|
function chartTextBodyElement(body) {
|
|
@@ -41611,7 +41829,7 @@ function editChartTextBody(body, edit) {
|
|
|
41611
41829
|
String(typeof value === "number" ? Math.round(value * 6e4) : value)
|
|
41612
41830
|
);
|
|
41613
41831
|
}
|
|
41614
|
-
const runs =
|
|
41832
|
+
const runs = descendants2(root, ["defRPr", "rPr", "endParaRPr"]);
|
|
41615
41833
|
if (!runs.length) {
|
|
41616
41834
|
let paragraph2 = first(root, "p", NS.a);
|
|
41617
41835
|
if (!paragraph2) {
|
|
@@ -41821,22 +42039,22 @@ function patchRange(labels2, range, show) {
|
|
|
41821
42039
|
for (const child17 of elements(ext))
|
|
41822
42040
|
if (child17.namespaceURI === C15 && ["datalabelsRange", "showDataLabelsRange"].includes(child17.localName))
|
|
41823
42041
|
ext.removeChild(child17);
|
|
41824
|
-
const
|
|
42042
|
+
const add2 = (parent, ns, name, text) => {
|
|
41825
42043
|
const node = root.ownerDocument.createElementNS(ns, name);
|
|
41826
42044
|
if (text !== void 0) node.textContent = text;
|
|
41827
42045
|
parent.appendChild(node);
|
|
41828
42046
|
return node;
|
|
41829
42047
|
};
|
|
41830
42048
|
if (range) {
|
|
41831
|
-
|
|
41832
|
-
const node =
|
|
41833
|
-
|
|
41834
|
-
const cache =
|
|
41835
|
-
|
|
42049
|
+
add2(ext, C15, "c15:showDataLabelsRange").setAttribute("val", show ? "1" : "0");
|
|
42050
|
+
const node = add2(ext, C15, "c15:datalabelsRange");
|
|
42051
|
+
add2(node, C15, "c15:f", range.formula);
|
|
42052
|
+
const cache = add2(node, C15, "c15:dlblRangeCache");
|
|
42053
|
+
add2(cache, NS.c, "c:ptCount").setAttribute("val", String(range.cache.length));
|
|
41836
42054
|
range.cache.forEach((text, index) => {
|
|
41837
|
-
const pt2 =
|
|
42055
|
+
const pt2 = add2(cache, NS.c, "c:pt");
|
|
41838
42056
|
pt2.setAttribute("idx", String(index));
|
|
41839
|
-
|
|
42057
|
+
add2(pt2, NS.c, "c:v", text);
|
|
41840
42058
|
});
|
|
41841
42059
|
}
|
|
41842
42060
|
if (!elements(ext).length) root.removeChild(ext);
|
|
@@ -46497,6 +46715,7 @@ function dimension(data, kind, type) {
|
|
|
46497
46715
|
if (d.kind === kind) map.set(d.type?.trim() || (kind === "numDim" ? "val" : "cat"), d);
|
|
46498
46716
|
return map.get(type) ?? map.values().next().value;
|
|
46499
46717
|
}
|
|
46718
|
+
var exactDimension = (data, kind, type) => data?.dimensions.find((d) => d.kind === kind && d.type?.trim() === type);
|
|
46500
46719
|
var levelText = (dimension2) => dimension2?.levels.map((level) => level.points.map((point) => point.value.trim()));
|
|
46501
46720
|
function flags(visibility) {
|
|
46502
46721
|
return {
|
|
@@ -46518,6 +46737,32 @@ function chartExFromNeutral(space, styled) {
|
|
|
46518
46737
|
const values = levelText(dimension(dataOf2(index), "numDim", "val"))?.[0]?.map((value) => Number.parseFloat(value)).filter(Number.isFinite);
|
|
46519
46738
|
result.name = source.tx?.value?.trim() || `Series ${index + 1}`;
|
|
46520
46739
|
result.values = values?.length ? values : [0];
|
|
46740
|
+
if (source.layoutId === "regionMap") {
|
|
46741
|
+
const dim = exactDimension(dataOf2(index), "numDim", "colorVal")?.levels[0];
|
|
46742
|
+
if (dim) {
|
|
46743
|
+
result.values = dim.points.map((p) => Number.parseFloat(p.value));
|
|
46744
|
+
result.regionMapOptions = {
|
|
46745
|
+
...result.regionMapOptions,
|
|
46746
|
+
valueSourceIndices: dim.points.map((p, i) => p.index ?? i)
|
|
46747
|
+
};
|
|
46748
|
+
}
|
|
46749
|
+
for (const [type, key2] of [
|
|
46750
|
+
["cat", "categorySourceIndices"],
|
|
46751
|
+
["entityId", "entityIdSourceIndices"]
|
|
46752
|
+
]) {
|
|
46753
|
+
const points7 = exactDimension(dataOf2(index), "strDim", type)?.levels[0]?.points;
|
|
46754
|
+
if (points7)
|
|
46755
|
+
result.regionMapOptions = {
|
|
46756
|
+
...result.regionMapOptions,
|
|
46757
|
+
[key2]: points7.map((p, i) => p.index ?? i)
|
|
46758
|
+
};
|
|
46759
|
+
}
|
|
46760
|
+
const positions2 = parseRegionValueColorPositions(source.valueColorPositionsXml);
|
|
46761
|
+
if (positions2)
|
|
46762
|
+
result.regionMapOptions = { ...result.regionMapOptions, valueColorPositions: positions2 };
|
|
46763
|
+
if (source.spPr?.fill?.kind === "solid" && result.color)
|
|
46764
|
+
result.regionMapOptions = { ...result.regionMapOptions, fixedColor: result.color };
|
|
46765
|
+
}
|
|
46521
46766
|
for (const key2 of [
|
|
46522
46767
|
"histogramOptions",
|
|
46523
46768
|
"waterfallOptions",
|
|
@@ -46526,6 +46771,11 @@ function chartExFromNeutral(space, styled) {
|
|
|
46526
46771
|
])
|
|
46527
46772
|
delete result[key2];
|
|
46528
46773
|
Object.assign(result, chartExFamilyFields(source));
|
|
46774
|
+
if (source.layoutId === "regionMap" && source.layoutProperties?.geography?.geoCacheXml)
|
|
46775
|
+
result.regionMapOptions = {
|
|
46776
|
+
...result.regionMapOptions,
|
|
46777
|
+
geographyCacheXml: source.layoutProperties.geography.geoCacheXml
|
|
46778
|
+
};
|
|
46529
46779
|
const group = source.dataLabels;
|
|
46530
46780
|
if (!group) {
|
|
46531
46781
|
delete result.dataLabels;
|
|
@@ -46616,12 +46866,18 @@ function chartExFromNeutral(space, styled) {
|
|
|
46616
46866
|
});
|
|
46617
46867
|
const title = chartExText(space.title?.tx);
|
|
46618
46868
|
const chartData = { ...styled.chartData };
|
|
46869
|
+
if (space.plotArea.series[0]?.layoutId === "funnel") {
|
|
46870
|
+
const category = space.plotArea.axes.find((axis) => axis.scaling?.kind === "cat")?.scaling;
|
|
46871
|
+
if (category?.kind === "cat" && typeof category.gapWidth === "number")
|
|
46872
|
+
chartData.funnelGapWidth = category.gapWidth;
|
|
46873
|
+
else delete chartData.funnelGapWidth;
|
|
46874
|
+
}
|
|
46619
46875
|
if (axes.length) chartData.axes = axes;
|
|
46620
46876
|
else delete chartData.axes;
|
|
46621
46877
|
if (title) chartData.title = title;
|
|
46622
46878
|
else delete chartData.title;
|
|
46623
46879
|
return {
|
|
46624
|
-
categories: (levels?.[0] ?? []).filter(Boolean),
|
|
46880
|
+
categories: space.plotArea.series[0]?.layoutId === "regionMap" ? levels?.[0] ?? [] : (levels?.[0] ?? []).filter(Boolean),
|
|
46625
46881
|
categoryLevels: levels,
|
|
46626
46882
|
series,
|
|
46627
46883
|
hasDataLabels: space.plotArea.series.some((series2) => {
|
|
@@ -50863,7 +51119,7 @@ var NS2 = 'xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main"
|
|
|
50863
51119
|
var MODEL3D_URI = "http://schemas.microsoft.com/office/drawing/2017/model3d";
|
|
50864
51120
|
var MODEL3D_REL = "http://schemas.microsoft.com/office/2017/06/relationships/model3d";
|
|
50865
51121
|
var IMAGE_REL = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";
|
|
50866
|
-
function
|
|
51122
|
+
function escapeAttr(value) {
|
|
50867
51123
|
return value.replace(/&/gu, "&").replace(/"/gu, """).replace(/</gu, "<");
|
|
50868
51124
|
}
|
|
50869
51125
|
function modelBody(cx, cy, hasPoster) {
|
|
@@ -50894,7 +51150,7 @@ function buildModel3dMetroInput(element2, glbBytes) {
|
|
|
50894
51150
|
const cx = Math.max(1, Math.round(rect.w));
|
|
50895
51151
|
const cy = Math.max(1, Math.round(rect.h));
|
|
50896
51152
|
const id = element2.shapeId && /^\d+$/u.test(element2.shapeId) ? element2.shapeId : "2";
|
|
50897
|
-
const name =
|
|
51153
|
+
const name = escapeAttr(element2.name ?? "3D Model");
|
|
50898
51154
|
const rootXml = `<p:E2oFrame ${NS2}><p:nvGraphicFramePr><p:cNvPr id="${id}" name="${name}"/><p:cNvGraphicFramePr/><p:nvPr/></p:nvGraphicFramePr><p:xfrm><a:off x="${Math.round(rect.x)}" y="${Math.round(rect.y)}"/><a:ext cx="${cx}" cy="${cy}"/></p:xfrm><a:graphic><a:graphicData uri="${MODEL3D_URI}"><am3d:model3d r:embed="rId1">${modelBody(cx, cy, Boolean(posterExt))}</am3d:model3d></a:graphicData></a:graphic></p:E2oFrame>`;
|
|
50899
51155
|
const parts = /* @__PURE__ */ new Map([["drs/media/model3d1.glb", glb]]);
|
|
50900
51156
|
const contentTypes2 = /* @__PURE__ */ new Map([["drs/media/model3d1.glb", "model/gltf-binary"]]);
|
|
@@ -50931,12 +51187,12 @@ var DOWNREV = {
|
|
|
50931
51187
|
contentType: "application/vnd.ms-office.DrsDownRev+xml",
|
|
50932
51188
|
relType: "http://schemas.microsoft.com/office/2006/relationships/downRev"
|
|
50933
51189
|
};
|
|
50934
|
-
function
|
|
51190
|
+
function escapeAttr2(value) {
|
|
50935
51191
|
return value.replace(/&/gu, "&").replace(/"/gu, """).replace(/</gu, "<").replace(/>/gu, ">");
|
|
50936
51192
|
}
|
|
50937
51193
|
function buildRelsXml(rels) {
|
|
50938
51194
|
const body = rels.map(
|
|
50939
|
-
(r) => `<Relationship Id="${
|
|
51195
|
+
(r) => `<Relationship Id="${escapeAttr2(r.id)}" Type="${escapeAttr2(r.type)}" Target="${escapeAttr2(
|
|
50940
51196
|
r.target
|
|
50941
51197
|
)}"${r.external ? ' TargetMode="External"' : ""}/>`
|
|
50942
51198
|
).join("");
|
|
@@ -50948,7 +51204,7 @@ function buildDownRevXml(shapeId) {
|
|
|
50948
51204
|
}
|
|
50949
51205
|
function buildContentTypesXml(overrides) {
|
|
50950
51206
|
const body = [...overrides].map(
|
|
50951
|
-
([path3, type]) => `<Override PartName="/${
|
|
51207
|
+
([path3, type]) => `<Override PartName="/${escapeAttr2(path3)}" ContentType="${escapeAttr2(type)}"/>`
|
|
50952
51208
|
).join("");
|
|
50953
51209
|
return `${XML_DECL}<Types xmlns="${CT_NS}"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/>${body}</Types>`;
|
|
50954
51210
|
}
|
|
@@ -53788,8 +54044,8 @@ function readTxStyles(masterXml) {
|
|
|
53788
54044
|
const declarations = [...root.matchAll(/\s(xmlns(?::\w+)?)="[^"]*"/gu)].filter((m) => !startTag.includes(` ${m[1]}=`)).map((m) => m[0]);
|
|
53789
54045
|
return txStyles.replace(/^<p:txStyles\b/u, `<p:txStyles${declarations.join("")}`);
|
|
53790
54046
|
}
|
|
53791
|
-
function themeColor(themeXml3,
|
|
53792
|
-
const body = new RegExp(`<a:${
|
|
54047
|
+
function themeColor(themeXml3, slot2) {
|
|
54048
|
+
const body = new RegExp(`<a:${slot2}>([\\s\\S]*?)</a:${slot2}>`, "u").exec(themeXml3)?.[1];
|
|
53793
54049
|
if (!body) {
|
|
53794
54050
|
return void 0;
|
|
53795
54051
|
}
|
|
@@ -53807,7 +54063,7 @@ function schemeColorsFor(themeXml3, clrMapAttributes) {
|
|
|
53807
54063
|
"hlink",
|
|
53808
54064
|
"folHlink"
|
|
53809
54065
|
];
|
|
53810
|
-
const colors = slots.map((
|
|
54066
|
+
const colors = slots.map((slot2) => themeColor(themeXml3, slot2)?.toUpperCase());
|
|
53811
54067
|
return colors.every((c) => c !== void 0) ? colors : void 0;
|
|
53812
54068
|
}
|
|
53813
54069
|
function latinFace(themeXml3, scheme) {
|
|
@@ -53978,18 +54234,18 @@ async function rasterizeSvgInDom(svg, fallbackW, fallbackH) {
|
|
|
53978
54234
|
}
|
|
53979
54235
|
}
|
|
53980
54236
|
async function rasterizeSvg(svg, fallbackWidthPx, fallbackHeightPx, rasterize) {
|
|
53981
|
-
let
|
|
54237
|
+
let png2;
|
|
53982
54238
|
if (rasterize) {
|
|
53983
54239
|
const sizeFor = (w, h) => svgRasterSize(w, h, fallbackWidthPx, fallbackHeightPx);
|
|
53984
54240
|
try {
|
|
53985
|
-
|
|
54241
|
+
png2 = await rasterize(svg, sizeFor);
|
|
53986
54242
|
} catch {
|
|
53987
|
-
|
|
54243
|
+
png2 = void 0;
|
|
53988
54244
|
}
|
|
53989
54245
|
} else if (hasDomRasteriser()) {
|
|
53990
|
-
|
|
54246
|
+
png2 = await rasterizeSvgInDom(svg, fallbackWidthPx, fallbackHeightPx);
|
|
53991
54247
|
}
|
|
53992
|
-
return
|
|
54248
|
+
return png2 ? { extension: "png", bytes: png2 } : void 0;
|
|
53993
54249
|
}
|
|
53994
54250
|
|
|
53995
54251
|
// pptx/core/ppt/writer/picture-resolve.ts
|
|
@@ -61639,31 +61895,6 @@ function blipExtensionEntries(blip) {
|
|
|
61639
61895
|
}
|
|
61640
61896
|
|
|
61641
61897
|
// pptx/core/core/runtime/image-a14-effects.ts
|
|
61642
|
-
var ARTISTIC_PRIMARY_ATTRIBUTE = {
|
|
61643
|
-
artisticBlur: "radius",
|
|
61644
|
-
artisticCement: "crackSpacing",
|
|
61645
|
-
artisticChalkSketch: "pressure",
|
|
61646
|
-
artisticCrisscrossEtching: "pressure",
|
|
61647
|
-
artisticCutout: "numberOfShades",
|
|
61648
|
-
artisticFilmGrain: "grainSize",
|
|
61649
|
-
artisticGlass: "scaling",
|
|
61650
|
-
artisticGlowDiffused: "intensity",
|
|
61651
|
-
artisticGlowEdges: "smoothness",
|
|
61652
|
-
artisticLightScreen: "gridSize",
|
|
61653
|
-
artisticLineDrawing: "pencilSize",
|
|
61654
|
-
artisticMarker: "size",
|
|
61655
|
-
// Spelled "Mosiaic" in the schema; Microsoft's typo is part of the format.
|
|
61656
|
-
artisticMosiaicBubbles: "pressure",
|
|
61657
|
-
artisticPaintBrush: "brushSize",
|
|
61658
|
-
artisticPaintStrokes: "intensity",
|
|
61659
|
-
artisticPastelsSmooth: "scaling",
|
|
61660
|
-
artisticPencilGrayscale: "pencilSize",
|
|
61661
|
-
artisticPencilSketch: "pressure",
|
|
61662
|
-
artisticPhotocopy: "detail",
|
|
61663
|
-
artisticPlasticWrap: "smoothness",
|
|
61664
|
-
artisticTexturizer: "scaling",
|
|
61665
|
-
artisticWatercolorSponge: "brushSize"
|
|
61666
|
-
};
|
|
61667
61898
|
var NON_SIZE_ATTRIBUTES = /* @__PURE__ */ new Set(["trans", "visible"]);
|
|
61668
61899
|
function parseMarks(parent, name) {
|
|
61669
61900
|
const marks = [];
|
|
@@ -70220,7 +70451,7 @@ var PptxHandlerRuntime21 = class extends PptxHandlerRuntime20 {
|
|
|
70220
70451
|
*/
|
|
70221
70452
|
findMasterSlotForLayoutSlot(masterSlots, layoutPhInfo) {
|
|
70222
70453
|
if (layoutPhInfo.idx !== void 0) {
|
|
70223
|
-
const byIdx = masterSlots.find((
|
|
70454
|
+
const byIdx = masterSlots.find((slot2) => slot2.phInfo.idx === layoutPhInfo.idx);
|
|
70224
70455
|
if (byIdx) {
|
|
70225
70456
|
return byIdx;
|
|
70226
70457
|
}
|
|
@@ -70230,7 +70461,7 @@ var PptxHandlerRuntime21 = class extends PptxHandlerRuntime20 {
|
|
|
70230
70461
|
}
|
|
70231
70462
|
const aliasedType = layoutPhInfo.type === "ctrtitle" ? "title" : layoutPhInfo.type === "subtitle" ? "body" : layoutPhInfo.type;
|
|
70232
70463
|
return masterSlots.find(
|
|
70233
|
-
(
|
|
70464
|
+
(slot2) => slot2.phInfo.type === layoutPhInfo.type || slot2.phInfo.type === aliasedType
|
|
70234
70465
|
);
|
|
70235
70466
|
}
|
|
70236
70467
|
/**
|
|
@@ -70246,7 +70477,7 @@ var PptxHandlerRuntime21 = class extends PptxHandlerRuntime20 {
|
|
|
70246
70477
|
if (slots.length === 0 || !layoutPath) {
|
|
70247
70478
|
return slots;
|
|
70248
70479
|
}
|
|
70249
|
-
const needsMasterGeometry = slots.some((
|
|
70480
|
+
const needsMasterGeometry = slots.some((slot2) => slot2.cxEmu <= 0 || slot2.cyEmu <= 0);
|
|
70250
70481
|
if (!needsMasterGeometry) {
|
|
70251
70482
|
return slots;
|
|
70252
70483
|
}
|
|
@@ -70257,16 +70488,16 @@ var PptxHandlerRuntime21 = class extends PptxHandlerRuntime20 {
|
|
|
70257
70488
|
if (masterSlots.length === 0) {
|
|
70258
70489
|
return slots;
|
|
70259
70490
|
}
|
|
70260
|
-
return slots.map((
|
|
70261
|
-
if (
|
|
70262
|
-
return
|
|
70491
|
+
return slots.map((slot2) => {
|
|
70492
|
+
if (slot2.cxEmu > 0 && slot2.cyEmu > 0) {
|
|
70493
|
+
return slot2;
|
|
70263
70494
|
}
|
|
70264
|
-
const masterSlot = this.findMasterSlotForLayoutSlot(masterSlots,
|
|
70495
|
+
const masterSlot = this.findMasterSlotForLayoutSlot(masterSlots, slot2.phInfo);
|
|
70265
70496
|
if (!masterSlot || masterSlot.cxEmu <= 0 || masterSlot.cyEmu <= 0) {
|
|
70266
|
-
return
|
|
70497
|
+
return slot2;
|
|
70267
70498
|
}
|
|
70268
70499
|
return {
|
|
70269
|
-
...
|
|
70500
|
+
...slot2,
|
|
70270
70501
|
xEmu: masterSlot.xEmu,
|
|
70271
70502
|
yEmu: masterSlot.yEmu,
|
|
70272
70503
|
cxEmu: masterSlot.cxEmu,
|
|
@@ -70290,8 +70521,8 @@ var PptxHandlerRuntime21 = class extends PptxHandlerRuntime20 {
|
|
|
70290
70521
|
* @returns The updated elements array.
|
|
70291
70522
|
*/
|
|
70292
70523
|
remapElementsToNewLayout(elements2, newLayoutXml, newLayoutPath) {
|
|
70293
|
-
const targets = this.extractLayoutPlaceholders(newLayoutXml, newLayoutPath).map((
|
|
70294
|
-
...
|
|
70524
|
+
const targets = this.extractLayoutPlaceholders(newLayoutXml, newLayoutPath).map((slot2) => ({
|
|
70525
|
+
...slot2,
|
|
70295
70526
|
matched: false
|
|
70296
70527
|
}));
|
|
70297
70528
|
const claimOrder = [
|
|
@@ -73807,7 +74038,17 @@ var PptxHandlerRuntime25 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
73807
74038
|
smartArtData.chrome,
|
|
73808
74039
|
(k) => this.compatibilityService.getXmlLocalName(k)
|
|
73809
74040
|
);
|
|
73810
|
-
this.zip.file(
|
|
74041
|
+
this.zip.file(
|
|
74042
|
+
dataPartPath,
|
|
74043
|
+
withDiagramPictureSources(this.builder.build(parsed), smartArtData.pictureLayoutSource)
|
|
74044
|
+
);
|
|
74045
|
+
const pictureDataRelsPath = dataPartPath.replace(/([^/]+)$/, "_rels/$1.rels");
|
|
74046
|
+
const pictureDataRels = diagramPictureRelationships(
|
|
74047
|
+
dataPartPath,
|
|
74048
|
+
smartArtData.pictureLayoutSource,
|
|
74049
|
+
await this.zip.file(pictureDataRelsPath)?.async("string")
|
|
74050
|
+
);
|
|
74051
|
+
if (pictureDataRels) this.zip.file(pictureDataRelsPath, pictureDataRels);
|
|
73811
74052
|
if (saveLayout && smartArtData.layoutRelId) {
|
|
73812
74053
|
const layoutTarget = relationships2?.get(smartArtData.layoutRelId);
|
|
73813
74054
|
if (layoutTarget) {
|
|
@@ -73828,7 +74069,31 @@ var PptxHandlerRuntime25 = class _PptxHandlerRuntime extends PptxHandlerRuntime2
|
|
|
73828
74069
|
presentationIds
|
|
73829
74070
|
);
|
|
73830
74071
|
if (drawingTarget && drawingXml) {
|
|
73831
|
-
this.
|
|
74072
|
+
const drawingPath = this.resolveImagePath(slidePath, drawingTarget);
|
|
74073
|
+
const pictureSource = smartArtData.pictureLayoutSource;
|
|
74074
|
+
const savedData = await this.zip.file(dataPartPath)?.async("string");
|
|
74075
|
+
const pictureCache = pictureSource && savedData ? buildGeneratedDiagramCache(savedData, {
|
|
74076
|
+
extentEmu: { width: element2.width * 9525, height: element2.height * 9525 },
|
|
74077
|
+
source: {
|
|
74078
|
+
...pictureSource,
|
|
74079
|
+
...saveLayout ? { layoutXml: saveLayout.xml } : {}
|
|
74080
|
+
},
|
|
74081
|
+
minorFont: smartArtData.themeMinorFont,
|
|
74082
|
+
scheme: smartArtData.pictureScheme
|
|
74083
|
+
}) : void 0;
|
|
74084
|
+
if (pictureCache)
|
|
74085
|
+
this.zip.file(
|
|
74086
|
+
dataPartPath,
|
|
74087
|
+
withDiagramDrawingRelationship(pictureCache.dataXml, smartArtData.drawingRelId)
|
|
74088
|
+
);
|
|
74089
|
+
this.zip.file(drawingPath, pictureCache?.drawingXml ?? drawingXml);
|
|
74090
|
+
const relsPath2 = drawingPath.replace(/([^/]+)$/, "_rels/$1.rels");
|
|
74091
|
+
const rels = diagramPictureRelationships(
|
|
74092
|
+
drawingPath,
|
|
74093
|
+
pictureSource,
|
|
74094
|
+
await this.zip.file(relsPath2)?.async("string")
|
|
74095
|
+
);
|
|
74096
|
+
if (rels) this.zip.file(relsPath2, rels);
|
|
73832
74097
|
}
|
|
73833
74098
|
}
|
|
73834
74099
|
} catch (e) {
|
|
@@ -78354,7 +78619,7 @@ function pruneEmptyEnvelopes(slideNode, getLocalName2) {
|
|
|
78354
78619
|
function reconcileSlideTransition(options2) {
|
|
78355
78620
|
const { slideNode, transitionNode, sourceNode, getLocalName: getLocalName2 } = options2;
|
|
78356
78621
|
const slots = collectEnvelopeSlots(slideNode, getLocalName2);
|
|
78357
|
-
const target = sourceNode ? slots.find((
|
|
78622
|
+
const target = sourceNode ? slots.find((slot2) => slot2.node === sourceNode) : void 0;
|
|
78358
78623
|
const usage = transitionNode ? extensionUsageOf(transitionNode) : void 0;
|
|
78359
78624
|
const requiresPrefix = usage ? requiresPrefixFor(usage) : void 0;
|
|
78360
78625
|
const reuseTarget = target && (requiresPrefix === void 0 || target.branchLocalName === "Choice") ? target : void 0;
|
|
@@ -78362,9 +78627,9 @@ function reconcileSlideTransition(options2) {
|
|
|
78362
78627
|
delete slideNode[key2];
|
|
78363
78628
|
}
|
|
78364
78629
|
const keptEnvelope = transitionNode ? reuseTarget?.envelope : void 0;
|
|
78365
|
-
for (const
|
|
78366
|
-
if (
|
|
78367
|
-
delete
|
|
78630
|
+
for (const slot2 of slots) {
|
|
78631
|
+
if (slot2.envelope !== keptEnvelope) {
|
|
78632
|
+
delete slot2.branch[slot2.key];
|
|
78368
78633
|
}
|
|
78369
78634
|
}
|
|
78370
78635
|
if (reuseTarget && transitionNode) {
|
|
@@ -79150,25 +79415,25 @@ var PptxHandlerRuntime43 = class extends PptxHandlerRuntime42 {
|
|
|
79150
79415
|
* fix to preserve original color XML and is out of scope here).
|
|
79151
79416
|
*/
|
|
79152
79417
|
buildClrSchemeObject(schemeName, colorMap) {
|
|
79153
|
-
const
|
|
79418
|
+
const slot2 = (key2) => {
|
|
79154
79419
|
const hex3 = String(colorMap[key2] || "").replace(/^#/, "");
|
|
79155
79420
|
const srgb = hex3.length === 6 ? hex3.toUpperCase() : "000000";
|
|
79156
79421
|
return { "a:srgbClr": { "@_val": srgb } };
|
|
79157
79422
|
};
|
|
79158
79423
|
return {
|
|
79159
79424
|
"@_name": schemeName,
|
|
79160
|
-
"a:dk1":
|
|
79161
|
-
"a:lt1":
|
|
79162
|
-
"a:dk2":
|
|
79163
|
-
"a:lt2":
|
|
79164
|
-
"a:accent1":
|
|
79165
|
-
"a:accent2":
|
|
79166
|
-
"a:accent3":
|
|
79167
|
-
"a:accent4":
|
|
79168
|
-
"a:accent5":
|
|
79169
|
-
"a:accent6":
|
|
79170
|
-
"a:hlink":
|
|
79171
|
-
"a:folHlink":
|
|
79425
|
+
"a:dk1": slot2("dk1"),
|
|
79426
|
+
"a:lt1": slot2("lt1"),
|
|
79427
|
+
"a:dk2": slot2("dk2"),
|
|
79428
|
+
"a:lt2": slot2("lt2"),
|
|
79429
|
+
"a:accent1": slot2("accent1"),
|
|
79430
|
+
"a:accent2": slot2("accent2"),
|
|
79431
|
+
"a:accent3": slot2("accent3"),
|
|
79432
|
+
"a:accent4": slot2("accent4"),
|
|
79433
|
+
"a:accent5": slot2("accent5"),
|
|
79434
|
+
"a:accent6": slot2("accent6"),
|
|
79435
|
+
"a:hlink": slot2("hlink"),
|
|
79436
|
+
"a:folHlink": slot2("folHlink")
|
|
79172
79437
|
};
|
|
79173
79438
|
}
|
|
79174
79439
|
/**
|
|
@@ -90216,6 +90481,14 @@ async function parseDrawingShapesFromPart(drawingPath, deps) {
|
|
|
90216
90481
|
shapes.push(shape2);
|
|
90217
90482
|
});
|
|
90218
90483
|
await resolveDrawingBlipFills(shapes, drawingPath, deps);
|
|
90484
|
+
try {
|
|
90485
|
+
const source = parseDiagramDrawing(xmlString);
|
|
90486
|
+
for (const shape2 of shapes) {
|
|
90487
|
+
const fill3 = source.shapes.find((entry2) => entry2.modelId === shape2.id)?.fill;
|
|
90488
|
+
if (fill3?.kind === "picture") shape2.pictureFill = fill3;
|
|
90489
|
+
}
|
|
90490
|
+
} catch {
|
|
90491
|
+
}
|
|
90219
90492
|
return shapes;
|
|
90220
90493
|
} catch {
|
|
90221
90494
|
return [];
|
|
@@ -90358,7 +90631,44 @@ var PptxHandlerRuntime91 = class _PptxHandlerRuntime extends PptxHandlerRuntime9
|
|
|
90358
90631
|
const drawingRelationshipId = drawingResolution?.relId;
|
|
90359
90632
|
const styleRelationshipId = parsedRelationshipIds?.styleRelId ?? "";
|
|
90360
90633
|
const quickStyle = await this.parseSmartArtQuickStyle(slidePath, styleRelationshipId);
|
|
90634
|
+
const neutral = await loadDiagram(slidePath, parsedRelationshipIds ?? {}, {
|
|
90635
|
+
hostRelationships: (path3) => this.slideRelsMap.get(path3),
|
|
90636
|
+
resolvePath: (base, target) => this.resolveImagePath(base, target),
|
|
90637
|
+
readText: (path3) => this.zip.file(path3)?.async("string") ?? Promise.resolve(void 0),
|
|
90638
|
+
readRelationshipEntries: async (path3) => {
|
|
90639
|
+
const xml = await this.zip.file(path3)?.async("string");
|
|
90640
|
+
return xml ? [...parseRelationships(xml).values()] : void 0;
|
|
90641
|
+
}
|
|
90642
|
+
});
|
|
90643
|
+
const pictureLayoutSource = neutral.layoutSource?.pictures?.length ? neutral.layoutSource : void 0;
|
|
90644
|
+
const pictureUrls = {};
|
|
90645
|
+
const pictureSizes = {};
|
|
90646
|
+
for (const part of Object.values(pictureLayoutSource?.pictureParts ?? {})) {
|
|
90647
|
+
const url = await this.getImageDataAsDataUrl(part);
|
|
90648
|
+
if (url) pictureUrls[part] = url;
|
|
90649
|
+
const payload = url ? /^data:[^,]*;base64,(.*)$/s.exec(url)?.[1] : void 0;
|
|
90650
|
+
const bytes = payload ? decodeBase64(payload) : void 0;
|
|
90651
|
+
if (bytes) {
|
|
90652
|
+
try {
|
|
90653
|
+
const info = inspectRasterImage(bytes);
|
|
90654
|
+
pictureSizes[part] = { width: info.pixelWidth, height: info.pixelHeight };
|
|
90655
|
+
} catch {
|
|
90656
|
+
}
|
|
90657
|
+
}
|
|
90658
|
+
}
|
|
90659
|
+
for (const shape2 of drawingShapes) {
|
|
90660
|
+
const part = shape2.fillBlipEmbedId ? neutral.drawing?.pictureParts?.[shape2.fillBlipEmbedId] : void 0;
|
|
90661
|
+
if (part && pictureUrls[part]) shape2.fillImageUrl = pictureUrls[part];
|
|
90662
|
+
if (part && pictureSizes[part]) {
|
|
90663
|
+
shape2.fillImageWidth = pictureSizes[part].width;
|
|
90664
|
+
shape2.fillImageHeight = pictureSizes[part].height;
|
|
90665
|
+
}
|
|
90666
|
+
}
|
|
90361
90667
|
return {
|
|
90668
|
+
pictureLayoutSource,
|
|
90669
|
+
pictureUrls: pictureLayoutSource ? pictureUrls : void 0,
|
|
90670
|
+
pictureScheme: pictureLayoutSource ? { ...this.themeColorMap } : void 0,
|
|
90671
|
+
pictureSizes: pictureLayoutSource ? pictureSizes : void 0,
|
|
90362
90672
|
layoutType,
|
|
90363
90673
|
resolvedLayoutType,
|
|
90364
90674
|
layoutDefinition,
|
|
@@ -93393,7 +93703,7 @@ var PptxHandlerRuntime104 = class extends PptxHandlerRuntime103 {
|
|
|
93393
93703
|
}
|
|
93394
93704
|
root["p:cSld"] = withLeadingBackground(root["p:cSld"] ?? {}, bg);
|
|
93395
93705
|
root["p:clrMap"] = Object.fromEntries(
|
|
93396
|
-
Object.entries(clrMap).map(([alias,
|
|
93706
|
+
Object.entries(clrMap).map(([alias, slot2]) => [`@_${alias}`, slot2])
|
|
93397
93707
|
);
|
|
93398
93708
|
this.masterClrMaps.set(masterPath, { ...clrMap });
|
|
93399
93709
|
this.masterStyleOverrides.set(masterPath, { bg, clrMap: { ...clrMap } });
|
|
@@ -93427,12 +93737,12 @@ function selectTextPlaceholder(input, type, options2, slots) {
|
|
|
93427
93737
|
};
|
|
93428
93738
|
let best;
|
|
93429
93739
|
let bestScore = 0;
|
|
93430
|
-
for (const
|
|
93431
|
-
if (!TEXT_PLACEHOLDER_TYPES.has(
|
|
93432
|
-
if (source.idx !== void 0 && source.idx !== (
|
|
93433
|
-
const score = scorePlaceholderMatch(input, source,
|
|
93740
|
+
for (const slot2 of slots) {
|
|
93741
|
+
if (!TEXT_PLACEHOLDER_TYPES.has(slot2.phInfo.type ?? "obj")) continue;
|
|
93742
|
+
if (source.idx !== void 0 && source.idx !== (slot2.phInfo.idx ?? "0")) continue;
|
|
93743
|
+
const score = scorePlaceholderMatch(input, source, slot2.phInfo);
|
|
93434
93744
|
if (score > bestScore) {
|
|
93435
|
-
best =
|
|
93745
|
+
best = slot2;
|
|
93436
93746
|
bestScore = score;
|
|
93437
93747
|
}
|
|
93438
93748
|
}
|
|
@@ -94953,7 +95263,7 @@ var OPT2 = {
|
|
|
94953
95263
|
fNoLineDrawDash: 511,
|
|
94954
95264
|
wzName: 896
|
|
94955
95265
|
};
|
|
94956
|
-
function
|
|
95266
|
+
function parseProperties(view, data, rec) {
|
|
94957
95267
|
const values = /* @__PURE__ */ new Map();
|
|
94958
95268
|
const complex = /* @__PURE__ */ new Map();
|
|
94959
95269
|
const count2 = rec.recInstance;
|
|
@@ -95160,7 +95470,7 @@ function parseShape(ctx, container) {
|
|
|
95160
95470
|
return void 0;
|
|
95161
95471
|
}
|
|
95162
95472
|
const optRec = findChild2(ctx.view, container, OA.FOPT);
|
|
95163
|
-
const props = optRec ?
|
|
95473
|
+
const props = optRec ? parseProperties(ctx.view, ctx.data, optRec) : { values: /* @__PURE__ */ new Map(), complex: /* @__PURE__ */ new Map() };
|
|
95164
95474
|
const anchorRec = findChild2(ctx.view, container, OA.ClientAnchor);
|
|
95165
95475
|
const childAnchorRec = findChild2(ctx.view, container, OA.ChildAnchor);
|
|
95166
95476
|
const anchor = anchorRec ? readClientAnchor(ctx.view, anchorRec) : childAnchorRec ? readChildAnchor(ctx.view, childAnchorRec) : void 0;
|
|
@@ -95323,7 +95633,7 @@ function extractBackground(ctx, container) {
|
|
|
95323
95633
|
if (!optRec) {
|
|
95324
95634
|
return ctx.scheme[0];
|
|
95325
95635
|
}
|
|
95326
|
-
const props =
|
|
95636
|
+
const props = parseProperties(ctx.view, ctx.data, optRec);
|
|
95327
95637
|
const fillColor = props.values.get(OPT2.fillColor);
|
|
95328
95638
|
return fillColor !== void 0 ? resolveEscherColor(fillColor, ctx.scheme) : ctx.scheme[0];
|
|
95329
95639
|
}
|