@aixa-transformation/pptx-viewer 2.0.31 → 2.0.35

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.
@@ -8630,7 +8630,7 @@ var PptxPresentationSlidesReconciler = class {
8630
8630
  if (typeof relationshipId2 === "string" && relationshipId2.length > 0) {
8631
8631
  usedRIds.add(relationshipId2);
8632
8632
  }
8633
- if (relationshipType === input.slideRelationshipType && typeof relationshipId2 === "string" && typeof relationshipTarget2 === "string") {
8633
+ if (this.isSlideRelationshipType(relationshipType, input.slideRelationshipType) && typeof relationshipId2 === "string" && typeof relationshipTarget2 === "string") {
8634
8634
  slideTargetByRid.set(relationshipId2, relationshipTarget2);
8635
8635
  continue;
8636
8636
  }
@@ -8845,6 +8845,13 @@ var PptxPresentationSlidesReconciler = class {
8845
8845
  }
8846
8846
  return [value];
8847
8847
  }
8848
+ /** Match equivalent Strict and Transitional slide relationship URIs. */
8849
+ isSlideRelationshipType(value, expected) {
8850
+ if (typeof value !== "string") {
8851
+ return false;
8852
+ }
8853
+ return value === expected || value.endsWith("/relationships/slide");
8854
+ }
8848
8855
  };
