@spiffcommerce/core 31.0.0 → 31.1.0-beta.c5afa5d3-4b53-5432-9ee2-0dbc6dca6200

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -330,13 +330,13 @@ class jr {
330
330
  fetch: qr
331
331
  }), e = Ar(async (i, s) => {
332
332
  const { headers: o } = s, l = o || {}, c = await Wr();
333
- let d = s.bearer ?? c.bearer;
333
+ let A = s.bearer ?? c.bearer;
334
334
  if (this.spiffClient)
335
335
  try {
336
- d = await this.spiffClient.loggedInBearerToken();
336
+ A = await this.spiffClient.loggedInBearerToken();
337
337
  } catch {
338
338
  }
339
- const A = s.partnerId ?? c.partnerId, u = s.activeIntegration ?? c.activeIntegration, h = s.transactionOwnerId, m = s.customerToken ?? c.customerToken, g = s.applicationKey ?? c.applicationKey, p = s.bundleOwnerId;
339
+ const d = s.partnerId ?? c.partnerId, u = s.activeIntegration ?? c.activeIntegration, h = s.transactionOwnerId, m = s.customerToken ?? c.customerToken, g = s.applicationKey ?? c.applicationKey, p = s.bundleOwnerId;
340
340
  try {
341
341
  if (window && window.__SENTRY__) {
342
342
  const f = window.__SENTRY__.hub;
@@ -349,7 +349,7 @@ class jr {
349
349
  }
350
350
  } catch {
351
351
  }
352
- return d && (l.Authorization = `Bearer ${d}`), A && (l.partnerId = A), u && (l.activeIntegration = u), h && (l.transactionOwnerId = h), m && (l.customerToken = m), g && (l["X-Application-Key"] = g), p && (l.bundleOwnerId = p), l["Allow-Moonlight-Redirect"] = "true", {
352
+ return A && (l.Authorization = `Bearer ${A}`), d && (l.partnerId = d), u && (l.activeIntegration = u), h && (l.transactionOwnerId = h), m && (l.customerToken = m), g && (l["X-Application-Key"] = g), p && (l.bundleOwnerId = p), l["Allow-Moonlight-Redirect"] = "true", {
353
353
  headers: l
354
354
  };
355
355
  }), a = ur(({ operation: i, graphQLErrors: s, networkError: o }) => {
@@ -426,34 +426,34 @@ const Hr = (r) => new Promise((t) => {
426
426
  }, Kr = async (r) => {
427
427
  const t = await Or(r), e = await te(t), [a, n] = Jr(e);
428
428
  if (!await Yr()) {
429
- const A = pt(a, n);
430
- return A.getContext("2d")?.drawImage(e, 0, 0, a, n), A;
429
+ const d = pt(a, n);
430
+ return d.getContext("2d")?.drawImage(e, 0, 0, a, n), d;
431
431
  }
432
- const s = await Hr(r), [o, l] = s > 4 ? [n, a] : [a, n], c = pt(o, l), d = c.getContext("2d");
432
+ const s = await Hr(r), [o, l] = s > 4 ? [n, a] : [a, n], c = pt(o, l), A = c.getContext("2d");
433
433
  switch (s) {
434
434
  case 2:
435
- d.translate(o, 0), d.scale(-1, 1);
435
+ A.translate(o, 0), A.scale(-1, 1);
436
436
  break;
437
437
  case 3:
438
- d.translate(o, l), d.rotate(Math.PI);
438
+ A.translate(o, l), A.rotate(Math.PI);
439
439
  break;
440
440
  case 4:
441
- d.translate(0, l), d.scale(1, -1);
441
+ A.translate(0, l), A.scale(1, -1);
442
442
  break;
443
443
  case 5:
444
- d.rotate(-0.5 * Math.PI), d.scale(-1, 1);
444
+ A.rotate(-0.5 * Math.PI), A.scale(-1, 1);
445
445
  break;
446
446
  case 6:
447
- d.rotate(-0.5 * Math.PI), d.translate(-o, 0);
447
+ A.rotate(-0.5 * Math.PI), A.translate(-o, 0);
448
448
  break;
449
449
  case 7:
450
- d.rotate(-0.5 * Math.PI), d.translate(-o, l), d.scale(1, -1);
450
+ A.rotate(-0.5 * Math.PI), A.translate(-o, l), A.scale(1, -1);
451
451
  break;
452
452
  case 8:
453
- d.rotate(0.5 * Math.PI), d.translate(0, -l);
453
+ A.rotate(0.5 * Math.PI), A.translate(0, -l);
454
454
  break;
455
455
  }
456
- return d.drawImage(e, 0, 0, o, l), c;
456
+ return A.drawImage(e, 0, 0, o, l), c;
457
457
  }, Te = async (r) => {
458
458
  const t = await Kr(r);
459
459
  return Me(r) === "image/jpeg" ? {
@@ -3170,15 +3170,15 @@ function Oc(r, t = 64) {
3170
3170
  distance: 0
3171
3171
  });
3172
3172
  const i = parseInt(r.substring(0, 2), 16), s = parseInt(r.substring(2, 4), 16), o = parseInt(r.substring(4, 6), 16);
3173
- let l, c, d;
3174
- for (let A = 0; A < Ft.length; A++) {
3175
- l = Le[A][0], c = Le[A][1], d = Le[A][2];
3176
- const u = Math.sqrt(Math.pow(i - l, 2) + Math.pow(s - c, 2) + Math.pow(o - d, 2));
3173
+ let l, c, A;
3174
+ for (let d = 0; d < Ft.length; d++) {
3175
+ l = Le[d][0], c = Le[d][1], A = Le[d][2];
3176
+ const u = Math.sqrt(Math.pow(i - l, 2) + Math.pow(s - c, 2) + Math.pow(o - A, 2));
3177
3177
  a.push(u);
3178
3178
  }
3179
- for (let A = 0; A < a.length; A++)
3180
- a[A] <= t && !e.some((u) => u.pms === Yt[A]) && e.push({ pms: Yt[A], hex: Ft[A], distance: a[A] });
3181
- return e.sort((A, u) => A.distance - u.distance);
3179
+ for (let d = 0; d < a.length; d++)
3180
+ a[d] <= t && !e.some((u) => u.pms === Yt[d]) && e.push({ pms: Yt[d], hex: Ft[d], distance: a[d] });
3181
+ return e.sort((d, u) => d.distance - u.distance);
3182
3182
  }
3183
3183
  const Xr = Yt.map((r, t) => ({ pms: r, hex: Ft[t] })), Zr = new pr(Xr, { keys: ["pms"] });
3184
3184
  function $c(r, t) {
@@ -3269,8 +3269,8 @@ const le = (r) => {
3269
3269
  n.split(";").forEach((o) => {
3270
3270
  const l = o.trim();
3271
3271
  if (l) {
3272
- const [c, d] = l.split(":"), A = c.toLowerCase();
3273
- ai.indexOf(A) > -1 ? a.setAttribute(A, d.trim()) : i.push(l);
3272
+ const [c, A] = l.split(":"), d = c.toLowerCase();
3273
+ ai.indexOf(d) > -1 ? a.setAttribute(d, A.trim()) : i.push(l);
3274
3274
  }
3275
3275
  }), i.length > 0 ? a.setAttribute("style", i.join(";")) : a.removeAttribute("style");
3276
3276
  }
@@ -3351,13 +3351,13 @@ const le = (r) => {
3351
3351
  ei.includes(s.tagName) && !s.attributes.getNamedItem("fill") && s.setAttribute("fill", "black");
3352
3352
  const o = s.attributes.getNamedItem("fill");
3353
3353
  if (o && o.value !== "none" && !o.value.startsWith("url(")) {
3354
- const c = Oa(o.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-fill-${d}`;
3355
- s.setAttribute("fill", c.browserValue), s.classList.add(A), a[d] = c;
3354
+ const c = Oa(o.value), A = c.browserValue.replace(/\W/g, ""), d = `spiff-fill-${A}`;
3355
+ s.setAttribute("fill", c.browserValue), s.classList.add(d), a[A] = c;
3356
3356
  }
3357
3357
  const l = s.attributes.getNamedItem("stroke");
3358
3358
  if (l && l.value !== "none" && !l.value.startsWith("url(")) {
3359
- const c = Oa(l.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-stroke-${d}`;
3360
- s.classList.add(A), s.setAttribute("stroke", c.browserValue), a[d] = c;
3359
+ const c = Oa(l.value), A = c.browserValue.replace(/\W/g, ""), d = `spiff-stroke-${A}`;
3360
+ s.classList.add(d), s.setAttribute("stroke", c.browserValue), a[A] = c;
3361
3361
  }
3362
3362
  });
3363
3363
  const i = Bt().serializeToString(e);
@@ -3599,12 +3599,12 @@ class mi {
3599
3599
  throw new Error("Failed to create asset.");
3600
3600
  return await new Promise((o, l) => {
3601
3601
  const c = new XMLHttpRequest();
3602
- c.open("PUT", s.assetResponse.uploadUrl, !0), c.setRequestHeader("Content-Type", s.mimeType), c.setRequestHeader("Cache-Control", "public,max-age=31536000,immutable"), c.upload.onprogress = (d) => {
3603
- d.lengthComputable && a(d.loaded * 100 / d.total);
3602
+ c.open("PUT", s.assetResponse.uploadUrl, !0), c.setRequestHeader("Content-Type", s.mimeType), c.setRequestHeader("Cache-Control", "public,max-age=31536000,immutable"), c.upload.onprogress = (A) => {
3603
+ A.lengthComputable && a(A.loaded * 100 / A.total);
3604
3604
  }, c.onload = () => {
3605
- const d = s.assetResponse.asset;
3606
- At.add(s.assetResponse.asset), o(d);
3607
- }, c.onerror = l, this.postProcessFileUpload(t, s.mimeType).then((d) => c.send(d.blob)).catch(l);
3605
+ const A = s.assetResponse.asset;
3606
+ At.add(s.assetResponse.asset), o(A);
3607
+ }, c.onerror = l, this.postProcessFileUpload(t, s.mimeType).then((A) => c.send(A.blob)).catch(l);
3608
3608
  }), this.cacheAsset(s.assetResponse.asset), s.assetResponse.asset;
3609
3609
  }
3610
3610
  async uploadAsset(t, e, a, n) {
@@ -5335,11 +5335,11 @@ const M = () => {
5335
5335
  maxWidth: o,
5336
5336
  outlineArea: l,
5337
5337
  position: c,
5338
- preserveAspectRatio: d,
5339
- viewBox: A,
5338
+ preserveAspectRatio: A,
5339
+ viewBox: d,
5340
5340
  width: u
5341
5341
  }) => {
5342
- const h = e || 0, m = 2 * (l?.scale || 1), g = A || { x: 0, y: 0, width: u, height: i }, p = `${g.x} ${g.y} ${g.width} ${g.height}`, f = M(), S = a.purpose === jt.FreeDesign && /* @__PURE__ */ D("defs", { children: /* @__PURE__ */ D("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ D("rect", { width: g.width, height: g.height, rx: h }) }) }), v = a.colorProfiles?.map((b, P) => (
5342
+ const h = e || 0, m = 2 * (l?.scale || 1), g = d || { x: 0, y: 0, width: u, height: i }, p = `${g.x} ${g.y} ${g.width} ${g.height}`, f = M(), S = a.purpose === jt.FreeDesign && /* @__PURE__ */ D("defs", { children: /* @__PURE__ */ D("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ D("rect", { width: g.width, height: g.height, rx: h }) }) }), v = a.colorProfiles?.map((b, P) => (
5343
5343
  /* @ts-ignore */
5344
5344
  /* @__PURE__ */ D("color-profile", { name: b.name, xlinkHref: b.key, children: " " }, P)
5345
5345
  )), I = n.map((b) => ({
@@ -5354,7 +5354,7 @@ const M = () => {
5354
5354
  xmlnsXlink: "http://www.w3.org/1999/xlink",
5355
5355
  xmlSpace: "preserve",
5356
5356
  version: "1.1",
5357
- preserveAspectRatio: d,
5357
+ preserveAspectRatio: A,
5358
5358
  width: u,
5359
5359
  height: i,
5360
5360
  style: {
@@ -5425,7 +5425,7 @@ const M = () => {
5425
5425
  }
5426
5426
  );
5427
5427
  }, Uc = (r, t, e, a, n) => {
5428
- const i = ft(n), s = e / 2, o = a / 2, l = r + s, c = t + o, d = Math.sin(i), A = Math.cos(i), u = s, h = s, m = -o, g = o, p = u * A - m * d, f = h * A - g * d, S = u * d + m * A, v = h * d + g * A, I = Math.max(Math.abs(p), Math.abs(f)), C = Math.max(Math.abs(S), Math.abs(v));
5428
+ const i = ft(n), s = e / 2, o = a / 2, l = r + s, c = t + o, A = Math.sin(i), d = Math.cos(i), u = s, h = s, m = -o, g = o, p = u * d - m * A, f = h * d - g * A, S = u * A + m * d, v = h * A + g * d, I = Math.max(Math.abs(p), Math.abs(f)), C = Math.max(Math.abs(S), Math.abs(v));
5429
5429
  return {
5430
5430
  minX: l - I,
5431
5431
  maxX: l + I,
@@ -5560,8 +5560,8 @@ const M = () => {
5560
5560
  if (!r.pattern)
5561
5561
  return "";
5562
5562
  if (r.pattern.svg) {
5563
- const A = fa(r.pattern.svg, r.pattern.colors || {}, !1);
5564
- return ua(A);
5563
+ const d = fa(r.pattern.svg, r.pattern.colors || {}, !1);
5564
+ return ua(d);
5565
5565
  }
5566
5566
  return r.pattern.src;
5567
5567
  };
@@ -5586,12 +5586,12 @@ const M = () => {
5586
5586
  /* @__PURE__ */ D("feFuncG", { type: "discrete", tableValues: n() }),
5587
5587
  /* @__PURE__ */ D("feFuncB", { type: "discrete", tableValues: n() })
5588
5588
  ] })
5589
- ] }) }) }), s = r.rotation || 0, o = ft(s), l = Math.cos(o), c = -Math.sin(o), d = () => {
5590
- const A = r.pattern?.x || 0, u = r.pattern?.y || 0, h = r.pattern?.width || 0, m = r.pattern?.height || 0, g = r.pattern?.scaleX || 1, p = r.pattern?.scaleY || 1, f = r.pattern?.rotation || 0;
5589
+ ] }) }) }), s = r.rotation || 0, o = ft(s), l = Math.cos(o), c = -Math.sin(o), A = () => {
5590
+ const d = r.pattern?.x || 0, u = r.pattern?.y || 0, h = r.pattern?.width || 0, m = r.pattern?.height || 0, g = r.pattern?.scaleX || 1, p = r.pattern?.scaleY || 1, f = r.pattern?.rotation || 0;
5591
5591
  return [r.pattern?.svg ? {
5592
5592
  id: `${t}-contents`,
5593
5593
  type: x.Illustration,
5594
- x: A,
5594
+ x: d,
5595
5595
  y: u,
5596
5596
  rotation: f,
5597
5597
  width: h * g,
@@ -5602,7 +5602,7 @@ const M = () => {
5602
5602
  } : {
5603
5603
  id: `${t}-contents`,
5604
5604
  type: x.Image,
5605
- x: A,
5605
+ x: d,
5606
5606
  y: u,
5607
5607
  rotation: f,
5608
5608
  width: h * g,
@@ -5638,7 +5638,7 @@ const M = () => {
5638
5638
  width: r.width,
5639
5639
  height: r.height,
5640
5640
  clipPath: r.path,
5641
- children: d()
5641
+ children: A()
5642
5642
  }
5643
5643
  )
5644
5644
  }
@@ -5726,8 +5726,8 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ve = /* @_
5726
5726
  return Tn.set(r, e), e;
5727
5727
  }, _c = async (r) => {
5728
5728
  const t = dt(), e = t.parseFromString(r, "image/svg+xml"), a = e.firstElementChild, n = /* @__PURE__ */ new Map();
5729
- a.querySelectorAll("style").forEach((d) => {
5730
- on(d.innerHTML).stylesheet?.rules.forEach((u) => {
5729
+ a.querySelectorAll("style").forEach((A) => {
5730
+ on(A.innerHTML).stylesheet?.rules.forEach((u) => {
5731
5731
  if (u.type === "font-face" && u.declarations) {
5732
5732
  const h = u.declarations.find(
5733
5733
  (p) => p.property === "font-family"
@@ -5737,36 +5737,36 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ve = /* @_
5737
5737
  });
5738
5738
  });
5739
5739
  const s = e.querySelectorAll("tspan");
5740
- for (let d = 0; d < s.length; d++) {
5741
- const A = s.item(d), u = A.closest("text"), h = A.closest("g"), m = u.getAttribute("font-family"), g = await Tt(n.get(m)), p = u.getAttribute("fill"), f = u.getAttribute("stroke"), S = u.getAttribute("stroke-width"), v = g.getPath(
5742
- A.innerHTML,
5740
+ for (let A = 0; A < s.length; A++) {
5741
+ const d = s.item(A), u = d.closest("text"), h = d.closest("g"), m = u.getAttribute("font-family"), g = await Tt(n.get(m)), p = u.getAttribute("fill"), f = u.getAttribute("stroke"), S = u.getAttribute("stroke-width"), v = g.getPath(
5742
+ d.innerHTML,
5743
5743
  0,
5744
5744
  0,
5745
5745
  parseInt(u.getAttribute("font-size") ?? "72")
5746
5746
  ), I = v.getBoundingBox().x2 - v.getBoundingBox().x1;
5747
5747
  let C = 0;
5748
- const b = A.getAttribute("text-anchor");
5748
+ const b = d.getAttribute("text-anchor");
5749
5749
  b === "middle" ? C = I / 2 : b === "end" && (C = I);
5750
5750
  const P = g.getPath(
5751
- A.innerHTML,
5752
- parseFloat(A.getAttribute("x") ?? "0") - C,
5753
- parseFloat(A.getAttribute("y") ?? "0"),
5751
+ d.innerHTML,
5752
+ parseFloat(d.getAttribute("x") ?? "0") - C,
5753
+ parseFloat(d.getAttribute("y") ?? "0"),
5754
5754
  parseInt(u.getAttribute("font-size") ?? "72")
5755
5755
  );
5756
5756
  P.fill = p, P.stroke = f, P.strokeWidth = parseFloat(S ?? "0");
5757
5757
  const B = P.toSVG(2), Q = t.parseFromString(B, "image/svg+xml").firstElementChild;
5758
5758
  h.appendChild(Q);
5759
5759
  }
5760
- return e.querySelectorAll("text").forEach((d) => d.remove()), Bt().serializeToString(a);
5760
+ return e.querySelectorAll("text").forEach((A) => A.remove()), Bt().serializeToString(a);
5761
5761
  }, be = (r, t, e, a) => Math.max(ns(r.join(`
5762
5762
  `), e, a), t), Ua = (r, t, e, a, n, i) => {
5763
5763
  const s = (i || wa) * n.getApproximateHeight(), o = t.split(`
5764
5764
  `);
5765
5765
  try {
5766
- const l = o.flatMap((d) => ge(d, r.width, a, n)), c = l.flatMap((d) => d.lines);
5766
+ const l = o.flatMap((A) => ge(A, r.width, a, n)), c = l.flatMap((A) => A.lines);
5767
5767
  return {
5768
5768
  lines: c,
5769
- requiredHeight: l.flatMap((d) => d.lines).length * (a * s),
5769
+ requiredHeight: l.flatMap((A) => A.lines).length * (a * s),
5770
5770
  fontSize: e,
5771
5771
  requiredWidth: be(c, r.width, a, n)
5772
5772
  };
@@ -5786,33 +5786,33 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ve = /* @_
5786
5786
  if (!(r.indexOf(" ") > -1)) {
5787
5787
  if (r.length <= 1)
5788
5788
  throw new Error(`Character ${r} is wider than region`);
5789
- const d = Math.floor(r.length / 2), A = ge(r.slice(0, d), t, e, a), u = ge(r.slice(d), t, e, a);
5790
- return { lines: [...A.lines, ...u.lines], width: Math.max(A.width, u.width) };
5789
+ const A = Math.floor(r.length / 2), d = ge(r.slice(0, A), t, e, a), u = ge(r.slice(A), t, e, a);
5790
+ return { lines: [...d.lines, ...u.lines], width: Math.max(d.width, u.width) };
5791
5791
  }
5792
5792
  const s = r.split(" "), o = [];
5793
5793
  let l = -1 / 0, c = 0;
5794
5794
  for (; c < s.length; ) {
5795
- const d = s[c];
5796
- if (mt(d, e, a) > t) {
5797
- const A = ge(d, t, e, a);
5798
- o.push(...A.lines), l = Math.max(l, A.width), c++;
5795
+ const A = s[c];
5796
+ if (mt(A, e, a) > t) {
5797
+ const d = ge(A, t, e, a);
5798
+ o.push(...d.lines), l = Math.max(l, d.width), c++;
5799
5799
  } else {
5800
- const A = [d];
5801
- l = Math.max(l, mt(d, e, a));
5800
+ const d = [A];
5801
+ l = Math.max(l, mt(A, e, a));
5802
5802
  let u = c + 1, h = !0;
5803
5803
  for (; u < s.length && h; ) {
5804
- const m = s[u], g = mt(`${A.join(" ")} ${m}`, e, a);
5805
- g <= t ? (A.push(m), l = Math.max(l, g), u++) : h = !1;
5804
+ const m = s[u], g = mt(`${d.join(" ")} ${m}`, e, a);
5805
+ g <= t ? (d.push(m), l = Math.max(l, g), u++) : h = !1;
5806
5806
  }
5807
- o.push(A.join(" ")), c = u;
5807
+ o.push(d.join(" ")), c = u;
5808
5808
  }
5809
5809
  }
5810
5810
  if (l < 0)
5811
5811
  throw new Error(`No max width calculated for text: ${o}.`);
5812
5812
  return { lines: o, width: l };
5813
5813
  }, ts = (r, t, e, a, n, i) => {
5814
- const s = (i ?? wa) * t.getApproximateHeight(), o = 1 / e.unitsPerEm, l = Nn(r, o, t), c = r.length * s * o, d = a / l, A = n / c;
5815
- return Math.min(A, d);
5814
+ const s = (i ?? wa) * t.getApproximateHeight(), o = 1 / e.unitsPerEm, l = Nn(r, o, t), c = r.length * s * o, A = a / l, d = n / c;
5815
+ return Math.min(d, A);
5816
5816
  }, es = (r, t, e, a) => {
5817
5817
  const n = Et(t.fontData.assetUrl), i = n.getFont(), s = t.fontSize / i.unitsPerEm;
5818
5818
  if (!e)
@@ -5838,7 +5838,7 @@ const Xi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ve = /* @_
5838
5838
  const s = Et(t.assetUrl).getFont();
5839
5839
  let o = { ...r };
5840
5840
  const l = { ...r }, c = Nn(a, e / s.unitsPerEm, Et(t.assetUrl));
5841
- return c && c < o.width && (l.width = c, n === "left" ? (l.left += Math.sin(o.rotation * Math.PI / 360) * (o.width - c), l.top += Math.sin(o.rotation * Math.PI / 180) * (c - o.width) / 2) : n === "right" ? l.left += o.width - c : l.left += (o.width - c) / 2, a && rs(a, a).every(([d, A]) => d === A) && (o = l)), o;
5841
+ return c && c < o.width && (l.width = c, n === "left" ? (l.left += Math.sin(o.rotation * Math.PI / 360) * (o.width - c), l.top += Math.sin(o.rotation * Math.PI / 180) * (c - o.width) / 2) : n === "right" ? l.left += o.width - c : l.left += (o.width - c) / 2, a && rs(a, a).every(([A, d]) => A === d) && (o = l)), o;
5842
5842
  }, ze = 1, mt = (r, t, e) => {
5843
5843
  let a = 0;
5844
5844
  const n = e.getGlyphs(r);
@@ -5902,8 +5902,8 @@ function Rn(r, t) {
5902
5902
  return r;
5903
5903
  }
5904
5904
  const ss = (r) => {
5905
- const e = (r.rotation || 0) * Math.PI / 180, a = Math.cos(e), n = -Math.sin(e), i = `text-path-${r.id}`, s = `text-fill-${r.id}`, o = r.x + (r.curved ? 0 : r.width / 2), l = r.y + (r.curved ? 0 : r.height / 2), c = Rn(r.text || "", r._renderingConfiguration?.templatingContext), d = c.split(`
5906
- `), A = r.strokeColor?.browserValue && r.strokeThickness ? r.strokeColor?.browserValue : void 0, u = r.strokeColor?.browserValue && r.strokeThickness ? r.strokeThickness : void 0;
5905
+ const e = (r.rotation || 0) * Math.PI / 180, a = Math.cos(e), n = -Math.sin(e), i = `text-path-${r.id}`, s = `text-fill-${r.id}`, o = r.x + (r.curved ? 0 : r.width / 2), l = r.y + (r.curved ? 0 : r.height / 2), c = Rn(r.text || "", r._renderingConfiguration?.templatingContext), A = c.split(`
5906
+ `), d = r.strokeColor?.browserValue && r.strokeThickness ? r.strokeColor?.browserValue : void 0, u = r.strokeColor?.browserValue && r.strokeThickness ? r.strokeThickness : void 0;
5907
5907
  if (r.curved && !r.paths || !r.fontData)
5908
5908
  return null;
5909
5909
  const h = () => r.textFillImage ? `url("#${s}")` : r._renderingConfiguration?.spotColors && r.fillSpotColorDefinition ? `${r.fill} ${wn(r.fillSpotColorDefinition)}` : r.fill;
@@ -5959,15 +5959,15 @@ const ss = (r) => {
5959
5959
  whiteSpace: "pre",
5960
5960
  userSelect: "none"
5961
5961
  },
5962
- stroke: A,
5962
+ stroke: d,
5963
5963
  strokeWidth: u,
5964
- children: r.curved ? /* @__PURE__ */ D(ls, { text: c, curvedPathId: i, align: r.align }) : d.map((m, g) => /* @__PURE__ */ D(
5964
+ children: r.curved ? /* @__PURE__ */ D(ls, { text: c, curvedPathId: i, align: r.align }) : A.map((m, g) => /* @__PURE__ */ D(
5965
5965
  os,
5966
5966
  {
5967
5967
  align: r.vertical ? "center" : r.align,
5968
5968
  fontSize: r.fontSize,
5969
5969
  thisLineIdx: g,
5970
- amountLines: d.length,
5970
+ amountLines: A.length,
5971
5971
  text: m,
5972
5972
  textboxHeight: r.height,
5973
5973
  textboxWidth: r.width,
@@ -6220,9 +6220,9 @@ const ne = (r) => {
6220
6220
  const s = i.getAttribute("viewBox");
6221
6221
  if (!s)
6222
6222
  throw new Error("SVG missing viewBox.");
6223
- const o = s.split(" "), l = parseFloat(o[3]) || 1, c = parseFloat(o[2]) || 1, d = n.getElementById("target-path"), A = n.getElementsByClassName("st0").item(0);
6224
- if (d) {
6225
- const u = d.getAttribute("d");
6223
+ const o = s.split(" "), l = parseFloat(o[3]) || 1, c = parseFloat(o[2]) || 1, A = n.getElementById("target-path"), d = n.getElementsByClassName("st0").item(0);
6224
+ if (A) {
6225
+ const u = A.getAttribute("d");
6226
6226
  if (!u)
6227
6227
  throw new Error("Malformed frame SVG: 'd' attribute not found on target element");
6228
6228
  const h = {
@@ -6232,8 +6232,8 @@ const ne = (r) => {
6232
6232
  };
6233
6233
  return Lt.set(u, h), h;
6234
6234
  }
6235
- if (A) {
6236
- const u = A.getAttribute("d");
6235
+ if (d) {
6236
+ const u = d.getAttribute("d");
6237
6237
  if (!u)
6238
6238
  throw new Error("Malformed frame SVG: 'd' attribute not found on target element");
6239
6239
  const h = {
@@ -6250,9 +6250,9 @@ const ne = (r) => {
6250
6250
  const n = t.width / t.height, i = r.width / r.height;
6251
6251
  let s;
6252
6252
  a ? i > n ? s = t.height / r.height : s = t.width / r.width : i > n ? s = t.width / r.width : s = t.height / r.height, e?.scale !== void 0 && (s *= e?.scale);
6253
- const o = t.width / 2, l = t.height / 2, c = o - r.width / 2 * s, d = e?.left || c, A = l - r.height / 2 * s, u = e?.top || A;
6253
+ const o = t.width / 2, l = t.height / 2, c = o - r.width / 2 * s, A = e?.left || c, d = l - r.height / 2 * s, u = e?.top || d;
6254
6254
  return {
6255
- x: d,
6255
+ x: A,
6256
6256
  y: u,
6257
6257
  zoom: s
6258
6258
  };
@@ -6324,7 +6324,7 @@ const ne = (r) => {
6324
6324
  const s = dt().parseFromString(r, "image/svg+xml").firstElementChild;
6325
6325
  if (!s)
6326
6326
  throw new Error("Failed to read SVG");
6327
- const l = Bt().serializeToString(s), c = pt(), d = c.getContext("2d"), A = await da.from(d, l, {
6327
+ const l = Bt().serializeToString(s), c = pt(), A = c.getContext("2d"), d = await da.from(A, l, {
6328
6328
  anonymousCrossOrigin: !0,
6329
6329
  ignoreDimensions: !1,
6330
6330
  createCanvas: pt,
@@ -6334,10 +6334,10 @@ const ne = (r) => {
6334
6334
  }), u = s.getAttribute("width"), h = s.getAttribute("height"), m = 2048;
6335
6335
  if (h && u) {
6336
6336
  const g = parseFloat(h), f = parseFloat(u) / g;
6337
- f > 1 ? A.resize(m, m / f) : A.resize(m * f, m);
6337
+ f > 1 ? d.resize(m, m / f) : d.resize(m * f, m);
6338
6338
  } else
6339
- A.resize(m, m);
6340
- return await A.render(), await t(c);
6339
+ d.resize(m, m);
6340
+ return await d.render(), await t(c);
6341
6341
  })();
6342
6342
  return We.set(r, a), a;
6343
6343
  }, $t = async (r, t, e, a) => {
@@ -6361,8 +6361,8 @@ const ne = (r) => {
6361
6361
  o.height = o.width / f, o.top += (h - o.height) / 2;
6362
6362
  }
6363
6363
  if (e && t === x.Image) {
6364
- const l = o.height, c = await ke(e), d = await Te(c), A = d.width / d.height;
6365
- o.height = o.width / A, o.top += (l - o.height) / 2;
6364
+ const l = o.height, c = await ke(e), A = await Te(c), d = A.width / A.height;
6365
+ o.height = o.width / d, o.top += (l - o.height) / 2;
6366
6366
  }
6367
6367
  if (e && t === x.Textbox && a?.text && a?.fontScale) {
6368
6368
  await Tt(e);
@@ -6419,38 +6419,38 @@ class Xc {
6419
6419
  const { configuration: a, fontSrc: n, designInputStep: i } = e, s = await Tt(n), o = {
6420
6420
  assetUrl: n,
6421
6421
  name: s.names.fullName.en
6422
- }, l = i?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = Be(c, {
6422
+ }, l = i?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, A = Be(c, {
6423
6423
  vertical: a.vertical,
6424
6424
  uppercase: a.uppercase
6425
- }), A = e.region || await $t(t, x.Textbox, n, {
6426
- text: d,
6425
+ }), d = e.region || await $t(t, x.Textbox, n, {
6426
+ text: A,
6427
6427
  fontScale: a.size ? a.size / s.unitsPerEm : void 0
6428
6428
  }), u = ae(
6429
6429
  {
6430
6430
  id: M(),
6431
6431
  type: x.Textbox,
6432
- x: A.left,
6433
- y: A.top,
6434
- width: A.width,
6435
- height: A.height,
6432
+ x: d.left,
6433
+ y: d.top,
6434
+ width: d.width,
6435
+ height: d.height,
6436
6436
  align: is(a.textAlign, a.vertical),
6437
6437
  curved: a.curved,
6438
6438
  fill: i?.color || a.colour || "#000000",
6439
6439
  fontData: o,
6440
- layer: A.layer || 0,
6441
- layerIndex: A.layerIndex || Ot(t, A.layer || 0),
6440
+ layer: d.layer || 0,
6441
+ layerIndex: d.layerIndex || Ot(t, d.layer || 0),
6442
6442
  paths: a.paths,
6443
- rotation: A.rotation,
6443
+ rotation: d.rotation,
6444
6444
  vertical: a.vertical,
6445
6445
  verticalAlign: a.verticalAlign || "middle",
6446
6446
  algorithm: kt.Traditional,
6447
- fontSize: a.size || Math.max(Math.round(A.height * 0.025), 1),
6448
- text: d,
6447
+ fontSize: a.size || Math.max(Math.round(d.height * 0.025), 1),
6448
+ text: A,
6449
6449
  input: l
6450
6450
  },
6451
- d
6451
+ A
6452
6452
  ), h = as(
6453
- { ...A, height: u.height },
6453
+ { ...d, height: u.height },
6454
6454
  o,
6455
6455
  u.fontSize,
6456
6456
  u?.text?.split(`
@@ -6460,7 +6460,7 @@ class Xc {
6460
6460
  return {
6461
6461
  ...u,
6462
6462
  x: h.left,
6463
- y: h.top + (A.height - h.height) / 2,
6463
+ y: h.top + (d.height - h.height) / 2,
6464
6464
  width: h.width,
6465
6465
  height: h.height
6466
6466
  };
@@ -7245,7 +7245,7 @@ class qa {
7245
7245
  command: new z(c, i)
7246
7246
  };
7247
7247
  } else {
7248
- const l = this.configuration.type === E.SilentIllustration ? this.configuration.data.asset?.fileLink : s, d = await ot(await (async () => new Promise((u, h) => {
7248
+ const l = this.configuration.type === E.SilentIllustration ? this.configuration.data.asset?.fileLink : s, A = await ot(await (async () => new Promise((u, h) => {
7249
7249
  if (!l) {
7250
7250
  h("Undefined vector silent step source");
7251
7251
  return;
@@ -7253,13 +7253,13 @@ class qa {
7253
7253
  at(l, !0).then((m) => {
7254
7254
  u(m);
7255
7255
  }).catch((m) => console.error(m));
7256
- }))()), A = {
7256
+ }))()), d = {
7257
7257
  stepName: this.configuration.stepName,
7258
7258
  id: M(),
7259
- cachedObjectURL: await _t(d.svg),
7259
+ cachedObjectURL: await _t(A.svg),
7260
7260
  src: l,
7261
- svg: d.svg,
7262
- colors: d.colors,
7261
+ svg: A.svg,
7262
+ colors: A.colors,
7263
7263
  type: o,
7264
7264
  y: n.top,
7265
7265
  x: n.left,
@@ -7274,10 +7274,10 @@ class qa {
7274
7274
  };
7275
7275
  return {
7276
7276
  regionElement: {
7277
- id: A.id,
7277
+ id: d.id,
7278
7278
  region: n
7279
7279
  },
7280
- command: new z(A, i)
7280
+ command: new z(d, i)
7281
7281
  };
7282
7282
  }
7283
7283
  }, this.configuration = t, this.layouts = e, this.product = a || void 0;
@@ -7348,10 +7348,10 @@ class ys {
7348
7348
  a.serializableWorkflow.steps
7349
7349
  ), l = Object.values(a.layouts).map((c) => c.elements).flat().filter((c) => c.stepName === t.stepName).map((c) => ({ id: c.id, region: c.stepRegion }));
7350
7350
  await e.setSelectionsAndElements(t.stepName, [], l, async () => {
7351
- const c = n?.storage?.videoShortUrl, d = n?.storage?.videoUrl;
7351
+ const c = n?.storage?.videoShortUrl, A = n?.storage?.videoUrl;
7352
7352
  e.updateStorage(t.stepName, {
7353
7353
  videoShortUrl: c,
7354
- videoUrl: d
7354
+ videoUrl: A
7355
7355
  });
7356
7356
  });
7357
7357
  }
@@ -7384,16 +7384,16 @@ class ys {
7384
7384
  const c = l.toString();
7385
7385
  if (c.length >= 2e3)
7386
7386
  throw new xe("Cannot create QR code, URL too long.");
7387
- const d = await ws(c);
7387
+ const A = await ws(c);
7388
7388
  if (!n.data || !n.data.regions)
7389
7389
  throw new ve(n, "Missing regions.");
7390
- const A = await this.regionElements(n), u = await this.command(d, A, a, n.stepName);
7391
- return u && (u.command && a.getCommandDispatcher()(u.command), u.followup && await u.followup()), await a.setSelectionsAndElements(n.stepName, [], A, async () => {
7390
+ const d = await this.regionElements(n), u = await this.command(A, d, a, n.stepName);
7391
+ return u && (u.command && a.getCommandDispatcher()(u.command), u.followup && await u.followup()), await a.setSelectionsAndElements(n.stepName, [], d, async () => {
7392
7392
  a.updateStorage(n.stepName, {
7393
- videoShortUrl: d,
7393
+ videoShortUrl: A,
7394
7394
  videoUrl: s.href
7395
7395
  });
7396
- }), d;
7396
+ }), A;
7397
7397
  }
7398
7398
  async regionElements(t) {
7399
7399
  const e = (a) => ({ id: M(), region: a });
@@ -7401,27 +7401,27 @@ class ys {
7401
7401
  }
7402
7402
  async command(t, e, a, n) {
7403
7403
  const i = a.getLayouts(), o = `data:image/svg+xml;base64,${btoa(await ln(t, { type: "svg" }))}`, l = e.map((c) => {
7404
- const d = c.region, A = i.find((u) => u.panelId === d?.panelId);
7405
- if (!A && d)
7406
- throw new Y(d);
7407
- if (A && !d)
7404
+ const A = c.region, d = i.find((u) => u.panelId === A?.panelId);
7405
+ if (!d && A)
7406
+ throw new Y(A);
7407
+ if (d && !A)
7408
7408
  throw new Error("Region not found");
7409
- if (!A || !d)
7409
+ if (!d || !A)
7410
7410
  throw new Error("Neither a region or layout found!");
7411
7411
  return new z(
7412
7412
  {
7413
- stepRegion: d,
7413
+ stepRegion: A,
7414
7414
  stepName: n,
7415
7415
  id: c.id,
7416
7416
  src: o,
7417
7417
  type: x.Image,
7418
- y: d.top,
7419
- x: d.left,
7420
- width: d.width,
7421
- height: d.height,
7418
+ y: A.top,
7419
+ x: A.left,
7420
+ width: A.width,
7421
+ height: A.height,
7422
7422
  rotation: 0
7423
7423
  },
7424
- A
7424
+ d
7425
7425
  );
7426
7426
  });
7427
7427
  return { command: new R(l), followup: async () => {
@@ -7482,22 +7482,22 @@ class Ie {
7482
7482
  a.serializableWorkflow.steps
7483
7483
  ), l = Object.values(a.layouts).map((c) => c.elements).flat().filter((c) => c.stepName === t.stepName).map((c) => ({ id: c.id, region: c.stepRegion }));
7484
7484
  if (!t.option || (t.option.variants || []).length === 0) {
7485
- const c = t.data.regions.map((d) => sa(d));
7485
+ const c = t.data.regions.map((A) => sa(A));
7486
7486
  e.updateStorage(t.stepName, {
7487
7487
  currentFrameSources: c
7488
7488
  });
7489
7489
  }
7490
7490
  if (n) {
7491
7491
  const c = async () => {
7492
- const d = n.storage?.colors, A = n.storage?.framePatternSrc, u = n.storage?.frameOffsetsList;
7492
+ const A = n.storage?.colors, d = n.storage?.framePatternSrc, u = n.storage?.frameOffsetsList;
7493
7493
  if (e.updateMetadata(t.stepName, {
7494
7494
  frameOffsetsList: u,
7495
- framePatternSrc: A
7496
- }), A) {
7495
+ framePatternSrc: d
7496
+ }), d) {
7497
7497
  const h = e.getWorkflowExperience().getStepById(t.stepName)?.frameService;
7498
7498
  if (!h) throw new Error("Frame service unavailable, cannot load pattern!");
7499
- await this.loadPatternFromString(A, h, !0, d), e.updateMetadata(t.stepName, { image: A }), e.updateStorage(t.stepName, {
7500
- framePatternSrc: A
7499
+ await this.loadPatternFromString(d, h, !0, A), e.updateMetadata(t.stepName, { image: d }), e.updateStorage(t.stepName, {
7500
+ framePatternSrc: d
7501
7501
  }), this.validateColorCount(t, e);
7502
7502
  }
7503
7503
  if (u?.some((h) => h.zoom)) {
@@ -7508,16 +7508,16 @@ class Ie {
7508
7508
  e.setMandatoryFulfilled(t.stepName, !0);
7509
7509
  };
7510
7510
  if (n.selectedVariants && n.selectedVariants.length > 0) {
7511
- const d = n.selectedVariants[0].id;
7512
- if (t.option && d) {
7513
- const A = t.option.variants?.find((u) => u.id === d);
7514
- A && await e.setSelectionsAndElements(
7511
+ const A = n.selectedVariants[0].id;
7512
+ if (t.option && A) {
7513
+ const d = t.option.variants?.find((u) => u.id === A);
7514
+ d && await e.setSelectionsAndElements(
7515
7515
  t.stepName,
7516
- [A],
7516
+ [d],
7517
7517
  l,
7518
7518
  async () => {
7519
7519
  const u = await Promise.all(
7520
- t.data.regions.map((h) => this.frameSourceSvg(A, h))
7520
+ t.data.regions.map((h) => this.frameSourceSvg(d, h))
7521
7521
  );
7522
7522
  e.updateStorage(t.stepName, { currentFrameSources: u }), await c();
7523
7523
  }
@@ -7545,8 +7545,8 @@ class Ie {
7545
7545
  a.addPoller(
7546
7546
  new zn(
7547
7547
  async () => {
7548
- const d = (await O.getFromServer(e.key || "")).versions?.find((u) => u.name === "svg");
7549
- return d ? (await nt(d.link)).status === 200 : !1;
7548
+ const A = (await O.getFromServer(e.key || "")).versions?.find((u) => u.name === "svg");
7549
+ return A ? (await nt(A.link)).status === 200 : !1;
7550
7550
  },
7551
7551
  () => {
7552
7552
  O.getLocalOrFromServer(e.key || "").then((c) => {
@@ -7608,15 +7608,15 @@ class Ie {
7608
7608
  "Vector files may not include images or gradients when a color limit is specified."
7609
7609
  );
7610
7610
  }
7611
- const d = await ot(c), A = {
7611
+ const A = await ot(c), d = {
7612
7612
  src: t,
7613
7613
  width: o,
7614
7614
  height: l,
7615
7615
  aspect: o / l,
7616
- svg: d.svg,
7617
- colors: n ?? d.colors
7616
+ svg: A.svg,
7617
+ colors: n ?? A.colors
7618
7618
  };
7619
- ut.set(t, A), e.setPatternData(A, a);
7619
+ ut.set(t, d), e.setPatternData(d, a);
7620
7620
  } else {
7621
7621
  const s = await ke(t, !0), o = await Te(s), l = {
7622
7622
  src: t,
@@ -7671,8 +7671,8 @@ class Ie {
7671
7671
  };
7672
7672
  const n = { ...t.getImageData().colors ?? {} }, i = {};
7673
7673
  Object.entries(n).forEach(([l, c]) => {
7674
- const d = { browserValue: c.browserValue };
7675
- i[l] = d;
7674
+ const A = { browserValue: c.browserValue };
7675
+ i[l] = A;
7676
7676
  });
7677
7677
  for (const [l, c] of a.entries())
7678
7678
  n[l] = { browserValue: c.browserValue, pmsValue: c.pmsValue }, i[l] = c;
@@ -7701,7 +7701,7 @@ class Ie {
7701
7701
  t.data.regions.map((h) => this.frameSourceSvg(e, h))
7702
7702
  );
7703
7703
  i && i(!0);
7704
- const c = t.data.initialZoomLevel, d = await Promise.all(
7704
+ const c = t.data.initialZoomLevel, A = await Promise.all(
7705
7705
  t.data.regions.map(async (h, m) => {
7706
7706
  const g = await Re(l[m]), p = o.getImageData(), f = a.map((P) => new bt(P.id)), S = p ? va(
7707
7707
  p,
@@ -7735,14 +7735,14 @@ class Ie {
7735
7735
  removeExistingCommands: f
7736
7736
  };
7737
7737
  })
7738
- ), A = d.map((h) => h.command), u = d.map((h) => h.removeExistingCommands).flat();
7738
+ ), d = A.map((h) => h.command), u = A.map((h) => h.removeExistingCommands).flat();
7739
7739
  return {
7740
- command: new R([...A, ...u]),
7740
+ command: new R([...d, ...u]),
7741
7741
  followup: async () => {
7742
7742
  i && i(!1), await n.setSelectionsAndElements(
7743
7743
  t.stepName,
7744
7744
  e ? [e] : [],
7745
- [...d.map((h) => h.regionEl)],
7745
+ [...A.map((h) => h.regionEl)],
7746
7746
  async () => {
7747
7747
  if (n.updateStorage(t.stepName, { currentFrameSources: l }), s) {
7748
7748
  const h = n.getWorkflowExperience().getStepById(t.stepName)?.frameService;
@@ -7860,13 +7860,13 @@ class Ss {
7860
7860
  if (n?.selectedVariants) {
7861
7861
  const c = n.selectedVariants[0].id;
7862
7862
  if (l && c) {
7863
- const d = l.variants?.find((A) => A.id === c);
7864
- if (d) {
7865
- const A = o.map((u) => ({ id: u.id, region: u.stepRegion }));
7863
+ const A = l.variants?.find((d) => d.id === c);
7864
+ if (A) {
7865
+ const d = o.map((u) => ({ id: u.id, region: u.stepRegion }));
7866
7866
  await e.setSelectionsAndElements(
7867
7867
  t.stepName,
7868
- [d],
7869
- A,
7868
+ [A],
7869
+ d,
7870
7870
  async () => {
7871
7871
  e.updateMetadata(t.stepName, {
7872
7872
  colors: n.storage?.colors
@@ -7889,21 +7889,21 @@ class Ss {
7889
7889
  }
7890
7890
  async changeColorsCommand(t, e, a, n, i) {
7891
7891
  const s = {};
7892
- for (const [d, A] of i.entries())
7893
- typeof A == "string" ? s[d] = {
7894
- browserValue: A,
7892
+ for (const [A, d] of i.entries())
7893
+ typeof d == "string" ? s[A] = {
7894
+ browserValue: d,
7895
7895
  spotColor: void 0,
7896
7896
  pmsValue: void 0
7897
- } : s[d] = {
7898
- browserValue: A.browserValue,
7899
- spotColor: A.spotColor,
7900
- pmsValue: A.pmsValue
7897
+ } : s[A] = {
7898
+ browserValue: d.browserValue,
7899
+ spotColor: d.spotColor,
7900
+ pmsValue: d.pmsValue
7901
7901
  };
7902
7902
  const o = pa(t, e, a, s), l = await _t(o), c = [];
7903
- for (const d of n) {
7904
- for (const [A, u] of i.entries())
7905
- c.push(new la(d, A, u));
7906
- c.push(new Cs(d, o, l));
7903
+ for (const A of n) {
7904
+ for (const [d, u] of i.entries())
7905
+ c.push(new la(A, d, u));
7906
+ c.push(new Cs(A, o, l));
7907
7907
  }
7908
7908
  return new R(c);
7909
7909
  }
@@ -7923,13 +7923,13 @@ class Ss {
7923
7923
  o[h] = { browserValue: g, spotColor: o[h]?.spotColor, pmsValue: p }, l[h] = { browserValue: g };
7924
7924
  }
7925
7925
  let c = Array.from(Object.values(o)).map((h) => h.browserValue);
7926
- const d = t.data.colorOption;
7927
- d && d.variants?.forEach((h) => {
7926
+ const A = t.data.colorOption;
7927
+ A && A.variants?.forEach((h) => {
7928
7928
  c = c.map((m) => m.toLowerCase() === h.color?.toLowerCase() ? h.name : m);
7929
7929
  }), a.updateMetadata(t.stepName, { colors: c });
7930
- const A = /* @__PURE__ */ new Map();
7930
+ const d = /* @__PURE__ */ new Map();
7931
7931
  if (Object.entries(o).forEach(([h, m]) => {
7932
- A.set(h, m);
7932
+ d.set(h, m);
7933
7933
  }), !s.svg)
7934
7934
  throw new Error("Colors changed before SVG loaded. This should never happen!");
7935
7935
  const u = await this.changeColorsCommand(
@@ -7937,7 +7937,7 @@ class Ss {
7937
7937
  s.width,
7938
7938
  s.height,
7939
7939
  e.map((h) => h.id),
7940
- A
7940
+ d
7941
7941
  );
7942
7942
  a.updateStorage(t.stepName, {
7943
7943
  colors: l
@@ -7959,7 +7959,7 @@ class Ss {
7959
7959
  const l = o.fileLink;
7960
7960
  if (!l)
7961
7961
  throw new Ht(o);
7962
- const c = await ot(await this.getIllustrationBody(l)), d = await _t(c.svg), A = (f) => {
7962
+ const c = await ot(await this.getIllustrationBody(l)), A = await _t(c.svg), d = (f) => {
7963
7963
  const S = i.getLayouts().find((I) => I.panelId === f.panelId);
7964
7964
  if (!S)
7965
7965
  throw new Y(f);
@@ -7969,11 +7969,11 @@ class Ss {
7969
7969
  command: this.getCreateElementCommand(v, f, S, {
7970
7970
  stepName: t.stepName,
7971
7971
  src: l,
7972
- objectURL: d,
7972
+ objectURL: A,
7973
7973
  svg: c
7974
7974
  })
7975
7975
  };
7976
- }, u = t.data.regions.map(A), m = [...u.map((f) => f.command), ...s];
7976
+ }, u = t.data.regions.map(d), m = [...u.map((f) => f.command), ...s];
7977
7977
  let g = Array.from(Object.values(c.colors)).map((f) => f.browserValue);
7978
7978
  const p = t.data.colorOption;
7979
7979
  return p && p.variants?.forEach((f) => {
@@ -8052,12 +8052,12 @@ class vs {
8052
8052
  if (n?.selectedVariants) {
8053
8053
  const c = n.selectedVariants[0].id;
8054
8054
  if (c) {
8055
- const d = l.variants?.find((A) => A.id === c);
8056
- if (d) {
8057
- const A = d.material, u = o.map((h) => ({ id: h.id, region: h.stepRegion }));
8055
+ const A = l.variants?.find((d) => d.id === c);
8056
+ if (A) {
8057
+ const d = A.material, u = o.map((h) => ({ id: h.id, region: h.stepRegion }));
8058
8058
  await e.setSelectionsAndElements(
8059
8059
  t.stepName,
8060
- [d],
8060
+ [A],
8061
8061
  u,
8062
8062
  async () => {
8063
8063
  const h = e.getModelContainer();
@@ -8065,7 +8065,7 @@ class vs {
8065
8065
  const m = t.data.targetMaterials.map((g) => h.applyMaterialVariant(
8066
8066
  g,
8067
8067
  l.id || "",
8068
- A || {}
8068
+ d || {}
8069
8069
  ));
8070
8070
  Promise.all(m).then(
8071
8071
  () => e.setMandatoryFulfilled(t.stepName, !0)
@@ -8126,18 +8126,18 @@ class Es {
8126
8126
  if (n?.selectedVariants) {
8127
8127
  const c = n.selectedVariants[0].id;
8128
8128
  if (l && c) {
8129
- const d = l.variants?.find((A) => A.id === c);
8130
- if (d) {
8131
- const A = o.map((u) => ({ id: u.id, region: u.stepRegion }));
8129
+ const A = l.variants?.find((d) => d.id === c);
8130
+ if (A) {
8131
+ const d = o.map((u) => ({ id: u.id, region: u.stepRegion }));
8132
8132
  await e.setSelectionsAndElements(
8133
8133
  t.stepName,
8134
- [d],
8135
- A,
8134
+ [A],
8135
+ d,
8136
8136
  async () => {
8137
8137
  const u = e.getModelContainer();
8138
8138
  if (u && t.option) {
8139
- const h = d.asset?.fileLink;
8140
- if (!h) throw new vt(d);
8139
+ const h = A.asset?.fileLink;
8140
+ if (!h) throw new vt(A);
8141
8141
  await u.applyModelVariant(
8142
8142
  t.stepName || "",
8143
8143
  {
@@ -8217,57 +8217,57 @@ class bs {
8217
8217
  if (a.setMandatoryFulfilled(t.stepName, e !== ""), !t.data || !t.data.regions || t.data.regions.length <= 0)
8218
8218
  return console.error("Missing configuration."), null;
8219
8219
  a.updateStorage(t.stepName, { text: e }), a.updateMetadata(t.stepName, { text: e });
8220
- const c = (d, A, u) => {
8221
- const h = u || M(), g = a.getLayouts().find((f) => f.panelId === A.panelId);
8220
+ const c = (A, d, u) => {
8221
+ const h = u || M(), g = a.getLayouts().find((f) => f.panelId === d.panelId);
8222
8222
  if (!g)
8223
- return console.error(`Can not find layout for region: ${A.panelId}`), null;
8223
+ return console.error(`Can not find layout for region: ${d.panelId}`), null;
8224
8224
  const p = [];
8225
8225
  return u && p.push(new bt(h)), p.push(
8226
8226
  new z(
8227
8227
  {
8228
- stepRegion: A,
8228
+ stepRegion: d,
8229
8229
  stepName: t.stepName,
8230
8230
  colors: {},
8231
8231
  id: h,
8232
- svg: d,
8232
+ svg: A,
8233
8233
  type: x.Illustration,
8234
- y: A.top,
8235
- x: A.left,
8236
- rotation: A.rotation,
8237
- width: A.width,
8238
- height: A.height,
8239
- layer: A.layer,
8240
- layerIndex: A.layerIndex,
8241
- immutable: A.immutable
8234
+ y: d.top,
8235
+ x: d.left,
8236
+ rotation: d.rotation,
8237
+ width: d.width,
8238
+ height: d.height,
8239
+ layer: d.layer,
8240
+ layerIndex: d.layerIndex,
8241
+ immutable: d.immutable
8242
8242
  },
8243
8243
  g
8244
8244
  )
8245
8245
  ), {
8246
8246
  id: h,
8247
- region: A,
8247
+ region: d,
8248
8248
  command: new R(p)
8249
8249
  };
8250
8250
  };
8251
8251
  if (i.length > 0) {
8252
- const A = i.map((u) => {
8252
+ const d = i.map((u) => {
8253
8253
  if (!u.region)
8254
8254
  return null;
8255
8255
  const h = s.svgPrint(e, u.region);
8256
8256
  return c(h, u.region, u.id);
8257
8257
  }).filter((u) => !!u).filter((u) => !!u).map((u) => u && u.command);
8258
8258
  return {
8259
- command: new R(A),
8259
+ command: new R(d),
8260
8260
  followup: async () => {
8261
8261
  }
8262
8262
  };
8263
8263
  } else {
8264
- const d = t.data.regions.map(
8264
+ const A = t.data.regions.map(
8265
8265
  (u) => c(s.svgPrint(e, u), u)
8266
- ), A = d.filter((u) => !!u).map((u) => u && u.command);
8266
+ ), d = A.filter((u) => !!u).map((u) => u && u.command);
8267
8267
  return {
8268
- command: new R(A),
8268
+ command: new R(d),
8269
8269
  followup: async () => {
8270
- const u = d.filter((h) => h).map((h) => h && { id: h.id, region: h.region });
8270
+ const u = A.filter((h) => h).map((h) => h && { id: h.id, region: h.region });
8271
8271
  await a.setSelectionsAndElements(
8272
8272
  t.stepName,
8273
8273
  [],
@@ -8316,13 +8316,13 @@ class Bs {
8316
8316
  if (n?.selectedVariants) {
8317
8317
  const c = n.selectedVariants[0].id;
8318
8318
  if (l && c) {
8319
- const d = l.variants?.find((A) => A.id === c);
8320
- if (d) {
8321
- const A = o.map((u) => ({ id: u.id, region: u.stepRegion }));
8319
+ const A = l.variants?.find((d) => d.id === c);
8320
+ if (A) {
8321
+ const d = o.map((u) => ({ id: u.id, region: u.stepRegion }));
8322
8322
  await e.setSelectionsAndElements(
8323
8323
  t.stepName,
8324
- [d],
8325
- A,
8324
+ [A],
8325
+ d,
8326
8326
  async () => {
8327
8327
  e.setMandatoryFulfilled(t.stepName, !0);
8328
8328
  }
@@ -8343,41 +8343,41 @@ class Bs {
8343
8343
  if (!s)
8344
8344
  return console.error("No URL for picture!"), null;
8345
8345
  n(!0), t.mandatory && a.setMandatoryFulfilled(t.stepName, !1);
8346
- const l = a.getRegionElements(t.stepName).map((A) => new bt(A.id)), c = (A) => {
8347
- const h = a.getLayouts().find((g) => g.panelId === A.panelId);
8346
+ const l = a.getRegionElements(t.stepName).map((d) => new bt(d.id)), c = (d) => {
8347
+ const h = a.getLayouts().find((g) => g.panelId === d.panelId);
8348
8348
  if (!h)
8349
- throw new Y(A);
8349
+ throw new Y(d);
8350
8350
  const m = M();
8351
8351
  return {
8352
- regionElement: { id: m, region: A },
8352
+ regionElement: { id: m, region: d },
8353
8353
  command: new z(
8354
8354
  {
8355
8355
  stepName: t.stepName,
8356
- stepRegion: A,
8356
+ stepRegion: d,
8357
8357
  id: m,
8358
8358
  src: s,
8359
8359
  type: x.Image,
8360
- y: A.top,
8361
- x: A.left,
8362
- rotation: A.rotation,
8363
- width: A.width,
8364
- height: A.height,
8365
- layer: A.layer,
8366
- layerIndex: A.layerIndex,
8367
- immutable: A.immutable,
8360
+ y: d.top,
8361
+ x: d.left,
8362
+ rotation: d.rotation,
8363
+ width: d.width,
8364
+ height: d.height,
8365
+ layer: d.layer,
8366
+ layerIndex: d.layerIndex,
8367
+ immutable: d.immutable,
8368
8368
  preserveAspectRatio: "none"
8369
8369
  },
8370
8370
  h
8371
8371
  )
8372
8372
  };
8373
- }, d = t.data.regions.map(c);
8373
+ }, A = t.data.regions.map(c);
8374
8374
  return {
8375
- command: new R([...l, ...d.map((A) => A.command)]),
8375
+ command: new R([...l, ...A.map((d) => d.command)]),
8376
8376
  followup: async () => {
8377
8377
  await a.setSelectionsAndElements(
8378
8378
  t.stepName,
8379
8379
  [e],
8380
- d.map((A) => A.regionElement),
8380
+ A.map((d) => d.regionElement),
8381
8381
  async () => {
8382
8382
  a.setMandatoryFulfilled(t.stepName, !0), n(!1);
8383
8383
  }
@@ -8458,7 +8458,7 @@ class Ps {
8458
8458
  setCustomColor(t, e, a) {
8459
8459
  const n = a.getLayouts(), s = (a.getRegionElements(e.stepName) || []).map((o) => {
8460
8460
  const l = o.region;
8461
- if (!n.find((d) => d.panelId === l?.panelId)) throw new Y(l);
8461
+ if (!n.find((A) => A.panelId === l?.panelId)) throw new Y(l);
8462
8462
  return new la(o.id, this.shapeFillId, t);
8463
8463
  }).filter((o) => !!o);
8464
8464
  a.getCommandDispatcher()(new R(s)), a.updateStorage(e.stepName, { colour: t });
@@ -8496,13 +8496,13 @@ class Ps {
8496
8496
  if (n?.selectedVariants) {
8497
8497
  const c = n.selectedVariants[0].id;
8498
8498
  if (l && c) {
8499
- const d = l.variants?.find((A) => A.id === c);
8500
- if (d) {
8501
- const A = o.map((u) => ({ id: u.id, region: u.stepRegion }));
8499
+ const A = l.variants?.find((d) => d.id === c);
8500
+ if (A) {
8501
+ const d = o.map((u) => ({ id: u.id, region: u.stepRegion }));
8502
8502
  await e.setSelectionsAndElements(
8503
8503
  t.stepName,
8504
- [d],
8505
- A,
8504
+ [A],
8505
+ d,
8506
8506
  async () => {
8507
8507
  e.updateStorage(t.stepName, {
8508
8508
  colour: n?.storage?.colour || ""
@@ -8520,13 +8520,13 @@ class Ps {
8520
8520
  throw new Error("Failed to resolve color for shape step.");
8521
8521
  };
8522
8522
  if (a.length > 0) {
8523
- const l = (d) => {
8524
- const A = d.region;
8525
- if (!i.find((m) => m.panelId === A?.panelId))
8526
- throw new Y(A);
8523
+ const l = (A) => {
8524
+ const d = A.region;
8525
+ if (!i.find((m) => m.panelId === d?.panelId))
8526
+ throw new Y(d);
8527
8527
  const h = o();
8528
- return new la(d.id, this.shapeFillId, h);
8529
- }, c = a.map(l).filter((d) => !!d);
8528
+ return new la(A.id, this.shapeFillId, h);
8529
+ }, c = a.map(l).filter((A) => !!A);
8530
8530
  return {
8531
8531
  command: new R(c),
8532
8532
  followup: async () => {
@@ -8589,14 +8589,14 @@ class Ps {
8589
8589
  h
8590
8590
  )
8591
8591
  };
8592
- }, c = t.data.regions.map(l), d = c.filter((u) => !!u).map((u) => u?.command), A = c.filter((u) => !!u).map((u) => ({ id: u.id, region: u.region }));
8592
+ }, c = t.data.regions.map(l), A = c.filter((u) => !!u).map((u) => u?.command), d = c.filter((u) => !!u).map((u) => ({ id: u.id, region: u.region }));
8593
8593
  return {
8594
- command: new R(d),
8594
+ command: new R(A),
8595
8595
  followup: async () => {
8596
8596
  await n.setSelectionsAndElements(
8597
8597
  t.stepName,
8598
8598
  e.variant ? [e.variant] : [],
8599
- A,
8599
+ d,
8600
8600
  async () => {
8601
8601
  n.updateStorage(t.stepName, { colour: o() });
8602
8602
  }
@@ -8633,18 +8633,18 @@ class Ds {
8633
8633
  }
8634
8634
  }
8635
8635
  const Fs = new Ds(), He = (r, t, e, a, n) => {
8636
- if (t.some((d) => d == null))
8636
+ if (t.some((A) => A == null))
8637
8637
  throw new Error(`Failed to autosize lines: ${t.join(", ")}`);
8638
- let i = t.map((d) => d.split(`
8639
- `)).flat(), s = i.length, o = i.map((d) => mt(d, a, n));
8638
+ let i = t.map((A) => A.split(`
8639
+ `)).flat(), s = i.length, o = i.map((A) => mt(A, a, n));
8640
8640
  const l = n.getApproximateHeight() * a;
8641
8641
  let c = !0;
8642
8642
  for (; c; ) {
8643
8643
  if (l + (s - 1) * e > r.height)
8644
8644
  return [null, null];
8645
- const A = Math.max(...o);
8646
- if (A <= r.width)
8647
- return [i, A];
8645
+ const d = Math.max(...o);
8646
+ if (d <= r.width)
8647
+ return [i, d];
8648
8648
  const u = o.reduce((p, f, S, v) => f > v[p] ? S : p, 0), h = i[u];
8649
8649
  let m = !1, g = h.length;
8650
8650
  for (; !m && g > -1; ) {
@@ -8667,15 +8667,15 @@ const Fs = new Ds(), He = (r, t, e, a, n) => {
8667
8667
  return [i, s] = He(e, a, r, u, o), [n.size, i, s];
8668
8668
  }
8669
8669
  const c = 6;
8670
- let d = c - ze;
8670
+ let A = c - ze;
8671
8671
  if (a.length > 0) {
8672
8672
  let u = a, h = 0;
8673
- for (; (!n.maxSize || d <= n.maxSize) && u; )
8674
- d += ze, h = d / l.unitsPerEm, [u, s] = He(e, a, d, h, o);
8673
+ for (; (!n.maxSize || A <= n.maxSize) && u; )
8674
+ A += ze, h = A / l.unitsPerEm, [u, s] = He(e, a, A, h, o);
8675
8675
  }
8676
- d > c && (d -= ze), n.minSize && d < n.minSize && (d = n.minSize);
8677
- const A = d / l.unitsPerEm;
8678
- return [i, s] = He(e, a, d, A, o), [d, i, s];
8676
+ A > c && (A -= ze), n.minSize && A < n.minSize && (A = n.minSize);
8677
+ const d = A / l.unitsPerEm;
8678
+ return [i, s] = He(e, a, A, d, o), [A, i, s];
8679
8679
  }, Ye = 30;
8680
8680
  class Pe extends Error {
8681
8681
  constructor(t) {
@@ -8710,9 +8710,9 @@ class ks {
8710
8710
  a.data && a.data.maxLength && e.length > a.data.maxLength && (i || (i = {}), i.hitCharacterLimit = !0);
8711
8711
  const s = n.getProfanities(), o = ta(t.toLowerCase());
8712
8712
  for (const c of o)
8713
- for (const d in s) {
8714
- const A = s[d].toLowerCase().replace(/\s/g, "");
8715
- if (c === A) {
8713
+ for (const A in s) {
8714
+ const d = s[A].toLowerCase().replace(/\s/g, "");
8715
+ if (c === d) {
8716
8716
  i || (i = {}), i.blockedProfanity = !0;
8717
8717
  break;
8718
8718
  }
@@ -8733,11 +8733,11 @@ class ks {
8733
8733
  height: o.height,
8734
8734
  width: o.width,
8735
8735
  scale: t.data.imageFillScale || 1
8736
- } : void 0, c = this.getDefaultStrokeColorVariant(t.data), d = t.data.strokeEnabled && c?.color ? {
8736
+ } : void 0, c = this.getDefaultStrokeColorVariant(t.data), A = t.data.strokeEnabled && c?.color ? {
8737
8737
  browserValue: c.color,
8738
8738
  pmsValue: c.name
8739
8739
  } : void 0;
8740
- let A = t.data.defaultText || "";
8740
+ let d = t.data.defaultText || "";
8741
8741
  const u = e.getWorkflowExperience().getBundle();
8742
8742
  if (u && t.globalPropertyAspectConfigurations) {
8743
8743
  const g = u.getGlobalPropertyConfiguration()?.aspects?.find(
@@ -8745,17 +8745,17 @@ class ks {
8745
8745
  );
8746
8746
  if (g) {
8747
8747
  const f = u.getGlobalPropertyStateManager().getAspect(g.name);
8748
- f && (A = f);
8748
+ f && (d = f);
8749
8749
  }
8750
8750
  }
8751
8751
  e.updateStorage(t.stepName, {
8752
- text: A,
8752
+ text: d,
8753
8753
  inputText: t.data.defaultText || "",
8754
8754
  color: this.getDefaultColorVariant(t.data)?.color || this.getDefaultColor(t.data),
8755
8755
  fillImage: l,
8756
- strokeColor: d
8756
+ strokeColor: A
8757
8757
  }), e.updateMetadata(t.stepName, {
8758
- text: A,
8758
+ text: d,
8759
8759
  color: this.getDefaultColorVariant(t.data)?.name || this.getDefaultColor(t.data),
8760
8760
  fillImage: i?.name,
8761
8761
  strokeColor: t.data.strokeEnabled ? c?.color : void 0
@@ -8765,7 +8765,7 @@ class ks {
8765
8765
  return this.selectVariantCommand(
8766
8766
  t,
8767
8767
  h,
8768
- { text: A },
8768
+ { text: d },
8769
8769
  [],
8770
8770
  e,
8771
8771
  () => {
@@ -8773,7 +8773,7 @@ class ks {
8773
8773
  () => {
8774
8774
  },
8775
8775
  l,
8776
- d
8776
+ A
8777
8777
  );
8778
8778
  }
8779
8779
  return null;
@@ -8912,7 +8912,7 @@ class ks {
8912
8912
  if (l.errorData)
8913
8913
  return l;
8914
8914
  l.helperData.charactersRemaining = a.data.maxLength - o.length;
8915
- const c = [], d = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map();
8915
+ const c = [], A = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
8916
8916
  for (const u of e) {
8917
8917
  if (!u.fontData) throw new V("Failed to resolve font data for text.");
8918
8918
  const [h, m] = fe(
@@ -8922,12 +8922,12 @@ class ks {
8922
8922
  [s],
8923
8923
  { size: a.data.size, minSize: a.data.minSize, maxSize: a.data.maxSize }
8924
8924
  );
8925
- d.set(u.id, h), A.set(u.id, m);
8925
+ A.set(u.id, h), d.set(u.id, m);
8926
8926
  const g = a.data.curved ? s : (m || []).join(`
8927
8927
  `);
8928
8928
  c.push(this.generateTextChangeCommandsForRegion(h, a.data, u.id, g));
8929
8929
  }
8930
- return !a.data.curved && e.length > 0 && !Array.from(A.values()).every((h) => h) ? (l.errorData || (l.errorData = {}), l.errorData.doesNotFit = !0, l) : (n.updateStorage(a.stepName, { text: t }), n.updateMetadata(a.stepName, {
8930
+ return !a.data.curved && e.length > 0 && !Array.from(d.values()).every((h) => h) ? (l.errorData || (l.errorData = {}), l.errorData.doesNotFit = !0, l) : (n.updateStorage(a.stepName, { text: t }), n.updateMetadata(a.stepName, {
8931
8931
  text: s
8932
8932
  }), (i?.defaultCleared || !a.data.deleteDefaultOnFocus) && s.trim() !== "" && n.setMandatoryFulfilled(a.stepName, !0), l.command = new R(c), l);
8933
8933
  }
@@ -8962,9 +8962,9 @@ class ks {
8962
8962
  if (n?.selectedVariants) {
8963
8963
  const c = n.selectedVariants[0].id;
8964
8964
  if (l && c) {
8965
- const d = l.variants?.find((A) => A.id === c);
8966
- if (d) {
8967
- const A = await this.fontDataFromVariant(d), u = o.map((p) => ({ id: p.id, region: p.stepRegion })), h = n.storage?.color;
8965
+ const A = l.variants?.find((d) => d.id === c);
8966
+ if (A) {
8967
+ const d = await this.fontDataFromVariant(A), u = o.map((p) => ({ id: p.id, region: p.stepRegion })), h = n.storage?.color;
8968
8968
  let m = n.storage?.text;
8969
8969
  const g = e.getWorkflowExperience().getBundle();
8970
8970
  if (g && t.globalPropertyAspectConfigurations) {
@@ -8978,11 +8978,11 @@ class ks {
8978
8978
  }
8979
8979
  if (await e.setSelectionsAndElements(
8980
8980
  t.stepName,
8981
- [d],
8981
+ [A],
8982
8982
  u,
8983
8983
  async () => {
8984
8984
  e.updateMetadata(t.stepName, { color: h, text: m }), e.updateStorage(t.stepName, { text: m, inputText: m });
8985
- const p = o.map((S) => new Wa(S.id, A)), f = new R(p);
8985
+ const p = o.map((S) => new Wa(S.id, d)), f = new R(p);
8986
8986
  e.getCommandDispatcher()(f);
8987
8987
  }
8988
8988
  ), o.length === 0 && l) {
@@ -9015,11 +9015,11 @@ class ks {
9015
9015
  } else {
9016
9016
  const c = e.getWorkflowExperience().getBundle();
9017
9017
  if (c && t.globalPropertyAspectConfigurations) {
9018
- const A = c.getGlobalPropertyConfiguration()?.aspects?.find(
9018
+ const d = c.getGlobalPropertyConfiguration()?.aspects?.find(
9019
9019
  (u) => u.type === L.Text && t.globalPropertyAspectConfigurations?.map((h) => h.aspectName).includes(u.name)
9020
9020
  );
9021
- if (A) {
9022
- const h = c.getGlobalPropertyStateManager().getAspect(A.name);
9021
+ if (d) {
9022
+ const h = c.getGlobalPropertyStateManager().getAspect(d.name);
9023
9023
  if (h)
9024
9024
  if (o.length === 0 && l) {
9025
9025
  const m = H.getDefaultVariant(l);
@@ -9083,9 +9083,9 @@ class ks {
9083
9083
  };
9084
9084
  }
9085
9085
  async selectVariantCommand(t, e, a, n, i, s, o, l, c) {
9086
- const d = i.markUpdatePending(), A = await this.fontDataFromVariant(e);
9086
+ const A = i.markUpdatePending(), d = await this.fontDataFromVariant(e);
9087
9087
  if (n.length > 0) {
9088
- const u = n.map((g) => new Wa(g.id, A));
9088
+ const u = n.map((g) => new Wa(g.id, d));
9089
9089
  if (l) {
9090
9090
  const g = n.map((p) => new qe(p.id, l));
9091
9091
  u.push(...g);
@@ -9099,7 +9099,7 @@ class ks {
9099
9099
  const h = await this.changeInputTextWithRegion(
9100
9100
  t,
9101
9101
  t.data.size || Ye,
9102
- A,
9102
+ d,
9103
9103
  a.text || "",
9104
9104
  a,
9105
9105
  i,
@@ -9110,7 +9110,7 @@ class ks {
9110
9110
  return h && u.push(h), {
9111
9111
  command: new R(u),
9112
9112
  followup: async () => {
9113
- i.markUpdateCompleted(d), await i.setSelectionsAndElements(t.stepName, [e], n);
9113
+ i.markUpdateCompleted(A), await i.setSelectionsAndElements(t.stepName, [e], n);
9114
9114
  }
9115
9115
  };
9116
9116
  } else {
@@ -9118,13 +9118,13 @@ class ks {
9118
9118
  t.stepName,
9119
9119
  e,
9120
9120
  t.data,
9121
- A,
9121
+ d,
9122
9122
  a,
9123
9123
  i
9124
9124
  ), h = await this.changeInputTextWithRegion(
9125
9125
  t,
9126
9126
  t.data.size || Ye,
9127
- A,
9127
+ d,
9128
9128
  u[0]?.newElement.input || a.text || t.data.defaultText || "",
9129
9129
  a,
9130
9130
  i,
@@ -9147,7 +9147,7 @@ class ks {
9147
9147
  return h && m.push(h), {
9148
9148
  command: new R(m),
9149
9149
  followup: async () => {
9150
- i.markUpdateCompleted(d);
9150
+ i.markUpdateCompleted(A);
9151
9151
  }
9152
9152
  };
9153
9153
  }
@@ -9163,11 +9163,11 @@ class ks {
9163
9163
  async createTextboxRegions(t, e, a, n, i, s) {
9164
9164
  if (!a || !a.regions)
9165
9165
  throw new Error("Step data not supplied");
9166
- const o = i.text || a.defaultText || "", l = this.getProcessedInput(o, a, !1), c = async (A) => {
9167
- const h = s.getLayouts().find((g) => g.panelId === A.panelId), m = M();
9166
+ const o = i.text || a.defaultText || "", l = this.getProcessedInput(o, a, !1), c = async (d) => {
9167
+ const h = s.getLayouts().find((g) => g.panelId === d.panelId), m = M();
9168
9168
  try {
9169
9169
  if (!h)
9170
- throw new De("Failed to find layout for region: " + A.panelId);
9170
+ throw new De("Failed to find layout for region: " + d.panelId);
9171
9171
  const g = a.colorOption;
9172
9172
  let p;
9173
9173
  if (g && g.variants) {
@@ -9177,25 +9177,25 @@ class ks {
9177
9177
  });
9178
9178
  }
9179
9179
  const f = await this.getDefaultColor(a), S = f || "#000000", v = {
9180
- stepRegion: A,
9180
+ stepRegion: d,
9181
9181
  stepName: t,
9182
9182
  align: this.textAlign(a),
9183
9183
  fill: i.color ? i.color : S,
9184
9184
  fontSize: a.size || Ye,
9185
9185
  fontData: n,
9186
9186
  id: m,
9187
- layer: A.layer,
9188
- layerIndex: A.layerIndex,
9189
- rotation: A.rotation,
9187
+ layer: d.layer,
9188
+ layerIndex: d.layerIndex,
9189
+ rotation: d.rotation,
9190
9190
  text: l,
9191
9191
  input: o,
9192
9192
  type: x.Textbox,
9193
9193
  vertical: a.vertical,
9194
- x: A.left,
9195
- y: A.top,
9196
- height: A.height,
9197
- width: A.width,
9198
- immutable: A.immutable,
9194
+ x: d.left,
9195
+ y: d.top,
9196
+ height: d.height,
9197
+ width: d.width,
9198
+ immutable: d.immutable,
9199
9199
  verticalAlign: a.verticalAlign || "middle",
9200
9200
  curved: a.curved,
9201
9201
  paths: a.paths,
@@ -9224,7 +9224,7 @@ class ks {
9224
9224
  );
9225
9225
  const Q = new z(v, h);
9226
9226
  return {
9227
- regionElement: { id: m, region: A },
9227
+ regionElement: { id: m, region: d },
9228
9228
  commands: [Q, ...I],
9229
9229
  newElement: v,
9230
9230
  fontData: n
@@ -9232,13 +9232,13 @@ class ks {
9232
9232
  } catch (g) {
9233
9233
  throw console.log(g), new Pe("Error adding font to region");
9234
9234
  }
9235
- }, d = await Promise.all(a.regions.map(c)).catch((A) => {
9236
- throw A instanceof Pe ? (Fs.setLatestToast("Failed to load font.", Oe.Error), A) : A instanceof De ? A : new Error(A);
9235
+ }, A = await Promise.all(a.regions.map(c)).catch((d) => {
9236
+ throw d instanceof Pe ? (Fs.setLatestToast("Failed to load font.", Oe.Error), d) : d instanceof De ? d : new Error(d);
9237
9237
  });
9238
9238
  return await s.setSelectionsAndElements(
9239
9239
  t,
9240
9240
  [e],
9241
- d.map((A) => A.regionElement),
9241
+ A.map((d) => d.regionElement),
9242
9242
  async () => {
9243
9243
  s.updateMetadata(t, {
9244
9244
  text: o
@@ -9246,7 +9246,7 @@ class ks {
9246
9246
  text: o
9247
9247
  });
9248
9248
  }
9249
- ), d;
9249
+ ), A;
9250
9250
  }
9251
9251
  generateTextChangeCommandsForRegion(t, e, a, n) {
9252
9252
  const i = [], s = new fs(a, n);
@@ -9259,8 +9259,8 @@ class ks {
9259
9259
  /**
9260
9260
  * @deprecated
9261
9261
  */
9262
- async changeInputTextWithRegion(t, e, a, n, i, s, o, l, c, d) {
9263
- const A = (n || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = this.getProcessedInput(A, t.data, o), h = s.getRegionElements(t.stepName), m = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
9262
+ async changeInputTextWithRegion(t, e, a, n, i, s, o, l, c, A) {
9263
+ const d = (n || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = this.getProcessedInput(d, t.data, o), h = s.getRegionElements(t.stepName), m = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
9264
9264
  for (const I of h)
9265
9265
  if (I.region) {
9266
9266
  const [C, b] = fe(
@@ -9275,7 +9275,7 @@ class ks {
9275
9275
  const f = (() => {
9276
9276
  const I = Kt(u, s);
9277
9277
  if (t.data && t.data.maxLength && I.length > t.data.maxLength)
9278
- return d && d(!0), { info: "0" };
9278
+ return A && A(!0), { info: "0" };
9279
9279
  const C = s.getProfanities(), b = ta(u.toLowerCase());
9280
9280
  for (const P of b)
9281
9281
  for (const B in C) {
@@ -9290,11 +9290,11 @@ class ks {
9290
9290
  c(f.error);
9291
9291
  return;
9292
9292
  }
9293
- if (c(`${f.info} characters remaining` || ""), d)
9293
+ if (c(`${f.info} characters remaining` || ""), A)
9294
9294
  return;
9295
- s.updateStorage(t.stepName, { text: A }), s.updateMetadata(t.stepName, {
9296
- text: this.injectReplaceableText(A, t.data)
9297
- }), (i.defaultCleared || !t.data.deleteDefaultOnFocus) && A.trim() !== "" && s.setMandatoryFulfilled(t.stepName, !0);
9295
+ s.updateStorage(t.stepName, { text: d }), s.updateMetadata(t.stepName, {
9296
+ text: this.injectReplaceableText(d, t.data)
9297
+ }), (i.defaultCleared || !t.data.deleteDefaultOnFocus) && d.trim() !== "" && s.setMandatoryFulfilled(t.stepName, !0);
9298
9298
  const S = [];
9299
9299
  for (const I of h) {
9300
9300
  const C = t.data.curved ? u : (g.get(I.id) || []).join(`
@@ -9339,8 +9339,8 @@ function Os(r, t, e, a, n, i) {
9339
9339
  };
9340
9340
  if (l.width <= 0)
9341
9341
  return;
9342
- const c = $s(l.height, l.width, e * s, a * o), d = (a - c * l.width) / 2 - c * l.x, A = (e - c * l.height) / 2 - c * l.y;
9343
- r.setAttribute("transform", `translate(${d} ${A}) scale(${c} ${c})`);
9342
+ const c = $s(l.height, l.width, e * s, a * o), A = (a - c * l.width) / 2 - c * l.x, d = (e - c * l.height) / 2 - c * l.y;
9343
+ r.setAttribute("transform", `translate(${A} ${d}) scale(${c} ${c})`);
9344
9344
  }
9345
9345
  function $s(r, t, e, a) {
9346
9346
  const n = e / r, i = a / t;
@@ -9378,15 +9378,15 @@ class Us {
9378
9378
  let l = e !== o;
9379
9379
  const c = ja[i.type];
9380
9380
  l && (s.push(o), e = o);
9381
- for (const d of c) {
9382
- const A = i[d];
9381
+ for (const A of c) {
9382
+ const d = i[A];
9383
9383
  let u;
9384
- switch (typeof A) {
9384
+ switch (typeof d) {
9385
9385
  case "boolean":
9386
- u = A | 0;
9386
+ u = d | 0;
9387
9387
  break;
9388
9388
  case "number":
9389
- u = (A * 100 | 0) / 100;
9389
+ u = (d * 100 | 0) / 100;
9390
9390
  break;
9391
9391
  default:
9392
9392
  throw new Dt("Failed to encode path.");
@@ -9411,11 +9411,11 @@ class Us {
9411
9411
  throw new Dt(
9412
9412
  `Path type "${s}" given ${o.length} arguments, not divisible by ${c.length}`
9413
9413
  );
9414
- for (let d = 0; d < o.length / c.length; d++) {
9415
- const A = { type: s, relative: l };
9414
+ for (let A = 0; A < o.length / c.length; A++) {
9415
+ const d = { type: s, relative: l };
9416
9416
  for (let u = 0; u < c.length; u++)
9417
- A[c[u]] = o[d * c.length + u];
9418
- n.push(A);
9417
+ d[c[u]] = o[A * c.length + u];
9418
+ n.push(d);
9419
9419
  }
9420
9420
  } else
9421
9421
  n.push({ type: s, relative: l });
@@ -9431,10 +9431,10 @@ class Us {
9431
9431
  for (let s = 0; s < a.length; s++) {
9432
9432
  const [o, l] = a[s];
9433
9433
  if (o in i && l in i) {
9434
- const c = [i[o], i[l]], d = e(c);
9435
- if (d.length < 2)
9434
+ const c = [i[o], i[l]], A = e(c);
9435
+ if (A.length < 2)
9436
9436
  throw new Dt("Transformer must return at least 2 points.");
9437
- i[o] = d[0], i[l] = d[1];
9437
+ i[o] = A[0], i[l] = A[1];
9438
9438
  }
9439
9439
  }
9440
9440
  return i;
@@ -9467,13 +9467,13 @@ class Ls extends Ms {
9467
9467
  return this.svgElement(t, e);
9468
9468
  }
9469
9469
  svgElement(t, e) {
9470
- const a = Zi(Ts), i = t !== "" ? ((v) => v.charAt(0).toUpperCase() + v.substr(1).toLowerCase())(t) : "", s = a.getPath(i, 0, 72, 72), o = s.toSVG(2), l = s.getBoundingBox(), c = l.x2 - l.x1, d = s.toPathData(3), A = () => {
9470
+ const a = Zi(Ts), i = t !== "" ? ((v) => v.charAt(0).toUpperCase() + v.substr(1).toLowerCase())(t) : "", s = a.getPath(i, 0, 72, 72), o = s.toSVG(2), l = s.getBoundingBox(), c = l.x2 - l.x1, A = s.toPathData(3), d = () => {
9471
9471
  const v = et("g");
9472
9472
  v.classList.add("module-text-group");
9473
9473
  const I = et("defs");
9474
9474
  v.appendChild(I), I.appendChild(Qs(0, 2, 2, "shadow"));
9475
9475
  const C = et("path");
9476
- C.setAttribute("d", d), C.setAttribute("stroke", "black"), C.setAttribute("stroke-width", "3"), I.appendChild(C);
9476
+ C.setAttribute("d", A), C.setAttribute("stroke", "black"), C.setAttribute("stroke-width", "3"), I.appendChild(C);
9477
9477
  const b = et("g");
9478
9478
  b.classList.add("module-layer0"), v.appendChild(b), b.setAttribute("filter", "url(#shadow)"), b.innerHTML = C.outerHTML;
9479
9479
  const P = et("g");
@@ -9492,9 +9492,9 @@ class Ls extends Ms {
9492
9492
  g.setAttribute("opacity", "0"), m.appendChild(g);
9493
9493
  const p = et("g");
9494
9494
  p.classList.add("module-text-enclosure"), u.appendChild(p);
9495
- const f = A();
9495
+ const f = d();
9496
9496
  p.appendChild(f);
9497
- const S = fr(d);
9497
+ const S = fr(A);
9498
9498
  return Os(p, S, e.height, e.width, 0.35, 0.65), Rs(u.outerHTML);
9499
9499
  }
9500
9500
  }
@@ -9625,6 +9625,12 @@ const re = w`
9625
9625
  description
9626
9626
  dispatchStartDate
9627
9627
  dispatchEndDate
9628
+ productCollectionCustomers {
9629
+ id
9630
+ customer {
9631
+ id
9632
+ }
9633
+ }
9628
9634
  image {
9629
9635
  key
9630
9636
  name
@@ -9842,6 +9848,7 @@ const re = w`
9842
9848
  $tags: ProductCollectionProductTagFilterInput
9843
9849
  $sortKey: ProductCollectionProductSortKey
9844
9850
  $sortDescending: Boolean
9851
+ $quickSearch: String
9845
9852
  ) {
9846
9853
  productCollections(ids: [$id]) {
9847
9854
  id
@@ -9852,6 +9859,7 @@ const re = w`
9852
9859
  offset: $offset
9853
9860
  sortKey: $sortKey
9854
9861
  sortDescending: $sortDescending
9862
+ quickSearch: $quickSearch
9855
9863
  ) {
9856
9864
  items {
9857
9865
  ...ProductCollectionProductFields
@@ -10225,14 +10233,14 @@ class Ya extends Fn {
10225
10233
  }
10226
10234
  }
10227
10235
  class yo {
10228
- constructor(t, e, a, n, i, s, o, l, c, d, A, u, h, m = !1, g, p = !1, f = !1, S = !1) {
10236
+ constructor(t, e, a, n, i, s, o, l, c, A, d, u, h, m = !1, g, p = !1, f = !1, S = !1) {
10229
10237
  this.workflowStatePromiseQueue = new xn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.renderLayouts = () => {
10230
10238
  if (!this.previewService) return;
10231
10239
  const v = this.getCommandContext().getAllLayouts(), I = this.getLayoutPreviewService()?.getAll();
10232
10240
  if (I)
10233
10241
  for (const [, C] of I)
10234
10242
  C.render(v);
10235
- }, this.experience = t, this.client = e, this.updateTransaction = o, this.graphQlClient = l, this.commandContext = s, this.reloadedState = h, this.transaction = c, this.readOnly = m, this.singleVariantsRenderable = f, this.confirmedDesign = !1, this.editedSteps = {}, this.informationResults = [], this.mandatorySteps = {}, this.pendingUpdates = [], this.selectionCost = 0, this.workflow = a, this.stepSpecificServices = {}, this.profanityFilter = n, this.pollers = [], this.allScenes = [], this.layouts = i, this.product = d, this.previewService = A, this.modelContainer = g, this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, this.validationErrors = { steps: /* @__PURE__ */ new Map() }, this.confirmCallbacks = [], this.editedCallbacks = [], this.elementsCallbacks = [], this.informationResultCallbacks = [], this.initCallbacks = [], this.mandatoryCallbacks = [], this.makingAdjustmentsCallback = [], this.metadataCallbacks = [], this.selectionCallbacks = [], this.stepSpecificStorageCallbacks = {}, this.storageCallbacks = [], this.validationCallbacks = [], this.recipientCallbacks = [], this.currentAdjustingStepId = "", this.renderableContextService = u, this.renderableContextService?.setWorkflowManager(this), this.isReloadedTransaction = p, this.workflow.steps.forEach((v) => {
10243
+ }, this.experience = t, this.client = e, this.updateTransaction = o, this.graphQlClient = l, this.commandContext = s, this.reloadedState = h, this.transaction = c, this.readOnly = m, this.singleVariantsRenderable = f, this.confirmedDesign = !1, this.editedSteps = {}, this.informationResults = [], this.mandatorySteps = {}, this.pendingUpdates = [], this.selectionCost = 0, this.workflow = a, this.stepSpecificServices = {}, this.profanityFilter = n, this.pollers = [], this.allScenes = [], this.layouts = i, this.product = A, this.previewService = d, this.modelContainer = g, this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, this.validationErrors = { steps: /* @__PURE__ */ new Map() }, this.confirmCallbacks = [], this.editedCallbacks = [], this.elementsCallbacks = [], this.informationResultCallbacks = [], this.initCallbacks = [], this.mandatoryCallbacks = [], this.makingAdjustmentsCallback = [], this.metadataCallbacks = [], this.selectionCallbacks = [], this.stepSpecificStorageCallbacks = {}, this.storageCallbacks = [], this.validationCallbacks = [], this.recipientCallbacks = [], this.currentAdjustingStepId = "", this.renderableContextService = u, this.renderableContextService?.setWorkflowManager(this), this.isReloadedTransaction = p, this.workflow.steps.forEach((v) => {
10236
10244
  this.stepTags[v.stepName] = v.tags ?? [];
10237
10245
  }), S && (this.workflowStatePromiseQueue.enabled = !1), this.initializationPromise = this.initializeDefaultWorkflowState(a), this.initializationPromise.then(() => {
10238
10246
  this.initialized = !0;
@@ -10265,7 +10273,7 @@ class yo {
10265
10273
  }
10266
10274
  }), e;
10267
10275
  }
10268
- async updateRecipient(t, e, a, n, i, s, o, l, c, d, A, u, h, m, g, p, f) {
10276
+ async updateRecipient(t, e, a, n, i, s, o, l, c, A, d, u, h, m, g, p, f) {
10269
10277
  if (this.transaction.recipient?.id)
10270
10278
  this.transaction.recipient = {
10271
10279
  id: this.transaction.recipient.id,
@@ -10278,8 +10286,8 @@ class yo {
10278
10286
  postalCode: o || this.transaction.recipient.postalCode,
10279
10287
  country: l || this.transaction.recipient.country,
10280
10288
  mobile: c || this.transaction.recipient.mobile,
10281
- company: d || this.transaction.recipient.company,
10282
- apartment: A || this.transaction.recipient.apartment,
10289
+ company: A || this.transaction.recipient.company,
10290
+ apartment: d || this.transaction.recipient.apartment,
10283
10291
  customField1: u || this.transaction.recipient.customField1,
10284
10292
  customField2: h || this.transaction.recipient.customField2,
10285
10293
  customField3: m || this.transaction.recipient.customField3,
@@ -10301,8 +10309,8 @@ class yo {
10301
10309
  postalCode: o || this.transaction.recipient.postalCode,
10302
10310
  country: l || this.transaction.recipient.country,
10303
10311
  mobile: c || this.transaction.recipient.mobile,
10304
- company: d || this.transaction.recipient.company,
10305
- apartment: A || this.transaction.recipient.apartment,
10312
+ company: A || this.transaction.recipient.company,
10313
+ apartment: d || this.transaction.recipient.apartment,
10306
10314
  customField1: u || this.transaction.recipient.customField1,
10307
10315
  customField2: h || this.transaction.recipient.customField2,
10308
10316
  customField3: m || this.transaction.recipient.customField3,
@@ -10326,8 +10334,8 @@ class yo {
10326
10334
  postalCode: o,
10327
10335
  country: l,
10328
10336
  mobile: c,
10329
- company: d,
10330
- apartment: A,
10337
+ company: A,
10338
+ apartment: d,
10331
10339
  customField1: u,
10332
10340
  customField2: h,
10333
10341
  customField3: m,
@@ -10347,8 +10355,8 @@ class yo {
10347
10355
  postalCode: o,
10348
10356
  country: l,
10349
10357
  mobile: c,
10350
- company: d,
10351
- apartment: A,
10358
+ company: A,
10359
+ apartment: d,
10352
10360
  customField1: u,
10353
10361
  customField2: h,
10354
10362
  customField3: m,
@@ -10603,14 +10611,14 @@ class yo {
10603
10611
  console.error(`Failed to read model url from variant: ${l.id} for step: ${s.stepName}`);
10604
10612
  return;
10605
10613
  }
10606
- const d = s.data;
10614
+ const A = s.data;
10607
10615
  this.modelContainer.applyModelVariant(
10608
10616
  s.stepName,
10609
10617
  {
10610
10618
  model: c,
10611
10619
  contextService: this.getLayoutPreviewService()
10612
10620
  },
10613
- d.replaceProductModel || !1
10621
+ A.replaceProductModel || !1
10614
10622
  );
10615
10623
  } else {
10616
10624
  const c = l.material;
@@ -10618,12 +10626,12 @@ class yo {
10618
10626
  console.error(`Failed to read material from variant: ${l.id} for step: ${s.stepName}`);
10619
10627
  return;
10620
10628
  }
10621
- s.data.targetMaterials.forEach((A) => {
10629
+ s.data.targetMaterials.forEach((d) => {
10622
10630
  if (!this.modelContainer)
10623
10631
  throw new V(
10624
10632
  "We should always have a model container when injecting a preview!"
10625
10633
  );
10626
- this.modelContainer.applyMaterialVariant(A, s.option.id, c);
10634
+ this.modelContainer.applyMaterialVariant(d, s.option.id, c);
10627
10635
  });
10628
10636
  }
10629
10637
  }), await a.getInitializationPromise(), this.renderLayouts();
@@ -10721,7 +10729,7 @@ class yo {
10721
10729
  const e = (a, n) => Object.keys(a).reduce((i, s) => {
10722
10730
  const o = [...a[s] || []];
10723
10731
  return n.forEach((l) => {
10724
- const c = o.findIndex((d) => d.id === l.id);
10732
+ const c = o.findIndex((A) => A.id === l.id);
10725
10733
  c > -1 && o.splice(c, 1);
10726
10734
  }), i[s] = o, i;
10727
10735
  }, {});
@@ -10739,15 +10747,15 @@ class yo {
10739
10747
  const a = this.product;
10740
10748
  if (!a)
10741
10749
  return Promise.resolve({ stepElements: {}, commands: [] });
10742
- const n = async (c, d, A) => {
10750
+ const n = async (c, A, d) => {
10743
10751
  if (c.type === E.SilentIllustration) {
10744
- const u = await new qa(c, d).trigger();
10752
+ const u = await new qa(c, A).trigger();
10745
10753
  return { step: c, results: u };
10746
10754
  } else if (c.type === E.ProductOverlay) {
10747
10755
  const u = await new qa(
10748
10756
  c,
10749
- d,
10750
- A
10757
+ A,
10758
+ d
10751
10759
  ).trigger();
10752
10760
  return { step: c, results: u };
10753
10761
  }
@@ -10762,7 +10770,7 @@ class yo {
10762
10770
  this.markStepsAsInitialised([c.stepName]), e || o.push(n(c, this.layouts, a));
10763
10771
  const l = await Promise.all(o);
10764
10772
  for (const c of l)
10765
- s.stepElements[c.step.stepName] = c.results.map((d) => d.regionElement), s.commands = [...s.commands, ...c.results.map((d) => d.command)];
10773
+ s.stepElements[c.step.stepName] = c.results.map((A) => A.regionElement), s.commands = [...s.commands, ...c.results.map((A) => A.command)];
10766
10774
  return s;
10767
10775
  }
10768
10776
  getStepStorage(t) {
@@ -10835,13 +10843,13 @@ class yo {
10835
10843
  }, this.selectionCost = Object.values(this.stepSelections).reduce((C, b) => C + b.selectedVariants.map((P) => P.priceModifier || 0).reduce((P, B) => P + B, 0), 0), this.workflow.steps.forEach((C) => {
10836
10844
  yt(C, this.stepSelections) || (this.stepInitialised[C.stepName] = !1, delete this.stepMetadata[C.stepName], delete this.stepSelections[C.stepName], delete this.storage[C.stepName]);
10837
10845
  });
10838
- const s = this.allScenes, o = Pt(s, i), l = Pt(s, this.stepSelections), c = o.map((C) => C.silentSteps).flat(), A = l.map((C) => C.silentSteps).flat().filter(
10846
+ const s = this.allScenes, o = Pt(s, i), l = Pt(s, this.stepSelections), c = o.map((C) => C.silentSteps).flat(), d = l.map((C) => C.silentSteps).flat().filter(
10839
10847
  (C) => !c.some((b) => b.stepName === C.stepName)
10840
10848
  );
10841
10849
  c.forEach((C) => {
10842
10850
  yt(C, this.stepSelections) || (this.stepInitialised[C.stepName] = !1);
10843
10851
  });
10844
- const u = this.getInvalidCanvasRegions(), { stepElements: h, commands: m } = await this.stepElementsForIntroducedSilentSteps(A, !1);
10852
+ const u = this.getInvalidCanvasRegions(), { stepElements: h, commands: m } = await this.stepElementsForIntroducedSilentSteps(d, !1);
10845
10853
  this.stepElements = {
10846
10854
  ...this.stepElements,
10847
10855
  ...h,
@@ -11217,10 +11225,10 @@ class So extends Z {
11217
11225
  if (s.length !== 0) {
11218
11226
  const o = {};
11219
11227
  return s.forEach((l) => {
11220
- const c = i.channelNumbers.find((d) => d.number === l.channelNumber);
11228
+ const c = i.channelNumbers.find((A) => A.number === l.channelNumber);
11221
11229
  if (c) {
11222
- const d = c.id.replace(/\W/g, "");
11223
- o[l.channelNumber] = { browserValue: a[d]?.browserValue || "" };
11230
+ const A = c.id.replace(/\W/g, "");
11231
+ o[l.channelNumber] = { browserValue: a[A]?.browserValue || "" };
11224
11232
  }
11225
11233
  }), o;
11226
11234
  }
@@ -11467,24 +11475,24 @@ class Po extends Z {
11467
11475
  s || (e.input = n);
11468
11476
  const o = a.length <= 0, l = o ? { inputText: n, text: n } : { inputText: n };
11469
11477
  this.manager.updateStorage(this.step.stepName, l);
11470
- const c = this.manager.getStepStorage(this.step.stepName), d = G.getProcessedInput(
11478
+ const c = this.manager.getStepStorage(this.step.stepName), A = G.getProcessedInput(
11471
11479
  n,
11472
11480
  this.step.data,
11473
11481
  c?.customiseAllText ?? !1
11474
11482
  );
11475
11483
  if (o)
11476
11484
  s || this.manager.updateMetadata(this.step.stepName, {
11477
- text: d
11485
+ text: A
11478
11486
  });
11479
11487
  else {
11480
- const { command: A, errorData: u, helperData: h } = G.updateInputText(
11488
+ const { command: d, errorData: u, helperData: h } = G.updateInputText(
11481
11489
  n,
11482
11490
  a,
11483
11491
  this.step,
11484
11492
  this.manager
11485
11493
  );
11486
- A && this.manager.getCommandDispatcher()(A), e.helperData = h, e.errorData = u, !s && !u && this.manager.updateMetadata(this.step.stepName, {
11487
- text: d
11494
+ d && this.manager.getCommandDispatcher()(d), e.helperData = h, e.errorData = u, !s && !u && this.manager.updateMetadata(this.step.stepName, {
11495
+ text: A
11488
11496
  });
11489
11497
  }
11490
11498
  return e;
@@ -11852,11 +11860,11 @@ const To = async (r, t) => {
11852
11860
  const n = {};
11853
11861
  let i = {};
11854
11862
  a && (i = a);
11855
- const o = t.steps.map((l) => l.stepTitle).filter((l, c, d) => d.indexOf(l) == c);
11863
+ const o = t.steps.map((l) => l.stepTitle).filter((l, c, A) => A.indexOf(l) == c);
11856
11864
  for (const l of o) {
11857
11865
  if (Object.keys(r).includes(l)) {
11858
- const c = r[l], d = t.steps.find((A) => A.stepTitle === l);
11859
- n[`${d?.stepTitle} selection`] = {
11866
+ const c = r[l], A = t.steps.find((d) => d.stepTitle === l);
11867
+ n[`${A?.stepTitle} selection`] = {
11860
11868
  value: c[0].name,
11861
11869
  priceModifier: c[0].priceModifier
11862
11870
  };
@@ -11869,7 +11877,7 @@ const To = async (r, t) => {
11869
11877
  }
11870
11878
  return n;
11871
11879
  }, _n = (r, t, e, a, n, i, s, o) => {
11872
- const l = t.basePrice || 0, c = r.priceModifierTotal || 0, d = Qo(a, e, void 0, i), u = (k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(r.id), h = {
11880
+ const l = t.basePrice || 0, c = r.priceModifierTotal || 0, A = Qo(a, e, void 0, i), u = (k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(r.id), h = {
11873
11881
  additionalExternalProductId: r.integrationProduct?.additionalExternalProductId,
11874
11882
  additionalExternalVariantId: r.integrationProduct?.additionalExternalVariantId,
11875
11883
  baseCost: l,
@@ -11877,7 +11885,7 @@ const To = async (r, t) => {
11877
11885
  designProductId: r.externalDesignProductId,
11878
11886
  designProductVariantId: r.externalDesignProductVariantId,
11879
11887
  event: "onComplete",
11880
- exportedData: d,
11888
+ exportedData: A,
11881
11889
  externalCartProductId: r.externalCartProductId,
11882
11890
  externalCartProductVariantId: r.externalCartProductVariantId,
11883
11891
  lineItemImageUrl: s || "",
@@ -11982,9 +11990,9 @@ const To = async (r, t) => {
11982
11990
  cartSelectionsWithPrices: S,
11983
11991
  cartMetadata: g
11984
11992
  };
11985
- }, Ro = async (r, t, e, a, n, i, s, o, l, c, d) => {
11993
+ }, Ro = async (r, t, e, a, n, i, s, o, l, c, A) => {
11986
11994
  l("workflow.steps.finish.finalize.buildingLayouts");
11987
- const { designDetails: A, cartSelectionsWithPrices: u, cartMetadata: h } = await Xn(
11995
+ const { designDetails: d, cartSelectionsWithPrices: u, cartMetadata: h } = await Xn(
11988
11996
  r,
11989
11997
  t,
11990
11998
  e,
@@ -11993,10 +12001,10 @@ const To = async (r, t) => {
11993
12001
  s,
11994
12002
  o,
11995
12003
  c,
11996
- d
12004
+ A
11997
12005
  );
11998
12006
  l("workflow.steps.finish.finalize.creatingDesign");
11999
- const m = await To(A), g = m?.transaction?.previewImageLink;
12007
+ const m = await To(d), g = m?.transaction?.previewImageLink;
12000
12008
  if (!m?.transaction)
12001
12009
  throw new Error("Failed to create design");
12002
12010
  l("workflow.steps.finish.finalize.updatingTransaction");
@@ -12046,15 +12054,15 @@ const To = async (r, t) => {
12046
12054
  if (!s)
12047
12055
  throw new Error("Failed to create designs");
12048
12056
  return t("workflow.steps.finish.finalize.updatingTransaction"), s.map((o, l) => {
12049
- const c = r[l], d = i[l], A = o.transaction;
12057
+ const c = r[l], A = i[l], d = o.transaction;
12050
12058
  return _n(
12051
- A,
12059
+ d,
12052
12060
  c.product,
12053
12061
  c.workflow,
12054
- d.cartSelectionsWithPrices,
12062
+ A.cartSelectionsWithPrices,
12055
12063
  o.sku,
12056
- d.cartMetadata,
12057
- A.previewImageLink,
12064
+ A.cartMetadata,
12065
+ d.previewImageLink,
12058
12066
  o.processExecution?.id
12059
12067
  );
12060
12068
  });
@@ -12280,23 +12288,23 @@ class Go {
12280
12288
  }
12281
12289
  let i = 2048;
12282
12290
  e && e <= 2048 && (i = e);
12283
- const s = pt(i, i), o = this.commandContext.getAllLayouts(), l = a.defaultPreviewPanelIndex || 0, c = a.panels[l], d = o.find((v) => v.layoutState?.layout.panelId === c?.name) || o[0], A = d.layoutState.layout.previewRegion ? {
12284
- x: d.layoutState.layout.previewRegion.left,
12285
- y: d.layoutState.layout.previewRegion.top,
12286
- width: d.layoutState.layout.previewRegion.width,
12287
- height: d.layoutState.layout.previewRegion.height
12291
+ const s = pt(i, i), o = this.commandContext.getAllLayouts(), l = a.defaultPreviewPanelIndex || 0, c = a.panels[l], A = o.find((v) => v.layoutState?.layout.panelId === c?.name) || o[0], d = A.layoutState.layout.previewRegion ? {
12292
+ x: A.layoutState.layout.previewRegion.left,
12293
+ y: A.layoutState.layout.previewRegion.top,
12294
+ width: A.layoutState.layout.previewRegion.width,
12295
+ height: A.layoutState.layout.previewRegion.height
12288
12296
  } : {
12289
12297
  x: 0,
12290
12298
  y: 0,
12291
- width: d.layoutState.layout.width,
12292
- height: d.layoutState.layout.height
12293
- }, u = this.commandContext.getLayoutById(d.layoutState.layout.id), h = s.getContext("2d");
12299
+ width: A.layoutState.layout.width,
12300
+ height: A.layoutState.layout.height
12301
+ }, u = this.commandContext.getLayoutById(A.layoutState.layout.id), h = s.getContext("2d");
12294
12302
  if (!h)
12295
12303
  throw new xe("Failed to obtain 2D context for preview image creation");
12296
12304
  const m = await this.workflowManager.getTemplatingContext(), g = ya(u.layoutState.layout, u.layoutState.elements, {
12297
12305
  renderingConfiguration: {
12298
12306
  purpose: jt.Print,
12299
- region: { left: A.x, top: A.y, width: A.width, height: A.height },
12307
+ region: { left: d.x, top: d.y, width: d.width, height: d.height },
12300
12308
  templatingContext: m
12301
12309
  }
12302
12310
  }), p = mn(g);
@@ -12396,20 +12404,20 @@ class Go {
12396
12404
  );
12397
12405
  }
12398
12406
  async copySelectionsViaGlobalConfiguration(t, e, a) {
12399
- const n = await t.getGlobalProperties(), i = a?.map((c) => c.getId()), s = this.getSteps().filter((c) => i === void 0 || i.includes(c.getId())), o = e.getSteps(), l = (c) => n.find((d) => d.getRawProperty().name === c.aspectName);
12407
+ const n = await t.getGlobalProperties(), i = a?.map((c) => c.getId()), s = this.getSteps().filter((c) => i === void 0 || i.includes(c.getId())), o = e.getSteps(), l = (c) => n.find((A) => A.getRawProperty().name === c.aspectName);
12400
12408
  s.forEach((c) => {
12401
- const d = /* @__PURE__ */ new Set(), A = c.getRaw().globalPropertyAspectConfigurations;
12402
- A !== void 0 && (A.forEach((u) => d.add(JSON.stringify(u))), o.forEach((u) => {
12409
+ const A = /* @__PURE__ */ new Set(), d = c.getRaw().globalPropertyAspectConfigurations;
12410
+ d !== void 0 && (d.forEach((u) => A.add(JSON.stringify(u))), o.forEach((u) => {
12403
12411
  const h = u.getRaw().globalPropertyAspectConfigurations;
12404
12412
  h !== void 0 && h.forEach((m) => {
12405
- const g = l(m), p = d.has(JSON.stringify(m));
12413
+ const g = l(m), p = A.has(JSON.stringify(m));
12406
12414
  if (p && g?.getType() === "Option") {
12407
12415
  const f = u.getCurrentVariant();
12408
12416
  if (!f) return;
12409
- c.selectVariant(f), d.delete(JSON.stringify(m));
12417
+ c.selectVariant(f), A.delete(JSON.stringify(m));
12410
12418
  } else if (p && g?.getType() === "Text") {
12411
12419
  const f = u.getText();
12412
- c.setText(f), d.delete(JSON.stringify(m));
12420
+ c.setText(f), A.delete(JSON.stringify(m));
12413
12421
  }
12414
12422
  });
12415
12423
  }));
@@ -12545,19 +12553,19 @@ class Go {
12545
12553
  switch (i.type) {
12546
12554
  case E.Frame:
12547
12555
  {
12548
- const d = i.data, A = o;
12549
- A.image && d.displayImageOnFinishStep && c.properties.push({
12556
+ const A = i.data, d = o;
12557
+ d.image && A.displayImageOnFinishStep && c.properties.push({
12550
12558
  type: "image",
12551
- value: A.image,
12559
+ value: d.image,
12552
12560
  priceModifier: 0
12553
12561
  });
12554
12562
  }
12555
12563
  break;
12556
12564
  case E.Illustration:
12557
12565
  {
12558
- const d = i.data, A = o;
12559
- if (A && A.colors && A.colors.length > 0 && d.displayColorsOnFinishStep) {
12560
- const u = A.colors.join(", ").toUpperCase();
12566
+ const A = i.data, d = o;
12567
+ if (d && d.colors && d.colors.length > 0 && A.displayColorsOnFinishStep) {
12568
+ const u = d.colors.join(", ").toUpperCase();
12561
12569
  c.properties.push({
12562
12570
  type: "color",
12563
12571
  value: u,
@@ -12568,23 +12576,23 @@ class Go {
12568
12576
  break;
12569
12577
  case E.Module:
12570
12578
  {
12571
- const d = i.data, A = o;
12572
- A && A.text && d.displayTextOnFinishStep && c.properties.push({
12579
+ const A = i.data, d = o;
12580
+ d && d.text && A.displayTextOnFinishStep && c.properties.push({
12573
12581
  type: "text",
12574
- value: A.text,
12582
+ value: d.text,
12575
12583
  priceModifier: 0
12576
12584
  });
12577
12585
  }
12578
12586
  break;
12579
12587
  case E.Text: {
12580
- const d = i.data, A = o;
12581
- A && A.text && d.displayTextOnFinishStep && c.properties.push({
12588
+ const A = i.data, d = o;
12589
+ d && d.text && A.displayTextOnFinishStep && c.properties.push({
12582
12590
  type: "text",
12583
- value: A.text,
12591
+ value: d.text,
12584
12592
  priceModifier: 0
12585
- }), A && A.color && d.displayColorOnFinishStep && c.properties.push({
12593
+ }), d && d.color && A.displayColorOnFinishStep && c.properties.push({
12586
12594
  type: "color",
12587
- value: A.color,
12595
+ value: d.color,
12588
12596
  priceModifier: 0
12589
12597
  });
12590
12598
  }
@@ -12665,7 +12673,7 @@ const Wo = (r) => {
12665
12673
  ], Ho = async (r, t, e) => {
12666
12674
  const a = t.data, n = e.data.baseUrl, i = a.assetUrl.replace("localhost", "localstack"), s = n.slice(0, 4) === "http" ? "" : "https://", o = new URL(s + n);
12667
12675
  o.searchParams.append("video", Qa(JSON.stringify([{ href: i }]))), o.pathname = o.pathname + (o.pathname.slice(-1) === "/" ? "" : "/");
12668
- const l = o.toString(), d = `data:image/svg+xml;base64,${Qa(await ln(l, { type: "svg" }))}`, A = (h) => {
12676
+ const l = o.toString(), A = `data:image/svg+xml;base64,${Qa(await ln(l, { type: "svg" }))}`, d = (h) => {
12669
12677
  const m = r.find((p) => p.panelId === h.panelId);
12670
12678
  if (!m)
12671
12679
  throw new Y(h);
@@ -12673,7 +12681,7 @@ const Wo = (r) => {
12673
12681
  return new z(
12674
12682
  {
12675
12683
  id: g,
12676
- src: d,
12684
+ src: A,
12677
12685
  type: x.Image,
12678
12686
  y: h.top,
12679
12687
  x: h.left,
@@ -12685,7 +12693,7 @@ const Wo = (r) => {
12685
12693
  );
12686
12694
  }, u = e.data.regions;
12687
12695
  try {
12688
- return u.map(A);
12696
+ return u.map(d);
12689
12697
  } catch (h) {
12690
12698
  return console.error(h), [];
12691
12699
  }
@@ -12695,12 +12703,12 @@ const Wo = (r) => {
12695
12703
  const o = As(n, a.option);
12696
12704
  o && (t[a.stepName] = { selectedVariants: [o] });
12697
12705
  const l = async (c) => {
12698
- const d = await $n(c, o?.asset?.fileLink), A = await Re(d), u = M(), h = r.find((g) => g.panelId === c.panelId);
12706
+ const A = await $n(c, o?.asset?.fileLink), d = await Re(A), u = M(), h = r.find((g) => g.panelId === c.panelId);
12699
12707
  if (!h)
12700
12708
  throw new Y(c);
12701
12709
  const m = va(
12702
12710
  s,
12703
- A,
12711
+ d,
12704
12712
  {
12705
12713
  scale: n.scale,
12706
12714
  left: n.x,
@@ -12712,7 +12720,7 @@ const Wo = (r) => {
12712
12720
  new z(
12713
12721
  {
12714
12722
  id: u,
12715
- path: A.path,
12723
+ path: d.path,
12716
12724
  type: x.Frame,
12717
12725
  forceImageCover: a.data.forceImageCover,
12718
12726
  x: c.left,
@@ -12722,8 +12730,8 @@ const Wo = (r) => {
12722
12730
  layer: c.layer,
12723
12731
  layerIndex: c.layerIndex,
12724
12732
  rotation: c.rotation,
12725
- scaleX: c.width / A.width,
12726
- scaleY: c.height / A.height,
12733
+ scaleX: c.width / d.width,
12734
+ scaleY: c.height / d.height,
12727
12735
  pattern: {
12728
12736
  id: `${u}-pattern`,
12729
12737
  src: s.src,
@@ -12759,7 +12767,7 @@ const Wo = (r) => {
12759
12767
  const o = s.asset?.fileLink;
12760
12768
  if (!o)
12761
12769
  return console.error(`No asset link for variant with ID: ${n.illustrationVariantId}`), [];
12762
- const l = await at(o, !0), c = /<svg.*?<\/svg>/s, d = l.match(c) || [], A = d?.length > 0 ? d[0] : "", m = dt().parseFromString(A, "image/svg+xml").firstElementChild;
12770
+ const l = await at(o, !0), c = /<svg.*?<\/svg>/s, A = l.match(c) || [], d = A?.length > 0 ? A[0] : "", m = dt().parseFromString(d, "image/svg+xml").firstElementChild;
12763
12771
  if (!m)
12764
12772
  return console.error("Failed to read SVG."), [];
12765
12773
  ga(m);
@@ -12816,14 +12824,14 @@ const Wo = (r) => {
12816
12824
  }
12817
12825
  }, Ko = async (r, t, e) => {
12818
12826
  const a = await Jn(e.data.module), n = t.data, i = (o, l) => {
12819
- const c = r.find((A) => A.panelId === l.panelId);
12827
+ const c = r.find((d) => d.panelId === l.panelId);
12820
12828
  if (!c)
12821
12829
  throw new Y(l);
12822
- const d = M();
12830
+ const A = M();
12823
12831
  return new z(
12824
12832
  {
12825
12833
  colors: {},
12826
- id: d,
12834
+ id: A,
12827
12835
  svg: o,
12828
12836
  type: x.Illustration,
12829
12837
  y: l.top,
@@ -12848,7 +12856,7 @@ const Wo = (r) => {
12848
12856
  const n = e.data, i = a.option;
12849
12857
  if (!i)
12850
12858
  return console.error(`No option for step ${a.stepName}.`), [];
12851
- const s = i.variants?.find((d) => d.id === n.pictureVariantId) || ne(i);
12859
+ const s = i.variants?.find((A) => A.id === n.pictureVariantId) || ne(i);
12852
12860
  if (!s)
12853
12861
  return console.error(`No variant with ID: ${n.pictureVariantId}`), [];
12854
12862
  if (!s.asset)
@@ -12857,33 +12865,33 @@ const Wo = (r) => {
12857
12865
  const o = s.asset?.fileLink;
12858
12866
  if (!o)
12859
12867
  return console.error(`No asset link for variant with ID: ${n.pictureVariantId}`), [];
12860
- const l = (d) => {
12861
- const A = r.find((h) => h.panelId === d.panelId);
12862
- if (!A)
12863
- throw new Y(d);
12868
+ const l = (A) => {
12869
+ const d = r.find((h) => h.panelId === A.panelId);
12870
+ if (!d)
12871
+ throw new Y(A);
12864
12872
  const u = M();
12865
12873
  return new z(
12866
12874
  {
12867
12875
  id: u,
12868
12876
  src: o,
12869
12877
  type: x.Image,
12870
- y: d.top,
12871
- x: d.left,
12872
- rotation: d.rotation,
12873
- width: d.width,
12874
- height: d.height,
12875
- layer: d.layer,
12876
- layerIndex: d.layerIndex,
12877
- immutable: d.immutable,
12878
+ y: A.top,
12879
+ x: A.left,
12880
+ rotation: A.rotation,
12881
+ width: A.width,
12882
+ height: A.height,
12883
+ layer: A.layer,
12884
+ layerIndex: A.layerIndex,
12885
+ immutable: A.immutable,
12878
12886
  preserveAspectRatio: "none"
12879
12887
  },
12880
- A
12888
+ d
12881
12889
  );
12882
12890
  }, c = a.data.regions;
12883
12891
  try {
12884
12892
  return c.map(l);
12885
- } catch (d) {
12886
- return console.error(d), [];
12893
+ } catch (A) {
12894
+ return console.error(A), [];
12887
12895
  }
12888
12896
  }, Xo = async (r, t, e, a) => {
12889
12897
  const n = e.data, i = a.option;
@@ -12894,10 +12902,10 @@ const Wo = (r) => {
12894
12902
  return console.error(`No variant with ID: ${n.colorVariantId}`), [];
12895
12903
  t[a.stepName] = { selectedVariants: [s] };
12896
12904
  const o = (c) => {
12897
- const d = r.find((g) => g.panelId === c.panelId);
12898
- if (!d)
12905
+ const A = r.find((g) => g.panelId === c.panelId);
12906
+ if (!A)
12899
12907
  throw new Y(c);
12900
- const A = `
12908
+ const d = `
12901
12909
  <svg
12902
12910
  xmlns="http://www.w3.org/2000/svg"
12903
12911
  xmlnsXlink="http://www.w3.org/1999/xlink"
@@ -12922,7 +12930,7 @@ const Wo = (r) => {
12922
12930
  {
12923
12931
  colors: h,
12924
12932
  id: m,
12925
- svg: A,
12933
+ svg: d,
12926
12934
  type: x.Illustration,
12927
12935
  y: c.top,
12928
12936
  x: c.left,
@@ -12933,7 +12941,7 @@ const Wo = (r) => {
12933
12941
  layerIndex: c.layerIndex,
12934
12942
  immutable: c.immutable
12935
12943
  },
12936
- d
12944
+ A
12937
12945
  );
12938
12946
  }, l = a.data.regions;
12939
12947
  try {
@@ -12946,10 +12954,10 @@ const Wo = (r) => {
12946
12954
  if (o === "image")
12947
12955
  try {
12948
12956
  l.forEach((c) => {
12949
- const d = r.find((u) => u.panelId === c.panelId);
12950
- if (!d)
12957
+ const A = r.find((u) => u.panelId === c.panelId);
12958
+ if (!A)
12951
12959
  throw new Y(c);
12952
- const A = {
12960
+ const d = {
12953
12961
  id: M(),
12954
12962
  src: i,
12955
12963
  type: o,
@@ -12966,38 +12974,38 @@ const Wo = (r) => {
12966
12974
  excludeFromExport: t.data.excludeFromPrint,
12967
12975
  preserveAspectRatio: "none"
12968
12976
  };
12969
- a.push(new z(A, d));
12977
+ a.push(new z(d, A));
12970
12978
  });
12971
12979
  } catch (c) {
12972
12980
  console.error(c);
12973
12981
  }
12974
12982
  else {
12975
- const c = await at(i, !0), d = (A) => {
12976
- const u = /<svg.*?<\/svg>/s, h = A.match(u) || [], m = h?.length > 0 ? h[0] : "", f = dt().parseFromString(m, "image/svg+xml").firstElementChild;
12983
+ const c = await at(i, !0), A = (d) => {
12984
+ const u = /<svg.*?<\/svg>/s, h = d.match(u) || [], m = h?.length > 0 ? h[0] : "", f = dt().parseFromString(m, "image/svg+xml").firstElementChild;
12977
12985
  if (!f)
12978
12986
  throw new Dt("Failed to read SVG.");
12979
12987
  return ga(f), Bt().serializeToString(f);
12980
12988
  };
12981
- l.forEach((A) => {
12982
- const u = r.find((m) => m.panelId === A.panelId);
12989
+ l.forEach((d) => {
12990
+ const u = r.find((m) => m.panelId === d.panelId);
12983
12991
  if (!u)
12984
- throw new Y(A);
12992
+ throw new Y(d);
12985
12993
  const h = {
12986
12994
  id: M(),
12987
12995
  src: i,
12988
12996
  asset_key: i,
12989
- svg: d(c),
12997
+ svg: A(c),
12990
12998
  colors: {},
12991
12999
  type: o,
12992
- y: A.top,
12993
- x: A.left,
12994
- width: A.width,
12995
- height: A.height,
12996
- layer: A.layer,
12997
- layerIndex: A.layerIndex,
13000
+ y: d.top,
13001
+ x: d.left,
13002
+ width: d.width,
13003
+ height: d.height,
13004
+ layer: d.layer,
13005
+ layerIndex: d.layerIndex,
12998
13006
  scaleX: 1,
12999
13007
  scaleY: 1,
13000
- rotation: A.rotation,
13008
+ rotation: d.rotation,
13001
13009
  productOverlay: t.type === E.ProductOverlay ? !0 : void 0,
13002
13010
  excludeFromExport: t.data.excludeFromPrint
13003
13011
  };
@@ -13017,7 +13025,7 @@ const Wo = (r) => {
13017
13025
  const S = f.asset.fileLink;
13018
13026
  if (S)
13019
13027
  return S;
13020
- }, d = await (async () => {
13028
+ }, A = await (async () => {
13021
13029
  const p = l();
13022
13030
  if (!p)
13023
13031
  return;
@@ -13026,7 +13034,7 @@ const Wo = (r) => {
13026
13034
  assetUrl: p,
13027
13035
  name: f.names.fullName.en
13028
13036
  };
13029
- })(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", i.text) : i.text) || "", u = Be(A, {
13037
+ })(), d = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", i.text) : i.text) || "", u = Be(d, {
13030
13038
  vertical: a.data.vertical,
13031
13039
  uppercase: a.data.uppercase
13032
13040
  }), h = async (p) => {
@@ -13043,7 +13051,7 @@ const Wo = (r) => {
13043
13051
  align: o(a.data),
13044
13052
  curved: a.data.curved,
13045
13053
  fill: i.color || m || "#000000",
13046
- fontData: d,
13054
+ fontData: A,
13047
13055
  fontSize: a.data.size || s,
13048
13056
  height: p.height,
13049
13057
  layer: p.layer,
@@ -13058,10 +13066,10 @@ const Wo = (r) => {
13058
13066
  x: p.left,
13059
13067
  y: p.top
13060
13068
  };
13061
- if (d) {
13069
+ if (A) {
13062
13070
  const [v, I] = fe(
13063
13071
  a.data.size || s,
13064
- d,
13072
+ A,
13065
13073
  p,
13066
13074
  [
13067
13075
  Be(u, {
@@ -13312,12 +13320,12 @@ class ol extends Fn {
13312
13320
  l = p.width, c = p.height;
13313
13321
  } else
13314
13322
  l = i.width, c = i.height;
13315
- const d = await this.getWorkflowManager?.()?.getTemplatingContext(), A = ya(t.layoutState.layout, e, {
13323
+ const A = await this.getWorkflowManager?.()?.getTemplatingContext(), d = ya(t.layoutState.layout, e, {
13316
13324
  renderingConfiguration: {
13317
13325
  purpose: jt.ThreeD,
13318
- templatingContext: d
13326
+ templatingContext: A
13319
13327
  }
13320
- }), u = mn(A), h = await da.from(this.ctx, u, {
13328
+ }), u = mn(d), h = await da.from(this.ctx, u, {
13321
13329
  anonymousCrossOrigin: !0,
13322
13330
  ignoreDimensions: !this.nonPOTSupport,
13323
13331
  ignoreAnimation: !0,
@@ -13937,7 +13945,7 @@ class hl {
13937
13945
  else {
13938
13946
  if (n === 1) {
13939
13947
  const c = this.globalPropertyState.aspects.findIndex(
13940
- (d) => !d.channel && d.name === t
13948
+ (A) => !A.channel && A.name === t
13941
13949
  );
13942
13950
  c && c > 0 && this.globalPropertyState.aspects.splice(c, 1);
13943
13951
  }
@@ -14321,9 +14329,12 @@ class er {
14321
14329
  * @param limit The maximum number of products to return.
14322
14330
  * @param filters Optional metafield filters to apply to the query.
14323
14331
  * @param tags Optional object of tag filters to apply.
14332
+ * @param sortKey Optional field of the products to sort by.
14333
+ * @param sortDescending Optional boolean to indicate if the sort should be in descending order.
14334
+ * @param quickSearch Optional string to filter products by name.
14324
14335
  * @returns
14325
14336
  */
14326
- async fetchProductsFeed(t, e, a, n, i, s) {
14337
+ async fetchProductsFeed(t, e, a, n, i, s, o) {
14327
14338
  if (this.fullFetched) {
14328
14339
  const d = await (a ? this.filterProducts(a) : this.fetchProducts());
14329
14340
  return {
@@ -14331,7 +14342,7 @@ class er {
14331
14342
  items: d.slice(t, t + e)
14332
14343
  };
14333
14344
  }
14334
- const o = new AbortController(), { signal: l } = o, c = y.getShadowGraphqlClient().watchQuery({
14345
+ const l = new AbortController(), { signal: c } = l, A = y.getShadowGraphqlClient().watchQuery({
14335
14346
  query: Js,
14336
14347
  variables: {
14337
14348
  id: this.getId(),
@@ -14346,33 +14357,34 @@ class er {
14346
14357
  exclude: n.exclude ?? []
14347
14358
  } : void 0,
14348
14359
  sortKey: i,
14349
- sortDescending: s
14360
+ sortDescending: s,
14361
+ quickSearch: o
14350
14362
  },
14351
14363
  errorPolicy: "all",
14352
14364
  fetchPolicy: "cache-first",
14353
14365
  returnPartialData: !0,
14354
14366
  context: {
14355
14367
  fetchOptions: {
14356
- signal: l
14368
+ signal: c
14357
14369
  }
14358
14370
  }
14359
14371
  });
14360
14372
  return new Promise((d) => {
14361
- let A = !1;
14362
- const u = c.subscribe({
14363
- next(h) {
14364
- if (A || h.partial && (!h.data.productCollections || h.data.productCollections.length === 0 || !h.data.productCollections[0].productCollectionProductsFeed?.items || h.data.productCollections[0].productCollectionProductsFeed?.items.length === 0))
14373
+ let u = !1;
14374
+ const h = A.subscribe({
14375
+ next(m) {
14376
+ if (u || m.partial && (!m.data.productCollections || m.data.productCollections.length === 0 || !m.data.productCollections[0].productCollectionProductsFeed?.items || m.data.productCollections[0].productCollectionProductsFeed?.items.length === 0))
14365
14377
  return;
14366
- o.abort(), A = !0, u.unsubscribe();
14367
- const m = h.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((g) => !!g.product).map((g) => new Ae(St(g))) || [];
14378
+ l.abort(), u = !0, h.unsubscribe();
14379
+ const g = m.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((p) => !!p.product).map((p) => new Ae(St(p))) || [];
14368
14380
  d({
14369
- items: m,
14381
+ items: g,
14370
14382
  // Clone items because it could be cached data (immutable)
14371
- total: h.data.productCollections?.[0].productCollectionProductsFeed?.total ?? 0
14383
+ total: m.data.productCollections?.[0].productCollectionProductsFeed?.total ?? 0
14372
14384
  });
14373
14385
  },
14374
14386
  error() {
14375
- A || (A = !0, u.unsubscribe(), d({ items: [], total: 0 }));
14387
+ u || (u = !0, h.unsubscribe(), d({ items: [], total: 0 }));
14376
14388
  }
14377
14389
  });
14378
14390
  });
@@ -14670,22 +14682,22 @@ class Ke {
14670
14682
  this.onGlobalPropertiesChanged.bind(this),
14671
14683
  s
14672
14684
  ), this.globalPropertyHandleService = new ll(this), this.setPreviewService(a);
14673
- const l = new Promise((c, d) => {
14685
+ const l = new Promise((c, A) => {
14674
14686
  if (s?.readonly) {
14675
14687
  c([]);
14676
14688
  return;
14677
14689
  }
14678
14690
  console.log("Setting default global variants.");
14679
- const A = this.globalPropertyStateManager.getGlobalPropertyState();
14680
- A ? this.globalPropertyHandleService.getHandles().then((u) => {
14691
+ const d = this.globalPropertyStateManager.getGlobalPropertyState();
14692
+ d ? this.globalPropertyHandleService.getHandles().then((u) => {
14681
14693
  const h = u.map((m) => {
14682
14694
  if (m.getType() === L.ColorOption || m.getType() === L.Option) {
14683
14695
  const g = m;
14684
- if (!A.aspects.find((f) => f.name === g.getName()))
14696
+ if (!d.aspects.find((f) => f.name === g.getName()))
14685
14697
  return g.initDefaultVariant();
14686
14698
  }
14687
14699
  });
14688
- Promise.all(h).then(c).catch(d);
14700
+ Promise.all(h).then(c).catch(A);
14689
14701
  }) : (console.log("Attempted to set global default variant before state was initialized."), c([]));
14690
14702
  });
14691
14703
  this.initializationPromise = Promise.all([
@@ -14820,9 +14832,9 @@ class Ke {
14820
14832
  const l = a.storage?.colors;
14821
14833
  if (l) {
14822
14834
  const c = Object.fromEntries(
14823
- l.map((d) => [
14824
- d.key,
14825
- { browserValue: d.browserValue, pmsValue: d.pmsValue }
14835
+ l.map((A) => [
14836
+ A.key,
14837
+ { browserValue: A.browserValue, pmsValue: A.pmsValue }
14826
14838
  ]) ?? []
14827
14839
  );
14828
14840
  await s.changeColors(c);
@@ -14875,9 +14887,9 @@ class Ke {
14875
14887
  this.getWorkflowExperiences(),
14876
14888
  this.globalConfigurationPropertyId || "",
14877
14889
  n
14878
- ), d = [...new Set(o.map((u) => u.number))];
14879
- if (d.length > c)
14880
- for (const u of d) {
14890
+ ), A = [...new Set(o.map((u) => u.number))];
14891
+ if (A.length > c)
14892
+ for (const u of A) {
14881
14893
  const h = this.getGlobalPropertyStateManager(), m = l.find((g) => g.channelNumber === u);
14882
14894
  m && await h.setAspect(n, m.variant.id || "", void 0, m.channelNumber);
14883
14895
  }
@@ -15401,16 +15413,16 @@ class Pl {
15401
15413
  mutation: Il,
15402
15414
  variables: {
15403
15415
  processFlowId: t,
15404
- inputs: [...e.map((A) => A.getValueForTransmission())]
15416
+ inputs: [...e.map((d) => d.getValueForTransmission())]
15405
15417
  }
15406
15418
  })).data?.processExecutionCreate?.id;
15407
15419
  if (!i) throw new Error("Failed to create process execution.");
15408
- function s(A) {
15420
+ function s(d) {
15409
15421
  return new Promise((u) => {
15410
- setTimeout(u, A);
15422
+ setTimeout(u, d);
15411
15423
  });
15412
15424
  }
15413
- let o = !1, l = 0, c, d;
15425
+ let o = !1, l = 0, c, A;
15414
15426
  for (; !o; ) {
15415
15427
  c = await y.getShadowGraphqlClient().query({
15416
15428
  query: w`
@@ -15431,14 +15443,14 @@ class Pl {
15431
15443
  ids: [i]
15432
15444
  }
15433
15445
  });
15434
- const A = c.data?.processExecutions[0];
15435
- if (!c || !A) throw new Error("Failed to retrieve server response for execution.");
15436
- if (A.failedAt)
15446
+ const d = c.data?.processExecutions[0];
15447
+ if (!c || !d) throw new Error("Failed to retrieve server response for execution.");
15448
+ if (d.failedAt)
15437
15449
  throw new Error(
15438
15450
  "Execution has failed to complete. See Automation > FLows in Flight on partner account on SpiffCommerce Hub."
15439
15451
  );
15440
- if (A.completedAt) {
15441
- o = !0, d = new Dl(A);
15452
+ if (d.completedAt) {
15453
+ o = !0, A = new Dl(d);
15442
15454
  break;
15443
15455
  }
15444
15456
  l += 1;
@@ -15446,8 +15458,8 @@ class Pl {
15446
15458
  if (l >= u) throw new Error("Maximum wait time exceeded for execution result.");
15447
15459
  await s(a?.sleepTime ? Math.max(a.sleepTime, 500) : 2e3);
15448
15460
  }
15449
- if (!d) throw new Error("Failed to retrieve server response for execution.");
15450
- return Promise.resolve(d);
15461
+ if (!A) throw new Error("Failed to retrieve server response for execution.");
15462
+ return Promise.resolve(A);
15451
15463
  }
15452
15464
  }
15453
15465
  class Dl {
@@ -15605,6 +15617,12 @@ const he = w`
15605
15617
  partner {
15606
15618
  id
15607
15619
  }
15620
+ productCollectionCustomers {
15621
+ id
15622
+ productCollection {
15623
+ id
15624
+ }
15625
+ }
15608
15626
  }
15609
15627
  }
15610
15628
  `, xl = w`
@@ -15922,7 +15940,7 @@ class md {
15922
15940
  } catch (a) {
15923
15941
  throw console.error(a), new ht("Critical - Unable to synchronize workflow state with server.");
15924
15942
  }
15925
- }, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 31.0.0"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15943
+ }, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 31.1.0"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15926
15944
  }
15927
15945
  configure(t) {
15928
15946
  gt.setHubUrl(t.hubUrl), gt.setServerUrl(t.serverUrl), gt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && zr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Ut.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
@@ -16210,7 +16228,7 @@ class md {
16210
16228
  mutation: Ks(a?.graphql?.productCollection?.eagerFetchProducts || !1),
16211
16229
  variables: {
16212
16230
  collectionId: t,
16213
- initialMetadata: e ? Object.entries(e).map((c, d) => ({ key: c[0], value: c[1] })) : void 0,
16231
+ initialMetadata: e ? Object.entries(e).map((c, A) => ({ key: c[0], value: c[1] })) : void 0,
16214
16232
  marketplaceThemeInstallId: this.marketplaceThemeInstallId,
16215
16233
  marketplaceThemeInstallConfigurationId: this.marketplaceThemeInstallConfigurationId
16216
16234
  },
@@ -16260,9 +16278,9 @@ class md {
16260
16278
  });
16261
16279
  if (!c.data?.bundles || c.data?.bundles.length === 0 || !c.data?.bundles[0])
16262
16280
  throw new Error(`Unable to find bundle: ${t}`);
16263
- const d = c.data?.bundles[0], A = k.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
16264
- A.set(d.id, d.partner.id), k.setMap("bundlePartnerIds", A);
16265
- const u = new Ke(this, d, e, a, s, {
16281
+ const A = c.data?.bundles[0], d = k.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
16282
+ d.set(A.id, A.partner.id), k.setMap("bundlePartnerIds", d);
16283
+ const u = new Ke(this, A, e, a, s, {
16266
16284
  additionalHeaders: n?.graphql?.additionalHeaders,
16267
16285
  eagerFetchProducts: n?.graphql?.productCollection?.eagerFetchProducts,
16268
16286
  existingGlobalPropertyState: c.data.globalPropertyState,
@@ -16305,10 +16323,10 @@ class md {
16305
16323
  })).data?.bundleDuplicate;
16306
16324
  if (!c?.id)
16307
16325
  throw new Error("Unable to duplicate bundle");
16308
- const d = k.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
16309
- d.set(c.id, c.partner.id), k.setMap("bundlePartnerIds", d);
16310
- const A = k.getMap("bundleOwnerIds") || /* @__PURE__ */ new Map();
16311
- return A.set(c.id, c.bundleOwnerId), k.setMap("bundleOwnerIds", A), async () => {
16326
+ const A = k.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
16327
+ A.set(c.id, c.partner.id), k.setMap("bundlePartnerIds", A);
16328
+ const d = k.getMap("bundleOwnerIds") || /* @__PURE__ */ new Map();
16329
+ return d.set(c.id, c.bundleOwnerId), k.setMap("bundleOwnerIds", d), async () => {
16312
16330
  const u = new Ke(this, c, void 0, void 0, c.bundleOwnerId, {
16313
16331
  eagerFetchProducts: n?.graphql?.productCollection?.eagerFetchProducts,
16314
16332
  existingGlobalPropertyState: c.globalPropertyState
@@ -16434,10 +16452,10 @@ class md {
16434
16452
  }));
16435
16453
  }, s = t.map((C, b) => ({ option: C, index: b })), o = s.filter((C) => C.option.type === "transaction"), l = s.filter(
16436
16454
  (C) => C.option.type === "integration" || C.option.type === "external"
16437
- ), c = Fa(o, 10), d = Fa(l, 10), A = (await Promise.all([
16455
+ ), c = Fa(o, 10), A = Fa(l, 10), d = (await Promise.all([
16438
16456
  ...c.map(n),
16439
- ...d.map(i)
16440
- ])).flat(), u = [...new Set(A.map((C) => C.workflowId))], h = await nr(u, e), m = new Map(h.map((C) => [C.id, C])), g = k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), p = A.map(async (C) => {
16457
+ ...A.map(i)
16458
+ ])).flat(), u = [...new Set(d.map((C) => C.workflowId))], h = await nr(u, e), m = new Map(h.map((C) => [C.id, C])), g = k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), p = d.map(async (C) => {
16441
16459
  const { transaction: b, workflowId: P, readOnly: B, index: F } = C, Q = m.get(P), T = t[F];
16442
16460
  !g.get(b.id) && b.transactionOwnerId && g.set(b.id, b.transactionOwnerId);
16443
16461
  const tt = g.get(b.id) || void 0, rt = new Tl({
@@ -16596,8 +16614,8 @@ function zl(r, t, e, a) {
16596
16614
  if (a) {
16597
16615
  const o = r, l = Math.max(t.width / e.width, t.height / e.height);
16598
16616
  o.zoom = Math.max(l, r.zoom);
16599
- const c = e.width * o.zoom, d = e.height * o.zoom;
16600
- return o.x = me(r.x, t.width - c, 0), o.y = me(r.y, t.height - d, 0), o;
16617
+ const c = e.width * o.zoom, A = e.height * o.zoom;
16618
+ return o.x = me(r.x, t.width - c, 0), o.y = me(r.y, t.height - A, 0), o;
16601
16619
  }
16602
16620
  const s = r;
16603
16621
  return s.x = me(s.x, -n, t.width), s.y = me(s.y, -i, t.height), s;
@@ -16710,10 +16728,10 @@ class Gl {
16710
16728
  if (this.imageData && this.offsets && this.frameData) {
16711
16729
  (!this.offsets || this.offsets.length !== this.frameData.length) && (this.offsets = new Array(this.frameData.length));
16712
16730
  const i = this.frameData.map((s, o) => {
16713
- const l = (e[o] - this.offsets[o].x) / this.offsets[o].zoom, c = (a[o] - this.offsets[o].y) / this.offsets[o].zoom, d = e[o] - l * t[o], A = a[o] - c * t[o];
16731
+ const l = (e[o] - this.offsets[o].x) / this.offsets[o].zoom, c = (a[o] - this.offsets[o].y) / this.offsets[o].zoom, A = e[o] - l * t[o], d = a[o] - c * t[o];
16714
16732
  return {
16715
- x: d,
16716
- y: A,
16733
+ x: A,
16734
+ y: d,
16717
16735
  zoom: this.imageData.width * t[o] / this.imageData.width
16718
16736
  };
16719
16737
  });
@@ -16827,7 +16845,7 @@ class Gl {
16827
16845
  }
16828
16846
  }
16829
16847
  class wd {
16830
- updateRecipient(t, e, a, n, i, s, o, l, c, d, A, u, h, m, g, p, f) {
16848
+ updateRecipient(t, e, a, n, i, s, o, l, c, A, d, u, h, m, g, p, f) {
16831
16849
  throw new Error("Method not implemented.");
16832
16850
  }
16833
16851
  approveTransaction(t) {