@spiffcommerce/core 33.12.0 → 33.13.0-beta.442ca23a-1a46-521c-9410-a29cf07ceee6
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/CHANGELOG.md +6 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +76 -95
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +749 -767
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { createHttpLink as Ii, ApolloClient as Bi, InMemoryCache as Pi, from as
|
|
2
|
-
import { setContext as
|
|
1
|
+
import { createHttpLink as Ii, ApolloClient as Bi, InMemoryCache as Pi, from as Di, gql as C } from "@apollo/client/core";
|
|
2
|
+
import { setContext as Fi } from "@apollo/client/link/context";
|
|
3
3
|
import { onError as xi } from "@apollo/client/link/error";
|
|
4
4
|
import { renderToStaticMarkup as ki } from "preact-render-to-string";
|
|
5
5
|
import { removeTypenameFromVariables as Mi } from "@apollo/client/link/remove-typename";
|
|
6
6
|
import { orientation as Ti } from "exifr/dist/mini.umd.cjs";
|
|
7
7
|
import { parse as yn } from "css";
|
|
8
8
|
import Ni from "fuse.js";
|
|
9
|
-
import { Pith as
|
|
9
|
+
import { Pith as va } from "pith";
|
|
10
10
|
import It from "lodash.clonedeep";
|
|
11
11
|
import Jt from "lodash.isequal";
|
|
12
12
|
import { jsx as P, jsxs as dt, Fragment as qt } from "preact/jsx-runtime";
|
|
13
|
-
import { parse as
|
|
13
|
+
import { parse as la } from "opentype.js";
|
|
14
14
|
import Qi from "handlebars";
|
|
15
15
|
import { dataUriToBuffer as Ri } from "data-uri-to-buffer";
|
|
16
16
|
import { toString as Sn } from "qrcode";
|
|
17
|
-
import { split as
|
|
17
|
+
import { split as ca } from "unicode-default-word-boundary";
|
|
18
18
|
import Oi from "svg-path-bbox";
|
|
19
|
-
import
|
|
20
|
-
import { CognitoIdentityProviderClient as $i, InitiateAuthCommand as
|
|
19
|
+
import La from "lodash.chunk";
|
|
20
|
+
import { CognitoIdentityProviderClient as $i, InitiateAuthCommand as Va, RespondToAuthChallengeCommand as Ui } from "@aws-sdk/client-cognito-identity-provider";
|
|
21
21
|
import Li from "dinero.js";
|
|
22
|
-
import * as
|
|
22
|
+
import * as za from "currency-codes";
|
|
23
23
|
import vn from "lodash.debounce";
|
|
24
24
|
import "fs";
|
|
25
25
|
import "path";
|
|
26
26
|
import Vi from "lodash.omit";
|
|
27
|
-
var
|
|
27
|
+
var Ie = /* @__PURE__ */ ((n) => (n.Data = "Data", n.Font = "Font", n.Frame = "Frame", n.Illustration = "Illustration", n.Image = "Image", n.Model = "Model", n.Material = "Material", n.Color = "Color", n.QuestionnaireCollateral = "QuestionnaireCollateral", n.RequestCollateral = "RequestCollateral", n.SignupCollateral = "SignupCollateral", n.Video = "Video", n.ColorProfile = "ColorProfile", n.Environment = "Environment", n))(Ie || {}), En = /* @__PURE__ */ ((n) => (n.AND = "AND", n.OR = "OR", n))(En || {}), G = /* @__PURE__ */ ((n) => (n.FileUpload = "FileUpload", n.Option = "Option", n.ColorOption = "ColorOption", n.Text = "Text", n))(G || {}), v = /* @__PURE__ */ ((n) => (n.Information = "Information", n.Bulk = "Bulk", n.DigitalContent = "DigitalContent", n.Finish = "Finish", n.Frame = "Frame", n.Illustration = "Illustration", n.Introduction = "Introduction", n.Material = "Material", n.Model = "Model", n.Module = "Module", n.Picture = "Picture", n.Photo = "Photo", n.ProductOverlay = "ProductOverlay", n.Question = "Question", n.Shape = "Shape", n.SilentIllustration = "SilentIllustration", n.Text = "Text", n))(v || {}), zi = /* @__PURE__ */ ((n) => (n.Color = "Color", n.Colors = "Colors", n.Selection = "Selection", n.Selections = "Selections", n.Text = "Text", n.Upload = "Upload", n))(zi || {}), Kt = /* @__PURE__ */ ((n) => (n.ThreeD = "ThreeD", n.FreeDesign = "FreeDesign", n.Print = "Print", n))(Kt || {}), F = /* @__PURE__ */ ((n) => (n.Frame = "frame", n.Group = "group", n.Image = "image", n.Pattern = "pattern", n.Illustration = "illustration", n.Textbox = "textbox", n))(F || {}), Gi = /* @__PURE__ */ ((n) => (n.Default = "Default", n.FirstTransaction = "FirstTransaction", n.OneToOne = "OneToOne", n))(Gi || {}), bn = /* @__PURE__ */ ((n) => (n.Pending = "Pending", n.Failed = "Failed", n.Validated = "Validated", n.Overridden = "Overridden", n))(bn || {}), Wi = /* @__PURE__ */ ((n) => (n.Hyperlink = "Hyperlink", n.Edit = "Edit", n.Approve = "Approve", n))(Wi || {}), qi = /* @__PURE__ */ ((n) => (n.Hub = "Hub", n.Shopify = "Shopify", n))(qi || {}), Ea = /* @__PURE__ */ ((n) => (n.BackgroundRemover = "BackgroundRemover", n.ConversionAccelerator = "Conversion Accelerator", n.ProcessBuilder = "ProcessBuilder", n))(Ea || {}), Hi = /* @__PURE__ */ ((n) => (n[n.Orbit = 0] = "Orbit", n[n.Pan = 1] = "Pan", n))(Hi || {}), Be = /* @__PURE__ */ ((n) => (n.Owner = "Owner", n.Approver = "Approver", n.Editor = "Editor", n.Viewer = "Viewer", n))(Be || {}), Tt = /* @__PURE__ */ ((n) => (n.Autosize = "Autosize", n.Traditional = "Traditional", n))(Tt || {}), Y = /* @__PURE__ */ ((n) => (n[n.North = 0] = "North", n[n.Northeast = 1] = "Northeast", n[n.East = 2] = "East", n[n.Southeast = 3] = "Southeast", n[n.South = 4] = "South", n[n.Southwest = 5] = "Southwest", n[n.West = 6] = "West", n[n.Northwest = 7] = "Northwest", n))(Y || {}), ji = /* @__PURE__ */ ((n) => (n.Pixel = "px", n.Millimeter = "mm", n.Centimeter = "cm", n))(ji || {});
|
|
28
28
|
class In extends Error {
|
|
29
29
|
constructor(t) {
|
|
30
30
|
super(t), this.name = this.constructor.name;
|
|
@@ -35,7 +35,7 @@ class ae extends In {
|
|
|
35
35
|
super(`ConfigurationError - ${t}`);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
class
|
|
38
|
+
class Pe extends ae {
|
|
39
39
|
constructor(t) {
|
|
40
40
|
super(`Option not Configured: ${t.stepTitle}`), this.optionId = t?.optionId || "N/A";
|
|
41
41
|
}
|
|
@@ -55,32 +55,32 @@ class _t extends ae {
|
|
|
55
55
|
super(`Resource not found for asset: ${t.name}`), this.asset = t;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
class
|
|
58
|
+
class De extends ae {
|
|
59
59
|
constructor(t, e) {
|
|
60
60
|
super(`Workflow Misconfiguration: ${t.stepName} - ${e}`), this.step = t;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
class
|
|
63
|
+
class Qe extends In {
|
|
64
64
|
constructor(t) {
|
|
65
65
|
super(`ImplementationError - ${t}`);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
class R extends
|
|
68
|
+
class R extends Qe {
|
|
69
69
|
constructor(t) {
|
|
70
70
|
super(`Unhandled Behavior Encountered: ${t}`);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
class
|
|
73
|
+
class Ft extends Qe {
|
|
74
74
|
constructor(t) {
|
|
75
75
|
super(`Parsing Error: ${t}`);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
class gt extends
|
|
78
|
+
class gt extends Qe {
|
|
79
79
|
constructor(t) {
|
|
80
80
|
super(`Client Error: ${t}`);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
class
|
|
83
|
+
class Re extends Qe {
|
|
84
84
|
constructor(t) {
|
|
85
85
|
super(`Resource Generation Failed: ${t}`);
|
|
86
86
|
}
|
|
@@ -105,7 +105,7 @@ class Yi {
|
|
|
105
105
|
this.set(t, a);
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
class
|
|
108
|
+
class Ga {
|
|
109
109
|
constructor() {
|
|
110
110
|
this.storage = /* @__PURE__ */ new Map();
|
|
111
111
|
}
|
|
@@ -130,9 +130,9 @@ class Wa {
|
|
|
130
130
|
}
|
|
131
131
|
const Ji = () => {
|
|
132
132
|
try {
|
|
133
|
-
return localStorage ? new Yi() : new
|
|
133
|
+
return localStorage ? new Yi() : new Ga();
|
|
134
134
|
} catch {
|
|
135
|
-
return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."), new
|
|
135
|
+
return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."), new Ga();
|
|
136
136
|
}
|
|
137
137
|
}, k = Ji();
|
|
138
138
|
class Ki {
|
|
@@ -162,42 +162,42 @@ class Ki {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
const ft = new Ki();
|
|
165
|
-
let
|
|
165
|
+
let da, Aa;
|
|
166
166
|
function id(n) {
|
|
167
|
-
|
|
167
|
+
da = n;
|
|
168
168
|
}
|
|
169
169
|
function rd(n) {
|
|
170
|
-
|
|
170
|
+
Aa = n;
|
|
171
171
|
}
|
|
172
172
|
function ne() {
|
|
173
|
-
return
|
|
173
|
+
return da ? new da().window : (console.log(
|
|
174
174
|
"DOM constructor is not registered. Assuming browser environment. If not, please register DOM constructor before calling this function."
|
|
175
175
|
), window);
|
|
176
176
|
}
|
|
177
177
|
function it(n, t) {
|
|
178
|
-
if (!
|
|
178
|
+
if (!Aa) {
|
|
179
179
|
if (typeof window < "u" && window.fetch)
|
|
180
180
|
return window.fetch(n, t);
|
|
181
181
|
if (typeof global < "u" && global.fetch)
|
|
182
182
|
return global.fetch(n, t);
|
|
183
183
|
throw new Error("Fetch implementation is not registered. Please register it before calling this function.");
|
|
184
184
|
}
|
|
185
|
-
return
|
|
185
|
+
return Aa(n, t);
|
|
186
186
|
}
|
|
187
|
-
const Bn = /* @__PURE__ */ new Map(),
|
|
188
|
-
const t =
|
|
187
|
+
const Bn = /* @__PURE__ */ new Map(), Wa = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Pn = async (n) => {
|
|
188
|
+
const t = Wa.get(n);
|
|
189
189
|
if (t) return t;
|
|
190
190
|
const a = (async () => {
|
|
191
191
|
const i = await it(n);
|
|
192
192
|
return Bn.set(n, i.headers?.get("content-type") || ""), await i.arrayBuffer();
|
|
193
193
|
})();
|
|
194
|
-
return
|
|
194
|
+
return Wa.set(n, a), a;
|
|
195
195
|
}, _i = async (n) => {
|
|
196
|
-
const t =
|
|
196
|
+
const t = qa.get(n);
|
|
197
197
|
if (t) return t;
|
|
198
198
|
const a = (async () => await (await it(n)).text())();
|
|
199
|
-
return
|
|
200
|
-
}, Nt = (n) => n.every((t) => t !== "undefined"),
|
|
199
|
+
return qa.set(n, a), a;
|
|
200
|
+
}, Nt = (n) => n.every((t) => t !== "undefined"), de = (n) => Nt([typeof document]) ? document.createElement(n) : ne().document.createElement(n), Xi = (n, t) => {
|
|
201
201
|
if (Nt([typeof document]))
|
|
202
202
|
return document.createElementNS(n, t);
|
|
203
203
|
const a = ne().document.createElement(t);
|
|
@@ -207,7 +207,7 @@ const Bn = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Ha = /* @_
|
|
|
207
207
|
return new DOMParser();
|
|
208
208
|
const n = ne();
|
|
209
209
|
return new n.DOMParser();
|
|
210
|
-
}, Zi = () => Nt([typeof DOMParser]) ? DOMParser : ne().DOMParser,
|
|
210
|
+
}, Zi = () => Nt([typeof DOMParser]) ? DOMParser : ne().DOMParser, Oe = (n, t) => new Promise((e, a) => {
|
|
211
211
|
t ? Pn(n).then(e).catch(a) : it(n).then((i) => {
|
|
212
212
|
i.arrayBuffer().then(e).catch(a);
|
|
213
213
|
}).catch((i) => {
|
|
@@ -217,7 +217,7 @@ const Bn = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Ha = /* @_
|
|
|
217
217
|
t ? _i(n).then(e).catch(a) : it(n).then((i) => {
|
|
218
218
|
i.text().then(e).catch(a);
|
|
219
219
|
}).catch(a);
|
|
220
|
-
}),
|
|
220
|
+
}), Dn = (n) => ki(n), je = /* @__PURE__ */ new Map(), tr = async (n, t) => {
|
|
221
221
|
if (Nt([typeof FontFace])) {
|
|
222
222
|
if (je.has(t))
|
|
223
223
|
return je.get(t);
|
|
@@ -231,7 +231,7 @@ const Bn = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Ha = /* @_
|
|
|
231
231
|
return new XMLSerializer();
|
|
232
232
|
const n = ne();
|
|
233
233
|
return new n.XMLSerializer();
|
|
234
|
-
},
|
|
234
|
+
}, Ha = (n) => btoa(n), $e = (n) => {
|
|
235
235
|
function t() {
|
|
236
236
|
const a = new Uint8Array(n), i = 4;
|
|
237
237
|
if (a.length >= i) {
|
|
@@ -258,7 +258,7 @@ const Bn = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Ha = /* @_
|
|
|
258
258
|
const e = t();
|
|
259
259
|
return e || "image/svg+xml";
|
|
260
260
|
}, od = async (n) => {
|
|
261
|
-
const t = await Pn(n), e = Bn.get(n) ||
|
|
261
|
+
const t = await Pn(n), e = Bn.get(n) || $e(t);
|
|
262
262
|
return await nr(new Blob([t], { type: e }));
|
|
263
263
|
}, er = (n) => {
|
|
264
264
|
let t = "";
|
|
@@ -267,9 +267,9 @@ const Bn = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Ha = /* @_
|
|
|
267
267
|
t += String.fromCharCode(n[a]);
|
|
268
268
|
return t;
|
|
269
269
|
}, ar = async (n) => {
|
|
270
|
-
const t =
|
|
270
|
+
const t = $e(n), e = new Uint8Array(n), a = er(e), i = btoa(a);
|
|
271
271
|
return `data:${t};base64,${i}`;
|
|
272
|
-
},
|
|
272
|
+
}, ba = (n) => `data:image/svg+xml;base64,${btoa(n)}`, Fn = (n) => {
|
|
273
273
|
const t = n.replace(/\r?\n/g, ""), e = t.indexOf(",");
|
|
274
274
|
if (e === -1 || e <= 4)
|
|
275
275
|
throw new TypeError("malformed data: URI");
|
|
@@ -288,10 +288,10 @@ const Bn = /* @__PURE__ */ new Map(), qa = /* @__PURE__ */ new Map(), Ha = /* @_
|
|
|
288
288
|
!r || !r.result ? e() : t(r.result.toString());
|
|
289
289
|
}, a.readAsDataURL(n);
|
|
290
290
|
});
|
|
291
|
-
let ir,
|
|
291
|
+
let ir, Ia;
|
|
292
292
|
const rr = (n) => {
|
|
293
|
-
|
|
294
|
-
}, or = () =>
|
|
293
|
+
Ia = n;
|
|
294
|
+
}, or = () => Ia;
|
|
295
295
|
let xn;
|
|
296
296
|
const sr = (n) => {
|
|
297
297
|
xn = n;
|
|
@@ -302,7 +302,7 @@ const sr = (n) => {
|
|
|
302
302
|
window.parent !== window && (window.addEventListener("message", e, !1), window.parent.postMessage("ready", t));
|
|
303
303
|
}), cr = async () => {
|
|
304
304
|
const n = {
|
|
305
|
-
applicationKey:
|
|
305
|
+
applicationKey: Ia,
|
|
306
306
|
customerToken: ir,
|
|
307
307
|
bearer: xn
|
|
308
308
|
};
|
|
@@ -329,7 +329,7 @@ class Ar {
|
|
|
329
329
|
const t = Ii({
|
|
330
330
|
uri: `${ft.getServerUrl()}/graphql`,
|
|
331
331
|
fetch: dr
|
|
332
|
-
}), e =
|
|
332
|
+
}), e = Fi(async (r, o) => {
|
|
333
333
|
const { headers: s } = o, l = s || {}, c = await cr();
|
|
334
334
|
let d = o.bearer ?? c.bearer;
|
|
335
335
|
if (this.spiffClient)
|
|
@@ -342,9 +342,9 @@ class Ar {
|
|
|
342
342
|
if (window && window.__SENTRY__) {
|
|
343
343
|
const f = window.__SENTRY__.hub;
|
|
344
344
|
if (f) {
|
|
345
|
-
const
|
|
346
|
-
Object.entries(
|
|
347
|
-
l[
|
|
345
|
+
const S = f.traceHeaders();
|
|
346
|
+
Object.entries(S).forEach(([w, I]) => {
|
|
347
|
+
l[w] = I;
|
|
348
348
|
});
|
|
349
349
|
}
|
|
350
350
|
}
|
|
@@ -358,17 +358,17 @@ class Ar {
|
|
|
358
358
|
s && !c?.fetchOptions?.signal?.aborted && console.log("GraphQL Network error"), l.forEach(() => console.log("GraphQL Error: " + r.operationName));
|
|
359
359
|
}), i = Mi();
|
|
360
360
|
return new Bi({
|
|
361
|
-
link:
|
|
361
|
+
link: Di([i, a, e, t]),
|
|
362
362
|
cache: new Pi(),
|
|
363
363
|
name: "Core"
|
|
364
364
|
});
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
const y = new Ar();
|
|
368
|
-
let
|
|
368
|
+
let ua, ha;
|
|
369
369
|
const Ct = (n, t, e) => {
|
|
370
|
-
if (
|
|
371
|
-
return
|
|
370
|
+
if (ua !== void 0)
|
|
371
|
+
return ua(n, t, e);
|
|
372
372
|
try {
|
|
373
373
|
const a = Mn(!0);
|
|
374
374
|
return kn(a), a.createCanvas(n, t, e);
|
|
@@ -376,8 +376,8 @@ const Ct = (n, t, e) => {
|
|
|
376
376
|
throw new Error("Canvas module not set");
|
|
377
377
|
}
|
|
378
378
|
}, ie = (n, t) => {
|
|
379
|
-
if (
|
|
380
|
-
return
|
|
379
|
+
if (ha !== void 0)
|
|
380
|
+
return ha(n, t);
|
|
381
381
|
try {
|
|
382
382
|
const e = Mn(!0);
|
|
383
383
|
return kn(e), e.loadImage(n, t);
|
|
@@ -386,7 +386,7 @@ const Ct = (n, t, e) => {
|
|
|
386
386
|
}
|
|
387
387
|
};
|
|
388
388
|
function kn(n) {
|
|
389
|
-
|
|
389
|
+
ua = n?.createCanvas, ha = n?.loadImage;
|
|
390
390
|
}
|
|
391
391
|
function Mn(n) {
|
|
392
392
|
try {
|
|
@@ -408,19 +408,19 @@ function Mn(n) {
|
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
let Ye;
|
|
411
|
-
function
|
|
411
|
+
function Ba() {
|
|
412
412
|
return Ye === void 0 && (Ye = Zi()), Ye;
|
|
413
413
|
}
|
|
414
|
-
let
|
|
414
|
+
let Ae = null;
|
|
415
415
|
const ur = (n) => new Promise((t) => {
|
|
416
|
-
if (
|
|
416
|
+
if ($e(n) !== "image/jpeg")
|
|
417
417
|
return t(1);
|
|
418
418
|
Ti(n).then((a) => t(a || 1)).catch(() => t(1));
|
|
419
419
|
}), hr = async () => {
|
|
420
|
-
if (
|
|
421
|
-
return !
|
|
420
|
+
if (Ae !== null)
|
|
421
|
+
return !Ae;
|
|
422
422
|
const t = await ie("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAIAAwMBEQACEQEDEQH/xABRAAEAAAAAAAAAAAAAAAAAAAAKEAEBAQADAQEAAAAAAAAAAAAGBQQDCAkCBwEBAAAAAAAAAAAAAAAAAAAAABEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AG8T9NfSMEVMhQvoP3fFiRZ+MTHDifa/95OFSZU5OzRzxkyejv8ciEfhSceSXGjS8eSdLnZc2HDm4M3BxcXwH/9k=");
|
|
423
|
-
return
|
|
423
|
+
return Ae = t.width === 2 && t.height === 3, !Ae;
|
|
424
424
|
}, mr = (n) => {
|
|
425
425
|
const e = n.naturalWidth / n.naturalHeight;
|
|
426
426
|
return n.naturalHeight <= 8192 && n.naturalWidth <= 8192 ? [n.naturalWidth, n.naturalHeight] : n.naturalHeight > n.naturalWidth ? [e * 8192, 8192] : [8192, 8192 / e];
|
|
@@ -455,9 +455,9 @@ const ur = (n) => new Promise((t) => {
|
|
|
455
455
|
break;
|
|
456
456
|
}
|
|
457
457
|
return d.drawImage(e, 0, 0, s, l), c;
|
|
458
|
-
},
|
|
458
|
+
}, Ue = async (n) => {
|
|
459
459
|
const t = await gr(n);
|
|
460
|
-
return
|
|
460
|
+
return $e(n) === "image/jpeg" ? {
|
|
461
461
|
dataUrl: t.toDataURL("image/jpeg", 1),
|
|
462
462
|
height: t.height,
|
|
463
463
|
width: t.width
|
|
@@ -3188,20 +3188,20 @@ function cd(n, t) {
|
|
|
3188
3188
|
let Ot = null;
|
|
3189
3189
|
function wr(n) {
|
|
3190
3190
|
if (n.startsWith("#"))
|
|
3191
|
-
return
|
|
3191
|
+
return ja(n);
|
|
3192
3192
|
if (!document)
|
|
3193
3193
|
throw new Error("browserColorToHex is only supported on browsers");
|
|
3194
3194
|
if (Ot || (Ot = document.createElement("canvas").getContext("2d")), !Ot)
|
|
3195
3195
|
throw new Error("Failed to create canvas context required to convert colors");
|
|
3196
3196
|
Ot.fillStyle = n;
|
|
3197
|
-
const t =
|
|
3197
|
+
const t = ja(Ot.fillStyle);
|
|
3198
3198
|
return t || console.error(`Unknown browser color ${n}`), t;
|
|
3199
3199
|
}
|
|
3200
|
-
function
|
|
3200
|
+
function ja(n) {
|
|
3201
3201
|
const t = n.substring(1).toUpperCase();
|
|
3202
3202
|
return t.length === 6 ? t : t.length === 3 ? `${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}` : "";
|
|
3203
3203
|
}
|
|
3204
|
-
const
|
|
3204
|
+
const ue = (n) => {
|
|
3205
3205
|
const t = Tn(n.spotColor);
|
|
3206
3206
|
return t ? `${n.browserValue} ${t}` : n.browserValue;
|
|
3207
3207
|
}, Tn = (n) => {
|
|
@@ -3212,7 +3212,7 @@ const me = (n) => {
|
|
|
3212
3212
|
return `icc-named-color(${t.slice(e + 1).slice(0, -4)}, ${n.namedColor})`;
|
|
3213
3213
|
}
|
|
3214
3214
|
return `icc-named-color(${n.profileName}, ${n.namedColor})`;
|
|
3215
|
-
},
|
|
3215
|
+
}, Ya = (n) => {
|
|
3216
3216
|
const t = n.split(/[ ](?=[^)]*?(?:\(|$))/);
|
|
3217
3217
|
if (t.length === 0)
|
|
3218
3218
|
return { browserValue: "#000000" };
|
|
@@ -3234,7 +3234,7 @@ const me = (n) => {
|
|
|
3234
3234
|
} catch {
|
|
3235
3235
|
return n.classList.contains(t.substring(1));
|
|
3236
3236
|
}
|
|
3237
|
-
},
|
|
3237
|
+
}, Pa = (n, t = !1) => {
|
|
3238
3238
|
!t && n.setAttribute("preserveAspectRatio", "none");
|
|
3239
3239
|
const e = [];
|
|
3240
3240
|
Mt(n, (a) => {
|
|
@@ -3287,13 +3287,13 @@ const me = (n) => {
|
|
|
3287
3287
|
if (s)
|
|
3288
3288
|
a.setAttribute(
|
|
3289
3289
|
"fill",
|
|
3290
|
-
e ?
|
|
3290
|
+
e ? ue(s) : s.browserValue
|
|
3291
3291
|
);
|
|
3292
3292
|
else {
|
|
3293
3293
|
const l = t[o];
|
|
3294
3294
|
l && a.setAttribute(
|
|
3295
3295
|
"fill",
|
|
3296
|
-
e ?
|
|
3296
|
+
e ? ue(l) : l.browserValue
|
|
3297
3297
|
);
|
|
3298
3298
|
}
|
|
3299
3299
|
}
|
|
@@ -3305,13 +3305,13 @@ const me = (n) => {
|
|
|
3305
3305
|
if (s)
|
|
3306
3306
|
a.setAttribute(
|
|
3307
3307
|
"stroke",
|
|
3308
|
-
e ?
|
|
3308
|
+
e ? ue(s) : s.browserValue
|
|
3309
3309
|
);
|
|
3310
3310
|
else {
|
|
3311
3311
|
const l = t[o];
|
|
3312
3312
|
l && a.setAttribute(
|
|
3313
3313
|
"fill",
|
|
3314
|
-
e ?
|
|
3314
|
+
e ? ue(l) : l.browserValue
|
|
3315
3315
|
);
|
|
3316
3316
|
}
|
|
3317
3317
|
}
|
|
@@ -3322,7 +3322,7 @@ const me = (n) => {
|
|
|
3322
3322
|
if (!r)
|
|
3323
3323
|
throw new Error("Failed to read SVG.");
|
|
3324
3324
|
return Er(r, t, e), Qn(r, a, i), Rn(r);
|
|
3325
|
-
},
|
|
3325
|
+
}, Fa = (n, t, e) => {
|
|
3326
3326
|
const a = Nn(n);
|
|
3327
3327
|
if (!a)
|
|
3328
3328
|
throw new Error("Failed to read SVG.");
|
|
@@ -3334,17 +3334,17 @@ const me = (n) => {
|
|
|
3334
3334
|
const e = br(n).firstElementChild;
|
|
3335
3335
|
if (!e)
|
|
3336
3336
|
throw new Error("Failed to read SVG.");
|
|
3337
|
-
|
|
3337
|
+
Pa(e);
|
|
3338
3338
|
const a = {};
|
|
3339
3339
|
Mt(e, (o) => {
|
|
3340
3340
|
const s = o.attributes.getNamedItem("fill");
|
|
3341
3341
|
if (s && s.value !== "none" && !s.value.startsWith("url(")) {
|
|
3342
|
-
const c =
|
|
3342
|
+
const c = Ya(s.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-fill-${d}`;
|
|
3343
3343
|
o.setAttribute("fill", c.browserValue), o.classList.add(A), a[d] = c;
|
|
3344
3344
|
}
|
|
3345
3345
|
const l = o.attributes.getNamedItem("stroke");
|
|
3346
3346
|
if (l && l.value !== "none" && !l.value.startsWith("url(")) {
|
|
3347
|
-
const c =
|
|
3347
|
+
const c = Ya(l.value), d = c.browserValue.replace(/\W/g, ""), A = `spiff-stroke-${d}`;
|
|
3348
3348
|
o.classList.add(A), o.setAttribute("stroke", c.browserValue), a[d] = c;
|
|
3349
3349
|
}
|
|
3350
3350
|
});
|
|
@@ -3410,7 +3410,7 @@ const me = (n) => {
|
|
|
3410
3410
|
...AssetFields
|
|
3411
3411
|
}
|
|
3412
3412
|
}
|
|
3413
|
-
`,
|
|
3413
|
+
`, xa = C`
|
|
3414
3414
|
fragment MaterialFields on Material {
|
|
3415
3415
|
id
|
|
3416
3416
|
name
|
|
@@ -3458,13 +3458,13 @@ const me = (n) => {
|
|
|
3458
3458
|
}
|
|
3459
3459
|
}
|
|
3460
3460
|
`, Pr = C`
|
|
3461
|
-
${
|
|
3461
|
+
${xa}
|
|
3462
3462
|
query GetMaterials($ids: [String]) {
|
|
3463
3463
|
materials(id: $ids) {
|
|
3464
3464
|
...MaterialFields
|
|
3465
3465
|
}
|
|
3466
3466
|
}
|
|
3467
|
-
`,
|
|
3467
|
+
`, Dr = C`
|
|
3468
3468
|
mutation CreateAsset($name: String!, $type: String!, $mimeType: String!, $anonymous: Boolean, $temporary: Boolean) {
|
|
3469
3469
|
assetCreate(name: $name, type: $type, mimeType: $mimeType, anonymous: $anonymous, temporary: $temporary) {
|
|
3470
3470
|
uploadUrl
|
|
@@ -3478,14 +3478,14 @@ const me = (n) => {
|
|
|
3478
3478
|
}
|
|
3479
3479
|
}
|
|
3480
3480
|
}
|
|
3481
|
-
`,
|
|
3481
|
+
`, Fr = C`
|
|
3482
3482
|
${re(!1)}
|
|
3483
3483
|
mutation RemoveBackgroundFromAsset($key: String!) {
|
|
3484
3484
|
assetRemoveBackground(key: $key) {
|
|
3485
3485
|
...AssetFields
|
|
3486
3486
|
}
|
|
3487
3487
|
}
|
|
3488
|
-
`,
|
|
3488
|
+
`, Fe = async (n) => (await y.getShadowGraphqlClient().query({
|
|
3489
3489
|
query: Br,
|
|
3490
3490
|
errorPolicy: "all",
|
|
3491
3491
|
fetchPolicy: "no-cache",
|
|
@@ -3499,7 +3499,7 @@ const me = (n) => {
|
|
|
3499
3499
|
ids: n
|
|
3500
3500
|
}
|
|
3501
3501
|
})).data.materials, kr = async (n, t, e, a, i) => (await y.getShadowGraphqlClient().mutate({
|
|
3502
|
-
mutation:
|
|
3502
|
+
mutation: Dr,
|
|
3503
3503
|
errorPolicy: "all",
|
|
3504
3504
|
fetchPolicy: "no-cache",
|
|
3505
3505
|
variables: {
|
|
@@ -3513,7 +3513,7 @@ const me = (n) => {
|
|
|
3513
3513
|
class Mr {
|
|
3514
3514
|
constructor() {
|
|
3515
3515
|
this.cache = /* @__PURE__ */ new Map(), this.bgrmProcessCache = /* @__PURE__ */ new Map(), this.materialCache = /* @__PURE__ */ new Map(), this.loadImageAsFileInfo = async (t) => {
|
|
3516
|
-
const e = await t.arrayBuffer(), a = await
|
|
3516
|
+
const e = await t.arrayBuffer(), a = await Ue(e), i = (r, o) => {
|
|
3517
3517
|
const s = atob(r.split(",")[1]), l = [];
|
|
3518
3518
|
for (let c = 0; c < s.length; c++)
|
|
3519
3519
|
l.push(s.charCodeAt(c));
|
|
@@ -3534,14 +3534,14 @@ class Mr {
|
|
|
3534
3534
|
if (!i) throw new R("Failed to get asset from cache!");
|
|
3535
3535
|
return i;
|
|
3536
3536
|
}
|
|
3537
|
-
const a = (async () => (await
|
|
3537
|
+
const a = (async () => (await Fe([t]))[0])();
|
|
3538
3538
|
return this.cache.set(t, a), a;
|
|
3539
3539
|
}
|
|
3540
3540
|
/**
|
|
3541
3541
|
* Retrieves the asset from the server, bypassing cache (but still writing the result to cache)
|
|
3542
3542
|
*/
|
|
3543
3543
|
async getFromServer(t) {
|
|
3544
|
-
const a = (async () => (await
|
|
3544
|
+
const a = (async () => (await Fe([t]))[0])();
|
|
3545
3545
|
return this.cache.set(t, a), a;
|
|
3546
3546
|
}
|
|
3547
3547
|
keyFromURL(t) {
|
|
@@ -3600,7 +3600,7 @@ class Mr {
|
|
|
3600
3600
|
}, a, i);
|
|
3601
3601
|
}
|
|
3602
3602
|
async uploadFile(t, e) {
|
|
3603
|
-
const i = this.isRaster(t) ?
|
|
3603
|
+
const i = this.isRaster(t) ? Ie.Image : Ie.Illustration, r = await this.loadImageAsFileInfo(t);
|
|
3604
3604
|
return await this.uploadAssetWithProgress(r, i, e, !0);
|
|
3605
3605
|
}
|
|
3606
3606
|
async removeBackgroundFromAsset(t) {
|
|
@@ -3613,7 +3613,7 @@ class Mr {
|
|
|
3613
3613
|
}
|
|
3614
3614
|
const i = (async () => {
|
|
3615
3615
|
const r = await y.getShadowGraphqlClient().mutate({
|
|
3616
|
-
mutation:
|
|
3616
|
+
mutation: Fr,
|
|
3617
3617
|
fetchPolicy: "no-cache",
|
|
3618
3618
|
errorPolicy: "all",
|
|
3619
3619
|
variables: {
|
|
@@ -3647,7 +3647,7 @@ class Mr {
|
|
|
3647
3647
|
async postProcessFileUpload(t, e) {
|
|
3648
3648
|
if (e === "image/svg+xml") {
|
|
3649
3649
|
const a = await t.blob.text(), o = new window.DOMParser().parseFromString(a, "image/svg+xml").documentElement;
|
|
3650
|
-
if (!o) throw new
|
|
3650
|
+
if (!o) throw new Ft("Failed to read SVG.");
|
|
3651
3651
|
vr(o);
|
|
3652
3652
|
const l = Pt().serializeToString(o);
|
|
3653
3653
|
return {
|
|
@@ -3736,7 +3736,7 @@ const $t = "persistentAssets", ct = class ct {
|
|
|
3736
3736
|
};
|
|
3737
3737
|
ct.callbacks = [];
|
|
3738
3738
|
let ht = ct;
|
|
3739
|
-
const
|
|
3739
|
+
const Ja = "bgrmPersistentAssets";
|
|
3740
3740
|
class _ {
|
|
3741
3741
|
static has(t) {
|
|
3742
3742
|
return _.getMap().has(t);
|
|
@@ -3763,10 +3763,10 @@ class _ {
|
|
|
3763
3763
|
a && (e.delete(a), _.setMap(e));
|
|
3764
3764
|
}
|
|
3765
3765
|
static getMap() {
|
|
3766
|
-
return k.getMap(
|
|
3766
|
+
return k.getMap(Ja) || /* @__PURE__ */ new Map();
|
|
3767
3767
|
}
|
|
3768
3768
|
static setMap(t) {
|
|
3769
|
-
k.setMap(
|
|
3769
|
+
k.setMap(Ja, t);
|
|
3770
3770
|
}
|
|
3771
3771
|
}
|
|
3772
3772
|
const V = new Mr();
|
|
@@ -3842,7 +3842,7 @@ const Zt = new Tr(), On = C`
|
|
|
3842
3842
|
}
|
|
3843
3843
|
`, Nr = C`
|
|
3844
3844
|
${re(!1)}
|
|
3845
|
-
${
|
|
3845
|
+
${xa}
|
|
3846
3846
|
${On}
|
|
3847
3847
|
query GetOptions($ids: [String]!) {
|
|
3848
3848
|
options(ids: $ids) {
|
|
@@ -3931,7 +3931,7 @@ const J = new $r(), $n = C`
|
|
|
3931
3931
|
currencyCode
|
|
3932
3932
|
}
|
|
3933
3933
|
}
|
|
3934
|
-
`,
|
|
3934
|
+
`, Le = C`
|
|
3935
3935
|
fragment AdditionalIntegrationProductFields on IntegrationProduct {
|
|
3936
3936
|
id
|
|
3937
3937
|
product {
|
|
@@ -4046,7 +4046,7 @@ const J = new $r(), $n = C`
|
|
|
4046
4046
|
url
|
|
4047
4047
|
}
|
|
4048
4048
|
`, Lr = C`
|
|
4049
|
-
${
|
|
4049
|
+
${Le}
|
|
4050
4050
|
${oe}
|
|
4051
4051
|
${$n}
|
|
4052
4052
|
query ReadIntegrationProducts($ids: [String!]!) {
|
|
@@ -4292,7 +4292,7 @@ const J = new $r(), $n = C`
|
|
|
4292
4292
|
}
|
|
4293
4293
|
}
|
|
4294
4294
|
`, Gn = (n) => C`
|
|
4295
|
-
${
|
|
4295
|
+
${Le}
|
|
4296
4296
|
fragment IntegrationProductFields on IntegrationProduct {
|
|
4297
4297
|
id
|
|
4298
4298
|
externalProductId
|
|
@@ -4529,7 +4529,7 @@ const J = new $r(), $n = C`
|
|
|
4529
4529
|
}
|
|
4530
4530
|
`, ao = (n) => C`
|
|
4531
4531
|
${re(n)}
|
|
4532
|
-
${
|
|
4532
|
+
${xa}
|
|
4533
4533
|
${On}
|
|
4534
4534
|
${Xr}
|
|
4535
4535
|
${Zr}
|
|
@@ -4973,7 +4973,7 @@ const J = new $r(), $n = C`
|
|
|
4973
4973
|
}
|
|
4974
4974
|
}
|
|
4975
4975
|
}
|
|
4976
|
-
`,
|
|
4976
|
+
`, Ve = C`
|
|
4977
4977
|
${oe}
|
|
4978
4978
|
fragment MarketplaceThemeInstallConfigurationFields on MarketplaceThemeInstallConfiguration {
|
|
4979
4979
|
id
|
|
@@ -5042,7 +5042,7 @@ const J = new $r(), $n = C`
|
|
|
5042
5042
|
}
|
|
5043
5043
|
}
|
|
5044
5044
|
`, ro = C`
|
|
5045
|
-
${
|
|
5045
|
+
${Ve}
|
|
5046
5046
|
query GetMarketplaceThemeInstallConfiguration($themeConfigurationId: String!, $themeInstallId: String!) {
|
|
5047
5047
|
marketplaceThemeInstallConfiguration(id: $themeConfigurationId, themeInstallId: $themeInstallId, raw: false) {
|
|
5048
5048
|
...MarketplaceThemeInstallConfigurationFields
|
|
@@ -5050,7 +5050,7 @@ const J = new $r(), $n = C`
|
|
|
5050
5050
|
}
|
|
5051
5051
|
`, oo = C`
|
|
5052
5052
|
${$n}
|
|
5053
|
-
${
|
|
5053
|
+
${Ve}
|
|
5054
5054
|
query GetCurrentIntegration($themeConfigurationId: String) {
|
|
5055
5055
|
currentIntegration {
|
|
5056
5056
|
id
|
|
@@ -5062,7 +5062,7 @@ const J = new $r(), $n = C`
|
|
|
5062
5062
|
}
|
|
5063
5063
|
}
|
|
5064
5064
|
`, so = C`
|
|
5065
|
-
${
|
|
5065
|
+
${Ve}
|
|
5066
5066
|
query ReadTransactionForMarketplaceTheme($id: String!) {
|
|
5067
5067
|
transactions(ids: [$id]) {
|
|
5068
5068
|
marketplaceThemeInstallConfiguration(raw: false) {
|
|
@@ -5071,7 +5071,7 @@ const J = new $r(), $n = C`
|
|
|
5071
5071
|
}
|
|
5072
5072
|
}
|
|
5073
5073
|
`, lo = C`
|
|
5074
|
-
${
|
|
5074
|
+
${Ve}
|
|
5075
5075
|
query ReadBundleForMarketplaceTheme($id: String!) {
|
|
5076
5076
|
bundles(ids: [$id]) {
|
|
5077
5077
|
marketplaceThemeInstallConfiguration(raw: false) {
|
|
@@ -5094,14 +5094,14 @@ const J = new $r(), $n = C`
|
|
|
5094
5094
|
timestamp
|
|
5095
5095
|
}
|
|
5096
5096
|
}
|
|
5097
|
-
`, Ut = [
|
|
5097
|
+
`, Ut = [v.SilentIllustration, v.ProductOverlay], uo = async (n) => {
|
|
5098
5098
|
const t = [];
|
|
5099
5099
|
n.introduction && t.push({
|
|
5100
5100
|
name: "Introduction",
|
|
5101
5101
|
title: n.name,
|
|
5102
5102
|
renderableSteps: [
|
|
5103
5103
|
{
|
|
5104
|
-
type:
|
|
5104
|
+
type: v.Introduction,
|
|
5105
5105
|
stepName: "Introduction",
|
|
5106
5106
|
stepTitle: n.name,
|
|
5107
5107
|
helpText: n.introduction,
|
|
@@ -5136,7 +5136,7 @@ const J = new $r(), $n = C`
|
|
|
5136
5136
|
title: e,
|
|
5137
5137
|
renderableSteps: [
|
|
5138
5138
|
{
|
|
5139
|
-
type:
|
|
5139
|
+
type: v.Finish,
|
|
5140
5140
|
stepName: "Finish",
|
|
5141
5141
|
stepTitle: e,
|
|
5142
5142
|
helpText: "",
|
|
@@ -5171,7 +5171,7 @@ const J = new $r(), $n = C`
|
|
|
5171
5171
|
for (const o of a)
|
|
5172
5172
|
for (const s of o.renderableSteps) {
|
|
5173
5173
|
const l = (s.option?.variants || []).length;
|
|
5174
|
-
s.silent || (s.type ===
|
|
5174
|
+
s.silent || (s.type === v.Model || s.type === v.Material || s.type === v.Picture || s.type === v.Shape ? (l > 1 || e) && i.push(s.stepName) : i.push(s.stepName));
|
|
5175
5175
|
}
|
|
5176
5176
|
const r = a.filter((o) => o.renderableSteps.filter(
|
|
5177
5177
|
(l) => i.includes(l.stepName)
|
|
@@ -5275,14 +5275,14 @@ const M = () => {
|
|
|
5275
5275
|
viewBox: A,
|
|
5276
5276
|
width: u
|
|
5277
5277
|
}) => {
|
|
5278
|
-
const h = e || 0, m = 2 * (l?.scale || 1), p = A || { x: 0, y: 0, width: u, height: r }, g = `${p.x} ${p.y} ${p.width} ${p.height}`, f = M(),
|
|
5278
|
+
const h = e || 0, m = 2 * (l?.scale || 1), p = A || { x: 0, y: 0, width: u, height: r }, g = `${p.x} ${p.y} ${p.width} ${p.height}`, f = M(), S = a.purpose === Kt.FreeDesign && /* @__PURE__ */ P("defs", { children: /* @__PURE__ */ P("clipPath", { id: "viewboxClip", children: /* @__PURE__ */ P("rect", { width: p.width, height: p.height, rx: h }) }) }), w = a.colorProfiles?.map((E, D) => (
|
|
5279
5279
|
/* @ts-ignore */
|
|
5280
|
-
/* @__PURE__ */ P("color-profile", { name:
|
|
5281
|
-
)),
|
|
5282
|
-
...
|
|
5280
|
+
/* @__PURE__ */ P("color-profile", { name: E.name, xlinkHref: E.key, children: " " }, D)
|
|
5281
|
+
)), I = i.map((E) => ({
|
|
5282
|
+
...E,
|
|
5283
5283
|
_renderingConfiguration: a,
|
|
5284
5284
|
mask: l ? `url(#viewmask-${f})` : void 0
|
|
5285
|
-
})),
|
|
5285
|
+
})), b = Ma(I);
|
|
5286
5286
|
return /* @__PURE__ */ dt(
|
|
5287
5287
|
"svg",
|
|
5288
5288
|
{
|
|
@@ -5302,8 +5302,8 @@ const M = () => {
|
|
|
5302
5302
|
},
|
|
5303
5303
|
viewBox: g,
|
|
5304
5304
|
children: [
|
|
5305
|
-
b,
|
|
5306
5305
|
w,
|
|
5306
|
+
S,
|
|
5307
5307
|
!!n && /* @__PURE__ */ P(
|
|
5308
5308
|
"rect",
|
|
5309
5309
|
{
|
|
@@ -5319,7 +5319,7 @@ const M = () => {
|
|
|
5319
5319
|
{
|
|
5320
5320
|
id: "element-group",
|
|
5321
5321
|
clipPath: a.purpose === Kt.FreeDesign ? "url(#viewboxClip)" : void 0,
|
|
5322
|
-
children:
|
|
5322
|
+
children: b.map((E) => Zn(E)).filter((E) => !!E)
|
|
5323
5323
|
}
|
|
5324
5324
|
),
|
|
5325
5325
|
l && /* @__PURE__ */ P(
|
|
@@ -5361,12 +5361,12 @@ const M = () => {
|
|
|
5361
5361
|
}
|
|
5362
5362
|
);
|
|
5363
5363
|
}, dd = (n, t, e, a, i) => {
|
|
5364
|
-
const r = wt(i), o = e / 2, s = a / 2, l = n + o, c = t + s, d = Math.sin(r), A = Math.cos(r), u = o, h = o, m = -s, p = s, g = u * A - m * d, f = h * A - p * d,
|
|
5364
|
+
const r = wt(i), o = e / 2, s = a / 2, l = n + o, c = t + s, d = Math.sin(r), A = Math.cos(r), u = o, h = o, m = -s, p = s, g = u * A - m * d, f = h * A - p * d, S = u * d + m * A, w = h * d + p * A, I = Math.max(Math.abs(g), Math.abs(f)), b = Math.max(Math.abs(S), Math.abs(w));
|
|
5365
5365
|
return {
|
|
5366
|
-
minX: l -
|
|
5367
|
-
maxX: l +
|
|
5368
|
-
minY: c -
|
|
5369
|
-
maxY: c +
|
|
5366
|
+
minX: l - I,
|
|
5367
|
+
maxX: l + I,
|
|
5368
|
+
minY: c - b,
|
|
5369
|
+
maxY: c + b
|
|
5370
5370
|
};
|
|
5371
5371
|
}, Ad = (n, t, e) => {
|
|
5372
5372
|
const a = Math.sqrt(Math.pow(t.x - n.x, 2) + Math.pow(t.y - n.y, 2)), i = Math.sqrt(Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2)), r = Math.sqrt(Math.pow(e.x - n.x, 2) + Math.pow(e.y - n.y, 2));
|
|
@@ -5389,7 +5389,7 @@ const M = () => {
|
|
|
5389
5389
|
}), fd = (n, t, e, a) => ({
|
|
5390
5390
|
x: n.x + (t?.x + t?.width) * e,
|
|
5391
5391
|
y: n.y + (t?.y + t?.height) * a
|
|
5392
|
-
}),
|
|
5392
|
+
}), Dt = (n) => {
|
|
5393
5393
|
switch (n) {
|
|
5394
5394
|
case Y.North:
|
|
5395
5395
|
return Y.East;
|
|
@@ -5408,7 +5408,7 @@ const M = () => {
|
|
|
5408
5408
|
case Y.Southwest:
|
|
5409
5409
|
return Y.Northwest;
|
|
5410
5410
|
}
|
|
5411
|
-
}, Cd = (n, t) => t > 45 && t <= 135 ?
|
|
5411
|
+
}, Cd = (n, t) => t > 45 && t <= 135 ? Dt(n) : t > 135 && t <= 225 ? Dt(Dt(n)) : t > 225 && t <= 315 ? Dt(Dt(Dt(n))) : n, wd = (n, t = { x: 0, y: 0 }, e = { x: 1, y: 1 }) => {
|
|
5412
5412
|
const a = wt(n.rotation), i = {
|
|
5413
5413
|
x: t.x + n.x * e.x,
|
|
5414
5414
|
y: t.x + n.y * e.y
|
|
@@ -5426,13 +5426,13 @@ const M = () => {
|
|
|
5426
5426
|
y: s.y - n.height * e.y / 2
|
|
5427
5427
|
};
|
|
5428
5428
|
return {
|
|
5429
|
-
a:
|
|
5430
|
-
b:
|
|
5431
|
-
c:
|
|
5432
|
-
d:
|
|
5429
|
+
a: he(i, l, a),
|
|
5430
|
+
b: he(r, l, a),
|
|
5431
|
+
c: he(o, l, a),
|
|
5432
|
+
d: he(s, l, a),
|
|
5433
5433
|
center: l
|
|
5434
5434
|
};
|
|
5435
|
-
},
|
|
5435
|
+
}, he = (n, t, e) => {
|
|
5436
5436
|
const a = Math.sin(e), i = Math.cos(e);
|
|
5437
5437
|
return {
|
|
5438
5438
|
x: (n.x - t.x) * i - (n.y - t.y) * a + t.x,
|
|
@@ -5461,7 +5461,7 @@ const M = () => {
|
|
|
5461
5461
|
}
|
|
5462
5462
|
) });
|
|
5463
5463
|
}, jn = (n) => {
|
|
5464
|
-
const t = `spiff-group-clip-${n.id}`, e = n.rotation || 0, a = wt(e), i = Math.cos(a), r = -Math.sin(a), o =
|
|
5464
|
+
const t = `spiff-group-clip-${n.id}`, e = n.rotation || 0, a = wt(e), i = Math.cos(a), r = -Math.sin(a), o = Ma(n.children);
|
|
5465
5465
|
return /* @__PURE__ */ dt(qt, { children: [
|
|
5466
5466
|
/* @__PURE__ */ P("defs", { children: /* @__PURE__ */ P("clipPath", { id: t, preserveAspectRatio: "none", children: n.clipPath ? /* @__PURE__ */ P("path", { d: n.clipPath }) : /* @__PURE__ */ P("rect", { x: 0, y: 0, width: n.width, height: n.height }) }) }),
|
|
5467
5467
|
/* @__PURE__ */ dt(
|
|
@@ -5496,8 +5496,8 @@ const M = () => {
|
|
|
5496
5496
|
if (!n.pattern)
|
|
5497
5497
|
return "";
|
|
5498
5498
|
if (n.pattern.svg) {
|
|
5499
|
-
const A =
|
|
5500
|
-
return
|
|
5499
|
+
const A = Fa(n.pattern.svg, n.pattern.colors || {}, !1);
|
|
5500
|
+
return ba(A);
|
|
5501
5501
|
}
|
|
5502
5502
|
return n.pattern.src;
|
|
5503
5503
|
};
|
|
@@ -5526,7 +5526,7 @@ const M = () => {
|
|
|
5526
5526
|
const A = n.pattern?.x || 0, u = n.pattern?.y || 0, h = n.pattern?.width || 0, m = n.pattern?.height || 0, p = n.pattern?.scaleX || 1, g = n.pattern?.scaleY || 1, f = n.pattern?.rotation || 0;
|
|
5527
5527
|
return [n.pattern?.svg ? {
|
|
5528
5528
|
id: `${t}-contents`,
|
|
5529
|
-
type:
|
|
5529
|
+
type: F.Illustration,
|
|
5530
5530
|
x: A,
|
|
5531
5531
|
y: u,
|
|
5532
5532
|
rotation: f,
|
|
@@ -5537,7 +5537,7 @@ const M = () => {
|
|
|
5537
5537
|
colors: n.pattern?.colors
|
|
5538
5538
|
} : {
|
|
5539
5539
|
id: `${t}-contents`,
|
|
5540
|
-
type:
|
|
5540
|
+
type: F.Image,
|
|
5541
5541
|
x: A,
|
|
5542
5542
|
y: u,
|
|
5543
5543
|
rotation: f,
|
|
@@ -5640,24 +5640,24 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5640
5640
|
return yt(n).getFont();
|
|
5641
5641
|
} catch {
|
|
5642
5642
|
if (wo(n)) {
|
|
5643
|
-
const a =
|
|
5644
|
-
return
|
|
5643
|
+
const a = Fn(n), i = la(a);
|
|
5644
|
+
return ma(n, i), i;
|
|
5645
5645
|
} else {
|
|
5646
|
-
const a = await
|
|
5647
|
-
return
|
|
5646
|
+
const a = await Oe(n, !0), i = la(a);
|
|
5647
|
+
return ma(n, i), await tr(i, n), i;
|
|
5648
5648
|
}
|
|
5649
5649
|
}
|
|
5650
5650
|
})();
|
|
5651
5651
|
return Ke.set(n, e), e;
|
|
5652
5652
|
}, yo = (n) => {
|
|
5653
|
-
const t =
|
|
5654
|
-
return
|
|
5653
|
+
const t = Fn(n), e = la(t);
|
|
5654
|
+
return ma(n, e), e;
|
|
5655
5655
|
}, yt = (n) => {
|
|
5656
5656
|
const t = Yn.get(n);
|
|
5657
5657
|
if (t)
|
|
5658
5658
|
return t;
|
|
5659
5659
|
throw new Error("Font metrics unavailable for font");
|
|
5660
|
-
},
|
|
5660
|
+
}, ma = (n, t) => {
|
|
5661
5661
|
const e = new Co(t);
|
|
5662
5662
|
return Yn.set(n, e), e;
|
|
5663
5663
|
}, vd = async (n) => {
|
|
@@ -5674,37 +5674,37 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5674
5674
|
});
|
|
5675
5675
|
const o = e.querySelectorAll("tspan");
|
|
5676
5676
|
for (let d = 0; d < o.length; d++) {
|
|
5677
|
-
const A = o.item(d), u = A.closest("text"), h = A.closest("g"), m = u.getAttribute("font-family"), p = await Qt(i.get(m)), g = u.getAttribute("fill"), f = u.getAttribute("stroke"),
|
|
5677
|
+
const A = o.item(d), u = A.closest("text"), h = A.closest("g"), m = u.getAttribute("font-family"), p = await Qt(i.get(m)), g = u.getAttribute("fill"), f = u.getAttribute("stroke"), S = u.getAttribute("stroke-width"), w = p.getPath(
|
|
5678
5678
|
A.innerHTML,
|
|
5679
5679
|
0,
|
|
5680
5680
|
0,
|
|
5681
5681
|
parseInt(u.getAttribute("font-size") ?? "72")
|
|
5682
|
-
),
|
|
5683
|
-
let
|
|
5684
|
-
const
|
|
5685
|
-
|
|
5686
|
-
const
|
|
5682
|
+
), I = w.getBoundingBox().x2 - w.getBoundingBox().x1;
|
|
5683
|
+
let b = 0;
|
|
5684
|
+
const E = A.getAttribute("text-anchor");
|
|
5685
|
+
E === "middle" ? b = I / 2 : E === "end" && (b = I);
|
|
5686
|
+
const D = p.getPath(
|
|
5687
5687
|
A.innerHTML,
|
|
5688
|
-
parseFloat(A.getAttribute("x") ?? "0") -
|
|
5688
|
+
parseFloat(A.getAttribute("x") ?? "0") - b,
|
|
5689
5689
|
parseFloat(A.getAttribute("y") ?? "0"),
|
|
5690
5690
|
parseInt(u.getAttribute("font-size") ?? "72")
|
|
5691
5691
|
);
|
|
5692
|
-
|
|
5693
|
-
const x =
|
|
5692
|
+
D.fill = g, D.stroke = f, D.strokeWidth = parseFloat(S ?? "0");
|
|
5693
|
+
const x = D.toSVG(2), $ = t.parseFromString(x, "image/svg+xml").firstElementChild;
|
|
5694
5694
|
h.appendChild($);
|
|
5695
5695
|
}
|
|
5696
5696
|
return e.querySelectorAll("text").forEach((d) => d.remove()), Pt().serializeToString(a);
|
|
5697
|
-
},
|
|
5698
|
-
`), e, a), t),
|
|
5697
|
+
}, xe = (n, t, e, a) => Math.max(bo(n.join(`
|
|
5698
|
+
`), e, a), t), Ka = (n, t, e, a, i, r) => {
|
|
5699
5699
|
const o = (r || _n) * i.getApproximateHeight(), s = t.split(`
|
|
5700
5700
|
`);
|
|
5701
5701
|
try {
|
|
5702
|
-
const l = s.flatMap((d) =>
|
|
5702
|
+
const l = s.flatMap((d) => ye(d, n.width, a, i)), c = l.flatMap((d) => d.lines);
|
|
5703
5703
|
return {
|
|
5704
5704
|
lines: c,
|
|
5705
5705
|
requiredHeight: l.flatMap((d) => d.lines).length * (a * o),
|
|
5706
5706
|
fontSize: e,
|
|
5707
|
-
requiredWidth:
|
|
5707
|
+
requiredWidth: xe(c, n.width, a, i)
|
|
5708
5708
|
};
|
|
5709
5709
|
} catch {
|
|
5710
5710
|
const c = t.split("");
|
|
@@ -5712,17 +5712,17 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5712
5712
|
lines: c,
|
|
5713
5713
|
requiredHeight: c.length * (a * o),
|
|
5714
5714
|
fontSize: e,
|
|
5715
|
-
requiredWidth:
|
|
5715
|
+
requiredWidth: xe(c, n.width, a, i)
|
|
5716
5716
|
};
|
|
5717
5717
|
}
|
|
5718
|
-
},
|
|
5718
|
+
}, ye = (n, t, e, a) => {
|
|
5719
5719
|
const i = pt(n, e, a);
|
|
5720
5720
|
if (i <= t)
|
|
5721
5721
|
return { lines: [n], width: i };
|
|
5722
5722
|
if (!(n.indexOf(" ") > -1)) {
|
|
5723
5723
|
if (n.length <= 1)
|
|
5724
5724
|
throw new Error(`Character ${n} is wider than region`);
|
|
5725
|
-
const d = Math.floor(n.length / 2), A =
|
|
5725
|
+
const d = Math.floor(n.length / 2), A = ye(n.slice(0, d), t, e, a), u = ye(n.slice(d), t, e, a);
|
|
5726
5726
|
return { lines: [...A.lines, ...u.lines], width: Math.max(A.width, u.width) };
|
|
5727
5727
|
}
|
|
5728
5728
|
const o = n.split(" "), s = [];
|
|
@@ -5730,7 +5730,7 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5730
5730
|
for (; c < o.length; ) {
|
|
5731
5731
|
const d = o[c];
|
|
5732
5732
|
if (pt(d, e, a) > t) {
|
|
5733
|
-
const A =
|
|
5733
|
+
const A = ye(d, t, e, a);
|
|
5734
5734
|
s.push(...A.lines), l = Math.max(l, A.width), c++;
|
|
5735
5735
|
} else {
|
|
5736
5736
|
const A = [d];
|
|
@@ -5752,7 +5752,7 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5752
5752
|
}, vo = (n, t, e, a) => {
|
|
5753
5753
|
const i = yt(t.fontData.assetUrl), r = i.getFont(), o = t.fontSize / r.unitsPerEm;
|
|
5754
5754
|
if (!e)
|
|
5755
|
-
return
|
|
5755
|
+
return Ka(t, n, t.fontSize, o, i, a);
|
|
5756
5756
|
let s;
|
|
5757
5757
|
if (t.text ? s = t.text.split(`
|
|
5758
5758
|
`) : s = t.input?.split(`
|
|
@@ -5760,16 +5760,16 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5760
5760
|
return {
|
|
5761
5761
|
lines: s,
|
|
5762
5762
|
requiredHeight: t.height,
|
|
5763
|
-
requiredWidth:
|
|
5763
|
+
requiredWidth: xe(s, t.width, o, i),
|
|
5764
5764
|
fontSize: t.fontSize
|
|
5765
5765
|
};
|
|
5766
5766
|
const l = t.width !== e.width != (t.height !== e.height);
|
|
5767
5767
|
return t.lineHeight === e.lineHeight && !l && e.input === n ? {
|
|
5768
5768
|
lines: s,
|
|
5769
5769
|
requiredHeight: t.height,
|
|
5770
|
-
requiredWidth:
|
|
5770
|
+
requiredWidth: xe(s, t.width, o, i),
|
|
5771
5771
|
fontSize: So(s, i, r, t.width, t.height, a)
|
|
5772
|
-
} :
|
|
5772
|
+
} : Ka(t, n, t.fontSize, o, i, a);
|
|
5773
5773
|
}, Eo = (n, t, e, a, i) => {
|
|
5774
5774
|
const o = yt(t.assetUrl).getFont();
|
|
5775
5775
|
let s = { ...n };
|
|
@@ -5798,12 +5798,12 @@ const wo = (n) => n.substring(0, 5).toLowerCase().trim() === "data:", Ke = /* @_
|
|
|
5798
5798
|
return n.forEach((i) => {
|
|
5799
5799
|
a = Math.max(a, pt(i, t, e));
|
|
5800
5800
|
}), a;
|
|
5801
|
-
},
|
|
5801
|
+
}, _a = {
|
|
5802
5802
|
stripControlCharacters: !0,
|
|
5803
5803
|
vertical: !1,
|
|
5804
5804
|
uppercase: !1
|
|
5805
|
-
},
|
|
5806
|
-
const e = { ...
|
|
5805
|
+
}, ke = (n, t = _a) => {
|
|
5806
|
+
const e = { ..._a, ...t };
|
|
5807
5807
|
let a = n || "";
|
|
5808
5808
|
return e.stripControlCharacters && (a = a.replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, "")), e.uppercase && (a = a.toUpperCase()), e.vertical && (a = a.split("").join(`
|
|
5809
5809
|
`)), a;
|
|
@@ -5897,8 +5897,8 @@ const Po = (n) => {
|
|
|
5897
5897
|
},
|
|
5898
5898
|
stroke: A,
|
|
5899
5899
|
strokeWidth: u,
|
|
5900
|
-
children: n.curved ? /* @__PURE__ */ P(
|
|
5901
|
-
|
|
5900
|
+
children: n.curved ? /* @__PURE__ */ P(Fo, { text: c, curvedPathId: r, align: n.align }) : d.map((m, p) => /* @__PURE__ */ P(
|
|
5901
|
+
Do,
|
|
5902
5902
|
{
|
|
5903
5903
|
align: n.vertical ? "center" : n.align,
|
|
5904
5904
|
fontSize: n.fontSize,
|
|
@@ -5917,7 +5917,7 @@ const Po = (n) => {
|
|
|
5917
5917
|
}
|
|
5918
5918
|
) }) })
|
|
5919
5919
|
] });
|
|
5920
|
-
},
|
|
5920
|
+
}, Do = (n) => {
|
|
5921
5921
|
const t = () => {
|
|
5922
5922
|
if (n.lineHeight !== void 0)
|
|
5923
5923
|
return n.lineHeight * n.fontSize;
|
|
@@ -5935,7 +5935,7 @@ const Po = (n) => {
|
|
|
5935
5935
|
return (n.thisLineIdx - o) * i + n.fontSize / 4;
|
|
5936
5936
|
};
|
|
5937
5937
|
return /* @__PURE__ */ P("tspan", { textAnchor: Kn(n.align), x: e(), y: `${a()}px`, children: n.text });
|
|
5938
|
-
},
|
|
5938
|
+
}, Fo = (n) => {
|
|
5939
5939
|
const t = `#${n.curvedPathId}`;
|
|
5940
5940
|
return /* @__PURE__ */ P(
|
|
5941
5941
|
"textPath",
|
|
@@ -6055,7 +6055,7 @@ class ko {
|
|
|
6055
6055
|
layout: t,
|
|
6056
6056
|
elements: e
|
|
6057
6057
|
},
|
|
6058
|
-
getComponentWithProps: (a) =>
|
|
6058
|
+
getComponentWithProps: (a) => ka(t, e, a)
|
|
6059
6059
|
};
|
|
6060
6060
|
}
|
|
6061
6061
|
initialize(t, e) {
|
|
@@ -6080,7 +6080,7 @@ class ko {
|
|
|
6080
6080
|
return { ...t, transaction: e.apply(a) };
|
|
6081
6081
|
}
|
|
6082
6082
|
}
|
|
6083
|
-
const Zn = (n) => n.type ===
|
|
6083
|
+
const Zn = (n) => n.type === F.Image ? /* @__PURE__ */ P(Hn, { ...n }, n.id) : n.type === F.Frame ? /* @__PURE__ */ P(fo, { ...n }, n.id) : n.type === F.Illustration ? /* @__PURE__ */ P(xo, { ...n }, n.id) : n.type === F.Textbox ? /* @__PURE__ */ P(Po, { ...n }, n.id) : n.type === F.Group ? /* @__PURE__ */ P(jn, { ...n }, n.id) : null, ka = (n, t, e) => {
|
|
6084
6084
|
const a = e.renderingConfiguration, i = a?.removeExcludedElements ? t.filter((r) => !r.excludeFromExport) : t;
|
|
6085
6085
|
return /* @__PURE__ */ P(
|
|
6086
6086
|
po,
|
|
@@ -6111,7 +6111,7 @@ const Zn = (n) => n.type === D.Image ? /* @__PURE__ */ P(Hn, { ...n }, n.id) : n
|
|
|
6111
6111
|
}
|
|
6112
6112
|
);
|
|
6113
6113
|
};
|
|
6114
|
-
function
|
|
6114
|
+
function Ma(n) {
|
|
6115
6115
|
return n.sort((t, e) => {
|
|
6116
6116
|
const a = t.layer || 0, i = e.layer || 0;
|
|
6117
6117
|
if (a < i) return -1;
|
|
@@ -6131,10 +6131,10 @@ const le = (n) => {
|
|
|
6131
6131
|
}, mt = /* @__PURE__ */ new Map(), Gt = /* @__PURE__ */ new Map(), Xe = /* @__PURE__ */ new Map(), ti = async (n, t) => {
|
|
6132
6132
|
if (!t) {
|
|
6133
6133
|
if (!n) throw new Error("No region or src supplied. Cannot construct frame!");
|
|
6134
|
-
return
|
|
6134
|
+
return ga(n);
|
|
6135
6135
|
}
|
|
6136
6136
|
return nt(t);
|
|
6137
|
-
},
|
|
6137
|
+
}, ga = (n) => {
|
|
6138
6138
|
const t = n.width, e = n.height;
|
|
6139
6139
|
return `<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 ${t} ${e}'>
|
|
6140
6140
|
<path id="target-path" d='M0 0 h ${t} v ${e} h ${-t} Z' />
|
|
@@ -6149,7 +6149,7 @@ const le = (n) => {
|
|
|
6149
6149
|
if (!e.asset)
|
|
6150
6150
|
throw new Error(`No asset for variant with ID: ${n.frameVariantId}`);
|
|
6151
6151
|
return e;
|
|
6152
|
-
},
|
|
6152
|
+
}, ze = async (n) => {
|
|
6153
6153
|
if (Xe.has(n))
|
|
6154
6154
|
return Xe.get(n);
|
|
6155
6155
|
const e = (async () => {
|
|
@@ -6188,7 +6188,7 @@ const le = (n) => {
|
|
|
6188
6188
|
throw new Error("Malformed frame SVG");
|
|
6189
6189
|
})();
|
|
6190
6190
|
return Xe.set(n, e), e;
|
|
6191
|
-
},
|
|
6191
|
+
}, Ta = (n, t, e, a) => {
|
|
6192
6192
|
const i = t.width / t.height, r = n.width / n.height;
|
|
6193
6193
|
let o;
|
|
6194
6194
|
a ? r > i ? o = t.height / n.height : o = t.width / n.width : r > i ? o = t.width / n.width : o = t.height / n.height, e?.scale !== void 0 && (o *= e?.scale);
|
|
@@ -6198,7 +6198,7 @@ const le = (n) => {
|
|
|
6198
6198
|
y: u,
|
|
6199
6199
|
zoom: o
|
|
6200
6200
|
};
|
|
6201
|
-
},
|
|
6201
|
+
}, pa = async (n) => {
|
|
6202
6202
|
if (mt.has(n))
|
|
6203
6203
|
return mt.get(n);
|
|
6204
6204
|
if (n.startsWith("data:image/svg+xml")) {
|
|
@@ -6211,7 +6211,7 @@ const le = (n) => {
|
|
|
6211
6211
|
return mt.set(n, r), r;
|
|
6212
6212
|
}
|
|
6213
6213
|
if ((n.split(".").pop()?.toLowerCase() ?? "") === "svg") {
|
|
6214
|
-
const e = await
|
|
6214
|
+
const e = await Na(n), a = e.width, i = e.height, r = {
|
|
6215
6215
|
src: n,
|
|
6216
6216
|
width: a,
|
|
6217
6217
|
height: i,
|
|
@@ -6219,7 +6219,7 @@ const le = (n) => {
|
|
|
6219
6219
|
};
|
|
6220
6220
|
return mt.set(n, r), r;
|
|
6221
6221
|
} else {
|
|
6222
|
-
const e = await
|
|
6222
|
+
const e = await Oe(n, !0), a = await Ue(e), i = {
|
|
6223
6223
|
src: n,
|
|
6224
6224
|
width: a.width,
|
|
6225
6225
|
height: a.height,
|
|
@@ -6227,14 +6227,14 @@ const le = (n) => {
|
|
|
6227
6227
|
};
|
|
6228
6228
|
return mt.set(n, i), i;
|
|
6229
6229
|
}
|
|
6230
|
-
},
|
|
6230
|
+
}, Na = async (n) => {
|
|
6231
6231
|
const t = await nt(n);
|
|
6232
6232
|
return ei(t);
|
|
6233
|
-
},
|
|
6233
|
+
}, Xa = (n) => n.endsWith("mm") ? Number(n.replace("mm", "")) * 3.7795275591 : n.endsWith("px") ? Number(n.replace("px", "")) : Number(n), ei = (n) => {
|
|
6234
6234
|
const a = At().parseFromString(n, "image/svg+xml").querySelector("svg");
|
|
6235
6235
|
if (!a)
|
|
6236
6236
|
throw new Error("No svg tag found, this svg must be malformed!");
|
|
6237
|
-
const i = a.getAttribute("viewBox"), r = a.getAttribute("width"), o = a.getAttribute("height"), s = o && r ? [0, 0,
|
|
6237
|
+
const i = a.getAttribute("viewBox"), r = a.getAttribute("width"), o = a.getAttribute("height"), s = o && r ? [0, 0, Xa(r), Xa(o)] : i?.split(" ").map((l) => Number(l));
|
|
6238
6238
|
if (!s)
|
|
6239
6239
|
throw new Error("No viewbox or width/height values detected on SVG file!");
|
|
6240
6240
|
return {
|
|
@@ -6266,12 +6266,12 @@ const le = (n) => {
|
|
|
6266
6266
|
const o = At().parseFromString(n, "image/svg+xml").firstElementChild;
|
|
6267
6267
|
if (!o)
|
|
6268
6268
|
throw new Error("Failed to read SVG");
|
|
6269
|
-
const l = Pt().serializeToString(o), c = Ct(), d = c.getContext("2d"), A = await
|
|
6269
|
+
const l = Pt().serializeToString(o), c = Ct(), d = c.getContext("2d"), A = await va.from(d, l, {
|
|
6270
6270
|
anonymousCrossOrigin: !0,
|
|
6271
6271
|
ignoreDimensions: !1,
|
|
6272
6272
|
createCanvas: Ct,
|
|
6273
6273
|
createImage: ie,
|
|
6274
|
-
DOMParser:
|
|
6274
|
+
DOMParser: Ba(),
|
|
6275
6275
|
fetch: it
|
|
6276
6276
|
}), u = o.getAttribute("width"), h = o.getAttribute("height"), m = 2048;
|
|
6277
6277
|
if (h && u) {
|
|
@@ -6296,17 +6296,17 @@ const le = (n) => {
|
|
|
6296
6296
|
rotation: 0,
|
|
6297
6297
|
panelId: n.layoutState.layout.panelId
|
|
6298
6298
|
};
|
|
6299
|
-
if (e && t ===
|
|
6299
|
+
if (e && t === F.Illustration) {
|
|
6300
6300
|
const l = await lt(await ai(e)), u = At().parseFromString(l.svg, "image/svg+xml").firstElementChild.getAttribute("viewBox");
|
|
6301
6301
|
if (!u) throw new Error("SVG missing viewBox.");
|
|
6302
6302
|
const h = s.height, m = u.split(" "), p = parseFloat(m[2]) || 1, g = parseFloat(m[3]) || 1, f = p / g;
|
|
6303
6303
|
s.height = s.width / f, s.top += (h - s.height) / 2;
|
|
6304
6304
|
}
|
|
6305
|
-
if (e && t ===
|
|
6306
|
-
const l = s.height, c = await
|
|
6305
|
+
if (e && t === F.Image) {
|
|
6306
|
+
const l = s.height, c = await Oe(e), d = await Ue(c), A = d.width / d.height;
|
|
6307
6307
|
s.height = s.width / A, s.top += (l - s.height) / 2;
|
|
6308
6308
|
}
|
|
6309
|
-
if (e && t ===
|
|
6309
|
+
if (e && t === F.Textbox && a?.text && a?.fontScale) {
|
|
6310
6310
|
await Qt(e);
|
|
6311
6311
|
const l = yt(e), c = pt(a.text, a?.fontScale, l);
|
|
6312
6312
|
s.width = Math.min(c, i.width * 0.85), s.left = i.x + i.width / 2 - s.width / 2;
|
|
@@ -6315,7 +6315,7 @@ const le = (n) => {
|
|
|
6315
6315
|
};
|
|
6316
6316
|
class Ed {
|
|
6317
6317
|
static async getFrame(t, e) {
|
|
6318
|
-
const a = await ti(e.region, e.src), i = await
|
|
6318
|
+
const a = await ti(e.region, e.src), i = await ze(a), r = e.region || await Vt(t, F.Frame);
|
|
6319
6319
|
return {
|
|
6320
6320
|
id: M(),
|
|
6321
6321
|
x: r.left,
|
|
@@ -6330,7 +6330,7 @@ class Ed {
|
|
|
6330
6330
|
path: i.path,
|
|
6331
6331
|
dataWidth: i.width,
|
|
6332
6332
|
dataHeight: i.height,
|
|
6333
|
-
type:
|
|
6333
|
+
type: F.Frame,
|
|
6334
6334
|
disablePlaceholder: e.configuration.disablePlaceholder,
|
|
6335
6335
|
focalBlur: e.configuration.focalBlur,
|
|
6336
6336
|
focalBlurStrength: e.configuration.focalBlurStrength,
|
|
@@ -6341,11 +6341,11 @@ class Ed {
|
|
|
6341
6341
|
};
|
|
6342
6342
|
}
|
|
6343
6343
|
static async getImage(t, e) {
|
|
6344
|
-
const a = e.region || await Vt(t,
|
|
6344
|
+
const a = e.region || await Vt(t, F.Image, e.src);
|
|
6345
6345
|
return {
|
|
6346
6346
|
id: M(),
|
|
6347
6347
|
src: e.src,
|
|
6348
|
-
type:
|
|
6348
|
+
type: F.Image,
|
|
6349
6349
|
y: a.top,
|
|
6350
6350
|
x: a.left,
|
|
6351
6351
|
rotation: a.rotation,
|
|
@@ -6361,16 +6361,16 @@ class Ed {
|
|
|
6361
6361
|
const { configuration: a, fontSrc: i, designInputStep: r } = e, o = await Qt(i), s = {
|
|
6362
6362
|
assetUrl: i,
|
|
6363
6363
|
name: o.names.fullName.en
|
|
6364
|
-
}, l = r?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d =
|
|
6364
|
+
}, l = r?.text || a.defaultText || "", c = a.replaceableText ? a.replaceableText.replace("{{}}", l) : l, d = ke(c, {
|
|
6365
6365
|
vertical: a.vertical,
|
|
6366
6366
|
uppercase: a.uppercase
|
|
6367
|
-
}), A = e.region || await Vt(t,
|
|
6367
|
+
}), A = e.region || await Vt(t, F.Textbox, i, {
|
|
6368
6368
|
text: d,
|
|
6369
6369
|
fontScale: a.size ? a.size / o.unitsPerEm : void 0
|
|
6370
6370
|
}), u = se(
|
|
6371
6371
|
{
|
|
6372
6372
|
id: M(),
|
|
6373
|
-
type:
|
|
6373
|
+
type: F.Textbox,
|
|
6374
6374
|
x: A.left,
|
|
6375
6375
|
y: A.top,
|
|
6376
6376
|
width: A.width,
|
|
@@ -6430,13 +6430,13 @@ class Ed {
|
|
|
6430
6430
|
</svg>
|
|
6431
6431
|
`, i = {};
|
|
6432
6432
|
i["spiff-fill-shape"] = { browserValue: e.color };
|
|
6433
|
-
const r = e.region || await Vt(t,
|
|
6433
|
+
const r = e.region || await Vt(t, F.Illustration), o = M();
|
|
6434
6434
|
return {
|
|
6435
6435
|
stepRegion: e.region,
|
|
6436
6436
|
colors: i,
|
|
6437
6437
|
id: o,
|
|
6438
6438
|
svg: a,
|
|
6439
|
-
type:
|
|
6439
|
+
type: F.Illustration,
|
|
6440
6440
|
y: r.top,
|
|
6441
6441
|
x: r.left,
|
|
6442
6442
|
rotation: r.rotation,
|
|
@@ -6448,7 +6448,7 @@ class Ed {
|
|
|
6448
6448
|
};
|
|
6449
6449
|
}
|
|
6450
6450
|
static async getIllustration(t, e) {
|
|
6451
|
-
const a = e.region || await Vt(t,
|
|
6451
|
+
const a = e.region || await Vt(t, F.Illustration, e.src), i = await lt(await ai(e.src)), r = await te(i.svg), o = M();
|
|
6452
6452
|
return {
|
|
6453
6453
|
cachedObjectURL: r,
|
|
6454
6454
|
stepRegion: e.region,
|
|
@@ -6456,7 +6456,7 @@ class Ed {
|
|
|
6456
6456
|
id: o,
|
|
6457
6457
|
src: e.src,
|
|
6458
6458
|
svg: i.svg,
|
|
6459
|
-
type:
|
|
6459
|
+
type: F.Illustration,
|
|
6460
6460
|
y: a.top,
|
|
6461
6461
|
x: a.left,
|
|
6462
6462
|
rotation: a.rotation,
|
|
@@ -6479,13 +6479,13 @@ const z = (n, t) => Z(n, t).elements.find((i) => i.id === n), Z = (n, t) => {
|
|
|
6479
6479
|
throw new W();
|
|
6480
6480
|
return e;
|
|
6481
6481
|
}, tt = (n, t) => {
|
|
6482
|
-
const e = [...t.elements.filter((i) => i.id !== n.id), n], a =
|
|
6482
|
+
const e = [...t.elements.filter((i) => i.id !== n.id), n], a = Ma(e);
|
|
6483
6483
|
return {
|
|
6484
6484
|
layout: t.layout,
|
|
6485
6485
|
elements: a,
|
|
6486
6486
|
modificationID: M()
|
|
6487
6487
|
};
|
|
6488
|
-
},
|
|
6488
|
+
}, Za = async (n) => {
|
|
6489
6489
|
const t = [...Object.keys(n.layouts)], e = [...new Set(t)];
|
|
6490
6490
|
for (let a = 0; a < e.length; a++) {
|
|
6491
6491
|
const i = e[a], r = n.layouts[i];
|
|
@@ -6515,7 +6515,7 @@ const z = (n, t) => Z(n, t).elements.find((i) => i.id === n), Z = (n, t) => {
|
|
|
6515
6515
|
}
|
|
6516
6516
|
for (const a in n.layouts) {
|
|
6517
6517
|
const i = n.layouts[a].elements.filter(
|
|
6518
|
-
(o) => o.type ===
|
|
6518
|
+
(o) => o.type === F.Illustration
|
|
6519
6519
|
);
|
|
6520
6520
|
for (let o = 0; o < i.length; ++o) {
|
|
6521
6521
|
const s = i[o];
|
|
@@ -6527,7 +6527,7 @@ const z = (n, t) => Z(n, t).elements.find((i) => i.id === n), Z = (n, t) => {
|
|
|
6527
6527
|
}
|
|
6528
6528
|
}
|
|
6529
6529
|
const r = n.layouts[a].elements.filter(
|
|
6530
|
-
(o) => o.type ===
|
|
6530
|
+
(o) => o.type === F.Textbox
|
|
6531
6531
|
);
|
|
6532
6532
|
for (let o = 0; o < r.length; ++o) {
|
|
6533
6533
|
const s = r[o];
|
|
@@ -6545,7 +6545,7 @@ class O {
|
|
|
6545
6545
|
this.oldState = t;
|
|
6546
6546
|
}
|
|
6547
6547
|
}
|
|
6548
|
-
class
|
|
6548
|
+
class tn extends O {
|
|
6549
6549
|
constructor(t) {
|
|
6550
6550
|
super(), this.serializableWorkflow = t;
|
|
6551
6551
|
}
|
|
@@ -6807,7 +6807,7 @@ class No extends O {
|
|
|
6807
6807
|
};
|
|
6808
6808
|
}
|
|
6809
6809
|
}
|
|
6810
|
-
class
|
|
6810
|
+
class en extends O {
|
|
6811
6811
|
constructor(t, e) {
|
|
6812
6812
|
super(), this.id = t, this.fontData = e;
|
|
6813
6813
|
}
|
|
@@ -6976,7 +6976,7 @@ class ea extends O {
|
|
|
6976
6976
|
};
|
|
6977
6977
|
}
|
|
6978
6978
|
}
|
|
6979
|
-
class
|
|
6979
|
+
class fa extends O {
|
|
6980
6980
|
constructor(t, e, a) {
|
|
6981
6981
|
super(), this.id = t, this.className = e, this.fill = a;
|
|
6982
6982
|
}
|
|
@@ -7031,7 +7031,7 @@ class Uo extends O {
|
|
|
7031
7031
|
};
|
|
7032
7032
|
}
|
|
7033
7033
|
}
|
|
7034
|
-
class
|
|
7034
|
+
class Dd extends O {
|
|
7035
7035
|
/**
|
|
7036
7036
|
* @param id The targeted element to bring to the front.
|
|
7037
7037
|
*/
|
|
@@ -7060,7 +7060,7 @@ class Fd extends O {
|
|
|
7060
7060
|
};
|
|
7061
7061
|
}
|
|
7062
7062
|
}
|
|
7063
|
-
class
|
|
7063
|
+
class Fd extends O {
|
|
7064
7064
|
/**
|
|
7065
7065
|
* @param id The targeted element to bring to the back.
|
|
7066
7066
|
*/
|
|
@@ -7145,21 +7145,21 @@ class kd extends O {
|
|
|
7145
7145
|
};
|
|
7146
7146
|
}
|
|
7147
7147
|
}
|
|
7148
|
-
class
|
|
7148
|
+
class an {
|
|
7149
7149
|
constructor(t, e, a) {
|
|
7150
7150
|
this.processRegion = async (i) => {
|
|
7151
7151
|
const r = this.layouts.find((l) => l.panelId === i.panelId);
|
|
7152
7152
|
if (!r)
|
|
7153
7153
|
throw new K(i);
|
|
7154
7154
|
let o = "";
|
|
7155
|
-
if (this.configuration.type ===
|
|
7155
|
+
if (this.configuration.type === v.ProductOverlay) {
|
|
7156
7156
|
let l = "";
|
|
7157
7157
|
if (this.product?.overlayImageUrl && (l = this.product.overlayImageUrl), o = l, !l)
|
|
7158
|
-
throw new
|
|
7158
|
+
throw new De(this.configuration, "Couldn't find an asset for product overlay step");
|
|
7159
7159
|
}
|
|
7160
7160
|
const s = this.evaluateAssetType();
|
|
7161
|
-
if (s ===
|
|
7162
|
-
const l = this.configuration.type ===
|
|
7161
|
+
if (s === F.Image) {
|
|
7162
|
+
const l = this.configuration.type === v.SilentIllustration ? this.configuration.data.asset?.fileLink : this.product?.overlayImageUrl;
|
|
7163
7163
|
if (!l)
|
|
7164
7164
|
throw new Error("Undefined raster silent step source");
|
|
7165
7165
|
const c = {
|
|
@@ -7174,7 +7174,7 @@ class nn {
|
|
|
7174
7174
|
layer: i.layer,
|
|
7175
7175
|
layerIndex: i.layerIndex,
|
|
7176
7176
|
immutable: i.immutable,
|
|
7177
|
-
productOverlay: this.configuration.type ===
|
|
7177
|
+
productOverlay: this.configuration.type === v.ProductOverlay ? !0 : void 0,
|
|
7178
7178
|
rotation: i.rotation,
|
|
7179
7179
|
excludeFromExport: this.configuration.data.excludeFromPrint,
|
|
7180
7180
|
preserveAspectRatio: "none"
|
|
@@ -7187,7 +7187,7 @@ class nn {
|
|
|
7187
7187
|
command: new H(c, r)
|
|
7188
7188
|
};
|
|
7189
7189
|
} else {
|
|
7190
|
-
const l = this.configuration.type ===
|
|
7190
|
+
const l = this.configuration.type === v.SilentIllustration ? this.configuration.data.asset?.fileLink : o, d = await lt(await (async () => new Promise((u, h) => {
|
|
7191
7191
|
if (!l) {
|
|
7192
7192
|
h("Undefined vector silent step source");
|
|
7193
7193
|
return;
|
|
@@ -7211,7 +7211,7 @@ class nn {
|
|
|
7211
7211
|
layerIndex: i.layerIndex,
|
|
7212
7212
|
rotation: i.rotation,
|
|
7213
7213
|
immutable: i.immutable,
|
|
7214
|
-
productOverlay: this.configuration.type ===
|
|
7214
|
+
productOverlay: this.configuration.type === v.ProductOverlay ? !0 : void 0,
|
|
7215
7215
|
excludeFromExport: this.configuration.data.excludeFromPrint
|
|
7216
7216
|
};
|
|
7217
7217
|
return {
|
|
@@ -7226,11 +7226,11 @@ class nn {
|
|
|
7226
7226
|
}
|
|
7227
7227
|
async trigger() {
|
|
7228
7228
|
if (!this.configuration.data.regions)
|
|
7229
|
-
throw new
|
|
7230
|
-
if (this.configuration.type ===
|
|
7229
|
+
throw new De(this.configuration, "Missing regions.");
|
|
7230
|
+
if (this.configuration.type === v.SilentIllustration) {
|
|
7231
7231
|
const t = this.configuration.data.regions.map(this.processRegion);
|
|
7232
7232
|
return Promise.all(t);
|
|
7233
|
-
} else return this.configuration.type ===
|
|
7233
|
+
} else return this.configuration.type === v.ProductOverlay ? Promise.all(
|
|
7234
7234
|
this.configuration.data.regions.map((t) => {
|
|
7235
7235
|
if (!this.layouts.find((a) => t.panelId === a.panelId))
|
|
7236
7236
|
throw new K(t);
|
|
@@ -7239,8 +7239,8 @@ class nn {
|
|
|
7239
7239
|
) : Promise.reject("Unknown silent step. This is a bug");
|
|
7240
7240
|
}
|
|
7241
7241
|
evaluateAssetType() {
|
|
7242
|
-
const t = this.configuration.type ===
|
|
7243
|
-
return t?.startsWith("data:image/png") || t?.endsWith(".jpeg") || t?.endsWith(".jpg") || t?.endsWith(".png") ?
|
|
7242
|
+
const t = this.configuration.type === v.ProductOverlay && this.product?.overlayImageUrl ? this.product.overlayImageUrl.toLowerCase() : this.configuration.data.asset?.fileLink?.toLowerCase().split("?")[0];
|
|
7243
|
+
return t?.startsWith("data:image/png") || t?.endsWith(".jpeg") || t?.endsWith(".jpg") || t?.endsWith(".png") ? F.Image : (t?.endsWith(".svg") || t?.startsWith("image/svg+xml"), F.Illustration);
|
|
7244
7244
|
}
|
|
7245
7245
|
}
|
|
7246
7246
|
const Lo = async (n) => {
|
|
@@ -7254,7 +7254,7 @@ const Lo = async (n) => {
|
|
|
7254
7254
|
}
|
|
7255
7255
|
})).json()).shortUrl;
|
|
7256
7256
|
} catch (e) {
|
|
7257
|
-
throw console.error(e), new
|
|
7257
|
+
throw console.error(e), new Re("Failed to shorten URL, see console.");
|
|
7258
7258
|
}
|
|
7259
7259
|
};
|
|
7260
7260
|
class ii {
|
|
@@ -7299,7 +7299,7 @@ class Vo {
|
|
|
7299
7299
|
}
|
|
7300
7300
|
async regenerateQRCode(t, e, a, i) {
|
|
7301
7301
|
const r = async () => {
|
|
7302
|
-
const h = (await
|
|
7302
|
+
const h = (await Fe([e]))[0], m = h?.versions?.find((p) => p.name === "mpeg4")?.link;
|
|
7303
7303
|
return { asset: h, link: m };
|
|
7304
7304
|
}, o = await new Promise((h, m) => {
|
|
7305
7305
|
new ii(
|
|
@@ -7325,10 +7325,10 @@ class Vo {
|
|
|
7325
7325
|
l.searchParams.append("video", btoa(JSON.stringify([o]))), l.pathname = l.pathname + (l.pathname.slice(-1) === "/" ? "" : "/");
|
|
7326
7326
|
const c = l.toString();
|
|
7327
7327
|
if (c.length >= 2e3)
|
|
7328
|
-
throw new
|
|
7328
|
+
throw new Re("Cannot create QR code, URL too long.");
|
|
7329
7329
|
const d = await Lo(c);
|
|
7330
7330
|
if (!i.data || !i.data.regions)
|
|
7331
|
-
throw new
|
|
7331
|
+
throw new De(i, "Missing regions.");
|
|
7332
7332
|
const A = await this.regionElements(i), u = await this.command(d, A, a, i.stepName);
|
|
7333
7333
|
return u && (u.command && a.getCommandDispatcher()(u.command), u.followup && await u.followup()), await a.setSelectionsAndElements(i.stepName, [], A, async () => {
|
|
7334
7334
|
a.updateStorage(i.stepName, {
|
|
@@ -7356,7 +7356,7 @@ class Vo {
|
|
|
7356
7356
|
stepName: i,
|
|
7357
7357
|
id: c.id,
|
|
7358
7358
|
src: s,
|
|
7359
|
-
type:
|
|
7359
|
+
type: F.Image,
|
|
7360
7360
|
y: d.top,
|
|
7361
7361
|
x: d.left,
|
|
7362
7362
|
width: d.width,
|
|
@@ -7371,11 +7371,11 @@ class Vo {
|
|
|
7371
7371
|
}
|
|
7372
7372
|
}
|
|
7373
7373
|
const ri = new Vo();
|
|
7374
|
-
class
|
|
7374
|
+
class Me {
|
|
7375
7375
|
constructor() {
|
|
7376
7376
|
this.frameSourceSvg = async (t, e) => {
|
|
7377
7377
|
if (!t)
|
|
7378
|
-
return
|
|
7378
|
+
return ga(e);
|
|
7379
7379
|
const a = t.asset;
|
|
7380
7380
|
if (!a)
|
|
7381
7381
|
throw new Bt(t);
|
|
@@ -7424,7 +7424,7 @@ class Ne {
|
|
|
7424
7424
|
a.serializableWorkflow.steps
|
|
7425
7425
|
), l = Object.values(a.layouts).map((c) => c.elements).flat().filter((c) => c.stepName === t.stepName).map((c) => ({ id: c.id, region: c.stepRegion }));
|
|
7426
7426
|
if (!t.option || (t.option.variants || []).length === 0) {
|
|
7427
|
-
const c = t.data.regions.map((d) =>
|
|
7427
|
+
const c = t.data.regions.map((d) => ga(d));
|
|
7428
7428
|
e.updateStorage(t.stepName, {
|
|
7429
7429
|
currentFrameSources: c
|
|
7430
7430
|
});
|
|
@@ -7478,7 +7478,7 @@ class Ne {
|
|
|
7478
7478
|
})) ?? [];
|
|
7479
7479
|
}
|
|
7480
7480
|
selectImage(t, e, a, i = !0) {
|
|
7481
|
-
const r =
|
|
7481
|
+
const r = Me.patternSource(e), o = a.getStepStorage(t.stepName)?.framePatternSrc;
|
|
7482
7482
|
if (o && o === r)
|
|
7483
7483
|
return Promise.resolve();
|
|
7484
7484
|
a.setEditedStatus(t.stepName, !0);
|
|
@@ -7498,7 +7498,7 @@ class Ne {
|
|
|
7498
7498
|
});
|
|
7499
7499
|
},
|
|
7500
7500
|
() => {
|
|
7501
|
-
throw new
|
|
7501
|
+
throw new Re("Failed to resolve transcoded PDF");
|
|
7502
7502
|
}
|
|
7503
7503
|
)
|
|
7504
7504
|
);
|
|
@@ -7518,7 +7518,7 @@ class Ne {
|
|
|
7518
7518
|
return new H(
|
|
7519
7519
|
{
|
|
7520
7520
|
id: t,
|
|
7521
|
-
type:
|
|
7521
|
+
type: F.Frame,
|
|
7522
7522
|
x: e.left,
|
|
7523
7523
|
y: e.top,
|
|
7524
7524
|
width: e.width,
|
|
@@ -7542,7 +7542,7 @@ class Ne {
|
|
|
7542
7542
|
}
|
|
7543
7543
|
async loadPatternFromString(t, e, a = !0, i = void 0, r) {
|
|
7544
7544
|
if (t.endsWith("svg")) {
|
|
7545
|
-
const o = await
|
|
7545
|
+
const o = await Na(t), s = o.width, l = o.height, c = await nt(t);
|
|
7546
7546
|
if (r) {
|
|
7547
7547
|
const u = c.match(/<(image|linearGradient|radialGradient)(\s|>|\/>)/gim);
|
|
7548
7548
|
if (u && u.length > 0)
|
|
@@ -7560,7 +7560,7 @@ class Ne {
|
|
|
7560
7560
|
};
|
|
7561
7561
|
mt.set(t, A), e.setPatternData(A, a);
|
|
7562
7562
|
} else {
|
|
7563
|
-
const o = await
|
|
7563
|
+
const o = await Oe(t, !0), s = await Ue(o), l = {
|
|
7564
7564
|
src: t,
|
|
7565
7565
|
width: s.width,
|
|
7566
7566
|
height: s.height,
|
|
@@ -7645,33 +7645,33 @@ class Ne {
|
|
|
7645
7645
|
r && r(!0);
|
|
7646
7646
|
const c = t.data.initialZoomLevel, d = await Promise.all(
|
|
7647
7647
|
t.data.regions.map(async (h, m) => {
|
|
7648
|
-
const p = await
|
|
7648
|
+
const p = await ze(l[m]), g = s.getImageData(), f = a.map((D) => new Rt(D.id)), S = g ? Ta(
|
|
7649
7649
|
g,
|
|
7650
7650
|
p,
|
|
7651
7651
|
c && !t.data.forceImageCover ? { scale: c } : void 0,
|
|
7652
7652
|
t.data.forceImageCover
|
|
7653
|
-
) : void 0,
|
|
7653
|
+
) : void 0, w = g ? {
|
|
7654
7654
|
id: M(),
|
|
7655
7655
|
src: g.src,
|
|
7656
|
-
x:
|
|
7657
|
-
y:
|
|
7656
|
+
x: S?.x || 0,
|
|
7657
|
+
y: S?.y || 0,
|
|
7658
7658
|
width: g.width,
|
|
7659
7659
|
height: g.height,
|
|
7660
|
-
scaleX:
|
|
7661
|
-
scaleY:
|
|
7660
|
+
scaleX: S?.zoom || 1,
|
|
7661
|
+
scaleY: S?.zoom || 1,
|
|
7662
7662
|
rotation: 0
|
|
7663
|
-
} : void 0,
|
|
7664
|
-
if (!
|
|
7663
|
+
} : void 0, I = M(), E = i.getLayouts().find((D) => D.panelId === h.panelId);
|
|
7664
|
+
if (!E)
|
|
7665
7665
|
throw new K(h);
|
|
7666
7666
|
return {
|
|
7667
|
-
command: this.getCreateElementCommand(
|
|
7667
|
+
command: this.getCreateElementCommand(I, h, E, {
|
|
7668
7668
|
frameData: p,
|
|
7669
|
-
pattern:
|
|
7669
|
+
pattern: w,
|
|
7670
7670
|
disablePlaceholder: t.data.disablePlaceholder,
|
|
7671
7671
|
stepName: t.stepName
|
|
7672
7672
|
}),
|
|
7673
7673
|
regionEl: {
|
|
7674
|
-
id:
|
|
7674
|
+
id: I,
|
|
7675
7675
|
region: h
|
|
7676
7676
|
},
|
|
7677
7677
|
removeExistingCommands: f
|
|
@@ -7709,7 +7709,7 @@ class Ne {
|
|
|
7709
7709
|
throw new _t(t);
|
|
7710
7710
|
}
|
|
7711
7711
|
async loadPatternFromAsset(t, e, a, i) {
|
|
7712
|
-
const r =
|
|
7712
|
+
const r = Me.patternSource(t), o = a.markUpdatePending(), s = a.getWorkflowExperience().getStepById(e.stepName)?.frameService;
|
|
7713
7713
|
if (!s)
|
|
7714
7714
|
throw a.markUpdateCompleted(o), new Error("Frame service unavailable, cannot load pattern!");
|
|
7715
7715
|
try {
|
|
@@ -7736,7 +7736,7 @@ class Ne {
|
|
|
7736
7736
|
), this.validateColorCount(e, a);
|
|
7737
7737
|
}
|
|
7738
7738
|
}
|
|
7739
|
-
const Et = new
|
|
7739
|
+
const Et = new Me();
|
|
7740
7740
|
class zo {
|
|
7741
7741
|
async getIllustrationBody(t) {
|
|
7742
7742
|
return new Promise((e) => {
|
|
@@ -7755,7 +7755,7 @@ class zo {
|
|
|
7755
7755
|
src: i.src,
|
|
7756
7756
|
svg: i.svg.svg,
|
|
7757
7757
|
cachedObjectURL: i.objectURL,
|
|
7758
|
-
type:
|
|
7758
|
+
type: F.Illustration,
|
|
7759
7759
|
y: e.top,
|
|
7760
7760
|
x: e.left,
|
|
7761
7761
|
rotation: e.rotation,
|
|
@@ -7844,7 +7844,7 @@ class zo {
|
|
|
7844
7844
|
const s = Da(t, e, a, o), l = await te(s), c = [];
|
|
7845
7845
|
for (const d of i) {
|
|
7846
7846
|
for (const [A, u] of r.entries())
|
|
7847
|
-
c.push(new
|
|
7847
|
+
c.push(new fa(d, A, u));
|
|
7848
7848
|
c.push(new Uo(d, s, l));
|
|
7849
7849
|
}
|
|
7850
7850
|
return new L(c);
|
|
@@ -7891,7 +7891,7 @@ class zo {
|
|
|
7891
7891
|
}
|
|
7892
7892
|
async selectVariantCommand(t, e, a, i, r) {
|
|
7893
7893
|
if (!t.data || !t.data.regions)
|
|
7894
|
-
throw new
|
|
7894
|
+
throw new De(t, "Missing regions.");
|
|
7895
7895
|
i(!0);
|
|
7896
7896
|
const o = a.map((f) => new Rt(f.id));
|
|
7897
7897
|
t.mandatory && r.setMandatoryFulfilled(t.stepName, !1);
|
|
@@ -7902,13 +7902,13 @@ class zo {
|
|
|
7902
7902
|
if (!l)
|
|
7903
7903
|
throw new _t(s);
|
|
7904
7904
|
const c = await lt(await this.getIllustrationBody(l)), d = await te(c.svg), A = (f) => {
|
|
7905
|
-
const
|
|
7906
|
-
if (!
|
|
7905
|
+
const S = r.getLayouts().find((I) => I.panelId === f.panelId);
|
|
7906
|
+
if (!S)
|
|
7907
7907
|
throw new K(f);
|
|
7908
|
-
const
|
|
7908
|
+
const w = M();
|
|
7909
7909
|
return {
|
|
7910
|
-
regionElement: { id:
|
|
7911
|
-
command: this.getCreateElementCommand(
|
|
7910
|
+
regionElement: { id: w, region: f },
|
|
7911
|
+
command: this.getCreateElementCommand(w, f, S, {
|
|
7912
7912
|
stepName: t.stepName,
|
|
7913
7913
|
src: l,
|
|
7914
7914
|
objectURL: d,
|
|
@@ -7919,47 +7919,47 @@ class zo {
|
|
|
7919
7919
|
let p = Array.from(Object.values(c.colors)).map((f) => f.browserValue);
|
|
7920
7920
|
const g = t.data.colorOption;
|
|
7921
7921
|
return g && g.variants?.forEach((f) => {
|
|
7922
|
-
p = p.map((
|
|
7922
|
+
p = p.map((S) => S.toLowerCase() === f.color?.toLowerCase() ? f.name : S);
|
|
7923
7923
|
}), r.updateMetadata(t.stepName, { colors: p }), {
|
|
7924
7924
|
command: new L(m),
|
|
7925
7925
|
followup: async () => {
|
|
7926
7926
|
await r.setSelectionsAndElements(
|
|
7927
7927
|
t.stepName,
|
|
7928
7928
|
[e],
|
|
7929
|
-
u.map((
|
|
7929
|
+
u.map((S) => S.regionElement),
|
|
7930
7930
|
async () => {
|
|
7931
7931
|
r.setMandatoryFulfilled(t.stepName, !0), i(!1);
|
|
7932
7932
|
}
|
|
7933
7933
|
);
|
|
7934
7934
|
const f = s.assetConfiguration?.defaultColorVariants || [];
|
|
7935
7935
|
if (f.length !== 0) {
|
|
7936
|
-
const
|
|
7937
|
-
(s.assetConfiguration?.channelNumbers || []).forEach((
|
|
7938
|
-
const
|
|
7939
|
-
|
|
7936
|
+
const S = {};
|
|
7937
|
+
(s.assetConfiguration?.channelNumbers || []).forEach((I) => {
|
|
7938
|
+
const b = f.find((E) => E.channelNumber === I.number);
|
|
7939
|
+
b && (S[`${I.id.replace(/\W/g, "")}`] = { browserValue: b?.variant?.color || "" });
|
|
7940
7940
|
}), await this.changeColors(
|
|
7941
7941
|
t,
|
|
7942
|
-
u.map((
|
|
7942
|
+
u.map((I) => I.regionElement),
|
|
7943
7943
|
r,
|
|
7944
7944
|
() => r.getCommandContext().getAllLayouts(),
|
|
7945
|
-
new Map(Object.entries(
|
|
7945
|
+
new Map(Object.entries(S))
|
|
7946
7946
|
);
|
|
7947
7947
|
}
|
|
7948
7948
|
if (t.data.colorPickerEnabled) {
|
|
7949
|
-
const
|
|
7950
|
-
if (
|
|
7951
|
-
const
|
|
7949
|
+
const S = await this.availableColors(t, r) || [], w = Object.keys(c.colors), I = S.length === 1 && w.length === 1;
|
|
7950
|
+
if (I) {
|
|
7951
|
+
const b = S[0], E = w[0];
|
|
7952
7952
|
await this.changeColors(
|
|
7953
7953
|
t,
|
|
7954
|
-
u.map((
|
|
7954
|
+
u.map((D) => D.regionElement),
|
|
7955
7955
|
r,
|
|
7956
7956
|
() => r.getCommandContext().getAllLayouts(),
|
|
7957
|
-
/* @__PURE__ */ new Map([[
|
|
7957
|
+
/* @__PURE__ */ new Map([[E, b.variant.color]])
|
|
7958
7958
|
);
|
|
7959
7959
|
}
|
|
7960
|
-
!
|
|
7960
|
+
!I && f.length === 0 && await this.changeColors(
|
|
7961
7961
|
t,
|
|
7962
|
-
u.map((
|
|
7962
|
+
u.map((b) => b.regionElement),
|
|
7963
7963
|
r,
|
|
7964
7964
|
() => r.getCommandContext().getAllLayouts(),
|
|
7965
7965
|
/* @__PURE__ */ new Map()
|
|
@@ -7969,12 +7969,12 @@ class zo {
|
|
|
7969
7969
|
};
|
|
7970
7970
|
}
|
|
7971
7971
|
}
|
|
7972
|
-
const
|
|
7972
|
+
const Se = new zo();
|
|
7973
7973
|
class Go {
|
|
7974
7974
|
async init(t, e, a) {
|
|
7975
7975
|
const i = t.option;
|
|
7976
7976
|
if (!i)
|
|
7977
|
-
throw new
|
|
7977
|
+
throw new Pe(t);
|
|
7978
7978
|
if (a)
|
|
7979
7979
|
await this.reload(t, e, a);
|
|
7980
7980
|
else {
|
|
@@ -7990,7 +7990,7 @@ class Go {
|
|
|
7990
7990
|
t.stepName,
|
|
7991
7991
|
a.serializableWorkflow.steps
|
|
7992
7992
|
), s = Object.values(a.layouts).map((c) => c.elements).flat().filter((c) => c.stepName === t.stepName), l = t.option;
|
|
7993
|
-
if (!l) throw new
|
|
7993
|
+
if (!l) throw new Pe(t);
|
|
7994
7994
|
if (i?.selectedVariants) {
|
|
7995
7995
|
const c = i.selectedVariants[0].id;
|
|
7996
7996
|
if (c) {
|
|
@@ -8049,7 +8049,7 @@ const oi = new Go();
|
|
|
8049
8049
|
class Wo {
|
|
8050
8050
|
async init(t, e, a) {
|
|
8051
8051
|
const i = t.option;
|
|
8052
|
-
if (!i) throw new
|
|
8052
|
+
if (!i) throw new Pe(t);
|
|
8053
8053
|
if (a)
|
|
8054
8054
|
await this.reload(t, e, a);
|
|
8055
8055
|
else {
|
|
@@ -8172,7 +8172,7 @@ class qo {
|
|
|
8172
8172
|
colors: {},
|
|
8173
8173
|
id: h,
|
|
8174
8174
|
svg: d,
|
|
8175
|
-
type:
|
|
8175
|
+
type: F.Illustration,
|
|
8176
8176
|
y: A.top,
|
|
8177
8177
|
x: A.left,
|
|
8178
8178
|
rotation: A.rotation,
|
|
@@ -8227,7 +8227,7 @@ class qo {
|
|
|
8227
8227
|
}
|
|
8228
8228
|
if (!/^$|^[a-zA-Z0-9 ]+$/.test(e))
|
|
8229
8229
|
return i("Unsupported characters."), { input: e, helperData: {}, errorData: { unsupportedCharacters: !0 } };
|
|
8230
|
-
const r =
|
|
8230
|
+
const r = ca(e.toLowerCase());
|
|
8231
8231
|
for (const o of r)
|
|
8232
8232
|
for (const s in a) {
|
|
8233
8233
|
const l = a[s].toLowerCase().replace(/\s/g, "");
|
|
@@ -8298,7 +8298,7 @@ class Ho {
|
|
|
8298
8298
|
stepRegion: A,
|
|
8299
8299
|
id: m,
|
|
8300
8300
|
src: o,
|
|
8301
|
-
type:
|
|
8301
|
+
type: F.Image,
|
|
8302
8302
|
y: A.top,
|
|
8303
8303
|
x: A.left,
|
|
8304
8304
|
rotation: A.rotation,
|
|
@@ -8401,14 +8401,14 @@ class Yo {
|
|
|
8401
8401
|
const i = a.getLayouts(), o = (a.getRegionElements(e.stepName) || []).map((s) => {
|
|
8402
8402
|
const l = s.region;
|
|
8403
8403
|
if (!i.find((d) => d.panelId === l?.panelId)) throw new K(l);
|
|
8404
|
-
return new
|
|
8404
|
+
return new fa(s.id, this.shapeFillId, t);
|
|
8405
8405
|
}).filter((s) => !!s);
|
|
8406
8406
|
a.getCommandDispatcher()(new L(o)), a.updateStorage(e.stepName, { colour: t });
|
|
8407
8407
|
}
|
|
8408
8408
|
async init(t, e, a) {
|
|
8409
8409
|
const i = t.option;
|
|
8410
8410
|
if (!i)
|
|
8411
|
-
throw new
|
|
8411
|
+
throw new Pe(t);
|
|
8412
8412
|
if (a)
|
|
8413
8413
|
await this.reload(t, e, a);
|
|
8414
8414
|
else {
|
|
@@ -8467,7 +8467,7 @@ class Yo {
|
|
|
8467
8467
|
if (!r.find((m) => m.panelId === A?.panelId))
|
|
8468
8468
|
throw new K(A);
|
|
8469
8469
|
const h = s();
|
|
8470
|
-
return new
|
|
8470
|
+
return new fa(d.id, this.shapeFillId, h);
|
|
8471
8471
|
}, c = a.map(l).filter((d) => !!d);
|
|
8472
8472
|
return {
|
|
8473
8473
|
command: new L(c),
|
|
@@ -8481,7 +8481,7 @@ class Yo {
|
|
|
8481
8481
|
};
|
|
8482
8482
|
} else {
|
|
8483
8483
|
const l = (u) => {
|
|
8484
|
-
const h = r.find((
|
|
8484
|
+
const h = r.find((S) => S.panelId === u.panelId);
|
|
8485
8485
|
if (!h)
|
|
8486
8486
|
throw new K(u);
|
|
8487
8487
|
const m = s(), p = `
|
|
@@ -8517,7 +8517,7 @@ class Yo {
|
|
|
8517
8517
|
colors: g,
|
|
8518
8518
|
id: f,
|
|
8519
8519
|
svg: p,
|
|
8520
|
-
type:
|
|
8520
|
+
type: F.Illustration,
|
|
8521
8521
|
y: u.top,
|
|
8522
8522
|
x: u.left,
|
|
8523
8523
|
rotation: u.rotation,
|
|
@@ -8587,11 +8587,11 @@ const Ko = new Jo(), aa = (n, t, e, a, i) => {
|
|
|
8587
8587
|
const A = Math.max(...s);
|
|
8588
8588
|
if (A <= n.width)
|
|
8589
8589
|
return [r, A];
|
|
8590
|
-
const u = s.reduce((g, f,
|
|
8590
|
+
const u = s.reduce((g, f, S, w) => f > w[g] ? S : g, 0), h = r[u];
|
|
8591
8591
|
let m = !1, p = h.length;
|
|
8592
8592
|
for (; !m && p > -1; ) {
|
|
8593
8593
|
p = h.lastIndexOf(" ", p - 1);
|
|
8594
|
-
const g = [h.slice(0, p), h.slice(p + 1)], f = g.map((
|
|
8594
|
+
const g = [h.slice(0, p), h.slice(p + 1)], f = g.map((w) => pt(w, a, i));
|
|
8595
8595
|
f[0] <= n.width && (r = [...r.slice(0, u), ...g, ...r.slice(u + 1)], s = [
|
|
8596
8596
|
...s.slice(0, u),
|
|
8597
8597
|
...f,
|
|
@@ -8601,7 +8601,7 @@ const Ko = new Jo(), aa = (n, t, e, a, i) => {
|
|
|
8601
8601
|
m || (c = !1);
|
|
8602
8602
|
}
|
|
8603
8603
|
return [null, null];
|
|
8604
|
-
},
|
|
8604
|
+
}, ve = (n, t, e, a, i) => {
|
|
8605
8605
|
let r, o;
|
|
8606
8606
|
const s = yt(t.assetUrl), l = s.getFont();
|
|
8607
8607
|
if (i.size) {
|
|
@@ -8619,16 +8619,16 @@ const Ko = new Jo(), aa = (n, t, e, a, i) => {
|
|
|
8619
8619
|
const A = d / l.unitsPerEm;
|
|
8620
8620
|
return [r, o] = aa(e, a, d, A, s), [d, r, o];
|
|
8621
8621
|
}, na = 30;
|
|
8622
|
-
class
|
|
8622
|
+
class Te extends Error {
|
|
8623
8623
|
constructor(t) {
|
|
8624
|
-
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name =
|
|
8624
|
+
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = Te.name;
|
|
8625
8625
|
}
|
|
8626
8626
|
}
|
|
8627
8627
|
const _o = ["‘", "’", "“", "”", `
|
|
8628
8628
|
`];
|
|
8629
|
-
class
|
|
8629
|
+
class Ne extends Error {
|
|
8630
8630
|
constructor(t) {
|
|
8631
|
-
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name =
|
|
8631
|
+
super(t), Object.setPrototypeOf(this, new.target.prototype), this.name = Ne.name;
|
|
8632
8632
|
}
|
|
8633
8633
|
}
|
|
8634
8634
|
class Xo {
|
|
@@ -8650,7 +8650,7 @@ class Xo {
|
|
|
8650
8650
|
}, this.textAlign = (t) => t.vertical ? "center" : t.textAlign || "center", this.getErrorsForText = (t, e, a, i) => {
|
|
8651
8651
|
let r;
|
|
8652
8652
|
a.data && a.data.maxLength && e.length > a.data.maxLength && (r || (r = {}), r.hitCharacterLimit = !0);
|
|
8653
|
-
const o = i.getWorkflowExperience().getProfanityList(), s =
|
|
8653
|
+
const o = i.getWorkflowExperience().getProfanityList(), s = ca(t.toLowerCase());
|
|
8654
8654
|
for (const c of s)
|
|
8655
8655
|
for (const d in o) {
|
|
8656
8656
|
const A = o[d].toLowerCase().replace(/\s/g, "");
|
|
@@ -8670,7 +8670,7 @@ class Xo {
|
|
|
8670
8670
|
if (a)
|
|
8671
8671
|
await this.reload(t, e, a);
|
|
8672
8672
|
else {
|
|
8673
|
-
const r = this.getDefaultImageFillVariant(t.data), o = r?.asset?.fileLink, s = o ? await
|
|
8673
|
+
const r = this.getDefaultImageFillVariant(t.data), o = r?.asset?.fileLink, s = o ? await pa(o) : void 0, l = s ? {
|
|
8674
8674
|
src: s.src,
|
|
8675
8675
|
height: s.height,
|
|
8676
8676
|
width: s.width,
|
|
@@ -8777,7 +8777,7 @@ class Xo {
|
|
|
8777
8777
|
const a = e.variants?.map((i) => i.asset?.fileLink)?.filter((i) => !!i) || [];
|
|
8778
8778
|
return Promise.all(
|
|
8779
8779
|
a.map(async (i) => {
|
|
8780
|
-
const r = await
|
|
8780
|
+
const r = await pa(i);
|
|
8781
8781
|
return {
|
|
8782
8782
|
src: i,
|
|
8783
8783
|
width: r.width,
|
|
@@ -8840,7 +8840,7 @@ class Xo {
|
|
|
8840
8840
|
}
|
|
8841
8841
|
getProcessedInput(t, e, a) {
|
|
8842
8842
|
const i = a ? t : this.injectReplaceableText(t, e);
|
|
8843
|
-
return
|
|
8843
|
+
return ke(i, {
|
|
8844
8844
|
vertical: e.vertical,
|
|
8845
8845
|
uppercase: e.uppercase
|
|
8846
8846
|
});
|
|
@@ -8857,7 +8857,7 @@ class Xo {
|
|
|
8857
8857
|
const c = [], d = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map();
|
|
8858
8858
|
for (const u of e) {
|
|
8859
8859
|
if (!u.fontData) throw new R("Failed to resolve font data for text.");
|
|
8860
|
-
const [h, m] =
|
|
8860
|
+
const [h, m] = ve(
|
|
8861
8861
|
u.fontSize,
|
|
8862
8862
|
u.fontData,
|
|
8863
8863
|
{ left: u.x, top: u.y, width: u.width, height: u.height, rotation: u.rotation },
|
|
@@ -8911,11 +8911,11 @@ class Xo {
|
|
|
8911
8911
|
const p = e.getWorkflowExperience().getBundle();
|
|
8912
8912
|
if (p && t.globalPropertyAspectConfigurations) {
|
|
8913
8913
|
const f = p.getGlobalPropertyConfiguration()?.aspects?.find(
|
|
8914
|
-
(
|
|
8914
|
+
(S) => S.type === G.Text && t.globalPropertyAspectConfigurations?.map((w) => w.aspectName).includes(S.name)
|
|
8915
8915
|
);
|
|
8916
8916
|
if (f) {
|
|
8917
|
-
const
|
|
8918
|
-
|
|
8917
|
+
const w = p.getGlobalPropertyStateManager().getAspect(f.name);
|
|
8918
|
+
w && (m = w);
|
|
8919
8919
|
}
|
|
8920
8920
|
}
|
|
8921
8921
|
if (await e.setSelectionsAndElements(
|
|
@@ -8924,7 +8924,7 @@ class Xo {
|
|
|
8924
8924
|
u,
|
|
8925
8925
|
async () => {
|
|
8926
8926
|
e.updateMetadata(t.stepName, { color: h, text: m }), e.updateStorage(t.stepName, { text: m, inputText: m });
|
|
8927
|
-
const g = s.map((
|
|
8927
|
+
const g = s.map((S) => new en(S.id, A)), f = new L(g);
|
|
8928
8928
|
e.getCommandDispatcher()(f);
|
|
8929
8929
|
}
|
|
8930
8930
|
), s.length === 0 && l) {
|
|
@@ -9027,7 +9027,7 @@ class Xo {
|
|
|
9027
9027
|
async selectVariantCommand(t, e, a, i, r, o, s, l, c) {
|
|
9028
9028
|
const d = r.markUpdatePending(), A = await this.fontDataFromVariant(e);
|
|
9029
9029
|
if (i.length > 0) {
|
|
9030
|
-
const u = i.map((p) => new
|
|
9030
|
+
const u = i.map((p) => new en(p.id, A));
|
|
9031
9031
|
if (l) {
|
|
9032
9032
|
const p = i.map((g) => new ta(g.id, l));
|
|
9033
9033
|
u.push(...p);
|
|
@@ -9109,7 +9109,7 @@ class Xo {
|
|
|
9109
9109
|
const m = o.getLayouts().find((g) => g.panelId === u.panelId), p = M();
|
|
9110
9110
|
try {
|
|
9111
9111
|
if (!m)
|
|
9112
|
-
throw new
|
|
9112
|
+
throw new Ne("Failed to find layout for region: " + u.panelId);
|
|
9113
9113
|
const g = a.colorOption;
|
|
9114
9114
|
let f;
|
|
9115
9115
|
if (g && g.variants) {
|
|
@@ -9118,11 +9118,11 @@ class Xo {
|
|
|
9118
9118
|
colorProfileAssetKey: g.colorProfile?.key
|
|
9119
9119
|
});
|
|
9120
9120
|
}
|
|
9121
|
-
const
|
|
9121
|
+
const S = await this.getDefaultColor(a), w = S || "#000000", I = {
|
|
9122
9122
|
stepRegion: u,
|
|
9123
9123
|
stepName: t,
|
|
9124
9124
|
align: this.textAlign(a),
|
|
9125
|
-
fill: r.color ? r.color :
|
|
9125
|
+
fill: r.color ? r.color : w,
|
|
9126
9126
|
fontSize: a.size || na,
|
|
9127
9127
|
fontData: i,
|
|
9128
9128
|
id: p,
|
|
@@ -9131,7 +9131,7 @@ class Xo {
|
|
|
9131
9131
|
rotation: u.rotation,
|
|
9132
9132
|
text: c,
|
|
9133
9133
|
input: s,
|
|
9134
|
-
type:
|
|
9134
|
+
type: F.Textbox,
|
|
9135
9135
|
vertical: a.vertical,
|
|
9136
9136
|
x: u.left,
|
|
9137
9137
|
y: u.top,
|
|
@@ -9142,40 +9142,40 @@ class Xo {
|
|
|
9142
9142
|
curved: a.curved,
|
|
9143
9143
|
paths: a.paths,
|
|
9144
9144
|
fillSpotColorDefinition: f
|
|
9145
|
-
},
|
|
9146
|
-
if (!
|
|
9147
|
-
const [x, T] =
|
|
9148
|
-
|
|
9149
|
-
|
|
9145
|
+
}, b = [], E = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map();
|
|
9146
|
+
if (!I.fontData) throw new R("Failed to resolve font data for text.");
|
|
9147
|
+
const [x, T] = ve(
|
|
9148
|
+
I.fontSize,
|
|
9149
|
+
I.fontData,
|
|
9150
9150
|
{
|
|
9151
|
-
left:
|
|
9152
|
-
top:
|
|
9153
|
-
width:
|
|
9154
|
-
height:
|
|
9155
|
-
rotation:
|
|
9151
|
+
left: I.x,
|
|
9152
|
+
top: I.y,
|
|
9153
|
+
width: I.width,
|
|
9154
|
+
height: I.height,
|
|
9155
|
+
rotation: I.rotation,
|
|
9156
9156
|
panelId: ""
|
|
9157
9157
|
},
|
|
9158
9158
|
[c],
|
|
9159
9159
|
{ size: a.size, minSize: a.minSize, maxSize: a.maxSize }
|
|
9160
9160
|
);
|
|
9161
|
-
|
|
9161
|
+
E.set(I.id, x), D.set(I.id, T);
|
|
9162
9162
|
const $ = a.curved || a.vertical ? c : (T || []).join(`
|
|
9163
9163
|
`);
|
|
9164
|
-
|
|
9165
|
-
this.generateTextChangeCommandsForRegion(x, a,
|
|
9164
|
+
b.push(
|
|
9165
|
+
this.generateTextChangeCommandsForRegion(x, a, I.id, $)
|
|
9166
9166
|
);
|
|
9167
|
-
const
|
|
9167
|
+
const B = new H(I, m);
|
|
9168
9168
|
return {
|
|
9169
9169
|
regionElement: { id: p, region: u },
|
|
9170
|
-
commands: [
|
|
9171
|
-
newElement:
|
|
9170
|
+
commands: [B, ...b],
|
|
9171
|
+
newElement: I,
|
|
9172
9172
|
fontData: i
|
|
9173
9173
|
};
|
|
9174
9174
|
} catch (g) {
|
|
9175
|
-
throw console.log(g), new
|
|
9175
|
+
throw console.log(g), new Te("Error adding font to region");
|
|
9176
9176
|
}
|
|
9177
9177
|
}, A = await Promise.all(a.regions.map(d)).catch((u) => {
|
|
9178
|
-
throw u instanceof
|
|
9178
|
+
throw u instanceof Te ? (Ko.setLatestToast("Failed to load font.", qe.Error), u) : u instanceof Ne ? u : new Error(u);
|
|
9179
9179
|
});
|
|
9180
9180
|
return await o.setSelectionsAndElements(
|
|
9181
9181
|
t,
|
|
@@ -9203,53 +9203,53 @@ class Xo {
|
|
|
9203
9203
|
*/
|
|
9204
9204
|
async changeInputTextWithRegion(t, e, a, i, r, o, s, l, c, d) {
|
|
9205
9205
|
const A = (i || "").replace(/^(?![\u000A\u000D])[\u0000-\u001F\u007F-\u009F]/g, ""), u = xt(A, o), h = this.getProcessedInput(u, t.data, s), m = o.getRegionElements(t.stepName), p = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
|
|
9206
|
-
for (const
|
|
9207
|
-
if (
|
|
9208
|
-
const [
|
|
9206
|
+
for (const b of m)
|
|
9207
|
+
if (b.region) {
|
|
9208
|
+
const [E, D] = ve(
|
|
9209
9209
|
e,
|
|
9210
9210
|
a,
|
|
9211
|
-
|
|
9211
|
+
b.region,
|
|
9212
9212
|
[h],
|
|
9213
9213
|
{ size: t.data.size, minSize: t.data.minSize, maxSize: t.data.maxSize }
|
|
9214
9214
|
);
|
|
9215
|
-
p.set(
|
|
9215
|
+
p.set(b.id, E), g.set(b.id, D);
|
|
9216
9216
|
}
|
|
9217
|
-
const
|
|
9217
|
+
const S = (() => {
|
|
9218
9218
|
if (t.data && t.data.maxLength && h.length > t.data.maxLength)
|
|
9219
9219
|
return d && d(!0), { info: "0" };
|
|
9220
|
-
const
|
|
9221
|
-
for (const
|
|
9222
|
-
for (const x in
|
|
9223
|
-
const T =
|
|
9224
|
-
if (
|
|
9220
|
+
const b = o.getWorkflowExperience().getProfanityList(), E = ca(h.toLowerCase());
|
|
9221
|
+
for (const D of E)
|
|
9222
|
+
for (const x in b) {
|
|
9223
|
+
const T = b[x].toLowerCase().replace(/\s/g, "");
|
|
9224
|
+
if (D === T)
|
|
9225
9225
|
return l(!0), { error: "Blocked profanity." };
|
|
9226
9226
|
}
|
|
9227
9227
|
return !t.data.vertical && !t.data.allowNewlines && (h.includes(`
|
|
9228
9228
|
`) || h.includes("\r")) ? (l(!0), { error: "Cannot span multiple lines." }) : !t.data.curved && !Array.from(g.values()).every((x) => x) ? (l(!0), { error: "Does not fit." }) : (l(!1), { info: (t.data.maxLength - h.length).toString() });
|
|
9229
9229
|
})();
|
|
9230
|
-
if (
|
|
9231
|
-
c(
|
|
9230
|
+
if (S.error) {
|
|
9231
|
+
c(S.error);
|
|
9232
9232
|
return;
|
|
9233
9233
|
}
|
|
9234
|
-
if (c(`${
|
|
9234
|
+
if (c(`${S.info} characters remaining` || ""), d)
|
|
9235
9235
|
return;
|
|
9236
9236
|
o.updateStorage(t.stepName, { text: A }), o.updateMetadata(t.stepName, {
|
|
9237
9237
|
text: this.injectReplaceableText(A, t.data)
|
|
9238
9238
|
}), (r.defaultCleared || !t.data.deleteDefaultOnFocus) && A.trim() !== "" && o.setMandatoryFulfilled(t.stepName, !0);
|
|
9239
|
-
const
|
|
9240
|
-
for (const
|
|
9241
|
-
const
|
|
9239
|
+
const w = [];
|
|
9240
|
+
for (const b of m) {
|
|
9241
|
+
const E = t.data.curved ? h : (g.get(b.id) || []).join(`
|
|
9242
9242
|
`);
|
|
9243
|
-
|
|
9243
|
+
w.push(
|
|
9244
9244
|
this.generateTextChangeCommandsForRegion(
|
|
9245
|
-
p.get(
|
|
9245
|
+
p.get(b.id) || 1,
|
|
9246
9246
|
t.data,
|
|
9247
|
-
|
|
9248
|
-
|
|
9247
|
+
b.id,
|
|
9248
|
+
E
|
|
9249
9249
|
)
|
|
9250
9250
|
);
|
|
9251
9251
|
}
|
|
9252
|
-
return new L(
|
|
9252
|
+
return new L(w);
|
|
9253
9253
|
}
|
|
9254
9254
|
}
|
|
9255
9255
|
const j = new Xo();
|
|
@@ -9259,13 +9259,13 @@ const ts = "data:application/octet-stream;base64,AAEAAAAPAIAAAwBwRkZUTYdHeHoAAEl
|
|
|
9259
9259
|
const e = at("rect");
|
|
9260
9260
|
return e.setAttribute("height", `${n}`), e.setAttribute("width", `${t}`), e;
|
|
9261
9261
|
}, as = (n, t, e, a) => {
|
|
9262
|
-
const i =
|
|
9262
|
+
const i = de("filter");
|
|
9263
9263
|
i.setAttribute("id", a), i.setAttribute("height", "200%"), i.setAttribute("width", "200%"), i.setAttribute("x", "-50%"), i.setAttribute("y", "-50%");
|
|
9264
|
-
const r =
|
|
9264
|
+
const r = de("feOffset");
|
|
9265
9265
|
i.appendChild(r), r.setAttribute("result", "offOut"), r.setAttribute("in", "SourceAlpha"), r.setAttribute("dx", `${n}`), r.setAttribute("dy", `${t}`);
|
|
9266
|
-
const o =
|
|
9266
|
+
const o = de("feGaussianBlur");
|
|
9267
9267
|
i.appendChild(o), o.setAttribute("result", "blurOut"), o.setAttribute("in", "offOut"), o.setAttribute("stdDeviation", `${e}`);
|
|
9268
|
-
const s =
|
|
9268
|
+
const s = de("feBlend");
|
|
9269
9269
|
return i.appendChild(s), s.setAttribute("in", "SourceGraphic"), s.setAttribute("in2", "blurOut"), s.setAttribute("mode", "normal"), i;
|
|
9270
9270
|
}, ns = (n) => {
|
|
9271
9271
|
let t = n;
|
|
@@ -9287,7 +9287,7 @@ function rs(n, t, e, a) {
|
|
|
9287
9287
|
const i = e / n, r = a / t;
|
|
9288
9288
|
return i > 1 && r > 1 ? Math.min(i, r) : i > 1 && r < 1 ? r : i < 1 && r > 1 ? i : Math.min(i, r);
|
|
9289
9289
|
}
|
|
9290
|
-
const
|
|
9290
|
+
const nn = {
|
|
9291
9291
|
m: ["x", "y"],
|
|
9292
9292
|
z: [],
|
|
9293
9293
|
l: ["x", "y"],
|
|
@@ -9317,7 +9317,7 @@ class os {
|
|
|
9317
9317
|
const i = (r) => {
|
|
9318
9318
|
const o = [], s = r.relative ? r.type : r.type.toUpperCase();
|
|
9319
9319
|
let l = e !== s;
|
|
9320
|
-
const c =
|
|
9320
|
+
const c = nn[r.type];
|
|
9321
9321
|
l && (o.push(s), e = s);
|
|
9322
9322
|
for (const d of c) {
|
|
9323
9323
|
const A = r[d];
|
|
@@ -9330,7 +9330,7 @@ class os {
|
|
|
9330
9330
|
u = (A * 100 | 0) / 100;
|
|
9331
9331
|
break;
|
|
9332
9332
|
default:
|
|
9333
|
-
throw new
|
|
9333
|
+
throw new Ft("Failed to encode path.");
|
|
9334
9334
|
}
|
|
9335
9335
|
l || o.push(" "), o.push(u), l = !1;
|
|
9336
9336
|
}
|
|
@@ -9342,14 +9342,14 @@ class os {
|
|
|
9342
9342
|
const e = /([mzlhvcsqta])([^mzlhvcsqta]*)/gi, a = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, i = [];
|
|
9343
9343
|
let r;
|
|
9344
9344
|
for (e.lastIndex = 0; r = e.exec(t); ) {
|
|
9345
|
-
const o = r[1].toLowerCase(), s = (r[2].match(a) || []).map(parseFloat), l = o === r[1], c =
|
|
9345
|
+
const o = r[1].toLowerCase(), s = (r[2].match(a) || []).map(parseFloat), l = o === r[1], c = nn[o];
|
|
9346
9346
|
if (s.length < c.length)
|
|
9347
|
-
throw new
|
|
9347
|
+
throw new Ft(
|
|
9348
9348
|
`Path type "${o}" given ${s.length} arguments, expected ${c.length}.`
|
|
9349
9349
|
);
|
|
9350
9350
|
if (c.length > 0) {
|
|
9351
9351
|
if (s.length % c.length !== 0)
|
|
9352
|
-
throw new
|
|
9352
|
+
throw new Ft(
|
|
9353
9353
|
`Path type "${o}" given ${s.length} arguments, not divisible by ${c.length}`
|
|
9354
9354
|
);
|
|
9355
9355
|
for (let d = 0; d < s.length / c.length; d++) {
|
|
@@ -9374,7 +9374,7 @@ class os {
|
|
|
9374
9374
|
if (s in r && l in r) {
|
|
9375
9375
|
const c = [r[s], r[l]], d = e(c);
|
|
9376
9376
|
if (d.length < 2)
|
|
9377
|
-
throw new
|
|
9377
|
+
throw new Ft("Transformer must return at least 2 points.");
|
|
9378
9378
|
r[s] = d[0], r[l] = d[1];
|
|
9379
9379
|
}
|
|
9380
9380
|
}
|
|
@@ -9408,21 +9408,21 @@ class ss extends Zo {
|
|
|
9408
9408
|
return this.svgElement(t, e);
|
|
9409
9409
|
}
|
|
9410
9410
|
svgElement(t, e) {
|
|
9411
|
-
const a = yo(ts), r = t !== "" ? ((
|
|
9412
|
-
const
|
|
9413
|
-
|
|
9414
|
-
const
|
|
9415
|
-
|
|
9416
|
-
const
|
|
9417
|
-
|
|
9418
|
-
const
|
|
9419
|
-
|
|
9420
|
-
const
|
|
9421
|
-
|
|
9411
|
+
const a = yo(ts), r = t !== "" ? ((w) => w.charAt(0).toUpperCase() + w.substr(1).toLowerCase())(t) : "", o = a.getPath(r, 0, 72, 72), s = o.toSVG(2), l = o.getBoundingBox(), c = l.x2 - l.x1, d = o.toPathData(3), A = () => {
|
|
9412
|
+
const w = at("g");
|
|
9413
|
+
w.classList.add("module-text-group");
|
|
9414
|
+
const I = at("defs");
|
|
9415
|
+
w.appendChild(I), I.appendChild(as(0, 2, 2, "shadow"));
|
|
9416
|
+
const b = at("path");
|
|
9417
|
+
b.setAttribute("d", d), b.setAttribute("stroke", "black"), b.setAttribute("stroke-width", "3"), I.appendChild(b);
|
|
9418
|
+
const E = at("g");
|
|
9419
|
+
E.classList.add("module-layer0"), w.appendChild(E), E.setAttribute("filter", "url(#shadow)"), E.innerHTML = b.outerHTML;
|
|
9420
|
+
const D = at("g");
|
|
9421
|
+
D.classList.add("module-layer1"), w.appendChild(D), D.setAttribute("stroke-width", "3"), D.setAttribute("stroke", "rgb(45,41,38)"), D.setAttribute("fill", "rgb(45,41,38)"), D.setAttribute("transform", "translate(0.5,0)"), D.innerHTML = s;
|
|
9422
9422
|
const x = at("g");
|
|
9423
|
-
x.classList.add("module-layer2"),
|
|
9423
|
+
x.classList.add("module-layer2"), w.appendChild(x), x.setAttribute("fill", "rgb(255,209,0)"), x.setAttribute("transform", "translate(1,-0.1)"), x.innerHTML = s;
|
|
9424
9424
|
const T = at("g");
|
|
9425
|
-
return T.classList.add("module-layer3"),
|
|
9425
|
+
return T.classList.add("module-layer3"), w.appendChild(T), T.setAttribute("fill", "white"), T.innerHTML = s, new os(w).transform(([B, Q]) => [B, Q + (c / 2 - B) ** 2 / (c * 6)]), w;
|
|
9426
9426
|
}, u = at("g");
|
|
9427
9427
|
u.classList.add("module-root");
|
|
9428
9428
|
const h = at("defs");
|
|
@@ -9435,8 +9435,8 @@ class ss extends Zo {
|
|
|
9435
9435
|
g.classList.add("module-text-enclosure"), u.appendChild(g);
|
|
9436
9436
|
const f = A();
|
|
9437
9437
|
g.appendChild(f);
|
|
9438
|
-
const
|
|
9439
|
-
return is(g,
|
|
9438
|
+
const S = Oi(d);
|
|
9439
|
+
return is(g, S, e.height, e.width, 0.35, 0.65), ns(u.outerHTML);
|
|
9440
9440
|
}
|
|
9441
9441
|
}
|
|
9442
9442
|
async function Ai(n) {
|
|
@@ -9458,8 +9458,8 @@ const ls = [
|
|
|
9458
9458
|
"tspan"
|
|
9459
9459
|
], cs = async (n, t, e) => {
|
|
9460
9460
|
const a = t.data, i = e.data.baseUrl, r = a.assetUrl.replace("localhost", "localstack"), o = i.slice(0, 4) === "http" ? "" : "https://", s = new URL(o + i);
|
|
9461
|
-
s.searchParams.append("video",
|
|
9462
|
-
const l = s.toString(), d = `data:image/svg+xml;base64,${
|
|
9461
|
+
s.searchParams.append("video", Ha(JSON.stringify([{ href: r }]))), s.pathname = s.pathname + (s.pathname.slice(-1) === "/" ? "" : "/");
|
|
9462
|
+
const l = s.toString(), d = `data:image/svg+xml;base64,${Ha(await Sn(l, { type: "svg" }))}`, A = (h) => {
|
|
9463
9463
|
const m = n.find((g) => g.panelId === h.panelId);
|
|
9464
9464
|
if (!m)
|
|
9465
9465
|
throw new K(h);
|
|
@@ -9468,7 +9468,7 @@ const ls = [
|
|
|
9468
9468
|
{
|
|
9469
9469
|
id: p,
|
|
9470
9470
|
src: d,
|
|
9471
|
-
type:
|
|
9471
|
+
type: F.Image,
|
|
9472
9472
|
y: h.top,
|
|
9473
9473
|
x: h.left,
|
|
9474
9474
|
width: h.width,
|
|
@@ -9484,15 +9484,15 @@ const ls = [
|
|
|
9484
9484
|
return console.error(h), [];
|
|
9485
9485
|
}
|
|
9486
9486
|
}, ds = async (n, t, e, a) => {
|
|
9487
|
-
const i = e.data, r = i.assetUrl, o = await
|
|
9487
|
+
const i = e.data, r = i.assetUrl, o = await pa(r);
|
|
9488
9488
|
try {
|
|
9489
9489
|
const s = Mo(i, a.option);
|
|
9490
9490
|
s && (t[a.stepName] = { selectedVariants: [s] });
|
|
9491
9491
|
const l = async (c) => {
|
|
9492
|
-
const d = await ti(c, s?.asset?.fileLink), A = await
|
|
9492
|
+
const d = await ti(c, s?.asset?.fileLink), A = await ze(d), u = M(), h = n.find((p) => p.panelId === c.panelId);
|
|
9493
9493
|
if (!h)
|
|
9494
9494
|
throw new K(c);
|
|
9495
|
-
const m =
|
|
9495
|
+
const m = Ta(
|
|
9496
9496
|
o,
|
|
9497
9497
|
A,
|
|
9498
9498
|
{
|
|
@@ -9507,7 +9507,7 @@ const ls = [
|
|
|
9507
9507
|
{
|
|
9508
9508
|
id: u,
|
|
9509
9509
|
path: A.path,
|
|
9510
|
-
type:
|
|
9510
|
+
type: F.Frame,
|
|
9511
9511
|
forceImageCover: a.data.forceImageCover,
|
|
9512
9512
|
x: c.left,
|
|
9513
9513
|
y: c.top,
|
|
@@ -9544,7 +9544,7 @@ const ls = [
|
|
|
9544
9544
|
const i = e.data, r = a.option;
|
|
9545
9545
|
if (!r)
|
|
9546
9546
|
return console.error(`No option for step ${a.stepName}.`), [];
|
|
9547
|
-
const o = r.variants?.find((
|
|
9547
|
+
const o = r.variants?.find((b) => b.id === i.illustrationVariantId) || le(r);
|
|
9548
9548
|
if (!o)
|
|
9549
9549
|
return console.error(`No variant with ID: ${i.illustrationVariantId}`), [];
|
|
9550
9550
|
if (!o.asset)
|
|
@@ -9556,57 +9556,57 @@ const ls = [
|
|
|
9556
9556
|
const l = await nt(s, !0), c = /<svg.*?<\/svg>/s, d = l.match(c) || [], A = d?.length > 0 ? d[0] : "", m = At().parseFromString(A, "image/svg+xml").firstElementChild;
|
|
9557
9557
|
if (!m)
|
|
9558
9558
|
return console.error("Failed to read SVG."), [];
|
|
9559
|
-
|
|
9559
|
+
Pa(m);
|
|
9560
9560
|
const p = {};
|
|
9561
|
-
Mt(m, (
|
|
9562
|
-
ls.includes(
|
|
9563
|
-
const
|
|
9564
|
-
if (
|
|
9565
|
-
const x =
|
|
9566
|
-
|
|
9567
|
-
}
|
|
9568
|
-
const
|
|
9569
|
-
if (
|
|
9570
|
-
const x =
|
|
9571
|
-
|
|
9561
|
+
Mt(m, (b) => {
|
|
9562
|
+
ls.includes(b.tagName) && !b.attributes.getNamedItem("fill") && b.setAttribute("fill", "#000000");
|
|
9563
|
+
const E = b.attributes.getNamedItem("fill");
|
|
9564
|
+
if (E && E.value !== "none") {
|
|
9565
|
+
const x = E.value, $ = `spiff-fill-${x.replace(/\W/g, "")}`;
|
|
9566
|
+
b.classList.add($), p[$] = { browserValue: x };
|
|
9567
|
+
}
|
|
9568
|
+
const D = b.attributes.getNamedItem("stroke");
|
|
9569
|
+
if (D && D.value !== "none") {
|
|
9570
|
+
const x = D.value, $ = `spiff-stroke-${x.replace(/\W/g, "")}`;
|
|
9571
|
+
b.classList.add($), p[$] = { browserValue: x };
|
|
9572
9572
|
}
|
|
9573
9573
|
});
|
|
9574
|
-
const f = Pt().serializeToString(m),
|
|
9575
|
-
if (
|
|
9576
|
-
for (const [
|
|
9577
|
-
for (const
|
|
9578
|
-
if (
|
|
9579
|
-
p[
|
|
9574
|
+
const f = Pt().serializeToString(m), S = i.colors;
|
|
9575
|
+
if (S) {
|
|
9576
|
+
for (const [b, E] of Object.entries(p))
|
|
9577
|
+
for (const D of Object.keys(S))
|
|
9578
|
+
if (E.browserValue === D) {
|
|
9579
|
+
p[b] = { browserValue: S[D] };
|
|
9580
9580
|
break;
|
|
9581
9581
|
}
|
|
9582
9582
|
}
|
|
9583
|
-
const
|
|
9584
|
-
const
|
|
9585
|
-
if (!
|
|
9586
|
-
throw new K(
|
|
9587
|
-
const
|
|
9583
|
+
const w = (b) => {
|
|
9584
|
+
const E = n.find((x) => x.panelId === b.panelId);
|
|
9585
|
+
if (!E)
|
|
9586
|
+
throw new K(b);
|
|
9587
|
+
const D = M();
|
|
9588
9588
|
return new H(
|
|
9589
9589
|
{
|
|
9590
9590
|
colors: p,
|
|
9591
|
-
id:
|
|
9591
|
+
id: D,
|
|
9592
9592
|
svg: f,
|
|
9593
|
-
type:
|
|
9594
|
-
y:
|
|
9595
|
-
x:
|
|
9596
|
-
rotation:
|
|
9597
|
-
width:
|
|
9598
|
-
height:
|
|
9599
|
-
layer:
|
|
9600
|
-
layerIndex:
|
|
9601
|
-
immutable:
|
|
9593
|
+
type: F.Illustration,
|
|
9594
|
+
y: b.top,
|
|
9595
|
+
x: b.left,
|
|
9596
|
+
rotation: b.rotation,
|
|
9597
|
+
width: b.width,
|
|
9598
|
+
height: b.height,
|
|
9599
|
+
layer: b.layer,
|
|
9600
|
+
layerIndex: b.layerIndex,
|
|
9601
|
+
immutable: b.immutable
|
|
9602
9602
|
},
|
|
9603
|
-
|
|
9603
|
+
E
|
|
9604
9604
|
);
|
|
9605
|
-
},
|
|
9605
|
+
}, I = a.data.regions;
|
|
9606
9606
|
try {
|
|
9607
|
-
return
|
|
9608
|
-
} catch (
|
|
9609
|
-
return console.error(
|
|
9607
|
+
return I.map(w);
|
|
9608
|
+
} catch (b) {
|
|
9609
|
+
return console.error(b), [];
|
|
9610
9610
|
}
|
|
9611
9611
|
}, us = async (n, t, e) => {
|
|
9612
9612
|
const a = await Ai(e.data.module), i = t.data, r = (s, l) => {
|
|
@@ -9619,7 +9619,7 @@ const ls = [
|
|
|
9619
9619
|
colors: {},
|
|
9620
9620
|
id: d,
|
|
9621
9621
|
svg: s,
|
|
9622
|
-
type:
|
|
9622
|
+
type: F.Illustration,
|
|
9623
9623
|
y: l.top,
|
|
9624
9624
|
x: l.left,
|
|
9625
9625
|
rotation: l.rotation,
|
|
@@ -9660,7 +9660,7 @@ const ls = [
|
|
|
9660
9660
|
{
|
|
9661
9661
|
id: u,
|
|
9662
9662
|
src: s,
|
|
9663
|
-
type:
|
|
9663
|
+
type: F.Image,
|
|
9664
9664
|
y: d.top,
|
|
9665
9665
|
x: d.left,
|
|
9666
9666
|
rotation: d.rotation,
|
|
@@ -9717,7 +9717,7 @@ const ls = [
|
|
|
9717
9717
|
colors: h,
|
|
9718
9718
|
id: m,
|
|
9719
9719
|
svg: A,
|
|
9720
|
-
type:
|
|
9720
|
+
type: F.Illustration,
|
|
9721
9721
|
y: c.top,
|
|
9722
9722
|
x: c.left,
|
|
9723
9723
|
rotation: c.rotation,
|
|
@@ -9736,7 +9736,7 @@ const ls = [
|
|
|
9736
9736
|
return console.error(c), [];
|
|
9737
9737
|
}
|
|
9738
9738
|
}, gs = async (n, t, e) => {
|
|
9739
|
-
const a = [], r = t.type ===
|
|
9739
|
+
const a = [], r = t.type === v.ProductOverlay ? e || t.data.asset?.fileLink || "" : t.data.asset?.fileLink || "", s = r.endsWith(".jpeg") || r.endsWith(".jpg") || r.endsWith(".png") ? F.Image : (r.endsWith(".svg"), F.Illustration), l = t.data.regions;
|
|
9740
9740
|
if (s === "image")
|
|
9741
9741
|
try {
|
|
9742
9742
|
l.forEach((c) => {
|
|
@@ -9753,7 +9753,7 @@ const ls = [
|
|
|
9753
9753
|
height: c.height,
|
|
9754
9754
|
layer: c.layer,
|
|
9755
9755
|
layerIndex: c.layerIndex,
|
|
9756
|
-
productOverlay: t.type ===
|
|
9756
|
+
productOverlay: t.type === v.ProductOverlay ? !0 : void 0,
|
|
9757
9757
|
scaleX: 1,
|
|
9758
9758
|
scaleY: 1,
|
|
9759
9759
|
rotation: c.rotation,
|
|
@@ -9769,8 +9769,8 @@ const ls = [
|
|
|
9769
9769
|
const c = await nt(r, !0), d = (A) => {
|
|
9770
9770
|
const u = /<svg.*?<\/svg>/s, h = A.match(u) || [], m = h?.length > 0 ? h[0] : "", f = At().parseFromString(m, "image/svg+xml").firstElementChild;
|
|
9771
9771
|
if (!f)
|
|
9772
|
-
throw new
|
|
9773
|
-
return
|
|
9772
|
+
throw new Ft("Failed to read SVG.");
|
|
9773
|
+
return Pa(f), Pt().serializeToString(f);
|
|
9774
9774
|
};
|
|
9775
9775
|
l.forEach((A) => {
|
|
9776
9776
|
const u = n.find((m) => m.panelId === A.panelId);
|
|
@@ -9792,7 +9792,7 @@ const ls = [
|
|
|
9792
9792
|
scaleX: 1,
|
|
9793
9793
|
scaleY: 1,
|
|
9794
9794
|
rotation: A.rotation,
|
|
9795
|
-
productOverlay: t.type ===
|
|
9795
|
+
productOverlay: t.type === v.ProductOverlay ? !0 : void 0,
|
|
9796
9796
|
excludeFromExport: t.data.excludeFromPrint
|
|
9797
9797
|
};
|
|
9798
9798
|
a.push(new H(h, u));
|
|
@@ -9804,13 +9804,13 @@ const ls = [
|
|
|
9804
9804
|
const g = a.option;
|
|
9805
9805
|
if (!g)
|
|
9806
9806
|
return;
|
|
9807
|
-
const f = g.variants?.find((
|
|
9807
|
+
const f = g.variants?.find((w) => w.id === r.fontVariantId) || le(g);
|
|
9808
9808
|
if (!f || !f.asset)
|
|
9809
9809
|
return;
|
|
9810
9810
|
t[a.stepName] = { selectedVariants: [f] };
|
|
9811
|
-
const
|
|
9812
|
-
if (
|
|
9813
|
-
return
|
|
9811
|
+
const S = f.asset.fileLink;
|
|
9812
|
+
if (S)
|
|
9813
|
+
return S;
|
|
9814
9814
|
}, d = await (async () => {
|
|
9815
9815
|
const g = l();
|
|
9816
9816
|
if (!g)
|
|
@@ -9820,7 +9820,7 @@ const ls = [
|
|
|
9820
9820
|
assetUrl: g,
|
|
9821
9821
|
name: f.names.fullName.en
|
|
9822
9822
|
};
|
|
9823
|
-
})(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", r.text) : r.text) || "", u =
|
|
9823
|
+
})(), A = (a.data.replaceableText ? a.data.replaceableText.replace("{{}}", r.text) : r.text) || "", u = ke(A, {
|
|
9824
9824
|
vertical: a.data.vertical,
|
|
9825
9825
|
uppercase: a.data.uppercase
|
|
9826
9826
|
}), h = async (g) => {
|
|
@@ -9828,10 +9828,10 @@ const ls = [
|
|
|
9828
9828
|
return f ? J.getDefaultVariant(f)?.color : void 0;
|
|
9829
9829
|
}, m = r.color || await h(a.data), p = a.data.regions;
|
|
9830
9830
|
for (const g of p) {
|
|
9831
|
-
const f = n.find((
|
|
9831
|
+
const f = n.find((w) => w.panelId === g.panelId);
|
|
9832
9832
|
if (!f)
|
|
9833
9833
|
continue;
|
|
9834
|
-
const
|
|
9834
|
+
const S = {
|
|
9835
9835
|
stepName: e.name,
|
|
9836
9836
|
id: M(),
|
|
9837
9837
|
align: s(a.data),
|
|
@@ -9845,7 +9845,7 @@ const ls = [
|
|
|
9845
9845
|
paths: a.data.paths,
|
|
9846
9846
|
rotation: g.rotation,
|
|
9847
9847
|
text: u,
|
|
9848
|
-
type:
|
|
9848
|
+
type: F.Textbox,
|
|
9849
9849
|
vertical: a.data.vertical,
|
|
9850
9850
|
verticalAlign: a.data.verticalAlign || "middle",
|
|
9851
9851
|
width: g.width,
|
|
@@ -9853,12 +9853,12 @@ const ls = [
|
|
|
9853
9853
|
y: g.top
|
|
9854
9854
|
};
|
|
9855
9855
|
if (d) {
|
|
9856
|
-
const [
|
|
9856
|
+
const [w, I] = ve(
|
|
9857
9857
|
a.data.size || o,
|
|
9858
9858
|
d,
|
|
9859
9859
|
g,
|
|
9860
9860
|
[
|
|
9861
|
-
|
|
9861
|
+
ke(u, {
|
|
9862
9862
|
vertical: a.data.vertical,
|
|
9863
9863
|
uppercase: a.data.uppercase
|
|
9864
9864
|
})
|
|
@@ -9872,16 +9872,16 @@ const ls = [
|
|
|
9872
9872
|
i.push(
|
|
9873
9873
|
new H(
|
|
9874
9874
|
{
|
|
9875
|
-
...
|
|
9876
|
-
fontSize:
|
|
9877
|
-
text:
|
|
9875
|
+
...S,
|
|
9876
|
+
fontSize: w,
|
|
9877
|
+
text: S.curved ? S.text : (I || []).join(`
|
|
9878
9878
|
`)
|
|
9879
9879
|
},
|
|
9880
9880
|
f
|
|
9881
9881
|
)
|
|
9882
9882
|
);
|
|
9883
9883
|
} else
|
|
9884
|
-
i.push(new H(
|
|
9884
|
+
i.push(new H(S, f));
|
|
9885
9885
|
}
|
|
9886
9886
|
return i;
|
|
9887
9887
|
}, fs = (n, t) => n.conditions ? n.conditions.every((e) => {
|
|
@@ -9899,18 +9899,18 @@ const ls = [
|
|
|
9899
9899
|
const s = t.steps.find((l) => l.stepName === o.name);
|
|
9900
9900
|
if (s)
|
|
9901
9901
|
switch (s.type) {
|
|
9902
|
-
case
|
|
9902
|
+
case v.DigitalContent:
|
|
9903
9903
|
i.push(
|
|
9904
9904
|
...await cs(e, o, s)
|
|
9905
9905
|
);
|
|
9906
9906
|
break;
|
|
9907
|
-
case
|
|
9908
|
-
case
|
|
9907
|
+
case v.Frame:
|
|
9908
|
+
case v.Photo:
|
|
9909
9909
|
i.push(
|
|
9910
9910
|
...await ds(e, r, o, s)
|
|
9911
9911
|
);
|
|
9912
9912
|
break;
|
|
9913
|
-
case
|
|
9913
|
+
case v.Illustration:
|
|
9914
9914
|
i.push(
|
|
9915
9915
|
...await As(
|
|
9916
9916
|
e,
|
|
@@ -9920,20 +9920,20 @@ const ls = [
|
|
|
9920
9920
|
)
|
|
9921
9921
|
);
|
|
9922
9922
|
break;
|
|
9923
|
-
case
|
|
9923
|
+
case v.Module:
|
|
9924
9924
|
i.push(...await us(e, o, s));
|
|
9925
9925
|
break;
|
|
9926
|
-
case
|
|
9926
|
+
case v.Picture:
|
|
9927
9927
|
i.push(
|
|
9928
9928
|
...await hs(e, r, o, s)
|
|
9929
9929
|
);
|
|
9930
9930
|
break;
|
|
9931
|
-
case
|
|
9931
|
+
case v.Shape:
|
|
9932
9932
|
i.push(
|
|
9933
9933
|
...await ms(e, r, o, s)
|
|
9934
9934
|
);
|
|
9935
9935
|
break;
|
|
9936
|
-
case
|
|
9936
|
+
case v.Text:
|
|
9937
9937
|
i.push(
|
|
9938
9938
|
...await ps(e, r, o, s)
|
|
9939
9939
|
);
|
|
@@ -9941,7 +9941,7 @@ const ls = [
|
|
|
9941
9941
|
}
|
|
9942
9942
|
}
|
|
9943
9943
|
for (const o of t.steps)
|
|
9944
|
-
o.type !==
|
|
9944
|
+
o.type !== v.SilentIllustration && o.type !== v.ProductOverlay || fs(o, r) && i.push(
|
|
9945
9945
|
...await gs(e, o, a)
|
|
9946
9946
|
);
|
|
9947
9947
|
return i;
|
|
@@ -10106,12 +10106,12 @@ class Es extends Wn {
|
|
|
10106
10106
|
l = g.width, c = g.height;
|
|
10107
10107
|
} else
|
|
10108
10108
|
l = r.width, c = r.height;
|
|
10109
|
-
const d = this.getWorkflowManager?.()?.getTemplatingContext(), A =
|
|
10109
|
+
const d = this.getWorkflowManager?.()?.getTemplatingContext(), A = ka(t.layoutState.layout, e, {
|
|
10110
10110
|
renderingConfiguration: {
|
|
10111
10111
|
purpose: Kt.ThreeD,
|
|
10112
10112
|
templatingContext: d
|
|
10113
10113
|
}
|
|
10114
|
-
}), u =
|
|
10114
|
+
}), u = Dn(A), h = await va.from(this.ctx, u, {
|
|
10115
10115
|
anonymousCrossOrigin: !0,
|
|
10116
10116
|
ignoreDimensions: !this.nonPOTSupport,
|
|
10117
10117
|
ignoreAnimation: !0,
|
|
@@ -10120,7 +10120,7 @@ class Es extends Wn {
|
|
|
10120
10120
|
enableRedraw: !1,
|
|
10121
10121
|
createCanvas: Ct,
|
|
10122
10122
|
createImage: ie,
|
|
10123
|
-
DOMParser:
|
|
10123
|
+
DOMParser: Ba(),
|
|
10124
10124
|
fetch
|
|
10125
10125
|
});
|
|
10126
10126
|
h.resize(l, c), await h.render(), this.onRender();
|
|
@@ -10130,7 +10130,7 @@ const Md = (n, t) => {
|
|
|
10130
10130
|
const e = [];
|
|
10131
10131
|
return n.forEach((a) => {
|
|
10132
10132
|
const i = t.steps.find((r) => r.stepName === a.stepName);
|
|
10133
|
-
i?.type ===
|
|
10133
|
+
i?.type === v.Text && a.stepAspectType === "Text" && e.push({
|
|
10134
10134
|
name: i.stepName,
|
|
10135
10135
|
data: {
|
|
10136
10136
|
text: a.value
|
|
@@ -10145,7 +10145,7 @@ const Md = (n, t) => {
|
|
|
10145
10145
|
i = new L(e.map((l) => new ni(l))).apply(i);
|
|
10146
10146
|
const o = await Cs(n, t, e, a);
|
|
10147
10147
|
return new L(o).apply(i);
|
|
10148
|
-
},
|
|
10148
|
+
}, Ge = C`
|
|
10149
10149
|
fragment GlobalPropertyStateAspectFields on GlobalPropertyStateAspect {
|
|
10150
10150
|
name
|
|
10151
10151
|
value
|
|
@@ -10168,7 +10168,7 @@ const Md = (n, t) => {
|
|
|
10168
10168
|
}
|
|
10169
10169
|
}
|
|
10170
10170
|
`, bs = C`
|
|
10171
|
-
${
|
|
10171
|
+
${Ge}
|
|
10172
10172
|
mutation CreateGlobalPropertyState($bundleId: String!) {
|
|
10173
10173
|
globalPropertyStateCreate(bundleId: $bundleId) {
|
|
10174
10174
|
id
|
|
@@ -10178,7 +10178,7 @@ const Md = (n, t) => {
|
|
|
10178
10178
|
}
|
|
10179
10179
|
}
|
|
10180
10180
|
`, Is = C`
|
|
10181
|
-
${
|
|
10181
|
+
${Ge}
|
|
10182
10182
|
mutation UpdateGlobalPropertyState($id: String!, $aspects: [GlobalPropertyStateAspectInput]!) {
|
|
10183
10183
|
globalPropertyStateUpdate(id: $id, aspects: $aspects) {
|
|
10184
10184
|
id
|
|
@@ -10188,7 +10188,7 @@ const Md = (n, t) => {
|
|
|
10188
10188
|
}
|
|
10189
10189
|
}
|
|
10190
10190
|
`, Bs = C`
|
|
10191
|
-
${
|
|
10191
|
+
${Ge}
|
|
10192
10192
|
query GetGlobalPropertyState($bundleId: String!) {
|
|
10193
10193
|
globalPropertyState(bundleId: $bundleId) {
|
|
10194
10194
|
id
|
|
@@ -10205,7 +10205,7 @@ const Md = (n, t) => {
|
|
|
10205
10205
|
bundleId: n
|
|
10206
10206
|
}
|
|
10207
10207
|
})).data.globalPropertyState, Ps = (n) => C`
|
|
10208
|
-
${
|
|
10208
|
+
${Le}
|
|
10209
10209
|
fragment ProductFields on Product {
|
|
10210
10210
|
id
|
|
10211
10211
|
basePrice
|
|
@@ -10249,7 +10249,7 @@ const Md = (n, t) => {
|
|
|
10249
10249
|
name
|
|
10250
10250
|
}
|
|
10251
10251
|
}
|
|
10252
|
-
`,
|
|
10252
|
+
`, Qa = (n) => C`
|
|
10253
10253
|
${Ps(n)}
|
|
10254
10254
|
fragment ProductCollectionProductFields on ProductCollectionProduct {
|
|
10255
10255
|
id
|
|
@@ -10259,8 +10259,8 @@ const Md = (n, t) => {
|
|
|
10259
10259
|
...ProductFields
|
|
10260
10260
|
}
|
|
10261
10261
|
}
|
|
10262
|
-
`,
|
|
10263
|
-
${n ?
|
|
10262
|
+
`, We = (n, t = !1) => C`
|
|
10263
|
+
${n ? Qa(t) : ""}
|
|
10264
10264
|
fragment ProductCollectionFields on ProductCollection {
|
|
10265
10265
|
id
|
|
10266
10266
|
name
|
|
@@ -10349,9 +10349,9 @@ const Md = (n, t) => {
|
|
|
10349
10349
|
workflowViewerLink
|
|
10350
10350
|
workflowViewerAmendLink
|
|
10351
10351
|
}
|
|
10352
|
-
`,
|
|
10353
|
-
${
|
|
10354
|
-
${
|
|
10352
|
+
`, Ds = (n) => C`
|
|
10353
|
+
${Ge}
|
|
10354
|
+
${We(n)}
|
|
10355
10355
|
${ui}
|
|
10356
10356
|
query GetBundle($id: String!) {
|
|
10357
10357
|
globalPropertyState(bundleId: $id) {
|
|
@@ -10384,7 +10384,7 @@ const Md = (n, t) => {
|
|
|
10384
10384
|
}
|
|
10385
10385
|
}
|
|
10386
10386
|
}
|
|
10387
|
-
`,
|
|
10387
|
+
`, rn = C`
|
|
10388
10388
|
query GetBundleStakeholders($id: String!) {
|
|
10389
10389
|
bundles(ids: [$id]) {
|
|
10390
10390
|
id
|
|
@@ -10429,7 +10429,7 @@ const Md = (n, t) => {
|
|
|
10429
10429
|
}
|
|
10430
10430
|
}
|
|
10431
10431
|
}
|
|
10432
|
-
`,
|
|
10432
|
+
`, Fs = C`
|
|
10433
10433
|
query GetBundlesForCustomer($id: String!) {
|
|
10434
10434
|
customers(ids: [$id]) {
|
|
10435
10435
|
bundleStakeholders {
|
|
@@ -10459,7 +10459,7 @@ const Md = (n, t) => {
|
|
|
10459
10459
|
}
|
|
10460
10460
|
}
|
|
10461
10461
|
`, xs = C`
|
|
10462
|
-
${
|
|
10462
|
+
${Qa(!1)}
|
|
10463
10463
|
query GetProductCollectionProducts($id: String!, $productIds: [String!]) {
|
|
10464
10464
|
productCollections(ids: [$id], productIds: $productIds) {
|
|
10465
10465
|
id
|
|
@@ -10492,7 +10492,7 @@ const Md = (n, t) => {
|
|
|
10492
10492
|
}
|
|
10493
10493
|
}
|
|
10494
10494
|
`, Ms = C`
|
|
10495
|
-
${
|
|
10495
|
+
${Qa(!0)}
|
|
10496
10496
|
query GetProductCollectionForProductsFeed(
|
|
10497
10497
|
$id: String!
|
|
10498
10498
|
$limit: Int
|
|
@@ -10524,7 +10524,7 @@ const Md = (n, t) => {
|
|
|
10524
10524
|
}
|
|
10525
10525
|
}
|
|
10526
10526
|
`, Ts = (n) => C`
|
|
10527
|
-
${
|
|
10527
|
+
${We(n)}
|
|
10528
10528
|
mutation CreateBundle(
|
|
10529
10529
|
$collectionId: String
|
|
10530
10530
|
$initialMetadata: [MetadataInput!]
|
|
@@ -10552,9 +10552,7 @@ const Md = (n, t) => {
|
|
|
10552
10552
|
}
|
|
10553
10553
|
}
|
|
10554
10554
|
}
|
|
10555
|
-
`, Ns = (
|
|
10556
|
-
${ce}
|
|
10557
|
-
${de(n)}
|
|
10555
|
+
`, Ns = () => C`
|
|
10558
10556
|
mutation DuplicateBundle(
|
|
10559
10557
|
$id: String!
|
|
10560
10558
|
$template: Boolean
|
|
@@ -10571,28 +10569,9 @@ const Md = (n, t) => {
|
|
|
10571
10569
|
) {
|
|
10572
10570
|
id
|
|
10573
10571
|
bundleOwnerId
|
|
10574
|
-
template
|
|
10575
|
-
bundleStateData
|
|
10576
|
-
metadata {
|
|
10577
|
-
key
|
|
10578
|
-
value
|
|
10579
|
-
}
|
|
10580
|
-
name
|
|
10581
10572
|
partner {
|
|
10582
10573
|
id
|
|
10583
10574
|
}
|
|
10584
|
-
productCollection {
|
|
10585
|
-
...ProductCollectionFields
|
|
10586
|
-
}
|
|
10587
|
-
transactions {
|
|
10588
|
-
id
|
|
10589
|
-
}
|
|
10590
|
-
globalPropertyState {
|
|
10591
|
-
id
|
|
10592
|
-
aspects {
|
|
10593
|
-
...GlobalPropertyStateAspectFields
|
|
10594
|
-
}
|
|
10595
|
-
}
|
|
10596
10575
|
}
|
|
10597
10576
|
}
|
|
10598
10577
|
`, ia = C`
|
|
@@ -10710,7 +10689,7 @@ const Md = (n, t) => {
|
|
|
10710
10689
|
}
|
|
10711
10690
|
}
|
|
10712
10691
|
`, Gs = (n) => C`
|
|
10713
|
-
${
|
|
10692
|
+
${We(n)}
|
|
10714
10693
|
mutation BundleAssignProductCollection($id: String!, $productCollectionId: String!) {
|
|
10715
10694
|
bundleAssignProductCollection(id: $id, collectionId: $productCollectionId) {
|
|
10716
10695
|
id
|
|
@@ -10833,6 +10812,7 @@ const Md = (n, t) => {
|
|
|
10833
10812
|
$customField4: String
|
|
10834
10813
|
$customField5: String
|
|
10835
10814
|
$conversionConfigurationId: String
|
|
10815
|
+
$prevalidated: Boolean
|
|
10836
10816
|
) {
|
|
10837
10817
|
recipientUpdate(
|
|
10838
10818
|
id: $id
|
|
@@ -10853,6 +10833,7 @@ const Md = (n, t) => {
|
|
|
10853
10833
|
customField4: $customField4
|
|
10854
10834
|
customField5: $customField5
|
|
10855
10835
|
conversionConfigurationId: $conversionConfigurationId
|
|
10836
|
+
prevalidated: $prevalidated
|
|
10856
10837
|
) {
|
|
10857
10838
|
id
|
|
10858
10839
|
}
|
|
@@ -10870,7 +10851,7 @@ const Md = (n, t) => {
|
|
|
10870
10851
|
`;
|
|
10871
10852
|
var qe = /* @__PURE__ */ ((n) => (n.Error = "Error", n.Warning = "Warning", n.Info = "Info", n))(qe || {});
|
|
10872
10853
|
const el = 1e3;
|
|
10873
|
-
class
|
|
10854
|
+
class on extends Wn {
|
|
10874
10855
|
constructor(t) {
|
|
10875
10856
|
super(), this.createdAt = /* @__PURE__ */ new Date(), this.update = t;
|
|
10876
10857
|
}
|
|
@@ -10929,10 +10910,10 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
10929
10910
|
const t = this.experience.getTransaction().recipient, e = { recipient: t };
|
|
10930
10911
|
return this.recipientConversionConfiguration?.requestedDataItems?.forEach((a) => {
|
|
10931
10912
|
const i = a.uniqueIdentifier ?? a.title ?? "";
|
|
10932
|
-
a.type ===
|
|
10913
|
+
a.type === Ee.FirstName ? e[i] = t?.firstName : a.type === Ee.LastName ? e[i] = t?.lastName : a.type === Ee.Custom && (a.customFieldIndex === 1 ? e[i] = t?.customField1 : a.customFieldIndex === 2 ? e[i] = t?.customField2 : a.customFieldIndex === 3 ? e[i] = t?.customField3 : a.customFieldIndex === 4 ? e[i] = t?.customField4 : a.customFieldIndex === 5 && (e[i] = t?.customField5), a.option && (e[i] = a.option.variants?.find((r) => r.id === e[i])?.name));
|
|
10933
10914
|
}), e;
|
|
10934
10915
|
}
|
|
10935
|
-
async updateRecipient(t, e, a, i, r, o, s, l, c, d, A, u, h, m, p, g, f) {
|
|
10916
|
+
async updateRecipient(t, e, a, i, r, o, s, l, c, d, A, u, h, m, p, g, f, S) {
|
|
10936
10917
|
const w = this.experience.getTransaction();
|
|
10937
10918
|
if (w.recipient?.id)
|
|
10938
10919
|
this.experience.getTransaction().recipient = {
|
|
@@ -10954,7 +10935,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
10954
10935
|
customField4: p ?? w.recipient.customField4,
|
|
10955
10936
|
customField5: g ?? w.recipient.customField5,
|
|
10956
10937
|
conversionConfigurationId: f || w.recipient.conversionConfigurationId
|
|
10957
|
-
}, this.experience.callEvent(
|
|
10938
|
+
}, this.experience.callEvent(wa.RecipientChanged), await this.graphQlClient().mutate({
|
|
10958
10939
|
mutation: Xs,
|
|
10959
10940
|
errorPolicy: "all",
|
|
10960
10941
|
fetchPolicy: "no-cache",
|
|
@@ -10976,11 +10957,12 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
10976
10957
|
customField3: m || w.recipient.customField3,
|
|
10977
10958
|
customField4: p || w.recipient.customField4,
|
|
10978
10959
|
customField5: g || w.recipient.customField5,
|
|
10979
|
-
conversionConfigurationId: f || w.recipient.conversionConfigurationId
|
|
10960
|
+
conversionConfigurationId: f || w.recipient.conversionConfigurationId,
|
|
10961
|
+
prevalidated: S
|
|
10980
10962
|
}
|
|
10981
10963
|
});
|
|
10982
10964
|
else {
|
|
10983
|
-
const
|
|
10965
|
+
const I = await this.graphQlClient().mutate({
|
|
10984
10966
|
mutation: _s,
|
|
10985
10967
|
errorPolicy: "all",
|
|
10986
10968
|
fetchPolicy: "no-cache",
|
|
@@ -11005,7 +10987,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11005
10987
|
}
|
|
11006
10988
|
});
|
|
11007
10989
|
w.recipient = {
|
|
11008
|
-
id:
|
|
10990
|
+
id: I?.data?.recipientCreate?.id,
|
|
11009
10991
|
firstName: t,
|
|
11010
10992
|
lastName: e,
|
|
11011
10993
|
address: a,
|
|
@@ -11023,20 +11005,20 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11023
11005
|
customField4: p,
|
|
11024
11006
|
customField5: g,
|
|
11025
11007
|
conversionConfigurationId: f
|
|
11026
|
-
}, this.experience.callEvent(
|
|
11008
|
+
}, this.experience.callEvent(wa.RecipientChanged), await this.graphQlClient().mutate({
|
|
11027
11009
|
mutation: Zs,
|
|
11028
11010
|
errorPolicy: "all",
|
|
11029
11011
|
fetchPolicy: "no-cache",
|
|
11030
11012
|
variables: {
|
|
11031
11013
|
id: this.experience.getTransaction().id,
|
|
11032
|
-
recipientId:
|
|
11014
|
+
recipientId: I.data?.recipientCreate?.id
|
|
11033
11015
|
},
|
|
11034
11016
|
context: {
|
|
11035
11017
|
transactionOwnerId: this.experience.getTransaction().transactionOwnerId
|
|
11036
11018
|
}
|
|
11037
11019
|
});
|
|
11038
11020
|
}
|
|
11039
|
-
await this.fetchConversionConfiguration(), this.recipientCallbacks.forEach((
|
|
11021
|
+
await this.fetchConversionConfiguration(), this.recipientCallbacks.forEach((I) => I(this.experience.getTransaction().recipient));
|
|
11040
11022
|
}
|
|
11041
11023
|
async fetchConversionConfiguration() {
|
|
11042
11024
|
const t = this.experience.getTransaction().recipient;
|
|
@@ -11259,7 +11241,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11259
11241
|
},
|
|
11260
11242
|
{ refocusCamera: e }
|
|
11261
11243
|
);
|
|
11262
|
-
this.setModelContainer(i), vt(this.allScenes, this.stepSelections).filter((s) => s).map((s) => s.renderableSteps).flat().filter((s) => s.type ===
|
|
11244
|
+
this.setModelContainer(i), vt(this.allScenes, this.stepSelections).filter((s) => s).map((s) => s.renderableSteps).flat().filter((s) => s.type === v.Model || s.type === v.Material).forEach((s) => {
|
|
11263
11245
|
if (!s.option?.id) {
|
|
11264
11246
|
console.error(`Failed to read option id from step: ${s.stepName}`);
|
|
11265
11247
|
return;
|
|
@@ -11267,7 +11249,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11267
11249
|
const l = this.stepSelections[s.stepName]?.selectedVariants || [];
|
|
11268
11250
|
if (l.length === 0) return;
|
|
11269
11251
|
const c = l[0];
|
|
11270
|
-
if (s.type ===
|
|
11252
|
+
if (s.type === v.Model) {
|
|
11271
11253
|
if (!this.modelContainer)
|
|
11272
11254
|
throw new R(
|
|
11273
11255
|
"We should always have a model container when injecting a preview!"
|
|
@@ -11317,7 +11299,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11317
11299
|
};
|
|
11318
11300
|
if (!Jt(a, this.storage)) {
|
|
11319
11301
|
this.storage = a;
|
|
11320
|
-
const i = new
|
|
11302
|
+
const i = new tn(this.constructSerializableWorkflow());
|
|
11321
11303
|
this.commandContext.apply(i, !0), this.onStepSpecificStorageChange(t), this.onStorageChange();
|
|
11322
11304
|
}
|
|
11323
11305
|
}
|
|
@@ -11336,7 +11318,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11336
11318
|
if (this.readOnly) return;
|
|
11337
11319
|
const t = this.serialize();
|
|
11338
11320
|
this.workflowStatePromiseQueue.enqueue(
|
|
11339
|
-
new
|
|
11321
|
+
new on(async () => {
|
|
11340
11322
|
await new Promise((e) => {
|
|
11341
11323
|
setTimeout(() => {
|
|
11342
11324
|
e();
|
|
@@ -11353,7 +11335,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11353
11335
|
async updateStateWithServerImmediate() {
|
|
11354
11336
|
if (this.readOnly) return;
|
|
11355
11337
|
const t = this.serialize();
|
|
11356
|
-
return new
|
|
11338
|
+
return new on(async () => {
|
|
11357
11339
|
await this.updateTransaction({
|
|
11358
11340
|
variables: {
|
|
11359
11341
|
id: this.experience.getTransaction().id,
|
|
@@ -11407,18 +11389,18 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11407
11389
|
), t), []) || [];
|
|
11408
11390
|
}
|
|
11409
11391
|
getInvalidModelVariants() {
|
|
11410
|
-
return this.experience.getWorkflow()?.steps.reduce((t, e) => (e.type ===
|
|
11392
|
+
return this.experience.getWorkflow()?.steps.reduce((t, e) => (e.type === v.Model && !bt(e, this.stepSelections) && t.push(e.stepName), t), []) || [];
|
|
11411
11393
|
}
|
|
11412
11394
|
async stepElementsForIntroducedSilentSteps(t, e) {
|
|
11413
11395
|
const a = this.experience.getProduct();
|
|
11414
11396
|
if (!a)
|
|
11415
11397
|
return Promise.resolve({ stepElements: {}, commands: [] });
|
|
11416
11398
|
const i = async (c, d, A) => {
|
|
11417
|
-
if (c.type ===
|
|
11418
|
-
const u = await new
|
|
11399
|
+
if (c.type === v.SilentIllustration) {
|
|
11400
|
+
const u = await new an(c, d).trigger();
|
|
11419
11401
|
return { step: c, results: u };
|
|
11420
|
-
} else if (c.type ===
|
|
11421
|
-
const u = await new
|
|
11402
|
+
} else if (c.type === v.ProductOverlay) {
|
|
11403
|
+
const u = await new an(
|
|
11422
11404
|
c,
|
|
11423
11405
|
d,
|
|
11424
11406
|
A
|
|
@@ -11504,14 +11486,14 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11504
11486
|
this.stepSelections = {
|
|
11505
11487
|
...this.stepSelections,
|
|
11506
11488
|
[t]: { selectedVariants: e }
|
|
11507
|
-
}, this.selectionCost = Object.values(this.stepSelections).reduce((
|
|
11508
|
-
bt(
|
|
11489
|
+
}, this.selectionCost = Object.values(this.stepSelections).reduce((E, D) => E + D.selectedVariants.map((x) => x.priceModifier || 0).reduce((x, T) => x + T, 0), 0), r.steps.forEach((E) => {
|
|
11490
|
+
bt(E, this.stepSelections) || (this.stepInitialised[E.stepName] = !1, delete this.stepMetadata[E.stepName], delete this.stepSelections[E.stepName], delete this.storage[E.stepName]);
|
|
11509
11491
|
});
|
|
11510
|
-
const s = this.allScenes, l = vt(s, o), c = vt(s, this.stepSelections), d = l.map((
|
|
11511
|
-
(
|
|
11492
|
+
const s = this.allScenes, l = vt(s, o), c = vt(s, this.stepSelections), d = l.map((E) => E.silentSteps).flat(), u = c.map((E) => E.silentSteps).flat().filter(
|
|
11493
|
+
(E) => !d.some((D) => D.stepName === E.stepName)
|
|
11512
11494
|
);
|
|
11513
|
-
d.forEach((
|
|
11514
|
-
bt(
|
|
11495
|
+
d.forEach((E) => {
|
|
11496
|
+
bt(E, this.stepSelections) || (this.stepInitialised[E.stepName] = !1);
|
|
11515
11497
|
});
|
|
11516
11498
|
const h = this.getInvalidCanvasRegions(), { stepElements: m, commands: p } = await this.stepElementsForIntroducedSilentSteps(u, !1);
|
|
11517
11499
|
this.stepElements = {
|
|
@@ -11519,22 +11501,22 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11519
11501
|
...m,
|
|
11520
11502
|
[t]: a
|
|
11521
11503
|
}, this.removeElements(h);
|
|
11522
|
-
const g = r.steps.find((
|
|
11523
|
-
g?.type ===
|
|
11524
|
-
const f = h.map((
|
|
11525
|
-
|
|
11526
|
-
const
|
|
11527
|
-
if (
|
|
11528
|
-
const
|
|
11529
|
-
(
|
|
11530
|
-
|
|
11504
|
+
const g = r.steps.find((E) => E.stepName === t);
|
|
11505
|
+
g?.type === v.Frame && this.getWorkflowExperience().getStepById(g.stepName)?.frameService?.setTargetElements(a.map((D) => D.id));
|
|
11506
|
+
const f = h.map((E) => new Rt(E.id)), S = new tn(this.constructSerializableWorkflow()), w = [...p, ...f, S];
|
|
11507
|
+
w.length > 0 && this.commandContext.apply(new L(w), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
|
|
11508
|
+
const I = this.getInvalidModelVariants(), b = this.modelContainer;
|
|
11509
|
+
if (b) {
|
|
11510
|
+
const E = I.map(
|
|
11511
|
+
(D) => b.applyModelVariant(
|
|
11512
|
+
D,
|
|
11531
11513
|
{
|
|
11532
11514
|
contextService: this.getLayoutPreviewService()
|
|
11533
11515
|
},
|
|
11534
11516
|
!1
|
|
11535
11517
|
)
|
|
11536
11518
|
);
|
|
11537
|
-
await Promise.all(
|
|
11519
|
+
await Promise.all(E);
|
|
11538
11520
|
}
|
|
11539
11521
|
await this.onSelectionChange(), i && await i();
|
|
11540
11522
|
}
|
|
@@ -11543,7 +11525,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11543
11525
|
for (const l of i)
|
|
11544
11526
|
if (!this.stepInitialised[l.stepName])
|
|
11545
11527
|
switch (this.stepInitialised[l.stepName] = !0, l.type) {
|
|
11546
|
-
case
|
|
11528
|
+
case v.DigitalContent:
|
|
11547
11529
|
a.push(
|
|
11548
11530
|
ri.init(
|
|
11549
11531
|
l,
|
|
@@ -11552,43 +11534,43 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11552
11534
|
)
|
|
11553
11535
|
);
|
|
11554
11536
|
break;
|
|
11555
|
-
case
|
|
11537
|
+
case v.Frame:
|
|
11556
11538
|
a.push(Et.init(l, this, this.reloadedState));
|
|
11557
11539
|
break;
|
|
11558
|
-
case
|
|
11540
|
+
case v.Illustration:
|
|
11559
11541
|
a.push(
|
|
11560
|
-
|
|
11542
|
+
Se.init(l, this, this.reloadedState)
|
|
11561
11543
|
);
|
|
11562
11544
|
break;
|
|
11563
|
-
case
|
|
11545
|
+
case v.Material:
|
|
11564
11546
|
a.push(
|
|
11565
11547
|
oi.init(l, this, this.reloadedState)
|
|
11566
11548
|
);
|
|
11567
11549
|
break;
|
|
11568
|
-
case
|
|
11550
|
+
case v.Model:
|
|
11569
11551
|
a.push(si.init(l, this, this.reloadedState));
|
|
11570
11552
|
break;
|
|
11571
|
-
case
|
|
11553
|
+
case v.Module:
|
|
11572
11554
|
this.stepSpecificServices[l.stepName] = {
|
|
11573
11555
|
module: await Ai(l.data.module)
|
|
11574
11556
|
}, a.push(
|
|
11575
11557
|
li.init(l, this, this.reloadedState)
|
|
11576
11558
|
);
|
|
11577
11559
|
break;
|
|
11578
|
-
case
|
|
11560
|
+
case v.Picture:
|
|
11579
11561
|
a.push(
|
|
11580
11562
|
ci.init(l, this, this.reloadedState)
|
|
11581
11563
|
);
|
|
11582
11564
|
break;
|
|
11583
|
-
case
|
|
11565
|
+
case v.Question:
|
|
11584
11566
|
a.push(
|
|
11585
11567
|
di.init(l, this, this.reloadedState)
|
|
11586
11568
|
);
|
|
11587
11569
|
break;
|
|
11588
|
-
case
|
|
11570
|
+
case v.Shape:
|
|
11589
11571
|
a.push(Wt.init(l, this, this.reloadedState));
|
|
11590
11572
|
break;
|
|
11591
|
-
case
|
|
11573
|
+
case v.Text:
|
|
11592
11574
|
a.push(j.init(l, this, this.reloadedState));
|
|
11593
11575
|
break;
|
|
11594
11576
|
}
|
|
@@ -11652,7 +11634,7 @@ const al = (n) => n.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11652
11634
|
}
|
|
11653
11635
|
};
|
|
11654
11636
|
jt.configurationPromiseMap = /* @__PURE__ */ new Map();
|
|
11655
|
-
let
|
|
11637
|
+
let Ca = jt;
|
|
11656
11638
|
class ot {
|
|
11657
11639
|
constructor(t) {
|
|
11658
11640
|
this.variantData = t;
|
|
@@ -11877,7 +11859,7 @@ class il extends et {
|
|
|
11877
11859
|
*/
|
|
11878
11860
|
async selectVariant(t) {
|
|
11879
11861
|
if (!this.getUpdateState() && this.getCurrentVariant() !== t)
|
|
11880
|
-
return
|
|
11862
|
+
return Se.selectVariant(
|
|
11881
11863
|
this.step,
|
|
11882
11864
|
t.getResource(),
|
|
11883
11865
|
this.manager.getRegionElements(this.step.stepName) || [],
|
|
@@ -11919,7 +11901,7 @@ class il extends et {
|
|
|
11919
11901
|
const c = l.id.replace(/\W/g, "");
|
|
11920
11902
|
a ? i.set(c, { browserValue: e, pmsValue: a }) : i.set(c, e);
|
|
11921
11903
|
}
|
|
11922
|
-
}) : a ? i.set(t, { browserValue: e, pmsValue: a }) : i.set(t, e),
|
|
11904
|
+
}) : a ? i.set(t, { browserValue: e, pmsValue: a }) : i.set(t, e), Se.changeColors(
|
|
11923
11905
|
this.step,
|
|
11924
11906
|
this.manager.getRegionElements(this.step.stepName),
|
|
11925
11907
|
this.manager,
|
|
@@ -11931,7 +11913,7 @@ class il extends et {
|
|
|
11931
11913
|
return this.step.data.colorOption;
|
|
11932
11914
|
}
|
|
11933
11915
|
getAvailableColors() {
|
|
11934
|
-
return this.step.data.colorPickerEnabled ?
|
|
11916
|
+
return this.step.data.colorPickerEnabled ? Se.availableColors(this.step, this.manager) : Promise.resolve([]);
|
|
11935
11917
|
}
|
|
11936
11918
|
isColorPickerEnabled() {
|
|
11937
11919
|
return this.step.data.colorPickerEnabled ?? !1;
|
|
@@ -12338,30 +12320,30 @@ class hl extends et {
|
|
|
12338
12320
|
});
|
|
12339
12321
|
}
|
|
12340
12322
|
}
|
|
12341
|
-
class
|
|
12323
|
+
class me {
|
|
12342
12324
|
static get(t, e) {
|
|
12343
12325
|
switch (e.type) {
|
|
12344
|
-
case
|
|
12326
|
+
case v.DigitalContent:
|
|
12345
12327
|
return new ul(t, e, t.getStepTags(e.stepName));
|
|
12346
|
-
case
|
|
12328
|
+
case v.Information:
|
|
12347
12329
|
return new Al(t, e, t.getStepTags(e.stepName));
|
|
12348
|
-
case
|
|
12330
|
+
case v.Question:
|
|
12349
12331
|
return new ll(t, e, t.getStepTags(e.stepName));
|
|
12350
|
-
case
|
|
12332
|
+
case v.Text:
|
|
12351
12333
|
return new dl(t, e, t.getStepTags(e.stepName));
|
|
12352
|
-
case
|
|
12334
|
+
case v.Illustration:
|
|
12353
12335
|
return new il(t, e, t.getStepTags(e.stepName));
|
|
12354
|
-
case
|
|
12336
|
+
case v.Picture:
|
|
12355
12337
|
return new sl(t, e, t.getStepTags(e.stepName));
|
|
12356
|
-
case
|
|
12338
|
+
case v.Shape:
|
|
12357
12339
|
return new cl(t, e, t.getStepTags(e.stepName));
|
|
12358
|
-
case
|
|
12340
|
+
case v.Material:
|
|
12359
12341
|
return new rl(t, e, t.getStepTags(e.stepName));
|
|
12360
|
-
case
|
|
12342
|
+
case v.Model:
|
|
12361
12343
|
return new ol(t, e, t.getStepTags(e.stepName));
|
|
12362
|
-
case
|
|
12344
|
+
case v.Frame:
|
|
12363
12345
|
return new hc(t, e, t.getStepTags(e.stepName));
|
|
12364
|
-
case
|
|
12346
|
+
case v.Module:
|
|
12365
12347
|
return new hl(t, e, t.getStepTags(e.stepName));
|
|
12366
12348
|
default:
|
|
12367
12349
|
throw new R(`Step type ${e.type} not yet supported in Core SDK`);
|
|
@@ -12498,7 +12480,7 @@ const pl = async (n, t) => {
|
|
|
12498
12480
|
headers: e
|
|
12499
12481
|
}
|
|
12500
12482
|
})).data?.designCreateMany;
|
|
12501
|
-
},
|
|
12483
|
+
}, sn = (n, t, e) => {
|
|
12502
12484
|
const a = (r) => {
|
|
12503
12485
|
const o = {};
|
|
12504
12486
|
if (r.type === "Frame") {
|
|
@@ -12581,7 +12563,7 @@ const pl = async (n, t) => {
|
|
|
12581
12563
|
await (async () => {
|
|
12582
12564
|
if (c !== void 0) return c;
|
|
12583
12565
|
await n.outstandingRequestsPromise();
|
|
12584
|
-
const T = (k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(i.id),
|
|
12566
|
+
const T = (k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(i.id), B = await y.getShadowGraphqlClient().query({
|
|
12585
12567
|
query: zn,
|
|
12586
12568
|
variables: { ids: [i.id] },
|
|
12587
12569
|
fetchPolicy: "no-cache",
|
|
@@ -12589,17 +12571,17 @@ const pl = async (n, t) => {
|
|
|
12589
12571
|
context: {
|
|
12590
12572
|
transactionOwnerId: T
|
|
12591
12573
|
}
|
|
12592
|
-
}), Q =
|
|
12593
|
-
return
|
|
12594
|
-
|
|
12574
|
+
}), Q = B.data?.transactions[0].workflowState;
|
|
12575
|
+
return B.errors ? (B.errors.forEach((U) => {
|
|
12576
|
+
B.errors && console.log("Server Error:", U.message);
|
|
12595
12577
|
}), null) : Q ?? null;
|
|
12596
12578
|
})() || (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(a())), await n.updateStateWithServerImmediate(a), console.log("Server state is undefined @ Workflow completion"));
|
|
12597
|
-
const u = n.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, p = l &&
|
|
12579
|
+
const u = n.getPreviewService(), h = t?.finalizeStepConfig?.lookAtAnimation, m = u && t.showModelOnFinishStep && !!h, p = l && sn(l, t, !0), g = l && sn(l, t, !1), f = async (x) => {
|
|
12598
12580
|
const T = {};
|
|
12599
12581
|
let $ = 0;
|
|
12600
12582
|
if (Object.keys(r).length > 0)
|
|
12601
|
-
for (const
|
|
12602
|
-
const Q = r[
|
|
12583
|
+
for (const B of Object.keys(r)) {
|
|
12584
|
+
const Q = r[B], U = t.steps.find((N) => N.stepName === B);
|
|
12603
12585
|
for (let N = 0; N < Q.selections.length; ++N) {
|
|
12604
12586
|
const q = Q.selections[N];
|
|
12605
12587
|
if (U && (!x || U.option && (U.option.variants || []).length > 1 && !U.data.hideSelectionInCart && !U.data.hideSelectionsInCart)) {
|
|
@@ -12620,20 +12602,20 @@ const pl = async (n, t) => {
|
|
|
12620
12602
|
}
|
|
12621
12603
|
}
|
|
12622
12604
|
return [T, $];
|
|
12623
|
-
}, [
|
|
12624
|
-
Object.keys(
|
|
12625
|
-
), [
|
|
12626
|
-
Object.keys(
|
|
12605
|
+
}, [S] = await f(!0), w = Object.fromEntries(
|
|
12606
|
+
Object.keys(S).map((x) => [x, S[x].map((T) => T.id)])
|
|
12607
|
+
), [I] = await f(!1), b = Object.fromEntries(
|
|
12608
|
+
Object.keys(I).map((x) => [
|
|
12627
12609
|
x,
|
|
12628
|
-
|
|
12610
|
+
I[x].map((T) => T.id)
|
|
12629
12611
|
])
|
|
12630
12612
|
);
|
|
12631
|
-
let
|
|
12632
|
-
if (
|
|
12633
|
-
const x = await (await it(
|
|
12634
|
-
|
|
12613
|
+
let E = await s(m, i.id);
|
|
12614
|
+
if (E) {
|
|
12615
|
+
const x = await (await it(E)).blob();
|
|
12616
|
+
E = (await V.uploadAsset(
|
|
12635
12617
|
{ name: `${i.id}-preview-image.png`, blob: x },
|
|
12636
|
-
|
|
12618
|
+
Ie.Image,
|
|
12637
12619
|
!0,
|
|
12638
12620
|
!1
|
|
12639
12621
|
)).fileLink;
|
|
@@ -12649,23 +12631,23 @@ const pl = async (n, t) => {
|
|
|
12649
12631
|
workflowId: t.id,
|
|
12650
12632
|
transactionId: i.id,
|
|
12651
12633
|
useThreeDimPreview: !!m,
|
|
12652
|
-
previewImage:
|
|
12634
|
+
previewImage: E
|
|
12653
12635
|
};
|
|
12654
12636
|
if (g) {
|
|
12655
12637
|
const T = [];
|
|
12656
|
-
for (const [$,
|
|
12657
|
-
T.push({ key: $, value:
|
|
12638
|
+
for (const [$, B] of Object.entries(g))
|
|
12639
|
+
T.push({ key: $, value: B });
|
|
12658
12640
|
x.metadata = T;
|
|
12659
12641
|
}
|
|
12660
|
-
if (
|
|
12642
|
+
if (w) {
|
|
12661
12643
|
const T = [];
|
|
12662
|
-
for (const [$,
|
|
12663
|
-
T.push({ key: $, ids:
|
|
12644
|
+
for (const [$, B] of Object.entries(b))
|
|
12645
|
+
T.push({ key: $, ids: B });
|
|
12664
12646
|
x.selectedVariants = T;
|
|
12665
12647
|
}
|
|
12666
12648
|
return x;
|
|
12667
12649
|
})(),
|
|
12668
|
-
cartSelectionsWithPrices:
|
|
12650
|
+
cartSelectionsWithPrices: S,
|
|
12669
12651
|
cartMetadata: p
|
|
12670
12652
|
};
|
|
12671
12653
|
}, wl = async (n, t, e, a, i, r, o, s, l, c, d) => {
|
|
@@ -12854,8 +12836,8 @@ const ra = new Sl(), vl = C`
|
|
|
12854
12836
|
id
|
|
12855
12837
|
}
|
|
12856
12838
|
}
|
|
12857
|
-
`,
|
|
12858
|
-
${
|
|
12839
|
+
`, ln = C`
|
|
12840
|
+
${Le}
|
|
12859
12841
|
${oe}
|
|
12860
12842
|
mutation TransactionUpdateIntegrationProduct($id: String!, $integrationProductId: String) {
|
|
12861
12843
|
transactionUpdateIntegrationProduct(id: $id, integrationProductId: $integrationProductId) {
|
|
@@ -12943,7 +12925,7 @@ const ra = new Sl(), vl = C`
|
|
|
12943
12925
|
}
|
|
12944
12926
|
}
|
|
12945
12927
|
`;
|
|
12946
|
-
var
|
|
12928
|
+
var wa = /* @__PURE__ */ ((n) => (n.PriceBreakChanged = "PriceBreakChanged", n.ProductChanged = "ProductChanged", n.QuantityChanged = "QuantityChanged", n.RecipientChanged = "RecipientChanged", n.SelectionChanged = "SelectionChanged", n))(wa || {});
|
|
12947
12929
|
class Il {
|
|
12948
12930
|
constructor(t, e) {
|
|
12949
12931
|
this.cachedStepHandles = /* @__PURE__ */ new Map(), this.profanityList = [], this.currentPriceBreak = 1, this.renderableScenes = [], this.renderableSceneCallbacks = [], this.eventCallbacks = /* @__PURE__ */ new Map(), this.debouncedSavedDesignUpdate = vn(async () => {
|
|
@@ -12959,7 +12941,7 @@ class Il {
|
|
|
12959
12941
|
} catch (o) {
|
|
12960
12942
|
r(o);
|
|
12961
12943
|
}
|
|
12962
|
-
}), this.client = t, this.transaction = e.transaction, this.workflow = e.workflow, this.profanityList = this.transaction.product?.profanities?.map((a) => a.word) || [], this.isReadOnly = e.transaction.isOrdered || !!e.readOnly, this.graphQlClient = e.graphQlClient, this.workflowManager = new
|
|
12944
|
+
}), this.client = t, this.transaction = e.transaction, this.workflow = e.workflow, this.profanityList = this.transaction.product?.profanities?.map((a) => a.word) || [], this.isReadOnly = e.transaction.isOrdered || !!e.readOnly, this.graphQlClient = e.graphQlClient, this.workflowManager = new Ca(
|
|
12963
12945
|
this,
|
|
12964
12946
|
t,
|
|
12965
12947
|
(a) => {
|
|
@@ -13005,7 +12987,7 @@ class Il {
|
|
|
13005
12987
|
async setProduct(t) {
|
|
13006
12988
|
this.workflow = void 0;
|
|
13007
12989
|
const e = await this.graphQlClient().mutate({
|
|
13008
|
-
mutation:
|
|
12990
|
+
mutation: ln,
|
|
13009
12991
|
variables: {
|
|
13010
12992
|
id: this.getTransaction().id,
|
|
13011
12993
|
integrationProductId: t
|
|
@@ -13045,7 +13027,7 @@ class Il {
|
|
|
13045
13027
|
"ProductChanged"
|
|
13046
13028
|
/* ProductChanged */
|
|
13047
13029
|
), await this.graphQlClient().mutate({
|
|
13048
|
-
mutation:
|
|
13030
|
+
mutation: ln,
|
|
13049
13031
|
variables: {
|
|
13050
13032
|
id: this.getTransaction().id
|
|
13051
13033
|
}
|
|
@@ -13115,7 +13097,7 @@ class Il {
|
|
|
13115
13097
|
}
|
|
13116
13098
|
let r = 2048;
|
|
13117
13099
|
e && e <= 2048 && (r = e);
|
|
13118
|
-
const o = Ct(r, r), s = this.workflowManager.getCommandContext().getAllLayouts(), l = a.defaultPreviewPanelIndex || 0, c = a.panels[l], d = s.find((
|
|
13100
|
+
const o = Ct(r, r), s = this.workflowManager.getCommandContext().getAllLayouts(), l = a.defaultPreviewPanelIndex || 0, c = a.panels[l], d = s.find((w) => w.layoutState?.layout.panelId === c?.name) || s[0], A = d.layoutState.layout.previewRegion ? {
|
|
13119
13101
|
x: d.layoutState.layout.previewRegion.left,
|
|
13120
13102
|
y: d.layoutState.layout.previewRegion.top,
|
|
13121
13103
|
width: d.layoutState.layout.previewRegion.width,
|
|
@@ -13127,24 +13109,24 @@ class Il {
|
|
|
13127
13109
|
height: d.layoutState.layout.height
|
|
13128
13110
|
}, u = this.workflowManager.getCommandContext().getLayoutById(d.layoutState.layout.id), h = o.getContext("2d");
|
|
13129
13111
|
if (!h)
|
|
13130
|
-
throw new
|
|
13131
|
-
const m = this.workflowManager.getTemplatingContext(), p =
|
|
13112
|
+
throw new Re("Failed to obtain 2D context for preview image creation");
|
|
13113
|
+
const m = this.workflowManager.getTemplatingContext(), p = ka(u.layoutState.layout, u.layoutState.elements, {
|
|
13132
13114
|
renderingConfiguration: {
|
|
13133
13115
|
purpose: Kt.Print,
|
|
13134
13116
|
region: { left: A.x, top: A.y, width: A.width, height: A.height },
|
|
13135
13117
|
templatingContext: m
|
|
13136
13118
|
}
|
|
13137
|
-
}), g =
|
|
13138
|
-
await (await
|
|
13119
|
+
}), g = Dn(p);
|
|
13120
|
+
await (await va.from(h, g, {
|
|
13139
13121
|
anonymousCrossOrigin: !0,
|
|
13140
13122
|
ignoreDimensions: !1,
|
|
13141
13123
|
createCanvas: Ct,
|
|
13142
13124
|
createImage: ie,
|
|
13143
|
-
DOMParser:
|
|
13125
|
+
DOMParser: Ba(),
|
|
13144
13126
|
fetch
|
|
13145
13127
|
})).render();
|
|
13146
|
-
const
|
|
13147
|
-
return o.toDataURL(
|
|
13128
|
+
const S = await this.getCanvasObjectURLAsync(o);
|
|
13129
|
+
return o.toDataURL(S);
|
|
13148
13130
|
}
|
|
13149
13131
|
getStepById(t) {
|
|
13150
13132
|
const e = this.getWorkflow()?.steps.find((r) => r.stepName === t);
|
|
@@ -13152,7 +13134,7 @@ class Il {
|
|
|
13152
13134
|
const a = this.cachedStepHandles.get(e.stepName);
|
|
13153
13135
|
if (a)
|
|
13154
13136
|
return a;
|
|
13155
|
-
const i =
|
|
13137
|
+
const i = me.get(this.getWorkflowManager(), e);
|
|
13156
13138
|
return this.cachedStepHandles.set(e.stepName, i), i;
|
|
13157
13139
|
}
|
|
13158
13140
|
getSteps() {
|
|
@@ -13249,17 +13231,17 @@ class Il {
|
|
|
13249
13231
|
getStepByName(t) {
|
|
13250
13232
|
const e = this.getWorkflow()?.steps.find((a) => a.stepTitle === t);
|
|
13251
13233
|
if (!(!e || !this.stepHasHandle(e)))
|
|
13252
|
-
return
|
|
13234
|
+
return me.get(this.getWorkflowManager(), e);
|
|
13253
13235
|
}
|
|
13254
13236
|
getStepsByType(t) {
|
|
13255
|
-
return this.getWorkflow()?.steps.filter((e) => e.type === t).map((e) =>
|
|
13237
|
+
return this.getWorkflow()?.steps.filter((e) => e.type === t).map((e) => me.get(this.getWorkflowManager(), e)) || [];
|
|
13256
13238
|
}
|
|
13257
13239
|
getStepsByScene(t) {
|
|
13258
13240
|
if (!this.getWorkflow()?.stepGroups.find((a) => a.name === t.name))
|
|
13259
13241
|
throw new Error(
|
|
13260
13242
|
"Given scene is not present on workflow! Be careful when persisting scenes that you only use them with the relevant workflow."
|
|
13261
13243
|
);
|
|
13262
|
-
return t.stepIds.map((a) => this.getWorkflow()?.steps.find((i) => i.stepName === a)).filter((a) => this.stepHasHandle(a)).map((a) =>
|
|
13244
|
+
return t.stepIds.map((a) => this.getWorkflow()?.steps.find((i) => i.stepName === a)).filter((a) => this.stepHasHandle(a)).map((a) => me.get(this.getWorkflowManager(), a));
|
|
13263
13245
|
}
|
|
13264
13246
|
async attachCustomerDetails(t) {
|
|
13265
13247
|
return this.assignCustomerDetails({ emailAddress: t.email });
|
|
@@ -13362,7 +13344,7 @@ class Il {
|
|
|
13362
13344
|
* @returns Returns true when a valid handle is implemented for a given step type. Certain steps don't support handles, such as silent illustrations.
|
|
13363
13345
|
*/
|
|
13364
13346
|
stepHasHandle(t) {
|
|
13365
|
-
return t.type !==
|
|
13347
|
+
return t.type !== v.SilentIllustration && t.type !== v.ProductOverlay;
|
|
13366
13348
|
}
|
|
13367
13349
|
getExportedStepData() {
|
|
13368
13350
|
const t = this.getWorkflow(), e = this.getWorkflowManager().getWorkflowMetadata(), a = this.getWorkflowManager().getWorkflowSelections(), i = [];
|
|
@@ -13381,7 +13363,7 @@ class Il {
|
|
|
13381
13363
|
return;
|
|
13382
13364
|
}
|
|
13383
13365
|
switch (r.type) {
|
|
13384
|
-
case
|
|
13366
|
+
case v.Frame:
|
|
13385
13367
|
{
|
|
13386
13368
|
const d = r.data, A = s;
|
|
13387
13369
|
A.image && d.displayImageOnFinishStep && c.properties.push({
|
|
@@ -13391,7 +13373,7 @@ class Il {
|
|
|
13391
13373
|
});
|
|
13392
13374
|
}
|
|
13393
13375
|
break;
|
|
13394
|
-
case
|
|
13376
|
+
case v.Illustration:
|
|
13395
13377
|
{
|
|
13396
13378
|
const d = r.data, A = s;
|
|
13397
13379
|
if (A && A.colors && A.colors.length > 0 && d.displayColorsOnFinishStep) {
|
|
@@ -13404,7 +13386,7 @@ class Il {
|
|
|
13404
13386
|
}
|
|
13405
13387
|
}
|
|
13406
13388
|
break;
|
|
13407
|
-
case
|
|
13389
|
+
case v.Module:
|
|
13408
13390
|
{
|
|
13409
13391
|
const d = r.data, A = s;
|
|
13410
13392
|
A && A.text && d.displayTextOnFinishStep && c.properties.push({
|
|
@@ -13414,7 +13396,7 @@ class Il {
|
|
|
13414
13396
|
});
|
|
13415
13397
|
}
|
|
13416
13398
|
break;
|
|
13417
|
-
case
|
|
13399
|
+
case v.Text: {
|
|
13418
13400
|
const d = r.data, A = s;
|
|
13419
13401
|
A && A.text && d.displayTextOnFinishStep && c.properties.push({
|
|
13420
13402
|
type: "text",
|
|
@@ -13468,14 +13450,14 @@ class Il {
|
|
|
13468
13450
|
}
|
|
13469
13451
|
const Bl = (n) => {
|
|
13470
13452
|
if ([
|
|
13471
|
-
|
|
13472
|
-
|
|
13473
|
-
|
|
13474
|
-
|
|
13475
|
-
|
|
13476
|
-
|
|
13477
|
-
|
|
13478
|
-
|
|
13453
|
+
v.Question,
|
|
13454
|
+
v.Frame,
|
|
13455
|
+
v.Illustration,
|
|
13456
|
+
v.Material,
|
|
13457
|
+
v.Model,
|
|
13458
|
+
v.Picture,
|
|
13459
|
+
v.Shape,
|
|
13460
|
+
v.Text
|
|
13479
13461
|
].includes(n.type)) {
|
|
13480
13462
|
const e = n.data;
|
|
13481
13463
|
return !!e.displaySelectionOnFinishStep || !!e.displaySelectionsOnFinishStep;
|
|
@@ -13489,7 +13471,7 @@ const Bl = (n) => {
|
|
|
13489
13471
|
}
|
|
13490
13472
|
return !1;
|
|
13491
13473
|
};
|
|
13492
|
-
class
|
|
13474
|
+
class Dl {
|
|
13493
13475
|
constructor(t) {
|
|
13494
13476
|
this.handleCache = {}, this.bundle = t;
|
|
13495
13477
|
}
|
|
@@ -13531,16 +13513,16 @@ class Fl {
|
|
|
13531
13513
|
async createHandle(t) {
|
|
13532
13514
|
switch (t.type) {
|
|
13533
13515
|
case G.FileUpload:
|
|
13534
|
-
return new
|
|
13516
|
+
return new Fl(this.bundle, t).initialize();
|
|
13535
13517
|
case G.ColorOption:
|
|
13536
|
-
return new
|
|
13518
|
+
return new cn(
|
|
13537
13519
|
this.bundle,
|
|
13538
13520
|
t,
|
|
13539
13521
|
t.entityId ? await J.getOption(t.entityId) : void 0
|
|
13540
13522
|
);
|
|
13541
13523
|
case G.Option: {
|
|
13542
13524
|
const e = t.entityId ? await J.getOption(t.entityId) : void 0;
|
|
13543
|
-
return e?.type === "Color" ? new
|
|
13525
|
+
return e?.type === "Color" ? new cn(this.bundle, t, e) : new pi(this.bundle, t, e);
|
|
13544
13526
|
}
|
|
13545
13527
|
case G.Text:
|
|
13546
13528
|
return new xl(this.bundle, t);
|
|
@@ -13549,7 +13531,7 @@ class Fl {
|
|
|
13549
13531
|
}
|
|
13550
13532
|
}
|
|
13551
13533
|
}
|
|
13552
|
-
class
|
|
13534
|
+
class Ra {
|
|
13553
13535
|
constructor(t, e) {
|
|
13554
13536
|
this.bundle = t, this.property = e;
|
|
13555
13537
|
}
|
|
@@ -13610,7 +13592,7 @@ class Oa {
|
|
|
13610
13592
|
return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
|
|
13611
13593
|
}
|
|
13612
13594
|
}
|
|
13613
|
-
class
|
|
13595
|
+
class Fl extends Ra {
|
|
13614
13596
|
constructor(t, e) {
|
|
13615
13597
|
super(t, e);
|
|
13616
13598
|
}
|
|
@@ -13621,7 +13603,7 @@ class Dl extends Oa {
|
|
|
13621
13603
|
const t = await this.getImage();
|
|
13622
13604
|
if (t?.fileLink)
|
|
13623
13605
|
if (t?.fileLink.endsWith(".svg")) {
|
|
13624
|
-
const e = await nt(t?.fileLink), a = await
|
|
13606
|
+
const e = await nt(t?.fileLink), a = await Na(t?.fileLink), i = a.width, r = a.height, o = await lt(e);
|
|
13625
13607
|
this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.colors?.forEach((c) => {
|
|
13626
13608
|
o.colors[c.key] = {
|
|
13627
13609
|
browserValue: c.browserValue,
|
|
@@ -13664,7 +13646,7 @@ class Dl extends Oa {
|
|
|
13664
13646
|
]);
|
|
13665
13647
|
}
|
|
13666
13648
|
async canUseBackgroundRemover() {
|
|
13667
|
-
return this.bundle.getClient().canUseAddon(
|
|
13649
|
+
return this.bundle.getClient().canUseAddon(Ea.BackgroundRemover);
|
|
13668
13650
|
}
|
|
13669
13651
|
/**
|
|
13670
13652
|
* Removes the background from an image, stores it in the state, and returns the new asset.
|
|
@@ -13702,7 +13684,7 @@ class Dl extends Oa {
|
|
|
13702
13684
|
return V.getLocalOrFromServer(t);
|
|
13703
13685
|
}
|
|
13704
13686
|
async getImageWithColors() {
|
|
13705
|
-
return await this.loadImageData(), this.imageData?.svg ?
|
|
13687
|
+
return await this.loadImageData(), this.imageData?.svg ? ba(Fa(this.imageData.svg, this.imageData.colors ?? {}, !1)) : this.imageData?.src;
|
|
13706
13688
|
}
|
|
13707
13689
|
/**
|
|
13708
13690
|
* Retrieves the original, unmodified image selection, if one exists.
|
|
@@ -13836,7 +13818,7 @@ class Dl extends Oa {
|
|
|
13836
13818
|
);
|
|
13837
13819
|
}
|
|
13838
13820
|
}
|
|
13839
|
-
class xl extends
|
|
13821
|
+
class xl extends Ra {
|
|
13840
13822
|
constructor(t, e) {
|
|
13841
13823
|
super(t, e);
|
|
13842
13824
|
}
|
|
@@ -13875,7 +13857,7 @@ class xl extends Oa {
|
|
|
13875
13857
|
await Promise.all(i);
|
|
13876
13858
|
}
|
|
13877
13859
|
}
|
|
13878
|
-
class pi extends
|
|
13860
|
+
class pi extends Ra {
|
|
13879
13861
|
constructor(t, e, a) {
|
|
13880
13862
|
super(t, e), this.optionResource = a;
|
|
13881
13863
|
}
|
|
@@ -13937,7 +13919,7 @@ class pi extends Oa {
|
|
|
13937
13919
|
await Promise.all(i);
|
|
13938
13920
|
}
|
|
13939
13921
|
}
|
|
13940
|
-
class
|
|
13922
|
+
class cn extends pi {
|
|
13941
13923
|
constructor(t, e, a) {
|
|
13942
13924
|
super(t, e, a);
|
|
13943
13925
|
}
|
|
@@ -13960,15 +13942,15 @@ class dn extends pi {
|
|
|
13960
13942
|
async applyColorVariant(t, e, a) {
|
|
13961
13943
|
const r = this.getSharedSteps(e).map((o) => {
|
|
13962
13944
|
switch (o.getType()) {
|
|
13963
|
-
case
|
|
13945
|
+
case v.Shape:
|
|
13964
13946
|
return o.selectVariant(t);
|
|
13965
|
-
case
|
|
13947
|
+
case v.Text:
|
|
13966
13948
|
return o.setFillColor({
|
|
13967
13949
|
fill: t.getColor(),
|
|
13968
13950
|
stroke: t.getColor(),
|
|
13969
13951
|
variant: t.getResource()
|
|
13970
13952
|
});
|
|
13971
|
-
case
|
|
13953
|
+
case v.Illustration:
|
|
13972
13954
|
return o.setColor(a?.toString() || "", t.getColor() || "");
|
|
13973
13955
|
}
|
|
13974
13956
|
});
|
|
@@ -13992,22 +13974,22 @@ const kl = (n, t, e, a) => n.flatMap((i) => i.getSteps()).filter((i) => i.getGlo
|
|
|
13992
13974
|
n,
|
|
13993
13975
|
t,
|
|
13994
13976
|
e,
|
|
13995
|
-
|
|
13977
|
+
v.Illustration
|
|
13996
13978
|
).map((r) => {
|
|
13997
13979
|
const o = r.getCurrentVariant()?.getAssetResource(), s = r.getColors();
|
|
13998
13980
|
return !o?.assetConfiguration || !s ? 0 : Object.getOwnPropertyNames(s).length;
|
|
13999
13981
|
});
|
|
14000
13982
|
return Math.max(...i);
|
|
14001
13983
|
};
|
|
14002
|
-
function
|
|
13984
|
+
function ya(n, t) {
|
|
14003
13985
|
function e(a) {
|
|
14004
13986
|
if (typeof a > "u" || !Array.isArray(a) && !Nl(a))
|
|
14005
13987
|
return a;
|
|
14006
13988
|
if (Array.isArray(a))
|
|
14007
|
-
return
|
|
13989
|
+
return ya(a, t);
|
|
14008
13990
|
let i = {};
|
|
14009
13991
|
for (const [r, o] of Object.entries(a))
|
|
14010
|
-
i[r] = Tl(o) ? o :
|
|
13992
|
+
i[r] = Tl(o) ? o : ya(o, t);
|
|
14011
13993
|
return Vi(i, t);
|
|
14012
13994
|
}
|
|
14013
13995
|
return Array.isArray(n) ? n.map(e) : e(n);
|
|
@@ -14024,17 +14006,17 @@ function fi(n) {
|
|
|
14024
14006
|
e.value !== "" && t.set(e.name, !0);
|
|
14025
14007
|
}), t;
|
|
14026
14008
|
}
|
|
14027
|
-
function
|
|
14028
|
-
return
|
|
14009
|
+
function ge(n) {
|
|
14010
|
+
return ya(n, ["__typename"]);
|
|
14029
14011
|
}
|
|
14030
14012
|
class Ql {
|
|
14031
14013
|
constructor(t, e, a, i, r) {
|
|
14032
14014
|
this.mandatoryFulfilledAspects = /* @__PURE__ */ new Map(), this.bundleId = t, this.bundleOwnerId = e, this.configuration = a, this.bundleOptions = r;
|
|
14033
14015
|
const o = r?.existingGlobalPropertyState;
|
|
14034
14016
|
this.initPromise = o ? Promise.resolve(o).then(() => {
|
|
14035
|
-
console.log("Setting global property state to existing state."), this.globalPropertyState =
|
|
14017
|
+
console.log("Setting global property state to existing state."), this.globalPropertyState = ge(o), this.recalculateMandatoryStates();
|
|
14036
14018
|
}) : this.createGlobalPropertyState().then((s) => {
|
|
14037
|
-
console.log("Setting global property state to new state."), this.globalPropertyState =
|
|
14019
|
+
console.log("Setting global property state to new state."), this.globalPropertyState = ge(s), this.recalculateMandatoryStates();
|
|
14038
14020
|
}), this.onGlobalPropertyStateChange = i;
|
|
14039
14021
|
}
|
|
14040
14022
|
async clearAspects(t) {
|
|
@@ -14064,7 +14046,7 @@ class Ql {
|
|
|
14064
14046
|
async setGlobalPropertyState(t) {
|
|
14065
14047
|
this.globalPropertyState || await this.initPromise;
|
|
14066
14048
|
const e = It(this.globalPropertyState);
|
|
14067
|
-
this.globalPropertyState = { ...
|
|
14049
|
+
this.globalPropertyState = { ...ge(t), id: e.id }, this.recalculateMandatoryStates(), await this.updateGlobalPropertyState(), await this.onGlobalPropertyStateChange(e, this.globalPropertyState);
|
|
14068
14050
|
}
|
|
14069
14051
|
getAspectMandatoryFulfilled(t) {
|
|
14070
14052
|
return this.mandatoryFulfilledAspects.get(t);
|
|
@@ -14193,7 +14175,7 @@ class Ql {
|
|
|
14193
14175
|
}
|
|
14194
14176
|
});
|
|
14195
14177
|
if (t.data?.globalPropertyStateUpdate)
|
|
14196
|
-
this.globalPropertyState =
|
|
14178
|
+
this.globalPropertyState = ge(t.data.globalPropertyStateUpdate);
|
|
14197
14179
|
else
|
|
14198
14180
|
throw new Error("Unable to update global property state");
|
|
14199
14181
|
}
|
|
@@ -14432,14 +14414,14 @@ class Ci {
|
|
|
14432
14414
|
getProducts() {
|
|
14433
14415
|
if (!this.collection.productCollectionProducts)
|
|
14434
14416
|
throw new Error("Failed to find products on collection. Ensure you fetch them first!");
|
|
14435
|
-
return this.collection.productCollectionProducts.filter((t) => !!t.product).map((t) => new
|
|
14417
|
+
return this.collection.productCollectionProducts.filter((t) => !!t.product).map((t) => new pe(t));
|
|
14436
14418
|
}
|
|
14437
14419
|
/**
|
|
14438
14420
|
* A list of products in this collections with useful helpers for interacting with them.
|
|
14439
14421
|
*/
|
|
14440
14422
|
async fetchProducts(t) {
|
|
14441
14423
|
if (this.fullFetched)
|
|
14442
|
-
return this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new
|
|
14424
|
+
return this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new pe(a));
|
|
14443
14425
|
const e = await y.getShadowGraphqlClient().query({
|
|
14444
14426
|
query: xs,
|
|
14445
14427
|
variables: {
|
|
@@ -14448,7 +14430,7 @@ class Ci {
|
|
|
14448
14430
|
},
|
|
14449
14431
|
errorPolicy: "all"
|
|
14450
14432
|
});
|
|
14451
|
-
return t || (this.fullFetched = !0), this.collection.productCollectionProducts = e.data.productCollections[0].productCollectionProducts || [], this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new
|
|
14433
|
+
return t || (this.fullFetched = !0), this.collection.productCollectionProducts = e.data.productCollections[0].productCollectionProducts || [], this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new pe(a));
|
|
14452
14434
|
}
|
|
14453
14435
|
/**
|
|
14454
14436
|
* Returns a list of collections products matching the associated metafield/tag filters.
|
|
@@ -14538,7 +14520,7 @@ class Ci {
|
|
|
14538
14520
|
if (h || p.partial && (!p.data.productCollections || p.data.productCollections.length === 0 || !p.data.productCollections[0].productCollectionProductsFeed?.items || p.data.productCollections[0].productCollectionProductsFeed?.items.length === 0))
|
|
14539
14521
|
return;
|
|
14540
14522
|
c.abort(), h = !0, m.unsubscribe();
|
|
14541
|
-
const g = p.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((f) => !!f.product).map((f) => new
|
|
14523
|
+
const g = p.data.productCollections?.[0].productCollectionProductsFeed?.items.filter((f) => !!f.product).map((f) => new pe(It(f))) || [];
|
|
14542
14524
|
u({
|
|
14543
14525
|
items: g,
|
|
14544
14526
|
// Clone items because it could be cached data (immutable)
|
|
@@ -14562,7 +14544,7 @@ class Ci {
|
|
|
14562
14544
|
return this.collection;
|
|
14563
14545
|
}
|
|
14564
14546
|
}
|
|
14565
|
-
class
|
|
14547
|
+
class pe {
|
|
14566
14548
|
constructor(t) {
|
|
14567
14549
|
this.product = t.product, this.productResource = t;
|
|
14568
14550
|
}
|
|
@@ -14755,7 +14737,7 @@ class zl {
|
|
|
14755
14737
|
}
|
|
14756
14738
|
}
|
|
14757
14739
|
const Gl = C`
|
|
14758
|
-
${
|
|
14740
|
+
${We(!1)}
|
|
14759
14741
|
query GetProductCollections($ids: [String!]!) {
|
|
14760
14742
|
productCollections(ids: $ids) {
|
|
14761
14743
|
...ProductCollectionFields
|
|
@@ -14831,7 +14813,7 @@ const ql = C`
|
|
|
14831
14813
|
}
|
|
14832
14814
|
}
|
|
14833
14815
|
`;
|
|
14834
|
-
class
|
|
14816
|
+
class dn {
|
|
14835
14817
|
constructor(t, e, a, i, r, o, s) {
|
|
14836
14818
|
this.workflowExperiences = [], this.eventEmitter = new Wl(), this.updatesLocked = !1, this.client = t, this.id = e.id, this.name = e.name || "", this.dispatchDate = e.dispatchDate, this.template = e.template || !1, this.quoteId = e.quoteId, this.shareActions = e.bundleShareActions, this.workflowViewerLink = e.workflowViewerLink, this.workflowViewerAmendLink = e.workflowViewerAmendLink, this.ownerId = r, this.metadata = new Map(e.metadata?.map((d) => [d.key, d.value]) || []), this.completed = e.completed ?? !1, this.productCollection = e.productCollection, this.bundleStateManager = new Rl(e.bundleStateData);
|
|
14837
14819
|
const l = this.productCollection?.globalPropertyConfiguration;
|
|
@@ -14841,7 +14823,7 @@ class oa {
|
|
|
14841
14823
|
l,
|
|
14842
14824
|
this.onGlobalPropertiesChanged.bind(this),
|
|
14843
14825
|
o
|
|
14844
|
-
), this.globalPropertyHandleService = new
|
|
14826
|
+
), this.globalPropertyHandleService = new Dl(this), this.setPreviewService(a);
|
|
14845
14827
|
const c = new Promise((d, A) => {
|
|
14846
14828
|
if (o?.readonly) {
|
|
14847
14829
|
d([]);
|
|
@@ -14853,7 +14835,7 @@ class oa {
|
|
|
14853
14835
|
const m = h.map((p) => {
|
|
14854
14836
|
if (p.getType() === G.ColorOption || p.getType() === G.Option) {
|
|
14855
14837
|
const g = p;
|
|
14856
|
-
if (!u.aspects.find((
|
|
14838
|
+
if (!u.aspects.find((S) => S.name === g.getName()))
|
|
14857
14839
|
return g.initDefaultVariant();
|
|
14858
14840
|
}
|
|
14859
14841
|
});
|
|
@@ -15045,7 +15027,7 @@ class oa {
|
|
|
15045
15027
|
if (r)
|
|
15046
15028
|
switch (a.type) {
|
|
15047
15029
|
case G.FileUpload: {
|
|
15048
|
-
const o = r, s = await
|
|
15030
|
+
const o = r, s = await Fe([a.value]);
|
|
15049
15031
|
s.length > 0 && await o.selectImage(s[0]);
|
|
15050
15032
|
const l = a.storage?.colors;
|
|
15051
15033
|
if (l) {
|
|
@@ -15092,7 +15074,7 @@ class oa {
|
|
|
15092
15074
|
return this.productCollection ? new Ci(this.productCollection) : void 0;
|
|
15093
15075
|
}
|
|
15094
15076
|
async initializeAdditionalRequiredColorChannels(t) {
|
|
15095
|
-
for (const e of t.getStepsByType(
|
|
15077
|
+
for (const e of t.getStepsByType(v.Illustration)) {
|
|
15096
15078
|
const a = e.getGlobalPropertyAspects(this.globalConfigurationPropertyId || "");
|
|
15097
15079
|
for (const i of a) {
|
|
15098
15080
|
const r = this.getGlobalPropertyConfiguration()?.aspects.find(
|
|
@@ -15296,7 +15278,7 @@ class oa {
|
|
|
15296
15278
|
variables: {
|
|
15297
15279
|
id: this.id,
|
|
15298
15280
|
details: t,
|
|
15299
|
-
type: e ||
|
|
15281
|
+
type: e || Be.Owner
|
|
15300
15282
|
},
|
|
15301
15283
|
context: {
|
|
15302
15284
|
bundleOwnerId: this.ownerId
|
|
@@ -15335,7 +15317,7 @@ class oa {
|
|
|
15335
15317
|
}
|
|
15336
15318
|
async getAllStakeholders() {
|
|
15337
15319
|
const t = await y.getShadowGraphqlClient().query({
|
|
15338
|
-
query:
|
|
15320
|
+
query: rn,
|
|
15339
15321
|
errorPolicy: "all",
|
|
15340
15322
|
fetchPolicy: "no-cache",
|
|
15341
15323
|
variables: {
|
|
@@ -15351,7 +15333,7 @@ class oa {
|
|
|
15351
15333
|
}
|
|
15352
15334
|
async getCurrentStakeholder() {
|
|
15353
15335
|
const t = await y.getShadowGraphqlClient().query({
|
|
15354
|
-
query:
|
|
15336
|
+
query: rn,
|
|
15355
15337
|
errorPolicy: "all",
|
|
15356
15338
|
fetchPolicy: "no-cache",
|
|
15357
15339
|
variables: {
|
|
@@ -15707,14 +15689,14 @@ class Kl {
|
|
|
15707
15689
|
* @returns The nodes contained within the execution.
|
|
15708
15690
|
*/
|
|
15709
15691
|
getNodes() {
|
|
15710
|
-
return this.execution.nodes.map((t) => new
|
|
15692
|
+
return this.execution.nodes.map((t) => new fe(t));
|
|
15711
15693
|
}
|
|
15712
15694
|
/**
|
|
15713
15695
|
* @param type The type of node to return.
|
|
15714
15696
|
* @returns A list of nodes matching the requested type.
|
|
15715
15697
|
*/
|
|
15716
15698
|
getNodesByType(t) {
|
|
15717
|
-
return this.execution.nodes.filter((e) => e.type === t).map((e) => new
|
|
15699
|
+
return this.execution.nodes.filter((e) => e.type === t).map((e) => new fe(e));
|
|
15718
15700
|
}
|
|
15719
15701
|
/**
|
|
15720
15702
|
* @returns A list of input nodes that exist in this execution.
|
|
@@ -15723,7 +15705,7 @@ class Kl {
|
|
|
15723
15705
|
return this.execution.nodes.filter(
|
|
15724
15706
|
(t) => t.type === "StartTerminal"
|
|
15725
15707
|
/* StartTerminal */
|
|
15726
|
-
).map((t) => new
|
|
15708
|
+
).map((t) => new fe(t));
|
|
15727
15709
|
}
|
|
15728
15710
|
/**
|
|
15729
15711
|
* @returns A list of out put nodes that exist in this execution.
|
|
@@ -15732,7 +15714,7 @@ class Kl {
|
|
|
15732
15714
|
return this.execution.nodes.filter(
|
|
15733
15715
|
(t) => t.type === "EndTerminal"
|
|
15734
15716
|
/* EndTerminal */
|
|
15735
|
-
).map((t) => new
|
|
15717
|
+
).map((t) => new fe(t));
|
|
15736
15718
|
}
|
|
15737
15719
|
/**
|
|
15738
15720
|
* @returns A date object representing the point in time this execution completed.
|
|
@@ -15749,7 +15731,7 @@ class Kl {
|
|
|
15749
15731
|
return new Date(this.execution.failedAt);
|
|
15750
15732
|
}
|
|
15751
15733
|
}
|
|
15752
|
-
class
|
|
15734
|
+
class fe {
|
|
15753
15735
|
constructor(t) {
|
|
15754
15736
|
this.node = t;
|
|
15755
15737
|
}
|
|
@@ -15766,7 +15748,7 @@ class we {
|
|
|
15766
15748
|
return this.getArtifacts().get(t);
|
|
15767
15749
|
}
|
|
15768
15750
|
}
|
|
15769
|
-
class
|
|
15751
|
+
class Oa {
|
|
15770
15752
|
constructor(t) {
|
|
15771
15753
|
this.value = t;
|
|
15772
15754
|
}
|
|
@@ -15779,12 +15761,12 @@ class $a {
|
|
|
15779
15761
|
}
|
|
15780
15762
|
}
|
|
15781
15763
|
var _l = /* @__PURE__ */ ((n) => (n.Transaction = "Transaction", n.Bundle = "Bundle", n.Product = "Product", n.Variant = "Variant", n.Option = "Option", n.LineItem = "LineItem", n.Asset = "Asset", n))(_l || {});
|
|
15782
|
-
class Rd extends
|
|
15764
|
+
class Rd extends Oa {
|
|
15783
15765
|
constructor(t) {
|
|
15784
15766
|
super(`"${t}"`);
|
|
15785
15767
|
}
|
|
15786
15768
|
}
|
|
15787
|
-
class wi extends
|
|
15769
|
+
class wi extends Oa {
|
|
15788
15770
|
constructor(t, e) {
|
|
15789
15771
|
if (e !== "Asset" && !wi.validUUID(t))
|
|
15790
15772
|
throw new Error("Invalid ID, must be a valid v4 UUID. https://www.uuidgenerator.net/");
|
|
@@ -15794,7 +15776,7 @@ class wi extends $a {
|
|
|
15794
15776
|
return t.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i);
|
|
15795
15777
|
}
|
|
15796
15778
|
}
|
|
15797
|
-
class Od extends
|
|
15779
|
+
class Od extends Oa {
|
|
15798
15780
|
constructor(t) {
|
|
15799
15781
|
super(`[${t.map((e) => e.getRaw()).join(",")}]`);
|
|
15800
15782
|
}
|
|
@@ -15839,7 +15821,7 @@ class An {
|
|
|
15839
15821
|
return t.sort((e, a) => (e.index ?? 0) - (a.index ?? 0)).map((e) => new Ht(e));
|
|
15840
15822
|
}
|
|
15841
15823
|
}
|
|
15842
|
-
const
|
|
15824
|
+
const Ce = C`
|
|
15843
15825
|
query GetCustomer($emailAddress: String!) {
|
|
15844
15826
|
customer(emailAddress: $emailAddress) {
|
|
15845
15827
|
id
|
|
@@ -15987,7 +15969,7 @@ class ac {
|
|
|
15987
15969
|
}
|
|
15988
15970
|
async generateCode(t) {
|
|
15989
15971
|
const e = await this.cognitoClient?.send(
|
|
15990
|
-
new
|
|
15972
|
+
new Va({
|
|
15991
15973
|
AuthFlow: "CUSTOM_AUTH",
|
|
15992
15974
|
ClientId: this.userPoolClientId,
|
|
15993
15975
|
AuthParameters: {
|
|
@@ -16021,7 +16003,7 @@ class ac {
|
|
|
16021
16003
|
throw new Error("Failed to find existing tokens.");
|
|
16022
16004
|
const e = JSON.parse(t);
|
|
16023
16005
|
return await this.cognitoClient?.send(
|
|
16024
|
-
new
|
|
16006
|
+
new Va({
|
|
16025
16007
|
AuthFlow: "REFRESH_TOKEN_AUTH",
|
|
16026
16008
|
ClientId: this.userPoolClientId,
|
|
16027
16009
|
AuthParameters: {
|
|
@@ -16051,7 +16033,7 @@ class nc {
|
|
|
16051
16033
|
* @param currency The currency to determine precision for.
|
|
16052
16034
|
*/
|
|
16053
16035
|
getPrecisionForCurrency(t) {
|
|
16054
|
-
const e = t, a =
|
|
16036
|
+
const e = t, a = za.code(e);
|
|
16055
16037
|
return a ? a.digits : 2;
|
|
16056
16038
|
}
|
|
16057
16039
|
/**
|
|
@@ -16062,7 +16044,7 @@ class nc {
|
|
|
16062
16044
|
*/
|
|
16063
16045
|
getSpecialFormat(t) {
|
|
16064
16046
|
const e = t;
|
|
16065
|
-
if (
|
|
16047
|
+
if (za.code(e)?.code === "CLP")
|
|
16066
16048
|
return "USD0,0";
|
|
16067
16049
|
}
|
|
16068
16050
|
}
|
|
@@ -16164,7 +16146,7 @@ class $d {
|
|
|
16164
16146
|
} catch (a) {
|
|
16165
16147
|
throw console.error(a), new gt("Critical - Unable to synchronize workflow state with server.");
|
|
16166
16148
|
}
|
|
16167
|
-
}, this.options = t, this.options.applicationKey && rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 33.
|
|
16149
|
+
}, this.options = t, this.options.applicationKey && rr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 33.13.0"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
|
16168
16150
|
}
|
|
16169
16151
|
configure(t) {
|
|
16170
16152
|
ft.setHubUrl(t.hubUrl), ft.setServerUrl(t.serverUrl), ft.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && sr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && zt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
|
@@ -16214,7 +16196,7 @@ class $d {
|
|
|
16214
16196
|
*/
|
|
16215
16197
|
async authenticateBundleFromLocalStorage(t) {
|
|
16216
16198
|
if (k.getMap("bundleOwnerIds")?.has(t))
|
|
16217
|
-
return Promise.resolve({ success: !0, stakeholderType:
|
|
16199
|
+
return Promise.resolve({ success: !0, stakeholderType: Be.Owner });
|
|
16218
16200
|
const a = k.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
|
16219
16201
|
if (a.has(t)) {
|
|
16220
16202
|
const i = a.get(t);
|
|
@@ -16258,7 +16240,7 @@ class $d {
|
|
|
16258
16240
|
if (i.isOrdered)
|
|
16259
16241
|
return Promise.resolve({ success: !1, transactionReadOnly: !0 });
|
|
16260
16242
|
if (k.getMap("transactionOwnerIds")?.has(t))
|
|
16261
|
-
return Promise.resolve({ success: !0, stakeholderType:
|
|
16243
|
+
return Promise.resolve({ success: !0, stakeholderType: Be.Owner });
|
|
16262
16244
|
const s = k.getMap("transactionCustomerIds");
|
|
16263
16245
|
if (s?.has(t) && s.get(t) && await this.reloadLoggedInCustomer()) {
|
|
16264
16246
|
const u = this.customer?.bundleStakeholders?.find(
|
|
@@ -16296,7 +16278,7 @@ class $d {
|
|
|
16296
16278
|
}
|
|
16297
16279
|
async customerHasBundleTemplates(t) {
|
|
16298
16280
|
const i = (await y.getShadowGraphqlClient().query({
|
|
16299
|
-
query:
|
|
16281
|
+
query: Ce,
|
|
16300
16282
|
errorPolicy: "all",
|
|
16301
16283
|
fetchPolicy: "no-cache",
|
|
16302
16284
|
variables: {
|
|
@@ -16315,7 +16297,7 @@ class $d {
|
|
|
16315
16297
|
async getOrCreateCustomer(t) {
|
|
16316
16298
|
this.customer = void 0;
|
|
16317
16299
|
const e = y.getShadowGraphqlClient(), i = (await e.query({
|
|
16318
|
-
query:
|
|
16300
|
+
query: Ce,
|
|
16319
16301
|
errorPolicy: "all",
|
|
16320
16302
|
fetchPolicy: "no-cache",
|
|
16321
16303
|
variables: {
|
|
@@ -16368,7 +16350,7 @@ class $d {
|
|
|
16368
16350
|
return this.logOut(), console.error("Failed to refresh tokens."), !1;
|
|
16369
16351
|
}
|
|
16370
16352
|
const s = (await y.getShadowGraphqlClient().query({
|
|
16371
|
-
query:
|
|
16353
|
+
query: Ce,
|
|
16372
16354
|
errorPolicy: "all",
|
|
16373
16355
|
fetchPolicy: "no-cache",
|
|
16374
16356
|
variables: {
|
|
@@ -16397,7 +16379,7 @@ class $d {
|
|
|
16397
16379
|
if (i?.AuthenticationResult) {
|
|
16398
16380
|
localStorage.setItem("last-refreshed-cognito-tokens", `${(/* @__PURE__ */ new Date()).getTime() / 1e3}`), localStorage.setItem("cognito-tokens", JSON.stringify(i.AuthenticationResult)), localStorage.setItem("cognito-email", t);
|
|
16399
16381
|
const o = (await y.getShadowGraphqlClient().query({
|
|
16400
|
-
query:
|
|
16382
|
+
query: Ce,
|
|
16401
16383
|
errorPolicy: "all",
|
|
16402
16384
|
fetchPolicy: "no-cache",
|
|
16403
16385
|
variables: {
|
|
@@ -16464,7 +16446,7 @@ class $d {
|
|
|
16464
16446
|
o.set(r.id, r.partner.id), k.setMap("bundlePartnerIds", o);
|
|
16465
16447
|
const s = k.getMap("bundleOwnerIds") || /* @__PURE__ */ new Map();
|
|
16466
16448
|
s.set(r.id, r.bundleOwnerId), k.setMap("bundleOwnerIds", s);
|
|
16467
|
-
const l = new
|
|
16449
|
+
const l = new dn(this, r, void 0, void 0, r.bundleOwnerId, {
|
|
16468
16450
|
eagerFetchProducts: a?.graphql?.productCollection?.eagerFetchProducts
|
|
16469
16451
|
});
|
|
16470
16452
|
return await l.getInitializationPromise(), l;
|
|
@@ -16483,7 +16465,7 @@ class $d {
|
|
|
16483
16465
|
const m = await this.loggedInBearerToken();
|
|
16484
16466
|
l.Authorization = `Bearer ${m}`;
|
|
16485
16467
|
} catch {
|
|
16486
|
-
const g = Object.entries(localStorage).find(([
|
|
16468
|
+
const g = Object.entries(localStorage).find(([S, w]) => S.startsWith("CognitoIdentityServiceProvider") && S.endsWith("idToken"))?.[0] || "", f = localStorage.getItem(g);
|
|
16487
16469
|
f && !ee(f) && (l.Authorization = `Bearer ${f}`);
|
|
16488
16470
|
}
|
|
16489
16471
|
const c = {
|
|
@@ -16491,7 +16473,7 @@ class $d {
|
|
|
16491
16473
|
...l,
|
|
16492
16474
|
...i?.graphql?.additionalHeaders
|
|
16493
16475
|
}, d = await y.getShadowGraphqlClient().query({
|
|
16494
|
-
query:
|
|
16476
|
+
query: Ds(i?.graphql?.productCollection?.eagerFetchProducts || !1),
|
|
16495
16477
|
variables: {
|
|
16496
16478
|
id: t
|
|
16497
16479
|
},
|
|
@@ -16504,7 +16486,7 @@ class $d {
|
|
|
16504
16486
|
throw new Error(`Unable to find bundle: ${t}`);
|
|
16505
16487
|
const A = d.data?.bundles[0], u = k.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
|
16506
16488
|
u.set(A.id, A.partner.id), k.setMap("bundlePartnerIds", u);
|
|
16507
|
-
const h = new
|
|
16489
|
+
const h = new dn(
|
|
16508
16490
|
this,
|
|
16509
16491
|
A,
|
|
16510
16492
|
e,
|
|
@@ -16531,7 +16513,7 @@ class $d {
|
|
|
16531
16513
|
...await Si(t),
|
|
16532
16514
|
...i?.graphql?.additionalHeaders
|
|
16533
16515
|
}, l = (await y.getShadowGraphqlClient().mutate({
|
|
16534
|
-
mutation: Ns(
|
|
16516
|
+
mutation: Ns(),
|
|
16535
16517
|
variables: {
|
|
16536
16518
|
id: t,
|
|
16537
16519
|
template: e,
|
|
@@ -16549,13 +16531,13 @@ class $d {
|
|
|
16549
16531
|
const c = k.getMap("bundlePartnerIds") || /* @__PURE__ */ new Map();
|
|
16550
16532
|
c.set(l.id, l.partner.id), k.setMap("bundlePartnerIds", c);
|
|
16551
16533
|
const d = k.getMap("bundleOwnerIds") || /* @__PURE__ */ new Map();
|
|
16552
|
-
return d.set(l.id, l.bundleOwnerId), k.setMap("bundleOwnerIds", d), async () => {
|
|
16553
|
-
|
|
16554
|
-
|
|
16555
|
-
|
|
16556
|
-
|
|
16557
|
-
|
|
16558
|
-
};
|
|
16534
|
+
return d.set(l.id, l.bundleOwnerId), k.setMap("bundleOwnerIds", d), async () => await this.getExistingBundle(l.id, void 0, void 0, {
|
|
16535
|
+
graphql: {
|
|
16536
|
+
productCollection: {
|
|
16537
|
+
eagerFetchProducts: i?.graphql?.productCollection?.eagerFetchProducts || !1
|
|
16538
|
+
}
|
|
16539
|
+
}
|
|
16540
|
+
});
|
|
16559
16541
|
}
|
|
16560
16542
|
/**
|
|
16561
16543
|
* Fetches information about the currently authenticated customer's bundles.
|
|
@@ -16587,7 +16569,7 @@ class $d {
|
|
|
16587
16569
|
if (!this.customer)
|
|
16588
16570
|
throw new Error("Customer not authenticated.");
|
|
16589
16571
|
const t = await y.getShadowGraphqlClient().query({
|
|
16590
|
-
query:
|
|
16572
|
+
query: Fs,
|
|
16591
16573
|
variables: {
|
|
16592
16574
|
id: this.customer.id
|
|
16593
16575
|
},
|
|
@@ -16622,14 +16604,14 @@ class $d {
|
|
|
16622
16604
|
async getWorkflowExperiences(t, e, a, i) {
|
|
16623
16605
|
if (t.length === 0)
|
|
16624
16606
|
throw new gt("No options provided!");
|
|
16625
|
-
const r = t.map((
|
|
16626
|
-
(
|
|
16627
|
-
), l = 50, c =
|
|
16607
|
+
const r = t.map((B, Q) => ({ option: B, index: Q })), o = r.filter((B) => B.option.type === "transaction"), s = r.filter(
|
|
16608
|
+
(B) => B.option.type === "integration" || B.option.type === "external" || B.option.type === "blank"
|
|
16609
|
+
), l = 50, c = La(o, l), d = La(s, l);
|
|
16628
16610
|
let A = 0;
|
|
16629
|
-
const u = y.getShadowGraphqlClient(), h = async (
|
|
16630
|
-
if (
|
|
16611
|
+
const u = y.getShadowGraphqlClient(), h = async (B) => {
|
|
16612
|
+
if (B.length === 0)
|
|
16631
16613
|
return [];
|
|
16632
|
-
const Q =
|
|
16614
|
+
const Q = B.map((q) => q.option.transactionId), U = await u.query({
|
|
16633
16615
|
query: Vr,
|
|
16634
16616
|
variables: {
|
|
16635
16617
|
ids: Q
|
|
@@ -16637,23 +16619,23 @@ class $d {
|
|
|
16637
16619
|
errorPolicy: "all",
|
|
16638
16620
|
fetchPolicy: "no-cache"
|
|
16639
16621
|
}), N = U.data.transactions;
|
|
16640
|
-
if (A = A + N.length, i && i(A, o.length), N.length !==
|
|
16622
|
+
if (A = A + N.length, i && i(A, o.length), N.length !== B.length) {
|
|
16641
16623
|
const q = U.errors?.[0]?.message || "Unknown error";
|
|
16642
16624
|
throw new gt(`Not all transactions were found: ${q}`);
|
|
16643
16625
|
}
|
|
16644
16626
|
return !this.activeIntegration && N[0].integrationProduct?.integration && (this.activeIntegration = Promise.resolve(N[0].integrationProduct.integration)), N.map((q, St) => ({
|
|
16645
16627
|
transaction: q,
|
|
16646
16628
|
workflowId: q.workflowId,
|
|
16647
|
-
readOnly:
|
|
16648
|
-
index:
|
|
16629
|
+
readOnly: B.find((ut) => ut.option.transactionId === q.id)?.option.readOnly ?? !1,
|
|
16630
|
+
index: B[St].index
|
|
16649
16631
|
}));
|
|
16650
|
-
}, m = async (
|
|
16651
|
-
if (
|
|
16632
|
+
}, m = async (B) => {
|
|
16633
|
+
if (B.length === 0)
|
|
16652
16634
|
return [];
|
|
16653
16635
|
const Q = await u.mutate({
|
|
16654
16636
|
mutation: Ur,
|
|
16655
16637
|
variables: {
|
|
16656
|
-
inputs:
|
|
16638
|
+
inputs: B.map((N) => ({
|
|
16657
16639
|
integrationProductId: N.option.type === "integration" ? N.option.integrationProductId : void 0,
|
|
16658
16640
|
externalIntegrationId: N.option.type === "external" ? N.option.externalIntegrationId : void 0,
|
|
16659
16641
|
externalProductId: N.option.type === "external" ? N.option.externalProductId : void 0,
|
|
@@ -16677,29 +16659,29 @@ class $d {
|
|
|
16677
16659
|
transaction: N,
|
|
16678
16660
|
workflowId: N.workflowId,
|
|
16679
16661
|
readOnly: !1,
|
|
16680
|
-
index:
|
|
16662
|
+
index: B[q].index
|
|
16681
16663
|
}));
|
|
16682
16664
|
}, p = (await Promise.all([
|
|
16683
16665
|
...c.map(h),
|
|
16684
16666
|
...d.map(m)
|
|
16685
16667
|
])).flat(), g = [
|
|
16686
|
-
...new Set(p.map((
|
|
16687
|
-
].filter((
|
|
16688
|
-
(
|
|
16689
|
-
), [
|
|
16668
|
+
...new Set(p.map((B) => B.transaction.integrationProductId))
|
|
16669
|
+
].filter((B) => B !== void 0), f = [...new Set(p.map((B) => B.workflowId))].filter(
|
|
16670
|
+
(B) => B !== void 0
|
|
16671
|
+
), [S, w] = await Promise.all([
|
|
16690
16672
|
(async () => g.length > 0 ? await lc(g) : [])(),
|
|
16691
16673
|
(async () => f.length > 0 ? await yi(f, e) : [])()
|
|
16692
|
-
]),
|
|
16693
|
-
const { transaction: Q, workflowId: U, readOnly: N, index: q } =
|
|
16674
|
+
]), I = new Map(S.map((B) => [B.id, B])), b = new Map(w.map((B) => [B.id, B])), E = k.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), D = p.map(async (B) => {
|
|
16675
|
+
const { transaction: Q, workflowId: U, readOnly: N, index: q } = B, St = U ? b.get(U) : void 0, ut = t[q];
|
|
16694
16676
|
if (Q.integrationProductId) {
|
|
16695
|
-
const rt =
|
|
16677
|
+
const rt = I.get(Q.integrationProductId);
|
|
16696
16678
|
Q.integrationProduct = rt, Q.product = rt?.product, Q.integrationProduct || console.error("failed to find transaction's product");
|
|
16697
16679
|
}
|
|
16698
|
-
!
|
|
16699
|
-
const He =
|
|
16680
|
+
!E.get(Q.id) && Q.transactionOwnerId && E.set(Q.id, Q.transactionOwnerId);
|
|
16681
|
+
const He = E.get(Q.id) || void 0, bi = new ec({
|
|
16700
16682
|
onMutate: () => ({ context: { transactionOwnerId: He, bundleOwnerId: e?.bundleOwnerId } }),
|
|
16701
16683
|
onQuery: () => ({ context: { transactionOwnerId: He, bundleOwnerId: e?.bundleOwnerId } })
|
|
16702
|
-
}),
|
|
16684
|
+
}), ce = {
|
|
16703
16685
|
workflow: St,
|
|
16704
16686
|
transaction: Q,
|
|
16705
16687
|
singleVariantsRenderable: ut?.workflowConfiguration?.singleVariantsRenderable,
|
|
@@ -16715,18 +16697,18 @@ class $d {
|
|
|
16715
16697
|
};
|
|
16716
16698
|
if (ut.type === "transaction" && Q.workflowState) {
|
|
16717
16699
|
const rt = JSON.parse(Q.workflowState);
|
|
16718
|
-
await
|
|
16700
|
+
await Za(rt), ce.reloadedState = rt;
|
|
16719
16701
|
} else if (!N && ut.workflowState) {
|
|
16720
16702
|
const rt = JSON.parse(ut.workflowState);
|
|
16721
|
-
await
|
|
16703
|
+
await Za(rt), ce.reloadedState = rt;
|
|
16722
16704
|
}
|
|
16723
|
-
return
|
|
16724
|
-
}), x = await Promise.all(
|
|
16725
|
-
k.setMap("transactionOwnerIds",
|
|
16726
|
-
const T = x.sort((
|
|
16705
|
+
return ce.delayWorkflowStateSync = !0, { experienceOptions: ce, index: q, options: ut };
|
|
16706
|
+
}), x = await Promise.all(D);
|
|
16707
|
+
k.setMap("transactionOwnerIds", E);
|
|
16708
|
+
const T = x.sort((B, Q) => B.index - Q.index);
|
|
16727
16709
|
let $ = [];
|
|
16728
|
-
for (const
|
|
16729
|
-
const { experienceOptions: Q, options: U } =
|
|
16710
|
+
for (const B of T) {
|
|
16711
|
+
const { experienceOptions: Q, options: U } = B, N = new Il(this, Q);
|
|
16730
16712
|
await N.getWorkflowManager().getInitializationPromise(), a && a(), U.type !== "transaction" && this.customer && await N.attachCustomerDetails({ email: this.customer.emailAddress }), $ = [...$, N], N.getWorkflowManager().setWorkflowStateSyncEnabled(!0);
|
|
16731
16713
|
}
|
|
16732
16714
|
return $;
|
|
@@ -16876,12 +16858,12 @@ function dc(n, t, e, a) {
|
|
|
16876
16858
|
const s = n, l = Math.max(t.width / e.width, t.height / e.height);
|
|
16877
16859
|
s.zoom = Math.max(l, n.zoom);
|
|
16878
16860
|
const c = e.width * s.zoom, d = e.height * s.zoom;
|
|
16879
|
-
return s.x =
|
|
16861
|
+
return s.x = we(n.x, t.width - c, 0), s.y = we(n.y, t.height - d, 0), s;
|
|
16880
16862
|
}
|
|
16881
16863
|
const o = n;
|
|
16882
|
-
return o.x =
|
|
16864
|
+
return o.x = we(o.x, -i, t.width), o.y = we(o.y, -r, t.height), o;
|
|
16883
16865
|
}
|
|
16884
|
-
function
|
|
16866
|
+
function we(n, t, e) {
|
|
16885
16867
|
return Math.min(Math.max(n, t), e);
|
|
16886
16868
|
}
|
|
16887
16869
|
class Ac {
|
|
@@ -16906,7 +16888,7 @@ class Ac {
|
|
|
16906
16888
|
if (i.currentFrameSources) {
|
|
16907
16889
|
let r = !1;
|
|
16908
16890
|
for (let o = 0; o < i.currentFrameSources.length; o++) {
|
|
16909
|
-
const s = i.currentFrameSources[o], l = await
|
|
16891
|
+
const s = i.currentFrameSources[o], l = await ze(s), c = this.frameData ? this.frameData[o] : void 0;
|
|
16910
16892
|
Jt(l, c) || (this.frameData || (this.frameData = new Array(i.currentFrameSources.length)), this.frameData[o] = l, r = !0);
|
|
16911
16893
|
}
|
|
16912
16894
|
r && (this.onFrameDataChangeListeners.forEach(
|
|
@@ -16959,8 +16941,8 @@ class Ac {
|
|
|
16959
16941
|
getImageSrc() {
|
|
16960
16942
|
if (this.imageData) {
|
|
16961
16943
|
if (this.imageData.svg) {
|
|
16962
|
-
const t =
|
|
16963
|
-
return
|
|
16944
|
+
const t = Fa(this.imageData.svg, this.imageData.colors || {}, !1);
|
|
16945
|
+
return ba(t);
|
|
16964
16946
|
}
|
|
16965
16947
|
return this.imageData.src;
|
|
16966
16948
|
}
|
|
@@ -17096,7 +17078,7 @@ class Ac {
|
|
|
17096
17078
|
}
|
|
17097
17079
|
recalculateOffsets(t) {
|
|
17098
17080
|
this.frameData && ((!this.offsets || this.offsets.length !== this.frameData.length) && (this.offsets = new Array(this.frameData.length)), this.frameData.forEach((e, a) => {
|
|
17099
|
-
this.offsets[a] =
|
|
17081
|
+
this.offsets[a] = Ta(
|
|
17100
17082
|
t,
|
|
17101
17083
|
e,
|
|
17102
17084
|
this.initialZoom && !this.forceImageCover ? { scale: this.initialZoom } : void 0,
|
|
@@ -17312,7 +17294,7 @@ class hc extends et {
|
|
|
17312
17294
|
* Returns `true` if the Background Remover is available for the current session.
|
|
17313
17295
|
*/
|
|
17314
17296
|
async canUseBackgroundRemover() {
|
|
17315
|
-
return this.manager.getClient().canUseAddon(
|
|
17297
|
+
return this.manager.getClient().canUseAddon(Ea.BackgroundRemover);
|
|
17316
17298
|
}
|
|
17317
17299
|
/**
|
|
17318
17300
|
* Returns `true` if the Background Remover is available for the current session and if the associated frame has a user-supplied raster image.
|
|
@@ -17438,7 +17420,7 @@ const mc = C`
|
|
|
17438
17420
|
id
|
|
17439
17421
|
}
|
|
17440
17422
|
}
|
|
17441
|
-
`,
|
|
17423
|
+
`, $a = C`
|
|
17442
17424
|
query GetCustomerTransactions(
|
|
17443
17425
|
$id: String!
|
|
17444
17426
|
$limit: Int!
|
|
@@ -17605,7 +17587,7 @@ const mc = C`
|
|
|
17605
17587
|
},
|
|
17606
17588
|
context: t
|
|
17607
17589
|
}), Xd = async (n, t, e) => (await y.getShadowGraphqlClient().query({
|
|
17608
|
-
query:
|
|
17590
|
+
query: $a,
|
|
17609
17591
|
errorPolicy: "all",
|
|
17610
17592
|
fetchPolicy: "no-cache",
|
|
17611
17593
|
variables: {
|
|
@@ -17625,7 +17607,7 @@ const mc = C`
|
|
|
17625
17607
|
limit: t
|
|
17626
17608
|
}
|
|
17627
17609
|
}))?.data.customerTransactionsFeed?.items || [], Zd = async (n, t, e) => (await y.getShadowGraphqlClient().query({
|
|
17628
|
-
query:
|
|
17610
|
+
query: $a,
|
|
17629
17611
|
errorPolicy: "all",
|
|
17630
17612
|
fetchPolicy: "no-cache",
|
|
17631
17613
|
variables: {
|
|
@@ -17645,7 +17627,7 @@ const mc = C`
|
|
|
17645
17627
|
limit: t
|
|
17646
17628
|
}
|
|
17647
17629
|
}))?.data.customerTransactionsFeed?.items || [], tA = async (n, t, e) => (await y.getShadowGraphqlClient().query({
|
|
17648
|
-
query:
|
|
17630
|
+
query: $a,
|
|
17649
17631
|
errorPolicy: "all",
|
|
17650
17632
|
fetchPolicy: "no-cache",
|
|
17651
17633
|
variables: {
|
|
@@ -17680,7 +17662,7 @@ const mc = C`
|
|
|
17680
17662
|
console.error("vite-plugin-css-injected-by-js", t);
|
|
17681
17663
|
}
|
|
17682
17664
|
})();
|
|
17683
|
-
var vc = /* @__PURE__ */ ((n) => (n.Manual = "Manual", n.OnStart = "OnStart", n.OnQuit = "OnQuit", n.OnEnd = "OnEnd", n))(vc || {}),
|
|
17665
|
+
var vc = /* @__PURE__ */ ((n) => (n.Manual = "Manual", n.OnStart = "OnStart", n.OnQuit = "OnQuit", n.OnEnd = "OnEnd", n))(vc || {}), Ee = /* @__PURE__ */ ((n) => (n.Email = "Email", n.FirstName = "FirstName", n.LastName = "LastName", n.Phone = "Phone", n.Apartment = "Apartment", n.City = "City", n.Country = "Country", n.OrganizationName = "OrganizationName", n.PostCode = "PostCode", n.State = "State", n.StreetAddress = "StreetAddress", n.Custom = "Custom", n))(Ee || {}), X;
|
|
17684
17666
|
X = { __e: function(n, t, e, a) {
|
|
17685
17667
|
for (var i, r, o; t = t.__; )
|
|
17686
17668
|
if ((i = t.__c) && !i.__)
|
|
@@ -17692,12 +17674,12 @@ X = { __e: function(n, t, e, a) {
|
|
|
17692
17674
|
}
|
|
17693
17675
|
throw n;
|
|
17694
17676
|
} }, typeof Promise == "function" && Promise.prototype.then.bind(Promise.resolve());
|
|
17695
|
-
var st,
|
|
17677
|
+
var st, oa, hn, vi = [], sa = [], mn = X.__b, gn = X.__r, pn = X.diffed, fn = X.__c, Cn = X.unmount;
|
|
17696
17678
|
function Ec() {
|
|
17697
17679
|
for (var n; n = vi.shift(); )
|
|
17698
17680
|
if (n.__P && n.__H)
|
|
17699
17681
|
try {
|
|
17700
|
-
n.__H.__h.forEach(
|
|
17682
|
+
n.__H.__h.forEach(be), n.__H.__h.forEach(Sa), n.__H.__h = [];
|
|
17701
17683
|
} catch (t) {
|
|
17702
17684
|
n.__H.__h = [], X.__e(t, n.__v);
|
|
17703
17685
|
}
|
|
@@ -17707,20 +17689,20 @@ X.__b = function(n) {
|
|
|
17707
17689
|
}, X.__r = function(n) {
|
|
17708
17690
|
gn && gn(n);
|
|
17709
17691
|
var t = (st = n.__c).__H;
|
|
17710
|
-
t && (
|
|
17711
|
-
e.__N && (e.__ = e.__N), e.__V =
|
|
17712
|
-
})) : (t.__h.forEach(
|
|
17692
|
+
t && (oa === st ? (t.__h = [], st.__h = [], t.__.forEach(function(e) {
|
|
17693
|
+
e.__N && (e.__ = e.__N), e.__V = sa, e.__N = e.i = void 0;
|
|
17694
|
+
})) : (t.__h.forEach(be), t.__h.forEach(Sa), t.__h = [])), oa = st;
|
|
17713
17695
|
}, X.diffed = function(n) {
|
|
17714
17696
|
pn && pn(n);
|
|
17715
17697
|
var t = n.__c;
|
|
17716
17698
|
t && t.__H && (t.__H.__h.length && (vi.push(t) !== 1 && hn === X.requestAnimationFrame || ((hn = X.requestAnimationFrame) || bc)(Ec)), t.__H.__.forEach(function(e) {
|
|
17717
|
-
e.i && (e.__H = e.i), e.__V !==
|
|
17718
|
-
})),
|
|
17699
|
+
e.i && (e.__H = e.i), e.__V !== sa && (e.__ = e.__V), e.i = void 0, e.__V = sa;
|
|
17700
|
+
})), oa = st = null;
|
|
17719
17701
|
}, X.__c = function(n, t) {
|
|
17720
17702
|
t.some(function(e) {
|
|
17721
17703
|
try {
|
|
17722
|
-
e.__h.forEach(
|
|
17723
|
-
return !a.__ ||
|
|
17704
|
+
e.__h.forEach(be), e.__h = e.__h.filter(function(a) {
|
|
17705
|
+
return !a.__ || Sa(a);
|
|
17724
17706
|
});
|
|
17725
17707
|
} catch (a) {
|
|
17726
17708
|
t.some(function(i) {
|
|
@@ -17733,7 +17715,7 @@ X.__b = function(n) {
|
|
|
17733
17715
|
var t, e = n.__c;
|
|
17734
17716
|
e && e.__H && (e.__H.__.forEach(function(a) {
|
|
17735
17717
|
try {
|
|
17736
|
-
|
|
17718
|
+
be(a);
|
|
17737
17719
|
} catch (i) {
|
|
17738
17720
|
t = i;
|
|
17739
17721
|
}
|
|
@@ -17746,11 +17728,11 @@ function bc(n) {
|
|
|
17746
17728
|
}, a = setTimeout(e, 100);
|
|
17747
17729
|
wn && (t = requestAnimationFrame(e));
|
|
17748
17730
|
}
|
|
17749
|
-
function
|
|
17731
|
+
function be(n) {
|
|
17750
17732
|
var t = st, e = n.__c;
|
|
17751
17733
|
typeof e == "function" && (n.__c = void 0, e()), st = t;
|
|
17752
17734
|
}
|
|
17753
|
-
function
|
|
17735
|
+
function Sa(n) {
|
|
17754
17736
|
var t = st;
|
|
17755
17737
|
n.__c = n.__(), st = t;
|
|
17756
17738
|
}
|
|
@@ -17776,7 +17758,7 @@ const Ei = C`
|
|
|
17776
17758
|
}
|
|
17777
17759
|
missingComponentTypes
|
|
17778
17760
|
}
|
|
17779
|
-
`,
|
|
17761
|
+
`, Ua = C`
|
|
17780
17762
|
${Ei}
|
|
17781
17763
|
fragment AddressValidationJobFields on AddressValidationJob {
|
|
17782
17764
|
id
|
|
@@ -17789,14 +17771,14 @@ const Ei = C`
|
|
|
17789
17771
|
}
|
|
17790
17772
|
}
|
|
17791
17773
|
`, Ic = C`
|
|
17792
|
-
${
|
|
17774
|
+
${Ua}
|
|
17793
17775
|
query GetAddressValidationJobs($ids: [String!]!) {
|
|
17794
17776
|
addressValidationJobs(ids: $ids) {
|
|
17795
17777
|
...AddressValidationJobFields
|
|
17796
17778
|
}
|
|
17797
17779
|
}
|
|
17798
17780
|
`, Bc = C`
|
|
17799
|
-
${
|
|
17781
|
+
${Ua}
|
|
17800
17782
|
query GetRecipientsWithAddressValidationJobs($ids: [String!]!) {
|
|
17801
17783
|
recipients(ids: $ids) {
|
|
17802
17784
|
id
|
|
@@ -17812,14 +17794,14 @@ const Ei = C`
|
|
|
17812
17794
|
...AddressValidationResultFields
|
|
17813
17795
|
}
|
|
17814
17796
|
}
|
|
17815
|
-
`,
|
|
17816
|
-
${
|
|
17797
|
+
`, Dc = C`
|
|
17798
|
+
${Ua}
|
|
17817
17799
|
mutation BatchValidateRecipientAddress($ids: [String!]!) {
|
|
17818
17800
|
recipientValidateBatch(ids: $ids) {
|
|
17819
17801
|
...AddressValidationJobFields
|
|
17820
17802
|
}
|
|
17821
17803
|
}
|
|
17822
|
-
`,
|
|
17804
|
+
`, Fc = C`
|
|
17823
17805
|
mutation OverrideRecipientAddress($id: String!) {
|
|
17824
17806
|
recipientOverrideAddress(id: $id) {
|
|
17825
17807
|
id
|
|
@@ -17857,7 +17839,7 @@ const aA = async (n) => {
|
|
|
17857
17839
|
}
|
|
17858
17840
|
})).data?.recipientValidate : void 0, rA = async (n) => {
|
|
17859
17841
|
const t = n.map((a) => a.getTransaction().recipient?.id).filter((a) => !!a), e = await y.getShadowGraphqlClient().mutate({
|
|
17860
|
-
mutation:
|
|
17842
|
+
mutation: Dc,
|
|
17861
17843
|
errorPolicy: "all",
|
|
17862
17844
|
fetchPolicy: "network-only",
|
|
17863
17845
|
variables: {
|
|
@@ -17874,7 +17856,7 @@ const aA = async (n) => {
|
|
|
17874
17856
|
if (!t)
|
|
17875
17857
|
return;
|
|
17876
17858
|
(await y.getShadowGraphqlClient().mutate({
|
|
17877
|
-
mutation:
|
|
17859
|
+
mutation: Fc,
|
|
17878
17860
|
errorPolicy: "all",
|
|
17879
17861
|
fetchPolicy: "network-only",
|
|
17880
17862
|
variables: {
|
|
@@ -17898,23 +17880,23 @@ const aA = async (n) => {
|
|
|
17898
17880
|
}
|
|
17899
17881
|
})).data.integrationProducts;
|
|
17900
17882
|
export {
|
|
17901
|
-
|
|
17883
|
+
Ea as AddonHandle,
|
|
17902
17884
|
kc as AddressValidationJobStatus,
|
|
17903
17885
|
xc as AddressValidationResultConfirmationLevel,
|
|
17904
17886
|
bn as AddressValidationStatus,
|
|
17905
17887
|
Od as ArrayInput,
|
|
17906
17888
|
G as AspectType,
|
|
17907
17889
|
Bt as AssetNotFoundError,
|
|
17908
|
-
|
|
17890
|
+
Ie as AssetType,
|
|
17909
17891
|
xd as BringForwardCommand,
|
|
17910
|
-
|
|
17911
|
-
|
|
17892
|
+
Fd as BringToBackCommand,
|
|
17893
|
+
Dd as BringToFrontCommand,
|
|
17912
17894
|
Gi as BundleDesignCreationCartAddMode,
|
|
17913
17895
|
O as CanvasCommand,
|
|
17914
|
-
|
|
17915
|
-
|
|
17896
|
+
pe as CollectionProduct,
|
|
17897
|
+
cn as ColorOptionGlobalPropertyHandle,
|
|
17916
17898
|
ko as CommandContext,
|
|
17917
|
-
|
|
17899
|
+
Ee as ConversionDataType,
|
|
17918
17900
|
vc as ConversionLocation,
|
|
17919
17901
|
H as CreateElementCommand,
|
|
17920
17902
|
ni as CreateLayoutCommand,
|
|
@@ -17922,18 +17904,18 @@ export {
|
|
|
17922
17904
|
nc as CurrencyService,
|
|
17923
17905
|
Rt as DeleteElementCommand,
|
|
17924
17906
|
ul as DigitalContentStepHandle,
|
|
17925
|
-
|
|
17926
|
-
|
|
17907
|
+
Fl as FileUploadGlobalPropertyHandle,
|
|
17908
|
+
fe as FlowExecutionNodeResult,
|
|
17927
17909
|
Kl as FlowExecutionResult,
|
|
17928
17910
|
Jl as FlowService,
|
|
17929
17911
|
Qo as FontAlignmentCommand,
|
|
17930
17912
|
To as FontColorCommand,
|
|
17931
17913
|
No as FontSizeCommand,
|
|
17932
|
-
|
|
17914
|
+
en as FontSourceCommand,
|
|
17933
17915
|
Ac as FrameService,
|
|
17934
17916
|
uc as FrameStep,
|
|
17935
17917
|
hc as FrameStepHandle,
|
|
17936
|
-
|
|
17918
|
+
Ra as GlobalPropertyHandle,
|
|
17937
17919
|
L as GroupCommand,
|
|
17938
17920
|
il as IllustrationStepHandle,
|
|
17939
17921
|
qe as InformationMessageType,
|
|
@@ -17941,11 +17923,11 @@ export {
|
|
|
17941
17923
|
An as IntegrationProduct,
|
|
17942
17924
|
qi as IntegrationType,
|
|
17943
17925
|
Ed as LayoutElementFactory,
|
|
17944
|
-
|
|
17926
|
+
F as LayoutElementType,
|
|
17945
17927
|
K as LayoutNotFoundError,
|
|
17946
17928
|
Kt as LayoutRenderingPurpose,
|
|
17947
17929
|
rl as MaterialStepHandle,
|
|
17948
|
-
|
|
17930
|
+
De as MisconfigurationError,
|
|
17949
17931
|
Wd as MockWorkflowManager,
|
|
17950
17932
|
ol as ModelStepHandle,
|
|
17951
17933
|
hl as ModuleStepHandle,
|
|
@@ -17953,8 +17935,8 @@ export {
|
|
|
17953
17935
|
wi as ObjectInput,
|
|
17954
17936
|
_l as ObjectInputType,
|
|
17955
17937
|
pi as OptionGlobalPropertyHandle,
|
|
17956
|
-
|
|
17957
|
-
|
|
17938
|
+
Pe as OptionNotFoundError,
|
|
17939
|
+
Ft as ParseError,
|
|
17958
17940
|
sl as PictureStepHandle,
|
|
17959
17941
|
Hi as ProductCameraRig,
|
|
17960
17942
|
Ci as ProductCollection,
|
|
@@ -17972,10 +17954,10 @@ export {
|
|
|
17972
17954
|
cl as ShapeStepHandle,
|
|
17973
17955
|
Wi as ShareActionType,
|
|
17974
17956
|
$d as SpiffCommerceClient,
|
|
17975
|
-
|
|
17957
|
+
Be as StakeholderType,
|
|
17976
17958
|
zi as StepAspectType,
|
|
17977
17959
|
et as StepHandle,
|
|
17978
|
-
|
|
17960
|
+
v as StepType,
|
|
17979
17961
|
Tt as TextAlgorithm,
|
|
17980
17962
|
$o as TextChangeCommand,
|
|
17981
17963
|
xl as TextGlobalPropertyHandle,
|
|
@@ -17987,7 +17969,7 @@ export {
|
|
|
17987
17969
|
ji as UnitOfMeasurement,
|
|
17988
17970
|
Pd as UpdateImageSourceCommand,
|
|
17989
17971
|
ot as Variant,
|
|
17990
|
-
|
|
17972
|
+
wa as WorkflowExperienceEventType,
|
|
17991
17973
|
Il as WorkflowExperienceImpl,
|
|
17992
17974
|
V as assetService,
|
|
17993
17975
|
wr as browserColorToHex,
|
|
@@ -17997,7 +17979,7 @@ export {
|
|
|
17997
17979
|
od as dataUrlFromExternalUrl,
|
|
17998
17980
|
Gd as deleteBundle,
|
|
17999
17981
|
ra as designService,
|
|
18000
|
-
|
|
17982
|
+
ve as determineCorrectFontSizeAndLines,
|
|
18001
17983
|
ri as digitalContentStepService,
|
|
18002
17984
|
At as domParser,
|
|
18003
17985
|
jd as duplicateBundle,
|
|
@@ -18013,14 +17995,14 @@ export {
|
|
|
18013
17995
|
lt as generateSVGWithUnknownColors,
|
|
18014
17996
|
Td as generateStateFromDesignInputSteps,
|
|
18015
17997
|
nA as getAddressValidationJobs,
|
|
18016
|
-
|
|
17998
|
+
Ue as getAttributesFromArrayBuffer,
|
|
18017
17999
|
dd as getAxisAlignedBoundingBox,
|
|
18018
18000
|
dc as getBoundedOffsets,
|
|
18019
18001
|
Vd as getBundleThemeConfiguration,
|
|
18020
18002
|
Jd as getCustomer,
|
|
18021
18003
|
Kd as getCustomerBundles,
|
|
18022
18004
|
wd as getElementVertices,
|
|
18023
|
-
|
|
18005
|
+
ze as getFrameData,
|
|
18024
18006
|
Nd as getGlobalPropertyStateForBundle,
|
|
18025
18007
|
cc as getIntegration,
|
|
18026
18008
|
sA as getIntegrationProducts,
|
|
@@ -18031,7 +18013,7 @@ export {
|
|
|
18031
18013
|
md as getPointOfRotation,
|
|
18032
18014
|
Qd as getProductCollections,
|
|
18033
18015
|
fd as getSEPoint,
|
|
18034
|
-
|
|
18016
|
+
ka as getSvgElement,
|
|
18035
18017
|
eA as getTemplateBundles,
|
|
18036
18018
|
tA as getTemplateTransactions,
|
|
18037
18019
|
Ud as getTransaction,
|
|
@@ -18043,7 +18025,7 @@ export {
|
|
|
18043
18025
|
sc as getWorkflow,
|
|
18044
18026
|
yi as getWorkflows,
|
|
18045
18027
|
y as graphQlManager,
|
|
18046
|
-
|
|
18028
|
+
Se as illustrationStepService,
|
|
18047
18029
|
ud as isCloseToValue,
|
|
18048
18030
|
Qt as loadFont,
|
|
18049
18031
|
ld as matchHexToPms,
|
|
@@ -18051,7 +18033,7 @@ export {
|
|
|
18051
18033
|
Ul as metafieldManager,
|
|
18052
18034
|
yd as mmPerPixel,
|
|
18053
18035
|
si as modelStepService,
|
|
18054
|
-
|
|
18036
|
+
Fa as modifySVGColors,
|
|
18055
18037
|
li as moduleStepService,
|
|
18056
18038
|
qd as nameBundle,
|
|
18057
18039
|
Hd as nameTransaction,
|
|
@@ -18065,19 +18047,19 @@ export {
|
|
|
18065
18047
|
di as questionStepService,
|
|
18066
18048
|
rd as registerFetchImplementation,
|
|
18067
18049
|
id as registerWindowImplementation,
|
|
18068
|
-
|
|
18050
|
+
Za as rehydrateSerializedLayout,
|
|
18069
18051
|
pr as rgbToPms,
|
|
18070
|
-
|
|
18071
|
-
|
|
18052
|
+
he as rotateAroundPoint,
|
|
18053
|
+
Pa as sanitizeSvgTree,
|
|
18072
18054
|
sr as setBearerAuthenticationToken,
|
|
18073
18055
|
kn as setCanvasModule,
|
|
18074
18056
|
Wt as shapeStepService,
|
|
18075
18057
|
Lo as shortenUrl,
|
|
18076
18058
|
ft as spiffCoreConfiguration,
|
|
18077
18059
|
Md as stepAspectValuesToDesignInputSteps,
|
|
18078
|
-
|
|
18060
|
+
Ya as svgColorValueToDefinition,
|
|
18079
18061
|
ei as svgStringDimensions,
|
|
18080
|
-
|
|
18062
|
+
ba as svgToDataUrl,
|
|
18081
18063
|
j as textStepService,
|
|
18082
18064
|
Ko as toast,
|
|
18083
18065
|
iA as validateWorkflowExperienceRecipient,
|