@shbernal/ts-pptx 3.3.0 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/{autopage-D1sqK6j7.js → autopage-BYlTzX-l.js} +8 -5
  2. package/dist/autopage-BYlTzX-l.js.map +1 -0
  3. package/dist/browser.d.ts +5 -5
  4. package/dist/browser.js +11 -11
  5. package/dist/browser.js.map +1 -1
  6. package/dist/{diagnostics-B2yWpcjB.d.ts → diagnostics-BDuR8UkG.d.ts} +39 -7
  7. package/dist/diagnostics-BDuR8UkG.d.ts.map +1 -0
  8. package/dist/{diagnostics-H1QzgRSw.js → diagnostics-CPVADSL1.js} +29 -3
  9. package/dist/{diagnostics-H1QzgRSw.js.map → diagnostics-CPVADSL1.js.map} +1 -1
  10. package/dist/{errors-fB1KDJKQ.d.ts → errors-CgnueTYL.d.ts} +3 -3
  11. package/dist/{errors-fB1KDJKQ.d.ts.map → errors-CgnueTYL.d.ts.map} +1 -1
  12. package/dist/{fit-CYJ1jkQI.js → fit-TjpNbMru.js} +3 -3
  13. package/dist/{fit-CYJ1jkQI.js.map → fit-TjpNbMru.js.map} +1 -1
  14. package/dist/{html-dom-CzewEdE1.js → html-dom-yUSdCExA.js} +5 -5
  15. package/dist/html-dom-yUSdCExA.js.map +1 -0
  16. package/dist/html.d.ts +3 -3
  17. package/dist/html.js +1 -1
  18. package/dist/index.d.ts +5 -5
  19. package/dist/index.js +16 -33
  20. package/dist/index.js.map +1 -1
  21. package/dist/inspect.d.ts +28 -4
  22. package/dist/inspect.d.ts.map +1 -1
  23. package/dist/inspect.js +43 -10
  24. package/dist/inspect.js.map +1 -1
  25. package/dist/math.d.ts +1 -1
  26. package/dist/measure.d.ts +2 -2
  27. package/dist/measure.js +1 -1
  28. package/dist/{st-enums-bVnezkMJ.js → namespaces-CcKuzeuE.js} +291 -200
  29. package/dist/namespaces-CcKuzeuE.js.map +1 -0
  30. package/dist/node.d.ts +5 -5
  31. package/dist/node.js +7 -19
  32. package/dist/node.js.map +1 -1
  33. package/dist/{notes-SCvpJz0l.js → notes-DNqAggXx.js} +221 -140
  34. package/dist/notes-DNqAggXx.js.map +1 -0
  35. package/dist/{pres-Cb-1xDne.d.ts → pres-Dybf7ZUl.d.ts} +2 -2
  36. package/dist/{pres-Cb-1xDne.d.ts.map → pres-Dybf7ZUl.d.ts.map} +1 -1
  37. package/dist/{presentation-DeKTJGHf.js → presentation-VfJ_FT7E.js} +306 -234
  38. package/dist/presentation-VfJ_FT7E.js.map +1 -0
  39. package/dist/{presentation-types-B50aOUFI.d.ts → presentation-types-CpkTx9Xa.d.ts} +352 -16
  40. package/dist/presentation-types-CpkTx9Xa.d.ts.map +1 -0
  41. package/dist/read.d.ts +4 -4
  42. package/dist/read.js +3 -3
  43. package/dist/script.d.ts +2 -2
  44. package/dist/script.d.ts.map +1 -1
  45. package/dist/script.js +128 -63
  46. package/dist/script.js.map +1 -1
  47. package/dist/{shapes-BXVgsk0F.js → shapes-Kt51vry6.js} +717 -54
  48. package/dist/shapes-Kt51vry6.js.map +1 -0
  49. package/dist/{slide-DWw9UoI6.d.ts → slide-B_aInw3N.d.ts} +208 -180
  50. package/dist/slide-B_aInw3N.d.ts.map +1 -0
  51. package/dist/{text-uM-zGton.js → text-D04NUMvA.js} +3563 -3437
  52. package/dist/text-D04NUMvA.js.map +1 -0
  53. package/dist/{units-internal-CGf4VrXy.js → units-internal-DNvK2I6o.js} +54 -34
  54. package/dist/{units-internal-CGf4VrXy.js.map → units-internal-DNvK2I6o.js.map} +1 -1
  55. package/dist/zip.d.ts +1 -1
  56. package/package.json +4 -4
  57. package/dist/autopage-D1sqK6j7.js.map +0 -1
  58. package/dist/diagnostics-B2yWpcjB.d.ts.map +0 -1
  59. package/dist/html-dom-CzewEdE1.js.map +0 -1
  60. package/dist/notes-SCvpJz0l.js.map +0 -1
  61. package/dist/presentation-DeKTJGHf.js.map +0 -1
  62. package/dist/presentation-types-B50aOUFI.d.ts.map +0 -1
  63. package/dist/shapes-BXVgsk0F.js.map +0 -1
  64. package/dist/slide-DWw9UoI6.d.ts.map +0 -1
  65. package/dist/st-enums-bVnezkMJ.js.map +0 -1
  66. package/dist/text-uM-zGton.js.map +0 -1
@@ -1,5 +1,209 @@
1
- import { r as warnOnce } from "./diagnostics-H1QzgRSw.js";
1
+ import { i as warnOnce } from "./diagnostics-CPVADSL1.js";
2
2
  import { n as InvalidOptionError } from "./errors-Bvln0H-7.js";
