@spiffcommerce/core 27.2.1-beta.ba9aed1e-3075-5c0b-8797-fad18911dd7e → 27.2.1-beta.d1700123-3835-51b2-8677-b33ff1a4b7e2
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 +2 -0
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +370 -373
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -9,10 +9,10 @@ import hr from "fuse.js";
|
|
|
9
9
|
import { Pith as Aa } from "pith";
|
|
10
10
|
import St from "lodash.clonedeep";
|
|
11
11
|
import { toString as sn } from "qrcode";
|
|
12
|
-
import
|
|
12
|
+
import mr from "svg-path-bbox";
|
|
13
13
|
import { parse as Xe } from "opentype.js";
|
|
14
14
|
import { jsx as F, jsxs as ct, Fragment as zt } from "preact/jsx-runtime";
|
|
15
|
-
import
|
|
15
|
+
import gr from "handlebars";
|
|
16
16
|
import { dataUriToBuffer as pr } from "data-uri-to-buffer";
|
|
17
17
|
import Fa from "lodash.chunk";
|
|
18
18
|
import { CognitoIdentityProviderClient as fr, InitiateAuthCommand as ka, RespondToAuthChallengeCommand as Cr } from "@aws-sdk/client-cognito-identity-provider";
|
|
@@ -158,7 +158,7 @@ class Pr {
|
|
|
158
158
|
this.serverUrlCallbacks.push(t);
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
const
|
|
161
|
+
const mt = new Pr();
|
|
162
162
|
let ta, ea;
|
|
163
163
|
function Ec(r) {
|
|
164
164
|
ta = r;
|
|
@@ -289,34 +289,34 @@ const dn = /* @__PURE__ */ new Map(), Ta = /* @__PURE__ */ new Map(), Na = /* @_
|
|
|
289
289
|
!i || !i.result ? e() : t(i.result.toString());
|
|
290
290
|
}, a.readAsDataURL(r);
|
|
291
291
|
});
|
|
292
|
-
let Qr,
|
|
292
|
+
let Qr, ma;
|
|
293
293
|
const Rr = (r) => {
|
|
294
|
-
|
|
295
|
-
}, Or = () =>
|
|
296
|
-
let
|
|
294
|
+
ma = r;
|
|
295
|
+
}, Or = () => ma;
|
|
296
|
+
let mn;
|
|
297
297
|
const $r = (r) => {
|
|
298
|
-
|
|
298
|
+
mn = r;
|
|
299
299
|
}, Lr = () => new Promise((r) => {
|
|
300
|
-
const t =
|
|
300
|
+
const t = mt.getHubUrl(), e = (a) => {
|
|
301
301
|
a.origin === t && (window.removeEventListener("message", e), r(a.data));
|
|
302
302
|
};
|
|
303
303
|
window.parent !== window && (window.addEventListener("message", e, !1), window.parent.postMessage("ready", t));
|
|
304
304
|
}), Ur = async () => {
|
|
305
305
|
const r = {
|
|
306
|
-
applicationKey:
|
|
306
|
+
applicationKey: ma,
|
|
307
307
|
customerToken: Qr,
|
|
308
|
-
bearer:
|
|
308
|
+
bearer: mn
|
|
309
309
|
};
|
|
310
310
|
return typeof window < "u" && (window.location.href.includes("/workflows/product/") || window.location.href.includes("hub=true")) ? { ...await Lr(), ...r } : r;
|
|
311
311
|
};
|
|
312
312
|
async function Vr(r, t) {
|
|
313
|
-
const e =
|
|
313
|
+
const e = mt.getServerUrl(), a = e.includes(".aumelbdev.spiffcommerce.com") ? "https://moonlight.aumelbdev.spiffcommerce.com" : e.includes(".us.spiffcommerce.com") ? "https://moonlight.us.spiffcommerce.com" : "https://moonlight.au.spiffcommerce.com";
|
|
314
314
|
let n = await rt(r, { ...t, redirect: "manual" });
|
|
315
315
|
return n.type === "opaqueredirect" && (typeof r != "string" && "url" in r ? n = await rt({ ...r, url: `${a}/graphql` }, t) : n = await rt(`${a}/graphql`, t)), n;
|
|
316
316
|
}
|
|
317
317
|
class Gr {
|
|
318
318
|
constructor() {
|
|
319
|
-
this.shadowGraphqlClient = this.constructShadowGraphqlClient(),
|
|
319
|
+
this.shadowGraphqlClient = this.constructShadowGraphqlClient(), mt.addServerUrlCallback(() => {
|
|
320
320
|
this.shadowGraphqlClient = this.constructShadowGraphqlClient();
|
|
321
321
|
});
|
|
322
322
|
}
|
|
@@ -328,7 +328,7 @@ class Gr {
|
|
|
328
328
|
}
|
|
329
329
|
constructShadowGraphqlClient() {
|
|
330
330
|
const t = rr({
|
|
331
|
-
uri: `${
|
|
331
|
+
uri: `${mt.getServerUrl()}/graphql`,
|
|
332
332
|
fetch: Vr
|
|
333
333
|
}), e = lr(async (i, s) => {
|
|
334
334
|
const { headers: o } = s, l = o || {}, c = await Ur();
|
|
@@ -338,7 +338,7 @@ class Gr {
|
|
|
338
338
|
d = await this.spiffClient.loggedInBearerToken();
|
|
339
339
|
} catch {
|
|
340
340
|
}
|
|
341
|
-
const A = s.partnerId ?? c.partnerId, u = s.activeIntegration ?? c.activeIntegration, h = s.transactionOwnerId,
|
|
341
|
+
const A = s.partnerId ?? c.partnerId, u = s.activeIntegration ?? c.activeIntegration, h = s.transactionOwnerId, m = s.customerToken ?? c.customerToken, g = s.applicationKey ?? c.applicationKey, p = s.bundleOwnerId;
|
|
342
342
|
try {
|
|
343
343
|
if (window && window.__SENTRY__) {
|
|
344
344
|
const f = window.__SENTRY__.hub;
|
|
@@ -351,7 +351,7 @@ class Gr {
|
|
|
351
351
|
}
|
|
352
352
|
} catch {
|
|
353
353
|
}
|
|
354
|
-
return d && (l.Authorization = `Bearer ${d}`), A && (l.partnerId = A), u && (l.activeIntegration = u), h && (l.transactionOwnerId = h),
|
|
354
|
+
return d && (l.Authorization = `Bearer ${d}`), A && (l.partnerId = A), u && (l.activeIntegration = u), h && (l.transactionOwnerId = h), m && (l.customerToken = m), g && (l["X-Application-Key"] = g), p && (l.bundleOwnerId = p), l["Allow-Moonlight-Redirect"] = "true", {
|
|
355
355
|
headers: l
|
|
356
356
|
};
|
|
357
357
|
}), a = cr(({ operation: i, graphQLErrors: s, networkError: o }) => {
|
|
@@ -368,12 +368,12 @@ class Gr {
|
|
|
368
368
|
}
|
|
369
369
|
const b = new Gr();
|
|
370
370
|
let aa, na;
|
|
371
|
-
const
|
|
371
|
+
const gt = (r, t, e) => {
|
|
372
372
|
if (aa !== void 0)
|
|
373
373
|
return aa(r, t, e);
|
|
374
374
|
try {
|
|
375
375
|
const a = pn(!0);
|
|
376
|
-
return
|
|
376
|
+
return gn(a), a.createCanvas(r, t, e);
|
|
377
377
|
} catch {
|
|
378
378
|
throw new Error("Canvas module not set");
|
|
379
379
|
}
|
|
@@ -382,12 +382,12 @@ const mt = (r, t, e) => {
|
|
|
382
382
|
return na(r, t);
|
|
383
383
|
try {
|
|
384
384
|
const e = pn(!0);
|
|
385
|
-
return
|
|
385
|
+
return gn(e), e.loadImage(r, t);
|
|
386
386
|
} catch {
|
|
387
387
|
throw new Error("Canvas module not set");
|
|
388
388
|
}
|
|
389
389
|
};
|
|
390
|
-
function
|
|
390
|
+
function gn(r) {
|
|
391
391
|
aa = r == null ? void 0 : r.createCanvas, na = r == null ? void 0 : r.loadImage;
|
|
392
392
|
}
|
|
393
393
|
function pn(r) {
|
|
@@ -411,7 +411,7 @@ function pn(r) {
|
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
413
|
let $e;
|
|
414
|
-
function
|
|
414
|
+
function ga() {
|
|
415
415
|
return $e === void 0 && ($e = Fr()), $e;
|
|
416
416
|
}
|
|
417
417
|
let se = null;
|
|
@@ -431,10 +431,10 @@ const zr = (r) => new Promise((t) => {
|
|
|
431
431
|
var A;
|
|
432
432
|
const t = await Tr(r), e = await Zt(t), [a, n] = jr(e);
|
|
433
433
|
if (!await Wr()) {
|
|
434
|
-
const u =
|
|
434
|
+
const u = gt(a, n);
|
|
435
435
|
return (A = u.getContext("2d")) == null || A.drawImage(e, 0, 0, a, n), u;
|
|
436
436
|
}
|
|
437
|
-
const s = await zr(r), [o, l] = s > 4 ? [n, a] : [a, n], c =
|
|
437
|
+
const s = await zr(r), [o, l] = s > 4 ? [n, a] : [a, n], c = gt(o, l), d = c.getContext("2d");
|
|
438
438
|
switch (s) {
|
|
439
439
|
case 2:
|
|
440
440
|
d.translate(o, 0), d.scale(-1, 1);
|
|
@@ -3275,8 +3275,8 @@ const oe = (r) => {
|
|
|
3275
3275
|
n.split(";").forEach((d) => {
|
|
3276
3276
|
const A = d.trim();
|
|
3277
3277
|
if (A) {
|
|
3278
|
-
const [u, h] = A.split(":"),
|
|
3279
|
-
Xr.indexOf(
|
|
3278
|
+
const [u, h] = A.split(":"), m = u.toLowerCase();
|
|
3279
|
+
Xr.indexOf(m) > -1 ? a.setAttribute(m, h.trim()) : l.push(A);
|
|
3280
3280
|
}
|
|
3281
3281
|
}), l.length > 0 ? a.setAttribute("style", l.join(";")) : a.removeAttribute("style");
|
|
3282
3282
|
}
|
|
@@ -3891,12 +3891,12 @@ const Jt = new Ai(), vn = v`
|
|
|
3891
3891
|
i.asset && L.cacheAsset(i.asset), i.thumbnail && L.cacheAsset(i.thumbnail), i.material && L.cacheMaterial(i.material);
|
|
3892
3892
|
});
|
|
3893
3893
|
}), t.data.options;
|
|
3894
|
-
},
|
|
3894
|
+
}, mi = async (r, t) => (await t).find((a) => a.id === r), gi = async (r) => {
|
|
3895
3895
|
const t = r.map((s) => Jt.get({ id: s })), e = r.filter((s, o) => t[o] === void 0);
|
|
3896
3896
|
if (e.length === 0)
|
|
3897
3897
|
return Promise.all(t);
|
|
3898
3898
|
const a = hi(e), n = e.map(
|
|
3899
|
-
(s) => Jt.set({ id: s },
|
|
3899
|
+
(s) => Jt.set({ id: s }, mi(s, a))
|
|
3900
3900
|
), i = t.filter((s) => s !== void 0);
|
|
3901
3901
|
return await Promise.all(i.concat(n));
|
|
3902
3902
|
};
|
|
@@ -3914,7 +3914,7 @@ class pi {
|
|
|
3914
3914
|
*/
|
|
3915
3915
|
async getOption(t) {
|
|
3916
3916
|
return (async () => {
|
|
3917
|
-
const n = (await
|
|
3917
|
+
const n = (await gi([t]))[0];
|
|
3918
3918
|
if (n)
|
|
3919
3919
|
return n;
|
|
3920
3920
|
})();
|
|
@@ -5317,7 +5317,7 @@ const Q = () => {
|
|
|
5317
5317
|
width: u
|
|
5318
5318
|
}) => {
|
|
5319
5319
|
var E;
|
|
5320
|
-
const h = e || 0,
|
|
5320
|
+
const h = e || 0, m = 2 * ((l == null ? void 0 : l.scale) || 1), g = A || { x: 0, y: 0, width: u, height: i }, p = `${g.x} ${g.y} ${g.width} ${g.height}`, f = Q(), C = a.purpose === qt.FreeDesign && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ F("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ F("rect", { width: g.width, height: g.height, rx: h }) }) }), w = (E = a.colorProfiles) == null ? void 0 : E.map((B, I) => (
|
|
5321
5321
|
/* @ts-ignore */
|
|
5322
5322
|
/* @__PURE__ */ F("color-profile", { name: B.name, xlinkHref: B.key, children: " " }, I)
|
|
5323
5323
|
)), S = n.map((B) => ({
|
|
@@ -5350,8 +5350,8 @@ const Q = () => {
|
|
|
5350
5350
|
"rect",
|
|
5351
5351
|
{
|
|
5352
5352
|
id: "layout-background",
|
|
5353
|
-
width:
|
|
5354
|
-
height:
|
|
5353
|
+
width: g.width,
|
|
5354
|
+
height: g.height,
|
|
5355
5355
|
fill: r,
|
|
5356
5356
|
rx: h
|
|
5357
5357
|
}
|
|
@@ -5373,18 +5373,18 @@ const Q = () => {
|
|
|
5373
5373
|
height: l.height,
|
|
5374
5374
|
fill: "none",
|
|
5375
5375
|
stroke: l.hidden ? "none" : t || "#aaaaaa",
|
|
5376
|
-
strokeWidth:
|
|
5377
|
-
strokeDasharray: `${
|
|
5376
|
+
strokeWidth: m / 2,
|
|
5377
|
+
strokeDasharray: `${m * 2} ${m}`
|
|
5378
5378
|
}
|
|
5379
5379
|
),
|
|
5380
5380
|
l && /* @__PURE__ */ ct("mask", { id: `viewmask-${f}`, children: [
|
|
5381
5381
|
/* @__PURE__ */ F(
|
|
5382
5382
|
"rect",
|
|
5383
5383
|
{
|
|
5384
|
-
x:
|
|
5385
|
-
y:
|
|
5386
|
-
width:
|
|
5387
|
-
height:
|
|
5384
|
+
x: g.x,
|
|
5385
|
+
y: g.y,
|
|
5386
|
+
width: g.width,
|
|
5387
|
+
height: g.height,
|
|
5388
5388
|
fill: "black"
|
|
5389
5389
|
}
|
|
5390
5390
|
),
|
|
@@ -5403,7 +5403,7 @@ const Q = () => {
|
|
|
5403
5403
|
}
|
|
5404
5404
|
);
|
|
5405
5405
|
}, xc = (r, t, e, a, n) => {
|
|
5406
|
-
const i = pt(n), s = e / 2, o = a / 2, l = r + s, c = t + o, d = Math.sin(i), A = Math.cos(i), u = s, h = s,
|
|
5406
|
+
const i = pt(n), s = e / 2, o = a / 2, l = r + s, c = t + o, d = Math.sin(i), A = Math.cos(i), u = s, h = s, m = -o, g = o, p = u * A - m * d, f = h * A - g * d, C = u * d + m * A, w = h * d + g * A, S = Math.max(Math.abs(p), Math.abs(f)), y = Math.max(Math.abs(C), Math.abs(w));
|
|
5407
5407
|
return {
|
|
5408
5408
|
minX: l - S,
|
|
5409
5409
|
maxX: l + S,
|
|
@@ -5567,15 +5567,15 @@ const Q = () => {
|
|
|
5567
5567
|
] })
|
|
5568
5568
|
] }) }) }), s = r.rotation || 0, o = pt(s), l = Math.cos(o), c = -Math.sin(o), d = () => {
|
|
5569
5569
|
var w, S, y, E, B, I, D, x, k, T;
|
|
5570
|
-
const A = ((w = r.pattern) == null ? void 0 : w.x) || 0, u = ((S = r.pattern) == null ? void 0 : S.y) || 0, h = ((y = r.pattern) == null ? void 0 : y.width) || 0,
|
|
5570
|
+
const A = ((w = r.pattern) == null ? void 0 : w.x) || 0, u = ((S = r.pattern) == null ? void 0 : S.y) || 0, h = ((y = r.pattern) == null ? void 0 : y.width) || 0, m = ((E = r.pattern) == null ? void 0 : E.height) || 0, g = ((B = r.pattern) == null ? void 0 : B.scaleX) || 1, p = ((I = r.pattern) == null ? void 0 : I.scaleY) || 1, f = ((D = r.pattern) == null ? void 0 : D.rotation) || 0;
|
|
5571
5571
|
return [(x = r.pattern) != null && x.svg ? {
|
|
5572
5572
|
id: `${t}-contents`,
|
|
5573
5573
|
type: M.Illustration,
|
|
5574
5574
|
x: A,
|
|
5575
5575
|
y: u,
|
|
5576
5576
|
rotation: f,
|
|
5577
|
-
width: h *
|
|
5578
|
-
height:
|
|
5577
|
+
width: h * g,
|
|
5578
|
+
height: m * p,
|
|
5579
5579
|
src: a(),
|
|
5580
5580
|
svg: (k = r.pattern) == null ? void 0 : k.svg,
|
|
5581
5581
|
colors: (T = r.pattern) == null ? void 0 : T.colors
|
|
@@ -5585,8 +5585,8 @@ const Q = () => {
|
|
|
5585
5585
|
x: A,
|
|
5586
5586
|
y: u,
|
|
5587
5587
|
rotation: f,
|
|
5588
|
-
width: h *
|
|
5589
|
-
height:
|
|
5588
|
+
width: h * g,
|
|
5589
|
+
height: m * p,
|
|
5590
5590
|
src: a()
|
|
5591
5591
|
}];
|
|
5592
5592
|
};
|
|
@@ -5710,18 +5710,18 @@ const qi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ue = /* @_
|
|
|
5710
5710
|
a.querySelectorAll("style").forEach((d) => {
|
|
5711
5711
|
var u;
|
|
5712
5712
|
(u = rn(d.innerHTML).stylesheet) == null || u.rules.forEach((h) => {
|
|
5713
|
-
var
|
|
5713
|
+
var m, g, p;
|
|
5714
5714
|
if (h.type === "font-face" && h.declarations) {
|
|
5715
|
-
const f = (
|
|
5715
|
+
const f = (m = h.declarations.find(
|
|
5716
5716
|
(S) => S.property === "font-family"
|
|
5717
|
-
)) == null ? void 0 :
|
|
5717
|
+
)) == null ? void 0 : m.value, C = (g = h.declarations.find((S) => S.property === "src")) == null ? void 0 : g.value, w = (p = C == null ? void 0 : C.match(/'(https.*?)'/)) == null ? void 0 : p[1];
|
|
5718
5718
|
f && w && n.set(f, w);
|
|
5719
5719
|
}
|
|
5720
5720
|
});
|
|
5721
5721
|
});
|
|
5722
5722
|
const s = e.querySelectorAll("tspan");
|
|
5723
5723
|
for (let d = 0; d < s.length; d++) {
|
|
5724
|
-
const A = s.item(d), u = A.closest("text"), h = A.closest("g"),
|
|
5724
|
+
const A = s.item(d), u = A.closest("text"), h = A.closest("g"), m = u.getAttribute("font-family"), g = await Nt(n.get(m)), p = u.getAttribute("fill"), f = u.getAttribute("stroke"), C = u.getAttribute("stroke-width"), w = g.getPath(
|
|
5725
5725
|
A.innerHTML,
|
|
5726
5726
|
0,
|
|
5727
5727
|
0,
|
|
@@ -5730,7 +5730,7 @@ const qi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ue = /* @_
|
|
|
5730
5730
|
let y = 0;
|
|
5731
5731
|
const E = A.getAttribute("text-anchor");
|
|
5732
5732
|
E === "middle" ? y = S / 2 : E === "end" && (y = S);
|
|
5733
|
-
const B =
|
|
5733
|
+
const B = g.getPath(
|
|
5734
5734
|
A.innerHTML,
|
|
5735
5735
|
parseFloat(A.getAttribute("x") ?? "0") - y,
|
|
5736
5736
|
parseFloat(A.getAttribute("y") ?? "0"),
|
|
@@ -5746,7 +5746,7 @@ const qi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ue = /* @_
|
|
|
5746
5746
|
const s = (i || ya) * n.getApproximateHeight(), o = t.split(`
|
|
5747
5747
|
`);
|
|
5748
5748
|
try {
|
|
5749
|
-
const l = o.flatMap((d) =>
|
|
5749
|
+
const l = o.flatMap((d) => me(d, r.width, a, n)), c = l.flatMap((d) => d.lines);
|
|
5750
5750
|
return {
|
|
5751
5751
|
lines: c,
|
|
5752
5752
|
requiredHeight: l.flatMap((d) => d.lines).length * (a * s),
|
|
@@ -5762,14 +5762,14 @@ const qi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ue = /* @_
|
|
|
5762
5762
|
requiredWidth: Ee(c, r.width, a, n)
|
|
5763
5763
|
};
|
|
5764
5764
|
}
|
|
5765
|
-
},
|
|
5765
|
+
}, me = (r, t, e, a) => {
|
|
5766
5766
|
const n = ht(r, e, a);
|
|
5767
5767
|
if (n <= t)
|
|
5768
5768
|
return { lines: [r], width: n };
|
|
5769
5769
|
if (!(r.indexOf(" ") > -1)) {
|
|
5770
5770
|
if (r.length <= 1)
|
|
5771
5771
|
throw new Error(`Character ${r} is wider than region`);
|
|
5772
|
-
const d = Math.floor(r.length / 2), A =
|
|
5772
|
+
const d = Math.floor(r.length / 2), A = me(r.slice(0, d), t, e, a), u = me(r.slice(d), t, e, a);
|
|
5773
5773
|
return { lines: [...A.lines, ...u.lines], width: Math.max(A.width, u.width) };
|
|
5774
5774
|
}
|
|
5775
5775
|
const s = r.split(" "), o = [];
|
|
@@ -5777,15 +5777,15 @@ const qi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ue = /* @_
|
|
|
5777
5777
|
for (; c < s.length; ) {
|
|
5778
5778
|
const d = s[c];
|
|
5779
5779
|
if (ht(d, e, a) > t) {
|
|
5780
|
-
const A =
|
|
5780
|
+
const A = me(d, t, e, a);
|
|
5781
5781
|
o.push(...A.lines), l = Math.max(l, A.width), c++;
|
|
5782
5782
|
} else {
|
|
5783
5783
|
const A = [d];
|
|
5784
5784
|
l = Math.max(l, ht(d, e, a));
|
|
5785
5785
|
let u = c + 1, h = !0;
|
|
5786
5786
|
for (; u < s.length && h; ) {
|
|
5787
|
-
const
|
|
5788
|
-
|
|
5787
|
+
const m = s[u], g = ht(`${A.join(" ")} ${m}`, e, a);
|
|
5788
|
+
g <= t ? (A.push(m), l = Math.max(l, g), u++) : h = !1;
|
|
5789
5789
|
}
|
|
5790
5790
|
o.push(A.join(" ")), c = u;
|
|
5791
5791
|
}
|
|
@@ -5874,16 +5874,16 @@ const qi = (r) => r.substring(0, 5).toLowerCase().trim() === "data:", Ue = /* @_
|
|
|
5874
5874
|
};
|
|
5875
5875
|
})()
|
|
5876
5876
|
} : r, ya = 1.1, ts = (r) => {
|
|
5877
|
-
var
|
|
5877
|
+
var m, g, p, f, C;
|
|
5878
5878
|
const e = (r.rotation || 0) * Math.PI / 180, a = Math.cos(e), n = -Math.sin(e), i = `text-path-${r.id}`, s = `text-fill-${r.id}`, o = r.x + (r.curved ? 0 : r.width / 2), l = r.y + (r.curved ? 0 : r.height / 2);
|
|
5879
5879
|
let c = "";
|
|
5880
5880
|
try {
|
|
5881
|
-
c =
|
|
5881
|
+
c = gr.compile(r.text || "")((m = r._renderingConfiguration) == null ? void 0 : m.templatingContext);
|
|
5882
5882
|
} catch {
|
|
5883
5883
|
c = r.text ?? "";
|
|
5884
5884
|
}
|
|
5885
5885
|
const d = c.split(`
|
|
5886
|
-
`), A = (
|
|
5886
|
+
`), A = (g = r.strokeColor) != null && g.browserValue && r.strokeThickness ? (p = r.strokeColor) == null ? void 0 : p.browserValue : void 0, u = (f = r.strokeColor) != null && f.browserValue && r.strokeThickness ? r.strokeThickness : void 0;
|
|
5887
5887
|
if (r.curved && !r.paths || !r.fontData)
|
|
5888
5888
|
return null;
|
|
5889
5889
|
const h = () => {
|
|
@@ -6316,19 +6316,19 @@ const ae = (r) => {
|
|
|
6316
6316
|
const s = dt().parseFromString(r, "image/svg+xml").firstElementChild;
|
|
6317
6317
|
if (!s)
|
|
6318
6318
|
throw new Error("Failed to read SVG");
|
|
6319
|
-
const l = bt().serializeToString(s), c =
|
|
6319
|
+
const l = bt().serializeToString(s), c = gt(), d = c.getContext("2d"), A = await Aa.from(d, l, {
|
|
6320
6320
|
anonymousCrossOrigin: !0,
|
|
6321
6321
|
ignoreDimensions: !1,
|
|
6322
|
-
createCanvas:
|
|
6322
|
+
createCanvas: gt,
|
|
6323
6323
|
createImage: Zt,
|
|
6324
|
-
DOMParser:
|
|
6324
|
+
DOMParser: ga(),
|
|
6325
6325
|
fetch: rt
|
|
6326
|
-
}), u = s.getAttribute("width"), h = s.getAttribute("height"),
|
|
6326
|
+
}), u = s.getAttribute("width"), h = s.getAttribute("height"), m = 2048;
|
|
6327
6327
|
if (h && u) {
|
|
6328
|
-
const
|
|
6329
|
-
f > 1 ? A.resize(
|
|
6328
|
+
const g = parseFloat(h), f = parseFloat(u) / g;
|
|
6329
|
+
f > 1 ? A.resize(m, m / f) : A.resize(m * f, m);
|
|
6330
6330
|
} else
|
|
6331
|
-
A.resize(
|
|
6331
|
+
A.resize(m, m);
|
|
6332
6332
|
return await A.render(), await t(c);
|
|
6333
6333
|
})();
|
|
6334
6334
|
return ze.set(r, a), a;
|
|
@@ -6350,7 +6350,7 @@ const ae = (r) => {
|
|
|
6350
6350
|
const l = await lt(await $n(e)), u = dt().parseFromString(l.svg, "image/svg+xml").firstElementChild.getAttribute("viewBox");
|
|
6351
6351
|
if (!u)
|
|
6352
6352
|
throw new Error("SVG missing viewBox.");
|
|
6353
|
-
const h = o.height,
|
|
6353
|
+
const h = o.height, m = u.split(" "), g = parseFloat(m[2]) || 1, p = parseFloat(m[3]) || 1, f = g / p;
|
|
6354
6354
|
o.height = o.width / f, o.top += (h - o.height) / 2;
|
|
6355
6355
|
}
|
|
6356
6356
|
if (e && t === M.Image) {
|
|
@@ -6409,7 +6409,7 @@ class Gc {
|
|
|
6409
6409
|
};
|
|
6410
6410
|
}
|
|
6411
6411
|
static async getTextbox(t, e) {
|
|
6412
|
-
var
|
|
6412
|
+
var m;
|
|
6413
6413
|
const { configuration: a, fontSrc: n, designInputStep: i } = e, s = await Nt(n), o = {
|
|
6414
6414
|
assetUrl: n,
|
|
6415
6415
|
name: s.names.fullName.en
|
|
@@ -6447,7 +6447,7 @@ class Gc {
|
|
|
6447
6447
|
{ ...A, height: u.height },
|
|
6448
6448
|
o,
|
|
6449
6449
|
u.fontSize,
|
|
6450
|
-
((
|
|
6450
|
+
((m = u == null ? void 0 : u.text) == null ? void 0 : m.split(`
|
|
6451
6451
|
`)) || [],
|
|
6452
6452
|
u.align
|
|
6453
6453
|
);
|
|
@@ -7243,7 +7243,7 @@ class ja {
|
|
|
7243
7243
|
command: new W(h, i)
|
|
7244
7244
|
};
|
|
7245
7245
|
} else {
|
|
7246
|
-
const u = this.configuration.type === P.SilentIllustration ? (A = this.configuration.data.asset) == null ? void 0 : A.fileLink : s,
|
|
7246
|
+
const u = this.configuration.type === P.SilentIllustration ? (A = this.configuration.data.asset) == null ? void 0 : A.fileLink : s, m = await lt(await (async () => new Promise((p, f) => {
|
|
7247
7247
|
if (!u) {
|
|
7248
7248
|
f("Undefined vector silent step source");
|
|
7249
7249
|
return;
|
|
@@ -7251,13 +7251,13 @@ class ja {
|
|
|
7251
7251
|
at(u, !0).then((C) => {
|
|
7252
7252
|
p(C);
|
|
7253
7253
|
}).catch((C) => console.error(C));
|
|
7254
|
-
}))()),
|
|
7254
|
+
}))()), g = {
|
|
7255
7255
|
stepName: this.configuration.stepName,
|
|
7256
7256
|
id: Q(),
|
|
7257
|
-
cachedObjectURL: await Kt(
|
|
7257
|
+
cachedObjectURL: await Kt(m.svg),
|
|
7258
7258
|
src: u,
|
|
7259
|
-
svg:
|
|
7260
|
-
colors:
|
|
7259
|
+
svg: m.svg,
|
|
7260
|
+
colors: m.colors,
|
|
7261
7261
|
type: o,
|
|
7262
7262
|
y: n.top,
|
|
7263
7263
|
x: n.left,
|
|
@@ -7272,10 +7272,10 @@ class ja {
|
|
|
7272
7272
|
};
|
|
7273
7273
|
return {
|
|
7274
7274
|
regionElement: {
|
|
7275
|
-
id:
|
|
7275
|
+
id: g.id,
|
|
7276
7276
|
region: n
|
|
7277
7277
|
},
|
|
7278
|
-
command: new W(
|
|
7278
|
+
command: new W(g, i)
|
|
7279
7279
|
};
|
|
7280
7280
|
}
|
|
7281
7281
|
}, this.configuration = t, this.layouts = e, this.product = a || void 0;
|
|
@@ -7302,7 +7302,7 @@ class ja {
|
|
|
7302
7302
|
}
|
|
7303
7303
|
}
|
|
7304
7304
|
const hs = async (r) => {
|
|
7305
|
-
const t = `${
|
|
7305
|
+
const t = `${mt.getServicesApiUrl()}/shortener`;
|
|
7306
7306
|
try {
|
|
7307
7307
|
return (await (await rt(t, {
|
|
7308
7308
|
method: "POST",
|
|
@@ -7338,7 +7338,7 @@ class Un {
|
|
|
7338
7338
|
this.onSuccess = e, this.onFailure = a, this.predicate = t, this.attempts = 0, this.pollingId = -1, this.interval = n, this.maxAttempts = i, this.poll();
|
|
7339
7339
|
}
|
|
7340
7340
|
}
|
|
7341
|
-
class
|
|
7341
|
+
class ms {
|
|
7342
7342
|
async init(t, e, a) {
|
|
7343
7343
|
return a && await this.reload(t, e, a), null;
|
|
7344
7344
|
}
|
|
@@ -7358,23 +7358,23 @@ class gs {
|
|
|
7358
7358
|
}
|
|
7359
7359
|
async regenerateQRCode(t, e, a, n) {
|
|
7360
7360
|
const i = async () => {
|
|
7361
|
-
var
|
|
7362
|
-
const h = (await ve([e]))[0],
|
|
7363
|
-
return { asset: h, link:
|
|
7364
|
-
}, s = await new Promise((h,
|
|
7361
|
+
var g, p;
|
|
7362
|
+
const h = (await ve([e]))[0], m = (p = (g = h == null ? void 0 : h.versions) == null ? void 0 : g.find((f) => f.name === "mpeg4")) == null ? void 0 : p.link;
|
|
7363
|
+
return { asset: h, link: m };
|
|
7364
|
+
}, s = await new Promise((h, m) => {
|
|
7365
7365
|
new Un(
|
|
7366
7366
|
async () => !!(await i()).link,
|
|
7367
7367
|
async () => {
|
|
7368
|
-
const
|
|
7369
|
-
if (!
|
|
7370
|
-
throw new Ht(
|
|
7368
|
+
const g = await i();
|
|
7369
|
+
if (!g.link || !g.link)
|
|
7370
|
+
throw new Ht(g.asset);
|
|
7371
7371
|
h({
|
|
7372
7372
|
rel: "mpeg4",
|
|
7373
|
-
href:
|
|
7373
|
+
href: g.link
|
|
7374
7374
|
});
|
|
7375
7375
|
},
|
|
7376
7376
|
() => {
|
|
7377
|
-
|
|
7377
|
+
m("Poller timed out with 40 attempts @ 3 second interval");
|
|
7378
7378
|
},
|
|
7379
7379
|
3e3,
|
|
7380
7380
|
40
|
|
@@ -7430,7 +7430,7 @@ class gs {
|
|
|
7430
7430
|
} };
|
|
7431
7431
|
}
|
|
7432
7432
|
}
|
|
7433
|
-
const Vn = new
|
|
7433
|
+
const Vn = new ms();
|
|
7434
7434
|
class be {
|
|
7435
7435
|
constructor() {
|
|
7436
7436
|
this.frameSourceSvg = async (t, e) => {
|
|
@@ -7492,8 +7492,8 @@ class be {
|
|
|
7492
7492
|
}
|
|
7493
7493
|
if (n) {
|
|
7494
7494
|
const d = async () => {
|
|
7495
|
-
var
|
|
7496
|
-
const A = (
|
|
7495
|
+
var m, g, p, f, C;
|
|
7496
|
+
const A = (m = n.storage) == null ? void 0 : m.colors, u = (g = n.storage) == null ? void 0 : g.framePatternSrc, h = (p = n.storage) == null ? void 0 : p.frameOffsetsList;
|
|
7497
7497
|
if (e.updateMetadata(t.stepName, {
|
|
7498
7498
|
frameOffsetsList: h,
|
|
7499
7499
|
framePatternSrc: u
|
|
@@ -7523,7 +7523,7 @@ class be {
|
|
|
7523
7523
|
l,
|
|
7524
7524
|
async () => {
|
|
7525
7525
|
const h = await Promise.all(
|
|
7526
|
-
t.data.regions.map((
|
|
7526
|
+
t.data.regions.map((m) => this.frameSourceSvg(u, m))
|
|
7527
7527
|
);
|
|
7528
7528
|
e.updateStorage(t.stepName, { currentFrameSources: h }), await d();
|
|
7529
7529
|
}
|
|
@@ -7555,7 +7555,7 @@ class be {
|
|
|
7555
7555
|
new Un(
|
|
7556
7556
|
async () => {
|
|
7557
7557
|
var h;
|
|
7558
|
-
const A = (h = (await L.getFromServer(e.key || "")).versions) == null ? void 0 : h.find((
|
|
7558
|
+
const A = (h = (await L.getFromServer(e.key || "")).versions) == null ? void 0 : h.find((m) => m.name === "svg");
|
|
7559
7559
|
return A ? (await rt(A.link)).status === 200 : !1;
|
|
7560
7560
|
},
|
|
7561
7561
|
() => {
|
|
@@ -7717,12 +7717,12 @@ class be {
|
|
|
7717
7717
|
if (!o)
|
|
7718
7718
|
throw new Error("Frame service unavailable, cannot load pattern!");
|
|
7719
7719
|
const l = await Promise.all(
|
|
7720
|
-
t.data.regions.map((
|
|
7720
|
+
t.data.regions.map((m) => this.frameSourceSvg(e, m))
|
|
7721
7721
|
);
|
|
7722
7722
|
i && i(!0);
|
|
7723
7723
|
const c = t.data.initialZoomLevel, d = await Promise.all(
|
|
7724
|
-
t.data.regions.map(async (
|
|
7725
|
-
const p = await Qe(l[
|
|
7724
|
+
t.data.regions.map(async (m, g) => {
|
|
7725
|
+
const p = await Qe(l[g]), f = o.getImageData(), C = a.map((I) => new Bt(I.id)), w = f ? Ea(
|
|
7726
7726
|
f,
|
|
7727
7727
|
p,
|
|
7728
7728
|
c && !t.data.forceImageCover ? { scale: c } : void 0,
|
|
@@ -7737,11 +7737,11 @@ class be {
|
|
|
7737
7737
|
scaleX: (w == null ? void 0 : w.zoom) || 1,
|
|
7738
7738
|
scaleY: (w == null ? void 0 : w.zoom) || 1,
|
|
7739
7739
|
rotation: 0
|
|
7740
|
-
} : void 0, y = Q(), B = n.getLayouts().find((I) => I.panelId ===
|
|
7740
|
+
} : void 0, y = Q(), B = n.getLayouts().find((I) => I.panelId === m.panelId);
|
|
7741
7741
|
if (!B)
|
|
7742
|
-
throw new J(
|
|
7742
|
+
throw new J(m);
|
|
7743
7743
|
return {
|
|
7744
|
-
command: this.getCreateElementCommand(y,
|
|
7744
|
+
command: this.getCreateElementCommand(y, m, B, {
|
|
7745
7745
|
frameData: p,
|
|
7746
7746
|
pattern: S,
|
|
7747
7747
|
disablePlaceholder: t.data.disablePlaceholder,
|
|
@@ -7749,26 +7749,26 @@ class be {
|
|
|
7749
7749
|
}),
|
|
7750
7750
|
regionEl: {
|
|
7751
7751
|
id: y,
|
|
7752
|
-
region:
|
|
7752
|
+
region: m
|
|
7753
7753
|
},
|
|
7754
7754
|
removeExistingCommands: C
|
|
7755
7755
|
};
|
|
7756
7756
|
})
|
|
7757
|
-
), A = d.map((
|
|
7757
|
+
), A = d.map((m) => m.command), u = d.map((m) => m.removeExistingCommands).flat();
|
|
7758
7758
|
return {
|
|
7759
7759
|
command: new $([...A, ...u]),
|
|
7760
7760
|
followup: async () => {
|
|
7761
7761
|
i && i(!1), await n.setSelectionsAndElements(
|
|
7762
7762
|
t.stepName,
|
|
7763
7763
|
e ? [e] : [],
|
|
7764
|
-
[...d.map((
|
|
7764
|
+
[...d.map((m) => m.regionEl)],
|
|
7765
7765
|
async () => {
|
|
7766
|
-
var
|
|
7766
|
+
var m;
|
|
7767
7767
|
if (n.updateStorage(t.stepName, { currentFrameSources: l }), s) {
|
|
7768
|
-
const
|
|
7769
|
-
if (!
|
|
7768
|
+
const g = (m = n.getWorkflowExperience().getStepById(t.stepName)) == null ? void 0 : m.frameService;
|
|
7769
|
+
if (!g)
|
|
7770
7770
|
throw new Error("Frame service unavailable, cannot load pattern!");
|
|
7771
|
-
await this.loadPatternFromString(s,
|
|
7771
|
+
await this.loadPatternFromString(s, g, !0);
|
|
7772
7772
|
}
|
|
7773
7773
|
}
|
|
7774
7774
|
);
|
|
@@ -7818,7 +7818,7 @@ class be {
|
|
|
7818
7818
|
}
|
|
7819
7819
|
}
|
|
7820
7820
|
const wt = new be();
|
|
7821
|
-
class
|
|
7821
|
+
class gs {
|
|
7822
7822
|
async getIllustrationBody(t) {
|
|
7823
7823
|
return new Promise((e) => {
|
|
7824
7824
|
at(t, !0).then((a) => {
|
|
@@ -7936,39 +7936,39 @@ class ms {
|
|
|
7936
7936
|
return new $(c);
|
|
7937
7937
|
}
|
|
7938
7938
|
async changeColors(t, e, a, n, i) {
|
|
7939
|
-
var h,
|
|
7939
|
+
var h, m;
|
|
7940
7940
|
if (e.length === 0)
|
|
7941
7941
|
return;
|
|
7942
7942
|
const s = U(
|
|
7943
7943
|
e[0].id,
|
|
7944
|
-
n().map((
|
|
7944
|
+
n().map((g) => g.layoutState)
|
|
7945
7945
|
), o = { ...s.colors }, l = {};
|
|
7946
|
-
Object.entries(o).forEach(([
|
|
7946
|
+
Object.entries(o).forEach(([g, p]) => {
|
|
7947
7947
|
const f = { browserValue: p.browserValue, pmsValue: p.pmsValue }, C = p.spotColor;
|
|
7948
|
-
C && (f.spotColor = { profileName: C.profileName, namedColor: C.namedColor }), l[
|
|
7948
|
+
C && (f.spotColor = { profileName: C.profileName, namedColor: C.namedColor }), l[g] = f;
|
|
7949
7949
|
});
|
|
7950
|
-
for (const [
|
|
7950
|
+
for (const [g, p] of i.entries()) {
|
|
7951
7951
|
const f = typeof p == "string" ? p : p.browserValue, C = typeof p == "string" ? void 0 : p.pmsValue;
|
|
7952
|
-
o[
|
|
7952
|
+
o[g] = { browserValue: f, spotColor: (h = o[g]) == null ? void 0 : h.spotColor, pmsValue: C }, l[g] = { browserValue: f };
|
|
7953
7953
|
}
|
|
7954
|
-
let c = Array.from(Object.values(o)).map((
|
|
7954
|
+
let c = Array.from(Object.values(o)).map((g) => g.browserValue);
|
|
7955
7955
|
const d = t.data.colorOption;
|
|
7956
|
-
d && ((
|
|
7956
|
+
d && ((m = d.variants) == null || m.forEach((g) => {
|
|
7957
7957
|
c = c.map((p) => {
|
|
7958
7958
|
var f;
|
|
7959
|
-
return p.toLowerCase() === ((f =
|
|
7959
|
+
return p.toLowerCase() === ((f = g.color) == null ? void 0 : f.toLowerCase()) ? g.name : p;
|
|
7960
7960
|
});
|
|
7961
7961
|
})), a.updateMetadata(t.stepName, { colors: c });
|
|
7962
7962
|
const A = /* @__PURE__ */ new Map();
|
|
7963
|
-
if (Object.entries(o).forEach(([
|
|
7964
|
-
A.set(
|
|
7963
|
+
if (Object.entries(o).forEach(([g, p]) => {
|
|
7964
|
+
A.set(g, p);
|
|
7965
7965
|
}), !s.svg)
|
|
7966
7966
|
throw new Error("Colors changed before SVG loaded. This should never happen!");
|
|
7967
7967
|
const u = await this.changeColorsCommand(
|
|
7968
7968
|
s.svg,
|
|
7969
7969
|
s.width,
|
|
7970
7970
|
s.height,
|
|
7971
|
-
e.map((
|
|
7971
|
+
e.map((g) => g.id),
|
|
7972
7972
|
A
|
|
7973
7973
|
);
|
|
7974
7974
|
a.updateStorage(t.stepName, {
|
|
@@ -8006,16 +8006,16 @@ class ms {
|
|
|
8006
8006
|
svg: c
|
|
8007
8007
|
})
|
|
8008
8008
|
};
|
|
8009
|
-
}, u = t.data.regions.map(A),
|
|
8010
|
-
let
|
|
8009
|
+
}, u = t.data.regions.map(A), m = [...u.map((C) => C.command), ...s];
|
|
8010
|
+
let g = Array.from(Object.values(c.colors)).map((C) => C.browserValue);
|
|
8011
8011
|
const p = t.data.colorOption;
|
|
8012
8012
|
return p && ((f = p.variants) == null || f.forEach((C) => {
|
|
8013
|
-
|
|
8013
|
+
g = g.map((w) => {
|
|
8014
8014
|
var S;
|
|
8015
8015
|
return w.toLowerCase() === ((S = C.color) == null ? void 0 : S.toLowerCase()) ? C.name : w;
|
|
8016
8016
|
});
|
|
8017
|
-
})), i.updateMetadata(t.stepName, { colors:
|
|
8018
|
-
command: new $(
|
|
8017
|
+
})), i.updateMetadata(t.stepName, { colors: g }), {
|
|
8018
|
+
command: new $(m),
|
|
8019
8019
|
followup: async () => {
|
|
8020
8020
|
var w, S;
|
|
8021
8021
|
await i.setSelectionsAndElements(
|
|
@@ -8065,7 +8065,7 @@ class ms {
|
|
|
8065
8065
|
};
|
|
8066
8066
|
}
|
|
8067
8067
|
}
|
|
8068
|
-
const
|
|
8068
|
+
const ge = new gs();
|
|
8069
8069
|
class ps {
|
|
8070
8070
|
async init(t, e, a) {
|
|
8071
8071
|
const n = t.option;
|
|
@@ -8094,20 +8094,20 @@ class ps {
|
|
|
8094
8094
|
if (d) {
|
|
8095
8095
|
const A = (c = l.variants) == null ? void 0 : c.find((u) => u.id === d);
|
|
8096
8096
|
if (A) {
|
|
8097
|
-
const u = A.material, h = o.map((
|
|
8097
|
+
const u = A.material, h = o.map((m) => ({ id: m.id, region: m.stepRegion }));
|
|
8098
8098
|
await e.setSelectionsAndElements(
|
|
8099
8099
|
t.stepName,
|
|
8100
8100
|
[A],
|
|
8101
8101
|
h,
|
|
8102
8102
|
async () => {
|
|
8103
|
-
const
|
|
8104
|
-
if (
|
|
8105
|
-
const
|
|
8103
|
+
const m = e.getModelContainer();
|
|
8104
|
+
if (m) {
|
|
8105
|
+
const g = t.data.targetMaterials.map((p) => m.applyMaterialVariant(
|
|
8106
8106
|
p,
|
|
8107
8107
|
l.id || "",
|
|
8108
8108
|
u || {}
|
|
8109
8109
|
));
|
|
8110
|
-
Promise.all(
|
|
8110
|
+
Promise.all(g).then(
|
|
8111
8111
|
() => e.setMandatoryFulfilled(t.stepName, !0)
|
|
8112
8112
|
);
|
|
8113
8113
|
}
|
|
@@ -8176,16 +8176,16 @@ class fs {
|
|
|
8176
8176
|
[A],
|
|
8177
8177
|
u,
|
|
8178
8178
|
async () => {
|
|
8179
|
-
var
|
|
8179
|
+
var m;
|
|
8180
8180
|
const h = e.getModelContainer();
|
|
8181
8181
|
if (h && t.option) {
|
|
8182
|
-
const
|
|
8183
|
-
if (!
|
|
8182
|
+
const g = (m = A.asset) == null ? void 0 : m.fileLink;
|
|
8183
|
+
if (!g)
|
|
8184
8184
|
throw new vt(A);
|
|
8185
8185
|
await h.applyModelVariant(
|
|
8186
8186
|
t.stepName || "",
|
|
8187
8187
|
{
|
|
8188
|
-
model:
|
|
8188
|
+
model: g,
|
|
8189
8189
|
contextService: e.getLayoutPreviewService()
|
|
8190
8190
|
},
|
|
8191
8191
|
t.data.replaceProductModel || !1
|
|
@@ -8265,17 +8265,17 @@ class Cs {
|
|
|
8265
8265
|
return console.error("Missing configuration."), null;
|
|
8266
8266
|
a.updateStorage(t.stepName, { text: e }), a.updateMetadata(t.stepName, { text: e });
|
|
8267
8267
|
const c = (A, u, h) => {
|
|
8268
|
-
const
|
|
8268
|
+
const m = h || Q(), p = a.getLayouts().find((C) => C.panelId === u.panelId);
|
|
8269
8269
|
if (!p)
|
|
8270
8270
|
return console.error(`Can not find layout for region: ${u.panelId}`), null;
|
|
8271
8271
|
const f = [];
|
|
8272
|
-
return h && f.push(new Bt(
|
|
8272
|
+
return h && f.push(new Bt(m)), f.push(
|
|
8273
8273
|
new W(
|
|
8274
8274
|
{
|
|
8275
8275
|
stepRegion: u,
|
|
8276
8276
|
stepName: t.stepName,
|
|
8277
8277
|
colors: {},
|
|
8278
|
-
id:
|
|
8278
|
+
id: m,
|
|
8279
8279
|
svg: A,
|
|
8280
8280
|
type: M.Illustration,
|
|
8281
8281
|
y: u.top,
|
|
@@ -8290,7 +8290,7 @@ class Cs {
|
|
|
8290
8290
|
p
|
|
8291
8291
|
)
|
|
8292
8292
|
), {
|
|
8293
|
-
id:
|
|
8293
|
+
id: m,
|
|
8294
8294
|
region: u,
|
|
8295
8295
|
command: new $(f)
|
|
8296
8296
|
};
|
|
@@ -8299,8 +8299,8 @@ class Cs {
|
|
|
8299
8299
|
const u = i.map((h) => {
|
|
8300
8300
|
if (!h.region)
|
|
8301
8301
|
return null;
|
|
8302
|
-
const
|
|
8303
|
-
return c(
|
|
8302
|
+
const m = s.svgPrint(e, h.region);
|
|
8303
|
+
return c(m, h.region, h.id);
|
|
8304
8304
|
}).filter((h) => !!h).filter((h) => !!h).map((h) => h && h.command);
|
|
8305
8305
|
return {
|
|
8306
8306
|
command: new $(u),
|
|
@@ -8314,7 +8314,7 @@ class Cs {
|
|
|
8314
8314
|
return {
|
|
8315
8315
|
command: new $(u),
|
|
8316
8316
|
followup: async () => {
|
|
8317
|
-
const h = A.filter((
|
|
8317
|
+
const h = A.filter((m) => m).map((m) => m && { id: m.id, region: m.region });
|
|
8318
8318
|
await a.setSelectionsAndElements(
|
|
8319
8319
|
t.stepName,
|
|
8320
8320
|
[],
|
|
@@ -8392,17 +8392,17 @@ class ws {
|
|
|
8392
8392
|
return console.error("No URL for picture!"), null;
|
|
8393
8393
|
n(!0), t.mandatory && a.setMandatoryFulfilled(t.stepName, !1);
|
|
8394
8394
|
const l = a.getRegionElements(t.stepName).map((A) => new Bt(A.id)), c = (A) => {
|
|
8395
|
-
const h = a.getLayouts().find((
|
|
8395
|
+
const h = a.getLayouts().find((g) => g.panelId === A.panelId);
|
|
8396
8396
|
if (!h)
|
|
8397
8397
|
throw new J(A);
|
|
8398
|
-
const
|
|
8398
|
+
const m = Q();
|
|
8399
8399
|
return {
|
|
8400
|
-
regionElement: { id:
|
|
8400
|
+
regionElement: { id: m, region: A },
|
|
8401
8401
|
command: new W(
|
|
8402
8402
|
{
|
|
8403
8403
|
stepName: t.stepName,
|
|
8404
8404
|
stepRegion: A,
|
|
8405
|
-
id:
|
|
8405
|
+
id: m,
|
|
8406
8406
|
src: s,
|
|
8407
8407
|
type: M.Image,
|
|
8408
8408
|
y: A.top,
|
|
@@ -8585,10 +8585,10 @@ class Ss {
|
|
|
8585
8585
|
if (a.length > 0) {
|
|
8586
8586
|
const c = (A) => {
|
|
8587
8587
|
const u = A.region;
|
|
8588
|
-
if (!i.find((
|
|
8588
|
+
if (!i.find((g) => g.panelId === (u == null ? void 0 : u.panelId)))
|
|
8589
8589
|
throw new J(u);
|
|
8590
|
-
const
|
|
8591
|
-
return new oa(A.id, this.shapeFillId,
|
|
8590
|
+
const m = o();
|
|
8591
|
+
return new oa(A.id, this.shapeFillId, m);
|
|
8592
8592
|
}, d = a.map(c).filter((A) => !!A);
|
|
8593
8593
|
return {
|
|
8594
8594
|
command: new $(d),
|
|
@@ -8602,10 +8602,10 @@ class Ss {
|
|
|
8602
8602
|
};
|
|
8603
8603
|
} else {
|
|
8604
8604
|
const c = (h) => {
|
|
8605
|
-
const
|
|
8606
|
-
if (!
|
|
8605
|
+
const m = i.find((w) => w.panelId === h.panelId);
|
|
8606
|
+
if (!m)
|
|
8607
8607
|
throw new J(h);
|
|
8608
|
-
const
|
|
8608
|
+
const g = o(), p = `
|
|
8609
8609
|
<svg
|
|
8610
8610
|
xmlns="http://www.w3.org/2000/svg"
|
|
8611
8611
|
xmlnsXlink="http://www.w3.org/1999/xlink"
|
|
@@ -8622,11 +8622,11 @@ class Ss {
|
|
|
8622
8622
|
width="1"
|
|
8623
8623
|
height="1"
|
|
8624
8624
|
class="${this.shapeFillId}"
|
|
8625
|
-
fill="${
|
|
8625
|
+
fill="${g}"
|
|
8626
8626
|
/>
|
|
8627
8627
|
</svg>
|
|
8628
8628
|
`, f = {};
|
|
8629
|
-
f[this.shapeFillId] = { browserValue:
|
|
8629
|
+
f[this.shapeFillId] = { browserValue: g };
|
|
8630
8630
|
const C = Q();
|
|
8631
8631
|
return {
|
|
8632
8632
|
id: C,
|
|
@@ -8649,7 +8649,7 @@ class Ss {
|
|
|
8649
8649
|
immutable: h.immutable,
|
|
8650
8650
|
excludeFromExport: t.data.excludeFromPrint
|
|
8651
8651
|
},
|
|
8652
|
-
|
|
8652
|
+
m
|
|
8653
8653
|
)
|
|
8654
8654
|
};
|
|
8655
8655
|
}, d = t.data.regions.map(c), A = d.filter((h) => !!h).map((h) => h == null ? void 0 : h.command), u = d.filter((h) => !!h).map((h) => ({ id: h.id, region: h.region }));
|
|
@@ -8709,17 +8709,17 @@ const Es = new vs(), qe = (r, t, e, a, n) => {
|
|
|
8709
8709
|
if (A <= r.width)
|
|
8710
8710
|
return [i, A];
|
|
8711
8711
|
const u = o.reduce((p, f, C, w) => f > w[p] ? C : p, 0), h = i[u];
|
|
8712
|
-
let
|
|
8713
|
-
for (; !
|
|
8714
|
-
|
|
8715
|
-
const p = [h.slice(0,
|
|
8712
|
+
let m = !1, g = h.length;
|
|
8713
|
+
for (; !m && g > -1; ) {
|
|
8714
|
+
g = h.lastIndexOf(" ", g - 1);
|
|
8715
|
+
const p = [h.slice(0, g), h.slice(g + 1)], f = p.map((w) => ht(w, a, n));
|
|
8716
8716
|
f[0] <= r.width && (i = [...i.slice(0, u), ...p, ...i.slice(u + 1)], o = [
|
|
8717
8717
|
...o.slice(0, u),
|
|
8718
8718
|
...f,
|
|
8719
8719
|
...o.slice(u + 1)
|
|
8720
|
-
], s += 1,
|
|
8720
|
+
], s += 1, m = !0);
|
|
8721
8721
|
}
|
|
8722
|
-
|
|
8722
|
+
m || (c = !1);
|
|
8723
8723
|
}
|
|
8724
8724
|
return [null, null];
|
|
8725
8725
|
}, pe = (r, t, e, a, n) => {
|
|
@@ -8786,24 +8786,24 @@ class bs {
|
|
|
8786
8786
|
}
|
|
8787
8787
|
async init(t, e, a) {
|
|
8788
8788
|
var i, s, o, l;
|
|
8789
|
-
console.log(
|
|
8789
|
+
console.log(`LOG: t (${t.stepName}) init`);
|
|
8790
8790
|
const n = t.option;
|
|
8791
8791
|
if (!n)
|
|
8792
|
-
return console.log(
|
|
8792
|
+
return console.log(`LOG: t (${t.stepName}) no option`), null;
|
|
8793
8793
|
if (a)
|
|
8794
|
-
console.log(
|
|
8794
|
+
console.log(`LOG: t (${t.stepName}) reload`), await this.reload(t, e, a);
|
|
8795
8795
|
else {
|
|
8796
|
-
console.log(
|
|
8796
|
+
console.log(`LOG: t (${t.stepName}) no reload`);
|
|
8797
8797
|
const c = this.getDefaultImageFillVariant(t.data), d = (i = c == null ? void 0 : c.asset) == null ? void 0 : i.fileLink, A = d ? await sa(d) : void 0, u = A ? {
|
|
8798
8798
|
src: A.src,
|
|
8799
8799
|
height: A.height,
|
|
8800
8800
|
width: A.width,
|
|
8801
8801
|
scale: t.data.imageFillScale || 1
|
|
8802
|
-
} : void 0, h = this.getDefaultStrokeColorVariant(t.data),
|
|
8802
|
+
} : void 0, h = this.getDefaultStrokeColorVariant(t.data), m = t.data.strokeEnabled && (h != null && h.color) ? {
|
|
8803
8803
|
browserValue: h.color,
|
|
8804
8804
|
pmsValue: h.name
|
|
8805
8805
|
} : void 0;
|
|
8806
|
-
let
|
|
8806
|
+
let g = t.data.defaultText || "";
|
|
8807
8807
|
const p = e.getWorkflowExperience().getBundle();
|
|
8808
8808
|
if (p && t.globalPropertyAspectConfigurations) {
|
|
8809
8809
|
const C = (s = p.getGlobalPropertyConfiguration()) == null ? void 0 : s.aspects, w = C == null ? void 0 : C.find((S) => {
|
|
@@ -8812,27 +8812,27 @@ class bs {
|
|
|
8812
8812
|
});
|
|
8813
8813
|
if (w) {
|
|
8814
8814
|
const y = p.getGlobalPropertyStateManager().getAspect(w.name);
|
|
8815
|
-
y && (
|
|
8815
|
+
y && (g = y);
|
|
8816
8816
|
}
|
|
8817
8817
|
}
|
|
8818
8818
|
e.updateStorage(t.stepName, {
|
|
8819
|
-
text:
|
|
8819
|
+
text: g,
|
|
8820
8820
|
inputText: t.data.defaultText || "",
|
|
8821
8821
|
color: ((o = this.getDefaultColorVariant(t.data)) == null ? void 0 : o.color) || this.getDefaultColor(t.data),
|
|
8822
8822
|
fillImage: u,
|
|
8823
|
-
strokeColor:
|
|
8823
|
+
strokeColor: m
|
|
8824
8824
|
}), e.updateMetadata(t.stepName, {
|
|
8825
|
-
text:
|
|
8825
|
+
text: g,
|
|
8826
8826
|
color: ((l = this.getDefaultColorVariant(t.data)) == null ? void 0 : l.name) || this.getDefaultColor(t.data),
|
|
8827
8827
|
fillImage: c == null ? void 0 : c.name,
|
|
8828
8828
|
strokeColor: t.data.strokeEnabled ? h == null ? void 0 : h.color : void 0
|
|
8829
8829
|
});
|
|
8830
8830
|
const f = Y.getDefaultVariant(n);
|
|
8831
8831
|
if (f)
|
|
8832
|
-
return console.log(
|
|
8832
|
+
return console.log(`LOG: t (${t.stepName}) variant`), this.selectVariantCommand(
|
|
8833
8833
|
t,
|
|
8834
8834
|
f,
|
|
8835
|
-
{ text:
|
|
8835
|
+
{ text: g },
|
|
8836
8836
|
[],
|
|
8837
8837
|
e,
|
|
8838
8838
|
() => {
|
|
@@ -8840,10 +8840,10 @@ class bs {
|
|
|
8840
8840
|
() => {
|
|
8841
8841
|
},
|
|
8842
8842
|
u,
|
|
8843
|
-
|
|
8843
|
+
m
|
|
8844
8844
|
);
|
|
8845
8845
|
}
|
|
8846
|
-
return console.log(
|
|
8846
|
+
return console.log(`LOG: t (${t.stepName}) end`), null;
|
|
8847
8847
|
}
|
|
8848
8848
|
findLayoutElements(t, e) {
|
|
8849
8849
|
return t.getRegionElements(e.stepName).map((i) => U(i.id, t.getAllLayoutData()));
|
|
@@ -9003,9 +9003,9 @@ class bs {
|
|
|
9003
9003
|
{ size: a.data.size, minSize: a.data.minSize, maxSize: a.data.maxSize }
|
|
9004
9004
|
);
|
|
9005
9005
|
c.set(A.id, u), d.set(A.id, h);
|
|
9006
|
-
const
|
|
9006
|
+
const m = a.data.curved ? s : (h || []).join(`
|
|
9007
9007
|
`);
|
|
9008
|
-
l.push(this.generateTextChangeCommandsForRegion(u, a.data, A.id,
|
|
9008
|
+
l.push(this.generateTextChangeCommandsForRegion(u, a.data, A.id, m));
|
|
9009
9009
|
}
|
|
9010
9010
|
return !a.data.curved && e.length > 0 && !Array.from(d.values()).every((u) => u) ? (o.errorData || (o.errorData = {}), o.errorData.doesNotFit = !0, o) : (n.updateStorage(a.stepName, { text: t }), n.updateMetadata(a.stepName, {
|
|
9011
9011
|
text: s
|
|
@@ -9040,15 +9040,15 @@ class bs {
|
|
|
9040
9040
|
const n = e.getSerializedStep(
|
|
9041
9041
|
t.stepName,
|
|
9042
9042
|
a.serializableWorkflow.steps
|
|
9043
|
-
), o = Object.values(a.layouts).map((
|
|
9043
|
+
), o = Object.values(a.layouts).map((m) => m.elements).flat().filter((m) => m.stepName === t.stepName), l = t.option;
|
|
9044
9044
|
if (n != null && n.selectedVariants) {
|
|
9045
|
-
console.log(
|
|
9046
|
-
const
|
|
9047
|
-
if (l &&
|
|
9048
|
-
const
|
|
9049
|
-
if (
|
|
9050
|
-
console.log(
|
|
9051
|
-
const p = await this.fontDataFromVariant(
|
|
9045
|
+
console.log(`LOG: text (${t.stepName}) reload selections`);
|
|
9046
|
+
const m = n.selectedVariants[0].id;
|
|
9047
|
+
if (l && m) {
|
|
9048
|
+
const g = (c = l.variants) == null ? void 0 : c.find((p) => p.id === m);
|
|
9049
|
+
if (g) {
|
|
9050
|
+
console.log(`LOG: text (${t.stepName}) reload selections variant`);
|
|
9051
|
+
const p = await this.fontDataFromVariant(g), f = o.map((y) => ({ id: y.id, region: y.stepRegion })), C = (d = n.storage) == null ? void 0 : d.color;
|
|
9052
9052
|
let w = (A = n.storage) == null ? void 0 : A.text;
|
|
9053
9053
|
const S = e.getWorkflowExperience().getBundle();
|
|
9054
9054
|
if (S && t.globalPropertyAspectConfigurations) {
|
|
@@ -9063,7 +9063,7 @@ class bs {
|
|
|
9063
9063
|
}
|
|
9064
9064
|
if (await e.setSelectionsAndElements(
|
|
9065
9065
|
t.stepName,
|
|
9066
|
-
[
|
|
9066
|
+
[g],
|
|
9067
9067
|
f,
|
|
9068
9068
|
async () => {
|
|
9069
9069
|
e.updateMetadata(t.stepName, { color: C, text: w }), e.updateStorage(t.stepName, { text: w, inputText: w });
|
|
@@ -9071,10 +9071,10 @@ class bs {
|
|
|
9071
9071
|
e.getCommandDispatcher()(E);
|
|
9072
9072
|
}
|
|
9073
9073
|
), o.length === 0 && l) {
|
|
9074
|
-
console.log(
|
|
9074
|
+
console.log(`LOG: text (${t.stepName}) reload cond`);
|
|
9075
9075
|
const y = Y.getDefaultVariant(l);
|
|
9076
9076
|
if (y) {
|
|
9077
|
-
console.log(
|
|
9077
|
+
console.log(`LOG: text (${t.stepName}) reload cond default`);
|
|
9078
9078
|
const E = await this.selectVariantCommand(
|
|
9079
9079
|
t,
|
|
9080
9080
|
y,
|
|
@@ -9089,7 +9089,7 @@ class bs {
|
|
|
9089
9089
|
e.getCommandDispatcher()(E.command);
|
|
9090
9090
|
}
|
|
9091
9091
|
} else {
|
|
9092
|
-
console.log(
|
|
9092
|
+
console.log(`LOG: text (${t.stepName}) reload noncond`);
|
|
9093
9093
|
const { command: y } = j.updateInputText(
|
|
9094
9094
|
w || "",
|
|
9095
9095
|
o,
|
|
@@ -9101,19 +9101,18 @@ class bs {
|
|
|
9101
9101
|
}
|
|
9102
9102
|
}
|
|
9103
9103
|
} else {
|
|
9104
|
-
console.log(
|
|
9105
|
-
const
|
|
9106
|
-
if (
|
|
9107
|
-
const
|
|
9104
|
+
console.log(`LOG: text (${t.stepName}) reload else`);
|
|
9105
|
+
const m = e.getWorkflowExperience().getBundle();
|
|
9106
|
+
if (m && t.globalPropertyAspectConfigurations) {
|
|
9107
|
+
const g = (h = m.getGlobalPropertyConfiguration()) == null ? void 0 : h.aspects, p = g == null ? void 0 : g.find((f) => {
|
|
9108
9108
|
var C;
|
|
9109
9109
|
return f.type === G.Text && ((C = t.globalPropertyAspectConfigurations) == null ? void 0 : C.map((w) => w.aspectName).includes(f.name));
|
|
9110
9110
|
});
|
|
9111
9111
|
if (p) {
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
if (C)
|
|
9112
|
+
const C = m.getGlobalPropertyStateManager().getAspect(p.name);
|
|
9113
|
+
if (console.log(`LOG: text (${t.stepName}) reload else aspect, aspect text ${C}`), C)
|
|
9115
9114
|
if (o.length === 0 && l) {
|
|
9116
|
-
console.log(
|
|
9115
|
+
console.log(`LOG: text (${t.stepName}) reload else aspect text a`);
|
|
9117
9116
|
const w = Y.getDefaultVariant(l);
|
|
9118
9117
|
if (w) {
|
|
9119
9118
|
const S = await this.selectVariantCommand(
|
|
@@ -9130,7 +9129,7 @@ class bs {
|
|
|
9130
9129
|
e.getCommandDispatcher()(S.command);
|
|
9131
9130
|
}
|
|
9132
9131
|
} else {
|
|
9133
|
-
console.log(
|
|
9132
|
+
console.log(`LOG: text (${t.stepName}) reload else aspect text b`);
|
|
9134
9133
|
const { command: w } = j.updateInputText(
|
|
9135
9134
|
C,
|
|
9136
9135
|
o,
|
|
@@ -9193,7 +9192,7 @@ class bs {
|
|
|
9193
9192
|
);
|
|
9194
9193
|
h.push(...p);
|
|
9195
9194
|
}
|
|
9196
|
-
const
|
|
9195
|
+
const m = await this.changeInputTextWithRegion(
|
|
9197
9196
|
t,
|
|
9198
9197
|
t.data.size || He,
|
|
9199
9198
|
A,
|
|
@@ -9204,7 +9203,7 @@ class bs {
|
|
|
9204
9203
|
s,
|
|
9205
9204
|
o
|
|
9206
9205
|
);
|
|
9207
|
-
return
|
|
9206
|
+
return m && h.push(m), {
|
|
9208
9207
|
command: new $(h),
|
|
9209
9208
|
followup: async () => {
|
|
9210
9209
|
i.markUpdateCompleted(d), await i.setSelectionsAndElements(t.stepName, [e], n);
|
|
@@ -9218,7 +9217,7 @@ class bs {
|
|
|
9218
9217
|
A,
|
|
9219
9218
|
a,
|
|
9220
9219
|
i
|
|
9221
|
-
),
|
|
9220
|
+
), m = await this.changeInputTextWithRegion(
|
|
9222
9221
|
t,
|
|
9223
9222
|
t.data.size || He,
|
|
9224
9223
|
A,
|
|
@@ -9228,21 +9227,21 @@ class bs {
|
|
|
9228
9227
|
(a == null ? void 0 : a.customiseAllText) ?? !1,
|
|
9229
9228
|
s,
|
|
9230
9229
|
o
|
|
9231
|
-
),
|
|
9230
|
+
), g = h.flatMap((f) => f.commands);
|
|
9232
9231
|
if (l) {
|
|
9233
9232
|
const f = h.map(
|
|
9234
9233
|
(C) => new We(C.regionElement.id, l)
|
|
9235
9234
|
);
|
|
9236
|
-
|
|
9235
|
+
g.push(...f);
|
|
9237
9236
|
}
|
|
9238
9237
|
if (c) {
|
|
9239
9238
|
const f = n.map(
|
|
9240
9239
|
(C) => new je(C.id, c, t.data.strokeThickness)
|
|
9241
9240
|
);
|
|
9242
|
-
|
|
9241
|
+
g.push(...f);
|
|
9243
9242
|
}
|
|
9244
|
-
return
|
|
9245
|
-
command: new $(
|
|
9243
|
+
return m && g.push(m), {
|
|
9244
|
+
command: new $(g),
|
|
9246
9245
|
followup: async () => {
|
|
9247
9246
|
i.markUpdateCompleted(d);
|
|
9248
9247
|
}
|
|
@@ -9261,8 +9260,8 @@ class bs {
|
|
|
9261
9260
|
if (!a || !a.regions)
|
|
9262
9261
|
throw new Error("Step data not supplied");
|
|
9263
9262
|
const o = i.text || a.defaultText || "", l = this.getProcessedInput(o, a, !1), c = async (A) => {
|
|
9264
|
-
var
|
|
9265
|
-
const h = s.getLayouts().find((p) => p.panelId === A.panelId),
|
|
9263
|
+
var g;
|
|
9264
|
+
const h = s.getLayouts().find((p) => p.panelId === A.panelId), m = Q();
|
|
9266
9265
|
try {
|
|
9267
9266
|
if (!h)
|
|
9268
9267
|
throw new Pe("Failed to find layout for region: " + A.panelId);
|
|
@@ -9274,7 +9273,7 @@ class bs {
|
|
|
9274
9273
|
return nt.id === ((R = p.defaultVariant) == null ? void 0 : R.id);
|
|
9275
9274
|
}) || p.variants[0];
|
|
9276
9275
|
f = this.createTextFillSpotColor(p, T), s.updateStorage(t, {
|
|
9277
|
-
colorProfileAssetKey: (
|
|
9276
|
+
colorProfileAssetKey: (g = p.colorProfile) == null ? void 0 : g.key
|
|
9278
9277
|
});
|
|
9279
9278
|
}
|
|
9280
9279
|
const C = await this.getDefaultColor(a), w = C || "#000000", S = {
|
|
@@ -9284,7 +9283,7 @@ class bs {
|
|
|
9284
9283
|
fill: i.color ? i.color : w,
|
|
9285
9284
|
fontSize: a.size || He,
|
|
9286
9285
|
fontData: n,
|
|
9287
|
-
id:
|
|
9286
|
+
id: m,
|
|
9288
9287
|
layer: A.layer,
|
|
9289
9288
|
layerIndex: A.layerIndex,
|
|
9290
9289
|
rotation: A.rotation,
|
|
@@ -9326,7 +9325,7 @@ class bs {
|
|
|
9326
9325
|
);
|
|
9327
9326
|
const k = new W(S, h);
|
|
9328
9327
|
return {
|
|
9329
|
-
regionElement: { id:
|
|
9328
|
+
regionElement: { id: m, region: A },
|
|
9330
9329
|
commands: [k, ...y],
|
|
9331
9330
|
newElement: S,
|
|
9332
9331
|
fontData: n
|
|
@@ -9337,7 +9336,7 @@ class bs {
|
|
|
9337
9336
|
}, d = await Promise.all(a.regions.map(c)).catch((A) => {
|
|
9338
9337
|
throw A instanceof Ie ? (Es.setLatestToast("Failed to load font.", Re.Error), A) : A instanceof Pe ? A : new Error(A);
|
|
9339
9338
|
});
|
|
9340
|
-
return await s.setSelectionsAndElements(
|
|
9339
|
+
return console.log(`LOG: step (${t}) created ${d.length} new text elements for ${a.regions.length} regions`), await s.setSelectionsAndElements(
|
|
9341
9340
|
t,
|
|
9342
9341
|
[e],
|
|
9343
9342
|
d.map((A) => A.regionElement),
|
|
@@ -9362,7 +9361,7 @@ class bs {
|
|
|
9362
9361
|
* @deprecated
|
|
9363
9362
|
*/
|
|
9364
9363
|
async changeInputTextWithRegion(t, e, a, n, i, s, o, l, c, d) {
|
|
9365
|
-
const A = (n || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = this.getProcessedInput(A, t.data, o), h = s.getRegionElements(t.stepName),
|
|
9364
|
+
const A = (n || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = this.getProcessedInput(A, t.data, o), h = s.getRegionElements(t.stepName), m = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
|
|
9366
9365
|
for (const S of h)
|
|
9367
9366
|
if (S.region) {
|
|
9368
9367
|
const [y, E] = pe(
|
|
@@ -9372,7 +9371,7 @@ class bs {
|
|
|
9372
9371
|
[u],
|
|
9373
9372
|
{ size: t.data.size, minSize: t.data.minSize, maxSize: t.data.maxSize }
|
|
9374
9373
|
);
|
|
9375
|
-
|
|
9374
|
+
m.set(S.id, y), g.set(S.id, E);
|
|
9376
9375
|
}
|
|
9377
9376
|
const f = (() => {
|
|
9378
9377
|
if (t.data && t.data.maxLength && u.length > t.data.maxLength)
|
|
@@ -9385,7 +9384,7 @@ class bs {
|
|
|
9385
9384
|
return l(!0), { error: "Blocked profanity." };
|
|
9386
9385
|
}
|
|
9387
9386
|
return !t.data.vertical && !t.data.allowNewlines && (u.includes(`
|
|
9388
|
-
`) || u.includes("\r")) ? (l(!0), { error: "Cannot span multiple lines." }) : !t.data.curved && !Array.from(
|
|
9387
|
+
`) || u.includes("\r")) ? (l(!0), { error: "Cannot span multiple lines." }) : !t.data.curved && !Array.from(g.values()).every((B) => B) ? (l(!0), { error: "Does not fit." }) : (l(!1), { info: (t.data.maxLength - u.length).toString() });
|
|
9389
9388
|
})();
|
|
9390
9389
|
if (f.error) {
|
|
9391
9390
|
c(f.error);
|
|
@@ -9398,11 +9397,11 @@ class bs {
|
|
|
9398
9397
|
}), (i.defaultCleared || !t.data.deleteDefaultOnFocus) && A.trim() !== "" && s.setMandatoryFulfilled(t.stepName, !0);
|
|
9399
9398
|
const C = [];
|
|
9400
9399
|
for (const S of h) {
|
|
9401
|
-
const y = t.data.curved ? u : (
|
|
9400
|
+
const y = t.data.curved ? u : (g.get(S.id) || []).join(`
|
|
9402
9401
|
`);
|
|
9403
9402
|
C.push(
|
|
9404
9403
|
this.generateTextChangeCommandsForRegion(
|
|
9405
|
-
|
|
9404
|
+
m.get(S.id) || 1,
|
|
9406
9405
|
t.data,
|
|
9407
9406
|
S.id,
|
|
9408
9407
|
y
|
|
@@ -9587,15 +9586,15 @@ class Ns extends Is {
|
|
|
9587
9586
|
u.classList.add("module-root");
|
|
9588
9587
|
const h = et("defs");
|
|
9589
9588
|
u.appendChild(h);
|
|
9590
|
-
const
|
|
9591
|
-
|
|
9592
|
-
const
|
|
9593
|
-
|
|
9589
|
+
const m = et("g");
|
|
9590
|
+
m.classList.add("module-bounds"), u.appendChild(m);
|
|
9591
|
+
const g = Ds(e.height, e.width);
|
|
9592
|
+
g.setAttribute("opacity", "0"), m.appendChild(g);
|
|
9594
9593
|
const p = et("g");
|
|
9595
9594
|
p.classList.add("module-text-enclosure"), u.appendChild(p);
|
|
9596
9595
|
const f = A();
|
|
9597
9596
|
p.appendChild(f);
|
|
9598
|
-
const C =
|
|
9597
|
+
const C = mr(d);
|
|
9599
9598
|
return ks(p, C, e.height, e.width, 0.35, 0.65), Fs(u.outerHTML);
|
|
9600
9599
|
}
|
|
9601
9600
|
}
|
|
@@ -10289,18 +10288,18 @@ class Ya extends Dn {
|
|
|
10289
10288
|
});
|
|
10290
10289
|
}
|
|
10291
10290
|
}
|
|
10292
|
-
class
|
|
10293
|
-
constructor(t, e, a, n, i, s, o, l, c, d, A, u, h,
|
|
10291
|
+
class mo {
|
|
10292
|
+
constructor(t, e, a, n, i, s, o, l, c, d, A, u, h, m = !1, g, p = !1, f = !1, C = !1) {
|
|
10294
10293
|
var w;
|
|
10295
10294
|
this.workflowStatePromiseQueue = new xn(1), this.initialized = !1, this.readOnly = !1, this.isReloadedTransaction = !1, this.singleVariantsRenderable = !1, this.stepTags = {}, this.renderLayouts = () => {
|
|
10296
10295
|
var E;
|
|
10297
10296
|
if (!this.previewService)
|
|
10298
10297
|
return;
|
|
10299
10298
|
const S = this.getCommandContext().getAllLayouts(), y = (E = this.getLayoutPreviewService()) == null ? void 0 : E.getAll();
|
|
10300
|
-
if (
|
|
10299
|
+
if (y)
|
|
10301
10300
|
for (const [, B] of y)
|
|
10302
10301
|
B.render(S);
|
|
10303
|
-
}, this.experience = t, this.client = e, this.updateTransaction = o, this.graphQlClient = l, this.commandContext = s, this.reloadedState = h, this.transaction = c, this.readOnly =
|
|
10302
|
+
}, this.experience = t, this.client = e, this.updateTransaction = o, this.graphQlClient = l, this.commandContext = s, this.reloadedState = h, this.transaction = c, this.readOnly = m, this.singleVariantsRenderable = f, this.confirmedDesign = !1, this.editedSteps = {}, this.informationResults = [], this.mandatorySteps = {}, this.pendingUpdates = [], this.selectionCost = 0, this.workflow = a, this.stepSpecificServices = {}, this.profanityFilter = n, this.pollers = [], this.allScenes = [], this.layouts = i, this.product = d, this.previewService = A, this.modelContainer = g, this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, this.validationErrors = { steps: /* @__PURE__ */ new Map() }, this.confirmCallbacks = [], this.editedCallbacks = [], this.elementsCallbacks = [], this.informationResultCallbacks = [], this.initCallbacks = [], this.mandatoryCallbacks = [], this.makingAdjustmentsCallback = [], this.metadataCallbacks = [], this.selectionCallbacks = [], this.stepSpecificStorageCallbacks = {}, this.storageCallbacks = [], this.validationCallbacks = [], this.recipientCallbacks = [], this.currentAdjustingStepId = "", this.renderableContextService = u, (w = this.renderableContextService) == null || w.setWorkflowManager(this), this.isReloadedTransaction = p, this.workflow.steps.forEach((S) => {
|
|
10304
10303
|
this.stepTags[S.stepName] = S.tags ?? [];
|
|
10305
10304
|
}), C && (this.workflowStatePromiseQueue.enabled = !1), this.initializationPromise = this.initializeDefaultWorkflowState(a), this.initializationPromise.then(() => {
|
|
10306
10305
|
this.initialized = !0;
|
|
@@ -10316,7 +10315,7 @@ class go {
|
|
|
10316
10315
|
return { recipient: this.transaction.recipient };
|
|
10317
10316
|
}
|
|
10318
10317
|
async updateRecipient(t, e, a, n, i, s, o, l, c, d) {
|
|
10319
|
-
var A, u, h,
|
|
10318
|
+
var A, u, h, m, g;
|
|
10320
10319
|
if ((A = this.transaction.recipient) != null && A.id)
|
|
10321
10320
|
this.transaction.recipient = {
|
|
10322
10321
|
id: this.transaction.recipient.id,
|
|
@@ -10384,7 +10383,7 @@ class go {
|
|
|
10384
10383
|
fetchPolicy: "no-cache",
|
|
10385
10384
|
variables: {
|
|
10386
10385
|
id: this.transaction.id,
|
|
10387
|
-
recipientId: (
|
|
10386
|
+
recipientId: (g = (m = p.data) == null ? void 0 : m.recipientCreate) == null ? void 0 : g.id
|
|
10388
10387
|
},
|
|
10389
10388
|
context: {
|
|
10390
10389
|
transactionOwnerId: this.transaction.transactionOwnerId
|
|
@@ -10646,12 +10645,12 @@ class go {
|
|
|
10646
10645
|
console.error(`Failed to read material from variant: ${l.id} for step: ${s.stepName}`);
|
|
10647
10646
|
return;
|
|
10648
10647
|
}
|
|
10649
|
-
s.data.targetMaterials.forEach((
|
|
10648
|
+
s.data.targetMaterials.forEach((m) => {
|
|
10650
10649
|
if (!this.modelContainer)
|
|
10651
10650
|
throw new z(
|
|
10652
10651
|
"We should always have a model container when injecting a preview!"
|
|
10653
10652
|
);
|
|
10654
|
-
this.modelContainer.applyMaterialVariant(
|
|
10653
|
+
this.modelContainer.applyMaterialVariant(m, s.option.id, u);
|
|
10655
10654
|
});
|
|
10656
10655
|
}
|
|
10657
10656
|
}), await a.getInitializationPromise(), this.renderLayouts();
|
|
@@ -10860,6 +10859,9 @@ class go {
|
|
|
10860
10859
|
})
|
|
10861
10860
|
), this.stepElements = {}, this.stepInitialised = {}, this.stepMetadata = {}, this.stepSelections = {}, this.storage = {}, await this.ensureStepsAreLoaded();
|
|
10862
10861
|
}
|
|
10862
|
+
unsetInitialized() {
|
|
10863
|
+
this.stepInitialised = {};
|
|
10864
|
+
}
|
|
10863
10865
|
async setSelectionsAndElements(t, e, a, n) {
|
|
10864
10866
|
var y;
|
|
10865
10867
|
const i = this.stepSelections;
|
|
@@ -10875,18 +10877,18 @@ class go {
|
|
|
10875
10877
|
c.forEach((E) => {
|
|
10876
10878
|
yt(E, this.stepSelections) || (this.stepInitialised[E.stepName] = !1);
|
|
10877
10879
|
});
|
|
10878
|
-
const u = this.getInvalidCanvasRegions(), { stepElements: h, commands:
|
|
10880
|
+
const u = this.getInvalidCanvasRegions(), { stepElements: h, commands: m } = await this.stepElementsForIntroducedSilentSteps(A, !1);
|
|
10879
10881
|
this.stepElements = {
|
|
10880
10882
|
...this.stepElements,
|
|
10881
10883
|
...h,
|
|
10882
10884
|
[t]: a
|
|
10883
10885
|
}, this.removeElements(u);
|
|
10884
|
-
const
|
|
10885
|
-
if ((
|
|
10886
|
-
const E = (y = this.getWorkflowExperience().getStepById(
|
|
10886
|
+
const g = this.workflow.steps.find((E) => E.stepName === t);
|
|
10887
|
+
if ((g == null ? void 0 : g.type) === P.Frame) {
|
|
10888
|
+
const E = (y = this.getWorkflowExperience().getStepById(g.stepName)) == null ? void 0 : y.frameService;
|
|
10887
10889
|
E == null || E.setTargetElements(a.map((B) => B.id));
|
|
10888
10890
|
}
|
|
10889
|
-
const p = u.map((E) => new Bt(E.id)), f = new za(this.constructSerializableWorkflow()), C = [...
|
|
10891
|
+
const p = u.map((E) => new Bt(E.id)), f = new za(this.constructSerializableWorkflow()), C = [...m, ...p, f];
|
|
10890
10892
|
C.length > 0 && this.commandContext.apply(new $(C), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
|
|
10891
10893
|
const w = this.getInvalidModelVariants(), S = this.modelContainer;
|
|
10892
10894
|
if (S) {
|
|
@@ -10907,7 +10909,7 @@ class go {
|
|
|
10907
10909
|
const e = Dt(this.allScenes, this.stepSelections).map((l) => l.renderableSteps), a = [], n = e.flat();
|
|
10908
10910
|
console.log(`LOG: ensure ${n.length} steps loaded`);
|
|
10909
10911
|
for (const l of n)
|
|
10910
|
-
if (console.log(`LOG: is ${l.stepTitle} (${l.stepName}) inited? ${this.stepInitialised[l.stepName]}`), !this.stepInitialised[l.stepName])
|
|
10912
|
+
if (l.stepTitle === "Top Card Message" && console.log(`LOG: is ${l.stepTitle} (${l.stepName}) inited? ${this.stepInitialised[l.stepName]}`), !this.stepInitialised[l.stepName])
|
|
10911
10913
|
switch (this.stepInitialised[l.stepName] = !0, l.type) {
|
|
10912
10914
|
case P.DigitalContent:
|
|
10913
10915
|
a.push(
|
|
@@ -10923,7 +10925,7 @@ class go {
|
|
|
10923
10925
|
break;
|
|
10924
10926
|
case P.Illustration:
|
|
10925
10927
|
a.push(
|
|
10926
|
-
|
|
10928
|
+
ge.init(l, this, this.reloadedState)
|
|
10927
10929
|
);
|
|
10928
10930
|
break;
|
|
10929
10931
|
case P.Material:
|
|
@@ -11234,7 +11236,7 @@ const Yn = class la {
|
|
|
11234
11236
|
};
|
|
11235
11237
|
Yn.updateState = /* @__PURE__ */ new Map();
|
|
11236
11238
|
let it = Yn;
|
|
11237
|
-
class
|
|
11239
|
+
class go extends it {
|
|
11238
11240
|
constructor(t, e, a) {
|
|
11239
11241
|
super(t, e, a);
|
|
11240
11242
|
}
|
|
@@ -11245,7 +11247,7 @@ class mo extends it {
|
|
|
11245
11247
|
*/
|
|
11246
11248
|
async selectVariant(t) {
|
|
11247
11249
|
if (!this.getUpdateState() && this.getCurrentVariant() !== t)
|
|
11248
|
-
return
|
|
11250
|
+
return ge.selectVariant(
|
|
11249
11251
|
this.step,
|
|
11250
11252
|
t.getResource(),
|
|
11251
11253
|
this.manager.getRegionElements(this.step.stepName) || [],
|
|
@@ -11291,7 +11293,7 @@ class mo extends it {
|
|
|
11291
11293
|
const d = c.id.replace(/\W/g, "");
|
|
11292
11294
|
a ? n.set(d, { browserValue: e, pmsValue: a }) : n.set(d, e);
|
|
11293
11295
|
}
|
|
11294
|
-
}) : a ? n.set(t, { browserValue: e, pmsValue: a }) : n.set(t, e),
|
|
11296
|
+
}) : a ? n.set(t, { browserValue: e, pmsValue: a }) : n.set(t, e), ge.changeColors(
|
|
11295
11297
|
this.step,
|
|
11296
11298
|
this.manager.getRegionElements(this.step.stepName),
|
|
11297
11299
|
this.manager,
|
|
@@ -11303,7 +11305,7 @@ class mo extends it {
|
|
|
11303
11305
|
return this.step.data.colorOption;
|
|
11304
11306
|
}
|
|
11305
11307
|
getAvailableColors() {
|
|
11306
|
-
return this.step.data.colorPickerEnabled ?
|
|
11308
|
+
return this.step.data.colorPickerEnabled ? ge.availableColors(this.step, this.manager) : Promise.resolve([]);
|
|
11307
11309
|
}
|
|
11308
11310
|
isColorPickerEnabled() {
|
|
11309
11311
|
return this.step.data.colorPickerEnabled ?? !1;
|
|
@@ -11731,7 +11733,7 @@ class ce {
|
|
|
11731
11733
|
case P.Text:
|
|
11732
11734
|
return new So(t, e, t.getStepTags(e.stepName));
|
|
11733
11735
|
case P.Illustration:
|
|
11734
|
-
return new
|
|
11736
|
+
return new go(t, e, t.getStepTags(e.stepName));
|
|
11735
11737
|
case P.Picture:
|
|
11736
11738
|
return new Co(t, e, t.getStepTags(e.stepName));
|
|
11737
11739
|
case P.Shape:
|
|
@@ -11946,10 +11948,10 @@ const Po = async (r, t) => {
|
|
|
11946
11948
|
}
|
|
11947
11949
|
return n;
|
|
11948
11950
|
}, Kn = (r, t, e, a, n, i, s, o) => {
|
|
11949
|
-
var
|
|
11951
|
+
var m, g;
|
|
11950
11952
|
const l = t.basePrice || 0, c = r.priceModifierTotal || 0, d = xo(a, e, void 0, i), u = (N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(r.id), h = {
|
|
11951
|
-
additionalExternalProductId: (
|
|
11952
|
-
additionalExternalVariantId: (
|
|
11953
|
+
additionalExternalProductId: (m = r.integrationProduct) == null ? void 0 : m.additionalExternalProductId,
|
|
11954
|
+
additionalExternalVariantId: (g = r.integrationProduct) == null ? void 0 : g.additionalExternalVariantId,
|
|
11953
11955
|
baseCost: l,
|
|
11954
11956
|
designExternalVariants: r.designExternalVariants,
|
|
11955
11957
|
designProductId: r.externalDesignProductId,
|
|
@@ -11989,7 +11991,7 @@ const Po = async (r, t) => {
|
|
|
11989
11991
|
T.errors && console.log("Server Error:", tt.message);
|
|
11990
11992
|
}), null) : nt ?? null;
|
|
11991
11993
|
})() || (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(a())), await r.updateStateWithServerImmediate(a), console.log("Server state is undefined @ Workflow completion"));
|
|
11992
|
-
const u = r.getPreviewService(), h = (I = t == null ? void 0 : t.finalizeStepConfig) == null ? void 0 : I.lookAtAnimation,
|
|
11994
|
+
const u = r.getPreviewService(), h = (I = t == null ? void 0 : t.finalizeStepConfig) == null ? void 0 : I.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, g = l && ca(l, t, !0), p = l && ca(l, t, !1), f = async (D) => {
|
|
11993
11995
|
const x = {};
|
|
11994
11996
|
let k = 0;
|
|
11995
11997
|
if (Object.keys(i).length > 0)
|
|
@@ -12023,7 +12025,7 @@ const Po = async (r, t) => {
|
|
|
12023
12025
|
S[D].map((x) => x.id)
|
|
12024
12026
|
])
|
|
12025
12027
|
);
|
|
12026
|
-
let E = await o(
|
|
12028
|
+
let E = await o(m, n.id);
|
|
12027
12029
|
if (E) {
|
|
12028
12030
|
const D = await (await rt(E)).blob();
|
|
12029
12031
|
E = (await L.uploadAsset(
|
|
@@ -12043,7 +12045,7 @@ const Po = async (r, t) => {
|
|
|
12043
12045
|
})),
|
|
12044
12046
|
workflowId: t.id,
|
|
12045
12047
|
transactionId: n.id,
|
|
12046
|
-
useThreeDimPreview: !!
|
|
12048
|
+
useThreeDimPreview: !!m,
|
|
12047
12049
|
previewImage: E
|
|
12048
12050
|
};
|
|
12049
12051
|
if (p) {
|
|
@@ -12061,7 +12063,7 @@ const Po = async (r, t) => {
|
|
|
12061
12063
|
return D;
|
|
12062
12064
|
})(),
|
|
12063
12065
|
cartSelectionsWithPrices: C,
|
|
12064
|
-
cartMetadata:
|
|
12066
|
+
cartMetadata: g
|
|
12065
12067
|
};
|
|
12066
12068
|
}, Fo = async (r, t, e, a, n, i, s, o, l, c, d) => {
|
|
12067
12069
|
var f, C;
|
|
@@ -12078,20 +12080,20 @@ const Po = async (r, t) => {
|
|
|
12078
12080
|
d
|
|
12079
12081
|
);
|
|
12080
12082
|
l("workflow.steps.finish.finalize.creatingDesign");
|
|
12081
|
-
const
|
|
12082
|
-
if (!(
|
|
12083
|
+
const m = await Po(A), g = (f = m == null ? void 0 : m.transaction) == null ? void 0 : f.previewImageLink;
|
|
12084
|
+
if (!(m != null && m.transaction))
|
|
12083
12085
|
throw new Error("Failed to create design");
|
|
12084
12086
|
l("workflow.steps.finish.finalize.updatingTransaction");
|
|
12085
|
-
const p =
|
|
12087
|
+
const p = m.transaction;
|
|
12086
12088
|
return Kn(
|
|
12087
12089
|
p,
|
|
12088
12090
|
n,
|
|
12089
12091
|
t,
|
|
12090
12092
|
u,
|
|
12091
|
-
|
|
12093
|
+
m == null ? void 0 : m.sku,
|
|
12092
12094
|
h,
|
|
12093
|
-
|
|
12094
|
-
(C =
|
|
12095
|
+
g,
|
|
12096
|
+
(C = m == null ? void 0 : m.processExecution) == null ? void 0 : C.id
|
|
12095
12097
|
);
|
|
12096
12098
|
}, ko = async (r, t, e) => {
|
|
12097
12099
|
t("workflow.steps.finish.finalize.buildingLayouts"), await Promise.all(
|
|
@@ -12276,7 +12278,7 @@ class Oo {
|
|
|
12276
12278
|
throw new Error("No Workflow ID provided.");
|
|
12277
12279
|
this.client = t;
|
|
12278
12280
|
const a = e.layouts;
|
|
12279
|
-
this.commandContext = new rs(), this.commandContext.initialize(a, e.reloadedState), this.isReadOnly = e.transaction.isOrdered || !!e.readOnly, this.graphQlClient = e.graphQlClient, this.workflowManager = new
|
|
12281
|
+
this.commandContext = new rs(), this.commandContext.initialize(a, e.reloadedState), this.isReadOnly = e.transaction.isOrdered || !!e.readOnly, this.graphQlClient = e.graphQlClient, this.workflowManager = new mo(
|
|
12280
12282
|
this,
|
|
12281
12283
|
t,
|
|
12282
12284
|
e.workflow,
|
|
@@ -12366,7 +12368,7 @@ class Oo {
|
|
|
12366
12368
|
}
|
|
12367
12369
|
let i = 2048;
|
|
12368
12370
|
e && e <= 2048 && (i = e);
|
|
12369
|
-
const s =
|
|
12371
|
+
const s = gt(i, i), o = this.commandContext.getAllLayouts(), l = a.defaultPreviewPanelIndex || 0, c = a.panels[l], d = o.find((S) => {
|
|
12370
12372
|
var y;
|
|
12371
12373
|
return ((y = S.layoutState) == null ? void 0 : y.layout.panelId) === (c == null ? void 0 : c.name);
|
|
12372
12374
|
}) || o[0], A = d.layoutState.layout.previewRegion ? {
|
|
@@ -12382,19 +12384,19 @@ class Oo {
|
|
|
12382
12384
|
}, u = this.commandContext.getLayoutById(d.layoutState.layout.id), h = s.getContext("2d");
|
|
12383
12385
|
if (!h)
|
|
12384
12386
|
throw new xe("Failed to obtain 2D context for preview image creation");
|
|
12385
|
-
const
|
|
12387
|
+
const m = Sa(u.layoutState.layout, u.layoutState.elements, {
|
|
12386
12388
|
renderingConfiguration: {
|
|
12387
12389
|
purpose: qt.Print,
|
|
12388
12390
|
region: { left: A.x, top: A.y, width: A.width, height: A.height },
|
|
12389
12391
|
templatingContext: this.workflowManager.getTemplatingContext()
|
|
12390
12392
|
}
|
|
12391
|
-
}),
|
|
12392
|
-
await (await Aa.from(h,
|
|
12393
|
+
}), g = un(m);
|
|
12394
|
+
await (await Aa.from(h, g, {
|
|
12393
12395
|
anonymousCrossOrigin: !0,
|
|
12394
12396
|
ignoreDimensions: !1,
|
|
12395
|
-
createCanvas:
|
|
12397
|
+
createCanvas: gt,
|
|
12396
12398
|
createImage: Zt,
|
|
12397
|
-
DOMParser:
|
|
12399
|
+
DOMParser: ga(),
|
|
12398
12400
|
fetch
|
|
12399
12401
|
})).render();
|
|
12400
12402
|
const f = await this.getCanvasObjectURLAsync(s);
|
|
@@ -12493,16 +12495,16 @@ class Oo {
|
|
|
12493
12495
|
const d = /* @__PURE__ */ new Set(), A = c.getRaw().globalPropertyAspectConfigurations;
|
|
12494
12496
|
A !== void 0 && (A.forEach((u) => d.add(JSON.stringify(u))), o.forEach((u) => {
|
|
12495
12497
|
const h = u.getRaw().globalPropertyAspectConfigurations;
|
|
12496
|
-
h !== void 0 && h.forEach((
|
|
12497
|
-
const
|
|
12498
|
-
if (p && (
|
|
12498
|
+
h !== void 0 && h.forEach((m) => {
|
|
12499
|
+
const g = l(m), p = d.has(JSON.stringify(m));
|
|
12500
|
+
if (p && (g == null ? void 0 : g.getType()) === "Option") {
|
|
12499
12501
|
const f = u.getCurrentVariant();
|
|
12500
12502
|
if (!f)
|
|
12501
12503
|
return;
|
|
12502
|
-
c.selectVariant(f), d.delete(JSON.stringify(
|
|
12503
|
-
} else if (p && (
|
|
12504
|
+
c.selectVariant(f), d.delete(JSON.stringify(m));
|
|
12505
|
+
} else if (p && (g == null ? void 0 : g.getType()) === "Text") {
|
|
12504
12506
|
const f = u.getText();
|
|
12505
|
-
c.setText(f), d.delete(JSON.stringify(
|
|
12507
|
+
c.setText(f), d.delete(JSON.stringify(m));
|
|
12506
12508
|
}
|
|
12507
12509
|
});
|
|
12508
12510
|
}));
|
|
@@ -12698,13 +12700,13 @@ const $o = [
|
|
|
12698
12700
|
const a = t.data, n = e.data.baseUrl, i = a.assetUrl.replace("localhost", "localstack"), s = n.slice(0, 4) === "http" ? "" : "https://", o = new URL(s + n);
|
|
12699
12701
|
o.searchParams.append("video", Qa(JSON.stringify([{ href: i }]))), o.pathname = o.pathname + (o.pathname.slice(-1) === "/" ? "" : "/");
|
|
12700
12702
|
const l = o.toString(), d = `data:image/svg+xml;base64,${Qa(await sn(l, { type: "svg" }))}`, A = (h) => {
|
|
12701
|
-
const
|
|
12702
|
-
if (!
|
|
12703
|
+
const m = r.find((p) => p.panelId === h.panelId);
|
|
12704
|
+
if (!m)
|
|
12703
12705
|
throw new J(h);
|
|
12704
|
-
const
|
|
12706
|
+
const g = Q();
|
|
12705
12707
|
return new W(
|
|
12706
12708
|
{
|
|
12707
|
-
id:
|
|
12709
|
+
id: g,
|
|
12708
12710
|
src: d,
|
|
12709
12711
|
type: M.Image,
|
|
12710
12712
|
y: h.top,
|
|
@@ -12713,7 +12715,7 @@ const $o = [
|
|
|
12713
12715
|
height: h.height,
|
|
12714
12716
|
rotation: 0
|
|
12715
12717
|
},
|
|
12716
|
-
|
|
12718
|
+
m
|
|
12717
12719
|
);
|
|
12718
12720
|
}, u = e.data.regions;
|
|
12719
12721
|
try {
|
|
@@ -12727,11 +12729,11 @@ const $o = [
|
|
|
12727
12729
|
const o = is(n, a.option);
|
|
12728
12730
|
o && (t[a.stepName] = { selectedVariants: [o] });
|
|
12729
12731
|
const l = async (c) => {
|
|
12730
|
-
var
|
|
12731
|
-
const d = await Rn(c, (
|
|
12732
|
+
var g;
|
|
12733
|
+
const d = await Rn(c, (g = o == null ? void 0 : o.asset) == null ? void 0 : g.fileLink), A = await Qe(d), u = Q(), h = r.find((p) => p.panelId === c.panelId);
|
|
12732
12734
|
if (!h)
|
|
12733
12735
|
throw new J(c);
|
|
12734
|
-
const
|
|
12736
|
+
const m = Ea(
|
|
12735
12737
|
s,
|
|
12736
12738
|
A,
|
|
12737
12739
|
{
|
|
@@ -12760,13 +12762,13 @@ const $o = [
|
|
|
12760
12762
|
pattern: {
|
|
12761
12763
|
id: `${u}-pattern`,
|
|
12762
12764
|
src: s.src,
|
|
12763
|
-
x:
|
|
12764
|
-
y:
|
|
12765
|
+
x: m.x,
|
|
12766
|
+
y: m.y,
|
|
12765
12767
|
width: s.width,
|
|
12766
12768
|
height: s.height,
|
|
12767
12769
|
rotation: 0,
|
|
12768
|
-
scaleX:
|
|
12769
|
-
scaleY:
|
|
12770
|
+
scaleX: m.zoom,
|
|
12771
|
+
scaleY: m.zoom,
|
|
12770
12772
|
svg: s.svg,
|
|
12771
12773
|
colors: s.colors
|
|
12772
12774
|
}
|
|
@@ -12793,30 +12795,30 @@ const $o = [
|
|
|
12793
12795
|
const o = (E = s.asset) == null ? void 0 : E.fileLink;
|
|
12794
12796
|
if (!o)
|
|
12795
12797
|
return console.error(`No asset link for variant with ID: ${n.illustrationVariantId}`), [];
|
|
12796
|
-
const l = await at(o, !0), c = /<svg.*?<\/svg>/s, d = l.match(c) || [], A = (d == null ? void 0 : d.length) > 0 ? d[0] : "",
|
|
12797
|
-
if (!
|
|
12798
|
+
const l = await at(o, !0), c = /<svg.*?<\/svg>/s, d = l.match(c) || [], A = (d == null ? void 0 : d.length) > 0 ? d[0] : "", m = dt().parseFromString(A, "image/svg+xml").firstElementChild;
|
|
12799
|
+
if (!m)
|
|
12798
12800
|
return console.error("Failed to read SVG."), [];
|
|
12799
|
-
pa(
|
|
12800
|
-
const
|
|
12801
|
-
kt(
|
|
12801
|
+
pa(m);
|
|
12802
|
+
const g = {};
|
|
12803
|
+
kt(m, (B) => {
|
|
12802
12804
|
$o.includes(B.tagName) && !B.attributes.getNamedItem("fill") && B.setAttribute("fill", "#000000");
|
|
12803
12805
|
const I = B.attributes.getNamedItem("fill");
|
|
12804
12806
|
if (I && I.value !== "none") {
|
|
12805
12807
|
const x = I.value, T = `spiff-fill-${x.replace(/\W/g, "")}`;
|
|
12806
|
-
B.classList.add(T),
|
|
12808
|
+
B.classList.add(T), g[T] = { browserValue: x };
|
|
12807
12809
|
}
|
|
12808
12810
|
const D = B.attributes.getNamedItem("stroke");
|
|
12809
12811
|
if (D && D.value !== "none") {
|
|
12810
12812
|
const x = D.value, T = `spiff-stroke-${x.replace(/\W/g, "")}`;
|
|
12811
|
-
B.classList.add(T),
|
|
12813
|
+
B.classList.add(T), g[T] = { browserValue: x };
|
|
12812
12814
|
}
|
|
12813
12815
|
});
|
|
12814
|
-
const f = bt().serializeToString(
|
|
12816
|
+
const f = bt().serializeToString(m), C = n.colors;
|
|
12815
12817
|
if (C) {
|
|
12816
|
-
for (const [B, I] of Object.entries(
|
|
12818
|
+
for (const [B, I] of Object.entries(g))
|
|
12817
12819
|
for (const D of Object.keys(C))
|
|
12818
12820
|
if (I.browserValue === D) {
|
|
12819
|
-
|
|
12821
|
+
g[B] = { browserValue: C[D] };
|
|
12820
12822
|
break;
|
|
12821
12823
|
}
|
|
12822
12824
|
}
|
|
@@ -12827,7 +12829,7 @@ const $o = [
|
|
|
12827
12829
|
const D = Q();
|
|
12828
12830
|
return new W(
|
|
12829
12831
|
{
|
|
12830
|
-
colors:
|
|
12832
|
+
colors: g,
|
|
12831
12833
|
id: D,
|
|
12832
12834
|
svg: f,
|
|
12833
12835
|
type: M.Illustration,
|
|
@@ -12893,13 +12895,13 @@ const $o = [
|
|
|
12893
12895
|
if (!o)
|
|
12894
12896
|
return console.error(`No asset link for variant with ID: ${n.pictureVariantId}`), [];
|
|
12895
12897
|
const l = (u) => {
|
|
12896
|
-
const h = r.find((
|
|
12898
|
+
const h = r.find((g) => g.panelId === u.panelId);
|
|
12897
12899
|
if (!h)
|
|
12898
12900
|
throw new J(u);
|
|
12899
|
-
const
|
|
12901
|
+
const m = Q();
|
|
12900
12902
|
return new W(
|
|
12901
12903
|
{
|
|
12902
|
-
id:
|
|
12904
|
+
id: m,
|
|
12903
12905
|
src: o,
|
|
12904
12906
|
type: M.Image,
|
|
12905
12907
|
y: u.top,
|
|
@@ -12953,11 +12955,11 @@ const $o = [
|
|
|
12953
12955
|
fill="${s == null ? void 0 : s.color}"
|
|
12954
12956
|
/>
|
|
12955
12957
|
</svg>
|
|
12956
|
-
`,
|
|
12958
|
+
`, m = { "spiff-fill-shape": { browserValue: s.color || "#000000" } }, g = Q();
|
|
12957
12959
|
return new W(
|
|
12958
12960
|
{
|
|
12959
|
-
colors:
|
|
12960
|
-
id:
|
|
12961
|
+
colors: m,
|
|
12962
|
+
id: g,
|
|
12961
12963
|
svg: u,
|
|
12962
12964
|
type: M.Illustration,
|
|
12963
12965
|
y: d.top,
|
|
@@ -13012,13 +13014,13 @@ const $o = [
|
|
|
13012
13014
|
}
|
|
13013
13015
|
else {
|
|
13014
13016
|
const c = await at(i, !0), d = (A) => {
|
|
13015
|
-
const u = /<svg.*?<\/svg>/s, h = A.match(u) || [],
|
|
13017
|
+
const u = /<svg.*?<\/svg>/s, h = A.match(u) || [], m = (h == null ? void 0 : h.length) > 0 ? h[0] : "", f = dt().parseFromString(m, "image/svg+xml").firstElementChild;
|
|
13016
13018
|
if (!f)
|
|
13017
13019
|
throw new xt("Failed to read SVG.");
|
|
13018
13020
|
return pa(f), bt().serializeToString(f);
|
|
13019
13021
|
};
|
|
13020
13022
|
l.forEach((A) => {
|
|
13021
|
-
const u = r.find((
|
|
13023
|
+
const u = r.find((m) => m.panelId === A.panelId);
|
|
13022
13024
|
if (!u)
|
|
13023
13025
|
throw new J(A);
|
|
13024
13026
|
const h = {
|
|
@@ -13075,8 +13077,8 @@ const $o = [
|
|
|
13075
13077
|
return;
|
|
13076
13078
|
const C = Y.getDefaultVariant(f);
|
|
13077
13079
|
return C == null ? void 0 : C.color;
|
|
13078
|
-
},
|
|
13079
|
-
for (const p of
|
|
13080
|
+
}, m = i.color || await h(a.data), g = a.data.regions;
|
|
13081
|
+
for (const p of g) {
|
|
13080
13082
|
const f = r.find((w) => w.panelId === p.panelId);
|
|
13081
13083
|
if (!f)
|
|
13082
13084
|
continue;
|
|
@@ -13085,7 +13087,7 @@ const $o = [
|
|
|
13085
13087
|
id: Q(),
|
|
13086
13088
|
align: o(a.data),
|
|
13087
13089
|
curved: a.data.curved,
|
|
13088
|
-
fill: i.color ||
|
|
13090
|
+
fill: i.color || m || "#000000",
|
|
13089
13091
|
fontData: d,
|
|
13090
13092
|
fontSize: a.data.size || s,
|
|
13091
13093
|
height: p.height,
|
|
@@ -13230,7 +13232,7 @@ class Jo {
|
|
|
13230
13232
|
}
|
|
13231
13233
|
const Ko = () => new Promise((r, t) => {
|
|
13232
13234
|
try {
|
|
13233
|
-
const a =
|
|
13235
|
+
const a = gt().getContext("webgl2");
|
|
13234
13236
|
r(!!a);
|
|
13235
13237
|
} catch {
|
|
13236
13238
|
r(!1);
|
|
@@ -13343,15 +13345,15 @@ class Zo extends Dn {
|
|
|
13343
13345
|
* a loose target but should be kept in mind when making changes.
|
|
13344
13346
|
*/
|
|
13345
13347
|
async execute() {
|
|
13346
|
-
var h,
|
|
13347
|
-
const t = this.layouts.find((
|
|
13348
|
+
var h, m;
|
|
13349
|
+
const t = this.layouts.find((g) => g.layoutState.layout.id === this.layoutId);
|
|
13348
13350
|
if (!t)
|
|
13349
13351
|
return;
|
|
13350
13352
|
const e = t.layoutState.elements || [], a = t.layoutState.layout.width, n = t.layoutState.layout.height, i = a === 1 || n === 1 ? { width: 1, height: 1 } : this.getDynamicTextureResolution(), s = i.width, o = i.height;
|
|
13351
13353
|
let l, c;
|
|
13352
13354
|
if (this.nonPOTSupport) {
|
|
13353
|
-
const
|
|
13354
|
-
a / n <
|
|
13355
|
+
const g = s / o;
|
|
13356
|
+
a / n < g ? (l = s, c = n * (s / a)) : (l = a * (o / n), c = o);
|
|
13355
13357
|
const f = this.resizeFit({ width: l, height: c });
|
|
13356
13358
|
l = f.width, c = f.height;
|
|
13357
13359
|
} else
|
|
@@ -13359,7 +13361,7 @@ class Zo extends Dn {
|
|
|
13359
13361
|
const d = Sa(t.layoutState.layout, e, {
|
|
13360
13362
|
renderingConfiguration: {
|
|
13361
13363
|
purpose: qt.ThreeD,
|
|
13362
|
-
templatingContext: (
|
|
13364
|
+
templatingContext: (m = (h = this.getWorkflowManager) == null ? void 0 : h.call(this)) == null ? void 0 : m.getTemplatingContext()
|
|
13363
13365
|
}
|
|
13364
13366
|
}), A = un(d), u = await Aa.from(this.ctx, A, {
|
|
13365
13367
|
anonymousCrossOrigin: !0,
|
|
@@ -13368,9 +13370,9 @@ class Zo extends Dn {
|
|
|
13368
13370
|
ignoreClear: !0,
|
|
13369
13371
|
ignoreMouse: !0,
|
|
13370
13372
|
enableRedraw: !1,
|
|
13371
|
-
createCanvas:
|
|
13373
|
+
createCanvas: gt,
|
|
13372
13374
|
createImage: Zt,
|
|
13373
|
-
DOMParser:
|
|
13375
|
+
DOMParser: ga(),
|
|
13374
13376
|
fetch
|
|
13375
13377
|
});
|
|
13376
13378
|
u.resize(l, c), await u.render(), this.onRender();
|
|
@@ -13498,19 +13500,15 @@ class Ia {
|
|
|
13498
13500
|
* @param targetExperiences Optionally filter the steps to only those in the given experiences.
|
|
13499
13501
|
*/
|
|
13500
13502
|
getSharedSteps(t, e) {
|
|
13501
|
-
|
|
13502
|
-
|
|
13503
|
-
|
|
13504
|
-
|
|
13505
|
-
|
|
13506
|
-
|
|
13507
|
-
|
|
13508
|
-
|
|
13509
|
-
|
|
13510
|
-
}
|
|
13511
|
-
));
|
|
13512
|
-
});
|
|
13513
|
-
});
|
|
13503
|
+
return (t ?? this.bundle.getWorkflowExperiences()).flatMap((i) => (e ? i.getSteps() : i.getStepsConditionallyActive()).filter((o) => {
|
|
13504
|
+
var l;
|
|
13505
|
+
return o.getOverrideGlobalPropertyConfiguration(this.property.type) ? !1 : (l = o.getRaw().globalPropertyAspectConfigurations) == null ? void 0 : l.some(
|
|
13506
|
+
(c) => {
|
|
13507
|
+
var d, A;
|
|
13508
|
+
return c.globalPropertyConfigurationId === ((A = (d = this.bundle.getProductCollection()) == null ? void 0 : d.getResource().globalPropertyConfiguration) == null ? void 0 : A.id) && c.aspectName === this.property.name;
|
|
13509
|
+
}
|
|
13510
|
+
);
|
|
13511
|
+
}));
|
|
13514
13512
|
}
|
|
13515
13513
|
getStateValue() {
|
|
13516
13514
|
return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
|
|
@@ -13780,9 +13778,7 @@ class al extends Ia {
|
|
|
13780
13778
|
await this.applyTextSelection(e, t);
|
|
13781
13779
|
}
|
|
13782
13780
|
async applyTextSelection(t, e, a) {
|
|
13783
|
-
const
|
|
13784
|
-
console.log(`LOG: ${n.length} shared steps`);
|
|
13785
|
-
const i = n.map((s) => {
|
|
13781
|
+
const i = this.getSharedSteps(e, a).map((s) => {
|
|
13786
13782
|
s.setText(t);
|
|
13787
13783
|
});
|
|
13788
13784
|
await Promise.all(i);
|
|
@@ -14405,13 +14401,13 @@ class Zn {
|
|
|
14405
14401
|
let A = !1;
|
|
14406
14402
|
const u = c.subscribe({
|
|
14407
14403
|
next(h) {
|
|
14408
|
-
var
|
|
14409
|
-
if (A || h.partial && (!h.data.productCollections || h.data.productCollections.length === 0 || !((
|
|
14404
|
+
var g, p, f, C, w, S;
|
|
14405
|
+
if (A || h.partial && (!h.data.productCollections || h.data.productCollections.length === 0 || !((g = h.data.productCollections[0].productCollectionProductsFeed) != null && g.items) || ((p = h.data.productCollections[0].productCollectionProductsFeed) == null ? void 0 : p.items.length) === 0))
|
|
14410
14406
|
return;
|
|
14411
14407
|
o.abort(), A = !0, u.unsubscribe();
|
|
14412
|
-
const
|
|
14408
|
+
const m = ((C = (f = h.data.productCollections) == null ? void 0 : f[0].productCollectionProductsFeed) == null ? void 0 : C.items.filter((y) => !!y.product).map((y) => new de(St(y)))) || [];
|
|
14413
14409
|
d({
|
|
14414
|
-
items:
|
|
14410
|
+
items: m,
|
|
14415
14411
|
// Clone items because it could be cached data (immutable)
|
|
14416
14412
|
total: ((S = (w = h.data.productCollections) == null ? void 0 : w[0].productCollectionProductsFeed) == null ? void 0 : S.total) ?? 0
|
|
14417
14413
|
});
|
|
@@ -14660,7 +14656,7 @@ const hl = v`
|
|
|
14660
14656
|
}
|
|
14661
14657
|
})).data) == null ? void 0 : e.productCollections) == null ? void 0 : a.map((n) => new Zn(n));
|
|
14662
14658
|
};
|
|
14663
|
-
class
|
|
14659
|
+
class ml {
|
|
14664
14660
|
constructor() {
|
|
14665
14661
|
this.listeners = {};
|
|
14666
14662
|
}
|
|
@@ -14687,7 +14683,7 @@ class gl {
|
|
|
14687
14683
|
delete this.listeners[e];
|
|
14688
14684
|
}
|
|
14689
14685
|
}
|
|
14690
|
-
const
|
|
14686
|
+
const gl = v`
|
|
14691
14687
|
mutation AddAddressToBundle(
|
|
14692
14688
|
$bundleId: String!
|
|
14693
14689
|
$streetAddress: String
|
|
@@ -14726,7 +14722,7 @@ const ml = v`
|
|
|
14726
14722
|
class Je {
|
|
14727
14723
|
constructor(t, e, a, n, i, s) {
|
|
14728
14724
|
var c, d, A;
|
|
14729
|
-
this.workflowExperiences = [], this.eventEmitter = new
|
|
14725
|
+
this.workflowExperiences = [], this.eventEmitter = new ml(), this.client = t, this.id = e.id, this.name = e.name || "", this.template = e.template || !1, this.quoteId = e.quoteId, this.shareActions = e.bundleShareActions, this.workflowViewerLink = e.workflowViewerLink, this.workflowViewerAmendLink = e.workflowViewerAmendLink, this.ownerId = i, this.metadata = new Map(((c = e.metadata) == null ? void 0 : c.map((u) => [u.key, u.value])) || []), this.completed = e.completed ?? !1, this.productCollection = e.productCollection, this.bundleStateManager = new sl(e.bundleStateData);
|
|
14730
14726
|
const o = (d = this.productCollection) == null ? void 0 : d.globalPropertyConfiguration;
|
|
14731
14727
|
this.globalConfigurationPropertyId = o == null ? void 0 : o.id, this.globalPropertyStateManager = new il(
|
|
14732
14728
|
this.id,
|
|
@@ -14740,8 +14736,8 @@ class Je {
|
|
|
14740
14736
|
u([]);
|
|
14741
14737
|
return;
|
|
14742
14738
|
}
|
|
14743
|
-
console.log("Setting default global variants."), this.globalPropertyHandleService.getHandles().then((
|
|
14744
|
-
const
|
|
14739
|
+
console.log("Setting default global variants."), this.globalPropertyHandleService.getHandles().then((m) => {
|
|
14740
|
+
const g = m.map((p) => {
|
|
14745
14741
|
if (p.getType() === G.ColorOption || p.getType() === G.Option) {
|
|
14746
14742
|
const f = p;
|
|
14747
14743
|
if (this.globalPropertyStateManager.getGlobalPropertyState())
|
|
@@ -14749,7 +14745,7 @@ class Je {
|
|
|
14749
14745
|
console.log("Attempted to set global default variant before state was initialized.");
|
|
14750
14746
|
}
|
|
14751
14747
|
});
|
|
14752
|
-
Promise.all(
|
|
14748
|
+
Promise.all(g).then(u).catch(h);
|
|
14753
14749
|
});
|
|
14754
14750
|
});
|
|
14755
14751
|
this.initializationPromise = Promise.all([
|
|
@@ -14780,7 +14776,7 @@ class Je {
|
|
|
14780
14776
|
}
|
|
14781
14777
|
async attachAddress(t, e, a, n, i, s) {
|
|
14782
14778
|
await b.getShadowGraphqlClient().mutate({
|
|
14783
|
-
mutation:
|
|
14779
|
+
mutation: gl,
|
|
14784
14780
|
variables: {
|
|
14785
14781
|
bundleId: this.id,
|
|
14786
14782
|
streetAddress: t || void 0,
|
|
@@ -14872,10 +14868,11 @@ class Je {
|
|
|
14872
14868
|
async applyGlobalPropertyState(t) {
|
|
14873
14869
|
var a;
|
|
14874
14870
|
const e = await this.globalPropertyHandleService.getHandles();
|
|
14875
|
-
console.log(`LOG: ${e.length} handles`);
|
|
14876
14871
|
for (const n of t.aspects) {
|
|
14872
|
+
for (const o of this.workflowExperiences)
|
|
14873
|
+
o.getWorkflowManager().unsetInitialized();
|
|
14877
14874
|
const i = n == null ? void 0 : n.name, s = e.find((o) => o.getName() === i);
|
|
14878
|
-
if (
|
|
14875
|
+
if (s)
|
|
14879
14876
|
switch (n.type) {
|
|
14880
14877
|
case G.FileUpload: {
|
|
14881
14878
|
const o = s, l = await ve([n.value]);
|
|
@@ -14938,9 +14935,9 @@ class Je {
|
|
|
14938
14935
|
this.getWorkflowExperiences(),
|
|
14939
14936
|
this.globalConfigurationPropertyId || "",
|
|
14940
14937
|
l
|
|
14941
|
-
),
|
|
14942
|
-
if (
|
|
14943
|
-
for (const p of
|
|
14938
|
+
), m = [...new Set(A.map((p) => p.number))];
|
|
14939
|
+
if (m.length > h)
|
|
14940
|
+
for (const p of m) {
|
|
14944
14941
|
const f = this.getGlobalPropertyStateManager(), C = u.find((w) => w.channelNumber === p);
|
|
14945
14942
|
C && await f.setAspect(l, C.variant.id || "", void 0, C.channelNumber);
|
|
14946
14943
|
}
|
|
@@ -15465,14 +15462,14 @@ class wl {
|
|
|
15465
15462
|
mutation: Cl,
|
|
15466
15463
|
variables: {
|
|
15467
15464
|
processFlowId: t,
|
|
15468
|
-
inputs: [...e.map((
|
|
15465
|
+
inputs: [...e.map((m) => m.getValueForTransmission())]
|
|
15469
15466
|
}
|
|
15470
15467
|
})).data) == null ? void 0 : A.processExecutionCreate) == null ? void 0 : u.id;
|
|
15471
15468
|
if (!i)
|
|
15472
15469
|
throw new Error("Failed to create process execution.");
|
|
15473
|
-
function s(
|
|
15474
|
-
return new Promise((
|
|
15475
|
-
setTimeout(
|
|
15470
|
+
function s(m) {
|
|
15471
|
+
return new Promise((g) => {
|
|
15472
|
+
setTimeout(g, m);
|
|
15476
15473
|
});
|
|
15477
15474
|
}
|
|
15478
15475
|
let o = !1, l = 0, c, d;
|
|
@@ -15496,20 +15493,20 @@ class wl {
|
|
|
15496
15493
|
ids: [i]
|
|
15497
15494
|
}
|
|
15498
15495
|
});
|
|
15499
|
-
const
|
|
15500
|
-
if (!c || !
|
|
15496
|
+
const m = (h = c.data) == null ? void 0 : h.processExecutions[0];
|
|
15497
|
+
if (!c || !m)
|
|
15501
15498
|
throw new Error("Failed to retrieve server response for execution.");
|
|
15502
|
-
if (
|
|
15499
|
+
if (m.failedAt)
|
|
15503
15500
|
throw new Error(
|
|
15504
15501
|
"Execution has failed to complete. See Automation > FLows in Flight on partner account on SpiffCommerce Hub."
|
|
15505
15502
|
);
|
|
15506
|
-
if (
|
|
15507
|
-
o = !0, d = new yl(
|
|
15503
|
+
if (m.completedAt) {
|
|
15504
|
+
o = !0, d = new yl(m);
|
|
15508
15505
|
break;
|
|
15509
15506
|
}
|
|
15510
15507
|
l += 1;
|
|
15511
|
-
const
|
|
15512
|
-
if (l >=
|
|
15508
|
+
const g = a != null && a.repeats ? a == null ? void 0 : a.repeats : 5;
|
|
15509
|
+
if (l >= g)
|
|
15513
15510
|
throw new Error("Maximum wait time exceeded for execution result.");
|
|
15514
15511
|
await s(a != null && a.sleepTime ? Math.max(a.sleepTime, 500) : 2e3);
|
|
15515
15512
|
}
|
|
@@ -15922,10 +15919,10 @@ class rd {
|
|
|
15922
15919
|
} catch (a) {
|
|
15923
15920
|
throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
|
|
15924
15921
|
}
|
|
15925
|
-
}, this.options = t, this.options.applicationKey && Rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 27.2.1-beta.
|
|
15922
|
+
}, this.options = t, this.options.applicationKey && Rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 27.2.1-beta.7511abac-e002-517f-be28-38477f8184a4"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
|
15926
15923
|
}
|
|
15927
15924
|
configure(t) {
|
|
15928
|
-
|
|
15925
|
+
mt.setHubUrl(t.hubUrl), mt.setServerUrl(t.serverUrl), mt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && $r(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Ut.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
|
15929
15926
|
}
|
|
15930
15927
|
/**
|
|
15931
15928
|
* @returns The asset manager allows for common operations related to assets
|
|
@@ -16000,7 +15997,7 @@ class rd {
|
|
|
16000
15997
|
* @throws An error if the transaction is not found.
|
|
16001
15998
|
*/
|
|
16002
15999
|
async authenticateTransactionFromLocalStorage(t) {
|
|
16003
|
-
var d, A, u, h,
|
|
16000
|
+
var d, A, u, h, m, g;
|
|
16004
16001
|
const e = b.getShadowGraphqlClient(), a = await e.query({
|
|
16005
16002
|
query: Mi,
|
|
16006
16003
|
errorPolicy: "all",
|
|
@@ -16026,7 +16023,7 @@ class rd {
|
|
|
16026
16023
|
var S, y;
|
|
16027
16024
|
return (y = (S = w.bundle) == null ? void 0 : S.transactions) == null ? void 0 : y.some((E) => E.id === t);
|
|
16028
16025
|
}
|
|
16029
|
-
)) || ((
|
|
16026
|
+
)) || ((g = (m = this.customer) == null ? void 0 : m.stakeholders) == null ? void 0 : g.find(
|
|
16030
16027
|
(w) => {
|
|
16031
16028
|
var S;
|
|
16032
16029
|
return ((S = w.transaction) == null ? void 0 : S.id) === t;
|
|
@@ -16225,7 +16222,7 @@ class rd {
|
|
|
16225
16222
|
mutation: Ws(((d = (c = a == null ? void 0 : a.graphql) == null ? void 0 : c.productCollection) == null ? void 0 : d.eagerFetchProducts) || !1),
|
|
16226
16223
|
variables: {
|
|
16227
16224
|
collectionId: t,
|
|
16228
|
-
initialMetadata: e ? Object.entries(e).map((
|
|
16225
|
+
initialMetadata: e ? Object.entries(e).map((m, g) => ({ key: m[0], value: m[1] })) : void 0,
|
|
16229
16226
|
marketplaceThemeInstallId: this.marketplaceThemeInstallId,
|
|
16230
16227
|
marketplaceThemeInstallConfigurationId: this.marketplaceThemeInstallConfigurationId
|
|
16231
16228
|
},
|
|
@@ -16251,7 +16248,7 @@ class rd {
|
|
|
16251
16248
|
* @returns A bundle to be used for grouping and operating on large amounts of workflow experiences.
|
|
16252
16249
|
*/
|
|
16253
16250
|
async getExistingBundle(t, e, a, n) {
|
|
16254
|
-
var h,
|
|
16251
|
+
var h, m, g, p, f, C, w, S, y, E, B;
|
|
16255
16252
|
const i = N.getMap("bundleOwnerIds"), s = i == null ? void 0 : i.get(t), o = {};
|
|
16256
16253
|
try {
|
|
16257
16254
|
const I = await this.loggedInBearerToken();
|
|
@@ -16263,9 +16260,9 @@ class rd {
|
|
|
16263
16260
|
const l = {
|
|
16264
16261
|
bundleOwnerId: s,
|
|
16265
16262
|
...o,
|
|
16266
|
-
...(
|
|
16263
|
+
...(m = n == null ? void 0 : n.graphql) == null ? void 0 : m.additionalHeaders
|
|
16267
16264
|
}, c = await b.getShadowGraphqlClient().query({
|
|
16268
|
-
query: Ls(((p = (
|
|
16265
|
+
query: Ls(((p = (g = n == null ? void 0 : n.graphql) == null ? void 0 : g.productCollection) == null ? void 0 : p.eagerFetchProducts) || !1),
|
|
16269
16266
|
variables: {
|
|
16270
16267
|
id: t
|
|
16271
16268
|
},
|
|
@@ -16293,19 +16290,19 @@ class rd {
|
|
|
16293
16290
|
* @returns A bundle to be used for grouping and operating on large amounts of workflow experiences.
|
|
16294
16291
|
*/
|
|
16295
16292
|
async duplicateBundle(t, e, a, n) {
|
|
16296
|
-
var h,
|
|
16293
|
+
var h, m, g, p, f, C, w, S;
|
|
16297
16294
|
const i = (h = N.getMap("bundleOwnerIds")) == null ? void 0 : h.get(t), s = {};
|
|
16298
16295
|
try {
|
|
16299
16296
|
const y = await this.loggedInBearerToken();
|
|
16300
16297
|
s.Authorization = `Bearer ${y}`;
|
|
16301
16298
|
} catch {
|
|
16302
|
-
const B = ((
|
|
16299
|
+
const B = ((m = Object.entries(localStorage).find(([D, x]) => D.startsWith("CognitoIdentityServiceProvider") && D.endsWith("idToken"))) == null ? void 0 : m[0]) || "", I = localStorage.getItem(B);
|
|
16303
16300
|
I && !Wt(I) && (s.Authorization = `Bearer ${I}`);
|
|
16304
16301
|
}
|
|
16305
16302
|
const o = {
|
|
16306
16303
|
bundleOwnerId: i,
|
|
16307
16304
|
...s,
|
|
16308
|
-
...(
|
|
16305
|
+
...(g = n == null ? void 0 : n.graphql) == null ? void 0 : g.additionalHeaders
|
|
16309
16306
|
}, c = (C = (await b.getShadowGraphqlClient().mutate({
|
|
16310
16307
|
mutation: js(((f = (p = n == null ? void 0 : n.graphql) == null ? void 0 : p.productCollection) == null ? void 0 : f.eagerFetchProducts) || !1),
|
|
16311
16308
|
variables: {
|
|
@@ -16461,11 +16458,11 @@ class rd {
|
|
|
16461
16458
|
), c = Fa(o, 10), d = Fa(l, 10), A = (await Promise.all([
|
|
16462
16459
|
...c.map(n),
|
|
16463
16460
|
...d.map(i)
|
|
16464
|
-
])).flat(), u = [...new Set(A.map((y) => y.workflowId))], h = await er(u, e),
|
|
16461
|
+
])).flat(), u = [...new Set(A.map((y) => y.workflowId))], h = await er(u, e), m = new Map(h.map((y) => [y.id, y])), g = N.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), p = A.map(async (y) => {
|
|
16465
16462
|
var tt;
|
|
16466
|
-
const { transaction: E, workflowId: B, readOnly: I, index: D } = y, x =
|
|
16467
|
-
!
|
|
16468
|
-
const T =
|
|
16463
|
+
const { transaction: E, workflowId: B, readOnly: I, index: D } = y, x = m.get(B), k = t[D];
|
|
16464
|
+
!g.get(E.id) && E.transactionOwnerId && g.set(E.id, E.transactionOwnerId);
|
|
16465
|
+
const T = g.get(E.id) || void 0, nt = new bl({
|
|
16469
16466
|
onMutate: () => ({ context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId } }),
|
|
16470
16467
|
onQuery: () => ({ context: { transactionOwnerId: T, bundleOwnerId: e == null ? void 0 : e.bundleOwnerId } })
|
|
16471
16468
|
}), R = {
|
|
@@ -16499,7 +16496,7 @@ class rd {
|
|
|
16499
16496
|
R.layouts
|
|
16500
16497
|
), R.delayWorkflowStateSync = !0, { experienceOptions: R, index: D, options: k };
|
|
16501
16498
|
}), f = await Promise.all(p);
|
|
16502
|
-
N.setMap("transactionOwnerIds",
|
|
16499
|
+
N.setMap("transactionOwnerIds", g);
|
|
16503
16500
|
const w = f.sort((y, E) => y.index - E.index).map(async (y) => {
|
|
16504
16501
|
const { experienceOptions: E, options: B } = y, I = new Oo(this, E);
|
|
16505
16502
|
return await I.getWorkflowManager().getInitializationPromise(), B.type !== "transaction" && this.customer && await I.attachCustomerDetails({ email: this.customer.emailAddress }), I;
|
|
@@ -17348,13 +17345,13 @@ const Rl = v`
|
|
|
17348
17345
|
id: r,
|
|
17349
17346
|
template: t
|
|
17350
17347
|
}
|
|
17351
|
-
}),
|
|
17348
|
+
}), md = async (r) => (await b.getShadowGraphqlClient().query({
|
|
17352
17349
|
query: Rl,
|
|
17353
17350
|
errorPolicy: "all",
|
|
17354
17351
|
variables: {
|
|
17355
17352
|
email: r
|
|
17356
17353
|
}
|
|
17357
|
-
})).data.customer,
|
|
17354
|
+
})).data.customer, gd = async (r, t, e) => await b.getShadowGraphqlClient().query({
|
|
17358
17355
|
query: Ll,
|
|
17359
17356
|
errorPolicy: "all",
|
|
17360
17357
|
fetchPolicy: "no-cache",
|
|
@@ -17696,7 +17693,7 @@ export {
|
|
|
17696
17693
|
Ql as FrameStepHandle,
|
|
17697
17694
|
Ia as GlobalPropertyHandle,
|
|
17698
17695
|
$ as GroupCommand,
|
|
17699
|
-
|
|
17696
|
+
go as IllustrationStepHandle,
|
|
17700
17697
|
Re as InformationMessageType,
|
|
17701
17698
|
vo as InformationStepHandle,
|
|
17702
17699
|
Ka as IntegrationProduct,
|
|
@@ -17777,8 +17774,8 @@ export {
|
|
|
17777
17774
|
xc as getAxisAlignedBoundingBox,
|
|
17778
17775
|
Ml as getBoundedOffsets,
|
|
17779
17776
|
od as getBundleThemeConfiguration,
|
|
17780
|
-
|
|
17781
|
-
|
|
17777
|
+
md as getCustomer,
|
|
17778
|
+
gd as getCustomerBundles,
|
|
17782
17779
|
$c as getElementVertices,
|
|
17783
17780
|
Qe as getFrameData,
|
|
17784
17781
|
_c as getGlobalPropertyStateForBundle,
|
|
@@ -17802,7 +17799,7 @@ export {
|
|
|
17802
17799
|
nd as getWorkflow,
|
|
17803
17800
|
er as getWorkflows,
|
|
17804
17801
|
b as graphQlManager,
|
|
17805
|
-
|
|
17802
|
+
ge as illustrationStepService,
|
|
17806
17803
|
kc as isCloseToValue,
|
|
17807
17804
|
Nt as loadFont,
|
|
17808
17805
|
Pc as matchHexToPms,
|
|
@@ -17828,10 +17825,10 @@ export {
|
|
|
17828
17825
|
le as rotateAroundPoint,
|
|
17829
17826
|
pa as sanitizeSvgTree,
|
|
17830
17827
|
$r as setBearerAuthenticationToken,
|
|
17831
|
-
|
|
17828
|
+
gn as setCanvasModule,
|
|
17832
17829
|
Gt as shapeStepService,
|
|
17833
17830
|
hs as shortenUrl,
|
|
17834
|
-
|
|
17831
|
+
mt as spiffCoreConfiguration,
|
|
17835
17832
|
Xc as stepAspectValuesToDesignInputSteps,
|
|
17836
17833
|
Oa as svgColorValueToDefinition,
|
|
17837
17834
|
On as svgStringDimensions,
|