@algorisys/yappydraw 0.8.293 → 0.8.294

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 (26) hide show
  1. package/README.md +2 -2
  2. package/chunks/{canva-ai-B5NJGMGr.js → canva-ai-DqccAnxC.js} +1 -1
  3. package/chunks/{choice-dialog-state-Cw0WShhc.js → choice-dialog-state-10-yA9qy.js} +1 -1
  4. package/chunks/{custgeom-BeeylhzV.js → custgeom-gp_HWEYw.js} +13 -10
  5. package/chunks/{design-generator-BSZ2XUOE.js → design-generator-DIyJ4Dr0.js} +1 -1
  6. package/chunks/{drawing-engine-DfASJ_gK.js → drawing-engine-nqE0zI8L.js} +1 -1
  7. package/chunks/{drawings-store-cl-M93Eh.js → drawings-store-BFtMld-q.js} +1 -1
  8. package/chunks/{ds-operations-CXoS_Obn.js → ds-operations-40JYI4lM.js} +1 -1
  9. package/chunks/{export-game-BTjE-uv-.js → export-game-5Kek7Bol.js} +1 -1
  10. package/chunks/{from-yappy-hUcG5auS.js → from-yappy-ChRzxzZ9.js} +98 -88
  11. package/chunks/{game-runtime-33Ly0Axb.js → game-runtime--zmzKmmo.js} +37 -37
  12. package/chunks/{import-Dk___UKU.js → import-DGbhv-Je.js} +571 -507
  13. package/chunks/{index-OCtbNe3Y.js → index-v2rH-W8-.js} +40108 -39488
  14. package/chunks/{lucide-solid-Btzt68l9.js → lucide-solid-BHWkJbay.js} +1 -1
  15. package/chunks/markdown-to-slides-siI6fZd3.js +122 -0
  16. package/chunks/{morph-animator-CWLzpuUc.js → morph-animator-klLNQx0a.js} +1 -1
  17. package/chunks/{onboarding-tour-eLES7UJM.js → onboarding-tour-CV0e3oyB.js} +1 -1
  18. package/chunks/{pdf-vector-C1l03NEO.js → pdf-vector-DLxGyE10.js} +1 -1
  19. package/chunks/{search-tbh5OqVp.js → search-53sGgwDp.js} +2 -2
  20. package/chunks/{slide-generator-CZfB2tSO.js → slide-generator-BttJgv2N.js} +1 -1
  21. package/chunks/{turntable-ai-CeD-w_eE.js → turntable-ai-7udakZBz.js} +1 -1
  22. package/chunks/write-CIGfHqn4.js +254 -0
  23. package/package.json +1 -1
  24. package/yappy.js +1 -1
  25. package/chunks/markdown-to-slides-CNpwNPE8.js +0 -96
  26. package/chunks/write-BUtbdS9L.js +0 -212
@@ -1,9 +1,9 @@
1
1
  import { u as ae, a as ie } from "./browser-DbZP-BrN.js";