3
+ //#region src/ooxml/check-enum.ts
4
+ /**
5
+ * Check a value against its `ST_` union, reporting and dropping it when outside (the write-path
6
+ * policy — see the module note).
7
+ *
8
+ * `undefined`/`null` returns `null` without reporting: an unset option is not an invalid one, and
9
+ * it is by far the common case.
10
+ *
11
+ * The offending value is interpolated into the message deliberately. {@link warnOnce} dedups on
12
+ * code **and** message, so keeping the value in the text is what lets a second, *different* bad
13
+ * value under the same code still get reported.
14
+ * @param value - the value the caller supplied, if any
15
+ * @param valid - the enum's members
16
+ * @param code - the condition to report
17
+ * @param label - how to name the offending option in the message, e.g. ``'table cell: cell3D `preset`'``
18
+ * @param detail - extra structured context to merge into the diagnostic's `detail`
19
+ * @returns the value when legal, else `null`
20
+ */
21
+ function checkEnumOrWarn(value, valid, code, label, detail) {
22
+ if (value === void 0 || value === null) return null;
23
+ if (valid.includes(value)) return value;
24
+ warnOnce(code, `${label} value \`${String(value)}\` is not valid and is ignored — use one of ${valid.join(", ")}.`, {
25
+ received: value,
26
+ valid,
27
+ ...detail
28
+ });
29
+ return null;
30
+ }
31
+ /**
32
+ * Check a value against its `ST_` union, throwing when outside (the read/edit-path policy — see
33
+ * the module note).
34
+ * @param value - the value the caller asked for
35
+ * @param valid - the enum's members
36
+ * @param attribute - the attribute's name, for the message
37
+ * @param code - the condition to report
38
+ * @returns `value`, when it is legal
39
+ */
40
+ function checkEnumOrThrow(value, valid, attribute, code) {
41
+ if (valid.includes(value)) return value;
42
+ throw new InvalidOptionError(code, `Invalid ${attribute}: ${JSON.stringify(value)}. Expected one of: ${valid.join(", ")}.`);
43
+ }
44
+ //#endregion
45
+ //#region src/ooxml/st-enums.ts
46
+ /**
47
+ * `ST_` simple-type enumerations from ECMA-376, declared once as the single source of both the
48
+ * TypeScript union a caller is checked against and the runtime list a value is validated against.
49
+ *
50
+ * **The problem this solves.** Each of these used to exist twice: a hand-written string union in
51
+ * `src/types/` (what the compiler enforces) and a hand-written array in `src/gen/` or `src/read/`
52
+ * (what the validator checks at run time). Nothing tied the two together, so adding a member to
53
+ * one and not the other produced either a value TypeScript accepts and the validator drops, or a
54
+ * value the validator passes and the type rejects. Two of them had already diverged in *order*,
55
+ * which is harmless, but nothing would have caught a divergence in *content*.
56
+ *
57
+ * **The shape.** Every entry is a `readonly` tuple declared `as const`, with its union derived via
58
+ * `(typeof X)[number]`. Widening the tuple widens the union in the same edit — they cannot drift.
59
+ * This is the idiom already used for `EMBEDDED_FONT_SLOTS` and `EXTRA_SHAPE_PRESETS`; this module
60
+ * brings the stragglers onto it.
61
+ *
62
+ * **Why this module is neither `gen/` nor `read/`.** `src/types/` needs the unions for the public
63
+ * write API, `src/gen/` needs the tuples to vet a value before emitting it, and `src/read/` needs
64
+ * them to vet a value before writing it into a loaded part. It is a fact about the schema, so it
65
+ * belongs to none of the three.
66
+ *
67
+ * Values are listed in **schema declaration order**, which is the order the diagnostics print
68
+ * when they tell a caller what is legal.
69
+ */
70
+ /**
71
+ * `ST_BevelPresetType` — the bevel profile applied to a 3-D edge.
72
+ * @see ECMA-376 Part 1 §20.1.10.9
73
+ */
74
+ const BEVEL_PRESETS = [
75
+ "relaxedInset",
76
+ "circle",
77
+ "slope",
78
+ "cross",
79
+ "angle",
80
+ "softRound",
81
+ "convex",
82
+ "coolSlant",
83
+ "divot",
84
+ "riblet",
85
+ "hardEdge",
86
+ "artDeco"
87
+ ];
88
+ /**
89
+ * `ST_PresetMaterialType` — how a 3-D surface responds to light.
90
+ * @see ECMA-376 Part 1 §20.1.10.50
91
+ */
92
+ const PRESET_MATERIALS = [
93
+ "legacyMatte",
94
+ "legacyPlastic",
95
+ "legacyMetal",
96
+ "legacyWireframe",
97
+ "matte",
98
+ "plastic",
99
+ "metal",
100
+ "warmMatte",
101
+ "translucentPowder",
102
+ "powder",
103
+ "dkEdge",
104
+ "softEdge",
105
+ "clear",
106
+ "flat",
107
+ "softmetal"
108
+ ];
109
+ /**
110
+ * `ST_LightRigType` — the preset lighting scene.
111
+ * @see ECMA-376 Part 1 §20.1.10.35
112
+ */
113
+ const LIGHT_RIGS = [
114
+ "legacyFlat1",
115
+ "legacyFlat2",
116
+ "legacyFlat3",
117
+ "legacyFlat4",
118
+ "legacyNormal1",
119
+ "legacyNormal2",
120
+ "legacyNormal3",
121
+ "legacyNormal4",
122
+ "legacyHarsh1",
123
+ "legacyHarsh2",
124
+ "legacyHarsh3",
125
+ "legacyHarsh4",
126
+ "threePt",
127
+ "balanced",
128
+ "soft",
129
+ "harsh",
130
+ "flood",
131
+ "contrasting",
132
+ "morning",
133
+ "sunrise",
134
+ "sunset",
135
+ "chilly",
136
+ "freezing",
137
+ "flat",
138
+ "twoPt",
139
+ "glow",
140
+ "brightRoom"
141
+ ];
142
+ /**
143
+ * `ST_LightRigDirection` — where the light rig sits relative to the scene.
144
+ * @see ECMA-376 Part 1 §20.1.10.33
145
+ */
146
+ const LIGHT_RIG_DIRECTIONS = [
147
+ "tl",
148
+ "t",
149
+ "tr",
150
+ "l",
151
+ "r",
152
+ "bl",
153
+ "b",
154
+ "br"
155
+ ];
156
+ /**
157
+ * `ST_TextHorzOverflowType` — `a:bodyPr/@horzOverflow` and `a:tcPr/@horzOverflow`.
158
+ * @see ECMA-376 Part 1 §20.1.10.68
159
+ */
160
+ const TEXT_HORZ_OVERFLOW = ["clip", "overflow"];
161
+ /**
162
+ * `ST_TextAnchoringType` — `a:bodyPr/@anchor` and `a:tcPr/@anchor`.
163
+ * @see ECMA-376 Part 1 §20.1.10.60
164
+ */
165
+ const TEXT_ANCHORS = [
166
+ "t",
167
+ "ctr",
168
+ "b",
169
+ "just",
170
+ "dist"
171
+ ];
172
+ /**
173
+ * `ST_TextVerticalType` — `a:bodyPr/@vert` and `a:tcPr/@vert`.
174
+ * @see ECMA-376 Part 1 §20.1.10.83
175
+ */
176
+ const TEXT_VERTICAL = [
177
+ "horz",
178
+ "vert",
179
+ "vert270",
180
+ "wordArtVert",
181
+ "eaVert",
182
+ "mongolianVert",
183
+ "wordArtVertRtl"
184
+ ];
185
+ /**
186
+ * `ST_PresetLineDashVal` — the dash pattern of a line or border (`a:prstDash/@val`).
187
+ *
188
+ * The `sys*` members are the "system" dashes whose exact dot/gap ratio the renderer picks; the
189
+ * rest are defined by the spec. Both `BorderProps.dashType` and `ShapeLineProps.dashType` accept
190
+ * this whole set, so a caller who knows one knows the other.
191
+ * @see ECMA-376 Part 1 §20.1.10.49
192
+ */
193
+ const PRESET_LINE_DASHES = [
194
+ "solid",
195
+ "dot",
196
+ "dash",
197
+ "lgDash",
198
+ "dashDot",
199
+ "lgDashDot",
200
+ "lgDashDotDot",
201
+ "sysDash",
202
+ "sysDot",
203
+ "sysDashDot",
204
+ "sysDashDotDot"
205
+ ];
206
+ //#endregion
3
207
  //#region src/media/base64.ts
4
208
  /**
5
209
  * Base64 payload handling for media parts — isomorphic across Node and browsers
@@ -31,6 +235,26 @@ function bytesToBase64(bytes) {
31
235
  return btoa(binary);
32
236
  }
33
237
  /**
238
+ * Present a freshly loaded media payload as a `data:` URI.
239
+ *
240
+ * A {@link RuntimeAdapter.loadMedia} implementation returns whichever encoding its host
241
+ * makes cheap — the browser adapter a full URI, because `FileReader.readAsDataURL` is what
242
+ * decodes a blob without blocking; Node and the neutral adapter raw base64, because neither
243
+ * has a `FileReader`. This is where the two become one, so nothing downstream of the load
244
+ * has to ask which it got.
245
+ *
246
+ * The mime label is documentary: {@link decodeBase64ToBytes} ignores it, and the one consumer
247
+ * that needs a real URI (`image.src`, in the browser adapter's SVG preview) is handed the
248
+ * adapter's own. It is taken from the rel anyway rather than hard-coded, so an already-correct
249
+ * label is not overwritten with a wrong one.
250
+ * @param {string} payload - what the adapter returned: raw base64, or an already-formed URI
251
+ * @param {string} contentType - the rel's content type, e.g. `image/png`
252
+ * @returns {string} a `data:` URI
253
+ */
254
+ function toMediaDataUri(payload, contentType) {
255
+ return payload.startsWith("data:") ? payload : `data:${contentType};base64,${payload}`;
256
+ }
257
+ /**
34
258
  * Decode a base64 image payload (raw base64 or a `data:` URI) to bytes.
35
259
  * - tolerant of the `data:[mime];base64,` prefix and of whitespace in the payload
36
260
  * @param {string} b64 - base64 string or data URI
@@ -251,7 +475,7 @@ function utf8Decode(bytes) {
251
475
  //#endregion
252
476
  //#region src/ooxml/rel-types.ts
253
477
  /**
254
- * OPC relationship type URIs, and the two schema-URI bases they are built from.
478
+ * OPC relationship type URIs and part content types, and the schema-URI bases they are built from.
255
479
  *
256
480
  * These are long, near-identical strings that differ in one path segment, which makes a typo
257
481
  * both easy to write and invisible on review — a wrong URI does not throw, it silently matches
@@ -268,6 +492,11 @@ function utf8Decode(bytes) {
268
492
  * (`chart`, `hyperlink`, `tags`, the two comments parts, `oleObject`, the MS media rels, …) stays
269
493
  * declared next to the code that reads or emits it — hoisting those would trade a definition you
270
494
  * can see for one you have to go and find, and buy nothing.
495
+ *
496
+ * The same reasoning covers **part content types**, which are the same kind of fact and fail the
497
+ * same silent way. The write side is the exception at the bottom of this file: `[Content_Types].xml`
498
+ * spells its entries out locally so each one stays greppable by its suffix next to the part it
499
+ * declares.
271
500
  */
