@spiffcommerce/core 40.0.1 → 40.1.0
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.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +136 -120
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -9,14 +9,14 @@ import Vi from "fuse.js";
|
|
|
9
9
|
import { Pith as Ia } from "pith";
|
|
10
10
|
import ca from "lodash.chunk";
|
|
11
11
|
import It from "lodash.clonedeep";
|
|
12
|
-
import { jsx as F, jsxs as ut, Fragment as
|
|
12
|
+
import { jsx as F, jsxs as ut, Fragment as Wt } from "preact/jsx-runtime";
|
|
13
13
|
import { parse as da } from "opentype.js";
|
|
14
14
|
import { decode as Li } from "html-entities";
|
|
15
15
|
import zi from "handlebars";
|
|
16
16
|
import { dataUriToBuffer as Gi } from "data-uri-to-buffer";
|
|
17
|
-
import { CognitoIdentityProviderClient as qi, InitiateAuthCommand as
|
|
18
|
-
import
|
|
19
|
-
import * as
|
|
17
|
+
import { CognitoIdentityProviderClient as qi, InitiateAuthCommand as Ha, RespondToAuthChallengeCommand as Hi } from "@aws-sdk/client-cognito-identity-provider";
|
|
18
|
+
import Wi from "dinero.js";
|
|
19
|
+
import * as Wa from "currency-codes";
|
|
20
20
|
import Pn from "lodash.debounce";
|
|
21
21
|
import Kt from "lodash.isequal";
|
|
22
22
|
import { split as ua } from "unicode-default-word-boundary";
|
|
@@ -218,14 +218,14 @@ const Tn = /* @__PURE__ */ new Map(), Ya = /* @__PURE__ */ new Map(), Ja = /* @_
|
|
|
218
218
|
t ? ir(i).then(e).catch(a) : nt(i).then((n) => {
|
|
219
219
|
n.text().then(e).catch(a);
|
|
220
220
|
}).catch(a);
|
|
221
|
-
}), Qn = (i) => Ri(i),
|
|
221
|
+
}), Qn = (i) => Ri(i), We = /* @__PURE__ */ new Map(), or = async (i, t) => {
|
|
222
222
|
if (Nt([typeof FontFace])) {
|
|
223
|
-
if (
|
|
224
|
-
return
|
|
223
|
+
if (We.has(t))
|
|
224
|
+
return We.get(t);
|
|
225
225
|
const e = i.names.fullName.en, a = new FontFace(e, `url(${t})`);
|
|
226
226
|
document.fonts.add(a);
|
|
227
227
|
const n = a.load();
|
|
228
|
-
return
|
|
228
|
+
return We.set(t, n), n;
|
|
229
229
|
}
|
|
230
230
|
}, Pt = () => {
|
|
231
231
|
if (Nt([typeof XMLSerializer]))
|
|
@@ -3451,7 +3451,7 @@ const ue = (i) => {
|
|
|
3451
3451
|
${i && "...AssetMetadataFields" || ""}
|
|
3452
3452
|
|
|
3453
3453
|
}
|
|
3454
|
-
`,
|
|
3454
|
+
`, Hn = C`
|
|
3455
3455
|
fragment MaterialFields on Material {
|
|
3456
3456
|
id
|
|
3457
3457
|
name
|
|
@@ -3499,7 +3499,7 @@ const ue = (i) => {
|
|
|
3499
3499
|
}
|
|
3500
3500
|
}
|
|
3501
3501
|
`, Qr = C`
|
|
3502
|
-
${
|
|
3502
|
+
${Hn}
|
|
3503
3503
|
query GetMaterials($ids: [String]) {
|
|
3504
3504
|
materials(id: $ids) {
|
|
3505
3505
|
...MaterialFields
|
|
@@ -3865,7 +3865,7 @@ class G {
|
|
|
3865
3865
|
Q.setMap(t, e);
|
|
3866
3866
|
}
|
|
3867
3867
|
}
|
|
3868
|
-
const
|
|
3868
|
+
const H = new Lr();
|
|
3869
3869
|
class zr {
|
|
3870
3870
|
constructor() {
|
|
3871
3871
|
this.cache = {}, this.disabled = !1;
|
|
@@ -3946,7 +3946,7 @@ const Pe = new zr(), Ta = (i, t = 512, e, a) => {
|
|
|
3946
3946
|
...AssetFields
|
|
3947
3947
|
}
|
|
3948
3948
|
}
|
|
3949
|
-
`,
|
|
3949
|
+
`, Hr = C`
|
|
3950
3950
|
query GetTagsMany($ids: [String!]!) {
|
|
3951
3951
|
tagsMany(entityIds: $ids) {
|
|
3952
3952
|
id
|
|
@@ -3954,11 +3954,11 @@ const Pe = new zr(), Ta = (i, t = 512, e, a) => {
|
|
|
3954
3954
|
name
|
|
3955
3955
|
}
|
|
3956
3956
|
}
|
|
3957
|
-
`,
|
|
3957
|
+
`, Wr = async (i) => {
|
|
3958
3958
|
const t = await S.getShadowGraphqlClient().query({
|
|
3959
3959
|
query: C`
|
|
3960
3960
|
${ie(!1, !1)}
|
|
3961
|
-
${
|
|
3961
|
+
${Hn}
|
|
3962
3962
|
${qr}
|
|
3963
3963
|
query GetOptions($ids: [String]!) {
|
|
3964
3964
|
options(ids: $ids) {
|
|
@@ -3972,14 +3972,14 @@ const Pe = new zr(), Ta = (i, t = 512, e, a) => {
|
|
|
3972
3972
|
}
|
|
3973
3973
|
});
|
|
3974
3974
|
return t.data.options.forEach((e) => {
|
|
3975
|
-
e.colorProfile &&
|
|
3976
|
-
a.asset &&
|
|
3975
|
+
e.colorProfile && H.cacheAsset(e.colorProfile), e.variants?.forEach((a) => {
|
|
3976
|
+
a.asset && H.cacheAsset(a.asset), a.thumbnail && H.cacheAsset(a.thumbnail), a.material && H.cacheMaterial(a.material);
|
|
3977
3977
|
});
|
|
3978
3978
|
}), t.data.options;
|
|
3979
3979
|
}, jr = async (i, t) => (await t).find((a) => a.id === i), Je = async (i) => {
|
|
3980
3980
|
const t = new Map(i.map((n) => [n, Pe.get({ id: n })])), e = i.filter((n) => t.get(n) === void 0);
|
|
3981
3981
|
if (e.length > 0) {
|
|
3982
|
-
const n =
|
|
3982
|
+
const n = Wr(e);
|
|
3983
3983
|
e.forEach(
|
|
3984
3984
|
(r) => t.set(r, Pe.set({ id: r }, jr(r, n)))
|
|
3985
3985
|
);
|
|
@@ -4011,7 +4011,7 @@ class Yr {
|
|
|
4011
4011
|
}, this.getTagsForAssets = async (t) => {
|
|
4012
4012
|
const e = t?.map((s) => s.asset?.key) || [], a = t?.map((s) => s.material?.id) || [], n = [...e, ...a].filter((s) => !!s);
|
|
4013
4013
|
return n.length === 0 ? [] : (await S.getShadowGraphqlClient().query({
|
|
4014
|
-
query:
|
|
4014
|
+
query: Hr,
|
|
4015
4015
|
errorPolicy: "all",
|
|
4016
4016
|
variables: {
|
|
4017
4017
|
ids: n
|
|
@@ -4054,7 +4054,7 @@ class Yr {
|
|
|
4054
4054
|
return e || (t.material ? t.material.id : "");
|
|
4055
4055
|
}
|
|
4056
4056
|
}
|
|
4057
|
-
const B = new Yr(),
|
|
4057
|
+
const B = new Yr(), Wn = C`
|
|
4058
4058
|
fragment ActiveIntegrationFields on Integration {
|
|
4059
4059
|
id
|
|
4060
4060
|
logo
|
|
@@ -4191,7 +4191,7 @@ const B = new Yr(), Hn = C`
|
|
|
4191
4191
|
`, Kn = C`
|
|
4192
4192
|
${Ue}
|
|
4193
4193
|
${re}
|
|
4194
|
-
${
|
|
4194
|
+
${Wn}
|
|
4195
4195
|
query ReadIntegrationProducts($ids: [String!]!) {
|
|
4196
4196
|
integrationProducts(ids: $ids) {
|
|
4197
4197
|
id
|
|
@@ -5141,7 +5141,7 @@ const B = new Yr(), Hn = C`
|
|
|
5141
5141
|
}
|
|
5142
5142
|
}
|
|
5143
5143
|
`, gs = C`
|
|
5144
|
-
${
|
|
5144
|
+
${Wn}
|
|
5145
5145
|
${Ve}
|
|
5146
5146
|
query GetCurrentIntegration($themeConfigurationId: String) {
|
|
5147
5147
|
currentIntegration {
|
|
@@ -5538,7 +5538,7 @@ const N = () => {
|
|
|
5538
5538
|
) });
|
|
5539
5539
|
}, Zn = (i) => {
|
|
5540
5540
|
const t = `spiff-group-clip-${i.id}`, e = i.rotation || 0, a = St(e), n = Math.cos(a), r = -Math.sin(a), s = Ra(i.children);
|
|
5541
|
-
return /* @__PURE__ */ ut(
|
|
5541
|
+
return /* @__PURE__ */ ut(Wt, { children: [
|
|
5542
5542
|
/* @__PURE__ */ F("defs", { children: /* @__PURE__ */ F("clipPath", { id: t, preserveAspectRatio: "none", children: i.clipPath ? /* @__PURE__ */ F("path", { d: i.clipPath }) : /* @__PURE__ */ F("rect", { x: 0, y: 0, width: i.width, height: i.height }) }) }),
|
|
5543
5543
|
/* @__PURE__ */ ut(
|
|
5544
5544
|
"g",
|
|
@@ -5578,8 +5578,8 @@ const N = () => {
|
|
|
5578
5578
|
return i.pattern.src;
|
|
5579
5579
|
};
|
|
5580
5580
|
if (!a())
|
|
5581
|
-
return /* @__PURE__ */ F(
|
|
5582
|
-
const n = () => i.threshold ? i.invertThreshold ? "1 ".repeat(i.threshold) + "0 ".repeat(256 - i.threshold) : "0 ".repeat(i.threshold) + "1 ".repeat(256 - i.threshold) : "", r = () => /* @__PURE__ */ F(
|
|
5581
|
+
return /* @__PURE__ */ F(Wt, {});
|
|
5582
|
+
const n = () => i.threshold ? i.invertThreshold ? "1 ".repeat(i.threshold) + "0 ".repeat(256 - i.threshold) : "0 ".repeat(i.threshold) + "1 ".repeat(256 - i.threshold) : "", r = () => /* @__PURE__ */ F(Wt, { children: i.useThreshold && /* @__PURE__ */ F("defs", { children: /* @__PURE__ */ ut("filter", { id: e, "color-interpolation-filters": "sRGB", children: [
|
|
5583
5583
|
/* @__PURE__ */ F(
|
|
5584
5584
|
"feColorMatrix",
|
|
5585
5585
|
{
|
|
@@ -5622,7 +5622,7 @@ const N = () => {
|
|
|
5622
5622
|
src: a()
|
|
5623
5623
|
}];
|
|
5624
5624
|
};
|
|
5625
|
-
return /* @__PURE__ */ ut(
|
|
5625
|
+
return /* @__PURE__ */ ut(Wt, { children: [
|
|
5626
5626
|
r(),
|
|
5627
5627
|
/* @__PURE__ */ F(
|
|
5628
5628
|
"g",
|
|
@@ -5919,7 +5919,7 @@ const Ts = (i) => {
|
|
|
5919
5919
|
if (i.curved && !i.paths || !i.fontData)
|
|
5920
5920
|
return null;
|
|
5921
5921
|
const h = () => i.textFillImage ? `url("#${s}")` : i._renderingConfiguration?.spotColors && i.fillSpotColorDefinition ? `${i.fill} ${Vn(i.fillSpotColorDefinition)}` : i.fill;
|
|
5922
|
-
return /* @__PURE__ */ ut(
|
|
5922
|
+
return /* @__PURE__ */ ut(Wt, { children: [
|
|
5923
5923
|
/* @__PURE__ */ ut("defs", { children: [
|
|
5924
5924
|
i.textFillImage && /* @__PURE__ */ F(
|
|
5925
5925
|
"pattern",
|
|
@@ -6728,7 +6728,7 @@ class ci extends $ {
|
|
|
6728
6728
|
};
|
|
6729
6729
|
}
|
|
6730
6730
|
}
|
|
6731
|
-
class
|
|
6731
|
+
class W extends $ {
|
|
6732
6732
|
/**
|
|
6733
6733
|
* @param initialParams The initial parameters to be set on this new object
|
|
6734
6734
|
* @param callback An optional callback function to be notified when the object has been instantiated
|
|
@@ -7078,7 +7078,7 @@ class wa extends $ {
|
|
|
7078
7078
|
};
|
|
7079
7079
|
}
|
|
7080
7080
|
}
|
|
7081
|
-
class
|
|
7081
|
+
class Hs extends $ {
|
|
7082
7082
|
constructor(t, e, a) {
|
|
7083
7083
|
super(), this.id = t, this.svgBody = e, this.objectURL = a;
|
|
7084
7084
|
}
|
|
@@ -7254,7 +7254,7 @@ class cn {
|
|
|
7254
7254
|
id: c.id,
|
|
7255
7255
|
region: n
|
|
7256
7256
|
},
|
|
7257
|
-
command: new
|
|
7257
|
+
command: new W(c, r)
|
|
7258
7258
|
};
|
|
7259
7259
|
} else {
|
|
7260
7260
|
const l = this.configuration.type === E.SilentIllustration ? this.configuration.data.asset?.fileLink : s, d = await ot(await (async () => new Promise((A, h) => {
|
|
@@ -7289,7 +7289,7 @@ class cn {
|
|
|
7289
7289
|
id: u.id,
|
|
7290
7290
|
region: n
|
|
7291
7291
|
},
|
|
7292
|
-
command: new
|
|
7292
|
+
command: new W(u, r)
|
|
7293
7293
|
};
|
|
7294
7294
|
}
|
|
7295
7295
|
}, this.configuration = t, this.layouts = e, this.product = a || void 0;
|
|
@@ -7313,7 +7313,7 @@ class cn {
|
|
|
7313
7313
|
return t?.startsWith("data:image/png") || t?.endsWith(".jpeg") || t?.endsWith(".jpg") || t?.endsWith(".png") ? D.Image : (t?.endsWith(".svg") || t?.startsWith("image/svg+xml"), D.Illustration);
|
|
7314
7314
|
}
|
|
7315
7315
|
}
|
|
7316
|
-
const
|
|
7316
|
+
const Ws = async (i) => {
|
|
7317
7317
|
const t = `${wt.getServicesApiUrl()}/shortener`;
|
|
7318
7318
|
try {
|
|
7319
7319
|
return (await (await nt(t, {
|
|
@@ -7400,7 +7400,7 @@ class js {
|
|
|
7400
7400
|
const c = l.toString();
|
|
7401
7401
|
if (c.length >= 2e3)
|
|
7402
7402
|
throw new Qe("Cannot create QR code, URL too long.");
|
|
7403
|
-
const d = await
|
|
7403
|
+
const d = await Ws(c);
|
|
7404
7404
|
if (!n.data || !n.data.regions)
|
|
7405
7405
|
throw new At(n, "Missing regions.");
|
|
7406
7406
|
const u = await this.regionElements(n), A = await this.command(d, u, a, n.stepName);
|
|
@@ -7424,7 +7424,7 @@ class js {
|
|
|
7424
7424
|
throw new Error("Region not found");
|
|
7425
7425
|
if (!u || !d)
|
|
7426
7426
|
throw new Error("Neither a region or layout found!");
|
|
7427
|
-
return new
|
|
7427
|
+
return new W(
|
|
7428
7428
|
{
|
|
7429
7429
|
stepRegion: d,
|
|
7430
7430
|
stepRegionIndex: c.regionIndex,
|
|
@@ -7471,7 +7471,7 @@ class De {
|
|
|
7471
7471
|
const s = e.getWorkflowExperience().getBundle();
|
|
7472
7472
|
if (s && t.globalPropertyAspectConfigurations) {
|
|
7473
7473
|
const o = s.getGlobalPropertyStateManager(), l = t.globalPropertyAspectConfigurations[0], c = o.getAspectStorage(l.aspectName);
|
|
7474
|
-
c && c.originalAssetKey && (r = (await
|
|
7474
|
+
c && c.originalAssetKey && (r = (await H.getLocalOrFromServer(c.originalAssetKey)).fileLink);
|
|
7475
7475
|
}
|
|
7476
7476
|
if (t.option) {
|
|
7477
7477
|
const o = await B.getDefaultVariant(
|
|
@@ -7571,11 +7571,11 @@ class De {
|
|
|
7571
7571
|
a.addPoller(
|
|
7572
7572
|
new di(
|
|
7573
7573
|
async () => {
|
|
7574
|
-
const d = (await
|
|
7574
|
+
const d = (await H.getFromServer(e.key || "")).versions?.find((A) => A.name === "svg");
|
|
7575
7575
|
return d ? (await nt(d.link)).status === 200 : !1;
|
|
7576
7576
|
},
|
|
7577
7577
|
() => {
|
|
7578
|
-
|
|
7578
|
+
H.getLocalOrFromServer(e.key || "").then((c) => {
|
|
7579
7579
|
this.loadPatternFromAsset(c, t, a, n).then(
|
|
7580
7580
|
l
|
|
7581
7581
|
);
|
|
@@ -7599,7 +7599,7 @@ class De {
|
|
|
7599
7599
|
s && (s.command && n.getCommandDispatcher()(s.command), s.followup && await s.followup());
|
|
7600
7600
|
}
|
|
7601
7601
|
getCreateElementCommand(t, e, a, n, r) {
|
|
7602
|
-
return new
|
|
7602
|
+
return new W(
|
|
7603
7603
|
{
|
|
7604
7604
|
id: t,
|
|
7605
7605
|
type: D.Frame,
|
|
@@ -7832,7 +7832,7 @@ class Ys {
|
|
|
7832
7832
|
});
|
|
7833
7833
|
}
|
|
7834
7834
|
getCreateElementCommand(t, e, a, n, r) {
|
|
7835
|
-
return new
|
|
7835
|
+
return new W(
|
|
7836
7836
|
{
|
|
7837
7837
|
stepRegion: e,
|
|
7838
7838
|
stepRegionIndex: a,
|
|
@@ -7935,7 +7935,7 @@ class Ys {
|
|
|
7935
7935
|
for (const d of n) {
|
|
7936
7936
|
for (const [u, A] of r.entries())
|
|
7937
7937
|
c.push(new wa(d, u, A));
|
|
7938
|
-
c.push(new
|
|
7938
|
+
c.push(new Hs(d, o, l));
|
|
7939
7939
|
}
|
|
7940
7940
|
return new U(c);
|
|
7941
7941
|
}
|
|
@@ -8256,7 +8256,7 @@ class _s {
|
|
|
8256
8256
|
return console.error(`Can not find layout for region: ${u.panelId}`), null;
|
|
8257
8257
|
const f = [];
|
|
8258
8258
|
return h && f.push(new Ot(g)), f.push(
|
|
8259
|
-
new
|
|
8259
|
+
new W(
|
|
8260
8260
|
{
|
|
8261
8261
|
stepRegion: u,
|
|
8262
8262
|
stepRegionIndex: A,
|
|
@@ -8389,7 +8389,7 @@ class Xs {
|
|
|
8389
8389
|
const p = N();
|
|
8390
8390
|
return {
|
|
8391
8391
|
regionElement: { id: p, region: u, regionIndex: A },
|
|
8392
|
-
command: new
|
|
8392
|
+
command: new W(
|
|
8393
8393
|
{
|
|
8394
8394
|
stepName: t.stepName,
|
|
8395
8395
|
stepRegion: u,
|
|
@@ -8609,7 +8609,7 @@ class to {
|
|
|
8609
8609
|
return {
|
|
8610
8610
|
id: y,
|
|
8611
8611
|
region: A,
|
|
8612
|
-
command: new
|
|
8612
|
+
command: new W(
|
|
8613
8613
|
{
|
|
8614
8614
|
stepRegion: A,
|
|
8615
8615
|
stepRegionIndex: h,
|
|
@@ -8648,7 +8648,7 @@ class to {
|
|
|
8648
8648
|
}
|
|
8649
8649
|
}
|
|
8650
8650
|
}
|
|
8651
|
-
const
|
|
8651
|
+
const Ht = new to();
|
|
8652
8652
|
class eo {
|
|
8653
8653
|
constructor() {
|
|
8654
8654
|
this.latestToast = null, this.toastType = null, this.toastCallbacks = [];
|
|
@@ -9281,7 +9281,7 @@ class io {
|
|
|
9281
9281
|
v.push(
|
|
9282
9282
|
this.generateTextChangeCommandsForRegion(R, a, b.id, T)
|
|
9283
9283
|
);
|
|
9284
|
-
const V = new
|
|
9284
|
+
const V = new W(b, p);
|
|
9285
9285
|
return {
|
|
9286
9286
|
regionElement: { id: m, region: A, regionIndex: h },
|
|
9287
9287
|
commands: [V, ...v],
|
|
@@ -9591,7 +9591,7 @@ const mo = [
|
|
|
9591
9591
|
if (!g)
|
|
9592
9592
|
throw new J(h);
|
|
9593
9593
|
const p = N();
|
|
9594
|
-
return new
|
|
9594
|
+
return new W(
|
|
9595
9595
|
{
|
|
9596
9596
|
id: p,
|
|
9597
9597
|
src: d,
|
|
@@ -9630,7 +9630,7 @@ const mo = [
|
|
|
9630
9630
|
a.data.forceImageCover
|
|
9631
9631
|
);
|
|
9632
9632
|
return [
|
|
9633
|
-
new
|
|
9633
|
+
new W(
|
|
9634
9634
|
{
|
|
9635
9635
|
id: A,
|
|
9636
9636
|
path: u.path,
|
|
@@ -9712,7 +9712,7 @@ const mo = [
|
|
|
9712
9712
|
if (!v)
|
|
9713
9713
|
throw new J(b);
|
|
9714
9714
|
const I = N();
|
|
9715
|
-
return new
|
|
9715
|
+
return new W(
|
|
9716
9716
|
{
|
|
9717
9717
|
colors: p,
|
|
9718
9718
|
id: I,
|
|
@@ -9741,7 +9741,7 @@ const mo = [
|
|
|
9741
9741
|
if (!c)
|
|
9742
9742
|
throw new J(l);
|
|
9743
9743
|
const d = N();
|
|
9744
|
-
return new
|
|
9744
|
+
return new W(
|
|
9745
9745
|
{
|
|
9746
9746
|
colors: {},
|
|
9747
9747
|
id: d,
|
|
@@ -9783,7 +9783,7 @@ const mo = [
|
|
|
9783
9783
|
if (!u)
|
|
9784
9784
|
throw new J(d);
|
|
9785
9785
|
const A = N();
|
|
9786
|
-
return new
|
|
9786
|
+
return new W(
|
|
9787
9787
|
{
|
|
9788
9788
|
id: A,
|
|
9789
9789
|
src: o,
|
|
@@ -9839,7 +9839,7 @@ const mo = [
|
|
|
9839
9839
|
/>
|
|
9840
9840
|
</svg>
|
|
9841
9841
|
`, h = { "spiff-fill-shape": { browserValue: s.color || "#000000" } }, g = N();
|
|
9842
|
-
return new
|
|
9842
|
+
return new W(
|
|
9843
9843
|
{
|
|
9844
9844
|
colors: h,
|
|
9845
9845
|
id: g,
|
|
@@ -9887,7 +9887,7 @@ const mo = [
|
|
|
9887
9887
|
excludeFromExport: t.data.excludeFromPrint,
|
|
9888
9888
|
preserveAspectRatio: "none"
|
|
9889
9889
|
};
|
|
9890
|
-
a.push(new
|
|
9890
|
+
a.push(new W(u, d));
|
|
9891
9891
|
});
|
|
9892
9892
|
} catch (c) {
|
|
9893
9893
|
console.error(c);
|
|
@@ -9922,7 +9922,7 @@ const mo = [
|
|
|
9922
9922
|
productOverlay: t.type === E.ProductOverlay ? !0 : void 0,
|
|
9923
9923
|
excludeFromExport: t.data.excludeFromPrint
|
|
9924
9924
|
};
|
|
9925
|
-
a.push(new
|
|
9925
|
+
a.push(new W(h, A));
|
|
9926
9926
|
});
|
|
9927
9927
|
}
|
|
9928
9928
|
return a;
|
|
@@ -9997,7 +9997,7 @@ const mo = [
|
|
|
9997
9997
|
}
|
|
9998
9998
|
);
|
|
9999
9999
|
n.push(
|
|
10000
|
-
new
|
|
10000
|
+
new W(
|
|
10001
10001
|
{
|
|
10002
10002
|
...y,
|
|
10003
10003
|
fontSize: w,
|
|
@@ -10008,7 +10008,7 @@ const mo = [
|
|
|
10008
10008
|
)
|
|
10009
10009
|
);
|
|
10010
10010
|
} else
|
|
10011
|
-
n.push(new
|
|
10011
|
+
n.push(new W(y, f));
|
|
10012
10012
|
}
|
|
10013
10013
|
return n;
|
|
10014
10014
|
}, bo = async (i, t, e, a) => {
|
|
@@ -10269,6 +10269,7 @@ const Vd = (i, t) => {
|
|
|
10269
10269
|
value
|
|
10270
10270
|
type
|
|
10271
10271
|
channel
|
|
10272
|
+
hidden
|
|
10272
10273
|
storage {
|
|
10273
10274
|
... on GlobalPropertyStateColorOptionStorage {
|
|
10274
10275
|
customColor
|
|
@@ -10735,7 +10736,7 @@ const Vd = (i, t) => {
|
|
|
10735
10736
|
id
|
|
10736
10737
|
}
|
|
10737
10738
|
}
|
|
10738
|
-
`,
|
|
10739
|
+
`, Ho = C`
|
|
10739
10740
|
mutation BundleAddStakeholder($id: String!, $details: CustomerDetailsInput!, $type: String!) {
|
|
10740
10741
|
bundleAddStakeholder(id: $id, details: $details, type: $type) {
|
|
10741
10742
|
id
|
|
@@ -10755,7 +10756,7 @@ const Vd = (i, t) => {
|
|
|
10755
10756
|
}
|
|
10756
10757
|
}
|
|
10757
10758
|
}
|
|
10758
|
-
`,
|
|
10759
|
+
`, Wo = C`
|
|
10759
10760
|
mutation BundleAddStakeholder($id: String!, $emailAddress: String!) {
|
|
10760
10761
|
bundleRemoveStakeholder(id: $id, emailAddress: $emailAddress) {
|
|
10761
10762
|
id
|
|
@@ -11734,7 +11735,7 @@ const ul = (i) => i.sort((t, e) => t.index - e.index).map((t) => ({
|
|
|
11734
11735
|
);
|
|
11735
11736
|
break;
|
|
11736
11737
|
case E.Shape:
|
|
11737
|
-
a.push(
|
|
11738
|
+
a.push(Ht.init(l, this, this.reloadedState));
|
|
11738
11739
|
break;
|
|
11739
11740
|
case E.Text:
|
|
11740
11741
|
a.push(j.init(l, this, this.reloadedState));
|
|
@@ -12183,7 +12184,7 @@ class Cl extends tt {
|
|
|
12183
12184
|
}
|
|
12184
12185
|
selectVariant(t) {
|
|
12185
12186
|
const e = t.getResource();
|
|
12186
|
-
return
|
|
12187
|
+
return Ht.selectVariant(
|
|
12187
12188
|
this.step,
|
|
12188
12189
|
{
|
|
12189
12190
|
fill: e.color,
|
|
@@ -12201,7 +12202,7 @@ class Cl extends tt {
|
|
|
12201
12202
|
* @deprecated The shape step can now pass through colors returned by getColors via selectVariant. Please swap setColor for selectVariant.
|
|
12202
12203
|
*/
|
|
12203
12204
|
setColor(t) {
|
|
12204
|
-
return
|
|
12205
|
+
return Ht.selectVariant(
|
|
12205
12206
|
this.step,
|
|
12206
12207
|
t,
|
|
12207
12208
|
this.manager.getRegionElements(this.step.stepName) || [],
|
|
@@ -12213,7 +12214,7 @@ class Cl extends tt {
|
|
|
12213
12214
|
* @returns A list of color definitions that are currently applied to the illustration.
|
|
12214
12215
|
*/
|
|
12215
12216
|
getColors() {
|
|
12216
|
-
return
|
|
12217
|
+
return Ht.availableColours(this.step);
|
|
12217
12218
|
}
|
|
12218
12219
|
/**
|
|
12219
12220
|
* Allows for setting a custom color when the custom variant is selected. Will
|
|
@@ -12222,7 +12223,7 @@ class Cl extends tt {
|
|
|
12222
12223
|
setCustomColor(t) {
|
|
12223
12224
|
return this.getCurrentVariant()?.getColor() !== "#custom" && console.warn(
|
|
12224
12225
|
`setting custom color for step ${this.step.stepName} but color is ${this.getCurrentVariant()?.getColor()}`
|
|
12225
|
-
),
|
|
12226
|
+
), Ht.setCustomColor(t, this.step, this.manager);
|
|
12226
12227
|
}
|
|
12227
12228
|
getCustomColor() {
|
|
12228
12229
|
this.getCurrentVariant()?.getColor() !== "#custom" && console.warn(
|
|
@@ -12748,7 +12749,7 @@ const Il = async (i, t) => {
|
|
|
12748
12749
|
let x = await o(A, n.id);
|
|
12749
12750
|
if (x) {
|
|
12750
12751
|
const v = await (await nt(x)).blob();
|
|
12751
|
-
x = (await
|
|
12752
|
+
x = (await H.uploadAsset(
|
|
12752
12753
|
{ name: `${n.id}-preview-image.png`, blob: v },
|
|
12753
12754
|
be.Image,
|
|
12754
12755
|
!0,
|
|
@@ -13709,7 +13710,7 @@ class La {
|
|
|
13709
13710
|
* @returns Whether this aspect has been marked as silent and therefore should not be displayed to the user.
|
|
13710
13711
|
*/
|
|
13711
13712
|
isSilent() {
|
|
13712
|
-
return !!this.property.silent;
|
|
13713
|
+
return !!this.property.silent || this.bundle.getGlobalPropertyStateManager().getAspectHidden(this.property.name);
|
|
13713
13714
|
}
|
|
13714
13715
|
/**
|
|
13715
13716
|
* Returns all steps that share this property.
|
|
@@ -13797,7 +13798,7 @@ class Rl extends La {
|
|
|
13797
13798
|
const e = await this.getOriginalImage();
|
|
13798
13799
|
if (!e)
|
|
13799
13800
|
throw new Error("You must supply an image selection before attempting to remove the background.");
|
|
13800
|
-
const a = this.bundle.getGlobalPropertyStateManager(), n = await
|
|
13801
|
+
const a = this.bundle.getGlobalPropertyStateManager(), n = await H.removeBackgroundFromAsset(e), s = {
|
|
13801
13802
|
...a.getAspectStorage(this.property.name),
|
|
13802
13803
|
backgroundRemovedAssetKey: n.key,
|
|
13803
13804
|
useOriginalAsset: !t
|
|
@@ -13818,7 +13819,7 @@ class Rl extends La {
|
|
|
13818
13819
|
const e = await this.getOriginalImage();
|
|
13819
13820
|
if (!e)
|
|
13820
13821
|
throw new Error("You must supply an image selection before attempting to vectorize the image.");
|
|
13821
|
-
const a = this.bundle.getGlobalPropertyStateManager(), n = await
|
|
13822
|
+
const a = this.bundle.getGlobalPropertyStateManager(), n = await H.vectorizeAsset(e), s = {
|
|
13822
13823
|
...a.getAspectStorage(this.property.name),
|
|
13823
13824
|
vectorizedAssetKey: n.key,
|
|
13824
13825
|
useOriginalAsset: !t
|
|
@@ -13838,7 +13839,7 @@ class Rl extends La {
|
|
|
13838
13839
|
async getImage() {
|
|
13839
13840
|
const t = this.getStateValue();
|
|
13840
13841
|
if (t)
|
|
13841
|
-
return
|
|
13842
|
+
return H.getLocalOrFromServer(t);
|
|
13842
13843
|
}
|
|
13843
13844
|
async getImageWithColors() {
|
|
13844
13845
|
return await this.loadImageData(), this.imageData?.svg ? Pa(Ma(this.imageData.svg, this.imageData.colors ?? {}, !1)) : this.imageData?.src;
|
|
@@ -13850,7 +13851,7 @@ class Rl extends La {
|
|
|
13850
13851
|
async getOriginalImage() {
|
|
13851
13852
|
const t = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
|
|
13852
13853
|
if (t?.originalAssetKey)
|
|
13853
|
-
return
|
|
13854
|
+
return H.getLocalOrFromServer(t.originalAssetKey);
|
|
13854
13855
|
}
|
|
13855
13856
|
/**
|
|
13856
13857
|
* Retrieves the version of the image selection that has the background removed, if one exists.
|
|
@@ -13859,7 +13860,7 @@ class Rl extends La {
|
|
|
13859
13860
|
async getBackgroundRemovedImage() {
|
|
13860
13861
|
const t = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
|
|
13861
13862
|
if (t?.backgroundRemovedAssetKey)
|
|
13862
|
-
return
|
|
13863
|
+
return H.getLocalOrFromServer(t.backgroundRemovedAssetKey);
|
|
13863
13864
|
}
|
|
13864
13865
|
getUseOriginalImage() {
|
|
13865
13866
|
return this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name)?.useOriginalAsset ?? !1;
|
|
@@ -13893,7 +13894,7 @@ class Rl extends La {
|
|
|
13893
13894
|
async applyGlobalState(t) {
|
|
13894
13895
|
const e = this.getStateValue();
|
|
13895
13896
|
if (!e) return;
|
|
13896
|
-
const a = await
|
|
13897
|
+
const a = await H.getLocalOrFromServer(e);
|
|
13897
13898
|
if (!a) return;
|
|
13898
13899
|
await this.applyImageSelection(a, t, !1, !0);
|
|
13899
13900
|
const n = this.bundle.getGlobalPropertyStateManager().getAspectStorage(this.property.name);
|
|
@@ -14236,6 +14237,11 @@ class ql {
|
|
|
14236
14237
|
getAspectMandatoryFulfilled(t) {
|
|
14237
14238
|
return this.mandatoryFulfilledAspects.get(t);
|
|
14238
14239
|
}
|
|
14240
|
+
getAspectHidden(t) {
|
|
14241
|
+
if (!this.globalPropertyState)
|
|
14242
|
+
throw new Error("Global property state not initialized");
|
|
14243
|
+
return !!this.globalPropertyState.aspects.find((e) => e.name === t)?.hidden;
|
|
14244
|
+
}
|
|
14239
14245
|
getAspect(t, e) {
|
|
14240
14246
|
if (!this.globalPropertyState)
|
|
14241
14247
|
throw new Error("Global property state not initialized");
|
|
@@ -14248,49 +14254,52 @@ class ql {
|
|
|
14248
14254
|
throw new Error("Global property state not initialized");
|
|
14249
14255
|
return this.globalPropertyState.aspects.find((a) => a.name === t && a.channel === e)?.storage;
|
|
14250
14256
|
}
|
|
14251
|
-
async setAspect(t, e, a, n) {
|
|
14257
|
+
async setAspect(t, e, a, n, r) {
|
|
14252
14258
|
if (!this.globalPropertyState)
|
|
14253
14259
|
throw new Error("Global property state not initialized");
|
|
14254
14260
|
if (!this.configuration)
|
|
14255
14261
|
throw new Error("Global property configuration not linked to the state manager.");
|
|
14256
|
-
const
|
|
14257
|
-
if (!
|
|
14262
|
+
const s = this.configuration.aspects.find((c) => c.name === t);
|
|
14263
|
+
if (!s)
|
|
14258
14264
|
throw new Error(`Failed to find configuration aspect with name: ${t}`);
|
|
14259
14265
|
this.mandatoryFulfilledAspects.set(t, e !== "");
|
|
14260
|
-
const
|
|
14261
|
-
if (
|
|
14266
|
+
const o = It(this.globalPropertyState), l = this.globalPropertyState.aspects.filter((c) => c.name === t);
|
|
14267
|
+
if (l.length > 0)
|
|
14262
14268
|
if (n) {
|
|
14263
|
-
const
|
|
14264
|
-
if (
|
|
14265
|
-
|
|
14269
|
+
const c = l.find((d) => d.channel === n);
|
|
14270
|
+
if (c)
|
|
14271
|
+
c.value = e, c.type = s.type, c.channel = n, c.hidden = r ?? c.hidden, a !== void 0 && (c.storage = a !== null ? a : void 0);
|
|
14266
14272
|
else {
|
|
14273
|
+
let d;
|
|
14267
14274
|
if (n === 1) {
|
|
14268
|
-
const
|
|
14269
|
-
(
|
|
14275
|
+
const u = this.globalPropertyState.aspects.findIndex(
|
|
14276
|
+
(A) => !A.channel && A.name === t
|
|
14270
14277
|
);
|
|
14271
|
-
|
|
14278
|
+
u && u > 0 && (d = this.globalPropertyState.aspects.splice(u, 1)[0].hidden);
|
|
14272
14279
|
}
|
|
14273
14280
|
this.globalPropertyState.aspects.push({
|
|
14274
14281
|
name: t,
|
|
14275
14282
|
value: e,
|
|
14276
|
-
type:
|
|
14283
|
+
type: s.type,
|
|
14277
14284
|
storage: a !== null ? a : void 0,
|
|
14278
|
-
channel: n
|
|
14285
|
+
channel: n,
|
|
14286
|
+
hidden: r ?? d
|
|
14279
14287
|
});
|
|
14280
14288
|
}
|
|
14281
14289
|
} else {
|
|
14282
|
-
const
|
|
14283
|
-
|
|
14290
|
+
const c = l[0];
|
|
14291
|
+
c.value = e, c.type = s.type, c.hidden = r ?? c.hidden, a !== void 0 && (c.storage = a !== null ? a : void 0);
|
|
14284
14292
|
}
|
|
14285
14293
|
else
|
|
14286
14294
|
this.globalPropertyState.aspects.push({
|
|
14287
14295
|
name: t,
|
|
14288
14296
|
value: e,
|
|
14289
|
-
type:
|
|
14297
|
+
type: s.type,
|
|
14290
14298
|
storage: a !== null ? a : void 0,
|
|
14291
|
-
channel: n
|
|
14299
|
+
channel: n,
|
|
14300
|
+
hidden: r
|
|
14292
14301
|
});
|
|
14293
|
-
Kt(
|
|
14302
|
+
Kt(o, this.globalPropertyState) || (this.queueGlobalPropertyStateUpdate(), await this.onGlobalPropertyStateChange(o, this.globalPropertyState));
|
|
14294
14303
|
}
|
|
14295
14304
|
async setAspectStorage(t, e, a) {
|
|
14296
14305
|
if (!this.globalPropertyState)
|
|
@@ -14355,7 +14364,8 @@ class ql {
|
|
|
14355
14364
|
value: e.value,
|
|
14356
14365
|
type: e.type,
|
|
14357
14366
|
storage: a,
|
|
14358
|
-
channel: e.channel
|
|
14367
|
+
channel: e.channel,
|
|
14368
|
+
hidden: e.hidden
|
|
14359
14369
|
};
|
|
14360
14370
|
})
|
|
14361
14371
|
},
|
|
@@ -14386,7 +14396,7 @@ class ql {
|
|
|
14386
14396
|
throw new Error(`Unable to create global property state for bundle: ${this.bundleId}`);
|
|
14387
14397
|
}
|
|
14388
14398
|
}
|
|
14389
|
-
class
|
|
14399
|
+
class Hl {
|
|
14390
14400
|
constructor(t) {
|
|
14391
14401
|
this.setState(t || '{"transactions": []}');
|
|
14392
14402
|
}
|
|
@@ -14412,7 +14422,7 @@ class Wl {
|
|
|
14412
14422
|
a === e ? delete t[a] : this.deleteFieldNameFromObjectRecursive(t[a], e);
|
|
14413
14423
|
}
|
|
14414
14424
|
}
|
|
14415
|
-
const
|
|
14425
|
+
const Wl = C`
|
|
14416
14426
|
query GetManyMetafields($entityIds: [String!]!) {
|
|
14417
14427
|
metafieldsMany(entityIds: $entityIds) {
|
|
14418
14428
|
id
|
|
@@ -14446,7 +14456,7 @@ class jl {
|
|
|
14446
14456
|
async ensureIdsArePresent(t) {
|
|
14447
14457
|
if (t.every((a) => this.internalMap.has(a))) return;
|
|
14448
14458
|
const e = await S.getShadowGraphqlClient().query({
|
|
14449
|
-
query:
|
|
14459
|
+
query: Wl,
|
|
14450
14460
|
errorPolicy: "all",
|
|
14451
14461
|
variables: {
|
|
14452
14462
|
entityIds: t.filter((a) => !this.internalMap.has(a))
|
|
@@ -14903,7 +14913,7 @@ const _l = C`
|
|
|
14903
14913
|
`;
|
|
14904
14914
|
class pn {
|
|
14905
14915
|
constructor(t, e, a, n, r, s, o) {
|
|
14906
|
-
this.workflowExperiences = [], this.eventEmitter = new Kl(), 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((c) => [c.key, c.value]) || []), this.completed = e.completed ?? !1, this.productCollection = e.productCollection, this.bundleStateManager = new
|
|
14916
|
+
this.workflowExperiences = [], this.eventEmitter = new Kl(), 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((c) => [c.key, c.value]) || []), this.completed = e.completed ?? !1, this.productCollection = e.productCollection, this.bundleStateManager = new Hl(e.bundleStateData);
|
|
14907
14917
|
const l = this.productCollection?.globalPropertyConfiguration;
|
|
14908
14918
|
this.globalConfigurationPropertyId = l?.id, this.globalPropertyStateManager = new ql(
|
|
14909
14919
|
this.id,
|
|
@@ -15148,7 +15158,13 @@ class pn {
|
|
|
15148
15158
|
try {
|
|
15149
15159
|
for (const a of t.aspects) {
|
|
15150
15160
|
const n = a?.name;
|
|
15151
|
-
await this.getGlobalPropertyStateManager().setAspect(
|
|
15161
|
+
await this.getGlobalPropertyStateManager().setAspect(
|
|
15162
|
+
n,
|
|
15163
|
+
a.value,
|
|
15164
|
+
void 0,
|
|
15165
|
+
void 0,
|
|
15166
|
+
a.hidden
|
|
15167
|
+
);
|
|
15152
15168
|
}
|
|
15153
15169
|
for (const a of t.aspects) {
|
|
15154
15170
|
const n = a?.name, r = e.find((s) => s.getName() === n);
|
|
@@ -15398,7 +15414,7 @@ class pn {
|
|
|
15398
15414
|
}
|
|
15399
15415
|
async addStakeholder(t, e) {
|
|
15400
15416
|
const a = await S.getShadowGraphqlClient().mutate({
|
|
15401
|
-
mutation:
|
|
15417
|
+
mutation: Ho,
|
|
15402
15418
|
variables: {
|
|
15403
15419
|
id: this.id,
|
|
15404
15420
|
details: t,
|
|
@@ -15414,7 +15430,7 @@ class pn {
|
|
|
15414
15430
|
}
|
|
15415
15431
|
async removeStakeholder(t) {
|
|
15416
15432
|
if (!(await S.getShadowGraphqlClient().mutate({
|
|
15417
|
-
mutation:
|
|
15433
|
+
mutation: Wo,
|
|
15418
15434
|
variables: {
|
|
15419
15435
|
id: this.id,
|
|
15420
15436
|
emailAddress: t
|
|
@@ -15899,7 +15915,7 @@ class bi extends za {
|
|
|
15899
15915
|
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);
|
|
15900
15916
|
}
|
|
15901
15917
|
}
|
|
15902
|
-
class
|
|
15918
|
+
class Hd extends za {
|
|
15903
15919
|
constructor(t) {
|
|
15904
15920
|
super(`[${t.map((e) => e.getRaw()).join(",")}]`);
|
|
15905
15921
|
}
|
|
@@ -16092,7 +16108,7 @@ class lc {
|
|
|
16092
16108
|
}
|
|
16093
16109
|
async generateCode(t) {
|
|
16094
16110
|
const e = await this.cognitoClient?.send(
|
|
16095
|
-
new
|
|
16111
|
+
new Ha({
|
|
16096
16112
|
AuthFlow: "CUSTOM_AUTH",
|
|
16097
16113
|
ClientId: this.userPoolClientId,
|
|
16098
16114
|
AuthParameters: {
|
|
@@ -16104,7 +16120,7 @@ class lc {
|
|
|
16104
16120
|
}
|
|
16105
16121
|
async verifyCode(t, e, a) {
|
|
16106
16122
|
const n = await this.cognitoClient?.send(
|
|
16107
|
-
new
|
|
16123
|
+
new Hi({
|
|
16108
16124
|
ClientId: this.userPoolClientId,
|
|
16109
16125
|
ChallengeName: "CUSTOM_CHALLENGE",
|
|
16110
16126
|
Session: this.challengeSession,
|
|
@@ -16126,7 +16142,7 @@ class lc {
|
|
|
16126
16142
|
throw new Error("Failed to find existing tokens.");
|
|
16127
16143
|
const e = JSON.parse(t);
|
|
16128
16144
|
return await this.cognitoClient?.send(
|
|
16129
|
-
new
|
|
16145
|
+
new Ha({
|
|
16130
16146
|
AuthFlow: "REFRESH_TOKEN_AUTH",
|
|
16131
16147
|
ClientId: this.userPoolClientId,
|
|
16132
16148
|
AuthParameters: {
|
|
@@ -16149,14 +16165,14 @@ class cc {
|
|
|
16149
16165
|
currency: t,
|
|
16150
16166
|
precision: this.getPrecisionForCurrency(t)
|
|
16151
16167
|
};
|
|
16152
|
-
return
|
|
16168
|
+
return Wi(a).toFormat(this.getSpecialFormat(t));
|
|
16153
16169
|
}
|
|
16154
16170
|
/**
|
|
16155
16171
|
* Get the number of decimal places expected in a currency string.
|
|
16156
16172
|
* @param currency The currency to determine precision for.
|
|
16157
16173
|
*/
|
|
16158
16174
|
getPrecisionForCurrency(t) {
|
|
16159
|
-
const e = t, a =
|
|
16175
|
+
const e = t, a = Wa.code(e);
|
|
16160
16176
|
return a ? a.digits : 2;
|
|
16161
16177
|
}
|
|
16162
16178
|
/**
|
|
@@ -16167,7 +16183,7 @@ class cc {
|
|
|
16167
16183
|
*/
|
|
16168
16184
|
getSpecialFormat(t) {
|
|
16169
16185
|
const e = t;
|
|
16170
|
-
if (
|
|
16186
|
+
if (Wa.code(e)?.code === "CLP")
|
|
16171
16187
|
return "USD0,0";
|
|
16172
16188
|
}
|
|
16173
16189
|
}
|
|
@@ -16254,7 +16270,7 @@ const uc = async (i, t) => {
|
|
|
16254
16270
|
});
|
|
16255
16271
|
return t.errors && console.error(t.errors), t.data.integrationProducts || [];
|
|
16256
16272
|
};
|
|
16257
|
-
class
|
|
16273
|
+
class Wd {
|
|
16258
16274
|
constructor(t) {
|
|
16259
16275
|
this.activeIntegration = void 0, this.updateTransactionState = async (e) => {
|
|
16260
16276
|
try {
|
|
@@ -16265,7 +16281,7 @@ class Hd {
|
|
|
16265
16281
|
} catch (a) {
|
|
16266
16282
|
throw console.error(a), new pt("Critical - Unable to synchronize workflow state with server.");
|
|
16267
16283
|
}
|
|
16268
|
-
}, this.options = t, this.options.applicationKey && Ar(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 40.0
|
|
16284
|
+
}, this.options = t, this.options.applicationKey && Ar(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 40.1.0"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
|
|
16269
16285
|
}
|
|
16270
16286
|
configure(t) {
|
|
16271
16287
|
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 && gr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Gt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
|
|
@@ -16275,7 +16291,7 @@ class Hd {
|
|
|
16275
16291
|
* and the Spiff Commerce platform.
|
|
16276
16292
|
*/
|
|
16277
16293
|
getAssetManager() {
|
|
16278
|
-
return
|
|
16294
|
+
return H;
|
|
16279
16295
|
}
|
|
16280
16296
|
/**
|
|
16281
16297
|
* @returns A promise that resolves with a boolean indicating whether to use beta features.
|
|
@@ -16723,9 +16739,9 @@ class Hd {
|
|
|
16723
16739
|
}
|
|
16724
16740
|
const oe = Q.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map();
|
|
16725
16741
|
!oe.get(T.id) && T.transactionOwnerId && (oe.set(T.id, T.transactionOwnerId), Q.setMap("transactionOwnerIds", oe));
|
|
16726
|
-
const
|
|
16727
|
-
onMutate: () => ({ context: { transactionOwnerId:
|
|
16728
|
-
onQuery: () => ({ context: { transactionOwnerId:
|
|
16742
|
+
const He = oe.get(T.id) || void 0, Di = new oc({
|
|
16743
|
+
onMutate: () => ({ context: { transactionOwnerId: He, bundleOwnerId: e?.bundleOwnerId } }),
|
|
16744
|
+
onQuery: () => ({ context: { transactionOwnerId: He, bundleOwnerId: e?.bundleOwnerId } })
|
|
16729
16745
|
}), le = {
|
|
16730
16746
|
workflow: Et,
|
|
16731
16747
|
transaction: T,
|
|
@@ -16734,7 +16750,7 @@ class Hd {
|
|
|
16734
16750
|
throw new O("State mutation is forbidden in read only mode!");
|
|
16735
16751
|
} : async (it) => this.updateTransactionState({
|
|
16736
16752
|
...it,
|
|
16737
|
-
context: { transactionOwnerId:
|
|
16753
|
+
context: { transactionOwnerId: He, bundleOwnerId: e?.bundleOwnerId }
|
|
16738
16754
|
}),
|
|
16739
16755
|
graphQlClient: () => Di,
|
|
16740
16756
|
readOnly: k,
|
|
@@ -17389,7 +17405,7 @@ class yc extends tt {
|
|
|
17389
17405
|
const e = await this.getOriginalImageSelection();
|
|
17390
17406
|
if (!e)
|
|
17391
17407
|
throw new Error("You must supply an image selection before attempting to remove the background.");
|
|
17392
|
-
const a = await
|
|
17408
|
+
const a = await H.removeBackgroundFromAsset(e);
|
|
17393
17409
|
t && await bt.selectImage(this.step, a, this.manager, !1);
|
|
17394
17410
|
const n = this.manager.getStepStorage(this.step.stepName)?.framePatternData || {};
|
|
17395
17411
|
return this.manager.updateStorage(this.step.stepName, {
|
|
@@ -17409,7 +17425,7 @@ class yc extends tt {
|
|
|
17409
17425
|
const a = t ?? await this.getOriginalImageSelection();
|
|
17410
17426
|
if (!a)
|
|
17411
17427
|
throw new Error("You must supply an image selection before attempting to vectorize the image.");
|
|
17412
|
-
const n = await
|
|
17428
|
+
const n = await H.vectorizeAsset(a, e);
|
|
17413
17429
|
await this.selectImage(n, t !== void 0);
|
|
17414
17430
|
const r = this.manager.getStepStorage(this.step.stepName)?.framePatternData || {};
|
|
17415
17431
|
return this.manager.updateStorage(this.step.stepName, {
|
|
@@ -17423,12 +17439,12 @@ class yc extends tt {
|
|
|
17423
17439
|
async getBackgroundRemovedImageSelection() {
|
|
17424
17440
|
const t = this.manager.getStepStorage(this.step.stepName)?.framePatternData?.backgroundRemovedAssetKey;
|
|
17425
17441
|
if (t)
|
|
17426
|
-
return
|
|
17442
|
+
return H.getLocalOrFromServer(t);
|
|
17427
17443
|
}
|
|
17428
17444
|
async getVectorizedImageSelection() {
|
|
17429
17445
|
const t = this.manager.getStepStorage(this.step.stepName)?.framePatternData?.vectorizedAssetKey;
|
|
17430
17446
|
if (t)
|
|
17431
|
-
return
|
|
17447
|
+
return H.getLocalOrFromServer(t);
|
|
17432
17448
|
}
|
|
17433
17449
|
hasOriginalImageSelection() {
|
|
17434
17450
|
return !!this.manager.getStepStorage(this.step.stepName)?.framePatternData?.originalAssetKey;
|
|
@@ -17492,7 +17508,7 @@ class yc extends tt {
|
|
|
17492
17508
|
async getOriginalImageSelection() {
|
|
17493
17509
|
const t = this.manager.getStepStorage(this.step.stepName)?.framePatternData?.originalAssetKey;
|
|
17494
17510
|
if (t)
|
|
17495
|
-
return
|
|
17511
|
+
return H.getLocalOrFromServer(t);
|
|
17496
17512
|
}
|
|
17497
17513
|
getUseOriginalImageSelection() {
|
|
17498
17514
|
return this.getFrameStepStorage()?.framePatternData?.useOriginalAsset ?? !1;
|
|
@@ -17995,7 +18011,7 @@ export {
|
|
|
17995
18011
|
$c as AddressValidationJobStatus,
|
|
17996
18012
|
Rc as AddressValidationResultConfirmationLevel,
|
|
17997
18013
|
Dn as AddressValidationStatus,
|
|
17998
|
-
|
|
18014
|
+
Hd as ArrayInput,
|
|
17999
18015
|
z as AspectType,
|
|
18000
18016
|
Bt as AssetNotFoundError,
|
|
18001
18017
|
be as AssetType,
|
|
@@ -18009,7 +18025,7 @@ export {
|
|
|
18009
18025
|
Rs as CommandContext,
|
|
18010
18026
|
ve as ConversionDataType,
|
|
18011
18027
|
xc as ConversionLocation,
|
|
18012
|
-
|
|
18028
|
+
W as CreateElementCommand,
|
|
18013
18029
|
ci as CreateLayoutCommand,
|
|
18014
18030
|
dc as CurrencyContext,
|
|
18015
18031
|
cc as CurrencyService,
|
|
@@ -18064,7 +18080,7 @@ export {
|
|
|
18064
18080
|
Ud as SendBackwardsCommand,
|
|
18065
18081
|
Cl as ShapeStepHandle,
|
|
18066
18082
|
_i as ShareActionType,
|
|
18067
|
-
|
|
18083
|
+
Wd as SpiffCommerceClient,
|
|
18068
18084
|
kn as StakeholderType,
|
|
18069
18085
|
Ji as StepAspectType,
|
|
18070
18086
|
tt as StepHandle,
|
|
@@ -18081,7 +18097,7 @@ export {
|
|
|
18081
18097
|
Sa as WorkflowExperienceEventType,
|
|
18082
18098
|
Tl as WorkflowExperienceImpl,
|
|
18083
18099
|
Vl as amtChannelsForAspect,
|
|
18084
|
-
|
|
18100
|
+
H as assetService,
|
|
18085
18101
|
Br as browserColorToHex,
|
|
18086
18102
|
xd as cmPerPixel,
|
|
18087
18103
|
Bd as currentDirection,
|
|
@@ -18164,8 +18180,8 @@ export {
|
|
|
18164
18180
|
Da as sanitizeSvgTree,
|
|
18165
18181
|
gr as setBearerAuthenticationToken,
|
|
18166
18182
|
$n as setCanvasModule,
|
|
18167
|
-
|
|
18168
|
-
|
|
18183
|
+
Ht as shapeStepService,
|
|
18184
|
+
Ws as shortenUrl,
|
|
18169
18185
|
wt as spiffCoreConfiguration,
|
|
18170
18186
|
Vd as stepAspectValuesToDesignInputSteps,
|
|
18171
18187
|
Xa as svgColorValueToDefinition,
|