@spiffcommerce/core 33.13.0 → 33.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,30 +1,30 @@
1
- import { createHttpLink as Ii, ApolloClient as Bi, InMemoryCache as Pi, from as Fi, gql as C } from "@apollo/client/core";
2
- import { setContext as Di } from "@apollo/client/link/context";
1
+ import { createHttpLink as Ii, ApolloClient as Bi, InMemoryCache as Pi, from as Di, gql as C } from "@apollo/client/core";
2
+ import { setContext as Fi } from "@apollo/client/link/context";
3
3
  import { onError as xi } from "@apollo/client/link/error";
4
4
  import { renderToStaticMarkup as ki } from "preact-render-to-string";
5
5
  import { removeTypenameFromVariables as Mi } from "@apollo/client/link/remove-typename";
6
6
  import { orientation as Ti } from "exifr/dist/mini.umd.cjs";
7
7
  import { parse as yn } from "css";
8
8
  import Ni from "fuse.js";
9
- import { Pith as Ea } from "pith";
9
+ import { Pith as va } from "pith";
10
10
  import It from "lodash.clonedeep";
11
11
  import Jt from "lodash.isequal";
12
12
  import { jsx as P, jsxs as dt, Fragment as qt } from "preact/jsx-runtime";
13
- import { parse as ca } from "opentype.js";
13
+ import { parse as la } from "opentype.js";
14
14
  import Qi from "handlebars";
15
15
  import { dataUriToBuffer as Ri } from "data-uri-to-buffer";
16
16
  import { toString as Sn } from "qrcode";
17
- import { split as da } from "unicode-default-word-boundary";
17
+ import { split as ca } from "unicode-default-word-boundary";
18
18
  import Oi from "svg-path-bbox";
19
- import Va from "lodash.chunk";
20
- import { CognitoIdentityProviderClient as $i, InitiateAuthCommand as za, RespondToAuthChallengeCommand as Ui } from "@aws-sdk/client-cognito-identity-provider";
19
+ import La from "lodash.chunk";
20
+ import { CognitoIdentityProviderClient as $i, InitiateAuthCommand as Va, RespondToAuthChallengeCommand as Ui } from "@aws-sdk/client-cognito-identity-provider";
21
21
  import Li from "dinero.js";
22
- import * as Ga from "currency-codes";
22
+ import * as za from "currency-codes";
23
23
  import vn from "lodash.debounce";
24
24
  import "fs";
25
25
  import "path";
26
26
  import Vi from "lodash.omit";