272
501
  /** Root of every ECMA-376 schema URI. Private: callers want one of the prefixes below. */
273
502
  const SCHEMA_BASE = "http://schemas.openxmlformats.org/";
@@ -294,211 +523,73 @@ const THEME_REL = OFFICE_REL + "theme";
294
523
  const OFFICE_DOCUMENT_REL = OFFICE_REL + "officeDocument";
295
524
  /** Any part → an image in `ppt/media/`. */
296
525
  const IMAGE_REL = OFFICE_REL + "image";
526
+ /** Root of the ECMA-376 content types. Private: callers want one of the constants below. */
527
+ const OD_CONTENT = "application/vnd.openxmlformats-officedocument.";
528
+ /** `ppt/slides/slideN.xml`. */
529
+ const SLIDE_CONTENT_TYPE = OD_CONTENT + "presentationml.slide+xml";
530
+ /** `ppt/slideMasters/slideMasterN.xml`. */
531
+ const SLIDE_MASTER_CONTENT_TYPE = OD_CONTENT + "presentationml.slideMaster+xml";
532
+ /** `ppt/slideLayouts/slideLayoutN.xml`. */
533
+ const SLIDE_LAYOUT_CONTENT_TYPE = OD_CONTENT + "presentationml.slideLayout+xml";
534
+ /** `ppt/notesSlides/notesSlideN.xml`. */
535
+ const NOTES_SLIDE_CONTENT_TYPE = OD_CONTENT + "presentationml.notesSlide+xml";
536
+ /** `ppt/notesMasters/notesMasterN.xml`. */
537
+ const NOTES_MASTER_CONTENT_TYPE = OD_CONTENT + "presentationml.notesMaster+xml";
538
+ /** `ppt/theme/themeN.xml`. Not `presentationml.`: a theme is a DrawingML part. */
539
+ const THEME_CONTENT_TYPE = OD_CONTENT + "theme+xml";
297
540
  //#endregion
298
- //#region src/ooxml/check-enum.ts
541
+ //#region src/ooxml/namespaces.ts
299
542
  /**
300
- * Check a value against its `ST_` union, reporting and dropping it when outside (the write-path
301
- * policy — see the module note).
543
+ * OOXML namespace URIs, by their canonical prefix.
302
544
  *
303
- * `undefined`/`null` returns `null` without reporting: an unset option is not an invalid one, and
304
- * it is by far the common case.
545
+ * A namespace URI is a fact about the format, not about reading or writing one, so it belongs
546
+ * here rather than on either side — the same reasoning `rel-types.ts` states at length, and for
547
+ * the same failure mode: these are long, near-identical strings, and a typo does not throw. It
548
+ * silently matches nothing on the read side and produces a part PowerPoint ignores on the write
549
+ * side.
305
550
  *
306
- * The offending value is interpolated into the message deliberately. {@link warnOnce} dedups on
307
- * code **and** message, so keeping the value in the text is what lets a second, *different* bad
308
- * value under the same code still get reported.
309
- * @param value - the value the caller supplied, if any
310
- * @param valid - the enum's members
311
- * @param code - the condition to report
312
- * @param label - how to name the offending option in the message, e.g. ``'table cell: cell3D `preset`'``
313
- * @param detail - extra structured context to merge into the diagnostic's `detail`
314
- * @returns the value when legal, else `null`
551
+ * The table lived in `read/oxml/dom.ts` and could not be reached from `gen/`, because that
552
+ * module imports `@xmldom/xmldom` at module scope and pulling an XML DOM into the write-only
553
+ * bundle is a real cost. So the write side hand-wrote the URIs instead: three separate `A_NS`
554
+ * constants and seven copies of the same `xmlns:a`/`xmlns:r`/`xmlns:p` triple. This module has
555
+ * **no runtime imports** — like `rel-types.ts`, `st-enums.ts` and `sequence.ts` beside it — so
556
+ * both sides can reach it and neither pays for the other's dependencies. `read/oxml/dom.ts`
557
+ * re-exports it, so no read-side import path changed.
315
558
  */
316
- function checkEnumOrWarn(value, valid, code, label, detail) {
317
- if (value === void 0 || value === null) return null;
318
- if (valid.includes(value)) return value;
319
- warnOnce(code, `${label} value \`${String(value)}\` is not valid and is ignored — use one of ${valid.join(", ")}.`, {
320
- received: value,
321
- valid,
322
- ...detail
323
- });
324
- return null;
325
- }
559
+ /** Canonical OOXML prefix → namespace URI registry. */
560
+ const OOXML_NS = Object.freeze({
561
+ a: "http://schemas.openxmlformats.org/drawingml/2006/main",
562
+ c: "http://schemas.openxmlformats.org/drawingml/2006/chart",
563
+ cp: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties",
564
+ ct: "http://schemas.openxmlformats.org/package/2006/content-types",
565
+ cx: "http://schemas.microsoft.com/office/drawing/2014/chartex",
566
+ dc: "http://purl.org/dc/elements/1.1/",
567
+ dcterms: "http://purl.org/dc/terms/",
568
+ dgm: "http://schemas.openxmlformats.org/drawingml/2006/diagram",
569
+ dsp: "http://schemas.microsoft.com/office/drawing/2008/diagram",
570
+ ep: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",
571
+ mc: "http://schemas.openxmlformats.org/markup-compatibility/2006",
572
+ p: "http://schemas.openxmlformats.org/presentationml/2006/main",
573
+ p14: "http://schemas.microsoft.com/office/powerpoint/2010/main",
574
+ p188: "http://schemas.microsoft.com/office/powerpoint/2018/8/main",
575
+ pr: "http://schemas.openxmlformats.org/package/2006/relationships",
576
+ r: "http://schemas.openxmlformats.org/officeDocument/2006/relationships"
577
+ });
326
578
  /**
327
- * Check a value against its `ST_` union, throwing when outside (the read/edit-path policy — see
328
- * the module note).
329
- * @param value - the value the caller asked for
330
- * @param valid - the enum's members
331
- * @param attribute - the attribute's name, for the message
332
- * @param code - the condition to report
333
- * @returns `value`, when it is legal
334
- */
335
- function checkEnumOrThrow(value, valid, attribute, code) {
336
- if (valid.includes(value)) return value;
337
- throw new InvalidOptionError(code, `Invalid ${attribute}: ${JSON.stringify(value)}. Expected one of: ${valid.join(", ")}.`);
338
- }
339
- //#endregion
340
- //#region src/ooxml/st-enums.ts
341
- /**
342
- * `ST_` simple-type enumerations from ECMA-376, declared once as the single source of both the
343
- * TypeScript union a caller is checked against and the runtime list a value is validated against.
344
- *
345
- * **The problem this solves.** Each of these used to exist twice: a hand-written string union in
346
- * `src/types/` (what the compiler enforces) and a hand-written array in `src/gen/` or `src/read/`
347
- * (what the validator checks at run time). Nothing tied the two together, so adding a member to
348
- * one and not the other produced either a value TypeScript accepts and the validator drops, or a
349
- * value the validator passes and the type rejects. Two of them had already diverged in *order*,
350
- * which is harmless, but nothing would have caught a divergence in *content*.
351
- *
352
- * **The shape.** Every entry is a `readonly` tuple declared `as const`, with its union derived via
353
- * `(typeof X)[number]`. Widening the tuple widens the union in the same edit — they cannot drift.
354
- * This is the idiom already used for `EMBEDDED_FONT_SLOTS` and `EXTRA_SHAPE_PRESETS`; this module
355
- * brings the stragglers onto it.
356
- *
357
- * **Why this module is neither `gen/` nor `read/`.** `src/types/` needs the unions for the public
358
- * write API, `src/gen/` needs the tuples to vet a value before emitting it, and `src/read/` needs
359
- * them to vet a value before writing it into a loaded part. It is a fact about the schema, so it
360
- * belongs to none of the three.
579
+ * The `xmlns` declarations every PresentationML part root carries, in the order the emitters
580
+ * have always written them.
361
581
  *
362
- * Values are listed in **schema declaration order**, which is the order the diagnostics print
363
- * when they tell a caller what is legal.
364
- */
365
- /**
366
- * `ST_BevelPresetType` — the bevel profile applied to a 3-D edge.
367
- * @see ECMA-376 Part 1 §20.1.10.9
582
+ * Spread this **first** in a root element's attribute map: `el()` serializes attributes in
583
+ * object-key order, so the three keys have to keep the positions the literals occupied or the
584
+ * emitted bytes move. A root with extra attributes (`show` on `p:sld`, `def` on `a:tblStyleLst`)
585
+ * lists them after the spread, which is where they already were.
368
586
  */
