@spiffcommerce/core 27.3.0-beta.d19ddd38-fcd3-5036-a764-7674af30aff5 → 27.3.0-beta.e9193700-c583-5895-966c-8f5d9493e0d9

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
@@ -3,15 +3,15 @@ import { setContext as dr } from "@apollo/client/link/context";
3
3
  import { onError as Ar } from "@apollo/client/link/error";
4
4
  import { renderToStaticMarkup as ur } from "preact-render-to-string";
5
5
  import { removeTypenameFromVariables as hr } from "@apollo/client/link/remove-typename";
6
- import { orientation as mr } from "exifr/dist/mini.umd.cjs";
6
+ import { orientation as gr } from "exifr/dist/mini.umd.cjs";
7
7
  import { parse as on } from "css";
8
- import gr from "fuse.js";
8
+ import mr from "fuse.js";
9
9
  import { Pith as Aa } from "pith";
10
10
  import St from "lodash.clonedeep";
11
11
  import { toString as ln } from "qrcode";
12
12
  import pr from "svg-path-bbox";
13
13
  import { parse as Xe } from "opentype.js";
14
- import { jsx as F, jsxs as ct, Fragment as Gt } from "preact/jsx-runtime";
14
+ import { jsx as k, jsxs as ct, Fragment as zt } from "preact/jsx-runtime";
15
15
  import fr from "handlebars";
16
16
  import { dataUriToBuffer as Cr } from "data-uri-to-buffer";
17
17
  import Fa from "lodash.chunk";
@@ -64,7 +64,7 @@ class De extends An {
64
64
  super(`ImplementationError - ${t}`);
65
65
  }
66
66
  }
67
- class z extends De {
67
+ class G extends De {
68
68
  constructor(t) {
69
69
  super(`Unhandled Behavior Encountered: ${t}`);
70
70
  }
@@ -160,7 +160,7 @@ class Fr {
160
160
  this.serverUrlCallbacks.push(t);
161
161
  }
162
162
  }
163
- const mt = new Fr();
163
+ const gt = new Fr();
164
164
  let ta, ea;
165
165
  function Fc(r) {
166
166
  ta = r;
@@ -219,7 +219,7 @@ const un = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @_
219
219
  t ? kr(r).then(e).catch(a) : rt(r).then((n) => {
220
220
  n.text().then(e).catch(a);
221
221
  }).catch(a);
222
- }), mn = (r) => ur(r), Oe = /* @__PURE__ */ new Map(), Nr = async (r, t) => {
222
+ }), gn = (r) => ur(r), Oe = /* @__PURE__ */ new Map(), Nr = async (r, t) => {
223
223
  if (Tt([typeof FontFace])) {
224
224
  if (Oe.has(t))
225
225
  return Oe.get(t);
@@ -272,7 +272,7 @@ const un = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @_
272
272
  }, Rr = async (r) => {
273
273
  const t = ke(r), e = new Uint8Array(r), a = Qr(e), n = btoa(a);
274
274
  return `data:${t};base64,${n}`;
275
- }, ha = (r) => `data:image/svg+xml;base64,${btoa(r)}`, gn = (r) => {
275
+ }, ha = (r) => `data:image/svg+xml;base64,${btoa(r)}`, mn = (r) => {
276
276
  const t = r.replace(/\r?\n/g, ""), e = t.indexOf(",");
277
277
  if (e === -1 || e <= 4)
278
278
  throw new TypeError("malformed data: URI");
@@ -291,34 +291,34 @@ const un = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @_
291
291
  !i || !i.result ? e() : t(i.result.toString());
292
292
  }, a.readAsDataURL(r);
293
293
  });
294
- let $r, ma;
295
- const Ur = (r) => {
296
- ma = r;
297
- }, Lr = () => ma;
294
+ let $r, ga;
295
+ const Lr = (r) => {
296
+ ga = r;
297
+ }, Ur = () => ga;
298
298
  let pn;
299
299
  const Vr = (r) => {
300
300
  pn = r;
301
- }, zr = () => new Promise((r) => {
302
- const t = mt.getHubUrl(), e = (a) => {
301
+ }, Gr = () => new Promise((r) => {
302
+ const t = gt.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));
306
- }), Gr = async () => {
306
+ }), zr = async () => {
307
307
  const r = {
308
- applicationKey: ma,
308
+ applicationKey: ga,
309
309
  customerToken: $r,
310
310
  bearer: pn
311
311
  };
312
- return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await zr(), ...r } : r;
312
+ return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await Gr(), ...r } : r;
313
313
  };
314
314
  async function Wr(r, t) {
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";
315
+ const e = gt.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
316
  let n = await rt(r, { ...t, redirect: "manual" });
317
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;
318
318
  }
