@office-open/core 0.11.0 → 0.12.1

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 (85) hide show
  1. package/dist/chart/index.d.mts +2 -2
  2. package/dist/chart/index.mjs +2 -2
  3. package/dist/{chart-Kf_utasF.mjs → chart-BAnjzVoe.mjs} +861 -287
  4. package/dist/chart-BAnjzVoe.mjs.map +1 -0
  5. package/dist/data-type-CZMKVaaT.d.mts.map +1 -1
  6. package/dist/descriptor/index.d.mts +1 -1
  7. package/dist/descriptor/index.mjs +1 -1
  8. package/dist/{descriptor-BX8xW8na.mjs → descriptor-BqaNZrrZ.mjs} +38 -10
  9. package/dist/{descriptor-BX8xW8na.mjs.map → descriptor-BqaNZrrZ.mjs.map} +1 -1
  10. package/dist/drawing/index.d.mts +2 -2
  11. package/dist/drawing/index.mjs +2 -2
  12. package/dist/{drawing-FBzd2I0m.mjs → drawing-BVwCkNXB.mjs} +3062 -3131
  13. package/dist/drawing-BVwCkNXB.mjs.map +1 -0
  14. package/dist/{generators-CElPsAhd.mjs → ext-uri-BHBcIrW7.mjs} +599 -343
  15. package/dist/ext-uri-BHBcIrW7.mjs.map +1 -0
  16. package/dist/index-BAxlDUQ1.d.mts +590 -0
  17. package/dist/index-BAxlDUQ1.d.mts.map +1 -0
  18. package/dist/{index-CLX7gU9J.d.mts → index-BQLIofaF.d.mts} +3 -2
  19. package/dist/index-BQLIofaF.d.mts.map +1 -0
  20. package/dist/{index-k8WKLXnA.d.mts → index-CaNwM5_e.d.mts} +19 -20
  21. package/dist/index-CaNwM5_e.d.mts.map +1 -0
  22. package/dist/{index-CnjCK-lF.d.mts → index-DPkf_CtG.d.mts} +566 -597
  23. package/dist/index-DPkf_CtG.d.mts.map +1 -0
  24. package/dist/{index-BsTUn4K1.d.mts → index-DcukVskh.d.mts} +9 -6
  25. package/dist/index-DcukVskh.d.mts.map +1 -0
  26. package/dist/{index-Cgz88FU0.d.mts → index-Di6XPdGl.d.mts} +26 -12
  27. package/dist/index-Di6XPdGl.d.mts.map +1 -0
  28. package/dist/{index-C0ClOhmZ.d.mts → index-L6AXewfV.d.mts} +11 -8
  29. package/dist/index-L6AXewfV.d.mts.map +1 -0
  30. package/dist/{index-DxwLMnBF.d.mts → index-k1h_t946.d.mts} +219 -99
  31. package/dist/index-k1h_t946.d.mts.map +1 -0
  32. package/dist/index.d.mts +161 -29
  33. package/dist/index.d.mts.map +1 -1
  34. package/dist/index.mjs +873 -87
  35. package/dist/index.mjs.map +1 -1
  36. package/dist/{output-D_G_JR_8.d.mts → output-yyxdkG0C.d.mts} +2 -3
  37. package/dist/output-yyxdkG0C.d.mts.map +1 -0
  38. package/dist/patch/index.d.mts +2 -2
  39. package/dist/patch/index.mjs +2 -2
  40. package/dist/{patch-3KLx2yEP.mjs → patch-AkQY17CD.mjs} +71 -26
  41. package/dist/patch-AkQY17CD.mjs.map +1 -0
  42. package/dist/smartart/index.d.mts +2 -2
  43. package/dist/smartart/index.mjs +1 -1
  44. package/dist/{smartart-BxnkROOp.mjs → smartart-DV6ZcN5R.mjs} +27 -26
  45. package/dist/smartart-DV6ZcN5R.mjs.map +1 -0
  46. package/dist/{style-matrix-DAP6XrLv.mjs → style-matrix-DjhMuuQg.mjs} +4 -4
  47. package/dist/style-matrix-DjhMuuQg.mjs.map +1 -0
  48. package/dist/theme/index.d.mts +4 -4
  49. package/dist/theme/index.mjs +3 -2
  50. package/dist/{theme-OAuRcA9_.mjs → theme-Dx0Db9bX.mjs} +37 -71
  51. package/dist/theme-Dx0Db9bX.mjs.map +1 -0
  52. package/dist/{theme-options-BbWccl85.d.mts → theme-options-kO89NUEX.d.mts} +17 -17
  53. package/dist/theme-options-kO89NUEX.d.mts.map +1 -0
  54. package/dist/util/index.d.mts +3 -3
  55. package/dist/util/index.mjs +3 -3
  56. package/dist/{util-C94-JKtp.mjs → util-ptE16MEk.mjs} +69 -37
  57. package/dist/util-ptE16MEk.mjs.map +1 -0
  58. package/dist/{values-aVoirbWB.d.mts → values-BECDm4zr.d.mts} +15 -31
  59. package/dist/values-BECDm4zr.d.mts.map +1 -0
  60. package/dist/vector/index.d.mts +2 -2
  61. package/dist/vector/index.mjs +2 -2
  62. package/dist/{vector-TpjW6ZSc.mjs → vector-DhLGZjP5.mjs} +104 -147
  63. package/dist/vector-DhLGZjP5.mjs.map +1 -0
  64. package/package.json +3 -3
  65. package/dist/chart-Kf_utasF.mjs.map +0 -1
  66. package/dist/drawing-FBzd2I0m.mjs.map +0 -1
  67. package/dist/generators-CElPsAhd.mjs.map +0 -1
  68. package/dist/index-BsTUn4K1.d.mts.map +0 -1
  69. package/dist/index-C0ClOhmZ.d.mts.map +0 -1
  70. package/dist/index-CLX7gU9J.d.mts.map +0 -1
  71. package/dist/index-Cgz88FU0.d.mts.map +0 -1
  72. package/dist/index-CnjCK-lF.d.mts.map +0 -1
  73. package/dist/index-DpPeyf5f.d.mts +0 -316
  74. package/dist/index-DpPeyf5f.d.mts.map +0 -1
  75. package/dist/index-DxwLMnBF.d.mts.map +0 -1
  76. package/dist/index-k8WKLXnA.d.mts.map +0 -1
  77. package/dist/output-D_G_JR_8.d.mts.map +0 -1
  78. package/dist/patch-3KLx2yEP.mjs.map +0 -1
  79. package/dist/smartart-BxnkROOp.mjs.map +0 -1
  80. package/dist/style-matrix-DAP6XrLv.mjs.map +0 -1
  81. package/dist/theme-OAuRcA9_.mjs.map +0 -1
  82. package/dist/theme-options-BbWccl85.d.mts.map +0 -1
  83. package/dist/util-C94-JKtp.mjs.map +0 -1
  84. package/dist/values-aVoirbWB.d.mts.map +0 -1
  85. package/dist/vector-TpjW6ZSc.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"vector-TpjW6ZSc.mjs","names":[],"sources":["../src/vector/style.ts","../src/vector/attributes.ts","../src/vector/shape-elements/office-elements.ts","../src/vector/shape-elements/client-data.ts","../src/vector/shape-elements/fill.ts","../src/vector/shape-elements/formulas.ts","../src/vector/shape-elements/handles.ts","../src/vector/shape-elements/imagedata.ts","../src/vector/shape-elements/path.ts","../src/vector/shape-elements/presentation-elements.ts","../src/vector/shape-elements/shadow.ts","../src/vector/shape-elements/stroke.ts","../src/vector/shape-elements/textbox.ts","../src/vector/shape-elements/textpath.ts","../src/vector/shape-elements/word-elements.ts","../src/vector/shapes.ts","../src/vector/office-shape-defaults.ts"],"sourcesContent":["/**\n * VML style mini-language.\n *\n * VML elements (v:shape, v:rect, …) carry layout in a CSS-like `style`\n * attribute (`\"position:absolute;width:100pt;height:50pt\"`). This module owns\n * the shared vocabulary: the VmlShapeStyle type, the property-name mapping,\n * and the stringify/parse pair used by the shape element serializers in this\n * domain.\n *\n * References:\n * - https://c-rex.net/samples/ooxml/e1/Part3/OOXML_P3_Primer_OfficeArt_topic_ID0ELU5O.html\n * - http://webapp.docx4java.org/OnlineDemo/ecma376/VML/shape.html\n *\n * @module\n */\nimport type { Percentage, RelativeMeasure, UniversalMeasure } from \"../util/values\";\n\n/**\n * Represents a length unit value for VML shape styling.\n *\n * Length units can be specified in multiple formats:\n * - \"auto\" - Automatically calculated by the application\n * - number - Numeric value (typically in points)\n * - Percentage - Percentage-based measurement\n * - UniversalMeasure - Measurement with explicit units (pt, cm, in, etc.)\n * - RelativeMeasure - Relative measurement units\n */\nexport type LengthUnit = \"auto\" | number | Percentage | UniversalMeasure | RelativeMeasure;\n\n/**\n * Maps VmlShapeStyle property names to their corresponding CSS-style property names.\n * Used internally for converting TypeScript-friendly property names to VML style attributes.\n */\nexport const styleToKeyMap: Record<keyof VmlShapeStyle, string> = {\n flip: \"flip\",\n height: \"height\",\n left: \"left\",\n marginBottom: \"margin-bottom\",\n marginLeft: \"margin-left\",\n marginRight: \"margin-right\",\n marginTop: \"margin-top\",\n position: \"position\",\n positionHorizontal: \"mso-position-horizontal\",\n positionHorizontalRelative: \"mso-position-horizontal-relative\",\n positionVertical: \"mso-position-vertical\",\n positionVerticalRelative: \"mso-position-vertical-relative\",\n rotation: \"rotation\",\n top: \"top\",\n visibility: \"visibility\",\n width: \"width\",\n wrapDistanceBottom: \"mso-wrap-distance-bottom\",\n wrapDistanceLeft: \"mso-wrap-distance-left\",\n wrapDistanceRight: \"mso-wrap-distance-right\",\n wrapDistanceTop: \"mso-wrap-distance-top\",\n wrapEdited: \"mso-wrap-edited\",\n wrapStyle: \"mso-wrap-style\",\n fitShapeToText: \"mso-fit-shape-to-text\",\n directionAlt: \"mso-direction-alt\",\n zIndex: \"z-index\",\n};\n\n/**\n * Serialize a VmlShapeStyle object to the VML style attribute value\n * (`\"width:100pt;height:50pt\"`), translating property names via\n * {@link styleToKeyMap}.\n */\nexport function stringifyVmlStyle(style: VmlShapeStyle): string {\n return Object.entries(style)\n .map(([key, value]) => {\n // VML's CSS-style vocabulary spells booleans t/f (mso-fit-shape-to-text:t).\n const text = typeof value === \"boolean\" ? (value ? \"t\" : \"f\") : String(value);\n return `${styleToKeyMap[key as keyof VmlShapeStyle]}:${text}`;\n })\n .join(\";\");\n}\n\n/**\n * Parse a VML style attribute value into a CSS-name-keyed record\n * (`{ \"mso-position-horizontal\": \"absolute\", … }`). Keys stay in VML/CSS form;\n * callers read the entries they understand (width/height, wrap distances, …).\n */\nexport function parseVmlStyle(styleStr: string): Record<string, string> {\n const style: Record<string, string> = {};\n for (const part of styleStr.split(\";\")) {\n const [key, val] = part.split(\":\").map((s) => s.trim());\n if (key && val) style[key] = val;\n }\n return style;\n}\n\n/** Reverse of {@link styleToKeyMap} — CSS-style property name → VmlShapeStyle field. */\nconst keyToStyleMap = Object.fromEntries(\n Object.entries(styleToKeyMap).map(([field, key]) => [key, field]),\n) as Record<string, keyof VmlShapeStyle>;\n\nconst NUMERIC = /^-?\\d+(\\.\\d+)?$/;\n\n/**\n * Parse a CSS-name-keyed style record into a VmlShapeStyle object (camelCase\n * fields, numeric and boolean literals coerced) — the inverse of\n * {@link stringifyVmlStyle}. Keys outside the map are dropped.\n */\nexport function parseVmlShapeStyle(record: Record<string, string>): VmlShapeStyle {\n const style: Partial<Record<keyof VmlShapeStyle, unknown>> = {};\n for (const [key, value] of Object.entries(record)) {\n const field = keyToStyleMap[key];\n if (!field) continue;\n if (field === \"wrapEdited\" || field === \"fitShapeToText\") {\n style[field] = value === \"t\" || value === \"true\";\n } else if (NUMERIC.test(value)) {\n style[field] = Number(value);\n } else {\n style[field] = value;\n }\n }\n return style as unknown as VmlShapeStyle;\n}\n\n/**\n * VML shape styling properties for WordprocessingML documents.\n *\n * These properties map to CSS-style attributes on VML shape elements and control\n * the shape's appearance, layout, and interaction with surrounding text.\n */\nexport interface VmlShapeStyle {\n /** Specifies that the orientation of a shape is flipped. Default is no value. */\n flip?: \"x\" | \"y\" | \"xy\" | \"yx\";\n /** Specifies the height of the containing block of the shape. Default is 0. */\n height?: LengthUnit;\n /** Specifies the position of the left of the containing block relative to the element left of it. Default is 0. */\n left?: LengthUnit;\n /** Specifies the position of the bottom of the containing block relative to the shape anchor. Default is 0. */\n marginBottom?: LengthUnit;\n /** Specifies the position of the left of the containing block relative to the shape anchor. Default is 0. */\n marginLeft?: LengthUnit;\n /** Specifies the position of the right of the containing block relative to the shape anchor. Default is 0. */\n marginRight?: LengthUnit;\n /** Specifies the position of the top of the containing block relative to the shape anchor. Default is 0. */\n marginTop?: LengthUnit;\n /** Specifies the horizontal positioning data. Default is absolute. */\n positionHorizontal?: \"absolute\" | \"left\" | \"center\" | \"right\" | \"inside\" | \"outside\";\n /** Specifies relative horizontal position data. Default is text. */\n positionHorizontalRelative?: \"margin\" | \"page\" | \"text\" | \"char\";\n /** Specifies the vertical positioning data. Default is absolute. */\n positionVertical?: \"absolute\" | \"left\" | \"center\" | \"right\" | \"inside\" | \"outside\";\n /** Specifies relative vertical position data. Default is text. */\n positionVerticalRelative?: \"margin\" | \"page\" | \"text\" | \"char\";\n /** Specifies the distance from the bottom of the shape to the text that wraps around it. Default is 0 pt. */\n wrapDistanceBottom?: number;\n /** Specifies the distance from the left side of the shape to the text that wraps around it. Default is 0 pt. */\n wrapDistanceLeft?: number;\n /** Specifies the distance from the right side of the shape to the text that wraps around it. Default is 0 pt. */\n wrapDistanceRight?: number;\n /** Specifies the distance from the top of the shape to the text that wraps around it. Default is 0 pt. */\n wrapDistanceTop?: number;\n /** Specifies whether the wrap coordinates were customized by the user. Default is false. */\n wrapEdited?: boolean;\n /** Specifies that a shape's height adjusts to fit its text. Default is false. */\n fitShapeToText?: boolean;\n /** Textbox text-flow override — \"auto\" lets paragraph direction decide. */\n directionAlt?: \"auto\";\n /** Specifies the wrapping mode for text in shapes. Default is square. */\n wrapStyle?: \"square\" | \"none\";\n /** Specifies the type of positioning used to place an element. Default is static. */\n position?: \"static\" | \"absolute\" | \"relative\";\n /** Specifies the angle that a shape is rotated, in degrees. Default is 0. */\n rotation?: number;\n /** Specifies the position of the top of the containing block. Default is 0. */\n top?: LengthUnit;\n /** Specifies whether a shape is displayed. Default is inherit. */\n visibility?: \"hidden\" | \"inherit\";\n /** Specifies the width of the containing block. Default is 0. */\n width?: LengthUnit;\n /** Specifies the display order of overlapping shapes. Default is 0. */\n zIndex?: \"auto\" | number;\n}\n","/**\n * VML attribute-group serialization — AG_AllCoreAttributes /\n * AG_AllShapeAttributes and their v: subgroups.\n *\n * Every shape-ish element (shape, shapetype, group, and the eight basic\n * shapes) carries the same attribute vocabulary, so the field↔attribute\n * mapping lives here once and the element serializers consume it. The office\n * attribute subgroups (o: prefix, injected by vml-officeDrawing.xsd) join the\n * same table in `office-attributes.ts`; a merged spec list is all a caller\n * passes to {@link stringifyVmlAttributes} / {@link parseVmlAttributes}.\n *\n * Reference: ISO/IEC 29500-4, vml-main.xsd, AG_CoreAttributes,\n * AG_ShapeAttributes and their compositions.\n *\n * @module\n */\nimport type { Element as XmlElement } from \"@office-open/xml\";\nimport { escapeXml } from \"@office-open/xml\";\n\nimport type { VmlShapeStyle } from \"./style\";\n\n// ── Shared types ──\n\n/** s:ST_TrueFalse — VML boolean attributes serialize as \"t\"/\"f\". */\nexport type VmlTrueFalse = boolean;\n\n/** s:ST_ColorType kept verbatim — VML colors carry forms like \"red\" or \"infoBackground [80]\". */\nexport type VmlColor = string;\n\n/** s:ST_TrueFalseBlank — a boolean that also admits the empty-string form. */\nexport type VmlTrueFalseBlank = boolean | \"\";\n\n/** ST_BWMode (o:) — black-and-white rendering fallback. */\nexport type VmlBlackWhiteMode =\n | \"color\"\n | \"auto\"\n | \"grayScale\"\n | \"lightGrayscale\"\n | \"inverseGray\"\n | \"grayOutline\"\n | \"highContrast\"\n | \"black\"\n | \"white\"\n | \"hide\"\n | \"undrawn\"\n | \"blackTextAndLines\";\n\n/** ST_ConnectorType (o:). */\nexport type VmlConnectorType = \"none\" | \"straight\" | \"elbow\" | \"curved\";\n\n/** ST_HrAlign (o:) — horizontal-rule alignment. */\nexport type VmlHorizontalRuleAlign = \"left\" | \"right\" | \"center\";\n\n/** ST_InsetMode (o:). */\nexport type VmlInsetMode = \"auto\" | \"custom\";\n\n/** ST_ConnectType (o:). */\nexport type VmlConnectType = \"none\" | \"rect\" | \"segments\" | \"custom\";\n\n/** ST_ScreenSize (o:) — the resolution presets Office writes verbatim. */\nexport type VmlScreenSize = \"544,376\" | \"640,480\" | \"720,512\" | \"800,600\" | \"1024,768\" | \"1152,862\";\n\n/** ST_DiagramLayout (o:) — layout code kept in its XML string spelling. */\nexport type VmlDiagramLayout = \"0\" | \"1\" | \"2\" | \"3\";\n\n/** AG_CoreAttributes (v: namespace). `style` expands via the style mini-language. */\nexport interface VmlCoreAttributes {\n id?: string;\n style?: VmlShapeStyle;\n href?: string;\n target?: string;\n class?: string;\n title?: string;\n alt?: string;\n /** \"21600,21600\" — coordinate space of the shape. */\n coordsize?: string;\n /** \"0,0\" — origin of the coordinate space. */\n coordorigin?: string;\n wrapcoords?: string;\n print?: VmlTrueFalse;\n}\n\n/** AG_ShapeAttributes (v: namespace). */\nexport interface VmlShapeAttributes {\n chromakey?: VmlColor;\n filled?: VmlTrueFalse;\n fillcolor?: VmlColor;\n opacity?: string;\n stroked?: VmlTrueFalse;\n strokecolor?: VmlColor;\n strokeweight?: string;\n insetpen?: VmlTrueFalse;\n}\n\n// ── Attribute table ──\n\n/** How a field converts to/from its XML attribute form. */\nexport type VmlAttrKind = \"string\" | \"trueFalse\" | \"trueFalseBlank\" | \"number\";\n\nexport interface VmlAttrSpec {\n /** Options field name. */\n field: string;\n /** XML attribute name including its prefix (\"o:title\", \"r:id\"). */\n attr: string;\n kind: VmlAttrKind;\n}\n\n/** AG_CoreAttributes — `style` is special-cased (mini-language), not tabulated. */\nexport const VML_CORE_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"id\", attr: \"id\", kind: \"string\" },\n { field: \"href\", attr: \"href\", kind: \"string\" },\n { field: \"target\", attr: \"target\", kind: \"string\" },\n { field: \"class\", attr: \"class\", kind: \"string\" },\n { field: \"title\", attr: \"title\", kind: \"string\" },\n { field: \"alt\", attr: \"alt\", kind: \"string\" },\n { field: \"coordsize\", attr: \"coordsize\", kind: \"string\" },\n { field: \"coordorigin\", attr: \"coordorigin\", kind: \"string\" },\n { field: \"wrapcoords\", attr: \"wrapcoords\", kind: \"string\" },\n { field: \"print\", attr: \"print\", kind: \"trueFalse\" },\n];\n\n/** AG_ShapeAttributes. */\nexport const VML_SHAPE_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"chromakey\", attr: \"chromakey\", kind: \"string\" },\n { field: \"filled\", attr: \"filled\", kind: \"trueFalse\" },\n { field: \"fillcolor\", attr: \"fillcolor\", kind: \"string\" },\n { field: \"opacity\", attr: \"opacity\", kind: \"string\" },\n { field: \"stroked\", attr: \"stroked\", kind: \"trueFalse\" },\n { field: \"strokecolor\", attr: \"strokecolor\", kind: \"string\" },\n { field: \"strokeweight\", attr: \"strokeweight\", kind: \"string\" },\n { field: \"insetpen\", attr: \"insetpen\", kind: \"trueFalse\" },\n];\n\n// ── Office attribute groups (o:, vml-officeDrawing.xsd) ──\n\n/**\n * AG_OfficeCoreAttributes — the o: members folded into AG_AllCoreAttributes,\n * carried by every shape-ish element alongside {@link VmlCoreAttributes}.\n */\nexport interface VmlOfficeCoreAttributes {\n /** o:spid — shape id from the drawing part's id map. */\n spid?: string;\n /** o:oned — the shape is a one-dimensional connector. */\n oned?: VmlTrueFalse;\n regroupid?: number;\n doubleclicknotify?: VmlTrueFalse;\n /** o:button — the shape behaves as a button. */\n button?: VmlTrueFalse;\n userhidden?: VmlTrueFalse;\n /** o:bullet — paragraph mark rendered as a list bullet. */\n bullet?: VmlTrueFalse;\n /** o:hr — horizontal rule. */\n hr?: VmlTrueFalse;\n hrstd?: VmlTrueFalse;\n hrnoshade?: VmlTrueFalse;\n /** Horizontal-rule width in percent. */\n hrpct?: number;\n hralign?: VmlHorizontalRuleAlign;\n allowincell?: VmlTrueFalse;\n allowoverlap?: VmlTrueFalse;\n userdrawn?: VmlTrueFalse;\n bordertopcolor?: VmlColor;\n borderleftcolor?: VmlColor;\n borderbottomcolor?: VmlColor;\n borderrightcolor?: VmlColor;\n dgmlayout?: VmlDiagramLayout;\n dgmnodekind?: number;\n dgmlayoutmru?: VmlDiagramLayout;\n insetmode?: VmlInsetMode;\n}\n\n/**\n * AG_OfficeShapeAttributes — the o: members folded into AG_AllShapeAttributes.\n */\nexport interface VmlOfficeShapeAttributes {\n /** o:spt — shape-type number (202 = textbox, 75 = picture frame, …). */\n spt?: number;\n connectortype?: VmlConnectorType;\n bwmode?: VmlBlackWhiteMode;\n bwpure?: VmlBlackWhiteMode;\n bwnormal?: VmlBlackWhiteMode;\n /** o:forcedash — always render dashed (accessibility). */\n forcedash?: VmlTrueFalse;\n oleicon?: VmlTrueFalse;\n /** o:ole — OLE behavior flag; ST_TrueFalseBlank (\"\" | boolean). */\n ole?: VmlTrueFalseBlank;\n preferrelative?: VmlTrueFalse;\n cliptowrap?: VmlTrueFalse;\n clip?: VmlTrueFalse;\n}\n\n/** AG_OfficeCoreAttributes — field names mirror the o: attribute names. */\nexport const VML_OFFICE_CORE_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"spid\", attr: \"o:spid\", kind: \"string\" },\n { field: \"oned\", attr: \"o:oned\", kind: \"trueFalse\" },\n { field: \"regroupid\", attr: \"o:regroupid\", kind: \"number\" },\n { field: \"doubleclicknotify\", attr: \"o:doubleclicknotify\", kind: \"trueFalse\" },\n { field: \"button\", attr: \"o:button\", kind: \"trueFalse\" },\n { field: \"userhidden\", attr: \"o:userhidden\", kind: \"trueFalse\" },\n { field: \"bullet\", attr: \"o:bullet\", kind: \"trueFalse\" },\n { field: \"hr\", attr: \"o:hr\", kind: \"trueFalse\" },\n { field: \"hrstd\", attr: \"o:hrstd\", kind: \"trueFalse\" },\n { field: \"hrnoshade\", attr: \"o:hrnoshade\", kind: \"trueFalse\" },\n { field: \"hrpct\", attr: \"o:hrpct\", kind: \"number\" },\n { field: \"hralign\", attr: \"o:hralign\", kind: \"string\" },\n { field: \"allowincell\", attr: \"o:allowincell\", kind: \"trueFalse\" },\n { field: \"allowoverlap\", attr: \"o:allowoverlap\", kind: \"trueFalse\" },\n { field: \"userdrawn\", attr: \"o:userdrawn\", kind: \"trueFalse\" },\n { field: \"bordertopcolor\", attr: \"o:bordertopcolor\", kind: \"string\" },\n { field: \"borderleftcolor\", attr: \"o:borderleftcolor\", kind: \"string\" },\n { field: \"borderbottomcolor\", attr: \"o:borderbottomcolor\", kind: \"string\" },\n { field: \"borderrightcolor\", attr: \"o:borderrightcolor\", kind: \"string\" },\n { field: \"dgmlayout\", attr: \"o:dgmlayout\", kind: \"string\" },\n { field: \"dgmnodekind\", attr: \"o:dgmnodekind\", kind: \"number\" },\n { field: \"dgmlayoutmru\", attr: \"o:dgmlayoutmru\", kind: \"string\" },\n { field: \"insetmode\", attr: \"o:insetmode\", kind: \"string\" },\n];\n\n/** AG_OfficeShapeAttributes. */\nexport const VML_OFFICE_SHAPE_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"spt\", attr: \"o:spt\", kind: \"number\" },\n { field: \"connectortype\", attr: \"o:connectortype\", kind: \"string\" },\n { field: \"bwmode\", attr: \"o:bwmode\", kind: \"string\" },\n { field: \"bwpure\", attr: \"o:bwpure\", kind: \"string\" },\n { field: \"bwnormal\", attr: \"o:bwnormal\", kind: \"string\" },\n { field: \"forcedash\", attr: \"o:forcedash\", kind: \"trueFalse\" },\n { field: \"oleicon\", attr: \"o:oleicon\", kind: \"trueFalse\" },\n { field: \"ole\", attr: \"o:ole\", kind: \"string\" },\n { field: \"preferrelative\", attr: \"o:preferrelative\", kind: \"trueFalse\" },\n { field: \"cliptowrap\", attr: \"o:cliptowrap\", kind: \"trueFalse\" },\n { field: \"clip\", attr: \"o:clip\", kind: \"trueFalse\" },\n];\n\n// ── Value coercion ──\n\n/** s:ST_TrueFalse output form — \"t\"/\"f\", the spelling Office itself writes. */\nexport function stringifyVmlTrueFalse(value: boolean): \"t\" | \"f\" {\n return value ? \"t\" : \"f\";\n}\n\n/** Accepts every ST_TrueFalse input spelling. */\nexport function parseVmlTrueFalse(value: string): boolean {\n return value === \"t\" || value === \"true\" || value === \"1\";\n}\n\n// ── Table-driven attribute (de)serialization ──\n\n/**\n * Serialize the tabulated fields of `opts` into one attribute string (leading\n * space included when non-empty). The `style` field of\n * {@link VmlCoreAttributes} joins here so callers need a single call.\n */\nexport function stringifyVmlAttributes(\n opts: Record<string, unknown>,\n specs: readonly VmlAttrSpec[],\n): string {\n const parts: string[] = [];\n for (const spec of specs) {\n const value = opts[spec.field];\n if (value === undefined) continue;\n const text =\n spec.kind === \"trueFalse\"\n ? stringifyVmlTrueFalse(value as boolean)\n : spec.kind === \"trueFalseBlank\"\n ? stringifyVmlTrueFalseBlank(value as VmlTrueFalseBlank)\n : spec.kind === \"number\"\n ? String(value as number)\n : escapeXml(String(value as string));\n parts.push(`${spec.attr}=\"${text}\"`);\n }\n return parts.length > 0 ? ` ${parts.join(\" \")}` : \"\";\n}\n\n/** Serialize a boolean-or-empty ST_TrueFalseBlank (\"t\"/\"f\"/\"\"). */\nexport function stringifyVmlTrueFalseBlank(value: VmlTrueFalseBlank): string {\n return value === \"\" ? \"\" : stringifyVmlTrueFalse(value);\n}\n\n/** Parse a boolean-or-empty ST_TrueFalseBlank. */\nexport function parseVmlTrueFalseBlank(value: string): VmlTrueFalseBlank {\n return value === \"\" ? \"\" : parseVmlTrueFalse(value);\n}\n\n/** Inverse of {@link stringifyVmlAttributes} — fills the tabulated fields onto `out`. */\nexport function parseVmlAttributes(\n el: XmlElement,\n specs: readonly VmlAttrSpec[],\n out: Record<string, unknown>,\n): void {\n for (const spec of specs) {\n const raw = el.attributes?.[spec.attr];\n if (raw === undefined) continue;\n out[spec.field] =\n spec.kind === \"trueFalse\"\n ? parseVmlTrueFalse(String(raw))\n : spec.kind === \"trueFalseBlank\"\n ? parseVmlTrueFalseBlank(String(raw))\n : spec.kind === \"number\"\n ? Number(raw)\n : String(raw);\n }\n}\n","/**\n * Office-drawing o: elements — the EG_ShapeElements members defined in\n * vml-officeDrawing.xsd (skew, extrusion, callout, lock, clippath,\n * signatureline, ink, equationxml, diagram) plus the standalone o:fill,\n * o:complex and o:OLEObject.\n *\n * Every element carries the v:ext attribute (AG_Ext, ST_Ext) exposing the\n * extension-slot behavior.\n *\n * Reference: ISO/IEC 29500-4, vml-officeDrawing.xsd.\n *\n * @module\n */\nimport type { Element as XmlElement } from \"@office-open/xml\";\nimport { escapeXml, stringifyElement } from \"@office-open/xml\";\n\nimport {\n stringifyVmlAttributes,\n parseVmlAttributes,\n stringifyVmlTrueFalse,\n parseVmlTrueFalse,\n stringifyVmlTrueFalseBlank,\n parseVmlTrueFalseBlank,\n type VmlAttrSpec,\n type VmlColor,\n type VmlTrueFalse,\n type VmlTrueFalseBlank,\n} from \"../attributes\";\n\nexport { stringifyVmlTrueFalseBlank, parseVmlTrueFalseBlank };\n\n// The scalar o: enums live in `attributes.ts` (they feed the shared attribute\n// tables); re-exported here so the office-elements module stays the one-stop\n// import for its consumers.\nexport type {\n VmlBlackWhiteMode,\n VmlConnectorType,\n VmlHorizontalRuleAlign,\n VmlInsetMode,\n VmlConnectType,\n VmlScreenSize,\n VmlDiagramLayout,\n VmlTrueFalseBlank,\n} from \"../attributes\";\n\n// ── Shared types ──\n\n/** ST_Ext — the v:ext extension-slot attribute carried by every o: element. */\nexport type VmlExtensionMode = \"view\" | \"edit\" | \"backwardCompatible\";\n\n/** The AG_Ext attribute present on every o: element. */\nexport interface VmlExtAttribute {\n ext?: VmlExtensionMode;\n}\n\n/** AG_Ext as a spec entry — prepend to every o: element's spec list. */\nconst EXT_ATTR: readonly VmlAttrSpec[] = [{ field: \"ext\", attr: \"v:ext\", kind: \"string\" }];\n\n// ── o:skew ──\n\n/** o:skew options (CT_Skew). */\nexport interface VmlSkewOptions extends VmlExtAttribute {\n id?: string;\n on?: VmlTrueFalse;\n offset?: string;\n origin?: string;\n matrix?: string;\n}\n\nconst SKEW_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"id\", attr: \"id\", kind: \"string\" },\n { field: \"on\", attr: \"on\", kind: \"trueFalse\" },\n { field: \"offset\", attr: \"offset\", kind: \"string\" },\n { field: \"origin\", attr: \"origin\", kind: \"string\" },\n { field: \"matrix\", attr: \"matrix\", kind: \"string\" },\n];\n\n/** Serialize o:skew. */\nexport function stringifyVmlSkew(opts: VmlSkewOptions): string {\n return `<o:skew${stringifyVmlAttributes(opts as Record<string, unknown>, [...EXT_ATTR, ...SKEW_ATTRS])}/>`;\n}\n\n/** Parse an o:skew element. */\nexport function parseVmlSkew(el: XmlElement): VmlSkewOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, [...EXT_ATTR, ...SKEW_ATTRS], out);\n return out as VmlSkewOptions;\n}\n\n// ── o:extrusion ──\n\n/** ST_ExtrusionType. */\nexport type VmlExtrusionType = \"perspective\" | \"parallel\";\n\n/** ST_ExtrusionRender. */\nexport type VmlExtrusionRender = \"solid\" | \"wireFrame\" | \"boundingCube\";\n\n/** ST_ExtrusionPlane. */\nexport type VmlExtrusionPlane = \"XY\" | \"ZX\" | \"YZ\";\n\n/** ST_ColorMode. */\nexport type VmlColorMode = \"auto\" | \"custom\";\n\n/** o:extrusion options (CT_Extrusion). */\nexport interface VmlExtrusionOptions extends VmlExtAttribute {\n on?: VmlTrueFalse;\n type?: VmlExtrusionType;\n render?: VmlExtrusionRender;\n viewpointorigin?: string;\n viewpoint?: string;\n plane?: VmlExtrusionPlane;\n skewangle?: number;\n skewamt?: string;\n foredepth?: string;\n backdepth?: string;\n orientation?: string;\n orientationangle?: number;\n lockrotationcenter?: VmlTrueFalse;\n autorotationcenter?: VmlTrueFalse;\n rotationcenter?: string;\n rotationangle?: string;\n colormode?: VmlColorMode;\n color?: VmlColor;\n shininess?: number;\n specularity?: string;\n diffusity?: string;\n metal?: VmlTrueFalse;\n edge?: string;\n facet?: string;\n lightface?: VmlTrueFalse;\n brightness?: string;\n lightposition?: string;\n lightlevel?: string;\n lightharsh?: VmlTrueFalse;\n lightposition2?: string;\n lightlevel2?: string;\n lightharsh2?: VmlTrueFalse;\n}\n\nconst EXTRUSION_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"on\", attr: \"on\", kind: \"trueFalse\" },\n { field: \"type\", attr: \"type\", kind: \"string\" },\n { field: \"render\", attr: \"render\", kind: \"string\" },\n { field: \"viewpointorigin\", attr: \"viewpointorigin\", kind: \"string\" },\n { field: \"viewpoint\", attr: \"viewpoint\", kind: \"string\" },\n { field: \"plane\", attr: \"plane\", kind: \"string\" },\n { field: \"skewangle\", attr: \"skewangle\", kind: \"number\" },\n { field: \"skewamt\", attr: \"skewamt\", kind: \"string\" },\n { field: \"foredepth\", attr: \"foredepth\", kind: \"string\" },\n { field: \"backdepth\", attr: \"backdepth\", kind: \"string\" },\n { field: \"orientation\", attr: \"orientation\", kind: \"string\" },\n { field: \"orientationangle\", attr: \"orientationangle\", kind: \"number\" },\n { field: \"lockrotationcenter\", attr: \"lockrotationcenter\", kind: \"trueFalse\" },\n { field: \"autorotationcenter\", attr: \"autorotationcenter\", kind: \"trueFalse\" },\n { field: \"rotationcenter\", attr: \"rotationcenter\", kind: \"string\" },\n { field: \"rotationangle\", attr: \"rotationangle\", kind: \"string\" },\n { field: \"colormode\", attr: \"colormode\", kind: \"string\" },\n { field: \"color\", attr: \"color\", kind: \"string\" },\n { field: \"shininess\", attr: \"shininess\", kind: \"number\" },\n { field: \"specularity\", attr: \"specularity\", kind: \"string\" },\n { field: \"diffusity\", attr: \"diffusity\", kind: \"string\" },\n { field: \"metal\", attr: \"metal\", kind: \"trueFalse\" },\n { field: \"edge\", attr: \"edge\", kind: \"string\" },\n { field: \"facet\", attr: \"facet\", kind: \"string\" },\n { field: \"lightface\", attr: \"lightface\", kind: \"trueFalse\" },\n { field: \"brightness\", attr: \"brightness\", kind: \"string\" },\n { field: \"lightposition\", attr: \"lightposition\", kind: \"string\" },\n { field: \"lightlevel\", attr: \"lightlevel\", kind: \"string\" },\n { field: \"lightharsh\", attr: \"lightharsh\", kind: \"trueFalse\" },\n { field: \"lightposition2\", attr: \"lightposition2\", kind: \"string\" },\n { field: \"lightlevel2\", attr: \"lightlevel2\", kind: \"string\" },\n { field: \"lightharsh2\", attr: \"lightharsh2\", kind: \"trueFalse\" },\n];\n\n/** Serialize o:extrusion. */\nexport function stringifyVmlExtrusion(opts: VmlExtrusionOptions): string {\n return `<o:extrusion${stringifyVmlAttributes(opts as Record<string, unknown>, [...EXT_ATTR, ...EXTRUSION_ATTRS])}/>`;\n}\n\n/** Parse an o:extrusion element. */\nexport function parseVmlExtrusion(el: XmlElement): VmlExtrusionOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, [...EXT_ATTR, ...EXTRUSION_ATTRS], out);\n return out as VmlExtrusionOptions;\n}\n\n// ── o:callout ──\n\n/** ST_Angle — the callout leader-angle presets, kept in XML spelling. */\nexport type VmlCalloutAngle = \"any\" | \"30\" | \"45\" | \"60\" | \"90\" | \"auto\";\n\n/** o:callout options (CT_Callout). */\nexport interface VmlCalloutOptions extends VmlExtAttribute {\n on?: VmlTrueFalse;\n type?: string;\n gap?: string;\n angle?: VmlCalloutAngle;\n dropauto?: VmlTrueFalse;\n drop?: string;\n distance?: string;\n lengthspecified?: VmlTrueFalse;\n length?: string;\n accentbar?: VmlTrueFalse;\n textborder?: VmlTrueFalse;\n minusx?: VmlTrueFalse;\n minusy?: VmlTrueFalse;\n}\n\nconst CALLOUT_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"on\", attr: \"on\", kind: \"trueFalse\" },\n { field: \"type\", attr: \"type\", kind: \"string\" },\n { field: \"gap\", attr: \"gap\", kind: \"string\" },\n { field: \"angle\", attr: \"angle\", kind: \"string\" },\n { field: \"dropauto\", attr: \"dropauto\", kind: \"trueFalse\" },\n { field: \"drop\", attr: \"drop\", kind: \"string\" },\n { field: \"distance\", attr: \"distance\", kind: \"string\" },\n { field: \"lengthspecified\", attr: \"lengthspecified\", kind: \"trueFalse\" },\n { field: \"length\", attr: \"length\", kind: \"string\" },\n { field: \"accentbar\", attr: \"accentbar\", kind: \"trueFalse\" },\n { field: \"textborder\", attr: \"textborder\", kind: \"trueFalse\" },\n { field: \"minusx\", attr: \"minusx\", kind: \"trueFalse\" },\n { field: \"minusy\", attr: \"minusy\", kind: \"trueFalse\" },\n];\n\n/** Serialize o:callout. */\nexport function stringifyVmlCallout(opts: VmlCalloutOptions): string {\n return `<o:callout${stringifyVmlAttributes(opts as Record<string, unknown>, [...EXT_ATTR, ...CALLOUT_ATTRS])}/>`;\n}\n\n/** Parse an o:callout element. */\nexport function parseVmlCallout(el: XmlElement): VmlCalloutOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, [...EXT_ATTR, ...CALLOUT_ATTRS], out);\n return out as VmlCalloutOptions;\n}\n\n// ── o:lock ──\n\n/** o:lock options (CT_Lock) — a true flag locks the capability. */\nexport interface VmlLockOptions extends VmlExtAttribute {\n position?: VmlTrueFalse;\n selection?: VmlTrueFalse;\n grouping?: VmlTrueFalse;\n ungrouping?: VmlTrueFalse;\n rotation?: VmlTrueFalse;\n cropping?: VmlTrueFalse;\n verticies?: VmlTrueFalse;\n adjusthandles?: VmlTrueFalse;\n text?: VmlTrueFalse;\n aspectratio?: VmlTrueFalse;\n shapetype?: VmlTrueFalse;\n}\n\nconst LOCK_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"position\", attr: \"position\", kind: \"trueFalse\" },\n { field: \"selection\", attr: \"selection\", kind: \"trueFalse\" },\n { field: \"grouping\", attr: \"grouping\", kind: \"trueFalse\" },\n { field: \"ungrouping\", attr: \"ungrouping\", kind: \"trueFalse\" },\n { field: \"rotation\", attr: \"rotation\", kind: \"trueFalse\" },\n { field: \"cropping\", attr: \"cropping\", kind: \"trueFalse\" },\n { field: \"verticies\", attr: \"verticies\", kind: \"trueFalse\" },\n { field: \"adjusthandles\", attr: \"adjusthandles\", kind: \"trueFalse\" },\n { field: \"text\", attr: \"text\", kind: \"trueFalse\" },\n { field: \"aspectratio\", attr: \"aspectratio\", kind: \"trueFalse\" },\n { field: \"shapetype\", attr: \"shapetype\", kind: \"trueFalse\" },\n];\n\n/** Serialize o:lock. */\nexport function stringifyVmlLock(opts: VmlLockOptions): string {\n return `<o:lock${stringifyVmlAttributes(opts as Record<string, unknown>, [...EXT_ATTR, ...LOCK_ATTRS])}/>`;\n}\n\n/** Parse an o:lock element. */\nexport function parseVmlLock(el: XmlElement): VmlLockOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, [...EXT_ATTR, ...LOCK_ATTRS], out);\n return out as VmlLockOptions;\n}\n\n// ── o:clippath ──\n\n/** o:clippath options (CT_ClipPath). The path attribute is qualified: `v:v`. */\nexport interface VmlClipPathOptions {\n /** Path command string, serialized as the `v:v` attribute. */\n v: string;\n}\n\n/** Serialize o:clippath. */\nexport function stringifyVmlClipPath(opts: VmlClipPathOptions): string {\n return `<o:clippath v:v=\"${escapeXml(opts.v)}\"/>`;\n}\n\n/** Parse an o:clippath element. */\nexport function parseVmlClipPath(el: XmlElement): VmlClipPathOptions {\n return { v: String(el.attributes?.[\"v:v\"] ?? \"\") };\n}\n\n// ── o:signatureline ──\n\n/** o:signatureline options (CT_SignatureLine). */\nexport interface VmlSignatureLineOptions extends VmlExtAttribute {\n issignatureline?: VmlTrueFalse;\n /** s:ST_Guid — a GUID string. */\n id?: string;\n provid?: string;\n signinginstructionsset?: VmlTrueFalse;\n allowcomments?: VmlTrueFalse;\n showsigndate?: VmlTrueFalse;\n suggestedsigner?: string;\n suggestedsigner2?: string;\n suggestedsigneremail?: string;\n signinginstructions?: string;\n addlxml?: string;\n sigprovurl?: string;\n}\n\nconst SIGNATURE_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"issignatureline\", attr: \"issignatureline\", kind: \"trueFalse\" },\n { field: \"id\", attr: \"id\", kind: \"string\" },\n { field: \"provid\", attr: \"provid\", kind: \"string\" },\n { field: \"signinginstructionsset\", attr: \"signinginstructionsset\", kind: \"trueFalse\" },\n { field: \"allowcomments\", attr: \"allowcomments\", kind: \"trueFalse\" },\n { field: \"showsigndate\", attr: \"showsigndate\", kind: \"trueFalse\" },\n // form=\"qualified\" in the XSD — serialized with the o: prefix.\n { field: \"suggestedsigner\", attr: \"o:suggestedsigner\", kind: \"string\" },\n { field: \"suggestedsigner2\", attr: \"o:suggestedsigner2\", kind: \"string\" },\n { field: \"suggestedsigneremail\", attr: \"o:suggestedsigneremail\", kind: \"string\" },\n { field: \"signinginstructions\", attr: \"signinginstructions\", kind: \"string\" },\n { field: \"addlxml\", attr: \"addlxml\", kind: \"string\" },\n { field: \"sigprovurl\", attr: \"sigprovurl\", kind: \"string\" },\n];\n\n/** Serialize o:signatureline. */\nexport function stringifyVmlSignatureLine(opts: VmlSignatureLineOptions): string {\n return `<o:signatureline${stringifyVmlAttributes(opts as Record<string, unknown>, [...EXT_ATTR, ...SIGNATURE_ATTRS])}/>`;\n}\n\n/** Parse an o:signatureline element. */\nexport function parseVmlSignatureLine(el: XmlElement): VmlSignatureLineOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, [...EXT_ATTR, ...SIGNATURE_ATTRS], out);\n return out as VmlSignatureLineOptions;\n}\n\n// ── o:ink ──\n\n/** o:ink options (CT_Ink) — Tablet PC ink annotation data. */\nexport interface VmlInkOptions {\n /** Ink data — an ISF-encoded string. */\n i: string;\n annotation?: VmlTrueFalse;\n contentType?: string;\n}\n\n/** Serialize o:ink (hand-written — `i` is required, so no table-driven cast). */\nexport function stringifyVmlInk(opts: VmlInkOptions): string {\n const attrs = [`i=\"${escapeXml(opts.i)}\"`];\n if (opts.annotation !== undefined) {\n attrs.push(`annotation=\"${stringifyVmlTrueFalse(opts.annotation)}\"`);\n }\n if (opts.contentType !== undefined) attrs.push(`contentType=\"${escapeXml(opts.contentType)}\"`);\n return `<o:ink ${attrs.join(\" \")}/>`;\n}\n\n/** Parse an o:ink element. */\nexport function parseVmlInk(el: XmlElement): VmlInkOptions {\n const out: VmlInkOptions = { i: String(el.attributes?.i ?? \"\") };\n if (el.attributes?.annotation !== undefined) {\n out.annotation = parseVmlTrueFalse(String(el.attributes.annotation));\n }\n if (el.attributes?.contentType !== undefined) {\n out.contentType = String(el.attributes.contentType);\n }\n return out;\n}\n\n// ── o:equationxml ──\n\n/**\n * o:equationxml options (CT_EquationXml) — the alternative math content,\n * carried as verbatim inner XML (the XSD allows any single element).\n */\nexport interface VmlEquationXmlOptions {\n contentType?: string;\n /** Inner XML of the alternate equation element, serialized verbatim. */\n content?: string;\n}\n\n/** Serialize o:equationxml. */\nexport function stringifyVmlEquationXml(opts: VmlEquationXmlOptions): string {\n const attrStr =\n opts.contentType !== undefined ? ` contentType=\"${escapeXml(opts.contentType)}\"` : \"\";\n return `<o:equationxml${attrStr}>${opts.content ?? \"\"}</o:equationxml>`;\n}\n\n/** Parse an o:equationxml element. */\nexport function parseVmlEquationXml(el: XmlElement): VmlEquationXmlOptions {\n const out: VmlEquationXmlOptions = {};\n const contentType = el.attributes?.contentType;\n if (contentType !== undefined) out.contentType = String(contentType);\n if ((el.elements ?? []).length > 0) {\n const child = el.elements!.find((c) => c.type === \"element\");\n if (child) {\n out.content = stringifyElement(child);\n }\n }\n return out;\n}\n\n// ── o:diagram ──\n\n/** CT_Relation — one relationtable row. */\nexport interface VmlDiagramRelationOptions extends VmlExtAttribute {\n idsrc?: string;\n iddest?: string;\n idcntr?: string;\n}\n\nconst RELATION_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"idsrc\", attr: \"idsrc\", kind: \"string\" },\n { field: \"iddest\", attr: \"iddest\", kind: \"string\" },\n { field: \"idcntr\", attr: \"idcntr\", kind: \"string\" },\n];\n\n/** o:diagram options (CT_Diagram) — legacy org-chart/diagram shape group. */\nexport interface VmlDiagramOptions extends VmlExtAttribute {\n dgmstyle?: number;\n autoformat?: VmlTrueFalse;\n reverse?: VmlTrueFalse;\n autolayout?: VmlTrueFalse;\n dgmscalex?: number;\n dgmscaley?: number;\n dgmfontsize?: number;\n constrainbounds?: string;\n dgmbasetextscale?: number;\n relations?: VmlDiagramRelationOptions[];\n}\n\nconst DIAGRAM_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"dgmstyle\", attr: \"dgmstyle\", kind: \"number\" },\n { field: \"autoformat\", attr: \"autoformat\", kind: \"trueFalse\" },\n { field: \"reverse\", attr: \"reverse\", kind: \"trueFalse\" },\n { field: \"autolayout\", attr: \"autolayout\", kind: \"trueFalse\" },\n { field: \"dgmscalex\", attr: \"dgmscalex\", kind: \"number\" },\n { field: \"dgmscaley\", attr: \"dgmscaley\", kind: \"number\" },\n { field: \"dgmfontsize\", attr: \"dgmfontsize\", kind: \"number\" },\n { field: \"constrainbounds\", attr: \"constrainbounds\", kind: \"string\" },\n { field: \"dgmbasetextscale\", attr: \"dgmbasetextscale\", kind: \"number\" },\n];\n\n/** Serialize o:diagram. */\nexport function stringifyVmlDiagram(opts: VmlDiagramOptions): string {\n const relations = (opts.relations ?? [])\n .map(\n (rel) =>\n `<o:rel${stringifyVmlAttributes(rel as Record<string, unknown>, [...EXT_ATTR, ...RELATION_ATTRS])}/>`,\n )\n .join(\"\");\n const children = relations !== \"\" ? `<o:relationtable>${relations}</o:relationtable>` : \"\";\n return `<o:diagram${stringifyVmlAttributes(opts as Record<string, unknown>, [...EXT_ATTR, ...DIAGRAM_ATTRS])}>${children}</o:diagram>`;\n}\n\n/** Parse an o:diagram element. */\nexport function parseVmlDiagram(el: XmlElement): VmlDiagramOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, [...EXT_ATTR, ...DIAGRAM_ATTRS], out);\n const relationTable = (el.elements ?? []).find(\n (c) => c.type === \"element\" && c.name === \"o:relationtable\",\n );\n if (relationTable) {\n const relations: VmlDiagramRelationOptions[] = [];\n for (const child of relationTable.elements ?? []) {\n if (child.type === \"element\" && child.name === \"o:rel\") {\n const rel: Record<string, unknown> = {};\n parseVmlAttributes(child, [...EXT_ATTR, ...RELATION_ATTRS], rel);\n relations.push(rel as VmlDiagramRelationOptions);\n }\n }\n if (relations.length > 0) out.relations = relations;\n }\n return out as VmlDiagramOptions;\n}\n\n// ── o:complex ──\n\n/** o:complex options (CT_Complex) — the extension slot at the end of CT_Shapetype. */\nexport interface VmlComplexOptions extends VmlExtAttribute {}\n\n/** Serialize o:complex. */\nexport function stringifyVmlComplex(opts: VmlComplexOptions): string {\n return `<o:complex${stringifyVmlAttributes(opts as Record<string, unknown>, EXT_ATTR)}/>`;\n}\n\n/** Parse an o:complex element. */\nexport function parseVmlComplex(el: XmlElement): VmlComplexOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, EXT_ATTR, out);\n return out as VmlComplexOptions;\n}\n\n// ── o:fill ──\n\n/** ST_FillType (o: namespace form — includes the gradientCenter/background variants). */\nexport type VmlOfficeFillType =\n | \"gradientCenter\"\n | \"solid\"\n | \"pattern\"\n | \"tile\"\n | \"frame\"\n | \"gradientUnscaled\"\n | \"gradientRadial\"\n | \"gradient\"\n | \"background\";\n\n/** o:fill options (CT_Fill) — the o: extension child of v:fill. */\nexport interface VmlOfficeFillOptions extends VmlExtAttribute {\n type?: VmlOfficeFillType;\n}\n\n/** Serialize o:fill. */\nexport function stringifyVmlOfficeFill(opts: VmlOfficeFillOptions): string {\n return `<o:fill${stringifyVmlAttributes(opts as Record<string, unknown>, EXT_ATTR)}${opts.type !== undefined ? ` type=\"${opts.type}\"` : \"\"}/>`;\n}\n\n/** Parse an o:fill element. */\nexport function parseVmlOfficeFill(el: XmlElement): VmlOfficeFillOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, EXT_ATTR, out);\n if (el.attributes?.type !== undefined) out.type = String(el.attributes.type);\n return out as VmlOfficeFillOptions;\n}\n\n// ── o:OLEObject ──\n\n/** ST_OLEType. */\nexport type VmlOleObjectType = \"Embed\" | \"Link\";\n\n/** ST_OLEDrawAspect. */\nexport type VmlOleDrawAspect = \"Content\" | \"Icon\";\n\n/** ST_OLEUpdateMode. */\nexport type VmlOleUpdateMode = \"Always\" | \"OnCall\";\n\n/**\n * o:OLEObject options (CT_OLEObject). Attribute names keep the PascalCase\n * XML spelling (ProgID, ShapeID, …) — they mirror the serialized attribute.\n */\nexport interface VmlOleObjectOptions {\n Type?: VmlOleObjectType;\n ProgID?: string;\n ShapeID?: string;\n DrawAspect?: VmlOleDrawAspect;\n ObjectID?: string;\n /** r:id — relationship id, bridged by the caller. */\n relationshipId?: string;\n UpdateMode?: VmlOleUpdateMode;\n /** LinkType child (link-source type string). */\n linkType?: string;\n /** LockedField child. */\n lockedField?: VmlTrueFalseBlank;\n /** FieldCodes child (the FIELD instruction when the object is a field result). */\n fieldCodes?: string;\n}\n\nconst OLE_OBJECT_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"Type\", attr: \"Type\", kind: \"string\" },\n { field: \"ProgID\", attr: \"ProgID\", kind: \"string\" },\n { field: \"ShapeID\", attr: \"ShapeID\", kind: \"string\" },\n { field: \"DrawAspect\", attr: \"DrawAspect\", kind: \"string\" },\n { field: \"ObjectID\", attr: \"ObjectID\", kind: \"string\" },\n { field: \"relationshipId\", attr: \"r:id\", kind: \"string\" },\n { field: \"UpdateMode\", attr: \"UpdateMode\", kind: \"string\" },\n];\n\n/** Serialize o:OLEObject. */\nexport function stringifyVmlOleObject(opts: VmlOleObjectOptions): string {\n const children: string[] = [];\n if (opts.linkType !== undefined) {\n children.push(`<o:LinkType>${escapeXml(opts.linkType)}</o:LinkType>`);\n }\n if (opts.lockedField !== undefined) {\n children.push(`<o:LockedField>${stringifyVmlTrueFalseBlank(opts.lockedField)}</o:LockedField>`);\n }\n if (opts.fieldCodes !== undefined) {\n children.push(`<o:FieldCodes>${escapeXml(opts.fieldCodes)}</o:FieldCodes>`);\n }\n const attrStr = stringifyVmlAttributes(opts as Record<string, unknown>, OLE_OBJECT_ATTRS);\n return children.length > 0\n ? `<o:OLEObject${attrStr}>${children.join(\"\")}</o:OLEObject>`\n : `<o:OLEObject${attrStr}/>`;\n}\n\n/** Read the concatenated text content of an element (LinkType/FieldCodes children). */\nfunction elementText(el: XmlElement): string {\n return (el.elements ?? []).map((child) => String(child.text ?? \"\")).join(\"\");\n}\n\n/** Parse an o:OLEObject element. */\nexport function parseVmlOleObject(el: XmlElement): VmlOleObjectOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, OLE_OBJECT_ATTRS, out);\n for (const child of el.elements ?? []) {\n if (child.type !== \"element\") continue;\n if (child.name === \"o:LinkType\") {\n out.linkType = elementText(child);\n } else if (child.name === \"o:LockedField\") {\n out.lockedField = parseVmlTrueFalseBlank(elementText(child));\n } else if (child.name === \"o:FieldCodes\") {\n out.fieldCodes = elementText(child);\n }\n }\n return out as VmlOleObjectOptions;\n}\n","/**\n * Spreadsheet drawing x:ClientData — the form-control/comment anchor payload\n * every xlsx VML shape carries. One required ObjectType attribute plus a\n * repeating choice of 67 leaf child elements, each holding a single text\n * value (TrueFalseBlank flag, integer, or string).\n *\n * Field names keep the XML PascalCase spelling — they mirror the child\n * elements one-to-one (same decision as o:OLEObject's Type/ProgID).\n *\n * Reference: ISO/IEC 29500-4, vml-spreadsheetDrawing.xsd, CT_ClientData.\n *\n * @module\n */\nimport type { Element as XmlElement } from \"@office-open/xml\";\nimport { escapeXml } from \"@office-open/xml\";\n\nimport type { VmlTrueFalseBlank } from \"../attributes\";\nimport { parseVmlTrueFalseBlank, stringifyVmlTrueFalseBlank } from \"./office-elements\";\n\n/** ST_ObjectType — the legacy form-control kinds. */\nexport type VmlClientObjectType =\n | \"Button\"\n | \"Checkbox\"\n | \"Dialog\"\n | \"Drop\"\n | \"Edit\"\n | \"GBox\"\n | \"Label\"\n | \"LineA\"\n | \"List\"\n | \"Movie\"\n | \"Note\"\n | \"Pict\"\n | \"Radio\"\n | \"RectA\"\n | \"Scroll\"\n | \"Spin\"\n | \"Shape\"\n | \"Group\"\n | \"Rect\";\n\n/** x:ClientData options (CT_ClientData). */\nexport interface VmlClientDataOptions {\n objectType: VmlClientObjectType;\n // ST_TrueFalseBlank children\n MoveWithCells?: VmlTrueFalseBlank;\n SizeWithCells?: VmlTrueFalseBlank;\n Locked?: VmlTrueFalseBlank;\n DefaultSize?: VmlTrueFalseBlank;\n PrintObject?: VmlTrueFalseBlank;\n Disabled?: VmlTrueFalseBlank;\n AutoFill?: VmlTrueFalseBlank;\n AutoLine?: VmlTrueFalseBlank;\n AutoPict?: VmlTrueFalseBlank;\n LockText?: VmlTrueFalseBlank;\n JustLastX?: VmlTrueFalseBlank;\n SecretEdit?: VmlTrueFalseBlank;\n Default?: VmlTrueFalseBlank;\n Help?: VmlTrueFalseBlank;\n Cancel?: VmlTrueFalseBlank;\n Dismiss?: VmlTrueFalseBlank;\n Visible?: VmlTrueFalseBlank;\n RowHidden?: VmlTrueFalseBlank;\n ColHidden?: VmlTrueFalseBlank;\n MultiLine?: VmlTrueFalseBlank;\n VScroll?: VmlTrueFalseBlank;\n ValidIds?: VmlTrueFalseBlank;\n NoThreeD2?: VmlTrueFalseBlank;\n Colored?: VmlTrueFalseBlank;\n NoThreeD?: VmlTrueFalseBlank;\n FirstButton?: VmlTrueFalseBlank;\n Horiz?: VmlTrueFalseBlank;\n MapOCX?: VmlTrueFalseBlank;\n Camera?: VmlTrueFalseBlank;\n RecalcAlways?: VmlTrueFalseBlank;\n AutoScale?: VmlTrueFalseBlank;\n DDE?: VmlTrueFalseBlank;\n UIObj?: VmlTrueFalseBlank;\n // integer children\n Accel?: number;\n Accel2?: number;\n Row?: number;\n Column?: number;\n VTEdit?: number;\n WidthMin?: number;\n Sel?: number;\n DropLines?: number;\n Checked?: number;\n Val?: number;\n Min?: number;\n Max?: number;\n Inc?: number;\n Page?: number;\n Dx?: number;\n ScriptLanguage?: number;\n ScriptLocation?: number;\n // string children\n /** Cell anchor, e.g. \"\\n_Frmd4c1s387\\n1\\n15\\n90\\n1\\n12\\n65\\n85\". */\n Anchor?: string;\n FmlaMacro?: string;\n TextHAlign?: string;\n TextVAlign?: string;\n FmlaRange?: string;\n SelType?: string;\n MultiSel?: string;\n LCT?: string;\n ListItem?: string;\n DropStyle?: string;\n FmlaLink?: string;\n FmlaPict?: string;\n FmlaGroup?: string;\n ScriptText?: string;\n ScriptExtended?: string;\n FmlaTxbx?: string;\n /** CF — clipboard format name. */\n CF?: string;\n}\n\nconst TRUE_FALSE_BLANK_FIELDS = [\n \"MoveWithCells\",\n \"SizeWithCells\",\n \"Locked\",\n \"DefaultSize\",\n \"PrintObject\",\n \"Disabled\",\n \"AutoFill\",\n \"AutoLine\",\n \"AutoPict\",\n \"LockText\",\n \"JustLastX\",\n \"SecretEdit\",\n \"Default\",\n \"Help\",\n \"Cancel\",\n \"Dismiss\",\n \"Visible\",\n \"RowHidden\",\n \"ColHidden\",\n \"MultiLine\",\n \"VScroll\",\n \"ValidIds\",\n \"NoThreeD2\",\n \"Colored\",\n \"NoThreeD\",\n \"FirstButton\",\n \"Horiz\",\n \"MapOCX\",\n \"Camera\",\n \"RecalcAlways\",\n \"AutoScale\",\n \"DDE\",\n \"UIObj\",\n] as const;\n\nconst INTEGER_FIELDS = [\n \"Accel\",\n \"Accel2\",\n \"Row\",\n \"Column\",\n \"VTEdit\",\n \"WidthMin\",\n \"Sel\",\n \"DropLines\",\n \"Checked\",\n \"Val\",\n \"Min\",\n \"Max\",\n \"Inc\",\n \"Page\",\n \"Dx\",\n \"ScriptLanguage\",\n \"ScriptLocation\",\n] as const;\n\nconst STRING_FIELDS = [\n \"Anchor\",\n \"FmlaMacro\",\n \"TextHAlign\",\n \"TextVAlign\",\n \"FmlaRange\",\n \"SelType\",\n \"MultiSel\",\n \"LCT\",\n \"ListItem\",\n \"DropStyle\",\n \"FmlaLink\",\n \"FmlaPict\",\n \"FmlaGroup\",\n \"ScriptText\",\n \"ScriptExtended\",\n \"FmlaTxbx\",\n \"CF\",\n] as const;\n\n/** Serialize x:ClientData. */\nexport function stringifyVmlClientData(opts: VmlClientDataOptions): string {\n const children: string[] = [];\n for (const field of TRUE_FALSE_BLANK_FIELDS) {\n const value = opts[field];\n if (value !== undefined) {\n children.push(`<x:${field}>${stringifyVmlTrueFalseBlank(value)}</x:${field}>`);\n }\n }\n for (const field of INTEGER_FIELDS) {\n const value = opts[field];\n if (value !== undefined) children.push(`<x:${field}>${value}</x:${field}>`);\n }\n for (const field of STRING_FIELDS) {\n const value = opts[field];\n if (value !== undefined) children.push(`<x:${field}>${escapeXml(value)}</x:${field}>`);\n }\n return `<x:ClientData ObjectType=\"${opts.objectType}\">${children.join(\"\")}</x:ClientData>`;\n}\n\n/** Parse an x:ClientData element. */\nexport function parseVmlClientData(el: XmlElement): VmlClientDataOptions {\n const out: VmlClientDataOptions = {\n objectType: String(el.attributes?.ObjectType ?? \"\") as VmlClientObjectType,\n };\n const tfbFields = new Set<string>(TRUE_FALSE_BLANK_FIELDS);\n const intFields = new Set<string>(INTEGER_FIELDS);\n const extras: Record<string, unknown> = {};\n for (const child of el.elements ?? []) {\n if (child.type !== \"element\") continue;\n const local = child.name?.startsWith(\"x:\") ? child.name.slice(2) : null;\n if (local === null) continue;\n const text = (child.elements ?? []).map((c) => String(c.text ?? \"\")).join(\"\");\n if (tfbFields.has(local)) {\n extras[local] = parseVmlTrueFalseBlank(text);\n } else if (intFields.has(local)) {\n extras[local] = Number(text);\n } else if ((STRING_FIELDS as readonly string[]).includes(local)) {\n extras[local] = text;\n }\n }\n return Object.assign(out, extras);\n}\n","/**\n * v:fill element — CT_Fill.\n *\n * Solid / gradient / tile / pattern / frame fill for VML shapes; also the\n * child of v:background. Relationship references (r:id) stay plain strings —\n * callers that bridge media hand in the `{fileName}` placeholder form, exactly\n * like the DrawingML blip path.\n *\n * Reference: ISO/IEC 29500-4, vml-main.xsd, CT_Fill / ST_FillType /\n * ST_FillMethod.\n *\n * @module\n */\nimport type { Element as XmlElement } from \"@office-open/xml\";\n\nimport {\n stringifyVmlAttributes,\n parseVmlAttributes,\n type VmlColor,\n type VmlTrueFalse,\n type VmlAttrSpec,\n} from \"../attributes\";\nimport {\n stringifyVmlOfficeFill,\n parseVmlOfficeFill,\n type VmlOfficeFillOptions,\n} from \"./office-elements\";\n\n/** ST_FillType. */\nexport type VmlFillType = \"solid\" | \"gradient\" | \"gradientRadial\" | \"tile\" | \"pattern\" | \"frame\";\n\n/** ST_FillMethod. */\nexport type VmlFillMethod = \"none\" | \"linear\" | \"sigma\" | \"any\" | \"linear sigma\";\n\n/** ST_ImageAspect. */\nexport type VmlImageAspect = \"ignore\" | \"atMost\" | \"atLeast\";\n\n/** v:fill options (CT_Fill). */\nexport interface VmlFillOptions {\n id?: string;\n type?: VmlFillType;\n on?: VmlTrueFalse;\n color?: VmlColor;\n opacity?: string;\n color2?: VmlColor;\n src?: string;\n size?: string;\n origin?: string;\n position?: string;\n aspect?: VmlImageAspect;\n colors?: string;\n /** Gradient angle in degrees. */\n angle?: number;\n alignshape?: VmlTrueFalse;\n focus?: string;\n focussize?: string;\n focusposition?: string;\n method?: VmlFillMethod;\n recolor?: VmlTrueFalse;\n rotate?: VmlTrueFalse;\n /** Relationship reference; callers bridge media via the placeholder form. */\n relationshipId?: string;\n // o: extension members (AG_FillAttributes o: refs)\n /** o:href — hyperlink target for image fills. */\n officeHref?: string;\n /** o:althref — alternate (high-contrast) image reference. */\n officeAltHref?: string;\n /** o:detectmouseclick — the fill toggles on mouse click. */\n detectmouseclick?: VmlTrueFalse;\n /** o:title — image title. */\n officeTitle?: string;\n /** o:opacity2 — the second-stop opacity. */\n opacity2?: string;\n /** o:relid — relationship id, in the o: extension slot. */\n officeRelationshipId?: string;\n /** o:fill child — the office fill-type extension. */\n officeFill?: VmlOfficeFillOptions;\n}\n\nconst FILL_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"id\", attr: \"id\", kind: \"string\" },\n { field: \"type\", attr: \"type\", kind: \"string\" },\n { field: \"on\", attr: \"on\", kind: \"trueFalse\" },\n { field: \"color\", attr: \"color\", kind: \"string\" },\n { field: \"opacity\", attr: \"opacity\", kind: \"string\" },\n { field: \"color2\", attr: \"color2\", kind: \"string\" },\n { field: \"src\", attr: \"src\", kind: \"string\" },\n { field: \"size\", attr: \"size\", kind: \"string\" },\n { field: \"origin\", attr: \"origin\", kind: \"string\" },\n { field: \"position\", attr: \"position\", kind: \"string\" },\n { field: \"aspect\", attr: \"aspect\", kind: \"string\" },\n { field: \"colors\", attr: \"colors\", kind: \"string\" },\n { field: \"angle\", attr: \"angle\", kind: \"number\" },\n { field: \"alignshape\", attr: \"alignshape\", kind: \"trueFalse\" },\n { field: \"focus\", attr: \"focus\", kind: \"string\" },\n { field: \"focussize\", attr: \"focussize\", kind: \"string\" },\n { field: \"focusposition\", attr: \"focusposition\", kind: \"string\" },\n { field: \"method\", attr: \"method\", kind: \"string\" },\n { field: \"recolor\", attr: \"recolor\", kind: \"trueFalse\" },\n { field: \"rotate\", attr: \"rotate\", kind: \"trueFalse\" },\n { field: \"relationshipId\", attr: \"r:id\", kind: \"string\" },\n { field: \"officeHref\", attr: \"o:href\", kind: \"string\" },\n { field: \"officeAltHref\", attr: \"o:althref\", kind: \"string\" },\n { field: \"detectmouseclick\", attr: \"o:detectmouseclick\", kind: \"trueFalse\" },\n { field: \"officeTitle\", attr: \"o:title\", kind: \"string\" },\n { field: \"opacity2\", attr: \"o:opacity2\", kind: \"string\" },\n { field: \"officeRelationshipId\", attr: \"o:relid\", kind: \"string\" },\n];\n\n/** Serialize v:fill. */\nexport function stringifyVmlFill(opts: VmlFillOptions): string {\n const child = opts.officeFill !== undefined ? stringifyVmlOfficeFill(opts.officeFill) : \"\";\n const attrStr = stringifyVmlAttributes(opts as Record<string, unknown>, FILL_ATTRS);\n return child !== \"\" ? `<v:fill${attrStr}>${child}</v:fill>` : `<v:fill${attrStr}/>`;\n}\n\n/** Parse a v:fill element. */\nexport function parseVmlFill(el: XmlElement): VmlFillOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, FILL_ATTRS, out);\n for (const child of el.elements ?? []) {\n if (child.type === \"element\" && child.name === \"o:fill\") {\n out.officeFill = parseVmlOfficeFill(child);\n break;\n }\n }\n return out as VmlFillOptions;\n}\n","/**\n * v:formulas element — CT_Formulas (list of v:f equation definitions).\n *\n * Reference: ISO/IEC 29500-4, vml-main.xsd, CT_Formulas / CT_F.\n *\n * @module\n */\nimport type { Element as XmlElement } from \"@office-open/xml\";\nimport { escapeXml } from \"@office-open/xml\";\n\n/** v:formulas options (CT_Formulas). */\nexport interface VmlFormulasOptions {\n /** Equation strings, each becoming a `<v:f eqn=\"…\"/>` child. */\n equations?: string[];\n}\n\n/** Serialize v:formulas. */\nexport function stringifyVmlFormulas(opts: VmlFormulasOptions): string {\n const children = (opts.equations ?? []).map((eqn) => `<v:f eqn=\"${escapeXml(eqn)}\"/>`).join(\"\");\n return `<v:formulas>${children}</v:formulas>`;\n}\n\n/** Parse a v:formulas element. */\nexport function parseVmlFormulas(el: XmlElement): VmlFormulasOptions {\n const equations: string[] = [];\n for (const child of el.elements ?? []) {\n if (child.type === \"element\" && child.name === \"v:f\") {\n const eqn = child.attributes?.eqn;\n if (eqn !== undefined) equations.push(String(eqn));\n }\n }\n return equations.length > 0 ? { equations } : {};\n}\n","/**\n * v:handles element — CT_Handles (list of v:h adjustment handles).\n *\n * Reference: ISO/IEC 29500-4, vml-main.xsd, CT_Handles / CT_H.\n *\n * @module\n */\nimport type { Element as XmlElement } from \"@office-open/xml\";\nimport { escapeXml } from \"@office-open/xml\";\n\nimport { stringifyVmlTrueFalse, parseVmlTrueFalse, type VmlTrueFalse } from \"../attributes\";\n\n/** v:h options (CT_H). `switch` matches the XML attribute name. */\nexport interface VmlHandleOptions {\n position?: string;\n polar?: string;\n map?: string;\n invx?: VmlTrueFalse;\n invy?: VmlTrueFalse;\n switch?: VmlTrueFalse;\n xrange?: string;\n yrange?: string;\n radiusrange?: string;\n}\n\n/** v:handles options (CT_Handles). */\nexport interface VmlHandlesOptions {\n handles?: VmlHandleOptions[];\n}\n\nconst HANDLE_STRING_FIELDS = [\n \"position\",\n \"polar\",\n \"map\",\n \"xrange\",\n \"yrange\",\n \"radiusrange\",\n] as const;\nconst HANDLE_BOOLEAN_FIELDS = [\"invx\", \"invy\", \"switch\"] as const;\n\n/** Serialize v:handles. */\nexport function stringifyVmlHandles(opts: VmlHandlesOptions): string {\n const children = (opts.handles ?? []).map((handle) => {\n const attrs: string[] = [];\n for (const field of HANDLE_STRING_FIELDS) {\n const value = handle[field];\n if (value !== undefined) attrs.push(`${field}=\"${escapeXml(value)}\"`);\n }\n for (const field of HANDLE_BOOLEAN_FIELDS) {\n const value = handle[field];\n if (value !== undefined) attrs.push(`${field}=\"${stringifyVmlTrueFalse(value)}\"`);\n }\n const attrStr = attrs.length > 0 ? ` ${attrs.join(\" \")}` : \"\";\n return `<v:h${attrStr}/>`;\n });\n return `<v:handles>${children.join(\"\")}</v:handles>`;\n}\n\n/** Parse a v:handles element. */\nexport function parseVmlHandles(el: XmlElement): VmlHandlesOptions {\n const handles: VmlHandleOptions[] = [];\n for (const child of el.elements ?? []) {\n if (child.type !== \"element\" || child.name !== \"v:h\") continue;\n const handle: VmlHandleOptions = {};\n const attrs = child.attributes ?? {};\n for (const field of HANDLE_STRING_FIELDS) {\n const raw = attrs[field];\n if (raw !== undefined) handle[field] = String(raw);\n }\n for (const field of HANDLE_BOOLEAN_FIELDS) {\n const raw = attrs[field];\n if (raw !== undefined) handle[field] = parseVmlTrueFalse(String(raw));\n }\n handles.push(handle);\n }\n return handles.length > 0 ? { handles } : {};\n}\n","/**\n * v:imagedata element — CT_ImageData.\n *\n * AG_ImageAttributes (crop/gain/gamma …) plus chromakey, the emboss/recolor\n * colors, and the three relationship references. Relationship ids stay plain\n * strings — callers that bridge media hand in the `{fileName}` placeholder\n * form.\n *\n * Reference: ISO/IEC 29500-4, vml-main.xsd, CT_ImageData / AG_ImageAttributes.\n *\n * @module\n */\nimport type { Element as XmlElement } from \"@office-open/xml\";\n\nimport {\n stringifyVmlAttributes,\n parseVmlAttributes,\n type VmlColor,\n type VmlTrueFalse,\n type VmlAttrSpec,\n} from \"../attributes\";\n\n/** v:imagedata options (CT_ImageData). */\nexport interface VmlImageDataOptions {\n id?: string;\n src?: string;\n cropleft?: string;\n croptop?: string;\n cropright?: string;\n cropbottom?: string;\n gain?: string;\n blacklevel?: string;\n gamma?: string;\n grayscale?: VmlTrueFalse;\n bilevel?: VmlTrueFalse;\n chromakey?: VmlColor;\n embosscolor?: VmlColor;\n recolortarget?: VmlColor;\n /** r:id — picture relationship; callers bridge media via the placeholder form. */\n relationshipId?: string;\n /** r:pict — print-output relationship. */\n pictRelationshipId?: string;\n /** r:href — hyperlink relationship. */\n hrefRelationshipId?: string;\n // o: extension members\n /** o:href — hyperlink target. */\n officeHref?: string;\n /** o:althref — alternate (high-contrast) image reference. */\n officeAltHref?: string;\n /** o:title — image title (the tooltip Office shows). */\n officeTitle?: string;\n /** o:oleid — OLE object number. */\n oleid?: number;\n /** o:detectmouseclick — click detection for OLE activation. */\n detectmouseclick?: VmlTrueFalse;\n /** o:movie — movie reference number. */\n movie?: number;\n /** o:relid — relationship id, in the o: extension slot. */\n officeRelationshipId?: string;\n}\n\nconst IMAGEDATA_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"id\", attr: \"id\", kind: \"string\" },\n { field: \"src\", attr: \"src\", kind: \"string\" },\n { field: \"cropleft\", attr: \"cropleft\", kind: \"string\" },\n { field: \"croptop\", attr: \"croptop\", kind: \"string\" },\n { field: \"cropright\", attr: \"cropright\", kind: \"string\" },\n { field: \"cropbottom\", attr: \"cropbottom\", kind: \"string\" },\n { field: \"gain\", attr: \"gain\", kind: \"string\" },\n { field: \"blacklevel\", attr: \"blacklevel\", kind: \"string\" },\n { field: \"gamma\", attr: \"gamma\", kind: \"string\" },\n { field: \"grayscale\", attr: \"grayscale\", kind: \"trueFalse\" },\n { field: \"bilevel\", attr: \"bilevel\", kind: \"trueFalse\" },\n { field: \"chromakey\", attr: \"chromakey\", kind: \"string\" },\n { field: \"embosscolor\", attr: \"embosscolor\", kind: \"string\" },\n { field: \"recolortarget\", attr: \"recolortarget\", kind: \"string\" },\n { field: \"relationshipId\", attr: \"r:id\", kind: \"string\" },\n { field: \"pictRelationshipId\", attr: \"r:pict\", kind: \"string\" },\n { field: \"hrefRelationshipId\", attr: \"r:href\", kind: \"string\" },\n { field: \"officeHref\", attr: \"o:href\", kind: \"string\" },\n { field: \"officeAltHref\", attr: \"o:althref\", kind: \"string\" },\n { field: \"officeTitle\", attr: \"o:title\", kind: \"string\" },\n { field: \"oleid\", attr: \"o:oleid\", kind: \"number\" },\n { field: \"detectmouseclick\", attr: \"o:detectmouseclick\", kind: \"trueFalse\" },\n { field: \"movie\", attr: \"o:movie\", kind: \"number\" },\n { field: \"officeRelationshipId\", attr: \"o:relid\", kind: \"string\" },\n];\n\n/** Serialize v:imagedata. */\nexport function stringifyVmlImageData(opts: VmlImageDataOptions): string {\n return `<v:imagedata${stringifyVmlAttributes(opts as Record<string, unknown>, IMAGEDATA_ATTRS)}/>`;\n}\n\n/** Parse a v:imagedata element. */\nexport function parseVmlImageData(el: XmlElement): VmlImageDataOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, IMAGEDATA_ATTRS, out);\n return out as VmlImageDataOptions;\n}\n","/**\n * v:path element — CT_Path (path geometry, textbox rectangle, render toggles).\n *\n * Reference: ISO/IEC 29500-4, vml-main.xsd, CT_Path.\n *\n * @module\n */\nimport type { Element as XmlElement } from \"@office-open/xml\";\n\nimport {\n stringifyVmlAttributes,\n parseVmlAttributes,\n type VmlTrueFalse,\n type VmlAttrSpec,\n} from \"../attributes\";\nimport type { VmlConnectType } from \"./office-elements\";\n\n/** v:path options (CT_Path). */\nexport interface VmlPathOptions {\n id?: string;\n /** Path command string (\"m0,0l100,0,100,100,0,100xe\"). */\n v?: string;\n limo?: string;\n textboxrect?: string;\n fillok?: VmlTrueFalse;\n strokeok?: VmlTrueFalse;\n shadowok?: VmlTrueFalse;\n arrowok?: VmlTrueFalse;\n gradientshapeok?: VmlTrueFalse;\n textpathok?: VmlTrueFalse;\n insetpenok?: VmlTrueFalse;\n // o: extension members (AG_PathAttributes o: refs)\n /** o:connecttype — how shapes connect at this path. */\n connecttype?: VmlConnectType;\n /** o:connectlocs — connection-site coordinates. */\n connectlocs?: string;\n /** o:connectangles — connection-site angles. */\n connectangles?: string;\n /** o:extrusionok — 3D extrusion allowed along this path. */\n extrusionok?: VmlTrueFalse;\n}\n\nconst PATH_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"id\", attr: \"id\", kind: \"string\" },\n { field: \"v\", attr: \"v\", kind: \"string\" },\n { field: \"limo\", attr: \"limo\", kind: \"string\" },\n { field: \"textboxrect\", attr: \"textboxrect\", kind: \"string\" },\n { field: \"fillok\", attr: \"fillok\", kind: \"trueFalse\" },\n { field: \"strokeok\", attr: \"strokeok\", kind: \"trueFalse\" },\n { field: \"shadowok\", attr: \"shadowok\", kind: \"trueFalse\" },\n { field: \"arrowok\", attr: \"arrowok\", kind: \"trueFalse\" },\n { field: \"gradientshapeok\", attr: \"gradientshapeok\", kind: \"trueFalse\" },\n { field: \"textpathok\", attr: \"textpathok\", kind: \"trueFalse\" },\n { field: \"insetpenok\", attr: \"insetpenok\", kind: \"trueFalse\" },\n { field: \"connecttype\", attr: \"o:connecttype\", kind: \"string\" },\n { field: \"connectlocs\", attr: \"o:connectlocs\", kind: \"string\" },\n { field: \"connectangles\", attr: \"o:connectangles\", kind: \"string\" },\n { field: \"extrusionok\", attr: \"o:extrusionok\", kind: \"trueFalse\" },\n];\n\n/** Serialize v:path. */\nexport function stringifyVmlPath(opts: VmlPathOptions): string {\n return `<v:path${stringifyVmlAttributes(opts as Record<string, unknown>, PATH_ATTRS)}/>`;\n}\n\n/** Parse a v:path element. */\nexport function parseVmlPath(el: XmlElement): VmlPathOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, PATH_ATTRS, out);\n return out as VmlPathOptions;\n}\n","/**\n * Presentation pvml: elements — the two EG_ShapeElements members from\n * vml-presentationDrawing.xsd: iscomment (empty marker) and textdata.\n *\n * Reference: ISO/IEC 29500-4, vml-presentationDrawing.xsd.\n *\n * @module\n */\nimport type { Element as XmlElement } from \"@office-open/xml\";\n\n/** pvml:iscomment options (CT_Empty) — empty marker element. */\nexport interface VmlIsCommentOptions {}\n\n/** Serialize pvml:iscomment. */\nexport function stringifyVmlIsComment(_opts: VmlIsCommentOptions): string {\n return \"<pvml:iscomment/>\";\n}\n\n/** Parse a pvml:iscomment element. */\nexport function parseVmlIsComment(_el: XmlElement): VmlIsCommentOptions {\n return {};\n}\n\n/** pvml:textdata options (CT_Rel). */\nexport interface VmlTextDataOptions {\n /** Relationship id — bridged by the caller. */\n id?: string;\n}\n\n/** Serialize pvml:textdata. */\nexport function stringifyVmlTextData(opts: VmlTextDataOptions): string {\n return opts.id !== undefined ? `<pvml:textdata id=\"${opts.id}\"/>` : \"<pvml:textdata/>\";\n}\n\n/** Parse a pvml:textdata element. */\nexport function parseVmlTextData(el: XmlElement): VmlTextDataOptions {\n const id = el.attributes?.id;\n return id !== undefined ? { id: String(id) } : {};\n}\n","/**\n * v:shadow element — CT_Shadow (single / double / emboss / perspective).\n *\n * Reference: ISO/IEC 29500-4, vml-main.xsd, CT_Shadow / ST_ShadowType.\n *\n * @module\n */\nimport type { Element as XmlElement } from \"@office-open/xml\";\n\nimport {\n stringifyVmlAttributes,\n parseVmlAttributes,\n type VmlColor,\n type VmlTrueFalse,\n type VmlAttrSpec,\n} from \"../attributes\";\n\n/** ST_ShadowType. */\nexport type VmlShadowType = \"single\" | \"double\" | \"emboss\" | \"perspective\";\n\n/** v:shadow options (CT_Shadow). */\nexport interface VmlShadowOptions {\n id?: string;\n on?: VmlTrueFalse;\n type?: VmlShadowType;\n obscured?: VmlTrueFalse;\n color?: VmlColor;\n opacity?: string;\n offset?: string;\n color2?: VmlColor;\n offset2?: string;\n origin?: string;\n matrix?: string;\n}\n\nconst SHADOW_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"id\", attr: \"id\", kind: \"string\" },\n { field: \"on\", attr: \"on\", kind: \"trueFalse\" },\n { field: \"type\", attr: \"type\", kind: \"string\" },\n { field: \"obscured\", attr: \"obscured\", kind: \"trueFalse\" },\n { field: \"color\", attr: \"color\", kind: \"string\" },\n { field: \"opacity\", attr: \"opacity\", kind: \"string\" },\n { field: \"offset\", attr: \"offset\", kind: \"string\" },\n { field: \"color2\", attr: \"color2\", kind: \"string\" },\n { field: \"offset2\", attr: \"offset2\", kind: \"string\" },\n { field: \"origin\", attr: \"origin\", kind: \"string\" },\n { field: \"matrix\", attr: \"matrix\", kind: \"string\" },\n];\n\n/** Serialize v:shadow. */\nexport function stringifyVmlShadow(opts: VmlShadowOptions): string {\n return `<v:shadow${stringifyVmlAttributes(opts as Record<string, unknown>, SHADOW_ATTRS)}/>`;\n}\n\n/** Parse a v:shadow element. */\nexport function parseVmlShadow(el: XmlElement): VmlShadowOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, SHADOW_ATTRS, out);\n return out as VmlShadowOptions;\n}\n","/**\n * v:stroke element — CT_Stroke.\n *\n * AG_StrokeAttributes (~30 attributes, including the o: extension members)\n * plus the five o: border sub-strokes (o:left/top/right/bottom/column,\n * CT_StrokeChild).\n *\n * Reference: ISO/IEC 29500-4, vml-main.xsd, CT_Stroke / AG_StrokeAttributes.\n *\n * @module\n */\nimport type { Element as XmlElement } from \"@office-open/xml\";\n\nimport {\n stringifyVmlAttributes,\n parseVmlAttributes,\n type VmlColor,\n type VmlTrueFalse,\n type VmlAttrSpec,\n} from \"../attributes\";\nimport type { VmlFillType, VmlImageAspect } from \"./fill\";\n\n/** ST_StrokeLineStyle. */\nexport type VmlStrokeLineStyle =\n | \"single\"\n | \"thinThin\"\n | \"thinThick\"\n | \"thickThin\"\n | \"thickBetweenThin\";\n\n/** ST_StrokeJoinStyle. */\nexport type VmlStrokeJoinStyle = \"round\" | \"bevel\" | \"miter\";\n\n/** ST_StrokeEndCap. */\nexport type VmlStrokeEndCap = \"flat\" | \"square\" | \"round\";\n\n/** ST_StrokeArrowType. */\nexport type VmlStrokeArrowType = \"none\" | \"block\" | \"classic\" | \"oval\" | \"diamond\" | \"open\";\n\n/** ST_StrokeArrowWidth. */\nexport type VmlStrokeArrowWidth = \"narrow\" | \"medium\" | \"wide\";\n\n/** ST_StrokeArrowLength. */\nexport type VmlStrokeArrowLength = \"short\" | \"medium\" | \"long\";\n\n/** v:stroke options (CT_Stroke / AG_StrokeAttributes). */\nexport interface VmlStrokeOptions {\n id?: string;\n on?: VmlTrueFalse;\n /** Line weight, e.g. \"2pt\". */\n weight?: string;\n color?: VmlColor;\n opacity?: string;\n linestyle?: VmlStrokeLineStyle;\n miterlimit?: number;\n joinstyle?: VmlStrokeJoinStyle;\n endcap?: VmlStrokeEndCap;\n /** Preset (\"dash\", \"dotdotdash\", …) or custom dash pattern (\"4 2 4 2\"). */\n dashstyle?: string;\n filltype?: VmlFillType;\n src?: string;\n imageaspect?: VmlImageAspect;\n imagesize?: string;\n imagealignshape?: VmlTrueFalse;\n color2?: VmlColor;\n startarrow?: VmlStrokeArrowType;\n startarrowwidth?: VmlStrokeArrowWidth;\n startarrowlength?: VmlStrokeArrowLength;\n endarrow?: VmlStrokeArrowType;\n endarrowwidth?: VmlStrokeArrowWidth;\n endarrowlength?: VmlStrokeArrowLength;\n /** Relationship reference; callers bridge media via the placeholder form. */\n relationshipId?: string;\n insetpen?: VmlTrueFalse;\n // AG_StrokeAttributes o: members\n /** o:href — hyperlink target for image fills. */\n officeHref?: string;\n /** o:althref — alternate (high-contrast) image reference. */\n officeAltHref?: string;\n /** o:title — image title. */\n officeTitle?: string;\n /** o:forcedash — always render dashed (accessibility). */\n forcedash?: VmlTrueFalse;\n /** o:relid — relationship id for the image, in the o: extension slot. */\n officeRelationshipId?: string;\n // o: border sub-strokes (CT_StrokeChild children)\n leftStroke?: VmlStrokeChildOptions;\n topStroke?: VmlStrokeChildOptions;\n rightStroke?: VmlStrokeChildOptions;\n bottomStroke?: VmlStrokeChildOptions;\n columnStroke?: VmlStrokeChildOptions;\n}\n\n/**\n * o:left/top/right/bottom/column options (CT_StrokeChild) — the per-edge\n * sub-strokes of v:stroke, sharing most of the stroke vocabulary.\n */\nexport interface VmlStrokeChildOptions {\n ext?: string;\n on?: VmlTrueFalse;\n weight?: string;\n color?: VmlColor;\n color2?: VmlColor;\n opacity?: string;\n linestyle?: VmlStrokeLineStyle;\n miterlimit?: number;\n joinstyle?: VmlStrokeJoinStyle;\n endcap?: VmlStrokeEndCap;\n dashstyle?: string;\n insetpen?: VmlTrueFalse;\n filltype?: VmlFillType;\n src?: string;\n imageaspect?: VmlImageAspect;\n imagesize?: string;\n imagealignshape?: VmlTrueFalse;\n startarrow?: VmlStrokeArrowType;\n startarrowwidth?: VmlStrokeArrowWidth;\n startarrowlength?: VmlStrokeArrowLength;\n endarrow?: VmlStrokeArrowType;\n endarrowwidth?: VmlStrokeArrowWidth;\n endarrowlength?: VmlStrokeArrowLength;\n /** o:href. */\n officeHref?: string;\n /** o:althref. */\n officeAltHref?: string;\n /** o:title. */\n officeTitle?: string;\n /** o:forcedash. */\n forcedash?: VmlTrueFalse;\n}\n\nconst STROKE_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"id\", attr: \"id\", kind: \"string\" },\n { field: \"on\", attr: \"on\", kind: \"trueFalse\" },\n { field: \"weight\", attr: \"weight\", kind: \"string\" },\n { field: \"color\", attr: \"color\", kind: \"string\" },\n { field: \"opacity\", attr: \"opacity\", kind: \"string\" },\n { field: \"linestyle\", attr: \"linestyle\", kind: \"string\" },\n { field: \"miterlimit\", attr: \"miterlimit\", kind: \"number\" },\n { field: \"joinstyle\", attr: \"joinstyle\", kind: \"string\" },\n { field: \"endcap\", attr: \"endcap\", kind: \"string\" },\n { field: \"dashstyle\", attr: \"dashstyle\", kind: \"string\" },\n { field: \"filltype\", attr: \"filltype\", kind: \"string\" },\n { field: \"src\", attr: \"src\", kind: \"string\" },\n { field: \"imageaspect\", attr: \"imageaspect\", kind: \"string\" },\n { field: \"imagesize\", attr: \"imagesize\", kind: \"string\" },\n { field: \"imagealignshape\", attr: \"imagealignshape\", kind: \"trueFalse\" },\n { field: \"color2\", attr: \"color2\", kind: \"string\" },\n { field: \"startarrow\", attr: \"startarrow\", kind: \"string\" },\n { field: \"startarrowwidth\", attr: \"startarrowwidth\", kind: \"string\" },\n { field: \"startarrowlength\", attr: \"startarrowlength\", kind: \"string\" },\n { field: \"endarrow\", attr: \"endarrow\", kind: \"string\" },\n { field: \"endarrowwidth\", attr: \"endarrowwidth\", kind: \"string\" },\n { field: \"endarrowlength\", attr: \"endarrowlength\", kind: \"string\" },\n { field: \"relationshipId\", attr: \"r:id\", kind: \"string\" },\n { field: \"insetpen\", attr: \"insetpen\", kind: \"trueFalse\" },\n { field: \"officeHref\", attr: \"o:href\", kind: \"string\" },\n { field: \"officeAltHref\", attr: \"o:althref\", kind: \"string\" },\n { field: \"officeTitle\", attr: \"o:title\", kind: \"string\" },\n { field: \"forcedash\", attr: \"o:forcedash\", kind: \"trueFalse\" },\n { field: \"officeRelationshipId\", attr: \"o:relid\", kind: \"string\" },\n];\n\nconst STROKE_CHILD_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"ext\", attr: \"v:ext\", kind: \"string\" },\n { field: \"on\", attr: \"on\", kind: \"trueFalse\" },\n { field: \"weight\", attr: \"weight\", kind: \"string\" },\n { field: \"color\", attr: \"color\", kind: \"string\" },\n { field: \"color2\", attr: \"color2\", kind: \"string\" },\n { field: \"opacity\", attr: \"opacity\", kind: \"string\" },\n { field: \"linestyle\", attr: \"linestyle\", kind: \"string\" },\n { field: \"miterlimit\", attr: \"miterlimit\", kind: \"number\" },\n { field: \"joinstyle\", attr: \"joinstyle\", kind: \"string\" },\n { field: \"endcap\", attr: \"endcap\", kind: \"string\" },\n { field: \"dashstyle\", attr: \"dashstyle\", kind: \"string\" },\n { field: \"insetpen\", attr: \"insetpen\", kind: \"trueFalse\" },\n { field: \"filltype\", attr: \"filltype\", kind: \"string\" },\n { field: \"src\", attr: \"src\", kind: \"string\" },\n { field: \"imageaspect\", attr: \"imageaspect\", kind: \"string\" },\n { field: \"imagesize\", attr: \"imagesize\", kind: \"string\" },\n { field: \"imagealignshape\", attr: \"imagealignshape\", kind: \"trueFalse\" },\n { field: \"startarrow\", attr: \"startarrow\", kind: \"string\" },\n { field: \"startarrowwidth\", attr: \"startarrowwidth\", kind: \"string\" },\n { field: \"startarrowlength\", attr: \"startarrowlength\", kind: \"string\" },\n { field: \"endarrow\", attr: \"endarrow\", kind: \"string\" },\n { field: \"endarrowwidth\", attr: \"endarrowwidth\", kind: \"string\" },\n { field: \"endarrowlength\", attr: \"endarrowlength\", kind: \"string\" },\n { field: \"officeHref\", attr: \"o:href\", kind: \"string\" },\n { field: \"officeAltHref\", attr: \"o:althref\", kind: \"string\" },\n { field: \"officeTitle\", attr: \"o:title\", kind: \"string\" },\n { field: \"forcedash\", attr: \"o:forcedash\", kind: \"trueFalse\" },\n];\n\n/** Serialize an o:left/top/right/bottom/column sub-stroke. */\nfunction stringifyVmlStrokeChild(tag: string, opts: VmlStrokeChildOptions): string {\n return `<${tag}${stringifyVmlAttributes(opts as Record<string, unknown>, STROKE_CHILD_ATTRS)}/>`;\n}\n\n/** Parse an o: sub-stroke child of v:stroke. */\nfunction parseVmlStrokeChild(el: XmlElement): VmlStrokeChildOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, STROKE_CHILD_ATTRS, out);\n return out as VmlStrokeChildOptions;\n}\n\n/** Serialize v:stroke. */\nexport function stringifyVmlStroke(opts: VmlStrokeOptions): string {\n const children: string[] = [];\n if (opts.leftStroke !== undefined)\n children.push(stringifyVmlStrokeChild(\"o:left\", opts.leftStroke));\n if (opts.topStroke !== undefined) children.push(stringifyVmlStrokeChild(\"o:top\", opts.topStroke));\n if (opts.rightStroke !== undefined)\n children.push(stringifyVmlStrokeChild(\"o:right\", opts.rightStroke));\n if (opts.bottomStroke !== undefined)\n children.push(stringifyVmlStrokeChild(\"o:bottom\", opts.bottomStroke));\n if (opts.columnStroke !== undefined)\n children.push(stringifyVmlStrokeChild(\"o:column\", opts.columnStroke));\n const attrStr = stringifyVmlAttributes(opts as Record<string, unknown>, STROKE_ATTRS);\n return children.length > 0\n ? `<v:stroke${attrStr}>${children.join(\"\")}</v:stroke>`\n : `<v:stroke${attrStr}/>`;\n}\n\n/** Parse a v:stroke element. */\nexport function parseVmlStroke(el: XmlElement): VmlStrokeOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, STROKE_ATTRS, out);\n for (const child of el.elements ?? []) {\n if (child.type !== \"element\") continue;\n switch (child.name) {\n case \"o:left\":\n out.leftStroke = parseVmlStrokeChild(child);\n break;\n case \"o:top\":\n out.topStroke = parseVmlStrokeChild(child);\n break;\n case \"o:right\":\n out.rightStroke = parseVmlStrokeChild(child);\n break;\n case \"o:bottom\":\n out.bottomStroke = parseVmlStrokeChild(child);\n break;\n case \"o:column\":\n out.columnStroke = parseVmlStrokeChild(child);\n break;\n }\n }\n return out as VmlStrokeOptions;\n}\n","/**\n * v:textbox element — CT_Textbox.\n *\n * The content model is a choice: w:txbxContent (WordprocessingML paragraphs,\n * owned by the docx package) or an unqualified local element (the HTML `<div>`\n * Excel writes). This domain stays format-agnostic by carrying both as raw\n * inner-XML strings the caller produces/consumes.\n *\n * Reference: ISO/IEC 29500-4, vml-main.xsd, CT_Textbox.\n *\n * @module\n */\nimport type { Element as XmlElement } from \"@office-open/xml\";\nimport { escapeXml, stringifyElement } from \"@office-open/xml\";\n\nimport { stringifyVmlTrueFalse, parseVmlTrueFalse } from \"../attributes\";\nimport { parseVmlShapeStyle, parseVmlStyle, stringifyVmlStyle, type VmlShapeStyle } from \"../style\";\nimport type { VmlInsetMode } from \"./office-elements\";\n\n/** v:textbox options (CT_Textbox). */\nexport interface VmlTextboxOptions {\n id?: string;\n style?: VmlShapeStyle;\n /** Inner inset, e.g. \"auto\" or \"10pt,10pt,10pt,10pt\". */\n inset?: string;\n /** o:singleclick — the whole shape is the click target. */\n singleclick?: boolean;\n /** o:insetmode — inset handling mode. */\n insetmode?: VmlInsetMode;\n /** Inner XML of the w:txbxContent child (docx paragraphs), caller-produced. */\n txbxContent?: string;\n /** Verbatim inner XML for a local (unqualified) child — Excel's `<div>` form. */\n content?: string;\n}\n\n/**\n * Serialize v:textbox. Exactly one content form is emitted when present\n * (txbxContent wins if both are set, matching the XSD choice).\n */\nexport function stringifyVmlTextbox(opts: VmlTextboxOptions): string {\n const attrs: string[] = [];\n if (opts.id !== undefined) attrs.push(`id=\"${escapeXml(opts.id)}\"`);\n if (opts.style !== undefined) attrs.push(`style=\"${escapeXml(stringifyVmlStyle(opts.style))}\"`);\n if (opts.inset !== undefined) attrs.push(`inset=\"${escapeXml(opts.inset)}\"`);\n if (opts.singleclick !== undefined) {\n attrs.push(`o:singleclick=\"${stringifyVmlTrueFalse(opts.singleclick)}\"`);\n }\n if (opts.insetmode !== undefined) attrs.push(`o:insetmode=\"${opts.insetmode}\"`);\n const attrStr = attrs.length > 0 ? ` ${attrs.join(\" \")}` : \"\";\n\n if (opts.txbxContent !== undefined) {\n return `<v:textbox${attrStr}><w:txbxContent>${opts.txbxContent}</w:txbxContent></v:textbox>`;\n }\n if (opts.content !== undefined) {\n return `<v:textbox${attrStr}>${opts.content}</v:textbox>`;\n }\n return `<v:textbox${attrStr}/>`;\n}\n\n/** Parse a v:textbox element. */\nexport function parseVmlTextbox(el: XmlElement): VmlTextboxOptions {\n const out: VmlTextboxOptions = {};\n const attrs = el.attributes ?? {};\n if (attrs.id !== undefined) out.id = String(attrs.id);\n if (attrs.style !== undefined) {\n out.style = parseVmlShapeStyle(parseVmlStyle(String(attrs.style)));\n }\n if (attrs.inset !== undefined) out.inset = String(attrs.inset);\n if (attrs[\"o:singleclick\"] !== undefined) {\n out.singleclick = parseVmlTrueFalse(String(attrs[\"o:singleclick\"]));\n }\n if (attrs[\"o:insetmode\"] !== undefined) {\n out.insetmode = String(attrs[\"o:insetmode\"]) as VmlInsetMode;\n }\n\n for (const child of el.elements ?? []) {\n if (child.type !== \"element\") continue;\n if (child.name === \"w:txbxContent\") {\n out.txbxContent = (child.elements ?? []).map((e) => stringifyElement(e)).join(\"\");\n break;\n }\n // First local (unqualified) child wins — the XSD is a single-element choice.\n if (!child.name?.includes(\":\")) {\n out.content = stringifyElement(child);\n break;\n }\n }\n return out;\n}\n","/**\n * v:textpath element — CT_TextPath (WordArt text on a path).\n *\n * Reference: ISO/IEC 29500-4, vml-main.xsd, CT_TextPath.\n *\n * @module\n */\nimport type { Element as XmlElement } from \"@office-open/xml\";\nimport { escapeXml } from \"@office-open/xml\";\n\nimport {\n stringifyVmlAttributes,\n parseVmlAttributes,\n type VmlAttrSpec,\n type VmlTrueFalse,\n} from \"../attributes\";\n\n/**\n * v:textpath style vocabulary — font-centric CSS, distinct from the layout\n * vocabulary of {@link VmlShapeStyle}. Values stay strings: font sizes carry\n * units (\"24pt\"), families carry quotes, weights may be named or numeric.\n */\nexport interface VmlTextPathStyle {\n fontFamily?: string;\n fontSize?: string;\n fontWeight?: string;\n fontStyle?: string;\n fontVariant?: string;\n textTransform?: string;\n textDecoration?: string;\n letterSpacing?: string;\n /** v-text-align — WordArt alignment (\"center\", \"letter-justify\", …). */\n vTextAlign?: string;\n /** v-text-kern — kerning toggle (\"t\"/\"f\" literal in the CSS stream). */\n vTextKern?: string;\n /** v-text-spacing — character spacing. */\n vTextSpacing?: string;\n /** v-text-spacing-mode — spacing mode (\"tightening\", …). */\n vTextSpacingMode?: string;\n}\n\nconst TEXT_PATH_STYLE_MAP: Record<keyof VmlTextPathStyle, string> = {\n fontFamily: \"font-family\",\n fontSize: \"font-size\",\n fontWeight: \"font-weight\",\n fontStyle: \"font-style\",\n fontVariant: \"font-variant\",\n textTransform: \"text-transform\",\n textDecoration: \"text-decoration\",\n letterSpacing: \"letter-spacing\",\n vTextAlign: \"v-text-align\",\n vTextKern: \"v-text-kern\",\n vTextSpacing: \"v-text-spacing\",\n vTextSpacingMode: \"v-text-spacing-mode\",\n};\n\n/** Serialize a VmlTextPathStyle to its CSS-stream form. */\nfunction stringifyVmlTextPathStyle(style: VmlTextPathStyle): string {\n return Object.entries(style)\n .map(([key, value]) => `${TEXT_PATH_STYLE_MAP[key as keyof VmlTextPathStyle]}:${value}`)\n .join(\";\");\n}\n\n/** Parse a CSS stream into a VmlTextPathStyle; unmapped keys drop. */\nfunction parseVmlTextPathStyle(styleStr: string): VmlTextPathStyle {\n const reverse = Object.fromEntries(\n Object.entries(TEXT_PATH_STYLE_MAP).map(([field, key]) => [key, field]),\n ) as Record<string, keyof VmlTextPathStyle>;\n const style: Partial<VmlTextPathStyle> = {};\n for (const part of styleStr.split(\";\")) {\n const [key, val] = part.split(\":\").map((s) => s.trim());\n if (!key || !val) continue;\n const field = reverse[key];\n if (field) style[field] = val;\n }\n return style as VmlTextPathStyle;\n}\n\n/** v:textpath options (CT_TextPath). */\nexport interface VmlTextPathOptions {\n id?: string;\n style?: VmlTextPathStyle;\n on?: VmlTrueFalse;\n fitshape?: VmlTrueFalse;\n fitpath?: VmlTrueFalse;\n trim?: VmlTrueFalse;\n xscale?: VmlTrueFalse;\n string?: string;\n}\n\nconst TEXT_PATH_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"id\", attr: \"id\", kind: \"string\" },\n { field: \"on\", attr: \"on\", kind: \"trueFalse\" },\n { field: \"fitshape\", attr: \"fitshape\", kind: \"trueFalse\" },\n { field: \"fitpath\", attr: \"fitpath\", kind: \"trueFalse\" },\n { field: \"trim\", attr: \"trim\", kind: \"trueFalse\" },\n { field: \"xscale\", attr: \"xscale\", kind: \"trueFalse\" },\n { field: \"string\", attr: \"string\", kind: \"string\" },\n];\n\n/** Serialize v:textpath. */\nexport function stringifyVmlTextPath(opts: VmlTextPathOptions): string {\n const attrStr = stringifyVmlAttributes(\n opts as unknown as Record<string, unknown>,\n TEXT_PATH_ATTRS,\n );\n if (opts.style !== undefined) {\n return `<v:textpath${attrStr} style=\"${escapeXml(stringifyVmlTextPathStyle(opts.style))}\"/>`;\n }\n return `<v:textpath${attrStr}/>`;\n}\n\n/** Parse a v:textpath element. */\nexport function parseVmlTextPath(el: XmlElement): VmlTextPathOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, TEXT_PATH_ATTRS, out);\n if (el.attributes?.style !== undefined) {\n out.style = parseVmlTextPathStyle(String(el.attributes.style));\n }\n return out as VmlTextPathOptions;\n}\n","/**\n * WordprocessingML drawing w10: elements — the EG_ShapeElements members from\n * vml-wordprocessingDrawing.xsd: wrap, anchorlock and the four borders.\n *\n * Reference: ISO/IEC 29500-4, vml-wordprocessingDrawing.xsd.\n *\n * @module\n */\nimport type { Element as XmlElement } from \"@office-open/xml\";\n\nimport {\n stringifyVmlAttributes,\n parseVmlAttributes,\n type VmlAttrSpec,\n type VmlTrueFalseBlank,\n} from \"../attributes\";\n\n/** ST_WrapType. */\nexport type VmlWrapType = \"topAndBottom\" | \"square\" | \"none\" | \"tight\" | \"through\";\n\n/** ST_WrapSide. */\nexport type VmlWrapSide = \"both\" | \"left\" | \"right\" | \"largest\";\n\n/** ST_HorizontalAnchor. */\nexport type VmlHorizontalAnchor = \"margin\" | \"page\" | \"text\" | \"char\";\n\n/** ST_VerticalAnchor. */\nexport type VmlVerticalAnchor = \"margin\" | \"page\" | \"text\" | \"line\";\n\n/** ST_BorderType — the 27 legacy border presets. */\nexport type VmlBorderType =\n | \"none\"\n | \"single\"\n | \"thick\"\n | \"double\"\n | \"hairline\"\n | \"dot\"\n | \"dash\"\n | \"dotDash\"\n | \"dashDotDot\"\n | \"triple\"\n | \"thinThickSmall\"\n | \"thickThinSmall\"\n | \"thickBetweenThinSmall\"\n | \"thinThick\"\n | \"thickThin\"\n | \"thickBetweenThin\"\n | \"thinThickLarge\"\n | \"thickThinLarge\"\n | \"thickBetweenThinLarge\"\n | \"wave\"\n | \"doubleWave\"\n | \"dashedSmall\"\n | \"dashDotStroked\"\n | \"threeDEmboss\"\n | \"threeDEngrave\"\n | \"HTMLOutset\"\n | \"HTMLInset\";\n\n/** w10:wrap options (CT_Wrap). */\nexport interface VmlWrapOptions {\n type?: VmlWrapType;\n side?: VmlWrapSide;\n anchorx?: VmlHorizontalAnchor;\n anchory?: VmlVerticalAnchor;\n}\n\nconst WRAP_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"type\", attr: \"type\", kind: \"string\" },\n { field: \"side\", attr: \"side\", kind: \"string\" },\n { field: \"anchorx\", attr: \"anchorx\", kind: \"string\" },\n { field: \"anchory\", attr: \"anchory\", kind: \"string\" },\n];\n\n/** Serialize w10:wrap. */\nexport function stringifyVmlWrap(opts: VmlWrapOptions): string {\n return `<w10:wrap${stringifyVmlAttributes(opts as Record<string, unknown>, WRAP_ATTRS)}/>`;\n}\n\n/** Parse a w10:wrap element. */\nexport function parseVmlWrap(el: XmlElement): VmlWrapOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, WRAP_ATTRS, out);\n return out as VmlWrapOptions;\n}\n\n/** w10:anchorlock options (CT_AnchorLock) — empty marker element. */\nexport interface VmlAnchorLockOptions {}\n\n/** Serialize w10:anchorlock. */\nexport function stringifyVmlAnchorLock(_opts: VmlAnchorLockOptions): string {\n return \"<w10:anchorlock/>\";\n}\n\n/** Parse a w10:anchorlock element. */\nexport function parseVmlAnchorLock(_el: XmlElement): VmlAnchorLockOptions {\n return {};\n}\n\n/** w10:bordertop/borderleft/borderright/borderbottom options (CT_Border). */\nexport interface VmlBorderOptions {\n type?: VmlBorderType;\n /** Border width in 1/8 pt units. */\n width?: number;\n shadow?: VmlTrueFalseBlank;\n}\n\nconst BORDER_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"type\", attr: \"type\", kind: \"string\" },\n { field: \"width\", attr: \"width\", kind: \"number\" },\n { field: \"shadow\", attr: \"shadow\", kind: \"trueFalseBlank\" },\n];\n\n/** The four w10: border element names. */\nexport const VML_BORDER_TAGS = [\n \"w10:bordertop\",\n \"w10:borderleft\",\n \"w10:borderright\",\n \"w10:borderbottom\",\n] as const;\n\n/** Serialize a w10: border element. */\nexport function stringifyVmlBorder(\n tag: (typeof VML_BORDER_TAGS)[number],\n opts: VmlBorderOptions,\n): string {\n return `<${tag}${stringifyVmlAttributes(opts as Record<string, unknown>, BORDER_ATTRS)}/>`;\n}\n\n/** Parse a w10: border element. */\nexport function parseVmlBorder(el: XmlElement): VmlBorderOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, BORDER_ATTRS, out);\n return out as VmlBorderOptions;\n}\n","/**\n * VML shape elements — CT_Shape, CT_Shapetype, CT_Group, CT_Background and\n * the eight basic shapes (arc, curve, image, line, oval, polyline, rect,\n * roundrect).\n *\n * All shape-ish elements share the AG_AllCoreAttributes / AG_AllShapeAttributes\n * vocabulary (see `attributes.ts`) plus the EG_ShapeElements child set (see\n * `shape-elements/`); the per-element extras are small. Child order follows\n * the EG_ShapeElements declaration order — the XSD content model is an\n * unordered repeating choice, and that order matches what Office emits.\n *\n * Reference: ISO/IEC 29500-4, vml-main.xsd.\n *\n * @module\n */\nimport type { Element as XmlElement } from \"@office-open/xml\";\nimport { escapeXml } from \"@office-open/xml\";\n\nimport {\n stringifyVmlAttributes,\n parseVmlAttributes,\n VML_CORE_ATTRS,\n VML_SHAPE_ATTRS,\n VML_OFFICE_CORE_ATTRS,\n VML_OFFICE_SHAPE_ATTRS,\n type VmlAttrSpec,\n type VmlColor,\n type VmlCoreAttributes,\n type VmlOfficeCoreAttributes,\n type VmlOfficeShapeAttributes,\n type VmlShapeAttributes,\n type VmlTrueFalse,\n type VmlBlackWhiteMode,\n type VmlScreenSize,\n} from \"./attributes\";\nimport {\n stringifyVmlClientData,\n parseVmlClientData,\n type VmlClientDataOptions,\n} from \"./shape-elements/client-data\";\nimport { stringifyVmlFill, parseVmlFill, type VmlFillOptions } from \"./shape-elements/fill\";\nimport {\n stringifyVmlFormulas,\n parseVmlFormulas,\n type VmlFormulasOptions,\n} from \"./shape-elements/formulas\";\nimport {\n stringifyVmlHandles,\n parseVmlHandles,\n type VmlHandlesOptions,\n} from \"./shape-elements/handles\";\nimport {\n stringifyVmlImageData,\n parseVmlImageData,\n type VmlImageDataOptions,\n} from \"./shape-elements/imagedata\";\nimport {\n stringifyVmlSkew,\n parseVmlSkew,\n stringifyVmlExtrusion,\n parseVmlExtrusion,\n stringifyVmlCallout,\n parseVmlCallout,\n stringifyVmlLock,\n parseVmlLock,\n stringifyVmlClipPath,\n parseVmlClipPath,\n stringifyVmlSignatureLine,\n parseVmlSignatureLine,\n stringifyVmlInk,\n parseVmlInk,\n stringifyVmlEquationXml,\n parseVmlEquationXml,\n stringifyVmlDiagram,\n parseVmlDiagram,\n stringifyVmlComplex,\n parseVmlComplex,\n type VmlSkewOptions,\n type VmlExtrusionOptions,\n type VmlCalloutOptions,\n type VmlLockOptions,\n type VmlClipPathOptions,\n type VmlSignatureLineOptions,\n type VmlInkOptions,\n type VmlEquationXmlOptions,\n type VmlDiagramOptions,\n type VmlComplexOptions,\n} from \"./shape-elements/office-elements\";\nimport { stringifyVmlPath, parseVmlPath, type VmlPathOptions } from \"./shape-elements/path\";\nimport {\n stringifyVmlIsComment,\n parseVmlIsComment,\n stringifyVmlTextData,\n parseVmlTextData,\n type VmlIsCommentOptions,\n type VmlTextDataOptions,\n} from \"./shape-elements/presentation-elements\";\nimport { stringifyVmlShadow, parseVmlShadow, type VmlShadowOptions } from \"./shape-elements/shadow\";\nimport { stringifyVmlStroke, parseVmlStroke, type VmlStrokeOptions } from \"./shape-elements/stroke\";\nimport {\n stringifyVmlTextbox,\n parseVmlTextbox,\n type VmlTextboxOptions,\n} from \"./shape-elements/textbox\";\nimport {\n stringifyVmlTextPath,\n parseVmlTextPath,\n type VmlTextPathOptions,\n} from \"./shape-elements/textpath\";\nimport {\n stringifyVmlWrap,\n parseVmlWrap,\n stringifyVmlAnchorLock,\n parseVmlAnchorLock,\n stringifyVmlBorder,\n parseVmlBorder,\n type VmlWrapOptions,\n type VmlAnchorLockOptions,\n type VmlBorderOptions,\n} from \"./shape-elements/word-elements\";\nimport { stringifyVmlStyle, parseVmlStyle, parseVmlShapeStyle, type VmlShapeStyle } from \"./style\";\n\n// ── Shape id allocation ──\n\n/** Next spid in the `_x0000_s` segment (Word hands out shape ids from 1025). */\nlet nextSpid = 1024;\n\n/**\n * Allocate the next VML shape id (`_x0000_s1025`, `_x0000_s1026`, …).\n * Ids only need to be unique within a document; the counter is process-global\n * so concurrent generations never collide.\n */\nexport function nextVmlShapeId(): string {\n return `_x0000_s${++nextSpid}`;\n}\n\n// ── Shared shape options base ──\n\n/**\n * Fields shared by every shape-ish element: the v: + o: attribute vocabulary\n * (AG_AllCoreAttributes / AG_AllShapeAttributes) and the EG_ShapeElements\n * child set.\n */\nexport interface VmlBaseShapeFields\n extends VmlCoreAttributes, VmlOfficeCoreAttributes, VmlShapeAttributes, VmlOfficeShapeAttributes {\n /** AG_Path attribute — path data overriding the referenced shapetype's geometry. */\n path?: string;\n /** v:path child element — a separate XSD slot from the path attribute. */\n pathElement?: VmlPathOptions;\n formulas?: VmlFormulasOptions;\n handles?: VmlHandlesOptions;\n fill?: VmlFillOptions;\n stroke?: VmlStrokeOptions;\n shadow?: VmlShadowOptions;\n textbox?: VmlTextboxOptions;\n textpath?: VmlTextPathOptions;\n imagedata?: VmlImageDataOptions;\n // o: members of EG_ShapeElements\n skew?: VmlSkewOptions;\n extrusion?: VmlExtrusionOptions;\n callout?: VmlCalloutOptions;\n lock?: VmlLockOptions;\n clippath?: VmlClipPathOptions;\n signatureline?: VmlSignatureLineOptions;\n // w10: / x: / pvml: members of EG_ShapeElements\n wrap?: VmlWrapOptions;\n anchorlock?: VmlAnchorLockOptions;\n bordertop?: VmlBorderOptions;\n borderbottom?: VmlBorderOptions;\n borderleft?: VmlBorderOptions;\n borderright?: VmlBorderOptions;\n clientData?: VmlClientDataOptions;\n textdata?: VmlTextDataOptions;\n}\n\n/** ST_EditAs. */\nexport type VmlEditAs =\n | \"canvas\"\n | \"orgchart\"\n | \"radial\"\n | \"cycle\"\n | \"stacked\"\n | \"venn\"\n | \"bullseye\";\n\n// ── Options types ──\n\n/** v:shape options (CT_Shape). */\nexport interface VmlShapeOptions extends VmlBaseShapeFields {\n /** Shapetype reference, e.g. \"#_x0000_t202\". */\n type?: string;\n /** AG_Adj — adjustment values, e.g. \"1,500\". */\n adj?: string;\n /** o:gfxdata — base64 shape geometry payload (UI cache). */\n gfxdata?: string;\n /** @equationxml — alternative-equation string attribute. */\n equationxml?: string;\n /** o:ink child — Tablet PC ink annotation. */\n ink?: VmlInkOptions;\n /** o:equationxml child — alternate math content as verbatim XML. */\n equationxmlElement?: VmlEquationXmlOptions;\n /** pvml:iscomment child — PowerPoint ink-comment marker. */\n iscomment?: VmlIsCommentOptions;\n}\n\n/** v:shapetype options (CT_Shapetype). */\nexport interface VmlShapetypeOptions extends VmlBaseShapeFields {\n adj?: string;\n /** o:master — the shapetype this one derives from. */\n master?: string;\n /** o:complex — the trailing extension slot. */\n complex?: VmlComplexOptions;\n}\n\n/** One nested shape inside a v:group — single-key wrapper, like the format packages' child unions. */\nexport type VmlGroupChild =\n | { shape: VmlShapeOptions }\n | { shapetype: VmlShapetypeOptions }\n | { group: VmlGroupOptions }\n | { arc: VmlArcOptions }\n | { curve: VmlCurveOptions }\n | { image: VmlImageOptions }\n | { line: VmlLineOptions }\n | { oval: VmlOvalOptions }\n | { polyline: VmlPolylineOptions }\n | { rect: VmlRectOptions }\n | { roundrect: VmlRoundRectOptions };\n\n/** v:group options (CT_Group) — full attr vocabulary + fill subset + nested shapes. */\nexport interface VmlGroupOptions extends VmlBaseShapeFields {\n filled?: VmlTrueFalse;\n fillcolor?: VmlColor;\n editas?: VmlEditAs;\n /** o:tableproperties / o:tablelimits — legacy diagram table metadata. */\n tableproperties?: string;\n tablelimits?: string;\n /** o:diagram child — legacy org-chart/diagram payload. */\n diagram?: VmlDiagramOptions;\n children?: VmlGroupChild[];\n}\n\n/** v:background options (CT_Background). */\nexport interface VmlBackgroundOptions {\n id?: string;\n filled?: VmlTrueFalse;\n fillcolor?: VmlColor;\n bwmode?: VmlBlackWhiteMode;\n bwpure?: VmlBlackWhiteMode;\n bwnormal?: VmlBlackWhiteMode;\n targetscreensize?: VmlScreenSize;\n fill?: VmlFillOptions;\n}\n\n/** v:arc options (CT_Arc). */\nexport interface VmlArcOptions extends VmlBaseShapeFields {\n /** Start angle in degrees. */\n startAngle?: number;\n /** End angle in degrees. */\n endAngle?: number;\n}\n\n/** v:curve options (CT_Curve). */\nexport interface VmlCurveOptions extends VmlBaseShapeFields {\n from?: string;\n control1?: string;\n control2?: string;\n to?: string;\n}\n\n/** v:image options (CT_Image) — AG_ImageAttributes rides along. */\nexport interface VmlImageOptions extends VmlBaseShapeFields {\n src?: string;\n cropleft?: string;\n croptop?: string;\n cropright?: string;\n cropbottom?: string;\n gain?: string;\n blacklevel?: string;\n gamma?: string;\n grayscale?: VmlTrueFalse;\n bilevel?: VmlTrueFalse;\n}\n\n/** v:line options (CT_Line). */\nexport interface VmlLineOptions extends VmlBaseShapeFields {\n from?: string;\n to?: string;\n}\n\n/** v:oval options (CT_Oval). */\nexport interface VmlOvalOptions extends VmlBaseShapeFields {}\n\n/** v:polyline options (CT_PolyLine). */\nexport interface VmlPolylineOptions extends VmlBaseShapeFields {\n points?: string;\n /** o:ink child — ink annotation riding on the polyline. */\n ink?: VmlInkOptions;\n}\n\n/** v:rect options (CT_Rect). */\nexport interface VmlRectOptions extends VmlBaseShapeFields {}\n\n/** v:roundrect options (CT_RoundRect). */\nexport interface VmlRoundRectOptions extends VmlBaseShapeFields {\n arcsize?: string;\n}\n\n// ── Shared (de)serialization ──\n\nconst GROUP_FILL_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"filled\", attr: \"filled\", kind: \"trueFalse\" },\n { field: \"fillcolor\", attr: \"fillcolor\", kind: \"string\" },\n];\n\nconst ARC_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"startAngle\", attr: \"startAngle\", kind: \"number\" },\n { field: \"endAngle\", attr: \"endAngle\", kind: \"number\" },\n];\n\nconst CURVE_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"from\", attr: \"from\", kind: \"string\" },\n { field: \"control1\", attr: \"control1\", kind: \"string\" },\n { field: \"control2\", attr: \"control2\", kind: \"string\" },\n { field: \"to\", attr: \"to\", kind: \"string\" },\n];\n\nconst IMAGE_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"src\", attr: \"src\", kind: \"string\" },\n { field: \"cropleft\", attr: \"cropleft\", kind: \"string\" },\n { field: \"croptop\", attr: \"croptop\", kind: \"string\" },\n { field: \"cropright\", attr: \"cropright\", kind: \"string\" },\n { field: \"cropbottom\", attr: \"cropbottom\", kind: \"string\" },\n { field: \"gain\", attr: \"gain\", kind: \"string\" },\n { field: \"blacklevel\", attr: \"blacklevel\", kind: \"string\" },\n { field: \"gamma\", attr: \"gamma\", kind: \"string\" },\n { field: \"grayscale\", attr: \"grayscale\", kind: \"trueFalse\" },\n { field: \"bilevel\", attr: \"bilevel\", kind: \"trueFalse\" },\n];\n\nconst LINE_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"from\", attr: \"from\", kind: \"string\" },\n { field: \"to\", attr: \"to\", kind: \"string\" },\n];\n\nconst POLYLINE_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"points\", attr: \"points\", kind: \"string\" },\n];\n\nconst ROUNDRECT_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"arcsize\", attr: \"arcsize\", kind: \"string\" },\n];\n\n/** The full AG_AllCoreAttributes + AG_AllShapeAttributes table. */\nconst ALL_SHAPE_ATTRS: readonly VmlAttrSpec[] = [\n ...VML_CORE_ATTRS,\n ...VML_OFFICE_CORE_ATTRS,\n ...VML_SHAPE_ATTRS,\n ...VML_OFFICE_SHAPE_ATTRS,\n];\n\n/** Serialize the shared attribute vocabulary (style special-cased) plus extras. */\nfunction stringifyShapeAttrs(\n opts: Record<string, unknown>,\n extraSpecs: readonly VmlAttrSpec[] = [],\n): string {\n let attrStr = stringifyVmlAttributes(opts, [...ALL_SHAPE_ATTRS, ...extraSpecs]);\n const style = opts.style as VmlShapeStyle | undefined;\n if (style !== undefined) {\n attrStr += ` style=\"${escapeXml(stringifyVmlStyle(style))}\"`;\n }\n return attrStr;\n}\n\n/** Serialize the EG_ShapeElements children present on `opts`, in declaration order. */\nfunction stringifyShapeElements(opts: VmlBaseShapeFields): string {\n const parts: string[] = [];\n if (opts.pathElement !== undefined) parts.push(stringifyVmlPath(opts.pathElement));\n if (opts.formulas !== undefined) parts.push(stringifyVmlFormulas(opts.formulas));\n if (opts.handles !== undefined) parts.push(stringifyVmlHandles(opts.handles));\n if (opts.fill !== undefined) parts.push(stringifyVmlFill(opts.fill));\n if (opts.stroke !== undefined) parts.push(stringifyVmlStroke(opts.stroke));\n if (opts.shadow !== undefined) parts.push(stringifyVmlShadow(opts.shadow));\n if (opts.textbox !== undefined) parts.push(stringifyVmlTextbox(opts.textbox));\n if (opts.textpath !== undefined) parts.push(stringifyVmlTextPath(opts.textpath));\n if (opts.imagedata !== undefined) parts.push(stringifyVmlImageData(opts.imagedata));\n if (opts.skew !== undefined) parts.push(stringifyVmlSkew(opts.skew));\n if (opts.extrusion !== undefined) parts.push(stringifyVmlExtrusion(opts.extrusion));\n if (opts.callout !== undefined) parts.push(stringifyVmlCallout(opts.callout));\n if (opts.lock !== undefined) parts.push(stringifyVmlLock(opts.lock));\n if (opts.clippath !== undefined) parts.push(stringifyVmlClipPath(opts.clippath));\n if (opts.signatureline !== undefined) {\n parts.push(stringifyVmlSignatureLine(opts.signatureline));\n }\n if (opts.wrap !== undefined) parts.push(stringifyVmlWrap(opts.wrap));\n if (opts.anchorlock !== undefined) parts.push(stringifyVmlAnchorLock(opts.anchorlock));\n if (opts.bordertop !== undefined) parts.push(stringifyVmlBorder(\"w10:bordertop\", opts.bordertop));\n if (opts.borderbottom !== undefined) {\n parts.push(stringifyVmlBorder(\"w10:borderbottom\", opts.borderbottom));\n }\n if (opts.borderleft !== undefined) {\n parts.push(stringifyVmlBorder(\"w10:borderleft\", opts.borderleft));\n }\n if (opts.borderright !== undefined) {\n parts.push(stringifyVmlBorder(\"w10:borderright\", opts.borderright));\n }\n if (opts.clientData !== undefined) parts.push(stringifyVmlClientData(opts.clientData));\n if (opts.textdata !== undefined) parts.push(stringifyVmlTextData(opts.textdata));\n return parts.join(\"\");\n}\n\n/** Parse the shared attribute vocabulary plus extras onto `out`. */\nfunction parseShapeAttrs(\n el: XmlElement,\n out: Record<string, unknown>,\n extraSpecs: readonly VmlAttrSpec[] = [],\n): void {\n parseVmlAttributes(el, [...ALL_SHAPE_ATTRS, ...extraSpecs], out);\n if (el.attributes?.style !== undefined) {\n out.style = parseVmlShapeStyle(parseVmlStyle(String(el.attributes.style)));\n }\n if (el.attributes?.path !== undefined) out.path = String(el.attributes.path);\n}\n\n/** Parse the EG_ShapeElements children from `el` onto `out`. */\nfunction parseShapeElements(el: XmlElement, out: Record<string, unknown>): void {\n for (const child of el.elements ?? []) {\n if (child.type !== \"element\") continue;\n switch (child.name) {\n case \"v:path\":\n out.pathElement = parseVmlPath(child);\n break;\n case \"v:formulas\":\n out.formulas = parseVmlFormulas(child);\n break;\n case \"v:handles\":\n out.handles = parseVmlHandles(child);\n break;\n case \"v:fill\":\n out.fill = parseVmlFill(child);\n break;\n case \"v:stroke\":\n out.stroke = parseVmlStroke(child);\n break;\n case \"v:shadow\":\n out.shadow = parseVmlShadow(child);\n break;\n case \"v:textbox\":\n out.textbox = parseVmlTextbox(child);\n break;\n case \"v:textpath\":\n out.textpath = parseVmlTextPath(child);\n break;\n case \"v:imagedata\":\n out.imagedata = parseVmlImageData(child);\n break;\n case \"o:skew\":\n out.skew = parseVmlSkew(child);\n break;\n case \"o:extrusion\":\n out.extrusion = parseVmlExtrusion(child);\n break;\n case \"o:callout\":\n out.callout = parseVmlCallout(child);\n break;\n case \"o:lock\":\n out.lock = parseVmlLock(child);\n break;\n case \"o:clippath\":\n out.clippath = parseVmlClipPath(child);\n break;\n case \"o:signatureline\":\n out.signatureline = parseVmlSignatureLine(child);\n break;\n case \"w10:wrap\":\n out.wrap = parseVmlWrap(child);\n break;\n case \"w10:anchorlock\":\n out.anchorlock = parseVmlAnchorLock(child);\n break;\n case \"w10:bordertop\":\n out.bordertop = parseVmlBorder(child);\n break;\n case \"w10:borderbottom\":\n out.borderbottom = parseVmlBorder(child);\n break;\n case \"w10:borderleft\":\n out.borderleft = parseVmlBorder(child);\n break;\n case \"w10:borderright\":\n out.borderright = parseVmlBorder(child);\n break;\n case \"x:ClientData\":\n out.clientData = parseVmlClientData(child);\n break;\n case \"pvml:textdata\":\n out.textdata = parseVmlTextData(child);\n break;\n case \"pvml:iscomment\":\n out.iscomment = parseVmlIsComment(child);\n break;\n }\n }\n}\n\n/** Generic shape element serializer: tag + shared/extra attrs + @path + children. */\nfunction stringifyShapeElement(\n tag: string,\n opts: Record<string, unknown>,\n extraSpecs: readonly VmlAttrSpec[] = [],\n extraAttrStrings: string[] = [],\n childrenXml = \"\",\n): string {\n const attrStr =\n stringifyShapeAttrs(opts, extraSpecs) +\n (extraAttrStrings.length > 0 ? \" \" + extraAttrStrings.join(\" \") : \"\");\n return childrenXml !== \"\" ? `<${tag}${attrStr}>${childrenXml}</${tag}>` : `<${tag}${attrStr}/>`;\n}\n\n// ── v:shape / v:shapetype ──\n\nconst SHAPE_EXTRA_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"type\", attr: \"type\", kind: \"string\" },\n { field: \"adj\", attr: \"adj\", kind: \"string\" },\n { field: \"gfxdata\", attr: \"o:gfxdata\", kind: \"string\" },\n { field: \"equationxml\", attr: \"equationxml\", kind: \"string\" },\n];\n\n/** Serialize v:shape. */\nexport function stringifyVmlShape(opts: VmlShapeOptions): string {\n const extra = opts.path !== undefined ? [`path=\"${escapeXml(opts.path)}\"`] : [];\n let children = stringifyShapeElements(opts);\n if (opts.ink !== undefined) children += stringifyVmlInk(opts.ink);\n if (opts.equationxmlElement !== undefined) {\n children += stringifyVmlEquationXml(opts.equationxmlElement);\n }\n if (opts.iscomment !== undefined) children += stringifyVmlIsComment(opts.iscomment);\n return stringifyShapeElement(\n \"v:shape\",\n opts as unknown as Record<string, unknown>,\n SHAPE_EXTRA_ATTRS,\n extra,\n children,\n );\n}\n\n/** Parse a v:shape element. */\nexport function parseVmlShape(el: XmlElement): VmlShapeOptions {\n const out: Record<string, unknown> = {};\n parseShapeAttrs(el, out, SHAPE_EXTRA_ATTRS);\n parseShapeElements(el, out);\n for (const child of el.elements ?? []) {\n if (child.type !== \"element\") continue;\n if (child.name === \"o:ink\") out.ink = parseVmlInk(child);\n else if (child.name === \"o:equationxml\") out.equationxmlElement = parseVmlEquationXml(child);\n }\n return out as VmlShapeOptions;\n}\n\nconst SHAPETYPE_EXTRA_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"adj\", attr: \"adj\", kind: \"string\" },\n { field: \"master\", attr: \"o:master\", kind: \"string\" },\n];\n\n/** Serialize v:shapetype. */\nexport function stringifyVmlShapetype(opts: VmlShapetypeOptions): string {\n const extra = opts.path !== undefined ? [`path=\"${escapeXml(opts.path)}\"`] : [];\n // CT_Shapetype is a sequence: the o:complex extension slot comes last.\n let children = stringifyShapeElements(opts);\n if (opts.complex !== undefined) children += stringifyVmlComplex(opts.complex);\n return stringifyShapeElement(\n \"v:shapetype\",\n opts as unknown as Record<string, unknown>,\n SHAPETYPE_EXTRA_ATTRS,\n extra,\n children,\n );\n}\n\n/** Parse a v:shapetype element. */\nexport function parseVmlShapetype(el: XmlElement): VmlShapetypeOptions {\n const out: Record<string, unknown> = {};\n parseShapeAttrs(el, out, SHAPETYPE_EXTRA_ATTRS);\n parseShapeElements(el, out);\n for (const child of el.elements ?? []) {\n if (child.type === \"element\" && child.name === \"o:complex\") {\n out.complex = parseVmlComplex(child);\n break;\n }\n }\n return out as VmlShapetypeOptions;\n}\n\n// ── v:group ──\n\n/** Serialize one VmlGroupChild. */\nfunction stringifyGroupChild(child: VmlGroupChild): string {\n if (\"shape\" in child) return stringifyVmlShape(child.shape);\n if (\"shapetype\" in child) return stringifyVmlShapetype(child.shapetype);\n if (\"group\" in child) return stringifyVmlGroup(child.group);\n if (\"arc\" in child) return stringifyVmlArc(child.arc);\n if (\"curve\" in child) return stringifyVmlCurve(child.curve);\n if (\"image\" in child) return stringifyVmlImage(child.image);\n if (\"line\" in child) return stringifyVmlLine(child.line);\n if (\"oval\" in child) return stringifyVmlOval(child.oval);\n if (\"polyline\" in child) return stringifyVmlPolyline(child.polyline);\n if (\"rect\" in child) return stringifyVmlRect(child.rect);\n return stringifyVmlRoundRect(child.roundrect);\n}\n\n/** CT_Group attribute table — AG_AllCoreAttributes + AG_Fill + editas + table props. */\nconst GROUP_ATTRS: readonly VmlAttrSpec[] = [\n ...VML_CORE_ATTRS,\n ...VML_OFFICE_CORE_ATTRS,\n ...GROUP_FILL_ATTRS,\n { field: \"editas\", attr: \"editas\", kind: \"string\" },\n { field: \"tableproperties\", attr: \"o:tableproperties\", kind: \"string\" },\n { field: \"tablelimits\", attr: \"o:tablelimits\", kind: \"string\" },\n];\n\n/** Serialize v:group. */\nexport function stringifyVmlGroup(opts: VmlGroupOptions): string {\n let children =\n (opts.children ?? []).map(stringifyGroupChild).join(\"\") + stringifyShapeElements(opts);\n if (opts.diagram !== undefined) children += stringifyVmlDiagram(opts.diagram);\n const attrStr =\n stringifyVmlAttributes(opts as Record<string, unknown>, GROUP_ATTRS) +\n (opts.path !== undefined ? ` path=\"${escapeXml(opts.path)}\"` : \"\");\n const style = opts.style;\n const styleStr = style !== undefined ? ` style=\"${escapeXml(stringifyVmlStyle(style))}\"` : \"\";\n return children !== \"\"\n ? `<v:group${attrStr}${styleStr}>${children}</v:group>`\n : `<v:group${attrStr}${styleStr}/>`;\n}\n\n/** Parse a v:group element. */\nexport function parseVmlGroup(el: XmlElement): VmlGroupOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, GROUP_ATTRS, out);\n if (el.attributes?.style !== undefined) {\n out.style = parseVmlShapeStyle(parseVmlStyle(String(el.attributes.style)));\n }\n if (el.attributes?.path !== undefined && out.path === undefined) {\n out.path = String(el.attributes.path);\n }\n parseShapeElements(el, out);\n\n const children: VmlGroupChild[] = [];\n for (const child of el.elements ?? []) {\n if (child.type !== \"element\") continue;\n switch (child.name) {\n case \"v:shape\":\n children.push({ shape: parseVmlShape(child) });\n break;\n case \"v:shapetype\":\n children.push({ shapetype: parseVmlShapetype(child) });\n break;\n case \"v:group\":\n children.push({ group: parseVmlGroup(child) });\n break;\n case \"v:arc\":\n children.push({ arc: parseVmlArc(child) });\n break;\n case \"v:curve\":\n children.push({ curve: parseVmlCurve(child) });\n break;\n case \"v:image\":\n children.push({ image: parseVmlImage(child) });\n break;\n case \"v:line\":\n children.push({ line: parseVmlLine(child) });\n break;\n case \"v:oval\":\n children.push({ oval: parseVmlOval(child) });\n break;\n case \"v:polyline\":\n children.push({ polyline: parseVmlPolyline(child) });\n break;\n case \"v:rect\":\n children.push({ rect: parseVmlRect(child) });\n break;\n case \"v:roundrect\":\n children.push({ roundrect: parseVmlRoundRect(child) });\n break;\n case \"o:diagram\":\n out.diagram = parseVmlDiagram(child);\n break;\n }\n }\n if (children.length > 0) out.children = children;\n return out as VmlGroupOptions;\n}\n\n// ── v:background ──\n\nconst BACKGROUND_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"id\", attr: \"id\", kind: \"string\" },\n { field: \"filled\", attr: \"filled\", kind: \"trueFalse\" },\n { field: \"fillcolor\", attr: \"fillcolor\", kind: \"string\" },\n { field: \"bwmode\", attr: \"o:bwmode\", kind: \"string\" },\n { field: \"bwpure\", attr: \"o:bwpure\", kind: \"string\" },\n { field: \"bwnormal\", attr: \"o:bwnormal\", kind: \"string\" },\n { field: \"targetscreensize\", attr: \"o:targetscreensize\", kind: \"string\" },\n];\n\n/** Serialize v:background. */\nexport function stringifyVmlBackground(opts: VmlBackgroundOptions): string {\n // CT_Background carries AG_Id + AG_Fill + the o:bw* attributes only — it is\n // not an AG_AllCoreAttributes host, so it must not join the shared shape\n // attribute table (that would double-emit id).\n const attrStr = stringifyVmlAttributes(\n opts as unknown as Record<string, unknown>,\n BACKGROUND_ATTRS,\n );\n const fillXml = opts.fill !== undefined ? stringifyVmlFill(opts.fill) : \"\";\n return fillXml !== \"\"\n ? `<v:background${attrStr}>${fillXml}</v:background>`\n : `<v:background${attrStr}/>`;\n}\n\n/** Parse a v:background element. */\nexport function parseVmlBackground(el: XmlElement): VmlBackgroundOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, BACKGROUND_ATTRS, out);\n for (const child of el.elements ?? []) {\n if (child.type === \"element\" && child.name === \"v:fill\") {\n out.fill = parseVmlFill(child);\n break;\n }\n }\n return out as VmlBackgroundOptions;\n}\n\n// ── Eight basic shapes ──\n\n/** Serialize v:arc. */\nexport function stringifyVmlArc(opts: VmlArcOptions): string {\n return stringifyShapeElement(\n \"v:arc\",\n opts as unknown as Record<string, unknown>,\n ARC_ATTRS,\n opts.path !== undefined ? [`path=\"${escapeXml(opts.path)}\"`] : [],\n stringifyShapeElements(opts),\n );\n}\n\n/** Parse a v:arc element. */\nexport function parseVmlArc(el: XmlElement): VmlArcOptions {\n const out: Record<string, unknown> = {};\n parseShapeAttrs(el, out, ARC_ATTRS);\n parseShapeElements(el, out);\n return out as VmlArcOptions;\n}\n\n/** Serialize v:curve. */\nexport function stringifyVmlCurve(opts: VmlCurveOptions): string {\n return stringifyShapeElement(\n \"v:curve\",\n opts as unknown as Record<string, unknown>,\n CURVE_ATTRS,\n opts.path !== undefined ? [`path=\"${escapeXml(opts.path)}\"`] : [],\n stringifyShapeElements(opts),\n );\n}\n\n/** Parse a v:curve element. */\nexport function parseVmlCurve(el: XmlElement): VmlCurveOptions {\n const out: Record<string, unknown> = {};\n parseShapeAttrs(el, out, CURVE_ATTRS);\n parseShapeElements(el, out);\n return out as VmlCurveOptions;\n}\n\n/** Serialize v:image. */\nexport function stringifyVmlImage(opts: VmlImageOptions): string {\n return stringifyShapeElement(\n \"v:image\",\n opts as unknown as Record<string, unknown>,\n IMAGE_ATTRS,\n opts.path !== undefined ? [`path=\"${escapeXml(opts.path)}\"`] : [],\n stringifyShapeElements(opts),\n );\n}\n\n/** Parse a v:image element. */\nexport function parseVmlImage(el: XmlElement): VmlImageOptions {\n const out: Record<string, unknown> = {};\n parseShapeAttrs(el, out, IMAGE_ATTRS);\n parseShapeElements(el, out);\n return out as VmlImageOptions;\n}\n\n/** Serialize v:line. */\nexport function stringifyVmlLine(opts: VmlLineOptions): string {\n return stringifyShapeElement(\n \"v:line\",\n opts as unknown as Record<string, unknown>,\n LINE_ATTRS,\n opts.path !== undefined ? [`path=\"${escapeXml(opts.path)}\"`] : [],\n stringifyShapeElements(opts),\n );\n}\n\n/** Parse a v:line element. */\nexport function parseVmlLine(el: XmlElement): VmlLineOptions {\n const out: Record<string, unknown> = {};\n parseShapeAttrs(el, out, LINE_ATTRS);\n parseShapeElements(el, out);\n return out as VmlLineOptions;\n}\n\n/** Serialize v:oval. */\nexport function stringifyVmlOval(opts: VmlOvalOptions): string {\n return stringifyShapeElement(\n \"v:oval\",\n opts as unknown as Record<string, unknown>,\n [],\n opts.path !== undefined ? [`path=\"${escapeXml(opts.path)}\"`] : [],\n stringifyShapeElements(opts),\n );\n}\n\n/** Parse a v:oval element. */\nexport function parseVmlOval(el: XmlElement): VmlOvalOptions {\n const out: Record<string, unknown> = {};\n parseShapeAttrs(el, out);\n parseShapeElements(el, out);\n return out as VmlOvalOptions;\n}\n\n/** Serialize v:polyline. */\nexport function stringifyVmlPolyline(opts: VmlPolylineOptions): string {\n const children =\n stringifyShapeElements(opts) + (opts.ink !== undefined ? stringifyVmlInk(opts.ink) : \"\");\n return stringifyShapeElement(\n \"v:polyline\",\n opts as unknown as Record<string, unknown>,\n POLYLINE_ATTRS,\n opts.path !== undefined ? [`path=\"${escapeXml(opts.path)}\"`] : [],\n children,\n );\n}\n\n/** Parse a v:polyline element. */\nexport function parseVmlPolyline(el: XmlElement): VmlPolylineOptions {\n const out: Record<string, unknown> = {};\n parseShapeAttrs(el, out, POLYLINE_ATTRS);\n parseShapeElements(el, out);\n for (const child of el.elements ?? []) {\n if (child.type === \"element\" && child.name === \"o:ink\") {\n out.ink = parseVmlInk(child);\n break;\n }\n }\n return out as VmlPolylineOptions;\n}\n\n/** Serialize v:rect. */\nexport function stringifyVmlRect(opts: VmlRectOptions): string {\n return stringifyShapeElement(\n \"v:rect\",\n opts as unknown as Record<string, unknown>,\n [],\n opts.path !== undefined ? [`path=\"${escapeXml(opts.path)}\"`] : [],\n stringifyShapeElements(opts),\n );\n}\n\n/** Parse a v:rect element. */\nexport function parseVmlRect(el: XmlElement): VmlRectOptions {\n const out: Record<string, unknown> = {};\n parseShapeAttrs(el, out);\n parseShapeElements(el, out);\n return out as VmlRectOptions;\n}\n\n/** Serialize v:roundrect. */\nexport function stringifyVmlRoundRect(opts: VmlRoundRectOptions): string {\n return stringifyShapeElement(\n \"v:roundrect\",\n opts as unknown as Record<string, unknown>,\n ROUNDRECT_ATTRS,\n opts.path !== undefined ? [`path=\"${escapeXml(opts.path)}\"`] : [],\n stringifyShapeElements(opts),\n );\n}\n\n/** Parse a v:roundrect element. */\nexport function parseVmlRoundRect(el: XmlElement): VmlRoundRectOptions {\n const out: Record<string, unknown> = {};\n parseShapeAttrs(el, out, ROUNDRECT_ATTRS);\n parseShapeElements(el, out);\n return out as VmlRoundRectOptions;\n}\n","/**\n * Office shape defaults and layout — o:shapedefaults / o:shapelayout and\n * their children (colormru, colormenu, idmap, regrouptable, rules).\n *\n * These head the legacy VML drawing parts: docx settings.xml carries\n * shapedefaults/shapelayout (hdrShapeDefaults/shapeDefaults), and every\n * xlsx vmlDrawing part opens with `<o:shapelayout><o:idmap …/></o:shapelayout>`\n * plus the comment-shape `<o:shapedefaults v:ext=\"edit\">` block.\n *\n * Reference: ISO/IEC 29500-4, vml-officeDrawing.xsd, CT_ShapeDefaults /\n * CT_ShapeLayout and their nested types.\n *\n * @module\n */\nimport type { Element as XmlElement } from \"@office-open/xml\";\n\nimport {\n stringifyVmlAttributes,\n parseVmlAttributes,\n type VmlAttrSpec,\n type VmlColor,\n type VmlTrueFalse,\n} from \"./attributes\";\nimport { stringifyVmlFill, parseVmlFill, type VmlFillOptions } from \"./shape-elements/fill\";\nimport type { VmlExtAttribute } from \"./shape-elements/office-elements\";\nimport {\n stringifyVmlSkew,\n parseVmlSkew,\n stringifyVmlExtrusion,\n parseVmlExtrusion,\n stringifyVmlCallout,\n parseVmlCallout,\n stringifyVmlLock,\n parseVmlLock,\n type VmlSkewOptions,\n type VmlExtrusionOptions,\n type VmlCalloutOptions,\n type VmlLockOptions,\n} from \"./shape-elements/office-elements\";\nimport { stringifyVmlShadow, parseVmlShadow, type VmlShadowOptions } from \"./shape-elements/shadow\";\nimport { stringifyVmlStroke, parseVmlStroke, type VmlStrokeOptions } from \"./shape-elements/stroke\";\nimport {\n stringifyVmlTextbox,\n parseVmlTextbox,\n type VmlTextboxOptions,\n} from \"./shape-elements/textbox\";\n\n// ── o:shapedefaults ──\n\n/** o:shapedefaults options (CT_ShapeDefaults). */\nexport interface VmlShapeDefaultsOptions extends VmlExtAttribute {\n /** Highest shape id handed out so far. */\n spidmax?: number;\n style?: string;\n fill?: VmlTrueFalse;\n fillcolor?: VmlColor;\n stroke?: VmlTrueFalse;\n strokecolor?: VmlColor;\n /** form=\"qualified\" — serialized as `o:allowincell`. */\n allowincell?: VmlTrueFalse;\n // xsd:all children, each at most once\n fillElement?: VmlFillOptions;\n strokeElement?: VmlStrokeOptions;\n textbox?: VmlTextboxOptions;\n shadow?: VmlShadowOptions;\n skew?: VmlSkewOptions;\n extrusion?: VmlExtrusionOptions;\n callout?: VmlCalloutOptions;\n lock?: VmlLockOptions;\n colormru?: VmlColorMruOptions;\n colormenu?: VmlColorMenuOptions;\n}\n\nconst SHAPEDEFAULTS_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"ext\", attr: \"v:ext\", kind: \"string\" },\n { field: \"spidmax\", attr: \"spidmax\", kind: \"number\" },\n { field: \"style\", attr: \"style\", kind: \"string\" },\n { field: \"fill\", attr: \"fill\", kind: \"trueFalse\" },\n { field: \"fillcolor\", attr: \"fillcolor\", kind: \"string\" },\n { field: \"stroke\", attr: \"stroke\", kind: \"trueFalse\" },\n { field: \"strokecolor\", attr: \"strokecolor\", kind: \"string\" },\n { field: \"allowincell\", attr: \"o:allowincell\", kind: \"trueFalse\" },\n];\n\n/** Serialize o:shapedefaults. */\nexport function stringifyVmlShapeDefaults(opts: VmlShapeDefaultsOptions): string {\n const children: string[] = [];\n if (opts.fillElement !== undefined) children.push(stringifyVmlFill(opts.fillElement));\n if (opts.strokeElement !== undefined) children.push(stringifyVmlStroke(opts.strokeElement));\n if (opts.textbox !== undefined) children.push(stringifyVmlTextbox(opts.textbox));\n if (opts.shadow !== undefined) children.push(stringifyVmlShadow(opts.shadow));\n if (opts.skew !== undefined) children.push(stringifyVmlSkew(opts.skew));\n if (opts.extrusion !== undefined) children.push(stringifyVmlExtrusion(opts.extrusion));\n if (opts.callout !== undefined) children.push(stringifyVmlCallout(opts.callout));\n if (opts.lock !== undefined) children.push(stringifyVmlLock(opts.lock));\n if (opts.colormru !== undefined) children.push(stringifyVmlColorMru(opts.colormru));\n if (opts.colormenu !== undefined) children.push(stringifyVmlColorMenu(opts.colormenu));\n const attrStr = stringifyVmlAttributes(opts as Record<string, unknown>, SHAPEDEFAULTS_ATTRS);\n return children.length > 0\n ? `<o:shapedefaults${attrStr}>${children.join(\"\")}</o:shapedefaults>`\n : `<o:shapedefaults${attrStr}/>`;\n}\n\n/** Parse an o:shapedefaults element. */\nexport function parseVmlShapeDefaults(el: XmlElement): VmlShapeDefaultsOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, SHAPEDEFAULTS_ATTRS, out);\n for (const child of el.elements ?? []) {\n if (child.type !== \"element\") continue;\n switch (child.name) {\n case \"v:fill\":\n out.fillElement = parseVmlFill(child);\n break;\n case \"v:stroke\":\n out.strokeElement = parseVmlStroke(child);\n break;\n case \"v:textbox\":\n out.textbox = parseVmlTextbox(child);\n break;\n case \"v:shadow\":\n out.shadow = parseVmlShadow(child);\n break;\n case \"o:skew\":\n out.skew = parseVmlSkew(child);\n break;\n case \"o:extrusion\":\n out.extrusion = parseVmlExtrusion(child);\n break;\n case \"o:callout\":\n out.callout = parseVmlCallout(child);\n break;\n case \"o:lock\":\n out.lock = parseVmlLock(child);\n break;\n case \"o:colormru\":\n out.colormru = parseVmlColorMru(child);\n break;\n case \"o:colormenu\":\n out.colormenu = parseVmlColorMenu(child);\n break;\n }\n }\n return out as VmlShapeDefaultsOptions;\n}\n\n// ── o:colormru / o:colormenu ──\n\n/** o:colormru options (CT_ColorMru) — the recently-used color list. */\nexport interface VmlColorMruOptions extends VmlExtAttribute {\n colors?: string;\n}\n\n/** Serialize o:colormru. */\nexport function stringifyVmlColorMru(opts: VmlColorMruOptions): string {\n return `<o:colormru${stringifyVmlAttributes(opts as Record<string, unknown>, [\n { field: \"ext\", attr: \"v:ext\", kind: \"string\" },\n { field: \"colors\", attr: \"colors\", kind: \"string\" },\n ])}/>`;\n}\n\n/** Parse an o:colormru element. */\nexport function parseVmlColorMru(el: XmlElement): VmlColorMruOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(\n el,\n [\n { field: \"ext\", attr: \"v:ext\", kind: \"string\" },\n { field: \"colors\", attr: \"colors\", kind: \"string\" },\n ],\n out,\n );\n return out as VmlColorMruOptions;\n}\n\n/** o:colormenu options (CT_ColorMenu) — the palette slots. */\nexport interface VmlColorMenuOptions extends VmlExtAttribute {\n strokecolor?: VmlColor;\n fillcolor?: VmlColor;\n shadowcolor?: VmlColor;\n extrusioncolor?: VmlColor;\n}\n\nconst COLORMENU_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"ext\", attr: \"v:ext\", kind: \"string\" },\n { field: \"strokecolor\", attr: \"strokecolor\", kind: \"string\" },\n { field: \"fillcolor\", attr: \"fillcolor\", kind: \"string\" },\n { field: \"shadowcolor\", attr: \"shadowcolor\", kind: \"string\" },\n { field: \"extrusioncolor\", attr: \"extrusioncolor\", kind: \"string\" },\n];\n\n/** Serialize o:colormenu. */\nexport function stringifyVmlColorMenu(opts: VmlColorMenuOptions): string {\n return `<o:colormenu${stringifyVmlAttributes(opts as Record<string, unknown>, COLORMENU_ATTRS)}/>`;\n}\n\n/** Parse an o:colormenu element. */\nexport function parseVmlColorMenu(el: XmlElement): VmlColorMenuOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, COLORMENU_ATTRS, out);\n return out as VmlColorMenuOptions;\n}\n\n// ── o:shapelayout ──\n\n/** CT_Entry — one regroup-table row. */\nexport interface VmlRegroupEntryOptions {\n new?: number;\n old?: number;\n}\n\nconst ENTRY_ATTRS: readonly VmlAttrSpec[] = [\n { field: \"new\", attr: \"new\", kind: \"number\" },\n { field: \"old\", attr: \"old\", kind: \"number\" },\n];\n\n/** o:regrouptable options (CT_RegroupTable). */\nexport interface VmlRegroupTableOptions extends VmlExtAttribute {\n entries?: VmlRegroupEntryOptions[];\n}\n\n/** ST_RType. */\nexport type VmlRuleType = \"arc\" | \"callout\" | \"connector\" | \"align\";\n\n/** ST_How. */\nexport type VmlRuleHow = \"top\" | \"middle\" | \"bottom\" | \"left\" | \"center\" | \"right\";\n\n/** CT_Proxy — one rule proxy. */\nexport interface VmlRuleProxyOptions {\n start?: boolean | \"\";\n end?: boolean | \"\";\n idref?: string;\n connectloc?: number;\n}\n\n/** CT_R — one layout rule. */\nexport interface VmlRuleOptions {\n id: string;\n type?: VmlRuleType;\n how?: VmlRuleHow;\n idref?: string;\n proxies?: VmlRuleProxyOptions[];\n}\n\n/** o:rules options (CT_Rules). */\nexport interface VmlRulesOptions extends VmlExtAttribute {\n rules?: VmlRuleOptions[];\n}\n\n/** o:idmap options (CT_IdMap). */\nexport interface VmlIdMapOptions extends VmlExtAttribute {\n /** Space-separated shape-id prefixes, e.g. \"1 2 3\". */\n data?: string;\n}\n\n/** o:shapelayout options (CT_ShapeLayout). */\nexport interface VmlShapeLayoutOptions extends VmlExtAttribute {\n idmap?: VmlIdMapOptions;\n regrouptable?: VmlRegroupTableOptions;\n rules?: VmlRulesOptions;\n}\n\n/** Serialize an o:idmap. */\nfunction stringifyVmlIdMap(opts: VmlIdMapOptions): string {\n return `<o:idmap${stringifyVmlAttributes(opts as Record<string, unknown>, [\n { field: \"ext\", attr: \"v:ext\", kind: \"string\" },\n { field: \"data\", attr: \"data\", kind: \"string\" },\n ])}/>`;\n}\n\n/** Parse an o:idmap element. */\nfunction parseVmlIdMap(el: XmlElement): VmlIdMapOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(\n el,\n [\n { field: \"ext\", attr: \"v:ext\", kind: \"string\" },\n { field: \"data\", attr: \"data\", kind: \"string\" },\n ],\n out,\n );\n return out as VmlIdMapOptions;\n}\n\n/** Serialize an o:regrouptable. */\nfunction stringifyVmlRegroupTable(opts: VmlRegroupTableOptions): string {\n const entries = (opts.entries ?? [])\n .map(\n (entry) =>\n `<o:entry${stringifyVmlAttributes(entry as Record<string, unknown>, ENTRY_ATTRS)}/>`,\n )\n .join(\"\");\n const attrStr = stringifyVmlAttributes(opts as Record<string, unknown>, [\n { field: \"ext\", attr: \"v:ext\", kind: \"string\" },\n ]);\n return `<o:regrouptable${attrStr}>${entries}</o:regrouptable>`;\n}\n\n/** Parse an o:regrouptable element. */\nfunction parseVmlRegroupTable(el: XmlElement): VmlRegroupTableOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, [{ field: \"ext\", attr: \"v:ext\", kind: \"string\" }], out);\n const entries: VmlRegroupEntryOptions[] = [];\n for (const child of el.elements ?? []) {\n if (child.type === \"element\" && child.name === \"o:entry\") {\n const entry: Record<string, unknown> = {};\n parseVmlAttributes(child, ENTRY_ATTRS, entry);\n entries.push(entry as VmlRegroupEntryOptions);\n }\n }\n if (entries.length > 0) out.entries = entries;\n return out as VmlRegroupTableOptions;\n}\n\n/** Serialize a proxy child inside an o:r. */\nfunction stringifyVmlRuleProxy(proxy: VmlRuleProxyOptions): string {\n const attrs: string[] = [];\n if (proxy.start !== undefined) {\n attrs.push(`start=\"${proxy.start === \"\" ? \"\" : proxy.start ? \"t\" : \"f\"}\"`);\n }\n if (proxy.end !== undefined) {\n attrs.push(`end=\"${proxy.end === \"\" ? \"\" : proxy.end ? \"t\" : \"f\"}\"`);\n }\n if (proxy.idref !== undefined) attrs.push(`idref=\"${proxy.idref}\"`);\n if (proxy.connectloc !== undefined) attrs.push(`connectloc=\"${proxy.connectloc}\"`);\n return `<o:proxy${attrs.length > 0 ? \" \" + attrs.join(\" \") : \"\"}/>`;\n}\n\n/** Parse an o:proxy element. */\nfunction parseVmlRuleProxy(el: XmlElement): VmlRuleProxyOptions {\n const out: VmlRuleProxyOptions = {};\n const attrs = el.attributes ?? {};\n if (attrs.start !== undefined) {\n const raw = String(attrs.start);\n out.start = raw === \"\" ? \"\" : raw === \"t\" || raw === \"true\" || raw === \"1\";\n }\n if (attrs.end !== undefined) {\n const raw = String(attrs.end);\n out.end = raw === \"\" ? \"\" : raw === \"t\" || raw === \"true\" || raw === \"1\";\n }\n if (attrs.idref !== undefined) out.idref = String(attrs.idref);\n if (attrs.connectloc !== undefined) out.connectloc = Number(attrs.connectloc);\n return out;\n}\n\n/** Serialize an o:r (hand-written — `id` is required, so no table-driven cast). */\nfunction stringifyVmlRule(rule: VmlRuleOptions): string {\n const attrs: string[] = [`id=\"${rule.id}\"`];\n if (rule.type !== undefined) attrs.push(`type=\"${rule.type}\"`);\n if (rule.how !== undefined) attrs.push(`how=\"${rule.how}\"`);\n if (rule.idref !== undefined) attrs.push(`idref=\"${rule.idref}\"`);\n const proxies = (rule.proxies ?? []).map(stringifyVmlRuleProxy).join(\"\");\n const attrStr = attrs.length > 0 ? \" \" + attrs.join(\" \") : \"\";\n return `<o:r${attrStr}>${proxies}</o:r>`;\n}\n\n/** Parse an o:r element. */\nfunction parseVmlRule(el: XmlElement): VmlRuleOptions {\n const attrs = el.attributes ?? {};\n const out: VmlRuleOptions = { id: String(attrs.id ?? \"\") };\n if (attrs.type !== undefined) out.type = String(attrs.type) as VmlRuleType;\n if (attrs.how !== undefined) out.how = String(attrs.how) as VmlRuleHow;\n if (attrs.idref !== undefined) out.idref = String(attrs.idref);\n const proxies: VmlRuleProxyOptions[] = [];\n for (const child of el.elements ?? []) {\n if (child.type === \"element\" && child.name === \"o:proxy\") {\n proxies.push(parseVmlRuleProxy(child));\n }\n }\n if (proxies.length > 0) out.proxies = proxies;\n return out;\n}\n\n/** Serialize an o:rules block. */\nfunction stringifyVmlRulesBlock(opts: VmlRulesOptions): string {\n const rules = (opts.rules ?? []).map(stringifyVmlRule).join(\"\");\n const attrStr = stringifyVmlAttributes(opts as Record<string, unknown>, [\n { field: \"ext\", attr: \"v:ext\", kind: \"string\" },\n ]);\n return `<o:rules${attrStr}>${rules}</o:rules>`;\n}\n\n/** Parse an o:rules element. */\nfunction parseVmlRulesBlock(el: XmlElement): VmlRulesOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, [{ field: \"ext\", attr: \"v:ext\", kind: \"string\" }], out);\n const rules: VmlRuleOptions[] = [];\n for (const child of el.elements ?? []) {\n if (child.type === \"element\" && child.name === \"o:r\") {\n rules.push(parseVmlRule(child));\n }\n }\n if (rules.length > 0) out.rules = rules;\n return out as VmlRulesOptions;\n}\n\n/** Serialize o:shapelayout. */\nexport function stringifyVmlShapeLayout(opts: VmlShapeLayoutOptions): string {\n const children: string[] = [];\n if (opts.idmap !== undefined) children.push(stringifyVmlIdMap(opts.idmap));\n if (opts.regrouptable !== undefined) children.push(stringifyVmlRegroupTable(opts.regrouptable));\n if (opts.rules !== undefined) children.push(stringifyVmlRulesBlock(opts.rules));\n const attrStr = stringifyVmlAttributes(opts as Record<string, unknown>, [\n { field: \"ext\", attr: \"v:ext\", kind: \"string\" },\n ]);\n return children.length > 0\n ? `<o:shapelayout${attrStr}>${children.join(\"\")}</o:shapelayout>`\n : `<o:shapelayout${attrStr}/>`;\n}\n\n/** Parse an o:shapelayout element. */\nexport function parseVmlShapeLayout(el: XmlElement): VmlShapeLayoutOptions {\n const out: Record<string, unknown> = {};\n parseVmlAttributes(el, [{ field: \"ext\", attr: \"v:ext\", kind: \"string\" }], out);\n for (const child of el.elements ?? []) {\n if (child.type !== \"element\") continue;\n if (child.name === \"o:idmap\") out.idmap = parseVmlIdMap(child);\n else if (child.name === \"o:regrouptable\") out.regrouptable = parseVmlRegroupTable(child);\n else if (child.name === \"o:rules\") out.rules = parseVmlRulesBlock(child);\n }\n return out as VmlShapeLayoutOptions;\n}\n"],"mappings":";;;;;;AAiCA,MAAa,gBAAqD;CAChE,MAAM;CACN,QAAQ;CACR,MAAM;CACN,cAAc;CACd,YAAY;CACZ,aAAa;CACb,WAAW;CACX,UAAU;CACV,oBAAoB;CACpB,4BAA4B;CAC5B,kBAAkB;CAClB,0BAA0B;CAC1B,UAAU;CACV,KAAK;CACL,YAAY;CACZ,OAAO;CACP,oBAAoB;CACpB,kBAAkB;CAClB,mBAAmB;CACnB,iBAAiB;CACjB,YAAY;CACZ,WAAW;CACX,gBAAgB;CAChB,cAAc;CAC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