@spiffcommerce/core 27.2.1-beta.53daa97c-6932-5a12-a2b0-5f55ecb6f4c7 → 27.2.1-beta.79d76762-97a7-51e6-8168-080be1e15965

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
@@ -9,10 +9,10 @@ import hr from "fuse.js";
9
9
  import { Pith as Aa } from "pith";
10
10
  import St from "lodash.clonedeep";
11
11
  import { toString as sn } from "qrcode";
12
- import mr from "svg-path-bbox";
12
+ import gr from "svg-path-bbox";
13
13
  import { parse as Xe } from "opentype.js";
14
14
  import { jsx as F, jsxs as ct, Fragment as zt } from "preact/jsx-runtime";
15
- import gr from "handlebars";
15
+ import mr from "handlebars";
16
16
  import { dataUriToBuffer as pr } from "data-uri-to-buffer";
17
17
  import Fa from "lodash.chunk";
18
18
  import { CognitoIdentityProviderClient as fr, InitiateAuthCommand as ka, RespondToAuthChallengeCommand as Cr } from "@aws-sdk/client-cognito-identity-provider";
@@ -21,7 +21,7 @@ import { split as Ze } from "unicode-default-word-boundary";
21
21
  import ln from "lodash.debounce";
22
22
  import "fs";
23
23
  import "path";
24
- var Ce = /* @__PURE__ */ ((r) => (r.Data = "Data", r.Font = "Font", r.Frame = "Frame", r.Illustration = "Illustration", r.Image = "Image", r.Model = "Model", r.Material = "Material", r.Color = "Color", r.QuestionnaireCollateral = "QuestionnaireCollateral", r.RequestCollateral = "RequestCollateral", r.SignupCollateral = "SignupCollateral", r.Video = "Video", r.ColorProfile = "ColorProfile", r.Environment = "Environment", r))(Ce || {}), G = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(G || {}), P = /* @__PURE__ */ ((r) => (r.Information = "Information", r.Bulk = "Bulk", r.DigitalContent = "DigitalContent", r.Finish = "Finish", r.Frame = "Frame", r.Illustration = "Illustration", r.Introduction = "Introduction", r.Material = "Material", r.Model = "Model", r.Module = "Module", r.Picture = "Picture", r.Photo = "Photo", r.ProductOverlay = "ProductOverlay", r.Question = "Question", r.Shape = "Shape", r.SilentIllustration = "SilentIllustration", r.Text = "Text", r))(P || {}), wr = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(wr || {}), Ht = /* @__PURE__ */ ((r) => (r.ThreeD = "ThreeD", r.FreeDesign = "FreeDesign", r.Print = "Print", r))(Ht || {}), M = /* @__PURE__ */ ((r) => (r.Frame = "frame", r.Group = "group", r.Image = "image", r.Pattern = "pattern", r.Illustration = "illustration", r.Textbox = "textbox", r))(M || {}), yr = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(yr || {}), Sr = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Sr || {}), vr = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(vr || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Er = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Er || {}), we = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(we || {}), Mt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(Mt || {}), q = /* @__PURE__ */ ((r) => (r[r.North = 0] = "North", r[r.Northeast = 1] = "Northeast", r[r.East = 2] = "East", r[r.Southeast = 3] = "Southeast", r[r.South = 4] = "South", r[r.Southwest = 5] = "Southwest", r[r.West = 6] = "West", r[r.Northwest = 7] = "Northwest", r))(q || {}), Br = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Br || {});
24
+ var Ce = /* @__PURE__ */ ((r) => (r.Data = "Data", r.Font = "Font", r.Frame = "Frame", r.Illustration = "Illustration", r.Image = "Image", r.Model = "Model", r.Material = "Material", r.Color = "Color", r.QuestionnaireCollateral = "QuestionnaireCollateral", r.RequestCollateral = "RequestCollateral", r.SignupCollateral = "SignupCollateral", r.Video = "Video", r.ColorProfile = "ColorProfile", r.Environment = "Environment", r))(Ce || {}), G = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(G || {}), P = /* @__PURE__ */ ((r) => (r.Information = "Information", r.Bulk = "Bulk", r.DigitalContent = "DigitalContent", r.Finish = "Finish", r.Frame = "Frame", r.Illustration = "Illustration", r.Introduction = "Introduction", r.Material = "Material", r.Model = "Model", r.Module = "Module", r.Picture = "Picture", r.Photo = "Photo", r.ProductOverlay = "ProductOverlay", r.Question = "Question", r.Shape = "Shape", r.SilentIllustration = "SilentIllustration", r.Text = "Text", r))(P || {}), wr = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(wr || {}), qt = /* @__PURE__ */ ((r) => (r.ThreeD = "ThreeD", r.FreeDesign = "FreeDesign", r.Print = "Print", r))(qt || {}), M = /* @__PURE__ */ ((r) => (r.Frame = "frame", r.Group = "group", r.Image = "image", r.Pattern = "pattern", r.Illustration = "illustration", r.Textbox = "textbox", r))(M || {}), yr = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(yr || {}), Sr = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Sr || {}), vr = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(vr || {}), ua = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ua || {}), Er = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Er || {}), we = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(we || {}), Mt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(Mt || {}), H = /* @__PURE__ */ ((r) => (r[r.North = 0] = "North", r[r.Northeast = 1] = "Northeast", r[r.East = 2] = "East", r[r.Southeast = 3] = "Southeast", r[r.South = 4] = "South", r[r.Southwest = 5] = "Southwest", r[r.West = 6] = "West", r[r.Northwest = 7] = "Northwest", r))(H || {}), Br = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Br || {});
25
25
  class cn extends Error {
26
26
  constructor(t) {
27
27
  super(t), this.name = this.constructor.name;
@@ -47,7 +47,7 @@ class vt extends _t {
47
47
  super(`Asset not found for variant: ${t.name}`), this.variant = t;
48
48
  }
49
49
  }
50
- class qt extends _t {
50
+ class Ht extends _t {
51
51
  constructor(t) {
52
52
  super(`Resource not found for asset: ${t.name}`), this.asset = t;
53
53
  }
@@ -158,7 +158,7 @@ class Pr {
158
158
  this.serverUrlCallbacks.push(t);
159
159
  }
160
160
  }
161
- const mt = new Pr();
161
+ const gt = new Pr();
162
162
  let ta, ea;
163
163
  function Ec(r) {
164
164
  ta = r;
@@ -289,34 +289,34 @@ const dn = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @_
289
289
  !i || !i.result ? e() : t(i.result.toString());
290
290
  }, a.readAsDataURL(r);
291
291
  });
292
- let Qr, ma;
292
+ let Qr, ga;
293
293
  const Rr = (r) => {
294
- ma = r;
295
- }, Or = () => ma;
296
- let mn;
294
+ ga = r;
295
+ }, Or = () => ga;
296
+ let gn;
297
297
  const $r = (r) => {
298
- mn = r;
299
- }, Ur = () => new Promise((r) => {
300
- const t = mt.getHubUrl(), e = (a) => {
298
+ gn = r;
299
+ }, Lr = () => new Promise((r) => {
300
+ const t = gt.getHubUrl(), e = (a) => {
301
301
  a.origin === t && (window.removeEventListener("message", e), r(a.data));
302
302
  };
303
303
  window.parent !== window && (window.addEventListener("message", e, !1), window.parent.postMessage("ready", t));
304
- }), Lr = async () => {
304
+ }), Ur = async () => {
305
305
  const r = {
306
- applicationKey: ma,
306
+ applicationKey: ga,
307
307
  customerToken: Qr,
308
- bearer: mn
308
+ bearer: gn
309
309
  };
310
- return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await Ur(), ...r } : r;
310
+ return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await Lr(), ...r } : r;
311
311
  };
312
312
  async function Vr(r, t) {
313
- 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";
313
+ 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";
314
314
  let n = await rt(r, { ...t, redirect: "manual" });
315
315
  return n.type === "opaqueredirect" && (typeof r != "string" && "url" in r ? n = await rt({ ...r, url: `${a}/graphql` }, t) : n = await rt(`${a}/graphql`, t)), n;
316
316
  }
