@office-open/core 0.10.15 → 0.11.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 (83) hide show
  1. package/README.md +2 -1
  2. package/dist/chart/index.d.mts +2 -2
  3. package/dist/chart/index.mjs +2 -2
  4. package/dist/chart-Kf_utasF.mjs +1780 -0
  5. package/dist/chart-Kf_utasF.mjs.map +1 -0
  6. package/dist/color-mapping-CFF0vRSe.mjs +117 -0
  7. package/dist/color-mapping-CFF0vRSe.mjs.map +1 -0
  8. package/dist/descriptor/index.d.mts +2 -2
  9. package/dist/descriptor/index.mjs +1 -1
  10. package/dist/{descriptor-BjNkn5jo.mjs → descriptor-BX8xW8na.mjs} +6 -2
  11. package/dist/{descriptor-BjNkn5jo.mjs.map → descriptor-BX8xW8na.mjs.map} +1 -1
  12. package/dist/drawing/index.d.mts +2 -0
  13. package/dist/drawing/index.mjs +2 -0
  14. package/dist/{drawingml-sj1J3lb0.mjs → drawing-FBzd2I0m.mjs} +2596 -1518
  15. package/dist/drawing-FBzd2I0m.mjs.map +1 -0
  16. package/dist/{converters-C_Y2QX1w.mjs → generators-CElPsAhd.mjs} +699 -258
  17. package/dist/generators-CElPsAhd.mjs.map +1 -0
  18. package/dist/index-BsTUn4K1.d.mts +28 -0
  19. package/dist/index-BsTUn4K1.d.mts.map +1 -0
  20. package/dist/index-C0ClOhmZ.d.mts +869 -0
  21. package/dist/index-C0ClOhmZ.d.mts.map +1 -0
  22. package/dist/{index-BVK2dv6C.d.mts → index-CLX7gU9J.d.mts} +8 -3
  23. package/dist/index-CLX7gU9J.d.mts.map +1 -0
  24. package/dist/index-Cgz88FU0.d.mts +308 -0
  25. package/dist/index-Cgz88FU0.d.mts.map +1 -0
  26. package/dist/{index-CE53SwpZ.d.mts → index-CnjCK-lF.d.mts} +497 -351
  27. package/dist/index-CnjCK-lF.d.mts.map +1 -0
  28. package/dist/{index-BfHfKuKy.d.mts → index-DpPeyf5f.d.mts} +61 -20
  29. package/dist/index-DpPeyf5f.d.mts.map +1 -0
  30. package/dist/index-DxwLMnBF.d.mts +384 -0
  31. package/dist/index-DxwLMnBF.d.mts.map +1 -0
  32. package/dist/index.d.mts +175 -22
  33. package/dist/index.d.mts.map +1 -1
  34. package/dist/index.mjs +523 -70
  35. package/dist/index.mjs.map +1 -1
  36. package/dist/patch/index.mjs +1 -1
  37. package/dist/{patch-BmRfghOo.mjs → patch-3KLx2yEP.mjs} +4 -4
  38. package/dist/patch-3KLx2yEP.mjs.map +1 -0
  39. package/dist/smartart/index.d.mts +2 -2
  40. package/dist/smartart/index.mjs +2 -2
  41. package/dist/smartart-BxnkROOp.mjs +1649 -0
  42. package/dist/smartart-BxnkROOp.mjs.map +1 -0
  43. package/dist/style-matrix-DAP6XrLv.mjs +123 -0
  44. package/dist/style-matrix-DAP6XrLv.mjs.map +1 -0
  45. package/dist/theme/index.d.mts +4 -2
  46. package/dist/theme/index.mjs +3 -2
  47. package/dist/theme-OAuRcA9_.mjs +460 -0
  48. package/dist/theme-OAuRcA9_.mjs.map +1 -0
  49. package/dist/theme-options-BbWccl85.d.mts +109 -0
  50. package/dist/theme-options-BbWccl85.d.mts.map +1 -0
  51. package/dist/util/index.d.mts +3 -3
  52. package/dist/util/index.mjs +3 -3
  53. package/dist/{util-Tq9PSjK0.mjs → util-C94-JKtp.mjs} +175 -429
  54. package/dist/util-C94-JKtp.mjs.map +1 -0
  55. package/dist/{values-8di32lIe.d.mts → values-aVoirbWB.d.mts} +4 -2
  56. package/dist/values-aVoirbWB.d.mts.map +1 -0
  57. package/dist/vector/index.d.mts +2 -0
  58. package/dist/vector/index.mjs +2 -0
  59. package/dist/vector-TpjW6ZSc.mjs +3092 -0
  60. package/dist/vector-TpjW6ZSc.mjs.map +1 -0
  61. package/package.json +15 -7
  62. package/dist/chart-DIGJna_6.mjs +0 -582
  63. package/dist/chart-DIGJna_6.mjs.map +0 -1
  64. package/dist/converters-C_Y2QX1w.mjs.map +0 -1
  65. package/dist/drawingml/index.d.mts +0 -2
  66. package/dist/drawingml/index.mjs +0 -2
  67. package/dist/drawingml-sj1J3lb0.mjs.map +0 -1
  68. package/dist/index-BVK2dv6C.d.mts.map +0 -1
  69. package/dist/index-BfHfKuKy.d.mts.map +0 -1
  70. package/dist/index-CE53SwpZ.d.mts.map +0 -1
  71. package/dist/index-D6VE-MnJ.d.mts +0 -43
  72. package/dist/index-D6VE-MnJ.d.mts.map +0 -1
  73. package/dist/index-DE4CLElr.d.mts +0 -145
  74. package/dist/index-DE4CLElr.d.mts.map +0 -1
  75. package/dist/index-DlPA26cw.d.mts +0 -91
  76. package/dist/index-DlPA26cw.d.mts.map +0 -1
  77. package/dist/patch-BmRfghOo.mjs.map +0 -1
  78. package/dist/smartart-B7ukZ-Tw.mjs +0 -305
  79. package/dist/smartart-B7ukZ-Tw.mjs.map +0 -1
  80. package/dist/theme-CiNzdl-9.mjs +0 -177
  81. package/dist/theme-CiNzdl-9.mjs.map +0 -1
  82. package/dist/util-Tq9PSjK0.mjs.map +0 -1
  83. package/dist/values-8di32lIe.d.mts.map +0 -1
