@shbernal/ts-pptx 3.5.0 → 3.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +8 -0
  2. package/dist/{autopage-BYlTzX-l.js → autopage-DkjYZUFD.js} +3 -3
  3. package/dist/{autopage-BYlTzX-l.js.map → autopage-DkjYZUFD.js.map} +1 -1
  4. package/dist/browser.d.ts +5 -5
  5. package/dist/browser.js +4 -4
  6. package/dist/browser.js.map +1 -1
  7. package/dist/{diagnostics-BDuR8UkG.d.ts → diagnostics-DfBdDHre.d.ts} +20 -5
  8. package/dist/diagnostics-DfBdDHre.d.ts.map +1 -0
  9. package/dist/{errors-CgnueTYL.d.ts → errors-PflMPWBn.d.ts} +2 -2
  10. package/dist/{errors-CgnueTYL.d.ts.map → errors-PflMPWBn.d.ts.map} +1 -1
  11. package/dist/{fit-TjpNbMru.js → fit-BKs0zxMI.js} +3 -3
  12. package/dist/{fit-TjpNbMru.js.map → fit-BKs0zxMI.js.map} +1 -1
  13. package/dist/{html-dom-yUSdCExA.js → html-dom-B0I0QSbU.js} +4 -4
  14. package/dist/{html-dom-yUSdCExA.js.map → html-dom-B0I0QSbU.js.map} +1 -1
  15. package/dist/html.d.ts +3 -3
  16. package/dist/html.js +1 -1
  17. package/dist/index.d.ts +5 -5
  18. package/dist/index.js +3 -3
  19. package/dist/inspect.d.ts +1 -1
  20. package/dist/inspect.js +4 -5
  21. package/dist/inspect.js.map +1 -1
  22. package/dist/math.d.ts +1 -1
  23. package/dist/measure.d.ts +2 -2
  24. package/dist/measure.js +1 -1
  25. package/dist/{namespaces-CcKuzeuE.js → namespaces-BVnNu7sg.js} +74 -3
  26. package/dist/namespaces-BVnNu7sg.js.map +1 -0
  27. package/dist/node.d.ts +5 -5
  28. package/dist/node.js +3 -3
  29. package/dist/{notes-DNqAggXx.js → notes-CJFJaG6M.js} +310 -313
  30. package/dist/notes-CJFJaG6M.js.map +1 -0
  31. package/dist/{pres-Dybf7ZUl.d.ts → pres-BcBR3CSM.d.ts} +2 -2
  32. package/dist/{pres-Dybf7ZUl.d.ts.map → pres-BcBR3CSM.d.ts.map} +1 -1
  33. package/dist/{presentation-VfJ_FT7E.js → presentation-DrJtj3-C.js} +414 -515
  34. package/dist/presentation-DrJtj3-C.js.map +1 -0
  35. package/dist/{presentation-types-CpkTx9Xa.d.ts → presentation-types-CDjScsev.d.ts} +351 -274
  36. package/dist/presentation-types-CDjScsev.d.ts.map +1 -0
  37. package/dist/read.d.ts +31 -48
  38. package/dist/read.d.ts.map +1 -1
  39. package/dist/read.js +3 -3
  40. package/dist/script.d.ts +2 -2
  41. package/dist/script.d.ts.map +1 -1
  42. package/dist/script.js +18 -47
  43. package/dist/script.js.map +1 -1
  44. package/dist/{shapes-Kt51vry6.js → shapes-BemroU-z.js} +625 -265
  45. package/dist/shapes-BemroU-z.js.map +1 -0
  46. package/dist/{slide-B_aInw3N.d.ts → slide-ZqAdVvHV.d.ts} +1135 -1058
  47. package/dist/slide-ZqAdVvHV.d.ts.map +1 -0
  48. package/dist/{text-D04NUMvA.js → text-B8SLEaZx.js} +2089 -1418
  49. package/dist/text-B8SLEaZx.js.map +1 -0
  50. package/dist/units-1kRzYShk.js +231 -0
  51. package/dist/units-1kRzYShk.js.map +1 -0
  52. package/dist/units-internal-Dg95w_YD.js +753 -0
  53. package/dist/units-internal-Dg95w_YD.js.map +1 -0
  54. package/dist/zip.d.ts +1 -1
  55. package/package.json +2 -1
  56. package/dist/diagnostics-BDuR8UkG.d.ts.map +0 -1
  57. package/dist/diagnostics-CPVADSL1.js +0 -90
  58. package/dist/diagnostics-CPVADSL1.js.map +0 -1
  59. package/dist/namespaces-CcKuzeuE.js.map +0 -1
  60. package/dist/notes-DNqAggXx.js.map +0 -1
  61. package/dist/presentation-VfJ_FT7E.js.map +0 -1
  62. package/dist/presentation-types-CpkTx9Xa.d.ts.map +0 -1
  63. package/dist/shapes-Kt51vry6.js.map +0 -1
  64. package/dist/slide-B_aInw3N.d.ts.map +0 -1
  65. package/dist/text-D04NUMvA.js.map +0 -1
  66. package/dist/units-internal-DNvK2I6o.js +0 -896
  67. package/dist/units-internal-DNvK2I6o.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"units-internal-Dg95w_YD.js","names":[],"sources":["../src/enums.ts","../src/constants-internal.ts","../src/units-internal.ts"],"sourcesContent":["/**\n * ts-pptx Enums\n * NOTE: `enum` wont work for objects, so use `Object.freeze`\n */\n\n/**\n * Output-type name accepted by the zip/write layer. Derived from the `OutputType`\n * enum (see below) so the two never drift: adding a member to the enum extends this\n * union automatically.\n */\nexport type ZIP_OUTPUT_TYPE = `${OutputType}`\nexport type WRITE_OUTPUT_TYPE = ZIP_OUTPUT_TYPE\n/**\n * Public chart-type name accepted by `addChart()`. Derived from the internal\n * `ChartType` enum (see below) so the two never drift: adding a member to the\n * enum extends this union automatically.\n */\nexport type CHART_NAME = `${ChartType}`\n/**\n * Public scheme-color name. Derived from the `SchemeColor` enum (see below) so the\n * two never drift.\n */\nexport type SCHEME_COLORS = `${SchemeColor}`\n\nexport enum TextAnchor {\n\tb = 'b',\n\tctr = 'ctr',\n\tt = 't',\n}\n\n// ENUM\nexport enum OutputType {\n\tarraybuffer = 'arraybuffer',\n\tbase64 = 'base64',\n\tbinarystring = 'binarystring',\n\tblob = 'blob',\n\tnodebuffer = 'nodebuffer',\n\tuint8array = 'uint8array',\n}\nexport enum ChartType {\n\tarea = 'area',\n\tbar = 'bar',\n\tbar3d = 'bar3D',\n\tbubble = 'bubble',\n\tbubble3d = 'bubble3D',\n\tdoughnut = 'doughnut',\n\tline = 'line',\n\tpie = 'pie',\n\tradar = 'radar',\n\tscatter = 'scatter',\n\tstock = 'stock',\n\tsurface = 'surface',\n\twaterfall = 'waterfall',\n\tfunnel = 'funnel',\n\ttreemap = 'treemap',\n\tsunburst = 'sunburst',\n\thistogram = 'histogram',\n\tpareto = 'pareto',\n\tboxWhisker = 'boxWhisker',\n\tregionMap = 'regionMap',\n}\nexport enum ShapeType {\n\taccentBorderCallout1 = 'accentBorderCallout1',\n\taccentBorderCallout2 = 'accentBorderCallout2',\n\taccentBorderCallout3 = 'accentBorderCallout3',\n\taccentCallout1 = 'accentCallout1',\n\taccentCallout2 = 'accentCallout2',\n\taccentCallout3 = 'accentCallout3',\n\tactionButtonBackPrevious = 'actionButtonBackPrevious',\n\tactionButtonBeginning = 'actionButtonBeginning',\n\tactionButtonBlank = 'actionButtonBlank',\n\tactionButtonDocument = 'actionButtonDocument',\n\tactionButtonEnd = 'actionButtonEnd',\n\tactionButtonForwardNext = 'actionButtonForwardNext',\n\tactionButtonHelp = 'actionButtonHelp',\n\tactionButtonHome = 'actionButtonHome',\n\tactionButtonInformation = 'actionButtonInformation',\n\tactionButtonMovie = 'actionButtonMovie',\n\tactionButtonReturn = 'actionButtonReturn',\n\tactionButtonSound = 'actionButtonSound',\n\tarc = 'arc',\n\tbentArrow = 'bentArrow',\n\tbentUpArrow = 'bentUpArrow',\n\tbevel = 'bevel',\n\tblockArc = 'blockArc',\n\tborderCallout1 = 'borderCallout1',\n\tborderCallout2 = 'borderCallout2',\n\tborderCallout3 = 'borderCallout3',\n\tbracePair = 'bracePair',\n\tbracketPair = 'bracketPair',\n\tcallout1 = 'callout1',\n\tcallout2 = 'callout2',\n\tcallout3 = 'callout3',\n\tcan = 'can',\n\tchartPlus = 'chartPlus',\n\tchartStar = 'chartStar',\n\tchartX = 'chartX',\n\tchevron = 'chevron',\n\tchord = 'chord',\n\tcircularArrow = 'circularArrow',\n\tcloud = 'cloud',\n\tcloudCallout = 'cloudCallout',\n\tcorner = 'corner',\n\tcornerTabs = 'cornerTabs',\n\tcube = 'cube',\n\tcurvedDownArrow = 'curvedDownArrow',\n\tcurvedLeftArrow = 'curvedLeftArrow',\n\tcurvedRightArrow = 'curvedRightArrow',\n\tcurvedUpArrow = 'curvedUpArrow',\n\tcustGeom = 'custGeom',\n\tdecagon = 'decagon',\n\tdiagStripe = 'diagStripe',\n\tdiamond = 'diamond',\n\tdodecagon = 'dodecagon',\n\tdonut = 'donut',\n\tdoubleWave = 'doubleWave',\n\tdownArrow = 'downArrow',\n\tdownArrowCallout = 'downArrowCallout',\n\tellipse = 'ellipse',\n\tellipseRibbon = 'ellipseRibbon',\n\tellipseRibbon2 = 'ellipseRibbon2',\n\tflowChartAlternateProcess = 'flowChartAlternateProcess',\n\tflowChartCollate = 'flowChartCollate',\n\tflowChartConnector = 'flowChartConnector',\n\tflowChartDecision = 'flowChartDecision',\n\tflowChartDelay = 'flowChartDelay',\n\tflowChartDisplay = 'flowChartDisplay',\n\tflowChartDocument = 'flowChartDocument',\n\tflowChartExtract = 'flowChartExtract',\n\tflowChartInputOutput = 'flowChartInputOutput',\n\tflowChartInternalStorage = 'flowChartInternalStorage',\n\tflowChartMagneticDisk = 'flowChartMagneticDisk',\n\tflowChartMagneticDrum = 'flowChartMagneticDrum',\n\tflowChartMagneticTape = 'flowChartMagneticTape',\n\tflowChartManualInput = 'flowChartManualInput',\n\tflowChartManualOperation = 'flowChartManualOperation',\n\tflowChartMerge = 'flowChartMerge',\n\tflowChartMultidocument = 'flowChartMultidocument',\n\tflowChartOfflineStorage = 'flowChartOfflineStorage',\n\tflowChartOffpageConnector = 'flowChartOffpageConnector',\n\tflowChartOnlineStorage = 'flowChartOnlineStorage',\n\tflowChartOr = 'flowChartOr',\n\tflowChartPredefinedProcess = 'flowChartPredefinedProcess',\n\tflowChartPreparation = 'flowChartPreparation',\n\tflowChartProcess = 'flowChartProcess',\n\tflowChartPunchedCard = 'flowChartPunchedCard',\n\tflowChartPunchedTape = 'flowChartPunchedTape',\n\tflowChartSort = 'flowChartSort',\n\tflowChartSummingJunction = 'flowChartSummingJunction',\n\tflowChartTerminator = 'flowChartTerminator',\n\tfoldedCorner = 'foldedCorner',\n\tframe = 'frame',\n\tfunnel = 'funnel',\n\tgear6 = 'gear6',\n\tgear9 = 'gear9',\n\thalfFrame = 'halfFrame',\n\theart = 'heart',\n\theptagon = 'heptagon',\n\thexagon = 'hexagon',\n\thomePlate = 'homePlate',\n\thorizontalScroll = 'horizontalScroll',\n\tirregularSeal1 = 'irregularSeal1',\n\tirregularSeal2 = 'irregularSeal2',\n\tleftArrow = 'leftArrow',\n\tleftArrowCallout = 'leftArrowCallout',\n\tleftBrace = 'leftBrace',\n\tleftBracket = 'leftBracket',\n\tleftCircularArrow = 'leftCircularArrow',\n\tleftRightArrow = 'leftRightArrow',\n\tleftRightArrowCallout = 'leftRightArrowCallout',\n\tleftRightCircularArrow = 'leftRightCircularArrow',\n\tleftRightRibbon = 'leftRightRibbon',\n\tleftRightUpArrow = 'leftRightUpArrow',\n\tleftUpArrow = 'leftUpArrow',\n\tlightningBolt = 'lightningBolt',\n\tline = 'line',\n\tlineInv = 'lineInv',\n\tmathDivide = 'mathDivide',\n\tmathEqual = 'mathEqual',\n\tmathMinus = 'mathMinus',\n\tmathMultiply = 'mathMultiply',\n\tmathNotEqual = 'mathNotEqual',\n\tmathPlus = 'mathPlus',\n\tmoon = 'moon',\n\tnoSmoking = 'noSmoking',\n\tnonIsoscelesTrapezoid = 'nonIsoscelesTrapezoid',\n\tnotchedRightArrow = 'notchedRightArrow',\n\toctagon = 'octagon',\n\tparallelogram = 'parallelogram',\n\tpentagon = 'pentagon',\n\tpie = 'pie',\n\tpieWedge = 'pieWedge',\n\tplaque = 'plaque',\n\tplaqueTabs = 'plaqueTabs',\n\tplus = 'plus',\n\tquadArrow = 'quadArrow',\n\tquadArrowCallout = 'quadArrowCallout',\n\trect = 'rect',\n\tribbon = 'ribbon',\n\tribbon2 = 'ribbon2',\n\trightArrow = 'rightArrow',\n\trightArrowCallout = 'rightArrowCallout',\n\trightBrace = 'rightBrace',\n\trightBracket = 'rightBracket',\n\tround1Rect = 'round1Rect',\n\tround2DiagRect = 'round2DiagRect',\n\tround2SameRect = 'round2SameRect',\n\troundRect = 'roundRect',\n\trtTriangle = 'rtTriangle',\n\tsmileyFace = 'smileyFace',\n\tsnip1Rect = 'snip1Rect',\n\tsnip2DiagRect = 'snip2DiagRect',\n\tsnip2SameRect = 'snip2SameRect',\n\tsnipRoundRect = 'snipRoundRect',\n\tsquareTabs = 'squareTabs',\n\tstar10 = 'star10',\n\tstar12 = 'star12',\n\tstar16 = 'star16',\n\tstar24 = 'star24',\n\tstar32 = 'star32',\n\tstar4 = 'star4',\n\tstar5 = 'star5',\n\tstar6 = 'star6',\n\tstar7 = 'star7',\n\tstar8 = 'star8',\n\tstripedRightArrow = 'stripedRightArrow',\n\tsun = 'sun',\n\tswooshArrow = 'swooshArrow',\n\tteardrop = 'teardrop',\n\ttrapezoid = 'trapezoid',\n\ttriangle = 'triangle',\n\tupArrow = 'upArrow',\n\tupArrowCallout = 'upArrowCallout',\n\tupDownArrow = 'upDownArrow',\n\tupDownArrowCallout = 'upDownArrowCallout',\n\tuturnArrow = 'uturnArrow',\n\tverticalScroll = 'verticalScroll',\n\twave = 'wave',\n\twedgeEllipseCallout = 'wedgeEllipseCallout',\n\twedgeRectCallout = 'wedgeRectCallout',\n\twedgeRoundRectCallout = 'wedgeRoundRectCallout',\n}\nexport enum SchemeColor {\n\ttext1 = 'tx1',\n\ttext2 = 'tx2',\n\tbackground1 = 'bg1',\n\tbackground2 = 'bg2',\n\taccent1 = 'accent1',\n\taccent2 = 'accent2',\n\taccent3 = 'accent3',\n\taccent4 = 'accent4',\n\taccent5 = 'accent5',\n\taccent6 = 'accent6',\n}\nexport enum AlignH {\n\tleft = 'left',\n\tcenter = 'center',\n\tright = 'right',\n\tjustify = 'justify',\n}\nexport enum AlignV {\n\ttop = 'top',\n\tmiddle = 'middle',\n\tbottom = 'bottom',\n}\n\nexport type SHAPE_NAME =\n\t| 'accentBorderCallout1'\n\t| 'accentBorderCallout2'\n\t| 'accentBorderCallout3'\n\t| 'accentCallout1'\n\t| 'accentCallout2'\n\t| 'accentCallout3'\n\t| 'actionButtonBackPrevious'\n\t| 'actionButtonBeginning'\n\t| 'actionButtonBlank'\n\t| 'actionButtonDocument'\n\t| 'actionButtonEnd'\n\t| 'actionButtonForwardNext'\n\t| 'actionButtonHelp'\n\t| 'actionButtonHome'\n\t| 'actionButtonInformation'\n\t| 'actionButtonMovie'\n\t| 'actionButtonReturn'\n\t| 'actionButtonSound'\n\t| 'arc'\n\t| 'bentArrow'\n\t| 'bentUpArrow'\n\t| 'bevel'\n\t| 'blockArc'\n\t| 'borderCallout1'\n\t| 'borderCallout2'\n\t| 'borderCallout3'\n\t| 'bracePair'\n\t| 'bracketPair'\n\t| 'callout1'\n\t| 'callout2'\n\t| 'callout3'\n\t| 'can'\n\t| 'chartPlus'\n\t| 'chartStar'\n\t| 'chartX'\n\t| 'chevron'\n\t| 'chord'\n\t| 'circularArrow'\n\t| 'cloud'\n\t| 'cloudCallout'\n\t| 'corner'\n\t| 'cornerTabs'\n\t| 'cube'\n\t| 'curvedDownArrow'\n\t| 'curvedLeftArrow'\n\t| 'curvedRightArrow'\n\t| 'curvedUpArrow'\n\t| 'custGeom'\n\t| 'decagon'\n\t| 'diagStripe'\n\t| 'diamond'\n\t| 'dodecagon'\n\t| 'donut'\n\t| 'doubleWave'\n\t| 'downArrow'\n\t| 'downArrowCallout'\n\t| 'ellipse'\n\t| 'ellipseRibbon'\n\t| 'ellipseRibbon2'\n\t| 'flowChartAlternateProcess'\n\t| 'flowChartCollate'\n\t| 'flowChartConnector'\n\t| 'flowChartDecision'\n\t| 'flowChartDelay'\n\t| 'flowChartDisplay'\n\t| 'flowChartDocument'\n\t| 'flowChartExtract'\n\t| 'flowChartInputOutput'\n\t| 'flowChartInternalStorage'\n\t| 'flowChartMagneticDisk'\n\t| 'flowChartMagneticDrum'\n\t| 'flowChartMagneticTape'\n\t| 'flowChartManualInput'\n\t| 'flowChartManualOperation'\n\t| 'flowChartMerge'\n\t| 'flowChartMultidocument'\n\t| 'flowChartOfflineStorage'\n\t| 'flowChartOffpageConnector'\n\t| 'flowChartOnlineStorage'\n\t| 'flowChartOr'\n\t| 'flowChartPredefinedProcess'\n\t| 'flowChartPreparation'\n\t| 'flowChartProcess'\n\t| 'flowChartPunchedCard'\n\t| 'flowChartPunchedTape'\n\t| 'flowChartSort'\n\t| 'flowChartSummingJunction'\n\t| 'flowChartTerminator'\n\t| 'foldedCorner'\n\t| 'frame'\n\t| 'funnel'\n\t| 'gear6'\n\t| 'gear9'\n\t| 'halfFrame'\n\t| 'heart'\n\t| 'heptagon'\n\t| 'hexagon'\n\t| 'homePlate'\n\t| 'horizontalScroll'\n\t| 'irregularSeal1'\n\t| 'irregularSeal2'\n\t| 'leftArrow'\n\t| 'leftArrowCallout'\n\t| 'leftBrace'\n\t| 'leftBracket'\n\t| 'leftCircularArrow'\n\t| 'leftRightArrow'\n\t| 'leftRightArrowCallout'\n\t| 'leftRightCircularArrow'\n\t| 'leftRightRibbon'\n\t| 'leftRightUpArrow'\n\t| 'leftUpArrow'\n\t| 'lightningBolt'\n\t| 'line'\n\t| 'lineInv'\n\t| 'mathDivide'\n\t| 'mathEqual'\n\t| 'mathMinus'\n\t| 'mathMultiply'\n\t| 'mathNotEqual'\n\t| 'mathPlus'\n\t| 'moon'\n\t| 'noSmoking'\n\t| 'nonIsoscelesTrapezoid'\n\t| 'notchedRightArrow'\n\t| 'octagon'\n\t| 'parallelogram'\n\t| 'pentagon'\n\t| 'pie'\n\t| 'pieWedge'\n\t| 'plaque'\n\t| 'plaqueTabs'\n\t| 'plus'\n\t| 'quadArrow'\n\t| 'quadArrowCallout'\n\t| 'rect'\n\t| 'ribbon'\n\t| 'ribbon2'\n\t| 'rightArrow'\n\t| 'rightArrowCallout'\n\t| 'rightBrace'\n\t| 'rightBracket'\n\t| 'round1Rect'\n\t| 'round2DiagRect'\n\t| 'round2SameRect'\n\t| 'roundRect'\n\t| 'rtTriangle'\n\t| 'smileyFace'\n\t| 'snip1Rect'\n\t| 'snip2DiagRect'\n\t| 'snip2SameRect'\n\t| 'snipRoundRect'\n\t| 'squareTabs'\n\t| 'star10'\n\t| 'star12'\n\t| 'star16'\n\t| 'star24'\n\t| 'star32'\n\t| 'star4'\n\t| 'star5'\n\t| 'star6'\n\t| 'star7'\n\t| 'star8'\n\t| 'stripedRightArrow'\n\t| 'sun'\n\t| 'swooshArrow'\n\t| 'teardrop'\n\t| 'trapezoid'\n\t| 'triangle'\n\t| 'upArrow'\n\t| 'upArrowCallout'\n\t| 'upDownArrow'\n\t| 'upDownArrowCallout'\n\t| 'uturnArrow'\n\t| 'verticalScroll'\n\t| 'wave'\n\t| 'wedgeEllipseCallout'\n\t| 'wedgeRectCallout'\n\t| 'wedgeRoundRectCallout'\n\t| CONNECTOR_PRESET_NAME\n\n/**\n * Valid ECMA-376 `ST_ShapeType` presets that are not surfaced with a friendly\n * `ShapeType` name. They are still legal geometries PowerPoint renders, so the\n * preset-validation set must accept them.\n */\nconst EXTRA_SHAPE_PRESETS = [\n\t'straightConnector1',\n\t'bentConnector2',\n\t'bentConnector3',\n\t'bentConnector4',\n\t'bentConnector5',\n\t'curvedConnector2',\n\t'curvedConnector3',\n\t'curvedConnector4',\n\t'curvedConnector5',\n] as const\n\n/**\n * Connector preset geometries (`straightConnector1` / `bentConnector{2-5}` /\n * `curvedConnector{2-5}`) that `addShape` can serialize but that are not surfaced\n * as friendly `ShapeType` names. Derived from `EXTRA_SHAPE_PRESETS` so the public\n * `SHAPE_NAME` union and the runtime `VALID_SHAPE_PRESETS` set share one source of\n * truth and cannot drift. Use `addConnector` for live, endpoint-bound connectors;\n * pass these to `addShape` for a static box-positioned connector geometry.\n */\nexport type CONNECTOR_PRESET_NAME = (typeof EXTRA_SHAPE_PRESETS)[number]\n\n/**\n * Every shape geometry name ts-pptx can serialize without corrupting the\n * package: the OOXML preset geometries (`ST_ShapeType` — `ShapeType` values\n * plus the unexposed connectors above) and `custGeom` (freeform paths, emitted\n * as `<a:custGeom>` rather than `<a:prstGeom>`). Used to reject bogus presets\n * before they become an invalid `<a:prstGeom prst=\"...\">` that triggers\n * PowerPoint's \"needs repair\" dialog and drops the shape.\n */\nexport const VALID_SHAPE_PRESETS: ReadonlySet<string> = new Set<string>([\n\t...Object.values(ShapeType),\n\t...EXTRA_SHAPE_PRESETS,\n])\n\n/**\n * Narrow a public `CHART_NAME` to the internal `ChartType` enum. Because\n * `CHART_NAME` is derived from `ChartType`, every `CHART_NAME` value is by\n * construction a valid enum value, so this conversion is total and safe — it is\n * the single boundary cast that lets internal code compare against the enum\n * (enum-to-enum) instead of enum-to-string.\n */\nexport function asChartType(name: CHART_NAME): ChartType {\n\treturn name as ChartType\n}\n\n/** Every {@link ChartType} value, for validating a caller-supplied `type` at the API boundary. */\nconst CHART_TYPES: ReadonlySet<string> = new Set<string>(Object.values(ChartType))\n\n/**\n * Is `name` a chart type this library emits?\n *\n * `CHART_NAME` constrains TypeScript callers, but `addChart` is reachable from plain JavaScript\n * where nothing enforces the union — and the two emitters partition the catalog between them by\n * `switch`, so an off-catalog string has no arm in either and cannot produce a plot. Checked once\n * at define time (`gen/define/chart.ts`) so the caller hears about it at the call that was wrong,\n * rather than getting a chart-shaped hole in the deck.\n */\nexport function isChartType(name: unknown): name is CHART_NAME {\n\treturn typeof name === 'string' && CHART_TYPES.has(name)\n}\n\n/**\n * The chartEx (`cx:` / Office 2016 chart-extension) chart types. Unlike the classic 2007 catalog\n * these do NOT emit a `<c:chartSpace>` chart part: they emit a separate `chartEx{N}.xml` part in\n * the `http://schemas.microsoft.com/office/drawing/2014/chartex` namespace, are referenced from\n * the slide through `<mc:AlternateContent>`, and render only in PowerPoint 2016+/Microsoft 365\n * (older Office, Google Slides, Keynote and LibreOffice show the `<mc:Fallback>` shape instead).\n * See `gen/chart/chartex-xml.ts`.\n */\nconst CHARTEX_TYPES: ReadonlySet<string> = new Set<string>([\n\tChartType.waterfall,\n\tChartType.funnel,\n\tChartType.treemap,\n\tChartType.sunburst,\n\tChartType.histogram,\n\tChartType.pareto,\n\tChartType.boxWhisker,\n\tChartType.regionMap,\n])\n\n/**\n * Is `type` a chartEx (cx:) chart? Accepts a `ChartType`/`CHART_NAME` string; anything else —\n * including a combo-chart `ChartMulti[]` array or `undefined` — is not a chartEx type (combos are\n * classic-only), so those return `false`.\n */\nexport function isChartExType(type: unknown): boolean {\n\treturn typeof type === 'string' && CHARTEX_TYPES.has(type)\n}\n\nexport enum SlideObjectType {\n\tchart = 'chart',\n\tconnector = 'connector',\n\tgroup = 'group',\n\thyperlink = 'hyperlink',\n\timage = 'image',\n\tmedia = 'media',\n\tmodel3d = 'model3d',\n\toleObject = 'oleObject',\n\tonline = 'online',\n\tplaceholder = 'placeholder',\n\ttable = 'table',\n\ttablecell = 'tablecell',\n\ttext = 'text',\n\tnotes = 'notes',\n\tzoom = 'zoom',\n}\n\n/**\n * Maps a friendly `ConnectorType` to its OOXML connector preset *family*. `straight`\n * has a single fixed preset; `elbow` and `curved` select a member by bend count\n * (`bentConnector{3,4,5}` / `curvedConnector{3,4,5}`) — see `connectorPresetFor`.\n */\nexport const CONNECTOR_PRESETS = {\n\tstraight: 'straightConnector1',\n\telbow: 'bentConnector',\n\tcurved: 'curvedConnector',\n} as const satisfies Record<'straight' | 'elbow' | 'curved', string>\n\n/**\n * Resolve the concrete connector preset geometry name for a `type` + bend count.\n * `straight` ignores `bends` (it has no adjustable jog). For `elbow` / `curved`, the\n * preset suffix is `bends + 2`, so `bends` of 1/2/3 maps to `…Connector3/4/5`, each\n * of which exposes exactly `bends` adjustable guides (`adj1…adjN`).\n * @param {'straight' | 'elbow' | 'curved'} type - friendly connector routing style\n * @param {number} bends - number of adjustable bends (1–3); ignored for `straight`\n * @return {CONNECTOR_PRESET_NAME} OOXML preset geometry name (e.g. `bentConnector4`)\n */\nexport function connectorPresetFor(type: 'straight' | 'elbow' | 'curved', bends: number): CONNECTOR_PRESET_NAME {\n\tif (type === 'straight') return CONNECTOR_PRESETS.straight\n\treturn `${CONNECTOR_PRESETS[type]}${bends + 2}` as CONNECTOR_PRESET_NAME\n}\nexport enum PlaceholderType {\n\ttitle = 'title',\n\tbody = 'body',\n\timage = 'pic',\n\tchart = 'chart',\n\ttable = 'tbl',\n\tmedia = 'media',\n}\n/**\n * Placeholder-type name. Derived from the `PlaceholderType` enum (above) so the two\n * never drift.\n */\nexport type PLACEHOLDER_TYPE = `${PlaceholderType}`\n\n/**\n * Bullet glyph presets. Only `DEFAULT` is currently wired through to output; the remaining entries are\n * reserved and not yet selectable via options.\n */\nexport enum BulletType {\n\tDEFAULT = '&#x2022;',\n\tCHECK = '&#x2713;',\n\tSTAR = '&#x2605;',\n\tTRIANGLE = '&#x25B6;',\n}\n\n/**\n * Built-in PowerPoint table style IDs.\n *\n * Each value is the GUID that goes into `<a:tableStyleId>` inside `<a:tblPr>`.\n * These 74 GUIDs are the complete set defined in [MS-OE376] §5.1.6.10 and are\n * resolved by PowerPoint without embedding any style definition in the file.\n *\n * Only these enum members are supported. Raw GUID strings are not accepted;\n * use `TableStyle` members exclusively.\n */\nexport enum TableStyle {\n\t// ── No style ────────────────────────────────────────────────────────────\n\tNO_STYLE_NO_GRID = '{2D5ABB26-0587-4C30-8999-92F81FD0307C}',\n\tNO_STYLE_TABLE_GRID = '{5940675A-B579-460E-94D1-54222C63F5DA}',\n\n\t// ── Themed Style 1 ──────────────────────────────────────────────────────\n\tTHEMED_STYLE_1_ACCENT_1 = '{3C2FFA5D-87B4-456A-9821-1D502468CF0F}',\n\tTHEMED_STYLE_1_ACCENT_2 = '{284E427A-3D55-4303-BF80-6455036E1DE7}',\n\tTHEMED_STYLE_1_ACCENT_3 = '{69C7853C-536D-4A76-A0AE-DD22124D55A5}',\n\tTHEMED_STYLE_1_ACCENT_4 = '{775DCB02-9BB8-47FD-8907-85C794F793BA}',\n\tTHEMED_STYLE_1_ACCENT_5 = '{35758FB7-9AC5-4552-8A53-C91805E547FA}',\n\tTHEMED_STYLE_1_ACCENT_6 = '{08FB837D-C827-4EFA-A057-4D05807E0F7C}',\n\n\t// ── Themed Style 2 ──────────────────────────────────────────────────────\n\tTHEMED_STYLE_2_ACCENT_1 = '{D113A9D2-9D6B-4929-AA2D-F23B5EE8CBE7}',\n\tTHEMED_STYLE_2_ACCENT_2 = '{18603FDC-E32A-4AB5-989C-0864C3EAD2B8}',\n\tTHEMED_STYLE_2_ACCENT_3 = '{306799F8-075E-4A3A-A7F6-7FBC6576F1A4}',\n\tTHEMED_STYLE_2_ACCENT_4 = '{E269D01E-BC32-4049-B463-5C60D7B0CCD2}',\n\tTHEMED_STYLE_2_ACCENT_5 = '{327F97BB-C833-4FB7-BDE5-3F7075034690}',\n\tTHEMED_STYLE_2_ACCENT_6 = '{638B1855-1B75-4FBE-930C-398BA8C253C6}',\n\n\t// ── Light Style 1 ───────────────────────────────────────────────────────\n\tLIGHT_STYLE_1 = '{9D7B26C5-4107-4FEC-AEDC-1716B250A1EF}',\n\tLIGHT_STYLE_1_ACCENT_1 = '{3B4B98B0-60AC-42C2-AFA5-B58CD77FA1E5}',\n\tLIGHT_STYLE_1_ACCENT_2 = '{0E3FDE45-AF77-4B5C-9715-49D594BDF05E}',\n\tLIGHT_STYLE_1_ACCENT_3 = '{C083E6E3-FA7D-4D7B-A595-EF9225AFEA82}',\n\tLIGHT_STYLE_1_ACCENT_4 = '{D27102A9-8310-4765-A935-A1911B00CA55}',\n\tLIGHT_STYLE_1_ACCENT_5 = '{5FD0F851-EC5A-4D38-B0AD-8093EC10F338}',\n\tLIGHT_STYLE_1_ACCENT_6 = '{68D230F3-CF80-4859-8CE7-A43EE81993B5}',\n\n\t// ── Light Style 2 ───────────────────────────────────────────────────────\n\tLIGHT_STYLE_2 = '{7E9639D4-E3E2-4D34-9284-5A2195B3D0D7}',\n\tLIGHT_STYLE_2_ACCENT_1 = '{69012ECD-51FC-41F1-AA8D-1B2483CD663E}',\n\tLIGHT_STYLE_2_ACCENT_2 = '{72833802-FEF1-4C79-8D5D-14CF1EAF98D9}',\n\tLIGHT_STYLE_2_ACCENT_3 = '{F2DE63D5-997A-4646-A377-4702673A728D}',\n\tLIGHT_STYLE_2_ACCENT_4 = '{17292A2E-F333-43FB-9621-5CBBE7FDCDCB}',\n\tLIGHT_STYLE_2_ACCENT_5 = '{5A111915-BE36-4E01-A7E5-04B1672EAD32}',\n\tLIGHT_STYLE_2_ACCENT_6 = '{912C8C85-51F0-491E-9774-3900AFEF0FD7}',\n\n\t// ── Light Style 3 ───────────────────────────────────────────────────────\n\tLIGHT_STYLE_3 = '{616DA210-FB5B-4158-B5E0-FEB733F419BA}',\n\tLIGHT_STYLE_3_ACCENT_1 = '{BC89EF96-8CEA-46FF-86C4-4CE0E7609802}',\n\tLIGHT_STYLE_3_ACCENT_2 = '{5DA37D80-6434-44D0-A028-1B22A696006F}',\n\tLIGHT_STYLE_3_ACCENT_3 = '{8799B23B-EC83-4686-B30A-512413B5E67A}',\n\tLIGHT_STYLE_3_ACCENT_4 = '{ED083AE6-46FA-4A59-8FB0-9F97EB10719F}',\n\tLIGHT_STYLE_3_ACCENT_5 = '{BDBED569-4797-4DF1-A0F4-6AAB3CD982D8}',\n\tLIGHT_STYLE_3_ACCENT_6 = '{E8B1032C-EA38-4F05-BA0D-38AFFFC7BED3}',\n\n\t// ── Medium Style 1 ──────────────────────────────────────────────────────\n\tMEDIUM_STYLE_1 = '{793D81CF-94F2-401A-BA57-92F5A7B2D0C5}',\n\tMEDIUM_STYLE_1_ACCENT_1 = '{B301B821-A1FF-4177-AEE7-76D212191A09}',\n\tMEDIUM_STYLE_1_ACCENT_2 = '{9DCAF9ED-07DC-4A11-8D7F-57B35C25682E}',\n\tMEDIUM_STYLE_1_ACCENT_3 = '{1FECB4D8-DB02-4DC6-A0A2-4F2EBAE1DC90}',\n\tMEDIUM_STYLE_1_ACCENT_4 = '{1E171933-4619-4E11-9A3F-F7608DF75F80}',\n\tMEDIUM_STYLE_1_ACCENT_5 = '{FABFCF23-3B69-468F-B69F-88F6DE6A72F2}',\n\tMEDIUM_STYLE_1_ACCENT_6 = '{10A1B5D5-9B99-4C35-A422-299274C87663}',\n\n\t// ── Medium Style 2 ──────────────────────────────────────────────────────\n\tMEDIUM_STYLE_2 = '{073A0DAA-6AF3-43AB-8588-CEC1D06C72B9}',\n\tMEDIUM_STYLE_2_ACCENT_1 = '{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}',\n\tMEDIUM_STYLE_2_ACCENT_2 = '{21E4AEA4-8DFA-4A89-87EB-49C32662AFE0}',\n\tMEDIUM_STYLE_2_ACCENT_3 = '{F5AB1C69-6EDB-4FF4-983F-18BD219EF322}',\n\tMEDIUM_STYLE_2_ACCENT_4 = '{00A15C55-8517-42AA-B614-E9B94910E393}',\n\tMEDIUM_STYLE_2_ACCENT_5 = '{7DF18680-E054-41AD-8BC1-D1AEF772440D}',\n\tMEDIUM_STYLE_2_ACCENT_6 = '{93296810-A885-4BE3-A3E7-6D5BEEA58F35}',\n\n\t// ── Medium Style 3 ──────────────────────────────────────────────────────\n\tMEDIUM_STYLE_3 = '{8EC20E35-A176-4012-BC5E-935CFFF8708E}',\n\tMEDIUM_STYLE_3_ACCENT_1 = '{6E25E649-3F16-4E02-A733-19D2CDBF48F0}',\n\tMEDIUM_STYLE_3_ACCENT_2 = '{85BE263C-DBD7-4A20-BB59-AAB30ACAA65A}',\n\tMEDIUM_STYLE_3_ACCENT_3 = '{EB344D84-9AFB-497E-A393-DC336BA19D2E}',\n\tMEDIUM_STYLE_3_ACCENT_4 = '{EB9631B5-78F2-41C9-869B-9F39066F8104}',\n\tMEDIUM_STYLE_3_ACCENT_5 = '{74C1A8A3-306A-4EB7-A6B1-4F7E0EB9C5D6}',\n\tMEDIUM_STYLE_3_ACCENT_6 = '{2A488322-F2BA-4B5B-9748-0D474271808F}',\n\n\t// ── Medium Style 4 ──────────────────────────────────────────────────────\n\tMEDIUM_STYLE_4 = '{D7AC3CCA-C797-4891-BE02-D94E43425B78}',\n\tMEDIUM_STYLE_4_ACCENT_1 = '{69CF1AB2-1976-4502-BF36-3FF5EA218861}',\n\tMEDIUM_STYLE_4_ACCENT_2 = '{8A107856-5554-42FB-B03E-39F5DBC370BA}',\n\tMEDIUM_STYLE_4_ACCENT_3 = '{0505E3EF-67EA-436B-97B2-0124C06EBD24}',\n\tMEDIUM_STYLE_4_ACCENT_4 = '{C4B1156A-380E-4F78-BDF5-A606A8083BF9}',\n\tMEDIUM_STYLE_4_ACCENT_5 = '{22838BEF-8BB2-4498-84A7-C5851F593DF1}',\n\tMEDIUM_STYLE_4_ACCENT_6 = '{16D9F66E-5EB9-4882-86FB-DCBF35E3C3E4}',\n\n\t// ── Dark Style 1 ────────────────────────────────────────────────────────\n\tDARK_STYLE_1 = '{E8034E78-7F5D-4C2E-B375-FC64B27BC917}',\n\tDARK_STYLE_1_ACCENT_1 = '{125E5076-3810-47DD-B79F-674D7AD40C01}',\n\tDARK_STYLE_1_ACCENT_2 = '{37CE84F3-28C3-443E-9E96-99CF82512B78}',\n\tDARK_STYLE_1_ACCENT_3 = '{D03447BB-5D67-496B-8E87-E561075AD55C}',\n\tDARK_STYLE_1_ACCENT_4 = '{E929F9F4-4A8F-4326-A1B4-22849713DDAB}',\n\tDARK_STYLE_1_ACCENT_5 = '{8FD4443E-F989-4FC4-A0C8-D5A2AF1F390B}',\n\tDARK_STYLE_1_ACCENT_6 = '{AF606853-7671-496A-8E4F-DF71F8EC918B}',\n\n\t// ── Dark Style 2 ────────────────────────────────────────────────────────\n\tDARK_STYLE_2 = '{5202B0CA-FC54-4496-8BCA-5EF66A818D29}',\n\t/** Header uses Accent 2, body rows use Accent 1 */\n\tDARK_STYLE_2_ACCENT_1_ACCENT_2 = '{0660B408-B3CF-4A94-85FC-2B1E0A45F4A2}',\n\t/** Header uses Accent 4, body rows use Accent 3 */\n\tDARK_STYLE_2_ACCENT_3_ACCENT_4 = '{91EBBBCC-DAD2-459C-BE2E-F6DE35CF9A28}',\n\t/** Header uses Accent 6, body rows use Accent 5 */\n\tDARK_STYLE_2_ACCENT_5_ACCENT_6 = '{46F890A9-2807-4EBB-B81D-B2AA78EC7F39}',\n}\n","/**\n * Generator-internal constants — the non-published half of the enums module.\n *\n * `enums.ts` holds the genuinely public surface (the `ChartType`/`ShapeType`/\n * `SchemeColor`/`AlignH`… enums, the shape-preset sets, and the `*_NAME` unions) and is\n * `export *`-ed by every entrypoint. This module holds the constants only the generators\n * need — default styling, fixed axis/field ids, colour palettes, layout bases, and the\n * base64 placeholder images — none of which are part of the public API. Splitting them out\n * keeps `export *` from leaking them onto the package surface, mirroring the\n * `units-internal.ts` / `types/internal.ts` split. Nothing here is exported from an entrypoint.\n */\n\nimport type { BorderProps, OptsChartGridLine } from './types/index.js'\nimport type { ShadowPropsInternal } from './types/internal.js'\n\n// CONST\nexport const CRLF = '\\r\\n' // AKA: Chr(13) & Chr(10)\n// Base for `<p:sldLayoutId id>` (layout N gets BASE + N). 2147483649 = 0x80000001:\n// ECMA-376 ST_SlideLayoutId requires id >= 0x80000000, and PowerPoint conventionally\n// starts layout IDs one past that. See `makeXmlMaster` in `gen/slide/master.ts`.\nexport const LAYOUT_IDX_SERIES_BASE = 2147483649\nexport const REGEX_HEX_COLOR = /^[0-9a-fA-F]{6}$/\nexport const LINEH_MODIFIER = 1.67 // AKA: Golden Ratio Typography\n\nexport const DEF_BULLET_MARGIN = 27\nexport const DEF_CELL_BORDER: BorderProps = { type: 'solid', color: '666666', width: 1 }\nexport const DEF_CELL_MARGIN_IN: [number, number, number, number] = [0.05, 0.1, 0.05, 0.1] // \"Normal\" margins in PPT-2021 (\"Narrow\" is `0.05` for all 4)\nexport const DEF_CHART_BORDER: BorderProps = { type: 'solid', color: '363636', width: 1 }\nexport const DEF_CHART_GRIDLINE: OptsChartGridLine = { color: '888888', style: 'solid', size: 1, cap: 'flat' }\nexport const DEF_FONT_COLOR = '000000'\nexport const DEF_FONT_SIZE = 12\nexport const DEF_FONT_TITLE_SIZE = 18\nexport const DEF_PRES_LAYOUT = 'LAYOUT_16x9'\nexport const DEF_PRES_LAYOUT_NAME = 'DEFAULT'\nexport const DEF_SHAPE_LINE_COLOR = '333333'\nexport const DEF_SHAPE_SHADOW: ShadowPropsInternal = {\n\ttype: 'outer',\n\tblur: 3,\n\toffset: 23000 / 12700,\n\tangle: 90,\n\tcolor: '000000',\n\t_alpha: 0.35,\n\trotateWithShape: true,\n}\nexport const DEF_SLIDE_MARGIN_IN: [number, number, number, number] = [0.5, 0.5, 0.5, 0.5] // TRBL-style\nexport const DEF_TEXT_SHADOW: ShadowPropsInternal = {\n\ttype: 'outer',\n\tblur: 8,\n\toffset: 4,\n\tangle: 270,\n\tcolor: '000000',\n\t_alpha: 0.75,\n}\nexport const DEF_TEXT_GLOW = { size: 8, color: 'FFFFFF', opacity: 0.75 }\n\n// Fixed `<c:axId val>` identifiers that wire each chart's axes together (e.g. a value\n// axis's `<c:crossAx>` points at its category axis by id). ECMA-376 only requires the id\n// be a unique unsigned int within the chart; these stable constants keep the emitted\n// cross-references deterministic across decks. Consumed throughout `gen/chart/`.\nexport const AXIS_ID_VALUE_PRIMARY = '2094734552'\nexport const AXIS_ID_VALUE_SECONDARY = '2094734553'\nexport const AXIS_ID_CATEGORY_PRIMARY = '2094734554'\nexport const AXIS_ID_CATEGORY_SECONDARY = '2094734555'\nexport const AXIS_ID_SERIES_PRIMARY = '2094734556'\n\nexport const LETTERS: string[] = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('')\n// The default series palettes hold their distinct entries once. Every consumer reaches them\n// through `paletteColor()` (`gen/chart/chart-parts.ts`), which wraps back to the start, so a\n// chart with more series or points than the palette has entries repeats it rather than\n// running off the end.\nexport const BARCHART_COLORS: string[] = [\n\t'C0504D',\n\t'4F81BD',\n\t'9BBB59',\n\t'8064A2',\n\t'4BACC6',\n\t'F79646',\n\t'628FC6',\n\t'C86360',\n]\nexport const PIECHART_COLORS: string[] = [\n\t'5DA5DA',\n\t'FAA43A',\n\t'60BD68',\n\t'F17CB0',\n\t'B2912F',\n\t'B276B2',\n\t'DECF3F',\n\t'F15854',\n\t'A7A7A7',\n]\n\n// Fixed GUID PowerPoint stamps on a slide-number field: `<a:fld id=\"{...}\" type=\"slidenum\">`.\n// Microsoft-specific (not defined by ECMA-376); reused verbatim so PowerPoint recognizes the\n// field and auto-updates the page number. Consumed in `gen/slide/object.ts` (`slideObjectToXml`).\nexport const SLDNUMFLDID = '{F7021451-1387-4CA6-816F-3879F97B5CBC}'\n\n// Cached text of a slide-number field on a part that has no slide number of its own — a master\n// or a layout. Guillemets around a hash, which is verbatim what PowerPoint caches there: every\n// en-US master and layout in `test/read/fixtures/` writes `<a:t>‹#›</a:t>`. (A German-locale\n// deck writes `‹Nr.›`; the cache is recomputed on open, so the en-US spelling is the one to\n// emit rather than a per-locale table.) Consumed in `gen/slide/object.ts`.\nexport const SLDNUM_PLACEHOLDER_TEXT = '‹#›'\n\n// The XML prolog every emitted OOXML part begins with. Kept as one constant so a\n// stray edit can't desync one part's declaration from the rest.\nexport const XML_DECL = '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>'\n","/**\n * Generator-side unit conversion — the lenient layer over `units.ts`.\n *\n * `units.ts` holds the strict, public primitives: one branded `Emu` type and converters that\n * take a number and throw on anything they cannot represent. This module holds what the\n * generators actually need on top of that: converters that accept the loose shapes the\n * authoring API has always accepted (numeric strings, `\"5in\"`, `null`), that clamp to the\n * ranges PowerPoint will load without offering to repair the file, and that warn about legacy\n * inputs instead of failing.\n *\n * The split is deliberate: the leniency and the back-compat warnings are policy, not\n * arithmetic, and policy should not be part of the published API. Nothing here is exported\n * from an entrypoint.\n */\n\nimport { warn, warnOnce } from './diagnostics.js'\nimport { InvalidOptionError } from './errors.js'\nimport {\n\tEMU_PER_INCH,\n\tEMU_PER_POINT,\n\tANGLE_UNITS_PER_DEGREE,\n\tcoordToEmu,\n\tFIXED_PCT_PER_PERCENT,\n\tinchesToEmu,\n\tPERCENT_SCALE,\n\ttype Emu,\n} from './units.js'\nimport type { Coord, PresLayout } from './types/index.js'\n\n/**\n * Resolve a user `Coord` (x/y/w/h) to EMU — the single user-coordinate → EMU boundary.\n * - bare `number` → **inches** (no magnitude guessing); `\"<n>%\"` → percent of the slide axis;\n * `\"<n>in\"`/`\"<n>pt\"`/`\"<n>emu\"` → explicit units (see {@link Coord} / {@link coordToEmu})\n * - `null`/`undefined` → 0 (callers may omit a coordinate)\n * - throws on a non-finite number rather than silently collapsing the object to zero size\n * @param {Coord|null|undefined} size - user coordinate\n * @param {'X' | 'Y'} xyDir - axis (selects slide width vs height for percentages)\n * @param {PresLayout} layout - presentation layout (EMU dimensions)\n * @returns {Emu} resolved EMU value\n */\nexport function getSmartParseNumber(size: Coord | null | undefined, xyDir: 'X' | 'Y', layout: PresLayout): Emu {\n\tif (size === null || size === undefined) return 0 as Emu\n\n\t// GUARD: A NaN/Infinity coordinate is always a mistake (commonly arithmetic on an\n\t// `undefined` layout dimension). Fail loud with a targeted hint instead of the generic\n\t// converter message, since this is the most common way a deck collapses to zero-size.\n\tif (typeof size === 'number' && !isFinite(size)) {\n\t\tthrow new InvalidOptionError(\n\t\t\t'coord/non-finite',\n\t\t\t`Invalid ${xyDir || 'coordinate'} value: expected a finite number but received ${String(size)}. ` +\n\t\t\t\t'This usually means a layout dimension was read from a missing property (e.g. `layout.width` returning `undefined`). ' +\n\t\t\t\t'Use `slide.width`/`slide.height` or `STANDARD_LAYOUTS.<NAME>.width`/`.height` (inches).'\n\t\t)\n\t}\n\n\treturn coordToEmu(size, xyDir === 'Y' ? layout.height : layout.width)\n}\n\n/**\n * Convert inches into EMU.\n * - accepts a number (inches) or a numeric/`\"<n>in\"` string\n * - no magnitude guessing: values are always treated as inches (use {@link coordToEmu} for\n * user coordinates that may carry other units)\n * @param {number|string} inches - inches as number or string\n * @returns {Emu} EMU value\n */\nexport function inch2Emu(inches: number | string): Emu {\n\tif (typeof inches === 'string') inches = Number(inches.replace(/in*/gi, ''))\n\treturn inchesToEmu(inches)\n}\n\n/**\n * Convert a single `margin` component (table cell/table margin, or text-box/placeholder body\n * inset) to EMU.\n *\n * Margins are INCHES, consistent with the positional API (`x`/`y`/`w`/`h`) and the value\n * PowerPoint's own dialog shows (both the table cell-margin and the text-box internal-margin\n * fields are inches). Historically the library read these as POINTS (table cells used a magnitude\n * heuristic — `>= 1` points, `< 1` inches; text-box margins were straight points), so a legitimate\n * fraction-of-an-inch value entered from the PowerPoint dialog became a tiny points value. Every\n * value is now inches. A `>= 1` value is honored as inches but warns once, because it is almost\n * certainly a legacy points value that should be divided by 72 (e.g. `10` points → `0.139` inches).\n *\n * Shared by every margin site so they stay in lockstep: the cell XML emitter and text-box/slide-\n * number insets (`gen/slide/object.ts`), the autoPage row-height pass (`gen/table/autopage.ts`), and the measured-fit pass\n * (`measure-fit`).\n * @param {number} inches - margin component in inches\n * @returns {Emu} EMU value\n */\nexport function marginToEmu(inches: number): Emu {\n\tif (inches >= 1)\n\t\twarnOnce(\n\t\t\t'margin/legacy-points',\n\t\t\t'margins (table cell and text-box) are interpreted as inches (matching the rest of the API and the ' +\n\t\t\t\t'PowerPoint dialog); a value >= 1 is likely a legacy points value — divide by 72 to convert (e.g. 10pt => 0.139in).'\n\t\t)\n\treturn inch2Emu(inches)\n}\n\n/**\n * Resolve a table's column widths to EMU, the single source of truth shared by the\n * table XML emitter and the measured-fit pass (so a fitted cell sees the same grid\n * the renderer draws).\n * - an explicit `colW` **array** is per-column inches (`inch2Emu`); a non-finite slot\n * falls back to the even-distribution width\n * - otherwise the table's already-resolved width (`totalWidthEmu`, EMU) is split evenly\n * across `colCount` columns. (A scalar `colW` never reaches here — `addTableDefinition`\n * converts it to `w` and clears `colW`.)\n *\n * IMPORTANT: the even path divides an **EMU** width. Passing the raw inches `options.w`\n * instead (the historical bug) produced ~0-EMU columns (e.g. `w=9` → `gridCol w=\"3\"`),\n * collapsing auto-width tables to a sliver in PowerPoint/LibreOffice.\n * @param {Coord[]|Coord|undefined} colW - explicit per-column inches, or scalar/undefined\n * @param {number} totalWidthEmu - the table's resolved width in EMU\n * @param {number} colCount - number of grid columns (counting colspans)\n * @returns {number[]} per-column widths in EMU (length `colCount`)\n */\nexport function resolveTableColWidthsEmu(\n\tcolW: Coord[] | Coord | undefined,\n\ttotalWidthEmu: number,\n\tcolCount: number\n): number[] {\n\tif (!(colCount > 0)) return []\n\tconst even = totalWidthEmu > 0 ? Math.round(totalWidthEmu / colCount) : EMU_PER_INCH\n\tif (Array.isArray(colW)) {\n\t\treturn Array.from({ length: colCount }, (_, i) => {\n\t\t\t// Guard before inch2Emu: it throws on non-finite input. A missing/NaN slot\n\t\t\t// falls back to the even-distribution width.\n\t\t\tconst n = colW[i]\n\t\t\treturn typeof n === 'number' && Number.isFinite(n) ? Math.round(inch2Emu(n)) : even\n\t\t})\n\t}\n\treturn new Array<number>(colCount).fill(even)\n}\n\n/**\n * Convert points to EMU, leniently: anything that does not read as a finite number — a `NaN`,\n * an `Infinity`, a non-numeric string, `null` — becomes `0` rather than throwing.\n *\n * That is the whole difference from {@link pointsToEmu} in `units.ts`, which throws on the same\n * input. Emitters use this one for the many optional size/width/offset options where a missing\n * or malformed value should collapse the feature (a zero-width line, no shadow offset) rather\n * than take the whole deck down.\n *\n * @param pt - points, as a number or a numeric string\n * @returns the value in EMU, or `0` if it does not read as a finite number\n */\nexport function ptsToEmuLenient(pt: number | string): number {\n\tconst points = Number(pt)\n\treturn Number.isFinite(points) ? Math.round(points * EMU_PER_POINT) : 0\n}\n\n/**\n * Convert a transparency percentage (0-100) into a schema-valid `<a:alpha>` value\n * (ST_PositiveFixedPercentage, 0-100000). Out-of-range transparency yields an\n * alpha that PowerPoint rejects as needing repair, so clamp into range and warn.\n */\nexport function transparencyToAlpha(transparency: number): number {\n\tconst pct = Math.min(100, Math.max(0, transparency))\n\tif (pct !== transparency)\n\t\twarn('transparency/out-of-range', `transparency ${transparency} is outside the valid range 0-100; using ${pct}.`)\n\treturn Math.round((100 - pct) * FIXED_PCT_PER_PERCENT)\n}\n\n/** Convert an opacity (0-1) into a schema-valid `<a:alpha>` value (0-100000); clamps + warns on out-of-range input. */\nexport function opacityToAlpha(opacity: number): number {\n\tconst o = Math.min(1, Math.max(0, opacity))\n\tif (o !== opacity) warn('opacity/out-of-range', `opacity ${opacity} is outside the valid range 0-1; using ${o}.`)\n\treturn Math.round(o * PERCENT_SCALE)\n}\n\n/**\n * Convert a line width (points) to EMU clamped into ST_LineWidth (0..20116800 EMU,\n * i.e. 0-1584pt). Out-of-range widths make PowerPoint report the package as needing\n * repair, so clamp into range and warn.\n */\nexport function lineWidthToEmu(widthPts: number | string): number {\n\tconst raw = ptsToEmuLenient(widthPts)\n\tconst clamped = Math.min(20116800, Math.max(0, raw))\n\tif (clamped !== raw)\n\t\twarn(\n\t\t\t'line/width-out-of-range',\n\t\t\t`line width ${widthPts} is outside the valid range 0-1584pt; using ${clamped / EMU_PER_POINT}.`\n\t\t)\n\treturn clamped\n}\n\n/**\n * Convert degrees to a DrawingML angle (60000ths of a degree), **without** wrapping.\n *\n * Most angles in the format are not modular: a connection site at 400 degrees, a polar adjust\n * handle whose range runs to 540, an arc that sweeps 400 degrees — each means something a\n * reduction into 0..360 would destroy. Use this for those, and {@link convertRotationDegrees}\n * for the ones that genuinely are a rotation.\n *\n * Non-finite input throws rather than reaching the attribute: `Math.round(Infinity * 60000)` is\n * `Infinity`, which serializes as `ang=\"Infinity\"` and makes PowerPoint offer to repair the file.\n *\n * @param d - degrees\n * @param what - what is being converted, for the error message\n * @param code - diagnostic code to throw under, where a caller has a more specific one\n */\nexport function convertAngleUnits(d: number, what: string, code: AngleErrorCode = 'coord/non-finite'): number {\n\tassertFiniteDegrees(d, what, code)\n\treturn Math.round(d * ANGLE_UNITS_PER_DEGREE)\n}\n\n/** The codes {@link convertAngleUnits} may throw under, each declared in `codes.ts`. */\ntype AngleErrorCode = 'coord/non-finite' | 'geometry/arc-angle-non-finite'\n\nfunction assertFiniteDegrees(d: number, what: string, code: AngleErrorCode): void {\n\tif (typeof d !== 'number' || !Number.isFinite(d))\n\t\tthrow new InvalidOptionError(code, `${what} must be a finite number of degrees; received ${String(d)}.`)\n}\n\n/**\n * Convert a shape or gradient rotation (degrees) to a DrawingML angle (60000ths of a degree).\n *\n * A rotation *is* modular — 800 degrees and 80 degrees point the same way — so the value is\n * reduced with `% 360`. The reduction keeps the sign: `-45` stays `-45` rather than becoming\n * `315`, because both are valid `ST_Angle`, PowerPoint writes negative rotations itself, and\n * the read side reports back what was authored. Only an input outside -360..360 moves.\n *\n * @param d - degrees\n * @returns the `rot` value in 60000ths of a degree\n */\nexport function convertRotationDegrees(d: number): number {\n\tconst degrees = d || 0\n\t// Guard before reducing, so `Infinity` is reported as itself rather than as the `NaN` that\n\t// `Infinity % 360` would hand on.\n\tassertFiniteDegrees(degrees, 'rotation', 'coord/non-finite')\n\treturn Math.round((degrees % 360) * ANGLE_UNITS_PER_DEGREE)\n}\n\n/**\n * Convert a freeform arc angle (degrees) to an `<a:arcTo>` ST_AdjAngle value (60000ths).\n * Unlike a shape rotation, a sweep is not modular: a 400 degree swAng draws a different\n * arc than a 40 degree one, so the value is never wrapped into 0..360.\n * @param {number} d degrees\n * @param {'stAng' | 'swAng'} attr - attribute being emitted, for the error message\n * @returns {number} ST_AdjAngle value (60000ths of a degree)\n */\nexport function convertArcAngle(d: number, attr: 'stAng' | 'swAng'): number {\n\treturn convertAngleUnits(d, `Arc ${attr}`, 'geometry/arc-angle-non-finite')\n}\n"],"mappings":";;;AAwBA,IAAY,aAAL,yBAAA,YAAA;CACN,WAAA,OAAA;CACA,WAAA,SAAA;CACA,WAAA,OAAA;;AACD,EAAA,CAAA,CAAA;AAGA,IAAY,aAAL,yBAAA,YAAA;CACN,WAAA,iBAAA;CACA,WAAA,YAAA;CACA,WAAA,kBAAA;CACA,WAAA,UAAA;CACA,WAAA,gBAAA;CACA,WAAA,gBAAA;;AACD,EAAA,CAAA,CAAA;AACA,IAAY,YAAL,yBAAA,WAAA;CACN,UAAA,UAAA;CACA,UAAA,SAAA;CACA,UAAA,WAAA;CACA,UAAA,YAAA;CACA,UAAA,cAAA;CACA,UAAA,cAAA;CACA,UAAA,UAAA;CACA,UAAA,SAAA;CACA,UA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C,EAAE,EAAE;AACzG;;;;;;;;;;;;AAaA,SAAgB,uBAAuB,GAAmB;CACzD,MAAM,UAAU,KAAK;CAGrB,oBAAoB,SAAS,YAAY,kBAAkB;CAC3D,OAAO,KAAK,MAAO,UAAU,MAAO,sBAAsB;AAC3D;;;;;;;;;AAUA,SAAgB,gBAAgB,GAAW,MAAiC;CAC3E,OAAO,kBAAkB,GAAG,OAAO,QAAQ,+BAA+B;AAC3E"}