8849
8856
  function isExternalTarget(target) {
8850
8857
  const normalized = target.trim();
@@ -16387,8 +16394,16 @@ var PptxDocumentPropertiesUpdater = class {
16387
16394
  const relationships = relsData["Relationships"];
16388
16395
  if (relationships) {
16389
16396
  const rels = Array.isArray(relationships["Relationship"]) ? relationships["Relationship"] : relationships["Relationship"] ? [relationships["Relationship"]] : [];
16390
- const hasCustomRel = rels.some((r) => String(r?.["@_Type"] || "") === customRelType);
16391
- if (!hasCustomRel) {
16397
+ const customRelationships = rels.filter(
16398
+ (relationship) => this.isCustomPropertiesRelationship(relationship)
16399
+ );
16400
+ if (customRelationships.length > 0) {
16401
+ const retained = customRelationships[0];
16402
+ relationships["Relationship"] = rels.filter(
16403
+ (relationship) => !this.isCustomPropertiesRelationship(relationship) || relationship === retained
16404
+ );
16405
+ this.context.zip.file("_rels/.rels", this.context.builder.build(relsData));
16406
+ } else {
16392
16407
  let maxId = 0;
16393
16408
  for (const rel of rels) {
16394
16409
  const id = String(rel?.["@_Id"] || "");
@@ -16417,7 +16432,6 @@ var PptxDocumentPropertiesUpdater = class {
16417
16432
  * orphan content-type entry referencing a deleted part.
16418
16433
  */
16419
16434
  async removeCustomPropertiesPackagingArtifacts() {
16420
- const customRelType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties";
16421
16435
  const ctFile = this.context.zip.file("[Content_Types].xml");
16422
16436
  if (ctFile) {
16423
16437
  try {
@@ -16445,7 +16459,9 @@ var PptxDocumentPropertiesUpdater = class {
16445
16459
  const relationships = relsData["Relationships"];
16446
16460
  if (relationships) {
16447
16461
  const rels = Array.isArray(relationships["Relationship"]) ? relationships["Relationship"] : relationships["Relationship"] ? [relationships["Relationship"]] : [];
16448
- const filtered = rels.filter((r) => String(r?.["@_Type"] || "") !== customRelType);
16462
+ const filtered = rels.filter(
16463
+ (relationship) => !this.isCustomPropertiesRelationship(relationship)
16464
+ );
16449
16465
  if (filtered.length !== rels.length) {
16450
16466
  relationships["Relationship"] = filtered;
16451
16467
  this.context.zip.file("_rels/.rels", this.context.builder.build(relsData));
@@ -16455,6 +16471,11 @@ var PptxDocumentPropertiesUpdater = class {
16455
16471
  }
16456
16472
  }
16457
16473
  }
16474
+ isCustomPropertiesRelationship(relationship) {
16475
+ const type = String(relationship?.["@_Type"] || "");
16476
+ const target = String(relationship?.["@_Target"] || "").replace(/\\/gu, "/").replace(/^\.\//u, "");
16477
+ return target === "docProps/custom.xml" || type.endsWith("/relationships/custom-properties") || type.endsWith("/relationships/customProperties");
16478
+ }
16458
16479
  normalizeCustomPropertyType(type) {
16459
16480
  const supportedTypes = /* @__PURE__ */ new Set([
16460
16481
  "lpwstr",
@@ -31686,6 +31707,31 @@ function readUtf16LE2(data, offset, byteLength) {
31686
31707
  }
31687
31708
  return chars.join("");
31688
31709
  }
31710
+ function readUint16BE(data, offset) {
31711
+ return (data[offset] ?? 0) << 8 | (data[offset + 1] ?? 0);
31712
+ }
31713
+ function readUint32BE(data, offset) {
31714
+ return ((data[offset] ?? 0) << 24 >>> 0 | (data[offset + 1] ?? 0) << 16 | (data[offset + 2] ?? 0) << 8 | (data[offset + 3] ?? 0)) >>> 0;
31715
+ }
31716
+ function findSfntTable(data, tag) {
31717
+ if (data.length < 12) return null;
31718
+ const numTables = readUint16BE(data, 4);
31719
+ for (let i = 0; i < numTables; i++) {
31720
+ const record = 12 + i * 16;
31721
+ if (record + 16 > data.length) break;
31722
+ const recordTag = String.fromCharCode(
31723
+ data[record],
31724
+ data[record + 1],
31725
+ data[record + 2],
31726
+ data[record + 3]
31727
+ );
31728
+ if (recordTag !== tag) continue;
31729
+ const offset = readUint32BE(data, record + 8);
31730
+ const length = readUint32BE(data, record + 12);
31731
+ return offset + length <= data.length ? { offset, length } : null;
31732
+ }
31733
+ return null;
31734
+ }
31689
31735
  function isEotFormat(data) {
31690
31736
  if (data.length < 36) {
31691
31737
  return false;
@@ -31693,6 +31739,70 @@ function isEotFormat(data) {
31693
31739
  const magic = readUint16LE(data, EOT_MAGIC_OFFSET);
31694
31740
  return magic === EOT_MAGIC;
31695
31741
  }
31742
+ function createEotFromSfnt(fontData, options) {
31743
+ const encodeName2 = (value) => {
31744
+ const bytes = new Uint8Array((value.length + 1) * 2);
31745
+ const view2 = new DataView(bytes.buffer);
31746
+ for (let i = 0; i < value.length; i++) {
31747
+ view2.setUint16(i * 2, value.charCodeAt(i), true);
31748
+ }
31749
+ return bytes;
31750
+ };
31751
+ const names = [
31752
+ encodeName2(options.familyName),
31753
+ encodeName2(options.styleName ?? ""),
31754
+ encodeName2(""),
31755
+ encodeName2(options.fullName ?? options.familyName)
31756
+ ];
31757
+ const headerSize = 82 + names.reduce((sum, name) => sum + 2 + name.length, 0) + 2;
31758
+ const result = new Uint8Array(headerSize + fontData.length);
31759
+ const view = new DataView(result.buffer);
31760
+ const os2 = findSfntTable(fontData, "OS/2");
31761
+ const head = findSfntTable(fontData, "head");
31762
+ view.setUint32(0, result.length, true);
31763
+ view.setUint32(4, fontData.length, true);
31764
+ view.setUint32(8, 131073, true);
31765
+ view.setUint32(12, 0, true);
31766
+ if (os2 && os2.length >= 42) {
31767
+ result.set(fontData.slice(os2.offset + 32, os2.offset + 42), 16);
31768
+ }
31769
+ result[26] = 1;
31770
+ result[27] = options.italic ? 1 : 0;
31771
+ view.setUint32(
31772
+ 28,
31773
+ options.weight ?? (os2 && os2.length >= 6 ? readUint16BE(fontData, os2.offset + 4) : 400),
31774
+ true
31775
+ );
31776
+ view.setUint16(
31777
+ 32,
31778
+ os2 && os2.length >= 10 ? readUint16BE(fontData, os2.offset + 8) : 0,
31779
+ true
31780
+ );
31781
+ view.setUint16(34, EOT_MAGIC, true);
31782
+ if (os2 && os2.length >= 58) {
31783
+ for (let i = 0; i < 4; i++) {
31784
+ view.setUint32(36 + i * 4, readUint32BE(fontData, os2.offset + 42 + i * 4), true);
31785
+ }
31786
+ }
31787
+ if (os2 && os2.length >= 86) {
31788
+ view.setUint32(52, readUint32BE(fontData, os2.offset + 78), true);
31789
+ view.setUint32(56, readUint32BE(fontData, os2.offset + 82), true);
31790
+ }
31791
+ if (head && head.length >= 12) {
31792
+ view.setUint32(60, readUint32BE(fontData, head.offset + 8), true);
31793
+ }
31794
+ let offset = 82;
31795
+ for (const name of names) {
31796
+ view.setUint16(offset, Math.max(0, name.length - 2), true);
31797
+ offset += 2;
31798
+ result.set(name, offset);
31799
+ offset += name.length;
31800
+ }
31801
+ view.setUint16(offset, 0, true);
31802
+ offset += 2;
31803
+ result.set(fontData, offset);
31804
+ return result;
31805
+ }
31696
31806
  function parseEotHeader(data) {
31697
31807
  if (!isEotFormat(data)) {
31698
31808
  return null;
@@ -31725,8 +31835,10 @@ function parseEotHeader(data) {
31725
31835
  const styleName = readNameString();
31726
31836
  const versionName = readNameString();
31727
31837
  const fullName = readNameString();
31728
- if (version >= 131074) {
31838
+ if (version >= 131073 && offset + 4 <= data.length && readUint16LE(data, offset) === 0 && readUint16LE(data, offset + 2) === 0) {
31729
31839
  readNameString();
31840
+ }
31841
+ if (version >= 131074) {
31730
31842
  offset += 8;
31731
31843
  if (offset + 4 <= data.length) {
31732
31844
  const signatureSize = readUint16LE(data, offset + 2);
@@ -31795,7 +31907,8 @@ function guidToKey(guid) {
31795
31907
  }
31796
31908
  const key = new Uint8Array(KEY_LENGTH);
31797
31909
  for (let i = 0; i < KEY_LENGTH; i++) {
31798
- key[i] = parseInt(stripped.substring(i * 2, i * 2 + 2), 16);
31910
+ const sourceIndex = KEY_LENGTH - i - 1;
31911
+ key[i] = parseInt(stripped.substring(sourceIndex * 2, sourceIndex * 2 + 2), 16);
31799
31912
  }
31800
31913
  return key;
31801
31914
  }
@@ -41647,9 +41760,13 @@ var NAMESPACE_PAIRS = [
41647
41760
  "http://schemas.openxmlformats.org/officeDocument/2006/bibliography"
41648
41761
  ],
41649
41762
  [
41650
- "http://purl.oclc.org/ooxml/officeDocument/custom-properties",
41763
+ "http://purl.oclc.org/ooxml/officeDocument/customProperties",
41651
41764
  "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
41652
41765
  ],
41766
+ [
41767
+ "http://purl.oclc.org/ooxml/officeDocument/relationships/customProperties",
41768
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties"
41769
+ ],
41653
41770
  [
41654
41771
  "http://purl.oclc.org/ooxml/officeDocument/extended-properties",
41655
41772
  "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
@@ -62255,8 +62372,14 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime7 extends PptxHandlerRuntime
62255
62372
  }
62256
62373
  return;
62257
62374
  }
62375
+ const newFontsWithData = fontsWithData.filter(
62376
+ (font) => !(font.originalRId && font.partPath)
62377
+ );
62378
+ if (newFontsWithData.length === 0) {
62379
+ return;
62380
+ }
62258
62381
  const fontsByName = /* @__PURE__ */ new Map();
62259
- for (const font of fontsWithData) {
62382
+ for (const font of newFontsWithData) {
62260
62383
  const existing = fontsByName.get(font.name) ?? [];
62261
62384
  existing.push(font);
62262
62385
  fontsByName.set(font.name, existing);
@@ -62291,6 +62414,13 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime7 extends PptxHandlerRuntime
62291
62414
  };
62292
62415
  for (const variant of variants) {
62293
62416
  const fontData = variant.rawFontData;
62417
+ const isWebFont = variant.format === "woff" || variant.format === "woff2";
62418
+ const hasSfntSignature = fontData.length >= 4 && (fontData[0] === 0 && fontData[1] === 1 && fontData[2] === 0 && fontData[3] === 0 || String.fromCharCode(fontData[0], fontData[1], fontData[2], fontData[3]) === "OTTO" || String.fromCharCode(fontData[0], fontData[1], fontData[2], fontData[3]) === "true" || String.fromCharCode(fontData[0], fontData[1], fontData[2], fontData[3]) === "ttcf");
62419
+ if (!variant.originalRId && (isWebFont || !hasSfntSignature)) {
62420
+ throw new Error(
62421
+ `Cannot embed custom font "${variant.name}" in PowerPoint: use a valid .ttf or .otf font file, not WOFF/WOFF2 browser data.`
62422
+ );
62423
+ }
62294
62424
  const hasOriginal = Boolean(variant.originalRId && variant.partPath);
62295
62425
  const reuseObfuscation = hasOriginal && Boolean(variant.fontGuid);
62296
62426
  const reuseVerbatim = hasOriginal && !variant.fontGuid && Boolean(variant.originalPartBytes);
@@ -62313,10 +62443,16 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime7 extends PptxHandlerRuntime
62313
62443
  bytesToWrite = variant.originalPartBytes;
62314
62444
  } else {
62315
62445
  guid = variant.fontGuid ?? generateFontGuid();
62316
- const fileName = `{${guid}}.fntdata`;
62446
+ const usedFontNumbers = relationships.map((relationship) => /fonts\/font(?<number>\d+)\.fntdata$/iu.exec(String(relationship?.["@_Target"] || ""))?.groups?.number).map((number) => Number(number)).filter((number) => Number.isFinite(number));
62447
+ const fileName = `font${Math.max(0, ...usedFontNumbers) + 1}.fntdata`;
62317
62448
  fontPartPath = `ppt/fonts/${fileName}`;
62318
62449
  relativeTarget4 = `fonts/${fileName}`;
62319
- bytesToWrite = obfuscateFont(fontData, guid);
62450
+ bytesToWrite = createEotFromSfnt(fontData, {
62451
+ familyName: variant.name,
62452
+ styleName: variant.bold ? variant.italic ? "Bold Italic" : "Bold" : variant.italic ? "Italic" : "Regular",
62453
+ weight: variant.bold ? 700 : 400,
62454
+ italic: variant.italic
62455
+ });
62320
62456
  const existingRel = relationships.find(
62321
62457
  (r) => String(r?.["@_Target"] || "") === relativeTarget4
62322
62458
  );
@@ -62345,8 +62481,28 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime7 extends PptxHandlerRuntime
62345
62481
  const generatedList = {
62346
62482
  "p:embeddedFont": embeddedFontEntries.length === 1 ? embeddedFontEntries[0] : embeddedFontEntries
62347
62483
  };
62348
- const metadata = explicitFontList ? serializeEmbeddedFontList(explicitFontList) : explicitFonts === void 0 && this.loadedEmbeddedFontList ? serializeEmbeddedFontList(this.loadedEmbeddedFontList) : generatedList;
62349
- setEmbeddedFontList(this.presentationData, metadata);
62484
+ const preservedMetadata = explicitFontList ?? this.loadedEmbeddedFontList;
62485
+ let metadata = generatedList;
62486
+ let metadataAppliedInPlace = false;
62487
+ if (preservedMetadata?.rawXml && !explicitFontList) {
62488
+ const rawList = preservedMetadata.rawXml;
62489
+ const embeddedFontKey = Object.keys(rawList).find(
62490
+ (key) => key.replace(/^.*:/u, "") === "embeddedFont"
62491
+ ) ?? "p:embeddedFont";
62492
+ const preservedEntries = this.ensureArray(rawList[embeddedFontKey]);
62493
+ rawList[embeddedFontKey] = [...preservedEntries, ...embeddedFontEntries];
62494
+ metadataAppliedInPlace = true;
62495
+ } else if (preservedMetadata) {
62496
+ metadata = serializeEmbeddedFontList(preservedMetadata);
62497
+ const embeddedFontKey = Object.keys(metadata).find(
62498
+ (key) => key.replace(/^.*:/u, "") === "embeddedFont"
62499
+ ) ?? "p:embeddedFont";
62500
+ const preservedEntries = this.ensureArray(metadata[embeddedFontKey]);
62501
+ metadata[embeddedFontKey] = [...preservedEntries, ...embeddedFontEntries];
62502
+ }
62503
+ if (!metadataAppliedInPlace) {
62504
+ setEmbeddedFontList(this.presentationData, metadata);
62505
+ }
62350
62506
  }
62351
62507
  const ctXml = await this.zip.file("[Content_Types].xml")?.async("string");
62352
62508
  if (ctXml) {
@@ -1,7 +1,7 @@
1
- import { DEFAULT_STROKE_COLOR, getConnectorPathGeometry, buildLineShadowCss, buildLineGlowFilter, renderConnectorMarker, getShapeVisualStyle, getTextStyleForElement, DEFAULT_TEXT_COLOR, renderVectorShape, isConnectorOrLineElement, build3DExtrusionData, getImageRenderStyle, cn, getTextLayoutStyle, renderTableElement, renderMediaElement, shouldRenderFallbackLabel, SHAPE_PRESETS, ANIMATION_PRESET_OPTIONS, useReducedMotion, useViewerState, useViewerOptions, useIsMobile, useResizablePanels, useDerivedSlideState, useZoomViewport, useEditorHistory, usePresentationSetup, useTouchGestures, useViewerDialogs, useEditorOperations, useViewerIntegration, useLayoutSwitching, useYjsDocumentSync, useFollowMode, useBroadcastFollower, DEFAULT_FILL_COLOR, hasDagDuotoneEffect, renderDagDuotoneSvgFilter, getCropShapeClipPath, MIN_ELEMENT_SIZE, resolvePalette, resolveStyle, layoutToCategory, wrapChrome, isImageTiled, getImageTilingStyle, getDuotoneColors, getTextWarpStyle, renderTextSegments, buildReactChartViewModel, renderChartElement, buildTextBody3DSceneStyle, SLIDE_TRANSITION_OPTIONS, SLIDE_NAV_THUMBNAIL_WIDTH, scopeLayoutOptionsToActiveSlide, useToolbarVisibility, useKeyboardInsets, useModalDismissDrag, useCollaborativeState, styleShadow, styleStroke, colour, fitFontSize, smartArtNodeGroupProps, chevronPoints, SmartArtNodeText, contrastingTextColor, renderStepDownProcess, renderAlternatingFlow, renderDescendingProcess, renderPictureAccentList, renderVerticalBlockList, renderGroupedList, renderPyramidList, renderHorizontalPictureList, renderAccentProcess, renderVerticalChevronList, DEFAULT_TEXT_FONT_SIZE, DEFAULT_FONT_FAMILY, TOOLBAR_SECTIONS, useVirtualizedSlides, useSwipeNavigation, useSheetDismissDrag, detectTargetType, parseEmailUrl, parseSlideFromUrl, ACTION_VERB_MAP, SHORTCUT_REFERENCE_ITEMS as SHORTCUT_REFERENCE_ITEMS$1, buildTree, treeWidth, treeDepth, nodeOpacity, truncate, gearPath, resolveSmartArtDataPalette, HYPERLINK_COLOR, GRID_SIZE, startPreviewAnimation, stopPreviewAnimation } from './chunk-FXXVW5YN.mjs';
2
- import { normalizeHexColor, colorWithOpacity, normalizeStrokeDashType, getSvgStrokeDasharray, getCompoundLineOffsets, getCompoundLineWidths, svgLineCap, getElementTransform, isEditableTextElement, getAriaRole, getAriaLabel, getAriaRoleDescription, getImageEffectsOpacity, getImageEffectsFilter, getElementTransformWithoutRotation, ACTION_BUTTON_PRESETS, getElementLabel, RULER_THICKNESS, RULER_FONT_SIZE, EQUATION_TEMPLATES, convertLatexToOmml, convertOmmlToMathMl, sanitizeMathMl, DEFAULT_VIEWER_OPTIONS, buildUserFontFaceStyles, readStoredViewerPrefs, resolveThemeCatalogEntry, THEME_CATALOG, writeStoredViewerPrefs, openPptxFile, readBackstageRecentFile, viewerOptionsToPreferences, applyPreferenceToOptions, listAutosaveSnapshots, deleteAutosaveSnapshot, createBackstagePresentation, buildCssGradientFromShapeStyle, getComputedEffectStyle, getSoftEdgeSvgFilter, getGroupChildParentFill, revealedSmartArtNodeCount, buildSmartArtA11y, buildSummaryZoomView, getImageColorWashStyle, getPendingSelectionRestore, restoreSegmentSelection, getTextCompensationTransform, applyChartBuildReveal, formatAxisValue, hasPressureVariation, getInkReplayStyles, INK_REPLAY_KEYFRAMES, resolveInkColor, resolveInkWidth, resolveInkOpacity, pressuresToWidths, getContentPartReplayStyles, resolveOleType, getOleTypeColor, getOleTypeLabel, resolveGroupChildFill, shouldUseSvgWarp, buildPreviewElements, themeToCssVars, DEFAULT_INSERT_CHART_TYPE, hasCopyableFormat, printPropertiesFrameSlides, printPropertiesSlidesPerPage, VIEWER_OPTIONS_TABS, DEFAULT_QUICK_ACCESS_COMMAND_IDS, buildJoinCollaborationConfig, buildCreateCollaborationConfig, generateBroadcastRoomId, DEFAULT_BROADCAST_SERVER_URL, buildBroadcastViewerUrl, resolveTransportForServerUrl, resolveDrawingShapeNodeId, getImageSvgFilters, buildDuotoneCacheKey, getDuotoneCachedResult, applyDuotone, setDuotoneCachedResult, buildCacheKey, DEFAULT_COLOR_CHANGE_TOLERANCE, getCachedResult, applyColorChange, setCachedResult, findChartPartTarget, dragValueForPart, withChartPointValue, dragAnchorViewY, withChartTitle, computeSmartArtLayout, buildSmartArt3DModel, extractPathPoints, generatePressureCircles, isBrowserOpenableMime, formatBytes, getOleBadgeLabel, openUrlInNewTab, getWarpPath, getSlideBackgroundStyle, filterCommands, resolveTitleBarStatusKey, TITLE_BAR_CLASSES, TITLE_BAR_DEFAULT_FILE_KEY, shouldConfirmExternalHyperlink, safeOpenUrl, isPpactionUrl, parsePpactionUrl, formatVersionTimestamp, formatRelativeTime, scanAvailableFontFamilies, PRESETS, CATEGORIES, convertOmmlToLatex, clampPercent, HANDOUT_OPTIONS, TOOLBAR_TABS, SHORTCUT_REFERENCE_ITEMS, resolveViewerAddinRows, availableQuickAccessCommands, addQuickAccessCommand, removeQuickAccessCommand, moveQuickAccessCommand, activateModalFocus, buildCollaborationShareUrl, presentationInkPath, mobileElapsedSince, isFirstSlide, isLastSlide, formatMobileElapsed, mobileSlideCounter, formatElapsed, computeInlineEditorRect, findSmartArtNodeText, rebuildDrawingShapesIfCleared, shouldCommitSmartArtNodeText, groupIntoParagraphs, substituteFieldText, TAB_ROW_ACTION_CLASSES, listBackstageRecentFiles, BACKSTAGE_NAV, INSERT_CHART_TYPES, SLIDE_VIRTUALIZATION_THRESHOLD, getShapeAdjustmentHandleDescriptor, getSlideTransitionAnimations, SLIDE_TRANSITION_KEYFRAMES, formatSlideCounter, isUrlSafe, computeHandoutLayout, getPrintableArea, generateNoteLineCount, computeAllNotesPages, getNotesPrintableArea, QUICK_ACCESS_COMMAND_CATALOG, notesSegmentsToSpans, erasePresentationInkAt, movePresenterPointer, appendPresentationInkPoint, NOTES_FONT_SIZE_DEFAULT, formatTime, NOTES_FONT_SIZE_MIN, clampNotesFontSize, NOTES_FONT_SIZE_STEP, NOTES_FONT_SIZE_MAX, BACKSTAGE_TEMPLATES, formatBackstageDate, formatBackstageSize, DEFAULT_VIEWER_PROFILE, resolveProfileInitial, AVATAR_COLOR_SWATCHES, getConnectionSites, generateTicks, getCommentMarkerPosition, buildThemeColorGrid, THEME_COLOR_LABELS, buildSmartArtPresetData, getLocalStorageUsageSummary, saveViewerProfile, clearAllLocalViewerData, TABLE_STYLE_PRESETS, withFrameSlides, withSlidesPerPage, formatCommentTimestamp, DIRECTIONAL_PRESETS, computeMergeCellRight, computeMergeCellDown, computeSplitCell, DUOTONE_PRESETS, ARTISTIC_EFFECTS, LBL, SEL, FILL_MODE_OPTIONS, SECTION_HEADING, NUM, GRADIENT_TYPE_OPTIONS, PATTERN_OPTIONS } from './chunk-6SJP4DDM.mjs';
1
+ import { DEFAULT_STROKE_COLOR, getConnectorPathGeometry, buildLineShadowCss, buildLineGlowFilter, renderConnectorMarker, getShapeVisualStyle, getTextStyleForElement, DEFAULT_TEXT_COLOR, renderVectorShape, isConnectorOrLineElement, build3DExtrusionData, getImageRenderStyle, cn, getTextLayoutStyle, renderTableElement, renderMediaElement, shouldRenderFallbackLabel, SHAPE_PRESETS, ANIMATION_PRESET_OPTIONS, useReducedMotion, useViewerState, useViewerOptions, useIsMobile, useResizablePanels, useDerivedSlideState, useZoomViewport, useEditorHistory, usePresentationSetup, useTouchGestures, useViewerDialogs, useEditorOperations, useViewerIntegration, useLayoutSwitching, useYjsDocumentSync, useFollowMode, useBroadcastFollower, DEFAULT_FILL_COLOR, hasDagDuotoneEffect, renderDagDuotoneSvgFilter, getCropShapeClipPath, MIN_ELEMENT_SIZE, resolvePalette, resolveStyle, layoutToCategory, wrapChrome, isImageTiled, getImageTilingStyle, getDuotoneColors, getTextWarpStyle, renderTextSegments, buildReactChartViewModel, renderChartElement, buildTextBody3DSceneStyle, SLIDE_TRANSITION_OPTIONS, SLIDE_NAV_THUMBNAIL_WIDTH, scopeLayoutOptionsToActiveSlide, useToolbarVisibility, useKeyboardInsets, useModalDismissDrag, useCollaborativeState, styleShadow, styleStroke, colour, fitFontSize, smartArtNodeGroupProps, chevronPoints, SmartArtNodeText, contrastingTextColor, renderStepDownProcess, renderAlternatingFlow, renderDescendingProcess, renderPictureAccentList, renderVerticalBlockList, renderGroupedList, renderPyramidList, renderHorizontalPictureList, renderAccentProcess, renderVerticalChevronList, DEFAULT_TEXT_FONT_SIZE, DEFAULT_FONT_FAMILY, TOOLBAR_SECTIONS, useVirtualizedSlides, useSwipeNavigation, useSheetDismissDrag, detectTargetType, parseEmailUrl, parseSlideFromUrl, ACTION_VERB_MAP, SHORTCUT_REFERENCE_ITEMS as SHORTCUT_REFERENCE_ITEMS$1, buildTree, treeWidth, treeDepth, nodeOpacity, truncate, gearPath, resolveSmartArtDataPalette, HYPERLINK_COLOR, GRID_SIZE, startPreviewAnimation, stopPreviewAnimation } from './chunk-JVIT6JD7.mjs';
2
+ import { normalizeHexColor, colorWithOpacity, normalizeStrokeDashType, getSvgStrokeDasharray, getCompoundLineOffsets, getCompoundLineWidths, svgLineCap, getElementTransform, isEditableTextElement, getAriaRole, getAriaLabel, getAriaRoleDescription, getImageEffectsOpacity, getImageEffectsFilter, getElementTransformWithoutRotation, ACTION_BUTTON_PRESETS, getElementLabel, RULER_THICKNESS, RULER_FONT_SIZE, EQUATION_TEMPLATES, convertLatexToOmml, convertOmmlToMathMl, sanitizeMathMl, DEFAULT_VIEWER_OPTIONS, buildUserFontFaceStyles, readStoredViewerPrefs, resolveThemeCatalogEntry, THEME_CATALOG, writeStoredViewerPrefs, openPptxFile, readBackstageRecentFile, viewerOptionsToPreferences, applyPreferenceToOptions, listAutosaveSnapshots, deleteAutosaveSnapshot, createBackstagePresentation, buildCssGradientFromShapeStyle, getComputedEffectStyle, getSoftEdgeSvgFilter, getGroupChildParentFill, revealedSmartArtNodeCount, buildSmartArtA11y, buildSummaryZoomView, getImageColorWashStyle, getPendingSelectionRestore, restoreSegmentSelection, getTextCompensationTransform, applyChartBuildReveal, formatAxisValue, hasPressureVariation, getInkReplayStyles, INK_REPLAY_KEYFRAMES, resolveInkColor, resolveInkWidth, resolveInkOpacity, pressuresToWidths, getContentPartReplayStyles, resolveOleType, getOleTypeColor, getOleTypeLabel, resolveGroupChildFill, shouldUseSvgWarp, buildPreviewElements, themeToCssVars, DEFAULT_INSERT_CHART_TYPE, hasCopyableFormat, printPropertiesFrameSlides, printPropertiesSlidesPerPage, VIEWER_OPTIONS_TABS, DEFAULT_QUICK_ACCESS_COMMAND_IDS, buildJoinCollaborationConfig, buildCreateCollaborationConfig, generateBroadcastRoomId, DEFAULT_BROADCAST_SERVER_URL, buildBroadcastViewerUrl, resolveTransportForServerUrl, resolveDrawingShapeNodeId, getImageSvgFilters, buildDuotoneCacheKey, getDuotoneCachedResult, applyDuotone, setDuotoneCachedResult, buildCacheKey, DEFAULT_COLOR_CHANGE_TOLERANCE, getCachedResult, applyColorChange, setCachedResult, findChartPartTarget, dragValueForPart, withChartPointValue, dragAnchorViewY, withChartTitle, computeSmartArtLayout, buildSmartArt3DModel, extractPathPoints, generatePressureCircles, isBrowserOpenableMime, formatBytes, getOleBadgeLabel, openUrlInNewTab, getWarpPath, getSlideBackgroundStyle, filterCommands, resolveTitleBarStatusKey, TITLE_BAR_CLASSES, TITLE_BAR_DEFAULT_FILE_KEY, shouldConfirmExternalHyperlink, safeOpenUrl, isPpactionUrl, parsePpactionUrl, formatVersionTimestamp, formatRelativeTime, scanAvailableFontFamilies, PRESETS, CATEGORIES, convertOmmlToLatex, clampPercent, HANDOUT_OPTIONS, TOOLBAR_TABS, SHORTCUT_REFERENCE_ITEMS, resolveViewerAddinRows, availableQuickAccessCommands, addQuickAccessCommand, removeQuickAccessCommand, moveQuickAccessCommand, activateModalFocus, buildCollaborationShareUrl, presentationInkPath, mobileElapsedSince, isFirstSlide, isLastSlide, formatMobileElapsed, mobileSlideCounter, formatElapsed, computeInlineEditorRect, findSmartArtNodeText, rebuildDrawingShapesIfCleared, shouldCommitSmartArtNodeText, groupIntoParagraphs, substituteFieldText, TAB_ROW_ACTION_CLASSES, listBackstageRecentFiles, BACKSTAGE_NAV, INSERT_CHART_TYPES, SLIDE_VIRTUALIZATION_THRESHOLD, getShapeAdjustmentHandleDescriptor, getSlideTransitionAnimations, SLIDE_TRANSITION_KEYFRAMES, formatSlideCounter, isUrlSafe, computeHandoutLayout, getPrintableArea, generateNoteLineCount, computeAllNotesPages, getNotesPrintableArea, QUICK_ACCESS_COMMAND_CATALOG, notesSegmentsToSpans, erasePresentationInkAt, movePresenterPointer, appendPresentationInkPoint, NOTES_FONT_SIZE_DEFAULT, formatTime, NOTES_FONT_SIZE_MIN, clampNotesFontSize, NOTES_FONT_SIZE_STEP, NOTES_FONT_SIZE_MAX, BACKSTAGE_TEMPLATES, formatBackstageDate, formatBackstageSize, DEFAULT_VIEWER_PROFILE, resolveProfileInitial, AVATAR_COLOR_SWATCHES, getConnectionSites, generateTicks, getCommentMarkerPosition, buildThemeColorGrid, THEME_COLOR_LABELS, buildSmartArtPresetData, getLocalStorageUsageSummary, saveViewerProfile, clearAllLocalViewerData, TABLE_STYLE_PRESETS, withFrameSlides, withSlidesPerPage, formatCommentTimestamp, DIRECTIONAL_PRESETS, computeMergeCellRight, computeMergeCellDown, computeSplitCell, DUOTONE_PRESETS, ARTISTIC_EFFECTS, LBL, SEL, FILL_MODE_OPTIONS, SECTION_HEADING, NUM, GRADIENT_TYPE_OPTIONS, PATTERN_OPTIONS } from './chunk-PWNYNDVP.mjs';
3
3
  import { LOCALE_CATALOG, translationsEn } from './chunk-2X72MOPZ.mjs';
4
- import { hasShapeProperties, hasTextProperties, isInkElement, SWITCHABLE_LAYOUT_TYPES, isImageLikeElement, getLinkedTextBoxSegments, getSubstituteFontFamily, themeColorSchemesEqual, setSmartArtNodeStyle, updateSmartArtNodeText, THEME_COLOR_SCHEME_KEYS, chartDataChangeType, chartDataUpdatePoint, chartDataAddCategory, chartDataRemoveCategory, chartDataAddSeries, chartDataRemoveSeries, setChartAxisLogScale, setChartAxisTitleStyle, setChartAxisGridlineStyle, setChartSeriesMarker, setChartSeriesChartType, setChartDataPointFill, setChartDataPointExplosion, setChartDataPointMarker, setChartDataPointLabel, getOleObjectTypeLabel, pptxActionToElementAction, applyThemeOverrideToSlide, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, addSmartArtNodeAsChild, removeSmartArtNode, elementActionToPptxAction, switchSmartArtLayout, addSmartArtNode, demoteSmartArtNode, promoteSmartArtNode, reorderSmartArtNode } from './chunk-3IIMAKXR.mjs';
4
+ import { hasShapeProperties, hasTextProperties, isInkElement, SWITCHABLE_LAYOUT_TYPES, isImageLikeElement, getLinkedTextBoxSegments, getSubstituteFontFamily, themeColorSchemesEqual, setSmartArtNodeStyle, updateSmartArtNodeText, THEME_COLOR_SCHEME_KEYS, chartDataChangeType, chartDataUpdatePoint, chartDataAddCategory, chartDataRemoveCategory, chartDataAddSeries, chartDataRemoveSeries, setChartAxisLogScale, setChartAxisTitleStyle, setChartAxisGridlineStyle, setChartSeriesMarker, setChartSeriesChartType, setChartDataPointFill, setChartDataPointExplosion, setChartDataPointMarker, setChartDataPointLabel, getOleObjectTypeLabel, pptxActionToElementAction, applyThemeOverrideToSlide, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, addSmartArtNodeAsChild, removeSmartArtNode, elementActionToPptxAction, switchSmartArtLayout, addSmartArtNode, demoteSmartArtNode, promoteSmartArtNode, reorderSmartArtNode } from './chunk-ZKWWCC2U.mjs';
5
5
  import React18, { createContext, useMemo, useState, useCallback, forwardRef, useEffect, useRef, Suspense, useLayoutEffect, useContext, useDeferredValue } from 'react';
6
6
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
7
7
  import { useTranslation } from 'react-i18next';
@@ -1335,7 +1335,7 @@ function AccountPage() {
1335
1335
  return void 0;
1336
1336
  });
1337
1337
  };
1338
- const version = "2.0.31" ;
1338
+ const version = "2.0.35" ;
1339
1339
  return /* @__PURE__ */ jsxs("div", { className: "mt-8 max-w-[700px] space-y-6", children: [
1340
1340
  /* @__PURE__ */ jsxs("section", { className: cardClass, children: [
1341
1341
  /* @__PURE__ */ jsxs("h2", { className: "flex items-center gap-2 text-sm font-semibold", children: [
@@ -3853,7 +3853,7 @@ function FailedToLoad() {
3853
3853
  var LazyModel3DScene = React18.lazy(
3854
3854
  async () => {
3855
3855
  try {
3856
- return await import('./Model3DScene-BLJ7FKLP.mjs');
3856
+ return await import('./Model3DScene-2GPBXNZQ.mjs');
3857
3857
  } catch {
3858
3858
  return { default: FailedToLoad };
3859
3859
  }
@@ -7133,6 +7133,18 @@ function HomeSection(p) {
7133
7133
  p.onUpdateTextStyle?.({ fontFamily: family });
7134
7134
  setFontMenuOpen(false);
7135
7135
  };
7136
+ const isPowerPointFontSource = (source) => source.format === "truetype" || source.format === "opentype";
7137
+ const selectPowerPointFontSources = (sources) => {
7138
+ const selected = /* @__PURE__ */ new Map();
7139
+ for (const source of sources) {
7140
+ if (!isPowerPointFontSource(source)) continue;
7141
+ const bold = Number(source.weight ?? 400) >= 600;
7142
+ const italic = source.style === "italic" || source.style === "oblique";
7143
+ const key = `${source.family.toLocaleLowerCase()}|${bold ? "bold" : "regular"}|${italic ? "italic" : "normal"}`;
7144
+ selected.set(key, source);
7145
+ }
7146
+ return [...selected.values()];
7147
+ };
7136
7148
  const fontSourceFromFile = async (file) => {
7137
7149
  const baseName = getZipEntryBaseName(file.name);
7138
7150
  const stem = baseName.replace(CUSTOM_FONT_FILE_EXTENSION, "");
@@ -7200,8 +7212,14 @@ function HomeSection(p) {
7200
7212
  sources.map(({ data: _data, ...source }) => source)
7201
7213
  );
7202
7214
  await registerFontSources(sources);
7215
+ const powerPointSources = selectPowerPointFontSources(sources);
7216
+ if (powerPointSources.length === 0) {
7217
+ throw new Error(
7218
+ "This font can be previewed in the browser, but PowerPoint embedding requires a .ttf or .otf file. Add that file to the ZIP and upload it again."
7219
+ );
7220
+ }
7203
7221
  p.onEmbedCustomFonts?.(
7204
- sources.map((source) => ({
7222
+ powerPointSources.map((source) => ({
7205
7223
  name: source.family,
7206
7224
  dataUrl: "",
7207
7225
  bold: Number(source.weight ?? 400) >= 600,