@haus-storefront-react/vendure-plugin-configs 1.0.4-next.7 → 1.0.4-next.8
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 +808 -793
- package/badge.js +1 -1
- package/badge.mjs +439 -424
- package/campaign.js +1 -1
- package/campaign.mjs +50 -106
- package/elastic.js +1 -1
- package/elastic.mjs +10 -26
- package/index.js +1 -1
- package/index.mjs +2 -4
- package/lib/configs/vendure-badge-plugin.d.ts +2 -2
- package/lib/configs/vendure-related-products-plugin.d.ts +39 -0
- package/lib/configs/vendure-related-products-plugin.types.d.ts +16 -0
- package/lib/exports/related-products.d.ts +3 -0
- package/lib/hooks/use-related-products.d.ts +2 -0
- package/package.json +13 -7
- package/packagesize.js +1 -1
- package/packagesize.mjs +15 -59
- package/plugin-config-DrQQb9Ry.js +1 -0
- package/plugin-config-DywohMgp.mjs +903 -0
- package/product-popularity.js +1 -1
- package/product-popularity.mjs +12 -22
- package/product-variant-specifications.js +1 -1
- package/product-variant-specifications.mjs +8 -18
- package/purchase-order-payment.js +5 -5
- package/purchase-order-payment.mjs +207 -631
- package/related-products.d.ts +2 -0
- package/related-products.js +1 -0
- package/related-products.mjs +36 -0
- package/src-BCHcjT-q.mjs +455 -0
- package/src-BqcrcEUL.mjs +2718 -0
- package/src-Cj3iGasO.js +6 -0
- package/src-CvZOxNaX.js +21 -0
- package/compiler-runtime-oPPev21o.js +0 -10
- package/compiler-runtime-qHgugrLy.mjs +0 -296
- package/index-BRlTlK6a.mjs +0 -3768
- package/index-BgBC_k8M.js +0 -1
- package/index-C0E-40z0.mjs +0 -19
- package/index-CgxqXyHf.js +0 -20
- package/useSdk-DOrZRSHz.mjs +0 -2634
- package/useSdk-YXpk8Wsi.js +0 -21
package/badge.mjs
CHANGED
|
@@ -1,438 +1,453 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
name: "badges",
|
|
10
|
-
enableFeatures: {
|
|
11
|
-
showBadges: ({
|
|
12
|
-
badges: t = [],
|
|
13
|
-
parentComponent: e
|
|
14
|
-
}) => {
|
|
15
|
-
const n = e ? v.getSettings().availablePositions[e] : v.getSettings().defaultPositions;
|
|
16
|
-
return {
|
|
17
|
-
badges: R.filter(t, (c) => n ? n.includes(c.position) : !0),
|
|
18
|
-
availablePositions: n
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
queryUpdates: {},
|
|
23
|
-
settings: {
|
|
24
|
-
defaultPositions: ["top-left", "top-right", "bottom-left", "bottom-right"],
|
|
25
|
-
availablePositions: {
|
|
26
|
-
productListItem: ["top-left", "top-right", "bottom-left", "bottom-right"],
|
|
27
|
-
productDetail: ["top-left", "top-right", "bottom-left", "bottom-right"],
|
|
28
|
-
imageCarousel: ["top-left", "top-right", "bottom-left", "bottom-right"]
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
v.setQueryUpdates({
|
|
33
|
-
product: {
|
|
34
|
-
fields: [{
|
|
35
|
-
badges: ["id", "position", "assetId", {
|
|
36
|
-
asset: ["id", "name", "preview", "source"]
|
|
37
|
-
}, {
|
|
38
|
-
collection: ["id", "name"]
|
|
39
|
-
}]
|
|
40
|
-
}]
|
|
41
|
-
},
|
|
42
|
-
search: {
|
|
43
|
-
fields: [{
|
|
44
|
-
items: [{
|
|
45
|
-
badges: ["id", "position", "assetId", {
|
|
46
|
-
asset: ["id", "name", "preview", "source"]
|
|
47
|
-
}, {
|
|
48
|
-
collection: ["id", "name"]
|
|
49
|
-
}]
|
|
50
|
-
}]
|
|
51
|
-
}]
|
|
52
|
-
},
|
|
53
|
-
products: {
|
|
54
|
-
fields: [{
|
|
55
|
-
items: [{
|
|
56
|
-
badges: ["id", "position", "assetId", {
|
|
57
|
-
asset: ["id", "name", "preview", "source"]
|
|
58
|
-
}, {
|
|
59
|
-
collection: ["id", "name"]
|
|
60
|
-
}]
|
|
61
|
-
}]
|
|
62
|
-
}]
|
|
63
|
-
},
|
|
64
|
-
briefProducts: {
|
|
65
|
-
fields: [{
|
|
66
|
-
items: [{
|
|
67
|
-
badges: ["id", "position", "assetId", {
|
|
68
|
-
asset: ["id", "name", "preview", "source"]
|
|
69
|
-
}, {
|
|
70
|
-
collection: ["id", "name"]
|
|
71
|
-
}]
|
|
72
|
-
}]
|
|
73
|
-
}]
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
v.setRequests({
|
|
77
|
-
getBadges: async () => v.getSdk().createRequest({
|
|
78
|
-
operation: "badges",
|
|
79
|
-
fields: ["totalItems", {
|
|
80
|
-
items: ["id", "createdAt", "updatedAt", "collectionId", "position", "assetId", {
|
|
81
|
-
asset: ["id", "name", "preview", "source"]
|
|
82
|
-
}, {
|
|
83
|
-
collection: ["id", "name"]
|
|
84
|
-
}]
|
|
85
|
-
}]
|
|
86
|
-
}, {
|
|
87
|
-
options: {
|
|
88
|
-
take: 100
|
|
89
|
-
}
|
|
90
|
-
}, !1).then((t) => t.data).catch((t) => ({
|
|
91
|
-
message: t.message,
|
|
92
|
-
errorCode: t.code || "unknown"
|
|
93
|
-
}))
|
|
94
|
-
});
|
|
95
|
-
function A(t) {
|
|
96
|
-
const e = [];
|
|
97
|
-
function n(c, o) {
|
|
98
|
-
const s = m.createContext(o), r = e.length;
|
|
99
|
-
e.push(s);
|
|
100
|
-
const l = (u) => {
|
|
101
|
-
const f = P.c(8);
|
|
102
|
-
let d, p, g;
|
|
103
|
-
f[0] !== u ? ({
|
|
104
|
-
scope: g,
|
|
105
|
-
children: d,
|
|
106
|
-
...p
|
|
107
|
-
} = u, f[0] = u, f[1] = d, f[2] = p, f[3] = g) : (d = f[1], p = f[2], g = f[3]);
|
|
108
|
-
const h = g?.[t]?.[r] || s, b = p;
|
|
109
|
-
let x;
|
|
110
|
-
return f[4] !== h.Provider || f[5] !== d || f[6] !== b ? (x = /* @__PURE__ */ y.jsx(h.Provider, { value: b, children: d }), f[4] = h.Provider, f[5] = d, f[6] = b, f[7] = x) : x = f[7], x;
|
|
111
|
-
};
|
|
112
|
-
l.displayName = c + "Provider";
|
|
113
|
-
function a(u, f) {
|
|
114
|
-
const d = f?.[t]?.[r] || s, p = m.useContext(d);
|
|
115
|
-
if (p)
|
|
116
|
-
return p;
|
|
117
|
-
if (o !== void 0)
|
|
118
|
-
return o;
|
|
119
|
-
throw new Error(`\`${u}\` must be used within \`${c}\``);
|
|
120
|
-
}
|
|
121
|
-
return [l, a];
|
|
122
|
-
}
|
|
123
|
-
function i() {
|
|
124
|
-
const c = e.map((o) => m.createContext(o));
|
|
125
|
-
return function(s) {
|
|
126
|
-
const r = s?.[t] || c;
|
|
127
|
-
return m.useMemo(() => ({
|
|
128
|
-
[`__scope${t}`]: {
|
|
129
|
-
...s,
|
|
130
|
-
[t]: r
|
|
131
|
-
}
|
|
132
|
-
}), [s, r]);
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
return i.scopeName = t, [n, i];
|
|
1
|
+
import { a as e, c as t, o as n, r, s as i } from "./src-BCHcjT-q.mjs";
|
|
2
|
+
import { C as a, S as o, T as s, _ as c, a as l, b as u, c as d, d as f, f as p, g as m, h, i as g, l as _, m as v, n as y, o as b, p as x, r as S, s as C, t as ee, u as w, v as te, w as T, x as ne, y as re } from "./plugin-config-DywohMgp.mjs";
|
|
3
|
+
import { i as E } from "./src-BqcrcEUL.mjs";
|
|
4
|
+
import { useRef as ie } from "react";
|
|
5
|
+
//#region ../../../node_modules/lodash-es/_setCacheAdd.js
|
|
6
|
+
var ae = "__lodash_hash_undefined__";
|
|
7
|
+
function oe(e) {
|
|
8
|
+
return this.__data__.set(e, ae), this;
|
|
136
9
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
src: n,
|
|
142
|
-
alt: i,
|
|
143
|
-
width: c,
|
|
144
|
-
height: o,
|
|
145
|
-
...s
|
|
146
|
-
} = t, r = [typeof c == "number" ? {
|
|
147
|
-
width: c
|
|
148
|
-
} : void 0, typeof o == "number" ? {
|
|
149
|
-
height: o
|
|
150
|
-
} : void 0].filter(Boolean);
|
|
151
|
-
let l;
|
|
152
|
-
return r.length === 1 ? l = r[0] : r.length > 1 && (l = r), {
|
|
153
|
-
...s,
|
|
154
|
-
source: {
|
|
155
|
-
uri: n
|
|
156
|
-
},
|
|
157
|
-
...l ? {
|
|
158
|
-
style: l
|
|
159
|
-
} : {}
|
|
160
|
-
// alt tas bort, finns inte i RN
|
|
161
|
-
};
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region ../../../node_modules/lodash-es/_setCacheHas.js
|
|
12
|
+
function se(e) {
|
|
13
|
+
return this.__data__.has(e);
|
|
162
14
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
} = t;
|
|
169
|
-
return e ? {
|
|
170
|
-
...i,
|
|
171
|
-
source: {
|
|
172
|
-
uri: e
|
|
173
|
-
}
|
|
174
|
-
} : i;
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region ../../../node_modules/lodash-es/_SetCache.js
|
|
17
|
+
function D(e) {
|
|
18
|
+
var t = -1, n = e == null ? 0 : e.length;
|
|
19
|
+
for (this.__data__ = new p(); ++t < n;) this.add(e[t]);
|
|
175
20
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
h3: "Text",
|
|
183
|
-
h4: "Text",
|
|
184
|
-
h5: "Text",
|
|
185
|
-
h6: "Text",
|
|
186
|
-
button: "Pressable",
|
|
187
|
-
input: "TextInput",
|
|
188
|
-
form: "View",
|
|
189
|
-
section: "View",
|
|
190
|
-
article: "View",
|
|
191
|
-
nav: "View",
|
|
192
|
-
header: "View",
|
|
193
|
-
footer: "View",
|
|
194
|
-
main: "View",
|
|
195
|
-
aside: "View",
|
|
196
|
-
ul: "View",
|
|
197
|
-
ol: "View",
|
|
198
|
-
li: "View",
|
|
199
|
-
a: "Pressable",
|
|
200
|
-
img: "Image",
|
|
201
|
-
label: "Text",
|
|
202
|
-
textarea: "TextInput",
|
|
203
|
-
select: "Pressable",
|
|
204
|
-
option: "Text"
|
|
205
|
-
};
|
|
206
|
-
function F(t, e) {
|
|
207
|
-
if (e === "web")
|
|
208
|
-
return t;
|
|
209
|
-
let n = null;
|
|
210
|
-
try {
|
|
211
|
-
n = require("react-native");
|
|
212
|
-
} catch {
|
|
213
|
-
n = null;
|
|
214
|
-
}
|
|
215
|
-
if (!n)
|
|
216
|
-
return console.warn(`react-native is not available at runtime; falling back to 'View' for '${t}'`), "div";
|
|
217
|
-
const i = q[t];
|
|
218
|
-
if (!i)
|
|
219
|
-
return console.warn(`No native component mapping found for '${t}', falling back to View`), n.View;
|
|
220
|
-
if (i === "Image") {
|
|
221
|
-
const o = $.forwardRef((s, r) => {
|
|
222
|
-
const l = P.c(5);
|
|
223
|
-
if (!s.src)
|
|
224
|
-
return null;
|
|
225
|
-
let a;
|
|
226
|
-
l[0] !== s ? (a = D(s), l[0] = s, l[1] = a) : a = l[1];
|
|
227
|
-
let u;
|
|
228
|
-
return l[2] !== r || l[3] !== a ? (u = /* @__PURE__ */ y.jsx(n.Image, { ref: r, ...a }), l[2] = r, l[3] = a, l[4] = u) : u = l[4], u;
|
|
229
|
-
});
|
|
230
|
-
return o.displayName = "PlatformPrimitiveImage", o;
|
|
231
|
-
}
|
|
232
|
-
const c = n[i];
|
|
233
|
-
return c || (console.warn(`Native component '${i}' not found, falling back to View`), n.View);
|
|
21
|
+
D.prototype.add = D.prototype.push = oe, D.prototype.has = se;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region ../../../node_modules/lodash-es/_arraySome.js
|
|
24
|
+
function ce(e, t) {
|
|
25
|
+
for (var n = -1, r = e == null ? 0 : e.length; ++n < r;) if (t(e[n], n, e)) return !0;
|
|
26
|
+
return !1;
|
|
234
27
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
});
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region ../../../node_modules/lodash-es/_cacheHas.js
|
|
30
|
+
function le(e, t) {
|
|
31
|
+
return e.has(t);
|
|
240
32
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region ../../../node_modules/lodash-es/_equalArrays.js
|
|
35
|
+
var ue = 1, de = 2;
|
|
36
|
+
function O(e, t, n, r, i, a) {
|
|
37
|
+
var o = n & ue, s = e.length, c = t.length;
|
|
38
|
+
if (s != c && !(o && c > s)) return !1;
|
|
39
|
+
var l = a.get(e), u = a.get(t);
|
|
40
|
+
if (l && u) return l == t && u == e;
|
|
41
|
+
var d = -1, f = !0, p = n & de ? new D() : void 0;
|
|
42
|
+
for (a.set(e, t), a.set(t, e); ++d < s;) {
|
|
43
|
+
var m = e[d], h = t[d];
|
|
44
|
+
if (r) var g = o ? r(h, m, d, t, e, a) : r(m, h, d, e, t, a);
|
|
45
|
+
if (g !== void 0) {
|
|
46
|
+
if (g) continue;
|
|
47
|
+
f = !1;
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
if (p) {
|
|
51
|
+
if (!ce(t, function(e, t) {
|
|
52
|
+
if (!le(p, t) && (m === e || i(m, e, n, r, a))) return p.push(t);
|
|
53
|
+
})) {
|
|
54
|
+
f = !1;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
} else if (!(m === h || i(m, h, n, r, a))) {
|
|
58
|
+
f = !1;
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return a.delete(e), a.delete(t), f;
|
|
256
63
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
const i = n?.StyleSheet?.flatten;
|
|
265
|
-
if (typeof t == "function" && typeof e == "function")
|
|
266
|
-
return (o) => {
|
|
267
|
-
const s = [t(o), e(o)];
|
|
268
|
-
return i ? i(s) : s;
|
|
269
|
-
};
|
|
270
|
-
if (typeof t == "function")
|
|
271
|
-
return (o) => {
|
|
272
|
-
const s = e ? [t(o), e] : t(o);
|
|
273
|
-
return i ? i(s) : s;
|
|
274
|
-
};
|
|
275
|
-
if (typeof e == "function")
|
|
276
|
-
return (o) => {
|
|
277
|
-
const s = t ? [t, e(o)] : e(o);
|
|
278
|
-
return i ? i(s) : s;
|
|
279
|
-
};
|
|
280
|
-
const c = [t, e].filter(Boolean);
|
|
281
|
-
return i ? i(c) : c;
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region ../../../node_modules/lodash-es/_mapToArray.js
|
|
66
|
+
function fe(e) {
|
|
67
|
+
var t = -1, n = Array(e.size);
|
|
68
|
+
return e.forEach(function(e, r) {
|
|
69
|
+
n[++t] = [r, e];
|
|
70
|
+
}), n;
|
|
282
71
|
}
|
|
283
|
-
|
|
284
|
-
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region ../../../node_modules/lodash-es/_setToArray.js
|
|
74
|
+
function pe(e) {
|
|
75
|
+
var t = -1, n = Array(e.size);
|
|
76
|
+
return e.forEach(function(e) {
|
|
77
|
+
n[++t] = e;
|
|
78
|
+
}), n;
|
|
285
79
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region ../../../node_modules/lodash-es/_equalByTag.js
|
|
82
|
+
var me = 1, he = 2, ge = "[object Boolean]", _e = "[object Date]", k = "[object Error]", A = "[object Map]", j = "[object Number]", M = "[object RegExp]", N = "[object Set]", P = "[object String]", F = "[object Symbol]", I = "[object ArrayBuffer]", ve = "[object DataView]", L = s ? s.prototype : void 0, R = L ? L.valueOf : void 0;
|
|
83
|
+
function ye(e, t, n, r, i, a, o) {
|
|
84
|
+
switch (n) {
|
|
85
|
+
case ve:
|
|
86
|
+
if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset) return !1;
|
|
87
|
+
e = e.buffer, t = t.buffer;
|
|
88
|
+
case I: return !(e.byteLength != t.byteLength || !a(new S(e), new S(t)));
|
|
89
|
+
case ge:
|
|
90
|
+
case _e:
|
|
91
|
+
case j: return re(+e, +t);
|
|
92
|
+
case k: return e.name == t.name && e.message == t.message;
|
|
93
|
+
case M:
|
|
94
|
+
case P: return e == t + "";
|
|
95
|
+
case A: var s = fe;
|
|
96
|
+
case N:
|
|
97
|
+
var c = r & me;
|
|
98
|
+
if (s ||= pe, e.size != t.size && !c) return !1;
|
|
99
|
+
var l = o.get(e);
|
|
100
|
+
if (l) return l == t;
|
|
101
|
+
r |= he, o.set(e, t);
|
|
102
|
+
var u = O(s(e), s(t), r, i, a, o);
|
|
103
|
+
return o.delete(e), u;
|
|
104
|
+
case F: if (R) return R.call(e) == R.call(t);
|
|
105
|
+
}
|
|
106
|
+
return !1;
|
|
289
107
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region ../../../node_modules/lodash-es/_equalObjects.js
|
|
110
|
+
var be = 1, xe = Object.prototype.hasOwnProperty;
|
|
111
|
+
function Se(e, t, n, r, i, a) {
|
|
112
|
+
var o = n & be, s = l(e), c = s.length;
|
|
113
|
+
if (c != l(t).length && !o) return !1;
|
|
114
|
+
for (var u = c; u--;) {
|
|
115
|
+
var d = s[u];
|
|
116
|
+
if (!(o ? d in t : xe.call(t, d))) return !1;
|
|
117
|
+
}
|
|
118
|
+
var f = a.get(e), p = a.get(t);
|
|
119
|
+
if (f && p) return f == t && p == e;
|
|
120
|
+
var m = !0;
|
|
121
|
+
a.set(e, t), a.set(t, e);
|
|
122
|
+
for (var h = o; ++u < c;) {
|
|
123
|
+
d = s[u];
|
|
124
|
+
var g = e[d], _ = t[d];
|
|
125
|
+
if (r) var v = o ? r(_, g, d, t, e, a) : r(g, _, d, e, t, a);
|
|
126
|
+
if (!(v === void 0 ? g === _ || i(g, _, n, r, a) : v)) {
|
|
127
|
+
m = !1;
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
h ||= d == "constructor";
|
|
131
|
+
}
|
|
132
|
+
if (m && !h) {
|
|
133
|
+
var y = e.constructor, b = t.constructor;
|
|
134
|
+
y != b && "constructor" in e && "constructor" in t && !(typeof y == "function" && y instanceof y && typeof b == "function" && b instanceof b) && (m = !1);
|
|
135
|
+
}
|
|
136
|
+
return a.delete(e), a.delete(t), m;
|
|
303
137
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
r[3] = l, r[4] = s, r[5] = a, r[6] = u;
|
|
327
|
-
} else
|
|
328
|
-
u = r[6];
|
|
329
|
-
if (u !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
|
|
330
|
-
return u;
|
|
331
|
-
let f;
|
|
332
|
-
return r[11] !== l || r[12] !== s || r[13] !== a ? (f = /* @__PURE__ */ y.jsx(i, { ...a, ref: s, children: l }), r[11] = l, r[12] = s, r[13] = a, r[14] = f) : f = r[14], f;
|
|
333
|
-
});
|
|
334
|
-
return c.displayName = "Slot", c;
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region ../../../node_modules/lodash-es/_baseIsEqualDeep.js
|
|
140
|
+
var Ce = 1, z = "[object Arguments]", B = "[object Array]", V = "[object Object]", H = Object.prototype.hasOwnProperty;
|
|
141
|
+
function we(e, t, n, r, i, o) {
|
|
142
|
+
var s = a(e), c = a(t), l = s ? B : g(e), u = c ? B : g(t);
|
|
143
|
+
l = l == z ? V : l, u = u == z ? V : u;
|
|
144
|
+
var d = l == V, f = u == V, p = l == u;
|
|
145
|
+
if (p && m(e)) {
|
|
146
|
+
if (!m(t)) return !1;
|
|
147
|
+
s = !0, d = !1;
|
|
148
|
+
}
|
|
149
|
+
if (p && !d) return o ||= new C(), s || h(e) ? O(e, t, n, r, i, o) : ye(e, t, l, n, r, i, o);
|
|
150
|
+
if (!(n & Ce)) {
|
|
151
|
+
var _ = d && H.call(e, "__wrapped__"), v = f && H.call(t, "__wrapped__");
|
|
152
|
+
if (_ || v) {
|
|
153
|
+
var y = _ ? e.value() : e, b = v ? t.value() : t;
|
|
154
|
+
return o ||= new C(), i(y, b, n, r, o);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return p ? (o ||= new C(), Se(e, t, n, r, i, o)) : !1;
|
|
335
158
|
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region ../../../node_modules/lodash-es/_baseIsEqual.js
|
|
161
|
+
function U(e, t, n, r, i) {
|
|
162
|
+
return e === t ? !0 : e == null || t == null || !T(e) && !T(t) ? e !== e && t !== t : we(e, t, n, r, U, i);
|
|
163
|
+
}
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region ../../../node_modules/lodash-es/_baseIsMatch.js
|
|
166
|
+
var Te = 1, Ee = 2;
|
|
167
|
+
function De(e, t, n, r) {
|
|
168
|
+
var i = n.length, a = i, o = !r;
|
|
169
|
+
if (e == null) return !a;
|
|
170
|
+
for (e = Object(e); i--;) {
|
|
171
|
+
var s = n[i];
|
|
172
|
+
if (o && s[2] ? s[1] !== e[s[0]] : !(s[0] in e)) return !1;
|
|
173
|
+
}
|
|
174
|
+
for (; ++i < a;) {
|
|
175
|
+
s = n[i];
|
|
176
|
+
var c = s[0], l = e[c], u = s[1];
|
|
177
|
+
if (o && s[2]) {
|
|
178
|
+
if (l === void 0 && !(c in e)) return !1;
|
|
179
|
+
} else {
|
|
180
|
+
var d = new C();
|
|
181
|
+
if (r) var f = r(l, u, c, e, t, d);
|
|
182
|
+
if (!(f === void 0 ? U(u, l, Te | Ee, r, d) : f)) return !1;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return !0;
|
|
186
|
+
}
|
|
187
|
+
//#endregion
|
|
188
|
+
//#region ../../../node_modules/lodash-es/_isStrictComparable.js
|
|
189
|
+
function W(e) {
|
|
190
|
+
return e === e && !o(e);
|
|
191
|
+
}
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region ../../../node_modules/lodash-es/_getMatchData.js
|
|
194
|
+
function Oe(e) {
|
|
195
|
+
for (var t = v(e), n = t.length; n--;) {
|
|
196
|
+
var r = t[n], i = e[r];
|
|
197
|
+
t[n] = [
|
|
198
|
+
r,
|
|
199
|
+
i,
|
|
200
|
+
W(i)
|
|
201
|
+
];
|
|
202
|
+
}
|
|
203
|
+
return t;
|
|
204
|
+
}
|
|
205
|
+
//#endregion
|
|
206
|
+
//#region ../../../node_modules/lodash-es/_matchesStrictComparable.js
|
|
207
|
+
function G(e, t) {
|
|
208
|
+
return function(n) {
|
|
209
|
+
return n == null ? !1 : n[e] === t && (t !== void 0 || e in Object(n));
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
//#endregion
|
|
213
|
+
//#region ../../../node_modules/lodash-es/_baseMatches.js
|
|
214
|
+
function ke(e) {
|
|
215
|
+
var t = Oe(e);
|
|
216
|
+
return t.length == 1 && t[0][2] ? G(t[0][0], t[0][1]) : function(n) {
|
|
217
|
+
return n === e || De(n, e, t);
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
//#endregion
|
|
221
|
+
//#region ../../../node_modules/lodash-es/_baseHasIn.js
|
|
222
|
+
function Ae(e, t) {
|
|
223
|
+
return e != null && t in Object(e);
|
|
224
|
+
}
|
|
225
|
+
//#endregion
|
|
226
|
+
//#region ../../../node_modules/lodash-es/_hasPath.js
|
|
227
|
+
function je(e, t, n) {
|
|
228
|
+
t = f(t, e);
|
|
229
|
+
for (var r = -1, i = t.length, o = !1; ++r < i;) {
|
|
230
|
+
var s = w(t[r]);
|
|
231
|
+
if (!(o = e != null && n(e, s))) break;
|
|
232
|
+
e = e[s];
|
|
233
|
+
}
|
|
234
|
+
return o || ++r != i ? o : (i = e == null ? 0 : e.length, !!i && te(i) && u(s, i) && (a(e) || c(e)));
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region ../../../node_modules/lodash-es/hasIn.js
|
|
238
|
+
function Me(e, t) {
|
|
239
|
+
return e != null && je(e, t, Ae);
|
|
240
|
+
}
|
|
241
|
+
//#endregion
|
|
242
|
+
//#region ../../../node_modules/lodash-es/_baseMatchesProperty.js
|
|
243
|
+
var Ne = 1, Pe = 2;
|
|
244
|
+
function Fe(e, t) {
|
|
245
|
+
return x(e) && W(t) ? G(w(e), t) : function(n) {
|
|
246
|
+
var r = d(n, e);
|
|
247
|
+
return r === void 0 && r === t ? Me(n, e) : U(t, r, Ne | Pe);
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region ../../../node_modules/lodash-es/_baseProperty.js
|
|
252
|
+
function Ie(e) {
|
|
253
|
+
return function(t) {
|
|
254
|
+
return t?.[e];
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region ../../../node_modules/lodash-es/_basePropertyDeep.js
|
|
259
|
+
function Le(e) {
|
|
260
|
+
return function(t) {
|
|
261
|
+
return _(t, e);
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region ../../../node_modules/lodash-es/property.js
|
|
266
|
+
function Re(e) {
|
|
267
|
+
return x(e) ? Ie(w(e)) : Le(e);
|
|
268
|
+
}
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region ../../../node_modules/lodash-es/_baseIteratee.js
|
|
271
|
+
function ze(e) {
|
|
272
|
+
return typeof e == "function" ? e : e == null ? ne : typeof e == "object" ? a(e) ? Fe(e[0], e[1]) : ke(e) : Re(e);
|
|
273
|
+
}
|
|
274
|
+
//#endregion
|
|
275
|
+
//#region ../../../node_modules/lodash-es/_baseFilter.js
|
|
276
|
+
function Be(e, t) {
|
|
277
|
+
var n = [];
|
|
278
|
+
return y(e, function(e, r, i) {
|
|
279
|
+
t(e, r, i) && n.push(e);
|
|
280
|
+
}), n;
|
|
281
|
+
}
|
|
282
|
+
//#endregion
|
|
283
|
+
//#region ../../../node_modules/lodash-es/filter.js
|
|
284
|
+
function Ve(e, t) {
|
|
285
|
+
return (a(e) ? b : Be)(e, ze(t, 3));
|
|
286
|
+
}
|
|
287
|
+
//#endregion
|
|
288
|
+
//#region src/lib/configs/vendure-badge-plugin.ts
|
|
289
|
+
var K = new ee({
|
|
290
|
+
name: "badges",
|
|
291
|
+
enableFeatures: { showBadges: ({ badges: e = [], parentComponent: t }) => {
|
|
292
|
+
let n = t ? K.getSettings().availablePositions[t] : K.getSettings().defaultPositions;
|
|
293
|
+
return {
|
|
294
|
+
badges: Ve(e, (e) => n ? n.includes(e.position) : !0),
|
|
295
|
+
availablePositions: n
|
|
296
|
+
};
|
|
297
|
+
} },
|
|
298
|
+
queryUpdates: {},
|
|
299
|
+
settings: {
|
|
300
|
+
defaultPositions: [
|
|
301
|
+
"top-left",
|
|
302
|
+
"top-right",
|
|
303
|
+
"bottom-left",
|
|
304
|
+
"bottom-right"
|
|
305
|
+
],
|
|
306
|
+
availablePositions: {
|
|
307
|
+
productListItem: [
|
|
308
|
+
"top-left",
|
|
309
|
+
"top-right",
|
|
310
|
+
"bottom-left",
|
|
311
|
+
"bottom-right"
|
|
312
|
+
],
|
|
313
|
+
productDetail: [
|
|
314
|
+
"top-left",
|
|
315
|
+
"top-right",
|
|
316
|
+
"bottom-left",
|
|
317
|
+
"bottom-right"
|
|
318
|
+
],
|
|
319
|
+
imageCarousel: [
|
|
320
|
+
"top-left",
|
|
321
|
+
"top-right",
|
|
322
|
+
"bottom-left",
|
|
323
|
+
"bottom-right"
|
|
324
|
+
]
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
K.setQueryUpdates({
|
|
329
|
+
product: { fields: [{ badges: [
|
|
330
|
+
"id",
|
|
331
|
+
"position",
|
|
332
|
+
"assetId",
|
|
333
|
+
{ asset: [
|
|
334
|
+
"id",
|
|
335
|
+
"name",
|
|
336
|
+
"preview",
|
|
337
|
+
"source"
|
|
338
|
+
] },
|
|
339
|
+
{ collection: ["id", "name"] }
|
|
340
|
+
] }] },
|
|
341
|
+
search: { fields: [{ items: [{ badges: [
|
|
342
|
+
"id",
|
|
343
|
+
"position",
|
|
344
|
+
"assetId",
|
|
345
|
+
{ asset: [
|
|
346
|
+
"id",
|
|
347
|
+
"name",
|
|
348
|
+
"preview",
|
|
349
|
+
"source"
|
|
350
|
+
] },
|
|
351
|
+
{ collection: ["id", "name"] }
|
|
352
|
+
] }] }] },
|
|
353
|
+
products: { fields: [{ items: [{ badges: [
|
|
354
|
+
"id",
|
|
355
|
+
"position",
|
|
356
|
+
"assetId",
|
|
357
|
+
{ asset: [
|
|
358
|
+
"id",
|
|
359
|
+
"name",
|
|
360
|
+
"preview",
|
|
361
|
+
"source"
|
|
362
|
+
] },
|
|
363
|
+
{ collection: ["id", "name"] }
|
|
364
|
+
] }] }] },
|
|
365
|
+
briefProducts: { fields: [{ items: [{ badges: [
|
|
366
|
+
"id",
|
|
367
|
+
"position",
|
|
368
|
+
"assetId",
|
|
369
|
+
{ asset: [
|
|
370
|
+
"id",
|
|
371
|
+
"name",
|
|
372
|
+
"preview",
|
|
373
|
+
"source"
|
|
374
|
+
] },
|
|
375
|
+
{ collection: ["id", "name"] }
|
|
376
|
+
] }] }] }
|
|
377
|
+
}), K.setRequests({ getBadges: async () => K.getSdk().createRequest({
|
|
378
|
+
operation: "badges",
|
|
379
|
+
fields: ["totalItems", { items: [
|
|
380
|
+
"id",
|
|
381
|
+
"createdAt",
|
|
382
|
+
"updatedAt",
|
|
383
|
+
"collectionId",
|
|
384
|
+
"position",
|
|
385
|
+
"assetId",
|
|
386
|
+
{ asset: [
|
|
387
|
+
"id",
|
|
388
|
+
"name",
|
|
389
|
+
"preview",
|
|
390
|
+
"source"
|
|
391
|
+
] },
|
|
392
|
+
{ collection: ["id", "name"] }
|
|
393
|
+
] }]
|
|
394
|
+
}, { options: { take: 100 } }, !1).then((e) => e.data).catch((e) => ({
|
|
395
|
+
message: e.message,
|
|
396
|
+
errorCode: e.code || "unknown"
|
|
397
|
+
})) });
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region src/lib/components/product-badges.tsx
|
|
400
|
+
var q = t(), J = "ProductBadge", [Y] = i(J), [He, Ue] = Y(J), X = ({ children: t, product: n, __scopeProductBadge: i, style: a, ...o }) => {
|
|
401
|
+
let s = ie(null), c = e(E());
|
|
402
|
+
if (!K.getEnabled()) return null;
|
|
403
|
+
let { badges: l } = n;
|
|
404
|
+
if (!l) return null;
|
|
405
|
+
let u = l.reduce((e, t) => (e[t.position] || (e[t.position] = []), e[t.position].push(t), e), {}), d = {
|
|
406
|
+
groupedBadges: u,
|
|
407
|
+
badges: l,
|
|
408
|
+
badgesRef: s,
|
|
409
|
+
positions: Object.keys(u)
|
|
410
|
+
};
|
|
411
|
+
return /* @__PURE__ */ (0, q.jsx)(He, {
|
|
412
|
+
scope: i,
|
|
413
|
+
...d,
|
|
414
|
+
children: /* @__PURE__ */ (0, q.jsx)(c, {
|
|
415
|
+
...o,
|
|
416
|
+
style: a,
|
|
417
|
+
children: r(t, d)
|
|
418
|
+
})
|
|
419
|
+
});
|
|
422
420
|
};
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
421
|
+
X.displayName = J;
|
|
422
|
+
var Z = ({ children: t, position: n, asChild: i, __scopeProductBadge: a, ...o }) => {
|
|
423
|
+
let s = e(E(), i, "div"), { groupedBadges: c } = Ue(J, a), l = c[n];
|
|
424
|
+
return /* @__PURE__ */ (0, q.jsx)(s, {
|
|
425
|
+
...o,
|
|
426
|
+
"data-position": n,
|
|
427
|
+
children: r(t, {
|
|
428
|
+
badges: l,
|
|
429
|
+
position: n
|
|
430
|
+
})
|
|
431
|
+
});
|
|
432
|
+
}, Q = ({ children: t, asChild: n, badge: r, ...i }) => /* @__PURE__ */ (0, q.jsx)(e(E(), n, "div"), {
|
|
433
|
+
...i,
|
|
434
|
+
"data-badge-id": r?.id,
|
|
435
|
+
children: t
|
|
436
|
+
}), $ = ({ badge: t, asChild: r, ...i }) => {
|
|
437
|
+
let a = E(), o = e(a, r, "img"), s = n(i, a);
|
|
438
|
+
return /* @__PURE__ */ (0, q.jsx)(o, {
|
|
439
|
+
src: t.asset?.preview,
|
|
440
|
+
alt: t.collection.name,
|
|
441
|
+
"data-badge-name": t.collection.name,
|
|
442
|
+
...s
|
|
443
|
+
});
|
|
431
444
|
};
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
445
|
+
Z.displayName = "ProductBadgeGroup", Q.displayName = "ProductBadgeItem", $.displayName = "ProductBadgeImage";
|
|
446
|
+
var We = {
|
|
447
|
+
Root: X,
|
|
448
|
+
Group: Z,
|
|
449
|
+
Item: Q,
|
|
450
|
+
Image: $
|
|
438
451
|
};
|
|
452
|
+
//#endregion
|
|
453
|
+
export { We as ProductBadge, K as VendureBadgePlugin };
|