@hirokisakabe/pom 9.1.2 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buildContext.js +2 -2
- package/dist/buildContext.js.map +1 -1
- package/dist/buildPptx.d.ts +2 -1
- package/dist/buildPptx.d.ts.map +1 -1
- package/dist/buildPptx.js +4 -3
- package/dist/buildPptx.js.map +1 -1
- package/dist/calcYogaLayout/calcYogaLayout.js +1 -1
- package/dist/calcYogaLayout/calcYogaLayout.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/registry/definitions/icon.js +1 -1
- package/dist/registry/definitions/list.js.map +1 -1
- package/dist/renderPptx/nodes/chart.js +172 -47
- package/dist/renderPptx/nodes/chart.js.map +1 -1
- package/dist/renderPptx/nodes/flow.js +4 -1
- package/dist/renderPptx/nodes/flow.js.map +1 -1
- package/dist/renderPptx/nodes/icon.js +5 -2
- package/dist/renderPptx/nodes/icon.js.map +1 -1
- package/dist/renderPptx/nodes/list.js +7 -9
- package/dist/renderPptx/nodes/list.js.map +1 -1
- package/dist/renderPptx/nodes/matrix.js +4 -1
- package/dist/renderPptx/nodes/matrix.js.map +1 -1
- package/dist/renderPptx/nodes/processArrow.js +8 -2
- package/dist/renderPptx/nodes/processArrow.js.map +1 -1
- package/dist/renderPptx/nodes/pyramid.js +4 -1
- package/dist/renderPptx/nodes/pyramid.js.map +1 -1
- package/dist/renderPptx/nodes/shape.js +5 -2
- package/dist/renderPptx/nodes/shape.js.map +1 -1
- package/dist/renderPptx/nodes/table.js +89 -59
- package/dist/renderPptx/nodes/table.js.map +1 -1
- package/dist/renderPptx/nodes/text.js +1 -18
- package/dist/renderPptx/nodes/text.js.map +1 -1
- package/dist/renderPptx/nodes/timeline.js +9 -3
- package/dist/renderPptx/nodes/timeline.js.map +1 -1
- package/dist/renderPptx/nodes/tree.js +4 -1
- package/dist/renderPptx/nodes/tree.js.map +1 -1
- package/dist/renderPptx/pptxAuthoring.js +381 -0
- package/dist/renderPptx/pptxAuthoring.js.map +1 -0
- package/dist/renderPptx/renderPptx.js +157 -126
- package/dist/renderPptx/renderPptx.js.map +1 -1
- package/dist/renderPptx/textOptions.js +7 -8
- package/dist/renderPptx/textOptions.js.map +1 -1
- package/dist/renderPptx/units.js +3 -3
- package/dist/renderPptx/units.js.map +1 -1
- package/dist/renderPptx/utils/backgroundBorder.js +30 -44
- package/dist/renderPptx/utils/backgroundBorder.js.map +1 -1
- package/dist/renderPptx/utils/contentArea.js +1 -1
- package/dist/renderPptx/utils/contentArea.js.map +1 -1
- package/dist/renderPptx/utils/glimpsePicture.js +3 -22
- package/dist/renderPptx/utils/glimpsePicture.js.map +1 -1
- package/dist/renderPptx/utils/glimpseShape.js +6 -25
- package/dist/renderPptx/utils/glimpseShape.js.map +1 -1
- package/dist/renderPptx/utils/glimpseTextBox.js +41 -60
- package/dist/renderPptx/utils/glimpseTextBox.js.map +1 -1
- package/dist/renderPptx/utils/straightLine.js +5 -2
- package/dist/renderPptx/utils/straightLine.js.map +1 -1
- package/dist/renderPptx/utils/visualStyle.js +3 -33
- package/dist/renderPptx/utils/visualStyle.js.map +1 -1
- package/dist/renderPptx/writablePptx.d.ts +23 -0
- package/dist/renderPptx/writablePptx.d.ts.map +1 -0
- package/dist/renderPptx/writablePptx.js +74 -0
- package/dist/renderPptx/writablePptx.js.map +1 -0
- package/dist/shared/measureImage.js.map +1 -1
- package/package.json +4 -5
- package/dist/renderPptx/glimpseTextBoxes.js +0 -646
- package/dist/renderPptx/glimpseTextBoxes.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"glimpseTextBoxes.js","names":[],"sources":["../../src/renderPptx/glimpseTextBoxes.ts"],"sourcesContent":["/**\n * Text primitive の @pptx-glimpse/document writer への段階的 swap。\n *\n * 混在期間の合成方式は「pptxgenjs 出力 zip をベースに、swap 済み Text\n * primitive の shape XML だけを glimpse writer で生成して該当 marker shape と\n * 差し替える」方式を採用する。pptxgenjs 側にはまだ Shape / Image / Table /\n * Chart など未 swap primitive と slide master 生成が残っているため、既存 zip を\n * ベースにすると [Content_Types].xml / rels / media parts の管理を現行実装へ\n * 寄せられる。代替案として glimpse の package をベースに未 swap primitive を\n * pptxgenjs から取り込む方式も検討したが、初回スライス時点では pptxgenjs 側の\n * 非 text primitive と master 出力を XML part 単位で切り出す責務が増え、以降の\n * primitive swap より先に package 合成の複雑さが大きくなるため採用しない。\n *\n * marker shape は描画順を保持するためだけに pptxgenjs へ追加し、write 時に\n * glimpse の `<p:sp>` で丸ごと置換する。Text content 自体は pptxgenjs `addText`\n * を経由しない。\n */\nimport {\n addPicture,\n addShape,\n addTextBox,\n asEmu,\n asHundredthPt,\n asOoxmlAngle,\n asOoxmlPercent,\n asPt,\n createPptx,\n type AddTextBoxGradientFillInput,\n type AddShapeInput,\n type AddPictureInput,\n type AddTextBoxInput,\n type AddTextBoxParagraphInput,\n type AddTextBoxRunPropertiesInput,\n type MediaPart,\n type PartPath,\n type PptxSourceModel,\n type PptxSourceModelAddPictureEdit,\n type PptxSourceModelAddShapeEdit,\n type PptxSourceModelAddTextBoxEdit,\n readPptx,\n} from \"@pptx-glimpse/document\";\nimport type {\n BorderStyle,\n PositionedNode,\n ShadowStyle,\n TextGlow,\n TextOutline,\n Underline,\n} from \"../types.ts\";\nimport { parseGradient, parseLinearGradient } from \"../shared/gradient.ts\";\nimport { EMU_PER_IN, pxToEmu, pxToPt } from \"./units.ts\";\nimport { createTextOptions, resolveSubSup } from \"./textOptions.ts\";\n\ntype PptxGenJSInstance = import(\"pptxgenjs\").default;\ntype StreamProps = NonNullable<Parameters<PptxGenJSInstance[\"stream\"]>[0]>;\ntype WriteProps = NonNullable<Parameters<PptxGenJSInstance[\"write\"]>[0]>;\ntype WriteFileProps = NonNullable<\n Parameters<PptxGenJSInstance[\"writeFile\"]>[0]\n>;\ntype BrowserWritablePptx = PptxGenJSInstance & {\n writeFileToBrowser?: (fileName: string, blobContent: Blob) => Promise<string>;\n};\ntype TextPositionedNode = Extract<PositionedNode, { type: \"text\" }>;\n\ntype XmlTransform = (xml: string) => string;\n\nconst MARKER_PREFIX = \"pom-text:\";\nconst SHAPE_MARKER_PREFIX = \"pom-shape:\";\nconst PICTURE_MARKER_PREFIX = \"pom-picture:\";\nconst SLIDE_BACKGROUND_MARKER_BASE = 0x0f7a3d;\nconst HYPERLINK_REL_TYPE =\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\";\nconst IMAGE_REL_TYPE =\n \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\";\n\ninterface GlimpseTextRun {\n text: string;\n properties: AddTextBoxRunPropertiesInput;\n href?: string;\n}\n\nasync function loadJSZip(): Promise<typeof import(\"jszip\")> {\n const mod = await import(\"jszip\");\n /* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return */\n return (mod as any).default ?? mod;\n /* eslint-enable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-return */\n}\n\nexport function cleanHex(color: string | undefined): string | undefined {\n return color?.replace(/^#/, \"\").toUpperCase();\n}\n\nexport function toColorInput(color: string | undefined) {\n const hex = cleanHex(color);\n return hex ? { kind: \"srgb\" as const, hex } : undefined;\n}\n\nfunction toUnderlineInput(underline: Underline | undefined) {\n if (underline === undefined || underline === false) return undefined;\n if (underline === true) return true;\n return {\n style: underline.style,\n color: toColorInput(underline.color),\n };\n}\n\nfunction toBaselineInput(\n subscript: boolean | undefined,\n superscript: boolean | undefined,\n) {\n if (subscript) return \"subscript\" as const;\n if (superscript) return \"superscript\" as const;\n return undefined;\n}\n\nfunction toGlowInput(glow: TextGlow | undefined) {\n if (!glow) return undefined;\n return {\n radius: asEmu(Math.round(pxToEmu(glow.size ?? 8))),\n color: toColorInput(glow.color ?? \"FFFFFF\")!,\n };\n}\n\nfunction toOutlineInput(outline: TextOutline | undefined) {\n if (!outline) return undefined;\n return {\n width: asEmu(Math.round(pxToEmu(outline.size ?? 1))),\n color: toColorInput(outline.color ?? \"FFFFFF\"),\n };\n}\n\nfunction toCharSpacing(letterSpacingPx: number | undefined) {\n if (letterSpacingPx === undefined) return undefined;\n return Math.round(pxToPt(letterSpacingPx) * 100);\n}\n\nfunction toTextGradientInput(\n value: string | undefined,\n): AddTextBoxGradientFillInput | undefined {\n if (!value) return undefined;\n const linear = parseLinearGradient(value);\n if (!linear) return undefined;\n const dmlAngle = (((linear.angle - 90) % 360) + 360) % 360;\n return {\n angle: asOoxmlAngle(Math.round(dmlAngle * 60000)),\n stops: linear.stops.map((stop) => ({\n position: asOoxmlPercent(Math.round(stop.position * 1000)),\n color: toColorInput(stop.color)!,\n })),\n };\n}\n\nfunction stripUndefined<T extends Record<string, unknown>>(value: T): T {\n return Object.fromEntries(\n Object.entries(value).filter(([, entry]) => entry !== undefined),\n ) as T;\n}\n\nfunction buildRunProperties(\n node: TextPositionedNode,\n run: NonNullable<TextPositionedNode[\"runs\"]>[number] | undefined,\n gradientFill: AddTextBoxGradientFillInput | undefined,\n): AddTextBoxRunPropertiesInput {\n const fontSizePx = run?.fontSize ?? node.fontSize ?? 24;\n const letterSpacingPx = run?.letterSpacing ?? node.letterSpacing;\n const subSup = run ? resolveSubSup(run, node) : node;\n const color = gradientFill\n ? undefined\n : toColorInput(run?.color ?? node.color);\n\n return stripUndefined({\n fontFace: run?.fontFamily ?? node.fontFamily ?? \"Noto Sans JP\",\n fontSize: asPt(pxToPt(fontSizePx)),\n color,\n gradientFill,\n bold: run?.bold ?? node.bold,\n italic: run?.italic ?? node.italic,\n underline: toUnderlineInput(resolveUnderline(node, run)),\n strike: run?.strike ?? node.strike,\n baseline: toBaselineInput(subSup.subscript, subSup.superscript),\n highlight: toColorInput(run?.highlight ?? node.highlight),\n glow: toGlowInput(node.glow),\n outline: toOutlineInput(node.outline),\n charSpacing: toCharSpacing(letterSpacingPx),\n });\n}\n\nfunction resolveUnderline(\n node: TextPositionedNode,\n run: NonNullable<TextPositionedNode[\"runs\"]>[number] | undefined,\n): Underline | undefined {\n if (run?.underline !== undefined) return run.underline;\n if (node.underline !== undefined) return node.underline;\n return run?.href ? true : undefined;\n}\n\nfunction createParagraphProperties(\n node: TextPositionedNode,\n): AddTextBoxParagraphInput[\"properties\"] {\n const lineHeight = node.lineHeight ?? 1.3;\n const fontSizePx = node.fontSize ?? 24;\n return stripUndefined({\n align: node.textAlign,\n lineSpacing: asHundredthPt(\n Math.round(pxToPt(fontSizePx * lineHeight) * 100),\n ),\n });\n}\n\nfunction buildParagraphs(node: TextPositionedNode): {\n paragraphs: readonly AddTextBoxParagraphInput[];\n hyperlinks: readonly (string | undefined)[];\n} {\n const gradientFill = toTextGradientInput(node.textGradient);\n const sourceRuns: GlimpseTextRun[] =\n node.runs && node.runs.length > 0\n ? node.runs.map((run) => ({\n text: run.text,\n properties: buildRunProperties(node, run, gradientFill),\n href: run.href,\n }))\n : [\n {\n text: node.text ?? \"\",\n properties: buildRunProperties(node, undefined, gradientFill),\n },\n ];\n const paragraphRuns: GlimpseTextRun[][] = [[]];\n for (const run of sourceRuns) {\n const lines = run.text.replace(/\\r*\\n/g, \"\\n\").split(\"\\n\");\n lines.forEach((line, index) => {\n if (index > 0) {\n paragraphRuns.push([]);\n }\n paragraphRuns[paragraphRuns.length - 1]?.push({\n ...run,\n text: line,\n });\n });\n }\n\n return {\n paragraphs: paragraphRuns.map((runs) => ({\n properties: createParagraphProperties(node),\n runs,\n })),\n hyperlinks: paragraphRuns.flatMap((runs) =>\n runs.map((run) => (run.text ? run.href : undefined)),\n ),\n };\n}\n\nfunction withGlowAlpha(xml: string, node: TextPositionedNode): string {\n const glow = node.glow;\n if (!glow) return xml;\n const alpha = Math.round((glow.opacity ?? 0.75) * 100000);\n const color = cleanHex(glow.color ?? \"FFFFFF\");\n const target = `<a:glow rad=\"${Math.round(pxToEmu(glow.size ?? 8))}\"><a:srgbClr val=\"${color}\"/></a:glow>`;\n const replacement = `<a:glow rad=\"${Math.round(pxToEmu(glow.size ?? 8))}\"><a:srgbClr val=\"${color}\"><a:alpha val=\"${alpha}\"/></a:srgbClr></a:glow>`;\n return xml.replaceAll(target, replacement);\n}\n\nfunction withShapeGlowAlpha(xml: string, glow: TextGlow | undefined): string {\n if (!glow) return xml;\n const alpha = Math.round((glow.opacity ?? 0.75) * 100000);\n const color = cleanHex(glow.color ?? \"FFFFFF\");\n const target = `<a:glow rad=\"${Math.round(pxToEmu(glow.size ?? 8))}\"><a:srgbClr val=\"${color}\"/></a:glow>`;\n const replacement = `<a:glow rad=\"${Math.round(pxToEmu(glow.size ?? 8))}\"><a:srgbClr val=\"${color}\"><a:alpha val=\"${alpha}\"/></a:srgbClr></a:glow>`;\n return xml.replaceAll(target, replacement);\n}\n\nfunction colorWithOptionalAlphaXml(\n color: string,\n opacity: number | undefined,\n): string {\n const clean = cleanHex(color) ?? color;\n if (opacity === undefined) return `<a:srgbClr val=\"${clean}\"/>`;\n return `<a:srgbClr val=\"${clean}\"><a:alpha val=\"${Math.round(opacity * 100000)}\"/></a:srgbClr>`;\n}\n\nfunction buildGradFillXml(value: string, opacity?: number): string | undefined {\n const gradient = parseGradient(value);\n if (!gradient) return undefined;\n const gsXml = gradient.value.stops\n .map(\n (stop) =>\n `<a:gs pos=\"${Math.round(stop.position * 1000)}\">${colorWithOptionalAlphaXml(\n stop.color,\n opacity,\n )}</a:gs>`,\n )\n .join(\"\");\n\n if (gradient.kind === \"linear\") {\n const dmlAngle = (((gradient.value.angle - 90) % 360) + 360) % 360;\n const ang = Math.round(dmlAngle * 60000);\n return `<a:gradFill flip=\"none\" rotWithShape=\"1\"><a:gsLst>${gsXml}</a:gsLst><a:lin ang=\"${ang}\" scaled=\"0\"/></a:gradFill>`;\n }\n\n const { centerX, centerY } = gradient.value;\n const l = Math.round(centerX * 1000);\n const t = Math.round(centerY * 1000);\n const r = Math.round((100 - centerX) * 1000);\n const b = Math.round((100 - centerY) * 1000);\n return `<a:gradFill flip=\"none\" rotWithShape=\"1\"><a:gsLst>${gsXml}</a:gsLst><a:path path=\"circle\"><a:fillToRect l=\"${l}\" t=\"${t}\" r=\"${r}\" b=\"${b}\"/></a:path></a:gradFill>`;\n}\n\nfunction withSolidFillAlpha(\n xml: string,\n color: string | undefined,\n opacity: number | undefined,\n): string {\n if (color === undefined || opacity === undefined) return xml;\n const clean = cleanHex(color);\n return xml.replaceAll(\n `<a:solidFill><a:srgbClr val=\"${clean}\"/></a:solidFill>`,\n `<a:solidFill>${colorWithOptionalAlphaXml(clean ?? color, opacity)}</a:solidFill>`,\n );\n}\n\nfunction withGradientFill(\n xml: string,\n backgroundGradient: string | undefined,\n opacity: number | undefined,\n preset: string,\n): string {\n if (!backgroundGradient) return xml;\n const gradFill = buildGradFillXml(backgroundGradient, opacity);\n if (!gradFill) return xml;\n if (preset === \"line\") {\n return xml.replace(\n /<a:ln\\b([^>]*)>([\\s\\S]*?)<\\/a:ln>/,\n (match, attrs, body) => {\n const nextBody = (body as string).replace(\n /<a:(?:solidFill|gradFill)\\b[\\s\\S]*?<\\/a:(?:solidFill|gradFill)>|<a:noFill\\/>/,\n gradFill,\n );\n return nextBody === body\n ? match\n : `<a:ln${attrs as string}>${nextBody}</a:ln>`;\n },\n );\n }\n return xml.replace(\n /<a:(?:solidFill|gradFill)\\b[\\s\\S]*?<\\/a:(?:solidFill|gradFill)>|<a:noFill\\/>/,\n gradFill,\n );\n}\n\nfunction withRoundRectAdjust(\n xml: string,\n input: AddShapeInput,\n rectRadius: number | undefined,\n): string {\n if (input.preset !== \"roundRect\" || rectRadius === undefined) return xml;\n // `rectRadius` is the pptxgenjs-compatible option value already resolved by\n // visualStyle.resolveRectRadius. Keep the same formula pptxgenjs uses.\n const adj = Math.round(\n (rectRadius * EMU_PER_IN * 100000) / Math.min(input.width, input.height),\n );\n return xml.replace(\n /<a:prstGeom prst=\"roundRect\"><a:avLst\\/><\\/a:prstGeom>/,\n `<a:prstGeom prst=\"roundRect\"><a:avLst><a:gd name=\"adj\" fmla=\"val ${adj}\"/></a:avLst></a:prstGeom>`,\n );\n}\n\nfunction shadowXml(shadow: ShadowStyle | undefined): string | undefined {\n if (!shadow) return undefined;\n const blur = Math.round((shadow.blur ?? 3) * 12700);\n const dist = Math.round((shadow.offset ?? 23000 / 12700) * 12700);\n const dir = Math.round((shadow.angle ?? 90) * 60000);\n const color = cleanHex(shadow.color ?? \"000000\") ?? \"000000\";\n const alpha = Math.round((shadow.opacity ?? 0.35) * 100000);\n const type = shadow.type ?? \"outer\";\n return `<a:${type}Shdw sx=\"100000\" sy=\"100000\" kx=\"0\" ky=\"0\" algn=\"bl\" blurRad=\"${blur}\" rotWithShape=\"1\" dist=\"${dist}\" dir=\"${dir}\"><a:srgbClr val=\"${color}\"><a:alpha val=\"${alpha}\"/></a:srgbClr></a:${type}Shdw>`;\n}\n\nfunction withShadow(xml: string, shadow: ShadowStyle | undefined): string {\n const effect = shadowXml(shadow);\n if (!effect) return xml;\n if (xml.includes(\"<a:effectLst>\")) {\n return xml.replace(\"</a:effectLst>\", `${effect}</a:effectLst>`);\n }\n return xml.replace(\n \"</p:spPr>\",\n `<a:effectLst>${effect}</a:effectLst></p:spPr>`,\n );\n}\n\nfunction withLineFlip(\n xml: string,\n flipH: boolean | undefined,\n flipV: boolean | undefined,\n): string {\n if (!flipH && !flipV) return xml;\n return xml.replace(\n \"<a:xfrm\",\n `<a:xfrm${flipH ? ' flipH=\"1\"' : \"\"}${flipV ? ' flipV=\"1\"' : \"\"}`,\n );\n}\n\nfunction withLineZeroExtent(\n xml: string,\n preset: string,\n zeroWidth: boolean | undefined,\n zeroHeight: boolean | undefined,\n): string {\n if (preset !== \"line\" || (!zeroWidth && !zeroHeight)) return xml;\n return xml.replace(\n /<a:ext cx=\"(\\d+)\" cy=\"(\\d+)\"\\/>/,\n (_match, cx: string, cy: string) =>\n `<a:ext cx=\"${zeroWidth ? \"0\" : cx}\" cy=\"${zeroHeight ? \"0\" : cy}\"/>`,\n );\n}\n\nfunction withPrstDash(xml: string, dashType: string): string {\n return xml.replace(\n /<a:ln\\b([^>]*)>([\\s\\S]*?)<\\/a:ln>/g,\n (match, attrs, body) => {\n const bodyText = body as string;\n if (bodyText.includes(\"<a:prstDash\")) return match;\n return `<a:ln${attrs as string}>${bodyText.replace(\n /(<a:(?:solidFill|noFill\\/)>[\\s\\S]*?<\\/a:solidFill>|<a:noFill\\/>)/,\n `$1<a:prstDash val=\"${dashType}\"/>`,\n )}</a:ln>`;\n },\n );\n}\n\nfunction withUnsupportedDashStyle(\n xml: string,\n dashType: BorderStyle[\"dashType\"] | undefined,\n): string {\n if (dashType !== \"lgDashDotDot\") return xml;\n return withPrstDash(xml, dashType);\n}\n\nfunction withPptxGenLineArrowDefaults(xml: string, preset: string): string {\n if (preset !== \"line\") return xml;\n const withoutDefaultSizes = xml.replace(\n /<a:(headEnd|tailEnd) type=\"([^\"]+)\" w=\"med\" len=\"med\"\\/>/g,\n '<a:$1 type=\"$2\"/>',\n );\n return withPrstDash(withoutDefaultSizes, \"solid\");\n}\n\nfunction withPptxGenParagraphDefaults(xml: string): string {\n let result = xml.replaceAll('baseline=\"-25000\"', 'baseline=\"-40000\"');\n result = result.replace(/<a:bodyPr\\b([^>]*)\\/>/g, (_match, attrs) => {\n const attrText = attrs as string;\n const withRtl = /(?:^|\\s)rtlCol=/.test(attrText)\n ? attrText\n : `${attrText} rtlCol=\"0\"`;\n const withAnchor = /(?:^|\\s)anchor=/.test(withRtl)\n ? withRtl\n : `${withRtl} anchor=\"t\"`;\n return `<a:bodyPr${withAnchor}/>`;\n });\n result = result.replace(\n /<a:pPr([^>]*)>([\\s\\S]*?)<\\/a:pPr>/g,\n (match, attrs, body) => {\n const attrText = attrs as string;\n const nextAttrs = /(?:^|\\s)indent=/.test(attrText)\n ? attrText\n : `${attrText} indent=\"0\" marL=\"0\"`;\n const bodyText = body as string;\n const nextBody = bodyText.includes(\"<a:buNone/>\")\n ? bodyText\n : `${bodyText}<a:buNone/>`;\n return `<a:pPr${nextAttrs}>${nextBody}</a:pPr>`;\n },\n );\n result = result.replace(\n /<a:p>(?!<a:pPr)/g,\n '<a:p><a:pPr indent=\"0\" marL=\"0\"><a:buNone/></a:pPr>',\n );\n return result;\n}\n\nfunction createTextBoxXml(\n node: TextPositionedNode,\n name: string,\n): { xml: string; hyperlinks: readonly (string | undefined)[] } {\n const textOptions = createTextOptions(node);\n const { paragraphs, hyperlinks } = buildParagraphs(node);\n const input: AddTextBoxInput = {\n offsetX: asEmu(Math.round(textOptions.x * EMU_PER_IN)),\n offsetY: asEmu(Math.round(textOptions.y * EMU_PER_IN)),\n width: asEmu(Math.round(textOptions.w * EMU_PER_IN)),\n height: asEmu(Math.round(textOptions.h * EMU_PER_IN)),\n rotation:\n node.rotate !== undefined\n ? asOoxmlAngle(Math.round(node.rotate * 60000))\n : undefined,\n name,\n body: {\n marginLeft: asEmu(0),\n marginRight: asEmu(0),\n marginTop: asEmu(0),\n marginBottom: asEmu(0),\n },\n paragraphs,\n };\n return {\n xml: createTextBoxXmlFromInput(input, {\n xmlTransform: (xml) => withGlowAlpha(xml, node),\n }),\n hyperlinks,\n };\n}\n\nfunction createTextBoxXmlFromInput(\n input: AddTextBoxInput,\n options?: { xmlTransform?: XmlTransform },\n): string {\n const source = createPptx();\n const slideHandle = source.slides[0]?.handle;\n if (!slideHandle) {\n throw new Error(\"createPptx did not create an editable slide\");\n }\n\n const edited = addTextBox(source, slideHandle, input);\n const edit = edited.edits?.at(-1) as\n PptxSourceModelAddTextBoxEdit | undefined;\n if (edit?.kind !== \"addTextBox\") {\n throw new Error(\"addTextBox did not produce an addTextBox edit\");\n }\n const xml = withPptxGenParagraphDefaults(edit.xml);\n return options?.xmlTransform ? options.xmlTransform(xml) : xml;\n}\n\nexport type GlimpseShapeXmlOptions = {\n fillColor?: string;\n fillOpacity?: number;\n backgroundGradient?: string;\n outlineGradient?: string;\n outlineOpacity?: number;\n glow?: TextGlow;\n shadow?: ShadowStyle;\n rectRadius?: number;\n dashType?: BorderStyle[\"dashType\"];\n flipH?: boolean;\n flipV?: boolean;\n zeroWidth?: boolean;\n zeroHeight?: boolean;\n customGeometry?: CustomGeometryXmlInput;\n};\n\ntype CustomGeometryPointInput = { x: number; y: number } | { close: true };\n\nexport type CustomGeometryXmlInput = {\n width: number;\n height: number;\n points: readonly CustomGeometryPointInput[];\n};\n\nfunction geometryPointXml(point: { x: number; y: number }): string {\n return `<a:pt x=\"${Math.round(point.x * EMU_PER_IN)}\" y=\"${Math.round(\n point.y * EMU_PER_IN,\n )}\"/>`;\n}\n\nfunction buildCustomGeometryXml(\n geometry: CustomGeometryXmlInput,\n): string | undefined {\n const first = geometry.points.find(\n (point): point is { x: number; y: number } => \"x\" in point,\n );\n if (!first) return undefined;\n\n let hasMoveTo = false;\n const commands = geometry.points\n .map((point) => {\n if (\"close\" in point) return hasMoveTo ? \"<a:close/>\" : \"\";\n if (!hasMoveTo) {\n hasMoveTo = true;\n return `<a:moveTo>${geometryPointXml(point)}</a:moveTo>`;\n }\n return `<a:lnTo>${geometryPointXml(point)}</a:lnTo>`;\n })\n .join(\"\");\n\n return (\n \"<a:custGeom><a:avLst/><a:gdLst/><a:ahLst/><a:cxnLst/>\" +\n '<a:rect l=\"l\" t=\"t\" r=\"r\" b=\"b\"/>' +\n `<a:pathLst><a:path w=\"${Math.round(\n geometry.width * EMU_PER_IN,\n )}\" h=\"${Math.round(geometry.height * EMU_PER_IN)}\">${commands}</a:path></a:pathLst>` +\n \"</a:custGeom>\"\n );\n}\n\nfunction withCustomGeometry(\n xml: string,\n geometry: CustomGeometryXmlInput | undefined,\n): string {\n if (!geometry) return xml;\n const customGeometry = buildCustomGeometryXml(geometry);\n if (!customGeometry) return xml;\n return xml.replace(/<a:prstGeom\\b[\\s\\S]*?<\\/a:prstGeom>/, customGeometry);\n}\n\nfunction withOutlineGradientFill(\n xml: string,\n outlineGradient: string | undefined,\n opacity: number | undefined,\n): string {\n if (!outlineGradient) return xml;\n const gradFill = buildGradFillXml(outlineGradient, opacity);\n if (!gradFill) return xml;\n const lineFillPattern =\n /<a:(?:solidFill|gradFill)\\b[\\s\\S]*?<\\/a:(?:solidFill|gradFill)>|<a:noFill\\/>/;\n if (/<a:ln\\b[^>]*\\/>/.test(xml)) {\n return xml.replace(\n /<a:ln\\b([^>]*)\\/>/,\n (_match, attrs: string) => `<a:ln${attrs}>${gradFill}</a:ln>`,\n );\n }\n return xml.replace(\n /(<a:ln\\b[^>]*>)([\\s\\S]*?)(<\\/a:ln>)/,\n (_match, open: string, body: string, close: string) => {\n const nextBody = lineFillPattern.test(body)\n ? body.replace(lineFillPattern, gradFill)\n : `${gradFill}${body}`;\n return `${open}${nextBody}${close}`;\n },\n );\n}\n\nfunction createShapeXml(\n input: AddShapeInput,\n options: GlimpseShapeXmlOptions | undefined,\n): string {\n const source = createPptx();\n const slideHandle = source.slides[0]?.handle;\n if (!slideHandle) {\n throw new Error(\"createPptx did not create an editable slide\");\n }\n\n const edited = addShape(source, slideHandle, input);\n const edit = edited.edits?.at(-1) as PptxSourceModelAddShapeEdit | undefined;\n if (edit?.kind !== \"addShape\") {\n throw new Error(\"addShape did not produce an addShape edit\");\n }\n\n let xml = edit.xml;\n xml = withShapeGlowAlpha(xml, options?.glow);\n xml = withSolidFillAlpha(xml, options?.fillColor, options?.fillOpacity);\n xml = withGradientFill(\n xml,\n options?.backgroundGradient,\n options?.fillOpacity,\n input.preset,\n );\n xml = withOutlineGradientFill(\n xml,\n options?.outlineGradient,\n options?.outlineOpacity ?? options?.fillOpacity,\n );\n xml = withRoundRectAdjust(xml, input, options?.rectRadius);\n xml = withShadow(xml, options?.shadow);\n xml = withUnsupportedDashStyle(xml, options?.dashType);\n xml = withLineFlip(xml, options?.flipH, options?.flipV);\n xml = withLineZeroExtent(\n xml,\n input.preset,\n options?.zeroWidth,\n options?.zeroHeight,\n );\n xml = withPptxGenLineArrowDefaults(xml, input.preset);\n xml = withCustomGeometry(xml, options?.customGeometry);\n return xml;\n}\n\ninterface RegisteredTextBox {\n kind: \"shape\";\n marker: string;\n name: string;\n xml: string;\n hyperlinks: readonly (string | undefined)[];\n}\n\ninterface RegisteredPicture {\n kind: \"picture\";\n marker: string;\n name: string;\n input: AddPictureInput;\n shadow?: ShadowStyle;\n}\n\ninterface RegisteredSlideBackground {\n kind: \"slideBackground\";\n marker: string;\n slideNumber: number;\n xml: string;\n}\n\ntype RegisteredDrawing =\n RegisteredTextBox | RegisteredPicture | RegisteredSlideBackground;\n\nexport class GlimpseTextBoxRegistry {\n private readonly registered: RegisteredDrawing[] = [];\n private textCount = 0;\n private shapeCount = 0;\n private pictureCount = 0;\n private slideBackgroundCount = 0;\n\n register(node: TextPositionedNode): string {\n const index = this.textCount++;\n const marker = `${MARKER_PREFIX}${index}`;\n const name = `Text ${index + 1}`;\n const { xml, hyperlinks } = createTextBoxXml(node, name);\n this.registered.push({ kind: \"shape\", marker, name, xml, hyperlinks });\n return marker;\n }\n\n registerTextBox(\n input: AddTextBoxInput,\n options?: {\n name?: string;\n hyperlinks?: readonly (string | undefined)[];\n xmlTransform?: XmlTransform;\n },\n ): string {\n const index = this.textCount++;\n const marker = `${MARKER_PREFIX}${index}`;\n const name = options?.name ?? `Text ${index + 1}`;\n const xml = createTextBoxXmlFromInput({ ...input, name }, options);\n this.registered.push({\n kind: \"shape\",\n marker,\n name,\n xml,\n hyperlinks: options?.hyperlinks ?? [],\n });\n return marker;\n }\n\n registerShape(\n input: AddShapeInput,\n options?: GlimpseShapeXmlOptions & { name?: string },\n ): string {\n const index = this.shapeCount++;\n const marker = `${SHAPE_MARKER_PREFIX}${index}`;\n const name = options?.name ?? `Shape ${index + 1}`;\n const xml = createShapeXml({ ...input, name }, options);\n this.registered.push({ kind: \"shape\", marker, name, xml, hyperlinks: [] });\n return marker;\n }\n\n registerPicture(\n input: AddPictureInput,\n options?: { name?: string; shadow?: ShadowStyle },\n ): string {\n const index = this.pictureCount++;\n const marker = `${PICTURE_MARKER_PREFIX}${index}`;\n const name = options?.name ?? `Picture ${index + 1}`;\n this.registered.push({\n kind: \"picture\",\n marker,\n name,\n input: { ...input, name },\n shadow: options?.shadow,\n });\n return marker;\n }\n\n registerSlideBackgroundGradient(\n backgroundGradient: string,\n slideNumber: number,\n opacity?: number,\n ): string | undefined {\n const xml = buildGradFillXml(backgroundGradient, opacity);\n if (!xml) return undefined;\n const marker = (SLIDE_BACKGROUND_MARKER_BASE + this.slideBackgroundCount++)\n .toString(16)\n .toUpperCase()\n .padStart(6, \"0\");\n this.registered.push({ kind: \"slideBackground\", marker, slideNumber, xml });\n return marker;\n }\n\n get isEmpty(): boolean {\n return this.registered.length === 0;\n }\n\n get entries(): readonly RegisteredDrawing[] {\n return this.registered;\n }\n}\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nfunction replaceShapeId(xml: string, id: string, name: string): string {\n return xml.replace(\n /<p:cNvPr id=\"[^\"]+\" name=\"[^\"]*\"/,\n `<p:cNvPr id=\"${xmlAttr(id)}\" name=\"${xmlAttr(name)}\"`,\n );\n}\n\nfunction xmlAttr(value: string): string {\n return value\n .replaceAll(\"&\", \"&\")\n .replaceAll('\"', \""\")\n .replaceAll(\"<\", \"<\")\n .replaceAll(\">\", \">\");\n}\n\nfunction slideRelsPath(slidePath: string): string {\n const fileName = slidePath.split(\"/\").at(-1);\n return `ppt/slides/_rels/${fileName}.rels`;\n}\n\nclass SlideRelationshipEditor {\n private nextId: number;\n\n private changed = false;\n\n constructor(private xml: string) {\n const ids = Array.from(xml.matchAll(/\\bId=\"rId(\\d+)\"/g), (match) =>\n Number(match[1]),\n );\n this.nextId = Math.max(0, ...ids) + 1;\n }\n\n addHyperlink(href: string): string {\n const id = `rId${this.nextId++}`;\n const rel =\n `<Relationship Id=\"${id}\" Type=\"${HYPERLINK_REL_TYPE}\" ` +\n `Target=\"${xmlAttr(href)}\" TargetMode=\"External\"/>`;\n this.xml = this.xml.replace(\"</Relationships>\", `${rel}</Relationships>`);\n this.changed = true;\n return id;\n }\n\n addImageRelationship(id: string, target: string): void {\n const idPattern = new RegExp(`\\\\bId=\"${escapeRegExp(id)}\"`);\n if (idPattern.test(this.xml)) return;\n const rel =\n `<Relationship Id=\"${xmlAttr(id)}\" Type=\"${IMAGE_REL_TYPE}\" ` +\n `Target=\"${xmlAttr(target)}\"/>`;\n this.xml = this.xml.replace(\"</Relationships>\", `${rel}</Relationships>`);\n const numeric = id.match(/^rId(\\d+)$/)?.[1];\n if (numeric) {\n this.nextId = Math.max(this.nextId, Number(numeric) + 1);\n }\n this.changed = true;\n }\n\n get result(): { xml: string; changed: boolean } {\n return { xml: this.xml, changed: this.changed };\n }\n}\n\nfunction createRelationshipEditor(xml: string | undefined) {\n return new SlideRelationshipEditor(\n xml ??\n '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>' +\n '<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"></Relationships>',\n );\n}\n\nfunction withHyperlinkRelationships(\n xml: string,\n hyperlinks: readonly (string | undefined)[],\n addRelationship: (href: string) => string,\n): string {\n if (!hyperlinks.some(Boolean)) return xml;\n let index = 0;\n return xml.replace(\n /<a:rPr\\b([^>]*)>([\\s\\S]*?)<\\/a:rPr>/g,\n (match, attrs, body) => {\n const href = hyperlinks[index++];\n if (!href) return match;\n const id = addRelationship(href);\n return `<a:rPr${attrs as string}>${body as string}<a:hlinkClick r:id=\"${id}\"/></a:rPr>`;\n },\n );\n}\n\nfunction findSlideHandle(source: PptxSourceModel, slidePath: string) {\n return source.slides.find((slide) => slide.partPath === slidePath)?.handle;\n}\n\nfunction findMediaPart(source: PptxSourceModel, partPath: PartPath): MediaPart {\n const media = source.packageGraph.media.find(\n (part) => part.partPath === partPath,\n );\n if (!media) {\n throw new Error(`addPicture media part was not found: ${partPath}`);\n }\n return media;\n}\n\nfunction findSlideImageTarget(\n source: PptxSourceModel,\n slidePath: string,\n relationshipId: string,\n): string {\n const relationships = source.packageGraph.relationships.find(\n (group) => group.sourcePartPath === slidePath,\n );\n const relationship = relationships?.relationships.find(\n (candidate) => candidate.id === relationshipId,\n );\n if (!relationship) {\n throw new Error(`addPicture relationship was not found: ${relationshipId}`);\n }\n return relationship.target;\n}\n\nfunction applyGlimpseTextBoxesToXml(\n xml: string,\n registry: GlimpseTextBoxRegistry,\n addRelationship: (href: string) => string,\n): string {\n let result = xml;\n for (const entry of registry.entries) {\n if (entry.kind !== \"shape\") continue;\n const re = new RegExp(\n `<p:sp><p:nvSpPr><p:cNvPr id=\"([^\"]+)\" name=\"${escapeRegExp(\n entry.marker,\n )}\"[\\\\s\\\\S]*?</p:sp>`,\n \"g\",\n );\n result = result.replace(re, (_match, id: string) => {\n const xmlWithIds = replaceShapeId(entry.xml, id, entry.name);\n return withHyperlinkRelationships(\n xmlWithIds,\n entry.hyperlinks,\n addRelationship,\n );\n });\n }\n return result;\n}\n\nfunction applySlideBackgroundGradientsToXml(\n xml: string,\n registry: GlimpseTextBoxRegistry,\n slidePath: string,\n): string {\n let result = xml;\n const slideNumber = Number(slidePath.match(/slide(\\d+)\\.xml$/)?.[1]);\n for (const entry of registry.entries) {\n if (entry.kind !== \"slideBackground\") continue;\n if (entry.slideNumber !== slideNumber) continue;\n const target = `<p:bgPr><a:solidFill><a:srgbClr val=\"${entry.marker}\"/></a:solidFill></p:bgPr>`;\n result = result.replace(target, `<p:bgPr>${entry.xml}</p:bgPr>`);\n }\n return result;\n}\n\nfunction withPptxGenPictureSizingXml(xml: string, hasSizing: boolean): string {\n if (!hasSizing) return xml;\n return xml.replace(\"<a:stretch><a:fillRect/></a:stretch>\", \"<a:stretch/>\");\n}\n\nfunction applyGlimpsePicturesToXml(\n xml: string,\n registry: GlimpseTextBoxRegistry,\n source: PptxSourceModel,\n slidePath: string,\n relationshipEditor: SlideRelationshipEditor,\n addMedia: (media: MediaPart) => void,\n): { xml: string; source: PptxSourceModel } {\n let result = xml;\n let editedSource = source;\n for (const entry of registry.entries) {\n if (entry.kind !== \"picture\") continue;\n const re = new RegExp(\n `<p:sp><p:nvSpPr><p:cNvPr id=\"([^\"]+)\" name=\"${escapeRegExp(\n entry.marker,\n )}\"[\\\\s\\\\S]*?</p:sp>`,\n \"g\",\n );\n result = result.replace(re, (_match, id: string) => {\n const slideHandle = findSlideHandle(editedSource, slidePath);\n if (!slideHandle) {\n throw new Error(`slide handle was not found: ${slidePath}`);\n }\n editedSource = addPicture(editedSource, slideHandle, entry.input);\n const edit = editedSource.edits?.at(-1) as\n PptxSourceModelAddPictureEdit | undefined;\n if (edit?.kind !== \"addPicture\") {\n throw new Error(\"addPicture did not produce an addPicture edit\");\n }\n const media = findMediaPart(editedSource, edit.mediaPartPath);\n addMedia(media);\n relationshipEditor.addImageRelationship(\n edit.relationshipId,\n findSlideImageTarget(editedSource, slidePath, edit.relationshipId),\n );\n const xml = withPptxGenPictureSizingXml(\n replaceShapeId(edit.xml, id, entry.name),\n entry.input.crop !== undefined,\n );\n return withShadow(xml, entry.shadow);\n });\n }\n return { xml: result, source: editedSource };\n}\n\nfunction ensureContentTypeDefault(\n xml: string,\n extension: string,\n contentType: string,\n): string {\n const existing = new RegExp(\n `<Default\\\\s+[^>]*Extension=\"${escapeRegExp(extension)}\"[^>]*/>`,\n );\n if (existing.test(xml)) return xml;\n const entry = `<Default Extension=\"${xmlAttr(extension)}\" ContentType=\"${xmlAttr(\n contentType,\n )}\"/>`;\n return xml.replace(\"</Types>\", `${entry}</Types>`);\n}\n\nasync function applyGlimpseMediaParts(\n zip: import(\"jszip\"),\n mediaParts: Iterable<MediaPart>,\n): Promise<void> {\n const mediaList = Array.from(mediaParts);\n if (mediaList.length === 0) return;\n const contentTypesFile = zip.file(\"[Content_Types].xml\");\n if (!contentTypesFile) {\n throw new Error(\"[Content_Types].xml was not found in pptx output\");\n }\n let contentTypesXml = await contentTypesFile.async(\"text\");\n for (const media of mediaList) {\n zip.file(media.partPath, media.bytes);\n const extension = media.partPath.split(\".\").at(-1);\n if (!extension) continue;\n contentTypesXml = ensureContentTypeDefault(\n contentTypesXml,\n extension,\n media.contentType,\n );\n }\n zip.file(\"[Content_Types].xml\", contentTypesXml);\n}\n\nasync function applyGlimpseTextBoxes(\n data: Uint8Array | ArrayBuffer,\n registry: GlimpseTextBoxRegistry,\n): Promise<import(\"jszip\")> {\n const JSZip = await loadJSZip();\n const zip = await JSZip.loadAsync(data);\n const hasPictures = registry.entries.some(\n (entry) => entry.kind === \"picture\",\n );\n let source = hasPictures\n ? readPptx(data instanceof Uint8Array ? data : new Uint8Array(data))\n : undefined;\n const addedMedia = new Map<string, MediaPart>();\n\n const slidePaths = Object.keys(zip.files).filter((path) =>\n /^ppt\\/slides\\/slide\\d+\\.xml$/.test(path),\n );\n for (const path of slidePaths) {\n const file = zip.file(path);\n if (!file) continue;\n const original = await file.async(\"text\");\n const relsPath = slideRelsPath(path);\n const relsFile = zip.file(relsPath);\n const relationshipEditor = createRelationshipEditor(\n relsFile ? await relsFile.async(\"text\") : undefined,\n );\n const withSlideBackground = applySlideBackgroundGradientsToXml(\n original,\n registry,\n path,\n );\n const pictureResult = source\n ? applyGlimpsePicturesToXml(\n withSlideBackground,\n registry,\n source,\n path,\n relationshipEditor,\n (media) => {\n addedMedia.set(media.partPath, media);\n },\n )\n : { xml: withSlideBackground, source };\n source = pictureResult.source;\n const replaced = applyGlimpseTextBoxesToXml(\n pictureResult.xml,\n registry,\n (href) => relationshipEditor.addHyperlink(href),\n );\n if (replaced !== original) {\n zip.file(path, replaced);\n }\n const relationships = relationshipEditor.result;\n if (relationships.changed) {\n zip.file(relsPath, relationships.xml);\n }\n }\n await applyGlimpseMediaParts(zip, addedMedia.values());\n return zip;\n}\n\nexport function patchPptxWriteForGlimpseTextBoxes(\n pptx: PptxGenJSInstance,\n registry: GlimpseTextBoxRegistry,\n): void {\n if (registry.isEmpty) return;\n\n const originalWrite = pptx.write.bind(pptx);\n\n const patchedWrite = async (rawProps?: WriteProps | string) => {\n const props: WriteProps | undefined =\n typeof rawProps === \"string\"\n ? ({ outputType: rawProps } as WriteProps)\n : rawProps;\n const data = (await originalWrite({\n outputType: \"uint8array\",\n })) as Uint8Array;\n const zip = await applyGlimpseTextBoxes(data, registry);\n\n const outputType = props?.outputType;\n if (outputType === \"STREAM\") {\n return zip.generateAsync({\n type: \"nodebuffer\",\n compression: props?.compression ? \"DEFLATE\" : \"STORE\",\n });\n }\n if (outputType) {\n return zip.generateAsync({\n type: outputType,\n compression: props?.compression ? \"DEFLATE\" : \"STORE\",\n });\n }\n return zip.generateAsync({\n type: \"blob\",\n compression: props?.compression ? \"DEFLATE\" : \"STORE\",\n });\n };\n pptx.write = patchedWrite;\n\n const patchedStream = async (props?: StreamProps) =>\n pptx.write({\n outputType: \"STREAM\",\n compression: props?.compression,\n });\n pptx.stream = patchedStream;\n\n const patchedWriteFile = async (rawProps?: WriteFileProps | string) => {\n const props: WriteFileProps | undefined =\n typeof rawProps === \"string\" ? { fileName: rawProps } : rawProps;\n const isNode =\n typeof process !== \"undefined\" && Boolean(process.versions?.node);\n if (!isNode) {\n const browserWriter = pptx as BrowserWritablePptx;\n if (typeof browserWriter.writeFileToBrowser !== \"function\") {\n throw new Error(\n \"pptx.writeFile browser download helper is unavailable; use pptx.write({ outputType: 'blob' }) instead\",\n );\n }\n const rawName = props?.fileName ?? \"Presentation.pptx\";\n const fileName = rawName.toLowerCase().endsWith(\".pptx\")\n ? rawName\n : `${rawName}.pptx`;\n const blob = (await patchedWrite({\n outputType: \"blob\",\n compression: props?.compression,\n })) as Blob;\n await browserWriter.writeFileToBrowser(fileName, blob);\n return fileName;\n }\n const rawName = props?.fileName ?? \"Presentation.pptx\";\n const fileName = rawName.toLowerCase().endsWith(\".pptx\")\n ? rawName\n : `${rawName}.pptx`;\n const buffer = (await patchedWrite({\n outputType: \"nodebuffer\",\n compression: props?.compression,\n })) as Buffer;\n const fs = await import(\"fs\");\n await fs.promises.writeFile(fileName, buffer);\n return fileName;\n };\n pptx.writeFile = patchedWriteFile;\n}\n"],"mapp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