@spiffcommerce/core 26.27.0-beta.f48415d8-da0d-52c0-aebd-a01f1ae00cf9 → 26.27.1

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
@@ -156,7 +156,7 @@ class Sr {
156
156
  this.serverUrlCallbacks.push(t);
157
157
  }
158
158
  }
159
- const wt = new Sr();
159
+ const mt = new Sr();
160
160
  let _e, Xe;
161
161
  function nc(r) {
162
162
  _e = r;
@@ -169,7 +169,7 @@ function Jt() {
169
169
  "DOM constructor is not registered. Assuming browser environment. If not, please register DOM constructor before calling this function."
170
170
  ), window);
171
171
  }
172
- function ot(r, t) {
172
+ function rt(r, t) {
173
173
  if (!Xe) {
174
174
  if (typeof window < "u" && window.fetch)
175
175
  return window.fetch(r, t);
@@ -185,7 +185,7 @@ const ln = /* @__PURE__ */ new Map(), Fa = /* @__PURE__ */ new Map(), xa = /* @_
185
185
  return t;
186
186
  const a = (async () => {
187
187
  var i;
188
- const n = await ot(r);
188
+ const n = await rt(r);
189
189
  return ln.set(r, ((i = n.headers) == null ? void 0 : i.get("content-type")) || ""), await n.arrayBuffer();
190
190
  })();
191
191
  return Fa.set(r, a), a;
@@ -193,7 +193,7 @@ const ln = /* @__PURE__ */ new Map(), Fa = /* @__PURE__ */ new Map(), xa = /* @_
193
193
  const t = xa.get(r);
194
194
  if (t)
195
195
  return t;
196
- const a = (async () => await (await ot(r)).text())();
196
+ const a = (async () => await (await rt(r)).text())();
197
197
  return xa.set(r, a), a;
198
198
  }, Mt = (r) => r.every((t) => t !== "undefined"), ee = (r) => Mt([typeof document]) ? document.createElement(r) : Jt().document.createElement(r), Er = (r, t) => {
199
199
  if (Mt([typeof document]))
@@ -206,13 +206,13 @@ const ln = /* @__PURE__ */ new Map(), Fa = /* @__PURE__ */ new Map(), xa = /* @_
206
206
  const r = Jt();
207
207
  return new r.DOMParser();
208
208
  }, Br = () => Mt([typeof DOMParser]) ? DOMParser : Jt().DOMParser, be = (r, t) => new Promise((e, a) => {
209
- t ? cn(r).then(e).catch(a) : ot(r).then((n) => {
209
+ t ? cn(r).then(e).catch(a) : rt(r).then((n) => {
210
210
  n.arrayBuffer().then(e).catch(a);
211
211
  }).catch((n) => {
212
212
  a(n);
213
213
  });
214
214
  }), at = (r, t) => new Promise((e, a) => {
215
- t ? vr(r).then(e).catch(a) : ot(r).then((n) => {
215
+ t ? vr(r).then(e).catch(a) : rt(r).then((n) => {
216
216
  n.text().then(e).catch(a);
217
217
  }).catch(a);
218
218
  }), dn = (r) => or(r), Qe = /* @__PURE__ */ new Map(), br = async (r, t) => {
@@ -299,7 +299,7 @@ let hn;
299
299
  const kr = (r) => {
300
300
  hn = r;
301
301
  }, Mr = () => new Promise((r) => {
302
- const t = wt.getHubUrl(), e = (a) => {
302
+ const t = mt.getHubUrl(), e = (a) => {
303
303
  a.origin === t && (window.removeEventListener("message", e), r(a.data));
304
304
  };
305
305
  window.parent !== window && (window.addEventListener("message", e, !1), window.parent.postMessage("ready", t));
@@ -312,18 +312,13 @@ const kr = (r) => {
312
312
  return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await Mr(), ...r } : r;
313
313
  };
314
314
  async function Qr(r, t) {
315
- const e = {
316
- ...t,
317
- redirect: "manual"
318
- };
319
- let a = await ot(r, e);
320
- for (; a.redirected; )
321
- a = await ot(a.url, e);
322
- return a;
315
+ const e = mt.getServerUrl(), a = e.includes(".aumelbdev.spiffcommerce.com") ? "https://moonlight.aumelbdev.spiffcommerce.com" : e.includes(".us.spiffcommerce.com") ? "https://moonlight.us.spiffcommerce.com" : "https://moonlight.au.spiffcommerce.com";
316
+ let n = await rt(r, { ...t, redirect: "manual" });
317
+ return n.type === "opaqueredirect" && (typeof r != "string" && "url" in r ? n = await rt({ ...r, url: `${a}/graphql` }, t) : n = await rt(`${a}/graphql`, t)), n;
323
318
  }
324
319
  class Nr {
325
320
  constructor() {
326
- this.shadowGraphqlClient = this.constructShadowGraphqlClient(), wt.addServerUrlCallback(() => {
321
+ this.shadowGraphqlClient = this.constructShadowGraphqlClient(), mt.addServerUrlCallback(() => {
327
322
  this.shadowGraphqlClient = this.constructShadowGraphqlClient();
328
323
  });
329
324
  }
@@ -332,7 +327,7 @@ class Nr {
332
327
  }
333
328
  constructShadowGraphqlClient() {
334
329
  const t = er({
335
- uri: `${wt.getServerUrl()}/graphql`,
330
+ uri: `${mt.getServerUrl()}/graphql`,
336
331
  fetch: Qr
337
332
  }), e = ir(async (i, s) => {
338
333
  const { headers: o } = s, l = o || {}, c = await Tr(), d = s.bearer ?? c.bearer, A = s.partnerId ?? c.partnerId, u = s.activeIntegration ?? c.activeIntegration, h = s.transactionOwnerId, m = s.customerToken ?? c.customerToken, g = s.applicationKey ?? c.applicationKey, f = s.bundleOwnerId;
@@ -364,7 +359,7 @@ class Nr {
364
359
  }
365
360
  const b = new Nr();
366
361
  let Ze, ta;
367
- const mt = (r, t, e) => {
362
+ const gt = (r, t, e) => {
368
363
  if (Ze !== void 0)
369
364
  return Ze(r, t, e);
370
365
  try {
@@ -427,10 +422,10 @@ const Rr = (r) => new Promise((t) => {
427
422
  var A;
428
423
  const t = await Dr(r), e = await Kt(t), [a, n] = Ur(e);
429
424
  if (!await Or()) {
430
- const u = mt(a, n);
425
+ const u = gt(a, n);
431
426
  return (A = u.getContext("2d")) == null || A.drawImage(e, 0, 0, a, n), u;
432
427
  }
433
- const s = await Rr(r), [o, l] = s > 4 ? [n, a] : [a, n], c = mt(o, l), d = c.getContext("2d");
428
+ const s = await Rr(r), [o, l] = s > 4 ? [n, a] : [a, n], c = gt(o, l), d = c.getContext("2d");
434
429
  switch (s) {
435
430
  case 2:
436
431
  d.translate(o, 0), d.scale(-1, 1);
@@ -3709,7 +3704,7 @@ class ni {
3709
3704
  }
3710
3705
  }
3711
3706
  }
3712
- const Nt = "persistentAssets", yn = class ft {
3707
+ const Nt = "persistentAssets", yn = class pt {
3713
3708
  /**
3714
3709
  * Add a new asset to persistence
3715
3710
  * @param asset The asset to add.
@@ -3724,7 +3719,7 @@ const Nt = "persistentAssets", yn = class ft {
3724
3719
  const a = k.getMap(Nt);
3725
3720
  a && a.forEach((n, i) => {
3726
3721
  e.set(i, n);
3727
- }), k.setMap(Nt, e), ft.executeCallbacks();
3722
+ }), k.setMap(Nt, e), pt.executeCallbacks();
3728
3723
  }
3729
3724
  /**
3730
3725
  * Remove an existing asset from persistence. Noop if the asset doesn't exist.
@@ -3735,7 +3730,7 @@ const Nt = "persistentAssets", yn = class ft {
3735
3730
  if (!e)
3736
3731
  return;
3737
3732
  const a = Array.from(e.entries()).find((n) => n[0] === t);
3738
- a && (e.delete(a[0]), k.setMap(Nt, e), ft.executeCallbacks());
3733
+ a && (e.delete(a[0]), k.setMap(Nt, e), pt.executeCallbacks());
3739
3734
  }
3740
3735
  /**
3741
3736
  * Get a list of all persisted assets.
@@ -3748,16 +3743,16 @@ const Nt = "persistentAssets", yn = class ft {
3748
3743
  * Adds a callback that will be called whenever assets are added/removed from persistence.
3749
3744
  */
3750
3745
  static addCallback(t) {
3751
- ft.callbacks.push(t);
3746
+ pt.callbacks.push(t);
3752
3747
  }
3753
3748
  /**
3754
3749
  * Removes an existing callback.
3755
3750
  */
3756
3751
  static removeCallback(t) {
3757
- ft.callbacks = ft.callbacks.filter((e) => e !== t);
3752
+ pt.callbacks = pt.callbacks.filter((e) => e !== t);
3758
3753
  }
3759
3754
  static executeCallbacks() {
3760
- ft.callbacks.forEach((t) => t());
3755
+ pt.callbacks.forEach((t) => t());
3761
3756
  }
3762
3757
  };
3763
3758
  yn.callbacks = [];
@@ -5171,7 +5166,7 @@ const X = new ci(), vn = y`
5171
5166
  ],
5172
5167
  silentSteps: []
5173
5168
  }), t;
5174
- }, Ti = (r, t) => t.find((e) => e.stepNames.includes(r)), Ct = (r, t) => (r.conditions || []).every((e) => {
5169
+ }, Ti = (r, t) => t.find((e) => e.stepNames.includes(r)), wt = (r, t) => (r.conditions || []).every((e) => {
5175
5170
  const a = t[e.targetStepName];
5176
5171
  if (a && a.selectedVariants) {
5177
5172
  const n = a.selectedVariants;
@@ -5184,8 +5179,8 @@ const X = new ci(), vn = y`
5184
5179
  const e = {
5185
5180
  name: r.name,
5186
5181
  title: r.title,
5187
- renderableSteps: r.renderableSteps.filter((a) => Ct(a, t)),
5188
- silentSteps: r.silentSteps.filter((a) => Ct(a, t))
5182
+ renderableSteps: r.renderableSteps.filter((a) => wt(a, t)),
5183
+ silentSteps: r.silentSteps.filter((a) => wt(a, t))
5189
5184
  };
5190
5185
  return e.silentSteps.length === 0 && e.renderableSteps.length === 0 ? null : e;
5191
5186
  }, It = (r, t) => r.map((e) => Qi(e, t)).filter((e) => e !== null), Ni = async (r, t, e = !1) => {
@@ -5385,7 +5380,7 @@ const Q = () => {
5385
5380
  }
5386
5381
  );
5387
5382
  }, cc = (r, t, e, a, n) => {
5388
- const i = gt(n), s = e / 2, o = a / 2, l = r + s, c = t + o, d = Math.sin(i), A = Math.cos(i), u = s, h = s, m = -o, g = o, f = u * A - m * d, p = h * A - g * d, C = u * d + m * A, w = h * d + g * A, v = Math.max(Math.abs(f), Math.abs(p)), S = Math.max(Math.abs(C), Math.abs(w));
5383
+ const i = ft(n), s = e / 2, o = a / 2, l = r + s, c = t + o, d = Math.sin(i), A = Math.cos(i), u = s, h = s, m = -o, g = o, f = u * A - m * d, p = h * A - g * d, C = u * d + m * A, w = h * d + g * A, v = Math.max(Math.abs(f), Math.abs(p)), S = Math.max(Math.abs(C), Math.abs(w));
5389
5384
  return {
5390
5385
  minX: l - v,
5391
5386
  maxX: l + v,
@@ -5395,8 +5390,8 @@ const Q = () => {
5395
5390
  }, dc = (r, t, e) => {
5396
5391
  const a = Math.sqrt(Math.pow(t.x - r.x, 2) + Math.pow(t.y - r.y, 2)), n = Math.sqrt(Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2)), i = Math.sqrt(Math.pow(e.x - r.x, 2) + Math.pow(e.y - r.y, 2));
5397
5392
  return Math.acos((n * n + a * a - i * i) / (2 * n * a)) * (180 / Math.PI);
5398
- }, gt = (r) => r * (Math.PI / 180), Ac = (r, t, e) => Math.abs(r - t) < e, uc = (r, t, e) => {
5399
- const a = Math.sin(gt(e)), n = Math.cos(gt(e));
5393
+ }, ft = (r) => r * (Math.PI / 180), Ac = (r, t, e) => Math.abs(r - t) < e, uc = (r, t, e) => {
5394
+ const a = Math.sin(ft(e)), n = Math.cos(ft(e));
5400
5395
  return {
5401
5396
  x: (r.x - t.x) * n - (r.y - t.y) * a + t.x,
5402
5397
  y: (r.x - t.x) * a + (r.y - t.y) * n + t.y
@@ -5433,7 +5428,7 @@ const Q = () => {
5433
5428
  return H.Northwest;
5434
5429
  }
5435
5430
  }, pc = (r, t) => t > 45 && t <= 135 ? bt(r) : t > 135 && t <= 225 ? bt(bt(r)) : t > 225 && t <= 315 ? bt(bt(bt(r))) : r, Cc = (r, t = { x: 0, y: 0 }, e = { x: 1, y: 1 }) => {
5436
- const a = gt(r.rotation), n = {
5431
+ const a = ft(r.rotation), n = {
5437
5432
  x: t.x + r.x * e.x,
5438
5433
  y: t.x + r.y * e.y
5439
5434
  }, i = {
@@ -5463,7 +5458,7 @@ const Q = () => {
5463
5458
  y: (r.x - t.x) * a + (r.y - t.y) * n + t.y
5464
5459
  };
5465
5460
  }, wc = 0.352778, yc = 0.035277, Fn = (r) => {
5466
- const t = r.rotation || 0, e = gt(t), a = Math.cos(e), n = -Math.sin(e);
5461
+ const t = r.rotation || 0, e = ft(t), a = Math.cos(e), n = -Math.sin(e);
5467
5462
  return /* @__PURE__ */ x("g", { mask: r.stepName || r.productOverlay ? void 0 : r.mask, children: /* @__PURE__ */ x(
5468
5463
  "g",
5469
5464
  {
@@ -5486,7 +5481,7 @@ const Q = () => {
5486
5481
  ) });
5487
5482
  }, xn = (r) => {
5488
5483
  var l;
5489
- const t = `spiff-group-clip-${r.id}`, e = r.rotation || 0, a = gt(e), n = Math.cos(a), i = -Math.sin(a), s = ya(r.children);
5484
+ const t = `spiff-group-clip-${r.id}`, e = r.rotation || 0, a = ft(e), n = Math.cos(a), i = -Math.sin(a), s = ya(r.children);
5490
5485
  return /* @__PURE__ */ ct(Vt, { children: [
5491
5486
  /* @__PURE__ */ x("defs", { children: (() => /* @__PURE__ */ x("clipPath", { id: t, preserveAspectRatio: "none", children: r.clipPath ? /* @__PURE__ */ x("path", { d: r.clipPath }) : /* @__PURE__ */ x("rect", { x: 0, y: 0, width: r.width, height: r.height }) }))() }),
5492
5487
  /* @__PURE__ */ ct(
@@ -5547,7 +5542,7 @@ const Q = () => {
5547
5542
  /* @__PURE__ */ x("feFuncG", { type: "discrete", tableValues: n() }),
5548
5543
  /* @__PURE__ */ x("feFuncB", { type: "discrete", tableValues: n() })
5549
5544
  ] })
5550
- ] }) }) }), s = r.rotation || 0, o = gt(s), l = Math.cos(o), c = -Math.sin(o), d = () => {
5545
+ ] }) }) }), s = r.rotation || 0, o = ft(s), l = Math.cos(o), c = -Math.sin(o), d = () => {
5551
5546
  var w, v, S, B, E, I, P, F, M, N;
5552
5547
  const A = ((w = r.pattern) == null ? void 0 : w.x) || 0, u = ((v = r.pattern) == null ? void 0 : v.y) || 0, h = ((S = r.pattern) == null ? void 0 : S.width) || 0, m = ((B = r.pattern) == null ? void 0 : B.height) || 0, g = ((E = r.pattern) == null ? void 0 : E.scaleX) || 1, f = ((I = r.pattern) == null ? void 0 : I.scaleY) || 1, p = ((P = r.pattern) == null ? void 0 : P.rotation) || 0;
5553
5548
  return [(F = r.pattern) != null && F.svg ? {
@@ -5981,7 +5976,7 @@ const Li = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Oe = /* @_
5981
5976
  mask: r.stepName ? void 0 : r.mask
5982
5977
  }
5983
5978
  );
5984
- const t = r.rotation || 0, e = gt(t), a = Math.cos(e), n = -Math.sin(e), i = `
5979
+ const t = r.rotation || 0, e = ft(t), a = Math.cos(e), n = -Math.sin(e), i = `
5985
5980
  matrix(1, 0, 0, 1, ${r.x}, ${r.y})
5986
5981
  matrix(1, 0, 0, 1, ${r.width / 2}, ${r.height / 2})
5987
5982
  matrix(${a}, ${-n}, ${n}, ${a}, 0, 0)
@@ -6291,13 +6286,13 @@ const Zt = (r) => {
6291
6286
  const s = dt().parseFromString(r, "image/svg+xml").firstElementChild;
6292
6287
  if (!s)
6293
6288
  throw new Error("Failed to read SVG");
6294
- const l = Et().serializeToString(s), c = mt(), d = c.getContext("2d"), A = await ca.from(d, l, {
6289
+ const l = Et().serializeToString(s), c = gt(), d = c.getContext("2d"), A = await ca.from(d, l, {
6295
6290
  anonymousCrossOrigin: !0,
6296
6291
  ignoreDimensions: !1,
6297
- createCanvas: mt,
6292
+ createCanvas: gt,
6298
6293
  createImage: Kt,
6299
6294
  DOMParser: ha(),
6300
- fetch: ot
6295
+ fetch: rt
6301
6296
  }), u = s.getAttribute("width"), h = s.getAttribute("height"), m = 2048;
6302
6297
  if (h && u) {
6303
6298
  const g = parseFloat(h), p = parseFloat(u) / g;
@@ -7277,9 +7272,9 @@ class za {
7277
7272
  }
7278
7273
  }
7279
7274
  const ss = async (r) => {
7280
- const t = `${wt.getServicesApiUrl()}/shortener`;
7275
+ const t = `${mt.getServicesApiUrl()}/shortener`;
7281
7276
  try {
7282
- return (await (await ot(t, {
7277
+ return (await (await rt(t, {
7283
7278
  method: "POST",
7284
7279
  body: JSON.stringify({ longUrl: r }),
7285
7280
  headers: {
@@ -7531,7 +7526,7 @@ class we {
7531
7526
  async () => {
7532
7527
  var h;
7533
7528
  const A = (h = (await U.getFromServer(e.key || "")).versions) == null ? void 0 : h.find((m) => m.name === "svg");
7534
- return A ? (await ot(A.link)).status === 200 : !1;
7529
+ return A ? (await rt(A.link)).status === 200 : !1;
7535
7530
  },
7536
7531
  () => {
7537
7532
  U.getLocalOrFromServer(e.key || "").then((d) => {
@@ -7792,7 +7787,7 @@ class we {
7792
7787
  ), this.validateColorCount(e, a);
7793
7788
  }
7794
7789
  }
7795
- const pt = new we();
7790
+ const Ct = new we();
7796
7791
  class ls {
7797
7792
  async getIllustrationBody(t) {
7798
7793
  return new Promise((e) => {
@@ -10437,12 +10432,12 @@ class ao {
10437
10432
  this.stepElements = e(this.stepElements, t);
10438
10433
  }
10439
10434
  getInvalidCanvasRegions() {
10440
- return this.workflow.steps.reduce((t, e) => (Ct(e, this.stepSelections) || this.stepElements[e.stepName] && this.stepElements[e.stepName].forEach(
10435
+ return this.workflow.steps.reduce((t, e) => (wt(e, this.stepSelections) || this.stepElements[e.stepName] && this.stepElements[e.stepName].forEach(
10441
10436
  (a) => t.push(a)
10442
10437
  ), t), []);
10443
10438
  }
10444
10439
  getInvalidModelVariants() {
10445
- return this.workflow.steps.reduce((t, e) => (e.type === D.Model && !Ct(e, this.stepSelections) && t.push(e.stepName), t), []);
10440
+ return this.workflow.steps.reduce((t, e) => (e.type === D.Model && !wt(e, this.stepSelections) && t.push(e.stepName), t), []);
10446
10441
  }
10447
10442
  async stepElementsForIntroducedSilentSteps(t, e) {
10448
10443
  const a = this.product;
@@ -10544,13 +10539,13 @@ class ao {
10544
10539
  ...this.stepSelections,
10545
10540
  [t]: { selectedVariants: e }
10546
10541
  }, this.selectionCost = Object.values(this.stepSelections).reduce((B, E) => B + E.selectedVariants.map((I) => I.priceModifier || 0).reduce((I, P) => I + P, 0), 0), this.workflow.steps.forEach((B) => {
10547
- Ct(B, this.stepSelections) || (this.stepInitialised[B.stepName] = !1, delete this.stepMetadata[B.stepName], delete this.stepSelections[B.stepName], delete this.storage[B.stepName]);
10542
+ wt(B, this.stepSelections) || (this.stepInitialised[B.stepName] = !1, delete this.stepMetadata[B.stepName], delete this.stepSelections[B.stepName], delete this.storage[B.stepName]);
10548
10543
  });
10549
10544
  const s = this.allScenes, o = It(s, i), l = It(s, this.stepSelections), c = o.map((B) => B.silentSteps).flat(), A = l.map((B) => B.silentSteps).flat().filter(
10550
10545
  (B) => !c.some((E) => E.stepName === B.stepName)
10551
10546
  );
10552
10547
  c.forEach((B) => {
10553
- Ct(B, this.stepSelections) || (this.stepInitialised[B.stepName] = !1);
10548
+ wt(B, this.stepSelections) || (this.stepInitialised[B.stepName] = !1);
10554
10549
  });
10555
10550
  const u = this.getInvalidCanvasRegions(), { stepElements: h, commands: m } = await this.stepElementsForIntroducedSilentSteps(A, !1);
10556
10551
  this.stepElements = {
@@ -10596,7 +10591,7 @@ class ao {
10596
10591
  break;
10597
10592
  case D.Frame:
10598
10593
  a.push(
10599
- pt.init(l, this, this.reloadedState)
10594
+ Ct.init(l, this, this.reloadedState)
10600
10595
  );
10601
10596
  break;
10602
10597
  case D.Illustration:
@@ -10696,7 +10691,7 @@ class ao {
10696
10691
  return Ni(this.allScenes, this.stepSelections, this.singleVariantsRenderable);
10697
10692
  }
10698
10693
  }
10699
- class it {
10694
+ class st {
10700
10695
  constructor(t) {
10701
10696
  this.variantData = t;
10702
10697
  }
@@ -10803,21 +10798,21 @@ const qn = class sa {
10803
10798
  getCurrentVariant() {
10804
10799
  const e = this.manager.getWorkflowSelections()[this.step.stepName], a = e == null ? void 0 : e.selections[0];
10805
10800
  if (a)
10806
- return new it(a);
10801
+ return new st(a);
10807
10802
  }
10808
10803
  /**
10809
10804
  * @returns A list of valid variants for this step. Does not include disabled variants.
10810
10805
  */
10811
10806
  getAvailableVariants() {
10812
10807
  var e, a;
10813
- return (((a = (e = this.step.option) == null ? void 0 : e.variants) == null ? void 0 : a.filter((n) => n.enabled)) || []).map((n) => new it(n));
10808
+ return (((a = (e = this.step.option) == null ? void 0 : e.variants) == null ? void 0 : a.filter((n) => n.enabled)) || []).map((n) => new st(n));
10814
10809
  }
10815
10810
  /**
10816
10811
  * @returns A list of all variants for this step, including disabled ones.
10817
10812
  */
10818
10813
  getAllVariants() {
10819
10814
  var e;
10820
- return (((e = this.step.option) == null ? void 0 : e.variants) || []).map((a) => new it(a));
10815
+ return (((e = this.step.option) == null ? void 0 : e.variants) || []).map((a) => new st(a));
10821
10816
  }
10822
10817
  /**
10823
10818
  * @returns A unique identifier for this step within the workflow.
@@ -10911,8 +10906,8 @@ const qn = class sa {
10911
10906
  }
10912
10907
  };
10913
10908
  qn.updateState = /* @__PURE__ */ new Map();
10914
- let rt = qn;
10915
- class no extends rt {
10909
+ let it = qn;
10910
+ class no extends it {
10916
10911
  constructor(t, e, a) {
10917
10912
  super(t, e, a);
10918
10913
  }
@@ -10990,7 +10985,7 @@ class no extends rt {
10990
10985
  return this.step.data.pmsPickerEnabled ?? !1;
10991
10986
  }
10992
10987
  }
10993
- class ro extends rt {
10988
+ class ro extends it {
10994
10989
  constructor(t, e, a) {
10995
10990
  super(t, e, a);
10996
10991
  }
@@ -11003,7 +10998,7 @@ class ro extends rt {
11003
10998
  );
11004
10999
  }
11005
11000
  }
11006
- class io extends rt {
11001
+ class io extends it {
11007
11002
  constructor(t, e, a) {
11008
11003
  super(t, e, a);
11009
11004
  }
@@ -11016,7 +11011,7 @@ class io extends rt {
11016
11011
  );
11017
11012
  }
11018
11013
  }
11019
- class so extends rt {
11014
+ class so extends it {
11020
11015
  constructor(t, e, a) {
11021
11016
  super(t, e, a);
11022
11017
  }
@@ -11034,7 +11029,7 @@ class so extends rt {
11034
11029
  );
11035
11030
  }
11036
11031
  }
11037
- class oo extends rt {
11032
+ class oo extends it {
11038
11033
  constructor(t, e, a) {
11039
11034
  super(t, e, a);
11040
11035
  }
@@ -11051,7 +11046,7 @@ class oo extends rt {
11051
11046
  return this.step.data.displayType || ((t = this.step.option) == null ? void 0 : t.displayType);
11052
11047
  }
11053
11048
  }
11054
- class lo extends rt {
11049
+ class lo extends it {
11055
11050
  constructor(t, e, a) {
11056
11051
  super(t, e, a);
11057
11052
  }
@@ -11106,7 +11101,7 @@ class lo extends rt {
11106
11101
  return t;
11107
11102
  }
11108
11103
  }
11109
- class co extends rt {
11104
+ class co extends it {
11110
11105
  constructor(t, e, a) {
11111
11106
  super(t, e, a);
11112
11107
  }
@@ -11307,7 +11302,7 @@ class co extends rt {
11307
11302
  await q.changeStrokeColor(this.step, t, e, this.manager);
11308
11303
  }
11309
11304
  }
11310
- class Ao extends rt {
11305
+ class Ao extends it {
11311
11306
  constructor(t, e, a) {
11312
11307
  super(t, e, a);
11313
11308
  }
@@ -11320,7 +11315,7 @@ class Ao extends rt {
11320
11315
  return this.step.data.content;
11321
11316
  }
11322
11317
  }
11323
- class uo extends rt {
11318
+ class uo extends it {
11324
11319
  constructor(t, e, a) {
11325
11320
  super(t, e, a);
11326
11321
  }
@@ -11347,7 +11342,7 @@ class uo extends rt {
11347
11342
  );
11348
11343
  }
11349
11344
  }
11350
- class ho extends rt {
11345
+ class ho extends it {
11351
11346
  constructor(t, e, a) {
11352
11347
  super(t, e, a);
11353
11348
  }
@@ -11681,7 +11676,7 @@ const fo = async (r) => {
11681
11676
  );
11682
11677
  let B = await o(m, n.id);
11683
11678
  if (B) {
11684
- const P = await (await ot(B)).blob();
11679
+ const P = await (await rt(B)).blob();
11685
11680
  B = (await U.uploadAsset(
11686
11681
  { name: `${n.id}-preview-image.png`, blob: P },
11687
11682
  he.Image,
@@ -12035,7 +12030,7 @@ class Io {
12035
12030
  }
12036
12031
  let i = 2048;
12037
12032
  e && e <= 2048 && (i = e);
12038
- const s = mt(i, i), o = this.commandContext.getAllLayouts(), l = a.defaultPreviewPanelIndex || 0, c = a.panels[l], d = o.find((v) => {
12033
+ const s = gt(i, i), o = this.commandContext.getAllLayouts(), l = a.defaultPreviewPanelIndex || 0, c = a.panels[l], d = o.find((v) => {
12039
12034
  var S;
12040
12035
  return ((S = v.layoutState) == null ? void 0 : S.layout.panelId) === (c == null ? void 0 : c.name);
12041
12036
  }) || o[0], A = d.layoutState.layout.previewRegion ? {
@@ -12060,7 +12055,7 @@ class Io {
12060
12055
  await (await ca.from(h, g, {
12061
12056
  anonymousCrossOrigin: !0,
12062
12057
  ignoreDimensions: !1,
12063
- createCanvas: mt,
12058
+ createCanvas: gt,
12064
12059
  createImage: Kt,
12065
12060
  DOMParser: ha(),
12066
12061
  fetch
@@ -12084,7 +12079,7 @@ class Io {
12084
12079
  getStepsConditionallyActive() {
12085
12080
  return this.getScenes().flatMap(
12086
12081
  (t) => this.getStepsByScene(t).filter(
12087
- (e) => Ct(e.getRaw(), this.getWorkflowManager().getStepSelections())
12082
+ (e) => wt(e.getRaw(), this.getWorkflowManager().getStepSelections())
12088
12083
  )
12089
12084
  );
12090
12085
  }
@@ -12892,7 +12887,7 @@ class Uo {
12892
12887
  }
12893
12888
  const Lo = () => new Promise((r, t) => {
12894
12889
  try {
12895
- const a = mt().getContext("webgl2");
12890
+ const a = gt().getContext("webgl2");
12896
12891
  r(!!a);
12897
12892
  } catch {
12898
12893
  r(!1);
@@ -13026,7 +13021,7 @@ class zo extends Dn {
13026
13021
  ignoreClear: !0,
13027
13022
  ignoreMouse: !0,
13028
13023
  enableRedraw: !1,
13029
- createCanvas: mt,
13024
+ createCanvas: gt,
13030
13025
  createImage: Kt,
13031
13026
  DOMParser: ha(),
13032
13027
  fetch
@@ -13457,7 +13452,7 @@ class _n extends Ba {
13457
13452
  return n.id === ((s = (i = this.optionResource) == null ? void 0 : i.defaultVariant) == null ? void 0 : s.id);
13458
13453
  }
13459
13454
  );
13460
- t && await this.selectVariant(new it(t));
13455
+ t && await this.selectVariant(new st(t));
13461
13456
  }
13462
13457
  /**
13463
13458
  * Gets the currently selected variant, or undefined if no variant is selected.
@@ -13469,7 +13464,7 @@ class _n extends Ba {
13469
13464
  const t = this.getStateValue();
13470
13465
  if (t) {
13471
13466
  const n = (a = this.optionResource.variants) == null ? void 0 : a.find((i) => i.id === t);
13472
- return n ? new it(n) : void 0;
13467
+ return n ? new st(n) : void 0;
13473
13468
  } else {
13474
13469
  const n = (e = this.optionResource.variants) == null ? void 0 : e.find(
13475
13470
  (i) => {
@@ -13477,7 +13472,7 @@ class _n extends Ba {
13477
13472
  return i.id === ((o = (s = this.optionResource) == null ? void 0 : s.defaultVariant) == null ? void 0 : o.id);
13478
13473
  }
13479
13474
  );
13480
- return n ? new it(n) : void 0;
13475
+ return n ? new st(n) : void 0;
13481
13476
  }
13482
13477
  }
13483
13478
  /**
@@ -13485,14 +13480,14 @@ class _n extends Ba {
13485
13480
  */
13486
13481
  getAvailableVariants() {
13487
13482
  var e, a;
13488
- return (((a = (e = this.optionResource) == null ? void 0 : e.variants) == null ? void 0 : a.filter((n) => n.enabled)) || []).map((n) => new it(n));
13483
+ return (((a = (e = this.optionResource) == null ? void 0 : e.variants) == null ? void 0 : a.filter((n) => n.enabled)) || []).map((n) => new st(n));
13489
13484
  }
13490
13485
  /**
13491
13486
  * @returns A list of all variants for this step, including disabled ones.
13492
13487
  */
13493
13488
  getAllVariants() {
13494
13489
  var e;
13495
- return (((e = this.optionResource) == null ? void 0 : e.variants) || []).map((a) => new it(a));
13490
+ return (((e = this.optionResource) == null ? void 0 : e.variants) || []).map((a) => new st(a));
13496
13491
  }
13497
13492
  /**
13498
13493
  * Select a given variant on the option for all shared steps.
@@ -13510,7 +13505,7 @@ class _n extends Ba {
13510
13505
  if (!e)
13511
13506
  return Promise.resolve();
13512
13507
  const a = (i = (n = this.optionResource) == null ? void 0 : n.variants) == null ? void 0 : i.find((s) => s.id === e);
13513
- return a ? (console.log(`Applying global state using variant ${a.id} for aspect ${e}`), this.applyVariantSelection(new it(a), t)) : Promise.resolve();
13508
+ return a ? (console.log(`Applying global state using variant ${a.id} for aspect ${e}`), this.applyVariantSelection(new st(a), t)) : Promise.resolve();
13514
13509
  }
13515
13510
  async applyVariantSelection(t, e) {
13516
13511
  const n = this.getSharedSteps(e).map((i) => i.selectVariant(t));
@@ -13539,7 +13534,7 @@ class Ha extends _n {
13539
13534
  const a = (s = (i = this.optionResource) == null ? void 0 : i.variants) == null ? void 0 : s.find((l) => l.id === e);
13540
13535
  if (!a)
13541
13536
  return Promise.resolve();
13542
- await this.applyColorVariant(new it(a), t);
13537
+ await this.applyColorVariant(new st(a), t);
13543
13538
  const n = (o = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)) == null ? void 0 : o.customColor;
13544
13539
  n && this.setCustomColor(n);
13545
13540
  }
@@ -15388,10 +15383,10 @@ class Rc {
15388
15383
  } catch (a) {
15389
15384
  throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
15390
15385
  }
15391
- }, this.options = t, this.options.applicationKey && Fr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 26.27.0-beta.2c843685-8df7-5858-89a0-ccbbad249c0f"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15386
+ }, this.options = t, this.options.applicationKey && Fr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 26.27.1"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15392
15387
  }
15393
15388
  configure(t) {
15394
- wt.setHubUrl(t.hubUrl), wt.setServerUrl(t.serverUrl), wt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, t.bearerAuthenticationToken && kr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration();
15389
+ mt.setHubUrl(t.hubUrl), mt.setServerUrl(t.serverUrl), mt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, t.bearerAuthenticationToken && kr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration();
15395
15390
  }
15396
15391
  /**
15397
15392
  * @returns The asset manager allows for common operations related to assets
@@ -16451,7 +16446,7 @@ class Vc {
16451
16446
  }
16452
16447
  }
16453
16448
  var vl = /* @__PURE__ */ ((r) => (r.SelectFrame = "SelectFrame", r.SelectImage = "SelectImage", r.Position = "Position", r))(vl || {});
16454
- class El extends rt {
16449
+ class El extends it {
16455
16450
  constructor(t, e, a) {
16456
16451
  super(t, e, a);
16457
16452
  const n = e.data;
@@ -16459,7 +16454,7 @@ class El extends rt {
16459
16454
  }
16460
16455
  selectVariant(t) {
16461
16456
  const e = this.manager.getRegionElements(this.step.stepName);
16462
- return pt.selectVariant(
16457
+ return Ct.selectVariant(
16463
16458
  this.step,
16464
16459
  t.getResource(),
16465
16460
  e,
@@ -16480,7 +16475,7 @@ class El extends rt {
16480
16475
  */
16481
16476
  async selectImage(t, e = !0, a = !0) {
16482
16477
  var n;
16483
- if (await pt.selectImage(this.step, t, this.manager, a), e) {
16478
+ if (await Ct.selectImage(this.step, t, this.manager, a), e) {
16484
16479
  const i = ((n = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : n.framePatternData) || {};
16485
16480
  this.manager.updateStorage(this.step.stepName, {
16486
16481
  framePatternData: {
@@ -16520,7 +16515,7 @@ class El extends rt {
16520
16515
  if (!e)
16521
16516
  throw new Error("You must supply an image selection before attempting to remove the background.");
16522
16517
  const a = await U.removeBackgroundFromAsset(e);
16523
- t && await pt.selectImage(this.step, a, this.manager, !1);
16518
+ t && await Ct.selectImage(this.step, a, this.manager, !1);
16524
16519
  const n = ((i = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : i.framePatternData) || {};
16525
16520
  return this.manager.updateStorage(this.step.stepName, {
16526
16521
  framePatternData: {
@@ -16531,7 +16526,7 @@ class El extends rt {
16531
16526
  }), a;
16532
16527
  }
16533
16528
  changeColors(t) {
16534
- pt.changeColors(this.step, this.manager, t);
16529
+ Ct.changeColors(this.step, this.manager, t);
16535
16530
  }
16536
16531
  getImageData() {
16537
16532
  if (this.frameService)
@@ -16541,7 +16536,7 @@ class El extends rt {
16541
16536
  return this.step.data.colorOption;
16542
16537
  }
16543
16538
  getAvailableColors() {
16544
- return this.step.data.colorPickerEnabled ? pt.availableColors(this.step, this.manager) : Promise.resolve([]);
16539
+ return this.step.data.colorPickerEnabled ? Ct.availableColors(this.step, this.manager) : Promise.resolve([]);
16545
16540
  }
16546
16541
  isColorPickerEnabled() {
16547
16542
  return this.step.data.colorPickerEnabled ?? !1;
@@ -16554,7 +16549,7 @@ class El extends rt {
16554
16549
  return this.step.data.maxColors;
16555
16550
  }
16556
16551
  getUniqueColorCount() {
16557
- return pt.getUniqueColorCount(this.step, this.manager);
16552
+ return Ct.getUniqueColorCount(this.step, this.manager);
16558
16553
  }
16559
16554
  getCurrentFrameStep(t, e, a, n) {
16560
16555
  return n && n.length > 1 && t === void 0 ? "SelectFrame" : e || a || this.getImageData() ? "Position" : "SelectImage";
@@ -16898,7 +16893,7 @@ K = { __e: function(r, t, e, a) {
16898
16893
  }
16899
16894
  throw r;
16900
16895
  } }, typeof Promise == "function" && Promise.prototype.then.bind(Promise.resolve());
16901
- var st, qe, Ja, tr = [], Ye = [], Ka = K.__b, _a = K.__r, Xa = K.diffed, Za = K.__c, tn = K.unmount;
16896
+ var ot, qe, Ja, tr = [], Ye = [], Ka = K.__b, _a = K.__r, Xa = K.diffed, Za = K.__c, tn = K.unmount;
16902
16897
  function Ql() {
16903
16898
  for (var r; r = tr.shift(); )
16904
16899
  if (r.__P && r.__H)
@@ -16909,19 +16904,19 @@ function Ql() {
16909
16904
  }
16910
16905
  }
16911
16906
  K.__b = function(r) {
16912
- st = null, Ka && Ka(r);
16907
+ ot = null, Ka && Ka(r);
16913
16908
  }, K.__r = function(r) {
16914
16909
  _a && _a(r);
16915
- var t = (st = r.__c).__H;
16916
- t && (qe === st ? (t.__h = [], st.__h = [], t.__.forEach(function(e) {
16910
+ var t = (ot = r.__c).__H;
16911
+ t && (qe === ot ? (t.__h = [], ot.__h = [], t.__.forEach(function(e) {
16917
16912
  e.__N && (e.__ = e.__N), e.__V = Ye, e.__N = e.i = void 0;
16918
- })) : (t.__h.forEach(ue), t.__h.forEach(la), t.__h = [])), qe = st;
16913
+ })) : (t.__h.forEach(ue), t.__h.forEach(la), t.__h = [])), qe = ot;
16919
16914
  }, K.diffed = function(r) {
16920
16915
  Xa && Xa(r);
16921
16916
  var t = r.__c;
16922
16917
  t && t.__H && (t.__H.__h.length && (tr.push(t) !== 1 && Ja === K.requestAnimationFrame || ((Ja = K.requestAnimationFrame) || Nl)(Ql)), t.__H.__.forEach(function(e) {
16923
16918
  e.i && (e.__H = e.i), e.__V !== Ye && (e.__ = e.__V), e.i = void 0, e.__V = Ye;
16924
- })), qe = st = null;
16919
+ })), qe = ot = null;
16925
16920
  }, K.__c = function(r, t) {
16926
16921
  t.some(function(e) {
16927
16922
  try {
@@ -16953,12 +16948,12 @@ function Nl(r) {
16953
16948
  en && (t = requestAnimationFrame(e));
16954
16949
  }
16955
16950
  function ue(r) {
16956
- var t = st, e = r.__c;
16957
- typeof e == "function" && (r.__c = void 0, e()), st = t;
16951
+ var t = ot, e = r.__c;
16952
+ typeof e == "function" && (r.__c = void 0, e()), ot = t;
16958
16953
  }
16959
16954
  function la(r) {
16960
- var t = st;
16961
- r.__c = r.__(), st = t;
16955
+ var t = ot;
16956
+ r.__c = r.__(), ot = t;
16962
16957
  }
16963
16958
  export {
16964
16959
  da as AddonHandle,
@@ -17031,7 +17026,7 @@ export {
17031
17026
  Rc as SpiffCommerceClient,
17032
17027
  me as StakeholderType,
17033
17028
  hr as StepAspectType,
17034
- rt as StepHandle,
17029
+ it as StepHandle,
17035
17030
  D as StepType,
17036
17031
  kt as TextAlgorithm,
17037
17032
  rs as TextChangeCommand,
@@ -17043,7 +17038,7 @@ export {
17043
17038
  z as UnhandledBehaviorError,
17044
17039
  Cr as UnitOfMeasurement,
17045
17040
  Ic as UpdateImageSourceCommand,
17046
- it as Variant,
17041
+ st as Variant,
17047
17042
  bo as WorkflowExperienceEventType,
17048
17043
  Io as WorkflowExperienceImpl,
17049
17044
  U as assetService,
@@ -17063,7 +17058,7 @@ export {
17063
17058
  L as findElement,
17064
17059
  lc as findPmsColors,
17065
17060
  Lt as frameDataCache,
17066
- pt as frameStepService,
17061
+ Ct as frameStepService,
17067
17062
  Q as generate,
17068
17063
  Oo as generateCommands,
17069
17064
  lt as generateSVGWithUnknownColors,
@@ -17123,7 +17118,7 @@ export {
17123
17118
  mn as setCanvasModule,
17124
17119
  $t as shapeStepService,
17125
17120
  ss as shortenUrl,
17126
- wt as spiffCoreConfiguration,
17121
+ mt as spiffCoreConfiguration,
17127
17122
  kc as stepAspectValuesToDesignInputSteps,
17128
17123
  Qa as svgColorValueToDefinition,
17129
17124
  Rn as svgStringDimensions,