@spiffcommerce/core 34.0.0-beta.c6fd98dc-c442-53b2-b921-8f53e4fd56f9 → 34.0.0-beta.ee7533e8-2025-5ab5-9b84-699a87a6cc70
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 +38 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +258 -238
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -8,8 +8,8 @@ import { parse as yn } from "css";
|
|
|
8
8
|
import ki from "fuse.js";
|
|
9
9
|
import { Pith as va } from "pith";
|
|
10
10
|
import Et from "lodash.clonedeep";
|
|
11
|
-
import
|
|
12
|
-
import { jsx as P, jsxs as ct, Fragment as
|
|
11
|
+
import Yt from "lodash.isequal";
|
|
12
|
+
import { jsx as P, jsxs as ct, Fragment as Wt } from "preact/jsx-runtime";
|
|
13
13
|
import { parse as la } from "opentype.js";
|
|
14
14
|
import Mi from "handlebars";
|
|
15
15
|
import { dataUriToBuffer as Ti } from "data-uri-to-buffer";
|
|
@@ -24,38 +24,38 @@ import vn from "lodash.debounce";
|
|
|
24
24
|
import "fs";
|
|
25
25
|
import "path";
|
|
26
26
|
import $i from "lodash.omit";
|
|
27
|
-
var Ee = /* @__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))(Ee || {}), En = /* @__PURE__ */ ((n) => (n.AND = "AND", n.OR = "OR", n))(En || {}), z = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(z || {}), b = /* @__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))(b || {}), Ui = /* @__PURE__ */ ((n) => (n.Color = "Color", n.Colors = "Colors", n.Selection = "Selection", n.Selections = "Selections", n.Text = "Text", n.Upload = "Upload", n))(Ui || {}),
|
|
27
|
+
var Ee = /* @__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))(Ee || {}), En = /* @__PURE__ */ ((n) => (n.AND = "AND", n.OR = "OR", n))(En || {}), z = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(z || {}), b = /* @__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))(b || {}), Ui = /* @__PURE__ */ ((n) => (n.Color = "Color", n.Colors = "Colors", n.Selection = "Selection", n.Selections = "Selections", n.Text = "Text", n.Upload = "Upload", n))(Ui || {}), Jt = /* @__PURE__ */ ((n) => (n.ThreeD = "ThreeD", n.FreeDesign = "FreeDesign", n.Print = "Print", n))(Jt || {}), F = /* @__PURE__ */ ((n) => (n.Frame = "frame", n.Group = "group", n.Image = "image", n.Pattern = "pattern", n.Illustration = "illustration", n.Textbox = "textbox", n))(F || {}), Li = /* @__PURE__ */ ((n) => (n.Default = "Default", n.FirstTransaction = "FirstTransaction", n.OneToOne = "OneToOne", n))(Li || {}), bn = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Failed = "Failed", n.Validated = "Validated", n.Overridden = "Overridden", n))(bn || {}), Vi = /* @__PURE__ */ ((n) => (n.Hyperlink = "Hyperlink", n.Edit = "Edit", n.Approve = "Approve", n))(Vi || {}), zi = /* @__PURE__ */ ((n) => (n.Hub = "Hub", n.Shopify = "Shopify", n))(zi || {}), Ea = /* @__PURE__ */ ((n) => (n.BackgroundRemover = "BackgroundRemover", n.ConversionAccelerator = "Conversion Accelerator", n.ProcessBuilder = "ProcessBuilder", n))(Ea || {}), Gi = /* @__PURE__ */ ((n) => (n[n.Orbit = 0] = "Orbit", n[n.Pan = 1] = "Pan", n))(Gi || {}), be = /* @__PURE__ */ ((n) => (n.Owner = "Owner", n.Approver = "Approver", n.Editor = "Editor", n.Viewer = "Viewer", n))(be || {}), Mt = /* @__PURE__ */ ((n) => (n.Autosize = "Autosize", n.Traditional = "Traditional", n))(Mt || {}), j = /* @__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))(j || {}), Wi = /* @__PURE__ */ ((n) => (n.Pixel = "px", n.Millimeter = "mm", n.Centimeter = "cm", n))(Wi || {});
|
|
28
28
|
class In extends Error {
|
|
29
29
|
constructor(t) {
|
|
30
30
|
super(t), this.name = this.constructor.name;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
class
|
|
33
|
+
class te extends In {
|
|
34
34
|
constructor(t) {
|
|
35
35
|
super(`ConfigurationError - ${t}`);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
class Ie extends
|
|
38
|
+
class Ie extends te {
|
|
39
39
|
constructor(t) {
|
|
40
40
|
super(`Option not Configured: ${t.stepTitle}`), this.optionId = t?.optionId || "N/A";
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
class J extends
|
|
43
|
+
class J extends te {
|
|
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 te {
|
|
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 Kt extends te {
|
|
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 te {
|
|
59
59
|
constructor(t, e) {
|
|
60
60
|
super(`Workflow Misconfiguration: ${t.stepName} - ${e}`), this.step = t;
|
|
61
61
|
}
|
|
@@ -70,7 +70,7 @@ class Q extends Ne {
|
|
|
70
70
|
super(`Unhandled Behavior Encountered: ${t}`);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
class
|
|
73
|
+
class xt extends Ne {
|
|
74
74
|
constructor(t) {
|
|
75
75
|
super(`Parsing Error: ${t}`);
|
|
76
76
|
}
|
|
@@ -169,7 +169,7 @@ function ad(n) {
|
|
|
169
169
|
function nd(n) {
|
|
170
170
|
Aa = n;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function ee() {
|
|
173
173
|
return da ? new da().window : (console.log(
|
|
174
174
|
"DOM constructor is not registered. Assuming browser environment. If not, please register DOM constructor before calling this function."
|
|
175
175
|
), window);
|
|
@@ -197,17 +197,17 @@ const Bn = /* @__PURE__ */ new Map(), Wa = /* @__PURE__ */ new Map(), qa = /* @_
|
|
|
197
197
|
if (t) return t;
|
|
198
198
|
const a = (async () => await (await nt(n)).text())();
|
|
199
199
|
return qa.set(n, a), a;
|
|
200
|
-
},
|
|
201
|
-
if (
|
|
200
|
+
}, Tt = (n) => n.every((t) => t !== "undefined"), ce = (n) => Tt([typeof document]) ? document.createElement(n) : ee().document.createElement(n), Ji = (n, t) => {
|
|
201
|
+
if (Tt([typeof document]))
|
|
202
202
|
return document.createElementNS(n, t);
|
|
203
|
-
const a =
|
|
203
|
+
const a = ee().document.createElement(t);
|
|
204
204
|
return a.setAttribute("xmlns", n), a;
|
|
205
205
|
}, dt = () => {
|
|
206
|
-
if (
|
|
206
|
+
if (Tt([typeof DOMParser]))
|
|
207
207
|
return new DOMParser();
|
|
208
|
-
const n =
|
|
208
|
+
const n = ee();
|
|
209
209
|
return new n.DOMParser();
|
|
210
|
-
}, Ki = () =>
|
|
210
|
+
}, Ki = () => Tt([typeof DOMParser]) ? DOMParser : ee().DOMParser, Re = (n, t) => new Promise((e, a) => {
|
|
211
211
|
t ? Pn(n).then(e).catch(a) : nt(n).then((i) => {
|
|
212
212
|
i.arrayBuffer().then(e).catch(a);
|
|
213
213
|
}).catch((i) => {
|
|
@@ -218,7 +218,7 @@ const Bn = /* @__PURE__ */ new Map(), Wa = /* @__PURE__ */ new Map(), qa = /* @_
|
|
|
218
218
|
i.text().then(e).catch(a);
|
|
219
219
|
}).catch(a);
|
|
220
220
|
}), xn = (n) => xi(n), je = /* @__PURE__ */ new Map(), _i = async (n, t) => {
|
|
221
|
-
if (
|
|
221
|
+
if (Tt([typeof FontFace])) {
|
|
222
222
|
if (je.has(t))
|
|
223
223
|
return je.get(t);
|
|
224
224
|
const e = n.names.fullName.en, a = new FontFace(e, `url(${t})`);
|
|
@@ -227,9 +227,9 @@ const Bn = /* @__PURE__ */ new Map(), Wa = /* @__PURE__ */ new Map(), qa = /* @_
|
|
|
227
227
|
return je.set(t, i), i;
|
|
228
228
|
}
|
|
229
229
|
}, It = () => {
|
|
230
|
-
if (
|
|
230
|
+
if (Tt([typeof XMLSerializer]))
|
|
231
231
|
return new XMLSerializer();
|
|
232
|
-
const n =
|
|
232
|
+
const n = ee();
|
|
233
233
|
return new n.XMLSerializer();
|
|
234
234
|
}, Ha = (n) => btoa(n), Oe = (n) => {
|
|
235
235
|
function t() {
|
|
@@ -375,7 +375,7 @@ const ft = (n, t, e) => {
|
|
|
375
375
|
} catch {
|
|
376
376
|
throw new Error("Canvas module not set");
|
|
377
377
|
}
|
|
378
|
-
},
|
|
378
|
+
}, ae = (n, t) => {
|
|
379
379
|
if (ha !== void 0)
|
|
380
380
|
return ha(n, t);
|
|
381
381
|
try {
|
|
@@ -411,21 +411,21 @@ let Ye;
|
|
|
411
411
|
function Ba() {
|
|
412
412
|
return Ye === void 0 && (Ye = Ki()), Ye;
|
|
413
413
|
}
|
|
414
|
-
let
|
|
414
|
+
let de = null;
|
|
415
415
|
const cr = (n) => new Promise((t) => {
|
|
416
416
|
if (Oe(n) !== "image/jpeg")
|
|
417
417
|
return t(1);
|
|
418
418
|
Di(n).then((a) => t(a || 1)).catch(() => t(1));
|
|
419
419
|
}), dr = async () => {
|
|
420
|
-
if (
|
|
421
|
-
return !
|
|
422
|
-
const t = await
|
|
423
|
-
return
|
|
420
|
+
if (de !== null)
|
|
421
|
+
return !de;
|
|
422
|
+
const t = await ae("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAIAAwMBEQACEQEDEQH/xABRAAEAAAAAAAAAAAAAAAAAAAAKEAEBAQADAQEAAAAAAAAAAAAGBQQDCAkCBwEBAAAAAAAAAAAAAAAAAAAAABEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AG8T9NfSMEVMhQvoP3fFiRZ+MTHDifa/95OFSZU5OzRzxkyejv8ciEfhSceSXGjS8eSdLnZc2HDm4M3BxcXwH/9k=");
|
|
423
|
+
return de = t.width === 2 && t.height === 3, !de;
|
|
424
424
|
}, Ar = (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
|
}, ur = async (n) => {
|
|
428
|
-
const t = await Zi(n), e = await
|
|
428
|
+
const t = await Zi(n), e = await ae(t), [a, i] = Ar(e);
|
|
429
429
|
if (!await dr()) {
|
|
430
430
|
const A = ft(a, i);
|
|
431
431
|
return A.getContext("2d")?.drawImage(e, 0, 0, a, i), A;
|
|
@@ -466,7 +466,7 @@ const cr = (n) => new Promise((t) => {
|
|
|
466
466
|
height: t.height,
|
|
467
467
|
width: t.width
|
|
468
468
|
};
|
|
469
|
-
},
|
|
469
|
+
}, _t = [
|
|
470
470
|
"Yellow C",
|
|
471
471
|
"Yellow 012 C",
|
|
472
472
|
"Orange 021 C",
|
|
@@ -1808,7 +1808,7 @@ const cr = (n) => new Promise((t) => {
|
|
|
1808
1808
|
"Black 5 C",
|
|
1809
1809
|
"Black 6 C",
|
|
1810
1810
|
"Black 7 C"
|
|
1811
|
-
],
|
|
1811
|
+
], Dt = [
|
|
1812
1812
|
"FEDD00",
|
|
1813
1813
|
"FFD700",
|
|
1814
1814
|
"FE5000",
|
|
@@ -3150,18 +3150,18 @@ const cr = (n) => new Promise((t) => {
|
|
|
3150
3150
|
"3E2B2E",
|
|
3151
3151
|
"101820",
|
|
3152
3152
|
"3D3935"
|
|
3153
|
-
], Je =
|
|
3153
|
+
], Je = Dt.map((n) => [
|
|
3154
3154
|
parseInt(n.substring(0, 2), 16),
|
|
3155
3155
|
parseInt(n.substring(2, 4), 16),
|
|
3156
3156
|
parseInt(n.substring(4, 6), 16)
|
|
3157
3157
|
]);
|
|
3158
3158
|
function rd(n) {
|
|
3159
|
-
const t =
|
|
3160
|
-
return t >= 0 ?
|
|
3159
|
+
const t = _t.indexOf(n);
|
|
3160
|
+
return t >= 0 ? Dt[t] : "";
|
|
3161
3161
|
}
|
|
3162
3162
|
function hr(n) {
|
|
3163
|
-
const t =
|
|
3164
|
-
return t >= 0 ?
|
|
3163
|
+
const t = Dt.indexOf(n);
|
|
3164
|
+
return t >= 0 ? _t[t] : "";
|
|
3165
3165
|
}
|
|
3166
3166
|
function od(n, t = 64) {
|
|
3167
3167
|
const e = [], a = [], i = hr(n);
|
|
@@ -3172,36 +3172,36 @@ function od(n, t = 64) {
|
|
|
3172
3172
|
});
|
|
3173
3173
|
const r = parseInt(n.substring(0, 2), 16), o = parseInt(n.substring(2, 4), 16), s = parseInt(n.substring(4, 6), 16);
|
|
3174
3174
|
let l, c, d;
|
|
3175
|
-
for (let A = 0; A <
|
|
3175
|
+
for (let A = 0; A < Dt.length; A++) {
|
|
3176
3176
|
l = Je[A][0], c = Je[A][1], d = Je[A][2];
|
|
3177
3177
|
const u = Math.sqrt(Math.pow(r - l, 2) + Math.pow(o - c, 2) + Math.pow(s - d, 2));
|
|
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 === _t[A]) && e.push({ pms: _t[A], hex: Dt[A], distance: a[A] });
|
|
3182
3182
|
return e.sort((A, u) => A.distance - u.distance);
|
|
3183
3183
|
}
|
|
3184
|
-
const gr =
|
|
3184
|
+
const gr = _t.map((n, t) => ({ pms: n, hex: Dt[t] })), mr = new ki(gr, { keys: ["pms"] });
|
|
3185
3185
|
function sd(n, t) {
|
|
3186
3186
|
return mr.search(n, t ? { limit: t } : void 0);
|
|
3187
3187
|
}
|
|
3188
|
-
let
|
|
3188
|
+
let Rt = null;
|
|
3189
3189
|
function pr(n) {
|
|
3190
3190
|
if (n.startsWith("#"))
|
|
3191
3191
|
return ja(n);
|
|
3192
3192
|
if (!document)
|
|
3193
3193
|
throw new Error("browserColorToHex is only supported on browsers");
|
|
3194
|
-
if (
|
|
3194
|
+
if (Rt || (Rt = document.createElement("canvas").getContext("2d")), !Rt)
|
|
3195
3195
|
throw new Error("Failed to create canvas context required to convert colors");
|
|
3196
|
-
|
|
3197
|
-
const t = ja(
|
|
3196
|
+
Rt.fillStyle = n;
|
|
3197
|
+
const t = ja(Rt.fillStyle);
|
|
3198
3198
|
return t || console.error(`Unknown browser color ${n}`), t;
|
|
3199
3199
|
}
|
|
3200
3200
|
function ja(n) {
|
|
3201
3201
|
const t = n.substring(1).toUpperCase();
|
|
3202
3202
|
return t.length === 6 ? t : t.length === 3 ? `${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}` : "";
|
|
3203
3203
|
}
|
|
3204
|
-
const
|
|
3204
|
+
const Bt = (n) => {
|
|
3205
3205
|
const t = Tn(n.spotColor);
|
|
3206
3206
|
return t ? `${n.browserValue} ${t}` : n.browserValue;
|
|
3207
3207
|
}, Tn = (n) => {
|
|
@@ -3238,8 +3238,8 @@ const de = (n) => {
|
|
|
3238
3238
|
"textPath",
|
|
3239
3239
|
"tref",
|
|
3240
3240
|
"tspan"
|
|
3241
|
-
], Cr = ["fill", "stroke"],
|
|
3242
|
-
t(n), n.children.length > 0 && Array.from(n.children).forEach((e) =>
|
|
3241
|
+
], Cr = ["fill", "stroke"], kt = (n, t) => {
|
|
3242
|
+
t(n), n.children.length > 0 && Array.from(n.children).forEach((e) => kt(e, t));
|
|
3243
3243
|
}, wr = (n, t) => {
|
|
3244
3244
|
try {
|
|
3245
3245
|
return n.matches(t);
|
|
@@ -3249,7 +3249,7 @@ const de = (n) => {
|
|
|
3249
3249
|
}, Pa = (n, t = !1) => {
|
|
3250
3250
|
!t && n.setAttribute("preserveAspectRatio", "none");
|
|
3251
3251
|
const e = [];
|
|
3252
|
-
|
|
3252
|
+
kt(n, (a) => {
|
|
3253
3253
|
if (a.tagName === "script") {
|
|
3254
3254
|
a.remove();
|
|
3255
3255
|
return;
|
|
@@ -3275,7 +3275,7 @@ const de = (n) => {
|
|
|
3275
3275
|
}
|
|
3276
3276
|
}), r.length > 0 ? a.setAttribute("style", r.join(";")) : a.removeAttribute("style");
|
|
3277
3277
|
}
|
|
3278
|
-
}),
|
|
3278
|
+
}), kt(n, (a) => {
|
|
3279
3279
|
e.forEach((i) => {
|
|
3280
3280
|
i.selectors?.forEach((r) => {
|
|
3281
3281
|
wr(a, r) && i.declarations?.forEach((o) => {
|
|
@@ -3291,39 +3291,57 @@ const de = (n) => {
|
|
|
3291
3291
|
}, Nn = (n) => dt().parseFromString(n, "image/svg+xml").firstElementChild, Sr = (n, t, e) => {
|
|
3292
3292
|
n.setAttribute("height", `${e}px`), n.setAttribute("width", `${t}px`);
|
|
3293
3293
|
}, Qn = (n, t, e) => {
|
|
3294
|
-
|
|
3294
|
+
kt(n, (a) => {
|
|
3295
3295
|
const i = a.attributes.getNamedItem("fill");
|
|
3296
|
-
i && i.value !== "none" && a.classList.forEach((
|
|
3297
|
-
if (
|
|
3298
|
-
const
|
|
3299
|
-
if (
|
|
3296
|
+
i && i.value !== "none" && a.classList.forEach((s) => {
|
|
3297
|
+
if (s.startsWith("spiff-fill")) {
|
|
3298
|
+
const l = t[s.replace("spiff-fill-", "")];
|
|
3299
|
+
if (l)
|
|
3300
|
+
a.setAttribute(
|
|
3301
|
+
"fill",
|
|
3302
|
+
e ? Bt(l) : l.browserValue
|
|
3303
|
+
);
|
|
3304
|
+
else {
|
|
3305
|
+
const c = t[s];
|
|
3306
|
+
c && a.setAttribute(
|
|
3307
|
+
"fill",
|
|
3308
|
+
e ? Bt(c) : c.browserValue
|
|
3309
|
+
);
|
|
3310
|
+
}
|
|
3311
|
+
}
|
|
3312
|
+
});
|
|
3313
|
+
const r = a.attributes.getNamedItem("spiff-fill");
|
|
3314
|
+
r && r.value === "undefined" && a.classList.forEach((s) => {
|
|
3315
|
+
if (s.startsWith("spiff-fill")) {
|
|
3316
|
+
const l = t[s.replace("spiff-fill-", "")];
|
|
3317
|
+
if (l)
|
|
3300
3318
|
a.setAttribute(
|
|
3301
3319
|
"fill",
|
|
3302
|
-
e ?
|
|
3320
|
+
e ? Bt(l) : l.browserValue
|
|
3303
3321
|
);
|
|
3304
3322
|
else {
|
|
3305
|
-
const
|
|
3306
|
-
|
|
3323
|
+
const c = t[s];
|
|
3324
|
+
c && a.setAttribute(
|
|
3307
3325
|
"fill",
|
|
3308
|
-
e ?
|
|
3326
|
+
e ? Bt(c) : c.browserValue
|
|
3309
3327
|
);
|
|
3310
3328
|
}
|
|
3311
3329
|
}
|
|
3312
3330
|
});
|
|
3313
|
-
const
|
|
3314
|
-
|
|
3315
|
-
if (
|
|
3316
|
-
const
|
|
3317
|
-
if (
|
|
3331
|
+
const o = a.attributes.getNamedItem("stroke");
|
|
3332
|
+
o && o.value !== "none" && a.classList.forEach((s) => {
|
|
3333
|
+
if (s.startsWith("spiff-stroke")) {
|
|
3334
|
+
const l = t[s.replace("spiff-stroke-", "")];
|
|
3335
|
+
if (l)
|
|
3318
3336
|
a.setAttribute(
|
|
3319
3337
|
"stroke",
|
|
3320
|
-
e ?
|
|
3338
|
+
e ? Bt(l) : l.browserValue
|
|
3321
3339
|
);
|
|
3322
3340
|
else {
|
|
3323
|
-
const
|
|
3324
|
-
|
|
3341
|
+
const c = t[s];
|
|
3342
|
+
c && a.setAttribute(
|
|
3325
3343
|
"fill",
|
|
3326
|
-
e ?
|
|
3344
|
+
e ? Bt(c) : c.browserValue
|
|
3327
3345
|
);
|
|
3328
3346
|
}
|
|
3329
3347
|
}
|
|
@@ -3348,10 +3366,10 @@ const de = (n) => {
|
|
|
3348
3366
|
throw new Error("Failed to read SVG.");
|
|
3349
3367
|
Pa(e);
|
|
3350
3368
|
const a = {};
|
|
3351
|
-
|
|
3369
|
+
kt(e, (o) => {
|
|
3352
3370
|
if (fr.includes(o.tagName) && !o.attributes.getNamedItem("fill")) {
|
|
3353
|
-
const c = "spiff-fill-
|
|
3354
|
-
o.setAttribute("spiff-fill", "
|
|
3371
|
+
const c = "spiff-fill-undefined";
|
|
3372
|
+
o.setAttribute("spiff-fill", "undefined"), o.classList.add(c), a.undefined = { browserValue: "undefined" };
|
|
3355
3373
|
}
|
|
3356
3374
|
const s = o.attributes.getNamedItem("fill");
|
|
3357
3375
|
if (s && s.value !== "none" && !s.value.startsWith("url(")) {
|
|
@@ -3376,7 +3394,7 @@ const de = (n) => {
|
|
|
3376
3394
|
value
|
|
3377
3395
|
}
|
|
3378
3396
|
}
|
|
3379
|
-
`,
|
|
3397
|
+
`, ne = (n) => C`
|
|
3380
3398
|
${n && Er || ""}
|
|
3381
3399
|
fragment AssetFields on Asset {
|
|
3382
3400
|
name
|
|
@@ -3420,7 +3438,7 @@ const de = (n) => {
|
|
|
3420
3438
|
${n && "...AssetMetadataFields" || ""}
|
|
3421
3439
|
}
|
|
3422
3440
|
`, br = C`
|
|
3423
|
-
${
|
|
3441
|
+
${ne(!1)}
|
|
3424
3442
|
query GetAssets($keys: [String]!) {
|
|
3425
3443
|
assets(keys: $keys) {
|
|
3426
3444
|
...AssetFields
|
|
@@ -3495,7 +3513,7 @@ const de = (n) => {
|
|
|
3495
3513
|
}
|
|
3496
3514
|
}
|
|
3497
3515
|
`, Pr = C`
|
|
3498
|
-
${
|
|
3516
|
+
${ne(!1)}
|
|
3499
3517
|
mutation RemoveBackgroundFromAsset($key: String!) {
|
|
3500
3518
|
assetRemoveBackground(key: $key) {
|
|
3501
3519
|
...AssetFields
|
|
@@ -3663,7 +3681,7 @@ class Dr {
|
|
|
3663
3681
|
async postProcessFileUpload(t, e) {
|
|
3664
3682
|
if (e === "image/svg+xml") {
|
|
3665
3683
|
const a = await t.blob.text(), o = new window.DOMParser().parseFromString(a, "image/svg+xml").documentElement;
|
|
3666
|
-
if (!o) throw new
|
|
3684
|
+
if (!o) throw new xt("Failed to read SVG.");
|
|
3667
3685
|
yr(o);
|
|
3668
3686
|
const l = It().serializeToString(o);
|
|
3669
3687
|
return {
|
|
@@ -3700,7 +3718,7 @@ class Dr {
|
|
|
3700
3718
|
}
|
|
3701
3719
|
}
|
|
3702
3720
|
}
|
|
3703
|
-
const
|
|
3721
|
+
const Ot = "persistentAssets", lt = class lt {
|
|
3704
3722
|
/**
|
|
3705
3723
|
* Add a new asset to persistence
|
|
3706
3724
|
* @param asset The asset to add.
|
|
@@ -3712,26 +3730,26 @@ const Rt = "persistentAssets", lt = class lt {
|
|
|
3712
3730
|
}
|
|
3713
3731
|
const e = /* @__PURE__ */ new Map();
|
|
3714
3732
|
e.set(t.key || "", t.fileLink);
|
|
3715
|
-
const a = k.getMap(
|
|
3733
|
+
const a = k.getMap(Ot);
|
|
3716
3734
|
a && a.forEach((i, r) => {
|
|
3717
3735
|
e.set(r, i);
|
|
3718
|
-
}), k.setMap(
|
|
3736
|
+
}), k.setMap(Ot, e), lt.executeCallbacks();
|
|
3719
3737
|
}
|
|
3720
3738
|
/**
|
|
3721
3739
|
* Remove an existing asset from persistence. Noop if the asset doesn't exist.
|
|
3722
3740
|
* @param assetKey The key to remove.
|
|
3723
3741
|
*/
|
|
3724
3742
|
static remove(t) {
|
|
3725
|
-
const e = k.getMap(
|
|
3743
|
+
const e = k.getMap(Ot);
|
|
3726
3744
|
if (!e) return;
|
|
3727
3745
|
const a = Array.from(e.entries()).find((i) => i[0] === t);
|
|
3728
|
-
a && (e.delete(a[0]), k.setMap(
|
|
3746
|
+
a && (e.delete(a[0]), k.setMap(Ot, e), lt.executeCallbacks());
|
|
3729
3747
|
}
|
|
3730
3748
|
/**
|
|
3731
3749
|
* Get a list of all persisted assets.
|
|
3732
3750
|
*/
|
|
3733
3751
|
static list() {
|
|
3734
|
-
const t = k.getMap(
|
|
3752
|
+
const t = k.getMap(Ot);
|
|
3735
3753
|
return t ? Array.from(t.entries()).map((e) => ({ assetKey: e[0], src: e[1] })) : [];
|
|
3736
3754
|
}
|
|
3737
3755
|
/**
|
|
@@ -3815,7 +3833,7 @@ class kr {
|
|
|
3815
3833
|
this.disabled = t;
|
|
3816
3834
|
}
|
|
3817
3835
|
}
|
|
3818
|
-
const
|
|
3836
|
+
const Xt = new kr(), On = C`
|
|
3819
3837
|
fragment OptionFields on Option {
|
|
3820
3838
|
id
|
|
3821
3839
|
name
|
|
@@ -3857,7 +3875,7 @@ const _t = new kr(), On = C`
|
|
|
3857
3875
|
}
|
|
3858
3876
|
}
|
|
3859
3877
|
`, Mr = C`
|
|
3860
|
-
${
|
|
3878
|
+
${ne(!1)}
|
|
3861
3879
|
${Da}
|
|
3862
3880
|
${On}
|
|
3863
3881
|
query GetOptions($ids: [String]!) {
|
|
@@ -3879,11 +3897,11 @@ const _t = new kr(), On = C`
|
|
|
3879
3897
|
});
|
|
3880
3898
|
}), t.data.options;
|
|
3881
3899
|
}, Nr = async (n, t) => (await t).find((a) => a.id === n), Qr = async (n) => {
|
|
3882
|
-
const t = n.map((o) =>
|
|
3900
|
+
const t = n.map((o) => Xt.get({ id: o })), e = n.filter((o, s) => t[s] === void 0);
|
|
3883
3901
|
if (e.length === 0)
|
|
3884
3902
|
return Promise.all(t);
|
|
3885
3903
|
const a = Tr(e), i = e.map(
|
|
3886
|
-
(o) =>
|
|
3904
|
+
(o) => Xt.set({ id: o }, Nr(o, a))
|
|
3887
3905
|
), r = t.filter((o) => o !== void 0);
|
|
3888
3906
|
return await Promise.all(r.concat(i));
|
|
3889
3907
|
};
|
|
@@ -3986,7 +4004,7 @@ const Y = new Rr(), $n = C`
|
|
|
3986
4004
|
customField5
|
|
3987
4005
|
conversionConfigurationId
|
|
3988
4006
|
}
|
|
3989
|
-
`,
|
|
4007
|
+
`, ie = C`
|
|
3990
4008
|
fragment ConversionConfigurationFields on ConversionConfiguration {
|
|
3991
4009
|
id
|
|
3992
4010
|
partnerId
|
|
@@ -4063,7 +4081,7 @@ const Y = new Rr(), $n = C`
|
|
|
4063
4081
|
}
|
|
4064
4082
|
`, $r = C`
|
|
4065
4083
|
${Ue}
|
|
4066
|
-
${
|
|
4084
|
+
${ie}
|
|
4067
4085
|
${$n}
|
|
4068
4086
|
query ReadIntegrationProducts($ids: [String!]!) {
|
|
4069
4087
|
integrationProducts(ids: $ids) {
|
|
@@ -4224,14 +4242,14 @@ const Y = new Rr(), $n = C`
|
|
|
4224
4242
|
}
|
|
4225
4243
|
}
|
|
4226
4244
|
`, Gr = C`
|
|
4227
|
-
${
|
|
4245
|
+
${ie}
|
|
4228
4246
|
query ReadConversionConfigurationQuery($id: String!) {
|
|
4229
4247
|
conversionConfiguration(id: $id) {
|
|
4230
4248
|
...ConversionConfigurationFields
|
|
4231
4249
|
}
|
|
4232
4250
|
}
|
|
4233
4251
|
`, Wr = C`
|
|
4234
|
-
${
|
|
4252
|
+
${ie}
|
|
4235
4253
|
query ReadTransactionForDesignCreation($id: String!) {
|
|
4236
4254
|
transactions(ids: [$id]) {
|
|
4237
4255
|
id
|
|
@@ -4541,7 +4559,7 @@ const Y = new Rr(), $n = C`
|
|
|
4541
4559
|
name
|
|
4542
4560
|
}
|
|
4543
4561
|
`, eo = (n) => C`
|
|
4544
|
-
${
|
|
4562
|
+
${ne(n)}
|
|
4545
4563
|
${Da}
|
|
4546
4564
|
${On}
|
|
4547
4565
|
${_r}
|
|
@@ -4965,7 +4983,7 @@ const Y = new Rr(), $n = C`
|
|
|
4965
4983
|
}
|
|
4966
4984
|
}
|
|
4967
4985
|
`, no = C`
|
|
4968
|
-
${
|
|
4986
|
+
${ne(!1)}
|
|
4969
4987
|
query GetWorkflowForTheme($id: String!) {
|
|
4970
4988
|
workflow(id: $id) {
|
|
4971
4989
|
id
|
|
@@ -4987,7 +5005,7 @@ const Y = new Rr(), $n = C`
|
|
|
4987
5005
|
}
|
|
4988
5006
|
}
|
|
4989
5007
|
`, Le = C`
|
|
4990
|
-
${
|
|
5008
|
+
${ie}
|
|
4991
5009
|
fragment MarketplaceThemeInstallConfigurationFields on MarketplaceThemeInstallConfiguration {
|
|
4992
5010
|
id
|
|
4993
5011
|
themeInstallId
|
|
@@ -5107,7 +5125,7 @@ const Y = new Rr(), $n = C`
|
|
|
5107
5125
|
timestamp
|
|
5108
5126
|
}
|
|
5109
5127
|
}
|
|
5110
|
-
`,
|
|
5128
|
+
`, $t = [b.SilentIllustration, b.ProductOverlay], Ao = async (n) => {
|
|
5111
5129
|
const t = [];
|
|
5112
5130
|
n.introduction && t.push({
|
|
5113
5131
|
name: "Introduction",
|
|
@@ -5130,16 +5148,16 @@ const Y = new Rr(), $n = C`
|
|
|
5130
5148
|
t.push({
|
|
5131
5149
|
name: a.stepName,
|
|
5132
5150
|
title: a.stepTitle,
|
|
5133
|
-
renderableSteps:
|
|
5134
|
-
silentSteps:
|
|
5151
|
+
renderableSteps: $t.includes(a.type) ? [] : [a],
|
|
5152
|
+
silentSteps: $t.includes(a.type) ? [a] : []
|
|
5135
5153
|
});
|
|
5136
5154
|
else {
|
|
5137
5155
|
const r = t.find((o) => o.name === i.name);
|
|
5138
|
-
r ?
|
|
5156
|
+
r ? $t.includes(a.type) ? r.silentSteps.push(a) : r.renderableSteps.push(a) : t.push({
|
|
5139
5157
|
name: i.name,
|
|
5140
5158
|
title: i.name,
|
|
5141
|
-
renderableSteps:
|
|
5142
|
-
silentSteps:
|
|
5159
|
+
renderableSteps: $t.includes(a.type) ? [] : [a],
|
|
5160
|
+
silentSteps: $t.includes(a.type) ? [a] : []
|
|
5143
5161
|
});
|
|
5144
5162
|
}
|
|
5145
5163
|
}
|
|
@@ -5288,7 +5306,7 @@ const M = () => {
|
|
|
5288
5306
|
viewBox: A,
|
|
5289
5307
|
width: u
|
|
5290
5308
|
}) => {
|
|
5291
|
-
const h = e || 0, g = 2 * (l?.scale || 1), m = A || { x: 0, y: 0, width: u, height: r }, p = `${m.x} ${m.y} ${m.width} ${m.height}`, f = M(), S = a.purpose ===
|
|
5309
|
+
const h = e || 0, g = 2 * (l?.scale || 1), m = A || { x: 0, y: 0, width: u, height: r }, p = `${m.x} ${m.y} ${m.width} ${m.height}`, f = M(), S = a.purpose === Jt.FreeDesign && /* @__PURE__ */ P("defs", { children: /* @__PURE__ */ P("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ P("rect", { width: m.width, height: m.height, rx: h }) }) }), w = a.colorProfiles?.map((E, I) => (
|
|
5292
5310
|
/* @ts-ignore */
|
|
5293
5311
|
/* @__PURE__ */ P("color-profile", { name: E.name, xlinkHref: E.key, children: " " }, I)
|
|
5294
5312
|
)), x = i.map((E) => ({
|
|
@@ -5331,7 +5349,7 @@ const M = () => {
|
|
|
5331
5349
|
"g",
|
|
5332
5350
|
{
|
|
5333
5351
|
id: "element-group",
|
|
5334
|
-
clipPath: a.purpose ===
|
|
5352
|
+
clipPath: a.purpose === Jt.FreeDesign ? "url(#viewboxClip)" : void 0,
|
|
5335
5353
|
children: v.map((E) => Xn(E)).filter((E) => !!E)
|
|
5336
5354
|
}
|
|
5337
5355
|
),
|
|
@@ -5402,7 +5420,7 @@ const M = () => {
|
|
|
5402
5420
|
}), md = (n, t, e, a) => ({
|
|
5403
5421
|
x: n.x + (t?.x + t?.width) * e,
|
|
5404
5422
|
y: n.y + (t?.y + t?.height) * a
|
|
5405
|
-
}),
|
|
5423
|
+
}), Pt = (n) => {
|
|
5406
5424
|
switch (n) {
|
|
5407
5425
|
case j.North:
|
|
5408
5426
|
return j.East;
|
|
@@ -5421,7 +5439,7 @@ const M = () => {
|
|
|
5421
5439
|
case j.Southwest:
|
|
5422
5440
|
return j.Northwest;
|
|
5423
5441
|
}
|
|
5424
|
-
}, pd = (n, t) => t > 45 && t <= 135 ?
|
|
5442
|
+
}, pd = (n, t) => t > 45 && t <= 135 ? Pt(n) : t > 135 && t <= 225 ? Pt(Pt(n)) : t > 225 && t <= 315 ? Pt(Pt(Pt(n))) : n, fd = (n, t = { x: 0, y: 0 }, e = { x: 1, y: 1 }) => {
|
|
5425
5443
|
const a = Ct(n.rotation), i = {
|
|
5426
5444
|
x: t.x + n.x * e.x,
|
|
5427
5445
|
y: t.x + n.y * e.y
|
|
@@ -5475,7 +5493,7 @@ const M = () => {
|
|
|
5475
5493
|
) });
|
|
5476
5494
|
}, Hn = (n) => {
|
|
5477
5495
|
const t = `spiff-group-clip-${n.id}`, e = n.rotation || 0, a = Ct(e), i = Math.cos(a), r = -Math.sin(a), o = Ma(n.children);
|
|
5478
|
-
return /* @__PURE__ */ ct(
|
|
5496
|
+
return /* @__PURE__ */ ct(Wt, { children: [
|
|
5479
5497
|
/* @__PURE__ */ P("defs", { children: /* @__PURE__ */ P("clipPath", { id: t, preserveAspectRatio: "none", children: n.clipPath ? /* @__PURE__ */ P("path", { d: n.clipPath }) : /* @__PURE__ */ P("rect", { x: 0, y: 0, width: n.width, height: n.height }) }) }),
|
|
5480
5498
|
/* @__PURE__ */ ct(
|
|
5481
5499
|
"g",
|
|
@@ -5515,8 +5533,8 @@ const M = () => {
|
|
|
5515
5533
|
return n.pattern.src;
|
|
5516
5534
|
};
|
|
5517
5535
|
if (!a())
|
|
5518
|
-
return /* @__PURE__ */ P(
|
|
5519
|
-
const i = () => n.threshold ? n.invertThreshold ? "1 ".repeat(n.threshold) + "0 ".repeat(256 - n.threshold) : "0 ".repeat(n.threshold) + "1 ".repeat(256 - n.threshold) : "", r = () => /* @__PURE__ */ P(
|
|
5536
|
+
return /* @__PURE__ */ P(Wt, {});
|
|
5537
|
+
const i = () => n.threshold ? n.invertThreshold ? "1 ".repeat(n.threshold) + "0 ".repeat(256 - n.threshold) : "0 ".repeat(n.threshold) + "1 ".repeat(256 - n.threshold) : "", r = () => /* @__PURE__ */ P(Wt, { children: n.useThreshold && /* @__PURE__ */ P("defs", { children: /* @__PURE__ */ ct("filter", { id: e, "color-interpolation-filters": "sRGB", children: [
|
|
5520
5538
|
/* @__PURE__ */ P(
|
|
5521
5539
|
"feColorMatrix",
|
|
5522
5540
|
{
|
|
@@ -5559,7 +5577,7 @@ const M = () => {
|
|
|
5559
5577
|
src: a()
|
|
5560
5578
|
}];
|
|
5561
5579
|
};
|
|
5562
|
-
return /* @__PURE__ */ ct(
|
|
5580
|
+
return /* @__PURE__ */ ct(Wt, { children: [
|
|
5563
5581
|
r(),
|
|
5564
5582
|
/* @__PURE__ */ P(
|
|
5565
5583
|
"g",
|
|
@@ -5645,7 +5663,7 @@ class fo {
|
|
|
5645
5663
|
}), a - i;
|
|
5646
5664
|
}
|
|
5647
5665
|
}
|
|
5648
|
-
const Co = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @__PURE__ */ new Map(),
|
|
5666
|
+
const Co = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @__PURE__ */ new Map(), Nt = async (n) => {
|
|
5649
5667
|
if (Ke.has(n))
|
|
5650
5668
|
return Ke.get(n);
|
|
5651
5669
|
const e = (async () => {
|
|
@@ -5687,7 +5705,7 @@ const Co = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5687
5705
|
});
|
|
5688
5706
|
const o = e.querySelectorAll("tspan");
|
|
5689
5707
|
for (let d = 0; d < o.length; d++) {
|
|
5690
|
-
const A = o.item(d), u = A.closest("text"), h = A.closest("g"), g = u.getAttribute("font-family"), m = await
|
|
5708
|
+
const A = o.item(d), u = A.closest("text"), h = A.closest("g"), g = u.getAttribute("font-family"), m = await Nt(i.get(g)), p = u.getAttribute("fill"), f = u.getAttribute("stroke"), S = u.getAttribute("stroke-width"), w = m.getPath(
|
|
5691
5709
|
A.innerHTML,
|
|
5692
5710
|
0,
|
|
5693
5711
|
0,
|
|
@@ -5820,10 +5838,10 @@ const Co = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5820
5838
|
let a = n || "";
|
|
5821
5839
|
return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
|
|
5822
5840
|
`)), a;
|
|
5823
|
-
}, bo = (n, t) => n.map((e, a) => [e, t[a]]), Io = (n = "center", t = !1) => t ? "center" : n, Jn = (n) => n === "left" ? "start" : n === "right" ? "end" : "middle",
|
|
5841
|
+
}, bo = (n, t) => n.map((e, a) => [e, t[a]]), Io = (n = "center", t = !1) => t ? "center" : n, Jn = (n) => n === "left" ? "start" : n === "right" ? "end" : "middle", re = (n, t, e) => n.fontData ? {
|
|
5824
5842
|
...n,
|
|
5825
5843
|
...(() => {
|
|
5826
|
-
if (n.algorithm ===
|
|
5844
|
+
if (n.algorithm === Mt.Traditional) {
|
|
5827
5845
|
const i = So(t, n, e, n.lineHeight);
|
|
5828
5846
|
return {
|
|
5829
5847
|
text: i.lines.join(`
|
|
@@ -5839,7 +5857,7 @@ const Co = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5839
5857
|
};
|
|
5840
5858
|
})()
|
|
5841
5859
|
} : n, Kn = 1.1;
|
|
5842
|
-
function
|
|
5860
|
+
function Ft(n, t) {
|
|
5843
5861
|
return _n(n, t.getTemplatingContext());
|
|
5844
5862
|
}
|
|
5845
5863
|
function _n(n, t) {
|
|
@@ -5856,7 +5874,7 @@ const Bo = (n) => {
|
|
|
5856
5874
|
if (n.curved && !n.paths || !n.fontData)
|
|
5857
5875
|
return null;
|
|
5858
5876
|
const h = () => n.textFillImage ? `url("#${o}")` : n._renderingConfiguration?.spotColors && n.fillSpotColorDefinition ? `${n.fill} ${Tn(n.fillSpotColorDefinition)}` : n.fill;
|
|
5859
|
-
return /* @__PURE__ */ ct(
|
|
5877
|
+
return /* @__PURE__ */ ct(Wt, { children: [
|
|
5860
5878
|
/* @__PURE__ */ ct("defs", { children: [
|
|
5861
5879
|
n.textFillImage && /* @__PURE__ */ P(
|
|
5862
5880
|
"pattern",
|
|
@@ -6133,7 +6151,7 @@ function Ma(n) {
|
|
|
6133
6151
|
return r < o ? -1 : r > o ? 1 : 0;
|
|
6134
6152
|
});
|
|
6135
6153
|
}
|
|
6136
|
-
const
|
|
6154
|
+
const oe = (n) => {
|
|
6137
6155
|
const t = n.variants;
|
|
6138
6156
|
if (t) {
|
|
6139
6157
|
if (t.length === 1)
|
|
@@ -6141,7 +6159,7 @@ const re = (n) => {
|
|
|
6141
6159
|
if (n.defaultVariant !== void 0)
|
|
6142
6160
|
return t.find((e) => e.id === n.defaultVariant);
|
|
6143
6161
|
}
|
|
6144
|
-
}, ht = /* @__PURE__ */ new Map(),
|
|
6162
|
+
}, ht = /* @__PURE__ */ new Map(), zt = /* @__PURE__ */ new Map(), Xe = /* @__PURE__ */ new Map(), Zn = async (n, t) => {
|
|
6145
6163
|
if (!t) {
|
|
6146
6164
|
if (!n) throw new Error("No region or src supplied. Cannot construct frame!");
|
|
6147
6165
|
return ma(n);
|
|
@@ -6156,7 +6174,7 @@ const re = (n) => {
|
|
|
6156
6174
|
}, ko = (n, t) => {
|
|
6157
6175
|
if (!t)
|
|
6158
6176
|
return;
|
|
6159
|
-
const e = t.variants?.find((a) => a.id === n.frameVariantId) ||
|
|
6177
|
+
const e = t.variants?.find((a) => a.id === n.frameVariantId) || oe(t);
|
|
6160
6178
|
if (!e)
|
|
6161
6179
|
throw new Error(`No variant with ID: ${n.frameVariantId}`);
|
|
6162
6180
|
if (!e.asset)
|
|
@@ -6166,8 +6184,8 @@ const re = (n) => {
|
|
|
6166
6184
|
if (Xe.has(n))
|
|
6167
6185
|
return Xe.get(n);
|
|
6168
6186
|
const e = (async () => {
|
|
6169
|
-
if (
|
|
6170
|
-
return
|
|
6187
|
+
if (zt.has(n))
|
|
6188
|
+
return zt.get(n);
|
|
6171
6189
|
await new Promise((u) => setTimeout(u, 0));
|
|
6172
6190
|
const i = dt().parseFromString(n, "image/svg+xml"), r = i.querySelector("svg");
|
|
6173
6191
|
if (!r)
|
|
@@ -6185,7 +6203,7 @@ const re = (n) => {
|
|
|
6185
6203
|
width: c,
|
|
6186
6204
|
height: l
|
|
6187
6205
|
};
|
|
6188
|
-
return
|
|
6206
|
+
return zt.set(u, h), h;
|
|
6189
6207
|
}
|
|
6190
6208
|
if (A) {
|
|
6191
6209
|
const u = A.getAttribute("d");
|
|
@@ -6196,7 +6214,7 @@ const re = (n) => {
|
|
|
6196
6214
|
width: c,
|
|
6197
6215
|
height: l
|
|
6198
6216
|
};
|
|
6199
|
-
return
|
|
6217
|
+
return zt.set(u, h), h;
|
|
6200
6218
|
}
|
|
6201
6219
|
throw new Error("Malformed frame SVG");
|
|
6202
6220
|
})();
|
|
@@ -6254,14 +6272,14 @@ const re = (n) => {
|
|
|
6254
6272
|
width: s[2],
|
|
6255
6273
|
height: s[3]
|
|
6256
6274
|
};
|
|
6257
|
-
},
|
|
6275
|
+
}, Ut = (n, t) => {
|
|
6258
6276
|
const e = n.layoutState.elements.filter((i) => i.layer === t), a = Math.max(...e.map((i) => i.layerIndex).filter((i) => i !== void 0));
|
|
6259
6277
|
return Math.max(a, 0) + 1;
|
|
6260
6278
|
}, ei = async (n) => new Promise((t) => {
|
|
6261
6279
|
at(n).then((e) => {
|
|
6262
6280
|
t(e);
|
|
6263
6281
|
}).catch((e) => console.error(e));
|
|
6264
|
-
}), Ze = /* @__PURE__ */ new Map(),
|
|
6282
|
+
}), Ze = /* @__PURE__ */ new Map(), Zt = async (n) => {
|
|
6265
6283
|
if (Ze.has(n))
|
|
6266
6284
|
return Ze.get(n);
|
|
6267
6285
|
const t = async (i) => new Promise((r, o) => {
|
|
@@ -6283,7 +6301,7 @@ const re = (n) => {
|
|
|
6283
6301
|
anonymousCrossOrigin: !0,
|
|
6284
6302
|
ignoreDimensions: !1,
|
|
6285
6303
|
createCanvas: ft,
|
|
6286
|
-
createImage:
|
|
6304
|
+
createImage: ae,
|
|
6287
6305
|
DOMParser: Ba(),
|
|
6288
6306
|
fetch: nt
|
|
6289
6307
|
}), u = o.getAttribute("width"), h = o.getAttribute("height"), g = 2048;
|
|
@@ -6295,7 +6313,7 @@ const re = (n) => {
|
|
|
6295
6313
|
return await A.render(), await t(c);
|
|
6296
6314
|
})();
|
|
6297
6315
|
return Ze.set(n, a), a;
|
|
6298
|
-
},
|
|
6316
|
+
}, Lt = async (n, t, e, a) => {
|
|
6299
6317
|
const i = n.layoutState.layout.useEditableArea && n.layoutState.layout.editableArea || {
|
|
6300
6318
|
width: n.layoutState.layout.width,
|
|
6301
6319
|
height: n.layoutState.layout.height,
|
|
@@ -6320,7 +6338,7 @@ const re = (n) => {
|
|
|
6320
6338
|
s.height = s.width / A, s.top += (l - s.height) / 2;
|
|
6321
6339
|
}
|
|
6322
6340
|
if (e && t === F.Textbox && a?.text && a?.fontScale) {
|
|
6323
|
-
await
|
|
6341
|
+
await Nt(e);
|
|
6324
6342
|
const l = wt(e), c = mt(a.text, a?.fontScale, l);
|
|
6325
6343
|
s.width = Math.min(c, i.width * 0.85), s.left = i.x + i.width / 2 - s.width / 2;
|
|
6326
6344
|
}
|
|
@@ -6328,7 +6346,7 @@ const re = (n) => {
|
|
|
6328
6346
|
};
|
|
6329
6347
|
class Sd {
|
|
6330
6348
|
static async getFrame(t, e) {
|
|
6331
|
-
const a = await Zn(e.region, e.src), i = await Ve(a), r = e.region || await
|
|
6349
|
+
const a = await Zn(e.region, e.src), i = await Ve(a), r = e.region || await Lt(t, F.Frame);
|
|
6332
6350
|
return {
|
|
6333
6351
|
id: M(),
|
|
6334
6352
|
x: r.left,
|
|
@@ -6336,7 +6354,7 @@ class Sd {
|
|
|
6336
6354
|
width: r.width,
|
|
6337
6355
|
height: r.height,
|
|
6338
6356
|
layer: r.layer || 0,
|
|
6339
|
-
layerIndex: r.layerIndex ||
|
|
6357
|
+
layerIndex: r.layerIndex || Ut(t, r.layer || 0),
|
|
6340
6358
|
rotation: r.rotation,
|
|
6341
6359
|
scaleX: r.width / i.width,
|
|
6342
6360
|
scaleY: r.height / i.height,
|
|
@@ -6354,7 +6372,7 @@ class Sd {
|
|
|
6354
6372
|
};
|
|
6355
6373
|
}
|
|
6356
6374
|
static async getImage(t, e) {
|
|
6357
|
-
const a = e.region || await
|
|
6375
|
+
const a = e.region || await Lt(t, F.Image, e.src);
|
|
6358
6376
|
return {
|
|
6359
6377
|
id: M(),
|
|
6360
6378
|
src: e.src,
|
|
@@ -6365,22 +6383,22 @@ class Sd {
|
|
|
6365
6383
|
width: a.width,
|
|
6366
6384
|
height: a.height,
|
|
6367
6385
|
layer: a.layer || 0,
|
|
6368
|
-
layerIndex: a.layerIndex ||
|
|
6386
|
+
layerIndex: a.layerIndex || Ut(t, a.layer || 0),
|
|
6369
6387
|
immutable: a.immutable,
|
|
6370
6388
|
preserveAspectRatio: "none"
|
|
6371
6389
|
};
|
|
6372
6390
|
}
|
|
6373
6391
|
static async getTextbox(t, e) {
|
|
6374
|
-
const { configuration: a, fontSrc: i, designInputStep: r } = e, o = await
|
|
6392
|
+
const { configuration: a, fontSrc: i, designInputStep: r } = e, o = await Nt(i), s = {
|
|
6375
6393
|
assetUrl: i,
|
|
6376
6394
|
name: o.names.fullName.en
|
|
6377
6395
|
}, l = r?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = Fe(c, {
|
|
6378
6396
|
vertical: a.vertical,
|
|
6379
6397
|
uppercase: a.uppercase
|
|
6380
|
-
}), A = e.region || await
|
|
6398
|
+
}), A = e.region || await Lt(t, F.Textbox, i, {
|
|
6381
6399
|
text: d,
|
|
6382
6400
|
fontScale: a.size ? a.size / o.unitsPerEm : void 0
|
|
6383
|
-
}), u =
|
|
6401
|
+
}), u = re(
|
|
6384
6402
|
{
|
|
6385
6403
|
id: M(),
|
|
6386
6404
|
type: F.Textbox,
|
|
@@ -6393,12 +6411,12 @@ class Sd {
|
|
|
6393
6411
|
fill: r?.color || a.colour || "#000000",
|
|
6394
6412
|
fontData: s,
|
|
6395
6413
|
layer: A.layer || 0,
|
|
6396
|
-
layerIndex: A.layerIndex ||
|
|
6414
|
+
layerIndex: A.layerIndex || Ut(t, A.layer || 0),
|
|
6397
6415
|
paths: a.paths,
|
|
6398
6416
|
rotation: A.rotation,
|
|
6399
6417
|
vertical: a.vertical,
|
|
6400
6418
|
verticalAlign: a.verticalAlign || "middle",
|
|
6401
|
-
algorithm:
|
|
6419
|
+
algorithm: Mt.Traditional,
|
|
6402
6420
|
fontSize: a.size || Math.max(Math.round(A.height * 0.025), 1),
|
|
6403
6421
|
text: d,
|
|
6404
6422
|
input: l
|
|
@@ -6443,7 +6461,7 @@ class Sd {
|
|
|
6443
6461
|
</svg>
|
|
6444
6462
|
`, i = {};
|
|
6445
6463
|
i["spiff-fill-shape"] = { browserValue: e.color };
|
|
6446
|
-
const r = e.region?.item || await
|
|
6464
|
+
const r = e.region?.item || await Lt(t, F.Illustration), o = M();
|
|
6447
6465
|
return {
|
|
6448
6466
|
stepRegion: e.region?.item,
|
|
6449
6467
|
stepRegionIndex: e.region?.index,
|
|
@@ -6457,12 +6475,12 @@ class Sd {
|
|
|
6457
6475
|
width: r.width,
|
|
6458
6476
|
height: r.height,
|
|
6459
6477
|
layer: r.layer || 0,
|
|
6460
|
-
layerIndex: r.layerIndex ||
|
|
6478
|
+
layerIndex: r.layerIndex || Ut(t, r.layer || 0),
|
|
6461
6479
|
immutable: r.immutable
|
|
6462
6480
|
};
|
|
6463
6481
|
}
|
|
6464
6482
|
static async getIllustration(t, e) {
|
|
6465
|
-
const a = e.region?.item || await
|
|
6483
|
+
const a = e.region?.item || await Lt(t, F.Illustration, e.src), i = await st(await ei(e.src)), r = await Zt(i.svg), o = M();
|
|
6466
6484
|
return {
|
|
6467
6485
|
cachedObjectURL: r,
|
|
6468
6486
|
stepRegion: e.region?.item,
|
|
@@ -6478,7 +6496,7 @@ class Sd {
|
|
|
6478
6496
|
width: a.width,
|
|
6479
6497
|
height: a.height,
|
|
6480
6498
|
layer: a.layer || 0,
|
|
6481
|
-
layerIndex: a.layerIndex ||
|
|
6499
|
+
layerIndex: a.layerIndex || Ut(t, a.layer || 0),
|
|
6482
6500
|
immutable: a.immutable
|
|
6483
6501
|
};
|
|
6484
6502
|
}
|
|
@@ -6536,7 +6554,7 @@ const V = (n, t) => X(n, t).elements.find((i) => i.id === n), X = (n, t) => {
|
|
|
6536
6554
|
const s = i[o];
|
|
6537
6555
|
if (s.src && s.svg)
|
|
6538
6556
|
try {
|
|
6539
|
-
s.cachedObjectURL = await
|
|
6557
|
+
s.cachedObjectURL = await Zt(s.svg);
|
|
6540
6558
|
} catch (l) {
|
|
6541
6559
|
console.log(l);
|
|
6542
6560
|
}
|
|
@@ -6546,7 +6564,7 @@ const V = (n, t) => X(n, t).elements.find((i) => i.id === n), X = (n, t) => {
|
|
|
6546
6564
|
);
|
|
6547
6565
|
for (let o = 0; o < r.length; ++o) {
|
|
6548
6566
|
const s = r[o];
|
|
6549
|
-
s.fontData?.assetUrl && await
|
|
6567
|
+
s.fontData?.assetUrl && await Nt(s.fontData.assetUrl);
|
|
6550
6568
|
}
|
|
6551
6569
|
}
|
|
6552
6570
|
};
|
|
@@ -6634,8 +6652,8 @@ class bd extends O {
|
|
|
6634
6652
|
const o = a;
|
|
6635
6653
|
o.scaleX = o.scaleX * this.width / e.width, o.scaleY = o.scaleY * this.height / e.height;
|
|
6636
6654
|
} else if (e.type === "textbox") {
|
|
6637
|
-
const o = a, s = (!o.algorithm || o.algorithm ===
|
|
6638
|
-
a =
|
|
6655
|
+
const o = a, s = (!o.algorithm || o.algorithm === Mt.Autosize ? o.text : o.input) ?? "";
|
|
6656
|
+
a = re(o, s, e);
|
|
6639
6657
|
}
|
|
6640
6658
|
const i = X(e.id, Object.values(t.layouts)), r = Z(a, i);
|
|
6641
6659
|
return {
|
|
@@ -6732,7 +6750,7 @@ class W extends O {
|
|
|
6732
6750
|
return a !== void 0 ? a + 1 : 0;
|
|
6733
6751
|
}
|
|
6734
6752
|
}
|
|
6735
|
-
class
|
|
6753
|
+
class Qt extends O {
|
|
6736
6754
|
constructor(t) {
|
|
6737
6755
|
super(), this.id = t;
|
|
6738
6756
|
}
|
|
@@ -6812,7 +6830,7 @@ class To extends O {
|
|
|
6812
6830
|
const a = {
|
|
6813
6831
|
...e,
|
|
6814
6832
|
fontSize: this.size
|
|
6815
|
-
}, i = X(e.id, Object.values(t.layouts)), r = (!e.algorithm || e.algorithm ===
|
|
6833
|
+
}, i = X(e.id, Object.values(t.layouts)), r = (!e.algorithm || e.algorithm === Mt.Autosize ? e.text : e.input) ?? "", o = Z(re(a, r), i);
|
|
6816
6834
|
return {
|
|
6817
6835
|
...t,
|
|
6818
6836
|
layouts: {
|
|
@@ -6834,7 +6852,7 @@ class en extends O {
|
|
|
6834
6852
|
const a = {
|
|
6835
6853
|
...e,
|
|
6836
6854
|
fontData: this.fontData
|
|
6837
|
-
}, i = X(e.id, Object.values(t.layouts)), r = (!e.algorithm || e.algorithm ===
|
|
6855
|
+
}, i = X(e.id, Object.values(t.layouts)), r = (!e.algorithm || e.algorithm === Mt.Autosize ? e.text : e.input) ?? "", o = Z(re(a, r), i);
|
|
6838
6856
|
return {
|
|
6839
6857
|
...t,
|
|
6840
6858
|
layouts: {
|
|
@@ -6958,7 +6976,7 @@ class Oo extends O {
|
|
|
6958
6976
|
const e = V(this.id, Object.values(t.layouts));
|
|
6959
6977
|
if (!e.id)
|
|
6960
6978
|
throw new G();
|
|
6961
|
-
const a = X(e.id, Object.values(t.layouts)), i = Z(
|
|
6979
|
+
const a = X(e.id, Object.values(t.layouts)), i = Z(re(e, this.text, e), a);
|
|
6962
6980
|
return {
|
|
6963
6981
|
...t,
|
|
6964
6982
|
layouts: {
|
|
@@ -7213,7 +7231,7 @@ class an {
|
|
|
7213
7231
|
}))()), A = {
|
|
7214
7232
|
stepName: this.configuration.stepName,
|
|
7215
7233
|
id: M(),
|
|
7216
|
-
cachedObjectURL: await
|
|
7234
|
+
cachedObjectURL: await Zt(d.svg),
|
|
7217
7235
|
src: l,
|
|
7218
7236
|
svg: d.svg,
|
|
7219
7237
|
colors: d.colors,
|
|
@@ -7326,7 +7344,7 @@ class Lo {
|
|
|
7326
7344
|
async () => {
|
|
7327
7345
|
const m = await r();
|
|
7328
7346
|
if (!m.link || !m.link)
|
|
7329
|
-
throw new
|
|
7347
|
+
throw new Kt(m.asset);
|
|
7330
7348
|
h({
|
|
7331
7349
|
rel: "mpeg4",
|
|
7332
7350
|
href: m.link
|
|
@@ -7339,7 +7357,7 @@ class Lo {
|
|
|
7339
7357
|
40
|
|
7340
7358
|
);
|
|
7341
7359
|
});
|
|
7342
|
-
t.forEach((h) => a.getCommandDispatcher()(new
|
|
7360
|
+
t.forEach((h) => a.getCommandDispatcher()(new Qt(h.id)));
|
|
7343
7361
|
const s = i.data.baseUrl.slice(0, 4) === "http" ? "" : "https://", l = new URL(s + i.data.baseUrl);
|
|
7344
7362
|
l.searchParams.append("video", btoa(JSON.stringify([o]))), l.pathname = l.pathname + (l.pathname.slice(-1) === "/" ? "" : "/");
|
|
7345
7363
|
const c = l.toString();
|
|
@@ -7402,7 +7420,7 @@ class De {
|
|
|
7402
7420
|
const i = a.fileLink;
|
|
7403
7421
|
if (i)
|
|
7404
7422
|
return at(i, !0);
|
|
7405
|
-
throw new
|
|
7423
|
+
throw new Kt(a);
|
|
7406
7424
|
};
|
|
7407
7425
|
}
|
|
7408
7426
|
async init(t, e, a) {
|
|
@@ -7670,7 +7688,7 @@ class De {
|
|
|
7670
7688
|
r && r(!0);
|
|
7671
7689
|
const c = t.data.initialZoomLevel, d = await Promise.all(
|
|
7672
7690
|
t.data.regions.map(async (h, g) => {
|
|
7673
|
-
const m = await Ve(l[g]), p = s.getImageData(), f = a.map((I) => new
|
|
7691
|
+
const m = await Ve(l[g]), p = s.getImageData(), f = a.map((I) => new Qt(I.id)), S = p ? Ta(
|
|
7674
7692
|
p,
|
|
7675
7693
|
m,
|
|
7676
7694
|
c && !t.data.forceImageCover ? { scale: c } : void 0,
|
|
@@ -7732,7 +7750,7 @@ class De {
|
|
|
7732
7750
|
const a = t.fileLink;
|
|
7733
7751
|
if (a)
|
|
7734
7752
|
return a;
|
|
7735
|
-
throw new
|
|
7753
|
+
throw new Kt(t);
|
|
7736
7754
|
}
|
|
7737
7755
|
async loadPatternFromAsset(t, e, a, i) {
|
|
7738
7756
|
const r = De.patternSource(t), o = a.markUpdatePending(), s = a.getWorkflowExperience().getStepById(e.stepName)?.frameService;
|
|
@@ -7872,7 +7890,8 @@ class Vo {
|
|
|
7872
7890
|
spotColor: A.spotColor,
|
|
7873
7891
|
pmsValue: A.pmsValue
|
|
7874
7892
|
};
|
|
7875
|
-
|
|
7893
|
+
console.log(`LOG: newColors ${JSON.stringify(o, null, 2)}`);
|
|
7894
|
+
const s = xa(t, e, a, o), l = await Zt(s), c = [];
|
|
7876
7895
|
for (const d of i) {
|
|
7877
7896
|
for (const [A, u] of r.entries())
|
|
7878
7897
|
c.push(new fa(d, A, u));
|
|
@@ -7924,15 +7943,15 @@ class Vo {
|
|
|
7924
7943
|
if (!t.data || !t.data.regions)
|
|
7925
7944
|
throw new Be(t, "Missing regions.");
|
|
7926
7945
|
i(!0);
|
|
7927
|
-
const o = a.map((f) => new
|
|
7946
|
+
const o = a.map((f) => new Qt(f.id));
|
|
7928
7947
|
t.mandatory && r.setMandatoryFulfilled(t.stepName, !1);
|
|
7929
7948
|
const s = e.asset;
|
|
7930
7949
|
if (!s)
|
|
7931
7950
|
throw new bt(e);
|
|
7932
7951
|
const l = s.fileLink;
|
|
7933
7952
|
if (!l)
|
|
7934
|
-
throw new
|
|
7935
|
-
const c = await st(await this.getIllustrationBody(l)), d = await
|
|
7953
|
+
throw new Kt(s);
|
|
7954
|
+
const c = await st(await this.getIllustrationBody(l)), d = await Zt(c.svg), A = (f, S) => {
|
|
7936
7955
|
const w = r.getLayouts().find((v) => v.panelId === f.panelId);
|
|
7937
7956
|
if (!w)
|
|
7938
7957
|
throw new J(f);
|
|
@@ -8207,7 +8226,7 @@ class Wo {
|
|
|
8207
8226
|
if (!p)
|
|
8208
8227
|
return console.error(`Can not find layout for region: ${A.panelId}`), null;
|
|
8209
8228
|
const f = [];
|
|
8210
|
-
return h && f.push(new
|
|
8229
|
+
return h && f.push(new Qt(g)), f.push(
|
|
8211
8230
|
new W(
|
|
8212
8231
|
{
|
|
8213
8232
|
stepRegion: A,
|
|
@@ -8338,7 +8357,7 @@ class qo {
|
|
|
8338
8357
|
if (!o)
|
|
8339
8358
|
return console.error("No URL for picture!"), null;
|
|
8340
8359
|
i(!0), t.mandatory && a.setMandatoryFulfilled(t.stepName, !1);
|
|
8341
|
-
const l = a.getRegionElements(t.stepName).map((A) => new
|
|
8360
|
+
const l = a.getRegionElements(t.stepName).map((A) => new Qt(A.id)), c = (A, u) => {
|
|
8342
8361
|
const g = a.getLayouts().find((p) => p.panelId === A.panelId);
|
|
8343
8362
|
if (!g)
|
|
8344
8363
|
throw new J(A);
|
|
@@ -8607,7 +8626,7 @@ class jo {
|
|
|
8607
8626
|
}
|
|
8608
8627
|
}
|
|
8609
8628
|
}
|
|
8610
|
-
const
|
|
8629
|
+
const Gt = new jo();
|
|
8611
8630
|
class Yo {
|
|
8612
8631
|
constructor() {
|
|
8613
8632
|
this.latestToast = null, this.toastType = null, this.toastCallbacks = [];
|
|
@@ -8905,7 +8924,7 @@ class _o {
|
|
|
8905
8924
|
});
|
|
8906
8925
|
}
|
|
8907
8926
|
updateInputText(t, e, a, i) {
|
|
8908
|
-
const r = i.getStepStorage(a.stepName), o =
|
|
8927
|
+
const r = i.getStepStorage(a.stepName), o = Ft(t, i), s = this.getProcessedInput(o, a.data, r?.customiseAllText ?? !1), l = {
|
|
8909
8928
|
command: void 0,
|
|
8910
8929
|
helperData: {},
|
|
8911
8930
|
errorData: this.getErrorsForText(t, s, a, i)
|
|
@@ -9080,8 +9099,8 @@ class _o {
|
|
|
9080
9099
|
throw new bt(t);
|
|
9081
9100
|
const a = e.fileLink;
|
|
9082
9101
|
if (!a)
|
|
9083
|
-
throw new
|
|
9084
|
-
const i = await
|
|
9102
|
+
throw new Kt(e);
|
|
9103
|
+
const i = await Nt(a);
|
|
9085
9104
|
return {
|
|
9086
9105
|
assetUrl: a,
|
|
9087
9106
|
name: i.names.fullName.en
|
|
@@ -9168,7 +9187,7 @@ class _o {
|
|
|
9168
9187
|
async createTextboxRegions(t, e, a, i, r, o) {
|
|
9169
9188
|
if (!a || !a.regions)
|
|
9170
9189
|
throw new Error("Step data not supplied");
|
|
9171
|
-
const s = r.text || a.defaultText || "", l =
|
|
9190
|
+
const s = r.text || a.defaultText || "", l = Ft(s, o), c = this.getProcessedInput(l, a, !1), d = async (u, h) => {
|
|
9172
9191
|
const m = o.getLayouts().find((f) => f.panelId === u.panelId), p = M();
|
|
9173
9192
|
try {
|
|
9174
9193
|
if (!m)
|
|
@@ -9266,7 +9285,7 @@ class _o {
|
|
|
9266
9285
|
* @deprecated
|
|
9267
9286
|
*/
|
|
9268
9287
|
async changeInputTextWithRegion(t, e, a, i, r, o, s, l, c, d) {
|
|
9269
|
-
const A = (i || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u =
|
|
9288
|
+
const A = (i || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = Ft(A, o), h = this.getProcessedInput(u, t.data, s), g = o.getRegionElements(t.stepName), m = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
|
|
9270
9289
|
for (const v of g)
|
|
9271
9290
|
if (v.region) {
|
|
9272
9291
|
const [E, I] = ye(
|
|
@@ -9323,13 +9342,13 @@ const Zo = "data:application/octet-stream;base64,AAEAAAAPAIAAAwBwRkZUTYdHeHoAAEl
|
|
|
9323
9342
|
const e = et("rect");
|
|
9324
9343
|
return e.setAttribute("height", `${n}`), e.setAttribute("width", `${t}`), e;
|
|
9325
9344
|
}, es = (n, t, e, a) => {
|
|
9326
|
-
const i =
|
|
9345
|
+
const i = ce("filter");
|
|
9327
9346
|
i.setAttribute("id", a), i.setAttribute("height", "200%"), i.setAttribute("width", "200%"), i.setAttribute("x", "-50%"), i.setAttribute("y", "-50%");
|
|
9328
|
-
const r =
|
|
9347
|
+
const r = ce("feOffset");
|
|
9329
9348
|
i.appendChild(r), r.setAttribute("result", "offOut"), r.setAttribute("in", "SourceAlpha"), r.setAttribute("dx", `${n}`), r.setAttribute("dy", `${t}`);
|
|
9330
|
-
const o =
|
|
9349
|
+
const o = ce("feGaussianBlur");
|
|
9331
9350
|
i.appendChild(o), o.setAttribute("result", "blurOut"), o.setAttribute("in", "offOut"), o.setAttribute("stdDeviation", `${e}`);
|
|
9332
|
-
const s =
|
|
9351
|
+
const s = ce("feBlend");
|
|
9333
9352
|
return i.appendChild(s), s.setAttribute("in", "SourceGraphic"), s.setAttribute("in2", "blurOut"), s.setAttribute("mode", "normal"), i;
|
|
9334
9353
|
}, as = (n) => {
|
|
9335
9354
|
let t = n;
|
|
@@ -9394,7 +9413,7 @@ class rs {
|
|
|
9394
9413
|
u = (A * 100 | 0) / 100;
|
|
9395
9414
|
break;
|
|
9396
9415
|
default:
|
|
9397
|
-
throw new
|
|
9416
|
+
throw new xt("Failed to encode path.");
|
|
9398
9417
|
}
|
|
9399
9418
|
l || o.push(" "), o.push(u), l = !1;
|
|
9400
9419
|
}
|
|
@@ -9408,12 +9427,12 @@ class rs {
|
|
|
9408
9427
|
for (e.lastIndex = 0; r = e.exec(t); ) {
|
|
9409
9428
|
const o = r[1].toLowerCase(), s = (r[2].match(a) || []).map(parseFloat), l = o === r[1], c = nn[o];
|
|
9410
9429
|
if (s.length < c.length)
|
|
9411
|
-
throw new
|
|
9430
|
+
throw new xt(
|
|
9412
9431
|
`Path type "${o}" given ${s.length} arguments, expected ${c.length}.`
|
|
9413
9432
|
);
|
|
9414
9433
|
if (c.length > 0) {
|
|
9415
9434
|
if (s.length % c.length !== 0)
|
|
9416
|
-
throw new
|
|
9435
|
+
throw new xt(
|
|
9417
9436
|
`Path type "${o}" given ${s.length} arguments, not divisible by ${c.length}`
|
|
9418
9437
|
);
|
|
9419
9438
|
for (let d = 0; d < s.length / c.length; d++) {
|
|
@@ -9438,7 +9457,7 @@ class rs {
|
|
|
9438
9457
|
if (s in r && l in r) {
|
|
9439
9458
|
const c = [r[s], r[l]], d = e(c);
|
|
9440
9459
|
if (d.length < 2)
|
|
9441
|
-
throw new
|
|
9460
|
+
throw new xt("Transformer must return at least 2 points.");
|
|
9442
9461
|
r[s] = d[0], r[l] = d[1];
|
|
9443
9462
|
}
|
|
9444
9463
|
}
|
|
@@ -9608,7 +9627,7 @@ const ss = [
|
|
|
9608
9627
|
const i = e.data, r = a.option;
|
|
9609
9628
|
if (!r)
|
|
9610
9629
|
return console.error(`No option for step ${a.stepName}.`), [];
|
|
9611
|
-
const o = r.variants?.find((v) => v.id === i.illustrationVariantId) ||
|
|
9630
|
+
const o = r.variants?.find((v) => v.id === i.illustrationVariantId) || oe(r);
|
|
9612
9631
|
if (!o)
|
|
9613
9632
|
return console.error(`No variant with ID: ${i.illustrationVariantId}`), [];
|
|
9614
9633
|
if (!o.asset)
|
|
@@ -9622,7 +9641,7 @@ const ss = [
|
|
|
9622
9641
|
return console.error("Failed to read SVG."), [];
|
|
9623
9642
|
Pa(g);
|
|
9624
9643
|
const m = {};
|
|
9625
|
-
|
|
9644
|
+
kt(g, (v) => {
|
|
9626
9645
|
ss.includes(v.tagName) && !v.attributes.getNamedItem("fill") && v.setAttribute("fill", "#000000");
|
|
9627
9646
|
const E = v.attributes.getNamedItem("fill");
|
|
9628
9647
|
if (E && E.value !== "none") {
|
|
@@ -9706,7 +9725,7 @@ const ss = [
|
|
|
9706
9725
|
const i = e.data, r = a.option;
|
|
9707
9726
|
if (!r)
|
|
9708
9727
|
return console.error(`No option for step ${a.stepName}.`), [];
|
|
9709
|
-
const o = r.variants?.find((d) => d.id === i.pictureVariantId) ||
|
|
9728
|
+
const o = r.variants?.find((d) => d.id === i.pictureVariantId) || oe(r);
|
|
9710
9729
|
if (!o)
|
|
9711
9730
|
return console.error(`No variant with ID: ${i.pictureVariantId}`), [];
|
|
9712
9731
|
if (!o.asset)
|
|
@@ -9747,7 +9766,7 @@ const ss = [
|
|
|
9747
9766
|
const i = e.data, r = a.option;
|
|
9748
9767
|
if (!r)
|
|
9749
9768
|
return console.error(`No option for step ${a.stepName}.`), [];
|
|
9750
|
-
const o = r.variants?.find((c) => c.id === i.colorVariantId) ||
|
|
9769
|
+
const o = r.variants?.find((c) => c.id === i.colorVariantId) || oe(r);
|
|
9751
9770
|
if (!o)
|
|
9752
9771
|
return console.error(`No variant with ID: ${i.colorVariantId}`), [];
|
|
9753
9772
|
t[a.stepName] = { selectedVariants: [o] };
|
|
@@ -9833,7 +9852,7 @@ const ss = [
|
|
|
9833
9852
|
const c = await at(r, !0), d = (A) => {
|
|
9834
9853
|
const u = /<svg.*?<\/svg>/s, h = A.match(u) || [], g = h?.length > 0 ? h[0] : "", f = dt().parseFromString(g, "image/svg+xml").firstElementChild;
|
|
9835
9854
|
if (!f)
|
|
9836
|
-
throw new
|
|
9855
|
+
throw new xt("Failed to read SVG.");
|
|
9837
9856
|
return Pa(f), It().serializeToString(f);
|
|
9838
9857
|
};
|
|
9839
9858
|
l.forEach((A) => {
|
|
@@ -9868,7 +9887,7 @@ const ss = [
|
|
|
9868
9887
|
const p = a.option;
|
|
9869
9888
|
if (!p)
|
|
9870
9889
|
return;
|
|
9871
|
-
const f = p.variants?.find((w) => w.id === r.fontVariantId) ||
|
|
9890
|
+
const f = p.variants?.find((w) => w.id === r.fontVariantId) || oe(p);
|
|
9872
9891
|
if (!f || !f.asset)
|
|
9873
9892
|
return;
|
|
9874
9893
|
t[a.stepName] = { selectedVariants: [f] };
|
|
@@ -9879,7 +9898,7 @@ const ss = [
|
|
|
9879
9898
|
const p = l();
|
|
9880
9899
|
if (!p)
|
|
9881
9900
|
return;
|
|
9882
|
-
const f = await
|
|
9901
|
+
const f = await Nt(p);
|
|
9883
9902
|
return {
|
|
9884
9903
|
assetUrl: p,
|
|
9885
9904
|
name: f.names.fullName.en
|
|
@@ -10172,7 +10191,7 @@ class vs extends Gn {
|
|
|
10172
10191
|
l = r.width, c = r.height;
|
|
10173
10192
|
const d = this.getWorkflowManager?.()?.getTemplatingContext(), A = ka(t.layoutState.layout, e, {
|
|
10174
10193
|
renderingConfiguration: {
|
|
10175
|
-
purpose:
|
|
10194
|
+
purpose: Jt.ThreeD,
|
|
10176
10195
|
templatingContext: d
|
|
10177
10196
|
}
|
|
10178
10197
|
}), u = xn(A), h = await va.from(this.ctx, u, {
|
|
@@ -10183,7 +10202,7 @@ class vs extends Gn {
|
|
|
10183
10202
|
ignoreMouse: !0,
|
|
10184
10203
|
enableRedraw: !1,
|
|
10185
10204
|
createCanvas: ft,
|
|
10186
|
-
createImage:
|
|
10205
|
+
createImage: ae,
|
|
10187
10206
|
DOMParser: Ba(),
|
|
10188
10207
|
fetch
|
|
10189
10208
|
});
|
|
@@ -10946,7 +10965,7 @@ const el = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
10946
10965
|
})), al = (n, t) => {
|
|
10947
10966
|
const e = n.workflowState, a = e ? JSON.parse(e) : void 0;
|
|
10948
10967
|
return a ? Object.values(a.layouts).map((i) => i.layout) : el(t.panels);
|
|
10949
|
-
},
|
|
10968
|
+
}, Ht = class Ht {
|
|
10950
10969
|
constructor(t, e, a, i, r, o = !1, s, l = !1, c = !1, d = !1) {
|
|
10951
10970
|
this.workflowStatePromiseQueue = new Wn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.setWorkflow = async (u) => {
|
|
10952
10971
|
this.confirmedDesign = !1, this.editedSteps = {}, this.informationResults = [], this.mandatorySteps = {}, this.pendingUpdates = [], this.selectionCost = 0, this.stepSpecificServices = {}, this.pollers = [], this.allScenes = [], this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, this.validationErrors = { steps: /* @__PURE__ */ new Map() }, this.currentAdjustingStepId = "", this.reloadedState ? this.layouts = Object.values(this.reloadedState.layouts || {}).map((g) => g.layout) : u ? this.layouts = al(this.experience.getTransaction(), u) : this.layouts = [], this.commandContext.initialize(this.layouts, this.reloadedState), this.renderableContextService = new Cs(this.layouts), this.renderableContextService.setWorkflowManager(this), u.steps.forEach((g) => {
|
|
@@ -11089,7 +11108,7 @@ const el = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11089
11108
|
async fetchConversionConfiguration() {
|
|
11090
11109
|
const t = this.experience.getTransaction().recipient;
|
|
11091
11110
|
if (t?.conversionConfigurationId && !this.recipientConversionConfiguration) {
|
|
11092
|
-
const e =
|
|
11111
|
+
const e = Ht.configurationPromiseMap.get(
|
|
11093
11112
|
t.conversionConfigurationId
|
|
11094
11113
|
);
|
|
11095
11114
|
if (e)
|
|
@@ -11103,7 +11122,7 @@ const el = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11103
11122
|
id: t.conversionConfigurationId
|
|
11104
11123
|
}
|
|
11105
11124
|
})).data.conversionConfiguration)();
|
|
11106
|
-
|
|
11125
|
+
Ht.configurationPromiseMap.set(t.conversionConfigurationId, i), this.recipientConversionConfiguration = await i;
|
|
11107
11126
|
}
|
|
11108
11127
|
}
|
|
11109
11128
|
}
|
|
@@ -11363,7 +11382,7 @@ const el = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11363
11382
|
...this.storage,
|
|
11364
11383
|
[t]: { ...this.storage[t], ...e }
|
|
11365
11384
|
};
|
|
11366
|
-
if (!
|
|
11385
|
+
if (!Yt(a, this.storage)) {
|
|
11367
11386
|
this.storage = a;
|
|
11368
11387
|
const i = new tn(this.constructSerializableWorkflow());
|
|
11369
11388
|
this.commandContext.apply(i, !0), this.onStepSpecificStorageChange(t), this.onStorageChange();
|
|
@@ -11581,7 +11600,7 @@ const el = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11581
11600
|
}, this.removeElements(h);
|
|
11582
11601
|
const p = r.steps.find((E) => E.stepName === t);
|
|
11583
11602
|
p?.type === b.Frame && this.getWorkflowExperience().getStepById(p.stepName)?.frameService?.setTargetElements(a.map((I) => I.id));
|
|
11584
|
-
const f = h.map((E) => new
|
|
11603
|
+
const f = h.map((E) => new Qt(E.id)), S = new tn(this.constructSerializableWorkflow()), w = [...m, ...f, S];
|
|
11585
11604
|
w.length > 0 && this.commandContext.apply(new $(w), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
|
|
11586
11605
|
const x = this.getInvalidModelVariants(), v = this.modelContainer;
|
|
11587
11606
|
if (v) {
|
|
@@ -11646,7 +11665,7 @@ const el = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11646
11665
|
);
|
|
11647
11666
|
break;
|
|
11648
11667
|
case b.Shape:
|
|
11649
|
-
a.push(
|
|
11668
|
+
a.push(Gt.init(l, this, this.reloadedState));
|
|
11650
11669
|
break;
|
|
11651
11670
|
case b.Text:
|
|
11652
11671
|
a.push(H.init(l, this, this.reloadedState));
|
|
@@ -11711,8 +11730,8 @@ const el = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11711
11730
|
return go(this.allScenes, this.stepSelections, this.singleVariantsRenderable);
|
|
11712
11731
|
}
|
|
11713
11732
|
};
|
|
11714
|
-
|
|
11715
|
-
let Ca =
|
|
11733
|
+
Ht.configurationPromiseMap = /* @__PURE__ */ new Map();
|
|
11734
|
+
let Ca = Ht;
|
|
11716
11735
|
class rt {
|
|
11717
11736
|
constructor(t) {
|
|
11718
11737
|
this.variantData = t;
|
|
@@ -11793,7 +11812,7 @@ class rt {
|
|
|
11793
11812
|
return this.variantData.enabled;
|
|
11794
11813
|
}
|
|
11795
11814
|
}
|
|
11796
|
-
const
|
|
11815
|
+
const jt = class jt {
|
|
11797
11816
|
constructor(t, e, a) {
|
|
11798
11817
|
this.manager = t, this.step = e, this.tags = a;
|
|
11799
11818
|
}
|
|
@@ -11803,7 +11822,7 @@ const Ht = class Ht {
|
|
|
11803
11822
|
* @param value The new value
|
|
11804
11823
|
*/
|
|
11805
11824
|
setUpdateState(t) {
|
|
11806
|
-
|
|
11825
|
+
jt.updateState.set(
|
|
11807
11826
|
`${this.step.stepName}-${this.manager.getWorkflowExperience().getTransaction().id}`,
|
|
11808
11827
|
t
|
|
11809
11828
|
);
|
|
@@ -11812,7 +11831,7 @@ const Ht = class Ht {
|
|
|
11812
11831
|
* @returns Gets the current update state of this step. All step handles for this step will see this value.
|
|
11813
11832
|
*/
|
|
11814
11833
|
getUpdateState() {
|
|
11815
|
-
return !!
|
|
11834
|
+
return !!jt.updateState.get(
|
|
11816
11835
|
`${this.step.stepName}-${this.manager.getWorkflowExperience().getTransaction().id}`
|
|
11817
11836
|
);
|
|
11818
11837
|
}
|
|
@@ -11924,8 +11943,8 @@ const Ht = class Ht {
|
|
|
11924
11943
|
e ? r && e.executeCameraAnimation(r) : console.warn("No preview service available, cannot execute camera animations."), a ? i && a.executeAnimation(i, t) : console.warn("No model container available, cannot execute model animations.");
|
|
11925
11944
|
}
|
|
11926
11945
|
};
|
|
11927
|
-
|
|
11928
|
-
let tt =
|
|
11946
|
+
jt.updateState = /* @__PURE__ */ new Map();
|
|
11947
|
+
let tt = jt;
|
|
11929
11948
|
class nl extends tt {
|
|
11930
11949
|
constructor(t, e, a) {
|
|
11931
11950
|
super(t, e, a);
|
|
@@ -11973,13 +11992,14 @@ class nl extends tt {
|
|
|
11973
11992
|
* Set color for the illustration.
|
|
11974
11993
|
*/
|
|
11975
11994
|
setColor(t, e, a) {
|
|
11995
|
+
console.log("LOG: setColor");
|
|
11976
11996
|
const i = /* @__PURE__ */ new Map(), o = this.getCurrentVariant()?.getAssetResource()?.assetConfiguration;
|
|
11977
11997
|
return (o?.defaultColorVariants || []).length !== 0 ? o.channelNumbers.forEach((l) => {
|
|
11978
11998
|
if (l.number.toString() === t) {
|
|
11979
11999
|
const c = l.id.replace(/\W/g, "");
|
|
11980
12000
|
a ? i.set(c, { browserValue: e, pmsValue: a }) : i.set(c, e);
|
|
11981
12001
|
}
|
|
11982
|
-
}) : a ? i.set(t, { browserValue: e, pmsValue: a }) : i.set(t, e), we.changeColors(
|
|
12002
|
+
}) : a ? i.set(t, { browserValue: e, pmsValue: a }) : (console.log(`LOG: setting color ${t} | ${e}`), i.set(t, e)), we.changeColors(
|
|
11983
12003
|
this.step,
|
|
11984
12004
|
this.manager.getRegionElements(this.step.stepName),
|
|
11985
12005
|
this.manager,
|
|
@@ -12066,7 +12086,7 @@ class ll extends tt {
|
|
|
12066
12086
|
}
|
|
12067
12087
|
selectVariant(t) {
|
|
12068
12088
|
const e = t.getResource();
|
|
12069
|
-
return
|
|
12089
|
+
return Gt.selectVariant(
|
|
12070
12090
|
this.step,
|
|
12071
12091
|
{
|
|
12072
12092
|
fill: e.color,
|
|
@@ -12084,7 +12104,7 @@ class ll extends tt {
|
|
|
12084
12104
|
* @deprecated The shape step can now pass through colors returned by getColors via selectVariant. Please swap setColor for selectVariant.
|
|
12085
12105
|
*/
|
|
12086
12106
|
setColor(t) {
|
|
12087
|
-
return
|
|
12107
|
+
return Gt.selectVariant(
|
|
12088
12108
|
this.step,
|
|
12089
12109
|
t,
|
|
12090
12110
|
this.manager.getRegionElements(this.step.stepName) || [],
|
|
@@ -12096,7 +12116,7 @@ class ll extends tt {
|
|
|
12096
12116
|
* @returns A list of color definitions that are currently applied to the illustration.
|
|
12097
12117
|
*/
|
|
12098
12118
|
getColors() {
|
|
12099
|
-
return
|
|
12119
|
+
return Gt.availableColours(this.step);
|
|
12100
12120
|
}
|
|
12101
12121
|
/**
|
|
12102
12122
|
* Allows for setting a custom color when the custom variant is selected. Will
|
|
@@ -12105,7 +12125,7 @@ class ll extends tt {
|
|
|
12105
12125
|
setCustomColor(t) {
|
|
12106
12126
|
return this.getCurrentVariant()?.getColor() !== "#custom" && console.warn(
|
|
12107
12127
|
`setting custom color for step ${this.step.stepName} but color is ${this.getCurrentVariant()?.getColor()}`
|
|
12108
|
-
),
|
|
12128
|
+
), Gt.setCustomColor(t, this.step, this.manager);
|
|
12109
12129
|
}
|
|
12110
12130
|
getCustomColor() {
|
|
12111
12131
|
this.getCurrentVariant()?.getColor() !== "#custom" && console.warn(
|
|
@@ -12209,7 +12229,7 @@ class cl extends tt {
|
|
|
12209
12229
|
const e = {
|
|
12210
12230
|
input: t,
|
|
12211
12231
|
helperData: {}
|
|
12212
|
-
}, a = H.findLayoutElements(this.manager, this.step), i = H.filterUnsupportedCharacters(t, a[0]?.fontData), r =
|
|
12232
|
+
}, a = H.findLayoutElements(this.manager, this.step), i = H.filterUnsupportedCharacters(t, a[0]?.fontData), r = Ft(i, this.manager).length, o = !!this.step.data && !!this.step.data.maxLength && r > this.step.data.maxLength;
|
|
12213
12233
|
o || (e.input = i);
|
|
12214
12234
|
const s = a.length <= 0, l = s ? { inputText: i, text: i } : { inputText: i };
|
|
12215
12235
|
this.manager.updateStorage(this.step.stepName, l);
|
|
@@ -12285,7 +12305,7 @@ class cl extends tt {
|
|
|
12285
12305
|
const t = this.step.data.maxLength;
|
|
12286
12306
|
if (t === void 0)
|
|
12287
12307
|
return;
|
|
12288
|
-
const e =
|
|
12308
|
+
const e = Ft(this.getText(), this.manager);
|
|
12289
12309
|
return t - e.length;
|
|
12290
12310
|
}
|
|
12291
12311
|
setCustomColor(t) {
|
|
@@ -12366,7 +12386,7 @@ class ul extends tt {
|
|
|
12366
12386
|
const t = this.step.data.maxLength;
|
|
12367
12387
|
if (t === void 0)
|
|
12368
12388
|
return;
|
|
12369
|
-
const e =
|
|
12389
|
+
const e = Ft(this.getText(), this.manager);
|
|
12370
12390
|
return t - e.length;
|
|
12371
12391
|
}
|
|
12372
12392
|
/**
|
|
@@ -12817,7 +12837,7 @@ const ra = new wl(), yl = C`
|
|
|
12817
12837
|
}
|
|
12818
12838
|
`, ln = C`
|
|
12819
12839
|
${Ue}
|
|
12820
|
-
${
|
|
12840
|
+
${ie}
|
|
12821
12841
|
mutation TransactionUpdateIntegrationProduct($id: String!, $integrationProductId: String) {
|
|
12822
12842
|
transactionUpdateIntegrationProduct(id: $id, integrationProductId: $integrationProductId) {
|
|
12823
12843
|
id
|
|
@@ -13091,7 +13111,7 @@ class El {
|
|
|
13091
13111
|
throw new Qe("Failed to obtain 2D context for preview image creation");
|
|
13092
13112
|
const g = this.workflowManager.getTemplatingContext(), m = ka(u.layoutState.layout, u.layoutState.elements, {
|
|
13093
13113
|
renderingConfiguration: {
|
|
13094
|
-
purpose:
|
|
13114
|
+
purpose: Jt.Print,
|
|
13095
13115
|
region: { left: A.x, top: A.y, width: A.width, height: A.height },
|
|
13096
13116
|
templatingContext: g
|
|
13097
13117
|
}
|
|
@@ -13100,7 +13120,7 @@ class El {
|
|
|
13100
13120
|
anonymousCrossOrigin: !0,
|
|
13101
13121
|
ignoreDimensions: !1,
|
|
13102
13122
|
createCanvas: ft,
|
|
13103
|
-
createImage:
|
|
13123
|
+
createImage: ae,
|
|
13104
13124
|
DOMParser: Ba(),
|
|
13105
13125
|
fetch
|
|
13106
13126
|
})).render();
|
|
@@ -14086,7 +14106,7 @@ class Tl {
|
|
|
14086
14106
|
storage: a !== null ? a : void 0,
|
|
14087
14107
|
channel: i
|
|
14088
14108
|
});
|
|
14089
|
-
|
|
14109
|
+
Yt(o, this.globalPropertyState) || (await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(o, this.globalPropertyState));
|
|
14090
14110
|
}
|
|
14091
14111
|
async setAspectStorage(t, e, a) {
|
|
14092
14112
|
if (!this.globalPropertyState)
|
|
@@ -14113,7 +14133,7 @@ class Tl {
|
|
|
14113
14133
|
storage: e !== null ? e : void 0,
|
|
14114
14134
|
channel: a
|
|
14115
14135
|
});
|
|
14116
|
-
|
|
14136
|
+
Yt(r, this.globalPropertyState) || (await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(r, this.globalPropertyState));
|
|
14117
14137
|
}
|
|
14118
14138
|
async updateGlobalPropertyState() {
|
|
14119
14139
|
if (!this.globalPropertyState)
|
|
@@ -14583,10 +14603,10 @@ class ge {
|
|
|
14583
14603
|
const e = this.productResource.workflowId;
|
|
14584
14604
|
if (e) {
|
|
14585
14605
|
const a = t.find((i) => i.workflowName === e);
|
|
14586
|
-
if (a) return new
|
|
14606
|
+
if (a) return new qt(a);
|
|
14587
14607
|
}
|
|
14588
14608
|
if (t.length === 1)
|
|
14589
|
-
return new
|
|
14609
|
+
return new qt(t[0]);
|
|
14590
14610
|
throw new gt(
|
|
14591
14611
|
"Called getDefaultWorkflow() but no default workflow is configured for the requested product. Multiple workflows exist so we can't assume!"
|
|
14592
14612
|
);
|
|
@@ -14599,7 +14619,7 @@ class ge {
|
|
|
14599
14619
|
throw new gt(
|
|
14600
14620
|
"No workflows on configured product. Ensure at least 1 workflow is assigned to this product."
|
|
14601
14621
|
);
|
|
14602
|
-
return this.product.workflows.sort((e, a) => (e.index ?? 0) - (a.index ?? 0)).map((e) => new
|
|
14622
|
+
return this.product.workflows.sort((e, a) => (e.index ?? 0) - (a.index ?? 0)).map((e) => new qt(e));
|
|
14603
14623
|
}
|
|
14604
14624
|
/**
|
|
14605
14625
|
* A list of all integrations this product is connected to.
|
|
@@ -14643,7 +14663,7 @@ class ge {
|
|
|
14643
14663
|
return Ol.requestKeysForEntity(this.product.id, t);
|
|
14644
14664
|
}
|
|
14645
14665
|
}
|
|
14646
|
-
class
|
|
14666
|
+
class qt {
|
|
14647
14667
|
constructor(t) {
|
|
14648
14668
|
this.workflow = t;
|
|
14649
14669
|
}
|
|
@@ -15514,7 +15534,7 @@ class dn {
|
|
|
15514
15534
|
});
|
|
15515
15535
|
await Promise.all(l), await Promise.all(r.map((A) => A.applyGlobalState()));
|
|
15516
15536
|
const c = this.globalPropertyStateManager.getGlobalPropertyState(), d = this.globalPropertyHandleService.applyConditionsFromState(a, c);
|
|
15517
|
-
|
|
15537
|
+
Yt(r.sort(), d.sort()) || (this.checkConditionalHandlesChanged(r, d), this.checkMandatoryHandlesChanged(c, d), await this.onGlobalPropertiesChanged(e, c));
|
|
15518
15538
|
}
|
|
15519
15539
|
checkConditionalHandlesChanged(t, e) {
|
|
15520
15540
|
(() => {
|
|
@@ -15787,7 +15807,7 @@ class An {
|
|
|
15787
15807
|
throw new Error(
|
|
15788
15808
|
"No workflows found on product. This is generally due to a configuration error. Please confirm at least one workflow is configured for this product."
|
|
15789
15809
|
);
|
|
15790
|
-
return new
|
|
15810
|
+
return new qt(t[0]);
|
|
15791
15811
|
}
|
|
15792
15812
|
getAllWorkflows() {
|
|
15793
15813
|
if (!this.integrationProduct.product)
|
|
@@ -15797,7 +15817,7 @@ class An {
|
|
|
15797
15817
|
throw new Error(
|
|
15798
15818
|
"No workflows found on product. This is generally due to a configuration error. Please confirm at least one workflow is configured for this product."
|
|
15799
15819
|
);
|
|
15800
|
-
return t.sort((e, a) => (e.index ?? 0) - (a.index ?? 0)).map((e) => new
|
|
15820
|
+
return t.sort((e, a) => (e.index ?? 0) - (a.index ?? 0)).map((e) => new qt(e));
|
|
15801
15821
|
}
|
|
15802
15822
|
}
|
|
15803
15823
|
const pe = C`
|
|
@@ -15992,7 +16012,7 @@ class tc {
|
|
|
15992
16012
|
);
|
|
15993
16013
|
}
|
|
15994
16014
|
}
|
|
15995
|
-
const
|
|
16015
|
+
const Vt = new tc();
|
|
15996
16016
|
class ec {
|
|
15997
16017
|
/**
|
|
15998
16018
|
* Returns a formatted string representing a given amount with desired currency.
|
|
@@ -16087,7 +16107,7 @@ const nc = async (n, t) => {
|
|
|
16087
16107
|
i.steps.forEach((r) => {
|
|
16088
16108
|
delete r.data.__typename, r.option?.id && (r.option.defaultVariant?.asset && U.cacheAsset(r.option.defaultVariant.asset), r.option.colorProfile && U.cacheAsset(r.option.colorProfile), r.option.variants?.forEach((o) => {
|
|
16089
16109
|
o.asset && U.cacheAsset(o.asset), o.thumbnail && U.cacheAsset(o.thumbnail), o.material && U.cacheMaterial(o.material);
|
|
16090
|
-
}),
|
|
16110
|
+
}), Xt.set({ id: r.option.id }, Promise.resolve(r.option)));
|
|
16091
16111
|
}), i.finalizeStepConfig || (i.finalizeStepConfig = {}), i.finalizeStepConfig.termsMarkdown = i.finalizeStepConfig.termsMarkdown || i.partner.termsMarkdown;
|
|
16092
16112
|
}), a;
|
|
16093
16113
|
}, ic = async (n, t) => {
|
|
@@ -16096,11 +16116,11 @@ const nc = async (n, t) => {
|
|
|
16096
16116
|
throw new Error(`Workflow not found: ${n}`);
|
|
16097
16117
|
return a;
|
|
16098
16118
|
}, fi = async (n, t) => {
|
|
16099
|
-
const e = n.map((s) =>
|
|
16119
|
+
const e = n.map((s) => Xt.get({ id: s, options: t })), a = n.filter((s, l) => e[l] === void 0);
|
|
16100
16120
|
if (a.length === 0)
|
|
16101
16121
|
return Promise.all(e);
|
|
16102
16122
|
const i = nc(a, t), r = a.map(
|
|
16103
|
-
(s) =>
|
|
16123
|
+
(s) => Xt.set({ id: s, options: t }, ic(s, i))
|
|
16104
16124
|
), o = e.filter((s) => s !== void 0);
|
|
16105
16125
|
return await Promise.all(o.concat(r));
|
|
16106
16126
|
}, rc = async (n, t) => (await fi([n], t))[0], oc = async (n) => {
|
|
@@ -16125,10 +16145,10 @@ class Rd {
|
|
|
16125
16145
|
} catch (a) {
|
|
16126
16146
|
throw console.error(a), new gt("Critical - Unable to synchronize workflow state with server.");
|
|
16127
16147
|
}
|
|
16128
|
-
}, this.options = t, this.options.applicationKey && ar(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 34.0.0-beta.
|
|
16148
|
+
}, this.options = t, this.options.applicationKey && ar(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 34.0.0-beta.3f2fe6a9-805d-5c25-a99f-4d12215f8c94"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
|
16129
16149
|
}
|
|
16130
16150
|
configure(t) {
|
|
16131
|
-
pt.setHubUrl(t.hubUrl), pt.setServerUrl(t.serverUrl), pt.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 && ir(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId &&
|
|
16151
|
+
pt.setHubUrl(t.hubUrl), pt.setServerUrl(t.serverUrl), pt.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 && ir(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Vt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
|
16132
16152
|
}
|
|
16133
16153
|
/**
|
|
16134
16154
|
* @returns The asset manager allows for common operations related to assets
|
|
@@ -16322,7 +16342,7 @@ class Rd {
|
|
|
16322
16342
|
return !1;
|
|
16323
16343
|
const i = JSON.parse(e), r = (/* @__PURE__ */ new Date()).getTime() / 1e3;
|
|
16324
16344
|
if (!i.ExpiresIn || i.ExpiresIn < r - parseInt(t)) {
|
|
16325
|
-
const l = await
|
|
16345
|
+
const l = await Vt.refreshTokens();
|
|
16326
16346
|
if (l?.AuthenticationResult)
|
|
16327
16347
|
localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), i.AccessToken = l.AuthenticationResult.AccessToken, localStorage.setItem("cognito-tokens", JSON.stringify(i));
|
|
16328
16348
|
else
|
|
@@ -16347,14 +16367,14 @@ class Rd {
|
|
|
16347
16367
|
variables: {
|
|
16348
16368
|
emailAddress: t
|
|
16349
16369
|
}
|
|
16350
|
-
}), await
|
|
16370
|
+
}), await Vt.generateCode(t);
|
|
16351
16371
|
}
|
|
16352
16372
|
/**
|
|
16353
16373
|
* Verify an email code to log in as a Spiff user.
|
|
16354
16374
|
* Always returns true if it doesn't throw.
|
|
16355
16375
|
*/
|
|
16356
16376
|
async verifyCode(t, e) {
|
|
16357
|
-
const a = (await this.getIntegration()).partner.id || "", i = await
|
|
16377
|
+
const a = (await this.getIntegration()).partner.id || "", i = await Vt.verifyCode(t, e, a);
|
|
16358
16378
|
if (i?.AuthenticationResult) {
|
|
16359
16379
|
localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), localStorage.setItem("cognito-tokens", JSON.stringify(i.AuthenticationResult)), localStorage.setItem("cognito-email", t);
|
|
16360
16380
|
const o = (await y.getShadowGraphqlClient().query({
|
|
@@ -16384,7 +16404,7 @@ class Rd {
|
|
|
16384
16404
|
throw new Error("No token data in storage.");
|
|
16385
16405
|
const a = JSON.parse(e), i = (/* @__PURE__ */ new Date()).getTime() / 1e3, r = !a?.AccessToken || Te(a.AccessToken);
|
|
16386
16406
|
if (!a.ExpiresIn || a.ExpiresIn < i - parseInt(t) || r) {
|
|
16387
|
-
const o = await
|
|
16407
|
+
const o = await Vt.refreshTokens();
|
|
16388
16408
|
if (o?.AuthenticationResult)
|
|
16389
16409
|
localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), a.AccessToken = o.AuthenticationResult.AccessToken, localStorage.setItem("cognito-tokens", JSON.stringify(a));
|
|
16390
16410
|
else
|
|
@@ -16656,12 +16676,12 @@ class Rd {
|
|
|
16656
16676
|
const it = x.get(T.integrationProductId);
|
|
16657
16677
|
T.integrationProduct = it, T.product = it?.product, T.integrationProduct || console.error("failed to find transaction's product");
|
|
16658
16678
|
}
|
|
16659
|
-
const
|
|
16660
|
-
!
|
|
16661
|
-
const He =
|
|
16679
|
+
const se = k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map();
|
|
16680
|
+
!se.get(T.id) && T.transactionOwnerId && (se.set(T.id, T.transactionOwnerId), k.setMap("transactionOwnerIds", se));
|
|
16681
|
+
const He = se.get(T.id) || void 0, Si = new Zl({
|
|
16662
16682
|
onMutate: () => ({ context: { transactionOwnerId: He, bundleOwnerId: e?.bundleOwnerId } }),
|
|
16663
16683
|
onQuery: () => ({ context: { transactionOwnerId: He, bundleOwnerId: e?.bundleOwnerId } })
|
|
16664
|
-
}),
|
|
16684
|
+
}), le = {
|
|
16665
16685
|
workflow: qe,
|
|
16666
16686
|
transaction: T,
|
|
16667
16687
|
singleVariantsRenderable: At?.workflowConfiguration?.singleVariantsRenderable,
|
|
@@ -16677,12 +16697,12 @@ class Rd {
|
|
|
16677
16697
|
};
|
|
16678
16698
|
if (At.type === "transaction" && T.workflowState) {
|
|
16679
16699
|
const it = JSON.parse(T.workflowState);
|
|
16680
|
-
await Za(it),
|
|
16700
|
+
await Za(it), le.reloadedState = it;
|
|
16681
16701
|
} else if (!D && At.workflowState) {
|
|
16682
16702
|
const it = JSON.parse(At.workflowState);
|
|
16683
|
-
await Za(it),
|
|
16703
|
+
await Za(it), le.reloadedState = it;
|
|
16684
16704
|
}
|
|
16685
|
-
return
|
|
16705
|
+
return le.delayWorkflowStateSync = !0, { experienceOptions: le, index: q, options: At };
|
|
16686
16706
|
}), N = (await Promise.all(E)).sort((B, T) => B.index - T.index);
|
|
16687
16707
|
let R = [];
|
|
16688
16708
|
for (const B of N) {
|
|
@@ -16867,7 +16887,7 @@ class cc {
|
|
|
16867
16887
|
let r = !1;
|
|
16868
16888
|
for (let o = 0; o < i.currentFrameSources.length; o++) {
|
|
16869
16889
|
const s = i.currentFrameSources[o], l = await Ve(s), c = this.frameData ? this.frameData[o] : void 0;
|
|
16870
|
-
|
|
16890
|
+
Yt(l, c) || (this.frameData || (this.frameData = new Array(i.currentFrameSources.length)), this.frameData[o] = l, r = !0);
|
|
16871
16891
|
}
|
|
16872
16892
|
r && (this.onFrameDataChangeListeners.forEach(
|
|
16873
16893
|
(o) => o(this.frameData)
|
|
@@ -16901,7 +16921,7 @@ class cc {
|
|
|
16901
16921
|
return;
|
|
16902
16922
|
}
|
|
16903
16923
|
t.forEach((e, a) => {
|
|
16904
|
-
const i =
|
|
16924
|
+
const i = zt.get(e);
|
|
16905
16925
|
i && (this.frameData || (this.frameData = new Array(t.length)), this.frameData[a] = i);
|
|
16906
16926
|
});
|
|
16907
16927
|
}
|
|
@@ -17881,7 +17901,7 @@ export {
|
|
|
17881
17901
|
ai as CreateLayoutCommand,
|
|
17882
17902
|
ac as CurrencyContext,
|
|
17883
17903
|
ec as CurrencyService,
|
|
17884
|
-
|
|
17904
|
+
Qt as DeleteElementCommand,
|
|
17885
17905
|
Al as DigitalContentStepHandle,
|
|
17886
17906
|
Pl as FileUploadGlobalPropertyHandle,
|
|
17887
17907
|
me as FlowExecutionNodeResult,
|
|
@@ -17904,7 +17924,7 @@ export {
|
|
|
17904
17924
|
Sd as LayoutElementFactory,
|
|
17905
17925
|
F as LayoutElementType,
|
|
17906
17926
|
J as LayoutNotFoundError,
|
|
17907
|
-
|
|
17927
|
+
Jt as LayoutRenderingPurpose,
|
|
17908
17928
|
il as MaterialStepHandle,
|
|
17909
17929
|
Be as MisconfigurationError,
|
|
17910
17930
|
zd as MockWorkflowManager,
|
|
@@ -17915,18 +17935,18 @@ export {
|
|
|
17915
17935
|
Jl as ObjectInputType,
|
|
17916
17936
|
hi as OptionGlobalPropertyHandle,
|
|
17917
17937
|
Ie as OptionNotFoundError,
|
|
17918
|
-
|
|
17938
|
+
xt as ParseError,
|
|
17919
17939
|
ol as PictureStepHandle,
|
|
17920
17940
|
Gi as ProductCameraRig,
|
|
17921
17941
|
mi as ProductCollection,
|
|
17922
17942
|
$l as ProductCollectionProductSortKey,
|
|
17923
|
-
|
|
17924
|
-
|
|
17943
|
+
qt as ProductWorkflow,
|
|
17944
|
+
Xt as PromiseCache,
|
|
17925
17945
|
Wn as PromiseQueue,
|
|
17926
17946
|
sl as QuestionStepHandle,
|
|
17927
17947
|
Gn as QueueablePromise,
|
|
17928
17948
|
bd as ResizeCommand,
|
|
17929
|
-
|
|
17949
|
+
Kt as ResourceNotFoundError,
|
|
17930
17950
|
Ed as RotateCommand,
|
|
17931
17951
|
j as ScaleAxis,
|
|
17932
17952
|
Fd as SendBackwardsCommand,
|
|
@@ -17937,7 +17957,7 @@ export {
|
|
|
17937
17957
|
Ui as StepAspectType,
|
|
17938
17958
|
tt as StepHandle,
|
|
17939
17959
|
b as StepType,
|
|
17940
|
-
|
|
17960
|
+
Mt as TextAlgorithm,
|
|
17941
17961
|
Oo as TextChangeCommand,
|
|
17942
17962
|
xl as TextGlobalPropertyHandle,
|
|
17943
17963
|
Nd as TextInput,
|
|
@@ -17966,7 +17986,7 @@ export {
|
|
|
17966
17986
|
cd as findAngle,
|
|
17967
17987
|
V as findElement,
|
|
17968
17988
|
sd as findPmsColors,
|
|
17969
|
-
|
|
17989
|
+
zt as frameDataCache,
|
|
17970
17990
|
St as frameStepService,
|
|
17971
17991
|
M as generate,
|
|
17972
17992
|
fs as generateCommands,
|
|
@@ -18005,7 +18025,7 @@ export {
|
|
|
18005
18025
|
y as graphQlManager,
|
|
18006
18026
|
we as illustrationStepService,
|
|
18007
18027
|
dd as isCloseToValue,
|
|
18008
|
-
|
|
18028
|
+
Nt as loadFont,
|
|
18009
18029
|
od as matchHexToPms,
|
|
18010
18030
|
ri as materialStepService,
|
|
18011
18031
|
Ol as metafieldManager,
|
|
@@ -18031,7 +18051,7 @@ export {
|
|
|
18031
18051
|
Pa as sanitizeSvgTree,
|
|
18032
18052
|
ir as setBearerAuthenticationToken,
|
|
18033
18053
|
kn as setCanvasModule,
|
|
18034
|
-
|
|
18054
|
+
Gt as shapeStepService,
|
|
18035
18055
|
Uo as shortenUrl,
|
|
18036
18056
|
pt as spiffCoreConfiguration,
|
|
18037
18057
|
Dd as stepAspectValuesToDesignInputSteps,
|