@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.
Files changed (31) hide show
  1. package/components/{LoyaltyPagination-B8amLojn.cjs → LoyaltyPagination-B7JqsoUi.cjs} +8 -8
  2. package/components/{LoyaltyPagination-B2XwqERr.cjs → LoyaltyPagination-BRav_RW5.cjs} +8 -8
  3. package/components/{LoyaltyPagination-DOu-qNFO.js → LoyaltyPagination-Cw2snZwZ.js} +10 -10
  4. package/components/{LoyaltyPagination-BqHc2i2H.js → LoyaltyPagination-CyjgdUPo.js} +10 -10
  5. package/components/LoyaltyPointsCard-CFk3DpjI.js +249 -0
  6. package/components/LoyaltyPointsCard-DTOQlcMH.js +242 -0
  7. package/components/LoyaltyPointsCard-Xb627em8.cjs +18 -0
  8. package/components/LoyaltyPointsCard-njx77PMq.cjs +18 -0
  9. package/components/LoyaltyShop-8d3N_F-0.cjs +27 -0
  10. package/components/LoyaltyShop-BKubFlFr.js +478 -0
  11. package/components/LoyaltyShop-D_Oyu_cp.cjs +27 -0
  12. package/components/LoyaltyShop-Dfybp9ut.js +452 -0
  13. package/components/{LoyaltyShopItem-DL7R43c_.js → LoyaltyShopItem-BXrrNl9f.js} +72 -72
  14. package/components/LoyaltyShopItem-CGOptttz.cjs +5 -0
  15. package/components/{LoyaltyShopItem-bzNnPlQa.js → LoyaltyShopItem-CqY63kaT.js} +103 -103
  16. package/components/LoyaltyShopItem-DEz9OVzD.cjs +5 -0
  17. package/es2015/loyalty-shop.cjs +1 -1
  18. package/es2015/loyalty-shop.js +2 -2
  19. package/esnext/loyalty-shop.cjs +1 -1
  20. package/esnext/loyalty-shop.js +2 -2
  21. package/package.json +1 -1
  22. package/components/LoyaltyPointsCard-BjF9SVWO.js +0 -249
  23. package/components/LoyaltyPointsCard-C2Xj_0zZ.cjs +0 -18
  24. package/components/LoyaltyPointsCard-DKq6yH_i.js +0 -242
  25. package/components/LoyaltyPointsCard-DO9GoE9Q.cjs +0 -18
  26. package/components/LoyaltyShop-CBH93UYT.js +0 -452
  27. package/components/LoyaltyShop-CCeVtHJ7.cjs +0 -27
  28. package/components/LoyaltyShop-CnX4zXMd.cjs +0 -27
  29. package/components/LoyaltyShop-aSar2Vkc.js +0 -478
  30. package/components/LoyaltyShopItem-BvxV4bEm.cjs +0 -5
  31. package/components/LoyaltyShopItem-CYoPPSZj.cjs +0 -5