369
- const BEVEL_PRESETS = [
370
- "relaxedInset",
371
- "circle",
372
- "slope",
373
- "cross",
374
- "angle",
375
- "softRound",
376
- "convex",
377
- "coolSlant",
378
- "divot",
379
- "riblet",
380
- "hardEdge",
381
- "artDeco"
382
- ];
383
- /**
384
- * `ST_PresetMaterialType` — how a 3-D surface responds to light.
385
- * @see ECMA-376 Part 1 §20.1.10.50
386
- */
387
- const PRESET_MATERIALS = [
388
- "legacyMatte",
389
- "legacyPlastic",
390
- "legacyMetal",
391
- "legacyWireframe",
392
- "matte",
393
- "plastic",
394
- "metal",
395
- "warmMatte",
396
- "translucentPowder",
397
- "powder",
398
- "dkEdge",
399
- "softEdge",
400
- "clear",
401
- "flat",
402
- "softmetal"
403
- ];
404
- /**
405
- * `ST_LightRigType` — the preset lighting scene.
406
- * @see ECMA-376 Part 1 §20.1.10.35
407
- */
408
- const LIGHT_RIGS = [
409
- "legacyFlat1",
410
- "legacyFlat2",
411
- "legacyFlat3",
412
- "legacyFlat4",
413
- "legacyNormal1",
414
- "legacyNormal2",
415
- "legacyNormal3",
416
- "legacyNormal4",
417
- "legacyHarsh1",
418
- "legacyHarsh2",
419
- "legacyHarsh3",
420
- "legacyHarsh4",
421
- "threePt",
422
- "balanced",
423
- "soft",
424
- "harsh",
425
- "flood",
426
- "contrasting",
427
- "morning",
428
- "sunrise",
429
- "sunset",
430
- "chilly",
431
- "freezing",
432
- "flat",
433
- "twoPt",
434
- "glow",
435
- "brightRoom"
436
- ];
437
- /**
438
- * `ST_LightRigDirection` — where the light rig sits relative to the scene.
439
- * @see ECMA-376 Part 1 §20.1.10.33
440
- */
441
- const LIGHT_RIG_DIRECTIONS = [
442
- "tl",
443
- "t",
444
- "tr",
445
- "l",
446
- "r",
447
- "bl",
448
- "b",
449
- "br"
450
- ];
451
- /**
452
- * `ST_TextHorzOverflowType` — `a:bodyPr/@horzOverflow` and `a:tcPr/@horzOverflow`.
453
- * @see ECMA-376 Part 1 §20.1.10.68
454
- */
455
- const TEXT_HORZ_OVERFLOW = ["clip", "overflow"];
456
- /**
457
- * `ST_TextAnchoringType` — `a:bodyPr/@anchor` and `a:tcPr/@anchor`.
458
- * @see ECMA-376 Part 1 §20.1.10.60
459
- */
460
- const TEXT_ANCHORS = [
461
- "t",
462
- "ctr",
463
- "b",
464
- "just",
465
- "dist"
466
- ];
467
- /**
468
- * `ST_TextVerticalType` — `a:bodyPr/@vert` and `a:tcPr/@vert`.
469
- * @see ECMA-376 Part 1 §20.1.10.83
470
- */
471
- const TEXT_VERTICAL = [
472
- "horz",
473
- "vert",
474
- "vert270",
475
- "wordArtVert",
476
- "eaVert",
477
- "mongolianVert",
478
- "wordArtVertRtl"
479
- ];
480
- /**
481
- * `ST_PresetLineDashVal` — the dash pattern of a line or border (`a:prstDash/@val`).
482
- *
483
- * The `sys*` members are the "system" dashes whose exact dot/gap ratio the renderer picks; the
484
- * rest are defined by the spec. Both `BorderProps.dashType` and `ShapeLineProps.dashType` accept
485
- * this whole set, so a caller who knows one knows the other.
486
- * @see ECMA-376 Part 1 §20.1.10.49
487
- */
488
- const PRESET_LINE_DASHES = [
489
- "solid",
490
- "dot",
491
- "dash",
492
- "lgDash",
493
- "dashDot",
494
- "lgDashDot",
495
- "lgDashDotDot",
496
- "sysDash",
497
- "sysDot",
498
- "sysDashDot",
499
- "sysDashDotDot"
500
- ];
587
+ const PML_ROOT_NS = Object.freeze({
588
+ "xmlns:a": OOXML_NS.a,
589
+ "xmlns:r": OOXML_NS.r,
590
+ "xmlns:p": OOXML_NS.p
591
+ });
501
592
  //#endregion
502
- export { getImageSizeFromBytes as C, svgMarkupToDataUri as E, getImageSizeFromBase64 as S, decodeBase64ToBytes as T, SLIDE_LAYOUT_REL as _, PRESET_MATERIALS as a, THEME_REL as b, TEXT_VERTICAL as c, IMAGE_REL as d, NOTES_MASTER_REL as f, PACKAGE_REL_NS as g, OFFICE_REL as h, PRESET_LINE_DASHES as i, checkEnumOrThrow as l, OFFICE_DOCUMENT_REL as m, LIGHT_RIGS as n, TEXT_ANCHORS as o, NOTES_SLIDE_REL as p, LIGHT_RIG_DIRECTIONS as r, TEXT_HORZ_OVERFLOW as s, BEVEL_PRESETS as t, checkEnumOrWarn as u, SLIDE_MASTER_REL as v, bytesToBase64 as w, fitSrcRectPercents as x, SLIDE_REL as y };
593
+ export { PRESET_MATERIALS as A, decodeBase64ToBytes as C, LIGHT_RIGS as D, BEVEL_PRESETS as E, checkEnumOrWarn as F, TEXT_HORZ_OVERFLOW as M, TEXT_VERTICAL as N, LIGHT_RIG_DIRECTIONS as O, checkEnumOrThrow as P, bytesToBase64 as S, toMediaDataUri as T, THEME_CONTENT_TYPE as _, NOTES_MASTER_REL as a, getImageSizeFromBase64 as b, OFFICE_DOCUMENT_REL as c, SLIDE_CONTENT_TYPE as d, SLIDE_LAYOUT_CONTENT_TYPE as f, SLIDE_REL as g, SLIDE_MASTER_REL as h, NOTES_MASTER_CONTENT_TYPE as i, TEXT_ANCHORS as j, PRESET_LINE_DASHES as k, OFFICE_REL as l, SLIDE_MASTER_CONTENT_TYPE as m, PML_ROOT_NS as n, NOTES_SLIDE_CONTENT_TYPE as o, SLIDE_LAYOUT_REL as p, IMAGE_REL as r, NOTES_SLIDE_REL as s, OOXML_NS as t, PACKAGE_REL_NS as u, THEME_REL as v, svgMarkupToDataUri as w, getImageSizeFromBytes as x, fitSrcRectPercents as y };
503
594
 
