@spiffcommerce/core 39.2.2 → 39.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +36 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +123 -119
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createHttpLink as Di, ApolloClient as ki, InMemoryCache as Mi, from as Ti, gql as C } from "@apollo/client/core";
|
|
2
2
|
import { setContext as Ni } from "@apollo/client/link/context";
|
|
3
3
|
import { onError as Qi } from "@apollo/client/link/error";
|
|
4
|
-
import { renderToStaticMarkup as
|
|
5
|
-
import { removeTypenameFromVariables as
|
|
4
|
+
import { renderToStaticMarkup as Oi } from "preact-render-to-string";
|
|
5
|
+
import { removeTypenameFromVariables as Ri } from "@apollo/client/link/remove-typename";
|
|
6
6
|
import { orientation as $i } from "exifr/dist/mini.umd.cjs";
|
|
7
7
|
import { parse as En } from "css";
|
|
8
8
|
import Ui from "fuse.js";
|
|
@@ -25,7 +25,7 @@ import Hi from "svg-path-bbox";
|
|
|
25
25
|
import "fs";
|
|
26
26
|
import "path";
|
|
27
27
|
import ji from "lodash.omit";
|
|
28
|
-
var Ie = /* @__PURE__ */ ((i) => (i.Data = "Data", i.Font = "Font", i.Frame = "Frame", i.Illustration = "Illustration", i.Image = "Image", i.Model = "Model", i.Material = "Material", i.Color = "Color", i.QuestionnaireCollateral = "QuestionnaireCollateral", i.RequestCollateral = "RequestCollateral", i.SignupCollateral = "SignupCollateral", i.Video = "Video", i.ColorProfile = "ColorProfile", i.Environment = "Environment", i))(Ie || {}), Bn = /* @__PURE__ */ ((i) => (i.AND = "AND", i.OR = "OR", i))(Bn || {}), z = /* @__PURE__ */ ((i) => (i.FileUpload = "FileUpload", i.Option = "Option", i.ColorOption = "ColorOption", i.Text = "Text", i))(z || {}), E = /* @__PURE__ */ ((i) => (i.Information = "Information", i.Bulk = "Bulk", i.DigitalContent = "DigitalContent", i.Finish = "Finish", i.Frame = "Frame", i.Illustration = "Illustration", i.Introduction = "Introduction", i.Material = "Material", i.Model = "Model", i.Module = "Module", i.Picture = "Picture", i.Photo = "Photo", i.ProductOverlay = "ProductOverlay", i.Question = "Question", i.Shape = "Shape", i.SilentIllustration = "SilentIllustration", i.Text = "Text", i))(E || {}), Yi = /* @__PURE__ */ ((i) => (i.Color = "Color", i.Colors = "Colors", i.Selection = "Selection", i.Selections = "Selections", i.Text = "Text", i.Upload = "Upload", i))(Yi || {}), _t = /* @__PURE__ */ ((i) => (i.ThreeD = "ThreeD", i.FreeDesign = "FreeDesign", i.Print = "Print", i))(_t || {}), D = /* @__PURE__ */ ((i) => (i.Frame = "frame", i.Group = "group", i.Image = "image", i.Pattern = "pattern", i.Illustration = "illustration", i.Textbox = "textbox", i))(D || {}), Ji = /* @__PURE__ */ ((i) => (i.Default = "Default", i.FirstTransaction = "FirstTransaction", i.OneToOne = "OneToOne", i))(Ji || {}), Pn = /* @__PURE__ */ ((i) => (i.Pending = "Pending", i.Failed = "Failed", i.Validated = "Validated", i.Overridden = "Overridden", i))(Pn || {}), Ki = /* @__PURE__ */ ((i) => (i.Hyperlink = "Hyperlink", i.Edit = "Edit", i.Approve = "Approve", i))(Ki || {}), _i = /* @__PURE__ */ ((i) => (i.Hub = "Hub", i.Shopify = "Shopify", i))(_i || {}), Ba = /* @__PURE__ */ ((i) => (i.
|
|
28
|
+
var Ie = /* @__PURE__ */ ((i) => (i.Data = "Data", i.Font = "Font", i.Frame = "Frame", i.Illustration = "Illustration", i.Image = "Image", i.Model = "Model", i.Material = "Material", i.Color = "Color", i.QuestionnaireCollateral = "QuestionnaireCollateral", i.RequestCollateral = "RequestCollateral", i.SignupCollateral = "SignupCollateral", i.Video = "Video", i.ColorProfile = "ColorProfile", i.Environment = "Environment", i))(Ie || {}), Bn = /* @__PURE__ */ ((i) => (i.AND = "AND", i.OR = "OR", i))(Bn || {}), z = /* @__PURE__ */ ((i) => (i.FileUpload = "FileUpload", i.Option = "Option", i.ColorOption = "ColorOption", i.Text = "Text", i))(z || {}), E = /* @__PURE__ */ ((i) => (i.Information = "Information", i.Bulk = "Bulk", i.DigitalContent = "DigitalContent", i.Finish = "Finish", i.Frame = "Frame", i.Illustration = "Illustration", i.Introduction = "Introduction", i.Material = "Material", i.Model = "Model", i.Module = "Module", i.Picture = "Picture", i.Photo = "Photo", i.ProductOverlay = "ProductOverlay", i.Question = "Question", i.Shape = "Shape", i.SilentIllustration = "SilentIllustration", i.Text = "Text", i))(E || {}), Yi = /* @__PURE__ */ ((i) => (i.Color = "Color", i.Colors = "Colors", i.Selection = "Selection", i.Selections = "Selections", i.Text = "Text", i.Upload = "Upload", i))(Yi || {}), _t = /* @__PURE__ */ ((i) => (i.ThreeD = "ThreeD", i.FreeDesign = "FreeDesign", i.Print = "Print", i))(_t || {}), D = /* @__PURE__ */ ((i) => (i.Frame = "frame", i.Group = "group", i.Image = "image", i.Pattern = "pattern", i.Illustration = "illustration", i.Textbox = "textbox", i))(D || {}), Ji = /* @__PURE__ */ ((i) => (i.Default = "Default", i.FirstTransaction = "FirstTransaction", i.OneToOne = "OneToOne", i))(Ji || {}), Pn = /* @__PURE__ */ ((i) => (i.Pending = "Pending", i.Failed = "Failed", i.Validated = "Validated", i.Overridden = "Overridden", i))(Pn || {}), Ki = /* @__PURE__ */ ((i) => (i.Hyperlink = "Hyperlink", i.Edit = "Edit", i.Approve = "Approve", i))(Ki || {}), _i = /* @__PURE__ */ ((i) => (i.Hub = "Hub", i.Shopify = "Shopify", i))(_i || {}), Ba = /* @__PURE__ */ ((i) => (i.AdvancedImageManipulation = "BackgroundRemover", i.ConversionAccelerator = "Conversion Accelerator", i.ProcessBuilder = "ProcessBuilder", i))(Ba || {}), Xi = /* @__PURE__ */ ((i) => (i[i.Orbit = 0] = "Orbit", i[i.Pan = 1] = "Pan", i))(Xi || {}), Fn = /* @__PURE__ */ ((i) => (i.Owner = "Owner", i.Approver = "Approver", i.Editor = "Editor", i.Viewer = "Viewer", i))(Fn || {}), Tt = /* @__PURE__ */ ((i) => (i.Autosize = "Autosize", i.Traditional = "Traditional", i))(Tt || {}), Y = /* @__PURE__ */ ((i) => (i[i.North = 0] = "North", i[i.Northeast = 1] = "Northeast", i[i.East = 2] = "East", i[i.Southeast = 3] = "Southeast", i[i.South = 4] = "South", i[i.Southwest = 5] = "Southwest", i[i.West = 6] = "West", i[i.Northwest = 7] = "Northwest", i))(Y || {}), Zi = /* @__PURE__ */ ((i) => (i.Pixel = "px", i.Millimeter = "mm", i.Centimeter = "cm", i))(Zi || {});
|
|
29
29
|
class xn extends Error {
|
|
30
30
|
constructor(t) {
|
|
31
31
|
super(t), this.name = this.constructor.name;
|
|
@@ -66,7 +66,7 @@ class Qe extends xn {
|
|
|
66
66
|
super(`ImplementationError - ${t}`);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
class
|
|
69
|
+
class O extends Qe {
|
|
70
70
|
constructor(t) {
|
|
71
71
|
super(`Unhandled Behavior Encountered: ${t}`);
|
|
72
72
|
}
|
|
@@ -81,7 +81,7 @@ class pt extends Qe {
|
|
|
81
81
|
super(`Client Error: ${t}`);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
class
|
|
84
|
+
class Oe extends Qe {
|
|
85
85
|
constructor(t) {
|
|
86
86
|
super(`Resource Generation Failed: ${t}`);
|
|
87
87
|
}
|
|
@@ -208,7 +208,7 @@ const Dn = /* @__PURE__ */ new Map(), Wa = /* @__PURE__ */ new Map(), Ha = /* @_
|
|
|
208
208
|
return new DOMParser();
|
|
209
209
|
const i = ae();
|
|
210
210
|
return new i.DOMParser();
|
|
211
|
-
}, rr = () => Nt([typeof DOMParser]) ? DOMParser : ae().DOMParser,
|
|
211
|
+
}, rr = () => Nt([typeof DOMParser]) ? DOMParser : ae().DOMParser, Re = (i, t) => new Promise((e, a) => {
|
|
212
212
|
t ? kn(i).then(e).catch(a) : nt(i).then((n) => {
|
|
213
213
|
n.arrayBuffer().then(e).catch(a);
|
|
214
214
|
}).catch((n) => {
|
|
@@ -218,7 +218,7 @@ const Dn = /* @__PURE__ */ new Map(), Wa = /* @__PURE__ */ new Map(), Ha = /* @_
|
|
|
218
218
|
t ? nr(i).then(e).catch(a) : nt(i).then((n) => {
|
|
219
219
|
n.text().then(e).catch(a);
|
|
220
220
|
}).catch(a);
|
|
221
|
-
}), Mn = (i) =>
|
|
221
|
+
}), Mn = (i) => Oi(i), je = /* @__PURE__ */ new Map(), or = async (i, t) => {
|
|
222
222
|
if (Nt([typeof FontFace])) {
|
|
223
223
|
if (je.has(t))
|
|
224
224
|
return je.get(t);
|
|
@@ -362,7 +362,7 @@ class fr {
|
|
|
362
362
|
}), a = Qi(({ operation: r, graphQLErrors: o, networkError: s }) => {
|
|
363
363
|
const l = o || [], c = r.getContext();
|
|
364
364
|
s && !c?.fetchOptions?.signal?.aborted && console.log("GraphQL Network error"), l.forEach(() => console.log("GraphQL Error: " + r.operationName));
|
|
365
|
-
}), n =
|
|
365
|
+
}), n = Ri();
|
|
366
366
|
return new ki({
|
|
367
367
|
link: Ti([n, a, e, t]),
|
|
368
368
|
cache: new Mi(),
|
|
@@ -376,7 +376,7 @@ const yt = (i, t, e) => {
|
|
|
376
376
|
if (ga !== void 0)
|
|
377
377
|
return ga(i, t, e);
|
|
378
378
|
try {
|
|
379
|
-
const a =
|
|
379
|
+
const a = On(!0);
|
|
380
380
|
return Qn(a), a.createCanvas(i, t, e);
|
|
381
381
|
} catch {
|
|
382
382
|
throw new Error("Canvas module not set");
|
|
@@ -385,7 +385,7 @@ const yt = (i, t, e) => {
|
|
|
385
385
|
if (ma !== void 0)
|
|
386
386
|
return ma(i, t);
|
|
387
387
|
try {
|
|
388
|
-
const e =
|
|
388
|
+
const e = On(!0);
|
|
389
389
|
return Qn(e), e.loadImage(i, t);
|
|
390
390
|
} catch {
|
|
391
391
|
throw new Error("Canvas module not set");
|
|
@@ -394,7 +394,7 @@ const yt = (i, t, e) => {
|
|
|
394
394
|
function Qn(i) {
|
|
395
395
|
ga = i?.createCanvas, ma = i?.loadImage;
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function On(i) {
|
|
398
398
|
try {
|
|
399
399
|
if (document.createElement("canvas").getContext("2d"))
|
|
400
400
|
return {
|
|
@@ -3191,16 +3191,16 @@ const Er = Zt.map((i, t) => ({ pms: i, hex: kt[t] })), br = new Ui(Er, { keys: [
|
|
|
3191
3191
|
function pd(i, t) {
|
|
3192
3192
|
return br.search(i, t ? { limit: t } : void 0);
|
|
3193
3193
|
}
|
|
3194
|
-
let
|
|
3194
|
+
let Rt = null;
|
|
3195
3195
|
function Ir(i) {
|
|
3196
3196
|
if (i.startsWith("#"))
|
|
3197
3197
|
return Ya(i);
|
|
3198
3198
|
if (!document)
|
|
3199
3199
|
throw new Error("browserColorToHex is only supported on browsers");
|
|
3200
|
-
if (
|
|
3200
|
+
if (Rt || (Rt = document.createElement("canvas").getContext("2d")), !Rt)
|
|
3201
3201
|
throw new Error("Failed to create canvas context required to convert colors");
|
|
3202
|
-
|
|
3203
|
-
const t = Ya(
|
|
3202
|
+
Rt.fillStyle = i;
|
|
3203
|
+
const t = Ya(Rt.fillStyle);
|
|
3204
3204
|
return t || console.error(`Unknown browser color ${i}`), t;
|
|
3205
3205
|
}
|
|
3206
3206
|
function Ya(i) {
|
|
@@ -3208,9 +3208,9 @@ function Ya(i) {
|
|
|
3208
3208
|
return t.length === 6 ? t : t.length === 3 ? `${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}` : "";
|
|
3209
3209
|
}
|
|
3210
3210
|
const ue = (i) => {
|
|
3211
|
-
const t =
|
|
3211
|
+
const t = Rn(i.spotColor);
|
|
3212
3212
|
return t ? `${i.browserValue} ${t}` : i.browserValue;
|
|
3213
|
-
},
|
|
3213
|
+
}, Rn = (i) => {
|
|
3214
3214
|
if (!i)
|
|
3215
3215
|
return "";
|
|
3216
3216
|
if (i.profileName.includes("/") && i.profileName.includes(".icc")) {
|
|
@@ -3520,14 +3520,14 @@ const ue = (i) => {
|
|
|
3520
3520
|
}
|
|
3521
3521
|
}
|
|
3522
3522
|
}
|
|
3523
|
-
`,
|
|
3523
|
+
`, Or = C`
|
|
3524
3524
|
${ie(!1)}
|
|
3525
3525
|
mutation RemoveBackgroundFromAsset($key: String!) {
|
|
3526
3526
|
assetRemoveBackground(key: $key) {
|
|
3527
3527
|
...AssetFields
|
|
3528
3528
|
}
|
|
3529
3529
|
}
|
|
3530
|
-
`,
|
|
3530
|
+
`, Rr = C`
|
|
3531
3531
|
${ie(!1)}
|
|
3532
3532
|
mutation VectorizeAsset($key: String!, $options: AssetVectorizeOptions) {
|
|
3533
3533
|
assetVectorize(key: $key, options: $options) {
|
|
@@ -3580,7 +3580,7 @@ class Vr {
|
|
|
3580
3580
|
async getLocalOrFromServer(t) {
|
|
3581
3581
|
if (this.cache.has(t)) {
|
|
3582
3582
|
const n = this.cache.get(t);
|
|
3583
|
-
if (!n) throw new
|
|
3583
|
+
if (!n) throw new O("Failed to get asset from cache!");
|
|
3584
3584
|
return n;
|
|
3585
3585
|
}
|
|
3586
3586
|
const a = (async () => (await Pe([t]))[0])();
|
|
@@ -3606,14 +3606,14 @@ class Vr {
|
|
|
3606
3606
|
* Caches an asset if it doesn't already exist.
|
|
3607
3607
|
*/
|
|
3608
3608
|
cacheAsset(t) {
|
|
3609
|
-
if (!t.key) throw new
|
|
3609
|
+
if (!t.key) throw new O("Asset has no key!");
|
|
3610
3610
|
this.cache.has(t.key) || this.cache.set(t.key, Promise.resolve(t));
|
|
3611
3611
|
}
|
|
3612
3612
|
/**
|
|
3613
3613
|
* Caches a material if it doesn't already exist.
|
|
3614
3614
|
*/
|
|
3615
3615
|
cacheMaterial(t) {
|
|
3616
|
-
if (!t.id) throw new
|
|
3616
|
+
if (!t.id) throw new O("Material has no id!");
|
|
3617
3617
|
this.materialCache.has(t.id) || this.materialCache.set(t.id, Promise.resolve(t));
|
|
3618
3618
|
}
|
|
3619
3619
|
/**
|
|
@@ -3664,7 +3664,7 @@ class Vr {
|
|
|
3664
3664
|
}
|
|
3665
3665
|
const n = (async () => {
|
|
3666
3666
|
const r = await S.getShadowGraphqlClient().mutate({
|
|
3667
|
-
mutation:
|
|
3667
|
+
mutation: Or,
|
|
3668
3668
|
fetchPolicy: "no-cache",
|
|
3669
3669
|
errorPolicy: "all",
|
|
3670
3670
|
variables: {
|
|
@@ -3696,7 +3696,7 @@ class Vr {
|
|
|
3696
3696
|
}
|
|
3697
3697
|
const r = (async () => {
|
|
3698
3698
|
const o = await S.getShadowGraphqlClient().mutate({
|
|
3699
|
-
mutation:
|
|
3699
|
+
mutation: Rr,
|
|
3700
3700
|
fetchPolicy: "no-cache",
|
|
3701
3701
|
errorPolicy: "all",
|
|
3702
3702
|
variables: {
|
|
@@ -3770,7 +3770,7 @@ class Vr {
|
|
|
3770
3770
|
case "mkv":
|
|
3771
3771
|
return "video/x-matroska";
|
|
3772
3772
|
default:
|
|
3773
|
-
throw new
|
|
3773
|
+
throw new O("Unexpected mimetype: " + e);
|
|
3774
3774
|
}
|
|
3775
3775
|
}
|
|
3776
3776
|
}
|
|
@@ -5712,7 +5712,7 @@ const Bo = (i) => i.substring(0, 5).toLowerCase().trim() === "data:", Xe = /* @_
|
|
|
5712
5712
|
const a = Tn(i), n = da(a);
|
|
5713
5713
|
return pa(i, n), n;
|
|
5714
5714
|
} else {
|
|
5715
|
-
const a = await
|
|
5715
|
+
const a = await Re(i, !0), n = da(a);
|
|
5716
5716
|
return pa(i, n), await or(n, i), n;
|
|
5717
5717
|
}
|
|
5718
5718
|
}
|
|
@@ -5759,7 +5759,7 @@ const Bo = (i) => i.substring(0, 5).toLowerCase().trim() === "data:", Xe = /* @_
|
|
|
5759
5759
|
parseInt(A.getAttribute("font-size") ?? "72")
|
|
5760
5760
|
);
|
|
5761
5761
|
M.fill = f, M.stroke = y, M.strokeWidth = parseFloat(w ?? "0");
|
|
5762
|
-
const
|
|
5762
|
+
const R = M.toSVG(2), T = t.parseFromString(R, "image/svg+xml").firstElementChild;
|
|
5763
5763
|
h.appendChild(T);
|
|
5764
5764
|
}
|
|
5765
5765
|
return e.querySelectorAll("text").forEach((d) => d.remove()), Pt().serializeToString(a);
|
|
@@ -5911,7 +5911,7 @@ const No = (i) => {
|
|
|
5911
5911
|
`), u = i.strokeColor?.browserValue && i.strokeThickness ? i.strokeColor?.browserValue : void 0, A = i.strokeColor?.browserValue && i.strokeThickness ? i.strokeThickness : void 0;
|
|
5912
5912
|
if (i.curved && !i.paths || !i.fontData)
|
|
5913
5913
|
return null;
|
|
5914
|
-
const h = () => i.textFillImage ? `url("#${o}")` : i._renderingConfiguration?.spotColors && i.fillSpotColorDefinition ? `${i.fill} ${
|
|
5914
|
+
const h = () => i.textFillImage ? `url("#${o}")` : i._renderingConfiguration?.spotColors && i.fillSpotColorDefinition ? `${i.fill} ${Rn(i.fillSpotColorDefinition)}` : i.fill;
|
|
5915
5915
|
return /* @__PURE__ */ ut(Ht, { children: [
|
|
5916
5916
|
/* @__PURE__ */ ut("defs", { children: [
|
|
5917
5917
|
i.textFillImage && /* @__PURE__ */ F(
|
|
@@ -5966,7 +5966,7 @@ const No = (i) => {
|
|
|
5966
5966
|
},
|
|
5967
5967
|
stroke: u,
|
|
5968
5968
|
strokeWidth: A,
|
|
5969
|
-
children: i.curved ? /* @__PURE__ */ F(
|
|
5969
|
+
children: i.curved ? /* @__PURE__ */ F(Oo, { text: c, curvedPathId: r, align: i.align }) : d.map((g, p) => /* @__PURE__ */ F(
|
|
5970
5970
|
Qo,
|
|
5971
5971
|
{
|
|
5972
5972
|
align: i.vertical ? "center" : i.align,
|
|
@@ -6004,7 +6004,7 @@ const No = (i) => {
|
|
|
6004
6004
|
return (i.thisLineIdx - o) * n + i.fontSize / 4;
|
|
6005
6005
|
};
|
|
6006
6006
|
return /* @__PURE__ */ F("tspan", { textAnchor: ei(i.align), x: e(), y: `${a()}px`, children: i.text });
|
|
6007
|
-
},
|
|
6007
|
+
}, Oo = (i) => {
|
|
6008
6008
|
const t = `#${i.curvedPathId}`;
|
|
6009
6009
|
return /* @__PURE__ */ F(
|
|
6010
6010
|
"textPath",
|
|
@@ -6016,7 +6016,7 @@ const No = (i) => {
|
|
|
6016
6016
|
children: i.text
|
|
6017
6017
|
}
|
|
6018
6018
|
);
|
|
6019
|
-
},
|
|
6019
|
+
}, Ro = (i) => {
|
|
6020
6020
|
if (i.cachedObjectURL && !i._renderingConfiguration?.omitCachedFields)
|
|
6021
6021
|
return /* @__PURE__ */ F(
|
|
6022
6022
|
_n,
|
|
@@ -6149,7 +6149,7 @@ class $o {
|
|
|
6149
6149
|
return { ...t, transaction: e.apply(a) };
|
|
6150
6150
|
}
|
|
6151
6151
|
}
|
|
6152
|
-
const ii = (i) => i.type === D.Image ? /* @__PURE__ */ F(_n, { ...i }, i.id) : i.type === D.Frame ? /* @__PURE__ */ F(bo, { ...i }, i.id) : i.type === D.Illustration ? /* @__PURE__ */ F(
|
|
6152
|
+
const ii = (i) => i.type === D.Image ? /* @__PURE__ */ F(_n, { ...i }, i.id) : i.type === D.Frame ? /* @__PURE__ */ F(bo, { ...i }, i.id) : i.type === D.Illustration ? /* @__PURE__ */ F(Ro, { ...i }, i.id) : i.type === D.Textbox ? /* @__PURE__ */ F(No, { ...i }, i.id) : i.type === D.Group ? /* @__PURE__ */ F(Xn, { ...i }, i.id) : null, Ta = (i, t, e) => {
|
|
6153
6153
|
const a = e.renderingConfiguration, n = a?.removeExcludedElements ? t.filter((r) => !r.excludeFromExport) : t;
|
|
6154
6154
|
return /* @__PURE__ */ F(
|
|
6155
6155
|
Eo,
|
|
@@ -6272,7 +6272,7 @@ const mt = /* @__PURE__ */ new Map(), qt = /* @__PURE__ */ new Map(), ta = /* @_
|
|
|
6272
6272
|
return mt.set(i, r), r;
|
|
6273
6273
|
}
|
|
6274
6274
|
if ((i.split(".").pop()?.toLowerCase() ?? "") === "svg") {
|
|
6275
|
-
const e = await
|
|
6275
|
+
const e = await Oa(i), a = e.width, n = e.height, r = {
|
|
6276
6276
|
src: i,
|
|
6277
6277
|
width: a,
|
|
6278
6278
|
height: n,
|
|
@@ -6280,7 +6280,7 @@ const mt = /* @__PURE__ */ new Map(), qt = /* @__PURE__ */ new Map(), ta = /* @_
|
|
|
6280
6280
|
};
|
|
6281
6281
|
return mt.set(i, r), r;
|
|
6282
6282
|
} else {
|
|
6283
|
-
const e = await
|
|
6283
|
+
const e = await Re(i, !0), a = await Ue(e), n = {
|
|
6284
6284
|
src: i,
|
|
6285
6285
|
width: a.width,
|
|
6286
6286
|
height: a.height,
|
|
@@ -6288,7 +6288,7 @@ const mt = /* @__PURE__ */ new Map(), qt = /* @__PURE__ */ new Map(), ta = /* @_
|
|
|
6288
6288
|
};
|
|
6289
6289
|
return mt.set(i, n), n;
|
|
6290
6290
|
}
|
|
6291
|
-
},
|
|
6291
|
+
}, Oa = async (i) => {
|
|
6292
6292
|
const t = await at(i);
|
|
6293
6293
|
return oi(t);
|
|
6294
6294
|
}, en = (i) => i.endsWith("mm") ? Number(i.replace("mm", "")) * 3.7795275591 : i.endsWith("px") ? Number(i.replace("px", "")) : Number(i), oi = (i) => {
|
|
@@ -6364,7 +6364,7 @@ const mt = /* @__PURE__ */ new Map(), qt = /* @__PURE__ */ new Map(), ta = /* @_
|
|
|
6364
6364
|
s.height = s.width / f, s.top += (h - s.height) / 2;
|
|
6365
6365
|
}
|
|
6366
6366
|
if (e && t === D.Image) {
|
|
6367
|
-
const l = s.height, c = await
|
|
6367
|
+
const l = s.height, c = await Re(e), d = await Ue(c), u = d.width / d.height;
|
|
6368
6368
|
s.height = s.width / u, s.top += (l - s.height) / 2;
|
|
6369
6369
|
}
|
|
6370
6370
|
if (e && t === D.Textbox && a?.text && a?.fontScale) {
|
|
@@ -6780,7 +6780,7 @@ class H extends $ {
|
|
|
6780
6780
|
return a !== void 0 ? a + 1 : 0;
|
|
6781
6781
|
}
|
|
6782
6782
|
}
|
|
6783
|
-
class
|
|
6783
|
+
class Ot extends $ {
|
|
6784
6784
|
constructor(t) {
|
|
6785
6785
|
super(), this.id = t;
|
|
6786
6786
|
}
|
|
@@ -7123,7 +7123,7 @@ class Qd extends $ {
|
|
|
7123
7123
|
};
|
|
7124
7124
|
}
|
|
7125
7125
|
}
|
|
7126
|
-
class
|
|
7126
|
+
class Od extends $ {
|
|
7127
7127
|
/**
|
|
7128
7128
|
* @param id The targeted element to bring to the back.
|
|
7129
7129
|
*/
|
|
@@ -7154,7 +7154,7 @@ class Rd extends $ {
|
|
|
7154
7154
|
};
|
|
7155
7155
|
}
|
|
7156
7156
|
}
|
|
7157
|
-
class
|
|
7157
|
+
class Rd extends $ {
|
|
7158
7158
|
/**
|
|
7159
7159
|
* @param id The targeted element to bring to the front.
|
|
7160
7160
|
*/
|
|
@@ -7317,7 +7317,7 @@ const jo = async (i) => {
|
|
|
7317
7317
|
}
|
|
7318
7318
|
})).json()).shortUrl;
|
|
7319
7319
|
} catch (e) {
|
|
7320
|
-
throw console.error(e), new
|
|
7320
|
+
throw console.error(e), new Oe("Failed to shorten URL, see console.");
|
|
7321
7321
|
}
|
|
7322
7322
|
};
|
|
7323
7323
|
class ci {
|
|
@@ -7387,12 +7387,12 @@ class Yo {
|
|
|
7387
7387
|
40
|
|
7388
7388
|
);
|
|
7389
7389
|
});
|
|
7390
|
-
t.forEach((h) => a.getCommandDispatcher()(new
|
|
7390
|
+
t.forEach((h) => a.getCommandDispatcher()(new Ot(h.id)));
|
|
7391
7391
|
const s = n.data.baseUrl.slice(0, 4) === "http" ? "" : "https://", l = new URL(s + n.data.baseUrl);
|
|
7392
7392
|
l.searchParams.append("video", btoa(JSON.stringify([o]))), l.pathname = l.pathname + (l.pathname.slice(-1) === "/" ? "" : "/");
|
|
7393
7393
|
const c = l.toString();
|
|
7394
7394
|
if (c.length >= 2e3)
|
|
7395
|
-
throw new
|
|
7395
|
+
throw new Oe("Cannot create QR code, URL too long.");
|
|
7396
7396
|
const d = await jo(c);
|
|
7397
7397
|
if (!n.data || !n.data.regions)
|
|
7398
7398
|
throw new At(n, "Missing regions.");
|
|
@@ -7575,7 +7575,7 @@ class ke {
|
|
|
7575
7575
|
});
|
|
7576
7576
|
},
|
|
7577
7577
|
() => {
|
|
7578
|
-
throw new
|
|
7578
|
+
throw new Oe("Failed to resolve transcoded PDF");
|
|
7579
7579
|
}
|
|
7580
7580
|
)
|
|
7581
7581
|
);
|
|
@@ -7620,7 +7620,7 @@ class ke {
|
|
|
7620
7620
|
}
|
|
7621
7621
|
async loadPatternFromString(t, e, a = !0, n = void 0, r) {
|
|
7622
7622
|
if (t.endsWith("svg")) {
|
|
7623
|
-
const o = await
|
|
7623
|
+
const o = await Oa(t), s = o.width, l = o.height, c = await at(t);
|
|
7624
7624
|
if (r) {
|
|
7625
7625
|
const A = c.match(/<(image|linearGradient|radialGradient)(\s|>|\/>)/gim);
|
|
7626
7626
|
if (A && A.length > 0)
|
|
@@ -7638,7 +7638,7 @@ class ke {
|
|
|
7638
7638
|
};
|
|
7639
7639
|
mt.set(t, u), e.setPatternData(u, a);
|
|
7640
7640
|
} else {
|
|
7641
|
-
const o = await
|
|
7641
|
+
const o = await Re(t, !0), s = await Ue(o), l = {
|
|
7642
7642
|
src: t,
|
|
7643
7643
|
width: s.width,
|
|
7644
7644
|
height: s.height,
|
|
@@ -7723,7 +7723,7 @@ class ke {
|
|
|
7723
7723
|
r && r(!0);
|
|
7724
7724
|
const c = t.data.initialZoomLevel, d = await Promise.all(
|
|
7725
7725
|
t.data.regions.map(async (h, g) => {
|
|
7726
|
-
const p = await ze(l[g]), m = s.getImageData(), f = a.map((I) => new
|
|
7726
|
+
const p = await ze(l[g]), m = s.getImageData(), f = a.map((I) => new Ot(I.id)), y = m ? Qa(
|
|
7727
7727
|
m,
|
|
7728
7728
|
p,
|
|
7729
7729
|
c && !t.data.forceImageCover ? { scale: c } : void 0,
|
|
@@ -7989,7 +7989,7 @@ class Jo {
|
|
|
7989
7989
|
if (!o)
|
|
7990
7990
|
throw new Xt(r);
|
|
7991
7991
|
t.mandatory && n.setMandatoryFulfilled(t.stepName, !1);
|
|
7992
|
-
const s = a.map((m) => new
|
|
7992
|
+
const s = a.map((m) => new Ot(m.id)), l = await st(await this.getIllustrationBody(o)), c = await te(l.svg), d = (m, f) => {
|
|
7993
7993
|
const y = n.getLayouts().find((x) => x.panelId === m.panelId);
|
|
7994
7994
|
if (!y)
|
|
7995
7995
|
throw new J(m);
|
|
@@ -8248,7 +8248,7 @@ class Xo {
|
|
|
8248
8248
|
if (!m)
|
|
8249
8249
|
return console.error(`Can not find layout for region: ${u.panelId}`), null;
|
|
8250
8250
|
const f = [];
|
|
8251
|
-
return h && f.push(new
|
|
8251
|
+
return h && f.push(new Ot(g)), f.push(
|
|
8252
8252
|
new H(
|
|
8253
8253
|
{
|
|
8254
8254
|
stepRegion: u,
|
|
@@ -8375,7 +8375,7 @@ class Zo {
|
|
|
8375
8375
|
if (!o)
|
|
8376
8376
|
return console.error("No URL for picture!"), null;
|
|
8377
8377
|
n(!0), t.mandatory && a.setMandatoryFulfilled(t.stepName, !1);
|
|
8378
|
-
const l = a.getRegionElements(t.stepName).map((u) => new
|
|
8378
|
+
const l = a.getRegionElements(t.stepName).map((u) => new Ot(u.id)), c = (u, A) => {
|
|
8379
8379
|
const g = a.getLayouts().find((m) => m.panelId === u.panelId);
|
|
8380
8380
|
if (!g)
|
|
8381
8381
|
throw new J(u);
|
|
@@ -8949,7 +8949,7 @@ class rs {
|
|
|
8949
8949
|
l.helperData.charactersRemaining = a.data.maxLength - s.length;
|
|
8950
8950
|
const c = [], d = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
|
|
8951
8951
|
for (const A of e) {
|
|
8952
|
-
if (!A.fontData) throw new
|
|
8952
|
+
if (!A.fontData) throw new O("Failed to resolve font data for text.");
|
|
8953
8953
|
const [h, g] = ve(
|
|
8954
8954
|
A.fontSize,
|
|
8955
8955
|
A.fontData,
|
|
@@ -9253,8 +9253,8 @@ class rs {
|
|
|
9253
9253
|
paths: a.paths,
|
|
9254
9254
|
fillSpotColorDefinition: y
|
|
9255
9255
|
}, v = [], I = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map();
|
|
9256
|
-
if (!b.fontData) throw new
|
|
9257
|
-
const [
|
|
9256
|
+
if (!b.fontData) throw new O("Failed to resolve font data for text.");
|
|
9257
|
+
const [R, P] = ve(
|
|
9258
9258
|
b.fontSize,
|
|
9259
9259
|
b.fontData,
|
|
9260
9260
|
{
|
|
@@ -9268,11 +9268,11 @@ class rs {
|
|
|
9268
9268
|
[c],
|
|
9269
9269
|
{ size: a.size, minSize: a.minSize, maxSize: a.maxSize }
|
|
9270
9270
|
);
|
|
9271
|
-
I.set(b.id,
|
|
9271
|
+
I.set(b.id, R), M.set(b.id, P);
|
|
9272
9272
|
const T = a.curved || a.vertical ? c : (P || []).join(`
|
|
9273
9273
|
`);
|
|
9274
9274
|
v.push(
|
|
9275
|
-
this.generateTextChangeCommandsForRegion(
|
|
9275
|
+
this.generateTextChangeCommandsForRegion(R, a, b.id, T)
|
|
9276
9276
|
);
|
|
9277
9277
|
const V = new H(b, p);
|
|
9278
9278
|
return {
|
|
@@ -9330,8 +9330,8 @@ class rs {
|
|
|
9330
9330
|
const b = o.getWorkflowExperience().getProfanityList(), v = ua(h.toLowerCase());
|
|
9331
9331
|
for (const I of v)
|
|
9332
9332
|
for (const M in b) {
|
|
9333
|
-
const
|
|
9334
|
-
if (I ===
|
|
9333
|
+
const R = b[M].toLowerCase().replace(/\s/g, "");
|
|
9334
|
+
if (I === R) {
|
|
9335
9335
|
const T = "Blocked profanity.";
|
|
9336
9336
|
return l(T), { error: T };
|
|
9337
9337
|
}
|
|
@@ -9541,8 +9541,8 @@ class gs extends os {
|
|
|
9541
9541
|
I.classList.add("module-layer1"), w.appendChild(I), I.setAttribute("stroke-width", "3"), I.setAttribute("stroke", "rgb(45,41,38)"), I.setAttribute("fill", "rgb(45,41,38)"), I.setAttribute("transform", "translate(0.5,0)"), I.innerHTML = s;
|
|
9542
9542
|
const M = et("g");
|
|
9543
9543
|
M.classList.add("module-layer2"), w.appendChild(M), M.setAttribute("fill", "rgb(255,209,0)"), M.setAttribute("transform", "translate(1,-0.1)"), M.innerHTML = s;
|
|
9544
|
-
const
|
|
9545
|
-
return
|
|
9544
|
+
const R = et("g");
|
|
9545
|
+
return R.classList.add("module-layer3"), w.appendChild(R), R.setAttribute("fill", "white"), R.innerHTML = s, new hs(w).transform(([T, V]) => [T, V + (c / 2 - T) ** 2 / (c * 6)]), w;
|
|
9546
9546
|
}, A = et("g");
|
|
9547
9547
|
A.classList.add("module-root");
|
|
9548
9548
|
const h = et("defs");
|
|
@@ -9562,7 +9562,7 @@ class gs extends os {
|
|
|
9562
9562
|
async function pi(i) {
|
|
9563
9563
|
if (i === "Vegemite")
|
|
9564
9564
|
return new gs();
|
|
9565
|
-
throw new
|
|
9565
|
+
throw new O(`Failed to resolve Module, Module ${i} not found`);
|
|
9566
9566
|
}
|
|
9567
9567
|
const ms = [
|
|
9568
9568
|
"altGlyph",
|
|
@@ -10360,7 +10360,7 @@ const Ud = (i, t) => {
|
|
|
10360
10360
|
name
|
|
10361
10361
|
}
|
|
10362
10362
|
}
|
|
10363
|
-
`,
|
|
10363
|
+
`, Ra = (i) => C`
|
|
10364
10364
|
${Ts(i)}
|
|
10365
10365
|
fragment ProductCollectionProductFields on ProductCollectionProduct {
|
|
10366
10366
|
id
|
|
@@ -10371,7 +10371,7 @@ const Ud = (i, t) => {
|
|
|
10371
10371
|
}
|
|
10372
10372
|
}
|
|
10373
10373
|
`, qe = (i, t = !1) => C`
|
|
10374
|
-
${i ?
|
|
10374
|
+
${i ? Ra(t) : ""}
|
|
10375
10375
|
fragment ProductCollectionFields on ProductCollection {
|
|
10376
10376
|
id
|
|
10377
10377
|
name
|
|
@@ -10550,8 +10550,8 @@ const Ud = (i, t) => {
|
|
|
10550
10550
|
}
|
|
10551
10551
|
}
|
|
10552
10552
|
}
|
|
10553
|
-
`,
|
|
10554
|
-
${
|
|
10553
|
+
`, Os = C`
|
|
10554
|
+
${Ra(!1)}
|
|
10555
10555
|
query GetProductCollectionProducts($id: String!, $productIds: [String!]) {
|
|
10556
10556
|
productCollections(ids: [$id], productIds: $productIds) {
|
|
10557
10557
|
id
|
|
@@ -10560,7 +10560,7 @@ const Ud = (i, t) => {
|
|
|
10560
10560
|
}
|
|
10561
10561
|
}
|
|
10562
10562
|
}
|
|
10563
|
-
`,
|
|
10563
|
+
`, Rs = C`
|
|
10564
10564
|
query GetProductCollectionForFilteredProducts(
|
|
10565
10565
|
$id: String!
|
|
10566
10566
|
$filters: ProductCollectionProductFilterInput
|
|
@@ -10584,7 +10584,7 @@ const Ud = (i, t) => {
|
|
|
10584
10584
|
}
|
|
10585
10585
|
}
|
|
10586
10586
|
`, $s = C`
|
|
10587
|
-
${
|
|
10587
|
+
${Ra(!0)}
|
|
10588
10588
|
query GetProductCollectionForProductsFeed(
|
|
10589
10589
|
$id: String!
|
|
10590
10590
|
$limit: Int
|
|
@@ -11390,7 +11390,7 @@ const ul = (i) => i.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11390
11390
|
const c = l[0];
|
|
11391
11391
|
if (s.type === E.Model) {
|
|
11392
11392
|
if (!this.modelContainer)
|
|
11393
|
-
throw new
|
|
11393
|
+
throw new O(
|
|
11394
11394
|
"We should always have a model container when injecting a preview!"
|
|
11395
11395
|
);
|
|
11396
11396
|
const d = c.asset?.fileLink;
|
|
@@ -11415,7 +11415,7 @@ const ul = (i) => i.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11415
11415
|
}
|
|
11416
11416
|
s.data.targetMaterials.forEach((A) => {
|
|
11417
11417
|
if (!this.modelContainer)
|
|
11418
|
-
throw new
|
|
11418
|
+
throw new O(
|
|
11419
11419
|
"We should always have a model container when injecting a preview!"
|
|
11420
11420
|
);
|
|
11421
11421
|
this.modelContainer.applyMaterialVariant(A, s.option.id, d);
|
|
@@ -11486,7 +11486,7 @@ const ul = (i) => i.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11486
11486
|
serialize() {
|
|
11487
11487
|
const t = this.getCommandContext().getState();
|
|
11488
11488
|
if (!t)
|
|
11489
|
-
throw new
|
|
11489
|
+
throw new O("Attempted to serialize state before it was initialized.");
|
|
11490
11490
|
const e = It(t.transaction), a = cl(e);
|
|
11491
11491
|
return JSON.stringify(a, ll, void 0);
|
|
11492
11492
|
}
|
|
@@ -11633,7 +11633,7 @@ const ul = (i) => i.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11633
11633
|
this.stepSelections = {
|
|
11634
11634
|
...this.stepSelections,
|
|
11635
11635
|
[t]: { selectedVariants: e }
|
|
11636
|
-
}, this.selectionCost = Object.values(this.stepSelections).reduce((v, I) => v + I.selectedVariants.map((M) => M.priceModifier || 0).reduce((M,
|
|
11636
|
+
}, this.selectionCost = Object.values(this.stepSelections).reduce((v, I) => v + I.selectedVariants.map((M) => M.priceModifier || 0).reduce((M, R) => M + R, 0), 0);
|
|
11637
11637
|
for (const v of r.steps)
|
|
11638
11638
|
await ft(v, this.stepSelections) || (this.stepInitialised[v.stepName] = !1, delete this.stepMetadata[v.stepName], delete this.stepSelections[v.stepName], delete this.storage[v.stepName]);
|
|
11639
11639
|
const s = this.allScenes, l = await lt(s, o), c = await lt(s, this.stepSelections), d = l.map((v) => v.silentSteps).flat(), A = c.map((v) => v.silentSteps).flat().filter(
|
|
@@ -11649,7 +11649,7 @@ const ul = (i) => i.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11649
11649
|
}, this.removeElements(h);
|
|
11650
11650
|
const m = r.steps.find((v) => v.stepName === t);
|
|
11651
11651
|
m?.type === E.Frame && this.getWorkflowExperience().getStepById(m.stepName)?.frameService?.setTargetElements(a.map((I) => I.id));
|
|
11652
|
-
const f = h.map((v) => new
|
|
11652
|
+
const f = h.map((v) => new Ot(v.id)), y = new nn(this.constructSerializableWorkflow()), w = [...p, ...f, y];
|
|
11653
11653
|
w.length > 0 && this.commandContext.apply(new U(w), !0), await this.ensureStepsAreLoaded(), this.onElementsChange();
|
|
11654
11654
|
const x = await this.getInvalidModelVariants(), b = this.modelContainer;
|
|
11655
11655
|
if (b) {
|
|
@@ -12539,7 +12539,7 @@ class ge {
|
|
|
12539
12539
|
case E.Module:
|
|
12540
12540
|
return new vl(t, e, t.getStepTags(e.stepName));
|
|
12541
12541
|
default:
|
|
12542
|
-
throw new
|
|
12542
|
+
throw new O(`Step type ${e.type} not yet supported in Core SDK`);
|
|
12543
12543
|
}
|
|
12544
12544
|
}
|
|
12545
12545
|
}
|
|
@@ -12704,8 +12704,8 @@ const Il = async (i, t) => {
|
|
|
12704
12704
|
const I = {};
|
|
12705
12705
|
let M = 0;
|
|
12706
12706
|
if (Object.keys(r).length > 0)
|
|
12707
|
-
for (const
|
|
12708
|
-
const P = r[
|
|
12707
|
+
for (const R of Object.keys(r)) {
|
|
12708
|
+
const P = r[R], T = t.steps.find((V) => V.stepName === R);
|
|
12709
12709
|
for (let V = 0; V < P.selections.length; ++V) {
|
|
12710
12710
|
const k = P.selections[V];
|
|
12711
12711
|
if (T) {
|
|
@@ -12762,14 +12762,14 @@ const Il = async (i, t) => {
|
|
|
12762
12762
|
};
|
|
12763
12763
|
if (g) {
|
|
12764
12764
|
const I = [];
|
|
12765
|
-
for (const [M,
|
|
12766
|
-
I.push({ key: M, value:
|
|
12765
|
+
for (const [M, R] of Object.entries(g))
|
|
12766
|
+
I.push({ key: M, value: R });
|
|
12767
12767
|
v.metadata = I;
|
|
12768
12768
|
}
|
|
12769
12769
|
if (f) {
|
|
12770
12770
|
const I = [];
|
|
12771
|
-
for (const [M,
|
|
12772
|
-
I.push({ key: M, ids:
|
|
12771
|
+
for (const [M, R] of Object.entries(w))
|
|
12772
|
+
I.push({ key: M, ids: R });
|
|
12773
12773
|
v.selectedVariants = I;
|
|
12774
12774
|
}
|
|
12775
12775
|
return v;
|
|
@@ -12861,7 +12861,7 @@ class xl {
|
|
|
12861
12861
|
const t = Q.get(this.localPersistenceKey);
|
|
12862
12862
|
return t ? JSON.parse(t) : [];
|
|
12863
12863
|
}
|
|
12864
|
-
throw new
|
|
12864
|
+
throw new O("Unexpected storage method requested");
|
|
12865
12865
|
}
|
|
12866
12866
|
/**
|
|
12867
12867
|
* Search for a transaction that has been saved.
|
|
@@ -12901,7 +12901,7 @@ class xl {
|
|
|
12901
12901
|
Q.set(this.localPersistenceKey, JSON.stringify(t));
|
|
12902
12902
|
return;
|
|
12903
12903
|
}
|
|
12904
|
-
throw new
|
|
12904
|
+
throw new O("Unexpected storage method requested");
|
|
12905
12905
|
}
|
|
12906
12906
|
}
|
|
12907
12907
|
const oa = new xl(), Dl = C`
|
|
@@ -13104,9 +13104,9 @@ class Tl {
|
|
|
13104
13104
|
}
|
|
13105
13105
|
}), a = e.data?.transactionUpdateIntegrationProduct.product;
|
|
13106
13106
|
if (!a)
|
|
13107
|
-
throw new
|
|
13107
|
+
throw new O("Failed to set product. No product returned from server.");
|
|
13108
13108
|
if (!this.bundle)
|
|
13109
|
-
throw new
|
|
13109
|
+
throw new O("Cannot set product on experience that is not part of a bundle.");
|
|
13110
13110
|
this.transaction.product = {
|
|
13111
13111
|
...this.transaction.product,
|
|
13112
13112
|
...e.data?.transactionUpdateIntegrationProduct.product
|
|
@@ -13132,7 +13132,7 @@ class Tl {
|
|
|
13132
13132
|
}
|
|
13133
13133
|
async clearProduct() {
|
|
13134
13134
|
if (!this.bundle)
|
|
13135
|
-
throw new
|
|
13135
|
+
throw new O("Cannot clear product on experience that is not part of a bundle.");
|
|
13136
13136
|
this.workflow = void 0, this.transaction.workflowState = void 0, this.transaction.product = void 0, this.transaction.integrationProduct = void 0, this.currentPriceBreak = this.priceBreakToBeApplied(), this.callEvent(
|
|
13137
13137
|
"ProductChanged"
|
|
13138
13138
|
/* ProductChanged */
|
|
@@ -13219,7 +13219,7 @@ class Tl {
|
|
|
13219
13219
|
height: d.layoutState.layout.height
|
|
13220
13220
|
}, A = this.workflowManager.getCommandContext().getLayoutById(d.layoutState.layout.id), h = o.getContext("2d");
|
|
13221
13221
|
if (!h)
|
|
13222
|
-
throw new
|
|
13222
|
+
throw new Oe("Failed to obtain 2D context for preview image creation");
|
|
13223
13223
|
const g = this.workflowManager.getTemplatingContext(), p = Ta(A.layoutState.layout, A.layoutState.elements, {
|
|
13224
13224
|
renderingConfiguration: {
|
|
13225
13225
|
purpose: _t.Print,
|
|
@@ -13382,9 +13382,9 @@ class Tl {
|
|
|
13382
13382
|
}
|
|
13383
13383
|
async save(t) {
|
|
13384
13384
|
const e = this.getProduct(), a = this.getWorkflow(), n = this.getCommandContext().getState();
|
|
13385
|
-
if (!e) throw new
|
|
13386
|
-
if (!a) throw new
|
|
13387
|
-
if (!n) throw new
|
|
13385
|
+
if (!e) throw new O("Product undefined!");
|
|
13386
|
+
if (!a) throw new O("Workflow undefined!");
|
|
13387
|
+
if (!n) throw new O("State undefined!");
|
|
13388
13388
|
const o = {
|
|
13389
13389
|
title: await (async () => {
|
|
13390
13390
|
if (t) return t;
|
|
@@ -13403,11 +13403,11 @@ class Tl {
|
|
|
13403
13403
|
}
|
|
13404
13404
|
async copy() {
|
|
13405
13405
|
const t = It(this.getCommandContext().getState());
|
|
13406
|
-
if (!t) throw new
|
|
13406
|
+
if (!t) throw new O("Internal state is undefined! Cannot copy experience!");
|
|
13407
13407
|
const e = JSON.stringify(t.transaction), a = this.getWorkflow();
|
|
13408
|
-
if (!a) throw new
|
|
13408
|
+
if (!a) throw new O("Workflow is undefined! Cannot copy experience!");
|
|
13409
13409
|
const n = this.getTransaction().integrationProduct?.id;
|
|
13410
|
-
if (!n) throw new
|
|
13410
|
+
if (!n) throw new O("Integration product id is undefined!");
|
|
13411
13411
|
return await this.getClient().getWorkflowExperience({
|
|
13412
13412
|
type: "integration",
|
|
13413
13413
|
integrationProductId: n,
|
|
@@ -13418,9 +13418,9 @@ class Tl {
|
|
|
13418
13418
|
async onDesignFinished(t = !0) {
|
|
13419
13419
|
const e = this.getTransaction(), a = this.getProduct(), n = this.getWorkflow();
|
|
13420
13420
|
if (!a)
|
|
13421
|
-
throw new
|
|
13421
|
+
throw new O("Product undefined! Cannot finish an experience without a product.");
|
|
13422
13422
|
if (!n)
|
|
13423
|
-
throw new
|
|
13423
|
+
throw new O("Workflow undefined! Cannot finish an experience without a workflow.");
|
|
13424
13424
|
if (e.isOrdered)
|
|
13425
13425
|
return {
|
|
13426
13426
|
event: "",
|
|
@@ -13589,7 +13589,7 @@ const Nl = (i) => {
|
|
|
13589
13589
|
}
|
|
13590
13590
|
return !1;
|
|
13591
13591
|
};
|
|
13592
|
-
class
|
|
13592
|
+
class Ol {
|
|
13593
13593
|
constructor(t) {
|
|
13594
13594
|
this.handleCache = {}, this.bundle = t;
|
|
13595
13595
|
}
|
|
@@ -13631,7 +13631,7 @@ class Rl {
|
|
|
13631
13631
|
async createHandle(t) {
|
|
13632
13632
|
switch (t.type) {
|
|
13633
13633
|
case z.FileUpload:
|
|
13634
|
-
return new
|
|
13634
|
+
return new Rl(this.bundle, t).initialize();
|
|
13635
13635
|
case z.ColorOption:
|
|
13636
13636
|
return new An(
|
|
13637
13637
|
this.bundle,
|
|
@@ -13717,7 +13717,7 @@ class $a {
|
|
|
13717
13717
|
return this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);
|
|
13718
13718
|
}
|
|
13719
13719
|
}
|
|
13720
|
-
class
|
|
13720
|
+
class Rl extends $a {
|
|
13721
13721
|
constructor(t, e) {
|
|
13722
13722
|
super(t, e);
|
|
13723
13723
|
}
|
|
@@ -13728,7 +13728,7 @@ class Ol extends $a {
|
|
|
13728
13728
|
const t = await this.getImage();
|
|
13729
13729
|
if (t?.fileLink)
|
|
13730
13730
|
if (t?.fileLink.endsWith(".svg")) {
|
|
13731
|
-
const e = await at(t?.fileLink), a = await
|
|
13731
|
+
const e = await at(t?.fileLink), a = await Oa(t?.fileLink), n = a.width, r = a.height, o = await st(e);
|
|
13732
13732
|
this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.colors?.forEach((c) => {
|
|
13733
13733
|
o.colors[c.key] = {
|
|
13734
13734
|
browserValue: c.browserValue,
|
|
@@ -13771,8 +13771,8 @@ class Ol extends $a {
|
|
|
13771
13771
|
this.loadImageData()
|
|
13772
13772
|
]);
|
|
13773
13773
|
}
|
|
13774
|
-
async
|
|
13775
|
-
return this.bundle.getClient().canUseAddon(Ba.
|
|
13774
|
+
async canUseAdvancedImageManipulation() {
|
|
13775
|
+
return this.bundle.getClient().canUseAddon(Ba.AdvancedImageManipulation);
|
|
13776
13776
|
}
|
|
13777
13777
|
/**
|
|
13778
13778
|
* Removes the background from an image, stores it in the state, and returns the new asset.
|
|
@@ -13780,9 +13780,9 @@ class Ol extends $a {
|
|
|
13780
13780
|
* @returns A promise that resolves with the newly generated Asset.
|
|
13781
13781
|
*/
|
|
13782
13782
|
async removeBackgroundFromImage(t = !0) {
|
|
13783
|
-
if (!await this.
|
|
13783
|
+
if (!await this.canUseAdvancedImageManipulation())
|
|
13784
13784
|
throw new Error(
|
|
13785
|
-
"The current Integration does not have access to the
|
|
13785
|
+
"The current Integration does not have access to the Advanced Image Manipulation addon. Please call canUseAdvancedImageManipulation to ensure you disable this feature when appropriate."
|
|
13786
13786
|
);
|
|
13787
13787
|
const e = await this.getOriginalImage();
|
|
13788
13788
|
if (!e)
|
|
@@ -13801,6 +13801,10 @@ class Ol extends $a {
|
|
|
13801
13801
|
* @returns A promise that resolves with the newly generated Asset.
|
|
13802
13802
|
*/
|
|
13803
13803
|
async vectorizeImage(t = !0) {
|
|
13804
|
+
if (!await this.canUseAdvancedImageManipulation())
|
|
13805
|
+
throw new Error(
|
|
13806
|
+
"The current Integration does not have access to the Advanced Image Manipulation addon. Please call canUseAdvancedImageManipulation to ensure you disable this feature when appropriate."
|
|
13807
|
+
);
|
|
13804
13808
|
const e = await this.getOriginalImage();
|
|
13805
13809
|
if (!e)
|
|
13806
13810
|
throw new Error("You must supply an image selection before attempting to vectorize the image.");
|
|
@@ -14528,7 +14532,7 @@ class vi {
|
|
|
14528
14532
|
if (this.fullFetched)
|
|
14529
14533
|
return (this.collection.productCollectionProducts ?? []).filter((n) => !!n.product).map((n) => new pe(n));
|
|
14530
14534
|
const e = await S.getShadowGraphqlClient().query({
|
|
14531
|
-
query:
|
|
14535
|
+
query: Os,
|
|
14532
14536
|
variables: {
|
|
14533
14537
|
id: this.getId(),
|
|
14534
14538
|
productIds: t
|
|
@@ -14549,7 +14553,7 @@ class vi {
|
|
|
14549
14553
|
*/
|
|
14550
14554
|
async filterProducts(t, e, a, n) {
|
|
14551
14555
|
const r = await S.getShadowGraphqlClient().query({
|
|
14552
|
-
query:
|
|
14556
|
+
query: Rs,
|
|
14553
14557
|
errorPolicy: "all",
|
|
14554
14558
|
variables: {
|
|
14555
14559
|
id: this.getId(),
|
|
@@ -14879,7 +14883,7 @@ class hn {
|
|
|
14879
14883
|
l,
|
|
14880
14884
|
this.onGlobalPropertiesChanged.bind(this),
|
|
14881
14885
|
o
|
|
14882
|
-
), this.globalPropertyHandleService = new
|
|
14886
|
+
), this.globalPropertyHandleService = new Ol(this), this.setPreviewService(a), this.initializationPromise = (async () => {
|
|
14883
14887
|
if (!o?.readonly) {
|
|
14884
14888
|
const c = this.bundleStateManager.getState();
|
|
14885
14889
|
if (c.integrationProductIds && c.integrationProductIds.length > 0) {
|
|
@@ -16233,7 +16237,7 @@ class Wd {
|
|
|
16233
16237
|
} catch (a) {
|
|
16234
16238
|
throw console.error(a), new pt("Critical - Unable to synchronize workflow state with server.");
|
|
16235
16239
|
}
|
|
16236
|
-
}, this.options = t, this.options.applicationKey && ur(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 39.2.
|
|
16240
|
+
}, this.options = t, this.options.applicationKey && ur(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 39.2.3"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
|
16237
16241
|
}
|
|
16238
16242
|
configure(t) {
|
|
16239
16243
|
wt.setHubUrl(t.hubUrl), wt.setServerUrl(t.serverUrl), wt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && hr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Gt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
|
@@ -16699,7 +16703,7 @@ class Wd {
|
|
|
16699
16703
|
transaction: T,
|
|
16700
16704
|
singleVariantsRenderable: gt?.workflowConfiguration?.singleVariantsRenderable,
|
|
16701
16705
|
stateMutationFunc: k ? async () => {
|
|
16702
|
-
throw new
|
|
16706
|
+
throw new O("State mutation is forbidden in read only mode!");
|
|
16703
16707
|
} : async (it) => this.updateTransactionState({
|
|
16704
16708
|
...it,
|
|
16705
16709
|
context: { transactionOwnerId: He, bundleOwnerId: e?.bundleOwnerId }
|
|
@@ -16717,12 +16721,12 @@ class Wd {
|
|
|
16717
16721
|
}
|
|
16718
16722
|
return le.delayWorkflowStateSync = !0, { experienceOptions: le, index: X, options: gt };
|
|
16719
16723
|
}), M = (await Promise.all(v)).sort((P, T) => P.index - T.index);
|
|
16720
|
-
let
|
|
16724
|
+
let R = [];
|
|
16721
16725
|
for (const P of M) {
|
|
16722
16726
|
const { experienceOptions: T, options: V } = P, k = new Tl(this, T);
|
|
16723
|
-
await k.getWorkflowManager().getInitializationPromise(), a && a(), V.type !== "transaction" && this.customer && await k.attachCustomerDetails({ email: this.customer.emailAddress }),
|
|
16727
|
+
await k.getWorkflowManager().getInitializationPromise(), a && a(), V.type !== "transaction" && this.customer && await k.attachCustomerDetails({ email: this.customer.emailAddress }), R = [...R, k], k.getWorkflowManager().setWorkflowStateSyncEnabled(!0);
|
|
16724
16728
|
}
|
|
16725
|
-
return
|
|
16729
|
+
return R;
|
|
16726
16730
|
}
|
|
16727
16731
|
storeCustomer(t) {
|
|
16728
16732
|
const e = Q.getMap("partnerCustomerIds") || /* @__PURE__ */ new Map();
|
|
@@ -17039,7 +17043,7 @@ class fc {
|
|
|
17039
17043
|
if (!n || !this.frameData)
|
|
17040
17044
|
return;
|
|
17041
17045
|
if (this.frameData.length !== t.length)
|
|
17042
|
-
throw new
|
|
17046
|
+
throw new O(
|
|
17043
17047
|
"Frame data and offsets are not the same length. This is a bug. Please report it."
|
|
17044
17048
|
);
|
|
17045
17049
|
if (!this.offsets.some((o, s) => !(t[s].x === o.x && t[s].y === o.y && t[s].zoom === o.zoom)) && !a) {
|
|
@@ -17083,8 +17087,8 @@ class fc {
|
|
|
17083
17087
|
*/
|
|
17084
17088
|
updateFrameOffsets(t, e, a, n, r) {
|
|
17085
17089
|
if (!a || a.length === 0 || a.some((l) => !l))
|
|
17086
|
-
throw new
|
|
17087
|
-
if (!this.workflowManager) throw new
|
|
17090
|
+
throw new O("Frame data not set. This is a bug");
|
|
17091
|
+
if (!this.workflowManager) throw new O("No workflow manager set, cannot update offsets.");
|
|
17088
17092
|
const o = this.workflowManager.getRegionElements(this.stepName || ""), s = this.workflowManager.getCommandDispatcher();
|
|
17089
17093
|
this.targetElements.forEach((l, c) => {
|
|
17090
17094
|
let d = o.find((u) => u.id === l)?.regionIndex ?? c;
|
|
@@ -17336,7 +17340,7 @@ class wc extends tt {
|
|
|
17336
17340
|
* Returns `true` if the Background Remover is available for the current session.
|
|
17337
17341
|
*/
|
|
17338
17342
|
async canUseBackgroundRemover() {
|
|
17339
|
-
return this.manager.getClient().canUseAddon(Ba.
|
|
17343
|
+
return this.manager.getClient().canUseAddon(Ba.AdvancedImageManipulation);
|
|
17340
17344
|
}
|
|
17341
17345
|
/**
|
|
17342
17346
|
* Returns `true` if the Background Remover is available for the current session and if the associated frame has a user-supplied raster image.
|
|
@@ -17887,7 +17891,7 @@ const Fi = C`
|
|
|
17887
17891
|
}
|
|
17888
17892
|
}
|
|
17889
17893
|
`;
|
|
17890
|
-
var
|
|
17894
|
+
var Oc = /* @__PURE__ */ ((i) => (i.Confirmed = "Confirmed", i.Plausible = "Plausible", i.Unlikely = "Unlikely", i))(Oc || {}), Rc = /* @__PURE__ */ ((i) => (i.Created = "Created", i.Processing = "Processing", i.Completed = "Completed", i.Failed = "Failed", i.Cancelled = "Cancelled", i))(Rc || {});
|
|
17891
17895
|
const du = async (i) => {
|
|
17892
17896
|
const t = i.map((a) => a.getTransaction().recipient?.id).filter((a) => !!a), e = await S.getShadowGraphqlClient().query({
|
|
17893
17897
|
query: Mc,
|
|
@@ -17960,15 +17964,15 @@ const du = async (i) => {
|
|
|
17960
17964
|
})).data.integrationProducts;
|
|
17961
17965
|
export {
|
|
17962
17966
|
Ba as AddonHandle,
|
|
17963
|
-
|
|
17964
|
-
|
|
17967
|
+
Rc as AddressValidationJobStatus,
|
|
17968
|
+
Oc as AddressValidationResultConfirmationLevel,
|
|
17965
17969
|
Pn as AddressValidationStatus,
|
|
17966
17970
|
qd as ArrayInput,
|
|
17967
17971
|
z as AspectType,
|
|
17968
17972
|
Bt as AssetNotFoundError,
|
|
17969
17973
|
Ie as AssetType,
|
|
17970
|
-
|
|
17971
|
-
|
|
17974
|
+
Rd as BringForwardCommand,
|
|
17975
|
+
Od as BringToBackCommand,
|
|
17972
17976
|
Qd as BringToFrontCommand,
|
|
17973
17977
|
Ji as BundleDesignCreationCartAddMode,
|
|
17974
17978
|
$ as CanvasCommand,
|
|
@@ -17981,9 +17985,9 @@ export {
|
|
|
17981
17985
|
li as CreateLayoutCommand,
|
|
17982
17986
|
cc as CurrencyContext,
|
|
17983
17987
|
lc as CurrencyService,
|
|
17984
|
-
|
|
17988
|
+
Ot as DeleteElementCommand,
|
|
17985
17989
|
Sl as DigitalContentStepHandle,
|
|
17986
|
-
|
|
17990
|
+
Rl as FileUploadGlobalPropertyHandle,
|
|
17987
17991
|
fe as FlowExecutionNodeResult,
|
|
17988
17992
|
ec as FlowExecutionResult,
|
|
17989
17993
|
tc as FlowService,
|
|
@@ -18042,7 +18046,7 @@ export {
|
|
|
18042
18046
|
$l as TextGlobalPropertyHandle,
|
|
18043
18047
|
Gd as TextInput,
|
|
18044
18048
|
wl as TextStepHandle,
|
|
18045
|
-
|
|
18049
|
+
O as UnhandledBehaviorError,
|
|
18046
18050
|
Zi as UnitOfMeasurement,
|
|
18047
18051
|
Nd as UpdateImageSourceCommand,
|
|
18048
18052
|
rt as Variant,
|