2
- import { E as H, i as vt, g as le } from "./custgeom-BeeylhzV.js";
3
- import { ap as ce, aq as Rt, M as fe, q as ue, K as de } from "./index-OCtbNe3Y.js";
4
- const he = 1e4, pe = 1e5, Wt = 6e4, K = (t) => t / Wt * (Math.PI / 180);
2
+ import { E as H, i as vt, g as le } from "./custgeom-gp_HWEYw.js";
3
+ import { aq as ce, ar as Nt, as as fe, at as ue, M as de, q as he, K as pe } from "./index-v2rH-W8-.js";
4
+ const me = 1e4, ge = 1e5, Wt = 6e4, Q = (t) => t / Wt * (Math.PI / 180);
5
5
  function _t(t, n, e, o = {}) {
6
- const s = /* @__PURE__ */ new Map(), r = Math.max(0, n), a = Math.max(0, e), i = Math.min(r, a), c = Math.max(r, a), y = {
6
+ const s = /* @__PURE__ */ new Map(), r = Math.max(0, n), a = Math.max(0, e), i = Math.min(r, a), c = Math.max(r, a), x = {
7
7
  w: r,
8
8
  h: a,
9
9
  l: 0,
@@ -22,28 +22,28 @@ function _t(t, n, e, o = {}) {
22
22
  "5cd8": 135e5,
23
23
  "7cd8": 189e5
24
24
  };
25
- for (const [g, h] of Object.entries(y)) s.set(g, h);
26
- for (const g of [2, 3, 4, 5, 6, 8, 10, 12, 16, 32])
27
- s.set(`wd${g}`, r / g), s.set(`hd${g}`, a / g), s.set(`ssd${g}`, i / g);
28
- const x = (g) => {
29
- const h = s.get(g);
30
- if (h !== void 0) return h;
31
- const u = /^(wd|hd|ssd)(\d+)$/.exec(g);
25
+ for (const [m, g] of Object.entries(x)) s.set(m, g);
26
+ for (const m of [2, 3, 4, 5, 6, 8, 10, 12, 16, 32])
27
+ s.set(`wd${m}`, r / m), s.set(`hd${m}`, a / m), s.set(`ssd${m}`, i / m);
28
+ const b = (m) => {
29
+ const g = s.get(m);
30
+ if (g !== void 0) return g;
31
+ const u = /^(wd|hd|ssd)(\d+)$/.exec(m);
32
32
  if (u) {
33
- const b = u[1] === "wd" ? r : u[1] === "hd" ? a : i, d = Number(u[2]);
34
- return d ? b / d : 0;
33
+ const y = u[1] === "wd" ? r : u[1] === "hd" ? a : i, d = Number(u[2]);
34
+ return d ? y / d : 0;
35
35
  }
36
- const p = Number(g);
37
- return Number.isFinite(p) ? p : 0;
38
- }, f = (g, h) => {
39
- s.size > he || s.set(g, me(h, x));
36
+ const h = Number(m);
37
+ return Number.isFinite(h) ? h : 0;
38
+ }, f = (m, g) => {
39
+ s.size > me || s.set(m, xe(g, b));
40
40
  };
41
- for (const [g, h] of t.av ?? []) f(g, o[g] ?? h);
42
- for (const [g, h] of Object.entries(o)) s.has(g) || f(g, h);
43
- for (const [g, h] of t.gd ?? []) f(g, h);
41
+ for (const [m, g] of t.av ?? []) f(m, o[m] ?? g);
42
+ for (const [m, g] of Object.entries(o)) s.has(m) || f(m, g);
43
+ for (const [m, g] of t.gd ?? []) f(m, g);
44
44
  return s;
45
45
  }
46
- function me(t, n) {
46
+ function xe(t, n) {
47
47
  const e = String(t || "").trim().split(/\s+/), o = e[0], [s, r, a] = e.slice(1).map(n);
48
48
  let i;
49
49
  switch (o) {
@@ -75,13 +75,13 @@ function me(t, n) {
75
75
  i = s * Math.sin(Math.atan2(a, r));
76
76
  break;
77
77
  case "cos":
78
- i = s * Math.cos(K(r));
78
+ i = s * Math.cos(Q(r));
79
79
  break;
80
80
  case "sin":
81
- i = s * Math.sin(K(r));
81
+ i = s * Math.sin(Q(r));
82
82
  break;
83
83
  case "tan":
84
- i = s * Math.tan(K(r));
84
+ i = s * Math.tan(Q(r));
85
85
  break;
86
86
  case "max":
87
87
  i = Math.max(s, r);
@@ -103,74 +103,74 @@ function me(t, n) {
103
103
  }
104
104
  return Number.isFinite(i) ? i : 0;
105
105
  }
106
- const Nt = (t, n, e) => Math.atan2(n * Math.sin(t), e * Math.cos(t));
107
- function it(t, n, e, o = {}) {
108
- const s = Math.max(Math.abs(n), 0) * H, r = Math.max(Math.abs(e), 0) * H, a = _t(t, s, r, o), i = (x) => typeof x == "number" ? x : a.get(x) ?? (Number.isFinite(Number(x)) ? Number(x) : 0), c = [];
109
- let y = pe;
110
- for (const x of t.paths) {
111
- const f = x.w ? s / x.w : 1, g = x.h ? r / x.h : 1, h = (m) => i(m) * f / H, u = (m) => i(m) * g / H, p = [];
112
- let b = { x: 0, y: 0 }, d = { x: 0, y: 0 };
113
- for (const m of x.d) {
114
- if (--y < 0) break;
115
- switch (m[0]) {
106
+ const Ot = (t, n, e) => Math.atan2(n * Math.sin(t), e * Math.cos(t));
107
+ function lt(t, n, e, o = {}) {
108
+ const s = Math.max(Math.abs(n), 0) * H, r = Math.max(Math.abs(e), 0) * H, a = _t(t, s, r, o), i = (b) => typeof b == "number" ? b : a.get(b) ?? (Number.isFinite(Number(b)) ? Number(b) : 0), c = [];
109
+ let x = ge;
110
+ for (const b of t.paths) {
111
+ const f = b.w ? s / b.w : 1, m = b.h ? r / b.h : 1, g = (p) => i(p) * f / H, u = (p) => i(p) * m / H, h = [];
112
+ let y = { x: 0, y: 0 }, d = { x: 0, y: 0 };
113
+ for (const p of b.d) {
114
+ if (--x < 0) break;
115
+ switch (p[0]) {
116
116
  case "M":
117
- b = { x: h(m[1]), y: u(m[2]) }, d = b, p.push({ op: "M", ...b });
117
+ y = { x: g(p[1]), y: u(p[2]) }, d = y, h.push({ op: "M", ...y });
118
118
  break;
119
119
  case "L":
120
- b = { x: h(m[1]), y: u(m[2]) }, p.push({ op: "L", ...b });
120
+ y = { x: g(p[1]), y: u(p[2]) }, h.push({ op: "L", ...y });
121
121
  break;
122
122
  case "C": {
123
- const k = h(m[1]), M = u(m[2]), S = h(m[3]), v = u(m[4]);
124
- b = { x: h(m[5]), y: u(m[6]) }, p.push({ op: "C", x1: k, y1: M, x2: S, y2: v, ...b });
123
+ const k = g(p[1]), M = u(p[2]), S = g(p[3]), v = u(p[4]);
124
+ y = { x: g(p[5]), y: u(p[6]) }, h.push({ op: "C", x1: k, y1: M, x2: S, y2: v, ...y });
125
125
  break;
126
126
  }
127
127
  case "Q": {
128
- const k = h(m[1]), M = u(m[2]), S = h(m[3]), v = u(m[4]);
129
- p.push({ op: "C", x1: b.x + 2 / 3 * (k - b.x), y1: b.y + 2 / 3 * (M - b.y), x2: S + 2 / 3 * (k - S), y2: v + 2 / 3 * (M - v), x: S, y: v }), b = { x: S, y: v };
128
+ const k = g(p[1]), M = u(p[2]), S = g(p[3]), v = u(p[4]);
129
+ h.push({ op: "C", x1: y.x + 2 / 3 * (k - y.x), y1: y.y + 2 / 3 * (M - y.y), x2: S + 2 / 3 * (k - S), y2: v + 2 / 3 * (M - v), x: S, y: v }), y = { x: S, y: v };
130
130
  break;
131
131
  }
132
132
  case "A": {
133
- const k = i(m[1]) * f / H, M = i(m[2]) * g / H;
134
- b = ge(p, b, k, M, i(m[3]), i(m[4]));
133
+ const k = i(p[1]) * f / H, M = i(p[2]) * m / H;
134
+ y = be(h, y, k, M, i(p[3]), i(p[4]));
135
135
  break;
136
136
  }
137
137
  case "Z":
138
- p.push({ op: "Z" }), b = d;
138
+ h.push({ op: "Z" }), y = d;
139
139
  break;
140
140
  }
141
141
  }
142
- p.length && c.push({ cmds: p, fill: x.fill === "none" ? !1 : void 0, stroke: x.stroke === !1 ? !1 : void 0 });
142
+ h.length && c.push({ cmds: h, fill: b.fill === "none" ? !1 : void 0, stroke: b.stroke === !1 ? !1 : void 0 });
143
143
  }
144
144
  return c;
145
145
  }
146
- function ge(t, n, e, o, s, r) {
146
+ function be(t, n, e, o, s, r) {
147
147
  if (Math.abs(e) < 1e-9 || Math.abs(o) < 1e-9 || r === 0) return n;
148
- const a = K(s), i = Math.max(-4 * Math.PI, Math.min(4 * Math.PI, K(r))), c = Nt(a, e, o);
149
- let y = Nt(a + i, e, o);
150
- if (Math.abs(i) >= 2 * Math.PI - 1e-9) y = c + Math.sign(i) * 2 * Math.PI;
148
+ const a = Q(s), i = Math.max(-4 * Math.PI, Math.min(4 * Math.PI, Q(r))), c = Ot(a, e, o);
149
+ let x = Ot(a + i, e, o);
150
+ if (Math.abs(i) >= 2 * Math.PI - 1e-9) x = c + Math.sign(i) * 2 * Math.PI;
151
151
  else {
152
- for (; i > 0 && y < c; ) y += 2 * Math.PI;
153
- for (; i < 0 && y > c; ) y -= 2 * Math.PI;
152
+ for (; i > 0 && x < c; ) x += 2 * Math.PI;
153
+ for (; i < 0 && x > c; ) x -= 2 * Math.PI;
154
154
  }
155
- const x = n.x - e * Math.cos(c), f = n.y - o * Math.sin(c), g = y - c, h = Math.max(1, Math.min(16, Math.ceil(Math.abs(g) / (Math.PI / 2)))), u = g / h, p = 4 / 3 * Math.tan(u / 4);
156
- let b = c, d = n;
157
- for (let m = 0; m < h; m++) {
158
- const k = b + u, M = Math.cos(b), S = Math.sin(b), v = Math.cos(k), I = Math.sin(k);
159
- d = { x: x + e * v, y: f + o * I }, t.push({ op: "C", x1: x + e * (M - p * S), y1: f + o * (S + p * M), x2: x + e * (v + p * I), y2: f + o * (I - p * v), ...d }), b = k;
155
+ const b = n.x - e * Math.cos(c), f = n.y - o * Math.sin(c), m = x - c, g = Math.max(1, Math.min(16, Math.ceil(Math.abs(m) / (Math.PI / 2)))), u = m / g, h = 4 / 3 * Math.tan(u / 4);
156
+ let y = c, d = n;
157
+ for (let p = 0; p < g; p++) {
158
+ const k = y + u, M = Math.cos(y), S = Math.sin(y), v = Math.cos(k), N = Math.sin(k);
159
+ d = { x: b + e * v, y: f + o * N }, t.push({ op: "C", x1: b + e * (M - h * S), y1: f + o * (S + h * M), x2: b + e * (v + h * N), y2: f + o * (N - h * v), ...d }), y = k;
160
160
  }
161
161
  return d;
162
162
  }
163
163
  function Ut(t, n, e, o = {}) {
164
164
  const s = Math.abs(n), r = Math.abs(e);
165
165
  if (!t.rect) return { l: 0, t: 0, r: s, b: r };
166
- const a = _t(t, s * H, r * H, o), i = (g) => (a.get(g) ?? (Number.isFinite(Number(g)) ? Number(g) : 0)) / H, [c, y, x, f] = t.rect.map(i);
167
- return { l: c, t: y, r: x, b: f };
166
+ const a = _t(t, s * H, r * H, o), i = (m) => (a.get(m) ?? (Number.isFinite(Number(m)) ? Number(m) : 0)) / H, [c, x, b, f] = t.rect.map(i);
167
+ return { l: c, t: x, r: b, b: f };
168
168
  }
169
- let Ot = null;
170
- async function xe() {
171
- return Ot ??= (await import("./presets-DP49P8i2.js")).default, Ot;
169
+ let Rt = null;
170
+ async function ye() {
171
+ return Rt ??= (await import("./presets-DP49P8i2.js")).default, Rt;
172
172
  }
173
- const Et = 5e4, be = 256 * 1024 * 1024, At = 1024 * 1024 * 1024, ye = 1e4, ke = 32, we = 2e4, R = (t, n) => {
173
+ const At = 5e4, ke = 256 * 1024 * 1024, Et = 1024 * 1024 * 1024, we = 1e4, Me = 32, ve = 2e4, I = (t, n) => {
174
174
  if (!t) return [];
175
175
  const e = [];
176
176
  for (let o = t.firstChild; o; o = o.nextSibling)
@@ -180,7 +180,7 @@ const Et = 5e4, be = 256 * 1024 * 1024, At = 1024 * 1024 * 1024, ye = 1e4, ke =
180
180
  if (!t) return null;
181
181
  for (let e = t.firstChild; e; e = e.nextSibling) if (e.nodeType === 1 && e.localName === n) return e;
182
182
  return null;
183
- }, E = (t, ...n) => {
183
+ }, R = (t, ...n) => {
184
184
  let e = t;
185
185
  for (const o of n) e = l(e, o);
186
186
  return e ?? null;
@@ -200,16 +200,16 @@ const Et = 5e4, be = 256 * 1024 * 1024, At = 1024 * 1024 * 1024, ye = 1e4, ke =
200
200
  }, B = (t, n) => {
201
201
  const e = w(t, n);
202
202
  return e === null ? void 0 : e === "1" || e === "true" || e === "on";
203
- }, L = (t) => t / H, Me = /* @__PURE__ */ new Set(["p14", "a14", "a16"]);
204
- function ve(t) {
203
+ }, L = (t) => t / H, Se = /* @__PURE__ */ new Set(["p14", "a14", "a16"]);
204
+ function Ce(t) {
205
205
  if (t.localName !== "AlternateContent") return [t];
206
206
  const n = l(t, "Fallback");
207
- for (const e of R(t, "Choice"))
208
- if ((w(e, "Requires") || "").split(/\s+/).filter(Boolean).every((s) => Me.has(s))) return R(e);
209
- return R(n);
207
+ for (const e of I(t, "Choice"))
208
+ if ((w(e, "Requires") || "").split(/\s+/).filter(Boolean).every((s) => Se.has(s))) return I(e);
209
+ return I(n);
210
210
  }
211
- const ut = (t) => R(t).flatMap(ve);
212
- class Se {
211
+ const st = (t) => I(t).flatMap(Ce);
212
+ class Pe {
213
213
  files;
214
214
  text = /* @__PURE__ */ new Map();
215
215
  relCache = /* @__PURE__ */ new Map();
@@ -217,13 +217,13 @@ class Se {
217
217
  warn;
218
218
  constructor(n, e, o) {
219
219
  this.parseXml = e, this.warn = o, this.files = {};
220
- for (const [s, r] of Object.entries(n)) this.files[Z(s)] = r;
220
+ for (const [s, r] of Object.entries(n)) this.files[K(s)] = r;
221
221
  }
222
222
  bytes(n) {
223
- return this.files[Z(n)];
223
+ return this.files[K(n)];
224
224
  }
225
225
  xml(n) {
226
- const e = Z(n);
226
+ const e = K(n);
227
227
  if (!this.text.has(e)) {
228
228
  const o = this.files[e];
229
229
  let s = null;
@@ -241,16 +241,16 @@ class Se {
241
241
  return this.text.get(e)?.documentElement ?? null;
242
242
  }
243
243
  rels(n) {
244
- const e = Z(n);
244
+ const e = K(n);
245
245
  let o = this.relCache.get(e);
246
246
  if (o) return o;
247
247
  o = /* @__PURE__ */ new Map();
248
248
  const s = e.includes("/") ? e.slice(0, e.lastIndexOf("/")) : "", r = e.slice(e.lastIndexOf("/") + 1), a = this.xml(`${s ? s + "/" : ""}_rels/${r}.rels`);
249
- for (const i of R(a, "Relationship")) {
250
- const c = w(i, "Id"), y = w(i, "Type") || "", x = w(i, "Target") || "";
249
+ for (const i of I(a, "Relationship")) {
250
+ const c = w(i, "Id"), x = w(i, "Type") || "", b = w(i, "Target") || "";
251
251
  if (!c) continue;
252
252
  const f = w(i, "TargetMode") === "External";
253
- o.set(c, { type: y.slice(y.lastIndexOf("/") + 1), target: f ? x : Ce(s, x), external: f });
253
+ o.set(c, { type: x.slice(x.lastIndexOf("/") + 1), target: f ? b : Te(s, b), external: f });
254
254
  }
255
255
  return this.relCache.set(e, o), o;
256
256
  }
@@ -259,14 +259,14 @@ class Se {
259
259
  return null;
260
260
  }
261
261
  }
262
- const Z = (t) => t.replace(/\\/g, "/").replace(/^\/+/, "");
263
- function Ce(t, n) {
262
+ const K = (t) => t.replace(/\\/g, "/").replace(/^\/+/, "");
263
+ function Te(t, n) {
264
264
  let e = n.split("#")[0];
265
265
  try {
266
266
  e = decodeURIComponent(e);
267
267
  } catch {
268
268
  }
269
- if (e.startsWith("/")) return Z(e);
269
+ if (e.startsWith("/")) return K(e);
270
270
  const o = (t ? t.split("/") : []).concat(e.split("/")), s = [];
271
271
  for (const r of o)
272
272
  r === ".." ? s.pop() : r && r !== "." && s.push(r);
@@ -275,18 +275,18 @@ function Ce(t, n) {
275
275
  const St = { bg1: "lt1", tx1: "dk1", bg2: "lt2", tx2: "dk2" };
276
276
  function pt(t) {
277
277
  const n = { colors: {}, major: "Calibri Light", minor: "Calibri", fills: [], lines: [], bgFills: [] }, e = l(t, "themeElements");
278
- for (const r of R(l(e, "clrScheme"))) {
279
- const a = R(r)[0];
278
+ for (const r of I(l(e, "clrScheme"))) {
279
+ const a = I(r)[0];
280
280
  if (!a) continue;
281
281
  const i = a.localName === "sysClr" ? w(a, "lastClr") : w(a, "val");
282
282
  i && /^[0-9a-f]{6}$/i.test(i) && (n.colors[r.localName] = "#" + i.toLowerCase());
283
283
  }
284
284
  const o = l(e, "fontScheme");
285
- n.major = w(E(o, "majorFont", "latin"), "typeface") || n.major, n.minor = w(E(o, "minorFont", "latin"), "typeface") || n.minor;
285
+ n.major = w(R(o, "majorFont", "latin"), "typeface") || n.major, n.minor = w(R(o, "minorFont", "latin"), "typeface") || n.minor;
286
286
  const s = l(e, "fmtScheme");
287
- return n.fills = R(l(s, "fillStyleLst")), n.lines = R(l(s, "lnStyleLst")), n.bgFills = R(l(s, "bgFillStyleLst")), n;
287
+ return n.fills = I(l(s, "fillStyleLst")), n.lines = I(l(s, "lnStyleLst")), n.bgFills = I(l(s, "bgFillStyleLst")), n;
288
288
  }
289
- const Pe = {
289
+ const Ie = {
290
290
  black: "#000000",
291
291
  white: "#ffffff",
292
292
  red: "#ff0000",
@@ -314,7 +314,7 @@ const Pe = {
314
314
  }, Gt = (t) => {
315
315
  const n = t.replace("#", "");
316
316
  return [parseInt(n.slice(0, 2), 16) || 0, parseInt(n.slice(2, 4), 16) || 0, parseInt(n.slice(4, 6), 16) || 0];
317
- }, rt = (t, n, e) => "#" + [t, n, e].map((o) => Math.max(0, Math.min(255, Math.round(o))).toString(16).padStart(2, "0")).join(""), Q = (t) => (t /= 255, t <= 0.04045 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4)), _ = (t) => 255 * (t <= 31308e-7 ? t * 12.92 : 1.055 * Math.pow(t, 1 / 2.4) - 0.055);
317
+ }, it = (t, n, e) => "#" + [t, n, e].map((o) => Math.max(0, Math.min(255, Math.round(o))).toString(16).padStart(2, "0")).join(""), J = (t) => (t /= 255, t <= 0.04045 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4)), _ = (t) => 255 * (t <= 31308e-7 ? t * 12.92 : 1.055 * Math.pow(t, 1 / 2.4) - 0.055);
318
318
  function Lt(t, n, e) {
319
319
  t /= 255, n /= 255, e /= 255;
320
320
  const o = Math.max(t, n, e), s = Math.min(t, n, e), r = (o + s) / 2;
@@ -328,10 +328,10 @@ function mt(t, n, e) {
328
328
  return [r(t + 1 / 3) * 255, r(t) * 255, r(t - 1 / 3) * 255];
329
329
  }
330
330
  function $(t, n) {
331
- const e = R(t).find((o) => /Clr$/.test(o.localName));
332
- return e ? Te(e, n) : null;
331
+ const e = I(t).find((o) => /Clr$/.test(o.localName));
332
+ return e ? Ne(e, n) : null;
333
333
  }
334
- function Te(t, n) {
334
+ function Ne(t, n) {
335
335
  let e = null, o = 1;
336
336
  switch (t.localName) {
337
337
  case "srgbClr": {
@@ -345,14 +345,14 @@ function Te(t, n) {
345
345
  break;
346
346
  }
347
347
  case "prstClr":
348
- e = Pe[w(t, "val") || ""] ?? "#000000";
348
+ e = Ie[w(t, "val") || ""] ?? "#000000";
349
349
  break;
350
350
  case "scrgbClr":
351
- e = rt(_(C(t, "r") / 1e5), _(C(t, "g") / 1e5), _(C(t, "b") / 1e5));
351
+ e = it(_(C(t, "r") / 1e5), _(C(t, "g") / 1e5), _(C(t, "b") / 1e5));
352
352
  break;
353
353
  case "hslClr": {
354
- const [c, y, x] = mt(C(t, "hue") / 6e4, C(t, "sat") / 1e5, C(t, "lum") / 1e5);
355
- e = rt(c, y, x);
354
+ const [c, x, b] = mt(C(t, "hue") / 6e4, C(t, "sat") / 1e5, C(t, "lum") / 1e5);
355
+ e = it(c, x, b);
356
356
  break;
357
357
  }
358
358
  case "schemeClr": {
@@ -361,24 +361,24 @@ function Te(t, n) {
361
361
  n.phClr ? (e = n.phClr.hex, o = n.phClr.alpha ?? 1) : e = n.theme.colors.accent1 ?? "#4472c4";
362
362
  break;
363
363
  }
364
- const y = n.clrMap[c] ?? St[c] ?? c;
365
- e = n.theme.colors[y] ?? null;
364
+ const x = n.clrMap[c] ?? St[c] ?? c;
365
+ e = n.theme.colors[x] ?? null;
366
366
  break;
367
367
  }
368
368
  }
369
369
  if (!e) return null;
370
370
  let [s, r, a] = Gt(e);
371
- for (const c of R(t)) {
372
- const y = C(c, "val") / 1e5;
371
+ for (const c of I(t)) {
372
+ const x = C(c, "val") / 1e5;
373
373
  switch (c.localName) {
374
374
  case "alpha":
375
- o = y;
375
+ o = x;
376
376
  break;
377
377
  case "alphaMod":
378
- o *= y;
378
+ o *= x;
379
379
  break;
380
380
  case "alphaOff":
381
- o += y;
381
+ o += x;
382
382
  break;
383
383
  case "lumMod":
384
384
  case "lumOff":
@@ -386,19 +386,19 @@ function Te(t, n) {
386
386
  case "satOff":
387
387
  case "hueMod":
388
388
  case "hueOff": {
389
- let [x, f, g] = Lt(s, r, a);
390
- c.localName === "lumMod" ? g *= y : c.localName === "lumOff" ? g += y : c.localName === "satMod" ? f *= y : c.localName === "satOff" ? f += y : c.localName === "hueMod" ? x *= y : x += C(c, "val") / 6e4, [s, r, a] = mt(x, Math.max(0, Math.min(1, f)), Math.max(0, Math.min(1, g)));
389
+ let [b, f, m] = Lt(s, r, a);
390
+ c.localName === "lumMod" ? m *= x : c.localName === "lumOff" ? m += x : c.localName === "satMod" ? f *= x : c.localName === "satOff" ? f += x : c.localName === "hueMod" ? b *= x : b += C(c, "val") / 6e4, [s, r, a] = mt(b, Math.max(0, Math.min(1, f)), Math.max(0, Math.min(1, m)));
391
391
  break;
392
392
  }
393
393
  case "tint":
394
- [s, r, a] = [s, r, a].map((x) => _(Q(x) * y + (1 - y)));
394
+ [s, r, a] = [s, r, a].map((b) => _(J(b) * x + (1 - x)));
395
395
  break;
396
396
  case "shade":
397
- [s, r, a] = [s, r, a].map((x) => _(Q(x) * y));
397
+ [s, r, a] = [s, r, a].map((b) => _(J(b) * x));
398
398
  break;
399
399
  case "comp": {
400
- const [x, f, g] = Lt(s, r, a);
401
- [s, r, a] = mt(x + 180, f, g);
400
+ const [b, f, m] = Lt(s, r, a);
401
+ [s, r, a] = mt(b + 180, f, m);
402
402
  break;
403
403
  }
404
404
  case "inv":
@@ -411,11 +411,11 @@ function Te(t, n) {
411
411
  }
412
412
  }
413
413
  o = Math.max(0, Math.min(1, o));
414
- const i = { hex: rt(s, r, a) };
414
+ const i = { hex: it(s, r, a) };
415
415
  return o < 0.999 && (i.alpha = o), i;
416
416
  }
417
417
  function V(t, n) {
418
- for (const e of R(t)) {
418
+ for (const e of I(t)) {
419
419
  const o = Ct(e, n);
420
420
  if (o) return o;
421
421
  }
@@ -429,7 +429,7 @@ function Ct(t, n) {
429
429
  return e ? { kind: "solid", color: e } : { kind: "none" };
430
430
  }
431
431
  case "gradFill": {
432
- const e = R(l(t, "gsLst"), "gs").slice(0, 256).map((s) => ({ pos: C(s, "pos") / 1e5, color: $(s, n.ctx) ?? { hex: "#000000" } }));
432
+ const e = I(l(t, "gsLst"), "gs").slice(0, 256).map((s) => ({ pos: C(s, "pos") / 1e5, color: $(s, n.ctx) ?? { hex: "#000000" } }));
433
433
  if (!e.length) return { kind: "none" };
434
434
  const o = l(t, "lin");
435
435
  return l(t, "path") ? { kind: "radial", stops: e } : { kind: "linear", stops: e, angle: o ? C(o, "ang") / 6e4 : 90, scaled: B(o, "scaled") ?? !1 };
@@ -450,7 +450,7 @@ function Ct(t, n) {
450
450
  return;
451
451
  }
452
452
  }
453
- const Ie = {
453
+ const Oe = {
454
454
  png: "png",
455
455
  jpg: "jpeg",
456
456
  jpeg: "jpeg",
@@ -469,14 +469,14 @@ function Vt(t, n) {
469
469
  if (!o) return null;
470
470
  const s = n.pkg.rels(n.part).get(o);
471
471
  if (!s || s.external) return null;
472
- const r = n.pkg.bytes(s.target), a = Ie[(s.target.split(".").pop() || "").toLowerCase()];
472
+ const r = n.pkg.bytes(s.target), a = Oe[(s.target.split(".").pop() || "").toLowerCase()];
473
473
  return r && a ? { bytes: r, ext: a } : null;
474
474
  }
475
475
  const Re = { solid: "", dot: "sysDot", sysDot: "sysDot", sysDash: "dash", dash: "dash", lgDash: "dash", dashDot: "dash", lgDashDot: "dash", lgDashDotDot: "dash", sysDashDot: "dash", sysDashDotDot: "dash" };
476
476
  function U(t, n) {
477
477
  if (!t) return;
478
478
  let e;
479
- for (const i of R(t)) {
479
+ for (const i of I(t)) {
480
480
  if (i.localName === "noFill") return null;
481
481
  i.localName === "solidFill" && (e = $(i, n.ctx)), i.localName === "gradFill" && (e = $(l(l(i, "gsLst"), "gs"), n.ctx));
482
482
  }
@@ -485,8 +485,8 @@ function U(t, n) {
485
485
  const s = (i) => {
486
486
  const c = w(i, "type");
487
487
  if (!c || c === "none") return;
488
- const y = c === "triangle" || c === "stealth" || c === "arrow" || c === "oval" || c === "diamond" ? c : "triangle", x = w(i, "len") || w(i, "w");
489
- return { type: y, size: x === "sm" || x === "lg" ? x : "med" };
488
+ const x = c === "triangle" || c === "stealth" || c === "arrow" || c === "oval" || c === "diamond" ? c : "triangle", b = w(i, "len") || w(i, "w");
489
+ return { type: x, size: b === "sm" || b === "lg" ? b : "med" };
490
490
  }, r = Re[w(l(t, "prstDash"), "val") || "solid"], a = w(t, "cap");
491
491
  return {
492
492
  // ECMA's default is 9525 EMU — 0.75 pt, one px.
@@ -499,7 +499,7 @@ function U(t, n) {
499
499
  tail: s(l(t, "tailEnd"))
500
500
  };
501
501
  }
502
- function lt(t, n) {
502
+ function ct(t, n) {
503
503
  const e = l(t, "fillRef");
504
504
  if (!e) return;
505
505
  const o = C(e, "idx");
@@ -533,18 +533,18 @@ function Y(t) {
533
533
  };
534
534
  }
535
535
  const gt = (t) => t;
536
- function Ne(t, n) {
536
+ function Ae(t, n) {
537
537
  const e = Y(t);
538
538
  if (!e) return n;
539
- const o = l(t, "chOff"), s = l(t, "chExt"), r = o ? L(C(o, "x")) : e.x, a = o ? L(C(o, "y")) : e.y, i = s ? L(C(s, "cx")) : e.w, c = s ? L(C(s, "cy")) : e.h, y = i > 0 ? e.w / i : 1, x = c > 0 ? e.h / c : 1, f = e.x + e.w / 2, g = e.y + e.h / 2, h = e.rot * Math.PI / 180;
539
+ const o = l(t, "chOff"), s = l(t, "chExt"), r = o ? L(C(o, "x")) : e.x, a = o ? L(C(o, "y")) : e.y, i = s ? L(C(s, "cx")) : e.w, c = s ? L(C(s, "cy")) : e.h, x = i > 0 ? e.w / i : 1, b = c > 0 ? e.h / c : 1, f = e.x + e.w / 2, m = e.y + e.h / 2, g = e.rot * Math.PI / 180;
540
540
  return (u) => {
541
- let p = e.x + (u.x + u.w / 2 - r) * y, b = e.y + (u.y + u.h / 2 - a) * x, d = u.rot, m = u.flipH, k = u.flipV;
542
- if (e.flipH && (p = 2 * f - p, m = !m, d = -d), e.flipV && (b = 2 * g - b, k = !k, d = -d), h) {
543
- const v = p - f, I = b - g;
544
- p = f + v * Math.cos(h) - I * Math.sin(h), b = g + v * Math.sin(h) + I * Math.cos(h), d += e.rot;
541
+ let h = e.x + (u.x + u.w / 2 - r) * x, y = e.y + (u.y + u.h / 2 - a) * b, d = u.rot, p = u.flipH, k = u.flipV;
542
+ if (e.flipH && (h = 2 * f - h, p = !p, d = -d), e.flipV && (y = 2 * m - y, k = !k, d = -d), g) {
543
+ const v = h - f, N = y - m;
544
+ h = f + v * Math.cos(g) - N * Math.sin(g), y = m + v * Math.sin(g) + N * Math.cos(g), d += e.rot;
545
545
  }
546
- const M = u.w * y, S = u.h * x;
547
- return n({ x: p - M / 2, y: b - S / 2, w: M, h: S, rot: (d % 360 + 360) % 360, flipH: m, flipV: k });
546
+ const M = u.w * x, S = u.h * b;
547
+ return n({ x: h - M / 2, y: y - S / 2, w: M, h: S, rot: (d % 360 + 360) % 360, flipH: p, flipV: k });
548
548
  };
549
549
  }
550
550
  function Ft(t) {
@@ -552,7 +552,7 @@ function Ft(t) {
552
552
  if (n) return { px: Math.max(0, Math.min(1584, C(n, "val") / 100)) * (vt / H) };
553
553
  if (e) return { lines: Math.max(0, Math.min(13.2, C(e, "val") / 1e5)) };
554
554
  }
555
- function Dt(t, n, e) {
555
+ function jt(t, n, e) {
556
556
  const o = l(t, `lvl${n + 1}pPr`) ?? (t && t.localName.endsWith("pPr") ? t : null);
557
557
  return o ? qt(o, e) : {};
558
558
  }
@@ -567,7 +567,7 @@ function qt(t, n) {
567
567
  const a = w(l(t, "buSzPct"), "val") || "", i = a.endsWith("%") ? parseFloat(a) / 100 : Number(a) / 1e5;
568
568
  e.buSz = Number.isFinite(i) && i > 0 ? Math.max(0.25, Math.min(4, i)) : null;
569
569
  } else (l(t, "buSzTx") || l(t, "buSzPts")) && (e.buSz = null);
570
- const o = E(t, "lnSpc", "spcPct");
570
+ const o = R(t, "lnSpc", "spcPct");
571
571
  o && (e.lnSpcPct = C(o, "val") / 1e5);
572
572
  const s = Ft(l(t, "spcBef")), r = Ft(l(t, "spcAft"));
573
573
  return s && (e.spcBef = s), r && (e.spcAft = r), Object.assign(e, Zt(l(t, "defRPr"), n)), e;
@@ -581,7 +581,7 @@ function Zt(t, n) {
581
581
  const s = w(l(t, "latin"), "typeface");
582
582
  return s && (e.font = s), e;
583
583
  }
584
- const Oe = {
584
+ const Ee = {
585
585
  108: "●",
586
586
  110: "■",
587
587
  111: "□",
@@ -595,130 +595,130 @@ const Oe = {
595
595
  252: "✔",
596
596
  251: "✗",
597
597
  254: "☑"
598
- }, Ee = { 183: "•", 168: "♦", 174: "→", 222: "⇒", 45: "−", 42: "∗" };
599
- function Ae(t, n) {
598
+ }, Le = { 183: "•", 168: "♦", 174: "→", 222: "⇒", 45: "−", 42: "∗" };
599
+ function Fe(t, n) {
600
600
  if (!t) return "•";
601
601
  let e = t.codePointAt(0);
602
602
  e >= 61440 && e <= 61695 && (e -= 61440);
603
603
  const o = (n || "").toLowerCase();
604
- return o.startsWith("wingdings") ? o === "wingdings" && Oe[e] || "•" : o === "symbol" ? Ee[e] ?? (e < 128 && e > 32 ? String.fromCharCode(e) : "•") : o.startsWith("webdings") || o.startsWith("marlett") ? "•" : o === "courier new" && t === "o" ? "◦" : /\s/.test(t) || e < 32 ? "•" : [...t][0];
604
+ return o.startsWith("wingdings") ? o === "wingdings" && Ee[e] || "•" : o === "symbol" ? Le[e] ?? (e < 128 && e > 32 ? String.fromCharCode(e) : "•") : o.startsWith("webdings") || o.startsWith("marlett") ? "•" : o === "courier new" && t === "o" ? "◦" : /\s/.test(t) || e < 32 ? "•" : [...t][0];
605
605
  }
606
- const jt = (...t) => {
606
+ const Dt = (...t) => {
607
607
  const n = {};
608
608
  for (const e of t) for (const [o, s] of Object.entries(e)) s !== void 0 && (n[o] = s);
609
609
  return n;
610
610
  };
611
- function Le(t, n) {
611
+ function je(t, n) {
612
612
  if (t)
613
613
  return t.startsWith("+mj") ? n.major : t.startsWith("+mn") ? n.minor : t;
614
614
  }
615
615
  function Tt(t, n, e) {
616
616
  if (!t) return;
617
- const o = R(t, "p");
618
- if (!o.some((h) => R(h).some((u) => (u.localName === "r" || u.localName === "fld") && (E(u, "t")?.textContent ?? "") !== ""))) return;
617
+ const o = I(t, "p");
618
+ if (!o.some((g) => I(g).some((u) => (u.localName === "r" || u.localName === "fld") && (R(u, "t")?.textContent ?? "") !== ""))) return;
619
619
  const r = {};
620
620
  let a = 1, i = 1;
621
- for (const h of [...n.bodyPr, l(t, "bodyPr")]) {
622
- if (!h) continue;
623
- for (let p = 0; p < h.attributes.length; p++) r[h.attributes[p].localName ?? h.attributes[p].name] = h.attributes[p].value;
624
- const u = l(h, "normAutofit");
625
- u && (a = w(u, "fontScale") !== null ? C(u, "fontScale") / 1e5 : 1), u && (i = 1 - Math.max(0, Math.min(0.9, C(u, "lnSpcReduction") / 1e5))), (l(h, "noAutofit") || l(h, "spAutoFit")) && (a = 1, i = 1);
621
+ for (const g of [...n.bodyPr, l(t, "bodyPr")]) {
622
+ if (!g) continue;
623
+ for (let h = 0; h < g.attributes.length; h++) r[g.attributes[h].localName ?? g.attributes[h].name] = g.attributes[h].value;
624
+ const u = l(g, "normAutofit");
625
+ u && (a = w(u, "fontScale") !== null ? C(u, "fontScale") / 1e5 : 1), u && (i = 1 - Math.max(0, Math.min(0.9, C(u, "lnSpcReduction") / 1e5))), (l(g, "noAutofit") || l(g, "spAutoFit")) && (a = 1, i = 1);
626
626
  }
627
- const c = (h, u) => r[h] !== void 0 ? L(Number(r[h]) || 0) : L(u), y = r.anchor === "ctr" ? "ctr" : r.anchor === "b" ? "b" : "t", x = l(t, "lstStyle"), f = [];
628
- let g;
629
- for (const h of o) {
630
- const u = l(h, "pPr"), p = Math.max(0, Math.min(8, C(u, "lvl"))), b = n.fontRef ? { color: n.fontRef.color ?? void 0, font: n.fontRef.font } : {}, d = jt(...n.levels.map((P) => Dt(P, p, e)), b, Dt(x, p, e), u ? qt(u, e) : {});
631
- d.lnSpcPct !== void 0 && g === void 0 && (g = d.lnSpcPct);
632
- const m = { runs: [], align: d.algn === "ctr" ? "ctr" : d.algn === "r" ? "r" : (d.algn === "just", "l"), level: p };
627
+ const c = (g, u) => r[g] !== void 0 ? L(Number(r[g]) || 0) : L(u), x = r.anchor === "ctr" ? "ctr" : r.anchor === "b" ? "b" : "t", b = l(t, "lstStyle"), f = [];
628
+ let m;
629
+ for (const g of o) {
630
+ const u = l(g, "pPr"), h = Math.max(0, Math.min(8, C(u, "lvl"))), y = n.fontRef ? { color: n.fontRef.color ?? void 0, font: n.fontRef.font } : {}, d = Dt(...n.levels.map((P) => jt(P, h, e)), y, jt(b, h, e), u ? qt(u, e) : {});
631
+ d.lnSpcPct !== void 0 && m === void 0 && (m = d.lnSpcPct);
632
+ const p = { runs: [], align: d.algn === "ctr" ? "ctr" : d.algn === "r" ? "r" : (d.algn === "just", "l"), level: h };
633
633
  if (d.bullet === "char" || d.bullet === "num") {
634
- if (m.bullet = d.bullet, m.marL = d.marL ?? 0, m.indent = d.indent ?? 0, d.bullet === "char") {
635
- const P = Ae(d.buChar, d.buFont ?? void 0);
636
- P !== "•" && (m.bulletChar = P);
634
+ if (p.bullet = d.bullet, p.marL = d.marL ?? 0, p.indent = d.indent ?? 0, d.bullet === "char") {
635
+ const P = Fe(d.buChar, d.buFont ?? void 0);
636
+ P !== "•" && (p.bulletChar = P);
637
637
  } else
638
- d.numType && d.numType !== "arabicPeriod" && (m.numType = d.numType), d.startAt && d.startAt !== 1 && (m.startAt = d.startAt);
639
- d.buClr && (m.bulletColor = d.buClr), d.buSz && Math.abs(d.buSz - 1) > 1e-3 && (m.bulletScale = d.buSz);
638
+ d.numType && d.numType !== "arabicPeriod" && (p.numType = d.numType), d.startAt && d.startAt !== 1 && (p.startAt = d.startAt);
639
+ d.buClr && (p.bulletColor = d.buClr), d.buSz && Math.abs(d.buSz - 1) > 1e-3 && (p.bulletScale = d.buSz);
640
640
  }
641
641
  const k = (P) => {
642
- const T = jt(d, Zt(P, e)), O = (T.sz ?? 18 * vt / H) * a, A = T.color === null ? void 0 : T.color ?? Kt("tx1", e);
642
+ const T = Dt(d, Zt(P, e)), A = (T.sz ?? 18 * vt / H) * a, E = T.color === null ? void 0 : T.color ?? Kt("tx1", e);
643
643
  return {
644
644
  text: "",
645
- size: O,
645
+ size: A,
646
646
  bold: T.b || void 0,
647
647
  italic: T.i || void 0,
648
648
  underline: T.u || void 0,
649
649
  strike: T.strike || void 0,
650
- color: A ?? void 0,
651
- font: Le(T.font ?? "+mn-lt", e.ctx.theme)
650
+ color: E ?? void 0,
651
+ font: je(T.font ?? "+mn-lt", e.ctx.theme)
652
652
  };
653
653
  };
654
- for (const P of R(h))
654
+ for (const P of I(g))
655
655
  if (P.localName === "r" || P.localName === "fld") {
656
- const T = E(P, "t")?.textContent ?? "";
656
+ const T = R(P, "t")?.textContent ?? "";
657
657
  if (!T) continue;
658
- T.split(/[\v\n]/).forEach((O, A) => {
659
- A > 0 && m.runs.push({ ...k(l(P, "rPr")), br: !0 }), O && m.runs.push({ ...k(l(P, "rPr")), text: O });
658
+ T.split(/[\v\n]/).forEach((A, E) => {
659
+ E > 0 && p.runs.push({ ...k(l(P, "rPr")), br: !0 }), A && p.runs.push({ ...k(l(P, "rPr")), text: A });
660
660
  });
661
- } else P.localName === "br" && m.runs.push({ ...k(l(P, "rPr")), br: !0 });
662
- m.endSize = k(l(h, "endParaRPr")).size;
663
- const M = (m.runs.length ? Math.max(...m.runs.map((P) => P.size ?? 0)) : m.endSize ?? 0) * 1.2 * (d.lnSpcPct ?? 1), S = (P) => P ? ("px" in P ? P.px : P.lines * M) * i : 0, v = S(d.spcBef), I = S(d.spcAft);
664
- v > 0.05 && (m.spaceBefore = Math.round(v * 100) / 100), I > 0.05 && (m.spaceAfter = Math.round(I * 100) / 100), f.push(m);
661
+ } else P.localName === "br" && p.runs.push({ ...k(l(P, "rPr")), br: !0 });
662
+ p.endSize = k(l(g, "endParaRPr")).size;
663
+ const M = (p.runs.length ? Math.max(...p.runs.map((P) => P.size ?? 0)) : p.endSize ?? 0) * 1.2 * (d.lnSpcPct ?? 1), S = (P) => P ? ("px" in P ? P.px : P.lines * M) * i : 0, v = S(d.spcBef), N = S(d.spcAft);
664
+ v > 0.05 && (p.spaceBefore = Math.round(v * 100) / 100), N > 0.05 && (p.spaceAfter = Math.round(N * 100) / 100), f.push(p);
665
665
  }
666
666
  return {
667
667
  paragraphs: f,
668
- anchor: y,
668
+ anchor: x,
669
669
  insets: { l: c("lIns", 91440), t: c("tIns", 45720), r: c("rIns", 91440), b: c("bIns", 45720) },
670
670
  wrap: r.wrap !== "none",
671
- lineSpacing: g
671
+ lineSpacing: m
672
672
  };
673
673
  }
674
674
  const Kt = (t, n) => {
675
675
  const e = n.ctx.clrMap[t] ?? St[t] ?? t, o = n.ctx.theme.colors[e];
676
676
  return o ? { hex: o } : null;
677
- }, J = (t) => {
677
+ }, q = (t) => {
678
678
  const n = l(t, "ph");
679
679
  return n ? { type: w(n, "type") || "obj", idx: C(n, "idx") } : null;
680
- }, at = (t) => l(R(t).find((n) => n.localName.startsWith("nv")) ?? null, "nvPr"), nt = /* @__PURE__ */ new Set(["title", "ctrTitle"]), $t = /* @__PURE__ */ new Set(["title", "ctrTitle", "dt", "ftr", "sldNum", "hdr"]), Bt = (t, n) => t === n || nt.has(t) && nt.has(n) || !$t.has(t) && !$t.has(n);
681
- function ct(t, n) {
682
- const e = Fe(t);
680
+ }, tt = (t) => l(I(t).find((n) => n.localName.startsWith("nv")) ?? null, "nvPr"), ot = /* @__PURE__ */ new Set(["title", "ctrTitle"]), $t = /* @__PURE__ */ new Set(["title", "ctrTitle", "dt", "ftr", "sldNum", "hdr"]), Bt = (t, n) => t === n || ot.has(t) && ot.has(n) || !$t.has(t) && !$t.has(n);
681
+ function ft(t, n) {
682
+ const e = De(t);
683
683
  if (n.idx) {
684
684
  const o = e.find((s) => s.ph.idx === n.idx && Bt(s.ph.type, n.type));
685
685
  if (o) return o.el;
686
686
  }
687
- return (e.find((o) => o.ph.type === n.type && (o.ph.idx === n.idx || !n.idx || nt.has(n.type))) ?? e.find((o) => o.ph.type === n.type) ?? e.find((o) => Bt(o.ph.type, n.type)))?.el ?? null;
687
+ return (e.find((o) => o.ph.type === n.type && (o.ph.idx === n.idx || !n.idx || ot.has(n.type))) ?? e.find((o) => o.ph.type === n.type) ?? e.find((o) => Bt(o.ph.type, n.type)))?.el ?? null;
688
688
  }
689
- function Fe(t) {
689
+ function De(t) {
690
690
  const n = [];
691
- for (const e of ut(t)) {
692
- const o = J(at(e));
691
+ for (const e of st(t)) {
692
+ const o = q(tt(e));
693
693
  o && n.push({ el: e, ph: o });
694
694
  }
695
695
  return n;
696
696
  }
697
- const Qt = (t) => nt.has(t) ? "title" : ["dt", "ftr", "sldNum", "hdr"].includes(t) ? t : "body", De = (t) => {
697
+ const Qt = (t) => ot.has(t) ? "title" : ["dt", "ftr", "sldNum", "hdr"].includes(t) ? t : "body", $e = (t) => {
698
698
  const n = {};
699
- for (const e of R(l(t, "avLst"), "gd")) {
699
+ for (const e of I(l(t, "avLst"), "gd")) {
700
700
  const o = w(e, "name"), s = w(e, "fmla");
701
701
  o && s && (n[o] = s);
702
702
  }
703
703
  return n;
704
704
  };
705
- function je(t) {
706
- const n = (r) => R(r, "gd").slice(0, 1e4).map((a) => [w(a, "name") || "", w(a, "fmla") || "val 0"]), e = R(l(t, "cxnLst"), "cxn").map((r) => [w(r, "ang") || "0", w(l(r, "pos"), "x") || "0", w(l(r, "pos"), "y") || "0"]), o = l(t, "rect"), s = R(l(t, "pathLst"), "path").slice(0, 1e3).map((r) => {
705
+ function Be(t) {
706
+ const n = (r) => I(r, "gd").slice(0, 1e4).map((a) => [w(a, "name") || "", w(a, "fmla") || "val 0"]), e = I(l(t, "cxnLst"), "cxn").map((r) => [w(r, "ang") || "0", w(l(r, "pos"), "x") || "0", w(l(r, "pos"), "y") || "0"]), o = l(t, "rect"), s = I(l(t, "pathLst"), "path").slice(0, 1e3).map((r) => {
707
707
  const a = [];
708
- for (const c of R(r)) {
709
- const y = R(c, "pt").map((x) => [w(x, "x") || "0", w(x, "y") || "0"]).flat();
708
+ for (const c of I(r)) {
709
+ const x = I(c, "pt").map((b) => [w(b, "x") || "0", w(b, "y") || "0"]).flat();
710
710
  switch (c.localName) {
711
711
  case "moveTo":
712
- a.push(["M", ...y]);
712
+ a.push(["M", ...x]);
713
713
  break;
714
714
  case "lnTo":
715
- a.push(["L", ...y]);
715
+ a.push(["L", ...x]);
716
716
  break;
717
717
  case "quadBezTo":
718
- a.push(["Q", ...y]);
718
+ a.push(["Q", ...x]);
719
719
  break;
720
720
  case "cubicBezTo":
721
- a.push(["C", ...y]);
721
+ a.push(["C", ...x]);
722
722
  break;
723
723
  case "arcTo":
724
724
  a.push(["A", w(c, "wR") || "0", w(c, "hR") || "0", w(c, "stAng") || "0", w(c, "swAng") || "0"]);
@@ -732,18 +732,18 @@ function je(t) {
732
732
  return { w: C(r, "w") || void 0, h: C(r, "h") || void 0, fill: i && i !== "norm" ? i : void 0, stroke: B(r, "stroke") === !1 ? !1 : void 0, d: a };
733
733
  });
734
734
  return {
735
- av: R(l(t, "avLst"), "gd").map((r) => [w(r, "name") || "", w(r, "fmla") || "val 0"]),
735
+ av: I(l(t, "avLst"), "gd").map((r) => [w(r, "name") || "", w(r, "fmla") || "val 0"]),
736
736
  gd: n(l(t, "gdLst")),
737
737
  cxn: e,
738
738
  rect: o ? [w(o, "l") || "l", w(o, "t") || "t", w(o, "r") || "r", w(o, "b") || "b"] : null,
739
739
  paths: s
740
740
  };
741
741
  }
742
- function tt(t, n) {
742
+ function et(t, n) {
743
743
  const e = l(t, "prstGeom");
744
744
  if (e) {
745
745
  const s = {};
746
- for (const [r, a] of Object.entries(De(e))) {
746
+ for (const [r, a] of Object.entries($e(e))) {
747
747
  const i = /^val\s+(-?\d+(\.\d+)?)/.exec(a);
748
748
  i && (s[r] = Number(i[1]));
749
749
  }
@@ -751,21 +751,21 @@ function tt(t, n) {
751
751
  }
752
752
  const o = l(t, "custGeom");
753
753
  if (o) {
754
- const s = je(o);
755
- return { geom: { kind: "custom", paths: it(s, n.w, n.h) }, textRect: s.rect ? Ut(s, n.w, n.h) : void 0 };
754
+ const s = Be(o);
755
+ return { geom: { kind: "custom", paths: lt(s, n.w, n.h) }, textRect: s.rect ? Ut(s, n.w, n.h) : void 0 };
756
756
  }
757
757
  }
758
- function et(t, n, e, o, s, r) {
758
+ function nt(t, n, e, o, s, r) {
759
759
  const a = [];
760
- if (s > ke)
760
+ if (s > Me)
761
761
  return e.warnings.push("Groups nested too deeply; the innermost were skipped."), a;
762
- for (const i of ut(t)) {
763
- if (++e.count > we) {
762
+ for (const i of st(t)) {
763
+ if (++e.count > ve) {
764
764
  e.warnings.push("Too many shapes on one slide; the rest were skipped.");
765
765
  break;
766
766
  }
767
767
  try {
768
- const c = $e(i, n, e, o, s, r);
768
+ const c = He(i, n, e, o, s, r);
769
769
  c && a.push(...Array.isArray(c) ? c : [c]);
770
770
  } catch {
771
771
  e.warnings.push(`A ${i.localName} couldn't be read and was skipped.`);
@@ -773,106 +773,130 @@ function et(t, n, e, o, s, r) {
773
773
  }
774
774
  return a;
775
775
  }
776
- function $e(t, n, e, o, s, r) {
777
- const a = { pkg: e.pkg, part: n.part, ctx: e.ctx }, i = R(t).find((f) => f.localName.startsWith("nv")), c = l(i ?? null, "cNvPr"), y = C(c, "id"), x = w(c, "name") || t.localName;
776
+ const ze = {
777
+ nextslide: "next",
778
+ previousslide: "previous",
779
+ firstslide: "first",
780
+ lastslide: "last",
781
+ endshow: "end"
782
+ };
783
+ function Xe(t, n, e) {
784
+ const o = l(t, "hlinkClick");
785
+ if (!o) return;
786
+ const s = w(o, "action") || "", r = e.rels(n).get(w(o, "r:id") || "");
787
+ if (s.startsWith("ppaction://hlinkshowjump")) {
788
+ const a = ze[(/jump=([a-z]+)/i.exec(s)?.[1] ?? "").toLowerCase()];
789
+ return a ? { kind: "action", action: a } : void 0;
790
+ }
791
+ if (s.startsWith("ppaction://hlinksldjump")) return r && !r.external ? { kind: "slide", key: r.target } : void 0;
792
+ if (!s)
793
+ return r?.external && /^(https?:|mailto:|tel:)/i.test(r.target) ? { kind: "url", url: r.target } : void 0;
794
+ }
795
+ function He(t, n, e, o, s, r) {
796
+ const a = I(t).find((x) => x.localName.startsWith("nv")), i = Ye(t, n, e, o, s, r), c = i ? Xe(l(a ?? null, "cNvPr"), n.part, e.pkg) : void 0;
797
+ if (c) for (const x of Array.isArray(i) ? i : [i]) x.link = c;
798
+ return i;
799
+ }
800
+ function Ye(t, n, e, o, s, r) {
801
+ const a = { pkg: e.pkg, part: n.part, ctx: e.ctx }, i = I(t).find((f) => f.localName.startsWith("nv")), c = l(i ?? null, "cNvPr"), x = C(c, "id"), b = w(c, "name") || t.localName;
778
802
  if (w(c, "hidden") === "1") return null;
779
803
  switch (t.localName) {
780
804
  case "sp":
781
- return Xe(t, n, e, o, y, x, r);
805
+ return Ue(t, n, e, o, x, b, r);
782
806
  case "cxnSp": {
783
- const f = l(t, "spPr"), g = Y(l(f, "xfrm"));
784
- if (!g) return null;
785
- const h = o(g), u = l(t, "style"), p = U(l(f, "ln"), a) ?? Pt(u, a) ?? { width: 1, color: { hex: "#000000" } };
786
- if (!p) return null;
787
- const b = tt(f, h) ?? { geom: { kind: "preset", prst: "line" } }, d = (k) => k ? { id: C(k, "id"), idx: C(k, "idx") } : void 0, m = l(i ?? null, "cNvCxnSpPr");
788
- return { kind: "connector", id: y, name: x, ...h, geom: b.geom, line: p, start: d(l(m, "stCxn")), end: d(l(m, "endCxn")) };
807
+ const f = l(t, "spPr"), m = Y(l(f, "xfrm"));
808
+ if (!m) return null;
809
+ const g = o(m), u = l(t, "style"), h = U(l(f, "ln"), a) ?? Pt(u, a) ?? { width: 1, color: { hex: "#000000" } };
810
+ if (!h) return null;
811
+ const y = et(f, g) ?? { geom: { kind: "preset", prst: "line" } }, d = (k) => k ? { id: C(k, "id"), idx: C(k, "idx") } : void 0, p = l(i ?? null, "cNvCxnSpPr");
812
+ return { kind: "connector", id: x, name: b, ...g, geom: y.geom, line: h, start: d(l(p, "stCxn")), end: d(l(p, "endCxn")) };
789
813
  }
790
814
  case "pic": {
791
815
  const f = l(t, "spPr");
792
- let g = Y(l(f, "xfrm"));
793
- const h = J(l(i ?? null, "nvPr"));
794
- if (!g && h && (g = Be(h, e)), !g) return null;
795
- const u = l(t, "blipFill"), p = u ? Vt(u, a) : null;
796
- if (!p)
797
- return e.warnings.push(`Picture "${x}" has no image the importer can read.`), null;
798
- const b = l(u, "srcRect"), d = b ? { l: C(b, "l") / 1e5, t: C(b, "t") / 1e5, r: C(b, "r") / 1e5, b: C(b, "b") / 1e5 } : void 0, m = w(E(u, "blip", "alphaModFix"), "amt"), k = o(g), M = tt(f, k)?.geom, S = M && !(M.kind === "preset" && M.prst === "rect") ? M : void 0;
799
- return { kind: "picture", id: y, name: x, ...k, media: p, crop: d, alpha: m !== null ? Number(m) / 1e5 : void 0, descr: w(c, "descr") || void 0, geom: S, ...E(u, "blip", "grayscl") ? { grayscale: !0 } : {} };
816
+ let m = Y(l(f, "xfrm"));
817
+ const g = q(l(i ?? null, "nvPr"));
818
+ if (!m && g && (m = We(g, e)), !m) return null;
819
+ const u = l(t, "blipFill"), h = u ? Vt(u, a) : null;
820
+ if (!h)
821
+ return e.warnings.push(`Picture "${b}" has no image the importer can read.`), null;
822
+ const y = l(u, "srcRect"), d = y ? { l: C(y, "l") / 1e5, t: C(y, "t") / 1e5, r: C(y, "r") / 1e5, b: C(y, "b") / 1e5 } : void 0, p = w(R(u, "blip", "alphaModFix"), "amt"), k = o(m), M = et(f, k)?.geom, S = M && !(M.kind === "preset" && M.prst === "rect") ? M : void 0;
823
+ return { kind: "picture", id: x, name: b, ...k, media: h, crop: d, alpha: p !== null ? Number(p) / 1e5 : void 0, descr: w(c, "descr") || void 0, geom: S, ...R(u, "blip", "grayscl") ? { grayscale: !0 } : {} };
800
824
  }
801
825
  case "grpSp": {
802
- const f = l(t, "grpSpPr"), g = l(f, "xfrm"), h = Ne(g, o), u = et(t, n, e, h, s + 1, r);
826
+ const f = l(t, "grpSpPr"), m = l(f, "xfrm"), g = Ae(m, o), u = nt(t, n, e, g, s + 1, r);
803
827
  if (!u.length) return null;
804
- const p = ft(u);
805
- return { kind: "group", id: y, name: x, ...p, children: u };
828
+ const h = ut(u);
829
+ return { kind: "group", id: x, name: b, ...h, children: u };
806
830
  }
807
831
  case "graphicFrame":
808
- return We(t, n, e, o, y, x, s);
832
+ return qe(t, n, e, o, x, b, s);
809
833
  default:
810
834
  return null;
811
835
  }
812
836
  }
813
- function ft(t) {
837
+ function ut(t) {
814
838
  let n = 1 / 0, e = 1 / 0, o = -1 / 0, s = -1 / 0;
815
839
  for (const r of t)
816
840
  n = Math.min(n, r.x), e = Math.min(e, r.y), o = Math.max(o, r.x + r.w), s = Math.max(s, r.y + r.h);
817
841
  return { x: n, y: e, w: Math.max(0, o - n), h: Math.max(0, s - e) };
818
842
  }
819
- function Be(t, n) {
820
- const e = ct(n.layout?.tree ?? null, t), o = Y(E(e, "spPr", "xfrm"));
843
+ function We(t, n) {
844
+ const e = ft(n.layout?.tree ?? null, t), o = Y(R(e, "spPr", "xfrm"));
821
845
  if (o) return o;
822
- const s = ct(n.master?.tree ?? null, { type: Qt(t.type), idx: 0 });
823
- return Y(E(s, "spPr", "xfrm"));
846
+ const s = ft(n.master?.tree ?? null, { type: Qt(t.type), idx: 0 });
847
+ return Y(R(s, "spPr", "xfrm"));
824
848
  }
825
- function ze(...t) {
849
+ function _e(...t) {
826
850
  for (const n of t) {
827
851
  const e = n();
828
852
  if (e !== void 0) return e;
829
853
  }
830
854
  }
831
- function Xe(t, n, e, o, s, r, a) {
832
- const i = { pkg: e.pkg, part: n.part, ctx: e.ctx }, c = at(t), y = J(c);
833
- if (y && !a) return null;
834
- const x = l(t, "spPr"), f = l(t, "style"), g = w(E(t, "nvSpPr", "cNvSpPr"), "txBox") === "1", h = y && e.layout ? ct(e.layout.tree, y) : null, u = y && e.master ? ct(e.master.tree, { type: Qt(h ? J(at(h))?.type ?? y.type : y.type), idx: 0 }) : null, p = h && e.layout ? { pkg: e.pkg, part: e.layout.part, ctx: e.ctx } : null, b = u && e.master ? { pkg: e.pkg, part: e.master.part, ctx: e.ctx } : null;
835
- let d = Y(l(x, "xfrm")) ?? Y(E(h, "spPr", "xfrm")) ?? Y(E(u, "spPr", "xfrm"));
855
+ function Ue(t, n, e, o, s, r, a) {
856
+ const i = { pkg: e.pkg, part: n.part, ctx: e.ctx }, c = tt(t), x = q(c);
857
+ if (x && !a) return null;
858
+ const b = l(t, "spPr"), f = l(t, "style"), m = w(R(t, "nvSpPr", "cNvSpPr"), "txBox") === "1", g = x && e.layout ? ft(e.layout.tree, x) : null, u = x && e.master ? ft(e.master.tree, { type: Qt(g ? q(tt(g))?.type ?? x.type : x.type), idx: 0 }) : null, h = g && e.layout ? { pkg: e.pkg, part: e.layout.part, ctx: e.ctx } : null, y = u && e.master ? { pkg: e.pkg, part: e.master.part, ctx: e.ctx } : null;
859
+ let d = Y(l(b, "xfrm")) ?? Y(R(g, "spPr", "xfrm")) ?? Y(R(u, "spPr", "xfrm"));
836
860
  if (!d) return null;
837
861
  d = o(d);
838
- const m = tt(x, d) ?? (h ? tt(l(h, "spPr"), d) : void 0) ?? (u ? tt(l(u, "spPr"), d) : void 0) ?? { geom: { kind: "preset", prst: "rect" } }, M = (B(t, "useBgFill") ? e.background?.kind === "image" ? { kind: "none" } : e.background ?? { kind: "solid", color: { hex: "#ffffff" } } : void 0) ?? V(x, i) ?? lt(f, i) ?? (p ? V(l(h, "spPr"), p) : void 0) ?? (b ? V(l(u, "spPr"), b) : void 0) ?? (p ? lt(l(h, "style"), p) : void 0) ?? { kind: "none" }, S = ze(
839
- () => U(l(x, "ln"), i),
862
+ const p = et(b, d) ?? (g ? et(l(g, "spPr"), d) : void 0) ?? (u ? et(l(u, "spPr"), d) : void 0) ?? { geom: { kind: "preset", prst: "rect" } }, M = (B(t, "useBgFill") ? e.background?.kind === "image" ? { kind: "none" } : e.background ?? { kind: "solid", color: { hex: "#ffffff" } } : void 0) ?? V(b, i) ?? ct(f, i) ?? (h ? V(l(g, "spPr"), h) : void 0) ?? (y ? V(l(u, "spPr"), y) : void 0) ?? (h ? ct(l(g, "style"), h) : void 0) ?? { kind: "none" }, S = _e(
863
+ () => U(l(b, "ln"), i),
840
864
  () => Pt(f, i),
841
- () => p ? U(E(h, "spPr", "ln"), p) : void 0,
842
- () => b ? U(E(u, "spPr", "ln"), b) : void 0
865
+ () => h ? U(R(g, "spPr", "ln"), h) : void 0,
866
+ () => y ? U(R(u, "spPr", "ln"), y) : void 0
843
867
  ) ?? null, v = [];
844
- if (y) {
845
- const D = h ? J(at(h))?.type ?? y.type : y.type;
846
- v.push(nt.has(D) ? e.masterTx.title : ["body", "obj", "subTitle", "tbl", "chart", "dgm", "media", "pic", "clipArt"].includes(D) ? e.masterTx.body : e.masterTx.other), v.push(E(u, "txBody", "lstStyle"), E(h, "txBody", "lstStyle"));
868
+ if (x) {
869
+ const j = g ? q(tt(g))?.type ?? x.type : x.type;
870
+ v.push(ot.has(j) ? e.masterTx.title : ["body", "obj", "subTitle", "tbl", "chart", "dgm", "media", "pic", "clipArt"].includes(j) ? e.masterTx.body : e.masterTx.other), v.push(R(u, "txBody", "lstStyle"), R(g, "txBody", "lstStyle"));
847
871
  } else
848
872
  v.push(e.defaultText);
849
- const I = l(f, "fontRef"), P = {
873
+ const N = l(f, "fontRef"), P = {
850
874
  levels: v,
851
- bodyPr: [E(u, "txBody", "bodyPr"), E(h, "txBody", "bodyPr")],
852
- fontRef: I ? { font: w(I, "idx") === "major" ? "+mj-lt" : "+mn-lt", color: $(I, i.ctx) } : void 0
875
+ bodyPr: [R(u, "txBody", "bodyPr"), R(g, "txBody", "bodyPr")],
876
+ fontRef: N ? { font: w(N, "idx") === "major" ? "+mj-lt" : "+mn-lt", color: $(N, i.ctx) } : void 0
853
877
  }, T = Tt(l(t, "txBody"), P, i);
854
878
  if (!(M.kind !== "none" || !!S || !!T)) return null;
855
- let A = m.textRect;
856
- const N = Y(l(x, "xfrm")), z = T ? Y(l(t, "txXfrm")) : null;
857
- if (z && N && N.w > 0 && N.h > 0) {
858
- const D = d.w / N.w, W = d.h / N.h, X = { l: (z.x - N.x) * D, t: (z.y - N.y) * W, r: (z.x + z.w - N.x) * D, b: (z.y + z.h - N.y) * W };
859
- (Math.abs(X.l) > 0.5 || Math.abs(X.t) > 0.5 || Math.abs(X.r - d.w) > 0.5 || Math.abs(X.b - d.h) > 0.5) && (A = X);
879
+ let E = p.textRect;
880
+ const O = Y(l(b, "xfrm")), z = T ? Y(l(t, "txXfrm")) : null;
881
+ if (z && O && O.w > 0 && O.h > 0) {
882
+ const j = d.w / O.w, W = d.h / O.h, X = { l: (z.x - O.x) * j, t: (z.y - O.y) * W, r: (z.x + z.w - O.x) * j, b: (z.y + z.h - O.y) * W };
883
+ (Math.abs(X.l) > 0.5 || Math.abs(X.t) > 0.5 || Math.abs(X.r - d.w) > 0.5 || Math.abs(X.b - d.h) > 0.5) && (E = X);
860
884
  }
861
- return { kind: "shape", id: s, name: r, ...d, geom: m.geom, fill: M, line: S, text: T, textBox: g || void 0, textRect: A };
885
+ return { kind: "shape", id: s, name: r, ...d, geom: p.geom, fill: M, line: S, text: T, textBox: m || void 0, textRect: E };
862
886
  }
863
887
  const zt = "{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}";
864
- function He(t, n) {
888
+ function Ge(t, n) {
865
889
  const e = {};
866
890
  if (!t) return e;
867
- const o = l(t, "tcStyle"), s = l(t, "tcTxStyle"), r = l(o, "fill"), a = r ? V(r, n) : lt(o, n);
891
+ const o = l(t, "tcStyle"), s = l(t, "tcTxStyle"), r = l(o, "fill"), a = r ? V(r, n) : ct(o, n);
868
892
  a && (e.fill = a);
869
893
  const i = $(s, n.ctx) ?? $(l(s, "fontRef"), n.ctx);
870
894
  i && (e.text = i), w(s, "b") === "on" && (e.bold = !0);
871
895
  const c = l(o, "tcBdr");
872
- for (const y of ["insideH", "bottom", "top", "left"]) {
873
- const x = l(c, y);
874
- if (!x) continue;
875
- const f = U(l(x, "ln"), n) ?? Pt(x, n);
896
+ for (const x of ["insideH", "bottom", "top", "left"]) {
897
+ const b = l(c, x);
898
+ if (!b) continue;
899
+ const f = U(l(b, "ln"), n) ?? Pt(b, n);
876
900
  if (f !== void 0) {
877
901
  e.border = f;
878
902
  break;
@@ -880,10 +904,10 @@ function He(t, n) {
880
904
  }
881
905
  return e;
882
906
  }
883
- function Ye(t, n, e) {
884
- const o = ((l(t, "tableStyleId")?.textContent || "").trim() || w(e, "def") || zt).toUpperCase(), s = (f) => B(t, f) ?? !1, r = { firstRow: s("firstRow"), lastRow: s("lastRow"), firstCol: s("firstCol"), lastCol: s("lastCol"), bandRow: s("bandRow"), bandCol: s("bandCol") }, a = R(e, "tblStyle").find((f) => (w(f, "styleId") || "").toUpperCase() === o);
907
+ function Ve(t, n, e) {
908
+ const o = ((l(t, "tableStyleId")?.textContent || "").trim() || w(e, "def") || zt).toUpperCase(), s = (f) => B(t, f) ?? !1, r = { firstRow: s("firstRow"), lastRow: s("lastRow"), firstCol: s("firstCol"), lastCol: s("lastCol"), bandRow: s("bandRow"), bandCol: s("bandCol") }, a = I(e, "tblStyle").find((f) => (w(f, "styleId") || "").toUpperCase() === o);
885
909
  if (a) {
886
- const f = (b) => He(l(a, b), n), g = l(a, "tblBg"), h = g ? l(g, "fill") ? V(l(g, "fill"), n) : lt(g, n) : void 0, u = {
910
+ const f = (y) => Ge(l(a, y), n), m = l(a, "tblBg"), g = m ? l(m, "fill") ? V(l(m, "fill"), n) : ct(m, n) : void 0, u = {
887
911
  whole: f("wholeTbl"),
888
912
  b1H: f("band1H"),
889
913
  b2H: f("band2H"),
@@ -893,69 +917,69 @@ function Ye(t, n, e) {
893
917
  lastRow: f("lastRow"),
894
918
  firstCol: f("firstCol"),
895
919
  lastCol: f("lastCol")
896
- }, p = (b, d, m, k) => {
897
- const M = [u.whole], S = b - (r.firstRow ? 1 : 0), v = d - (r.firstCol ? 1 : 0);
898
- r.bandCol && v >= 0 && M.push(v % 2 === 0 ? u.b1V : u.b2V), r.bandRow && S >= 0 && M.push(S % 2 === 0 ? u.b1H : u.b2H), r.firstCol && d === 0 && M.push(u.firstCol), r.lastCol && d === k - 1 && M.push(u.lastCol), r.firstRow && b === 0 && M.push(u.firstRow), r.lastRow && b === m - 1 && M.push(u.lastRow);
899
- const I = {};
920
+ }, h = (y, d, p, k) => {
921
+ const M = [u.whole], S = y - (r.firstRow ? 1 : 0), v = d - (r.firstCol ? 1 : 0);
922
+ r.bandCol && v >= 0 && M.push(v % 2 === 0 ? u.b1V : u.b2V), r.bandRow && S >= 0 && M.push(S % 2 === 0 ? u.b1H : u.b2H), r.firstCol && d === 0 && M.push(u.firstCol), r.lastCol && d === k - 1 && M.push(u.lastCol), r.firstRow && y === 0 && M.push(u.firstRow), r.lastRow && y === p - 1 && M.push(u.lastRow);
923
+ const N = {};
900
924
  for (const P of M)
901
- P.fill && (I.fill = P.fill), P.text && (I.text = P.text), P.bold && (I.bold = !0), P.border !== void 0 && (I.border = P.border);
902
- return I;
925
+ P.fill && (N.fill = P.fill), P.text && (N.text = P.text), P.bold && (N.bold = !0), P.border !== void 0 && (N.border = P.border);
926
+ return N;
903
927
  };
904
- return h && h.kind !== "none" && (p.background = h), p;
928
+ return g && g.kind !== "none" && (h.background = g), h;
905
929
  }
906
930
  if (o !== zt) return null;
907
931
  const i = n.ctx.theme.colors.accent1 ?? "#4472c4", c = (f) => {
908
- const [g, h, u] = Gt(i);
909
- return { hex: rt(_(Q(g) * f + (1 - f)), _(Q(h) * f + (1 - f)), _(Q(u) * f + (1 - f))) };
910
- }, y = { hex: n.ctx.theme.colors.lt1 ?? "#ffffff" }, x = Kt("tx1", n) ?? void 0;
932
+ const [m, g, u] = Gt(i);
933
+ return { hex: it(_(J(m) * f + (1 - f)), _(J(g) * f + (1 - f)), _(J(u) * f + (1 - f))) };
934
+ }, x = { hex: n.ctx.theme.colors.lt1 ?? "#ffffff" }, b = Kt("tx1", n) ?? void 0;
911
935
  return (f) => {
912
- const g = r.firstRow && f === 0, h = r.bandRow && !g && (f - (r.firstRow ? 1 : 0)) % 2 === 0;
936
+ const m = r.firstRow && f === 0, g = r.bandRow && !m && (f - (r.firstRow ? 1 : 0)) % 2 === 0;
913
937
  return {
914
- fill: { kind: "solid", color: g ? { hex: i } : c(h ? 0.4 : 0.2) },
915
- text: g ? y : x,
916
- bold: g || void 0,
917
- border: { width: 1.33, color: y }
938
+ fill: { kind: "solid", color: m ? { hex: i } : c(g ? 0.4 : 0.2) },
939
+ text: m ? x : b,
940
+ bold: m || void 0,
941
+ border: { width: 1.33, color: x }
918
942
  };
919
943
  };
920
944
  }
921
- function We(t, n, e, o, s, r, a = 0) {
945
+ function qe(t, n, e, o, s, r, a = 0) {
922
946
  const i = { pkg: e.pkg, part: n.part, ctx: e.ctx }, c = Y(l(t, "xfrm"));
923
947
  if (!c) return null;
924
- const y = E(t, "graphic", "graphicData"), x = l(y, "tbl");
925
- if (x) {
926
- const h = R(l(x, "tblGrid"), "gridCol").map((k) => L(C(k, "w"))), u = Ye(l(x, "tblPr"), i, e.tableStyles), p = [];
927
- let b = c.y, d = 1e6 + s * 1e3;
928
- const m = R(x, "tr");
929
- if (m.forEach((k, M) => {
948
+ const x = R(t, "graphic", "graphicData"), b = l(x, "tbl");
949
+ if (b) {
950
+ const g = I(l(b, "tblGrid"), "gridCol").map((k) => L(C(k, "w"))), u = Ve(l(b, "tblPr"), i, e.tableStyles), h = [];
951
+ let y = c.y, d = 1e6 + s * 1e3;
952
+ const p = I(b, "tr");
953
+ if (p.forEach((k, M) => {
930
954
  const S = L(C(k, "h"));
931
- let v = c.x, I = 0;
932
- for (const P of R(k, "tc")) {
933
- const T = Math.max(1, C(P, "gridSpan", 1)), O = h.slice(I, I + T).reduce((G, F) => G + F, 0);
934
- if (I += T, B(P, "hMerge") || B(P, "vMerge")) {
935
- v += O;
955
+ let v = c.x, N = 0;
956
+ for (const P of I(k, "tc")) {
957
+ const T = Math.max(1, C(P, "gridSpan", 1)), A = g.slice(N, N + T).reduce((G, F) => G + F, 0);
958
+ if (N += T, B(P, "hMerge") || B(P, "vMerge")) {
959
+ v += A;
936
960
  continue;
937
961
  }
938
- const A = Math.max(1, C(P, "rowSpan", 1)), N = l(P, "tcPr"), z = A > 1 ? S * A : S, D = u ? u(M, I - T, m.length, h.length) : null, W = D?.text ? { color: D.text } : void 0, X = Tt(l(P, "txBody"), { levels: [e.defaultText], bodyPr: [], fontRef: W }, i);
939
- X && D?.bold && X.paragraphs.forEach((G) => G.runs.forEach((F) => {
962
+ const E = Math.max(1, C(P, "rowSpan", 1)), O = l(P, "tcPr"), z = E > 1 ? S * E : S, j = u ? u(M, N - T, p.length, g.length) : null, W = j?.text ? { color: j.text } : void 0, X = Tt(l(P, "txBody"), { levels: [e.defaultText], bodyPr: [], fontRef: W }, i);
963
+ X && j?.bold && X.paragraphs.forEach((G) => G.runs.forEach((F) => {
940
964
  F.bold === void 0 && (F.bold = !0);
941
- })), X && (X.insets = { l: L(C(N, "marL", 91440)), r: L(C(N, "marR", 91440)), t: L(C(N, "marT", 45720)), b: L(C(N, "marB", 45720)) }, X.anchor = w(N, "anchor") === "ctr" ? "ctr" : w(N, "anchor") === "b" ? "b" : "t");
942
- const dt = U(l(N, "lnB"), i) ?? U(l(N, "lnT"), i) ?? (D ? D.border ?? null : { width: 1, color: { hex: "#bfbfbf" } }), ot = D?.fill;
943
- p.push({
965
+ })), X && (X.insets = { l: L(C(O, "marL", 91440)), r: L(C(O, "marR", 91440)), t: L(C(O, "marT", 45720)), b: L(C(O, "marB", 45720)) }, X.anchor = w(O, "anchor") === "ctr" ? "ctr" : w(O, "anchor") === "b" ? "b" : "t");
966
+ const dt = U(l(O, "lnB"), i) ?? U(l(O, "lnT"), i) ?? (j ? j.border ?? null : { width: 1, color: { hex: "#bfbfbf" } }), rt = j?.fill;
967
+ h.push({
944
968
  kind: "shape",
945
969
  id: d++,
946
970
  name: `${r} cell`,
947
- ...o({ x: v, y: b, w: O, h: z, rot: 0, flipH: !1, flipV: !1 }),
971
+ ...o({ x: v, y, w: A, h: z, rot: 0, flipH: !1, flipV: !1 }),
948
972
  geom: { kind: "preset", prst: "rect" },
949
- fill: V(N, i) ?? ot ?? { kind: "none" },
973
+ fill: V(O, i) ?? rt ?? { kind: "none" },
950
974
  line: dt,
951
975
  text: X
952
- }), v += O;
976
+ }), v += A;
953
977
  }
954
- b += S;
955
- }), !p.length) return null;
978
+ y += S;
979
+ }), !h.length) return null;
956
980
  if (u?.background) {
957
- const k = ft(p);
958
- p.unshift({
981
+ const k = ut(h);
982
+ h.unshift({
959
983
  kind: "shape",
960
984
  id: d++,
961
985
  name: `${r} background`,
@@ -971,17 +995,17 @@ function We(t, n, e, o, s, r, a = 0) {
971
995
  line: null
972
996
  });
973
997
  }
974
- return { kind: "group", id: s, name: r, ...ft(p), children: p };
998
+ return { kind: "group", id: s, name: r, ...ut(h), children: h };
975
999
  }
976
- const f = w(y, "uri") || "";
1000
+ const f = w(x, "uri") || "";
977
1001
  if (/diagram/.test(f)) {
978
- const h = _e(y, n, e, o, c, s, r, a);
979
- if (h) return h;
980
- const u = Ue(y, n, e, o, c, s, r, i);
1002
+ const g = Ze(x, n, e, o, c, s, r, a);
1003
+ if (g) return g;
1004
+ const u = Ke(x, n, e, o, c, s, r, i);
981
1005
  if (u) return u;
982
1006
  }
983
- const g = /chart/.test(f) ? "Chart" : /diagram/.test(f) ? "SmartArt diagram" : "Embedded object";
984
- return e.warnings.push(`${g} "${r}" was imported as a placeholder frame.`), {
1007
+ const m = /chart/.test(f) ? "Chart" : /diagram/.test(f) ? "SmartArt diagram" : "Embedded object";
1008
+ return e.warnings.push(`${m} "${r}" was imported as a placeholder frame.`), {
985
1009
  kind: "shape",
986
1010
  id: s,
987
1011
  name: r,
@@ -989,64 +1013,64 @@ function We(t, n, e, o, s, r, a = 0) {
989
1013
  geom: { kind: "preset", prst: "rect" },
990
1014
  fill: { kind: "solid", color: { hex: "#f1f3f5" } },
991
1015
  line: { width: 1, color: { hex: "#adb5bd" }, dash: "dash" },
992
- text: { paragraphs: [{ runs: [{ text: `${g}: ${r}`, size: 16, color: { hex: "#495057" } }], align: "ctr" }], anchor: "ctr", insets: { l: 8, t: 8, r: 8, b: 8 }, wrap: !0 }
1016
+ text: { paragraphs: [{ runs: [{ text: `${m}: ${r}`, size: 16, color: { hex: "#495057" } }], align: "ctr" }], anchor: "ctr", insets: { l: 8, t: 8, r: 8, b: 8 }, wrap: !0 }
993
1017
  };
994
1018
  }
995
- function _e(t, n, e, o, s, r, a, i) {
996
- const c = e.pkg.rels(n.part), y = w(l(t, "relIds"), "r:dm"), x = y ? c.get(y) : void 0;
1019
+ function Ze(t, n, e, o, s, r, a, i) {
1020
+ const c = e.pkg.rels(n.part), x = w(l(t, "relIds"), "r:dm"), b = x ? c.get(x) : void 0;
997
1021
  let f;
998
- if (x && !x.external) {
999
- const d = Jt(e.pkg.xml(x.target), "dataModelExt", 6), m = d ? c.get(w(d, "relId") || "") : void 0;
1000
- m && !m.external && (f = m.target);
1022
+ if (b && !b.external) {
1023
+ const d = Jt(e.pkg.xml(b.target), "dataModelExt", 6), p = d ? c.get(w(d, "relId") || "") : void 0;
1024
+ p && !p.external && (f = p.target);
1001
1025
  }
1002
1026
  if (!f) {
1003
- const d = [...c.values()].filter((m) => m.type === "diagramDrawing" && !m.external);
1027
+ const d = [...c.values()].filter((p) => p.type === "diagramDrawing" && !p.external);
1004
1028
  d.length === 1 && (f = d[0].target);
1005
1029
  }
1006
1030
  if (!f) return null;
1007
- const g = l(e.pkg.xml(f), "spTree");
1008
- if (!g) return null;
1009
- const u = et(g, { part: f, tree: g }, e, (d) => o({ ...d, x: d.x + s.x, y: d.y + s.y }), i + 1, !0);
1031
+ const m = l(e.pkg.xml(f), "spTree");
1032
+ if (!m) return null;
1033
+ const u = nt(m, { part: f, tree: m }, e, (d) => o({ ...d, x: d.x + s.x, y: d.y + s.y }), i + 1, !0);
1010
1034
  if (!u.length) return null;
1011
- let p = 2e6 + r * 1e3;
1012
- const b = (d) => d.forEach((m) => {
1013
- m.id = p++, m.kind === "group" && b(m.children);
1035
+ let h = 2e6 + r * 1e3;
1036
+ const y = (d) => d.forEach((p) => {
1037
+ p.id = h++, p.kind === "group" && y(p.children);
1014
1038
  });
1015
- return b(u), { kind: "group", id: r, name: a, ...ft(u), children: u };
1016
- }
1017
- function Ue(t, n, e, o, s, r, a, i) {
1018
- const c = w(l(t, "relIds"), "r:dm"), y = c ? e.pkg.rels(n.part).get(c) : void 0;
1019
- if (!y || y.external) return null;
1020
- const x = e.pkg.xml(y.target), f = /* @__PURE__ */ new Map();
1021
- for (const d of R(l(x, "ptLst"), "pt")) f.set(w(d, "modelId") || "", d);
1022
- const g = /* @__PURE__ */ new Map();
1023
- for (const d of R(l(x, "cxnLst"), "cxn")) {
1039
+ return y(u), { kind: "group", id: r, name: a, ...ut(u), children: u };
1040
+ }
1041
+ function Ke(t, n, e, o, s, r, a, i) {
1042
+ const c = w(l(t, "relIds"), "r:dm"), x = c ? e.pkg.rels(n.part).get(c) : void 0;
1043
+ if (!x || x.external) return null;
1044
+ const b = e.pkg.xml(x.target), f = /* @__PURE__ */ new Map();
1045
+ for (const d of I(l(b, "ptLst"), "pt")) f.set(w(d, "modelId") || "", d);
1046
+ const m = /* @__PURE__ */ new Map();
1047
+ for (const d of I(l(b, "cxnLst"), "cxn")) {
1024
1048
  if ((w(d, "type") || "parOf") !== "parOf") continue;
1025
- const m = w(d, "srcId") || "", k = w(d, "destId") || "";
1026
- g.has(m) || g.set(m, []), g.get(m).push({ id: k, ord: C(d, "srcOrd") });
1049
+ const p = w(d, "srcId") || "", k = w(d, "destId") || "";
1050
+ m.has(p) || m.set(p, []), m.get(p).push({ id: k, ord: C(d, "srcOrd") });
1027
1051
  }
1028
- const h = [...f.values()].find((d) => w(d, "type") === "doc");
1029
- if (!h) return null;
1030
- const u = [], p = /* @__PURE__ */ new Set(), b = (d, m) => {
1031
- if (!(p.has(d) || m > 16 || u.length > 500)) {
1032
- p.add(d);
1033
- for (const k of (g.get(d) ?? []).sort((M, S) => M.ord - S.ord)) {
1052
+ const g = [...f.values()].find((d) => w(d, "type") === "doc");
1053
+ if (!g) return null;
1054
+ const u = [], h = /* @__PURE__ */ new Set(), y = (d, p) => {
1055
+ if (!(h.has(d) || p > 16 || u.length > 500)) {
1056
+ h.add(d);
1057
+ for (const k of (m.get(d) ?? []).sort((M, S) => M.ord - S.ord)) {
1034
1058
  const M = f.get(k.id), S = w(M, "type") || "node";
1035
1059
  if (!M || S !== "node" && S !== "asst") continue;
1036
1060
  const v = Tt(l(M, "t"), { levels: [e.defaultText], bodyPr: [] }, i);
1037
- for (const I of v?.paragraphs ?? [])
1038
- I.runs.some((P) => !P.br && P.text.trim()) && u.push({
1039
- ...I,
1061
+ for (const N of v?.paragraphs ?? [])
1062
+ N.runs.some((P) => !P.br && P.text.trim()) && u.push({
1063
+ ...N,
1040
1064
  align: "l",
1041
- level: m,
1042
- ...m > 0 ? { bullet: "char" } : {},
1043
- runs: I.runs.map((P) => ({ ...P, size: P.size ?? (m > 0 ? 16 : 18), bold: P.bold ?? (m === 0 ? !0 : void 0) }))
1065
+ level: p,
1066
+ ...p > 0 ? { bullet: "char" } : {},
1067
+ runs: N.runs.map((P) => ({ ...P, size: P.size ?? (p > 0 ? 16 : 18), bold: P.bold ?? (p === 0 ? !0 : void 0) }))
1044
1068
  });
1045
- b(k.id, m + 1);
1069
+ y(k.id, p + 1);
1046
1070
  }
1047
1071
  }
1048
1072
  };
1049
- return b(w(h, "modelId") || "", 0), u.length ? (e.warnings.push(`SmartArt diagram "${a}" had no saved drawing; its text was imported as a list.`), {
1073
+ return y(w(g, "modelId") || "", 0), u.length ? (e.warnings.push(`SmartArt diagram "${a}" had no saved drawing; its text was imported as a list.`), {
1050
1074
  kind: "shape",
1051
1075
  id: r,
1052
1076
  name: a,
@@ -1060,7 +1084,7 @@ function Ue(t, n, e, o, s, r, a, i) {
1060
1084
  }
1061
1085
  function Jt(t, n, e) {
1062
1086
  if (!t || e < 0) return null;
1063
- for (const o of ut(t)) {
1087
+ for (const o of st(t)) {
1064
1088
  if (o.localName === n) return o;
1065
1089
  const s = Jt(o, n, e - 1);
1066
1090
  if (s) return s;
@@ -1079,10 +1103,36 @@ function xt(t, n) {
1079
1103
  return (i ? Ct(i, { ...n, ctx: { ...n.ctx, phClr: $(s, n.ctx) ?? void 0 } }) : void 0) ?? ($(s, n.ctx) ? { kind: "solid", color: $(s, n.ctx) } : void 0);
1080
1104
  }
1081
1105
  }
1082
- function Ge(t) {
1083
- const n = ut(t).find((a) => a.localName === "transition");
1106
+ function Qe(t, n) {
1107
+ const e = t.relOfType(n, "notesSlide"), o = e ? R(t.xml(e), "cSld", "spTree") : null;
1108
+ if (!o) return;
1109
+ const s = [], r = (i) => {
1110
+ for (const c of st(i)) {
1111
+ if (c.localName === "grpSp") {
1112
+ r(c);
1113
+ continue;
1114
+ }
1115
+ if (c.localName !== "sp") continue;
1116
+ const x = q(tt(c));
1117
+ if (!(!x || x.type !== "body" && x.type !== "obj"))
1118
+ for (const b of I(l(c, "txBody"), "p")) {
1119
+ let f = "";
1120
+ for (const m of I(b))
1121
+ m.localName === "r" || m.localName === "fld" ? f += l(m, "t")?.textContent ?? "" : m.localName === "br" && (f += `
1122
+ `);
1123
+ s.push(f);
1124
+ }
1125
+ }
1126
+ };
1127
+ r(o);
1128
+ const a = s.join(`
1129
+ `).replace(/\s+$/, "");
1130
+ return a.trim() ? a : void 0;
1131
+ }
1132
+ function Je(t) {
1133
+ const n = st(t).find((a) => a.localName === "transition");
1084
1134
  if (!n) return;
1085
- const e = R(n).find((a) => a.localName !== "sndAc" && a.localName !== "extLst");
1135
+ const e = I(n).find((a) => a.localName !== "sndAc" && a.localName !== "extLst");
1086
1136
  if (!e) return;
1087
1137
  const o = w(n, "spd"), s = w(n, "p14:dur") !== null ? C(n, "p14:dur") : o === "fast" ? 500 : o === "slow" ? 1e3 : 750, r = w(e, "dir");
1088
1138
  switch (e.localName) {
@@ -1099,72 +1149,72 @@ function Ge(t) {
1099
1149
  return { kind: "fade", durationMs: s };
1100
1150
  }
1101
1151
  }
1102
- function Ve(t, n = {}) {
1152
+ function tn(t, n = {}) {
1103
1153
  const e = [], o = (T) => {
1104
1154
  e.length < 200 && !e.includes(T) && e.push(T);
1105
1155
  }, s = n.parseXml ?? ((T) => new DOMParser().parseFromString(T, "application/xml"));
1106
1156
  let r, a = 0, i = 0;
1107
1157
  try {
1108
1158
  r = ae(t, {
1109
- filter: (T) => (a++, i += T.originalSize, a <= Et && T.originalSize <= be && i <= At)
1159
+ filter: (T) => (a++, i += T.originalSize, a <= At && T.originalSize <= ke && i <= Et)
1110
1160
  });
1111
1161
  } catch {
1112
1162
  throw new Error("This file is not a PowerPoint presentation (it is not a valid .pptx package).");
1113
1163
  }
1114
- (a > Et || i > At) && o("The file is very large; some parts were skipped.");
1115
- const c = new Se(r, s, o), y = c.relOfType("", "officeDocument") ?? "ppt/presentation.xml", x = c.xml(y);
1116
- if (!x || x.localName !== "presentation") throw new Error("This file is not a PowerPoint presentation (no presentation part).");
1117
- const f = l(x, "sldSz"), g = f ? Math.max(1, L(C(f, "cx", 9144e3))) : 960, h = f ? Math.max(1, L(C(f, "cy", 5143500))) : 540, u = l(x, "defaultTextStyle"), p = c.rels(y), b = c.relOfType(y, "tableStyles"), d = b ? c.xml(b) : null, m = [], k = /* @__PURE__ */ new Set();
1118
- for (const T of R(l(x, "sldIdLst"), "sldId")) {
1119
- const O = p.get(w(T, "r:id") || "");
1120
- O && !k.has(O.target) && m.length < ye && (k.add(O.target), m.push(O.target));
1164
+ (a > At || i > Et) && o("The file is very large; some parts were skipped.");
1165
+ const c = new Pe(r, s, o), x = c.relOfType("", "officeDocument") ?? "ppt/presentation.xml", b = c.xml(x);
1166
+ if (!b || b.localName !== "presentation") throw new Error("This file is not a PowerPoint presentation (no presentation part).");
1167
+ const f = l(b, "sldSz"), m = f ? Math.max(1, L(C(f, "cx", 9144e3))) : 960, g = f ? Math.max(1, L(C(f, "cy", 5143500))) : 540, u = l(b, "defaultTextStyle"), h = c.rels(x), y = c.relOfType(x, "tableStyles"), d = y ? c.xml(y) : null, p = [], k = /* @__PURE__ */ new Set();
1168
+ for (const T of I(l(b, "sldIdLst"), "sldId")) {
1169
+ const A = h.get(w(T, "r:id") || "");
1170
+ A && !k.has(A.target) && p.length < we && (k.add(A.target), p.push(A.target));
1121
1171
  }
1122
1172
  const M = /* @__PURE__ */ new Map(), S = (T) => {
1123
- const O = c.relOfType(T, "theme");
1124
- return O ? (M.has(O) || M.set(O, pt(c.xml(O))), M.get(O)) : pt(null);
1173
+ const A = c.relOfType(T, "theme");
1174
+ return A ? (M.has(A) || M.set(A, pt(c.xml(A))), M.get(A)) : pt(null);
1125
1175
  }, v = (T) => {
1126
1176
  if (!T) return null;
1127
- const O = {};
1128
- for (let A = 0; A < T.attributes.length; A++) O[T.attributes[A].localName ?? T.attributes[A].name] = T.attributes[A].value;
1129
- return O;
1130
- }, I = [];
1131
- m.forEach((T, O) => {
1132
- const A = c.xml(T);
1133
- if (!A) {
1134
- o(`Slide ${O + 1} couldn't be read and was skipped.`);
1177
+ const A = {};
1178
+ for (let E = 0; E < T.attributes.length; E++) A[T.attributes[E].localName ?? T.attributes[E].name] = T.attributes[E].value;
1179
+ return A;
1180
+ }, N = [];
1181
+ p.forEach((T, A) => {
1182
+ const E = c.xml(T);
1183
+ if (!E) {
1184
+ o(`Slide ${A + 1} couldn't be read and was skipped.`);
1135
1185
  return;
1136
1186
  }
1137
- const N = c.relOfType(T, "slideLayout"), z = N ? c.xml(N) : null, D = N ? c.relOfType(N, "slideMaster") : null, W = D ? c.xml(D) : null, X = D ? S(D) : pt(null), dt = v(E(A, "clrMapOvr", "overrideClrMapping")) ?? v(E(z, "clrMapOvr", "overrideClrMapping")) ?? v(l(W, "clrMap")) ?? St, ot = { theme: X, clrMap: dt }, G = l(W, "txStyles"), F = {
1187
+ const O = c.relOfType(T, "slideLayout"), z = O ? c.xml(O) : null, j = O ? c.relOfType(O, "slideMaster") : null, W = j ? c.xml(j) : null, X = j ? S(j) : pt(null), dt = v(R(E, "clrMapOvr", "overrideClrMapping")) ?? v(R(z, "clrMapOvr", "overrideClrMapping")) ?? v(l(W, "clrMap")) ?? St, rt = { theme: X, clrMap: dt }, G = l(W, "txStyles"), F = {
1138
1188
  pkg: c,
1139
- ctx: ot,
1140
- slide: { part: T, tree: E(A, "cSld", "spTree") },
1141
- layout: N ? { part: N, tree: E(z, "cSld", "spTree") } : null,
1142
- master: D ? { part: D, tree: E(W, "cSld", "spTree") } : null,
1189
+ ctx: rt,
1190
+ slide: { part: T, tree: R(E, "cSld", "spTree") },
1191
+ layout: O ? { part: O, tree: R(z, "cSld", "spTree") } : null,
1192
+ master: j ? { part: j, tree: R(W, "cSld", "spTree") } : null,
1143
1193
  masterTx: { title: l(G, "titleStyle"), body: l(G, "bodyStyle"), other: l(G, "otherStyle") },
1144
1194
  defaultText: u,
1145
1195
  warnings: e,
1146
1196
  count: 0,
1147
1197
  tableStyles: d
1148
- }, ht = (re) => ({ pkg: c, part: re?.part ?? T, ctx: ot }), It = xt(l(A, "cSld"), ht(F.slide)) ?? xt(l(z, "cSld"), ht(F.layout)) ?? xt(l(W, "cSld"), ht(F.master)) ?? { kind: "solid", color: { hex: "#ffffff" } };
1198
+ }, ht = (re) => ({ pkg: c, part: re?.part ?? T, ctx: rt }), It = xt(l(E, "cSld"), ht(F.slide)) ?? xt(l(z, "cSld"), ht(F.layout)) ?? xt(l(W, "cSld"), ht(F.master)) ?? { kind: "solid", color: { hex: "#ffffff" } };
1149
1199
  F.background = It;
1150
- const st = [], se = B(A, "showMasterSp") !== !1 && B(z, "showMasterSp") !== !1;
1151
- F.master && se && st.push(...et(F.master.tree, F.master, F, gt, 0, !1)), F.layout && B(A, "showMasterSp") !== !1 && st.push(...et(F.layout.tree, F.layout, F, gt, 0, !1)), st.push(...et(F.slide.tree, F.slide, F, gt, 0, !0)), I.push({ items: st, background: It, transition: Ge(A), name: w(l(A, "cSld"), "name") || void 0 });
1152
- }), I.length || o("The presentation has no slides.");
1153
- const P = E(c.xml("docProps/core.xml"), "title")?.textContent || void 0;
1154
- return { deck: { width: g, height: h, slides: I, title: P }, warnings: e };
1200
+ const at = [], se = B(E, "showMasterSp") !== !1 && B(z, "showMasterSp") !== !1;
1201
+ F.master && se && at.push(...nt(F.master.tree, F.master, F, gt, 0, !1)), F.layout && B(E, "showMasterSp") !== !1 && at.push(...nt(F.layout.tree, F.layout, F, gt, 0, !1)), at.push(...nt(F.slide.tree, F.slide, F, gt, 0, !0)), N.push({ items: at, background: It, transition: Je(E), name: w(l(E, "cSld"), "name") || void 0, notes: Qe(c, T), key: T });
1202
+ }), N.length || o("The presentation has no slides.");
1203
+ const P = R(c.xml("docProps/core.xml"), "title")?.textContent || void 0;
1204
+ return { deck: { width: m, height: g, slides: N, title: P }, warnings: e };
1155
1205
  }
1156
- const qe = 80, Ze = "default-layer", j = (t) => {
1206
+ const en = 80, nn = "default-layer", D = (t) => {
1157
1207
  if (!t) return "transparent";
1158
1208
  if (t.alpha === void 0 || t.alpha >= 0.999) return t.hex;
1159
1209
  const n = t.hex.replace("#", "");
1160
1210
  return `rgba(${parseInt(n.slice(0, 2), 16)}, ${parseInt(n.slice(2, 4), 16)}, ${parseInt(n.slice(4, 6), 16)}, ${+t.alpha.toFixed(3)})`;
1161
- }, Ke = /(times|georgia|garamond|cambria|book|serif|palatino|baskerville|merriweather)/i, Qe = /(courier|consolas|mono|menlo|code)/i;
1211
+ }, on = /(times|georgia|garamond|cambria|book|serif|palatino|baskerville|merriweather)/i, sn = /(courier|consolas|mono|menlo|code)/i;
1162
1212
  function Xt(t) {
1163
1213
  if (!t) return "sans-serif";
1164
- const n = fe(t);
1165
- return n || (Qe.test(t) ? "monospace" : Ke.test(t) ? "serif" : "sans-serif");
1214
+ const n = de(t);
1215
+ return n || (sn.test(t) ? "monospace" : on.test(t) ? "serif" : "sans-serif");
1166
1216
  }
1167
- function Je(t) {
1217
+ function rn(t) {
1168
1218
  const n = [];
1169
1219
  let e = [], o = !1;
1170
1220
  const s = () => {
@@ -1189,8 +1239,15 @@ function Je(t) {
1189
1239
  } else r.op === "Z" && (o = !0, s());
1190
1240
  return s(), n;
1191
1241
  }
1192
- const tn = (t, n, e) => t.map((o) => o.op === "Z" ? o : o.op === "C" ? { ...o, x1: o.x1 + n, y1: o.y1 + e, x2: o.x2 + n, y2: o.y2 + e, x: o.x + n, y: o.y + e } : { ...o, x: o.x + n, y: o.y + e });
1193
- async function en(t) {
1242
+ const an = (t, n, e) => t.map((o) => o.op === "Z" ? o : o.op === "C" ? { ...o, x1: o.x1 + n, y1: o.y1 + e, x2: o.x2 + n, y2: o.y2 + e, x: o.x + n, y: o.y + e } : { ...o, x: o.x + n, y: o.y + e });
1243
+ function ln(t, n) {
1244
+ if (!t) return null;
1245
+ if (t.kind === "url") return t.url;
1246
+ if (t.kind === "action") return fe(t.action);
1247
+ const e = n.slideIds?.get(t.key);
1248
+ return e ? ue(e) : null;
1249
+ }
1250
+ async function cn(t) {
1194
1251
  if (!(typeof document > "u"))
1195
1252
  try {
1196
1253
  const n = new Image();
@@ -1203,7 +1260,7 @@ async function en(t) {
1203
1260
  return;
1204
1261
  }
1205
1262
  }
1206
- async function nn(t, n) {
1263
+ async function fn(t, n) {
1207
1264
  const e = /* @__PURE__ */ new Set(), o = (r) => {
1208
1265
  for (const a of r)
1209
1266
  if (a.kind === "group") o(a.children);
@@ -1218,11 +1275,11 @@ async function nn(t, n) {
1218
1275
  t.slides.forEach((r) => o(r.items));
1219
1276
  const s = /* @__PURE__ */ new Map();
1220
1277
  return await Promise.all([...e].map(async (r) => {
1221
- const a = await en(r);
1278
+ const a = await cn(r);
1222
1279
  a && s.set(r, a);
1223
1280
  })), s;
1224
1281
  }
1225
- async function on(t, n, e, o) {
1282
+ async function un(t, n, e, o) {
1226
1283
  if (!(typeof document > "u"))
1227
1284
  try {
1228
1285
  const s = new Image();
@@ -1244,7 +1301,7 @@ async function on(t, n, e, o) {
1244
1301
  return;
1245
1302
  }
1246
1303
  }
1247
- function q(t, n, e, o) {
1304
+ function Z(t, n, e, o) {
1248
1305
  return {
1249
1306
  id: t.nextId(n),
1250
1307
  type: n,
@@ -1265,7 +1322,7 @@ function q(t, n, e, o) {
1265
1322
  opacity: 100,
1266
1323
  seed: 1,
1267
1324
  locked: !1,
1268
- layerId: Ze,
1325
+ layerId: nn,
1269
1326
  groupIds: [...o].reverse(),
1270
1327
  // innermost first, the store's convention
1271
1328
  name: e.name
@@ -1277,14 +1334,14 @@ function Ht(t, n, e) {
1277
1334
  t.backgroundColor = "transparent";
1278
1335
  break;
1279
1336
  case "solid":
1280
- t.backgroundColor = j(n.color), t.fillStyle = "solid";
1337
+ t.backgroundColor = D(n.color), t.fillStyle = "solid";
1281
1338
  break;
1282
1339
  case "linear":
1283
1340
  case "radial":
1284
- t.fillStyle = n.kind, t.backgroundColor = j(n.stops[0]?.color), t.gradientStops = n.stops.map((o) => ({ offset: o.pos, color: j(o.color) })), n.kind === "linear" && (t.gradientDirection = n.angle);
1341
+ t.fillStyle = n.kind, t.backgroundColor = D(n.stops[0]?.color), t.gradientStops = n.stops.map((o) => ({ offset: o.pos, color: D(o.color) })), n.kind === "linear" && (t.gradientDirection = n.angle);
1285
1342
  break;
1286
1343
  case "pattern": {
1287
- t.backgroundColor = j(n.color), t.fillStyle = "pattern", t.patternFill = mn(n.preset, j(n.color), n.bg ? j(n.bg) : "transparent");
1344
+ t.backgroundColor = D(n.color), t.fillStyle = "pattern", t.patternFill = Mn(n.preset, D(n.color), n.bg ? D(n.bg) : "transparent");
1288
1345
  break;
1289
1346
  }
1290
1347
  case "image": {
@@ -1299,59 +1356,59 @@ function kt(t, n) {
1299
1356
  t.strokeColor = "transparent", t.strokeWidth = 0;
1300
1357
  return;
1301
1358
  }
1302
- t.strokeColor = j(n.color), t.strokeWidth = Math.max(0.5, n.width), t.strokeStyle = n.dash === "sysDot" ? "dotted" : n.dash ? "dashed" : "solid", (n.join === "miter" || n.join === "bevel") && (t.strokeLineJoin = n.join), n.cap === "flat" ? t.strokeLineCap = "butt" : n.cap === "sq" && (t.strokeLineCap = "square");
1359
+ t.strokeColor = D(n.color), t.strokeWidth = Math.max(0.5, n.width), t.strokeStyle = n.dash === "sysDot" ? "dotted" : n.dash ? "dashed" : "solid", (n.join === "miter" || n.join === "bevel") && (t.strokeLineJoin = n.join), n.cap === "flat" ? t.strokeLineCap = "butt" : n.cap === "sq" && (t.strokeLineCap = "square");
1303
1360
  }
1304
- function sn(t) {
1361
+ function dn(t) {
1305
1362
  const n = /^(alphaLc|alphaUc|arabic|romanLc|romanUc)(ParenBoth|ParenR|Period|Plain)$/.exec(t ?? "");
1306
1363
  if (!n) return {};
1307
1364
  const e = { alphaLc: "lower-alpha", alphaUc: "upper-alpha", romanLc: "lower-roman", romanUc: "upper-roman", arabic: void 0 }[n[1]], o = { ParenBoth: "parens", ParenR: "paren", Plain: "none", Period: void 0 }[n[2]], s = {};
1308
1365
  return e && (s.listNumberStyle = e), o && (s.listNumberSuffix = o), s;
1309
1366
  }
1310
- function rn(t, n) {
1311
- const e = t.bullet === "num" ? sn(t.numType) : t.bulletChar ? { listMarker: t.bulletChar } : {}, o = t.runs.find((s) => !s.br)?.color ?? n.defaults?.color;
1312
- return t.bulletColor && j(t.bulletColor) !== j(o) && (e.listMarkerColor = j(t.bulletColor)), t.bulletScale && (e.listMarkerScale = Math.round(t.bulletScale * 100) / 100), t.marL !== void 0 && (e.listIndent = Math.max(0, Math.round(t.marL * 10) / 10), e.listMarkerIndent = Math.max(0, Math.round((t.marL + (t.indent ?? 0)) * 10) / 10)), e;
1367
+ function hn(t, n) {
1368
+ const e = t.bullet === "num" ? dn(t.numType) : t.bulletChar ? { listMarker: t.bulletChar } : {}, o = t.runs.find((s) => !s.br)?.color ?? n.defaults?.color;
1369
+ return t.bulletColor && D(t.bulletColor) !== D(o) && (e.listMarkerColor = D(t.bulletColor)), t.bulletScale && (e.listMarkerScale = Math.round(t.bulletScale * 100) / 100), t.marL !== void 0 && (e.listIndent = Math.max(0, Math.round(t.marL * 10) / 10), e.listMarkerIndent = Math.max(0, Math.round((t.marL + (t.indent ?? 0)) * 10) / 10)), e;
1313
1370
  }
1314
1371
  const bt = (t, n) => Math.round(((t.paragraphs[n - 1]?.spaceAfter ?? 0) + (t.paragraphs[n]?.spaceBefore ?? 0)) * 100) / 100;
1315
1372
  function te(t, n) {
1316
- const e = t.paragraphs.flatMap((p) => p.runs.filter((b) => !b.br)), o = e[0], s = o?.size ?? 24, r = /* @__PURE__ */ new Map(), a = (p) => p.runs.reduce((b, d) => b + (d.br ? 0 : d.text.trim().length), 0);
1317
- for (const p of t.paragraphs) {
1318
- const b = a(p);
1319
- b && r.set(p.align ?? "l", (r.get(p.align ?? "l") ?? 0) + b);
1373
+ const e = t.paragraphs.flatMap((h) => h.runs.filter((y) => !y.br)), o = e[0], s = o?.size ?? 24, r = /* @__PURE__ */ new Map(), a = (h) => h.runs.reduce((y, d) => y + (d.br ? 0 : d.text.trim().length), 0);
1374
+ for (const h of t.paragraphs) {
1375
+ const y = a(h);
1376
+ y && r.set(h.align ?? "l", (r.get(h.align ?? "l") ?? 0) + y);
1320
1377
  }
1321
- const i = [...r].sort((p, b) => b[1] - p[1])[0]?.[0] ?? t.paragraphs.find((p) => p.runs.length)?.align ?? "l", c = (p) => a(p) > 0 && (p.align ?? "l") !== i ? p.align === "ctr" ? "center" : p.align === "r" ? "right" : "left" : void 0, y = e.every((p) => p.size === o?.size && p.bold === o?.bold && p.italic === o?.italic && p.underline === o?.underline && p.strike === o?.strike && p.font === o?.font && j(p.color) === j(o?.color)) && !t.paragraphs.some((p) => p.bullet) && !t.paragraphs.some((p, b) => b > 0 && bt(t, b) > 0) && !t.paragraphs.some(c), x = {
1378
+ const i = [...r].sort((h, y) => y[1] - h[1])[0]?.[0] ?? t.paragraphs.find((h) => h.runs.length)?.align ?? "l", c = (h) => a(h) > 0 && (h.align ?? "l") !== i ? h.align === "ctr" ? "center" : h.align === "r" ? "right" : "left" : void 0, x = e.every((h) => h.size === o?.size && h.bold === o?.bold && h.italic === o?.italic && h.underline === o?.underline && h.strike === o?.strike && h.font === o?.font && D(h.color) === D(o?.color)) && !t.paragraphs.some((h) => h.bullet) && !t.paragraphs.some((h, y) => y > 0 && bt(t, y) > 0) && !t.paragraphs.some(c), b = {
1322
1379
  fontSize: Math.round(s * 10) / 10,
1323
1380
  fontFamily: Xt(o?.font),
1324
1381
  textAlign: i === "ctr" ? "center" : i === "r" ? "right" : "left",
1325
1382
  verticalAlign: t.anchor === "ctr" ? "middle" : t.anchor === "b" ? "bottom" : "top",
1326
- textColor: j(o?.color ?? { hex: "#000000" })
1383
+ textColor: D(o?.color ?? { hex: "#000000" })
1327
1384
  };
1328
- t.lineSpacing && Math.abs(t.lineSpacing - 1) > 0.01 && (x.lineHeight = Math.max(0.5, Math.min(4, t.lineSpacing * 1.2)));
1329
- const f = t.paragraphs.map((p) => p.runs.map((b) => b.br ? `
1330
- ` : b.text).join("")).join(`
1385
+ t.lineSpacing && Math.abs(t.lineSpacing - 1) > 0.01 && (b.lineHeight = Math.max(0.5, Math.min(4, t.lineSpacing * 1.2)));
1386
+ const f = t.paragraphs.map((h) => h.runs.map((y) => y.br ? `
1387
+ ` : y.text).join("")).join(`
1331
1388
  `);
1332
- if (y)
1333
- return o?.bold && (x.fontWeight = 700), o?.italic && (x.fontStyle = "italic"), n ? x.containerText = f : x.text = f, { fields: x, rich: !1 };
1334
- const g = [], h = [], u = [];
1335
- return t.paragraphs.forEach((p, b) => {
1336
- const d = p.level ?? 0;
1337
- if (p.bullet === "num") {
1338
- const M = p.numType ?? "arabicPeriod";
1339
- (h[d] === void 0 || u[d] !== M) && (h[d] = (p.startAt ?? 1) - 1), h[d]++, u[d] = M, h.length = d + 1, u.length = d + 1;
1389
+ if (x)
1390
+ return o?.bold && (b.fontWeight = 700), o?.italic && (b.fontStyle = "italic"), n ? b.containerText = f : b.text = f, { fields: b, rich: !1 };
1391
+ const m = [], g = [], u = [];
1392
+ return t.paragraphs.forEach((h, y) => {
1393
+ const d = h.level ?? 0;
1394
+ if (h.bullet === "num") {
1395
+ const M = h.numType ?? "arabicPeriod";
1396
+ (g[d] === void 0 || u[d] !== M) && (g[d] = (h.startAt ?? 1) - 1), g[d]++, u[d] = M, g.length = d + 1, u.length = d + 1;
1340
1397
  } else
1341
- h.length = Math.min(h.length, d), u.length = h.length;
1342
- const m = p.bullet ? { listType: p.bullet === "num" ? "ordered" : "bullet", listLevel: d, ...rn(p, t) } : {};
1343
- p.bullet === "num" && (m.listIndex = h[d]), (p.runs.length ? p.runs : [{ text: "" }]).forEach((M, S) => {
1398
+ g.length = Math.min(g.length, d), u.length = g.length;
1399
+ const p = h.bullet ? { listType: h.bullet === "num" ? "ordered" : "bullet", listLevel: d, ...hn(h, t) } : {};
1400
+ h.bullet === "num" && (p.listIndex = g[d]), (h.runs.length ? h.runs : [{ text: "" }]).forEach((M, S) => {
1344
1401
  const v = { text: M.br ? `
1345
- ` : M.text, ...S === 0 ? m : {} };
1346
- S === 0 && b > 0 && bt(t, b) > 0 && (v.paragraphSpaceBefore = bt(t, b));
1347
- const I = c(p);
1348
- I && (v.paragraphAlign = I), M.bold && (v.bold = !0), M.italic && (v.italic = !0), M.underline && (v.underline = !0), M.strike && (v.strikethrough = !0), M.color && (v.color = j(M.color)), M.size && (v.fontSize = Math.round(M.size * 10) / 10), M.font && (v.fontFamily = Xt(M.font)), g.push(v);
1349
- }), b < t.paragraphs.length - 1 && g.push({ text: `
1402
+ ` : M.text, ...S === 0 ? p : {} };
1403
+ S === 0 && y > 0 && bt(t, y) > 0 && (v.paragraphSpaceBefore = bt(t, y));
1404
+ const N = c(h);
1405
+ N && (v.paragraphAlign = N), M.bold && (v.bold = !0), M.italic && (v.italic = !0), M.underline && (v.underline = !0), M.strike && (v.strikethrough = !0), M.color && (v.color = D(M.color)), M.size && (v.fontSize = Math.round(M.size * 10) / 10), M.font && (v.fontFamily = Xt(M.font)), m.push(v);
1406
+ }), y < t.paragraphs.length - 1 && m.push({ text: `
1350
1407
  ` });
1351
- }), n ? (x.richContainerText = g, x.containerText = f) : (x.richText = g, x.text = f), { fields: x, rich: !0 };
1408
+ }), n ? (b.richContainerText = m, b.containerText = f) : (b.richText = m, b.text = f), { fields: b, rich: !0 };
1352
1409
  }
1353
1410
  function yt(t, n, e, o, s) {
1354
- const { fields: r, rich: a } = te(n, !1), i = 4, c = q(t, a ? "richtext" : "text", {
1411
+ const { fields: r, rich: a } = te(n, !1), i = 4, c = Z(t, a ? "richtext" : "text", {
1355
1412
  ...e,
1356
1413
  x: e.x + n.insets.l - i,
1357
1414
  y: e.y + n.insets.t - i,
@@ -1366,75 +1423,75 @@ function ne(t, n, e) {
1366
1423
  if (t.text && t.fill.kind === "none" && !t.line && (t.textBox || o.kind === "preset" && o.prst === "rect"))
1367
1424
  return n.stats.elements++, [yt(n, t.text, t, e)];
1368
1425
  if (o.kind === "preset" && ee.has(o.prst)) return wt({ ...t, kind: "connector", line: t.line ?? { width: 1, color: { hex: "#000000" } } }, n, e);
1369
- if (o.kind === "custom" && t.line && (t.line.head || t.line.tail) && !t.text && o.paths.every((f) => !f.cmds.some((g) => g.op === "Z")))
1426
+ if (o.kind === "custom" && t.line && (t.line.head || t.line.tail) && !t.text && o.paths.every((f) => !f.cmds.some((m) => m.op === "Z")))
1370
1427
  return wt({ ...t, kind: "connector", line: t.line }, n, e);
1371
- const s = ln(t);
1428
+ const s = mn(t);
1372
1429
  if (s) {
1373
- const f = q(n, s.type, t, e);
1430
+ const f = Z(n, s.type, t, e);
1374
1431
  Object.assign(f, s.extra), Ht(f, t.fill, n), kt(f, t.line), n.byPptId.set(t.id, { el: f, item: t }), n.stats.elements++;
1375
- const g = t.textRect ?? { l: 0, t: 0, r: t.w, b: t.h }, h = t.text?.insets, u = Math.abs(g.l) > 0.5 || Math.abs(g.t) > 0.5 || Math.abs(g.r - t.w) > 0.5 || Math.abs(g.b - t.h) > 0.5, p = !!h && Math.max(h.l, h.r, h.t, h.b) > 16;
1376
- if (t.text && (u || p)) {
1377
- const b = n.nextId("group");
1378
- return f.groupIds = [...e, b].reverse(), n.stats.elements++, [f, yt(n, t.text, { ...t, rot: 0, x: t.x + g.l, y: t.y + g.t, w: g.r - g.l, h: g.b - g.t }, [...e, b])];
1432
+ const m = t.textRect ?? { l: 0, t: 0, r: t.w, b: t.h }, g = t.text?.insets, u = Math.abs(m.l) > 0.5 || Math.abs(m.t) > 0.5 || Math.abs(m.r - t.w) > 0.5 || Math.abs(m.b - t.h) > 0.5, h = !!g && Math.max(g.l, g.r, g.t, g.b) > 16;
1433
+ if (t.text && (u || h)) {
1434
+ const y = n.nextId("group");
1435
+ return f.groupIds = [...e, y].reverse(), n.stats.elements++, [f, yt(n, t.text, { ...t, rot: 0, x: t.x + m.l, y: t.y + m.t, w: m.r - m.l, h: m.b - m.t }, [...e, y])];
1379
1436
  }
1380
1437
  if (t.text) {
1381
- const { fields: b } = te(t.text, !0);
1382
- Object.assign(f, b);
1438
+ const { fields: y } = te(t.text, !0);
1439
+ Object.assign(f, y);
1383
1440
  }
1384
1441
  return [f];
1385
1442
  }
1386
1443
  const r = o.kind === "custom" ? o.paths : (() => {
1387
1444
  const f = n.presets[o.prst];
1388
1445
  if (!f)
1389
- return n.warnings.push(`Unknown shape "${o.prst}" was imported as a rectangle.`), it(n.presets.rect, t.w, t.h);
1390
- const g = Object.fromEntries(Object.entries(o.adj ?? {}).map(([h, u]) => [h, `val ${u}`]));
1391
- return it(f, t.w, t.h, g);
1392
- })(), a = [], i = (t.text || r.some((f) => f.fill === !1)) && r.some((f) => f.fill !== !1) ? n.nextId("group") : null, c = i ? [...e, i] : e, y = /* @__PURE__ */ new Map();
1446
+ return n.warnings.push(`Unknown shape "${o.prst}" was imported as a rectangle.`), lt(n.presets.rect, t.w, t.h);
1447
+ const m = Object.fromEntries(Object.entries(o.adj ?? {}).map(([g, u]) => [g, `val ${u}`]));
1448
+ return lt(f, t.w, t.h, m);
1449
+ })(), a = [], i = (t.text || r.some((f) => f.fill === !1)) && r.some((f) => f.fill !== !1) ? n.nextId("group") : null, c = i ? [...e, i] : e, x = /* @__PURE__ */ new Map();
1393
1450
  for (const f of r) {
1394
- const g = `${f.fill === !1 ? "nofill" : "fill"}|${f.stroke === !1 ? "nostroke" : "stroke"}`;
1395
- y.has(g) || y.set(g, []), y.get(g).push(f);
1451
+ const m = `${f.fill === !1 ? "nofill" : "fill"}|${f.stroke === !1 ? "nostroke" : "stroke"}`;
1452
+ x.has(m) || x.set(m, []), x.get(m).push(f);
1396
1453
  }
1397
- let x = null;
1398
- for (const [f, g] of y) {
1399
- const h = g.flatMap((m) => m.cmds), u = le(h);
1454
+ let b = null;
1455
+ for (const [f, m] of x) {
1456
+ const g = m.flatMap((p) => p.cmds), u = le(g);
1400
1457
  if (!u) continue;
1401
- const p = Je(tn(h, -u.minX, -u.minY));
1402
- if (!p.length) continue;
1403
- const b = q(n, "path", { ...t, x: t.x + u.minX, y: t.y + u.minY, w: Math.max(u.maxX - u.minX, 1), h: Math.max(u.maxY - u.minY, 1) }, c);
1404
- !(Math.abs(u.minX + u.maxX - t.w) < 0.5 && Math.abs(u.minY + u.maxY - t.h) < 0.5) && (t.rot || t.flipH || t.flipV) && an(b, p, t, u), b.pathSubpaths = p, b.pathAnchors = p[0].anchors, b.pathClosed = p[0].closed, f.startsWith("fill") ? Ht(b, t.fill, n) : b.backgroundColor = "transparent", f.endsWith("|stroke") ? kt(b, t.line) : (b.strokeColor = "transparent", b.strokeWidth = 0), a.push(b), x ??= b, n.stats.paths++;
1458
+ const h = rn(an(g, -u.minX, -u.minY));
1459
+ if (!h.length) continue;
1460
+ const y = Z(n, "path", { ...t, x: t.x + u.minX, y: t.y + u.minY, w: Math.max(u.maxX - u.minX, 1), h: Math.max(u.maxY - u.minY, 1) }, c);
1461
+ !(Math.abs(u.minX + u.maxX - t.w) < 0.5 && Math.abs(u.minY + u.maxY - t.h) < 0.5) && (t.rot || t.flipH || t.flipV) && pn(y, h, t, u), y.pathSubpaths = h, y.pathAnchors = h[0].anchors, y.pathClosed = h[0].closed, f.startsWith("fill") ? Ht(y, t.fill, n) : y.backgroundColor = "transparent", f.endsWith("|stroke") ? kt(y, t.line) : (y.strokeColor = "transparent", y.strokeWidth = 0), a.push(y), b ??= y, n.stats.paths++;
1405
1462
  }
1406
- if (x && n.byPptId.set(t.id, { el: x, item: t }), t.text) {
1463
+ if (b && n.byPptId.set(t.id, { el: b, item: t }), t.text) {
1407
1464
  const f = t.textRect ?? (o.kind === "preset" && n.presets[o.prst] ? Ut(n.presets[o.prst], t.w, t.h) : { l: 0, t: 0, r: t.w, b: t.h });
1408
1465
  a.push(yt(n, t.text, { ...t, x: t.x + f.l, y: t.y + f.t, w: f.r - f.l, h: f.b - f.t }, c));
1409
1466
  }
1410
1467
  return n.stats.elements += a.length, a;
1411
1468
  }
1412
- function an(t, n, e, o) {
1413
- const s = e.w / 2, r = e.h / 2, a = (e.rot || 0) * Math.PI / 180, i = Math.cos(a), c = Math.sin(a), y = e.flipH ? -1 : 1, x = e.flipV ? -1 : 1, f = (d, m) => {
1414
- const k = (d + o.minX - s) * y, M = (m + o.minY - r) * x;
1469
+ function pn(t, n, e, o) {
1470
+ const s = e.w / 2, r = e.h / 2, a = (e.rot || 0) * Math.PI / 180, i = Math.cos(a), c = Math.sin(a), x = e.flipH ? -1 : 1, b = e.flipV ? -1 : 1, f = (d, p) => {
1471
+ const k = (d + o.minX - s) * x, M = (p + o.minY - r) * b;
1415
1472
  return { x: s + k * i - M * c, y: r + k * c + M * i };
1416
- }, g = (d, m) => {
1417
- const k = d * y, M = m * x;
1473
+ }, m = (d, p) => {
1474
+ const k = d * x, M = p * b;
1418
1475
  return { x: k * i - M * c, y: k * c + M * i };
1419
1476
  };
1420
- let h = 1 / 0, u = 1 / 0, p = -1 / 0, b = -1 / 0;
1421
- for (const d of n) for (const m of d.anchors) {
1422
- const k = f(m.x, m.y);
1423
- if (m.x = k.x, m.y = k.y, m.inX !== void 0) {
1424
- const M = g(m.inX, m.inY ?? 0);
1425
- m.inX = M.x, m.inY = M.y;
1477
+ let g = 1 / 0, u = 1 / 0, h = -1 / 0, y = -1 / 0;
1478
+ for (const d of n) for (const p of d.anchors) {
1479
+ const k = f(p.x, p.y);
1480
+ if (p.x = k.x, p.y = k.y, p.inX !== void 0) {
1481
+ const M = m(p.inX, p.inY ?? 0);
1482
+ p.inX = M.x, p.inY = M.y;
1426
1483
  }
1427
- if (m.outX !== void 0) {
1428
- const M = g(m.outX, m.outY ?? 0);
1429
- m.outX = M.x, m.outY = M.y;
1484
+ if (p.outX !== void 0) {
1485
+ const M = m(p.outX, p.outY ?? 0);
1486
+ p.outX = M.x, p.outY = M.y;
1430
1487
  }
1431
- h = Math.min(h, m.x), u = Math.min(u, m.y), p = Math.max(p, m.x), b = Math.max(b, m.y);
1488
+ g = Math.min(g, p.x), u = Math.min(u, p.y), h = Math.max(h, p.x), y = Math.max(y, p.y);
1432
1489
  }
1433
- for (const d of n) for (const m of d.anchors)
1434
- m.x -= h, m.y -= u;
1435
- t.x = t.x - o.minX + h, t.y = t.y - o.minY + u, t.width = Math.max(p - h, 1), t.height = Math.max(b - u, 1), t.angle = 0, t.flipX = void 0, t.flipY = void 0;
1490
+ for (const d of n) for (const p of d.anchors)
1491
+ p.x -= g, p.y -= u;
1492
+ t.x = t.x - o.minX + g, t.y = t.y - o.minY + u, t.width = Math.max(h - g, 1), t.height = Math.max(y - u, 1), t.angle = 0, t.flipX = void 0, t.flipY = void 0;
1436
1493
  }
1437
- function ln(t) {
1494
+ function mn(t) {
1438
1495
  const n = t.geom;
1439
1496
  if (n.kind !== "preset") return null;
1440
1497
  const e = n.adj ?? {};
@@ -1461,27 +1518,27 @@ function wt(t, n, e) {
1461
1518
  else if (o.kind === "custom") s = o.paths.flatMap((k) => k.cmds);
1462
1519
  else {
1463
1520
  const k = n.presets[o.prst], M = Object.fromEntries(Object.entries(o.adj ?? {}).map(([S, v]) => [S, `val ${v}`]));
1464
- s = k ? it(k, t.w, t.h, M).flatMap((S) => S.cmds) : [{ op: "M", x: 0, y: 0 }, { op: "L", x: t.w, y: t.h }];
1521
+ s = k ? lt(k, t.w, t.h, M).flatMap((S) => S.cmds) : [{ op: "M", x: 0, y: 0 }, { op: "L", x: t.w, y: t.h }];
1465
1522
  }
1466
1523
  const r = t.w / 2, a = t.h / 2, i = (t.rot || 0) * Math.PI / 180, c = (k, M) => {
1467
1524
  let S = k - r, v = M - a;
1468
1525
  return t.flipH && (S = -S), t.flipV && (v = -v), { x: t.x + r + S * Math.cos(i) - v * Math.sin(i), y: t.y + a + S * Math.sin(i) + v * Math.cos(i) };
1469
- }, y = [];
1470
- let x = { x: 0, y: 0 };
1526
+ }, x = [];
1527
+ let b = { x: 0, y: 0 };
1471
1528
  for (const k of s)
1472
1529
  if (k.op === "M" || k.op === "L")
1473
- x = { x: k.x, y: k.y }, y.push(c(x.x, x.y));
1530
+ b = { x: k.x, y: k.y }, x.push(c(b.x, b.y));
1474
1531
  else if (k.op === "C") {
1475
1532
  for (let M = 1; M <= 12; M++) {
1476
- const S = M / 12, v = 1 - S, I = v * v * v * x.x + 3 * v * v * S * k.x1 + 3 * v * S * S * k.x2 + S * S * S * k.x, P = v * v * v * x.y + 3 * v * v * S * k.y1 + 3 * v * S * S * k.y2 + S * S * S * k.y;
1477
- y.push(c(I, P));
1533
+ const S = M / 12, v = 1 - S, N = v * v * v * b.x + 3 * v * v * S * k.x1 + 3 * v * S * S * k.x2 + S * S * S * k.x, P = v * v * v * b.y + 3 * v * v * S * k.y1 + 3 * v * S * S * k.y2 + S * S * S * k.y;
1534
+ x.push(c(N, P));
1478
1535
  }
1479
- x = { x: k.x, y: k.y };
1536
+ b = { x: k.x, y: k.y };
1480
1537
  }
1481
- if (y.length < 2) return [];
1482
- const f = Math.min(...y.map((k) => k.x)), g = Math.min(...y.map((k) => k.y)), h = Math.max(...y.map((k) => k.x)), u = Math.max(...y.map((k) => k.y)), p = t.line.head && Yt[t.line.head.type], b = t.line.tail && Yt[t.line.tail.type], d = q(n, p || b ? "arrow" : "line", { ...t, x: f, y: g, w: Math.max(h - f, 1), h: Math.max(u - g, 1), rot: 0, flipH: !1, flipV: !1 }, e);
1483
- d.points = y.map((k) => ({ x: k.x - f, y: k.y - g })), d.curveType = "straight", d.startArrowhead = p ?? null, d.endArrowhead = b ?? null, kt(d, t.line);
1484
- const m = (k, M) => {
1538
+ if (x.length < 2) return [];
1539
+ const f = Math.min(...x.map((k) => k.x)), m = Math.min(...x.map((k) => k.y)), g = Math.max(...x.map((k) => k.x)), u = Math.max(...x.map((k) => k.y)), h = t.line.head && Yt[t.line.head.type], y = t.line.tail && Yt[t.line.tail.type], d = Z(n, h || y ? "arrow" : "line", { ...t, x: f, y: m, w: Math.max(g - f, 1), h: Math.max(u - m, 1), rot: 0, flipH: !1, flipV: !1 }, e);
1540
+ d.points = x.map((k) => ({ x: k.x - f, y: k.y - m })), d.curveType = "straight", d.startArrowhead = h ?? null, d.endArrowhead = y ?? null, kt(d, t.line);
1541
+ const p = (k, M) => {
1485
1542
  if (!k) return null;
1486
1543
  const S = n.byPptId.get(k.id);
1487
1544
  if (!S || !S.el.width || !S.el.height) return null;
@@ -1489,17 +1546,17 @@ function wt(t, n, e) {
1489
1546
  return { elementId: v.id, focus: 0, gap: 0, anchorFractionX: (M.x + n.ox - v.x) / v.width, anchorFractionY: (M.y + n.oy - v.y) / v.height };
1490
1547
  };
1491
1548
  return n.glue.push(() => {
1492
- d.startBinding = m(t.start, y[0]), d.endBinding = m(t.end, y[y.length - 1]);
1549
+ d.startBinding = p(t.start, x[0]), d.endBinding = p(t.end, x[x.length - 1]);
1493
1550
  }), n.stats.elements++, [d];
1494
1551
  }
1495
- function cn(t, n, e) {
1552
+ function gn(t, n, e) {
1496
1553
  const o = n.images.get(t.media);
1497
1554
  if (!o) {
1498
1555
  n.warnings.push(`Picture "${t.name}" is a ${t.media.ext.toUpperCase()} image, which browsers can't show; it was imported as a placeholder.`);
1499
- const c = q(n, "rectangle", t, e);
1556
+ const c = Z(n, "rectangle", t, e);
1500
1557
  return Object.assign(c, { backgroundColor: "#f1f3f5", strokeColor: "#adb5bd", strokeWidth: 1, strokeStyle: "dashed", containerText: `${t.media.ext.toUpperCase()} picture`, fontSize: 14, textColor: "#495057" }), n.stats.elements++, [c];
1501
1558
  }
1502
- const s = q(n, "image", t, e);
1559
+ const s = Z(n, "image", t, e);
1503
1560
  if (s.dataURL = t.grayscale && n.gray.get(o.url) || o.url, s.status = "loaded", s.mimeType = Mt[t.media.ext], t.crop && (t.crop.l || t.crop.t || t.crop.r || t.crop.b) && (s.crop = { x: t.crop.l * o.w, y: t.crop.t * o.h, width: Math.max(1, (1 - t.crop.l - t.crop.r) * o.w), height: Math.max(1, (1 - t.crop.t - t.crop.b) * o.h) }), t.alpha !== void 0 && t.alpha < 1 && (s.opacity = Math.round(t.alpha * 100)), t.descr && (s.altText = t.descr), n.stats.elements++, n.stats.pictures++, !t.geom) return [s];
1504
1561
  const r = n.nextId("group"), a = ne({
1505
1562
  kind: "shape",
@@ -1525,38 +1582,43 @@ function oe(t, n, e) {
1525
1582
  const o = [];
1526
1583
  for (const s of t)
1527
1584
  try {
1585
+ const r = [];
1528
1586
  switch (s.kind) {
1529
1587
  case "shape":
1530
- o.push(...ne(s, n, e));
1588
+ r.push(...ne(s, n, e));
1531
1589
  break;
1532
1590
  case "connector":
1533
- o.push(...wt(s, n, e));
1591
+ r.push(...wt(s, n, e));
1534
1592
  break;
1535
1593
  case "picture":
1536
- o.push(...cn(s, n, e));
1594
+ r.push(...gn(s, n, e));
1537
1595
  break;
1538
1596
  case "group":
1539
- o.push(...oe(s.children, n, [...e, n.nextId("group")]));
1597
+ r.push(...oe(s.children, n, [...e, n.nextId("group")]));
1540
1598
  break;
1541
1599
  }
1600
+ const a = ln(s.link, n);
1601
+ if (a)
1602
+ for (const i of r) i.link || (i.link = a);
1603
+ o.push(...r);
1542
1604
  } catch {
1543
1605
  n.warnings.push(`"${s.name}" couldn't be converted and was skipped.`);
1544
1606
  }
1545
1607
  return o;
1546
1608
  }
1547
- function fn(t) {
1609
+ function xn(t) {
1548
1610
  return t ? { type: t.kind === "fade" ? "fade" : t.kind === "zoom" ? t.zoomIn === !1 ? "zoom-out" : "zoom-in" : t.dir === "r" ? "slide-right" : t.dir === "u" ? "slide-up" : t.dir === "d" ? "slide-down" : "slide-left", duration: Math.max(100, Math.min(5e3, t.durationMs)), easing: "easeInOutQuad" } : void 0;
1549
1611
  }
1550
- function un(t, n, e) {
1612
+ function bn(t, n, e) {
1551
1613
  if (n)
1552
1614
  if (n.kind === "solid")
1553
- t.fillStyle = "solid", t.backgroundColor = j(n.color);
1615
+ t.fillStyle = "solid", t.backgroundColor = D(n.color);
1554
1616
  else if (n.kind === "linear" || n.kind === "radial")
1555
- t.fillStyle = n.kind, t.backgroundColor = j(n.stops[0]?.color), t.gradientStops = n.stops.map((o) => ({ offset: o.pos, color: j(o.color) })), n.kind === "linear" && (t.gradientDirection = n.angle);
1617
+ t.fillStyle = n.kind, t.backgroundColor = D(n.stops[0]?.color), t.gradientStops = n.stops.map((o) => ({ offset: o.pos, color: D(o.color) })), n.kind === "linear" && (t.gradientDirection = n.angle);
1556
1618
  else if (n.kind === "image") {
1557
1619
  const o = e.images.get(n.media), s = e.slideBg ?? o?.url;
1558
1620
  s && (t.fillStyle = "image", t.backgroundImage = s, t.backgroundColor = "#ffffff"), s && n.alpha !== void 0 && n.alpha < 1 && (t.backgroundOpacity = n.alpha);
1559
- } else n.kind === "pattern" && (t.fillStyle = "solid", t.backgroundColor = j(n.color));
1621
+ } else n.kind === "pattern" && (t.fillStyle = "solid", t.backgroundColor = D(n.color));
1560
1622
  }
1561
1623
  const Mt = {
1562
1624
  png: "image/png",
@@ -1568,13 +1630,13 @@ const Mt = {
1568
1630
  webp: "image/webp",
1569
1631
  emf: "image/x-emf",
1570
1632
  wmf: "image/x-wmf"
1571
- }, dn = /* @__PURE__ */ new Set(["png", "jpeg", "gif", "svg", "bmp", "webp"]);
1572
- function hn(t) {
1633
+ }, yn = /* @__PURE__ */ new Set(["png", "jpeg", "gif", "svg", "bmp", "webp"]);
1634
+ function kn(t) {
1573
1635
  let n = "";
1574
1636
  for (let o = 0; o < t.length; o += 32768) n += String.fromCharCode(...t.subarray(o, o + 32768));
1575
1637
  return btoa(n);
1576
1638
  }
1577
- async function pn(t) {
1639
+ async function wn(t) {
1578
1640
  const n = /* @__PURE__ */ new Set(), e = (s) => {
1579
1641
  for (const r of s)
1580
1642
  r.kind === "picture" ? n.add(r.media) : r.kind === "group" ? e(r.children) : r.kind === "shape" && r.fill.kind === "image" && n.add(r.fill.media);
@@ -1583,11 +1645,11 @@ async function pn(t) {
1583
1645
  e(s.items), s.background?.kind === "image" && n.add(s.background.media);
1584
1646
  const o = /* @__PURE__ */ new Map();
1585
1647
  return await Promise.all([...n].map(async (s) => {
1586
- if (!dn.has(s.ext)) {
1648
+ if (!yn.has(s.ext)) {
1587
1649
  o.set(s, null);
1588
1650
  return;
1589
1651
  }
1590
- const r = `data:${Mt[s.ext]};base64,${hn(s.bytes)}`;
1652
+ const r = `data:${Mt[s.ext]};base64,${kn(s.bytes)}`;
1591
1653
  let a = 0, i = 0;
1592
1654
  try {
1593
1655
  const c = await createImageBitmap(new Blob([s.bytes], { type: Mt[s.ext] }));
@@ -1597,39 +1659,41 @@ async function pn(t) {
1597
1659
  o.set(s, { url: r, w: a, h: i });
1598
1660
  })), o;
1599
1661
  }
1600
- function mn(t, n, e) {
1662
+ function Mn(t, n, e) {
1601
1663
  const o = /^(nar|sm)/.test(t) ? 4 : /^(wd|lg)/.test(t) ? 12 : 8, s = /^dk/.test(t) ? 3 : /^lt/.test(t) ? 1 : /^(wd)/.test(t) ? 3 : 1.5, r = { color: n, background: e, spacing: o, strokeWidth: s }, a = /^pct(\d+)$/.exec(t);
1602
1664
  if (a) {
1603
- const i = Math.max(1, Math.min(99, Number(a[1]))), c = i > 50, y = (c ? 100 - i : i) / 100;
1604
- return { type: "dots", color: c ? e : n, background: c ? n : e, spacing: 4, strokeWidth: Math.max(0.5, 4 * Math.sqrt(y / Math.PI)) };
1665
+ const i = Math.max(1, Math.min(99, Number(a[1]))), c = i > 50, x = (c ? 100 - i : i) / 100;
1666
+ return { type: "dots", color: c ? e : n, background: c ? n : e, spacing: 4, strokeWidth: Math.max(0.5, 4 * Math.sqrt(x / Math.PI)) };
1605
1667
  }
1606
1668
  return /Horz$|^horz|Brick$|^shingle$|^wave$|^zigZag$/.test(t) ? { type: "stripes", ...r, angle: 0 } : /Vert$|^vert$/.test(t) ? { type: "stripes", ...r, angle: 90 } : /DnDiag$|^dnDiag$/.test(t) ? { type: "stripes", ...r, angle: 45 } : /UpDiag$|^upDiag$/.test(t) ? { type: "stripes", ...r, angle: -45 } : /^(diagCross|trellis|openDmnd|weave)$/.test(t) ? { type: "crosshatch", ...r } : /Check$|^solidDmnd$/.test(t) ? { type: "checker", ...r, angle: t === "solidDmnd" ? 45 : 0 } : /^(cross|smGrid|lgGrid|dotGrid|plaid)$/.test(t) ? { type: "grid", ...r } : { type: "dots", ...r, strokeWidth: 1 };
1607
1669
  }
1608
- async function gn(t, n, e) {
1609
- const o = await xe(), s = await pn(t), r = Math.round(t.width), a = Math.round(t.height), i = ce(e ?? t.title, "slides", { width: r, height: a }), c = [], y = { slides: 0, elements: 0, pictures: 0, paths: 0 };
1670
+ async function vn(t, n, e) {
1671
+ const o = await ye(), s = await wn(t), r = Math.round(t.width), a = Math.round(t.height), i = ce(e ?? t.title, "slides", { width: r, height: a }), c = [], x = { slides: 0, elements: 0, pictures: 0, paths: 0 };
1610
1672
  i.slides = [];
1611
- const x = await nn(t, s), f = await Promise.all(t.slides.map((g) => {
1612
- const h = g.background, u = h?.kind === "image" ? s.get(h.media) : void 0;
1613
- return h?.kind === "image" && u ? on(u.url, r, a, h.tile) : void 0;
1614
- }));
1615
- return t.slides.forEach((g, h) => {
1616
- const u = h * (r + qe), p = Rt(void 0, g.name || `Slide ${h + 1}`, u, 0, { width: r, height: a });
1617
- p.order = h;
1618
- const b = { ox: u, oy: 0, presets: o, nextId: n, out: [], byPptId: /* @__PURE__ */ new Map(), glue: [], warnings: c, stats: y, images: s, slideBg: f[h], gray: x };
1619
- i.elements.push(...oe(g.items, b, [])), b.glue.forEach((m) => m()), un(p, g.background, b);
1620
- const d = fn(g.transition);
1621
- d && (p.transition = d), i.slides.push(p), y.slides++;
1622
- }), i.slides.length || i.slides.push(Rt(void 0, "Slide 1", 0, 0, { width: r, height: a })), { doc: i, warnings: [...new Set(c)], stats: y };
1623
- }
1624
- const xn = 512 * 1024 * 1024;
1625
- async function wn(t, n) {
1673
+ const b = await fn(t, s), f = await Promise.all(t.slides.map((u) => {
1674
+ const h = u.background, y = h?.kind === "image" ? s.get(h.media) : void 0;
1675
+ return h?.kind === "image" && y ? un(y.url, r, a, h.tile) : void 0;
1676
+ })), m = t.slides.map(() => n("slide")), g = /* @__PURE__ */ new Map();
1677
+ return t.slides.forEach((u, h) => {
1678
+ u.key && g.set(u.key, m[h]);
1679
+ }), t.slides.forEach((u, h) => {
1680
+ const y = h * (r + en), d = Nt(m[h], u.name || `Slide ${h + 1}`, y, 0, { width: r, height: a });
1681
+ d.order = h;
1682
+ const p = { ox: y, oy: 0, presets: o, nextId: n, out: [], byPptId: /* @__PURE__ */ new Map(), glue: [], warnings: c, stats: x, images: s, slideBg: f[h], gray: b, slideIds: g };
1683
+ i.elements.push(...oe(u.items, p, [])), p.glue.forEach((M) => M()), bn(d, u.background, p);
1684
+ const k = xn(u.transition);
1685
+ k && (d.transition = k), u.notes && (d.notes = u.notes), i.slides.push(d), x.slides++;
1686
+ }), i.slides.length || i.slides.push(Nt(void 0, "Slide 1", 0, 0, { width: r, height: a })), { doc: i, warnings: [...new Set(c)], stats: x };
1687
+ }
1688
+ const Sn = 512 * 1024 * 1024;
1689
+ async function In(t, n) {
1626
1690
  const e = t instanceof Uint8Array ? t : t instanceof ArrayBuffer ? new Uint8Array(t) : new Uint8Array(await t.arrayBuffer());
1627
- if (e.length > xn) throw new Error("This presentation is too large to open (over 512 MB).");
1628
- const { deck: o, warnings: s } = Ve(e), r = /* @__PURE__ */ new Set(), a = await gn(o, (c) => de(c, r), n);
1629
- ue(a.doc);
1691
+ if (e.length > Sn) throw new Error("This presentation is too large to open (over 512 MB).");
1692
+ const { deck: o, warnings: s } = tn(e), r = /* @__PURE__ */ new Set(), a = await vn(o, (c) => pe(c, r), n);
1693
+ he(a.doc);
1630
1694
  const i = [...s, ...a.warnings];
1631
1695
  return i.length && console.warn("[pptx import]", i), { stats: a.stats, warnings: i };
1632
1696
  }
1633
1697
  export {
1634
- wn as importPptx
1698
+ In as importPptx
1635
1699
  };