319
319
  class jr {
320
320
  constructor() {
321
- this.shadowGraphqlClient = this.constructShadowGraphqlClient(), mt.addServerUrlCallback(() => {
321
+ this.shadowGraphqlClient = this.constructShadowGraphqlClient(), gt.addServerUrlCallback(() => {
322
322
  this.shadowGraphqlClient = this.constructShadowGraphqlClient();
323
323
  });
324
324
  }
@@ -330,17 +330,17 @@ class jr {
330
330
  }
331
331
  constructShadowGraphqlClient() {
332
332
  const t = sr({
333
- uri: `${mt.getServerUrl()}/graphql`,
333
+ uri: `${gt.getServerUrl()}/graphql`,
334
334
  fetch: Wr
335
335
  }), e = dr(async (i, s) => {
336
- const { headers: o } = s, l = o || {}, c = await Gr();
336
+ const { headers: o } = s, l = o || {}, c = await zr();
337
337
  let d = s.bearer ?? c.bearer;
338
338
  if (this.spiffClient)
339
339
  try {
340
340
  d = await this.spiffClient.loggedInBearerToken();
341
341
  } catch {
342
342
  }
343
- const A = s.partnerId ?? c.partnerId, u = s.activeIntegration ?? c.activeIntegration, h = s.transactionOwnerId, m = s.customerToken ?? c.customerToken, g = s.applicationKey ?? c.applicationKey, p = s.bundleOwnerId;
343
+ const A = s.partnerId ?? c.partnerId, u = s.activeIntegration ?? c.activeIntegration, h = s.transactionOwnerId, g = s.customerToken ?? c.customerToken, m = s.applicationKey ?? c.applicationKey, p = s.bundleOwnerId;
344
344
  try {
345
345
  if (window && window.__SENTRY__) {
346
346
  const f = window.__SENTRY__.hub;
@@ -353,7 +353,7 @@ class jr {
353
353
  }
354
354
  } catch {
355
355
  }
356
- return d && (l.Authorization = `Bearer ${d}`), A && (l.partnerId = A), u && (l.activeIntegration = u), h && (l.transactionOwnerId = h), m && (l.customerToken = m), g && (l["X-Application-Key"] = g), p && (l.bundleOwnerId = p), l["Allow-Moonlight-Redirect"] = "true", {
356
+ return d && (l.Authorization = `Bearer ${d}`), A && (l.partnerId = A), u && (l.activeIntegration = u), h && (l.transactionOwnerId = h), g && (l.customerToken = g), m && (l["X-Application-Key"] = m), p && (l.bundleOwnerId = p), l["Allow-Moonlight-Redirect"] = "true", {
357
357
  headers: l
358
358
  };
359
359
  }), a = Ar(({ operation: i, graphQLErrors: s, networkError: o }) => {
@@ -370,7 +370,7 @@ class jr {
370
370
  }
371
371
  const B = new jr();
372
372
  let aa, na;
373
- const gt = (r, t, e) => {
373
+ const mt = (r, t, e) => {
374
374
  if (aa !== void 0)
375
375
  return aa(r, t, e);
376
376
  try {
@@ -413,14 +413,14 @@ function Cn(r) {
413
413
  }
414
414
  }
415
415
  let $e;
416
- function ga() {
416
+ function ma() {
417
417
  return $e === void 0 && ($e = Tr()), $e;
418
418
  }
419
419
  let se = null;
420
420
  const qr = (r) => new Promise((t) => {
421
421
  if (ke(r) !== "image/jpeg")
422
422
  return t(1);
423
- mr(r).then((a) => t(a || 1)).catch(() => t(1));
423
+ gr(r).then((a) => t(a || 1)).catch(() => t(1));
424
424
  }), Hr = async () => {
425
425
  if (se !== null)
426
426
  return !se;
@@ -433,10 +433,10 @@ const qr = (r) => new Promise((t) => {
433
433
  var A;
434
434
  const t = await Rr(r), e = await Zt(t), [a, n] = Yr(e);
435
435
  if (!await Hr()) {
436
- const u = gt(a, n);
436
+ const u = mt(a, n);
437
437
  return (A = u.getContext("2d")) == null || A.drawImage(e, 0, 0, a, n), u;
438
438
  }
439
- const s = await qr(r), [o, l] = s > 4 ? [n, a] : [a, n], c = gt(o, l), d = c.getContext("2d");
439
+ const s = await qr(r), [o, l] = s > 4 ? [n, a] : [a, n], c = mt(o, l), d = c.getContext("2d");
440
440
  switch (s) {
441
441
  case 2:
442
442
  d.translate(o, 0), d.scale(-1, 1);
@@ -3156,7 +3156,7 @@ const qr = (r) => new Promise((t) => {
3156
3156
  "3E2B2E",
3157
3157
  "101820",
3158
3158
  "3D3935"
3159
- ], Ue = Ft.map((r) => [
3159
+ ], Le = Ft.map((r) => [
3160
3160
  parseInt(r.substring(0, 2), 16),
3161
3161
  parseInt(r.substring(2, 4), 16),
3162
3162
  parseInt(r.substring(4, 6), 16)
@@ -3179,7 +3179,7 @@ function Nc(r, t = 64) {
3179
3179
  const i = parseInt(r.substring(0, 2), 16), s = parseInt(r.substring(2, 4), 16), o = parseInt(r.substring(4, 6), 16);
3180
3180
  let l, c, d;
3181
3181
  for (let A = 0; A < Ft.length; A++) {
3182
- l = Ue[A][0], c = Ue[A][1], d = Ue[A][2];
3182
+ l = Le[A][0], c = Le[A][1], d = Le[A][2];
3183
3183
  const u = Math.sqrt(Math.pow(i - l, 2) + Math.pow(s - c, 2) + Math.pow(o - d, 2));
3184
3184
  a.push(u);
3185
3185
  }
@@ -3187,7 +3187,7 @@ function Nc(r, t = 64) {
3187
3187
  a[A] <= t && !e.some((u) => u.pms === Yt[A]) && e.push({ pms: Yt[A], hex: Ft[A], distance: a[A] });
3188
3188
  return e.sort((A, u) => A.distance - u.distance);
3189
3189
  }
3190
- const _r = Yt.map((r, t) => ({ pms: r, hex: Ft[t] })), Xr = new gr(_r, { keys: ["pms"] });
3190
+ const _r = Yt.map((r, t) => ({ pms: r, hex: Ft[t] })), Xr = new mr(_r, { keys: ["pms"] });
3191
3191
  function Qc(r, t) {
3192
3192
  return Xr.search(r, t ? { limit: t } : void 0);
3193
3193
  }
@@ -3277,8 +3277,8 @@ const oe = (r) => {
3277
3277
  n.split(";").forEach((d) => {
3278
3278
  const A = d.trim();
3279
3279
  if (A) {
3280
- const [u, h] = A.split(":"), m = u.toLowerCase();
3281
- ei.indexOf(m) > -1 ? a.setAttribute(m, h.trim()) : l.push(A);
3280
+ const [u, h] = A.split(":"), g = u.toLowerCase();
3281
+ ei.indexOf(g) > -1 ? a.setAttribute(g, h.trim()) : l.push(A);
3282
3282
  }
3283
3283
  }), l.length > 0 ? a.setAttribute("style", l.join(";")) : a.removeAttribute("style");
3284
3284
  }
@@ -3558,7 +3558,7 @@ class hi {
3558
3558
  if (this.cache.has(t)) {
3559
3559
  const n = this.cache.get(t);
3560
3560
  if (!n)
3561
- throw new z("Failed to get asset from cache!");
3561
+ throw new G("Failed to get asset from cache!");
3562
3562
  return n;
3563
3563
  }
3564
3564
  const a = (async () => (await ve([t]))[0])();
@@ -3585,7 +3585,7 @@ class hi {
3585
3585
  */
3586
3586
  cacheAsset(t) {
3587
3587
  if (!t.key)
3588
- throw new z("Asset has no key!");
3588
+ throw new G("Asset has no key!");
3589
3589
  this.cache.has(t.key) || this.cache.set(t.key, Promise.resolve(t));
3590
3590
  }
3591
3591
  /**
@@ -3593,7 +3593,7 @@ class hi {
3593
3593
  */
3594
3594
  cacheMaterial(t) {
3595
3595
  if (!t.id)
3596
- throw new z("Material has no id!");
3596
+ throw new G("Material has no id!");
3597
3597
  this.materialCache.has(t.id) || this.materialCache.set(t.id, Promise.resolve(t));
3598
3598
  }
3599
3599
  /**
@@ -3711,7 +3711,7 @@ class hi {
3711
3711
  case "mkv":
3712
3712
  return "video/x-matroska";
3713
3713
  default:
3714
- throw new z("Unexpected mimetype: " + e);
3714
+ throw new G("Unexpected mimetype: " + e);
3715
3715
  }
3716
3716
  }
3717
3717
  }
@@ -3768,7 +3768,7 @@ const Rt = "persistentAssets", En = class Ct {
3768
3768
  };
3769
3769
  En.callbacks = [];
3770
3770
  let It = En;
3771
- const Ua = "bgrmPersistentAssets";
3771
+ const La = "bgrmPersistentAssets";
3772
3772
  class K {
3773
3773
  static has(t) {
3774
3774
  return K.getMap().has(t);
@@ -3795,14 +3795,14 @@ class K {
3795
3795
  a && (e.delete(a), K.setMap(e));
3796
3796
  }
3797
3797
  static getMap() {
3798
- return N.getMap(Ua) || /* @__PURE__ */ new Map();
3798
+ return N.getMap(La) || /* @__PURE__ */ new Map();
3799
3799
  }
3800
3800
  static setMap(t) {
3801
- N.setMap(Ua, t);
3801
+ N.setMap(La, t);
3802
3802
  }
3803
3803
  }
3804
- const U = new hi();
3805
- class mi {
3804
+ const L = new hi();
3805
+ class gi {
3806
3806
  constructor() {
3807
3807
  this.cache = {}, this.disabled = !1;
3808
3808
  }
@@ -3833,7 +3833,7 @@ class mi {
3833
3833
  this.disabled = t;
3834
3834
  }
3835
3835
  }
3836
- const Jt = new mi(), bn = v`
3836
+ const Jt = new gi(), bn = v`
3837
3837
  fragment OptionFields on Option {
3838
3838
  id
3839
3839
  name
@@ -3870,7 +3870,7 @@ const Jt = new mi(), bn = v`
3870
3870
  ...AssetFields
3871
3871
  }
3872
3872
  }
3873
- `, gi = v`
3873
+ `, mi = v`
3874
3874
  ${te(!1)}
3875
3875
  ${wa}
3876
3876
  ${bn}
@@ -3881,7 +3881,7 @@ const Jt = new mi(), bn = v`
3881
3881
  }
3882
3882
  `, pi = async (r) => {
3883
3883
  const t = await B.getShadowGraphqlClient().query({
3884
- query: gi,
3884
+ query: mi,
3885
3885
  errorPolicy: "all",
3886
3886
  variables: {
3887
3887
  ids: r
@@ -3889,8 +3889,8 @@ const Jt = new mi(), bn = v`
3889
3889
  });
3890
3890
  return t.data.options.forEach((e) => {
3891
3891
  var a, n;
3892
- (a = e.defaultVariant) != null && a.asset && U.cacheAsset(e.defaultVariant.asset), e.colorProfile && U.cacheAsset(e.colorProfile), (n = e.variants) == null || n.forEach((i) => {
3893
- i.asset && U.cacheAsset(i.asset), i.thumbnail && U.cacheAsset(i.thumbnail), i.material && U.cacheMaterial(i.material);
3892
+ (a = e.defaultVariant) != null && a.asset && L.cacheAsset(e.defaultVariant.asset), e.colorProfile && L.cacheAsset(e.colorProfile), (n = e.variants) == null || n.forEach((i) => {
3893
+ i.asset && L.cacheAsset(i.asset), i.thumbnail && L.cacheAsset(i.thumbnail), i.material && L.cacheMaterial(i.material);
3894
3894
  });
3895
3895
  }), t.data.options;
3896
3896
  }, fi = async (r, t) => (await t).find((a) => a.id === r), Ci = async (r) => {
@@ -5112,7 +5112,7 @@ const Y = new wi(), Bn = v`
5112
5112
  ...ActiveIntegrationFields
5113
5113
  }
5114
5114
  }
5115
- `, Ui = v`
5115
+ `, Li = v`
5116
5116
  ${Ne}
5117
5117
  query ReadTransactionForMarketplaceTheme($id: String!) {
5118
5118
  transactions(ids: [$id]) {
@@ -5121,7 +5121,7 @@ const Y = new wi(), Bn = v`
5121
5121
  }
5122
5122
  }
5123
5123
  }
5124
- `, Li = v`
5124
+ `, Ui = v`
5125
5125
  ${Ne}
5126
5126
  query ReadBundleForMarketplaceTheme($id: String!) {
5127
5127
  bundles(ids: [$id]) {
@@ -5137,7 +5137,7 @@ const Y = new wi(), Bn = v`
5137
5137
  internalId
5138
5138
  }
5139
5139
  }
5140
- `, zi = v`
5140
+ `, Gi = v`
5141
5141
  query CurrencyConversion($from: String!, $to: String!) {
5142
5142
  currencyConversion(from: $from, to: $to) {
5143
5143
  rateFrom
@@ -5145,7 +5145,7 @@ const Y = new wi(), Bn = v`
5145
5145
  timestamp
5146
5146
  }
5147
5147
  }
5148
- `, Ot = [P.SilentIllustration, P.ProductOverlay], Gi = async (r) => {
5148
+ `, Ot = [P.SilentIllustration, P.ProductOverlay], zi = async (r) => {
5149
5149
  const t = [];
5150
5150
  r.introduction && t.push({
5151
5151
  name: "Introduction",
@@ -5328,9 +5328,9 @@ 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 === qt.FreeDesign && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ F("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ F("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, g = 2 * ((l == null ? void 0 : l.scale) || 1), m = A || { x: 0, y: 0, width: u, height: i }, p = `${m.x} ${m.y} ${m.width} ${m.height}`, f = Q(), C = a.purpose === qt.FreeDesign && /* @__PURE__ */ k("defs", { children: /* @__PURE__ */ k("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ k("rect", { width: m.width, height: m.height, rx: h }) }) }), w = (E = a.colorProfiles) == null ? void 0 : E.map((b, I) => (
5332
5332
  /* @ts-ignore */
5333
- /* @__PURE__ */ F("color-profile", { name: b.name, xlinkHref: b.key, children: " " }, I)
5333
+ /* @__PURE__ */ k("color-profile", { name: b.name, xlinkHref: b.key, children: " " }, I)
5334
5334
  )), S = n.map((b) => ({
5335
5335
  ...b,
5336
5336
  _renderingConfiguration: a,
@@ -5357,17 +5357,17 @@ const Q = () => {
5357
5357
  children: [
5358
5358
  w,
5359
5359
  C,
5360
- !!r && /* @__PURE__ */ F(
5360
+ !!r && /* @__PURE__ */ k(
5361
5361
  "rect",
5362
5362
  {
5363
5363
  id: "layout-background",
5364
- width: g.width,
5365
- height: g.height,
5364
+ width: m.width,
5365
+ height: m.height,
5366
5366
  fill: r,
5367
5367
  rx: h
5368
5368
  }
5369
5369
  ),
5370
- /* @__PURE__ */ F(
5370
+ /* @__PURE__ */ k(
5371
5371
  "g",
5372
5372
  {
5373
5373
  id: "element-group",
@@ -5375,7 +5375,7 @@ const Q = () => {
5375
5375
  children: y.map((b) => On(b)).filter((b) => !!b)
5376
5376
  }
5377
5377
  ),
5378
- l && /* @__PURE__ */ F(
5378
+ l && /* @__PURE__ */ k(
5379
5379
  "rect",
5380
5380
  {
5381
5381
  x: l.x,
@@ -5384,22 +5384,22 @@ const Q = () => {
5384
5384
  height: l.height,
5385
5385
  fill: "none",
5386
5386
  stroke: l.hidden ? "none" : t || "#aaaaaa",
5387
- strokeWidth: m / 2,
5388
- strokeDasharray: `${m * 2} ${m}`
5387
+ strokeWidth: g / 2,
5388
+ strokeDasharray: `${g * 2} ${g}`
5389
5389
  }
5390
5390
  ),
5391
5391
  l && /* @__PURE__ */ ct("mask", { id: `viewmask-${f}`, children: [
5392
- /* @__PURE__ */ F(
5392
+ /* @__PURE__ */ k(
5393
5393
  "rect",
5394
5394
  {
5395
- x: g.x,
5396
- y: g.y,
5397
- width: g.width,
5398
- height: g.height,
5395
+ x: m.x,
5396
+ y: m.y,
5397
+ width: m.width,
5398
+ height: m.height,
5399
5399
  fill: "black"
5400
5400
  }
5401
5401
  ),
5402
- /* @__PURE__ */ F(
5402
+ /* @__PURE__ */ k(
5403
5403
  "rect",
5404
5404
  {
5405
5405
  x: l.x,
@@ -5414,7 +5414,7 @@ const Q = () => {
5414
5414
  }
5415
5415
  );
5416
5416
  }, Rc = (r, t, e, a, n) => {
5417
- const i = pt(n), s = e / 2, o = a / 2, l = r + s, c = t + o, d = Math.sin(i), A = Math.cos(i), u = s, h = s, m = -o, g = o, p = u * A - m * d, f = h * A - g * d, C = u * d + m * A, w = h * d + g * A, S = Math.max(Math.abs(p), Math.abs(f)), y = Math.max(Math.abs(C), Math.abs(w));
5417
+ const i = pt(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, g = -o, m = o, p = u * A - g * d, f = h * A - m * d, C = u * d + g * A, w = h * d + m * A, S = Math.max(Math.abs(p), Math.abs(f)), y = Math.max(Math.abs(C), Math.abs(w));
5418
5418
  return {
5419
5419
  minX: l - S,
5420
5420
  maxX: l + S,
@@ -5424,22 +5424,22 @@ const Q = () => {
5424
5424
  }, Oc = (r, t, e) => {
5425
5425
  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));
5426
5426
  return Math.acos((n * n + a * a - i * i) / (2 * n * a)) * (180 / Math.PI);
5427
- }, pt = (r) => r * (Math.PI / 180), $c = (r, t, e) => Math.abs(r - t) < e, Uc = (r, t, e) => {
5427
+ }, pt = (r) => r * (Math.PI / 180), $c = (r, t, e) => Math.abs(r - t) < e, Lc = (r, t, e) => {
5428
5428
  const a = Math.sin(pt(e)), n = Math.cos(pt(e));
5429
5429
  return {
5430
5430
  x: (r.x - t.x) * n - (r.y - t.y) * a + t.x,
5431
5431
  y: (r.x - t.x) * a + (r.y - t.y) * n + t.y
5432
5432
  };
5433
- }, Lc = (r, t) => ({
5433
+ }, Uc = (r, t) => ({
5434
5434
  x: (r.x + t.x) / 2,
5435
5435
  y: (r.y + t.y) / 2
5436
5436
  }), Vc = (r, t, e, a) => ({
5437
5437
  x: r.x + (t == null ? void 0 : t.x) * e,
5438
5438
  y: r.y + (t == null ? void 0 : t.y) * a
5439
- }), zc = (r, t, e, a) => ({
5439
+ }), Gc = (r, t, e, a) => ({
5440
5440
  x: r.x + ((t == null ? void 0 : t.x) + (t == null ? void 0 : t.width)) * e,
5441
5441
  y: r.y + (t == null ? void 0 : t.y) * a
5442
- }), Gc = (r, t, e, a) => ({
5442
+ }), zc = (r, t, e, a) => ({
5443
5443
  x: r.x + ((t == null ? void 0 : t.x) + (t == null ? void 0 : t.width)) * e,
5444
5444
  y: r.y + ((t == null ? void 0 : t.y) + (t == null ? void 0 : t.height)) * a
5445
5445
  }), Pt = (r) => {
@@ -5493,7 +5493,7 @@ const Q = () => {
5493
5493
  };
5494
5494
  }, qc = 0.352778, Hc = 0.035277, Mn = (r) => {
5495
5495
  const t = r.rotation || 0, e = pt(t), a = Math.cos(e), n = -Math.sin(e);
5496
- return /* @__PURE__ */ F("g", { mask: r.stepName || r.productOverlay ? void 0 : r.mask, children: /* @__PURE__ */ F(
5496
+ return /* @__PURE__ */ k("g", { mask: r.stepName || r.productOverlay ? void 0 : r.mask, children: /* @__PURE__ */ k(
5497
5497
  "g",
5498
5498
  {
5499
5499
  transform: `
@@ -5502,7 +5502,7 @@ const Q = () => {
5502
5502
  matrix(${a}, ${-n}, ${n}, ${a}, 0, 0)
5503
5503
  matrix(1, 0, 0, 1, ${-r.width / 2}, ${-r.height / 2})
5504
5504
  `,
5505
- children: /* @__PURE__ */ F(
5505
+ children: /* @__PURE__ */ k(
5506
5506
  "image",
5507
5507
  {
5508
5508
  xlinkHref: r.src,
@@ -5516,8 +5516,8 @@ const Q = () => {
5516
5516
  }, Tn = (r) => {
5517
5517
  var l;
5518
5518
  const t = `spiff-group-clip-${r.id}`, e = r.rotation || 0, a = pt(e), n = Math.cos(a), i = -Math.sin(a), s = va(r.children);
5519
- return /* @__PURE__ */ ct(Gt, { children: [
5520
- /* @__PURE__ */ F("defs", { children: (() => /* @__PURE__ */ F("clipPath", { id: t, preserveAspectRatio: "none", children: r.clipPath ? /* @__PURE__ */ F("path", { d: r.clipPath }) : /* @__PURE__ */ F("rect", { x: 0, y: 0, width: r.width, height: r.height }) }))() }),
5519
+ return /* @__PURE__ */ ct(zt, { children: [
5520
+ /* @__PURE__ */ k("defs", { children: (() => /* @__PURE__ */ k("clipPath", { id: t, preserveAspectRatio: "none", children: r.clipPath ? /* @__PURE__ */ k("path", { d: r.clipPath }) : /* @__PURE__ */ k("rect", { x: 0, y: 0, width: r.width, height: r.height }) }))() }),
5521
5521
  /* @__PURE__ */ ct(
5522
5522
  "g",
5523
5523
  {
@@ -5528,7 +5528,7 @@ const Q = () => {
5528
5528
  matrix(1, 0, 0, 1, ${-r.width / 2}, ${-r.height / 2})
5529
5529
  `,
5530
5530
  children: [
5531
- (l = r._renderingConfiguration) != null && l.debug ? /* @__PURE__ */ F(
5531
+ (l = r._renderingConfiguration) != null && l.debug ? /* @__PURE__ */ k(
5532
5532
  "rect",
5533
5533
  {
5534
5534
  stroke: "red",
@@ -5540,7 +5540,7 @@ const Q = () => {
5540
5540
  height: r.height
5541
5541
  }
5542
5542
  ) : void 0,
5543
- s.map((c) => On(c)).filter((c) => !!c).map((c) => /* @__PURE__ */ F("g", { clipPath: `url(#${t})`, children: c }))
5543
+ s.map((c) => On(c)).filter((c) => !!c).map((c) => /* @__PURE__ */ k("g", { clipPath: `url(#${t})`, children: c }))
5544
5544
  ]
5545
5545
  }
5546
5546
  )
@@ -5556,9 +5556,9 @@ const Q = () => {
5556
5556
  return r.pattern.src;
5557
5557
  };
5558
5558
  if (!a())
5559
- return /* @__PURE__ */ F(Gt, {});
5560
- const n = () => r.threshold ? r.invertThreshold ? "1 ".repeat(r.threshold) + "0 ".repeat(256 - r.threshold) : "0 ".repeat(r.threshold) + "1 ".repeat(256 - r.threshold) : "", i = () => /* @__PURE__ */ F(Gt, { children: r.useThreshold && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ ct("filter", { id: e, "color-interpolation-filters": "sRGB", children: [
5561
- /* @__PURE__ */ F(
5559
+ return /* @__PURE__ */ k(zt, {});
5560
+ const n = () => r.threshold ? r.invertThreshold ? "1 ".repeat(r.threshold) + "0 ".repeat(256 - r.threshold) : "0 ".repeat(r.threshold) + "1 ".repeat(256 - r.threshold) : "", i = () => /* @__PURE__ */ k(zt, { children: r.useThreshold && /* @__PURE__ */ k("defs", { children: /* @__PURE__ */ ct("filter", { id: e, "color-interpolation-filters": "sRGB", children: [
5561
+ /* @__PURE__ */ k(
5562
5562
  "feColorMatrix",
5563
5563
  {
5564
5564
  type: "matrix",
@@ -5572,23 +5572,23 @@ const Q = () => {
5572
5572
  }
5573
5573
  ),
5574
5574
  /* @__PURE__ */ ct("feComponentTransfer", { in: "greyscale", children: [
5575
- /* @__PURE__ */ F("feFuncR", { type: "discrete", tableValues: n() }),
5576
- /* @__PURE__ */ F("feFuncG", { type: "discrete", tableValues: n() }),
5577
- /* @__PURE__ */ F("feFuncB", { type: "discrete", tableValues: n() })
5575
+ /* @__PURE__ */ k("feFuncR", { type: "discrete", tableValues: n() }),
5576
+ /* @__PURE__ */ k("feFuncG", { type: "discrete", tableValues: n() }),
5577
+ /* @__PURE__ */ k("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, x, 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, x, F, 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, g = ((E = r.pattern) == null ? void 0 : E.height) || 0, m = ((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 [(x = r.pattern) != null && x.svg ? {
5583
5583
  id: `${t}-contents`,
5584
5584
  type: M.Illustration,
5585
5585
  x: A,
5586
5586
  y: u,
5587
5587
  rotation: f,
5588
- width: h * g,
5589
- height: m * p,
5588
+ width: h * m,
5589
+ height: g * p,
5590
5590
  src: a(),
5591
- svg: (k = r.pattern) == null ? void 0 : k.svg,
5591
+ svg: (F = r.pattern) == null ? void 0 : F.svg,
5592
5592
  colors: (T = r.pattern) == null ? void 0 : T.colors
5593
5593
  } : {
5594
5594
  id: `${t}-contents`,
@@ -5596,20 +5596,20 @@ const Q = () => {
5596
5596
  x: A,
5597
5597
  y: u,
5598
5598
  rotation: f,
5599
- width: h * g,
5600
- height: m * p,
5599
+ width: h * m,
5600
+ height: g * p,
5601
5601
  src: a()
5602
5602
  }];
5603
5603
  };
5604
- return /* @__PURE__ */ ct(Gt, { children: [
5604
+ return /* @__PURE__ */ ct(zt, { children: [
5605
5605
  i(),
5606
- /* @__PURE__ */ F(
5606
+ /* @__PURE__ */ k(
5607
5607
  "g",
5608
5608
  {
5609
5609
  opacity: r.opacity,
5610
5610
  mask: r.stepName ? void 0 : r.mask,
5611
5611
  filter: r.useThreshold ? `url(#${e})` : void 0,
5612
- children: /* @__PURE__ */ F(
5612
+ children: /* @__PURE__ */ k(
5613
5613
  "g",
5614
5614
  {
5615
5615
  transform: `
@@ -5619,7 +5619,7 @@ const Q = () => {
5619
5619
  matrix(1, 0, 0, 1, ${-r.width / 2}, ${-r.height / 2})
5620
5620
  matrix(${r.scaleX}, 0, 0, ${r.scaleY}, 0, 0)
5621
5621
  `,
5622
- children: /* @__PURE__ */ F(
5622
+ children: /* @__PURE__ */ k(
5623
5623
  Tn,
5624
5624
  {
5625
5625
  id: t,
@@ -5688,15 +5688,15 @@ class Ji {
5688
5688
  }), a - n;
5689
5689
  }
5690
5690
  }
5691
- const Ki = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @__PURE__ */ new Map(), Nt = async (r) => {
5692
- if (Le.has(r))
5693
- return Le.get(r);
5691
+ const Ki = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ue = /* @__PURE__ */ new Map(), Nt = async (r) => {
5692
+ if (Ue.has(r))
5693
+ return Ue.get(r);
5694
5694
  const e = (async () => {
5695
5695
  try {
5696
5696
  return Et(r).getFont();
5697
5697
  } catch {
5698
5698
  if (Ki(r)) {
5699
- const a = gn(r), n = Xe(a);
5699
+ const a = mn(r), n = Xe(a);
5700
5700
  return ra(r, n), n;
5701
5701
  } else {
5702
5702
  const a = await Fe(r, !0), n = Xe(a);
@@ -5704,9 +5704,9 @@ const Ki = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5704
5704
  }
5705
5705
  }
5706
5706
  })();
5707
- return Le.set(r, e), e;
5707
+ return Ue.set(r, e), e;
5708
5708
  }, _i = (r) => {
5709
- const t = gn(r), e = Xe(t);
5709
+ const t = mn(r), e = Xe(t);
5710
5710
  return ra(r, e), e;
5711
5711
  }, Et = (r) => {
5712
5712
  const t = Nn.get(r);
@@ -5721,18 +5721,18 @@ const Ki = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5721
5721
  a.querySelectorAll("style").forEach((d) => {
5722
5722
  var u;
5723
5723
  (u = on(d.innerHTML).stylesheet) == null || u.rules.forEach((h) => {
5724
- var m, g, p;
5724
+ var g, m, p;
5725
5725
  if (h.type === "font-face" && h.declarations) {
5726
- const f = (m = h.declarations.find(
5726
+ const f = (g = h.declarations.find(
5727
5727
  (S) => S.property === "font-family"
5728
- )) == null ? void 0 : m.value, C = (g = h.declarations.find((S) => S.property === "src")) == null ? void 0 : g.value, w = (p = C == null ? void 0 : C.match(/'(https.*?)'/)) == null ? void 0 : p[1];
5728
+ )) == null ? void 0 : g.value, C = (m = h.declarations.find((S) => S.property === "src")) == null ? void 0 : m.value, w = (p = C == null ? void 0 : C.match(/'(https.*?)'/)) == null ? void 0 : p[1];
5729
5729
  f && w && n.set(f, w);
5730
5730
  }
5731
5731
  });
5732
5732
  });
5733
5733
  const s = e.querySelectorAll("tspan");
5734
5734
  for (let d = 0; d < s.length; d++) {
5735
- const A = s.item(d), u = A.closest("text"), h = A.closest("g"), m = u.getAttribute("font-family"), g = await Nt(n.get(m)), p = u.getAttribute("fill"), f = u.getAttribute("stroke"), C = u.getAttribute("stroke-width"), w = g.getPath(
5735
+ const A = s.item(d), u = A.closest("text"), h = A.closest("g"), g = u.getAttribute("font-family"), m = await Nt(n.get(g)), p = u.getAttribute("fill"), f = u.getAttribute("stroke"), C = u.getAttribute("stroke-width"), w = m.getPath(
5736
5736
  A.innerHTML,
5737
5737
  0,
5738
5738
  0,
@@ -5741,7 +5741,7 @@ const Ki = (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 = m.getPath(
5745
5745
  A.innerHTML,
5746
5746
  parseFloat(A.getAttribute("x") ?? "0") - y,
5747
5747
  parseFloat(A.getAttribute("y") ?? "0"),
@@ -5753,11 +5753,11 @@ const Ki = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5753
5753
  }
5754
5754
  return e.querySelectorAll("text").forEach((d) => d.remove()), Bt().serializeToString(a);
5755
5755
  }, Ee = (r, t, e, a) => Math.max(es(r.join(`
5756
- `), e, a), t), La = (r, t, e, a, n, i) => {
5756
+ `), e, a), t), Ua = (r, t, e, a, n, i) => {
5757
5757
  const s = (i || ya) * n.getApproximateHeight(), o = t.split(`
5758
5758
  `);
5759
5759
  try {
5760
- const l = o.flatMap((d) => me(d, r.width, a, n)), c = l.flatMap((d) => d.lines);
5760
+ const l = o.flatMap((d) => ge(d, r.width, a, n)), c = l.flatMap((d) => d.lines);
5761
5761
  return {
5762
5762
  lines: c,
5763
5763
  requiredHeight: l.flatMap((d) => d.lines).length * (a * s),
@@ -5773,14 +5773,14 @@ const Ki = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5773
5773
  requiredWidth: Ee(c, r.width, a, n)
5774
5774
  };
5775
5775
  }
5776
- }, me = (r, t, e, a) => {
5776
+ }, ge = (r, t, e, a) => {
5777
5777
  const n = ht(r, e, a);
5778
5778
  if (n <= t)
5779
5779
  return { lines: [r], width: n };
5780
5780
  if (!(r.indexOf(" ") > -1)) {
5781
5781
  if (r.length <= 1)
5782
5782
  throw new Error(`Character ${r} is wider than region`);
5783
- const d = Math.floor(r.length / 2), A = me(r.slice(0, d), t, e, a), u = me(r.slice(d), t, e, a);
5783
+ const d = Math.floor(r.length / 2), A = ge(r.slice(0, d), t, e, a), u = ge(r.slice(d), t, e, a);
5784
5784
  return { lines: [...A.lines, ...u.lines], width: Math.max(A.width, u.width) };
5785
5785
  }
5786
5786
  const s = r.split(" "), o = [];
@@ -5788,15 +5788,15 @@ const Ki = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5788
5788
  for (; c < s.length; ) {
5789
5789
  const d = s[c];
5790
5790
  if (ht(d, e, a) > t) {
5791
- const A = me(d, t, e, a);
5791
+ const A = ge(d, t, e, a);
5792
5792
  o.push(...A.lines), l = Math.max(l, A.width), c++;
5793
5793
  } else {
5794
5794
  const A = [d];
5795
5795
  l = Math.max(l, ht(d, e, a));
5796
5796
  let u = c + 1, h = !0;
5797
5797
  for (; u < s.length && h; ) {
5798
- const m = s[u], g = ht(`${A.join(" ")} ${m}`, e, a);
5799
- g <= t ? (A.push(m), l = Math.max(l, g), u++) : h = !1;
5798
+ const g = s[u], m = ht(`${A.join(" ")} ${g}`, e, a);
5799
+ m <= t ? (A.push(g), l = Math.max(l, m), u++) : h = !1;
5800
5800
  }
5801
5801
  o.push(A.join(" ")), c = u;
5802
5802
  }
@@ -5811,7 +5811,7 @@ const Ki = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5811
5811
  var c;
5812
5812
  const n = Et(t.fontData.assetUrl), i = n.getFont(), s = t.fontSize / i.unitsPerEm;
5813
5813
  if (!e)
5814
- return La(t, r, t.fontSize, s, n, a);
5814
+ return Ua(t, r, t.fontSize, s, n, a);
5815
5815
  let o;
5816
5816
  if (t.text ? o = t.text.split(`
5817
5817
  `) : o = ((c = t.input) == null ? void 0 : c.split(`
@@ -5828,7 +5828,7 @@ const Ki = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5828
5828
  requiredHeight: t.height,
5829
5829
  requiredWidth: Ee(o, t.width, s, n),
5830
5830
  fontSize: Xi(o, n, i, t.width, t.height, a)
5831
- } : La(t, r, t.fontSize, s, n, a);
5831
+ } : Ua(t, r, t.fontSize, s, n, a);
5832
5832
  }, ts = (r, t, e, a, n) => {
5833
5833
  const s = Et(t.assetUrl).getFont();
5834
5834
  let o = { ...r };
@@ -5885,25 +5885,25 @@ const Ki = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5885
5885
  };
5886
5886
  })()
5887
5887
  } : r, ya = 1.1, rs = (r) => {
5888
- var m, g, p, f, C;
5888
+ var g, m, p, f, C;
5889
5889
  const e = (r.rotation || 0) * Math.PI / 180, a = Math.cos(e), n = -Math.sin(e), i = `text-path-${r.id}`, s = `text-fill-${r.id}`, o = r.x + (r.curved ? 0 : r.width / 2), l = r.y + (r.curved ? 0 : r.height / 2);
5890
5890
  let c = "";
5891
5891
  try {
5892
- c = fr.compile(r.text || "")((m = r._renderingConfiguration) == null ? void 0 : m.templatingContext);
5892
+ c = fr.compile(r.text || "")((g = r._renderingConfiguration) == null ? void 0 : g.templatingContext);
5893
5893
  } catch {
5894
5894
  c = r.text ?? "";
5895
5895
  }
5896
5896
  const d = c.split(`
5897
- `), A = (g = r.strokeColor) != null && g.browserValue && r.strokeThickness ? (p = r.strokeColor) == null ? void 0 : p.browserValue : void 0, u = (f = r.strokeColor) != null && f.browserValue && r.strokeThickness ? r.strokeThickness : void 0;
5897
+ `), A = (m = r.strokeColor) != null && m.browserValue && r.strokeThickness ? (p = r.strokeColor) == null ? void 0 : p.browserValue : void 0, u = (f = r.strokeColor) != null && f.browserValue && r.strokeThickness ? r.strokeThickness : void 0;
5898
5898
  if (r.curved && !r.paths || !r.fontData)
5899
5899
  return null;
5900
5900
  const h = () => {
5901
5901
  var w;
5902
5902
  return r.textFillImage ? `url("#${s}")` : (w = r._renderingConfiguration) != null && w.spotColors && r.fillSpotColorDefinition ? `${r.fill} ${wn(r.fillSpotColorDefinition)}` : r.fill;
5903
5903
  };
5904
- return /* @__PURE__ */ ct(Gt, { children: [
5904
+ return /* @__PURE__ */ ct(zt, { children: [
5905
5905
  /* @__PURE__ */ ct("defs", { children: [
5906
- r.textFillImage && /* @__PURE__ */ F(
5906
+ r.textFillImage && /* @__PURE__ */ k(
5907
5907
  "pattern",
5908
5908
  {
5909
5909
  id: s,
@@ -5912,7 +5912,7 @@ const Ki = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5912
5912
  height: r.textFillImage.scale * r.textFillImage.height,
5913
5913
  x: 0,
5914
5914
  y: 0,
5915
- children: /* @__PURE__ */ F(
5915
+ children: /* @__PURE__ */ k(
5916
5916
  "image",
5917
5917
  {
5918
5918
  href: r.textFillImage.src,
@@ -5923,7 +5923,7 @@ const Ki = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5923
5923
  )
5924
5924
  }
5925
5925
  ),
5926
- /* @__PURE__ */ F(
5926
+ /* @__PURE__ */ k(
5927
5927
  "style",
5928
5928
  {
5929
5929
  type: "text/css",
@@ -5937,10 +5937,10 @@ const Ki = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5937
5937
  }
5938
5938
  }
5939
5939
  ),
5940
- r.curved && r.paths ? /* @__PURE__ */ F("path", { id: i, d: r.paths[0] }) : void 0
5940
+ r.curved && r.paths ? /* @__PURE__ */ k("path", { id: i, d: r.paths[0] }) : void 0
5941
5941
  ] }),
5942
- (C = r._renderingConfiguration) != null && C.debug ? /* @__PURE__ */ F("rect", { stroke: "blue", fill: "none", x: r.x, y: r.y, width: r.width, height: r.height }) : void 0,
5943
- /* @__PURE__ */ F("g", { mask: r.stepName ? void 0 : r.mask, children: /* @__PURE__ */ F("g", { transform: `matrix(${a}, ${-n}, ${n}, ${a}, ${o}, ${l})`, children: /* @__PURE__ */ F(
5942
+ (C = r._renderingConfiguration) != null && C.debug ? /* @__PURE__ */ k("rect", { stroke: "blue", fill: "none", x: r.x, y: r.y, width: r.width, height: r.height }) : void 0,
5943
+ /* @__PURE__ */ k("g", { mask: r.stepName ? void 0 : r.mask, children: /* @__PURE__ */ k("g", { transform: `matrix(${a}, ${-n}, ${n}, ${a}, ${o}, ${l})`, children: /* @__PURE__ */ k(
5944
5944
  "text",
5945
5945
  {
5946
5946
  xmlSpace: "preserve",
@@ -5955,7 +5955,7 @@ const Ki = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5955
5955
  },
5956
5956
  stroke: A,
5957
5957
  strokeWidth: u,
5958
- children: r.curved ? /* @__PURE__ */ F(ss, { text: c, curvedPathId: i, align: r.align }) : d.map((w, S) => /* @__PURE__ */ F(
5958
+ children: r.curved ? /* @__PURE__ */ k(ss, { text: c, curvedPathId: i, align: r.align }) : d.map((w, S) => /* @__PURE__ */ k(
5959
5959
  is,
5960
5960
  {
5961
5961
  align: r.vertical ? "center" : r.align,
@@ -5986,10 +5986,10 @@ const Ki = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5986
5986
  const s = (r.amountLines - 1) / 2;
5987
5987
  return (r.thisLineIdx - s) * n + r.fontSize / 4;
5988
5988
  };
5989
- return /* @__PURE__ */ F("tspan", { textAnchor: Rn(r.align), x: e(), y: `${a()}px`, children: r.text });
5989
+ return /* @__PURE__ */ k("tspan", { textAnchor: Rn(r.align), x: e(), y: `${a()}px`, children: r.text });
5990
5990
  }, ss = (r) => {
5991
5991
  const t = `#${r.curvedPathId}`;
5992
- return /* @__PURE__ */ F(
5992
+ return /* @__PURE__ */ k(
5993
5993
  "textPath",
5994
5994
  {
5995
5995
  startOffset: (() => r.align === "left" ? "0%" : r.align === "right" ? "100%" : "50%")(),
@@ -6002,7 +6002,7 @@ const Ki = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
6002
6002
  }, os = (r) => {
6003
6003
  var s, o;
6004
6004
  if (r.cachedObjectURL && !((s = r._renderingConfiguration) != null && s.omitCachedFields))
6005
- return /* @__PURE__ */ F(
6005
+ return /* @__PURE__ */ k(
6006
6006
  Mn,
6007
6007
  {
6008
6008
  id: r.id,
@@ -6027,7 +6027,7 @@ const Ki = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
6027
6027
  throw new Error(
6028
6028
  `Illustration element ${r.id} (stepName ${r.stepName}) lacked svg from src ${r.src} at render time.`
6029
6029
  );
6030
- return /* @__PURE__ */ F("g", { mask: r.stepName ? void 0 : r.mask, children: /* @__PURE__ */ F(
6030
+ return /* @__PURE__ */ k("g", { mask: r.stepName ? void 0 : r.mask, children: /* @__PURE__ */ k(
6031
6031
  "g",
6032
6032
  {
6033
6033
  transform: i,
@@ -6135,9 +6135,9 @@ class ls {
6135
6135
  return { ...t, transaction: e.apply(a) };
6136
6136
  }
6137
6137
  }
6138
- const On = (r) => r.type === M.Image ? /* @__PURE__ */ F(Mn, { ...r }, r.id) : r.type === M.Frame ? /* @__PURE__ */ F(Yi, { ...r }, r.id) : r.type === M.Illustration ? /* @__PURE__ */ F(os, { ...r }, r.id) : r.type === M.Textbox ? /* @__PURE__ */ F(rs, { ...r }, r.id) : r.type === M.Group ? /* @__PURE__ */ F(Tn, { ...r }, r.id) : null, Sa = (r, t, e) => {
6138
+ const On = (r) => r.type === M.Image ? /* @__PURE__ */ k(Mn, { ...r }, r.id) : r.type === M.Frame ? /* @__PURE__ */ k(Yi, { ...r }, r.id) : r.type === M.Illustration ? /* @__PURE__ */ k(os, { ...r }, r.id) : r.type === M.Textbox ? /* @__PURE__ */ k(rs, { ...r }, r.id) : r.type === M.Group ? /* @__PURE__ */ k(Tn, { ...r }, r.id) : null, Sa = (r, t, e) => {
6139
6139
  const a = e.renderingConfiguration, n = a != null && a.removeExcludedElements ? t.filter((i) => !i.excludeFromExport) : t;
6140
- return /* @__PURE__ */ F(
6140
+ return /* @__PURE__ */ k(
6141
6141
  Hi,
6142
6142
  {
6143
6143
  preserveAspectRatio: void 0,
@@ -6185,7 +6185,7 @@ const ae = (r) => {
6185
6185
  if (r.defaultVariant !== void 0)
6186
6186
  return t.find((e) => e.id === r.defaultVariant);
6187
6187
  }
6188
- }, At = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(), ze = /* @__PURE__ */ new Map(), $n = async (r, t) => {
6188
+ }, At = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(), Ge = /* @__PURE__ */ new Map(), $n = async (r, t) => {
6189
6189
  if (!t) {
6190
6190
  if (!r)
6191
6191
  throw new Error("No region or src supplied. Cannot construct frame!");
@@ -6209,8 +6209,8 @@ const ae = (r) => {
6209
6209
  throw new Error(`No asset for variant with ID: ${r.frameVariantId}`);
6210
6210
  return e;
6211
6211
  }, Qe = async (r) => {
6212
- if (ze.has(r))
6213
- return ze.get(r);
6212
+ if (Ge.has(r))
6213
+ return Ge.get(r);
6214
6214
  const e = (async () => {
6215
6215
  if (Vt.has(r))
6216
6216
  return Vt.get(r);
@@ -6246,7 +6246,7 @@ const ae = (r) => {
6246
6246
  }
6247
6247
  throw new Error("Malformed frame SVG");
6248
6248
  })();
6249
- return ze.set(r, e), e;
6249
+ return Ge.set(r, e), e;
6250
6250
  }, Ea = (r, t, e, a) => {
6251
6251
  const n = t.width / t.height, i = r.width / r.height;
6252
6252
  let s;
@@ -6262,7 +6262,7 @@ const ae = (r) => {
6262
6262
  if (At.has(r))
6263
6263
  return At.get(r);
6264
6264
  if (r.startsWith("data:image/svg+xml")) {
6265
- const a = Cr(r), n = new TextDecoder().decode(a.buffer), i = Un(n), s = {
6265
+ const a = Cr(r), n = new TextDecoder().decode(a.buffer), i = Ln(n), s = {
6266
6266
  src: r,
6267
6267
  width: i.width,
6268
6268
  height: i.height,
@@ -6289,12 +6289,12 @@ const ae = (r) => {
6289
6289
  }
6290
6290
  }, ba = async (r) => {
6291
6291
  const t = await at(r);
6292
- return Un(t);
6293
- }, za = (r) => r.endsWith("mm") ? Number(r.replace("mm", "")) * 3.7795275591 : r.endsWith("px") ? Number(r.replace("px", "")) : Number(r), Un = (r) => {
6292
+ return Ln(t);
6293
+ }, Ga = (r) => r.endsWith("mm") ? Number(r.replace("mm", "")) * 3.7795275591 : r.endsWith("px") ? Number(r.replace("px", "")) : Number(r), Ln = (r) => {
6294
6294
  const a = dt().parseFromString(r, "image/svg+xml").querySelector("svg");
6295
6295
  if (!a)
6296
6296
  throw new Error("No svg tag found, this svg must be malformed!");
6297
- const n = a.getAttribute("viewBox"), i = a.getAttribute("width"), s = a.getAttribute("height"), o = s && i ? [0, 0, za(i), za(s)] : n == null ? void 0 : n.split(" ").map((l) => Number(l));
6297
+ const n = a.getAttribute("viewBox"), i = a.getAttribute("width"), s = a.getAttribute("height"), o = s && i ? [0, 0, Ga(i), Ga(s)] : n == null ? void 0 : n.split(" ").map((l) => Number(l));
6298
6298
  if (!o)
6299
6299
  throw new Error("No viewbox or width/height values detected on SVG file!");
6300
6300
  return {
@@ -6304,13 +6304,13 @@ const ae = (r) => {
6304
6304
  }, $t = (r, t) => {
6305
6305
  const e = r.layoutState.elements.filter((n) => n.layer === t), a = Math.max(...e.map((n) => n.layerIndex).filter((n) => n !== void 0));
6306
6306
  return Math.max(a, 0) + 1;
6307
- }, Ln = async (r) => new Promise((t) => {
6307
+ }, Un = async (r) => new Promise((t) => {
6308
6308
  at(r).then((e) => {
6309
6309
  t(e);
6310
6310
  }).catch((e) => console.error(e));
6311
- }), Ge = /* @__PURE__ */ new Map(), Kt = async (r) => {
6312
- if (Ge.has(r))
6313
- return Ge.get(r);
6311
+ }), ze = /* @__PURE__ */ new Map(), Kt = async (r) => {
6312
+ if (ze.has(r))
6313
+ return ze.get(r);
6314
6314
  const t = async (n) => new Promise((i, s) => {
6315
6315
  try {
6316
6316
  if (!(!!URL && !!URL.createObjectURL))
@@ -6327,23 +6327,23 @@ 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 = mt(), d = c.getContext("2d"), A = await Aa.from(d, l, {
6331
6331
  anonymousCrossOrigin: !0,
6332
6332
  ignoreDimensions: !1,
6333
- createCanvas: gt,
6333
+ createCanvas: mt,
6334
6334
  createImage: Zt,
6335
- DOMParser: ga(),
6335
+ DOMParser: ma(),
6336
6336
  fetch: rt
6337
- }), u = s.getAttribute("width"), h = s.getAttribute("height"), m = 2048;
6337
+ }), u = s.getAttribute("width"), h = s.getAttribute("height"), g = 2048;
6338
6338
  if (h && u) {
6339
- const g = parseFloat(h), f = parseFloat(u) / g;
6340
- f > 1 ? A.resize(m, m / f) : A.resize(m * f, m);
6339
+ const m = parseFloat(h), f = parseFloat(u) / m;
6340
+ f > 1 ? A.resize(g, g / f) : A.resize(g * f, g);
6341
6341
  } else
6342
- A.resize(m, m);
6342
+ A.resize(g, g);
6343
6343
  return await A.render(), await t(c);
6344
6344
  })();
6345
- return Ge.set(r, a), a;
6346
- }, Ut = async (r, t, e, a) => {
6345
+ return ze.set(r, a), a;
6346
+ }, Lt = async (r, t, e, a) => {
6347
6347
  const n = r.layoutState.layout.useEditableArea && r.layoutState.layout.editableArea || {
6348
6348
  width: r.layoutState.layout.width,
6349
6349
  height: r.layoutState.layout.height,
@@ -6358,10 +6358,10 @@ const ae = (r) => {
6358
6358
  panelId: r.layoutState.layout.panelId
6359
6359
  };
6360
6360
  if (e && t === M.Illustration) {
6361
- const l = await lt(await Ln(e)), u = dt().parseFromString(l.svg, "image/svg+xml").firstElementChild.getAttribute("viewBox");
6361
+ const l = await lt(await Un(e)), u = dt().parseFromString(l.svg, "image/svg+xml").firstElementChild.getAttribute("viewBox");
6362
6362
  if (!u)
6363
6363
  throw new Error("SVG missing viewBox.");
6364
- const h = o.height, m = u.split(" "), g = parseFloat(m[2]) || 1, p = parseFloat(m[3]) || 1, f = g / p;
6364
+ const h = o.height, g = u.split(" "), m = parseFloat(g[2]) || 1, p = parseFloat(g[3]) || 1, f = m / p;
6365
6365
  o.height = o.width / f, o.top += (h - o.height) / 2;
6366
6366
  }
6367
6367
  if (e && t === M.Image) {
@@ -6377,7 +6377,7 @@ const ae = (r) => {
6377
6377
  };
6378
6378
  class Jc {
6379
6379
  static async getFrame(t, e) {
6380
- const a = await $n(e.region, e.src), n = await Qe(a), i = e.region || await Ut(t, M.Frame);
6380
+ const a = await $n(e.region, e.src), n = await Qe(a), i = e.region || await Lt(t, M.Frame);
6381
6381
  return {
6382
6382
  id: Q(),
6383
6383
  x: i.left,
@@ -6403,7 +6403,7 @@ class Jc {
6403
6403
  };
6404
6404
  }
6405
6405
  static async getImage(t, e) {
6406
- const a = e.region || await Ut(t, M.Image, e.src);
6406
+ const a = e.region || await Lt(t, M.Image, e.src);
6407
6407
  return {
6408
6408
  id: Q(),
6409
6409
  src: e.src,
@@ -6420,14 +6420,14 @@ class Jc {
6420
6420
  };
6421
6421
  }
6422
6422
  static async getTextbox(t, e) {
6423
- var m;
6423
+ var g;
6424
6424
  const { configuration: a, fontSrc: n, designInputStep: i } = e, s = await Nt(n), o = {
6425
6425
  assetUrl: n,
6426
6426
  name: s.names.fullName.en
6427
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
- }), A = e.region || await Ut(t, M.Textbox, n, {
6430
+ }), A = e.region || await Lt(t, M.Textbox, n, {
6431
6431
  text: d,
6432
6432
  fontScale: a.size ? a.size / s.unitsPerEm : void 0
6433
6433
  }), u = ee(
@@ -6458,7 +6458,7 @@ class Jc {
6458
6458
  { ...A, height: u.height },
6459
6459
  o,
6460
6460
  u.fontSize,
6461
- ((m = u == null ? void 0 : u.text) == null ? void 0 : m.split(`
6461
+ ((g = u == null ? void 0 : u.text) == null ? void 0 : g.split(`
6462
6462
  `)) || [],
6463
6463
  u.align
6464
6464
  );
@@ -6493,7 +6493,7 @@ class Jc {
6493
6493
  </svg>
6494
6494
  `, n = {};
6495
6495
  n["spiff-fill-shape"] = { browserValue: e.color };
6496
- const i = e.region || await Ut(t, M.Illustration), s = Q();
6496
+ const i = e.region || await Lt(t, M.Illustration), s = Q();
6497
6497
  return {
6498
6498
  stepRegion: e.region,
6499
6499
  colors: n,
@@ -6511,7 +6511,7 @@ class Jc {
6511
6511
  };
6512
6512
  }
6513
6513
  static async getIllustration(t, e) {
6514
- const a = e.region || await Ut(t, M.Illustration, e.src), n = await lt(await Ln(e.src)), i = await Kt(n.svg), s = Q();
6514
+ const a = e.region || await Lt(t, M.Illustration, e.src), n = await lt(await Un(e.src)), i = await Kt(n.svg), s = Q();
6515
6515
  return {
6516
6516
  cachedObjectURL: i,
6517
6517
  stepRegion: e.region,
@@ -6536,7 +6536,7 @@ class V extends Error {
6536
6536
  super("Element not found!"), Object.setPrototypeOf(this, V.prototype);
6537
6537
  }
6538
6538
  }
6539
- const L = (r, t) => X(r, t).elements.find((n) => n.id === r), X = (r, t) => {
6539
+ const U = (r, t) => X(r, t).elements.find((n) => n.id === r), X = (r, t) => {
6540
6540
  const e = Object.values(t).find((a) => a.elements.some((n) => n.id === r));
6541
6541
  if (!e)
6542
6542
  throw new V();
@@ -6548,7 +6548,7 @@ const L = (r, t) => X(r, t).elements.find((n) => n.id === r), X = (r, t) => {
6548
6548
  elements: a,
6549
6549
  modificationID: Q()
6550
6550
  };
6551
- }, Ga = async (r) => {
6551
+ }, za = async (r) => {
6552
6552
  var a;
6553
6553
  const t = [...Object.keys(r.layouts)], e = [...new Set(t)];
6554
6554
  for (let n = 0; n < e.length; n++) {
@@ -6627,7 +6627,7 @@ class Kc extends O {
6627
6627
  }
6628
6628
  apply(t) {
6629
6629
  this.oldState = t;
6630
- const e = L(this.id, Object.values(t.layouts));
6630
+ const e = U(this.id, Object.values(t.layouts));
6631
6631
  if (!e.id)
6632
6632
  throw new V();
6633
6633
  const a = {
@@ -6650,7 +6650,7 @@ class _c extends O {
6650
6650
  }
6651
6651
  apply(t) {
6652
6652
  this.oldState = t;
6653
- const e = L(this.id, Object.values(t.layouts));
6653
+ const e = U(this.id, Object.values(t.layouts));
6654
6654
  if (!e.id)
6655
6655
  throw new V();
6656
6656
  const a = {
@@ -6672,7 +6672,7 @@ class Xc extends O {
6672
6672
  }
6673
6673
  apply(t) {
6674
6674
  this.oldState = t;
6675
- const e = L(this.id, Object.values(t.layouts));
6675
+ const e = U(this.id, Object.values(t.layouts));
6676
6676
  if (!e.id)
6677
6677
  throw new V();
6678
6678
  let a = {
@@ -6723,7 +6723,7 @@ class Vn extends O {
6723
6723
  };
6724
6724
  }
6725
6725
  }
6726
- class G extends O {
6726
+ class z extends O {
6727
6727
  /**
6728
6728
  * @param initialParams The initial parameters to be set on this new object
6729
6729
  * @param callback An optional callback function to be notified when the object has been instantiated
@@ -6811,7 +6811,7 @@ class ds extends O {
6811
6811
  }
6812
6812
  apply(t) {
6813
6813
  this.oldState = t;
6814
- const e = L(this.id, Object.values(t.layouts));
6814
+ const e = U(this.id, Object.values(t.layouts));
6815
6815
  if (!e.id)
6816
6816
  throw new V();
6817
6817
  const a = {
@@ -6835,7 +6835,7 @@ class We extends O {
6835
6835
  }
6836
6836
  apply(t) {
6837
6837
  this.oldState = t;
6838
- const e = L(this.id, Object.values(t.layouts));
6838
+ const e = U(this.id, Object.values(t.layouts));
6839
6839
  if (!e.id)
6840
6840
  throw new V();
6841
6841
  const a = {
@@ -6857,7 +6857,7 @@ class As extends O {
6857
6857
  }
6858
6858
  apply(t) {
6859
6859
  this.oldState = t;
6860
- const e = L(this.id, Object.values(t.layouts));
6860
+ const e = U(this.id, Object.values(t.layouts));
6861
6861
  if (!e.id)
6862
6862
  throw new V();
6863
6863
  const a = {
@@ -6879,7 +6879,7 @@ class ja extends O {
6879
6879
  }
6880
6880
  apply(t) {
6881
6881
  this.oldState = t;
6882
- const e = L(this.id, Object.values(t.layouts));
6882
+ const e = U(this.id, Object.values(t.layouts));
6883
6883
  if (!e.id)
6884
6884
  throw new V();
6885
6885
  const a = {
@@ -6901,7 +6901,7 @@ class us extends O {
6901
6901
  }
6902
6902
  apply(t) {
6903
6903
  this.oldState = t;
6904
- const e = L(this.id, Object.values(t.layouts));
6904
+ const e = U(this.id, Object.values(t.layouts));
6905
6905
  if (!e.id)
6906
6906
  throw new V();
6907
6907
  const a = {
@@ -6953,13 +6953,13 @@ class hs extends O {
6953
6953
  };
6954
6954
  }
6955
6955
  }
6956
- class ms extends O {
6956
+ class gs extends O {
6957
6957
  constructor(t, e, a, n, i) {
6958
6958
  super(), this.id = t, this.useThreshold = e, this.invertThreshold = a, this.threshold = n, this.thresholdSaturation = i;
6959
6959
  }
6960
6960
  apply(t) {
6961
6961
  this.oldState = t;
6962
- const e = L(this.id, Object.values(t.layouts));
6962
+ const e = U(this.id, Object.values(t.layouts));
6963
6963
  if (!e.id)
6964
6964
  throw new V();
6965
6965
  const a = {
@@ -6984,7 +6984,7 @@ class Zc extends O {
6984
6984
  }
6985
6985
  apply(t) {
6986
6986
  this.oldState = t;
6987
- const e = L(this.id, Object.values(t.layouts));
6987
+ const e = U(this.id, Object.values(t.layouts));
6988
6988
  if (!e.id)
6989
6989
  throw new V();
6990
6990
  const a = {
@@ -7000,13 +7000,13 @@ class Zc extends O {
7000
7000
  };
7001
7001
  }
7002
7002
  }
7003
- class gs extends O {
7003
+ class ms extends O {
7004
7004
  constructor(t, e) {
7005
7005
  super(), this.id = t, this.text = e;
7006
7006
  }
7007
7007
  apply(t) {
7008
7008
  this.oldState = t;
7009
- const e = L(this.id, Object.values(t.layouts));
7009
+ const e = U(this.id, Object.values(t.layouts));
7010
7010
  if (!e.id)
7011
7011
  throw new V();
7012
7012
  const a = X(e.id, Object.values(t.layouts)), n = Z(ee(e, this.text, e), a);
@@ -7025,7 +7025,7 @@ class je extends O {
7025
7025
  }
7026
7026
  apply(t) {
7027
7027
  this.oldState = t;
7028
- const e = L(this.id, Object.values(t.layouts));
7028
+ const e = U(this.id, Object.values(t.layouts));
7029
7029
  if (!e.id)
7030
7030
  throw new V();
7031
7031
  const a = {
@@ -7048,7 +7048,7 @@ class oa extends O {
7048
7048
  }
7049
7049
  apply(t) {
7050
7050
  this.oldState = t;
7051
- const e = L(this.id, Object.values(t.layouts));
7051
+ const e = U(this.id, Object.values(t.layouts));
7052
7052
  if (!e.id)
7053
7053
  throw new V();
7054
7054
  const a = e.colors || {}, n = a[this.className];
@@ -7080,7 +7080,7 @@ class ps extends O {
7080
7080
  }
7081
7081
  apply(t) {
7082
7082
  this.oldState = t;
7083
- const e = L(this.id, Object.values(t.layouts));
7083
+ const e = U(this.id, Object.values(t.layouts));
7084
7084
  if (!e.id)
7085
7085
  throw new V();
7086
7086
  const a = {
@@ -7105,7 +7105,7 @@ class td extends O {
7105
7105
  super(), this.id = t;
7106
7106
  }
7107
7107
  apply(t) {
7108
- if (this.oldState = t, !L(this.id, Object.values(t.layouts)).id)
7108
+ if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
7109
7109
  throw new V();
7110
7110
  const a = Object.values(t.layouts).find((s) => s.elements.find((o) => o.id === this.id));
7111
7111
  if (!a)
@@ -7135,7 +7135,7 @@ class ed extends O {
7135
7135
  }
7136
7136
  apply(t) {
7137
7137
  this.oldState = t;
7138
- const e = L(this.id, Object.values(t.layouts));
7138
+ const e = U(this.id, Object.values(t.layouts));
7139
7139
  if (!e.id)
7140
7140
  throw new V();
7141
7141
  const a = Object.values(t.layouts).find((o) => o.elements.find((l) => l.id === this.id));
@@ -7165,7 +7165,7 @@ class ad extends O {
7165
7165
  super(), this.id = t;
7166
7166
  }
7167
7167
  apply(t) {
7168
- if (this.oldState = t, !L(this.id, Object.values(t.layouts)).id)
7168
+ if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
7169
7169
  throw new V();
7170
7170
  const a = Object.values(t.layouts).find((l) => l.elements.find((c) => c.id === this.id));
7171
7171
  if (!a)
@@ -7192,7 +7192,7 @@ class nd extends O {
7192
7192
  super(), this.id = t;
7193
7193
  }
7194
7194
  apply(t) {
7195
- if (this.oldState = t, !L(this.id, Object.values(t.layouts)).id)
7195
+ if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
7196
7196
  throw new V();
7197
7197
  const a = Object.values(t.layouts).find((l) => l.elements.find((c) => c.id === this.id));
7198
7198
  if (!a)
@@ -7251,10 +7251,10 @@ class qa {
7251
7251
  id: h.id,
7252
7252
  region: n
7253
7253
  },
7254
- command: new G(h, i)
7254
+ command: new z(h, i)
7255
7255
  };
7256
7256
  } else {
7257
- const u = this.configuration.type === P.SilentIllustration ? (A = this.configuration.data.asset) == null ? void 0 : A.fileLink : s, m = await lt(await (async () => new Promise((p, f) => {
7257
+ const u = this.configuration.type === P.SilentIllustration ? (A = this.configuration.data.asset) == null ? void 0 : A.fileLink : s, g = await lt(await (async () => new Promise((p, f) => {
7258
7258
  if (!u) {
7259
7259
  f("Undefined vector silent step source");
7260
7260
  return;
@@ -7262,13 +7262,13 @@ class qa {
7262
7262
  at(u, !0).then((C) => {
7263
7263
  p(C);
7264
7264
  }).catch((C) => console.error(C));
7265
- }))()), g = {
7265
+ }))()), m = {
7266
7266
  stepName: this.configuration.stepName,
7267
7267
  id: Q(),
7268
- cachedObjectURL: await Kt(m.svg),
7268
+ cachedObjectURL: await Kt(g.svg),
7269
7269
  src: u,
7270
- svg: m.svg,
7271
- colors: m.colors,
7270
+ svg: g.svg,
7271
+ colors: g.colors,
7272
7272
  type: o,
7273
7273
  y: n.top,
7274
7274
  x: n.left,
@@ -7283,10 +7283,10 @@ class qa {
7283
7283
  };
7284
7284
  return {
7285
7285
  regionElement: {
7286
- id: g.id,
7286
+ id: m.id,
7287
7287
  region: n
7288
7288
  },
7289
- command: new G(g, i)
7289
+ command: new z(m, i)
7290
7290
  };
7291
7291
  }
7292
7292
  }, this.configuration = t, this.layouts = e, this.product = a || void 0;
@@ -7313,7 +7313,7 @@ class qa {
7313
7313
  }
7314
7314
  }
7315
7315
  const fs = async (r) => {
7316
- const t = `${mt.getServicesApiUrl()}/shortener`;
7316
+ const t = `${gt.getServicesApiUrl()}/shortener`;
7317
7317
  try {
7318
7318
  return (await (await rt(t, {
7319
7319
  method: "POST",
@@ -7326,7 +7326,7 @@ const fs = async (r) => {
7326
7326
  throw console.error(e), new xe("Failed to shorten URL, see console.");
7327
7327
  }
7328
7328
  };
7329
- class zn {
7329
+ class Gn {
7330
7330
  async poll() {
7331
7331
  try {
7332
7332
  if (await this.predicate()) {
@@ -7369,23 +7369,23 @@ class Cs {
7369
7369
  }
7370
7370
  async regenerateQRCode(t, e, a, n) {
7371
7371
  const i = async () => {
7372
- var g, p;
7373
- const h = (await ve([e]))[0], m = (p = (g = h == null ? void 0 : h.versions) == null ? void 0 : g.find((f) => f.name === "mpeg4")) == null ? void 0 : p.link;
7374
- return { asset: h, link: m };
7375
- }, s = await new Promise((h, m) => {
7376
- new zn(
7372
+ var m, p;
7373
+ const h = (await ve([e]))[0], g = (p = (m = h == null ? void 0 : h.versions) == null ? void 0 : m.find((f) => f.name === "mpeg4")) == null ? void 0 : p.link;
7374
+ return { asset: h, link: g };
7375
+ }, s = await new Promise((h, g) => {
7376
+ new Gn(
7377
7377
  async () => !!(await i()).link,
7378
7378
  async () => {
7379
- const g = await i();
7380
- if (!g.link || !g.link)
7381
- throw new Ht(g.asset);
7379
+ const m = await i();
7380
+ if (!m.link || !m.link)
7381
+ throw new Ht(m.asset);
7382
7382
  h({
7383
7383
  rel: "mpeg4",
7384
- href: g.link
7384
+ href: m.link
7385
7385
  });
7386
7386
  },
7387
7387
  () => {
7388
- m("Poller timed out with 40 attempts @ 3 second interval");
7388
+ g("Poller timed out with 40 attempts @ 3 second interval");
7389
7389
  },
7390
7390
  3e3,
7391
7391
  40
@@ -7421,7 +7421,7 @@ class Cs {
7421
7421
  throw new Error("Region not found");
7422
7422
  if (!A || !d)
7423
7423
  throw new Error("Neither a region or layout found!");
7424
- return new G(
7424
+ return new z(
7425
7425
  {
7426
7426
  stepRegion: d,
7427
7427
  stepName: n,
@@ -7441,7 +7441,7 @@ class Cs {
7441
7441
  } };
7442
7442
  }
7443
7443
  }
7444
- const Gn = new Cs();
7444
+ const zn = new Cs();
7445
7445
  class Be {
7446
7446
  constructor() {
7447
7447
  this.frameSourceSvg = async (t, e) => {
@@ -7467,7 +7467,7 @@ class Be {
7467
7467
  const s = e.getWorkflowExperience().getBundle();
7468
7468
  if (s && t.globalPropertyAspectConfigurations) {
7469
7469
  const o = s.getGlobalPropertyStateManager(), l = t.globalPropertyAspectConfigurations[0], c = o.getAspectStorage(l.aspectName);
7470
- c && c.originalAssetKey && (i = (await U.getLocalOrFromServer(c.originalAssetKey)).fileLink);
7470
+ c && c.originalAssetKey && (i = (await L.getLocalOrFromServer(c.originalAssetKey)).fileLink);
7471
7471
  }
7472
7472
  if (t.option && t.option.variants && t.option.variants.length > 0) {
7473
7473
  const o = t.option, l = Y.getDefaultVariant(o);
@@ -7503,8 +7503,8 @@ class Be {
7503
7503
  }
7504
7504
  if (n) {
7505
7505
  const d = async () => {
7506
- var m, g, p, f, C;
7507
- const A = (m = n.storage) == null ? void 0 : m.colors, u = (g = n.storage) == null ? void 0 : g.framePatternSrc, h = (p = n.storage) == null ? void 0 : p.frameOffsetsList;
7506
+ var g, m, p, f, C;
7507
+ const A = (g = n.storage) == null ? void 0 : g.colors, u = (m = n.storage) == null ? void 0 : m.framePatternSrc, h = (p = n.storage) == null ? void 0 : p.frameOffsetsList;
7508
7508
  if (e.updateMetadata(t.stepName, {
7509
7509
  frameOffsetsList: h,
7510
7510
  framePatternSrc: u
@@ -7534,7 +7534,7 @@ class Be {
7534
7534
  l,
7535
7535
  async () => {
7536
7536
  const h = await Promise.all(
7537
- t.data.regions.map((m) => this.frameSourceSvg(u, m))
7537
+ t.data.regions.map((g) => this.frameSourceSvg(u, g))
7538
7538
  );
7539
7539
  e.updateStorage(t.stepName, { currentFrameSources: h }), await d();
7540
7540
  }
@@ -7563,14 +7563,14 @@ class Be {
7563
7563
  const o = e.fileLink || "";
7564
7564
  return o.endsWith(".pdf") || o.endsWith(".eps") || o.endsWith(".ai") ? new Promise((c) => {
7565
7565
  a.addPoller(
7566
- new zn(
7566
+ new Gn(
7567
7567
  async () => {
7568
7568
  var h;
7569
- const A = (h = (await U.getFromServer(e.key || "")).versions) == null ? void 0 : h.find((m) => m.name === "svg");
7569
+ const A = (h = (await L.getFromServer(e.key || "")).versions) == null ? void 0 : h.find((g) => g.name === "svg");
7570
7570
  return A ? (await rt(A.link)).status === 200 : !1;
7571
7571
  },
7572
7572
  () => {
7573
- U.getLocalOrFromServer(e.key || "").then((d) => {
7573
+ L.getLocalOrFromServer(e.key || "").then((d) => {
7574
7574
  this.loadPatternFromAsset(d, t, a, n).then(
7575
7575
  c
7576
7576
  );
@@ -7594,7 +7594,7 @@ class Be {
7594
7594
  s && (s.command && n.getCommandDispatcher()(s.command), s.followup && await s.followup());
7595
7595
  }
7596
7596
  getCreateElementCommand(t, e, a, n) {
7597
- return new G(
7597
+ return new z(
7598
7598
  {
7599
7599
  id: t,
7600
7600
  type: M.Frame,
@@ -7728,12 +7728,12 @@ class Be {
7728
7728
  if (!o)
7729
7729
  throw new Error("Frame service unavailable, cannot load pattern!");
7730
7730
  const l = await Promise.all(
7731
- t.data.regions.map((m) => this.frameSourceSvg(e, m))
7731
+ t.data.regions.map((g) => this.frameSourceSvg(e, g))
7732
7732
  );
7733
7733
  i && i(!0);
7734
7734
  const c = t.data.initialZoomLevel, d = await Promise.all(
7735
- t.data.regions.map(async (m, g) => {
7736
- const p = await Qe(l[g]), f = o.getImageData(), C = a.map((I) => new bt(I.id)), w = f ? Ea(
7735
+ t.data.regions.map(async (g, m) => {
7736
+ const p = await Qe(l[m]), f = o.getImageData(), C = a.map((I) => new bt(I.id)), w = f ? Ea(
7737
7737
  f,
7738
7738
  p,
7739
7739
  c && !t.data.forceImageCover ? { scale: c } : void 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);
7751
+ } : void 0, y = Q(), b = n.getLayouts().find((I) => I.panelId === g.panelId);
7752
7752
  if (!b)
7753
- throw new J(m);
7753
+ throw new J(g);
7754
7754
  return {
7755
- command: this.getCreateElementCommand(y, m, b, {
7755
+ command: this.getCreateElementCommand(y, g, b, {
7756
7756
  frameData: p,
7757
7757
  pattern: S,
7758
7758
  disablePlaceholder: t.data.disablePlaceholder,
@@ -7760,26 +7760,26 @@ class Be {
7760
7760
  }),
7761
7761
  regionEl: {
7762
7762
  id: y,
7763
- region: m
7763
+ region: g
7764
7764
  },
7765
7765
  removeExistingCommands: C
7766
7766
  };
7767
7767
  })
7768
- ), A = d.map((m) => m.command), u = d.map((m) => m.removeExistingCommands).flat();
7768
+ ), A = d.map((g) => g.command), u = d.map((g) => g.removeExistingCommands).flat();
7769
7769
  return {
7770
7770
  command: new $([...A, ...u]),
7771
7771
  followup: async () => {
7772
7772
  i && i(!1), await n.setSelectionsAndElements(
7773
7773
  t.stepName,
7774
7774
  e ? [e] : [],
7775
- [...d.map((m) => m.regionEl)],
7775
+ [...d.map((g) => g.regionEl)],
7776
7776
  async () => {
7777
- var m;
7777
+ var g;
7778
7778
  if (n.updateStorage(t.stepName, { currentFrameSources: l }), s) {
7779
- const g = (m = n.getWorkflowExperience().getStepById(t.stepName)) == null ? void 0 : m.frameService;
7780
- if (!g)
7779
+ const m = (g = n.getWorkflowExperience().getStepById(t.stepName)) == null ? void 0 : g.frameService;
7780
+ if (!m)
7781
7781
  throw new Error("Frame service unavailable, cannot load pattern!");
7782
- await this.loadPatternFromString(s, g, !0);
7782
+ await this.loadPatternFromString(s, m, !0);
7783
7783
  }
7784
7784
  }
7785
7785
  );
@@ -7838,7 +7838,7 @@ class ws {
7838
7838
  });
7839
7839
  }
7840
7840
  getCreateElementCommand(t, e, a, n) {
7841
- return new G(
7841
+ return new z(
7842
7842
  {
7843
7843
  stepRegion: e,
7844
7844
  stepName: n.stepName,
@@ -7865,7 +7865,7 @@ class ws {
7865
7865
  if (a.length === 0)
7866
7866
  return [];
7867
7867
  try {
7868
- return L(
7868
+ return U(
7869
7869
  a[0].id,
7870
7870
  e.getAllLayoutData()
7871
7871
  ).colors;
@@ -7947,39 +7947,39 @@ class ws {
7947
7947
  return new $(c);
7948
7948
  }
7949
7949
  async changeColors(t, e, a, n, i) {
7950
- var h, m;
7950
+ var h, g;
7951
7951
  if (e.length === 0)
7952
7952
  return;
7953
- const s = L(
7953
+ const s = U(
7954
7954
  e[0].id,
7955
- n().map((g) => g.layoutState)
7955
+ n().map((m) => m.layoutState)
7956
7956
  ), o = { ...s.colors }, l = {};
7957
- Object.entries(o).forEach(([g, p]) => {
7957
+ Object.entries(o).forEach(([m, p]) => {
7958
7958
  const f = { browserValue: p.browserValue, pmsValue: p.pmsValue }, C = p.spotColor;
7959
- C && (f.spotColor = { profileName: C.profileName, namedColor: C.namedColor }), l[g] = f;
7959
+ C && (f.spotColor = { profileName: C.profileName, namedColor: C.namedColor }), l[m] = f;
7960
7960
  });
7961
- for (const [g, p] of i.entries()) {
7961
+ for (const [m, p] of i.entries()) {
7962
7962
  const f = typeof p == "string" ? p : p.browserValue, C = typeof p == "string" ? void 0 : p.pmsValue;
7963
- o[g] = { browserValue: f, spotColor: (h = o[g]) == null ? void 0 : h.spotColor, pmsValue: C }, l[g] = { browserValue: f };
7963
+ o[m] = { browserValue: f, spotColor: (h = o[m]) == null ? void 0 : h.spotColor, pmsValue: C }, l[m] = { browserValue: f };
7964
7964
  }
7965
- let c = Array.from(Object.values(o)).map((g) => g.browserValue);
7965
+ let c = Array.from(Object.values(o)).map((m) => m.browserValue);
7966
7966
  const d = t.data.colorOption;
7967
- d && ((m = d.variants) == null || m.forEach((g) => {
7967
+ d && ((g = d.variants) == null || g.forEach((m) => {
7968
7968
  c = c.map((p) => {
7969
7969
  var f;
7970
- return p.toLowerCase() === ((f = g.color) == null ? void 0 : f.toLowerCase()) ? g.name : p;
7970
+ return p.toLowerCase() === ((f = m.color) == null ? void 0 : f.toLowerCase()) ? m.name : p;
7971
7971
  });
7972
7972
  })), a.updateMetadata(t.stepName, { colors: c });
7973
7973
  const A = /* @__PURE__ */ new Map();
7974
- if (Object.entries(o).forEach(([g, p]) => {
7975
- A.set(g, p);
7974
+ if (Object.entries(o).forEach(([m, p]) => {
7975
+ A.set(m, p);
7976
7976
  }), !s.svg)
7977
7977
  throw new Error("Colors changed before SVG loaded. This should never happen!");
7978
7978
  const u = await this.changeColorsCommand(
7979
7979
  s.svg,
7980
7980
  s.width,
7981
7981
  s.height,
7982
- e.map((g) => g.id),
7982
+ e.map((m) => m.id),
7983
7983
  A
7984
7984
  );
7985
7985
  a.updateStorage(t.stepName, {
@@ -8017,16 +8017,16 @@ class ws {
8017
8017
  svg: c
8018
8018
  })
8019
8019
  };
8020
- }, u = t.data.regions.map(A), m = [...u.map((C) => C.command), ...s];
8021
- let g = Array.from(Object.values(c.colors)).map((C) => C.browserValue);
8020
+ }, u = t.data.regions.map(A), g = [...u.map((C) => C.command), ...s];
8021
+ let m = Array.from(Object.values(c.colors)).map((C) => C.browserValue);
8022
8022
  const p = t.data.colorOption;
8023
8023
  return p && ((f = p.variants) == null || f.forEach((C) => {
8024
- g = g.map((w) => {
8024
+ m = m.map((w) => {
8025
8025
  var S;
8026
8026
  return w.toLowerCase() === ((S = C.color) == null ? void 0 : S.toLowerCase()) ? C.name : w;
8027
8027
  });
8028
- })), i.updateMetadata(t.stepName, { colors: g }), {
8029
- command: new $(m),
8028
+ })), i.updateMetadata(t.stepName, { colors: m }), {
8029
+ command: new $(g),
8030
8030
  followup: async () => {
8031
8031
  var w, S;
8032
8032
  await i.setSelectionsAndElements(
@@ -8076,7 +8076,7 @@ class ws {
8076
8076
  };
8077
8077
  }
8078
8078
  }
8079
- const ge = new ws();
8079
+ const me = new ws();
8080
8080
  class ys {
8081
8081
  async init(t, e, a) {
8082
8082
  const n = t.option;
@@ -8105,20 +8105,20 @@ class ys {
8105
8105
  if (d) {
8106
8106
  const A = (c = l.variants) == null ? void 0 : c.find((u) => u.id === d);
8107
8107
  if (A) {
8108
- const u = A.material, h = o.map((m) => ({ id: m.id, region: m.stepRegion }));
8108
+ const u = A.material, h = o.map((g) => ({ id: g.id, region: g.stepRegion }));
8109
8109
  await e.setSelectionsAndElements(
8110
8110
  t.stepName,
8111
8111
  [A],
8112
8112
  h,
8113
8113
  async () => {
8114
- const m = e.getModelContainer();
8115
- if (m) {
8116
- const g = t.data.targetMaterials.map((p) => m.applyMaterialVariant(
8114
+ const g = e.getModelContainer();
8115
+ if (g) {
8116
+ const m = t.data.targetMaterials.map((p) => g.applyMaterialVariant(
8117
8117
  p,
8118
8118
  l.id || "",
8119
8119
  u || {}
8120
8120
  ));
8121
- Promise.all(g).then(
8121
+ Promise.all(m).then(
8122
8122
  () => e.setMandatoryFulfilled(t.stepName, !0)
8123
8123
  );
8124
8124
  }
@@ -8187,16 +8187,16 @@ class Ss {
8187
8187
  [A],
8188
8188
  u,
8189
8189
  async () => {
8190
- var m;
8190
+ var g;
8191
8191
  const h = e.getModelContainer();
8192
8192
  if (h && t.option) {
8193
- const g = (m = A.asset) == null ? void 0 : m.fileLink;
8194
- if (!g)
8193
+ const m = (g = A.asset) == null ? void 0 : g.fileLink;
8194
+ if (!m)
8195
8195
  throw new vt(A);
8196
8196
  await h.applyModelVariant(
8197
8197
  t.stepName || "",
8198
8198
  {
8199
- model: g,
8199
+ model: m,
8200
8200
  contextService: e.getLayoutPreviewService()
8201
8201
  },
8202
8202
  t.data.replaceProductModel || !1
@@ -8276,17 +8276,17 @@ class vs {
8276
8276
  return console.error("Missing configuration."), null;
8277
8277
  a.updateStorage(t.stepName, { text: e }), a.updateMetadata(t.stepName, { text: e });
8278
8278
  const c = (A, u, h) => {
8279
- const m = h || Q(), p = a.getLayouts().find((C) => C.panelId === u.panelId);
8279
+ const g = h || Q(), p = a.getLayouts().find((C) => C.panelId === u.panelId);
8280
8280
  if (!p)
8281
8281
  return console.error(`Can not find layout for region: ${u.panelId}`), null;
8282
8282
  const f = [];
8283
- return h && f.push(new bt(m)), f.push(
8284
- new G(
8283
+ return h && f.push(new bt(g)), f.push(
8284
+ new z(
8285
8285
  {
8286
8286
  stepRegion: u,
8287
8287
  stepName: t.stepName,
8288
8288
  colors: {},
8289
- id: m,
8289
+ id: g,
8290
8290
  svg: A,
8291
8291
  type: M.Illustration,
8292
8292
  y: u.top,
@@ -8301,7 +8301,7 @@ class vs {
8301
8301
  p
8302
8302
  )
8303
8303
  ), {
8304
- id: m,
8304
+ id: g,
8305
8305
  region: u,
8306
8306
  command: new $(f)
8307
8307
  };
@@ -8310,8 +8310,8 @@ class vs {
8310
8310
  const u = i.map((h) => {
8311
8311
  if (!h.region)
8312
8312
  return null;
8313
- const m = s.svgPrint(e, h.region);
8314
- return c(m, h.region, h.id);
8313
+ const g = s.svgPrint(e, h.region);
8314
+ return c(g, h.region, h.id);
8315
8315
  }).filter((h) => !!h).filter((h) => !!h).map((h) => h && h.command);
8316
8316
  return {
8317
8317
  command: new $(u),
@@ -8325,7 +8325,7 @@ class vs {
8325
8325
  return {
8326
8326
  command: new $(u),
8327
8327
  followup: async () => {
8328
- const h = A.filter((m) => m).map((m) => m && { id: m.id, region: m.region });
8328
+ const h = A.filter((g) => g).map((g) => g && { id: g.id, region: g.region });
8329
8329
  await a.setSelectionsAndElements(
8330
8330
  t.stepName,
8331
8331
  [],
@@ -8403,17 +8403,17 @@ class Es {
8403
8403
  return console.error("No URL for picture!"), null;
8404
8404
  n(!0), t.mandatory && a.setMandatoryFulfilled(t.stepName, !1);
8405
8405
  const l = a.getRegionElements(t.stepName).map((A) => new bt(A.id)), c = (A) => {
8406
- const h = a.getLayouts().find((g) => g.panelId === A.panelId);
8406
+ const h = a.getLayouts().find((m) => m.panelId === A.panelId);
8407
8407
  if (!h)
8408
8408
  throw new J(A);
8409
- const m = Q();
8409
+ const g = Q();
8410
8410
  return {
8411
- regionElement: { id: m, region: A },
8412
- command: new G(
8411
+ regionElement: { id: g, region: A },
8412
+ command: new z(
8413
8413
  {
8414
8414
  stepName: t.stepName,
8415
8415
  stepRegion: A,
8416
- id: m,
8416
+ id: g,
8417
8417
  src: s,
8418
8418
  type: M.Image,
8419
8419
  y: A.top,
@@ -8593,10 +8593,10 @@ class Bs {
8593
8593
  if (a.length > 0) {
8594
8594
  const c = (A) => {
8595
8595
  const u = A.region;
8596
- if (!i.find((g) => g.panelId === (u == null ? void 0 : u.panelId)))
8596
+ if (!i.find((m) => m.panelId === (u == null ? void 0 : u.panelId)))
8597
8597
  throw new J(u);
8598
- const m = o();
8599
- return new oa(A.id, this.shapeFillId, m);
8598
+ const g = o();
8599
+ return new oa(A.id, this.shapeFillId, g);
8600
8600
  }, d = a.map(c).filter((A) => !!A);
8601
8601
  return {
8602
8602
  command: new $(d),
@@ -8610,10 +8610,10 @@ class Bs {
8610
8610
  };
8611
8611
  } else {
8612
8612
  const c = (h) => {
8613
- const m = i.find((w) => w.panelId === h.panelId);
8614
- if (!m)
8613
+ const g = i.find((w) => w.panelId === h.panelId);
8614
+ if (!g)
8615
8615
  throw new J(h);
8616
- const g = o(), p = `
8616
+ const m = o(), p = `
8617
8617
  <svg
8618
8618
  xmlns="http://www.w3.org/2000/svg"
8619
8619
  xmlnsXlink="http://www.w3.org/1999/xlink"
@@ -8630,16 +8630,16 @@ class Bs {
8630
8630
  width="1"
8631
8631
  height="1"
8632
8632
  class="${this.shapeFillId}"
8633
- fill="${g}"
8633
+ fill="${m}"
8634
8634
  />
8635
8635
  </svg>
8636
8636
  `, f = {};
8637
- f[this.shapeFillId] = { browserValue: g };
8637
+ f[this.shapeFillId] = { browserValue: m };
8638
8638
  const C = Q();
8639
8639
  return {
8640
8640
  id: C,
8641
8641
  region: h,
8642
- command: new G(
8642
+ command: new z(
8643
8643
  {
8644
8644
  stepRegion: h,
8645
8645
  stepName: t.stepName,
@@ -8657,7 +8657,7 @@ class Bs {
8657
8657
  immutable: h.immutable,
8658
8658
  excludeFromExport: t.data.excludeFromPrint
8659
8659
  },
8660
- m
8660
+ g
8661
8661
  )
8662
8662
  };
8663
8663
  }, d = t.data.regions.map(c), A = d.filter((h) => !!h).map((h) => h == null ? void 0 : h.command), u = d.filter((h) => !!h).map((h) => ({ id: h.id, region: h.region }));
@@ -8677,7 +8677,7 @@ class Bs {
8677
8677
  }
8678
8678
  }
8679
8679
  }
8680
- const zt = new Bs();
8680
+ const Gt = new Bs();
8681
8681
  class Is {
8682
8682
  constructor() {
8683
8683
  this.latestToast = null, this.toastType = null, this.toastCallbacks = [];
@@ -8717,17 +8717,17 @@ const Ps = new Is(), qe = (r, t, e, a, n) => {
8717
8717
  if (A <= r.width)
8718
8718
  return [i, A];
8719
8719
  const u = o.reduce((p, f, C, w) => f > w[p] ? C : p, 0), h = i[u];
8720
- let m = !1, g = h.length;
8721
- for (; !m && g > -1; ) {
8722
- g = h.lastIndexOf(" ", g - 1);
8723
- const p = [h.slice(0, g), h.slice(g + 1)], f = p.map((w) => ht(w, a, n));
8720
+ let g = !1, m = h.length;
8721
+ for (; !g && m > -1; ) {
8722
+ m = h.lastIndexOf(" ", m - 1);
8723
+ const p = [h.slice(0, m), h.slice(m + 1)], f = p.map((w) => ht(w, a, n));
8724
8724
  f[0] <= r.width && (i = [...i.slice(0, u), ...p, ...i.slice(u + 1)], o = [
8725
8725
  ...o.slice(0, u),
8726
8726
  ...f,
8727
8727
  ...o.slice(u + 1)
8728
- ], s += 1, m = !0);
8728
+ ], s += 1, g = !0);
8729
8729
  }
8730
- m || (c = !1);
8730
+ g || (c = !1);
8731
8731
  }
8732
8732
  return [null, null];
8733
8733
  }, pe = (r, t, e, a, n) => {
@@ -8807,11 +8807,11 @@ class xs {
8807
8807
  height: A.height,
8808
8808
  width: A.width,
8809
8809
  scale: t.data.imageFillScale || 1
8810
- } : void 0, h = this.getDefaultStrokeColorVariant(t.data), m = t.data.strokeEnabled && (h != null && h.color) ? {
8810
+ } : void 0, h = this.getDefaultStrokeColorVariant(t.data), g = t.data.strokeEnabled && (h != null && h.color) ? {
8811
8811
  browserValue: h.color,
8812
8812
  pmsValue: h.name
8813
8813
  } : void 0;
8814
- let g = t.data.defaultText || "";
8814
+ let m = t.data.defaultText || "";
8815
8815
  const p = e.getWorkflowExperience().getBundle();
8816
8816
  if (p && t.globalPropertyAspectConfigurations) {
8817
8817
  const C = (s = p.getGlobalPropertyConfiguration()) == null ? void 0 : s.aspects, w = C == null ? void 0 : C.find((S) => {
@@ -8820,17 +8820,17 @@ class xs {
8820
8820
  });
8821
8821
  if (w) {
8822
8822
  const y = p.getGlobalPropertyStateManager().getAspect(w.name);
8823
- y && (g = y);
8823
+ y && (m = y);
8824
8824
  }
8825
8825
  }
8826
8826
  e.updateStorage(t.stepName, {
8827
- text: g,
8827
+ text: m,
8828
8828
  inputText: t.data.defaultText || "",
8829
8829
  color: ((o = this.getDefaultColorVariant(t.data)) == null ? void 0 : o.color) || this.getDefaultColor(t.data),
8830
8830
  fillImage: u,
8831
- strokeColor: m
8831
+ strokeColor: g
8832
8832
  }), e.updateMetadata(t.stepName, {
8833
- text: g,
8833
+ text: m,
8834
8834
  color: ((l = this.getDefaultColorVariant(t.data)) == null ? void 0 : l.name) || this.getDefaultColor(t.data),
8835
8835
  fillImage: c == null ? void 0 : c.name,
8836
8836
  strokeColor: t.data.strokeEnabled ? h == null ? void 0 : h.color : void 0
@@ -8840,7 +8840,7 @@ class xs {
8840
8840
  return console.log(`LOG: text step init default (${t.stepName})`), this.selectVariantCommand(
8841
8841
  t,
8842
8842
  f,
8843
- { text: g },
8843
+ { text: m },
8844
8844
  [],
8845
8845
  e,
8846
8846
  () => {
@@ -8848,13 +8848,13 @@ class xs {
8848
8848
  () => {
8849
8849
  },
8850
8850
  u,
8851
- m
8851
+ g
8852
8852
  );
8853
8853
  }
8854
8854
  return console.log(`LOG: text step init end (${t.stepName})`), null;
8855
8855
  }
8856
8856
  findLayoutElements(t, e) {
8857
- return t.getRegionElements(e.stepName).map((i) => L(i.id, t.getAllLayoutData()));
8857
+ return t.getRegionElements(e.stepName).map((i) => U(i.id, t.getAllLayoutData()));
8858
8858
  }
8859
8859
  /**
8860
8860
  * Get the colors that can be used for a given text step.
@@ -9002,7 +9002,7 @@ class xs {
9002
9002
  const l = [], c = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
9003
9003
  for (const A of e) {
9004
9004
  if (!A.fontData)
9005
- throw new z("Failed to resolve font data for text.");
9005
+ throw new G("Failed to resolve font data for text.");
9006
9006
  const [u, h] = pe(
9007
9007
  A.fontSize,
9008
9008
  A.fontData,
@@ -9011,9 +9011,9 @@ class xs {
9011
9011
  { size: a.data.size, minSize: a.data.minSize, maxSize: a.data.maxSize }
9012
9012
  );
9013
9013
  c.set(A.id, u), d.set(A.id, h);
9014
- const m = a.data.curved ? s : (h || []).join(`
9014
+ const g = a.data.curved ? s : (h || []).join(`
9015
9015
  `);
9016
- l.push(this.generateTextChangeCommandsForRegion(u, a.data, A.id, m));
9016
+ l.push(this.generateTextChangeCommandsForRegion(u, a.data, A.id, g));
9017
9017
  }
9018
9018
  return !a.data.curved && e.length > 0 && !Array.from(d.values()).every((u) => u) ? (o.errorData || (o.errorData = {}), o.errorData.doesNotFit = !0, o) : (n.updateStorage(a.stepName, { text: t }), n.updateMetadata(a.stepName, {
9019
9019
  text: s
@@ -9048,13 +9048,15 @@ class xs {
9048
9048
  const n = e.getSerializedStep(
9049
9049
  t.stepName,
9050
9050
  a.serializableWorkflow.steps
9051
- ), o = Object.values(a.layouts).map((m) => m.elements).flat().filter((m) => m.stepName === t.stepName), l = t.option;
9051
+ ), o = Object.values(a.layouts).map((g) => g.elements).flat().filter((g) => g.stepName === t.stepName), l = t.option;
9052
9052
  if (n != null && n.selectedVariants) {
9053
- const m = n.selectedVariants[0].id;
9054
- if (l && m) {
9055
- const g = (c = l.variants) == null ? void 0 : c.find((p) => p.id === m);
9056
- if (g) {
9057
- const p = await this.fontDataFromVariant(g), f = o.map((y) => ({ id: y.id, region: y.stepRegion })), C = (d = n.storage) == null ? void 0 : d.color;
9053
+ console.log("LOG: text reload a");
9054
+ const g = n.selectedVariants[0].id;
9055
+ if (l && g) {
9056
+ const m = (c = l.variants) == null ? void 0 : c.find((p) => p.id === g);
9057
+ if (m) {
9058
+ console.log("LOG: text reload a variant");
9059
+ const p = await this.fontDataFromVariant(m), f = o.map((y) => ({ id: y.id, region: y.stepRegion })), C = (d = n.storage) == null ? void 0 : d.color;
9058
9060
  let w = (A = n.storage) == null ? void 0 : A.text;
9059
9061
  const S = e.getWorkflowExperience().getBundle();
9060
9062
  if (S && t.globalPropertyAspectConfigurations) {
@@ -9064,12 +9066,12 @@ class xs {
9064
9066
  });
9065
9067
  if (E) {
9066
9068
  const I = S.getGlobalPropertyStateManager().getAspect(E.name);
9067
- I && (w = I);
9069
+ I && (console.log("LOG: text reload a variant found aspect text"), w = I);
9068
9070
  }
9069
9071
  }
9070
9072
  if (await e.setSelectionsAndElements(
9071
9073
  t.stepName,
9072
- [g],
9074
+ [m],
9073
9075
  f,
9074
9076
  async () => {
9075
9077
  e.updateMetadata(t.stepName, { color: C, text: w }), e.updateStorage(t.stepName, { text: w, inputText: w });
@@ -9077,6 +9079,7 @@ class xs {
9077
9079
  e.getCommandDispatcher()(E);
9078
9080
  }
9079
9081
  ), o.length === 0 && l) {
9082
+ console.log("LOG: text reload a variant no elements");
9080
9083
  const y = Y.getDefaultVariant(l);
9081
9084
  if (y) {
9082
9085
  const E = await this.selectVariantCommand(
@@ -9093,6 +9096,7 @@ class xs {
9093
9096
  e.getCommandDispatcher()(E.command);
9094
9097
  }
9095
9098
  } else {
9099
+ console.log("LOG: text reload a variant yes elements");
9096
9100
  const { command: y } = W.updateInputText(
9097
9101
  w || "",
9098
9102
  o,
@@ -9104,18 +9108,23 @@ class xs {
9104
9108
  }
9105
9109
  }
9106
9110
  } else {
9107
- const m = e.getWorkflowExperience().getBundle();
9108
- if (m && t.globalPropertyAspectConfigurations) {
9109
- const g = (h = m.getGlobalPropertyConfiguration()) == null ? void 0 : h.aspects, p = g == null ? void 0 : g.find((f) => {
9111
+ console.log("LOG: text reload b");
9112
+ const g = e.getWorkflowExperience().getBundle();
9113
+ if (g && t.globalPropertyAspectConfigurations) {
9114
+ console.log("LOG: text reload found bundle");
9115
+ const m = (h = g.getGlobalPropertyConfiguration()) == null ? void 0 : h.aspects, p = m == null ? void 0 : m.find((f) => {
9110
9116
  var C;
9111
9117
  return f.type === j.Text && ((C = t.globalPropertyAspectConfigurations) == null ? void 0 : C.map((w) => w.aspectName).includes(f.name));
9112
9118
  });
9113
9119
  if (p) {
9114
- const C = m.getGlobalPropertyStateManager().getAspect(p.name);
9120
+ console.log(`LOG: text reload found aspect ${p.name}`);
9121
+ const C = g.getGlobalPropertyStateManager().getAspect(p.name);
9115
9122
  if (C)
9116
- if (o.length === 0 && l) {
9123
+ if (console.log("LOG: text reload b found aspect text"), o.length === 0 && l) {
9124
+ console.log("LOG: text reload b variant no elements");
9117
9125
  const w = Y.getDefaultVariant(l);
9118
9126
  if (w) {
9127
+ console.log("LOG: text reload b variant default");
9119
9128
  const S = await this.selectVariantCommand(
9120
9129
  t,
9121
9130
  w,
@@ -9130,6 +9139,7 @@ class xs {
9130
9139
  e.getCommandDispatcher()(S.command);
9131
9140
  }
9132
9141
  } else {
9142
+ console.log("LOG: text reload b variant yes elements");
9133
9143
  const { command: w } = W.updateInputText(
9134
9144
  C,
9135
9145
  o,
@@ -9140,6 +9150,7 @@ class xs {
9140
9150
  }
9141
9151
  }
9142
9152
  }
9153
+ console.log("LOG: text reload b end");
9143
9154
  }
9144
9155
  }
9145
9156
  getDefaultColorVariant(t) {
@@ -9192,7 +9203,7 @@ class xs {
9192
9203
  );
9193
9204
  h.push(...p);
9194
9205
  }
9195
- const m = await this.changeInputTextWithRegion(
9206
+ const g = await this.changeInputTextWithRegion(
9196
9207
  t,
9197
9208
  t.data.size || He,
9198
9209
  A,
@@ -9203,7 +9214,7 @@ class xs {
9203
9214
  s,
9204
9215
  o
9205
9216
  );
9206
- return m && h.push(m), {
9217
+ return g && h.push(g), {
9207
9218
  command: new $(h),
9208
9219
  followup: async () => {
9209
9220
  i.markUpdateCompleted(d), await i.setSelectionsAndElements(t.stepName, [e], n);
@@ -9217,7 +9228,7 @@ class xs {
9217
9228
  A,
9218
9229
  a,
9219
9230
  i
9220
- ), m = await this.changeInputTextWithRegion(
9231
+ ), g = await this.changeInputTextWithRegion(
9221
9232
  t,
9222
9233
  t.data.size || He,
9223
9234
  A,
@@ -9227,21 +9238,21 @@ class xs {
9227
9238
  (a == null ? void 0 : a.customiseAllText) ?? !1,
9228
9239
  s,
9229
9240
  o
9230
- ), g = h.flatMap((f) => f.commands);
9241
+ ), m = h.flatMap((f) => f.commands);
9231
9242
  if (l) {
9232
9243
  const f = h.map(
9233
9244
  (C) => new We(C.regionElement.id, l)
9234
9245
  );
9235
- g.push(...f);
9246
+ m.push(...f);
9236
9247
  }
9237
9248
  if (c) {
9238
9249
  const f = n.map(
9239
9250
  (C) => new je(C.id, c, t.data.strokeThickness)
9240
9251
  );
9241
- g.push(...f);
9252
+ m.push(...f);
9242
9253
  }
9243
- return m && g.push(m), {
9244
- command: new $(g),
9254
+ return g && m.push(g), {
9255
+ command: new $(m),
9245
9256
  followup: async () => {
9246
9257
  i.markUpdateCompleted(d);
9247
9258
  }
@@ -9260,8 +9271,8 @@ class xs {
9260
9271
  if (!a || !a.regions)
9261
9272
  throw new Error("Step data not supplied");
9262
9273
  const o = i.text || a.defaultText || "", l = this.getProcessedInput(o, a, !1), c = async (A) => {
9263
- var g;
9264
- const h = s.getLayouts().find((p) => p.panelId === A.panelId), m = Q();
9274
+ var m;
9275
+ const h = s.getLayouts().find((p) => p.panelId === A.panelId), g = Q();
9265
9276
  try {
9266
9277
  if (!h)
9267
9278
  throw new Pe("Failed to find layout for region: " + A.panelId);
@@ -9273,7 +9284,7 @@ class xs {
9273
9284
  return nt.id === ((R = p.defaultVariant) == null ? void 0 : R.id);
9274
9285
  }) || p.variants[0];
9275
9286
  f = this.createTextFillSpotColor(p, T), s.updateStorage(t, {
9276
- colorProfileAssetKey: (g = p.colorProfile) == null ? void 0 : g.key
9287
+ colorProfileAssetKey: (m = p.colorProfile) == null ? void 0 : m.key
9277
9288
  });
9278
9289
  }
9279
9290
  const C = await this.getDefaultColor(a), w = C || "#000000", S = {
@@ -9283,7 +9294,7 @@ class xs {
9283
9294
  fill: i.color ? i.color : w,
9284
9295
  fontSize: a.size || He,
9285
9296
  fontData: n,
9286
- id: m,
9297
+ id: g,
9287
9298
  layer: A.layer,
9288
9299
  layerIndex: A.layerIndex,
9289
9300
  rotation: A.rotation,
@@ -9302,7 +9313,7 @@ class xs {
9302
9313
  fillSpotColorDefinition: f
9303
9314
  }, y = [], E = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map();
9304
9315
  if (!S.fontData)
9305
- throw new z("Failed to resolve font data for text.");
9316
+ throw new G("Failed to resolve font data for text.");
9306
9317
  const [I, D] = pe(
9307
9318
  S.fontSize,
9308
9319
  S.fontData,
@@ -9323,10 +9334,10 @@ class xs {
9323
9334
  y.push(
9324
9335
  this.generateTextChangeCommandsForRegion(I, a, S.id, x)
9325
9336
  );
9326
- const k = new G(S, h);
9337
+ const F = new z(S, h);
9327
9338
  return {
9328
- regionElement: { id: m, region: A },
9329
- commands: [k, ...y],
9339
+ regionElement: { id: g, region: A },
9340
+ commands: [F, ...y],
9330
9341
  newElement: S,
9331
9342
  fontData: n
9332
9343
  };
@@ -9350,7 +9361,7 @@ class xs {
9350
9361
  ), d;
9351
9362
  }
9352
9363
  generateTextChangeCommandsForRegion(t, e, a, n) {
9353
- const i = [], s = new gs(a, n);
9364
+ const i = [], s = new ms(a, n);
9354
9365
  if (i.push(s), !e.size) {
9355
9366
  const l = new As(a, t);
9356
9367
  i.push(l);
@@ -9361,7 +9372,7 @@ class xs {
9361
9372
  * @deprecated
9362
9373
  */
9363
9374
  async changeInputTextWithRegion(t, e, a, n, i, s, o, l, c, d) {
9364
- const A = (n || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = this.getProcessedInput(A, t.data, o), h = s.getRegionElements(t.stepName), m = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
9375
+ const A = (n || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = this.getProcessedInput(A, t.data, o), h = s.getRegionElements(t.stepName), g = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
9365
9376
  for (const S of h)
9366
9377
  if (S.region) {
9367
9378
  const [y, E] = pe(
@@ -9371,7 +9382,7 @@ class xs {
9371
9382
  [u],
9372
9383
  { size: t.data.size, minSize: t.data.minSize, maxSize: t.data.maxSize }
9373
9384
  );
9374
- m.set(S.id, y), g.set(S.id, E);
9385
+ g.set(S.id, y), m.set(S.id, E);
9375
9386
  }
9376
9387
  const f = (() => {
9377
9388
  if (t.data && t.data.maxLength && u.length > t.data.maxLength)
@@ -9384,7 +9395,7 @@ class xs {
9384
9395
  return l(!0), { error: "Blocked profanity." };
9385
9396
  }
9386
9397
  return !t.data.vertical && !t.data.allowNewlines && (u.includes(`
9387
- `) || 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() });
9398
+ `) || u.includes("\r")) ? (l(!0), { error: "Cannot span multiple lines." }) : !t.data.curved && !Array.from(m.values()).every((b) => b) ? (l(!0), { error: "Does not fit." }) : (l(!1), { info: (t.data.maxLength - u.length).toString() });
9388
9399
  })();
9389
9400
  if (f.error) {
9390
9401
  c(f.error);
@@ -9397,11 +9408,11 @@ class xs {
9397
9408
  }), (i.defaultCleared || !t.data.deleteDefaultOnFocus) && A.trim() !== "" && s.setMandatoryFulfilled(t.stepName, !0);
9398
9409
  const C = [];
9399
9410
  for (const S of h) {
9400
- const y = t.data.curved ? u : (g.get(S.id) || []).join(`
9411
+ const y = t.data.curved ? u : (m.get(S.id) || []).join(`
9401
9412
  `);
9402
9413
  C.push(
9403
9414
  this.generateTextChangeCommandsForRegion(
9404
- m.get(S.id) || 1,
9415
+ g.get(S.id) || 1,
9405
9416
  t.data,
9406
9417
  S.id,
9407
9418
  y
@@ -9581,15 +9592,15 @@ class $s extends Fs {
9581
9592
  const I = et("g");
9582
9593
  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;
9583
9594
  const D = et("g");
9584
- return D.classList.add("module-layer3"), w.appendChild(D), D.setAttribute("fill", "white"), D.innerHTML = o, new Os(w).transform(([k, T]) => [k, T + (c / 2 - k) ** 2 / (c * 6)]), w;
9595
+ return D.classList.add("module-layer3"), w.appendChild(D), D.setAttribute("fill", "white"), D.innerHTML = o, new Os(w).transform(([F, T]) => [F, T + (c / 2 - F) ** 2 / (c * 6)]), w;
9585
9596
  }, u = et("g");
9586
9597
  u.classList.add("module-root");
9587
9598
  const h = et("defs");
9588
9599
  u.appendChild(h);
9589
- const m = et("g");
9590
- m.classList.add("module-bounds"), u.appendChild(m);
9591
- const g = Ms(e.height, e.width);
9592
- g.setAttribute("opacity", "0"), m.appendChild(g);
9600
+ const g = et("g");
9601
+ g.classList.add("module-bounds"), u.appendChild(g);
9602
+ const m = Ms(e.height, e.width);
9603
+ m.setAttribute("opacity", "0"), g.appendChild(m);
9593
9604
  const p = et("g");
9594
9605
  p.classList.add("module-text-enclosure"), u.appendChild(p);
9595
9606
  const f = A();
@@ -9601,7 +9612,7 @@ class $s extends Fs {
9601
9612
  async function Jn(r) {
9602
9613
  if (r === "Vegemite")
9603
9614
  return new $s();
9604
- throw new z(`Failed to resolve Module, Module ${r} not found`);
9615
+ throw new G(`Failed to resolve Module, Module ${r} not found`);
9605
9616
  }
9606
9617
  const ne = v`
9607
9618
  fragment GlobalPropertyStateAspectFields on GlobalPropertyStateAspect {
@@ -9625,7 +9636,7 @@ const ne = v`
9625
9636
  }
9626
9637
  }
9627
9638
  }
9628
- `, Us = v`
9639
+ `, Ls = v`
9629
9640
  ${ne}
9630
9641
  mutation CreateGlobalPropertyState($bundleId: String!) {
9631
9642
  globalPropertyStateCreate(bundleId: $bundleId) {
@@ -9635,7 +9646,7 @@ const ne = v`
9635
9646
  }
9636
9647
  }
9637
9648
  }
9638
- `, Ls = v`
9649
+ `, Us = v`
9639
9650
  ${ne}
9640
9651
  mutation UpdateGlobalPropertyState($id: String!, $aspects: [GlobalPropertyStateAspectInput]!) {
9641
9652
  globalPropertyStateUpdate(id: $id, aspects: $aspects) {
@@ -9662,7 +9673,7 @@ const ne = v`
9662
9673
  variables: {
9663
9674
  bundleId: r
9664
9675
  }
9665
- })).data.globalPropertyState, zs = v`
9676
+ })).data.globalPropertyState, Gs = v`
9666
9677
  ${Te}
9667
9678
  fragment ProductFields on Product {
9668
9679
  id
@@ -9708,7 +9719,7 @@ const ne = v`
9708
9719
  }
9709
9720
  }
9710
9721
  `, Ba = v`
9711
- ${zs}
9722
+ ${Gs}
9712
9723
  fragment ProductCollectionProductFields on ProductCollectionProduct {
9713
9724
  id
9714
9725
  productId
@@ -9775,7 +9786,7 @@ const ne = v`
9775
9786
  }
9776
9787
  }
9777
9788
  }
9778
- `, Gs = (r) => v`
9789
+ `, zs = (r) => v`
9779
9790
  ${ne}
9780
9791
  ${re(r)}
9781
9792
  query GetBundle($id: String!) {
@@ -10209,7 +10220,7 @@ const ne = v`
10209
10220
  mutation RejectTransaction($id: String!, $note: String) {
10210
10221
  transactionReject(id: $id, note: $note)
10211
10222
  }
10212
- `, mo = v`
10223
+ `, go = v`
10213
10224
  mutation CreateRecipient(
10214
10225
  $firstName: String
10215
10226
  $lastName: String
@@ -10237,7 +10248,7 @@ const ne = v`
10237
10248
  id
10238
10249
  }
10239
10250
  }
10240
- `, go = v`
10251
+ `, mo = v`
10241
10252
  mutation UpdateRecipient(
10242
10253
  $id: String!
10243
10254
  $firstName: String
@@ -10289,7 +10300,7 @@ class Ja extends Fn {
10289
10300
  }
10290
10301
  }
10291
10302
  class Co {
10292
- constructor(t, e, a, n, i, s, o, l, c, d, A, u, h, m = !1, g, p = !1, f = !1, C = !1) {
10303
+ constructor(t, e, a, n, i, s, o, l, c, d, A, u, h, g = !1, m, p = !1, f = !1, C = !1) {
10293
10304
  var w;
10294
10305
  this.workflowStatePromiseQueue = new kn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.renderLayouts = () => {
10295
10306
  var E;
@@ -10301,7 +10312,7 @@ class Co {
10301
10312
  for (const [, b] of y)
10302
10313
  b.render(S);
10303
10314
  }
10304
- }, 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) => {
10315
+ }, this.experience = t, this.client = e, this.updateTransaction = o, this.graphQlClient = l, this.commandContext = s, this.reloadedState = h, this.transaction = c, this.readOnly = g, 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 = m, 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) => {
10305
10316
  this.stepTags[S.stepName] = S.tags ?? [];
10306
10317
  }), C && (this.workflowStatePromiseQueue.enabled = !1), this.initializationPromise = this.initializeDefaultWorkflowState(a), this.initializationPromise.then(() => {
10307
10318
  this.initialized = !0;
@@ -10317,7 +10328,7 @@ class Co {
10317
10328
  return { recipient: this.transaction.recipient };
10318
10329
  }
10319
10330
  async updateRecipient(t, e, a, n, i, s, o, l, c, d) {
10320
- var A, u, h, m, g;
10331
+ var A, u, h, g, m;
10321
10332
  if ((A = this.transaction.recipient) != null && A.id)
10322
10333
  this.transaction.recipient = {
10323
10334
  id: this.transaction.recipient.id,
@@ -10332,7 +10343,7 @@ class Co {
10332
10343
  mobile: c || this.transaction.recipient.mobile,
10333
10344
  company: d || this.transaction.recipient.company
10334
10345
  }, await this.graphQlClient().mutate({
10335
- mutation: go,
10346
+ mutation: mo,
10336
10347
  errorPolicy: "all",
10337
10348
  fetchPolicy: "no-cache",
10338
10349
  variables: {
@@ -10351,7 +10362,7 @@ class Co {
10351
10362
  });
10352
10363
  else {
10353
10364
  const p = await this.graphQlClient().mutate({
10354
- mutation: mo,
10365
+ mutation: go,
10355
10366
  errorPolicy: "all",
10356
10367
  fetchPolicy: "no-cache",
10357
10368
  variables: {
@@ -10385,7 +10396,7 @@ class Co {
10385
10396
  fetchPolicy: "no-cache",
10386
10397
  variables: {
10387
10398
  id: this.transaction.id,
10388
- recipientId: (g = (m = p.data) == null ? void 0 : m.recipientCreate) == null ? void 0 : g.id
10399
+ recipientId: (m = (g = p.data) == null ? void 0 : g.recipientCreate) == null ? void 0 : m.id
10389
10400
  },
10390
10401
  context: {
10391
10402
  transactionOwnerId: this.transaction.transactionOwnerId
@@ -10405,7 +10416,7 @@ class Co {
10405
10416
  };
10406
10417
  this.reloadedState && this.reloadedState.serializableWorkflow.steps.forEach((o) => {
10407
10418
  this.storage[o.stepName] = o.storage || {};
10408
- }), this.allScenes = await Gi(t);
10419
+ }), this.allScenes = await zi(t);
10409
10420
  const n = Dt(this.allScenes, this.stepSelections).map((o) => o.silentSteps).flat(), { stepElements: i, commands: s } = await this.stepElementsForIntroducedSilentSteps(n, !!this.reloadedState);
10410
10421
  this.commandContext.apply(new $(s), !0), this.stepElements = { ...this.stepElements, ...i }, await this.ensureStepsAreLoaded(), !this.isReloadedTransaction && this.updateStateWithServer(), this.renderLayouts(), this.reloadedState && e();
10411
10422
  }
@@ -10624,7 +10635,7 @@ class Co {
10624
10635
  const l = o[0];
10625
10636
  if (s.type === P.Model) {
10626
10637
  if (!this.modelContainer)
10627
- throw new z(
10638
+ throw new G(
10628
10639
  "We should always have a model container when injecting a preview!"
10629
10640
  );
10630
10641
  const u = (A = l.asset) == null ? void 0 : A.fileLink;
@@ -10647,12 +10658,12 @@ class Co {
10647
10658
  console.error(`Failed to read material from variant: ${l.id} for step: ${s.stepName}`);
10648
10659
  return;
10649
10660
  }
10650
- s.data.targetMaterials.forEach((m) => {
10661
+ s.data.targetMaterials.forEach((g) => {
10651
10662
  if (!this.modelContainer)
10652
- throw new z(
10663
+ throw new G(
10653
10664
  "We should always have a model container when injecting a preview!"
10654
10665
  );
10655
- this.modelContainer.applyMaterialVariant(m, s.option.id, u);
10666
+ this.modelContainer.applyMaterialVariant(g, s.option.id, u);
10656
10667
  });
10657
10668
  }
10658
10669
  }), await a.getInitializationPromise(), this.renderLayouts();
@@ -10723,7 +10734,7 @@ class Co {
10723
10734
  serialize() {
10724
10735
  const t = this.getCommandContext().getState();
10725
10736
  if (!t)
10726
- throw new z("Attempted to serialize state before it was initialized.");
10737
+ throw new G("Attempted to serialize state before it was initialized.");
10727
10738
  const e = St(t.transaction), a = this.dehydrateState(e);
10728
10739
  return JSON.stringify(a);
10729
10740
  }
@@ -10876,18 +10887,18 @@ class Co {
10876
10887
  c.forEach((E) => {
10877
10888
  yt(E, this.stepSelections) || (this.stepInitialised[E.stepName] = !1);
10878
10889
  });
10879
- const u = this.getInvalidCanvasRegions(), { stepElements: h, commands: m } = await this.stepElementsForIntroducedSilentSteps(A, !1);
10890
+ const u = this.getInvalidCanvasRegions(), { stepElements: h, commands: g } = await this.stepElementsForIntroducedSilentSteps(A, !1);
10880
10891
  this.stepElements = {
10881
10892
  ...this.stepElements,
10882
10893
  ...h,
10883
10894
  [t]: a
10884
10895
  }, this.removeElements(u);
10885
- const g = this.workflow.steps.find((E) => E.stepName === t);
10886
- if ((g == null ? void 0 : g.type) === P.Frame) {
10887
- const E = (y = this.getWorkflowExperience().getStepById(g.stepName)) == null ? void 0 : y.frameService;
10896
+ const m = this.workflow.steps.find((E) => E.stepName === t);
10897
+ if ((m == null ? void 0 : m.type) === P.Frame) {
10898
+ const E = (y = this.getWorkflowExperience().getStepById(m.stepName)) == null ? void 0 : y.frameService;
10888
10899
  E == null || E.setTargetElements(a.map((b) => b.id));
10889
10900
  }
10890
- const p = u.map((E) => new bt(E.id)), f = new Wa(this.constructSerializableWorkflow()), C = [...m, ...p, f];
10901
+ const p = u.map((E) => new bt(E.id)), f = new Wa(this.constructSerializableWorkflow()), C = [...g, ...p, f];
10891
10902
  C.length > 0 && this.commandContext.apply(new $(C), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
10892
10903
  const w = this.getInvalidModelVariants(), S = this.modelContainer;
10893
10904
  if (S) {
@@ -10906,13 +10917,13 @@ class Co {
10906
10917
  }
10907
10918
  async ensureStepsAreLoaded() {
10908
10919
  const e = Dt(this.allScenes, this.stepSelections).map((l) => l.renderableSteps), a = [], n = e.flat();
10909
- console.log("LOG: ensuring steps are loaded");
10920
+ console.log(`LOG: ensuring steps are loaded. reloaded state: ${this.reloadedState}`);
10910
10921
  for (const l of n)
10911
10922
  if (!this.stepInitialised[l.stepName])
10912
10923
  switch (this.stepInitialised[l.stepName] = !0, l.type) {
10913
10924
  case P.DigitalContent:
10914
10925
  a.push(
10915
- Gn.init(
10926
+ zn.init(
10916
10927
  l,
10917
10928
  this,
10918
10929
  this.reloadedState
@@ -10924,7 +10935,7 @@ class Co {
10924
10935
  break;
10925
10936
  case P.Illustration:
10926
10937
  a.push(
10927
- ge.init(l, this, this.reloadedState)
10938
+ me.init(l, this, this.reloadedState)
10928
10939
  );
10929
10940
  break;
10930
10941
  case P.Material:
@@ -10953,7 +10964,7 @@ class Co {
10953
10964
  );
10954
10965
  break;
10955
10966
  case P.Shape:
10956
- a.push(zt.init(l, this, this.reloadedState));
10967
+ a.push(Gt.init(l, this, this.reloadedState));
10957
10968
  break;
10958
10969
  case P.Text:
10959
10970
  a.push(W.init(l, this, this.reloadedState));
@@ -11246,7 +11257,7 @@ class wo extends it {
11246
11257
  */
11247
11258
  async selectVariant(t) {
11248
11259
  if (!this.getUpdateState() && this.getCurrentVariant() !== t)
11249
- return ge.selectVariant(
11260
+ return me.selectVariant(
11250
11261
  this.step,
11251
11262
  t.getResource(),
11252
11263
  this.manager.getRegionElements(this.step.stepName) || [],
@@ -11263,7 +11274,7 @@ class wo extends it {
11263
11274
  const t = this.manager.getRegionElements(this.step.stepName) || [];
11264
11275
  if (t.length === 0)
11265
11276
  return;
11266
- const a = L(t[0].id, this.manager.getAllLayoutData()).colors, n = (o = this.getCurrentVariant()) == null ? void 0 : o.getAssetResource(), i = n == null ? void 0 : n.assetConfiguration, s = (i == null ? void 0 : i.defaultColorVariants) || [];
11277
+ const a = U(t[0].id, this.manager.getAllLayoutData()).colors, n = (o = this.getCurrentVariant()) == null ? void 0 : o.getAssetResource(), i = n == null ? void 0 : n.assetConfiguration, s = (i == null ? void 0 : i.defaultColorVariants) || [];
11267
11278
  if (s.length !== 0) {
11268
11279
  const l = {};
11269
11280
  return s.forEach((c) => {
@@ -11292,7 +11303,7 @@ class wo extends it {
11292
11303
  const d = c.id.replace(/\W/g, "");
11293
11304
  a ? n.set(d, { browserValue: e, pmsValue: a }) : n.set(d, e);
11294
11305
  }
11295
- }) : a ? n.set(t, { browserValue: e, pmsValue: a }) : n.set(t, e), ge.changeColors(
11306
+ }) : a ? n.set(t, { browserValue: e, pmsValue: a }) : n.set(t, e), me.changeColors(
11296
11307
  this.step,
11297
11308
  this.manager.getRegionElements(this.step.stepName),
11298
11309
  this.manager,
@@ -11304,7 +11315,7 @@ class wo extends it {
11304
11315
  return this.step.data.colorOption;
11305
11316
  }
11306
11317
  getAvailableColors() {
11307
- return this.step.data.colorPickerEnabled ? ge.availableColors(this.step, this.manager) : Promise.resolve([]);
11318
+ return this.step.data.colorPickerEnabled ? me.availableColors(this.step, this.manager) : Promise.resolve([]);
11308
11319
  }
11309
11320
  isColorPickerEnabled() {
11310
11321
  return this.step.data.colorPickerEnabled ?? !1;
@@ -11380,7 +11391,7 @@ class bo extends it {
11380
11391
  }
11381
11392
  selectVariant(t) {
11382
11393
  const e = t.getResource();
11383
- return zt.selectVariant(
11394
+ return Gt.selectVariant(
11384
11395
  this.step,
11385
11396
  {
11386
11397
  fill: e.color,
@@ -11398,7 +11409,7 @@ class bo extends it {
11398
11409
  * @deprecated The shape step can now pass through colors returned by getColors via selectVariant. Please swap setColor for selectVariant.
11399
11410
  */
11400
11411
  setColor(t) {
11401
- return zt.selectVariant(
11412
+ return Gt.selectVariant(
11402
11413
  this.step,
11403
11414
  t,
11404
11415
  this.manager.getRegionElements(this.step.stepName) || [],
@@ -11410,7 +11421,7 @@ class bo extends it {
11410
11421
  * @returns A list of color definitions that are currently applied to the illustration.
11411
11422
  */
11412
11423
  getColors() {
11413
- return zt.availableColours(this.step);
11424
+ return Gt.availableColours(this.step);
11414
11425
  }
11415
11426
  /**
11416
11427
  * Allows for setting a custom color when the custom variant is selected. Will
@@ -11418,7 +11429,7 @@ class bo extends it {
11418
11429
  */
11419
11430
  setCustomColor(t) {
11420
11431
  var e, a;
11421
- return ((e = this.getCurrentVariant()) == null ? void 0 : e.getColor()) !== "#custom" && console.warn(`setting custom color for step ${this.step.stepName} but color is ${(a = this.getCurrentVariant()) == null ? void 0 : a.getColor()}`), zt.setCustomColor(t, this.step, this.manager);
11432
+ return ((e = this.getCurrentVariant()) == null ? void 0 : e.getColor()) !== "#custom" && console.warn(`setting custom color for step ${this.step.stepName} but color is ${(a = this.getCurrentVariant()) == null ? void 0 : a.getColor()}`), Gt.setCustomColor(t, this.step, this.manager);
11422
11433
  }
11423
11434
  getCustomColor() {
11424
11435
  var e, a, n;
@@ -11662,7 +11673,7 @@ class Po extends it {
11662
11673
  * @returns The final URL string for the QR code.
11663
11674
  */
11664
11675
  async selectVideo(t) {
11665
- return Gn.regenerateQRCode(
11676
+ return zn.regenerateQRCode(
11666
11677
  this.manager.getRegionElements(this.step.stepName),
11667
11678
  t.key,
11668
11679
  this.manager,
@@ -11744,7 +11755,7 @@ class ce {
11744
11755
  case P.Module:
11745
11756
  return new Do(t, e, t.getStepTags(e.stepName));
11746
11757
  default:
11747
- throw new z(`Step type ${e.type} not yet supported in Core SDK`);
11758
+ throw new G(`Step type ${e.type} not yet supported in Core SDK`);
11748
11759
  }
11749
11760
  }
11750
11761
  }
@@ -11945,10 +11956,10 @@ const ko = async (r, t) => {
11945
11956
  }
11946
11957
  return n;
11947
11958
  }, Xn = (r, t, e, a, n, i, s, o) => {
11948
- var m, g;
11959
+ var g, m;
11949
11960
  const l = t.basePrice || 0, c = r.priceModifierTotal || 0, d = To(a, e, void 0, i), u = (N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(r.id), h = {
11950
- additionalExternalProductId: (m = r.integrationProduct) == null ? void 0 : m.additionalExternalProductId,
11951
- additionalExternalVariantId: (g = r.integrationProduct) == null ? void 0 : g.additionalExternalVariantId,
11961
+ additionalExternalProductId: (g = r.integrationProduct) == null ? void 0 : g.additionalExternalProductId,
11962
+ additionalExternalVariantId: (m = r.integrationProduct) == null ? void 0 : m.additionalExternalVariantId,
11952
11963
  baseCost: l,
11953
11964
  designExternalVariants: r.designExternalVariants,
11954
11965
  designProductId: r.externalDesignProductId,
@@ -11988,9 +11999,9 @@ const ko = async (r, t) => {
11988
11999
  T.errors && console.log("Server Error:", tt.message);
11989
12000
  }), null) : nt ?? null;
11990
12001
  })() || (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(a())), await r.updateStateWithServerImmediate(a), console.log("Server state is undefined @ Workflow completion"));
11991
- const u = r.getPreviewService(), h = (I = t == null ? void 0 : t.finalizeStepConfig) == null ? void 0 : I.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, g = l && ca(l, t, !0), p = l && ca(l, t, !1), f = async (D) => {
12002
+ const u = r.getPreviewService(), h = (I = t == null ? void 0 : t.finalizeStepConfig) == null ? void 0 : I.lookAtAnimation, g = u && t.showModelOnFinishStep && !!h, m = l && ca(l, t, !0), p = l && ca(l, t, !1), f = async (D) => {
11992
12003
  const x = {};
11993
- let k = 0;
12004
+ let F = 0;
11994
12005
  if (Object.keys(i).length > 0)
11995
12006
  for (const T of Object.keys(i)) {
11996
12007
  const nt = i[T], R = t.steps.find((tt) => tt.stepName === T);
@@ -12010,10 +12021,10 @@ const ko = async (r, t) => {
12010
12021
  }
12011
12022
  ];
12012
12023
  }
12013
- k += q.priceModifier;
12024
+ F += q.priceModifier;
12014
12025
  }
12015
12026
  }
12016
- return [x, k];
12027
+ return [x, F];
12017
12028
  }, [C] = await f(!0), w = Object.fromEntries(
12018
12029
  Object.keys(C).map((D) => [D, C[D].map((x) => x.id)])
12019
12030
  ), [S] = await f(!1), y = Object.fromEntries(
@@ -12022,10 +12033,10 @@ const ko = async (r, t) => {
12022
12033
  S[D].map((x) => x.id)
12023
12034
  ])
12024
12035
  );
12025
- let E = await o(m, n.id);
12036
+ let E = await o(g, n.id);
12026
12037
  if (E) {
12027
12038
  const D = await (await rt(E)).blob();
12028
- E = (await U.uploadAsset(
12039
+ E = (await L.uploadAsset(
12029
12040
  { name: `${n.id}-preview-image.png`, blob: D },
12030
12041
  Ce.Image,
12031
12042
  !0,
@@ -12042,25 +12053,25 @@ const ko = async (r, t) => {
12042
12053
  })),
12043
12054
  workflowId: t.id,
12044
12055
  transactionId: n.id,
12045
- useThreeDimPreview: !!m,
12056
+ useThreeDimPreview: !!g,
12046
12057
  previewImage: E
12047
12058
  };
12048
12059
  if (p) {
12049
12060
  const x = [];
12050
- for (const [k, T] of Object.entries(p))
12051
- x.push({ key: k, value: T });
12061
+ for (const [F, T] of Object.entries(p))
12062
+ x.push({ key: F, value: T });
12052
12063
  D.metadata = x;
12053
12064
  }
12054
12065
  if (w) {
12055
12066
  const x = [];
12056
- for (const [k, T] of Object.entries(y))
12057
- x.push({ key: k, ids: T });
12067
+ for (const [F, T] of Object.entries(y))
12068
+ x.push({ key: F, ids: T });
12058
12069
  D.selectedVariants = x;
12059
12070
  }
12060
12071
  return D;
12061
12072
  })(),
12062
12073
  cartSelectionsWithPrices: C,
12063
- cartMetadata: g
12074
+ cartMetadata: m
12064
12075
  };
12065
12076
  }, No = async (r, t, e, a, n, i, s, o, l, c, d) => {
12066
12077
  var f, C;
@@ -12077,20 +12088,20 @@ const ko = async (r, t) => {
12077
12088
  d
12078
12089
  );
12079
12090
  l("workflow.steps.finish.finalize.creatingDesign");
12080
- const m = await ko(A), g = (f = m == null ? void 0 : m.transaction) == null ? void 0 : f.previewImageLink;
12081
- if (!(m != null && m.transaction))
12091
+ const g = await ko(A), m = (f = g == null ? void 0 : g.transaction) == null ? void 0 : f.previewImageLink;
12092
+ if (!(g != null && g.transaction))
12082
12093
  throw new Error("Failed to create design");
12083
12094
  l("workflow.steps.finish.finalize.updatingTransaction");
12084
- const p = m.transaction;
12095
+ const p = g.transaction;
12085
12096
  return Xn(
12086
12097
  p,
12087
12098
  n,
12088
12099
  t,
12089
12100
  u,
12090
- m == null ? void 0 : m.sku,
12101
+ g == null ? void 0 : g.sku,
12091
12102
  h,
12092
- g,
12093
- (C = m == null ? void 0 : m.processExecution) == null ? void 0 : C.id
12103
+ m,
12104
+ (C = g == null ? void 0 : g.processExecution) == null ? void 0 : C.id
12094
12105
  );
12095
12106
  }, Qo = async (r, t, e) => {
12096
12107
  t("workflow.steps.finish.finalize.buildingLayouts"), await Promise.all(
@@ -12166,7 +12177,7 @@ class Ro {
12166
12177
  const t = N.get(this.localPersistenceKey);
12167
12178
  return t ? JSON.parse(t) : [];
12168
12179
  }
12169
- throw new z("Unexpected storage method requested");
12180
+ throw new G("Unexpected storage method requested");
12170
12181
  }
12171
12182
  /**
12172
12183
  * Search for a transaction that has been saved.
@@ -12206,7 +12217,7 @@ class Ro {
12206
12217
  N.set(this.localPersistenceKey, JSON.stringify(t));
12207
12218
  return;
12208
12219
  }
12209
- throw new z("Unexpected storage method requested");
12220
+ throw new G("Unexpected storage method requested");
12210
12221
  }
12211
12222
  }
12212
12223
  const Ye = new Ro(), Oo = v`
@@ -12245,14 +12256,14 @@ const Ye = new Ro(), Oo = v`
12245
12256
  id
12246
12257
  }
12247
12258
  }
12248
- `, Uo = v`
12259
+ `, Lo = v`
12249
12260
  mutation AddOrganizationToTransaction($transactionId: String!, $organizationName: String!) {
12250
12261
  organizationAttachToTransaction(transactionId: $transactionId, organizationName: $organizationName) {
12251
12262
  id
12252
12263
  }
12253
12264
  }
12254
12265
  `;
12255
- var Lo = /* @__PURE__ */ ((r) => (r.QuantityChanged = "QuantityChanged", r.PriceBreakChanged = "PriceBreakChanged", r))(Lo || {});
12266
+ var Uo = /* @__PURE__ */ ((r) => (r.QuantityChanged = "QuantityChanged", r.PriceBreakChanged = "PriceBreakChanged", r))(Uo || {});
12256
12267
  class Vo {
12257
12268
  constructor(t, e) {
12258
12269
  var n;
@@ -12330,7 +12341,7 @@ class Vo {
12330
12341
  }
12331
12342
  async attachOrganization(t) {
12332
12343
  await this.graphQlClient().mutate({
12333
- mutation: Uo,
12344
+ mutation: Lo,
12334
12345
  variables: {
12335
12346
  transactionId: this.getWorkflowManager().getTransaction().id,
12336
12347
  organizationName: t
@@ -12365,7 +12376,7 @@ class Vo {
12365
12376
  }
12366
12377
  let i = 2048;
12367
12378
  e && e <= 2048 && (i = e);
12368
- const s = gt(i, i), o = this.commandContext.getAllLayouts(), l = a.defaultPreviewPanelIndex || 0, c = a.panels[l], d = o.find((S) => {
12379
+ const s = mt(i, i), o = this.commandContext.getAllLayouts(), l = a.defaultPreviewPanelIndex || 0, c = a.panels[l], d = o.find((S) => {
12369
12380
  var y;
12370
12381
  return ((y = S.layoutState) == null ? void 0 : y.layout.panelId) === (c == null ? void 0 : c.name);
12371
12382
  }) || o[0], A = d.layoutState.layout.previewRegion ? {
@@ -12381,19 +12392,19 @@ class Vo {
12381
12392
  }, u = this.commandContext.getLayoutById(d.layoutState.layout.id), h = s.getContext("2d");
12382
12393
  if (!h)
12383
12394
  throw new xe("Failed to obtain 2D context for preview image creation");
12384
- const m = Sa(u.layoutState.layout, u.layoutState.elements, {
12395
+ const g = Sa(u.layoutState.layout, u.layoutState.elements, {
12385
12396
  renderingConfiguration: {
12386
12397
  purpose: qt.Print,
12387
12398
  region: { left: A.x, top: A.y, width: A.width, height: A.height },
12388
12399
  templatingContext: this.workflowManager.getTemplatingContext()
12389
12400
  }
12390
- }), g = mn(m);
12391
- await (await Aa.from(h, g, {
12401
+ }), m = gn(g);
12402
+ await (await Aa.from(h, m, {
12392
12403
  anonymousCrossOrigin: !0,
12393
12404
  ignoreDimensions: !1,
12394
- createCanvas: gt,
12405
+ createCanvas: mt,
12395
12406
  createImage: Zt,
12396
- DOMParser: ga(),
12407
+ DOMParser: ma(),
12397
12408
  fetch
12398
12409
  })).render();
12399
12410
  const f = await this.getCanvasObjectURLAsync(s);
@@ -12492,16 +12503,16 @@ class Vo {
12492
12503
  const d = /* @__PURE__ */ new Set(), A = c.getRaw().globalPropertyAspectConfigurations;
12493
12504
  A !== void 0 && (A.forEach((u) => d.add(JSON.stringify(u))), o.forEach((u) => {
12494
12505
  const h = u.getRaw().globalPropertyAspectConfigurations;
12495
- h !== void 0 && h.forEach((m) => {
12496
- const g = l(m), p = d.has(JSON.stringify(m));
12497
- if (p && (g == null ? void 0 : g.getType()) === "Option") {
12506
+ h !== void 0 && h.forEach((g) => {
12507
+ const m = l(g), p = d.has(JSON.stringify(g));
12508
+ if (p && (m == null ? void 0 : m.getType()) === "Option") {
12498
12509
  const f = u.getCurrentVariant();
12499
12510
  if (!f)
12500
12511
  return;
12501
- c.selectVariant(f), d.delete(JSON.stringify(m));
12502
- } else if (p && (g == null ? void 0 : g.getType()) === "Text") {
12512
+ c.selectVariant(f), d.delete(JSON.stringify(g));
12513
+ } else if (p && (m == null ? void 0 : m.getType()) === "Text") {
12503
12514
  const f = u.getText();
12504
- c.setText(f), d.delete(JSON.stringify(m));
12515
+ c.setText(f), d.delete(JSON.stringify(g));
12505
12516
  }
12506
12517
  });
12507
12518
  }));
@@ -12556,7 +12567,7 @@ class Vo {
12556
12567
  }
12557
12568
  async save(t) {
12558
12569
  if (!this.getCommandContext().getState())
12559
- throw new z("State undefined!");
12570
+ throw new G("State undefined!");
12560
12571
  const n = {
12561
12572
  title: await (async () => {
12562
12573
  var l;
@@ -12579,10 +12590,10 @@ class Vo {
12579
12590
  var s;
12580
12591
  const t = St(this.getCommandContext().getState());
12581
12592
  if (!t)
12582
- throw new z("Internal state is undefined! Cannot copy experience!");
12593
+ throw new G("Internal state is undefined! Cannot copy experience!");
12583
12594
  const e = JSON.stringify(t.transaction), a = this.getWorkflowManager().getWorkflow(), n = (s = this.getWorkflowManager().getTransaction().integrationProduct) == null ? void 0 : s.id;
12584
12595
  if (!n)
12585
- throw new z("Integration product id is undefined!");
12596
+ throw new G("Integration product id is undefined!");
12586
12597
  return await this.getClient().getWorkflowExperience({
12587
12598
  type: "integration",
12588
12599
  integrationProductId: n,
@@ -12681,7 +12692,7 @@ class Vo {
12681
12692
  (this.eventCallbacks.get(t) || []).forEach((e) => e(this));
12682
12693
  }
12683
12694
  }
12684
- const zo = [
12695
+ const Go = [
12685
12696
  "altGlyph",
12686
12697
  "circle",
12687
12698
  "ellipse",
@@ -12693,17 +12704,17 @@ const zo = [
12693
12704
  "textPath",
12694
12705
  "tref",
12695
12706
  "tspan"
12696
- ], Go = async (r, t, e) => {
12707
+ ], zo = async (r, t, e) => {
12697
12708
  const a = t.data, n = e.data.baseUrl, i = a.assetUrl.replace("localhost", "localstack"), s = n.slice(0, 4) === "http" ? "" : "https://", o = new URL(s + n);
12698
12709
  o.searchParams.append("video", Ra(JSON.stringify([{ href: i }]))), o.pathname = o.pathname + (o.pathname.slice(-1) === "/" ? "" : "/");
12699
12710
  const l = o.toString(), d = `data:image/svg+xml;base64,${Ra(await ln(l, { type: "svg" }))}`, A = (h) => {
12700
- const m = r.find((p) => p.panelId === h.panelId);
12701
- if (!m)
12711
+ const g = r.find((p) => p.panelId === h.panelId);
12712
+ if (!g)
12702
12713
  throw new J(h);
12703
- const g = Q();
12704
- return new G(
12714
+ const m = Q();
12715
+ return new z(
12705
12716
  {
12706
- id: g,
12717
+ id: m,
12707
12718
  src: d,
12708
12719
  type: M.Image,
12709
12720
  y: h.top,
@@ -12712,7 +12723,7 @@ const zo = [
12712
12723
  height: h.height,
12713
12724
  rotation: 0
12714
12725
  },
12715
- m
12726
+ g
12716
12727
  );
12717
12728
  }, u = e.data.regions;
12718
12729
  try {
@@ -12726,11 +12737,11 @@ const zo = [
12726
12737
  const o = cs(n, a.option);
12727
12738
  o && (t[a.stepName] = { selectedVariants: [o] });
12728
12739
  const l = async (c) => {
12729
- var g;
12730
- const d = await $n(c, (g = o == null ? void 0 : o.asset) == null ? void 0 : g.fileLink), A = await Qe(d), u = Q(), h = r.find((p) => p.panelId === c.panelId);
12740
+ var m;
12741
+ const d = await $n(c, (m = o == null ? void 0 : o.asset) == null ? void 0 : m.fileLink), A = await Qe(d), u = Q(), h = r.find((p) => p.panelId === c.panelId);
12731
12742
  if (!h)
12732
12743
  throw new J(c);
12733
- const m = Ea(
12744
+ const g = Ea(
12734
12745
  s,
12735
12746
  A,
12736
12747
  {
@@ -12741,7 +12752,7 @@ const zo = [
12741
12752
  a.data.forceImageCover
12742
12753
  );
12743
12754
  return [
12744
- new G(
12755
+ new z(
12745
12756
  {
12746
12757
  id: u,
12747
12758
  path: A.path,
@@ -12759,13 +12770,13 @@ const zo = [
12759
12770
  pattern: {
12760
12771
  id: `${u}-pattern`,
12761
12772
  src: s.src,
12762
- x: m.x,
12763
- y: m.y,
12773
+ x: g.x,
12774
+ y: g.y,
12764
12775
  width: s.width,
12765
12776
  height: s.height,
12766
12777
  rotation: 0,
12767
- scaleX: m.zoom,
12768
- scaleY: m.zoom,
12778
+ scaleX: g.zoom,
12779
+ scaleY: g.zoom,
12769
12780
  svg: s.svg,
12770
12781
  colors: s.colors
12771
12782
  }
@@ -12792,30 +12803,30 @@ const zo = [
12792
12803
  const o = (E = s.asset) == null ? void 0 : E.fileLink;
12793
12804
  if (!o)
12794
12805
  return console.error(`No asset link for variant with ID: ${n.illustrationVariantId}`), [];
12795
- const l = await at(o, !0), c = /<svg.*?<\/svg>/s, d = l.match(c) || [], A = (d == null ? void 0 : d.length) > 0 ? d[0] : "", m = dt().parseFromString(A, "image/svg+xml").firstElementChild;
12796
- if (!m)
12806
+ const l = await at(o, !0), c = /<svg.*?<\/svg>/s, d = l.match(c) || [], A = (d == null ? void 0 : d.length) > 0 ? d[0] : "", g = dt().parseFromString(A, "image/svg+xml").firstElementChild;
12807
+ if (!g)
12797
12808
  return console.error("Failed to read SVG."), [];
12798
- pa(m);
12799
- const g = {};
12800
- kt(m, (b) => {
12801
- zo.includes(b.tagName) && !b.attributes.getNamedItem("fill") && b.setAttribute("fill", "#000000");
12809
+ pa(g);
12810
+ const m = {};
12811
+ kt(g, (b) => {
12812
+ Go.includes(b.tagName) && !b.attributes.getNamedItem("fill") && b.setAttribute("fill", "#000000");
12802
12813
  const I = b.attributes.getNamedItem("fill");
12803
12814
  if (I && I.value !== "none") {
12804
12815
  const x = I.value, T = `spiff-fill-${x.replace(/\W/g, "")}`;
12805
- b.classList.add(T), g[T] = { browserValue: x };
12816
+ b.classList.add(T), m[T] = { browserValue: x };
12806
12817
  }
12807
12818
  const D = b.attributes.getNamedItem("stroke");
12808
12819
  if (D && D.value !== "none") {
12809
12820
  const x = D.value, T = `spiff-stroke-${x.replace(/\W/g, "")}`;
12810
- b.classList.add(T), g[T] = { browserValue: x };
12821
+ b.classList.add(T), m[T] = { browserValue: x };
12811
12822
  }
12812
12823
  });
12813
- const f = Bt().serializeToString(m), C = n.colors;
12824
+ const f = Bt().serializeToString(g), C = n.colors;
12814
12825
  if (C) {
12815
- for (const [b, I] of Object.entries(g))
12826
+ for (const [b, I] of Object.entries(m))
12816
12827
  for (const D of Object.keys(C))
12817
12828
  if (I.browserValue === D) {
12818
- g[b] = { browserValue: C[D] };
12829
+ m[b] = { browserValue: C[D] };
12819
12830
  break;
12820
12831
  }
12821
12832
  }
@@ -12824,9 +12835,9 @@ const zo = [
12824
12835
  if (!I)
12825
12836
  throw new J(b);
12826
12837
  const D = Q();
12827
- return new G(
12838
+ return new z(
12828
12839
  {
12829
- colors: g,
12840
+ colors: m,
12830
12841
  id: D,
12831
12842
  svg: f,
12832
12843
  type: M.Illustration,
@@ -12853,7 +12864,7 @@ const zo = [
12853
12864
  if (!c)
12854
12865
  throw new J(l);
12855
12866
  const d = Q();
12856
- return new G(
12867
+ return new z(
12857
12868
  {
12858
12869
  colors: {},
12859
12870
  id: d,
@@ -12892,13 +12903,13 @@ const zo = [
12892
12903
  if (!o)
12893
12904
  return console.error(`No asset link for variant with ID: ${n.pictureVariantId}`), [];
12894
12905
  const l = (u) => {
12895
- const h = r.find((g) => g.panelId === u.panelId);
12906
+ const h = r.find((m) => m.panelId === u.panelId);
12896
12907
  if (!h)
12897
12908
  throw new J(u);
12898
- const m = Q();
12899
- return new G(
12909
+ const g = Q();
12910
+ return new z(
12900
12911
  {
12901
- id: m,
12912
+ id: g,
12902
12913
  src: o,
12903
12914
  type: M.Image,
12904
12915
  y: u.top,
@@ -12952,11 +12963,11 @@ const zo = [
12952
12963
  fill="${s == null ? void 0 : s.color}"
12953
12964
  />
12954
12965
  </svg>
12955
- `, m = { "spiff-fill-shape": { browserValue: s.color || "#000000" } }, g = Q();
12956
- return new G(
12966
+ `, g = { "spiff-fill-shape": { browserValue: s.color || "#000000" } }, m = Q();
12967
+ return new z(
12957
12968
  {
12958
- colors: m,
12959
- id: g,
12969
+ colors: g,
12970
+ id: m,
12960
12971
  svg: u,
12961
12972
  type: M.Illustration,
12962
12973
  y: d.top,
@@ -13004,20 +13015,20 @@ const zo = [
13004
13015
  excludeFromExport: t.data.excludeFromPrint,
13005
13016
  preserveAspectRatio: "none"
13006
13017
  };
13007
- a.push(new G(A, d));
13018
+ a.push(new z(A, d));
13008
13019
  });
13009
13020
  } catch (c) {
13010
13021
  console.error(c);
13011
13022
  }
13012
13023
  else {
13013
13024
  const c = await at(i, !0), d = (A) => {
13014
- 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;
13025
+ const u = /<svg.*?<\/svg>/s, h = A.match(u) || [], g = (h == null ? void 0 : h.length) > 0 ? h[0] : "", f = dt().parseFromString(g, "image/svg+xml").firstElementChild;
13015
13026
  if (!f)
13016
13027
  throw new xt("Failed to read SVG.");
13017
13028
  return pa(f), Bt().serializeToString(f);
13018
13029
  };
13019
13030
  l.forEach((A) => {
13020
- const u = r.find((m) => m.panelId === A.panelId);
13031
+ const u = r.find((g) => g.panelId === A.panelId);
13021
13032
  if (!u)
13022
13033
  throw new J(A);
13023
13034
  const h = {
@@ -13039,7 +13050,7 @@ const zo = [
13039
13050
  productOverlay: t.type === P.ProductOverlay ? !0 : void 0,
13040
13051
  excludeFromExport: t.data.excludeFromPrint
13041
13052
  };
13042
- a.push(new G(h, u));
13053
+ a.push(new z(h, u));
13043
13054
  });
13044
13055
  }
13045
13056
  return a;
@@ -13074,8 +13085,8 @@ const zo = [
13074
13085
  return;
13075
13086
  const C = Y.getDefaultVariant(f);
13076
13087
  return C == null ? void 0 : C.color;
13077
- }, m = i.color || await h(a.data), g = a.data.regions;
13078
- for (const p of g) {
13088
+ }, g = i.color || await h(a.data), m = a.data.regions;
13089
+ for (const p of m) {
13079
13090
  const f = r.find((w) => w.panelId === p.panelId);
13080
13091
  if (!f)
13081
13092
  continue;
@@ -13084,7 +13095,7 @@ const zo = [
13084
13095
  id: Q(),
13085
13096
  align: o(a.data),
13086
13097
  curved: a.data.curved,
13087
- fill: i.color || m || "#000000",
13098
+ fill: i.color || g || "#000000",
13088
13099
  fontData: d,
13089
13100
  fontSize: a.data.size || s,
13090
13101
  height: p.height,
@@ -13118,7 +13129,7 @@ const zo = [
13118
13129
  }
13119
13130
  );
13120
13131
  n.push(
13121
- new G(
13132
+ new z(
13122
13133
  {
13123
13134
  ...C,
13124
13135
  fontSize: w,
@@ -13129,7 +13140,7 @@ const zo = [
13129
13140
  )
13130
13141
  );
13131
13142
  } else
13132
- n.push(new G(C, f));
13143
+ n.push(new z(C, f));
13133
13144
  }
13134
13145
  return n;
13135
13146
  }, _o = (r, t) => r.conditions ? r.conditions.every((e) => {
@@ -13149,7 +13160,7 @@ const zo = [
13149
13160
  switch (o.type) {
13150
13161
  case P.DigitalContent:
13151
13162
  n.push(
13152
- ...await Go(e, s, o)
13163
+ ...await zo(e, s, o)
13153
13164
  );
13154
13165
  break;
13155
13166
  case P.Frame:
@@ -13229,7 +13240,7 @@ class Zo {
13229
13240
  }
13230
13241
  const tl = () => new Promise((r, t) => {
13231
13242
  try {
13232
- const a = gt().getContext("webgl2");
13243
+ const a = mt().getContext("webgl2");
13233
13244
  r(!!a);
13234
13245
  } catch {
13235
13246
  r(!1);
@@ -13342,15 +13353,15 @@ class nl extends Fn {
13342
13353
  * a loose target but should be kept in mind when making changes.
13343
13354
  */
13344
13355
  async execute() {
13345
- var h, m;
13346
- const t = this.layouts.find((g) => g.layoutState.layout.id === this.layoutId);
13356
+ var h, g;
13357
+ const t = this.layouts.find((m) => m.layoutState.layout.id === this.layoutId);
13347
13358
  if (!t)
13348
13359
  return;
13349
13360
  const e = t.layoutState.elements || [], a = t.layoutState.layout.width, n = t.layoutState.layout.height, i = a === 1 || n === 1 ? { width: 1, height: 1 } : this.getDynamicTextureResolution(), s = i.width, o = i.height;
13350
13361
  let l, c;
13351
13362
  if (this.nonPOTSupport) {
13352
- const g = s / o;
13353
- a / n < g ? (l = s, c = n * (s / a)) : (l = a * (o / n), c = o);
13363
+ const m = s / o;
13364
+ a / n < m ? (l = s, c = n * (s / a)) : (l = a * (o / n), c = o);
13354
13365
  const f = this.resizeFit({ width: l, height: c });
13355
13366
  l = f.width, c = f.height;
13356
13367
  } else
@@ -13358,18 +13369,18 @@ class nl extends Fn {
13358
13369
  const d = Sa(t.layoutState.layout, e, {
13359
13370
  renderingConfiguration: {
13360
13371
  purpose: qt.ThreeD,
13361
- templatingContext: (m = (h = this.getWorkflowManager) == null ? void 0 : h.call(this)) == null ? void 0 : m.getTemplatingContext()
13372
+ templatingContext: (g = (h = this.getWorkflowManager) == null ? void 0 : h.call(this)) == null ? void 0 : g.getTemplatingContext()
13362
13373
  }
13363
- }), A = mn(d), u = await Aa.from(this.ctx, A, {
13374
+ }), A = gn(d), u = await Aa.from(this.ctx, A, {
13364
13375
  anonymousCrossOrigin: !0,
13365
13376
  ignoreDimensions: !this.nonPOTSupport,
13366
13377
  ignoreAnimation: !0,
13367
13378
  ignoreClear: !0,
13368
13379
  ignoreMouse: !0,
13369
13380
  enableRedraw: !1,
13370
- createCanvas: gt,
13381
+ createCanvas: mt,
13371
13382
  createImage: Zt,
13372
- DOMParser: ga(),
13383
+ DOMParser: ma(),
13373
13384
  fetch
13374
13385
  });
13375
13386
  u.resize(l, c), await u.render(), this.onRender();
@@ -13579,7 +13590,7 @@ class il extends Ia {
13579
13590
  const e = await this.getOriginalImage();
13580
13591
  if (!e)
13581
13592
  throw new Error("You must supply an image selection before attempting to remove the background.");
13582
- const a = this.bundle.getGlobalPropertyStateManager(), n = await U.removeBackgroundFromAsset(e), s = {
13593
+ const a = this.bundle.getGlobalPropertyStateManager(), n = await L.removeBackgroundFromAsset(e), s = {
13583
13594
  ...a.getAspectStorage(this.property.name),
13584
13595
  backgroundRemovedAssetKey: n.key,
13585
13596
  useOriginalAsset: !t
@@ -13599,7 +13610,7 @@ class il extends Ia {
13599
13610
  async getImage() {
13600
13611
  const t = this.getStateValue();
13601
13612
  if (t)
13602
- return U.getLocalOrFromServer(t);
13613
+ return L.getLocalOrFromServer(t);
13603
13614
  }
13604
13615
  async getImageWithColors() {
13605
13616
  var t, e;
@@ -13612,7 +13623,7 @@ class il extends Ia {
13612
13623
  async getOriginalImage() {
13613
13624
  const t = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13614
13625
  if (t != null && t.originalAssetKey)
13615
- return U.getLocalOrFromServer(t.originalAssetKey);
13626
+ return L.getLocalOrFromServer(t.originalAssetKey);
13616
13627
  }
13617
13628
  /**
13618
13629
  * Retrieves the version of the image selection that has the background removed, if one exists.
@@ -13621,7 +13632,7 @@ class il extends Ia {
13621
13632
  async getBackgroundRemovedImage() {
13622
13633
  const t = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13623
13634
  if (t != null && t.backgroundRemovedAssetKey)
13624
- return U.getLocalOrFromServer(t.backgroundRemovedAssetKey);
13635
+ return L.getLocalOrFromServer(t.backgroundRemovedAssetKey);
13625
13636
  }
13626
13637
  getUseOriginalImage() {
13627
13638
  var t;
@@ -13657,7 +13668,7 @@ class il extends Ia {
13657
13668
  const e = this.getStateValue();
13658
13669
  if (!e)
13659
13670
  return;
13660
- const a = await U.getLocalOrFromServer(e);
13671
+ const a = await L.getLocalOrFromServer(e);
13661
13672
  if (!a)
13662
13673
  return;
13663
13674
  await this.applyImageSelection(a, t, !1, !0);
@@ -13765,7 +13776,7 @@ class sl extends Ia {
13765
13776
  * Set the text.
13766
13777
  */
13767
13778
  async setText(t) {
13768
- console.log(`LOG: global setting text ${t}`), await Promise.all([
13779
+ await Promise.all([
13769
13780
  this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t),
13770
13781
  this.applyTextSelection(t)
13771
13782
  ]);
@@ -13974,7 +13985,7 @@ class cl {
13974
13985
  return (a = this.globalPropertyState.aspects.find((n) => n.name === t && n.channel === e)) == null ? void 0 : a.storage;
13975
13986
  }
13976
13987
  async setAspect(t, e, a, n) {
13977
- if (!this.globalPropertyState)
13988
+ if (console.log(`LOG: setting aspect ${t} to ${e}`), !this.globalPropertyState)
13978
13989
  throw new Error("Global property state not initialized");
13979
13990
  if (!this.configuration)
13980
13991
  throw new Error("Global property configuration not linked to the state manager.");
@@ -13983,7 +13994,7 @@ class cl {
13983
13994
  throw new Error(`Failed to find configuration aspect with name: ${t}`);
13984
13995
  const s = St(this.globalPropertyState), o = this.globalPropertyState.aspects.filter((l) => l.name === t);
13985
13996
  if (o.length > 0)
13986
- if (n) {
13997
+ if (console.log("LOG: setting aspect if case"), n) {
13987
13998
  const l = o.find((c) => c.channel === n);
13988
13999
  if (l)
13989
14000
  l.value = e, l.type = i.type, l.channel = n, a !== void 0 && (l.storage = a !== null ? a : void 0);
@@ -14001,18 +14012,19 @@ class cl {
14001
14012
  });
14002
14013
  }
14003
14014
  } else {
14015
+ console.log("LOG: setting aspect if case no channel");
14004
14016
  const l = o[0];
14005
- l.value = e, l.type = i.type, a !== void 0 && (l.storage = a !== null ? a : void 0);
14017
+ l.value = e, l.type = i.type, a !== void 0 && (console.log("LOG: setting aspect if case no channel storage"), l.storage = a !== null ? a : void 0);
14006
14018
  }
14007
14019
  else
14008
- this.globalPropertyState.aspects.push({
14020
+ console.log("LOG: setting aspect else case"), this.globalPropertyState.aspects.push({
14009
14021
  name: t,
14010
14022
  value: e,
14011
14023
  type: i.type,
14012
14024
  storage: a !== null ? a : void 0,
14013
14025
  channel: n
14014
14026
  });
14015
- await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(s, this.globalPropertyState);
14027
+ await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(s, this.globalPropertyState), console.log("LOG: setting aspect end");
14016
14028
  }
14017
14029
  async setAspectStorage(t, e, a) {
14018
14030
  if (!this.globalPropertyState)
@@ -14047,7 +14059,7 @@ class cl {
14047
14059
  throw new Error("Global property state not initialized");
14048
14060
  console.log(`LOG: setting state ${this.globalPropertyState.id} with ${this.globalPropertyState.aspects.length} aspects`), console.trace();
14049
14061
  const t = await B.getShadowGraphqlClient().mutate({
14050
- mutation: Ls,
14062
+ mutation: Us,
14051
14063
  variables: {
14052
14064
  id: this.globalPropertyState.id,
14053
14065
  aspects: this.globalPropertyState.aspects.map((n) => {
@@ -14091,7 +14103,7 @@ class cl {
14091
14103
  async createGlobalPropertyState() {
14092
14104
  var e, a;
14093
14105
  const t = await B.getShadowGraphqlClient().mutate({
14094
- mutation: Us,
14106
+ mutation: Ls,
14095
14107
  variables: {
14096
14108
  bundleId: this.bundleId
14097
14109
  },
@@ -14271,7 +14283,7 @@ class ul {
14271
14283
  }
14272
14284
  }
14273
14285
  const hl = new ul();
14274
- var ml = /* @__PURE__ */ ((r) => (r.Default = "Default", r.Name = "Name", r.Price = "Price", r))(ml || {});
14286
+ var gl = /* @__PURE__ */ ((r) => (r.Default = "Default", r.Name = "Name", r.Price = "Price", r))(gl || {});
14275
14287
  class er {
14276
14288
  constructor(t) {
14277
14289
  this.fullFetched = !1, this.collection = t;
@@ -14403,13 +14415,13 @@ class er {
14403
14415
  let A = !1;
14404
14416
  const u = c.subscribe({
14405
14417
  next(h) {
14406
- var g, p, f, C, w, S;
14407
- if (A || h.partial && (!h.data.productCollections || h.data.productCollections.length === 0 || !((g = h.data.productCollections[0].productCollectionProductsFeed) != null && g.items) || ((p = h.data.productCollections[0].productCollectionProductsFeed) == null ? void 0 : p.items.length) === 0))
14418
+ var m, p, f, C, w, S;
14419
+ if (A || h.partial && (!h.data.productCollections || h.data.productCollections.length === 0 || !((m = h.data.productCollections[0].productCollectionProductsFeed) != null && m.items) || ((p = h.data.productCollections[0].productCollectionProductsFeed) == null ? void 0 : p.items.length) === 0))
14408
14420
  return;
14409
14421
  o.abort(), A = !0, u.unsubscribe();
14410
- const m = ((C = (f = h.data.productCollections) == null ? void 0 : f[0].productCollectionProductsFeed) == null ? void 0 : C.items.filter((y) => !!y.product).map((y) => new de(St(y)))) || [];
14422
+ const g = ((C = (f = h.data.productCollections) == null ? void 0 : f[0].productCollectionProductsFeed) == null ? void 0 : C.items.filter((y) => !!y.product).map((y) => new de(St(y)))) || [];
14411
14423
  d({
14412
- items: m,
14424
+ items: g,
14413
14425
  // Clone items because it could be cached data (immutable)
14414
14426
  total: ((S = (w = h.data.productCollections) == null ? void 0 : w[0].productCollectionProductsFeed) == null ? void 0 : S.total) ?? 0
14415
14427
  });
@@ -14422,7 +14434,7 @@ class er {
14422
14434
  }
14423
14435
  getTransformCollection() {
14424
14436
  if (this.collection.transformCollection)
14425
- return new gl(this.collection.transformCollection);
14437
+ return new ml(this.collection.transformCollection);
14426
14438
  }
14427
14439
  /**
14428
14440
  * The raw collection resource. This is generally not needed and should be avoided.
@@ -14591,7 +14603,7 @@ class jt {
14591
14603
  return this.workflow.imageUrl;
14592
14604
  }
14593
14605
  }
14594
- class gl {
14606
+ class ml {
14595
14607
  constructor(t) {
14596
14608
  this.collection = t;
14597
14609
  }
@@ -14852,6 +14864,10 @@ class Je {
14852
14864
  async applyGlobalPropertyState(t) {
14853
14865
  var a;
14854
14866
  const e = await this.globalPropertyHandleService.getHandles();
14867
+ for (const n of t.aspects) {
14868
+ const i = n == null ? void 0 : n.name;
14869
+ this.getGlobalPropertyStateManager().setAspect(i, n.value), console.log(`LOG: setting aspect ${i} to ${n.value}`);
14870
+ }
14855
14871
  for (const n of t.aspects) {
14856
14872
  const i = n == null ? void 0 : n.name, s = e.find((o) => o.getName() === i);
14857
14873
  if (s)
@@ -14917,9 +14933,9 @@ class Je {
14917
14933
  this.getWorkflowExperiences(),
14918
14934
  this.globalConfigurationPropertyId || "",
14919
14935
  l
14920
- ), m = [...new Set(A.map((p) => p.number))];
14921
- if (m.length > h)
14922
- for (const p of m) {
14936
+ ), g = [...new Set(A.map((p) => p.number))];
14937
+ if (g.length > h)
14938
+ for (const p of g) {
14923
14939
  const f = this.getGlobalPropertyStateManager(), C = u.find((w) => w.channelNumber === p);
14924
14940
  C && await f.setAspect(l, C.variant.id || "", void 0, C.channelNumber);
14925
14941
  }
@@ -15444,14 +15460,14 @@ class El {
15444
15460
  mutation: vl,
15445
15461
  variables: {
15446
15462
  processFlowId: t,
15447
- inputs: [...e.map((m) => m.getValueForTransmission())]
15463
+ inputs: [...e.map((g) => g.getValueForTransmission())]
15448
15464
  }
15449
15465
  })).data) == null ? void 0 : A.processExecutionCreate) == null ? void 0 : u.id;
15450
15466
  if (!i)
15451
15467
  throw new Error("Failed to create process execution.");
15452
- function s(m) {
15453
- return new Promise((g) => {
15454
- setTimeout(g, m);
15468
+ function s(g) {
15469
+ return new Promise((m) => {
15470
+ setTimeout(m, g);
15455
15471
  });
15456
15472
  }
15457
15473
  let o = !1, l = 0, c, d;
@@ -15475,20 +15491,20 @@ class El {
15475
15491
  ids: [i]
15476
15492
  }
15477
15493
  });
15478
- const m = (h = c.data) == null ? void 0 : h.processExecutions[0];
15479
- if (!c || !m)
15494
+ const g = (h = c.data) == null ? void 0 : h.processExecutions[0];
15495
+ if (!c || !g)
15480
15496
  throw new Error("Failed to retrieve server response for execution.");
15481
- if (m.failedAt)
15497
+ if (g.failedAt)
15482
15498
  throw new Error(
15483
15499
  "Execution has failed to complete. See Automation > FLows in Flight on partner account on SpiffCommerce Hub."
15484
15500
  );
15485
- if (m.completedAt) {
15486
- o = !0, d = new bl(m);
15501
+ if (g.completedAt) {
15502
+ o = !0, d = new bl(g);
15487
15503
  break;
15488
15504
  }
15489
15505
  l += 1;
15490
- const g = a != null && a.repeats ? a == null ? void 0 : a.repeats : 5;
15491
- if (l >= g)
15506
+ const m = a != null && a.repeats ? a == null ? void 0 : a.repeats : 5;
15507
+ if (l >= m)
15492
15508
  throw new Error("Maximum wait time exceeded for execution result.");
15493
15509
  await s(a != null && a.sleepTime ? Math.max(a.sleepTime, 500) : 2e3);
15494
15510
  }
@@ -15835,7 +15851,7 @@ class Fl {
15835
15851
  ));
15836
15852
  }
15837
15853
  }
15838
- const Lt = new Fl();
15854
+ const Ut = new Fl();
15839
15855
  class kl {
15840
15856
  /**
15841
15857
  * Returns a formatted string representing a given amount with desired currency.
@@ -15930,8 +15946,8 @@ const Tl = async (r, t) => {
15930
15946
  return a.forEach((i) => {
15931
15947
  i.steps.forEach((s) => {
15932
15948
  var o, l, c;
15933
- delete s.data.__typename, (o = s.option) != null && o.id && ((l = s.option.defaultVariant) != null && l.asset && U.cacheAsset(s.option.defaultVariant.asset), s.option.colorProfile && U.cacheAsset(s.option.colorProfile), (c = s.option.variants) == null || c.forEach((d) => {
15934
- d.asset && U.cacheAsset(d.asset), d.thumbnail && U.cacheAsset(d.thumbnail), d.material && U.cacheMaterial(d.material);
15949
+ delete s.data.__typename, (o = s.option) != null && o.id && ((l = s.option.defaultVariant) != null && l.asset && L.cacheAsset(s.option.defaultVariant.asset), s.option.colorProfile && L.cacheAsset(s.option.colorProfile), (c = s.option.variants) == null || c.forEach((d) => {
15950
+ d.asset && L.cacheAsset(d.asset), d.thumbnail && L.cacheAsset(d.thumbnail), d.material && L.cacheMaterial(d.material);
15935
15951
  }), Jt.set({ id: s.option.id }, Promise.resolve(s.option)));
15936
15952
  }), i.finalizeStepConfig || (i.finalizeStepConfig = {}), i.finalizeStepConfig.termsMarkdown = i.finalizeStepConfig.termsMarkdown || i.partner.termsMarkdown;
15937
15953
  }), a;
@@ -15977,26 +15993,26 @@ class Ad {
15977
15993
  } catch (a) {
15978
15994
  throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
15979
15995
  }
15980
- }, this.options = t, this.options.applicationKey && Ur(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 27.3.0-beta.6be7f001-355c-5c90-9a12-0f7223284f2f"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15996
+ }, this.options = t, this.options.applicationKey && Lr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 27.3.0-beta.525d3b80-811f-54ad-924f-79a50e9b6e91"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15981
15997
  }
15982
15998
  configure(t) {
15983
- 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 && Vr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
15999
+ gt.setHubUrl(t.hubUrl), gt.setServerUrl(t.serverUrl), gt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && Vr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Ut.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
15984
16000
  }
15985
16001
  /**
15986
16002
  * @returns The asset manager allows for common operations related to assets
15987
16003
  * and the Spiff Commerce platform.
15988
16004
  */
15989
16005
  getAssetManager() {
15990
- return U;
16006
+ return L;
15991
16007
  }
15992
16008
  getFlowService() {
15993
- if (!Lr())
16009
+ if (!Ur())
15994
16010
  throw new Error("Application key required to use Flow Service.");
15995
16011
  return new El();
15996
16012
  }
15997
16013
  async getCurrencyContext(t) {
15998
16014
  const a = (await this.getIntegration()).partner.currencyCode, i = await B.getShadowGraphqlClient().query({
15999
- query: zi,
16015
+ query: Gi,
16000
16016
  errorPolicy: "all",
16001
16017
  fetchPolicy: "cache-first",
16002
16018
  variables: {
@@ -16062,7 +16078,7 @@ class Ad {
16062
16078
  * @throws An error if the transaction is not found.
16063
16079
  */
16064
16080
  async authenticateTransactionFromLocalStorage(t) {
16065
- var d, A, u, h, m, g;
16081
+ var d, A, u, h, g, m;
16066
16082
  const e = B.getShadowGraphqlClient(), a = await e.query({
16067
16083
  query: Qi,
16068
16084
  errorPolicy: "all",
@@ -16088,7 +16104,7 @@ class Ad {
16088
16104
  var S, y;
16089
16105
  return (y = (S = w.bundle) == null ? void 0 : S.transactions) == null ? void 0 : y.some((E) => E.id === t);
16090
16106
  }
16091
- )) || ((g = (m = this.customer) == null ? void 0 : m.stakeholders) == null ? void 0 : g.find(
16107
+ )) || ((m = (g = this.customer) == null ? void 0 : g.stakeholders) == null ? void 0 : m.find(
16092
16108
  (w) => {
16093
16109
  var S;
16094
16110
  return ((S = w.transaction) == null ? void 0 : S.id) === t;
@@ -16194,7 +16210,7 @@ class Ad {
16194
16210
  return !1;
16195
16211
  const n = JSON.parse(e), i = (/* @__PURE__ */ new Date()).getTime() / 1e3;
16196
16212
  if (!n.ExpiresIn || n.ExpiresIn < i - parseInt(t)) {
16197
- const l = await Lt.refreshTokens();
16213
+ const l = await Ut.refreshTokens();
16198
16214
  if (l != null && l.AuthenticationResult)
16199
16215
  localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), n.AccessToken = l.AuthenticationResult.AccessToken, localStorage.setItem("cognito-tokens", JSON.stringify(n));
16200
16216
  else
@@ -16219,14 +16235,14 @@ class Ad {
16219
16235
  variables: {
16220
16236
  emailAddress: t
16221
16237
  }
16222
- }), await Lt.generateCode(t);
16238
+ }), await Ut.generateCode(t);
16223
16239
  }
16224
16240
  /**
16225
16241
  * Verify an email code to log in as a Spiff user.
16226
16242
  * Always returns true if it doesn't throw.
16227
16243
  */
16228
16244
  async verifyCode(t, e) {
16229
- const a = (await this.getIntegration()).partner.id || "", n = await Lt.verifyCode(t, e, a);
16245
+ const a = (await this.getIntegration()).partner.id || "", n = await Ut.verifyCode(t, e, a);
16230
16246
  if (n != null && n.AuthenticationResult) {
16231
16247
  localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), localStorage.setItem("cognito-tokens", JSON.stringify(n.AuthenticationResult)), localStorage.setItem("cognito-email", t);
16232
16248
  const s = (await B.getShadowGraphqlClient().query({
@@ -16256,7 +16272,7 @@ class Ad {
16256
16272
  throw new Error("No token data in storage.");
16257
16273
  const a = JSON.parse(e), n = (/* @__PURE__ */ new Date()).getTime() / 1e3, i = !(a != null && a.AccessToken) || Wt(a.AccessToken);
16258
16274
  if (!a.ExpiresIn || a.ExpiresIn < n - parseInt(t) || i) {
16259
- const s = await Lt.refreshTokens();
16275
+ const s = await Ut.refreshTokens();
16260
16276
  if (s != null && s.AuthenticationResult)
16261
16277
  localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), a.AccessToken = s.AuthenticationResult.AccessToken, localStorage.setItem("cognito-tokens", JSON.stringify(a));
16262
16278
  else
@@ -16287,7 +16303,7 @@ class Ad {
16287
16303
  mutation: Ys(((d = (c = a == null ? void 0 : a.graphql) == null ? void 0 : c.productCollection) == null ? void 0 : d.eagerFetchProducts) || !1),
16288
16304
  variables: {
16289
16305
  collectionId: t,
16290
- initialMetadata: e ? Object.entries(e).map((m, g) => ({ key: m[0], value: m[1] })) : void 0,
16306
+ initialMetadata: e ? Object.entries(e).map((g, m) => ({ key: g[0], value: g[1] })) : void 0,
16291
16307
  marketplaceThemeInstallId: this.marketplaceThemeInstallId,
16292
16308
  marketplaceThemeInstallConfigurationId: this.marketplaceThemeInstallConfigurationId
16293
16309
  },
@@ -16313,21 +16329,21 @@ class Ad {
16313
16329
  * @returns A bundle to be used for grouping and operating on large amounts of workflow experiences.
16314
16330
  */
16315
16331
  async getExistingBundle(t, e, a, n) {
16316
- var h, m, g, p, f, C, w, S, y, E, b;
16332
+ var h, g, m, p, f, C, w, S, y, E, b;
16317
16333
  const i = N.getMap("bundleOwnerIds"), s = i == null ? void 0 : i.get(t), o = {};
16318
16334
  try {
16319
16335
  const I = await this.loggedInBearerToken();
16320
16336
  o.Authorization = `Bearer ${I}`;
16321
16337
  } catch {
16322
- const x = ((h = Object.entries(localStorage).find(([T, nt]) => T.startsWith("CognitoIdentityServiceProvider") && T.endsWith("idToken"))) == null ? void 0 : h[0]) || "", k = localStorage.getItem(x);
16323
- k && !Wt(k) && (o.Authorization = `Bearer ${k}`);
16338
+ const x = ((h = Object.entries(localStorage).find(([T, nt]) => T.startsWith("CognitoIdentityServiceProvider") && T.endsWith("idToken"))) == null ? void 0 : h[0]) || "", F = localStorage.getItem(x);
16339
+ F && !Wt(F) && (o.Authorization = `Bearer ${F}`);
16324
16340
  }
16325
16341
  const l = {
16326
16342
  bundleOwnerId: s,
16327
16343
  ...o,
16328
- ...(m = n == null ? void 0 : n.graphql) == null ? void 0 : m.additionalHeaders
16344
+ ...(g = n == null ? void 0 : n.graphql) == null ? void 0 : g.additionalHeaders
16329
16345
  }, c = await B.getShadowGraphqlClient().query({
16330
- query: Gs(((p = (g = n == null ? void 0 : n.graphql) == null ? void 0 : g.productCollection) == null ? void 0 : p.eagerFetchProducts) || !1),
16346
+ query: zs(((p = (m = n == null ? void 0 : n.graphql) == null ? void 0 : m.productCollection) == null ? void 0 : p.eagerFetchProducts) || !1),
16331
16347
  variables: {
16332
16348
  id: t
16333
16349
  },
@@ -16355,7 +16371,7 @@ class Ad {
16355
16371
  * @returns A bundle to be used for grouping and operating on large amounts of workflow experiences.
16356
16372
  */
16357
16373
  async duplicateBundle(t, e, a, n) {
16358
- var u, h, m, g, p, f;
16374
+ var u, h, g, m, p, f;
16359
16375
  const i = (u = N.getMap("bundleOwnerIds")) == null ? void 0 : u.get(t), s = {};
16360
16376
  try {
16361
16377
  const C = await this.loggedInBearerToken();
@@ -16367,9 +16383,9 @@ class Ad {
16367
16383
  const o = {
16368
16384
  bundleOwnerId: i,
16369
16385
  ...s,
16370
- ...(m = n == null ? void 0 : n.graphql) == null ? void 0 : m.additionalHeaders
16386
+ ...(g = n == null ? void 0 : n.graphql) == null ? void 0 : g.additionalHeaders
16371
16387
  }, c = (f = (await B.getShadowGraphqlClient().mutate({
16372
- mutation: Js(((p = (g = n == null ? void 0 : n.graphql) == null ? void 0 : g.productCollection) == null ? void 0 : p.eagerFetchProducts) || !1),
16388
+ mutation: Js(((p = (m = n == null ? void 0 : n.graphql) == null ? void 0 : m.productCollection) == null ? void 0 : p.eagerFetchProducts) || !1),
16373
16389
  variables: {
16374
16390
  id: t,
16375
16391
  template: e,
@@ -16462,10 +16478,10 @@ class Ad {
16462
16478
  * @returns An array of workflow experiences configured as requested.
16463
16479
  */
16464
16480
  async getWorkflowExperiences(t, e) {
16465
- if (t.length === 0)
16481
+ if (console.log("LOG: start of getWorkflowExperiences"), t.length === 0)
16466
16482
  throw new ut("No options provided!");
16467
16483
  const a = B.getShadowGraphqlClient(), n = async (y) => {
16468
- var D, x, k;
16484
+ var D, x, F;
16469
16485
  if (y.length === 0)
16470
16486
  return [];
16471
16487
  const E = y.map((T) => T.option.transactionId), b = await a.query({
@@ -16480,7 +16496,7 @@ class Ad {
16480
16496
  const T = ((x = (D = b.errors) == null ? void 0 : D[0]) == null ? void 0 : x.message) || "Unknown error";
16481
16497
  throw new ut(`Not all transactions were found: ${T}`);
16482
16498
  }
16483
- return !this.activeIntegration && ((k = I[0].integrationProduct) != null && k.integration) && (this.activeIntegration = Promise.resolve(I[0].integrationProduct.integration)), I.map((T, nt) => {
16499
+ return !this.activeIntegration && ((F = I[0].integrationProduct) != null && F.integration) && (this.activeIntegration = Promise.resolve(I[0].integrationProduct.integration)), I.map((T, nt) => {
16484
16500
  var R;
16485
16501
  return {
16486
16502
  transaction: T,
@@ -16496,12 +16512,12 @@ class Ad {
16496
16512
  const E = await a.mutate({
16497
16513
  mutation: yi,
16498
16514
  variables: {
16499
- inputs: y.map((k) => ({
16500
- integrationProductId: k.option.type === "integration" ? k.option.integrationProductId : void 0,
16501
- externalIntegrationId: k.option.type === "external" ? k.option.externalIntegrationId : void 0,
16502
- externalProductId: k.option.type === "external" ? k.option.externalProductId : void 0,
16503
- workflowId: k.option.workflowId,
16504
- designName: k.option.designName,
16515
+ inputs: y.map((F) => ({
16516
+ integrationProductId: F.option.type === "integration" ? F.option.integrationProductId : void 0,
16517
+ externalIntegrationId: F.option.type === "external" ? F.option.externalIntegrationId : void 0,
16518
+ externalProductId: F.option.type === "external" ? F.option.externalProductId : void 0,
16519
+ workflowId: F.option.workflowId,
16520
+ designName: F.option.designName,
16505
16521
  claim: !0
16506
16522
  })),
16507
16523
  marketplaceThemeInstallId: this.marketplaceThemeInstallId,
@@ -16511,12 +16527,12 @@ class Ad {
16511
16527
  fetchPolicy: "no-cache"
16512
16528
  }), b = (I = E.data) == null ? void 0 : I.transactionCreateMany;
16513
16529
  if (!b || b.length === 0) {
16514
- const k = ((x = (D = E.errors) == null ? void 0 : D[0]) == null ? void 0 : x.message) || "Unknown error";
16515
- throw new ut(`Failed to create transactions: ${k}`);
16530
+ const F = ((x = (D = E.errors) == null ? void 0 : D[0]) == null ? void 0 : x.message) || "Unknown error";
16531
+ throw new ut(`Failed to create transactions: ${F}`);
16516
16532
  }
16517
- return b.map((k, T) => ({
16518
- transaction: k,
16519
- workflowId: k.workflowId,
16533
+ return b.map((F, T) => ({
16534
+ transaction: F,
16535
+ workflowId: F.workflowId,
16520
16536
  readOnly: !1,
16521
16537
  index: y[T].index
16522
16538
  }));
@@ -16525,20 +16541,21 @@ class Ad {
16525
16541
  ), c = Fa(o, 10), d = Fa(l, 10), A = (await Promise.all([
16526
16542
  ...c.map(n),
16527
16543
  ...d.map(i)
16528
- ])).flat(), u = [...new Set(A.map((y) => y.workflowId))], h = await nr(u, e), m = new Map(h.map((y) => [y.id, y])), g = N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), p = A.map(async (y) => {
16544
+ ])).flat(), u = [...new Set(A.map((y) => y.workflowId))], h = await nr(u, e), g = new Map(h.map((y) => [y.id, y])), m = N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), p = A.map(async (y) => {
16529
16545
  var tt;
16530
- const { transaction: E, workflowId: b, readOnly: I, index: D } = y, x = m.get(b), k = t[D];
16531
- !g.get(E.id) && E.transactionOwnerId && g.set(E.id, E.transactionOwnerId);
16532
- const T = g.get(E.id) || void 0, nt = new xl({
16546
+ console.log("mapping transaction result");
16547
+ const { transaction: E, workflowId: b, readOnly: I, index: D } = y, x = g.get(b), F = t[D];
16548
+ !m.get(E.id) && E.transactionOwnerId && m.set(E.id, E.transactionOwnerId);
16549
+ const T = m.get(E.id) || void 0, nt = new xl({
16533
16550
  onMutate: () => ({ context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId } }),
16534
16551
  onQuery: () => ({ context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId } })
16535
16552
  }), R = {
16536
16553
  product: E.product,
16537
16554
  transaction: E,
16538
16555
  layouts: [],
16539
- singleVariantsRenderable: (tt = k == null ? void 0 : k.workflowConfiguration) == null ? void 0 : tt.singleVariantsRenderable,
16556
+ singleVariantsRenderable: (tt = F == null ? void 0 : F.workflowConfiguration) == null ? void 0 : tt.singleVariantsRenderable,
16540
16557
  stateMutationFunc: I ? async () => {
16541
- throw new z("State mutation is forbidden in read only mode!");
16558
+ throw new G("State mutation is forbidden in read only mode!");
16542
16559
  } : async (q) => this.updateTransactionState({
16543
16560
  ...q,
16544
16561
  context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId }
@@ -16546,14 +16563,16 @@ class Ad {
16546
16563
  graphQlClient: () => nt,
16547
16564
  readOnly: I,
16548
16565
  workflow: x,
16549
- isReloadedTransaction: k.type === "transaction"
16566
+ isReloadedTransaction: F.type === "transaction"
16550
16567
  };
16551
- if (k.type === "transaction" && E.workflowState) {
16568
+ if (F.type === "transaction" && E.workflowState) {
16569
+ console.log(`LOG: reloading transaction with state ${F.workflowState}`);
16552
16570
  const q = JSON.parse(E.workflowState);
16553
- R.layouts = Object.values(q.layouts || {}).map((ft) => ft.layout), await Ga(q), R.reloadedState = q;
16554
- } else if (!I && k.workflowState) {
16555
- const q = JSON.parse(k.workflowState);
16556
- R.layouts = Object.values(q.layouts || {}).map((ft) => ft.layout), await Ga(q), R.reloadedState = q;
16571
+ R.layouts = Object.values(q.layouts || {}).map((ft) => ft.layout), await za(q), R.reloadedState = q;
16572
+ } else if (!I && F.workflowState) {
16573
+ console.log(`LOG: reloading with state ${F.workflowState}`);
16574
+ const q = JSON.parse(F.workflowState);
16575
+ R.layouts = Object.values(q.layouts || {}).map((ft) => ft.layout), await za(q), R.reloadedState = q;
16557
16576
  } else
16558
16577
  R.layouts = Rl(
16559
16578
  R.transaction,
@@ -16561,14 +16580,14 @@ class Ad {
16561
16580
  );
16562
16581
  return R.renderableContextService = new Zo(
16563
16582
  R.layouts
16564
- ), R.delayWorkflowStateSync = !0, { experienceOptions: R, index: D, options: k };
16583
+ ), R.delayWorkflowStateSync = !0, console.log("mapping transaction result end"), { experienceOptions: R, index: D, options: F };
16565
16584
  }), f = await Promise.all(p);
16566
- N.setMap("transactionOwnerIds", g);
16585
+ N.setMap("transactionOwnerIds", m);
16567
16586
  const w = f.sort((y, E) => y.index - E.index).map(async (y) => {
16568
16587
  const { experienceOptions: E, options: b } = y, I = new Vo(this, E);
16569
16588
  return await I.getWorkflowManager().getInitializationPromise(), b.type !== "transaction" && this.customer && await I.attachCustomerDetails({ email: this.customer.emailAddress }), I;
16570
16589
  }), S = await Promise.all(w);
16571
- return S.forEach((y) => y.getWorkflowManager().setWorkflowStateSyncEnabled(!0)), S;
16590
+ return S.forEach((y) => y.getWorkflowManager().setWorkflowStateSyncEnabled(!0)), console.log("LOG: end of getWorkflowExperiences"), S;
16572
16591
  }
16573
16592
  storeCustomer(t) {
16574
16593
  const e = N.getMap("partnerCustomerIds") || /* @__PURE__ */ new Map();
@@ -16672,19 +16691,19 @@ const Ol = async (r, t) => (await B.getShadowGraphqlClient().query({
16672
16691
  themeInstallId: t
16673
16692
  }
16674
16693
  })).data) == null ? void 0 : a.marketplaceThemeInstallConfiguration;
16675
- }, md = async (r) => {
16694
+ }, gd = async (r) => {
16676
16695
  var e, a, n;
16677
16696
  return (n = (a = (e = (await B.getShadowGraphqlClient().query({
16678
- query: Li,
16697
+ query: Ui,
16679
16698
  errorPolicy: "all",
16680
16699
  variables: {
16681
16700
  id: r
16682
16701
  }
16683
16702
  })).data) == null ? void 0 : e.bundles) == null ? void 0 : a[0]) == null ? void 0 : n.marketplaceThemeInstallConfiguration;
16684
- }, gd = async (r) => {
16703
+ }, md = async (r) => {
16685
16704
  var e, a, n;
16686
16705
  return (n = (a = (e = (await B.getShadowGraphqlClient().query({
16687
- query: Ui,
16706
+ query: Li,
16688
16707
  errorPolicy: "all",
16689
16708
  variables: {
16690
16709
  id: r
@@ -16705,7 +16724,7 @@ function $l(r, t, e, a) {
16705
16724
  function he(r, t, e) {
16706
16725
  return Math.min(Math.max(r, t), e);
16707
16726
  }
16708
- class Ul {
16727
+ class Ll {
16709
16728
  constructor(t, e) {
16710
16729
  this.minZoomScale = [0.03], this.maxZoomScale = [20], this._debouncedUpdateFrameOffsets = dn(this.updateFrameOffsets, 200), this.targetElements = [], this.onFrameDataChangeListeners = [], this.onZoomChangeListeners = [], this.forceImageCover = t, this.initialZoom = e, this.thresholdSettings = {
16711
16730
  useThreshold: !1,
@@ -16840,7 +16859,7 @@ class Ul {
16840
16859
  if (!n || !this.frameData)
16841
16860
  return;
16842
16861
  if (this.frameData.length !== t.length)
16843
- throw new z(
16862
+ throw new G(
16844
16863
  "Frame data and offsets are not the same length. This is a bug. Please report it."
16845
16864
  );
16846
16865
  if (!this.offsets.some((s, o) => !(t[o].x === s.x && t[o].y === s.y && t[o].zoom === s.zoom)) && !a) {
@@ -16884,15 +16903,15 @@ class Ul {
16884
16903
  */
16885
16904
  updateFrameOffsets(t, e, a, n, i) {
16886
16905
  if (!a || a.length === 0 || a.some((o) => !o))
16887
- throw new z("Frame data not set. This is a bug");
16906
+ throw new G("Frame data not set. This is a bug");
16888
16907
  if (!this.workflowManager)
16889
- throw new z("No workflow manager set, cannot update offsets.");
16908
+ throw new G("No workflow manager set, cannot update offsets.");
16890
16909
  const s = this.workflowManager.getCommandDispatcher();
16891
16910
  this.targetElements.forEach((o, l) => {
16892
16911
  s(
16893
16912
  new $([
16894
16913
  new hs(o, e, t[l]),
16895
- new ms(
16914
+ new gs(
16896
16915
  o,
16897
16916
  n.useThreshold,
16898
16917
  n.invertThreshold,
@@ -17089,12 +17108,12 @@ class pd {
17089
17108
  return [];
17090
17109
  }
17091
17110
  }
17092
- var Ll = /* @__PURE__ */ ((r) => (r.SelectFrame = "SelectFrame", r.SelectImage = "SelectImage", r.Position = "Position", r))(Ll || {});
17111
+ var Ul = /* @__PURE__ */ ((r) => (r.SelectFrame = "SelectFrame", r.SelectImage = "SelectImage", r.Position = "Position", r))(Ul || {});
17093
17112
  class Vl extends it {
17094
17113
  constructor(t, e, a) {
17095
17114
  super(t, e, a);
17096
17115
  const n = e.data;
17097
- this.frameService = new Ul(n.forceImageCover, n.initialZoomLevel), this.frameService.connectWorkflowManager(t, e.stepName);
17116
+ this.frameService = new Ll(n.forceImageCover, n.initialZoomLevel), this.frameService.connectWorkflowManager(t, e.stepName);
17098
17117
  }
17099
17118
  selectVariant(t) {
17100
17119
  const e = this.manager.getRegionElements(this.step.stepName);
@@ -17158,7 +17177,7 @@ class Vl extends it {
17158
17177
  const e = await this.getOriginalImageSelection();
17159
17178
  if (!e)
17160
17179
  throw new Error("You must supply an image selection before attempting to remove the background.");
17161
- const a = await U.removeBackgroundFromAsset(e);
17180
+ const a = await L.removeBackgroundFromAsset(e);
17162
17181
  t && await wt.selectImage(this.step, a, this.manager, !1);
17163
17182
  const n = ((i = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : i.framePatternData) || {};
17164
17183
  return this.manager.updateStorage(this.step.stepName, {
@@ -17217,13 +17236,13 @@ class Vl extends it {
17217
17236
  var e, a;
17218
17237
  const t = (a = (e = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : e.framePatternData) == null ? void 0 : a.originalAssetKey;
17219
17238
  if (t)
17220
- return U.getLocalOrFromServer(t);
17239
+ return L.getLocalOrFromServer(t);
17221
17240
  }
17222
17241
  async getBackgroundRemovedImageSelection() {
17223
17242
  var e, a;
17224
17243
  const t = (a = (e = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : e.framePatternData) == null ? void 0 : a.backgroundRemovedAssetKey;
17225
17244
  if (t)
17226
- return U.getLocalOrFromServer(t);
17245
+ return L.getLocalOrFromServer(t);
17227
17246
  }
17228
17247
  hasOriginalImageSelection() {
17229
17248
  var t, e;
@@ -17263,7 +17282,7 @@ class Vl extends it {
17263
17282
  return this.manager.getStepStorage(this.step.stepName);
17264
17283
  }
17265
17284
  }
17266
- const zl = v`
17285
+ const Gl = v`
17267
17286
  query GetLoggedInCustomer($email: String!) {
17268
17287
  customer(emailAddress: $email) {
17269
17288
  id
@@ -17306,7 +17325,7 @@ const zl = v`
17306
17325
  total
17307
17326
  }
17308
17327
  }
17309
- `, Gl = v`
17328
+ `, zl = v`
17310
17329
  mutation SetTransactionDesignName($id: String!, $name: String!) {
17311
17330
  transactionUpdate(id: $id, designName: $name) {
17312
17331
  id
@@ -17392,7 +17411,7 @@ const zl = v`
17392
17411
  },
17393
17412
  context: e
17394
17413
  }), Cd = async (r, t) => await B.getShadowGraphqlClient().mutate({
17395
- mutation: Gl,
17414
+ mutation: zl,
17396
17415
  errorPolicy: "all",
17397
17416
  variables: {
17398
17417
  id: r,
@@ -17413,7 +17432,7 @@ const zl = v`
17413
17432
  template: t
17414
17433
  }
17415
17434
  }), Sd = async (r) => (await B.getShadowGraphqlClient().query({
17416
- query: zl,
17435
+ query: Gl,
17417
17436
  errorPolicy: "all",
17418
17437
  variables: {
17419
17438
  email: r
@@ -17743,7 +17762,7 @@ export {
17743
17762
  ls as CommandContext,
17744
17763
  _l as ConversionDataType,
17745
17764
  Kl as ConversionLocation,
17746
- G as CreateElementCommand,
17765
+ z as CreateElementCommand,
17747
17766
  Vn as CreateLayoutCommand,
17748
17767
  Ml as CurrencyContext,
17749
17768
  kl as CurrencyService,
@@ -17757,8 +17776,8 @@ export {
17757
17776
  ds as FontColorCommand,
17758
17777
  As as FontSizeCommand,
17759
17778
  ja as FontSourceCommand,
17760
- Ul as FrameService,
17761
- Ll as FrameStep,
17779
+ Ll as FrameService,
17780
+ Ul as FrameStep,
17762
17781
  Vl as FrameStepHandle,
17763
17782
  Ia as GlobalPropertyHandle,
17764
17783
  $ as GroupCommand,
@@ -17785,7 +17804,7 @@ export {
17785
17804
  vo as PictureStepHandle,
17786
17805
  Ir as ProductCameraRig,
17787
17806
  er as ProductCollection,
17788
- ml as ProductCollectionProductSortKey,
17807
+ gl as ProductCollectionProductSortKey,
17789
17808
  jt as ProductWorkflow,
17790
17809
  Jt as PromiseCache,
17791
17810
  kn as PromiseQueue,
@@ -17804,19 +17823,19 @@ export {
17804
17823
  it as StepHandle,
17805
17824
  P as StepType,
17806
17825
  Mt as TextAlgorithm,
17807
- gs as TextChangeCommand,
17826
+ ms as TextChangeCommand,
17808
17827
  sl as TextGlobalPropertyHandle,
17809
17828
  ld as TextInput,
17810
17829
  Bo as TextStepHandle,
17811
17830
  pl as Transform,
17812
- gl as TransformCollection,
17813
- z as UnhandledBehaviorError,
17831
+ ml as TransformCollection,
17832
+ G as UnhandledBehaviorError,
17814
17833
  Pr as UnitOfMeasurement,
17815
17834
  Zc as UpdateImageSourceCommand,
17816
17835
  st as Variant,
17817
- Lo as WorkflowExperienceEventType,
17836
+ Uo as WorkflowExperienceEventType,
17818
17837
  Vo as WorkflowExperienceImpl,
17819
- U as assetService,
17838
+ L as assetService,
17820
17839
  Zr as browserColorToHex,
17821
17840
  Hc as cmPerPixel,
17822
17841
  No as createDesign,
@@ -17824,13 +17843,13 @@ export {
17824
17843
  Mc as dataUrlFromExternalUrl,
17825
17844
  Ye as designService,
17826
17845
  pe as determineCorrectFontSizeAndLines,
17827
- Gn as digitalContentStepService,
17846
+ zn as digitalContentStepService,
17828
17847
  dt as domParser,
17829
17848
  wd as duplicateBundle,
17830
17849
  yd as duplicateTransaction,
17831
17850
  at as fetchAsString,
17832
17851
  Oc as findAngle,
17833
- L as findElement,
17852
+ U as findElement,
17834
17853
  Qc as findPmsColors,
17835
17854
  Vt as frameDataCache,
17836
17855
  wt as frameStepService,
@@ -17842,33 +17861,33 @@ export {
17842
17861
  Me as getAttributesFromArrayBuffer,
17843
17862
  Rc as getAxisAlignedBoundingBox,
17844
17863
  $l as getBoundedOffsets,
17845
- md as getBundleThemeConfiguration,
17864
+ gd as getBundleThemeConfiguration,
17846
17865
  Sd as getCustomer,
17847
17866
  vd as getCustomerBundles,
17848
17867
  jc as getElementVertices,
17849
17868
  Qe as getFrameData,
17850
17869
  rd as getGlobalPropertyStateForBundle,
17851
17870
  Ol as getIntegration,
17852
- zc as getNEPoint,
17871
+ Gc as getNEPoint,
17853
17872
  Vc as getNWPoint,
17854
17873
  Bd as getOrderedTransactions,
17855
17874
  hd as getOverrideThemeConfiguration,
17856
- Lc as getPointOfRotation,
17875
+ Uc as getPointOfRotation,
17857
17876
  od as getProductCollections,
17858
- Gc as getSEPoint,
17877
+ zc as getSEPoint,
17859
17878
  Sa as getSvgElement,
17860
17879
  Pd as getTemplateBundles,
17861
17880
  Id as getTemplateTransactions,
17862
17881
  ud as getTransaction,
17863
- gd as getTransactionThemeConfiguration,
17882
+ md as getTransactionThemeConfiguration,
17864
17883
  Ed as getTransactionsForBundle,
17865
- Uc as getTrueCoordinates,
17884
+ Lc as getTrueCoordinates,
17866
17885
  bd as getUnorderedTransactions,
17867
17886
  Dd as getValidationJobsForWorkflowExperiences,
17868
17887
  dd as getWorkflow,
17869
17888
  nr as getWorkflows,
17870
17889
  B as graphQlManager,
17871
- ge as illustrationStepService,
17890
+ me as illustrationStepService,
17872
17891
  $c as isCloseToValue,
17873
17892
  Nt as loadFont,
17874
17893
  Nc as matchHexToPms,
@@ -17889,18 +17908,18 @@ export {
17889
17908
  Yn as questionStepService,
17890
17909
  kc as registerFetchImplementation,
17891
17910
  Fc as registerWindowImplementation,
17892
- Ga as rehydrateSerializedLayout,
17911
+ za as rehydrateSerializedLayout,
17893
17912
  Kr as rgbToPms,
17894
17913
  le as rotateAroundPoint,
17895
17914
  pa as sanitizeSvgTree,
17896
17915
  Vr as setBearerAuthenticationToken,
17897
17916
  fn as setCanvasModule,
17898
- zt as shapeStepService,
17917
+ Gt as shapeStepService,
17899
17918
  fs as shortenUrl,
17900
- mt as spiffCoreConfiguration,
17919
+ gt as spiffCoreConfiguration,
17901
17920
  id as stepAspectValuesToDesignInputSteps,
17902
17921
  $a as svgColorValueToDefinition,
17903
- Un as svgStringDimensions,
17922
+ Ln as svgStringDimensions,
17904
17923
  ha as svgToDataUrl,
17905
17924
  W as textStepService,
17906
17925
  Ps as toast,