@spiffcommerce/core 28.0.0 → 28.0.1-beta.10d96995-f841-5fe3-9e44-7c0791da863a

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
@@ -23,7 +23,7 @@ import { split as Ze } from "unicode-default-word-boundary";
23
23
  import cn from "lodash.debounce";
24
24
  import "fs";
25
25
  import "path";
26
- 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 || {}), Sr = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(Sr || {}), 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 || {}), vr = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(vr || {}), Er = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Er || {}), Br = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(Br || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), br = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(br || {}), we = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(we || {}), kt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(kt || {}), H = /* @__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))(H || {}), Ir = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Ir || {});
26
+ 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 || {}), Sr = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(Sr || {}), 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 || {}), vr = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(vr || {}), Er = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Er || {}), br = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(br || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Br = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Br || {}), we = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(we || {}), kt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(kt || {}), H = /* @__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))(H || {}), Ir = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Ir || {});
27
27
  class dn extends Error {
28
28
  constructor(t) {
29
29
  super(t), this.name = this.constructor.name;
@@ -228,7 +228,7 @@ const An = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @_
228
228
  const n = a.load();
229
229
  return Oe.set(t, n), n;
230
230
  }
231
- }, Bt = () => {
231
+ }, bt = () => {
232
232
  if (Mt([typeof XMLSerializer]))
233
233
  return new XMLSerializer();
234
234
  const r = Xt();
@@ -368,7 +368,7 @@ class Wr {
368
368
  });
369
369
  }
370
370
  }
371
- const b = new Wr();
371
+ const B = new Wr();
372
372
  let aa, na;
373
373
  const gt = (r, t, e) => {
374
374
  if (aa !== void 0)
@@ -3339,7 +3339,7 @@ const oe = (r) => {
3339
3339
  }
3340
3340
  });
3341
3341
  });
3342
- }, Sn = (r) => Bt().serializeToString(r), fa = (r, t, e, a, n) => {
3342
+ }, Sn = (r) => bt().serializeToString(r), fa = (r, t, e, a, n) => {
3343
3343
  const i = wn(r);
3344
3344
  if (!i)
3345
3345
  throw new Error("Failed to read SVG.");
@@ -3371,7 +3371,7 @@ const oe = (r) => {
3371
3371
  s.classList.add(A), s.setAttribute("stroke", c.browserValue), a[d] = c;
3372
3372
  }
3373
3373
  });
3374
- const i = Bt().serializeToString(e);
3374
+ const i = bt().serializeToString(e);
3375
3375
  return {
3376
3376
  colors: a,
3377
3377
  svg: i
@@ -3508,14 +3508,14 @@ const oe = (r) => {
3508
3508
  ...AssetFields
3509
3509
  }
3510
3510
  }
3511
- `, ve = async (r) => (await b.getShadowGraphqlClient().query({
3511
+ `, ve = async (r) => (await B.getShadowGraphqlClient().query({
3512
3512
  query: si,
3513
3513
  errorPolicy: "all",
3514
3514
  fetchPolicy: "no-cache",
3515
3515
  variables: {
3516
3516
  keys: r
3517
3517
  }
3518
- })).data.assets, di = async (r) => (await b.getShadowGraphqlClient().query({
3518
+ })).data.assets, di = async (r) => (await B.getShadowGraphqlClient().query({
3519
3519
  query: oi,
3520
3520
  errorPolicy: "all",
3521
3521
  variables: {
@@ -3523,7 +3523,7 @@ const oe = (r) => {
3523
3523
  }
3524
3524
  })).data.materials, Ai = async (r, t, e, a, n) => {
3525
3525
  var s;
3526
- return (s = (await b.getShadowGraphqlClient().mutate({
3526
+ return (s = (await B.getShadowGraphqlClient().mutate({
3527
3527
  mutation: li,
3528
3528
  errorPolicy: "all",
3529
3529
  fetchPolicy: "no-cache",
@@ -3620,7 +3620,7 @@ class ui {
3620
3620
  d.lengthComputable && a(d.loaded * 100 / d.total);
3621
3621
  }, c.onload = () => {
3622
3622
  const d = s.assetResponse.asset;
3623
- bt.add(s.assetResponse.asset), o(d);
3623
+ Bt.add(s.assetResponse.asset), o(d);
3624
3624
  }, c.onerror = l, this.postProcessFileUpload(t, s.mimeType).then((d) => c.send(d.blob)).catch(l);
3625
3625
  }), this.cacheAsset(s.assetResponse.asset), s.assetResponse.asset;
3626
3626
  }
@@ -3642,7 +3642,7 @@ class ui {
3642
3642
  }
3643
3643
  const n = (async () => {
3644
3644
  var s, o;
3645
- const i = await b.getShadowGraphqlClient().mutate({
3645
+ const i = await B.getShadowGraphqlClient().mutate({
3646
3646
  mutation: ci,
3647
3647
  fetchPolicy: "no-cache",
3648
3648
  errorPolicy: "all",
@@ -3652,7 +3652,7 @@ class ui {
3652
3652
  });
3653
3653
  if (this.bgrmProcessCache.delete(e), !((o = (s = i.data) == null ? void 0 : s.assetRemoveBackground) != null && o.key))
3654
3654
  throw new Error("Failed to remove background from image");
3655
- return bt.add(i.data.assetRemoveBackground), J.add(e, i.data.assetRemoveBackground.key), this.cache.set(
3655
+ return Bt.add(i.data.assetRemoveBackground), J.add(e, i.data.assetRemoveBackground.key), this.cache.set(
3656
3656
  i.data.assetRemoveBackground.key,
3657
3657
  Promise.resolve(i.data.assetRemoveBackground)
3658
3658
  ), i.data.assetRemoveBackground;
@@ -3660,16 +3660,16 @@ class ui {
3660
3660
  return this.bgrmProcessCache.set(e, n), n;
3661
3661
  }
3662
3662
  removePersistedAsset(t) {
3663
- bt.remove(t), J.delete(t), J.deleteForBgRemovedKey(t);
3663
+ Bt.remove(t), J.delete(t), J.deleteForBgRemovedKey(t);
3664
3664
  }
3665
3665
  getPersistedAssets() {
3666
- return bt.list();
3666
+ return Bt.list();
3667
3667
  }
3668
3668
  registerPersistedAssetListener(t) {
3669
- bt.addCallback(t);
3669
+ Bt.addCallback(t);
3670
3670
  }
3671
3671
  unRegisterPersistedAssetListener(t) {
3672
- bt.removeCallback(t);
3672
+ Bt.removeCallback(t);
3673
3673
  }
3674
3674
  isRaster(t) {
3675
3675
  return !(t.type === "image/svg+xml" || t.type === "application/pdf" || t.type === "application/postscript");
@@ -3680,7 +3680,7 @@ class ui {
3680
3680
  if (!s)
3681
3681
  throw new Dt("Failed to read SVG.");
3682
3682
  ai(s);
3683
- const l = Bt().serializeToString(s);
3683
+ const l = bt().serializeToString(s);
3684
3684
  return {
3685
3685
  name: t.name,
3686
3686
  blob: new Blob([l], { type: "image/svg+xml" })
@@ -3767,7 +3767,7 @@ const Rt = "persistentAssets", vn = class ft {
3767
3767
  }
3768
3768
  };
3769
3769
  vn.callbacks = [];
3770
- let bt = vn;
3770
+ let Bt = vn;
3771
3771
  const Ua = "bgrmPersistentAssets";
3772
3772
  class J {
3773
3773
  static has(t) {
@@ -3880,7 +3880,7 @@ const Jt = new hi(), En = v`
3880
3880
  }
3881
3881
  }
3882
3882
  `, gi = async (r) => {
3883
- const t = await b.getShadowGraphqlClient().query({
3883
+ const t = await B.getShadowGraphqlClient().query({
3884
3884
  query: mi,
3885
3885
  errorPolicy: "all",
3886
3886
  variables: {
@@ -3948,7 +3948,7 @@ class Ci {
3948
3948
  }
3949
3949
  }
3950
3950
  }
3951
- const q = new Ci(), Bn = v`
3951
+ const q = new Ci(), bn = v`
3952
3952
  fragment ActiveIntegrationFields on Integration {
3953
3953
  id
3954
3954
  logo
@@ -4072,7 +4072,7 @@ const q = new Ci(), Bn = v`
4072
4072
  }
4073
4073
  }
4074
4074
  }
4075
- `, bn = v`
4075
+ `, Bn = v`
4076
4076
  fragment StakeholderFields on Stakeholder {
4077
4077
  id
4078
4078
  type
@@ -4091,9 +4091,9 @@ const q = new Ci(), Bn = v`
4091
4091
  }
4092
4092
  `, yi = v`
4093
4093
  ${Te}
4094
- ${bn}
4095
- ${In}
4096
4094
  ${Bn}
4095
+ ${In}
4096
+ ${bn}
4097
4097
  query ReadTransactions($ids: [String]!) {
4098
4098
  transactions(ids: $ids) {
4099
4099
  customLogoLink
@@ -4322,7 +4322,7 @@ const q = new Ci(), Bn = v`
4322
4322
  workflowViewerReadOnlyLink
4323
4323
  }
4324
4324
  }
4325
- `, Bi = v`
4325
+ `, bi = v`
4326
4326
  ${In}
4327
4327
  query ReadTransactionForShareActions($id: String!) {
4328
4328
  transactions(ids: [$id]) {
@@ -4423,7 +4423,7 @@ const q = new Ci(), Bn = v`
4423
4423
  ` : ""}
4424
4424
  }
4425
4425
  }
4426
- `, bi = (r) => v`
4426
+ `, Bi = (r) => v`
4427
4427
  ${Dn(r)}
4428
4428
  query GetIntegrationProducts($ids: [String!]!) {
4429
4429
  integrationProducts(ids: $ids) {
@@ -4441,7 +4441,7 @@ const q = new Ci(), Bn = v`
4441
4441
  }
4442
4442
  }
4443
4443
  `, Pi = v`
4444
- ${bn}
4444
+ ${Bn}
4445
4445
  query ReadTransactionForStakeholders($id: String!) {
4446
4446
  transactions(ids: [$id]) {
4447
4447
  stakeholders {
@@ -5100,7 +5100,7 @@ const q = new Ci(), Bn = v`
5100
5100
  }
5101
5101
  }
5102
5102
  `, Oi = v`
5103
- ${Bn}
5103
+ ${bn}
5104
5104
  ${Ne}
5105
5105
  query GetCurrentIntegration($themeConfigurationId: String) {
5106
5106
  currentIntegration {
@@ -5328,11 +5328,11 @@ const Q = () => {
5328
5328
  width: u
5329
5329
  }) => {
5330
5330
  var E;
5331
- const h = e || 0, m = 2 * ((l == null ? void 0 : l.scale) || 1), g = A || { x: 0, y: 0, width: u, height: i }, p = `${g.x} ${g.y} ${g.width} ${g.height}`, f = Q(), C = a.purpose === Ht.FreeDesign && /* @__PURE__ */ x("defs", { children: /* @__PURE__ */ x("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ x("rect", { width: g.width, height: g.height, rx: h }) }) }), w = (E = a.colorProfiles) == null ? void 0 : E.map((B, I) => (
5331
+ const h = e || 0, m = 2 * ((l == null ? void 0 : l.scale) || 1), g = A || { x: 0, y: 0, width: u, height: i }, p = `${g.x} ${g.y} ${g.width} ${g.height}`, f = Q(), C = a.purpose === Ht.FreeDesign && /* @__PURE__ */ x("defs", { children: /* @__PURE__ */ x("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ x("rect", { width: g.width, height: g.height, rx: h }) }) }), w = (E = a.colorProfiles) == null ? void 0 : E.map((b, I) => (
5332
5332
  /* @ts-ignore */
5333
- /* @__PURE__ */ x("color-profile", { name: B.name, xlinkHref: B.key, children: " " }, I)
5334
- )), S = n.map((B) => ({
5335
- ...B,
5333
+ /* @__PURE__ */ x("color-profile", { name: b.name, xlinkHref: b.key, children: " " }, I)
5334
+ )), S = n.map((b) => ({
5335
+ ...b,
5336
5336
  _renderingConfiguration: a,
5337
5337
  mask: l ? `url(#viewmask-${f})` : void 0
5338
5338
  })), y = va(S);
@@ -5372,7 +5372,7 @@ const Q = () => {
5372
5372
  {
5373
5373
  id: "element-group",
5374
5374
  clipPath: a.purpose === Ht.FreeDesign ? "url(#viewboxClip)" : void 0,
5375
- children: y.map((B) => Rn(B)).filter((B) => !!B)
5375
+ children: y.map((b) => Rn(b)).filter((b) => !!b)
5376
5376
  }
5377
5377
  ),
5378
5378
  l && /* @__PURE__ */ x(
@@ -5577,8 +5577,8 @@ const Q = () => {
5577
5577
  /* @__PURE__ */ x("feFuncB", { type: "discrete", tableValues: n() })
5578
5578
  ] })
5579
5579
  ] }) }) }), s = r.rotation || 0, o = pt(s), l = Math.cos(o), c = -Math.sin(o), d = () => {
5580
- var w, S, y, E, B, I, D, F, k, T;
5581
- const A = ((w = r.pattern) == null ? void 0 : w.x) || 0, u = ((S = r.pattern) == null ? void 0 : S.y) || 0, h = ((y = r.pattern) == null ? void 0 : y.width) || 0, m = ((E = r.pattern) == null ? void 0 : E.height) || 0, g = ((B = r.pattern) == null ? void 0 : B.scaleX) || 1, p = ((I = r.pattern) == null ? void 0 : I.scaleY) || 1, f = ((D = r.pattern) == null ? void 0 : D.rotation) || 0;
5580
+ var w, S, y, E, b, I, D, F, k, T;
5581
+ const A = ((w = r.pattern) == null ? void 0 : w.x) || 0, u = ((S = r.pattern) == null ? void 0 : S.y) || 0, h = ((y = r.pattern) == null ? void 0 : y.width) || 0, m = ((E = r.pattern) == null ? void 0 : E.height) || 0, g = ((b = r.pattern) == null ? void 0 : b.scaleX) || 1, p = ((I = r.pattern) == null ? void 0 : I.scaleY) || 1, f = ((D = r.pattern) == null ? void 0 : D.rotation) || 0;
5582
5582
  return [(F = r.pattern) != null && F.svg ? {
5583
5583
  id: `${t}-contents`,
5584
5584
  type: M.Illustration,
@@ -5741,17 +5741,17 @@ const Ji = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5741
5741
  let y = 0;
5742
5742
  const E = A.getAttribute("text-anchor");
5743
5743
  E === "middle" ? y = S / 2 : E === "end" && (y = S);
5744
- const B = g.getPath(
5744
+ const b = g.getPath(
5745
5745
  A.innerHTML,
5746
5746
  parseFloat(A.getAttribute("x") ?? "0") - y,
5747
5747
  parseFloat(A.getAttribute("y") ?? "0"),
5748
5748
  parseInt(u.getAttribute("font-size") ?? "72")
5749
5749
  );
5750
- B.fill = p, B.stroke = f, B.strokeWidth = parseFloat(C ?? "0");
5751
- const I = B.toSVG(2), F = t.parseFromString(I, "image/svg+xml").firstElementChild;
5750
+ b.fill = p, b.stroke = f, b.strokeWidth = parseFloat(C ?? "0");
5751
+ const I = b.toSVG(2), F = t.parseFromString(I, "image/svg+xml").firstElementChild;
5752
5752
  h.appendChild(F);
5753
5753
  }
5754
- return e.querySelectorAll("text").forEach((d) => d.remove()), Bt().serializeToString(a);
5754
+ return e.querySelectorAll("text").forEach((d) => d.remove()), bt().serializeToString(a);
5755
5755
  }, Ee = (r, t, e, a) => Math.max(ts(r.join(`
5756
5756
  `), e, a), t), La = (r, t, e, a, n, i) => {
5757
5757
  const s = (i || ya) * n.getApproximateHeight(), o = t.split(`
@@ -5861,7 +5861,7 @@ const Ji = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5861
5861
  stripControlCharacters: !0,
5862
5862
  vertical: !1,
5863
5863
  uppercase: !1
5864
- }, Be = (r, t = Va) => {
5864
+ }, be = (r, t = Va) => {
5865
5865
  const e = { ...Va, ...t };
5866
5866
  let a = r || "";
5867
5867
  return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
@@ -6271,7 +6271,7 @@ const ae = (r) => {
6271
6271
  return At.set(r, s), s;
6272
6272
  }
6273
6273
  if ((((e = r.split(".").pop()) == null ? void 0 : e.toLowerCase()) ?? "") === "svg") {
6274
- const a = await Ba(r), n = a.width, i = a.height, s = {
6274
+ const a = await ba(r), n = a.width, i = a.height, s = {
6275
6275
  src: r,
6276
6276
  width: n,
6277
6277
  height: i,
@@ -6287,7 +6287,7 @@ const ae = (r) => {
6287
6287
  };
6288
6288
  return At.set(r, i), i;
6289
6289
  }
6290
- }, Ba = async (r) => {
6290
+ }, ba = async (r) => {
6291
6291
  const t = await at(r);
6292
6292
  return $n(t);
6293
6293
  }, za = (r) => r.endsWith("mm") ? Number(r.replace("mm", "")) * 3.7795275591 : r.endsWith("px") ? Number(r.replace("px", "")) : Number(r), $n = (r) => {
@@ -6327,7 +6327,7 @@ const ae = (r) => {
6327
6327
  const s = dt().parseFromString(r, "image/svg+xml").firstElementChild;
6328
6328
  if (!s)
6329
6329
  throw new Error("Failed to read SVG");
6330
- const l = Bt().serializeToString(s), c = gt(), d = c.getContext("2d"), A = await Aa.from(d, l, {
6330
+ const l = bt().serializeToString(s), c = gt(), d = c.getContext("2d"), A = await Aa.from(d, l, {
6331
6331
  anonymousCrossOrigin: !0,
6332
6332
  ignoreDimensions: !1,
6333
6333
  createCanvas: gt,
@@ -6424,7 +6424,7 @@ class Jc {
6424
6424
  const { configuration: a, fontSrc: n, designInputStep: i } = e, s = await Tt(n), o = {
6425
6425
  assetUrl: n,
6426
6426
  name: s.names.fullName.en
6427
- }, l = (i == null ? void 0 : i.text) || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = Be(c, {
6427
+ }, l = (i == null ? void 0 : i.text) || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = be(c, {
6428
6428
  vertical: a.vertical,
6429
6429
  uppercase: a.uppercase
6430
6430
  }), A = e.region || await Ut(t, M.Textbox, n, {
@@ -6541,7 +6541,7 @@ const L = (r, t) => _(r, t).elements.find((n) => n.id === r), _ = (r, t) => {
6541
6541
  if (!e)
6542
6542
  throw new V();
6543
6543
  return e;
6544
- }, X = (r, t) => {
6544
+ }, Z = (r, t) => {
6545
6545
  const e = [...t.elements.filter((n) => n.id !== r.id), r], a = va(e);
6546
6546
  return {
6547
6547
  layout: t.layout,
@@ -6634,7 +6634,7 @@ class Kc extends O {
6634
6634
  ...e,
6635
6635
  x: this.x,
6636
6636
  y: this.y
6637
- }, n = _(e.id, Object.values(t.layouts)), i = X(a, n);
6637
+ }, n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
6638
6638
  return {
6639
6639
  ...t,
6640
6640
  layouts: {
@@ -6656,7 +6656,7 @@ class _c extends O {
6656
6656
  const a = {
6657
6657
  ...e,
6658
6658
  rotation: this.angle
6659
- }, n = _(e.id, Object.values(t.layouts)), i = X(a, n);
6659
+ }, n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
6660
6660
  return {
6661
6661
  ...t,
6662
6662
  layouts: {
@@ -6687,7 +6687,7 @@ class Xc extends O {
6687
6687
  const s = a, o = (!s.algorithm || s.algorithm === kt.Autosize ? s.text : s.input) ?? "";
6688
6688
  a = ee(s, o, e);
6689
6689
  }
6690
- const n = _(e.id, Object.values(t.layouts)), i = X(a, n);
6690
+ const n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
6691
6691
  return {
6692
6692
  ...t,
6693
6693
  layouts: {
@@ -6819,7 +6819,7 @@ class ds extends O {
6819
6819
  fill: this.color,
6820
6820
  fillSpotColorDefinition: this.textFillSpotColor,
6821
6821
  textFillImage: void 0
6822
- }, n = _(e.id, Object.values(t.layouts)), i = X(a, n);
6822
+ }, n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
6823
6823
  return {
6824
6824
  ...t,
6825
6825
  layouts: {
@@ -6841,7 +6841,7 @@ class We extends O {
6841
6841
  const a = {
6842
6842
  ...e,
6843
6843
  textFillImage: this.imageFill
6844
- }, n = _(e.id, Object.values(t.layouts)), i = X(a, n);
6844
+ }, n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
6845
6845
  return {
6846
6846
  ...t,
6847
6847
  layouts: {
@@ -6863,7 +6863,7 @@ class As extends O {
6863
6863
  const a = {
6864
6864
  ...e,
6865
6865
  fontSize: this.size
6866
- }, n = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === kt.Autosize ? e.text : e.input) ?? "", s = X(ee(a, i), n);
6866
+ }, n = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === kt.Autosize ? e.text : e.input) ?? "", s = Z(ee(a, i), n);
6867
6867
  return {
6868
6868
  ...t,
6869
6869
  layouts: {
@@ -6885,7 +6885,7 @@ class Wa extends O {
6885
6885
  const a = {
6886
6886
  ...e,
6887
6887
  fontData: this.fontData
6888
- }, n = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === kt.Autosize ? e.text : e.input) ?? "", s = X(ee(a, i), n);
6888
+ }, n = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === kt.Autosize ? e.text : e.input) ?? "", s = Z(ee(a, i), n);
6889
6889
  return {
6890
6890
  ...t,
6891
6891
  layouts: {
@@ -6907,7 +6907,7 @@ class us extends O {
6907
6907
  const a = {
6908
6908
  ...e,
6909
6909
  align: this.align
6910
- }, n = _(e.id, Object.values(t.layouts)), i = X(a, n);
6910
+ }, n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
6911
6911
  return {
6912
6912
  ...t,
6913
6913
  layouts: {
@@ -6968,7 +6968,7 @@ class ms extends O {
6968
6968
  invertThreshold: this.invertThreshold,
6969
6969
  threshold: this.threshold,
6970
6970
  thresholdSaturation: this.thresholdSaturation
6971
- }, n = _(e.id, Object.values(t.layouts)), i = X(a, n);
6971
+ }, n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
6972
6972
  return {
6973
6973
  ...t,
6974
6974
  layouts: {
@@ -6990,7 +6990,7 @@ class Zc extends O {
6990
6990
  const a = {
6991
6991
  ...e,
6992
6992
  src: this.src
6993
- }, n = _(e.id, Object.values(t.layouts)), i = X(a, n);
6993
+ }, n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
6994
6994
  return {
6995
6995
  ...t,
6996
6996
  layouts: {
@@ -7009,7 +7009,7 @@ class gs extends O {
7009
7009
  const e = L(this.id, Object.values(t.layouts));
7010
7010
  if (!e.id)
7011
7011
  throw new V();
7012
- const a = _(e.id, Object.values(t.layouts)), n = X(ee(e, this.text, e), a);
7012
+ const a = _(e.id, Object.values(t.layouts)), n = Z(ee(e, this.text, e), a);
7013
7013
  return {
7014
7014
  ...t,
7015
7015
  layouts: {
@@ -7032,7 +7032,7 @@ class je extends O {
7032
7032
  ...e,
7033
7033
  strokeColor: this.strokeColor,
7034
7034
  strokeThickness: this.strokeThickness
7035
- }, n = _(e.id, Object.values(t.layouts)), i = X(a, n);
7035
+ }, n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
7036
7036
  return {
7037
7037
  ...t,
7038
7038
  layouts: {
@@ -7064,7 +7064,7 @@ class oa extends O {
7064
7064
  const i = {
7065
7065
  ...e,
7066
7066
  colors: a
7067
- }, s = _(e.id, Object.values(t.layouts)), o = X(i, s);
7067
+ }, s = _(e.id, Object.values(t.layouts)), o = Z(i, s);
7068
7068
  return {
7069
7069
  ...t,
7070
7070
  layouts: {
@@ -7087,7 +7087,7 @@ class ps extends O {
7087
7087
  ...e,
7088
7088
  svg: this.svgBody,
7089
7089
  cachedObjectURL: this.objectURL
7090
- }, n = _(e.id, Object.values(t.layouts)), i = X(a, n);
7090
+ }, n = _(e.id, Object.values(t.layouts)), i = Z(a, n);
7091
7091
  return {
7092
7092
  ...t,
7093
7093
  layouts: {
@@ -7442,7 +7442,7 @@ class Cs {
7442
7442
  }
7443
7443
  }
7444
7444
  const zn = new Cs();
7445
- class be {
7445
+ class Be {
7446
7446
  constructor() {
7447
7447
  this.frameSourceSvg = async (t, e) => {
7448
7448
  if (!t)
@@ -7556,7 +7556,7 @@ class be {
7556
7556
  }
7557
7557
  selectImage(t, e, a, n = !0) {
7558
7558
  var l;
7559
- const i = be.patternSource(e), s = (l = a.getStepStorage(t.stepName)) == null ? void 0 : l.framePatternSrc;
7559
+ const i = Be.patternSource(e), s = (l = a.getStepStorage(t.stepName)) == null ? void 0 : l.framePatternSrc;
7560
7560
  if (s && s === i)
7561
7561
  return Promise.resolve();
7562
7562
  a.setEditedStatus(t.stepName, !0);
@@ -7621,7 +7621,7 @@ class be {
7621
7621
  }
7622
7622
  async loadPatternFromString(t, e, a = !0, n = void 0, i) {
7623
7623
  if (t.endsWith("svg")) {
7624
- const s = await Ba(t), o = s.width, l = s.height, c = await at(t);
7624
+ const s = await ba(t), o = s.width, l = s.height, c = await at(t);
7625
7625
  if (i) {
7626
7626
  const u = c.match(/<(image|linearGradient|radialGradient)(\s|>|\/>)/gim);
7627
7627
  if (u && u.length > 0)
@@ -7748,11 +7748,11 @@ class be {
7748
7748
  scaleX: (w == null ? void 0 : w.zoom) || 1,
7749
7749
  scaleY: (w == null ? void 0 : w.zoom) || 1,
7750
7750
  rotation: 0
7751
- } : void 0, y = Q(), B = n.getLayouts().find((I) => I.panelId === m.panelId);
7752
- if (!B)
7751
+ } : void 0, y = Q(), b = n.getLayouts().find((I) => I.panelId === m.panelId);
7752
+ if (!b)
7753
7753
  throw new Y(m);
7754
7754
  return {
7755
- command: this.getCreateElementCommand(y, m, B, {
7755
+ command: this.getCreateElementCommand(y, m, b, {
7756
7756
  frameData: p,
7757
7757
  pattern: S,
7758
7758
  disablePlaceholder: t.data.disablePlaceholder,
@@ -7801,7 +7801,7 @@ class be {
7801
7801
  }
7802
7802
  async loadPatternFromAsset(t, e, a, n) {
7803
7803
  var c, d;
7804
- const i = be.patternSource(t), s = a.markUpdatePending(), o = (c = a.getWorkflowExperience().getStepById(e.stepName)) == null ? void 0 : c.frameService;
7804
+ const i = Be.patternSource(t), s = a.markUpdatePending(), o = (c = a.getWorkflowExperience().getStepById(e.stepName)) == null ? void 0 : c.frameService;
7805
7805
  if (!o)
7806
7806
  throw a.markUpdateCompleted(s), new Error("Frame service unavailable, cannot load pattern!");
7807
7807
  try {
@@ -7828,7 +7828,7 @@ class be {
7828
7828
  ), this.validateColorCount(e, a);
7829
7829
  }
7830
7830
  }
7831
- const Ct = new be();
7831
+ const Ct = new Be();
7832
7832
  class ws {
7833
7833
  async getIllustrationBody(t) {
7834
7834
  return new Promise((e) => {
@@ -8040,21 +8040,21 @@ class ws {
8040
8040
  const C = ((w = o.assetConfiguration) == null ? void 0 : w.defaultColorVariants) || [];
8041
8041
  if (C.length !== 0) {
8042
8042
  const y = {};
8043
- (((S = o.assetConfiguration) == null ? void 0 : S.channelNumbers) || []).forEach((B) => {
8043
+ (((S = o.assetConfiguration) == null ? void 0 : S.channelNumbers) || []).forEach((b) => {
8044
8044
  var D;
8045
- const I = C.find((F) => F.channelNumber === B.number);
8046
- I && (y[`${B.id.replace(/\W/g, "")}`] = { browserValue: ((D = I == null ? void 0 : I.variant) == null ? void 0 : D.color) || "" });
8045
+ const I = C.find((F) => F.channelNumber === b.number);
8046
+ I && (y[`${b.id.replace(/\W/g, "")}`] = { browserValue: ((D = I == null ? void 0 : I.variant) == null ? void 0 : D.color) || "" });
8047
8047
  }), await this.changeColors(
8048
8048
  t,
8049
- u.map((B) => B.regionElement),
8049
+ u.map((b) => b.regionElement),
8050
8050
  i,
8051
8051
  () => i.getCommandContext().getAllLayouts(),
8052
8052
  new Map(Object.entries(y))
8053
8053
  );
8054
8054
  }
8055
8055
  if (t.data.colorPickerEnabled) {
8056
- const y = await this.availableColors(t, i) || [], E = Object.keys(c.colors), B = y.length === 1 && E.length === 1;
8057
- if (B) {
8056
+ const y = await this.availableColors(t, i) || [], E = Object.keys(c.colors), b = y.length === 1 && E.length === 1;
8057
+ if (b) {
8058
8058
  const I = y[0], D = E[0];
8059
8059
  await this.changeColors(
8060
8060
  t,
@@ -8064,7 +8064,7 @@ class ws {
8064
8064
  /* @__PURE__ */ new Map([[D, I.variant.color]])
8065
8065
  );
8066
8066
  }
8067
- !B && C.length === 0 && await this.changeColors(
8067
+ !b && C.length === 0 && await this.changeColors(
8068
8068
  t,
8069
8069
  u.map((I) => I.regionElement),
8070
8070
  i,
@@ -8446,7 +8446,7 @@ class Es {
8446
8446
  }
8447
8447
  }
8448
8448
  const Hn = new Es();
8449
- class Bs {
8449
+ class bs {
8450
8450
  async init(t, e, a) {
8451
8451
  const n = t.option;
8452
8452
  if (!n)
@@ -8504,8 +8504,8 @@ class Bs {
8504
8504
  };
8505
8505
  }
8506
8506
  }
8507
- const qn = new Bs();
8508
- class bs {
8507
+ const qn = new bs();
8508
+ class Bs {
8509
8509
  constructor() {
8510
8510
  this.shapeFillId = "spiff-fill-shape";
8511
8511
  }
@@ -8677,7 +8677,7 @@ class bs {
8677
8677
  }
8678
8678
  }
8679
8679
  }
8680
- const zt = new bs();
8680
+ const zt = new Bs();
8681
8681
  class Is {
8682
8682
  constructor() {
8683
8683
  this.latestToast = null, this.toastType = null, this.toastCallbacks = [];
@@ -8983,7 +8983,7 @@ class Fs {
8983
8983
  }
8984
8984
  getProcessedInput(t, e, a) {
8985
8985
  const n = a ? t : this.injectReplaceableText(t, e);
8986
- return Be(n, {
8986
+ return be(n, {
8987
8987
  vertical: e.vertical,
8988
8988
  uppercase: e.uppercase
8989
8989
  });
@@ -9056,9 +9056,9 @@ class Fs {
9056
9056
  let w = (A = n.storage) == null ? void 0 : A.text;
9057
9057
  const S = e.getWorkflowExperience().getBundle();
9058
9058
  if (S && t.globalPropertyAspectConfigurations) {
9059
- const y = (u = S.getGlobalPropertyConfiguration()) == null ? void 0 : u.aspects, E = y == null ? void 0 : y.find((B) => {
9059
+ const y = (u = S.getGlobalPropertyConfiguration()) == null ? void 0 : u.aspects, E = y == null ? void 0 : y.find((b) => {
9060
9060
  var I;
9061
- return B.type === z.Text && ((I = t.globalPropertyAspectConfigurations) == null ? void 0 : I.map((D) => D.aspectName).includes(B.name));
9061
+ return b.type === z.Text && ((I = t.globalPropertyAspectConfigurations) == null ? void 0 : I.map((D) => D.aspectName).includes(b.name));
9062
9062
  });
9063
9063
  if (E) {
9064
9064
  const I = S.getGlobalPropertyStateManager().getAspect(E.name);
@@ -9071,7 +9071,7 @@ class Fs {
9071
9071
  f,
9072
9072
  async () => {
9073
9073
  e.updateMetadata(t.stepName, { color: C, text: w }), e.updateStorage(t.stepName, { text: w, inputText: w });
9074
- const y = o.map((B) => new Wa(B.id, p)), E = new $(y);
9074
+ const y = o.map((b) => new Wa(b.id, p)), E = new $(y);
9075
9075
  e.getCommandDispatcher()(E);
9076
9076
  }
9077
9077
  ), o.length === 0 && l) {
@@ -9298,7 +9298,7 @@ class Fs {
9298
9298
  curved: a.curved,
9299
9299
  paths: a.paths,
9300
9300
  fillSpotColorDefinition: f
9301
- }, y = [], E = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
9301
+ }, y = [], E = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map();
9302
9302
  if (!S.fontData)
9303
9303
  throw new G("Failed to resolve font data for text.");
9304
9304
  const [I, D] = pe(
@@ -9315,7 +9315,7 @@ class Fs {
9315
9315
  [l],
9316
9316
  { size: a.size, minSize: a.minSize, maxSize: a.maxSize }
9317
9317
  );
9318
- E.set(S.id, I), B.set(S.id, D);
9318
+ E.set(S.id, I), b.set(S.id, D);
9319
9319
  const F = a.curved || a.vertical ? l : (D || []).join(`
9320
9320
  `);
9321
9321
  y.push(
@@ -9376,13 +9376,13 @@ class Fs {
9376
9376
  return d && d(!0), { info: "0" };
9377
9377
  const S = s.getProfanities(), y = Ze(u.toLowerCase());
9378
9378
  for (const E of y)
9379
- for (const B in S) {
9380
- const I = S[B].toLowerCase().replace(/\s/g, "");
9379
+ for (const b in S) {
9380
+ const I = S[b].toLowerCase().replace(/\s/g, "");
9381
9381
  if (E === I)
9382
9382
  return l(!0), { error: "Blocked profanity." };
9383
9383
  }
9384
9384
  return !t.data.vertical && !t.data.allowNewlines && (u.includes(`
9385
- `) || u.includes("\r")) ? (l(!0), { error: "Cannot span multiple lines." }) : !t.data.curved && !Array.from(g.values()).every((B) => B) ? (l(!0), { error: "Does not fit." }) : (l(!1), { info: (t.data.maxLength - u.length).toString() });
9385
+ `) || u.includes("\r")) ? (l(!0), { error: "Cannot span multiple lines." }) : !t.data.curved && !Array.from(g.values()).every((b) => b) ? (l(!0), { error: "Does not fit." }) : (l(!1), { info: (t.data.maxLength - u.length).toString() });
9386
9386
  })();
