@spiffcommerce/core 32.4.0-beta.a1f69100-8b64-5ab1-b13d-d042fc2f8765 → 32.4.0-beta.c54c71e8-d20e-5f9e-b388-dfd7c32e1052
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.d.ts +1 -0
- package/dist/index.js +36 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +188 -175
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -18,44 +18,44 @@ import Ma from "lodash.chunk";
|
|
18
18
|
import { CognitoIdentityProviderClient as Er, InitiateAuthCommand as Ta, RespondToAuthChallengeCommand as br } from "@aws-sdk/client-cognito-identity-provider";
|
19
19
|
import Br from "dinero.js";
|
20
20
|
import * as Na from "currency-codes";
|
21
|
-
import
|
21
|
+
import jt from "lodash.isequal";
|
22
22
|
import { split as na } from "unicode-default-word-boundary";
|
23
23
|
import un from "lodash.debounce";
|
24
24
|
import "fs";
|
25
25
|
import "path";
|
26
26
|
import Ir from "lodash.omit";
|
27
|
-
var ve = /* @__PURE__ */ ((n) => (n.Data = "Data", n.Font = "Font", n.Frame = "Frame", n.Illustration = "Illustration", n.Image = "Image", n.Model = "Model", n.Material = "Material", n.Color = "Color", n.QuestionnaireCollateral = "QuestionnaireCollateral", n.RequestCollateral = "RequestCollateral", n.SignupCollateral = "SignupCollateral", n.Video = "Video", n.ColorProfile = "ColorProfile", n.Environment = "Environment", n))(ve || {}), U = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(U || {}), v = /* @__PURE__ */ ((n) => (n.Information = "Information", n.Bulk = "Bulk", n.DigitalContent = "DigitalContent", n.Finish = "Finish", n.Frame = "Frame", n.Illustration = "Illustration", n.Introduction = "Introduction", n.Material = "Material", n.Model = "Model", n.Module = "Module", n.Picture = "Picture", n.Photo = "Photo", n.ProductOverlay = "ProductOverlay", n.Question = "Question", n.Shape = "Shape", n.SilentIllustration = "SilentIllustration", n.Text = "Text", n))(v || {}), Pr = /* @__PURE__ */ ((n) => (n.Color = "Color", n.Colors = "Colors", n.Selection = "Selection", n.Selections = "Selections", n.Text = "Text", n.Upload = "Upload", n))(Pr || {}),
|
27
|
+
var ve = /* @__PURE__ */ ((n) => (n.Data = "Data", n.Font = "Font", n.Frame = "Frame", n.Illustration = "Illustration", n.Image = "Image", n.Model = "Model", n.Material = "Material", n.Color = "Color", n.QuestionnaireCollateral = "QuestionnaireCollateral", n.RequestCollateral = "RequestCollateral", n.SignupCollateral = "SignupCollateral", n.Video = "Video", n.ColorProfile = "ColorProfile", n.Environment = "Environment", n))(ve || {}), U = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(U || {}), v = /* @__PURE__ */ ((n) => (n.Information = "Information", n.Bulk = "Bulk", n.DigitalContent = "DigitalContent", n.Finish = "Finish", n.Frame = "Frame", n.Illustration = "Illustration", n.Introduction = "Introduction", n.Material = "Material", n.Model = "Model", n.Module = "Module", n.Picture = "Picture", n.Photo = "Photo", n.ProductOverlay = "ProductOverlay", n.Question = "Question", n.Shape = "Shape", n.SilentIllustration = "SilentIllustration", n.Text = "Text", n))(v || {}), Pr = /* @__PURE__ */ ((n) => (n.Color = "Color", n.Colors = "Colors", n.Selection = "Selection", n.Selections = "Selections", n.Text = "Text", n.Upload = "Upload", n))(Pr || {}), Yt = /* @__PURE__ */ ((n) => (n.ThreeD = "ThreeD", n.FreeDesign = "FreeDesign", n.Print = "Print", n))(Yt || {}), x = /* @__PURE__ */ ((n) => (n.Frame = "frame", n.Group = "group", n.Image = "image", n.Pattern = "pattern", n.Illustration = "illustration", n.Textbox = "textbox", n))(x || {}), Dr = /* @__PURE__ */ ((n) => (n.Default = "Default", n.FirstTransaction = "FirstTransaction", n.OneToOne = "OneToOne", n))(Dr || {}), hn = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Failed = "Failed", n.Validated = "Validated", n.Overridden = "Overridden", n))(hn || {}), Fr = /* @__PURE__ */ ((n) => (n.Hyperlink = "Hyperlink", n.Edit = "Edit", n.Approve = "Approve", n))(Fr || {}), xr = /* @__PURE__ */ ((n) => (n.Hub = "Hub", n.Shopify = "Shopify", n))(xr || {}), ga = /* @__PURE__ */ ((n) => (n.BackgroundRemover = "BackgroundRemover", n.ConversionAccelerator = "Conversion Accelerator", n.ProcessBuilder = "ProcessBuilder", n))(ga || {}), kr = /* @__PURE__ */ ((n) => (n[n.Orbit = 0] = "Orbit", n[n.Pan = 1] = "Pan", n))(kr || {}), Ee = /* @__PURE__ */ ((n) => (n.Owner = "Owner", n.Approver = "Approver", n.Editor = "Editor", n.Viewer = "Viewer", n))(Ee || {}), Mt = /* @__PURE__ */ ((n) => (n.Autosize = "Autosize", n.Traditional = "Traditional", n))(Mt || {}), H = /* @__PURE__ */ ((n) => (n[n.North = 0] = "North", n[n.Northeast = 1] = "Northeast", n[n.East = 2] = "East", n[n.Southeast = 3] = "Southeast", n[n.South = 4] = "South", n[n.Southwest = 5] = "Southwest", n[n.West = 6] = "West", n[n.Northwest = 7] = "Northwest", n))(H || {}), Mr = /* @__PURE__ */ ((n) => (n.Pixel = "px", n.Millimeter = "mm", n.Centimeter = "cm", n))(Mr || {});
|
28
28
|
class mn extends Error {
|
29
29
|
constructor(t) {
|
30
30
|
super(t), this.name = this.constructor.name;
|
31
31
|
}
|
32
32
|
}
|
33
|
-
class
|
33
|
+
class Zt extends mn {
|
34
34
|
constructor(t) {
|
35
35
|
super(`ConfigurationError - ${t}`);
|
36
36
|
}
|
37
37
|
}
|
38
|
-
class be extends
|
38
|
+
class be extends Zt {
|
39
39
|
constructor(t) {
|
40
40
|
super(`Option not Configured: ${t.stepTitle}`), this.optionId = t?.optionId || "N/A";
|
41
41
|
}
|
42
42
|
}
|
43
|
-
class Y extends
|
43
|
+
class Y extends Zt {
|
44
44
|
constructor(t) {
|
45
45
|
super(`Panel not Found: ${t.panelId}`), this.panelId = t?.panelId || "N/A";
|
46
46
|
}
|
47
47
|
}
|
48
|
-
class bt extends
|
48
|
+
class bt extends Zt {
|
49
49
|
constructor(t) {
|
50
50
|
super(`Asset not found for variant: ${t.name}`), this.variant = t;
|
51
51
|
}
|
52
52
|
}
|
53
|
-
class
|
53
|
+
class Jt extends Zt {
|
54
54
|
constructor(t) {
|
55
55
|
super(`Resource not found for asset: ${t.name}`), this.asset = t;
|
56
56
|
}
|
57
57
|
}
|
58
|
-
class Be extends
|
58
|
+
class Be extends Zt {
|
59
59
|
constructor(t, e) {
|
60
60
|
super(`Workflow Misconfiguration: ${t.stepName} - ${e}`), this.step = t;
|
61
61
|
}
|
@@ -169,7 +169,7 @@ function zc(n) {
|
|
169
169
|
function Gc(n) {
|
170
170
|
ia = n;
|
171
171
|
}
|
172
|
-
function
|
172
|
+
function te() {
|
173
173
|
return ra ? new ra().window : (console.log(
|
174
174
|
"DOM constructor is not registered. Assuming browser environment. If not, please register DOM constructor before calling this function."
|
175
175
|
), window);
|
@@ -197,17 +197,17 @@ const gn = /* @__PURE__ */ new Map(), Ra = /* @__PURE__ */ new Map(), Oa = /* @_
|
|
197
197
|
if (t) return t;
|
198
198
|
const a = (async () => await (await rt(n)).text())();
|
199
199
|
return Oa.set(n, a), a;
|
200
|
-
}, Tt = (n) => n.every((t) => t !== "undefined"),
|
200
|
+
}, Tt = (n) => n.every((t) => t !== "undefined"), se = (n) => Tt([typeof document]) ? document.createElement(n) : te().document.createElement(n), Or = (n, t) => {
|
201
201
|
if (Tt([typeof document]))
|
202
202
|
return document.createElementNS(n, t);
|
203
|
-
const a =
|
203
|
+
const a = te().document.createElement(t);
|
204
204
|
return a.setAttribute("xmlns", n), a;
|
205
205
|
}, dt = () => {
|
206
206
|
if (Tt([typeof DOMParser]))
|
207
207
|
return new DOMParser();
|
208
|
-
const n =
|
208
|
+
const n = te();
|
209
209
|
return new n.DOMParser();
|
210
|
-
}, $r = () => Tt([typeof DOMParser]) ? DOMParser :
|
210
|
+
}, $r = () => Tt([typeof DOMParser]) ? DOMParser : te().DOMParser, Ne = (n, t) => new Promise((e, a) => {
|
211
211
|
t ? pn(n).then(e).catch(a) : rt(n).then((r) => {
|
212
212
|
r.arrayBuffer().then(e).catch(a);
|
213
213
|
}).catch((r) => {
|
@@ -229,7 +229,7 @@ const gn = /* @__PURE__ */ new Map(), Ra = /* @__PURE__ */ new Map(), Oa = /* @_
|
|
229
229
|
}, It = () => {
|
230
230
|
if (Tt([typeof XMLSerializer]))
|
231
231
|
return new XMLSerializer();
|
232
|
-
const n =
|
232
|
+
const n = te();
|
233
233
|
return new n.XMLSerializer();
|
234
234
|
}, $a = (n) => btoa(n), Qe = (n) => {
|
235
235
|
function t() {
|
@@ -375,7 +375,7 @@ const pt = (n, t, e) => {
|
|
375
375
|
} catch {
|
376
376
|
throw new Error("Canvas module not set");
|
377
377
|
}
|
378
|
-
},
|
378
|
+
}, ee = (n, t) => {
|
379
379
|
if (sa !== void 0)
|
380
380
|
return sa(n, t);
|
381
381
|
try {
|
@@ -411,21 +411,21 @@ let ze;
|
|
411
411
|
function Ca() {
|
412
412
|
return ze === void 0 && (ze = $r()), ze;
|
413
413
|
}
|
414
|
-
let
|
414
|
+
let le = null;
|
415
415
|
const _r = (n) => new Promise((t) => {
|
416
416
|
if (Qe(n) !== "image/jpeg")
|
417
417
|
return t(1);
|
418
418
|
Cr(n).then((a) => t(a || 1)).catch(() => t(1));
|
419
419
|
}), Xr = async () => {
|
420
|
-
if (
|
421
|
-
return !
|
422
|
-
const t = await
|
423
|
-
return
|
420
|
+
if (le !== null)
|
421
|
+
return !le;
|
422
|
+
const t = await ee("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAIAAwMBEQACEQEDEQH/xABRAAEAAAAAAAAAAAAAAAAAAAAKEAEBAQADAQEAAAAAAAAAAAAGBQQDCAkCBwEBAAAAAAAAAAAAAAAAAAAAABEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AG8T9NfSMEVMhQvoP3fFiRZ+MTHDifa/95OFSZU5OzRzxkyejv8ciEfhSceSXGjS8eSdLnZc2HDm4M3BxcXwH/9k=");
|
423
|
+
return le = t.width === 2 && t.height === 3, !le;
|
424
424
|
}, Zr = (n) => {
|
425
425
|
const e = n.naturalWidth / n.naturalHeight;
|
426
426
|
return n.naturalHeight <= 8192 && n.naturalWidth <= 8192 ? [n.naturalWidth, n.naturalHeight] : n.naturalHeight > n.naturalWidth ? [e * 8192, 8192] : [8192, 8192 / e];
|
427
427
|
}, ti = async (n) => {
|
428
|
-
const t = await Vr(n), e = await
|
428
|
+
const t = await Vr(n), e = await ee(t), [a, r] = Zr(e);
|
429
429
|
if (!await Xr()) {
|
430
430
|
const A = pt(a, r);
|
431
431
|
return A.getContext("2d")?.drawImage(e, 0, 0, a, r), A;
|
@@ -466,7 +466,7 @@ const _r = (n) => new Promise((t) => {
|
|
466
466
|
height: t.height,
|
467
467
|
width: t.width
|
468
468
|
};
|
469
|
-
},
|
469
|
+
}, Kt = [
|
470
470
|
"Yellow C",
|
471
471
|
"Yellow 012 C",
|
472
472
|
"Orange 021 C",
|
@@ -3156,12 +3156,12 @@ const _r = (n) => new Promise((t) => {
|
|
3156
3156
|
parseInt(n.substring(4, 6), 16)
|
3157
3157
|
]);
|
3158
3158
|
function qc(n) {
|
3159
|
-
const t =
|
3159
|
+
const t = Kt.indexOf(n);
|
3160
3160
|
return t >= 0 ? xt[t] : "";
|
3161
3161
|
}
|
3162
3162
|
function ei(n) {
|
3163
3163
|
const t = xt.indexOf(n);
|
3164
|
-
return t >= 0 ?
|
3164
|
+
return t >= 0 ? Kt[t] : "";
|
3165
3165
|
}
|
3166
3166
|
function Hc(n, t = 64) {
|
3167
3167
|
const e = [], a = [], r = ei(n);
|
@@ -3178,10 +3178,10 @@ function Hc(n, t = 64) {
|
|
3178
3178
|
a.push(u);
|
3179
3179
|
}
|
3180
3180
|
for (let A = 0; A < a.length; A++)
|
3181
|
-
a[A] <= t && !e.some((u) => u.pms ===
|
3181
|
+
a[A] <= t && !e.some((u) => u.pms === Kt[A]) && e.push({ pms: Kt[A], hex: xt[A], distance: a[A] });
|
3182
3182
|
return e.sort((A, u) => A.distance - u.distance);
|
3183
3183
|
}
|
3184
|
-
const ai =
|
3184
|
+
const ai = Kt.map((n, t) => ({ pms: n, hex: xt[t] })), ni = new wr(ai, { keys: ["pms"] });
|
3185
3185
|
function jc(n, t) {
|
3186
3186
|
return ni.search(n, t ? { limit: t } : void 0);
|
3187
3187
|
}
|
@@ -3201,7 +3201,7 @@ function Ua(n) {
|
|
3201
3201
|
const t = n.substring(1).toUpperCase();
|
3202
3202
|
return t.length === 6 ? t : t.length === 3 ? `${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}` : "";
|
3203
3203
|
}
|
3204
|
-
const
|
3204
|
+
const ce = (n) => {
|
3205
3205
|
const t = vn(n.spotColor);
|
3206
3206
|
return t ? `${n.browserValue} ${t}` : n.browserValue;
|
3207
3207
|
}, vn = (n) => {
|
@@ -3299,13 +3299,13 @@ const le = (n) => {
|
|
3299
3299
|
if (s)
|
3300
3300
|
a.setAttribute(
|
3301
3301
|
"fill",
|
3302
|
-
e ?
|
3302
|
+
e ? ce(s) : s.browserValue
|
3303
3303
|
);
|
3304
3304
|
else {
|
3305
3305
|
const l = t[o];
|
3306
3306
|
l && a.setAttribute(
|
3307
3307
|
"fill",
|
3308
|
-
e ?
|
3308
|
+
e ? ce(l) : l.browserValue
|
3309
3309
|
);
|
3310
3310
|
}
|
3311
3311
|
}
|
@@ -3317,13 +3317,13 @@ const le = (n) => {
|
|
3317
3317
|
if (s)
|
3318
3318
|
a.setAttribute(
|
3319
3319
|
"stroke",
|
3320
|
-
e ?
|
3320
|
+
e ? ce(s) : s.browserValue
|
3321
3321
|
);
|
3322
3322
|
else {
|
3323
3323
|
const l = t[o];
|
3324
3324
|
l && a.setAttribute(
|
3325
3325
|
"fill",
|
3326
|
-
e ?
|
3326
|
+
e ? ce(l) : l.browserValue
|
3327
3327
|
);
|
3328
3328
|
}
|
3329
3329
|
}
|
@@ -3373,7 +3373,7 @@ const le = (n) => {
|
|
3373
3373
|
value
|
3374
3374
|
}
|
3375
3375
|
}
|
3376
|
-
`,
|
3376
|
+
`, ae = (n) => w`
|
3377
3377
|
${n && Ai || ""}
|
3378
3378
|
fragment AssetFields on Asset {
|
3379
3379
|
name
|
@@ -3417,7 +3417,7 @@ const le = (n) => {
|
|
3417
3417
|
${n && "...AssetMetadataFields" || ""}
|
3418
3418
|
}
|
3419
3419
|
`, ui = w`
|
3420
|
-
${
|
3420
|
+
${ae(!1)}
|
3421
3421
|
query GetAssets($keys: [String]!) {
|
3422
3422
|
assets(keys: $keys) {
|
3423
3423
|
...AssetFields
|
@@ -3492,7 +3492,7 @@ const le = (n) => {
|
|
3492
3492
|
}
|
3493
3493
|
}
|
3494
3494
|
`, gi = w`
|
3495
|
-
${
|
3495
|
+
${ae(!1)}
|
3496
3496
|
mutation RemoveBackgroundFromAsset($key: String!) {
|
3497
3497
|
assetRemoveBackground(key: $key) {
|
3498
3498
|
...AssetFields
|
@@ -3812,7 +3812,7 @@ class wi {
|
|
3812
3812
|
this.disabled = t;
|
3813
3813
|
}
|
3814
3814
|
}
|
3815
|
-
const
|
3815
|
+
const _t = new wi(), In = w`
|
3816
3816
|
fragment OptionFields on Option {
|
3817
3817
|
id
|
3818
3818
|
name
|
@@ -3850,7 +3850,7 @@ const Kt = new wi(), In = w`
|
|
3850
3850
|
}
|
3851
3851
|
}
|
3852
3852
|
`, yi = w`
|
3853
|
-
${
|
3853
|
+
${ae(!1)}
|
3854
3854
|
${va}
|
3855
3855
|
${In}
|
3856
3856
|
query GetOptions($ids: [String]!) {
|
@@ -3872,11 +3872,11 @@ const Kt = new wi(), In = w`
|
|
3872
3872
|
});
|
3873
3873
|
}), t.data.options;
|
3874
3874
|
}, vi = async (n, t) => (await t).find((a) => a.id === n), Ei = async (n) => {
|
3875
|
-
const t = n.map((o) =>
|
3875
|
+
const t = n.map((o) => _t.get({ id: o })), e = n.filter((o, s) => t[s] === void 0);
|
3876
3876
|
if (e.length === 0)
|
3877
3877
|
return Promise.all(t);
|
3878
3878
|
const a = Si(e), r = e.map(
|
3879
|
-
(o) =>
|
3879
|
+
(o) => _t.set({ id: o }, vi(o, a))
|
3880
3880
|
), i = t.filter((o) => o !== void 0);
|
3881
3881
|
return await Promise.all(i.concat(r));
|
3882
3882
|
};
|
@@ -4588,7 +4588,7 @@ const j = new bi(), Pn = w`
|
|
4588
4588
|
name
|
4589
4589
|
}
|
4590
4590
|
`, Li = (n) => w`
|
4591
|
-
${
|
4591
|
+
${ae(n)}
|
4592
4592
|
${va}
|
4593
4593
|
${In}
|
4594
4594
|
${Ri}
|
@@ -5008,7 +5008,7 @@ const j = new bi(), Pn = w`
|
|
5008
5008
|
}
|
5009
5009
|
}
|
5010
5010
|
`, zi = w`
|
5011
|
-
${
|
5011
|
+
${ae(!1)}
|
5012
5012
|
query GetWorkflowForTheme($id: String!) {
|
5013
5013
|
workflow(id: $id) {
|
5014
5014
|
id
|
@@ -5342,7 +5342,7 @@ const M = () => {
|
|
5342
5342
|
viewBox: A,
|
5343
5343
|
width: u
|
5344
5344
|
}) => {
|
5345
|
-
const h = e || 0, m = 2 * (l?.scale || 1), p = A || { x: 0, y: 0, width: u, height: i }, g = `${p.x} ${p.y} ${p.width} ${p.height}`, f = M(), S = a.purpose ===
|
5345
|
+
const h = e || 0, m = 2 * (l?.scale || 1), p = A || { x: 0, y: 0, width: u, height: i }, g = `${p.x} ${p.y} ${p.width} ${p.height}`, f = M(), S = a.purpose === Yt.FreeDesign && /* @__PURE__ */ D("defs", { children: /* @__PURE__ */ D("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ D("rect", { width: p.width, height: p.height, rx: h }) }) }), B = a.colorProfiles?.map((E, P) => (
|
5346
5346
|
/* @ts-ignore */
|
5347
5347
|
/* @__PURE__ */ D("color-profile", { name: E.name, xlinkHref: E.key, children: " " }, P)
|
5348
5348
|
)), I = r.map((E) => ({
|
@@ -5385,7 +5385,7 @@ const M = () => {
|
|
5385
5385
|
"g",
|
5386
5386
|
{
|
5387
5387
|
id: "element-group",
|
5388
|
-
clipPath: a.purpose ===
|
5388
|
+
clipPath: a.purpose === Yt.FreeDesign ? "url(#viewboxClip)" : void 0,
|
5389
5389
|
children: C.map((E) => Vn(E)).filter((E) => !!E)
|
5390
5390
|
}
|
5391
5391
|
),
|
@@ -5493,13 +5493,13 @@ const M = () => {
|
|
5493
5493
|
y: s.y - n.height * e.y / 2
|
5494
5494
|
};
|
5495
5495
|
return {
|
5496
|
-
a:
|
5497
|
-
b:
|
5498
|
-
c:
|
5499
|
-
d:
|
5496
|
+
a: de(r, l, a),
|
5497
|
+
b: de(i, l, a),
|
5498
|
+
c: de(o, l, a),
|
5499
|
+
d: de(s, l, a),
|
5500
5500
|
center: l
|
5501
5501
|
};
|
5502
|
-
},
|
5502
|
+
}, de = (n, t, e) => {
|
5503
5503
|
const a = Math.sin(e), r = Math.cos(e);
|
5504
5504
|
return {
|
5505
5505
|
x: (n.x - t.x) * r - (n.y - t.y) * a + t.x,
|
@@ -5766,7 +5766,7 @@ const ao = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", We = /* @_
|
|
5766
5766
|
const o = (i || Un) * r.getApproximateHeight(), s = t.split(`
|
5767
5767
|
`);
|
5768
5768
|
try {
|
5769
|
-
const l = s.flatMap((d) =>
|
5769
|
+
const l = s.flatMap((d) => fe(d, n.width, a, r)), c = l.flatMap((d) => d.lines);
|
5770
5770
|
return {
|
5771
5771
|
lines: c,
|
5772
5772
|
requiredHeight: l.flatMap((d) => d.lines).length * (a * o),
|
@@ -5782,14 +5782,14 @@ const ao = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", We = /* @_
|
|
5782
5782
|
requiredWidth: Pe(c, n.width, a, r)
|
5783
5783
|
};
|
5784
5784
|
}
|
5785
|
-
},
|
5785
|
+
}, fe = (n, t, e, a) => {
|
5786
5786
|
const r = mt(n, e, a);
|
5787
5787
|
if (r <= t)
|
5788
5788
|
return { lines: [n], width: r };
|
5789
5789
|
if (!(n.indexOf(" ") > -1)) {
|
5790
5790
|
if (n.length <= 1)
|
5791
5791
|
throw new Error(`Character ${n} is wider than region`);
|
5792
|
-
const d = Math.floor(n.length / 2), A =
|
5792
|
+
const d = Math.floor(n.length / 2), A = fe(n.slice(0, d), t, e, a), u = fe(n.slice(d), t, e, a);
|
5793
5793
|
return { lines: [...A.lines, ...u.lines], width: Math.max(A.width, u.width) };
|
5794
5794
|
}
|
5795
5795
|
const o = n.split(" "), s = [];
|
@@ -5797,7 +5797,7 @@ const ao = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", We = /* @_
|
|
5797
5797
|
for (; c < o.length; ) {
|
5798
5798
|
const d = o[c];
|
5799
5799
|
if (mt(d, e, a) > t) {
|
5800
|
-
const A =
|
5800
|
+
const A = fe(d, t, e, a);
|
5801
5801
|
s.push(...A.lines), l = Math.max(l, A.width), c++;
|
5802
5802
|
} else {
|
5803
5803
|
const A = [d];
|
@@ -5874,7 +5874,7 @@ const ao = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", We = /* @_
|
|
5874
5874
|
let a = n || "";
|
5875
5875
|
return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
|
5876
5876
|
`)), a;
|
5877
|
-
}, lo = (n, t) => n.map((e, a) => [e, t[a]]), co = (n = "center", t = !1) => t ? "center" : n, $n = (n) => n === "left" ? "start" : n === "right" ? "end" : "middle",
|
5877
|
+
}, lo = (n, t) => n.map((e, a) => [e, t[a]]), co = (n = "center", t = !1) => t ? "center" : n, $n = (n) => n === "left" ? "start" : n === "right" ? "end" : "middle", ne = (n, t, e) => n.fontData ? {
|
5878
5878
|
...n,
|
5879
5879
|
...(() => {
|
5880
5880
|
if (n.algorithm === Mt.Traditional) {
|
@@ -6187,7 +6187,7 @@ function ba(n) {
|
|
6187
6187
|
return i < o ? -1 : i > o ? 1 : 0;
|
6188
6188
|
});
|
6189
6189
|
}
|
6190
|
-
const
|
6190
|
+
const re = (n) => {
|
6191
6191
|
const t = n.variants;
|
6192
6192
|
if (t) {
|
6193
6193
|
if (t.length === 1)
|
@@ -6210,7 +6210,7 @@ const ne = (n) => {
|
|
6210
6210
|
}, po = (n, t) => {
|
6211
6211
|
if (!t)
|
6212
6212
|
return;
|
6213
|
-
const e = t.variants?.find((a) => a.id === n.frameVariantId) ||
|
6213
|
+
const e = t.variants?.find((a) => a.id === n.frameVariantId) || re(t);
|
6214
6214
|
if (!e)
|
6215
6215
|
throw new Error(`No variant with ID: ${n.frameVariantId}`);
|
6216
6216
|
if (!e.asset)
|
@@ -6315,7 +6315,7 @@ const ne = (n) => {
|
|
6315
6315
|
nt(n).then((e) => {
|
6316
6316
|
t(e);
|
6317
6317
|
}).catch((e) => console.error(e));
|
6318
|
-
}), je = /* @__PURE__ */ new Map(),
|
6318
|
+
}), je = /* @__PURE__ */ new Map(), Xt = async (n) => {
|
6319
6319
|
if (je.has(n))
|
6320
6320
|
return je.get(n);
|
6321
6321
|
const t = async (r) => new Promise((i, o) => {
|
@@ -6337,7 +6337,7 @@ const ne = (n) => {
|
|
6337
6337
|
anonymousCrossOrigin: !0,
|
6338
6338
|
ignoreDimensions: !1,
|
6339
6339
|
createCanvas: pt,
|
6340
|
-
createImage:
|
6340
|
+
createImage: ee,
|
6341
6341
|
DOMParser: Ca(),
|
6342
6342
|
fetch: rt
|
6343
6343
|
}), u = o.getAttribute("width"), h = o.getAttribute("height"), m = 2048;
|
@@ -6434,7 +6434,7 @@ class sd {
|
|
6434
6434
|
}), A = e.region || await Ut(t, x.Textbox, r, {
|
6435
6435
|
text: d,
|
6436
6436
|
fontScale: a.size ? a.size / o.unitsPerEm : void 0
|
6437
|
-
}), u =
|
6437
|
+
}), u = ne(
|
6438
6438
|
{
|
6439
6439
|
id: M(),
|
6440
6440
|
type: x.Textbox,
|
@@ -6515,7 +6515,7 @@ class sd {
|
|
6515
6515
|
};
|
6516
6516
|
}
|
6517
6517
|
static async getIllustration(t, e) {
|
6518
|
-
const a = e.region || await Ut(t, x.Illustration, e.src), r = await st(await Wn(e.src)), i = await
|
6518
|
+
const a = e.region || await Ut(t, x.Illustration, e.src), r = await st(await Wn(e.src)), i = await Xt(r.svg), o = M();
|
6519
6519
|
return {
|
6520
6520
|
cachedObjectURL: i,
|
6521
6521
|
stepRegion: e.region,
|
@@ -6588,7 +6588,7 @@ const $ = (n, t) => _(n, t).elements.find((r) => r.id === n), _ = (n, t) => {
|
|
6588
6588
|
const s = r[o];
|
6589
6589
|
if (s.src && s.svg)
|
6590
6590
|
try {
|
6591
|
-
s.cachedObjectURL = await
|
6591
|
+
s.cachedObjectURL = await Xt(s.svg);
|
6592
6592
|
} catch (l) {
|
6593
6593
|
console.log(l);
|
6594
6594
|
}
|
@@ -6687,7 +6687,7 @@ class dd extends N {
|
|
6687
6687
|
o.scaleX = o.scaleX * this.width / e.width, o.scaleY = o.scaleY * this.height / e.height;
|
6688
6688
|
} else if (e.type === "textbox") {
|
6689
6689
|
const o = a, s = (!o.algorithm || o.algorithm === Mt.Autosize ? o.text : o.input) ?? "";
|
6690
|
-
a =
|
6690
|
+
a = ne(o, s, e);
|
6691
6691
|
}
|
6692
6692
|
const r = _(e.id, Object.values(t.layouts)), i = X(a, r);
|
6693
6693
|
return {
|
@@ -6864,7 +6864,7 @@ class Co extends N {
|
|
6864
6864
|
const a = {
|
6865
6865
|
...e,
|
6866
6866
|
fontSize: this.size
|
6867
|
-
}, r = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === Mt.Autosize ? e.text : e.input) ?? "", o = X(
|
6867
|
+
}, r = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === Mt.Autosize ? e.text : e.input) ?? "", o = X(ne(a, i), r);
|
6868
6868
|
return {
|
6869
6869
|
...t,
|
6870
6870
|
layouts: {
|
@@ -6886,7 +6886,7 @@ class ja extends N {
|
|
6886
6886
|
const a = {
|
6887
6887
|
...e,
|
6888
6888
|
fontData: this.fontData
|
6889
|
-
}, r = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === Mt.Autosize ? e.text : e.input) ?? "", o = X(
|
6889
|
+
}, r = _(e.id, Object.values(t.layouts)), i = (!e.algorithm || e.algorithm === Mt.Autosize ? e.text : e.input) ?? "", o = X(ne(a, i), r);
|
6890
6890
|
return {
|
6891
6891
|
...t,
|
6892
6892
|
layouts: {
|
@@ -7010,7 +7010,7 @@ class vo extends N {
|
|
7010
7010
|
const e = $(this.id, Object.values(t.layouts));
|
7011
7011
|
if (!e.id)
|
7012
7012
|
throw new L();
|
7013
|
-
const a = _(e.id, Object.values(t.layouts)), r = X(
|
7013
|
+
const a = _(e.id, Object.values(t.layouts)), r = X(ne(e, this.text, e), a);
|
7014
7014
|
return {
|
7015
7015
|
...t,
|
7016
7016
|
layouts: {
|
@@ -7265,7 +7265,7 @@ class Ya {
|
|
7265
7265
|
}))()), A = {
|
7266
7266
|
stepName: this.configuration.stepName,
|
7267
7267
|
id: M(),
|
7268
|
-
cachedObjectURL: await
|
7268
|
+
cachedObjectURL: await Xt(d.svg),
|
7269
7269
|
src: l,
|
7270
7270
|
svg: d.svg,
|
7271
7271
|
colors: d.colors,
|
@@ -7374,7 +7374,7 @@ class Bo {
|
|
7374
7374
|
async () => {
|
7375
7375
|
const p = await i();
|
7376
7376
|
if (!p.link || !p.link)
|
7377
|
-
throw new
|
7377
|
+
throw new Jt(p.asset);
|
7378
7378
|
h({
|
7379
7379
|
rel: "mpeg4",
|
7380
7380
|
href: p.link
|
@@ -7449,7 +7449,7 @@ class Fe {
|
|
7449
7449
|
const r = a.fileLink;
|
7450
7450
|
if (r)
|
7451
7451
|
return nt(r, !0);
|
7452
|
-
throw new
|
7452
|
+
throw new Jt(a);
|
7453
7453
|
};
|
7454
7454
|
}
|
7455
7455
|
async init(t, e, a) {
|
@@ -7773,7 +7773,7 @@ class Fe {
|
|
7773
7773
|
const a = t.fileLink;
|
7774
7774
|
if (a)
|
7775
7775
|
return a;
|
7776
|
-
throw new
|
7776
|
+
throw new Jt(t);
|
7777
7777
|
}
|
7778
7778
|
async loadPatternFromAsset(t, e, a, r) {
|
7779
7779
|
const i = Fe.patternSource(t), o = a.markUpdatePending(), s = a.getWorkflowExperience().getStepById(e.stepName)?.frameService;
|
@@ -7908,7 +7908,7 @@ class Io {
|
|
7908
7908
|
spotColor: A.spotColor,
|
7909
7909
|
pmsValue: A.pmsValue
|
7910
7910
|
};
|
7911
|
-
const s = ya(t, e, a, o), l = await
|
7911
|
+
const s = ya(t, e, a, o), l = await Xt(s), c = [];
|
7912
7912
|
for (const d of r) {
|
7913
7913
|
for (const [A, u] of i.entries())
|
7914
7914
|
c.push(new Aa(d, A, u));
|
@@ -7967,8 +7967,8 @@ class Io {
|
|
7967
7967
|
throw new bt(e);
|
7968
7968
|
const l = s.fileLink;
|
7969
7969
|
if (!l)
|
7970
|
-
throw new
|
7971
|
-
const c = await st(await this.getIllustrationBody(l)), d = await
|
7970
|
+
throw new Jt(s);
|
7971
|
+
const c = await st(await this.getIllustrationBody(l)), d = await Xt(c.svg), A = (f) => {
|
7972
7972
|
const S = i.getLayouts().find((I) => I.panelId === f.panelId);
|
7973
7973
|
if (!S)
|
7974
7974
|
throw new Y(f);
|
@@ -8036,7 +8036,7 @@ class Io {
|
|
8036
8036
|
};
|
8037
8037
|
}
|
8038
8038
|
}
|
8039
|
-
const
|
8039
|
+
const Ce = new Io();
|
8040
8040
|
class Po {
|
8041
8041
|
async init(t, e, a) {
|
8042
8042
|
const r = t.option;
|
@@ -8668,7 +8668,7 @@ const No = new To(), Ke = (n, t, e, a, r) => {
|
|
8668
8668
|
m || (c = !1);
|
8669
8669
|
}
|
8670
8670
|
return [null, null];
|
8671
|
-
},
|
8671
|
+
}, we = (n, t, e, a, r) => {
|
8672
8672
|
let i, o;
|
8673
8673
|
const s = Ct(t.assetUrl), l = s.getFont();
|
8674
8674
|
if (r.size) {
|
@@ -8924,7 +8924,7 @@ class Ro {
|
|
8924
8924
|
const c = [], d = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map();
|
8925
8925
|
for (const u of e) {
|
8926
8926
|
if (!u.fontData) throw new V("Failed to resolve font data for text.");
|
8927
|
-
const [h, m] =
|
8927
|
+
const [h, m] = we(
|
8928
8928
|
u.fontSize,
|
8929
8929
|
u.fontData,
|
8930
8930
|
{ left: u.x, top: u.y, width: u.width, height: u.height, rotation: u.rotation },
|
@@ -9084,7 +9084,7 @@ class Ro {
|
|
9084
9084
|
throw new bt(t);
|
9085
9085
|
const a = e.fileLink;
|
9086
9086
|
if (!a)
|
9087
|
-
throw new
|
9087
|
+
throw new Jt(e);
|
9088
9088
|
const r = await Nt(a);
|
9089
9089
|
return {
|
9090
9090
|
assetUrl: a,
|
@@ -9211,7 +9211,7 @@ class Ro {
|
|
9211
9211
|
fillSpotColorDefinition: f
|
9212
9212
|
}, C = [], E = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map();
|
9213
9213
|
if (!I.fontData) throw new V("Failed to resolve font data for text.");
|
9214
|
-
const [b, F] =
|
9214
|
+
const [b, F] = we(
|
9215
9215
|
I.fontSize,
|
9216
9216
|
I.fontData,
|
9217
9217
|
{
|
@@ -9272,7 +9272,7 @@ class Ro {
|
|
9272
9272
|
const A = (r || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = Ft(A, o), h = this.getProcessedInput(u, t.data, s), m = o.getRegionElements(t.stepName), p = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
|
9273
9273
|
for (const C of m)
|
9274
9274
|
if (C.region) {
|
9275
|
-
const [E, P] =
|
9275
|
+
const [E, P] = we(
|
9276
9276
|
e,
|
9277
9277
|
a,
|
9278
9278
|
C.region,
|
@@ -9326,13 +9326,13 @@ const $o = "data:application/octet-stream;base64,AAEAAAAPAIAAAwBwRkZUTYdHeHoAAEl
|
|
9326
9326
|
const e = at("rect");
|
9327
9327
|
return e.setAttribute("height", `${n}`), e.setAttribute("width", `${t}`), e;
|
9328
9328
|
}, Lo = (n, t, e, a) => {
|
9329
|
-
const r =
|
9329
|
+
const r = se("filter");
|
9330
9330
|
r.setAttribute("id", a), r.setAttribute("height", "200%"), r.setAttribute("width", "200%"), r.setAttribute("x", "-50%"), r.setAttribute("y", "-50%");
|
9331
|
-
const i =
|
9331
|
+
const i = se("feOffset");
|
9332
9332
|
r.appendChild(i), i.setAttribute("result", "offOut"), i.setAttribute("in", "SourceAlpha"), i.setAttribute("dx", `${n}`), i.setAttribute("dy", `${t}`);
|
9333
|
-
const o =
|
9333
|
+
const o = se("feGaussianBlur");
|
9334
9334
|
r.appendChild(o), o.setAttribute("result", "blurOut"), o.setAttribute("in", "offOut"), o.setAttribute("stdDeviation", `${e}`);
|
9335
|
-
const s =
|
9335
|
+
const s = se("feBlend");
|
9336
9336
|
return r.appendChild(s), s.setAttribute("in", "SourceGraphic"), s.setAttribute("in2", "blurOut"), s.setAttribute("mode", "normal"), r;
|
9337
9337
|
}, Vo = (n) => {
|
9338
9338
|
let t = n;
|
@@ -9511,7 +9511,7 @@ async function Zn(n) {
|
|
9511
9511
|
return new qo();
|
9512
9512
|
throw new V(`Failed to resolve Module, Module ${n} not found`);
|
9513
9513
|
}
|
9514
|
-
const
|
9514
|
+
const ie = w`
|
9515
9515
|
fragment GlobalPropertyStateAspectFields on GlobalPropertyStateAspect {
|
9516
9516
|
name
|
9517
9517
|
value
|
@@ -9534,7 +9534,7 @@ const re = w`
|
|
9534
9534
|
}
|
9535
9535
|
}
|
9536
9536
|
`, Ho = w`
|
9537
|
-
${
|
9537
|
+
${ie}
|
9538
9538
|
mutation CreateGlobalPropertyState($bundleId: String!) {
|
9539
9539
|
globalPropertyStateCreate(bundleId: $bundleId) {
|
9540
9540
|
id
|
@@ -9544,7 +9544,7 @@ const re = w`
|
|
9544
9544
|
}
|
9545
9545
|
}
|
9546
9546
|
`, jo = w`
|
9547
|
-
${
|
9547
|
+
${ie}
|
9548
9548
|
mutation UpdateGlobalPropertyState($id: String!, $aspects: [GlobalPropertyStateAspectInput]!) {
|
9549
9549
|
globalPropertyStateUpdate(id: $id, aspects: $aspects) {
|
9550
9550
|
id
|
@@ -9554,7 +9554,7 @@ const re = w`
|
|
9554
9554
|
}
|
9555
9555
|
}
|
9556
9556
|
`, Yo = w`
|
9557
|
-
${
|
9557
|
+
${ie}
|
9558
9558
|
query GetGlobalPropertyState($bundleId: String!) {
|
9559
9559
|
globalPropertyState(bundleId: $bundleId) {
|
9560
9560
|
id
|
@@ -9625,7 +9625,7 @@ const re = w`
|
|
9625
9625
|
...ProductFields
|
9626
9626
|
}
|
9627
9627
|
}
|
9628
|
-
`,
|
9628
|
+
`, oe = (n, t = !1) => w`
|
9629
9629
|
${n ? Pa(t) : ""}
|
9630
9630
|
fragment ProductCollectionFields on ProductCollection {
|
9631
9631
|
id
|
@@ -9696,8 +9696,8 @@ const re = w`
|
|
9696
9696
|
}
|
9697
9697
|
}
|
9698
9698
|
`, Ko = (n) => w`
|
9699
|
-
${
|
9700
|
-
${
|
9699
|
+
${ie}
|
9700
|
+
${oe(n)}
|
9701
9701
|
query GetBundle($id: String!) {
|
9702
9702
|
globalPropertyState(bundleId: $id) {
|
9703
9703
|
id
|
@@ -9879,7 +9879,7 @@ const re = w`
|
|
9879
9879
|
}
|
9880
9880
|
}
|
9881
9881
|
`, es = (n) => w`
|
9882
|
-
${
|
9882
|
+
${oe(n)}
|
9883
9883
|
mutation CreateBundle(
|
9884
9884
|
$collectionId: String
|
9885
9885
|
$initialMetadata: [MetadataInput!]
|
@@ -9908,8 +9908,8 @@ const re = w`
|
|
9908
9908
|
}
|
9909
9909
|
}
|
9910
9910
|
`, as = (n) => w`
|
9911
|
-
${
|
9912
|
-
${
|
9911
|
+
${ie}
|
9912
|
+
${oe(n)}
|
9913
9913
|
mutation DuplicateBundle(
|
9914
9914
|
$id: String!
|
9915
9915
|
$template: Boolean
|
@@ -10064,7 +10064,7 @@ const re = w`
|
|
10064
10064
|
}
|
10065
10065
|
}
|
10066
10066
|
`, us = (n) => w`
|
10067
|
-
${
|
10067
|
+
${oe(n)}
|
10068
10068
|
mutation BundleAssignProductCollection($id: String!, $productCollectionId: String!) {
|
10069
10069
|
bundleAssignProductCollection(id: $id, collectionId: $productCollectionId) {
|
10070
10070
|
id
|
@@ -10270,7 +10270,7 @@ class Bs {
|
|
10270
10270
|
const t = this.transaction.recipient, e = { recipient: t };
|
10271
10271
|
return this.recipientConversionConfiguration?.requestedDataItems?.forEach((a) => {
|
10272
10272
|
const r = a.uniqueIdentifier ?? a.title ?? "";
|
10273
|
-
a.type ===
|
10273
|
+
a.type === ye.FirstName ? e[r] = t?.firstName : a.type === ye.LastName ? e[r] = t?.lastName : a.type === ye.Custom && (a.customFieldIndex === 1 ? e[r] = t?.customField1 : a.customFieldIndex === 2 ? e[r] = t?.customField2 : a.customFieldIndex === 3 ? e[r] = t?.customField3 : a.customFieldIndex === 4 ? e[r] = t?.customField4 : a.customFieldIndex === 5 && (e[r] = t?.customField5));
|
10274
10274
|
}), e;
|
10275
10275
|
}
|
10276
10276
|
async updateRecipient(t, e, a, r, i, o, s, l, c, d, A, u, h, m, p, g, f) {
|
@@ -10666,7 +10666,7 @@ class Bs {
|
|
10666
10666
|
...this.storage,
|
10667
10667
|
[t]: { ...this.storage[t], ...e }
|
10668
10668
|
};
|
10669
|
-
if (!
|
10669
|
+
if (!jt(a, this.storage)) {
|
10670
10670
|
this.storage = a;
|
10671
10671
|
const r = new Ha(this.constructSerializableWorkflow());
|
10672
10672
|
this.commandContext.apply(r, !0), this.onStepSpecificStorageChange(t), this.onStorageChange();
|
@@ -10910,7 +10910,7 @@ class Bs {
|
|
10910
10910
|
break;
|
10911
10911
|
case v.Illustration:
|
10912
10912
|
a.push(
|
10913
|
-
|
10913
|
+
Ce.init(l, this, this.reloadedState)
|
10914
10914
|
);
|
10915
10915
|
break;
|
10916
10916
|
case v.Material:
|
@@ -11223,7 +11223,7 @@ class Is extends Z {
|
|
11223
11223
|
*/
|
11224
11224
|
async selectVariant(t) {
|
11225
11225
|
if (!this.getUpdateState() && this.getCurrentVariant() !== t)
|
11226
|
-
return
|
11226
|
+
return Ce.selectVariant(
|
11227
11227
|
this.step,
|
11228
11228
|
t.getResource(),
|
11229
11229
|
this.manager.getRegionElements(this.step.stepName) || [],
|
@@ -11265,7 +11265,7 @@ class Is extends Z {
|
|
11265
11265
|
const c = l.id.replace(/\W/g, "");
|
11266
11266
|
a ? r.set(c, { browserValue: e, pmsValue: a }) : r.set(c, e);
|
11267
11267
|
}
|
11268
|
-
}) : a ? r.set(t, { browserValue: e, pmsValue: a }) : r.set(t, e),
|
11268
|
+
}) : a ? r.set(t, { browserValue: e, pmsValue: a }) : r.set(t, e), Ce.changeColors(
|
11269
11269
|
this.step,
|
11270
11270
|
this.manager.getRegionElements(this.step.stepName),
|
11271
11271
|
this.manager,
|
@@ -11277,7 +11277,7 @@ class Is extends Z {
|
|
11277
11277
|
return this.step.data.colorOption;
|
11278
11278
|
}
|
11279
11279
|
getAvailableColors() {
|
11280
|
-
return this.step.data.colorPickerEnabled ?
|
11280
|
+
return this.step.data.colorPickerEnabled ? Ce.availableColors(this.step, this.manager) : Promise.resolve([]);
|
11281
11281
|
}
|
11282
11282
|
isColorPickerEnabled() {
|
11283
11283
|
return this.step.data.colorPickerEnabled ?? !1;
|
@@ -11684,7 +11684,7 @@ class Qs extends Z {
|
|
11684
11684
|
});
|
11685
11685
|
}
|
11686
11686
|
}
|
11687
|
-
class
|
11687
|
+
class Ae {
|
11688
11688
|
static get(t, e) {
|
11689
11689
|
switch (e.type) {
|
11690
11690
|
case v.DigitalContent:
|
@@ -12330,7 +12330,7 @@ class Ys {
|
|
12330
12330
|
throw new Te("Failed to obtain 2D context for preview image creation");
|
12331
12331
|
const m = this.workflowManager.getTemplatingContext(), p = Ea(u.layoutState.layout, u.layoutState.elements, {
|
12332
12332
|
renderingConfiguration: {
|
12333
|
-
purpose:
|
12333
|
+
purpose: Yt.Print,
|
12334
12334
|
region: { left: A.x, top: A.y, width: A.width, height: A.height },
|
12335
12335
|
templatingContext: m
|
12336
12336
|
}
|
@@ -12339,7 +12339,7 @@ class Ys {
|
|
12339
12339
|
anonymousCrossOrigin: !0,
|
12340
12340
|
ignoreDimensions: !1,
|
12341
12341
|
createCanvas: pt,
|
12342
|
-
createImage:
|
12342
|
+
createImage: ee,
|
12343
12343
|
DOMParser: Ca(),
|
12344
12344
|
fetch
|
12345
12345
|
})).render();
|
@@ -12352,7 +12352,7 @@ class Ys {
|
|
12352
12352
|
const a = this.cachedStepHandles.get(e.stepName);
|
12353
12353
|
if (a)
|
12354
12354
|
return a;
|
12355
|
-
const r =
|
12355
|
+
const r = Ae.get(this.getWorkflowManager(), e);
|
12356
12356
|
return this.cachedStepHandles.set(e.stepName, r), r;
|
12357
12357
|
}
|
12358
12358
|
getSteps() {
|
@@ -12453,10 +12453,10 @@ class Ys {
|
|
12453
12453
|
getStepByName(t) {
|
12454
12454
|
const e = this.getWorkflowManager().getWorkflow().steps.find((a) => a.stepTitle === t);
|
12455
12455
|
if (!(!e || !this.stepHasHandle(e)))
|
12456
|
-
return
|
12456
|
+
return Ae.get(this.getWorkflowManager(), e);
|
12457
12457
|
}
|
12458
12458
|
getStepsByType(t) {
|
12459
|
-
return this.getWorkflowManager().getWorkflow().steps.filter((e) => e.type === t).map((e) =>
|
12459
|
+
return this.getWorkflowManager().getWorkflow().steps.filter((e) => e.type === t).map((e) => Ae.get(this.getWorkflowManager(), e));
|
12460
12460
|
}
|
12461
12461
|
getStepsByScene(t) {
|
12462
12462
|
if (!this.getWorkflowManager().getWorkflow().stepGroups.find((a) => a.name === t.name))
|
@@ -12465,7 +12465,7 @@ class Ys {
|
|
12465
12465
|
);
|
12466
12466
|
return t.stepIds.map(
|
12467
12467
|
(a) => this.getWorkflowManager().getWorkflow().steps.find((r) => r.stepName === a)
|
12468
|
-
).filter((a) => this.stepHasHandle(a)).map((a) =>
|
12468
|
+
).filter((a) => this.stepHasHandle(a)).map((a) => Ae.get(this.getWorkflowManager(), a));
|
12469
12469
|
}
|
12470
12470
|
async attachCustomerDetails(t) {
|
12471
12471
|
return this.assignCustomerDetails({ emailAddress: t.email });
|
@@ -12785,7 +12785,7 @@ const Js = (n) => {
|
|
12785
12785
|
const r = e.data, i = a.option;
|
12786
12786
|
if (!i)
|
12787
12787
|
return console.error(`No option for step ${a.stepName}.`), [];
|
12788
|
-
const o = i.variants?.find((C) => C.id === r.illustrationVariantId) ||
|
12788
|
+
const o = i.variants?.find((C) => C.id === r.illustrationVariantId) || re(i);
|
12789
12789
|
if (!o)
|
12790
12790
|
return console.error(`No variant with ID: ${r.illustrationVariantId}`), [];
|
12791
12791
|
if (!o.asset)
|
@@ -12883,7 +12883,7 @@ const Js = (n) => {
|
|
12883
12883
|
const r = e.data, i = a.option;
|
12884
12884
|
if (!i)
|
12885
12885
|
return console.error(`No option for step ${a.stepName}.`), [];
|
12886
|
-
const o = i.variants?.find((d) => d.id === r.pictureVariantId) ||
|
12886
|
+
const o = i.variants?.find((d) => d.id === r.pictureVariantId) || re(i);
|
12887
12887
|
if (!o)
|
12888
12888
|
return console.error(`No variant with ID: ${r.pictureVariantId}`), [];
|
12889
12889
|
if (!o.asset)
|
@@ -12924,7 +12924,7 @@ const Js = (n) => {
|
|
12924
12924
|
const r = e.data, i = a.option;
|
12925
12925
|
if (!i)
|
12926
12926
|
return console.error(`No option for step ${a.stepName}.`), [];
|
12927
|
-
const o = i.variants?.find((c) => c.id === r.colorVariantId) ||
|
12927
|
+
const o = i.variants?.find((c) => c.id === r.colorVariantId) || re(i);
|
12928
12928
|
if (!o)
|
12929
12929
|
return console.error(`No variant with ID: ${r.colorVariantId}`), [];
|
12930
12930
|
t[a.stepName] = { selectedVariants: [o] };
|
@@ -13045,7 +13045,7 @@ const Js = (n) => {
|
|
13045
13045
|
const g = a.option;
|
13046
13046
|
if (!g)
|
13047
13047
|
return;
|
13048
|
-
const f = g.variants?.find((B) => B.id === i.fontVariantId) ||
|
13048
|
+
const f = g.variants?.find((B) => B.id === i.fontVariantId) || re(g);
|
13049
13049
|
if (!f || !f.asset)
|
13050
13050
|
return;
|
13051
13051
|
t[a.stepName] = { selectedVariants: [f] };
|
@@ -13094,7 +13094,7 @@ const Js = (n) => {
|
|
13094
13094
|
y: g.top
|
13095
13095
|
};
|
13096
13096
|
if (d) {
|
13097
|
-
const [B, I] =
|
13097
|
+
const [B, I] = we(
|
13098
13098
|
a.data.size || o,
|
13099
13099
|
d,
|
13100
13100
|
g,
|
@@ -13349,7 +13349,7 @@ class ul extends Mn {
|
|
13349
13349
|
l = i.width, c = i.height;
|
13350
13350
|
const d = this.getWorkflowManager?.()?.getTemplatingContext(), A = Ea(t.layoutState.layout, e, {
|
13351
13351
|
renderingConfiguration: {
|
13352
|
-
purpose:
|
13352
|
+
purpose: Yt.ThreeD,
|
13353
13353
|
templatingContext: d
|
13354
13354
|
}
|
13355
13355
|
}), u = fn(A), h = await ma.from(this.ctx, u, {
|
@@ -13360,7 +13360,7 @@ class ul extends Mn {
|
|
13360
13360
|
ignoreMouse: !0,
|
13361
13361
|
enableRedraw: !1,
|
13362
13362
|
createCanvas: pt,
|
13363
|
-
createImage:
|
13363
|
+
createImage: ee,
|
13364
13364
|
DOMParser: Ca(),
|
13365
13365
|
fetch
|
13366
13366
|
});
|
@@ -13421,11 +13421,9 @@ class hl {
|
|
13421
13421
|
return e ? t.filter((a) => this.aspectConditionsSatisfied(a.getRawProperty(), e)) : t;
|
13422
13422
|
}
|
13423
13423
|
aspectConditionsSatisfied(t, e) {
|
13424
|
-
return
|
13425
|
-
const r = e.aspects.find((
|
13426
|
-
|
13427
|
-
const i = a.requiredVariantSelections.some((o) => o === r.value);
|
13428
|
-
return console.log(`LOG: does aspect ${t.name} (${t.title}) have a matching selection for ${a.targetAspectName} / ${r.value}? ${i}`), i;
|
13424
|
+
return !t.conditions || t.conditions.length === 0 ? !0 : t.conditions.some((a) => {
|
13425
|
+
const r = e.aspects.find((i) => i.name === a.targetAspectName);
|
13426
|
+
return r ? a.requiredVariantSelections.some((i) => i === r.value) : !1;
|
13429
13427
|
});
|
13430
13428
|
}
|
13431
13429
|
async createHandle(t) {
|
@@ -13924,7 +13922,7 @@ function rr(n) {
|
|
13924
13922
|
e.value !== "" && t.set(e.name, !0);
|
13925
13923
|
}), t;
|
13926
13924
|
}
|
13927
|
-
function
|
13925
|
+
function ue(n) {
|
13928
13926
|
return ua(n, ["__typename"]);
|
13929
13927
|
}
|
13930
13928
|
class yl {
|
@@ -13932,11 +13930,17 @@ class yl {
|
|
13932
13930
|
this.mandatoryFulfilledAspects = /* @__PURE__ */ new Map(), this.bundleId = t, this.bundleOwnerId = e, this.configuration = a, this.bundleOptions = i;
|
13933
13931
|
const o = i?.existingGlobalPropertyState;
|
13934
13932
|
this.initPromise = o ? Promise.resolve(o).then(() => {
|
13935
|
-
console.log("Setting global property state to existing state."), this.globalPropertyState =
|
13933
|
+
console.log("Setting global property state to existing state."), this.globalPropertyState = ue(o), this.recalculateMandatoryStates();
|
13936
13934
|
}) : this.createGlobalPropertyState().then((s) => {
|
13937
|
-
console.log("Setting global property state to new state."), this.globalPropertyState =
|
13935
|
+
console.log("Setting global property state to new state."), this.globalPropertyState = ue(s), this.recalculateMandatoryStates();
|
13938
13936
|
}), this.onGlobalPropertyStateChange = r;
|
13939
13937
|
}
|
13938
|
+
async clearAspects(t) {
|
13939
|
+
if (!this.globalPropertyState)
|
13940
|
+
throw new Error("Global property state not initialized");
|
13941
|
+
const e = this.globalPropertyState.aspects;
|
13942
|
+
this.globalPropertyState.aspects = e.filter((a) => !t.includes(a.name)), console.log(`LOG: after the clear there are ${this.globalPropertyState.aspects.length} aspects`);
|
13943
|
+
}
|
13940
13944
|
recalculateMandatoryStates() {
|
13941
13945
|
this.mandatoryFulfilledAspects = rr(this.globalPropertyState);
|
13942
13946
|
}
|
@@ -13958,7 +13962,7 @@ class yl {
|
|
13958
13962
|
async setGlobalPropertyState(t) {
|
13959
13963
|
this.globalPropertyState || await this.initPromise;
|
13960
13964
|
const e = Et(this.globalPropertyState);
|
13961
|
-
this.globalPropertyState = { ...
|
13965
|
+
this.globalPropertyState = { ...ue(t), id: e.id }, this.recalculateMandatoryStates(), await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(e, this.globalPropertyState);
|
13962
13966
|
}
|
13963
13967
|
getAspectMandatoryFulfilled(t) {
|
13964
13968
|
return this.mandatoryFulfilledAspects.get(t);
|
@@ -13983,7 +13987,7 @@ class yl {
|
|
13983
13987
|
const i = this.configuration.aspects.find((l) => l.name === t);
|
13984
13988
|
if (!i)
|
13985
13989
|
throw new Error(`Failed to find configuration aspect with name: ${t}`);
|
13986
|
-
this.mandatoryFulfilledAspects.set(t, e !== "");
|
13990
|
+
this.mandatoryFulfilledAspects.set(t, e !== ""), console.log(`LOG: setting aspects, currently ${this.globalPropertyState.aspects.length}`);
|
13987
13991
|
const o = Et(this.globalPropertyState), s = this.globalPropertyState.aspects.filter((l) => l.name === t);
|
13988
13992
|
if (s.length > 0)
|
13989
13993
|
if (r) {
|
@@ -14017,7 +14021,7 @@ class yl {
|
|
14017
14021
|
storage: a !== null ? a : void 0,
|
14018
14022
|
channel: r
|
14019
14023
|
});
|
14020
|
-
|
14024
|
+
jt(o, this.globalPropertyState) || (console.log(`LOG: end of setting aspects, currently ${this.globalPropertyState.aspects.length}, if it changed we pushed aspect ${t} / ${e}`), await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(o, this.globalPropertyState));
|
14021
14025
|
}
|
14022
14026
|
async setAspectStorage(t, e, a) {
|
14023
14027
|
if (!this.globalPropertyState)
|
@@ -14044,11 +14048,12 @@ class yl {
|
|
14044
14048
|
storage: e !== null ? e : void 0,
|
14045
14049
|
channel: a
|
14046
14050
|
});
|
14047
|
-
|
14051
|
+
jt(i, this.globalPropertyState) || (await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(i, this.globalPropertyState));
|
14048
14052
|
}
|
14049
14053
|
async updateGlobalPropertyState() {
|
14050
14054
|
if (!this.globalPropertyState)
|
14051
14055
|
throw new Error("Global property state not initialized");
|
14056
|
+
console.log(`LOG: updating ${this.globalPropertyState.aspects.length} aspects`), console.trace();
|
14052
14057
|
const t = await y.getShadowGraphqlClient().mutate({
|
14053
14058
|
mutation: jo,
|
14054
14059
|
variables: {
|
@@ -14087,7 +14092,7 @@ class yl {
|
|
14087
14092
|
}
|
14088
14093
|
});
|
14089
14094
|
if (t.data?.globalPropertyStateUpdate)
|
14090
|
-
this.globalPropertyState =
|
14095
|
+
this.globalPropertyState = ue(t.data.globalPropertyStateUpdate);
|
14091
14096
|
else
|
14092
14097
|
throw new Error("Unable to update global property state");
|
14093
14098
|
}
|
@@ -14323,14 +14328,14 @@ class ir {
|
|
14323
14328
|
getProducts() {
|
14324
14329
|
if (!this.collection.productCollectionProducts)
|
14325
14330
|
throw new Error("Failed to find products on collection. Ensure you fetch them first!");
|
14326
|
-
return this.collection.productCollectionProducts.filter((t) => !!t.product).map((t) => new
|
14331
|
+
return this.collection.productCollectionProducts.filter((t) => !!t.product).map((t) => new he(t));
|
14327
14332
|
}
|
14328
14333
|
/**
|
14329
14334
|
* A list of products in this collections with useful helpers for interacting with them.
|
14330
14335
|
*/
|
14331
14336
|
async fetchProducts(t) {
|
14332
14337
|
if (this.fullFetched)
|
14333
|
-
return this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new
|
14338
|
+
return this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new he(a));
|
14334
14339
|
const e = await y.getShadowGraphqlClient().query({
|
14335
14340
|
query: Xo,
|
14336
14341
|
variables: {
|
@@ -14339,7 +14344,7 @@ class ir {
|
|
14339
14344
|
},
|
14340
14345
|
errorPolicy: "all"
|
14341
14346
|
});
|
14342
|
-
return t || (this.fullFetched = !0), this.collection.productCollectionProducts = e.data.productCollections[0].productCollectionProducts || [], this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new
|
14347
|
+
return t || (this.fullFetched = !0), this.collection.productCollectionProducts = e.data.productCollections[0].productCollectionProducts || [], this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new he(a));
|
14343
14348
|
}
|
14344
14349
|
/**
|
14345
14350
|
* Returns a list of collections products matching the associated metafield/tag filters.
|
@@ -14429,7 +14434,7 @@ class ir {
|
|
14429
14434
|
if (h || p.partial && (!p.data.productCollections || p.data.productCollections.length === 0 || !p.data.productCollections[0].productCollectionProductsFeed?.items || p.data.productCollections[0].productCollectionProductsFeed?.items.length === 0))
|
14430
14435
|
return;
|
14431
14436
|
c.abort(), h = !0, m.unsubscribe();
|
14432
|
-
const g = p.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((f) => !!f.product).map((f) => new
|
14437
|
+
const g = p.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((f) => !!f.product).map((f) => new he(Et(f))) || [];
|
14433
14438
|
u({
|
14434
14439
|
items: g,
|
14435
14440
|
// Clone items because it could be cached data (immutable)
|
@@ -14453,7 +14458,7 @@ class ir {
|
|
14453
14458
|
return this.collection;
|
14454
14459
|
}
|
14455
14460
|
}
|
14456
|
-
class
|
14461
|
+
class he {
|
14457
14462
|
constructor(t) {
|
14458
14463
|
this.product = t.product, this.productResource = t;
|
14459
14464
|
}
|
@@ -14648,7 +14653,7 @@ class Pl {
|
|
14648
14653
|
}
|
14649
14654
|
}
|
14650
14655
|
const Dl = w`
|
14651
|
-
${
|
14656
|
+
${oe(!1)}
|
14652
14657
|
query GetProductCollections($ids: [String!]!) {
|
14653
14658
|
productCollections(ids: $ids) {
|
14654
14659
|
...ProductCollectionFields
|
@@ -14913,7 +14918,7 @@ class Ze {
|
|
14913
14918
|
}
|
14914
14919
|
}
|
14915
14920
|
} finally {
|
14916
|
-
this.updatesLocked = !1, this.onGlobalPropertiesChanged(void 0, this.globalPropertyStateManager.getGlobalPropertyState());
|
14921
|
+
this.updatesLocked = !1, console.log(`LOG: finally ${this.globalPropertyStateManager.getGlobalPropertyState()?.aspects?.length}`), this.onGlobalPropertiesChanged(void 0, this.globalPropertyStateManager.getGlobalPropertyState());
|
14917
14922
|
}
|
14918
14923
|
}
|
14919
14924
|
getGlobalPropertyStateManager() {
|
@@ -15376,24 +15381,32 @@ class Ze {
|
|
15376
15381
|
return;
|
15377
15382
|
const a = await this.globalPropertyHandleService.getHandles(), r = this.globalPropertyHandleService.applyConditionsFromState(a, t), i = this.globalPropertyHandleService.applyConditionsFromState(a, e);
|
15378
15383
|
this.checkConditionalHandlesChanged(r, i), this.checkMandatoryHandlesChanged(t, i);
|
15379
|
-
const o =
|
15380
|
-
|
15381
|
-
|
15382
|
-
|
15383
|
-
|
15384
|
+
const o = this.getGlobalPropertyStateManager();
|
15385
|
+
let s = [];
|
15386
|
+
for (const A of a)
|
15387
|
+
i.find((u) => u.getName() == A.getName()) || (s = [...s, A.getName()]);
|
15388
|
+
await o.clearAspects(s);
|
15389
|
+
const l = i.map((A) => {
|
15390
|
+
if (A.getType() === U.ColorOption || A.getType() === U.Option) {
|
15391
|
+
const u = A;
|
15392
|
+
if (!e.aspects.find((m) => m.name === u.getName()))
|
15393
|
+
return u.initDefaultVariant();
|
15384
15394
|
}
|
15385
15395
|
});
|
15386
|
-
await Promise.all(
|
15396
|
+
await Promise.all(l), await Promise.all(i.map((A) => A.applyGlobalState()));
|
15397
|
+
const c = this.globalPropertyStateManager.getGlobalPropertyState(), d = this.globalPropertyHandleService.applyConditionsFromState(a, c);
|
15398
|
+
console.log(`LOG: h: ${a.map((A) => A.getName())} | nh: ${i.map((A) => A.getName())} | xh: ${d.map((A) => A.getName())}`), jt(i.sort(), d.sort()) || (console.log("LOG: recurse onChange"), await this.onGlobalPropertiesChanged(e, c));
|
15387
15399
|
}
|
15388
15400
|
checkConditionalHandlesChanged(t, e) {
|
15389
|
-
(() => {
|
15401
|
+
const r = (() => {
|
15390
15402
|
if (t.length !== e.length) return !0;
|
15391
|
-
for (let
|
15392
|
-
if (t[
|
15403
|
+
for (let i = 0; i < t.length; i++)
|
15404
|
+
if (t[i].getName() !== e[i].getName()) return !0;
|
15393
15405
|
return !1;
|
15394
|
-
})()
|
15406
|
+
})();
|
15407
|
+
console.log(`LOG: checkHandlesChanged, changed ${r} | ph ${t.map((i) => i.getName())} | nh ${e.map((i) => i.getName())}`), r && (console.log(`LOG: firing with handles ${e.map((i) => i.getName())}`), this.fireEvent("conditional-global-properties-changed", {
|
15395
15408
|
globalProperties: e
|
15396
|
-
});
|
15409
|
+
}));
|
15397
15410
|
}
|
15398
15411
|
checkMandatoryHandlesChanged(t, e) {
|
15399
15412
|
const a = [], r = [], i = [], o = rr(t);
|
@@ -15537,14 +15550,14 @@ class Ql {
|
|
15537
15550
|
* @returns The nodes contained within the execution.
|
15538
15551
|
*/
|
15539
15552
|
getNodes() {
|
15540
|
-
return this.execution.nodes.map((t) => new
|
15553
|
+
return this.execution.nodes.map((t) => new me(t));
|
15541
15554
|
}
|
15542
15555
|
/**
|
15543
15556
|
* @param type The type of node to return.
|
15544
15557
|
* @returns A list of nodes matching the requested type.
|
15545
15558
|
*/
|
15546
15559
|
getNodesByType(t) {
|
15547
|
-
return this.execution.nodes.filter((e) => e.type === t).map((e) => new
|
15560
|
+
return this.execution.nodes.filter((e) => e.type === t).map((e) => new me(e));
|
15548
15561
|
}
|
15549
15562
|
/**
|
15550
15563
|
* @returns A list of input nodes that exist in this execution.
|
@@ -15553,7 +15566,7 @@ class Ql {
|
|
15553
15566
|
return this.execution.nodes.filter(
|
15554
15567
|
(t) => t.type === "StartTerminal"
|
15555
15568
|
/* StartTerminal */
|
15556
|
-
).map((t) => new
|
15569
|
+
).map((t) => new me(t));
|
15557
15570
|
}
|
15558
15571
|
/**
|
15559
15572
|
* @returns A list of out put nodes that exist in this execution.
|
@@ -15562,7 +15575,7 @@ class Ql {
|
|
15562
15575
|
return this.execution.nodes.filter(
|
15563
15576
|
(t) => t.type === "EndTerminal"
|
15564
15577
|
/* EndTerminal */
|
15565
|
-
).map((t) => new
|
15578
|
+
).map((t) => new me(t));
|
15566
15579
|
}
|
15567
15580
|
/**
|
15568
15581
|
* @returns A date object representing the point in time this execution completed.
|
@@ -15579,7 +15592,7 @@ class Ql {
|
|
15579
15592
|
return new Date(this.execution.failedAt);
|
15580
15593
|
}
|
15581
15594
|
}
|
15582
|
-
class
|
15595
|
+
class me {
|
15583
15596
|
constructor(t) {
|
15584
15597
|
this.node = t;
|
15585
15598
|
}
|
@@ -15669,7 +15682,7 @@ class tn {
|
|
15669
15682
|
return t.sort((e, a) => (e.index ?? 0) - (a.index ?? 0)).map((e) => new qt(e));
|
15670
15683
|
}
|
15671
15684
|
}
|
15672
|
-
const
|
15685
|
+
const ge = w`
|
15673
15686
|
query GetCustomer($emailAddress: String!) {
|
15674
15687
|
customer(emailAddress: $emailAddress) {
|
15675
15688
|
id
|
@@ -15956,7 +15969,7 @@ const Wl = async (n, t) => {
|
|
15956
15969
|
r.steps.forEach((i) => {
|
15957
15970
|
delete i.data.__typename, i.option?.id && (i.option.defaultVariant?.asset && O.cacheAsset(i.option.defaultVariant.asset), i.option.colorProfile && O.cacheAsset(i.option.colorProfile), i.option.variants?.forEach((o) => {
|
15958
15971
|
o.asset && O.cacheAsset(o.asset), o.thumbnail && O.cacheAsset(o.thumbnail), o.material && O.cacheMaterial(o.material);
|
15959
|
-
}),
|
15972
|
+
}), _t.set({ id: i.option.id }, Promise.resolve(i.option)));
|
15960
15973
|
}), r.finalizeStepConfig || (r.finalizeStepConfig = {}), r.finalizeStepConfig.termsMarkdown = r.finalizeStepConfig.termsMarkdown || r.partner.termsMarkdown;
|
15961
15974
|
}), a;
|
15962
15975
|
}, ql = async (n, t) => {
|
@@ -15965,11 +15978,11 @@ const Wl = async (n, t) => {
|
|
15965
15978
|
throw new Error(`Workflow not found: ${n}`);
|
15966
15979
|
return a;
|
15967
15980
|
}, sr = async (n, t) => {
|
15968
|
-
const e = n.map((s) =>
|
15981
|
+
const e = n.map((s) => _t.get({ id: s, options: t })), a = n.filter((s, l) => e[l] === void 0);
|
15969
15982
|
if (a.length === 0)
|
15970
15983
|
return Promise.all(e);
|
15971
15984
|
const r = Wl(a, t), i = a.map(
|
15972
|
-
(s) =>
|
15985
|
+
(s) => _t.set({ id: s, options: t }, ql(s, r))
|
15973
15986
|
), o = e.filter((s) => s !== void 0);
|
15974
15987
|
return await Promise.all(o.concat(i));
|
15975
15988
|
}, vd = async (n, t) => (await sr([n], t))[0], Hl = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
@@ -16001,7 +16014,7 @@ class Ed {
|
|
16001
16014
|
} catch (a) {
|
16002
16015
|
throw console.error(a), new ht("Critical - Unable to synchronize workflow state with server.");
|
16003
16016
|
}
|
16004
|
-
}, this.options = t, this.options.applicationKey && Wr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 32.4.0"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
16017
|
+
}, this.options = t, this.options.applicationKey && Wr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 32.4.0-beta.8e6e6fc7-f504-51f5-b260-5ab00b636331"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
16005
16018
|
}
|
16006
16019
|
configure(t) {
|
16007
16020
|
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 && Hr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
@@ -16133,7 +16146,7 @@ class Ed {
|
|
16133
16146
|
}
|
16134
16147
|
async customerHasBundleTemplates(t) {
|
16135
16148
|
const r = (await y.getShadowGraphqlClient().query({
|
16136
|
-
query:
|
16149
|
+
query: ge,
|
16137
16150
|
errorPolicy: "all",
|
16138
16151
|
fetchPolicy: "no-cache",
|
16139
16152
|
variables: {
|
@@ -16152,7 +16165,7 @@ class Ed {
|
|
16152
16165
|
async getOrCreateCustomer(t) {
|
16153
16166
|
this.customer = void 0;
|
16154
16167
|
const e = y.getShadowGraphqlClient(), r = (await e.query({
|
16155
|
-
query:
|
16168
|
+
query: ge,
|
16156
16169
|
errorPolicy: "all",
|
16157
16170
|
fetchPolicy: "no-cache",
|
16158
16171
|
variables: {
|
@@ -16205,7 +16218,7 @@ class Ed {
|
|
16205
16218
|
return this.logOut(), console.error("Failed to refresh tokens."), !1;
|
16206
16219
|
}
|
16207
16220
|
const s = (await y.getShadowGraphqlClient().query({
|
16208
|
-
query:
|
16221
|
+
query: ge,
|
16209
16222
|
errorPolicy: "all",
|
16210
16223
|
fetchPolicy: "no-cache",
|
16211
16224
|
variables: {
|
@@ -16234,7 +16247,7 @@ class Ed {
|
|
16234
16247
|
if (r?.AuthenticationResult) {
|
16235
16248
|
localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), localStorage.setItem("cognito-tokens", JSON.stringify(r.AuthenticationResult)), localStorage.setItem("cognito-email", t);
|
16236
16249
|
const o = (await y.getShadowGraphqlClient().query({
|
16237
|
-
query:
|
16250
|
+
query: ge,
|
16238
16251
|
errorPolicy: "all",
|
16239
16252
|
fetchPolicy: "no-cache",
|
16240
16253
|
variables: {
|
@@ -16691,12 +16704,12 @@ function Jl(n, t, e, a) {
|
|
16691
16704
|
const s = n, l = Math.max(t.width / e.width, t.height / e.height);
|
16692
16705
|
s.zoom = Math.max(l, n.zoom);
|
16693
16706
|
const c = e.width * s.zoom, d = e.height * s.zoom;
|
16694
|
-
return s.x =
|
16707
|
+
return s.x = pe(n.x, t.width - c, 0), s.y = pe(n.y, t.height - d, 0), s;
|
16695
16708
|
}
|
16696
16709
|
const o = n;
|
16697
|
-
return o.x =
|
16710
|
+
return o.x = pe(o.x, -r, t.width), o.y = pe(o.y, -i, t.height), o;
|
16698
16711
|
}
|
16699
|
-
function
|
16712
|
+
function pe(n, t, e) {
|
16700
16713
|
return Math.min(Math.max(n, t), e);
|
16701
16714
|
}
|
16702
16715
|
class Kl {
|
@@ -16722,7 +16735,7 @@ class Kl {
|
|
16722
16735
|
let i = !1;
|
16723
16736
|
for (let o = 0; o < r.currentFrameSources.length; o++) {
|
16724
16737
|
const s = r.currentFrameSources[o], l = await Ue(s), c = this.frameData ? this.frameData[o] : void 0;
|
16725
|
-
|
16738
|
+
jt(l, c) || (this.frameData || (this.frameData = new Array(r.currentFrameSources.length)), this.frameData[o] = l, i = !0);
|
16726
16739
|
}
|
16727
16740
|
i && (this.onFrameDataChangeListeners.forEach(
|
16728
16741
|
(o) => o(this.frameData)
|
@@ -17498,7 +17511,7 @@ const Zl = w`
|
|
17498
17511
|
console.error("vite-plugin-css-injected-by-js", t);
|
17499
17512
|
}
|
17500
17513
|
})();
|
17501
|
-
var sc = /* @__PURE__ */ ((n) => (n.Manual = "Manual", n.OnStart = "OnStart", n.OnQuit = "OnQuit", n.OnEnd = "OnEnd", n))(sc || {}),
|
17514
|
+
var sc = /* @__PURE__ */ ((n) => (n.Manual = "Manual", n.OnStart = "OnStart", n.OnQuit = "OnQuit", n.OnEnd = "OnEnd", n))(sc || {}), ye = /* @__PURE__ */ ((n) => (n.Email = "Email", n.FirstName = "FirstName", n.LastName = "LastName", n.Phone = "Phone", n.Apartment = "Apartment", n.City = "City", n.Country = "Country", n.OrganizationName = "OrganizationName", n.PostCode = "PostCode", n.State = "State", n.StreetAddress = "StreetAddress", n.Custom = "Custom", n))(ye || {}), K;
|
17502
17515
|
K = { __e: function(n, t, e, a) {
|
17503
17516
|
for (var r, i, o; t = t.__; )
|
17504
17517
|
if ((r = t.__c) && !r.__)
|
@@ -17515,7 +17528,7 @@ function lc() {
|
|
17515
17528
|
for (var n; n = lr.shift(); )
|
17516
17529
|
if (n.__P && n.__H)
|
17517
17530
|
try {
|
17518
|
-
n.__H.__h.forEach(
|
17531
|
+
n.__H.__h.forEach(Se), n.__H.__h.forEach(ha), n.__H.__h = [];
|
17519
17532
|
} catch (t) {
|
17520
17533
|
n.__H.__h = [], K.__e(t, n.__v);
|
17521
17534
|
}
|
@@ -17527,7 +17540,7 @@ K.__b = function(n) {
|
|
17527
17540
|
var t = (ot = n.__c).__H;
|
17528
17541
|
t && (ta === ot ? (t.__h = [], ot.__h = [], t.__.forEach(function(e) {
|
17529
17542
|
e.__N && (e.__ = e.__N), e.__V = ea, e.__N = e.i = void 0;
|
17530
|
-
})) : (t.__h.forEach(
|
17543
|
+
})) : (t.__h.forEach(Se), t.__h.forEach(ha), t.__h = [])), ta = ot;
|
17531
17544
|
}, K.diffed = function(n) {
|
17532
17545
|
on && on(n);
|
17533
17546
|
var t = n.__c;
|
@@ -17537,7 +17550,7 @@ K.__b = function(n) {
|
|
17537
17550
|
}, K.__c = function(n, t) {
|
17538
17551
|
t.some(function(e) {
|
17539
17552
|
try {
|
17540
|
-
e.__h.forEach(
|
17553
|
+
e.__h.forEach(Se), e.__h = e.__h.filter(function(a) {
|
17541
17554
|
return !a.__ || ha(a);
|
17542
17555
|
});
|
17543
17556
|
} catch (a) {
|
@@ -17551,7 +17564,7 @@ K.__b = function(n) {
|
|
17551
17564
|
var t, e = n.__c;
|
17552
17565
|
e && e.__H && (e.__H.__.forEach(function(a) {
|
17553
17566
|
try {
|
17554
|
-
|
17567
|
+
Se(a);
|
17555
17568
|
} catch (r) {
|
17556
17569
|
t = r;
|
17557
17570
|
}
|
@@ -17564,7 +17577,7 @@ function cc(n) {
|
|
17564
17577
|
}, a = setTimeout(e, 100);
|
17565
17578
|
cn && (t = requestAnimationFrame(e));
|
17566
17579
|
}
|
17567
|
-
function
|
17580
|
+
function Se(n) {
|
17568
17581
|
var t = ot, e = n.__c;
|
17569
17582
|
typeof e == "function" && (n.__c = void 0, e()), ot = t;
|
17570
17583
|
}
|
@@ -17714,10 +17727,10 @@ export {
|
|
17714
17727
|
ud as BringToFrontCommand,
|
17715
17728
|
Dr as BundleDesignCreationCartAddMode,
|
17716
17729
|
N as CanvasCommand,
|
17717
|
-
|
17730
|
+
he as CollectionProduct,
|
17718
17731
|
Za as ColorOptionGlobalPropertyHandle,
|
17719
17732
|
go as CommandContext,
|
17720
|
-
|
17733
|
+
ye as ConversionDataType,
|
17721
17734
|
sc as ConversionLocation,
|
17722
17735
|
z as CreateElementCommand,
|
17723
17736
|
qn as CreateLayoutCommand,
|
@@ -17726,7 +17739,7 @@ export {
|
|
17726
17739
|
Bt as DeleteElementCommand,
|
17727
17740
|
Ns as DigitalContentStepHandle,
|
17728
17741
|
ml as FileUploadGlobalPropertyHandle,
|
17729
|
-
|
17742
|
+
me as FlowExecutionNodeResult,
|
17730
17743
|
Ql as FlowExecutionResult,
|
17731
17744
|
Nl as FlowService,
|
17732
17745
|
wo as FontAlignmentCommand,
|
@@ -17746,7 +17759,7 @@ export {
|
|
17746
17759
|
sd as LayoutElementFactory,
|
17747
17760
|
x as LayoutElementType,
|
17748
17761
|
Y as LayoutNotFoundError,
|
17749
|
-
|
17762
|
+
Yt as LayoutRenderingPurpose,
|
17750
17763
|
Ps as MaterialStepHandle,
|
17751
17764
|
Be as MisconfigurationError,
|
17752
17765
|
Fd as MockWorkflowManager,
|
@@ -17763,12 +17776,12 @@ export {
|
|
17763
17776
|
ir as ProductCollection,
|
17764
17777
|
Bl as ProductCollectionProductSortKey,
|
17765
17778
|
qt as ProductWorkflow,
|
17766
|
-
|
17779
|
+
_t as PromiseCache,
|
17767
17780
|
Tn as PromiseQueue,
|
17768
17781
|
xs as QuestionStepHandle,
|
17769
17782
|
Mn as QueueablePromise,
|
17770
17783
|
dd as ResizeCommand,
|
17771
|
-
|
17784
|
+
Jt as ResourceNotFoundError,
|
17772
17785
|
cd as RotateCommand,
|
17773
17786
|
H as ScaleAxis,
|
17774
17787
|
gd as SendBackwardsCommand,
|
@@ -17800,7 +17813,7 @@ export {
|
|
17800
17813
|
Wc as dataUrlFromExternalUrl,
|
17801
17814
|
Dd as deleteBundle,
|
17802
17815
|
Xe as designService,
|
17803
|
-
|
17816
|
+
we as determineCorrectFontSizeAndLines,
|
17804
17817
|
jn as digitalContentStepService,
|
17805
17818
|
dt as domParser,
|
17806
17819
|
Md as duplicateBundle,
|
@@ -17845,7 +17858,7 @@ export {
|
|
17845
17858
|
vd as getWorkflow,
|
17846
17859
|
sr as getWorkflows,
|
17847
17860
|
y as graphQlManager,
|
17848
|
-
|
17861
|
+
Ce as illustrationStepService,
|
17849
17862
|
Kc as isCloseToValue,
|
17850
17863
|
Nt as loadFont,
|
17851
17864
|
Hc as matchHexToPms,
|
@@ -17869,7 +17882,7 @@ export {
|
|
17869
17882
|
zc as registerWindowImplementation,
|
17870
17883
|
qa as rehydrateSerializedLayout,
|
17871
17884
|
ei as rgbToPms,
|
17872
|
-
|
17885
|
+
de as rotateAroundPoint,
|
17873
17886
|
wa as sanitizeSvgTree,
|
17874
17887
|
Hr as setBearerAuthenticationToken,
|
17875
17888
|
yn as setCanvasModule,
|