@@ -0,0 +1,478 @@
1
+ var X = (h, a, s) => new Promise((l, k) => {
2
+ var u = (i) => {
3
+ try {
4
+ p(s.next(i));
5
+ } catch (w) {
6
+ k(w);
7
+ }
8
+ }, c = (i) => {
9
+ try {
10
+ p(s.throw(i));
11
+ } catch (w) {
12
+ k(w);
13
+ }
14
+ }, p = (i) => i.done ? l(i.value) : Promise.resolve(i.value).then(u, c);
15
+ p((s = s.apply(h, a)).next());
16
+ });
17
+ import { z as Ze, c as fe, p as be, a as Je, b, s as We, d as le, A as f, B as de, P as ue, E as z, m as t, F as d, C as Ye, H as ce, S as Ge, i as $, h as I, j as _e, Q as T, R as Qe, u as pe, I as Xe, J as $e, K as et, L as tt, w as C, k as _, l as nt, n as me, r as H, T as ge, U as at, o as P, t as he, v as K, g as ot, q as U, x as st, $ as it, V as rt, O as ye, M as ee, W as lt, X as dt, N as ut, Y as ct } from "./LoyaltyPagination-Cw2snZwZ.js";
18
+ import { L as pt } from "./LoyaltyShopItem-CqY63kaT.js";
19
+ typeof globalThis.HTMLElement == "undefined" && (globalThis.HTMLElement = class {
20
+ }, globalThis.customElements = { define() {
21
+ }, get() {
22
+ }, whenDefined() {
23
+ } });
24
+ if (typeof window != "undefined") {
25
+ let h = function(a) {
26
+ return function(...s) {
27
+ try {
28
+ return a.apply(this, s);
29
+ } catch (l) {
30
+ if (l instanceof DOMException && l.message.includes("has already been used with this registry") || l instanceof Error && l.message.includes("Cannot define multiple custom elements with the same tag name"))
31
+ return !1;
32
+ throw l;
33
+ }
34
+ };
35
+ };
36
+ customElements.define = h(customElements.define), import("./LoyaltyPagination-Cw2snZwZ.js").then((a) => a.Z).then((a) => {
37
+ const s = a.default || a;
38
+ customElements.get("loyalty-pagination") || customElements.define("loyalty-pagination", s.element || s);
39
+ }).catch((a) => {
40
+ console.error("BOOT ERROR:", a);
41
+ });
42
+ }
43
+ if (typeof window != "undefined") {
44
+ let h = function(a) {
45
+ return function(...s) {
46
+ try {
47
+ return a.apply(this, s);
48
+ } catch (l) {
49
+ if (l instanceof DOMException && l.message.includes("has already been used with this registry") || l instanceof Error && l.message.includes("Cannot define multiple custom elements with the same tag name"))
50
+ return !1;
51
+ throw l;
52
+ }
53
+ };
54
+ };
55
+ customElements.define = h(customElements.define), import("./LoyaltyShopItem-CqY63kaT.js").then((a) => a.a).then((a) => {
56
+ const s = a.default || a;
57
+ customElements.get("loyalty-shop-item") || customElements.define("loyalty-shop-item", s.element || s);
58
+ }).catch((a) => {
59
+ console.error("BOOT ERROR:", a);
60
+ });
61
+ }
62
+ const mt = {
63
+ en: {
64
+ loading: "Loading…",
65
+ noContent: "There are no bonus items available for redemption.",
66
+ networkProblem: "Network problem. Please reload.",
67
+ tokens: "Tokens",
68
+ buyNow: "Buy Now",
69
+ generalError: "Something went wrong... Please try again."
70
+ },
71
+ tr: {
72
+ loading: "Yükleniyor…",
73
+ noContent: "Kullanılabilir bonus öğesi bulunmamaktadır.",
74
+ networkProblem: "Ağ sorunu. Lütfen yeniden yükleyin.",
75
+ tokens: "Tokens",
76
+ buyNow: "Satın Al",
77
+ generalError: "Bir sorun oluştu, lütfen tekrar deneyin."
78
+ },
79
+ da: {
80
+ loading: "Indlæser…",
81
+ noContent: "Der er ingen bonusgenstande tilgængelige til indløsning.",
82
+ networkProblem: "Netværksproblem. Genindlæs venligst siden.",
83
+ tokens: "Tokens",
84
+ buyNow: "Køb nu",
85
+ generalError: "Noget gik galt. Prøv venligst igen."
86
+ },
87
+ de: {
88
+ loading: "Wird geladen…",
89
+ noContent: "Es sind keine Bonusartikel zum Einlösen verfügbar.",
90
+ networkProblem: "Netzwerkproblem. Bitte lade die Seite neu.",
91
+ tokens: "Token",
92
+ buyNow: "Jetzt kaufen",
93
+ generalError: "Etwas ist schiefgelaufen. Bitte versuche es erneut."
94
+ },
95
+ nl: {
96
+ loading: "Laden…",
97
+ noContent: "Er zijn geen bonusitems beschikbaar om in te wisselen.",
98
+ networkProblem: "Netwerkprobleem. Laad de pagina opnieuw.",
99
+ tokens: "Tokens",
100
+ buyNow: "Nu kopen",
101
+ generalError: "Er is iets misgegaan. Probeer het opnieuw."
102
+ },
103
+ fr: {
104
+ loading: "Chargement…",
105
+ noContent: "Aucun bonus n'est disponible pour être échangé.",
106
+ networkProblem: "Problème de réseau. Veuillez recharger la page.",
107
+ tokens: "Jetons",
108
+ buyNow: "Acheter",
109
+ generalError: "Une erreur s'est produite. Veuillez réessayer."
110
+ },
111
+ hu: {
112
+ loading: "Betöltés…",
113
+ noContent: "Nincsenek beváltható bónuszok.",
114
+ networkProblem: "Hálózati probléma. Kérjük, töltsd újra az oldalt.",
115
+ tokens: "Tokenek",
116
+ buyNow: "Vásárlás",
117
+ generalError: "Hiba történt. Kérjük, próbáld újra."
118
+ }
119
+ }, gt = "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";
120
+ var ht = C('<div class="loyalty-shop__item loyalty-shop__item--skeleton"><div class="loyalty-shop__item-image skeleton-box"></div> <div class="loyalty-shop__item-title skeleton-line"></div> <div class="loyalty-shop__item-points skeleton-line skeleton-line--short"></div> <div class="loyalty-shop__item-button-skeleton skeleton-box"></div></div>'), yt = C('<div class="loyalty-shop__grid loyalty-shop__grid--skeleton"></div>'), ft = C('<div class="loyalty-shop__unavailable"> </div>'), bt = C('<div><div role="button" tabindex="0" class="loyalty-shop__item-image-container"><img class="loyalty-shop__item-image"/></div> <span class="loyalty-shop__item-title"> </span> <span class="loyalty-shop__item-points"> </span> <button class="loyalty-shop__item-button" type="button"> </button></div>'), _t = C('<div class="load-more-sentinel" aria-hidden="true"></div>'), vt = C('<div class="loyalty-shop__grid"></div> <!> <!>', 1), kt = C('<div class="loyalty-shop"><!></div>');
121
+ const wt = {
122
+ hash: "svelte-1f1q033",
123
+ code: `.loyalty-shop {padding:16px;border-radius:6px;border:1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));background-color:var(--app-container-bg-default, #022652);width:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:16px;}.loyalty-shop__unavailable {color:var(--text-subtle, #dfe3e8);font-size:14px;padding:24px 0;text-align:center;}.loyalty-shop__grid {display:grid;gap:16px;grid-template-columns:repeat(2, 1fr);margin:0;}.loyalty-shop__item {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-subtle, rgba(251, 251, 251, 0.1));}.loyalty-shop__item--unavailable {opacity:1;}.loyalty-shop__item-image {width:100%;height:82px;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-container {display:flex;flex-direction:column;gap:12px;}.skeleton-box {background:linear-gradient(
124
+ 90deg,
125
+ var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 0%,
126
+ color-mix(in srgb, var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 80%, white) 50%,
127
+ var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 100%
128
+ );background-size:200% 100%;
129
+ animation: shimmer 3s linear infinite;border-radius:6px;}.skeleton-line {height:14px;border-radius:6px;background:linear-gradient(
130
+ 90deg,
131
+ var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 0%,
132
+ color-mix(in srgb, var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 80%, white) 50%,
133
+ var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 100%
134
+ );background-size:200% 100%;
135
+ animation: shimmer 3s linear infinite;}.skeleton-line--short {width:40%;}.loyalty-shop__item--skeleton {display:flex;flex-direction:column;}.loyalty-shop__item--skeleton .loyalty-shop__item-image {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item--skeleton .loyalty-shop__item-title {width:90%;}.loyalty-shop__item--skeleton .loyalty-shop__item-points {width:40%;}.loyalty-shop__item-button-skeleton {margin-top:auto;width:100%;height:40px;border-radius:6px;}.loyalty-shop__item-image-container {cursor:pointer;}
136
+
137
+ @keyframes shimmer {
138
+ 0% {
139
+ background-position: 200% 0;
140
+ }
141
+
142
+ 100% {
143
+ background-position: -200% 0;
144
+ }
145
+ }
146
+
147
+ @media (min-width: 768px) {.loyalty-shop__grid {grid-template-columns:repeat(4, 1fr);justify-content:start;margin:0;}.loyalty-shop__item {width:100%;height:100%;box-sizing:border-box;}.loyalty-shop__item-image {height:200px;}.loyalty-shop__item--skeleton .loyalty-shop__item-image {height:200px;}
148
+ }`
149
+ };
150
+ function ve(h, a) {
151
+ be(a, !0), Je(h, wt);
152
+ const s = () => st(it, "$_", l), [l, k] = nt(), u = b(a, "apiEndpoint", 7, ""), c = b(a, "userSession", 7, ""), p = b(a, "locale", 7, ""), i = b(a, "limitItem", 7, T), w = b(a, "translationUrl");
153
+ We({ withLocale: p(), translations: {} });
154
+ const we = () => X(this, null, function* () {
155
+ try {
156
+ const e = new URL(w(), window.location.href), n = yield fetch(e.href);
157
+ if (!n.ok)
158
+ throw new Error("Failed to fetch translations");
159
+ const o = yield n.json();
160
+ Object.entries(o).forEach(([r, v]) => {
161
+ le(r, v);
162
+ });
163
+ } catch (e) {
164
+ console.error("loyalty shop translation url err:", e);
165
+ }
166
+ });
167
+ Object.entries(mt).forEach(([e, n]) => {
168
+ le(e, n);
169
+ });
170
+ let y = f(de([])), R = f(void 0), B = f(0), E = f(0), L = f(de(ue)), q = f(!1), F = f(!1), M = f(void 0), S = f(!1), A = f(void 0), D = 0;
171
+ const xe = pe(() => typeof i() == "number" ? i() : parseInt(i(), T) || T), te = () => {
172
+ if (!u() || !c())
173
+ return;
174
+ d(q, !0), d(F, !1);
175
+ const e = ++D, n = t(S) && t(E) > 0;
176
+ Qe(
177
+ {
178
+ apiEndpoint: u(),
179
+ userSession: c(),
180
+ locale: p()
181
+ },
182
+ t(E),
183
+ t(L)
184
+ ).then((o) => {
185
+ var v, x;
186
+ if (e !== D)
187
+ return;
188
+ const r = (v = o.data) != null ? v : [];
189
+ d(B, (x = o.total) != null ? x : 0, !0), n ? d(y, [...t(y), ...r], !0) : d(y, r, !0);
190
+ }).catch((o) => {
191
+ e === D && (d(F, !0), console.error("Failed to load shop rewards:", o));
192
+ }).finally(() => {
193
+ e === D && d(q, !1);
194
+ });
195
+ };
196
+ z(() => {
197
+ u(), c(), p(), t(E), t(L), te();
198
+ }), z(() => {
199
+ const e = window.matchMedia("(max-width: 767px)"), n = (o) => {
200
+ d(S, o.matches, !0);
201
+ };
202
+ return d(S, e.matches, !0), e.addEventListener("change", n), () => e.removeEventListener("change", n);
203
+ }), z(() => {
204
+ d(L, t(S) ? ue : t(xe), !0);
205
+ }), z(() => {
206
+ if (!t(S) || !t(A)) return;
207
+ const e = new IntersectionObserver(
208
+ (n) => {
209
+ n.some((o) => o.isIntersecting) && t(y).length < t(B) && d(E, t(E) + t(L));
210
+ },
211
+ { rootMargin: "200px" }
212
+ );
213
+ return e.observe(t(A)), () => e.disconnect();
214
+ }), Ye(() => {
215
+ w() && we();
216
+ });
217
+ const Ee = (e) => {
218
+ var n, o, r;
219
+ return (r = (o = (n = e.presentation) == null ? void 0 : n.assets) == null ? void 0 : o[0]) != null ? r : gt;
220
+ }, Z = (e) => {
221
+ var n, o, r;
222
+ return (r = (o = e.displayName) != null ? o : (n = e.presentation) == null ? void 0 : n.displayName) != null ? r : "";
223
+ }, J = (e) => e.available === "true", Se = (e) => {
224
+ t(M) || !J(e) || ut(Z(e), e.id);
225
+ }, Ie = (e) => X(this, null, function* () {
226
+ if (!(!u() || t(M))) {
227
+ d(M, e, !0);
228
+ try {
229
+ yield Xe({ apiEndpoint: u(), userSession: c() }, e), $e(e), et(), te();
230
+ } catch (n) {
231
+ tt(e, n);
232
+ } finally {
233
+ d(M, void 0);
234
+ }
235
+ }
236
+ });
237
+ z(() => {
238
+ const e = (n) => {
239
+ var x;
240
+ const { type: o, id: r, source: v } = (x = n.data) != null ? x : {};
241
+ switch (o) {
242
+ case ce.REDEEM_REWARD_CONFIRMED:
243
+ if (t(R))
244
+ break;
245
+ r && t(y).some((O) => O.id === r) && Ie(r);
246
+ break;
247
+ case ce.BACK_BUTTON_CLICKED:
248
+ v === Ge && d(R, void 0);
249
+ break;
250
+ }
251
+ };
252
+ return window.addEventListener("message", e), () => window.removeEventListener("message", e);
253
+ });
254
+ const Ce = () => t(y).length ? s()("generalError") : s()("noContent"), Re = (e) => {
255
+ d(E, e, !0);
256
+ }, Le = (e) => {
257
+ ct(e.displayName || e.presentation.displayName, e.id);
258
+ }, ne = (e) => {
259
+ d(R, e, !0), Le(e);
260
+ }, Ne = (e) => (n) => {
261
+ (n.key === "Enter" || n.key === " ") && (n.preventDefault(), ne(e));
262
+ };
263
+ var Te = {
264
+ get apiEndpoint() {
265
+ return u();
266
+ },
267
+ set apiEndpoint(e = "") {
268
+ u(e), _();
269
+ },
270
+ get userSession() {
271
+ return c();
272
+ },
273
+ set userSession(e = "") {
274
+ c(e), _();
275
+ },
276
+ get locale() {
277
+ return p();
278
+ },
279
+ set locale(e = "") {
280
+ p(e), _();
281
+ },
282
+ get limitItem() {
283
+ return i();
284
+ },
285
+ set limitItem(e = T) {
286
+ i(e), _();
287
+ },
288
+ get translationUrl() {
289
+ return w();
290
+ },
291
+ set translationUrl(e) {
292
+ w(e), _();
293
+ }
294
+ }, W = kt(), Me = me(W);
295
+ {
296
+ var Oe = (e) => {
297
+ pt(e, {
298
+ get itemId() {
299
+ return t(R).id;
300
+ },
301
+ get elevateReward() {
302
+ return t(R);
303
+ },
304
+ get apiEndpoint() {
305
+ return u();
306
+ },
307
+ get userSession() {
308
+ return c();
309
+ },
310
+ get locale() {
311
+ return p();
312
+ }
313
+ });
314
+ }, ze = (e) => {
315
+ var n = yt();
316
+ ge(n, 21, () => Array(t(L)), at, (o, r, v, x) => {
317
+ var O = ht();
318
+ I(o, O);
319
+ }), H(n), I(e, n);
320
+ }, Pe = (e) => {
321
+ var n = ft(), o = P(n, !0);
322
+ he((r) => K(o, r), [() => Ce()]), I(e, n);
323
+ }, Ue = (e) => {
324
+ var n = vt(), o = ot(n);
325
+ ge(o, 21, () => t(y), (g) => g.id, (g, m) => {
326
+ var N = bt();
327
+ let ae;
328
+ var j = me(N), Ae = pe(() => Ne(t(m))), oe = P(j), se = U(j, 2), De = P(se, !0), ie = U(se, 2), je = P(ie), Y = U(ie, 2), Ve = P(Y, !0);
329
+ H(N), he(
330
+ (G, V, He, Ke, Q, qe, Fe) => {
331
+ var re;
332
+ ae = rt(N, 1, "loyalty-shop__item", null, ae, { "loyalty-shop__item--unavailable": G }), ye(oe, "src", V), ye(oe, "alt", He), K(De, Ke), K(je, `${(re = t(m).points) != null ? re : ""}
333
+ ${Q != null ? Q : ""}`), Y.disabled = qe, K(Ve, Fe);
334
+ },
335
+ [
336
+ () => !J(t(m)),
337
+ () => Ee(t(m)),
338
+ () => Z(t(m)),
339
+ () => Z(t(m)),
340
+ () => s()("tokens"),
341
+ () => !J(t(m)) || t(M) === t(m).id,
342
+ () => s()("buyNow")
343
+ ]
344
+ ), ee("click", j, () => ne(t(m))), ee("keydown", j, function(...G) {
345
+ var V;
346
+ (V = t(Ae)) == null || V.apply(this, G);
347
+ }), ee("click", Y, () => Se(t(m))), I(g, N);
348
+ }), H(o);
349
+ var r = U(o, 2);
350
+ {
351
+ var v = (g) => {
352
+ lt(g, {
353
+ get offset() {
354
+ return t(E);
355
+ },
356
+ get limit() {
357
+ return t(L);
358
+ },
359
+ get total() {
360
+ return t(B);
361
+ },
362
+ onPageChange: Re,
363
+ get locale() {
364
+ return p();
365
+ }
366
+ });
367
+ };
368
+ $(r, (g) => {
369
+ t(S) || g(v);
370
+ });
371
+ }
372
+ var x = U(r, 2);
373
+ {
374
+ var O = (g) => {
375
+ var m = _t();
376
+ dt(m, (N) => d(A, N), () => t(A)), I(g, m);
377
+ };
378
+ $(x, (g) => {
379
+ t(S) && t(y).length < t(B) && g(O);
380
+ });
381
+ }
382
+ I(e, n);
383
+ };
384
+ $(Me, (e) => {
385
+ t(R) ? e(Oe) : t(q) && t(y).length === 0 ? e(ze, 1) : !t(y).length || t(F) ? e(Pe, 2) : e(Ue, -1);
386
+ });
387
+ }
388
+ H(W), I(h, W);
389
+ var Be = _e(Te);
390
+ return k(), Be;
391
+ }
392
+ Ze(["click", "keydown"]);
393
+ fe(
394
+ ve,
395
+ {
396
+ apiEndpoint: {},
397
+ userSession: {},
398
+ locale: {},
399
+ limitItem: {},
400
+ translationUrl: {}
401
+ },
402
+ [],
403
+ [],
404
+ { mode: "open" }
405
+ );
406
+ function ke(h, a) {
407
+ be(a, !0);
408
+ let s = b(a, "apiEndpoint", 7, ""), l = b(a, "userSession", 7, ""), k = b(a, "locale", 7, ""), u = b(a, "limitItem", 7, T), c = b(a, "translationUrl");
409
+ var p = {
410
+ get apiEndpoint() {
411
+ return s();
412
+ },
413
+ set apiEndpoint(i = "") {
414
+ s(i), _();
415
+ },
416
+ get userSession() {
417
+ return l();
418
+ },
419
+ set userSession(i = "") {
420
+ l(i), _();
421
+ },
422
+ get locale() {
423
+ return k();
424
+ },
425
+ set locale(i = "") {
426
+ k(i), _();
427
+ },
428
+ get limitItem() {
429
+ return u();
430
+ },
431
+ set limitItem(i = T) {
432
+ u(i), _();
433
+ },
434
+ get translationUrl() {
435
+ return c();
436
+ },
437
+ set translationUrl(i) {
438
+ c(i), _();
439
+ }
440
+ };
441
+ return ve(h, {
442
+ get apiEndpoint() {
443
+ return s();
444
+ },
445
+ get userSession() {
446
+ return l();
447
+ },
448
+ get locale() {
449
+ return k();
450
+ },
451
+ get limitItem() {
452
+ return u();
453
+ },
454
+ get translationUrl() {
455
+ return c();
456
+ }
457
+ }), _e(p);
458
+ }
459
+ customElements.define("loyalty-shop", fe(
460
+ ke,
461
+ {
462
+ apiEndpoint: {},
463
+ userSession: {},
464
+ locale: {},
465
+ limitItem: {},
466
+ translationUrl: {}
467
+ },
468
+ [],
469
+ []
470
+ ));
471
+ const It = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
472
+ __proto__: null,
473
+ default: ke
474
+ }, Symbol.toStringTag, { value: "Module" }));
475
+ export {
476
+ ve as L,
477
+ It as a
478
+ };
@@ -0,0 +1,27 @@
1
+ var j=(m,o,i)=>new Promise((l,f)=>{var d=r=>{try{c(i.next(r))}catch(_){f(_)}},p=r=>{try{c(i.throw(r))}catch(_){f(_)}},c=r=>r.done?l(r.value):Promise.resolve(r.value).then(d,p);c((i=i.apply(m,o)).next())});typeof globalThis.HTMLElement=="undefined"&&(globalThis.HTMLElement=class{},globalThis.customElements={define(){},get(){},whenDefined(){}});const e=require("./LoyaltyPagination-BRav_RW5.cjs"),ve=require("./LoyaltyShopItem-DEz9OVzD.cjs");if(typeof window!="undefined"){let m=function(o){return function(...i){try{return o.apply(this,i)}catch(l){if(l instanceof DOMException&&l.message.includes("has already been used with this registry")||l instanceof Error&&l.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw l}}};customElements.define=m(customElements.define),Promise.resolve().then(()=>require("./LoyaltyPagination-BRav_RW5.cjs")).then(o=>o.LoyaltyPagination_ce).then(o=>{const i=o.default||o;customElements.get("loyalty-pagination")||customElements.define("loyalty-pagination",i.element||i)}).catch(o=>{console.error("BOOT ERROR:",o)})}if(typeof window!="undefined"){let m=function(o){return function(...i){try{return o.apply(this,i)}catch(l){if(l instanceof DOMException&&l.message.includes("has already been used with this registry")||l instanceof Error&&l.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw l}}};customElements.define=m(customElements.define),Promise.resolve().then(()=>require("./LoyaltyShopItem-DEz9OVzD.cjs")).then(o=>o.LoyaltyShopItem_ce).then(o=>{const i=o.default||o;customElements.get("loyalty-shop-item")||customElements.define("loyalty-shop-item",i.element||i)}).catch(o=>{console.error("BOOT ERROR:",o)})}const ke={en:{loading:"Loading…",noContent:"There are no bonus items available for redemption.",networkProblem:"Network problem. Please reload.",tokens:"Tokens",buyNow:"Buy Now",generalError:"Something went wrong... Please try again."},tr:{loading:"Yükleniyor…",noContent:"Kullanılabilir bonus öğesi bulunmamaktadır.",networkProblem:"Ağ sorunu. Lütfen yeniden yükleyin.",tokens:"Tokens",buyNow:"Satın Al",generalError:"Bir sorun oluştu, lütfen tekrar deneyin."},da:{loading:"Indlæser…",noContent:"Der er ingen bonusgenstande tilgængelige til indløsning.",networkProblem:"Netværksproblem. Genindlæs venligst siden.",tokens:"Tokens",buyNow:"Køb nu",generalError:"Noget gik galt. Prøv venligst igen."},de:{loading:"Wird geladen…",noContent:"Es sind keine Bonusartikel zum Einlösen verfügbar.",networkProblem:"Netzwerkproblem. Bitte lade die Seite neu.",tokens:"Token",buyNow:"Jetzt kaufen",generalError:"Etwas ist schiefgelaufen. Bitte versuche es erneut."},nl:{loading:"Laden…",noContent:"Er zijn geen bonusitems beschikbaar om in te wisselen.",networkProblem:"Netwerkprobleem. Laad de pagina opnieuw.",tokens:"Tokens",buyNow:"Nu kopen",generalError:"Er is iets misgegaan. Probeer het opnieuw."},fr:{loading:"Chargement…",noContent:"Aucun bonus n'est disponible pour être échangé.",networkProblem:"Problème de réseau. Veuillez recharger la page.",tokens:"Jetons",buyNow:"Acheter",generalError:"Une erreur s'est produite. Veuillez réessayer."},hu:{loading:"Betöltés…",noContent:"Nincsenek beváltható bónuszok.",networkProblem:"Hálózati probléma. Kérjük, töltsd újra az oldalt.",tokens:"Tokenek",buyNow:"Vásárlás",generalError:"Hiba történt. Kérjük, próbáld újra."}},Ee="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 we=e.from_html('<div class="loyalty-shop__item loyalty-shop__item--skeleton"><div class="loyalty-shop__item-image skeleton-box"></div> <div class="loyalty-shop__item-title skeleton-line"></div> <div class="loyalty-shop__item-points skeleton-line skeleton-line--short"></div> <div class="loyalty-shop__item-button-skeleton skeleton-box"></div></div>'),xe=e.from_html('<div class="loyalty-shop__grid loyalty-shop__grid--skeleton"></div>'),Se=e.from_html('<div class="loyalty-shop__unavailable"> </div>'),Ie=e.from_html('<div><div role="button" tabindex="0" class="loyalty-shop__item-image-container"><img class="loyalty-shop__item-image"/></div> <span class="loyalty-shop__item-title"> </span> <span class="loyalty-shop__item-points"> </span> <button class="loyalty-shop__item-button" type="button"> </button></div>'),Le=e.from_html('<div class="load-more-sentinel" aria-hidden="true"></div>'),Te=e.from_html('<div class="loyalty-shop__grid"></div> <!> <!>',1),Me=e.from_html('<div class="loyalty-shop"><!></div>');const Ce={hash:"svelte-1f1q033",code:`.loyalty-shop {padding:16px;border-radius:6px;border:1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));background-color:var(--app-container-bg-default, #022652);width:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:16px;}.loyalty-shop__unavailable {color:var(--text-subtle, #dfe3e8);font-size:14px;padding:24px 0;text-align:center;}.loyalty-shop__grid {display:grid;gap:16px;grid-template-columns:repeat(2, 1fr);margin:0;}.loyalty-shop__item {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-subtle, rgba(251, 251, 251, 0.1));}.loyalty-shop__item--unavailable {opacity:1;}.loyalty-shop__item-image {width:100%;height:82px;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-container {display:flex;flex-direction:column;gap:12px;}.skeleton-box {background:linear-gradient(
2
+ 90deg,
3
+ var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 0%,
4
+ color-mix(in srgb, var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 80%, white) 50%,
5
+ var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 100%
6
+ );background-size:200% 100%;
7
+ animation: shimmer 3s linear infinite;border-radius:6px;}.skeleton-line {height:14px;border-radius:6px;background:linear-gradient(
8
+ 90deg,
9
+ var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 0%,
10
+ color-mix(in srgb, var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 80%, white) 50%,
11
+ var(--app-container-bg-subtle, rgba(251, 251, 251, 0.1)) 100%
12
+ );background-size:200% 100%;
13
+ animation: shimmer 3s linear infinite;}.skeleton-line--short {width:40%;}.loyalty-shop__item--skeleton {display:flex;flex-direction:column;}.loyalty-shop__item--skeleton .loyalty-shop__item-image {width:100%;height:82px;border-radius:6px;}.loyalty-shop__item--skeleton .loyalty-shop__item-title {width:90%;}.loyalty-shop__item--skeleton .loyalty-shop__item-points {width:40%;}.loyalty-shop__item-button-skeleton {margin-top:auto;width:100%;height:40px;border-radius:6px;}.loyalty-shop__item-image-container {cursor:pointer;}
14
+
15
+ @keyframes shimmer {
16
+ 0% {
17
+ background-position: 200% 0;
18
+ }
19
+
20
+ 100% {
21
+ background-position: -200% 0;
22
+ }
23
+ }
24
+
25
+ @media (min-width: 768px) {.loyalty-shop__grid {grid-template-columns:repeat(4, 1fr);justify-content:start;margin:0;}.loyalty-shop__item {width:100%;height:100%;box-sizing:border-box;}.loyalty-shop__item-image {height:200px;}.loyalty-shop__item--skeleton .loyalty-shop__item-image {height:200px;}
26
+ }`};function F(m,o){e.push(o,!0),e.append_styles(m,Ce);const i=()=>e.store_get(e.$format,"$_",l),[l,f]=e.setup_stores(),d=e.prop(o,"apiEndpoint",7,""),p=e.prop(o,"userSession",7,""),c=e.prop(o,"locale",7,""),r=e.prop(o,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),_=e.prop(o,"translationUrl");e.setupI18n({withLocale:c(),translations:{}});const G=()=>j(this,null,function*(){try{const t=new URL(_(),window.location.href),n=yield fetch(t.href);if(!n.ok)throw new Error("Failed to fetch translations");const a=yield n.json();Object.entries(a).forEach(([s,y])=>{e.addNewMessages(s,y)})}catch(t){console.error("loyalty shop translation url err:",t)}});Object.entries(ke).forEach(([t,n])=>{e.addNewMessages(t,n)});let h=e.state(e.proxy([])),E=e.state(void 0),L=e.state(0),v=e.state(0),w=e.state(e.proxy(e.MOBILE_LOAD_ITEMS)),N=e.state(!1),O=e.state(!1),S=e.state(void 0),k=e.state(!1),T=e.state(void 0),M=0;const Q=e.user_derived(()=>typeof r()=="number"?r():parseInt(r(),e.ITEMS_LIMIT_DEFAULT)||e.ITEMS_LIMIT_DEFAULT),q=()=>{if(!d()||!p())return;e.set(N,!0),e.set(O,!1);const t=++M,n=e.get(k)&&e.get(v)>0;e.fetchShopRewards({apiEndpoint:d(),userSession:p(),locale:c()},e.get(v),e.get(w)).then(a=>{var y,b;if(t!==M)return;const s=(y=a.data)!=null?y:[];e.set(L,(b=a.total)!=null?b:0,!0),n?e.set(h,[...e.get(h),...s],!0):e.set(h,s,!0)}).catch(a=>{t===M&&(e.set(O,!0),console.error("Failed to load shop rewards:",a))}).finally(()=>{t===M&&e.set(N,!1)})};e.user_effect(()=>{d(),p(),c(),e.get(v),e.get(w),q()}),e.user_effect(()=>{const t=window.matchMedia("(max-width: 767px)"),n=a=>{e.set(k,a.matches,!0)};return e.set(k,t.matches,!0),t.addEventListener("change",n),()=>t.removeEventListener("change",n)}),e.user_effect(()=>{e.set(w,e.get(k)?e.MOBILE_LOAD_ITEMS:e.get(Q),!0)}),e.user_effect(()=>{if(!e.get(k)||!e.get(T))return;const t=new IntersectionObserver(n=>{n.some(a=>a.isIntersecting)&&e.get(h).length<e.get(L)&&e.set(v,e.get(v)+e.get(w))},{rootMargin:"200px"});return t.observe(e.get(T)),()=>t.disconnect()}),e.user_pre_effect(()=>{_()&&G()});const X=t=>{var n,a,s;return(s=(a=(n=t.presentation)==null?void 0:n.assets)==null?void 0:a[0])!=null?s:Ee},P=t=>{var n,a,s;return(s=(a=t.displayName)!=null?a:(n=t.presentation)==null?void 0:n.displayName)!=null?s:""},U=t=>t.available==="true",$=t=>{e.get(S)||!U(t)||e.sendRedeemRewardRequested(P(t),t.id)},ee=t=>j(this,null,function*(){if(!(!d()||e.get(S))){e.set(S,t,!0);try{yield e.redeemReward({apiEndpoint:d(),userSession:p()},t),e.sendRedeemRewardSuccess(t),e.dispatchRedeemRewardButton(),q()}catch(n){e.sendRedeemRewardFailed(t,n)}finally{e.set(S,void 0)}}});e.user_effect(()=>{const t=n=>{var b;const{type:a,id:s,source:y}=(b=n.data)!=null?b:{};switch(a){case e.EVENT_TYPES.REDEEM_REWARD_CONFIRMED:if(e.get(E))break;s&&e.get(h).some(I=>I.id===s)&&ee(s);break;case e.EVENT_TYPES.BACK_BUTTON_CLICKED:y===e.SOURCE&&e.set(E,void 0);break}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)});const te=()=>e.get(h).length?i()("generalError"):i()("noContent"),ne=t=>{e.set(v,t,!0)},oe=t=>{e.sendRewardItemClicked(t.displayName||t.presentation.displayName,t.id)},V=t=>{e.set(E,t,!0),oe(t)},ae=t=>n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),V(t))};var ie={get apiEndpoint(){return d()},set apiEndpoint(t=""){d(t),e.flushSync()},get userSession(){return p()},set userSession(t=""){p(t),e.flushSync()},get locale(){return c()},set locale(t=""){c(t),e.flushSync()},get limitItem(){return r()},set limitItem(t=e.ITEMS_LIMIT_DEFAULT){r(t),e.flushSync()},get translationUrl(){return _()},set translationUrl(t){_(t),e.flushSync()}},D=Me(),re=e.child(D);{var se=t=>{ve.LoyaltyShopItem(t,{get itemId(){return e.get(E).id},get elevateReward(){return e.get(E)},get apiEndpoint(){return d()},get userSession(){return p()},get locale(){return c()}})},le=t=>{var n=xe();e.each(n,21,()=>Array(e.get(w)),e.index,(a,s,y,b)=>{var I=we();e.append(a,I)}),e.reset(n),e.append(t,n)},de=t=>{var n=Se(),a=e.only_child(n,!0);e.template_effect(s=>e.set_text(a,s),[()=>te()]),e.append(t,n)},pe=t=>{var n=Te(),a=e.first_child(n);e.each(a,21,()=>e.get(h),u=>u.id,(u,g)=>{var x=Ie();let H;var C=e.child(x),ge=e.user_derived(()=>ae(e.get(g))),K=e.only_child(C),Y=e.sibling(C,2),ue=e.only_child(Y,!0),Z=e.sibling(Y,2),me=e.only_child(Z),A=e.sibling(Z,2),he=e.only_child(A,!0);e.reset(x),e.template_effect((z,R,ye,fe,B,_e,be)=>{var J;H=e.set_class(x,1,"loyalty-shop__item",null,H,{"loyalty-shop__item--unavailable":z}),e.set_attribute(K,"src",R),e.set_attribute(K,"alt",ye),e.set_text(ue,fe),e.set_text(me,`${(J=e.get(g).points)!=null?J:""}
27
+ ${B!=null?B:""}`),A.disabled=_e,e.set_text(he,be)},[()=>!U(e.get(g)),()=>X(e.get(g)),()=>P(e.get(g)),()=>P(e.get(g)),()=>i()("tokens"),()=>!U(e.get(g))||e.get(S)===e.get(g).id,()=>i()("buyNow")]),e.delegated("click",C,()=>V(e.get(g))),e.delegated("keydown",C,function(...z){var R;(R=e.get(ge))==null||R.apply(this,z)}),e.delegated("click",A,()=>$(e.get(g))),e.append(u,x)}),e.reset(a);var s=e.sibling(a,2);{var y=u=>{e.LoyaltyPagination(u,{get offset(){return e.get(v)},get limit(){return e.get(w)},get total(){return e.get(L)},onPageChange:ne,get locale(){return c()}})};e.if_block(s,u=>{e.get(k)||u(y)})}var b=e.sibling(s,2);{var I=u=>{var g=Le();e.bind_this(g,x=>e.set(T,x),()=>e.get(T)),e.append(u,g)};e.if_block(b,u=>{e.get(k)&&e.get(h).length<e.get(L)&&u(I)})}e.append(t,n)};e.if_block(re,t=>{e.get(E)?t(se):e.get(N)&&e.get(h).length===0?t(le,1):!e.get(h).length||e.get(O)?t(de,2):t(pe,-1)})}e.reset(D),e.append(m,D);var ce=e.pop(ie);return f(),ce}e.delegate(["click","keydown"]);e.create_custom_element(F,{apiEndpoint:{},userSession:{},locale:{},limitItem:{},translationUrl:{}},[],[],{mode:"open"});function W(m,o){e.push(o,!0);let i=e.prop(o,"apiEndpoint",7,""),l=e.prop(o,"userSession",7,""),f=e.prop(o,"locale",7,""),d=e.prop(o,"limitItem",7,e.ITEMS_LIMIT_DEFAULT),p=e.prop(o,"translationUrl");var c={get apiEndpoint(){return i()},set apiEndpoint(r=""){i(r),e.flushSync()},get userSession(){return l()},set userSession(r=""){l(r),e.flushSync()},get locale(){return f()},set locale(r=""){f(r),e.flushSync()},get limitItem(){return d()},set limitItem(r=e.ITEMS_LIMIT_DEFAULT){d(r),e.flushSync()},get translationUrl(){return p()},set translationUrl(r){p(r),e.flushSync()}};return F(m,{get apiEndpoint(){return i()},get userSession(){return l()},get locale(){return f()},get limitItem(){return d()},get translationUrl(){return p()}}),e.pop(c)}customElements.define("loyalty-shop",e.create_custom_element(W,{apiEndpoint:{},userSession:{},locale:{},limitItem:{},translationUrl:{}},[],[]));const Re=Object.freeze(Object.defineProperty({__proto__:null,default:W},Symbol.toStringTag,{value:"Module"}));exports.LoyaltyShop=F;exports.LoyaltyShop_ce=Re;