@@ -0,0 +1,3092 @@
1
+ import { escapeXml, stringifyElement } from "@office-open/xml";
2
+ //#region src/vector/style.ts
3
+ /**
4
+ * Maps VmlShapeStyle property names to their corresponding CSS-style property names.
5
+ * Used internally for converting TypeScript-friendly property names to VML style attributes.
6
+ */
7
+ const styleToKeyMap = {
8
+ flip: "flip",
9
+ height: "height",
10
+ left: "left",
11
+ marginBottom: "margin-bottom",
12
+ marginLeft: "margin-left",
13
+ marginRight: "margin-right",
14
+ marginTop: "margin-top",
15
+ position: "position",
16
+ positionHorizontal: "mso-position-horizontal",
17
+ positionHorizontalRelative: "mso-position-horizontal-relative",
18
+ positionVertical: "mso-position-vertical",
19
+ positionVerticalRelative: "mso-position-vertical-relative",
20
+ rotation: "rotation",
21
+ top: "top",
22
+ visibility: "visibility",
23
+ width: "width",
24
+ wrapDistanceBottom: "mso-wrap-distance-bottom",
25
+ wrapDistanceLeft: "mso-wrap-distance-left",
26
+ wrapDistanceRight: "mso-wrap-distance-right",
27
+ wrapDistanceTop: "mso-wrap-distance-top",
28
+ wrapEdited: "mso-wrap-edited",
29
+ wrapStyle: "mso-wrap-style",
30
+ fitShapeToText: "mso-fit-shape-to-text",
31
+ directionAlt: "mso-direction-alt",
32
+ zIndex: "z-index"
33
+ };
34
+ /**
35
+ * Serialize a VmlShapeStyle object to the VML style attribute value
36
+ * (`"width:100pt;height:50pt"`), translating property names via
37
+ * {@link styleToKeyMap}.
38
+ */
39
+ function stringifyVmlStyle(style) {
40
+ return Object.entries(style).map(([key, value]) => {
41
+ const text = typeof value === "boolean" ? value ? "t" : "f" : String(value);
42
+ return `${styleToKeyMap[key]}:${text}`;
43
+ }).join(";");
44
+ }
45
+ /**
46
+ * Parse a VML style attribute value into a CSS-name-keyed record
47
+ * (`{ "mso-position-horizontal": "absolute", … }`). Keys stay in VML/CSS form;
48
+ * callers read the entries they understand (width/height, wrap distances, …).
49
+ */
50
+ function parseVmlStyle(styleStr) {
51
+ const style = {};
52
+ for (const part of styleStr.split(";")) {
53
+ const [key, val] = part.split(":").map((s) => s.trim());
54
+ if (key && val) style[key] = val;
55
+ }
56
+ return style;
57
+ }
58
+ /** Reverse of {@link styleToKeyMap} — CSS-style property name → VmlShapeStyle field. */
59
+ const keyToStyleMap = Object.fromEntries(Object.entries(styleToKeyMap).map(([field, key]) => [key, field]));
60
+ const NUMERIC = /^-?\d+(\.\d+)?$/;
61
+ /**
62
+ * Parse a CSS-name-keyed style record into a VmlShapeStyle object (camelCase
63
+ * fields, numeric and boolean literals coerced) — the inverse of
64
+ * {@link stringifyVmlStyle}. Keys outside the map are dropped.
65
+ */
66
+ function parseVmlShapeStyle(record) {
67
+ const style = {};
68
+ for (const [key, value] of Object.entries(record)) {
69
+ const field = keyToStyleMap[key];
70
+ if (!field) continue;
71
+ if (field === "wrapEdited" || field === "fitShapeToText") style[field] = value === "t" || value === "true";
72
+ else if (NUMERIC.test(value)) style[field] = Number(value);
73
+ else style[field] = value;
74
+ }
75
+ return style;
76
+ }
77
+ //#endregion
78
+ //#region src/vector/attributes.ts
79
+ /** AG_CoreAttributes — `style` is special-cased (mini-language), not tabulated. */
80
+ const VML_CORE_ATTRS = [
81
+ {
82
+ field: "id",
83
+ attr: "id",
84
+ kind: "string"
85
+ },
86
+ {
87
+ field: "href",
88
+ attr: "href",
89
+ kind: "string"
90
+ },
91
+ {
92
+ field: "target",
93
+ attr: "target",
94
+ kind: "string"
95
+ },
96
+ {
97
+ field: "class",
98
+ attr: "class",
99
+ kind: "string"
100
+ },
101
+ {
102
+ field: "title",
103
+ attr: "title",
104
+ kind: "string"
105
+ },
106
+ {
107
+ field: "alt",
108
+ attr: "alt",
109
+ kind: "string"
110
+ },
111
+ {
112
+ field: "coordsize",
113
+ attr: "coordsize",
114
+ kind: "string"
115
+ },
116
+ {
117
+ field: "coordorigin",
118
+ attr: "coordorigin",
119
+ kind: "string"
120
+ },
121
+ {
122
+ field: "wrapcoords",
123
+ attr: "wrapcoords",
124
+ kind: "string"
125
+ },
126
+ {
127
+ field: "print",
128
+ attr: "print",
129
+ kind: "trueFalse"
130
+ }
131
+ ];
132
+ /** AG_ShapeAttributes. */
133
+ const VML_SHAPE_ATTRS = [
134
+ {
135
+ field: "chromakey",
136
+ attr: "chromakey",
137
+ kind: "string"
138
+ },
139
+ {
140
+ field: "filled",
141
+ attr: "filled",
142
+ kind: "trueFalse"
143
+ },
144
+ {
145
+ field: "fillcolor",
146
+ attr: "fillcolor",
147
+ kind: "string"
148
+ },
149
+ {
150
+ field: "opacity",
151
+ attr: "opacity",
152
+ kind: "string"
153
+ },
154
+ {
155
+ field: "stroked",
156
+ attr: "stroked",
157
+ kind: "trueFalse"
158
+ },
159
+ {
160
+ field: "strokecolor",
161
+ attr: "strokecolor",
162
+ kind: "string"
163
+ },
164
+ {
165
+ field: "strokeweight",
166
+ attr: "strokeweight",
167
+ kind: "string"
168
+ },
169
+ {
170
+ field: "insetpen",
171
+ attr: "insetpen",
172
+ kind: "trueFalse"
173
+ }
174
+ ];
175
+ /** AG_OfficeCoreAttributes — field names mirror the o: attribute names. */
176
+ const VML_OFFICE_CORE_ATTRS = [
177
+ {
178
+ field: "spid",
179
+ attr: "o:spid",
180
+ kind: "string"
181
+ },
182
+ {
183
+ field: "oned",
184
+ attr: "o:oned",
185
+ kind: "trueFalse"
186
+ },
187
+ {
188
+ field: "regroupid",
189
+ attr: "o:regroupid",
190
+ kind: "number"
191
+ },
192
+ {
193
+ field: "doubleclicknotify",
194
+ attr: "o:doubleclicknotify",
195
+ kind: "trueFalse"
196
+ },
197
+ {
198
+ field: "button",
199
+ attr: "o:button",
200
+ kind: "trueFalse"
201
+ },
202
+ {
203
+ field: "userhidden",
204
+ attr: "o:userhidden",
205
+ kind: "trueFalse"
206
+ },
207
+ {
208
+ field: "bullet",
209
+ attr: "o:bullet",
210
+ kind: "trueFalse"
211
+ },
212
+ {
213
+ field: "hr",
214
+ attr: "o:hr",
215
+ kind: "trueFalse"
216
+ },
217
+ {
218
+ field: "hrstd",
219
+ attr: "o:hrstd",
220
+ kind: "trueFalse"
221
+ },
222
+ {
223
+ field: "hrnoshade",
224
+ attr: "o:hrnoshade",
225
+ kind: "trueFalse"
226
+ },
227
+ {
228
+ field: "hrpct",
229
+ attr: "o:hrpct",
230
+ kind: "number"
231
+ },
232
+ {
233
+ field: "hralign",
234
+ attr: "o:hralign",
235
+ kind: "string"
236
+ },
237
+ {
238
+ field: "allowincell",
239
+ attr: "o:allowincell",
240
+ kind: "trueFalse"
241
+ },
242
+ {
243
+ field: "allowoverlap",
244
+ attr: "o:allowoverlap",
245
+ kind: "trueFalse"
246
+ },
247
+ {
248
+ field: "userdrawn",
249
+ attr: "o:userdrawn",
250
+ kind: "trueFalse"
251
+ },
252
+ {
253
+ field: "bordertopcolor",
254
+ attr: "o:bordertopcolor",
255
+ kind: "string"
256
+ },
257
+ {
258
+ field: "borderleftcolor",
259
+ attr: "o:borderleftcolor",
260
+ kind: "string"
261
+ },
262
+ {
263
+ field: "borderbottomcolor",
264
+ attr: "o:borderbottomcolor",
265
+ kind: "string"
266
+ },
267
+ {
268
+ field: "borderrightcolor",
269
+ attr: "o:borderrightcolor",
270
+ kind: "string"
271
+ },
272
+ {
273
+ field: "dgmlayout",
274
+ attr: "o:dgmlayout",
275
+ kind: "string"
276
+ },
277
+ {
278
+ field: "dgmnodekind",
279
+ attr: "o:dgmnodekind",
280
+ kind: "number"
281
+ },
282
+ {
283
+ field: "dgmlayoutmru",
284
+ attr: "o:dgmlayoutmru",
285
+ kind: "string"
286
+ },
287
+ {
288
+ field: "insetmode",
289
+ attr: "o:insetmode",
290
+ kind: "string"
291
+ }
292
+ ];
293
+ /** AG_OfficeShapeAttributes. */
294
+ const VML_OFFICE_SHAPE_ATTRS = [
295
+ {
296
+ field: "spt",
297
+ attr: "o:spt",
298
+ kind: "number"
299
+ },
300
+ {
301
+ field: "connectortype",
302
+ attr: "o:connectortype",
303
+ kind: "string"
304
+ },
305
+ {
306
+ field: "bwmode",
307
+ attr: "o:bwmode",
308
+ kind: "string"
309
+ },
310
+ {
311
+ field: "bwpure",
312
+ attr: "o:bwpure",
313
+ kind: "string"
314
+ },
315
+ {
316
+ field: "bwnormal",
317
+ attr: "o:bwnormal",
318
+ kind: "string"
319
+ },
320
+ {
321
+ field: "forcedash",
322
+ attr: "o:forcedash",
323
+ kind: "trueFalse"
324
+ },
325
+ {
326
+ field: "oleicon",
327
+ attr: "o:oleicon",
328
+ kind: "trueFalse"
329
+ },
330
+ {
331
+ field: "ole",
332
+ attr: "o:ole",
333
+ kind: "string"
334
+ },
335
+ {
336
+ field: "preferrelative",
337
+ attr: "o:preferrelative",
338
+ kind: "trueFalse"
339
+ },
340
+ {
341
+ field: "cliptowrap",
342
+ attr: "o:cliptowrap",
343
+ kind: "trueFalse"
344
+ },
345
+ {
346
+ field: "clip",
347
+ attr: "o:clip",
348
+ kind: "trueFalse"
349
+ }
350
+ ];
351
+ /** s:ST_TrueFalse output form — "t"/"f", the spelling Office itself writes. */
352
+ function stringifyVmlTrueFalse(value) {
353
+ return value ? "t" : "f";
354
+ }
355
+ /** Accepts every ST_TrueFalse input spelling. */
356
+ function parseVmlTrueFalse(value) {
357
+ return value === "t" || value === "true" || value === "1";
358
+ }
359
+ /**
360
+ * Serialize the tabulated fields of `opts` into one attribute string (leading
361
+ * space included when non-empty). The `style` field of
362
+ * {@link VmlCoreAttributes} joins here so callers need a single call.
363
+ */
364
+ function stringifyVmlAttributes(opts, specs) {
365
+ const parts = [];
366
+ for (const spec of specs) {
367
+ const value = opts[spec.field];
368
+ if (value === void 0) continue;
369
+ const text = spec.kind === "trueFalse" ? stringifyVmlTrueFalse(value) : spec.kind === "trueFalseBlank" ? stringifyVmlTrueFalseBlank(value) : spec.kind === "number" ? String(value) : escapeXml(String(value));
370
+ parts.push(`${spec.attr}="${text}"`);
371
+ }
372
+ return parts.length > 0 ? ` ${parts.join(" ")}` : "";
373
+ }
374
+ /** Serialize a boolean-or-empty ST_TrueFalseBlank ("t"/"f"/""). */
375
+ function stringifyVmlTrueFalseBlank(value) {
376
+ return value === "" ? "" : stringifyVmlTrueFalse(value);
377
+ }
378
+ /** Parse a boolean-or-empty ST_TrueFalseBlank. */
379
+ function parseVmlTrueFalseBlank(value) {
380
+ return value === "" ? "" : parseVmlTrueFalse(value);
381
+ }
382
+ /** Inverse of {@link stringifyVmlAttributes} — fills the tabulated fields onto `out`. */
383
+ function parseVmlAttributes(el, specs, out) {
384
+ for (const spec of specs) {
385
+ const raw = el.attributes?.[spec.attr];
386
+ if (raw === void 0) continue;
387
+ out[spec.field] = spec.kind === "trueFalse" ? parseVmlTrueFalse(String(raw)) : spec.kind === "trueFalseBlank" ? parseVmlTrueFalseBlank(String(raw)) : spec.kind === "number" ? Number(raw) : String(raw);
388
+ }
389
+ }
390
+ //#endregion
391
+ //#region src/vector/shape-elements/office-elements.ts
392
+ /** AG_Ext as a spec entry — prepend to every o: element's spec list. */
393
+ const EXT_ATTR = [{
394
+ field: "ext",
395
+ attr: "v:ext",
396
+ kind: "string"
397
+ }];
398
+ const SKEW_ATTRS = [
399
+ {
400
+ field: "id",
401
+ attr: "id",
402
+ kind: "string"
403
+ },
404
+ {
405
+ field: "on",
406
+ attr: "on",
407
+ kind: "trueFalse"
408
+ },
409
+ {
410
+ field: "offset",
411
+ attr: "offset",
412
+ kind: "string"
413
+ },
414
+ {
415
+ field: "origin",
416
+ attr: "origin",
417
+ kind: "string"
418
+ },
419
+ {
420
+ field: "matrix",
421
+ attr: "matrix",
422
+ kind: "string"
423
+ }
424
+ ];
425
+ /** Serialize o:skew. */
426
+ function stringifyVmlSkew(opts) {
427
+ return `<o:skew${stringifyVmlAttributes(opts, [...EXT_ATTR, ...SKEW_ATTRS])}/>`;
428
+ }
429
+ /** Parse an o:skew element. */
430
+ function parseVmlSkew(el) {
431
+ const out = {};
432
+ parseVmlAttributes(el, [...EXT_ATTR, ...SKEW_ATTRS], out);
433
+ return out;
434
+ }
435
+ const EXTRUSION_ATTRS = [
436
+ {
437
+ field: "on",
438
+ attr: "on",
439
+ kind: "trueFalse"
440
+ },
441
+ {
442
+ field: "type",
443
+ attr: "type",
444
+ kind: "string"
445
+ },
446
+ {
447
+ field: "render",
448
+ attr: "render",
449
+ kind: "string"
450
+ },
451
+ {
452
+ field: "viewpointorigin",
453
+ attr: "viewpointorigin",
454
+ kind: "string"
455
+ },
456
+ {
457
+ field: "viewpoint",
458
+ attr: "viewpoint",
459
+ kind: "string"
460
+ },
461
+ {
462
+ field: "plane",
463
+ attr: "plane",
464
+ kind: "string"
465
+ },
466
+ {
467
+ field: "skewangle",
468
+ attr: "skewangle",
469
+ kind: "number"
470
+ },
471
+ {
472
+ field: "skewamt",
473
+ attr: "skewamt",
474
+ kind: "string"
475
+ },
476
+ {
477
+ field: "foredepth",
478
+ attr: "foredepth",
479
+ kind: "string"
480
+ },
481
+ {
482
+ field: "backdepth",
483
+ attr: "backdepth",
484
+ kind: "string"
485
+ },
486
+ {
487
+ field: "orientation",
488
+ attr: "orientation",
489
+ kind: "string"
490
+ },
491
+ {
492
+ field: "orientationangle",
493
+ attr: "orientationangle",
494
+ kind: "number"
495
+ },
496
+ {
497
+ field: "lockrotationcenter",
498
+ attr: "lockrotationcenter",
499
+ kind: "trueFalse"
500
+ },
501
+ {
502
+ field: "autorotationcenter",
503
+ attr: "autorotationcenter",
504
+ kind: "trueFalse"
505
+ },
506
+ {
507
+ field: "rotationcenter",
508
+ attr: "rotationcenter",
509
+ kind: "string"
510
+ },
511
+ {
512
+ field: "rotationangle",
513
+ attr: "rotationangle",
514
+ kind: "string"
515
+ },
516
+ {
517
+ field: "colormode",
518
+ attr: "colormode",
519
+ kind: "string"
520
+ },
521
+ {
522
+ field: "color",
523
+ attr: "color",
524
+ kind: "string"
525
+ },
526
+ {
527
+ field: "shininess",
528
+ attr: "shininess",
529
+ kind: "number"
530
+ },
531
+ {
532
+ field: "specularity",
533
+ attr: "specularity",
534
+ kind: "string"
535
+ },
536
+ {
537
+ field: "diffusity",
538
+ attr: "diffusity",
539
+ kind: "string"
540
+ },
541
+ {
542
+ field: "metal",
543
+ attr: "metal",
544
+ kind: "trueFalse"
545
+ },
546
+ {
547
+ field: "edge",
548
+ attr: "edge",
549
+ kind: "string"
550
+ },
551
+ {
552
+ field: "facet",
553
+ attr: "facet",
554
+ kind: "string"
555
+ },
556
+ {
557
+ field: "lightface",
558
+ attr: "lightface",
559
+ kind: "trueFalse"
560
+ },
561
+ {
562
+ field: "brightness",
563
+ attr: "brightness",
564
+ kind: "string"
565
+ },
566
+ {
567
+ field: "lightposition",
568
+ attr: "lightposition",
569
+ kind: "string"
570
+ },
571
+ {
572
+ field: "lightlevel",
573
+ attr: "lightlevel",
574
+ kind: "string"
575
+ },
576
+ {
577
+ field: "lightharsh",
578
+ attr: "lightharsh",
579
+ kind: "trueFalse"
580
+ },
581
+ {
582
+ field: "lightposition2",
583
+ attr: "lightposition2",
584
+ kind: "string"
585
+ },
586
+ {
587
+ field: "lightlevel2",
588
+ attr: "lightlevel2",
589
+ kind: "string"
590
+ },
591
+ {
592
+ field: "lightharsh2",
593
+ attr: "lightharsh2",
594
+ kind: "trueFalse"
595
+ }
596
+ ];
597
+ /** Serialize o:extrusion. */
598
+ function stringifyVmlExtrusion(opts) {
599
+ return `<o:extrusion${stringifyVmlAttributes(opts, [...EXT_ATTR, ...EXTRUSION_ATTRS])}/>`;
600
+ }
601
+ /** Parse an o:extrusion element. */
602
+ function parseVmlExtrusion(el) {
603
+ const out = {};
604
+ parseVmlAttributes(el, [...EXT_ATTR, ...EXTRUSION_ATTRS], out);
605
+ return out;
606
+ }
607
+ const CALLOUT_ATTRS = [
608
+ {
609
+ field: "on",
610
+ attr: "on",
611
+ kind: "trueFalse"
612
+ },
613
+ {
614
+ field: "type",
615
+ attr: "type",
616
+ kind: "string"
617
+ },
618
+ {
619
+ field: "gap",
620
+ attr: "gap",
621
+ kind: "string"
622
+ },
623
+ {
624
+ field: "angle",
625
+ attr: "angle",
626
+ kind: "string"
627
+ },
628
+ {
629
+ field: "dropauto",
630
+ attr: "dropauto",
631
+ kind: "trueFalse"
632
+ },
633
+ {
634
+ field: "drop",
635
+ attr: "drop",
636
+ kind: "string"
637
+ },
638
+ {
639
+ field: "distance",
640
+ attr: "distance",
641
+ kind: "string"
642
+ },
643
+ {
644
+ field: "lengthspecified",
645
+ attr: "lengthspecified",
646
+ kind: "trueFalse"
647
+ },
648
+ {
649
+ field: "length",
650
+ attr: "length",
651
+ kind: "string"
652
+ },
653
+ {
654
+ field: "accentbar",
655
+ attr: "accentbar",
656
+ kind: "trueFalse"
657
+ },
658
+ {
659
+ field: "textborder",
660
+ attr: "textborder",
661
+ kind: "trueFalse"
662
+ },
663
+ {
664
+ field: "minusx",
665
+ attr: "minusx",
666
+ kind: "trueFalse"
667
+ },
668
+ {
669
+ field: "minusy",
670
+ attr: "minusy",
671
+ kind: "trueFalse"
672
+ }
673
+ ];
674
+ /** Serialize o:callout. */
675
+ function stringifyVmlCallout(opts) {
676
+ return `<o:callout${stringifyVmlAttributes(opts, [...EXT_ATTR, ...CALLOUT_ATTRS])}/>`;
677
+ }
678
+ /** Parse an o:callout element. */
679
+ function parseVmlCallout(el) {
680
+ const out = {};
681
+ parseVmlAttributes(el, [...EXT_ATTR, ...CALLOUT_ATTRS], out);
682
+ return out;
683
+ }
684
+ const LOCK_ATTRS = [
685
+ {
686
+ field: "position",
687
+ attr: "position",
688
+ kind: "trueFalse"
689
+ },
690
+ {
691
+ field: "selection",
692
+ attr: "selection",
693
+ kind: "trueFalse"
694
+ },
695
+ {
696
+ field: "grouping",
697
+ attr: "grouping",
698
+ kind: "trueFalse"
699
+ },
700
+ {
701
+ field: "ungrouping",
702
+ attr: "ungrouping",
703
+ kind: "trueFalse"
704
+ },
705
+ {
706
+ field: "rotation",
707
+ attr: "rotation",
708
+ kind: "trueFalse"
709
+ },
710
+ {
711
+ field: "cropping",
712
+ attr: "cropping",
713
+ kind: "trueFalse"
714
+ },
715
+ {
716
+ field: "verticies",
717
+ attr: "verticies",
718
+ kind: "trueFalse"
719
+ },
720
+ {
721
+ field: "adjusthandles",
722
+ attr: "adjusthandles",
723
+ kind: "trueFalse"
724
+ },
725
+ {
726
+ field: "text",
727
+ attr: "text",
728
+ kind: "trueFalse"
729
+ },
730
+ {
731
+ field: "aspectratio",
732
+ attr: "aspectratio",
733
+ kind: "trueFalse"
734
+ },
735
+ {
736
+ field: "shapetype",
737
+ attr: "shapetype",
738
+ kind: "trueFalse"
739
+ }
740
+ ];
741
+ /** Serialize o:lock. */
742
+ function stringifyVmlLock(opts) {
743
+ return `<o:lock${stringifyVmlAttributes(opts, [...EXT_ATTR, ...LOCK_ATTRS])}/>`;
744
+ }
745
+ /** Parse an o:lock element. */
746
+ function parseVmlLock(el) {
747
+ const out = {};
748
+ parseVmlAttributes(el, [...EXT_ATTR, ...LOCK_ATTRS], out);
749
+ return out;
750
+ }
751
+ /** Serialize o:clippath. */
752
+ function stringifyVmlClipPath(opts) {
753
+ return `<o:clippath v:v="${escapeXml(opts.v)}"/>`;
754
+ }
755
+ /** Parse an o:clippath element. */
756
+ function parseVmlClipPath(el) {
757
+ return { v: String(el.attributes?.["v:v"] ?? "") };
758
+ }
759
+ const SIGNATURE_ATTRS = [
760
+ {
761
+ field: "issignatureline",
762
+ attr: "issignatureline",
763
+ kind: "trueFalse"
764
+ },
765
+ {
766
+ field: "id",
767
+ attr: "id",
768
+ kind: "string"
769
+ },
770
+ {
771
+ field: "provid",
772
+ attr: "provid",
773
+ kind: "string"
774
+ },
775
+ {
776
+ field: "signinginstructionsset",
777
+ attr: "signinginstructionsset",
778
+ kind: "trueFalse"
779
+ },
780
+ {
781
+ field: "allowcomments",
782
+ attr: "allowcomments",
783
+ kind: "trueFalse"
784
+ },
785
+ {
786
+ field: "showsigndate",
787
+ attr: "showsigndate",
788
+ kind: "trueFalse"
789
+ },
790
+ {
791
+ field: "suggestedsigner",
792
+ attr: "o:suggestedsigner",
793
+ kind: "string"
794
+ },
795
+ {
796
+ field: "suggestedsigner2",
797
+ attr: "o:suggestedsigner2",
798
+ kind: "string"
799
+ },
800
+ {
801
+ field: "suggestedsigneremail",
802
+ attr: "o:suggestedsigneremail",
803
+ kind: "string"
804
+ },
805
+ {
806
+ field: "signinginstructions",
807
+ attr: "signinginstructions",
808
+ kind: "string"
809
+ },
810
+ {
811
+ field: "addlxml",
812
+ attr: "addlxml",
813
+ kind: "string"
814
+ },
815
+ {
816
+ field: "sigprovurl",
817
+ attr: "sigprovurl",
818
+ kind: "string"
819
+ }
820
+ ];
821
+ /** Serialize o:signatureline. */
822
+ function stringifyVmlSignatureLine(opts) {
823
+ return `<o:signatureline${stringifyVmlAttributes(opts, [...EXT_ATTR, ...SIGNATURE_ATTRS])}/>`;
824
+ }
825
+ /** Parse an o:signatureline element. */
826
+ function parseVmlSignatureLine(el) {
827
+ const out = {};
828
+ parseVmlAttributes(el, [...EXT_ATTR, ...SIGNATURE_ATTRS], out);
829
+ return out;
830
+ }
831
+ /** Serialize o:ink (hand-written — `i` is required, so no table-driven cast). */
832
+ function stringifyVmlInk(opts) {
833
+ const attrs = [`i="${escapeXml(opts.i)}"`];
834
+ if (opts.annotation !== void 0) attrs.push(`annotation="${stringifyVmlTrueFalse(opts.annotation)}"`);
835
+ if (opts.contentType !== void 0) attrs.push(`contentType="${escapeXml(opts.contentType)}"`);
836
+ return `<o:ink ${attrs.join(" ")}/>`;
837
+ }
838
+ /** Parse an o:ink element. */
839
+ function parseVmlInk(el) {
840
+ const out = { i: String(el.attributes?.i ?? "") };
841
+ if (el.attributes?.annotation !== void 0) out.annotation = parseVmlTrueFalse(String(el.attributes.annotation));
842
+ if (el.attributes?.contentType !== void 0) out.contentType = String(el.attributes.contentType);
843
+ return out;
844
+ }
845
+ /** Serialize o:equationxml. */
846
+ function stringifyVmlEquationXml(opts) {
847
+ return `<o:equationxml${opts.contentType !== void 0 ? ` contentType="${escapeXml(opts.contentType)}"` : ""}>${opts.content ?? ""}</o:equationxml>`;
848
+ }
849
+ /** Parse an o:equationxml element. */
850
+ function parseVmlEquationXml(el) {
851
+ const out = {};
852
+ const contentType = el.attributes?.contentType;
853
+ if (contentType !== void 0) out.contentType = String(contentType);
854
+ if ((el.elements ?? []).length > 0) {
855
+ const child = el.elements.find((c) => c.type === "element");
856
+ if (child) out.content = stringifyElement(child);
857
+ }
858
+ return out;
859
+ }
860
+ const RELATION_ATTRS = [
861
+ {
862
+ field: "idsrc",
863
+ attr: "idsrc",
864
+ kind: "string"
865
+ },
866
+ {
867
+ field: "iddest",
868
+ attr: "iddest",
869
+ kind: "string"
870
+ },
871
+ {
872
+ field: "idcntr",
873
+ attr: "idcntr",
874
+ kind: "string"
875
+ }
876
+ ];
877
+ const DIAGRAM_ATTRS = [
878
+ {
879
+ field: "dgmstyle",
880
+ attr: "dgmstyle",
881
+ kind: "number"
882
+ },
883
+ {
884
+ field: "autoformat",
885
+ attr: "autoformat",
886
+ kind: "trueFalse"
887
+ },
888
+ {
889
+ field: "reverse",
890
+ attr: "reverse",
891
+ kind: "trueFalse"
892
+ },
893
+ {
894
+ field: "autolayout",
895
+ attr: "autolayout",
896
+ kind: "trueFalse"
897
+ },
898
+ {
899
+ field: "dgmscalex",
900
+ attr: "dgmscalex",
901
+ kind: "number"
902
+ },
903
+ {
904
+ field: "dgmscaley",
905
+ attr: "dgmscaley",
906
+ kind: "number"
907
+ },
908
+ {
909
+ field: "dgmfontsize",
910
+ attr: "dgmfontsize",
911
+ kind: "number"
912
+ },
913
+ {
914
+ field: "constrainbounds",
915
+ attr: "constrainbounds",
916
+ kind: "string"
917
+ },
918
+ {
919
+ field: "dgmbasetextscale",
920
+ attr: "dgmbasetextscale",
921
+ kind: "number"
922
+ }
923
+ ];
924
+ /** Serialize o:diagram. */
925
+ function stringifyVmlDiagram(opts) {
926
+ const relations = (opts.relations ?? []).map((rel) => `<o:rel${stringifyVmlAttributes(rel, [...EXT_ATTR, ...RELATION_ATTRS])}/>`).join("");
927
+ const children = relations !== "" ? `<o:relationtable>${relations}</o:relationtable>` : "";
928
+ return `<o:diagram${stringifyVmlAttributes(opts, [...EXT_ATTR, ...DIAGRAM_ATTRS])}>${children}</o:diagram>`;
929
+ }
930
+ /** Parse an o:diagram element. */
931
+ function parseVmlDiagram(el) {
932
+ const out = {};
933
+ parseVmlAttributes(el, [...EXT_ATTR, ...DIAGRAM_ATTRS], out);
934
+ const relationTable = (el.elements ?? []).find((c) => c.type === "element" && c.name === "o:relationtable");
935
+ if (relationTable) {
936
+ const relations = [];
937
+ for (const child of relationTable.elements ?? []) if (child.type === "element" && child.name === "o:rel") {
938
+ const rel = {};
939
+ parseVmlAttributes(child, [...EXT_ATTR, ...RELATION_ATTRS], rel);
940
+ relations.push(rel);
941
+ }
942
+ if (relations.length > 0) out.relations = relations;
943
+ }
944
+ return out;
945
+ }
946
+ /** Serialize o:complex. */
947
+ function stringifyVmlComplex(opts) {
948
+ return `<o:complex${stringifyVmlAttributes(opts, EXT_ATTR)}/>`;
949
+ }
950
+ /** Parse an o:complex element. */
951
+ function parseVmlComplex(el) {
952
+ const out = {};
953
+ parseVmlAttributes(el, EXT_ATTR, out);
954
+ return out;
955
+ }
956
+ /** Serialize o:fill. */
957
+ function stringifyVmlOfficeFill(opts) {
958
+ return `<o:fill${stringifyVmlAttributes(opts, EXT_ATTR)}${opts.type !== void 0 ? ` type="${opts.type}"` : ""}/>`;
959
+ }
960
+ /** Parse an o:fill element. */
961
+ function parseVmlOfficeFill(el) {
962
+ const out = {};
963
+ parseVmlAttributes(el, EXT_ATTR, out);
964
+ if (el.attributes?.type !== void 0) out.type = String(el.attributes.type);
965
+ return out;
966
+ }
967
+ const OLE_OBJECT_ATTRS = [
968
+ {
969
+ field: "Type",
970
+ attr: "Type",
971
+ kind: "string"
972
+ },
973
+ {
974
+ field: "ProgID",
975
+ attr: "ProgID",
976
+ kind: "string"
977
+ },
978
+ {
979
+ field: "ShapeID",
980
+ attr: "ShapeID",
981
+ kind: "string"
982
+ },
983
+ {
984
+ field: "DrawAspect",
985
+ attr: "DrawAspect",
986
+ kind: "string"
987
+ },
988
+ {
989
+ field: "ObjectID",
990
+ attr: "ObjectID",
991
+ kind: "string"
992
+ },
993
+ {
994
+ field: "relationshipId",
995
+ attr: "r:id",
996
+ kind: "string"
997
+ },
998
+ {
999
+ field: "UpdateMode",
1000
+ attr: "UpdateMode",
1001
+ kind: "string"
1002
+ }
1003
+ ];
1004
+ /** Serialize o:OLEObject. */
1005
+ function stringifyVmlOleObject(opts) {
1006
+ const children = [];
1007
+ if (opts.linkType !== void 0) children.push(`<o:LinkType>${escapeXml(opts.linkType)}</o:LinkType>`);
1008
+ if (opts.lockedField !== void 0) children.push(`<o:LockedField>${stringifyVmlTrueFalseBlank(opts.lockedField)}</o:LockedField>`);
1009
+ if (opts.fieldCodes !== void 0) children.push(`<o:FieldCodes>${escapeXml(opts.fieldCodes)}</o:FieldCodes>`);
1010
+ const attrStr = stringifyVmlAttributes(opts, OLE_OBJECT_ATTRS);
1011
+ return children.length > 0 ? `<o:OLEObject${attrStr}>${children.join("")}</o:OLEObject>` : `<o:OLEObject${attrStr}/>`;
1012
+ }
1013
+ /** Read the concatenated text content of an element (LinkType/FieldCodes children). */
1014
+ function elementText(el) {
1015
+ return (el.elements ?? []).map((child) => String(child.text ?? "")).join("");
1016
+ }
1017
+ /** Parse an o:OLEObject element. */
1018
+ function parseVmlOleObject(el) {
1019
+ const out = {};
1020
+ parseVmlAttributes(el, OLE_OBJECT_ATTRS, out);
1021
+ for (const child of el.elements ?? []) {
1022
+ if (child.type !== "element") continue;
1023
+ if (child.name === "o:LinkType") out.linkType = elementText(child);
1024
+ else if (child.name === "o:LockedField") out.lockedField = parseVmlTrueFalseBlank(elementText(child));
1025
+ else if (child.name === "o:FieldCodes") out.fieldCodes = elementText(child);
1026
+ }
1027
+ return out;
1028
+ }
1029
+ //#endregion
1030
+ //#region src/vector/shape-elements/client-data.ts
1031
+ const TRUE_FALSE_BLANK_FIELDS = [
1032
+ "MoveWithCells",
1033
+ "SizeWithCells",
1034
+ "Locked",
1035
+ "DefaultSize",
1036
+ "PrintObject",
1037
+ "Disabled",
1038
+ "AutoFill",
1039
+ "AutoLine",
1040
+ "AutoPict",
1041
+ "LockText",
1042
+ "JustLastX",
1043
+ "SecretEdit",
1044
+ "Default",
1045
+ "Help",
1046
+ "Cancel",
1047
+ "Dismiss",
1048
+ "Visible",
1049
+ "RowHidden",
1050
+ "ColHidden",
1051
+ "MultiLine",
1052
+ "VScroll",
1053
+ "ValidIds",
1054
+ "NoThreeD2",
1055
+ "Colored",
1056
+ "NoThreeD",
1057
+ "FirstButton",
1058
+ "Horiz",
1059
+ "MapOCX",
1060
+ "Camera",
1061
+ "RecalcAlways",
1062
+ "AutoScale",
1063
+ "DDE",
1064
+ "UIObj"
1065
+ ];
1066
+ const INTEGER_FIELDS = [
1067
+ "Accel",
1068
+ "Accel2",
1069
+ "Row",
1070
+ "Column",
1071
+ "VTEdit",
1072
+ "WidthMin",
1073
+ "Sel",
1074
+ "DropLines",
1075
+ "Checked",
1076
+ "Val",
1077
+ "Min",
1078
+ "Max",
1079
+ "Inc",
1080
+ "Page",
1081
+ "Dx",
1082
+ "ScriptLanguage",
1083
+ "ScriptLocation"
1084
+ ];
1085
+ const STRING_FIELDS = [
1086
+ "Anchor",
1087
+ "FmlaMacro",
1088
+ "TextHAlign",
1089
+ "TextVAlign",
1090
+ "FmlaRange",
1091
+ "SelType",
1092
+ "MultiSel",
1093
+ "LCT",
1094
+ "ListItem",
1095
+ "DropStyle",
1096
+ "FmlaLink",
1097
+ "FmlaPict",
1098
+ "FmlaGroup",
1099
+ "ScriptText",
1100
+ "ScriptExtended",
1101
+ "FmlaTxbx",
1102
+ "CF"
1103
+ ];
1104
+ /** Serialize x:ClientData. */
1105
+ function stringifyVmlClientData(opts) {
1106
+ const children = [];
1107
+ for (const field of TRUE_FALSE_BLANK_FIELDS) {
1108
+ const value = opts[field];
1109
+ if (value !== void 0) children.push(`<x:${field}>${stringifyVmlTrueFalseBlank(value)}</x:${field}>`);
1110
+ }
1111
+ for (const field of INTEGER_FIELDS) {
1112
+ const value = opts[field];
1113
+ if (value !== void 0) children.push(`<x:${field}>${value}</x:${field}>`);
1114
+ }
1115
+ for (const field of STRING_FIELDS) {
1116
+ const value = opts[field];
1117
+ if (value !== void 0) children.push(`<x:${field}>${escapeXml(value)}</x:${field}>`);
1118
+ }
1119
+ return `<x:ClientData ObjectType="${opts.objectType}">${children.join("")}</x:ClientData>`;
1120
+ }
1121
+ /** Parse an x:ClientData element. */
1122
+ function parseVmlClientData(el) {
1123
+ const out = { objectType: String(el.attributes?.ObjectType ?? "") };
1124
+ const tfbFields = new Set(TRUE_FALSE_BLANK_FIELDS);
1125
+ const intFields = new Set(INTEGER_FIELDS);
1126
+ const extras = {};
1127
+ for (const child of el.elements ?? []) {
1128
+ if (child.type !== "element") continue;
1129
+ const local = child.name?.startsWith("x:") ? child.name.slice(2) : null;
1130
+ if (local === null) continue;
1131
+ const text = (child.elements ?? []).map((c) => String(c.text ?? "")).join("");
1132
+ if (tfbFields.has(local)) extras[local] = parseVmlTrueFalseBlank(text);
1133
+ else if (intFields.has(local)) extras[local] = Number(text);
1134
+ else if (STRING_FIELDS.includes(local)) extras[local] = text;
1135
+ }
1136
+ return Object.assign(out, extras);
1137
+ }
1138
+ //#endregion
1139
+ //#region src/vector/shape-elements/fill.ts
1140
+ const FILL_ATTRS = [
1141
+ {
1142
+ field: "id",
1143
+ attr: "id",
1144
+ kind: "string"
1145
+ },
1146
+ {
1147
+ field: "type",
1148
+ attr: "type",
1149
+ kind: "string"
1150
+ },
1151
+ {
1152
+ field: "on",
1153
+ attr: "on",
1154
+ kind: "trueFalse"
1155
+ },
1156
+ {
1157
+ field: "color",
1158
+ attr: "color",
1159
+ kind: "string"
1160
+ },
1161
+ {
1162
+ field: "opacity",
1163
+ attr: "opacity",
1164
+ kind: "string"
1165
+ },
1166
+ {
1167
+ field: "color2",
1168
+ attr: "color2",
1169
+ kind: "string"
1170
+ },
1171
+ {
1172
+ field: "src",
1173
+ attr: "src",
1174
+ kind: "string"
1175
+ },
1176
+ {
1177
+ field: "size",
1178
+ attr: "size",
1179
+ kind: "string"
1180
+ },
1181
+ {
1182
+ field: "origin",
1183
+ attr: "origin",
1184
+ kind: "string"
1185
+ },
1186
+ {
1187
+ field: "position",
1188
+ attr: "position",
1189
+ kind: "string"
1190
+ },
1191
+ {
1192
+ field: "aspect",
1193
+ attr: "aspect",
1194
+ kind: "string"
1195
+ },
1196
+ {
1197
+ field: "colors",
1198
+ attr: "colors",
1199
+ kind: "string"
1200
+ },
1201
+ {
1202
+ field: "angle",
1203
+ attr: "angle",
1204
+ kind: "number"
1205
+ },
1206
+ {
1207
+ field: "alignshape",
1208
+ attr: "alignshape",
1209
+ kind: "trueFalse"
1210
+ },
1211
+ {
1212
+ field: "focus",
1213
+ attr: "focus",
1214
+ kind: "string"
1215
+ },
1216
+ {
1217
+ field: "focussize",
1218
+ attr: "focussize",
1219
+ kind: "string"
1220
+ },
1221
+ {
1222
+ field: "focusposition",
1223
+ attr: "focusposition",
1224
+ kind: "string"
1225
+ },
1226
+ {
1227
+ field: "method",
1228
+ attr: "method",
1229
+ kind: "string"
1230
+ },
1231
+ {
1232
+ field: "recolor",
1233
+ attr: "recolor",
1234
+ kind: "trueFalse"
1235
+ },
1236
+ {
1237
+ field: "rotate",
1238
+ attr: "rotate",
1239
+ kind: "trueFalse"
1240
+ },
1241
+ {
1242
+ field: "relationshipId",
1243
+ attr: "r:id",
1244
+ kind: "string"
1245
+ },
1246
+ {
1247
+ field: "officeHref",
1248
+ attr: "o:href",
1249
+ kind: "string"
1250
+ },
1251
+ {
1252
+ field: "officeAltHref",
1253
+ attr: "o:althref",
1254
+ kind: "string"
1255
+ },
1256
+ {
1257
+ field: "detectmouseclick",
1258
+ attr: "o:detectmouseclick",
1259
+ kind: "trueFalse"
1260
+ },
1261
+ {
1262
+ field: "officeTitle",
1263
+ attr: "o:title",
1264
+ kind: "string"
1265
+ },
1266
+ {
1267
+ field: "opacity2",
1268
+ attr: "o:opacity2",
1269
+ kind: "string"
1270
+ },
1271
+ {
1272
+ field: "officeRelationshipId",
1273
+ attr: "o:relid",
1274
+ kind: "string"
1275
+ }
1276
+ ];
1277
+ /** Serialize v:fill. */
1278
+ function stringifyVmlFill(opts) {
1279
+ const child = opts.officeFill !== void 0 ? stringifyVmlOfficeFill(opts.officeFill) : "";
1280
+ const attrStr = stringifyVmlAttributes(opts, FILL_ATTRS);
1281
+ return child !== "" ? `<v:fill${attrStr}>${child}</v:fill>` : `<v:fill${attrStr}/>`;
1282
+ }
1283
+ /** Parse a v:fill element. */
1284
+ function parseVmlFill(el) {
1285
+ const out = {};
1286
+ parseVmlAttributes(el, FILL_ATTRS, out);
1287
+ for (const child of el.elements ?? []) if (child.type === "element" && child.name === "o:fill") {
1288
+ out.officeFill = parseVmlOfficeFill(child);
1289
+ break;
1290
+ }
1291
+ return out;
1292
+ }
1293
+ //#endregion
1294
+ //#region src/vector/shape-elements/formulas.ts
1295
+ /** Serialize v:formulas. */
1296
+ function stringifyVmlFormulas(opts) {
1297
+ return `<v:formulas>${(opts.equations ?? []).map((eqn) => `<v:f eqn="${escapeXml(eqn)}"/>`).join("")}</v:formulas>`;
1298
+ }
1299
+ /** Parse a v:formulas element. */
1300
+ function parseVmlFormulas(el) {
1301
+ const equations = [];
1302
+ for (const child of el.elements ?? []) if (child.type === "element" && child.name === "v:f") {
1303
+ const eqn = child.attributes?.eqn;
1304
+ if (eqn !== void 0) equations.push(String(eqn));
1305
+ }
1306
+ return equations.length > 0 ? { equations } : {};
1307
+ }
1308
+ //#endregion
1309
+ //#region src/vector/shape-elements/handles.ts
1310
+ const HANDLE_STRING_FIELDS = [
1311
+ "position",
1312
+ "polar",
1313
+ "map",
1314
+ "xrange",
1315
+ "yrange",
1316
+ "radiusrange"
1317
+ ];
1318
+ const HANDLE_BOOLEAN_FIELDS = [
1319
+ "invx",
1320
+ "invy",
1321
+ "switch"
1322
+ ];
1323
+ /** Serialize v:handles. */
1324
+ function stringifyVmlHandles(opts) {
1325
+ return `<v:handles>${(opts.handles ?? []).map((handle) => {
1326
+ const attrs = [];
1327
+ for (const field of HANDLE_STRING_FIELDS) {
1328
+ const value = handle[field];
1329
+ if (value !== void 0) attrs.push(`${field}="${escapeXml(value)}"`);
1330
+ }
1331
+ for (const field of HANDLE_BOOLEAN_FIELDS) {
1332
+ const value = handle[field];
1333
+ if (value !== void 0) attrs.push(`${field}="${stringifyVmlTrueFalse(value)}"`);
1334
+ }
1335
+ return `<v:h${attrs.length > 0 ? ` ${attrs.join(" ")}` : ""}/>`;
1336
+ }).join("")}</v:handles>`;
1337
+ }
1338
+ /** Parse a v:handles element. */
1339
+ function parseVmlHandles(el) {
1340
+ const handles = [];
1341
+ for (const child of el.elements ?? []) {
1342
+ if (child.type !== "element" || child.name !== "v:h") continue;
1343
+ const handle = {};
1344
+ const attrs = child.attributes ?? {};
1345
+ for (const field of HANDLE_STRING_FIELDS) {
1346
+ const raw = attrs[field];
1347
+ if (raw !== void 0) handle[field] = String(raw);
1348
+ }
1349
+ for (const field of HANDLE_BOOLEAN_FIELDS) {
1350
+ const raw = attrs[field];
1351
+ if (raw !== void 0) handle[field] = parseVmlTrueFalse(String(raw));
1352
+ }
1353
+ handles.push(handle);
1354
+ }
1355
+ return handles.length > 0 ? { handles } : {};
1356
+ }
1357
+ //#endregion
1358
+ //#region src/vector/shape-elements/imagedata.ts
1359
+ const IMAGEDATA_ATTRS = [
1360
+ {
1361
+ field: "id",
1362
+ attr: "id",
1363
+ kind: "string"
1364
+ },
1365
+ {
1366
+ field: "src",
1367
+ attr: "src",
1368
+ kind: "string"
1369
+ },
1370
+ {
1371
+ field: "cropleft",
1372
+ attr: "cropleft",
1373
+ kind: "string"
1374
+ },
1375
+ {
1376
+ field: "croptop",
1377
+ attr: "croptop",
1378
+ kind: "string"
1379
+ },
1380
+ {
1381
+ field: "cropright",
1382
+ attr: "cropright",
1383
+ kind: "string"
1384
+ },
1385
+ {
1386
+ field: "cropbottom",
1387
+ attr: "cropbottom",
1388
+ kind: "string"
1389
+ },
1390
+ {
1391
+ field: "gain",
1392
+ attr: "gain",
1393
+ kind: "string"
1394
+ },
1395
+ {
1396
+ field: "blacklevel",
1397
+ attr: "blacklevel",
1398
+ kind: "string"
1399
+ },
1400
+ {
1401
+ field: "gamma",
1402
+ attr: "gamma",
1403
+ kind: "string"
1404
+ },
1405
+ {
1406
+ field: "grayscale",
1407
+ attr: "grayscale",
1408
+ kind: "trueFalse"
1409
+ },
1410
+ {
1411
+ field: "bilevel",
1412
+ attr: "bilevel",
1413
+ kind: "trueFalse"
1414
+ },
1415
+ {
1416
+ field: "chromakey",
1417
+ attr: "chromakey",
1418
+ kind: "string"
1419
+ },
1420
+ {
1421
+ field: "embosscolor",
1422
+ attr: "embosscolor",
1423
+ kind: "string"
1424
+ },
1425
+ {
1426
+ field: "recolortarget",
1427
+ attr: "recolortarget",
1428
+ kind: "string"
1429
+ },
1430
+ {
1431
+ field: "relationshipId",
1432
+ attr: "r:id",
1433
+ kind: "string"
1434
+ },
1435
+ {
1436
+ field: "pictRelationshipId",
1437
+ attr: "r:pict",
1438
+ kind: "string"
1439
+ },
1440
+ {
1441
+ field: "hrefRelationshipId",
1442
+ attr: "r:href",
1443
+ kind: "string"
1444
+ },
1445
+ {
1446
+ field: "officeHref",
1447
+ attr: "o:href",
1448
+ kind: "string"
1449
+ },
1450
+ {
1451
+ field: "officeAltHref",
1452
+ attr: "o:althref",
1453
+ kind: "string"
1454
+ },
1455
+ {
1456
+ field: "officeTitle",
1457
+ attr: "o:title",
1458
+ kind: "string"
1459
+ },
1460
+ {
1461
+ field: "oleid",
1462
+ attr: "o:oleid",
1463
+ kind: "number"
1464
+ },
1465
+ {
1466
+ field: "detectmouseclick",
1467
+ attr: "o:detectmouseclick",
1468
+ kind: "trueFalse"
1469
+ },
1470
+ {
1471
+ field: "movie",
1472
+ attr: "o:movie",
1473
+ kind: "number"
1474
+ },
1475
+ {
1476
+ field: "officeRelationshipId",
1477
+ attr: "o:relid",
1478
+ kind: "string"
1479
+ }
1480
+ ];
1481
+ /** Serialize v:imagedata. */
1482
+ function stringifyVmlImageData(opts) {
1483
+ return `<v:imagedata${stringifyVmlAttributes(opts, IMAGEDATA_ATTRS)}/>`;
1484
+ }
1485
+ /** Parse a v:imagedata element. */
1486
+ function parseVmlImageData(el) {
1487
+ const out = {};
1488
+ parseVmlAttributes(el, IMAGEDATA_ATTRS, out);
1489
+ return out;
1490
+ }
1491
+ //#endregion
1492
+ //#region src/vector/shape-elements/path.ts
1493
+ const PATH_ATTRS = [
1494
+ {
1495
+ field: "id",
1496
+ attr: "id",
1497
+ kind: "string"
1498
+ },
1499
+ {
1500
+ field: "v",
1501
+ attr: "v",
1502
+ kind: "string"
1503
+ },
1504
+ {
1505
+ field: "limo",
1506
+ attr: "limo",
1507
+ kind: "string"
1508
+ },
1509
+ {
1510
+ field: "textboxrect",
1511
+ attr: "textboxrect",
1512
+ kind: "string"
1513
+ },
1514
+ {
1515
+ field: "fillok",
1516
+ attr: "fillok",
1517
+ kind: "trueFalse"
1518
+ },
1519
+ {
1520
+ field: "strokeok",
1521
+ attr: "strokeok",
1522
+ kind: "trueFalse"
1523
+ },
1524
+ {
1525
+ field: "shadowok",
1526
+ attr: "shadowok",
1527
+ kind: "trueFalse"
1528
+ },
1529
+ {
1530
+ field: "arrowok",
1531
+ attr: "arrowok",
1532
+ kind: "trueFalse"
1533
+ },
1534
+ {
1535
+ field: "gradientshapeok",
1536
+ attr: "gradientshapeok",
1537
+ kind: "trueFalse"
1538
+ },
1539
+ {
1540
+ field: "textpathok",
1541
+ attr: "textpathok",
1542
+ kind: "trueFalse"
1543
+ },
1544
+ {
1545
+ field: "insetpenok",
1546
+ attr: "insetpenok",
1547
+ kind: "trueFalse"
1548
+ },
1549
+ {
1550
+ field: "connecttype",
1551
+ attr: "o:connecttype",
1552
+ kind: "string"
1553
+ },
1554
+ {
1555
+ field: "connectlocs",
1556
+ attr: "o:connectlocs",
1557
+ kind: "string"
1558
+ },
1559
+ {
1560
+ field: "connectangles",
1561
+ attr: "o:connectangles",
1562
+ kind: "string"
1563
+ },
1564
+ {
1565
+ field: "extrusionok",
1566
+ attr: "o:extrusionok",
1567
+ kind: "trueFalse"
1568
+ }
1569
+ ];
1570
+ /** Serialize v:path. */
1571
+ function stringifyVmlPath(opts) {
1572
+ return `<v:path${stringifyVmlAttributes(opts, PATH_ATTRS)}/>`;
1573
+ }
1574
+ /** Parse a v:path element. */
1575
+ function parseVmlPath(el) {
1576
+ const out = {};
1577
+ parseVmlAttributes(el, PATH_ATTRS, out);
1578
+ return out;
1579
+ }
1580
+ //#endregion
1581
+ //#region src/vector/shape-elements/presentation-elements.ts
1582
+ /** Serialize pvml:iscomment. */
1583
+ function stringifyVmlIsComment(_opts) {
1584
+ return "<pvml:iscomment/>";
1585
+ }
1586
+ /** Parse a pvml:iscomment element. */
1587
+ function parseVmlIsComment(_el) {
1588
+ return {};
1589
+ }
1590
+ /** Serialize pvml:textdata. */
1591
+ function stringifyVmlTextData(opts) {
1592
+ return opts.id !== void 0 ? `<pvml:textdata id="${opts.id}"/>` : "<pvml:textdata/>";
1593
+ }
1594
+ /** Parse a pvml:textdata element. */
1595
+ function parseVmlTextData(el) {
1596
+ const id = el.attributes?.id;
1597
+ return id !== void 0 ? { id: String(id) } : {};
1598
+ }
1599
+ //#endregion
1600
+ //#region src/vector/shape-elements/shadow.ts
1601
+ const SHADOW_ATTRS = [
1602
+ {
1603
+ field: "id",
1604
+ attr: "id",
1605
+ kind: "string"
1606
+ },
1607
+ {
1608
+ field: "on",
1609
+ attr: "on",
1610
+ kind: "trueFalse"
1611
+ },
1612
+ {
1613
+ field: "type",
1614
+ attr: "type",
1615
+ kind: "string"
1616
+ },
1617
+ {
1618
+ field: "obscured",
1619
+ attr: "obscured",
1620
+ kind: "trueFalse"
1621
+ },
1622
+ {
1623
+ field: "color",
1624
+ attr: "color",
1625
+ kind: "string"
1626
+ },
1627
+ {
1628
+ field: "opacity",
1629
+ attr: "opacity",
1630
+ kind: "string"
1631
+ },
1632
+ {
1633
+ field: "offset",
1634
+ attr: "offset",
1635
+ kind: "string"
1636
+ },
1637
+ {
1638
+ field: "color2",
1639
+ attr: "color2",
1640
+ kind: "string"
1641
+ },
1642
+ {
1643
+ field: "offset2",
1644
+ attr: "offset2",
1645
+ kind: "string"
1646
+ },
1647
+ {
1648
+ field: "origin",
1649
+ attr: "origin",
1650
+ kind: "string"
1651
+ },
1652
+ {
1653
+ field: "matrix",
1654
+ attr: "matrix",
1655
+ kind: "string"
1656
+ }
1657
+ ];
1658
+ /** Serialize v:shadow. */
1659
+ function stringifyVmlShadow(opts) {
1660
+ return `<v:shadow${stringifyVmlAttributes(opts, SHADOW_ATTRS)}/>`;
1661
+ }
1662
+ /** Parse a v:shadow element. */
1663
+ function parseVmlShadow(el) {
1664
+ const out = {};
1665
+ parseVmlAttributes(el, SHADOW_ATTRS, out);
1666
+ return out;
1667
+ }
1668
+ //#endregion
1669
+ //#region src/vector/shape-elements/stroke.ts
1670
+ const STROKE_ATTRS = [
1671
+ {
1672
+ field: "id",
1673
+ attr: "id",
1674
+ kind: "string"
1675
+ },
1676
+ {
1677
+ field: "on",
1678
+ attr: "on",
1679
+ kind: "trueFalse"
1680
+ },
1681
+ {
1682
+ field: "weight",
1683
+ attr: "weight",
1684
+ kind: "string"
1685
+ },
1686
+ {
1687
+ field: "color",
1688
+ attr: "color",
1689
+ kind: "string"
1690
+ },
1691
+ {
1692
+ field: "opacity",
1693
+ attr: "opacity",
1694
+ kind: "string"
1695
+ },
1696
+ {
1697
+ field: "linestyle",
1698
+ attr: "linestyle",
1699
+ kind: "string"
1700
+ },
1701
+ {
1702
+ field: "miterlimit",
1703
+ attr: "miterlimit",
1704
+ kind: "number"
1705
+ },
1706
+ {
1707
+ field: "joinstyle",
1708
+ attr: "joinstyle",
1709
+ kind: "string"
1710
+ },
1711
+ {
1712
+ field: "endcap",
1713
+ attr: "endcap",
1714
+ kind: "string"
1715
+ },
1716
+ {
1717
+ field: "dashstyle",
1718
+ attr: "dashstyle",
1719
+ kind: "string"
1720
+ },
1721
+ {
1722
+ field: "filltype",
1723
+ attr: "filltype",
1724
+ kind: "string"
1725
+ },
1726
+ {
1727
+ field: "src",
1728
+ attr: "src",
1729
+ kind: "string"
1730
+ },
1731
+ {
1732
+ field: "imageaspect",
1733
+ attr: "imageaspect",
1734
+ kind: "string"
1735
+ },
1736
+ {
1737
+ field: "imagesize",
1738
+ attr: "imagesize",
1739
+ kind: "string"
1740
+ },
1741
+ {
1742
+ field: "imagealignshape",
1743
+ attr: "imagealignshape",
1744
+ kind: "trueFalse"
1745
+ },
1746
+ {
1747
+ field: "color2",
1748
+ attr: "color2",
1749
+ kind: "string"
1750
+ },
1751
+ {
1752
+ field: "startarrow",
1753
+ attr: "startarrow",
1754
+ kind: "string"
1755
+ },
1756
+ {
1757
+ field: "startarrowwidth",
1758
+ attr: "startarrowwidth",
1759
+ kind: "string"
1760
+ },
1761
+ {
1762
+ field: "startarrowlength",
1763
+ attr: "startarrowlength",
1764
+ kind: "string"
1765
+ },
1766
+ {
1767
+ field: "endarrow",
1768
+ attr: "endarrow",
1769
+ kind: "string"
1770
+ },
1771
+ {
1772
+ field: "endarrowwidth",
1773
+ attr: "endarrowwidth",
1774
+ kind: "string"
1775
+ },
1776
+ {
1777
+ field: "endarrowlength",
1778
+ attr: "endarrowlength",
1779
+ kind: "string"
1780
+ },
1781
+ {
1782
+ field: "relationshipId",
1783
+ attr: "r:id",
1784
+ kind: "string"
1785
+ },
1786
+ {
1787
+ field: "insetpen",
1788
+ attr: "insetpen",
1789
+ kind: "trueFalse"
1790
+ },
1791
+ {
1792
+ field: "officeHref",
1793
+ attr: "o:href",
1794
+ kind: "string"
1795
+ },
1796
+ {
1797
+ field: "officeAltHref",
1798
+ attr: "o:althref",
1799
+ kind: "string"
1800
+ },
1801
+ {
1802
+ field: "officeTitle",
1803
+ attr: "o:title",
1804
+ kind: "string"
1805
+ },
1806
+ {
1807
+ field: "forcedash",
1808
+ attr: "o:forcedash",
1809
+ kind: "trueFalse"
1810
+ },
1811
+ {
1812
+ field: "officeRelationshipId",
1813
+ attr: "o:relid",
1814
+ kind: "string"
1815
+ }
1816
+ ];
1817
+ const STROKE_CHILD_ATTRS = [
1818
+ {
1819
+ field: "ext",
1820
+ attr: "v:ext",
1821
+ kind: "string"
1822
+ },
1823
+ {
1824
+ field: "on",
1825
+ attr: "on",
1826
+ kind: "trueFalse"
1827
+ },
1828
+ {
1829
+ field: "weight",
1830
+ attr: "weight",
1831
+ kind: "string"
1832
+ },
1833
+ {
1834
+ field: "color",
1835
+ attr: "color",
1836
+ kind: "string"
1837
+ },
1838
+ {
1839
+ field: "color2",
1840
+ attr: "color2",
1841
+ kind: "string"
1842
+ },
1843
+ {
1844
+ field: "opacity",
1845
+ attr: "opacity",
1846
+ kind: "string"
1847
+ },
1848
+ {
1849
+ field: "linestyle",
1850
+ attr: "linestyle",
1851
+ kind: "string"
1852
+ },
1853
+ {
1854
+ field: "miterlimit",
1855
+ attr: "miterlimit",
1856
+ kind: "number"
1857
+ },
1858
+ {
1859
+ field: "joinstyle",
1860
+ attr: "joinstyle",
1861
+ kind: "string"
1862
+ },
1863
+ {
1864
+ field: "endcap",
1865
+ attr: "endcap",
1866
+ kind: "string"
1867
+ },
1868
+ {
1869
+ field: "dashstyle",
1870
+ attr: "dashstyle",
1871
+ kind: "string"
1872
+ },
1873
+ {
1874
+ field: "insetpen",
1875
+ attr: "insetpen",
1876
+ kind: "trueFalse"
1877
+ },
1878
+ {
1879
+ field: "filltype",
1880
+ attr: "filltype",
1881
+ kind: "string"
1882
+ },
1883
+ {
1884
+ field: "src",
1885
+ attr: "src",
1886
+ kind: "string"
1887
+ },
1888
+ {
1889
+ field: "imageaspect",
1890
+ attr: "imageaspect",
1891
+ kind: "string"
1892
+ },
1893
+ {
1894
+ field: "imagesize",
1895
+ attr: "imagesize",
1896
+ kind: "string"
1897
+ },
1898
+ {
1899
+ field: "imagealignshape",
1900
+ attr: "imagealignshape",
1901
+ kind: "trueFalse"
1902
+ },
1903
+ {
1904
+ field: "startarrow",
1905
+ attr: "startarrow",
1906
+ kind: "string"
1907
+ },
1908
+ {
1909
+ field: "startarrowwidth",
1910
+ attr: "startarrowwidth",
1911
+ kind: "string"
1912
+ },
1913
+ {
1914
+ field: "startarrowlength",
1915
+ attr: "startarrowlength",
1916
+ kind: "string"
1917
+ },
1918
+ {
1919
+ field: "endarrow",
1920
+ attr: "endarrow",
1921
+ kind: "string"
1922
+ },
1923
+ {
1924
+ field: "endarrowwidth",
1925
+ attr: "endarrowwidth",
1926
+ kind: "string"
1927
+ },
1928
+ {
1929
+ field: "endarrowlength",
1930
+ attr: "endarrowlength",
1931
+ kind: "string"
1932
+ },
1933
+ {
1934
+ field: "officeHref",
1935
+ attr: "o:href",
1936
+ kind: "string"
1937
+ },
1938
+ {
1939
+ field: "officeAltHref",
1940
+ attr: "o:althref",
1941
+ kind: "string"
1942
+ },
1943
+ {
1944
+ field: "officeTitle",
1945
+ attr: "o:title",
1946
+ kind: "string"
1947
+ },
1948
+ {
1949
+ field: "forcedash",
1950
+ attr: "o:forcedash",
1951
+ kind: "trueFalse"
1952
+ }
1953
+ ];
1954
+ /** Serialize an o:left/top/right/bottom/column sub-stroke. */
1955
+ function stringifyVmlStrokeChild(tag, opts) {
1956
+ return `<${tag}${stringifyVmlAttributes(opts, STROKE_CHILD_ATTRS)}/>`;
1957
+ }
1958
+ /** Parse an o: sub-stroke child of v:stroke. */
1959
+ function parseVmlStrokeChild(el) {
1960
+ const out = {};
1961
+ parseVmlAttributes(el, STROKE_CHILD_ATTRS, out);
1962
+ return out;
1963
+ }
1964
+ /** Serialize v:stroke. */
1965
+ function stringifyVmlStroke(opts) {
1966
+ const children = [];
1967
+ if (opts.leftStroke !== void 0) children.push(stringifyVmlStrokeChild("o:left", opts.leftStroke));
1968
+ if (opts.topStroke !== void 0) children.push(stringifyVmlStrokeChild("o:top", opts.topStroke));
1969
+ if (opts.rightStroke !== void 0) children.push(stringifyVmlStrokeChild("o:right", opts.rightStroke));
1970
+ if (opts.bottomStroke !== void 0) children.push(stringifyVmlStrokeChild("o:bottom", opts.bottomStroke));
1971
+ if (opts.columnStroke !== void 0) children.push(stringifyVmlStrokeChild("o:column", opts.columnStroke));
1972
+ const attrStr = stringifyVmlAttributes(opts, STROKE_ATTRS);
1973
+ return children.length > 0 ? `<v:stroke${attrStr}>${children.join("")}</v:stroke>` : `<v:stroke${attrStr}/>`;
1974
+ }
1975
+ /** Parse a v:stroke element. */
1976
+ function parseVmlStroke(el) {
1977
+ const out = {};
1978
+ parseVmlAttributes(el, STROKE_ATTRS, out);
1979
+ for (const child of el.elements ?? []) {
1980
+ if (child.type !== "element") continue;
1981
+ switch (child.name) {
1982
+ case "o:left":
1983
+ out.leftStroke = parseVmlStrokeChild(child);
1984
+ break;
1985
+ case "o:top":
1986
+ out.topStroke = parseVmlStrokeChild(child);
1987
+ break;
1988
+ case "o:right":
1989
+ out.rightStroke = parseVmlStrokeChild(child);
1990
+ break;
1991
+ case "o:bottom":
1992
+ out.bottomStroke = parseVmlStrokeChild(child);
1993
+ break;
1994
+ case "o:column":
1995
+ out.columnStroke = parseVmlStrokeChild(child);
1996
+ break;
1997
+ }
1998
+ }
1999
+ return out;
2000
+ }
2001
+ //#endregion
2002
+ //#region src/vector/shape-elements/textbox.ts
2003
+ /**
2004
+ * Serialize v:textbox. Exactly one content form is emitted when present
2005
+ * (txbxContent wins if both are set, matching the XSD choice).
2006
+ */
2007
+ function stringifyVmlTextbox(opts) {
2008
+ const attrs = [];
2009
+ if (opts.id !== void 0) attrs.push(`id="${escapeXml(opts.id)}"`);
2010
+ if (opts.style !== void 0) attrs.push(`style="${escapeXml(stringifyVmlStyle(opts.style))}"`);
2011
+ if (opts.inset !== void 0) attrs.push(`inset="${escapeXml(opts.inset)}"`);
2012
+ if (opts.singleclick !== void 0) attrs.push(`o:singleclick="${stringifyVmlTrueFalse(opts.singleclick)}"`);
2013
+ if (opts.insetmode !== void 0) attrs.push(`o:insetmode="${opts.insetmode}"`);
2014
+ const attrStr = attrs.length > 0 ? ` ${attrs.join(" ")}` : "";
2015
+ if (opts.txbxContent !== void 0) return `<v:textbox${attrStr}><w:txbxContent>${opts.txbxContent}</w:txbxContent></v:textbox>`;
2016
+ if (opts.content !== void 0) return `<v:textbox${attrStr}>${opts.content}</v:textbox>`;
2017
+ return `<v:textbox${attrStr}/>`;
2018
+ }
2019
+ /** Parse a v:textbox element. */
2020
+ function parseVmlTextbox(el) {
2021
+ const out = {};
2022
+ const attrs = el.attributes ?? {};
2023
+ if (attrs.id !== void 0) out.id = String(attrs.id);
2024
+ if (attrs.style !== void 0) out.style = parseVmlShapeStyle(parseVmlStyle(String(attrs.style)));
2025
+ if (attrs.inset !== void 0) out.inset = String(attrs.inset);
2026
+ if (attrs["o:singleclick"] !== void 0) out.singleclick = parseVmlTrueFalse(String(attrs["o:singleclick"]));
2027
+ if (attrs["o:insetmode"] !== void 0) out.insetmode = String(attrs["o:insetmode"]);
2028
+ for (const child of el.elements ?? []) {
2029
+ if (child.type !== "element") continue;
2030
+ if (child.name === "w:txbxContent") {
2031
+ out.txbxContent = (child.elements ?? []).map((e) => stringifyElement(e)).join("");
2032
+ break;
2033
+ }
2034
+ if (!child.name?.includes(":")) {
2035
+ out.content = stringifyElement(child);
2036
+ break;
2037
+ }
2038
+ }
2039
+ return out;
2040
+ }
2041
+ //#endregion
2042
+ //#region src/vector/shape-elements/textpath.ts
2043
+ const TEXT_PATH_STYLE_MAP = {
2044
+ fontFamily: "font-family",
2045
+ fontSize: "font-size",
2046
+ fontWeight: "font-weight",
2047
+ fontStyle: "font-style",
2048
+ fontVariant: "font-variant",
2049
+ textTransform: "text-transform",
2050
+ textDecoration: "text-decoration",
2051
+ letterSpacing: "letter-spacing",
2052
+ vTextAlign: "v-text-align",
2053
+ vTextKern: "v-text-kern",
2054
+ vTextSpacing: "v-text-spacing",
2055
+ vTextSpacingMode: "v-text-spacing-mode"
2056
+ };
2057
+ /** Serialize a VmlTextPathStyle to its CSS-stream form. */
2058
+ function stringifyVmlTextPathStyle(style) {
2059
+ return Object.entries(style).map(([key, value]) => `${TEXT_PATH_STYLE_MAP[key]}:${value}`).join(";");
2060
+ }
2061
+ /** Parse a CSS stream into a VmlTextPathStyle; unmapped keys drop. */
2062
+ function parseVmlTextPathStyle(styleStr) {
2063
+ const reverse = Object.fromEntries(Object.entries(TEXT_PATH_STYLE_MAP).map(([field, key]) => [key, field]));
2064
+ const style = {};
2065
+ for (const part of styleStr.split(";")) {
2066
+ const [key, val] = part.split(":").map((s) => s.trim());
2067
+ if (!key || !val) continue;
2068
+ const field = reverse[key];
2069
+ if (field) style[field] = val;
2070
+ }
2071
+ return style;
2072
+ }
2073
+ const TEXT_PATH_ATTRS = [
2074
+ {
2075
+ field: "id",
2076
+ attr: "id",
2077
+ kind: "string"
2078
+ },
2079
+ {
2080
+ field: "on",
2081
+ attr: "on",
2082
+ kind: "trueFalse"
2083
+ },
2084
+ {
2085
+ field: "fitshape",
2086
+ attr: "fitshape",
2087
+ kind: "trueFalse"
2088
+ },
2089
+ {
2090
+ field: "fitpath",
2091
+ attr: "fitpath",
2092
+ kind: "trueFalse"
2093
+ },
2094
+ {
2095
+ field: "trim",
2096
+ attr: "trim",
2097
+ kind: "trueFalse"
2098
+ },
2099
+ {
2100
+ field: "xscale",
2101
+ attr: "xscale",
2102
+ kind: "trueFalse"
2103
+ },
2104
+ {
2105
+ field: "string",
2106
+ attr: "string",
2107
+ kind: "string"
2108
+ }
2109
+ ];
2110
+ /** Serialize v:textpath. */
2111
+ function stringifyVmlTextPath(opts) {
2112
+ const attrStr = stringifyVmlAttributes(opts, TEXT_PATH_ATTRS);
2113
+ if (opts.style !== void 0) return `<v:textpath${attrStr} style="${escapeXml(stringifyVmlTextPathStyle(opts.style))}"/>`;
2114
+ return `<v:textpath${attrStr}/>`;
2115
+ }
2116
+ /** Parse a v:textpath element. */
2117
+ function parseVmlTextPath(el) {
2118
+ const out = {};
2119
+ parseVmlAttributes(el, TEXT_PATH_ATTRS, out);
2120
+ if (el.attributes?.style !== void 0) out.style = parseVmlTextPathStyle(String(el.attributes.style));
2121
+ return out;
2122
+ }
2123
+ //#endregion
2124
+ //#region src/vector/shape-elements/word-elements.ts
2125
+ const WRAP_ATTRS = [
2126
+ {
2127
+ field: "type",
2128
+ attr: "type",
2129
+ kind: "string"
2130
+ },
2131
+ {
2132
+ field: "side",
2133
+ attr: "side",
2134
+ kind: "string"
2135
+ },
2136
+ {
2137
+ field: "anchorx",
2138
+ attr: "anchorx",
2139
+ kind: "string"
2140
+ },
2141
+ {
2142
+ field: "anchory",
2143
+ attr: "anchory",
2144
+ kind: "string"
2145
+ }
2146
+ ];
2147
+ /** Serialize w10:wrap. */
2148
+ function stringifyVmlWrap(opts) {
2149
+ return `<w10:wrap${stringifyVmlAttributes(opts, WRAP_ATTRS)}/>`;
2150
+ }
2151
+ /** Parse a w10:wrap element. */
2152
+ function parseVmlWrap(el) {
2153
+ const out = {};
2154
+ parseVmlAttributes(el, WRAP_ATTRS, out);
2155
+ return out;
2156
+ }
2157
+ /** Serialize w10:anchorlock. */
2158
+ function stringifyVmlAnchorLock(_opts) {
2159
+ return "<w10:anchorlock/>";
2160
+ }
2161
+ /** Parse a w10:anchorlock element. */
2162
+ function parseVmlAnchorLock(_el) {
2163
+ return {};
2164
+ }
2165
+ const BORDER_ATTRS = [
2166
+ {
2167
+ field: "type",
2168
+ attr: "type",
2169
+ kind: "string"
2170
+ },
2171
+ {
2172
+ field: "width",
2173
+ attr: "width",
2174
+ kind: "number"
2175
+ },
2176
+ {
2177
+ field: "shadow",
2178
+ attr: "shadow",
2179
+ kind: "trueFalseBlank"
2180
+ }
2181
+ ];
2182
+ /** The four w10: border element names. */
2183
+ const VML_BORDER_TAGS = [
2184
+ "w10:bordertop",
2185
+ "w10:borderleft",
2186
+ "w10:borderright",
2187
+ "w10:borderbottom"
2188
+ ];
2189
+ /** Serialize a w10: border element. */
2190
+ function stringifyVmlBorder(tag, opts) {
2191
+ return `<${tag}${stringifyVmlAttributes(opts, BORDER_ATTRS)}/>`;
2192
+ }
2193
+ /** Parse a w10: border element. */
2194
+ function parseVmlBorder(el) {
2195
+ const out = {};
2196
+ parseVmlAttributes(el, BORDER_ATTRS, out);
2197
+ return out;
2198
+ }
2199
+ //#endregion
2200
+ //#region src/vector/shapes.ts
2201
+ /** Next spid in the `_x0000_s` segment (Word hands out shape ids from 1025). */
2202
+ let nextSpid = 1024;
2203
+ /**
2204
+ * Allocate the next VML shape id (`_x0000_s1025`, `_x0000_s1026`, …).
2205
+ * Ids only need to be unique within a document; the counter is process-global
2206
+ * so concurrent generations never collide.
2207
+ */
2208
+ function nextVmlShapeId() {
2209
+ return `_x0000_s${++nextSpid}`;
2210
+ }
2211
+ const GROUP_FILL_ATTRS = [{
2212
+ field: "filled",
2213
+ attr: "filled",
2214
+ kind: "trueFalse"
2215
+ }, {
2216
+ field: "fillcolor",
2217
+ attr: "fillcolor",
2218
+ kind: "string"
2219
+ }];
2220
+ const ARC_ATTRS = [{
2221
+ field: "startAngle",
2222
+ attr: "startAngle",
2223
+ kind: "number"
2224
+ }, {
2225
+ field: "endAngle",
2226
+ attr: "endAngle",
2227
+ kind: "number"
2228
+ }];
2229
+ const CURVE_ATTRS = [
2230
+ {
2231
+ field: "from",
2232
+ attr: "from",
2233
+ kind: "string"
2234
+ },
2235
+ {
2236
+ field: "control1",
2237
+ attr: "control1",
2238
+ kind: "string"
2239
+ },
2240
+ {
2241
+ field: "control2",
2242
+ attr: "control2",
2243
+ kind: "string"
2244
+ },
2245
+ {
2246
+ field: "to",
2247
+ attr: "to",
2248
+ kind: "string"
2249
+ }
2250
+ ];
2251
+ const IMAGE_ATTRS = [
2252
+ {
2253
+ field: "src",
2254
+ attr: "src",
2255
+ kind: "string"
2256
+ },
2257
+ {
2258
+ field: "cropleft",
2259
+ attr: "cropleft",
2260
+ kind: "string"
2261
+ },
2262
+ {
2263
+ field: "croptop",
2264
+ attr: "croptop",
2265
+ kind: "string"
2266
+ },
2267
+ {
2268
+ field: "cropright",
2269
+ attr: "cropright",
2270
+ kind: "string"
2271
+ },
2272
+ {
2273
+ field: "cropbottom",
2274
+ attr: "cropbottom",
2275
+ kind: "string"
2276
+ },
2277
+ {
2278
+ field: "gain",
2279
+ attr: "gain",
2280
+ kind: "string"
2281
+ },
2282
+ {
2283
+ field: "blacklevel",
2284
+ attr: "blacklevel",
2285
+ kind: "string"
2286
+ },
2287
+ {
2288
+ field: "gamma",
2289
+ attr: "gamma",
2290
+ kind: "string"
2291
+ },
2292
+ {
2293
+ field: "grayscale",
2294
+ attr: "grayscale",
2295
+ kind: "trueFalse"
2296
+ },
2297
+ {
2298
+ field: "bilevel",
2299
+ attr: "bilevel",
2300
+ kind: "trueFalse"
2301
+ }
2302
+ ];
2303
+ const LINE_ATTRS = [{
2304
+ field: "from",
2305
+ attr: "from",
2306
+ kind: "string"
2307
+ }, {
2308
+ field: "to",
2309
+ attr: "to",
2310
+ kind: "string"
2311
+ }];
2312
+ const POLYLINE_ATTRS = [{
2313
+ field: "points",
2314
+ attr: "points",
2315
+ kind: "string"
2316
+ }];
2317
+ const ROUNDRECT_ATTRS = [{
2318
+ field: "arcsize",
2319
+ attr: "arcsize",
2320
+ kind: "string"
2321
+ }];
2322
+ /** The full AG_AllCoreAttributes + AG_AllShapeAttributes table. */
2323
+ const ALL_SHAPE_ATTRS = [
2324
+ ...VML_CORE_ATTRS,
2325
+ ...VML_OFFICE_CORE_ATTRS,
2326
+ ...VML_SHAPE_ATTRS,
2327
+ ...VML_OFFICE_SHAPE_ATTRS
2328
+ ];
2329
+ /** Serialize the shared attribute vocabulary (style special-cased) plus extras. */
2330
+ function stringifyShapeAttrs(opts, extraSpecs = []) {
2331
+ let attrStr = stringifyVmlAttributes(opts, [...ALL_SHAPE_ATTRS, ...extraSpecs]);
2332
+ const style = opts.style;
2333
+ if (style !== void 0) attrStr += ` style="${escapeXml(stringifyVmlStyle(style))}"`;
2334
+ return attrStr;
2335
+ }
2336
+ /** Serialize the EG_ShapeElements children present on `opts`, in declaration order. */
2337
+ function stringifyShapeElements(opts) {
2338
+ const parts = [];
2339
+ if (opts.pathElement !== void 0) parts.push(stringifyVmlPath(opts.pathElement));
2340
+ if (opts.formulas !== void 0) parts.push(stringifyVmlFormulas(opts.formulas));
2341
+ if (opts.handles !== void 0) parts.push(stringifyVmlHandles(opts.handles));
2342
+ if (opts.fill !== void 0) parts.push(stringifyVmlFill(opts.fill));
2343
+ if (opts.stroke !== void 0) parts.push(stringifyVmlStroke(opts.stroke));
2344
+ if (opts.shadow !== void 0) parts.push(stringifyVmlShadow(opts.shadow));
2345
+ if (opts.textbox !== void 0) parts.push(stringifyVmlTextbox(opts.textbox));
2346
+ if (opts.textpath !== void 0) parts.push(stringifyVmlTextPath(opts.textpath));
2347
+ if (opts.imagedata !== void 0) parts.push(stringifyVmlImageData(opts.imagedata));
2348
+ if (opts.skew !== void 0) parts.push(stringifyVmlSkew(opts.skew));
2349
+ if (opts.extrusion !== void 0) parts.push(stringifyVmlExtrusion(opts.extrusion));
2350
+ if (opts.callout !== void 0) parts.push(stringifyVmlCallout(opts.callout));
2351
+ if (opts.lock !== void 0) parts.push(stringifyVmlLock(opts.lock));
2352
+ if (opts.clippath !== void 0) parts.push(stringifyVmlClipPath(opts.clippath));
2353
+ if (opts.signatureline !== void 0) parts.push(stringifyVmlSignatureLine(opts.signatureline));
2354
+ if (opts.wrap !== void 0) parts.push(stringifyVmlWrap(opts.wrap));
2355
+ if (opts.anchorlock !== void 0) parts.push(stringifyVmlAnchorLock(opts.anchorlock));
2356
+ if (opts.bordertop !== void 0) parts.push(stringifyVmlBorder("w10:bordertop", opts.bordertop));
2357
+ if (opts.borderbottom !== void 0) parts.push(stringifyVmlBorder("w10:borderbottom", opts.borderbottom));
2358
+ if (opts.borderleft !== void 0) parts.push(stringifyVmlBorder("w10:borderleft", opts.borderleft));
2359
+ if (opts.borderright !== void 0) parts.push(stringifyVmlBorder("w10:borderright", opts.borderright));
2360
+ if (opts.clientData !== void 0) parts.push(stringifyVmlClientData(opts.clientData));
2361
+ if (opts.textdata !== void 0) parts.push(stringifyVmlTextData(opts.textdata));
2362
+ return parts.join("");
2363
+ }
2364
+ /** Parse the shared attribute vocabulary plus extras onto `out`. */
2365
+ function parseShapeAttrs(el, out, extraSpecs = []) {
2366
+ parseVmlAttributes(el, [...ALL_SHAPE_ATTRS, ...extraSpecs], out);
2367
+ if (el.attributes?.style !== void 0) out.style = parseVmlShapeStyle(parseVmlStyle(String(el.attributes.style)));
2368
+ if (el.attributes?.path !== void 0) out.path = String(el.attributes.path);
2369
+ }
2370
+ /** Parse the EG_ShapeElements children from `el` onto `out`. */
2371
+ function parseShapeElements(el, out) {
2372
+ for (const child of el.elements ?? []) {
2373
+ if (child.type !== "element") continue;
2374
+ switch (child.name) {
2375
+ case "v:path":
2376
+ out.pathElement = parseVmlPath(child);
2377
+ break;
2378
+ case "v:formulas":
2379
+ out.formulas = parseVmlFormulas(child);
2380
+ break;
2381
+ case "v:handles":
2382
+ out.handles = parseVmlHandles(child);
2383
+ break;
2384
+ case "v:fill":
2385
+ out.fill = parseVmlFill(child);
2386
+ break;
2387
+ case "v:stroke":
2388
+ out.stroke = parseVmlStroke(child);
2389
+ break;
2390
+ case "v:shadow":
2391
+ out.shadow = parseVmlShadow(child);
2392
+ break;
2393
+ case "v:textbox":
2394
+ out.textbox = parseVmlTextbox(child);
2395
+ break;
2396
+ case "v:textpath":
2397
+ out.textpath = parseVmlTextPath(child);
2398
+ break;
2399
+ case "v:imagedata":
2400
+ out.imagedata = parseVmlImageData(child);
2401
+ break;
2402
+ case "o:skew":
2403
+ out.skew = parseVmlSkew(child);
2404
+ break;
2405
+ case "o:extrusion":
2406
+ out.extrusion = parseVmlExtrusion(child);
2407
+ break;
2408
+ case "o:callout":
2409
+ out.callout = parseVmlCallout(child);
2410
+ break;
2411
+ case "o:lock":
2412
+ out.lock = parseVmlLock(child);
2413
+ break;
2414
+ case "o:clippath":
2415
+ out.clippath = parseVmlClipPath(child);
2416
+ break;
2417
+ case "o:signatureline":
2418
+ out.signatureline = parseVmlSignatureLine(child);
2419
+ break;
2420
+ case "w10:wrap":
2421
+ out.wrap = parseVmlWrap(child);
2422
+ break;
2423
+ case "w10:anchorlock":
2424
+ out.anchorlock = parseVmlAnchorLock(child);
2425
+ break;
2426
+ case "w10:bordertop":
2427
+ out.bordertop = parseVmlBorder(child);
2428
+ break;
2429
+ case "w10:borderbottom":
2430
+ out.borderbottom = parseVmlBorder(child);
2431
+ break;
2432
+ case "w10:borderleft":
2433
+ out.borderleft = parseVmlBorder(child);
2434
+ break;
2435
+ case "w10:borderright":
2436
+ out.borderright = parseVmlBorder(child);
2437
+ break;
2438
+ case "x:ClientData":
2439
+ out.clientData = parseVmlClientData(child);
2440
+ break;
2441
+ case "pvml:textdata":
2442
+ out.textdata = parseVmlTextData(child);
2443
+ break;
2444
+ case "pvml:iscomment":
2445
+ out.iscomment = parseVmlIsComment(child);
2446
+ break;
2447
+ }
2448
+ }
2449
+ }
2450
+ /** Generic shape element serializer: tag + shared/extra attrs + @path + children. */
2451
+ function stringifyShapeElement(tag, opts, extraSpecs = [], extraAttrStrings = [], childrenXml = "") {
2452
+ const attrStr = stringifyShapeAttrs(opts, extraSpecs) + (extraAttrStrings.length > 0 ? " " + extraAttrStrings.join(" ") : "");
2453
+ return childrenXml !== "" ? `<${tag}${attrStr}>${childrenXml}</${tag}>` : `<${tag}${attrStr}/>`;
2454
+ }
2455
+ const SHAPE_EXTRA_ATTRS = [
2456
+ {
2457
+ field: "type",
2458
+ attr: "type",
2459
+ kind: "string"
2460
+ },
2461
+ {
2462
+ field: "adj",
2463
+ attr: "adj",
2464
+ kind: "string"
2465
+ },
2466
+ {
2467
+ field: "gfxdata",
2468
+ attr: "o:gfxdata",
2469
+ kind: "string"
2470
+ },
2471
+ {
2472
+ field: "equationxml",
2473
+ attr: "equationxml",
2474
+ kind: "string"
2475
+ }
2476
+ ];
2477
+ /** Serialize v:shape. */
2478
+ function stringifyVmlShape(opts) {
2479
+ const extra = opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [];
2480
+ let children = stringifyShapeElements(opts);
2481
+ if (opts.ink !== void 0) children += stringifyVmlInk(opts.ink);
2482
+ if (opts.equationxmlElement !== void 0) children += stringifyVmlEquationXml(opts.equationxmlElement);
2483
+ if (opts.iscomment !== void 0) children += stringifyVmlIsComment(opts.iscomment);
2484
+ return stringifyShapeElement("v:shape", opts, SHAPE_EXTRA_ATTRS, extra, children);
2485
+ }
2486
+ /** Parse a v:shape element. */
2487
+ function parseVmlShape(el) {
2488
+ const out = {};
2489
+ parseShapeAttrs(el, out, SHAPE_EXTRA_ATTRS);
2490
+ parseShapeElements(el, out);
2491
+ for (const child of el.elements ?? []) {
2492
+ if (child.type !== "element") continue;
2493
+ if (child.name === "o:ink") out.ink = parseVmlInk(child);
2494
+ else if (child.name === "o:equationxml") out.equationxmlElement = parseVmlEquationXml(child);
2495
+ }
2496
+ return out;
2497
+ }
2498
+ const SHAPETYPE_EXTRA_ATTRS = [{
2499
+ field: "adj",
2500
+ attr: "adj",
2501
+ kind: "string"
2502
+ }, {
2503
+ field: "master",
2504
+ attr: "o:master",
2505
+ kind: "string"
2506
+ }];
2507
+ /** Serialize v:shapetype. */
2508
+ function stringifyVmlShapetype(opts) {
2509
+ const extra = opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [];
2510
+ let children = stringifyShapeElements(opts);
2511
+ if (opts.complex !== void 0) children += stringifyVmlComplex(opts.complex);
2512
+ return stringifyShapeElement("v:shapetype", opts, SHAPETYPE_EXTRA_ATTRS, extra, children);
2513
+ }
2514
+ /** Parse a v:shapetype element. */
2515
+ function parseVmlShapetype(el) {
2516
+ const out = {};
2517
+ parseShapeAttrs(el, out, SHAPETYPE_EXTRA_ATTRS);
2518
+ parseShapeElements(el, out);
2519
+ for (const child of el.elements ?? []) if (child.type === "element" && child.name === "o:complex") {
2520
+ out.complex = parseVmlComplex(child);
2521
+ break;
2522
+ }
2523
+ return out;
2524
+ }
2525
+ /** Serialize one VmlGroupChild. */
2526
+ function stringifyGroupChild(child) {
2527
+ if ("shape" in child) return stringifyVmlShape(child.shape);
2528
+ if ("shapetype" in child) return stringifyVmlShapetype(child.shapetype);
2529
+ if ("group" in child) return stringifyVmlGroup(child.group);
2530
+ if ("arc" in child) return stringifyVmlArc(child.arc);
2531
+ if ("curve" in child) return stringifyVmlCurve(child.curve);
2532
+ if ("image" in child) return stringifyVmlImage(child.image);
2533
+ if ("line" in child) return stringifyVmlLine(child.line);
2534
+ if ("oval" in child) return stringifyVmlOval(child.oval);
2535
+ if ("polyline" in child) return stringifyVmlPolyline(child.polyline);
2536
+ if ("rect" in child) return stringifyVmlRect(child.rect);
2537
+ return stringifyVmlRoundRect(child.roundrect);
2538
+ }
2539
+ /** CT_Group attribute table — AG_AllCoreAttributes + AG_Fill + editas + table props. */
2540
+ const GROUP_ATTRS = [
2541
+ ...VML_CORE_ATTRS,
2542
+ ...VML_OFFICE_CORE_ATTRS,
2543
+ ...GROUP_FILL_ATTRS,
2544
+ {
2545
+ field: "editas",
2546
+ attr: "editas",
2547
+ kind: "string"
2548
+ },
2549
+ {
2550
+ field: "tableproperties",
2551
+ attr: "o:tableproperties",
2552
+ kind: "string"
2553
+ },
2554
+ {
2555
+ field: "tablelimits",
2556
+ attr: "o:tablelimits",
2557
+ kind: "string"
2558
+ }
2559
+ ];
2560
+ /** Serialize v:group. */
2561
+ function stringifyVmlGroup(opts) {
2562
+ let children = (opts.children ?? []).map(stringifyGroupChild).join("") + stringifyShapeElements(opts);
2563
+ if (opts.diagram !== void 0) children += stringifyVmlDiagram(opts.diagram);
2564
+ const attrStr = stringifyVmlAttributes(opts, GROUP_ATTRS) + (opts.path !== void 0 ? ` path="${escapeXml(opts.path)}"` : "");
2565
+ const style = opts.style;
2566
+ const styleStr = style !== void 0 ? ` style="${escapeXml(stringifyVmlStyle(style))}"` : "";
2567
+ return children !== "" ? `<v:group${attrStr}${styleStr}>${children}</v:group>` : `<v:group${attrStr}${styleStr}/>`;
2568
+ }
2569
+ /** Parse a v:group element. */
2570
+ function parseVmlGroup(el) {
2571
+ const out = {};
2572
+ parseVmlAttributes(el, GROUP_ATTRS, out);
2573
+ if (el.attributes?.style !== void 0) out.style = parseVmlShapeStyle(parseVmlStyle(String(el.attributes.style)));
2574
+ if (el.attributes?.path !== void 0 && out.path === void 0) out.path = String(el.attributes.path);
2575
+ parseShapeElements(el, out);
2576
+ const children = [];
2577
+ for (const child of el.elements ?? []) {
2578
+ if (child.type !== "element") continue;
2579
+ switch (child.name) {
2580
+ case "v:shape":
2581
+ children.push({ shape: parseVmlShape(child) });
2582
+ break;
2583
+ case "v:shapetype":
2584
+ children.push({ shapetype: parseVmlShapetype(child) });
2585
+ break;
2586
+ case "v:group":
2587
+ children.push({ group: parseVmlGroup(child) });
2588
+ break;
2589
+ case "v:arc":
2590
+ children.push({ arc: parseVmlArc(child) });
2591
+ break;
2592
+ case "v:curve":
2593
+ children.push({ curve: parseVmlCurve(child) });
2594
+ break;
2595
+ case "v:image":
2596
+ children.push({ image: parseVmlImage(child) });
2597
+ break;
2598
+ case "v:line":
2599
+ children.push({ line: parseVmlLine(child) });
2600
+ break;
2601
+ case "v:oval":
2602
+ children.push({ oval: parseVmlOval(child) });
2603
+ break;
2604
+ case "v:polyline":
2605
+ children.push({ polyline: parseVmlPolyline(child) });
2606
+ break;
2607
+ case "v:rect":
2608
+ children.push({ rect: parseVmlRect(child) });
2609
+ break;
2610
+ case "v:roundrect":
2611
+ children.push({ roundrect: parseVmlRoundRect(child) });
2612
+ break;
2613
+ case "o:diagram":
2614
+ out.diagram = parseVmlDiagram(child);
2615
+ break;
2616
+ }
2617
+ }
2618
+ if (children.length > 0) out.children = children;
2619
+ return out;
2620
+ }
2621
+ const BACKGROUND_ATTRS = [
2622
+ {
2623
+ field: "id",
2624
+ attr: "id",
2625
+ kind: "string"
2626
+ },
2627
+ {
2628
+ field: "filled",
2629
+ attr: "filled",
2630
+ kind: "trueFalse"
2631
+ },
2632
+ {
2633
+ field: "fillcolor",
2634
+ attr: "fillcolor",
2635
+ kind: "string"
2636
+ },
2637
+ {
2638
+ field: "bwmode",
2639
+ attr: "o:bwmode",
2640
+ kind: "string"
2641
+ },
2642
+ {
2643
+ field: "bwpure",
2644
+ attr: "o:bwpure",
2645
+ kind: "string"
2646
+ },
2647
+ {
2648
+ field: "bwnormal",
2649
+ attr: "o:bwnormal",
2650
+ kind: "string"
2651
+ },
2652
+ {
2653
+ field: "targetscreensize",
2654
+ attr: "o:targetscreensize",
2655
+ kind: "string"
2656
+ }
2657
+ ];
2658
+ /** Serialize v:background. */
2659
+ function stringifyVmlBackground(opts) {
2660
+ const attrStr = stringifyVmlAttributes(opts, BACKGROUND_ATTRS);
2661
+ const fillXml = opts.fill !== void 0 ? stringifyVmlFill(opts.fill) : "";
2662
+ return fillXml !== "" ? `<v:background${attrStr}>${fillXml}</v:background>` : `<v:background${attrStr}/>`;
2663
+ }
2664
+ /** Parse a v:background element. */
2665
+ function parseVmlBackground(el) {
2666
+ const out = {};
2667
+ parseVmlAttributes(el, BACKGROUND_ATTRS, out);
2668
+ for (const child of el.elements ?? []) if (child.type === "element" && child.name === "v:fill") {
2669
+ out.fill = parseVmlFill(child);
2670
+ break;
2671
+ }
2672
+ return out;
2673
+ }
2674
+ /** Serialize v:arc. */
2675
+ function stringifyVmlArc(opts) {
2676
+ return stringifyShapeElement("v:arc", opts, ARC_ATTRS, opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [], stringifyShapeElements(opts));
2677
+ }
2678
+ /** Parse a v:arc element. */
2679
+ function parseVmlArc(el) {
2680
+ const out = {};
2681
+ parseShapeAttrs(el, out, ARC_ATTRS);
2682
+ parseShapeElements(el, out);
2683
+ return out;
2684
+ }
2685
+ /** Serialize v:curve. */
2686
+ function stringifyVmlCurve(opts) {
2687
+ return stringifyShapeElement("v:curve", opts, CURVE_ATTRS, opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [], stringifyShapeElements(opts));
2688
+ }
2689
+ /** Parse a v:curve element. */
2690
+ function parseVmlCurve(el) {
2691
+ const out = {};
2692
+ parseShapeAttrs(el, out, CURVE_ATTRS);
2693
+ parseShapeElements(el, out);
2694
+ return out;
2695
+ }
2696
+ /** Serialize v:image. */
2697
+ function stringifyVmlImage(opts) {
2698
+ return stringifyShapeElement("v:image", opts, IMAGE_ATTRS, opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [], stringifyShapeElements(opts));
2699
+ }
2700
+ /** Parse a v:image element. */
2701
+ function parseVmlImage(el) {
2702
+ const out = {};
2703
+ parseShapeAttrs(el, out, IMAGE_ATTRS);
2704
+ parseShapeElements(el, out);
2705
+ return out;
2706
+ }
2707
+ /** Serialize v:line. */
2708
+ function stringifyVmlLine(opts) {
2709
+ return stringifyShapeElement("v:line", opts, LINE_ATTRS, opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [], stringifyShapeElements(opts));
2710
+ }
2711
+ /** Parse a v:line element. */
2712
+ function parseVmlLine(el) {
2713
+ const out = {};
2714
+ parseShapeAttrs(el, out, LINE_ATTRS);
2715
+ parseShapeElements(el, out);
2716
+ return out;
2717
+ }
2718
+ /** Serialize v:oval. */
2719
+ function stringifyVmlOval(opts) {
2720
+ return stringifyShapeElement("v:oval", opts, [], opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [], stringifyShapeElements(opts));
2721
+ }
2722
+ /** Parse a v:oval element. */
2723
+ function parseVmlOval(el) {
2724
+ const out = {};
2725
+ parseShapeAttrs(el, out);
2726
+ parseShapeElements(el, out);
2727
+ return out;
2728
+ }
2729
+ /** Serialize v:polyline. */
2730
+ function stringifyVmlPolyline(opts) {
2731
+ const children = stringifyShapeElements(opts) + (opts.ink !== void 0 ? stringifyVmlInk(opts.ink) : "");
2732
+ return stringifyShapeElement("v:polyline", opts, POLYLINE_ATTRS, opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [], children);
2733
+ }
2734
+ /** Parse a v:polyline element. */
2735
+ function parseVmlPolyline(el) {
2736
+ const out = {};
2737
+ parseShapeAttrs(el, out, POLYLINE_ATTRS);
2738
+ parseShapeElements(el, out);
2739
+ for (const child of el.elements ?? []) if (child.type === "element" && child.name === "o:ink") {
2740
+ out.ink = parseVmlInk(child);
2741
+ break;
2742
+ }
2743
+ return out;
2744
+ }
2745
+ /** Serialize v:rect. */
2746
+ function stringifyVmlRect(opts) {
2747
+ return stringifyShapeElement("v:rect", opts, [], opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [], stringifyShapeElements(opts));
2748
+ }
2749
+ /** Parse a v:rect element. */
2750
+ function parseVmlRect(el) {
2751
+ const out = {};
2752
+ parseShapeAttrs(el, out);
2753
+ parseShapeElements(el, out);
2754
+ return out;
2755
+ }
2756
+ /** Serialize v:roundrect. */
2757
+ function stringifyVmlRoundRect(opts) {
2758
+ return stringifyShapeElement("v:roundrect", opts, ROUNDRECT_ATTRS, opts.path !== void 0 ? [`path="${escapeXml(opts.path)}"`] : [], stringifyShapeElements(opts));
2759
+ }
2760
+ /** Parse a v:roundrect element. */
2761
+ function parseVmlRoundRect(el) {
2762
+ const out = {};
2763
+ parseShapeAttrs(el, out, ROUNDRECT_ATTRS);
2764
+ parseShapeElements(el, out);
2765
+ return out;
2766
+ }
2767
+ //#endregion
2768
+ //#region src/vector/office-shape-defaults.ts
2769
+ const SHAPEDEFAULTS_ATTRS = [
2770
+ {
2771
+ field: "ext",
2772
+ attr: "v:ext",
2773
+ kind: "string"
2774
+ },
2775
+ {
2776
+ field: "spidmax",
2777
+ attr: "spidmax",
2778
+ kind: "number"
2779
+ },
2780
+ {
2781
+ field: "style",
2782
+ attr: "style",
2783
+ kind: "string"
2784
+ },
2785
+ {
2786
+ field: "fill",
2787
+ attr: "fill",
2788
+ kind: "trueFalse"
2789
+ },
2790
+ {
2791
+ field: "fillcolor",
2792
+ attr: "fillcolor",
2793
+ kind: "string"
2794
+ },
2795
+ {
2796
+ field: "stroke",
2797
+ attr: "stroke",
2798
+ kind: "trueFalse"
2799
+ },
2800
+ {
2801
+ field: "strokecolor",
2802
+ attr: "strokecolor",
2803
+ kind: "string"
2804
+ },
2805
+ {
2806
+ field: "allowincell",
2807
+ attr: "o:allowincell",
2808
+ kind: "trueFalse"
2809
+ }
2810
+ ];
2811
+ /** Serialize o:shapedefaults. */
2812
+ function stringifyVmlShapeDefaults(opts) {
2813
+ const children = [];
2814
+ if (opts.fillElement !== void 0) children.push(stringifyVmlFill(opts.fillElement));
2815
+ if (opts.strokeElement !== void 0) children.push(stringifyVmlStroke(opts.strokeElement));
2816
+ if (opts.textbox !== void 0) children.push(stringifyVmlTextbox(opts.textbox));
2817
+ if (opts.shadow !== void 0) children.push(stringifyVmlShadow(opts.shadow));
2818
+ if (opts.skew !== void 0) children.push(stringifyVmlSkew(opts.skew));
2819
+ if (opts.extrusion !== void 0) children.push(stringifyVmlExtrusion(opts.extrusion));
2820
+ if (opts.callout !== void 0) children.push(stringifyVmlCallout(opts.callout));
2821
+ if (opts.lock !== void 0) children.push(stringifyVmlLock(opts.lock));
2822
+ if (opts.colormru !== void 0) children.push(stringifyVmlColorMru(opts.colormru));
2823
+ if (opts.colormenu !== void 0) children.push(stringifyVmlColorMenu(opts.colormenu));
2824
+ const attrStr = stringifyVmlAttributes(opts, SHAPEDEFAULTS_ATTRS);
2825
+ return children.length > 0 ? `<o:shapedefaults${attrStr}>${children.join("")}</o:shapedefaults>` : `<o:shapedefaults${attrStr}/>`;
2826
+ }
2827
+ /** Parse an o:shapedefaults element. */
2828
+ function parseVmlShapeDefaults(el) {
2829
+ const out = {};
2830
+ parseVmlAttributes(el, SHAPEDEFAULTS_ATTRS, out);
2831
+ for (const child of el.elements ?? []) {
2832
+ if (child.type !== "element") continue;
2833
+ switch (child.name) {
2834
+ case "v:fill":
2835
+ out.fillElement = parseVmlFill(child);
2836
+ break;
2837
+ case "v:stroke":
2838
+ out.strokeElement = parseVmlStroke(child);
2839
+ break;
2840
+ case "v:textbox":
2841
+ out.textbox = parseVmlTextbox(child);
2842
+ break;
2843
+ case "v:shadow":
2844
+ out.shadow = parseVmlShadow(child);
2845
+ break;
2846
+ case "o:skew":
2847
+ out.skew = parseVmlSkew(child);
2848
+ break;
2849
+ case "o:extrusion":
2850
+ out.extrusion = parseVmlExtrusion(child);
2851
+ break;
2852
+ case "o:callout":
2853
+ out.callout = parseVmlCallout(child);
2854
+ break;
2855
+ case "o:lock":
2856
+ out.lock = parseVmlLock(child);
2857
+ break;
2858
+ case "o:colormru":
2859
+ out.colormru = parseVmlColorMru(child);
2860
+ break;
2861
+ case "o:colormenu":
2862
+ out.colormenu = parseVmlColorMenu(child);
2863
+ break;
2864
+ }
2865
+ }
2866
+ return out;
2867
+ }
2868
+ /** Serialize o:colormru. */
2869
+ function stringifyVmlColorMru(opts) {
2870
+ return `<o:colormru${stringifyVmlAttributes(opts, [{
2871
+ field: "ext",
2872
+ attr: "v:ext",
2873
+ kind: "string"
2874
+ }, {
2875
+ field: "colors",
2876
+ attr: "colors",
2877
+ kind: "string"
2878
+ }])}/>`;
2879
+ }
2880
+ /** Parse an o:colormru element. */
2881
+ function parseVmlColorMru(el) {
2882
+ const out = {};
2883
+ parseVmlAttributes(el, [{
2884
+ field: "ext",
2885
+ attr: "v:ext",
2886
+ kind: "string"
2887
+ }, {
2888
+ field: "colors",
2889
+ attr: "colors",
2890
+ kind: "string"
2891
+ }], out);
2892
+ return out;
2893
+ }
2894
+ const COLORMENU_ATTRS = [
2895
+ {
2896
+ field: "ext",
2897
+ attr: "v:ext",
2898
+ kind: "string"
2899
+ },
2900
+ {
2901
+ field: "strokecolor",
2902
+ attr: "strokecolor",
2903
+ kind: "string"
2904
+ },
2905
+ {
2906
+ field: "fillcolor",
2907
+ attr: "fillcolor",
2908
+ kind: "string"
2909
+ },
2910
+ {
2911
+ field: "shadowcolor",
2912
+ attr: "shadowcolor",
2913
+ kind: "string"
2914
+ },
2915
+ {
2916
+ field: "extrusioncolor",
2917
+ attr: "extrusioncolor",
2918
+ kind: "string"
2919
+ }
2920
+ ];
2921
+ /** Serialize o:colormenu. */
2922
+ function stringifyVmlColorMenu(opts) {
2923
+ return `<o:colormenu${stringifyVmlAttributes(opts, COLORMENU_ATTRS)}/>`;
2924
+ }
2925
+ /** Parse an o:colormenu element. */
2926
+ function parseVmlColorMenu(el) {
2927
+ const out = {};
2928
+ parseVmlAttributes(el, COLORMENU_ATTRS, out);
2929
+ return out;
2930
+ }
2931
+ const ENTRY_ATTRS = [{
2932
+ field: "new",
2933
+ attr: "new",
2934
+ kind: "number"
2935
+ }, {
2936
+ field: "old",
2937
+ attr: "old",
2938
+ kind: "number"
2939
+ }];
2940
+ /** Serialize an o:idmap. */
2941
+ function stringifyVmlIdMap(opts) {
2942
+ return `<o:idmap${stringifyVmlAttributes(opts, [{
2943
+ field: "ext",
2944
+ attr: "v:ext",
2945
+ kind: "string"
2946
+ }, {
2947
+ field: "data",
2948
+ attr: "data",
2949
+ kind: "string"
2950
+ }])}/>`;
2951
+ }
2952
+ /** Parse an o:idmap element. */
2953
+ function parseVmlIdMap(el) {
2954
+ const out = {};
2955
+ parseVmlAttributes(el, [{
2956
+ field: "ext",
2957
+ attr: "v:ext",
2958
+ kind: "string"
2959
+ }, {
2960
+ field: "data",
2961
+ attr: "data",
2962
+ kind: "string"
2963
+ }], out);
2964
+ return out;
2965
+ }
2966
+ /** Serialize an o:regrouptable. */
2967
+ function stringifyVmlRegroupTable(opts) {
2968
+ const entries = (opts.entries ?? []).map((entry) => `<o:entry${stringifyVmlAttributes(entry, ENTRY_ATTRS)}/>`).join("");
2969
+ return `<o:regrouptable${stringifyVmlAttributes(opts, [{
2970
+ field: "ext",
2971
+ attr: "v:ext",
2972
+ kind: "string"
2973
+ }])}>${entries}</o:regrouptable>`;
2974
+ }
2975
+ /** Parse an o:regrouptable element. */
2976
+ function parseVmlRegroupTable(el) {
2977
+ const out = {};
2978
+ parseVmlAttributes(el, [{
2979
+ field: "ext",
2980
+ attr: "v:ext",
2981
+ kind: "string"
2982
+ }], out);
2983
+ const entries = [];
2984
+ for (const child of el.elements ?? []) if (child.type === "element" && child.name === "o:entry") {
2985
+ const entry = {};
2986
+ parseVmlAttributes(child, ENTRY_ATTRS, entry);
2987
+ entries.push(entry);
2988
+ }
2989
+ if (entries.length > 0) out.entries = entries;
2990
+ return out;
2991
+ }
2992
+ /** Serialize a proxy child inside an o:r. */
2993
+ function stringifyVmlRuleProxy(proxy) {
2994
+ const attrs = [];
2995
+ if (proxy.start !== void 0) attrs.push(`start="${proxy.start === "" ? "" : proxy.start ? "t" : "f"}"`);
2996
+ if (proxy.end !== void 0) attrs.push(`end="${proxy.end === "" ? "" : proxy.end ? "t" : "f"}"`);
2997
+ if (proxy.idref !== void 0) attrs.push(`idref="${proxy.idref}"`);
2998
+ if (proxy.connectloc !== void 0) attrs.push(`connectloc="${proxy.connectloc}"`);
2999
+ return `<o:proxy${attrs.length > 0 ? " " + attrs.join(" ") : ""}/>`;
3000
+ }
3001
+ /** Parse an o:proxy element. */
3002
+ function parseVmlRuleProxy(el) {
3003
+ const out = {};
3004
+ const attrs = el.attributes ?? {};
3005
+ if (attrs.start !== void 0) {
3006
+ const raw = String(attrs.start);
3007
+ out.start = raw === "" ? "" : raw === "t" || raw === "true" || raw === "1";
3008
+ }
3009
+ if (attrs.end !== void 0) {
3010
+ const raw = String(attrs.end);
3011
+ out.end = raw === "" ? "" : raw === "t" || raw === "true" || raw === "1";
3012
+ }
3013
+ if (attrs.idref !== void 0) out.idref = String(attrs.idref);
3014
+ if (attrs.connectloc !== void 0) out.connectloc = Number(attrs.connectloc);
3015
+ return out;
3016
+ }
3017
+ /** Serialize an o:r (hand-written — `id` is required, so no table-driven cast). */
3018
+ function stringifyVmlRule(rule) {
3019
+ const attrs = [`id="${rule.id}"`];
3020
+ if (rule.type !== void 0) attrs.push(`type="${rule.type}"`);
3021
+ if (rule.how !== void 0) attrs.push(`how="${rule.how}"`);
3022
+ if (rule.idref !== void 0) attrs.push(`idref="${rule.idref}"`);
3023
+ const proxies = (rule.proxies ?? []).map(stringifyVmlRuleProxy).join("");
3024
+ return `<o:r${attrs.length > 0 ? " " + attrs.join(" ") : ""}>${proxies}</o:r>`;
3025
+ }
3026
+ /** Parse an o:r element. */
3027
+ function parseVmlRule(el) {
3028
+ const attrs = el.attributes ?? {};
3029
+ const out = { id: String(attrs.id ?? "") };
3030
+ if (attrs.type !== void 0) out.type = String(attrs.type);
3031
+ if (attrs.how !== void 0) out.how = String(attrs.how);
3032
+ if (attrs.idref !== void 0) out.idref = String(attrs.idref);
3033
+ const proxies = [];
3034
+ for (const child of el.elements ?? []) if (child.type === "element" && child.name === "o:proxy") proxies.push(parseVmlRuleProxy(child));
3035
+ if (proxies.length > 0) out.proxies = proxies;
3036
+ return out;
3037
+ }
3038
+ /** Serialize an o:rules block. */
3039
+ function stringifyVmlRulesBlock(opts) {
3040
+ const rules = (opts.rules ?? []).map(stringifyVmlRule).join("");
3041
+ return `<o:rules${stringifyVmlAttributes(opts, [{
3042
+ field: "ext",
3043
+ attr: "v:ext",
3044
+ kind: "string"
3045
+ }])}>${rules}</o:rules>`;
3046
+ }
3047
+ /** Parse an o:rules element. */
3048
+ function parseVmlRulesBlock(el) {
3049
+ const out = {};
3050
+ parseVmlAttributes(el, [{
3051
+ field: "ext",
3052
+ attr: "v:ext",
3053
+ kind: "string"
3054
+ }], out);
3055
+ const rules = [];
3056
+ for (const child of el.elements ?? []) if (child.type === "element" && child.name === "o:r") rules.push(parseVmlRule(child));
3057
+ if (rules.length > 0) out.rules = rules;
3058
+ return out;
3059
+ }
3060
+ /** Serialize o:shapelayout. */
3061
+ function stringifyVmlShapeLayout(opts) {
3062
+ const children = [];
3063
+ if (opts.idmap !== void 0) children.push(stringifyVmlIdMap(opts.idmap));
3064
+ if (opts.regrouptable !== void 0) children.push(stringifyVmlRegroupTable(opts.regrouptable));
3065
+ if (opts.rules !== void 0) children.push(stringifyVmlRulesBlock(opts.rules));
3066
+ const attrStr = stringifyVmlAttributes(opts, [{
3067
+ field: "ext",
3068
+ attr: "v:ext",
3069
+ kind: "string"
3070
+ }]);
3071
+ return children.length > 0 ? `<o:shapelayout${attrStr}>${children.join("")}</o:shapelayout>` : `<o:shapelayout${attrStr}/>`;
3072
+ }
3073
+ /** Parse an o:shapelayout element. */
3074
+ function parseVmlShapeLayout(el) {
3075
+ const out = {};
3076
+ parseVmlAttributes(el, [{
3077
+ field: "ext",
3078
+ attr: "v:ext",
3079
+ kind: "string"
3080
+ }], out);
3081
+ for (const child of el.elements ?? []) {
3082
+ if (child.type !== "element") continue;
3083
+ if (child.name === "o:idmap") out.idmap = parseVmlIdMap(child);
3084
+ else if (child.name === "o:regrouptable") out.regrouptable = parseVmlRegroupTable(child);
3085
+ else if (child.name === "o:rules") out.rules = parseVmlRulesBlock(child);
3086
+ }
3087
+ return out;
3088
+ }
3089
+ //#endregion
3090
+ export { parseVmlPath as $, stringifyVmlRect as A, stringifyVmlLock as At, stringifyVmlWrap as B, parseVmlTrueFalse as Bt, stringifyVmlBackground as C, stringifyVmlCallout as Ct, stringifyVmlLine as D, stringifyVmlEquationXml as Dt, stringifyVmlImage as E, stringifyVmlDiagram as Et, parseVmlAnchorLock as F, VML_CORE_ATTRS as Ft, parseVmlStroke as G, parseVmlShapeStyle as Gt, stringifyVmlTextPath as H, stringifyVmlAttributes as Ht, parseVmlBorder as I, VML_OFFICE_CORE_ATTRS as It, stringifyVmlShadow as J, styleToKeyMap as Jt, stringifyVmlStroke as K, parseVmlStyle as Kt, parseVmlWrap as L, VML_OFFICE_SHAPE_ATTRS as Lt, stringifyVmlShape as M, stringifyVmlOleObject as Mt, stringifyVmlShapetype as N, stringifyVmlSignatureLine as Nt, stringifyVmlOval as O, stringifyVmlExtrusion as Ot, VML_BORDER_TAGS as P, stringifyVmlSkew as Pt, stringifyVmlTextData as Q, stringifyVmlAnchorLock as R, VML_SHAPE_ATTRS as Rt, stringifyVmlArc as S, parseVmlSkew as St, stringifyVmlGroup as T, stringifyVmlComplex as Tt, parseVmlTextbox as U, stringifyVmlTrueFalse as Ut, parseVmlTextPath as V, parseVmlTrueFalseBlank as Vt, stringifyVmlTextbox as W, stringifyVmlTrueFalseBlank as Wt, parseVmlTextData as X, parseVmlIsComment as Y, stringifyVmlIsComment as Z, parseVmlPolyline as _, parseVmlInk as _t, stringifyVmlColorMenu as a, parseVmlFormulas as at, parseVmlShape as b, parseVmlOleObject as bt, stringifyVmlShapeLayout as c, stringifyVmlFill as ct, parseVmlBackground as d, parseVmlCallout as dt, stringifyVmlPath as et, parseVmlCurve as f, parseVmlClipPath as ft, parseVmlOval as g, parseVmlExtrusion as gt, parseVmlLine as h, parseVmlEquationXml as ht, parseVmlShapeLayout as i, stringifyVmlHandles as it, stringifyVmlRoundRect as j, stringifyVmlOfficeFill as jt, stringifyVmlPolyline as k, stringifyVmlInk as kt, nextVmlShapeId as l, parseVmlClientData as lt, parseVmlImage as m, parseVmlDiagram as mt, parseVmlColorMru as n, stringifyVmlImageData as nt, stringifyVmlColorMru as o, stringifyVmlFormulas as ot, parseVmlGroup as p, parseVmlComplex as pt, parseVmlShadow as q, stringifyVmlStyle as qt, parseVmlShapeDefaults as r, parseVmlHandles as rt, stringifyVmlShapeDefaults as s, parseVmlFill as st, parseVmlColorMenu as t, parseVmlImageData as tt, parseVmlArc as u, stringifyVmlClientData as ut, parseVmlRect as v, parseVmlLock as vt, stringifyVmlCurve as w, stringifyVmlClipPath as wt, parseVmlShapetype as x, parseVmlSignatureLine as xt, parseVmlRoundRect as y, parseVmlOfficeFill as yt, stringifyVmlBorder as z, parseVmlAttributes as zt };
3091
+
3092
+ //# sourceMappingURL=vector-TpjW6ZSc.mjs.map