@spiffcommerce/core 32.2.4-beta.2a1f0ff0-c7c4-56e0-afbf-fd744926c42c → 32.2.4-beta.4afe3abf-22fb-564b-b8a7-84762f8e91f4
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.js +55 -55
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +346 -349
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -4,26 +4,26 @@ import { onError as hr } from "@apollo/client/link/error";
|
|
4
4
|
import { renderToStaticMarkup as mr } from "preact-render-to-string";
|
5
5
|
import { removeTypenameFromVariables as gr } from "@apollo/client/link/remove-typename";
|
6
6
|
import { orientation as pr } from "exifr/dist/mini.umd.cjs";
|
7
|
-
import { parse as
|
7
|
+
import { parse as ln } from "css";
|
8
8
|
import fr from "fuse.js";
|
9
|
-
import { Pith as
|
9
|
+
import { Pith as ua } from "pith";
|
10
10
|
import Et from "lodash.clonedeep";
|
11
|
-
import { toString as
|
11
|
+
import { toString as cn } from "qrcode";
|
12
12
|
import Cr from "svg-path-bbox";
|
13
|
-
import { parse as
|
13
|
+
import { parse as ea } from "opentype.js";
|
14
14
|
import { jsx as D, jsxs as ct, Fragment as Gt } from "preact/jsx-runtime";
|
15
15
|
import wr from "handlebars";
|
16
16
|
import { dataUriToBuffer as yr } from "data-uri-to-buffer";
|
17
|
-
import
|
18
|
-
import { CognitoIdentityProviderClient as Sr, InitiateAuthCommand as
|
17
|
+
import xa from "lodash.chunk";
|
18
|
+
import { CognitoIdentityProviderClient as Sr, InitiateAuthCommand as ka, RespondToAuthChallengeCommand as vr } from "@aws-sdk/client-cognito-identity-provider";
|
19
19
|
import Er from "dinero.js";
|
20
|
-
import * as
|
21
|
-
import
|
22
|
-
import { split as
|
20
|
+
import * as Ma from "currency-codes";
|
21
|
+
import ye from "lodash.isequal";
|
22
|
+
import { split as aa } from "unicode-default-word-boundary";
|
23
23
|
import dn from "lodash.debounce";
|
24
24
|
import "fs";
|
25
25
|
import "path";
|
26
|
-
var
|
26
|
+
var Se = /* @__PURE__ */ ((r) => (r.Data = "Data", r.Font = "Font", r.Frame = "Frame", r.Illustration = "Illustration", r.Image = "Image", r.Model = "Model", r.Material = "Material", r.Color = "Color", r.QuestionnaireCollateral = "QuestionnaireCollateral", r.RequestCollateral = "RequestCollateral", r.SignupCollateral = "SignupCollateral", r.Video = "Video", r.ColorProfile = "ColorProfile", r.Environment = "Environment", r))(Se || {}), U = /* @__PURE__ */ ((r) => (r.FileUpload = "FileUpload", r.Option = "Option", r.ColorOption = "ColorOption", r.Text = "Text", r))(U || {}), v = /* @__PURE__ */ ((r) => (r.Information = "Information", r.Bulk = "Bulk", r.DigitalContent = "DigitalContent", r.Finish = "Finish", r.Frame = "Frame", r.Illustration = "Illustration", r.Introduction = "Introduction", r.Material = "Material", r.Model = "Model", r.Module = "Module", r.Picture = "Picture", r.Photo = "Photo", r.ProductOverlay = "ProductOverlay", r.Question = "Question", r.Shape = "Shape", r.SilentIllustration = "SilentIllustration", r.Text = "Text", r))(v || {}), br = /* @__PURE__ */ ((r) => (r.Color = "Color", r.Colors = "Colors", r.Selection = "Selection", r.Selections = "Selections", r.Text = "Text", r.Upload = "Upload", r))(br || {}), Ht = /* @__PURE__ */ ((r) => (r.ThreeD = "ThreeD", r.FreeDesign = "FreeDesign", r.Print = "Print", r))(Ht || {}), x = /* @__PURE__ */ ((r) => (r.Frame = "frame", r.Group = "group", r.Image = "image", r.Pattern = "pattern", r.Illustration = "illustration", r.Textbox = "textbox", r))(x || {}), Br = /* @__PURE__ */ ((r) => (r.Default = "Default", r.FirstTransaction = "FirstTransaction", r.OneToOne = "OneToOne", r))(Br || {}), An = /* @__PURE__ */ ((r) => (r.Pending = "Pending", r.Failed = "Failed", r.Validated = "Validated", r.Overridden = "Overridden", r))(An || {}), Ir = /* @__PURE__ */ ((r) => (r.Hyperlink = "Hyperlink", r.Edit = "Edit", r.Approve = "Approve", r))(Ir || {}), Pr = /* @__PURE__ */ ((r) => (r.Hub = "Hub", r.Shopify = "Shopify", r))(Pr || {}), ha = /* @__PURE__ */ ((r) => (r.BackgroundRemover = "BackgroundRemover", r.ConversionAccelerator = "Conversion Accelerator", r.ProcessBuilder = "ProcessBuilder", r))(ha || {}), Dr = /* @__PURE__ */ ((r) => (r[r.Orbit = 0] = "Orbit", r[r.Pan = 1] = "Pan", r))(Dr || {}), ve = /* @__PURE__ */ ((r) => (r.Owner = "Owner", r.Approver = "Approver", r.Editor = "Editor", r.Viewer = "Viewer", r))(ve || {}), Mt = /* @__PURE__ */ ((r) => (r.Autosize = "Autosize", r.Traditional = "Traditional", r))(Mt || {}), j = /* @__PURE__ */ ((r) => (r[r.North = 0] = "North", r[r.Northeast = 1] = "Northeast", r[r.East = 2] = "East", r[r.Southeast = 3] = "Southeast", r[r.South = 4] = "South", r[r.Southwest = 5] = "Southwest", r[r.West = 6] = "West", r[r.Northwest = 7] = "Northwest", r))(j || {}), Fr = /* @__PURE__ */ ((r) => (r.Pixel = "px", r.Millimeter = "mm", r.Centimeter = "cm", r))(Fr || {});
|
27
27
|
class un extends Error {
|
28
28
|
constructor(t) {
|
29
29
|
super(t), this.name = this.constructor.name;
|
@@ -34,7 +34,7 @@ class Xt extends un {
|
|
34
34
|
super(`ConfigurationError - ${t}`);
|
35
35
|
}
|
36
36
|
}
|
37
|
-
class
|
37
|
+
class Ee extends Xt {
|
38
38
|
constructor(t) {
|
39
39
|
super(`Option not Configured: ${t.stepTitle}`), this.optionId = t?.optionId || "N/A";
|
40
40
|
}
|
@@ -54,32 +54,32 @@ class Yt extends Xt {
|
|
54
54
|
super(`Resource not found for asset: ${t.name}`), this.asset = t;
|
55
55
|
}
|
56
56
|
}
|
57
|
-
class
|
57
|
+
class be extends Xt {
|
58
58
|
constructor(t, e) {
|
59
59
|
super(`Workflow Misconfiguration: ${t.stepName} - ${e}`), this.step = t;
|
60
60
|
}
|
61
61
|
}
|
62
|
-
class
|
62
|
+
class ke extends un {
|
63
63
|
constructor(t) {
|
64
64
|
super(`ImplementationError - ${t}`);
|
65
65
|
}
|
66
66
|
}
|
67
|
-
class V extends
|
67
|
+
class V extends ke {
|
68
68
|
constructor(t) {
|
69
69
|
super(`Unhandled Behavior Encountered: ${t}`);
|
70
70
|
}
|
71
71
|
}
|
72
|
-
class Dt extends
|
72
|
+
class Dt extends ke {
|
73
73
|
constructor(t) {
|
74
74
|
super(`Parsing Error: ${t}`);
|
75
75
|
}
|
76
76
|
}
|
77
|
-
class ht extends
|
77
|
+
class ht extends ke {
|
78
78
|
constructor(t) {
|
79
79
|
super(`Client Error: ${t}`);
|
80
80
|
}
|
81
81
|
}
|
82
|
-
class
|
82
|
+
class Me extends ke {
|
83
83
|
constructor(t) {
|
84
84
|
super(`Resource Generation Failed: ${t}`);
|
85
85
|
}
|
@@ -104,7 +104,7 @@ class xr {
|
|
104
104
|
this.set(t, a);
|
105
105
|
}
|
106
106
|
}
|
107
|
-
class
|
107
|
+
class Ta {
|
108
108
|
constructor() {
|
109
109
|
this.storage = /* @__PURE__ */ new Map();
|
110
110
|
}
|
@@ -129,9 +129,9 @@ class Ma {
|
|
129
129
|
}
|
130
130
|
const kr = () => {
|
131
131
|
try {
|
132
|
-
return localStorage ? new xr() : new
|
132
|
+
return localStorage ? new xr() : new Ta();
|
133
133
|
} catch {
|
134
|
-
return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."), new
|
134
|
+
return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."), new Ta();
|
135
135
|
}
|
136
136
|
}, k = kr();
|
137
137
|
class Mr {
|
@@ -161,41 +161,41 @@ class Mr {
|
|
161
161
|
}
|
162
162
|
}
|
163
163
|
const gt = new Mr();
|
164
|
-
let
|
164
|
+
let na, ra;
|
165
165
|
function Qc(r) {
|
166
|
-
|
166
|
+
na = r;
|
167
167
|
}
|
168
168
|
function Rc(r) {
|
169
|
-
|
169
|
+
ra = r;
|
170
170
|
}
|
171
171
|
function Zt() {
|
172
|
-
return
|
172
|
+
return na ? new na().window : (console.log(
|
173
173
|
"DOM constructor is not registered. Assuming browser environment. If not, please register DOM constructor before calling this function."
|
174
174
|
), window);
|
175
175
|
}
|
176
176
|
function rt(r, t) {
|
177
|
-
if (!
|
177
|
+
if (!ra) {
|
178
178
|
if (typeof window < "u" && window.fetch)
|
179
179
|
return window.fetch(r, t);
|
180
180
|
if (typeof global < "u" && global.fetch)
|
181
181
|
return global.fetch(r, t);
|
182
182
|
throw new Error("Fetch implementation is not registered. Please register it before calling this function.");
|
183
183
|
}
|
184
|
-
return
|
184
|
+
return ra(r, t);
|
185
185
|
}
|
186
|
-
const hn = /* @__PURE__ */ new Map(),
|
187
|
-
const t =
|
186
|
+
const hn = /* @__PURE__ */ new Map(), Na = /* @__PURE__ */ new Map(), Qa = /* @__PURE__ */ new Map(), mn = async (r) => {
|
187
|
+
const t = Na.get(r);
|
188
188
|
if (t) return t;
|
189
189
|
const a = (async () => {
|
190
190
|
const n = await rt(r);
|
191
191
|
return hn.set(r, n.headers?.get("content-type") || ""), await n.arrayBuffer();
|
192
192
|
})();
|
193
|
-
return
|
193
|
+
return Na.set(r, a), a;
|
194
194
|
}, Tr = async (r) => {
|
195
|
-
const t =
|
195
|
+
const t = Qa.get(r);
|
196
196
|
if (t) return t;
|
197
197
|
const a = (async () => await (await rt(r)).text())();
|
198
|
-
return
|
198
|
+
return Qa.set(r, a), a;
|
199
199
|
}, Tt = (r) => r.every((t) => t !== "undefined"), se = (r) => Tt([typeof document]) ? document.createElement(r) : Zt().document.createElement(r), Nr = (r, t) => {
|
200
200
|
if (Tt([typeof document]))
|
201
201
|
return document.createElementNS(r, t);
|
@@ -206,7 +206,7 @@ const hn = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @_
|
|
206
206
|
return new DOMParser();
|
207
207
|
const r = Zt();
|
208
208
|
return new r.DOMParser();
|
209
|
-
}, Qr = () => Tt([typeof DOMParser]) ? DOMParser : Zt().DOMParser,
|
209
|
+
}, Qr = () => Tt([typeof DOMParser]) ? DOMParser : Zt().DOMParser, Te = (r, t) => new Promise((e, a) => {
|
210
210
|
t ? mn(r).then(e).catch(a) : rt(r).then((n) => {
|
211
211
|
n.arrayBuffer().then(e).catch(a);
|
212
212
|
}).catch((n) => {
|
@@ -216,21 +216,21 @@ const hn = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @_
|
|
216
216
|
t ? Tr(r).then(e).catch(a) : rt(r).then((n) => {
|
217
217
|
n.text().then(e).catch(a);
|
218
218
|
}).catch(a);
|
219
|
-
}), gn = (r) => mr(r),
|
219
|
+
}), gn = (r) => mr(r), Le = /* @__PURE__ */ new Map(), Rr = async (r, t) => {
|
220
220
|
if (Tt([typeof FontFace])) {
|
221
|
-
if (
|
222
|
-
return
|
221
|
+
if (Le.has(t))
|
222
|
+
return Le.get(t);
|
223
223
|
const e = r.names.fullName.en, a = new FontFace(e, `url(${t})`);
|
224
224
|
document.fonts.add(a);
|
225
225
|
const n = a.load();
|
226
|
-
return
|
226
|
+
return Le.set(t, n), n;
|
227
227
|
}
|
228
228
|
}, It = () => {
|
229
229
|
if (Tt([typeof XMLSerializer]))
|
230
230
|
return new XMLSerializer();
|
231
231
|
const r = Zt();
|
232
232
|
return new r.XMLSerializer();
|
233
|
-
},
|
233
|
+
}, Ra = (r) => btoa(r), Ne = (r) => {
|
234
234
|
function t() {
|
235
235
|
const a = new Uint8Array(r), n = 4;
|
236
236
|
if (a.length >= n) {
|
@@ -257,7 +257,7 @@ const hn = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @_
|
|
257
257
|
const e = t();
|
258
258
|
return e || "image/svg+xml";
|
259
259
|
}, Oc = async (r) => {
|
260
|
-
const t = await mn(r), e = hn.get(r) ||
|
260
|
+
const t = await mn(r), e = hn.get(r) || Ne(t);
|
261
261
|
return await Ur(new Blob([t], { type: e }));
|
262
262
|
}, Or = (r) => {
|
263
263
|
let t = "";
|
@@ -266,9 +266,9 @@ const hn = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @_
|
|
266
266
|
t += String.fromCharCode(r[a]);
|
267
267
|
return t;
|
268
268
|
}, $r = async (r) => {
|
269
|
-
const t =
|
269
|
+
const t = Ne(r), e = new Uint8Array(r), a = Or(e), n = btoa(a);
|
270
270
|
return `data:${t};base64,${n}`;
|
271
|
-
},
|
271
|
+
}, ma = (r) => `data:image/svg+xml;base64,${btoa(r)}`, pn = (r) => {
|
272
272
|
const t = r.replace(/\r?\n/g, ""), e = t.indexOf(",");
|
273
273
|
if (e === -1 || e <= 4)
|
274
274
|
throw new TypeError("malformed data: URI");
|
@@ -287,10 +287,10 @@ const hn = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @_
|
|
287
287
|
!i || !i.result ? e() : t(i.result.toString());
|
288
288
|
}, a.readAsDataURL(r);
|
289
289
|
});
|
290
|
-
let Lr,
|
290
|
+
let Lr, ga;
|
291
291
|
const Vr = (r) => {
|
292
|
-
|
293
|
-
}, zr = () =>
|
292
|
+
ga = r;
|
293
|
+
}, zr = () => ga;
|
294
294
|
let fn;
|
295
295
|
const Gr = (r) => {
|
296
296
|
fn = r;
|
@@ -301,7 +301,7 @@ const Gr = (r) => {
|
|
301
301
|
window.parent !== window && (window.addEventListener("message", e, !1), window.parent.postMessage("ready", t));
|
302
302
|
}), qr = async () => {
|
303
303
|
const r = {
|
304
|
-
applicationKey:
|
304
|
+
applicationKey: ga,
|
305
305
|
customerToken: Lr,
|
306
306
|
bearer: fn
|
307
307
|
};
|
@@ -364,10 +364,10 @@ class Hr {
|
|
364
364
|
}
|
365
365
|
}
|
366
366
|
const y = new Hr();
|
367
|
-
let
|
367
|
+
let ia, sa;
|
368
368
|
const pt = (r, t, e) => {
|
369
|
-
if (
|
370
|
-
return
|
369
|
+
if (ia !== void 0)
|
370
|
+
return ia(r, t, e);
|
371
371
|
try {
|
372
372
|
const a = wn(!0);
|
373
373
|
return Cn(a), a.createCanvas(r, t, e);
|
@@ -375,8 +375,8 @@ const pt = (r, t, e) => {
|
|
375
375
|
throw new Error("Canvas module not set");
|
376
376
|
}
|
377
377
|
}, te = (r, t) => {
|
378
|
-
if (
|
379
|
-
return
|
378
|
+
if (sa !== void 0)
|
379
|
+
return sa(r, t);
|
380
380
|
try {
|
381
381
|
const e = wn(!0);
|
382
382
|
return Cn(e), e.loadImage(r, t);
|
@@ -385,7 +385,7 @@ const pt = (r, t, e) => {
|
|
385
385
|
}
|
386
386
|
};
|
387
387
|
function Cn(r) {
|
388
|
-
|
388
|
+
ia = r?.createCanvas, sa = r?.loadImage;
|
389
389
|
}
|
390
390
|
function wn(r) {
|
391
391
|
try {
|
@@ -406,13 +406,13 @@ function wn(r) {
|
|
406
406
|
throw t;
|
407
407
|
}
|
408
408
|
}
|
409
|
-
let
|
410
|
-
function
|
411
|
-
return
|
409
|
+
let Ve;
|
410
|
+
function pa() {
|
411
|
+
return Ve === void 0 && (Ve = Qr()), Ve;
|
412
412
|
}
|
413
413
|
let oe = null;
|
414
414
|
const Yr = (r) => new Promise((t) => {
|
415
|
-
if (
|
415
|
+
if (Ne(r) !== "image/jpeg")
|
416
416
|
return t(1);
|
417
417
|
pr(r).then((a) => t(a || 1)).catch(() => t(1));
|
418
418
|
}), Jr = async () => {
|
@@ -454,9 +454,9 @@ const Yr = (r) => new Promise((t) => {
|
|
454
454
|
break;
|
455
455
|
}
|
456
456
|
return d.drawImage(e, 0, 0, o, l), c;
|
457
|
-
},
|
457
|
+
}, Qe = async (r) => {
|
458
458
|
const t = await _r(r);
|
459
|
-
return
|
459
|
+
return Ne(r) === "image/jpeg" ? {
|
460
460
|
dataUrl: t.toDataURL("image/jpeg", 1),
|
461
461
|
height: t.height,
|
462
462
|
width: t.width
|
@@ -3149,7 +3149,7 @@ const Yr = (r) => new Promise((t) => {
|
|
3149
3149
|
"3E2B2E",
|
3150
3150
|
"101820",
|
3151
3151
|
"3D3935"
|
3152
|
-
],
|
3152
|
+
], ze = xt.map((r) => [
|
3153
3153
|
parseInt(r.substring(0, 2), 16),
|
3154
3154
|
parseInt(r.substring(2, 4), 16),
|
3155
3155
|
parseInt(r.substring(4, 6), 16)
|
@@ -3172,7 +3172,7 @@ function Uc(r, t = 64) {
|
|
3172
3172
|
const i = parseInt(r.substring(0, 2), 16), s = parseInt(r.substring(2, 4), 16), o = parseInt(r.substring(4, 6), 16);
|
3173
3173
|
let l, c, d;
|
3174
3174
|
for (let A = 0; A < xt.length; A++) {
|
3175
|
-
l =
|
3175
|
+
l = ze[A][0], c = ze[A][1], d = ze[A][2];
|
3176
3176
|
const u = Math.sqrt(Math.pow(i - l, 2) + Math.pow(s - c, 2) + Math.pow(o - d, 2));
|
3177
3177
|
a.push(u);
|
3178
3178
|
}
|
@@ -3187,16 +3187,16 @@ function Lc(r, t) {
|
|
3187
3187
|
let Qt = null;
|
3188
3188
|
function ei(r) {
|
3189
3189
|
if (r.startsWith("#"))
|
3190
|
-
return
|
3190
|
+
return Oa(r);
|
3191
3191
|
if (!document)
|
3192
3192
|
throw new Error("browserColorToHex is only supported on browsers");
|
3193
3193
|
if (Qt || (Qt = document.createElement("canvas").getContext("2d")), !Qt)
|
3194
3194
|
throw new Error("Failed to create canvas context required to convert colors");
|
3195
3195
|
Qt.fillStyle = r;
|
3196
|
-
const t =
|
3196
|
+
const t = Oa(Qt.fillStyle);
|
3197
3197
|
return t || console.error(`Unknown browser color ${r}`), t;
|
3198
3198
|
}
|
3199
|
-
function
|
3199
|
+
function Oa(r) {
|
3200
3200
|
const t = r.substring(1).toUpperCase();
|
3201
3201
|
return t.length === 6 ? t : t.length === 3 ? `${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}` : "";
|
3202
3202
|
}
|
@@ -3211,7 +3211,7 @@ const le = (r) => {
|
|
3211
3211
|
return `icc-named-color(${t.slice(e + 1).slice(0, -4)}, ${r.namedColor})`;
|
3212
3212
|
}
|
3213
3213
|
return `icc-named-color(${r.profileName}, ${r.namedColor})`;
|
3214
|
-
},
|
3214
|
+
}, $a = (r) => {
|
3215
3215
|
const t = r.split(/[ ](?=[^)]*?(?:\(|$))/);
|
3216
3216
|
if (t.length === 0)
|
3217
3217
|
return { browserValue: "#000000" };
|
@@ -3245,7 +3245,7 @@ const le = (r) => {
|
|
3245
3245
|
} catch {
|
3246
3246
|
return r.classList.contains(t.substring(1));
|
3247
3247
|
}
|
3248
|
-
},
|
3248
|
+
}, fa = (r, t = !1) => {
|
3249
3249
|
!t && r.setAttribute("preserveAspectRatio", "none");
|
3250
3250
|
const e = [];
|
3251
3251
|
kt(r, (a) => {
|
@@ -3255,7 +3255,7 @@ const le = (r) => {
|
|
3255
3255
|
}
|
3256
3256
|
if (a.tagName === "style") {
|
3257
3257
|
try {
|
3258
|
-
|
3258
|
+
ln(a.innerHTML).stylesheet?.rules.forEach((s) => {
|
3259
3259
|
e.push(s);
|
3260
3260
|
}), a.remove();
|
3261
3261
|
} catch (i) {
|
@@ -3328,12 +3328,12 @@ const le = (r) => {
|
|
3328
3328
|
}
|
3329
3329
|
});
|
3330
3330
|
});
|
3331
|
-
}, En = (r) => It().serializeToString(r),
|
3331
|
+
}, En = (r) => It().serializeToString(r), Ca = (r, t, e, a, n) => {
|
3332
3332
|
const i = Sn(r);
|
3333
3333
|
if (!i)
|
3334
3334
|
throw new Error("Failed to read SVG.");
|
3335
3335
|
return si(i, t, e), vn(i, a, n), En(i);
|
3336
|
-
},
|
3336
|
+
}, wa = (r, t, e) => {
|
3337
3337
|
const a = Sn(r);
|
3338
3338
|
if (!a)
|
3339
3339
|
throw new Error("Failed to read SVG.");
|
@@ -3345,18 +3345,18 @@ const le = (r) => {
|
|
3345
3345
|
const e = oi(r).firstElementChild;
|
3346
3346
|
if (!e)
|
3347
3347
|
throw new Error("Failed to read SVG.");
|
3348
|
-
|
3348
|
+
fa(e);
|
3349
3349
|
const a = {};
|
3350
3350
|
kt(e, (s) => {
|
3351
3351
|
ai.includes(s.tagName) && !s.attributes.getNamedItem("fill") && s.setAttribute("fill", "black");
|
3352
3352
|
const o = s.attributes.getNamedItem("fill");
|
3353
3353
|
if (o && o.value !== "none" && !o.value.startsWith("url(")) {
|
3354
|
-
const c =
|
3354
|
+
const c = $a(o.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-fill-${d}`;
|
3355
3355
|
s.setAttribute("fill", c.browserValue), s.classList.add(A), a[d] = c;
|
3356
3356
|
}
|
3357
3357
|
const l = s.attributes.getNamedItem("stroke");
|
3358
3358
|
if (l && l.value !== "none" && !l.value.startsWith("url(")) {
|
3359
|
-
const c =
|
3359
|
+
const c = $a(l.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-stroke-${d}`;
|
3360
3360
|
s.classList.add(A), s.setAttribute("stroke", c.browserValue), a[d] = c;
|
3361
3361
|
}
|
3362
3362
|
});
|
@@ -3422,7 +3422,7 @@ const le = (r) => {
|
|
3422
3422
|
...AssetFields
|
3423
3423
|
}
|
3424
3424
|
}
|
3425
|
-
`,
|
3425
|
+
`, ya = w`
|
3426
3426
|
fragment MaterialFields on Material {
|
3427
3427
|
id
|
3428
3428
|
name
|
@@ -3470,7 +3470,7 @@ const le = (r) => {
|
|
3470
3470
|
}
|
3471
3471
|
}
|
3472
3472
|
`, di = w`
|
3473
|
-
${
|
3473
|
+
${ya}
|
3474
3474
|
query GetMaterials($ids: [String]) {
|
3475
3475
|
materials(id: $ids) {
|
3476
3476
|
...MaterialFields
|
@@ -3497,7 +3497,7 @@ const le = (r) => {
|
|
3497
3497
|
...AssetFields
|
3498
3498
|
}
|
3499
3499
|
}
|
3500
|
-
`,
|
3500
|
+
`, Be = async (r) => (await y.getShadowGraphqlClient().query({
|
3501
3501
|
query: ci,
|
3502
3502
|
errorPolicy: "all",
|
3503
3503
|
fetchPolicy: "no-cache",
|
@@ -3525,7 +3525,7 @@ const le = (r) => {
|
|
3525
3525
|
class gi {
|
3526
3526
|
constructor() {
|
3527
3527
|
this.cache = /* @__PURE__ */ new Map(), this.bgrmProcessCache = /* @__PURE__ */ new Map(), this.materialCache = /* @__PURE__ */ new Map(), this.loadImageAsFileInfo = async (t) => {
|
3528
|
-
const e = await t.arrayBuffer(), a = await
|
3528
|
+
const e = await t.arrayBuffer(), a = await Qe(e), n = (i, s) => {
|
3529
3529
|
const o = atob(i.split(",")[1]), l = [];
|
3530
3530
|
for (let c = 0; c < o.length; c++)
|
3531
3531
|
l.push(o.charCodeAt(c));
|
@@ -3546,14 +3546,14 @@ class gi {
|
|
3546
3546
|
if (!n) throw new V("Failed to get asset from cache!");
|
3547
3547
|
return n;
|
3548
3548
|
}
|
3549
|
-
const a = (async () => (await
|
3549
|
+
const a = (async () => (await Be([t]))[0])();
|
3550
3550
|
return this.cache.set(t, a), a;
|
3551
3551
|
}
|
3552
3552
|
/**
|
3553
3553
|
* Retrieves the asset from the server, bypassing cache (but still writing the result to cache)
|
3554
3554
|
*/
|
3555
3555
|
async getFromServer(t) {
|
3556
|
-
const a = (async () => (await
|
3556
|
+
const a = (async () => (await Be([t]))[0])();
|
3557
3557
|
return this.cache.set(t, a), a;
|
3558
3558
|
}
|
3559
3559
|
keyFromURL(t) {
|
@@ -3612,7 +3612,7 @@ class gi {
|
|
3612
3612
|
}, a, n);
|
3613
3613
|
}
|
3614
3614
|
async uploadFile(t, e) {
|
3615
|
-
const n = this.isRaster(t) ?
|
3615
|
+
const n = this.isRaster(t) ? Se.Image : Se.Illustration, i = await this.loadImageAsFileInfo(t);
|
3616
3616
|
return await this.uploadAssetWithProgress(i, n, e, !0);
|
3617
3617
|
}
|
3618
3618
|
async removeBackgroundFromAsset(t) {
|
@@ -3748,7 +3748,7 @@ const Rt = "persistentAssets", lt = class lt {
|
|
3748
3748
|
};
|
3749
3749
|
lt.callbacks = [];
|
3750
3750
|
let At = lt;
|
3751
|
-
const
|
3751
|
+
const Ua = "bgrmPersistentAssets";
|
3752
3752
|
class J {
|
3753
3753
|
static has(t) {
|
3754
3754
|
return J.getMap().has(t);
|
@@ -3775,10 +3775,10 @@ class J {
|
|
3775
3775
|
a && (e.delete(a), J.setMap(e));
|
3776
3776
|
}
|
3777
3777
|
static getMap() {
|
3778
|
-
return k.getMap(
|
3778
|
+
return k.getMap(Ua) || /* @__PURE__ */ new Map();
|
3779
3779
|
}
|
3780
3780
|
static setMap(t) {
|
3781
|
-
k.setMap(
|
3781
|
+
k.setMap(Ua, t);
|
3782
3782
|
}
|
3783
3783
|
}
|
3784
3784
|
const O = new gi();
|
@@ -3850,7 +3850,7 @@ const Kt = new pi(), bn = w`
|
|
3850
3850
|
}
|
3851
3851
|
`, fi = w`
|
3852
3852
|
${ee(!1)}
|
3853
|
-
${
|
3853
|
+
${ya}
|
3854
3854
|
${bn}
|
3855
3855
|
query GetOptions($ids: [String]!) {
|
3856
3856
|
options(ids: $ids) {
|
@@ -3939,7 +3939,7 @@ const H = new Si(), Bn = w`
|
|
3939
3939
|
currencyCode
|
3940
3940
|
}
|
3941
3941
|
}
|
3942
|
-
`,
|
3942
|
+
`, Re = w`
|
3943
3943
|
fragment AdditionalIntegrationProductFields on IntegrationProduct {
|
3944
3944
|
id
|
3945
3945
|
product {
|
@@ -3958,7 +3958,7 @@ const H = new Si(), Bn = w`
|
|
3958
3958
|
}
|
3959
3959
|
}
|
3960
3960
|
`, vi = w`
|
3961
|
-
${
|
3961
|
+
${Re}
|
3962
3962
|
mutation CreateTransactions(
|
3963
3963
|
$inputs: [TransactionCreateInput]!
|
3964
3964
|
$marketplaceThemeInstallId: String
|
@@ -4066,7 +4066,7 @@ const H = new Si(), Bn = w`
|
|
4066
4066
|
url
|
4067
4067
|
}
|
4068
4068
|
`, Ei = w`
|
4069
|
-
${
|
4069
|
+
${Re}
|
4070
4070
|
${In}
|
4071
4071
|
${Pn}
|
4072
4072
|
${Bn}
|
@@ -4351,7 +4351,7 @@ const H = new Si(), Bn = w`
|
|
4351
4351
|
}
|
4352
4352
|
}
|
4353
4353
|
`, Fn = (r) => w`
|
4354
|
-
${
|
4354
|
+
${Re}
|
4355
4355
|
fragment IntegrationProductFields on IntegrationProduct {
|
4356
4356
|
id
|
4357
4357
|
externalProductId
|
@@ -4588,7 +4588,7 @@ const H = new Si(), Bn = w`
|
|
4588
4588
|
}
|
4589
4589
|
`, Oi = (r) => w`
|
4590
4590
|
${ee(r)}
|
4591
|
-
${
|
4591
|
+
${ya}
|
4592
4592
|
${bn}
|
4593
4593
|
${Ti}
|
4594
4594
|
${Ni}
|
@@ -5028,7 +5028,7 @@ const H = new Si(), Bn = w`
|
|
5028
5028
|
}
|
5029
5029
|
}
|
5030
5030
|
}
|
5031
|
-
`,
|
5031
|
+
`, Oe = w`
|
5032
5032
|
fragment MarketplaceThemeInstallConfigurationFields on MarketplaceThemeInstallConfiguration {
|
5033
5033
|
id
|
5034
5034
|
themeInstallId
|
@@ -5108,7 +5108,7 @@ const H = new Si(), Bn = w`
|
|
5108
5108
|
}
|
5109
5109
|
}
|
5110
5110
|
`, Li = w`
|
5111
|
-
${
|
5111
|
+
${Oe}
|
5112
5112
|
query GetMarketplaceThemeInstallConfiguration($themeConfigurationId: String!, $themeInstallId: String!) {
|
5113
5113
|
marketplaceThemeInstallConfiguration(id: $themeConfigurationId, themeInstallId: $themeInstallId, raw: false) {
|
5114
5114
|
...MarketplaceThemeInstallConfigurationFields
|
@@ -5116,7 +5116,7 @@ const H = new Si(), Bn = w`
|
|
5116
5116
|
}
|
5117
5117
|
`, Vi = w`
|
5118
5118
|
${Bn}
|
5119
|
-
${
|
5119
|
+
${Oe}
|
5120
5120
|
query GetCurrentIntegration($themeConfigurationId: String) {
|
5121
5121
|
currentIntegration {
|
5122
5122
|
id
|
@@ -5128,7 +5128,7 @@ const H = new Si(), Bn = w`
|
|
5128
5128
|
}
|
5129
5129
|
}
|
5130
5130
|
`, zi = w`
|
5131
|
-
${
|
5131
|
+
${Oe}
|
5132
5132
|
query ReadTransactionForMarketplaceTheme($id: String!) {
|
5133
5133
|
transactions(ids: [$id]) {
|
5134
5134
|
marketplaceThemeInstallConfiguration(raw: false) {
|
@@ -5137,7 +5137,7 @@ const H = new Si(), Bn = w`
|
|
5137
5137
|
}
|
5138
5138
|
}
|
5139
5139
|
`, Gi = w`
|
5140
|
-
${
|
5140
|
+
${Oe}
|
5141
5141
|
query ReadBundleForMarketplaceTheme($id: String!) {
|
5142
5142
|
bundles(ids: [$id]) {
|
5143
5143
|
marketplaceThemeInstallConfiguration(raw: false) {
|
@@ -5348,7 +5348,7 @@ const M = () => {
|
|
5348
5348
|
...E,
|
5349
5349
|
_renderingConfiguration: a,
|
5350
5350
|
mask: l ? `url(#viewmask-${f})` : void 0
|
5351
|
-
})), C =
|
5351
|
+
})), C = va(I);
|
5352
5352
|
return /* @__PURE__ */ ct(
|
5353
5353
|
"svg",
|
5354
5354
|
{
|
@@ -5527,7 +5527,7 @@ const M = () => {
|
|
5527
5527
|
}
|
5528
5528
|
) });
|
5529
5529
|
}, Tn = (r) => {
|
5530
|
-
const t = `spiff-group-clip-${r.id}`, e = r.rotation || 0, a = ft(e), n = Math.cos(a), i = -Math.sin(a), s =
|
5530
|
+
const t = `spiff-group-clip-${r.id}`, e = r.rotation || 0, a = ft(e), n = Math.cos(a), i = -Math.sin(a), s = va(r.children);
|
5531
5531
|
return /* @__PURE__ */ ct(Gt, { children: [
|
5532
5532
|
/* @__PURE__ */ D("defs", { children: /* @__PURE__ */ D("clipPath", { id: t, preserveAspectRatio: "none", children: r.clipPath ? /* @__PURE__ */ D("path", { d: r.clipPath }) : /* @__PURE__ */ D("rect", { x: 0, y: 0, width: r.width, height: r.height }) }) }),
|
5533
5533
|
/* @__PURE__ */ ct(
|
@@ -5562,8 +5562,8 @@ const M = () => {
|
|
5562
5562
|
if (!r.pattern)
|
5563
5563
|
return "";
|
5564
5564
|
if (r.pattern.svg) {
|
5565
|
-
const A =
|
5566
|
-
return
|
5565
|
+
const A = wa(r.pattern.svg, r.pattern.colors || {}, !1);
|
5566
|
+
return ma(A);
|
5567
5567
|
}
|
5568
5568
|
return r.pattern.src;
|
5569
5569
|
};
|
@@ -5698,38 +5698,38 @@ class Xi {
|
|
5698
5698
|
}), a - n;
|
5699
5699
|
}
|
5700
5700
|
}
|
5701
|
-
const Zi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:",
|
5702
|
-
if (
|
5703
|
-
return
|
5701
|
+
const Zi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ge = /* @__PURE__ */ new Map(), Nt = async (r) => {
|
5702
|
+
if (Ge.has(r))
|
5703
|
+
return Ge.get(r);
|
5704
5704
|
const e = (async () => {
|
5705
5705
|
try {
|
5706
5706
|
return Ct(r).getFont();
|
5707
5707
|
} catch {
|
5708
5708
|
if (Zi(r)) {
|
5709
|
-
const a = pn(r), n =
|
5710
|
-
return
|
5709
|
+
const a = pn(r), n = ea(a);
|
5710
|
+
return oa(r, n), n;
|
5711
5711
|
} else {
|
5712
|
-
const a = await
|
5713
|
-
return
|
5712
|
+
const a = await Te(r, !0), n = ea(a);
|
5713
|
+
return oa(r, n), await Rr(n, r), n;
|
5714
5714
|
}
|
5715
5715
|
}
|
5716
5716
|
})();
|
5717
|
-
return
|
5717
|
+
return Ge.set(r, e), e;
|
5718
5718
|
}, ts = (r) => {
|
5719
|
-
const t = pn(r), e =
|
5720
|
-
return
|
5719
|
+
const t = pn(r), e = ea(t);
|
5720
|
+
return oa(r, e), e;
|
5721
5721
|
}, Ct = (r) => {
|
5722
5722
|
const t = Nn.get(r);
|
5723
5723
|
if (t)
|
5724
5724
|
return t;
|
5725
5725
|
throw new Error("Font metrics unavailable for font");
|
5726
|
-
},
|
5726
|
+
}, oa = (r, t) => {
|
5727
5727
|
const e = new Xi(t);
|
5728
5728
|
return Nn.set(r, e), e;
|
5729
5729
|
}, Zc = async (r) => {
|
5730
5730
|
const t = dt(), e = t.parseFromString(r, "image/svg+xml"), a = e.firstElementChild, n = /* @__PURE__ */ new Map();
|
5731
5731
|
a.querySelectorAll("style").forEach((d) => {
|
5732
|
-
|
5732
|
+
ln(d.innerHTML).stylesheet?.rules.forEach((u) => {
|
5733
5733
|
if (u.type === "font-face" && u.declarations) {
|
5734
5734
|
const h = u.declarations.find(
|
5735
5735
|
(p) => p.property === "font-family"
|
@@ -5760,8 +5760,8 @@ const Zi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5760
5760
|
h.appendChild(Q);
|
5761
5761
|
}
|
5762
5762
|
return e.querySelectorAll("text").forEach((d) => d.remove()), It().serializeToString(a);
|
5763
|
-
},
|
5764
|
-
`), e, a), t),
|
5763
|
+
}, Ie = (r, t, e, a) => Math.max(rs(r.join(`
|
5764
|
+
`), e, a), t), La = (r, t, e, a, n, i) => {
|
5765
5765
|
const s = (i || On) * n.getApproximateHeight(), o = t.split(`
|
5766
5766
|
`);
|
5767
5767
|
try {
|
@@ -5770,7 +5770,7 @@ const Zi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5770
5770
|
lines: c,
|
5771
5771
|
requiredHeight: l.flatMap((d) => d.lines).length * (a * s),
|
5772
5772
|
fontSize: e,
|
5773
|
-
requiredWidth:
|
5773
|
+
requiredWidth: Ie(c, r.width, a, n)
|
5774
5774
|
};
|
5775
5775
|
} catch {
|
5776
5776
|
const c = t.split("");
|
@@ -5778,7 +5778,7 @@ const Zi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5778
5778
|
lines: c,
|
5779
5779
|
requiredHeight: c.length * (a * s),
|
5780
5780
|
fontSize: e,
|
5781
|
-
requiredWidth:
|
5781
|
+
requiredWidth: Ie(c, r.width, a, n)
|
5782
5782
|
};
|
5783
5783
|
}
|
5784
5784
|
}, ge = (r, t, e, a) => {
|
@@ -5818,7 +5818,7 @@ const Zi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5818
5818
|
}, as = (r, t, e, a) => {
|
5819
5819
|
const n = Ct(t.fontData.assetUrl), i = n.getFont(), s = t.fontSize / i.unitsPerEm;
|
5820
5820
|
if (!e)
|
5821
|
-
return
|
5821
|
+
return La(t, r, t.fontSize, s, n, a);
|
5822
5822
|
let o;
|
5823
5823
|
if (t.text ? o = t.text.split(`
|
5824
5824
|
`) : o = t.input?.split(`
|
@@ -5826,22 +5826,22 @@ const Zi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5826
5826
|
return {
|
5827
5827
|
lines: o,
|
5828
5828
|
requiredHeight: t.height,
|
5829
|
-
requiredWidth:
|
5829
|
+
requiredWidth: Ie(o, t.width, s, n),
|
5830
5830
|
fontSize: t.fontSize
|
5831
5831
|
};
|
5832
5832
|
const l = t.width !== e.width != (t.height !== e.height);
|
5833
5833
|
return t.lineHeight === e.lineHeight && !l && e.input === r ? {
|
5834
5834
|
lines: o,
|
5835
5835
|
requiredHeight: t.height,
|
5836
|
-
requiredWidth:
|
5836
|
+
requiredWidth: Ie(o, t.width, s, n),
|
5837
5837
|
fontSize: es(o, n, i, t.width, t.height, a)
|
5838
|
-
} :
|
5838
|
+
} : La(t, r, t.fontSize, s, n, a);
|
5839
5839
|
}, ns = (r, t, e, a, n) => {
|
5840
5840
|
const s = Ct(t.assetUrl).getFont();
|
5841
5841
|
let o = { ...r };
|
5842
5842
|
const l = { ...r }, c = Qn(a, e / s.unitsPerEm, Ct(t.assetUrl));
|
5843
5843
|
return c && c < o.width && (l.width = c, n === "left" ? (l.left += Math.sin(o.rotation * Math.PI / 360) * (o.width - c), l.top += Math.sin(o.rotation * Math.PI / 180) * (c - o.width) / 2) : n === "right" ? l.left += o.width - c : l.left += (o.width - c) / 2, a && is(a, a).every(([d, A]) => d === A) && (o = l)), o;
|
5844
|
-
},
|
5844
|
+
}, We = 1, mt = (r, t, e) => {
|
5845
5845
|
let a = 0;
|
5846
5846
|
const n = e.getGlyphs(r);
|
5847
5847
|
return n.forEach((i, s) => {
|
@@ -5864,12 +5864,12 @@ const Zi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", ze = /* @_
|
|
5864
5864
|
return r.forEach((n) => {
|
5865
5865
|
a = Math.max(a, mt(n, t, e));
|
5866
5866
|
}), a;
|
5867
|
-
},
|
5867
|
+
}, Va = {
|
5868
5868
|
stripControlCharacters: !0,
|
5869
5869
|
vertical: !1,
|
5870
5870
|
uppercase: !1
|
5871
|
-
},
|
5872
|
-
const e = { ...
|
5871
|
+
}, Pe = (r, t = Va) => {
|
5872
|
+
const e = { ...Va, ...t };
|
5873
5873
|
let a = r || "";
|
5874
5874
|
return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
|
5875
5875
|
`)), a;
|
@@ -6045,7 +6045,7 @@ const os = (r) => {
|
|
6045
6045
|
{
|
6046
6046
|
transform: i,
|
6047
6047
|
dangerouslySetInnerHTML: {
|
6048
|
-
__html:
|
6048
|
+
__html: Ca(
|
6049
6049
|
r.svg,
|
6050
6050
|
r.width,
|
6051
6051
|
r.height,
|
@@ -6121,7 +6121,7 @@ class As {
|
|
6121
6121
|
layout: t,
|
6122
6122
|
elements: e
|
6123
6123
|
},
|
6124
|
-
getComponentWithProps: (a) =>
|
6124
|
+
getComponentWithProps: (a) => Sa(t, e, a)
|
6125
6125
|
};
|
6126
6126
|
}
|
6127
6127
|
initialize(t, e) {
|
@@ -6146,7 +6146,7 @@ class As {
|
|
6146
6146
|
return { ...t, transaction: e.apply(a) };
|
6147
6147
|
}
|
6148
6148
|
}
|
6149
|
-
const Un = (r) => r.type === x.Image ? /* @__PURE__ */ D(Mn, { ...r }, r.id) : r.type === x.Frame ? /* @__PURE__ */ D(_i, { ...r }, r.id) : r.type === x.Illustration ? /* @__PURE__ */ D(ds, { ...r }, r.id) : r.type === x.Textbox ? /* @__PURE__ */ D(os, { ...r }, r.id) : r.type === x.Group ? /* @__PURE__ */ D(Tn, { ...r }, r.id) : null,
|
6149
|
+
const Un = (r) => r.type === x.Image ? /* @__PURE__ */ D(Mn, { ...r }, r.id) : r.type === x.Frame ? /* @__PURE__ */ D(_i, { ...r }, r.id) : r.type === x.Illustration ? /* @__PURE__ */ D(ds, { ...r }, r.id) : r.type === x.Textbox ? /* @__PURE__ */ D(os, { ...r }, r.id) : r.type === x.Group ? /* @__PURE__ */ D(Tn, { ...r }, r.id) : null, Sa = (r, t, e) => {
|
6150
6150
|
const a = e.renderingConfiguration, n = a?.removeExcludedElements ? t.filter((i) => !i.excludeFromExport) : t;
|
6151
6151
|
return /* @__PURE__ */ D(
|
6152
6152
|
Ki,
|
@@ -6177,7 +6177,7 @@ const Un = (r) => r.type === x.Image ? /* @__PURE__ */ D(Mn, { ...r }, r.id) : r
|
|
6177
6177
|
}
|
6178
6178
|
);
|
6179
6179
|
};
|
6180
|
-
function
|
6180
|
+
function va(r) {
|
6181
6181
|
return r.sort((t, e) => {
|
6182
6182
|
const a = t.layer || 0, n = e.layer || 0;
|
6183
6183
|
if (a < n) return -1;
|
@@ -6194,13 +6194,13 @@ const ne = (r) => {
|
|
6194
6194
|
if (r.defaultVariant !== void 0)
|
6195
6195
|
return t.find((e) => e.id === r.defaultVariant);
|
6196
6196
|
}
|
6197
|
-
}, ut = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(),
|
6197
|
+
}, ut = /* @__PURE__ */ new Map(), Vt = /* @__PURE__ */ new Map(), qe = /* @__PURE__ */ new Map(), Ln = async (r, t) => {
|
6198
6198
|
if (!t) {
|
6199
6199
|
if (!r) throw new Error("No region or src supplied. Cannot construct frame!");
|
6200
|
-
return
|
6200
|
+
return la(r);
|
6201
6201
|
}
|
6202
6202
|
return nt(t);
|
6203
|
-
},
|
6203
|
+
}, la = (r) => {
|
6204
6204
|
const t = r.width, e = r.height;
|
6205
6205
|
return `<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${t} ${e}'>
|
6206
6206
|
<path id="target-path" d='M0 0 h ${t} v ${e} h ${-t} Z' />
|
@@ -6215,9 +6215,9 @@ const ne = (r) => {
|
|
6215
6215
|
if (!e.asset)
|
6216
6216
|
throw new Error(`No asset for variant with ID: ${r.frameVariantId}`);
|
6217
6217
|
return e;
|
6218
|
-
},
|
6219
|
-
if (
|
6220
|
-
return
|
6218
|
+
}, $e = async (r) => {
|
6219
|
+
if (qe.has(r))
|
6220
|
+
return qe.get(r);
|
6221
6221
|
const e = (async () => {
|
6222
6222
|
if (Vt.has(r))
|
6223
6223
|
return Vt.get(r);
|
@@ -6253,8 +6253,8 @@ const ne = (r) => {
|
|
6253
6253
|
}
|
6254
6254
|
throw new Error("Malformed frame SVG");
|
6255
6255
|
})();
|
6256
|
-
return
|
6257
|
-
},
|
6256
|
+
return qe.set(r, e), e;
|
6257
|
+
}, Ea = (r, t, e, a) => {
|
6258
6258
|
const n = t.width / t.height, i = r.width / r.height;
|
6259
6259
|
let s;
|
6260
6260
|
a ? i > n ? s = t.height / r.height : s = t.width / r.width : i > n ? s = t.width / r.width : s = t.height / r.height, e?.scale !== void 0 && (s *= e?.scale);
|
@@ -6264,7 +6264,7 @@ const ne = (r) => {
|
|
6264
6264
|
y: u,
|
6265
6265
|
zoom: s
|
6266
6266
|
};
|
6267
|
-
},
|
6267
|
+
}, ca = async (r) => {
|
6268
6268
|
if (ut.has(r))
|
6269
6269
|
return ut.get(r);
|
6270
6270
|
if (r.startsWith("data:image/svg+xml")) {
|
@@ -6277,7 +6277,7 @@ const ne = (r) => {
|
|
6277
6277
|
return ut.set(r, i), i;
|
6278
6278
|
}
|
6279
6279
|
if ((r.split(".").pop()?.toLowerCase() ?? "") === "svg") {
|
6280
|
-
const e = await
|
6280
|
+
const e = await ba(r), a = e.width, n = e.height, i = {
|
6281
6281
|
src: r,
|
6282
6282
|
width: a,
|
6283
6283
|
height: n,
|
@@ -6285,7 +6285,7 @@ const ne = (r) => {
|
|
6285
6285
|
};
|
6286
6286
|
return ut.set(r, i), i;
|
6287
6287
|
} else {
|
6288
|
-
const e = await
|
6288
|
+
const e = await Te(r, !0), a = await Qe(e), n = {
|
6289
6289
|
src: r,
|
6290
6290
|
width: a.width,
|
6291
6291
|
height: a.height,
|
@@ -6293,14 +6293,14 @@ const ne = (r) => {
|
|
6293
6293
|
};
|
6294
6294
|
return ut.set(r, n), n;
|
6295
6295
|
}
|
6296
|
-
},
|
6296
|
+
}, ba = async (r) => {
|
6297
6297
|
const t = await nt(r);
|
6298
6298
|
return Vn(t);
|
6299
|
-
},
|
6299
|
+
}, za = (r) => r.endsWith("mm") ? Number(r.replace("mm", "")) * 3.7795275591 : r.endsWith("px") ? Number(r.replace("px", "")) : Number(r), Vn = (r) => {
|
6300
6300
|
const a = dt().parseFromString(r, "image/svg+xml").querySelector("svg");
|
6301
6301
|
if (!a)
|
6302
6302
|
throw new Error("No svg tag found, this svg must be malformed!");
|
6303
|
-
const n = a.getAttribute("viewBox"), i = a.getAttribute("width"), s = a.getAttribute("height"), o = s && i ? [0, 0,
|
6303
|
+
const n = a.getAttribute("viewBox"), i = a.getAttribute("width"), s = a.getAttribute("height"), o = s && i ? [0, 0, za(i), za(s)] : n?.split(" ").map((l) => Number(l));
|
6304
6304
|
if (!o)
|
6305
6305
|
throw new Error("No viewbox or width/height values detected on SVG file!");
|
6306
6306
|
return {
|
@@ -6314,9 +6314,9 @@ const ne = (r) => {
|
|
6314
6314
|
nt(r).then((e) => {
|
6315
6315
|
t(e);
|
6316
6316
|
}).catch((e) => console.error(e));
|
6317
|
-
}),
|
6318
|
-
if (
|
6319
|
-
return
|
6317
|
+
}), je = /* @__PURE__ */ new Map(), _t = async (r) => {
|
6318
|
+
if (je.has(r))
|
6319
|
+
return je.get(r);
|
6320
6320
|
const t = async (n) => new Promise((i, s) => {
|
6321
6321
|
try {
|
6322
6322
|
if (!(!!URL && !!URL.createObjectURL)) throw new Error("Environment incapable of generating ObjectURL");
|
@@ -6332,12 +6332,12 @@ const ne = (r) => {
|
|
6332
6332
|
const s = dt().parseFromString(r, "image/svg+xml").firstElementChild;
|
6333
6333
|
if (!s)
|
6334
6334
|
throw new Error("Failed to read SVG");
|
6335
|
-
const l = It().serializeToString(s), c = pt(), d = c.getContext("2d"), A = await
|
6335
|
+
const l = It().serializeToString(s), c = pt(), d = c.getContext("2d"), A = await ua.from(d, l, {
|
6336
6336
|
anonymousCrossOrigin: !0,
|
6337
6337
|
ignoreDimensions: !1,
|
6338
6338
|
createCanvas: pt,
|
6339
6339
|
createImage: te,
|
6340
|
-
DOMParser:
|
6340
|
+
DOMParser: pa(),
|
6341
6341
|
fetch: rt
|
6342
6342
|
}), u = s.getAttribute("width"), h = s.getAttribute("height"), m = 2048;
|
6343
6343
|
if (h && u) {
|
@@ -6347,7 +6347,7 @@ const ne = (r) => {
|
|
6347
6347
|
A.resize(m, m);
|
6348
6348
|
return await A.render(), await t(c);
|
6349
6349
|
})();
|
6350
|
-
return
|
6350
|
+
return je.set(r, a), a;
|
6351
6351
|
}, Ut = async (r, t, e, a) => {
|
6352
6352
|
const n = r.layoutState.layout.useEditableArea && r.layoutState.layout.editableArea || {
|
6353
6353
|
width: r.layoutState.layout.width,
|
@@ -6369,7 +6369,7 @@ const ne = (r) => {
|
|
6369
6369
|
o.height = o.width / f, o.top += (h - o.height) / 2;
|
6370
6370
|
}
|
6371
6371
|
if (e && t === x.Image) {
|
6372
|
-
const l = o.height, c = await
|
6372
|
+
const l = o.height, c = await Te(e), d = await Qe(c), A = d.width / d.height;
|
6373
6373
|
o.height = o.width / A, o.top += (l - o.height) / 2;
|
6374
6374
|
}
|
6375
6375
|
if (e && t === x.Textbox && a?.text && a?.fontScale) {
|
@@ -6381,7 +6381,7 @@ const ne = (r) => {
|
|
6381
6381
|
};
|
6382
6382
|
class td {
|
6383
6383
|
static async getFrame(t, e) {
|
6384
|
-
const a = await Ln(e.region, e.src), n = await
|
6384
|
+
const a = await Ln(e.region, e.src), n = await $e(a), i = e.region || await Ut(t, x.Frame);
|
6385
6385
|
return {
|
6386
6386
|
id: M(),
|
6387
6387
|
x: i.left,
|
@@ -6427,7 +6427,7 @@ class td {
|
|
6427
6427
|
const { configuration: a, fontSrc: n, designInputStep: i } = e, s = await Nt(n), o = {
|
6428
6428
|
assetUrl: n,
|
6429
6429
|
name: s.names.fullName.en
|
6430
|
-
}, l = i?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d =
|
6430
|
+
}, l = i?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = Pe(c, {
|
6431
6431
|
vertical: a.vertical,
|
6432
6432
|
uppercase: a.uppercase
|
6433
6433
|
}), A = e.region || await Ut(t, x.Textbox, n, {
|
@@ -6545,13 +6545,13 @@ const $ = (r, t) => _(r, t).elements.find((n) => n.id === r), _ = (r, t) => {
|
|
6545
6545
|
throw new L();
|
6546
6546
|
return e;
|
6547
6547
|
}, X = (r, t) => {
|
6548
|
-
const e = [...t.elements.filter((n) => n.id !== r.id), r], a =
|
6548
|
+
const e = [...t.elements.filter((n) => n.id !== r.id), r], a = va(e);
|
6549
6549
|
return {
|
6550
6550
|
layout: t.layout,
|
6551
6551
|
elements: a,
|
6552
6552
|
modificationID: M()
|
6553
6553
|
};
|
6554
|
-
},
|
6554
|
+
}, Ga = async (r) => {
|
6555
6555
|
const t = [...Object.keys(r.layouts)], e = [...new Set(t)];
|
6556
6556
|
for (let a = 0; a < e.length; a++) {
|
6557
6557
|
const n = e[a], i = r.layouts[n];
|
@@ -6561,7 +6561,7 @@ const $ = (r, t) => _(r, t).elements.find((n) => n.id === r), _ = (r, t) => {
|
|
6561
6561
|
const o = s;
|
6562
6562
|
if (o.src && !o.svg) {
|
6563
6563
|
const l = await nt(o.src), c = await ot(l);
|
6564
|
-
o.svg =
|
6564
|
+
o.svg = Ca(
|
6565
6565
|
c.svg,
|
6566
6566
|
o.width,
|
6567
6567
|
o.height,
|
@@ -6611,7 +6611,7 @@ class N {
|
|
6611
6611
|
this.oldState = t;
|
6612
6612
|
}
|
6613
6613
|
}
|
6614
|
-
class
|
6614
|
+
class Wa extends N {
|
6615
6615
|
constructor(t) {
|
6616
6616
|
super(), this.serializableWorkflow = t;
|
6617
6617
|
}
|
@@ -6829,7 +6829,7 @@ class hs extends N {
|
|
6829
6829
|
};
|
6830
6830
|
}
|
6831
6831
|
}
|
6832
|
-
class
|
6832
|
+
class He extends N {
|
6833
6833
|
constructor(t, e) {
|
6834
6834
|
super(), this.id = t, this.imageFill = e;
|
6835
6835
|
}
|
@@ -6873,7 +6873,7 @@ class ms extends N {
|
|
6873
6873
|
};
|
6874
6874
|
}
|
6875
6875
|
}
|
6876
|
-
class
|
6876
|
+
class qa extends N {
|
6877
6877
|
constructor(t, e) {
|
6878
6878
|
super(), this.id = t, this.fontData = e;
|
6879
6879
|
}
|
@@ -7019,7 +7019,7 @@ class Cs extends N {
|
|
7019
7019
|
};
|
7020
7020
|
}
|
7021
7021
|
}
|
7022
|
-
class
|
7022
|
+
class Ye extends N {
|
7023
7023
|
constructor(t, e, a) {
|
7024
7024
|
super(), this.id = t, this.strokeColor = e, this.strokeThickness = a;
|
7025
7025
|
}
|
@@ -7042,7 +7042,7 @@ class He extends N {
|
|
7042
7042
|
};
|
7043
7043
|
}
|
7044
7044
|
}
|
7045
|
-
class
|
7045
|
+
class da extends N {
|
7046
7046
|
constructor(t, e, a) {
|
7047
7047
|
super(), this.id = t, this.className = e, this.fill = a;
|
7048
7048
|
}
|
@@ -7211,7 +7211,7 @@ class ld extends N {
|
|
7211
7211
|
};
|
7212
7212
|
}
|
7213
7213
|
}
|
7214
|
-
class
|
7214
|
+
class ja {
|
7215
7215
|
constructor(t, e, a) {
|
7216
7216
|
this.processRegion = async (n) => {
|
7217
7217
|
const i = this.layouts.find((l) => l.panelId === n.panelId);
|
@@ -7221,7 +7221,7 @@ class qa {
|
|
7221
7221
|
if (this.configuration.type === v.ProductOverlay) {
|
7222
7222
|
let l = "";
|
7223
7223
|
if (this.product?.overlayImageUrl && (l = this.product.overlayImageUrl), s = l, !l)
|
7224
|
-
throw new
|
7224
|
+
throw new be(this.configuration, "Couldn't find an asset for product overlay step");
|
7225
7225
|
}
|
7226
7226
|
const o = this.evaluateAssetType();
|
7227
7227
|
if (o === x.Image) {
|
@@ -7292,7 +7292,7 @@ class qa {
|
|
7292
7292
|
}
|
7293
7293
|
async trigger() {
|
7294
7294
|
if (!this.configuration.data.regions)
|
7295
|
-
throw new
|
7295
|
+
throw new be(this.configuration, "Missing regions.");
|
7296
7296
|
if (this.configuration.type === v.SilentIllustration) {
|
7297
7297
|
const t = this.configuration.data.regions.map(this.processRegion);
|
7298
7298
|
return Promise.all(t);
|
@@ -7320,7 +7320,7 @@ const ys = async (r) => {
|
|
7320
7320
|
}
|
7321
7321
|
})).json()).shortUrl;
|
7322
7322
|
} catch (e) {
|
7323
|
-
throw console.error(e), new
|
7323
|
+
throw console.error(e), new Me("Failed to shorten URL, see console.");
|
7324
7324
|
}
|
7325
7325
|
};
|
7326
7326
|
class Wn {
|
@@ -7365,7 +7365,7 @@ class Ss {
|
|
7365
7365
|
}
|
7366
7366
|
async regenerateQRCode(t, e, a, n) {
|
7367
7367
|
const i = async () => {
|
7368
|
-
const h = (await
|
7368
|
+
const h = (await Be([e]))[0], m = h?.versions?.find((g) => g.name === "mpeg4")?.link;
|
7369
7369
|
return { asset: h, link: m };
|
7370
7370
|
}, s = await new Promise((h, m) => {
|
7371
7371
|
new Wn(
|
@@ -7391,10 +7391,10 @@ class Ss {
|
|
7391
7391
|
l.searchParams.append("video", btoa(JSON.stringify([s]))), l.pathname = l.pathname + (l.pathname.slice(-1) === "/" ? "" : "/");
|
7392
7392
|
const c = l.toString();
|
7393
7393
|
if (c.length >= 2e3)
|
7394
|
-
throw new
|
7394
|
+
throw new Me("Cannot create QR code, URL too long.");
|
7395
7395
|
const d = await ys(c);
|
7396
7396
|
if (!n.data || !n.data.regions)
|
7397
|
-
throw new
|
7397
|
+
throw new be(n, "Missing regions.");
|
7398
7398
|
const A = await this.regionElements(n), u = await this.command(d, A, a, n.stepName);
|
7399
7399
|
return u && (u.command && a.getCommandDispatcher()(u.command), u.followup && await u.followup()), await a.setSelectionsAndElements(n.stepName, [], A, async () => {
|
7400
7400
|
a.updateStorage(n.stepName, {
|
@@ -7408,7 +7408,7 @@ class Ss {
|
|
7408
7408
|
return t.data.regions.map(e);
|
7409
7409
|
}
|
7410
7410
|
async command(t, e, a, n) {
|
7411
|
-
const i = a.getLayouts(), o = `data:image/svg+xml;base64,${btoa(await
|
7411
|
+
const i = a.getLayouts(), o = `data:image/svg+xml;base64,${btoa(await cn(t, { type: "svg" }))}`, l = e.map((c) => {
|
7412
7412
|
const d = c.region, A = i.find((u) => u.panelId === d?.panelId);
|
7413
7413
|
if (!A && d)
|
7414
7414
|
throw new Y(d);
|
@@ -7437,11 +7437,11 @@ class Ss {
|
|
7437
7437
|
}
|
7438
7438
|
}
|
7439
7439
|
const qn = new Ss();
|
7440
|
-
class
|
7440
|
+
class De {
|
7441
7441
|
constructor() {
|
7442
7442
|
this.frameSourceSvg = async (t, e) => {
|
7443
7443
|
if (!t)
|
7444
|
-
return
|
7444
|
+
return la(e);
|
7445
7445
|
const a = t.asset;
|
7446
7446
|
if (!a)
|
7447
7447
|
throw new bt(t);
|
@@ -7490,7 +7490,7 @@ class Pe {
|
|
7490
7490
|
a.serializableWorkflow.steps
|
7491
7491
|
), l = Object.values(a.layouts).map((c) => c.elements).flat().filter((c) => c.stepName === t.stepName).map((c) => ({ id: c.id, region: c.stepRegion }));
|
7492
7492
|
if (!t.option || (t.option.variants || []).length === 0) {
|
7493
|
-
const c = t.data.regions.map((d) =>
|
7493
|
+
const c = t.data.regions.map((d) => la(d));
|
7494
7494
|
e.updateStorage(t.stepName, {
|
7495
7495
|
currentFrameSources: c
|
7496
7496
|
});
|
@@ -7544,7 +7544,7 @@ class Pe {
|
|
7544
7544
|
})) ?? [];
|
7545
7545
|
}
|
7546
7546
|
selectImage(t, e, a, n = !0) {
|
7547
|
-
const i =
|
7547
|
+
const i = De.patternSource(e), s = a.getStepStorage(t.stepName)?.framePatternSrc;
|
7548
7548
|
if (s && s === i)
|
7549
7549
|
return Promise.resolve();
|
7550
7550
|
a.setEditedStatus(t.stepName, !0);
|
@@ -7564,7 +7564,7 @@ class Pe {
|
|
7564
7564
|
});
|
7565
7565
|
},
|
7566
7566
|
() => {
|
7567
|
-
throw new
|
7567
|
+
throw new Me("Failed to resolve transcoded PDF");
|
7568
7568
|
}
|
7569
7569
|
)
|
7570
7570
|
);
|
@@ -7608,7 +7608,7 @@ class Pe {
|
|
7608
7608
|
}
|
7609
7609
|
async loadPatternFromString(t, e, a = !0, n = void 0, i) {
|
7610
7610
|
if (t.endsWith("svg")) {
|
7611
|
-
const s = await
|
7611
|
+
const s = await ba(t), o = s.width, l = s.height, c = await nt(t);
|
7612
7612
|
if (i) {
|
7613
7613
|
const u = c.match(/<(image|linearGradient|radialGradient)(\s|>|\/>)/gim);
|
7614
7614
|
if (u && u.length > 0)
|
@@ -7626,7 +7626,7 @@ class Pe {
|
|
7626
7626
|
};
|
7627
7627
|
ut.set(t, A), e.setPatternData(A, a);
|
7628
7628
|
} else {
|
7629
|
-
const s = await
|
7629
|
+
const s = await Te(t, !0), o = await Qe(s), l = {
|
7630
7630
|
src: t,
|
7631
7631
|
width: o.width,
|
7632
7632
|
height: o.height,
|
@@ -7711,7 +7711,7 @@ class Pe {
|
|
7711
7711
|
i && i(!0);
|
7712
7712
|
const c = t.data.initialZoomLevel, d = await Promise.all(
|
7713
7713
|
t.data.regions.map(async (h, m) => {
|
7714
|
-
const g = await
|
7714
|
+
const g = await $e(l[m]), p = o.getImageData(), f = a.map((P) => new Bt(P.id)), S = p ? Ea(
|
7715
7715
|
p,
|
7716
7716
|
g,
|
7717
7717
|
c && !t.data.forceImageCover ? { scale: c } : void 0,
|
@@ -7775,7 +7775,7 @@ class Pe {
|
|
7775
7775
|
throw new Yt(t);
|
7776
7776
|
}
|
7777
7777
|
async loadPatternFromAsset(t, e, a, n) {
|
7778
|
-
const i =
|
7778
|
+
const i = De.patternSource(t), s = a.markUpdatePending(), o = a.getWorkflowExperience().getStepById(e.stepName)?.frameService;
|
7779
7779
|
if (!o)
|
7780
7780
|
throw a.markUpdateCompleted(s), new Error("Frame service unavailable, cannot load pattern!");
|
7781
7781
|
try {
|
@@ -7802,7 +7802,7 @@ class Pe {
|
|
7802
7802
|
), this.validateColorCount(e, a);
|
7803
7803
|
}
|
7804
7804
|
}
|
7805
|
-
const St = new
|
7805
|
+
const St = new De();
|
7806
7806
|
class vs {
|
7807
7807
|
async getIllustrationBody(t) {
|
7808
7808
|
return new Promise((e) => {
|
@@ -7907,10 +7907,10 @@ class vs {
|
|
7907
7907
|
spotColor: A.spotColor,
|
7908
7908
|
pmsValue: A.pmsValue
|
7909
7909
|
};
|
7910
|
-
const o =
|
7910
|
+
const o = Ca(t, e, a, s), l = await _t(o), c = [];
|
7911
7911
|
for (const d of n) {
|
7912
7912
|
for (const [A, u] of i.entries())
|
7913
|
-
c.push(new
|
7913
|
+
c.push(new da(d, A, u));
|
7914
7914
|
c.push(new ws(d, o, l));
|
7915
7915
|
}
|
7916
7916
|
return new R(c);
|
@@ -7957,7 +7957,7 @@ class vs {
|
|
7957
7957
|
}
|
7958
7958
|
async selectVariantCommand(t, e, a, n, i) {
|
7959
7959
|
if (!t.data || !t.data.regions)
|
7960
|
-
throw new
|
7960
|
+
throw new be(t, "Missing regions.");
|
7961
7961
|
n(!0);
|
7962
7962
|
const s = a.map((f) => new Bt(f.id));
|
7963
7963
|
t.mandatory && i.setMandatoryFulfilled(t.stepName, !1);
|
@@ -8040,7 +8040,7 @@ class Es {
|
|
8040
8040
|
async init(t, e, a) {
|
8041
8041
|
const n = t.option;
|
8042
8042
|
if (!n)
|
8043
|
-
throw new
|
8043
|
+
throw new Ee(t);
|
8044
8044
|
if (a)
|
8045
8045
|
await this.reload(t, e, a);
|
8046
8046
|
else {
|
@@ -8056,7 +8056,7 @@ class Es {
|
|
8056
8056
|
t.stepName,
|
8057
8057
|
a.serializableWorkflow.steps
|
8058
8058
|
), o = Object.values(a.layouts).map((c) => c.elements).flat().filter((c) => c.stepName === t.stepName), l = t.option;
|
8059
|
-
if (!l) throw new
|
8059
|
+
if (!l) throw new Ee(t);
|
8060
8060
|
if (n?.selectedVariants) {
|
8061
8061
|
const c = n.selectedVariants[0].id;
|
8062
8062
|
if (c) {
|
@@ -8115,7 +8115,7 @@ const jn = new Es();
|
|
8115
8115
|
class bs {
|
8116
8116
|
async init(t, e, a) {
|
8117
8117
|
const n = t.option;
|
8118
|
-
if (!n) throw new
|
8118
|
+
if (!n) throw new Ee(t);
|
8119
8119
|
if (a)
|
8120
8120
|
await this.reload(t, e, a);
|
8121
8121
|
else {
|
@@ -8293,7 +8293,7 @@ class Bs {
|
|
8293
8293
|
}
|
8294
8294
|
if (!/^$|^[a-zA-Z0-9 ]+$/.test(e))
|
8295
8295
|
return n("Unsupported characters."), { input: e, helperData: {}, errorData: { unsupportedCharacters: !0 } };
|
8296
|
-
const i =
|
8296
|
+
const i = aa(e.toLowerCase());
|
8297
8297
|
for (const s of i)
|
8298
8298
|
for (const o in a) {
|
8299
8299
|
const l = a[o].toLowerCase().replace(/\s/g, "");
|
@@ -8467,14 +8467,14 @@ class Ds {
|
|
8467
8467
|
const n = a.getLayouts(), s = (a.getRegionElements(e.stepName) || []).map((o) => {
|
8468
8468
|
const l = o.region;
|
8469
8469
|
if (!n.find((d) => d.panelId === l?.panelId)) throw new Y(l);
|
8470
|
-
return new
|
8470
|
+
return new da(o.id, this.shapeFillId, t);
|
8471
8471
|
}).filter((o) => !!o);
|
8472
8472
|
a.getCommandDispatcher()(new R(s)), a.updateStorage(e.stepName, { colour: t });
|
8473
8473
|
}
|
8474
8474
|
async init(t, e, a) {
|
8475
8475
|
const n = t.option;
|
8476
8476
|
if (!n)
|
8477
|
-
throw new
|
8477
|
+
throw new Ee(t);
|
8478
8478
|
if (a)
|
8479
8479
|
await this.reload(t, e, a);
|
8480
8480
|
else {
|
@@ -8533,7 +8533,7 @@ class Ds {
|
|
8533
8533
|
if (!i.find((m) => m.panelId === A?.panelId))
|
8534
8534
|
throw new Y(A);
|
8535
8535
|
const h = o();
|
8536
|
-
return new
|
8536
|
+
return new da(d.id, this.shapeFillId, h);
|
8537
8537
|
}, c = a.map(l).filter((d) => !!d);
|
8538
8538
|
return {
|
8539
8539
|
command: new R(c),
|
@@ -8640,7 +8640,7 @@ class Fs {
|
|
8640
8640
|
);
|
8641
8641
|
}
|
8642
8642
|
}
|
8643
|
-
const xs = new Fs(),
|
8643
|
+
const xs = new Fs(), Je = (r, t, e, a, n) => {
|
8644
8644
|
if (t.some((d) => d == null))
|
8645
8645
|
throw new Error(`Failed to autosize lines: ${t.join(", ")}`);
|
8646
8646
|
let i = t.map((d) => d.split(`
|
@@ -8672,29 +8672,29 @@ const xs = new Fs(), Ye = (r, t, e, a, n) => {
|
|
8672
8672
|
const o = Ct(t.assetUrl), l = o.getFont();
|
8673
8673
|
if (n.size) {
|
8674
8674
|
const u = r / l.unitsPerEm;
|
8675
|
-
return [i, s] =
|
8675
|
+
return [i, s] = Je(e, a, r, u, o), [n.size, i, s];
|
8676
8676
|
}
|
8677
8677
|
const c = 6;
|
8678
|
-
let d = c -
|
8678
|
+
let d = c - We;
|
8679
8679
|
if (a.length > 0) {
|
8680
8680
|
let u = a, h = 0;
|
8681
8681
|
for (; (!n.maxSize || d <= n.maxSize) && u; )
|
8682
|
-
d +=
|
8682
|
+
d += We, h = d / l.unitsPerEm, [u, s] = Je(e, a, d, h, o);
|
8683
8683
|
}
|
8684
|
-
d > c && (d -=
|
8684
|
+
d > c && (d -= We), n.minSize && d < n.minSize && (d = n.minSize);
|
8685
8685
|
const A = d / l.unitsPerEm;
|
8686
|
-
return [i, s] =
|
8687
|
-
},
|
8688
|
-
class
|
8686
|
+
return [i, s] = Je(e, a, d, A, o), [d, i, s];
|
8687
|
+
}, Ke = 30;
|
8688
|
+
class Fe extends Error {
|
8689
8689
|
constructor(t) {
|
8690
|
-
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name =
|
8690
|
+
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = Fe.name;
|
8691
8691
|
}
|
8692
8692
|
}
|
8693
8693
|
const ks = ["‘", "’", "“", "”", `
|
8694
8694
|
`];
|
8695
|
-
class
|
8695
|
+
class xe extends Error {
|
8696
8696
|
constructor(t) {
|
8697
|
-
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name =
|
8697
|
+
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = xe.name;
|
8698
8698
|
}
|
8699
8699
|
}
|
8700
8700
|
class Ms {
|
@@ -8716,7 +8716,7 @@ class Ms {
|
|
8716
8716
|
}, this.textAlign = (t) => t.vertical ? "center" : t.textAlign || "center", this.getErrorsForText = (t, e, a, n) => {
|
8717
8717
|
let i;
|
8718
8718
|
a.data && a.data.maxLength && e.length > a.data.maxLength && (i || (i = {}), i.hitCharacterLimit = !0);
|
8719
|
-
const s = n.getProfanities(), o =
|
8719
|
+
const s = n.getProfanities(), o = aa(t.toLowerCase());
|
8720
8720
|
for (const c of o)
|
8721
8721
|
for (const d in s) {
|
8722
8722
|
const A = s[d].toLowerCase().replace(/\s/g, "");
|
@@ -8736,7 +8736,7 @@ class Ms {
|
|
8736
8736
|
if (a)
|
8737
8737
|
await this.reload(t, e, a);
|
8738
8738
|
else {
|
8739
|
-
const i = this.getDefaultImageFillVariant(t.data), s = i?.asset?.fileLink, o = s ? await
|
8739
|
+
const i = this.getDefaultImageFillVariant(t.data), s = i?.asset?.fileLink, o = s ? await ca(s) : void 0, l = o ? {
|
8740
8740
|
src: o.src,
|
8741
8741
|
height: o.height,
|
8742
8742
|
width: o.width,
|
@@ -8843,7 +8843,7 @@ class Ms {
|
|
8843
8843
|
const a = e.variants?.map((n) => n.asset?.fileLink)?.filter((n) => !!n) || [];
|
8844
8844
|
return Promise.all(
|
8845
8845
|
a.map(async (n) => {
|
8846
|
-
const i = await
|
8846
|
+
const i = await ca(n);
|
8847
8847
|
return {
|
8848
8848
|
src: n,
|
8849
8849
|
width: i.width,
|
@@ -8863,7 +8863,7 @@ class Ms {
|
|
8863
8863
|
fillImage: e
|
8864
8864
|
});
|
8865
8865
|
for (const o of a) {
|
8866
|
-
const l = new
|
8866
|
+
const l = new He(o.id, e);
|
8867
8867
|
i(l);
|
8868
8868
|
}
|
8869
8869
|
}
|
@@ -8900,13 +8900,13 @@ class Ms {
|
|
8900
8900
|
strokeColor: s
|
8901
8901
|
});
|
8902
8902
|
for (const o of a) {
|
8903
|
-
const l = new
|
8903
|
+
const l = new Ye(o.id, s, t.data?.strokeThickness);
|
8904
8904
|
i(l);
|
8905
8905
|
}
|
8906
8906
|
}
|
8907
8907
|
getProcessedInput(t, e, a) {
|
8908
8908
|
const n = a ? t : this.injectReplaceableText(t, e);
|
8909
|
-
return
|
8909
|
+
return Pe(n, {
|
8910
8910
|
vertical: e.vertical,
|
8911
8911
|
uppercase: e.uppercase
|
8912
8912
|
});
|
@@ -8990,7 +8990,7 @@ class Ms {
|
|
8990
8990
|
u,
|
8991
8991
|
async () => {
|
8992
8992
|
e.updateMetadata(t.stepName, { color: h, text: m }), e.updateStorage(t.stepName, { text: m, inputText: m });
|
8993
|
-
const p = o.map((S) => new
|
8993
|
+
const p = o.map((S) => new qa(S.id, A)), f = new R(p);
|
8994
8994
|
e.getCommandDispatcher()(f);
|
8995
8995
|
}
|
8996
8996
|
), o.length === 0 && l) {
|
@@ -9093,20 +9093,20 @@ class Ms {
|
|
9093
9093
|
async selectVariantCommand(t, e, a, n, i, s, o, l, c) {
|
9094
9094
|
const d = i.markUpdatePending(), A = await this.fontDataFromVariant(e);
|
9095
9095
|
if (n.length > 0) {
|
9096
|
-
const u = n.map((g) => new
|
9096
|
+
const u = n.map((g) => new qa(g.id, A));
|
9097
9097
|
if (l) {
|
9098
|
-
const g = n.map((p) => new
|
9098
|
+
const g = n.map((p) => new He(p.id, l));
|
9099
9099
|
u.push(...g);
|
9100
9100
|
}
|
9101
9101
|
if (c) {
|
9102
9102
|
const g = n.map(
|
9103
|
-
(p) => new
|
9103
|
+
(p) => new Ye(p.id, c, t.data.strokeThickness)
|
9104
9104
|
);
|
9105
9105
|
u.push(...g);
|
9106
9106
|
}
|
9107
9107
|
const h = await this.changeInputTextWithRegion(
|
9108
9108
|
t,
|
9109
|
-
t.data.size ||
|
9109
|
+
t.data.size || Ke,
|
9110
9110
|
A,
|
9111
9111
|
a.text || "",
|
9112
9112
|
a,
|
@@ -9131,7 +9131,7 @@ class Ms {
|
|
9131
9131
|
i
|
9132
9132
|
), h = await this.changeInputTextWithRegion(
|
9133
9133
|
t,
|
9134
|
-
t.data.size ||
|
9134
|
+
t.data.size || Ke,
|
9135
9135
|
A,
|
9136
9136
|
u[0]?.newElement.input || a.text || t.data.defaultText || "",
|
9137
9137
|
a,
|
@@ -9142,13 +9142,13 @@ class Ms {
|
|
9142
9142
|
), m = u.flatMap((p) => p.commands);
|
9143
9143
|
if (l) {
|
9144
9144
|
const p = u.map(
|
9145
|
-
(f) => new
|
9145
|
+
(f) => new He(f.regionElement.id, l)
|
9146
9146
|
);
|
9147
9147
|
m.push(...p);
|
9148
9148
|
}
|
9149
9149
|
if (c) {
|
9150
9150
|
const p = n.map(
|
9151
|
-
(f) => new
|
9151
|
+
(f) => new Ye(f.id, c, t.data.strokeThickness)
|
9152
9152
|
);
|
9153
9153
|
m.push(...p);
|
9154
9154
|
}
|
@@ -9175,7 +9175,7 @@ class Ms {
|
|
9175
9175
|
const m = s.getLayouts().find((p) => p.panelId === u.panelId), g = M();
|
9176
9176
|
try {
|
9177
9177
|
if (!m)
|
9178
|
-
throw new
|
9178
|
+
throw new xe("Failed to find layout for region: " + u.panelId);
|
9179
9179
|
const p = a.colorOption;
|
9180
9180
|
let f;
|
9181
9181
|
if (p && p.variants) {
|
@@ -9189,7 +9189,7 @@ class Ms {
|
|
9189
9189
|
stepName: t,
|
9190
9190
|
align: this.textAlign(a),
|
9191
9191
|
fill: i.color ? i.color : b,
|
9192
|
-
fontSize: a.size ||
|
9192
|
+
fontSize: a.size || Ke,
|
9193
9193
|
fontData: n,
|
9194
9194
|
id: g,
|
9195
9195
|
layer: u.layer,
|
@@ -9238,10 +9238,10 @@ class Ms {
|
|
9238
9238
|
fontData: n
|
9239
9239
|
};
|
9240
9240
|
} catch (p) {
|
9241
|
-
throw console.log(p), new
|
9241
|
+
throw console.log(p), new Fe("Error adding font to region");
|
9242
9242
|
}
|
9243
9243
|
}, A = await Promise.all(a.regions.map(d)).catch((u) => {
|
9244
|
-
throw u instanceof
|
9244
|
+
throw u instanceof Fe ? (xs.setLatestToast("Failed to load font.", Ue.Error), u) : u instanceof xe ? u : new Error(u);
|
9245
9245
|
});
|
9246
9246
|
return await s.setSelectionsAndElements(
|
9247
9247
|
t,
|
@@ -9283,7 +9283,7 @@ class Ms {
|
|
9283
9283
|
const S = (() => {
|
9284
9284
|
if (t.data && t.data.maxLength && h.length > t.data.maxLength)
|
9285
9285
|
return d && d(!0), { info: "0" };
|
9286
|
-
const C = s.getProfanities(), E =
|
9286
|
+
const C = s.getProfanities(), E = aa(h.toLowerCase());
|
9287
9287
|
for (const P of E)
|
9288
9288
|
for (const B in C) {
|
9289
9289
|
const F = C[B].toLowerCase().replace(/\s/g, "");
|
@@ -9353,7 +9353,7 @@ function Us(r, t, e, a) {
|
|
9353
9353
|
const n = e / r, i = a / t;
|
9354
9354
|
return n > 1 && i > 1 ? Math.min(n, i) : n > 1 && i < 1 ? i : n < 1 && i > 1 ? n : Math.min(n, i);
|
9355
9355
|
}
|
9356
|
-
const
|
9356
|
+
const Ha = {
|
9357
9357
|
m: ["x", "y"],
|
9358
9358
|
z: [],
|
9359
9359
|
l: ["x", "y"],
|
@@ -9383,7 +9383,7 @@ class Ls {
|
|
9383
9383
|
const n = (i) => {
|
9384
9384
|
const s = [], o = i.relative ? i.type : i.type.toUpperCase();
|
9385
9385
|
let l = e !== o;
|
9386
|
-
const c =
|
9386
|
+
const c = Ha[i.type];
|
9387
9387
|
l && (s.push(o), e = o);
|
9388
9388
|
for (const d of c) {
|
9389
9389
|
const A = i[d];
|
@@ -9408,7 +9408,7 @@ class Ls {
|
|
9408
9408
|
const e = /([mzlhvcsqta])([^mzlhvcsqta]*)/gi, a = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, n = [];
|
9409
9409
|
let i;
|
9410
9410
|
for (e.lastIndex = 0; i = e.exec(t); ) {
|
9411
|
-
const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c =
|
9411
|
+
const s = i[1].toLowerCase(), o = (i[2].match(a) || []).map(parseFloat), l = s === i[1], c = Ha[s];
|
9412
9412
|
if (o.length < c.length)
|
9413
9413
|
throw new Dt(
|
9414
9414
|
`Path type "${s}" given ${o.length} arguments, expected ${c.length}.`
|
@@ -9570,7 +9570,7 @@ const re = w`
|
|
9570
9570
|
bundleId: r
|
9571
9571
|
}
|
9572
9572
|
})).data.globalPropertyState, qs = (r) => w`
|
9573
|
-
${
|
9573
|
+
${Re}
|
9574
9574
|
fragment ProductFields on Product {
|
9575
9575
|
id
|
9576
9576
|
basePrice
|
@@ -9614,7 +9614,7 @@ const re = w`
|
|
9614
9614
|
name
|
9615
9615
|
}
|
9616
9616
|
}
|
9617
|
-
`,
|
9617
|
+
`, Ba = (r) => w`
|
9618
9618
|
${qs(r)}
|
9619
9619
|
fragment ProductCollectionProductFields on ProductCollectionProduct {
|
9620
9620
|
id
|
@@ -9625,7 +9625,7 @@ const re = w`
|
|
9625
9625
|
}
|
9626
9626
|
}
|
9627
9627
|
`, ie = (r, t = !1) => w`
|
9628
|
-
${r ?
|
9628
|
+
${r ? Ba(t) : ""}
|
9629
9629
|
fragment ProductCollectionFields on ProductCollection {
|
9630
9630
|
id
|
9631
9631
|
name
|
@@ -9738,7 +9738,7 @@ const re = w`
|
|
9738
9738
|
quoteId
|
9739
9739
|
}
|
9740
9740
|
}
|
9741
|
-
`,
|
9741
|
+
`, Ya = w`
|
9742
9742
|
query GetBundleStakeholders($id: String!) {
|
9743
9743
|
bundles(ids: [$id]) {
|
9744
9744
|
id
|
@@ -9813,7 +9813,7 @@ const re = w`
|
|
9813
9813
|
}
|
9814
9814
|
}
|
9815
9815
|
`, Ys = w`
|
9816
|
-
${
|
9816
|
+
${Ba(!1)}
|
9817
9817
|
query GetProductCollectionProducts($id: String!, $productIds: [String!]) {
|
9818
9818
|
productCollections(ids: [$id], productIds: $productIds) {
|
9819
9819
|
id
|
@@ -9846,7 +9846,7 @@ const re = w`
|
|
9846
9846
|
}
|
9847
9847
|
}
|
9848
9848
|
`, Ks = w`
|
9849
|
-
${
|
9849
|
+
${Ba(!0)}
|
9850
9850
|
query GetProductCollectionForProductsFeed(
|
9851
9851
|
$id: String!
|
9852
9852
|
$limit: Int
|
@@ -10227,9 +10227,9 @@ const re = w`
|
|
10227
10227
|
}
|
10228
10228
|
}
|
10229
10229
|
`;
|
10230
|
-
var
|
10230
|
+
var Ue = /* @__PURE__ */ ((r) => (r.Error = "Error", r.Warning = "Warning", r.Info = "Info", r))(Ue || {});
|
10231
10231
|
const yo = 1e3;
|
10232
|
-
class
|
10232
|
+
class Ja extends xn {
|
10233
10233
|
constructor(t) {
|
10234
10234
|
super(), this.createdAt = /* @__PURE__ */ new Date(), this.update = t;
|
10235
10235
|
}
|
@@ -10661,9 +10661,9 @@ class So {
|
|
10661
10661
|
...this.storage,
|
10662
10662
|
[t]: { ...this.storage[t], ...e }
|
10663
10663
|
};
|
10664
|
-
if (!
|
10664
|
+
if (!ye(a, this.storage)) {
|
10665
10665
|
this.storage = a;
|
10666
|
-
const n = new
|
10666
|
+
const n = new Wa(this.constructSerializableWorkflow());
|
10667
10667
|
this.commandContext.apply(n, !0), this.onStepSpecificStorageChange(t), this.onStorageChange();
|
10668
10668
|
}
|
10669
10669
|
}
|
@@ -10682,7 +10682,7 @@ class So {
|
|
10682
10682
|
if (this.readOnly) return;
|
10683
10683
|
const t = this.serialize();
|
10684
10684
|
this.workflowStatePromiseQueue.enqueue(
|
10685
|
-
new
|
10685
|
+
new Ja(async () => {
|
10686
10686
|
await new Promise((e) => {
|
10687
10687
|
setTimeout(() => {
|
10688
10688
|
e();
|
@@ -10699,7 +10699,7 @@ class So {
|
|
10699
10699
|
async updateStateWithServerImmediate() {
|
10700
10700
|
if (this.readOnly) return;
|
10701
10701
|
const t = this.serialize();
|
10702
|
-
return new
|
10702
|
+
return new Ja(async () => {
|
10703
10703
|
await this.updateTransaction({
|
10704
10704
|
variables: {
|
10705
10705
|
id: this.transaction.id,
|
@@ -10761,10 +10761,10 @@ class So {
|
|
10761
10761
|
return Promise.resolve({ stepElements: {}, commands: [] });
|
10762
10762
|
const n = async (c, d, A) => {
|
10763
10763
|
if (c.type === v.SilentIllustration) {
|
10764
|
-
const u = await new
|
10764
|
+
const u = await new ja(c, d).trigger();
|
10765
10765
|
return { step: c, results: u };
|
10766
10766
|
} else if (c.type === v.ProductOverlay) {
|
10767
|
-
const u = await new
|
10767
|
+
const u = await new ja(
|
10768
10768
|
c,
|
10769
10769
|
d,
|
10770
10770
|
A
|
@@ -10869,7 +10869,7 @@ class So {
|
|
10869
10869
|
}, this.removeElements(u);
|
10870
10870
|
const g = this.workflow.steps.find((C) => C.stepName === t);
|
10871
10871
|
g?.type === v.Frame && this.getWorkflowExperience().getStepById(g.stepName)?.frameService?.setTargetElements(a.map((E) => E.id));
|
10872
|
-
const p = u.map((C) => new Bt(C.id)), f = new
|
10872
|
+
const p = u.map((C) => new Bt(C.id)), f = new Wa(this.constructSerializableWorkflow()), S = [...m, ...p, f];
|
10873
10873
|
S.length > 0 && this.commandContext.apply(new R(S), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
|
10874
10874
|
const b = this.getInvalidModelVariants(), I = this.modelContainer;
|
10875
10875
|
if (I) {
|
@@ -11412,7 +11412,7 @@ class Do extends Z {
|
|
11412
11412
|
...this.manager.getInformationResults(),
|
11413
11413
|
{
|
11414
11414
|
message: "An issue has occurred with text",
|
11415
|
-
messageType:
|
11415
|
+
messageType: Ue.Error,
|
11416
11416
|
stepID: this.step.stepName
|
11417
11417
|
}
|
11418
11418
|
]);
|
@@ -11660,7 +11660,7 @@ class ko extends Z {
|
|
11660
11660
|
...this.manager.getInformationResults(),
|
11661
11661
|
{
|
11662
11662
|
message: e,
|
11663
|
-
messageType:
|
11663
|
+
messageType: Ue.Error,
|
11664
11664
|
stepID: this.step.stepName
|
11665
11665
|
}
|
11666
11666
|
];
|
@@ -11832,7 +11832,7 @@ const No = async (r, t) => {
|
|
11832
11832
|
headers: e
|
11833
11833
|
}
|
11834
11834
|
})).data?.designCreateMany;
|
11835
|
-
},
|
11835
|
+
}, Ka = (r, t, e) => {
|
11836
11836
|
const a = (i) => {
|
11837
11837
|
const s = {};
|
11838
11838
|
if (i.type === "Frame") {
|
@@ -11928,7 +11928,7 @@ const No = async (r, t) => {
|
|
11928
11928
|
T.errors && console.log("Server Error:", et.message);
|
11929
11929
|
}), null) : tt ?? null;
|
11930
11930
|
})() || (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(a())), await r.updateStateWithServerImmediate(a), console.log("Server state is undefined @ Workflow completion"));
|
11931
|
-
const u = r.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, g = l &&
|
11931
|
+
const u = r.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, g = l && Ka(l, t, !0), p = l && Ka(l, t, !1), f = async (B) => {
|
11932
11932
|
const F = {};
|
11933
11933
|
let Q = 0;
|
11934
11934
|
if (Object.keys(i).length > 0)
|
@@ -11967,7 +11967,7 @@ const No = async (r, t) => {
|
|
11967
11967
|
const B = await (await rt(E)).blob();
|
11968
11968
|
E = (await O.uploadAsset(
|
11969
11969
|
{ name: `${n.id}-preview-image.png`, blob: B },
|
11970
|
-
|
11970
|
+
Se.Image,
|
11971
11971
|
!0,
|
11972
11972
|
!1
|
11973
11973
|
)).fileLink;
|
@@ -12146,7 +12146,7 @@ class Uo {
|
|
12146
12146
|
throw new V("Unexpected storage method requested");
|
12147
12147
|
}
|
12148
12148
|
}
|
12149
|
-
const
|
12149
|
+
const _e = new Uo(), Lo = w`
|
12150
12150
|
mutation AddTransactionStakeholder($id: String!, $type: String!, $details: CustomerDetailsInput!) {
|
12151
12151
|
transactionAddStakeholder(id: $id, details: $details, type: $type) {
|
12152
12152
|
id
|
@@ -12193,7 +12193,7 @@ var Go = /* @__PURE__ */ ((r) => (r.QuantityChanged = "QuantityChanged", r.Price
|
|
12193
12193
|
class Wo {
|
12194
12194
|
constructor(t, e) {
|
12195
12195
|
if (this.cachedStepHandles = /* @__PURE__ */ new Map(), this.currentPriceBreak = 1, this.renderableScenes = [], this.renderableSceneCallbacks = [], this.eventCallbacks = /* @__PURE__ */ new Map(), this.debouncedSavedDesignUpdate = dn(async () => {
|
12196
|
-
await
|
12196
|
+
await _e.getSavedDesignByTransaction(
|
12197
12197
|
this.getWorkflowManager().getTransaction().id
|
12198
12198
|
) && this.save();
|
12199
12199
|
}, 2500), this.getCanvasObjectURLAsync = async (n) => new Promise((i, s) => {
|
@@ -12312,20 +12312,20 @@ class Wo {
|
|
12312
12312
|
height: d.layoutState.layout.height
|
12313
12313
|
}, u = this.commandContext.getLayoutById(d.layoutState.layout.id), h = s.getContext("2d");
|
12314
12314
|
if (!h)
|
12315
|
-
throw new
|
12316
|
-
const m = this.workflowManager.getTemplatingContext(), g =
|
12315
|
+
throw new Me("Failed to obtain 2D context for preview image creation");
|
12316
|
+
const m = this.workflowManager.getTemplatingContext(), g = Sa(u.layoutState.layout, u.layoutState.elements, {
|
12317
12317
|
renderingConfiguration: {
|
12318
12318
|
purpose: Ht.Print,
|
12319
12319
|
region: { left: A.x, top: A.y, width: A.width, height: A.height },
|
12320
12320
|
templatingContext: m
|
12321
12321
|
}
|
12322
12322
|
}), p = gn(g);
|
12323
|
-
await (await
|
12323
|
+
await (await ua.from(h, p, {
|
12324
12324
|
anonymousCrossOrigin: !0,
|
12325
12325
|
ignoreDimensions: !1,
|
12326
12326
|
createCanvas: pt,
|
12327
12327
|
createImage: te,
|
12328
|
-
DOMParser:
|
12328
|
+
DOMParser: pa(),
|
12329
12329
|
fetch
|
12330
12330
|
})).render();
|
12331
12331
|
const S = await this.getCanvasObjectURLAsync(s);
|
@@ -12483,7 +12483,7 @@ class Wo {
|
|
12483
12483
|
const n = {
|
12484
12484
|
title: await (async () => {
|
12485
12485
|
if (t) return t;
|
12486
|
-
const i = this.getWorkflowManager().getTransaction().id, o = (await
|
12486
|
+
const i = this.getWorkflowManager().getTransaction().id, o = (await _e.getSavedDesigns()).find((l) => l.transactionId === i)?.title;
|
12487
12487
|
return o || "My design";
|
12488
12488
|
})(),
|
12489
12489
|
thumbnail: await this.createPreviewImage(!1, 256),
|
@@ -12494,7 +12494,7 @@ class Wo {
|
|
12494
12494
|
workflowId: this.getWorkflowManager().getWorkflow().id,
|
12495
12495
|
lastEdited: /* @__PURE__ */ new Date()
|
12496
12496
|
};
|
12497
|
-
return await
|
12497
|
+
return await _e.addDesign(n), n;
|
12498
12498
|
}
|
12499
12499
|
async copy() {
|
12500
12500
|
const t = Et(this.getCommandContext().getState());
|
@@ -12684,8 +12684,8 @@ const qo = (r) => {
|
|
12684
12684
|
"tspan"
|
12685
12685
|
], Yo = async (r, t, e) => {
|
12686
12686
|
const a = t.data, n = e.data.baseUrl, i = a.assetUrl.replace("localhost", "localstack"), s = n.slice(0, 4) === "http" ? "" : "https://", o = new URL(s + n);
|
12687
|
-
o.searchParams.append("video",
|
12688
|
-
const l = o.toString(), d = `data:image/svg+xml;base64,${
|
12687
|
+
o.searchParams.append("video", Ra(JSON.stringify([{ href: i }]))), o.pathname = o.pathname + (o.pathname.slice(-1) === "/" ? "" : "/");
|
12688
|
+
const l = o.toString(), d = `data:image/svg+xml;base64,${Ra(await cn(l, { type: "svg" }))}`, A = (h) => {
|
12689
12689
|
const m = r.find((p) => p.panelId === h.panelId);
|
12690
12690
|
if (!m)
|
12691
12691
|
throw new Y(h);
|
@@ -12710,15 +12710,15 @@ const qo = (r) => {
|
|
12710
12710
|
return console.error(h), [];
|
12711
12711
|
}
|
12712
12712
|
}, Jo = async (r, t, e, a) => {
|
12713
|
-
const n = e.data, i = n.assetUrl, s = await
|
12713
|
+
const n = e.data, i = n.assetUrl, s = await ca(i);
|
12714
12714
|
try {
|
12715
12715
|
const o = us(n, a.option);
|
12716
12716
|
o && (t[a.stepName] = { selectedVariants: [o] });
|
12717
12717
|
const l = async (c) => {
|
12718
|
-
const d = await Ln(c, o?.asset?.fileLink), A = await
|
12718
|
+
const d = await Ln(c, o?.asset?.fileLink), A = await $e(d), u = M(), h = r.find((g) => g.panelId === c.panelId);
|
12719
12719
|
if (!h)
|
12720
12720
|
throw new Y(c);
|
12721
|
-
const m =
|
12721
|
+
const m = Ea(
|
12722
12722
|
s,
|
12723
12723
|
A,
|
12724
12724
|
{
|
@@ -12782,7 +12782,7 @@ const qo = (r) => {
|
|
12782
12782
|
const l = await nt(o, !0), c = /<svg.*?<\/svg>/s, d = l.match(c) || [], A = d?.length > 0 ? d[0] : "", m = dt().parseFromString(A, "image/svg+xml").firstElementChild;
|
12783
12783
|
if (!m)
|
12784
12784
|
return console.error("Failed to read SVG."), [];
|
12785
|
-
|
12785
|
+
fa(m);
|
12786
12786
|
const g = {};
|
12787
12787
|
kt(m, (C) => {
|
12788
12788
|
Ho.includes(C.tagName) && !C.attributes.getNamedItem("fill") && C.setAttribute("fill", "#000000");
|
@@ -12996,7 +12996,7 @@ const qo = (r) => {
|
|
12996
12996
|
const u = /<svg.*?<\/svg>/s, h = A.match(u) || [], m = h?.length > 0 ? h[0] : "", f = dt().parseFromString(m, "image/svg+xml").firstElementChild;
|
12997
12997
|
if (!f)
|
12998
12998
|
throw new Dt("Failed to read SVG.");
|
12999
|
-
return
|
12999
|
+
return fa(f), It().serializeToString(f);
|
13000
13000
|
};
|
13001
13001
|
l.forEach((A) => {
|
13002
13002
|
const u = r.find((m) => m.panelId === A.panelId);
|
@@ -13046,7 +13046,7 @@ const qo = (r) => {
|
|
13046
13046
|
assetUrl: p,
|
13047
13047
|
name: f.names.fullName.en
|
13048
13048
|
};
|
13049
|
-
})(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", i.text) : i.text) || "", u =
|
13049
|
+
})(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", i.text) : i.text) || "", u = Pe(A, {
|
13050
13050
|
vertical: a.data.vertical,
|
13051
13051
|
uppercase: a.data.uppercase
|
13052
13052
|
}), h = async (p) => {
|
@@ -13084,7 +13084,7 @@ const qo = (r) => {
|
|
13084
13084
|
d,
|
13085
13085
|
p,
|
13086
13086
|
[
|
13087
|
-
|
13087
|
+
Pe(u, {
|
13088
13088
|
vertical: a.data.vertical,
|
13089
13089
|
uppercase: a.data.uppercase
|
13090
13090
|
})
|
@@ -13332,12 +13332,12 @@ class ll extends xn {
|
|
13332
13332
|
l = p.width, c = p.height;
|
13333
13333
|
} else
|
13334
13334
|
l = i.width, c = i.height;
|
13335
|
-
const d = this.getWorkflowManager?.()?.getTemplatingContext(), A =
|
13335
|
+
const d = this.getWorkflowManager?.()?.getTemplatingContext(), A = Sa(t.layoutState.layout, e, {
|
13336
13336
|
renderingConfiguration: {
|
13337
13337
|
purpose: Ht.ThreeD,
|
13338
13338
|
templatingContext: d
|
13339
13339
|
}
|
13340
|
-
}), u = gn(A), h = await
|
13340
|
+
}), u = gn(A), h = await ua.from(this.ctx, u, {
|
13341
13341
|
anonymousCrossOrigin: !0,
|
13342
13342
|
ignoreDimensions: !this.nonPOTSupport,
|
13343
13343
|
ignoreAnimation: !0,
|
@@ -13346,7 +13346,7 @@ class ll extends xn {
|
|
13346
13346
|
enableRedraw: !1,
|
13347
13347
|
createCanvas: pt,
|
13348
13348
|
createImage: te,
|
13349
|
-
DOMParser:
|
13349
|
+
DOMParser: pa(),
|
13350
13350
|
fetch
|
13351
13351
|
});
|
13352
13352
|
h.resize(l, c), await h.render(), this.onRender();
|
@@ -13416,14 +13416,14 @@ class cl {
|
|
13416
13416
|
case U.FileUpload:
|
13417
13417
|
return new dl(this.bundle, t).initialize();
|
13418
13418
|
case U.ColorOption:
|
13419
|
-
return new
|
13419
|
+
return new _a(
|
13420
13420
|
this.bundle,
|
13421
13421
|
t,
|
13422
13422
|
t.entityId ? await H.getOption(t.entityId) : void 0
|
13423
13423
|
);
|
13424
13424
|
case U.Option: {
|
13425
13425
|
const e = t.entityId ? await H.getOption(t.entityId) : void 0;
|
13426
|
-
return e?.type === "Color" ? new
|
13426
|
+
return e?.type === "Color" ? new _a(this.bundle, t, e) : new er(this.bundle, t, e);
|
13427
13427
|
}
|
13428
13428
|
case U.Text:
|
13429
13429
|
return new Al(this.bundle, t);
|
@@ -13432,7 +13432,7 @@ class cl {
|
|
13432
13432
|
}
|
13433
13433
|
}
|
13434
13434
|
}
|
13435
|
-
class
|
13435
|
+
class Ia {
|
13436
13436
|
constructor(t, e) {
|
13437
13437
|
this.bundle = t, this.property = e;
|
13438
13438
|
}
|
@@ -13493,7 +13493,7 @@ class Ba {
|
|
13493
13493
|
return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
|
13494
13494
|
}
|
13495
13495
|
}
|
13496
|
-
class dl extends
|
13496
|
+
class dl extends Ia {
|
13497
13497
|
constructor(t, e) {
|
13498
13498
|
super(t, e);
|
13499
13499
|
}
|
@@ -13504,7 +13504,7 @@ class dl extends Ba {
|
|
13504
13504
|
const t = await this.getImage();
|
13505
13505
|
if (t?.fileLink)
|
13506
13506
|
if (t?.fileLink.endsWith(".svg")) {
|
13507
|
-
const e = await nt(t?.fileLink), a = await
|
13507
|
+
const e = await nt(t?.fileLink), a = await ba(t?.fileLink), n = a.width, i = a.height, s = await ot(e);
|
13508
13508
|
this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.colors?.forEach((c) => {
|
13509
13509
|
s.colors[c.key] = {
|
13510
13510
|
browserValue: c.browserValue,
|
@@ -13547,7 +13547,7 @@ class dl extends Ba {
|
|
13547
13547
|
]);
|
13548
13548
|
}
|
13549
13549
|
async canUseBackgroundRemover() {
|
13550
|
-
return this.bundle.getClient().canUseAddon(
|
13550
|
+
return this.bundle.getClient().canUseAddon(ha.BackgroundRemover);
|
13551
13551
|
}
|
13552
13552
|
/**
|
13553
13553
|
* Removes the background from an image, stores it in the state, and returns the new asset.
|
@@ -13585,7 +13585,7 @@ class dl extends Ba {
|
|
13585
13585
|
return O.getLocalOrFromServer(t);
|
13586
13586
|
}
|
13587
13587
|
async getImageWithColors() {
|
13588
|
-
return await this.loadImageData(), this.imageData?.svg ?
|
13588
|
+
return await this.loadImageData(), this.imageData?.svg ? ma(wa(this.imageData.svg, this.imageData.colors ?? {}, !1)) : this.imageData?.src;
|
13589
13589
|
}
|
13590
13590
|
/**
|
13591
13591
|
* Retrieves the original, unmodified image selection, if one exists.
|
@@ -13719,7 +13719,7 @@ class dl extends Ba {
|
|
13719
13719
|
);
|
13720
13720
|
}
|
13721
13721
|
}
|
13722
|
-
class Al extends
|
13722
|
+
class Al extends Ia {
|
13723
13723
|
constructor(t, e) {
|
13724
13724
|
super(t, e);
|
13725
13725
|
}
|
@@ -13758,7 +13758,7 @@ class Al extends Ba {
|
|
13758
13758
|
await Promise.all(n);
|
13759
13759
|
}
|
13760
13760
|
}
|
13761
|
-
class er extends
|
13761
|
+
class er extends Ia {
|
13762
13762
|
constructor(t, e, a) {
|
13763
13763
|
super(t, e), this.optionResource = a;
|
13764
13764
|
}
|
@@ -13820,7 +13820,7 @@ class er extends Ba {
|
|
13820
13820
|
await Promise.all(n);
|
13821
13821
|
}
|
13822
13822
|
}
|
13823
|
-
class
|
13823
|
+
class _a extends er {
|
13824
13824
|
constructor(t, e, a) {
|
13825
13825
|
super(t, e, a);
|
13826
13826
|
}
|
@@ -13829,10 +13829,7 @@ class Ka extends er {
|
|
13829
13829
|
* @param variant The variant to select.
|
13830
13830
|
*/
|
13831
13831
|
async selectVariant(t, e) {
|
13832
|
-
await
|
13833
|
-
this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t.getId(), {}, e),
|
13834
|
-
this.applyColorVariant(t, void 0, e)
|
13835
|
-
]);
|
13832
|
+
await this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t.getId(), void 0, e);
|
13836
13833
|
}
|
13837
13834
|
async applyGlobalState(t) {
|
13838
13835
|
const e = this.getStateValue();
|
@@ -13981,7 +13978,7 @@ class ml {
|
|
13981
13978
|
storage: a !== null ? a : void 0,
|
13982
13979
|
channel: n
|
13983
13980
|
});
|
13984
|
-
await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(s, this.globalPropertyState);
|
13981
|
+
ye(s, this.globalPropertyState) || (await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(s, this.globalPropertyState));
|
13985
13982
|
}
|
13986
13983
|
async setAspectStorage(t, e, a) {
|
13987
13984
|
if (!this.globalPropertyState)
|
@@ -14008,7 +14005,7 @@ class ml {
|
|
14008
14005
|
storage: e !== null ? e : void 0,
|
14009
14006
|
channel: a
|
14010
14007
|
});
|
14011
|
-
await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(i, this.globalPropertyState);
|
14008
|
+
ye(i, this.globalPropertyState) || (await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(i, this.globalPropertyState));
|
14012
14009
|
}
|
14013
14010
|
async updateGlobalPropertyState() {
|
14014
14011
|
if (!this.globalPropertyState)
|
@@ -14688,7 +14685,7 @@ const bl = w`
|
|
14688
14685
|
}
|
14689
14686
|
}
|
14690
14687
|
`;
|
14691
|
-
class
|
14688
|
+
class Xe {
|
14692
14689
|
constructor(t, e, a, n, i, s) {
|
14693
14690
|
this.workflowExperiences = [], this.eventEmitter = new El(), 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 = i, this.metadata = new Map(e.metadata?.map((c) => [c.key, c.value]) || []), this.completed = e.completed ?? !1, this.productCollection = e.productCollection, this.bundleStateManager = new gl(e.bundleStateData);
|
14694
14691
|
const o = this.productCollection?.globalPropertyConfiguration;
|
@@ -14846,7 +14843,7 @@ class _e {
|
|
14846
14843
|
if (i)
|
14847
14844
|
switch (a.type) {
|
14848
14845
|
case U.FileUpload: {
|
14849
|
-
const s = i, o = await
|
14846
|
+
const s = i, o = await Be([a.value]);
|
14850
14847
|
o.length > 0 && await s.selectImage(o[0]);
|
14851
14848
|
const l = a.storage?.colors;
|
14852
14849
|
if (l) {
|
@@ -15103,7 +15100,7 @@ class _e {
|
|
15103
15100
|
variables: {
|
15104
15101
|
id: this.id,
|
15105
15102
|
details: t,
|
15106
|
-
type: e ||
|
15103
|
+
type: e || ve.Owner
|
15107
15104
|
},
|
15108
15105
|
context: {
|
15109
15106
|
bundleOwnerId: this.ownerId
|
@@ -15142,7 +15139,7 @@ class _e {
|
|
15142
15139
|
}
|
15143
15140
|
async getAllStakeholders() {
|
15144
15141
|
const t = await y.getShadowGraphqlClient().query({
|
15145
|
-
query:
|
15142
|
+
query: Ya,
|
15146
15143
|
errorPolicy: "all",
|
15147
15144
|
fetchPolicy: "no-cache",
|
15148
15145
|
variables: {
|
@@ -15158,7 +15155,7 @@ class _e {
|
|
15158
15155
|
}
|
15159
15156
|
async getCurrentStakeholder() {
|
15160
15157
|
const t = await y.getShadowGraphqlClient().query({
|
15161
|
-
query:
|
15158
|
+
query: Ya,
|
15162
15159
|
errorPolicy: "all",
|
15163
15160
|
fetchPolicy: "no-cache",
|
15164
15161
|
variables: {
|
@@ -15570,7 +15567,7 @@ class ue {
|
|
15570
15567
|
return this.getArtifacts().get(t);
|
15571
15568
|
}
|
15572
15569
|
}
|
15573
|
-
class
|
15570
|
+
class Pa {
|
15574
15571
|
constructor(t) {
|
15575
15572
|
this.value = t;
|
15576
15573
|
}
|
@@ -15583,12 +15580,12 @@ class Ia {
|
|
15583
15580
|
}
|
15584
15581
|
}
|
15585
15582
|
var xl = /* @__PURE__ */ ((r) => (r.Transaction = "Transaction", r.Bundle = "Bundle", r.Product = "Product", r.Variant = "Variant", r.Option = "Option", r.LineItem = "LineItem", r.Asset = "Asset", r))(xl || {});
|
15586
|
-
class hd extends
|
15583
|
+
class hd extends Pa {
|
15587
15584
|
constructor(t) {
|
15588
15585
|
super(`"${t}"`);
|
15589
15586
|
}
|
15590
15587
|
}
|
15591
|
-
class rr extends
|
15588
|
+
class rr extends Pa {
|
15592
15589
|
constructor(t, e) {
|
15593
15590
|
if (e !== "Asset" && !rr.validUUID(t))
|
15594
15591
|
throw new Error("Invalid ID, must be a valid v4 UUID. https://www.uuidgenerator.net/");
|
@@ -15598,12 +15595,12 @@ class rr extends Ia {
|
|
15598
15595
|
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);
|
15599
15596
|
}
|
15600
15597
|
}
|
15601
|
-
class md extends
|
15598
|
+
class md extends Pa {
|
15602
15599
|
constructor(t) {
|
15603
15600
|
super(`[${t.map((e) => e.getRaw()).join(",")}]`);
|
15604
15601
|
}
|
15605
15602
|
}
|
15606
|
-
class
|
15603
|
+
class Xa {
|
15607
15604
|
constructor(t) {
|
15608
15605
|
this.integrationProduct = t;
|
15609
15606
|
}
|
@@ -15791,7 +15788,7 @@ class Ql {
|
|
15791
15788
|
}
|
15792
15789
|
async generateCode(t) {
|
15793
15790
|
const e = await this.cognitoClient?.send(
|
15794
|
-
new
|
15791
|
+
new ka({
|
15795
15792
|
AuthFlow: "CUSTOM_AUTH",
|
15796
15793
|
ClientId: this.userPoolClientId,
|
15797
15794
|
AuthParameters: {
|
@@ -15825,7 +15822,7 @@ class Ql {
|
|
15825
15822
|
throw new Error("Failed to find existing tokens.");
|
15826
15823
|
const e = JSON.parse(t);
|
15827
15824
|
return await this.cognitoClient?.send(
|
15828
|
-
new
|
15825
|
+
new ka({
|
15829
15826
|
AuthFlow: "REFRESH_TOKEN_AUTH",
|
15830
15827
|
ClientId: this.userPoolClientId,
|
15831
15828
|
AuthParameters: {
|
@@ -15855,7 +15852,7 @@ class Rl {
|
|
15855
15852
|
* @param currency The currency to determine precision for.
|
15856
15853
|
*/
|
15857
15854
|
getPrecisionForCurrency(t) {
|
15858
|
-
const e = t, a =
|
15855
|
+
const e = t, a = Ma.code(e);
|
15859
15856
|
return a ? a.digits : 2;
|
15860
15857
|
}
|
15861
15858
|
/**
|
@@ -15866,11 +15863,11 @@ class Rl {
|
|
15866
15863
|
*/
|
15867
15864
|
getSpecialFormat(t) {
|
15868
15865
|
const e = t;
|
15869
|
-
if (
|
15866
|
+
if (Ma.code(e)?.code === "CLP")
|
15870
15867
|
return "USD0,0";
|
15871
15868
|
}
|
15872
15869
|
}
|
15873
|
-
const
|
15870
|
+
const Za = new Rl();
|
15874
15871
|
class Ol {
|
15875
15872
|
constructor(t, e, a, n) {
|
15876
15873
|
this.presentmentCurrency = void 0, this.presentmentCurrency = n, this.partnerCurrency = a, this.rateFrom = t, this.rateTo = e;
|
@@ -15902,13 +15899,13 @@ class Ol {
|
|
15902
15899
|
* Converts a monetary value from the database to the units of its currency.
|
15903
15900
|
*/
|
15904
15901
|
units(t, e) {
|
15905
|
-
return t / Math.pow(10,
|
15902
|
+
return t / Math.pow(10, Za.getPrecisionForCurrency(e));
|
15906
15903
|
}
|
15907
15904
|
/**
|
15908
15905
|
* Converts a monetary value in units to the subunits of its currency.
|
15909
15906
|
*/
|
15910
15907
|
subunits(t, e) {
|
15911
|
-
return t * Math.pow(10,
|
15908
|
+
return t * Math.pow(10, Za.getPrecisionForCurrency(e));
|
15912
15909
|
}
|
15913
15910
|
}
|
15914
15911
|
const $l = async (r, t) => {
|
@@ -15975,7 +15972,7 @@ class pd {
|
|
15975
15972
|
} catch (a) {
|
15976
15973
|
throw console.error(a), new ht("Critical - Unable to synchronize workflow state with server.");
|
15977
15974
|
}
|
15978
|
-
}, this.options = t, this.options.applicationKey && Vr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 32.2.4"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
15975
|
+
}, this.options = t, this.options.applicationKey && Vr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 32.2.4-beta.37bc688d-3d85-536a-ba61-02a441df130e"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
15979
15976
|
}
|
15980
15977
|
configure(t) {
|
15981
15978
|
gt.setHubUrl(t.hubUrl), gt.setServerUrl(t.serverUrl), gt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && Gr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
@@ -16025,7 +16022,7 @@ class pd {
|
|
16025
16022
|
*/
|
16026
16023
|
async authenticateBundleFromLocalStorage(t) {
|
16027
16024
|
if (k.getMap("bundleOwnerIds")?.has(t))
|
16028
|
-
return Promise.resolve({ success: !0, stakeholderType:
|
16025
|
+
return Promise.resolve({ success: !0, stakeholderType: ve.Owner });
|
16029
16026
|
const a = k.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
16030
16027
|
if (a.has(t)) {
|
16031
16028
|
const n = a.get(t);
|
@@ -16069,7 +16066,7 @@ class pd {
|
|
16069
16066
|
if (n.isOrdered)
|
16070
16067
|
return Promise.resolve({ success: !1, transactionReadOnly: !0 });
|
16071
16068
|
if (k.getMap("transactionOwnerIds")?.has(t))
|
16072
|
-
return Promise.resolve({ success: !0, stakeholderType:
|
16069
|
+
return Promise.resolve({ success: !0, stakeholderType: ve.Owner });
|
16073
16070
|
const o = k.getMap("transactionCustomerIds");
|
16074
16071
|
if (o?.has(t) && o.get(t) && await this.reloadLoggedInCustomer()) {
|
16075
16072
|
const u = this.customer?.bundleStakeholders?.find(
|
@@ -16275,7 +16272,7 @@ class pd {
|
|
16275
16272
|
s.set(i.id, i.partner.id), k.setMap("bundlePartnerIds", s);
|
16276
16273
|
const o = k.getMap("bundleOwnerIds") || /* @__PURE__ */ new Map();
|
16277
16274
|
o.set(i.id, i.bundleOwnerId), k.setMap("bundleOwnerIds", o);
|
16278
|
-
const l = new
|
16275
|
+
const l = new Xe(this, i, void 0, void 0, i.bundleOwnerId, {
|
16279
16276
|
eagerFetchProducts: a?.graphql?.productCollection?.eagerFetchProducts
|
16280
16277
|
});
|
16281
16278
|
return await l.getInitializationPromise(), l;
|
@@ -16315,7 +16312,7 @@ class pd {
|
|
16315
16312
|
throw new Error(`Unable to find bundle: ${t}`);
|
16316
16313
|
const d = c.data?.bundles[0], A = k.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
16317
16314
|
A.set(d.id, d.partner.id), k.setMap("bundlePartnerIds", A);
|
16318
|
-
const u = new
|
16315
|
+
const u = new Xe(this, d, e, a, s, {
|
16319
16316
|
additionalHeaders: n?.graphql?.additionalHeaders,
|
16320
16317
|
eagerFetchProducts: n?.graphql?.productCollection?.eagerFetchProducts,
|
16321
16318
|
existingGlobalPropertyState: c.data.globalPropertyState,
|
@@ -16362,7 +16359,7 @@ class pd {
|
|
16362
16359
|
d.set(c.id, c.partner.id), k.setMap("bundlePartnerIds", d);
|
16363
16360
|
const A = k.getMap("bundleOwnerIds") || /* @__PURE__ */ new Map();
|
16364
16361
|
return A.set(c.id, c.bundleOwnerId), k.setMap("bundleOwnerIds", A), async () => {
|
16365
|
-
const u = new
|
16362
|
+
const u = new Xe(this, c, void 0, void 0, c.bundleOwnerId, {
|
16366
16363
|
eagerFetchProducts: n?.graphql?.productCollection?.eagerFetchProducts,
|
16367
16364
|
existingGlobalPropertyState: c.globalPropertyState
|
16368
16365
|
});
|
@@ -16487,7 +16484,7 @@ class pd {
|
|
16487
16484
|
}));
|
16488
16485
|
}, s = t.map((C, E) => ({ option: C, index: E })), o = s.filter((C) => C.option.type === "transaction"), l = s.filter(
|
16489
16486
|
(C) => C.option.type === "integration" || C.option.type === "external"
|
16490
|
-
), c =
|
16487
|
+
), c = xa(o, 10), d = xa(l, 10), A = (await Promise.all([
|
16491
16488
|
...c.map(n),
|
16492
16489
|
...d.map(i)
|
16493
16490
|
])).flat(), u = [...new Set(A.map((C) => C.workflowId))], h = await ir(u, e), m = new Map(h.map((C) => [C.id, C])), g = k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), p = A.map(async (C) => {
|
@@ -16514,10 +16511,10 @@ class pd {
|
|
16514
16511
|
};
|
16515
16512
|
if (T.type === "transaction" && E.workflowState) {
|
16516
16513
|
const q = JSON.parse(E.workflowState);
|
16517
|
-
W.layouts = Object.values(q.layouts || {}).map((wt) => wt.layout), await
|
16514
|
+
W.layouts = Object.values(q.layouts || {}).map((wt) => wt.layout), await Ga(q), W.reloadedState = q;
|
16518
16515
|
} else if (!B && T.workflowState) {
|
16519
16516
|
const q = JSON.parse(T.workflowState);
|
16520
|
-
W.layouts = Object.values(q.layouts || {}).map((wt) => wt.layout), await
|
16517
|
+
W.layouts = Object.values(q.layouts || {}).map((wt) => wt.layout), await Ga(q), W.reloadedState = q;
|
16521
16518
|
} else
|
16522
16519
|
W.layouts = Vl(
|
16523
16520
|
W.transaction,
|
@@ -16549,7 +16546,7 @@ class pd {
|
|
16549
16546
|
})).data?.integrationProducts;
|
16550
16547
|
if (!i || i.length === 0 || !i[0]?.id)
|
16551
16548
|
throw new Error("Integration product not found.");
|
16552
|
-
return new
|
16549
|
+
return new Xa(i[0]);
|
16553
16550
|
}
|
16554
16551
|
async getIntegrationProductFromExternalIds(t, e, a) {
|
16555
16552
|
const s = (await y.getShadowGraphqlClient().query({
|
@@ -16563,7 +16560,7 @@ class pd {
|
|
16563
16560
|
})).data?.integrationProductFromExternalIds;
|
16564
16561
|
if (!s?.id)
|
16565
16562
|
throw new Error("Integration product not found.");
|
16566
|
-
return new
|
16563
|
+
return new Xa(s);
|
16567
16564
|
}
|
16568
16565
|
async getIntegrationProduct(t) {
|
16569
16566
|
return t.type === "integration" ? this.getIntegrationProductById(t.integrationProductId) : this.getIntegrationProductFromExternalIds(t.externalIntegrationId, t.externalProductId);
|
@@ -16680,8 +16677,8 @@ class Wl {
|
|
16680
16677
|
if (n.currentFrameSources) {
|
16681
16678
|
let i = !1;
|
16682
16679
|
for (let s = 0; s < n.currentFrameSources.length; s++) {
|
16683
|
-
const o = n.currentFrameSources[s], l = await
|
16684
|
-
|
16680
|
+
const o = n.currentFrameSources[s], l = await $e(o), c = this.frameData ? this.frameData[s] : void 0;
|
16681
|
+
ye(l, c) || (this.frameData || (this.frameData = new Array(n.currentFrameSources.length)), this.frameData[s] = l, i = !0);
|
16685
16682
|
}
|
16686
16683
|
i && (this.onFrameDataChangeListeners.forEach(
|
16687
16684
|
(s) => s(this.frameData)
|
@@ -16733,8 +16730,8 @@ class Wl {
|
|
16733
16730
|
getImageSrc() {
|
16734
16731
|
if (this.imageData) {
|
16735
16732
|
if (this.imageData.svg) {
|
16736
|
-
const t =
|
16737
|
-
return
|
16733
|
+
const t = wa(this.imageData.svg, this.imageData.colors || {}, !1);
|
16734
|
+
return ma(t);
|
16738
16735
|
}
|
16739
16736
|
return this.imageData.src;
|
16740
16737
|
}
|
@@ -16870,7 +16867,7 @@ class Wl {
|
|
16870
16867
|
}
|
16871
16868
|
recalculateOffsets(t) {
|
16872
16869
|
this.frameData && ((!this.offsets || this.offsets.length !== this.frameData.length) && (this.offsets = new Array(this.frameData.length)), this.frameData.forEach((e, a) => {
|
16873
|
-
this.offsets[a] =
|
16870
|
+
this.offsets[a] = Ea(
|
16874
16871
|
t,
|
16875
16872
|
e,
|
16876
16873
|
this.initialZoom && !this.forceImageCover ? { scale: this.initialZoom } : void 0,
|
@@ -17089,7 +17086,7 @@ class jl extends Z {
|
|
17089
17086
|
* Returns `true` if the Background Remover is available for the current session.
|
17090
17087
|
*/
|
17091
17088
|
async canUseBackgroundRemover() {
|
17092
|
-
return this.manager.getClient().canUseAddon(
|
17089
|
+
return this.manager.getClient().canUseAddon(ha.BackgroundRemover);
|
17093
17090
|
}
|
17094
17091
|
/**
|
17095
17092
|
* Returns `true` if the Background Remover is available for the current session and if the associated frame has a user-supplied raster image.
|
@@ -17215,7 +17212,7 @@ const Hl = w`
|
|
17215
17212
|
id
|
17216
17213
|
}
|
17217
17214
|
}
|
17218
|
-
`,
|
17215
|
+
`, Da = w`
|
17219
17216
|
query GetCustomerTransactions(
|
17220
17217
|
$id: String!
|
17221
17218
|
$limit: Int!
|
@@ -17382,7 +17379,7 @@ const Hl = w`
|
|
17382
17379
|
},
|
17383
17380
|
context: t
|
17384
17381
|
}), Fd = async (r, t, e) => (await y.getShadowGraphqlClient().query({
|
17385
|
-
query:
|
17382
|
+
query: Da,
|
17386
17383
|
errorPolicy: "all",
|
17387
17384
|
fetchPolicy: "no-cache",
|
17388
17385
|
variables: {
|
@@ -17402,7 +17399,7 @@ const Hl = w`
|
|
17402
17399
|
limit: t
|
17403
17400
|
}
|
17404
17401
|
}))?.data.customerTransactionsFeed?.items || [], xd = async (r, t, e) => (await y.getShadowGraphqlClient().query({
|
17405
|
-
query:
|
17402
|
+
query: Da,
|
17406
17403
|
errorPolicy: "all",
|
17407
17404
|
fetchPolicy: "no-cache",
|
17408
17405
|
variables: {
|
@@ -17422,7 +17419,7 @@ const Hl = w`
|
|
17422
17419
|
limit: t
|
17423
17420
|
}
|
17424
17421
|
}))?.data.customerTransactionsFeed?.items || [], kd = async (r, t, e) => (await y.getShadowGraphqlClient().query({
|
17425
|
-
query:
|
17422
|
+
query: Da,
|
17426
17423
|
errorPolicy: "all",
|
17427
17424
|
fetchPolicy: "no-cache",
|
17428
17425
|
variables: {
|
@@ -17469,44 +17466,44 @@ K = { __e: function(r, t, e, a) {
|
|
17469
17466
|
}
|
17470
17467
|
throw r;
|
17471
17468
|
} }, typeof Promise == "function" && Promise.prototype.then.bind(Promise.resolve());
|
17472
|
-
var st,
|
17469
|
+
var st, Ze, tn, sr = [], ta = [], en = K.__b, an = K.__r, nn = K.diffed, rn = K.__c, sn = K.unmount;
|
17473
17470
|
function ac() {
|
17474
17471
|
for (var r; r = sr.shift(); )
|
17475
17472
|
if (r.__P && r.__H)
|
17476
17473
|
try {
|
17477
|
-
r.__H.__h.forEach(we), r.__H.__h.forEach(
|
17474
|
+
r.__H.__h.forEach(we), r.__H.__h.forEach(Aa), r.__H.__h = [];
|
17478
17475
|
} catch (t) {
|
17479
17476
|
r.__H.__h = [], K.__e(t, r.__v);
|
17480
17477
|
}
|
17481
17478
|
}
|
17482
17479
|
K.__b = function(r) {
|
17483
|
-
st = null,
|
17480
|
+
st = null, en && en(r);
|
17484
17481
|
}, K.__r = function(r) {
|
17485
|
-
|
17482
|
+
an && an(r);
|
17486
17483
|
var t = (st = r.__c).__H;
|
17487
|
-
t && (
|
17488
|
-
e.__N && (e.__ = e.__N), e.__V =
|
17489
|
-
})) : (t.__h.forEach(we), t.__h.forEach(
|
17484
|
+
t && (Ze === st ? (t.__h = [], st.__h = [], t.__.forEach(function(e) {
|
17485
|
+
e.__N && (e.__ = e.__N), e.__V = ta, e.__N = e.i = void 0;
|
17486
|
+
})) : (t.__h.forEach(we), t.__h.forEach(Aa), t.__h = [])), Ze = st;
|
17490
17487
|
}, K.diffed = function(r) {
|
17491
|
-
|
17488
|
+
nn && nn(r);
|
17492
17489
|
var t = r.__c;
|
17493
|
-
t && t.__H && (t.__H.__h.length && (sr.push(t) !== 1 &&
|
17494
|
-
e.i && (e.__H = e.i), e.__V !==
|
17495
|
-
})),
|
17490
|
+
t && t.__H && (t.__H.__h.length && (sr.push(t) !== 1 && tn === K.requestAnimationFrame || ((tn = K.requestAnimationFrame) || nc)(ac)), t.__H.__.forEach(function(e) {
|
17491
|
+
e.i && (e.__H = e.i), e.__V !== ta && (e.__ = e.__V), e.i = void 0, e.__V = ta;
|
17492
|
+
})), Ze = st = null;
|
17496
17493
|
}, K.__c = function(r, t) {
|
17497
17494
|
t.some(function(e) {
|
17498
17495
|
try {
|
17499
17496
|
e.__h.forEach(we), e.__h = e.__h.filter(function(a) {
|
17500
|
-
return !a.__ ||
|
17497
|
+
return !a.__ || Aa(a);
|
17501
17498
|
});
|
17502
17499
|
} catch (a) {
|
17503
17500
|
t.some(function(n) {
|
17504
17501
|
n.__h && (n.__h = []);
|
17505
17502
|
}), t = [], K.__e(a, e.__v);
|
17506
17503
|
}
|
17507
|
-
}),
|
17504
|
+
}), rn && rn(r, t);
|
17508
17505
|
}, K.unmount = function(r) {
|
17509
|
-
|
17506
|
+
sn && sn(r);
|
17510
17507
|
var t, e = r.__c;
|
17511
17508
|
e && e.__H && (e.__H.__.forEach(function(a) {
|
17512
17509
|
try {
|
@@ -17516,18 +17513,18 @@ K.__b = function(r) {
|
|
17516
17513
|
}
|
17517
17514
|
}), e.__H = void 0, t && K.__e(t, e.__v));
|
17518
17515
|
};
|
17519
|
-
var
|
17516
|
+
var on = typeof requestAnimationFrame == "function";
|
17520
17517
|
function nc(r) {
|
17521
17518
|
var t, e = function() {
|
17522
|
-
clearTimeout(a),
|
17519
|
+
clearTimeout(a), on && cancelAnimationFrame(t), setTimeout(r);
|
17523
17520
|
}, a = setTimeout(e, 100);
|
17524
|
-
|
17521
|
+
on && (t = requestAnimationFrame(e));
|
17525
17522
|
}
|
17526
17523
|
function we(r) {
|
17527
17524
|
var t = st, e = r.__c;
|
17528
17525
|
typeof e == "function" && (r.__c = void 0, e()), st = t;
|
17529
17526
|
}
|
17530
|
-
function
|
17527
|
+
function Aa(r) {
|
17531
17528
|
var t = st;
|
17532
17529
|
r.__c = r.__(), st = t;
|
17533
17530
|
}
|
@@ -17553,7 +17550,7 @@ const or = w`
|
|
17553
17550
|
}
|
17554
17551
|
missingComponentTypes
|
17555
17552
|
}
|
17556
|
-
`,
|
17553
|
+
`, Fa = w`
|
17557
17554
|
${or}
|
17558
17555
|
fragment AddressValidationJobFields on AddressValidationJob {
|
17559
17556
|
id
|
@@ -17566,14 +17563,14 @@ const or = w`
|
|
17566
17563
|
}
|
17567
17564
|
}
|
17568
17565
|
`, rc = w`
|
17569
|
-
${
|
17566
|
+
${Fa}
|
17570
17567
|
query GetAddressValidationJobs($ids: [String!]!) {
|
17571
17568
|
addressValidationJobs(ids: $ids) {
|
17572
17569
|
...AddressValidationJobFields
|
17573
17570
|
}
|
17574
17571
|
}
|
17575
17572
|
`, ic = w`
|
17576
|
-
${
|
17573
|
+
${Fa}
|
17577
17574
|
query GetRecipientsWithAddressValidationJobs($ids: [String!]!) {
|
17578
17575
|
recipients(ids: $ids) {
|
17579
17576
|
id
|
@@ -17590,7 +17587,7 @@ const or = w`
|
|
17590
17587
|
}
|
17591
17588
|
}
|
17592
17589
|
`, oc = w`
|
17593
|
-
${
|
17590
|
+
${Fa}
|
17594
17591
|
mutation BatchValidateRecipientAddress($ids: [String!]!) {
|
17595
17592
|
recipientValidateBatch(ids: $ids) {
|
17596
17593
|
...AddressValidationJobFields
|
@@ -17660,21 +17657,21 @@ const Td = async (r) => {
|
|
17660
17657
|
})).data?.recipientOverrideAddress?.id && (r.getWorkflowManager().getTransaction().addressValidationStatus = An.Overridden);
|
17661
17658
|
};
|
17662
17659
|
export {
|
17663
|
-
|
17660
|
+
ha as AddonHandle,
|
17664
17661
|
dc as AddressValidationJobStatus,
|
17665
17662
|
cc as AddressValidationResultConfirmationLevel,
|
17666
17663
|
An as AddressValidationStatus,
|
17667
17664
|
md as ArrayInput,
|
17668
17665
|
U as AspectType,
|
17669
17666
|
bt as AssetNotFoundError,
|
17670
|
-
|
17667
|
+
Se as AssetType,
|
17671
17668
|
od as BringForwardCommand,
|
17672
17669
|
sd as BringToBackCommand,
|
17673
17670
|
id as BringToFrontCommand,
|
17674
17671
|
Br as BundleDesignCreationCartAddMode,
|
17675
17672
|
N as CanvasCommand,
|
17676
17673
|
Ae as CollectionProduct,
|
17677
|
-
|
17674
|
+
_a as ColorOptionGlobalPropertyHandle,
|
17678
17675
|
As as CommandContext,
|
17679
17676
|
Ce as ConversionDataType,
|
17680
17677
|
ec as ConversionLocation,
|
@@ -17691,23 +17688,23 @@ export {
|
|
17691
17688
|
gs as FontAlignmentCommand,
|
17692
17689
|
hs as FontColorCommand,
|
17693
17690
|
ms as FontSizeCommand,
|
17694
|
-
|
17691
|
+
qa as FontSourceCommand,
|
17695
17692
|
Wl as FrameService,
|
17696
17693
|
ql as FrameStep,
|
17697
17694
|
jl as FrameStepHandle,
|
17698
|
-
|
17695
|
+
Ia as GlobalPropertyHandle,
|
17699
17696
|
R as GroupCommand,
|
17700
17697
|
vo as IllustrationStepHandle,
|
17701
|
-
|
17698
|
+
Ue as InformationMessageType,
|
17702
17699
|
Fo as InformationStepHandle,
|
17703
|
-
|
17700
|
+
Xa as IntegrationProduct,
|
17704
17701
|
Pr as IntegrationType,
|
17705
17702
|
td as LayoutElementFactory,
|
17706
17703
|
x as LayoutElementType,
|
17707
17704
|
Y as LayoutNotFoundError,
|
17708
17705
|
Ht as LayoutRenderingPurpose,
|
17709
17706
|
Eo as MaterialStepHandle,
|
17710
|
-
|
17707
|
+
be as MisconfigurationError,
|
17711
17708
|
Sd as MockWorkflowManager,
|
17712
17709
|
bo as ModelStepHandle,
|
17713
17710
|
ko as ModuleStepHandle,
|
@@ -17715,7 +17712,7 @@ export {
|
|
17715
17712
|
rr as ObjectInput,
|
17716
17713
|
xl as ObjectInputType,
|
17717
17714
|
er as OptionGlobalPropertyHandle,
|
17718
|
-
|
17715
|
+
Ee as OptionNotFoundError,
|
17719
17716
|
Dt as ParseError,
|
17720
17717
|
Bo as PictureStepHandle,
|
17721
17718
|
Dr as ProductCameraRig,
|
@@ -17734,7 +17731,7 @@ export {
|
|
17734
17731
|
Po as ShapeStepHandle,
|
17735
17732
|
Ir as ShareActionType,
|
17736
17733
|
pd as SpiffCommerceClient,
|
17737
|
-
|
17734
|
+
ve as StakeholderType,
|
17738
17735
|
br as StepAspectType,
|
17739
17736
|
Z as StepHandle,
|
17740
17737
|
v as StepType,
|
@@ -17757,7 +17754,7 @@ export {
|
|
17757
17754
|
Oo as createDesign,
|
17758
17755
|
Jc as currentDirection,
|
17759
17756
|
Oc as dataUrlFromExternalUrl,
|
17760
|
-
|
17757
|
+
_e as designService,
|
17761
17758
|
fe as determineCorrectFontSizeAndLines,
|
17762
17759
|
qn as digitalContentStepService,
|
17763
17760
|
dt as domParser,
|
@@ -17774,14 +17771,14 @@ export {
|
|
17774
17771
|
ot as generateSVGWithUnknownColors,
|
17775
17772
|
Ad as generateStateFromDesignInputSteps,
|
17776
17773
|
Nd as getAddressValidationJobs,
|
17777
|
-
|
17774
|
+
Qe as getAttributesFromArrayBuffer,
|
17778
17775
|
Vc as getAxisAlignedBoundingBox,
|
17779
17776
|
Gl as getBoundedOffsets,
|
17780
17777
|
wd as getBundleThemeConfiguration,
|
17781
17778
|
Id as getCustomer,
|
17782
17779
|
Pd as getCustomerBundles,
|
17783
17780
|
Kc as getElementVertices,
|
17784
|
-
|
17781
|
+
$e as getFrameData,
|
17785
17782
|
cd as getGlobalPropertyStateForBundle,
|
17786
17783
|
zl as getIntegration,
|
17787
17784
|
Hc as getNEPoint,
|
@@ -17791,7 +17788,7 @@ export {
|
|
17791
17788
|
qc as getPointOfRotation,
|
17792
17789
|
ud as getProductCollections,
|
17793
17790
|
Yc as getSEPoint,
|
17794
|
-
|
17791
|
+
Sa as getSvgElement,
|
17795
17792
|
Md as getTemplateBundles,
|
17796
17793
|
kd as getTemplateTransactions,
|
17797
17794
|
fd as getTransaction,
|
@@ -17811,7 +17808,7 @@ export {
|
|
17811
17808
|
Cl as metafieldManager,
|
17812
17809
|
_c as mmPerPixel,
|
17813
17810
|
Hn as modelStepService,
|
17814
|
-
|
17811
|
+
wa as modifySVGColors,
|
17815
17812
|
Yn as moduleStepService,
|
17816
17813
|
vd as nameBundle,
|
17817
17814
|
Ed as nameTransaction,
|
@@ -17825,19 +17822,19 @@ export {
|
|
17825
17822
|
Kn as questionStepService,
|
17826
17823
|
Rc as registerFetchImplementation,
|
17827
17824
|
Qc as registerWindowImplementation,
|
17828
|
-
|
17825
|
+
Ga as rehydrateSerializedLayout,
|
17829
17826
|
Xr as rgbToPms,
|
17830
17827
|
ce as rotateAroundPoint,
|
17831
|
-
|
17828
|
+
fa as sanitizeSvgTree,
|
17832
17829
|
Gr as setBearerAuthenticationToken,
|
17833
17830
|
Cn as setCanvasModule,
|
17834
17831
|
zt as shapeStepService,
|
17835
17832
|
ys as shortenUrl,
|
17836
17833
|
gt as spiffCoreConfiguration,
|
17837
17834
|
dd as stepAspectValuesToDesignInputSteps,
|
17838
|
-
|
17835
|
+
$a as svgColorValueToDefinition,
|
17839
17836
|
Vn as svgStringDimensions,
|
17840
|
-
|
17837
|
+
ma as svgToDataUrl,
|
17841
17838
|
G as textStepService,
|
17842
17839
|
xs as toast,
|
17843
17840
|
Qd as validateWorkflowExperienceRecipient,
|