@spiffcommerce/core 27.2.1-beta.18d38888-19ca-5144-b378-0ea4ef812e79 → 27.2.1-beta.31456104-bd13-593d-93cf-06c301698749

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
@@ -11,7 +11,7 @@ import St from "lodash.clonedeep";
11
11
  import { toString as sn } from "qrcode";
12
12
  import mr from "svg-path-bbox";
13
13
  import { parse as Xe } from "opentype.js";
14
- import { jsx as F, jsxs as ct, Fragment as Gt } from "preact/jsx-runtime";
14
+ import { jsx as F, jsxs as ct, Fragment as zt } from "preact/jsx-runtime";
15
15
  import gr from "handlebars";
16
16
  import { dataUriToBuffer as pr } from "data-uri-to-buffer";
17
17
  import Fa from "lodash.chunk";
@@ -21,7 +21,7 @@ import { split as Ze } from "unicode-default-word-boundary";
21
21
  import ln from "lodash.debounce";
22
22
  import "fs";
23
23
  import "path";
24
- var Ce = /* @__PURE__ */ ((r) => (r.Data = "Data", r.Font = "Font", r.Frame = "Frame", r.Illustration = "Illustration", r.Image = "Image", r.Model = "Model", r.Material = "Material", r.Color = "Color", r.QuestionnaireCollateral = "QuestionnaireCollateral", r.RequestCollateral = "RequestCollateral", r.SignupCollateral = "SignupCollateral", r.Video = "Video", r.ColorProfile = "ColorProfile", r.Environment = "Environment", r))(Ce || {}), z = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(z || {}), P = /* @__PURE__ */ ((r) => (r.Information = "Information", r.Bulk = "Bulk", r.DigitalContent = "DigitalContent", r.Finish = "Finish", r.Frame = "Frame", r.Illustration = "Illustration", r.Introduction = "Introduction", r.Material = "Material", r.Model = "Model", r.Module = "Module", r.Picture = "Picture", r.Photo = "Photo", r.ProductOverlay = "ProductOverlay", r.Question = "Question", r.Shape = "Shape", r.SilentIllustration = "SilentIllustration", r.Text = "Text", r))(P || {}), wr = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(wr || {}), Ht = /* @__PURE__ */ ((r) => (r.ThreeD = "ThreeD", r.FreeDesign = "FreeDesign", r.Print = "Print", r))(Ht || {}), M = /* @__PURE__ */ ((r) => (r.Frame = "frame", r.Group = "group", r.Image = "image", r.Pattern = "pattern", r.Illustration = "illustration", r.Textbox = "textbox", r))(M || {}), yr = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(yr || {}), Sr = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Sr || {}), vr = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(vr || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Er = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Er || {}), we = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(we || {}), Mt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(Mt || {}), q = /* @__PURE__ */ ((r) => (r[r.North = 0] = "North", r[r.Northeast = 1] = "Northeast", r[r.East = 2] = "East", r[r.Southeast = 3] = "Southeast", r[r.South = 4] = "South", r[r.Southwest = 5] = "Southwest", r[r.West = 6] = "West", r[r.Northwest = 7] = "Northwest", r))(q || {}), Br = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Br || {});
24
+ var Ce = /* @__PURE__ */ ((r) => (r.Data = "Data", r.Font = "Font", r.Frame = "Frame", r.Illustration = "Illustration", r.Image = "Image", r.Model = "Model", r.Material = "Material", r.Color = "Color", r.QuestionnaireCollateral = "QuestionnaireCollateral", r.RequestCollateral = "RequestCollateral", r.SignupCollateral = "SignupCollateral", r.Video = "Video", r.ColorProfile = "ColorProfile", r.Environment = "Environment", r))(Ce || {}), G = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(G || {}), P = /* @__PURE__ */ ((r) => (r.Information = "Information", r.Bulk = "Bulk", r.DigitalContent = "DigitalContent", r.Finish = "Finish", r.Frame = "Frame", r.Illustration = "Illustration", r.Introduction = "Introduction", r.Material = "Material", r.Model = "Model", r.Module = "Module", r.Picture = "Picture", r.Photo = "Photo", r.ProductOverlay = "ProductOverlay", r.Question = "Question", r.Shape = "Shape", r.SilentIllustration = "SilentIllustration", r.Text = "Text", r))(P || {}), wr = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(wr || {}), Ht = /* @__PURE__ */ ((r) => (r.ThreeD = "ThreeD", r.FreeDesign = "FreeDesign", r.Print = "Print", r))(Ht || {}), M = /* @__PURE__ */ ((r) => (r.Frame = "frame", r.Group = "group", r.Image = "image", r.Pattern = "pattern", r.Illustration = "illustration", r.Textbox = "textbox", r))(M || {}), yr = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(yr || {}), Sr = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Sr || {}), vr = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(vr || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Er = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Er || {}), we = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(we || {}), Mt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(Mt || {}), q = /* @__PURE__ */ ((r) => (r[r.North = 0] = "North", r[r.Northeast = 1] = "Northeast", r[r.East = 2] = "East", r[r.Southeast = 3] = "Southeast", r[r.South = 4] = "South", r[r.Southwest = 5] = "Southwest", r[r.West = 6] = "West", r[r.Northwest = 7] = "Northwest", r))(q || {}), Br = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Br || {});
25
25
  class cn extends Error {
26
26
  constructor(t) {
27
27
  super(t), this.name = this.constructor.name;
@@ -62,7 +62,7 @@ class De extends cn {
62
62
  super(`ImplementationError - ${t}`);
63
63
  }
64
64
  }
65
- class G extends De {
65
+ class z extends De {
66
66
  constructor(t) {
67
67
  super(`Unhandled Behavior Encountered: ${t}`);
68
68
  }
@@ -296,25 +296,25 @@ const Rr = (r) => {
296
296
  let mn;
297
297
  const $r = (r) => {
298
298
  mn = r;
299
- }, Ur = () => new Promise((r) => {
299
+ }, Lr = () => new Promise((r) => {
300
300
  const t = mt.getHubUrl(), e = (a) => {
301
301
  a.origin === t && (window.removeEventListener("message", e), r(a.data));
302
302
  };
303
303
  window.parent !== window && (window.addEventListener("message", e, !1), window.parent.postMessage("ready", t));
304
- }), Lr = async () => {
304
+ }), Ur = async () => {
305
305
  const r = {
306
306
  applicationKey: ma,
307
307
  customerToken: Qr,
308
308
  bearer: mn
309
309
  };
310
- return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await Ur(), ...r } : r;
310
+ return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await Lr(), ...r } : r;
311
311
  };
312
312
  async function Vr(r, t) {
313
313
  const e = mt.getServerUrl(), a = e.includes(".aumelbdev.spiffcommerce.com") ? "https://moonlight.aumelbdev.spiffcommerce.com" : e.includes(".us.spiffcommerce.com") ? "https://moonlight.us.spiffcommerce.com" : "https://moonlight.au.spiffcommerce.com";
314
314
  let n = await rt(r, { ...t, redirect: "manual" });
315
315
  return n.type === "opaqueredirect" && (typeof r != "string" && "url" in r ? n = await rt({ ...r, url: `${a}/graphql` }, t) : n = await rt(`${a}/graphql`, t)), n;
316
316
  }
317
- class zr {
317
+ class Gr {
318
318
  constructor() {
319
319
  this.shadowGraphqlClient = this.constructShadowGraphqlClient(), mt.addServerUrlCallback(() => {
320
320
  this.shadowGraphqlClient = this.constructShadowGraphqlClient();
@@ -331,7 +331,7 @@ class zr {
331
331
  uri: `${mt.getServerUrl()}/graphql`,
332
332
  fetch: Vr
333
333
  }), e = lr(async (i, s) => {
334
- const { headers: o } = s, l = o || {}, c = await Lr();
334
+ const { headers: o } = s, l = o || {}, c = await Ur();
335
335
  let d = s.bearer ?? c.bearer;
336
336
  if (this.spiffClient)
337
337
  try {
@@ -366,7 +366,7 @@ class zr {
366
366
  });
367
367
  }
368
368
  }
369
- const b = new zr();
369
+ const b = new Gr();
370
370
  let aa, na;
371
371
  const gt = (r, t, e) => {
372
372
  if (aa !== void 0)
@@ -415,7 +415,7 @@ function ga() {
415
415
  return $e === void 0 && ($e = Fr()), $e;
416
416
  }
417
417
  let se = null;
418
- const Gr = (r) => new Promise((t) => {
418
+ const zr = (r) => new Promise((t) => {
419
419
  if (ke(r) !== "image/jpeg")
420
420
  return t(1);
421
421
  ur(r).then((a) => t(a || 1)).catch(() => t(1));
@@ -434,7 +434,7 @@ const Gr = (r) => new Promise((t) => {
434
434
  const u = gt(a, n);
435
435
  return (A = u.getContext("2d")) == null || A.drawImage(e, 0, 0, a, n), u;
436
436
  }
437
- const s = await Gr(r), [o, l] = s > 4 ? [n, a] : [a, n], c = gt(o, l), d = c.getContext("2d");
437
+ const s = await zr(r), [o, l] = s > 4 ? [n, a] : [a, n], c = gt(o, l), d = c.getContext("2d");
438
438
  switch (s) {
439
439
  case 2:
440
440
  d.translate(o, 0), d.scale(-1, 1);
@@ -3154,7 +3154,7 @@ const Gr = (r) => new Promise((t) => {
3154
3154
  "3E2B2E",
3155
3155
  "101820",
3156
3156
  "3D3935"
3157
- ], Ue = Ft.map((r) => [
3157
+ ], Le = Ft.map((r) => [
3158
3158
  parseInt(r.substring(0, 2), 16),
3159
3159
  parseInt(r.substring(2, 4), 16),
3160
3160
  parseInt(r.substring(4, 6), 16)
@@ -3177,7 +3177,7 @@ function Pc(r, t = 64) {
3177
3177
  const i = parseInt(r.substring(0, 2), 16), s = parseInt(r.substring(2, 4), 16), o = parseInt(r.substring(4, 6), 16);
3178
3178
  let l, c, d;
3179
3179
  for (let A = 0; A < Ft.length; A++) {
3180
- l = Ue[A][0], c = Ue[A][1], d = Ue[A][2];
3180
+ l = Le[A][0], c = Le[A][1], d = Le[A][2];
3181
3181
  const u = Math.sqrt(Math.pow(i - l, 2) + Math.pow(s - c, 2) + Math.pow(o - d, 2));
3182
3182
  a.push(u);
3183
3183
  }
@@ -3556,7 +3556,7 @@ class di {
3556
3556
  if (this.cache.has(t)) {
3557
3557
  const n = this.cache.get(t);
3558
3558
  if (!n)
3559
- throw new G("Failed to get asset from cache!");
3559
+ throw new z("Failed to get asset from cache!");
3560
3560
  return n;
3561
3561
  }
3562
3562
  const a = (async () => (await ve([t]))[0])();
@@ -3583,7 +3583,7 @@ class di {
3583
3583
  */
3584
3584
  cacheAsset(t) {
3585
3585
  if (!t.key)
3586
- throw new G("Asset has no key!");
3586
+ throw new z("Asset has no key!");
3587
3587
  this.cache.has(t.key) || this.cache.set(t.key, Promise.resolve(t));
3588
3588
  }
3589
3589
  /**
@@ -3591,7 +3591,7 @@ class di {
3591
3591
  */
3592
3592
  cacheMaterial(t) {
3593
3593
  if (!t.id)
3594
- throw new G("Material has no id!");
3594
+ throw new z("Material has no id!");
3595
3595
  this.materialCache.has(t.id) || this.materialCache.set(t.id, Promise.resolve(t));
3596
3596
  }
3597
3597
  /**
@@ -3709,7 +3709,7 @@ class di {
3709
3709
  case "mkv":
3710
3710
  return "video/x-matroska";
3711
3711
  default:
3712
- throw new G("Unexpected mimetype: " + e);
3712
+ throw new z("Unexpected mimetype: " + e);
3713
3713
  }
3714
3714
  }
3715
3715
  }
@@ -3799,7 +3799,7 @@ class K {
3799
3799
  N.setMap($a, t);
3800
3800
  }
3801
3801
  }
3802
- const U = new di();
3802
+ const L = new di();
3803
3803
  class Ai {
3804
3804
  constructor() {
3805
3805
  this.cache = {}, this.disabled = !1;
@@ -3887,8 +3887,8 @@ const Jt = new Ai(), vn = v`
3887
3887
  });
3888
3888
  return t.data.options.forEach((e) => {
3889
3889
  var a, n;
3890
- (a = e.defaultVariant) != null && a.asset && U.cacheAsset(e.defaultVariant.asset), e.colorProfile && U.cacheAsset(e.colorProfile), (n = e.variants) == null || n.forEach((i) => {
3891
- i.asset && U.cacheAsset(i.asset), i.thumbnail && U.cacheAsset(i.thumbnail), i.material && U.cacheMaterial(i.material);
3890
+ (a = e.defaultVariant) != null && a.asset && L.cacheAsset(e.defaultVariant.asset), e.colorProfile && L.cacheAsset(e.colorProfile), (n = e.variants) == null || n.forEach((i) => {
3891
+ i.asset && L.cacheAsset(i.asset), i.thumbnail && L.cacheAsset(i.thumbnail), i.material && L.cacheMaterial(i.material);
3892
3892
  });
3893
3893
  }), t.data.options;
3894
3894
  }, mi = async (r, t) => (await t).find((a) => a.id === r), gi = async (r) => {
@@ -5134,7 +5134,7 @@ const Y = new pi(), En = v`
5134
5134
  internalId
5135
5135
  }
5136
5136
  }
5137
- `, Ot = [P.SilentIllustration, P.ProductOverlay], Ui = async (r) => {
5137
+ `, Ot = [P.SilentIllustration, P.ProductOverlay], Li = async (r) => {
5138
5138
  const t = [];
5139
5139
  r.introduction && t.push({
5140
5140
  name: "Introduction",
@@ -5152,7 +5152,7 @@ const Y = new pi(), En = v`
5152
5152
  silentSteps: []
5153
5153
  });
5154
5154
  for (const a of r.steps) {
5155
- const n = Li(a.stepName, r.stepGroups);
5155
+ const n = Ui(a.stepName, r.stepGroups);
5156
5156
  if (!n)
5157
5157
  t.push({
5158
5158
  name: a.stepName,
@@ -5189,7 +5189,7 @@ const Y = new pi(), En = v`
5189
5189
  ],
5190
5190
  silentSteps: []
5191
5191
  }), t;
5192
- }, Li = (r, t) => t.find((e) => e.stepNames.includes(r)), yt = (r, t) => (r.conditions || []).every((e) => {
5192
+ }, Ui = (r, t) => t.find((e) => e.stepNames.includes(r)), yt = (r, t) => (r.conditions || []).every((e) => {
5193
5193
  const a = t[e.targetStepName];
5194
5194
  if (a && a.selectedVariants) {
5195
5195
  const n = a.selectedVariants;
@@ -5206,7 +5206,7 @@ const Y = new pi(), En = v`
5206
5206
  silentSteps: r.silentSteps.filter((a) => yt(a, t))
5207
5207
  };
5208
5208
  return e.silentSteps.length === 0 && e.renderableSteps.length === 0 ? null : e;
5209
- }, Dt = (r, t) => r.map((e) => Vi(e, t)).filter((e) => e !== null), zi = async (r, t, e = !1) => {
5209
+ }, Dt = (r, t) => r.map((e) => Vi(e, t)).filter((e) => e !== null), Gi = async (r, t, e = !1) => {
5210
5210
  var s;
5211
5211
  const a = Dt(r, t), n = [];
5212
5212
  for (const o of a)
@@ -5301,7 +5301,7 @@ class xn {
5301
5301
  const Q = () => {
5302
5302
  const r = () => Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
5303
5303
  return r() + r() + "-" + r() + "-" + r() + "-" + r() + "-" + r() + r() + r();
5304
- }, Gi = ({
5304
+ }, zi = ({
5305
5305
  backgroundColor: r,
5306
5306
  outlineColor: t,
5307
5307
  borderRadius: e,
@@ -5480,7 +5480,7 @@ const Q = () => {
5480
5480
  x: (r.x - t.x) * n - (r.y - t.y) * a + t.x,
5481
5481
  y: (r.x - t.x) * a + (r.y - t.y) * n + t.y
5482
5482
  };
5483
- }, Uc = 0.352778, Lc = 0.035277, Fn = (r) => {
5483
+ }, Lc = 0.352778, Uc = 0.035277, Fn = (r) => {
5484
5484
  const t = r.rotation || 0, e = pt(t), a = Math.cos(e), n = -Math.sin(e);
5485
5485
  return /* @__PURE__ */ F("g", { mask: r.stepName || r.productOverlay ? void 0 : r.mask, children: /* @__PURE__ */ F(
5486
5486
  "g",
@@ -5505,7 +5505,7 @@ const Q = () => {
5505
5505
  }, kn = (r) => {
5506
5506
  var l;
5507
5507
  const t = `spiff-group-clip-${r.id}`, e = r.rotation || 0, a = pt(e), n = Math.cos(a), i = -Math.sin(a), s = va(r.children);
5508
- return /* @__PURE__ */ ct(Gt, { children: [
5508
+ return /* @__PURE__ */ ct(zt, { children: [
5509
5509
  /* @__PURE__ */ F("defs", { children: (() => /* @__PURE__ */ F("clipPath", { id: t, preserveAspectRatio: "none", children: r.clipPath ? /* @__PURE__ */ F("path", { d: r.clipPath }) : /* @__PURE__ */ F("rect", { x: 0, y: 0, width: r.width, height: r.height }) }))() }),
5510
5510
  /* @__PURE__ */ ct(
5511
5511
  "g",
@@ -5545,8 +5545,8 @@ const Q = () => {
5545
5545
  return r.pattern.src;
5546
5546
  };
5547
5547
  if (!a())
5548
- return /* @__PURE__ */ F(Gt, {});
5549
- const n = () => r.threshold ? r.invertThreshold ? "1 ".repeat(r.threshold) + "0 ".repeat(256 - r.threshold) : "0 ".repeat(r.threshold) + "1 ".repeat(256 - r.threshold) : "", i = () => /* @__PURE__ */ F(Gt, { children: r.useThreshold && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ ct("filter", { id: e, "color-interpolation-filters": "sRGB", children: [
5548
+ return /* @__PURE__ */ F(zt, {});
5549
+ const n = () => r.threshold ? r.invertThreshold ? "1 ".repeat(r.threshold) + "0 ".repeat(256 - r.threshold) : "0 ".repeat(r.threshold) + "1 ".repeat(256 - r.threshold) : "", i = () => /* @__PURE__ */ F(zt, { children: r.useThreshold && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ ct("filter", { id: e, "color-interpolation-filters": "sRGB", children: [
5550
5550
  /* @__PURE__ */ F(
5551
5551
  "feColorMatrix",
5552
5552
  {
@@ -5590,7 +5590,7 @@ const Q = () => {
5590
5590
  src: a()
5591
5591
  }];
5592
5592
  };
5593
- return /* @__PURE__ */ ct(Gt, { children: [
5593
+ return /* @__PURE__ */ ct(zt, { children: [
5594
5594
  i(),
5595
5595
  /* @__PURE__ */ F(
5596
5596
  "g",
@@ -5677,9 +5677,9 @@ class ji {
5677
5677
  }), a - n;
5678
5678
  }
5679
5679
  }
5680
- const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @__PURE__ */ new Map(), Nt = async (r) => {
5681
- if (Le.has(r))
5682
- return Le.get(r);
5680
+ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ue = /* @__PURE__ */ new Map(), Nt = async (r) => {
5681
+ if (Ue.has(r))
5682
+ return Ue.get(r);
5683
5683
  const e = (async () => {
5684
5684
  try {
5685
5685
  return Et(r).getFont();
@@ -5693,7 +5693,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5693
5693
  }
5694
5694
  }
5695
5695
  })();
5696
- return Le.set(r, e), e;
5696
+ return Ue.set(r, e), e;
5697
5697
  }, qi = (r) => {
5698
5698
  const t = hn(r), e = Xe(t);
5699
5699
  return ra(r, e), e;
@@ -5742,7 +5742,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5742
5742
  }
5743
5743
  return e.querySelectorAll("text").forEach((d) => d.remove()), bt().serializeToString(a);
5744
5744
  }, Ee = (r, t, e, a) => Math.max(_i(r.join(`
5745
- `), e, a), t), Ua = (r, t, e, a, n, i) => {
5745
+ `), e, a), t), La = (r, t, e, a, n, i) => {
5746
5746
  const s = (i || ya) * n.getApproximateHeight(), o = t.split(`
5747
5747
  `);
5748
5748
  try {
@@ -5800,7 +5800,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5800
5800
  var c;
5801
5801
  const n = Et(t.fontData.assetUrl), i = n.getFont(), s = t.fontSize / i.unitsPerEm;
5802
5802
  if (!e)
5803
- return Ua(t, r, t.fontSize, s, n, a);
5803
+ return La(t, r, t.fontSize, s, n, a);
5804
5804
  let o;
5805
5805
  if (t.text ? o = t.text.split(`
5806
5806
  `) : o = ((c = t.input) == null ? void 0 : c.split(`
@@ -5817,7 +5817,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5817
5817
  requiredHeight: t.height,
5818
5818
  requiredWidth: Ee(o, t.width, s, n),
5819
5819
  fontSize: Yi(o, n, i, t.width, t.height, a)
5820
- } : Ua(t, r, t.fontSize, s, n, a);
5820
+ } : La(t, r, t.fontSize, s, n, a);
5821
5821
  }, Ki = (r, t, e, a, n) => {
5822
5822
  const s = Et(t.assetUrl).getFont();
5823
5823
  let o = { ...r };
@@ -5846,12 +5846,12 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5846
5846
  return r.forEach((n) => {
5847
5847
  a = Math.max(a, ht(n, t, e));
5848
5848
  }), a;
5849
- }, La = {
5849
+ }, Ua = {
5850
5850
  stripControlCharacters: !0,
5851
5851
  vertical: !1,
5852
5852
  uppercase: !1
5853
- }, Be = (r, t = La) => {
5854
- const e = { ...La, ...t };
5853
+ }, Be = (r, t = Ua) => {
5854
+ const e = { ...Ua, ...t };
5855
5855
  let a = r || "";
5856
5856
  return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
5857
5857
  `)), a;
@@ -5890,7 +5890,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5890
5890
  var w;
5891
5891
  return r.textFillImage ? `url("#${s}")` : (w = r._renderingConfiguration) != null && w.spotColors && r.fillSpotColorDefinition ? `${r.fill} ${fn(r.fillSpotColorDefinition)}` : r.fill;
5892
5892
  };
5893
- return /* @__PURE__ */ ct(Gt, { children: [
5893
+ return /* @__PURE__ */ ct(zt, { children: [
5894
5894
  /* @__PURE__ */ ct("defs", { children: [
5895
5895
  r.textFillImage && /* @__PURE__ */ F(
5896
5896
  "pattern",
@@ -6046,7 +6046,7 @@ class rs {
6046
6046
  return this.state;
6047
6047
  }
6048
6048
  runStateCallbacks() {
6049
- this.stateCallbacks.forEach((t) => t());
6049
+ console.log("LOG: running callbacks"), this.stateCallbacks.forEach((t) => t());
6050
6050
  }
6051
6051
  apply(t, e) {
6052
6052
  if (!this.state)
@@ -6114,7 +6114,7 @@ class rs {
6114
6114
  layouts: {}
6115
6115
  };
6116
6116
  t.forEach((n) => {
6117
- a = new Un(n).apply(a);
6117
+ a = new Ln(n).apply(a);
6118
6118
  }), this.runStateCallbacks(), this.state = {
6119
6119
  transaction: a
6120
6120
  };
@@ -6127,7 +6127,7 @@ class rs {
6127
6127
  const Qn = (r) => r.type === M.Image ? /* @__PURE__ */ F(Fn, { ...r }, r.id) : r.type === M.Frame ? /* @__PURE__ */ F(Wi, { ...r }, r.id) : r.type === M.Illustration ? /* @__PURE__ */ F(ns, { ...r }, r.id) : r.type === M.Textbox ? /* @__PURE__ */ F(ts, { ...r }, r.id) : r.type === M.Group ? /* @__PURE__ */ F(kn, { ...r }, r.id) : null, Sa = (r, t, e) => {
6128
6128
  const a = e.renderingConfiguration, n = a != null && a.removeExcludedElements ? t.filter((i) => !i.excludeFromExport) : t;
6129
6129
  return /* @__PURE__ */ F(
6130
- Gi,
6130
+ zi,
6131
6131
  {
6132
6132
  preserveAspectRatio: void 0,
6133
6133
  elements: n,
@@ -6174,7 +6174,7 @@ const ae = (r) => {
6174
6174
  if (r.defaultVariant !== void 0)
6175
6175
  return t.find((e) => e.id === r.defaultVariant);
6176
6176
  }
6177
- }, At = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(), ze = /* @__PURE__ */ new Map(), Rn = async (r, t) => {
6177
+ }, At = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(), Ge = /* @__PURE__ */ new Map(), Rn = async (r, t) => {
6178
6178
  if (!t) {
6179
6179
  if (!r)
6180
6180
  throw new Error("No region or src supplied. Cannot construct frame!");
@@ -6198,8 +6198,8 @@ const ae = (r) => {
6198
6198
  throw new Error(`No asset for variant with ID: ${r.frameVariantId}`);
6199
6199
  return e;
6200
6200
  }, Qe = async (r) => {
6201
- if (ze.has(r))
6202
- return ze.get(r);
6201
+ if (Ge.has(r))
6202
+ return Ge.get(r);
6203
6203
  const e = (async () => {
6204
6204
  if (Vt.has(r))
6205
6205
  return Vt.get(r);
@@ -6235,7 +6235,7 @@ const ae = (r) => {
6235
6235
  }
6236
6236
  throw new Error("Malformed frame SVG");
6237
6237
  })();
6238
- return ze.set(r, e), e;
6238
+ return Ge.set(r, e), e;
6239
6239
  }, Ea = (r, t, e, a) => {
6240
6240
  const n = t.width / t.height, i = r.width / r.height;
6241
6241
  let s;
@@ -6297,9 +6297,9 @@ const ae = (r) => {
6297
6297
  at(r).then((e) => {
6298
6298
  t(e);
6299
6299
  }).catch((e) => console.error(e));
6300
- }), Ge = /* @__PURE__ */ new Map(), Kt = async (r) => {
6301
- if (Ge.has(r))
6302
- return Ge.get(r);
6300
+ }), ze = /* @__PURE__ */ new Map(), Kt = async (r) => {
6301
+ if (ze.has(r))
6302
+ return ze.get(r);
6303
6303
  const t = async (n) => new Promise((i, s) => {
6304
6304
  try {
6305
6305
  if (!(!!URL && !!URL.createObjectURL))
@@ -6331,8 +6331,8 @@ const ae = (r) => {
6331
6331
  A.resize(m, m);
6332
6332
  return await A.render(), await t(c);
6333
6333
  })();
6334
- return Ge.set(r, a), a;
6335
- }, Ut = async (r, t, e, a) => {
6334
+ return ze.set(r, a), a;
6335
+ }, Lt = async (r, t, e, a) => {
6336
6336
  const n = r.layoutState.layout.useEditableArea && r.layoutState.layout.editableArea || {
6337
6337
  width: r.layoutState.layout.width,
6338
6338
  height: r.layoutState.layout.height,
@@ -6364,9 +6364,9 @@ const ae = (r) => {
6364
6364
  }
6365
6365
  return o;
6366
6366
  };
6367
- class zc {
6367
+ class Gc {
6368
6368
  static async getFrame(t, e) {
6369
- const a = await Rn(e.region, e.src), n = await Qe(a), i = e.region || await Ut(t, M.Frame);
6369
+ const a = await Rn(e.region, e.src), n = await Qe(a), i = e.region || await Lt(t, M.Frame);
6370
6370
  return {
6371
6371
  id: Q(),
6372
6372
  x: i.left,
@@ -6392,7 +6392,7 @@ class zc {
6392
6392
  };
6393
6393
  }
6394
6394
  static async getImage(t, e) {
6395
- const a = e.region || await Ut(t, M.Image, e.src);
6395
+ const a = e.region || await Lt(t, M.Image, e.src);
6396
6396
  return {
6397
6397
  id: Q(),
6398
6398
  src: e.src,
@@ -6416,7 +6416,7 @@ class zc {
6416
6416
  }, l = (i == null ? void 0 : i.text) || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = Be(c, {
6417
6417
  vertical: a.vertical,
6418
6418
  uppercase: a.uppercase
6419
- }), A = e.region || await Ut(t, M.Textbox, n, {
6419
+ }), A = e.region || await Lt(t, M.Textbox, n, {
6420
6420
  text: d,
6421
6421
  fontScale: a.size ? a.size / s.unitsPerEm : void 0
6422
6422
  }), u = ee(
@@ -6482,7 +6482,7 @@ class zc {
6482
6482
  </svg>
6483
6483
  `, n = {};
6484
6484
  n["spiff-fill-shape"] = { browserValue: e.color };
6485
- const i = e.region || await Ut(t, M.Illustration), s = Q();
6485
+ const i = e.region || await Lt(t, M.Illustration), s = Q();
6486
6486
  return {
6487
6487
  stepRegion: e.region,
6488
6488
  colors: n,
@@ -6500,7 +6500,7 @@ class zc {
6500
6500
  };
6501
6501
  }
6502
6502
  static async getIllustration(t, e) {
6503
- const a = e.region || await Ut(t, M.Illustration, e.src), n = await lt(await $n(e.src)), i = await Kt(n.svg), s = Q();
6503
+ const a = e.region || await Lt(t, M.Illustration, e.src), n = await lt(await $n(e.src)), i = await Kt(n.svg), s = Q();
6504
6504
  return {
6505
6505
  cachedObjectURL: i,
6506
6506
  stepRegion: e.region,
@@ -6525,7 +6525,7 @@ class V extends Error {
6525
6525
  super("Element not found!"), Object.setPrototypeOf(this, V.prototype);
6526
6526
  }
6527
6527
  }
6528
- const L = (r, t) => X(r, t).elements.find((n) => n.id === r), X = (r, t) => {
6528
+ const U = (r, t) => X(r, t).elements.find((n) => n.id === r), X = (r, t) => {
6529
6529
  const e = Object.values(t).find((a) => a.elements.some((n) => n.id === r));
6530
6530
  if (!e)
6531
6531
  throw new V();
@@ -6537,7 +6537,7 @@ const L = (r, t) => X(r, t).elements.find((n) => n.id === r), X = (r, t) => {
6537
6537
  elements: a,
6538
6538
  modificationID: Q()
6539
6539
  };
6540
- }, za = async (r) => {
6540
+ }, Ga = async (r) => {
6541
6541
  var a;
6542
6542
  const t = [...Object.keys(r.layouts)], e = [...new Set(t)];
6543
6543
  for (let n = 0; n < e.length; n++) {
@@ -6599,7 +6599,7 @@ class O {
6599
6599
  this.oldState = t;
6600
6600
  }
6601
6601
  }
6602
- class Ga extends O {
6602
+ class za extends O {
6603
6603
  constructor(t) {
6604
6604
  super(), this.serializableWorkflow = t;
6605
6605
  }
@@ -6610,13 +6610,13 @@ class Ga extends O {
6610
6610
  };
6611
6611
  }
6612
6612
  }
6613
- class Gc extends O {
6613
+ class zc extends O {
6614
6614
  constructor(t, e, a) {
6615
6615
  super(), this.id = t, this.x = e, this.y = a;
6616
6616
  }
6617
6617
  apply(t) {
6618
6618
  this.oldState = t;
6619
- const e = L(this.id, Object.values(t.layouts));
6619
+ const e = U(this.id, Object.values(t.layouts));
6620
6620
  if (!e.id)
6621
6621
  throw new V();
6622
6622
  const a = {
@@ -6639,7 +6639,7 @@ class Wc extends O {
6639
6639
  }
6640
6640
  apply(t) {
6641
6641
  this.oldState = t;
6642
- const e = L(this.id, Object.values(t.layouts));
6642
+ const e = U(this.id, Object.values(t.layouts));
6643
6643
  if (!e.id)
6644
6644
  throw new V();
6645
6645
  const a = {
@@ -6661,7 +6661,7 @@ class jc extends O {
6661
6661
  }
6662
6662
  apply(t) {
6663
6663
  this.oldState = t;
6664
- const e = L(this.id, Object.values(t.layouts));
6664
+ const e = U(this.id, Object.values(t.layouts));
6665
6665
  if (!e.id)
6666
6666
  throw new V();
6667
6667
  let a = {
@@ -6694,7 +6694,7 @@ class $ extends O {
6694
6694
  return this.oldState = t, this.commands.reduce((e, a) => a.apply(e), t);
6695
6695
  }
6696
6696
  }
6697
- class Un extends O {
6697
+ class Ln extends O {
6698
6698
  constructor(t) {
6699
6699
  super(), this.layout = t;
6700
6700
  }
@@ -6800,7 +6800,7 @@ class ss extends O {
6800
6800
  }
6801
6801
  apply(t) {
6802
6802
  this.oldState = t;
6803
- const e = L(this.id, Object.values(t.layouts));
6803
+ const e = U(this.id, Object.values(t.layouts));
6804
6804
  if (!e.id)
6805
6805
  throw new V();
6806
6806
  const a = {
@@ -6824,7 +6824,7 @@ class We extends O {
6824
6824
  }
6825
6825
  apply(t) {
6826
6826
  this.oldState = t;
6827
- const e = L(this.id, Object.values(t.layouts));
6827
+ const e = U(this.id, Object.values(t.layouts));
6828
6828
  if (!e.id)
6829
6829
  throw new V();
6830
6830
  const a = {
@@ -6846,7 +6846,7 @@ class os extends O {
6846
6846
  }
6847
6847
  apply(t) {
6848
6848
  this.oldState = t;
6849
- const e = L(this.id, Object.values(t.layouts));
6849
+ const e = U(this.id, Object.values(t.layouts));
6850
6850
  if (!e.id)
6851
6851
  throw new V();
6852
6852
  const a = {
@@ -6868,7 +6868,7 @@ class Wa extends O {
6868
6868
  }
6869
6869
  apply(t) {
6870
6870
  this.oldState = t;
6871
- const e = L(this.id, Object.values(t.layouts));
6871
+ const e = U(this.id, Object.values(t.layouts));
6872
6872
  if (!e.id)
6873
6873
  throw new V();
6874
6874
  const a = {
@@ -6890,7 +6890,7 @@ class ls extends O {
6890
6890
  }
6891
6891
  apply(t) {
6892
6892
  this.oldState = t;
6893
- const e = L(this.id, Object.values(t.layouts));
6893
+ const e = U(this.id, Object.values(t.layouts));
6894
6894
  if (!e.id)
6895
6895
  throw new V();
6896
6896
  const a = {
@@ -6948,7 +6948,7 @@ class ds extends O {
6948
6948
  }
6949
6949
  apply(t) {
6950
6950
  this.oldState = t;
6951
- const e = L(this.id, Object.values(t.layouts));
6951
+ const e = U(this.id, Object.values(t.layouts));
6952
6952
  if (!e.id)
6953
6953
  throw new V();
6954
6954
  const a = {
@@ -6973,7 +6973,7 @@ class Hc extends O {
6973
6973
  }
6974
6974
  apply(t) {
6975
6975
  this.oldState = t;
6976
- const e = L(this.id, Object.values(t.layouts));
6976
+ const e = U(this.id, Object.values(t.layouts));
6977
6977
  if (!e.id)
6978
6978
  throw new V();
6979
6979
  const a = {
@@ -6995,7 +6995,7 @@ class As extends O {
6995
6995
  }
6996
6996
  apply(t) {
6997
6997
  this.oldState = t;
6998
- const e = L(this.id, Object.values(t.layouts));
6998
+ const e = U(this.id, Object.values(t.layouts));
6999
6999
  if (!e.id)
7000
7000
  throw new V();
7001
7001
  const a = X(e.id, Object.values(t.layouts)), n = Z(ee(e, this.text, e), a);
@@ -7014,7 +7014,7 @@ class je extends O {
7014
7014
  }
7015
7015
  apply(t) {
7016
7016
  this.oldState = t;
7017
- const e = L(this.id, Object.values(t.layouts));
7017
+ const e = U(this.id, Object.values(t.layouts));
7018
7018
  if (!e.id)
7019
7019
  throw new V();
7020
7020
  const a = {
@@ -7037,7 +7037,7 @@ class oa extends O {
7037
7037
  }
7038
7038
  apply(t) {
7039
7039
  this.oldState = t;
7040
- const e = L(this.id, Object.values(t.layouts));
7040
+ const e = U(this.id, Object.values(t.layouts));
7041
7041
  if (!e.id)
7042
7042
  throw new V();
7043
7043
  const a = e.colors || {}, n = a[this.className];
@@ -7069,7 +7069,7 @@ class us extends O {
7069
7069
  }
7070
7070
  apply(t) {
7071
7071
  this.oldState = t;
7072
- const e = L(this.id, Object.values(t.layouts));
7072
+ const e = U(this.id, Object.values(t.layouts));
7073
7073
  if (!e.id)
7074
7074
  throw new V();
7075
7075
  const a = {
@@ -7094,7 +7094,7 @@ class qc extends O {
7094
7094
  super(), this.id = t;
7095
7095
  }
7096
7096
  apply(t) {
7097
- if (this.oldState = t, !L(this.id, Object.values(t.layouts)).id)
7097
+ if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
7098
7098
  throw new V();
7099
7099
  const a = Object.values(t.layouts).find((s) => s.elements.find((o) => o.id === this.id));
7100
7100
  if (!a)
@@ -7124,7 +7124,7 @@ class Yc extends O {
7124
7124
  }
7125
7125
  apply(t) {
7126
7126
  this.oldState = t;
7127
- const e = L(this.id, Object.values(t.layouts));
7127
+ const e = U(this.id, Object.values(t.layouts));
7128
7128
  if (!e.id)
7129
7129
  throw new V();
7130
7130
  const a = Object.values(t.layouts).find((o) => o.elements.find((l) => l.id === this.id));
@@ -7154,7 +7154,7 @@ class Jc extends O {
7154
7154
  super(), this.id = t;
7155
7155
  }
7156
7156
  apply(t) {
7157
- if (this.oldState = t, !L(this.id, Object.values(t.layouts)).id)
7157
+ if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
7158
7158
  throw new V();
7159
7159
  const a = Object.values(t.layouts).find((l) => l.elements.find((c) => c.id === this.id));
7160
7160
  if (!a)
@@ -7181,7 +7181,7 @@ class Kc extends O {
7181
7181
  super(), this.id = t;
7182
7182
  }
7183
7183
  apply(t) {
7184
- if (this.oldState = t, !L(this.id, Object.values(t.layouts)).id)
7184
+ if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
7185
7185
  throw new V();
7186
7186
  const a = Object.values(t.layouts).find((l) => l.elements.find((c) => c.id === this.id));
7187
7187
  if (!a)
@@ -7315,7 +7315,7 @@ const hs = async (r) => {
7315
7315
  throw console.error(e), new xe("Failed to shorten URL, see console.");
7316
7316
  }
7317
7317
  };
7318
- class Ln {
7318
+ class Un {
7319
7319
  async poll() {
7320
7320
  try {
7321
7321
  if (await this.predicate()) {
@@ -7362,7 +7362,7 @@ class ms {
7362
7362
  const h = (await ve([e]))[0], m = (p = (g = h == null ? void 0 : h.versions) == null ? void 0 : g.find((f) => f.name === "mpeg4")) == null ? void 0 : p.link;
7363
7363
  return { asset: h, link: m };
7364
7364
  }, s = await new Promise((h, m) => {
7365
- new Ln(
7365
+ new Un(
7366
7366
  async () => !!(await i()).link,
7367
7367
  async () => {
7368
7368
  const g = await i();
@@ -7456,7 +7456,7 @@ class be {
7456
7456
  const s = e.getWorkflowExperience().getBundle();
7457
7457
  if (s && t.globalPropertyAspectConfigurations) {
7458
7458
  const o = s.getGlobalPropertyStateManager(), l = t.globalPropertyAspectConfigurations[0], c = o.getAspectStorage(l.aspectName);
7459
- c && c.originalAssetKey && (i = (await U.getLocalOrFromServer(c.originalAssetKey)).fileLink);
7459
+ c && c.originalAssetKey && (i = (await L.getLocalOrFromServer(c.originalAssetKey)).fileLink);
7460
7460
  }
7461
7461
  if (t.option && t.option.variants && t.option.variants.length > 0) {
7462
7462
  const o = t.option, l = Y.getDefaultVariant(o);
@@ -7552,14 +7552,14 @@ class be {
7552
7552
  const o = e.fileLink || "";
7553
7553
  return o.endsWith(".pdf") || o.endsWith(".eps") || o.endsWith(".ai") ? new Promise((c) => {
7554
7554
  a.addPoller(
7555
- new Ln(
7555
+ new Un(
7556
7556
  async () => {
7557
7557
  var h;
7558
- const A = (h = (await U.getFromServer(e.key || "")).versions) == null ? void 0 : h.find((m) => m.name === "svg");
7558
+ const A = (h = (await L.getFromServer(e.key || "")).versions) == null ? void 0 : h.find((m) => m.name === "svg");
7559
7559
  return A ? (await rt(A.link)).status === 200 : !1;
7560
7560
  },
7561
7561
  () => {
7562
- U.getLocalOrFromServer(e.key || "").then((d) => {
7562
+ L.getLocalOrFromServer(e.key || "").then((d) => {
7563
7563
  this.loadPatternFromAsset(d, t, a, n).then(
7564
7564
  c
7565
7565
  );
@@ -7854,7 +7854,7 @@ class gs {
7854
7854
  if (a.length === 0)
7855
7855
  return [];
7856
7856
  try {
7857
- return L(
7857
+ return U(
7858
7858
  a[0].id,
7859
7859
  e.getAllLayoutData()
7860
7860
  ).colors;
@@ -7939,7 +7939,7 @@ class gs {
7939
7939
  var h, m;
7940
7940
  if (e.length === 0)
7941
7941
  return;
7942
- const s = L(
7942
+ const s = U(
7943
7943
  e[0].id,
7944
7944
  n().map((g) => g.layoutState)
7945
7945
  ), o = { ...s.colors }, l = {};
@@ -8143,7 +8143,7 @@ class ps {
8143
8143
  };
8144
8144
  }
8145
8145
  }
8146
- const zn = new ps();
8146
+ const Gn = new ps();
8147
8147
  class fs {
8148
8148
  async init(t, e, a) {
8149
8149
  const n = t.option;
@@ -8229,7 +8229,7 @@ class fs {
8229
8229
  };
8230
8230
  }
8231
8231
  }
8232
- const Gn = new fs();
8232
+ const zn = new fs();
8233
8233
  class Cs {
8234
8234
  async init(t, e, a) {
8235
8235
  if (a)
@@ -8437,14 +8437,17 @@ class ws {
8437
8437
  const jn = new ws();
8438
8438
  class ys {
8439
8439
  async init(t, e, a) {
8440
+ console.log("LOG: q init");
8440
8441
  const n = t.option;
8441
8442
  if (!n)
8442
- return null;
8443
+ return console.log("LOG: q no option"), null;
8443
8444
  if (a)
8444
- await this.reload(t, e, a);
8445
+ console.log("LOG: q reload"), await this.reload(t, e, a);
8445
8446
  else {
8447
+ console.log("LOG: q no reload");
8446
8448
  const i = n.variants;
8447
8449
  if (Y.getDefaultVariant(n)) {
8450
+ console.log("LOG: q default");
8448
8451
  const o = i == null ? void 0 : i.find((l) => {
8449
8452
  var c;
8450
8453
  return l.id === ((c = n.defaultVariant) == null ? void 0 : c.id);
@@ -8452,7 +8455,7 @@ class ys {
8452
8455
  return this.selectVariantLambda(t, (o == null ? void 0 : o.id) || "", e);
8453
8456
  }
8454
8457
  }
8455
- return null;
8458
+ return console.log("LOG: q end"), null;
8456
8459
  }
8457
8460
  async reload(t, e, a) {
8458
8461
  var s;
@@ -8666,7 +8669,7 @@ class Ss {
8666
8669
  }
8667
8670
  }
8668
8671
  }
8669
- const zt = new Ss();
8672
+ const Gt = new Ss();
8670
8673
  class vs {
8671
8674
  constructor() {
8672
8675
  this.latestToast = null, this.toastType = null, this.toastCallbacks = [];
@@ -8803,7 +8806,7 @@ class bs {
8803
8806
  if (p && t.globalPropertyAspectConfigurations) {
8804
8807
  const C = (s = p.getGlobalPropertyConfiguration()) == null ? void 0 : s.aspects, w = C == null ? void 0 : C.find((S) => {
8805
8808
  var y;
8806
- return S.type === z.Text && ((y = t.globalPropertyAspectConfigurations) == null ? void 0 : y.map((E) => E.aspectName).includes(S.name));
8809
+ return S.type === G.Text && ((y = t.globalPropertyAspectConfigurations) == null ? void 0 : y.map((E) => E.aspectName).includes(S.name));
8807
8810
  });
8808
8811
  if (w) {
8809
8812
  const y = p.getGlobalPropertyStateManager().getAspect(w.name);
@@ -8841,7 +8844,7 @@ class bs {
8841
8844
  return null;
8842
8845
  }
8843
8846
  findLayoutElements(t, e) {
8844
- return t.getRegionElements(e.stepName).map((i) => L(i.id, t.getAllLayoutData()));
8847
+ return t.getRegionElements(e.stepName).map((i) => U(i.id, t.getAllLayoutData()));
8845
8848
  }
8846
8849
  /**
8847
8850
  * Get the colors that can be used for a given text step.
@@ -8989,7 +8992,7 @@ class bs {
8989
8992
  const l = [], c = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
8990
8993
  for (const A of e) {
8991
8994
  if (!A.fontData)
8992
- throw new G("Failed to resolve font data for text.");
8995
+ throw new z("Failed to resolve font data for text.");
8993
8996
  const [u, h] = pe(
8994
8997
  A.fontSize,
8995
8998
  A.fontData,
@@ -9047,7 +9050,7 @@ class bs {
9047
9050
  if (S && t.globalPropertyAspectConfigurations) {
9048
9051
  const y = (u = S.getGlobalPropertyConfiguration()) == null ? void 0 : u.aspects, E = y == null ? void 0 : y.find((B) => {
9049
9052
  var I;
9050
- return B.type === z.Text && ((I = t.globalPropertyAspectConfigurations) == null ? void 0 : I.map((D) => D.aspectName).includes(B.name));
9053
+ return B.type === G.Text && ((I = t.globalPropertyAspectConfigurations) == null ? void 0 : I.map((D) => D.aspectName).includes(B.name));
9051
9054
  });
9052
9055
  if (E) {
9053
9056
  const I = S.getGlobalPropertyStateManager().getAspect(E.name);
@@ -9095,7 +9098,7 @@ class bs {
9095
9098
  if (m && t.globalPropertyAspectConfigurations) {
9096
9099
  const g = (h = m.getGlobalPropertyConfiguration()) == null ? void 0 : h.aspects, p = g == null ? void 0 : g.find((f) => {
9097
9100
  var C;
9098
- return f.type === z.Text && ((C = t.globalPropertyAspectConfigurations) == null ? void 0 : C.map((w) => w.aspectName).includes(f.name));
9101
+ return f.type === G.Text && ((C = t.globalPropertyAspectConfigurations) == null ? void 0 : C.map((w) => w.aspectName).includes(f.name));
9099
9102
  });
9100
9103
  if (p) {
9101
9104
  const C = m.getGlobalPropertyStateManager().getAspect(p.name);
@@ -9289,7 +9292,7 @@ class bs {
9289
9292
  fillSpotColorDefinition: f
9290
9293
  }, y = [], E = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
9291
9294
  if (!S.fontData)
9292
- throw new G("Failed to resolve font data for text.");
9295
+ throw new z("Failed to resolve font data for text.");
9293
9296
  const [I, D] = pe(
9294
9297
  S.fontSize,
9295
9298
  S.fontData,
@@ -9588,7 +9591,7 @@ class Ns extends Is {
9588
9591
  async function qn(r) {
9589
9592
  if (r === "Vegemite")
9590
9593
  return new Ns();
9591
- throw new G(`Failed to resolve Module, Module ${r} not found`);
9594
+ throw new z(`Failed to resolve Module, Module ${r} not found`);
9592
9595
  }
9593
9596
  const ne = v`
9594
9597
  fragment GlobalPropertyStateAspectFields on GlobalPropertyStateAspect {
@@ -9762,7 +9765,7 @@ const ne = v`
9762
9765
  }
9763
9766
  }
9764
9767
  }
9765
- `, Us = (r) => v`
9768
+ `, Ls = (r) => v`
9766
9769
  ${ne}
9767
9770
  ${re(r)}
9768
9771
  query GetBundle($id: String!) {
@@ -9851,7 +9854,7 @@ const ne = v`
9851
9854
  }
9852
9855
  }
9853
9856
  }
9854
- `, Ls = v`
9857
+ `, Us = v`
9855
9858
  query GetBundlesForCustomer($id: String!) {
9856
9859
  customers(ids: [$id]) {
9857
9860
  bundleStakeholders {
@@ -9890,7 +9893,7 @@ const ne = v`
9890
9893
  }
9891
9894
  }
9892
9895
  }
9893
- `, zs = v`
9896
+ `, Gs = v`
9894
9897
  query GetProductCollectionForFilteredProducts(
9895
9898
  $id: String!
9896
9899
  $filters: ProductCollectionProductFilterInput
@@ -9913,7 +9916,7 @@ const ne = v`
9913
9916
  }
9914
9917
  }
9915
9918
  }
9916
- `, Gs = v`
9919
+ `, zs = v`
9917
9920
  ${ba}
9918
9921
  query GetProductCollectionForProductsFeed(
9919
9922
  $id: String!
@@ -10280,10 +10283,11 @@ class mo {
10280
10283
  var w;
10281
10284
  this.workflowStatePromiseQueue = new xn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.renderLayouts = () => {
10282
10285
  var E;
10283
- if (!this.previewService)
10286
+ if (console.log("LOG: render layouts"), !this.previewService)
10284
10287
  return;
10288
+ console.log("LOG: render layouts: service exists");
10285
10289
  const S = this.getCommandContext().getAllLayouts(), y = (E = this.getLayoutPreviewService()) == null ? void 0 : E.getAll();
10286
- if (y)
10290
+ if (console.log(`LOG: render layouts: ${y == null ? void 0 : y.size} handles`), !!y)
10287
10291
  for (const [, B] of y)
10288
10292
  B.render(S);
10289
10293
  }, 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, (w = this.renderableContextService) == null || w.setWorkflowManager(this), this.isReloadedTransaction = p, this.workflow.steps.forEach((S) => {
@@ -10390,7 +10394,7 @@ class mo {
10390
10394
  };
10391
10395
  this.reloadedState && this.reloadedState.serializableWorkflow.steps.forEach((o) => {
10392
10396
  this.storage[o.stepName] = o.storage || {};
10393
- }), this.allScenes = await Ui(t);
10397
+ }), this.allScenes = await Li(t);
10394
10398
  const n = Dt(this.allScenes, this.stepSelections).map((o) => o.silentSteps).flat(), { stepElements: i, commands: s } = await this.stepElementsForIntroducedSilentSteps(n, !!this.reloadedState);
10395
10399
  this.commandContext.apply(new $(s), !0), this.stepElements = { ...this.stepElements, ...i }, await this.ensureStepsAreLoaded(), !this.isReloadedTransaction && this.updateStateWithServer(), this.renderLayouts(), this.reloadedState && e();
10396
10400
  }
@@ -10609,7 +10613,7 @@ class mo {
10609
10613
  const l = o[0];
10610
10614
  if (s.type === P.Model) {
10611
10615
  if (!this.modelContainer)
10612
- throw new G(
10616
+ throw new z(
10613
10617
  "We should always have a model container when injecting a preview!"
10614
10618
  );
10615
10619
  const u = (A = l.asset) == null ? void 0 : A.fileLink;
@@ -10634,7 +10638,7 @@ class mo {
10634
10638
  }
10635
10639
  s.data.targetMaterials.forEach((m) => {
10636
10640
  if (!this.modelContainer)
10637
- throw new G(
10641
+ throw new z(
10638
10642
  "We should always have a model container when injecting a preview!"
10639
10643
  );
10640
10644
  this.modelContainer.applyMaterialVariant(m, s.option.id, u);
@@ -10657,7 +10661,7 @@ class mo {
10657
10661
  };
10658
10662
  if (!on(a, this.storage)) {
10659
10663
  this.storage = a;
10660
- const n = new Ga(this.constructSerializableWorkflow());
10664
+ const n = new za(this.constructSerializableWorkflow());
10661
10665
  this.commandContext.apply(n, !0), this.onStepSpecificStorageChange(t), this.onStorageChange();
10662
10666
  }
10663
10667
  }
@@ -10708,7 +10712,7 @@ class mo {
10708
10712
  serialize() {
10709
10713
  const t = this.getCommandContext().getState();
10710
10714
  if (!t)
10711
- throw new G("Attempted to serialize state before it was initialized.");
10715
+ throw new z("Attempted to serialize state before it was initialized.");
10712
10716
  const e = St(t.transaction), a = this.dehydrateState(e);
10713
10717
  return JSON.stringify(a);
10714
10718
  }
@@ -10872,7 +10876,7 @@ class mo {
10872
10876
  const E = (y = this.getWorkflowExperience().getStepById(g.stepName)) == null ? void 0 : y.frameService;
10873
10877
  E == null || E.setTargetElements(a.map((B) => B.id));
10874
10878
  }
10875
- const p = u.map((E) => new Bt(E.id)), f = new Ga(this.constructSerializableWorkflow()), C = [...m, ...p, f];
10879
+ const p = u.map((E) => new Bt(E.id)), f = new za(this.constructSerializableWorkflow()), C = [...m, ...p, f];
10876
10880
  C.length > 0 && this.commandContext.apply(new $(C), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
10877
10881
  const w = this.getInvalidModelVariants(), S = this.modelContainer;
10878
10882
  if (S) {
@@ -10913,11 +10917,11 @@ class mo {
10913
10917
  break;
10914
10918
  case P.Material:
10915
10919
  a.push(
10916
- zn.init(l, this, this.reloadedState)
10920
+ Gn.init(l, this, this.reloadedState)
10917
10921
  );
10918
10922
  break;
10919
10923
  case P.Model:
10920
- a.push(Gn.init(l, this, this.reloadedState));
10924
+ a.push(zn.init(l, this, this.reloadedState));
10921
10925
  break;
10922
10926
  case P.Module:
10923
10927
  this.stepSpecificServices[l.stepName] = {
@@ -10937,7 +10941,7 @@ class mo {
10937
10941
  );
10938
10942
  break;
10939
10943
  case P.Shape:
10940
- a.push(zt.init(l, this, this.reloadedState));
10944
+ a.push(Gt.init(l, this, this.reloadedState));
10941
10945
  break;
10942
10946
  case P.Text:
10943
10947
  a.push(j.init(l, this, this.reloadedState));
@@ -11000,7 +11004,7 @@ class mo {
11000
11004
  this.validationCallbacks.forEach((t) => t(this.validationErrors));
11001
11005
  }
11002
11006
  traversableScenes() {
11003
- return zi(this.allScenes, this.stepSelections, this.singleVariantsRenderable);
11007
+ return Gi(this.allScenes, this.stepSelections, this.singleVariantsRenderable);
11004
11008
  }
11005
11009
  }
11006
11010
  class st {
@@ -11247,7 +11251,7 @@ class go extends it {
11247
11251
  const t = this.manager.getRegionElements(this.step.stepName) || [];
11248
11252
  if (t.length === 0)
11249
11253
  return;
11250
- const a = L(t[0].id, this.manager.getAllLayoutData()).colors, n = (o = this.getCurrentVariant()) == null ? void 0 : o.getAssetResource(), i = n == null ? void 0 : n.assetConfiguration, s = (i == null ? void 0 : i.defaultColorVariants) || [];
11254
+ const a = U(t[0].id, this.manager.getAllLayoutData()).colors, n = (o = this.getCurrentVariant()) == null ? void 0 : o.getAssetResource(), i = n == null ? void 0 : n.assetConfiguration, s = (i == null ? void 0 : i.defaultColorVariants) || [];
11251
11255
  if (s.length !== 0) {
11252
11256
  const l = {};
11253
11257
  return s.forEach((c) => {
@@ -11302,7 +11306,7 @@ class po extends it {
11302
11306
  super(t, e, a);
11303
11307
  }
11304
11308
  selectVariant(t) {
11305
- return zn.selectVariant(
11309
+ return Gn.selectVariant(
11306
11310
  this.step,
11307
11311
  t.getResource(),
11308
11312
  this.manager,
@@ -11315,7 +11319,7 @@ class fo extends it {
11315
11319
  super(t, e, a);
11316
11320
  }
11317
11321
  selectVariant(t) {
11318
- return Gn.selectVariant(
11322
+ return zn.selectVariant(
11319
11323
  this.step,
11320
11324
  t.getResource(),
11321
11325
  this.manager,
@@ -11364,7 +11368,7 @@ class yo extends it {
11364
11368
  }
11365
11369
  selectVariant(t) {
11366
11370
  const e = t.getResource();
11367
- return zt.selectVariant(
11371
+ return Gt.selectVariant(
11368
11372
  this.step,
11369
11373
  {
11370
11374
  fill: e.color,
@@ -11382,7 +11386,7 @@ class yo extends it {
11382
11386
  * @deprecated The shape step can now pass through colors returned by getColors via selectVariant. Please swap setColor for selectVariant.
11383
11387
  */
11384
11388
  setColor(t) {
11385
- return zt.selectVariant(
11389
+ return Gt.selectVariant(
11386
11390
  this.step,
11387
11391
  t,
11388
11392
  this.manager.getRegionElements(this.step.stepName) || [],
@@ -11394,7 +11398,7 @@ class yo extends it {
11394
11398
  * @returns A list of color definitions that are currently applied to the illustration.
11395
11399
  */
11396
11400
  getColors() {
11397
- return zt.availableColours(this.step);
11401
+ return Gt.availableColours(this.step);
11398
11402
  }
11399
11403
  /**
11400
11404
  * Allows for setting a custom color when the custom variant is selected. Will
@@ -11402,7 +11406,7 @@ class yo extends it {
11402
11406
  */
11403
11407
  setCustomColor(t) {
11404
11408
  var e, a;
11405
- return ((e = this.getCurrentVariant()) == null ? void 0 : e.getColor()) !== "#custom" && console.warn(`setting custom color for step ${this.step.stepName} but color is ${(a = this.getCurrentVariant()) == null ? void 0 : a.getColor()}`), zt.setCustomColor(t, this.step, this.manager);
11409
+ return ((e = this.getCurrentVariant()) == null ? void 0 : e.getColor()) !== "#custom" && console.warn(`setting custom color for step ${this.step.stepName} but color is ${(a = this.getCurrentVariant()) == null ? void 0 : a.getColor()}`), Gt.setCustomColor(t, this.step, this.manager);
11406
11410
  }
11407
11411
  getCustomColor() {
11408
11412
  var e, a, n;
@@ -11510,7 +11514,9 @@ class So extends it {
11510
11514
  helperData: {}
11511
11515
  }, a = j.findLayoutElements(this.manager, this.step), n = j.filterUnsupportedCharacters(t, (d = a[0]) == null ? void 0 : d.fontData), i = !!this.step.data && !!this.step.data.maxLength && n.length > this.step.data.maxLength;
11512
11516
  i || (e.input = n);
11513
- const s = a.length <= 0, o = s ? { inputText: n, text: n } : { inputText: n };
11517
+ const s = a.length <= 0;
11518
+ console.log(`LOG: setting text ${t} to ${a.length} regions`);
11519
+ const o = s ? { inputText: n, text: n } : { inputText: n };
11514
11520
  this.manager.updateStorage(this.step.stepName, o);
11515
11521
  const l = this.manager.getStepStorage(this.step.stepName), c = j.getProcessedInput(
11516
11522
  n,
@@ -11728,7 +11734,7 @@ class ce {
11728
11734
  case P.Module:
11729
11735
  return new Bo(t, e, t.getStepTags(e.stepName));
11730
11736
  default:
11731
- throw new G(`Step type ${e.type} not yet supported in Core SDK`);
11737
+ throw new z(`Step type ${e.type} not yet supported in Core SDK`);
11732
11738
  }
11733
11739
  }
11734
11740
  }
@@ -12009,7 +12015,7 @@ const Po = async (r, t) => {
12009
12015
  let E = await o(m, n.id);
12010
12016
  if (E) {
12011
12017
  const D = await (await rt(E)).blob();
12012
- E = (await U.uploadAsset(
12018
+ E = (await L.uploadAsset(
12013
12019
  { name: `${n.id}-preview-image.png`, blob: D },
12014
12020
  Ce.Image,
12015
12021
  !0,
@@ -12150,7 +12156,7 @@ class Mo {
12150
12156
  const t = N.get(this.localPersistenceKey);
12151
12157
  return t ? JSON.parse(t) : [];
12152
12158
  }
12153
- throw new G("Unexpected storage method requested");
12159
+ throw new z("Unexpected storage method requested");
12154
12160
  }
12155
12161
  /**
12156
12162
  * Search for a transaction that has been saved.
@@ -12190,7 +12196,7 @@ class Mo {
12190
12196
  N.set(this.localPersistenceKey, JSON.stringify(t));
12191
12197
  return;
12192
12198
  }
12193
- throw new G("Unexpected storage method requested");
12199
+ throw new z("Unexpected storage method requested");
12194
12200
  }
12195
12201
  }
12196
12202
  const Ye = new Mo(), To = v`
@@ -12540,7 +12546,7 @@ class Oo {
12540
12546
  }
12541
12547
  async save(t) {
12542
12548
  if (!this.getCommandContext().getState())
12543
- throw new G("State undefined!");
12549
+ throw new z("State undefined!");
12544
12550
  const n = {
12545
12551
  title: await (async () => {
12546
12552
  var l;
@@ -12563,10 +12569,10 @@ class Oo {
12563
12569
  var s;
12564
12570
  const t = St(this.getCommandContext().getState());
12565
12571
  if (!t)
12566
- throw new G("Internal state is undefined! Cannot copy experience!");
12572
+ throw new z("Internal state is undefined! Cannot copy experience!");
12567
12573
  const e = JSON.stringify(t.transaction), a = this.getWorkflowManager().getWorkflow(), n = (s = this.getWorkflowManager().getTransaction().integrationProduct) == null ? void 0 : s.id;
12568
12574
  if (!n)
12569
- throw new G("Integration product id is undefined!");
12575
+ throw new z("Integration product id is undefined!");
12570
12576
  return await this.getClient().getWorkflowExperience({
12571
12577
  type: "integration",
12572
12578
  integrationProductId: n,
@@ -12677,7 +12683,7 @@ const $o = [
12677
12683
  "textPath",
12678
12684
  "tref",
12679
12685
  "tspan"
12680
- ], Uo = async (r, t, e) => {
12686
+ ], Lo = async (r, t, e) => {
12681
12687
  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);
12682
12688
  o.searchParams.append("video", Qa(JSON.stringify([{ href: i }]))), o.pathname = o.pathname + (o.pathname.slice(-1) === "/" ? "" : "/");
12683
12689
  const l = o.toString(), d = `data:image/svg+xml;base64,${Qa(await sn(l, { type: "svg" }))}`, A = (h) => {
@@ -12704,7 +12710,7 @@ const $o = [
12704
12710
  } catch (h) {
12705
12711
  return console.error(h), [];
12706
12712
  }
12707
- }, Lo = async (r, t, e, a) => {
12713
+ }, Uo = async (r, t, e, a) => {
12708
12714
  const n = e.data, i = n.assetUrl, s = await sa(i);
12709
12715
  try {
12710
12716
  const o = is(n, a.option);
@@ -12831,7 +12837,7 @@ const $o = [
12831
12837
  } catch (B) {
12832
12838
  return console.error(B), [];
12833
12839
  }
12834
- }, zo = async (r, t, e) => {
12840
+ }, Go = async (r, t, e) => {
12835
12841
  const a = await qn(e.data.module), n = t.data, i = (o, l) => {
12836
12842
  const c = r.find((A) => A.panelId === l.panelId);
12837
12843
  if (!c)
@@ -12861,7 +12867,7 @@ const $o = [
12861
12867
  } catch (o) {
12862
12868
  return console.error(o), [];
12863
12869
  }
12864
- }, Go = async (r, t, e, a) => {
12870
+ }, zo = async (r, t, e, a) => {
12865
12871
  var d, A;
12866
12872
  const n = e.data, i = a.option;
12867
12873
  if (!i)
@@ -13133,13 +13139,13 @@ const $o = [
13133
13139
  switch (o.type) {
13134
13140
  case P.DigitalContent:
13135
13141
  n.push(
13136
- ...await Uo(e, s, o)
13142
+ ...await Lo(e, s, o)
13137
13143
  );
13138
13144
  break;
13139
13145
  case P.Frame:
13140
13146
  case P.Photo:
13141
13147
  n.push(
13142
- ...await Lo(e, i, s, o)
13148
+ ...await Uo(e, i, s, o)
13143
13149
  );
13144
13150
  break;
13145
13151
  case P.Illustration:
@@ -13153,11 +13159,11 @@ const $o = [
13153
13159
  );
13154
13160
  break;
13155
13161
  case P.Module:
13156
- n.push(...await zo(e, s, o));
13162
+ n.push(...await Go(e, s, o));
13157
13163
  break;
13158
13164
  case P.Picture:
13159
13165
  n.push(
13160
- ...await Go(e, i, s, o)
13166
+ ...await zo(e, i, s, o)
13161
13167
  );
13162
13168
  break;
13163
13169
  case P.Shape:
@@ -13375,7 +13381,7 @@ const Xc = (r, t) => {
13375
13381
  serializableWorkflow: { steps: [] },
13376
13382
  layouts: {}
13377
13383
  };
13378
- n = new $(e.map((l) => new Un(l))).apply(n);
13384
+ n = new $(e.map((l) => new Ln(l))).apply(n);
13379
13385
  const s = await Yo(r, t, e, a);
13380
13386
  return new $(s).apply(n);
13381
13387
  };
@@ -13423,19 +13429,19 @@ class tl {
13423
13429
  }
13424
13430
  async createHandle(t) {
13425
13431
  switch (t.type) {
13426
- case z.FileUpload:
13432
+ case G.FileUpload:
13427
13433
  return new el(this.bundle, t).initialize();
13428
- case z.ColorOption:
13434
+ case G.ColorOption:
13429
13435
  return new Ja(
13430
13436
  this.bundle,
13431
13437
  t,
13432
13438
  t.entityId ? await Y.getOption(t.entityId) : void 0
13433
13439
  );
13434
- case z.Option: {
13440
+ case G.Option: {
13435
13441
  const e = t.entityId ? await Y.getOption(t.entityId) : void 0;
13436
13442
  return (e == null ? void 0 : e.type) === "Color" ? new Ja(this.bundle, t, e) : new Xn(this.bundle, t, e);
13437
13443
  }
13438
- case z.Text:
13444
+ case G.Text:
13439
13445
  return new al(this.bundle, t);
13440
13446
  default:
13441
13447
  throw new Error("Unhandled Global Property Aspect Type");
@@ -13480,18 +13486,20 @@ class Ia {
13480
13486
  * Returns all steps that share this property.
13481
13487
  * @param targetExperiences Optionally filter the steps to only those in the given experiences.
13482
13488
  */
13483
- getSharedSteps(t) {
13484
- return (t ?? this.bundle.getWorkflowExperiences()).flatMap(
13485
- (n) => n.getStepsConditionallyActive().filter((i) => {
13486
- var s;
13487
- return i.getOverrideGlobalPropertyConfiguration(this.property.type) ? !1 : (s = i.getRaw().globalPropertyAspectConfigurations) == null ? void 0 : s.some(
13488
- (o) => {
13489
- var l, c;
13490
- return o.globalPropertyConfigurationId === ((c = (l = this.bundle.getProductCollection()) == null ? void 0 : l.getResource().globalPropertyConfiguration) == null ? void 0 : c.id) && o.aspectName === this.property.name;
13489
+ getSharedSteps(t, e) {
13490
+ const a = t ?? this.bundle.getWorkflowExperiences();
13491
+ return console.log(`LOG: getting shared steps from ${a.length} experiences`), a.flatMap((i) => {
13492
+ const s = e ? i.getSteps() : i.getStepsConditionallyActive();
13493
+ return console.log(`LOG: getting shared steps from ${s.length} active steps`), s.filter((o) => {
13494
+ var l;
13495
+ return o.getOverrideGlobalPropertyConfiguration(this.property.type) ? (console.log("LOG: getting shared steps? no"), !1) : (console.log("LOG: getting shared steps? maybe!"), (l = o.getRaw().globalPropertyAspectConfigurations) == null ? void 0 : l.some(
13496
+ (c) => {
13497
+ var d, A;
13498
+ return c.globalPropertyConfigurationId === ((A = (d = this.bundle.getProductCollection()) == null ? void 0 : d.getResource().globalPropertyConfiguration) == null ? void 0 : A.id) && c.aspectName === this.property.name;
13491
13499
  }
13492
- );
13493
- })
13494
- );
13500
+ ));
13501
+ });
13502
+ });
13495
13503
  }
13496
13504
  getStateValue() {
13497
13505
  return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
@@ -13563,7 +13571,7 @@ class el extends Ia {
13563
13571
  const e = await this.getOriginalImage();
13564
13572
  if (!e)
13565
13573
  throw new Error("You must supply an image selection before attempting to remove the background.");
13566
- const a = this.bundle.getGlobalPropertyStateManager(), n = await U.removeBackgroundFromAsset(e), s = {
13574
+ const a = this.bundle.getGlobalPropertyStateManager(), n = await L.removeBackgroundFromAsset(e), s = {
13567
13575
  ...a.getAspectStorage(this.property.name),
13568
13576
  backgroundRemovedAssetKey: n.key,
13569
13577
  useOriginalAsset: !t
@@ -13583,7 +13591,7 @@ class el extends Ia {
13583
13591
  async getImage() {
13584
13592
  const t = this.getStateValue();
13585
13593
  if (t)
13586
- return U.getLocalOrFromServer(t);
13594
+ return L.getLocalOrFromServer(t);
13587
13595
  }
13588
13596
  async getImageWithColors() {
13589
13597
  var t, e;
@@ -13596,7 +13604,7 @@ class el extends Ia {
13596
13604
  async getOriginalImage() {
13597
13605
  const t = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13598
13606
  if (t != null && t.originalAssetKey)
13599
- return U.getLocalOrFromServer(t.originalAssetKey);
13607
+ return L.getLocalOrFromServer(t.originalAssetKey);
13600
13608
  }
13601
13609
  /**
13602
13610
  * Retrieves the version of the image selection that has the background removed, if one exists.
@@ -13605,7 +13613,7 @@ class el extends Ia {
13605
13613
  async getBackgroundRemovedImage() {
13606
13614
  const t = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13607
13615
  if (t != null && t.backgroundRemovedAssetKey)
13608
- return U.getLocalOrFromServer(t.backgroundRemovedAssetKey);
13616
+ return L.getLocalOrFromServer(t.backgroundRemovedAssetKey);
13609
13617
  }
13610
13618
  getUseOriginalImage() {
13611
13619
  var t;
@@ -13637,26 +13645,26 @@ class el extends Ia {
13637
13645
  }
13638
13646
  o.push(this.loadImageData()), await Promise.all(o), this.updateSharedStepStorage(i);
13639
13647
  }
13640
- async applyGlobalState(t) {
13641
- const e = this.getStateValue();
13642
- if (!e)
13643
- return;
13644
- const a = await U.getLocalOrFromServer(e);
13648
+ async applyGlobalState(t, e) {
13649
+ const a = this.getStateValue();
13645
13650
  if (!a)
13646
13651
  return;
13647
- await this.applyImageSelection(a, t, !1, !0);
13648
- const n = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13649
- if (n) {
13650
- if (this.updateSharedStepStorage({ ...n }), n.colors) {
13651
- const i = new Map(
13652
- n.colors.map((s) => [s.key, { browserValue: s.browserValue, pmsValue: s.pmsValue }]) ?? []
13652
+ const n = await L.getLocalOrFromServer(a);
13653
+ if (!n)
13654
+ return;
13655
+ await this.applyImageSelection(n, t, !1, !0);
13656
+ const i = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13657
+ if (i) {
13658
+ if (this.updateSharedStepStorage({ ...i }), i.colors) {
13659
+ const s = new Map(
13660
+ i.colors.map((o) => [o.key, { browserValue: o.browserValue, pmsValue: o.pmsValue }]) ?? []
13653
13661
  );
13654
- this.getSharedSteps(t).forEach((s) => {
13655
- s.changeColors(i);
13662
+ this.getSharedSteps(t, e).forEach((o) => {
13663
+ o.changeColors(s);
13656
13664
  });
13657
13665
  }
13658
13666
  } else
13659
- this.updateSharedStepStorage({ originalAssetKey: e }), await this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { originalAssetKey: e });
13667
+ this.updateSharedStepStorage({ originalAssetKey: a }), await this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { originalAssetKey: a });
13660
13668
  }
13661
13669
  getAvailableColors() {
13662
13670
  var t, e, a, n;
@@ -13683,22 +13691,22 @@ class el extends Ia {
13683
13691
  var e;
13684
13692
  return (e = this.imageData) != null && e.svg ? (await lt(this.imageData.svg)).colors : void 0;
13685
13693
  }
13686
- async changeColors(t) {
13687
- var i;
13688
- if (!((i = this.imageData) != null && i.svg))
13694
+ async changeColors(t, e) {
13695
+ var s;
13696
+ if (!((s = this.imageData) != null && s.svg))
13689
13697
  return;
13690
- const e = this.getSharedSteps(), a = new Map(Object.entries(t));
13691
- e.forEach((s) => {
13692
- s.changeColors(a);
13698
+ const a = this.getSharedSteps(void 0, e), n = new Map(Object.entries(t));
13699
+ a.forEach((o) => {
13700
+ o.changeColors(n);
13693
13701
  });
13694
- const n = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13702
+ const i = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13695
13703
  await Promise.all([
13696
13704
  this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, {
13697
- ...n,
13698
- colors: Object.entries(t).map(([s, o]) => ({
13699
- key: s,
13700
- browserValue: o.browserValue,
13701
- pmsValue: o.pmsValue
13705
+ ...i,
13706
+ colors: Object.entries(t).map(([o, l]) => ({
13707
+ key: o,
13708
+ browserValue: l.browserValue,
13709
+ pmsValue: l.pmsValue
13702
13710
  }))
13703
13711
  }),
13704
13712
  await this.loadImageData()
@@ -13748,10 +13756,10 @@ class al extends Ia {
13748
13756
  /**
13749
13757
  * Set the text.
13750
13758
  */
13751
- async setText(t) {
13759
+ async setText(t, e) {
13752
13760
  await Promise.all([
13753
13761
  this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t),
13754
- this.applyTextSelection(t)
13762
+ this.applyTextSelection(t, void 0, e)
13755
13763
  ]);
13756
13764
  }
13757
13765
  async applyGlobalState(t) {
@@ -13760,11 +13768,13 @@ class al extends Ia {
13760
13768
  return Promise.resolve();
13761
13769
  await this.applyTextSelection(e, t);
13762
13770
  }
13763
- async applyTextSelection(t, e) {
13764
- const n = this.getSharedSteps(e).map((i) => {
13765
- i.setText(t);
13771
+ async applyTextSelection(t, e, a) {
13772
+ const n = this.getSharedSteps(e, a);
13773
+ console.log(`LOG: ${n.length} shared steps`);
13774
+ const i = n.map((s) => {
13775
+ s.setText(t);
13766
13776
  });
13767
- await Promise.all(n);
13777
+ await Promise.all(i);
13768
13778
  }
13769
13779
  }
13770
13780
  class Xn extends Ia {
@@ -13823,10 +13833,10 @@ class Xn extends Ia {
13823
13833
  * Select a given variant on the option for all shared steps.
13824
13834
  * @param variant The variant to select.
13825
13835
  */
13826
- async selectVariant(t, e) {
13836
+ async selectVariant(t, e, a) {
13827
13837
  await Promise.all([
13828
13838
  this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t.getId(), void 0, e),
13829
- this.applyVariantSelection(t)
13839
+ this.applyVariantSelection(t, void 0, a)
13830
13840
  ]);
13831
13841
  }
13832
13842
  async applyGlobalState(t) {
@@ -13837,9 +13847,9 @@ class Xn extends Ia {
13837
13847
  const a = (i = (n = this.optionResource) == null ? void 0 : n.variants) == null ? void 0 : i.find((s) => s.id === e);
13838
13848
  return a ? this.applyVariantSelection(new st(a), t) : Promise.resolve();
13839
13849
  }
13840
- async applyVariantSelection(t, e) {
13841
- const n = this.getSharedSteps(e).map((i) => i.selectVariant(t));
13842
- await Promise.all(n);
13850
+ async applyVariantSelection(t, e, a) {
13851
+ const i = this.getSharedSteps(e, a).map((s) => s.selectVariant(t));
13852
+ await Promise.all(i);
13843
13853
  }
13844
13854
  }
13845
13855
  class Ja extends Xn {
@@ -13888,8 +13898,8 @@ class Ja extends Xn {
13888
13898
  /**
13889
13899
  * Sets a custom color on the global state.
13890
13900
  */
13891
- setCustomColor(t) {
13892
- this.getSharedSteps().forEach((a) => a.setCustomColor(t)), this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { customColor: t });
13901
+ setCustomColor(t, e) {
13902
+ this.getSharedSteps(void 0, e).forEach((n) => n.setCustomColor(t)), this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { customColor: t });
13893
13903
  }
13894
13904
  /**
13895
13905
  * Gets the custom color used by the global state.
@@ -14035,15 +14045,15 @@ class il {
14035
14045
  let i = n.type && n.storage ? {} : void 0;
14036
14046
  if (i)
14037
14047
  switch (n.type) {
14038
- case z.FileUpload: {
14048
+ case G.FileUpload: {
14039
14049
  i.fileUpload = n.storage;
14040
14050
  break;
14041
14051
  }
14042
- case z.Option: {
14052
+ case G.Option: {
14043
14053
  i.option = n.storage;
14044
14054
  break;
14045
14055
  }
14046
- case z.ColorOption: {
14056
+ case G.ColorOption: {
14047
14057
  i = n.storage;
14048
14058
  break;
14049
14059
  }
@@ -14315,7 +14325,7 @@ class Zn {
14315
14325
  async filterProducts(t, e, a, n) {
14316
14326
  var l, c;
14317
14327
  const i = await b.getShadowGraphqlClient().query({
14318
- query: zs,
14328
+ query: Gs,
14319
14329
  errorPolicy: "all",
14320
14330
  variables: {
14321
14331
  id: this.getId(),
@@ -14355,7 +14365,7 @@ class Zn {
14355
14365
  };
14356
14366
  }
14357
14367
  const o = new AbortController(), { signal: l } = o, c = b.getShadowGraphqlClient().watchQuery({
14358
- query: Gs,
14368
+ query: zs,
14359
14369
  variables: {
14360
14370
  id: this.getId(),
14361
14371
  limit: e,
@@ -14721,7 +14731,7 @@ class Je {
14721
14731
  }
14722
14732
  console.log("Setting default global variants."), this.globalPropertyHandleService.getHandles().then((m) => {
14723
14733
  const g = m.map((p) => {
14724
- if (p.getType() === z.ColorOption || p.getType() === z.Option) {
14734
+ if (p.getType() === G.ColorOption || p.getType() === G.Option) {
14725
14735
  const f = p;
14726
14736
  if (this.globalPropertyStateManager.getGlobalPropertyState())
14727
14737
  return f.initDefaultVariant();
@@ -14851,11 +14861,12 @@ class Je {
14851
14861
  async applyGlobalPropertyState(t) {
14852
14862
  var a;
14853
14863
  const e = await this.globalPropertyHandleService.getHandles();
14864
+ console.log(`LOG: ${e.length} handles`);
14854
14865
  for (const n of t.aspects) {
14855
14866
  const i = n == null ? void 0 : n.name, s = e.find((o) => o.getName() === i);
14856
- if (s)
14867
+ if (console.log(`LOG: handle for ${i}? ${s}`), s)
14857
14868
  switch (n.type) {
14858
- case z.FileUpload: {
14869
+ case G.FileUpload: {
14859
14870
  const o = s, l = await ve([n.value]);
14860
14871
  l.length > 0 && await o.selectImage(l[0]);
14861
14872
  const c = (a = n.storage) == null ? void 0 : a.colors;
@@ -14863,26 +14874,26 @@ class Je {
14863
14874
  const d = Object.fromEntries(
14864
14875
  c.map((A) => [A.key, { browserValue: A.browserValue, pmsValue: A.pmsValue }]) ?? []
14865
14876
  );
14866
- await o.changeColors(d);
14877
+ await o.changeColors(d, !0);
14867
14878
  }
14868
14879
  break;
14869
14880
  }
14870
- case z.ColorOption: {
14881
+ case G.ColorOption: {
14871
14882
  const o = s;
14872
- if (n.type === z.ColorOption) {
14883
+ if (n.type === G.ColorOption) {
14873
14884
  const c = o.getAllVariants().find((d) => d.getId() === n.value);
14874
14885
  c && await o.selectVariant(c);
14875
14886
  } else
14876
- o.setCustomColor(n.value);
14887
+ o.setCustomColor(n.value, !0);
14877
14888
  break;
14878
14889
  }
14879
- case z.Option: {
14890
+ case G.Option: {
14880
14891
  const o = s, c = o.getAllVariants().find((d) => d.getId() === n.value);
14881
- c && await o.selectVariant(c);
14892
+ console.log(`LOG: variant for ${n.value}: ${c}`), c && await o.selectVariant(c, void 0, !0);
14882
14893
  break;
14883
14894
  }
14884
- case z.Text: {
14885
- await s.setText(n.value);
14895
+ case G.Text: {
14896
+ console.log(`LOG: text ${n.value}`), await s.setText(n.value, !0);
14886
14897
  break;
14887
14898
  }
14888
14899
  }
@@ -14892,7 +14903,7 @@ class Je {
14892
14903
  return this.globalPropertyStateManager;
14893
14904
  }
14894
14905
  async getGlobalPropertyTotalSubunits() {
14895
- return (await this.globalPropertyHandleService.getHandles()).filter((a) => a.getType() === z.Option).map((a) => {
14906
+ return (await this.globalPropertyHandleService.getHandles()).filter((a) => a.getType() === G.Option).map((a) => {
14896
14907
  var n;
14897
14908
  return ((n = a.getCurrentVariant()) == null ? void 0 : n.getPrice()) || 0;
14898
14909
  }).reduce((a, n) => a + n, 0);
@@ -14911,7 +14922,7 @@ class Je {
14911
14922
  const c = (e = this.getGlobalPropertyConfiguration()) == null ? void 0 : e.aspects.find(
14912
14923
  (d) => d.name === l
14913
14924
  );
14914
- if (c && c.type === z.ColorOption) {
14925
+ if (c && c.type === G.ColorOption) {
14915
14926
  const d = (a = s.getCurrentVariant()) == null ? void 0 : a.getAssetResource(), A = ((n = d == null ? void 0 : d.assetConfiguration) == null ? void 0 : n.channelNumbers) || [], u = ((i = d == null ? void 0 : d.assetConfiguration) == null ? void 0 : i.defaultColorVariants) || [], h = rl(
14916
14927
  this.getWorkflowExperiences(),
14917
14928
  this.globalConfigurationPropertyId || "",
@@ -15834,7 +15845,7 @@ class Il {
15834
15845
  ));
15835
15846
  }
15836
15847
  }
15837
- const Lt = new Il(), Pl = async (r, t) => {
15848
+ const Ut = new Il(), Pl = async (r, t) => {
15838
15849
  var n;
15839
15850
  const e = await b.getShadowGraphqlClient().query({
15840
15851
  query: ki(((n = t == null ? void 0 : t.assets) == null ? void 0 : n.metadata) || !1),
@@ -15853,8 +15864,8 @@ const Lt = new Il(), Pl = async (r, t) => {
15853
15864
  return a.forEach((i) => {
15854
15865
  i.steps.forEach((s) => {
15855
15866
  var o, l, c;
15856
- delete s.data.__typename, (o = s.option) != null && o.id && ((l = s.option.defaultVariant) != null && l.asset && U.cacheAsset(s.option.defaultVariant.asset), s.option.colorProfile && U.cacheAsset(s.option.colorProfile), (c = s.option.variants) == null || c.forEach((d) => {
15857
- d.asset && U.cacheAsset(d.asset), d.thumbnail && U.cacheAsset(d.thumbnail), d.material && U.cacheMaterial(d.material);
15867
+ delete s.data.__typename, (o = s.option) != null && o.id && ((l = s.option.defaultVariant) != null && l.asset && L.cacheAsset(s.option.defaultVariant.asset), s.option.colorProfile && L.cacheAsset(s.option.colorProfile), (c = s.option.variants) == null || c.forEach((d) => {
15868
+ d.asset && L.cacheAsset(d.asset), d.thumbnail && L.cacheAsset(d.thumbnail), d.material && L.cacheMaterial(d.material);
15858
15869
  }), Jt.set({ id: s.option.id }, Promise.resolve(s.option)));
15859
15870
  }), i.finalizeStepConfig || (i.finalizeStepConfig = {}), i.finalizeStepConfig.termsMarkdown = i.finalizeStepConfig.termsMarkdown || i.partner.termsMarkdown;
15860
15871
  }), a;
@@ -15900,17 +15911,17 @@ class rd {
15900
15911
  } catch (a) {
15901
15912
  throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
15902
15913
  }
15903
- }, this.options = t, this.options.applicationKey && Rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 27.2.1-beta.0b62fc5b-7391-5211-9c59-10f72e60bfae"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15914
+ }, this.options = t, this.options.applicationKey && Rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 27.2.1-beta.4ce42ac6-14b8-5f25-8253-732fa129c9fa"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15904
15915
  }
15905
15916
  configure(t) {
15906
- mt.setHubUrl(t.hubUrl), mt.setServerUrl(t.serverUrl), mt.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 && $r(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
15917
+ mt.setHubUrl(t.hubUrl), mt.setServerUrl(t.serverUrl), mt.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 && $r(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Ut.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
15907
15918
  }
15908
15919
  /**
15909
15920
  * @returns The asset manager allows for common operations related to assets
15910
15921
  * and the Spiff Commerce platform.
15911
15922
  */
15912
15923
  getAssetManager() {
15913
- return U;
15924
+ return L;
15914
15925
  }
15915
15926
  getCurrencyCode() {
15916
15927
  if (this.currencyCode === void 0)
@@ -16110,7 +16121,7 @@ class rd {
16110
16121
  return !1;
16111
16122
  const n = JSON.parse(e), i = (/* @__PURE__ */ new Date()).getTime() / 1e3;
16112
16123
  if (!n.ExpiresIn || n.ExpiresIn < i - parseInt(t)) {
16113
- const l = await Lt.refreshTokens();
16124
+ const l = await Ut.refreshTokens();
16114
16125
  if (l != null && l.AuthenticationResult)
16115
16126
  localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), n.AccessToken = l.AuthenticationResult.AccessToken, localStorage.setItem("cognito-tokens", JSON.stringify(n));
16116
16127
  else
@@ -16135,14 +16146,14 @@ class rd {
16135
16146
  variables: {
16136
16147
  emailAddress: t
16137
16148
  }
16138
- }), await Lt.generateCode(t);
16149
+ }), await Ut.generateCode(t);
16139
16150
  }
16140
16151
  /**
16141
16152
  * Verify an email code to log in as a Spiff user.
16142
16153
  * Always returns true if it doesn't throw.
16143
16154
  */
16144
16155
  async verifyCode(t, e) {
16145
- const a = (await this.getIntegration()).partner.id || "", n = await Lt.verifyCode(t, e, a);
16156
+ const a = (await this.getIntegration()).partner.id || "", n = await Ut.verifyCode(t, e, a);
16146
16157
  if (n != null && n.AuthenticationResult) {
16147
16158
  localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), localStorage.setItem("cognito-tokens", JSON.stringify(n.AuthenticationResult)), localStorage.setItem("cognito-email", t);
16148
16159
  const s = (await b.getShadowGraphqlClient().query({
@@ -16172,7 +16183,7 @@ class rd {
16172
16183
  throw new Error("No token data in storage.");
16173
16184
  const a = JSON.parse(e), n = (/* @__PURE__ */ new Date()).getTime() / 1e3, i = !(a != null && a.AccessToken) || Wt(a.AccessToken);
16174
16185
  if (!a.ExpiresIn || a.ExpiresIn < n - parseInt(t) || i) {
16175
- const s = await Lt.refreshTokens();
16186
+ const s = await Ut.refreshTokens();
16176
16187
  if (s != null && s.AuthenticationResult)
16177
16188
  localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), a.AccessToken = s.AuthenticationResult.AccessToken, localStorage.setItem("cognito-tokens", JSON.stringify(a));
16178
16189
  else
@@ -16243,7 +16254,7 @@ class rd {
16243
16254
  ...o,
16244
16255
  ...(m = n == null ? void 0 : n.graphql) == null ? void 0 : m.additionalHeaders
16245
16256
  }, c = await b.getShadowGraphqlClient().query({
16246
- query: Us(((p = (g = n == null ? void 0 : n.graphql) == null ? void 0 : g.productCollection) == null ? void 0 : p.eagerFetchProducts) || !1),
16257
+ query: Ls(((p = (g = n == null ? void 0 : n.graphql) == null ? void 0 : g.productCollection) == null ? void 0 : p.eagerFetchProducts) || !1),
16247
16258
  variables: {
16248
16259
  id: t
16249
16260
  },
@@ -16342,7 +16353,7 @@ class rd {
16342
16353
  if (!this.customer)
16343
16354
  throw new Error("Customer not authenticated.");
16344
16355
  const t = await b.getShadowGraphqlClient().query({
16345
- query: Ls,
16356
+ query: Us,
16346
16357
  variables: {
16347
16358
  id: this.customer.id
16348
16359
  },
@@ -16452,7 +16463,7 @@ class rd {
16452
16463
  layouts: [],
16453
16464
  singleVariantsRenderable: (tt = k == null ? void 0 : k.workflowConfiguration) == null ? void 0 : tt.singleVariantsRenderable,
16454
16465
  stateMutationFunc: I ? async () => {
16455
- throw new G("State mutation is forbidden in read only mode!");
16466
+ throw new z("State mutation is forbidden in read only mode!");
16456
16467
  } : async (H) => this.updateTransactionState({
16457
16468
  ...H,
16458
16469
  context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId }
@@ -16464,10 +16475,10 @@ class rd {
16464
16475
  };
16465
16476
  if (k.type === "transaction" && E.workflowState) {
16466
16477
  const H = JSON.parse(E.workflowState);
16467
- R.layouts = Object.values(H.layouts || {}).map((ft) => ft.layout), await za(H), R.reloadedState = H;
16478
+ R.layouts = Object.values(H.layouts || {}).map((ft) => ft.layout), await Ga(H), R.reloadedState = H;
16468
16479
  } else if (!I && k.workflowState) {
16469
16480
  const H = JSON.parse(k.workflowState);
16470
- R.layouts = Object.values(H.layouts || {}).map((ft) => ft.layout), await za(H), R.reloadedState = H;
16481
+ R.layouts = Object.values(H.layouts || {}).map((ft) => ft.layout), await Ga(H), R.reloadedState = H;
16471
16482
  } else
16472
16483
  R.layouts = Fl(
16473
16484
  R.transaction,
@@ -16754,7 +16765,7 @@ class Tl {
16754
16765
  if (!n || !this.frameData)
16755
16766
  return;
16756
16767
  if (this.frameData.length !== t.length)
16757
- throw new G(
16768
+ throw new z(
16758
16769
  "Frame data and offsets are not the same length. This is a bug. Please report it."
16759
16770
  );
16760
16771
  if (!this.offsets.some((s, o) => !(t[o].x === s.x && t[o].y === s.y && t[o].zoom === s.zoom)) && !a) {
@@ -16798,9 +16809,9 @@ class Tl {
16798
16809
  */
16799
16810
  updateFrameOffsets(t, e, a, n, i) {
16800
16811
  if (!a || a.length === 0 || a.some((o) => !o))
16801
- throw new G("Frame data not set. This is a bug");
16812
+ throw new z("Frame data not set. This is a bug");
16802
16813
  if (!this.workflowManager)
16803
- throw new G("No workflow manager set, cannot update offsets.");
16814
+ throw new z("No workflow manager set, cannot update offsets.");
16804
16815
  const s = this.workflowManager.getCommandDispatcher();
16805
16816
  this.targetElements.forEach((o, l) => {
16806
16817
  s(
@@ -17072,7 +17083,7 @@ class Ql extends it {
17072
17083
  const e = await this.getOriginalImageSelection();
17073
17084
  if (!e)
17074
17085
  throw new Error("You must supply an image selection before attempting to remove the background.");
17075
- const a = await U.removeBackgroundFromAsset(e);
17086
+ const a = await L.removeBackgroundFromAsset(e);
17076
17087
  t && await wt.selectImage(this.step, a, this.manager, !1);
17077
17088
  const n = ((i = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : i.framePatternData) || {};
17078
17089
  return this.manager.updateStorage(this.step.stepName, {
@@ -17131,13 +17142,13 @@ class Ql extends it {
17131
17142
  var e, a;
17132
17143
  const t = (a = (e = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : e.framePatternData) == null ? void 0 : a.originalAssetKey;
17133
17144
  if (t)
17134
- return U.getLocalOrFromServer(t);
17145
+ return L.getLocalOrFromServer(t);
17135
17146
  }
17136
17147
  async getBackgroundRemovedImageSelection() {
17137
17148
  var e, a;
17138
17149
  const t = (a = (e = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : e.framePatternData) == null ? void 0 : a.backgroundRemovedAssetKey;
17139
17150
  if (t)
17140
- return U.getLocalOrFromServer(t);
17151
+ return L.getLocalOrFromServer(t);
17141
17152
  }
17142
17153
  hasOriginalImageSelection() {
17143
17154
  var t, e;
@@ -17234,7 +17245,7 @@ const Rl = v`
17234
17245
  workflowViewerLink
17235
17246
  }
17236
17247
  }
17237
- `, Ul = v`
17248
+ `, Ll = v`
17238
17249
  query GetCustomerBundles($id: String!, $limit: Int!, $offset: Int!) {
17239
17250
  customerBundlesFeed(id: $id, limit: $limit, offset: $offset) {
17240
17251
  items {
@@ -17249,7 +17260,7 @@ const Rl = v`
17249
17260
  total
17250
17261
  }
17251
17262
  }
17252
- `, Ll = v`
17263
+ `, Ul = v`
17253
17264
  query GetTransactionsForBundle($id: String!) {
17254
17265
  bundles(ids: [$id]) {
17255
17266
  id
@@ -17277,14 +17288,14 @@ const Rl = v`
17277
17288
  name
17278
17289
  }
17279
17290
  }
17280
- `, zl = v`
17291
+ `, Gl = v`
17281
17292
  mutation DuplicateBundle($id: String!, $template: Boolean!) {
17282
17293
  bundleDuplicate(id: $id, template: $template) {
17283
17294
  id
17284
17295
  workflowViewerLink
17285
17296
  }
17286
17297
  }
17287
- `, Gl = v`
17298
+ `, zl = v`
17288
17299
  query GetBundleTemplates($id: String!, $limit: Int!, $offset: Int!) {
17289
17300
  customerBundlesFeed(id: $id, limit: $limit, offset: $offset, template: true) {
17290
17301
  items {
@@ -17313,7 +17324,7 @@ const Rl = v`
17313
17324
  name: t
17314
17325
  }
17315
17326
  }), ud = async (r, t) => await b.getShadowGraphqlClient().mutate({
17316
- mutation: zl,
17327
+ mutation: Gl,
17317
17328
  errorPolicy: "all",
17318
17329
  variables: {
17319
17330
  id: r,
@@ -17333,7 +17344,7 @@ const Rl = v`
17333
17344
  email: r
17334
17345
  }
17335
17346
  })).data.customer, gd = async (r, t, e) => await b.getShadowGraphqlClient().query({
17336
- query: Ul,
17347
+ query: Ll,
17337
17348
  errorPolicy: "all",
17338
17349
  fetchPolicy: "no-cache",
17339
17350
  variables: {
@@ -17342,7 +17353,7 @@ const Rl = v`
17342
17353
  limit: t
17343
17354
  }
17344
17355
  }), pd = async (r, t) => await b.getShadowGraphqlClient().query({
17345
- query: Ll,
17356
+ query: Ul,
17346
17357
  errorPolicy: "all",
17347
17358
  fetchPolicy: "no-cache",
17348
17359
  variables: {
@@ -17420,7 +17431,7 @@ const Rl = v`
17420
17431
  }, yd = async (r, t, e) => {
17421
17432
  var n;
17422
17433
  const a = await b.getShadowGraphqlClient().query({
17423
- query: Gl,
17434
+ query: zl,
17424
17435
  errorPolicy: "all",
17425
17436
  fetchPolicy: "no-cache",
17426
17437
  variables: {
@@ -17644,7 +17655,7 @@ export {
17644
17655
  Zl as AddressValidationJobStatus,
17645
17656
  Xl as AddressValidationResultConfirmationLevel,
17646
17657
  ad as ArrayInput,
17647
- z as AspectType,
17658
+ G as AspectType,
17648
17659
  vt as AssetNotFoundError,
17649
17660
  Ce as AssetType,
17650
17661
  Jc as BringForwardCommand,
@@ -17658,7 +17669,7 @@ export {
17658
17669
  jl as ConversionDataType,
17659
17670
  Wl as ConversionLocation,
17660
17671
  W as CreateElementCommand,
17661
- Un as CreateLayoutCommand,
17672
+ Ln as CreateLayoutCommand,
17662
17673
  Bt as DeleteElementCommand,
17663
17674
  Eo as DigitalContentStepHandle,
17664
17675
  el as FileUploadGlobalPropertyHandle,
@@ -17679,7 +17690,7 @@ export {
17679
17690
  vo as InformationStepHandle,
17680
17691
  Ka as IntegrationProduct,
17681
17692
  vr as IntegrationType,
17682
- zc as LayoutElementFactory,
17693
+ Gc as LayoutElementFactory,
17683
17694
  M as LayoutElementType,
17684
17695
  J as LayoutNotFoundError,
17685
17696
  Ht as LayoutRenderingPurpose,
@@ -17688,7 +17699,7 @@ export {
17688
17699
  cd as MockWorkflowManager,
17689
17700
  fo as ModelStepHandle,
17690
17701
  Bo as ModuleStepHandle,
17691
- Gc as MoveCommand,
17702
+ zc as MoveCommand,
17692
17703
  tr as ObjectInput,
17693
17704
  Sl as ObjectInputType,
17694
17705
  Xn as OptionGlobalPropertyHandle,
@@ -17722,15 +17733,15 @@ export {
17722
17733
  So as TextStepHandle,
17723
17734
  ul as Transform,
17724
17735
  Al as TransformCollection,
17725
- G as UnhandledBehaviorError,
17736
+ z as UnhandledBehaviorError,
17726
17737
  Br as UnitOfMeasurement,
17727
17738
  Hc as UpdateImageSourceCommand,
17728
17739
  st as Variant,
17729
17740
  Ro as WorkflowExperienceEventType,
17730
17741
  Oo as WorkflowExperienceImpl,
17731
- U as assetService,
17742
+ L as assetService,
17732
17743
  Kr as browserColorToHex,
17733
- Lc as cmPerPixel,
17744
+ Uc as cmPerPixel,
17734
17745
  Fo as createDesign,
17735
17746
  Oc as currentDirection,
17736
17747
  bc as dataUrlFromExternalUrl,
@@ -17742,7 +17753,7 @@ export {
17742
17753
  hd as duplicateTransaction,
17743
17754
  at as fetchAsString,
17744
17755
  Fc as findAngle,
17745
- L as findElement,
17756
+ U as findElement,
17746
17757
  Dc as findPmsColors,
17747
17758
  Vt as frameDataCache,
17748
17759
  wt as frameStepService,
@@ -17784,10 +17795,10 @@ export {
17784
17795
  kc as isCloseToValue,
17785
17796
  Nt as loadFont,
17786
17797
  Pc as matchHexToPms,
17787
- zn as materialStepService,
17798
+ Gn as materialStepService,
17788
17799
  cl as metafieldManager,
17789
- Uc as mmPerPixel,
17790
- Gn as modelStepService,
17800
+ Lc as mmPerPixel,
17801
+ zn as modelStepService,
17791
17802
  Ca as modifySVGColors,
17792
17803
  Wn as moduleStepService,
17793
17804
  dd as nameBundle,
@@ -17801,13 +17812,13 @@ export {
17801
17812
  Hn as questionStepService,
17802
17813
  Bc as registerFetchImplementation,
17803
17814
  Ec as registerWindowImplementation,
17804
- za as rehydrateSerializedLayout,
17815
+ Ga as rehydrateSerializedLayout,
17805
17816
  qr as rgbToPms,
17806
17817
  le as rotateAroundPoint,
17807
17818
  pa as sanitizeSvgTree,
17808
17819
  $r as setBearerAuthenticationToken,
17809
17820
  gn as setCanvasModule,
17810
- zt as shapeStepService,
17821
+ Gt as shapeStepService,
17811
17822
  hs as shortenUrl,
17812
17823
  mt as spiffCoreConfiguration,
17813
17824
  Xc as stepAspectValuesToDesignInputSteps,