317
317
  class Gr {
318
318
  constructor() {
319
- this.shadowGraphqlClient = this.constructShadowGraphqlClient(), mt.addServerUrlCallback(() => {
319
+ this.shadowGraphqlClient = this.constructShadowGraphqlClient(), gt.addServerUrlCallback(() => {
320
320
  this.shadowGraphqlClient = this.constructShadowGraphqlClient();
321
321
  });
322
322
  }
@@ -328,17 +328,17 @@ class Gr {
328
328
  }
329
329
  constructShadowGraphqlClient() {
330
330
  const t = rr({
331
- uri: `${mt.getServerUrl()}/graphql`,
331
+ uri: `${gt.getServerUrl()}/graphql`,
332
332
  fetch: Vr
333
333
  }), e = lr(async (i, s) => {
334
- const { headers: o } = s, l = o || {}, c = await Lr();
334
+ const { headers: o } = s, l = o || {}, c = await Ur();
335
335
  let d = s.bearer ?? c.bearer;
336
336
  if (this.spiffClient)
337
337
  try {
338
338
  d = await this.spiffClient.loggedInBearerToken();
339
339
  } catch {
340
340
  }
341
- 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;
341
+ 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;
342
342
  try {
343
343
  if (window && window.__SENTRY__) {
344
344
  const f = window.__SENTRY__.hub;
@@ -351,7 +351,7 @@ class Gr {
351
351
  }
352
352
  } catch {
353
353
  }
354
- 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", {
354
+ 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", {
355
355
  headers: l
356
356
  };
357
357
  }), a = cr(({ operation: i, graphQLErrors: s, networkError: o }) => {
@@ -368,12 +368,12 @@ class Gr {
368
368
  }
369
369
  const b = new Gr();
370
370
  let aa, na;
371
- const gt = (r, t, e) => {
371
+ const mt = (r, t, e) => {
372
372
  if (aa !== void 0)
373
373
  return aa(r, t, e);
374
374
  try {
375
375
  const a = pn(!0);
376
- return gn(a), a.createCanvas(r, t, e);
376
+ return mn(a), a.createCanvas(r, t, e);
377
377
  } catch {
378
378
  throw new Error("Canvas module not set");
379
379
  }
@@ -382,12 +382,12 @@ const gt = (r, t, e) => {
382
382
  return na(r, t);
383
383
  try {
384
384
  const e = pn(!0);
385
- return gn(e), e.loadImage(r, t);
385
+ return mn(e), e.loadImage(r, t);
386
386
  } catch {
387
387
  throw new Error("Canvas module not set");
388
388
  }
389
389
  };
390
- function gn(r) {
390
+ function mn(r) {
391
391
  aa = r == null ? void 0 : r.createCanvas, na = r == null ? void 0 : r.loadImage;
392
392
  }
393
393
  function pn(r) {
@@ -411,7 +411,7 @@ function pn(r) {
411
411
  }
412
412
  }
413
413
  let $e;
414
- function ga() {
414
+ function ma() {
415
415
  return $e === void 0 && ($e = Fr()), $e;
416
416
  }
417
417
  let se = null;
@@ -427,14 +427,14 @@ const zr = (r) => new Promise((t) => {
427
427
  }, jr = (r) => {
428
428
  const e = r.naturalWidth / r.naturalHeight;
429
429
  return r.naturalHeight <= 8192 && r.naturalWidth <= 8192 ? [r.naturalWidth, r.naturalHeight] : r.naturalHeight > r.naturalWidth ? [e * 8192, 8192] : [8192, 8192 / e];
430
- }, Hr = async (r) => {
430
+ }, qr = async (r) => {
431
431
  var A;
432
432
  const t = await Tr(r), e = await Zt(t), [a, n] = jr(e);
433
433
  if (!await Wr()) {
434
- const u = gt(a, n);
434
+ const u = mt(a, n);
435
435
  return (A = u.getContext("2d")) == null || A.drawImage(e, 0, 0, a, n), u;
436
436
  }
437
- const s = await zr(r), [o, l] = s > 4 ? [n, a] : [a, n], c = gt(o, l), d = c.getContext("2d");
437
+ const s = await zr(r), [o, l] = s > 4 ? [n, a] : [a, n], c = mt(o, l), d = c.getContext("2d");
438
438
  switch (s) {
439
439
  case 2:
440
440
  d.translate(o, 0), d.scale(-1, 1);
@@ -460,7 +460,7 @@ const zr = (r) => new Promise((t) => {
460
460
  }
461
461
  return d.drawImage(e, 0, 0, o, l), c;
462
462
  }, Me = async (r) => {
463
- const t = await Hr(r);
463
+ const t = await qr(r);
464
464
  return ke(r) === "image/jpeg" ? {
465
465
  dataUrl: t.toDataURL("image/jpeg", 1),
466
466
  height: t.height,
@@ -3154,7 +3154,7 @@ const zr = (r) => new Promise((t) => {
3154
3154
  "3E2B2E",
3155
3155
  "101820",
3156
3156
  "3D3935"
3157
- ], Ue = Ft.map((r) => [
3157
+ ], Le = Ft.map((r) => [
3158
3158
  parseInt(r.substring(0, 2), 16),
3159
3159
  parseInt(r.substring(2, 4), 16),
3160
3160
  parseInt(r.substring(4, 6), 16)
@@ -3163,12 +3163,12 @@ function Ic(r) {
3163
3163
  const t = Yt.indexOf(r);
3164
3164
  return t >= 0 ? Ft[t] : "";
3165
3165
  }
3166
- function qr(r) {
3166
+ function Hr(r) {
3167
3167
  const t = Ft.indexOf(r);
3168
3168
  return t >= 0 ? Yt[t] : "";
3169
3169
  }
3170
3170
  function Pc(r, t = 64) {
3171
- const e = [], a = [], n = qr(r);
3171
+ const e = [], a = [], n = Hr(r);
3172
3172
  n && e.push({
3173
3173
  pms: n,
3174
3174
  hex: r,
@@ -3177,7 +3177,7 @@ function Pc(r, t = 64) {
3177
3177
  const i = parseInt(r.substring(0, 2), 16), s = parseInt(r.substring(2, 4), 16), o = parseInt(r.substring(4, 6), 16);
3178
3178
  let l, c, d;
3179
3179
  for (let A = 0; A < Ft.length; A++) {
3180
- l = Ue[A][0], c = Ue[A][1], d = Ue[A][2];
3180
+ l = Le[A][0], c = Le[A][1], d = Le[A][2];
3181
3181
  const u = Math.sqrt(Math.pow(i - l, 2) + Math.pow(s - c, 2) + Math.pow(o - d, 2));
3182
3182
  a.push(u);
3183
3183
  }
@@ -3275,8 +3275,8 @@ const oe = (r) => {
3275
3275
  n.split(";").forEach((d) => {
3276
3276
  const A = d.trim();
3277
3277
  if (A) {
3278
- const [u, h] = A.split(":"), m = u.toLowerCase();
3279
- Xr.indexOf(m) > -1 ? a.setAttribute(m, h.trim()) : l.push(A);
3278
+ const [u, h] = A.split(":"), g = u.toLowerCase();
3279
+ Xr.indexOf(g) > -1 ? a.setAttribute(g, h.trim()) : l.push(A);
3280
3280
  }
3281
3281
  }), l.length > 0 ? a.setAttribute("style", l.join(";")) : a.removeAttribute("style");
3282
3282
  }
@@ -3799,7 +3799,7 @@ class K {
3799
3799
  N.setMap($a, t);
3800
3800
  }
3801
3801
  }
3802
- const U = new di();
3802
+ const L = new di();
3803
3803
  class Ai {
3804
3804
  constructor() {
3805
3805
  this.cache = {}, this.disabled = !1;
@@ -3887,16 +3887,16 @@ const Jt = new Ai(), vn = v`
3887
3887
  });
3888
3888
  return t.data.options.forEach((e) => {
3889
3889
  var a, n;
3890
- (a = e.defaultVariant) != null && a.asset && U.cacheAsset(e.defaultVariant.asset), e.colorProfile && U.cacheAsset(e.colorProfile), (n = e.variants) == null || n.forEach((i) => {
3891
- i.asset && U.cacheAsset(i.asset), i.thumbnail && U.cacheAsset(i.thumbnail), i.material && U.cacheMaterial(i.material);
3890
+ (a = e.defaultVariant) != null && a.asset && L.cacheAsset(e.defaultVariant.asset), e.colorProfile && L.cacheAsset(e.colorProfile), (n = e.variants) == null || n.forEach((i) => {
3891
+ i.asset && L.cacheAsset(i.asset), i.thumbnail && L.cacheAsset(i.thumbnail), i.material && L.cacheMaterial(i.material);
3892
3892
  });
3893
3893
  }), t.data.options;
3894
- }, mi = async (r, t) => (await t).find((a) => a.id === r), gi = async (r) => {
3894
+ }, gi = async (r, t) => (await t).find((a) => a.id === r), mi = async (r) => {
3895
3895
  const t = r.map((s) => Jt.get({ id: s })), e = r.filter((s, o) => t[o] === void 0);
3896
3896
  if (e.length === 0)
3897
3897
  return Promise.all(t);
3898
3898
  const a = hi(e), n = e.map(
3899
- (s) => Jt.set({ id: s }, mi(s, a))
3899
+ (s) => Jt.set({ id: s }, gi(s, a))
3900
3900
  ), i = t.filter((s) => s !== void 0);
3901
3901
  return await Promise.all(i.concat(n));
3902
3902
  };
@@ -3914,7 +3914,7 @@ class pi {
3914
3914
  */
3915
3915
  async getOption(t) {
3916
3916
  return (async () => {
3917
- const n = (await gi([t]))[0];
3917
+ const n = (await mi([t]))[0];
3918
3918
  if (n)
3919
3919
  return n;
3920
3920
  })();
@@ -5134,7 +5134,7 @@ const Y = new pi(), En = v`
5134
5134
  internalId
5135
5135
  }
5136
5136
  }
5137
- `, Ot = [P.SilentIllustration, P.ProductOverlay], Ui = async (r) => {
5137
+ `, Ot = [P.SilentIllustration, P.ProductOverlay], Li = async (r) => {
5138
5138
  const t = [];
5139
5139
  r.introduction && t.push({
5140
5140
  name: "Introduction",
@@ -5152,7 +5152,7 @@ const Y = new pi(), En = v`
5152
5152
  silentSteps: []
5153
5153
  });
5154
5154
  for (const a of r.steps) {
5155
- const n = Li(a.stepName, r.stepGroups);
5155
+ const n = Ui(a.stepName, r.stepGroups);
5156
5156
  if (!n)
5157
5157
  t.push({
5158
5158
  name: a.stepName,
@@ -5189,7 +5189,7 @@ const Y = new pi(), En = v`
5189
5189
  ],
5190
5190
  silentSteps: []
5191
5191
  }), t;
5192
- }, Li = (r, t) => t.find((e) => e.stepNames.includes(r)), yt = (r, t) => (r.conditions || []).every((e) => {
5192
+ }, Ui = (r, t) => t.find((e) => e.stepNames.includes(r)), yt = (r, t) => (r.conditions || []).every((e) => {
5193
5193
  const a = t[e.targetStepName];
5194
5194
  if (a && a.selectedVariants) {
5195
5195
  const n = a.selectedVariants;
@@ -5317,7 +5317,7 @@ const Q = () => {
5317
5317
  width: u
5318
5318
  }) => {
5319
5319
  var E;
5320
- const h = e || 0, m = 2 * ((l == null ? void 0 : l.scale) || 1), g = A || { x: 0, y: 0, width: u, height: i }, p = `${g.x} ${g.y} ${g.width} ${g.height}`, f = Q(), C = a.purpose === Ht.FreeDesign && /* @__PURE__ */ 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) => (
5320
+ 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__ */ F("defs", { children: /* @__PURE__ */ F("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ F("rect", { width: m.width, height: m.height, rx: h }) }) }), w = (E = a.colorProfiles) == null ? void 0 : E.map((B, I) => (
5321
5321
  /* @ts-ignore */
5322
5322
  /* @__PURE__ */ F("color-profile", { name: B.name, xlinkHref: B.key, children: " " }, I)
5323
5323
  )), S = n.map((B) => ({
@@ -5350,8 +5350,8 @@ const Q = () => {
5350
5350
  "rect",
5351
5351
  {
5352
5352
  id: "layout-background",
5353
- width: g.width,
5354
- height: g.height,
5353
+ width: m.width,
5354
+ height: m.height,
5355
5355
  fill: r,
5356
5356
  rx: h
5357
5357
  }
@@ -5360,7 +5360,7 @@ const Q = () => {
5360
5360
  "g",
5361
5361
  {
5362
5362
  id: "element-group",
5363
- clipPath: a.purpose === Ht.FreeDesign ? "url(#viewboxClip)" : void 0,
5363
+ clipPath: a.purpose === qt.FreeDesign ? "url(#viewboxClip)" : void 0,
5364
5364
  children: y.map((B) => Qn(B)).filter((B) => !!B)
5365
5365
  }
5366
5366
  ),
@@ -5373,18 +5373,18 @@ const Q = () => {
5373
5373
  height: l.height,
5374
5374
  fill: "none",
5375
5375
  stroke: l.hidden ? "none" : t || "#aaaaaa",
5376
- strokeWidth: m / 2,
5377
- strokeDasharray: `${m * 2} ${m}`
5376
+ strokeWidth: g / 2,
5377
+ strokeDasharray: `${g * 2} ${g}`
5378
5378
  }
5379
5379
  ),
5380
5380
  l && /* @__PURE__ */ ct("mask", { id: `viewmask-${f}`, children: [
5381
5381
  /* @__PURE__ */ F(
5382
5382
  "rect",
5383
5383
  {
5384
- x: g.x,
5385
- y: g.y,
5386
- width: g.width,
5387
- height: g.height,
5384
+ x: m.x,
5385
+ y: m.y,
5386
+ width: m.width,
5387
+ height: m.height,
5388
5388
  fill: "black"
5389
5389
  }
5390
5390
  ),
@@ -5403,7 +5403,7 @@ const Q = () => {
5403
5403
  }
5404
5404
  );
5405
5405
  }, xc = (r, t, e, a, n) => {
5406
- 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));
5406
+ 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));
5407
5407
  return {
5408
5408
  minX: l - S,
5409
5409
  maxX: l + S,
@@ -5433,22 +5433,22 @@ const Q = () => {
5433
5433
  y: r.y + ((t == null ? void 0 : t.y) + (t == null ? void 0 : t.height)) * a
5434
5434
  }), Pt = (r) => {
5435
5435
  switch (r) {
5436
- case q.North:
5437
- return q.East;
5438
- case q.East:
5439
- return q.South;
5440
- case q.South:
5441
- return q.West;
5442
- case q.West:
5443
- return q.North;
5444
- case q.Northwest:
5445
- return q.Northeast;
5446
- case q.Northeast:
5447
- return q.Southeast;
5448
- case q.Southeast:
5449
- return q.Southwest;
5450
- case q.Southwest:
5451
- return q.Northwest;
5436
+ case H.North:
5437
+ return H.East;
5438
+ case H.East:
5439
+ return H.South;
5440
+ case H.South:
5441
+ return H.West;
5442
+ case H.West:
5443
+ return H.North;
5444
+ case H.Northwest:
5445
+ return H.Northeast;
5446
+ case H.Northeast:
5447
+ return H.Southeast;
5448
+ case H.Southeast:
5449
+ return H.Southwest;
5450
+ case H.Southwest:
5451
+ return H.Northwest;
5452
5452
  }
5453
5453
  }, Oc = (r, t) => t > 45 && t <= 135 ? Pt(r) : t > 135 && t <= 225 ? Pt(Pt(r)) : t > 225 && t <= 315 ? Pt(Pt(Pt(r))) : r, $c = (r, t = { x: 0, y: 0 }, e = { x: 1, y: 1 }) => {
5454
5454
  const a = pt(r.rotation), n = {
@@ -5480,7 +5480,7 @@ const Q = () => {
5480
5480
  x: (r.x - t.x) * n - (r.y - t.y) * a + t.x,
5481
5481
  y: (r.x - t.x) * a + (r.y - t.y) * n + t.y
5482
5482
  };
5483
- }, Uc = 0.352778, Lc = 0.035277, Fn = (r) => {
5483
+ }, Lc = 0.352778, Uc = 0.035277, Fn = (r) => {
5484
5484
  const t = r.rotation || 0, e = pt(t), a = Math.cos(e), n = -Math.sin(e);
5485
5485
  return /* @__PURE__ */ F("g", { mask: r.stepName || r.productOverlay ? void 0 : r.mask, children: /* @__PURE__ */ F(
5486
5486
  "g",
@@ -5567,15 +5567,15 @@ const Q = () => {
5567
5567
  ] })
5568
5568
  ] }) }) }), s = r.rotation || 0, o = pt(s), l = Math.cos(o), c = -Math.sin(o), d = () => {
5569
5569
  var w, S, y, E, B, I, D, x, k, T;
5570
- 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;
5570
+ 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;
5571
5571
  return [(x = r.pattern) != null && x.svg ? {
5572
5572
  id: `${t}-contents`,
5573
5573
  type: M.Illustration,
5574
5574
  x: A,
5575
5575
  y: u,
5576
5576
  rotation: f,
5577
- width: h * g,
5578
- height: m * p,
5577
+ width: h * m,
5578
+ height: g * p,
5579
5579
  src: a(),
5580
5580
  svg: (k = r.pattern) == null ? void 0 : k.svg,
5581
5581
  colors: (T = r.pattern) == null ? void 0 : T.colors
@@ -5585,8 +5585,8 @@ const Q = () => {
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
5591
  }];
5592
5592
  };
@@ -5677,14 +5677,14 @@ class ji {
5677
5677
  }), a - n;
5678
5678
  }
5679
5679
  }
5680
- const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @__PURE__ */ new Map(), Nt = async (r) => {
5681
- if (Le.has(r))
5682
- return Le.get(r);
5680
+ const qi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ue = /* @__PURE__ */ new Map(), Nt = async (r) => {
5681
+ if (Ue.has(r))
5682
+ return Ue.get(r);
5683
5683
  const e = (async () => {
5684
5684
  try {
5685
5685
  return Et(r).getFont();
5686
5686
  } catch {
5687
- if (Hi(r)) {
5687
+ if (qi(r)) {
5688
5688
  const a = hn(r), n = Xe(a);
5689
5689
  return ra(r, n), n;
5690
5690
  } else {
@@ -5693,8 +5693,8 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5693
5693
  }
5694
5694
  }
5695
5695
  })();
5696
- return Le.set(r, e), e;
5697
- }, qi = (r) => {
5696
+ return Ue.set(r, e), e;
5697
+ }, Hi = (r) => {
5698
5698
  const t = hn(r), e = Xe(t);
5699
5699
  return ra(r, e), e;
5700
5700
  }, Et = (r) => {
@@ -5710,18 +5710,18 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5710
5710
  a.querySelectorAll("style").forEach((d) => {
5711
5711
  var u;
5712
5712
  (u = rn(d.innerHTML).stylesheet) == null || u.rules.forEach((h) => {
5713
- var m, g, p;
5713
+ var g, m, p;
5714
5714
  if (h.type === "font-face" && h.declarations) {
5715
- const f = (m = h.declarations.find(
5715
+ const f = (g = h.declarations.find(
5716
5716
  (S) => S.property === "font-family"
5717
- )) == 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];
5717
+ )) == 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];
5718
5718
  f && w && n.set(f, w);
5719
5719
  }
5720
5720
  });
5721
5721
  });
5722
5722
  const s = e.querySelectorAll("tspan");
5723
5723
  for (let d = 0; d < s.length; d++) {
5724
- 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(
5724
+ 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(
5725
5725
  A.innerHTML,
5726
5726
  0,
5727
5727
  0,
@@ -5730,7 +5730,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5730
5730
  let y = 0;
5731
5731
  const E = A.getAttribute("text-anchor");
5732
5732
  E === "middle" ? y = S / 2 : E === "end" && (y = S);
5733
- const B = g.getPath(
5733
+ const B = m.getPath(
5734
5734
  A.innerHTML,
5735
5735
  parseFloat(A.getAttribute("x") ?? "0") - y,
5736
5736
  parseFloat(A.getAttribute("y") ?? "0"),
@@ -5742,11 +5742,11 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5742
5742
  }
5743
5743
  return e.querySelectorAll("text").forEach((d) => d.remove()), bt().serializeToString(a);
5744
5744
  }, Ee = (r, t, e, a) => Math.max(_i(r.join(`
5745
- `), e, a), t), Ua = (r, t, e, a, n, i) => {
5745
+ `), e, a), t), La = (r, t, e, a, n, i) => {
5746
5746
  const s = (i || ya) * n.getApproximateHeight(), o = t.split(`
5747
5747
  `);
5748
5748
  try {
5749
- const l = o.flatMap((d) => me(d, r.width, a, n)), c = l.flatMap((d) => d.lines);
5749
+ const l = o.flatMap((d) => ge(d, r.width, a, n)), c = l.flatMap((d) => d.lines);
5750
5750
  return {
5751
5751
  lines: c,
5752
5752
  requiredHeight: l.flatMap((d) => d.lines).length * (a * s),
@@ -5762,14 +5762,14 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5762
5762
  requiredWidth: Ee(c, r.width, a, n)
5763
5763
  };
5764
5764
  }
5765
- }, me = (r, t, e, a) => {
5765
+ }, ge = (r, t, e, a) => {
5766
5766
  const n = ht(r, e, a);
5767
5767
  if (n <= t)
5768
5768
  return { lines: [r], width: n };
5769
5769
  if (!(r.indexOf(" ") > -1)) {
5770
5770
  if (r.length <= 1)
5771
5771
  throw new Error(`Character ${r} is wider than region`);
5772
- const d = Math.floor(r.length / 2), A = me(r.slice(0, d), t, e, a), u = me(r.slice(d), t, e, a);
5772
+ const d = Math.floor(r.length / 2), A = ge(r.slice(0, d), t, e, a), u = ge(r.slice(d), t, e, a);
5773
5773
  return { lines: [...A.lines, ...u.lines], width: Math.max(A.width, u.width) };
5774
5774
  }
5775
5775
  const s = r.split(" "), o = [];
@@ -5777,15 +5777,15 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5777
5777
  for (; c < s.length; ) {
5778
5778
  const d = s[c];
5779
5779
  if (ht(d, e, a) > t) {
5780
- const A = me(d, t, e, a);
5780
+ const A = ge(d, t, e, a);
5781
5781
  o.push(...A.lines), l = Math.max(l, A.width), c++;
5782
5782
  } else {
5783
5783
  const A = [d];
5784
5784
  l = Math.max(l, ht(d, e, a));
5785
5785
  let u = c + 1, h = !0;
5786
5786
  for (; u < s.length && h; ) {
5787
- const m = s[u], g = ht(`${A.join(" ")} ${m}`, e, a);
5788
- g <= t ? (A.push(m), l = Math.max(l, g), u++) : h = !1;
5787
+ const g = s[u], m = ht(`${A.join(" ")} ${g}`, e, a);
5788
+ m <= t ? (A.push(g), l = Math.max(l, m), u++) : h = !1;
5789
5789
  }
5790
5790
  o.push(A.join(" ")), c = u;
5791
5791
  }
@@ -5800,7 +5800,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5800
5800
  var c;
5801
5801
  const n = Et(t.fontData.assetUrl), i = n.getFont(), s = t.fontSize / i.unitsPerEm;
5802
5802
  if (!e)
5803
- return Ua(t, r, t.fontSize, s, n, a);
5803
+ return La(t, r, t.fontSize, s, n, a);
5804
5804
  let o;
5805
5805
  if (t.text ? o = t.text.split(`
5806
5806
  `) : o = ((c = t.input) == null ? void 0 : c.split(`
@@ -5817,7 +5817,7 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5817
5817
  requiredHeight: t.height,
5818
5818
  requiredWidth: Ee(o, t.width, s, n),
5819
5819
  fontSize: Yi(o, n, i, t.width, t.height, a)
5820
- } : Ua(t, r, t.fontSize, s, n, a);
5820
+ } : La(t, r, t.fontSize, s, n, a);
5821
5821
  }, Ki = (r, t, e, a, n) => {
5822
5822
  const s = Et(t.assetUrl).getFont();
5823
5823
  let o = { ...r };
@@ -5846,12 +5846,12 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5846
5846
  return r.forEach((n) => {
5847
5847
  a = Math.max(a, ht(n, t, e));
5848
5848
  }), a;
5849
- }, La = {
5849
+ }, Ua = {
5850
5850
  stripControlCharacters: !0,
5851
5851
  vertical: !1,
5852
5852
  uppercase: !1
5853
- }, Be = (r, t = La) => {
5854
- const e = { ...La, ...t };
5853
+ }, Be = (r, t = Ua) => {
5854
+ const e = { ...Ua, ...t };
5855
5855
  let a = r || "";
5856
5856
  return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
5857
5857
  `)), a;
@@ -5874,16 +5874,16 @@ const Hi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Le = /* @_
5874
5874
  };
5875
5875
  })()
5876
5876
  } : r, ya = 1.1, ts = (r) => {
5877
- var m, g, p, f, C;
5877
+ var g, m, p, f, C;
5878
5878
  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);
5879
5879
  let c = "";
5880
5880
  try {
5881
- c = gr.compile(r.text || "")((m = r._renderingConfiguration) == null ? void 0 : m.templatingContext);
5881
+ c = mr.compile(r.text || "")((g = r._renderingConfiguration) == null ? void 0 : g.templatingContext);
5882
5882
  } catch {
5883
5883
  c = r.text ?? "";
5884
5884
  }
5885
5885
  const d = c.split(`
5886
- `), 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;
5886
+ `), 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;
5887
5887
  if (r.curved && !r.paths || !r.fontData)
5888
5888
  return null;
5889
5889
  const h = () => {
@@ -6046,7 +6046,7 @@ class rs {
6046
6046
  return this.state;
6047
6047
  }
6048
6048
  runStateCallbacks() {
6049
- console.log("LOG: running callbacks"), this.stateCallbacks.forEach((t) => t());
6049
+ this.stateCallbacks.forEach((t) => t());
6050
6050
  }
6051
6051
  apply(t, e) {
6052
6052
  if (!this.state)
@@ -6114,7 +6114,7 @@ class rs {
6114
6114
  layouts: {}
6115
6115
  };
6116
6116
  t.forEach((n) => {
6117
- a = new Un(n).apply(a);
6117
+ a = new Ln(n).apply(a);
6118
6118
  }), this.runStateCallbacks(), this.state = {
6119
6119
  transaction: a
6120
6120
  };
@@ -6316,23 +6316,23 @@ const ae = (r) => {
6316
6316
  const s = dt().parseFromString(r, "image/svg+xml").firstElementChild;
6317
6317
  if (!s)
6318
6318
  throw new Error("Failed to read SVG");
6319
- const l = bt().serializeToString(s), c = gt(), d = c.getContext("2d"), A = await Aa.from(d, l, {
6319
+ const l = bt().serializeToString(s), c = mt(), d = c.getContext("2d"), A = await Aa.from(d, l, {
6320
6320
  anonymousCrossOrigin: !0,
6321
6321
  ignoreDimensions: !1,
6322
- createCanvas: gt,
6322
+ createCanvas: mt,
6323
6323
  createImage: Zt,
6324
- DOMParser: ga(),
6324
+ DOMParser: ma(),
6325
6325
  fetch: rt
6326
- }), u = s.getAttribute("width"), h = s.getAttribute("height"), m = 2048;
6326
+ }), u = s.getAttribute("width"), h = s.getAttribute("height"), g = 2048;
6327
6327
  if (h && u) {
6328
- const g = parseFloat(h), f = parseFloat(u) / g;
6329
- f > 1 ? A.resize(m, m / f) : A.resize(m * f, m);
6328
+ const m = parseFloat(h), f = parseFloat(u) / m;
6329
+ f > 1 ? A.resize(g, g / f) : A.resize(g * f, g);
6330
6330
  } else
6331
- A.resize(m, m);
6331
+ A.resize(g, g);
6332
6332
  return await A.render(), await t(c);
6333
6333
  })();
6334
6334
  return ze.set(r, a), a;
6335
- }, Ut = async (r, t, e, a) => {
6335
+ }, Lt = async (r, t, e, a) => {
6336
6336
  const n = r.layoutState.layout.useEditableArea && r.layoutState.layout.editableArea || {
6337
6337
  width: r.layoutState.layout.width,
6338
6338
  height: r.layoutState.layout.height,
@@ -6350,7 +6350,7 @@ const ae = (r) => {
6350
6350
  const l = await lt(await $n(e)), u = dt().parseFromString(l.svg, "image/svg+xml").firstElementChild.getAttribute("viewBox");
6351
6351
  if (!u)
6352
6352
  throw new Error("SVG missing viewBox.");
6353
- const h = o.height, m = u.split(" "), g = parseFloat(m[2]) || 1, p = parseFloat(m[3]) || 1, f = g / p;
6353
+ const h = o.height, g = u.split(" "), m = parseFloat(g[2]) || 1, p = parseFloat(g[3]) || 1, f = m / p;
6354
6354
  o.height = o.width / f, o.top += (h - o.height) / 2;
6355
6355
  }
6356
6356
  if (e && t === M.Image) {
@@ -6366,7 +6366,7 @@ const ae = (r) => {
6366
6366
  };
6367
6367
  class Gc {
6368
6368
  static async getFrame(t, e) {
6369
- const a = await Rn(e.region, e.src), n = await Qe(a), i = e.region || await Ut(t, M.Frame);
6369
+ const a = await Rn(e.region, e.src), n = await Qe(a), i = e.region || await Lt(t, M.Frame);
6370
6370
  return {
6371
6371
  id: Q(),
6372
6372
  x: i.left,
@@ -6392,7 +6392,7 @@ class Gc {
6392
6392
  };
6393
6393
  }
6394
6394
  static async getImage(t, e) {
6395
- const a = e.region || await Ut(t, M.Image, e.src);
6395
+ const a = e.region || await Lt(t, M.Image, e.src);
6396
6396
  return {
6397
6397
  id: Q(),
6398
6398
  src: e.src,
@@ -6409,14 +6409,14 @@ class Gc {
6409
6409
  };
6410
6410
  }
6411
6411
  static async getTextbox(t, e) {
6412
- var m;
6412
+ var g;
6413
6413
  const { configuration: a, fontSrc: n, designInputStep: i } = e, s = await Nt(n), o = {
6414
6414
  assetUrl: n,
6415
6415
  name: s.names.fullName.en
6416
6416
  }, l = (i == null ? void 0 : i.text) || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = Be(c, {
6417
6417
  vertical: a.vertical,
6418
6418
  uppercase: a.uppercase
6419
- }), A = e.region || await Ut(t, M.Textbox, n, {
6419
+ }), A = e.region || await Lt(t, M.Textbox, n, {
6420
6420
  text: d,
6421
6421
  fontScale: a.size ? a.size / s.unitsPerEm : void 0
6422
6422
  }), u = ee(
@@ -6447,7 +6447,7 @@ class Gc {
6447
6447
  { ...A, height: u.height },
6448
6448
  o,
6449
6449
  u.fontSize,
6450
- ((m = u == null ? void 0 : u.text) == null ? void 0 : m.split(`
6450
+ ((g = u == null ? void 0 : u.text) == null ? void 0 : g.split(`
6451
6451
  `)) || [],
6452
6452
  u.align
6453
6453
  );
@@ -6482,7 +6482,7 @@ class Gc {
6482
6482
  </svg>
6483
6483
  `, n = {};
6484
6484
  n["spiff-fill-shape"] = { browserValue: e.color };
6485
- const i = e.region || await Ut(t, M.Illustration), s = Q();
6485
+ const i = e.region || await Lt(t, M.Illustration), s = Q();
6486
6486
  return {
6487
6487
  stepRegion: e.region,
6488
6488
  colors: n,
@@ -6500,7 +6500,7 @@ class Gc {
6500
6500
  };
6501
6501
  }
6502
6502
  static async getIllustration(t, e) {
6503
- const a = e.region || await Ut(t, M.Illustration, e.src), n = await lt(await $n(e.src)), i = await Kt(n.svg), s = Q();
6503
+ const a = e.region || await Lt(t, M.Illustration, e.src), n = await lt(await $n(e.src)), i = await Kt(n.svg), s = Q();
6504
6504
  return {
6505
6505
  cachedObjectURL: i,
6506
6506
  stepRegion: e.region,
@@ -6525,7 +6525,7 @@ class V extends Error {
6525
6525
  super("Element not found!"), Object.setPrototypeOf(this, V.prototype);
6526
6526
  }
6527
6527
  }
6528
- const L = (r, t) => X(r, t).elements.find((n) => n.id === r), X = (r, t) => {
6528
+ const U = (r, t) => X(r, t).elements.find((n) => n.id === r), X = (r, t) => {
6529
6529
  const e = Object.values(t).find((a) => a.elements.some((n) => n.id === r));
6530
6530
  if (!e)
6531
6531
  throw new V();
@@ -6616,7 +6616,7 @@ class zc extends O {
6616
6616
  }
6617
6617
  apply(t) {
6618
6618
  this.oldState = t;
6619
- const e = L(this.id, Object.values(t.layouts));
6619
+ const e = U(this.id, Object.values(t.layouts));
6620
6620
  if (!e.id)
6621
6621
  throw new V();
6622
6622
  const a = {
@@ -6639,7 +6639,7 @@ class Wc extends O {
6639
6639
  }
6640
6640
  apply(t) {
6641
6641
  this.oldState = t;
6642
- const e = L(this.id, Object.values(t.layouts));
6642
+ const e = U(this.id, Object.values(t.layouts));
6643
6643
  if (!e.id)
6644
6644
  throw new V();
6645
6645
  const a = {
@@ -6661,7 +6661,7 @@ class jc extends O {
6661
6661
  }
6662
6662
  apply(t) {
6663
6663
  this.oldState = t;
6664
- const e = L(this.id, Object.values(t.layouts));
6664
+ const e = U(this.id, Object.values(t.layouts));
6665
6665
  if (!e.id)
6666
6666
  throw new V();
6667
6667
  let a = {
@@ -6694,7 +6694,7 @@ class $ extends O {
6694
6694
  return this.oldState = t, this.commands.reduce((e, a) => a.apply(e), t);
6695
6695
  }
6696
6696
  }
6697
- class Un extends O {
6697
+ class Ln extends O {
6698
6698
  constructor(t) {
6699
6699
  super(), this.layout = t;
6700
6700
  }
@@ -6800,7 +6800,7 @@ class ss extends O {
6800
6800
  }
6801
6801
  apply(t) {
6802
6802
  this.oldState = t;
6803
- const e = L(this.id, Object.values(t.layouts));
6803
+ const e = U(this.id, Object.values(t.layouts));
6804
6804
  if (!e.id)
6805
6805
  throw new V();
6806
6806
  const a = {
@@ -6824,7 +6824,7 @@ class We extends O {
6824
6824
  }
6825
6825
  apply(t) {
6826
6826
  this.oldState = t;
6827
- const e = L(this.id, Object.values(t.layouts));
6827
+ const e = U(this.id, Object.values(t.layouts));
6828
6828
  if (!e.id)
6829
6829
  throw new V();
6830
6830
  const a = {
@@ -6846,7 +6846,7 @@ class os extends O {
6846
6846
  }
6847
6847
  apply(t) {
6848
6848
  this.oldState = t;
6849
- const e = L(this.id, Object.values(t.layouts));
6849
+ const e = U(this.id, Object.values(t.layouts));
6850
6850
  if (!e.id)
6851
6851
  throw new V();
6852
6852
  const a = {
@@ -6868,7 +6868,7 @@ class Wa extends O {
6868
6868
  }
6869
6869
  apply(t) {
6870
6870
  this.oldState = t;
6871
- const e = L(this.id, Object.values(t.layouts));
6871
+ const e = U(this.id, Object.values(t.layouts));
6872
6872
  if (!e.id)
6873
6873
  throw new V();
6874
6874
  const a = {
@@ -6890,7 +6890,7 @@ class ls extends O {
6890
6890
  }
6891
6891
  apply(t) {
6892
6892
  this.oldState = t;
6893
- const e = L(this.id, Object.values(t.layouts));
6893
+ const e = U(this.id, Object.values(t.layouts));
6894
6894
  if (!e.id)
6895
6895
  throw new V();
6896
6896
  const a = {
@@ -6948,7 +6948,7 @@ class ds extends O {
6948
6948
  }
6949
6949
  apply(t) {
6950
6950
  this.oldState = t;
6951
- const e = L(this.id, Object.values(t.layouts));
6951
+ const e = U(this.id, Object.values(t.layouts));
6952
6952
  if (!e.id)
6953
6953
  throw new V();
6954
6954
  const a = {
@@ -6967,13 +6967,13 @@ class ds extends O {
6967
6967
  };
6968
6968
  }
6969
6969
  }
6970
- class Hc extends O {
6970
+ class qc extends O {
6971
6971
  constructor(t, e) {
6972
6972
  super(), this.id = t, this.src = e;
6973
6973
  }
6974
6974
  apply(t) {
6975
6975
  this.oldState = t;
6976
- const e = L(this.id, Object.values(t.layouts));
6976
+ const e = U(this.id, Object.values(t.layouts));
6977
6977
  if (!e.id)
6978
6978
  throw new V();
6979
6979
  const a = {
@@ -6995,7 +6995,7 @@ class As extends O {
6995
6995
  }
6996
6996
  apply(t) {
6997
6997
  this.oldState = t;
6998
- const e = L(this.id, Object.values(t.layouts));
6998
+ const e = U(this.id, Object.values(t.layouts));
6999
6999
  if (!e.id)
7000
7000
  throw new V();
7001
7001
  const a = X(e.id, Object.values(t.layouts)), n = Z(ee(e, this.text, e), a);
@@ -7014,7 +7014,7 @@ class je extends O {
7014
7014
  }
7015
7015
  apply(t) {
7016
7016
  this.oldState = t;
7017
- const e = L(this.id, Object.values(t.layouts));
7017
+ const e = U(this.id, Object.values(t.layouts));
7018
7018
  if (!e.id)
7019
7019
  throw new V();
7020
7020
  const a = {
@@ -7037,7 +7037,7 @@ class oa extends O {
7037
7037
  }
7038
7038
  apply(t) {
7039
7039
  this.oldState = t;
7040
- const e = L(this.id, Object.values(t.layouts));
7040
+ const e = U(this.id, Object.values(t.layouts));
7041
7041
  if (!e.id)
7042
7042
  throw new V();
7043
7043
  const a = e.colors || {}, n = a[this.className];
@@ -7069,7 +7069,7 @@ class us extends O {
7069
7069
  }
7070
7070
  apply(t) {
7071
7071
  this.oldState = t;
7072
- const e = L(this.id, Object.values(t.layouts));
7072
+ const e = U(this.id, Object.values(t.layouts));
7073
7073
  if (!e.id)
7074
7074
  throw new V();
7075
7075
  const a = {
@@ -7086,7 +7086,7 @@ class us extends O {
7086
7086
  };
7087
7087
  }
7088
7088
  }
7089
- class qc extends O {
7089
+ class Hc extends O {
7090
7090
  /**
7091
7091
  * @param id The targeted element to bring to the front.
7092
7092
  */
@@ -7094,7 +7094,7 @@ class qc extends O {
7094
7094
  super(), this.id = t;
7095
7095
  }
7096
7096
  apply(t) {
7097
- if (this.oldState = t, !L(this.id, Object.values(t.layouts)).id)
7097
+ if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
7098
7098
  throw new V();
7099
7099
  const a = Object.values(t.layouts).find((s) => s.elements.find((o) => o.id === this.id));
7100
7100
  if (!a)
@@ -7124,7 +7124,7 @@ class Yc extends O {
7124
7124
  }
7125
7125
  apply(t) {
7126
7126
  this.oldState = t;
7127
- const e = L(this.id, Object.values(t.layouts));
7127
+ const e = U(this.id, Object.values(t.layouts));
7128
7128
  if (!e.id)
7129
7129
  throw new V();
7130
7130
  const a = Object.values(t.layouts).find((o) => o.elements.find((l) => l.id === this.id));
@@ -7154,7 +7154,7 @@ class Jc extends O {
7154
7154
  super(), this.id = t;
7155
7155
  }
7156
7156
  apply(t) {
7157
- if (this.oldState = t, !L(this.id, Object.values(t.layouts)).id)
7157
+ if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
7158
7158
  throw new V();
7159
7159
  const a = Object.values(t.layouts).find((l) => l.elements.find((c) => c.id === this.id));
7160
7160
  if (!a)
@@ -7181,7 +7181,7 @@ class Kc extends O {
7181
7181
  super(), this.id = t;
7182
7182
  }
7183
7183
  apply(t) {
7184
- if (this.oldState = t, !L(this.id, Object.values(t.layouts)).id)
7184
+ if (this.oldState = t, !U(this.id, Object.values(t.layouts)).id)
7185
7185
  throw new V();
7186
7186
  const a = Object.values(t.layouts).find((l) => l.elements.find((c) => c.id === this.id));
7187
7187
  if (!a)
@@ -7243,7 +7243,7 @@ class ja {
7243
7243
  command: new W(h, i)
7244
7244
  };
7245
7245
  } else {
7246
- 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) => {
7246
+ 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) => {
7247
7247
  if (!u) {
7248
7248
  f("Undefined vector silent step source");
7249
7249
  return;
@@ -7251,13 +7251,13 @@ class ja {
7251
7251
  at(u, !0).then((C) => {
7252
7252
  p(C);
7253
7253
  }).catch((C) => console.error(C));
7254
- }))()), g = {
7254
+ }))()), m = {
7255
7255
  stepName: this.configuration.stepName,
7256
7256
  id: Q(),
7257
- cachedObjectURL: await Kt(m.svg),
7257
+ cachedObjectURL: await Kt(g.svg),
7258
7258
  src: u,
7259
- svg: m.svg,
7260
- colors: m.colors,
7259
+ svg: g.svg,
7260
+ colors: g.colors,
7261
7261
  type: o,
7262
7262
  y: n.top,
7263
7263
  x: n.left,
@@ -7272,10 +7272,10 @@ class ja {
7272
7272
  };
7273
7273
  return {
7274
7274
  regionElement: {
7275
- id: g.id,
7275
+ id: m.id,
7276
7276
  region: n
7277
7277
  },
7278
- command: new W(g, i)
7278
+ command: new W(m, i)
7279
7279
  };
7280
7280
  }
7281
7281
  }, this.configuration = t, this.layouts = e, this.product = a || void 0;
@@ -7302,7 +7302,7 @@ class ja {
7302
7302
  }
7303
7303
  }
7304
7304
  const hs = async (r) => {
7305
- const t = `${mt.getServicesApiUrl()}/shortener`;
7305
+ const t = `${gt.getServicesApiUrl()}/shortener`;
7306
7306
  try {
7307
7307
  return (await (await rt(t, {
7308
7308
  method: "POST",
@@ -7315,7 +7315,7 @@ const hs = async (r) => {
7315
7315
  throw console.error(e), new xe("Failed to shorten URL, see console.");
7316
7316
  }
7317
7317
  };
7318
- class Ln {
7318
+ class Un {
7319
7319
  async poll() {
7320
7320
  try {
7321
7321
  if (await this.predicate()) {
@@ -7338,7 +7338,7 @@ class Ln {
7338
7338
  this.onSuccess = e, this.onFailure = a, this.predicate = t, this.attempts = 0, this.pollingId = -1, this.interval = n, this.maxAttempts = i, this.poll();
7339
7339
  }
7340
7340
  }
7341
- class ms {
7341
+ class gs {
7342
7342
  async init(t, e, a) {
7343
7343
  return a && await this.reload(t, e, a), null;
7344
7344
  }
@@ -7358,23 +7358,23 @@ class ms {
7358
7358
  }
7359
7359
  async regenerateQRCode(t, e, a, n) {
7360
7360
  const i = async () => {
7361
- var g, p;
7362
- const h = (await ve([e]))[0], m = (p = (g = h == null ? void 0 : h.versions) == null ? void 0 : g.find((f) => f.name === "mpeg4")) == null ? void 0 : p.link;
7363
- return { asset: h, link: m };
7364
- }, s = await new Promise((h, m) => {
7365
- new Ln(
7361
+ var m, p;
7362
+ 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;
7363
+ return { asset: h, link: g };
7364
+ }, s = await new Promise((h, g) => {
7365
+ new Un(
7366
7366
  async () => !!(await i()).link,
7367
7367
  async () => {
7368
- const g = await i();
7369
- if (!g.link || !g.link)
7370
- throw new qt(g.asset);
7368
+ const m = await i();
7369
+ if (!m.link || !m.link)
7370
+ throw new Ht(m.asset);
7371
7371
  h({
7372
7372
  rel: "mpeg4",
7373
- href: g.link
7373
+ href: m.link
7374
7374
  });
7375
7375
  },
7376
7376
  () => {
7377
- m("Poller timed out with 40 attempts @ 3 second interval");
7377
+ g("Poller timed out with 40 attempts @ 3 second interval");
7378
7378
  },
7379
7379
  3e3,
7380
7380
  40
@@ -7430,7 +7430,7 @@ class ms {
7430
7430
  } };
7431
7431
  }
7432
7432
  }
7433
- const Vn = new ms();
7433
+ const Vn = new gs();
7434
7434
  class be {
7435
7435
  constructor() {
7436
7436
  this.frameSourceSvg = async (t, e) => {
@@ -7442,7 +7442,7 @@ class be {
7442
7442
  const n = a.fileLink;
7443
7443
  if (n)
7444
7444
  return at(n, !0);
7445
- throw new qt(a);
7445
+ throw new Ht(a);
7446
7446
  };
7447
7447
  }
7448
7448
  async init(t, e, a) {
@@ -7456,7 +7456,7 @@ class be {
7456
7456
  const s = e.getWorkflowExperience().getBundle();
7457
7457
  if (s && t.globalPropertyAspectConfigurations) {
7458
7458
  const o = s.getGlobalPropertyStateManager(), l = t.globalPropertyAspectConfigurations[0], c = o.getAspectStorage(l.aspectName);
7459
- c && c.originalAssetKey && (i = (await U.getLocalOrFromServer(c.originalAssetKey)).fileLink);
7459
+ c && c.originalAssetKey && (i = (await L.getLocalOrFromServer(c.originalAssetKey)).fileLink);
7460
7460
  }
7461
7461
  if (t.option && t.option.variants && t.option.variants.length > 0) {
7462
7462
  const o = t.option, l = Y.getDefaultVariant(o);
@@ -7492,8 +7492,8 @@ class be {
7492
7492
  }
7493
7493
  if (n) {
7494
7494
  const d = async () => {
7495
- var m, g, p, f, C;
7496
- 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;
7495
+ var g, m, p, f, C;
7496
+ 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;
7497
7497
  if (e.updateMetadata(t.stepName, {
7498
7498
  frameOffsetsList: h,
7499
7499
  framePatternSrc: u
@@ -7523,7 +7523,7 @@ class be {
7523
7523
  l,
7524
7524
  async () => {
7525
7525
  const h = await Promise.all(
7526
- t.data.regions.map((m) => this.frameSourceSvg(u, m))
7526
+ t.data.regions.map((g) => this.frameSourceSvg(u, g))
7527
7527
  );
7528
7528
  e.updateStorage(t.stepName, { currentFrameSources: h }), await d();
7529
7529
  }
@@ -7552,14 +7552,14 @@ class be {
7552
7552
  const o = e.fileLink || "";
7553
7553
  return o.endsWith(".pdf") || o.endsWith(".eps") || o.endsWith(".ai") ? new Promise((c) => {
7554
7554
  a.addPoller(
7555
- new Ln(
7555
+ new Un(
7556
7556
  async () => {
7557
7557
  var h;
7558
- const A = (h = (await U.getFromServer(e.key || "")).versions) == null ? void 0 : h.find((m) => m.name === "svg");
7558
+ const A = (h = (await L.getFromServer(e.key || "")).versions) == null ? void 0 : h.find((g) => g.name === "svg");
7559
7559
  return A ? (await rt(A.link)).status === 200 : !1;
7560
7560
  },
7561
7561
  () => {
7562
- U.getLocalOrFromServer(e.key || "").then((d) => {
7562
+ L.getLocalOrFromServer(e.key || "").then((d) => {
7563
7563
  this.loadPatternFromAsset(d, t, a, n).then(
7564
7564
  c
7565
7565
  );
@@ -7717,12 +7717,12 @@ class be {
7717
7717
  if (!o)
7718
7718
  throw new Error("Frame service unavailable, cannot load pattern!");
7719
7719
  const l = await Promise.all(
7720
- t.data.regions.map((m) => this.frameSourceSvg(e, m))
7720
+ t.data.regions.map((g) => this.frameSourceSvg(e, g))
7721
7721
  );
7722
7722
  i && i(!0);
7723
7723
  const c = t.data.initialZoomLevel, d = await Promise.all(
7724
- t.data.regions.map(async (m, g) => {
7725
- const p = await Qe(l[g]), f = o.getImageData(), C = a.map((I) => new Bt(I.id)), w = f ? Ea(
7724
+ t.data.regions.map(async (g, m) => {
7725
+ const p = await Qe(l[m]), f = o.getImageData(), C = a.map((I) => new Bt(I.id)), w = f ? Ea(
7726
7726
  f,
7727
7727
  p,
7728
7728
  c && !t.data.forceImageCover ? { scale: c } : void 0,
@@ -7737,11 +7737,11 @@ class be {
7737
7737
  scaleX: (w == null ? void 0 : w.zoom) || 1,
7738
7738
  scaleY: (w == null ? void 0 : w.zoom) || 1,
7739
7739
  rotation: 0
7740
- } : void 0, y = Q(), B = n.getLayouts().find((I) => I.panelId === m.panelId);
7740
+ } : void 0, y = Q(), B = n.getLayouts().find((I) => I.panelId === g.panelId);
7741
7741
  if (!B)
7742
- throw new J(m);
7742
+ throw new J(g);
7743
7743
  return {
7744
- command: this.getCreateElementCommand(y, m, B, {
7744
+ command: this.getCreateElementCommand(y, g, B, {
7745
7745
  frameData: p,
7746
7746
  pattern: S,
7747
7747
  disablePlaceholder: t.data.disablePlaceholder,
@@ -7749,26 +7749,26 @@ class be {
7749
7749
  }),
7750
7750
  regionEl: {
7751
7751
  id: y,
7752
- region: m
7752
+ region: g
7753
7753
  },
7754
7754
  removeExistingCommands: C
7755
7755
  };
7756
7756
  })
7757
- ), A = d.map((m) => m.command), u = d.map((m) => m.removeExistingCommands).flat();
7757
+ ), A = d.map((g) => g.command), u = d.map((g) => g.removeExistingCommands).flat();
7758
7758
  return {
7759
7759
  command: new $([...A, ...u]),
7760
7760
  followup: async () => {
7761
7761
  i && i(!1), await n.setSelectionsAndElements(
7762
7762
  t.stepName,
7763
7763
  e ? [e] : [],
7764
- [...d.map((m) => m.regionEl)],
7764
+ [...d.map((g) => g.regionEl)],
7765
7765
  async () => {
7766
- var m;
7766
+ var g;
7767
7767
  if (n.updateStorage(t.stepName, { currentFrameSources: l }), s) {
7768
- const g = (m = n.getWorkflowExperience().getStepById(t.stepName)) == null ? void 0 : m.frameService;
7769
- if (!g)
7768
+ const m = (g = n.getWorkflowExperience().getStepById(t.stepName)) == null ? void 0 : g.frameService;
7769
+ if (!m)
7770
7770
  throw new Error("Frame service unavailable, cannot load pattern!");
7771
- await this.loadPatternFromString(s, g, !0);
7771
+ await this.loadPatternFromString(s, m, !0);
7772
7772
  }
7773
7773
  }
7774
7774
  );
@@ -7786,7 +7786,7 @@ class be {
7786
7786
  const a = t.fileLink;
7787
7787
  if (a)
7788
7788
  return a;
7789
- throw new qt(t);
7789
+ throw new Ht(t);
7790
7790
  }
7791
7791
  async loadPatternFromAsset(t, e, a, n) {
7792
7792
  var c, d;
@@ -7818,7 +7818,7 @@ class be {
7818
7818
  }
7819
7819
  }
7820
7820
  const wt = new be();
7821
- class gs {
7821
+ class ms {
7822
7822
  async getIllustrationBody(t) {
7823
7823
  return new Promise((e) => {
7824
7824
  at(t, !0).then((a) => {
@@ -7854,7 +7854,7 @@ class gs {
7854
7854
  if (a.length === 0)
7855
7855
  return [];
7856
7856
  try {
7857
- return L(
7857
+ return U(
7858
7858
  a[0].id,
7859
7859
  e.getAllLayoutData()
7860
7860
  ).colors;
@@ -7936,39 +7936,39 @@ class gs {
7936
7936
  return new $(c);
7937
7937
  }
7938
7938
  async changeColors(t, e, a, n, i) {
7939
- var h, m;
7939
+ var h, g;
7940
7940
  if (e.length === 0)
7941
7941
  return;
7942
- const s = L(
7942
+ const s = U(
7943
7943
  e[0].id,
7944
- n().map((g) => g.layoutState)
7944
+ n().map((m) => m.layoutState)
7945
7945
  ), o = { ...s.colors }, l = {};
7946
- Object.entries(o).forEach(([g, p]) => {
7946
+ Object.entries(o).forEach(([m, p]) => {
7947
7947
  const f = { browserValue: p.browserValue, pmsValue: p.pmsValue }, C = p.spotColor;
7948
- C && (f.spotColor = { profileName: C.profileName, namedColor: C.namedColor }), l[g] = f;
7948
+ C && (f.spotColor = { profileName: C.profileName, namedColor: C.namedColor }), l[m] = f;
7949
7949
  });
7950
- for (const [g, p] of i.entries()) {
7950
+ for (const [m, p] of i.entries()) {
7951
7951
  const f = typeof p == "string" ? p : p.browserValue, C = typeof p == "string" ? void 0 : p.pmsValue;
7952
- o[g] = { browserValue: f, spotColor: (h = o[g]) == null ? void 0 : h.spotColor, pmsValue: C }, l[g] = { browserValue: f };
7952
+ o[m] = { browserValue: f, spotColor: (h = o[m]) == null ? void 0 : h.spotColor, pmsValue: C }, l[m] = { browserValue: f };
7953
7953
  }
7954
- let c = Array.from(Object.values(o)).map((g) => g.browserValue);
7954
+ let c = Array.from(Object.values(o)).map((m) => m.browserValue);
7955
7955
  const d = t.data.colorOption;
7956
- d && ((m = d.variants) == null || m.forEach((g) => {
7956
+ d && ((g = d.variants) == null || g.forEach((m) => {
7957
7957
  c = c.map((p) => {
7958
7958
  var f;
7959
- return p.toLowerCase() === ((f = g.color) == null ? void 0 : f.toLowerCase()) ? g.name : p;
7959
+ return p.toLowerCase() === ((f = m.color) == null ? void 0 : f.toLowerCase()) ? m.name : p;
7960
7960
  });
7961
7961
  })), a.updateMetadata(t.stepName, { colors: c });
7962
7962
  const A = /* @__PURE__ */ new Map();
7963
- if (Object.entries(o).forEach(([g, p]) => {
7964
- A.set(g, p);
7963
+ if (Object.entries(o).forEach(([m, p]) => {
7964
+ A.set(m, p);
7965
7965
  }), !s.svg)
7966
7966
  throw new Error("Colors changed before SVG loaded. This should never happen!");
7967
7967
  const u = await this.changeColorsCommand(
7968
7968
  s.svg,
7969
7969
  s.width,
7970
7970
  s.height,
7971
- e.map((g) => g.id),
7971
+ e.map((m) => m.id),
7972
7972
  A
7973
7973
  );
7974
7974
  a.updateStorage(t.stepName, {
@@ -7991,7 +7991,7 @@ class gs {
7991
7991
  throw new vt(e);
7992
7992
  const l = o.fileLink;
7993
7993
  if (!l)
7994
- throw new qt(o);
7994
+ throw new Ht(o);
7995
7995
  const c = await lt(await this.getIllustrationBody(l)), d = await Kt(c.svg), A = (C) => {
7996
7996
  const w = i.getLayouts().find((y) => y.panelId === C.panelId);
7997
7997
  if (!w)
@@ -8006,16 +8006,16 @@ class gs {
8006
8006
  svg: c
8007
8007
  })
8008
8008
  };
8009
- }, u = t.data.regions.map(A), m = [...u.map((C) => C.command), ...s];
8010
- let g = Array.from(Object.values(c.colors)).map((C) => C.browserValue);
8009
+ }, u = t.data.regions.map(A), g = [...u.map((C) => C.command), ...s];
8010
+ let m = Array.from(Object.values(c.colors)).map((C) => C.browserValue);
8011
8011
  const p = t.data.colorOption;
8012
8012
  return p && ((f = p.variants) == null || f.forEach((C) => {
8013
- g = g.map((w) => {
8013
+ m = m.map((w) => {
8014
8014
  var S;
8015
8015
  return w.toLowerCase() === ((S = C.color) == null ? void 0 : S.toLowerCase()) ? C.name : w;
8016
8016
  });
8017
- })), i.updateMetadata(t.stepName, { colors: g }), {
8018
- command: new $(m),
8017
+ })), i.updateMetadata(t.stepName, { colors: m }), {
8018
+ command: new $(g),
8019
8019
  followup: async () => {
8020
8020
  var w, S;
8021
8021
  await i.setSelectionsAndElements(
@@ -8065,7 +8065,7 @@ class gs {
8065
8065
  };
8066
8066
  }
8067
8067
  }
8068
- const ge = new gs();
8068
+ const me = new ms();
8069
8069
  class ps {
8070
8070
  async init(t, e, a) {
8071
8071
  const n = t.option;
@@ -8094,20 +8094,20 @@ class ps {
8094
8094
  if (d) {
8095
8095
  const A = (c = l.variants) == null ? void 0 : c.find((u) => u.id === d);
8096
8096
  if (A) {
8097
- const u = A.material, h = o.map((m) => ({ id: m.id, region: m.stepRegion }));
8097
+ const u = A.material, h = o.map((g) => ({ id: g.id, region: g.stepRegion }));
8098
8098
  await e.setSelectionsAndElements(
8099
8099
  t.stepName,
8100
8100
  [A],
8101
8101
  h,
8102
8102
  async () => {
8103
- const m = e.getModelContainer();
8104
- if (m) {
8105
- const g = t.data.targetMaterials.map((p) => m.applyMaterialVariant(
8103
+ const g = e.getModelContainer();
8104
+ if (g) {
8105
+ const m = t.data.targetMaterials.map((p) => g.applyMaterialVariant(
8106
8106
  p,
8107
8107
  l.id || "",
8108
8108
  u || {}
8109
8109
  ));
8110
- Promise.all(g).then(
8110
+ Promise.all(m).then(
8111
8111
  () => e.setMandatoryFulfilled(t.stepName, !0)
8112
8112
  );
8113
8113
  }
@@ -8176,16 +8176,16 @@ class fs {
8176
8176
  [A],
8177
8177
  u,
8178
8178
  async () => {
8179
- var m;
8179
+ var g;
8180
8180
  const h = e.getModelContainer();
8181
8181
  if (h && t.option) {
8182
- const g = (m = A.asset) == null ? void 0 : m.fileLink;
8183
- if (!g)
8182
+ const m = (g = A.asset) == null ? void 0 : g.fileLink;
8183
+ if (!m)
8184
8184
  throw new vt(A);
8185
8185
  await h.applyModelVariant(
8186
8186
  t.stepName || "",
8187
8187
  {
8188
- model: g,
8188
+ model: m,
8189
8189
  contextService: e.getLayoutPreviewService()
8190
8190
  },
8191
8191
  t.data.replaceProductModel || !1
@@ -8265,17 +8265,17 @@ class Cs {
8265
8265
  return console.error("Missing configuration."), null;
8266
8266
  a.updateStorage(t.stepName, { text: e }), a.updateMetadata(t.stepName, { text: e });
8267
8267
  const c = (A, u, h) => {
8268
- const m = h || Q(), p = a.getLayouts().find((C) => C.panelId === u.panelId);
8268
+ const g = h || Q(), p = a.getLayouts().find((C) => C.panelId === u.panelId);
8269
8269
  if (!p)
8270
8270
  return console.error(`Can not find layout for region: ${u.panelId}`), null;
8271
8271
  const f = [];
8272
- return h && f.push(new Bt(m)), f.push(
8272
+ return h && f.push(new Bt(g)), f.push(
8273
8273
  new W(
8274
8274
  {
8275
8275
  stepRegion: u,
8276
8276
  stepName: t.stepName,
8277
8277
  colors: {},
8278
- id: m,
8278
+ id: g,
8279
8279
  svg: A,
8280
8280
  type: M.Illustration,
8281
8281
  y: u.top,
@@ -8290,7 +8290,7 @@ class Cs {
8290
8290
  p
8291
8291
  )
8292
8292
  ), {
8293
- id: m,
8293
+ id: g,
8294
8294
  region: u,
8295
8295
  command: new $(f)
8296
8296
  };
@@ -8299,8 +8299,8 @@ class Cs {
8299
8299
  const u = i.map((h) => {
8300
8300
  if (!h.region)
8301
8301
  return null;
8302
- const m = s.svgPrint(e, h.region);
8303
- return c(m, h.region, h.id);
8302
+ const g = s.svgPrint(e, h.region);
8303
+ return c(g, h.region, h.id);
8304
8304
  }).filter((h) => !!h).filter((h) => !!h).map((h) => h && h.command);
8305
8305
  return {
8306
8306
  command: new $(u),
@@ -8314,7 +8314,7 @@ class Cs {
8314
8314
  return {
8315
8315
  command: new $(u),
8316
8316
  followup: async () => {
8317
- const h = A.filter((m) => m).map((m) => m && { id: m.id, region: m.region });
8317
+ const h = A.filter((g) => g).map((g) => g && { id: g.id, region: g.region });
8318
8318
  await a.setSelectionsAndElements(
8319
8319
  t.stepName,
8320
8320
  [],
@@ -8392,17 +8392,17 @@ class ws {
8392
8392
  return console.error("No URL for picture!"), null;
8393
8393
  n(!0), t.mandatory && a.setMandatoryFulfilled(t.stepName, !1);
8394
8394
  const l = a.getRegionElements(t.stepName).map((A) => new Bt(A.id)), c = (A) => {
8395
- const h = a.getLayouts().find((g) => g.panelId === A.panelId);
8395
+ const h = a.getLayouts().find((m) => m.panelId === A.panelId);
8396
8396
  if (!h)
8397
8397
  throw new J(A);
8398
- const m = Q();
8398
+ const g = Q();
8399
8399
  return {
8400
- regionElement: { id: m, region: A },
8400
+ regionElement: { id: g, region: A },
8401
8401
  command: new W(
8402
8402
  {
8403
8403
  stepName: t.stepName,
8404
8404
  stepRegion: A,
8405
- id: m,
8405
+ id: g,
8406
8406
  src: s,
8407
8407
  type: M.Image,
8408
8408
  y: A.top,
@@ -8472,31 +8472,31 @@ class ys {
8472
8472
  }
8473
8473
  }
8474
8474
  async selectVariant(t, e, a) {
8475
- await a.getInitializationPromise();
8475
+ console.log("LOG: q select variant"), await a.getInitializationPromise();
8476
8476
  const n = await this.selectVariantLambda(t, e, a);
8477
- n && (n.command && a.getCommandDispatcher()(n.command), n.followup && await n.followup());
8477
+ n && (console.log("LOG: q select variant result"), n.command && a.getCommandDispatcher()(n.command), n.followup && await n.followup());
8478
8478
  }
8479
8479
  async selectVariantLambda(t, e, a) {
8480
8480
  const n = t.option;
8481
8481
  if (!n)
8482
- return null;
8482
+ return console.log("LOG: q select variant no option"), null;
8483
8483
  const i = n.variants;
8484
8484
  if (!i)
8485
- return null;
8485
+ return console.log("LOG: q select variant no variants"), null;
8486
8486
  const s = i.length > 1 ? i.find((o) => o.id === e) : i[0];
8487
8487
  if (!s)
8488
- throw new Error(`Failed to find selected variant ${e} in option ${n.id} of step ${t.stepName} (${t.stepTitle})`);
8488
+ throw console.log("LOG: q select variant no variant"), new Error(`Failed to find selected variant ${e} in option ${n.id} of step ${t.stepName} (${t.stepTitle})`);
8489
8489
  return {
8490
8490
  command: void 0,
8491
8491
  followup: async () => {
8492
- await a.setSelectionsAndElements(t.stepName, [s], [], async () => {
8492
+ console.log("LOG: q select variant follow up"), await a.setSelectionsAndElements(t.stepName, [s], [], async () => {
8493
8493
  a.setMandatoryFulfilled(t.stepName, !0);
8494
8494
  });
8495
8495
  }
8496
8496
  };
8497
8497
  }
8498
8498
  }
8499
- const Hn = new ys();
8499
+ const qn = new ys();
8500
8500
  class Ss {
8501
8501
  constructor() {
8502
8502
  this.shapeFillId = "spiff-fill-shape";
@@ -8585,10 +8585,10 @@ class Ss {
8585
8585
  if (a.length > 0) {
8586
8586
  const c = (A) => {
8587
8587
  const u = A.region;
8588
- if (!i.find((g) => g.panelId === (u == null ? void 0 : u.panelId)))
8588
+ if (!i.find((m) => m.panelId === (u == null ? void 0 : u.panelId)))
8589
8589
  throw new J(u);
8590
- const m = o();
8591
- return new oa(A.id, this.shapeFillId, m);
8590
+ const g = o();
8591
+ return new oa(A.id, this.shapeFillId, g);
8592
8592
  }, d = a.map(c).filter((A) => !!A);
8593
8593
  return {
8594
8594
  command: new $(d),
@@ -8602,10 +8602,10 @@ class Ss {
8602
8602
  };
8603
8603
  } else {
8604
8604
  const c = (h) => {
8605
- const m = i.find((w) => w.panelId === h.panelId);
8606
- if (!m)
8605
+ const g = i.find((w) => w.panelId === h.panelId);
8606
+ if (!g)
8607
8607
  throw new J(h);
8608
- const g = o(), p = `
8608
+ const m = o(), p = `
8609
8609
  <svg
8610
8610
  xmlns="http://www.w3.org/2000/svg"
8611
8611
  xmlnsXlink="http://www.w3.org/1999/xlink"
@@ -8622,11 +8622,11 @@ class Ss {
8622
8622
  width="1"
8623
8623
  height="1"
8624
8624
  class="${this.shapeFillId}"
8625
- fill="${g}"
8625
+ fill="${m}"
8626
8626
  />
8627
8627
  </svg>
8628
8628
  `, f = {};
8629
- f[this.shapeFillId] = { browserValue: g };
8629
+ f[this.shapeFillId] = { browserValue: m };
8630
8630
  const C = Q();
8631
8631
  return {
8632
8632
  id: C,
@@ -8649,7 +8649,7 @@ class Ss {
8649
8649
  immutable: h.immutable,
8650
8650
  excludeFromExport: t.data.excludeFromPrint
8651
8651
  },
8652
- m
8652
+ g
8653
8653
  )
8654
8654
  };
8655
8655
  }, 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 }));
@@ -8695,7 +8695,7 @@ class vs {
8695
8695
  );
8696
8696
  }
8697
8697
  }
8698
- const Es = new vs(), He = (r, t, e, a, n) => {
8698
+ const Es = new vs(), qe = (r, t, e, a, n) => {
8699
8699
  if (t.some((d) => d == null))
8700
8700
  throw new Error(`Failed to autosize lines: ${t.join(", ")}`);
8701
8701
  let i = t.map((d) => d.split(`
@@ -8709,17 +8709,17 @@ const Es = new vs(), He = (r, t, e, a, n) => {
8709
8709
  if (A <= r.width)
8710
8710
  return [i, A];
8711
8711
  const u = o.reduce((p, f, C, w) => f > w[p] ? C : p, 0), h = i[u];
8712
- let m = !1, g = h.length;
8713
- for (; !m && g > -1; ) {
8714
- g = h.lastIndexOf(" ", g - 1);
8715
- const p = [h.slice(0, g), h.slice(g + 1)], f = p.map((w) => ht(w, a, n));
8712
+ let g = !1, m = h.length;
8713
+ for (; !g && m > -1; ) {
8714
+ m = h.lastIndexOf(" ", m - 1);
8715
+ const p = [h.slice(0, m), h.slice(m + 1)], f = p.map((w) => ht(w, a, n));
8716
8716
  f[0] <= r.width && (i = [...i.slice(0, u), ...p, ...i.slice(u + 1)], o = [
8717
8717
  ...o.slice(0, u),
8718
8718
  ...f,
8719
8719
  ...o.slice(u + 1)
8720
- ], s += 1, m = !0);
8720
+ ], s += 1, g = !0);
8721
8721
  }
8722
- m || (c = !1);
8722
+ g || (c = !1);
8723
8723
  }
8724
8724
  return [null, null];
8725
8725
  }, pe = (r, t, e, a, n) => {
@@ -8727,19 +8727,19 @@ const Es = new vs(), He = (r, t, e, a, n) => {
8727
8727
  const o = Et(t.assetUrl), l = o.getFont();
8728
8728
  if (n.size) {
8729
8729
  const u = r / l.unitsPerEm;
8730
- return [i, s] = He(e, a, r, u, o), [n.size, i, s];
8730
+ return [i, s] = qe(e, a, r, u, o), [n.size, i, s];
8731
8731
  }
8732
8732
  const c = 6;
8733
8733
  let d = c - Ve;
8734
8734
  if (a.length > 0) {
8735
8735
  let u = a, h = 0;
8736
8736
  for (; (!n.maxSize || d <= n.maxSize) && u; )
8737
- d += Ve, h = d / l.unitsPerEm, [u, s] = He(e, a, d, h, o);
8737
+ d += Ve, h = d / l.unitsPerEm, [u, s] = qe(e, a, d, h, o);
8738
8738
  }
8739
8739
  d > c && (d -= Ve), n.minSize && d < n.minSize && (d = n.minSize);
8740
8740
  const A = d / l.unitsPerEm;
8741
- return [i, s] = He(e, a, d, A, o), [d, i, s];
8742
- }, qe = 30;
8741
+ return [i, s] = qe(e, a, d, A, o), [d, i, s];
8742
+ }, He = 30;
8743
8743
  class Ie extends Error {
8744
8744
  constructor(t) {
8745
8745
  super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = Ie.name;
@@ -8786,22 +8786,24 @@ class bs {
8786
8786
  }
8787
8787
  async init(t, e, a) {
8788
8788
  var i, s, o, l;
8789
+ console.log("LOG: t init");
8789
8790
  const n = t.option;
8790
8791
  if (!n)
8791
- return null;
8792
+ return console.log("LOG: t no option"), null;
8792
8793
  if (a)
8793
- await this.reload(t, e, a);
8794
+ console.log("LOG: t reload"), await this.reload(t, e, a);
8794
8795
  else {
8796
+ console.log("LOG: t no reload");
8795
8797
  const c = this.getDefaultImageFillVariant(t.data), d = (i = c == null ? void 0 : c.asset) == null ? void 0 : i.fileLink, A = d ? await sa(d) : void 0, u = A ? {
8796
8798
  src: A.src,
8797
8799
  height: A.height,
8798
8800
  width: A.width,
8799
8801
  scale: t.data.imageFillScale || 1
8800
- } : void 0, h = this.getDefaultStrokeColorVariant(t.data), m = t.data.strokeEnabled && (h != null && h.color) ? {
8802
+ } : void 0, h = this.getDefaultStrokeColorVariant(t.data), g = t.data.strokeEnabled && (h != null && h.color) ? {
8801
8803
  browserValue: h.color,
8802
8804
  pmsValue: h.name
8803
8805
  } : void 0;
8804
- let g = t.data.defaultText || "";
8806
+ let m = t.data.defaultText || "";
8805
8807
  const p = e.getWorkflowExperience().getBundle();
8806
8808
  if (p && t.globalPropertyAspectConfigurations) {
8807
8809
  const C = (s = p.getGlobalPropertyConfiguration()) == null ? void 0 : s.aspects, w = C == null ? void 0 : C.find((S) => {
@@ -8810,27 +8812,27 @@ class bs {
8810
8812
  });
8811
8813
  if (w) {
8812
8814
  const y = p.getGlobalPropertyStateManager().getAspect(w.name);
8813
- y && (g = y);
8815
+ y && (m = y);
8814
8816
  }
8815
8817
  }
8816
8818
  e.updateStorage(t.stepName, {
8817
- text: g,
8819
+ text: m,
8818
8820
  inputText: t.data.defaultText || "",
8819
8821
  color: ((o = this.getDefaultColorVariant(t.data)) == null ? void 0 : o.color) || this.getDefaultColor(t.data),
8820
8822
  fillImage: u,
8821
- strokeColor: m
8823
+ strokeColor: g
8822
8824
  }), e.updateMetadata(t.stepName, {
8823
- text: g,
8825
+ text: m,
8824
8826
  color: ((l = this.getDefaultColorVariant(t.data)) == null ? void 0 : l.name) || this.getDefaultColor(t.data),
8825
8827
  fillImage: c == null ? void 0 : c.name,
8826
8828
  strokeColor: t.data.strokeEnabled ? h == null ? void 0 : h.color : void 0
8827
8829
  });
8828
8830
  const f = Y.getDefaultVariant(n);
8829
8831
  if (f)
8830
- return this.selectVariantCommand(
8832
+ return console.log("LOG: t variant"), this.selectVariantCommand(
8831
8833
  t,
8832
8834
  f,
8833
- { text: g },
8835
+ { text: m },
8834
8836
  [],
8835
8837
  e,
8836
8838
  () => {
@@ -8838,13 +8840,13 @@ class bs {
8838
8840
  () => {
8839
8841
  },
8840
8842
  u,
8841
- m
8843
+ g
8842
8844
  );
8843
8845
  }
8844
- return null;
8846
+ return console.log("LOG: t end"), null;
8845
8847
  }
8846
8848
  findLayoutElements(t, e) {
8847
- return t.getRegionElements(e.stepName).map((i) => L(i.id, t.getAllLayoutData()));
8849
+ return t.getRegionElements(e.stepName).map((i) => U(i.id, t.getAllLayoutData()));
8848
8850
  }
8849
8851
  /**
8850
8852
  * Get the colors that can be used for a given text step.
@@ -9001,9 +9003,9 @@ class bs {
9001
9003
  { size: a.data.size, minSize: a.data.minSize, maxSize: a.data.maxSize }
9002
9004
  );
9003
9005
  c.set(A.id, u), d.set(A.id, h);
9004
- const m = a.data.curved ? s : (h || []).join(`
9006
+ const g = a.data.curved ? s : (h || []).join(`
9005
9007
  `);
9006
- l.push(this.generateTextChangeCommandsForRegion(u, a.data, A.id, m));
9008
+ l.push(this.generateTextChangeCommandsForRegion(u, a.data, A.id, g));
9007
9009
  }
9008
9010
  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, {
9009
9011
  text: s
@@ -9038,13 +9040,15 @@ class bs {
9038
9040
  const n = e.getSerializedStep(
9039
9041
  t.stepName,
9040
9042
  a.serializableWorkflow.steps
9041
- ), o = Object.values(a.layouts).map((m) => m.elements).flat().filter((m) => m.stepName === t.stepName), l = t.option;
9043
+ ), o = Object.values(a.layouts).map((g) => g.elements).flat().filter((g) => g.stepName === t.stepName), l = t.option;
9042
9044
  if (n != null && n.selectedVariants) {
9043
- const m = n.selectedVariants[0].id;
9044
- if (l && m) {
9045
- const g = (c = l.variants) == null ? void 0 : c.find((p) => p.id === m);
9046
- if (g) {
9047
- 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;
9045
+ console.log("LOG: text reload selections");
9046
+ const g = n.selectedVariants[0].id;
9047
+ if (l && g) {
9048
+ const m = (c = l.variants) == null ? void 0 : c.find((p) => p.id === g);
9049
+ if (m) {
9050
+ console.log("LOG: text reload selections variant");
9051
+ 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;
9048
9052
  let w = (A = n.storage) == null ? void 0 : A.text;
9049
9053
  const S = e.getWorkflowExperience().getBundle();
9050
9054
  if (S && t.globalPropertyAspectConfigurations) {
@@ -9059,7 +9063,7 @@ class bs {
9059
9063
  }
9060
9064
  if (await e.setSelectionsAndElements(
9061
9065
  t.stepName,
9062
- [g],
9066
+ [m],
9063
9067
  f,
9064
9068
  async () => {
9065
9069
  e.updateMetadata(t.stepName, { color: C, text: w }), e.updateStorage(t.stepName, { text: w, inputText: w });
@@ -9067,8 +9071,10 @@ class bs {
9067
9071
  e.getCommandDispatcher()(E);
9068
9072
  }
9069
9073
  ), o.length === 0 && l) {
9074
+ console.log("LOG: text reload cond");
9070
9075
  const y = Y.getDefaultVariant(l);
9071
9076
  if (y) {
9077
+ console.log("LOG: text reload cond default");
9072
9078
  const E = await this.selectVariantCommand(
9073
9079
  t,
9074
9080
  y,
@@ -9083,6 +9089,7 @@ class bs {
9083
9089
  e.getCommandDispatcher()(E.command);
9084
9090
  }
9085
9091
  } else {
9092
+ console.log("LOG: text reload noncond");
9086
9093
  const { command: y } = j.updateInputText(
9087
9094
  w || "",
9088
9095
  o,
@@ -9094,16 +9101,19 @@ class bs {
9094
9101
  }
9095
9102
  }
9096
9103
  } else {
9097
- const m = e.getWorkflowExperience().getBundle();
9098
- if (m && t.globalPropertyAspectConfigurations) {
9099
- const g = (h = m.getGlobalPropertyConfiguration()) == null ? void 0 : h.aspects, p = g == null ? void 0 : g.find((f) => {
9104
+ console.log("LOG: text reload else");
9105
+ const g = e.getWorkflowExperience().getBundle();
9106
+ if (g && t.globalPropertyAspectConfigurations) {
9107
+ const m = (h = g.getGlobalPropertyConfiguration()) == null ? void 0 : h.aspects, p = m == null ? void 0 : m.find((f) => {
9100
9108
  var C;
9101
9109
  return f.type === G.Text && ((C = t.globalPropertyAspectConfigurations) == null ? void 0 : C.map((w) => w.aspectName).includes(f.name));
9102
9110
  });
9103
9111
  if (p) {
9104
- const C = m.getGlobalPropertyStateManager().getAspect(p.name);
9112
+ console.log("LOG: text reload else aspect");
9113
+ const C = g.getGlobalPropertyStateManager().getAspect(p.name);
9105
9114
  if (C)
9106
9115
  if (o.length === 0 && l) {
9116
+ console.log("LOG: text reload else aspect text a");
9107
9117
  const w = Y.getDefaultVariant(l);
9108
9118
  if (w) {
9109
9119
  const S = await this.selectVariantCommand(
@@ -9120,6 +9130,7 @@ class bs {
9120
9130
  e.getCommandDispatcher()(S.command);
9121
9131
  }
9122
9132
  } else {
9133
+ console.log("LOG: text reload else aspect text b");
9123
9134
  const { command: w } = j.updateInputText(
9124
9135
  C,
9125
9136
  o,
@@ -9160,7 +9171,7 @@ class bs {
9160
9171
  throw new vt(t);
9161
9172
  const a = e.fileLink;
9162
9173
  if (!a)
9163
- throw new qt(e);
9174
+ throw new Ht(e);
9164
9175
  const n = await Nt(a);
9165
9176
  return {
9166
9177
  assetUrl: a,
@@ -9182,9 +9193,9 @@ class bs {
9182
9193
  );
9183
9194
  h.push(...p);
9184
9195
  }
9185
- const m = await this.changeInputTextWithRegion(
9196
+ const g = await this.changeInputTextWithRegion(
9186
9197
  t,
9187
- t.data.size || qe,
9198
+ t.data.size || He,
9188
9199
  A,
9189
9200
  a.text || "",
9190
9201
  a,
@@ -9193,7 +9204,7 @@ class bs {
9193
9204
  s,
9194
9205
  o
9195
9206
  );
9196
- return m && h.push(m), {
9207
+ return g && h.push(g), {
9197
9208
  command: new $(h),
9198
9209
  followup: async () => {
9199
9210
  i.markUpdateCompleted(d), await i.setSelectionsAndElements(t.stepName, [e], n);
@@ -9207,9 +9218,9 @@ class bs {
9207
9218
  A,
9208
9219
  a,
9209
9220
  i
9210
- ), m = await this.changeInputTextWithRegion(
9221
+ ), g = await this.changeInputTextWithRegion(
9211
9222
  t,
9212
- t.data.size || qe,
9223
+ t.data.size || He,
9213
9224
  A,
9214
9225
  ((u = h[0]) == null ? void 0 : u.newElement.input) || a.text || t.data.defaultText || "",
9215
9226
  a,
@@ -9217,21 +9228,21 @@ class bs {
9217
9228
  (a == null ? void 0 : a.customiseAllText) ?? !1,
9218
9229
  s,
9219
9230
  o
9220
- ), g = h.flatMap((f) => f.commands);
9231
+ ), m = h.flatMap((f) => f.commands);
9221
9232
  if (l) {
9222
9233
  const f = h.map(
9223
9234
  (C) => new We(C.regionElement.id, l)
9224
9235
  );
9225
- g.push(...f);
9236
+ m.push(...f);
9226
9237
  }
9227
9238
  if (c) {
9228
9239
  const f = n.map(
9229
9240
  (C) => new je(C.id, c, t.data.strokeThickness)
9230
9241
  );
9231
- g.push(...f);
9242
+ m.push(...f);
9232
9243
  }
9233
- return m && g.push(m), {
9234
- command: new $(g),
9244
+ return g && m.push(g), {
9245
+ command: new $(m),
9235
9246
  followup: async () => {
9236
9247
  i.markUpdateCompleted(d);
9237
9248
  }
@@ -9250,8 +9261,8 @@ class bs {
9250
9261
  if (!a || !a.regions)
9251
9262
  throw new Error("Step data not supplied");
9252
9263
  const o = i.text || a.defaultText || "", l = this.getProcessedInput(o, a, !1), c = async (A) => {
9253
- var g;
9254
- const h = s.getLayouts().find((p) => p.panelId === A.panelId), m = Q();
9264
+ var m;
9265
+ const h = s.getLayouts().find((p) => p.panelId === A.panelId), g = Q();
9255
9266
  try {
9256
9267
  if (!h)
9257
9268
  throw new Pe("Failed to find layout for region: " + A.panelId);
@@ -9263,7 +9274,7 @@ class bs {
9263
9274
  return nt.id === ((R = p.defaultVariant) == null ? void 0 : R.id);
9264
9275
  }) || p.variants[0];
9265
9276
  f = this.createTextFillSpotColor(p, T), s.updateStorage(t, {
9266
- colorProfileAssetKey: (g = p.colorProfile) == null ? void 0 : g.key
9277
+ colorProfileAssetKey: (m = p.colorProfile) == null ? void 0 : m.key
9267
9278
  });
9268
9279
  }
9269
9280
  const C = await this.getDefaultColor(a), w = C || "#000000", S = {
@@ -9271,9 +9282,9 @@ class bs {
9271
9282
  stepName: t,
9272
9283
  align: this.textAlign(a),
9273
9284
  fill: i.color ? i.color : w,
9274
- fontSize: a.size || qe,
9285
+ fontSize: a.size || He,
9275
9286
  fontData: n,
9276
- id: m,
9287
+ id: g,
9277
9288
  layer: A.layer,
9278
9289
  layerIndex: A.layerIndex,
9279
9290
  rotation: A.rotation,
@@ -9315,7 +9326,7 @@ class bs {
9315
9326
  );
9316
9327
  const k = new W(S, h);
9317
9328
  return {
9318
- regionElement: { id: m, region: A },
9329
+ regionElement: { id: g, region: A },
9319
9330
  commands: [k, ...y],
9320
9331
  newElement: S,
9321
9332
  fontData: n
@@ -9326,7 +9337,7 @@ class bs {
9326
9337
  }, d = await Promise.all(a.regions.map(c)).catch((A) => {
9327
9338
  throw A instanceof Ie ? (Es.setLatestToast("Failed to load font.", Re.Error), A) : A instanceof Pe ? A : new Error(A);
9328
9339
  });
9329
- return await s.setSelectionsAndElements(
9340
+ return console.log(`LOG: created ${d.length} new text elements`), await s.setSelectionsAndElements(
9330
9341
  t,
9331
9342
  [e],
9332
9343
  d.map((A) => A.regionElement),
@@ -9351,7 +9362,7 @@ class bs {
9351
9362
  * @deprecated
9352
9363
  */
9353
9364
  async changeInputTextWithRegion(t, e, a, n, i, s, o, l, c, d) {
9354
- 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();
9365
+ 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();
9355
9366
  for (const S of h)
9356
9367
  if (S.region) {
9357
9368
  const [y, E] = pe(
@@ -9361,7 +9372,7 @@ class bs {
9361
9372
  [u],
9362
9373
  { size: t.data.size, minSize: t.data.minSize, maxSize: t.data.maxSize }
9363
9374
  );
9364
- m.set(S.id, y), g.set(S.id, E);
9375
+ g.set(S.id, y), m.set(S.id, E);
9365
9376
  }
9366
9377
  const f = (() => {
9367
9378
  if (t.data && t.data.maxLength && u.length > t.data.maxLength)
@@ -9374,7 +9385,7 @@ class bs {
9374
9385
  return l(!0), { error: "Blocked profanity." };
9375
9386
  }
9376
9387
  return !t.data.vertical && !t.data.allowNewlines && (u.includes(`
9377
- `) || 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() });
9388
+ `) || 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() });
9378
9389
  })();
9379
9390
  if (f.error) {
9380
9391
  c(f.error);
@@ -9387,11 +9398,11 @@ class bs {
9387
9398
  }), (i.defaultCleared || !t.data.deleteDefaultOnFocus) && A.trim() !== "" && s.setMandatoryFulfilled(t.stepName, !0);
9388
9399
  const C = [];
9389
9400
  for (const S of h) {
9390
- const y = t.data.curved ? u : (g.get(S.id) || []).join(`
9401
+ const y = t.data.curved ? u : (m.get(S.id) || []).join(`
9391
9402
  `);
9392
9403
  C.push(
9393
9404
  this.generateTextChangeCommandsForRegion(
9394
- m.get(S.id) || 1,
9405
+ g.get(S.id) || 1,
9395
9406
  t.data,
9396
9407
  S.id,
9397
9408
  y
@@ -9436,7 +9447,7 @@ function Ms(r, t, e, a) {
9436
9447
  const n = e / r, i = a / t;
9437
9448
  return n > 1 && i > 1 ? Math.min(n, i) : n > 1 && i < 1 ? i : n < 1 && i > 1 ? n : Math.min(n, i);
9438
9449
  }
9439
- const Ha = {
9450
+ const qa = {
9440
9451
  m: ["x", "y"],
9441
9452
  z: [],
9442
9453
  l: ["x", "y"],
@@ -9466,7 +9477,7 @@ class Ts {
9466
9477
  const n = (i) => {
9467
9478
  const s = [], o = i.relative ? i.type : i.type.toUpperCase();
9468
9479
  let l = e !== o;
9469
- const c = Ha[i.type];
9480
+ const c = qa[i.type];
9470
9481
  l && (s.push(o), e = o);
9471
9482
  for (const d of c) {
9472
9483
  const A = i[d];
@@ -9491,7 +9502,7 @@ class Ts {
9491
9502
  const e = /([mzlhvcsqta])([^mzlhvcsqta]*)/gi, a = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, n = [];
9492
9503
  let i;
9493
9504
  for (e.lastIndex = 0; i = e.exec(t); ) {
9494
- const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c = Ha[s];
9505
+ const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c = qa[s];
9495
9506
  if (o.length < c.length)
9496
9507
  throw new xt(
9497
9508
  `Path type "${s}" given ${o.length} arguments, expected ${c.length}.`
@@ -9557,7 +9568,7 @@ class Ns extends Is {
9557
9568
  return this.svgElement(t, e);
9558
9569
  }
9559
9570
  svgElement(t, e) {
9560
- const a = qi(Ps), i = t !== "" ? ((w) => w.charAt(0).toUpperCase() + w.substr(1).toLowerCase())(t) : "", s = a.getPath(i, 0, 72, 72), o = s.toSVG(2), l = s.getBoundingBox(), c = l.x2 - l.x1, d = s.toPathData(3), A = () => {
9571
+ const a = Hi(Ps), i = t !== "" ? ((w) => w.charAt(0).toUpperCase() + w.substr(1).toLowerCase())(t) : "", s = a.getPath(i, 0, 72, 72), o = s.toSVG(2), l = s.getBoundingBox(), c = l.x2 - l.x1, d = s.toPathData(3), A = () => {
9561
9572
  const w = et("g");
9562
9573
  w.classList.add("module-text-group");
9563
9574
  const S = et("defs");
@@ -9576,19 +9587,19 @@ class Ns extends Is {
9576
9587
  u.classList.add("module-root");
9577
9588
  const h = et("defs");
9578
9589
  u.appendChild(h);
9579
- const m = et("g");
9580
- m.classList.add("module-bounds"), u.appendChild(m);
9581
- const g = Ds(e.height, e.width);
9582
- g.setAttribute("opacity", "0"), m.appendChild(g);
9590
+ const g = et("g");
9591
+ g.classList.add("module-bounds"), u.appendChild(g);
9592
+ const m = Ds(e.height, e.width);
9593
+ m.setAttribute("opacity", "0"), g.appendChild(m);
9583
9594
  const p = et("g");
9584
9595
  p.classList.add("module-text-enclosure"), u.appendChild(p);
9585
9596
  const f = A();
9586
9597
  p.appendChild(f);
9587
- const C = mr(d);
9598
+ const C = gr(d);
9588
9599
  return ks(p, C, e.height, e.width, 0.35, 0.65), Fs(u.outerHTML);
9589
9600
  }
9590
9601
  }
9591
- async function qn(r) {
9602
+ async function Hn(r) {
9592
9603
  if (r === "Vegemite")
9593
9604
  return new Ns();
9594
9605
  throw new z(`Failed to resolve Module, Module ${r} not found`);
@@ -9765,7 +9776,7 @@ const ne = v`
9765
9776
  }
9766
9777
  }
9767
9778
  }
9768
- `, Us = (r) => v`
9779
+ `, Ls = (r) => v`
9769
9780
  ${ne}
9770
9781
  ${re(r)}
9771
9782
  query GetBundle($id: String!) {
@@ -9809,7 +9820,7 @@ const ne = v`
9809
9820
  quoteId
9810
9821
  }
9811
9822
  }
9812
- `, qa = v`
9823
+ `, Ha = v`
9813
9824
  query GetBundleStakeholders($id: String!) {
9814
9825
  bundles(ids: [$id]) {
9815
9826
  id
@@ -9854,7 +9865,7 @@ const ne = v`
9854
9865
  }
9855
9866
  }
9856
9867
  }
9857
- `, Ls = v`
9868
+ `, Us = v`
9858
9869
  query GetBundlesForCustomer($id: String!) {
9859
9870
  customers(ids: [$id]) {
9860
9871
  bundleStakeholders {
@@ -10015,7 +10026,7 @@ const ne = v`
10015
10026
  }
10016
10027
  }
10017
10028
  }
10018
- `, Hs = v`
10029
+ `, qs = v`
10019
10030
  mutation UpdateBundle(
10020
10031
  $id: String!
10021
10032
  $name: String
@@ -10035,7 +10046,7 @@ const ne = v`
10035
10046
  id
10036
10047
  }
10037
10048
  }
10038
- `, qs = v`
10049
+ `, Hs = v`
10039
10050
  mutation BundleAddTransaction($id: String!, $transactionId: String!) {
10040
10051
  bundleAddTransaction(id: $id, transactionId: $transactionId) {
10041
10052
  id
@@ -10278,19 +10289,18 @@ class Ya extends Dn {
10278
10289
  });
10279
10290
  }
10280
10291
  }
10281
- class mo {
10282
- constructor(t, e, a, n, i, s, o, l, c, d, A, u, h, m = !1, g, p = !1, f = !1, C = !1) {
10292
+ class go {
10293
+ constructor(t, e, a, n, i, s, o, l, c, d, A, u, h, g = !1, m, p = !1, f = !1, C = !1) {
10283
10294
  var w;
10284
10295
  this.workflowStatePromiseQueue = new xn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.renderLayouts = () => {
10285
10296
  var E;
10286
- if (console.log("LOG: render layouts"), !this.previewService)
10297
+ if (!this.previewService)
10287
10298
  return;
10288
- console.log("LOG: render layouts: service exists");
10289
10299
  const S = this.getCommandContext().getAllLayouts(), y = (E = this.getLayoutPreviewService()) == null ? void 0 : E.getAll();
10290
10300
  if (console.log(`LOG: render layouts: ${y == null ? void 0 : y.size} handles`), !!y)
10291
10301
  for (const [, B] of y)
10292
10302
  B.render(S);
10293
- }, this.experience = t, this.client = e, this.updateTransaction = o, this.graphQlClient = l, this.commandContext = s, this.reloadedState = h, this.transaction = c, this.readOnly = m, this.singleVariantsRenderable = f, this.confirmedDesign = !1, this.editedSteps = {}, this.informationResults = [], this.mandatorySteps = {}, this.pendingUpdates = [], this.selectionCost = 0, this.workflow = a, this.stepSpecificServices = {}, this.profanityFilter = n, this.pollers = [], this.allScenes = [], this.layouts = i, this.product = d, this.previewService = A, this.modelContainer = g, this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, this.validationErrors = { steps: /* @__PURE__ */ new Map() }, this.confirmCallbacks = [], this.editedCallbacks = [], this.elementsCallbacks = [], this.informationResultCallbacks = [], this.initCallbacks = [], this.mandatoryCallbacks = [], this.makingAdjustmentsCallback = [], this.metadataCallbacks = [], this.selectionCallbacks = [], this.stepSpecificStorageCallbacks = {}, this.storageCallbacks = [], this.validationCallbacks = [], this.recipientCallbacks = [], this.currentAdjustingStepId = "", this.renderableContextService = u, (w = this.renderableContextService) == null || w.setWorkflowManager(this), this.isReloadedTransaction = p, this.workflow.steps.forEach((S) => {
10303
+ }, 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) => {
10294
10304
  this.stepTags[S.stepName] = S.tags ?? [];
10295
10305
  }), C && (this.workflowStatePromiseQueue.enabled = !1), this.initializationPromise = this.initializeDefaultWorkflowState(a), this.initializationPromise.then(() => {
10296
10306
  this.initialized = !0;
@@ -10306,7 +10316,7 @@ class mo {
10306
10316
  return { recipient: this.transaction.recipient };
10307
10317
  }
10308
10318
  async updateRecipient(t, e, a, n, i, s, o, l, c, d) {
10309
- var A, u, h, m, g;
10319
+ var A, u, h, g, m;
10310
10320
  if ((A = this.transaction.recipient) != null && A.id)
10311
10321
  this.transaction.recipient = {
10312
10322
  id: this.transaction.recipient.id,
@@ -10374,7 +10384,7 @@ class mo {
10374
10384
  fetchPolicy: "no-cache",
10375
10385
  variables: {
10376
10386
  id: this.transaction.id,
10377
- recipientId: (g = (m = p.data) == null ? void 0 : m.recipientCreate) == null ? void 0 : g.id
10387
+ recipientId: (m = (g = p.data) == null ? void 0 : g.recipientCreate) == null ? void 0 : m.id
10378
10388
  },
10379
10389
  context: {
10380
10390
  transactionOwnerId: this.transaction.transactionOwnerId
@@ -10394,7 +10404,7 @@ class mo {
10394
10404
  };
10395
10405
  this.reloadedState && this.reloadedState.serializableWorkflow.steps.forEach((o) => {
10396
10406
  this.storage[o.stepName] = o.storage || {};
10397
- }), this.allScenes = await Ui(t);
10407
+ }), this.allScenes = await Li(t);
10398
10408
  const n = Dt(this.allScenes, this.stepSelections).map((o) => o.silentSteps).flat(), { stepElements: i, commands: s } = await this.stepElementsForIntroducedSilentSteps(n, !!this.reloadedState);
10399
10409
  this.commandContext.apply(new $(s), !0), this.stepElements = { ...this.stepElements, ...i }, await this.ensureStepsAreLoaded(), !this.isReloadedTransaction && this.updateStateWithServer(), this.renderLayouts(), this.reloadedState && e();
10400
10410
  }
@@ -10636,12 +10646,12 @@ class mo {
10636
10646
  console.error(`Failed to read material from variant: ${l.id} for step: ${s.stepName}`);
10637
10647
  return;
10638
10648
  }
10639
- s.data.targetMaterials.forEach((m) => {
10649
+ s.data.targetMaterials.forEach((g) => {
10640
10650
  if (!this.modelContainer)
10641
10651
  throw new z(
10642
10652
  "We should always have a model container when injecting a preview!"
10643
10653
  );
10644
- this.modelContainer.applyMaterialVariant(m, s.option.id, u);
10654
+ this.modelContainer.applyMaterialVariant(g, s.option.id, u);
10645
10655
  });
10646
10656
  }
10647
10657
  }), await a.getInitializationPromise(), this.renderLayouts();
@@ -10865,18 +10875,18 @@ class mo {
10865
10875
  c.forEach((E) => {
10866
10876
  yt(E, this.stepSelections) || (this.stepInitialised[E.stepName] = !1);
10867
10877
  });
10868
- const u = this.getInvalidCanvasRegions(), { stepElements: h, commands: m } = await this.stepElementsForIntroducedSilentSteps(A, !1);
10878
+ const u = this.getInvalidCanvasRegions(), { stepElements: h, commands: g } = await this.stepElementsForIntroducedSilentSteps(A, !1);
10869
10879
  this.stepElements = {
10870
10880
  ...this.stepElements,
10871
10881
  ...h,
10872
10882
  [t]: a
10873
10883
  }, this.removeElements(u);
10874
- const g = this.workflow.steps.find((E) => E.stepName === t);
10875
- if ((g == null ? void 0 : g.type) === P.Frame) {
10876
- const E = (y = this.getWorkflowExperience().getStepById(g.stepName)) == null ? void 0 : y.frameService;
10884
+ const m = this.workflow.steps.find((E) => E.stepName === t);
10885
+ if ((m == null ? void 0 : m.type) === P.Frame) {
10886
+ const E = (y = this.getWorkflowExperience().getStepById(m.stepName)) == null ? void 0 : y.frameService;
10877
10887
  E == null || E.setTargetElements(a.map((B) => B.id));
10878
10888
  }
10879
- const p = u.map((E) => new Bt(E.id)), f = new za(this.constructSerializableWorkflow()), C = [...m, ...p, f];
10889
+ const p = u.map((E) => new Bt(E.id)), f = new za(this.constructSerializableWorkflow()), C = [...g, ...p, f];
10880
10890
  C.length > 0 && this.commandContext.apply(new $(C), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
10881
10891
  const w = this.getInvalidModelVariants(), S = this.modelContainer;
10882
10892
  if (S) {
@@ -10895,8 +10905,9 @@ class mo {
10895
10905
  }
10896
10906
  async ensureStepsAreLoaded() {
10897
10907
  const e = Dt(this.allScenes, this.stepSelections).map((l) => l.renderableSteps), a = [], n = e.flat();
10908
+ console.log(`LOG: ensure ${n.length} steps loaded`);
10898
10909
  for (const l of n)
10899
- if (!this.stepInitialised[l.stepName])
10910
+ if (console.log(`LOG: is ${l.stepTitle} (${l.stepName}) inited? ${this.stepInitialised[l.stepName]}`), !this.stepInitialised[l.stepName])
10900
10911
  switch (this.stepInitialised[l.stepName] = !0, l.type) {
10901
10912
  case P.DigitalContent:
10902
10913
  a.push(
@@ -10912,7 +10923,7 @@ class mo {
10912
10923
  break;
10913
10924
  case P.Illustration:
10914
10925
  a.push(
10915
- ge.init(l, this, this.reloadedState)
10926
+ me.init(l, this, this.reloadedState)
10916
10927
  );
10917
10928
  break;
10918
10929
  case P.Material:
@@ -10925,7 +10936,7 @@ class mo {
10925
10936
  break;
10926
10937
  case P.Module:
10927
10938
  this.stepSpecificServices[l.stepName] = {
10928
- module: await qn(l.data.module)
10939
+ module: await Hn(l.data.module)
10929
10940
  }, a.push(
10930
10941
  Wn.init(l, this, this.reloadedState)
10931
10942
  );
@@ -10937,14 +10948,14 @@ class mo {
10937
10948
  break;
10938
10949
  case P.Question:
10939
10950
  a.push(
10940
- Hn.init(l, this, this.reloadedState)
10951
+ qn.init(l, this, this.reloadedState)
10941
10952
  );
10942
10953
  break;
10943
10954
  case P.Shape:
10944
10955
  a.push(Gt.init(l, this, this.reloadedState));
10945
10956
  break;
10946
10957
  case P.Text:
10947
- a.push(j.init(l, this, this.reloadedState));
10958
+ console.log("LOG: ensure text loaded"), a.push(j.init(l, this, this.reloadedState));
10948
10959
  break;
10949
10960
  }
10950
10961
  const i = (await Promise.allSettled(a)).map((l) => {
@@ -11223,7 +11234,7 @@ const Yn = class la {
11223
11234
  };
11224
11235
  Yn.updateState = /* @__PURE__ */ new Map();
11225
11236
  let it = Yn;
11226
- class go extends it {
11237
+ class mo extends it {
11227
11238
  constructor(t, e, a) {
11228
11239
  super(t, e, a);
11229
11240
  }
@@ -11234,7 +11245,7 @@ class go extends it {
11234
11245
  */
11235
11246
  async selectVariant(t) {
11236
11247
  if (!this.getUpdateState() && this.getCurrentVariant() !== t)
11237
- return ge.selectVariant(
11248
+ return me.selectVariant(
11238
11249
  this.step,
11239
11250
  t.getResource(),
11240
11251
  this.manager.getRegionElements(this.step.stepName) || [],
@@ -11251,7 +11262,7 @@ class go extends it {
11251
11262
  const t = this.manager.getRegionElements(this.step.stepName) || [];
11252
11263
  if (t.length === 0)
11253
11264
  return;
11254
- 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) || [];
11265
+ 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) || [];
11255
11266
  if (s.length !== 0) {
11256
11267
  const l = {};
11257
11268
  return s.forEach((c) => {
@@ -11280,7 +11291,7 @@ class go extends it {
11280
11291
  const d = c.id.replace(/\W/g, "");
11281
11292
  a ? n.set(d, { browserValue: e, pmsValue: a }) : n.set(d, e);
11282
11293
  }
11283
- }) : a ? n.set(t, { browserValue: e, pmsValue: a }) : n.set(t, e), ge.changeColors(
11294
+ }) : a ? n.set(t, { browserValue: e, pmsValue: a }) : n.set(t, e), me.changeColors(
11284
11295
  this.step,
11285
11296
  this.manager.getRegionElements(this.step.stepName),
11286
11297
  this.manager,
@@ -11292,7 +11303,7 @@ class go extends it {
11292
11303
  return this.step.data.colorOption;
11293
11304
  }
11294
11305
  getAvailableColors() {
11295
- return this.step.data.colorPickerEnabled ? ge.availableColors(this.step, this.manager) : Promise.resolve([]);
11306
+ return this.step.data.colorPickerEnabled ? me.availableColors(this.step, this.manager) : Promise.resolve([]);
11296
11307
  }
11297
11308
  isColorPickerEnabled() {
11298
11309
  return this.step.data.colorPickerEnabled ?? !1;
@@ -11352,7 +11363,7 @@ class wo extends it {
11352
11363
  async selectVariant(t) {
11353
11364
  if (!t.getId())
11354
11365
  throw new Error("Unable to select variant with a null ID");
11355
- await Hn.selectVariant(this.step, t.getId(), this.manager);
11366
+ await qn.selectVariant(this.step, t.getId(), this.manager);
11356
11367
  }
11357
11368
  /**
11358
11369
  * The way that this step expects to be rendered.
@@ -11720,7 +11731,7 @@ class ce {
11720
11731
  case P.Text:
11721
11732
  return new So(t, e, t.getStepTags(e.stepName));
11722
11733
  case P.Illustration:
11723
- return new go(t, e, t.getStepTags(e.stepName));
11734
+ return new mo(t, e, t.getStepTags(e.stepName));
11724
11735
  case P.Picture:
11725
11736
  return new Co(t, e, t.getStepTags(e.stepName));
11726
11737
  case P.Shape:
@@ -11935,10 +11946,10 @@ const Po = async (r, t) => {
11935
11946
  }
11936
11947
  return n;
11937
11948
  }, Kn = (r, t, e, a, n, i, s, o) => {
11938
- var m, g;
11949
+ var g, m;
11939
11950
  const l = t.basePrice || 0, c = r.priceModifierTotal || 0, d = xo(a, e, void 0, i), u = (N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(r.id), h = {
11940
- additionalExternalProductId: (m = r.integrationProduct) == null ? void 0 : m.additionalExternalProductId,
11941
- additionalExternalVariantId: (g = r.integrationProduct) == null ? void 0 : g.additionalExternalVariantId,
11951
+ additionalExternalProductId: (g = r.integrationProduct) == null ? void 0 : g.additionalExternalProductId,
11952
+ additionalExternalVariantId: (m = r.integrationProduct) == null ? void 0 : m.additionalExternalVariantId,
11942
11953
  baseCost: l,
11943
11954
  designExternalVariants: r.designExternalVariants,
11944
11955
  designProductId: r.externalDesignProductId,
@@ -11978,29 +11989,29 @@ const Po = async (r, t) => {
11978
11989
  T.errors && console.log("Server Error:", tt.message);
11979
11990
  }), null) : nt ?? null;
11980
11991
  })() || (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"));
11981
- 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) => {
11992
+ 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) => {
11982
11993
  const x = {};
11983
11994
  let k = 0;
11984
11995
  if (Object.keys(i).length > 0)
11985
11996
  for (const T of Object.keys(i)) {
11986
11997
  const nt = i[T], R = t.steps.find((tt) => tt.stepName === T);
11987
11998
  for (let tt = 0; tt < nt.selections.length; ++tt) {
11988
- const H = nt.selections[tt];
11999
+ const q = nt.selections[tt];
11989
12000
  if (R && (!D || R.option && (R.option.variants || []).length > 1 && !R.data.hideSelectionInCart && !R.data.hideSelectionsInCart)) {
11990
12001
  const ft = R.stepTitle;
11991
12002
  x[ft] ? x[ft].push({
11992
- id: H.id || "",
11993
- name: H.name,
11994
- priceModifier: H.priceModifier
12003
+ id: q.id || "",
12004
+ name: q.name,
12005
+ priceModifier: q.priceModifier
11995
12006
  }) : x[ft] = [
11996
12007
  {
11997
- id: H.id || "",
11998
- name: H.name,
11999
- priceModifier: H.priceModifier
12008
+ id: q.id || "",
12009
+ name: q.name,
12010
+ priceModifier: q.priceModifier
12000
12011
  }
12001
12012
  ];
12002
12013
  }
12003
- k += H.priceModifier;
12014
+ k += q.priceModifier;
12004
12015
  }
12005
12016
  }
12006
12017
  return [x, k];
@@ -12012,10 +12023,10 @@ const Po = async (r, t) => {
12012
12023
  S[D].map((x) => x.id)
12013
12024
  ])
12014
12025
  );
12015
- let E = await o(m, n.id);
12026
+ let E = await o(g, n.id);
12016
12027
  if (E) {
12017
12028
  const D = await (await rt(E)).blob();
12018
- E = (await U.uploadAsset(
12029
+ E = (await L.uploadAsset(
12019
12030
  { name: `${n.id}-preview-image.png`, blob: D },
12020
12031
  Ce.Image,
12021
12032
  !0,
@@ -12032,7 +12043,7 @@ const Po = async (r, t) => {
12032
12043
  })),
12033
12044
  workflowId: t.id,
12034
12045
  transactionId: n.id,
12035
- useThreeDimPreview: !!m,
12046
+ useThreeDimPreview: !!g,
12036
12047
  previewImage: E
12037
12048
  };
12038
12049
  if (p) {
@@ -12050,7 +12061,7 @@ const Po = async (r, t) => {
12050
12061
  return D;
12051
12062
  })(),
12052
12063
  cartSelectionsWithPrices: C,
12053
- cartMetadata: g
12064
+ cartMetadata: m
12054
12065
  };
12055
12066
  }, Fo = async (r, t, e, a, n, i, s, o, l, c, d) => {
12056
12067
  var f, C;
@@ -12067,20 +12078,20 @@ const Po = async (r, t) => {
12067
12078
  d
12068
12079
  );
12069
12080
  l("workflow.steps.finish.finalize.creatingDesign");
12070
- const m = await Po(A), g = (f = m == null ? void 0 : m.transaction) == null ? void 0 : f.previewImageLink;
12071
- if (!(m != null && m.transaction))
12081
+ const g = await Po(A), m = (f = g == null ? void 0 : g.transaction) == null ? void 0 : f.previewImageLink;
12082
+ if (!(g != null && g.transaction))
12072
12083
  throw new Error("Failed to create design");
12073
12084
  l("workflow.steps.finish.finalize.updatingTransaction");
12074
- const p = m.transaction;
12085
+ const p = g.transaction;
12075
12086
  return Kn(
12076
12087
  p,
12077
12088
  n,
12078
12089
  t,
12079
12090
  u,
12080
- m == null ? void 0 : m.sku,
12091
+ g == null ? void 0 : g.sku,
12081
12092
  h,
12082
- g,
12083
- (C = m == null ? void 0 : m.processExecution) == null ? void 0 : C.id
12093
+ m,
12094
+ (C = g == null ? void 0 : g.processExecution) == null ? void 0 : C.id
12084
12095
  );
12085
12096
  }, ko = async (r, t, e) => {
12086
12097
  t("workflow.steps.finish.finalize.buildingLayouts"), await Promise.all(
@@ -12265,7 +12276,7 @@ class Oo {
12265
12276
  throw new Error("No Workflow ID provided.");
12266
12277
  this.client = t;
12267
12278
  const a = e.layouts;
12268
- this.commandContext = new rs(), this.commandContext.initialize(a, e.reloadedState), this.isReadOnly = e.transaction.isOrdered || !!e.readOnly, this.graphQlClient = e.graphQlClient, this.workflowManager = new mo(
12279
+ this.commandContext = new rs(), this.commandContext.initialize(a, e.reloadedState), this.isReadOnly = e.transaction.isOrdered || !!e.readOnly, this.graphQlClient = e.graphQlClient, this.workflowManager = new go(
12269
12280
  this,
12270
12281
  t,
12271
12282
  e.workflow,
@@ -12355,7 +12366,7 @@ class Oo {
12355
12366
  }
12356
12367
  let i = 2048;
12357
12368
  e && e <= 2048 && (i = e);
12358
- const s = gt(i, i), o = this.commandContext.getAllLayouts(), l = a.defaultPreviewPanelIndex || 0, c = a.panels[l], d = o.find((S) => {
12369
+ const s = mt(i, i), o = this.commandContext.getAllLayouts(), l = a.defaultPreviewPanelIndex || 0, c = a.panels[l], d = o.find((S) => {
12359
12370
  var y;
12360
12371
  return ((y = S.layoutState) == null ? void 0 : y.layout.panelId) === (c == null ? void 0 : c.name);
12361
12372
  }) || o[0], A = d.layoutState.layout.previewRegion ? {
@@ -12371,19 +12382,19 @@ class Oo {
12371
12382
  }, u = this.commandContext.getLayoutById(d.layoutState.layout.id), h = s.getContext("2d");
12372
12383
  if (!h)
12373
12384
  throw new xe("Failed to obtain 2D context for preview image creation");
12374
- const m = Sa(u.layoutState.layout, u.layoutState.elements, {
12385
+ const g = Sa(u.layoutState.layout, u.layoutState.elements, {
12375
12386
  renderingConfiguration: {
12376
- purpose: Ht.Print,
12387
+ purpose: qt.Print,
12377
12388
  region: { left: A.x, top: A.y, width: A.width, height: A.height },
12378
12389
  templatingContext: this.workflowManager.getTemplatingContext()
12379
12390
  }
12380
- }), g = un(m);
12381
- await (await Aa.from(h, g, {
12391
+ }), m = un(g);
12392
+ await (await Aa.from(h, m, {
12382
12393
  anonymousCrossOrigin: !0,
12383
12394
  ignoreDimensions: !1,
12384
- createCanvas: gt,
12395
+ createCanvas: mt,
12385
12396
  createImage: Zt,
12386
- DOMParser: ga(),
12397
+ DOMParser: ma(),
12387
12398
  fetch
12388
12399
  })).render();
12389
12400
  const f = await this.getCanvasObjectURLAsync(s);
@@ -12482,16 +12493,16 @@ class Oo {
12482
12493
  const d = /* @__PURE__ */ new Set(), A = c.getRaw().globalPropertyAspectConfigurations;
12483
12494
  A !== void 0 && (A.forEach((u) => d.add(JSON.stringify(u))), o.forEach((u) => {
12484
12495
  const h = u.getRaw().globalPropertyAspectConfigurations;
12485
- h !== void 0 && h.forEach((m) => {
12486
- const g = l(m), p = d.has(JSON.stringify(m));
12487
- if (p && (g == null ? void 0 : g.getType()) === "Option") {
12496
+ h !== void 0 && h.forEach((g) => {
12497
+ const m = l(g), p = d.has(JSON.stringify(g));
12498
+ if (p && (m == null ? void 0 : m.getType()) === "Option") {
12488
12499
  const f = u.getCurrentVariant();
12489
12500
  if (!f)
12490
12501
  return;
12491
- c.selectVariant(f), d.delete(JSON.stringify(m));
12492
- } else if (p && (g == null ? void 0 : g.getType()) === "Text") {
12502
+ c.selectVariant(f), d.delete(JSON.stringify(g));
12503
+ } else if (p && (m == null ? void 0 : m.getType()) === "Text") {
12493
12504
  const f = u.getText();
12494
- c.setText(f), d.delete(JSON.stringify(m));
12505
+ c.setText(f), d.delete(JSON.stringify(g));
12495
12506
  }
12496
12507
  });
12497
12508
  }));
@@ -12683,17 +12694,17 @@ const $o = [
12683
12694
  "textPath",
12684
12695
  "tref",
12685
12696
  "tspan"
12686
- ], Uo = async (r, t, e) => {
12697
+ ], Lo = async (r, t, e) => {
12687
12698
  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);
12688
12699
  o.searchParams.append("video", Qa(JSON.stringify([{ href: i }]))), o.pathname = o.pathname + (o.pathname.slice(-1) === "/" ? "" : "/");
12689
12700
  const l = o.toString(), d = `data:image/svg+xml;base64,${Qa(await sn(l, { type: "svg" }))}`, A = (h) => {
12690
- const m = r.find((p) => p.panelId === h.panelId);
12691
- if (!m)
12701
+ const g = r.find((p) => p.panelId === h.panelId);
12702
+ if (!g)
12692
12703
  throw new J(h);
12693
- const g = Q();
12704
+ const m = Q();
12694
12705
  return new W(
12695
12706
  {
12696
- id: g,
12707
+ id: m,
12697
12708
  src: d,
12698
12709
  type: M.Image,
12699
12710
  y: h.top,
@@ -12702,7 +12713,7 @@ const $o = [
12702
12713
  height: h.height,
12703
12714
  rotation: 0
12704
12715
  },
12705
- m
12716
+ g
12706
12717
  );
12707
12718
  }, u = e.data.regions;
12708
12719
  try {
@@ -12710,17 +12721,17 @@ const $o = [
12710
12721
  } catch (h) {
12711
12722
  return console.error(h), [];
12712
12723
  }
12713
- }, Lo = async (r, t, e, a) => {
12724
+ }, Uo = async (r, t, e, a) => {
12714
12725
  const n = e.data, i = n.assetUrl, s = await sa(i);
12715
12726
  try {
12716
12727
  const o = is(n, a.option);
12717
12728
  o && (t[a.stepName] = { selectedVariants: [o] });
12718
12729
  const l = async (c) => {
12719
- var g;
12720
- const d = await Rn(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);
12730
+ var m;
12731
+ const d = await Rn(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);
12721
12732
  if (!h)
12722
12733
  throw new J(c);
12723
- const m = Ea(
12734
+ const g = Ea(
12724
12735
  s,
12725
12736
  A,
12726
12737
  {
@@ -12749,13 +12760,13 @@ const $o = [
12749
12760
  pattern: {
12750
12761
  id: `${u}-pattern`,
12751
12762
  src: s.src,
12752
- x: m.x,
12753
- y: m.y,
12763
+ x: g.x,
12764
+ y: g.y,
12754
12765
  width: s.width,
12755
12766
  height: s.height,
12756
12767
  rotation: 0,
12757
- scaleX: m.zoom,
12758
- scaleY: m.zoom,
12768
+ scaleX: g.zoom,
12769
+ scaleY: g.zoom,
12759
12770
  svg: s.svg,
12760
12771
  colors: s.colors
12761
12772
  }
@@ -12782,30 +12793,30 @@ const $o = [
12782
12793
  const o = (E = s.asset) == null ? void 0 : E.fileLink;
12783
12794
  if (!o)
12784
12795
  return console.error(`No asset link for variant with ID: ${n.illustrationVariantId}`), [];
12785
- 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;
12786
- if (!m)
12796
+ 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;
12797
+ if (!g)
12787
12798
  return console.error("Failed to read SVG."), [];
12788
- pa(m);
12789
- const g = {};
12790
- kt(m, (B) => {
12799
+ pa(g);
12800
+ const m = {};
12801
+ kt(g, (B) => {
12791
12802
  $o.includes(B.tagName) && !B.attributes.getNamedItem("fill") && B.setAttribute("fill", "#000000");
12792
12803
  const I = B.attributes.getNamedItem("fill");
12793
12804
  if (I && I.value !== "none") {
12794
12805
  const x = I.value, T = `spiff-fill-${x.replace(/\W/g, "")}`;
12795
- B.classList.add(T), g[T] = { browserValue: x };
12806
+ B.classList.add(T), m[T] = { browserValue: x };
12796
12807
  }
12797
12808
  const D = B.attributes.getNamedItem("stroke");
12798
12809
  if (D && D.value !== "none") {
12799
12810
  const x = D.value, T = `spiff-stroke-${x.replace(/\W/g, "")}`;
12800
- B.classList.add(T), g[T] = { browserValue: x };
12811
+ B.classList.add(T), m[T] = { browserValue: x };
12801
12812
  }
12802
12813
  });
12803
- const f = bt().serializeToString(m), C = n.colors;
12814
+ const f = bt().serializeToString(g), C = n.colors;
12804
12815
  if (C) {
12805
- for (const [B, I] of Object.entries(g))
12816
+ for (const [B, I] of Object.entries(m))
12806
12817
  for (const D of Object.keys(C))
12807
12818
  if (I.browserValue === D) {
12808
- g[B] = { browserValue: C[D] };
12819
+ m[B] = { browserValue: C[D] };
12809
12820
  break;
12810
12821
  }
12811
12822
  }
@@ -12816,7 +12827,7 @@ const $o = [
12816
12827
  const D = Q();
12817
12828
  return new W(
12818
12829
  {
12819
- colors: g,
12830
+ colors: m,
12820
12831
  id: D,
12821
12832
  svg: f,
12822
12833
  type: M.Illustration,
@@ -12838,7 +12849,7 @@ const $o = [
12838
12849
  return console.error(B), [];
12839
12850
  }
12840
12851
  }, Go = async (r, t, e) => {
12841
- const a = await qn(e.data.module), n = t.data, i = (o, l) => {
12852
+ const a = await Hn(e.data.module), n = t.data, i = (o, l) => {
12842
12853
  const c = r.find((A) => A.panelId === l.panelId);
12843
12854
  if (!c)
12844
12855
  throw new J(l);
@@ -12882,13 +12893,13 @@ const $o = [
12882
12893
  if (!o)
12883
12894
  return console.error(`No asset link for variant with ID: ${n.pictureVariantId}`), [];
12884
12895
  const l = (u) => {
12885
- const h = r.find((g) => g.panelId === u.panelId);
12896
+ const h = r.find((m) => m.panelId === u.panelId);
12886
12897
  if (!h)
12887
12898
  throw new J(u);
12888
- const m = Q();
12899
+ const g = Q();
12889
12900
  return new W(
12890
12901
  {
12891
- id: m,
12902
+ id: g,
12892
12903
  src: o,
12893
12904
  type: M.Image,
12894
12905
  y: u.top,
@@ -12942,11 +12953,11 @@ const $o = [
12942
12953
  fill="${s == null ? void 0 : s.color}"
12943
12954
  />
12944
12955
  </svg>
12945
- `, m = { "spiff-fill-shape": { browserValue: s.color || "#000000" } }, g = Q();
12956
+ `, g = { "spiff-fill-shape": { browserValue: s.color || "#000000" } }, m = Q();
12946
12957
  return new W(
12947
12958
  {
12948
- colors: m,
12949
- id: g,
12959
+ colors: g,
12960
+ id: m,
12950
12961
  svg: u,
12951
12962
  type: M.Illustration,
12952
12963
  y: d.top,
@@ -13001,13 +13012,13 @@ const $o = [
13001
13012
  }
13002
13013
  else {
13003
13014
  const c = await at(i, !0), d = (A) => {
13004
- 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;
13015
+ 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;
13005
13016
  if (!f)
13006
13017
  throw new xt("Failed to read SVG.");
13007
13018
  return pa(f), bt().serializeToString(f);
13008
13019
  };
13009
13020
  l.forEach((A) => {
13010
- const u = r.find((m) => m.panelId === A.panelId);
13021
+ const u = r.find((g) => g.panelId === A.panelId);
13011
13022
  if (!u)
13012
13023
  throw new J(A);
13013
13024
  const h = {
@@ -13033,7 +13044,7 @@ const $o = [
13033
13044
  });
13034
13045
  }
13035
13046
  return a;
13036
- }, Ho = async (r, t, e, a) => {
13047
+ }, qo = async (r, t, e, a) => {
13037
13048
  const n = [], i = e.data, s = 30, o = (p) => p.vertical ? "center" : p.textAlign || "center", l = () => {
13038
13049
  var w;
13039
13050
  const p = a.option;
@@ -13064,8 +13075,8 @@ const $o = [
13064
13075
  return;
13065
13076
  const C = Y.getDefaultVariant(f);
13066
13077
  return C == null ? void 0 : C.color;
13067
- }, m = i.color || await h(a.data), g = a.data.regions;
13068
- for (const p of g) {
13078
+ }, g = i.color || await h(a.data), m = a.data.regions;
13079
+ for (const p of m) {
13069
13080
  const f = r.find((w) => w.panelId === p.panelId);
13070
13081
  if (!f)
13071
13082
  continue;
@@ -13074,7 +13085,7 @@ const $o = [
13074
13085
  id: Q(),
13075
13086
  align: o(a.data),
13076
13087
  curved: a.data.curved,
13077
- fill: i.color || m || "#000000",
13088
+ fill: i.color || g || "#000000",
13078
13089
  fontData: d,
13079
13090
  fontSize: a.data.size || s,
13080
13091
  height: p.height,
@@ -13122,7 +13133,7 @@ const $o = [
13122
13133
  n.push(new W(C, f));
13123
13134
  }
13124
13135
  return n;
13125
- }, qo = (r, t) => r.conditions ? r.conditions.every((e) => {
13136
+ }, Ho = (r, t) => r.conditions ? r.conditions.every((e) => {
13126
13137
  const a = t[e.targetStepName];
13127
13138
  if (a && a.selectedVariants) {
13128
13139
  const n = a.selectedVariants;
@@ -13139,13 +13150,13 @@ const $o = [
13139
13150
  switch (o.type) {
13140
13151
  case P.DigitalContent:
13141
13152
  n.push(
13142
- ...await Uo(e, s, o)
13153
+ ...await Lo(e, s, o)
13143
13154
  );
13144
13155
  break;
13145
13156
  case P.Frame:
13146
13157
  case P.Photo:
13147
13158
  n.push(
13148
- ...await Lo(e, i, s, o)
13159
+ ...await Uo(e, i, s, o)
13149
13160
  );
13150
13161
  break;
13151
13162
  case P.Illustration:
@@ -13173,13 +13184,13 @@ const $o = [
13173
13184
  break;
13174
13185
  case P.Text:
13175
13186
  n.push(
13176
- ...await Ho(e, i, s, o)
13187
+ ...await qo(e, i, s, o)
13177
13188
  );
13178
13189
  break;
13179
13190
  }
13180
13191
  }
13181
13192
  for (const s of t.steps)
13182
- s.type !== P.SilentIllustration && s.type !== P.ProductOverlay || qo(s, i) && n.push(
13193
+ s.type !== P.SilentIllustration && s.type !== P.ProductOverlay || Ho(s, i) && n.push(
13183
13194
  ...await jo(e, s, a)
13184
13195
  );
13185
13196
  return n;
@@ -13219,7 +13230,7 @@ class Jo {
13219
13230
  }
13220
13231
  const Ko = () => new Promise((r, t) => {
13221
13232
  try {
13222
- const a = gt().getContext("webgl2");
13233
+ const a = mt().getContext("webgl2");
13223
13234
  r(!!a);
13224
13235
  } catch {
13225
13236
  r(!1);
@@ -13332,23 +13343,23 @@ class Zo extends Dn {
13332
13343
  * a loose target but should be kept in mind when making changes.
13333
13344
  */
13334
13345
  async execute() {
13335
- var h, m;
13336
- const t = this.layouts.find((g) => g.layoutState.layout.id === this.layoutId);
13346
+ var h, g;
13347
+ const t = this.layouts.find((m) => m.layoutState.layout.id === this.layoutId);
13337
13348
  if (!t)
13338
13349
  return;
13339
13350
  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;
13340
13351
  let l, c;
13341
13352
  if (this.nonPOTSupport) {
13342
- const g = s / o;
13343
- a / n < g ? (l = s, c = n * (s / a)) : (l = a * (o / n), c = o);
13353
+ const m = s / o;
13354
+ a / n < m ? (l = s, c = n * (s / a)) : (l = a * (o / n), c = o);
13344
13355
  const f = this.resizeFit({ width: l, height: c });
13345
13356
  l = f.width, c = f.height;
13346
13357
  } else
13347
13358
  l = i.width, c = i.height;
13348
13359
  const d = Sa(t.layoutState.layout, e, {
13349
13360
  renderingConfiguration: {
13350
- purpose: Ht.ThreeD,
13351
- templatingContext: (m = (h = this.getWorkflowManager) == null ? void 0 : h.call(this)) == null ? void 0 : m.getTemplatingContext()
13361
+ purpose: qt.ThreeD,
13362
+ templatingContext: (g = (h = this.getWorkflowManager) == null ? void 0 : h.call(this)) == null ? void 0 : g.getTemplatingContext()
13352
13363
  }
13353
13364
  }), A = un(d), u = await Aa.from(this.ctx, A, {
13354
13365
  anonymousCrossOrigin: !0,
@@ -13357,9 +13368,9 @@ class Zo extends Dn {
13357
13368
  ignoreClear: !0,
13358
13369
  ignoreMouse: !0,
13359
13370
  enableRedraw: !1,
13360
- createCanvas: gt,
13371
+ createCanvas: mt,
13361
13372
  createImage: Zt,
13362
- DOMParser: ga(),
13373
+ DOMParser: ma(),
13363
13374
  fetch
13364
13375
  });
13365
13376
  u.resize(l, c), await u.render(), this.onRender();
@@ -13381,7 +13392,7 @@ const Xc = (r, t) => {
13381
13392
  serializableWorkflow: { steps: [] },
13382
13393
  layouts: {}
13383
13394
  };
13384
- n = new $(e.map((l) => new Un(l))).apply(n);
13395
+ n = new $(e.map((l) => new Ln(l))).apply(n);
13385
13396
  const s = await Yo(r, t, e, a);
13386
13397
  return new $(s).apply(n);
13387
13398
  };
@@ -13486,18 +13497,20 @@ class Ia {
13486
13497
  * Returns all steps that share this property.
13487
13498
  * @param targetExperiences Optionally filter the steps to only those in the given experiences.
13488
13499
  */
13489
- getSharedSteps(t) {
13490
- return (t ?? this.bundle.getWorkflowExperiences()).flatMap(
13491
- (n) => n.getStepsConditionallyActive().filter((i) => {
13492
- var s;
13493
- return i.getOverrideGlobalPropertyConfiguration(this.property.type) ? !1 : (s = i.getRaw().globalPropertyAspectConfigurations) == null ? void 0 : s.some(
13494
- (o) => {
13495
- var l, c;
13496
- return o.globalPropertyConfigurationId === ((c = (l = this.bundle.getProductCollection()) == null ? void 0 : l.getResource().globalPropertyConfiguration) == null ? void 0 : c.id) && o.aspectName === this.property.name;
13500
+ getSharedSteps(t, e) {
13501
+ const a = t ?? this.bundle.getWorkflowExperiences();
13502
+ return console.log(`LOG: getting shared steps from ${a.length} experiences`), a.flatMap((i) => {
13503
+ const s = e ? i.getSteps() : i.getStepsConditionallyActive();
13504
+ return console.log(`LOG: getting shared steps from ${s.length} active steps`), s.filter((o) => {
13505
+ var l;
13506
+ return o.getOverrideGlobalPropertyConfiguration(this.property.type) ? (console.log("LOG: getting shared steps? no"), !1) : (console.log("LOG: getting shared steps? maybe!"), (l = o.getRaw().globalPropertyAspectConfigurations) == null ? void 0 : l.some(
13507
+ (c) => {
13508
+ var d, A;
13509
+ return c.globalPropertyConfigurationId === ((A = (d = this.bundle.getProductCollection()) == null ? void 0 : d.getResource().globalPropertyConfiguration) == null ? void 0 : A.id) && c.aspectName === this.property.name;
13497
13510
  }
13498
- );
13499
- })
13500
- );
13511
+ ));
13512
+ });
13513
+ });
13501
13514
  }
13502
13515
  getStateValue() {
13503
13516
  return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
@@ -13569,7 +13582,7 @@ class el extends Ia {
13569
13582
  const e = await this.getOriginalImage();
13570
13583
  if (!e)
13571
13584
  throw new Error("You must supply an image selection before attempting to remove the background.");
13572
- const a = this.bundle.getGlobalPropertyStateManager(), n = await U.removeBackgroundFromAsset(e), s = {
13585
+ const a = this.bundle.getGlobalPropertyStateManager(), n = await L.removeBackgroundFromAsset(e), s = {
13573
13586
  ...a.getAspectStorage(this.property.name),
13574
13587
  backgroundRemovedAssetKey: n.key,
13575
13588
  useOriginalAsset: !t
@@ -13589,7 +13602,7 @@ class el extends Ia {
13589
13602
  async getImage() {
13590
13603
  const t = this.getStateValue();
13591
13604
  if (t)
13592
- return U.getLocalOrFromServer(t);
13605
+ return L.getLocalOrFromServer(t);
13593
13606
  }
13594
13607
  async getImageWithColors() {
13595
13608
  var t, e;
@@ -13602,7 +13615,7 @@ class el extends Ia {
13602
13615
  async getOriginalImage() {
13603
13616
  const t = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13604
13617
  if (t != null && t.originalAssetKey)
13605
- return U.getLocalOrFromServer(t.originalAssetKey);
13618
+ return L.getLocalOrFromServer(t.originalAssetKey);
13606
13619
  }
13607
13620
  /**
13608
13621
  * Retrieves the version of the image selection that has the background removed, if one exists.
@@ -13611,7 +13624,7 @@ class el extends Ia {
13611
13624
  async getBackgroundRemovedImage() {
13612
13625
  const t = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13613
13626
  if (t != null && t.backgroundRemovedAssetKey)
13614
- return U.getLocalOrFromServer(t.backgroundRemovedAssetKey);
13627
+ return L.getLocalOrFromServer(t.backgroundRemovedAssetKey);
13615
13628
  }
13616
13629
  getUseOriginalImage() {
13617
13630
  var t;
@@ -13643,26 +13656,26 @@ class el extends Ia {
13643
13656
  }
13644
13657
  o.push(this.loadImageData()), await Promise.all(o), this.updateSharedStepStorage(i);
13645
13658
  }
13646
- async applyGlobalState(t) {
13647
- const e = this.getStateValue();
13648
- if (!e)
13649
- return;
13650
- const a = await U.getLocalOrFromServer(e);
13659
+ async applyGlobalState(t, e) {
13660
+ const a = this.getStateValue();
13651
13661
  if (!a)
13652
13662
  return;
13653
- await this.applyImageSelection(a, t, !1, !0);
13654
- const n = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13655
- if (n) {
13656
- if (this.updateSharedStepStorage({ ...n }), n.colors) {
13657
- const i = new Map(
13658
- n.colors.map((s) => [s.key, { browserValue: s.browserValue, pmsValue: s.pmsValue }]) ?? []
13663
+ const n = await L.getLocalOrFromServer(a);
13664
+ if (!n)
13665
+ return;
13666
+ await this.applyImageSelection(n, t, !1, !0);
13667
+ const i = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13668
+ if (i) {
13669
+ if (this.updateSharedStepStorage({ ...i }), i.colors) {
13670
+ const s = new Map(
13671
+ i.colors.map((o) => [o.key, { browserValue: o.browserValue, pmsValue: o.pmsValue }]) ?? []
13659
13672
  );
13660
- this.getSharedSteps(t).forEach((s) => {
13661
- s.changeColors(i);
13673
+ this.getSharedSteps(t, e).forEach((o) => {
13674
+ o.changeColors(s);
13662
13675
  });
13663
13676
  }
13664
13677
  } else
13665
- this.updateSharedStepStorage({ originalAssetKey: e }), await this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { originalAssetKey: e });
13678
+ this.updateSharedStepStorage({ originalAssetKey: a }), await this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { originalAssetKey: a });
13666
13679
  }
13667
13680
  getAvailableColors() {
13668
13681
  var t, e, a, n;
@@ -13689,22 +13702,22 @@ class el extends Ia {
13689
13702
  var e;
13690
13703
  return (e = this.imageData) != null && e.svg ? (await lt(this.imageData.svg)).colors : void 0;
13691
13704
  }
13692
- async changeColors(t) {
13693
- var i;
13694
- if (!((i = this.imageData) != null && i.svg))
13705
+ async changeColors(t, e) {
13706
+ var s;
13707
+ if (!((s = this.imageData) != null && s.svg))
13695
13708
  return;
13696
- const e = this.getSharedSteps(), a = new Map(Object.entries(t));
13697
- e.forEach((s) => {
13698
- s.changeColors(a);
13709
+ const a = this.getSharedSteps(void 0, e), n = new Map(Object.entries(t));
13710
+ a.forEach((o) => {
13711
+ o.changeColors(n);
13699
13712
  });
13700
- const n = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13713
+ const i = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
13701
13714
  await Promise.all([
13702
13715
  this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, {
13703
- ...n,
13704
- colors: Object.entries(t).map(([s, o]) => ({
13705
- key: s,
13706
- browserValue: o.browserValue,
13707
- pmsValue: o.pmsValue
13716
+ ...i,
13717
+ colors: Object.entries(t).map(([o, l]) => ({
13718
+ key: o,
13719
+ browserValue: l.browserValue,
13720
+ pmsValue: l.pmsValue
13708
13721
  }))
13709
13722
  }),
13710
13723
  await this.loadImageData()
@@ -13754,10 +13767,10 @@ class al extends Ia {
13754
13767
  /**
13755
13768
  * Set the text.
13756
13769
  */
13757
- async setText(t) {
13770
+ async setText(t, e) {
13758
13771
  await Promise.all([
13759
13772
  this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t),
13760
- this.applyTextSelection(t)
13773
+ this.applyTextSelection(t, void 0, e)
13761
13774
  ]);
13762
13775
  }
13763
13776
  async applyGlobalState(t) {
@@ -13766,13 +13779,13 @@ class al extends Ia {
13766
13779
  return Promise.resolve();
13767
13780
  await this.applyTextSelection(e, t);
13768
13781
  }
13769
- async applyTextSelection(t, e) {
13770
- const a = this.getSharedSteps(e);
13771
- console.log(`LOG: ${a.length} shared steps`);
13772
- const n = a.map((i) => {
13773
- i.setText(t);
13782
+ async applyTextSelection(t, e, a) {
13783
+ const n = this.getSharedSteps(e, a);
13784
+ console.log(`LOG: ${n.length} shared steps`);
13785
+ const i = n.map((s) => {
13786
+ s.setText(t);
13774
13787
  });
13775
- await Promise.all(n);
13788
+ await Promise.all(i);
13776
13789
  }
13777
13790
  }
13778
13791
  class Xn extends Ia {
@@ -13831,10 +13844,10 @@ class Xn extends Ia {
13831
13844
  * Select a given variant on the option for all shared steps.
13832
13845
  * @param variant The variant to select.
13833
13846
  */
13834
- async selectVariant(t, e) {
13847
+ async selectVariant(t, e, a) {
13835
13848
  await Promise.all([
13836
13849
  this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t.getId(), void 0, e),
13837
- this.applyVariantSelection(t)
13850
+ this.applyVariantSelection(t, void 0, a)
13838
13851
  ]);
13839
13852
  }
13840
13853
  async applyGlobalState(t) {
@@ -13845,9 +13858,9 @@ class Xn extends Ia {
13845
13858
  const a = (i = (n = this.optionResource) == null ? void 0 : n.variants) == null ? void 0 : i.find((s) => s.id === e);
13846
13859
  return a ? this.applyVariantSelection(new st(a), t) : Promise.resolve();
13847
13860
  }
13848
- async applyVariantSelection(t, e) {
13849
- const n = this.getSharedSteps(e).map((i) => i.selectVariant(t));
13850
- await Promise.all(n);
13861
+ async applyVariantSelection(t, e, a) {
13862
+ const i = this.getSharedSteps(e, a).map((s) => s.selectVariant(t));
13863
+ await Promise.all(i);
13851
13864
  }
13852
13865
  }
13853
13866
  class Ja extends Xn {
@@ -13896,8 +13909,8 @@ class Ja extends Xn {
13896
13909
  /**
13897
13910
  * Sets a custom color on the global state.
13898
13911
  */
13899
- setCustomColor(t) {
13900
- this.getSharedSteps().forEach((a) => a.setCustomColor(t)), this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { customColor: t });
13912
+ setCustomColor(t, e) {
13913
+ this.getSharedSteps(void 0, e).forEach((n) => n.setCustomColor(t)), this.bundle.getGlobalPropertyStateManager().setAspectStorage(this.property.name, { customColor: t });
13901
13914
  }
13902
13915
  /**
13903
13916
  * Gets the custom color used by the global state.
@@ -14392,13 +14405,13 @@ class Zn {
14392
14405
  let A = !1;
14393
14406
  const u = c.subscribe({
14394
14407
  next(h) {
14395
- var g, p, f, C, w, S;
14396
- 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))
14408
+ var m, p, f, C, w, S;
14409
+ 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))
14397
14410
  return;
14398
14411
  o.abort(), A = !0, u.unsubscribe();
14399
- 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)))) || [];
14412
+ 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)))) || [];
14400
14413
  d({
14401
- items: m,
14414
+ items: g,
14402
14415
  // Clone items because it could be cached data (immutable)
14403
14416
  total: ((S = (w = h.data.productCollections) == null ? void 0 : w[0].productCollectionProductsFeed) == null ? void 0 : S.total) ?? 0
14404
14417
  });
@@ -14647,7 +14660,7 @@ const hl = v`
14647
14660
  }
14648
14661
  })).data) == null ? void 0 : e.productCollections) == null ? void 0 : a.map((n) => new Zn(n));
14649
14662
  };
14650
- class ml {
14663
+ class gl {
14651
14664
  constructor() {
14652
14665
  this.listeners = {};
14653
14666
  }
@@ -14674,7 +14687,7 @@ class ml {
14674
14687
  delete this.listeners[e];
14675
14688
  }
14676
14689
  }
14677
- const gl = v`
14690
+ const ml = v`
14678
14691
  mutation AddAddressToBundle(
14679
14692
  $bundleId: String!
14680
14693
  $streetAddress: String
@@ -14713,7 +14726,7 @@ const gl = v`
14713
14726
  class Je {
14714
14727
  constructor(t, e, a, n, i, s) {
14715
14728
  var c, d, A;
14716
- this.workflowExperiences = [], this.eventEmitter = new ml(), this.client = t, this.id = e.id, this.name = e.name || "", this.template = e.template || !1, this.quoteId = e.quoteId, this.shareActions = e.bundleShareActions, this.workflowViewerLink = e.workflowViewerLink, this.workflowViewerAmendLink = e.workflowViewerAmendLink, this.ownerId = i, this.metadata = new Map(((c = e.metadata) == null ? void 0 : c.map((u) => [u.key, u.value])) || []), this.completed = e.completed ?? !1, this.productCollection = e.productCollection, this.bundleStateManager = new sl(e.bundleStateData);
14729
+ this.workflowExperiences = [], this.eventEmitter = new gl(), this.client = t, this.id = e.id, this.name = e.name || "", this.template = e.template || !1, this.quoteId = e.quoteId, this.shareActions = e.bundleShareActions, this.workflowViewerLink = e.workflowViewerLink, this.workflowViewerAmendLink = e.workflowViewerAmendLink, this.ownerId = i, this.metadata = new Map(((c = e.metadata) == null ? void 0 : c.map((u) => [u.key, u.value])) || []), this.completed = e.completed ?? !1, this.productCollection = e.productCollection, this.bundleStateManager = new sl(e.bundleStateData);
14717
14730
  const o = (d = this.productCollection) == null ? void 0 : d.globalPropertyConfiguration;
14718
14731
  this.globalConfigurationPropertyId = o == null ? void 0 : o.id, this.globalPropertyStateManager = new il(
14719
14732
  this.id,
@@ -14727,8 +14740,8 @@ class Je {
14727
14740
  u([]);
14728
14741
  return;
14729
14742
  }
14730
- console.log("Setting default global variants."), this.globalPropertyHandleService.getHandles().then((m) => {
14731
- const g = m.map((p) => {
14743
+ console.log("Setting default global variants."), this.globalPropertyHandleService.getHandles().then((g) => {
14744
+ const m = g.map((p) => {
14732
14745
  if (p.getType() === G.ColorOption || p.getType() === G.Option) {
14733
14746
  const f = p;
14734
14747
  if (this.globalPropertyStateManager.getGlobalPropertyState())
@@ -14736,7 +14749,7 @@ class Je {
14736
14749
  console.log("Attempted to set global default variant before state was initialized.");
14737
14750
  }
14738
14751
  });
14739
- Promise.all(g).then(u).catch(h);
14752
+ Promise.all(m).then(u).catch(h);
14740
14753
  });
14741
14754
  });
14742
14755
  this.initializationPromise = Promise.all([
@@ -14767,7 +14780,7 @@ class Je {
14767
14780
  }
14768
14781
  async attachAddress(t, e, a, n, i, s) {
14769
14782
  await b.getShadowGraphqlClient().mutate({
14770
- mutation: gl,
14783
+ mutation: ml,
14771
14784
  variables: {
14772
14785
  bundleId: this.id,
14773
14786
  streetAddress: t || void 0,
@@ -14872,7 +14885,7 @@ class Je {
14872
14885
  const d = Object.fromEntries(
14873
14886
  c.map((A) => [A.key, { browserValue: A.browserValue, pmsValue: A.pmsValue }]) ?? []
14874
14887
  );
14875
- await o.changeColors(d);
14888
+ await o.changeColors(d, !0);
14876
14889
  }
14877
14890
  break;
14878
14891
  }
@@ -14882,16 +14895,16 @@ class Je {
14882
14895
  const c = o.getAllVariants().find((d) => d.getId() === n.value);
14883
14896
  c && await o.selectVariant(c);
14884
14897
  } else
14885
- o.setCustomColor(n.value);
14898
+ o.setCustomColor(n.value, !0);
14886
14899
  break;
14887
14900
  }
14888
14901
  case G.Option: {
14889
14902
  const o = s, c = o.getAllVariants().find((d) => d.getId() === n.value);
14890
- console.log(`LOG: variant for ${n.value}: ${c}`), c && await o.selectVariant(c);
14903
+ console.log(`LOG: variant for ${n.value}: ${c}`), c && await o.selectVariant(c, void 0, !0);
14891
14904
  break;
14892
14905
  }
14893
14906
  case G.Text: {
14894
- console.log(`LOG: text ${n.value}`), await s.setText(n.value);
14907
+ console.log(`LOG: text ${n.value}`), await s.setText(n.value, !0);
14895
14908
  break;
14896
14909
  }
14897
14910
  }
@@ -14925,9 +14938,9 @@ class Je {
14925
14938
  this.getWorkflowExperiences(),
14926
14939
  this.globalConfigurationPropertyId || "",
14927
14940
  l
14928
- ), m = [...new Set(A.map((p) => p.number))];
14929
- if (m.length > h)
14930
- for (const p of m) {
14941
+ ), g = [...new Set(A.map((p) => p.number))];
14942
+ if (g.length > h)
14943
+ for (const p of g) {
14931
14944
  const f = this.getGlobalPropertyStateManager(), C = u.find((w) => w.channelNumber === p);
14932
14945
  C && await f.setAspect(l, C.variant.id || "", void 0, C.channelNumber);
14933
14946
  }
@@ -14988,7 +15001,7 @@ class Je {
14988
15001
  throw new Error("Unable to add transaction to bundle - Already Exists!");
14989
15002
  const s = (N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(a);
14990
15003
  await b.getShadowGraphqlClient().mutate({
14991
- mutation: qs,
15004
+ mutation: Hs,
14992
15005
  variables: {
14993
15006
  id: this.id,
14994
15007
  transactionId: a
@@ -15171,7 +15184,7 @@ class Je {
15171
15184
  }
15172
15185
  async getAllStakeholders() {
15173
15186
  const t = await b.getShadowGraphqlClient().query({
15174
- query: qa,
15187
+ query: Ha,
15175
15188
  errorPolicy: "all",
15176
15189
  fetchPolicy: "no-cache",
15177
15190
  variables: {
@@ -15188,7 +15201,7 @@ class Je {
15188
15201
  }
15189
15202
  async getCurrentStakeholder() {
15190
15203
  const t = await b.getShadowGraphqlClient().query({
15191
- query: qa,
15204
+ query: Ha,
15192
15205
  errorPolicy: "all",
15193
15206
  fetchPolicy: "no-cache",
15194
15207
  variables: {
@@ -15343,7 +15356,7 @@ class Je {
15343
15356
  async updateBundle() {
15344
15357
  var e;
15345
15358
  if (!((e = (await b.getShadowGraphqlClient().mutate({
15346
- mutation: Hs,
15359
+ mutation: qs,
15347
15360
  variables: {
15348
15361
  id: this.id,
15349
15362
  name: this.name,
@@ -15452,14 +15465,14 @@ class wl {
15452
15465
  mutation: Cl,
15453
15466
  variables: {
15454
15467
  processFlowId: t,
15455
- inputs: [...e.map((m) => m.getValueForTransmission())]
15468
+ inputs: [...e.map((g) => g.getValueForTransmission())]
15456
15469
  }
15457
15470
  })).data) == null ? void 0 : A.processExecutionCreate) == null ? void 0 : u.id;
15458
15471
  if (!i)
15459
15472
  throw new Error("Failed to create process execution.");
15460
- function s(m) {
15461
- return new Promise((g) => {
15462
- setTimeout(g, m);
15473
+ function s(g) {
15474
+ return new Promise((m) => {
15475
+ setTimeout(m, g);
15463
15476
  });
15464
15477
  }
15465
15478
  let o = !1, l = 0, c, d;
@@ -15483,20 +15496,20 @@ class wl {
15483
15496
  ids: [i]
15484
15497
  }
15485
15498
  });
15486
- const m = (h = c.data) == null ? void 0 : h.processExecutions[0];
15487
- if (!c || !m)
15499
+ const g = (h = c.data) == null ? void 0 : h.processExecutions[0];
15500
+ if (!c || !g)
15488
15501
  throw new Error("Failed to retrieve server response for execution.");
15489
- if (m.failedAt)
15502
+ if (g.failedAt)
15490
15503
  throw new Error(
15491
15504
  "Execution has failed to complete. See Automation > FLows in Flight on partner account on SpiffCommerce Hub."
15492
15505
  );
15493
- if (m.completedAt) {
15494
- o = !0, d = new yl(m);
15506
+ if (g.completedAt) {
15507
+ o = !0, d = new yl(g);
15495
15508
  break;
15496
15509
  }
15497
15510
  l += 1;
15498
- const g = a != null && a.repeats ? a == null ? void 0 : a.repeats : 5;
15499
- if (l >= g)
15511
+ const m = a != null && a.repeats ? a == null ? void 0 : a.repeats : 5;
15512
+ if (l >= m)
15500
15513
  throw new Error("Maximum wait time exceeded for execution result.");
15501
15514
  await s(a != null && a.sleepTime ? Math.max(a.sleepTime, 500) : 2e3);
15502
15515
  }
@@ -15843,7 +15856,7 @@ class Il {
15843
15856
  ));
15844
15857
  }
15845
15858
  }
15846
- const Lt = new Il(), Pl = async (r, t) => {
15859
+ const Ut = new Il(), Pl = async (r, t) => {
15847
15860
  var n;
15848
15861
  const e = await b.getShadowGraphqlClient().query({
15849
15862
  query: ki(((n = t == null ? void 0 : t.assets) == null ? void 0 : n.metadata) || !1),
@@ -15862,8 +15875,8 @@ const Lt = new Il(), Pl = async (r, t) => {
15862
15875
  return a.forEach((i) => {
15863
15876
  i.steps.forEach((s) => {
15864
15877
  var o, l, c;
15865
- 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) => {
15866
- d.asset && U.cacheAsset(d.asset), d.thumbnail && U.cacheAsset(d.thumbnail), d.material && U.cacheMaterial(d.material);
15878
+ 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) => {
15879
+ d.asset && L.cacheAsset(d.asset), d.thumbnail && L.cacheAsset(d.thumbnail), d.material && L.cacheMaterial(d.material);
15867
15880
  }), Jt.set({ id: s.option.id }, Promise.resolve(s.option)));
15868
15881
  }), i.finalizeStepConfig || (i.finalizeStepConfig = {}), i.finalizeStepConfig.termsMarkdown = i.finalizeStepConfig.termsMarkdown || i.partner.termsMarkdown;
15869
15882
  }), a;
@@ -15909,17 +15922,17 @@ class rd {
15909
15922
  } catch (a) {
15910
15923
  throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
15911
15924
  }
15912
- }, this.options = t, this.options.applicationKey && Rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 27.2.1-beta.dabb7794-c627-5751-8578-07b1311c272c"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15925
+ }, this.options = t, this.options.applicationKey && Rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 27.2.1-beta.ba9aed1e-3075-5c0b-8797-fad18911dd7e"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15913
15926
  }
15914
15927
  configure(t) {
15915
- mt.setHubUrl(t.hubUrl), mt.setServerUrl(t.serverUrl), mt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && $r(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
15928
+ 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 && $r(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Ut.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
15916
15929
  }
15917
15930
  /**
15918
15931
  * @returns The asset manager allows for common operations related to assets
15919
15932
  * and the Spiff Commerce platform.
15920
15933
  */
15921
15934
  getAssetManager() {
15922
- return U;
15935
+ return L;
15923
15936
  }
15924
15937
  getCurrencyCode() {
15925
15938
  if (this.currencyCode === void 0)
@@ -15987,7 +16000,7 @@ class rd {
15987
16000
  * @throws An error if the transaction is not found.
15988
16001
  */
15989
16002
  async authenticateTransactionFromLocalStorage(t) {
15990
- var d, A, u, h, m, g;
16003
+ var d, A, u, h, g, m;
15991
16004
  const e = b.getShadowGraphqlClient(), a = await e.query({
15992
16005
  query: Mi,
15993
16006
  errorPolicy: "all",
@@ -16013,7 +16026,7 @@ class rd {
16013
16026
  var S, y;
16014
16027
  return (y = (S = w.bundle) == null ? void 0 : S.transactions) == null ? void 0 : y.some((E) => E.id === t);
16015
16028
  }
16016
- )) || ((g = (m = this.customer) == null ? void 0 : m.stakeholders) == null ? void 0 : g.find(
16029
+ )) || ((m = (g = this.customer) == null ? void 0 : g.stakeholders) == null ? void 0 : m.find(
16017
16030
  (w) => {
16018
16031
  var S;
16019
16032
  return ((S = w.transaction) == null ? void 0 : S.id) === t;
@@ -16119,7 +16132,7 @@ class rd {
16119
16132
  return !1;
16120
16133
  const n = JSON.parse(e), i = (/* @__PURE__ */ new Date()).getTime() / 1e3;
16121
16134
  if (!n.ExpiresIn || n.ExpiresIn < i - parseInt(t)) {
16122
- const l = await Lt.refreshTokens();
16135
+ const l = await Ut.refreshTokens();
16123
16136
  if (l != null && l.AuthenticationResult)
16124
16137
  localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), n.AccessToken = l.AuthenticationResult.AccessToken, localStorage.setItem("cognito-tokens", JSON.stringify(n));
16125
16138
  else
@@ -16144,14 +16157,14 @@ class rd {
16144
16157
  variables: {
16145
16158
  emailAddress: t
16146
16159
  }
16147
- }), await Lt.generateCode(t);
16160
+ }), await Ut.generateCode(t);
16148
16161
  }
16149
16162
  /**
16150
16163
  * Verify an email code to log in as a Spiff user.
16151
16164
  * Always returns true if it doesn't throw.
16152
16165
  */
16153
16166
  async verifyCode(t, e) {
16154
- const a = (await this.getIntegration()).partner.id || "", n = await Lt.verifyCode(t, e, a);
16167
+ const a = (await this.getIntegration()).partner.id || "", n = await Ut.verifyCode(t, e, a);
16155
16168
  if (n != null && n.AuthenticationResult) {
16156
16169
  localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), localStorage.setItem("cognito-tokens", JSON.stringify(n.AuthenticationResult)), localStorage.setItem("cognito-email", t);
16157
16170
  const s = (await b.getShadowGraphqlClient().query({
@@ -16181,7 +16194,7 @@ class rd {
16181
16194
  throw new Error("No token data in storage.");
16182
16195
  const a = JSON.parse(e), n = (/* @__PURE__ */ new Date()).getTime() / 1e3, i = !(a != null && a.AccessToken) || Wt(a.AccessToken);
16183
16196
  if (!a.ExpiresIn || a.ExpiresIn < n - parseInt(t) || i) {
16184
- const s = await Lt.refreshTokens();
16197
+ const s = await Ut.refreshTokens();
16185
16198
  if (s != null && s.AuthenticationResult)
16186
16199
  localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), a.AccessToken = s.AuthenticationResult.AccessToken, localStorage.setItem("cognito-tokens", JSON.stringify(a));
16187
16200
  else
@@ -16212,7 +16225,7 @@ class rd {
16212
16225
  mutation: Ws(((d = (c = a == null ? void 0 : a.graphql) == null ? void 0 : c.productCollection) == null ? void 0 : d.eagerFetchProducts) || !1),
16213
16226
  variables: {
16214
16227
  collectionId: t,
16215
- initialMetadata: e ? Object.entries(e).map((m, g) => ({ key: m[0], value: m[1] })) : void 0,
16228
+ initialMetadata: e ? Object.entries(e).map((g, m) => ({ key: g[0], value: g[1] })) : void 0,
16216
16229
  marketplaceThemeInstallId: this.marketplaceThemeInstallId,
16217
16230
  marketplaceThemeInstallConfigurationId: this.marketplaceThemeInstallConfigurationId
16218
16231
  },
@@ -16238,7 +16251,7 @@ class rd {
16238
16251
  * @returns A bundle to be used for grouping and operating on large amounts of workflow experiences.
16239
16252
  */
16240
16253
  async getExistingBundle(t, e, a, n) {
16241
- var h, m, g, p, f, C, w, S, y, E, B;
16254
+ var h, g, m, p, f, C, w, S, y, E, B;
16242
16255
  const i = N.getMap("bundleOwnerIds"), s = i == null ? void 0 : i.get(t), o = {};
16243
16256
  try {
16244
16257
  const I = await this.loggedInBearerToken();
@@ -16250,9 +16263,9 @@ class rd {
16250
16263
  const l = {
16251
16264
  bundleOwnerId: s,
16252
16265
  ...o,
16253
- ...(m = n == null ? void 0 : n.graphql) == null ? void 0 : m.additionalHeaders
16266
+ ...(g = n == null ? void 0 : n.graphql) == null ? void 0 : g.additionalHeaders
16254
16267
  }, c = await b.getShadowGraphqlClient().query({
16255
- query: Us(((p = (g = n == null ? void 0 : n.graphql) == null ? void 0 : g.productCollection) == null ? void 0 : p.eagerFetchProducts) || !1),
16268
+ query: Ls(((p = (m = n == null ? void 0 : n.graphql) == null ? void 0 : m.productCollection) == null ? void 0 : p.eagerFetchProducts) || !1),
16256
16269
  variables: {
16257
16270
  id: t
16258
16271
  },
@@ -16280,19 +16293,19 @@ class rd {
16280
16293
  * @returns A bundle to be used for grouping and operating on large amounts of workflow experiences.
16281
16294
  */
16282
16295
  async duplicateBundle(t, e, a, n) {
16283
- var h, m, g, p, f, C, w, S;
16296
+ var h, g, m, p, f, C, w, S;
16284
16297
  const i = (h = N.getMap("bundleOwnerIds")) == null ? void 0 : h.get(t), s = {};
16285
16298
  try {
16286
16299
  const y = await this.loggedInBearerToken();
16287
16300
  s.Authorization = `Bearer ${y}`;
16288
16301
  } catch {
16289
- const B = ((m = Object.entries(localStorage).find(([D, x]) => D.startsWith("CognitoIdentityServiceProvider") && D.endsWith("idToken"))) == null ? void 0 : m[0]) || "", I = localStorage.getItem(B);
16302
+ const B = ((g = Object.entries(localStorage).find(([D, x]) => D.startsWith("CognitoIdentityServiceProvider") && D.endsWith("idToken"))) == null ? void 0 : g[0]) || "", I = localStorage.getItem(B);
16290
16303
  I && !Wt(I) && (s.Authorization = `Bearer ${I}`);
16291
16304
  }
16292
16305
  const o = {
16293
16306
  bundleOwnerId: i,
16294
16307
  ...s,
16295
- ...(g = n == null ? void 0 : n.graphql) == null ? void 0 : g.additionalHeaders
16308
+ ...(m = n == null ? void 0 : n.graphql) == null ? void 0 : m.additionalHeaders
16296
16309
  }, c = (C = (await b.getShadowGraphqlClient().mutate({
16297
16310
  mutation: js(((f = (p = n == null ? void 0 : n.graphql) == null ? void 0 : p.productCollection) == null ? void 0 : f.eagerFetchProducts) || !1),
16298
16311
  variables: {
@@ -16351,7 +16364,7 @@ class rd {
16351
16364
  if (!this.customer)
16352
16365
  throw new Error("Customer not authenticated.");
16353
16366
  const t = await b.getShadowGraphqlClient().query({
16354
- query: Ls,
16367
+ query: Us,
16355
16368
  variables: {
16356
16369
  id: this.customer.id
16357
16370
  },
@@ -16448,11 +16461,11 @@ class rd {
16448
16461
  ), c = Fa(o, 10), d = Fa(l, 10), A = (await Promise.all([
16449
16462
  ...c.map(n),
16450
16463
  ...d.map(i)
16451
- ])).flat(), u = [...new Set(A.map((y) => y.workflowId))], h = await er(u, e), m = new Map(h.map((y) => [y.id, y])), g = N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), p = A.map(async (y) => {
16464
+ ])).flat(), u = [...new Set(A.map((y) => y.workflowId))], h = await er(u, e), g = new Map(h.map((y) => [y.id, y])), m = N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), p = A.map(async (y) => {
16452
16465
  var tt;
16453
- const { transaction: E, workflowId: B, readOnly: I, index: D } = y, x = m.get(B), k = t[D];
16454
- !g.get(E.id) && E.transactionOwnerId && g.set(E.id, E.transactionOwnerId);
16455
- const T = g.get(E.id) || void 0, nt = new bl({
16466
+ const { transaction: E, workflowId: B, readOnly: I, index: D } = y, x = g.get(B), k = t[D];
16467
+ !m.get(E.id) && E.transactionOwnerId && m.set(E.id, E.transactionOwnerId);
16468
+ const T = m.get(E.id) || void 0, nt = new bl({
16456
16469
  onMutate: () => ({ context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId } }),
16457
16470
  onQuery: () => ({ context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId } })
16458
16471
  }), R = {
@@ -16462,8 +16475,8 @@ class rd {
16462
16475
  singleVariantsRenderable: (tt = k == null ? void 0 : k.workflowConfiguration) == null ? void 0 : tt.singleVariantsRenderable,
16463
16476
  stateMutationFunc: I ? async () => {
16464
16477
  throw new z("State mutation is forbidden in read only mode!");
16465
- } : async (H) => this.updateTransactionState({
16466
- ...H,
16478
+ } : async (q) => this.updateTransactionState({
16479
+ ...q,
16467
16480
  context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId }
16468
16481
  }),
16469
16482
  graphQlClient: () => nt,
@@ -16472,11 +16485,11 @@ class rd {
16472
16485
  isReloadedTransaction: k.type === "transaction"
16473
16486
  };
16474
16487
  if (k.type === "transaction" && E.workflowState) {
16475
- const H = JSON.parse(E.workflowState);
16476
- R.layouts = Object.values(H.layouts || {}).map((ft) => ft.layout), await Ga(H), R.reloadedState = H;
16488
+ const q = JSON.parse(E.workflowState);
16489
+ R.layouts = Object.values(q.layouts || {}).map((ft) => ft.layout), await Ga(q), R.reloadedState = q;
16477
16490
  } else if (!I && k.workflowState) {
16478
- const H = JSON.parse(k.workflowState);
16479
- R.layouts = Object.values(H.layouts || {}).map((ft) => ft.layout), await Ga(H), R.reloadedState = H;
16491
+ const q = JSON.parse(k.workflowState);
16492
+ R.layouts = Object.values(q.layouts || {}).map((ft) => ft.layout), await Ga(q), R.reloadedState = q;
16480
16493
  } else
16481
16494
  R.layouts = Fl(
16482
16495
  R.transaction,
@@ -16486,7 +16499,7 @@ class rd {
16486
16499
  R.layouts
16487
16500
  ), R.delayWorkflowStateSync = !0, { experienceOptions: R, index: D, options: k };
16488
16501
  }), f = await Promise.all(p);
16489
- N.setMap("transactionOwnerIds", g);
16502
+ N.setMap("transactionOwnerIds", m);
16490
16503
  const w = f.sort((y, E) => y.index - E.index).map(async (y) => {
16491
16504
  const { experienceOptions: E, options: B } = y, I = new Oo(this, E);
16492
16505
  return await I.getWorkflowManager().getInitializationPromise(), B.type !== "transaction" && this.customer && await I.attachCustomerDetails({ email: this.customer.emailAddress }), I;
@@ -17081,7 +17094,7 @@ class Ql extends it {
17081
17094
  const e = await this.getOriginalImageSelection();
17082
17095
  if (!e)
17083
17096
  throw new Error("You must supply an image selection before attempting to remove the background.");
17084
- const a = await U.removeBackgroundFromAsset(e);
17097
+ const a = await L.removeBackgroundFromAsset(e);
17085
17098
  t && await wt.selectImage(this.step, a, this.manager, !1);
17086
17099
  const n = ((i = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : i.framePatternData) || {};
17087
17100
  return this.manager.updateStorage(this.step.stepName, {
@@ -17140,13 +17153,13 @@ class Ql extends it {
17140
17153
  var e, a;
17141
17154
  const t = (a = (e = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : e.framePatternData) == null ? void 0 : a.originalAssetKey;
17142
17155
  if (t)
17143
- return U.getLocalOrFromServer(t);
17156
+ return L.getLocalOrFromServer(t);
17144
17157
  }
17145
17158
  async getBackgroundRemovedImageSelection() {
17146
17159
  var e, a;
17147
17160
  const t = (a = (e = this.manager.getStepStorage(this.step.stepName)) == null ? void 0 : e.framePatternData) == null ? void 0 : a.backgroundRemovedAssetKey;
17148
17161
  if (t)
17149
- return U.getLocalOrFromServer(t);
17162
+ return L.getLocalOrFromServer(t);
17150
17163
  }
17151
17164
  hasOriginalImageSelection() {
17152
17165
  var t, e;
@@ -17243,7 +17256,7 @@ const Rl = v`
17243
17256
  workflowViewerLink
17244
17257
  }
17245
17258
  }
17246
- `, Ul = v`
17259
+ `, Ll = v`
17247
17260
  query GetCustomerBundles($id: String!, $limit: Int!, $offset: Int!) {
17248
17261
  customerBundlesFeed(id: $id, limit: $limit, offset: $offset) {
17249
17262
  items {
@@ -17258,7 +17271,7 @@ const Rl = v`
17258
17271
  total
17259
17272
  }
17260
17273
  }
17261
- `, Ll = v`
17274
+ `, Ul = v`
17262
17275
  query GetTransactionsForBundle($id: String!) {
17263
17276
  bundles(ids: [$id]) {
17264
17277
  id
@@ -17335,14 +17348,14 @@ const Rl = v`
17335
17348
  id: r,
17336
17349
  template: t
17337
17350
  }
17338
- }), md = async (r) => (await b.getShadowGraphqlClient().query({
17351
+ }), gd = async (r) => (await b.getShadowGraphqlClient().query({
17339
17352
  query: Rl,
17340
17353
  errorPolicy: "all",
17341
17354
  variables: {
17342
17355
  email: r
17343
17356
  }
17344
- })).data.customer, gd = async (r, t, e) => await b.getShadowGraphqlClient().query({
17345
- query: Ul,
17357
+ })).data.customer, md = async (r, t, e) => await b.getShadowGraphqlClient().query({
17358
+ query: Ll,
17346
17359
  errorPolicy: "all",
17347
17360
  fetchPolicy: "no-cache",
17348
17361
  variables: {
@@ -17351,7 +17364,7 @@ const Rl = v`
17351
17364
  limit: t
17352
17365
  }
17353
17366
  }), pd = async (r, t) => await b.getShadowGraphqlClient().query({
17354
- query: Ll,
17367
+ query: Ul,
17355
17368
  errorPolicy: "all",
17356
17369
  fetchPolicy: "no-cache",
17357
17370
  variables: {
@@ -17463,7 +17476,7 @@ _ = { __e: function(r, t, e, a) {
17463
17476
  throw r;
17464
17477
  } }, typeof Promise == "function" && Promise.prototype.then.bind(Promise.resolve());
17465
17478
  var ot, Ke, _a, ar = [], _e = [], Xa = _.__b, Za = _.__r, tn = _.diffed, en = _.__c, an = _.unmount;
17466
- function Hl() {
17479
+ function ql() {
17467
17480
  for (var r; r = ar.shift(); )
17468
17481
  if (r.__P && r.__H)
17469
17482
  try {
@@ -17483,7 +17496,7 @@ _.__b = function(r) {
17483
17496
  }, _.diffed = function(r) {
17484
17497
  tn && tn(r);
17485
17498
  var t = r.__c;
17486
- t && t.__H && (t.__H.__h.length && (ar.push(t) !== 1 && _a === _.requestAnimationFrame || ((_a = _.requestAnimationFrame) || ql)(Hl)), t.__H.__.forEach(function(e) {
17499
+ t && t.__H && (t.__H.__h.length && (ar.push(t) !== 1 && _a === _.requestAnimationFrame || ((_a = _.requestAnimationFrame) || Hl)(ql)), t.__H.__.forEach(function(e) {
17487
17500
  e.i && (e.__H = e.i), e.__V !== _e && (e.__ = e.__V), e.i = void 0, e.__V = _e;
17488
17501
  })), Ke = ot = null;
17489
17502
  }, _.__c = function(r, t) {
@@ -17510,7 +17523,7 @@ _.__b = function(r) {
17510
17523
  }), e.__H = void 0, t && _.__e(t, e.__v));
17511
17524
  };
17512
17525
  var nn = typeof requestAnimationFrame == "function";
17513
- function ql(r) {
17526
+ function Hl(r) {
17514
17527
  var t, e = function() {
17515
17528
  clearTimeout(a), nn && cancelAnimationFrame(t), setTimeout(r);
17516
17529
  }, a = setTimeout(e, 100);
@@ -17658,7 +17671,7 @@ export {
17658
17671
  Ce as AssetType,
17659
17672
  Jc as BringForwardCommand,
17660
17673
  Yc as BringToBackCommand,
17661
- qc as BringToFrontCommand,
17674
+ Hc as BringToFrontCommand,
17662
17675
  yr as BundleDesignCreationCartAddMode,
17663
17676
  O as CanvasCommand,
17664
17677
  de as CollectionProduct,
@@ -17667,7 +17680,7 @@ export {
17667
17680
  jl as ConversionDataType,
17668
17681
  Wl as ConversionLocation,
17669
17682
  W as CreateElementCommand,
17670
- Un as CreateLayoutCommand,
17683
+ Ln as CreateLayoutCommand,
17671
17684
  Bt as DeleteElementCommand,
17672
17685
  Eo as DigitalContentStepHandle,
17673
17686
  el as FileUploadGlobalPropertyHandle,
@@ -17683,7 +17696,7 @@ export {
17683
17696
  Ql as FrameStepHandle,
17684
17697
  Ia as GlobalPropertyHandle,
17685
17698
  $ as GroupCommand,
17686
- go as IllustrationStepHandle,
17699
+ mo as IllustrationStepHandle,
17687
17700
  Re as InformationMessageType,
17688
17701
  vo as InformationStepHandle,
17689
17702
  Ka as IntegrationProduct,
@@ -17691,7 +17704,7 @@ export {
17691
17704
  Gc as LayoutElementFactory,
17692
17705
  M as LayoutElementType,
17693
17706
  J as LayoutNotFoundError,
17694
- Ht as LayoutRenderingPurpose,
17707
+ qt as LayoutRenderingPurpose,
17695
17708
  po as MaterialStepHandle,
17696
17709
  Se as MisconfigurationError,
17697
17710
  cd as MockWorkflowManager,
@@ -17713,9 +17726,9 @@ export {
17713
17726
  wo as QuestionStepHandle,
17714
17727
  Dn as QueueablePromise,
17715
17728
  jc as ResizeCommand,
17716
- qt as ResourceNotFoundError,
17729
+ Ht as ResourceNotFoundError,
17717
17730
  Wc as RotateCommand,
17718
- q as ScaleAxis,
17731
+ H as ScaleAxis,
17719
17732
  Kc as SendBackwardsCommand,
17720
17733
  yo as ShapeStepHandle,
17721
17734
  Sr as ShareActionType,
@@ -17733,13 +17746,13 @@ export {
17733
17746
  Al as TransformCollection,
17734
17747
  z as UnhandledBehaviorError,
17735
17748
  Br as UnitOfMeasurement,
17736
- Hc as UpdateImageSourceCommand,
17749
+ qc as UpdateImageSourceCommand,
17737
17750
  st as Variant,
17738
17751
  Ro as WorkflowExperienceEventType,
17739
17752
  Oo as WorkflowExperienceImpl,
17740
- U as assetService,
17753
+ L as assetService,
17741
17754
  Kr as browserColorToHex,
17742
- Lc as cmPerPixel,
17755
+ Uc as cmPerPixel,
17743
17756
  Fo as createDesign,
17744
17757
  Oc as currentDirection,
17745
17758
  bc as dataUrlFromExternalUrl,
@@ -17751,7 +17764,7 @@ export {
17751
17764
  hd as duplicateTransaction,
17752
17765
  at as fetchAsString,
17753
17766
  Fc as findAngle,
17754
- L as findElement,
17767
+ U as findElement,
17755
17768
  Dc as findPmsColors,
17756
17769
  Vt as frameDataCache,
17757
17770
  wt as frameStepService,
@@ -17764,8 +17777,8 @@ export {
17764
17777
  xc as getAxisAlignedBoundingBox,
17765
17778
  Ml as getBoundedOffsets,
17766
17779
  od as getBundleThemeConfiguration,
17767
- md as getCustomer,
17768
- gd as getCustomerBundles,
17780
+ gd as getCustomer,
17781
+ md as getCustomerBundles,
17769
17782
  $c as getElementVertices,
17770
17783
  Qe as getFrameData,
17771
17784
  _c as getGlobalPropertyStateForBundle,
@@ -17789,13 +17802,13 @@ export {
17789
17802
  nd as getWorkflow,
17790
17803
  er as getWorkflows,
17791
17804
  b as graphQlManager,
17792
- ge as illustrationStepService,
17805
+ me as illustrationStepService,
17793
17806
  kc as isCloseToValue,
17794
17807
  Nt as loadFont,
17795
17808
  Pc as matchHexToPms,
17796
17809
  Gn as materialStepService,
17797
17810
  cl as metafieldManager,
17798
- Uc as mmPerPixel,
17811
+ Lc as mmPerPixel,
17799
17812
  zn as modelStepService,
17800
17813
  Ca as modifySVGColors,
17801
17814
  Wn as moduleStepService,
@@ -17807,18 +17820,18 @@ export {
17807
17820
  N as persistenceService,
17808
17821
  jn as pictureStepService,
17809
17822
  Ic as pmsToRgb,
17810
- Hn as questionStepService,
17823
+ qn as questionStepService,
17811
17824
  Bc as registerFetchImplementation,
17812
17825
  Ec as registerWindowImplementation,
17813
17826
  Ga as rehydrateSerializedLayout,
17814
- qr as rgbToPms,
17827
+ Hr as rgbToPms,
17815
17828
  le as rotateAroundPoint,
17816
17829
  pa as sanitizeSvgTree,
17817
17830
  $r as setBearerAuthenticationToken,
17818
- gn as setCanvasModule,
17831
+ mn as setCanvasModule,
17819
17832
  Gt as shapeStepService,
17820
17833
  hs as shortenUrl,
17821
- mt as spiffCoreConfiguration,
17834
+ gt as spiffCoreConfiguration,
17822
17835
  Xc as stepAspectValuesToDesignInputSteps,
17823
17836
  Oa as svgColorValueToDefinition,
17824
17837
  On as svgStringDimensions,