@everymatrix/loyalty-shop 0.2.4 → 0.2.6
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/components/{LoyaltyPagination-B8amLojn.cjs → LoyaltyPagination-B7JqsoUi.cjs} +8 -8
- package/components/{LoyaltyPagination-B2XwqERr.cjs → LoyaltyPagination-BRav_RW5.cjs} +8 -8
- package/components/{LoyaltyPagination-DOu-qNFO.js → LoyaltyPagination-Cw2snZwZ.js} +10 -10
- package/components/{LoyaltyPagination-BqHc2i2H.js → LoyaltyPagination-CyjgdUPo.js} +10 -10
- package/components/LoyaltyPointsCard-CFk3DpjI.js +249 -0
- package/components/LoyaltyPointsCard-DTOQlcMH.js +242 -0
- package/components/LoyaltyPointsCard-Xb627em8.cjs +18 -0
- package/components/LoyaltyPointsCard-njx77PMq.cjs +18 -0
- package/components/LoyaltyShop-8d3N_F-0.cjs +27 -0
- package/components/LoyaltyShop-BKubFlFr.js +478 -0
- package/components/LoyaltyShop-D_Oyu_cp.cjs +27 -0
- package/components/LoyaltyShop-Dfybp9ut.js +452 -0
- package/components/{LoyaltyShopItem-DL7R43c_.js → LoyaltyShopItem-BXrrNl9f.js} +72 -72
- package/components/LoyaltyShopItem-CGOptttz.cjs +5 -0
- package/components/{LoyaltyShopItem-bzNnPlQa.js → LoyaltyShopItem-CqY63kaT.js} +103 -103
- package/components/LoyaltyShopItem-DEz9OVzD.cjs +5 -0
- package/es2015/loyalty-shop.cjs +1 -1
- package/es2015/loyalty-shop.js +2 -2
- package/esnext/loyalty-shop.cjs +1 -1
- package/esnext/loyalty-shop.js +2 -2
- package/package.json +1 -1
- package/components/LoyaltyPointsCard-BjF9SVWO.js +0 -249
- package/components/LoyaltyPointsCard-C2Xj_0zZ.cjs +0 -18
- package/components/LoyaltyPointsCard-DKq6yH_i.js +0 -242
- package/components/LoyaltyPointsCard-DO9GoE9Q.cjs +0 -18
- package/components/LoyaltyShop-CBH93UYT.js +0 -452
- package/components/LoyaltyShop-CCeVtHJ7.cjs +0 -27
- package/components/LoyaltyShop-CnX4zXMd.cjs +0 -27
- package/components/LoyaltyShop-aSar2Vkc.js +0 -478
- package/components/LoyaltyShopItem-BvxV4bEm.cjs +0 -5
- package/components/LoyaltyShopItem-CYoPPSZj.cjs +0 -5
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
var q = (
|
|
2
|
-
var
|
|
1
|
+
var q = (_, a, r) => new Promise((d, v) => {
|
|
2
|
+
var c = (l) => {
|
|
3
3
|
try {
|
|
4
|
-
|
|
5
|
-
} catch (
|
|
6
|
-
|
|
4
|
+
u(r.next(l));
|
|
5
|
+
} catch (o) {
|
|
6
|
+
v(o);
|
|
7
7
|
}
|
|
8
|
-
},
|
|
8
|
+
}, f = (l) => {
|
|
9
9
|
try {
|
|
10
|
-
|
|
11
|
-
} catch (
|
|
12
|
-
|
|
10
|
+
u(r.throw(l));
|
|
11
|
+
} catch (o) {
|
|
12
|
+
v(o);
|
|
13
13
|
}
|
|
14
|
-
},
|
|
15
|
-
|
|
14
|
+
}, u = (l) => l.done ? d(l.value) : Promise.resolve(l.value).then(c, f);
|
|
15
|
+
u((r = r.apply(_, a)).next());
|
|
16
16
|
});
|
|
17
|
-
import { z as
|
|
18
|
-
import { L as Ue } from "./LoyaltyPointsCard-
|
|
17
|
+
import { z as fe, c as Y, p as Q, a as he, b as p, s as ye, d as G, A as C, B as ge, C as _e, E as K, F as b, G as ve, H as we, m as s, f as be, g as xe, i as U, h as S, j as X, I as Ee, J as Re, K as ke, L as Se, k as m, l as Ie, n as M, q as E, o as I, r as O, t as z, v as N, M as Ne, w as j, u as T, x as Te, $ as Le, N as Ce, O as W } from "./LoyaltyPagination-Cw2snZwZ.js";
|
|
18
|
+
import { L as Ue } from "./LoyaltyPointsCard-CFk3DpjI.js";
|
|
19
19
|
typeof globalThis.HTMLElement == "undefined" && (globalThis.HTMLElement = class {
|
|
20
20
|
}, globalThis.customElements = { define() {
|
|
21
21
|
}, get() {
|
|
22
22
|
}, whenDefined() {
|
|
23
23
|
} });
|
|
24
24
|
if (typeof window != "undefined") {
|
|
25
|
-
let
|
|
26
|
-
return function(...
|
|
25
|
+
let _ = function(a) {
|
|
26
|
+
return function(...r) {
|
|
27
27
|
try {
|
|
28
|
-
return a.apply(this,
|
|
28
|
+
return a.apply(this, r);
|
|
29
29
|
} catch (d) {
|
|
30
30
|
if (d instanceof DOMException && d.message.includes("has already been used with this registry") || d instanceof Error && d.message.includes("Cannot define multiple custom elements with the same tag name"))
|
|
31
31
|
return !1;
|
|
@@ -33,9 +33,9 @@ if (typeof window != "undefined") {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
-
customElements.define =
|
|
37
|
-
const
|
|
38
|
-
customElements.get("loyalty-points-card") || customElements.define("loyalty-points-card",
|
|
36
|
+
customElements.define = _(customElements.define), import("./LoyaltyPointsCard-CFk3DpjI.js").then((a) => a.a).then((a) => {
|
|
37
|
+
const r = a.default || a;
|
|
38
|
+
customElements.get("loyalty-points-card") || customElements.define("loyalty-points-card", r.element || r);
|
|
39
39
|
}).catch((a) => {
|
|
40
40
|
console.error("BOOT ERROR:", a);
|
|
41
41
|
});
|
|
@@ -77,27 +77,27 @@ const Me = {
|
|
|
77
77
|
back: "Vissza"
|
|
78
78
|
}
|
|
79
79
|
}, Oe = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='800px'%20height='800px'%20viewBox='0%200%20120%20120'%20fill='none'%3e%3crect%20width='120'%20height='120'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M33.2503%2038.4816C33.2603%2037.0472%2034.4199%2035.8864%2035.8543%2035.875H83.1463C84.5848%2035.875%2085.7503%2037.0431%2085.7503%2038.4816V80.5184C85.7403%2081.9528%2084.5807%2083.1136%2083.1463%2083.125H35.8543C34.4158%2083.1236%2033.2503%2081.957%2033.2503%2080.5184V38.4816ZM80.5006%2041.1251H38.5006V77.8751L62.8921%2053.4783C63.9172%2052.4536%2065.5788%2052.4536%2066.6039%2053.4783L80.5006%2067.4013V41.1251ZM43.75%2051.6249C43.75%2054.5244%2046.1005%2056.8749%2049%2056.8749C51.8995%2056.8749%2054.25%2054.5244%2054.25%2051.6249C54.25%2048.7254%2051.8995%2046.3749%2049%2046.3749C46.1005%2046.3749%2043.75%2048.7254%2043.75%2051.6249Z'%20fill='%23687787'/%3e%3c/svg%3e";
|
|
80
|
-
var ze = j('<img class="loyalty-shop-item__image
|
|
80
|
+
var ze = j('<img class="loyalty-shop-item__image"/>'), je = j('<div class="loyalty-shop-item__card loyalty-shop-item__card--description"><p class="loyalty-shop-item__description"> </p></div>'), Ve = j('<div class="loyalty-shop-item"><div class="loyalty-shop-item__card"><!> <span class="loyalty-shop-item__title"> </span> <span class="loyalty-shop-item__points"> </span> <button class="loyalty-shop-item__button" type="button"> </button></div> <!> <!></div>');
|
|
81
81
|
const Ae = {
|
|
82
82
|
hash: "svelte-ravnpu",
|
|
83
|
-
code: `.loyalty-shop-item
|
|
83
|
+
code: `.loyalty-shop-item {display:flex;flex-direction:column;gap:12px;}.loyalty-shop-item__card {display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:10px;border:1px solid var(--border-default, rgba(251, 251, 251, 0.15));background-color:var(--app-container-bg-default, #022652);}.loyalty-shop-item__card--description {min-height:120px;}.loyalty-shop-item__image {width:100%;height:170px;border-radius:6px;}.loyalty-shop-item__title {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop-item__points {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop-item__button {margin-top:auto;width:100%;height:37px;padding:8px 16px;border:none;border-radius:6px;background:var(--button-primary-bg-default, #ffcc00);color:var(--button-primary-text-default, #261d00);font-size:12px;font-weight:400;cursor:pointer;}.loyalty-shop-item__button:disabled {opacity:0.4;cursor:default;}.loyalty-shop-item__description {color:var(--text-subtle, #dfe3e8);font-size:12px;line-height:1.4;margin:0;font-weight:500;min-height:120px;}
|
|
84
84
|
|
|
85
|
-
@media (min-width: 768px) {.loyalty-shop-item__image
|
|
85
|
+
@media (min-width: 768px) {.loyalty-shop-item__image {height:clamp(170px, 30vw, 400px);object-fit:cover;}
|
|
86
86
|
}`
|
|
87
87
|
};
|
|
88
|
-
function $(
|
|
89
|
-
Q(a, !0),
|
|
90
|
-
const
|
|
91
|
-
|
|
88
|
+
function $(_, a) {
|
|
89
|
+
Q(a, !0), he(_, Ae);
|
|
90
|
+
const r = () => Te(Le, "$_", d), [d, v] = Ie(), c = p(a, "apiEndpoint", 7, ""), f = p(a, "userSession", 7, ""), u = p(a, "locale", 7, ""), l = p(a, "itemId", 7, ""), o = p(a, "elevateReward"), R = p(a, "translationUrl");
|
|
91
|
+
ye({ withLocale: u(), translations: {} }), Object.entries(Me).forEach(([e, t]) => {
|
|
92
92
|
G(e, t);
|
|
93
93
|
});
|
|
94
|
-
let i = C(
|
|
94
|
+
let i = C(ge(o())), x = C(!1), V = C("");
|
|
95
95
|
const A = T(() => {
|
|
96
|
-
var e, t, n,
|
|
97
|
-
return (
|
|
96
|
+
var e, t, n, h;
|
|
97
|
+
return (h = (n = (t = (e = s(i)) == null ? void 0 : e.presentation) == null ? void 0 : t.assets) == null ? void 0 : n[0]) != null ? h : "";
|
|
98
98
|
}), B = T(() => {
|
|
99
|
-
var e, t, n,
|
|
100
|
-
return (w = (
|
|
99
|
+
var e, t, n, h, w;
|
|
100
|
+
return (w = (h = (t = (e = s(i)) == null ? void 0 : e.presentation) == null ? void 0 : t.displayName) != null ? h : (n = s(i)) == null ? void 0 : n.displayName) != null ? w : "";
|
|
101
101
|
}), D = T(() => {
|
|
102
102
|
var e, t, n;
|
|
103
103
|
return (n = (t = (e = s(i)) == null ? void 0 : e.presentation) == null ? void 0 : t.description) != null ? n : "";
|
|
@@ -114,21 +114,21 @@ function $(g, a) {
|
|
|
114
114
|
console.log("loyalty shop item translation url err:", t);
|
|
115
115
|
});
|
|
116
116
|
};
|
|
117
|
-
|
|
117
|
+
_e(() => {
|
|
118
118
|
R() && te();
|
|
119
119
|
}), K(() => {
|
|
120
|
-
if (
|
|
121
|
-
b(i,
|
|
120
|
+
if (o()) {
|
|
121
|
+
b(i, o(), !0);
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
if (!
|
|
124
|
+
if (!c() || !l())
|
|
125
125
|
return;
|
|
126
126
|
let e = !1;
|
|
127
|
-
return
|
|
127
|
+
return ve(
|
|
128
128
|
{
|
|
129
|
-
apiEndpoint:
|
|
130
|
-
userSession:
|
|
131
|
-
locale:
|
|
129
|
+
apiEndpoint: c(),
|
|
130
|
+
userSession: f(),
|
|
131
|
+
locale: u()
|
|
132
132
|
},
|
|
133
133
|
l()
|
|
134
134
|
).then((t) => {
|
|
@@ -141,12 +141,12 @@ function $(g, a) {
|
|
|
141
141
|
s(x) || !s(H) || !s(i) || Ce(s(i).displayName || s(i).presentation.displayName, s(i).id);
|
|
142
142
|
}, se = () => q(this, null, function* () {
|
|
143
143
|
var t;
|
|
144
|
-
if (!
|
|
144
|
+
if (!c() || !s(i) || s(x))
|
|
145
145
|
return;
|
|
146
146
|
b(x, !0), b(V, "");
|
|
147
147
|
const e = s(i).id;
|
|
148
148
|
try {
|
|
149
|
-
yield Ee({ apiEndpoint:
|
|
149
|
+
yield Ee({ apiEndpoint: c(), userSession: f() }, e), Re(e), ke();
|
|
150
150
|
} catch (n) {
|
|
151
151
|
b(V, (t = n == null ? void 0 : n.message) != null ? t : "Redeem failed", !0), Se(e, n);
|
|
152
152
|
} finally {
|
|
@@ -155,29 +155,29 @@ function $(g, a) {
|
|
|
155
155
|
});
|
|
156
156
|
K(() => {
|
|
157
157
|
const e = (t) => {
|
|
158
|
-
var n,
|
|
159
|
-
((n = t.data) == null ? void 0 : n.type) === we.REDEEM_REWARD_CONFIRMED && ((
|
|
158
|
+
var n, h, w;
|
|
159
|
+
((n = t.data) == null ? void 0 : n.type) === we.REDEEM_REWARD_CONFIRMED && ((h = t.data) == null ? void 0 : h.id) === ((w = s(i)) == null ? void 0 : w.id) && se();
|
|
160
160
|
};
|
|
161
161
|
return window.addEventListener("message", e), () => window.removeEventListener("message", e);
|
|
162
162
|
});
|
|
163
163
|
var ne = {
|
|
164
164
|
get apiEndpoint() {
|
|
165
|
-
return
|
|
165
|
+
return c();
|
|
166
166
|
},
|
|
167
167
|
set apiEndpoint(e = "") {
|
|
168
|
-
|
|
168
|
+
c(e), m();
|
|
169
169
|
},
|
|
170
170
|
get userSession() {
|
|
171
|
-
return
|
|
171
|
+
return f();
|
|
172
172
|
},
|
|
173
173
|
set userSession(e = "") {
|
|
174
|
-
|
|
174
|
+
f(e), m();
|
|
175
175
|
},
|
|
176
176
|
get locale() {
|
|
177
|
-
return
|
|
177
|
+
return u();
|
|
178
178
|
},
|
|
179
179
|
set locale(e = "") {
|
|
180
|
-
|
|
180
|
+
u(e), m();
|
|
181
181
|
},
|
|
182
182
|
get itemId() {
|
|
183
183
|
return l();
|
|
@@ -186,10 +186,10 @@ function $(g, a) {
|
|
|
186
186
|
l(e), m();
|
|
187
187
|
},
|
|
188
188
|
get elevateReward() {
|
|
189
|
-
return
|
|
189
|
+
return o();
|
|
190
190
|
},
|
|
191
191
|
set elevateReward(e) {
|
|
192
|
-
|
|
192
|
+
o(e), m();
|
|
193
193
|
},
|
|
194
194
|
get translationUrl() {
|
|
195
195
|
return R();
|
|
@@ -197,63 +197,63 @@ function $(g, a) {
|
|
|
197
197
|
set translationUrl(e) {
|
|
198
198
|
R(e), m();
|
|
199
199
|
}
|
|
200
|
-
}, F = be(),
|
|
200
|
+
}, F = be(), oe = xe(F);
|
|
201
201
|
{
|
|
202
|
-
var
|
|
203
|
-
var t = Ve(), n = M(t),
|
|
202
|
+
var re = (e) => {
|
|
203
|
+
var t = Ve(), n = M(t), h = M(n);
|
|
204
204
|
{
|
|
205
|
-
var w = (
|
|
206
|
-
var
|
|
205
|
+
var w = (y) => {
|
|
206
|
+
var g = ze();
|
|
207
207
|
z(() => {
|
|
208
|
-
W(
|
|
209
|
-
}), S(
|
|
208
|
+
W(g, "src", s(A) || Oe), W(g, "alt", s(B));
|
|
209
|
+
}), S(y, g);
|
|
210
210
|
};
|
|
211
|
-
U(
|
|
212
|
-
s(A) &&
|
|
211
|
+
U(h, (y) => {
|
|
212
|
+
s(A) && y(w);
|
|
213
213
|
});
|
|
214
214
|
}
|
|
215
|
-
var P = E(
|
|
215
|
+
var P = E(h, 2), le = I(P, !0), Z = E(P, 2), de = I(Z), L = E(Z, 2), ce = I(L, !0);
|
|
216
216
|
O(n);
|
|
217
217
|
var J = E(n, 2);
|
|
218
218
|
Ue(J, {
|
|
219
219
|
get apiEndpoint() {
|
|
220
|
-
return
|
|
220
|
+
return c();
|
|
221
221
|
},
|
|
222
222
|
get userSession() {
|
|
223
|
-
return
|
|
223
|
+
return f();
|
|
224
224
|
},
|
|
225
225
|
get locale() {
|
|
226
|
-
return
|
|
226
|
+
return u();
|
|
227
227
|
}
|
|
228
228
|
});
|
|
229
|
-
var
|
|
229
|
+
var ue = E(J, 2);
|
|
230
230
|
{
|
|
231
|
-
var pe = (
|
|
232
|
-
var
|
|
233
|
-
O(
|
|
231
|
+
var pe = (y) => {
|
|
232
|
+
var g = je(), k = M(g), me = I(k, !0);
|
|
233
|
+
O(g), z(() => N(me, s(D))), S(y, g);
|
|
234
234
|
};
|
|
235
|
-
U(
|
|
236
|
-
s(D) &&
|
|
235
|
+
U(ue, (y) => {
|
|
236
|
+
s(D) && y(pe);
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
239
|
O(t), z(
|
|
240
|
-
(
|
|
240
|
+
(y, g) => {
|
|
241
241
|
var k;
|
|
242
242
|
N(le, s(B)), N(de, `${(k = s(i).points) != null ? k : ""}
|
|
243
|
-
${
|
|
243
|
+
${y != null ? y : ""}`), L.disabled = !s(H) || s(x), N(ce, g);
|
|
244
244
|
},
|
|
245
|
-
[() =>
|
|
245
|
+
[() => r()("tokens"), () => r()("buyNow")]
|
|
246
246
|
), Ne("click", L, ae), S(e, t);
|
|
247
247
|
};
|
|
248
|
-
U(
|
|
249
|
-
s(i) && e(
|
|
248
|
+
U(oe, (e) => {
|
|
249
|
+
s(i) && e(re);
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
|
-
S(
|
|
252
|
+
S(_, F);
|
|
253
253
|
var ie = X(ne);
|
|
254
|
-
return
|
|
254
|
+
return v(), ie;
|
|
255
255
|
}
|
|
256
|
-
|
|
256
|
+
fe(["click"]);
|
|
257
257
|
Y(
|
|
258
258
|
$,
|
|
259
259
|
{
|
|
@@ -268,65 +268,65 @@ Y(
|
|
|
268
268
|
[],
|
|
269
269
|
{ mode: "open" }
|
|
270
270
|
);
|
|
271
|
-
function ee(
|
|
271
|
+
function ee(_, a) {
|
|
272
272
|
Q(a, !0);
|
|
273
|
-
let
|
|
273
|
+
let r = p(a, "apiEndpoint", 7, ""), d = p(a, "userSession", 7, ""), v = p(a, "locale", 7, ""), c = p(a, "itemId", 7, ""), f = p(a, "elevateReward"), u = p(a, "translationUrl");
|
|
274
274
|
var l = {
|
|
275
275
|
get apiEndpoint() {
|
|
276
|
-
return
|
|
276
|
+
return r();
|
|
277
277
|
},
|
|
278
|
-
set apiEndpoint(
|
|
279
|
-
o
|
|
278
|
+
set apiEndpoint(o = "") {
|
|
279
|
+
r(o), m();
|
|
280
280
|
},
|
|
281
281
|
get userSession() {
|
|
282
282
|
return d();
|
|
283
283
|
},
|
|
284
|
-
set userSession(
|
|
285
|
-
d(
|
|
284
|
+
set userSession(o = "") {
|
|
285
|
+
d(o), m();
|
|
286
286
|
},
|
|
287
287
|
get locale() {
|
|
288
|
-
return
|
|
288
|
+
return v();
|
|
289
289
|
},
|
|
290
|
-
set locale(
|
|
291
|
-
|
|
290
|
+
set locale(o = "") {
|
|
291
|
+
v(o), m();
|
|
292
292
|
},
|
|
293
293
|
get itemId() {
|
|
294
|
-
return
|
|
294
|
+
return c();
|
|
295
295
|
},
|
|
296
|
-
set itemId(
|
|
297
|
-
|
|
296
|
+
set itemId(o = "") {
|
|
297
|
+
c(o), m();
|
|
298
298
|
},
|
|
299
299
|
get elevateReward() {
|
|
300
|
-
return
|
|
300
|
+
return f();
|
|
301
301
|
},
|
|
302
|
-
set elevateReward(
|
|
303
|
-
|
|
302
|
+
set elevateReward(o) {
|
|
303
|
+
f(o), m();
|
|
304
304
|
},
|
|
305
305
|
get translationUrl() {
|
|
306
|
-
return
|
|
306
|
+
return u();
|
|
307
307
|
},
|
|
308
|
-
set translationUrl(
|
|
309
|
-
|
|
308
|
+
set translationUrl(o) {
|
|
309
|
+
u(o), m();
|
|
310
310
|
}
|
|
311
311
|
};
|
|
312
|
-
return $(
|
|
312
|
+
return $(_, {
|
|
313
313
|
get apiEndpoint() {
|
|
314
|
-
return
|
|
314
|
+
return r();
|
|
315
315
|
},
|
|
316
316
|
get userSession() {
|
|
317
317
|
return d();
|
|
318
318
|
},
|
|
319
319
|
get locale() {
|
|
320
|
-
return
|
|
320
|
+
return v();
|
|
321
321
|
},
|
|
322
322
|
get itemId() {
|
|
323
|
-
return
|
|
323
|
+
return c();
|
|
324
324
|
},
|
|
325
325
|
get elevateReward() {
|
|
326
|
-
return
|
|
326
|
+
return f();
|
|
327
327
|
},
|
|
328
328
|
get translationUrl() {
|
|
329
|
-
return
|
|
329
|
+
return u();
|
|
330
330
|
}
|
|
331
331
|
}), X(l);
|
|
332
332
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var M=(y,o,r)=>new Promise((d,g)=>{var c=l=>{try{p(r.next(l))}catch(s){g(s)}},u=l=>{try{p(r.throw(l))}catch(s){g(s)}},p=l=>l.done?d(l.value):Promise.resolve(l.value).then(c,u);p((r=r.apply(y,o)).next())});typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-BRav_RW5.cjs"),K=require("./LoyaltyPointsCard-njx77PMq.cjs");if(typeof window!="undefined"){let y=function(o){return function(...r){try{return o.apply(this,r)}catch(d){if(d instanceof DOMException&&d.message.includes("has already been used with this registry")||d instanceof Error&&d.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw d}}};customElements.define=y(customElements.define),Promise.resolve().then(()=>require("./LoyaltyPointsCard-njx77PMq.cjs")).then(o=>o.LoyaltyPointsCard_ce).then(o=>{const r=o.default||o;customElements.get("loyalty-points-card")||customElements.define("loyalty-points-card",r.element||r)}).catch(o=>{console.error("BOOT ERROR:",o)})}const W={en:{tokens:"Tokens",buyNow:"Buy Now",back:"Back"},tr:{tokens:"Tokens",buyNow:"Şimdi Satın Al",back:"Geri"},da:{tokens:"Tokens",buyNow:"Køb nu",back:"Tilbage"},de:{tokens:"Token",buyNow:"Jetzt kaufen",back:"Zurück"},nl:{tokens:"Tokens",buyNow:"Nu kopen",back:"Terug"},fr:{tokens:"Jetons",buyNow:"Acheter",back:"Retour"},hu:{tokens:"Tokenek",buyNow:"Vásárlás",back:"Vissza"}},Y="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='800px'%20height='800px'%20viewBox='0%200%20120%20120'%20fill='none'%3e%3crect%20width='120'%20height='120'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M33.2503%2038.4816C33.2603%2037.0472%2034.4199%2035.8864%2035.8543%2035.875H83.1463C84.5848%2035.875%2085.7503%2037.0431%2085.7503%2038.4816V80.5184C85.7403%2081.9528%2084.5807%2083.1136%2083.1463%2083.125H35.8543C34.4158%2083.1236%2033.2503%2081.957%2033.2503%2080.5184V38.4816ZM80.5006%2041.1251H38.5006V77.8751L62.8921%2053.4783C63.9172%2052.4536%2065.5788%2052.4536%2066.6039%2053.4783L80.5006%2067.4013V41.1251ZM43.75%2051.6249C43.75%2054.5244%2046.1005%2056.8749%2049%2056.8749C51.8995%2056.8749%2054.25%2054.5244%2054.25%2051.6249C54.25%2048.7254%2051.8995%2046.3749%2049%2046.3749C46.1005%2046.3749%2043.75%2048.7254%2043.75%2051.6249Z'%20fill='%23687787'/%3e%3c/svg%3e";var Q=e.from_html('<img class="loyalty-shop-item__image"/>'),X=e.from_html('<div class="loyalty-shop-item__card loyalty-shop-item__card--description"><p class="loyalty-shop-item__description"> </p></div>'),$=e.from_html('<div class="loyalty-shop-item"><div class="loyalty-shop-item__card"><!> <span class="loyalty-shop-item__title"> </span> <span class="loyalty-shop-item__points"> </span> <button class="loyalty-shop-item__button" type="button"> </button></div> <!> <!></div>');const ee={hash:"svelte-ravnpu",code:`.loyalty-shop-item {display:flex;flex-direction:column;gap:12px;}.loyalty-shop-item__card {display:flex;flex-direction:column;gap:8px;padding:16px;border-radius:10px;border:1px solid var(--border-default, rgba(251, 251, 251, 0.15));background-color:var(--app-container-bg-default, #022652);}.loyalty-shop-item__card--description {min-height:120px;}.loyalty-shop-item__image {width:100%;height:170px;border-radius:6px;}.loyalty-shop-item__title {color:var(--text-default, #ffffff);font-size:12px;font-weight:400;}.loyalty-shop-item__points {color:var(--text-subtle, #dfe3e8);font-size:14px;font-weight:400;}.loyalty-shop-item__button {margin-top:auto;width:100%;height:37px;padding:8px 16px;border:none;border-radius:6px;background:var(--button-primary-bg-default, #ffcc00);color:var(--button-primary-text-default, #261d00);font-size:12px;font-weight:400;cursor:pointer;}.loyalty-shop-item__button:disabled {opacity:0.4;cursor:default;}.loyalty-shop-item__description {color:var(--text-subtle, #dfe3e8);font-size:12px;line-height:1.4;margin:0;font-weight:500;min-height:120px;}
|
|
2
|
+
|
|
3
|
+
@media (min-width: 768px) {.loyalty-shop-item__image {height:clamp(170px, 30vw, 400px);object-fit:cover;}
|
|
4
|
+
}`};function S(y,o){e.push(o,!0),e.append_styles(y,ee);const r=()=>e.store_get(e.$format,"$_",d),[d,g]=e.setup_stores(),c=e.prop(o,"apiEndpoint",7,""),u=e.prop(o,"userSession",7,""),p=e.prop(o,"locale",7,""),l=e.prop(o,"itemId",7,""),s=e.prop(o,"elevateReward"),b=e.prop(o,"translationUrl");e.setupI18n({withLocale:p(),translations:{}}),Object.entries(W).forEach(([t,n])=>{e.addNewMessages(t,n)});let i=e.state(e.proxy(s())),v=e.state(!1),E=e.state("");const k=e.user_derived(()=>{var t,n,a,m;return(m=(a=(n=(t=e.get(i))==null?void 0:t.presentation)==null?void 0:n.assets)==null?void 0:a[0])!=null?m:""}),R=e.user_derived(()=>{var t,n,a,m,_;return(_=(m=(n=(t=e.get(i))==null?void 0:t.presentation)==null?void 0:n.displayName)!=null?m:(a=e.get(i))==null?void 0:a.displayName)!=null?_:""}),I=e.user_derived(()=>{var t,n,a;return(a=(n=(t=e.get(i))==null?void 0:t.presentation)==null?void 0:n.description)!=null?a:""}),N=e.user_derived(()=>{var t;return((t=e.get(i))==null?void 0:t.available)==="true"}),P=()=>{let t=new URL(b(),window.location.href);fetch(t.href).then(n=>n.json()).then(n=>{Object.keys(n).forEach(a=>{e.addNewMessages(a,n[a])})}).catch(n=>{console.log("loyalty shop item translation url err:",n)})};e.user_pre_effect(()=>{b()&&P()}),e.user_effect(()=>{if(s()){e.set(i,s(),!0);return}if(!c()||!l())return;let t=!1;return e.fetchShopItem({apiEndpoint:c(),userSession:u(),locale:p()},l()).then(n=>{t||e.set(i,n,!0)}).catch(n=>console.error("Failed to load shop item:",n)),()=>{t=!0}});const z=()=>{e.get(v)||!e.get(N)||!e.get(i)||e.sendRedeemRewardRequested(e.get(i).displayName||e.get(i).presentation.displayName,e.get(i).id)},V=()=>M(this,null,function*(){var n;if(!c()||!e.get(i)||e.get(v))return;e.set(v,!0),e.set(E,"");const t=e.get(i).id;try{yield e.redeemReward({apiEndpoint:c(),userSession:u()},t),e.sendRedeemRewardSuccess(t),e.dispatchRedeemRewardButton()}catch(a){e.set(E,(n=a==null?void 0:a.message)!=null?n:"Redeem failed",!0),e.sendRedeemRewardFailed(t,a)}finally{e.set(v,!1)}});e.user_effect(()=>{const t=n=>{var a,m,_;((a=n.data)==null?void 0:a.type)===e.EVENT_TYPES.REDEEM_REWARD_CONFIRMED&&((m=n.data)==null?void 0:m.id)===((_=e.get(i))==null?void 0:_.id)&&V()};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});var j={get apiEndpoint(){return c()},set apiEndpoint(t=""){c(t),e.flushSync()},get userSession(){return u()},set userSession(t=""){u(t),e.flushSync()},get locale(){return p()},set locale(t=""){p(t),e.flushSync()},get itemId(){return l()},set itemId(t=""){l(t),e.flushSync()},get elevateReward(){return s()},set elevateReward(t){s(t),e.flushSync()},get translationUrl(){return b()},set translationUrl(t){b(t),e.flushSync()}},T=e.comment(),D=e.first_child(T);{var A=t=>{var n=$(),a=e.child(n),m=e.child(a);{var _=h=>{var f=Q();e.template_effect(()=>{e.set_attribute(f,"src",e.get(k)||Y),e.set_attribute(f,"alt",e.get(R))}),e.append(h,f)};e.if_block(m,h=>{e.get(k)&&h(_)})}var L=e.sibling(m,2),H=e.only_child(L,!0),C=e.sibling(L,2),q=e.only_child(C),x=e.sibling(C,2),Z=e.only_child(x,!0);e.reset(a);var U=e.sibling(a,2);K.LoyaltyPointsCard(U,{get apiEndpoint(){return c()},get userSession(){return u()},get locale(){return p()}});var F=e.sibling(U,2);{var J=h=>{var f=X(),w=e.child(f),G=e.only_child(w,!0);e.reset(f),e.template_effect(()=>e.set_text(G,e.get(I))),e.append(h,f)};e.if_block(F,h=>{e.get(I)&&h(J)})}e.reset(n),e.template_effect((h,f)=>{var w;e.set_text(H,e.get(R)),e.set_text(q,`${(w=e.get(i).points)!=null?w:""}
|
|
5
|
+
${h!=null?h:""}`),x.disabled=!e.get(N)||e.get(v),e.set_text(Z,f)},[()=>r()("tokens"),()=>r()("buyNow")]),e.delegated("click",x,z),e.append(t,n)};e.if_block(D,t=>{e.get(i)&&t(A)})}e.append(y,T);var B=e.pop(j);return g(),B}e.delegate(["click"]);e.create_custom_element(S,{apiEndpoint:{},userSession:{},locale:{},itemId:{},elevateReward:{},translationUrl:{}},[],[],{mode:"open"});function O(y,o){e.push(o,!0);let r=e.prop(o,"apiEndpoint",7,""),d=e.prop(o,"userSession",7,""),g=e.prop(o,"locale",7,""),c=e.prop(o,"itemId",7,""),u=e.prop(o,"elevateReward"),p=e.prop(o,"translationUrl");var l={get apiEndpoint(){return r()},set apiEndpoint(s=""){r(s),e.flushSync()},get userSession(){return d()},set userSession(s=""){d(s),e.flushSync()},get locale(){return g()},set locale(s=""){g(s),e.flushSync()},get itemId(){return c()},set itemId(s=""){c(s),e.flushSync()},get elevateReward(){return u()},set elevateReward(s){u(s),e.flushSync()},get translationUrl(){return p()},set translationUrl(s){p(s),e.flushSync()}};return S(y,{get apiEndpoint(){return r()},get userSession(){return d()},get locale(){return g()},get itemId(){return c()},get elevateReward(){return u()},get translationUrl(){return p()}}),e.pop(l)}customElements.define("loyalty-shop-item",e.create_custom_element(O,{apiEndpoint:{},userSession:{},locale:{},itemId:{},elevateReward:{},translationUrl:{}},[],[]));const te=Object.freeze(Object.defineProperty({__proto__:null,default:O},Symbol.toStringTag,{value:"Module"}));exports.LoyaltyShopItem=S;exports.LoyaltyShopItem_ce=te;
|
package/es2015/loyalty-shop.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-
|
|
1
|
+
typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-D_Oyu_cp.cjs");if(typeof window!="undefined"){let o=function(e){return function(...n){try{return e.apply(this,n)}catch(t){if(t instanceof DOMException&&t.message.includes("has already been used with this registry")||t instanceof Error&&t.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw t}}};customElements.define=o(customElements.define),Promise.resolve().then(()=>require("../components/LoyaltyShop-D_Oyu_cp.cjs")).then(e=>e.LoyaltyShop_ce).then(e=>{const n=e.default||e;customElements.get("loyalty-shop")||customElements.define("loyalty-shop",n.element||n)}).catch(e=>{console.error("BOOT ERROR:",e)})}module.exports=s.LoyaltyShop;
|
package/es2015/loyalty-shop.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as a } from "../components/LoyaltyShop-
|
|
1
|
+
import { L as a } from "../components/LoyaltyShop-BKubFlFr.js";
|
|
2
2
|
typeof globalThis.HTMLElement == "undefined" && (globalThis.HTMLElement = class {
|
|
3
3
|
}, globalThis.customElements = { define() {
|
|
4
4
|
}, get() {
|
|
@@ -16,7 +16,7 @@ if (typeof window != "undefined") {
|
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
customElements.define = s(customElements.define), import("../components/LoyaltyShop-
|
|
19
|
+
customElements.define = s(customElements.define), import("../components/LoyaltyShop-BKubFlFr.js").then((e) => e.a).then((e) => {
|
|
20
20
|
const n = e.default || e;
|
|
21
21
|
customElements.get("loyalty-shop") || customElements.define("loyalty-shop", n.element || n);
|
|
22
22
|
}).catch((e) => {
|
package/esnext/loyalty-shop.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-
|
|
1
|
+
typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const s=require("../components/LoyaltyShop-8d3N_F-0.cjs");if(typeof window<"u"){let o=function(e){return function(...n){try{return e.apply(this,n)}catch(t){if(t instanceof DOMException&&t.message.includes("has already been used with this registry")||t instanceof Error&&t.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw t}}};customElements.define=o(customElements.define),Promise.resolve().then(()=>require("../components/LoyaltyShop-8d3N_F-0.cjs")).then(e=>e.LoyaltyShop_ce).then(e=>{const n=e.default||e;customElements.get("loyalty-shop")||customElements.define("loyalty-shop",n.element||n)}).catch(e=>{console.error("BOOT ERROR:",e)})}module.exports=s.LoyaltyShop;
|
package/esnext/loyalty-shop.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as a } from "../components/LoyaltyShop-
|
|
1
|
+
import { L as a } from "../components/LoyaltyShop-Dfybp9ut.js";
|
|
2
2
|
typeof globalThis.HTMLElement > "u" && (globalThis.HTMLElement = class {
|
|
3
3
|
}, globalThis.customElements = { define() {
|
|
4
4
|
}, get() {
|
|
@@ -16,7 +16,7 @@ if (typeof window < "u") {
|
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
customElements.define = s(customElements.define), import("../components/LoyaltyShop-
|
|
19
|
+
customElements.define = s(customElements.define), import("../components/LoyaltyShop-Dfybp9ut.js").then((e) => e.a).then((e) => {
|
|
20
20
|
const n = e.default || e;
|
|
21
21
|
customElements.get("loyalty-shop") || customElements.define("loyalty-shop", n.element || n);
|
|
22
22
|
}).catch((e) => {
|