9387
9387
  if (f.error) {
9388
9388
  c(f.error);
@@ -9574,8 +9574,8 @@ class $s extends xs {
9574
9574
  y.setAttribute("d", d), y.setAttribute("stroke", "black"), y.setAttribute("stroke-width", "3"), S.appendChild(y);
9575
9575
  const E = et("g");
9576
9576
  E.classList.add("module-layer0"), w.appendChild(E), E.setAttribute("filter", "url(#shadow)"), E.innerHTML = y.outerHTML;
9577
- const B = et("g");
9578
- B.classList.add("module-layer1"), w.appendChild(B), B.setAttribute("stroke-width", "3"), B.setAttribute("stroke", "rgb(45,41,38)"), B.setAttribute("fill", "rgb(45,41,38)"), B.setAttribute("transform", "translate(0.5,0)"), B.innerHTML = o;
9577
+ const b = et("g");
9578
+ b.classList.add("module-layer1"), w.appendChild(b), b.setAttribute("stroke-width", "3"), b.setAttribute("stroke", "rgb(45,41,38)"), b.setAttribute("fill", "rgb(45,41,38)"), b.setAttribute("transform", "translate(0.5,0)"), b.innerHTML = o;
9579
9579
  const I = et("g");
9580
9580
  I.classList.add("module-layer2"), w.appendChild(I), I.setAttribute("fill", "rgb(255,209,0)"), I.setAttribute("transform", "translate(1,-0.1)"), I.innerHTML = o;
9581
9581
  const D = et("g");
@@ -9653,7 +9653,7 @@ const ne = v`
9653
9653
  }
9654
9654
  }
9655
9655
  }
9656
- `, rd = async (r) => (await b.getShadowGraphqlClient().query({
9656
+ `, rd = async (r) => (await B.getShadowGraphqlClient().query({
9657
9657
  query: Vs,
9658
9658
  fetchPolicy: "cache-first",
9659
9659
  errorPolicy: "all",
@@ -9705,7 +9705,7 @@ const ne = v`
9705
9705
  name
9706
9706
  }
9707
9707
  }
9708
- `, ba = v`
9708
+ `, Ba = v`
9709
9709
  ${zs}
9710
9710
  fragment ProductCollectionProductFields on ProductCollectionProduct {
9711
9711
  id
@@ -9716,7 +9716,7 @@ const ne = v`
9716
9716
  }
9717
9717
  }
9718
9718
  `, re = (r) => v`
9719
- ${r ? ba : ""}
9719
+ ${r ? Ba : ""}
9720
9720
  fragment ProductCollectionFields on ProductCollection {
9721
9721
  id
9722
9722
  name
@@ -9892,7 +9892,7 @@ const ne = v`
9892
9892
  }
9893
9893
  }
9894
9894
  `, js = v`
9895
- ${ba}
9895
+ ${Ba}
9896
9896
  query GetProductCollectionProducts($id: String!, $productIds: [String!]) {
9897
9897
  productCollections(ids: [$id], productIds: $productIds) {
9898
9898
  id
@@ -9925,7 +9925,7 @@ const ne = v`
9925
9925
  }
9926
9926
  }
9927
9927
  `, qs = v`
9928
- ${ba}
9928
+ ${Ba}
9929
9929
  query GetProductCollectionForProductsFeed(
9930
9930
  $id: String!
9931
9931
  $limit: Int
@@ -10295,8 +10295,8 @@ class Co {
10295
10295
  return;
10296
10296
  const S = this.getCommandContext().getAllLayouts(), y = (E = this.getLayoutPreviewService()) == null ? void 0 : E.getAll();
10297
10297
  if (y)
10298
- for (const [, B] of y)
10299
- B.render(S);
10298
+ for (const [, b] of y)
10299
+ b.render(S);
10300
10300
  }, 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) => {
10301
10301
  this.stepTags[S.stepName] = S.tags ?? [];
10302
10302
  }), C && (this.workflowStatePromiseQueue.enabled = !1), this.initializationPromise = this.initializeDefaultWorkflowState(a), this.initializationPromise.then(() => {
@@ -10818,7 +10818,7 @@ class Co {
10818
10818
  }
10819
10819
  async updateTransactionStakeholders() {
10820
10820
  var e;
10821
- const t = await b.getShadowGraphqlClient().query({
10821
+ const t = await B.getShadowGraphqlClient().query({
10822
10822
  query: Pi,
10823
10823
  errorPolicy: "all",
10824
10824
  fetchPolicy: "no-cache",
@@ -10829,7 +10829,7 @@ class Co {
10829
10829
  !((e = t == null ? void 0 : t.data) != null && e.transactions) || t.data.transactions.length !== 1 ? (this.transaction.currentStakeholder = void 0, this.transaction.stakeholders = void 0) : (this.transaction.stakeholders = t.data.transactions[0].stakeholders, this.transaction.currentStakeholder = t.data.transactions[0].currentStakeholder);
10830
10830
  }
10831
10831
  async approveTransaction(t) {
10832
- await b.getShadowGraphqlClient().mutate({
10832
+ await B.getShadowGraphqlClient().mutate({
10833
10833
  mutation: uo,
10834
10834
  errorPolicy: "all",
10835
10835
  fetchPolicy: "no-cache",
@@ -10840,7 +10840,7 @@ class Co {
10840
10840
  });
10841
10841
  }
10842
10842
  async rejectTransaction(t) {
10843
- await b.getShadowGraphqlClient().mutate({
10843
+ await B.getShadowGraphqlClient().mutate({
10844
10844
  mutation: ho,
10845
10845
  errorPolicy: "all",
10846
10846
  fetchPolicy: "no-cache",
@@ -10863,11 +10863,11 @@ class Co {
10863
10863
  this.stepSelections = {
10864
10864
  ...this.stepSelections,
10865
10865
  [t]: { selectedVariants: e }
10866
- }, this.selectionCost = Object.values(this.stepSelections).reduce((E, B) => E + B.selectedVariants.map((I) => I.priceModifier || 0).reduce((I, D) => I + D, 0), 0), this.workflow.steps.forEach((E) => {
10866
+ }, this.selectionCost = Object.values(this.stepSelections).reduce((E, b) => E + b.selectedVariants.map((I) => I.priceModifier || 0).reduce((I, D) => I + D, 0), 0), this.workflow.steps.forEach((E) => {
10867
10867
  wt(E, this.stepSelections) || (this.stepInitialised[E.stepName] = !1, delete this.stepMetadata[E.stepName], delete this.stepSelections[E.stepName], delete this.storage[E.stepName]);
10868
10868
  });
10869
10869
  const s = this.allScenes, o = Pt(s, i), l = Pt(s, this.stepSelections), c = o.map((E) => E.silentSteps).flat(), A = l.map((E) => E.silentSteps).flat().filter(
10870
- (E) => !c.some((B) => B.stepName === E.stepName)
10870
+ (E) => !c.some((b) => b.stepName === E.stepName)
10871
10871
  );
10872
10872
  c.forEach((E) => {
10873
10873
  wt(E, this.stepSelections) || (this.stepInitialised[E.stepName] = !1);
@@ -10881,15 +10881,15 @@ class Co {
10881
10881
  const g = this.workflow.steps.find((E) => E.stepName === t);
10882
10882
  if ((g == null ? void 0 : g.type) === P.Frame) {
10883
10883
  const E = (y = this.getWorkflowExperience().getStepById(g.stepName)) == null ? void 0 : y.frameService;
10884
- E == null || E.setTargetElements(a.map((B) => B.id));
10884
+ E == null || E.setTargetElements(a.map((b) => b.id));
10885
10885
  }
10886
10886
  const p = u.map((E) => new Et(E.id)), f = new Ga(this.constructSerializableWorkflow()), C = [...m, ...p, f];
10887
10887
  C.length > 0 && this.commandContext.apply(new $(C), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
10888
10888
  const w = this.getInvalidModelVariants(), S = this.modelContainer;
10889
10889
  if (S) {
10890
10890
  const E = w.map(
10891
- (B) => S.applyModelVariant(
10892
- B,
10891
+ (b) => S.applyModelVariant(
10892
+ b,
10893
10893
  {
10894
10894
  contextService: this.getLayoutPreviewService()
10895
10895
  },
@@ -11369,7 +11369,7 @@ class Eo extends it {
11369
11369
  return this.step.data.displayType || ((t = this.step.option) == null ? void 0 : t.displayType);
11370
11370
  }
11371
11371
  }
11372
- class Bo extends it {
11372
+ class bo extends it {
11373
11373
  constructor(t, e, a) {
11374
11374
  super(t, e, a);
11375
11375
  }
@@ -11424,7 +11424,7 @@ class Bo extends it {
11424
11424
  return t;
11425
11425
  }
11426
11426
  }
11427
- class bo extends it {
11427
+ class Bo extends it {
11428
11428
  constructor(t, e, a) {
11429
11429
  super(t, e, a);
11430
11430
  }
@@ -11723,13 +11723,13 @@ class ce {
11723
11723
  case P.Question:
11724
11724
  return new Eo(t, e, t.getStepTags(e.stepName));
11725
11725
  case P.Text:
11726
- return new bo(t, e, t.getStepTags(e.stepName));
11726
+ return new Bo(t, e, t.getStepTags(e.stepName));
11727
11727
  case P.Illustration:
11728
11728
  return new wo(t, e, t.getStepTags(e.stepName));
11729
11729
  case P.Picture:
11730
11730
  return new vo(t, e, t.getStepTags(e.stepName));
11731
11731
  case P.Shape:
11732
- return new Bo(t, e, t.getStepTags(e.stepName));
11732
+ return new bo(t, e, t.getStepTags(e.stepName));
11733
11733
  case P.Material:
11734
11734
  return new yo(t, e, t.getStepTags(e.stepName));
11735
11735
  case P.Model:
@@ -11832,7 +11832,7 @@ const ko = async (r, t) => {
11832
11832
  const l = ((n = Object.entries(localStorage).find(([d, A]) => d.startsWith("CognitoIdentityServiceProvider") && d.endsWith("idToken"))) == null ? void 0 : n[0]) || "", c = localStorage.getItem(l);
11833
11833
  c && !Wt(c) && (e.Authorization = `Bearer ${c}`);
11834
11834
  }
11835
- return (i = (await b.getShadowGraphqlClient().mutate({
11835
+ return (i = (await B.getShadowGraphqlClient().mutate({
11836
11836
  mutation: Fo,
11837
11837
  errorPolicy: "all",
11838
11838
  fetchPolicy: "no-cache",
@@ -11863,7 +11863,7 @@ const ko = async (r, t) => {
11863
11863
  const l = ((n = Object.entries(localStorage).find(([d, A]) => d.startsWith("CognitoIdentityServiceProvider") && d.endsWith("idToken"))) == null ? void 0 : n[0]) || "", c = localStorage.getItem(l);
11864
11864
  c && !Wt(c) && (e.Authorization = `Bearer ${c}`);
11865
11865
  }
11866
- return (i = (await b.getShadowGraphqlClient().mutate({
11866
+ return (i = (await B.getShadowGraphqlClient().mutate({
11867
11867
  mutation: xo,
11868
11868
  errorPolicy: "all",
11869
11869
  fetchPolicy: "no-cache",
@@ -11970,7 +11970,7 @@ const ko = async (r, t) => {
11970
11970
  if (c !== void 0)
11971
11971
  return c;
11972
11972
  await r.outstandingRequestsPromise();
11973
- const F = (N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(n.id), T = await b.getShadowGraphqlClient().query({
11973
+ const F = (N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(n.id), T = await B.getShadowGraphqlClient().query({
11974
11974
  query: Pn,
11975
11975
  variables: { ids: [n.id] },
11976
11976
  fetchPolicy: "no-cache",
@@ -11990,22 +11990,22 @@ const ko = async (r, t) => {
11990
11990
  for (const T of Object.keys(i)) {
11991
11991
  const nt = i[T], R = t.steps.find((tt) => tt.stepName === T);
11992
11992
  for (let tt = 0; tt < nt.selections.length; ++tt) {
11993
- const Z = nt.selections[tt];
11993
+ const X = nt.selections[tt];
11994
11994
  if (R && (!D || R.option && (R.option.variants || []).length > 1 && !R.data.hideSelectionInCart && !R.data.hideSelectionsInCart)) {
11995
11995
  const Nt = R.stepTitle;
11996
11996
  F[Nt] ? F[Nt].push({
11997
- id: Z.id || "",
11998
- name: Z.name,
11999
- priceModifier: Z.priceModifier
11997
+ id: X.id || "",
11998
+ name: X.name,
11999
+ priceModifier: X.priceModifier
12000
12000
  }) : F[Nt] = [
12001
12001
  {
12002
- id: Z.id || "",
12003
- name: Z.name,
12004
- priceModifier: Z.priceModifier
12002
+ id: X.id || "",
12003
+ name: X.name,
12004
+ priceModifier: X.priceModifier
12005
12005
  }
12006
12006
  ];
12007
12007
  }
12008
- k += Z.priceModifier;
12008
+ k += X.priceModifier;
12009
12009
  }
12010
12010
  }
12011
12011
  return [F, k];
@@ -12095,7 +12095,7 @@ const ko = async (r, t) => {
12095
12095
  );
12096
12096
  const n = await (async () => {
12097
12097
  var c;
12098
- const l = await b.getShadowGraphqlClient().query({
12098
+ const l = await B.getShadowGraphqlClient().query({
12099
12099
  query: Pn,
12100
12100
  variables: { ids: r.map((d) => d.transaction.id) },
12101
12101
  fetchPolicy: "no-cache",
@@ -12778,7 +12778,7 @@ const zo = [
12778
12778
  const n = e.data, i = a.option;
12779
12779
  if (!i)
12780
12780
  return console.error(`No option for step ${a.stepName}.`), [];
12781
- const s = ((y = i.variants) == null ? void 0 : y.find((B) => B.id === n.illustrationVariantId)) || ae(i);
12781
+ const s = ((y = i.variants) == null ? void 0 : y.find((b) => b.id === n.illustrationVariantId)) || ae(i);
12782
12782
  if (!s)
12783
12783
  return console.error(`No variant with ID: ${n.illustrationVariantId}`), [];
12784
12784
  if (!s.asset)
@@ -12792,32 +12792,32 @@ const zo = [
12792
12792
  return console.error("Failed to read SVG."), [];
12793
12793
  pa(m);
12794
12794
  const g = {};
12795
- xt(m, (B) => {
12796
- zo.includes(B.tagName) && !B.attributes.getNamedItem("fill") && B.setAttribute("fill", "#000000");
12797
- const I = B.attributes.getNamedItem("fill");
12795
+ xt(m, (b) => {
12796
+ zo.includes(b.tagName) && !b.attributes.getNamedItem("fill") && b.setAttribute("fill", "#000000");
12797
+ const I = b.attributes.getNamedItem("fill");
12798
12798
  if (I && I.value !== "none") {
12799
12799
  const F = I.value, T = `spiff-fill-${F.replace(/\W/g, "")}`;
12800
- B.classList.add(T), g[T] = { browserValue: F };
12800
+ b.classList.add(T), g[T] = { browserValue: F };
12801
12801
  }
12802
- const D = B.attributes.getNamedItem("stroke");
12802
+ const D = b.attributes.getNamedItem("stroke");
12803
12803
  if (D && D.value !== "none") {
12804
12804
  const F = D.value, T = `spiff-stroke-${F.replace(/\W/g, "")}`;
12805
- B.classList.add(T), g[T] = { browserValue: F };
12805
+ b.classList.add(T), g[T] = { browserValue: F };
12806
12806
  }
12807
12807
  });
12808
- const f = Bt().serializeToString(m), C = n.colors;
12808
+ const f = bt().serializeToString(m), C = n.colors;
12809
12809
  if (C) {
12810
- for (const [B, I] of Object.entries(g))
12810
+ for (const [b, I] of Object.entries(g))
12811
12811
  for (const D of Object.keys(C))
12812
12812
  if (I.browserValue === D) {
12813
- g[B] = { browserValue: C[D] };
12813
+ g[b] = { browserValue: C[D] };
12814
12814
  break;
12815
12815
  }
12816
12816
  }
12817
- const w = (B) => {
12818
- const I = r.find((F) => F.panelId === B.panelId);
12817
+ const w = (b) => {
12818
+ const I = r.find((F) => F.panelId === b.panelId);
12819
12819
  if (!I)
12820
- throw new Y(B);
12820
+ throw new Y(b);
12821
12821
  const D = Q();
12822
12822
  return new W(
12823
12823
  {
@@ -12825,22 +12825,22 @@ const zo = [
12825
12825
  id: D,
12826
12826
  svg: f,
12827
12827
  type: M.Illustration,
12828
- y: B.top,
12829
- x: B.left,
12830
- rotation: B.rotation,
12831
- width: B.width,
12832
- height: B.height,
12833
- layer: B.layer,
12834
- layerIndex: B.layerIndex,
12835
- immutable: B.immutable
12828
+ y: b.top,
12829
+ x: b.left,
12830
+ rotation: b.rotation,
12831
+ width: b.width,
12832
+ height: b.height,
12833
+ layer: b.layer,
12834
+ layerIndex: b.layerIndex,
12835
+ immutable: b.immutable
12836
12836
  },
12837
12837
  I
12838
12838
  );
12839
12839
  }, S = a.data.regions;
12840
12840
  try {
12841
12841
  return S.map(w);
12842
- } catch (B) {
12843
- return console.error(B), [];
12842
+ } catch (b) {
12843
+ return console.error(b), [];
12844
12844
  }
12845
12845
  }, Ho = async (r, t, e) => {
12846
12846
  const a = await Yn(e.data.module), n = t.data, i = (o, l) => {
@@ -13009,7 +13009,7 @@ const zo = [
13009
13009
  const u = /<svg.*?<\/svg>/s, h = A.match(u) || [], m = (h == null ? void 0 : h.length) > 0 ? h[0] : "", f = dt().parseFromString(m, "image/svg+xml").firstElementChild;
13010
13010
  if (!f)
13011
13011
  throw new Dt("Failed to read SVG.");
13012
- return pa(f), Bt().serializeToString(f);
13012
+ return pa(f), bt().serializeToString(f);
13013
13013
  };
13014
13014
  l.forEach((A) => {
13015
13015
  const u = r.find((m) => m.panelId === A.panelId);
@@ -13060,7 +13060,7 @@ const zo = [
13060
13060
  assetUrl: p,
13061
13061
  name: f.names.fullName.en
13062
13062
  };
13063
- })(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", i.text) : i.text) || "", u = Be(A, {
13063
+ })(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", i.text) : i.text) || "", u = be(A, {
13064
13064
  vertical: a.data.vertical,
13065
13065
  uppercase: a.data.uppercase
13066
13066
  }), h = async (p) => {
@@ -13101,7 +13101,7 @@ const zo = [
13101
13101
  d,
13102
13102
  p,
13103
13103
  [
13104
- Be(u, {
13104
+ be(u, {
13105
13105
  vertical: a.data.vertical,
13106
13106
  uppercase: a.data.uppercase
13107
13107
  })
@@ -13492,17 +13492,15 @@ class Ia {
13492
13492
  * @param targetExperiences Optionally filter the steps to only those in the given experiences.
13493
13493
  */
13494
13494
  getSharedSteps(t) {
13495
- return (t ?? this.bundle.getWorkflowExperiences()).flatMap(
13496
- (n) => n.getStepsConditionallyActive().filter((i) => {
13497
- var s;
13498
- return i.getOverrideGlobalPropertyConfiguration(this.property.type) ? !1 : (s = i.getRaw().globalPropertyAspectConfigurations) == null ? void 0 : s.some(
13499
- (o) => {
13500
- var l, c;
13501
- return o.globalPropertyConfigurationId === ((c = (l = this.bundle.getProductCollection()) == null ? void 0 : l.getResource().globalPropertyConfiguration) == null ? void 0 : c.id) && o.aspectName === this.property.name;
13502
- }
13503
- );
13504
- })
13505
- );
13495
+ return (t ?? this.bundle.getWorkflowExperiences()).flatMap((n) => n.getSteps().filter((s) => {
13496
+ var o;
13497
+ return s.getOverrideGlobalPropertyConfiguration(this.property.type) ? !1 : (o = s.getRaw().globalPropertyAspectConfigurations) == null ? void 0 : o.some(
13498
+ (l) => {
13499
+ var c, d;
13500
+ return l.globalPropertyConfigurationId === ((d = (c = this.bundle.getProductCollection()) == null ? void 0 : c.getResource().globalPropertyConfiguration) == null ? void 0 : d.id) && l.aspectName === this.property.name;
13501
+ }
13502
+ );
13503
+ }));
13506
13504
  }
13507
13505
  getStateValue() {
13508
13506
  return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
@@ -13521,7 +13519,7 @@ class il extends Ia {
13521
13519
  const t = await this.getImage();
13522
13520
  if (t != null && t.fileLink)
13523
13521
  if (t != null && t.fileLink.endsWith(".svg")) {
13524
- const a = await at(t == null ? void 0 : t.fileLink), n = await Ba(t == null ? void 0 : t.fileLink), i = n.width, s = n.height, o = await lt(a), l = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13522
+ const a = await at(t == null ? void 0 : t.fileLink), n = await ba(t == null ? void 0 : t.fileLink), i = n.width, s = n.height, o = await lt(a), l = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13525
13523
  (e = l == null ? void 0 : l.colors) == null || e.forEach((d) => {
13526
13524
  o.colors[d.key] = {
13527
13525
  browserValue: d.browserValue,
@@ -13842,6 +13840,7 @@ class Zn extends Ia {
13842
13840
  }
13843
13841
  async applyGlobalState(t) {
13844
13842
  var n, i;
13843
+ console.log(`LOG: applying global state for option ${this.property.name}`);
13845
13844
  const e = this.getStateValue();
13846
13845
  if (!e)
13847
13846
  return Promise.resolve();
@@ -13869,6 +13868,7 @@ class Ja extends Zn {
13869
13868
  }
13870
13869
  async applyGlobalState(t) {
13871
13870
  var i, s, o;
13871
+ console.log(`LOG: applying global state for color ${this.property.name}`);
13872
13872
  const e = this.getStateValue();
13873
13873
  if (!e)
13874
13874
  return Promise.resolve();
@@ -13877,10 +13877,12 @@ class Ja extends Zn {
13877
13877
  return Promise.resolve();
13878
13878
  await this.applyColorVariant(new st(a), t);
13879
13879
  const n = (o = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)) == null ? void 0 : o.customColor;
13880
- n && this.setCustomColor(n);
13880
+ console.log(`LOG: custom color ${n}`), n && this.setCustomColor(n);
13881
13881
  }
13882
13882
  async applyColorVariant(t, e, a) {
13883
- const i = this.getSharedSteps(e).map((s) => {
13883
+ const n = this.getSharedSteps(e);
13884
+ console.log(`LOG: applying color variant for ${n.length} shared steps`);
13885
+ const i = n.map((s) => {
13884
13886
  switch (s.getType()) {
13885
13887
  case P.Shape:
13886
13888
  return s.selectVariant(t);
@@ -14038,7 +14040,7 @@ class cl {
14038
14040
  var e, a;
14039
14041
  if (!this.globalPropertyState)
14040
14042
  throw new Error("Global property state not initialized");
14041
- const t = await b.getShadowGraphqlClient().mutate({
14043
+ const t = await B.getShadowGraphqlClient().mutate({
14042
14044
  mutation: Ls,
14043
14045
  variables: {
14044
14046
  id: this.globalPropertyState.id,
@@ -14082,7 +14084,7 @@ class cl {
14082
14084
  }
14083
14085
  async createGlobalPropertyState() {
14084
14086
  var e, a;
14085
- const t = await b.getShadowGraphqlClient().mutate({
14087
+ const t = await B.getShadowGraphqlClient().mutate({
14086
14088
  mutation: Us,
14087
14089
  variables: {
14088
14090
  bundleId: this.bundleId
@@ -14220,7 +14222,7 @@ class ul {
14220
14222
  async ensureIdsArePresent(t) {
14221
14223
  if (t.every((a) => this.internalMap.has(a)))
14222
14224
  return;
14223
- const e = await b.getShadowGraphqlClient().query({
14225
+ const e = await B.getShadowGraphqlClient().query({
14224
14226
  query: Al,
14225
14227
  errorPolicy: "all",
14226
14228
  variables: {
@@ -14308,7 +14310,7 @@ class tr {
14308
14310
  async fetchProducts(t) {
14309
14311
  if (this.fullFetched)
14310
14312
  return this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new de(a));
14311
- const e = await b.getShadowGraphqlClient().query({
14313
+ const e = await B.getShadowGraphqlClient().query({
14312
14314
  query: js,
14313
14315
  variables: {
14314
14316
  id: this.getId(),
@@ -14325,7 +14327,7 @@ class tr {
14325
14327
  */
14326
14328
  async filterProducts(t, e, a, n) {
14327
14329
  var l, c;
14328
- const i = await b.getShadowGraphqlClient().query({
14330
+ const i = await B.getShadowGraphqlClient().query({
14329
14331
  query: Hs,
14330
14332
  errorPolicy: "all",
14331
14333
  variables: {
@@ -14365,7 +14367,7 @@ class tr {
14365
14367
  items: d.slice(t, t + e)
14366
14368
  };
14367
14369
  }
14368
- const o = new AbortController(), { signal: l } = o, c = b.getShadowGraphqlClient().watchQuery({
14370
+ const o = new AbortController(), { signal: l } = o, c = B.getShadowGraphqlClient().watchQuery({
14369
14371
  query: qs,
14370
14372
  variables: {
14371
14373
  id: this.getId(),
@@ -14642,7 +14644,7 @@ const fl = v`
14642
14644
  }
14643
14645
  `, od = async (r) => {
14644
14646
  var e, a;
14645
- return (a = (e = (await b.getShadowGraphqlClient().query({
14647
+ return (a = (e = (await B.getShadowGraphqlClient().query({
14646
14648
  query: fl,
14647
14649
  errorPolicy: "all",
14648
14650
  variables: {
@@ -14730,17 +14732,18 @@ class Je {
14730
14732
  u([]);
14731
14733
  return;
14732
14734
  }
14733
- console.log("Setting default global variants."), this.globalPropertyHandleService.getHandles().then((m) => {
14734
- const g = m.map((p) => {
14735
- if (p.getType() === z.ColorOption || p.getType() === z.Option) {
14736
- const f = p;
14737
- if (this.globalPropertyStateManager.getGlobalPropertyState())
14738
- return f.initDefaultVariant();
14739
- console.log("Attempted to set global default variant before state was initialized.");
14735
+ console.log("Setting default global variants.");
14736
+ const m = this.globalPropertyStateManager.getGlobalPropertyState();
14737
+ m ? this.globalPropertyHandleService.getHandles().then((g) => {
14738
+ const p = g.map((f) => {
14739
+ if (f.getType() === z.ColorOption || f.getType() === z.Option) {
14740
+ const C = f;
14741
+ if (!m.aspects.find((S) => S.name === C.getName()))
14742
+ return C.initDefaultVariant();
14740
14743
  }
14741
14744
  });
14742
- Promise.all(g).then(u).catch(h);
14743
- });
14745
+ Promise.all(p).then(u).catch(h);
14746
+ }) : (console.log("Attempted to set global default variant before state was initialized."), u([]));
14744
14747
  });
14745
14748
  this.initializationPromise = Promise.all([
14746
14749
  this.loadExistingWorkflowExperiences(((A = e.transactions) == null ? void 0 : A.map((u) => u.id)) || [], {
@@ -14757,7 +14760,7 @@ class Je {
14757
14760
  }
14758
14761
  async generateQuoteId() {
14759
14762
  var a, n;
14760
- const e = (n = (a = (await b.getShadowGraphqlClient().mutate({
14763
+ const e = (n = (a = (await B.getShadowGraphqlClient().mutate({
14761
14764
  mutation: Sl,
14762
14765
  variables: {
14763
14766
  id: this.id
@@ -14769,7 +14772,7 @@ class Je {
14769
14772
  return this.quoteId = e, e || "";
14770
14773
  }
14771
14774
  async attachAddress(t, e, a, n, i, s) {
14772
- await b.getShadowGraphqlClient().mutate({
14775
+ await B.getShadowGraphqlClient().mutate({
14773
14776
  mutation: wl,
14774
14777
  variables: {
14775
14778
  bundleId: this.id,
@@ -14786,7 +14789,7 @@ class Je {
14786
14789
  });
14787
14790
  }
14788
14791
  async attachOrganization(t) {
14789
- await b.getShadowGraphqlClient().mutate({
14792
+ await B.getShadowGraphqlClient().mutate({
14790
14793
  mutation: yl,
14791
14794
  variables: {
14792
14795
  bundleId: this.id,
@@ -14961,7 +14964,7 @@ class Je {
14961
14964
  "Unable to add transaction to bundle - Already Exists: " + a.filter((o) => !!o).map((o) => o == null ? void 0 : o.getWorkflowManager().getTransaction().id).join(", ")
14962
14965
  );
14963
14966
  const n = N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), i = e.map((o) => n.get(o));
14964
- await b.getShadowGraphqlClient().mutate({
14967
+ await B.getShadowGraphqlClient().mutate({
14965
14968
  mutation: Xs,
14966
14969
  variables: {
14967
14970
  id: this.id,
@@ -14993,7 +14996,7 @@ class Je {
14993
14996
  ))
14994
14997
  throw new Error("Unable to add transaction to bundle - Already Exists!");
14995
14998
  const s = (N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(a);
14996
- await b.getShadowGraphqlClient().mutate({
14999
+ await B.getShadowGraphqlClient().mutate({
14997
15000
  mutation: _s,
14998
15001
  variables: {
14999
15002
  id: this.id,
@@ -15028,7 +15031,7 @@ class Je {
15028
15031
  const n = this.workflowExperiences.find(
15029
15032
  (i) => i.getWorkflowManager().getTransaction().id === e.id
15030
15033
  );
15031
- if (n.setBundle(void 0), this.previewService && n.getWorkflowManager().ejectFromPreviewService(), this.bundleStateManager.removeStateForTransaction(e.id), await b.getShadowGraphqlClient().mutate({
15034
+ if (n.setBundle(void 0), this.previewService && n.getWorkflowManager().ejectFromPreviewService(), this.bundleStateManager.removeStateForTransaction(e.id), await B.getShadowGraphqlClient().mutate({
15032
15035
  mutation: Zs,
15033
15036
  variables: {
15034
15037
  id: this.id,
@@ -15065,7 +15068,7 @@ class Je {
15065
15068
  );
15066
15069
  a.forEach((n) => n.setBundle(void 0)), [...this.workflowExperiences, ...a].forEach(
15067
15070
  (n) => n.checkForPriceBreakChanges()
15068
- ), this.previewService && a.forEach((n) => n.getWorkflowManager().ejectFromPreviewService()), t.forEach((n) => this.bundleStateManager.removeStateForTransaction(n.id)), await b.getShadowGraphqlClient().mutate({
15071
+ ), this.previewService && a.forEach((n) => n.getWorkflowManager().ejectFromPreviewService()), t.forEach((n) => this.bundleStateManager.removeStateForTransaction(n.id)), await B.getShadowGraphqlClient().mutate({
15069
15072
  mutation: to,
15070
15073
  variables: {
15071
15074
  id: this.id,
@@ -15128,7 +15131,7 @@ class Je {
15128
15131
  }
15129
15132
  async addStakeholder(t, e) {
15130
15133
  var i;
15131
- const a = await b.getShadowGraphqlClient().mutate({
15134
+ const a = await B.getShadowGraphqlClient().mutate({
15132
15135
  mutation: eo,
15133
15136
  variables: {
15134
15137
  id: this.id,
@@ -15146,7 +15149,7 @@ class Je {
15146
15149
  }
15147
15150
  async removeStakeholder(t) {
15148
15151
  var a;
15149
- if (!((a = (await b.getShadowGraphqlClient().mutate({
15152
+ if (!((a = (await B.getShadowGraphqlClient().mutate({
15150
15153
  mutation: ao,
15151
15154
  variables: {
15152
15155
  id: this.id,
@@ -15160,7 +15163,7 @@ class Je {
15160
15163
  }
15161
15164
  async updateStakeholders(t) {
15162
15165
  var n;
15163
- const e = await b.getShadowGraphqlClient().mutate({
15166
+ const e = await B.getShadowGraphqlClient().mutate({
15164
15167
  mutation: no,
15165
15168
  variables: {
15166
15169
  id: this.id,
@@ -15176,7 +15179,7 @@ class Je {
15176
15179
  this.storeStakeholderCustomers(a);
15177
15180
  }
15178
15181
  async getAllStakeholders() {
15179
- const t = await b.getShadowGraphqlClient().query({
15182
+ const t = await B.getShadowGraphqlClient().query({
15180
15183
  query: qa,
15181
15184
  errorPolicy: "all",
15182
15185
  fetchPolicy: "no-cache",
@@ -15193,7 +15196,7 @@ class Je {
15193
15196
  return this.storeStakeholderCustomers(e), e;
15194
15197
  }
15195
15198
  async getCurrentStakeholder() {
15196
- const t = await b.getShadowGraphqlClient().query({
15199
+ const t = await B.getShadowGraphqlClient().query({
15197
15200
  query: qa,
15198
15201
  errorPolicy: "all",
15199
15202
  fetchPolicy: "no-cache",
@@ -15215,7 +15218,7 @@ class Je {
15215
15218
  }
15216
15219
  async finish(t, e) {
15217
15220
  if (this.completed)
15218
- return await b.getShadowGraphqlClient().mutate({
15221
+ return await B.getShadowGraphqlClient().mutate({
15219
15222
  mutation: lo,
15220
15223
  variables: {
15221
15224
  bundleId: this.id
@@ -15277,7 +15280,7 @@ class Je {
15277
15280
  return this.bundleStateManager.activateWorkflowExperienceTransform(t, e), this.updateBundle();
15278
15281
  }
15279
15282
  async assignGlobalPropertyConfiguration(t) {
15280
- await b.getShadowGraphqlClient().mutate({
15283
+ await B.getShadowGraphqlClient().mutate({
15281
15284
  mutation: so,
15282
15285
  variables: {
15283
15286
  bundleId: this.id,
@@ -15290,7 +15293,7 @@ class Je {
15290
15293
  }
15291
15294
  async assignProductCollection(t) {
15292
15295
  var a, n;
15293
- const e = await b.getShadowGraphqlClient().mutate({
15296
+ const e = await B.getShadowGraphqlClient().mutate({
15294
15297
  mutation: io(
15295
15298
  ((a = this.globalPropertyStateManager.getBundleOptions()) == null ? void 0 : a.eagerFetchProducts) ?? !1
15296
15299
  ),
@@ -15348,7 +15351,7 @@ class Je {
15348
15351
  }
15349
15352
  async updateBundle() {
15350
15353
  var e;
15351
- if (!((e = (await b.getShadowGraphqlClient().mutate({
15354
+ if (!((e = (await B.getShadowGraphqlClient().mutate({
15352
15355
  mutation: Ks,
15353
15356
  variables: {
15354
15357
  id: this.id,
@@ -15365,7 +15368,7 @@ class Je {
15365
15368
  throw new Error("Bundle not found!");
15366
15369
  }
15367
15370
  async updateTransactionOrder() {
15368
- await b.getShadowGraphqlClient().mutate({
15371
+ await B.getShadowGraphqlClient().mutate({
15369
15372
  mutation: ro,
15370
15373
  variables: {
15371
15374
  id: this.id,
@@ -15406,7 +15409,7 @@ class Je {
15406
15409
  return this.workflowViewerAmendLink;
15407
15410
  }
15408
15411
  async approve(t, e) {
15409
- await b.getShadowGraphqlClient().mutate({
15412
+ await B.getShadowGraphqlClient().mutate({
15410
15413
  mutation: co,
15411
15414
  errorPolicy: "all",
15412
15415
  fetchPolicy: "no-cache",
@@ -15418,7 +15421,7 @@ class Je {
15418
15421
  });
15419
15422
  }
15420
15423
  async reject(t, e) {
15421
- await b.getShadowGraphqlClient().mutate({
15424
+ await B.getShadowGraphqlClient().mutate({
15422
15425
  mutation: Ao,
15423
15426
  errorPolicy: "all",
15424
15427
  fetchPolicy: "no-cache",
@@ -15454,7 +15457,7 @@ class El {
15454
15457
  */
15455
15458
  async execute(t, e, a) {
15456
15459
  var A, u, h;
15457
- const i = (u = (A = (await b.getShadowGraphqlClient().mutate({
15460
+ const i = (u = (A = (await B.getShadowGraphqlClient().mutate({
15458
15461
  mutation: vl,
15459
15462
  variables: {
15460
15463
  processFlowId: t,
@@ -15470,7 +15473,7 @@ class El {
15470
15473
  }
15471
15474
  let o = !1, l = 0, c, d;
15472
15475
  for (; !o; ) {
15473
- c = await b.getShadowGraphqlClient().query({
15476
+ c = await B.getShadowGraphqlClient().query({
15474
15477
  query: v`
15475
15478
  query getProcessFlowExecution($ids: [String]!) {
15476
15479
  processExecutions(ids: $ids) {
@@ -15497,7 +15500,7 @@ class El {
15497
15500
  "Execution has failed to complete. See Automation > FLows in Flight on partner account on SpiffCommerce Hub."
15498
15501
  );
15499
15502
  if (m.completedAt) {
15500
- o = !0, d = new Bl(m);
15503
+ o = !0, d = new bl(m);
15501
15504
  break;
15502
15505
  }
15503
15506
  l += 1;
@@ -15511,7 +15514,7 @@ class El {
15511
15514
  return Promise.resolve(d);
15512
15515
  }
15513
15516
  }
15514
- class Bl {
15517
+ class bl {
15515
15518
  constructor(t) {
15516
15519
  this.execution = t;
15517
15520
  }
@@ -15596,7 +15599,7 @@ class Pa {
15596
15599
  return t.startsWith("[") ? JSON.stringify(JSON.parse(t)) : t;
15597
15600
  }
15598
15601
  }
15599
- var bl = /* @__PURE__ */ ((r) => (r.Transaction = "Transaction", r.Bundle = "Bundle", r.Product = "Product", r.Variant = "Variant", r.Option = "Option", r.LineItem = "LineItem", r.Asset = "Asset", r))(bl || {});
15602
+ var Bl = /* @__PURE__ */ ((r) => (r.Transaction = "Transaction", r.Bundle = "Bundle", r.Product = "Product", r.Variant = "Variant", r.Option = "Option", r.LineItem = "LineItem", r.Asset = "Asset", r))(Bl || {});
15600
15603
  class ld extends Pa {
15601
15604
  constructor(t) {
15602
15605
  super(`"${t}"`);
@@ -15769,7 +15772,7 @@ const Dl = v`
15769
15772
  }
15770
15773
  `;
15771
15774
  class Fl {
15772
- constructor(t, e = b.getShadowGraphqlClient.bind(b)) {
15775
+ constructor(t, e = B.getShadowGraphqlClient.bind(B)) {
15773
15776
  this.options = t, this.client = e;
15774
15777
  }
15775
15778
  query(t) {
@@ -15927,7 +15930,7 @@ class Ml {
15927
15930
  }
15928
15931
  const Tl = async (r, t) => {
15929
15932
  var n;
15930
- const e = await b.getShadowGraphqlClient().query({
15933
+ const e = await B.getShadowGraphqlClient().query({
15931
15934
  query: Ti(((n = t == null ? void 0 : t.assets) == null ? void 0 : n.metadata) || !1),
15932
15935
  errorPolicy: "all",
15933
15936
  variables: {
@@ -15984,14 +15987,14 @@ class Ad {
15984
15987
  constructor(t) {
15985
15988
  this.activeIntegration = void 0, this.updateTransactionState = async (e) => {
15986
15989
  try {
15987
- return b.getShadowGraphqlClient().mutate({
15990
+ return B.getShadowGraphqlClient().mutate({
15988
15991
  ...e,
15989
15992
  mutation: Si
15990
15993
  });
15991
15994
  } catch (a) {
15992
15995
  throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
15993
15996
  }
15994
- }, this.options = t, this.options.applicationKey && $r(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 28.0.0"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15997
+ }, this.options = t, this.options.applicationKey && $r(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 28.0.1-beta.cf9847f6-7f99-59a1-a7ce-5381b1ac1990"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15995
15998
  }
15996
15999
  configure(t) {
15997
16000
  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 && Lr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
@@ -16009,7 +16012,7 @@ class Ad {
16009
16012
  return new El();
16010
16013
  }
16011
16014
  async getCurrencyContext(t) {
16012
- const a = (await this.getIntegration()).partner.currencyCode, i = await b.getShadowGraphqlClient().query({
16015
+ const a = (await this.getIntegration()).partner.currencyCode, i = await B.getShadowGraphqlClient().query({
16013
16016
  query: Vi,
16014
16017
  errorPolicy: "all",
16015
16018
  fetchPolicy: "cache-first",
@@ -16077,7 +16080,7 @@ class Ad {
16077
16080
  */
16078
16081
  async authenticateTransactionFromLocalStorage(t) {
16079
16082
  var d, A, u, h, m, g;
16080
- const e = b.getShadowGraphqlClient(), a = await e.query({
16083
+ const e = B.getShadowGraphqlClient(), a = await e.query({
16081
16084
  query: Ni,
16082
16085
  errorPolicy: "all",
16083
16086
  fetchPolicy: "no-cache",
@@ -16137,7 +16140,7 @@ class Ad {
16137
16140
  e != null && e.has(t) && (e.delete(t), N.setMap("transactionCustomerIds", e));
16138
16141
  }
16139
16142
  async customerHasBundleTemplates(t) {
16140
- const n = (await b.getShadowGraphqlClient().query({
16143
+ const n = (await B.getShadowGraphqlClient().query({
16141
16144
  query: ue,
16142
16145
  errorPolicy: "all",
16143
16146
  fetchPolicy: "no-cache",
@@ -16161,7 +16164,7 @@ class Ad {
16161
16164
  async getOrCreateCustomer(t) {
16162
16165
  var s;
16163
16166
  this.customer = void 0;
16164
- const e = b.getShadowGraphqlClient(), n = (await e.query({
16167
+ const e = B.getShadowGraphqlClient(), n = (await e.query({
16165
16168
  query: ue,
16166
16169
  errorPolicy: "all",
16167
16170
  fetchPolicy: "no-cache",
@@ -16214,7 +16217,7 @@ class Ad {
16214
16217
  else
16215
16218
  return this.logOut(), console.error("Failed to refresh tokens."), !1;
16216
16219
  }
16217
- const o = (await b.getShadowGraphqlClient().query({
16220
+ const o = (await B.getShadowGraphqlClient().query({
16218
16221
  query: ue,
16219
16222
  errorPolicy: "all",
16220
16223
  fetchPolicy: "no-cache",
@@ -16228,7 +16231,7 @@ class Ad {
16228
16231
  * Generate an email code to allow logging in as a Spiff user.
16229
16232
  */
16230
16233
  async generateVerificationCode(t) {
16231
- await b.getShadowGraphqlClient().mutate({
16234
+ await B.getShadowGraphqlClient().mutate({
16232
16235
  mutation: Pl,
16233
16236
  variables: {
16234
16237
  emailAddress: t
@@ -16243,7 +16246,7 @@ class Ad {
16243
16246
  const a = (await this.getIntegration()).partner.id || "", n = await Lt.verifyCode(t, e, a);
16244
16247
  if (n != null && n.AuthenticationResult) {
16245
16248
  localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), localStorage.setItem("cognito-tokens", JSON.stringify(n.AuthenticationResult)), localStorage.setItem("cognito-email", t);
16246
- const s = (await b.getShadowGraphqlClient().query({
16249
+ const s = (await B.getShadowGraphqlClient().query({
16247
16250
  query: ue,
16248
16251
  errorPolicy: "all",
16249
16252
  fetchPolicy: "no-cache",
@@ -16284,7 +16287,7 @@ class Ad {
16284
16287
  var e;
16285
16288
  if (!((e = this.customer) != null && e.id))
16286
16289
  throw new Error("Customer must be logged in before calling this function.");
16287
- return (await b.getShadowGraphqlClient().query({
16290
+ return (await B.getShadowGraphqlClient().query({
16288
16291
  query: Dl,
16289
16292
  variables: {
16290
16293
  id: this.customer.id
@@ -16297,7 +16300,7 @@ class Ad {
16297
16300
  */
16298
16301
  async getNewBundle(t, e, a) {
16299
16302
  var c, d, A, u, h;
16300
- const i = (A = (await b.getShadowGraphqlClient().mutate({
16303
+ const i = (A = (await B.getShadowGraphqlClient().mutate({
16301
16304
  mutation: Ys(((d = (c = a == null ? void 0 : a.graphql) == null ? void 0 : c.productCollection) == null ? void 0 : d.eagerFetchProducts) || !1),
16302
16305
  variables: {
16303
16306
  collectionId: t,
@@ -16327,7 +16330,7 @@ class Ad {
16327
16330
  * @returns A bundle to be used for grouping and operating on large amounts of workflow experiences.
16328
16331
  */
16329
16332
  async getExistingBundle(t, e, a, n) {
16330
- var h, m, g, p, f, C, w, S, y, E, B;
16333
+ var h, m, g, p, f, C, w, S, y, E, b;
16331
16334
  const i = N.getMap("bundleOwnerIds"), s = i == null ? void 0 : i.get(t), o = {};
16332
16335
  try {
16333
16336
  const I = await this.loggedInBearerToken();
@@ -16340,7 +16343,7 @@ class Ad {
16340
16343
  bundleOwnerId: s,
16341
16344
  ...o,
16342
16345
  ...(m = n == null ? void 0 : n.graphql) == null ? void 0 : m.additionalHeaders
16343
- }, c = await b.getShadowGraphqlClient().query({
16346
+ }, c = await B.getShadowGraphqlClient().query({
16344
16347
  query: Gs(((p = (g = n == null ? void 0 : n.graphql) == null ? void 0 : g.productCollection) == null ? void 0 : p.eagerFetchProducts) || !1),
16345
16348
  variables: {
16346
16349
  id: t
@@ -16356,7 +16359,7 @@ class Ad {
16356
16359
  A.set(d.id, d.partner.id), N.setMap("bundlePartnerIds", A);
16357
16360
  const u = new Je(this, d, e, a, s, {
16358
16361
  additionalHeaders: (y = n == null ? void 0 : n.graphql) == null ? void 0 : y.additionalHeaders,
16359
- eagerFetchProducts: (B = (E = n == null ? void 0 : n.graphql) == null ? void 0 : E.productCollection) == null ? void 0 : B.eagerFetchProducts,
16362
+ eagerFetchProducts: (b = (E = n == null ? void 0 : n.graphql) == null ? void 0 : E.productCollection) == null ? void 0 : b.eagerFetchProducts,
16360
16363
  existingGlobalPropertyState: c.data.globalPropertyState,
16361
16364
  readonly: n == null ? void 0 : n.readonly
16362
16365
  });
@@ -16375,14 +16378,14 @@ class Ad {
16375
16378
  const C = await this.loggedInBearerToken();
16376
16379
  s.Authorization = `Bearer ${C}`;
16377
16380
  } catch {
16378
- const S = ((h = Object.entries(localStorage).find(([E, B]) => E.startsWith("CognitoIdentityServiceProvider") && E.endsWith("idToken"))) == null ? void 0 : h[0]) || "", y = localStorage.getItem(S);
16381
+ const S = ((h = Object.entries(localStorage).find(([E, b]) => E.startsWith("CognitoIdentityServiceProvider") && E.endsWith("idToken"))) == null ? void 0 : h[0]) || "", y = localStorage.getItem(S);
16379
16382
  y && !Wt(y) && (s.Authorization = `Bearer ${y}`);
16380
16383
  }
16381
16384
  const o = {
16382
16385
  bundleOwnerId: i,
16383
16386
  ...s,
16384
16387
  ...(m = n == null ? void 0 : n.graphql) == null ? void 0 : m.additionalHeaders
16385
- }, c = (f = (await b.getShadowGraphqlClient().mutate({
16388
+ }, c = (f = (await B.getShadowGraphqlClient().mutate({
16386
16389
  mutation: Js(((p = (g = n == null ? void 0 : n.graphql) == null ? void 0 : g.productCollection) == null ? void 0 : p.eagerFetchProducts) || !1),
16387
16390
  variables: {
16388
16391
  id: t,
@@ -16424,7 +16427,7 @@ class Ad {
16424
16427
  if (!((i = this.customer) != null && i.id))
16425
16428
  throw new Error("Customer not authenticated.");
16426
16429
  const { includeMetadata: e, ...a } = t;
16427
- return (await b.getShadowGraphqlClient().query({
16430
+ return (await B.getShadowGraphqlClient().query({
16428
16431
  query: oo(e ?? !1),
16429
16432
  variables: {
16430
16433
  ...a,
@@ -16441,7 +16444,7 @@ class Ad {
16441
16444
  var i;
16442
16445
  if (!this.customer)
16443
16446
  throw new Error("Customer not authenticated.");
16444
- const t = await b.getShadowGraphqlClient().query({
16447
+ const t = await B.getShadowGraphqlClient().query({
16445
16448
  query: Ws,
16446
16449
  variables: {
16447
16450
  id: this.customer.id
@@ -16478,20 +16481,20 @@ class Ad {
16478
16481
  async getWorkflowExperiences(t, e) {
16479
16482
  if (t.length === 0)
16480
16483
  throw new ut("No options provided!");
16481
- const a = b.getShadowGraphqlClient(), n = async (y) => {
16484
+ const a = B.getShadowGraphqlClient(), n = async (y) => {
16482
16485
  var D, F, k;
16483
16486
  if (y.length === 0)
16484
16487
  return [];
16485
- const E = y.map((T) => T.option.transactionId), B = await a.query({
16488
+ const E = y.map((T) => T.option.transactionId), b = await a.query({
16486
16489
  query: yi,
16487
16490
  variables: {
16488
16491
  ids: E
16489
16492
  },
16490
16493
  errorPolicy: "all",
16491
16494
  fetchPolicy: "no-cache"
16492
- }), I = B.data.transactions;
16495
+ }), I = b.data.transactions;
16493
16496
  if (I.length !== y.length) {
16494
- const T = ((F = (D = B.errors) == null ? void 0 : D[0]) == null ? void 0 : F.message) || "Unknown error";
16497
+ const T = ((F = (D = b.errors) == null ? void 0 : D[0]) == null ? void 0 : F.message) || "Unknown error";
16495
16498
  throw new ut(`Not all transactions were found: ${T}`);
16496
16499
  }
16497
16500
  return !this.activeIntegration && ((k = I[0].integrationProduct) != null && k.integration) && (this.activeIntegration = Promise.resolve(I[0].integrationProduct.integration)), I.map((T, nt) => {
@@ -16523,12 +16526,12 @@ class Ad {
16523
16526
  },
16524
16527
  errorPolicy: "all",
16525
16528
  fetchPolicy: "no-cache"
16526
- }), B = (I = E.data) == null ? void 0 : I.transactionCreateMany;
16527
- if (!B || B.length === 0) {
16529
+ }), b = (I = E.data) == null ? void 0 : I.transactionCreateMany;
16530
+ if (!b || b.length === 0) {
16528
16531
  const k = ((F = (D = E.errors) == null ? void 0 : D[0]) == null ? void 0 : F.message) || "Unknown error";
16529
16532
  throw new ut(`Failed to create transactions: ${k}`);
16530
16533
  }
16531
- return B.map((k, T) => ({
16534
+ return b.map((k, T) => ({
16532
16535
  transaction: k,
16533
16536
  workflowId: k.workflowId,
16534
16537
  readOnly: !1,
@@ -16541,7 +16544,7 @@ class Ad {
16541
16544
  ...d.map(i)
16542
16545
  ])).flat(), u = [...new Set(A.map((y) => y.workflowId))], h = await ar(u, e), m = new Map(h.map((y) => [y.id, y])), g = N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), p = A.map(async (y) => {
16543
16546
  var tt;
16544
- const { transaction: E, workflowId: B, readOnly: I, index: D } = y, F = m.get(B), k = t[D];
16547
+ const { transaction: E, workflowId: b, readOnly: I, index: D } = y, F = m.get(b), k = t[D];
16545
16548
  !g.get(E.id) && E.transactionOwnerId && g.set(E.id, E.transactionOwnerId);
16546
16549
  const T = g.get(E.id) || void 0, nt = new Fl({
16547
16550
  onMutate: () => ({ context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId } }),
@@ -16553,18 +16556,18 @@ class Ad {
16553
16556
  singleVariantsRenderable: (tt = k == null ? void 0 : k.workflowConfiguration) == null ? void 0 : tt.singleVariantsRenderable,
16554
16557
  stateMutationFunc: I ? async () => {
16555
16558
  throw new G("State mutation is forbidden in read only mode!");
16556
- } : async (Z) => this.updateTransactionState({
16557
- ...Z,
16559
+ } : async (X) => (console.log(`LOG: updating transaction with options ${JSON.stringify(X, null, 2)}`), console.trace(), this.updateTransactionState({
16560
+ ...X,
16558
16561
  context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId }
16559
- }),
16562
+ })),
16560
16563
  graphQlClient: () => nt,
16561
16564
  readOnly: I,
16562
16565
  workflow: F,
16563
16566
  isReloadedTransaction: k.type === "transaction"
16564
16567
  };
16565
16568
  if (!I && k.workflowState) {
16566
- const Z = JSON.parse(k.workflowState);
16567
- R.layouts = Object.values(Z.layouts || {}).map((Nt) => Nt.layout), await cs(Z), R.reloadedState = Z;
16569
+ const X = JSON.parse(k.workflowState);
16570
+ R.layouts = Object.values(X.layouts || {}).map((Nt) => Nt.layout), await cs(X), R.reloadedState = X;
16568
16571
  } else
16569
16572
  R.layouts = Rl(
16570
16573
  R.transaction,
@@ -16576,8 +16579,8 @@ class Ad {
16576
16579
  }), f = await Promise.all(p);
16577
16580
  N.setMap("transactionOwnerIds", g);
16578
16581
  const w = f.sort((y, E) => y.index - E.index).map(async (y) => {
16579
- const { experienceOptions: E, options: B } = y, I = new Vo(this, E);
16580
- return await I.getWorkflowManager().getInitializationPromise(), B.type !== "transaction" && this.customer && await I.attachCustomerDetails({ email: this.customer.emailAddress }), I;
16582
+ const { experienceOptions: E, options: b } = y, I = new Vo(this, E);
16583
+ return await I.getWorkflowManager().getInitializationPromise(), b.type !== "transaction" && this.customer && await I.attachCustomerDetails({ email: this.customer.emailAddress }), I;
16581
16584
  }), S = await Promise.all(w);
16582
16585
  return S.forEach((y) => y.getWorkflowManager().setWorkflowStateSyncEnabled(!0)), S;
16583
16586
  }
@@ -16587,8 +16590,8 @@ class Ad {
16587
16590
  }
16588
16591
  async getIntegrationProductById(t, e) {
16589
16592
  var s, o;
16590
- const i = (s = (await b.getShadowGraphqlClient().query({
16591
- query: bi(e),
16593
+ const i = (s = (await B.getShadowGraphqlClient().query({
16594
+ query: Bi(e),
16592
16595
  variables: {
16593
16596
  ids: [t]
16594
16597
  },
@@ -16601,7 +16604,7 @@ class Ad {
16601
16604
  }
16602
16605
  async getIntegrationProductFromExternalIds(t, e, a) {
16603
16606
  var o;
16604
- const s = (o = (await b.getShadowGraphqlClient().query({
16607
+ const s = (o = (await B.getShadowGraphqlClient().query({
16605
16608
  query: Ii(a),
16606
16609
  variables: {
16607
16610
  externalProductId: e,
@@ -16618,8 +16621,8 @@ class Ad {
16618
16621
  return t.type === "integration" ? this.getIntegrationProductById(t.integrationProductId) : this.getIntegrationProductFromExternalIds(t.externalIntegrationId, t.externalProductId);
16619
16622
  }
16620
16623
  async getShareActionsForTransaction(t) {
16621
- const a = (N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(t) || void 0, n = await b.getShadowGraphqlClient().query({
16622
- query: Bi,
16624
+ const a = (N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(t) || void 0, n = await B.getShadowGraphqlClient().query({
16625
+ query: bi,
16623
16626
  errorPolicy: "all",
16624
16627
  fetchPolicy: "no-cache",
16625
16628
  variables: {
@@ -16634,7 +16637,7 @@ class Ad {
16634
16637
  return n.data.transactions[0].transactionShareActions;
16635
16638
  }
16636
16639
  async placeOrder(t) {
16637
- const e = await b.getShadowGraphqlClient().mutate({
16640
+ const e = await B.getShadowGraphqlClient().mutate({
16638
16641
  mutation: Li,
16639
16642
  variables: {
16640
16643
  orderItems: t
@@ -16650,7 +16653,7 @@ class Ad {
16650
16653
  };
16651
16654
  }
16652
16655
  }
16653
- const Ol = async (r, t) => (await b.getShadowGraphqlClient().query({
16656
+ const Ol = async (r, t) => (await B.getShadowGraphqlClient().query({
16654
16657
  query: Oi,
16655
16658
  errorPolicy: "all",
16656
16659
  fetchPolicy: "no-cache",
@@ -16663,7 +16666,7 @@ const Ol = async (r, t) => (await b.getShadowGraphqlClient().query({
16663
16666
  themeConfigurationId: t
16664
16667
  }
16665
16668
  })).data.currentIntegration, ud = async (r) => {
16666
- const e = await b.getShadowGraphqlClient().query({
16669
+ const e = await B.getShadowGraphqlClient().query({
16667
16670
  query: Ei,
16668
16671
  errorPolicy: "all",
16669
16672
  fetchPolicy: "network-only",
@@ -16675,7 +16678,7 @@ const Ol = async (r, t) => (await b.getShadowGraphqlClient().query({
16675
16678
  return e.data.transactions[0];
16676
16679
  }, hd = async (r, t) => {
16677
16680
  var a;
16678
- return (a = (await b.getShadowGraphqlClient().query({
16681
+ return (a = (await B.getShadowGraphqlClient().query({
16679
16682
  query: Ri,
16680
16683
  errorPolicy: "all",
16681
16684
  variables: {
@@ -16685,7 +16688,7 @@ const Ol = async (r, t) => (await b.getShadowGraphqlClient().query({
16685
16688
  })).data) == null ? void 0 : a.marketplaceThemeInstallConfiguration;
16686
16689
  }, md = async (r) => {
16687
16690
  var e, a, n;
16688
- return (n = (a = (e = (await b.getShadowGraphqlClient().query({
16691
+ return (n = (a = (e = (await B.getShadowGraphqlClient().query({
16689
16692
  query: Ui,
16690
16693
  errorPolicy: "all",
16691
16694
  variables: {
@@ -16694,7 +16697,7 @@ const Ol = async (r, t) => (await b.getShadowGraphqlClient().query({
16694
16697
  })).data) == null ? void 0 : e.bundles) == null ? void 0 : a[0]) == null ? void 0 : n.marketplaceThemeInstallConfiguration;
16695
16698
  }, gd = async (r) => {
16696
16699
  var e, a, n;
16697
- return (n = (a = (e = (await b.getShadowGraphqlClient().query({
16700
+ return (n = (a = (e = (await B.getShadowGraphqlClient().query({
16698
16701
  query: $i,
16699
16702
  errorPolicy: "all",
16700
16703
  variables: {
@@ -17394,7 +17397,7 @@ const zl = v`
17394
17397
  total
17395
17398
  }
17396
17399
  }
17397
- `, fd = async (r, t, e) => await b.getShadowGraphqlClient().mutate({
17400
+ `, fd = async (r, t, e) => await B.getShadowGraphqlClient().mutate({
17398
17401
  mutation: ql,
17399
17402
  errorPolicy: "all",
17400
17403
  variables: {
@@ -17402,34 +17405,34 @@ const zl = v`
17402
17405
  name: t
17403
17406
  },
17404
17407
  context: e
17405
- }), Cd = async (r, t) => await b.getShadowGraphqlClient().mutate({
17408
+ }), Cd = async (r, t) => await B.getShadowGraphqlClient().mutate({
17406
17409
  mutation: Gl,
17407
17410
  errorPolicy: "all",
17408
17411
  variables: {
17409
17412
  id: r,
17410
17413
  name: t
17411
17414
  }
17412
- }), wd = async (r, t) => await b.getShadowGraphqlClient().mutate({
17415
+ }), wd = async (r, t) => await B.getShadowGraphqlClient().mutate({
17413
17416
  mutation: Yl,
17414
17417
  errorPolicy: "all",
17415
17418
  variables: {
17416
17419
  id: r,
17417
17420
  template: t
17418
17421
  }
17419
- }), yd = async (r, t) => await b.getShadowGraphqlClient().mutate({
17422
+ }), yd = async (r, t) => await B.getShadowGraphqlClient().mutate({
17420
17423
  mutation: Wl,
17421
17424
  errorPolicy: "all",
17422
17425
  variables: {
17423
17426
  id: r,
17424
17427
  template: t
17425
17428
  }
17426
- }), Sd = async (r) => (await b.getShadowGraphqlClient().query({
17429
+ }), Sd = async (r) => (await B.getShadowGraphqlClient().query({
17427
17430
  query: zl,
17428
17431
  errorPolicy: "all",
17429
17432
  variables: {
17430
17433
  email: r
17431
17434
  }
17432
- })).data.customer, vd = async (r, t, e) => await b.getShadowGraphqlClient().query({
17435
+ })).data.customer, vd = async (r, t, e) => await B.getShadowGraphqlClient().query({
17433
17436
  query: jl,
17434
17437
  errorPolicy: "all",
17435
17438
  fetchPolicy: "no-cache",
@@ -17438,7 +17441,7 @@ const zl = v`
17438
17441
  offset: e,
17439
17442
  limit: t
17440
17443
  }
17441
- }), Ed = async (r, t) => await b.getShadowGraphqlClient().query({
17444
+ }), Ed = async (r, t) => await B.getShadowGraphqlClient().query({
17442
17445
  query: Hl,
17443
17446
  errorPolicy: "all",
17444
17447
  fetchPolicy: "no-cache",
@@ -17446,9 +17449,9 @@ const zl = v`
17446
17449
  id: r
17447
17450
  },
17448
17451
  context: t
17449
- }), Bd = async (r, t, e) => {
17452
+ }), bd = async (r, t, e) => {
17450
17453
  var n;
17451
- const a = await b.getShadowGraphqlClient().query({
17454
+ const a = await B.getShadowGraphqlClient().query({
17452
17455
  query: Da,
17453
17456
  errorPolicy: "all",
17454
17457
  fetchPolicy: "no-cache",
@@ -17470,9 +17473,9 @@ const zl = v`
17470
17473
  }
17471
17474
  });
17472
17475
  return ((n = a == null ? void 0 : a.data.customerTransactionsFeed) == null ? void 0 : n.items) || [];
17473
- }, bd = async (r, t, e) => {
17476
+ }, Bd = async (r, t, e) => {
17474
17477
  var n;
17475
- const a = await b.getShadowGraphqlClient().query({
17478
+ const a = await B.getShadowGraphqlClient().query({
17476
17479
  query: Da,
17477
17480
  errorPolicy: "all",
17478
17481
  fetchPolicy: "no-cache",
@@ -17496,7 +17499,7 @@ const zl = v`
17496
17499
  return ((n = a == null ? void 0 : a.data.customerTransactionsFeed) == null ? void 0 : n.items) || [];
17497
17500
  }, Id = async (r, t, e) => {
17498
17501
  var n;
17499
- const a = await b.getShadowGraphqlClient().query({
17502
+ const a = await B.getShadowGraphqlClient().query({
17500
17503
  query: Da,
17501
17504
  errorPolicy: "all",
17502
17505
  fetchPolicy: "no-cache",
@@ -17516,7 +17519,7 @@ const zl = v`
17516
17519
  return ((n = a == null ? void 0 : a.data.customerTransactionsFeed) == null ? void 0 : n.items) || [];
17517
17520
  }, Pd = async (r, t, e) => {
17518
17521
  var n;
17519
- const a = await b.getShadowGraphqlClient().query({
17522
+ const a = await B.getShadowGraphqlClient().query({
17520
17523
  query: Jl,
17521
17524
  errorPolicy: "all",
17522
17525
  fetchPolicy: "no-cache",
@@ -17683,7 +17686,7 @@ const Dd = async (r) => {
17683
17686
  const t = r.map((a) => {
17684
17687
  var n;
17685
17688
  return (n = a.getWorkflowManager().getTransaction().recipient) == null ? void 0 : n.id;
17686
- }).filter((a) => !!a), e = await b.getShadowGraphqlClient().query({
17689
+ }).filter((a) => !!a), e = await B.getShadowGraphqlClient().query({
17687
17690
  query: ec,
17688
17691
  errorPolicy: "all",
17689
17692
  fetchPolicy: "network-only",
@@ -17699,7 +17702,7 @@ const Dd = async (r) => {
17699
17702
  });
17700
17703
  }, Fd = async (r) => {
17701
17704
  var e;
17702
- return (e = (await b.getShadowGraphqlClient().query({
17705
+ return (e = (await B.getShadowGraphqlClient().query({
17703
17706
  query: tc,
17704
17707
  errorPolicy: "all",
17705
17708
  fetchPolicy: "network-only",
@@ -17709,7 +17712,7 @@ const Dd = async (r) => {
17709
17712
  })).data) == null ? void 0 : e.addressValidationJobs;
17710
17713
  }, xd = async (r) => {
17711
17714
  var e, a;
17712
- return (e = r.getWorkflowManager().getTransaction().recipient) != null && e.id ? (a = (await b.getShadowGraphqlClient().mutate({
17715
+ return (e = r.getWorkflowManager().getTransaction().recipient) != null && e.id ? (a = (await B.getShadowGraphqlClient().mutate({
17713
17716
  mutation: ac,
17714
17717
  errorPolicy: "all",
17715
17718
  fetchPolicy: "network-only",
@@ -17721,7 +17724,7 @@ const Dd = async (r) => {
17721
17724
  const t = r.map((a) => {
17722
17725
  var n;
17723
17726
  return (n = a.getWorkflowManager().getTransaction().recipient) == null ? void 0 : n.id;
17724
- }).filter((a) => !!a), e = await b.getShadowGraphqlClient().mutate({
17727
+ }).filter((a) => !!a), e = await B.getShadowGraphqlClient().mutate({
17725
17728
  mutation: nc,
17726
17729
  errorPolicy: "all",
17727
17730
  fetchPolicy: "network-only",
@@ -17762,7 +17765,7 @@ export {
17762
17765
  Po as DigitalContentStepHandle,
17763
17766
  il as FileUploadGlobalPropertyHandle,
17764
17767
  Ae as FlowExecutionNodeResult,
17765
- Bl as FlowExecutionResult,
17768
+ bl as FlowExecutionResult,
17766
17769
  El as FlowService,
17767
17770
  us as FontAlignmentCommand,
17768
17771
  ds as FontColorCommand,
@@ -17777,7 +17780,7 @@ export {
17777
17780
  Re as InformationMessageType,
17778
17781
  Io as InformationStepHandle,
17779
17782
  Ka as IntegrationProduct,
17780
- Br as IntegrationType,
17783
+ br as IntegrationType,
17781
17784
  Jc as LayoutElementFactory,
17782
17785
  M as LayoutElementType,
17783
17786
  Y as LayoutNotFoundError,
@@ -17789,12 +17792,12 @@ export {
17789
17792
  Do as ModuleStepHandle,
17790
17793
  Kc as MoveCommand,
17791
17794
  er as ObjectInput,
17792
- bl as ObjectInputType,
17795
+ Bl as ObjectInputType,
17793
17796
  Zn as OptionGlobalPropertyHandle,
17794
17797
  ye as OptionNotFoundError,
17795
17798
  Dt as ParseError,
17796
17799
  vo as PictureStepHandle,
17797
- br as ProductCameraRig,
17800
+ Br as ProductCameraRig,
17798
17801
  tr as ProductCollection,
17799
17802
  ml as ProductCollectionProductSortKey,
17800
17803
  jt as ProductWorkflow,
@@ -17807,7 +17810,7 @@ export {
17807
17810
  _c as RotateCommand,
17808
17811
  H as ScaleAxis,
17809
17812
  nd as SendBackwardsCommand,
17810
- Bo as ShapeStepHandle,
17813
+ bo as ShapeStepHandle,
17811
17814
  Er as ShareActionType,
17812
17815
  Ad as SpiffCommerceClient,
17813
17816
  we as StakeholderType,
@@ -17818,7 +17821,7 @@ export {
17818
17821
  gs as TextChangeCommand,
17819
17822
  sl as TextGlobalPropertyHandle,
17820
17823
  ld as TextInput,
17821
- bo as TextStepHandle,
17824
+ Bo as TextStepHandle,
17822
17825
  pl as Transform,
17823
17826
  gl as TransformCollection,
17824
17827
  G as UnhandledBehaviorError,
@@ -17862,7 +17865,7 @@ export {
17862
17865
  Ol as getIntegration,
17863
17866
  zc as getNEPoint,
17864
17867
  Vc as getNWPoint,
17865
- bd as getOrderedTransactions,
17868
+ Bd as getOrderedTransactions,
17866
17869
  hd as getOverrideThemeConfiguration,
17867
17870
  Lc as getPointOfRotation,
17868
17871
  od as getProductCollections,
@@ -17874,11 +17877,11 @@ export {
17874
17877
  gd as getTransactionThemeConfiguration,
17875
17878
  Ed as getTransactionsForBundle,
17876
17879
  Uc as getTrueCoordinates,
17877
- Bd as getUnorderedTransactions,
17880
+ bd as getUnorderedTransactions,
17878
17881
  Dd as getValidationJobsForWorkflowExperiences,
17879
17882
  dd as getWorkflow,
17880
17883
  ar as getWorkflows,
17881
- b as graphQlManager,
17884
+ B as graphQlManager,
17882
17885
  ge as illustrationStepService,
17883
17886
  $c as isCloseToValue,
17884
17887
  Tt as loadFont,
@@ -17917,6 +17920,6 @@ export {
17917
17920
  Ps as toast,
17918
17921
  xd as validateWorkflowExperienceRecipient,
17919
17922
  kd as validateWorkflowExperienceRecipients,
17920
- Bt as xmlSerializer
17923
+ bt as xmlSerializer
17921
17924
  };
17922
17925
  //# sourceMappingURL=index.mjs.map