@spiffcommerce/core 21.14.0-alpha.1 → 21.14.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/dist/index.d.ts +1 -9
- package/dist/index.js +149 -158
- package/dist/index.umd.cjs +17 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHttpLink as IA, InMemoryCache as fA, ApolloClient as DA, from as FA, gql as D } from "@apollo/client/core";
|
|
2
|
-
import { fetch as et, getAttributesFromArrayBuffer as
|
|
3
|
-
import { AspectType as es, AssetType as ts, BringForwardCommand as As, BringToBackCommand as as, BringToFrontCommand as ns, CanvasCommand as is, CommandContext as ss, CreateElementCommand as os, CreateLayoutCommand as rs, DeleteElementCommand as cs, FontAlignmentCommand as gs, FontColorCommand as ls, FontSizeCommand as Bs, FontSourceCommand as ds, GroupCommand as ws, LayoutElementFactory as hs, LayoutElementType as Es, MoveCommand as us, ResizeCommand as Cs, RotateCommand as Qs, SendBackwardsCommand as ms, StepAspectType as ps, StepType as Is, TextChangeCommand as fs, UnitOfMeasurement as Ds, UpdateImageSourceCommand as Fs, dataUrlFromExternalUrl as ys, determineCorrectFontSizeAndLines as Ms, findElement as Ss, frameDataCache as Ys, generate as Ps, generateSVGWithUnknownColors as xs, getAttributesFromArrayBuffer as Ns, getAxisAlignedBoundingBox as
|
|
2
|
+
import { fetch as et, getAttributesFromArrayBuffer as Rt, AssetType as ut, StepType as y, getFrameData as tt, frameDataCache as yA, GroupCommand as v, UpdateFramePattern as Ht, UpdateFrameThresholdSettingsCommand as MA, calculateOffsets as At, LayoutElementType as k, generate as J, CreateElementCommand as L, generateSVGWithUnknownColors as Ut, svgObjectURL as Pe, fetchAsString as _, DeleteElementCommand as ee, generateDefaultRectangleFrameSvg as Ct, GetSVGDimensions as SA, patternImageDataCache as Qt, fetchAsArrayBuffer as YA, findElement as xe, modifySVGWithElementProperties as PA, IllustrationColorCommand as We, IllustrationCacheCommand as xA, getFontMetrics as NA, getPatternImageData as Xe, FontAlignmentCommand as RA, FontColorCommand as HA, FontImageFillCommand as Oe, applyTextTransformations as qe, determineCorrectFontSizeAndLines as Me, FontSourceCommand as mt, loadFont as at, TextChangeCommand as UA, FontSizeCommand as vA, createElementNS as GA, createElement as Qe, _loadFontExternalDataURL as nt, UpdateWorkflowStateCommand as pt, CommandContext as kA, createCanvas as Ne, getSvgElement as vt, LayoutRenderingPurpose as Gt, renderPapyrusComponentAsString as kt, loadImage as bt, getDomParser as Jt, toBase64 as It, getVariant as bA, generateFrameSVG as JA, getDefaultVariant as be, domParser as Tt, sanitizeSvgTree as Lt, traverse as TA, xmlSerializer as Ot, CreateLayoutCommand as LA, AspectType as Be, rehydrateSerializedLayout as Ae } from "@spiffcommerce/papyrus";
|
|
3
|
+
import { AspectType as es, AssetType as ts, BringForwardCommand as As, BringToBackCommand as as, BringToFrontCommand as ns, CanvasCommand as is, CommandContext as ss, CreateElementCommand as os, CreateLayoutCommand as rs, DeleteElementCommand as cs, FontAlignmentCommand as gs, FontColorCommand as ls, FontSizeCommand as Bs, FontSourceCommand as ds, GroupCommand as ws, LayoutElementFactory as hs, LayoutElementType as Es, MoveCommand as us, ResizeCommand as Cs, RotateCommand as Qs, SendBackwardsCommand as ms, StepAspectType as ps, StepType as Is, TextChangeCommand as fs, UnitOfMeasurement as Ds, UpdateImageSourceCommand as Fs, dataUrlFromExternalUrl as ys, determineCorrectFontSizeAndLines as Ms, findElement as Ss, frameDataCache as Ys, generate as Ps, generateSVGWithUnknownColors as xs, getAttributesFromArrayBuffer as Ns, getAxisAlignedBoundingBox as Rs, getFrameData as Hs, getSvgElement as Us, loadFont as vs, patternImageDataCache as Gs, registerFetchImplementation as ks, registerWindowImplementation as bs, rehydrateSerializedLayout as Js, setCanvasModule as Ts } from "@spiffcommerce/papyrus";
|
|
4
4
|
import { setContext as OA } from "@apollo/client/link/context";
|
|
5
5
|
import { onError as zA } from "@apollo/client/link/error";
|
|
6
6
|
import { Pith as zt } from "pith";
|
|
@@ -21,7 +21,7 @@ class ue extends Wt {
|
|
|
21
21
|
super(`ConfigurationError - ${e}`);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
class
|
|
24
|
+
class Re extends ue {
|
|
25
25
|
constructor(e) {
|
|
26
26
|
super(`Option not Configured: ${e.stepTitle}`), this.optionId = (e == null ? void 0 : e.optionId) || "N/A";
|
|
27
27
|
}
|
|
@@ -41,7 +41,7 @@ class he extends ue {
|
|
|
41
41
|
super(`Resource not found for asset: ${e.name}`), this.asset = e;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
class
|
|
44
|
+
class He extends ue {
|
|
45
45
|
constructor(e, t) {
|
|
46
46
|
super(`Workflow Misconfiguration: ${e.stepName} - ${t}`), this.step = e;
|
|
47
47
|
}
|
|
@@ -66,7 +66,7 @@ class U extends Je {
|
|
|
66
66
|
super(`Client Error: ${e}`);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
class
|
|
69
|
+
class Te extends Je {
|
|
70
70
|
constructor(e) {
|
|
71
71
|
super(`Resource Generation Failed: ${e}`);
|
|
72
72
|
}
|
|
@@ -388,7 +388,7 @@ const x = new $A(), _A = D`
|
|
|
388
388
|
class sa {
|
|
389
389
|
constructor() {
|
|
390
390
|
this.cache = /* @__PURE__ */ new Map(), this.bgrmProcessCache = /* @__PURE__ */ new Map(), this.materialCache = /* @__PURE__ */ new Map(), this.loadImageAsFileInfo = async (e) => {
|
|
391
|
-
const t = await e.arrayBuffer(), A = await
|
|
391
|
+
const t = await e.arrayBuffer(), A = await Rt(t), a = (n, i) => {
|
|
392
392
|
const s = atob(n.split(",")[1]), o = [];
|
|
393
393
|
for (let r = 0; r < s.length; r++)
|
|
394
394
|
o.push(s.charCodeAt(r));
|
|
@@ -1653,7 +1653,7 @@ class Ya {
|
|
|
1653
1653
|
n.forEach((o, r) => {
|
|
1654
1654
|
s(
|
|
1655
1655
|
new v([
|
|
1656
|
-
new
|
|
1656
|
+
new Ht(o, t, e[r]),
|
|
1657
1657
|
new MA(
|
|
1658
1658
|
o,
|
|
1659
1659
|
a.useThreshold,
|
|
@@ -1701,7 +1701,7 @@ class St {
|
|
|
1701
1701
|
if (this.configuration.type === y.ProductOverlay) {
|
|
1702
1702
|
let l = "";
|
|
1703
1703
|
if ((o = this.product) != null && o.overlayImageUrl && (l = this.product.overlayImageUrl), i = l, !l)
|
|
1704
|
-
throw new
|
|
1704
|
+
throw new He(this.configuration, "Couldn't find an asset for product overlay step");
|
|
1705
1705
|
}
|
|
1706
1706
|
const s = this.evaluateAssetType();
|
|
1707
1707
|
if (s === k.Image) {
|
|
@@ -1730,7 +1730,7 @@ class St {
|
|
|
1730
1730
|
id: d.id,
|
|
1731
1731
|
region: a
|
|
1732
1732
|
},
|
|
1733
|
-
command: new
|
|
1733
|
+
command: new L(d, n)
|
|
1734
1734
|
};
|
|
1735
1735
|
} else {
|
|
1736
1736
|
const l = this.configuration.type === y.SilentIllustration ? (B = this.configuration.data.asset) == null ? void 0 : B.fileLink : i, w = await Ut(await (async () => new Promise((h, u) => {
|
|
@@ -1765,14 +1765,14 @@ class St {
|
|
|
1765
1765
|
id: E.id,
|
|
1766
1766
|
region: a
|
|
1767
1767
|
},
|
|
1768
|
-
command: new
|
|
1768
|
+
command: new L(E, n)
|
|
1769
1769
|
};
|
|
1770
1770
|
}
|
|
1771
1771
|
}, this.configuration = e, this.layouts = t, this.product = A || void 0;
|
|
1772
1772
|
}
|
|
1773
1773
|
async trigger() {
|
|
1774
1774
|
if (!this.configuration.data.regions)
|
|
1775
|
-
throw new
|
|
1775
|
+
throw new He(this.configuration, "Missing regions.");
|
|
1776
1776
|
if (this.configuration.type === y.SilentIllustration) {
|
|
1777
1777
|
const e = this.configuration.data.regions.map(this.processRegion);
|
|
1778
1778
|
return Promise.all(e);
|
|
@@ -1802,7 +1802,7 @@ const Pa = async (c) => {
|
|
|
1802
1802
|
}
|
|
1803
1803
|
})).json()).shortUrl;
|
|
1804
1804
|
} catch (t) {
|
|
1805
|
-
throw console.error(t), new
|
|
1805
|
+
throw console.error(t), new Te("Failed to shorten URL, see console.");
|
|
1806
1806
|
}
|
|
1807
1807
|
};
|
|
1808
1808
|
class aA {
|
|
@@ -1876,10 +1876,10 @@ class xa {
|
|
|
1876
1876
|
d.searchParams.append("video", btoa(JSON.stringify([B]))), d.pathname = d.pathname + (d.pathname.slice(-1) === "/" ? "" : "/");
|
|
1877
1877
|
const w = d.toString();
|
|
1878
1878
|
if (w.length >= 2e3)
|
|
1879
|
-
throw new
|
|
1879
|
+
throw new Te("Cannot create QR code, URL too long.");
|
|
1880
1880
|
const E = await Pa(w);
|
|
1881
1881
|
if (s(E), !i.data || !i.data.regions)
|
|
1882
|
-
throw new
|
|
1882
|
+
throw new He(i, "Missing regions.");
|
|
1883
1883
|
const h = await this.regionElements(i), u = await this.command(E, h, n, i.stepName);
|
|
1884
1884
|
u && (u.command && n.getCommandDispatcher()(u.command), u.followup && await u.followup()), await n.setSelectionsAndElements(i.stepName, [], h, async () => {
|
|
1885
1885
|
n.updateStorage(i.stepName, {
|
|
@@ -1903,7 +1903,7 @@ class xa {
|
|
|
1903
1903
|
throw new Error("Region not found");
|
|
1904
1904
|
if (!B || !g)
|
|
1905
1905
|
throw new Error("Neither a region or layout found!");
|
|
1906
|
-
return new
|
|
1906
|
+
return new L(
|
|
1907
1907
|
{
|
|
1908
1908
|
stepRegion: g,
|
|
1909
1909
|
stepName: a,
|
|
@@ -1924,7 +1924,7 @@ class xa {
|
|
|
1924
1924
|
}
|
|
1925
1925
|
}
|
|
1926
1926
|
const Na = new xa();
|
|
1927
|
-
class
|
|
1927
|
+
class Ra {
|
|
1928
1928
|
constructor() {
|
|
1929
1929
|
this.frameSourceSvg = async (e, t) => {
|
|
1930
1930
|
if (!e)
|
|
@@ -2035,7 +2035,7 @@ class Ha {
|
|
|
2035
2035
|
});
|
|
2036
2036
|
},
|
|
2037
2037
|
() => {
|
|
2038
|
-
throw new
|
|
2038
|
+
throw new Te("Failed to resolve transcoded PDF");
|
|
2039
2039
|
}
|
|
2040
2040
|
)
|
|
2041
2041
|
);
|
|
@@ -2052,7 +2052,7 @@ class Ha {
|
|
|
2052
2052
|
i && (i.command && a.getCommandDispatcher()(i.command), i.followup && await i.followup());
|
|
2053
2053
|
}
|
|
2054
2054
|
getCreateElementCommand(e, t, A, a) {
|
|
2055
|
-
return new
|
|
2055
|
+
return new L(
|
|
2056
2056
|
{
|
|
2057
2057
|
id: e,
|
|
2058
2058
|
type: k.Frame,
|
|
@@ -2090,7 +2090,7 @@ class Ha {
|
|
|
2090
2090
|
};
|
|
2091
2091
|
Qt.set(e, s), t.setPatternData(s, A);
|
|
2092
2092
|
} else {
|
|
2093
|
-
const a = await YA(e, !0), n = await
|
|
2093
|
+
const a = await YA(e, !0), n = await Rt(a), i = {
|
|
2094
2094
|
src: e,
|
|
2095
2095
|
width: n.width,
|
|
2096
2096
|
height: n.height,
|
|
@@ -2186,8 +2186,8 @@ class Ha {
|
|
|
2186
2186
|
}), A.markUpdateCompleted(i);
|
|
2187
2187
|
}
|
|
2188
2188
|
}
|
|
2189
|
-
const Se = new
|
|
2190
|
-
class
|
|
2189
|
+
const Se = new Ra();
|
|
2190
|
+
class Ha {
|
|
2191
2191
|
async getIllustrationBody(e) {
|
|
2192
2192
|
return new Promise((t) => {
|
|
2193
2193
|
_(e, !0).then((A) => {
|
|
@@ -2196,7 +2196,7 @@ class Ra {
|
|
|
2196
2196
|
});
|
|
2197
2197
|
}
|
|
2198
2198
|
getCreateElementCommand(e, t, A, a) {
|
|
2199
|
-
return new
|
|
2199
|
+
return new L(
|
|
2200
2200
|
{
|
|
2201
2201
|
stepRegion: t,
|
|
2202
2202
|
stepName: a.stepName,
|
|
@@ -2341,7 +2341,7 @@ class Ra {
|
|
|
2341
2341
|
async selectVariantCommand(e, t, A, a, n, i) {
|
|
2342
2342
|
var C;
|
|
2343
2343
|
if (!e.data || !e.data.regions)
|
|
2344
|
-
throw new
|
|
2344
|
+
throw new He(e, "Missing regions.");
|
|
2345
2345
|
a(!0);
|
|
2346
2346
|
const s = A.map((I) => new ee(I.id));
|
|
2347
2347
|
e.mandatory && n.setMandatoryFulfilled(e.stepName, !1);
|
|
@@ -2399,12 +2399,12 @@ class Ra {
|
|
|
2399
2399
|
};
|
|
2400
2400
|
}
|
|
2401
2401
|
}
|
|
2402
|
-
const Ye = new
|
|
2402
|
+
const Ye = new Ha();
|
|
2403
2403
|
class Ua {
|
|
2404
2404
|
async init(e, t, A) {
|
|
2405
2405
|
const a = e.option;
|
|
2406
2406
|
if (!a)
|
|
2407
|
-
throw new
|
|
2407
|
+
throw new Re(e);
|
|
2408
2408
|
if (A)
|
|
2409
2409
|
await this.reload(e, t, A);
|
|
2410
2410
|
else {
|
|
@@ -2422,7 +2422,7 @@ class Ua {
|
|
|
2422
2422
|
A.serializableWorkflow.steps
|
|
2423
2423
|
), s = Object.values(A.layouts).map((g) => g.elements).flat().filter((g) => g.stepName === e.stepName), o = e.option;
|
|
2424
2424
|
if (!o)
|
|
2425
|
-
throw new
|
|
2425
|
+
throw new Re(e);
|
|
2426
2426
|
if (a != null && a.selectedVariants) {
|
|
2427
2427
|
const g = a.selectedVariants[0].id;
|
|
2428
2428
|
if (g) {
|
|
@@ -2478,7 +2478,7 @@ class va {
|
|
|
2478
2478
|
async init(e, t, A) {
|
|
2479
2479
|
const a = e.option;
|
|
2480
2480
|
if (!a)
|
|
2481
|
-
throw new
|
|
2481
|
+
throw new Re(e);
|
|
2482
2482
|
if (A)
|
|
2483
2483
|
await this.reload(e, t, A);
|
|
2484
2484
|
else {
|
|
@@ -2600,7 +2600,7 @@ class Ga {
|
|
|
2600
2600
|
return console.error(`Can not find layout for region: ${l.panelId}`), null;
|
|
2601
2601
|
const u = [];
|
|
2602
2602
|
return d && u.push(new ee(w)), u.push(
|
|
2603
|
-
new
|
|
2603
|
+
new L(
|
|
2604
2604
|
{
|
|
2605
2605
|
stepRegion: l,
|
|
2606
2606
|
stepName: e.stepName,
|
|
@@ -2728,7 +2728,7 @@ class ba {
|
|
|
2728
2728
|
const E = J();
|
|
2729
2729
|
return {
|
|
2730
2730
|
regionElement: { id: E, region: l },
|
|
2731
|
-
command: new
|
|
2731
|
+
command: new L(
|
|
2732
2732
|
{
|
|
2733
2733
|
stepName: e.stepName,
|
|
2734
2734
|
stepRegion: l,
|
|
@@ -2824,7 +2824,7 @@ class Ja {
|
|
|
2824
2824
|
}
|
|
2825
2825
|
}
|
|
2826
2826
|
const oA = new Ja();
|
|
2827
|
-
class
|
|
2827
|
+
class Ta {
|
|
2828
2828
|
constructor() {
|
|
2829
2829
|
this.shapeFillId = "spiff-fill-shape";
|
|
2830
2830
|
}
|
|
@@ -2850,7 +2850,7 @@ class La {
|
|
|
2850
2850
|
async init(e, t, A) {
|
|
2851
2851
|
const a = e.option;
|
|
2852
2852
|
if (!a)
|
|
2853
|
-
throw new
|
|
2853
|
+
throw new Re(e);
|
|
2854
2854
|
if (A)
|
|
2855
2855
|
await this.reload(e, t, A);
|
|
2856
2856
|
else {
|
|
@@ -2958,7 +2958,7 @@ class La {
|
|
|
2958
2958
|
return {
|
|
2959
2959
|
id: C,
|
|
2960
2960
|
region: d,
|
|
2961
|
-
command: new
|
|
2961
|
+
command: new L(
|
|
2962
2962
|
{
|
|
2963
2963
|
stepRegion: d,
|
|
2964
2964
|
stepName: e.stepName,
|
|
@@ -2996,8 +2996,8 @@ class La {
|
|
|
2996
2996
|
}
|
|
2997
2997
|
}
|
|
2998
2998
|
}
|
|
2999
|
-
const le = new
|
|
3000
|
-
class
|
|
2999
|
+
const le = new Ta();
|
|
3000
|
+
class La {
|
|
3001
3001
|
constructor() {
|
|
3002
3002
|
this.latestToast = null, this.toastType = null, this.toastCallbacks = [];
|
|
3003
3003
|
}
|
|
@@ -3022,7 +3022,7 @@ class Ta {
|
|
|
3022
3022
|
);
|
|
3023
3023
|
}
|
|
3024
3024
|
}
|
|
3025
|
-
const Oa = new
|
|
3025
|
+
const Oa = new La(), ze = 30;
|
|
3026
3026
|
class ve extends Error {
|
|
3027
3027
|
constructor(e) {
|
|
3028
3028
|
super(e), Object.setPrototypeOf(this, new.target.prototype), this.name = ve.name;
|
|
@@ -3136,7 +3136,7 @@ class Ka {
|
|
|
3136
3136
|
return;
|
|
3137
3137
|
const n = a.getCommandDispatcher();
|
|
3138
3138
|
for (const i of A) {
|
|
3139
|
-
const s = new
|
|
3139
|
+
const s = new RA(i.id, t);
|
|
3140
3140
|
n(s);
|
|
3141
3141
|
}
|
|
3142
3142
|
}
|
|
@@ -3156,7 +3156,7 @@ class Ka {
|
|
|
3156
3156
|
for (const r of A) {
|
|
3157
3157
|
if (!t.fill)
|
|
3158
3158
|
throw new Error("Fill not set on new color selection!");
|
|
3159
|
-
const g = new
|
|
3159
|
+
const g = new HA(r.id, t.fill, s);
|
|
3160
3160
|
n(g);
|
|
3161
3161
|
}
|
|
3162
3162
|
}
|
|
@@ -3401,9 +3401,9 @@ class Ka {
|
|
|
3401
3401
|
const h = A.colorOption;
|
|
3402
3402
|
let u;
|
|
3403
3403
|
if (h && h.variants) {
|
|
3404
|
-
const N = h.variants.find((
|
|
3404
|
+
const N = h.variants.find((R) => {
|
|
3405
3405
|
var O;
|
|
3406
|
-
return
|
|
3406
|
+
return R.id === ((O = h.defaultVariant) == null ? void 0 : O.id);
|
|
3407
3407
|
}) || h.variants[0];
|
|
3408
3408
|
u = this.createTextFillSpotColor(h, N), i.updateStorage(e, {
|
|
3409
3409
|
colorProfileAssetKey: (E = h.colorProfile) == null ? void 0 : E.key
|
|
@@ -3456,7 +3456,7 @@ class Ka {
|
|
|
3456
3456
|
Q.push(
|
|
3457
3457
|
this.generateTextChangeCommandsForRegion(F, A, m.id, P)
|
|
3458
3458
|
);
|
|
3459
|
-
const S = new
|
|
3459
|
+
const S = new L(m, d);
|
|
3460
3460
|
return {
|
|
3461
3461
|
regionElement: { id: w, region: B },
|
|
3462
3462
|
commands: [S, ...Q],
|
|
@@ -4808,14 +4808,14 @@ IfnI8vaNAAAAAElFTkSuQmCC" transform="matrix(0.13 0.0141 -0.0141 0.1301 104.926 1
|
|
|
4808
4808
|
</g>
|
|
4809
4809
|
</svg>
|
|
4810
4810
|
|
|
4811
|
-
`,
|
|
4812
|
-
const t =
|
|
4811
|
+
`, H = (c) => GA("http://www.w3.org/2000/svg", c), gt = (c, e) => {
|
|
4812
|
+
const t = H("rect");
|
|
4813
4813
|
return t.setAttribute("height", `${c}`), t.setAttribute("width", `${e}`), t;
|
|
4814
4814
|
}, Wa = () => {
|
|
4815
|
-
const c =
|
|
4815
|
+
const c = H("svg");
|
|
4816
4816
|
return c.setAttribute("xmlns", "http://www.w3.org/2000/svg"), c.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink"), c.setAttribute("version", "1.1"), c;
|
|
4817
4817
|
}, Xa = (c) => {
|
|
4818
|
-
const e =
|
|
4818
|
+
const e = H("use");
|
|
4819
4819
|
return e.setAttribute("xlink:href", c), e.setAttribute("href", c), e;
|
|
4820
4820
|
};
|
|
4821
4821
|
function rA(c) {
|
|
@@ -4823,7 +4823,7 @@ function rA(c) {
|
|
|
4823
4823
|
return e.setAttribute("height", `${a}`), e.setAttribute("width", `${A}`), [e, a, A];
|
|
4824
4824
|
}
|
|
4825
4825
|
const qa = (c, e, t) => {
|
|
4826
|
-
const A =
|
|
4826
|
+
const A = H("g");
|
|
4827
4827
|
c.appendChild(A), A.setAttribute("id", t), A.innerHTML = e;
|
|
4828
4828
|
};
|
|
4829
4829
|
function cA(c, e, t) {
|
|
@@ -4985,26 +4985,26 @@ class $a extends ct {
|
|
|
4985
4985
|
}
|
|
4986
4986
|
brandSvg(e, t) {
|
|
4987
4987
|
const A = e.toSVG(2), a = e.getBoundingBox(), n = a.x2 - a.x1, i = e.toPathData(3), s = () => {
|
|
4988
|
-
const Q =
|
|
4988
|
+
const Q = H("g"), p = H("defs");
|
|
4989
4989
|
Q.appendChild(p), p.appendChild(gA(3, 7, 4, "shadow"));
|
|
4990
|
-
const f =
|
|
4990
|
+
const f = H("g");
|
|
4991
4991
|
Q.appendChild(f), f.setAttribute("filter", "url(#shadow)"), f.innerHTML = A;
|
|
4992
|
-
const F =
|
|
4992
|
+
const F = H("g");
|
|
4993
4993
|
Q.appendChild(F), F.setAttribute("fill", "red"), F.setAttribute("stroke", "red"), F.setAttribute("stroke-width", "9"), F.innerHTML = A;
|
|
4994
|
-
const M =
|
|
4994
|
+
const M = H("g");
|
|
4995
4995
|
Q.appendChild(M), M.setAttribute("fill", "#9d2621"), M.setAttribute("transform", "translate(1,1)"), M.innerHTML = A;
|
|
4996
|
-
const P =
|
|
4997
|
-
return Q.appendChild(P), P.setAttribute("fill", "yellow"), P.innerHTML = A, new Bt(Q).transform(([N,
|
|
4996
|
+
const P = H("g");
|
|
4997
|
+
return Q.appendChild(P), P.setAttribute("fill", "yellow"), P.innerHTML = A, new Bt(Q).transform(([N, R]) => [N, R + (n / 2 - N) ** 2 / (n * 2.9)]), Q;
|
|
4998
4998
|
}, [o, r, g] = rA(t);
|
|
4999
4999
|
if (!o)
|
|
5000
5000
|
return "";
|
|
5001
|
-
const B =
|
|
5001
|
+
const B = H("defs");
|
|
5002
5002
|
o.appendChild(B), cA(o, B, t);
|
|
5003
|
-
const l = r * 0.23, d = g * 0.94, w = g * 0.04, E = r * 0.53, h =
|
|
5003
|
+
const l = r * 0.23, d = g * 0.94, w = g * 0.04, E = r * 0.53, h = H("g");
|
|
5004
5004
|
o.appendChild(h), h.setAttribute("transform", `translate(${w} ${E}) rotate(-21)`);
|
|
5005
5005
|
const u = gt(l, d);
|
|
5006
5006
|
u.setAttribute("opacity", "0"), h.appendChild(u);
|
|
5007
|
-
const C =
|
|
5007
|
+
const C = H("g");
|
|
5008
5008
|
h.appendChild(C);
|
|
5009
5009
|
const I = s();
|
|
5010
5010
|
C.appendChild(I);
|
|
@@ -5029,29 +5029,29 @@ class en extends ct {
|
|
|
5029
5029
|
}
|
|
5030
5030
|
brandSvg(e, t, A) {
|
|
5031
5031
|
const a = e.toSVG(2), n = e.getBoundingBox(), i = n.y2 - n.y1, s = n.x2 - n.x1, o = e.toPathData(3), r = () => {
|
|
5032
|
-
const f =
|
|
5032
|
+
const f = H("g"), F = H("g");
|
|
5033
5033
|
f.appendChild(F), F.setAttribute("stroke", "#5C1A0D"), F.setAttribute("stroke-width", "4"), F.setAttribute("transform", "translate(1,1)"), F.innerHTML = a;
|
|
5034
|
-
const M =
|
|
5034
|
+
const M = H("g");
|
|
5035
5035
|
f.appendChild(M), M.setAttribute("fill", "#FFE386"), M.setAttribute("transform", "translate(1,1)"), M.innerHTML = a;
|
|
5036
|
-
const P =
|
|
5036
|
+
const P = H("g");
|
|
5037
5037
|
f.appendChild(P), P.setAttribute("fill", "white"), P.innerHTML = a;
|
|
5038
5038
|
const S = new Bt(f);
|
|
5039
|
-
return S.transform(([N,
|
|
5039
|
+
return S.transform(([N, R]) => [N, R + ((s - N) * R) ** 2 / (s * 5e4)]), S.transform(([N, R]) => [
|
|
5040
5040
|
N,
|
|
5041
|
-
|
|
5042
|
-
]), S.transform(([N,
|
|
5041
|
+
R + (s / 3 - N) ** 2 / s * this.indicator(N < s / 3)
|
|
5042
|
+
]), S.transform(([N, R]) => [N - (i - R) * (s - N) / 800, R]), f;
|
|
5043
5043
|
}, [g, B, l] = rA(t);
|
|
5044
5044
|
if (!g)
|
|
5045
5045
|
return "";
|
|
5046
|
-
const d =
|
|
5046
|
+
const d = H("defs");
|
|
5047
5047
|
g.appendChild(d), cA(g, d, t);
|
|
5048
5048
|
let w, E, h, u;
|
|
5049
5049
|
A ? (w = B * 0.25 * (1 + 0.1), E = l / 2 * (1 + 0.1), h = l * 0.22, u = B * 0.32) : (w = B * 0.22 * (1 + 0.1), E = l * 0.8, h = l * 0.067, u = B * 0.33);
|
|
5050
|
-
const C =
|
|
5050
|
+
const C = H("g");
|
|
5051
5051
|
g.appendChild(C), C.setAttribute("transform", `translate(${h} ${u}) rotate(-10)`);
|
|
5052
5052
|
const I = gt(w, E);
|
|
5053
5053
|
I.setAttribute("opacity", "0"), C.appendChild(I);
|
|
5054
|
-
const m =
|
|
5054
|
+
const m = H("g");
|
|
5055
5055
|
C.appendChild(m);
|
|
5056
5056
|
const Q = r();
|
|
5057
5057
|
m.appendChild(Q);
|
|
@@ -5073,29 +5073,29 @@ class An extends ct {
|
|
|
5073
5073
|
}
|
|
5074
5074
|
svgElement(e, t) {
|
|
5075
5075
|
const A = nt(tn), n = e !== "" ? ((I) => I.charAt(0).toUpperCase() + I.substr(1).toLowerCase())(e) : "", i = A.getPath(n, 0, 72, 72), s = i.toSVG(2), o = i.getBoundingBox(), r = o.x2 - o.x1, g = i.toPathData(3), B = () => {
|
|
5076
|
-
const I =
|
|
5076
|
+
const I = H("g");
|
|
5077
5077
|
I.classList.add("module-text-group");
|
|
5078
|
-
const m =
|
|
5078
|
+
const m = H("defs");
|
|
5079
5079
|
I.appendChild(m), m.appendChild(gA(0, 2, 2, "shadow"));
|
|
5080
|
-
const Q =
|
|
5080
|
+
const Q = H("path");
|
|
5081
5081
|
Q.setAttribute("d", g), Q.setAttribute("stroke", "black"), Q.setAttribute("stroke-width", "3"), m.appendChild(Q);
|
|
5082
|
-
const p =
|
|
5082
|
+
const p = H("g");
|
|
5083
5083
|
p.classList.add("module-layer0"), I.appendChild(p), p.setAttribute("filter", "url(#shadow)"), p.innerHTML = Q.outerHTML;
|
|
5084
|
-
const f =
|
|
5084
|
+
const f = H("g");
|
|
5085
5085
|
f.classList.add("module-layer1"), I.appendChild(f), f.setAttribute("stroke-width", "3"), f.setAttribute("stroke", "rgb(45,41,38)"), f.setAttribute("fill", "rgb(45,41,38)"), f.setAttribute("transform", "translate(0.5,0)"), f.innerHTML = s;
|
|
5086
|
-
const F =
|
|
5086
|
+
const F = H("g");
|
|
5087
5087
|
F.classList.add("module-layer2"), I.appendChild(F), F.setAttribute("fill", "rgb(255,209,0)"), F.setAttribute("transform", "translate(1,-0.1)"), F.innerHTML = s;
|
|
5088
|
-
const M =
|
|
5088
|
+
const M = H("g");
|
|
5089
5089
|
return M.classList.add("module-layer3"), I.appendChild(M), M.setAttribute("fill", "white"), M.innerHTML = s, new Bt(I).transform(([S, N]) => [S, N + (r / 2 - S) ** 2 / (r * 6)]), I;
|
|
5090
|
-
}, l =
|
|
5090
|
+
}, l = H("g");
|
|
5091
5091
|
l.classList.add("module-root");
|
|
5092
|
-
const d =
|
|
5092
|
+
const d = H("defs");
|
|
5093
5093
|
l.appendChild(d);
|
|
5094
|
-
const w =
|
|
5094
|
+
const w = H("g");
|
|
5095
5095
|
w.classList.add("module-bounds"), l.appendChild(w);
|
|
5096
5096
|
const E = gt(t.height, t.width);
|
|
5097
5097
|
E.setAttribute("opacity", "0"), w.appendChild(E);
|
|
5098
|
-
const h =
|
|
5098
|
+
const h = H("g");
|
|
5099
5099
|
h.classList.add("module-text-enclosure"), l.appendChild(h);
|
|
5100
5100
|
const u = B();
|
|
5101
5101
|
h.appendChild(u);
|
|
@@ -6290,7 +6290,7 @@ class Ie {
|
|
|
6290
6290
|
case y.Model:
|
|
6291
6291
|
return new rn(e, t);
|
|
6292
6292
|
case y.Frame:
|
|
6293
|
-
return new
|
|
6293
|
+
return new Hi(e, t);
|
|
6294
6294
|
default:
|
|
6295
6295
|
throw new b(`Step type ${t.type} not yet supported in Core SDK`);
|
|
6296
6296
|
}
|
|
@@ -6518,26 +6518,26 @@ const En = async (c) => {
|
|
|
6518
6518
|
context: {
|
|
6519
6519
|
transactionOwnerId: P
|
|
6520
6520
|
}
|
|
6521
|
-
}),
|
|
6522
|
-
return N.errors ? (N.errors.forEach((
|
|
6523
|
-
N.errors && console.log("Server Error:",
|
|
6524
|
-
}), null) :
|
|
6521
|
+
}), R = (O = N.data) == null ? void 0 : O.transactions[0].workflowState;
|
|
6522
|
+
return N.errors ? (N.errors.forEach((T) => {
|
|
6523
|
+
N.errors && console.log("Server Error:", T.message);
|
|
6524
|
+
}), null) : R ?? null;
|
|
6525
6525
|
})() || (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(A())), await c.updateStateWithServerImmediate(A), console.log("Server state is undefined @ Workflow completion"));
|
|
6526
6526
|
const l = c.getPreviewService(), d = (F = e == null ? void 0 : e.finalizeStepConfig) == null ? void 0 : F.lookAtAnimation, w = l && e.showModelOnFinishStep && !!d, E = o && _e(o, e, !0), h = o && _e(o, e, !1), u = async (M) => {
|
|
6527
6527
|
const P = {};
|
|
6528
6528
|
let S = 0;
|
|
6529
6529
|
if (Object.keys(n).length > 0)
|
|
6530
6530
|
for (const N of Object.keys(n)) {
|
|
6531
|
-
const
|
|
6532
|
-
for (let
|
|
6533
|
-
const W =
|
|
6531
|
+
const R = n[N], O = e.steps.find((T) => T.stepName === N);
|
|
6532
|
+
for (let T = 0; T < R.selections.length; ++T) {
|
|
6533
|
+
const W = R.selections[T];
|
|
6534
6534
|
if (O && (!M || O.option && (O.option.variants || []).length > 1 && !O.data.hideSelectionInCart && !O.data.hideSelectionsInCart)) {
|
|
6535
|
-
const
|
|
6536
|
-
P[
|
|
6535
|
+
const Le = O.stepTitle;
|
|
6536
|
+
P[Le] ? P[Le].push({
|
|
6537
6537
|
id: W.id || "",
|
|
6538
6538
|
name: W.name,
|
|
6539
6539
|
priceModifier: W.priceModifier
|
|
6540
|
-
}) : P[
|
|
6540
|
+
}) : P[Le] = [
|
|
6541
6541
|
{
|
|
6542
6542
|
id: W.id || "",
|
|
6543
6543
|
name: W.name,
|
|
@@ -6853,7 +6853,7 @@ class fe {
|
|
|
6853
6853
|
height: g.layoutState.layout.height
|
|
6854
6854
|
}, l = this.commandContext.getLayoutById(g.layoutState.layout.id), d = i.getContext("2d");
|
|
6855
6855
|
if (!d)
|
|
6856
|
-
throw new
|
|
6856
|
+
throw new Te("Failed to obtain 2D context for preview image creation");
|
|
6857
6857
|
const w = vt(l.layoutState.layout, l.layoutState.elements, {
|
|
6858
6858
|
renderingConfiguration: {
|
|
6859
6859
|
purpose: Gt.Print,
|
|
@@ -7153,7 +7153,7 @@ const Dn = [
|
|
|
7153
7153
|
if (!w)
|
|
7154
7154
|
throw new z(d);
|
|
7155
7155
|
const E = J();
|
|
7156
|
-
return new
|
|
7156
|
+
return new L(
|
|
7157
7157
|
{
|
|
7158
7158
|
id: E,
|
|
7159
7159
|
src: g,
|
|
@@ -7194,7 +7194,7 @@ const Dn = [
|
|
|
7194
7194
|
top: a.y
|
|
7195
7195
|
});
|
|
7196
7196
|
return [
|
|
7197
|
-
new
|
|
7197
|
+
new L(
|
|
7198
7198
|
{
|
|
7199
7199
|
id: l,
|
|
7200
7200
|
path: B.path,
|
|
@@ -7218,7 +7218,7 @@ const Dn = [
|
|
|
7218
7218
|
},
|
|
7219
7219
|
d
|
|
7220
7220
|
),
|
|
7221
|
-
new
|
|
7221
|
+
new Ht(l, i, w)
|
|
7222
7222
|
];
|
|
7223
7223
|
};
|
|
7224
7224
|
return (await Promise.all(A.data.regions.map((r) => o(r)))).flat();
|
|
@@ -7239,12 +7239,12 @@ const Dn = [
|
|
|
7239
7239
|
const s = (p = i.asset) == null ? void 0 : p.fileLink;
|
|
7240
7240
|
if (!s)
|
|
7241
7241
|
return console.error(`No asset link for variant with ID: ${a.illustrationVariantId}`), [];
|
|
7242
|
-
const o = await _(s, !0), r = /<svg.*?<\/svg>/s, g = o.match(r) || [], B = (g == null ? void 0 : g.length) > 0 ? g[0] : "", w =
|
|
7242
|
+
const o = await _(s, !0), r = /<svg.*?<\/svg>/s, g = o.match(r) || [], B = (g == null ? void 0 : g.length) > 0 ? g[0] : "", w = Tt().parseFromString(B, "image/svg+xml").firstElementChild;
|
|
7243
7243
|
if (!w)
|
|
7244
7244
|
return console.error("Failed to read SVG."), [];
|
|
7245
|
-
|
|
7245
|
+
Lt(w);
|
|
7246
7246
|
const E = {};
|
|
7247
|
-
|
|
7247
|
+
TA(w, (f) => {
|
|
7248
7248
|
Dn.includes(f.tagName) && !f.attributes.getNamedItem("fill") && f.setAttribute("fill", "#000000");
|
|
7249
7249
|
const F = f.attributes.getNamedItem("fill");
|
|
7250
7250
|
if (F && F.value !== "none") {
|
|
@@ -7271,7 +7271,7 @@ const Dn = [
|
|
|
7271
7271
|
if (!F)
|
|
7272
7272
|
throw new z(f);
|
|
7273
7273
|
const M = J();
|
|
7274
|
-
return new
|
|
7274
|
+
return new L(
|
|
7275
7275
|
{
|
|
7276
7276
|
colors: E,
|
|
7277
7277
|
id: M,
|
|
@@ -7300,7 +7300,7 @@ const Dn = [
|
|
|
7300
7300
|
if (!r)
|
|
7301
7301
|
throw new z(o);
|
|
7302
7302
|
const g = J();
|
|
7303
|
-
return new
|
|
7303
|
+
return new L(
|
|
7304
7304
|
{
|
|
7305
7305
|
colors: {},
|
|
7306
7306
|
id: g,
|
|
@@ -7343,7 +7343,7 @@ const Dn = [
|
|
|
7343
7343
|
if (!d)
|
|
7344
7344
|
throw new z(l);
|
|
7345
7345
|
const w = J();
|
|
7346
|
-
return new
|
|
7346
|
+
return new L(
|
|
7347
7347
|
{
|
|
7348
7348
|
id: w,
|
|
7349
7349
|
src: s,
|
|
@@ -7400,7 +7400,7 @@ const Dn = [
|
|
|
7400
7400
|
/>
|
|
7401
7401
|
</svg>
|
|
7402
7402
|
`, w = { "spiff-fill-shape": { browserValue: i.color || "#000000" } }, E = J();
|
|
7403
|
-
return new
|
|
7403
|
+
return new L(
|
|
7404
7404
|
{
|
|
7405
7405
|
colors: w,
|
|
7406
7406
|
id: E,
|
|
@@ -7451,17 +7451,17 @@ const Dn = [
|
|
|
7451
7451
|
excludeFromExport: e.data.excludeFromPrint,
|
|
7452
7452
|
preserveAspectRatio: "none"
|
|
7453
7453
|
};
|
|
7454
|
-
A.push(new
|
|
7454
|
+
A.push(new L(B, g));
|
|
7455
7455
|
});
|
|
7456
7456
|
} catch (r) {
|
|
7457
7457
|
console.error(r);
|
|
7458
7458
|
}
|
|
7459
7459
|
else {
|
|
7460
7460
|
const r = await _(n, !0), g = (B) => {
|
|
7461
|
-
const l = /<svg.*?<\/svg>/s, d = B.match(l) || [], w = (d == null ? void 0 : d.length) > 0 ? d[0] : "", u =
|
|
7461
|
+
const l = /<svg.*?<\/svg>/s, d = B.match(l) || [], w = (d == null ? void 0 : d.length) > 0 ? d[0] : "", u = Tt().parseFromString(w, "image/svg+xml").firstElementChild;
|
|
7462
7462
|
if (!u)
|
|
7463
7463
|
throw new ge("Failed to read SVG.");
|
|
7464
|
-
return
|
|
7464
|
+
return Lt(u), Ot().serializeToString(u);
|
|
7465
7465
|
};
|
|
7466
7466
|
o.forEach((B) => {
|
|
7467
7467
|
const l = c.find((w) => w.panelId === B.panelId);
|
|
@@ -7486,7 +7486,7 @@ const Dn = [
|
|
|
7486
7486
|
productOverlay: e.type === y.ProductOverlay ? !0 : void 0,
|
|
7487
7487
|
excludeFromExport: e.data.excludeFromPrint
|
|
7488
7488
|
};
|
|
7489
|
-
A.push(new
|
|
7489
|
+
A.push(new L(d, l));
|
|
7490
7490
|
});
|
|
7491
7491
|
}
|
|
7492
7492
|
return A;
|
|
@@ -7565,7 +7565,7 @@ const Dn = [
|
|
|
7565
7565
|
}
|
|
7566
7566
|
);
|
|
7567
7567
|
a.push(
|
|
7568
|
-
new
|
|
7568
|
+
new L(
|
|
7569
7569
|
{
|
|
7570
7570
|
...C,
|
|
7571
7571
|
fontSize: I,
|
|
@@ -7576,10 +7576,10 @@ const Dn = [
|
|
|
7576
7576
|
)
|
|
7577
7577
|
);
|
|
7578
7578
|
} else
|
|
7579
|
-
a.push(new
|
|
7579
|
+
a.push(new L(C, u));
|
|
7580
7580
|
}
|
|
7581
7581
|
return a;
|
|
7582
|
-
},
|
|
7582
|
+
}, Rn = (c, e) => c.conditions ? c.conditions.every((t) => {
|
|
7583
7583
|
const A = e[t.targetStepName];
|
|
7584
7584
|
if (A && A.selectedVariants) {
|
|
7585
7585
|
const a = A.selectedVariants;
|
|
@@ -7588,7 +7588,7 @@ const Dn = [
|
|
|
7588
7588
|
);
|
|
7589
7589
|
}
|
|
7590
7590
|
return !1;
|
|
7591
|
-
}) : !0,
|
|
7591
|
+
}) : !0, Hn = async (c, e, t, A) => {
|
|
7592
7592
|
const a = [], n = {};
|
|
7593
7593
|
for (const i of c) {
|
|
7594
7594
|
const s = e.steps.find((o) => o.stepName === i.name);
|
|
@@ -7636,7 +7636,7 @@ const Dn = [
|
|
|
7636
7636
|
}
|
|
7637
7637
|
}
|
|
7638
7638
|
for (const i of e.steps)
|
|
7639
|
-
i.type !== y.SilentIllustration && i.type !== y.ProductOverlay ||
|
|
7639
|
+
i.type !== y.SilentIllustration && i.type !== y.ProductOverlay || Rn(i, n) && a.push(
|
|
7640
7640
|
...await xn(t, i, A)
|
|
7641
7641
|
);
|
|
7642
7642
|
return a;
|
|
@@ -7645,12 +7645,7 @@ class De {
|
|
|
7645
7645
|
constructor(e) {
|
|
7646
7646
|
this.handleCompleteRender = null;
|
|
7647
7647
|
const t = /* @__PURE__ */ new Map();
|
|
7648
|
-
e.forEach(
|
|
7649
|
-
(A) => t.set(
|
|
7650
|
-
A.id,
|
|
7651
|
-
new Gn(A.id, A.name, this, { width: A.width, height: A.height })
|
|
7652
|
-
)
|
|
7653
|
-
), this.layouts = t;
|
|
7648
|
+
e.forEach((A) => t.set(A.id, new Gn(A.id, A.name, this))), this.layouts = t;
|
|
7654
7649
|
}
|
|
7655
7650
|
setCompleteRenderCallback(e) {
|
|
7656
7651
|
this.handleCompleteRender = e, e(Array.from(this.layouts.values()));
|
|
@@ -7667,8 +7662,8 @@ const Un = () => new Promise((c, e) => {
|
|
|
7667
7662
|
c(!!A);
|
|
7668
7663
|
}), vn = Un();
|
|
7669
7664
|
class Gn {
|
|
7670
|
-
constructor(e, t, A
|
|
7671
|
-
this.hasSetStaticContext = !1, this.interactiveDirty = !1, this.staticCtxDirty = !1, this.lastRequestedRenderArguments = void 0, this.lastCompletedStaticRender = void 0, this.lastModificationID = void 0, this.renderQueue = new AA(2), this.id = e, this.name = t, this.service = A
|
|
7665
|
+
constructor(e, t, A) {
|
|
7666
|
+
this.hasSetStaticContext = !1, this.interactiveDirty = !1, this.staticCtxDirty = !1, this.lastRequestedRenderArguments = void 0, this.lastCompletedStaticRender = void 0, this.lastModificationID = void 0, this.renderQueue = new AA(2), this.id = e, this.name = t, this.service = A;
|
|
7672
7667
|
}
|
|
7673
7668
|
getID() {
|
|
7674
7669
|
return this.id;
|
|
@@ -7676,9 +7671,6 @@ class Gn {
|
|
|
7676
7671
|
getName() {
|
|
7677
7672
|
return this.name;
|
|
7678
7673
|
}
|
|
7679
|
-
getPanelSize() {
|
|
7680
|
-
return this.panelSize;
|
|
7681
|
-
}
|
|
7682
7674
|
getStaticContext() {
|
|
7683
7675
|
return this.textureCtx;
|
|
7684
7676
|
}
|
|
@@ -7752,7 +7744,6 @@ class kn extends tA {
|
|
|
7752
7744
|
}
|
|
7753
7745
|
/**
|
|
7754
7746
|
* Returns the resolution expected for generated textures.
|
|
7755
|
-
* FIXME: This is reimplemented from the preview package. Can we find a way to remove this duplication.
|
|
7756
7747
|
*/
|
|
7757
7748
|
getDynamicTextureResolution() {
|
|
7758
7749
|
return this.getIsMobile() || !this.offscreenRenderingSupported() ? {
|
|
@@ -7784,21 +7775,21 @@ class kn extends tA {
|
|
|
7784
7775
|
* a loose target but should be kept in mind when making changes.
|
|
7785
7776
|
*/
|
|
7786
7777
|
async execute() {
|
|
7787
|
-
const e = this.layouts.find((
|
|
7778
|
+
const e = this.layouts.find((l) => l.layoutState.layout.id === this.layoutId);
|
|
7788
7779
|
if (!e)
|
|
7789
7780
|
return;
|
|
7790
|
-
const t = e.layoutState.elements || [], A = e.layoutState.layout.width, a = e.layoutState.layout.height, n =
|
|
7791
|
-
let
|
|
7781
|
+
const t = e.layoutState.elements || [], A = e.layoutState.layout.width, a = e.layoutState.layout.height, n = this.getDynamicTextureResolution().width, i = this.getDynamicTextureResolution().height;
|
|
7782
|
+
let s, o;
|
|
7792
7783
|
if (this.nonPOTSupport) {
|
|
7793
|
-
const
|
|
7794
|
-
A / a <
|
|
7795
|
-
const
|
|
7796
|
-
|
|
7784
|
+
const l = n / i;
|
|
7785
|
+
A / a < l ? (s = n, o = a * (n / A)) : (s = A * (i / a), o = i);
|
|
7786
|
+
const w = this.resizeFit({ width: s, height: o });
|
|
7787
|
+
s = w.width, o = w.height;
|
|
7797
7788
|
} else
|
|
7798
|
-
|
|
7799
|
-
const
|
|
7789
|
+
s = this.getDynamicTextureResolution().width, o = this.getDynamicTextureResolution().height;
|
|
7790
|
+
const r = vt(e.layoutState.layout, t, {
|
|
7800
7791
|
renderingConfiguration: { purpose: Gt.ThreeD }
|
|
7801
|
-
}),
|
|
7792
|
+
}), g = kt(r), B = await zt.from(this.ctx, g, {
|
|
7802
7793
|
anonymousCrossOrigin: !0,
|
|
7803
7794
|
ignoreDimensions: !this.nonPOTSupport,
|
|
7804
7795
|
ignoreAnimation: !0,
|
|
@@ -7810,7 +7801,7 @@ class kn extends tA {
|
|
|
7810
7801
|
DOMParser: Jt(),
|
|
7811
7802
|
fetch: et
|
|
7812
7803
|
});
|
|
7813
|
-
|
|
7804
|
+
B.resize(s, o), await B.render(), this.onRender();
|
|
7814
7805
|
}
|
|
7815
7806
|
}
|
|
7816
7807
|
const Vi = (c, e) => {
|
|
@@ -7829,8 +7820,8 @@ const Vi = (c, e) => {
|
|
|
7829
7820
|
serializableWorkflow: { steps: [] },
|
|
7830
7821
|
layouts: {}
|
|
7831
7822
|
};
|
|
7832
|
-
a = new v(t.map((o) => new
|
|
7833
|
-
const i = await
|
|
7823
|
+
a = new v(t.map((o) => new LA(o))).apply(a);
|
|
7824
|
+
const i = await Hn(c, e, t, A);
|
|
7834
7825
|
return new v(i).apply(a);
|
|
7835
7826
|
}, bn = D`
|
|
7836
7827
|
${oe}
|
|
@@ -7952,7 +7943,7 @@ const Vi = (c, e) => {
|
|
|
7952
7943
|
}
|
|
7953
7944
|
}
|
|
7954
7945
|
}
|
|
7955
|
-
`,
|
|
7946
|
+
`, Tn = D`
|
|
7956
7947
|
query GetBundleStakeholders($id: String!) {
|
|
7957
7948
|
bundles(ids: [$id]) {
|
|
7958
7949
|
id
|
|
@@ -7972,7 +7963,7 @@ const Vi = (c, e) => {
|
|
|
7972
7963
|
}
|
|
7973
7964
|
}
|
|
7974
7965
|
}
|
|
7975
|
-
`,
|
|
7966
|
+
`, Ln = D`
|
|
7976
7967
|
query GetBundlesForCustomer($id: String!) {
|
|
7977
7968
|
customers(ids: [$id]) {
|
|
7978
7969
|
bundleStakeholders {
|
|
@@ -9278,7 +9269,7 @@ class xt {
|
|
|
9278
9269
|
}
|
|
9279
9270
|
async getAllStakeholders() {
|
|
9280
9271
|
const e = await x.getShadowGraphqlClient().query({
|
|
9281
|
-
query:
|
|
9272
|
+
query: Tn,
|
|
9282
9273
|
errorPolicy: "all",
|
|
9283
9274
|
fetchPolicy: "no-cache",
|
|
9284
9275
|
variables: {
|
|
@@ -10685,7 +10676,7 @@ class Ni {
|
|
|
10685
10676
|
if (!this.customer)
|
|
10686
10677
|
throw new Error("Customer not authenticated.");
|
|
10687
10678
|
const e = await x.getShadowGraphqlClient().query({
|
|
10688
|
-
query:
|
|
10679
|
+
query: Ln,
|
|
10689
10680
|
variables: {
|
|
10690
10681
|
id: this.customer.id
|
|
10691
10682
|
},
|
|
@@ -10831,11 +10822,11 @@ class Ni {
|
|
|
10831
10822
|
throw new U(`Not all transactions were found: ${S}`);
|
|
10832
10823
|
}
|
|
10833
10824
|
return F.map((S, N) => {
|
|
10834
|
-
var
|
|
10825
|
+
var R;
|
|
10835
10826
|
return {
|
|
10836
10827
|
transaction: S,
|
|
10837
10828
|
workflowId: S.workflowId,
|
|
10838
|
-
readOnly: ((
|
|
10829
|
+
readOnly: ((R = Q.find((O) => O.option.transactionId === S.id)) == null ? void 0 : R.option.readOnly) ?? !1,
|
|
10839
10830
|
index: Q[N].index
|
|
10840
10831
|
};
|
|
10841
10832
|
});
|
|
@@ -10876,32 +10867,32 @@ class Ni {
|
|
|
10876
10867
|
var O;
|
|
10877
10868
|
const { transaction: p, workflowId: f, readOnly: F, index: M } = Q, P = w.get(f), S = e[M];
|
|
10878
10869
|
!E.get(p.id) && p.transactionOwnerId && E.set(p.id, p.transactionOwnerId);
|
|
10879
|
-
const N = E.get(p.id) || void 0,
|
|
10870
|
+
const N = E.get(p.id) || void 0, R = {
|
|
10880
10871
|
product: p.product,
|
|
10881
10872
|
transaction: p,
|
|
10882
10873
|
layouts: [],
|
|
10883
10874
|
singleVariantsRenderable: (O = S == null ? void 0 : S.workflowConfiguration) == null ? void 0 : O.singleVariantsRenderable,
|
|
10884
10875
|
stateMutationFunc: F ? async () => {
|
|
10885
10876
|
throw new b("State mutation is forbidden in read only mode!");
|
|
10886
|
-
} : async (
|
|
10877
|
+
} : async (T) => this.updateTransactionState({ ...T, context: { transactionOwnerId: N } }),
|
|
10887
10878
|
readOnly: F,
|
|
10888
10879
|
workflow: P,
|
|
10889
10880
|
isReloadedTransaction: S.type === "transaction"
|
|
10890
10881
|
};
|
|
10891
10882
|
if (S.type === "transaction" && p.workflowState) {
|
|
10892
|
-
const
|
|
10893
|
-
|
|
10883
|
+
const T = JSON.parse(p.workflowState);
|
|
10884
|
+
R.layouts = Object.values(T.layouts || {}).map((W) => W.layout), await Ae(T), await ne(T), R.reloadedState = T;
|
|
10894
10885
|
} else if (!F && S.workflowState) {
|
|
10895
|
-
const
|
|
10896
|
-
|
|
10886
|
+
const T = JSON.parse(S.workflowState);
|
|
10887
|
+
R.layouts = Object.values(T.layouts || {}).map((W) => W.layout), await Ae(T), await ne(T), R.reloadedState = T;
|
|
10897
10888
|
} else
|
|
10898
|
-
|
|
10899
|
-
|
|
10900
|
-
|
|
10889
|
+
R.layouts = Ve(
|
|
10890
|
+
R.transaction,
|
|
10891
|
+
R.workflow
|
|
10901
10892
|
);
|
|
10902
|
-
return
|
|
10903
|
-
|
|
10904
|
-
),
|
|
10893
|
+
return R.renderableContextService = new De(
|
|
10894
|
+
R.layouts
|
|
10895
|
+
), R.delayWorkflowStateSync = !0, this.initialized = !0, this.experienceOptions = R, { experienceOptions: R, index: M, options: S };
|
|
10905
10896
|
});
|
|
10906
10897
|
Y.setMap("transactionOwnerIds", E);
|
|
10907
10898
|
const I = (await Promise.all(h)).sort((Q, p) => Q.index - p.index).map(async (Q) => {
|
|
@@ -11272,8 +11263,8 @@ class Zi {
|
|
|
11272
11263
|
setWorkflowStateSyncEnabled(e) {
|
|
11273
11264
|
}
|
|
11274
11265
|
}
|
|
11275
|
-
var
|
|
11276
|
-
class
|
|
11266
|
+
var Ri = /* @__PURE__ */ ((c) => (c.SelectFrame = "SelectFrame", c.SelectImage = "SelectImage", c.Position = "Position", c))(Ri || {});
|
|
11267
|
+
class Hi extends X {
|
|
11277
11268
|
constructor(e, t) {
|
|
11278
11269
|
var A;
|
|
11279
11270
|
super(e, t), this.frameService = (A = this.manager.getStepSpecificServices(this.getId())) == null ? void 0 : A.frameService;
|
|
@@ -11430,8 +11421,8 @@ export {
|
|
|
11430
11421
|
Bs as FontSizeCommand,
|
|
11431
11422
|
ds as FontSourceCommand,
|
|
11432
11423
|
Ya as FrameService,
|
|
11433
|
-
|
|
11434
|
-
|
|
11424
|
+
Ri as FrameStep,
|
|
11425
|
+
Hi as FrameStepHandle,
|
|
11435
11426
|
wt as GlobalPropertyHandle,
|
|
11436
11427
|
ws as GroupCommand,
|
|
11437
11428
|
sn as IllustrationStepHandle,
|
|
@@ -11443,14 +11434,14 @@ export {
|
|
|
11443
11434
|
Es as LayoutElementType,
|
|
11444
11435
|
z as LayoutNotFoundError,
|
|
11445
11436
|
on as MaterialStepHandle,
|
|
11446
|
-
|
|
11437
|
+
He as MisconfigurationError,
|
|
11447
11438
|
Zi as MockWorkflowManager,
|
|
11448
11439
|
rn as ModelStepHandle,
|
|
11449
11440
|
us as MoveCommand,
|
|
11450
11441
|
mA as ObjectInput,
|
|
11451
11442
|
hi as ObjectInputType,
|
|
11452
11443
|
QA as OptionGlobalPropertyHandle,
|
|
11453
|
-
|
|
11444
|
+
Re as OptionNotFoundError,
|
|
11454
11445
|
ge as ParseError,
|
|
11455
11446
|
cn as PictureStepHandle,
|
|
11456
11447
|
wa as ProductCameraRig,
|
|
@@ -11492,13 +11483,13 @@ export {
|
|
|
11492
11483
|
Ys as frameDataCache,
|
|
11493
11484
|
Se as frameStepService,
|
|
11494
11485
|
Ps as generate,
|
|
11495
|
-
|
|
11486
|
+
Hn as generateCommands,
|
|
11496
11487
|
xs as generateSVGWithUnknownColors,
|
|
11497
11488
|
Wi as generateStateFromDesignInputSteps,
|
|
11498
11489
|
Ns as getAttributesFromArrayBuffer,
|
|
11499
|
-
|
|
11490
|
+
Rs as getAxisAlignedBoundingBox,
|
|
11500
11491
|
Sa as getBoundedOffsets,
|
|
11501
|
-
|
|
11492
|
+
Hs as getFrameData,
|
|
11502
11493
|
Us as getSvgElement,
|
|
11503
11494
|
ye as getWorkflow,
|
|
11504
11495
|
pA as getWorkflows,
|
|
@@ -11516,7 +11507,7 @@ export {
|
|
|
11516
11507
|
ks as registerFetchImplementation,
|
|
11517
11508
|
bs as registerWindowImplementation,
|
|
11518
11509
|
Js as rehydrateSerializedLayout,
|
|
11519
|
-
|
|
11510
|
+
Ts as setCanvasModule,
|
|
11520
11511
|
le as shapeStepService,
|
|
11521
11512
|
Pa as shortenUrl,
|
|
11522
11513
|
$ as spiffCoreConfiguration,
|