504
- //# sourceMappingURL=st-enums-bVnezkMJ.js.map
595
+ //# sourceMappingURL=namespaces-CcKuzeuE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"namespaces-CcKuzeuE.js","names":[],"sources":["../src/ooxml/check-enum.ts","../src/ooxml/st-enums.ts","../src/media/base64.ts","../src/media/image-size.ts","../src/ooxml/rel-types.ts","../src/ooxml/namespaces.ts"],"sourcesContent":["/**\n * Validating a value against an `ST_` enumeration, under the two policies the library uses.\n *\n * **Why validate at all.** A value outside its `ST_` union makes the containing part\n * schema-invalid, and PowerPoint reports that as a *corrupt file* rather than as a mis-set\n * option — so the cost of letting one through is a deck that will not open, attributed to\n * nothing in particular. Both halves therefore check before a value reaches the XML.\n *\n * **Why two policies.** They differ deliberately, and the difference is about where the value\n * came from:\n *\n * - {@link checkEnumOrWarn} (write path) reports and **drops** the attribute, leaving the\n * renderer on the schema default. An option here comes from a deck being built, and losing one\n * attribute is better than failing an entire build over it.\n * - {@link checkEnumOrThrow} (read/edit path) **throws**. A value here comes from a caller\n * editing one attribute of a loaded deck, so silently doing nothing would leave them looking at\n * an unchanged file with no explanation.\n *\n * Before this module the two policies were spread across three near-identical private validators\n * (two in `gen/`, one in `read/`), each with its own wording; adding an enum meant writing a\n * fourth. The policy split is worth keeping — the triplication was not.\n */\n\nimport type { DiagnosticCode, InvalidOptionErrorCode } from '../codes.js'\nimport { warnOnce } from '../diagnostics.js'\nimport { InvalidOptionError } from '../errors.js'\n\n/**\n * Check a value against its `ST_` union, reporting and dropping it when outside (the write-path\n * policy — see the module note).\n *\n * `undefined`/`null` returns `null` without reporting: an unset option is not an invalid one, and\n * it is by far the common case.\n *\n * The offending value is interpolated into the message deliberately. {@link warnOnce} dedups on\n * code **and** message, so keeping the value in the text is what lets a second, *different* bad\n * value under the same code still get reported.\n * @param value - the value the caller supplied, if any\n * @param valid - the enum's members\n * @param code - the condition to report\n * @param label - how to name the offending option in the message, e.g. ``'table cell: cell3D `preset`'``\n * @param detail - extra structured context to merge into the diagnostic's `detail`\n * @returns the value when legal, else `null`\n */\nexport function checkEnumOrWarn<T extends string>(\n\tvalue: string | undefined | null,\n\tvalid: readonly T[],\n\tcode: DiagnosticCode,\n\tlabel: string,\n\tdetail?: Readonly<Record<string, unknown>>\n): T | null {\n\tif (value === undefined || value === null) return null\n\tif ((valid as readonly string[]).includes(value)) return value as T\n\twarnOnce(code, `${label} value \\`${String(value)}\\` is not valid and is ignored — use one of ${valid.join(', ')}.`, {\n\t\treceived: value,\n\t\tvalid,\n\t\t...detail,\n\t})\n\treturn null\n}\n\n/**\n * Check a value against its `ST_` union, throwing when outside (the read/edit-path policy — see\n * the module note).\n * @param value - the value the caller asked for\n * @param valid - the enum's members\n * @param attribute - the attribute's name, for the message\n * @param code - the condition to report\n * @returns `value`, when it is legal\n */\nexport function checkEnumOrThrow<T extends string>(\n\tvalue: string,\n\tvalid: readonly T[],\n\tattribute: string,\n\tcode: InvalidOptionErrorCode\n): T {\n\tif ((valid as readonly string[]).includes(value)) return value as T\n\tthrow new InvalidOptionError(\n\t\tcode,\n\t\t`Invalid ${attribute}: ${JSON.stringify(value)}. Expected one of: ${valid.join(', ')}.`\n\t)\n}\n","/**\n * `ST_` simple-type enumerations from ECMA-376, declared once as the single source of both the\n * TypeScript union a caller is checked against and the runtime list a value is validated against.\n *\n * **The problem this solves.** Each of these used to exist twice: a hand-written string union in\n * `src/types/` (what the compiler enforces) and a hand-written array in `src/gen/` or `src/read/`\n * (what the validator checks at run time). Nothing tied the two together, so adding a member to\n * one and not the other produced either a value TypeScript accepts and the validator drops, or a\n * value the validator passes and the type rejects. Two of them had already diverged in *order*,\n * which is harmless, but nothing would have caught a divergence in *content*.\n *\n * **The shape.** Every entry is a `readonly` tuple declared `as const`, with its union derived via\n * `(typeof X)[number]`. Widening the tuple widens the union in the same edit — they cannot drift.\n * This is the idiom already used for `EMBEDDED_FONT_SLOTS` and `EXTRA_SHAPE_PRESETS`; this module\n * brings the stragglers onto it.\n *\n * **Why this module is neither `gen/` nor `read/`.** `src/types/` needs the unions for the public\n * write API, `src/gen/` needs the tuples to vet a value before emitting it, and `src/read/` needs\n * them to vet a value before writing it into a loaded part. It is a fact about the schema, so it\n * belongs to none of the three.\n *\n * Values are listed in **schema declaration order**, which is the order the diagnostics print\n * when they tell a caller what is legal.\n */\n\n/**\n * `ST_BevelPresetType` — the bevel profile applied to a 3-D edge.\n * @see ECMA-376 Part 1 §20.1.10.9\n */\nexport const BEVEL_PRESETS = [\n\t'relaxedInset',\n\t'circle',\n\t'slope',\n\t'cross',\n\t'angle',\n\t'softRound',\n\t'convex',\n\t'coolSlant',\n\t'divot',\n\t'riblet',\n\t'hardEdge',\n\t'artDeco',\n] as const\nexport type BevelPresetType = (typeof BEVEL_PRESETS)[number]\n\n/**\n * `ST_PresetMaterialType` — how a 3-D surface responds to light.\n * @see ECMA-376 Part 1 §20.1.10.50\n */\nexport const PRESET_MATERIALS = [\n\t'legacyMatte',\n\t'legacyPlastic',\n\t'legacyMetal',\n\t'legacyWireframe',\n\t'matte',\n\t'plastic',\n\t'metal',\n\t'warmMatte',\n\t'translucentPowder',\n\t'powder',\n\t'dkEdge',\n\t'softEdge',\n\t'clear',\n\t'flat',\n\t'softmetal',\n] as const\nexport type PresetMaterialType = (typeof PRESET_MATERIALS)[number]\n\n/**\n * `ST_LightRigType` — the preset lighting scene.\n * @see ECMA-376 Part 1 §20.1.10.35\n */\nexport const LIGHT_RIGS = [\n\t'legacyFlat1',\n\t'legacyFlat2',\n\t'legacyFlat3',\n\t'legacyFlat4',\n\t'legacyNormal1',\n\t'legacyNormal2',\n\t'legacyNormal3',\n\t'legacyNormal4',\n\t'legacyHarsh1',\n\t'legacyHarsh2',\n\t'legacyHarsh3',\n\t'legacyHarsh4',\n\t'threePt',\n\t'balanced',\n\t'soft',\n\t'harsh',\n\t'flood',\n\t'contrasting',\n\t'morning',\n\t'sunrise',\n\t'sunset',\n\t'chilly',\n\t'freezing',\n\t'flat',\n\t'twoPt',\n\t'glow',\n\t'brightRoom',\n] as const\nexport type LightRigType = (typeof LIGHT_RIGS)[number]\n\n/**\n * `ST_LightRigDirection` — where the light rig sits relative to the scene.\n * @see ECMA-376 Part 1 §20.1.10.33\n */\nexport const LIGHT_RIG_DIRECTIONS = ['tl', 't', 'tr', 'l', 'r', 'bl', 'b', 'br'] as const\nexport type LightRigDirection = (typeof LIGHT_RIG_DIRECTIONS)[number]\n\n/**\n * `ST_TextHorzOverflowType` — `a:bodyPr/@horzOverflow` and `a:tcPr/@horzOverflow`.\n * @see ECMA-376 Part 1 §20.1.10.68\n */\nexport const TEXT_HORZ_OVERFLOW = ['clip', 'overflow'] as const\nexport type TextHorzOverflowType = (typeof TEXT_HORZ_OVERFLOW)[number]\n\n/**\n * `ST_TextAnchoringType` — `a:bodyPr/@anchor` and `a:tcPr/@anchor`.\n * @see ECMA-376 Part 1 §20.1.10.60\n */\nexport const TEXT_ANCHORS = ['t', 'ctr', 'b', 'just', 'dist'] as const\nexport type TextAnchoringType = (typeof TEXT_ANCHORS)[number]\n\n/**\n * `ST_TextVerticalType` — `a:bodyPr/@vert` and `a:tcPr/@vert`.\n * @see ECMA-376 Part 1 §20.1.10.83\n */\nexport const TEXT_VERTICAL = [\n\t'horz',\n\t'vert',\n\t'vert270',\n\t'wordArtVert',\n\t'eaVert',\n\t'mongolianVert',\n\t'wordArtVertRtl',\n] as const\nexport type TextVerticalType = (typeof TEXT_VERTICAL)[number]\n\n/**\n * `ST_PresetLineDashVal` — the dash pattern of a line or border (`a:prstDash/@val`).\n *\n * The `sys*` members are the \"system\" dashes whose exact dot/gap ratio the renderer picks; the\n * rest are defined by the spec. Both `BorderProps.dashType` and `ShapeLineProps.dashType` accept\n * this whole set, so a caller who knows one knows the other.\n * @see ECMA-376 Part 1 §20.1.10.49\n */\nexport const PRESET_LINE_DASHES = [\n\t'solid',\n\t'dot',\n\t'dash',\n\t'lgDash',\n\t'dashDot',\n\t'lgDashDot',\n\t'lgDashDotDot',\n\t'sysDash',\n\t'sysDot',\n\t'sysDashDot',\n\t'sysDashDotDot',\n] as const\nexport type PresetLineDashVal = (typeof PRESET_LINE_DASHES)[number]\n","/**\n * Base64 payload handling for media parts — isomorphic across Node and browsers\n * (`TextEncoder`/`atob`/`btoa` only, no `Buffer`).\n */\n\n/**\n * Encode raw SVG markup as a base64 `image/svg+xml` data URI.\n * - lets callers pass inline SVG to `addImage({ svg })` without hand-rolling base64\n * - isomorphic and UTF-8 safe: uses the global `TextEncoder`/`btoa` (Node and browsers)\n * @param {string} svg - SVG markup, e.g. `'<svg ...>...</svg>'`\n * @returns {string} a `data:image/svg+xml;base64,...` URI\n */\nexport function svgMarkupToDataUri(svg: string): string {\n\treturn `data:image/svg+xml;base64,${bytesToBase64(new TextEncoder().encode(svg))}`\n}\n\n/**\n * Encode raw bytes as base64 (no `data:` prefix) using only `btoa`, so the result is the same\n * on Node, in a browser, and in a runtime that has neither `Buffer` nor `FileReader`.\n *\n * Chunked because `String.fromCharCode(...spread)` blows the argument-count limit on a payload\n * of any real size — a multi-megabyte video rel would throw rather than encode.\n * @param {Uint8Array} bytes - the payload\n * @returns {string} base64 text\n */\nexport function bytesToBase64(bytes: Uint8Array): string {\n\tconst CHUNK = 0x8000\n\tlet binary = ''\n\tfor (let i = 0; i < bytes.length; i += CHUNK) binary += String.fromCharCode(...bytes.subarray(i, i + CHUNK))\n\treturn btoa(binary)\n}\n\n/**\n * Present a freshly loaded media payload as a `data:` URI.\n *\n * A {@link RuntimeAdapter.loadMedia} implementation returns whichever encoding its host\n * makes cheap — the browser adapter a full URI, because `FileReader.readAsDataURL` is what\n * decodes a blob without blocking; Node and the neutral adapter raw base64, because neither\n * has a `FileReader`. This is where the two become one, so nothing downstream of the load\n * has to ask which it got.\n *\n * The mime label is documentary: {@link decodeBase64ToBytes} ignores it, and the one consumer\n * that needs a real URI (`image.src`, in the browser adapter's SVG preview) is handed the\n * adapter's own. It is taken from the rel anyway rather than hard-coded, so an already-correct\n * label is not overwritten with a wrong one.\n * @param {string} payload - what the adapter returned: raw base64, or an already-formed URI\n * @param {string} contentType - the rel's content type, e.g. `image/png`\n * @returns {string} a `data:` URI\n */\nexport function toMediaDataUri(payload: string, contentType: string): string {\n\treturn payload.startsWith('data:') ? payload : `data:${contentType};base64,${payload}`\n}\n\n/**\n * Decode a base64 image payload (raw base64 or a `data:` URI) to bytes.\n * - tolerant of the `data:[mime];base64,` prefix and of whitespace in the payload\n * @param {string} b64 - base64 string or data URI\n * @returns {Uint8Array | null} decoded bytes, or `null` when the payload is empty/undecodable\n */\nexport function decodeBase64ToBytes(b64: string): Uint8Array | null {\n\tif (!b64) return null\n\t// Strip any `data:...;base64,` prefix and surrounding whitespace\n\tconst comma = b64.indexOf('base64,')\n\tconst payload = (comma >= 0 ? b64.slice(comma + 'base64,'.length) : b64).replace(/\\s/g, '')\n\tif (!payload) return null\n\ttry {\n\t\tconst binary = atob(payload)\n\t\tconst bytes = new Uint8Array(binary.length)\n\t\tfor (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i)\n\t\treturn bytes\n\t} catch {\n\t\treturn null\n\t}\n}\n","/**\n * Intrinsic image geometry: reading a natural pixel size out of header bytes, and the\n * `<a:srcRect>` crop math that fits that natural size into a display box.\n *\n * Shared by both sides of the library — the write path (`addImage({ sizing })`) and the read\n * API's `Picture.setImage({ fit })` — which is why it lives outside `gen/` and `read/`.\n * Everything here is synchronous and pure: headers only, never pixel decoding.\n */\n\nimport { decodeBase64ToBytes } from './base64.js'\n\n/**\n * Read the intrinsic dimensions of an image from its header bytes.\n * - synchronous: parses only file-format headers, never decodes pixels\n * - raster: PNG, JPEG, GIF, BMP, and WebP (VP8 / VP8L / VP8X) — natural pixels\n * - vector: SVG — intrinsic size from the root `<svg>` width/height or viewBox\n * - unrecognized formats return `null` (no measurable intrinsic size)\n *\n * Used by image `sizing: 'cover' | 'contain'` to compute an aspect-correct\n * `<a:srcRect>` crop from the *natural* image ratio rather than the displayed box.\n * @param {string} dataB64 - base64 image payload or `data:` URI\n * @returns {{ w: number, h: number } | null} natural size, or `null` when unmeasurable\n */\nexport function getImageSizeFromBase64(dataB64: string): { w: number; h: number } | null {\n\tconst b = decodeBase64ToBytes(dataB64)\n\treturn b ? getImageSizeFromBytes(b) : null\n}\n\n/**\n * Read the intrinsic dimensions of an image from raw header bytes — the\n * byte-level core shared by {@link getImageSizeFromBase64} and the read API's\n * `Picture.setImage({ fit })`, which already holds the media bytes.\n * @param {Uint8Array} b - image bytes\n * @returns {{ w: number, h: number } | null} natural size, or `null` when unmeasurable\n */\nexport function getImageSizeFromBytes(b: Uint8Array): { w: number; h: number } | null {\n\tif (!b || b.length < 24) return null\n\n\t// Bounds-checked byte read: every access below is already guarded by an\n\t// explicit length check, so the `?? 0` fallback is unreachable in practice.\n\tconst u = (n: number): number => b[n] ?? 0\n\n\t// PNG: 8-byte signature, then IHDR with width@16 / height@20 (big-endian uint32)\n\tif (b[0] === 0x89 && b[1] === 0x50 && b[2] === 0x4e && b[3] === 0x47) {\n\t\tconst w = (u(16) << 24) | (u(17) << 16) | (u(18) << 8) | u(19)\n\t\tconst h = (u(20) << 24) | (u(21) << 16) | (u(22) << 8) | u(23)\n\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t}\n\n\t// GIF: \"GIF87a\"/\"GIF89a\", width@6 / height@8 (little-endian uint16)\n\tif (b[0] === 0x47 && b[1] === 0x49 && b[2] === 0x46) {\n\t\tconst w = u(6) | (u(7) << 8)\n\t\tconst h = u(8) | (u(9) << 8)\n\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t}\n\n\t// BMP: \"BM\", width@18 / height@22 (little-endian int32; height may be negative for top-down)\n\tif (b[0] === 0x42 && b[1] === 0x4d) {\n\t\tconst w = u(18) | (u(19) << 8) | (u(20) << 16) | (u(21) << 24)\n\t\tconst h = u(22) | (u(23) << 8) | (u(24) << 16) | (u(25) << 24)\n\t\tconst aw = Math.abs(w)\n\t\tconst ah = Math.abs(h)\n\t\treturn aw > 0 && ah > 0 ? { w: aw, h: ah } : null\n\t}\n\n\t// WebP: \"RIFF\"....\"WEBP\" then a VP8 / VP8L / VP8X chunk\n\tif (\n\t\tb[0] === 0x52 &&\n\t\tb[1] === 0x49 &&\n\t\tb[2] === 0x46 &&\n\t\tb[3] === 0x46 &&\n\t\tb[8] === 0x57 &&\n\t\tb[9] === 0x45 &&\n\t\tb[10] === 0x42 &&\n\t\tb[11] === 0x50\n\t) {\n\t\tconst fourCC = String.fromCharCode(u(12), u(13), u(14), u(15))\n\t\tif (fourCC === 'VP8 ' && b.length >= 30) {\n\t\t\t// Lossy: 14-bit width/height at offset 26/28 (little-endian, mask off scale bits)\n\t\t\tconst w = (u(26) | (u(27) << 8)) & 0x3fff\n\t\t\tconst h = (u(28) | (u(29) << 8)) & 0x3fff\n\t\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t\t}\n\t\tif (fourCC === 'VP8L' && b.length >= 25) {\n\t\t\t// Lossless: 14-bit width/height packed starting at bit 0 of offset 21\n\t\t\tconst bits = u(21) | (u(22) << 8) | (u(23) << 16) | (u(24) << 24)\n\t\t\tconst w = (bits & 0x3fff) + 1\n\t\t\tconst h = ((bits >> 14) & 0x3fff) + 1\n\t\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t\t}\n\t\tif (fourCC === 'VP8X' && b.length >= 30) {\n\t\t\t// Extended: 24-bit canvas width/height minus one at offset 24/27 (little-endian)\n\t\t\tconst w = (u(24) | (u(25) << 8) | (u(26) << 16)) + 1\n\t\t\tconst h = (u(27) | (u(28) << 8) | (u(29) << 16)) + 1\n\t\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t\t}\n\t\treturn null\n\t}\n\n\t// JPEG: \"FFD8\", scan segment markers for a Start-Of-Frame (SOFn) and read height@5 / width@7\n\tif (b[0] === 0xff && b[1] === 0xd8) {\n\t\tlet i = 2\n\t\twhile (i + 9 < b.length) {\n\t\t\tif (b[i] !== 0xff) {\n\t\t\t\ti++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst marker = u(i + 1)\n\t\t\t// SOF0..SOF15 carry frame dimensions, excluding DHT(C4)/JPG(C8)/DAC(CC)\n\t\t\tif (marker >= 0xc0 && marker <= 0xcf && marker !== 0xc4 && marker !== 0xc8 && marker !== 0xcc) {\n\t\t\t\tconst h = (u(i + 5) << 8) | u(i + 6)\n\t\t\t\tconst w = (u(i + 7) << 8) | u(i + 8)\n\t\t\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t\t\t}\n\t\t\t// Standalone markers (RSTn / SOI / EOI / TEM) have no length payload\n\t\t\tif ((marker >= 0xd0 && marker <= 0xd9) || marker === 0x01) {\n\t\t\t\ti += 2\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// Otherwise skip this segment using its 2-byte big-endian length\n\t\t\tconst segLen = (u(i + 2) << 8) | u(i + 3)\n\t\t\tif (segLen < 2) break\n\t\t\ti += 2 + segLen\n\t\t}\n\t\treturn null\n\t}\n\n\t// SVG: text-based vector with no binary signature. When the payload is an\n\t// `<svg>` document, read its intrinsic size from the root element so that\n\t// `sizing: 'cover' | 'contain'` is aspect-correct for SVG, not just rasters.\n\tconst text = utf8Decode(b)\n\tif (/<svg[\\s>]/i.test(text)) return getSvgSizeFromMarkup(text)\n\n\treturn null\n}\n\n/**\n * Compute the `<a:srcRect>` crop percentages (each in 1/1000 of a percent, the\n * OOXML unit) for fitting an image of natural size `img` into a display `box`,\n * assuming the cropped region is then stretched to fill the box (`<a:stretch>`).\n *\n * - `cover`: fill the box, cropping the overflowing axis (positive l/r or t/b)\n * - `contain`: fit inside the box, letterboxing the short axis (negative l/r or t/b)\n *\n * Single source of truth for the crop math shared by the write side\n * (`ImageSizingXml`) and the read API's `Picture.setImage({ fit })`. `l`/`r` and\n * `t`/`b` are symmetric (centered crop).\n * @param {'cover' | 'contain'} type - fit mode\n * @param {{ w: number, h: number }} img - natural image pixel size\n * @param {{ w: number, h: number }} box - displayed frame size (any consistent unit)\n * @returns {{ l: number, r: number, t: number, b: number }} srcRect percentages\n */\nexport function fitSrcRectPercents(\n\ttype: 'cover' | 'contain',\n\timg: { w: number; h: number },\n\tbox: { w: number; h: number }\n): { l: number; r: number; t: number; b: number } {\n\tconst imgRatio = img.h / img.w\n\tconst boxRatio = box.h / box.w\n\tlet width: number\n\tlet height: number\n\tif (type === 'cover') {\n\t\tconst isBoxBased = boxRatio > imgRatio\n\t\twidth = isBoxBased ? box.h / imgRatio : box.w\n\t\theight = isBoxBased ? box.h : box.w * imgRatio\n\t} else {\n\t\tconst widthBased = boxRatio > imgRatio\n\t\twidth = widthBased ? box.w : box.h / imgRatio\n\t\theight = widthBased ? box.w * imgRatio : box.h\n\t}\n\tconst hz = Math.round(1e5 * 0.5 * (1 - box.w / width))\n\tconst vz = Math.round(1e5 * 0.5 * (1 - box.h / height))\n\treturn { l: hz, r: hz, t: vz, b: vz }\n}\n\n/**\n * Read the intrinsic size of an SVG document from its root `<svg>` element.\n * Follows the SVG sizing model: an explicit absolute `width`/`height` pair wins;\n * otherwise the `viewBox` width/height defines the size (and thus aspect ratio).\n * Percentage or missing `width`/`height` fall through to `viewBox`.\n * @param {string} svg - SVG markup\n * @returns {{ w: number, h: number } | null} intrinsic size, or `null` when undeterminable\n */\nfunction getSvgSizeFromMarkup(svg: string): { w: number; h: number } | null {\n\tconst openTag = /<svg\\b[^>]*>/i.exec(svg)?.[0]\n\tif (!openTag) return null\n\tconst attr = (name: string): string | null =>\n\t\tnew RegExp(`\\\\b${name}\\\\s*=\\\\s*[\"']([^\"']*)[\"']`, 'i').exec(openTag)?.[1] ?? null\n\t// Leading number with an optional absolute unit; a percentage is not an intrinsic length.\n\tconst absLength = (val: string | null): number => {\n\t\tif (val == null || /%\\s*$/.test(val)) return NaN\n\t\tconst m = /^\\s*\\+?(\\d*\\.?\\d+)/.exec(val)\n\t\treturn m ? parseFloat(m[1] ?? '') : NaN\n\t}\n\tlet w = absLength(attr('width'))\n\tlet h = absLength(attr('height'))\n\tif (!(w > 0 && h > 0)) {\n\t\tconst vb = attr('viewBox')\n\t\tconst p = vb\n\t\t\t? vb\n\t\t\t\t\t.trim()\n\t\t\t\t\t.split(/[\\s,]+/)\n\t\t\t\t\t.map(Number)\n\t\t\t: []\n\t\tconst vw = p[2]\n\t\tconst vh = p[3]\n\t\tif (p.length === 4 && vw != null && vh != null && vw > 0 && vh > 0) {\n\t\t\tw = vw\n\t\t\th = vh\n\t\t}\n\t}\n\treturn w > 0 && h > 0 ? { w, h } : null\n}\n\n/** Decode UTF-8 bytes to a string, isomorphic across Node and browsers. */\nfunction utf8Decode(bytes: Uint8Array): string {\n\treturn new TextDecoder().decode(bytes)\n}\n","/**\n * OPC relationship type URIs and part content types, and the schema-URI bases they are built from.\n *\n * These are long, near-identical strings that differ in one path segment, which makes a typo\n * both easy to write and invisible on review — a wrong URI does not throw, it silently matches\n * nothing on the read side and produces a part PowerPoint ignores or rejects on the write side.\n *\n * **Why this module is neither `gen/` nor `read/`.** Both halves need the same URIs, and for a\n * while each kept its own copy (`gen/oxml/schema-uris.ts`, `read/api/rel-types.ts`), with a note\n * in both saying a shared home was \"a separate decision\". It is this module: a rel type is a fact\n * about the OOXML package format, not about writing or reading one, so neither side should own it.\n * A divergence between the two copies would mean the writer emitting a rel the reader cannot find\n * — a round-trip bug with no compile-time signal.\n *\n * Only types used by more than one module live here. A rel type exactly one module cares about\n * (`chart`, `hyperlink`, `tags`, the two comments parts, `oleObject`, the MS media rels, …) stays\n * declared next to the code that reads or emits it — hoisting those would trade a definition you\n * can see for one you have to go and find, and buy nothing.\n *\n * The same reasoning covers **part content types**, which are the same kind of fact and fail the\n * same silent way. The write side is the exception at the bottom of this file: `[Content_Types].xml`\n * spells its entries out locally so each one stays greppable by its suffix next to the part it\n * declares.\n */\n\n/** Root of every ECMA-376 schema URI. Private: callers want one of the prefixes below. */\nconst SCHEMA_BASE = 'http://schemas.openxmlformats.org/'\n\n/**\n * Prefix for `.rels` `Type` URIs — append the type name (`slide`, `image`, `theme`, …).\n * Exported for the write side, which builds one-off rel types at their call sites.\n */\nexport const OFFICE_REL = SCHEMA_BASE + 'officeDocument/2006/relationships/'\n\n/** `xmlns` of every `<Relationships>` part. Also the prefix of the package-scoped rel types. */\nexport const PACKAGE_REL_NS = SCHEMA_BASE + 'package/2006/relationships'\n\n/** `p:sldIdLst` → a slide part. */\nexport const SLIDE_REL = OFFICE_REL + 'slide'\n/** A slide → its layout; a master → each of its layouts. */\nexport const SLIDE_LAYOUT_REL = OFFICE_REL + 'slideLayout'\n/** A layout → its master; the presentation → each master. */\nexport const SLIDE_MASTER_REL = OFFICE_REL + 'slideMaster'\n/** A slide → its notes slide. */\nexport const NOTES_SLIDE_REL = OFFICE_REL + 'notesSlide'\n/** A notes slide → the notes master; the presentation → the notes master. */\nexport const NOTES_MASTER_REL = OFFICE_REL + 'notesMaster'\n/** A master or notes master → its theme. Layouts and slides inherit it rather than holding one. */\nexport const THEME_REL = OFFICE_REL + 'theme'\n/** The package root → `ppt/presentation.xml`. The entry point to everything above. */\nexport const OFFICE_DOCUMENT_REL = OFFICE_REL + 'officeDocument'\n/** Any part → an image in `ppt/media/`. */\nexport const IMAGE_REL = OFFICE_REL + 'image'\n\n// --- Part content types ----------------------------------------------------\n\n/** Root of the ECMA-376 content types. Private: callers want one of the constants below. */\nconst OD_CONTENT = 'application/vnd.openxmlformats-officedocument.'\n\n/** `ppt/slides/slideN.xml`. */\nexport const SLIDE_CONTENT_TYPE = OD_CONTENT + 'presentationml.slide+xml'\n\n/** `ppt/slideMasters/slideMasterN.xml`. */\nexport const SLIDE_MASTER_CONTENT_TYPE = OD_CONTENT + 'presentationml.slideMaster+xml'\n/** `ppt/slideLayouts/slideLayoutN.xml`. */\nexport const SLIDE_LAYOUT_CONTENT_TYPE = OD_CONTENT + 'presentationml.slideLayout+xml'\n/** `ppt/notesSlides/notesSlideN.xml`. */\nexport const NOTES_SLIDE_CONTENT_TYPE = OD_CONTENT + 'presentationml.notesSlide+xml'\n/** `ppt/notesMasters/notesMasterN.xml`. */\nexport const NOTES_MASTER_CONTENT_TYPE = OD_CONTENT + 'presentationml.notesMaster+xml'\n/** `ppt/theme/themeN.xml`. Not `presentationml.`: a theme is a DrawingML part. */\nexport const THEME_CONTENT_TYPE = OD_CONTENT + 'theme+xml'\n","/**\n * OOXML namespace URIs, by their canonical prefix.\n *\n * A namespace URI is a fact about the format, not about reading or writing one, so it belongs\n * here rather than on either side — the same reasoning `rel-types.ts` states at length, and for\n * the same failure mode: these are long, near-identical strings, and a typo does not throw. It\n * silently matches nothing on the read side and produces a part PowerPoint ignores on the write\n * side.\n *\n * The table lived in `read/oxml/dom.ts` and could not be reached from `gen/`, because that\n * module imports `@xmldom/xmldom` at module scope and pulling an XML DOM into the write-only\n * bundle is a real cost. So the write side hand-wrote the URIs instead: three separate `A_NS`\n * constants and seven copies of the same `xmlns:a`/`xmlns:r`/`xmlns:p` triple. This module has\n * **no runtime imports** — like `rel-types.ts`, `st-enums.ts` and `sequence.ts` beside it — so\n * both sides can reach it and neither pays for the other's dependencies. `read/oxml/dom.ts`\n * re-exports it, so no read-side import path changed.\n */\n\n/** Canonical OOXML prefix → namespace URI registry. */\nexport const OOXML_NS = Object.freeze({\n\ta: 'http://schemas.openxmlformats.org/drawingml/2006/main',\n\tc: 'http://schemas.openxmlformats.org/drawingml/2006/chart',\n\tcp: 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties',\n\tct: 'http://schemas.openxmlformats.org/package/2006/content-types',\n\tcx: 'http://schemas.microsoft.com/office/drawing/2014/chartex',\n\tdc: 'http://purl.org/dc/elements/1.1/',\n\tdcterms: 'http://purl.org/dc/terms/',\n\tdgm: 'http://schemas.openxmlformats.org/drawingml/2006/diagram',\n\tdsp: 'http://schemas.microsoft.com/office/drawing/2008/diagram',\n\tep: 'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties',\n\tmc: 'http://schemas.openxmlformats.org/markup-compatibility/2006',\n\tp: 'http://schemas.openxmlformats.org/presentationml/2006/main',\n\tp14: 'http://schemas.microsoft.com/office/powerpoint/2010/main',\n\tp188: 'http://schemas.microsoft.com/office/powerpoint/2018/8/main',\n\tpr: 'http://schemas.openxmlformats.org/package/2006/relationships',\n\tr: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',\n})\n\n/**\n * The `xmlns` declarations every PresentationML part root carries, in the order the emitters\n * have always written them.\n *\n * Spread this **first** in a root element's attribute map: `el()` serializes attributes in\n * object-key order, so the three keys have to keep the positions the literals occupied or the\n * emitted bytes move. A root with extra attributes (`show` on `p:sld`, `def` on `a:tblStyleLst`)\n * lists them after the spread, which is where they already were.\n */\nexport const PML_ROOT_NS = Object.freeze({\n\t'xmlns:a': OOXML_NS.a,\n\t'xmlns:r': OOXML_NS.r,\n\t'xmlns:p': OOXML_NS.p,\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4CA,SAAgB,gBACf,OACA,OACA,MACA,OACA,QACW;CACX,IAAI,UAAU,KAAA,KAAa,UAAU,MAAM,OAAO;CAClD,IAAK,MAA4B,SAAS,KAAK,GAAG,OAAO;CACzD,SAAS,MAAM,GAAG,MAAM,WAAW,OAAO,KAAK,EAAE,8CAA8C,MAAM,KAAK,IAAI,EAAE,IAAI;EACnH,UAAU;EACV;EACA,GAAG;CACJ,CAAC;CACD,OAAO;AACR;;;;;;;;;;AAWA,SAAgB,iBACf,OACA,OACA,WACA,MACI;CACJ,IAAK,MAA4B,SAAS,KAAK,GAAG,OAAO;CACzD,MAAM,IAAI,mBACT,MACA,WAAW,UAAU,IAAI,KAAK,UAAU,KAAK,EAAE,qBAAqB,MAAM,KAAK,IAAI,EAAE,EACtF;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpDA,MAAa,gBAAgB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;;AAOA,MAAa,mBAAmB;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;;;;AAOA,MAAa,aAAa;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;C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