27
- var Pe = /* @__PURE__ */ ((n) => (n.Data = "Data", n.Font = "Font", n.Frame = "Frame", n.Illustration = "Illustration", n.Image = "Image", n.Model = "Model", n.Material = "Material", n.Color = "Color", n.QuestionnaireCollateral = "QuestionnaireCollateral", n.RequestCollateral = "RequestCollateral", n.SignupCollateral = "SignupCollateral", n.Video = "Video", n.ColorProfile = "ColorProfile", n.Environment = "Environment", n))(Pe || {}), En = /* @__PURE__ */ ((n) => (n.AND = "AND", n.OR = "OR", n))(En || {}), G = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(G || {}), v = /* @__PURE__ */ ((n) => (n.Information = "Information", n.Bulk = "Bulk", n.DigitalContent = "DigitalContent", n.Finish = "Finish", n.Frame = "Frame", n.Illustration = "Illustration", n.Introduction = "Introduction", n.Material = "Material", n.Model = "Model", n.Module = "Module", n.Picture = "Picture", n.Photo = "Photo", n.ProductOverlay = "ProductOverlay", n.Question = "Question", n.Shape = "Shape", n.SilentIllustration = "SilentIllustration", n.Text = "Text", n))(v || {}), zi = /* @__PURE__ */ ((n) => (n.Color = "Color", n.Colors = "Colors", n.Selection = "Selection", n.Selections = "Selections", n.Text = "Text", n.Upload = "Upload", n))(zi || {}), Kt = /* @__PURE__ */ ((n) => (n.ThreeD = "ThreeD", n.FreeDesign = "FreeDesign", n.Print = "Print", n))(Kt || {}), D = /* @__PURE__ */ ((n) => (n.Frame = "frame", n.Group = "group", n.Image = "image", n.Pattern = "pattern", n.Illustration = "illustration", n.Textbox = "textbox", n))(D || {}), Gi = /* @__PURE__ */ ((n) => (n.Default = "Default", n.FirstTransaction = "FirstTransaction", n.OneToOne = "OneToOne", n))(Gi || {}), bn = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Failed = "Failed", n.Validated = "Validated", n.Overridden = "Overridden", n))(bn || {}), Wi = /* @__PURE__ */ ((n) => (n.Hyperlink = "Hyperlink", n.Edit = "Edit", n.Approve = "Approve", n))(Wi || {}), qi = /* @__PURE__ */ ((n) => (n.Hub = "Hub", n.Shopify = "Shopify", n))(qi || {}), ba = /* @__PURE__ */ ((n) => (n.BackgroundRemover = "BackgroundRemover", n.ConversionAccelerator = "Conversion Accelerator", n.ProcessBuilder = "ProcessBuilder", n))(ba || {}), Hi = /* @__PURE__ */ ((n) => (n[n.Orbit = 0] = "Orbit", n[n.Pan = 1] = "Pan", n))(Hi || {}), Fe = /* @__PURE__ */ ((n) => (n.Owner = "Owner", n.Approver = "Approver", n.Editor = "Editor", n.Viewer = "Viewer", n))(Fe || {}), Tt = /* @__PURE__ */ ((n) => (n.Autosize = "Autosize", n.Traditional = "Traditional", n))(Tt || {}), Y = /* @__PURE__ */ ((n) => (n[n.North = 0] = "North", n[n.Northeast = 1] = "Northeast", n[n.East = 2] = "East", n[n.Southeast = 3] = "Southeast", n[n.South = 4] = "South", n[n.Southwest = 5] = "Southwest", n[n.West = 6] = "West", n[n.Northwest = 7] = "Northwest", n))(Y || {}), ji = /* @__PURE__ */ ((n) => (n.Pixel = "px", n.Millimeter = "mm", n.Centimeter = "cm", n))(ji || {});
27
+ var Ie = /* @__PURE__ */ ((n) => (n.Data = "Data", n.Font = "Font", n.Frame = "Frame", n.Illustration = "Illustration", n.Image = "Image", n.Model = "Model", n.Material = "Material", n.Color = "Color", n.QuestionnaireCollateral = "QuestionnaireCollateral", n.RequestCollateral = "RequestCollateral", n.SignupCollateral = "SignupCollateral", n.Video = "Video", n.ColorProfile = "ColorProfile", n.Environment = "Environment", n))(Ie || {}), En = /* @__PURE__ */ ((n) => (n.AND = "AND", n.OR = "OR", n))(En || {}), G = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(G || {}), v = /* @__PURE__ */ ((n) => (n.Information = "Information", n.Bulk = "Bulk", n.DigitalContent = "DigitalContent", n.Finish = "Finish", n.Frame = "Frame", n.Illustration = "Illustration", n.Introduction = "Introduction", n.Material = "Material", n.Model = "Model", n.Module = "Module", n.Picture = "Picture", n.Photo = "Photo", n.ProductOverlay = "ProductOverlay", n.Question = "Question", n.Shape = "Shape", n.SilentIllustration = "SilentIllustration", n.Text = "Text", n))(v || {}), zi = /* @__PURE__ */ ((n) => (n.Color = "Color", n.Colors = "Colors", n.Selection = "Selection", n.Selections = "Selections", n.Text = "Text", n.Upload = "Upload", n))(zi || {}), Kt = /* @__PURE__ */ ((n) => (n.ThreeD = "ThreeD", n.FreeDesign = "FreeDesign", n.Print = "Print", n))(Kt || {}), F = /* @__PURE__ */ ((n) => (n.Frame = "frame", n.Group = "group", n.Image = "image", n.Pattern = "pattern", n.Illustration = "illustration", n.Textbox = "textbox", n))(F || {}), Gi = /* @__PURE__ */ ((n) => (n.Default = "Default", n.FirstTransaction = "FirstTransaction", n.OneToOne = "OneToOne", n))(Gi || {}), bn = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Failed = "Failed", n.Validated = "Validated", n.Overridden = "Overridden", n))(bn || {}), Wi = /* @__PURE__ */ ((n) => (n.Hyperlink = "Hyperlink", n.Edit = "Edit", n.Approve = "Approve", n))(Wi || {}), qi = /* @__PURE__ */ ((n) => (n.Hub = "Hub", n.Shopify = "Shopify", n))(qi || {}), Ea = /* @__PURE__ */ ((n) => (n.BackgroundRemover = "BackgroundRemover", n.ConversionAccelerator = "Conversion Accelerator", n.ProcessBuilder = "ProcessBuilder", n))(Ea || {}), Hi = /* @__PURE__ */ ((n) => (n[n.Orbit = 0] = "Orbit", n[n.Pan = 1] = "Pan", n))(Hi || {}), Be = /* @__PURE__ */ ((n) => (n.Owner = "Owner", n.Approver = "Approver", n.Editor = "Editor", n.Viewer = "Viewer", n))(Be || {}), Tt = /* @__PURE__ */ ((n) => (n.Autosize = "Autosize", n.Traditional = "Traditional", n))(Tt || {}), Y = /* @__PURE__ */ ((n) => (n[n.North = 0] = "North", n[n.Northeast = 1] = "Northeast", n[n.East = 2] = "East", n[n.Southeast = 3] = "Southeast", n[n.South = 4] = "South", n[n.Southwest = 5] = "Southwest", n[n.West = 6] = "West", n[n.Northwest = 7] = "Northwest", n))(Y || {}), ji = /* @__PURE__ */ ((n) => (n.Pixel = "px", n.Millimeter = "mm", n.Centimeter = "cm", n))(ji || {});
28
28
  class In extends Error {
29
29
  constructor(t) {
30
30
  super(t), this.name = this.constructor.name;
@@ -35,7 +35,7 @@ class ae extends In {
35
35
  super(`ConfigurationError - ${t}`);
36
36
  }
37
37
  }
38
- class De extends ae {
38
+ class Pe extends ae {
39
39
  constructor(t) {
40
40
  super(`Option not Configured: ${t.stepTitle}`), this.optionId = t?.optionId || "N/A";
41
41
  }
@@ -55,32 +55,32 @@ class _t extends ae {
55
55
  super(`Resource not found for asset: ${t.name}`), this.asset = t;
56
56
  }
57
57
  }
58
- class xe extends ae {
58
+ class De extends ae {
59
59
  constructor(t, e) {
60
60
  super(`Workflow Misconfiguration: ${t.stepName} - ${e}`), this.step = t;
61
61
  }
62
62
  }
63
- class Oe extends In {
63
+ class Qe extends In {
64
64
  constructor(t) {
65
65
  super(`ImplementationError - ${t}`);
66
66
  }
67
67
  }
68
- class R extends Oe {
68
+ class R extends Qe {
69
69
  constructor(t) {
70
70
  super(`Unhandled Behavior Encountered: ${t}`);
71
71
  }
72
72
  }
73
- class Dt extends Oe {
73
+ class Ft extends Qe {
74
74
  constructor(t) {
75
75
  super(`Parsing Error: ${t}`);
76
76
  }
77
77
  }
78
- class gt extends Oe {
78
+ class gt extends Qe {
79
79
  constructor(t) {
80
80
  super(`Client Error: ${t}`);
81
81
  }
82
82
  }
83
- class $e extends Oe {
83
+ class Re extends Qe {
84
84
  constructor(t) {
85
85
  super(`Resource Generation Failed: ${t}`);
86
86
  }
@@ -105,7 +105,7 @@ class Yi {
105
105
  this.set(t, a);
106
106
  }
107
107
  }
108
- class Wa {
108
+ class Ga {
109
109
  constructor() {
110
110
  this.storage = /* @__PURE__ */ new Map();
111
111
  }
@@ -130,9 +130,9 @@ class Wa {
130
130
  }
131
131
  const Ji = () => {
132
132
  try {
133
- return localStorage ? new Yi() : new Wa();
133
+ return localStorage ? new Yi() : new Ga();
134
134
  } catch {
135
- return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."), new Wa();
135
+ return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."), new Ga();
136
136
  }
137
137
  }, k = Ji();
138
138
  class Ki {
@@ -162,42 +162,42 @@ class Ki {
162
162
  }
163
163
  }
164
164
  const ft = new Ki();
165
- let Aa, ua;
165
+ let da, Aa;
166
166
  function id(n) {
167
- Aa = n;
167
+ da = n;
168
168
  }
169
169
  function rd(n) {
170
- ua = n;
170
+ Aa = n;
171
171
  }
172
172
  function ne() {
173
- return Aa ? new Aa().window : (console.log(
173
+ return da ? new da().window : (console.log(
174
174
  "DOM constructor is not registered. Assuming browser environment. If not, please register DOM constructor before calling this function."
175
175
  ), window);
176
176
  }
177
177
  function it(n, t) {
178
- if (!ua) {
178
+ if (!Aa) {
179
179
  if (typeof window < "u" && window.fetch)
180
180
  return window.fetch(n, t);
181
181
  if (typeof global < "u" && global.fetch)
182
182
  return global.fetch(n, t);
183
183
  throw new Error("Fetch implementation is not registered. Please register it before calling this function.");
184
184
  }
185
- return ua(n, t);
185
+ return Aa(n, t);
186
186
  }
187
- const Bn = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Ha = /* @__PURE__ */ new Map(), Pn = async (n) => {
188
- const t = qa.get(n);
187
+ const Bn = /* @__PURE__ */ new Map(), Wa = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Pn = async (n) => {
188
+ const t = Wa.get(n);
189
189
  if (t) return t;
190
190
  const a = (async () => {
191
191
  const i = await it(n);
192
192
  return Bn.set(n, i.headers?.get("content-type") || ""), await i.arrayBuffer();
193
193
  })();
194
- return qa.set(n, a), a;
194
+ return Wa.set(n, a), a;
195
195
  }, _i = async (n) => {
196
- const t = Ha.get(n);
196
+ const t = qa.get(n);
197
197
  if (t) return t;
198
198
  const a = (async () => await (await it(n)).text())();
199
- return Ha.set(n, a), a;
200
- }, Nt = (n) => n.every((t) => t !== "undefined"), ue = (n) => Nt([typeof document]) ? document.createElement(n) : ne().document.createElement(n), Xi = (n, t) => {
199
+ return qa.set(n, a), a;
200
+ }, Nt = (n) => n.every((t) => t !== "undefined"), de = (n) => Nt([typeof document]) ? document.createElement(n) : ne().document.createElement(n), Xi = (n, t) => {
201
201
  if (Nt([typeof document]))
202
202
  return document.createElementNS(n, t);
203
203
  const a = ne().document.createElement(t);
@@ -207,7 +207,7 @@ const Bn = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Ha = /* @_
207
207
  return new DOMParser();
208
208
  const n = ne();
209
209
  return new n.DOMParser();
210
- }, Zi = () => Nt([typeof DOMParser]) ? DOMParser : ne().DOMParser, Ue = (n, t) => new Promise((e, a) => {
210
+ }, Zi = () => Nt([typeof DOMParser]) ? DOMParser : ne().DOMParser, Oe = (n, t) => new Promise((e, a) => {
211
211
  t ? Pn(n).then(e).catch(a) : it(n).then((i) => {
212
212
  i.arrayBuffer().then(e).catch(a);
213
213
  }).catch((i) => {
@@ -217,7 +217,7 @@ const Bn = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Ha = /* @_
217
217
  t ? _i(n).then(e).catch(a) : it(n).then((i) => {
218
218
  i.text().then(e).catch(a);
219
219
  }).catch(a);
220
- }), Fn = (n) => ki(n), je = /* @__PURE__ */ new Map(), tr = async (n, t) => {
220
+ }), Dn = (n) => ki(n), je = /* @__PURE__ */ new Map(), tr = async (n, t) => {
221
221
  if (Nt([typeof FontFace])) {
222
222
  if (je.has(t))
223
223
  return je.get(t);
@@ -231,7 +231,7 @@ const Bn = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Ha = /* @_
231
231
  return new XMLSerializer();
232
232
  const n = ne();
233
233
  return new n.XMLSerializer();
234
- }, ja = (n) => btoa(n), Le = (n) => {
234
+ }, Ha = (n) => btoa(n), $e = (n) => {
235
235
  function t() {
236
236
  const a = new Uint8Array(n), i = 4;
237
237
  if (a.length >= i) {
@@ -258,7 +258,7 @@ const Bn = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Ha = /* @_
258
258
  const e = t();
259
259
  return e || "image/svg+xml";
260
260
  }, od = async (n) => {
261
- const t = await Pn(n), e = Bn.get(n) || Le(t);
261
+ const t = await Pn(n), e = Bn.get(n) || $e(t);
262
262
  return await nr(new Blob([t], { type: e }));
263
263
  }, er = (n) => {
264
264
  let t = "";
@@ -267,9 +267,9 @@ const Bn = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Ha = /* @_
267
267
  t += String.fromCharCode(n[a]);
268
268
  return t;
269
269
  }, ar = async (n) => {
270
- const t = Le(n), e = new Uint8Array(n), a = er(e), i = btoa(a);
270
+ const t = $e(n), e = new Uint8Array(n), a = er(e), i = btoa(a);
271
271
  return `data:${t};base64,${i}`;
272
- }, Ia = (n) => `data:image/svg+xml;base64,${btoa(n)}`, Dn = (n) => {
272
+ }, ba = (n) => `data:image/svg+xml;base64,${btoa(n)}`, Fn = (n) => {
273
273
  const t = n.replace(/\r?\n/g, ""), e = t.indexOf(",");
274
274
  if (e === -1 || e <= 4)
275
275
  throw new TypeError("malformed data: URI");
@@ -288,10 +288,10 @@ const Bn = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Ha = /* @_
288
288
  !r || !r.result ? e() : t(r.result.toString());
289
289
  }, a.readAsDataURL(n);
290
290
  });
291
- let ir, Ba;
291
+ let ir, Ia;
292
292
  const rr = (n) => {
293
- Ba = n;
294
- }, or = () => Ba;
293
+ Ia = n;
294
+ }, or = () => Ia;
295
295
  let xn;
296
296
  const sr = (n) => {
297
297
  xn = n;
@@ -302,7 +302,7 @@ const sr = (n) => {
302
302
  window.parent !== window && (window.addEventListener("message", e, !1), window.parent.postMessage("ready", t));
303
303
  }), cr = async () => {
304
304
  const n = {
305
- applicationKey: Ba,
305
+ applicationKey: Ia,
306
306
  customerToken: ir,
307
307
  bearer: xn
308
308
  };
@@ -329,7 +329,7 @@ class Ar {
329
329
  const t = Ii({
330
330
  uri: `${ft.getServerUrl()}/graphql`,
331
331
  fetch: dr
332
- }), e = Di(async (r, o) => {
332
+ }), e = Fi(async (r, o) => {
333
333
  const { headers: s } = o, l = s || {}, c = await cr();
334
334
  let d = o.bearer ?? c.bearer;
335
335
  if (this.spiffClient)
@@ -358,17 +358,17 @@ class Ar {
358
358
  s && !c?.fetchOptions?.signal?.aborted && console.log("GraphQL Network error"), l.forEach(() => console.log("GraphQL Error: " + r.operationName));
359
359
  }), i = Mi();
360
360
  return new Bi({
361
- link: Fi([i, a, e, t]),
361
+ link: Di([i, a, e, t]),
362
362
  cache: new Pi(),
363
363
  name: "Core"
364
364
  });
365
365
  }
366
366
  }
367
367
  const y = new Ar();
368
- let ha, ma;
368
+ let ua, ha;
369
369
  const Ct = (n, t, e) => {
370
- if (ha !== void 0)
371
- return ha(n, t, e);
370
+ if (ua !== void 0)
371
+ return ua(n, t, e);
372
372
  try {
373
373
  const a = Mn(!0);
374
374
  return kn(a), a.createCanvas(n, t, e);
@@ -376,8 +376,8 @@ const Ct = (n, t, e) => {
376
376
  throw new Error("Canvas module not set");
377
377
  }
378
378
  }, ie = (n, t) => {
379
- if (ma !== void 0)
380
- return ma(n, t);
379
+ if (ha !== void 0)
380
+ return ha(n, t);
381
381
  try {
382
382
  const e = Mn(!0);
383
383
  return kn(e), e.loadImage(n, t);
@@ -386,7 +386,7 @@ const Ct = (n, t, e) => {
386
386
  }
387
387
  };
388
388
  function kn(n) {
389
- ha = n?.createCanvas, ma = n?.loadImage;
389
+ ua = n?.createCanvas, ha = n?.loadImage;
390
390
  }
391
391
  function Mn(n) {
392
392
  try {
@@ -408,19 +408,19 @@ function Mn(n) {
408
408
  }
409
409
  }
410
410
  let Ye;
411
- function Pa() {
411
+ function Ba() {
412
412
  return Ye === void 0 && (Ye = Zi()), Ye;
413
413
  }
414
- let he = null;
414
+ let Ae = null;
415
415
  const ur = (n) => new Promise((t) => {
416
- if (Le(n) !== "image/jpeg")
416
+ if ($e(n) !== "image/jpeg")
417
417
  return t(1);
418
418
  Ti(n).then((a) => t(a || 1)).catch(() => t(1));
419
419
  }), hr = async () => {
420
- if (he !== null)
421
- return !he;
420
+ if (Ae !== null)
421
+ return !Ae;
422
422
  const t = await ie("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAIAAwMBEQACEQEDEQH/xABRAAEAAAAAAAAAAAAAAAAAAAAKEAEBAQADAQEAAAAAAAAAAAAGBQQDCAkCBwEBAAAAAAAAAAAAAAAAAAAAABEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AG8T9NfSMEVMhQvoP3fFiRZ+MTHDifa/95OFSZU5OzRzxkyejv8ciEfhSceSXGjS8eSdLnZc2HDm4M3BxcXwH/9k=");
423
- return he = t.width === 2 && t.height === 3, !he;
423
+ return Ae = t.width === 2 && t.height === 3, !Ae;
424
424
  }, mr = (n) => {
425
425
  const e = n.naturalWidth / n.naturalHeight;
426
426
  return n.naturalHeight <= 8192 && n.naturalWidth <= 8192 ? [n.naturalWidth, n.naturalHeight] : n.naturalHeight > n.naturalWidth ? [e * 8192, 8192] : [8192, 8192 / e];
@@ -455,9 +455,9 @@ const ur = (n) => new Promise((t) => {
455
455
  break;
456
456
  }
457
457
  return d.drawImage(e, 0, 0, s, l), c;
458
- }, Ve = async (n) => {
458
+ }, Ue = async (n) => {
459
459
  const t = await gr(n);
460
- return Le(n) === "image/jpeg" ? {
460
+ return $e(n) === "image/jpeg" ? {
461
461
  dataUrl: t.toDataURL("image/jpeg", 1),
462
462
  height: t.height,
463
463
  width: t.width
@@ -3188,20 +3188,20 @@ function cd(n, t) {
3188
3188
  let Ot = null;
3189
3189
  function wr(n) {
3190
3190
  if (n.startsWith("#"))
3191
- return Ya(n);
3191
+ return ja(n);
3192
3192
  if (!document)
3193
3193
  throw new Error("browserColorToHex is only supported on browsers");
3194
3194
  if (Ot || (Ot = document.createElement("canvas").getContext("2d")), !Ot)
3195
3195
  throw new Error("Failed to create canvas context required to convert colors");
3196
3196
  Ot.fillStyle = n;
3197
- const t = Ya(Ot.fillStyle);
3197
+ const t = ja(Ot.fillStyle);
3198
3198
  return t || console.error(`Unknown browser color ${n}`), t;
3199
3199
  }
3200
- function Ya(n) {
3200
+ function ja(n) {
3201
3201
  const t = n.substring(1).toUpperCase();
3202
3202
  return t.length === 6 ? t : t.length === 3 ? `${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}` : "";
3203
3203
  }
3204
- const me = (n) => {
3204
+ const ue = (n) => {
3205
3205
  const t = Tn(n.spotColor);
3206
3206
  return t ? `${n.browserValue} ${t}` : n.browserValue;
3207
3207
  }, Tn = (n) => {
@@ -3212,7 +3212,7 @@ const me = (n) => {
3212
3212
  return `icc-named-color(${t.slice(e + 1).slice(0, -4)}, ${n.namedColor})`;
3213
3213
  }
3214
3214
  return `icc-named-color(${n.profileName}, ${n.namedColor})`;
3215
- }, Ja = (n) => {
3215
+ }, Ya = (n) => {
3216
3216
  const t = n.split(/[ ](?=[^)]*?(?:\(|$))/);
3217
3217
  if (t.length === 0)
3218
3218
  return { browserValue: "#000000" };
@@ -3234,7 +3234,7 @@ const me = (n) => {
3234
3234
  } catch {
3235
3235
  return n.classList.contains(t.substring(1));
3236
3236
  }
3237
- }, Fa = (n, t = !1) => {
3237
+ }, Pa = (n, t = !1) => {
3238
3238
  !t && n.setAttribute("preserveAspectRatio", "none");
3239
3239
  const e = [];
3240
3240
  Mt(n, (a) => {
@@ -3287,13 +3287,13 @@ const me = (n) => {
3287
3287
  if (s)
3288
3288
  a.setAttribute(
3289
3289
  "fill",
3290
- e ? me(s) : s.browserValue
3290
+ e ? ue(s) : s.browserValue
3291
3291
  );
3292
3292
  else {
3293
3293
  const l = t[o];
3294
3294
  l && a.setAttribute(
3295
3295
  "fill",
3296
- e ? me(l) : l.browserValue
3296
+ e ? ue(l) : l.browserValue
3297
3297
  );
3298
3298
  }
3299
3299
  }
@@ -3305,13 +3305,13 @@ const me = (n) => {
3305
3305
  if (s)
3306
3306
  a.setAttribute(
3307
3307
  "stroke",
3308
- e ? me(s) : s.browserValue
3308
+ e ? ue(s) : s.browserValue
3309
3309
  );
3310
3310
  else {
3311
3311
  const l = t[o];
3312
3312
  l && a.setAttribute(
3313
3313
  "fill",
3314
- e ? me(l) : l.browserValue
3314
+ e ? ue(l) : l.browserValue
3315
3315
  );
3316
3316
  }
3317
3317
  }
@@ -3322,7 +3322,7 @@ const me = (n) => {
3322
3322
  if (!r)
3323
3323
  throw new Error("Failed to read SVG.");
3324
3324
  return Er(r, t, e), Qn(r, a, i), Rn(r);
3325
- }, xa = (n, t, e) => {
3325
+ }, Fa = (n, t, e) => {
3326
3326
  const a = Nn(n);
3327
3327
  if (!a)
3328
3328
  throw new Error("Failed to read SVG.");
@@ -3334,17 +3334,17 @@ const me = (n) => {
3334
3334
  const e = br(n).firstElementChild;
3335
3335
  if (!e)
3336
3336
  throw new Error("Failed to read SVG.");
3337
- Fa(e);
3337
+ Pa(e);
3338
3338
  const a = {};
3339
3339
  Mt(e, (o) => {
3340
3340
  const s = o.attributes.getNamedItem("fill");
3341
3341
  if (s && s.value !== "none" && !s.value.startsWith("url(")) {
3342
- const c = Ja(s.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-fill-${d}`;
3342
+ const c = Ya(s.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-fill-${d}`;
3343
3343
  o.setAttribute("fill", c.browserValue), o.classList.add(A), a[d] = c;
3344
3344
  }
3345
3345
  const l = o.attributes.getNamedItem("stroke");
3346
3346
  if (l && l.value !== "none" && !l.value.startsWith("url(")) {
3347
- const c = Ja(l.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-stroke-${d}`;
3347
+ const c = Ya(l.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-stroke-${d}`;
3348
3348
  o.classList.add(A), o.setAttribute("stroke", c.browserValue), a[d] = c;
3349
3349
  }
3350
3350
  });
@@ -3410,7 +3410,7 @@ const me = (n) => {
3410
3410
  ...AssetFields
3411
3411
  }
3412
3412
  }
3413
- `, ka = C`
3413
+ `, xa = C`
3414
3414
  fragment MaterialFields on Material {
3415
3415
  id
3416
3416
  name
@@ -3458,13 +3458,13 @@ const me = (n) => {
3458
3458
  }
3459
3459
  }
3460
3460
  `, Pr = C`
3461
- ${ka}
3461
+ ${xa}
3462
3462
  query GetMaterials($ids: [String]) {
3463
3463
  materials(id: $ids) {
3464
3464
  ...MaterialFields
3465
3465
  }
3466
3466
  }
3467
- `, Fr = C`
3467
+ `, Dr = C`
3468
3468
  mutation CreateAsset($name: String!, $type: String!, $mimeType: String!, $anonymous: Boolean, $temporary: Boolean) {
3469
3469
  assetCreate(name: $name, type: $type, mimeType: $mimeType, anonymous: $anonymous, temporary: $temporary) {
3470
3470
  uploadUrl
@@ -3478,14 +3478,14 @@ const me = (n) => {
3478
3478
  }
3479
3479
  }
3480
3480
  }
3481
- `, Dr = C`
3481
+ `, Fr = C`
3482
3482
  ${re(!1)}
3483
3483
  mutation RemoveBackgroundFromAsset($key: String!) {
3484
3484
  assetRemoveBackground(key: $key) {
3485
3485
  ...AssetFields
3486
3486
  }
3487
3487
  }
3488
- `, ke = async (n) => (await y.getShadowGraphqlClient().query({
3488
+ `, Fe = async (n) => (await y.getShadowGraphqlClient().query({
3489
3489
  query: Br,
3490
3490
  errorPolicy: "all",
3491
3491
  fetchPolicy: "no-cache",
@@ -3499,7 +3499,7 @@ const me = (n) => {
3499
3499
  ids: n
3500
3500
  }
3501
3501
  })).data.materials, kr = async (n, t, e, a, i) => (await y.getShadowGraphqlClient().mutate({
3502
- mutation: Fr,
3502
+ mutation: Dr,
3503
3503
  errorPolicy: "all",
3504
3504
  fetchPolicy: "no-cache",
3505
3505
  variables: {
@@ -3513,7 +3513,7 @@ const me = (n) => {
3513
3513
  class Mr {
3514
3514
  constructor() {
3515
3515
  this.cache = /* @__PURE__ */ new Map(), this.bgrmProcessCache = /* @__PURE__ */ new Map(), this.materialCache = /* @__PURE__ */ new Map(), this.loadImageAsFileInfo = async (t) => {
3516
- const e = await t.arrayBuffer(), a = await Ve(e), i = (r, o) => {
3516
+ const e = await t.arrayBuffer(), a = await Ue(e), i = (r, o) => {
3517
3517
  const s = atob(r.split(",")[1]), l = [];
3518
3518
  for (let c = 0; c < s.length; c++)
3519
3519
  l.push(s.charCodeAt(c));
@@ -3534,14 +3534,14 @@ class Mr {
3534
3534
  if (!i) throw new R("Failed to get asset from cache!");
3535
3535
  return i;
3536
3536
  }
3537
- const a = (async () => (await ke([t]))[0])();
3537
+ const a = (async () => (await Fe([t]))[0])();
3538
3538
  return this.cache.set(t, a), a;
3539
3539
  }
3540
3540
  /**
3541
3541
  * Retrieves the asset from the server, bypassing cache (but still writing the result to cache)
3542
3542
  */
3543
3543
  async getFromServer(t) {
3544
- const a = (async () => (await ke([t]))[0])();
3544
+ const a = (async () => (await Fe([t]))[0])();
3545
3545
  return this.cache.set(t, a), a;
3546
3546
  }
3547
3547
  keyFromURL(t) {
@@ -3600,7 +3600,7 @@ class Mr {
3600
3600
  }, a, i);
3601
3601
  }
3602
3602
  async uploadFile(t, e) {
3603
- const i = this.isRaster(t) ? Pe.Image : Pe.Illustration, r = await this.loadImageAsFileInfo(t);
3603
+ const i = this.isRaster(t) ? Ie.Image : Ie.Illustration, r = await this.loadImageAsFileInfo(t);
3604
3604
  return await this.uploadAssetWithProgress(r, i, e, !0);
3605
3605
  }
3606
3606
  async removeBackgroundFromAsset(t) {
@@ -3613,7 +3613,7 @@ class Mr {
3613
3613
  }
3614
3614
  const i = (async () => {
3615
3615
  const r = await y.getShadowGraphqlClient().mutate({
3616
- mutation: Dr,
3616
+ mutation: Fr,
3617
3617
  fetchPolicy: "no-cache",
3618
3618
  errorPolicy: "all",
3619
3619
  variables: {
@@ -3647,7 +3647,7 @@ class Mr {
3647
3647
  async postProcessFileUpload(t, e) {
3648
3648
  if (e === "image/svg+xml") {
3649
3649
  const a = await t.blob.text(), o = new window.DOMParser().parseFromString(a, "image/svg+xml").documentElement;
3650
- if (!o) throw new Dt("Failed to read SVG.");
3650
+ if (!o) throw new Ft("Failed to read SVG.");
3651
3651
  vr(o);
3652
3652
  const l = Pt().serializeToString(o);
3653
3653
  return {
@@ -3736,7 +3736,7 @@ const $t = "persistentAssets", ct = class ct {
3736
3736
  };
3737
3737
  ct.callbacks = [];
3738
3738
  let ht = ct;
3739
- const Ka = "bgrmPersistentAssets";
3739
+ const Ja = "bgrmPersistentAssets";
3740
3740
  class _ {
3741
3741
  static has(t) {
3742
3742
  return _.getMap().has(t);
@@ -3763,10 +3763,10 @@ class _ {
3763
3763
  a && (e.delete(a), _.setMap(e));
3764
3764
  }
3765
3765
  static getMap() {
3766
- return k.getMap(Ka) || /* @__PURE__ */ new Map();
3766
+ return k.getMap(Ja) || /* @__PURE__ */ new Map();
3767
3767
  }
3768
3768
  static setMap(t) {
3769
- k.setMap(Ka, t);
3769
+ k.setMap(Ja, t);
3770
3770
  }
3771
3771
  }
3772
3772
  const V = new Mr();
@@ -3842,7 +3842,7 @@ const Zt = new Tr(), On = C`
3842
3842
  }
3843
3843
  `, Nr = C`
3844
3844
  ${re(!1)}
3845
- ${ka}
3845
+ ${xa}
3846
3846
  ${On}
3847
3847
  query GetOptions($ids: [String]!) {
3848
3848
  options(ids: $ids) {
@@ -3931,7 +3931,7 @@ const J = new $r(), $n = C`
3931
3931
  currencyCode
3932
3932
  }
3933
3933
  }
3934
- `, ze = C`
3934
+ `, Le = C`
3935
3935
  fragment AdditionalIntegrationProductFields on IntegrationProduct {
3936
3936
  id
3937
3937
  product {
@@ -4046,7 +4046,7 @@ const J = new $r(), $n = C`
4046
4046
  url
4047
4047
  }
4048
4048
  `, Lr = C`
4049
- ${ze}
4049
+ ${Le}
4050
4050
  ${oe}
4051
4051
  ${$n}
4052
4052
  query ReadIntegrationProducts($ids: [String!]!) {
@@ -4292,7 +4292,7 @@ const J = new $r(), $n = C`
4292
4292
  }
4293
4293
  }
4294
4294
  `, Gn = (n) => C`
4295
- ${ze}
4295
+ ${Le}
4296
4296
  fragment IntegrationProductFields on IntegrationProduct {
4297
4297
  id
4298
4298
  externalProductId
@@ -4529,7 +4529,7 @@ const J = new $r(), $n = C`
4529
4529
  }
4530
4530
  `, ao = (n) => C`
4531
4531
  ${re(n)}
4532
- ${ka}
4532
+ ${xa}
4533
4533
  ${On}
4534
4534
  ${Xr}
4535
4535
  ${Zr}
@@ -4973,7 +4973,7 @@ const J = new $r(), $n = C`
4973
4973
  }
4974
4974
  }
4975
4975
  }
4976
- `, Ge = C`
4976
+ `, Ve = C`
4977
4977
  ${oe}
4978
4978
  fragment MarketplaceThemeInstallConfigurationFields on MarketplaceThemeInstallConfiguration {
4979
4979
  id
@@ -5042,7 +5042,7 @@ const J = new $r(), $n = C`
5042
5042
  }
5043
5043
  }
5044
5044
  `, ro = C`
5045
- ${Ge}
5045
+ ${Ve}
5046
5046
  query GetMarketplaceThemeInstallConfiguration($themeConfigurationId: String!, $themeInstallId: String!) {
5047
5047
  marketplaceThemeInstallConfiguration(id: $themeConfigurationId, themeInstallId: $themeInstallId, raw: false) {
5048
5048
  ...MarketplaceThemeInstallConfigurationFields
@@ -5050,7 +5050,7 @@ const J = new $r(), $n = C`
5050
5050
  }
5051
5051
  `, oo = C`
5052
5052
  ${$n}
5053
- ${Ge}
5053
+ ${Ve}
5054
5054
  query GetCurrentIntegration($themeConfigurationId: String) {
5055
5055
  currentIntegration {
5056
5056
  id
@@ -5062,7 +5062,7 @@ const J = new $r(), $n = C`
5062
5062
  }
5063
5063
  }
5064
5064
  `, so = C`
5065
- ${Ge}
5065
+ ${Ve}
5066
5066
  query ReadTransactionForMarketplaceTheme($id: String!) {
5067
5067
  transactions(ids: [$id]) {
5068
5068
  marketplaceThemeInstallConfiguration(raw: false) {
@@ -5071,7 +5071,7 @@ const J = new $r(), $n = C`
5071
5071
  }
5072
5072
  }
5073
5073
  `, lo = C`
5074
- ${Ge}
5074
+ ${Ve}
5075
5075
  query ReadBundleForMarketplaceTheme($id: String!) {
5076
5076
  bundles(ids: [$id]) {
5077
5077
  marketplaceThemeInstallConfiguration(raw: false) {
@@ -5275,14 +5275,14 @@ const M = () => {
5275
5275
  viewBox: A,
5276
5276
  width: u
5277
5277
  }) => {
5278
- const h = e || 0, m = 2 * (l?.scale || 1), p = A || { x: 0, y: 0, width: u, height: r }, g = `${p.x} ${p.y} ${p.width} ${p.height}`, f = M(), S = a.purpose === Kt.FreeDesign && /* @__PURE__ */ P("defs", { children: /* @__PURE__ */ P("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ P("rect", { width: p.width, height: p.height, rx: h }) }) }), w = a.colorProfiles?.map((E, F) => (
5278
+ const h = e || 0, m = 2 * (l?.scale || 1), p = A || { x: 0, y: 0, width: u, height: r }, g = `${p.x} ${p.y} ${p.width} ${p.height}`, f = M(), S = a.purpose === Kt.FreeDesign && /* @__PURE__ */ P("defs", { children: /* @__PURE__ */ P("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ P("rect", { width: p.width, height: p.height, rx: h }) }) }), w = a.colorProfiles?.map((E, D) => (
5279
5279
  /* @ts-ignore */
5280
- /* @__PURE__ */ P("color-profile", { name: E.name, xlinkHref: E.key, children: " " }, F)
5280
+ /* @__PURE__ */ P("color-profile", { name: E.name, xlinkHref: E.key, children: " " }, D)
5281
5281
  )), I = i.map((E) => ({
5282
5282
  ...E,
5283
5283
  _renderingConfiguration: a,
5284
5284
  mask: l ? `url(#viewmask-${f})` : void 0
5285
- })), b = Ta(I);
5285
+ })), b = Ma(I);
5286
5286
  return /* @__PURE__ */ dt(
5287
5287
  "svg",
5288
5288
  {
@@ -5389,7 +5389,7 @@ const M = () => {
5389
5389
  }), fd = (n, t, e, a) => ({
5390
5390
  x: n.x + (t?.x + t?.width) * e,
5391
5391
  y: n.y + (t?.y + t?.height) * a
5392
- }), Ft = (n) => {
5392
+ }), Dt = (n) => {
5393
5393
  switch (n) {
5394
5394
  case Y.North:
5395
5395
  return Y.East;
@@ -5408,7 +5408,7 @@ const M = () => {
5408
5408
  case Y.Southwest:
5409
5409
  return Y.Northwest;
5410
5410
  }
5411
- }, Cd = (n, t) => t > 45 && t <= 135 ? Ft(n) : t > 135 && t <= 225 ? Ft(Ft(n)) : t > 225 && t <= 315 ? Ft(Ft(Ft(n))) : n, wd = (n, t = { x: 0, y: 0 }, e = { x: 1, y: 1 }) => {
5411
+ }, Cd = (n, t) => t > 45 && t <= 135 ? Dt(n) : t > 135 && t <= 225 ? Dt(Dt(n)) : t > 225 && t <= 315 ? Dt(Dt(Dt(n))) : n, wd = (n, t = { x: 0, y: 0 }, e = { x: 1, y: 1 }) => {
5412
5412
  const a = wt(n.rotation), i = {
5413
5413
  x: t.x + n.x * e.x,
5414
5414
  y: t.x + n.y * e.y
@@ -5426,13 +5426,13 @@ const M = () => {
5426
5426
  y: s.y - n.height * e.y / 2
5427
5427
  };
5428
5428
  return {
5429
- a: ge(i, l, a),
5430
- b: ge(r, l, a),
5431
- c: ge(o, l, a),
5432
- d: ge(s, l, a),
5429
+ a: he(i, l, a),
5430
+ b: he(r, l, a),
5431
+ c: he(o, l, a),
5432
+ d: he(s, l, a),
5433
5433
  center: l
5434
5434
  };
5435
- }, ge = (n, t, e) => {
5435
+ }, he = (n, t, e) => {
5436
5436
  const a = Math.sin(e), i = Math.cos(e);
5437
5437
  return {
5438
5438
  x: (n.x - t.x) * i - (n.y - t.y) * a + t.x,
@@ -5461,7 +5461,7 @@ const M = () => {
5461
5461
  }
5462
5462
  ) });
5463
5463
  }, jn = (n) => {
5464
- const t = `spiff-group-clip-${n.id}`, e = n.rotation || 0, a = wt(e), i = Math.cos(a), r = -Math.sin(a), o = Ta(n.children);
5464
+ const t = `spiff-group-clip-${n.id}`, e = n.rotation || 0, a = wt(e), i = Math.cos(a), r = -Math.sin(a), o = Ma(n.children);
5465
5465
  return /* @__PURE__ */ dt(qt, { children: [
5466
5466
  /* @__PURE__ */ P("defs", { children: /* @__PURE__ */ P("clipPath", { id: t, preserveAspectRatio: "none", children: n.clipPath ? /* @__PURE__ */ P("path", { d: n.clipPath }) : /* @__PURE__ */ P("rect", { x: 0, y: 0, width: n.width, height: n.height }) }) }),
5467
5467
  /* @__PURE__ */ dt(
@@ -5496,8 +5496,8 @@ const M = () => {
5496
5496
  if (!n.pattern)
5497
5497
  return "";
5498
5498
  if (n.pattern.svg) {
5499
- const A = xa(n.pattern.svg, n.pattern.colors || {}, !1);
5500
- return Ia(A);
5499
+ const A = Fa(n.pattern.svg, n.pattern.colors || {}, !1);
5500
+ return ba(A);
5501
5501
  }
5502
5502
  return n.pattern.src;
5503
5503
  };
@@ -5526,7 +5526,7 @@ const M = () => {
5526
5526
  const A = n.pattern?.x || 0, u = n.pattern?.y || 0, h = n.pattern?.width || 0, m = n.pattern?.height || 0, p = n.pattern?.scaleX || 1, g = n.pattern?.scaleY || 1, f = n.pattern?.rotation || 0;
5527
5527
  return [n.pattern?.svg ? {
5528
5528
  id: `${t}-contents`,
5529
- type: D.Illustration,
5529
+ type: F.Illustration,
5530
5530
  x: A,
5531
5531
  y: u,
5532
5532
  rotation: f,
@@ -5537,7 +5537,7 @@ const M = () => {
5537
5537
  colors: n.pattern?.colors
5538
5538
  } : {
5539
5539
  id: `${t}-contents`,
5540
- type: D.Image,
5540
+ type: F.Image,
5541
5541
  x: A,
5542
5542
  y: u,
5543
5543
  rotation: f,
@@ -5640,24 +5640,24 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
5640
5640
  return yt(n).getFont();
5641
5641
  } catch {
5642
5642
  if (wo(n)) {
5643
- const a = Dn(n), i = ca(a);
5644
- return ga(n, i), i;
5643
+ const a = Fn(n), i = la(a);
5644
+ return ma(n, i), i;
5645
5645
  } else {
5646
- const a = await Ue(n, !0), i = ca(a);
5647
- return ga(n, i), await tr(i, n), i;
5646
+ const a = await Oe(n, !0), i = la(a);
5647
+ return ma(n, i), await tr(i, n), i;
5648
5648
  }
5649
5649
  }
5650
5650
  })();
5651
5651
  return Ke.set(n, e), e;
5652
5652
  }, yo = (n) => {
5653
- const t = Dn(n), e = ca(t);
5654
- return ga(n, e), e;
5653
+ const t = Fn(n), e = la(t);
5654
+ return ma(n, e), e;
5655
5655
  }, yt = (n) => {
5656
5656
  const t = Yn.get(n);
5657
5657
  if (t)
5658
5658
  return t;
5659
5659
  throw new Error("Font metrics unavailable for font");
5660
- }, ga = (n, t) => {
5660
+ }, ma = (n, t) => {
5661
5661
  const e = new Co(t);
5662
5662
  return Yn.set(n, e), e;
5663
5663
  }, vd = async (n) => {
@@ -5683,28 +5683,28 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
5683
5683
  let b = 0;
5684
5684
  const E = A.getAttribute("text-anchor");
5685
5685
  E === "middle" ? b = I / 2 : E === "end" && (b = I);
5686
- const F = p.getPath(
5686
+ const D = p.getPath(
5687
5687
  A.innerHTML,
5688
5688
  parseFloat(A.getAttribute("x") ?? "0") - b,
5689
5689
  parseFloat(A.getAttribute("y") ?? "0"),
5690
5690
  parseInt(u.getAttribute("font-size") ?? "72")
5691
5691
  );
5692
- F.fill = g, F.stroke = f, F.strokeWidth = parseFloat(S ?? "0");
5693
- const x = F.toSVG(2), $ = t.parseFromString(x, "image/svg+xml").firstElementChild;
5692
+ D.fill = g, D.stroke = f, D.strokeWidth = parseFloat(S ?? "0");
5693
+ const x = D.toSVG(2), $ = t.parseFromString(x, "image/svg+xml").firstElementChild;
5694
5694
  h.appendChild($);
5695
5695
  }
5696
5696
  return e.querySelectorAll("text").forEach((d) => d.remove()), Pt().serializeToString(a);
5697
- }, Me = (n, t, e, a) => Math.max(bo(n.join(`
5698
- `), e, a), t), _a = (n, t, e, a, i, r) => {
5697
+ }, xe = (n, t, e, a) => Math.max(bo(n.join(`
5698
+ `), e, a), t), Ka = (n, t, e, a, i, r) => {
5699
5699
  const o = (r || _n) * i.getApproximateHeight(), s = t.split(`
5700
5700
  `);
5701
5701
  try {
5702
- const l = s.flatMap((d) => ve(d, n.width, a, i)), c = l.flatMap((d) => d.lines);
5702
+ const l = s.flatMap((d) => ye(d, n.width, a, i)), c = l.flatMap((d) => d.lines);
5703
5703
  return {
5704
5704
  lines: c,
5705
5705
  requiredHeight: l.flatMap((d) => d.lines).length * (a * o),
5706
5706
  fontSize: e,
5707
- requiredWidth: Me(c, n.width, a, i)
5707
+ requiredWidth: xe(c, n.width, a, i)
5708
5708
  };
5709
5709
  } catch {
5710
5710
  const c = t.split("");
@@ -5712,17 +5712,17 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
5712
5712
  lines: c,
5713
5713
  requiredHeight: c.length * (a * o),
5714
5714
  fontSize: e,
5715
- requiredWidth: Me(c, n.width, a, i)
5715
+ requiredWidth: xe(c, n.width, a, i)
5716
5716
  };
5717
5717
  }
5718
- }, ve = (n, t, e, a) => {
5718
+ }, ye = (n, t, e, a) => {
5719
5719
  const i = pt(n, e, a);
5720
5720
  if (i <= t)
5721
5721
  return { lines: [n], width: i };
5722
5722
  if (!(n.indexOf(" ") > -1)) {
5723
5723
  if (n.length <= 1)
5724
5724
  throw new Error(`Character ${n} is wider than region`);
5725
- const d = Math.floor(n.length / 2), A = ve(n.slice(0, d), t, e, a), u = ve(n.slice(d), t, e, a);
5725
+ const d = Math.floor(n.length / 2), A = ye(n.slice(0, d), t, e, a), u = ye(n.slice(d), t, e, a);
5726
5726
  return { lines: [...A.lines, ...u.lines], width: Math.max(A.width, u.width) };
5727
5727
  }
5728
5728
  const o = n.split(" "), s = [];
@@ -5730,7 +5730,7 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
5730
5730
  for (; c < o.length; ) {
5731
5731
  const d = o[c];
5732
5732
  if (pt(d, e, a) > t) {
5733
- const A = ve(d, t, e, a);
5733
+ const A = ye(d, t, e, a);
5734
5734
  s.push(...A.lines), l = Math.max(l, A.width), c++;
5735
5735
  } else {
5736
5736
  const A = [d];
@@ -5752,7 +5752,7 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
5752
5752
  }, vo = (n, t, e, a) => {
5753
5753
  const i = yt(t.fontData.assetUrl), r = i.getFont(), o = t.fontSize / r.unitsPerEm;
5754
5754
  if (!e)
5755
- return _a(t, n, t.fontSize, o, i, a);
5755
+ return Ka(t, n, t.fontSize, o, i, a);
5756
5756
  let s;
5757
5757
  if (t.text ? s = t.text.split(`
5758
5758
  `) : s = t.input?.split(`
@@ -5760,16 +5760,16 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
5760
5760
  return {
5761
5761
  lines: s,
5762
5762
  requiredHeight: t.height,
5763
- requiredWidth: Me(s, t.width, o, i),
5763
+ requiredWidth: xe(s, t.width, o, i),
5764
5764
  fontSize: t.fontSize
5765
5765
  };
5766
5766
  const l = t.width !== e.width != (t.height !== e.height);
5767
5767
  return t.lineHeight === e.lineHeight && !l && e.input === n ? {
5768
5768
  lines: s,
5769
5769
  requiredHeight: t.height,
5770
- requiredWidth: Me(s, t.width, o, i),
5770
+ requiredWidth: xe(s, t.width, o, i),
5771
5771
  fontSize: So(s, i, r, t.width, t.height, a)
5772
- } : _a(t, n, t.fontSize, o, i, a);
5772
+ } : Ka(t, n, t.fontSize, o, i, a);
5773
5773
  }, Eo = (n, t, e, a, i) => {
5774
5774
  const o = yt(t.assetUrl).getFont();
5775
5775
  let s = { ...n };
@@ -5798,12 +5798,12 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
5798
5798
  return n.forEach((i) => {
5799
5799
  a = Math.max(a, pt(i, t, e));
5800
5800
  }), a;
5801
- }, Xa = {
5801
+ }, _a = {
5802
5802
  stripControlCharacters: !0,
5803
5803
  vertical: !1,
5804
5804
  uppercase: !1
5805
- }, Te = (n, t = Xa) => {
5806
- const e = { ...Xa, ...t };
5805
+ }, ke = (n, t = _a) => {
5806
+ const e = { ..._a, ...t };
5807
5807
  let a = n || "";
5808
5808
  return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
5809
5809
  `)), a;
@@ -5897,8 +5897,8 @@ const Po = (n) => {
5897
5897
  },
5898
5898
  stroke: A,
5899
5899
  strokeWidth: u,
5900
- children: n.curved ? /* @__PURE__ */ P(Do, { text: c, curvedPathId: r, align: n.align }) : d.map((m, p) => /* @__PURE__ */ P(
5901
- Fo,
5900
+ children: n.curved ? /* @__PURE__ */ P(Fo, { text: c, curvedPathId: r, align: n.align }) : d.map((m, p) => /* @__PURE__ */ P(
5901
+ Do,
5902
5902
  {
5903
5903
  align: n.vertical ? "center" : n.align,
5904
5904
  fontSize: n.fontSize,
@@ -5917,7 +5917,7 @@ const Po = (n) => {
5917
5917
  }
5918
5918
  ) }) })
5919
5919
  ] });
5920
- }, Fo = (n) => {
5920
+ }, Do = (n) => {
5921
5921
  const t = () => {
5922
5922
  if (n.lineHeight !== void 0)
5923
5923
  return n.lineHeight * n.fontSize;
@@ -5935,7 +5935,7 @@ const Po = (n) => {
5935
5935
  return (n.thisLineIdx - o) * i + n.fontSize / 4;
5936
5936
  };
5937
5937
  return /* @__PURE__ */ P("tspan", { textAnchor: Kn(n.align), x: e(), y: `${a()}px`, children: n.text });
5938
- }, Do = (n) => {
5938
+ }, Fo = (n) => {
5939
5939
  const t = `#${n.curvedPathId}`;
5940
5940
  return /* @__PURE__ */ P(
5941
5941
  "textPath",
@@ -6055,7 +6055,7 @@ class ko {
6055
6055
  layout: t,
6056
6056
  elements: e
6057
6057
  },
6058
- getComponentWithProps: (a) => Ma(t, e, a)
6058
+ getComponentWithProps: (a) => ka(t, e, a)
6059
6059
  };
6060
6060
  }
6061
6061
  initialize(t, e) {
@@ -6080,7 +6080,7 @@ class ko {
6080
6080
  return { ...t, transaction: e.apply(a) };
6081
6081
  }
6082
6082
  }
6083
- const Zn = (n) => n.type === D.Image ? /* @__PURE__ */ P(Hn, { ...n }, n.id) : n.type === D.Frame ? /* @__PURE__ */ P(fo, { ...n }, n.id) : n.type === D.Illustration ? /* @__PURE__ */ P(xo, { ...n }, n.id) : n.type === D.Textbox ? /* @__PURE__ */ P(Po, { ...n }, n.id) : n.type === D.Group ? /* @__PURE__ */ P(jn, { ...n }, n.id) : null, Ma = (n, t, e) => {
6083
+ const Zn = (n) => n.type === F.Image ? /* @__PURE__ */ P(Hn, { ...n }, n.id) : n.type === F.Frame ? /* @__PURE__ */ P(fo, { ...n }, n.id) : n.type === F.Illustration ? /* @__PURE__ */ P(xo, { ...n }, n.id) : n.type === F.Textbox ? /* @__PURE__ */ P(Po, { ...n }, n.id) : n.type === F.Group ? /* @__PURE__ */ P(jn, { ...n }, n.id) : null, ka = (n, t, e) => {
6084
6084
  const a = e.renderingConfiguration, i = a?.removeExcludedElements ? t.filter((r) => !r.excludeFromExport) : t;
6085
6085
  return /* @__PURE__ */ P(
6086
6086
  po,
@@ -6111,7 +6111,7 @@ const Zn = (n) => n.type === D.Image ? /* @__PURE__ */ P(Hn, { ...n }, n.id) : n
6111
6111
  }
6112
6112
  );
6113
6113
  };
6114
- function Ta(n) {
6114
+ function Ma(n) {
6115
6115
  return n.sort((t, e) => {
6116
6116
  const a = t.layer || 0, i = e.layer || 0;
6117
6117
  if (a < i) return -1;
@@ -6131,10 +6131,10 @@ const le = (n) => {
6131
6131
  }, mt = /* @__PURE__ */ new Map(), Gt = /* @__PURE__ */ new Map(), Xe = /* @__PURE__ */ new Map(), ti = async (n, t) => {
6132
6132
  if (!t) {
6133
6133
  if (!n) throw new Error("No region or src supplied. Cannot construct frame!");
6134
- return pa(n);
6134
+ return ga(n);
6135
6135
  }
6136
6136
  return nt(t);
6137
- }, pa = (n) => {
6137
+ }, ga = (n) => {
6138
6138
  const t = n.width, e = n.height;
6139
6139
  return `<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${t} ${e}'>
6140
6140
  <path id="target-path" d='M0 0 h ${t} v ${e} h ${-t} Z' />
@@ -6149,7 +6149,7 @@ const le = (n) => {
6149
6149
  if (!e.asset)
6150
6150
  throw new Error(`No asset for variant with ID: ${n.frameVariantId}`);
6151
6151
  return e;
6152
- }, We = async (n) => {
6152
+ }, ze = async (n) => {
6153
6153
  if (Xe.has(n))
6154
6154
  return Xe.get(n);
6155
6155
  const e = (async () => {
@@ -6188,7 +6188,7 @@ const le = (n) => {
6188
6188
  throw new Error("Malformed frame SVG");
6189
6189
  })();
6190
6190
  return Xe.set(n, e), e;
6191
- }, Na = (n, t, e, a) => {
6191
+ }, Ta = (n, t, e, a) => {
6192
6192
  const i = t.width / t.height, r = n.width / n.height;
6193
6193
  let o;
6194
6194
  a ? r > i ? o = t.height / n.height : o = t.width / n.width : r > i ? o = t.width / n.width : o = t.height / n.height, e?.scale !== void 0 && (o *= e?.scale);
@@ -6198,7 +6198,7 @@ const le = (n) => {
6198
6198
  y: u,
6199
6199
  zoom: o
6200
6200
  };
6201
- }, fa = async (n) => {
6201
+ }, pa = async (n) => {
6202
6202
  if (mt.has(n))
6203
6203
  return mt.get(n);
6204
6204
  if (n.startsWith("data:image/svg+xml")) {
@@ -6211,7 +6211,7 @@ const le = (n) => {
6211
6211
  return mt.set(n, r), r;
6212
6212
  }
6213
6213
  if ((n.split(".").pop()?.toLowerCase() ?? "") === "svg") {
6214
- const e = await Qa(n), a = e.width, i = e.height, r = {
6214
+ const e = await Na(n), a = e.width, i = e.height, r = {
6215
6215
  src: n,
6216
6216
  width: a,
6217
6217
  height: i,
@@ -6219,7 +6219,7 @@ const le = (n) => {
6219
6219
  };
6220
6220
  return mt.set(n, r), r;
6221
6221
  } else {
6222
- const e = await Ue(n, !0), a = await Ve(e), i = {
6222
+ const e = await Oe(n, !0), a = await Ue(e), i = {
6223
6223
  src: n,
6224
6224
  width: a.width,
6225
6225
  height: a.height,
@@ -6227,14 +6227,14 @@ const le = (n) => {
6227
6227
  };
6228
6228
  return mt.set(n, i), i;
6229
6229
  }
6230
- }, Qa = async (n) => {
6230
+ }, Na = async (n) => {
6231
6231
  const t = await nt(n);
6232
6232
  return ei(t);
6233
- }, Za = (n) => n.endsWith("mm") ? Number(n.replace("mm", "")) * 3.7795275591 : n.endsWith("px") ? Number(n.replace("px", "")) : Number(n), ei = (n) => {
6233
+ }, Xa = (n) => n.endsWith("mm") ? Number(n.replace("mm", "")) * 3.7795275591 : n.endsWith("px") ? Number(n.replace("px", "")) : Number(n), ei = (n) => {
6234
6234
  const a = At().parseFromString(n, "image/svg+xml").querySelector("svg");
6235
6235
  if (!a)
6236
6236
  throw new Error("No svg tag found, this svg must be malformed!");
6237
- const i = a.getAttribute("viewBox"), r = a.getAttribute("width"), o = a.getAttribute("height"), s = o && r ? [0, 0, Za(r), Za(o)] : i?.split(" ").map((l) => Number(l));
6237
+ const i = a.getAttribute("viewBox"), r = a.getAttribute("width"), o = a.getAttribute("height"), s = o && r ? [0, 0, Xa(r), Xa(o)] : i?.split(" ").map((l) => Number(l));
6238
6238
  if (!s)
6239
6239
  throw new Error("No viewbox or width/height values detected on SVG file!");
6240
6240
  return {
@@ -6266,12 +6266,12 @@ const le = (n) => {
6266
6266
  const o = At().parseFromString(n, "image/svg+xml").firstElementChild;
6267
6267
  if (!o)
6268
6268
  throw new Error("Failed to read SVG");
6269
- const l = Pt().serializeToString(o), c = Ct(), d = c.getContext("2d"), A = await Ea.from(d, l, {
6269
+ const l = Pt().serializeToString(o), c = Ct(), d = c.getContext("2d"), A = await va.from(d, l, {
6270
6270
  anonymousCrossOrigin: !0,
6271
6271
  ignoreDimensions: !1,
6272
6272
  createCanvas: Ct,
6273
6273
  createImage: ie,
6274
- DOMParser: Pa(),
6274
+ DOMParser: Ba(),
6275
6275
  fetch: it
6276
6276
  }), u = o.getAttribute("width"), h = o.getAttribute("height"), m = 2048;
6277
6277
  if (h && u) {
@@ -6296,17 +6296,17 @@ const le = (n) => {
6296
6296
  rotation: 0,
6297
6297
  panelId: n.layoutState.layout.panelId
6298
6298
  };
6299
- if (e && t === D.Illustration) {
6299
+ if (e && t === F.Illustration) {
6300
6300
  const l = await lt(await ai(e)), u = At().parseFromString(l.svg, "image/svg+xml").firstElementChild.getAttribute("viewBox");
6301
6301
  if (!u) throw new Error("SVG missing viewBox.");
6302
6302
  const h = s.height, m = u.split(" "), p = parseFloat(m[2]) || 1, g = parseFloat(m[3]) || 1, f = p / g;
6303
6303
  s.height = s.width / f, s.top += (h - s.height) / 2;
6304
6304
  }
6305
- if (e && t === D.Image) {
6306
- const l = s.height, c = await Ue(e), d = await Ve(c), A = d.width / d.height;
6305
+ if (e && t === F.Image) {
6306
+ const l = s.height, c = await Oe(e), d = await Ue(c), A = d.width / d.height;
6307
6307
  s.height = s.width / A, s.top += (l - s.height) / 2;
6308
6308
  }
6309
- if (e && t === D.Textbox && a?.text && a?.fontScale) {
6309
+ if (e && t === F.Textbox && a?.text && a?.fontScale) {
6310
6310
  await Qt(e);
6311
6311
  const l = yt(e), c = pt(a.text, a?.fontScale, l);
6312
6312
  s.width = Math.min(c, i.width * 0.85), s.left = i.x + i.width / 2 - s.width / 2;
@@ -6315,7 +6315,7 @@ const le = (n) => {
6315
6315
  };
6316
6316
  class Ed {
6317
6317
  static async getFrame(t, e) {
6318
- const a = await ti(e.region, e.src), i = await We(a), r = e.region || await Vt(t, D.Frame);
6318
+ const a = await ti(e.region, e.src), i = await ze(a), r = e.region || await Vt(t, F.Frame);
6319
6319
  return {
6320
6320
  id: M(),
6321
6321
  x: r.left,
@@ -6330,7 +6330,7 @@ class Ed {
6330
6330
  path: i.path,
6331
6331
  dataWidth: i.width,
6332
6332
  dataHeight: i.height,
6333
- type: D.Frame,
6333
+ type: F.Frame,
6334
6334
  disablePlaceholder: e.configuration.disablePlaceholder,
6335
6335
  focalBlur: e.configuration.focalBlur,
6336
6336
  focalBlurStrength: e.configuration.focalBlurStrength,
@@ -6341,11 +6341,11 @@ class Ed {
6341
6341
  };
6342
6342
  }
6343
6343
  static async getImage(t, e) {
6344
- const a = e.region || await Vt(t, D.Image, e.src);
6344
+ const a = e.region || await Vt(t, F.Image, e.src);
6345
6345
  return {
6346
6346
  id: M(),
6347
6347
  src: e.src,
6348
- type: D.Image,
6348
+ type: F.Image,
6349
6349
  y: a.top,
6350
6350
  x: a.left,
6351
6351
  rotation: a.rotation,
@@ -6361,16 +6361,16 @@ class Ed {
6361
6361
  const { configuration: a, fontSrc: i, designInputStep: r } = e, o = await Qt(i), s = {
6362
6362
  assetUrl: i,
6363
6363
  name: o.names.fullName.en
6364
- }, l = r?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = Te(c, {
6364
+ }, l = r?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = ke(c, {
6365
6365
  vertical: a.vertical,
6366
6366
  uppercase: a.uppercase
6367
- }), A = e.region || await Vt(t, D.Textbox, i, {
6367
+ }), A = e.region || await Vt(t, F.Textbox, i, {
6368
6368
  text: d,
6369
6369
  fontScale: a.size ? a.size / o.unitsPerEm : void 0
6370
6370
  }), u = se(
6371
6371
  {
6372
6372
  id: M(),
6373
- type: D.Textbox,
6373
+ type: F.Textbox,
6374
6374
  x: A.left,
6375
6375
  y: A.top,
6376
6376
  width: A.width,
@@ -6430,13 +6430,13 @@ class Ed {
6430
6430
  </svg>
6431
6431
  `, i = {};
6432
6432
  i["spiff-fill-shape"] = { browserValue: e.color };
6433
- const r = e.region || await Vt(t, D.Illustration), o = M();
6433
+ const r = e.region || await Vt(t, F.Illustration), o = M();
6434
6434
  return {
6435
6435
  stepRegion: e.region,
6436
6436
  colors: i,
6437
6437
  id: o,
6438
6438
  svg: a,
6439
- type: D.Illustration,
6439
+ type: F.Illustration,
6440
6440
  y: r.top,
6441
6441
  x: r.left,
6442
6442
  rotation: r.rotation,
@@ -6448,7 +6448,7 @@ class Ed {
6448
6448
  };
6449
6449
  }
6450
6450
  static async getIllustration(t, e) {
6451
- const a = e.region || await Vt(t, D.Illustration, e.src), i = await lt(await ai(e.src)), r = await te(i.svg), o = M();
6451
+ const a = e.region || await Vt(t, F.Illustration, e.src), i = await lt(await ai(e.src)), r = await te(i.svg), o = M();
6452
6452
  return {
6453
6453
  cachedObjectURL: r,
6454
6454
  stepRegion: e.region,
@@ -6456,7 +6456,7 @@ class Ed {
6456
6456
  id: o,
6457
6457
  src: e.src,
6458
6458
  svg: i.svg,
6459
- type: D.Illustration,
6459
+ type: F.Illustration,
6460
6460
  y: a.top,
6461
6461
  x: a.left,
6462
6462
  rotation: a.rotation,
@@ -6479,13 +6479,13 @@ const z = (n, t) => Z(n, t).elements.find((i) => i.id === n), Z = (n, t) => {
6479
6479
  throw new W();
6480
6480
  return e;
6481
6481
  }, tt = (n, t) => {
6482
- const e = [...t.elements.filter((i) => i.id !== n.id), n], a = Ta(e);
6482
+ const e = [...t.elements.filter((i) => i.id !== n.id), n], a = Ma(e);
6483
6483
  return {
6484
6484
  layout: t.layout,
6485
6485
  elements: a,
6486
6486
  modificationID: M()
6487
6487
  };
6488
- }, tn = async (n) => {
6488
+ }, Za = async (n) => {
6489
6489
  const t = [...Object.keys(n.layouts)], e = [...new Set(t)];
6490
6490
  for (let a = 0; a < e.length; a++) {
6491
6491
  const i = e[a], r = n.layouts[i];
@@ -6515,7 +6515,7 @@ const z = (n, t) => Z(n, t).elements.find((i) => i.id === n), Z = (n, t) => {
6515
6515
  }
6516
6516
  for (const a in n.layouts) {
6517
6517
  const i = n.layouts[a].elements.filter(
6518
- (o) => o.type === D.Illustration
6518
+ (o) => o.type === F.Illustration
6519
6519
  );
6520
6520
  for (let o = 0; o < i.length; ++o) {
6521
6521
  const s = i[o];
@@ -6527,7 +6527,7 @@ const z = (n, t) => Z(n, t).elements.find((i) => i.id === n), Z = (n, t) => {
6527
6527
  }
6528
6528
  }
6529
6529
  const r = n.layouts[a].elements.filter(
6530
- (o) => o.type === D.Textbox
6530
+ (o) => o.type === F.Textbox
6531
6531
  );
6532
6532
  for (let o = 0; o < r.length; ++o) {
6533
6533
  const s = r[o];
@@ -6545,7 +6545,7 @@ class O {
6545
6545
  this.oldState = t;
6546
6546
  }
6547
6547
  }
6548
- class en extends O {
6548
+ class tn extends O {
6549
6549
  constructor(t) {
6550
6550
  super(), this.serializableWorkflow = t;
6551
6551
  }
@@ -6807,7 +6807,7 @@ class No extends O {
6807
6807
  };
6808
6808
  }
6809
6809
  }
6810
- class an extends O {
6810
+ class en extends O {
6811
6811
  constructor(t, e) {
6812
6812
  super(), this.id = t, this.fontData = e;
6813
6813
  }
@@ -6976,7 +6976,7 @@ class ea extends O {
6976
6976
  };
6977
6977
  }
6978
6978
  }
6979
- class Ca extends O {
6979
+ class fa extends O {
6980
6980
  constructor(t, e, a) {
6981
6981
  super(), this.id = t, this.className = e, this.fill = a;
6982
6982
  }
@@ -7031,7 +7031,7 @@ class Uo extends O {
7031
7031
  };
7032
7032
  }
7033
7033
  }
7034
- class Fd extends O {
7034
+ class Dd extends O {
7035
7035
  /**
7036
7036
  * @param id The targeted element to bring to the front.
7037
7037
  */
@@ -7060,7 +7060,7 @@ class Fd extends O {
7060
7060
  };
7061
7061
  }
7062
7062
  }
7063
- class Dd extends O {
7063
+ class Fd extends O {
7064
7064
  /**
7065
7065
  * @param id The targeted element to bring to the back.
7066
7066
  */
@@ -7145,7 +7145,7 @@ class kd extends O {
7145
7145
  };
7146
7146
  }
7147
7147
  }
7148
- class nn {
7148
+ class an {
7149
7149
  constructor(t, e, a) {
7150
7150
  this.processRegion = async (i) => {
7151
7151
  const r = this.layouts.find((l) => l.panelId === i.panelId);
@@ -7155,10 +7155,10 @@ class nn {
7155
7155
  if (this.configuration.type === v.ProductOverlay) {
7156
7156
  let l = "";
7157
7157
  if (this.product?.overlayImageUrl && (l = this.product.overlayImageUrl), o = l, !l)
7158
- throw new xe(this.configuration, "Couldn't find an asset for product overlay step");
7158
+ throw new De(this.configuration, "Couldn't find an asset for product overlay step");
7159
7159
  }
7160
7160
  const s = this.evaluateAssetType();
7161
- if (s === D.Image) {
7161
+ if (s === F.Image) {
7162
7162
  const l = this.configuration.type === v.SilentIllustration ? this.configuration.data.asset?.fileLink : this.product?.overlayImageUrl;
7163
7163
  if (!l)
7164
7164
  throw new Error("Undefined raster silent step source");
@@ -7226,7 +7226,7 @@ class nn {
7226
7226
  }
7227
7227
  async trigger() {
7228
7228
  if (!this.configuration.data.regions)
7229
- throw new xe(this.configuration, "Missing regions.");
7229
+ throw new De(this.configuration, "Missing regions.");
7230
7230
  if (this.configuration.type === v.SilentIllustration) {
7231
7231
  const t = this.configuration.data.regions.map(this.processRegion);
7232
7232
  return Promise.all(t);
@@ -7240,7 +7240,7 @@ class nn {
7240
7240
  }
7241
7241
  evaluateAssetType() {
7242
7242
  const t = this.configuration.type === v.ProductOverlay && this.product?.overlayImageUrl ? this.product.overlayImageUrl.toLowerCase() : this.configuration.data.asset?.fileLink?.toLowerCase().split("?")[0];
7243
- return t?.startsWith("data:image/png") || t?.endsWith(".jpeg") || t?.endsWith(".jpg") || t?.endsWith(".png") ? D.Image : (t?.endsWith(".svg") || t?.startsWith("image/svg+xml"), D.Illustration);
7243
+ return t?.startsWith("data:image/png") || t?.endsWith(".jpeg") || t?.endsWith(".jpg") || t?.endsWith(".png") ? F.Image : (t?.endsWith(".svg") || t?.startsWith("image/svg+xml"), F.Illustration);
7244
7244
  }
7245
7245
  }
7246
7246
  const Lo = async (n) => {
@@ -7254,7 +7254,7 @@ const Lo = async (n) => {
7254
7254
  }
7255
7255
  })).json()).shortUrl;
7256
7256
  } catch (e) {
7257
- throw console.error(e), new $e("Failed to shorten URL, see console.");
7257
+ throw console.error(e), new Re("Failed to shorten URL, see console.");
7258
7258
  }
7259
7259
  };
7260
7260
  class ii {
@@ -7299,7 +7299,7 @@ class Vo {
7299
7299
  }
7300
7300
  async regenerateQRCode(t, e, a, i) {
7301
7301
  const r = async () => {
7302
- const h = (await ke([e]))[0], m = h?.versions?.find((p) => p.name === "mpeg4")?.link;
7302
+ const h = (await Fe([e]))[0], m = h?.versions?.find((p) => p.name === "mpeg4")?.link;
7303
7303
  return { asset: h, link: m };
7304
7304
  }, o = await new Promise((h, m) => {
7305
7305
  new ii(
@@ -7325,10 +7325,10 @@ class Vo {
7325
7325
  l.searchParams.append("video", btoa(JSON.stringify([o]))), l.pathname = l.pathname + (l.pathname.slice(-1) === "/" ? "" : "/");
7326
7326
  const c = l.toString();
7327
7327
  if (c.length >= 2e3)
7328
- throw new $e("Cannot create QR code, URL too long.");
7328
+ throw new Re("Cannot create QR code, URL too long.");
7329
7329
  const d = await Lo(c);
7330
7330
  if (!i.data || !i.data.regions)
7331
- throw new xe(i, "Missing regions.");
7331
+ throw new De(i, "Missing regions.");
7332
7332
  const A = await this.regionElements(i), u = await this.command(d, A, a, i.stepName);
7333
7333
  return u && (u.command && a.getCommandDispatcher()(u.command), u.followup && await u.followup()), await a.setSelectionsAndElements(i.stepName, [], A, async () => {
7334
7334
  a.updateStorage(i.stepName, {
@@ -7356,7 +7356,7 @@ class Vo {
7356
7356
  stepName: i,
7357
7357
  id: c.id,
7358
7358
  src: s,
7359
- type: D.Image,
7359
+ type: F.Image,
7360
7360
  y: d.top,
7361
7361
  x: d.left,
7362
7362
  width: d.width,
@@ -7371,11 +7371,11 @@ class Vo {
7371
7371
  }
7372
7372
  }
7373
7373
  const ri = new Vo();
7374
- class Ne {
7374
+ class Me {
7375
7375
  constructor() {
7376
7376
  this.frameSourceSvg = async (t, e) => {
7377
7377
  if (!t)
7378
- return pa(e);
7378
+ return ga(e);
7379
7379
  const a = t.asset;
7380
7380
  if (!a)
7381
7381
  throw new Bt(t);
@@ -7424,7 +7424,7 @@ class Ne {
7424
7424
  a.serializableWorkflow.steps
7425
7425
  ), l = Object.values(a.layouts).map((c) => c.elements).flat().filter((c) => c.stepName === t.stepName).map((c) => ({ id: c.id, region: c.stepRegion }));
7426
7426
  if (!t.option || (t.option.variants || []).length === 0) {
7427
- const c = t.data.regions.map((d) => pa(d));
7427
+ const c = t.data.regions.map((d) => ga(d));
7428
7428
  e.updateStorage(t.stepName, {
7429
7429
  currentFrameSources: c
7430
7430
  });
@@ -7478,7 +7478,7 @@ class Ne {
7478
7478
  })) ?? [];
7479
7479
  }
7480
7480
  selectImage(t, e, a, i = !0) {
7481
- const r = Ne.patternSource(e), o = a.getStepStorage(t.stepName)?.framePatternSrc;
7481
+ const r = Me.patternSource(e), o = a.getStepStorage(t.stepName)?.framePatternSrc;
7482
7482
  if (o && o === r)
7483
7483
  return Promise.resolve();
7484
7484
  a.setEditedStatus(t.stepName, !0);
@@ -7498,7 +7498,7 @@ class Ne {
7498
7498
  });
7499
7499
  },
7500
7500
  () => {
7501
- throw new $e("Failed to resolve transcoded PDF");
7501
+ throw new Re("Failed to resolve transcoded PDF");
7502
7502
  }
7503
7503
  )
7504
7504
  );
@@ -7518,7 +7518,7 @@ class Ne {
7518
7518
  return new H(
7519
7519
  {
7520
7520
  id: t,
7521
- type: D.Frame,
7521
+ type: F.Frame,
7522
7522
  x: e.left,
7523
7523
  y: e.top,
7524
7524
  width: e.width,
@@ -7542,7 +7542,7 @@ class Ne {
7542
7542
  }
7543
7543
  async loadPatternFromString(t, e, a = !0, i = void 0, r) {
7544
7544
  if (t.endsWith("svg")) {
7545
- const o = await Qa(t), s = o.width, l = o.height, c = await nt(t);
7545
+ const o = await Na(t), s = o.width, l = o.height, c = await nt(t);
7546
7546
  if (r) {
7547
7547
  const u = c.match(/<(image|linearGradient|radialGradient)(\s|>|\/>)/gim);
7548
7548
  if (u && u.length > 0)
@@ -7560,7 +7560,7 @@ class Ne {
7560
7560
  };
7561
7561
  mt.set(t, A), e.setPatternData(A, a);
7562
7562
  } else {
7563
- const o = await Ue(t, !0), s = await Ve(o), l = {
7563
+ const o = await Oe(t, !0), s = await Ue(o), l = {
7564
7564
  src: t,
7565
7565
  width: s.width,
7566
7566
  height: s.height,
@@ -7645,7 +7645,7 @@ class Ne {
7645
7645
  r && r(!0);
7646
7646
  const c = t.data.initialZoomLevel, d = await Promise.all(
7647
7647
  t.data.regions.map(async (h, m) => {
7648
- const p = await We(l[m]), g = s.getImageData(), f = a.map((F) => new Rt(F.id)), S = g ? Na(
7648
+ const p = await ze(l[m]), g = s.getImageData(), f = a.map((D) => new Rt(D.id)), S = g ? Ta(
7649
7649
  g,
7650
7650
  p,
7651
7651
  c && !t.data.forceImageCover ? { scale: c } : void 0,
@@ -7660,7 +7660,7 @@ class Ne {
7660
7660
  scaleX: S?.zoom || 1,
7661
7661
  scaleY: S?.zoom || 1,
7662
7662
  rotation: 0
7663
- } : void 0, I = M(), E = i.getLayouts().find((F) => F.panelId === h.panelId);
7663
+ } : void 0, I = M(), E = i.getLayouts().find((D) => D.panelId === h.panelId);
7664
7664
  if (!E)
7665
7665
  throw new K(h);
7666
7666
  return {
@@ -7709,7 +7709,7 @@ class Ne {
7709
7709
  throw new _t(t);
7710
7710
  }
7711
7711
  async loadPatternFromAsset(t, e, a, i) {
7712
- const r = Ne.patternSource(t), o = a.markUpdatePending(), s = a.getWorkflowExperience().getStepById(e.stepName)?.frameService;
7712
+ const r = Me.patternSource(t), o = a.markUpdatePending(), s = a.getWorkflowExperience().getStepById(e.stepName)?.frameService;
7713
7713
  if (!s)
7714
7714
  throw a.markUpdateCompleted(o), new Error("Frame service unavailable, cannot load pattern!");
7715
7715
  try {
@@ -7736,7 +7736,7 @@ class Ne {
7736
7736
  ), this.validateColorCount(e, a);
7737
7737
  }
7738
7738
  }
7739
- const Et = new Ne();
7739
+ const Et = new Me();
7740
7740
  class zo {
7741
7741
  async getIllustrationBody(t) {
7742
7742
  return new Promise((e) => {
@@ -7755,7 +7755,7 @@ class zo {
7755
7755
  src: i.src,
7756
7756
  svg: i.svg.svg,
7757
7757
  cachedObjectURL: i.objectURL,
7758
- type: D.Illustration,
7758
+ type: F.Illustration,
7759
7759
  y: e.top,
7760
7760
  x: e.left,
7761
7761
  rotation: e.rotation,
@@ -7844,7 +7844,7 @@ class zo {
7844
7844
  const s = Da(t, e, a, o), l = await te(s), c = [];
7845
7845
  for (const d of i) {
7846
7846
  for (const [A, u] of r.entries())
7847
- c.push(new Ca(d, A, u));
7847
+ c.push(new fa(d, A, u));
7848
7848
  c.push(new Uo(d, s, l));
7849
7849
  }
7850
7850
  return new L(c);
@@ -7891,7 +7891,7 @@ class zo {
7891
7891
  }
7892
7892
  async selectVariantCommand(t, e, a, i, r) {
7893
7893
  if (!t.data || !t.data.regions)
7894
- throw new xe(t, "Missing regions.");
7894
+ throw new De(t, "Missing regions.");
7895
7895
  i(!0);
7896
7896
  const o = a.map((f) => new Rt(f.id));
7897
7897
  t.mandatory && r.setMandatoryFulfilled(t.stepName, !1);
@@ -7951,7 +7951,7 @@ class zo {
7951
7951
  const b = S[0], E = w[0];
7952
7952
  await this.changeColors(
7953
7953
  t,
7954
- u.map((F) => F.regionElement),
7954
+ u.map((D) => D.regionElement),
7955
7955
  r,
7956
7956
  () => r.getCommandContext().getAllLayouts(),
7957
7957
  /* @__PURE__ */ new Map([[E, b.variant.color]])
@@ -7969,12 +7969,12 @@ class zo {
7969
7969
  };
7970
7970
  }
7971
7971
  }
7972
- const Ee = new zo();
7972
+ const Se = new zo();
7973
7973
  class Go {
7974
7974
  async init(t, e, a) {
7975
7975
  const i = t.option;
7976
7976
  if (!i)
7977
- throw new De(t);
7977
+ throw new Pe(t);
7978
7978
  if (a)
7979
7979
  await this.reload(t, e, a);
7980
7980
  else {
@@ -7990,7 +7990,7 @@ class Go {
7990
7990
  t.stepName,
7991
7991
  a.serializableWorkflow.steps
7992
7992
  ), s = Object.values(a.layouts).map((c) => c.elements).flat().filter((c) => c.stepName === t.stepName), l = t.option;
7993
- if (!l) throw new De(t);
7993
+ if (!l) throw new Pe(t);
7994
7994
  if (i?.selectedVariants) {
7995
7995
  const c = i.selectedVariants[0].id;
7996
7996
  if (c) {
@@ -8049,7 +8049,7 @@ const oi = new Go();
8049
8049
  class Wo {
8050
8050
  async init(t, e, a) {
8051
8051
  const i = t.option;
8052
- if (!i) throw new De(t);
8052
+ if (!i) throw new Pe(t);
8053
8053
  if (a)
8054
8054
  await this.reload(t, e, a);
8055
8055
  else {
@@ -8172,7 +8172,7 @@ class qo {
8172
8172
  colors: {},
8173
8173
  id: h,
8174
8174
  svg: d,
8175
- type: D.Illustration,
8175
+ type: F.Illustration,
8176
8176
  y: A.top,
8177
8177
  x: A.left,
8178
8178
  rotation: A.rotation,
@@ -8227,7 +8227,7 @@ class qo {
8227
8227
  }
8228
8228
  if (!/^$|^[a-zA-Z0-9 ]+$/.test(e))
8229
8229
  return i("Unsupported characters."), { input: e, helperData: {}, errorData: { unsupportedCharacters: !0 } };
8230
- const r = da(e.toLowerCase());
8230
+ const r = ca(e.toLowerCase());
8231
8231
  for (const o of r)
8232
8232
  for (const s in a) {
8233
8233
  const l = a[s].toLowerCase().replace(/\s/g, "");
@@ -8298,7 +8298,7 @@ class Ho {
8298
8298
  stepRegion: A,
8299
8299
  id: m,
8300
8300
  src: o,
8301
- type: D.Image,
8301
+ type: F.Image,
8302
8302
  y: A.top,
8303
8303
  x: A.left,
8304
8304
  rotation: A.rotation,
@@ -8401,14 +8401,14 @@ class Yo {
8401
8401
  const i = a.getLayouts(), o = (a.getRegionElements(e.stepName) || []).map((s) => {
8402
8402
  const l = s.region;
8403
8403
  if (!i.find((d) => d.panelId === l?.panelId)) throw new K(l);
8404
- return new Ca(s.id, this.shapeFillId, t);
8404
+ return new fa(s.id, this.shapeFillId, t);
8405
8405
  }).filter((s) => !!s);
8406
8406
  a.getCommandDispatcher()(new L(o)), a.updateStorage(e.stepName, { colour: t });
8407
8407
  }
8408
8408
  async init(t, e, a) {
8409
8409
  const i = t.option;
8410
8410
  if (!i)
8411
- throw new De(t);
8411
+ throw new Pe(t);
8412
8412
  if (a)
8413
8413
  await this.reload(t, e, a);
8414
8414
  else {
@@ -8467,7 +8467,7 @@ class Yo {
8467
8467
  if (!r.find((m) => m.panelId === A?.panelId))
8468
8468
  throw new K(A);
8469
8469
  const h = s();
8470
- return new Ca(d.id, this.shapeFillId, h);
8470
+ return new fa(d.id, this.shapeFillId, h);
8471
8471
  }, c = a.map(l).filter((d) => !!d);
8472
8472
  return {
8473
8473
  command: new L(c),
@@ -8517,7 +8517,7 @@ class Yo {
8517
8517
  colors: g,
8518
8518
  id: f,
8519
8519
  svg: p,
8520
- type: D.Illustration,
8520
+ type: F.Illustration,
8521
8521
  y: u.top,
8522
8522
  x: u.left,
8523
8523
  rotation: u.rotation,
@@ -8601,7 +8601,7 @@ const Ko = new Jo(), aa = (n, t, e, a, i) => {
8601
8601
  m || (c = !1);
8602
8602
  }
8603
8603
  return [null, null];
8604
- }, be = (n, t, e, a, i) => {
8604
+ }, ve = (n, t, e, a, i) => {
8605
8605
  let r, o;
8606
8606
  const s = yt(t.assetUrl), l = s.getFont();
8607
8607
  if (i.size) {
@@ -8619,16 +8619,16 @@ const Ko = new Jo(), aa = (n, t, e, a, i) => {
8619
8619
  const A = d / l.unitsPerEm;
8620
8620
  return [r, o] = aa(e, a, d, A, s), [d, r, o];
8621
8621
  }, na = 30;
8622
- class Qe extends Error {
8622
+ class Te extends Error {
8623
8623
  constructor(t) {
8624
- super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = Qe.name;
8624
+ super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = Te.name;
8625
8625
  }
8626
8626
  }
8627
8627
  const _o = ["‘", "’", "“", "”", `
8628
8628
  `];
8629
- class Re extends Error {
8629
+ class Ne extends Error {
8630
8630
  constructor(t) {
8631
- super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = Re.name;
8631
+ super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = Ne.name;
8632
8632
  }
8633
8633
  }
8634
8634
  class Xo {
@@ -8650,7 +8650,7 @@ class Xo {
8650
8650
  }, this.textAlign = (t) => t.vertical ? "center" : t.textAlign || "center", this.getErrorsForText = (t, e, a, i) => {
8651
8651
  let r;
8652
8652
  a.data && a.data.maxLength && e.length > a.data.maxLength && (r || (r = {}), r.hitCharacterLimit = !0);
8653
- const o = i.getWorkflowExperience().getProfanityList(), s = da(t.toLowerCase());
8653
+ const o = i.getWorkflowExperience().getProfanityList(), s = ca(t.toLowerCase());
8654
8654
  for (const c of s)
8655
8655
  for (const d in o) {
8656
8656
  const A = o[d].toLowerCase().replace(/\s/g, "");
@@ -8670,7 +8670,7 @@ class Xo {
8670
8670
  if (a)
8671
8671
  await this.reload(t, e, a);
8672
8672
  else {
8673
- const r = this.getDefaultImageFillVariant(t.data), o = r?.asset?.fileLink, s = o ? await fa(o) : void 0, l = s ? {
8673
+ const r = this.getDefaultImageFillVariant(t.data), o = r?.asset?.fileLink, s = o ? await pa(o) : void 0, l = s ? {
8674
8674
  src: s.src,
8675
8675
  height: s.height,
8676
8676
  width: s.width,
@@ -8777,7 +8777,7 @@ class Xo {
8777
8777
  const a = e.variants?.map((i) => i.asset?.fileLink)?.filter((i) => !!i) || [];
8778
8778
  return Promise.all(
8779
8779
  a.map(async (i) => {
8780
- const r = await fa(i);
8780
+ const r = await pa(i);
8781
8781
  return {
8782
8782
  src: i,
8783
8783
  width: r.width,
@@ -8840,7 +8840,7 @@ class Xo {
8840
8840
  }
8841
8841
  getProcessedInput(t, e, a) {
8842
8842
  const i = a ? t : this.injectReplaceableText(t, e);
8843
- return Te(i, {
8843
+ return ke(i, {
8844
8844
  vertical: e.vertical,
8845
8845
  uppercase: e.uppercase
8846
8846
  });
@@ -8857,7 +8857,7 @@ class Xo {
8857
8857
  const c = [], d = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map();
8858
8858
  for (const u of e) {
8859
8859
  if (!u.fontData) throw new R("Failed to resolve font data for text.");
8860
- const [h, m] = be(
8860
+ const [h, m] = ve(
8861
8861
  u.fontSize,
8862
8862
  u.fontData,
8863
8863
  { left: u.x, top: u.y, width: u.width, height: u.height, rotation: u.rotation },
@@ -8924,7 +8924,7 @@ class Xo {
8924
8924
  u,
8925
8925
  async () => {
8926
8926
  e.updateMetadata(t.stepName, { color: h, text: m }), e.updateStorage(t.stepName, { text: m, inputText: m });
8927
- const g = s.map((S) => new an(S.id, A)), f = new L(g);
8927
+ const g = s.map((S) => new en(S.id, A)), f = new L(g);
8928
8928
  e.getCommandDispatcher()(f);
8929
8929
  }
8930
8930
  ), s.length === 0 && l) {
@@ -9027,7 +9027,7 @@ class Xo {
9027
9027
  async selectVariantCommand(t, e, a, i, r, o, s, l, c) {
9028
9028
  const d = r.markUpdatePending(), A = await this.fontDataFromVariant(e);
9029
9029
  if (i.length > 0) {
9030
- const u = i.map((p) => new an(p.id, A));
9030
+ const u = i.map((p) => new en(p.id, A));
9031
9031
  if (l) {
9032
9032
  const p = i.map((g) => new ta(g.id, l));
9033
9033
  u.push(...p);
@@ -9109,7 +9109,7 @@ class Xo {
9109
9109
  const m = o.getLayouts().find((g) => g.panelId === u.panelId), p = M();
9110
9110
  try {
9111
9111
  if (!m)
9112
- throw new Re("Failed to find layout for region: " + u.panelId);
9112
+ throw new Ne("Failed to find layout for region: " + u.panelId);
9113
9113
  const g = a.colorOption;
9114
9114
  let f;
9115
9115
  if (g && g.variants) {
@@ -9131,7 +9131,7 @@ class Xo {
9131
9131
  rotation: u.rotation,
9132
9132
  text: c,
9133
9133
  input: s,
9134
- type: D.Textbox,
9134
+ type: F.Textbox,
9135
9135
  vertical: a.vertical,
9136
9136
  x: u.left,
9137
9137
  y: u.top,
@@ -9142,9 +9142,9 @@ class Xo {
9142
9142
  curved: a.curved,
9143
9143
  paths: a.paths,
9144
9144
  fillSpotColorDefinition: f
9145
- }, b = [], E = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
9145
+ }, b = [], E = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map();
9146
9146
  if (!I.fontData) throw new R("Failed to resolve font data for text.");
9147
- const [x, T] = be(
9147
+ const [x, T] = ve(
9148
9148
  I.fontSize,
9149
9149
  I.fontData,
9150
9150
  {
@@ -9158,7 +9158,7 @@ class Xo {
9158
9158
  [c],
9159
9159
  { size: a.size, minSize: a.minSize, maxSize: a.maxSize }
9160
9160
  );
9161
- E.set(I.id, x), F.set(I.id, T);
9161
+ E.set(I.id, x), D.set(I.id, T);
9162
9162
  const $ = a.curved || a.vertical ? c : (T || []).join(`
9163
9163
  `);
9164
9164
  b.push(
@@ -9172,10 +9172,10 @@ class Xo {
9172
9172
  fontData: i
9173
9173
  };
9174
9174
  } catch (g) {
9175
- throw console.log(g), new Qe("Error adding font to region");
9175
+ throw console.log(g), new Te("Error adding font to region");
9176
9176
  }
9177
9177
  }, A = await Promise.all(a.regions.map(d)).catch((u) => {
9178
- throw u instanceof Qe ? (Ko.setLatestToast("Failed to load font.", qe.Error), u) : u instanceof Re ? u : new Error(u);
9178
+ throw u instanceof Te ? (Ko.setLatestToast("Failed to load font.", qe.Error), u) : u instanceof Ne ? u : new Error(u);
9179
9179
  });
9180
9180
  return await o.setSelectionsAndElements(
9181
9181
  t,
@@ -9205,23 +9205,23 @@ class Xo {
9205
9205
  const A = (i || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = xt(A, o), h = this.getProcessedInput(u, t.data, s), m = o.getRegionElements(t.stepName), p = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
9206
9206
  for (const b of m)
9207
9207
  if (b.region) {
9208
- const [E, F] = be(
9208
+ const [E, D] = ve(
9209
9209
  e,
9210
9210
  a,
9211
9211
  b.region,
9212
9212
  [h],
9213
9213
  { size: t.data.size, minSize: t.data.minSize, maxSize: t.data.maxSize }
9214
9214
  );
9215
- p.set(b.id, E), g.set(b.id, F);
9215
+ p.set(b.id, E), g.set(b.id, D);
9216
9216
  }
9217
9217
  const S = (() => {
9218
9218
  if (t.data && t.data.maxLength && h.length > t.data.maxLength)
9219
9219
  return d && d(!0), { info: "0" };
9220
- const b = o.getWorkflowExperience().getProfanityList(), E = da(h.toLowerCase());
9221
- for (const F of E)
9220
+ const b = o.getWorkflowExperience().getProfanityList(), E = ca(h.toLowerCase());
9221
+ for (const D of E)
9222
9222
  for (const x in b) {
9223
9223
  const T = b[x].toLowerCase().replace(/\s/g, "");
9224
- if (F === T)
9224
+ if (D === T)
9225
9225
  return l(!0), { error: "Blocked profanity." };
9226
9226
  }
9227
9227
  return !t.data.vertical && !t.data.allowNewlines && (h.includes(`
@@ -9259,13 +9259,13 @@ const ts = "data:application/octet-stream;base64,AAEAAAAPAIAAAwBwRkZUTYdHeHoAAEl
9259
9259
  const e = at("rect");
9260
9260
  return e.setAttribute("height", `${n}`), e.setAttribute("width", `${t}`), e;
9261
9261
  }, as = (n, t, e, a) => {
9262
- const i = ue("filter");
9262
+ const i = de("filter");
9263
9263
  i.setAttribute("id", a), i.setAttribute("height", "200%"), i.setAttribute("width", "200%"), i.setAttribute("x", "-50%"), i.setAttribute("y", "-50%");
9264
- const r = ue("feOffset");
9264
+ const r = de("feOffset");
9265
9265
  i.appendChild(r), r.setAttribute("result", "offOut"), r.setAttribute("in", "SourceAlpha"), r.setAttribute("dx", `${n}`), r.setAttribute("dy", `${t}`);
9266
- const o = ue("feGaussianBlur");
9266
+ const o = de("feGaussianBlur");
9267
9267
  i.appendChild(o), o.setAttribute("result", "blurOut"), o.setAttribute("in", "offOut"), o.setAttribute("stdDeviation", `${e}`);
9268
- const s = ue("feBlend");
9268
+ const s = de("feBlend");
9269
9269
  return i.appendChild(s), s.setAttribute("in", "SourceGraphic"), s.setAttribute("in2", "blurOut"), s.setAttribute("mode", "normal"), i;
9270
9270
  }, ns = (n) => {
9271
9271
  let t = n;
@@ -9287,7 +9287,7 @@ function rs(n, t, e, a) {
9287
9287
  const i = e / n, r = a / t;
9288
9288
  return i > 1 && r > 1 ? Math.min(i, r) : i > 1 && r < 1 ? r : i < 1 && r > 1 ? i : Math.min(i, r);
9289
9289
  }
9290
- const rn = {
9290
+ const nn = {
9291
9291
  m: ["x", "y"],
9292
9292
  z: [],
9293
9293
  l: ["x", "y"],
@@ -9317,7 +9317,7 @@ class os {
9317
9317
  const i = (r) => {
9318
9318
  const o = [], s = r.relative ? r.type : r.type.toUpperCase();
9319
9319
  let l = e !== s;
9320
- const c = rn[r.type];
9320
+ const c = nn[r.type];
9321
9321
  l && (o.push(s), e = s);
9322
9322
  for (const d of c) {
9323
9323
  const A = r[d];
@@ -9330,7 +9330,7 @@ class os {
9330
9330
  u = (A * 100 | 0) / 100;
9331
9331
  break;
9332
9332
  default:
9333
- throw new Dt("Failed to encode path.");
9333
+ throw new Ft("Failed to encode path.");
9334
9334
  }
9335
9335
  l || o.push(" "), o.push(u), l = !1;
9336
9336
  }
@@ -9342,14 +9342,14 @@ class os {
9342
9342
  const e = /([mzlhvcsqta])([^mzlhvcsqta]*)/gi, a = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, i = [];
9343
9343
  let r;
9344
9344
  for (e.lastIndex = 0; r = e.exec(t); ) {
9345
- const o = r[1].toLowerCase(), s = (r[2].match(a) || []).map(parseFloat), l = o === r[1], c = rn[o];
9345
+ const o = r[1].toLowerCase(), s = (r[2].match(a) || []).map(parseFloat), l = o === r[1], c = nn[o];
9346
9346
  if (s.length < c.length)
9347
- throw new Dt(
9347
+ throw new Ft(
9348
9348
  `Path type "${o}" given ${s.length} arguments, expected ${c.length}.`
9349
9349
  );
9350
9350
  if (c.length > 0) {
9351
9351
  if (s.length % c.length !== 0)
9352
- throw new Dt(
9352
+ throw new Ft(
9353
9353
  `Path type "${o}" given ${s.length} arguments, not divisible by ${c.length}`
9354
9354
  );
9355
9355
  for (let d = 0; d < s.length / c.length; d++) {
@@ -9374,7 +9374,7 @@ class os {
9374
9374
  if (s in r && l in r) {
9375
9375
  const c = [r[s], r[l]], d = e(c);
9376
9376
  if (d.length < 2)
9377
- throw new Dt("Transformer must return at least 2 points.");
9377
+ throw new Ft("Transformer must return at least 2 points.");
9378
9378
  r[s] = d[0], r[l] = d[1];
9379
9379
  }
9380
9380
  }
@@ -9417,8 +9417,8 @@ class ss extends Zo {
9417
9417
  b.setAttribute("d", d), b.setAttribute("stroke", "black"), b.setAttribute("stroke-width", "3"), I.appendChild(b);
9418
9418
  const E = at("g");
9419
9419
  E.classList.add("module-layer0"), w.appendChild(E), E.setAttribute("filter", "url(#shadow)"), E.innerHTML = b.outerHTML;
9420
- const F = at("g");
9421
- F.classList.add("module-layer1"), w.appendChild(F), F.setAttribute("stroke-width", "3"), F.setAttribute("stroke", "rgb(45,41,38)"), F.setAttribute("fill", "rgb(45,41,38)"), F.setAttribute("transform", "translate(0.5,0)"), F.innerHTML = s;
9420
+ const D = at("g");
9421
+ D.classList.add("module-layer1"), w.appendChild(D), D.setAttribute("stroke-width", "3"), D.setAttribute("stroke", "rgb(45,41,38)"), D.setAttribute("fill", "rgb(45,41,38)"), D.setAttribute("transform", "translate(0.5,0)"), D.innerHTML = s;
9422
9422
  const x = at("g");
9423
9423
  x.classList.add("module-layer2"), w.appendChild(x), x.setAttribute("fill", "rgb(255,209,0)"), x.setAttribute("transform", "translate(1,-0.1)"), x.innerHTML = s;
9424
9424
  const T = at("g");
@@ -9458,8 +9458,8 @@ const ls = [
9458
9458
  "tspan"
9459
9459
  ], cs = async (n, t, e) => {
9460
9460
  const a = t.data, i = e.data.baseUrl, r = a.assetUrl.replace("localhost", "localstack"), o = i.slice(0, 4) === "http" ? "" : "https://", s = new URL(o + i);
9461
- s.searchParams.append("video", ja(JSON.stringify([{ href: r }]))), s.pathname = s.pathname + (s.pathname.slice(-1) === "/" ? "" : "/");
9462
- const l = s.toString(), d = `data:image/svg+xml;base64,${ja(await Sn(l, { type: "svg" }))}`, A = (h) => {
9461
+ s.searchParams.append("video", Ha(JSON.stringify([{ href: r }]))), s.pathname = s.pathname + (s.pathname.slice(-1) === "/" ? "" : "/");
9462
+ const l = s.toString(), d = `data:image/svg+xml;base64,${Ha(await Sn(l, { type: "svg" }))}`, A = (h) => {
9463
9463
  const m = n.find((g) => g.panelId === h.panelId);
9464
9464
  if (!m)
9465
9465
  throw new K(h);
@@ -9468,7 +9468,7 @@ const ls = [
9468
9468
  {
9469
9469
  id: p,
9470
9470
  src: d,
9471
- type: D.Image,
9471
+ type: F.Image,
9472
9472
  y: h.top,
9473
9473
  x: h.left,
9474
9474
  width: h.width,
@@ -9484,15 +9484,15 @@ const ls = [
9484
9484
  return console.error(h), [];
9485
9485
  }
9486
9486
  }, ds = async (n, t, e, a) => {
9487
- const i = e.data, r = i.assetUrl, o = await fa(r);
9487
+ const i = e.data, r = i.assetUrl, o = await pa(r);
9488
9488
  try {
9489
9489
  const s = Mo(i, a.option);
9490
9490
  s && (t[a.stepName] = { selectedVariants: [s] });
9491
9491
  const l = async (c) => {
9492
- const d = await ti(c, s?.asset?.fileLink), A = await We(d), u = M(), h = n.find((p) => p.panelId === c.panelId);
9492
+ const d = await ti(c, s?.asset?.fileLink), A = await ze(d), u = M(), h = n.find((p) => p.panelId === c.panelId);
9493
9493
  if (!h)
9494
9494
  throw new K(c);
9495
- const m = Na(
9495
+ const m = Ta(
9496
9496
  o,
9497
9497
  A,
9498
9498
  {
@@ -9507,7 +9507,7 @@ const ls = [
9507
9507
  {
9508
9508
  id: u,
9509
9509
  path: A.path,
9510
- type: D.Frame,
9510
+ type: F.Frame,
9511
9511
  forceImageCover: a.data.forceImageCover,
9512
9512
  x: c.left,
9513
9513
  y: c.top,
@@ -9556,7 +9556,7 @@ const ls = [
9556
9556
  const l = await nt(s, !0), c = /<svg.*?<\/svg>/s, d = l.match(c) || [], A = d?.length > 0 ? d[0] : "", m = At().parseFromString(A, "image/svg+xml").firstElementChild;
9557
9557
  if (!m)
9558
9558
  return console.error("Failed to read SVG."), [];
9559
- Fa(m);
9559
+ Pa(m);
9560
9560
  const p = {};
9561
9561
  Mt(m, (b) => {
9562
9562
  ls.includes(b.tagName) && !b.attributes.getNamedItem("fill") && b.setAttribute("fill", "#000000");
@@ -9565,18 +9565,18 @@ const ls = [
9565
9565
  const x = E.value, $ = `spiff-fill-${x.replace(/\W/g, "")}`;
9566
9566
  b.classList.add($), p[$] = { browserValue: x };
9567
9567
  }
9568
- const F = b.attributes.getNamedItem("stroke");
9569
- if (F && F.value !== "none") {
9570
- const x = F.value, $ = `spiff-stroke-${x.replace(/\W/g, "")}`;
9568
+ const D = b.attributes.getNamedItem("stroke");
9569
+ if (D && D.value !== "none") {
9570
+ const x = D.value, $ = `spiff-stroke-${x.replace(/\W/g, "")}`;
9571
9571
  b.classList.add($), p[$] = { browserValue: x };
9572
9572
  }
9573
9573
  });
9574
9574
  const f = Pt().serializeToString(m), S = i.colors;
9575
9575
  if (S) {
9576
9576
  for (const [b, E] of Object.entries(p))
9577
- for (const F of Object.keys(S))
9578
- if (E.browserValue === F) {
9579
- p[b] = { browserValue: S[F] };
9577
+ for (const D of Object.keys(S))
9578
+ if (E.browserValue === D) {
9579
+ p[b] = { browserValue: S[D] };
9580
9580
  break;
9581
9581
  }
9582
9582
  }
@@ -9584,13 +9584,13 @@ const ls = [
9584
9584
  const E = n.find((x) => x.panelId === b.panelId);
9585
9585
  if (!E)
9586
9586
  throw new K(b);
9587
- const F = M();
9587
+ const D = M();
9588
9588
  return new H(
9589
9589
  {
9590
9590
  colors: p,
9591
- id: F,
9591
+ id: D,
9592
9592
  svg: f,
9593
- type: D.Illustration,
9593
+ type: F.Illustration,
9594
9594
  y: b.top,
9595
9595
  x: b.left,
9596
9596
  rotation: b.rotation,
@@ -9619,7 +9619,7 @@ const ls = [
9619
9619
  colors: {},
9620
9620
  id: d,
9621
9621
  svg: s,
9622
- type: D.Illustration,
9622
+ type: F.Illustration,
9623
9623
  y: l.top,
9624
9624
  x: l.left,
9625
9625
  rotation: l.rotation,
@@ -9660,7 +9660,7 @@ const ls = [
9660
9660
  {
9661
9661
  id: u,
9662
9662
  src: s,
9663
- type: D.Image,
9663
+ type: F.Image,
9664
9664
  y: d.top,
9665
9665
  x: d.left,
9666
9666
  rotation: d.rotation,
@@ -9717,7 +9717,7 @@ const ls = [
9717
9717
  colors: h,
9718
9718
  id: m,
9719
9719
  svg: A,
9720
- type: D.Illustration,
9720
+ type: F.Illustration,
9721
9721
  y: c.top,
9722
9722
  x: c.left,
9723
9723
  rotation: c.rotation,
@@ -9736,7 +9736,7 @@ const ls = [
9736
9736
  return console.error(c), [];
9737
9737
  }
9738
9738
  }, gs = async (n, t, e) => {
9739
- const a = [], r = t.type === v.ProductOverlay ? e || t.data.asset?.fileLink || "" : t.data.asset?.fileLink || "", s = r.endsWith(".jpeg") || r.endsWith(".jpg") || r.endsWith(".png") ? D.Image : (r.endsWith(".svg"), D.Illustration), l = t.data.regions;
9739
+ const a = [], r = t.type === v.ProductOverlay ? e || t.data.asset?.fileLink || "" : t.data.asset?.fileLink || "", s = r.endsWith(".jpeg") || r.endsWith(".jpg") || r.endsWith(".png") ? F.Image : (r.endsWith(".svg"), F.Illustration), l = t.data.regions;
9740
9740
  if (s === "image")
9741
9741
  try {
9742
9742
  l.forEach((c) => {
@@ -9769,8 +9769,8 @@ const ls = [
9769
9769
  const c = await nt(r, !0), d = (A) => {
9770
9770
  const u = /<svg.*?<\/svg>/s, h = A.match(u) || [], m = h?.length > 0 ? h[0] : "", f = At().parseFromString(m, "image/svg+xml").firstElementChild;
9771
9771
  if (!f)
9772
- throw new Dt("Failed to read SVG.");
9773
- return Fa(f), Pt().serializeToString(f);
9772
+ throw new Ft("Failed to read SVG.");
9773
+ return Pa(f), Pt().serializeToString(f);
9774
9774
  };
9775
9775
  l.forEach((A) => {
9776
9776
  const u = n.find((m) => m.panelId === A.panelId);
@@ -9820,7 +9820,7 @@ const ls = [
9820
9820
  assetUrl: g,
9821
9821
  name: f.names.fullName.en
9822
9822
  };
9823
- })(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", r.text) : r.text) || "", u = Te(A, {
9823
+ })(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", r.text) : r.text) || "", u = ke(A, {
9824
9824
  vertical: a.data.vertical,
9825
9825
  uppercase: a.data.uppercase
9826
9826
  }), h = async (g) => {
@@ -9845,7 +9845,7 @@ const ls = [
9845
9845
  paths: a.data.paths,
9846
9846
  rotation: g.rotation,
9847
9847
  text: u,
9848
- type: D.Textbox,
9848
+ type: F.Textbox,
9849
9849
  vertical: a.data.vertical,
9850
9850
  verticalAlign: a.data.verticalAlign || "middle",
9851
9851
  width: g.width,
@@ -9853,12 +9853,12 @@ const ls = [
9853
9853
  y: g.top
9854
9854
  };
9855
9855
  if (d) {
9856
- const [w, I] = be(
9856
+ const [w, I] = ve(
9857
9857
  a.data.size || o,
9858
9858
  d,
9859
9859
  g,
9860
9860
  [
9861
- Te(u, {
9861
+ ke(u, {
9862
9862
  vertical: a.data.vertical,
9863
9863
  uppercase: a.data.uppercase
9864
9864
  })
@@ -10106,12 +10106,12 @@ class Es extends Wn {
10106
10106
  l = g.width, c = g.height;
10107
10107
  } else
10108
10108
  l = r.width, c = r.height;
10109
- const d = this.getWorkflowManager?.()?.getTemplatingContext(), A = Ma(t.layoutState.layout, e, {
10109
+ const d = this.getWorkflowManager?.()?.getTemplatingContext(), A = ka(t.layoutState.layout, e, {
10110
10110
  renderingConfiguration: {
10111
10111
  purpose: Kt.ThreeD,
10112
10112
  templatingContext: d
10113
10113
  }
10114
- }), u = Fn(A), h = await Ea.from(this.ctx, u, {
10114
+ }), u = Dn(A), h = await va.from(this.ctx, u, {
10115
10115
  anonymousCrossOrigin: !0,
10116
10116
  ignoreDimensions: !this.nonPOTSupport,
10117
10117
  ignoreAnimation: !0,
@@ -10120,7 +10120,7 @@ class Es extends Wn {
10120
10120
  enableRedraw: !1,
10121
10121
  createCanvas: Ct,
10122
10122
  createImage: ie,
10123
- DOMParser: Pa(),
10123
+ DOMParser: Ba(),
10124
10124
  fetch
10125
10125
  });
10126
10126
  h.resize(l, c), await h.render(), this.onRender();
@@ -10145,7 +10145,7 @@ const Md = (n, t) => {
10145
10145
  i = new L(e.map((l) => new ni(l))).apply(i);
10146
10146
  const o = await Cs(n, t, e, a);
10147
10147
  return new L(o).apply(i);
10148
- }, ce = C`
10148
+ }, Ge = C`
10149
10149
  fragment GlobalPropertyStateAspectFields on GlobalPropertyStateAspect {
10150
10150
  name
10151
10151
  value
@@ -10168,7 +10168,7 @@ const Md = (n, t) => {
10168
10168
  }
10169
10169
  }
10170
10170
  `, bs = C`
10171
- ${ce}
10171
+ ${Ge}
10172
10172
  mutation CreateGlobalPropertyState($bundleId: String!) {
10173
10173
  globalPropertyStateCreate(bundleId: $bundleId) {
10174
10174
  id
@@ -10178,7 +10178,7 @@ const Md = (n, t) => {
10178
10178
  }
10179
10179
  }
10180
10180
  `, Is = C`
10181
- ${ce}
10181
+ ${Ge}
10182
10182
  mutation UpdateGlobalPropertyState($id: String!, $aspects: [GlobalPropertyStateAspectInput]!) {
10183
10183
  globalPropertyStateUpdate(id: $id, aspects: $aspects) {
10184
10184
  id
@@ -10188,7 +10188,7 @@ const Md = (n, t) => {
10188
10188
  }
10189
10189
  }
10190
10190
  `, Bs = C`
10191
- ${ce}
10191
+ ${Ge}
10192
10192
  query GetGlobalPropertyState($bundleId: String!) {
10193
10193
  globalPropertyState(bundleId: $bundleId) {
10194
10194
  id
@@ -10205,7 +10205,7 @@ const Md = (n, t) => {
10205
10205
  bundleId: n
10206
10206
  }
10207
10207
  })).data.globalPropertyState, Ps = (n) => C`
10208
- ${ze}
10208
+ ${Le}
10209
10209
  fragment ProductFields on Product {
10210
10210
  id
10211
10211
  basePrice
@@ -10249,7 +10249,7 @@ const Md = (n, t) => {
10249
10249
  name
10250
10250
  }
10251
10251
  }
10252
- `, Ra = (n) => C`
10252
+ `, Qa = (n) => C`
10253
10253
  ${Ps(n)}
10254
10254
  fragment ProductCollectionProductFields on ProductCollectionProduct {
10255
10255
  id
@@ -10259,8 +10259,8 @@ const Md = (n, t) => {
10259
10259
  ...ProductFields
10260
10260
  }
10261
10261
  }
10262
- `, de = (n, t = !1) => C`
10263
- ${n ? Ra(t) : ""}
10262
+ `, We = (n, t = !1) => C`
10263
+ ${n ? Qa(t) : ""}
10264
10264
  fragment ProductCollectionFields on ProductCollection {
10265
10265
  id
10266
10266
  name
@@ -10349,9 +10349,9 @@ const Md = (n, t) => {
10349
10349
  workflowViewerLink
10350
10350
  workflowViewerAmendLink
10351
10351
  }
10352
- `, Fs = (n) => C`
10353
- ${ce}
10354
- ${de(n)}
10352
+ `, Ds = (n) => C`
10353
+ ${Ge}
10354
+ ${We(n)}
10355
10355
  ${ui}
10356
10356
  query GetBundle($id: String!) {
10357
10357
  globalPropertyState(bundleId: $id) {
@@ -10384,7 +10384,7 @@ const Md = (n, t) => {
10384
10384
  }
10385
10385
  }
10386
10386
  }
10387
- `, on = C`
10387
+ `, rn = C`
10388
10388
  query GetBundleStakeholders($id: String!) {
10389
10389
  bundles(ids: [$id]) {
10390
10390
  id
@@ -10429,7 +10429,7 @@ const Md = (n, t) => {
10429
10429
  }
10430
10430
  }
10431
10431
  }
10432
- `, Ds = C`
10432
+ `, Fs = C`
10433
10433
  query GetBundlesForCustomer($id: String!) {
10434
10434
  customers(ids: [$id]) {
10435
10435
  bundleStakeholders {
@@ -10459,7 +10459,7 @@ const Md = (n, t) => {
10459
10459
  }
10460
10460
  }
10461
10461
  `, xs = C`
10462
- ${Ra(!1)}
10462
+ ${Qa(!1)}
10463
10463
  query GetProductCollectionProducts($id: String!, $productIds: [String!]) {
10464
10464
  productCollections(ids: [$id], productIds: $productIds) {
10465
10465
  id
@@ -10492,7 +10492,7 @@ const Md = (n, t) => {
10492
10492
  }
10493
10493
  }
10494
10494
  `, Ms = C`
10495
- ${Ra(!0)}
10495
+ ${Qa(!0)}
10496
10496
  query GetProductCollectionForProductsFeed(
10497
10497
  $id: String!
10498
10498
  $limit: Int
@@ -10524,7 +10524,7 @@ const Md = (n, t) => {
10524
10524
  }
10525
10525
  }
10526
10526
  `, Ts = (n) => C`
10527
- ${de(n)}
10527
+ ${We(n)}
10528
10528
  mutation CreateBundle(
10529
10529
  $collectionId: String
10530
10530
  $initialMetadata: [MetadataInput!]
@@ -10552,9 +10552,7 @@ const Md = (n, t) => {
10552
10552
  }
10553
10553
  }
10554
10554
  }
10555
- `, Ns = (n) => C`
10556
- ${ce}
10557
- ${de(n)}
10555
+ `, Ns = () => C`
10558
10556
  mutation DuplicateBundle(
10559
10557
  $id: String!
10560
10558
  $template: Boolean
@@ -10571,28 +10569,9 @@ const Md = (n, t) => {
10571
10569
  ) {
10572
10570
  id
10573
10571
  bundleOwnerId
10574
- template
10575
- bundleStateData
10576
- metadata {
10577
- key
10578
- value
10579
- }
10580
- name
10581
10572
  partner {
10582
10573
  id
10583
10574
  }
10584
- productCollection {
10585
- ...ProductCollectionFields
10586
- }
10587
- transactions {
10588
- id
10589
- }
10590
- globalPropertyState {
10591
- id
10592
- aspects {
10593
- ...GlobalPropertyStateAspectFields
10594
- }
10595
- }
10596
10575
  }
10597
10576
  }
10598
10577
  `, ia = C`
@@ -10710,7 +10689,7 @@ const Md = (n, t) => {
10710
10689
  }
10711
10690
  }
10712
10691
  `, Gs = (n) => C`
10713
- ${de(n)}
10692
+ ${We(n)}
10714
10693
  mutation BundleAssignProductCollection($id: String!, $productCollectionId: String!) {
10715
10694
  bundleAssignProductCollection(id: $id, collectionId: $productCollectionId) {
10716
10695
  id
@@ -10872,7 +10851,7 @@ const Md = (n, t) => {
10872
10851
  `;
10873
10852
  var qe = /* @__PURE__ */ ((n) => (n.Error = "Error", n.Warning = "Warning", n.Info = "Info", n))(qe || {});
10874
10853
  const el = 1e3;
10875
- class sn extends Wn {
10854
+ class on extends Wn {
10876
10855
  constructor(t) {
10877
10856
  super(), this.createdAt = /* @__PURE__ */ new Date(), this.update = t;
10878
10857
  }
@@ -10931,7 +10910,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
10931
10910
  const t = this.experience.getTransaction().recipient, e = { recipient: t };
10932
10911
  return this.recipientConversionConfiguration?.requestedDataItems?.forEach((a) => {
10933
10912
  const i = a.uniqueIdentifier ?? a.title ?? "";
10934
- a.type === Ie.FirstName ? e[i] = t?.firstName : a.type === Ie.LastName ? e[i] = t?.lastName : a.type === Ie.Custom && (a.customFieldIndex === 1 ? e[i] = t?.customField1 : a.customFieldIndex === 2 ? e[i] = t?.customField2 : a.customFieldIndex === 3 ? e[i] = t?.customField3 : a.customFieldIndex === 4 ? e[i] = t?.customField4 : a.customFieldIndex === 5 && (e[i] = t?.customField5), a.option && (e[i] = a.option.variants?.find((r) => r.id === e[i])?.name));
10913
+ a.type === Ee.FirstName ? e[i] = t?.firstName : a.type === Ee.LastName ? e[i] = t?.lastName : a.type === Ee.Custom && (a.customFieldIndex === 1 ? e[i] = t?.customField1 : a.customFieldIndex === 2 ? e[i] = t?.customField2 : a.customFieldIndex === 3 ? e[i] = t?.customField3 : a.customFieldIndex === 4 ? e[i] = t?.customField4 : a.customFieldIndex === 5 && (e[i] = t?.customField5), a.option && (e[i] = a.option.variants?.find((r) => r.id === e[i])?.name));
10935
10914
  }), e;
10936
10915
  }
10937
10916
  async updateRecipient(t, e, a, i, r, o, s, l, c, d, A, u, h, m, p, g, f, S) {
@@ -10956,7 +10935,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
10956
10935
  customField4: p ?? w.recipient.customField4,
10957
10936
  customField5: g ?? w.recipient.customField5,
10958
10937
  conversionConfigurationId: f || w.recipient.conversionConfigurationId
10959
- }, this.experience.callEvent(ya.RecipientChanged), await this.graphQlClient().mutate({
10938
+ }, this.experience.callEvent(wa.RecipientChanged), await this.graphQlClient().mutate({
10960
10939
  mutation: Xs,
10961
10940
  errorPolicy: "all",
10962
10941
  fetchPolicy: "no-cache",
@@ -11026,7 +11005,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
11026
11005
  customField4: p,
11027
11006
  customField5: g,
11028
11007
  conversionConfigurationId: f
11029
- }, this.experience.callEvent(ya.RecipientChanged), await this.graphQlClient().mutate({
11008
+ }, this.experience.callEvent(wa.RecipientChanged), await this.graphQlClient().mutate({
11030
11009
  mutation: Zs,
11031
11010
  errorPolicy: "all",
11032
11011
  fetchPolicy: "no-cache",
@@ -11320,7 +11299,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
11320
11299
  };
11321
11300
  if (!Jt(a, this.storage)) {
11322
11301
  this.storage = a;
11323
- const i = new en(this.constructSerializableWorkflow());
11302
+ const i = new tn(this.constructSerializableWorkflow());
11324
11303
  this.commandContext.apply(i, !0), this.onStepSpecificStorageChange(t), this.onStorageChange();
11325
11304
  }
11326
11305
  }
@@ -11339,7 +11318,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
11339
11318
  if (this.readOnly) return;
11340
11319
  const t = this.serialize();
11341
11320
  this.workflowStatePromiseQueue.enqueue(
11342
- new sn(async () => {
11321
+ new on(async () => {
11343
11322
  await new Promise((e) => {
11344
11323
  setTimeout(() => {
11345
11324
  e();
@@ -11356,7 +11335,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
11356
11335
  async updateStateWithServerImmediate() {
11357
11336
  if (this.readOnly) return;
11358
11337
  const t = this.serialize();
11359
- return new sn(async () => {
11338
+ return new on(async () => {
11360
11339
  await this.updateTransaction({
11361
11340
  variables: {
11362
11341
  id: this.experience.getTransaction().id,
@@ -11418,10 +11397,10 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
11418
11397
  return Promise.resolve({ stepElements: {}, commands: [] });
11419
11398
  const i = async (c, d, A) => {
11420
11399
  if (c.type === v.SilentIllustration) {
11421
- const u = await new nn(c, d).trigger();
11400
+ const u = await new an(c, d).trigger();
11422
11401
  return { step: c, results: u };
11423
11402
  } else if (c.type === v.ProductOverlay) {
11424
- const u = await new nn(
11403
+ const u = await new an(
11425
11404
  c,
11426
11405
  d,
11427
11406
  A
@@ -11507,11 +11486,11 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
11507
11486
  this.stepSelections = {
11508
11487
  ...this.stepSelections,
11509
11488
  [t]: { selectedVariants: e }
11510
- }, this.selectionCost = Object.values(this.stepSelections).reduce((E, F) => E + F.selectedVariants.map((x) => x.priceModifier || 0).reduce((x, T) => x + T, 0), 0), r.steps.forEach((E) => {
11489
+ }, this.selectionCost = Object.values(this.stepSelections).reduce((E, D) => E + D.selectedVariants.map((x) => x.priceModifier || 0).reduce((x, T) => x + T, 0), 0), r.steps.forEach((E) => {
11511
11490
  bt(E, this.stepSelections) || (this.stepInitialised[E.stepName] = !1, delete this.stepMetadata[E.stepName], delete this.stepSelections[E.stepName], delete this.storage[E.stepName]);
11512
11491
  });
11513
11492
  const s = this.allScenes, l = vt(s, o), c = vt(s, this.stepSelections), d = l.map((E) => E.silentSteps).flat(), u = c.map((E) => E.silentSteps).flat().filter(
11514
- (E) => !d.some((F) => F.stepName === E.stepName)
11493
+ (E) => !d.some((D) => D.stepName === E.stepName)
11515
11494
  );
11516
11495
  d.forEach((E) => {
11517
11496
  bt(E, this.stepSelections) || (this.stepInitialised[E.stepName] = !1);
@@ -11523,14 +11502,14 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
11523
11502
  [t]: a
11524
11503
  }, this.removeElements(h);
11525
11504
  const g = r.steps.find((E) => E.stepName === t);
11526
- g?.type === v.Frame && this.getWorkflowExperience().getStepById(g.stepName)?.frameService?.setTargetElements(a.map((F) => F.id));
11527
- const f = h.map((E) => new Rt(E.id)), S = new en(this.constructSerializableWorkflow()), w = [...p, ...f, S];
11505
+ g?.type === v.Frame && this.getWorkflowExperience().getStepById(g.stepName)?.frameService?.setTargetElements(a.map((D) => D.id));
11506
+ const f = h.map((E) => new Rt(E.id)), S = new tn(this.constructSerializableWorkflow()), w = [...p, ...f, S];
11528
11507
  w.length > 0 && this.commandContext.apply(new L(w), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
11529
11508
  const I = this.getInvalidModelVariants(), b = this.modelContainer;
11530
11509
  if (b) {
11531
11510
  const E = I.map(
11532
- (F) => b.applyModelVariant(
11533
- F,
11511
+ (D) => b.applyModelVariant(
11512
+ D,
11534
11513
  {
11535
11514
  contextService: this.getLayoutPreviewService()
11536
11515
  },
@@ -11560,7 +11539,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
11560
11539
  break;
11561
11540
  case v.Illustration:
11562
11541
  a.push(
11563
- Ee.init(l, this, this.reloadedState)
11542
+ Se.init(l, this, this.reloadedState)
11564
11543
  );
11565
11544
  break;
11566
11545
  case v.Material:
@@ -11655,7 +11634,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
11655
11634
  }
11656
11635
  };
11657
11636
  jt.configurationPromiseMap = /* @__PURE__ */ new Map();
11658
- let wa = jt;
11637
+ let Ca = jt;
11659
11638
  class ot {
11660
11639
  constructor(t) {
11661
11640
  this.variantData = t;
@@ -11880,7 +11859,7 @@ class il extends et {
11880
11859
  */
11881
11860
  async selectVariant(t) {
11882
11861
  if (!this.getUpdateState() && this.getCurrentVariant() !== t)
11883
- return Ee.selectVariant(
11862
+ return Se.selectVariant(
11884
11863
  this.step,
11885
11864
  t.getResource(),
11886
11865
  this.manager.getRegionElements(this.step.stepName) || [],
@@ -11922,7 +11901,7 @@ class il extends et {
11922
11901
  const c = l.id.replace(/\W/g, "");
11923
11902
  a ? i.set(c, { browserValue: e, pmsValue: a }) : i.set(c, e);
11924
11903
  }
11925
- }) : a ? i.set(t, { browserValue: e, pmsValue: a }) : i.set(t, e), Ee.changeColors(
11904
+ }) : a ? i.set(t, { browserValue: e, pmsValue: a }) : i.set(t, e), Se.changeColors(
11926
11905
  this.step,
11927
11906
  this.manager.getRegionElements(this.step.stepName),
11928
11907
  this.manager,
@@ -11934,7 +11913,7 @@ class il extends et {
11934
11913
  return this.step.data.colorOption;
11935
11914
  }
11936
11915
  getAvailableColors() {
11937
- return this.step.data.colorPickerEnabled ? Ee.availableColors(this.step, this.manager) : Promise.resolve([]);
11916
+ return this.step.data.colorPickerEnabled ? Se.availableColors(this.step, this.manager) : Promise.resolve([]);
11938
11917
  }
11939
11918
  isColorPickerEnabled() {
11940
11919
  return this.step.data.colorPickerEnabled ?? !1;
@@ -12341,7 +12320,7 @@ class hl extends et {
12341
12320
  });
12342
12321
  }
12343
12322
  }
12344
- class pe {
12323
+ class me {
12345
12324
  static get(t, e) {
12346
12325
  switch (e.type) {
12347
12326
  case v.DigitalContent:
@@ -12501,7 +12480,7 @@ const pl = async (n, t) => {
12501
12480
  headers: e
12502
12481
  }
12503
12482
  })).data?.designCreateMany;
12504
- }, ln = (n, t, e) => {
12483
+ }, sn = (n, t, e) => {
12505
12484
  const a = (r) => {
12506
12485
  const o = {};
12507
12486
  if (r.type === "Frame") {
@@ -12597,7 +12576,7 @@ const pl = async (n, t) => {
12597
12576
  B.errors && console.log("Server Error:", U.message);
12598
12577
  }), null) : Q ?? null;
12599
12578
  })() || (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(a())), await n.updateStateWithServerImmediate(a), console.log("Server state is undefined @ Workflow completion"));
12600
- const u = n.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, p = l && ln(l, t, !0), g = l && ln(l, t, !1), f = async (x) => {
12579
+ const u = n.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, p = l && sn(l, t, !0), g = l && sn(l, t, !1), f = async (x) => {
12601
12580
  const T = {};
12602
12581
  let $ = 0;
12603
12582
  if (Object.keys(r).length > 0)
@@ -12636,7 +12615,7 @@ const pl = async (n, t) => {
12636
12615
  const x = await (await it(E)).blob();
12637
12616
  E = (await V.uploadAsset(
12638
12617
  { name: `${i.id}-preview-image.png`, blob: x },
12639
- Pe.Image,
12618
+ Ie.Image,
12640
12619
  !0,
12641
12620
  !1
12642
12621
  )).fileLink;
@@ -12857,8 +12836,8 @@ const ra = new Sl(), vl = C`
12857
12836
  id
12858
12837
  }
12859
12838
  }
12860
- `, cn = C`
12861
- ${ze}
12839
+ `, ln = C`
12840
+ ${Le}
12862
12841
  ${oe}
12863
12842
  mutation TransactionUpdateIntegrationProduct($id: String!, $integrationProductId: String) {
12864
12843
  transactionUpdateIntegrationProduct(id: $id, integrationProductId: $integrationProductId) {
@@ -12946,7 +12925,7 @@ const ra = new Sl(), vl = C`
12946
12925
  }
12947
12926
  }
12948
12927
  `;
12949
- var ya = /* @__PURE__ */ ((n) => (n.PriceBreakChanged = "PriceBreakChanged", n.ProductChanged = "ProductChanged", n.QuantityChanged = "QuantityChanged", n.RecipientChanged = "RecipientChanged", n.SelectionChanged = "SelectionChanged", n))(ya || {});
12928
+ var wa = /* @__PURE__ */ ((n) => (n.PriceBreakChanged = "PriceBreakChanged", n.ProductChanged = "ProductChanged", n.QuantityChanged = "QuantityChanged", n.RecipientChanged = "RecipientChanged", n.SelectionChanged = "SelectionChanged", n))(wa || {});
12950
12929
  class Il {
12951
12930
  constructor(t, e) {
12952
12931
  this.cachedStepHandles = /* @__PURE__ */ new Map(), this.profanityList = [], this.currentPriceBreak = 1, this.renderableScenes = [], this.renderableSceneCallbacks = [], this.eventCallbacks = /* @__PURE__ */ new Map(), this.debouncedSavedDesignUpdate = vn(async () => {
@@ -12962,7 +12941,7 @@ class Il {
12962
12941
  } catch (o) {
12963
12942
  r(o);
12964
12943
  }
12965
- }), this.client = t, this.transaction = e.transaction, this.workflow = e.workflow, this.profanityList = this.transaction.product?.profanities?.map((a) => a.word) || [], this.isReadOnly = e.transaction.isOrdered || !!e.readOnly, this.graphQlClient = e.graphQlClient, this.workflowManager = new wa(
12944
+ }), this.client = t, this.transaction = e.transaction, this.workflow = e.workflow, this.profanityList = this.transaction.product?.profanities?.map((a) => a.word) || [], this.isReadOnly = e.transaction.isOrdered || !!e.readOnly, this.graphQlClient = e.graphQlClient, this.workflowManager = new Ca(
12966
12945
  this,
12967
12946
  t,
12968
12947
  (a) => {
@@ -13008,7 +12987,7 @@ class Il {
13008
12987
  async setProduct(t) {
13009
12988
  this.workflow = void 0;
13010
12989
  const e = await this.graphQlClient().mutate({
13011
- mutation: cn,
12990
+ mutation: ln,
13012
12991
  variables: {
13013
12992
  id: this.getTransaction().id,
13014
12993
  integrationProductId: t
@@ -13048,7 +13027,7 @@ class Il {
13048
13027
  "ProductChanged"
13049
13028
  /* ProductChanged */
13050
13029
  ), await this.graphQlClient().mutate({
13051
- mutation: cn,
13030
+ mutation: ln,
13052
13031
  variables: {
13053
13032
  id: this.getTransaction().id
13054
13033
  }
@@ -13130,20 +13109,20 @@ class Il {
13130
13109
  height: d.layoutState.layout.height
13131
13110
  }, u = this.workflowManager.getCommandContext().getLayoutById(d.layoutState.layout.id), h = o.getContext("2d");
13132
13111
  if (!h)
13133
- throw new $e("Failed to obtain 2D context for preview image creation");
13134
- const m = this.workflowManager.getTemplatingContext(), p = Ma(u.layoutState.layout, u.layoutState.elements, {
13112
+ throw new Re("Failed to obtain 2D context for preview image creation");
13113
+ const m = this.workflowManager.getTemplatingContext(), p = ka(u.layoutState.layout, u.layoutState.elements, {
13135
13114
  renderingConfiguration: {
13136
13115
  purpose: Kt.Print,
13137
13116
  region: { left: A.x, top: A.y, width: A.width, height: A.height },
13138
13117
  templatingContext: m
13139
13118
  }
13140
- }), g = Fn(p);
13141
- await (await Ea.from(h, g, {
13119
+ }), g = Dn(p);
13120
+ await (await va.from(h, g, {
13142
13121
  anonymousCrossOrigin: !0,
13143
13122
  ignoreDimensions: !1,
13144
13123
  createCanvas: Ct,
13145
13124
  createImage: ie,
13146
- DOMParser: Pa(),
13125
+ DOMParser: Ba(),
13147
13126
  fetch
13148
13127
  })).render();
13149
13128
  const S = await this.getCanvasObjectURLAsync(o);
@@ -13155,7 +13134,7 @@ class Il {
13155
13134
  const a = this.cachedStepHandles.get(e.stepName);
13156
13135
  if (a)
13157
13136
  return a;
13158
- const i = pe.get(this.getWorkflowManager(), e);
13137
+ const i = me.get(this.getWorkflowManager(), e);
13159
13138
  return this.cachedStepHandles.set(e.stepName, i), i;
13160
13139
  }
13161
13140
  getSteps() {
@@ -13252,17 +13231,17 @@ class Il {
13252
13231
  getStepByName(t) {
13253
13232
  const e = this.getWorkflow()?.steps.find((a) => a.stepTitle === t);
13254
13233
  if (!(!e || !this.stepHasHandle(e)))
13255
- return pe.get(this.getWorkflowManager(), e);
13234
+ return me.get(this.getWorkflowManager(), e);
13256
13235
  }
13257
13236
  getStepsByType(t) {
13258
- return this.getWorkflow()?.steps.filter((e) => e.type === t).map((e) => pe.get(this.getWorkflowManager(), e)) || [];
13237
+ return this.getWorkflow()?.steps.filter((e) => e.type === t).map((e) => me.get(this.getWorkflowManager(), e)) || [];
13259
13238
  }
13260
13239
  getStepsByScene(t) {
13261
13240
  if (!this.getWorkflow()?.stepGroups.find((a) => a.name === t.name))
13262
13241
  throw new Error(
13263
13242
  "Given scene is not present on workflow! Be careful when persisting scenes that you only use them with the relevant workflow."
13264
13243
  );
13265
- return t.stepIds.map((a) => this.getWorkflow()?.steps.find((i) => i.stepName === a)).filter((a) => this.stepHasHandle(a)).map((a) => pe.get(this.getWorkflowManager(), a));
13244
+ return t.stepIds.map((a) => this.getWorkflow()?.steps.find((i) => i.stepName === a)).filter((a) => this.stepHasHandle(a)).map((a) => me.get(this.getWorkflowManager(), a));
13266
13245
  }
13267
13246
  async attachCustomerDetails(t) {
13268
13247
  return this.assignCustomerDetails({ emailAddress: t.email });
@@ -13492,7 +13471,7 @@ const Bl = (n) => {
13492
13471
  }
13493
13472
  return !1;
13494
13473
  };
13495
- class Fl {
13474
+ class Dl {
13496
13475
  constructor(t) {
13497
13476
  this.handleCache = {}, this.bundle = t;
13498
13477
  }
@@ -13534,16 +13513,16 @@ class Fl {
13534
13513
  async createHandle(t) {
13535
13514
  switch (t.type) {
13536
13515
  case G.FileUpload:
13537
- return new Dl(this.bundle, t).initialize();
13516
+ return new Fl(this.bundle, t).initialize();
13538
13517
  case G.ColorOption:
13539
- return new dn(
13518
+ return new cn(
13540
13519
  this.bundle,
13541
13520
  t,
13542
13521
  t.entityId ? await J.getOption(t.entityId) : void 0
13543
13522
  );
13544
13523
  case G.Option: {
13545
13524
  const e = t.entityId ? await J.getOption(t.entityId) : void 0;
13546
- return e?.type === "Color" ? new dn(this.bundle, t, e) : new pi(this.bundle, t, e);
13525
+ return e?.type === "Color" ? new cn(this.bundle, t, e) : new pi(this.bundle, t, e);
13547
13526
  }
13548
13527
  case G.Text:
13549
13528
  return new xl(this.bundle, t);
@@ -13552,7 +13531,7 @@ class Fl {
13552
13531
  }
13553
13532
  }
13554
13533
  }
13555
- class Oa {
13534
+ class Ra {
13556
13535
  constructor(t, e) {
13557
13536
  this.bundle = t, this.property = e;
13558
13537
  }
@@ -13613,7 +13592,7 @@ class Oa {
13613
13592
  return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
13614
13593
  }
13615
13594
  }
13616
- class Dl extends Oa {
13595
+ class Fl extends Ra {
13617
13596
  constructor(t, e) {
13618
13597
  super(t, e);
13619
13598
  }
@@ -13624,7 +13603,7 @@ class Dl extends Oa {
13624
13603
  const t = await this.getImage();
13625
13604
  if (t?.fileLink)
13626
13605
  if (t?.fileLink.endsWith(".svg")) {
13627
- const e = await nt(t?.fileLink), a = await Qa(t?.fileLink), i = a.width, r = a.height, o = await lt(e);
13606
+ const e = await nt(t?.fileLink), a = await Na(t?.fileLink), i = a.width, r = a.height, o = await lt(e);
13628
13607
  this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.colors?.forEach((c) => {
13629
13608
  o.colors[c.key] = {
13630
13609
  browserValue: c.browserValue,
@@ -13667,7 +13646,7 @@ class Dl extends Oa {
13667
13646
  ]);
13668
13647
  }
13669
13648
  async canUseBackgroundRemover() {
13670
- return this.bundle.getClient().canUseAddon(ba.BackgroundRemover);
13649
+ return this.bundle.getClient().canUseAddon(Ea.BackgroundRemover);
13671
13650
  }
13672
13651
  /**
13673
13652
  * Removes the background from an image, stores it in the state, and returns the new asset.
@@ -13705,7 +13684,7 @@ class Dl extends Oa {
13705
13684
  return V.getLocalOrFromServer(t);
13706
13685
  }
13707
13686
  async getImageWithColors() {
13708
- return await this.loadImageData(), this.imageData?.svg ? Ia(xa(this.imageData.svg, this.imageData.colors ?? {}, !1)) : this.imageData?.src;
13687
+ return await this.loadImageData(), this.imageData?.svg ? ba(Fa(this.imageData.svg, this.imageData.colors ?? {}, !1)) : this.imageData?.src;
13709
13688
  }
13710
13689
  /**
13711
13690
  * Retrieves the original, unmodified image selection, if one exists.
@@ -13839,7 +13818,7 @@ class Dl extends Oa {
13839
13818
  );
13840
13819
  }
13841
13820
  }
13842
- class xl extends Oa {
13821
+ class xl extends Ra {
13843
13822
  constructor(t, e) {
13844
13823
  super(t, e);
13845
13824
  }
@@ -13878,7 +13857,7 @@ class xl extends Oa {
13878
13857
  await Promise.all(i);
13879
13858
  }
13880
13859
  }
13881
- class pi extends Oa {
13860
+ class pi extends Ra {
13882
13861
  constructor(t, e, a) {
13883
13862
  super(t, e), this.optionResource = a;
13884
13863
  }
@@ -13940,7 +13919,7 @@ class pi extends Oa {
13940
13919
  await Promise.all(i);
13941
13920
  }
13942
13921
  }
13943
- class dn extends pi {
13922
+ class cn extends pi {
13944
13923
  constructor(t, e, a) {
13945
13924
  super(t, e, a);
13946
13925
  }
@@ -14002,15 +13981,15 @@ const kl = (n, t, e, a) => n.flatMap((i) => i.getSteps()).filter((i) => i.getGlo
14002
13981
  });
14003
13982
  return Math.max(...i);
14004
13983
  };
14005
- function Sa(n, t) {
13984
+ function ya(n, t) {
14006
13985
  function e(a) {
14007
13986
  if (typeof a > "u" || !Array.isArray(a) && !Nl(a))
14008
13987
  return a;
14009
13988
  if (Array.isArray(a))
14010
- return Sa(a, t);
13989
+ return ya(a, t);
14011
13990
  let i = {};
14012
13991
  for (const [r, o] of Object.entries(a))
14013
- i[r] = Tl(o) ? o : Sa(o, t);
13992
+ i[r] = Tl(o) ? o : ya(o, t);
14014
13993
  return Vi(i, t);
14015
13994
  }
14016
13995
  return Array.isArray(n) ? n.map(e) : e(n);
@@ -14027,17 +14006,17 @@ function fi(n) {
14027
14006
  e.value !== "" && t.set(e.name, !0);
14028
14007
  }), t;
14029
14008
  }
14030
- function fe(n) {
14031
- return Sa(n, ["__typename"]);
14009
+ function ge(n) {
14010
+ return ya(n, ["__typename"]);
14032
14011
  }
14033
14012
  class Ql {
14034
14013
  constructor(t, e, a, i, r) {
14035
14014
  this.mandatoryFulfilledAspects = /* @__PURE__ */ new Map(), this.bundleId = t, this.bundleOwnerId = e, this.configuration = a, this.bundleOptions = r;
14036
14015
  const o = r?.existingGlobalPropertyState;
14037
14016
  this.initPromise = o ? Promise.resolve(o).then(() => {
14038
- console.log("Setting global property state to existing state."), this.globalPropertyState = fe(o), this.recalculateMandatoryStates();
14017
+ console.log("Setting global property state to existing state."), this.globalPropertyState = ge(o), this.recalculateMandatoryStates();
14039
14018
  }) : this.createGlobalPropertyState().then((s) => {
14040
- console.log("Setting global property state to new state."), this.globalPropertyState = fe(s), this.recalculateMandatoryStates();
14019
+ console.log("Setting global property state to new state."), this.globalPropertyState = ge(s), this.recalculateMandatoryStates();
14041
14020
  }), this.onGlobalPropertyStateChange = i;
14042
14021
  }
14043
14022
  async clearAspects(t) {
@@ -14067,7 +14046,7 @@ class Ql {
14067
14046
  async setGlobalPropertyState(t) {
14068
14047
  this.globalPropertyState || await this.initPromise;
14069
14048
  const e = It(this.globalPropertyState);
14070
- this.globalPropertyState = { ...fe(t), id: e.id }, this.recalculateMandatoryStates(), await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(e, this.globalPropertyState);
14049
+ this.globalPropertyState = { ...ge(t), id: e.id }, this.recalculateMandatoryStates(), await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(e, this.globalPropertyState);
14071
14050
  }
14072
14051
  getAspectMandatoryFulfilled(t) {
14073
14052
  return this.mandatoryFulfilledAspects.get(t);
@@ -14196,7 +14175,7 @@ class Ql {
14196
14175
  }
14197
14176
  });
14198
14177
  if (t.data?.globalPropertyStateUpdate)
14199
- this.globalPropertyState = fe(t.data.globalPropertyStateUpdate);
14178
+ this.globalPropertyState = ge(t.data.globalPropertyStateUpdate);
14200
14179
  else
14201
14180
  throw new Error("Unable to update global property state");
14202
14181
  }
@@ -14435,14 +14414,14 @@ class Ci {
14435
14414
  getProducts() {
14436
14415
  if (!this.collection.productCollectionProducts)
14437
14416
  throw new Error("Failed to find products on collection. Ensure you fetch them first!");
14438
- return this.collection.productCollectionProducts.filter((t) => !!t.product).map((t) => new Ce(t));
14417
+ return this.collection.productCollectionProducts.filter((t) => !!t.product).map((t) => new pe(t));
14439
14418
  }
14440
14419
  /**
14441
14420
  * A list of products in this collections with useful helpers for interacting with them.
14442
14421
  */
14443
14422
  async fetchProducts(t) {
14444
14423
  if (this.fullFetched)
14445
- return this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new Ce(a));
14424
+ return this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new pe(a));
14446
14425
  const e = await y.getShadowGraphqlClient().query({
14447
14426
  query: xs,
14448
14427
  variables: {
@@ -14451,7 +14430,7 @@ class Ci {
14451
14430
  },
14452
14431
  errorPolicy: "all"
14453
14432
  });
14454
- return t || (this.fullFetched = !0), this.collection.productCollectionProducts = e.data.productCollections[0].productCollectionProducts || [], this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new Ce(a));
14433
+ return t || (this.fullFetched = !0), this.collection.productCollectionProducts = e.data.productCollections[0].productCollectionProducts || [], this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new pe(a));
14455
14434
  }
14456
14435
  /**
14457
14436
  * Returns a list of collections products matching the associated metafield/tag filters.
@@ -14541,7 +14520,7 @@ class Ci {
14541
14520
  if (h || p.partial && (!p.data.productCollections || p.data.productCollections.length === 0 || !p.data.productCollections[0].productCollectionProductsFeed?.items || p.data.productCollections[0].productCollectionProductsFeed?.items.length === 0))
14542
14521
  return;
14543
14522
  c.abort(), h = !0, m.unsubscribe();
14544
- const g = p.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((f) => !!f.product).map((f) => new Ce(It(f))) || [];
14523
+ const g = p.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((f) => !!f.product).map((f) => new pe(It(f))) || [];
14545
14524
  u({
14546
14525
  items: g,
14547
14526
  // Clone items because it could be cached data (immutable)
@@ -14565,7 +14544,7 @@ class Ci {
14565
14544
  return this.collection;
14566
14545
  }
14567
14546
  }
14568
- class Ce {
14547
+ class pe {
14569
14548
  constructor(t) {
14570
14549
  this.product = t.product, this.productResource = t;
14571
14550
  }
@@ -14758,7 +14737,7 @@ class zl {
14758
14737
  }
14759
14738
  }
14760
14739
  const Gl = C`
14761
- ${de(!1)}
14740
+ ${We(!1)}
14762
14741
  query GetProductCollections($ids: [String!]!) {
14763
14742
  productCollections(ids: $ids) {
14764
14743
  ...ProductCollectionFields
@@ -14834,7 +14813,7 @@ const ql = C`
14834
14813
  }
14835
14814
  }
14836
14815
  `;
14837
- class oa {
14816
+ class dn {
14838
14817
  constructor(t, e, a, i, r, o, s) {
14839
14818
  this.workflowExperiences = [], this.eventEmitter = new Wl(), this.updatesLocked = !1, this.client = t, this.id = e.id, this.name = e.name || "", this.dispatchDate = e.dispatchDate, this.template = e.template || !1, this.quoteId = e.quoteId, this.shareActions = e.bundleShareActions, this.workflowViewerLink = e.workflowViewerLink, this.workflowViewerAmendLink = e.workflowViewerAmendLink, this.ownerId = r, this.metadata = new Map(e.metadata?.map((d) => [d.key, d.value]) || []), this.completed = e.completed ?? !1, this.productCollection = e.productCollection, this.bundleStateManager = new Rl(e.bundleStateData);
14840
14819
  const l = this.productCollection?.globalPropertyConfiguration;
@@ -14844,7 +14823,7 @@ class oa {
14844
14823
  l,
14845
14824
  this.onGlobalPropertiesChanged.bind(this),
14846
14825
  o
14847
- ), this.globalPropertyHandleService = new Fl(this), this.setPreviewService(a);
14826
+ ), this.globalPropertyHandleService = new Dl(this), this.setPreviewService(a);
14848
14827
  const c = new Promise((d, A) => {
14849
14828
  if (o?.readonly) {
14850
14829
  d([]);
@@ -15048,7 +15027,7 @@ class oa {
15048
15027
  if (r)
15049
15028
  switch (a.type) {
15050
15029
  case G.FileUpload: {
15051
- const o = r, s = await ke([a.value]);
15030
+ const o = r, s = await Fe([a.value]);
15052
15031
  s.length > 0 && await o.selectImage(s[0]);
15053
15032
  const l = a.storage?.colors;
15054
15033
  if (l) {
@@ -15299,7 +15278,7 @@ class oa {
15299
15278
  variables: {
15300
15279
  id: this.id,
15301
15280
  details: t,
15302
- type: e || Fe.Owner
15281
+ type: e || Be.Owner
15303
15282
  },
15304
15283
  context: {
15305
15284
  bundleOwnerId: this.ownerId
@@ -15338,7 +15317,7 @@ class oa {
15338
15317
  }
15339
15318
  async getAllStakeholders() {
15340
15319
  const t = await y.getShadowGraphqlClient().query({
15341
- query: on,
15320
+ query: rn,
15342
15321
  errorPolicy: "all",
15343
15322
  fetchPolicy: "no-cache",
15344
15323
  variables: {
@@ -15354,7 +15333,7 @@ class oa {
15354
15333
  }
15355
15334
  async getCurrentStakeholder() {
15356
15335
  const t = await y.getShadowGraphqlClient().query({
15357
- query: on,
15336
+ query: rn,
15358
15337
  errorPolicy: "all",
15359
15338
  fetchPolicy: "no-cache",
15360
15339
  variables: {
@@ -15710,14 +15689,14 @@ class Kl {
15710
15689
  * @returns The nodes contained within the execution.
15711
15690
  */
15712
15691
  getNodes() {
15713
- return this.execution.nodes.map((t) => new we(t));
15692
+ return this.execution.nodes.map((t) => new fe(t));
15714
15693
  }
15715
15694
  /**
15716
15695
  * @param type The type of node to return.
15717
15696
  * @returns A list of nodes matching the requested type.
15718
15697
  */
15719
15698
  getNodesByType(t) {
15720
- return this.execution.nodes.filter((e) => e.type === t).map((e) => new we(e));
15699
+ return this.execution.nodes.filter((e) => e.type === t).map((e) => new fe(e));
15721
15700
  }
15722
15701
  /**
15723
15702
  * @returns A list of input nodes that exist in this execution.
@@ -15726,7 +15705,7 @@ class Kl {
15726
15705
  return this.execution.nodes.filter(
15727
15706
  (t) => t.type === "StartTerminal"
15728
15707
  /* StartTerminal */
15729
- ).map((t) => new we(t));
15708
+ ).map((t) => new fe(t));
15730
15709
  }
15731
15710
  /**
15732
15711
  * @returns A list of out put nodes that exist in this execution.
@@ -15735,7 +15714,7 @@ class Kl {
15735
15714
  return this.execution.nodes.filter(
15736
15715
  (t) => t.type === "EndTerminal"
15737
15716
  /* EndTerminal */
15738
- ).map((t) => new we(t));
15717
+ ).map((t) => new fe(t));
15739
15718
  }
15740
15719
  /**
15741
15720
  * @returns A date object representing the point in time this execution completed.
@@ -15752,7 +15731,7 @@ class Kl {
15752
15731
  return new Date(this.execution.failedAt);
15753
15732
  }
15754
15733
  }
15755
- class we {
15734
+ class fe {
15756
15735
  constructor(t) {
15757
15736
  this.node = t;
15758
15737
  }
@@ -15769,7 +15748,7 @@ class we {
15769
15748
  return this.getArtifacts().get(t);
15770
15749
  }
15771
15750
  }
15772
- class $a {
15751
+ class Oa {
15773
15752
  constructor(t) {
15774
15753
  this.value = t;
15775
15754
  }
@@ -15782,12 +15761,12 @@ class $a {
15782
15761
  }
15783
15762
  }
15784
15763
  var _l = /* @__PURE__ */ ((n) => (n.Transaction = "Transaction", n.Bundle = "Bundle", n.Product = "Product", n.Variant = "Variant", n.Option = "Option", n.LineItem = "LineItem", n.Asset = "Asset", n))(_l || {});
15785
- class Rd extends $a {
15764
+ class Rd extends Oa {
15786
15765
  constructor(t) {
15787
15766
  super(`"${t}"`);
15788
15767
  }
15789
15768
  }
15790
- class wi extends $a {
15769
+ class wi extends Oa {
15791
15770
  constructor(t, e) {
15792
15771
  if (e !== "Asset" && !wi.validUUID(t))
15793
15772
  throw new Error("Invalid ID, must be a valid v4 UUID. https://www.uuidgenerator.net/");
@@ -15797,7 +15776,7 @@ class wi extends $a {
15797
15776
  return t.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i);
15798
15777
  }
15799
15778
  }
15800
- class Od extends $a {
15779
+ class Od extends Oa {
15801
15780
  constructor(t) {
15802
15781
  super(`[${t.map((e) => e.getRaw()).join(",")}]`);
15803
15782
  }
@@ -15842,7 +15821,7 @@ class An {
15842
15821
  return t.sort((e, a) => (e.index ?? 0) - (a.index ?? 0)).map((e) => new Ht(e));
15843
15822
  }
15844
15823
  }
15845
- const ye = C`
15824
+ const Ce = C`
15846
15825
  query GetCustomer($emailAddress: String!) {
15847
15826
  customer(emailAddress: $emailAddress) {
15848
15827
  id
@@ -15990,7 +15969,7 @@ class ac {
15990
15969
  }
15991
15970
  async generateCode(t) {
15992
15971
  const e = await this.cognitoClient?.send(
15993
- new za({
15972
+ new Va({
15994
15973
  AuthFlow: "CUSTOM_AUTH",
15995
15974
  ClientId: this.userPoolClientId,
15996
15975
  AuthParameters: {
@@ -16024,7 +16003,7 @@ class ac {
16024
16003
  throw new Error("Failed to find existing tokens.");
16025
16004
  const e = JSON.parse(t);
16026
16005
  return await this.cognitoClient?.send(
16027
- new za({
16006
+ new Va({
16028
16007
  AuthFlow: "REFRESH_TOKEN_AUTH",
16029
16008
  ClientId: this.userPoolClientId,
16030
16009
  AuthParameters: {
@@ -16054,7 +16033,7 @@ class nc {
16054
16033
  * @param currency The currency to determine precision for.
16055
16034
  */
16056
16035
  getPrecisionForCurrency(t) {
16057
- const e = t, a = Ga.code(e);
16036
+ const e = t, a = za.code(e);
16058
16037
  return a ? a.digits : 2;
16059
16038
  }
16060
16039
  /**
@@ -16065,7 +16044,7 @@ class nc {
16065
16044
  */
16066
16045
  getSpecialFormat(t) {
16067
16046
  const e = t;
16068
- if (Ga.code(e)?.code === "CLP")
16047
+ if (za.code(e)?.code === "CLP")
16069
16048
  return "USD0,0";
16070
16049
  }
16071
16050
  }
@@ -16167,7 +16146,7 @@ class $d {
16167
16146
  } catch (a) {
16168
16147
  throw console.error(a), new gt("Critical - Unable to synchronize workflow state with server.");
16169
16148
  }
16170
- }, this.options = t, this.options.applicationKey && rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 33.13.0"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16149
+ }, this.options = t, this.options.applicationKey && rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 33.13.1"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16171
16150
  }
16172
16151
  configure(t) {
16173
16152
  ft.setHubUrl(t.hubUrl), ft.setServerUrl(t.serverUrl), ft.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 && sr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && zt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
@@ -16217,7 +16196,7 @@ class $d {
16217
16196
  */
16218
16197
  async authenticateBundleFromLocalStorage(t) {
16219
16198
  if (k.getMap("bundleOwnerIds")?.has(t))
16220
- return Promise.resolve({ success: !0, stakeholderType: Fe.Owner });
16199
+ return Promise.resolve({ success: !0, stakeholderType: Be.Owner });
16221
16200
  const a = k.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
16222
16201
  if (a.has(t)) {
16223
16202
  const i = a.get(t);
@@ -16261,7 +16240,7 @@ class $d {
16261
16240
  if (i.isOrdered)
16262
16241
  return Promise.resolve({ success: !1, transactionReadOnly: !0 });
16263
16242
  if (k.getMap("transactionOwnerIds")?.has(t))
16264
- return Promise.resolve({ success: !0, stakeholderType: Fe.Owner });
16243
+ return Promise.resolve({ success: !0, stakeholderType: Be.Owner });
16265
16244
  const s = k.getMap("transactionCustomerIds");
16266
16245
  if (s?.has(t) && s.get(t) && await this.reloadLoggedInCustomer()) {
16267
16246
  const u = this.customer?.bundleStakeholders?.find(
@@ -16299,7 +16278,7 @@ class $d {
16299
16278
  }
16300
16279
  async customerHasBundleTemplates(t) {
16301
16280
  const i = (await y.getShadowGraphqlClient().query({
16302
- query: ye,
16281
+ query: Ce,
16303
16282
  errorPolicy: "all",
16304
16283
  fetchPolicy: "no-cache",
16305
16284
  variables: {
@@ -16318,7 +16297,7 @@ class $d {
16318
16297
  async getOrCreateCustomer(t) {
16319
16298
  this.customer = void 0;
16320
16299
  const e = y.getShadowGraphqlClient(), i = (await e.query({
16321
- query: ye,
16300
+ query: Ce,
16322
16301
  errorPolicy: "all",
16323
16302
  fetchPolicy: "no-cache",
16324
16303
  variables: {
@@ -16371,7 +16350,7 @@ class $d {
16371
16350
  return this.logOut(), console.error("Failed to refresh tokens."), !1;
16372
16351
  }
16373
16352
  const s = (await y.getShadowGraphqlClient().query({
16374
- query: ye,
16353
+ query: Ce,
16375
16354
  errorPolicy: "all",
16376
16355
  fetchPolicy: "no-cache",
16377
16356
  variables: {
@@ -16400,7 +16379,7 @@ class $d {
16400
16379
  if (i?.AuthenticationResult) {
16401
16380
  localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), localStorage.setItem("cognito-tokens", JSON.stringify(i.AuthenticationResult)), localStorage.setItem("cognito-email", t);
16402
16381
  const o = (await y.getShadowGraphqlClient().query({
16403
- query: ye,
16382
+ query: Ce,
16404
16383
  errorPolicy: "all",
16405
16384
  fetchPolicy: "no-cache",
16406
16385
  variables: {
@@ -16467,7 +16446,7 @@ class $d {
16467
16446
  o.set(r.id, r.partner.id), k.setMap("bundlePartnerIds", o);
16468
16447
  const s = k.getMap("bundleOwnerIds") || /* @__PURE__ */ new Map();
16469
16448
  s.set(r.id, r.bundleOwnerId), k.setMap("bundleOwnerIds", s);
16470
- const l = new oa(this, r, void 0, void 0, r.bundleOwnerId, {
16449
+ const l = new dn(this, r, void 0, void 0, r.bundleOwnerId, {
16471
16450
  eagerFetchProducts: a?.graphql?.productCollection?.eagerFetchProducts
16472
16451
  });
16473
16452
  return await l.getInitializationPromise(), l;
@@ -16494,7 +16473,7 @@ class $d {
16494
16473
  ...l,
16495
16474
  ...i?.graphql?.additionalHeaders
16496
16475
  }, d = await y.getShadowGraphqlClient().query({
16497
- query: Fs(i?.graphql?.productCollection?.eagerFetchProducts || !1),
16476
+ query: Ds(i?.graphql?.productCollection?.eagerFetchProducts || !1),
16498
16477
  variables: {
16499
16478
  id: t
16500
16479
  },
@@ -16507,7 +16486,7 @@ class $d {
16507
16486
  throw new Error(`Unable to find bundle: ${t}`);
16508
16487
  const A = d.data?.bundles[0], u = k.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
16509
16488
  u.set(A.id, A.partner.id), k.setMap("bundlePartnerIds", u);
16510
- const h = new oa(
16489
+ const h = new dn(
16511
16490
  this,
16512
16491
  A,
16513
16492
  e,
@@ -16534,7 +16513,7 @@ class $d {
16534
16513
  ...await Si(t),
16535
16514
  ...i?.graphql?.additionalHeaders
16536
16515
  }, l = (await y.getShadowGraphqlClient().mutate({
16537
- mutation: Ns(i?.graphql?.productCollection?.eagerFetchProducts || !1),
16516
+ mutation: Ns(),
16538
16517
  variables: {
16539
16518
  id: t,
16540
16519
  template: e,
@@ -16552,13 +16531,13 @@ class $d {
16552
16531
  const c = k.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
16553
16532
  c.set(l.id, l.partner.id), k.setMap("bundlePartnerIds", c);
16554
16533
  const d = k.getMap("bundleOwnerIds") || /* @__PURE__ */ new Map();
16555
- return d.set(l.id, l.bundleOwnerId), k.setMap("bundleOwnerIds", d), async () => {
16556
- const A = new oa(this, l, void 0, void 0, l.bundleOwnerId, {
16557
- eagerFetchProducts: i?.graphql?.productCollection?.eagerFetchProducts,
16558
- existingGlobalPropertyState: l.globalPropertyState
16559
- });
16560
- return await A.getInitializationPromise(), A;
16561
- };
16534
+ return d.set(l.id, l.bundleOwnerId), k.setMap("bundleOwnerIds", d), async () => await this.getExistingBundle(l.id, void 0, void 0, {
16535
+ graphql: {
16536
+ productCollection: {
16537
+ eagerFetchProducts: i?.graphql?.productCollection?.eagerFetchProducts || !1
16538
+ }
16539
+ }
16540
+ });
16562
16541
  }
16563
16542
  /**
16564
16543
  * Fetches information about the currently authenticated customer's bundles.
@@ -16590,7 +16569,7 @@ class $d {
16590
16569
  if (!this.customer)
16591
16570
  throw new Error("Customer not authenticated.");
16592
16571
  const t = await y.getShadowGraphqlClient().query({
16593
- query: Ds,
16572
+ query: Fs,
16594
16573
  variables: {
16595
16574
  id: this.customer.id
16596
16575
  },
@@ -16627,7 +16606,7 @@ class $d {
16627
16606
  throw new gt("No options provided!");
16628
16607
  const r = t.map((B, Q) => ({ option: B, index: Q })), o = r.filter((B) => B.option.type === "transaction"), s = r.filter(
16629
16608
  (B) => B.option.type === "integration" || B.option.type === "external" || B.option.type === "blank"
16630
- ), l = 50, c = Va(o, l), d = Va(s, l);
16609
+ ), l = 50, c = La(o, l), d = La(s, l);
16631
16610
  let A = 0;
16632
16611
  const u = y.getShadowGraphqlClient(), h = async (B) => {
16633
16612
  if (B.length === 0)
@@ -16692,7 +16671,7 @@ class $d {
16692
16671
  ), [S, w] = await Promise.all([
16693
16672
  (async () => g.length > 0 ? await lc(g) : [])(),
16694
16673
  (async () => f.length > 0 ? await yi(f, e) : [])()
16695
- ]), I = new Map(S.map((B) => [B.id, B])), b = new Map(w.map((B) => [B.id, B])), E = k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), F = p.map(async (B) => {
16674
+ ]), I = new Map(S.map((B) => [B.id, B])), b = new Map(w.map((B) => [B.id, B])), E = k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), D = p.map(async (B) => {
16696
16675
  const { transaction: Q, workflowId: U, readOnly: N, index: q } = B, St = U ? b.get(U) : void 0, ut = t[q];
16697
16676
  if (Q.integrationProductId) {
16698
16677
  const rt = I.get(Q.integrationProductId);
@@ -16702,7 +16681,7 @@ class $d {
16702
16681
  const He = E.get(Q.id) || void 0, bi = new ec({
16703
16682
  onMutate: () => ({ context: { transactionOwnerId: He, bundleOwnerId: e?.bundleOwnerId } }),
16704
16683
  onQuery: () => ({ context: { transactionOwnerId: He, bundleOwnerId: e?.bundleOwnerId } })
16705
- }), Ae = {
16684
+ }), ce = {
16706
16685
  workflow: St,
16707
16686
  transaction: Q,
16708
16687
  singleVariantsRenderable: ut?.workflowConfiguration?.singleVariantsRenderable,
@@ -16718,13 +16697,13 @@ class $d {
16718
16697
  };
16719
16698
  if (ut.type === "transaction" && Q.workflowState) {
16720
16699
  const rt = JSON.parse(Q.workflowState);
16721
- await tn(rt), Ae.reloadedState = rt;
16700
+ await Za(rt), ce.reloadedState = rt;
16722
16701
  } else if (!N && ut.workflowState) {
16723
16702
  const rt = JSON.parse(ut.workflowState);
16724
- await tn(rt), Ae.reloadedState = rt;
16703
+ await Za(rt), ce.reloadedState = rt;
16725
16704
  }
16726
- return Ae.delayWorkflowStateSync = !0, { experienceOptions: Ae, index: q, options: ut };
16727
- }), x = await Promise.all(F);
16705
+ return ce.delayWorkflowStateSync = !0, { experienceOptions: ce, index: q, options: ut };
16706
+ }), x = await Promise.all(D);
16728
16707
  k.setMap("transactionOwnerIds", E);
16729
16708
  const T = x.sort((B, Q) => B.index - Q.index);
16730
16709
  let $ = [];
@@ -16879,12 +16858,12 @@ function dc(n, t, e, a) {
16879
16858
  const s = n, l = Math.max(t.width / e.width, t.height / e.height);
16880
16859
  s.zoom = Math.max(l, n.zoom);
16881
16860
  const c = e.width * s.zoom, d = e.height * s.zoom;
16882
- return s.x = Se(n.x, t.width - c, 0), s.y = Se(n.y, t.height - d, 0), s;
16861
+ return s.x = we(n.x, t.width - c, 0), s.y = we(n.y, t.height - d, 0), s;
16883
16862
  }
16884
16863
  const o = n;
16885
- return o.x = Se(o.x, -i, t.width), o.y = Se(o.y, -r, t.height), o;
16864
+ return o.x = we(o.x, -i, t.width), o.y = we(o.y, -r, t.height), o;
16886
16865
  }
16887
- function Se(n, t, e) {
16866
+ function we(n, t, e) {
16888
16867
  return Math.min(Math.max(n, t), e);
16889
16868
  }
16890
16869
  class Ac {
@@ -16909,7 +16888,7 @@ class Ac {
16909
16888
  if (i.currentFrameSources) {
16910
16889
  let r = !1;
16911
16890
  for (let o = 0; o < i.currentFrameSources.length; o++) {
16912
- const s = i.currentFrameSources[o], l = await We(s), c = this.frameData ? this.frameData[o] : void 0;
16891
+ const s = i.currentFrameSources[o], l = await ze(s), c = this.frameData ? this.frameData[o] : void 0;
16913
16892
  Jt(l, c) || (this.frameData || (this.frameData = new Array(i.currentFrameSources.length)), this.frameData[o] = l, r = !0);
16914
16893
  }
16915
16894
  r && (this.onFrameDataChangeListeners.forEach(
@@ -16962,8 +16941,8 @@ class Ac {
16962
16941
  getImageSrc() {
16963
16942
  if (this.imageData) {
16964
16943
  if (this.imageData.svg) {
16965
- const t = xa(this.imageData.svg, this.imageData.colors || {}, !1);
16966
- return Ia(t);
16944
+ const t = Fa(this.imageData.svg, this.imageData.colors || {}, !1);
16945
+ return ba(t);
16967
16946
  }
16968
16947
  return this.imageData.src;
16969
16948
  }
@@ -17099,7 +17078,7 @@ class Ac {
17099
17078
  }
17100
17079
  recalculateOffsets(t) {
17101
17080
  this.frameData && ((!this.offsets || this.offsets.length !== this.frameData.length) && (this.offsets = new Array(this.frameData.length)), this.frameData.forEach((e, a) => {
17102
- this.offsets[a] = Na(
17081
+ this.offsets[a] = Ta(
17103
17082
  t,
17104
17083
  e,
17105
17084
  this.initialZoom && !this.forceImageCover ? { scale: this.initialZoom } : void 0,
@@ -17315,7 +17294,7 @@ class hc extends et {
17315
17294
  * Returns `true` if the Background Remover is available for the current session.
17316
17295
  */
17317
17296
  async canUseBackgroundRemover() {
17318
- return this.manager.getClient().canUseAddon(ba.BackgroundRemover);
17297
+ return this.manager.getClient().canUseAddon(Ea.BackgroundRemover);
17319
17298
  }
17320
17299
  /**
17321
17300
  * Returns `true` if the Background Remover is available for the current session and if the associated frame has a user-supplied raster image.
@@ -17441,7 +17420,7 @@ const mc = C`
17441
17420
  id
17442
17421
  }
17443
17422
  }
17444
- `, Ua = C`
17423
+ `, $a = C`
17445
17424
  query GetCustomerTransactions(
17446
17425
  $id: String!
17447
17426
  $limit: Int!
@@ -17608,7 +17587,7 @@ const mc = C`
17608
17587
  },
17609
17588
  context: t
17610
17589
  }), Xd = async (n, t, e) => (await y.getShadowGraphqlClient().query({
17611
- query: Ua,
17590
+ query: $a,
17612
17591
  errorPolicy: "all",
17613
17592
  fetchPolicy: "no-cache",
17614
17593
  variables: {
@@ -17628,7 +17607,7 @@ const mc = C`
17628
17607
  limit: t
17629
17608
  }
17630
17609
  }))?.data.customerTransactionsFeed?.items || [], Zd = async (n, t, e) => (await y.getShadowGraphqlClient().query({
17631
- query: Ua,
17610
+ query: $a,
17632
17611
  errorPolicy: "all",
17633
17612
  fetchPolicy: "no-cache",
17634
17613
  variables: {
@@ -17648,7 +17627,7 @@ const mc = C`
17648
17627
  limit: t
17649
17628
  }
17650
17629
  }))?.data.customerTransactionsFeed?.items || [], tA = async (n, t, e) => (await y.getShadowGraphqlClient().query({
17651
- query: Ua,
17630
+ query: $a,
17652
17631
  errorPolicy: "all",
17653
17632
  fetchPolicy: "no-cache",
17654
17633
  variables: {
@@ -17683,7 +17662,7 @@ const mc = C`
17683
17662
  console.error("vite-plugin-css-injected-by-js", t);
17684
17663
  }
17685
17664
  })();
17686
- var vc = /* @__PURE__ */ ((n) => (n.Manual = "Manual", n.OnStart = "OnStart", n.OnQuit = "OnQuit", n.OnEnd = "OnEnd", n))(vc || {}), Ie = /* @__PURE__ */ ((n) => (n.Email = "Email", n.FirstName = "FirstName", n.LastName = "LastName", n.Phone = "Phone", n.Apartment = "Apartment", n.City = "City", n.Country = "Country", n.OrganizationName = "OrganizationName", n.PostCode = "PostCode", n.State = "State", n.StreetAddress = "StreetAddress", n.Custom = "Custom", n))(Ie || {}), X;
17665
+ var vc = /* @__PURE__ */ ((n) => (n.Manual = "Manual", n.OnStart = "OnStart", n.OnQuit = "OnQuit", n.OnEnd = "OnEnd", n))(vc || {}), Ee = /* @__PURE__ */ ((n) => (n.Email = "Email", n.FirstName = "FirstName", n.LastName = "LastName", n.Phone = "Phone", n.Apartment = "Apartment", n.City = "City", n.Country = "Country", n.OrganizationName = "OrganizationName", n.PostCode = "PostCode", n.State = "State", n.StreetAddress = "StreetAddress", n.Custom = "Custom", n))(Ee || {}), X;
17687
17666
  X = { __e: function(n, t, e, a) {
17688
17667
  for (var i, r, o; t = t.__; )
17689
17668
  if ((i = t.__c) && !i.__)
@@ -17695,12 +17674,12 @@ X = { __e: function(n, t, e, a) {
17695
17674
  }
17696
17675
  throw n;
17697
17676
  } }, typeof Promise == "function" && Promise.prototype.then.bind(Promise.resolve());
17698
- var st, sa, hn, vi = [], la = [], mn = X.__b, gn = X.__r, pn = X.diffed, fn = X.__c, Cn = X.unmount;
17677
+ var st, oa, hn, vi = [], sa = [], mn = X.__b, gn = X.__r, pn = X.diffed, fn = X.__c, Cn = X.unmount;
17699
17678
  function Ec() {
17700
17679
  for (var n; n = vi.shift(); )
17701
17680
  if (n.__P && n.__H)
17702
17681
  try {
17703
- n.__H.__h.forEach(Be), n.__H.__h.forEach(va), n.__H.__h = [];
17682
+ n.__H.__h.forEach(be), n.__H.__h.forEach(Sa), n.__H.__h = [];
17704
17683
  } catch (t) {
17705
17684
  n.__H.__h = [], X.__e(t, n.__v);
17706
17685
  }
@@ -17710,20 +17689,20 @@ X.__b = function(n) {
17710
17689
  }, X.__r = function(n) {
17711
17690
  gn && gn(n);
17712
17691
  var t = (st = n.__c).__H;
17713
- t && (sa === st ? (t.__h = [], st.__h = [], t.__.forEach(function(e) {
17714
- e.__N && (e.__ = e.__N), e.__V = la, e.__N = e.i = void 0;
17715
- })) : (t.__h.forEach(Be), t.__h.forEach(va), t.__h = [])), sa = st;
17692
+ t && (oa === st ? (t.__h = [], st.__h = [], t.__.forEach(function(e) {
17693
+ e.__N && (e.__ = e.__N), e.__V = sa, e.__N = e.i = void 0;
17694
+ })) : (t.__h.forEach(be), t.__h.forEach(Sa), t.__h = [])), oa = st;
17716
17695
  }, X.diffed = function(n) {
17717
17696
  pn && pn(n);
17718
17697
  var t = n.__c;
17719
17698
  t && t.__H && (t.__H.__h.length && (vi.push(t) !== 1 && hn === X.requestAnimationFrame || ((hn = X.requestAnimationFrame) || bc)(Ec)), t.__H.__.forEach(function(e) {
17720
- e.i && (e.__H = e.i), e.__V !== la && (e.__ = e.__V), e.i = void 0, e.__V = la;
17721
- })), sa = st = null;
17699
+ e.i && (e.__H = e.i), e.__V !== sa && (e.__ = e.__V), e.i = void 0, e.__V = sa;
17700
+ })), oa = st = null;
17722
17701
  }, X.__c = function(n, t) {
17723
17702
  t.some(function(e) {
17724
17703
  try {
17725
- e.__h.forEach(Be), e.__h = e.__h.filter(function(a) {
17726
- return !a.__ || va(a);
17704
+ e.__h.forEach(be), e.__h = e.__h.filter(function(a) {
17705
+ return !a.__ || Sa(a);
17727
17706
  });
17728
17707
  } catch (a) {
17729
17708
  t.some(function(i) {
@@ -17736,7 +17715,7 @@ X.__b = function(n) {
17736
17715
  var t, e = n.__c;
17737
17716
  e && e.__H && (e.__H.__.forEach(function(a) {
17738
17717
  try {
17739
- Be(a);
17718
+ be(a);
17740
17719
  } catch (i) {
17741
17720
  t = i;
17742
17721
  }
@@ -17749,11 +17728,11 @@ function bc(n) {
17749
17728
  }, a = setTimeout(e, 100);
17750
17729
  wn && (t = requestAnimationFrame(e));
17751
17730
  }
17752
- function Be(n) {
17731
+ function be(n) {
17753
17732
  var t = st, e = n.__c;
17754
17733
  typeof e == "function" && (n.__c = void 0, e()), st = t;
17755
17734
  }
17756
- function va(n) {
17735
+ function Sa(n) {
17757
17736
  var t = st;
17758
17737
  n.__c = n.__(), st = t;
17759
17738
  }
@@ -17779,7 +17758,7 @@ const Ei = C`
17779
17758
  }
17780
17759
  missingComponentTypes
17781
17760
  }
17782
- `, La = C`
17761
+ `, Ua = C`
17783
17762
  ${Ei}
17784
17763
  fragment AddressValidationJobFields on AddressValidationJob {
17785
17764
  id
@@ -17792,14 +17771,14 @@ const Ei = C`
17792
17771
  }
17793
17772
  }
17794
17773
  `, Ic = C`
17795
- ${La}
17774
+ ${Ua}
17796
17775
  query GetAddressValidationJobs($ids: [String!]!) {
17797
17776
  addressValidationJobs(ids: $ids) {
17798
17777
  ...AddressValidationJobFields
17799
17778
  }
17800
17779
  }
17801
17780
  `, Bc = C`
17802
- ${La}
17781
+ ${Ua}
17803
17782
  query GetRecipientsWithAddressValidationJobs($ids: [String!]!) {
17804
17783
  recipients(ids: $ids) {
17805
17784
  id
@@ -17815,14 +17794,14 @@ const Ei = C`
17815
17794
  ...AddressValidationResultFields
17816
17795
  }
17817
17796
  }
17818
- `, Fc = C`
17819
- ${La}
17797
+ `, Dc = C`
17798
+ ${Ua}
17820
17799
  mutation BatchValidateRecipientAddress($ids: [String!]!) {
17821
17800
  recipientValidateBatch(ids: $ids) {
17822
17801
  ...AddressValidationJobFields
17823
17802
  }
17824
17803
  }
17825
- `, Dc = C`
17804
+ `, Fc = C`
17826
17805
  mutation OverrideRecipientAddress($id: String!) {
17827
17806
  recipientOverrideAddress(id: $id) {
17828
17807
  id
@@ -17860,7 +17839,7 @@ const aA = async (n) => {
17860
17839
  }
17861
17840
  })).data?.recipientValidate : void 0, rA = async (n) => {
17862
17841
  const t = n.map((a) => a.getTransaction().recipient?.id).filter((a) => !!a), e = await y.getShadowGraphqlClient().mutate({
17863
- mutation: Fc,
17842
+ mutation: Dc,
17864
17843
  errorPolicy: "all",
17865
17844
  fetchPolicy: "network-only",
17866
17845
  variables: {
@@ -17877,7 +17856,7 @@ const aA = async (n) => {
17877
17856
  if (!t)
17878
17857
  return;
17879
17858
  (await y.getShadowGraphqlClient().mutate({
17880
- mutation: Dc,
17859
+ mutation: Fc,
17881
17860
  errorPolicy: "all",
17882
17861
  fetchPolicy: "network-only",
17883
17862
  variables: {
@@ -17901,23 +17880,23 @@ const aA = async (n) => {
17901
17880
  }
17902
17881
  })).data.integrationProducts;
17903
17882
  export {
17904
- ba as AddonHandle,
17883
+ Ea as AddonHandle,
17905
17884
  kc as AddressValidationJobStatus,
17906
17885
  xc as AddressValidationResultConfirmationLevel,
17907
17886
  bn as AddressValidationStatus,
17908
17887
  Od as ArrayInput,
17909
17888
  G as AspectType,
17910
17889
  Bt as AssetNotFoundError,
17911
- Pe as AssetType,
17890
+ Ie as AssetType,
17912
17891
  xd as BringForwardCommand,
17913
- Dd as BringToBackCommand,
17914
- Fd as BringToFrontCommand,
17892
+ Fd as BringToBackCommand,
17893
+ Dd as BringToFrontCommand,
17915
17894
  Gi as BundleDesignCreationCartAddMode,
17916
17895
  O as CanvasCommand,
17917
- Ce as CollectionProduct,
17918
- dn as ColorOptionGlobalPropertyHandle,
17896
+ pe as CollectionProduct,
17897
+ cn as ColorOptionGlobalPropertyHandle,
17919
17898
  ko as CommandContext,
17920
- Ie as ConversionDataType,
17899
+ Ee as ConversionDataType,
17921
17900
  vc as ConversionLocation,
17922
17901
  H as CreateElementCommand,
17923
17902
  ni as CreateLayoutCommand,
@@ -17925,18 +17904,18 @@ export {
17925
17904
  nc as CurrencyService,
17926
17905
  Rt as DeleteElementCommand,
17927
17906
  ul as DigitalContentStepHandle,
17928
- Dl as FileUploadGlobalPropertyHandle,
17929
- we as FlowExecutionNodeResult,
17907
+ Fl as FileUploadGlobalPropertyHandle,
17908
+ fe as FlowExecutionNodeResult,
17930
17909
  Kl as FlowExecutionResult,
17931
17910
  Jl as FlowService,
17932
17911
  Qo as FontAlignmentCommand,
17933
17912
  To as FontColorCommand,
17934
17913
  No as FontSizeCommand,
17935
- an as FontSourceCommand,
17914
+ en as FontSourceCommand,
17936
17915
  Ac as FrameService,
17937
17916
  uc as FrameStep,
17938
17917
  hc as FrameStepHandle,
17939
- Oa as GlobalPropertyHandle,
17918
+ Ra as GlobalPropertyHandle,
17940
17919
  L as GroupCommand,
17941
17920
  il as IllustrationStepHandle,
17942
17921
  qe as InformationMessageType,
@@ -17944,11 +17923,11 @@ export {
17944
17923
  An as IntegrationProduct,
17945
17924
  qi as IntegrationType,
17946
17925
  Ed as LayoutElementFactory,
17947
- D as LayoutElementType,
17926
+ F as LayoutElementType,
17948
17927
  K as LayoutNotFoundError,
17949
17928
  Kt as LayoutRenderingPurpose,
17950
17929
  rl as MaterialStepHandle,
17951
- xe as MisconfigurationError,
17930
+ De as MisconfigurationError,
17952
17931
  Wd as MockWorkflowManager,
17953
17932
  ol as ModelStepHandle,
17954
17933
  hl as ModuleStepHandle,
@@ -17956,8 +17935,8 @@ export {
17956
17935
  wi as ObjectInput,
17957
17936
  _l as ObjectInputType,
17958
17937
  pi as OptionGlobalPropertyHandle,
17959
- De as OptionNotFoundError,
17960
- Dt as ParseError,
17938
+ Pe as OptionNotFoundError,
17939
+ Ft as ParseError,
17961
17940
  sl as PictureStepHandle,
17962
17941
  Hi as ProductCameraRig,
17963
17942
  Ci as ProductCollection,
@@ -17975,7 +17954,7 @@ export {
17975
17954
  cl as ShapeStepHandle,
17976
17955
  Wi as ShareActionType,
17977
17956
  $d as SpiffCommerceClient,
17978
- Fe as StakeholderType,
17957
+ Be as StakeholderType,
17979
17958
  zi as StepAspectType,
17980
17959
  et as StepHandle,
17981
17960
  v as StepType,
@@ -17990,7 +17969,7 @@ export {
17990
17969
  ji as UnitOfMeasurement,
17991
17970
  Pd as UpdateImageSourceCommand,
17992
17971
  ot as Variant,
17993
- ya as WorkflowExperienceEventType,
17972
+ wa as WorkflowExperienceEventType,
17994
17973
  Il as WorkflowExperienceImpl,
17995
17974
  V as assetService,
17996
17975
  wr as browserColorToHex,
@@ -18000,7 +17979,7 @@ export {
18000
17979
  od as dataUrlFromExternalUrl,
18001
17980
  Gd as deleteBundle,
18002
17981
  ra as designService,
18003
- be as determineCorrectFontSizeAndLines,
17982
+ ve as determineCorrectFontSizeAndLines,
18004
17983
  ri as digitalContentStepService,
18005
17984
  At as domParser,
18006
17985
  jd as duplicateBundle,
@@ -18016,14 +17995,14 @@ export {
18016
17995
  lt as generateSVGWithUnknownColors,
18017
17996
  Td as generateStateFromDesignInputSteps,
18018
17997
  nA as getAddressValidationJobs,
18019
- Ve as getAttributesFromArrayBuffer,
17998
+ Ue as getAttributesFromArrayBuffer,
18020
17999
  dd as getAxisAlignedBoundingBox,
18021
18000
  dc as getBoundedOffsets,
18022
18001
  Vd as getBundleThemeConfiguration,
18023
18002
  Jd as getCustomer,
18024
18003
  Kd as getCustomerBundles,
18025
18004
  wd as getElementVertices,
18026
- We as getFrameData,
18005
+ ze as getFrameData,
18027
18006
  Nd as getGlobalPropertyStateForBundle,
18028
18007
  cc as getIntegration,
18029
18008
  sA as getIntegrationProducts,
@@ -18034,7 +18013,7 @@ export {
18034
18013
  md as getPointOfRotation,
18035
18014
  Qd as getProductCollections,
18036
18015
  fd as getSEPoint,
18037
- Ma as getSvgElement,
18016
+ ka as getSvgElement,
18038
18017
  eA as getTemplateBundles,
18039
18018
  tA as getTemplateTransactions,
18040
18019
  Ud as getTransaction,
@@ -18046,7 +18025,7 @@ export {
18046
18025
  sc as getWorkflow,
18047
18026
  yi as getWorkflows,
18048
18027
  y as graphQlManager,
18049
- Ee as illustrationStepService,
18028
+ Se as illustrationStepService,
18050
18029
  ud as isCloseToValue,
18051
18030
  Qt as loadFont,
18052
18031
  ld as matchHexToPms,
@@ -18054,7 +18033,7 @@ export {
18054
18033
  Ul as metafieldManager,
18055
18034
  yd as mmPerPixel,
18056
18035
  si as modelStepService,
18057
- xa as modifySVGColors,
18036
+ Fa as modifySVGColors,
18058
18037
  li as moduleStepService,
18059
18038
  qd as nameBundle,
18060
18039
  Hd as nameTransaction,
@@ -18068,19 +18047,19 @@ export {
18068
18047
  di as questionStepService,
18069
18048
  rd as registerFetchImplementation,
18070
18049
  id as registerWindowImplementation,
18071
- tn as rehydrateSerializedLayout,
18050
+ Za as rehydrateSerializedLayout,
18072
18051
  pr as rgbToPms,
18073
- ge as rotateAroundPoint,
18074
- Fa as sanitizeSvgTree,
18052
+ he as rotateAroundPoint,
18053
+ Pa as sanitizeSvgTree,
18075
18054
  sr as setBearerAuthenticationToken,
18076
18055
  kn as setCanvasModule,
18077
18056
  Wt as shapeStepService,
18078
18057
  Lo as shortenUrl,
18079
18058
  ft as spiffCoreConfiguration,
18080
18059
  Md as stepAspectValuesToDesignInputSteps,
18081
- Ja as svgColorValueToDefinition,
18060
+ Ya as svgColorValueToDefinition,
18082
18061
  ei as svgStringDimensions,
18083
- Ia as svgToDataUrl,
18062
+ ba as svgToDataUrl,
18084
18063
  j as textStepService,
18085
18064
  Ko as toast,
18086
18065
  iA as validateWorkflowExperienceRecipient,