package/dist/zip.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { b as ZIP_OUTPUT_TYPE } from "./enums-CvRYniUA.js";
2
- import { a as TsPptxError, d as InvalidOptionErrorCode, f as MediaErrorCode, h as UnsupportedFeatureErrorCode, i as PackageReadError, l as ErrorCode, m as TsPptxCode, n as InvalidOptionError, o as TsPptxErrorOptions, p as PackageReadErrorCode, r as MediaError, s as UnsupportedFeatureError, t as InternalError, u as InternalErrorCode } from "./errors-CgnueTYL.js";
2
+ import { a as TsPptxError, d as InvalidOptionErrorCode, f as MediaErrorCode, h as UnsupportedFeatureErrorCode, i as PackageReadError, l as ErrorCode, m as TsPptxCode, n as InvalidOptionError, o as TsPptxErrorOptions, p as PackageReadErrorCode, r as MediaError, s as UnsupportedFeatureError, t as InternalError, u as InternalErrorCode } from "./errors-PflMPWBn.js";
3
3
  //#region src/zip.d.ts
4
4
  declare class ZipWriter {
5
5
  #private;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shbernal/ts-pptx",
3
- "version": "3.5.0",
3
+ "version": "3.7.0",
4
4
  "author": {
5
5
  "name": "shbernal",
6
6
  "url": "https://github.com/shbernal/"
@@ -112,6 +112,7 @@
112
112
  "test:browser": "pnpm run docs:build && playwright test",
113
113
  "demos:build": "pnpm run ensure-dist && pnpm --dir demos/showcases run build",
114
114
  "test:com": "pnpm run ensure-dist && node scripts/powerpoint-com-smoke.mjs",
115
+ "test:lo": "pnpm run ensure-dist && node scripts/libreoffice-render-smoke.mjs",
115
116
  "typecheck": "tsc -p tsconfig.json --noEmit",
116
117
  "typecheck:scripts": "tsc -p tsconfig.scripts.json --noEmit",
117
118
  "typecheck:test": "tsc -p tsconfig.test.json --noEmit",
@@ -1 +0,0 @@
1
- {"version":3,"file":"diagnostics-BDuR8UkG.d.ts","names":[],"sources":["../src/types/zoom.ts","../src/types/internal.ts","../src/runtime/types.ts","../src/units.ts","../src/presentation.ts","../src/clip.ts","../src/diagnostics.ts"],"mappings":";;;;;;;UAiBiB,sBAAsB;;EAEtC;;;;;EAKA;IAAe;IAAe;;;;;;EAK9B;;EAEA;;;UAIgB,uBAAuB;;EAEvC,QAAQ;;;UAIQ,yBAAyB;;EAEzC;;;;;;KAOW,mBAAmB;;;UCjBd,8BAA8B;EAC9C;;EAEA;;UAEgB,0BAA0B;EAC1C,QAAQ,YAAY;;UAEJ,sBAAsB;EACtC,MAAM,aAAa;EACnB,MAAM;EACN,MAAM;EAEN;EACA;EACA;EACA;;;;;;;EAOA;;UAGgB;EAChB,MAAM;;;;;;;;EAQN;EACA;EACA;EACA,OAAO;EACP;EACA;EACA;EACA;;UAEgB;EAChB;EACA,OAAO;EACP;EACA;EACA,gBAAgB;;EAEhB;EACA;EACA;IAAY;IAAW;;;;;;;;;;EASvB;;;;;;;;;EASA;EACA;;EAEA;;UAEgB;EAChB,OAAO;EACP,UAAU;EAEV,OAAO;EAEP,aAAa;EAEb;EAEA;EACA;EACA,YAAY;EAEZ;EACA,QAAQ;EACR;EACA;EACA;EACA,QAAQ;EAER,gBAAgB;EAEhB,OAAO;EAEP,MAAM;EAEN,UAAU;;;;;;;;UAQM;;EAEhB;;EAEA;;EAEA;IAAO;IAAW;IAAW;;;EAE7B;IAAU;IAAW;IAAW;;;EAEhC;IAAM;IAAY;IAAY;;;EAE9B;;EAEA;;;UAGgB;;EAEhB;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;EACA;;;UAGgB;;EAEhB;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;IAAS;IAAW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BAgC7B,qBAAqB,MAAM;;;;;;;;;;;;;;;;iBAuD3B"}
@@ -1,90 +0,0 @@
1
- //#region src/diagnostics.ts
2
- /** Prefix stamped on every warning so consumers can attribute console noise to this library. */
3
- const WARN_PREFIX = "ts-pptx";
4
- /** The default handler: one `console.warn` line per diagnostic, prefixed. */
5
- const consoleHandler = (diagnostic) => {
6
- console.warn(`${WARN_PREFIX}: ${diagnostic.message}`);
7
- };
8
- let handler = consoleHandler;
9
- /**
10
- * Route every library diagnostic to `handler`, or pass `null` to restore the default
11
- * (one prefixed `console.warn` per diagnostic).
12
- *
13
- * This is process-global rather than per-presentation, deliberately: the emitting code is a tree
14
- * of free functions in `gen/**` with no presentation in scope, and threading a handler through
15
- * every signature would be a far larger and worse change than the problem warrants. The practical
16
- * consequence is that a process building several decks concurrently cannot attribute a diagnostic
17
- * to one of them; if that matters, correlate on `code` or set the handler around each build.
18
- *
19
- * A throwing handler propagates out of whatever library call emitted the diagnostic, which is the
20
- * supported way to make a specific condition fatal:
21
- *
22
- * ```ts
23
- * setDiagnosticHandler((d) => {
24
- * if (d.code === 'coord/bare-number-is-inches') throw new Error(d.message)
25
- * })
26
- * ```
27
- * @param next - the receiver, or `null` to restore the console default
28
- */
29
- function setDiagnosticHandler(next) {
30
- handler = next ?? consoleHandler;
31
- }
32
- /**
33
- * Emit a library diagnostic.
34
- * @param code - the stable condition identifier ({@link DiagnosticCode})
35
- * @param message - explanation, without a `ts-pptx:` prefix (the default handler adds one)
36
- * @param detail - optional structured context
37
- */
38
- function warn(code, message, detail) {
39
- handler(detail === void 0 ? {
40
- code,
41
- message
42
- } : {
43
- code,
44
- message,
45
- detail
46
- });
47
- }
48
- const seen = /* @__PURE__ */ new Set();
49
- /**
50
- * Emit a library diagnostic at most once per distinct code+message.
51
- *
52
- * "Once" is **process-global**, the same scope {@link setDiagnosticHandler} has and for the
53
- * same reason: the emitting code is a tree of free functions in `gen/**` with no presentation
54
- * in scope. The consequence is different, though, and worth stating on its own — a process that
55
- * builds several decks does not get a second report of a condition an earlier deck already
56
- * tripped, so the second deck's diagnostics are incomplete rather than merely unattributed.
57
- * {@link resetDiagnosticState} is how a host that cares gets each build a clean slate.
58
- *
59
- * @param code - the stable condition identifier ({@link DiagnosticCode})
60
- * @param message - explanation (see {@link warn})
61
- * @param detail - optional structured context
62
- */
63
- function warnOnce(code, message, detail) {
64
- const key = `${code}\0${message}`;
65
- if (seen.has(key)) return;
66
- seen.add(key);
67
- warn(code, message, detail);
68
- }
69
- /**
70
- * Clear the {@link warnOnce} dedupe set, so a condition already reported reports again.
71
- *
72
- * Call it between builds in a host that builds more than one deck per process and wants each
73
- * build's diagnostics complete. Without it, deck two is silent about anything deck one already
74
- * warned for, which reads as "no problems found" rather than as "already mentioned".
75
- *
76
- * It also bounds the set. Most `warnOnce` messages interpolate the offending value, so a server
77
- * building decks from user input accumulates one entry per distinct bad value with no way to
78
- * release them.
79
- *
80
- * This does not touch the handler — {@link setDiagnosticHandler} owns that, and the two are
81
- * reset independently on purpose: a host usually installs its handler once and wants it to
82
- * survive.
83
- */
84
- function resetDiagnosticState() {
85
- seen.clear();
86
- }
87
- //#endregion
88
- export { warnOnce as i, setDiagnosticHandler as n, warn as r, resetDiagnosticState as t };
89
-
90
- //# sourceMappingURL=diagnostics-CPVADSL1.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"diagnostics-CPVADSL1.js","names":[],"sources":["../src/diagnostics.ts"],"sourcesContent":["/**\n * Central sink for library diagnostics.\n *\n * Every user-facing warning is routed through {@link warn} / {@link warnOnce} rather than calling\n * `console.warn` directly, so there is one place to apply a consistent prefix and one place a\n * consumer can take over — see {@link setDiagnosticHandler}. This module has no *runtime* imports\n * so it can be used from anywhere without risking an import cycle; `codes.ts` is types only and is\n * erased at compile time, so it does not cost that property.\n *\n * **A diagnostic's `code` is API; its `message` is not.** The code is a stable identifier a\n * consumer may branch on (`if (d.code === 'chart/non-finite-value')`); the wording behind it is\n * free to improve in any release. The vocabulary lives in `codes.ts` and is shared with the thrown\n * surface (`errors.ts`), so a condition that can both warn and throw reads the same either way.\n */\n\nimport type { DiagnosticCode } from './codes.js'\n\nexport type { DiagnosticCode }\n\n/** One diagnostic emitted by the library. */\nexport interface Diagnostic {\n\t/** Stable condition identifier — see {@link DiagnosticCode}. Branch on this, not on the text. */\n\treadonly code: DiagnosticCode\n\t/** Human-readable explanation. Free to change in any release; do not parse it. */\n\treadonly message: string\n\t/**\n\t * Structured context for the condition, when a site has any to give. No site populates it\n\t * today; it exists so one can start to without a breaking signature change.\n\t */\n\treadonly detail?: Readonly<Record<string, unknown>>\n}\n\n/** Receives every {@link Diagnostic} the library emits. See {@link setDiagnosticHandler}. */\nexport type DiagnosticHandler = (diagnostic: Diagnostic) => void\n\n/** Prefix stamped on every warning so consumers can attribute console noise to this library. */\nconst WARN_PREFIX = 'ts-pptx'\n\n/** The default handler: one `console.warn` line per diagnostic, prefixed. */\nconst consoleHandler: DiagnosticHandler = (diagnostic) => {\n\tconsole.warn(`${WARN_PREFIX}: ${diagnostic.message}`)\n}\n\nlet handler: DiagnosticHandler = consoleHandler\n\n/**\n * Route every library diagnostic to `handler`, or pass `null` to restore the default\n * (one prefixed `console.warn` per diagnostic).\n *\n * This is process-global rather than per-presentation, deliberately: the emitting code is a tree\n * of free functions in `gen/**` with no presentation in scope, and threading a handler through\n * every signature would be a far larger and worse change than the problem warrants. The practical\n * consequence is that a process building several decks concurrently cannot attribute a diagnostic\n * to one of them; if that matters, correlate on `code` or set the handler around each build.\n *\n * A throwing handler propagates out of whatever library call emitted the diagnostic, which is the\n * supported way to make a specific condition fatal:\n *\n * ```ts\n * setDiagnosticHandler((d) => {\n * if (d.code === 'coord/bare-number-is-inches') throw new Error(d.message)\n * })\n * ```\n * @param next - the receiver, or `null` to restore the console default\n */\nexport function setDiagnosticHandler(next: DiagnosticHandler | null): void {\n\thandler = next ?? consoleHandler\n}\n\n/**\n * Emit a library diagnostic.\n * @param code - the stable condition identifier ({@link DiagnosticCode})\n * @param message - explanation, without a `ts-pptx:` prefix (the default handler adds one)\n * @param detail - optional structured context\n */\nexport function warn(code: DiagnosticCode, message: string, detail?: Readonly<Record<string, unknown>>): void {\n\thandler(detail === undefined ? { code, message } : { code, message, detail })\n}\n\n// Track diagnostics already emitted so a recurring condition (e.g. the same out-of-range fontSize\n// on every cell of a table) is reported once instead of flooding the handler. Keyed on code AND\n// message, so a *different* offending value under the same code still reports.\nconst seen = new Set<string>()\n\n/**\n * Emit a library diagnostic at most once per distinct code+message.\n *\n * \"Once\" is **process-global**, the same scope {@link setDiagnosticHandler} has and for the\n * same reason: the emitting code is a tree of free functions in `gen/**` with no presentation\n * in scope. The consequence is different, though, and worth stating on its own — a process that\n * builds several decks does not get a second report of a condition an earlier deck already\n * tripped, so the second deck's diagnostics are incomplete rather than merely unattributed.\n * {@link resetDiagnosticState} is how a host that cares gets each build a clean slate.\n *\n * @param code - the stable condition identifier ({@link DiagnosticCode})\n * @param message - explanation (see {@link warn})\n * @param detail - optional structured context\n */\nexport function warnOnce(code: DiagnosticCode, message: string, detail?: Readonly<Record<string, unknown>>): void {\n\tconst key = `${code}\\0${message}`\n\tif (seen.has(key)) return\n\tseen.add(key)\n\twarn(code, message, detail)\n}\n\n/**\n * Clear the {@link warnOnce} dedupe set, so a condition already reported reports again.\n *\n * Call it between builds in a host that builds more than one deck per process and wants each\n * build's diagnostics complete. Without it, deck two is silent about anything deck one already\n * warned for, which reads as \"no problems found\" rather than as \"already mentioned\".\n *\n * It also bounds the set. Most `warnOnce` messages interpolate the offending value, so a server\n * building decks from user input accumulates one entry per distinct bad value with no way to\n * release them.\n *\n * This does not touch the handler — {@link setDiagnosticHandler} owns that, and the two are\n * reset independently on purpose: a host usually installs its handler once and wants it to\n * survive.\n */\nexport function resetDiagnosticState(): void {\n\tseen.clear()\n}\n"],"mappings":";;AAoCA,MAAM,cAAc;;AAGpB,MAAM,kBAAqC,eAAe;CACzD,QAAQ,KAAK,GAAG,YAAY,IAAI,WAAW,SAAS;AACrD;AAEA,IAAI,UAA6B;;;;;;;;;;;;;;;;;;;;;AAsBjC,SAAgB,qBAAqB,MAAsC;CAC1E,UAAU,QAAQ;AACnB;;;;;;;AAQA,SAAgB,KAAK,MAAsB,SAAiB,QAAkD;CAC7G,QAAQ,WAAW,KAAA,IAAY;EAAE;EAAM;CAAQ,IAAI;EAAE;EAAM;EAAS;CAAO,CAAC;AAC7E;AAKA,MAAM,uBAAO,IAAI,IAAY;;;;;;;;;;;;;;;AAgB7B,SAAgB,SAAS,MAAsB,SAAiB,QAAkD;CACjH,MAAM,MAAM,GAAG,KAAK,IAAI;CACxB,IAAI,KAAK,IAAI,GAAG,GAAG;CACnB,KAAK,IAAI,GAAG;CACZ,KAAK,MAAM,SAAS,MAAM;AAC3B;;;;;;;;;;;;;;;;AAiBA,SAAgB,uBAA6B;CAC5C,KAAK,MAAM;AACZ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"namespaces-CcKuzeuE.js","names":[],"sources":["../src/ooxml/check-enum.ts","../src/ooxml/st-enums.ts","../src/media/base64.ts","../src/media/image-size.ts","../src/ooxml/rel-types.ts","../src/ooxml/namespaces.ts"],"sourcesContent":["/**\n * Validating a value against an `ST_` enumeration, under the two policies the library uses.\n *\n * **Why validate at all.** A value outside its `ST_` union makes the containing part\n * schema-invalid, and PowerPoint reports that as a *corrupt file* rather than as a mis-set\n * option — so the cost of letting one through is a deck that will not open, attributed to\n * nothing in particular. Both halves therefore check before a value reaches the XML.\n *\n * **Why two policies.** They differ deliberately, and the difference is about where the value\n * came from:\n *\n * - {@link checkEnumOrWarn} (write path) reports and **drops** the attribute, leaving the\n * renderer on the schema default. An option here comes from a deck being built, and losing one\n * attribute is better than failing an entire build over it.\n * - {@link checkEnumOrThrow} (read/edit path) **throws**. A value here comes from a caller\n * editing one attribute of a loaded deck, so silently doing nothing would leave them looking at\n * an unchanged file with no explanation.\n *\n * Before this module the two policies were spread across three near-identical private validators\n * (two in `gen/`, one in `read/`), each with its own wording; adding an enum meant writing a\n * fourth. The policy split is worth keeping — the triplication was not.\n */\n\nimport type { DiagnosticCode, InvalidOptionErrorCode } from '../codes.js'\nimport { warnOnce } from '../diagnostics.js'\nimport { InvalidOptionError } from '../errors.js'\n\n/**\n * Check a value against its `ST_` union, reporting and dropping it when outside (the write-path\n * policy — see the module note).\n *\n * `undefined`/`null` returns `null` without reporting: an unset option is not an invalid one, and\n * it is by far the common case.\n *\n * The offending value is interpolated into the message deliberately. {@link warnOnce} dedups on\n * code **and** message, so keeping the value in the text is what lets a second, *different* bad\n * value under the same code still get reported.\n * @param value - the value the caller supplied, if any\n * @param valid - the enum's members\n * @param code - the condition to report\n * @param label - how to name the offending option in the message, e.g. ``'table cell: cell3D `preset`'``\n * @param detail - extra structured context to merge into the diagnostic's `detail`\n * @returns the value when legal, else `null`\n */\nexport function checkEnumOrWarn<T extends string>(\n\tvalue: string | undefined | null,\n\tvalid: readonly T[],\n\tcode: DiagnosticCode,\n\tlabel: string,\n\tdetail?: Readonly<Record<string, unknown>>\n): T | null {\n\tif (value === undefined || value === null) return null\n\tif ((valid as readonly string[]).includes(value)) return value as T\n\twarnOnce(code, `${label} value \\`${String(value)}\\` is not valid and is ignored — use one of ${valid.join(', ')}.`, {\n\t\treceived: value,\n\t\tvalid,\n\t\t...detail,\n\t})\n\treturn null\n}\n\n/**\n * Check a value against its `ST_` union, throwing when outside (the read/edit-path policy — see\n * the module note).\n * @param value - the value the caller asked for\n * @param valid - the enum's members\n * @param attribute - the attribute's name, for the message\n * @param code - the condition to report\n * @returns `value`, when it is legal\n */\nexport function checkEnumOrThrow<T extends string>(\n\tvalue: string,\n\tvalid: readonly T[],\n\tattribute: string,\n\tcode: InvalidOptionErrorCode\n): T {\n\tif ((valid as readonly string[]).includes(value)) return value as T\n\tthrow new InvalidOptionError(\n\t\tcode,\n\t\t`Invalid ${attribute}: ${JSON.stringify(value)}. Expected one of: ${valid.join(', ')}.`\n\t)\n}\n","/**\n * `ST_` simple-type enumerations from ECMA-376, declared once as the single source of both the\n * TypeScript union a caller is checked against and the runtime list a value is validated against.\n *\n * **The problem this solves.** Each of these used to exist twice: a hand-written string union in\n * `src/types/` (what the compiler enforces) and a hand-written array in `src/gen/` or `src/read/`\n * (what the validator checks at run time). Nothing tied the two together, so adding a member to\n * one and not the other produced either a value TypeScript accepts and the validator drops, or a\n * value the validator passes and the type rejects. Two of them had already diverged in *order*,\n * which is harmless, but nothing would have caught a divergence in *content*.\n *\n * **The shape.** Every entry is a `readonly` tuple declared `as const`, with its union derived via\n * `(typeof X)[number]`. Widening the tuple widens the union in the same edit — they cannot drift.\n * This is the idiom already used for `EMBEDDED_FONT_SLOTS` and `EXTRA_SHAPE_PRESETS`; this module\n * brings the stragglers onto it.\n *\n * **Why this module is neither `gen/` nor `read/`.** `src/types/` needs the unions for the public\n * write API, `src/gen/` needs the tuples to vet a value before emitting it, and `src/read/` needs\n * them to vet a value before writing it into a loaded part. It is a fact about the schema, so it\n * belongs to none of the three.\n *\n * Values are listed in **schema declaration order**, which is the order the diagnostics print\n * when they tell a caller what is legal.\n */\n\n/**\n * `ST_BevelPresetType` — the bevel profile applied to a 3-D edge.\n * @see ECMA-376 Part 1 §20.1.10.9\n */\nexport const BEVEL_PRESETS = [\n\t'relaxedInset',\n\t'circle',\n\t'slope',\n\t'cross',\n\t'angle',\n\t'softRound',\n\t'convex',\n\t'coolSlant',\n\t'divot',\n\t'riblet',\n\t'hardEdge',\n\t'artDeco',\n] as const\nexport type BevelPresetType = (typeof BEVEL_PRESETS)[number]\n\n/**\n * `ST_PresetMaterialType` — how a 3-D surface responds to light.\n * @see ECMA-376 Part 1 §20.1.10.50\n */\nexport const PRESET_MATERIALS = [\n\t'legacyMatte',\n\t'legacyPlastic',\n\t'legacyMetal',\n\t'legacyWireframe',\n\t'matte',\n\t'plastic',\n\t'metal',\n\t'warmMatte',\n\t'translucentPowder',\n\t'powder',\n\t'dkEdge',\n\t'softEdge',\n\t'clear',\n\t'flat',\n\t'softmetal',\n] as const\nexport type PresetMaterialType = (typeof PRESET_MATERIALS)[number]\n\n/**\n * `ST_LightRigType` — the preset lighting scene.\n * @see ECMA-376 Part 1 §20.1.10.35\n */\nexport const LIGHT_RIGS = [\n\t'legacyFlat1',\n\t'legacyFlat2',\n\t'legacyFlat3',\n\t'legacyFlat4',\n\t'legacyNormal1',\n\t'legacyNormal2',\n\t'legacyNormal3',\n\t'legacyNormal4',\n\t'legacyHarsh1',\n\t'legacyHarsh2',\n\t'legacyHarsh3',\n\t'legacyHarsh4',\n\t'threePt',\n\t'balanced',\n\t'soft',\n\t'harsh',\n\t'flood',\n\t'contrasting',\n\t'morning',\n\t'sunrise',\n\t'sunset',\n\t'chilly',\n\t'freezing',\n\t'flat',\n\t'twoPt',\n\t'glow',\n\t'brightRoom',\n] as const\nexport type LightRigType = (typeof LIGHT_RIGS)[number]\n\n/**\n * `ST_LightRigDirection` — where the light rig sits relative to the scene.\n * @see ECMA-376 Part 1 §20.1.10.33\n */\nexport const LIGHT_RIG_DIRECTIONS = ['tl', 't', 'tr', 'l', 'r', 'bl', 'b', 'br'] as const\nexport type LightRigDirection = (typeof LIGHT_RIG_DIRECTIONS)[number]\n\n/**\n * `ST_TextHorzOverflowType` — `a:bodyPr/@horzOverflow` and `a:tcPr/@horzOverflow`.\n * @see ECMA-376 Part 1 §20.1.10.68\n */\nexport const TEXT_HORZ_OVERFLOW = ['clip', 'overflow'] as const\nexport type TextHorzOverflowType = (typeof TEXT_HORZ_OVERFLOW)[number]\n\n/**\n * `ST_TextAnchoringType` — `a:bodyPr/@anchor` and `a:tcPr/@anchor`.\n * @see ECMA-376 Part 1 §20.1.10.60\n */\nexport const TEXT_ANCHORS = ['t', 'ctr', 'b', 'just', 'dist'] as const\nexport type TextAnchoringType = (typeof TEXT_ANCHORS)[number]\n\n/**\n * `ST_TextVerticalType` — `a:bodyPr/@vert` and `a:tcPr/@vert`.\n * @see ECMA-376 Part 1 §20.1.10.83\n */\nexport const TEXT_VERTICAL = [\n\t'horz',\n\t'vert',\n\t'vert270',\n\t'wordArtVert',\n\t'eaVert',\n\t'mongolianVert',\n\t'wordArtVertRtl',\n] as const\nexport type TextVerticalType = (typeof TEXT_VERTICAL)[number]\n\n/**\n * `ST_PresetLineDashVal` — the dash pattern of a line or border (`a:prstDash/@val`).\n *\n * The `sys*` members are the \"system\" dashes whose exact dot/gap ratio the renderer picks; the\n * rest are defined by the spec. Both `BorderProps.dashType` and `ShapeLineProps.dashType` accept\n * this whole set, so a caller who knows one knows the other.\n * @see ECMA-376 Part 1 §20.1.10.49\n */\nexport const PRESET_LINE_DASHES = [\n\t'solid',\n\t'dot',\n\t'dash',\n\t'lgDash',\n\t'dashDot',\n\t'lgDashDot',\n\t'lgDashDotDot',\n\t'sysDash',\n\t'sysDot',\n\t'sysDashDot',\n\t'sysDashDotDot',\n] as const\nexport type PresetLineDashVal = (typeof PRESET_LINE_DASHES)[number]\n","/**\n * Base64 payload handling for media parts — isomorphic across Node and browsers\n * (`TextEncoder`/`atob`/`btoa` only, no `Buffer`).\n */\n\n/**\n * Encode raw SVG markup as a base64 `image/svg+xml` data URI.\n * - lets callers pass inline SVG to `addImage({ svg })` without hand-rolling base64\n * - isomorphic and UTF-8 safe: uses the global `TextEncoder`/`btoa` (Node and browsers)\n * @param {string} svg - SVG markup, e.g. `'<svg ...>...</svg>'`\n * @returns {string} a `data:image/svg+xml;base64,...` URI\n */\nexport function svgMarkupToDataUri(svg: string): string {\n\treturn `data:image/svg+xml;base64,${bytesToBase64(new TextEncoder().encode(svg))}`\n}\n\n/**\n * Encode raw bytes as base64 (no `data:` prefix) using only `btoa`, so the result is the same\n * on Node, in a browser, and in a runtime that has neither `Buffer` nor `FileReader`.\n *\n * Chunked because `String.fromCharCode(...spread)` blows the argument-count limit on a payload\n * of any real size — a multi-megabyte video rel would throw rather than encode.\n * @param {Uint8Array} bytes - the payload\n * @returns {string} base64 text\n */\nexport function bytesToBase64(bytes: Uint8Array): string {\n\tconst CHUNK = 0x8000\n\tlet binary = ''\n\tfor (let i = 0; i < bytes.length; i += CHUNK) binary += String.fromCharCode(...bytes.subarray(i, i + CHUNK))\n\treturn btoa(binary)\n}\n\n/**\n * Present a freshly loaded media payload as a `data:` URI.\n *\n * A {@link RuntimeAdapter.loadMedia} implementation returns whichever encoding its host\n * makes cheap — the browser adapter a full URI, because `FileReader.readAsDataURL` is what\n * decodes a blob without blocking; Node and the neutral adapter raw base64, because neither\n * has a `FileReader`. This is where the two become one, so nothing downstream of the load\n * has to ask which it got.\n *\n * The mime label is documentary: {@link decodeBase64ToBytes} ignores it, and the one consumer\n * that needs a real URI (`image.src`, in the browser adapter's SVG preview) is handed the\n * adapter's own. It is taken from the rel anyway rather than hard-coded, so an already-correct\n * label is not overwritten with a wrong one.\n * @param {string} payload - what the adapter returned: raw base64, or an already-formed URI\n * @param {string} contentType - the rel's content type, e.g. `image/png`\n * @returns {string} a `data:` URI\n */\nexport function toMediaDataUri(payload: string, contentType: string): string {\n\treturn payload.startsWith('data:') ? payload : `data:${contentType};base64,${payload}`\n}\n\n/**\n * Decode a base64 image payload (raw base64 or a `data:` URI) to bytes.\n * - tolerant of the `data:[mime];base64,` prefix and of whitespace in the payload\n * @param {string} b64 - base64 string or data URI\n * @returns {Uint8Array | null} decoded bytes, or `null` when the payload is empty/undecodable\n */\nexport function decodeBase64ToBytes(b64: string): Uint8Array | null {\n\tif (!b64) return null\n\t// Strip any `data:...;base64,` prefix and surrounding whitespace\n\tconst comma = b64.indexOf('base64,')\n\tconst payload = (comma >= 0 ? b64.slice(comma + 'base64,'.length) : b64).replace(/\\s/g, '')\n\tif (!payload) return null\n\ttry {\n\t\tconst binary = atob(payload)\n\t\tconst bytes = new Uint8Array(binary.length)\n\t\tfor (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i)\n\t\treturn bytes\n\t} catch {\n\t\treturn null\n\t}\n}\n","/**\n * Intrinsic image geometry: reading a natural pixel size out of header bytes, and the\n * `<a:srcRect>` crop math that fits that natural size into a display box.\n *\n * Shared by both sides of the library — the write path (`addImage({ sizing })`) and the read\n * API's `Picture.setImage({ fit })` — which is why it lives outside `gen/` and `read/`.\n * Everything here is synchronous and pure: headers only, never pixel decoding.\n */\n\nimport { decodeBase64ToBytes } from './base64.js'\n\n/**\n * Read the intrinsic dimensions of an image from its header bytes.\n * - synchronous: parses only file-format headers, never decodes pixels\n * - raster: PNG, JPEG, GIF, BMP, and WebP (VP8 / VP8L / VP8X) — natural pixels\n * - vector: SVG — intrinsic size from the root `<svg>` width/height or viewBox\n * - unrecognized formats return `null` (no measurable intrinsic size)\n *\n * Used by image `sizing: 'cover' | 'contain'` to compute an aspect-correct\n * `<a:srcRect>` crop from the *natural* image ratio rather than the displayed box.\n * @param {string} dataB64 - base64 image payload or `data:` URI\n * @returns {{ w: number, h: number } | null} natural size, or `null` when unmeasurable\n */\nexport function getImageSizeFromBase64(dataB64: string): { w: number; h: number } | null {\n\tconst b = decodeBase64ToBytes(dataB64)\n\treturn b ? getImageSizeFromBytes(b) : null\n}\n\n/**\n * Read the intrinsic dimensions of an image from raw header bytes — the\n * byte-level core shared by {@link getImageSizeFromBase64} and the read API's\n * `Picture.setImage({ fit })`, which already holds the media bytes.\n * @param {Uint8Array} b - image bytes\n * @returns {{ w: number, h: number } | null} natural size, or `null` when unmeasurable\n */\nexport function getImageSizeFromBytes(b: Uint8Array): { w: number; h: number } | null {\n\tif (!b || b.length < 24) return null\n\n\t// Bounds-checked byte read: every access below is already guarded by an\n\t// explicit length check, so the `?? 0` fallback is unreachable in practice.\n\tconst u = (n: number): number => b[n] ?? 0\n\n\t// PNG: 8-byte signature, then IHDR with width@16 / height@20 (big-endian uint32)\n\tif (b[0] === 0x89 && b[1] === 0x50 && b[2] === 0x4e && b[3] === 0x47) {\n\t\tconst w = (u(16) << 24) | (u(17) << 16) | (u(18) << 8) | u(19)\n\t\tconst h = (u(20) << 24) | (u(21) << 16) | (u(22) << 8) | u(23)\n\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t}\n\n\t// GIF: \"GIF87a\"/\"GIF89a\", width@6 / height@8 (little-endian uint16)\n\tif (b[0] === 0x47 && b[1] === 0x49 && b[2] === 0x46) {\n\t\tconst w = u(6) | (u(7) << 8)\n\t\tconst h = u(8) | (u(9) << 8)\n\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t}\n\n\t// BMP: \"BM\", width@18 / height@22 (little-endian int32; height may be negative for top-down)\n\tif (b[0] === 0x42 && b[1] === 0x4d) {\n\t\tconst w = u(18) | (u(19) << 8) | (u(20) << 16) | (u(21) << 24)\n\t\tconst h = u(22) | (u(23) << 8) | (u(24) << 16) | (u(25) << 24)\n\t\tconst aw = Math.abs(w)\n\t\tconst ah = Math.abs(h)\n\t\treturn aw > 0 && ah > 0 ? { w: aw, h: ah } : null\n\t}\n\n\t// WebP: \"RIFF\"....\"WEBP\" then a VP8 / VP8L / VP8X chunk\n\tif (\n\t\tb[0] === 0x52 &&\n\t\tb[1] === 0x49 &&\n\t\tb[2] === 0x46 &&\n\t\tb[3] === 0x46 &&\n\t\tb[8] === 0x57 &&\n\t\tb[9] === 0x45 &&\n\t\tb[10] === 0x42 &&\n\t\tb[11] === 0x50\n\t) {\n\t\tconst fourCC = String.fromCharCode(u(12), u(13), u(14), u(15))\n\t\tif (fourCC === 'VP8 ' && b.length >= 30) {\n\t\t\t// Lossy: 14-bit width/height at offset 26/28 (little-endian, mask off scale bits)\n\t\t\tconst w = (u(26) | (u(27) << 8)) & 0x3fff\n\t\t\tconst h = (u(28) | (u(29) << 8)) & 0x3fff\n\t\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t\t}\n\t\tif (fourCC === 'VP8L' && b.length >= 25) {\n\t\t\t// Lossless: 14-bit width/height packed starting at bit 0 of offset 21\n\t\t\tconst bits = u(21) | (u(22) << 8) | (u(23) << 16) | (u(24) << 24)\n\t\t\tconst w = (bits & 0x3fff) + 1\n\t\t\tconst h = ((bits >> 14) & 0x3fff) + 1\n\t\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t\t}\n\t\tif (fourCC === 'VP8X' && b.length >= 30) {\n\t\t\t// Extended: 24-bit canvas width/height minus one at offset 24/27 (little-endian)\n\t\t\tconst w = (u(24) | (u(25) << 8) | (u(26) << 16)) + 1\n\t\t\tconst h = (u(27) | (u(28) << 8) | (u(29) << 16)) + 1\n\t\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t\t}\n\t\treturn null\n\t}\n\n\t// JPEG: \"FFD8\", scan segment markers for a Start-Of-Frame (SOFn) and read height@5 / width@7\n\tif (b[0] === 0xff && b[1] === 0xd8) {\n\t\tlet i = 2\n\t\twhile (i + 9 < b.length) {\n\t\t\tif (b[i] !== 0xff) {\n\t\t\t\ti++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst marker = u(i + 1)\n\t\t\t// SOF0..SOF15 carry frame dimensions, excluding DHT(C4)/JPG(C8)/DAC(CC)\n\t\t\tif (marker >= 0xc0 && marker <= 0xcf && marker !== 0xc4 && marker !== 0xc8 && marker !== 0xcc) {\n\t\t\t\tconst h = (u(i + 5) << 8) | u(i + 6)\n\t\t\t\tconst w = (u(i + 7) << 8) | u(i + 8)\n\t\t\t\treturn w > 0 && h > 0 ? { w, h } : null\n\t\t\t}\n\t\t\t// Standalone markers (RSTn / SOI / EOI / TEM) have no length payload\n\t\t\tif ((marker >= 0xd0 && marker <= 0xd9) || marker === 0x01) {\n\t\t\t\ti += 2\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// Otherwise skip this segment using its 2-byte big-endian length\n\t\t\tconst segLen = (u(i + 2) << 8) | u(i + 3)\n\t\t\tif (segLen < 2) break\n\t\t\ti += 2 + segLen\n\t\t}\n\t\treturn null\n\t}\n\n\t// SVG: text-based vector with no binary signature. When the payload is an\n\t// `<svg>` document, read its intrinsic size from the root element so that\n\t// `sizing: 'cover' | 'contain'` is aspect-correct for SVG, not just rasters.\n\tconst text = utf8Decode(b)\n\tif (/<svg[\\s>]/i.test(text)) return getSvgSizeFromMarkup(text)\n\n\treturn null\n}\n\n/**\n * Compute the `<a:srcRect>` crop percentages (each in 1/1000 of a percent, the\n * OOXML unit) for fitting an image of natural size `img` into a display `box`,\n * assuming the cropped region is then stretched to fill the box (`<a:stretch>`).\n *\n * - `cover`: fill the box, cropping the overflowing axis (positive l/r or t/b)\n * - `contain`: fit inside the box, letterboxing the short axis (negative l/r or t/b)\n *\n * Single source of truth for the crop math shared by the write side\n * (`ImageSizingXml`) and the read API's `Picture.setImage({ fit })`. `l`/`r` and\n * `t`/`b` are symmetric (centered crop).\n * @param {'cover' | 'contain'} type - fit mode\n * @param {{ w: number, h: number }} img - natural image pixel size\n * @param {{ w: number, h: number }} box - displayed frame size (any consistent unit)\n * @returns {{ l: number, r: number, t: number, b: number }} srcRect percentages\n */\nexport function fitSrcRectPercents(\n\ttype: 'cover' | 'contain',\n\timg: { w: number; h: number },\n\tbox: { w: number; h: number }\n): { l: number; r: number; t: number; b: number } {\n\tconst imgRatio = img.h / img.w\n\tconst boxRatio = box.h / box.w\n\tlet width: number\n\tlet height: number\n\tif (type === 'cover') {\n\t\tconst isBoxBased = boxRatio > imgRatio\n\t\twidth = isBoxBased ? box.h / imgRatio : box.w\n\t\theight = isBoxBased ? box.h : box.w * imgRatio\n\t} else {\n\t\tconst widthBased = boxRatio > imgRatio\n\t\twidth = widthBased ? box.w : box.h / imgRatio\n\t\theight = widthBased ? box.w * imgRatio : box.h\n\t}\n\tconst hz = Math.round(1e5 * 0.5 * (1 - box.w / width))\n\tconst vz = Math.round(1e5 * 0.5 * (1 - box.h / height))\n\treturn { l: hz, r: hz, t: vz, b: vz }\n}\n\n/**\n * Read the intrinsic size of an SVG document from its root `<svg>` element.\n * Follows the SVG sizing model: an explicit absolute `width`/`height` pair wins;\n * otherwise the `viewBox` width/height defines the size (and thus aspect ratio).\n * Percentage or missing `width`/`height` fall through to `viewBox`.\n * @param {string} svg - SVG markup\n * @returns {{ w: number, h: number } | null} intrinsic size, or `null` when undeterminable\n */\nfunction getSvgSizeFromMarkup(svg: string): { w: number; h: number } | null {\n\tconst openTag = /<svg\\b[^>]*>/i.exec(svg)?.[0]\n\tif (!openTag) return null\n\tconst attr = (name: string): string | null =>\n\t\tnew RegExp(`\\\\b${name}\\\\s*=\\\\s*[\"']([^\"']*)[\"']`, 'i').exec(openTag)?.[1] ?? null\n\t// Leading number with an optional absolute unit; a percentage is not an intrinsic length.\n\tconst absLength = (val: string | null): number => {\n\t\tif (val == null || /%\\s*$/.test(val)) return NaN\n\t\tconst m = /^\\s*\\+?(\\d*\\.?\\d+)/.exec(val)\n\t\treturn m ? parseFloat(m[1] ?? '') : NaN\n\t}\n\tlet w = absLength(attr('width'))\n\tlet h = absLength(attr('height'))\n\tif (!(w > 0 && h > 0)) {\n\t\tconst vb = attr('viewBox')\n\t\tconst p = vb\n\t\t\t? vb\n\t\t\t\t\t.trim()\n\t\t\t\t\t.split(/[\\s,]+/)\n\t\t\t\t\t.map(Number)\n\t\t\t: []\n\t\tconst vw = p[2]\n\t\tconst vh = p[3]\n\t\tif (p.length === 4 && vw != null && vh != null && vw > 0 && vh > 0) {\n\t\t\tw = vw\n\t\t\th = vh\n\t\t}\n\t}\n\treturn w > 0 && h > 0 ? { w, h } : null\n}\n\n/** Decode UTF-8 bytes to a string, isomorphic across Node and browsers. */\nfunction utf8Decode(bytes: Uint8Array): string {\n\treturn new TextDecoder().decode(bytes)\n}\n","/**\n * OPC relationship type URIs and part content types, and the schema-URI bases they are built from.\n *\n * These are long, near-identical strings that differ in one path segment, which makes a typo\n * both easy to write and invisible on review — a wrong URI does not throw, it silently matches\n * nothing on the read side and produces a part PowerPoint ignores or rejects on the write side.\n *\n * **Why this module is neither `gen/` nor `read/`.** Both halves need the same URIs, and for a\n * while each kept its own copy (`gen/oxml/schema-uris.ts`, `read/api/rel-types.ts`), with a note\n * in both saying a shared home was \"a separate decision\". It is this module: a rel type is a fact\n * about the OOXML package format, not about writing or reading one, so neither side should own it.\n * A divergence between the two copies would mean the writer emitting a rel the reader cannot find\n * — a round-trip bug with no compile-time signal.\n *\n * Only types used by more than one module live here. A rel type exactly one module cares about\n * (`chart`, `hyperlink`, `tags`, the two comments parts, `oleObject`, the MS media rels, …) stays\n * declared next to the code that reads or emits it — hoisting those would trade a definition you\n * can see for one you have to go and find, and buy nothing.\n *\n * The same reasoning covers **part content types**, which are the same kind of fact and fail the\n * same silent way. The write side is the exception at the bottom of this file: `[Content_Types].xml`\n * spells its entries out locally so each one stays greppable by its suffix next to the part it\n * declares.\n */\n\n/** Root of every ECMA-376 schema URI. Private: callers want one of the prefixes below. */\nconst SCHEMA_BASE = 'http://schemas.openxmlformats.org/'\n\n/**\n * Prefix for `.rels` `Type` URIs — append the type name (`slide`, `image`, `theme`, …).\n * Exported for the write side, which builds one-off rel types at their call sites.\n */\nexport const OFFICE_REL = SCHEMA_BASE + 'officeDocument/2006/relationships/'\n\n/** `xmlns` of every `<Relationships>` part. Also the prefix of the package-scoped rel types. */\nexport const PACKAGE_REL_NS = SCHEMA_BASE + 'package/2006/relationships'\n\n/** `p:sldIdLst` → a slide part. */\nexport const SLIDE_REL = OFFICE_REL + 'slide'\n/** A slide → its layout; a master → each of its layouts. */\nexport const SLIDE_LAYOUT_REL = OFFICE_REL + 'slideLayout'\n/** A layout → its master; the presentation → each master. */\nexport const SLIDE_MASTER_REL = OFFICE_REL + 'slideMaster'\n/** A slide → its notes slide. */\nexport const NOTES_SLIDE_REL = OFFICE_REL + 'notesSlide'\n/** A notes slide → the notes master; the presentation → the notes master. */\nexport const NOTES_MASTER_REL = OFFICE_REL + 'notesMaster'\n/** A master or notes master → its theme. Layouts and slides inherit it rather than holding one. */\nexport const THEME_REL = OFFICE_REL + 'theme'\n/** The package root → `ppt/presentation.xml`. The entry point to everything above. */\nexport const OFFICE_DOCUMENT_REL = OFFICE_REL + 'officeDocument'\n/** Any part → an image in `ppt/media/`. */\nexport const IMAGE_REL = OFFICE_REL + 'image'\n\n// --- Part content types ----------------------------------------------------\n\n/** Root of the ECMA-376 content types. Private: callers want one of the constants below. */\nconst OD_CONTENT = 'application/vnd.openxmlformats-officedocument.'\n\n/** `ppt/slides/slideN.xml`. */\nexport const SLIDE_CONTENT_TYPE = OD_CONTENT + 'presentationml.slide+xml'\n\n/** `ppt/slideMasters/slideMasterN.xml`. */\nexport const SLIDE_MASTER_CONTENT_TYPE = OD_CONTENT + 'presentationml.slideMaster+xml'\n/** `ppt/slideLayouts/slideLayoutN.xml`. */\nexport const SLIDE_LAYOUT_CONTENT_TYPE = OD_CONTENT + 'presentationml.slideLayout+xml'\n/** `ppt/notesSlides/notesSlideN.xml`. */\nexport const NOTES_SLIDE_CONTENT_TYPE = OD_CONTENT + 'presentationml.notesSlide+xml'\n/** `ppt/notesMasters/notesMasterN.xml`. */\nexport const NOTES_MASTER_CONTENT_TYPE = OD_CONTENT + 'presentationml.notesMaster+xml'\n/** `ppt/theme/themeN.xml`. Not `presentationml.`: a theme is a DrawingML part. */\nexport const THEME_CONTENT_TYPE = OD_CONTENT + 'theme+xml'\n","/**\n * OOXML namespace URIs, by their canonical prefix.\n *\n * A namespace URI is a fact about the format, not about reading or writing one, so it belongs\n * here rather than on either side — the same reasoning `rel-types.ts` states at length, and for\n * the same failure mode: these are long, near-identical strings, and a typo does not throw. It\n * silently matches nothing on the read side and produces a part PowerPoint ignores on the write\n * side.\n *\n * The table lived in `read/oxml/dom.ts` and could not be reached from `gen/`, because that\n * module imports `@xmldom/xmldom` at module scope and pulling an XML DOM into the write-only\n * bundle is a real cost. So the write side hand-wrote the URIs instead: three separate `A_NS`\n * constants and seven copies of the same `xmlns:a`/`xmlns:r`/`xmlns:p` triple. This module has\n * **no runtime imports** — like `rel-types.ts`, `st-enums.ts` and `sequence.ts` beside it — so\n * both sides can reach it and neither pays for the other's dependencies. `read/oxml/dom.ts`\n * re-exports it, so no read-side import path changed.\n */\n\n/** Canonical OOXML prefix → namespace URI registry. */\nexport const OOXML_NS = Object.freeze({\n\ta: 'http://schemas.openxmlformats.org/drawingml/2006/main',\n\tc: 'http://schemas.openxmlformats.org/drawingml/2006/chart',\n\tcp: 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties',\n\tct: 'http://schemas.openxmlformats.org/package/2006/content-types',\n\tcx: 'http://schemas.microsoft.com/office/drawing/2014/chartex',\n\tdc: 'http://purl.org/dc/elements/1.1/',\n\tdcterms: 'http://purl.org/dc/terms/',\n\tdgm: 'http://schemas.openxmlformats.org/drawingml/2006/diagram',\n\tdsp: 'http://schemas.microsoft.com/office/drawing/2008/diagram',\n\tep: 'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties',\n\tmc: 'http://schemas.openxmlformats.org/markup-compatibility/2006',\n\tp: 'http://schemas.openxmlformats.org/presentationml/2006/main',\n\tp14: 'http://schemas.microsoft.com/office/powerpoint/2010/main',\n\tp188: 'http://schemas.microsoft.com/office/powerpoint/2018/8/main',\n\tpr: 'http://schemas.openxmlformats.org/package/2006/relationships',\n\tr: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',\n})\n\n/**\n * The `xmlns` declarations every PresentationML part root carries, in the order the emitters\n * have always written them.\n *\n * Spread this **first** in a root element's attribute map: `el()` serializes attributes in\n * object-key order, so the three keys have to keep the positions the literals occupied or the\n * emitted bytes move. A root with extra attributes (`show` on `p:sld`, `def` on `a:tblStyleLst`)\n * lists them after the spread, which is where they already were.\n */\nexport const PML_ROOT_NS = Object.freeze({\n\t'xmlns:a': OOXML_NS.a,\n\t'xmlns:r': OOXML_NS.r,\n\t'xmlns:p': OOXML_NS.p,\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA4CA,SAAgB,gBACf,OACA,OACA,MACA,OACA,QACW;CACX,IAAI,UAAU,KAAA,KAAa,UAAU,MAAM,OAAO;CAClD,IAAK,MAA4B,SAAS,KAAK,GAAG,OAAO;CACzD,SAAS,MAAM,GAAG,MAAM,WAAW,OAAO,KAAK,EAAE,8CAA8C,MAAM,KAAK,IAAI,EAAE,IAAI;EACnH,UAAU;EACV;EACA,GAAG;CACJ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